PageSourceSearch

https://mtvpressi.fi/build/374.0cb0da63.js

js mtvpressi.fi collected 2026-09-25 08:03:31 UTC 1,398,375 bytes, 1 lines download raw bytes

vendor: 4,316 bytes, line 1
1(self.webpackChunkcs_pressweb=self.webpackChunkcs_pressweb||[]).push([[374],{13060(e,t,n){"use strict";n.r(t),n.d(t,{CSWebPlayerCore:()=>Gl,CSWebPlayerCoreError:()=>Cl,CSWebPlayerCoreTrackingHelper:()=>Hl});const r=Number.isFinite||function(e){return"number"==typeof e&&isFinite(e)},s=Number.isSafeInteger||function(e){return"number"==typeof e&&Math.abs(e)<=i},i=Number.MAX_SAFE_INTEGER||9007199254740991;let a=function(e){return e.NETWORK_ERROR="networkError",e.MEDIA_ERROR="mediaError",e.KEY_SYSTEM_ERROR="keySystemError",e.MUX_ERROR="muxError",e.OTHER_ERROR="otherError",e}({}),o=function(e){return e.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",e.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",e.KEY_SYSTEM_NO_SESSION="keySystemNoSession",e.KEY_SYSTEM_NO_CONFIGURED_LICENSE="keySystemNoConfiguredLicense",e.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",e.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED="keySystemServerCertificateRequestFailed",e.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED="keySystemServerCertificateUpdateFailed",e.KEY_SYSTEM_SESSION_UPDATE_FAILED="keySystemSessionUpdateFailed",e.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED="keySystemStatusOutputRestricted",e.KEY_SYSTEM_STATUS_INTERNAL_ERROR="keySystemStatusInternalError",e.KEY_SYSTEM_DESTROY_MEDIA_KEYS_ERROR="keySystemDestroyMediaKeysError",e.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR="keySystemDestroyCloseSessionError",e.KEY_SYSTEM_DESTROY_REMOVE_SESSION_ERROR="keySystemDestroyRemoveSessionError",e.MANIFEST_LOAD_ERROR="manifestLoadError",e.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",e.MANIFEST_PARSING_ERROR="manifestParsingError",e.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",e.LEVEL_EMPTY_ERROR="levelEmptyError",e.LEVEL_LOAD_ERROR="levelLoadError",e.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",e.LEVEL_PARSING_ERROR="levelParsingError",e.LEVEL_SWITCH_ERROR="levelSwitchError",e.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",e.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",e.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",e.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",e.FRAG_LOAD_ERROR="fragLoadError",e.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",e.FRAG_DECRYPT_ERROR="fragDecryptError",e.FRAG_PARSING_ERROR="fragParsingError",e.FRAG_GAP="fragGap",e.REMUX_ALLOC_ERROR="remuxAllocError",e.KEY_LOAD_ERROR="keyLoadError",e.KEY_LOAD_TIMEOUT="keyLoadTimeOut",e.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",e.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",e.BUFFER_APPEND_ERROR="bufferAppendError",e.BUFFER_APPENDING_ERROR="bufferAppendingError",e.BUFFER_STALLED_ERROR="bufferStalledError",e.BUFFER_FULL_ERROR="bufferFullError",e.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",e.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",e.ASSET_LIST_LOAD_ERROR="assetListLoadError",e.ASSET_LIST_LOAD_TIMEOUT="assetListLoadTimeout",e.ASSET_LIST_PARSING_ERROR="assetListParsingError",e.INTERSTITIAL_ASSET_ITEM_ERROR="interstitialAssetItemError",e.INTERNAL_EXCEPTION="internalException",e.INTERNAL_ABORTED="aborted",e.ATTACH_MEDIA_ERROR="attachMediaError",e.UNKNOWN="unknown",e}({}),l=function(e){return e.MEDIA_ATTACHING="hlsMediaAttaching",e.MEDIA_ATTACHED="hlsMediaAttached",e.MEDIA_DETACHING="hlsMediaDetaching",e.MEDIA_DETACHED="hlsMediaDetached",e.MEDIA_ENDED="hlsMediaEnded",e.STALL_RESOLVED="hlsStallResolved",e.BUFFER_RESET="hlsBufferReset",e.BUFFER_CODECS="hlsBufferCodecs",e.BUFFER_CREATED="hlsBufferCreated",e.BUFFER_APPENDING="hlsBufferAppending",e.BUFFER_APPENDED="hlsBufferAppended",e.BUFFER_EOS="hlsBufferEos",e.BUFFERED_TO_END="hlsBufferedToEnd",e.BUFFER_FLUSHING="hlsBufferFlushing",e.BUFFER_FLUSHED="hlsBufferFlushed",e.MANIFEST_LOADING="hlsManifestLoading",e.MANIFEST_LOADED="hlsManifestLoaded",e.MANIFEST_PARSED="hlsManifestParsed",e.LEVEL_SWITCHING="hlsLevelSwitching",e.LEVEL_SWITCHED="hlsLevelSwitched",e.LEVEL_LOADING="hlsLevelLoading",e.LEVEL_LOADED="hlsLevelLoaded",e.LEVEL_UPDATED="hlsLevelUpdated",e.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",e.LEVELS_UPDATED="hlsLevelsUpdated",e.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",e.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",e.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",e.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",e.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",e.AUDIO_TRACK_UPDATED="hlsAudioTrackUpdated",e.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUp
1dated",e.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",e.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",e.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",e.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",e.SUBTITLE_TRACK_UPDATED="hlsSubtitleTrackUpdated",e.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",e.CUES_PARSED="hlsCuesParsed",e.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",e.INIT_PTS_FOUND="hlsInitPtsFound",e.FRAG_LOADING="hlsFragLoading",e.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",e.FRAG_LOADED="hlsFragLoaded",e.FRAG_DECRYPTED="hlsFragDecrypted",e.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",e.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",e.FRAG_PARSING_METADATA="hlsFragParsingMetadata",e.FRAG_PARSED="hlsFragParsed",e.FRAG_BUFFERED="hlsFragBuffered",e.FRAG_CHANGED="hlsFragChanged",e.FPS_DROP="hlsFpsDrop",e.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",e.MAX_AUTO_LEVEL_UPDATED="hlsMaxAutoLevelUpdated",e.ERROR="hlsError",e.DESTROYING="hlsDestroying",e.KEY_LOADING="hlsKeyLoading",e.KEY_LOADED="hlsKeyLoaded",e.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",e.BACK_BUFFER_REACHED="hlsBackBufferReached",e.STEERING_MANIFEST_LOADED="hlsSteeringManifestLoaded",e.ASSET_LIST_LOADING="hlsAssetListLoading",e.ASSET_LIST_LOADED="hlsAssetListLoaded",e.INTERSTITIALS_UPDATED="hlsInterstitialsUpdated",e.INTERSTITIALS_BUFFERED_TO_BOUNDARY="hlsInterstitialsBufferedToBoundary",e.INTERSTITIAL_ASSET_PLAYER_CREATED="hlsInterstitialAssetPlayerCreated",e.INTERSTITIAL_STARTED="hlsInterstitialStarted",e.INTERSTITIAL_ASSET_STARTED="hlsInterstitialAssetStarted",e.INTERSTITIAL_ASSET_ENDED="hlsInterstitialAssetEnded",e.INTERSTITIAL_ASSET_ERROR="hlsInterstitialAssetError",e.INTERSTITIAL_ENDED="hlsInterstitialEnded",e.INTERSTITIALS_PRIMARY_RESUMED="hlsInterstitialsPrimaryResumed",e.PLAYOUT_LIMIT_REACHED="hlsPlayoutLimitReached",e.EVENT_CUE_ENTER="hlsEventCueEnter",e}({});var c="manifest",u="level",d="audioTrack",h="subtitleTrack",f="main",p="audio",g="subtitle";class m{constructor(e,t=0,n=0){this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=e,this.alpha_=e?Math.exp(Math.log(.5)/e):0,this.estimate_=t,this.totalWeight_=n}sample(e,t){const n=Math.pow(this.alpha_,e);this.estimate_=t*(1-n)+n*this.estimate_,this.totalWeight_+=e}getTotalWeight(){return this.totalWeight_}getEstimate(){if(this.alpha_){const e=1-Math.pow(this.alpha_,this.totalWeight_);if(e)return this.estimate_/e}return this.estimate_}}class _{constructor(e,t,n,r=100){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultTTFB_=void 0,this.ttfb_=void 0,this.defaultEstimate_=n,this.minWeight_=.001,this.minDelayMs_=50,this.slow_
vendor: 3,265 bytes, line 1
1=new m(e),this.fast_=new m(t),this.defaultTTFB_=r,this.ttfb_=new m(e)}update(e,t){const{slow_:n,fast_:r,ttfb_:s}=this;n.halfLife!==e&&(this.slow_=new m(e,n.getEstimate(),n.getTotalWeight())),r.halfLife!==t&&(this.fast_=new m(t,r.getEstimate(),r.getTotalWeight())),s.halfLife!==e&&(this.ttfb_=new m(e,s.getEstimate(),s.getTotalWeight()))}sample(e,t){const n=(e=Math.max(e,this.minDelayMs_))/1e3,r=8*t/n;this.fast_.sample(n,r),this.slow_.sample(n,r)}sampleTTFB(e){const t=e/1e3,n=Math.sqrt(2)*Math.exp(-Math.pow(t,2)/2);this.ttfb_.sample(n,Math.max(e,5))}canEstimate(){return this.fast_.getTotalWeight()>=this.minWeight_}getEstimate(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_}getEstimateTTFB(){return this.ttfb_.getTotalWeight()>=this.minWeight_?this.ttfb_.getEstimate():this.defaultTTFB_}get defaultEstimate(){return this.defaultEstimate_}destroy(){}}function T(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function E(){return E=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},E.apply(null,arguments)}function y(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function S(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?y(Object(n),!0).forEach((function(t){T(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):y(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}class v{constructor(e,t){this.trace=void 0,this.debug=void 0,this.log=void 0,this.warn=void 0,this.info=void 0,this.error=void 0;const n=`[${e}]:`;this.trace=b,this.debug=t.debug.bind(null,n),this.log=t.log.bind(null,n),this.warn=t.warn.bind(null,n),this.info=t.info.bind(null,n),this.error=t.error.bind(null,n)}}const b=function(){},I={trace:b,debug:b,log:b,warn:b,info:b,error:b};function A(){return E({},I)}function R(e,t,n){return t[e]?t[e].bind(t):function(e,t){const n=self.console[e];return n?n.bind(self.console,`${t?"["+t+"] ":""}[${e}] >`):b}(e,n)}const C=A();const k=C;function L(e=!0){if("undefined"==typeof self)return;return(e||!self.MediaSource)&&self.ManagedMediaSource||self.MediaSource||self.WebKitMediaSource}function O(e,t){const n=Object.keys(e),r=Object.keys(t),s=n.length,i=r.length;return!s||!i||s===i&&!n.some((e=>-1===r.indexOf(e)))}function N(e,t=!1){if("undefined"!=typeof TextDecoder){const n=new TextDecoder("utf-8").decode(e);if(t){const e=n.indexOf("\0");return-1!==e?n.substring(0,e):n}return n.replace(/\0/g,"")}const n=e.length;let r,s,i,a="",o=0;for(;o<n;){if(r=e[o++],0===r&&t)return a;
vendor: 5,428 bytes, line 1
1if(0!==r&&3!==r)switch(r>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:a+=String.fromCharCode(r);break;case 12:case 13:s=e[o++],a+=String.fromCharCode((31&r)<<6|63&s);break;case 14:s=e[o++],i=e[o++],a+=String.fromCharCode((15&r)<<12|(63&s)<<6|63&i)}}return a}function w(e){let t="";for(let n=0;n<e.length;n++){let r=e[n].toString(16);r.length<2&&(r="0"+r),t+=r}return t}function P(e){return Uint8Array.from(e.replace(/^0x/,"").replace(/([\da-fA-F]{2}) ?/g,"0x$1 ").replace(/ +$/,"").split(" ")).buffer}function M(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var D,x={exports:{}};var U,B,F,$,G,H=(D||(D=1,U=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,B=/^(?=([^\/?#]*))\1([^]*)$/,F=/(?:\/|^)\.(?=\/)/g,$=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,x.exports=G={buildAbsoluteURL:function(e,t,n){if(n=n||{},e=e.trim(),!(t=t.trim())){if(!n.alwaysNormalize)return e;var r=G.parseURL(e);if(!r)throw new Error("Error trying to parse base URL.");return r.path=G.normalizePath(r.path),G.buildURLFromParts(r)}var s=G.parseURL(t);if(!s)throw new Error("Error trying to parse relative URL.");if(s.scheme)return n.alwaysNormalize?(s.path=G.normalizePath(s.path),G.buildURLFromParts(s)):t;var i=G.parseURL(e);if(!i)throw new Error("Error trying to parse base URL.");if(!i.netLoc&&i.path&&"/"!==i.path[0]){var a=B.exec(i.path);i.netLoc=a[1],i.path=a[2]}i.netLoc&&!i.path&&(i.path="/");var o={scheme:i.scheme,netLoc:s.netLoc,path:null,params:s.params,query:s.query,fragment:s.fragment};if(!s.netLoc&&(o.netLoc=i.netLoc,"/"!==s.path[0]))if(s.path){var l=i.path,c=l.substring(0,l.lastIndexOf("/")+1)+s.path;o.path=G.normalizePath(c)}else o.path=i.path,s.params||(o.params=i.params,s.query||(o.query=i.query));return null===o.path&&(o.path=n.alwaysNormalize?G.normalizePath(s.path):s.path),G.buildURLFromParts(o)},parseURL:function(e){var t=U.exec(e);return t?{scheme:t[1]||"",netLoc:t[2]||"",path:t[3]||"",params:t[4]||"",query:t[5]||"",fragment:t[6]||""}:null},normalizePath:function(e){for(e=e.split("").reverse().join("").replace(F,"");e.length!==(e=e.replace($,"")).length;);return e.split("").reverse().join("")},buildURLFromParts:function(e){return e.scheme+e.netLoc+e.path+e.params+e.query+e.fragment}}),x.exports);class j{constructor(){this.aborted=!1,this.loaded=0,this.retry=0,this.total=0,this.chunkCount=0,this.bwEstimate=0,this.loading={start:0,first:0,end:0},this.parsing={start:0,end:0},this.buffering={start:0,first:0,end:0}}}var W="audio",K="video",V="audiovideo";class q{constructor(e){this._byteRange=null,this._url=null,this._stats=null,this._streams=null,this.base=void 0,this.relurl=void 0,"string"==typeof e&&(e={url:e}),this.base=e,function(e,t){const n=X(e,t);n&&(n.enumerable=!0,Object.defineProperty(e,t,n))}(this,"stats")}setByteRange(e,t){const n=e.split("@",2);let r;r=1===n.length?(null==t?void 0:t.byteRangeEndOffset)||0:parseInt(n[1]),this._byteRange=[r,parseInt(n[0])+r]}get baseurl(){return this.base.url}get byteRange(){return null===this._byteRange?[]:this._byteRange}get byteRangeStartOffset(){return this.byteRange[0]}get byteRangeEndOffset(){return this.byteRange[1]}get elementaryStreams(){return null===this._streams&&(this._streams={[W]:null,[K]:null,[V]:null}),this._streams}set elementaryStreams(e){this._streams=e}get hasStats(){return null!==this._stats}get hasStreams(){return null!==this._streams}get stats(){return null===this._stats&&(this._stats=new j),this._stats}set stats(e){this._stats=e}get url(){return!this._url&&this.baseurl&&this.relurl&&(this._url=H.buildAbsoluteURL(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""}set url(e){this._url=e}clearElementaryStreamInfo(){const{elementaryStreams:e}=this;e[W]=null,e[K]=null,e[V]=null}}function Y(e){return"initSegment"!==e.sn}class z extends q{constructor(e,t){super(t),this._decryptdata=null,this._programDateTime=null,this._ref=null,this._bitrate=void 0,this.rawProgramDateTime=null,this.tagList=[],this.duration=0,this.sn=0,this.levelkeys=void 0,this.type=void 0,this.loader=null,this.keyLoader=null,this.level=-1,this.cc=0,this.startPTS=void 0,this.endPTS=void 0,this.startDTS=void 0,this.endDTS=void 0,this.start=0,this.playlistOffset=0,this.deltaPTS=void 0,this.maxStartPTS=void 0,this.minEndPTS=void 0,this.data=void 0,this.bitrateTest=!1,this.title=null,this.initSegment=null,this.endList=void 0,this.gap=void 0,this.urlId=0,this.type=e}get byteLength(){if(this.hasStats){const e=this.stats.total;if(e)return e}if(this.byteRange.length){const e=this.byteRange[0],t=this.byteRange[1];if(r(e)&&r(t))return t-e}return null}get bitrate(){return this.byteLength?8*this.byteLength/this.duration:this._bitrate?this._bitrate:null}set bitrate(e){this._bitrate=e}get decryptdata(){var e;const{levelkeys:t}=this;if(!t||t.NONE)return null;if(t.identity)this._decryptdata||(this._decryptdata=t.identity.getDecryptData(this.sn));else if(null==(e=this._decryptdata)||!e.keyId){const e=Object.keys(t);if(1===e.length){const n=this._decryptdata=t[e[0]]||null;n&&(this._decryptdata=n.getDecryptData(this.sn,t))}}return this._decryptdata}get end(){return this.start+this.duration}get endProgramDateTime(){if(null===this.programDateTime)return null;const e=r(this.duration)?this.duration:0;return this.programDateTime+1e3*e}get encrypted(){var e;if(null!=(e=this._decryptdata)&&e.encrypted)return!0;
vendor: 4,251 bytes, line 1
1if(this.levelkeys){var t;const e=Object.keys(this.levelkeys),n=e.length;if(n>1||1===n&&null!=(t=this.levelkeys[e[0]])&&t.encrypted)return!0}return!1}get programDateTime(){return null===this._programDateTime&&this.rawProgramDateTime&&(this.programDateTime=Date.parse(this.rawProgramDateTime)),this._programDateTime}set programDateTime(e){r(e)?this._programDateTime=e:this._programDateTime=this.rawProgramDateTime=null}get ref(){return Y(this)?(this._ref||(this._ref={base:this.base,start:this.start,duration:this.duration,sn:this.sn,programDateTime:this.programDateTime}),this._ref):null}addStart(e){this.setStart(this.start+e)}setStart(e){this.start=e,this._ref&&(this._ref.start=e)}setDuration(e){this.duration=e,this._ref&&(this._ref.duration=e)}setKeyFormat(e){const t=this.levelkeys;if(t){var n;const r=t[e];!r||null!=(n=this._decryptdata)&&n.keyId||(this._decryptdata=r.getDecryptData(this.sn,t))}}abortRequests(){var e,t;null==(e=this.loader)||e.abort(),null==(t=this.keyLoader)||t.abort()}setElementaryStreamInfo(e,t,n,r,s,i=!1){const{elementaryStreams:a}=this,o=a[e];o?(o.startPTS=Math.min(o.startPTS,t),o.endPTS=Math.max(o.endPTS,n),o.startDTS=Math.min(o.startDTS,r),o.endDTS=Math.max(o.endDTS,s)):a[e]={startPTS:t,endPTS:n,startDTS:r,endDTS:s,partial:i}}}class J extends q{constructor(e,t,n,r,s){super(n),this.fragOffset=0,this.duration=0,this.gap=!1,this.independent=!1,this.relurl=void 0,this.fragment=void 0,this.index=void 0,this.duration=e.decimalFloatingPoint("DURATION"),this.gap=e.bool("GAP"),this.independent=e.bool("INDEPENDENT"),this.relurl=e.enumeratedString("URI"),this.fragment=t,this.index=r;const i=e.enumeratedString("BYTERANGE");i&&this.setByteRange(i,s),s&&(this.fragOffset=s.fragOffset+s.duration)}get start(){return this.fragment.start+this.fragOffset}get end(){return this.start+this.duration}get loaded(){const{elementaryStreams:e}=this;return!!(e.audio||e.video||e.audiovideo)}}function X(e,t){const n=Object.getPrototypeOf(e);if(n){const e=Object.getOwnPropertyDescriptor(n,t);return e||X(n,t)}}const Q=Math.pow(2,32)-1,Z=[].push,ee={video:1,audio:2,id3:3,text:4};function te(e){return String.fromCharCode.apply(null,e)}function ne(e,t){const n=e[t]<<8|e[t+1];return n<0?65536+n:n}function re(e,t){const n=ie(e,t);return n<0?4294967296+n:n}function se(e,t){let n=re(e,t);return n*=Math.pow(2,32),n+=re(e,t+4),n}function ie(e,t){return e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3]}function ae(e,t){const n=[];if(!t.length)return n;const r=e.byteLength;for(let s=0;s<r;){const i=re(e,s),a=i>1?s+i:r;if(te(e.subarray(s+4,s+8))===t[0])if(1===t.length)n.push(e.subarray(s+8,a));else{const r=ae(e.subarray(s+8,a),t.slice(1));r.length&&Z.apply(n,r)}s=a}return n}function oe(e){const t=[],n=e[0];let r=8;const s=re(e,r);r+=4;let i=0,a=0;0===n?(i=re(e,r),a=re(e,r+4),r+=8):(i=se(e,r),a=se(e,r+8),r+=16),r+=2;let o=e.length+a;const l=ne(e,r);r+=2;for(let n=0;n<l;n++){let n=r;const i=re(e,n);n+=4;const a=2147483647&i;if(1===(2147483648&i)>>>31)return k.warn("SIDX has hierarchical references (not supported)"),null;const l=re(e,n);n+=4,t.push({referenceSize:a,subsegmentDuration:l,info:{duration:l/s,start:o,end:o+a-1}}),o+=a,n+=4,r=n}return{earliestPresentationTime:i,timescale:s,version:n,referencesCount:l,references:t}}function le(e){const t=[],n=ae(e,["moov","trak"]);for(let e=0;e<n.length;e++){const r=n[e],s=ae(r,["tkhd"])[0];if(s){let e=s[0];const n=re(s,0===e?12:20),i=ae(r,["mdia","mdhd"])[0];if(i){e=i[0];const s=re(i,0===e?12:20),a=ae(r,["mdia","hdlr"])[0];if(a){const e=te(a.subarray(8,12)),i={soun:W,vide:K}[e],o=ce(ae(r,["mdia","minf","stbl","stsd"])[0]);i?(t[n]={timescale:s,type:i,stsd:o},t[i]=S({timescale:s,id:n},o)):t[n]={timescale:s,type:e,stsd:o}}}}}return ae(e,["moov","mvex","trex"]).forEach((e=>{const n=re(e,4),r=t[n];r&&(r.default={duration:re(e,12),flags:re(e,20)})})),t}function ce(e){const t=e.subarray(8),n=t.subarray(86),r=te(t.subarray(4,8));let s,i=r;const a="enca"===r||"encv"===r;if(a){const e=ae(t,[r])[0];ae(e.subarray("enca"===r?28:78),["sinf"]).forEach((e=>{const t=ae(e,["schm"])[0];if(t){const n=te(t.subarray(4,8));if("cbcs"===n||"cenc"===n){const t=ae(e,["frma"])[0];t&&(i=te(t))}}}))}const o=i;switch(i){case"avc1":case"avc2":case"avc3":case"avc4":{const e=ae(n,["avcC"])[0];e&&e.length>
vendor: 6,597 bytes, line 1
13&&(i+="."+he(e[1])+he(e[2])+he(e[3]),s=ue("avc1"===o?"dva1":"dvav",n));break}case"mp4a":{const e=ae(t,[r])[0],n=ae(e.subarray(28),["esds"])[0];if(n&&n.length>7){let e=4;if(3!==n[e++])break;e=de(n,e),e+=2;const t=n[e++];if(128&t&&(e+=2),64&t&&(e+=n[e++]),4!==n[e++])break;e=de(n,e);const r=n[e++];if(64!==r)break;if(i+="."+he(r),e+=12,5!==n[e++])break;e=de(n,e);const s=n[e++];let a=(248&s)>>3;31===a&&(a+=1+((7&s)<<3)+((224&n[e])>>5)),i+="."+a}break}case"hvc1":case"hev1":{const e=ae(n,["hvcC"])[0];if(e&&e.length>12){const t=e[1],n=["","A","B","C"][t>>6],r=31&t,s=re(e,2),a=(32&t)>>5?"H":"L",o=e[12],l=e.subarray(6,12);i+="."+n+r,i+="."+function(e){let t=0;for(let n=0;n<32;n++)t|=(e>>n&1)<<31-n;return t>>>0}(s).toString(16).toUpperCase(),i+="."+a+o;let c="";for(let e=l.length;e--;){const t=l[e];if(t||c){c="."+t.toString(16).toUpperCase()+c}}i+=c}s=ue("hev1"==o?"dvhe":"dvh1",n);break}case"dvh1":case"dvhe":case"dvav":case"dva1":case"dav1":i=ue(i,n)||i;break;case"vp09":{const e=ae(n,["vpcC"])[0];if(e&&e.length>6){const t=e[4],n=e[5],r=e[6]>>4&15;i+="."+fe(t)+"."+fe(n)+"."+fe(r)}break}case"av01":{const e=ae(n,["av1C"])[0];if(e&&e.length>2){const t=e[1]>>>5,r=31&e[1],a=e[2]>>>7?"H":"M",o=(64&e[2])>>6,l=(32&e[2])>>5,c=2===t&&o?l?12:10:o?10:8,u=(16&e[2])>>4,d=(8&e[2])>>3,h=(4&e[2])>>2,f=3&e[2],p=1,g=1,m=1,_=0;i+="."+t+"."+fe(r)+a+"."+fe(c)+"."+u+"."+d+h+f+"."+fe(p)+"."+fe(g)+"."+fe(m)+"."+_,s=ue("dav1",n)}break}}return{codec:i,encrypted:a,supplemental:s}}function ue(e,t){const n=ae(t,["dvvC"]),r=n.length?n[0]:ae(t,["dvcC"])[0];if(r){const t=r[2]>>1&127,n=r[2]<<5&32|r[3]>>3&31;return e+"."+fe(t)+"."+fe(n)}}function de(e,t){const n=t+5;for(;128&e[t++]&&t<n;);return t}function he(e){return("0"+e.toString(16).toUpperCase()).slice(-2)}function fe(e){return(e<10?"0":"")+e}function pe(e,t){ae(e,["moov","trak"]).forEach((e=>{const n=ae(e,["mdia","minf","stbl","stsd"])[0];if(!n)return;const r=n.subarray(8);let s=ae(r,["enca"]);const i=s.length>0;i||(s=ae(r,["encv"])),s.forEach((e=>{ae(i?e.subarray(28):e.subarray(78),["sinf"]).forEach((e=>{const n=ge(e);n&&t(n,i)}))}))}))}function ge(e){const t=ae(e,["schm"])[0];if(t){const n=te(t.subarray(4,8));if("cbcs"===n||"cenc"===n){const t=ae(e,["schi","tenc"])[0];if(t)return t}}}function me(e,t){const n=new Uint8Array(e.length+t.length);return n.set(e),n.set(t,e.length),n}function _e(e,t){const n=[],r=t.samples,s=t.timescale,i=t.id;let a=!1;return ae(r,["moof"]).map((o=>{const l=o.byteOffset-8;ae(o,["traf"]).map((o=>{const c=ae(o,["tfdt"]).map((e=>{const t=e[0];let n=re(e,4);return 1===t&&(n*=Math.pow(2,32),n+=re(e,8)),n/s}))[0];return void 0!==c&&(e=c),ae(o,["tfhd"]).map((c=>{const u=re(c,4),d=16777215&re(c,0);let h=0;const f=!!(16&d);let p=0;const g=!!(32&d);let m=8;u===i&&(!!(1&d)&&(m+=8),!!(2&d)&&(m+=4),!!(8&d)&&(h=re(c,m),m+=4),f&&(p=re(c,m),m+=4),g&&(m+=4),"video"===t.type&&(a=Te(t.codec)),ae(o,["trun"]).map((i=>{const o=i[0],c=16777215&re(i,0),u=!!(1&c);let d=0;const f=!!(4&c),g=!!(256&c);let m=0;const _=!!(512&c);let T=0;const E=!!(1024&c),y=!!(2048&c);let S=0;const v=re(i,4);let b=8;u&&(d=re(i,b),b+=4),f&&(b+=4);let I=d+l;for(let l=0;l<v;l++){if(g?(m=re(i,b),b+=4):m=h,_?(T=re(i,b),b+=4):T=p,E&&(b+=4),y&&(S=0===o?re(i,b):ie(i,b),b+=4),t.type===K){let t=0;for(;t<T;){const i=re(r,I);if(I+=4,Ee(a,r[I])){ye(r.subarray(I,I+i),a?2:1,e+S/s,n)}I+=i,t+=i+4}}e+=m/s}})))}))}))})),n}function Te(e){if(!e)return!1;const t=e.substring(0,4);return"hvc1"===t||"hev1"===t||"dvh1"===t||"dvhe"===t}function Ee(e,t){if(e){const e=t>>1&63;return 39===e||40===e}return 6===(31&t)}function ye(e,t,n,r){const s=Se(e);let i=0;i+=t;let a=0,o=0,l=0;for(;i<s.length;){a=0;do{if(i>=s.length)break;l=s[i++],a+=l}while(255===l);o=0;do{if(i>=s.length)break;l=s[i++],o+=l}while(255===l);const e=s.length-i;let t=i;if(o<e)i+=o;else if(o>e){k.error(`Malformed SEI payload. ${o} is too small, only ${e} bytes left to parse.`);break}if(4===a){if(181===s[t++]){const e=ne(s,t);if(t+=2,49===e){const e=re(s,t);if(t+=4,1195456820===e){const e=s[t++];if(3===e){const i=s[t++],o=64&i,l=o?2+3*(31&i):0,c=new Uint8Array(l);if(o){c[0]=i;for(let e=1;e<l;e++)c[e]=s[t++]}r.push({type:e,payloadType:a,pts:n,bytes:c})}}}}}else if(5===a&&o>16){const e=[];for(let n=0;n<16;n++){const r=s[t++].toString(16);e.push(1==r.length?"0"+r:r),3!==n&&5!==n&&7!==n&&9!==n||e.push("-")}const i=o-16,l=new Uint8Array(i);for(let e=0;e<i;e++)l[e]=s[t++];r.push({payloadType:a,pts:n,uuid:e.join(""),userData:N(l),userDataBytes:l})}}}function Se(e){const t=e.byteLength,n=[];let r=1;for(;r<t-2;)0===e[r]&&0===e[r+1]&&3===e[r+2]?(n.push(r+2),r+=2):r++;if(0===n.length)return e;const s=t-n.length,i=new Uint8Array(s);let a=0;for(r=0;r<s;a++,r++)a===n[0]&&(a++,n.shift()),i[r]=e[a];return i}function ve(e,t,n){if(16!==e.byteLength)throw new RangeError("Invalid system id");let r,s,i;r=0,s=new Uint8Array,i=new Uint8Array;const a=new Uint8Array(4);return n.byteLength>0&&new DataView(a.buffer).setUint32(0,n.byteLength,!1),function(e,...t){const n=t.length;let r=8,s=n;for(;s--;)r+=t[s].byteLength;const i=new Uint8Array(r);for(i[0]=r>>24&255,i[1]=r>>16&255,i[2]=r>>8&255,i[3]=255&r,i.set(e,4),s=0,r=8;s<n;s++)i.set(t[s],r),r+=t[s].byteLength;return i}([112,115,115,104],new Uint8Array([0,0,0,0]),e,i,s,a,n)}function be(e){const t=e.getUint32(0),n=e.byteOffset,r=e.byteLength;if(r<t)return{offset:n,size:r};if(1886614376!==e.getUint32(4))return{offset:n,size:t};const s=e.getUint32(8)>>>24;if(0!==s&&1!==s)return{offset:n,size:t};const i=e.buffer,a=w(new Uint8Array(i,n+12,16));let o=null,l=null,c=0;if(0===s)c=28;else{const s=e.getUint32(28);if(!s||r<32+16*s)return{offset:n,size:t};o=[];for(let e=0;e<s;e++)o.push(new Uint8Array(i,n+32+16*e,16));c=32+16*s}if(!c)return{offset:n,size:t};const u=e.getUint32(c);return t-32<u?{offset:n,size:t}:(l=new Uint8Array(i,n+c+4,u),{version:s,systemId:a,kids:o,data:l,offset:n,size:t})}const Ie=()=>/\(Windows.+Firefox\//i.test(navigator.userAgent),Ae={audio:{a3ds:1,"ac-3":.95,"ac-4":1,alac:.9,alaw:1,dra1:1,"dts+":1,"dts-":1,dtsc:1,dtse:1,dtsh:1,"ec-3":.9,enca:1,fLaC:.9,flac:.9,FLAC:.9,g719:1,g726:1,m4ae:1,mha1:1,mha2:1,mhm1:1,mhm2:1,mlpa:1,mp4a:1,"raw ":1,Opus:1,opus:1,samr:1,sawb:1,sawp:1,sevc:1,sqcp:1,ssmv:1,twos:1,ulaw:1},video:{avc1:1,avc2:1,avc3:1,avc4:1,avcp:1,av01:.8,dav1:.8,drac:1,dva1:1,dvav:1,dvh1:.7,dvhe:.7,encv:1,hev1:.75,hvc1:.75,mjp2:1,mp4v:1,mvc1:1,mvc2:1,mvc3:1,mvc4:1,resv:1,rv60:1,s263:1,svc1:1,svc2:1,"vc-1":1,vp08:1,vp09:.9},text:{stpp:1,wvtt:1}};function Re(e,t){const n=Ae[t];return!!n&&!!n[e.slice(0,4)]}function Ce(e,t,n=!0){return!e.split(",").some((e=>!ke(e,t,n)))}function ke(e,t,n=!0){var r;const s=L(n);
vendor: 4,275 bytes, line 1
1return null!=(r=null==s?void 0:s.isTypeSupported(Le(e,t)))&&r}function Le(e,t){return`${t}/mp4;codecs=${e}`}function Oe(e){if(e){const t=e.substring(0,4);return Ae.video[t]}return 2}function Ne(e){const t=Ie();return e.split(",").reduce(((e,n)=>{const r=t&&Te(n)?9:Ae.video[n];return r?(2*r+e)/(e?3:2):(Ae.audio[n]+e)/(e?2:1)}),0)}const we={};const Pe=/flac|opus|mp4a\.40\.34/i;function Me(e,t=!0){return e.replace(Pe,(e=>function(e,t=!0){if(we[e])return we[e];const n={flac:["flac","fLaC","FLAC"],opus:["opus","Opus"],"mp4a.40.34":["mp3"]}[e];for(let s=0;s<n.length;s++){var r;if(ke(n[s],"audio",t))return we[e]=n[s],n[s];if("mp3"===n[s]&&null!=(r=L(t))&&r.isTypeSupported("audio/mpeg"))return""}return e}(e.toLowerCase(),t)))}function De(e,t){if(e&&(e.length>4||-1!==["ac-3","ec-3","alac","fLaC","Opus"].indexOf(e))&&(xe(e,"audio")||xe(e,"video")))return e;if(t){const n=t.split(",");if(n.length>1){if(e)for(let t=n.length;t--;)if(n[t].substring(0,4)===e.substring(0,4))return n[t];return n[0]}}return t||e}function xe(e,t){return Re(e,t)&&ke(e,t)}function Ue(e){if(e.startsWith("av01.")){const t=e.split("."),n=["0","111","01","01","01","0"];for(let e=t.length;e>4&&e<10;e++)t[e]=n[e-4];return t.join(".")}return e}function Be(e){const t=L(e)||{isTypeSupported:()=>!1};return{mpeg:t.isTypeSupported("audio/mpeg"),mp3:t.isTypeSupported('audio/mp4; codecs="mp3"'),ac3:t.isTypeSupported('audio/mp4; codecs="ac-3"')}}function Fe(e){return e.replace(/^.+codecs=["']?([^"']+).*$/,"$1")}const $e={supported:!1,smooth:!1,powerEfficient:!1},Ge={supported:!0,configurations:[],decodingInfoResults:[{supported:!0,powerEfficient:!0,smooth:!0}]};function He(e,t){return{supported:!1,configurations:t,decodingInfoResults:[$e],error:e}}function je(e,t,n,s,i,a){const o=e.videoCodec,l=e.audioCodec?e.audioGroups:null,c=null==a?void 0:a.audioCodec,u=null==a?void 0:a.channels,d=u?parseInt(u):c?1/0:2;let h=null;if(null!=l&&l.length)try{h=1===l.length&&l[0]?t.groups[l[0]].channels:l.reduce(((e,n)=>{if(n){const r=t.groups[n];if(!r)throw new Error(`Audio track group ${n} not found`);Object.keys(r.channels).forEach((t=>{e[t]=(e[t]||0)+r.channels[t]}))}return e}),{2:0})}catch(e){return!0}return void 0!==o&&(o.split(",").some((e=>Te(e)))||e.width>1920&&e.height>1088||e.height>1920&&e.width>1088||e.frameRate>Math.max(s,30)||"SDR"!==e.videoRange&&e.videoRange!==n||e.bitrate>Math.max(i,8e6))||!!h&&r(d)&&Object.keys(h).some((e=>parseInt(e)>d))}function We(e,t,n,r={}){const s=e.videoCodec;if(!s&&!e.audioCodec||!n)return Promise.resolve(Ge);const i=[],a=function(e){var t;const n=null==(t=e.videoCodec)?void 0:t.split(","),r=Ve(e),s=e.width||640,i=e.height||480,a=e.frameRate||30,o=e.videoRange.toLowerCase();return n?n.map((e=>{const t={contentType:Le(Ue(e),"video"),width:s,height:i,bitrate:r,framerate:a};return"sdr"!==o&&(t.transferFunction=o),t})):[]}(e),o=a.length,l=function(e,t,n){var r;const s=null==(r=e.audioCodec)?void 0:r.split(","),i=Ve(e);if(s&&e.audioGroups)return e.audioGroups.reduce(((e,r)=>{var a;const o=r?null==(a=t.groups[r])?void 0:a.tracks:null;return o?o.reduce(((e,t)=>{if(t.groupId===r){const r=parseFloat(t.channels||"");s.forEach((t=>{const s={contentType:Le(t,"audio"),bitrate:n?Ke(t,i):i};r&&(s.channels=""+r),e.push(s)}))}return e}),e):e}),[]);return[]}(e,t,o>0),c=l.length;for(let e=o||1*c||1;e--;){const t={type:"media-source"};if(o&&(t.video=a[e%o]),c){t.audio=l[e%c];const n=t.audio.bitrate;t.video&&n&&(t.video.bitrate-=n)}i.push(t)}if(s){const e=navigator.userAgent;if(s.split(",").some((e=>Te(e)))&&Ie())return Promise.resolve(He(new Error(`Overriding Windows Firefox HEVC MediaCapabilities result based on user-agent string: (${e})`),i))}return Promise.all(i.map((e=>{const t=function(e){let t="";const{audio:n,video:r}=e;if(r){t+=`${Fe(r.contentType)}_r${r.height}x${r.width}f${Math.ceil(r.framerate)}${r.transferFunction||"sd"}_${Math.ceil(r.bitrate/1e5)}`}if(n){t+=`${r?"_":""}${Fe(n.contentType)}_c${n.channels}`}return t}(e);return r[t]||(r[t]=n.decodingInfo(e))}))).then((e=>({supported:!e.some((e=>!e.supported)),configurations:i,decodingInfoResults:e}))).catch((e=>({supported:!1,configurations:i,decodingInfoResults:[],error:e})))}function Ke(e,t){if(t<=1)return 1;let n=128e3;return"ec-3"===e?n=768e3:"ac-3"===e&&(n=64e4),Math.min(t/2,n)}
vendor: 13,457 bytes, line 1
1function Ve(e){return 1e3*Math.ceil(Math.max(.9*e.bitrate,e.averageBitrate)/1e3)||1}const qe=["NONE","TYPE-0","TYPE-1",null];const Ye=["SDR","PQ","HLG"];var ze="",Je="YES",Xe="v2";function Qe(e){const{canSkipUntil:t,canSkipDateRanges:n,age:r}=e;return t&&r<t/2?n?Xe:Je:ze}class Ze{constructor(e,t,n){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=e,this.part=t,this.skip=n}addDirectives(e){const t=new self.URL(e);return void 0!==this.msn&&t.searchParams.set("_HLS_msn",this.msn.toString()),void 0!==this.part&&t.searchParams.set("_HLS_part",this.part.toString()),this.skip&&t.searchParams.set("_HLS_skip",this.skip),t.href}}class et{constructor(e){if(this._attrs=void 0,this.audioCodec=void 0,this.bitrate=void 0,this.codecSet=void 0,this.url=void 0,this.frameRate=void 0,this.height=void 0,this.id=void 0,this.name=void 0,this.supplemental=void 0,this.videoCodec=void 0,this.width=void 0,this.details=void 0,this.fragmentError=0,this.loadError=0,this.loaded=void 0,this.realBitrate=0,this.supportedPromise=void 0,this.supportedResult=void 0,this._avgBitrate=0,this._audioGroups=void 0,this._subtitleGroups=void 0,this._urlId=0,this.url=[e.url],this._attrs=[e.attrs],this.bitrate=e.bitrate,e.details&&(this.details=e.details),this.id=e.id||0,this.name=e.name,this.width=e.width||0,this.height=e.height||0,this.frameRate=e.attrs.optionalFloat("FRAME-RATE",0),this._avgBitrate=e.attrs.decimalInteger("AVERAGE-BANDWIDTH"),this.audioCodec=e.audioCodec,this.videoCodec=e.videoCodec,this.codecSet=[e.videoCodec,e.audioCodec].filter((e=>!!e)).map((e=>e.substring(0,4))).join(","),"supplemental"in e){var t;this.supplemental=e.supplemental;const n=null==(t=e.supplemental)?void 0:t.videoCodec;n&&n!==e.videoCodec&&(this.codecSet+=`,${n.substring(0,4)}`)}this.addGroupId("audio",e.attrs.AUDIO),this.addGroupId("text",e.attrs.SUBTITLES)}get maxBitrate(){return Math.max(this.realBitrate,this.bitrate)}get averageBitrate(){return this._avgBitrate||this.realBitrate||this.bitrate}get attrs(){return this._attrs[0]}get codecs(){return this.attrs.CODECS||""}get pathwayId(){return this.attrs["PATHWAY-ID"]||"."}get videoRange(){return this.attrs["VIDEO-RANGE"]||"SDR"}get score(){return this.attrs.optionalFloat("SCORE",0)}get uri(){return this.url[0]||""}hasAudioGroup(e){return tt(this._audioGroups,e)}hasSubtitleGroup(e){return tt(this._subtitleGroups,e)}get audioGroups(){return this._audioGroups}get subtitleGroups(){return this._subtitleGroups}addGroupId(e,t){if(t)if("audio"===e){let e=this._audioGroups;e||(e=this._audioGroups=[]),-1===e.indexOf(t)&&e.push(t)}else if("text"===e){let e=this._subtitleGroups;e||(e=this._subtitleGroups=[]),-1===e.indexOf(t)&&e.push(t)}}get urlId(){return 0}set urlId(e){}get audioGroupIds(){return this.audioGroups?[this.audioGroupId]:void 0}get textGroupIds(){return this.subtitleGroups?[this.textGroupId]:void 0}get audioGroupId(){var e;return null==(e=this.audioGroups)?void 0:e[0]}get textGroupId(){var e;return null==(e=this.subtitleGroups)?void 0:e[0]}addFallback(){}}function tt(e,t){return!(!t||!e)&&-1!==e.indexOf(t)}function nt(e,t){let n=!1,r=[];if(e&&(n="SDR"!==e,r=[e]),t){r=t.allowedVideoRanges||Ye.slice(0);const e="SDR"!==r.join("")&&!t.videoCodec;n=void 0!==t.preferHDR?t.preferHDR:e&&function(){if("function"==typeof matchMedia){const e=matchMedia("(dynamic-range: high)"),t=matchMedia("bad query");if(e.media!==t.media)return!0===e.matches}return!1}(),n||(r=["SDR"])}return{preferHDR:n,allowedVideoRanges:r}}const rt=(e,t)=>JSON.stringify(e,(e=>{const t=new WeakSet;return(n,r)=>{if(e&&(r=e(n,r)),"object"==typeof r&&null!==r){if(t.has(r))return;t.add(r)}return r}})(t));function st(e,t){k.log(`[abr] start candidates with "${e}" ignored because ${t}`)}function it(e){return e.reduce(((e,t)=>{let n=e.groups[t.groupId];n||(n=e.groups[t.groupId]={tracks:[],channels:{2:0},hasDefault:!1,hasAutoSelect:!1}),n.tracks.push(t);const r=t.channels||"2";return n.channels[r]=(n.channels[r]||0)+1,n.hasDefault=n.hasDefault||t.default,n.hasAutoSelect=n.hasAutoSelect||t.autoselect,n.hasDefault&&(e.hasDefaultAudio=!0),n.hasAutoSelect&&(e.hasAutoSelectAudio=!0),e}),{hasDefaultAudio:!1,hasAutoSelectAudio:!1,groups:{}})}function at(e){if(!e)return e;const{lang:t,assocLang:n,characteristics:r,channels:s,audioCodec:i}=e;return{lang:t,assocLang:n,characteristics:r,channels:s,audioCodec:i}}function ot(e,t,n){if("attrs"in e){const n=t.indexOf(e);if(-1!==n)return n}for(let r=0;r<t.length;r++){if(lt(e,t[r],n))return r}return-1}function lt(e,t,n){const{groupId:r,name:s,lang:i,assocLang:a,default:o}=e,l=e.forced;return(void 0===r||t.groupId===r)&&(void 0===s||t.name===s)&&(void 0===i||function(e,t="--"){if(e.length===t.length)return e===t;return e.startsWith(t)||t.startsWith(e)}(i,t.lang))&&(void 0===i||t.assocLang===a)&&(void 0===o||t.default===o)&&(void 0===l||t.forced===l)&&(!("characteristics"in e)||function(e,t=""){const n=e.split(","),r=t.split(",");return n.length===r.length&&!n.some((e=>-1===r.indexOf(e)))}(e.characteristics||"",t.characteristics))&&(void 0===n||n(e,t))}function ct(e,t){const{audioCodec:n,channels:r}=e;return!(void 0!==n&&(t.audioCodec||"").substring(0,4)!==n.substring(0,4)||void 0!==r&&r!==(t.channels||"2"))}function ut(e,t,n){for(let r=t;r>-1;r--)if(n(e[r]))return r;for(let r=t+1;r<e.length;r++)if(n(e[r]))return r;return-1}function dt(e,t){var n;return!!e&&e!==(null==(n=t.loadLevelObj)?void 0:n.uri)}const ht=function(e,t){let n=0,r=e.length-1,s=null,i=null;for(;n<=r;){s=(n+r)/2|0,i=e[s];const a=t(i);if(a>0)n=s+1;else{if(!(a<0))return i;r=s-1}}return null};function ft(e,t,n=0,r=0,s=.005){let i=null;if(e){i=t[1+e.sn-t[0].sn]||null;const r=e.endDTS-n;r>0&&r<15e-7&&(n+=15e-7),i&&e.level!==i.level&&i.end<=e.end&&(i=t[2+e.sn-t[0].sn]||null)}else 0===n&&0===t[0].start&&(i=t[0]);if(i&&((!e||e.level===i.level)&&0===pt(n,r,i)||function(e,t,n){if(t&&0===t.start&&t.level<e.level&&(t.endPTS||0)>0){const r=t.tagList.reduce(((e,t)=>("INF"===t[0]&&(e+=parseFloat(t[1])),e)),n);return e.start<=r}return!1}(i,e,Math.min(s,r))))return i;const a=ht(t,pt.bind(null,n,r));return!a||a===e&&i?i:a}function pt(e=0,t=0,n){if(n.start<=e&&n.start+n.duration>e)return 0;const r=Math.min(t,n.duration+(n.deltaPTS?n.deltaPTS:0));return n.start+n.duration-r<=e?1:n.start-r>e&&n.start?-1:0}function gt(e,t,n){const r=1e3*Math.min(t,n.duration+(n.deltaPTS?n.deltaPTS:0));return(n.endProgramDateTime||0)-r>e}function mt(e,t,n){if(e&&e.startCC<=t&&e.endCC>=t){let r=e.fragments;const{fragmentHint:s}=e;let i;return s&&(r=r.concat(s)),ht(r,(e=>e.cc<t?1:e.cc>t?-1:(i=e,e.end<=n?1:e.start>n?-1:0))),i||null}return null}function _t(e){switch(e.details){case o.FRAG_LOAD_TIMEOUT:case o.KEY_LOAD_TIMEOUT:case o.LEVEL_LOAD_TIMEOUT:case o.MANIFEST_LOAD_TIMEOUT:return!0}return!1}function Tt(e){return e.details.startsWith("key")}function Et(e){return Tt(e)&&!!e.frag&&!e.frag.decryptdata}function yt(e,t){const n=_t(t);return e.default[(n?"timeout":"error")+"Retry"]}function St(e,t){const n="linear"===e.backoff?1:Math.pow(2,t);return Math.min(n*e.retryDelayMs,e.maxRetryDelayMs)}function vt(e){return S(S({},e),{errorRetry:null,timeoutRetry:null})}function bt(e,t,n,r){if(!e)return!1;const s=null==r?void 0:r.code,i=t<e.maxNumRetry&&(function(e){return It(e)||!!e&&(e<400||e>499)}(s)||!!n);return e.shouldRetry?e.shouldRetry(e,t,n,r,i):i}function It(e){return 0===e&&!1===navigator.onLine}var At=0,Rt=2,Ct=3,kt=5,Lt=0,Ot=1,Nt=2,wt=4;function Pt(e){const t={action:At,flags:Lt};return e&&(t.resolved=!0),t}var Mt="NOT_LOADED",Dt="APPENDING",xt="PARTIAL",Ut="OK";class Bt{constructor(e){this.activePartLists=Object.create(null),this.endListFragments=Object.create(null),this.fragments=Object.create(null),this.timeRanges=Object.create(null),this.bufferPadding=.2,this.hls=void 0,this.hasGaps=!1,this.hls=e,this._registerListeners()}_registerListeners(){const{hls:e}=this;e&&(e.on(l.MANIFEST_LOADING,this.onManifestLoading,this),e.on(l.BUFFER_APPENDED,this.onBufferAppended,this),e.on(l.FRAG_BUFFERED,this.onFragBuffered,this),e.on(l.FRAG_LOADED,this.onFragLoaded,this))}_unregisterListeners(){const{hls:e}=this;e&&(e.off(l.MANIFEST_LOADING,this.onManifestLoading,this),e.off(l.BUFFER_APPENDED,this.onBufferAppended,this),e.off(l.FRAG_BUFFERED,this.onFragBuffered,this),e.off(l.FRAG_LOADED,this.onFragLoaded,this))}destroy(){this._unregisterListeners(),this.hls=this.fragments=this.activePartLists=this.endListFragments=this.timeRanges=null}getAppendedFrag(e,t){const n=this.activePartLists[t];if(n)for(let t=n.length;t--;){const r=n[t];if(!r)break;if(r.start<=e&&e<=r.end&&r.loaded)return r}return this.getBufferedFrag(e,t)}getBufferedFrag(e,t){return this.getFragAtPos(e,t,!0)}getFragAtPos(e,t,n){const{fragments:r}=this,s=Object.keys(r);for(let i=s.length;i--;){const a=r[s[i]];if((null==a?void 0:a.body.type)===t&&(!n||a.buffered)){const t=a.body;if(t.start<=e&&e<=t.end)return t}}return null}detectEvictedFragments(e,t,n,r,s){this.timeRanges&&(this.timeRanges[e]=t);const i=(null==r?void 0:r.fragment.sn)||-1;Object.keys(this.fragments).forEach((r=>{const a=this.fragments[r];if(!a)return;if(i>=a.body.sn)return;if(!a.buffered&&(!a.loaded||s))return void(a.body.type===n&&this.removeFragment(a.body));const o=a.range[e];o&&(0!==o.time.length?o.time.some((e=>{const n=!this.isTimeBuffered(e.startPTS,e.endPTS,t);return n&&this.removeFragment(a.body),n})):this.removeFragment(a.body))}))}detectPartialFragments(e){const t=this.timeRanges;if(!t||"initSegment"===e.frag.sn)return;const n=e.frag,r=$t(n),s=this.fragments[r];if(!s||s.buffered&&n.gap)return;const i=!n.relurl;Object.keys(t).forEach((r=>{const a=n.elementaryStreams[r];if(!a)return;const o=t[r],l=i||!0===a.partial;s.range[r]=this.getBufferedTimes(n,e.part,l,o)})),s.loaded=null,Object.keys(s.range).length?(this.bufferedEnd(s,n),Ft(s)||this.removeParts(n.sn-1,n.type)):this.removeFragment(s.body)}bufferedEnd(e,t){e.buffered=!0;(e.body.endList=t.endList||e.body.endList)&&(this.endListFragments[e.body.type]=e)}removeParts(e,t){const n=this.activePartLists[t];n&&(this.activePartLists[t]=Gt(n,(t=>t.fragment.sn>=e)))}fragBuffered(e,t){const n=$t(e);let r=this.fragments[n];!r&&t&&(r=this.fragments[n]={body:e,appendedPTS:null,loaded:null,buffered:!1,range:Object.create(null)},e.gap&&(this.hasGaps=!0)),r&&(r.loaded=null,this.bufferedEnd(r,e))}getBufferedTimes(e,t,n,r){const s={time:[],partial:n},i=e.start,a=e.end,o=e.minEndPTS||a,l=e.maxStartPTS||i;for(let e=0;e<r.length;e++){const t=r.start(e)-this.bufferPadding,n=r.end(e)+this.bufferPadding;if(l>=t&&o<=n){s.time.push({startPTS:Math.max(i,r.start(e)),endPTS:Math.min(a,r.end(e))});break}if(i<n&&a>t){const t=Math.max(i,r.start(e)),n=Math.min(a,r.end(e));n>t&&(s.partial=!0,s.time.push({startPTS:t,endPTS:n}))}else if(a<=t)break}return s}getPartialFragment(e){let t,n,r,s=null,i=0;const{bufferPadding:a,fragments:o}=this;return Object.keys(o).forEach((l=>{const c=o[l];c&&Ft(c)&&(n=c.body.start-a,r=c.body.end+a,e>=n&&e<=r&&(t=Math.min(e-n,r-e),i<=t&&(s=c.body,i=t)))})),s}isEndListAppended(e){const t=this.endListFragments[e];return void 0!==t&&(t.buffered||Ft(t))}getState(e){const t=$t(e),n=this.fragments[t];return n?n.buffered?Ft(n)?xt:Ut:Dt:Mt}isTimeBuffered(e,t,n){let r,s;for(let i=0;i<n.length;i++){if(r=n.start(i)-this.bufferPadding,s=n.end(i)+this.bufferPadding,e>=r&&t<=s)return!0;if(t<=r)return!1}return!1}onManifestLoading(){this.removeAllFragments()}onFragLoaded(e,t){if("initSegment"===t.frag.sn||t.frag.bitrateTest)return;const n=t.frag,r=t.part?null:t,s=$t(n);this.fragments[s]={body:n,appendedPTS:null,loaded:r,buffered:!1,range:Object.create(null)}}onBufferAppended(e,t){const{frag:n,part:r,timeRanges:s,type:i}=t;if("initSegment"===n.sn)return;const a=n.type;if(r){let e=this.activePartLists[a];e||(this.activePartLists[a]=e=[]),e.push(r)}this.timeRanges=s;const o=s[i];this.detectEvictedFragments(i,o,a,r)}onFragBuffered(e,t){this.detectPartialFragments(t)}hasFragment(e){const t=$t(e);return!!this.fragments[t]}hasFragments(e){const{fragments:t}=this,n=Object.keys(t);if(!e)return n.length>0;for(let r=n.length;r--;){const s=t[n[r]];if((null==s?void 0:s.body.type)===e)return!0}return!1}hasParts(e){var t;return!(null==(t=this.activePartLists[e])||!t.length)}removeFragmentsInRange(e,t,n,r,s){r&&!this.hasGaps||Object.keys(this.fragments).forEach((i=>{const a=this.fragments[i];if(!a)return;const o=a.body;o.type!==n||r&&!o.gap||o.start<t&&o.end>e&&(a.buffered||s)&&this.removeFragment(o)}))}removeFragment(e){const t=$t(e);e.clearElementaryStreamInfo();const n=this.activePartLists[e.type];if(n){const t=e.sn;this.activePartLists[e.type]=Gt(n,(e=>e.fragment.sn!==t))}delete this.fragments[t],e.endList&&delete this.endListFragments[e.type]}removeAllFragments(){var e;this.fragments=Object.create(null),this.endListFragments=Object.create(null),this.activePartLists=Object.create(null),this.hasGaps=!1;const t=null==(e=this.hls)||null==(e=e.latestLevelDetails)?void 0:e.partList;t&&t.forEach((e=>e.clearElementaryStreamInfo()))}}function Ft(e){var t,n,r;return e.buffered&&!!(e.body.gap||null!=(t=e.range.video)&&t.partial||null!=(n=e.range.audio)&&n.partial||null!=(r=e.range.audiovideo)&&r.partial)}function $t(e){return`${e.type}_${e.level}_${e.sn}`}function Gt(e,t){return e.filter((e=>{const n=t(e);return n||e.clearElementaryStreamInfo(),n}))}var Ht=0,jt=1;class Wt{constructor(e,t,n){this.subtle=void 0,this.aesIV=void 0,this.aesMode=void 0,this.subtle=e,this.aesIV=t,this.aesMode=n}decrypt(e,t){switch(this.aesMode){case Ht:return this.subtle.decrypt({
vendor: 9,051 bytes, line 1
1name:"AES-CBC",iv:this.aesIV},t,e);case jt:return this.subtle.decrypt({name:"AES-CTR",counter:this.aesIV,length:64},t,e);default:throw new Error(`[AESCrypto] invalid aes mode ${this.aesMode}`)}}}class Kt{constructor(){this.rcon=[0,1,2,4,8,16,32,64,128,27,54],this.subMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.invSubMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.sBox=new Uint32Array(256),this.invSBox=new Uint32Array(256),this.key=new Uint32Array(0),this.ksRows=0,this.keySize=0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.initTable()}uint8ArrayToUint32Array_(e){const t=new DataView(e),n=new Uint32Array(4);for(let e=0;e<4;e++)n[e]=t.getUint32(4*e);return n}initTable(){const e=this.sBox,t=this.invSBox,n=this.subMix,r=n[0],s=n[1],i=n[2],a=n[3],o=this.invSubMix,l=o[0],c=o[1],u=o[2],d=o[3],h=new Uint32Array(256);let f=0,p=0,g=0;for(g=0;g<256;g++)h[g]=g<128?g<<1:g<<1^283;for(g=0;g<256;g++){let n=p^p<<1^p<<2^p<<3^p<<4;n=n>>>8^255&n^99,e[f]=n,t[n]=f;const o=h[f],g=h[o],m=h[g];let _=257*h[n]^16843008*n;r[f]=_<<24|_>>>8,s[f]=_<<16|_>>>16,i[f]=_<<8|_>>>24,a[f]=_,_=16843009*m^65537*g^257*o^16843008*f,l[n]=_<<24|_>>>8,c[n]=_<<16|_>>>16,u[n]=_<<8|_>>>24,d[n]=_,f?(f=o^h[h[h[m^o]]],p^=h[h[p]]):f=p=1}}expandKey(e){const t=this.uint8ArrayToUint32Array_(e);let n=!0,r=0;for(;r<t.length&&n;)n=t[r]===this.key[r],r++;if(n)return;this.key=t;const s=this.keySize=t.length;if(4!==s&&6!==s&&8!==s)throw new Error("Invalid aes key size="+s);const i=this.ksRows=4*(s+6+1);let a,o;const l=this.keySchedule=new Uint32Array(i),c=this.invKeySchedule=new Uint32Array(i),u=this.sBox,d=this.rcon,h=this.invSubMix,f=h[0],p=h[1],g=h[2],m=h[3];let _,T;for(a=0;a<i;a++)a<s?_=l[a]=t[a]:(T=_,a%s==0?(T=T<<8|T>>>24,T=u[T>>>24]<<24|u[T>>>16&255]<<16|u[T>>>8&255]<<8|u[255&T],T^=d[a/s|0]<<24):s>6&&a%s==4&&(T=u[T>>>24]<<24|u[T>>>16&255]<<16|u[T>>>8&255]<<8|u[255&T]),l[a]=_=(l[a-s]^T)>>>0);for(o=0;o<i;o++)a=i-o,T=3&o?l[a]:l[a-4],c[o]=o<4||a<=4?T:f[u[T>>>24]]^p[u[T>>>16&255]]^g[u[T>>>8&255]]^m[u[255&T]],c[o]=c[o]>>>0}networkToHostOrderSwap(e){return e<<24|(65280&e)<<8|(16711680&e)>>8|e>>>24}decrypt(e,t,n){const r=this.keySize+6,s=this.invKeySchedule,i=this.invSBox,a=this.invSubMix,o=a[0],l=a[1],c=a[2],u=a[3],d=this.uint8ArrayToUint32Array_(n);let h=d[0],f=d[1],p=d[2],g=d[3];const m=new Int32Array(e),_=new Int32Array(m.length);let T,E,y,S,v,b,I,A,R,C,k,L,O,N;const w=this.networkToHostOrderSwap;for(;t<m.length;){for(R=w(m[t]),C=w(m[t+1]),k=w(m[t+2]),L=w(m[t+3]),v=R^s[0],b=L^s[1],I=k^s[2],A=C^s[3],O=4,N=1;N<r;N++)T=o[v>>>24]^l[b>>16&255]^c[I>>8&255]^u[255&A]^s[O],E=o[b>>>24]^l[I>>16&255]^c[A>>8&255]^u[255&v]^s[O+1],y=o[I>>>24]^l[A>>16&255]^c[v>>8&255]^u[255&b]^s[O+2],S=o[A>>>24]^l[v>>16&255]^c[b>>8&255]^u[255&I]^s[O+3],v=T,b=E,I=y,A=S,O+=4;T=i[v>>>24]<<24^i[b>>16&255]<<16^i[I>>8&255]<<8^i[255&A]^s[O],E=i[b>>>24]<<24^i[I>>16&255]<<16^i[A>>8&255]<<8^i[255&v]^s[O+1],y=i[I>>>24]<<24^i[A>>16&255]<<16^i[v>>8&255]<<8^i[255&b]^s[O+2],S=i[A>>>24]<<24^i[v>>16&255]<<16^i[b>>8&255]<<8^i[255&I]^s[O+3],_[t]=w(T^h),_[t+1]=w(S^f),_[t+2]=w(y^p),_[t+3]=w(E^g),h=R,f=C,p=k,g=L,t+=4}return _.buffer}}class Vt{constructor(e,t,n){this.subtle=void 0,this.key=void 0,this.aesMode=void 0,this.subtle=e,this.key=t,this.aesMode=n}expandKey(){const e=function(e){switch(e){case Ht:return"AES-CBC";case jt:return"AES-CTR";default:throw new Error(`[FastAESKey] invalid aes mode ${e}`)}}(this.aesMode);return this.subtle.importKey("raw",this.key,{name:e},!1,["encrypt","decrypt"])}}class qt{constructor(e,{removePKCS7Padding:t=!0}={}){if(this.logEnabled=!0,this.removePKCS7Padding=void 0,this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null,this.useSoftware=void 0,this.enableSoftwareAES=void 0,this.enableSoftwareAES=e.enableSoftwareAES,this.removePKCS7Padding=t,t)try{const e=self.crypto;e&&(this.subtle=e.subtle||e.webkitSubtle)}catch(e){}this.useSoftware=!this.subtle}destroy(){this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null}isSync(){return this.useSoftware}flush(){const{currentResult:e,remainderData:t}=this;if(!e||t)return this.reset(),null;const n=new Uint8Array(e);return this.reset(),this.removePKCS7Padding?function(e){const t=e.byteLength,n=t&&new DataView(e.buffer).getUint8(t-1);return n?e.slice(0,t-n):e}(n):n}reset(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)}decrypt(e,t,n,r){return this.useSoftware?new Promise(((s,i)=>{const a=ArrayBuffer.isView(e)?e:new Uint8Array(e);this.softwareDecrypt(a,t,n,r);const o=this.flush();o?s(o.buffer):i(new Error("[softwareDecrypt] Failed to decrypt data"))})):this.webCryptoDecrypt(new Uint8Array(e),t,n,r)}softwareDecrypt(e,t,n,r){const{currentIV:s,currentResult:i,remainderData:a}=this;if(r!==Ht||16!==t.byteLength)return k.warn("SoftwareDecrypt: can only handle AES-128-CBC"),null;this.logOnce("JS AES decrypt"),a&&(e=me(a,e),this.remainderData=null);const o=this.getValidChunk(e);if(!o.length)return null;s&&(n=s);let l=this.softwareDecrypter;l||(l=this.softwareDecrypter=new Kt),l.expandKey(t);const c=i;return this.currentResult=l.decrypt(o.buffer,0,n),this.currentIV=o.slice(-16).buffer,c||null}webCryptoDecrypt(e,t,n,r){if(this.key!==t||!this.fastAesKey){if(!this.subtle)return Promise.resolve(this.onWebCryptoError(e,t,n,r));this.key=t,this.fastAesKey=new Vt(this.subtle,t,r)}return this.fastAesKey.expandKey().then((t=>{if(!this.subtle)return Promise.reject(new Error("web crypto not initialized"));this.logOnce("WebCrypto AES decrypt");return new Wt(this.subtle,new Uint8Array(n),r).decrypt(e.buffer,t)})).catch((s=>(k.warn(`[decrypter]: WebCrypto Error, disable WebCrypto API, ${s.name}: ${s.message}`),this.onWebCryptoError(e,t,n,r))))}onWebCryptoError(e,t,n,r){const s=this.enableSoftwareAES;if(s){this.useSoftware=!0,this.logEnabled=!0,this.softwareDecrypt(e,t,n,r);const s=this.flush();if(s)return s.buffer}throw new Error("WebCrypto"+(s?" and softwareDecrypt":"")+": failed to decrypt data")}getValidChunk(e){let t=e;const n=e.length-e.length%16;return n!==e.length&&(t=e.slice(0,n),this.remainderData=e.slice(n)),t}logOnce(e){this.logEnabled&&(k.log(`[decrypter]: ${e}`),this.logEnabled=!1)}}const Yt=Math.pow(2,17);class zt{constructor(e){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=e}destroy(){this.loader&&(this.loader.destroy(),this.loader=null)}abort(){this.loader&&this.loader.abort()}load(e,t){const n=e.url;if(!n)return Promise.reject(new Qt({type:a.NETWORK_ERROR,details:o.FRAG_LOAD_ERROR,fatal:!1,frag:e,error:new Error("Fragment does not have a "+(n?"part list":"url")),networkDetails:null}));this.abort();const r=this.config,s=r.fLoader,i=r.loader;return new Promise(((l,c)=>{if(this.loader&&this.loader.destroy(),e.gap){if(e.tagList.some((e=>"GAP"===e[0])))return void c(Xt(e));e.gap=!1}const u=this.loader=s?new s(r):new i(r),d=Jt(e);e.loader=u;const h=vt(r.fragLoadPolicy.default),f={loadPolicy:h,timeout:h.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:"initSegment"===e.sn?1/0:Yt};e.stats=u.stats;const p={onSuccess:(t,n,r,s)=>{this.resetLoader(e,u);let i=t.data;r.resetIV&&e.decryptdata&&(e.decryptdata.iv=new Uint8Array(i.slice(0,16)),i=i.slice(16)),l({frag:e,part:null,payload:i,networkDetails:s})},onError:(t,r,s,i)=>{this.resetLoader(e,u),c(new Qt({type:a.NETWORK_ERROR,details:o.FRAG_LOAD_ERROR,fatal:!1,frag:e,response:S({url:n,data:void 0},t),error:new Error(`HTTP Error ${t.code} ${t.text}`),networkDetails:s,stats:i}))},onAbort:(t,n,r)=>{this.resetLoader(e,u),c(new Qt({type:a.NETWORK_ERROR,details:o.INTERNAL_ABORTED,fatal:!1,frag:e,error:new Error("Aborted"),networkDetails:r,stats:t}))},onTimeout:(t,n,r)=>{this.resetLoader(e,u),c(new Qt({type:a.NETWORK_ERROR,details:o.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,error:new Error(`Timeout after ${f.timeout}ms`),networkDetails:r,stats:t}))}};t&&(p.onProgress=(n,r,s,i)=>t({frag:e,part:null,payload:s,networkDetails:i})),u.load(d,f,p)}))}loadPart(e,t,n){this.abort();const r=this.config,s=r.fLoader,i=r.loader;return new Promise(((l,c)=>{if(this.loader&&this.loader.destroy(),e.gap||t.gap)return void c(Xt(e,t));const u=this.loader=s?new s(r):new i(r),d=Jt(e,t);e.loader=u;const h=vt(r.fragLoadPolicy.default),f={loadPolicy:h,timeout:h.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:Yt};t.stats=u.stats,u.load(d,f,{onSuccess:(r,s,i,a)=>{this.resetLoader(e,u),this.updateStatsFromPart(e,t);const o={frag:e,part:t,payload:r.data,networkDetails:a};n(o),l(o)},onError:(n,r,s,i)=>{this.resetLoader(e,u),c(new Qt({type:a.NETWORK_ERROR,details:o.FRAG_LOAD_ERROR,fatal:!1,frag:e,part:t,response:S({url:d.url,data:void 0},n),error:new Error(`HTTP Error ${n.code} ${n.text}`),networkDetails:s,stats:i}))},onAbort:(n,r,s)=>{e.stats.aborted=t.stats.aborted,this.resetLoader(e,u),c(new Qt({type:a.NETWORK_E
vendor: 25,588 bytes, line 1
1RROR,details:o.INTERNAL_ABORTED,fatal:!1,frag:e,part:t,error:new Error("Aborted"),networkDetails:s,stats:n}))},onTimeout:(n,r,s)=>{this.resetLoader(e,u),c(new Qt({type:a.NETWORK_ERROR,details:o.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,part:t,error:new Error(`Timeout after ${f.timeout}ms`),networkDetails:s,stats:n}))}})}))}updateStatsFromPart(e,t){const n=e.stats,r=t.stats,s=r.total;if(n.loaded+=r.loaded,s){const r=Math.round(e.duration/t.duration),i=Math.min(Math.round(n.loaded/s),r),a=(r-i)*Math.round(n.loaded/i);n.total=n.loaded+a}else n.total=Math.max(n.loaded,n.total);const i=n.loading,a=r.loading;i.start?i.first+=a.first-a.start:(i.start=a.start,i.first=a.first),i.end=a.end}resetLoader(e,t){e.loader=null,this.loader===t&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),t.destroy()}}function Jt(e,t=null){const n=t||e,s={frag:e,part:t,responseType:"arraybuffer",url:n.url,headers:{},rangeStart:0,rangeEnd:0},i=n.byteRangeStartOffset,a=n.byteRangeEndOffset;if(r(i)&&r(a)){var o;let t=i,n=a;if("initSegment"===e.sn&&("AES-128"===(l=null==(o=e.decryptdata)?void 0:o.method)||"AES-256"===l)){const e=a-i;e%16&&(n=a+(16-e%16)),0!==i&&(s.resetIV=!0,t=i-16)}s.rangeStart=t,s.rangeEnd=n}var l;return s}function Xt(e,t){const n=new Error(`GAP ${e.gap?"tag":"attribute"} found`),r={type:a.MEDIA_ERROR,details:o.FRAG_GAP,fatal:!1,frag:e,error:n,networkDetails:null};return t&&(r.part=t),(t||e).stats.aborted=!0,new Qt(r)}class Qt extends Error{constructor(e){super(e.error.message),this.data=void 0,this.data=e}}class Zt extends v{constructor(e,t){super(e,t),this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}destroy(){this.onHandlerDestroying(),this.onHandlerDestroyed()}onHandlerDestroying(){this.clearNextTick(),this.clearInterval()}onHandlerDestroyed(){}hasInterval(){return!!this._tickInterval}hasNextTick(){return!!this._tickTimer}setInterval(e){return!this._tickInterval&&(this._tickCallCount=0,this._tickInterval=self.setInterval(this._boundTick,e),!0)}clearInterval(){return!!this._tickInterval&&(self.clearInterval(this._tickInterval),this._tickInterval=null,!0)}clearNextTick(){return!!this._tickTimer&&(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0)}tick(){this._tickCallCount++,1===this._tickCallCount&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)}tickImmediate(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)}doTick(){}}class en{constructor(e,t,n,r=0,s=-1,i=!1){this.level=void 0,this.sn=void 0,this.part=void 0,this.id=void 0,this.size=void 0,this.partial=void 0,this.transmuxing={start:0,executeStart:0,executeEnd:0,end:0},this.buffering={audio:{start:0,executeStart:0,executeEnd:0,end:0},video:{start:0,executeStart:0,executeEnd:0,end:0},audiovideo:{start:0,executeStart:0,executeEnd:0,end:0}},this.level=e,this.sn=t,this.id=n,this.size=r,this.part=s,this.partial=i}}const tn={length:0,start:()=>0,end:()=>0};class nn{static isBuffered(e,t){if(e){const n=nn.getBuffered(e);for(let e=n.length;e--;)if(t>=n.start(e)&&t<=n.end(e))return!0}return!1}static bufferedRanges(e){if(e){const t=nn.getBuffered(e);return nn.timeRangesToArray(t)}return[]}static timeRangesToArray(e){const t=[];for(let n=0;n<e.length;n++)t.push({start:e.start(n),end:e.end(n)});return t}static bufferInfo(e,t,n){if(e){const r=nn.bufferedRanges(e);if(r.length)return nn.bufferedInfo(r,t,n)}return{len:0,start:t,end:t,bufferedIndex:-1}}static bufferedInfo(e,t,n){t=Math.max(0,t),e.length>1&&e.sort(((e,t)=>e.start-t.start||t.end-e.end));let r=-1,s=[];if(n)for(let i=0;i<e.length;i++){t>=e[i].start&&t<=e[i].end&&(r=i);const a=s.length;if(a){const t=s[a-1].end;e[i].start-t<n?e[i].end>t&&(s[a-1].end=e[i].end):s.push(e[i])}else s.push(e[i])}else s=e;let i,a=0,o=t,l=t;for(let e=0;e<s.length;e++){const c=s[e].start,u=s[e].end;if(-1===r&&t>=c&&t<=u&&(r=e),t+n>=c&&t<u)o=c,l=u,a=l-t;else if(t+n<c){i=c;break}}return{len:a,start:o||0,end:l||0,nextStart:i,buffered:e,bufferedIndex:r}}static getBuffered(e){try{return e.buffered||tn}catch(e){return k.log("failed to get media.buffered",e),tn}}}const rn=/\{\$([a-zA-Z0-9-_]+)\}/g;function sn(e){return rn.test(e)}function an(e,t){if(null!==e.variableList||e.hasVariableRefs){const n=e.variableList;return t.replace(rn,(t=>{const r=t.substring(2,t.length-1),s=null==n?void 0:n[r];return void 0===s?(e.playlistParsingError||(e.playlistParsingError=new Error(`Missing preceding EXT-X-DEFINE tag for Variable Reference: "${r}"`)),t):s}))}return t}function on(e,t,n){let r,s,i=e.variableList;if(i||(e.variableList=i={}),"QUERYPARAM"in t){r=t.QUERYPARAM;try{const e=new self.URL(n).searchParams;if(!e.has(r))throw new Error(`"${r}" does not match any query parameter in URI: "${n}"`);s=e.get(r)}catch(t){e.playlistParsingError||(e.playlistParsingError=new Error(`EXT-X-DEFINE QUERYPARAM: ${t.message}`))}}else r=t.NAME,s=t.VALUE;r in i?e.playlistParsingError||(e.playlistParsingError=new Error(`EXT-X-DEFINE duplicate Variable Name declarations: "${r}"`)):i[r]=s||""}function ln(e,t,n){const r=t.IMPORT;if(n&&r in n){let t=e.variableList;t||(e.variableList=t={}),t[r]=n[r]}else e.playlistParsingError||(e.playlistParsingError=new Error(`EXT-X-DEFINE IMPORT attribute not found in Multivariant Playlist: "${r}"`))}const cn=/^(\d+)x(\d+)$/,un=/(.+?)=(".*?"|.*?)(?:,|$)/g;class dn{constructor(e,t){"string"==typeof e&&(e=dn.parseAttrList(e,t)),E(this,e)}get clientAttrs(){return Object.keys(this).filter((e=>"X-"===e.substring(0,2)))}decimalInteger(e){const t=parseInt(this[e],10);return t>Number.MAX_SAFE_INTEGER?1/0:t}hexadecimalInteger(e){if(this[e]){let t=(this[e]||"0x").slice(2);t=(1&t.length?"0":"")+t;const n=new Uint8Array(t.length/2);for(let e=0;e<t.length/2;e++)n[e]=parseInt(t.slice(2*e,2*e+2),16);return n}return null}hexadecimalIntegerAsNumber(e){const t=parseInt(this[e],16);return t>Number.MAX_SAFE_INTEGER?1/0:t}decimalFloatingPoint(e){return parseFloat(this[e])}optionalFloat(e,t){const n=this[e];return n?parseFloat(n):t}enumeratedString(e){return this[e]}enumeratedStringList(e,t){const n=this[e];return(n?n.split(/[ ,]+/):[]).reduce(((e,t)=>(e[t.toLowerCase()]=!0,e)),t)}bool(e){return"YES"===this[e]}decimalResolution(e){const t=cn.exec(this[e]);if(null!==t)return{width:parseInt(t[1],10),height:parseInt(t[2],10)}}static parseAttrList(e,t){let n;const r={};for(un.lastIndex=0;null!==(n=un.exec(e));){const s=n[1].trim();let i=n[2];const a=0===i.indexOf('"')&&i.lastIndexOf('"')===i.length-1;let o=!1;if(a)i=i.slice(1,-1);else switch(s){case"IV":case"SCTE35-CMD":case"SCTE35-IN":case"SCTE35-OUT":o=!0}if(t&&(a||o))i=an(t,i);else if(!o&&!a)switch(s){case"CLOSED-CAPTIONS":if("NONE"===i)break;case"ALLOWED-CPC":case"CLASS":case"ASSOC-LANGUAGE":case"AUDIO":case"BYTERANGE":case"CHANNELS":case"CHARACTERISTICS":case"CODECS":case"DATA-ID":case"END-DATE":case"GROUP-ID":case"ID":case"IMPORT":case"INSTREAM-ID":case"KEYFORMAT":case"KEYFORMATVERSIONS":case"LANGUAGE":case"NAME":case"PATHWAY-ID":case"QUERYPARAM":case"RECENTLY-REMOVED-DATERANGES":case"SERVER-URI":case"STABLE-RENDITION-ID":case"STABLE-VARIANT-ID":case"START-DATE":case"SUBTITLES":case"SUPPLEMENTAL-CODECS":case"URI":case"VALUE":case"VIDEO":case"X-ASSET-LIST":case"X-ASSET-URI":k.warn(`${e}: attribute ${s} is missing quotes`)}r[s]=i}return r}}function hn(e){return"SCTE35-OUT"===e||"SCTE35-IN"===e||"SCTE35-CMD"===e}class fn{constructor(e,t,n=0){var s;if(this.attr=void 0,this.tagAnchor=void 0,this.tagOrder=void 0,this._startDate=void 0,this._endDate=void 0,this._dateAtEnd=void 0,this._cue=void 0,this._badValueForSameId=void 0,this.tagAnchor=(null==t?void 0:t.tagAnchor)||null,this.tagOrder=null!=(s=null==t?void 0:t.tagOrder)?s:n,t){const n=t.attr;for(const t in n)if(Object.prototype.hasOwnProperty.call(e,t)&&e[t]!==n[t]){k.warn(`DATERANGE tag attribute: "${t}" does not match for tags with ID: "${e.ID}"`),this._badValueForSameId=t;break}e=E(new dn({}),n,e)}if(this.attr=e,t?(this._startDate=t._startDate,this._cue=t._cue,this._endDate=t._endDate,this._dateAtEnd=t._dateAtEnd):this._startDate=new Date(e["START-DATE"]),"END-DATE"in this.attr){const e=(null==t?void 0:t.endDate)||new Date(this.attr["END-DATE"]);r(e.getTime())&&(this._endDate=e)}}get id(){return this.attr.ID}get class(){return this.attr.CLASS}get cue(){const e=this._cue;return void 0===e?this._cue=this.attr.enumeratedStringList(this.attr.CUE?"CUE":"X-CUE",{pre:!1,post:!1,once:!1}):e}get startTime(){const{tagAnchor:e}=this;return null===e||null===e.programDateTime?(k.warn(`Expected tagAnchor Fragment with PDT set for DateRange "${this.id}": ${e}`),NaN):e.start+(this.startDate.getTime()-e.programDateTime)/1e3}get startDate(){return this._startDate}get endDate(){const e=this._endDate||this._dateAtEnd;if(e)return e;const t=this.duration;return null!==t?this._dateAtEnd=new Date(this._startDate.getTime()+1e3*t):null}get duration(){if("DURATION"in this.attr){const e=this.attr.decimalFloatingPoint("DURATION");if(r(e))return e}else if(this._endDate)return(this._endDate.getTime()-this._startDate.getTime())/1e3;return null}get plannedDuration(){return"PLANNED-DURATION"in this.attr?this.attr.decimalFloatingPoint("PLANNED-DURATION"):null}get endOnNext(){return this.attr.bool("END-ON-NEXT")}get isInterstitial(){return"com.apple.hls.interstitial"===this.class}get isValid(){return!!this.id&&!this._badValueForSameId&&r(this.startDate.getTime())&&(null===this.duration||this.duration>=0)&&(!this.endOnNext||!!this.class)&&(!this.attr.CUE||!this.cue.pre&&!this.cue.post||this.cue.pre!==this.cue.post)&&(!this.isInterstitial||"X-ASSET-URI"in this.attr||"X-ASSET-LIST"in this.attr)}}class pn{constructor(e){this.PTSKnown=!1,this.alignedSliding=!1,this.averagetargetduration=void 0,this.endCC=0,this.endSN=0,this.fragments=void 0,this.fragmentHint=void 0,this.partList=null,this.dateRanges=void 0,this.dateRangeTagCount=0,this.live=!0,this.requestScheduled=-1,this.ageHeader=0,this.advancedDateTime=void 0,this.updated=!0,this.advanced=!0,this.misses=0,this.startCC=0,this.startSN=0,this.startTimeOffset=null,this.targetduration=0,this.totalduration=0,this.type=null,this.url=void 0,this.m3u8="",this.version=null,this.canBlockReload=!1,this.canSkipUntil=0,this.canSkipDateRanges=!1,this.skippedSegments=0,this.recentlyRemovedDateranges=void 0,this.partHoldBack=0,this.holdBack=0,this.partTarget=0,this.preloadHint=void 0,this.renditionReports=void 0,this.tuneInGoal=0,this.deltaUpdateFailed=void 0,this.driftStartTime=0,this.driftEndTime=0,this.driftStart=0,this.driftEnd=0,this.encryptedFragments=void 0,this.playlistParsingError=null,this.variableList=null,this.hasVariableRefs=!1,this.appliedTimelineOffset=void 0,this.fragments=[],this.encryptedFragments=[],this.dateRanges={},this.url=e}reloaded(e){if(!e)return this.advanced=!0,void(this.updated=!0);const t=this.lastPartSn-e.lastPartSn,n=this.lastPartIndex-e.lastPartIndex;this.updated=this.endSN!==e.endSN||!!n||!!t||!this.live,this.advanced=this.endSN>e.endSN||t>0||0===t&&n>0,this.updated||this.advanced?this.misses=Math.floor(.6*e.misses):this.misses=e.misses+1}hasKey(e){return this.encryptedFragments.some((t=>{let n=t.decryptdata;return n||(t.setKeyFormat(e.keyFormat),n=t.decryptdata),!!n&&e.matches(n)}))}get hasProgramDateTime(){return!!this.fragments.length&&r(this.fragments[this.fragments.length-1].programDateTime)}get levelTargetDuration(){return this.averagetargetduration||this.targetduration||10}get drift(){const e=this.driftEndTime-this.driftStartTime;if(e>0){return 1e3*(this.driftEnd-this.driftStart)/e}return 1}get edge(){return this.partEnd||this.fragmentEnd}get partEnd(){var e;return null!=(e=this.partList)&&e.length?this.partList[this.partList.length-1].end:this.fragmentEnd}get fragmentEnd(){return this.fragments.length?this.fragments[this.fragments.length-1].end:0}get fragmentStart(){return this.fragments.length?this.fragments[0].start:0}get age(){return this.advancedDateTime?Math.max(Date.now()-this.advancedDateTime,0)/1e3:0}get lastPartIndex(){var e;return null!=(e=this.partList)&&e.length?this.partList[this.partList.length-1].index:-1}get maxPartIndex(){const e=this.partList;if(e){const t=this.lastPartIndex;if(-1!==t){for(let n=e.length;n--;)if(e[n].index>t)return e[n].index;return t}}return 0}get lastPartSn(){var e;return null!=(e=this.partList)&&e.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}get expired(){if(this.live&&this.age&&this.misses<3){const e=this.partEnd-this.fragmentStart;return this.age>Math.max(e,this.totalduration)+this.levelTargetDuration}return!1}}function gn(e,t){return e.length===t.length&&!e.some(((e,n)=>e!==t[n]))}function mn(e,t){return!e&&!t||!(!e||!t)&&gn(e,t)}function _n(e){return"AES-128"===e||"AES-256"===e||"AES-256-CTR"===e}function Tn(e){switch(e){case"AES-128":case"AES-256":return Ht;case"AES-256-CTR":return jt;default:throw new Error(`invalid full segment method ${e}`)}}function En(e){return Uint8Array.from(atob(e),(e=>e.charCodeAt(0)))}function yn(e){return Uint8Array.from(unescape(encodeURIComponent(e)),(e=>e.charCodeAt(0)))}function Sn(e){const t=function(e,t,n){const r=e[t];e[t]=e[n],e[n]=r};t(e,0,3),t(e,1,2),t(e,4,5),t(e,6,7)}function vn(e){const t=e.split(":");let n=null;if("data"===t[0]&&2===t.length){const e=t[1].split(";"),r=e[e.length-1].split(",");if(2===r.length){const t="base64"===r[0],s=r[1];t?(e.splice(-1,1),n=En(s)):n=function(e){const t=yn(e).subarray(0,16),n=new Uint8Array(16);return n.set(t,16-t.length),n}(s)}}return n}const bn="undefined"!=typeof self?self:void 0;var In={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.fps",PLAYREADY:"com.microsoft.playready",WIDEVINE:"com.widevine.alpha"},An="org.w3.clearkey",Rn="com.apple.streamingkeydelivery",Cn="com.microsoft.playready",kn="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed";function Ln(e){switch(e){case Rn:return In.FAIRPLAY;case Cn:return In.PLAYREADY;case kn:return In.WIDEVINE;case An:return In.CLEARKEY}}function On(e){switch(e){case In.FAIRPLAY:return Rn;case In.PLAYREADY:return Cn;case In.WIDEVINE:return kn;case In.CLEARKEY:return An}}function Nn(e){const{drmSystems:t,widevineLicenseUrl:n}=e,r=t?[In.FAIRPLAY,In.WIDEVINE,In.PLAYREADY,In.CLEARKEY].filter((e=>!!t[e])):[];return!r[In.WIDEVINE]&&n&&r.push(In.WIDEVINE),r}const wn=null!=bn&&null!=(Pn=bn.navigator)&&Pn.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null;var Pn;function Mn(e){const t=new Uint16Array(e.buffer,e.byteOffset,e.byteLength/2),n=String.fromCharCode.apply(null,Array.from(t)),r=n.substring(n.indexOf("<"),n.length),s=(new DOMParser).parseFromString(r,"text/xml").getElementsByTagName("KID")[0];if(s){const e=s.childNodes[0]?s.childNodes[0].nodeValue:s.getAttribute("VALUE");if(e){const t=En(e).subarray(0,16);return Sn(t),t}}return null}let Dn={};class xn{static clearKeyUriToKeyIdMap(){Dn={}}static setKeyIdForUri(e,t){Dn[e]=t}static addKeyIdForUri(e){const t=Object.keys(Dn).length%Number.MAX_SAFE_INTEGER,n=new Uint8Array(16);return new DataView(n.buffer,12,4).setUint32(0,t),Dn[e]=n,n}constructor(e,t,n,r=[1],s=null,i){this.uri=void 0,this.method=void 0,this.keyFormat=void 0,this.keyFormatVersions=void 0,this.encrypted=void 0,this.isCommonEncryption=void 0,this.iv=null,this.key=null,this.keyId=null,this.pssh=null,this.method=e,this.uri=t,this.keyFormat=n,this.keyFormatVersions=r,this.iv=s,this.encrypted=!!e&&"NONE"!==e,this.isCommonEncryption=this.encrypted&&!_n(e),null!=i&&i.startsWith("0x")&&(this.keyId=new Uint8Array(P(i)))}matches(e){return e.uri===this.uri&&e.method===this.method&&e.encrypted===this.encrypted&&e.keyFormat===this.keyFormat&&gn(e.keyFormatVersions,this.keyFormatVersions)&&mn(e.iv,this.iv)&&mn(e.keyId,this.keyId)}isSupported(){if(this.method){if(_n(this.method)||"NONE"===this.method)return!0;if("identity"===this.keyFormat)return"SAMPLE-AES"===this.method;switch(this.keyFormat){case Rn:case kn:case Cn:case An:return-1!==["SAMPLE-AES","SAMPLE-AES-CENC","SAMPLE-AES-CTR"].indexOf(this.method)}}return!1}getDecryptData(e,t){if(!this.encrypted||!this.uri)return null;if(_n(this.method)){let t=this.iv;t||("number"!=typeof e&&(k.warn(`missing IV for initialization segment with method="${this.method}" - compliance issue`),e=0),t=function(e){const t=new Uint8Array(16);for(let n=12;n<16;n++)t[n]=e>>8*(15-n)&255;return t}(e));return new xn(this.method,this.uri,"identity",this.keyFormatVersions,t)}if(this.keyId){const e=Dn[this.uri];if(e&&!gn(this.keyId,e)&&xn.setKeyIdForUri(this.uri,this.keyId),this.pssh)return this}const n=vn(this.uri);if(n)switch(this.keyFormat){case kn:if(this.pssh=n,!this.keyId){const e=function(e){const t=[];if(e instanceof ArrayBuffer){const n=e.byteLength;let r=0;for(;r+32<n;){const n=be(new DataView(e,r));t.push(n),r+=n.size}}return t}(n.buffer);if(e.length){var r;const t=e[0];this.keyId=null!=(r=t.kids)&&r.length?t.kids[0]:null}}this.keyId||(this.keyId=Un(t));break;case Cn:{const e=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]);this.pssh=ve(e,0,n),this.keyId=Mn(n);break}default:{let e=n.subarray(0,16);if(16!==e.length){const t=new Uint8Array(16);t.set(e,16-e.length),e=t}this.keyId=e;break}}if(!this.keyId||16!==this.keyId.byteLength){let e;e=function(e){const t=null==e?void 0:e[kn];if(t)return t.keyId;return null}(t),e||(e=Un(t),e||(e=Dn[this.uri])),e&&(this.keyId=e,xn.setKeyIdForUri(this.uri,e))}return this}}function Un(e){const t=null==e?void 0:e[Cn];if(t){const e=vn(t.uri);if(e)return Mn(e)}return null}const Bn=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-(SESSION-DATA|SESSION-KEY|DEFINE|CONTENT-STEERING|START):([^\r\n]*)[\r\n]+/g,Fn=/#EXT-X-MEDIA:(.*)/g,$n=/^#EXT(?:INF|-X-TARGETDURATION):/m,Gn=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[^\r\n]*)/.source,/#.*/.source].join("|"),"g"),Hn=new RegExp([/#EXT-X-(PROGRAM-DATE-TIME|BYTERANGE|DATERANGE|DEFINE|KEY|MAP|PART|PART-INF|PLAYLIST-TYPE|PRELOAD-HINT|RENDITION-REPORT|SERVER-CONTROL|SKIP|START):(.+)/.source,/#EXT-X-(BITRATE|DISCONTINUITY-SEQUENCE|MEDIA-SEQUENCE|TARGETDURATION|VERSION): *(\d+)/.source,/#EXT-X-(DISCONTINUITY|ENDLIST|GAP|INDEPENDENT-SEGMENTS)/.source,/(#)([^:]*):(.*)/.source,/(#)(.*)(?:.*)\r?\n?/.source].join("|"));class jn{static findGroup(e,t){for(let n=0;n<e.length;n++){const r=e[n];if(r.id===t)return r}}static resolve(e,t){return H.buildAbsoluteURL(t,e,{alwaysNormalize:!0})}static isMediaPlaylist(e){return $n.test(e)}static parseMasterPlaylist(e,t){const n={contentSteering:null,levels:[],playlistParsingError:null,sessionData:null,sessionKeys:null,startTimeOffset:null,variableList:null,hasVariableRefs:sn(e)},r=[];if(Bn.lastIndex=0,!e.startsWith("#EXTM3U"))return n.playlistParsingError=new Error("no EXTM3U delimiter"),n;let s;for(;null!=(s=Bn.exec(e));)if(s[1]){var i;const e=new dn(s[1],n),a=an(n,s[2]),o={attrs:e,bitrate:e.decimalInteger("BANDWIDTH")||e.decimalInteger("AVERAGE-BANDWIDTH"),name:e.NAME,url:jn.resolve(a,t)},l=e.decimalResolution("RESOLUTION");l&&(o.width=l.width,o.height=l.height),Yn(e.CODECS,o);const c=e["SUPPLEMENTAL-CODECS"];c&&(o.supplemental={},Yn(c,o.supplemental)),null!=(i=o.unknownCodecs)&&i.length||r.push(o),n.levels.push(o)}else if(s[3]){const e=s[3],r=s[4];switch(e){case"SESSION-DATA":{const e=new dn(r,n),t=e["DATA-ID"];t&&(null===n.sessionData&&(n.sessionData={}),n.sessionData[t]=e);break}case"SESSION-KEY":{const e=Vn(r,t,n);e.encrypted&&e.isSupported()?(null===n.sessionKeys&&(n.sessionKeys=[]),n.sessionKeys.push(e)):k.warn(`[Keys] Ignoring invalid EXT-X-SESSION-KEY tag: "${r}"`);break}case"DEFINE":on(n,new dn(r,n),t);break;case"CONTENT-STEERING":{const e=new dn(r,n);n.contentSteering={uri:jn.resolve(e["SERVER-URI"],t),pathwayId:e["PATHWAY-ID"]||"."};break}case"START":n.startTimeOffset=qn(r)}}const a=r.length>0&&r.length<n.levels.length;return n.levels=a?r:n.levels,0===n.levels.length&&(n.playlistParsingError=new Error("no levels found in manifest")),n}static parseMasterPlaylistMedia(e,t,n){let r;const s={},i=n.levels,a={AUDIO:i.map((e=>({id:e.attrs.AUDIO,audioCodec:e.audioCodec}))),SUBTITLES:i.map((e=>({id:e.attrs.SUBTITLES,textCodec:e.textCodec}))),"CLOSED-CAPTIONS":[]};let o=0;for(Fn.lastIndex=0;null!==(r=Fn.exec(e));){const e=new dn(r[1],n),i=e.TYPE;if(i){const n=a[i],r=s[i]||[];s[i]=r;const l=e.LANGUAGE,c=e["ASSOC-LANGUAGE"],u=e.CHANNELS,d=e.CHARACTERISTICS,h=e["INSTREAM-ID"],f={attrs:e,bitrate:0,id:o++,groupId:e["GROUP-ID"]||"",name:e.NAME||l||"",type:i,default:e.bool("DEFAULT"),autoselect:e.bool("AUTOSELECT"),forced:e.bool("FORCED"),lang:l,url:e.URI?jn.resolve(e.URI,t):""};if(c&&(f.assocLang=c),u&&(f.channels=u),d&&(f.characteristics=d),h&&(f.instreamId=h),null!=n&&n.length){const e=jn.findGroup(n,f.groupId)||n[0];zn(f,e,"audioCodec"),zn(f,e,"textCodec")}r.push(f)}}return s}static parseLevelPlaylist(e,t,n,s,i,a){var o;const l={url:t},c=new pn(t),u=c.fragments,d=[];let h,f,p,g,m=null,_=0,T=0,y=0,S=0,v=0,b=null,I=new z(s,l),A=-1,R=!1,C=null;if(Gn.lastIndex=0,c.m3u8=e,c.hasVariableRefs=sn(e),"#EXTM3U"!==(null==(o=Gn.exec(e))?void 0:o[0]))return c.playlistParsingError=new Error("Missing format identifier #EXTM3U"),c;for(;null!==(h=Gn.exec(e));){R&&(R=!1,I=new z(s,l),I.playlistOffset=y,I.setStart(y),I.sn=_,I.cc=S,v&&(I.bitrate=v),I.level=n,m&&(I.initSegment=m,m.rawProgramDateTime&&(I.rawProgramDateTime=m.rawProgramDateTime,m.rawProgramDateTime=null),C&&(I.setByteRange(C),C=null)));const e=h[1];if(e){I.duration=parseFloat(e);const t=(" "+h[2]).slice(1);I.title=t||null,I.tagList.push(t?["INF",e,t]:["INF",e])}else if(h[3]){if(r(I.duration)){I.playlistOffset=y,I.setStart(y),p&&Qn(I,p,c),I.sn=_,I.level=n,I.cc=S,u.push(I);const e=(" "+h[3]).slice(1);I.relurl=an(c,e),Jn(I,b,d),b=I,y+=I.duration,_++,T=0,R=!0}}else{if(h=h[0].match(Hn),!h){k.warn("No matches on slow regex match for level playlist!");continue}for(f=1;f<h.length&&void 0===h[f];f++);const e=(" "+h[f]).slice(1),i=(" "+h[f+1]).slice(1),o=h[f+2]?(" "+h[f+2]).slice(1):null;switch(e){case"BYTERANGE":b?I.setByteRange(i,b):I.setByteRange(i);break;case"PROGRAM-DATE-TIME":I.rawProgramDateTime=i,I.tagList.push(["PROGRAM-DATE-TIME",i]),-1===A&&(A=u.length);break;case"PLAYLIST-TYPE":c.type&&Zn(c,e,h),c.type=i.toUpperCase();break;case"MEDIA-SEQUENCE":0!==c.startSN?Zn(c,e,h):u.length>0&&er(c,e,h),_=c.startSN=parseInt(i);break;case"SKIP":{c.skippedSegments&&Zn(c,e,h);const t=new dn(i,c),n=t.decimalInteger("SKIPPED-SEGMENTS");if(r(n)){c.skippedSegments+=n;for(let e=n;e--;)u.push(null);_+=n}const s=t.enumeratedString("RECENTLY-REMOVED-DATERANGES");s&&(c.recentlyRemovedDateranges=(c.recentlyRemovedDateranges||[]).concat(s.split("\t")));break}case"TARGETDURATION":0!==c.targetduration&&Zn(c,e,h),c.targetduration=Math.max(parseInt(i),1);break;case"VERSION":null!==c.version&&Zn(c,e,h),c.version=parseInt(i);break;case"INDEPENDENT-SEGMENTS":break;case"ENDLIST":c.live||Zn(c,e,h),c.live=!1;break;case"#":(i||o)&&I.tagList.push(o?[i,o]:[i]);break;case"DISCONTINUITY":S++,I.tagList.push(["DIS"]);break;case"GAP":I.gap=!0,I.tagList.push([e]);break;case"BITRATE":I.tagList.push([e,i]),v=1e3*parseInt(i),r(v)?I.bitrate=v:v=0;break;case"DATERANGE":{const e=new dn(i,c),t=new fn(e,c.dateRanges[e.ID],c.dateRangeTagCount);c.dateRangeTagCount++,t.isValid||c.skippedSegments?c.dateRanges[t.id]=t:k.warn(`Ignoring invalid DATERANGE tag: "${i}"`),I.tagList.push(["EXT-X-DATERANGE",i]);break}case"DEFINE":{const e=new dn(i,c);"IMPORT"in e?ln(c,e,a):on(c,e,t)}break;case"DISCONTINUITY-SEQUENCE":0!==c.startCC?Zn(c,e,h):u.length>0&&er(c,e,h),c.startCC=S=parseInt(i);break;case"KEY":{const e=Vn(i,t,c);if(e.isSupported()){if("NONE"===e.method){p=void 0;break}p||(p={});const t=p[e.keyFormat];null!=t&&t.matches(e)||(t&&(p=E({},p)),p[e.keyFormat]=e)}else k.warn(`[Keys] Ignoring unsupported EXT-X-KEY tag: "${i}"`);break}case"START":c.startTimeOffset=qn(i);break;case"MAP":{const e=new dn(i,c);if(I.duration){const t=new z(s,l);Xn(t,e,n,p),m=t,I.initSegment=m,m.rawProgramDateTime&&!I.rawProgramDateTime&&(I.rawProgramDateTime=m.rawProgramDateTime)}else{const t=I.byteRangeEndOffset;if(t){const e=I.byteRangeStartOffset;C=`${t-e}@${e}`}else C=null;Xn(I,e,n,p),m=I,R=!0}m.cc=S;break}case"SERVER-CONTROL":g&&Zn(c,e,h),g=new dn(i),c.canBlockReload=g.bool("CAN-BLOCK-RELOAD"),c.canSkipUntil=g.optionalFloat("CAN-SKIP-UNTIL",0),c.canSkipDateRanges=c.canSkipUntil>0&&g.bool("CAN-SKIP-DATERANGES"),c.partHoldBack=g.optionalFloat("PART-HOLD-BACK",0),c.holdBack=g.optionalFloat("HOLD-BACK",0);break;case"PART-INF":{c.partTarget&&Zn(c,e,h);const t=new dn(i);c.partTarget=t.decimalFloatingPoint("PART-TARGET");break}case"PART":{let e=c.partList;e||(e=c.partList=[]);const t=T>0?e[e.length-1]:void 0,n=T++,r=new dn(i,c),s=new J(r,I,l,n,t);e.push(s),I.duration+=s.duration;break}case"PRELOAD-HINT":{const e=new dn(i,c);c.preloadHint=e;break}case"RENDITION-REPORT":{const e=new dn(i,c);c.renditionReports=c.renditionReports||[],c.renditionReports.push(e);break}default:k.warn(`line parsed but not handled: ${h}`)}}}b&&!b.relurl?(u.pop(),y-=b.duration,c.partList&&(c.fragmentHint=b)):c.partList&&(Jn(I,b,d),I.cc=S,c.fragmentHint=I,p&&Qn(I,p,c)),c.targetduration||(c.playlistParsingError=new Error("Missing Target Duration"));const L=u.length,O=u[0],N=u[L-1];if(y+=c.skippedSegments*c.targetduration,y>0&&L&&N){c.averagetargetduration=y/L;const e=N.sn;c.endSN="initSegment"!==e?e:0,c.live||(N.endList=!0),A>0&&(!function(e,t){let n=e[t];for(let r=t;r--;){const t=e[r];if(!t)return;t.programDateTime=n.programDateTime-1e3*t.duration,n=t}}(u,A),O&&d.unshift(O))}return c.fragmentHint&&(y+=c.fragmentHint.duration),c.totalduration=y,d.length&&c.dateRangeTagCount&&O&&Wn(d,c),c.endCC=S,c}}function Wn(e,t){let n=e.length;
vendor: 4,244 bytes, line 1
1if(!n){if(!t.hasProgramDateTime)return;{const r=t.fragments[t.fragments.length-1];e.push(r),n++}}const r=e[n-1],s=t.live?1/0:t.totalduration,i=Object.keys(t.dateRanges);for(let o=i.length;o--;){const l=t.dateRanges[i[o]],c=l.startDate.getTime();l.tagAnchor=r.ref;for(let r=n;r--;){var a;if((null==(a=e[r])?void 0:a.sn)<t.startSN)break;const n=Kn(t,c,e,r,s);if(-1!==n){l.tagAnchor=t.fragments[n].ref;break}}}}function Kn(e,t,n,r,s){const i=n[r];if(i){const o=i.programDateTime;if(t>=o||0===r){var a;if(t<=o+1e3*(((null==(a=n[r+1])?void 0:a.start)||s)-i.start)){const s=n[r].sn-e.startSN;if(s<0)return-1;const i=e.fragments;if(i.length>n.length){for(let a=(n[r+1]||i[i.length-1]).sn-e.startSN;a>s;a--){const e=i[a].programDateTime;if(t>=e&&t<e+1e3*i[a].duration)return a}}return s}}}return-1}function Vn(e,t,n){var r,s;const i=new dn(e,n),a=null!=(r=i.METHOD)?r:"",o=i.URI,l=i.hexadecimalInteger("IV"),c=i.KEYFORMATVERSIONS,u=null!=(s=i.KEYFORMAT)?s:"identity";o&&i.IV&&!l&&k.error(`Invalid IV: ${i.IV}`);const d=o?jn.resolve(o,t):"",h=(c||"1").split("/").map(Number).filter(Number.isFinite);return new xn(a,d,u,h,l,i.KEYID)}function qn(e){const t=new dn(e).decimalFloatingPoint("TIME-OFFSET");return r(t)?t:null}function Yn(e,t){let n=(e||"").split(/[ ,]+/).filter((e=>e));["video","audio","text"].forEach((e=>{const r=n.filter((t=>Re(t,e)));r.length&&(t[`${e}Codec`]=r.map((e=>e.split("/")[0])).join(","),n=n.filter((e=>-1===r.indexOf(e))))})),t.unknownCodecs=n}function zn(e,t,n){const r=t[n];r&&(e[n]=r)}function Jn(e,t,n){e.rawProgramDateTime?n.push(e):null!=t&&t.programDateTime&&(e.programDateTime=t.endProgramDateTime)}function Xn(e,t,n,r){e.relurl=t.URI,t.BYTERANGE&&e.setByteRange(t.BYTERANGE),e.level=n,e.sn="initSegment",r&&(e.levelkeys=r),e.initSegment=null}function Qn(e,t,n){e.levelkeys=t;const{encryptedFragments:r}=n;r.length&&r[r.length-1].levelkeys===t||!Object.keys(t).some((e=>t[e].isCommonEncryption))||r.push(e)}function Zn(e,t,n){e.playlistParsingError=new Error(`#EXT-X-${t} must not appear more than once (${n[0]})`)}function er(e,t,n){e.playlistParsingError=new Error(`#EXT-X-${t} must appear before the first Media Segment (${n[0]})`)}function tr(e,t){const n=t.startPTS;if(r(n)){let r,s=0;t.sn>e.sn?(s=n-e.start,r=e):(s=e.start-n,r=t),r.duration!==s&&r.setDuration(s)}else if(t.sn>e.sn){e.cc===t.cc&&e.minEndPTS?t.setStart(e.start+(e.minEndPTS-e.start)):t.setStart(e.start+e.duration)}else t.setStart(Math.max(e.start-t.duration,0))}function nr(e,t,n,s,i,a,o){s-n<=0&&(o.warn("Fragment should have a positive duration",t),s=n+t.duration,a=i+t.duration);let l=n,c=s;const u=t.startPTS,d=t.endPTS;if(r(u)){const h=Math.abs(u-n);e&&h>e.totalduration?o.warn(`media timestamps and playlist times differ by ${h}s for level ${t.level} ${e.url}`):r(t.deltaPTS)?t.deltaPTS=Math.max(h,t.deltaPTS):t.deltaPTS=h,l=Math.max(n,u),n=Math.min(n,u),i=void 0!==t.startDTS?Math.min(i,t.startDTS):i,c=Math.min(s,d),s=Math.max(s,d),a=void 0!==t.endDTS?Math.max(a,t.endDTS):a}const h=n-t.start;0!==t.start&&t.setStart(n),t.setDuration(s-t.start),t.startPTS=n,t.maxStartPTS=l,t.startDTS=i,t.endPTS=s,t.minEndPTS=c,t.endDTS=a;const f=t.sn;if(!e||f<e.startSN||f>e.endSN)return 0;let p;const g=f-e.startSN,m=e.fragments;for(m[g]=t,p=g;p>0;p--)tr(m[p],m[p-1]);for(p=g;p<m.length-1;p++)tr(m[p],m[p+1]);return e.fragmentHint&&tr(m[m.length-1],e.fragmentHint),e.PTSKnown=e.alignedSliding=!0,h}function rr(e,t,n){if(e===t)return;let s=null;const i=e.fragments;for(let e=i.length-1;e>=0;e--){const t=i[e].initSegment;if(t){s=t;break}}let a;e.fragmentHint&&delete e.fragmentHint.endPTS,function(e,t,n){const r=t.skippedSegments,s=Math.max(e.startSN,t.startSN)-t.startSN,i=(e.fragmentHint?1:0)+(r?t.endSN:Math.min(e.endSN,t.endSN))-t.startSN,a=t.startSN-e.startSN,o=t.fragmentHint?t.fragments.concat(t.fragmentHint):t.fragments,l=e.fragmentHint?e.fragments.concat(e.fragmentHint):e.fragments;for(let c=s;c<=i;c++){const s=l[a+c];let i=o[c];if(r&&!i&&s&&(i=t.fragments[c]=s),s&&i){n(s,i,c,o);const r=s.relurl,a=i.relurl;if(r&&hr(r,a))return void(t.playlistParsingError=sr(`media sequence mismatch ${i.sn}:`,e,t,s,i));if(s.cc!==i.cc)return void(t.playlistParsingError=sr(`discontinuity sequence mismatch (${s.cc}!=${i.cc})`,e,t,s,i))}}}(e,t,((e,n,i,o)=>
vendor: 7,247 bytes, line 1
1{if((!t.startCC||t.skippedSegments)&&n.cc!==e.cc){const r=e.cc-n.cc;for(let e=i;e<o.length;e++)o[e].cc+=r;t.endCC=o[o.length-1].cc}r(e.startPTS)&&r(e.endPTS)&&(n.setStart(n.startPTS=e.startPTS),n.startDTS=e.startDTS,n.maxStartPTS=e.maxStartPTS,n.endPTS=e.endPTS,n.endDTS=e.endDTS,n.minEndPTS=e.minEndPTS,n.setDuration(e.endPTS-e.startPTS),n.duration&&(a=n),t.PTSKnown=t.alignedSliding=!0),e.hasStreams&&(n.elementaryStreams=e.elementaryStreams),n.loader=e.loader,e.hasStats&&(n.stats=e.stats),e.initSegment&&(n.initSegment=e.initSegment,s=e.initSegment)}));const o=t.fragments,l=t.fragmentHint?o.concat(t.fragmentHint):o;if(s&&l.forEach((e=>{var t;!e||e.initSegment&&e.initSegment.relurl!==(null==(t=s)?void 0:t.relurl)||(e.initSegment=s)})),t.skippedSegments){if(t.deltaUpdateFailed=o.some((e=>!e)),t.deltaUpdateFailed){n.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(let e=t.skippedSegments;e--;)o.shift();t.startSN=o[0].sn}else{t.canSkipDateRanges&&(t.dateRanges=function(e,t,n){const{dateRanges:r,recentlyRemovedDateranges:s}=t,i=E({},e);s&&s.forEach((e=>{delete i[e]}));const a=Object.keys(i).length;if(!a)return r;return Object.keys(r).forEach((e=>{const t=i[e],s=new fn(r[e].attr,t);s.isValid?(i[e]=s,t||(s.tagOrder+=a)):n.warn(`Ignoring invalid Playlist Delta Update DATERANGE tag: "${rt(r[e].attr)}"`)})),i}(e.dateRanges,t,n));const r=e.fragments.filter((e=>e.rawProgramDateTime));if(e.hasProgramDateTime&&!t.hasProgramDateTime)for(let e=1;e<l.length;e++)null===l[e].programDateTime&&Jn(l[e],l[e-1],r);Wn(r,t)}t.endCC=o[o.length-1].cc}if(!t.startCC){var c;const n=lr(e,t.startSN-1);t.startCC=null!=(c=null==n?void 0:n.cc)?c:o[0].cc}!function(e,t,n){if(e&&t){let r=0;for(let s=0,i=e.length;s<=i;s++){const i=e[s],a=t[s+r];i&&a&&i.index===a.index&&i.fragment.sn===a.fragment.sn?n(i,a):r--}}}(e.partList,t.partList,((e,t)=>{t.elementaryStreams=e.elementaryStreams,t.stats=e.stats})),a?nr(t,a,a.startPTS,a.endPTS,a.startDTS,a.endDTS,n):ir(e,t),o.length&&(t.totalduration=t.edge-o[0].start),t.driftStartTime=e.driftStartTime,t.driftStart=e.driftStart;const u=t.advancedDateTime;if(t.advanced&&u){const e=t.edge;t.driftStart||(t.driftStartTime=u,t.driftStart=e),t.driftEndTime=u,t.driftEnd=e}else t.driftEndTime=e.driftEndTime,t.driftEnd=e.driftEnd,t.advancedDateTime=e.advancedDateTime;-1===t.requestScheduled&&(t.requestScheduled=e.requestScheduled)}function sr(e,t,n,r,s){return new Error(`${e} ${s.url}\nPlaylist starting @${t.startSN}\n${t.m3u8}\n\nPlaylist starting @${n.startSN}\n${n.m3u8}`)}function ir(e,t,n=!0){const r=t.startSN+t.skippedSegments-e.startSN,s=e.fragments,i=r>=0;let a=0;if(i&&r<s.length)a=s[r].start;else if(i&&t.startSN===e.endSN+1)a=e.fragmentEnd;else if(i&&n)a=e.fragmentStart+r*t.levelTargetDuration;else{if(t.skippedSegments||0!==t.fragmentStart)return;a=e.fragmentStart}ar(t,a)}function ar(e,t){if(t){const n=e.fragments;for(let r=e.skippedSegments;r<n.length;r++)n[r].addStart(t);e.fragmentHint&&e.fragmentHint.addStart(t)}}function or(e,t=1/0){let n=1e3*e.targetduration;if(e.updated){const r=e.fragments,s=4;if(r.length&&n*s>t){const e=1e3*r[r.length-1].duration;e<n&&(n=e)}}else n/=2;return Math.round(n)}function lr(e,t,n){if(!e)return null;let r=e.fragments[t-e.startSN];return r||(r=e.fragmentHint,r&&r.sn===t?r:t<e.startSN&&n&&n.sn===t?n:null)}function cr(e,t,n){return e?ur(e.partList,t,n):null}function ur(e,t,n){if(e)for(let r=e.length;r--;){const s=e[r];if(s.index===n&&s.fragment.sn===t)return s}return null}function dr(e){e.forEach(((e,t)=>{var n;null==(n=e.details)||n.fragments.forEach((e=>{e.level=t,e.initSegment&&(e.initSegment.level=t)}))}))}function hr(e,t){return!(e===t||!t)&&fr(e)!==fr(t)}function fr(e){return e.replace(/\?[^?]*$/,"")}function pr(e,t){for(let r=0,s=e.length;r<s;r++){var n;if((null==(n=e[r])?void 0:n.cc)===t)return e[r]}return null}function gr(e,t){const n=e.start+t;e.startPTS=n,e.setStart(n),e.endPTS=n+e.duration}function mr(e,t){const n=t.fragments;for(let t=0,r=n.length;t<r;t++)gr(n[t],e);t.fragmentHint&&gr(t.fragmentHint,e),t.alignedSliding=!0}function _r(e,t){if(!function(e,t){return!!(e&&t.startCC<e.endCC&&t.endCC>e.startCC)}(t,e))return;const n=Math.min(t.endCC,e.endCC),r=pr(t.fragments,n),s=pr(e.fragments,n);if(!r||!s)return;k.log(`Aligning playlist at start of dicontinuity sequence ${n}`);mr(r.start-s.start,e)}function Tr(e,t){if(!e.hasProgramDateTime||!t.hasProgramDateTime)return;const n=e.fragments,r=t.fragments;if(!n.length||!r.length)return;let s,i;const a=Math.min(t.endCC,e.endCC);t.startCC<a&&e.startCC<a&&(s=pr(r,a),i=pr(n,a)),s&&i||(s=r[Math.floor(r.length/2)],i=pr(n,s.cc)||n[Math.floor(n.length/2)]);const o=s.programDateTime,l=i.programDateTime;if(!o||!l)return;mr((l-o)/1e3-(i.start-s.start),e)}function Er(e,t,n){yr(e,t,n),e.addEventListener(t,n)}function yr(e,t,n){e.removeEventListener(t,n)}const Sr=function(e){let t="";const n=e.length;for(let r=0;r<n;r++)t+=`[${e.start(r).toFixed(3)}-${e.end(r).toFixed(3)}]`;return t},vr="STOPPED",br="IDLE",Ir="KEY_LOADING",Ar="FRAG_LOADING",Rr="FRAG_LOADING_WAITING_RETRY",Cr="WAITING_TRACK",kr="PARSING",Lr="PARSED",Or="ENDED",Nr="ERROR",wr="WAITING_INIT_PTS",Pr="WAITING_LEVEL";class Mr extends Zt{constructor(e,t,n,s,i){super(s,e.logger),this.hls=void 0,this.fragPrevious=null,this.fragCurrent=null,this.fragmentTracker=void 0,this.transmuxer=null,this._state=vr,this.playlistType=void 0,this.media=null,this.mediaBuffer=null,this.config=void 0,this.bitrateTest=!1,this.lastCurrentTime=0,this.nextLoadPosition=0,this.startPosition=0,this.startTimeOffset=null,this.retryDate=0,this.levels=null,this.fragmentLoader=void 0,this.keyLoader=void 0,this.levelLastLoaded=null,this.startFragRequested=!1,this.decrypter=void 0,this.initPTS=[],this.buffering=!0,this.loadingParts=!1,this.loopSn=void 0,this.onMediaSeeking=()=>{const{config:e,fragCurrent:t,media:n,mediaBuffer:s,state:i}=this,a=n?n.currentTime:0,o=nn.bufferInfo(s||n,a,e.maxBufferHole),l=!o.len;if(this.log(`Media seeking to ${r(a)?a.toFixed(3):a}, state: ${i}, ${l?"out of":"in"} buffer`),this.state===Or)this.resetLoadingState();else if(t){const n=e.maxFragLookUpTolerance,r=t.start-n,s=t.start+t.duration+n;if(l||s<o.start||r>o.end){const e=a>s;(a<r||e)&&(e&&t.loader&&(this.log(`Cancelling fragment load for seek (sn: ${t.sn})`),t.abortRequests(),this.resetLoadingState()),this.fragPrevious=null)}}if(n){this.fragmentTracker.removeFragmentsInRange(a,1/0,this.playlistType,!0);if(a>this.lastCurrentTime&&(this.lastCurrentTime=a),!this.loadingParts){const e=Math.max(o.end,a),t=this.shouldLoadParts(this.getLevelDetails(),e);t&&(this.log(`LL-Part loading ON after seeking to ${a.toFixed(2)} with buffer @${e.toFixed(2)}`),this.loadingParts=t)}}this.hls.hasEnoughToStart||(this.log(`Setting ${l?"startPosition":"nextLoadPosition"} to ${a} for seek without enough to start`),this.nextLoadPosition=a,l&&(this.startPosition=a)),l&&this.state===br&&this.tickImmediate()},this.onMediaEnded=()=>{this.log("setting startPosition to 0 because media ended"),this.startPosition=this.lastCurrentTime=0},this.playlistType=i,this.hls=e,this.fragmentLoader=new zt(e.config),this.keyLoader=n,this.fragmentTracker=t,this.config=e.config,this.decrypter=new qt(e.config)}registerListeners(){const{hls:e}=this;
vendor: 12,991 bytes, line 1
1e.on(l.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(l.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(l.MANIFEST_LOADING,this.onManifestLoading,this),e.on(l.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(l.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(l.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(l.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(l.MANIFEST_LOADING,this.onManifestLoading,this),e.off(l.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(l.ERROR,this.onError,this)}doTick(){this.onTickEnd()}onTickEnd(){}startLoad(e){}stopLoad(){if(this.state===vr)return;this.fragmentLoader.abort(),this.keyLoader.abort(this.playlistType);const e=this.fragCurrent;null!=e&&e.loader&&(e.abortRequests(),this.fragmentTracker.removeFragment(e)),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=vr}get startPositionValue(){const{nextLoadPosition:e,startPosition:t}=this;return-1===t&&e?e:t}get bufferingEnabled(){return this.buffering}pauseBuffering(){this.buffering=!1}resumeBuffering(){this.buffering=!0}get inFlightFrag(){return{frag:this.fragCurrent,state:this.state}}_streamEnded(e,t){if(t.live||!this.media)return!1;const n=e.end||0,r=this.config.timelineOffset||0;if(n<=r)return!1;const s=e.buffered;this.config.maxBufferHole&&s&&s.length>1&&(e=nn.bufferedInfo(s,e.start,0));const i=e.nextStart;if(i&&i>r&&i<t.edge)return!1;if(this.media.currentTime<e.start)return!1;const a=t.partList;if(null!=a&&a.length){const e=a[a.length-1];return nn.isBuffered(this.media,e.start+e.duration/2)}const o=t.fragments[t.fragments.length-1].type;return this.fragmentTracker.isEndListAppended(o)}getLevelDetails(){if(this.levels&&null!==this.levelLastLoaded)return this.levelLastLoaded.details}get timelineOffset(){const e=this.config.timelineOffset;var t;return e?(null==(t=this.getLevelDetails())?void 0:t.appliedTimelineOffset)||e:0}onMediaAttached(e,t){const n=this.media=this.mediaBuffer=t.media;Er(n,"seeking",this.onMediaSeeking),Er(n,"ended",this.onMediaEnded);const r=this.config;this.levels&&r.autoStartLoad&&this.state===vr&&this.startLoad(r.startPosition)}onMediaDetaching(e,t){const n=!!t.transferMedia,r=this.media;if(null!==r){if(r.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),yr(r,"seeking",this.onMediaSeeking),yr(r,"ended",this.onMediaEnded),this.keyLoader&&!n&&this.keyLoader.detach(),this.media=this.mediaBuffer=null,this.loopSn=void 0,n)return this.resetLoadingState(),void this.resetTransmuxer();this.loadingParts=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()}}onManifestLoading(){this.initPTS=[],this.levels=this.levelLastLoaded=this.fragCurrent=null,this.lastCurrentTime=this.startPosition=0,this.startFragRequested=!1}onError(e,t){}onManifestLoaded(e,t){this.startTimeOffset=t.startTimeOffset}onHandlerDestroying(){this.stopLoad(),this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null),super.onHandlerDestroying(),this.hls=this.onMediaSeeking=this.onMediaEnded=null}onHandlerDestroyed(){this.state=vr,this.fragmentLoader&&this.fragmentLoader.destroy(),this.keyLoader&&this.keyLoader.destroy(),this.decrypter&&this.decrypter.destroy(),this.hls=this.log=this.warn=this.decrypter=this.keyLoader=this.fragmentLoader=this.fragmentTracker=null,super.onHandlerDestroyed()}loadFragment(e,t,n){this.startFragRequested=!0,this._loadFragForPlayback(e,t,n)}_loadFragForPlayback(e,t,n){this._doFragLoad(e,t,n,(e=>{const t=e.frag;if(this.fragContextChanged(t))return this.warn(`${t.type} sn: ${t.sn}${e.part?" part: "+e.part.index:""} of ${this.fragInfo(t,!1,e.part)}) was dropped during download.`),void this.fragmentTracker.removeFragment(t);t.stats.chunkCount++,this._handleFragmentLoadProgress(e)})).then((e=>{if(!e)return;const t=this.state,n=e.frag;this.fragContextChanged(n)?(t===Ar||!this.fragCurrent&&t===kr)&&(this.fragmentTracker.removeFragment(n),this.state=br):("payload"in e&&(this.log(`Loaded ${n.type} sn: ${n.sn} of ${this.playlistLabel()} ${n.level}`),this.hls.trigger(l.FRAG_LOADED,e)),this._handleFragmentLoadComplete(e))})).catch((t=>{this.state!==vr&&this.state!==Nr&&(this.warn(`Frag error: ${(null==t?void 0:t.message)||t}`),this.resetFragmentLoading(e))}))}clearTrackerIfNeeded(e){var t;const{fragmentTracker:n}=this;if(n.getState(e)===Dt){const t=e.type,r=this.getFwdBufferInfo(this.mediaBuffer,t),s=Math.max(e.duration,r?r.len:this.config.maxBufferLength),i=this.backtrackFragment;(1===(i?e.sn-i.sn:0)||this.reduceMaxBufferLength(s,e.duration))&&n.removeFragment(e)}else 0===(null==(t=this.mediaBuffer)?void 0:t.buffered.length)?n.removeAllFragments():n.hasParts(e.type)&&(n.detectPartialFragments({frag:e,part:null,stats:e.stats,id:e.type}),n.getState(e)===xt&&n.removeFragment(e))}checkLiveUpdate(e){if(e.updated&&!e.live){const t=e.fragments[e.fragments.length-1];this.fragmentTracker.detectPartialFragments({frag:t,part:null,stats:t.stats,id:t.type})}e.fragments[0]||(e.deltaUpdateFailed=!0)}waitForLive(e){const t=e.details;return(null==t?void 0:t.live)&&"EVENT"!==t.type&&(this.levelLastLoaded!==e||t.expired)}flushMainBuffer(e,t,n=null){if(!(e-t))return;const r={startOffset:e,endOffset:t,type:n};this.hls.trigger(l.BUFFER_FLUSHING,r)}_loadInitSegment(e,t){this._doFragLoad(e,t).then((e=>{const t=null==e?void 0:e.frag;if(!t||this.fragContextChanged(t)||!this.levels)throw new Error("init load aborted");return e})).then((e=>{const{hls:t}=this,{frag:n,payload:r}=e,s=n.decryptdata;if(r&&r.byteLength>0&&null!=s&&s.key&&s.iv&&_n(s.method)){const i=self.performance.now();return this.decrypter.decrypt(new Uint8Array(r),s.key.buffer,s.iv.buffer,Tn(s.method)).catch((e=>{throw t.trigger(l.ERROR,{type:a.MEDIA_ERROR,details:o.FRAG_DECRYPT_ERROR,fatal:!1,error:e,reason:e.message,frag:n}),e})).then((r=>{const s=self.performance.now();return t.trigger(l.FRAG_DECRYPTED,{frag:n,payload:r,stats:{tstart:i,tdecrypt:s}}),e.payload=r,this.completeInitSegmentLoad(e)}))}return this.completeInitSegmentLoad(e)})).catch((t=>{this.state!==vr&&this.state!==Nr&&(this.warn(t),this.resetFragmentLoading(e))}))}completeInitSegmentLoad(e){const{levels:t}=this;if(!t)throw new Error("init load aborted, missing levels");const n=e.frag.stats;this.state!==vr&&(this.state=br),e.frag.data=new Uint8Array(e.payload),n.parsing.start=n.buffering.start=self.performance.now(),n.parsing.end=n.buffering.end=self.performance.now(),this.tick()}unhandledEncryptionError(e,t){var n,r;const s=e.tracks;if(s&&!t.encrypted&&(null!=(n=s.audio)&&n.encrypted||null!=(r=s.video)&&r.encrypted)&&(!this.config.emeEnabled||!this.keyLoader.emeController)){const e=this.media,n=new Error(`Encrypted track with no key in ${this.fragInfo(t)} (media ${e?"attached mediaKeys: "+e.mediaKeys:"detached"})`);return this.warn(n.message),!e||e.mediaKeys?!1:(this.hls.trigger(l.ERROR,{type:a.KEY_SYSTEM_ERROR,details:o.KEY_SYSTEM_NO_KEYS,fatal:!1,error:n,frag:t}),this.resetTransmuxer(),!0)}return!1}fragContextChanged(e){const{fragCurrent:t}=this;return!e||!t||e.sn!==t.sn||e.level!==t.level}fragBufferedComplete(e,t){const n=this.mediaBuffer?this.mediaBuffer:this.media;if(this.log(`Buffered ${e.type} sn: ${e.sn}${t?" part: "+t.index:""} of ${this.fragInfo(e,!1,t)} > buffer:${n?Sr(nn.getBuffered(n)):"(detached)"})`),Y(e)){var r;if(e.type!==g){const t=e.elementaryStreams;if(!Object.keys(t).some((e=>!!t[e])))return void(this.state=br)}const t=null==(r=this.levels)?void 0:r[e.level];null!=t&&t.fragmentError&&(this.log(`Resetting level fragment error count of ${t.fragmentError} on frag buffered`),t.fragmentError=0)}this.state=br}_handleFragmentLoadComplete(e){const{transmuxer:t}=this;if(!t)return;const{frag:n,part:r,partsLoaded:s}=e,i=!s||0===s.length||s.some((e=>!e)),a=new en(n.level,n.sn,n.stats.chunkCount+1,0,r?r.index:-1,!i);t.flush(a)}_handleFragmentLoadProgress(e){}_doFragLoad(e,t,n=null,s){var i;this.fragCurrent=e;const a=t.details;if(!this.levels||!a)throw new Error(`frag load aborted, missing level${a?"":" detail"}s`);let o=null;if(!e.encrypted||null!=(i=e.decryptdata)&&i.key)e.encrypted||(o=this.keyLoader.loadClear(e,a.encryptedFragments,this.startFragRequested),o&&this.log("[eme] blocking frag load until media-keys acquired"));else if(this.log(`Loading key for ${e.sn} of [${a.startSN}-${a.endSN}], ${this.playlistLabel()} ${e.level}`),this.state=Ir,this.fragCurrent=e,o=this.keyLoader.load(e).then((e=>{if(!this.fragContextChanged(e.frag))return this.hls.trigger(l.KEY_LOADED,e),this.state===Ir&&(this.state=br),e})),this.hls.trigger(l.KEY_LOADING,{frag:e}),null===this.fragCurrent)return this.log("context changed in KEY_LOADING"),Promise.resolve(null);const c=this.fragPrevious;if(Y(e)&&(!c||e.sn!==c.sn)){const n=this.shouldLoadParts(t.details,e.end);n!==this.loadingParts&&(this.log(`LL-Part loading ${n?"ON":"OFF"} loading sn ${null==c?void 0:c.sn}->${e.sn}`),this.loadingParts=n)}if(n=Math.max(e.start,n||0),this.loadingParts&&Y(e)){const r=a.partList;if(r&&s){n>a.fragmentEnd&&a.fragmentHint&&(e=a.fragmentHint);const i=this.getNextPart(r,e,n);if(i>-1){const c=r[i];let u;return e=this.fragCurrent=c.fragment,this.log(`Loading ${e.type} sn: ${e.sn} part: ${c.index} (${i}/${r.length-1}) of ${this.fragInfo(e,!1,c)}) cc: ${e.cc} [${a.startSN}-${a.endSN}], target: ${parseFloat(n.toFixed(3))}`),this.nextLoadPosition=c.start+c.duration,this.state=Ar,u=o?o.then((n=>!n||this.fragContextChanged(n.frag)?null:this.doFragPartsLoad(e,c,t,s))).catch((e=>this.handleFragLoadError(e))):this.doFragPartsLoad(e,c,t,s).catch((e=>this.handleFragLoadError(e))),this.hls.trigger(l.FRAG_LOADING,{frag:e,part:c,targetBufferTime:n}),null===this.fragCurrent?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING parts")):u}if(!e.url||this.loadedEndOfParts(r,n))return Promise.resolve(null)}}var u;if(Y(e)&&this.loadingParts)this.log(`LL-Part loading OFF after next part miss @${n.toFixed(2)} Check buffer at sn: ${e.sn} loaded parts: ${null==(u=a.partList)?void 0:u.filter((e=>e.loaded)).map((e=>`[${e.start}-${e.end}]`))}`),this.loadingParts=!1;else if(!e.url)return Promise.resolve(null);this.log(`Loading ${e.type} sn: ${e.sn} of ${this.fragInfo(e,!1)}) cc: ${e.cc} ${"["+a.startSN+"-"+a.endSN+"]"}, target: ${parseFloat(n.toFixed(3))}`),r(e.sn)&&!this.bitrateTest&&(this.nextLoadPosition=e.start+e.duration),this.state=Ar;const d=this.config.progressive&&e.type!==g;let h;return h=d&&o?o.then((t=>!t||this.fragContextChanged(t.frag)?null:this.fragmentLoader.load(e,s))).catch((e=>this.handleFragLoadError(e))):Promise.all([this.fragmentLoader.load(e,d?s:void 0),o]).then((([e])=>(!d&&s&&s(e),e))).catch((e=>this.handleFragLoadError(e))),this.hls.trigger(l.FRAG_LOADING,{frag:e,targetBufferTime:n}),null===this.fragCurrent?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING")):h}doFragPartsLoad(e,t,n,r){return new Promise(((s,i)=>{var a;const o=[],c=null==(a=n.details)?void 0:a.partList,u=t=>{this.fragmentLoader.loadPart(e,t,r).then((r=>{o[t.index]=r;const i=r.part;this.hls.trigger(l.FRAG_LOADED,r);const a=cr(n.details,e.sn,t.index+1)||ur(c,e.sn,t.index+1);if(!a)return s({frag:e,part:i,partsLoaded:o});u(a)})).catch(i)};u(t)}))}handleFragLoadError(e){if("data"in e){const t=e.data;t.frag&&t.details===o.INTERNAL_ABORTED?this.handleFragLoadAborted(t.frag,t.part):t.frag&&t.type===a.KEY_SYSTEM_ERROR?(t.frag.abortRequests(),this.resetStartWhenNotLoaded(),this.resetFragmentLoading(t.frag)):this.hls.trigger(l.ERROR,t)}else this.hls.trigger(l.ERROR,{type:a.OTHER_ERROR,details:o.INTERNAL_EXCEPTION,err:e,error:e,fatal:!0});return null}_handleTransmuxerFlush(e){const t=this.getCurrentContext(e);if(!t||this.state!==kr)return void(this.fragCurrent||this.state===vr||this.state===Nr||(this.state=br));const{frag:n,part:r,level:s}=t,i=self.performance.now();n.stats.parsing.end=i,r&&(r.stats.parsing.end=i);const a=this.getLevelDetails(),o=a&&n.sn>a.endSN||this.shouldLoadParts(a,n.end);o!==this.loadingParts&&(this.log(`LL-Part loading ${o?"ON":"OFF"} after parsing segment ending @${n.end.toFixed(2)}`),this.loadingParts=o),this.updateLevelTiming(n,r,s,e.partial)}shouldLoadParts(e,t){if(this.config.lowLatencyMode){if(!e)return this.loadingParts;if(e.partList){var n;const s=e.partList[0];if(s.fragment.type===g)return!1;if(t>=s.end+((null==(n=e.fragmentHint)?void 0:n.duration)||0)){var r;if((this.hls.hasEnoughToStart?(null==(r=this.media)?void 0:r.currentTime)||this.lastCurrentTime:this.getLoadPosition())>s.start-s.fragment.duration)return!0}}}return!1}getCurrentContext(e){const{levels:t,fragCurrent:n}=this,{level:r,sn:s,part:i}=e;if(null==t||!t[r])return this.warn(`Levels object was unset while buffering fragment ${s} of ${this.playlistLabel()} ${r}. The current chunk will not be buffered.`),null;const a=t[r],o=a.details,l=i>-1?cr(o,s,i):null,c=l?l.fragment:lr(o,s,n);return c?(n&&n!==c&&(c.stats=n.stats),{frag:c,part:l,level:a}):null}bufferFragmentData(e,t,n,r,s){if(this.state!==kr)return;const{data1:i,data2:a}=e;let o=i;
vendor: 22,649 bytes, line 1
1if(a&&(o=me(i,a)),!o.length)return;const c=this.initPTS[t.cc],u=c?-c.baseTime/c.timescale:void 0,d={type:e.type,frag:t,part:n,chunkMeta:r,offset:u,parent:t.type,data:o};if(this.hls.trigger(l.BUFFER_APPENDING,d),e.dropped&&e.independent&&!n){if(s)return;this.flushBufferGap(t)}}flushBufferGap(e){const t=this.media;if(!t)return;if(!nn.isBuffered(t,t.currentTime))return void this.flushMainBuffer(0,e.start);const n=t.currentTime,r=nn.bufferInfo(t,n,0),s=e.duration,i=Math.min(2*this.config.maxFragLookUpTolerance,.25*s),a=Math.max(Math.min(e.start-i,r.end-i),n+i);e.start-a>i&&this.flushMainBuffer(a,e.start)}getFwdBufferInfo(e,t){var n;const s=this.getLoadPosition();if(!r(s))return null;const i=this.lastCurrentTime>s||null!=(n=this.media)&&n.paused?0:this.config.maxBufferHole;return this.getFwdBufferInfoAtPos(e,s,t,i)}getFwdBufferInfoAtPos(e,t,n,r){const s=nn.bufferInfo(e,t,r);if(0===s.len&&void 0!==s.nextStart){const i=this.fragmentTracker.getBufferedFrag(t,n);if(i&&(s.nextStart<=i.end||i.gap)){const n=Math.max(Math.min(s.nextStart,i.end)-t,r);return nn.bufferInfo(e,t,n)}}return s}getMaxBufferLength(e){const{config:t}=this;let n;return n=e?Math.max(8*t.maxBufferSize/e,t.maxBufferLength):t.maxBufferLength,Math.min(n,t.maxMaxBufferLength)}reduceMaxBufferLength(e,t){const n=this.config,r=Math.max(Math.min(e-t,n.maxBufferLength),t),s=Math.max(e-3*t,n.maxMaxBufferLength/2,r);return s>=r&&(n.maxMaxBufferLength=s,this.warn(`Reduce max buffer length to ${s}s`),!0)}getAppendedFrag(e,t=f){const n=this.fragmentTracker?this.fragmentTracker.getAppendedFrag(e,t):null;return n&&"fragment"in n?n.fragment:n}getNextFragment(e,t){const n=t.fragments,r=n.length;if(!r)return null;const{config:s}=this,i=n[0].start,a=s.lowLatencyMode&&!!t.partList;let o=null;if(t.live){const n=s.initialLiveManifestSize;if(r<n)return this.warn(`Not enough fragments to start playback (have: ${r}, need: ${n})`),null;if(!t.PTSKnown&&!this.startFragRequested&&-1===this.startPosition||e<i){var l;a&&!this.loadingParts&&(this.log("LL-Part loading ON for initial live fragment"),this.loadingParts=!0),o=this.getInitialLiveFragment(t);const n=this.hls.startPosition,r=this.hls.liveSyncPosition,s=o?(-1!==n&&n>=i?n:r)||o.start:e;this.log(`Setting startPosition to ${s} to match start frag at live edge. mainStart: ${n} liveSyncPosition: ${r} frag.start: ${null==(l=o)?void 0:l.start}`),this.startPosition=this.nextLoadPosition=s}}else e<=i&&(o=n[0]);if(!o){const n=this.loadingParts?t.partEnd:t.fragmentEnd;o=this.getFragmentAtPosition(e,n,t)}let c=this.filterReplacedPrimary(o,t);if(!c&&o){const e=o.sn-t.startSN;c=this.filterReplacedPrimary(n[e+1]||null,t)}return this.mapToInitFragWhenRequired(c)}isLoopLoading(e,t){const n=this.fragmentTracker.getState(e);return(n===Ut||n===xt&&!!e.gap)&&this.nextLoadPosition>t}getNextFragmentLoopLoading(e,t,n,r,s){let i=null;if(e.gap&&(i=this.getNextFragment(this.nextLoadPosition,t),i&&!i.gap&&n.nextStart)){const e=this.getFwdBufferInfoAtPos(this.mediaBuffer?this.mediaBuffer:this.media,n.nextStart,r,0);if(null!==e&&n.len+e.len>=s){const e=i.sn;return this.loopSn!==e&&(this.log(`buffer full after gaps in "${r}" playlist starting at sn: ${e}`),this.loopSn=e),null}}return this.loopSn=void 0,i}get primaryPrefetch(){if(Dr(this.config)){var e;if(null==(e=this.hls.interstitialsManager)||null==(e=e.playingItem)?void 0:e.event)return!0}return!1}filterReplacedPrimary(e,t){if(!e)return e;if(Dr(this.config)&&e.type!==g){const n=this.hls.interstitialsManager,r=null==n?void 0:n.bufferingItem;if(r){const n=r.event;if(n){if(n.appendInPlace||Math.abs(e.start-r.start)>1||0===r.start)return null}else{if(e.end<=r.start&&!1===(null==t?void 0:t.live))return null;if(e.start>r.end&&r.nextEvent&&(r.nextEvent.appendInPlace||e.start-r.end>1))return null}}const s=null==n?void 0:n.playerQueue;if(s)for(let t=s.length;t--;){const n=s[t].interstitial;if(n.appendInPlace&&e.start>=n.startTime&&e.end<=n.resumeTime)return null}}return e}mapToInitFragWhenRequired(e){return null==e||!e.initSegment||e.initSegment.data||this.bitrateTest?e:e.initSegment}getNextPart(e,t,n){let r=-1,s=!1,i=!0;for(let a=0,o=e.length;a<o;a++){const o=e[a];if(i=i&&!o.independent,r>-1&&n<o.start)break;const l=o.loaded;l?r=-1:(s||(o.independent||i)&&o.fragment===t)&&(o.fragment!==t&&this.warn(`Need buffer at ${n} but next unloaded part starts at ${o.start}`),r=a),s=l}return r}loadedEndOfParts(e,t){let n;for(let r=e.length;r--;){if(n=e[r],!n.loaded)return!1;if(t>n.start)return!0}return!1}getInitialLiveFragment(e){const t=e.fragments,n=this.fragPrevious;let s=null;if(n){if(e.hasProgramDateTime&&(this.log(`Live playlist, switching playlist, load frag with same PDT: ${n.programDateTime}`),s=function(e,t,n){if(null===t||!Array.isArray(e)||!e.length||!r(t))return null;if(t<(e[0].programDateTime||0))return null;if(t>=(e[e.length-1].endProgramDateTime||0))return null;for(let r=0;r<e.length;++r){const s=e[r];if(gt(t,n,s))return s}return null}(t,n.endProgramDateTime,this.config.maxFragLookUpTolerance)),!s){const r=n.sn+1;if(r>=e.startSN&&r<=e.endSN){const i=t[r-e.startSN];n.cc===i.cc&&(s=i,this.log(`Live playlist, switching playlist, load frag with next SN: ${s.sn}`))}s||(s=mt(e,n.cc,n.end),s&&this.log(`Live playlist, switching playlist, load frag with same CC: ${s.sn}`))}}else{const t=this.hls.liveSyncPosition;null!==t&&(s=this.getFragmentAtPosition(t,this.bitrateTest?e.fragmentEnd:e.edge,e))}return s}getFragmentAtPosition(e,t,n){const{config:r}=this;let{fragPrevious:s}=this,{fragments:i,endSN:a}=n;const{fragmentHint:o}=n,{maxFragLookUpTolerance:l}=r,c=n.partList,u=!!(this.loadingParts&&null!=c&&c.length&&o);let d;if(u&&!this.bitrateTest&&c[c.length-1].fragment.sn===o.sn&&(i=i.concat(o),a=o.sn),e<t){var h;d=ft(s,i,e,e<this.lastCurrentTime||e>t-l||null!=(h=this.media)&&h.paused||!this.startFragRequested?0:l)}else d=i[i.length-1];if(d){const e=d.sn-n.startSN,t=this.fragmentTracker.getState(d);if((t===Ut||t===xt&&d.gap)&&(s=d),s&&d.sn===s.sn&&(!u||c[0].fragment.sn>d.sn||!n.live)){if(d.level===s.level){const t=i[e+1];d=d.sn<a&&this.fragmentTracker.getState(t)!==Ut?t:null}}}return d}alignPlaylists(e,t,n){const s=e.fragments.length;if(!s)return this.warn("No fragments in live playlist"),0;const i=e.fragmentStart,a=!t,o=e.alignedSliding&&r(i);if(a||!o&&!i){!function(e,t){e&&(_r(t,e),t.alignedSliding||Tr(t,e),t.alignedSliding||t.skippedSegments||ir(e,t,!1))}(n,e);const r=e.fragmentStart;return this.log(`Live playlist sliding: ${r.toFixed(2)} start-sn: ${t?t.startSN:"na"}->${e.startSN} fragments: ${s}`),r}return i}waitForCdnTuneIn(e){return e.live&&e.canBlockReload&&e.partTarget&&e.tuneInGoal>Math.max(e.partHoldBack,3*e.partTarget)}setStartPosition(e,t){let n=this.startPosition;n<t&&(n=-1);const s=this.timelineOffset;if(-1===n){const i=null!==this.startTimeOffset,a=i?this.startTimeOffset:e.startTimeOffset;null!==a&&r(a)?(n=t+a,a<0&&(n+=e.edge),n=Math.min(Math.max(t,n),t+e.totalduration),this.log(`Setting startPosition to ${n} for start time offset ${a} found in ${i?"multivariant":"media"} playlist`),this.startPosition=n):e.live?(n=this.hls.liveSyncPosition||t,this.log(`Setting startPosition to -1 to start at live edge ${n}`),this.startPosition=-1):(this.log("setting startPosition to 0 by default"),this.startPosition=n=0),this.lastCurrentTime=n+s}this.nextLoadPosition=n+s}getLoadPosition(){var e;const{media:t}=this;let n=0;return null!=(e=this.hls)&&e.hasEnoughToStart&&t?n=t.currentTime:this.nextLoadPosition>=0&&(n=this.nextLoadPosition),n}handleFragLoadAborted(e,t){this.transmuxer&&e.type===this.playlistType&&Y(e)&&e.stats.aborted&&(this.log(`Fragment ${e.sn}${t?" part "+t.index:""} of ${this.playlistLabel()} ${e.level} was aborted`),this.resetFragmentLoading(e))}resetFragmentLoading(e){this.fragCurrent&&(this.fragContextChanged(e)||this.state===Rr)||(this.state=br)}onFragmentOrKeyLoadError(e,t){var n;if(t.chunkMeta&&!t.frag){const e=this.getCurrentContext(t.chunkMeta);e&&(t.frag=e.frag)}const r=t.frag;if(!r||r.type!==e||!this.levels)return;var s;if(this.fragContextChanged(r))return void this.warn(`Frag load error must match current frag to retry ${r.url} > ${null==(s=this.fragCurrent)?void 0:s.url}`);const i=t.details===o.FRAG_GAP;i&&this.fragmentTracker.fragBuffered(r,!0);const a=t.errorAction;if(!a)return void(this.state=Nr);const{action:l,flags:c,retryCount:u=0,retryConfig:d}=a,h=!!d,f=h&&l===kt,p=h&&!a.resolved&&c===Ot,g=null==(n=this.hls.latestLevelDetails)?void 0:n.live;if(!f&&p&&Y(r)&&!r.endList&&g&&!Et(t))this.resetFragmentErrors(e),this.treatAsGap(r),a.resolved=!0;else if((f||p)&&u<d.maxNumRetry){var m;const n=It(null==(m=t.response)?void 0:m.code),s=St(d,u);if(this.resetStartWhenNotLoaded(),this.retryDate=self.performance.now()+s,this.state=Rr,a.resolved=!0,n)return this.log("Waiting for connection (offline)"),this.retryDate=1/0,void(t.reason="offline");this.warn(`Fragment ${r.sn} of ${e} ${r.level} errored with ${t.details}, retrying loading ${u+1}/${d.maxNumRetry} in ${s}ms`)}else if(d){if(this.resetFragmentErrors(e),!(u<d.maxNumRetry))return void this.warn(`${t.details} reached or exceeded max retry (${u})`);i||l===Ct||(a.resolved=!0)}else this.state=l===Rt?Pr:Nr;this.tickImmediate()}checkRetryDate(){const e=self.performance.now(),t=this.retryDate,n=t===1/0;(!t||e>=t||n&&!It(0))&&(n&&this.log("Connection restored (online)"),this.resetStartWhenNotLoaded(),this.state=br)}reduceLengthAndFlushBuffer(e){if(this.state===kr||this.state===Lr){const t=e.frag,n=e.parent,r=this.getFwdBufferInfo(this.mediaBuffer,n),s=r&&r.len>.5;s&&this.reduceMaxBufferLength(r.len,(null==t?void 0:t.duration)||10);const i=!s;return i&&this.warn(`Buffer full error while media.currentTime (${this.getLoadPosition()}) is not buffered, flush ${n} buffer`),t&&(this.fragmentTracker.removeFragment(t),this.nextLoadPosition=t.start),this.resetLoadingState(),i}return!1}resetFragmentErrors(e){e===p&&(this.fragCurrent=null),this.hls.hasEnoughToStart||(this.startFragRequested=!1),this.state!==vr&&(this.state=br)}afterBufferFlushed(e,t,n){if(!e)return;const r=nn.getBuffered(e);this.fragmentTracker.detectEvictedFragments(t,r,n),this.state===Or&&this.resetLoadingState()}resetLoadingState(){this.log("Reset loading state"),this.fragCurrent=null,this.fragPrevious=null,this.state!==vr&&(this.state=br)}resetStartWhenNotLoaded(){if(!this.hls.hasEnoughToStart){this.startFragRequested=!1;const e=this.levelLastLoaded,t=e?e.details:null;null!=t&&t.live?(this.log("resetting startPosition for live start"),this.startPosition=-1,this.setStartPosition(t,t.fragmentStart),this.resetLoadingState()):this.nextLoadPosition=this.startPosition}}resetWhenMissingContext(e){this.log(`Loading context changed while buffering sn ${e.sn} of ${this.playlistLabel()} ${-1===e.level?"<removed>":e.level}. This chunk will not be buffered.`),this.removeUnbufferedFrags(),this.resetStartWhenNotLoaded(),this.resetLoadingState()}removeUnbufferedFrags(e=0){this.fragmentTracker.removeFragmentsInRange(e,1/0,this.playlistType,!1,!0)}updateLevelTiming(e,t,n,r){const s=n.details;if(!s)return void this.warn("level.details undefined");if(!Object.keys(e.elementaryStreams).reduce(((t,i)=>{const a=e.elementaryStreams[i];if(a){const o=a.endPTS-a.startPTS;if(o<=0)return this.warn(`Could not parse fragment ${e.sn} ${i} duration reliably (${o})`),t||!1;const c=r?0:nr(s,e,a.startPTS,a.endPTS,a.startDTS,a.endDTS,this);return this.hls.trigger(l.LEVEL_PTS_UPDATED,{details:s,level:n,drift:c,type:i,frag:e,start:a.startPTS,end:a.endPTS}),!0}return t}),!1)){var i;const t=null===(null==(i=this.transmuxer)?void 0:i.error);if((0===n.fragmentError||t&&(n.fragmentError<2||e.endList))&&this.treatAsGap(e,n),t){const t=new Error(`Found no media in fragment ${e.sn} of ${this.playlistLabel()} ${e.level} resetting transmuxer to fallback to playlist timing`);if(this.warn(t.message),this.hls.trigger(l.ERROR,{type:a.MEDIA_ERROR,details:o.FRAG_PARSING_ERROR,fatal:!1,error:t,frag:e,reason:`Found no media in msn ${e.sn} of ${this.playlistLabel()} "${n.url}"`}),!this.hls)return;this.resetTransmuxer()}}this.state=Lr,this.log(`Parsed ${e.type} sn: ${e.sn}${t?" part: "+t.index:""} of ${this.fragInfo(e,!1,t)})`),this.hls.trigger(l.FRAG_PARSED,{frag:e,part:t})}playlistLabel(){return this.playlistType===f?"level":"track"}fragInfo(e,t=!0,n){var r,s;return`${this.playlistLabel()} ${e.level} (${n?"part":"frag"}:[${(null!=(r=t&&!n?e.startPTS:(n||e).start)?r:NaN).toFixed(3)}-${(null!=(s=t&&!n?e.endPTS:(n||e).end)?s:NaN).toFixed(3)}]${n&&"main"===e.type?"INDEPENDENT="+(n.independent?"YES":"NO"):""}`}treatAsGap(e,t){t&&t.fragmentError++,e.gap=!0,this.fragmentTracker.removeFragment(e),this.fragmentTracker.fragBuffered(e,!0)}resetTransmuxer(){var e;null==(e=this.transmuxer)||e.reset()}recoverWorkerError(e){"demuxerWorker"===e.event&&(this.fragmentTracker.removeAllFragments(),this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null),this.resetStartWhenNotLoaded(),this.resetLoadingState())}set state(e){const t=this._state;t!==e&&(this._state=e,this.log(`${t}->${e}`))}get state(){return this._state}}function Dr(e){return!!e.interstitialsController&&!1!==e.enableInterstitialPlayback}class xr{constructor(){this.chunks=[],this.dataLength=0}push(e){this.chunks.push(e),this.dataLength+=e.length}flush(){const{chunks:e,dataLength:t}=this;let n;return e.length?(n=1===e.length?e[0]:function(e,t){const n=new Uint8Array(t);let r=0;for(let t=0;t<e.length;t++){const s=e[t];n.set(s,r),r+=s.length}return n}(e,t),this.reset(),n):new Uint8Array(0)}reset(){this.chunks.length=0,this.dataLength=0}}var Ur,Br={exports:{}};var Fr=(Ur||(Ur=1,function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}function s(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function i(e,t,r,i,a){if("function"!=typeof r)throw new TypeError("The listener must be a function");var o=new s(r,i||e,a),l=n?n+t:t;return e._events[l]?e._events[l].fn?e._events[l]=[e._events[l],o]:e._events[l].push(o):(e._events[l]=o,e._eventsCount++),e}function a(e,t){0==--e._eventsCount?e._events=new r:delete e._events[t]}function o(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),o.prototype.eventNames=function(){var e,r,s=[];if(0===this._eventsCount)return s;for(r in e=this._events)t.call(e,r)&&s.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?s.concat(Object.getOwnPropertySymbols(e)):s},o.prototype.listeners=function(e){var t=n?n+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var s=0,i=r.length,a=new Array(i);s<i;s++)a[s]=r[s].fn;return a},o.prototype.listenerCount=function(e){var t=n?n+e:e,r=this._events[t];return r?r.fn?1:r.length:0},o.prototype.emit=function(e,t,r,s,i,a){var o=n?n+e:e;if(!this._events[o])return!1;var l,c,u=this._events[o],d=arguments.length;if(u.fn){switch(u.once&&this.removeListener(e,u.fn,void 0,!0),d){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,t),!0;case 3:return u.fn.call(u.context,t,r),!0;case 4:return u.fn.call(u.context,t,r,s),!0;case 5:return u.fn.call(u.context,t,r,s,i),!0;case 6:return u.fn.call(u.context,t,r,s,i,a),!0}for(c=1,l=new Array(d-1);c<d;c++)l[c-1]=arguments[c];u.fn.apply(u.context,l)}else{var h,f=u.length;for(c=0;c<f;c++)switch(u[c].once&&this.removeListener(e,u[c].fn,void 0,!0),d){case 1:u[c].fn.call(u[c].context);break;case 2:u[c].fn.call(u[c].context,t);break;case 3:u[c].fn.call(u[c].context,t,r);break;case 4:u[c].fn.call(u[c].context,t,r,s);break;default:if(!l)for(h=1,l=new Array(d-1);h<d;h++)l[h-1]=arguments[h];u[c].fn.apply(u[c].context,l)}}return!0},o.prototype.on=function(e,t,n){return i(this,e,t,n,!1)},o.prototype.once=function(e,t,n){return i(this,e,t,n,!0)},o.prototype.removeListener=function(e,t,r,s){var i=n?n+e:e;if(!this._events[i])return this;if(!t)return a(this,i),this;var o=this._events[i];if(o.fn)o.fn!==t||s&&!o.once||r&&o.context!==r||a(this,i);else{for(var l=0,c=[],u=o.length;l<u;l++)(o[l].fn!==t||s&&!o[l].once||r&&o[l].context!==r)&&c.push(o[l]);c.length?this._events[i]=1===c.length?c[0]:c:a(this,i)}return this},o.prototype.removeAllListeners=function(e){var t;return e?(t=n?n+e:e,this._events[t]&&a(this,t)):(this._events=new r,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=n,o.EventEmitter=o,e.exports=o}(Br)),Br.exports),$r=M(Fr);const Gr="1.6.15",Hr={};function jr(e,t){return t+10<=e.length&&51===e[t]&&68===e[t+1]&&73===e[t+2]&&e[t+3]<255&&e[t+4]<255&&e[t+6]<128&&e[t+7]<128&&e[t+8]<128&&e[t+9]<128}function Wr(e,t){return t+10<=e.length&&73===e[t]&&68===e[t+1]&&51===e[t+2]&&e[t+3]<255&&e[t+4]<255&&e[t+6]<128&&e[t+7]<128&&e[t+8]<128&&e[t+9]<128}function Kr(e,t){let n=0;return n=(127&e[t])<<21,n|=(127&e[t+1])<<14,n|=(127&e[t+2])<<7,n|=127&e[t+3],n}function Vr(e,t){const n=t;let r=0;for(;Wr(e,t);){r+=10;r+=Kr(e,t+6),jr(e,t+10)&&(r+=10),t+=r}if(r>0)return e.subarray(n,n+r)}function qr(e,t){return 255===e[t]&&240==(246&e[t+1])}function Yr(e,t){return 1&e[t+1]?7:9}function zr(e,t){return(3&e[t+3])<<11|e[t+4]<<3|(224&e[t+5])>>>5}function Jr(e,t){return t+1<e.length&&qr(e,t)}function Xr(e,t){if(Jr(e,t)){const n=Yr(e,t);if(t+n>=e.length)return!1;const r=zr(e,t);if(r<=n)return!1;const s=t+r;return s===e.length||Jr(e,s)}return!1}function Qr(e,t,n,r,s){if(!e.samplerate){const i=function(e,t,n,r){const s=t[n+2],i=s>>2&15;if(i>12){const t=new Error(`invalid ADTS sampling index:${i}`);return void e.emit(l.ERROR,l.ERROR,{type:a.MEDIA_ERROR,details:o.FRAG_PARSING_ERROR,fatal:!0,error:t,reason:t.message})}const c=1+(s>>6&3),u=t[n+3]>>6&3|(1&s)<<2,d="mp4a.40."+c,h=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350][i];let f=i;5!==c&&29!==c||(f-=3);const p=[c<<3|(14&f)>>1,(1&f)<<7|u<<3];return k.log(`manifest codec:${r}, parsed codec:${d}, channels:${u}, rate:${h} (ADTS object type:${c} sampling index:${i})`),{config:p,samplerate:h,channelCount:u,codec:d,parsedCodec:d,manifestCodec:r}}(t,n,r,s);if(!i)return;E(e,i)}}function Zr(e){return 9216e4/e}function es(e,t,n,r,s){const i=r+s*Zr(e.samplerate),a=function(e,t){const n=Yr(e,t);if(t+n<=e.length){const r=zr(e,t)-n;if(r>0)return{headerLength:n,frameLength:r}}}(t,n);let o;if(a){const{frameLength:r,headerLength:s}=a,l=s+r,c=Math.max(0,n+l-t.length);c?(o=new Uint8Array(l-s),o.set(t.subarray(n+s,t.length),0)):o=t.subarray(n+s,n+l);const u={unit:o,pts:i};return c||e.samples.push(u),{sample:u,length:l,missing:c}}const l=t.length-n;o=new Uint8Array(l),o.set(t.subarray(n,t.length),0);return{sample:{unit:o,pts:i},length:l,missing:-1}}function ts(e,t){return Wr(e,t)&&Kr(e,t+6)+10<=e.length-t}function ns(e,t=0,n=1/0){return function(e,t,n,r){const s=function(e){return e instanceof ArrayBuffer?e:e.buffer}(e);let i=1;"BYTES_PER_ELEMENT"in r&&(i=r.BYTES_PER_ELEMENT);const a=(d=e,d&&d.buffer instanceof ArrayBuffer&&void 0!==d.byteLength&&void 0!==d.byteOffset?e.byteOffset:0),o=(a+e.byteLength)/i,l=(a+t)/i,c=Math.floor(Math.max(0,Math.min(l,o))),u=Math.floor(Math.min(c+Math.max(n,0),o));var d;return new r(s,c,u-c)}(e,t,n,Uint8Array)}function rs(e){const t={key:e.type,description:"",data:"",mimeType:null,pictureType:null};if(e.size<2)return;if(3!==e.data[0])return void console.log("Ignore frame with unrecognized character encoding");const n=e.data.subarray(1).indexOf(0);if(-1===n)return;const r=N(ns(e.data,1,n)),s=e.data[2+n],i=e.data.subarray(3+n).indexOf(0);if(-1===i)return;const a=N(ns(e.data,3+n,i));let o;return o="--\x3e"===r?N(ns(e.data,4+n+i)):function(e){return e instanceof ArrayBuffer?e:0==e.byteOffset&&e.byteLength==e.buffer.byteLength?e.buffer:new Uint8Array(e).buffer}(e.data.subarray(4+n+i)),t.mimeType=r,t.pictureType=s,t.description=a,t.data=o,t}function ss(e){return"PRIV"===e.type?function(e){if(e.size<2)return;const t=N(e.data,!0),n=new Uint8Array(e.data.subarray(t.length+1));return{key:e.type,info:t,data:n.buffer}}(e):"W"===e.type[0]?function(e){if("WXXX"===e.type){if(e.size<2)return;let t=1;const n=N(e.data.subarray(t),!0);t+=n.length+1;const r=N(e.data.subarray(t));return{key:e.type,info:n,data:r}}const t=N(e.data);return{key:e.type,info:"",data:t}}(e):"APIC"===e.type?rs(e):function(e){if(e.size<2)return;if("TXXX"===e.type){let t=1;const n=N(e.data.subarray(t),!0);t+=n.length+1;const r=N(e.data.subarray(t));return{key:e.type,info:n,data:r}}const t=N(e.data.subarray(1));return{key:e.type,info:"",data:t}}(e)}function is(e){const t=String.fromCharCode(e[0],e[1],e[2],e[3]),n=Kr(e,4);return{type:t,size:n,data:e.subarray(10,10+n)}}function as(e){let t=0;const n=[];for(;Wr(e,t);){const r=Kr(e,t+6);e[t+5]>>6&1&&(t+=10),t+=10;const s=t+r;for(;t+10<s;){const r=is(e.subarray(t)),s=ss(r);s&&n.push(s),t+=r.size+10}jr(e,t)&&(t+=10)}return n}function os(e){return e&&"PRIV"===e.key&&"com.apple.streaming.transportStreamTimestamp"===e.info}function ls(e){if(8===e.data.byteLength){const t=new Uint8Array(e.data),n=1&t[3];let r=(t[4]<<23)+(t[5]<<15)+(t[6]<<7)+t[7];return r/=45,n&&(r+=47721858.84),Math.round(r)}}function cs(e){const t=as(e);for(let e=0;e<t.length;e++){const n=t[e];if(os(n))return ls(n)}}let us=function(e){return e.audioId3="org.id3",e.dateRange="com.apple.quicktime.HLS",e.emsg="https://aomedia.org/emsg/ID3",e.misbklv="urn:misb:KLV:bin:1910.1",e}({});function ds(e="",t=9e4){return{type:e,id:-1,pid:-1,inputTimeScale:t,sequenceNumber:-1,samples:[],dropped:0}}class hs{constructor(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.basePTS=null,this.initPTS=null,this.lastPTS=null}resetInitSegment(e,t,n,r){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}}resetTimeStamp(e){this.initPTS=e,this.resetContiguity()}resetContiguity(){this.basePTS=null,this.lastPTS=null,this.frameIndex=0}canParse(e,t){return!1}appendFrame(e,t,n){}demux(e,t){this.cachedData&&(e=me(this.cachedData,e),this.cachedData=null);let n,s=Vr(e,0),i=s?s.length:0;const a=this._audioTrack,o=this._id3Track,l=s?cs(s):void 0,c=e.length;for((null===this.basePTS||0===this.frameIndex&&r(l))&&(this.basePTS=fs(l,t,this.initPTS),this.lastPTS=this.basePTS),null===this.lastPTS&&(this.lastPTS=this.basePTS),s&&s.length>0&&o.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:s,type:us.audioId3,duration:Number.POSITIVE_INFINITY});i<c;){if(this.canParse(e,i)){const t=this.appendFrame(a,e,i);t?(this.frameIndex++,this.lastPTS=t.sample.pts,i+=t.length,n=i):i=c}else ts(e,i)?(s=Vr(e,i),o.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:s,type:us.audioId3,duration:Number.POSITIVE_INFINITY}),i+=s.length,n=i):i++;if(i===c&&n!==c){const t=e.slice(n);this.cachedData?this.cachedData=me(this.cachedData,t):this.cachedData=t}}return{audioTrack:a,videoTrack:ds(),id3Track:o,textTrack:ds()}}
vendor: 4,481 bytes, line 1
1demuxSampleAes(e,t,n){return Promise.reject(new Error(`[${this}] This demuxer does not support Sample-AES decryption`))}flush(e){const t=this.cachedData;return t&&(this.cachedData=null,this.demux(t,0)),{audioTrack:this._audioTrack,videoTrack:ds(),id3Track:this._id3Track,textTrack:ds()}}destroy(){this.cachedData=null,this._audioTrack=this._id3Track=void 0}}const fs=(e,t,n)=>{if(r(e))return 90*e;return 9e4*t+(n?9e4*n.baseTime/n.timescale:0)};let ps=null;const gs=[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],ms=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],_s=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],Ts=[0,1,1,4];function Es(e,t,n,r,s){if(n+24>t.length)return;const i=ys(t,n);if(i&&n+i.frameLength<=t.length){const a=r+s*(9e4*i.samplesPerFrame/i.sampleRate),o={unit:t.subarray(n,n+i.frameLength),pts:a,dts:a};return e.config=[],e.channelCount=i.channelCount,e.samplerate=i.sampleRate,e.samples.push(o),{sample:o,length:i.frameLength,missing:0}}}function ys(e,t){const n=e[t+1]>>3&3,r=e[t+1]>>1&3,s=e[t+2]>>4&15,i=e[t+2]>>2&3;if(1!==n&&0!==s&&15!==s&&3!==i){const a=e[t+2]>>1&1,o=e[t+3]>>6,l=1e3*gs[14*(3===n?3-r:3===r?3:4)+s-1],c=ms[3*(3===n?0:2===n?1:2)+i],u=3===o?1:2,d=_s[n][r],h=Ts[r],f=8*d*h,p=Math.floor(d*l/c+a)*h;if(null===ps){const e=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);ps=e?parseInt(e[1]):0}return!!ps&&ps<=87&&2===r&&l>=224e3&&0===o&&(e[t+3]=128|e[t+3]),{sampleRate:c,channelCount:u,frameLength:p,samplesPerFrame:f}}}function Ss(e,t){return!(255!==e[t]||224&~e[t+1]||!(6&e[t+1]))}function vs(e,t){return t+1<e.length&&Ss(e,t)}function bs(e,t){if(t+1<e.length&&Ss(e,t)){const n=4,r=ys(e,t);let s=n;null!=r&&r.frameLength&&(s=r.frameLength);const i=t+s;return i===e.length||vs(e,i)}return!1}const Is=(e,t)=>{let n=0,r=5;t+=r;const s=new Uint32Array(1),i=new Uint32Array(1),a=new Uint8Array(1);for(;r>0;){a[0]=e[t];const o=Math.min(r,8),l=8-o;i[0]=4278190080>>>24+l<<l,s[0]=(a[0]&i[0])>>l,n=n?n<<o|s[0]:s[0],t+=1,r-=o}return n};class As extends hs{constructor(e){super(),this.observer=void 0,this.observer=e}resetInitSegment(e,t,n,r){super.resetInitSegment(e,t,n,r),this._audioTrack={container:"audio/ac-3",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"ac3",samples:[],manifestCodec:t,duration:r,inputTimeScale:9e4,dropped:0}}canParse(e,t){return t+64<e.length}appendFrame(e,t,n){const r=Rs(e,t,n,this.basePTS,this.frameIndex);if(-1!==r){return{sample:e.samples[e.samples.length-1],length:r,missing:0}}}static probe(e){if(!e)return!1;const t=Vr(e,0);if(!t)return!1;const n=t.length;return 11===e[n]&&119===e[n+1]&&void 0!==cs(t)&&Is(e,n)<16}}function Rs(e,t,n,r,s){if(n+8>t.length)return-1;if(11!==t[n]||119!==t[n+1])return-1;const i=t[n+4]>>6;if(i>=3)return-1;const a=[48e3,44100,32e3][i],o=63&t[n+4],l=2*[64,69,96,64,70,96,80,87,120,80,88,120,96,104,144,96,105,144,112,121,168,112,122,168,128,139,192,128,140,192,160,174,240,160,175,240,192,208,288,192,209,288,224,243,336,224,244,336,256,278,384,256,279,384,320,348,480,320,349,480,384,417,576,384,418,576,448,487,672,448,488,672,512,557,768,512,558,768,640,696,960,640,697,960,768,835,1152,768,836,1152,896,975,1344,896,976,1344,1024,1114,1536,1024,1115,1536,1152,1253,1728,1152,1254,1728,1280,1393,1920,1280,1394,1920][3*o+i];if(n+l>t.length)return-1;const c=t[n+6]>>5;let u=0;2===c?u+=2:(1&c&&1!==c&&(u+=2),4&c&&(u+=2));const d=(t[n+6]<<8|t[n+7])>>12-u&1,h=[2,1,2,3,3,4,4,5][c]+d,f=t[n+5]>>3,p=7&t[n+5],g=new Uint8Array([i<<6|f<<1|p>>2,(3&p)<<6|c<<3|d<<2|o>>4,o<<4&224]),m=r+s*(1536/a*9e4),_=t.subarray(n,n+l);return e.config=g,e.channelCount=h,e.samplerate=a,e.samples.push({unit:_,pts:m}),l}const Cs=/\/emsg[-/]ID3/i;function ks(e,t){return r(e.presentationTime)?e.presentationTime/e.timeScale:t+e.presentationTimeDelta/e.timeScale}class Ls{constructor(e,t,n){this.keyData=void 0,this.decrypter=void 0,this.keyData=n,this.decrypter=new qt(t,{removePKCS7Padding:!1})}decryptBuffer(e){return this.decrypter.decrypt(e,this.keyData.key.buffer,this.keyData.iv.buffer,Ht)}decryptAacSample(e,t,n){const r=e[t].unit;if(r.length<=16)return;const s=r.subarray(16,r.length-r.length%16),i=s.buffer.slice(s.byteOffset,s.byteOffset+s.length);this.decryptBuffer(i).then((s=>{const i=new Uint8Array(s);r.set(i,16),this.decrypter.isSync()||this.decryptAacSamples(e,t+1,n)})).catch(n)}
vendor: 5,248 bytes, line 1
1decryptAacSamples(e,t,n){for(;;t++){if(t>=e.length)return void n();if(!(e[t].unit.length<32)&&(this.decryptAacSample(e,t,n),!this.decrypter.isSync()))return}}getAvcEncryptedData(e){const t=16*Math.floor((e.length-48)/160)+16,n=new Int8Array(t);let r=0;for(let t=32;t<e.length-16;t+=160,r+=16)n.set(e.subarray(t,t+16),r);return n}getAvcDecryptedUnit(e,t){const n=new Uint8Array(t);let r=0;for(let t=32;t<e.length-16;t+=160,r+=16)e.set(n.subarray(r,r+16),t);return e}decryptAvcSample(e,t,n,r,s){const i=Se(s.data),a=this.getAvcEncryptedData(i);this.decryptBuffer(a.buffer).then((a=>{s.data=this.getAvcDecryptedUnit(i,a),this.decrypter.isSync()||this.decryptAvcSamples(e,t,n+1,r)})).catch(r)}decryptAvcSamples(e,t,n,r){if(e instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;t++,n=0){if(t>=e.length)return void r();const s=e[t].units;for(;!(n>=s.length);n++){const i=s[n];if(!(i.data.length<=48||1!==i.type&&5!==i.type||(this.decryptAvcSample(e,t,n,r,i),this.decrypter.isSync())))return}}}}class Os{constructor(){this.VideoSample=null}createVideoSample(e,t,n){return{key:e,frame:!1,pts:t,dts:n,units:[],length:0}}getLastNalUnit(e){var t;let n,r=this.VideoSample;if(r&&0!==r.units.length||(r=e[e.length-1]),null!=(t=r)&&t.units){const e=r.units;n=e[e.length-1]}return n}pushAccessUnit(e,t){if(e.units.length&&e.frame){if(void 0===e.pts){const n=t.samples,r=n.length;if(!r)return void t.dropped++;{const t=n[r-1];e.pts=t.pts,e.dts=t.dts}}t.samples.push(e)}}parseNALu(e,t,n){const r=t.byteLength;let s=e.naluState||0;const i=s,a=[];let o,l,c,u=0,d=-1,h=0;for(-1===s&&(d=0,h=this.getNALuType(t,0),s=0,u=1);u<r;)if(o=t[u++],s)if(1!==s)if(o)if(1===o){if(l=u-s-1,d>=0){const e={data:t.subarray(d,l),type:h};a.push(e)}else{const n=this.getLastNalUnit(e.samples);n&&(i&&u<=4-i&&n.state&&(n.data=n.data.subarray(0,n.data.byteLength-i)),l>0&&(n.data=me(n.data,t.subarray(0,l)),n.state=0))}u<r?(c=this.getNALuType(t,u),d=u,h=c,s=0):s=-1}else s=0;else s=3;else s=o?0:2;else s=o?0:1;if(d>=0&&s>=0){const e={data:t.subarray(d,r),type:h,state:s};a.push(e)}if(0===a.length){const n=this.getLastNalUnit(e.samples);n&&(n.data=me(n.data,t))}return e.naluState=s,a}}class Ns{constructor(e){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=e,this.bytesAvailable=e.byteLength,this.word=0,this.bitsAvailable=0}loadWord(){const e=this.data,t=this.bytesAvailable,n=e.byteLength-t,r=new Uint8Array(4),s=Math.min(4,t);if(0===s)throw new Error("no bytes available");r.set(e.subarray(n,n+s)),this.word=new DataView(r.buffer).getUint32(0),this.bitsAvailable=8*s,this.bytesAvailable-=s}skipBits(e){let t;e=Math.min(e,8*this.bytesAvailable+this.bitsAvailable),this.bitsAvailable>e?(this.word<<=e,this.bitsAvailable-=e):(t=(e-=this.bitsAvailable)>>3,e-=t<<3,this.bytesAvailable-=t,this.loadWord(),this.word<<=e,this.bitsAvailable-=e)}readBits(e){let t=Math.min(this.bitsAvailable,e);const n=this.word>>>32-t;if(e>32&&k.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=t,this.bitsAvailable>0)this.word<<=t;else{if(!(this.bytesAvailable>0))throw new Error("no bits available");this.loadWord()}return t=e-t,t>0&&this.bitsAvailable?n<<t|this.readBits(t):n}skipLZ(){let e;for(e=0;e<this.bitsAvailable;++e)if(this.word&2147483648>>>e)return this.word<<=e,this.bitsAvailable-=e,e;return this.loadWord(),e+this.skipLZ()}skipUEG(){this.skipBits(1+this.skipLZ())}skipEG(){this.skipBits(1+this.skipLZ())}readUEG(){const e=this.skipLZ();return this.readBits(e+1)-1}readEG(){const e=this.readUEG();return 1&e?1+e>>>1:-1*(e>>>1)}readBoolean(){return 1===this.readBits(1)}readUByte(){return this.readBits(8)}readUShort(){return this.readBits(16)}readUInt(){return this.readBits(32)}}class ws extends Os{parsePES(e,t,n,r){const s=this.parseNALu(e,n.data,r);let i,a=this.VideoSample,o=!1;n.data=null,a&&s.length&&!e.audFound&&(this.pushAccessUnit(a,e),a=this.VideoSample=this.createVideoSample(!1,n.pts,n.dts)),s.forEach((r=>{var s,l;switch(r.type){case 1:{let t=!1;i=!0;const s=r.data;if(o&&s.length>4){const e=this.readSliceType(s);2!==e&&4!==e&&7!==e&&9!==e||(t=!0)}var c;if(t)null!=(c=a)&&c.frame&&!a.key&&(this.pushAccessUnit(a,e),a=this.VideoSample=null);a||(a=this.VideoSample=this.createVideoSample(!0,n.pts,n.dts)),a.frame=!0,a.key=t;break}case 5:i=!0,null!=(s=a)&&s.frame&&!a.key&&(this.pushAccessUnit(a,e),a=this.VideoSample=null),a||(a=this.VideoSample=this.createVideoSample(!0,n.pts,n.dts)),a.key=!0,a.frame=!0;break;case 6:i=!0,ye(r.data,1,n.pts,t.samples);break;case 7:{var u,d;i=!0,o=!0;const t=r.data,n=this.readSPS(t);if(!e.sps||e.width!==n.width||e.height!==n.height||(null==(u=e.pixelRatio)?void 0:u[0])!==n.pixelRatio[0]||(null==(d=e.pixelRatio)?void 0:d[1])!==n.pixelRatio[1]){e.width=n.width,e.height=n.height,e.pixelRatio=n.pixelRatio,e.sps=[t];const r=t.subarray(1,4);let s="avc1.";for(let e=0;e<3;e++){let t=r[e].toString(16);t.length<2&&(t="0"+t),s+=t}e.codec=s}break}case 8:i=!0,e.pps=[r.data];break;case 9:i=!0,e.audFound=!0,null!=(l=a)&&l.frame&&(this.pushAccessUnit(a,e),a=null),a||(a=this.VideoSample=this.createVideoSample(!1,n.pts,n.dts));break;case 12:i=!0;break;default:i=!1}if(a&&i){a.units.push(r)}})),r&&a&&(this.pushAccessUnit(a,e),this.VideoSample=null)}
vendor: 8,326 bytes, line 1
1getNALuType(e,t){return 31&e[t]}readSliceType(e){const t=new Ns(e);return t.readUByte(),t.readUEG(),t.readUEG()}skipScalingList(e,t){let n,r=8,s=8;for(let i=0;i<e;i++)0!==s&&(n=t.readEG(),s=(r+n+256)%256),r=0===s?r:s}readSPS(e){const t=new Ns(e);let n,r,s,i=0,a=0,o=0,l=0;const c=t.readUByte.bind(t),u=t.readBits.bind(t),d=t.readUEG.bind(t),h=t.readBoolean.bind(t),f=t.skipBits.bind(t),p=t.skipEG.bind(t),g=t.skipUEG.bind(t),m=this.skipScalingList.bind(this);c();const _=c();if(u(5),f(3),c(),g(),100===_||110===_||122===_||244===_||44===_||83===_||86===_||118===_||128===_){const e=d();if(3===e&&f(1),g(),g(),f(1),h())for(r=3!==e?8:12,s=0;s<r;s++)h()&&m(s<6?16:64,t)}g();const T=d();if(0===T)d();else if(1===T)for(f(1),p(),p(),n=d(),s=0;s<n;s++)p();g(),f(1);const E=d(),y=d(),S=u(1);0===S&&f(1),f(1),h()&&(i=d(),a=d(),o=d(),l=d());let v=[1,1];if(h()&&h()){switch(c()){case 1:v=[1,1];break;case 2:v=[12,11];break;case 3:v=[10,11];break;case 4:v=[16,11];break;case 5:v=[40,33];break;case 6:v=[24,11];break;case 7:v=[20,11];break;case 8:v=[32,11];break;case 9:v=[80,33];break;case 10:v=[18,11];break;case 11:v=[15,11];break;case 12:v=[64,33];break;case 13:v=[160,99];break;case 14:v=[4,3];break;case 15:v=[3,2];break;case 16:v=[2,1];break;case 255:v=[c()<<8|c(),c()<<8|c()]}}return{width:Math.ceil(16*(E+1)-2*i-2*a),height:(2-S)*(y+1)*16-(S?2:4)*(o+l),pixelRatio:v}}}class Ps extends Os{constructor(...e){super(...e),this.initVPS=null}parsePES(e,t,n,r){const s=this.parseNALu(e,n.data,r);let i,a=this.VideoSample,o=!1;n.data=null,a&&s.length&&!e.audFound&&(this.pushAccessUnit(a,e),a=this.VideoSample=this.createVideoSample(!1,n.pts,n.dts)),s.forEach((r=>{var s,l;switch(r.type){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:a||(a=this.VideoSample=this.createVideoSample(!1,n.pts,n.dts)),a.frame=!0,i=!0;break;case 16:case 17:case 18:case 21:var c;if(i=!0,o)null!=(c=a)&&c.frame&&!a.key&&(this.pushAccessUnit(a,e),a=this.VideoSample=null);a||(a=this.VideoSample=this.createVideoSample(!0,n.pts,n.dts)),a.key=!0,a.frame=!0;break;case 19:case 20:i=!0,null!=(s=a)&&s.frame&&!a.key&&(this.pushAccessUnit(a,e),a=this.VideoSample=null),a||(a=this.VideoSample=this.createVideoSample(!0,n.pts,n.dts)),a.key=!0,a.frame=!0;break;case 39:i=!0,ye(r.data,2,n.pts,t.samples);break;case 32:i=!0,e.vps||("object"!=typeof e.params&&(e.params={}),e.params=E(e.params,this.readVPS(r.data)),this.initVPS=r.data),e.vps=[r.data];break;case 33:if(i=!0,o=!0,void 0===e.vps||e.vps[0]===this.initVPS||void 0===e.sps||this.matchSPS(e.sps[0],r.data)||(this.initVPS=e.vps[0],e.sps=e.pps=void 0),!e.sps){const t=this.readSPS(r.data);e.width=t.width,e.height=t.height,e.pixelRatio=t.pixelRatio,e.codec=t.codecString,e.sps=[],"object"!=typeof e.params&&(e.params={});for(const n in t.params)e.params[n]=t.params[n]}this.pushParameterSet(e.sps,r.data,e.vps),a||(a=this.VideoSample=this.createVideoSample(!0,n.pts,n.dts)),a.key=!0;break;case 34:if(i=!0,"object"==typeof e.params){if(!e.pps){e.pps=[];const t=this.readPPS(r.data);for(const n in t)e.params[n]=t[n]}this.pushParameterSet(e.pps,r.data,e.vps)}break;case 35:i=!0,e.audFound=!0,null!=(l=a)&&l.frame&&(this.pushAccessUnit(a,e),a=null),a||(a=this.VideoSample=this.createVideoSample(!1,n.pts,n.dts));break;default:i=!1}if(a&&i){a.units.push(r)}})),r&&a&&(this.pushAccessUnit(a,e),this.VideoSample=null)}pushParameterSet(e,t,n){(n&&n[0]===this.initVPS||!n&&!e.length)&&e.push(t)}getNALuType(e,t){return(126&e[t])>>>1}ebsp2rbsp(e){const t=new Uint8Array(e.byteLength);let n=0;for(let r=0;r<e.byteLength;r++)r>=2&&3===e[r]&&0===e[r-1]&&0===e[r-2]||(t[n]=e[r],n++);return new Uint8Array(t.buffer,0,n)}pushAccessUnit(e,t){super.pushAccessUnit(e,t),this.initVPS&&(this.initVPS=null)}readVPS(e){const t=new Ns(e);t.readUByte(),t.readUByte(),t.readBits(4),t.skipBits(2),t.readBits(6);return{numTemporalLayers:t.readBits(3)+1,temporalIdNested:t.readBoolean()}}readSPS(e){const t=new Ns(this.ebsp2rbsp(e));t.readUByte(),t.readUByte(),t.readBits(4);const n=t.readBits(3);t.readBoolean();const r=t.readBits(2),s=t.readBoolean(),i=t.readBits(5),a=t.readUByte(),o=t.readUByte(),l=t.readUByte(),c=t.readUByte(),u=t.readUByte(),d=t.readUByte(),h=t.readUByte(),f=t.readUByte(),p=t.readUByte(),g=t.readUByte(),m=t.readUByte(),_=[],T=[];for(let e=0;e<n;e++)_.push(t.readBoolean()),T.push(t.readBoolean());if(n>0)for(let e=n;e<8;e++)t.readBits(2);for(let e=0;e<n;e++)_[e]&&(t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte()),T[e]&&t.readUByte();t.readUEG();const E=t.readUEG();3==E&&t.skipBits(1);const y=t.readUEG(),S=t.readUEG(),v=t.readBoolean();let b=0,I=0,A=0,R=0;v&&(b+=t.readUEG(),I+=t.readUEG(),A+=t.readUEG(),R+=t.readUEG());const C=t.readUEG(),k=t.readUEG(),L=t.readUEG();for(let e=t.readBoolean()?0:n;e<=n;e++)t.skipUEG(),t.skipUEG(),t.skipUEG();t.skipUEG(),t.skipUEG(),t.skipUEG(),t.skipUEG(),t.skipUEG(),t.skipUEG();if(t.readBoolean()){if(t.readBoolean())for(let e=0;e<4;e++)for(let n=0;n<(3===e?2:6);n++){if(t.readBoolean()){const n=Math.min(64,1<<4+(e<<1));e>1&&t.readEG();for(let e=0;e<n;e++)t.readEG()}else t.readUEG()}}t.readBoolean(),t.readBoolean();t.readBoolean()&&(t.readUByte(),t.skipUEG(),t.skipUEG(),t.readBoolean());const O=t.readUEG();let N=0;for(let e=0;e<O;e++){let n=!1;if(0!==e&&(n=t.readBoolean()),n){e===O&&t.readUEG(),t.readBoolean(),t.readUEG();let n=0;for(let e=0;e<=N;e++){const e=t.readBoolean();let r=!1;e||(r=t.readBoolean()),(e||r)&&n++}N=n}else{const e=t.readUEG(),n=t.readUEG();N=e+n;for(let n=0;n<e;n++)t.readUEG(),t.readBoolean();for(let e=0;e<n;e++)t.readUEG(),t.readBoolean()}}if(t.readBoolean()){const e=t.readUEG();for(let n=0;n<e;n++){for(let e=0;e<L+4;e++)t.readBits(1);t.readBits(1)}}let w=0,P=1,M=1,D=!0,x=1,U=0;t.readBoolean(),t.readBoolean();let B=!1;if(t.readBoolean()){if(t.readBoolean()){const e=t.readUByte();e>0&&e<16?(P=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2][e-1],M=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1][e-1]):255===e&&(P=t.readBits(16),M=t.readBits(16))}t.readBoolean()&&t.readBoolean();if(t.readBoolean()){t.readBits(3),t.readBoolean();t.readBoolean()&&(t.readUByte(),t.readUByte(),t.readUByte())}t.readBoolean()&&(t.readUEG(),t.readUEG()),t.readBoolean(),t.readBoolean(),t.readBoolean(),B=t.readBoolean(),B&&(t.skipUEG(),t.skipUEG(),t.skipUEG(),t.skipUEG());if(t.readBoolean()){x=t.readBits(32),U=t.readBits(32);t.readBoolean()&&t.readUEG();if(t.readBoolean()){const e=t.readBoolean(),r=t.readBoolean();let s=!1;(e||r)&&(s=t.readBoolean(),s&&(t.readUByte(),t.readBits(5),t.readBoolean(),t.readBits(5)),t.readBits(4),t.readBits(4),s&&t.readBits(4),t.readBits(5),t.readBits(5),t.readBits(5));for(let i=0;i<=n;i++){D=t.readBoolean();let n=!1;D||t.readBoolean()?t.readEG():n=t.readBoolean();const i=n?1:t.readUEG()+1;if(e)for(let e=0;e<i;e++)t.readUEG(),t.readUEG(),s&&(t.readUEG(),t.readUEG()),t.skipBits(1);if(r)for(let e=0;e<i;e++)t.readUEG(),t.readUEG(),s&&(t.readUEG(),t.readUEG()),t.skipBits(1)}}}t.readBoolean()&&(t.readBoolean(),t.readBoolean(),t.readBoolean(),w=t.readUEG())}let F=y,$=S;if(v){let e=1,t=1;1===E?e=t=2:2==E&&(e=2),F=y-e*I-e*b,$=S-t*R-t*A}const G=r?["A","B","C"][r]:"",H=a<<24|o<<16|l<<8|c;let j=0;for(let e=0;e<32;e++)j=(j|(H>>e&1)<<31-e)>>>0;let W=j.toString(16);1===i&&"2"===W&&(W="6");return{codecString:`hvc1.${G}${i}.${W}.${s?"H":"L"}${m}.B0`,params:{general_tier_flag:s,general_profile_idc:i,general_profile_space:r,general_profile_compatibility_flags:[a,o,l,c],general_constraint_indicator_flags:[u,d,h,f,p,g],general_level_idc:m,bit_depth:C+8,bit_depth_luma_minus8:C,bit_depth_chroma_minus8:k,min_spatial_segmentation_idc:w,chroma_format_idc:E,frame_rate:{fixed:D,fps:U/x}},width:F,height:$,pixelRatio:[P,M]}}readPPS(e){const t=new Ns(this.ebsp2rbsp(e));t.readUByte(),t.readUByte(),t.skipUEG(),t.skipUEG(),t.skipBits(2),t.skipBits(3),t.skipBits(2),t.skipUEG(),t.skipUEG(),t.skipEG(),t.skipBits(2);t.readBoolean()&&t.skipUEG(),t.skipEG(),t.skipEG(),t.skipBits(4);const n=t.readBoolean(),r=t.readBoolean();let s=1;return r&&n?s=0:r?s=3:n&&(s=2),{parallelismType:s}}matchSPS(e,t){return String.fromCharCode.apply(null,e).substr(3)===String.fromCharCode.apply(null,t).substr(3)}}const Ms=188;class Ds{constructor(e,t,n,r){this.logger=void 0,this.observer=void 0,this.config=void 0,this.typeSupp
vendor: 4,599 bytes, line 1
1orted=void 0,this.sampleAes=null,this.pmtParsed=!1,this.audioCodec=void 0,this.videoCodec=void 0,this._pmtId=-1,this._videoTrack=void 0,this._audioTrack=void 0,this._id3Track=void 0,this._txtTrack=void 0,this.aacOverFlow=null,this.remainderData=null,this.videoParser=void 0,this.observer=e,this.config=t,this.typeSupported=n,this.logger=r,this.videoParser=null}static probe(e,t){const n=Ds.syncOffset(e);return n>0&&t.warn(`MPEG2-TS detected but first sync word found @ offset ${n}`),-1!==n}static syncOffset(e){const t=e.length;let n=Math.min(940,t-Ms)+1,r=0;for(;r<n;){let s=!1,i=-1,a=0;for(let o=r;o<t;o+=Ms){if(71!==e[o]||t-o!==Ms&&71!==e[o+Ms]){if(a)return-1;break}if(a++,-1===i&&(i=o,0!==i&&(n=Math.min(i+18612,e.length-Ms)+1)),s||(s=0===xs(e,o)),s&&a>1&&(0===i&&a>2||o+Ms>n))return i}r++}return-1}static createTrack(e,t){return{container:"video"===e||"audio"===e?"video/mp2t":void 0,type:e,id:ee[e],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:"audio"===e?t:void 0}}resetInitSegment(e,t,n,r){this.pmtParsed=!1,this._pmtId=-1,this._videoTrack=Ds.createTrack("video"),this._videoTrack.duration=r,this._audioTrack=Ds.createTrack("audio",r),this._id3Track=Ds.createTrack("id3"),this._txtTrack=Ds.createTrack("text"),this._audioTrack.segmentCodec="aac",this.videoParser=null,this.aacOverFlow=null,this.remainderData=null,this.audioCodec=t,this.videoCodec=n}resetTimeStamp(){}resetContiguity(){const{_audioTrack:e,_videoTrack:t,_id3Track:n}=this;e&&(e.pesData=null),t&&(t.pesData=null),n&&(n.pesData=null),this.aacOverFlow=null,this.remainderData=null}demux(e,t,n=!1,r=!1){let s;n||(this.sampleAes=null);const i=this._videoTrack,a=this._audioTrack,o=this._id3Track,l=this._txtTrack;let c=i.pid,u=i.pesData,d=a.pid,h=o.pid,f=a.pesData,p=o.pesData,g=null,m=this.pmtParsed,_=this._pmtId,T=e.length;if(this.remainderData&&(T=(e=me(this.remainderData,e)).length,this.remainderData=null),T<Ms&&!r)return this.remainderData=e,{audioTrack:a,videoTrack:i,id3Track:o,textTrack:l};const E=Math.max(0,Ds.syncOffset(e));T-=(T-E)%Ms,T<e.byteLength&&!r&&(this.remainderData=new Uint8Array(e.buffer,T,e.buffer.byteLength-T));let y=0;for(let t=E;t<T;t+=Ms)if(71===e[t]){const r=!!(64&e[t+1]),T=xs(e,t);let y;if((48&e[t+3])>>4>1){if(y=t+5+e[t+4],y===t+Ms)continue}else y=t+4;switch(T){case c:r&&(u&&(s=Gs(u,this.logger))&&(this.readyVideoParser(i.segmentCodec),null!==this.videoParser&&this.videoParser.parsePES(i,l,s,!1)),u={data:[],size:0}),u&&(u.data.push(e.subarray(y,t+Ms)),u.size+=t+Ms-y);break;case d:if(r){if(f&&(s=Gs(f,this.logger)))switch(a.segmentCodec){case"aac":this.parseAACPES(a,s);break;case"mp3":this.parseMPEGPES(a,s);break;case"ac3":this.parseAC3PES(a,s)}f={data:[],size:0}}f&&(f.data.push(e.subarray(y,t+Ms)),f.size+=t+Ms-y);break;case h:r&&(p&&(s=Gs(p,this.logger))&&this.parseID3PES(o,s),p={data:[],size:0}),p&&(p.data.push(e.subarray(y,t+Ms)),p.size+=t+Ms-y);break;case 0:r&&(y+=e[y]+1),_=this._pmtId=Us(e,y);break;case _:{r&&(y+=e[y]+1);const s=Bs(e,y,this.typeSupported,n,this.observer,this.logger);c=s.videoPid,c>0&&(i.pid=c,i.segmentCodec=s.segmentVideoCodec),d=s.audioPid,d>0&&(a.pid=d,a.segmentCodec=s.segmentAudioCodec),h=s.id3Pid,h>0&&(o.pid=h),null===g||m||(this.logger.warn(`MPEG-TS PMT found at ${t} after unknown PID '${g}'. Backtracking to sync byte @${E} to parse all TS packets.`),g=null,t=E-188),m=this.pmtParsed=!0;break}case 17:case 8191:break;default:g=T}}else y++;y>0&&Fs(this.observer,new Error(`Found ${y} TS packet/s that do not start with 0x47`),void 0,this.logger),i.pesData=u,a.pesData=f,o.pesData=p;const S={audioTrack:a,videoTrack:i,id3Track:o,textTrack:l};return r&&this.extractRemainingSamples(S),S}flush(){const{remainderData:e}=this;let t;return this.remainderData=null,t=e?this.demux(e,-1,!1,!0):{videoTrack:this._videoTrack,audioTrack:this._audioTrack,id3Track:this._id3Track,textTrack:this._txtTrack},this.extractRemainingSamples(t),this.sampleAes?this.decrypt(t,this.sampleAes):t}extractRemainingSamples(e){const{audioTrack:t,videoTrack:n,id3Track:r,textTrack:s}=e,i=n.pesData,a=t.pesData,o=r.pesData;let l;if(i&&(l=Gs(i,this.logger))?(this.readyVideoParser(n.segmentCodec),null!==this.videoParser&&(this.videoParser.parsePES(n,s,l,!0),n.pesData=null)):n.pesData=i,a&&(l=Gs(a,this.logger))){switch(t.segmentCodec){case"aac":this.parseAACPES(t,l);break;case"mp3":this.parseMPEGPES(t,l);break;case"ac3":this.parseAC3PES(t,l)}t.pesData=null}else null!=a&&a.size&&this.logger.log("last AAC PES packet truncated,might overlap between fragments"),t.pesData=a;o&&(l=Gs(o,this.logger))?(this.parseID3PES(r,l),r.pesData=null):r.pesData=o}
vendor: 10,945 bytes, line 1
1demuxSampleAes(e,t,n){const r=this.demux(e,n,!0,!this.config.progressive),s=this.sampleAes=new Ls(this.observer,this.config,t);return this.decrypt(r,s)}readyVideoParser(e){null===this.videoParser&&("avc"===e?this.videoParser=new ws:"hevc"===e&&(this.videoParser=new Ps))}decrypt(e,t){return new Promise((n=>{const{audioTrack:r,videoTrack:s}=e;r.samples&&"aac"===r.segmentCodec?t.decryptAacSamples(r.samples,0,(()=>{s.samples?t.decryptAvcSamples(s.samples,0,0,(()=>{n(e)})):n(e)})):s.samples&&t.decryptAvcSamples(s.samples,0,0,(()=>{n(e)}))}))}destroy(){this.observer&&this.observer.removeAllListeners(),this.config=this.logger=this.observer=null,this.aacOverFlow=this.videoParser=this.remainderData=this.sampleAes=null,this._videoTrack=this._audioTrack=this._id3Track=this._txtTrack=void 0}parseAACPES(e,t){let n=0;const r=this.aacOverFlow;let s,i,a,o=t.data;if(r){this.aacOverFlow=null;const t=r.missing,s=r.sample.unit.byteLength;if(-1===t)o=me(r.sample.unit,o);else{const i=s-t;r.sample.unit.set(o.subarray(0,t),i),e.samples.push(r.sample),n=r.missing}}for(s=n,i=o.length;s<i-1&&!Jr(o,s);s++);if(s!==n){let e;const t=s<i-1;if(e=t?`AAC PES did not start with ADTS header,offset:${s}`:"No ADTS header found in AAC PES",Fs(this.observer,new Error(e),t,this.logger),!t)return}if(Qr(e,this.observer,o,s,this.audioCodec),void 0!==t.pts)a=t.pts;else{if(!r)return void this.logger.warn("[tsdemuxer]: AAC PES unknown PTS");{const t=Zr(e.samplerate);a=r.sample.pts+t}}let l,c=0;for(;s<i;){if(l=es(e,o,s,a,c),s+=l.length,l.missing){this.aacOverFlow=l;break}for(c++;s<i-1&&!Jr(o,s);s++);}}parseMPEGPES(e,t){const n=t.data,r=n.length;let s=0,i=0;const a=t.pts;if(void 0!==a)for(;i<r;)if(vs(n,i)){const t=Es(e,n,i,a,s);if(!t)break;i+=t.length,s++}else i++;else this.logger.warn("[tsdemuxer]: MPEG PES unknown PTS")}parseAC3PES(e,t){{const n=t.data,r=t.pts;if(void 0===r)return void this.logger.warn("[tsdemuxer]: AC3 PES unknown PTS");const s=n.length;let i,a=0,o=0;for(;o<s&&(i=Rs(e,n,o,r,a++))>0;)o+=i}}parseID3PES(e,t){if(void 0===t.pts)return void this.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");const n=E({},t,{type:this._videoTrack?us.emsg:us.audioId3,duration:Number.POSITIVE_INFINITY});e.samples.push(n)}}function xs(e,t){return((31&e[t+1])<<8)+e[t+2]}function Us(e,t){return(31&e[t+10])<<8|e[t+11]}function Bs(e,t,n,r,s,i){const a={audioPid:-1,videoPid:-1,id3Pid:-1,segmentVideoCodec:"avc",segmentAudioCodec:"aac"},o=t+3+((15&e[t+1])<<8|e[t+2])-4;for(t+=12+((15&e[t+10])<<8|e[t+11]);t<o;){const o=xs(e,t),l=(15&e[t+3])<<8|e[t+4];switch(e[t]){case 207:if(!r){$s("ADTS AAC",i);break}case 15:-1===a.audioPid&&(a.audioPid=o);break;case 21:-1===a.id3Pid&&(a.id3Pid=o);break;case 219:if(!r){$s("H.264",i);break}case 27:-1===a.videoPid&&(a.videoPid=o);break;case 3:case 4:n.mpeg||n.mp3?-1===a.audioPid&&(a.audioPid=o,a.segmentAudioCodec="mp3"):i.log("MPEG audio found, not supported in this browser");break;case 193:if(!r){$s("AC-3",i);break}case 129:n.ac3?-1===a.audioPid&&(a.audioPid=o,a.segmentAudioCodec="ac3"):i.log("AC-3 audio found, not supported in this browser");break;case 6:if(-1===a.audioPid&&l>0){let r=t+5,s=l;for(;s>2;){if(106===e[r])!0!==n.ac3?i.log("AC-3 audio found, not supported in this browser for now"):(a.audioPid=o,a.segmentAudioCodec="ac3");const t=e[r+1]+2;r+=t,s-=t}}break;case 194:case 135:return Fs(s,new Error("Unsupported EC-3 in M2TS found"),void 0,i),a;case 36:-1===a.videoPid&&(a.videoPid=o,a.segmentVideoCodec="hevc",i.log("HEVC in M2TS found"))}t+=l+5}return a}function Fs(e,t,n,r){r.warn(`parsing error: ${t.message}`),e.emit(l.ERROR,l.ERROR,{type:a.MEDIA_ERROR,details:o.FRAG_PARSING_ERROR,fatal:!1,levelRetry:n,error:t,reason:t.message})}function $s(e,t){t.log(`${e} with AES-128-CBC encryption found in unencrypted stream`)}function Gs(e,t){let n,r,s,i,a,o=0;const l=e.data;if(!e||0===e.size)return null;for(;l[0].length<19&&l.length>1;)l[0]=me(l[0],l[1]),l.splice(1,1);n=l[0];if(1===(n[0]<<16)+(n[1]<<8)+n[2]){if(r=(n[4]<<8)+n[5],r&&r>e.size-6)return null;const c=n[7];192&c&&(i=536870912*(14&n[9])+4194304*(255&n[10])+16384*(254&n[11])+128*(255&n[12])+(254&n[13])/2,64&c?(a=536870912*(14&n[14])+4194304*(255&n[15])+16384*(254&n[16])+128*(255&n[17])+(254&n[18])/2,i-a>54e5&&(t.warn(`${Math.round((i-a)/9e4)}s delta between PTS and DTS, align them`),i=a)):a=i),s=n[8];let u=s+9;if(e.size<=u)return null;e.size-=u;const d=new Uint8Array(e.size);for(let e=0,t=l.length;e<t;e++){n=l[e];let t=n.byteLength;if(u){if(u>t){u-=t;continue}n=n.subarray(u),t-=u,u=0}d.set(n,o),o+=t}return r&&(r-=s+3),{data:d,pts:i,dts:a,len:r}}return null}class Hs{static getSilentFrame(e,t){if("mp4a.40.2"===e){if(1===t)return new Uint8Array([0,200,0,128,35,128]);if(2===t)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(3===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(4===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(5===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(6===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224])}else{if(1===t)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(2===t)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(3===t)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94])}}}const js=Math.pow(2,32)-1;class Ws{static init(){let e;for(e in Ws.types={avc1:[],avcC:[],hvc1:[],hvcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],".mp3":[],dac3:[],"ac-3":[],mvex:[],mvhd:[],pasp:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[]},Ws.types)Ws.types.hasOwnProperty(e)&&(Ws.types[e]=[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]);const t=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),n=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]);Ws.HDLR_TYPES={video:t,audio:n};const r=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),s=new Uint8Array([0,0,0,0,0,0,0,0]);Ws.STTS=Ws.STSC=Ws.STCO=s,Ws.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),Ws.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),Ws.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),Ws.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);const i=new Uint8Array([105,115,111,109]),a=new Uint8Array([97,118,99,49]),o=new Uint8Array([0,0,0,1]);Ws.FTYP=Ws.box(Ws.types.ftyp,i,o,i,a),Ws.DINF=Ws.box(Ws.types.dinf,Ws.box(Ws.types.dref,r))}static box(e,...t){let n=8,r=t.length;const s=r;for(;r--;)n+=t[r].byteLength;const i=new Uint8Array(n);for(i[0]=n>>24&255,i[1]=n>>16&255,i[2]=n>>8&255,i[3]=255&n,i.set(e,4),r=0,n=8;r<s;r++)i.set(t[r],n),n+=t[r].byteLength;return i}static hdlr(e){return Ws.box(Ws.types.hdlr,Ws.HDLR_TYPES[e])}static mdat(e){return Ws.box(Ws.types.mdat,e)}static mdhd(e,t){t*=e;const n=Math.floor(t/(js+1)),r=Math.floor(t%(js+1));return Ws.box(Ws.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,e>>24&255,e>>16&255,e>>8&255,255&e,n>>24,n>>16&255,n>>8&255,255&n,r>>24,r>>16&255,r>>8&255,255&r,85,196,0,0]))}static mdia(e){return Ws.box(Ws.types.mdia,Ws.mdhd(e.timescale||0,e.duration||0),Ws.hdlr(e.type),Ws.minf(e))}static mfhd(e){return Ws.box(Ws.types.mfhd,new Uint8Array([0,0,0,0,e>>24,e>>16&255,e>>8&255,255&e]))}static minf(e){return"audio"===e.type?Ws.box(Ws.types.minf,Ws.box(Ws.types.smhd,Ws.SMHD),Ws.DINF,Ws.stbl(e)):Ws.box(Ws.types.minf,Ws.box(Ws.types.vmhd,Ws.VMHD),Ws.DINF,Ws.stbl(e))}static moof(e,t,n){return Ws.box(Ws.types.moof,Ws.mfhd(e),Ws.traf(n,t))}static moov(e){let t=e.length;const n=[];for(;t--;)n[t]=Ws.trak(e[t]);return Ws.box.apply(null,[Ws.types.moov,Ws.mvhd(e[0].timescale||0,e[0].duration||0)].concat(n).concat(Ws.mvex(e)))}static mvex(e){let t=e.length;const n=[];for(;t--;)n[t]=Ws.trex(e[t]);return Ws.box.apply(null,[Ws.types.mvex,...n])}static mvhd(e,t){t*=e;const n=Math.floor(t/(js+1)),r=Math.floor(t%(js+1)),s=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,e>>24&255,e>>16&255,e>>8&255,255&e,n>>24,n>>16&255,n>>8&255,255&n,r>>24,r>>16&255,r>>8&255,255&r,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return Ws.box(Ws.types.mvhd,s)}static sdtp(e){const t=e.samples||[],n=new Uint8Array(4+t.length);let r,s;for(r=0;r<t.length;r++)s=t[r].flags,n[r+4]=s.dependsOn<<4|s.isDependedOn<<2|s.hasRedundancy;return Ws.box(Ws.types.sdtp,n)}static stbl(e){return Ws.box(Ws.types.stbl,Ws.stsd(e),Ws.box(Ws.types.stts,Ws.STTS),Ws.box(Ws.types.stsc,Ws.STSC),Ws.box(Ws.types.stsz,Ws.STSZ),Ws.box(Ws.types.stco,Ws.STCO))}static avc1(e){let t,n,r,s=[],i=[];for(t=0;t<e.sps.length;t++)n=e.sps[t],r=n.byteLength,s.push(r>>>8&255),s.push(255&r),s=s.concat(Array.prototype.slice.call(n));for(t=0;t<e.pps.length;t++)n=e.pps[t],r=n.byteLength,i.push(r>>>8&255),i.push(255&r),i=i.concat(Array.prototype.slice.call(n));const a=Ws.box(Ws.types.avcC,new Uint8Array([1,s[3],s[4],s[5],255,224|e.sps.length].concat(s).concat([e.pps.length]).concat(i))),o=e.width,l=e.height,c=e.pixelRatio[0],u=e.pixelRatio[1];return Ws.box(Ws.types.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,o>>8&255,255&o,l>>8&255,255&l,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),a,Ws.box(Ws.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),Ws.box(Ws.types.pasp,new Uint8Array([c>>24,c>>16&255,c>>8&255,255&c,u>>24,u>>16&255,u>>8&255,255&u])))}static esds(e){const t=e.config;return new Uint8Array([0,0,0,0,3,25,0,1,0,4,17,64,21,0,0,0,0,0,0,0,0,0,0,0,5,2,...t,6,1,2])}static audioStsd(e){const t=e.samplerate||0;return new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,e.channelCount||0,0,16,0,0,0,0,t>>8&255,255&t,0,0])}static mp4a(e){return Ws.box(Ws.types.mp4a,Ws.audioStsd(e),Ws.box(Ws.types.esds,Ws.esds(e)))}static mp3(e){return Ws.box(Ws.types[".mp3"],Ws.audioStsd(e))}static ac3(e){return Ws.box(Ws.types["ac-3"],Ws.audioStsd(e),Ws.box(Ws.types.dac3,e.config))}static stsd(e){const{segmentCodec:t}=e;if("audio"===e.type){if("aac"===t)return Ws.box(Ws.types.stsd,Ws.STSD,Ws.mp4a(e));if("ac3"===t&&e.config)return Ws.box(Ws.types.stsd,Ws.STSD,Ws.ac3(e));if("mp3"===t&&"mp3"===e.codec)return Ws.box(Ws.types.stsd,Ws.STSD,Ws.mp3(e))}
vendor: 4,074 bytes, line 1
1else{if(!e.pps||!e.sps)throw new Error("video track missing pps or sps");if("avc"===t)return Ws.box(Ws.types.stsd,Ws.STSD,Ws.avc1(e));if("hevc"===t&&e.vps)return Ws.box(Ws.types.stsd,Ws.STSD,Ws.hvc1(e))}throw new Error(`unsupported ${e.type} segment codec (${t}/${e.codec})`)}static tkhd(e){const t=e.id,n=(e.duration||0)*(e.timescale||0),r=e.width||0,s=e.height||0,i=Math.floor(n/(js+1)),a=Math.floor(n%(js+1));return Ws.box(Ws.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,t>>24&255,t>>16&255,t>>8&255,255&t,0,0,0,0,i>>24,i>>16&255,i>>8&255,255&i,a>>24,a>>16&255,a>>8&255,255&a,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,r>>8&255,255&r,0,0,s>>8&255,255&s,0,0]))}static traf(e,t){const n=Ws.sdtp(e),r=e.id,s=Math.floor(t/(js+1)),i=Math.floor(t%(js+1));return Ws.box(Ws.types.traf,Ws.box(Ws.types.tfhd,new Uint8Array([0,0,0,0,r>>24,r>>16&255,r>>8&255,255&r])),Ws.box(Ws.types.tfdt,new Uint8Array([1,0,0,0,s>>24,s>>16&255,s>>8&255,255&s,i>>24,i>>16&255,i>>8&255,255&i])),Ws.trun(e,n.length+16+20+8+16+8+8),n)}static trak(e){return e.duration=e.duration||4294967295,Ws.box(Ws.types.trak,Ws.tkhd(e),Ws.mdia(e))}static trex(e){const t=e.id;return Ws.box(Ws.types.trex,new Uint8Array([0,0,0,0,t>>24,t>>16&255,t>>8&255,255&t,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))}static trun(e,t){const n=e.samples||[],r=n.length,s=12+16*r,i=new Uint8Array(s);let a,o,l,c,u,d;for(t+=8+s,i.set(["video"===e.type?1:0,0,15,1,r>>>24&255,r>>>16&255,r>>>8&255,255&r,t>>>24&255,t>>>16&255,t>>>8&255,255&t],0),a=0;a<r;a++)o=n[a],l=o.duration,c=o.size,u=o.flags,d=o.cts,i.set([l>>>24&255,l>>>16&255,l>>>8&255,255&l,c>>>24&255,c>>>16&255,c>>>8&255,255&c,u.isLeading<<2|u.dependsOn,u.isDependedOn<<6|u.hasRedundancy<<4|u.paddingValue<<1|u.isNonSync,61440&u.degradPrio,15&u.degradPrio,d>>>24&255,d>>>16&255,d>>>8&255,255&d],12+16*a);return Ws.box(Ws.types.trun,i)}static initSegment(e){Ws.types||Ws.init();const t=Ws.moov(e);return me(Ws.FTYP,t)}static hvc1(e){const t=e.params,n=[e.vps,e.sps,e.pps],r=new Uint8Array([1,t.general_profile_space<<6|(t.general_tier_flag?32:0)|t.general_profile_idc,t.general_profile_compatibility_flags[0],t.general_profile_compatibility_flags[1],t.general_profile_compatibility_flags[2],t.general_profile_compatibility_flags[3],t.general_constraint_indicator_flags[0],t.general_constraint_indicator_flags[1],t.general_constraint_indicator_flags[2],t.general_constraint_indicator_flags[3],t.general_constraint_indicator_flags[4],t.general_constraint_indicator_flags[5],t.general_level_idc,240|t.min_spatial_segmentation_idc>>8,255&t.min_spatial_segmentation_idc,252|t.parallelismType,252|t.chroma_format_idc,248|t.bit_depth_luma_minus8,248|t.bit_depth_chroma_minus8,0,parseInt(t.frame_rate.fps),3|t.temporal_id_nested<<2|t.num_temporal_layers<<3|(t.frame_rate.fixed?64:0),n.length]);let s=r.length;for(let e=0;e<n.length;e+=1){s+=3;for(let t=0;t<n[e].length;t+=1)s+=2+n[e][t].length}const i=new Uint8Array(s);i.set(r,0),s=r.length;const a=n.length-1;for(let e=0;e<n.length;e+=1){i.set(new Uint8Array([32+e|(e===a?128:0),0,n[e].length]),s),s+=3;for(let t=0;t<n[e].length;t+=1)i.set(new Uint8Array([n[e][t].length>>8,255&n[e][t].length]),s),s+=2,i.set(n[e][t],s),s+=n[e][t].length}const o=Ws.box(Ws.types.hvcC,i),l=e.width,c=e.height,u=e.pixelRatio[0],d=e.pixelRatio[1];return Ws.box(Ws.types.hvc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,l>>8&255,255&l,c>>8&255,255&c,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),o,Ws.box(Ws.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),Ws.box(Ws.types.pasp,new Uint8Array([u>>24,u>>16&255,u>>8&255,255&u,d>>24,d>>16&255,d>>8&255,255&d])))}}Ws.types=void 0,Ws.HDLR_TYPES=void 0,Ws.STTS=void 0,Ws.STSC=void 0,Ws.STCO=void 0,Ws.STSZ=void 0,Ws.VMHD=void 0,Ws.SMHD=void 0,Ws.STSD=void 0,Ws.FTYP=void 0,Ws.DINF=void 0;function Ks(e,t,n=1,r=!1){const s=e*t*n;return r?Math.round(s):s}function Vs(e,t=!1){return Ks(e,1e3,1/9e4,t)}
vendor: 18,570 bytes, line 1
1function qs(e){const{baseTime:t,timescale:n,trackId:r}=e;return`${t/n} (${t}/${n}) trackId: ${r}`}let Ys,zs=null,Js=null;function Xs(e,t,n,r){return{duration:t,size:n,cts:r,flags:{isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:e?2:1,isNonSync:e?0:1}}}class Qs extends v{constructor(e,t,n,r){if(super("mp4-remuxer",r),this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.ISGenerated=!1,this._initPTS=null,this._initDTS=null,this.nextVideoTs=null,this.nextAudioTs=null,this.videoSampleDuration=null,this.isAudioContiguous=!1,this.isVideoContiguous=!1,this.videoTrackConfig=void 0,this.observer=e,this.config=t,this.typeSupported=n,this.ISGenerated=!1,null===zs){const e=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);zs=e?parseInt(e[1]):0}if(null===Js){const e=navigator.userAgent.match(/Safari\/(\d+)/i);Js=e?parseInt(e[1]):0}}destroy(){this.config=this.videoTrackConfig=this._initPTS=this._initDTS=null}resetTimeStamp(e){const t=this._initPTS;t&&e&&e.trackId===t.trackId&&e.baseTime===t.baseTime&&e.timescale===t.timescale||this.log(`Reset initPTS: ${t?qs(t):t} > ${e?qs(e):e}`),this._initPTS=this._initDTS=e}resetNextTimestamp(){this.log("reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1}resetInitSegment(){this.log("ISGenerated flag reset"),this.ISGenerated=!1,this.videoTrackConfig=void 0}getVideoStartPts(e){let t=!1;const n=e[0].pts,r=e.reduce(((e,r)=>{let s=r.pts,i=s-e;return i<-4294967296&&(t=!0,s=Zs(s,n),i=s-e),i>0?e:s}),n);return t&&this.debug("PTS rollover detected"),r}remux(e,t,n,r,s,i,a,o){let l,c,u,d,h,f,g=s,m=s;const _=e.pid>-1,T=t.pid>-1,E=t.samples.length,y=e.samples.length>0,S=a&&E>0||E>1;if((!_||y)&&(!T||S)||this.ISGenerated||a){if(this.ISGenerated){var v,b,I,A;const e=this.videoTrackConfig;(e&&(t.width!==e.width||t.height!==e.height||(null==(v=t.pixelRatio)?void 0:v[0])!==(null==(b=e.pixelRatio)?void 0:b[0])||(null==(I=t.pixelRatio)?void 0:I[1])!==(null==(A=e.pixelRatio)?void 0:A[1]))||!e&&S||null===this.nextAudioTs&&y)&&this.resetInitSegment()}this.ISGenerated||(u=this.generateIS(e,t,s,i));const n=this.isVideoContiguous;let r,a=-1;if(S&&(a=function(e){for(let t=0;t<e.length;t++)if(e[t].key)return t;return-1}(t.samples),!n&&this.config.forceKeyFrameOnDiscontinuity))if(f=!0,a>0){this.warn(`Dropped ${a} out of ${E} video samples due to a missing keyframe`);const e=this.getVideoStartPts(t.samples);t.samples=t.samples.slice(a),t.dropped+=a,m+=(t.samples[0].pts-e)/t.inputTimeScale,r=m}else-1===a&&(this.warn(`No keyframe found out of ${E} video samples`),f=!1);if(this.ISGenerated){if(y&&S){const n=this.getVideoStartPts(t.samples),r=(Zs(e.samples[0].pts,n)-n)/t.inputTimeScale;g+=Math.max(0,r),m+=Math.max(0,-r)}if(y){if(e.samplerate||(this.warn("regenerate InitSegment as audio detected"),u=this.generateIS(e,t,s,i)),c=this.remuxAudio(e,g,this.isAudioContiguous,i,T||S||o===p?m:void 0),S){const r=c?c.endPTS-c.startPTS:0;t.inputTimeScale||(this.warn("regenerate InitSegment as video detected"),u=this.generateIS(e,t,s,i)),l=this.remuxVideo(t,m,n,r)}}else S&&(l=this.remuxVideo(t,m,n,0));l&&(l.firstKeyFrame=a,l.independent=-1!==a,l.firstKeyFramePTS=r)}}return this.ISGenerated&&this._initPTS&&this._initDTS&&(n.samples.length&&(h=ei(n,s,this._initPTS,this._initDTS)),r.samples.length&&(d=ti(r,s,this._initPTS))),{audio:c,video:l,initSegment:u,independent:f,text:d,id3:h}}computeInitPts(e,t,n,r){const s=Math.round(n*t);let i=Zs(e,s);if(i<s+t)for(this.log(`Adjusting PTS for rollover in timeline near ${(s-i)/t} ${r}`);i<s+t;)i+=8589934592;return i-s}generateIS(e,t,n,r){const s=e.samples,i=t.samples,a=this.typeSupported,o={},l=this._initPTS;let c,u,d,h=!l||r,f="audio/mp4",p=-1;if(h&&(c=u=1/0),e.config&&s.length){switch(e.timescale=e.samplerate,e.segmentCodec){case"mp3":a.mpeg?(f="audio/mpeg",e.codec=""):a.mp3&&(e.codec="mp3");break;case"ac3":e.codec="ac-3"}o.audio={id:"audio",container:f,codec:e.codec,initSegment:"mp3"===e.segmentCodec&&a.mpeg?new Uint8Array(0):Ws.initSegment([e]),metadata:{channelCount:e.channelCount}},h&&(p=e.id,d=e.inputTimeScale,l&&d===l.timescale?h=!1:c=u=this.computeInitPts(s[0].pts,d,n,"audio"))}if(t.sps&&t.pps&&i.length){if(t.timescale=t.inputTimeScale,o.video={id:"main",container:"video/mp4",codec:t.codec,initSegment:Ws.initSegment([t]),metadata:{width:t.width,height:t.height}},h)if(p=t.id,d=t.inputTimeScale,l&&d===l.timescale)h=!1;else{const e=this.getVideoStartPts(i),t=Zs(i[0].dts,e),r=this.computeInitPts(t,d,n,"video"),s=this.computeInitPts(e,d,n,"video");u=Math.min(u,r),c=Math.min(c,s)}this.videoTrackConfig={width:t.width,height:t.height,pixelRatio:t.pixelRatio}}if(Object.keys(o).length)return this.ISGenerated=!0,h?(l&&this.warn(`Timestamps at playlist time: ${r?"":"~"}${n} ${c/d} != initPTS: ${l.baseTime/l.timescale} (${l.baseTime}/${l.timescale}) trackId: ${l.trackId}`),this.log(`Found initPTS at playlist time: ${n} offset: ${c/d} (${c}/${d}) trackId: ${p}`),this._initPTS={baseTime:c,timescale:d,trackId:p},this._initDTS={baseTime:u,timescale:d,trackId:p}):c=d=void 0,{tracks:o,initPTS:c,timescale:d,trackId:p}}remuxVideo(e,t,n,r){const s=e.inputTimeScale,i=e.samples,c=[],u=i.length,d=this._initPTS,h=d.baseTime*s/d.timescale;let f,p,g=this.nextVideoTs,m=8,_=this.videoSampleDuration,T=Number.POSITIVE_INFINITY,y=Number.NEGATIVE_INFINITY,S=!1;if(!n||null===g){const e=h+t*s,r=i[0].pts-Zs(i[0].dts,i[0].pts);zs&&null!==g&&Math.abs(e-r-(g+h))<15e3?n=!0:g=e-r-h}const v=g+h;for(let e=0;e<u;e++){const t=i[e];t.pts=Zs(t.pts,v),t.dts=Zs(t.dts,v),t.dts<i[e>0?e-1:e].dts&&(S=!0)}S&&i.sort((function(e,t){const n=e.dts-t.dts,r=e.pts-t.pts;return n||r})),f=i[0].dts,p=i[i.length-1].dts;const b=p-f,I=b?Math.round(b/(u-1)):_||e.inputTimeScale/30;if(n){const n=f-v,r=n>I,s=n<-1;if((r||s)&&(r?this.warn(`${(e.segmentCodec||"").toUpperCase()}: ${Vs(n,!0)} ms (${n}dts) hole between fragments detected at ${t.toFixed(3)}`):this.warn(`${(e.segmentCodec||"").toUpperCase()}: ${Vs(-n,!0)} ms (${n}dts) overlapping between fragments detected at ${t.toFixed(3)}`),!s||v>=i[0].pts||zs)){f=v;const e=i[0].pts-n;if(r)i[0].dts=f,i[0].pts=e;else{let t=!0;for(let r=0;r<i.length&&!(i[r].dts>e&&t);r++){const e=i[r].pts;if(i[r].dts-=n,i[r].pts-=n,r<i.length-1){const n=i[r+1].pts;t=n<=i[r].pts==n<=e}}}this.log(`Video: Initial PTS/DTS adjusted: ${Vs(e,!0)}/${Vs(f,!0)}, delta: ${Vs(n,!0)} ms`)}}f=Math.max(0,f);let A=0,R=0,C=f;for(let e=0;e<u;e++){const t=i[e],n=t.units,r=n.length;let s=0;for(let e=0;e<r;e++)s+=n[e].data.length;R+=s,A+=r,t.length=s,t.dts<C?(t.dts=C,C+=I/4|0||1):C=t.dts,T=Math.min(t.pts,T),y=Math.max(t.pts,y)}p=i[u-1].dts;const k=R+4*A+8;let L;try{L=new Uint8Array(k)}catch(e){return void this.observer.emit(l.ERROR,l.ERROR,{type:a.MUX_ERROR,details:o.REMUX_ALLOC_ERROR,fatal:!1,error:e,bytes:k,reason:`fail allocating video mdat ${k}`})}const O=new DataView(L.buffer);O.setUint32(0,k),L.set(Ws.types.mdat,4);let N=!1,w=Number.POSITIVE_INFINITY,P=Number.POSITIVE_INFINITY,M=Number.NEGATIVE_INFINITY,D=Number.NEGATIVE_INFINITY;for(let e=0;e<u;e++){const t=i[e],n=t.units;let a,o=0;for(let e=0,t=n.length;e<t;e++){const t=n[e],r=t.data,s=t.data.byteLength;O.setUint32(m,s),m+=4,L.set(r,m),m+=s,o+=4+s}if(e<u-1)_=i[e+1].dts-t.dts,a=i[e+1].pts-t.pts;else{const n=this.config,o=e>0?t.dts-i[e-1].dts:I;if(a=e>0?t.pts-i[e-1].pts:I,n.stretchShortVideoTrack&&null!==this.nextAudioTs){const e=Math.floor(n.maxBufferHole*s),i=(r?T+r*s:this.nextAudioTs+h)-t.pts;i>e?(_=i-o,_<0?_=o:N=!0,this.log(`It is approximately ${i/90} ms to the next segment; using duration ${_/90} ms for the last video frame.`)):_=o}else _=o}const l=Math.round(t.pts-t.dts);w=Math.min(w,_),M=Math.max(M,_),P=Math.min(P,a),D=Math.max(D,a),c.push(Xs(t.key,_,o,l))}if(c.length)if(zs){if(zs<70){const e=c[0].flags;e.dependsOn=2,e.isNonSync=0}}else if(Js&&D-P<M-w&&I/M<.025&&0===c[0].cts){this.warn("Found irregular gaps in sample duration. Using PTS instead of DTS to determine MP4 sample duration.");let e=f;for(let t=0,n=c.length;t<n;t++){const r=e+c[t].duration,s=e+c[t].cts;if(t<n-1){const e=r+c[t+1].cts;c[t].duration=e-s}else c[t].duration=t?c[t-1].duration:I;c[t].cts=0,e=r}}_=N||!_?I:_;const x=p+_;this.nextVideoTs=g=x-h,this.videoSampleDuration=_,this.isVideoContiguous=!0;const U={data1:Ws.moof(e.sequenceNumber++,f,E(e,{samples:c})),data2:L,startPTS:(T-h)/s,endPTS:(y+_-h)/s,startDTS:(f-h)/s,endDTS:g/s,type:"video",hasAudio:!1,hasVideo:!0,nb:c.length,dropped:e.dropped};return e.samples=[],e.dropped=0,U}getSamplesPerFrame(e){switch(e.segmentCodec){case"mp3":return 1152;case"ac3":return 1536;default:return 1024}}remuxAudio(e,t,n,r,s){const i=e.inputTimeScale,c=i/(e.samplerate?e.samplerate:i),u=this.getSamplesPerFrame(e),d=u*c,h=this._initPTS,f="mp3"===e.segmentCodec&&this.typeSupported.mpeg,p=[],g=void 0!==s;let m=e.samples,_=f?0:8,T=this.nextAudioTs||-1;const y=h.baseTime*i/h.timescale,S=y+t*i;if(this.isAudioContiguous=n=n||m.length&&T>0&&(r&&Math.abs(S-(T+y))<9e3||Math.abs(Zs(m[0].pts,S)-(T+y))<20*d),m.forEach((function(e){e.pts=Zs(e.pts,S)})),!n||T<0){const e=m.length;if(m=m.filter((e=>e.pts>=0)),e!==m.length&&this.warn(`Removed ${m.length-e} of ${e} samples (initPTS ${y} / ${i})`),!m.length)return;T=0===s?0:r&&!g?Math.max(0,S-y):m[0].pts-y}if("aac"===e.segmentCodec){const t=this.config.maxAudioFramesDrift;for(let n=0,r=T+y;n<m.length;n++){const s=m[n],a=s.pts,o=a-r,l=Math.abs(1e3*o/i);if(o<=-t*d&&g)0===n&&(this.warn(`Audio frame @ ${(a/i).toFixed(3)}s overlaps marker by ${Math.round(1e3*o/i)} ms.`),this.nextAudioTs=T=a-y,r=a);else if(o>=t*d&&l<1e4&&g){let t=Math.round(o/d);for(r=a-t*d;r<0&&t&&d;)t--,r+=d;0===n&&(this.nextAudioTs=T=r-y),this.warn(`Injecting ${t} audio frames @ ${((r-y)/i).toFixed(3)}s due to ${Math.round(1e3*o/i)} ms gap.`);for(let i=0;i<t;i++){let t=Hs.getSilentFrame(e.parsedCodec||e.manifestCodec||e.codec,e.channelCount);t||(this.log("Unable to get silent frame for given audio codec; duplicating last frame instead."),t=s.unit.subarray()),m.splice(n,0,{unit:t,pts:r}),r+=d,n++}}s.pts=r,r+=d}}let v,b=null,I=null,A=0,R=m.length;for(;R--;)A+=m[R].unit.byteLength;for(let t=0,r=m.length;t<r;t++){const r=m[t],s=r.unit;let i=r.pts;if(null!==I){p[t-1].duration=Math.round((i-I)/c)}else{if(n&&"aac"===e.segmentCodec&&(i=T+y),b=i,!(A>0))return;A+=_;try{v=new Uint8Array(A)}catch(e){return void this.observer.emit(l.ERROR,l.ERROR,{type:a.MUX_ERROR,details:o.REMUX_ALLOC_ERROR,fatal:!1,error:e,bytes:A,reason:`fail allocating audio mdat ${A}`})}if(!f){new DataView(v.buffer).setUint32(0,A),v.set(Ws.types.mdat,4)}}v.set(s,_);const d=s.byteLength;_+=d,p.push(Xs(!0,u,d,0)),I=i}const C=p.length;if(!C)return;const k=p[p.length-1];T=I-y,this.nextAudioTs=T+c*k.duration;const L=f?new Uint8Array(0):Ws.moof(e.sequenceNumber++,b/c,E({},e,{samples:p}));e.samples=[];const O=(b-y)/i,N=this.nextAudioTs/i,w={data1:L,data2:v,startPTS:O,endPTS:N,startDTS:O,endDTS:N,type:"audio",hasAudio:!0,hasVideo:!1,nb:C};return this.isAudioContiguous=!0,w}}function Zs(e,t){let n;if(null===t)return e;for(n=t<e?-8589934592:8589934592;Math.abs(e-t)>4294967296;)e+=n;return e}function ei(e,t,n,r){const s=e.samples.length;if(!s)return;const i=e.inputTimeScale;for(let a=0;a<s;a++){const s=e.samples[a];s.pts=Zs(s.pts-n.baseTime*i/n.timescale,t*i)/i,s.dts=Zs(s.dts-r.baseTime*i/r.timescale,t*i)/i}const a=e.samples;return e.samples=[],{samples:a}}function ti(e,t,n){const r=e.samples.length;if(!r)return;const s=e.inputTimeScale;for(let i=0;i<r;i++){const r=e.samples[i];r.pts=Zs(r.pts-n.baseTime*s/n.timescale,t*s)/s}e.samples.sort(((e,t)=>e.pts-t.pts));const i=e.samples;return e.samples=[],{samples:i}}function ni(e,t,n=!1){return void 0!==(null==e?void 0:e.start)?(e.start+(n?e.duration:0))/e.timescale:t}function ri(e,t,n){const r=e.codec;if(r&&r.length>4)return r;if(t===W){if("ec-3"===r||"ac-3"===r||"alac"===r)return r;if("fLaC"===r||"Opus"===r){return Me(r,!1)}return n.warn(`Unhandled audio codec "${r}" in mp4 MAP`),r||"mp4a"}return n.warn(`Unhandled video codec "${r}" in mp4 MAP`),r||"avc1"}try{Ys=self.performance.now.bind(self.performance)}catch(e){Ys=Date.now}const si=[{demux:class{constructor(e,t){this.remainderData=null,this.timeOffset=0,this.config=void 0,this.videoTrack=void 0,this.audioTrack=void 0,this.id3Track=void 0,this.txtTrack=void 0,this.config=t}resetTimeStamp(){}resetInitSegment(e,t,n,r){const s=this.videoTrack=ds("video",1),i=this.audioTrack=ds("audio",1),a=this.txtTrack=ds("text",1);if(this.id3Track=ds("id3",1),this.timeOffset=0,null==e||!e.byteLength)return;const o=le(e);if(o.video){const{id:e,timescale:t,codec:n,supplemental:r}=o.video;s.id=e,s.timescale=a.timescale=t,s.codec=n,s.supplemental=r}if(o.audio){const{id:e,timescale:t,codec:n}=o.audio;i.id=e,i.timescale=t,i.codec=n}a.id=ee.text,s.sampleDuration=0,s.duration=i.duration=r}resetContiguity(){this.remainderData=null}static probe(e){return function(e){const t=e.byteLength;for(let n=0;n<t;){const r=re(e,n);if(r>8&&109===e[n+4]&&111===e[n+5]&&111===e[n+6]&&102===e[n+7])return!0;n=r>1?n+r:t}return!1}(e)}demux(e,t){this.timeOffset=t;let n=e;const r=this.videoTrack,s=this.txtTrack;if(this.config.progressive){this.remainderData&&(n=me(this.remainderData,e));const t=function(e){const t={valid:null,remainder:null},n=ae(e,["moof"]);if(n.length<2)return t.remainder=e,t;const r=n[n.length-1];return t.valid=e.slice(0,r.byteOffset-8),t.remainder=e.slice(r.byteOffset-8),t}(n);this.remainderData=t.remainder,r.samples=t.valid||new Uint8Array}else r.samples=n;const i=this.extractID3Track(r,t);return s.samples=_e(t,r),{videoTrack:r,audioTrack:this.audioTrack,id3Track:i,textTrack:this.txtTrack}}flush(){const e=this.timeOffset,t=this.videoTrack,n=this.txtTrack;t.samples=this.remainderData||new Uint8Array,this.remainderData=null;const r=this.extractID3Track(t,this.timeOffset);return n.samples=_e(e,t),{videoTrack:t,audioTrack:ds(),id3Track:r,textTrack:ds()}}extractID3Track(e,t){const n=this.id3Track;if(e.samples.length){const r=ae(e.samples,["emsg"]);r&&r.forEach((e=>{const r=function(e){const t=e[0];let n="",r="",i=0,a=0,o=0,l=0,c=0,u=0;if(0===t){for(;"\0"!==te(e.subarray(u,u+1));)n+=te(e.subarray(u,u+1)),u+=1;for(n+=te(e.subarray(u,u+1)),u+=1;"\0"!==te(e.subarray(u,u+1));)r+=te(e.subarray(u,u+1)),u+=1;r+=te(e.subarray(u,u+1)),u+=1,i=re(e,12),a=re(e,16),l=re(e,20),c=re(e,24),u=28}else if(1===t){u+=4,i=re(e,u),u+=4;const t=re(e,u);u+=4;const a=re(e,u);for(u+=4,o=2**32*t+a,s(o)||(o=Number.MAX_SAFE_INTEGER,k.warn("Presentation time exceeds safe integer limit and wrapped to max safe integer in parsing emsg box")),l=re(e,u),u+=4,c=re(e,u),u+=4;"\0"!==te(e.subarray(u,u+1));)n+=te(e.subarray(u,u+1)),u+=1;for(n+=te(e.subarray(u,u+1)),u+=1;"\0"!==te(e.subarray(u,u+1));)r+=te(e.subarray(u,u+1)),u+=1;r+=te(e.subarray(u,u+1)),u+=1}return{schemeIdUri:n,value:r,timeScale:i,presentationTime:o,presentationTimeDelta:a,eventDuration:l,id:c,payload:e.subarray(u,e.byteLength)}}(e);if(Cs.test(r.schemeIdUri)){const e=ks(r,t);let s=4294967295===r.eventDuration?Number.POSITIVE_INFINITY:r.eventDuration/r.timeScale;s<=.001&&(s=Number.POSITIVE_INFINITY);const i=r.payload;n.samples.push({data:i,len:i.byteLength,dts:e,pts:e,type:us.emsg,duration:s})}else if(this.config.enableEmsgKLVMetadata&&r.schemeIdUri.startsWith("urn:misb:KLV:bin:1910.1")){const e=ks(r,t);n.samples.push({data:r.payload,len:r.payload.byteLength,dts:e,pts:e,type:us.misbklv,duration:Number.POSITIVE_INFINITY})}}))}return n}demuxSampleAes(e,t,n){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))}destroy(){this.config=null,this.remainderData=null,this.videoTrack=this.audioTrack=this.id3Track=this.txtTrack=void 0}},remux:class extends v{constructor(e,t,n,r){super("passthrough-remuxer",r),this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=null,this.initTracks=void 0,this.lastEndTime=null,this.isVideoContiguous=!1}destroy(){}resetTimeStamp(e){this.lastEndTime=null;const t=this.initPTS;t&&e&&t.baseTime===e.baseTime&&t.timescale===e.timescale||(this.initPTS=e)}resetNextTimestamp(){this.isVideoContiguous=!1,this.lastEndTime=null}resetInitSegment(e,t,n,r){this.audioCodec=t,this.videoCodec=n,this.generateInitSegment(e,r),this.emitInitSegment=!0}generateInitSegment(e,t){let{audioCodec:n,videoCodec:r}=this;if(null==e||!e.byteLength)return this.initTracks=void 0,void(this.initData=void 0);const{audio:s,video:i}=this.initData=le(e);if(t)!function(e,t){if(!e||!t)return;const n=t.keyId;n&&t.isCommonEncryption&&pe(e,((e,t)=>{const r=e.subarray(8,24);r.some((e=>0!==e))||(k.log(`[eme] Patching keyId in 'enc${t?"a":"v"}>sinf>>tenc' box: ${w(r)} -> ${w(n)}`),e.set(n,8))}))}(e,t);else{const e=s||i;null!=e&&e.encrypted&&this.warn(`Init segment with encrypted track with has no key ("${e.codec}")!`)}s&&(n=ri(s,W,this)),i&&(r=ri(i,K,this));const a={};s&&i?a.audiovideo={container:"video/mp4",codec:n+","+r,supplemental:i.supplemental,encrypted:i.encrypted,initSegment:e,id:"main"}:s?a.audio={container:"audio/mp4",codec:n,encrypted:s.encrypted,initSegment:e,id:"audio"}:i?a.video={container:"video/mp4",codec:r,supplemental:i.supplemental,encrypted:i.encrypted,initSegment:e,id:"main"}:this.warn("initSegment does not contain moov or trak boxes."),this.initTracks=a}remux(e,t,n,s,i,a){var o,l;let{initPTS:c,lastEndTime:u}=this;const d={audio:void 0,video:void 0,text:s,id3:n,initSegment:void 0};r(u)||(u=this.lastEndTime=i||0);const h=t.samples;if(!h.length)return d;const f={initPTS:void 0,timescale:void 0,trackId:void 0};let p=this.initData;if(null!=(o=p)&&o.length||(this.generateInitSegment(h),p=this.initData),null==(l=p)||!l.length)return this.warn("Failed to generate initSegment."),d;this.emitInitSegment&&(f.tracks=this.initTracks,this.emitInitSegment=!1);const g=function(e,t,n){const s={},i=ae(e,["moof","traf"]);for(let e=0;e<i.length;e++){const a=i[e],o=ae(a,["tfhd"])[0],l=re(o,4),c=t[l];if(!c)continue;s[l]||(s[l]={start:NaN,duration:0,sampleCount:0,timescale:c.timescale,type:c.type});const u=s[l],d=ae(a,["tfdt"])[0];if(d){const e=d[0];let t=re(d,4);1===e&&(t===Q?n.warn("[mp4-demuxer]: Ignoring assumed invalid signed 64-bit track fragment decode time"):(t*=Q+1,t+=re(d,8))),r(t)&&(!r(u.start)||t<u.start)&&(u.start=t)}const h=c.default,f=re(o,0)|(null==h?void 0:h.flags);let p=(null==h?void 0:h.duration)||0;8&f&&(p=re(o,2&f?12:8));const g=ae(a,["trun"]);let m=u.start||0,_=0,T=p;for(let e=0;e<g.length;e++){const t=g[e],n=re(t,4),r=u.sampleCount;u.sampleCount+=n;const s=1&t[3],i=4&t[3],a=1&t[2],o=2&t[2],l=4&t[2],c=8&t[2];let d=8,h=n;for(s&&(d+=4),i&&n&&(1&t[d+1]||void 0!==u.keyFrameIndex||(u.keyFrameIndex=r),d+=4,a?(T=re(t,d),d+=4):T=p,o&&(
vendor: 4,366 bytes, line 1
1d+=4),c&&(d+=4),m+=T,_+=T,h--);h--;)a?(T=re(t,d),d+=4):T=p,o&&(d+=4),l&&(1&t[d+1]||void 0===u.keyFrameIndex&&(u.keyFrameIndex=u.sampleCount-(h+1),u.keyFrameStart=m),d+=4),c&&(d+=4),m+=T,_+=T;!_&&p&&(_+=p*n)}u.duration+=_}if(!Object.keys(s).some((e=>s[e].duration))){let t=1/0,n=0;const i=ae(e,["sidx"]);for(let e=0;e<i.length;e++){const r=oe(i[e]);if(null!=r&&r.references){t=Math.min(t,r.earliestPresentationTime/r.timescale);const e=r.references.reduce(((e,t)=>e+t.info.duration||0),0);n=Math.max(n,e+r.earliestPresentationTime/r.timescale)}}n&&r(n)&&Object.keys(s).forEach((e=>{s[e].duration||(s[e].duration=n*s[e].timescale-s[e].start)}))}return s}(h,p,this),m=p.audio?g[p.audio.id]:null,_=p.video?g[p.video.id]:null,T=ni(_,1/0),E=ni(m,1/0),y=ni(_,0,!0),S=ni(m,0,!0);let v=i,b=0;const I=m&&(!_||!c&&E<T||c&&c.trackId===p.audio.id),A=I?m:_;if(A){const e=A.timescale,t=A.start-i*e,n=I?p.audio.id:p.video.id;v=A.start/e,b=I?S-E:y-T,!a&&c||!function(e,t,n,r){if(null===e)return!0;const s=Math.max(r,1),i=t-e.baseTime/e.timescale;return Math.abs(i-n)>s}(c,v,i,b)&&e===c.timescale||(c&&this.warn(`Timestamps at playlist time: ${a?"":"~"}${i} ${t/e} != initPTS: ${c.baseTime/c.timescale} (${c.baseTime}/${c.timescale}) trackId: ${c.trackId}`),this.log(`Found initPTS at playlist time: ${i} offset: ${v-i} (${t}/${e}) trackId: ${n}`),c=null,f.initPTS=t,f.timescale=e,f.trackId=n)}else this.warn(`No audio or video samples found for initPTS at playlist time: ${i}`);c?(f.initPTS=c.baseTime,f.timescale=c.timescale,f.trackId=c.trackId):(f.timescale&&void 0!==f.trackId&&void 0!==f.initPTS||(this.warn("Could not set initPTS"),f.initPTS=v,f.timescale=1,f.trackId=-1),this.initPTS=c={baseTime:f.initPTS,timescale:f.timescale,trackId:f.trackId});const R=v-c.baseTime/c.timescale,C=R+b;b>0?this.lastEndTime=C:(this.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());const k=!!p.audio,L=!!p.video;let O="";k&&(O+="audio"),L&&(O+="video");const N={data1:h,startPTS:R,startDTS:R,endPTS:C,endDTS:C,type:O,hasAudio:k,hasVideo:L,nb:1,dropped:0,encrypted:!!p.audio&&p.audio.encrypted||!!p.video&&p.video.encrypted};d.audio=k&&!L?N:void 0,d.video=L?N:void 0;const w=null==_?void 0:_.sampleCount;if(w){const e=_.keyFrameIndex,t=-1!==e;N.nb=w,N.dropped=0===e||this.isVideoContiguous?0:t?e:w,N.independent=t,N.firstKeyFrame=e,t&&_.keyFrameStart&&(N.firstKeyFramePTS=(_.keyFrameStart-c.baseTime)/c.timescale),this.isVideoContiguous||(d.independent=t),this.isVideoContiguous||(this.isVideoContiguous=t),N.dropped&&this.warn(`fmp4 does not start with IDR: firstIDR ${e}/${w} dropped: ${N.dropped} start: ${N.firstKeyFramePTS||"NA"}`)}return d.initSegment=f,d.id3=ei(n,i,c,c),s.samples.length&&(d.text=ti(s,i,c)),d}}},{demux:Ds,remux:Qs},{demux:class extends hs{constructor(e,t){super(),this.observer=void 0,this.config=void 0,this.observer=e,this.config=t}resetInitSegment(e,t,n,r){super.resetInitSegment(e,t,n,r),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"aac",samples:[],manifestCodec:t,duration:r,inputTimeScale:9e4,dropped:0}}static probe(e,t){if(!e)return!1;const n=Vr(e,0);let r=(null==n?void 0:n.length)||0;if(bs(e,r))return!1;for(let n=e.length;r<n;r++)if(Xr(e,r))return t.log("ADTS sync word found !"),!0;return!1}canParse(e,t){return function(e,t){return function(e,t){return t+5<e.length}(e,t)&&qr(e,t)&&zr(e,t)<=e.length-t}(e,t)}appendFrame(e,t,n){Qr(e,this.observer,t,n,e.manifestCodec);const r=es(e,t,n,this.basePTS,this.frameIndex);if(r&&0===r.missing)return r}},remux:Qs},{demux:class extends hs{resetInitSegment(e,t,n,r){super.resetInitSegment(e,t,n,r),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"mp3",samples:[],manifestCodec:t,duration:r,inputTimeScale:9e4,dropped:0}}static probe(e){if(!e)return!1;const t=Vr(e,0);let n=(null==t?void 0:t.length)||0;if(t&&11===e[n]&&119===e[n+1]&&void 0!==cs(t)&&Is(e,n)<=16)return!1;for(let t=e.length;n<t;n++)if(bs(e,n))return k.log("MPEG Audio sync word found !"),!0;return!1}canParse(e,t){return function(e,t){return Ss(e,t)&&4<=e.length-t}(e,t)}appendFrame(e,t,n){if(null!==this.basePTS)return Es(e,t,n,this.basePTS,this.frameIndex)}},remux:Qs}];si.splice(2,0,{demux:As,remux:Qs});class ii{constructor(e,t,n,r,s,i){this.asyncResult=!1,this.logger=void 0,this.observer=void 0,this.typeSupp
vendor: 4,473 bytes, line 1
1orted=void 0,this.config=void 0,this.id=void 0,this.demuxer=void 0,this.remuxer=void 0,this.decrypter=void 0,this.probe=void 0,this.decryptionPromise=null,this.transmuxConfig=void 0,this.currentTransmuxState=void 0,this.observer=e,this.typeSupported=t,this.config=n,this.id=s,this.logger=i}configure(e){this.transmuxConfig=e,this.decrypter&&this.decrypter.reset()}push(e,t,n,r){const s=n.transmuxing;s.executeStart=Ys();let i=new Uint8Array(e);const{currentTransmuxState:c,transmuxConfig:u}=this;r&&(this.currentTransmuxState=r);const{contiguous:d,discontinuity:h,trackSwitch:f,accurateTimeOffset:p,timeOffset:g,initSegmentChange:m}=r||c,{audioCodec:_,videoCodec:T,defaultInitPts:E,duration:y,initSegmentData:S}=u,v=function(e,t){let n=null;e.byteLength>0&&null!=(null==t?void 0:t.key)&&null!==t.iv&&null!=t.method&&(n=t);return n}(i,t);if(v&&_n(v.method)){const e=this.getDecrypter(),t=Tn(v.method);if(!e.isSync())return this.asyncResult=!0,this.decryptionPromise=e.webCryptoDecrypt(i,v.key.buffer,v.iv.buffer,t).then((e=>{const t=this.push(e,null,n);return this.decryptionPromise=null,t})),this.decryptionPromise;{let r=e.softwareDecrypt(i,v.key.buffer,v.iv.buffer,t);if(n.part>-1){const t=e.flush();r=t?t.buffer:t}if(!r)return s.executeEnd=Ys(),ai(n);i=new Uint8Array(r)}}const b=this.needsProbing(h,f);if(b){const e=this.configureTransmuxer(i);if(e)return this.logger.warn(`[transmuxer] ${e.message}`),this.observer.emit(l.ERROR,l.ERROR,{type:a.MEDIA_ERROR,details:o.FRAG_PARSING_ERROR,fatal:!1,error:e,reason:e.message}),s.executeEnd=Ys(),ai(n)}(h||f||m||b)&&this.resetInitSegment(S,_,T,y,t),(h||m||b)&&this.resetInitialTimestamp(E),d||this.resetContiguity();const I=this.transmux(i,v,g,p,n);this.asyncResult=oi(I);const A=this.currentTransmuxState;return A.contiguous=!0,A.discontinuity=!1,A.trackSwitch=!1,s.executeEnd=Ys(),I}flush(e){const t=e.transmuxing;t.executeStart=Ys();const{decrypter:n,currentTransmuxState:r,decryptionPromise:s}=this;if(s)return this.asyncResult=!0,s.then((()=>this.flush(e)));const i=[],{timeOffset:a}=r;if(n){const t=n.flush();t&&i.push(this.push(t.buffer,null,e))}const{demuxer:o,remuxer:l}=this;if(!o||!l){t.executeEnd=Ys();const n=[ai(e)];return this.asyncResult?Promise.resolve(n):n}const c=o.flush(a);return oi(c)?(this.asyncResult=!0,c.then((t=>(this.flushRemux(i,t,e),i)))):(this.flushRemux(i,c,e),this.asyncResult?Promise.resolve(i):i)}flushRemux(e,t,n){const{audioTrack:r,videoTrack:s,id3Track:i,textTrack:a}=t,{accurateTimeOffset:o,timeOffset:l}=this.currentTransmuxState;this.logger.log(`[transmuxer.ts]: Flushed ${this.id} sn: ${n.sn}${n.part>-1?" part: "+n.part:""} of ${this.id===f?"level":"track"} ${n.level}`);const c=this.remuxer.remux(r,s,i,a,l,o,!0,this.id);e.push({remuxResult:c,chunkMeta:n}),n.transmuxing.executeEnd=Ys()}resetInitialTimestamp(e){const{demuxer:t,remuxer:n}=this;t&&n&&(t.resetTimeStamp(e),n.resetTimeStamp(e))}resetContiguity(){const{demuxer:e,remuxer:t}=this;e&&t&&(e.resetContiguity(),t.resetNextTimestamp())}resetInitSegment(e,t,n,r,s){const{demuxer:i,remuxer:a}=this;i&&a&&(i.resetInitSegment(e,t,n,r),a.resetInitSegment(e,t,n,s))}destroy(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)}transmux(e,t,n,r,s){let i;return i=t&&"SAMPLE-AES"===t.method?this.transmuxSampleAes(e,t,n,r,s):this.transmuxUnencrypted(e,n,r,s),i}transmuxUnencrypted(e,t,n,r){const{audioTrack:s,videoTrack:i,id3Track:a,textTrack:o}=this.demuxer.demux(e,t,!1,!this.config.progressive);return{remuxResult:this.remuxer.remux(s,i,a,o,t,n,!1,this.id),chunkMeta:r}}transmuxSampleAes(e,t,n,r,s){return this.demuxer.demuxSampleAes(e,t,n).then((e=>({remuxResult:this.remuxer.remux(e.audioTrack,e.videoTrack,e.id3Track,e.textTrack,n,r,!1,this.id),chunkMeta:s})))}configureTransmuxer(e){const{config:t,observer:n,typeSupported:r}=this;let s;for(let t=0,n=si.length;t<n;t++){var i;if(null!=(i=si[t].demux)&&i.probe(e,this.logger)){s=si[t];break}}if(!s)return new Error("Failed to find demuxer by probing fragment data");const a=this.demuxer,o=this.remuxer,l=s.remux,c=s.demux;o&&o instanceof l||(this.remuxer=new l(n,t,r,this.logger)),a&&a instanceof c||(this.demuxer=new c(n,t,r,this.logger),this.probe=c.probe)}needsProbing(e,t){return!this.demuxer||!this.remuxer||e||t}getDecrypter(){let e=this.decrypter;return e||(e=this.decrypter=new qt(this.config)),e}}const ai=e=>({remuxResult:{},chunkMeta:e});function oi(e){return"then"in e&&e.then instanceof Function}
vendor: 3,659 bytes, line 1
1class li{constructor(e,t,n,r,s){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=e,this.videoCodec=t,this.initSegmentData=n,this.duration=r,this.defaultInitPts=s||null}}class ci{constructor(e,t,n,r,s,i){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.initSegmentChange=void 0,this.discontinuity=e,this.contiguous=t,this.accurateTimeOffset=n,this.trackSwitch=r,this.timeOffset=s,this.initSegmentChange=i}}let ui=0;class di{constructor(e,t,n,r){this.error=null,this.hls=void 0,this.id=void 0,this.instanceNo=ui++,this.observer=void 0,this.frag=null,this.part=null,this.useWorker=void 0,this.workerContext=null,this.transmuxer=null,this.onTransmuxComplete=void 0,this.onFlush=void 0,this.onWorkerMessage=e=>{const t=e.data,n=this.hls;if(n&&null!=t&&t.event&&t.instanceNo===this.instanceNo)switch(t.event){case"init":{var r;const e=null==(r=this.workerContext)?void 0:r.objectURL;e&&self.URL.revokeObjectURL(e);break}case"transmuxComplete":this.handleTransmuxComplete(t.data);break;case"flush":this.onFlush(t.data);break;case"workerLog":n.logger[t.data.logType]&&n.logger[t.data.logType](t.data.message);break;default:t.data=t.data||{},t.data.frag=this.frag,t.data.part=this.part,t.data.id=this.id,n.trigger(t.event,t.data)}},this.onWorkerError=e=>{if(!this.hls)return;const t=new Error(`${e.message}  (${e.filename}:${e.lineno})`);this.hls.config.enableWorker=!1,this.hls.logger.warn(`Error in "${this.id}" Web Worker, fallback to inline`),this.hls.trigger(l.ERROR,{type:a.OTHER_ERROR,details:o.INTERNAL_EXCEPTION,fatal:!1,event:"demuxerWorker",error:t})};const s=e.config;this.hls=e,this.id=t,this.useWorker=!!s.enableWorker,this.onTransmuxComplete=n,this.onFlush=r;const i=(e,t)=>{(t=t||{}).frag=this.frag||void 0,e===l.ERROR&&(t.parent=this.id,t.part=this.part,this.error=t.error),this.hls.trigger(e,t)};this.observer=new $r,this.observer.on(l.FRAG_DECRYPTED,i),this.observer.on(l.ERROR,i);const c=Be(s.preferManagedMediaSource);if(this.useWorker&&"undefined"!=typeof Worker){const n=this.hls.logger;if(s.workerPath||"function"==typeof __HLS_WORKER_BUNDLE__){try{s.workerPath?(n.log(`loading Web Worker ${s.workerPath} for "${t}"`),this.workerContext=function(e){const t=Hr[e];if(t)return t.clientCount++,t;const n=new self.URL(e,self.location.href).href,r={worker:new self.Worker(n),scriptURL:n,clientCount:1};return Hr[e]=r,r}(s.workerPath)):(n.log(`injecting Web Worker for "${t}"`),this.workerContext=function(){const e=Hr[Gr];if(e)return e.clientCount++,e;const t=new self.Blob([`var exports={};var module={exports:exports};function define(f){f()};define.amd=true;(${__HLS_WORKER_BUNDLE__.toString()})(true);`],{type:"text/javascript"}),n=self.URL.createObjectURL(t),r={worker:new self.Worker(n),objectURL:n,clientCount:1};return Hr[Gr]=r,r}());const{worker:e}=this.workerContext;e.addEventListener("message",this.onWorkerMessage),e.addEventListener("error",this.onWorkerError),e.postMessage({instanceNo:this.instanceNo,cmd:"init",typeSupported:c,id:t,config:rt(s)})}catch(r){n.warn(`Error setting up "${t}" Web Worker, fallback to inline`,r),this.terminateWorker(),this.error=null,this.transmuxer=new ii(this.observer,c,s,"",t,e.logger)}return}}this.transmuxer=new ii(this.observer,c,s,"",t,e.logger)}reset(){if(this.frag=null,this.part=null,this.workerContext){const e=this.instanceNo;this.instanceNo=ui++;const t=this.hls.config,n=Be(t.preferManagedMediaSource);this.workerContext.worker.postMessage({instanceNo:this.instanceNo,cmd:"reset",resetNo:e,typeSupported:n,id:this.id,c
vendor: 8,952 bytes, line 1
1onfig:rt(t)})}}terminateWorker(){if(this.workerContext){const{worker:e}=this.workerContext;this.workerContext=null,e.removeEventListener("message",this.onWorkerMessage),e.removeEventListener("error",this.onWorkerError),function(e){const t=Hr[e||Gr];if(t&&1==t.clientCount--){const{worker:n,objectURL:r}=t;delete Hr[e||Gr],r&&self.URL.revokeObjectURL(r),n.terminate()}}(this.hls.config.workerPath)}}destroy(){if(this.workerContext)this.terminateWorker(),this.onWorkerMessage=this.onWorkerError=null;else{const e=this.transmuxer;e&&(e.destroy(),this.transmuxer=null)}const e=this.observer;e&&e.removeAllListeners(),this.frag=null,this.part=null,this.observer=null,this.hls=null}push(e,t,n,r,s,i,a,o,l,c){var u,d;l.transmuxing.start=self.performance.now();const{instanceNo:h,transmuxer:p}=this,g=i?i.start:s.start,m=s.decryptdata,_=this.frag,T=!(_&&s.cc===_.cc),E=!(_&&l.level===_.level),y=_?l.sn-_.sn:-1,S=this.part?l.part-this.part.index:-1,v=0===y&&l.id>1&&l.id===(null==_?void 0:_.stats.chunkCount),b=!E&&(1===y||0===y&&(1===S||v&&S<=0)),I=self.performance.now();(E||y||0===s.stats.parsing.start)&&(s.stats.parsing.start=I),!i||!S&&b||(i.stats.parsing.start=I);const A=!(_&&(null==(u=s.initSegment)?void 0:u.url)===(null==(d=_.initSegment)?void 0:d.url)),R=new ci(T,b,o,E,g,A);if(!b||T||A){this.hls.logger.log(`[transmuxer-interface]: Starting new transmux session for ${s.type} sn: ${l.sn}${l.part>-1?" part: "+l.part:""} ${this.id===f?"level":"track"}: ${l.level} id: ${l.id}\n        discontinuity: ${T}\n        trackSwitch: ${E}\n        contiguous: ${b}\n        accurateTimeOffset: ${o}\n        timeOffset: ${g}\n        initSegmentChange: ${A}`);const e=new li(n,r,t,a,c);this.configureTransmuxer(e)}if(this.frag=s,this.part=i,this.workerContext)this.workerContext.worker.postMessage({instanceNo:h,cmd:"demux",data:e,decryptdata:m,chunkMeta:l,state:R},e instanceof ArrayBuffer?[e]:[]);else if(p){const t=p.push(e,m,l,R);oi(t)?t.then((e=>{this.handleTransmuxComplete(e)})).catch((e=>{this.transmuxerError(e,l,"transmuxer-interface push error")})):this.handleTransmuxComplete(t)}}flush(e){e.transmuxing.start=self.performance.now();const{instanceNo:t,transmuxer:n}=this;if(this.workerContext)this.workerContext.worker.postMessage({instanceNo:t,cmd:"flush",chunkMeta:e});else if(n){const t=n.flush(e);oi(t)?t.then((t=>{this.handleFlushResult(t,e)})).catch((t=>{this.transmuxerError(t,e,"transmuxer-interface flush error")})):this.handleFlushResult(t,e)}}transmuxerError(e,t,n){this.hls&&(this.error=e,this.hls.trigger(l.ERROR,{type:a.MEDIA_ERROR,details:o.FRAG_PARSING_ERROR,chunkMeta:t,frag:this.frag||void 0,part:this.part||void 0,fatal:!1,error:e,err:e,reason:n}))}handleFlushResult(e,t){e.forEach((e=>{this.handleTransmuxComplete(e)})),this.onFlush(t)}configureTransmuxer(e){const{instanceNo:t,transmuxer:n}=this;this.workerContext?this.workerContext.worker.postMessage({instanceNo:t,cmd:"configure",config:e}):n&&n.configure(e)}handleTransmuxComplete(e){e.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(e)}}class hi extends v{constructor(e,t){super(t,e.logger),this.hls=void 0,this.canLoad=!1,this.timer=-1,this.hls=e}destroy(){this.clearTimer(),this.hls=this.log=this.warn=null}clearTimer(){-1!==this.timer&&(self.clearTimeout(this.timer),this.timer=-1)}startLoad(){this.canLoad=!0,this.loadPlaylist()}stopLoad(){this.canLoad=!1,this.clearTimer()}switchParams(e,t,n){const r=null==t?void 0:t.renditionReports;if(r){let s=-1;for(let n=0;n<r.length;n++){const i=r[n];let a;try{a=new self.URL(i.URI,t.url).href}catch(e){this.warn(`Could not construct new URL for Rendition Report: ${e}`),a=i.URI||""}if(a===e){s=n;break}a===e.substring(0,a.length)&&(s=n)}if(-1!==s){const e=r[s],i=parseInt(e["LAST-MSN"])||t.lastPartSn;let a=parseInt(e["LAST-PART"])||t.lastPartIndex;if(this.hls.config.lowLatencyMode){const e=Math.min(t.age-t.partTarget,t.targetduration);a>=0&&e>t.partTarget&&(a+=1)}const o=n&&Qe(n);return new Ze(i,a>=0?a:void 0,o)}}}loadPlaylist(e){this.clearTimer()}loadingPlaylist(e,t){this.clearTimer()}shouldLoadPlaylist(e){return this.canLoad&&!!e&&!!e.url&&(!e.details||e.details.live)}getUrlWithDirectives(e,t){if(t)try{return t.addDirectives(e)}catch(e){this.warn(`Could not construct new URL with HLS Delivery Directives: ${e}`)}return e}playlistLoaded(e,t,n){const{details:r,stats:s}=t,i=self.performance.now(),c=s.loading.first?Math.max(0,i-s.loading.first):0;r.advancedDateTime=Date.now()-c;const u=this.hls.config.timelineOffset;if(u!==r.appliedTimelineOffset){const e=Math.max(u||0,0);r.appliedTimelineOffset=e,r.fragments.forEach((t=>{t.setStart(t.playlistOffset+e)}))}if(r.live||null!=n&&n.live){const u="levelInfo"in t?t.levelInfo:t.track;if(r.reloaded(n),n&&r.fragments.length>0){rr(n,r,this);const e=r.playlistParsingError;if(e){this.warn(e);const n=this.hls;if(!n.config.ignorePlaylistParsingErrors){var d;const{networkDetails:i}=t;return void n.trigger(l.ERROR,{type:a.NETWORK_ERROR,details:o.LEVEL_PARSING_ERROR,fatal:!1,url:r.url,error:e,reason:e.message,level:t.level||void 0,parent:null==(d=r.fragments[0])?void 0:d.type,networkDetails:i,stats:s})}r.playlistParsingError=null}}-1===r.requestScheduled&&(r.requestScheduled=s.loading.start);const h=this.hls.mainForwardBufferInfo,f=h?h.end-h.len:0,p=or(r,1e3*(r.edge-f));if(r.requestScheduled+p<i?r.requestScheduled=i:r.requestScheduled+=p,this.log(`live playlist ${e} ${r.advanced?"REFRESHED "+r.lastPartSn+"-"+r.lastPartIndex:r.updated?"UPDATED":"MISSED"}`),!this.canLoad||!r.live)return;let g,m,_;if(r.canBlockReload&&r.endSN&&r.advanced){const e=this.hls.config.lowLatencyMode,s=r.lastPartSn,a=r.endSN,o=r.lastPartIndex,l=s===a;-1!==o?l?(m=a+1,_=e?0:o):(m=s,_=e?o+1:r.maxPartIndex):m=a+1;const c=r.age,d=c+r.ageHeader;let h=Math.min(d-r.partTarget,1.5*r.targetduration);if(h>0){if(d>3*r.targetduration)this.log(`Playlist last advanced ${c.toFixed(2)}s ago. Omitting segment and part directives.`),m=void 0,_=void 0;else if(null!=n&&n.tuneInGoal&&d-r.partTarget>n.tuneInGoal)this.warn(`CDN Tune-in goal increased from: ${n.tuneInGoal} to: ${h} with playlist age: ${r.age}`),h=0;else{const e=Math.floor(h/r.targetduration);if(m+=e,void 0!==_){_+=Math.round(h%r.targetduration/r.partTarget)}this.log(`CDN Tune-in age: ${r.ageHeader}s last advanced ${c.toFixed(2)}s goal: ${h} skip sn ${e} to part ${_}`)}r.tuneInGoal=h}if(g=this.getDeliveryDirectives(r,t.deliveryDirectives,m,_),e||!l)return r.requestScheduled=i,void this.loadingPlaylist(u,g)}else(r.canBlockReload||r.canSkipUntil)&&(g=this.getDeliveryDirectives(r,t.deliveryDirectives,m,_));g&&void 0!==m&&r.canBlockReload&&(r.requestScheduled=s.loading.first+Math.max(p-2*c,p/2)),this.scheduleLoading(u,g,r)}else this.clearTimer()}scheduleLoading(e,t,n){const r=n||e.details;if(!r)return void this.loadingPlaylist(e,t);const s=self.performance.now(),i=r.requestScheduled;if(s>=i)return void this.loadingPlaylist(e,t);const a=i-s;this.log(`reload live playlist ${e.name||e.bitrate+"bps"} in ${Math.round(a)} ms`),this.clearTimer(),this.timer=self.setTimeout((()=>this.loadingPlaylist(e,t)),a)}getDeliveryDirectives(e,t,n,r){let s=Qe(e);return null!=t&&t.skip&&e.deltaUpdateFailed&&(n=t.msn,r=t.part,s=ze),new Ze(n,r,s)}checkRetry(e){const t=e.details,n=_t(e),r=e.errorAction,{action:s,retryCount:i=0,retryConfig:a}=r||{},o=!!r&&!!a&&(s===kt||!r.resolved&&s===Rt);if(o){var l;if(i>=a.maxNumRetry)return!1;if(n&&null!=(l=e.context)&&l.deliveryDirectives)this.warn(`Retrying playlist loading ${i+1}/${a.maxNumRetry} after "${t}" without delivery-directives`),this.loadPlaylist();else{const e=St(a,i);this.clearTimer(),this.timer=self.setTimeout((()=>this.loadPlaylist()),e),this.warn(`Retrying playlist loading ${i+1}/${a.maxNumRetry} after "${t}" in ${e}ms`)}e.levelRetry=!0,r.resolved=!0}return o}}function fi(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!pi(e[n].attrs,t[n].attrs))return!1;return!0}function pi(e,t,n){const r=e["STABLE-RENDITION-ID"];return r&&!n?r===t["STABLE-RENDITION-ID"]:!(n||["LANGUAGE","NAME","CHARACTERISTICS","AUTOSELECT","DEFAULT","FORCED","ASSOC-LANGUAGE"]).some((n=>e[n]!==t[n]))}function gi(e,t){return t.label.toLowerCase()===e.name.toLowerCase()&&(!t.language||t.language.toLowerCase()===(e.lang||"").toLowerCase())}class mi{constructor(e){this.tracks=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.tracks=e}destroy(){this.tracks=this.queues=null}append(e,t,n){if(null===this.queues||null===this.tracks)return;const r=this.queues[t];r.push(e),1!==r.length||n||this.executeNext(t)}appendBlocker(e){return new Promise((t=>{const n={label:"async-blocker",execute:t,onStart:()=>{},onComplete:()=>{},onError:()=>{}};this.append(n,e)}))}prependBlocker(e){return new Promise((t=>{if(this.queues){const n={label:"async-blocker-prepend",execute:t,onStart:()=>{},onComplete:()=>{},onError:()=>{}};this.queues[e].unshift(n)}}))}removeBlockers(){null!==this.queues&&[this.queues.video,this.queues.audio,this.queues.audiovideo].forEac
vendor: 2,632 bytes, line 1
1h((e=>{var t;const n=null==(t=e[0])?void 0:t.label;"async-blocker"!==n&&"async-blocker-prepend"!==n||(e[0].execute(),e.splice(0,1))}))}unblockAudio(e){if(null===this.queues)return;this.queues.audio[0]===e&&this.shiftAndExecuteNext("audio")}executeNext(e){if(null===this.queues||null===this.tracks)return;const t=this.queues[e];if(t.length){const r=t[0];try{r.execute()}catch(t){var n;if(r.onError(t),null===this.queues||null===this.tracks)return;const s=null==(n=this.tracks[e])?void 0:n.buffer;null!=s&&s.updating||this.shiftAndExecuteNext(e)}}}shiftAndExecuteNext(e){null!==this.queues&&(this.queues[e].shift(),this.executeNext(e))}current(e){var t;return(null==(t=this.queues)?void 0:t[e][0])||null}toString(){const{queues:e,tracks:t}=this;return null===e||null===t?"<destroyed>":`\n${this.list("video")}\n${this.list("audio")}\n${this.list("audiovideo")}}`}list(e){var t,n;return null!=(t=this.queues)&&t[e]||null!=(n=this.tracks)&&n[e]?`${e}: (${this.listSbInfo(e)}) ${this.listOps(e)}`:""}listSbInfo(e){var t;const n=null==(t=this.tracks)?void 0:t[e],r=null==n?void 0:n.buffer;return r?`SourceBuffer${r.updating?" updating":""}${n.ended?" ended":""}${n.ending?" ending":""}`:"none"}listOps(e){var t;return(null==(t=this.queues)?void 0:t[e].map((e=>e.label)).join(", "))||""}}const _i=/(avc[1234]|hvc1|hev1|dvh[1e]|vp09|av01)(?:\.[^.,]+)+/,Ti="HlsJsTrackRemovedError";class Ei extends Error{constructor(e){super(e),this.name=Ti}}function yi(e){const t=e.querySelectorAll("source");[].slice.call(t).forEach((t=>{e.removeChild(t)}))}function Si(e){return"audio"===e?1:0}class vi{constructor(e){this.hls=void 0,this.autoLevelCapping=void 0,this.firstLevel=void 0,this.media=void 0,this.restrictedLevels=void 0,this.timer=void 0,this.clientRect=void 0,this.streamController=void 0,this.hls=e,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}setStreamController(e){this.streamController=e}destroy(){this.hls&&this.unregisterListener(),this.timer&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null}registerListeners(){const{hls:e}=this;e.on(l.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),e.on(l.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(l.MANIFEST_PARSED,this.onManifestParsed,this),e.on(l.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(l.BUFFER_CODECS,this.onBufferCodecs,this),e.on(l.MEDIA_DETACHING,this.onMediaDetaching,this)}unregisterListener(){const{hls:e}=this;e.off(l.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),e.off(l.MEDIA_ATTA
vendor: 3,151 bytes, line 1
1CHING,this.onMediaAttaching,this),e.off(l.MANIFEST_PARSED,this.onManifestParsed,this),e.off(l.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(l.BUFFER_CODECS,this.onBufferCodecs,this),e.off(l.MEDIA_DETACHING,this.onMediaDetaching,this)}onFpsDropLevelCapping(e,t){const n=this.hls.levels[t.droppedLevel];this.isLevelAllowed(n)&&this.restrictedLevels.push({bitrate:n.bitrate,height:n.height,width:n.width})}onMediaAttaching(e,t){this.media=t.media instanceof HTMLVideoElement?t.media:null,this.clientRect=null,this.timer&&this.hls.levels.length&&this.detectPlayerSize()}onManifestParsed(e,t){const n=this.hls;this.restrictedLevels=[],this.firstLevel=t.firstLevel,n.config.capLevelToPlayerSize&&t.video&&this.startCapping()}onLevelsUpdated(e,t){this.timer&&r(this.autoLevelCapping)&&this.detectPlayerSize()}onBufferCodecs(e,t){this.hls.config.capLevelToPlayerSize&&t.video&&this.startCapping()}onMediaDetaching(){this.stopCapping(),this.media=null}detectPlayerSize(){if(this.media){if(this.mediaHeight<=0||this.mediaWidth<=0)return void(this.clientRect=null);const e=this.hls.levels;if(e.length){const t=this.hls,n=this.getMaxLevel(e.length-1);n!==this.autoLevelCapping&&t.logger.log(`Setting autoLevelCapping to ${n}: ${e[n].height}p@${e[n].bitrate} for media ${this.mediaWidth}x${this.mediaHeight}`),t.autoLevelCapping=n,t.autoLevelEnabled&&t.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=t.autoLevelCapping}}}getMaxLevel(e){const t=this.hls.levels;if(!t.length)return-1;const n=t.filter(((t,n)=>this.isLevelAllowed(t)&&n<=e));return this.clientRect=null,vi.getMaxLevelByMediaSize(n,this.mediaWidth,this.mediaHeight)}startCapping(){this.timer||(this.autoLevelCapping=Number.POSITIVE_INFINITY,self.clearInterval(this.timer),this.timer=self.setInterval(this.detectPlayerSize.bind(this),1e3),this.detectPlayerSize())}stopCapping(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)}getDimensions(){if(this.clientRect)return this.clientRect;const e=this.media,t={width:0,height:0};if(e){const n=e.getBoundingClientRect();t.width=n.width,t.height=n.height,t.width||t.height||(t.width=n.right-n.left||e.width||0,t.height=n.bottom-n.top||e.height||0)}return this.clientRect=t,t}get mediaWidth(){return this.getDimensions().width*this.contentScaleFactor}get mediaHeight(){return this.getDimensions().height*this.contentScaleFactor}get contentScaleFactor(){let e=1;if(!this.hls.config.ignoreDevicePixelRatio)try{e=self.devicePixelRatio}catch(e){}return Math.min(e,this.hls.config.maxDevicePixelRatio)}isLevelAllowed(e){return!this.restrictedLevels.some((t=>e.bitrate===t.bitrate&&e.width===t.width&&e.height===t.height))}static getMaxLevelByMediaSize(e,t,n){if(null==e||!e.length)return-1;let r=e.length-1;const s=Math.max(t,n);for(let t=0;t<e.length;t+=1){const n=e[t];if((n.width>=s||n.height>=s)&&(i=n,!(a=e[t+1])||i.width!==a.width||i.height!==a.height)){r=t;break}}var i,a;return r}}const bi={MANIFEST:"m",AUDIO:"a",VIDEO:"v",MUXED:"av",INIT:"i",CAPTION:"c",TIMED_TEXT:"tt",
vendor: 4,189 bytes, line 1
1KEY:"k",OTHER:"o"},Ii={HLS:"h"};class Ai{constructor(e,t){Array.isArray(e)&&(e=e.map((e=>e instanceof Ai?e:new Ai(e)))),this.value=e,this.params=t}}function Ri(e,t,n,r){return new Error(`failed to ${e} "${s=t,Array.isArray(s)?JSON.stringify(s):s instanceof Map?"Map{}":s instanceof Set?"Set{}":"object"==typeof s?JSON.stringify(s):String(s)}" as ${n}`,{cause:r});var s}function Ci(e,t,n){return Ri("serialize",e,t,n)}class ki{constructor(e){this.description=e}}const Li="Bare Item";function Oi(e){if(!1===ArrayBuffer.isView(e))throw Ci(e,"Byte Sequence");return`:${t=e,btoa(String.fromCharCode(...t))}:`;var t}function Ni(e){if(function(e){return e<-999999999999999||999999999999999<e}(e))throw Ci(e,"Integer");return e.toString()}function wi(e,t){if(e<0)return-wi(-e,t);const n=Math.pow(10,t);if(Math.abs(e*n%1-.5)<Number.EPSILON){const t=Math.floor(e*n);return(t%2==0?t:t+1)/n}return Math.round(e*n)/n}function Pi(e){const t=wi(e,3);if(Math.floor(Math.abs(t)).toString().length>12)throw Ci(e,"Decimal");const n=t.toString();return n.includes(".")?n:`${n}.0`}const Mi=/[\x00-\x1f\x7f]+/;function Di(e){const t=(n=e).description||n.toString().slice(7,-1);var n;if(!1===/^([a-zA-Z*])([!#$%&'*+\-.^_`|~\w:/]*)$/.test(t))throw Ci(t,"Token");return t}function xi(e){switch(typeof e){case"number":if(!r(e))throw Ci(e,Li);return Number.isInteger(e)?Ni(e):Pi(e);case"string":return function(e){if(Mi.test(e))throw Ci(e,"String");return`"${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}(e);case"symbol":return Di(e);case"boolean":return function(e){if("boolean"!=typeof e)throw Ci(e,"Boolean");return e?"?1":"?0"}(e);case"object":if(e instanceof Date)return function(e){return`@${Ni(e.getTime()/1e3)}`}(e);if(e instanceof Uint8Array)return Oi(e);if(e instanceof ki)return Di(e);default:throw Ci(e,Li)}}function Ui(e){if(!1===/^[a-z*][a-z0-9\-_.*]*$/.test(e))throw Ci(e,"Key");return e}function Bi(e){return null==e?"":Object.entries(e).map((([e,t])=>!0===t?`;${Ui(e)}`:`;${Ui(e)}=${xi(t)}`)).join("")}function Fi(e){return e instanceof Ai?`${xi(e.value)}${Bi(e.params)}`:xi(e)}function $i(e,t={whitespace:!0}){if("object"!=typeof e||null==e)throw Ci(e,"Dict");const n=e instanceof Map?e.entries():Object.entries(e),r=(null==t?void 0:t.whitespace)?" ":"";return Array.from(n).map((([e,t])=>{t instanceof Ai==!1&&(t=new Ai(t));let n=Ui(e);var r;return!0===t.value?n+=Bi(t.params):(n+="=",Array.isArray(t.value)?n+=`(${(r=t).value.map(Fi).join(" ")})${Bi(r.params)}`:n+=Fi(t)),n})).join(`,${r}`)}function Gi(e,t){return $i(e,t)}const Hi="CMCD-Object",ji="CMCD-Request",Wi="CMCD-Session",Ki="CMCD-Status",Vi={br:Hi,ab:Hi,d:Hi,ot:Hi,tb:Hi,tpb:Hi,lb:Hi,tab:Hi,lab:Hi,url:Hi,pb:ji,bl:ji,tbl:ji,dl:ji,ltc:ji,mtp:ji,nor:ji,nrr:ji,rc:ji,sn:ji,sta:ji,su:ji,ttfb:ji,ttfbb:ji,ttlb:ji,cmsdd:ji,cmsds:ji,smrt:ji,df:ji,cs:ji,ts:ji,cid:Wi,pr:Wi,sf:Wi,sid:Wi,st:Wi,v:Wi,msd:Wi,bs:Ki,bsd:Ki,cdn:Ki,rtp:Ki,bg:Ki,pt:Ki,ec:Ki,e:Ki},qi=ji;function Yi(e,t){const n={};if(!e)return n;const r=Object.keys(e),s=t?(i=t,Object.keys(i).reduce(((e,t)=>{var n;return null===(n=i[t])||void 0===n||n.forEach((n=>e[n]=t)),e}),{})):{};var i;return r.reduce(((t,n)=>{var r;const i=Vi[n]||s[n]||qi;return(null!==(r=t[i])&&void 0!==r?r:t[i]={})[n]=e[n],t}),n)}const zi="event";const Ji=e=>Math.round(e),Xi=(e,t)=>Array.isArray(e)?e.map((e=>Xi(e,t))):e instanceof Ai&&"string"==typeof e.value?new Ai(Xi(e.value,t),e.params):(t.baseUrl&&(e=function(e,t){const n=new URL(e),r=new URL(t);if(n.origin!==r.origin)return e;const s=n.pathname.split("/").slice(1),i=r.pathname.split("/").slice(1,-1);for(;s[0]===i[0];)s.shift(),i.shift();for(;i.length;)i.shift(),s.unshift("..");return s.join("/")+n.search+n.hash}(e,t.baseUrl)),1===t.version?encodeURIComponent(e):e),Qi=e=>100*Ji(e/100),Zi={br:Ji,d:Ji,bl:Qi,dl:Qi,mtp:Qi,nor:(e,t)=>{let n=e;return t.version>=2&&(e instanceof Ai&&"string"==typeof e.value?n=new Ai([e]):"string"==typeof e&&(n=[e])),Xi(n,t)},rtp:Qi,tb:Ji},ea="request",ta="response",na=["ab","bg","bl","br","bs","bsd","cdn","cid","cs","df","ec","lab","lb","ltc","msd","mtp","pb","pr","pt","sf","sid","sn","st","sta","tab","tb","tbl","tpb","ts","v"],ra=["e"],sa=/^[a-zA-Z0-9-.]+-[a-zA-Z0-9-.]+$/;function ia(e){return sa.test(e)}
1const aa=["d","dl","nor","ot","rtp","su"];const oa=["cmsdd","cmsds","rc","smrt","ttfb","ttfbb","ttlb","url"];const la=["bl","br","bs","cid","d","dl","mtp","nor","nrr","ot","pr","rtp","sf","sid","st","su","tb","v"];function ca(e){return la.includes(e)||ia(e)}const ua={[ta]:function(e){return na.includes(e)||aa.includes(e)||oa.includes(e)||ia(e)},[zi]:function(e){return na.includes(e)||ra.includes(e)||ia(e)},[ea]:function(e){return na.includes(e)||aa.includes(e)||ia(e)}};function da(e,t={}){const n={};if(null==e||"object"!=typeof e)return n;const s=t.version||e.v||1,i=t.reportingMode||ea,a=1===s?ca:ua[i];let o=Object.keys(e).filter(a);const l=t.filter;"function"==typeof l&&(o=o.filter(l));const c=i===ta||i===zi;c&&!o.includes("ts")&&o.push("ts"),s>1&&!o.includes("v")&&o.push("v");const u=E({},Zi,t.formatters),d={version:s,reportingMode:i,baseUrl:t.baseUrl};return o.sort().forEach((t=>{let i=e[t];const a=u[t];if("function"==typeof a&&(i=a(i,d)),"v"===t){if(1===s)return;i=s}"pr"==t&&1===i||(c&&"ts"===t&&!r(i)&&(i=Date.now()),function(e){return"number"==typeof e?r(e):null!=e&&""!==e&&!1!==e}(i)&&(function(e){return["ot","sf","st","e","sta"].includes(e)}(t)&&"string"==typeof i&&(i=new ki(i)),n[t]=i))})),n}function ha(e,t,n){return E(e,function(e,t={}){const n={};if(!e)return n;const r=Yi(da(e,t),null==t?void 0:t.customHeaderMap);return Object.entries(r).reduce(((e,[t,n])=>{const r=Gi(n,{whitespace:!1});return r&&(e[t]=r),e}),n)}(t,n))}function fa(e,t={}){if(!e)return"";const n=function(e,t={}){return e?Gi(da(e,t),{whitespace:!1}):""}(e,t);return encodeURIComponent(n)}const pa=/CMCD=[^&#]+/;function ga(e,t,n){const r=function(e,t={}){return e?`CMCD=${fa(e,t)}`:""}(t,n);if(!r)return e;if(pa.test(e))return e.replace(pa,r);const s=e.includes("?")?"&":"?";return`${e}${s}${r}`}function ma(e,t,n,r){e&&Object.keys(t).forEach((s=>{const i=e.filter((e=>e.groupId===s)).map((e=>{const i=E({},e);return i.details=void 0,i.attrs=new dn(i.attrs),i.url=i.attrs.URI=_a(e.url,e.attrs["STABLE-RENDITION-ID"],"PER-RENDITION-URIS",n),i.groupId=i.attrs["GROUP-ID"]=t[s],i.attrs["PATHWAY-ID"]=r,i}));e.push(...i)}))}function _a(e,t,n,r){const{HOST:s,PARAMS:i,[n]:a}=r;let o;t&&(o=null==a?void 0:a[t],o&&(e=o));const l=new self.URL(e);return s&&!o&&(l.host=s),i&&Object.keys(i).sort().forEach((e=>{e&&l.searchParams.set(e,i[e])})),l.href}class Ta extends v{constructor(e){super("eme",e.logger),this.hls=void 0,this.config=void 0,this.media=null,this.mediaResolved=void 0,this.keyFormatPromise=null,this.keySystemAccessPromises={},this._requestLicenseFailureCount=0,this.mediaKeySessions=[],this.keyIdToKeySessionPromise={},this.mediaKeys=null,this.setMediaKeysQueue=Ta.CDMCleanupPromise?[Ta.CDMCleanupPromise]:[],this.bannedKeyIds={},this.onMediaEncrypted=e=>{const{initDataType:t,initData:n}=e,r=`"${e.type}" event: init data type: "${t}"`;if(this.debug(r),null!==n){if(!this.keyFormatPromise){let e=Object.keys(this.keySystemAccessPromises);e.length||(e=Nn(this.config));const t=e.map(On).filter((e=>!!e));this.keyFormatPromise=this.getKeyFormatPromise(t)}this.keyFormatPromise.then((s=>{const i=Ln(s);if("sinf"!==t||i!==In.FAIRPLAY)return void this.log(`Ignoring "${e.type}" event with init data type: "${t}" for selected key-system ${i}`);let a;try{const e=te(new Uint8Array(n)),t=ge(En(JSON.parse(e).sinf));if(!t)throw new Error("'schm' box missing or not cbcs/cenc with schi > tenc");a=new Uint8Array(t.subarray(8,24))}catch(e){return void this.warn(`${r} Failed to parse sinf: ${e}`)}const o=w(a),{keyIdToKeySessionPromise:l,mediaKeySessions:c}=this;let u=l[o];for(let e=0;e<c.length;e++){const r=c[e],s=r.decryptdata;if(!s.keyId)continue;const i=w(s.keyId);if(gn(a,s.keyId)||-1!==s.uri.replace(/-/g,"").indexOf(o)){if(u=l[i],!u)continue;if(s.pssh)break;delete l[i],s.pssh=new Uint8Array(n),s.keyId=a,u=l[o]=u.then((()=>this.generateRequestWithPreferredKeySession(r,t,n,"encrypted-event-key-match"))),u.catch((e=>this.handleError(e)));break}}u||this.handleError(new Error(`Key ID ${o} not encountered in playlist. Key-system sessions ${c.length}.`))})).catch((e=>this.handleError(e)))}},this.onWaitingForKey=e=>{this.log(`"${e.type}" event`)},this.hls=e,this.config=e.config,this.registerListeners()}destroy(){this.onDestroying(),this.onMediaDetached();const e=this.config;e.requestMediaKeySystemAccessFunc=null,e.licenseXhrSetup=e.licenseResponseCallback=void 0,e.drmSystems=e.drmSystemOptions={},this.hls=this.config=this.keyIdToKeySessionPromise=null,this.onMediaEncrypted=this.onWaitingForKey=null}
1registerListeners(){this.hls.on(l.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(l.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(l.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(l.MANIFEST_LOADED,this.onManifestLoaded,this),this.hls.on(l.DESTROYING,this.onDestroying,this)}unregisterListeners(){this.hls.off(l.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(l.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(l.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.off(l.MANIFEST_LOADED,this.onManifestLoaded,this),this.hls.off(l.DESTROYING,this.onDestroying,this)}getLicenseServerUrl(e){const{drmSystems:t,widevineLicenseUrl:n}=this.config,r=null==t?void 0:t[e];return r?r.licenseUrl:e===In.WIDEVINE&&n?n:void 0}getLicenseServerUrlOrThrow(e){const t=this.getLicenseServerUrl(e);if(void 0===t)throw new Error(`no license server URL configured for key-system "${e}"`);return t}getServerCertificateUrl(e){const{drmSystems:t}=this.config,n=null==t?void 0:t[e];if(n)return n.serverCertificateUrl;this.log(`No Server Certificate in config.drmSystems["${e}"]`)}attemptKeySystemAccess(e){const t=this.hls.levels,n=(e,t,n)=>!!e&&n.indexOf(e)===t,r=t.map((e=>e.audioCodec)).filter(n),s=t.map((e=>e.videoCodec)).filter(n);return r.length+s.length===0&&s.push("avc1.42e01e"),new Promise(((t,n)=>{const i=e=>{const l=e.shift();this.getMediaKeysPromise(l,r,s).then((e=>t({keySystem:l,mediaKeys:e}))).catch((t=>{e.length?i(e):n(t instanceof Sa?t:new Sa({type:a.KEY_SYSTEM_ERROR,details:o.KEY_SYSTEM_NO_ACCESS,error:t,fatal:!0},t.message))}))};i(e)}))}requestMediaKeySystemAccess(e,t){const{requestMediaKeySystemAccessFunc:n}=this.config;if("function"!=typeof n){let e=`Configured requestMediaKeySystemAccess is not a function ${n}`;return null===wn&&"http:"===self.location.protocol&&(e=`navigator.requestMediaKeySystemAccess is not available over insecure protocol ${location.protocol}`),Promise.reject(new Error(e))}return n(e,t)}getMediaKeysPromise(e,t,n){var r;const s=function(e,t,n,r){let s;switch(e){case In.FAIRPLAY:s=["cenc","sinf"];break;case In.WIDEVINE:case In.PLAYREADY:s=["cenc"];break;case In.CLEARKEY:s=["cenc","keyids"];break;default:throw new Error(`Unknown key-system: ${e}`)}return function(e,t,n,r){return[{initDataTypes:e,persistentState:r.persistentState||"optional",distinctiveIdentifier:r.distinctiveIdentifier||"optional",sessionTypes:r.sessionTypes||[r.sessionType||"temporary"],audioCapabilities:t.map((e=>({contentType:`audio/mp4; codecs=${e}`,robustness:r.audioRobustness||"",encryptionScheme:r.audioEncryptionScheme||null}))),videoCapabilities:n.map((e=>({contentType:`video/mp4; codecs=${e}`,robustness:r.videoRobustness||"",encryptionScheme:r.videoEncryptionScheme||null})))}]}(s,t,n,r)}(e,t,n,this.config.drmSystemOptions||{});let i=this.keySystemAccessPromises[e],a=null==(r=i)?void 0:r.keySystemAccess;if(!a){this.log(`Requesting encrypted media "${e}" key-system access with config: ${rt(s)}`),a=this.requestMediaKeySystemAccess(e,s);const t=i=this.keySystemAccessPromises[e]={keySystemAccess:a};return a.catch((t=>{this.log(`Failed to obtain access to key-system "${e}": ${t}`)})),a.then((n=>{this.log(`Access for key-system "${n.keySystem}" obtained`);const r=this.fetchServerCertificate(e);this.log(`Create media-keys for "${e}"`);const s=t.mediaKeys=n.createMediaKeys().then((n=>(this.log(`Media-keys created for "${e}"`),t.hasMediaKeys=!0,r.then((t=>t?this.setMediaKeysServerCertificate(n,e,t):n)))));return s.catch((t=>{this.error(`Failed to create media-keys for "${e}"}: ${t}`)})),s}))}return a.then((()=>i.mediaKeys))}createMediaKeySessionContext({decryptdata:e,keySystem:t,mediaKeys:n}){this.log(`Creating key-system session "${t}" keyId: ${w(e.keyId||[])} keyUri: ${e.uri}`);const r=n.createSession(),s={decryptdata:e,keySystem:t,mediaKeys:n,mediaKeysSession:r,keyStatus:"status-pending"};return this.mediaKeySessions.push(s),s}renewKeySession(e){const t=e.decryptdata;if(t.pssh){const n=this.createMediaKeySessionContext(e),r=Ea(t),s="cenc";this.keyIdToKeySessionPromise[r]=this.generateRequestWithPreferredKeySession(n,s,t.pssh.buffer,"expired")}else this.warn("Could not renew expired session. Missing pssh initData.");this.removeSession(e)}updateKeySession(e,t){const n=e.mediaKeysSession;return this.log(`Updating key-session "${n.sessionId}" for keyId ${w(e.decryptdata.keyId||[])}\n      } (data length: ${t.byteLength})`),n.update(t)}getSelectedKeySystemFormats(){return Object.keys(this.keySystemAccessPromises).map((e=>({keySystem:e,hasMediaKeys:this.keySystemAccessPromises[e].hasMediaKeys}))).filter((({hasMediaKeys:e})=>!!e)).map((({keySystem:e})=>On(e))).filter((e=>!!e))}getKeySystemAccess(e){return this.getKeySystemSelectionPromise(e).then((({keySystem:e,mediaKeys:t})=>this.attemptSetMediaKeys(e,t)))}selectKeySystem(e){return new Promise(((t,n)=>{this.getKeySystemSelectionPromise(e).then((({keySystem:e})=>{const r=On(e);r?t(r):n(new Error(`Unable to find format for key-system "${e}"`))})).catch(n)}))}selectKeySystemFormat(e){const t=Object.keys(e.levelkeys||{});return this.keyFormatPromise||(this.log(`Selecting key-system from fragment (sn: ${e.sn} ${e.type}: ${e.level}) key formats ${t.join(", ")}`),this.keyFormatPromise=this.getKeyFormatPromise(t)),this.keyFormatPromise}getKeyFormatPromise(e){const t=Nn(this.config),n=e.map(Ln).filter((e=>!!e&&-1!==t.indexOf(e)));return this.selectKeySystem(n)}getKeyStatus(e){const{mediaKeySessions:t}=this;for(let n=0;n<t.length;n++){const r=ya(e,t[n]);if(r)return r}}loadKey(e){const t=e.keyInfo.decryptdata,n=Ea(t),r=this.bannedKeyIds[n];if(r||"internal-error"===this.getKeyStatus(t)){const n=va(r||"internal-error",t);return this.handleError(n,e.frag),Promise.reject(n)}const s=`(keyId: ${n} format: "${t.keyFormat}" method: ${t.method} uri: ${t.uri})`;this.log(`Starting session for key ${s}`);const i=this.keyIdToKeySessionPromise[n];if(!i){const r=this.getKeySystemForKeyPromise(t).then((({keySystem:n,mediaKeys:r})=>(this.throwIfDestroyed(),this.log(`Handle encrypted media sn: ${e.frag.sn} ${e.frag.type}: ${e.frag.level} using key ${s}`),this.attemptSetMediaKeys(n,r).then((()=>(this.throwIfDestroyed(),this.createMediaKeySessionContext({keySystem:n,mediaKeys:r,decryptdata:t}))))))).then((e=>{const n=t.pssh?t.pssh.buffer:null;return this.generateRequestWithPreferredKeySession(e,"cenc",n,"playlist-key")}));return r.catch((t=>this.handleError(t,e.frag))),this.keyIdToKeySessionPromise[n]=r,r}return i.catch((n=>{if(n instanceof Sa){const r=S({},n.data);"internal-error"===this.getKeyStatus(t)&&(r.decryptdata=t);const s=new Sa(r,n.message);this.handleError(s,e.frag)}})),i}throwIfDestroyed(e="Invalid state"){if(!this.hls)throw new Error("invalid state")}handleError(e,t){if(this.hls)if(e instanceof Sa){t&&(e.data.frag=t);const n=e.data.decryptdata;this.error(`${e.message}${n?` (${w(n.keyId||[])})`:""}`),this.hls.trigger(l.ERROR,e.data)}else this.error(e.message),this.hls.trigger(l.ERROR,{type:a.KEY_SYSTEM_ERROR,details:o.KEY_SYSTEM_NO_KEYS,error:e,fatal:!0})}
1getKeySystemForKeyPromise(e){const t=Ea(e),n=this.keyIdToKeySessionPromise[t];if(!n){const t=Ln(e.keyFormat),n=t?[t]:Nn(this.config);return this.attemptKeySystemAccess(n)}return n}getKeySystemSelectionPromise(e){if(e.length||(e=Nn(this.config)),0===e.length)throw new Sa({type:a.KEY_SYSTEM_ERROR,details:o.KEY_SYSTEM_NO_CONFIGURED_LICENSE,fatal:!0},`Missing key-system license configuration options ${rt({drmSystems:this.config.drmSystems})}`);return this.attemptKeySystemAccess(e)}attemptSetMediaKeys(e,t){if(this.mediaResolved=void 0,this.mediaKeys===t)return Promise.resolve();const n=this.setMediaKeysQueue.slice();this.log(`Setting media-keys for "${e}"`);const r=Promise.all(n).then((()=>this.media?this.media.setMediaKeys(t):new Promise(((e,n)=>{this.mediaResolved=()=>{if(this.mediaResolved=void 0,!this.media)return n(new Error("Attempted to set mediaKeys without media element attached"));this.mediaKeys=t,this.media.setMediaKeys(t).then(e).catch(n)}}))));return this.mediaKeys=t,this.setMediaKeysQueue.push(r),r.then((()=>{this.log(`Media-keys set for "${e}"`),n.push(r),this.setMediaKeysQueue=this.setMediaKeysQueue.filter((e=>-1===n.indexOf(e)))}))}generateRequestWithPreferredKeySession(e,t,n,r){var s;const i=null==(s=this.config.drmSystems)||null==(s=s[e.keySystem])?void 0:s.generateRequest;if(i)try{const r=i.call(this.hls,t,n,e);if(!r)throw new Error("Invalid response from configured generateRequest filter");t=r.initDataType,n=r.initData?r.initData:null,e.decryptdata.pssh=n?new Uint8Array(n):null}catch(e){if(this.warn(e.message),this.hls&&this.hls.config.debug)throw e}if(null===n)return this.log(`Skipping key-session request for "${r}" (no initData)`),Promise.resolve(e);const l=Ea(e.decryptdata),c=e.decryptdata.uri;this.log(`Generating key-session request for "${r}" keyId: ${l} URI: ${c} (init data type: ${t} length: ${n.byteLength})`);const u=new $r,d=e._onmessage=t=>{const n=e.mediaKeysSession;if(!n)return void u.emit("error",new Error("invalid state"));const{messageType:r,message:s}=t;this.log(`"${r}" message event for session "${n.sessionId}" message size: ${s.byteLength}`),"license-request"===r||"license-renewal"===r?this.renewLicense(e,s).catch((e=>{u.eventNames().length?u.emit("error",e):this.handleError(e)})):"license-release"===r?e.keySystem===In.FAIRPLAY&&this.updateKeySession(e,yn("acknowledged")).then((()=>this.removeSession(e))).catch((e=>this.handleError(e))):this.warn(`unhandled media key message type "${r}"`)},h=(e,t)=>{let n;t.keyStatus=e,e.startsWith("usable")?u.emit("resolved"):"internal-error"===e||"output-restricted"===e||"output-downscaled"===e?n=va(e,t.decryptdata):"expired"===e?n=new Error(`key expired (keyId: ${l})`):"released"===e?n=new Error("key released"):"status-pending"===e||this.warn(`unhandled key status change "${e}" (keyId: ${l})`),n&&(u.eventNames().length?u.emit("error",n):this.handleError(n))},f=e._onkeystatuseschange=t=>{if(!e.mediaKeysSession)return void u.emit("error",new Error("invalid state"));const n=this.getKeyStatuses(e);if(!Object.keys(n).some((e=>"status-pending"!==n[e])))return;if("expired"===n[l])return this.log(`Expired key ${rt(n)} in key-session "${e.mediaKeysSession.sessionId}"`),void this.renewKeySession(e);let r=n[l];if(r)h(r,e);else{var s;const t=1e3;e.keyStatusTimeouts||(e.keyStatusTimeouts={}),(s=e.keyStatusTimeouts)[l]||(s[l]=self.setTimeout((()=>{if(!e.mediaKeysSession||!this.mediaKeys)return;const n=this.getKeyStatus(e.decryptdata);if(n&&"status-pending"!==n)return this.log(`No status for keyId ${l} in key-session "${e.mediaKeysSession.sessionId}". Using session key-status ${n} from other session.`),h(n,e);this.log(`key status for ${l} in key-session "${e.mediaKeysSession.sessionId}" timed out after ${t}ms`),r="internal-error",h(r,e)}),t)),this.log(`No status for keyId ${l} (${rt(n)}).`)}};Er(e.mediaKeysSession,"message",d),Er(e.mediaKeysSession,"keystatuseschange",f);const p=new Promise(((e,t)=>{u.on("error",t),u.on("resolved",e)}));return e.mediaKeysSession.generateRequest(t,n).then((()=>{this.log(`Request generated for key-session "${e.mediaKeysSession.sessionId}" keyId: ${l} URI: ${c}`)})).catch((t=>{throw new Sa({type:a.KEY_SYSTEM_ERROR,details:o.KEY_SYSTEM_NO_SESSION,error:t,decryptdata:e.decryptdata,fatal:!1},`Error generating key-session request: ${t}`)})).then((()=>p)).catch((t=>(u.removeAllListeners(),this.removeSession(e).then((()=>{throw t}))))).then((()=>(u.removeAllListeners(),e)))}getKeyStatuses(e){const t={};
1return e.mediaKeysSession.keyStatuses.forEach(((n,r)=>{if("string"==typeof r&&"object"==typeof n){const e=r;r=n,n=e}const s="buffer"in r?new Uint8Array(r.buffer,r.byteOffset,r.byteLength):new Uint8Array(r);if(e.keySystem===In.PLAYREADY&&16===s.length){const e=w(s);t[e]=n,Sn(s)}const i=w(s);"internal-error"===n&&(this.bannedKeyIds[i]=n),this.log(`key status change "${n}" for keyStatuses keyId: ${i} key-session "${e.mediaKeysSession.sessionId}"`),t[i]=n})),t}fetchServerCertificate(e){const t=this.config,n=new(0,t.loader)(t),r=this.getServerCertificateUrl(e);return r?(this.log(`Fetching server certificate for "${e}"`),new Promise(((s,i)=>{const l={responseType:"arraybuffer",url:r},c=t.certLoadPolicy.default,u={loadPolicy:c,timeout:c.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},d={onSuccess:(e,t,n,r)=>{s(e.data)},onError:(t,n,s,c)=>{i(new Sa({type:a.KEY_SYSTEM_ERROR,details:o.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:s,response:S({url:l.url,data:void 0},t)},`"${e}" certificate request failed (${r}). Status: ${t.code} (${t.text})`))},onTimeout:(t,n,s)=>{i(new Sa({type:a.KEY_SYSTEM_ERROR,details:o.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:s,response:{url:l.url,data:void 0}},`"${e}" certificate request timed out (${r})`))},onAbort:(e,t,n)=>{i(new Error("aborted"))}};n.load(l,u,d)}))):Promise.resolve()}setMediaKeysServerCertificate(e,t,n){return new Promise(((r,s)=>{e.setServerCertificate(n).then((s=>{this.log(`setServerCertificate ${s?"success":"not supported by CDM"} (${n.byteLength}) on "${t}"`),r(e)})).catch((e=>{s(new Sa({type:a.KEY_SYSTEM_ERROR,details:o.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED,error:e,fatal:!0},e.message))}))}))}renewLicense(e,t){return this.requestLicense(e,new Uint8Array(t)).then((t=>this.updateKeySession(e,new Uint8Array(t)).catch((t=>{throw new Sa({type:a.KEY_SYSTEM_ERROR,details:o.KEY_SYSTEM_SESSION_UPDATE_FAILED,decryptdata:e.decryptdata,error:t,fatal:!1},t.message)}))))}unpackPlayReadyKeyMessage(e,t){const n=String.fromCharCode.apply(null,new Uint16Array(t.buffer));if(!n.includes("PlayReadyKeyMessage"))return e.setRequestHeader("Content-Type","text/xml; charset=utf-8"),t;const r=(new DOMParser).parseFromString(n,"application/xml"),s=r.querySelectorAll("HttpHeader");if(s.length>0){let t;for(let n=0,r=s.length;n<r;n++){var i,a;t=s[n];const r=null==(i=t.querySelector("name"))?void 0:i.textContent,o=null==(a=t.querySelector("value"))?void 0:a.textContent;r&&o&&e.setRequestHeader(r,o)}}const o=r.querySelector("Challenge"),l=null==o?void 0:o.textContent;if(!l)throw new Error("Cannot find <Challenge> in key message");return yn(atob(l))}setupLicenseXHR(e,t,n,r){const s=this.config.licenseXhrSetup;return s?Promise.resolve().then((()=>
1{if(!n.decryptdata)throw new Error("Key removed");return s.call(this.hls,e,t,n,r)})).catch((i=>{if(!n.decryptdata)throw i;return e.open("POST",t,!0),s.call(this.hls,e,t,n,r)})).then((n=>{e.readyState||e.open("POST",t,!0);return{xhr:e,licenseChallenge:n||r}})):(e.open("POST",t,!0),Promise.resolve({xhr:e,licenseChallenge:r}))}requestLicense(e,t){const n=this.config.keyLoadPolicy.default;return new Promise(((r,s)=>{const i=this.getLicenseServerUrlOrThrow(e.keySystem);this.log(`Sending license request to URL: ${i}`);const l=new XMLHttpRequest;l.responseType="arraybuffer",l.onreadystatechange=()=>{if(!this.hls||!e.mediaKeysSession)return s(new Error("invalid state"));if(4===l.readyState)if(200===l.status){this._requestLicenseFailureCount=0;let t=l.response;this.log(`License received ${t instanceof ArrayBuffer?t.byteLength:t}`);const n=this.config.licenseResponseCallback;if(n)try{t=n.call(this.hls,l,i,e)}catch(e){this.error(e)}r(t)}else{const c=n.errorRetry,u=c?c.maxNumRetry:0;if(this._requestLicenseFailureCount++,this._requestLicenseFailureCount>u||l.status>=400&&l.status<500)s(new Sa({type:a.KEY_SYSTEM_ERROR,details:o.KEY_SYSTEM_LICENSE_REQUEST_FAILED,decryptdata:e.decryptdata,fatal:!0,networkDetails:l,response:{url:i,data:void 0,code:l.status,text:l.statusText}},`License Request XHR failed (${i}). Status: ${l.status} (${l.statusText})`));else{const n=u-this._requestLicenseFailureCount+1;this.warn(`Retrying license request, ${n} attempts left`),this.requestLicense(e,t).then(r,s)}}},e.licenseXhr&&e.licenseXhr.readyState!==XMLHttpRequest.DONE&&e.licenseXhr.abort(),e.licenseXhr=l,this.setupLicenseXHR(l,i,e,t).then((({xhr:t,licenseChallenge:n})=>{e.keySystem==In.PLAYREADY&&(n=this.unpackPlayReadyKeyMessage(t,n)),t.send(n)})).catch(s)}))}onDestroying(){this.unregisterListeners(),this._clear()}onMediaAttached(e,t){if(!this.config.emeEnabled)return;const n=t.media;this.media=n,Er(n,"encrypted",this.onMediaEncrypted),Er(n,"waitingforkey",this.onWaitingForKey);const r=this.mediaResolved;r?r():this.mediaKeys=n.mediaKeys}onMediaDetached(){const e=this.media;e&&(yr(e,"encrypted",this.onMediaEncrypted),yr(e,"waitingforkey",this.onWaitingForKey),this.media=null,this.mediaKeys=null)}_clear(){var e;this._requestLicenseFailureCount=0,this.keyIdToKeySessionPromise={},this.bannedKeyIds={};const t=this.mediaResolved;if(t&&t(),!this.mediaKeys&&!this.mediaKeySessions.length)return;const n=this.media,r=this.mediaKeySessions.slice();this.mediaKeySessions=[],this.mediaKeys=null,xn.clearKeyUriToKeyIdMap();const s=r.length;Ta.CDMCleanupPromise=Promise.all(r.map((e=>this.removeSession(e))).concat((null==n||null==(e=n.setMediaKeys(null))?void 0:e.catch((e=>{this.log(`Could not clear media keys: ${e}`),this.hls&&this.hls.trigger(l.ERROR,{type:a.OTHER_ERROR,details:o.KEY_SYSTEM_DESTROY_MEDIA_KEYS_ERROR,fatal:!1,error:new Error(`Could not clear media keys: ${e}`)})})))||Promise.resolve())).catch((e=>{this.log(`Could not close sessions and clear media keys: ${e}`),this.hls&&this.hls.trigger(l.ERROR,{type:a.OTHER_ERROR,details:o.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR,fatal:!1,error:new Error(`Could not close sessions and clear media keys: ${e}`)})})).then((()=>{s&&this.log("finished closing key sessions and clearing media keys")}))}onManifestLoading(){this._clear()}onManifestLoaded(e,{sessionKeys:t}){if(t&&this.config.emeEnabled&&!this.keyFormatPromise){const e=t.reduce(((e,t)=>(-1===e.indexOf(t.keyFormat)&&e.push(t.keyFormat),e)),[]);this.log(`Selecting key-system from session-keys ${e.join(", ")}`),this.keyFormatPromise=this.getKeyFormatPromise(e)}}removeSession(e){const{mediaKeysSession:t,licenseXhr:n,decryptdata:r}=e;if(t){this.log(`Remove licenses and keys and close session "${t.sessionId}" keyId: ${w((null==r?void 0:r.keyId)||[])}`),e._onmessage&&(t.removeEventListener("message",e._onmessage),e._onmessage=void 0),e._onkeystatuseschange&&(t.removeEventListener("keystatuseschange",e._onkeystatuseschange),e._onkeystatuseschange=void 0),n&&n.readyState!==XMLHttpRequest.DONE&&n.abort(),e.mediaKeysSession=e.decryptdata=e.licenseXhr=void 0;const s=this.mediaKeySessions.indexOf(e);s>-1&&this.mediaKeySessions.splice(s,1);const{keyStatusTimeouts:i}=e;
1i&&Object.keys(i).forEach((e=>self.clearTimeout(i[e])));const{drmSystemOptions:c}=this.config,u=function(e){var t;return!(!e||"persistent-license"!==e.sessionType&&(null==(t=e.sessionTypes)||!t.some((e=>"persistent-license"===e))))}(c)?new Promise(((e,n)=>{self.setTimeout((()=>n(new Error("MediaKeySession.remove() timeout"))),8e3),t.remove().then(e).catch(n)})):Promise.resolve();return u.catch((e=>{this.log(`Could not remove session: ${e}`),this.hls&&this.hls.trigger(l.ERROR,{type:a.OTHER_ERROR,details:o.KEY_SYSTEM_DESTROY_REMOVE_SESSION_ERROR,fatal:!1,error:new Error(`Could not remove session: ${e}`)})})).then((()=>t.close())).catch((e=>{this.log(`Could not close session: ${e}`),this.hls&&this.hls.trigger(l.ERROR,{type:a.OTHER_ERROR,details:o.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR,fatal:!1,error:new Error(`Could not close session: ${e}`)})}))}return Promise.resolve()}}function Ea(e){if(!e)throw new Error("Could not read keyId of undefined decryptdata");if(null===e.keyId)throw new Error("keyId is null");return w(e.keyId)}function ya(e,t){return e.keyId&&t.mediaKeysSession.keyStatuses.has(e.keyId)?t.mediaKeysSession.keyStatuses.get(e.keyId):e.matches(t.decryptdata)?t.keyStatus:void 0}Ta.CDMCleanupPromise=void 0;class Sa extends Error{constructor(e,t){super(t),this.data=void 0,e.error||(e.error=new Error(t)),this.data=e,e.err=e.error}}function va(e,t){const n="output-restricted"===e,r=n?o.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED:o.KEY_SYSTEM_STATUS_INTERNAL_ERROR;return new Sa({type:a.KEY_SYSTEM_ERROR,details:r,fatal:!1,decryptdata:t},n?"HDCP level output restricted":`key status changed to "${e}"`)}function ba(e,t){let n;try{n=new Event("addtrack")}catch(e){n=document.createEvent("Event"),n.initEvent("addtrack",!1,!1)}n.track=e,t.dispatchEvent(n)}function Ia(e,t){const n=e.mode;if("disabled"===n&&(e.mode="hidden"),e.cues&&!e.cues.getCueById(t.id))try{if(e.addCue(t),!e.cues.getCueById(t.id))throw new Error(`addCue is failed for: ${t}`)}catch(n){k.debug(`[texttrack-utils]: ${n}`);try{const n=new self.TextTrackCue(t.startTime,t.endTime,t.text);n.id=t.id,e.addCue(n)}catch(e){k.debug(`[texttrack-utils]: Legacy TextTrackCue fallback failed: ${e}`)}}"disabled"===n&&(e.mode=n)}function Aa(e,t){const n=e.mode;if("disabled"===n&&(e.mode="hidden"),e.cues)for(let n=e.cues.length;n--;)t&&e.cues[n].removeEventListener("enter",t),e.removeCue(e.cues[n]);"disabled"===n&&(e.mode=n)}function Ra(e,t,n,r){const s=e.mode;if("disabled"===s&&(e.mode="hidden"),e.cues&&e.cues.length>0){const s=function(e,t,n){const r=[],s=function(e,t){if(t<=e[0].startTime)return 0;const n=e.length-1;if(t>e[n].endTime)return-1;let r,s=0,i=n;for(;s<=i;)if(r=Math.floor((i+s)/2),t<e[r].startTime)i=r-1;else{if(!(t>e[r].startTime&&s<n))return r;s=r+1}return e[s].startTime-t<t-e[i].startTime?s:i}(e,t);if(s>-1)for(let i=s,a=e.length;i<a;i++){const s=e[i];if(s.startTime>=t&&s.endTime<=n)r.push(s);else if(s.startTime>n)return r}return r}(e.cues,t,n);for(let t=0;t<s.length;t++)r&&!r(s[t])||e.removeCue(s[t])}"disabled"===s&&(e.mode=s)}function Ca(e){const t=[];for(let n=0;n<e.length;n++){const r=e[n];"subtitles"!==r.kind&&"captions"!==r.kind||!r.label||t.push(e[n])}return t}function ka(e){let t=5381,n=e.length;for(;n;)t=33*t^e.charCodeAt(--n);return(t>>>0).toString()}const La=.025;let Oa=function(e){return e[e.Point=0]="Point",e[e.Range=1]="Range",e}({});function Na(e,t,n){return`${e.identifier}-${n+1}-${ka(t)}`}class wa{constructor(e,t){this.base=void 0,this._duration=null,this._timelineStart=null,this.appendInPlaceDisabled=void 0,this.appendInPlaceStarted=void 0,this.dateRange=void 0,this.hasPlayed=!1,this.cumulativeDuration=0,this.resumeOffset=NaN,this.playoutLimit=NaN,this.restrictions={skip:!1,jump:!1},this.snapOptions={out:!1,in:!1},this.assetList=[],this.assetListLoader=void 0,this.assetListResponse=null,this.resumeAnchor=void 0,this.error=void 0,this.resetOnResume=void 0,this.base=t,this.dateRange=e,this.setDateRange(e)}setDateRange(e){this.dateRange=e,this.resumeOffset=e.attr.optionalFloat("X-RESUME-OFFSET",this.resumeOffset),this.playoutLimit=e.attr.optionalFloat("X-PLAYOUT-LIMIT",this.playoutLimit),this.restrictions=e.attr.enumeratedStringList("X-RESTRICT",this.restrictions),this.snapOptions=e.attr.enumeratedStringList("X-SNAP",this.snapOptions)}reset(){var e;this.appendInPlaceStarted=!1,null==(e=this.assetListLoader)||e.destroy(),this.assetListLoader=void 0,this.supplementsPrimary||(this.assetListResponse=null,this.assetList=[],this._duration=null)}isAssetPastPlayoutLimit(e){var t;if(e>0&&e>=this.assetList.length)return!0;const n=this.playoutLimit;if(e<=0||isNaN(n))return!1;if(0===n)return!0;return((null==(t=this.assetList[e])?void 0:t.startOffset)||0)>n}findAssetIndex(e){return this.assetList.indexOf(e)}get identifier(){return this.dateRange.id}get startDate(){return this.dateRange.startDate}get startTime(){const e=this.dateRange.startTime;if(this.snapOptions.out){const t=this.dateRange.tagAnchor;if(t)return Pa(e,t)}return e}get startOffset(){return this.cue.pre?0:this.startTime}get startIsAligned(){if(0===this.startTime||this.snapOptions.out)return!0;const e=this.dateRange.tagAnchor;if(e){const t=this.dateRange.startTime;return t-Pa(t,e)<.1}return!1}get resumptionOffset(){const e=this.resumeOffset,t=r(e)?e:this.duration;return this.cumulativeDuration+t}get resumeTime(){const e=this.startOffset+this.resumptionOffset;if(this.snapOptions.in){const t=this.resumeAnchor;if(t)return Pa(e,t)}return e}get appendInPlace(){return!!this.appendInPlaceStarted||!this.appendInPlaceDisabled&&!(this.cue.once||this.cue.pre||!this.startIsAligned||!(isNaN(this.playoutLimit)&&isNaN(this.resumeOffset)||this.resumeOffset&&this.duration&&Math.abs(this.resumeOffset-this.duration)<La))}set appendInPlace(e){this.appendInPlaceStarted?this.resetOnResume=!e:this.appendInPlaceDisabled=!e}get timelineStart(){return null!==this._timelineStart?this._timelineStart:this.startTime}set timelineStart(e){this._timelineStart=e}get duration(){const e=this.playoutLimit;let t;return t=null!==this._duration?this._duration:this.dateRange.duration?this.dateRange.duration:this.dateRange.plannedDuration||0,!isNaN(e)&&e<t&&(t=e),t}set duration(e){this._duration=e}get cue(){return this.dateRange.cue}get timelineOccupancy(){return"RANGE"===this.dateRange.attr["X-TIMELINE-OCCUPIES"]?Oa.Range:Oa.Point}get supplementsPrimary(){return"PRIMARY"===this.dateRange.attr["X-TIMELINE-STYLE"]}get contentMayVary(){return"NO"!==this.dateRange.attr["X-CONTENT-MAY-VARY"]}get assetUrl(){return this.dateRange.attr["X-ASSET-URI"]}get assetListUrl(){return this.dateRange.attr["X-ASSET-LIST"]}get baseUrl(){return this.base.url}get assetListLoaded(){return this.assetList.length>0||null!==this.assetListResponse}toString(){return`["${(e=this).identifier}" ${e.cue.pre?"<pre>":e.cue.post?"<post>":""}${e.timelineStart.toFixed(2)}-${e.resumeTime.toFixed(2)}]`;var e}}function Pa(e,t){return e-t.start<t.duration/2&&!(Math.abs(e-(t.start+t.duration))<La)?t.start:t.start+t.duration}
1function Ma(e,t,n){const r=new self.URL(e,n);return"data:"!==r.protocol&&r.searchParams.set("_HLS_primary_id",t),r}function Da(e,t){for(;null!=(n=e.assetList[++t])&&n.error;)var n;return t}function xa(e){const t=e.timelineStart,n=e.duration||0;return`["${e.identifier}" ${t.toFixed(2)}-${(t+n).toFixed(2)}]`}class Ua{constructor(e,t,n,r){this.hls=void 0,this.interstitial=void 0,this.assetItem=void 0,this.tracks=null,this.hasDetails=!1,this.mediaAttached=null,this._currentTime=void 0,this._bufferedEosTime=void 0,this.checkPlayout=()=>{this.reachedPlayout(this.currentTime)&&this.hls&&this.hls.trigger(l.PLAYOUT_LIMIT_REACHED,{})};const s=this.hls=new e(t);this.interstitial=n,this.assetItem=r;const i=()=>{this.hasDetails=!0};s.once(l.LEVEL_LOADED,i),s.once(l.AUDIO_TRACK_LOADED,i),s.once(l.SUBTITLE_TRACK_LOADED,i),s.on(l.MEDIA_ATTACHING,((e,{media:t})=>{this.removeMediaListeners(),this.mediaAttached=t;this.interstitial.playoutLimit&&(t.addEventListener("timeupdate",this.checkPlayout),this.appendInPlace&&s.on(l.BUFFER_APPENDED,(()=>{const e=this.bufferedEnd;this.reachedPlayout(e)&&(this._bufferedEosTime=e,s.trigger(l.BUFFERED_TO_END,void 0))})))}))}get appendInPlace(){return this.interstitial.appendInPlace}loadSource(){const e=this.hls;if(e)if(e.url)e.levels.length&&!e.started&&e.startLoad(-1,!0);else{let t=this.assetItem.uri;try{t=Ma(t,e.config.primarySessionId||"").href}catch(e){}e.loadSource(t)}}bufferedInPlaceToEnd(e){var t;if(!this.appendInPlace)return!1;if(null!=(t=this.hls)&&t.bufferedToEnd)return!0;if(!e)return!1;const n=Math.min(this._bufferedEosTime||1/0,this.duration),r=this.timelineOffset,s=nn.bufferInfo(e,r,0);return this.getAssetTime(s.end)>=n-.02}reachedPlayout(e){const t=this.interstitial.playoutLimit;return this.startOffset+e>=t}get destroyed(){var e;return!(null!=(e=this.hls)&&e.userConfig)}get assetId(){return this.assetItem.identifier}get interstitialId(){return this.assetItem.parentIdentifier}get media(){var e;return(null==(e=this.hls)?void 0:e.media)||null}get bufferedEnd(){const e=this.media||this.mediaAttached;if(!e)return this._bufferedEosTime?this._bufferedEosTime:this.currentTime;const t=nn.bufferInfo(e,e.currentTime,.001);return this.getAssetTime(t.end)}get currentTime(){const e=this.media||this.mediaAttached;return e?this.getAssetTime(e.currentTime):this._currentTime||0}get duration(){const e=this.assetItem.duration;if(!e)return 0;const t=this.interstitial.playoutLimit;if(t){const n=t-this.startOffset;if(n>0&&n<e)return n}return e}get remaining(){const e=this.duration;return e?Math.max(0,e-this.currentTime):0}get startOffset(){return this.assetItem.startOffset}get timelineOffset(){var e;return(null==(e=this.hls)?void 0:e.config.timelineOffset)||0}set timelineOffset(e){const t=this.timelineOffset;if(e!==t){const n=e-t;if(Math.abs(n)>1/9e4&&this.hls){if(this.hasDetails)throw new Error("Cannot set timelineOffset after playlists are loaded");this.hls.config.timelineOffset=e}}}getAssetTime(e){const t=this.timelineOffset,n=this.duration;return Math.min(Math.max(0,e-t),n)}removeMediaListeners(){const e=this.mediaAttached;e&&(this._currentTime=e.currentTime,this.bufferSnapShot(),e.removeEventListener("timeupdate",this.checkPlayout))}bufferSnapShot(){var e;this.mediaAttached&&(null!=(e=this.hls)&&e.bufferedToEnd&&(this._bufferedEosTime=this.bufferedEnd))}destroy(){this.removeMediaListeners(),this.hls&&this.hls.destroy(),this.hls=null,this.tracks=this.mediaAttached=this.checkPlayout=null}attachMedia(e){var t;this.loadSource(),null==(t=this.hls)||t.attachMedia(e)}detachMedia(){var e;this.removeMediaListeners(),this.mediaAttached=null,null==(e=this.hls)||e.detachMedia()}resumeBuffering(){var e;null==(e=this.hls)||e.resumeBuffering()}pauseBuffering(){var e;null==(e=this.hls)||e.pauseBuffering()}transferMedia(){var e;return this.bufferSnapShot(),(null==(e=this.hls)?void 0:e.transferMedia())||null}resetDetails(){const e=this.hls;if(e&&this.hasDetails){e.stopLoad();const t=e=>delete e.details;e.levels.forEach(t),e.allAudioTracks.forEach(t),e.allSubtitleTracks.forEach(t),this.hasDetails=!1}}on(e,t,n){var r;null==(r=this.hls)||r.on(e,t)}once(e,t,n){var r;null==(r=this.hls)||r.once(e,t)}off(e,t,n){var r;null==(r=this.hls)||r.off(e,t)}toString(){var e;return`HlsAssetPlayer: ${xa(this.assetItem)} ${null==(e=this.hls)?void 0:e.sessionId} ${this.appendInPlace?"append-in-place":""}`}}class Ba extends v{constructor(e,t){super("interstitials-sched",t),this.onScheduleUpdate=void 0,this.eventMap={},this.events=null,this.items=null,this.durations={primary:0,playout:0,integrated:0},this.onScheduleUpdate=e}destroy(){this.reset(),this.onScheduleUpdate=null}reset(){this.eventMap={}
1,this.setDurations(0,0,0),this.events&&this.events.forEach((e=>e.reset())),this.events=this.items=null}resetErrorsInRange(e,t){return this.events?this.events.reduce(((n,r)=>e<=r.startOffset&&t>r.startOffset?(delete r.error,n+1):n),0):0}get duration(){const e=this.items;return e?e[e.length-1].end:0}get length(){return this.items?this.items.length:0}getEvent(e){return e&&this.eventMap[e]||null}hasEvent(e){return e in this.eventMap}findItemIndex(e,t){if(e.event)return this.findEventIndex(e.event.identifier);let n=-1;e.nextEvent?n=this.findEventIndex(e.nextEvent.identifier)-1:e.previousEvent&&(n=this.findEventIndex(e.previousEvent.identifier)+1);const r=this.items;if(r)for(r[n]||(void 0===t&&(t=e.start),n=this.findItemIndexAtTime(t));n>=0&&null!=(s=r[n])&&s.event;){var s;n--}return n}findItemIndexAtTime(e,t){const n=this.items;if(n)for(let r=0;r<n.length;r++){let s=n[r];if(t&&"primary"!==t&&(s=s[t]),e===s.start||e>s.start&&e<s.end)return r}return-1}findJumpRestrictedIndex(e,t){const n=this.items;if(n)for(let r=e;r<=t&&n[r];r++){const e=n[r].event;if(null!=e&&e.restrictions.jump&&!e.appendInPlace)return r}return-1}findEventIndex(e){const t=this.items;if(t)for(let r=t.length;r--;){var n;if((null==(n=t[r].event)?void 0:n.identifier)===e)return r}return-1}findAssetIndex(e,t){const n=e.assetList,r=n.length;if(r>1)for(let e=0;e<r;e++){const s=n[e];if(!s.error){const n=s.timelineStart;if(t===n||t>n&&(t<n+(s.duration||0)||e===r-1))return e}}return 0}get assetIdAtEnd(){var e;const t=null==(e=this.items)||null==(e=e[this.length-1])?void 0:e.event;if(t){const e=t.assetList,n=e[e.length-1];if(n)return n.identifier}return null}parseInterstitialDateRanges(e,t){const n=e.main.details,{dateRanges:r}=n,s=this.events,i=this.parseDateRanges(r,{url:n.url},t),a=Object.keys(r),o=s?s.filter((e=>!a.includes(e.identifier))):[];i.length&&i.sort(((e,t)=>{const n=e.cue.pre,r=e.cue.post,s=t.cue.pre,i=t.cue.post;if(n&&!s)return-1;if(s&&!n)return 1;if(r&&!i)return 1;if(i&&!r)return-1;if(!(n||s||r||i)){const n=e.startTime,r=t.startTime;if(n!==r)return n-r}return e.dateRange.tagOrder-t.dateRange.tagOrder})),this.events=i,o.forEach((e=>{this.removeEvent(e)})),this.updateSchedule(e,o)}updateSchedule(e,t=[],n=!1){const r=this.events||[];
1if(r.length||t.length||this.length<2){const s=this.items,i=this.parseSchedule(r,e),a=n||t.length||(null==s?void 0:s.length)!==i.length||i.some(((e,t)=>Math.abs(e.playout.start-s[t].playout.start)>.005||Math.abs(e.playout.end-s[t].playout.end)>.005));a&&(this.items=i,this.onScheduleUpdate(t,s))}}parseDateRanges(e,t,n){const r=[],s=Object.keys(e);for(let i=0;i<s.length;i++){const a=s[i],o=e[a];if(o.isInterstitial){let e=this.eventMap[a];e?e.setDateRange(o):(e=new wa(o,t),this.eventMap[a]=e,!1===n&&(e.appendInPlace=n)),r.push(e)}}return r}parseSchedule(e,t){const n=[],r=t.main.details,s=r.live?1/0:r.edge;let i=0;if((e=e.filter((e=>!(e.error||e.cue.once&&e.hasPlayed)))).length){this.resolveOffsets(e,t);let r=0,o=0;if(e.forEach(((t,a)=>{const l=t.cue.pre,c=t.cue.post,u=e[a-1]||null,d=t.appendInPlace,h=c?s:t.startOffset,f=t.duration,p=t.timelineOccupancy===Oa.Range?f:0,g=t.resumptionOffset,m=(null==u?void 0:u.startTime)===h,_=h+t.cumulativeDuration;let T=d?_+f:h+g;if(l||!c&&h<=0){const e=o;o+=p,t.timelineStart=_;const r=i;i+=f,n.push({event:t,start:_,end:T,playout:{start:r,end:i},integrated:{start:e,end:o}})}else{if(!(h<=s))return;{if(!m){const s=h-r;if(s>.033){const l=r,c=o;o+=s;const u=i;i+=s;const d={previousEvent:e[a-1]||null,nextEvent:t,start:l,end:l+s,playout:{start:u,end:i},integrated:{start:c,end:o}};n.push(d)}else s>0&&u&&(u.cumulativeDuration+=s,n[n.length-1].end=h)}c&&(T=_),t.timelineStart=_;const s=o;o+=p;const l=i;i+=f,n.push({event:t,start:_,end:T,playout:{start:l,end:i},integrated:{start:s,end:o}})}}const E=t.resumeTime;r=c||E>s?s:E})),r<s){var a;const e=r,t=o,l=s-r;o+=l;const c=i;i+=l,n.push({previousEvent:(null==(a=n[n.length-1])?void 0:a.event)||null,nextEvent:null,start:r,end:e+l,playout:{start:c,end:i},integrated:{start:t,end:o}})}this.setDurations(s,i,o)}else{const e=0;n.push({previousEvent:null,nextEvent:null,start:e,end:s,playout:{start:e,end:s},integrated:{start:e,end:s}}),this.setDurations(s,s,s)}return n}setDurations(e,t,n){this.durations={primary:e,playout:t,integrated:n}}resolveOffsets(e,t){const n=t.main.details,s=n.live?1/0:n.edge;let i=0,a=-1;e.forEach(((o,l)=>{const c=o.cue.pre,u=o.cue.post,d=c?0:u?s:o.startTime;this.updateAssetDurations(o);if(a===d?o.cumulativeDuration=i:(i=0,a=d),!u&&o.snapOptions.in&&(o.resumeAnchor=ft(null,n.fragments,o.startOffset+o.resumptionOffset,0,0)||void 0),o.appendInPlace&&!o.appendInPlaceStarted){this.primaryCanResumeInPlaceAt(o,t)||(o.appendInPlace=!1)}if(!o.appendInPlace&&l+1<e.length){e[l+1].startTime-e[l].resumeTime<.033&&(e[l+1].appendInPlace=!1,e[l+1].appendInPlace&&this.warn(`Could not change append strategy for abutting event ${o}`))}const h=r(o.resumeOffset)?o.resumeOffset:o.duration;i+=h}))}primaryCanResumeInPlaceAt(e,t){const n=e.resumeTime,r=e.startTime+e.resumptionOffset;if(Math.abs(n-r)>La)return this.log(`"${e.identifier}" resumption ${n} not aligned with estimated timeline end ${r}`),!1;return!Object.keys(t).some((r=>{const s=t[r].details,i=s.edge;if(n>=i)return this.log(`"${e.identifier}" resumption ${n} past ${r} playlist end ${i}`),!1;const a=ft(null,s.fragments,n);if(!a)return this.log(`"${e.identifier}" resumption ${n} does not align with any fragments in ${r} playlist (${s.fragStart}-${s.fragmentEnd})`),!0;const o="audio"===r?.175:0;return!(Math.abs(a.start-n)<La+o||Math.abs(a.end-n)<La+o)&&(this.log(`"${e.identifier}" resumption ${n} not aligned with ${r} fragment bounds (${a.start}-${a.end} sn: ${a.sn} cc: ${a.cc})`),!0)}))}updateAssetDurations(e){if(!e.assetListLoaded)return;const t=e.timelineStart;let n=0,r=!1,s=!1;for(let i=0;i<e.assetList.length;i++){const a=e.assetList[i],o=t+n;a.startOffset=n,a.timelineStart=o,r||(r=null===a.duration),s||(s=!!a.error);n+=a.error?0:a.duration||0}e.duration=r&&!s?Math.max(n,e.duration):n}removeEvent(e){e.reset(),delete this.eventMap[e.identifier]}}function Fa(e){return`[${e.event?'"'+e.event.identifier+'"':"primary"}: ${e.start.toFixed(2)}-${e.end.toFixed(2)}]`}class $a{constructor(e){this.hls=void 0,this.hls=e}destroy(){this.hls=null}loadAssetList(e,t){const n=e.assetListUrl;let r;try{r=Ma(n,this.hls.sessionId,e.baseUrl)}catch(t){const r=this.assignAssetListError(e,o.ASSET_LIST_LOAD_ERROR,t,n);return void this.hls.trigger(l.ERROR,r)}t&&"data:"!==r.protocol&&r.searchParams.set("_HLS_start_offset",""+t);const s=this.hls.config,i=new(0,s.loader)(s),a={responseType:"json",url:r.href},c=s.interstitialAssetListLoadPolicy.default,u={loadPolicy:c,timeout:c.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},d={onSuccess:(t,n,r,s)=>{const i=t.data,a=null==i?void 0:i.ASSETS;if(Array.isArray(a))e.assetListResponse=i,this.hls.trigger(l.ASSET_LIST_LOADED,{event:e,assetListResponse:i,networkDetails:s});else{const t=this.assignAssetListError(e,o.ASSET_LIST_PARSING_ERROR,new Error("Invalid interstitial asset list"),r.url,n,s);this.hls.trigger(l.ERROR,t)}},onError:(t,n,r,s)=>{const i=this.assignAssetListError(e,o.ASSET_LIST_LOAD_ERROR,new Error(`Error loading X-ASSET-LIST: HTTP status ${t.code} ${t.text} (${n.url})`),n.url,s,r);this.hls.trigger(l.ERROR,i)},onTimeout:(t,n,r)=>{const s=this.assignAssetListError(e,o.ASSET_LIST_LOAD_TIMEOUT,new Error(`Timeout loading X-ASSET-LIST (${n.url})`),n.url,t,r);this.hls.trigger(l.ERROR,s)}};return i.load(a,u,d),this.hls.trigger(l.ASSET_LIST_LOADING,{event:e}),i}assignAssetListError(e,t,n,r,s,i){return e.error=n,{type:a.NETWORK_E
vendor: 20,304 bytes, line 1
1RROR,details:t,fatal:!1,interstitial:e,url:r,error:n,networkDetails:i,stats:s}}}function Ga(e){var t;null==e||null==(t=e.play())||t.catch((()=>{}))}function Ha(e,t){return`[${e}] Advancing timeline position to ${t}`}class ja{constructor(e){this.buffered=void 0;const t=(t,n,r)=>{if((n>>>=0)>r-1)throw new DOMException(`Failed to execute '${t}' on 'TimeRanges': The index provided (${n}) is greater than the maximum bound (${r})`);return e[n][t]};this.buffered={get length(){return e.length},end:n=>t("end",n,e.length),start:n=>t("start",n,e.length)}}}const Wa={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,128:174,129:176,130:189,131:191,132:8482,133:162,134:163,135:9834,136:224,137:32,138:232,139:226,140:234,141:238,142:244,143:251,144:193,145:201,146:211,147:218,148:220,149:252,150:8216,151:161,152:42,153:8217,154:9473,155:169,156:8480,157:8226,158:8220,159:8221,160:192,161:194,162:199,163:200,164:202,165:203,166:235,167:206,168:207,169:239,170:212,171:217,172:249,173:219,174:171,175:187,176:195,177:227,178:205,179:204,180:236,181:210,182:242,183:213,184:245,185:123,186:125,187:92,188:94,189:95,190:124,191:8764,192:196,193:228,194:214,195:246,196:223,197:165,198:164,199:9475,200:197,201:229,202:216,203:248,204:9487,205:9491,206:9495,207:9499},Ka=e=>String.fromCharCode(Wa[e]||e),Va=15,qa=100,Ya={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},za={17:2,18:4,21:6,22:8,23:10,19:13,20:15},Ja={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},Xa={25:2,26:4,29:6,30:8,31:10,27:13,28:15},Qa=["white","green","blue","cyan","red","yellow","magenta","black","transparent"];class Za{constructor(){this.time=null,this.verboseLevel=0}log(e,t){if(this.verboseLevel>=e){const n="function"==typeof t?t():t;k.log(`${this.time} [${e}] ${n}`)}}}const eo=function(e){const t=[];for(let n=0;n<e.length;n++)t.push(e[n].toString(16));return t};class to{constructor(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1}reset(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1}setStyles(e){const t=["foreground","underline","italics","background","flash"];for(let n=0;n<t.length;n++){const r=t[n];e.hasOwnProperty(r)&&(this[r]=e[r])}}isDefault(){return"white"===this.foreground&&!this.underline&&!this.italics&&"black"===this.background&&!this.flash}equals(e){return this.foreground===e.foreground&&this.underline===e.underline&&this.italics===e.italics&&this.background===e.background&&this.flash===e.flash}copy(e){this.foreground=e.foreground,this.underline=e.underline,this.italics=e.italics,this.background=e.background,this.flash=e.flash}toString(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash}}class no{constructor(){this.uchar=" ",this.penState=new to}reset(){this.uchar=" ",this.penState.reset()}setChar(e,t){this.uchar=e,this.penState.copy(t)}setPenState(e){this.penState.copy(e)}equals(e){return this.uchar===e.uchar&&this.penState.equals(e.penState)}copy(e){this.uchar=e.uchar,this.penState.copy(e.penState)}isEmpty(){return" "===this.uchar&&this.penState.isDefault()}}class ro{constructor(e){this.chars=[],this.pos=0,this.currPenState=new to,this.cueStartTime=null,this.logger=void 0;for(let e=0;e<qa;e++)this.chars.push(new no);this.logger=e}equals(e){for(let t=0;t<qa;t++)if(!this.chars[t].equals(e.chars[t]))return!1;return!0}copy(e){for(let t=0;t<qa;t++)this.chars[t].copy(e.chars[t])}isEmpty(){let e=!0;for(let t=0;t<qa;t++)if(!this.chars[t].isEmpty()){e=!1;break}return e}setCursor(e){this.pos!==e&&(this.pos=e),this.pos<0?(this.logger.log(3,"Negative cursor position "+this.pos),this.pos=0):this.pos>qa&&(this.logger.log(3,"Too large cursor position "+this.pos),this.pos=qa)}moveCursor(e){const t=this.pos+e;if(e>1)for(let e=this.pos+1;e<t+1;e++)this.chars[e].setPenState(this.currPenState);this.setCursor(t)}backSpace(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)}insertChar(e){e>=144&&this.backSpace();const t=Ka(e);this.pos>=qa?this.logger.log(0,(()=>"Cannot insert "+e.toString(16)+" ("+t+") at position "+this.pos+". Skipping it!")):(this.chars[this.pos].setChar(t,this.currPenState),this.moveCursor(1))}clearFromPos(e){let t;for(t=e;t<qa;t++)this.chars[t].reset()}clear(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()}clearToEndOfRow(){this.clearFromPos(this.pos)}getTextString(){const e=[];let t=!0;for(let n=0;n<qa;n++){const r=this.chars[n].uchar;" "!==r&&(t=!1),e.push(r)}return t?"":e.join("")}setPenStyles(e){this.currPenState.setStyles(e);this.chars[this.pos].setPenState(this.currPenState)}}class so{constructor(e){this.rows=[],this.currRow=14,this.nrRollUpRows=null,this.lastOutputScreen=null,this.logger=void 0;for(let t=0;t<Va;t++)this.rows.push(new ro(e));this.logger=e}reset(){for(let e=0;e<Va;e++)this.rows[e].clear();this.currRow=14}equals(e){let t=!0;for(let n=0;n<Va;n++)if(!this.rows[n].equals(e.rows[n])){t=!1;break}return t}copy(e){for(let t=0;t<Va;t++)this.rows[t].copy(e.rows[t])}isEmpty(){let e=!0;for(let t=0;t<Va;t++)if(!this.rows[t].isEmpty()){e=!1;break}return e}backSpace(){this.rows[this.currRow].backSpace()}clearToEndOfRow(){this.rows[this.currRow].clearToEndOfRow()}insertChar(e){this.rows[this.currRow].insertChar(e)}setPen(e){this.rows[this.currRow].setPenStyles(e)}moveCursor(e){this.rows[this.currRow].moveCursor(e)}setCursor(e){this.logger.log(2,"setCursor: "+e);this.rows[this.currRow].setCursor(e)}setPAC(e){this.logger.log(2,(()=>"pacData = "+rt(e)));let t=e.row-1;if(this.nrRollUpRows&&t<this.nrRollUpRows-1&&(t=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==t){for(let e=0;e<Va;e++)this.rows[e].clear();const e=this.currRow+1-this.nrRollUpRows,n=this.lastOutputScreen;if(n){const r=n.rows[e].cueStartTime,s=this.logger.time;if(null!==r&&null!==s&&r<s)for(let r=0;r<this.nrRollUpRows;r++)this.rows[t-this.nrRollUpRows+r+1].copy(n.rows[e+r])}}this.currRow=t;const n=this.rows[this.currRow];if(null!==e.indent){const t=e.indent,r=Math.max(t-1,0);n.setCursor(e.indent),e.color=n.chars[r].penState.foreground}const r={foreground:e.color,underline:e.underline,italics:e.italics,background:"black",flash:!1};this.setPen(r)}setBkgData(e){this.logger.log(2,(()=>"bkgData = "+rt(e))),this.backSpace(),this.setPen(e),this.insertChar(32)}setRollUpRows(e){this.nrRollUpRows=e}rollUp(){if(null===this.nrRollUpRows)return void this.logger.log(3,"roll_up but nrRollUpRows not set yet");this.logger.log(1,(()=>this.getDisplayText()));const e=this.currRow+1-this.nrRollUpRows,t=this.rows.splice(e,1)[0];t.clear(),this.rows.splice(this.currRow,0,t),this.logger.log(2,"Rolling up")}getDisplayText(e){e=e||!1;const t=[];let n="",r=-1;for(let n=0;n<Va;n++){const s=this.rows[n].getTextString();s&&(r=n+1,e?t.push("Row "+r+": '"+s+"'"):t.push(s.trim()))}return t.length>0&&(n=e?"["+t.join(" | ")+"]":t.join("\n")),n}getTextAndFormat(){return this.rows}}class io{constructor(e,t,n){this.chNr=void 0,this.outputFilter=void 0,this.mode=void 0,this.verbose=void 0,this.displayedMemory=void 0,this.nonDisplayedMemory=void 0,this.lastOutputScreen=void 0,this.currRollUpRow=void 0,this.writeScreen=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chNr=e,this.outputFilter=t,this.mode=null,this.verbose=0,this.displayedMemory=new so(n),this.nonDisplayedMemory=new so(n),this.lastOutputScreen=new so(n),this.currRollUpRow=this.displayedMemory.rows[14],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=n}reset(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[14],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null}getHandler(){return this.outputFilter}setHandler(e){this.outputFilter=e}setPAC(e){this.writeScreen.setPAC(e)}setBkgData(e){this.writeScreen.setBkgData(e)}setMode(e){e!==this.mode&&(this.mode=e,this.logger.log(2,(()=>"MODE="+e)),"MODE_POP-ON"===this.mode?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),"MODE_ROLL-UP"!==this.mode&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=e)}insertChars(e){for(let t=0;t<e.length;t++)this.writeScreen.insertChar(e[t]);const t=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(2,(()=>t+": "+this.writeScreen.getDisplayText(!0))),"MODE_PAINT-ON"!==this.mode&&"MODE_ROLL-UP"!==this.mode||(this.logger.log(1,(()=>"DISPLAYED: "+this.displayedMemory.getDisplayText(!0))),this.outputDataUpdate())}ccRCL(){this.logger.log(2,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")}ccBS(){this.logger.log(2,"BS - BackSpace"),"MODE_TEXT"!==this.mode&&(this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate())}ccAOF(){}ccAON(){}ccDER(){this.logger.log(2,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()}ccRU(e){this.logger.log(2,"RU("+e+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(e)}ccFON(){this.logger.log(2,"FON - Flash On"),this.writeScreen.setPen({flash:!0})}ccRDC(){this.logger.log(2,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")}ccTR(){this.logger.log(2,"TR"),this.setMode("MODE_TEXT")}ccRTD(){this.logger.log(2,"RTD"),this.setMode("MODE_TEXT")}ccEDM(){this.logger.log(2,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)}ccCR(){this.logger.log(2,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)}ccENM(){this.logger.log(2,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()}ccEOC(){if(this.logger.log(2,"EOC - End Of Caption"),"MODE_POP-ON"===this.mode){const e=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=e,this.writeScreen=this.nonDisplayedMemory,this.logger.log(1,(()=>"DISP: "+this.displayedMemory.getDisplayText()))}this.outputDataUpdate(!0)}ccTO(e){this.logger.log(2,"TO("+e+") - Tab Offset"),this.writeScreen.moveCursor(e)}ccMIDROW(e){const t={flash:!1};if(t.underline=e%2==1,t.italics=e>=46,t.italics)t.foreground="white";else{const n=Math.floor(e/2)-16,r=["white","green","blue","cyan","red","yellow","magenta"];t.foreground=r[n]}this.logger.log(2,"MIDROW: "+rt(t)),this.writeScreen.setPen(t)}outputDataUpdate(e=!1){const t=this.logger.time;null!==t&&this.outputFilter&&(null!==this.cueStartTime||this.displayedMemory.isEmpty()?this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,t,this.lastOutputScreen),e&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:t):this.cueStartTime=t,this.lastOutputScreen.copy(this.displayedMemory))}cueSplitAtTime(e){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,e,this.displayedMemory),this.cueStartTime=e))}}class ao{constructor(e,t,n){this.channels=void 0,this.currentChannel=0,this.cmdHistory={a:null,b:null},this.logger=void 0;const r=this.logger=new Za;this.channels=[null,new io(e,t,r),new io(e+1,n,r)]}getHandler(e){return this.channels[e].getHandler()}setHandler(e,t){this.channels[e].setHandler(t)}addData(e,t){this.logger.time=e;for(let e=0;e<t.length;e+=2){const n=127&t[e],r=127&t[e+1];let s=!1,i=null;if(0===n&&0===r)continue;this.logger.log(3,(()=>"["+eo([t[e],t[e+1]])+"] -> ("+eo([n,r])+")"));const a=this.cmdHistory;if(n>=16&&n<=31){if(lo(n,r,a)){oo(null,null,a),this.logger.log(3,(()=>"Repeated command ("+eo([n,r])+") is dropped"));continue}oo(n,r,this.cmdHistory),s=this.parseCmd(n,r),s||(s=this.parseMidrow(n,r)),s||(s=this.parsePAC(n,r)),s||(s=this.parseBackgroundAttributes(n,r))}else oo(null,null,a);if(!s&&(i=this.parseChars(n,r),i)){const e=this.currentChannel;if(e&&e>0){this.channels[e].insertChars(i)}else this.logger.log(2,"No channel found yet. TEXT-MODE?")}s||i||this.logger.log(2,(()=>"Couldn't parse cleaned data "+eo([n,r])+" orig: "+eo([t[e],t[e+1]])))}}parseCmd(e,t){if(!((20===e||28===e||21===e||29===e)&&t>=32&&t<=47)&&!((23===e||31===e)&&t>=33&&t<=35))return!1;const n=20===e||21===e||23===e?1:2,r=this.channels[n];return 20===e||21===e||28===e||29===e?32===t?r.ccRCL():33===t?r.ccBS():34===t?r.ccAOF():35===t?r.ccAON():36===t?r.ccDER():37===t?r.ccRU(2):38===t?r.ccRU(3):39===t?r.ccRU(4):40===t?r.ccFON():41===t?r.ccRDC():42===t?r.ccTR():43===t?r.ccRTD():44===t?r.ccEDM():45===t?r.ccCR():46===t?r.ccENM():47===t&&r.ccEOC():r.ccTO(t-32),this.currentChannel=n,!0}parseMidrow(e,t){let n=0;if((17===e||25===e)&&t>=32&&t<=47){if(n=17===e?1:2,n!==this.currentChannel)return this.logger.log(0,"Mismatch channel in midrow parsing"),!1;const r=this.channels[n];return!!r&&(r.ccMIDROW(t),this.logger.log(3,(()=>"MIDROW ("+eo([e,t])+")")),!0)}return!1}parsePAC(e,t){let n;if(!((e>=17&&e<=23||e>=25&&e<=31)&&t>=64&&t<=127)&&!((16===e||24===e)&&t>=64&&t<=95))return!1;const r=e<=23?1:2;n=t>=64&&t<=95?1===r?Ya[e]:Ja[e]:1===r?za[e]:Xa[e];const s=this.channels[r];return!!s&&(s.setPAC(this.interpretPAC(n,t)),this.currentChannel=r,!0)}interpretPAC(e,t){let n;const r={color:null,italics:!1,indent:null,underline:!1,row:e};return n=t>95?t-96:t-64,r.underline=!(1&~n),n<=13?r.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(n/2)]:n<=15?(r.italics=!0,r.color="white"):r.indent=4*Math.floor((n-16)/2),r}parseChars(e,t){let n,r=null,s=null;if(e>=25?(n=2,s=e-8):(n=1,s=e),s>=17&&s<=19){let e;e=17===s?t+80:18===s?t+112:t+144,this.logger.log(2,(()=>"Special char '"+Ka(e)+"' in channel "+n)),r=[e]}else e>=32&&e<=127&&(r=0===t?[e]:[e,t]);return r&&this.logger.log(3,(()=>"Char codes =  "+eo(r).join(","))),r}parseBackgroundAttributes(e,t){if(!((16===e||24===e)&&t>=32&&t<=47)&&!((23===e||31===e)&&t>=45&&t<=47))return!1;let n;const r={};16===e||24===e?(n=Math.floor((t-32)/2),r.background=Qa[n],t%2==1&&(r.background=r.background+"_semi")):45===t?r.background="transparent":(r.foreground="black",47===t&&(r.underline=!0));const s=e<=23?1:2;return this.channels[s].setBkgData(r),!0}reset(){for(let e=0;e<Object.keys(this.channels).length;e++){const t=this.channels[e];t&&t.reset()}oo(null,null,this.cmdHistory)}cueSplitAtTime(e){for(let t=0;t<this.channels.length;t++){const n=this.channels[t];n&&n.cueSplitAtTime(e)}}}function oo(e,t,n){n.a=e,n.b=t}function lo(e,t,n){return n.a===e&&n.b===t}var co=function(){if(null!=bn&&bn.VTTCue)return self.VTTCue;const e=["","lr","rl"],t=["start","middle","end","left","right"];function n(e,t){if("string"!=typeof t)return!1;if(!Array.isArray(e))return!1;const n=t.toLowerCase();return!!~e.indexOf(n)&&n}function r(e){return n(t,e)}function s(e,...t){let n=1;for(;n<arguments.length;n++){const t=arguments[n];for(const n in t)e[n]=t[n]}return e}function i(t,i,a){const o=this,l={enumerable:!0};o.hasBeenReset=!1;let c="",u=!1,d=t,h=i,f=a,p=null,g="",m=!0,_="auto",T="start",E=50,y="middle",S=50,v="middle";Object.defineProperty(o,"id",s({},l,{get:function(){return c},set:function(e){c=""+e}})),Object.defineProperty(o,"pauseOnExit",s({},l,{get:function(){return u},set:function(e){u=!!e}})),Object.defineProperty(o,"startTime",s({},l,{get:function(){return d},set:function(e){if("number"!=typeof e)throw new TypeError("Start time must be set to a number.");d=e,this.hasBeenReset=!0}})),Object.defineProperty(o,"endTime",s({},l,{get:function(){return h},set:function(e){if("number"!=typeof e)throw new TypeError("End time must be set to a number.");h=e,this.hasBeenReset=!0}})),Object.defineProperty(o,"text",s({},l,{get:function(){return f},set:function(e){f=""+e,this.hasBeenReset=!0}})),Object.defineProperty(o,"region",s({},l,{get:function(){return p},set:function(e){p=e,this.hasBeenReset=!0}})),Object.defineProperty(o,"vertical",s({},l,{get:function(){return g},set:function(t){const r=function(t){return n(e,t)}(t);if(!1===r)throw new SyntaxError("An invalid or illegal string was specified.");g=r,this.hasBeenReset=!0}})),Object.defineProperty(o,"snapToLines",s({},l,{get:function(){return m},set:function(e){m=!!e,this.hasBeenReset=!0}})),Object.defineProperty(o,"line",s({},l,{get:function(){return _},set:function(e){if("number"!=typeof e&&"auto"!==e)throw new SyntaxError("An invalid number or illegal string was specified.");_=e,this.hasBeenReset=!0}})),Object.defineProperty(o,"lineAlign",s({},l,{get:function(){return T},set:function(e){const t=r(e);if(!t)throw new SyntaxError("An invalid or illegal string was specified.");T=t,this.hasBeenReset=!0}})),Object.defineProperty(o,"position",s({},l,{get:function(){return E},set:function(e){if(e<0||e>100)throw new Error("Position must be between 0 and 100.");E=e,this.hasBeenReset=!0}})),Object.defineProperty(o,"positionAlign",s({},l,{get:function(){return y},set:function(e){const t=r(e);if(!t)throw new SyntaxError("An invalid or illegal string was specified.");y=t,this.hasBeenReset=!0}})),Object.defineProperty(o,"size",s({},l,{get:function(){return S},set:function(e){if(e<0||e>100)throw new Error("Size must be between 0 and 100.");S=e,this.hasBeenReset=!0}})),Object.defineProperty(o,"align",s({},l,{get:function(){return v},set:function(e){const t=r(e);if(!t)throw new SyntaxError("An invalid or illegal string was specified.");v=t,this.hasBeenReset=!0}})),o.displayState=void 0}return i.prototype.getCueAsHTML=function(){return self.WebVTT.convertCueToDOMTree(self,this.text)},i}();class uo{decode(e,t){if(!e)return"";if("string"!=typeof e)throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))}}function ho(e){function t(e,t,n,r){return 3600*(0|e)+60*(0|t)+(0|n)+parseFloat(r||0)}const n=e.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return n?parseFloat(n[2])>59?t(n[2],n[3],0,n[4]):t(n[1],n[2],n[3],n[4]):null}class fo{constructor(){this.values=Object.create(null)}set(e,t){this.get(e)||""===t||(this.values[e]=t)}get(e,t,n){return n?this.has(e)?this.values[e]:t[n]:this.has(e)?this.values[e]:t}has(e){return e in this.values}alt(e,t,n){for(let r=0;r<n.length;++r)if(t===n[r]){this.set(e,t);break}}integer(e,t){/^-?\d+$/.test(t)&&this.set(e,parseInt(t,10))}percent(e,t){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(t)){const n=parseFloat(t);if(n>=0&&n<=100)return this.set(e,n),!0}return!1}}function po(e,t,n,r){const s=r?e.split(r):[e];for(const e in s){if("string"!=typeof s[e])continue;const r=s[e].split(n);if(2!==r.length)continue;t(r[0],r[1])}}const go=new co(0,0,""),mo="middle"===go.align?"middle":"center";function _o(e,t,n){const r=e;function s(){const t=ho(e);if(null===t)throw new Error("Malformed timestamp: "+r);return e=e.replace(/^[^\sa-zA-Z-]+/,""),t}function i(){e=e.replace(/^\s+/,"")}if(i(),t.startTime=s(),i(),"--\x3e"!==e.slice(0,3))throw new Error("Malformed time stamp (time stamps must be separated by '--\x3e'): "+r);e=e.slice(3),i(),t.endTime=s(),i(),function(e,t){const r=new fo;po(e,(function(e,t){let s;switch(e){case"region":for(let s=n.length-1;s>=0;s--)if(n[s].id===t){r.set(e,n[s].region);break}break;case"vertical":r.alt(e,t,["rl","lr"]);break;case"line":s=t.split(","),r.integer(e,s[0]),r.percent(e,s[0])&&r.set("snapToLines",!1),r.alt(e,s[0],["auto"]),2===s.length&&r.alt("lineAlign",s[1],["start",mo,"end"]);break;case"position":s=t.split(","),r.percent(e,s[0]),2===s.length&&r.alt("positionAlign",s[1],["start",mo,"end","line-left","line-right","auto"]);break;case"size":r.percent(e,t);break;case"align":r.alt(e,t,["start",mo,"end","left","right"])}}),/:/,/\s/),t.region=r.get("region",null),t.vertical=r.get("vertical","");let s=r.get("line","auto");"auto"===s&&-1===go.line&&(s=-1),t.line=s,t.lineAlign=r.get("lineAlign","start"),t.snapToLines=r.get("snapToLines",!0),t.size=r.get("size",100),t.align=r.get("align",mo);let i=r.get("position","auto");"auto"===i&&50===go.position&&(i="start"===t.align||"left"===t.align?0:"end"===t.align||"right"===t.align?100:50),t.position=i}(e,t)}function To(e){return e.replace(/<br(?: \/)?>/gi,"\n")}class Eo{constructor(){this.state="INITIAL",this.buffer="",this.decoder=new uo,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}parse(e){const t=this;function n(){let e=t.buffer,n=0;for(e=To(e);
vendor: 4,645 bytes, line 1
1n<e.length&&"\r"!==e[n]&&"\n"!==e[n];)++n;const r=e.slice(0,n);return"\r"===e[n]&&++n,"\n"===e[n]&&++n,t.buffer=e.slice(n),r}e&&(t.buffer+=t.decoder.decode(e,{stream:!0}));try{let e="";if("INITIAL"===t.state){if(!/\r\n|\n/.test(t.buffer))return this;e=n();const r=e.match(/^()?WEBVTT([ \t].*)?$/);if(null==r||!r[0])throw new Error("Malformed WebVTT signature.");t.state="HEADER"}let r=!1;for(;t.buffer;){if(!/\r\n|\n/.test(t.buffer))return this;switch(r?r=!1:e=n(),t.state){case"HEADER":/:/.test(e)?po(e,(function(e,t){}),/:/):e||(t.state="ID");continue;case"NOTE":e||(t.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(e)){t.state="NOTE";break}if(!e)continue;if(t.cue=new co(0,0,""),t.state="CUE",-1===e.indexOf("--\x3e")){t.cue.id=e;continue}case"CUE":if(!t.cue){t.state="BADCUE";continue}try{_o(e,t.cue,t.regionList)}catch(e){t.cue=null,t.state="BADCUE";continue}t.state="CUETEXT";continue;case"CUETEXT":{const n=-1!==e.indexOf("--\x3e");if(!e||n&&(r=!0)){t.oncue&&t.cue&&t.oncue(t.cue),t.cue=null,t.state="ID";continue}if(null===t.cue)continue;t.cue.text&&(t.cue.text+="\n"),t.cue.text+=e}continue;case"BADCUE":e||(t.state="ID")}}}catch(e){"CUETEXT"===t.state&&t.cue&&t.oncue&&t.oncue(t.cue),t.cue=null,t.state="INITIAL"===t.state?"BADWEBVTT":"BADCUE"}return this}flush(){const e=this;try{if((e.cue||"HEADER"===e.state)&&(e.buffer+="\n\n",e.parse()),"INITIAL"===e.state||"BADWEBVTT"===e.state)throw new Error("Malformed WebVTT signature.")}catch(t){e.onparsingerror&&e.onparsingerror(t)}return e.onflush&&e.onflush(),this}}const yo=/\r\n|\n\r|\n|\r/g,So=function(e,t,n=0){return e.slice(n,n+t.length)===t};function vo(e,t,n){return ka(e.toString())+ka(t.toString())+ka(n)}function bo(e,t,n,s,i,a,o){const l=new Eo,c=N(new Uint8Array(e)).trim().replace(yo,"\n").split("\n"),u=[],d=t?function(e,t=1){return Ks(e,9e4,1/t)}(t.baseTime,t.timescale):0;let h,f="00:00.000",p=0,g=0,m=!0;l.oncue=function(e){const r=n[s];let a=n.ccOffset;const o=(p-d)/9e4;if(null!=r&&r.new&&(void 0!==g?a=n.ccOffset=r.start:function(e,t,n){let r=e[t],s=e[r.prevCC];if(!s||!s.new&&r.new)return e.ccOffset=e.presentationOffset=r.start,void(r.new=!1);for(;null!=(i=s)&&i.new;){var i;e.ccOffset+=r.start-s.start,r.new=!1,r=s,s=e[r.prevCC]}e.presentationOffset=n}(n,s,o)),o){if(!t)return void(h=new Error("Missing initPTS for VTT MPEGTS"));a=o-n.presentationOffset}const l=e.endTime-e.startTime,c=Zs(9e4*(e.startTime+a-g),9e4*i)/9e4;e.startTime=Math.max(c,0),e.endTime=Math.max(c+l,0);const f=e.text.trim();e.text=decodeURIComponent(encodeURIComponent(f)),e.id||(e.id=vo(e.startTime,e.endTime,f)),e.endTime>0&&u.push(e)},l.onparsingerror=function(e){h=e},l.onflush=function(){h?o(h):a(u)},c.forEach((e=>{if(m){if(So(e,"X-TIMESTAMP-MAP=")){m=!1,e.slice(16).split(",").forEach((e=>{So(e,"LOCAL:")?f=e.slice(6):So(e,"MPEGTS:")&&(p=parseInt(e.slice(7)))}));try{g=function(e){let t=parseInt(e.slice(-3));const n=parseInt(e.slice(-6,-4)),s=parseInt(e.slice(-9,-7)),i=e.length>9?parseInt(e.substring(0,e.indexOf(":"))):0;if(!(r(t)&&r(n)&&r(s)&&r(i)))throw Error(`Malformed X-TIMESTAMP-MAP: Local:${e}`);return t+=1e3*n,t+=6e4*s,t+=36e5*i,t}(f)/1e3}catch(e){h=e}return}""===e&&(m=!1)}l.parse(e+"\n")})),l.flush()}const Io="stpp.ttml.im1t",Ao=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,Ro=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,Co={left:"start",center:"center",right:"end",start:"start",end:"end"};function ko(e,t,n,r){const s=ae(new Uint8Array(e),["mdat"]);if(0===s.length)return void r(new Error("Could not parse IMSC1 mdat"));const i=s.map((e=>N(e))),a=function(e,t,n=1,r=!1){return Ks(e,t,1/n,r)}(t.baseTime,1,t.timescale);try{i.forEach((e=>n(function(e,t){const n=(new DOMParser).parseFromString(e,"text/xml"),r=n.getElementsByTagName("tt")[0];if(!r)throw new Error("Invalid ttml");const s={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},i=Object.keys(s).reduce(((e,t)=>(e[t]=r.getAttribute(`ttp:${t}`)||s[t],e)),{}),a="preserve"!==r.getAttribute("xml:space"),o=Oo(Lo(r,"styling","style")),l=Oo(Lo(r,"layout","region")),c=Lo(r,"body","[begin]");return[].map.call(c,(e=>{const n=No(e,a);if(!n||!e.hasAttribute("begin"))return null;const r=Mo(e.getAttribute("begin"),i),s=Mo(e.getAttribute("dur"),i);let c=Mo(e.getAttribute("end"),i);if(null===r)throw Po(e);if(null===c){if(null===s)throw Po(e);c=r+s}const u=new co(r-t,c-t,n);u.id=vo(u.startTime,u.endTime,u.text);const d=function(e,t,n){const r="http://www.w3.org/ns/ttml#styling";let s=null;const i=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"],a=null!=e&&e.hasAttribute("style")?e.getAttribute("style"):null;a&&n.hasOwnProperty(a)&&(s=n[a]);return i.reduce(((n,i)=>
1{const a=wo(t,r,i)||wo(e,r,i)||wo(s,r,i);return a&&(n[i]=a),n}),{})}(l[e.getAttribute("region")],o[e.getAttribute("style")],o),{textAlign:h}=d;if(h){const e=Co[h];e&&(u.lineAlign=e),u.align=h}return E(u,d),u})).filter((e=>null!==e))}(e,a))))}catch(e){r(e)}}function Lo(e,t,n){const r=e.getElementsByTagName(t)[0];return r?[].slice.call(r.querySelectorAll(n)):[]}function Oo(e){return e.reduce(((e,t)=>{const n=t.getAttribute("xml:id");return n&&(e[n]=t),e}),{})}function No(e,t){return[].slice.call(e.childNodes).reduce(((e,n,r)=>{var s;return"br"===n.nodeName&&r?e+"\n":null!=(s=n.childNodes)&&s.length?No(n,t):t?e+n.textContent.trim().replace(/\s+/g," "):e+n.textContent}),"")}function wo(e,t,n){return e&&e.hasAttributeNS(t,n)?e.getAttributeNS(t,n):null}function Po(e){return new Error(`Could not parse ttml timestamp ${e}`)}function Mo(e,t){if(!e)return null;let n=ho(e);return null===n&&(Ao.test(e)?n=function(e,t){const n=Ao.exec(e),r=(0|n[4])+(0|n[5])/t.subFrameRate;return 3600*(0|n[1])+60*(0|n[2])+(0|n[3])+r/t.frameRate}(e,t):Ro.test(e)&&(n=function(e,t){const n=Ro.exec(e),r=Number(n[1]);switch(n[2]){case"h":return 3600*r;case"m":return 60*r;case"ms":return 1e3*r;case"f":return r/t.frameRate;case"t":return r/t.tickRate}return r}(e,t))),n}class Do{constructor(e,t){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=e,this.trackName=t}dispatchCue(){null!==this.startTime&&(this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null)}newCue(e,t,n){(null===this.startTime||this.startTime>e)&&(this.startTime=e),this.endTime=t,this.screen=n,this.timelineController.createCaptionsTrack(this.trackName)}reset(){this.cueRanges=[],this.startTime=null}}function xo(e){return e.characteristics&&/transcribes-spoken-dialog/gi.test(e.characteristics)&&/describes-music-and-sound/gi.test(e.characteristics)?"captions":"subtitles"}function Uo(e,t){return!!e&&e.kind===xo(t)&&gi(t,e)}const Bo=/\s/,Fo={newCue(e,t,n,r){const s=[];let i,a,o,l,c;const u=self.VTTCue||self.TextTrackCue;for(let h=0;h<r.rows.length;h++)if(i=r.rows[h],o=!0,l=0,c="",!i.isEmpty()){var d;for(let e=0;e<i.chars.length;e++)Bo.test(i.chars[e].uchar)&&o?l++:(c+=i.chars[e].uchar,o=!1);i.cueStartTime=t,t===n&&(n+=1e-4),l>=16?l--:l++;const r=To(c.trim()),f=vo(t,n,r);null!=e&&null!=(d=e.cues)&&d.getCueById(f)||(a=new u(t,n,r),a.id=f,a.line=h+1,a.align="left",a.position=10+Math.min(80,10*Math.floor(8*l/32)),s.push(a))}return e&&s.length&&(s.sort(((e,t)=>"auto"===e.line||"auto"===t.line?0:e.line>8&&t.line>
vendor: 17,706 bytes, line 1
18?t.line-e.line:e.line-t.line)),s.forEach((t=>Ia(e,t)))),s}};const $o=/(\d+)-(\d+)\/(\d+)/;class Go{constructor(e){this.fetchSetup=void 0,this.requestTimeout=void 0,this.request=null,this.response=null,this.controller=void 0,this.context=null,this.config=null,this.callbacks=null,this.stats=void 0,this.loader=null,this.fetchSetup=e.fetchSetup||Ho,this.controller=new self.AbortController,this.stats=new j}destroy(){this.loader=this.callbacks=this.context=this.config=this.request=null,this.abortInternal(),this.response=null,this.fetchSetup=this.controller=this.stats=null}abortInternal(){this.controller&&!this.stats.loading.end&&(this.stats.aborted=!0,this.controller.abort())}abort(){var e;this.abortInternal(),null!=(e=this.callbacks)&&e.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)}load(e,t,n){const s=this.stats;if(s.loading.start)throw new Error("Loader can only be used once.");s.loading.start=self.performance.now();const i=function(e,t){const n={method:"GET",mode:"cors",credentials:"same-origin",signal:t,headers:new self.Headers(E({},e.headers))};e.rangeEnd&&n.headers.set("Range","bytes="+e.rangeStart+"-"+String(e.rangeEnd-1));return n}(e,this.controller.signal),a="arraybuffer"===e.responseType,o=a?"byteLength":"length",{maxTimeToFirstByteMs:l,maxLoadTimeMs:c}=t.loadPolicy;this.context=e,this.config=t,this.callbacks=n,this.request=this.fetchSetup(e,i),self.clearTimeout(this.requestTimeout),t.timeout=l&&r(l)?l:c,this.requestTimeout=self.setTimeout((()=>{this.callbacks&&(this.abortInternal(),this.callbacks.onTimeout(s,e,this.response))}),t.timeout);(oi(this.request)?this.request.then(self.fetch):self.fetch(this.request)).then((n=>{var i;this.response=this.loader=n;const o=Math.max(self.performance.now(),s.loading.start);if(self.clearTimeout(this.requestTimeout),t.timeout=c,this.requestTimeout=self.setTimeout((()=>{this.callbacks&&(this.abortInternal(),this.callbacks.onTimeout(s,e,this.response))}),c-(o-s.loading.start)),!n.ok){const{status:e,statusText:t}=n;throw new jo(t||"fetch, bad network response",e,n)}s.loading.first=o,s.total=function(e){const t=e.get("Content-Range");if(t){const e=function(e){const t=$o.exec(e);if(t)return parseInt(t[2])-parseInt(t[1])+1}(t);if(r(e))return e}const n=e.get("Content-Length");if(n)return parseInt(n)}(n.headers)||s.total;const l=null==(i=this.callbacks)?void 0:i.onProgress;return l&&r(t.highWaterMark)?this.loadProgressively(n,s,e,t.highWaterMark,l):a?n.arrayBuffer():"json"===e.responseType?n.json():n.text()})).then((n=>{var i,a;const l=this.response;if(!l)throw new Error("loader destroyed");self.clearTimeout(this.requestTimeout),s.loading.end=Math.max(self.performance.now(),s.loading.first);const c=n[o];c&&(s.loaded=s.total=c);const u={url:l.url,data:n,code:l.status},d=null==(i=this.callbacks)?void 0:i.onProgress;d&&!r(t.highWaterMark)&&d(s,e,n,l),null==(a=this.callbacks)||a.onSuccess(u,s,e,l)})).catch((t=>{var n;if(self.clearTimeout(this.requestTimeout),s.aborted)return;const r=t&&t.code||0,i=t?t.message:null;null==(n=this.callbacks)||n.onError({code:r,text:i},e,t?t.details:null,s)}))}getCacheAge(){let e=null;if(this.response){const t=this.response.headers.get("age");e=t?parseFloat(t):null}return e}getResponseHeader(e){return this.response?this.response.headers.get(e):null}loadProgressively(e,t,n,r=0,s){const i=new xr,a=e.body.getReader(),o=()=>a.read().then((a=>{if(a.done)return i.dataLength&&s(t,n,i.flush().buffer,e),Promise.resolve(new ArrayBuffer(0));const l=a.value,c=l.length;return t.loaded+=c,c<r||i.dataLength?(i.push(l),i.dataLength>=r&&s(t,n,i.flush().buffer,e)):s(t,n,l.buffer,e),o()})).catch((()=>Promise.reject()));return o()}}function Ho(e,t){return new self.Request(e.url,t)}class jo extends Error{constructor(e,t,n){super(e),this.code=void 0,this.details=void 0,this.code=t,this.details=n}}const Wo=/^age:\s*[\d.]+\s*$/im;class Ko{constructor(e){this.xhrSetup=void 0,this.requestTimeout=void 0,this.retryTimeout=void 0,this.retryDelay=void 0,this.config=null,this.callbacks=null,this.context=null,this.loader=null,this.stats=void 0,this.xhrSetup=e&&e.xhrSetup||null,this.stats=new j,this.retryDelay=0}destroy(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null,this.context=null,this.xhrSetup=null}abortInternal(){const e=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),e&&(e.onreadystatechange=null,e.onprogress=null,4!==e.readyState&&(this.stats.aborted=!0,e.abort()))}abort(){var e;this.abortInternal(),null!=(e=this.callbacks)&&e.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)}load(e,t,n){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=e,this.config=t,this.callbacks=n,this.loadInternal()}loadInternal(){const{config:e,context:t}=this;if(!e||!t)return;const n=this.loader=new self.XMLHttpRequest,r=this.stats;r.loading.first=0,r.loaded=0,r.aborted=!1;const s=this.xhrSetup;s?Promise.resolve().then((()=>{if(this.loader===n&&!this.stats.aborted)return s(n,t.url)})).catch((e=>{if(this.loader===n&&!this.stats.aborted)return n.open("GET",t.url,!0),s(n,t.url)})).then((()=>{this.loader!==n||this.stats.aborted||this.openAndSendXhr(n,t,e)})).catch((e=>{var s;null==(s=this.callbacks)||s.onError({code:n.status,text:e.message},t,n,r)})):this.openAndSendXhr(n,t,e)}openAndSendXhr(e,t,n){e.readyState||e.open("GET",t.url,!0);const s=t.headers,{maxTimeToFirstByteMs:i,maxLoadTimeMs:a}=n.loadPolicy;if(s)for(const t in s)e.setRequestHeader(t,s[t]);t.rangeEnd&&e.setRequestHeader("Range","bytes="+t.rangeStart+"-"+(t.rangeEnd-1)),e.onreadystatechange=this.readystatechange.bind(this),e.onprogress=this.loadprogress.bind(this),e.responseType=t.responseType,self.clearTimeout(this.requestTimeout),n.timeout=i&&r(i)?i:a,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),n.timeout),e.send()}readystatechange(){const{context:e,loader:t,stats:n}=this;if(!e||!t)return;const r=t.readyState,s=this.config;if(!n.aborted&&r>=2&&(0===n.loading.first&&(n.loading.first=Math.max(self.performance.now(),n.loading.start),s.timeout!==s.loadPolicy.maxLoadTimeMs&&(self.clearTimeout(this.requestTimeout),s.timeout=s.loadPolicy.maxLoadTimeMs,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),s.loadPolicy.maxLoadTimeMs-(n.loading.first-n.loading.start)))),4===r)){self.clearTimeout(this.requestTimeout),t.onreadystatechange=null,t.onprogress=null;const r=t.status,l="text"===t.responseType?t.responseText:null;if(r>=200&&r<300){const s=null!=l?l:t.response;if(null!=s){var i,a;n.loading.end=Math.max(self.performance.now(),n.loading.first);const o="arraybuffer"===t.responseType?s.byteLength:s.length;n.loaded=n.total=o,n.bwEstimate=8e3*n.total/(n.loading.end-n.loading.first);const l=null==(i=this.callbacks)?void 0:i.onProgress;l&&l(n,e,s,t);const c={url:t.responseURL,data:s,code:r};return void(null==(a=this.callbacks)||a.onSuccess(c,n,e,t))}}const c=s.loadPolicy.errorRetry;var o;if(bt(c,n.retry,!1,{url:e.url,data:void 0,code:r}))this.retry(c);else k.error(`${r} while loading ${e.url}`),null==(o=this.callbacks)||o.onError({code:r,text:t.statusText},e,t,n)}}loadtimeout(){if(!this.config)return;const e=this.config.loadPolicy.timeoutRetry;if(bt(e,this.stats.retry,!0))this.retry(e);else{var t;k.warn(`timeout while loading ${null==(t=this.context)?void 0:t.url}`);const e=this.callbacks;e&&(this.abortInternal(),e.onTimeout(this.stats,this.context,this.loader))}}retry(e){const{context:t,stats:n}=this;this.retryDelay=St(e,n.retry),n.retry++,k.warn(`${status?"HTTP Status "+status:"Timeout"} while loading ${null==t?void 0:t.url}, retrying ${n.retry}/${e.maxNumRetry} in ${this.retryDelay}ms`),this.abortInternal(),this.loader=null,self.clearTimeout(this.retryTimeout),this.retryTimeout=self.setTimeout(this.loadInternal.bind(this),this.retryDelay)}loadprogress(e){const t=this.stats;t.loaded=e.loaded,e.lengthComputable&&(t.total=e.total)}getCacheAge(){let e=null;if(this.loader&&Wo.test(this.loader.getAllResponseHeaders())){const t=this.loader.getResponseHeader("age");e=t?parseFloat(t):null}return e}getResponseHeader(e){return this.loader&&new RegExp(`^${e}:\\s*[\\d.]+\\s*$`,"im").test(this.loader.getAllResponseHeaders())?this.loader.getResponseHeader(e):null}}const Vo=S(S({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,ignoreDevicePixelRatio:!1,maxDevicePixelRatio:Number.POSITIVE_INFINITY,preferManagedMediaSource:!0,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:1/0,frontBufferFlushThreshold:1/0,startOnSegmentBoundary:!1,maxBufferSize:6e7,maxFragLookUpTolerance:.25,maxBufferHole:.1,detectStallWithCurrentTimeMs:1250,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,nudgeOnVideoHole:!0,liveSyncMode:"edge",liveSyncDurationCount:3,liveSyncOnStallIncrease:1,liveMaxLatencyDurationCount:1/0,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,maxLiveSyncPlaybackRate:1,liveDurationInfinity:!1,liveBackBufferLength:null,maxMaxBufferLength:600,enableWorker:!0,workerPath:null,enableSoftwareAES:!0,startLevel:void 0,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,ignorePlaylistParsingErrors:!1,loader:Ko,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:class extends v{constructor(e){super("abr",e.logger),this.hls=void 0,this.lastLevelLoadSec=0,this.lastLoadedFragLevel=-1,this.firstSelection=-1,this._nextAutoLevel=-1,this.nextAutoLevelKey="",this.audioTracksByGroup=null,this.codecTiers=null,this.timer=-1,this.fragCurrent=null,this.partCurrent=null,this.bitrateTestDelay=0,this.rebufferNotice=-1,this.supportedCache={},this.bwEstimator=void 0,this._abandonRulesCheck=e=>{var t;const{fragCurrent:n,partCurrent:s,hls:i}=this,{autoLevelEnabled:a,media:o}=i;if(!n||!o)return;const c=performance.now(),u=s?s.stats:n.stats,d=s?s.duration:n.duration,h=c-u.loading.start,f=i.minAutoLevel,p=n.level,g=this._nextAutoLevel;if(u.aborted||u.loaded&&u.loaded===u.total||p<=f)return this.clearTimer(),void(this._nextAutoLevel=-1);if(!a)return;const m=g>-1&&g!==p,_=!!e||m;if(!_&&(o.paused||!o.playbackRate||!o.readyState))return;const T=i.mainForwardBufferInfo;if(!_&&null===T)return;const E=this.bwEstimator.getEstimateTTFB(),y=Math.abs(o.playbackRate);if(h<=Math.max(E,d/(2*y)*1e3))return;const S=T?T.len/y:0,v=u.loading.first?u.loading.first-u.loading.start:-1,b=u.loaded&&v>-1,I=this.getBwEstimate(),A=i.levels,R=A[p],C=Math.max(u.loaded,Math.round(d*(n.bitrate||R.averageBitrate)/8));let k=b?h-v:h;k<1&&b&&(k=Math.min(h,8*u.loaded/I));const L=b?1e3*u.loaded/k:0,O=E/1e3,N=L?(C-u.loaded)/L:8*C/I+O;if(N<=S)return;const w=L?8*L:I,P=!0===(null==(t=(null==e?void 0:e.details)||this.hls.latestLevelDetails)?void 0:t.live),M=this.hls.config.abrBandWidthUpFactor;let D,x=Number.POSITIVE_INFINITY;for(D=p-1;D>f;D--){const e=A[D].maxBitrate,t=!A[D].details||P;if(x=this.getTimeToLoadFrag(O,w,d*e,t),x<Math.min(S,d+O))break}if(x>=N)return;if(x>10*d)return;b?this.bwEstimator.sample(h-Math.min(E,v),u.loaded):this.bwEstimator.sampleTTFB(h);const U=A[D].maxBitrate;this.getBwEstimate()*M>U&&this.resetEstimator(U);const B=this.findBestLevel(U,f,D,0,S,1,1);B>-1&&(D=B),this.warn(`Fragment ${n.sn}${s?" part "+s.index:""} of level ${p} is loading too slowly;\n      Fragment duration: ${n.duration.toFixed(3)}\n      Time to underbuffer: ${S.toFixed(3)} s\n      Estimated load time for current fragment: ${N.toFixed(3)} s\n      Estimated load time for down switch fragment: ${x.toFixed(3)} s\n      TTFB estimate: ${0|v} ms\n      Current BW estimate: ${r(I)?0|I:"Unknown"} bps\n      New BW estimate: ${0|this.getBwEstimate()} bps\n      Switching to level ${D} @ ${0|U} bps`),i.nextLoadLevel=i.nextAutoLevel=D,this.clearTimer();const F=()=>{if(this.clearTimer(),this.fragCurrent===n&&this.hls.loadLevel===D&&D>0){const e=this.getStarvationDelay();if(this.warn(`Aborting inflight request ${D>0?"and switching down":""}\n      Fragment duration: ${n.duration.toFixed(3)} s\n      Time to underbuffer: ${e.toFixed(3)} s`),n.abortRequests(),this.fragCurrent=this.partCurrent=null,D>f){let t=this.findBestLevel(this.hls.levels[f].bitrate,f,D,0,e,1,1);-1===t&&(t=f),this.hls.nextLoadLevel=this.hls.nextAutoLevel=t,this.resetEstimator(this.hls.levels[t].bitrate)}}};m||N>2*x?F():this.timer=self.setInterval(F,1e3*x),i.trigger(l.FRAG_LOAD_EMERGENCY_ABORTED,{frag:n,part:s,stats:u})},this.hls=e,this.bwEstimator=this.initEstimator(),this.registerListeners()}resetEstimator(e){e&&(this.log(`setting initial bwe to ${e}`),this.hls.config.abrEwmaDefaultEstimate=e),this.firstSelection=-1,this.bwEstimator=this.initEstimator()}initEstimator(){const e=this.hls.config;return new _(e.abrEwmaSlowVoD,e.abrEwmaFastVoD,e.abrEwmaDefaultEstimate)}registerListeners(){const{hls:e}=this;e.on(l.MANIFEST_LOADING,this.onManifestLoading,this),e.on(l.FRAG_LOADING,this.onFragLoading,this),e.on(l.FRAG_LOADED,this.onFragLoaded,this),e.on(l.FRAG_BUFFERED,this.onFragBuffered,this),e.on(l.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(l.LEVEL_LOADED,this.onLevelLoaded,this),e.on(l.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(l.MAX_AUTO_LEVEL_UPDATED,this.onMaxAutoLevelUpdated,this),e.on(l.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e&&(e.off(l.MANIFEST_LOADING,this.onManifestLoading,this),e.off(l.FRAG_LOADING,this.onFragLoading,this),e.off(l.FRAG_LOADED,this.onFragLoaded,this),e.off(l.FRAG_BUFFERED,this.onFragBuffered,this),e.off(l.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(l.LEVEL_LOADED,this.onLevelLoaded,this),e.off(l.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(l.MAX_AUTO_LEVEL_UPDATED,this.onMaxAutoLevelUpdated,this),e.off(l.ERROR,this.onError,this))}destroy(){this.unregisterListeners(),this.clearTimer(),this.hls=this._abandonRulesCheck=this.supportedCache=null,this.fragCurrent=this.partCurrent=null}onManifestLoading(e,t){this.lastLoadedFragLevel=-1,this.firstSelection=-1,this.lastLevelLoadSec=0,this.supportedCache={},this.fragCurrent=this.partCurrent=null,this.onLevelsUpdated(),this.clearTimer()}onLevelsUpdated(){this.lastLoadedFragLevel>-1&&this.fragCurrent&&(this.lastLoadedFragLevel=this.fragCurrent.level),this._nextAutoLevel=-1,this.onMaxAutoLevelUpdated(),this.codecTiers=null,this.audioTracksByGroup=null}onMaxAutoLevelUpdated(){this.firstSelection=-1,this.nextAutoLevelKey=""}onFragLoading(e,t){const n=t.frag;if(!this.ignoreFragment(n)){var r;if(!n.bitrateTest)this.fragCurrent=n,this.partCurrent=null!=(r=t.part)?r:null;this.clearTimer(),this.timer=self.setInterval(this._abandonRulesCheck,100)}}onLevelSwitching(e,t){this.clearTimer()}onError(e,t){if(!t.fatal)switch(t.details){case o.BUFFER_ADD_CODEC_ERROR:case o.BUFFER_APPEND_ERROR:this.lastLoadedFragLevel=-1,this.firstSelection=-1;break;case o.FRAG_LOAD_TIMEOUT:{const e=t.frag,{fragCurrent:n,partCurrent:r}=this;if(e&&n&&e.sn===n.sn&&e.level===n.level){const t=performance.now(),n=r?r.stats:e.stats,s=t-n.loading.start,i=n.loading.first?n.loading.first-n.loading.start:-1;if(n.loaded&&i>-1){const e=this.bwEstimator.getEstimateTTFB();this.bwEstimator.sample(s-Math.min(e,i),n.loaded)}else this.bwEstimator.sampleTTFB(s)}break}}}getTimeToLoadFrag(e,t,n,r){return e+n/t+(r?e+this.lastLevelLoadSec:0)}onLevelLoaded(e,t){const n=this.hls.config,{loading:s}=t.stats,i=s.end-s.first;r(i)&&(this.lastLevelLoadSec=i/1e3),t.details.live?this.bwEstimator.update(n.abrEwmaSlowLive,n.abrEwmaFastLive):this.bwEstimator.update(n.abrEwmaSlowVoD,n.abrEwmaFastVoD),this.timer>-1&&this._abandonRulesCheck(t.levelInfo)}onFragLoaded(e,{frag:t,part:n}){const r=n?n.stats:t.stats;if(t.type===f&&this.bwEstimator.sampleTTFB(r.loading.first-r.loading.start),!this.ignoreFragment(t)){if(this.clearTimer(),t.level===this._nextAutoLevel&&(this._nextAutoLevel=-1),this.firstSelection=-1,this.hls.config.abrMaxWithRealBitrate){const e=n?n.duration:t.duration,s=this.hls.levels[t.level],i=(s.loaded?s.loaded.bytes:0)+r.loaded,a=(s.loaded?s.loaded.duration:0)+e;s.loaded={bytes:i,duration:a},s.realBitrate=Math.round(8*i/a)}if(t.bitrateTest){const e={stats:r,frag:t,part:n,id:t.type};this.onFragBuffered(l.FRAG_BUFFERED,e),t.bitrateTest=!1}else this.lastLoadedFragLevel=t.level}}onFragBuffered(e,t){const{frag:n,part:r}=t,s=null!=r&&r.stats.loaded?r.stats:n.stats;if(s.aborted)return;if(this.ignoreFragment(n))return;const i=s.parsing.end-s.loading.start-Math.min(s.loading.first-s.loading.start,this.bwEstimator.getEstimateTTFB());this.bwEstimator.sample(i,s.loaded),s.bwEstimate=this.getBwEstimate(),n.bitrateTest?this.bitrateTestDelay=i/1e3:this.bitrateTestDelay=0}ignoreFragment(e){return e.type!==f||"initSegment"===e.sn}clearTimer(){this.timer>-1&&(self.clearInterval(this.timer),this.timer=-1)}get firstAutoLevel(){const{maxAutoLevel:e,minAutoLevel:t}=this.hls,n=this.getBwEstimate(),r=this.hls.config.maxStarvationDelay,s=this.findBestLevel(n,t,e,0,r,1,1);if(s>-1)return s;const i=this.hls.firstLevel,a=Math.min(Math.max(i,t),e);return this.warn(`Could not find best starting auto level. Defaulting to first in playlist ${i} clamped to ${a}`),a}get forcedAutoLevel(){return this.nextAutoLevelKey?-1:this._nextAutoLevel}get nextAutoLevel(){const e=this.forcedAutoLevel,t=this.bwEstimator.canEstimate(),n=this.lastLoadedFragLevel>-1;if(!(-1===e||t&&n&&this.nextAutoLevelKey!==this.getAutoLevelKey()))return e;const r=t&&n?this.getNextABRAutoLevel():this.firstAutoLevel;if(-1!==e){const t=this.hls.levels;if(t.length>Math.max(e,r)&&t[e].loadError<=t[r].loadError)return e}return this._nextAutoLevel=r,this.nextAutoLevelKey=this.getAutoLevelKey(),r}getAutoLevelKey(){return`${this.getBwEstimate()}
1_${this.getStarvationDelay().toFixed(2)}`}getNextABRAutoLevel(){const{fragCurrent:e,partCurrent:t,hls:n}=this;if(n.levels.length<=1)return n.loadLevel;const{maxAutoLevel:r,config:s,minAutoLevel:i}=n,a=t?t.duration:e?e.duration:0,o=this.getBwEstimate(),l=this.getStarvationDelay();let c=s.abrBandWidthFactor,u=s.abrBandWidthUpFactor;if(l){const e=this.findBestLevel(o,i,r,l,0,c,u);if(e>=0)return this.rebufferNotice=-1,e}let d=a?Math.min(a,s.maxStarvationDelay):s.maxStarvationDelay;if(!l){const e=this.bitrateTestDelay;if(e){d=(a?Math.min(a,s.maxLoadingDelay):s.maxLoadingDelay)-e,this.info(`bitrate test took ${Math.round(1e3*e)}ms, set first fragment max fetchDuration to ${Math.round(1e3*d)} ms`),c=u=1}}const h=this.findBestLevel(o,i,r,l,d,c,u);if(this.rebufferNotice!==h&&(this.rebufferNotice=h,this.info(`${l?"rebuffering expected":"buffer is empty"}, optimal quality level ${h}`)),h>-1)return h;const f=n.levels[i],p=n.loadLevelObj;return p&&(null==f?void 0:f.bitrate)<p.bitrate?i:n.loadLevel}getStarvationDelay(){const e=this.hls,t=e.media;if(!t)return 1/0;const n=t&&0!==t.playbackRate?Math.abs(t.playbackRate):1,r=e.mainForwardBufferInfo;return(r?r.len:0)/n}getBwEstimate(){return this.bwEstimator.canEstimate()?this.bwEstimator.getEstimate():this.hls.config.abrEwmaDefaultEstimate}findBestLevel(e,t,n,s,i,a,o){var l;const c=s+i,u=this.lastLoadedFragLevel,d=-1===u?this.hls.firstLevel:u,{fragCurrent:h,partCurrent:f}=this,{levels:p,allAudioTracks:g,loadLevel:m,config:_}=this.hls;if(1===p.length)return 0;const T=p[d],E=!(null==(l=this.hls.latestLevelDetails)||!l.live),y=-1===m||-1===u;let S,v="SDR",b=(null==T?void 0:T.frameRate)||0;const{audioPreference:I,videoPreference:A}=_,R=this.audioTracksByGroup||(this.audioTracksByGroup=it(g));let C=-1;if(y){if(-1!==this.firstSelection)return this.firstSelection;const s=this.codecTiers||(this.codecTiers=function(e,t,n,r){return e.slice(n,r+1).reduce(((e,n,r)=>{if(!n.codecSet)return e;const s=n.audioGroups;let i=e[n.codecSet];i||(e[n.codecSet]=i={minBitrate:1/0,minHeight:1/0,minFramerate:1/0,minIndex:r,maxScore:0,videoRanges:{SDR:0},channels:{2:0},hasDefaultAudio:!s,fragmentError:0}),i.minBitrate=Math.min(i.minBitrate,n.bitrate);const a=Math.min(n.height,n.width);return i.minHeight=Math.min(i.minHeight,a),i.minFramerate=Math.min(i.minFramerate,n.frameRate),i.minIndex=Math.min(i.minIndex,r),i.maxScore=Math.max(i.maxScore,n.score),i.fragmentError+=n.fragmentError,i.videoRanges[n.videoRange]=(i.videoRanges[n.videoRange]||0)+1,s&&s.forEach((e=>{if(!e)return;const n=t.groups[e];n&&(i.hasDefaultAudio=i.hasDefaultAudio||t.hasDefaultAudio?n.hasDefault:n.hasAutoSelect||!t.hasDefaultAudio&&!t.hasAutoSelectAudio,Object.keys(n.channels).forEach((e=>{i.channels[e]=(i.channels[e]||0)+n.channels[e]})))})),e}),{})}(p,R,t,n)),i=function(e,t,n,s,i){const a=Object.keys(e),o=null==s?void 0:s.channels,l=null==s?void 0:s.audioCodec,c=null==i?void 0:i.videoCodec,u=o&&2===parseInt(o);let d=!1,h=!1,f=1/0,p=1/0,g=1/0,m=1/0,_=0,T=[];const{preferHDR:E,allowedVideoRanges:y}=nt(t,i);for(let t=a.length;t--;){const n=e[a[t]];d||(d=n.channels[2]>0),f=Math.min(f,n.minHeight),p=Math.min(p,n.minFramerate),g=Math.min(g,n.minBitrate),y.filter((e=>n.videoRanges[e]>0)).length>0&&(h=!0)}f=r(f)?f:0,p=r(p)?p:0;const S=Math.max(1080,f),v=Math.max(30,p);g=r(g)?g:n,n=Math.max(g,n),h||(t=void 0);const b=a.length>1;return{codecSet:a.reduce(((t,r)=>{const s=e[r];if(r===t)return t;if(T=h?y.filter((e=>s.videoRanges[e]>0)):[],b){if(s.minBitrate>n)return st(r,`min bitrate of ${s.minBitrate} > current estimate of ${n}`),t;if(!s.hasDefaultAudio)return st(r,"no renditions with default or auto-select sound found"),t;if(l&&r.indexOf(l.substring(0,4))%5!=0)return st(r,`audio codec preference "${l}" not found`),t;if(o&&!u){if(!s.channels[o])return st(r,`no renditions with ${o} channel sound found (channels options: ${Object.keys(s.channels)})`),t}else if((!l||u)&&d&&0===s.channels[2])return st(r,"no renditions with stereo sound found"),t;if(s.minHeight>S)return st(r,`min resolution of ${s.minHeight} > maximum of ${S}`),t;if(s.minFramerate>v)return st(r,`min framerate of ${s.minFramerate} > maximum of ${v}`),t;if(!T.some((e=>s.videoRanges[e]>0)))return st(r,`no variants with VIDEO-RANGE of ${rt(T)} found`),t;if(c&&r.indexOf(c.substring(0,4))%5!=0)return st(r,`video codec preference "${c}" not found`),t;if(s.maxScore<_)return st(r,`max score of ${s.maxScore} < selected max of ${_}`),t}return t&&(Ne(r)>=Ne(t)||s.fragmentError>e[t].fragmentError)?t:(m=s.minIndex,_=s.maxScore,r)}),void 0),videoRanges:T,preferHDR:E,minFramerate:p,minBitrate:g,minIndex:m}}(s,v,e,I,A),{codecSet:a,videoRanges:o,minFramerate:l,minBitrate:c,minIndex:u,preferHDR:d}=i;C=u,S=a,v=d?o[o.length-1]:o[0],b=l,e=Math.max(e,c),this.log(`picked start tier ${rt(i)}`)}else S=null==T?void 0:T.codecSet,v=null==T?void 0:T.videoRange;
1const k=f?f.duration:h?h.duration:0,L=this.bwEstimator.getEstimateTTFB()/1e3,O=[];for(let l=n;l>=t;l--){var N;const t=p[l],h=l>d;if(!t)continue;if(_.useMediaCapabilities&&!t.supportedResult&&!t.supportedPromise){const n=navigator.mediaCapabilities;"function"==typeof(null==n?void 0:n.decodingInfo)&&je(t,R,v,b,e,I)?(t.supportedPromise=We(t,R,n,this.supportedCache),t.supportedPromise.then((e=>{if(!this.hls)return;t.supportedResult=e;const n=this.hls.levels,r=n.indexOf(t);e.error?this.warn(`MediaCapabilities decodingInfo error: "${e.error}" for level ${r} ${rt(e)}`):e.supported?e.decodingInfoResults.some((e=>!1===e.smooth||!1===e.powerEfficient))&&this.log(`MediaCapabilities decodingInfo for level ${r} not smooth or powerEfficient: ${rt(e)}`):(this.warn(`Unsupported MediaCapabilities decodingInfo result for level ${r} ${rt(e)}`),r>-1&&n.length>1&&(this.log(`Removing unsupported level ${r}`),this.hls.removeLevel(r),-1===this.hls.loadLevel&&(this.hls.nextLoadLevel=0)))})).catch((e=>{this.warn(`Error handling MediaCapabilities decodingInfo: ${e}`)}))):t.supportedResult=Ge}if((S&&t.codecSet!==S||v&&t.videoRange!==v||h&&b>t.frameRate||!h&&b>0&&b<t.frameRate||null!=(N=t.supportedResult)&&null!=(N=N.decodingInfoResults)&&N.some((e=>!1===e.smooth)))&&(!y||l!==C)){O.push(l);continue}const g=t.details,T=(f?null==g?void 0:g.partTarget:null==g?void 0:g.averagetargetduration)||k;let A;A=h?o*e:a*e;const w=k&&s>=2*k&&0===i?t.averageBitrate:t.maxBitrate,P=this.getTimeToLoadFrag(L,A,w*T,void 0===g);if(A>=w&&(l===u||0===t.loadError&&0===t.fragmentError)&&(P<=L||!r(P)||E&&!this.bitrateTestDelay||P<c)){const e=this.forcedAutoLevel;return l===m||-1!==e&&e===m||(O.length&&this.trace(`Skipped level(s) ${O.join(",")} of ${n} max with CODECS and VIDEO-RANGE:"${p[O[0]].codecs}" ${p[O[0]].videoRange}; not compatible with "${S}" ${v}`),this.info(`switch candidate:${d}->${l} adjustedbw(${Math.round(A)})-bitrate=${Math.round(A-w)} ttfb:${L.toFixed(1)} avgDuration:${T.toFixed(1)} maxFetchDuration:${c.toFixed(1)} fetchDuration:${P.toFixed(1)} firstSelection:${y} codecSet:${t.codecSet} videoRange:${t.videoRange} hls.loadLevel:${m}`)),y&&(this.firstSelection=l),l}}return-1}set nextAutoLevel(e){const t=this.deriveNextAutoLevel(e);this._nextAutoLevel!==t&&(this.nextAutoLevelKey="",this._nextAutoLevel=t)}deriveNextAutoLevel(e){const{maxAutoLevel:t,minAutoLevel:n}=this.hls;return Math.min(Math.max(e,n),t)}},bufferController:class extends v{constructor(e,t){var n;super("buffer-controller",e.logger),this.hls=void 0,this.fragmentTracker=void 0,this.details=null,this._objectUrl=null,this.operationQueue=null,this.bufferCodecEventsTotal=0,this.media=null,this.mediaSource=null,this.lastMpegAudioChunk=null,this.blockedAudioAppend=null,this.lastVideoAppendEnd=0,this.appendSource=void 0,this.transferData=void 0,this.overrides=void 0,this.appendErrors={audio:0,video:0,audiovideo:0},this.tracks={},this.sourceBuffers=[[null,null],[null,null]],this._onEndStreaming=e=>{var t;this.hls&&"open"===(null==(t=this.mediaSource)?void 0:t.readyState)&&this.hls.pauseBuffering()},this._onStartStreaming=e=>{this.hls&&this.hls.resumeBuffering()},this._onMediaSourceOpen=e=>{const{media:t,mediaSource:n}=this;e&&this.log("Media source opened"),t&&n&&(n.removeEventListener("sourceopen",this._onMediaSourceOpen),t.removeEventListener("emptied",this._onMediaEmptied),this.updateDuration(),this.hls.trigger(l.MEDIA_ATTA
vendor: 1,040 bytes, line 1
1CHED,{media:t,mediaSource:n}),null!==this.mediaSource&&this.checkPendingTracks())},this._onMediaSourceClose=()=>{this.log("Media source closed")},this._onMediaSourceEnded=()=>{this.log("Media source ended")},this._onMediaEmptied=()=>{const{mediaSrc:e,_objectUrl:t}=this;e!==t&&this.error(`Media element src was set while attaching MediaSource (${t} > ${e})`)},this.hls=e,this.fragmentTracker=t,this.appendSource=(n=L(e.config.preferManagedMediaSource),"undefined"!=typeof self&&n===self.ManagedMediaSource),this.initTracks(),this.registerListeners()}hasSourceTypes(){return Object.keys(this.tracks).length>0}destroy(){this.unregisterListeners(),this.details=null,this.lastMpegAudioChunk=this.blockedAudioAppend=null,this.transferData=this.overrides=void 0,this.operationQueue&&(this.operationQueue.destroy(),this.operationQueue=null),this.hls=this.fragmentTracker=null,this._onMediaSourceOpen=this._onMediaSourceClose=null,this._onMediaSourceEnded=null,this._onStartStreaming=this._onEndStreaming=null}registerListeners(){const{hls:e}=this;
vendor: 36,157 bytes, line 1
1e.on(l.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(l.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(l.MANIFEST_LOADING,this.onManifestLoading,this),e.on(l.MANIFEST_PARSED,this.onManifestParsed,this),e.on(l.BUFFER_RESET,this.onBufferReset,this),e.on(l.BUFFER_APPENDING,this.onBufferAppending,this),e.on(l.BUFFER_CODECS,this.onBufferCodecs,this),e.on(l.BUFFER_EOS,this.onBufferEos,this),e.on(l.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(l.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(l.FRAG_PARSED,this.onFragParsed,this),e.on(l.FRAG_CHANGED,this.onFragChanged,this),e.on(l.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(l.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(l.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(l.MANIFEST_LOADING,this.onManifestLoading,this),e.off(l.MANIFEST_PARSED,this.onManifestParsed,this),e.off(l.BUFFER_RESET,this.onBufferReset,this),e.off(l.BUFFER_APPENDING,this.onBufferAppending,this),e.off(l.BUFFER_CODECS,this.onBufferCodecs,this),e.off(l.BUFFER_EOS,this.onBufferEos,this),e.off(l.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(l.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(l.FRAG_PARSED,this.onFragParsed,this),e.off(l.FRAG_CHANGED,this.onFragChanged,this),e.off(l.ERROR,this.onError,this)}transferMedia(){const{media:e,mediaSource:t}=this;if(!e)return null;const n={};if(this.operationQueue){const e=this.isUpdating();e||this.operationQueue.removeBlockers();const t=this.isQueued();(e||t)&&this.warn(`Transfering MediaSource with${t?" operations in queue":""}${e?" updating SourceBuffer(s)":""} ${this.operationQueue}`),this.operationQueue.destroy()}const r=this.transferData;return!this.sourceBufferCount&&r&&r.mediaSource===t?E(n,r.tracks):this.sourceBuffers.forEach((e=>{const[t]=e;t&&(n[t]=E({},this.tracks[t]),this.removeBuffer(t)),e[0]=e[1]=null})),{media:e,mediaSource:t,tracks:n}}initTracks(){this.sourceBuffers=[[null,null],[null,null]],this.tracks={},this.resetQueue(),this.resetAppendErrors(),this.lastMpegAudioChunk=this.blockedAudioAppend=null,this.lastVideoAppendEnd=0}onManifestLoading(){this.bufferCodecEventsTotal=0,this.details=null}onManifestParsed(e,t){var n;let r=2;(t.audio&&!t.video||!t.altAudio)&&(r=1),this.bufferCodecEventsTotal=r,this.log(`${r} bufferCodec event(s) expected.`),null!=(n=this.transferData)&&n.mediaSource&&this.sourceBufferCount&&r&&this.bufferCreated()}onMediaAttaching(e,t){const n=this.media=t.media;this.transferData=this.overrides=void 0;const r=L(this.appendSource);if(r){const e=!!t.mediaSource;(e||t.overrides)&&(this.transferData=t,this.overrides=t.overrides);const s=this.mediaSource=t.mediaSource||new r;if(this.assignMediaSource(s),e)this._objectUrl=n.src,this.attachTransferred();else{const e=this._objectUrl=self.URL.createObjectURL(s);if(this.appendSource)try{n.removeAttribute("src");const t=self.ManagedMediaSource;n.disableRemotePlayback=n.disableRemotePlayback||t&&s instanceof t,yi(n),function(e,t){const n=self.document.createElement("source");n.type="video/mp4",n.src=t,e.appendChild(n)}(n,e),n.load()}catch(t){n.src=e}else n.src=e}n.addEventListener("emptied",this._onMediaEmptied)}}assignMediaSource(e){var t,n;this.log(`${(null==(t=this.transferData)?void 0:t.mediaSource)===e?"transferred":"created"} media source: ${null==(n=e.constructor)?void 0:n.name}`),e.addEventListener("sourceopen",this._onMediaSourceOpen),e.addEventListener("sourceended",this._onMediaSourceEnded),e.addEventListener("sourceclose",this._onMediaSourceClose),this.appendSource&&(e.addEventListener("startstreaming",this._onStartStreaming),e.addEventListener("endstreaming",this._onEndStreaming))}attachTransferred(){const e=this.media,t=this.transferData;if(!t||!e)return;const n=this.tracks,r=t.tracks,s=r?Object.keys(r):null,i=s?s.length:0,a=()=>{Promise.resolve().then((()=>{this.media&&this.mediaSourceOpenOrEnded&&this._onMediaSourceOpen()}))};if(r&&s&&i){if(!this.tracksReady)return this.hls.config.startFragPrefetch=!0,void this.log("attachTransferred: waiting for SourceBuffer track info");if(this.log(`attachTransferred: (bufferCodecEventsTotal ${this.bufferCodecEventsTotal})\nrequired tracks: ${rt(n,((e,t)=>"initSegment"===e?void 0:t))};\ntransfer tracks: ${rt(r,((e,t)=>"initSegment"===e?void 0:t))}}`),!O(r,n)){t.mediaSource=null,t.tracks=void 0;const s=e.currentTime,i=this.details,a=Math.max(s,(null==i?void 0:i.fragments[0].start)||0);return a-s>1?void this.log(`attachTransferred: waiting for playback to reach new tracks start time ${s} -> ${a}`):(this.warn(`attachTransferred: resetting MediaSource for incompatible tracks ("${Object.keys(r)}"->"${Object.keys(n)}") start time: ${a} currentTime: ${s}`),this.onMediaDetaching(l.MEDIA_DETACHING,{}),this.onMediaAttaching(l.MEDIA_ATTACHING,t),void(e.currentTime=a))}this.transferData=void 0,s.forEach((e=>{const t=e,n=r[t];if(n){const e=n.buffer;if(e){const r=this.fragmentTracker,s=n.id;if(r.hasFragments(s)||r.hasParts(s)){const n=nn.getBuffered(e);r.detectEvictedFragments(t,n,s,null,!0)}const i=Si(t),a=[t,e];this.sourceBuffers[i]=a,e.updating&&this.operationQueue&&this.operationQueue.prependBlocker(t),this.trackSourceBuffer(t,n)}}})),a(),this.bufferCreated()}else this.log("attachTransferred: MediaSource w/o SourceBuffers"),a()}get mediaSourceOpenOrEnded(){var e;const t=null==(e=this.mediaSource)?void 0:e.readyState;return"open"===t||"ended"===t}onMediaDetaching(e,t){const n=!!t.transferMedia;this.transferData=this.overrides=void 0;const{media:r,mediaSource:s,_objectUrl:i}=this;if(s){if(this.log("media source "+(n?"transferring":"detaching")),n)this.sourceBuffers.forEach((([e])=>{e&&this.removeBuffer(e)})),this.resetQueue();else{if(this.mediaSourceOpenOrEnded){const e="open"===s.readyState;try{const t=s.sourceBuffers;for(let n=t.length;n--;)e&&t[n].abort(),s.removeSourceBuffer(t[n]);e&&s.endOfStream()}catch(e){this.warn(`onMediaDetaching: ${e.message} while calling endOfStream`)}}this.sourceBufferCount&&this.onBufferReset()}s.removeEventListener("sourceopen",this._onMediaSourceOpen),s.removeEventListener("sourceended",this._onMediaSourceEnded),s.removeEventListener("sourceclose",this._onMediaSourceClose),this.appendSource&&(s.removeEventListener("startstreaming",this._onStartStreaming),s.removeEventListener("endstreaming",this._onEndStreaming)),this.mediaSource=null,this._objectUrl=null}r&&(r.removeEventListener("emptied",this._onMediaEmptied),n||(i&&self.URL.revokeObjectURL(i),this.mediaSrc===i?(r.removeAttribute("src"),this.appendSource&&yi(r),r.load()):this.warn("media|source.src was changed by a third party - skip cleanup")),this.media=null),this.hls.trigger(l.MEDIA_DETACHED,t)}onBufferReset(){this.sourceBuffers.forEach((([e])=>{e&&this.resetBuffer(e)})),this.initTracks()}resetBuffer(e){var t;const n=null==(t=this.tracks[e])?void 0:t.buffer;if(this.removeBuffer(e),n)try{var r;null!=(r=this.mediaSource)&&r.sourceBuffers.length&&this.mediaSource.removeSourceBuffer(n)}catch(t){this.warn(`onBufferReset ${e}`,t)}delete this.tracks[e]}removeBuffer(e){this.removeBufferListeners(e),this.sourceBuffers[Si(e)]=[null,null];const t=this.tracks[e];t&&(t.buffer=void 0)}resetQueue(){this.operationQueue&&this.operationQueue.destroy(),this.operationQueue=new mi(this.tracks)}onBufferCodecs(e,t){var n;const r=this.tracks,s=Object.keys(t);this.log(`BUFFER_CODECS: "${s}" (current SB count ${this.sourceBufferCount})`);const i="audiovideo"in t&&(r.audio||r.video)||r.audiovideo&&("audio"in t||"video"in t),a=!i&&this.sourceBufferCount&&this.media&&s.some((e=>!r[e]));i||a?this.warn(`Unsupported transition between "${Object.keys(r)}" and "${s}" SourceBuffers`):(s.forEach((e=>{var n,s;const i=t[e],{id:a,codec:o,levelCodec:l,container:c,metadata:u,supplemental:d}=i;let h=r[e];const f=null==(n=this.transferData)||null==(n=n.tracks)?void 0:n[e],p=null!=f&&f.buffer?f:h,g=(null==p?void 0:p.pendingCodec)||(null==p?void 0:p.codec),m=null==p?void 0:p.levelCodec;h||(h=r[e]={buffer:void 0,listeners:[],codec:o,supplemental:d,container:c,levelCodec:l,metadata:u,id:a});const _=De(g,m),T=null==_?void 0:_.replace(_i,"$1");let E=De(o,l);const y=null==(s=E)?void 0:s.replace(_i,"$1");E&&_&&T!==y&&("audio"===e.slice(0,5)&&(E=Me(E,this.appendSource)),this.log(`switching codec ${g} to ${E}`),E!==(h.pendingCodec||h.codec)&&(h.pendingCodec=E),h.container=c,this.appendChangeType(e,c,E))})),(this.tracksReady||this.sourceBufferCount)&&(t.tracks=this.sourceBufferTracks),this.sourceBufferCount||(this.bufferCodecEventsTotal>1&&!this.tracks.video&&!t.video&&"main"===(null==(n=t.audio)?void 0:n.id)&&(this.log("Main audio-only"),this.bufferCodecEventsTotal=1),this.mediaSourceOpenOrEnded&&this.checkPendingTracks()))}get sourceBufferTracks(){return Object.keys(this.tracks).reduce(((e,t)=>{const n=this.tracks[t];return e[t]={id:n.id,container:n.container,codec:n.codec,levelCodec:n.levelCodec},e}),{})}appendChangeType(e,t,n){const r=`${t};codecs=${n}`,s={label:`change-type=${r}`,execute:()=>{const s=this.tracks[e];if(s){const i=s.buffer;null!=i&&i.changeType&&(this.log(`changing ${e} sourceBuffer type to ${r}`),i.changeType(r),s.codec=n,s.container=t)}this.shiftAndExecuteNext(e)},onStart:()=>{},onComplete:()=>{},onError:t=>{this.warn(`Failed to change ${e} SourceBuffer type`,t)}};this.append(s,e,this.isPending(this.tracks[e]))}blockAudio(e){var t;const n=e.start,r=n+.05*e.duration;if(!0===(null==(t=this.fragmentTracker.getAppendedFrag(n,f))?void 0:t.gap))return;const s={label:"block-audio",execute:()=>{var e;const t=this.tracks.video;(this.lastVideoAppendEnd>r||null!=t&&t.buffer&&nn.isBuffered(t.buffer,r)||!0===(null==(e=this.fragmentTracker.getAppendedFrag(r,f))?void 0:e.gap))&&(this.blockedAudioAppend=null,this.shiftAndExecuteNext("audio"))},onStart:()=>{},onComplete:()=>{},onError:e=>{this.warn("Error executing block-audio operation",e)}};this.blockedAudioAppend={op:s,frag:e},this.append(s,"audio",!0)}unblockAudio(){const{blockedAudioAppend:e,operationQueue:t}=this;e&&t&&(this.blockedAudioAppend=null,t.unblockAudio(e.op))}onBufferAppending(e,t){const{tracks:n}=this,{data:s,type:i,parent:c,frag:u,part:d,chunkMeta:h,offset:p}=t,g=h.buffering[i],{sn:m,cc:_}=u,T=self.performance.now();g.start=T;const E=u.stats.buffering,y=d?d.stats.buffering:null;0===E.start&&(E.start=T),y&&0===y.start&&(y.start=T);const S=n.audio;let v=!1;"audio"===i&&"audio/mpeg"===(null==S?void 0:S.container)&&(v=!this.lastMpegAudioChunk||1===h.id||this.lastMpegAudioChunk.sn!==h.sn,this.lastMpegAudioChunk=h);const b=n.video,I=null==b?void 0:b.buffer;if(I&&"initSegment"!==m){const e=d||u,t=this.blockedAudioAppend;if("audio"!==i||"main"===c||this.blockedAudioAppend||b.ending||b.ended){if("video"===i){const n=e.end;if(t){const e=t.frag.start;(n>e||n<this.lastVideoAppendEnd||nn.isBuffered(I,e))&&this.unblockAudio()}this.lastVideoAppendEnd=n}}else{const t=e.start+.05*e.duration,n=I.buffered,r=this.currentOp("video");n.length||r?!r&&!nn.isBuffered(I,t)&&this.lastVideoAppendEnd<t&&this.blockAudio(e):this.blockAudio(e)}}const A=(d||u).start,R={label:`append-${i}`,execute:()=>{var e;g.executeStart=self.performance.now();const t=null==(e=this.tracks[i])?void 0:e.buffer;t&&(v?this.updateTimestampOffset(t,A,.1,i,m,_):void 0!==p&&r(p)&&this.updateTimestampOffset(t,p,1e-6,i,m,_)),this.appendExecutor(s,i)},onStart:()=>{},onComplete:()=>{const e=self.performance.now();g.executeEnd=g.end=e,0===E.first&&(E.first=e),y&&0===y.first&&(y.first=e);const t={};this.sourceBuffers.forEach((([e,n])=>{e&&(t[e]=nn.getBuffered(n))})),this.appendErrors[i]=0,"audio"===i||"video"===i?this.appendErrors.audiovideo=0:(this.appendErrors.audio=0,this.appendErrors.video=0),this.hls.trigger(l.BUFFER_APPENDED,{type:i,frag:u,part:d,chunkMeta:h,parent:u.type,timeRanges:t})},onError:e=>{var t;const n={type:a.MEDIA_ERROR,parent:u.type,details:o.BUFFER_APPEND_ERROR,sourceBufferName:i,frag:u,part:d,chunkMeta:h,error:e,err:e,fatal:!1},r=null==(t=this.media)?void 0:t.error;if(e.code===DOMException.QUOTA_EXCEEDED_ERR||"QuotaExceededError"==e.name||"quota"in e)n.details=o.BUFFER_FULL_ERROR;else if(e.code===DOMException.INVALID_STATE_ERR&&this.mediaSourceOpenOrEnded&&!r)n.errorAction=Pt(!0);else if(e.name===Ti&&0===this.sourceBufferCount)n.errorAction=Pt(!0);else{const e=++this.appendErrors[i];this.warn(`Failed ${e}/${this.hls.config.appendErrorMaxRetry} times to append segment in "${i}" sourceBuffer (${r||"no media error"})`),(e>=this.hls.config.appendErrorMaxRetry||r)&&(n.fatal=!0)}this.hls.trigger(l.ERROR,n)}};this.log(`queuing "${i}" append sn: ${m}${d?" p: "+d.index:""} of ${u.type===f?"level":"track"} ${u.level} cc: ${_}`),this.append(R,i,this.isPending(this.tracks[i]))}getFlushOp(e,t,n){return this.log(`queuing "${e}" remove ${t}-${n}`),{label:"remove",execute:()=>{this.removeExecutor(e,t,n)},onStart:()=>{},onComplete:()=>{this.hls.trigger(l.BUFFER_FLUSHED,{type:e})},onError:r=>{this.warn(`Failed to remove ${t}-${n} from "${e}" SourceBuffer`,r)}}}onBufferFlushing(e,t){const{type:n,startOffset:r,endOffset:s}=t;n?this.append(this.getFlushOp(n,r,s),n):this.sourceBuffers.forEach((([e])=>{e&&this.append(this.getFlushOp(e,r,s),e)}))}onFragParsed(e,t){const{frag:n,part:r}=t,s=[],i=r?r.elementaryStreams:n.elementaryStreams;i[V]?s.push("audiovideo"):(i[W]&&s.push("audio"),i[K]&&s.push("video"));0===s.length&&this.warn(`Fragments must have at least one ElementaryStreamType set. type: ${n.type} level: ${n.level} sn: ${n.sn}`),this.blockBuffers((()=>{const e=self.performance.now();n.stats.buffering.end=e,r&&(r.stats.buffering.end=e);const t=r?r.stats:n.stats;this.hls.trigger(l.FRAG_BUFFERED,{frag:n,part:r,stats:t,id:n.type})}),s).catch((e=>{this.warn(`Fragment buffered callback ${e}`),this.stepOperationQueue(this.sourceBufferTypes)}))}onFragChanged(e,t){this.trimBuffers()}get bufferedToEnd(){return this.sourceBufferCount>0&&!this.sourceBuffers.some((([e])=>{if(e){const t=this.tracks[e];if(t)return!t.ended||t.ending}return!1}))}onBufferEos(e,t){var n;this.sourceBuffers.forEach((([e])=>{if(e){const n=this.tracks[e];t.type&&t.type!==e||(n.ending=!0,n.ended||(n.ended=!0,this.log(`${e} buffer reached EOS`)))}}));const r=!1!==(null==(n=this.overrides)?void 0:n.endOfStream);this.sourceBufferCount>0&&!this.sourceBuffers.some((([e])=>{var t;return e&&!(null!=(t=this.tracks[e])&&t.ended)}))?r?(this.log("Queueing EOS"),this.blockUntilOpen((()=>{this.tracksEnded();const{mediaSource:e}=this;e&&"open"===e.readyState?(this.log("Calling mediaSource.endOfStream()"),e.endOfStream(),this.hls.trigger(l.BUFFERED_TO_END,void 0)):e&&this.log(`Could not call mediaSource.endOfStream(). mediaSource.readyState: ${e.readyState}`)}))):(this.tracksEnded(),this.hls.trigger(l.BUFFERED_TO_END,void 0)):"video"===t.type&&this.unblockAudio()}tracksEnded(){this.sourceBuffers.forEach((([e])=>{if(null!==e){const t=this.tracks[e];t&&(t.ending=!1)}}))}onLevelUpdated(e,{details:t}){t.fragments.length&&(this.details=t,this.updateDuration())}updateDuration(){this.blockUntilOpen((()=>{const e=this.getDurationAndRange();e&&this.updateMediaSource(e)}))}onError(e,t){if(t.details===o.BUFFER_APPEND_ERROR&&t.frag){var n;const e=null==(n=t.errorAction)?void 0:n.nextAutoLevel;r(e)&&e!==t.frag.level&&this.resetAppendErrors()}}resetAppendErrors(){this.appendErrors={audio:0,video:0,audiovideo:0}}trimBuffers(){const{hls:e,details:t,media:n}=this;if(!n||null===t)return;if(!this.sourceBufferCount)return;const s=e.config,i=n.currentTime,a=t.levelTargetDuration,o=t.live&&null!==s.liveBackBufferLength?s.liveBackBufferLength:s.backBufferLength;if(r(o)&&o>=0){const e=Math.max(o,a),t=Math.floor(i/a)*a-e;this.flushBackBuffer(i,a,t)}const l=s.frontBufferFlushThreshold;if(r(l)&&l>0){const e=Math.max(s.maxBufferLength,l),t=Math.max(e,a),n=Math.floor(i/a)*a+t;this.flushFrontBuffer(i,a,n)}}flushBackBuffer(e,t,n){this.sourceBuffers.forEach((([e,t])=>{if(t){const s=nn.getBuffered(t);if(s.length>0&&n>s.start(0)){var r;this.hls.trigger(l.BACK_BUFFER_REACHED,{bufferEnd:n});const t=this.tracks[e];if(null!=(r=this.details)&&r.live)this.hls.trigger(l.LIVE_BACK_BUFFER_REACHED,{bufferEnd:n});else if(null!=t&&t.ended)return void this.log(`Cannot flush ${e} back buffer while SourceBuffer is in ended state`);this.hls.trigger(l.BUFFER_FLUSHING,{startOffset:0,endOffset:n,type:e})}}}))}flushFrontBuffer(e,t,n){this.sourceBuffers.forEach((([t,r])=>{if(r){const s=nn.getBuffered(r),i=s.length;if(i<2)return;const a=s.start(i-1),o=s.end(i-1);if(n>a||e>=a&&e<=o)return;this.hls.trigger(l.BUFFER_FLUSHING,{startOffset:a,endOffset:1/0,type:t})}}))}getDurationAndRange(){var e;const{details:t,mediaSource:n}=this;if(!t||!this.media||"open"!==(null==n?void 0:n.readyState))return null;const s=t.edge;if(t.live&&this.hls.config.liveDurationInfinity){if(t.fragments.length&&n.setLiveSeekableRange){const e=Math.max(0,t.fragmentStart);return{duration:1/0,start:e,end:Math.max(e,s)}}return{duration:1/0}}const i=null==(e=this.overrides)?void 0:e.duration;if(i)return r(i)?{duration:i}:null;const a=this.media.duration;return s>(r(n.duration)?n.duration:0)&&s>a||!r(a)?{duration:s}:null}updateMediaSource({duration:e,start:t,end:n}){const s=this.mediaSource;this.media&&s&&"open"===s.readyState&&(s.duration!==e&&(r(e)&&this.log(`Updating MediaSource duration to ${e.toFixed(3)}`),s.duration=e),void 0!==t&&void 0!==n&&(this.log(`MediaSource duration is set to ${s.duration}. Setting seekable range to ${t}-${n}.`),s.setLiveSeekableRange(t,n)))}get tracksReady(){const e=this.pendingTrackCount;return e>0&&(e>=this.bufferCodecEventsTotal||this.isPending(this.tracks.audiovideo))}checkPendingTracks(){const{bufferCodecEventsTotal:e,pendingTrackCount:t,tracks:n}=this;if(this.log(`checkPendingTracks (pending: ${t} codec events expected: ${e}) ${rt(n)}`),this.tracksReady){var r;const e=null==(r=this.transferData)?void 0:r.tracks;e&&Object.keys(e).length?this.attachTransferred():this.createSourceBuffers()}}bufferCreated(){if(this.sourceBufferCount){const e={};this.sourceBuffers.forEach((([t,n])=>{if(t){const r=this.tracks[t];e[t]={buffer:n,container:r.container,codec:r.codec,supplemental:r.supplemental,levelCodec:r.levelCodec,id:r.id,metadata:r.metadata}}})),this.hls.trigger(l.BUFFER_CREATED,{tracks:e}),this.log(`SourceBuffers created. Running queue: ${this.operationQueue}`),this.sourceBuffers.forEach((([e])=>{this.executeNext(e)}))}else{const e=new Error("could not create source buffer for media codec(s)");this.hls.trigger(l.ERROR,{type:a.MEDIA_ERROR,details:o.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,error:e,reason:e.message})}}createSourceBuffers(){const{tracks:e,sourceBuffers:t,mediaSource:n}=this;if(!n)throw new Error("createSourceBuffers called when mediaSource was null");for(const s in e){const i=s,c=e[i];if(this.isPending(c)){const e=this.getTrackCodec(c,i),s=`${c.container};codecs=${e}`;c.codec=e,this.log(`creating sourceBuffer(${s})${this.currentOp(i)?" Queued":""} ${rt(c)}`);try{const e=n.addSourceBuffer(s),r=Si(i),a=[i,e];t[r]=a,c.buffer=e}catch(e){var r;return this.error(`error while trying to add sourceBuffer: ${e.message}`),this.shiftAndExecuteNext(i),null==(r=this.operationQueue)||r.removeBlockers(),delete this.tracks[i],void this.hls.trigger(l.ERROR,{type:a.MEDIA_ERROR,details:o.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:e,sourceBufferName:i,mimeType:s,parent:c.id})}this.trackSourceBuffer(i,c)}}this.bufferCreated()}getTrackCodec(e,t){const n=e.supplemental;let r=e.codec;n&&("video"===t||"audiovideo"===t)&&Ce(n,"video")&&(r=function(e,t){const n=[];if(e){const t=e.split(",");for(let e=0;e<t.length;e++)Re(t[e],"video")||n.push(t[e])}return t&&n.push(t),n.join(",")}(r,n));const s=De(r,e.levelCodec);return s?"audio"===t.slice(0,5)?Me(s,this.appendSource):s:""}trackSourceBuffer(e,t){const n=t.buffer;if(!n)return;const r=this.getTrackCodec(t,e);this.tracks[e]={buffer:n,codec:r,container:t.container,levelCodec:t.levelCodec,supplemental:t.supplemental,metadata:t.metadata,id:t.id,listeners:[]},this.removeBufferListeners(e),this.addBufferListener(e,"updatestart",this.onSBUpdateStart),this.addBufferListener(e,"updateend",this.onSBUpdateEnd),this.addBufferListener(e,"error",this.onSBUpdateError),this.appendSource&&this.addBufferListener(e,"bufferedchange",((e,t)=>{const n=t.removedRanges;null!=n&&n.length&&this.hls.trigger(l.BUFFER_FLUSHED,{type:e})}))}get mediaSrc(){var e,t;const n=(null==(e=this.media)||null==(t=e.querySelector)?void 0:t.call(e,"source"))||this.media;return null==n?void 0:n.src}onSBUpdateStart(e){const t=this.currentOp(e);t&&t.onStart()}onSBUpdateEnd(e){var t;if("closed"===(null==(t=this.mediaSource)?void 0:t.readyState))return void this.resetBuffer(e);const n=this.currentOp(e);n&&(n.onComplete(),this.shiftAndExecuteNext(e))}onSBUpdateError(e,t){var n;const r=new Error(`${e} SourceBuffer error. MediaSource readyState: ${null==(n=this.mediaSource)?void 0:n.readyState}`);this.error(`${r}`,t),this.hls.trigger(l.ERROR,{type:a.MEDIA_ERROR,details:o.BUFFER_APPENDING_ERROR,sourceBufferName:e,error:r,fatal:!1});const s=this.currentOp(e);s&&s.onError(r)}updateTimestampOffset(e,t,n,r,s,i){const a=t-e.timestampOffset;Math.abs(a)>=n&&(this.log(`Updating ${r} SourceBuffer timestampOffset to ${t} (sn: ${s} cc: ${i})`),e.timestampOffset=t)}removeExecutor(e,t,n){const{media:s,mediaSource:i}=this,a=this.tracks[e],o=null==a?void 0:a.buffer;if(!s||!i||!o)return this.warn(`Attempting to remove from the ${e} SourceBuffer, but it does not exist`),void this.shiftAndExecuteNext(e);const l=r(s.duration)?s.duration:1/0,c=r(i.duration)?i.duration:1/0,u=Math.max(0,t),d=Math.min(n,l,c);d>u&&(!a.ending||a.ended)?(a.ended=!1,this.log(`Removing [${u},${d}] from the ${e} SourceBuffer`),o.remove(u,d)):this.shiftAndExecuteNext(e)}appendExecutor(e,t){const n=this.tracks[t],r=null==n?void 0:n.buffer;if(!r)throw new Ei(`Attempting to append to the ${t} SourceBuffer, but it does not exist`);n.ending=!1,n.ended=!1,r.appendBuffer(e)}blockUntilOpen(e){if(this.isUpdating()||this.isQueued())this.blockBuffers(e).catch((e=>{this.warn(`SourceBuffer blocked callback ${e}`),this.stepOperationQueue(this.sourceBufferTypes)}));else try{e()}catch(e){this.warn(`Callback run without blocking ${this.operationQueue} ${e}`)}}isUpdating(){return this.sourceBuffers.some((([e,t])=>e&&t.updating))}isQueued(){return this.sourceBuffers.some((([e])=>e&&!!this.currentOp(e)))}isPending(e){return!!e&&!e.buffer}blockBuffers(e,t=this.sourceBufferTypes){if(!t.length)return this.log("Blocking operation requested, but no SourceBuffers exist"),Promise.resolve().then(e);const{operationQueue:n}=this,r=t.map((e=>this.appendBlocker(e)));return t.length>1&&!!this.blockedAudioAppend&&this.unblockAudio(),Promise.all(r).then((t=>{n===this.operationQueue&&(e(),this.stepOperationQueue(this.sourceBufferTypes))}))}stepOperationQueue(e){e.forEach((e=>{var t;const n=null==(t=this.tracks[e])?void 0:t.buffer;n&&!n.updating&&this.shiftAndExecuteNext(e)}))}append(e,t,n){this.operationQueue&&this.operationQueue.append(e,t,n)}appendBlocker(e){if(this.operationQueue)return this.operationQueue.appendBlocker(e)}currentOp(e){return this.operationQueue?this.operationQueue.current(e):null}executeNext(e){e&&this.operationQueue&&this.operationQueue.executeNext(e)}shiftAndExecuteNext(e){this.operationQueue&&this.operationQueue.shiftAndExecuteNext(e)}get pendingTrackCount(){return Object.keys(this.tracks).reduce(((e,t)=>e+(this.isPending(this.tracks[t])?1:0)),0)}get sourceBufferCount(){return this.sourceBuffers.reduce(((e,[t])=>e+(t?1:0)),0)}get sourceBufferTypes(){return this.sourceBuffers.map((([e])=>e)).filter((e=>!!e))}addBufferListener(e,t,n){const r=this.tracks[e];if(!r)return;const s=r.buffer;if(!s)return;const i=n.bind(this,e);r.listeners.push({event:t,listener:i}),s.addEventListener(t,i)}removeBufferListeners(e){const t=this.tracks[e];if(!t)return;const n=t.buffer;n&&(t.listeners.forEach((e=>{n.removeEventListener(e.event,e.listener)})),t.listeners.length=0)}},capLevelController:vi,errorController:class extends v{constructor(e){super("error-controller",e.logger),this.hls=void 0,this.playlistError=0,this.hls=e,this.registerListeners()}registerListeners(){const e=this.hls;e.on(l.ERROR,this.onError,this),e.on(l.MANIFEST_LOADING,this.onManifestLoading,this),e.on(l.LEVEL_UPDATED,this.onLevelUpdated,this)}unregisterListeners(){const e=this.hls;e&&(e.off(l.ERROR,this.onError,this),e.off(l.ERROR,this.onErrorOut,this),e.off(l.MANIFEST_LOADING,this.onManifestLoading,this),e.off(l.LEVEL_UPDATED,this.onLevelUpdated,this))}destroy(){this.unregisterListeners(),this.hls=null}startLoad(e){}stopLoad(){this.playlistError=0}getVariantLevelIndex(e){return(null==e?void 0:e.type)===f?e.level:this.getVariantIndex()}getVariantIndex(){var e;const t=this.hls,n=t.currentLevel;return null!=(e=t.loadLevelObj)&&e.details||-1===n?t.loadLevel:n}variantHasKey(e,t){if(e){var n;if(null!=(n=e.details)&&n.hasKey(t))return!0;const r=e.audioGroups;if(r){return this.hls.allAudioTracks.filter((e=>r.indexOf(e.groupId)>=0)).some((e=>{var n;return null==(n=e.details)?void 0:n.hasKey(t)}))}}return!1}onManifestLoading(){this.playlistError=0}onLevelUpdated(){this.playlistError=0}onError(e,t){var n;if(t.fatal)return;const r=this.hls,s=t.context;switch(t.details){case o.FRAG_LOAD_ERROR:case o.FRAG_LOAD_TIMEOUT:case o.KEY_LOAD_ERROR:case o.KEY_LOAD_TIMEOUT:return void(t.errorAction=this.getFragRetryOrSwitchAction(t));case o.FRAG_PARSING_ERROR:if(null!=(n=t.frag)&&n.gap)return void(t.errorAction=Pt());case o.FRAG_GAP:case o.FRAG_DECRYPT_ERROR:return t.errorAction=this.getFragRetryOrSwitchAction(t),void(t.errorAction.action=Rt);case o.LEVEL_EMPTY_ERROR:case o.LEVEL_PARSING_ERROR:{var i;const e=t.parent===f?t.level:r.loadLevel;t.details===o.LEVEL_EMPTY_ERROR&&null!=(i=t.context)&&null!=(i=i.levelDetails)&&i.live?t.errorAction=this.getPlaylistRetryOrSwitchAction(t,e):(t.levelRetry=!1,t.errorAction=this.getLevelSwitchAction(t,e))}return;case o.LEVEL_LOAD_ERROR:case o.LEVEL_LOAD_TIMEOUT:return void("number"==typeof(null==s?void 0:s.level)&&(t.errorAction=this.getPlaylistRetryOrSwitchAction(t,s.level)));case o.AUDIO_TRACK_LOAD_ERROR:case o.AUDIO_TRACK_LOAD_TIMEOUT:case o.SUBTITLE_LOAD_ERROR:case o.SUBTITLE_TRACK_LOAD_TIMEOUT:if(s){const e=r.loadLevelObj;if(e&&(s.type===d&&e.hasAudioGroup(s.groupId)||s.type===h&&e.hasSubtitleGroup(s.groupId)))return t.errorAction=this.getPlaylistRetryOrSwitchAction(t,r.loadLevel),t.errorAction.action=Rt,void(t.errorAction.flags=Ot)}return;case o.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED:return void(t.errorAction={action:Rt,flags:Nt});case o.KEY_SYSTEM_SESSION_UPDATE_FAILED:case o.KEY_SYSTEM_STATUS_INTERNAL_ERROR:case o.KEY_SYSTEM_NO_SESSION:return void(t.errorAction={action:Rt,flags:wt});case o.BUFFER_ADD_CODEC_ERROR:case o.REMUX_ALLOC_ERROR:case o.BUFFER_APPEND_ERROR:var l;if(!t.errorAction)t.errorAction=this.getLevelSwitchAction(t,null!=(l=t.level)?l:r.loadLevel);return;case o.INTERNAL_EXCEPTION:case o.BUFFER_APPENDING_ERROR:case o.BUFFER_FULL_ERROR:case o.LEVEL_SWITCH_ERROR:case o.BUFFER_STALLED_ERROR:case o.BUFFER_SEEK_OVER_HOLE:case o.BUFFER_NUDGE_ON_STALL:return void(t.errorAction=Pt())}t.type===a.KEY_SYSTEM_ERROR&&(t.levelRetry=!1,t.errorAction=Pt())}getPlaylistRetryOrSwitchAction(e,t){const n=yt(this.hls.config.playlistLoadPolicy,e),r=this.playlistError++;if(bt(n,r,_t(e),e.response))return{action:kt,flags:Lt,retryConfig:n,retryCount:r};const s=this.getLevelSwitchAction(e,t);return n&&(s.retryConfig=n,s.retryCount=r),s}getFragRetryOrSwitchAction(e){const t=this.hls,n=this.getVariantLevelIndex(e.frag),r=t.levels[n],{fragLoadPolicy:s,keyLoadPolicy:i}=t.config,a=yt(Tt(e)?i:s,e),l=t.levels.reduce(((e,t)=>e+t.fragmentError),0);if(r&&(e.details!==o.FRAG_GAP&&r.fragmentError++,!Et(e))){if(bt(a,l,_t(e),e.response))return{action:kt,flags:Lt,retryConfig:a,retryCount:l}}const c=this.getLevelSwitchAction(e,n);return a&&(c.retryConfig=a,c.retryCount=l),c}getLevelSwitchAction(e,t){const n=this.hls;null==t&&(t=n.loadLevel);const r=this.hls.levels[t];if(r){var s,i;const t=e.details;r.loadError++,t===o.BUFFER_APPEND_ERROR&&r.fragmentError++;let c=-1;const{levels:u,loadLevel:m,minAutoLevel:_,maxAutoLevel:T}=n;n.autoLevelEnabled||n.config.preserveManualLevelOnError||(n.loadLevel=-1);const E=null==(s=e.frag)?void 0:s.type,y=(E===p&&t===o.FRAG_PARSING_ERROR||"audio"===e.sourceBufferName&&(t===o.BUFFER_ADD_CODEC_ERROR||t===o.BUFFER_APPEND_ERROR))&&u.some((({audioCodec:e})=>r.audioCodec!==e)),S="video"===e.sourceBufferName&&(t===o.BUFFER_ADD_CODEC_ERROR||t===o.BUFFER_APPEND_ERROR)&&u.some((({codecSet:e,audioCodec:t})=>r.codecSet!==e&&r.audioCodec===t)),{type:v,groupId:b}=null!=(i=e.context)?i:{};for(let n=u.length;n--;){const s=(n+m)%u.length;if(s!==m&&s>=_&&s<=T&&0===u[s].loadError){var a,l;const n=u[s];if(t===o.FRAG_GAP&&E===f&&e.frag){const t=u[s].details;if(t){const n=ft(e.frag,t.fragments,e.frag.start);if(null!=n&&n.gap)continue}}else{if(v===d&&n.hasAudioGroup(b)||v===h&&n.hasSubtitleGroup(b))continue;if(E===p&&null!=(a=r.audioGroups)&&a.some((e=>n.hasAudioGroup(e)))||E===g&&null!=(l=r.subtitleGroups)&&l.some((e=>n.hasSubtitleGroup(e)))||y&&r.audioCodec===n.audioCodec||S&&r.codecSet===n.codecSet||!y&&r.codecSet!==n.codecSet)continue}c=s;break}}if(c>-1&&n.loadLevel!==c)return e.levelRetry=!0,this.playlistError=0,{action:Rt,flags:Lt,nextAutoLevel:c}}return{action:Rt,flags:Ot}}onErrorOut(e,t){var n;switch(null==(n=t.errorAction)?void 0:n.action){case At:break;case Rt:this.sendAlternateToPenaltyBox(t),t.errorAction.resolved||t.details===o.FRAG_GAP?/MediaSource readyState: ended/.test(t.error.message)&&(this.warn(`MediaSource ended after "${t.sourceBufferName}" sourceBuffer append error. Attempting to recover from media error.`),this.hls.recoverMediaError()):t.fatal=!0}t.fatal&&this.hls.stopLoad()}sendAlternateToPenaltyBox(e){const t=this.hls,n=e.errorAction;if(!n)return;const{flags:r}=n,s=n.nextAutoLevel;switch(r){case Lt:this.switchLevel(e,s);break;case Nt:{const r=this.getVariantLevelIndex(e.frag),s=t.levels[r],i=null==s?void 0:s.attrs["HDCP-LEVEL"];if(n.hdcpLevel=i,"NONE"===i)this.warn("HDCP policy resticted output with HDCP-LEVEL=NONE");else if(i){t.maxHdcpLevel=qe[qe.indexOf(i)-1],n.resolved=!0,this.warn(`Restricting playback to HDCP-LEVEL of "${t.maxHdcpLevel}" or lower`);break}}case wt:{const t=e.decryptdata;if(t){const r=this.hls.levels,s=r.length;for(let n=s;n--;){var i,a;if(this.variantHasKey(r[n],t))this.log(`Banned key found in level ${n} (${r[n].bitrate}bps) or audio group "${null==(i=r[n].audioGroups)?void 0:i.join(",")}" (${null==(a=e.frag)?void 0:a.type} fragment) ${w(t.keyId||[])}`),r[n].fragmentError++,r[n].loadError++,this.log(`Removing level ${n} with key error (${e.error})`),this.hls.removeLevel(n)}const o=e.frag;if(this.hls.levels.length<s)n.resolved=!0;else if(o&&o.type!==f){const e=o.decryptdata;e&&!t.matches(e)&&(n.resolved=!0)}}break}}n.resolved||this.switchLevel(e,s)}switchLevel(e,t){if(void 0!==t&&e.errorAction&&(this.warn(`switching to level ${t} after ${e.details}`),this.hls.nextAutoLevel=t,e.errorAction.resolved=!0,this.hls.nextLoadLevel=this.hls.nextAutoLevel,e.details===o.BUFFER_ADD_CODEC_ERROR&&e.mimeType&&"audiovideo"!==e.sourceBufferName)){const t=Fe(e.mimeType),n=this.hls.levels;for(let r=n.length;r--;)n[r][`${e.sourceBufferName}Codec`]===t&&(this.log(`Removing level ${r} for ${e.details} ("${t}" not supported)`),this.hls.removeLevel(r))}}},fpsController:class{constructor(e){this.hls=void 0,this.isVideoPlaybackQualityAvailable=!1,this.timer=void 0,this.media=null,this.lastTime=void 0,this.lastDroppedFrames=0,this.lastDecodedFrames=0,this.streamController=void 0,this.hls=e,this.registerListeners()}setStreamController(e){this.streamController=e}registerListeners(){this.hls.on(l.MEDIA_ATTACHING,this.onMediaAttaching,this),this.hls.on(l.MEDIA_DETACHING,this.onMediaDetaching,this)}unregisterListeners(){this.hls.off(l.MEDIA_ATTACHING,this.onMediaAttaching,this),this.hls.off(l.MEDIA_DETACHING,this.onMediaDetaching,this)}destroy(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null}onMediaAttaching(e,t){const n=this.hls.config;if(n.capLevelOnFPSDrop){const e=t.media instanceof self.HTMLVideoElement?t.media:null;this.media=e,e&&"function"==typeof e.getVideoPlaybackQuality&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),n.fpsDroppedMonitoringPeriod)}}onMediaDetaching(){this.media=null}checkFPS(e,t,n){const r=performance.now();if(t){if(this.lastTime){const e=r-this.lastTime,s=n-this.lastDroppedFrames,i=t-this.lastDecodedFrames,a=1e3*s/e,o=this.hls;if(o.trigger(l.FPS_DROP,{currentDropped:s,currentDecoded:i,totalDroppedFrames:n}),a>0&&s>o.config.fpsDroppedMonitoringThreshold*i){let e=o.currentLevel;o.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+e),e>0&&(-1===o.autoLevelCapping||o.autoLevelCapping>=e)&&(e-=1,o.trigger(l.FPS_DROP_LEVEL_CAPPING,{level:e,droppedLevel:o.currentLevel}),o.autoLevelCapping=e,this.streamController.nextLevelSwitch())}}this.lastTime=r,this.lastDroppedFrames=n,this.lastDecodedFrames=t}}checkFPSInterval(){const e=this.media;if(e)if(this.isVideoPlaybackQualityAvailable){const t=e.getVideoPlaybackQuality();this.checkFPS(e,t.totalVideoFrames,t.droppedVideoFrames)}else this.checkFPS(e,e.webkitDecodedFrameCount,e.webkitDroppedFrameCount)}},stretchShortVideoTrack:!1,maxAudioFramesDrift:1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrEwmaDefaultEstimateMax:5e6,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0,emeEnabled:!1,widevineLicenseUrl:void 0,drmSystems:{},drmSystemOptions:{},requestMediaKeySystemAccessFunc:wn,requireKeySystemAccessOnStart:!1,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0,enableDateRangeMetadataCues:!0,enableEmsgMetadataCues:!0,enableEmsgKLVMetadata:!1,enableID3MetadataCues:!0,enableInterstitialPlayback:!0,interstitialAppendInPlace:!0,interstitialLiveLookAhead:10,useMediaCapabilities:!0,preserveManualLevelOnError:!1,certLoadPolicy:{default:{maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:null,errorRetry:null}},keyLoadPolicy:{default:{maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:2e4,backoff:"linear"},errorRetry:{maxNumRetry:8,retryDelayMs:1e3,maxRetryDelayMs:2e4,backoff:"linear"}}},manifestLoadPolicy:{default:{maxTimeToFirstByteMs:1/0,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},playlistLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:2,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},fragLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:12e4,timeoutRetry:{maxNumRetry:4,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:6,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},steeringManifestLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},interstitialAssetListLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:3e4,timeoutRetry:{maxNumRetry:0,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:0,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3},{cueHandler:Fo,enableWebVTT:!0,enableIMSC1:!0,enableCEA708Captions:!0,captionsTextTrack1Label:"English",captionsTextTrack1LanguageCode:"en",captionsTextTrack2Label:"Spanish",captionsTextTrack2LanguageCode:"es",captionsTextTrack3Label:"Unknown CC",captionsTextTrack3LanguageCode:"",captionsTextTrack4Label:"Unknown CC",captionsTextTrack4LanguageCode:"",renderTextTracksNatively:!0}),{},{subtitleStreamController:class extends Mr{constructor(e,t,n){super(e,t,n,"subt
1itle-stream-controller",g),this.currentTrackId=-1,this.tracksBuffered=[],this.mainDetails=null,this.registerListeners()}onHandlerDestroying(){this.unregisterListeners(),super.onHandlerDestroying(),this.mainDetails=null}registerListeners(){super.registerListeners();const{hls:e}=this;e.on(l.LEVEL_LOADED,this.onLevelLoaded,this),e.on(l.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.on(l.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.on(l.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.on(l.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),e.on(l.BUFFER_FLUSHING,this.onBufferFlushing,this)}unregisterListeners(){super.unregisterListeners();const{hls:e}=this;e.off(l.LEVEL_LOADED,this.onLevelLoaded,this),e.off(l.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.off(l.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.off(l.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.off(l.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),e.off(l.BUFFER_FLUSHING,this.onBufferFlushing,this)}startLoad(e,t){this.stopLoad(),this.state=br,this.setInterval(500),this.nextLoadPosition=this.lastCurrentTime=e+this.timelineOffset,this.startPosition=t?-1:e,this.tick()}onManifestLoading(){super.onManifestLoading(),this.mainDetails=null}onMediaDetaching(e,t){this.tracksBuffered=[],super.onMediaDetaching(e,t)}onLevelLoaded(e,t){this.mainDetails=t.details}onSubtitleFragProcessed(e,t){const{frag:n,success:r}=t;if(this.fragContextChanged(n)||(Y(n)&&(this.fragPrevious=n),this.state=br),!r)return;const s=this.tracksBuffered[this.currentTrackId];if(!s)return;let i;const a=n.start;for(let e=0;e<s.length;e++)if(a>=s[e].start&&a<=s[e].end){i=s[e];break}const o=n.start+n.duration;i?i.end=o:(i={start:a,end:o},s.push(i)),this.fragmentTracker.fragBuffered(n),this.fragBufferedComplete(n,null),this.media&&this.tick()}onBufferFlushing(e,t){const{startOffset:n,endOffset:r}=t;if(0===n&&r!==Number.POSITIVE_INFINITY){const e=r-1;if(e<=0)return;t.endOffsetSubtitles=Math.max(0,e),this.tracksBuffered.forEach((t=>{for(let n=0;n<t.length;)if(t[n].end<=e)t.shift();else{if(!(t[n].start<e))break;t[n].start=e,n++}})),this.fragmentTracker.removeFragmentsInRange(n,e,g)}}onError(e,t){const n=t.frag;(null==n?void 0:n.type)===g&&(t.details===o.FRAG_GAP&&this.fragmentTracker.fragBuffered(n,!0),this.fragCurrent&&this.fragCurrent.abortRequests(),this.state!==vr&&(this.state=br))}onSubtitleTracksUpdated(e,{subtitleTracks:t}){this.levels&&fi(this.levels,t)?this.levels=t.map((e=>new et(e))):(this.tracksBuffered=[],this.levels=t.map((e=>{const t=new et(e);return this.tracksBuffered[t.id]=[],t})),this.fragmentTracker.removeFragmentsInRange(0,Number.POSITIVE_INFINITY,g),this.fragPrevious=null,this.mediaBuffer=null)}onSubtitleTrackSwitch(e,t){var n;if(this.currentTrackId=t.id,null==(n=this.levels)||!n.length||-1===this.currentTrackId)return void this.clearInterval();const r=this.levels[this.currentTrackId];null!=r&&r.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,r&&this.state!==vr&&this.setInterval(500)}onSubtitleTrackLoaded(e,t){var n;const{currentTrackId:r,levels:s}=this,{details:i,id:a}=t;if(!s)return void this.warn(`Subtitle tracks were reset while loading level ${a}`);const o=s[a];if(a>=s.length||!o)return;this.log(`Subtitle track ${a} loaded [${i.startSN},${i.endSN}]${i.lastPartSn?`[part-${i.lastPartSn}-${i.lastPartIndex}]`:""},duration:${i.totalduration}`),this.mediaBuffer=this.mediaBufferTimeRanges;let c=0;if(i.live||null!=(n=o.details)&&n.live){if(i.deltaUpdateFailed)return;const e=this.mainDetails;if(!e)return void(this.startFragRequested=!1);const t=e.fragments[0];var u;if(o.details)c=this.alignPlaylists(i,o.details,null==(u=this.levelLastLoaded)?void 0:u.details),0===c&&t&&(c=t.start,ar(i,c));else i.hasProgramDateTime&&e.hasProgramDateTime?(Tr(i,e),c=i.fragmentStart):t&&(c=t.start,ar(i,c));e&&!this.startFragRequested&&this.setStartPosition(e,c)}if(o.details=i,this.levelLastLoaded=o,a===r&&(this.hls.trigger(l.SUBTITLE_TRACK_UPDATED,{details:i,id:a,groupId:t.groupId}),this.tick(),i.live&&!this.fragCurrent&&this.media&&this.state===br)){ft(null,i.fragments,this.media.currentTime,0)||(this.warn("Subtitle playlist not aligned with playback"),o.details=void 0)}}_handleFragmentLoadComplete(e){const{frag:t,payload:n}=e,r=t.decryptdata,s=this.hls;if(!this.fragContextChanged(t)&&n&&n.byteLength>
10&&null!=r&&r.key&&r.iv&&_n(r.method)){const e=performance.now();this.decrypter.decrypt(new Uint8Array(n),r.key.buffer,r.iv.buffer,Tn(r.method)).catch((e=>{throw s.trigger(l.ERROR,{type:a.MEDIA_ERROR,details:o.FRAG_DECRYPT_ERROR,fatal:!1,error:e,reason:e.message,frag:t}),e})).then((n=>{const r=performance.now();s.trigger(l.FRAG_DECRYPTED,{frag:t,payload:n,stats:{tstart:e,tdecrypt:r}})})).catch((e=>{this.warn(`${e.name}: ${e.message}`),this.state=br}))}}doTick(){if(this.media){if(this.state===br){const{currentTrackId:e,levels:t}=this,n=null==t?void 0:t[e];if(!n||!t.length||!n.details)return;if(this.waitForLive(n))return;const{config:r}=this,s=this.getLoadPosition(),i=nn.bufferedInfo(this.tracksBuffered[this.currentTrackId]||[],s,r.maxBufferHole),{end:a,len:o}=i,l=n.details;if(o>this.hls.maxBufferLength+l.levelTargetDuration)return;const c=l.fragments,u=c.length,d=l.edge;let h=null;const f=this.fragPrevious;if(a<d){const e=r.maxFragLookUpTolerance,t=a>d-e?0:e;h=ft(f,c,Math.max(c[0].start,a),t),!h&&f&&f.start<c[0].start&&(h=c[0])}else h=c[u-1];if(h=this.filterReplacedPrimary(h,n.details),!h)return;const p=c[h.sn-l.startSN-1];if(p&&p.cc===h.cc&&this.fragmentTracker.getState(p)===Mt&&(h=p),this.fragmentTracker.getState(h)===Mt){const e=this.mapToInitFragWhenRequired(h);e&&this.loadFragment(e,n,a)}}}else this.state=br}loadFragment(e,t,n){Y(e)?super.loadFragment(e,t,n):this._loadInitSegment(e,t)}get mediaBufferTimeRanges(){return new ja(this.tracksBuffered[this.currentTrackId]||[])}},subtitleTrackController:class extends hi{constructor(e){super(e,"subtitle-track-controller"),this.media=null,this.tracks=[],this.groupIds=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0,this.queuedDefaultTrack=-1,this.useTextTrackPolling=!1,this.subtitlePollingInterval=-1,this._subtitleDisplay=!0,this.asyncPollTrackChange=()=>this.pollTrackChange(0),this.onTextTracksChanged=()=>{if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;let e=null;const t=Ca(this.media.textTracks);for(let n=0;n<t.length;n++)if("hidden"===t[n].mode)e=t[n];else if("showing"===t[n].mode){e=t[n];break}const n=this.findTrackForTextTrack(e);this.subtitleTrack!==n&&this.setSubtitleTrack(n)},this.registerListeners()}destroy(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.currentTrack=null,this.onTextTracksChanged=this.asyncPollTrackChange=null,super.destroy()}get subtitleDisplay(){return this._subtitleDisplay}set subtitleDisplay(e){this._subtitleDisplay=e,this.trackId>-1&&this.toggleTrackModes()}registerListeners(){const{hls:e}=this;
vendor: 1,678 bytes, line 1
1e.on(l.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(l.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(l.MANIFEST_LOADING,this.onManifestLoading,this),e.on(l.MANIFEST_PARSED,this.onManifestParsed,this),e.on(l.LEVEL_LOADING,this.onLevelLoading,this),e.on(l.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(l.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.on(l.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(l.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(l.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(l.MANIFEST_LOADING,this.onManifestLoading,this),e.off(l.MANIFEST_PARSED,this.onManifestParsed,this),e.off(l.LEVEL_LOADING,this.onLevelLoading,this),e.off(l.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(l.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.off(l.ERROR,this.onError,this)}onMediaAttached(e,t){this.media=t.media,this.media&&(this.queuedDefaultTrack>-1&&(this.subtitleTrack=this.queuedDefaultTrack,this.queuedDefaultTrack=-1),this.useTextTrackPolling=!(this.media.textTracks&&"onchange"in this.media.textTracks),this.useTextTrackPolling?this.pollTrackChange(500):this.media.textTracks.addEventListener("change",this.asyncPollTrackChange))}pollTrackChange(e){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.onTextTracksChanged,e)}onMediaDetaching(e,t){const n=this.media;if(!n)return;const r=!!t.transferMedia;if(self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||n.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId),this.subtitleTrack=-1,this.media=null,r)return;
1Ca(n.textTracks).forEach((e=>{Aa(e)}))}onManifestLoading(){this.tracks=[],this.groupIds=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0}onManifestParsed(e,t){this.tracks=t.subtitleTracks}onSubtitleTrackLoaded(e,t){const{id:n,groupId:r,details:s}=t,i=this.tracksInGroup[n];if(!i||i.groupId!==r)return void this.warn(`Subtitle track with id:${n} and group:${r} not found in active group ${null==i?void 0:i.groupId}`);const a=i.details;i.details=t.details,this.log(`Subtitle track ${n} "${i.name}" lang:${i.lang} group:${r} loaded [${s.startSN}-${s.endSN}]`),n===this.trackId&&this.playlistLoaded(n,t,a)}onLevelLoading(e,t){this.switchLevel(t.level)}onLevelSwitching(e,t){this.switchLevel(t.level)}switchLevel(e){const t=this.hls.levels[e];if(!t)return;const n=t.subtitleGroups||null,r=this.groupIds;let s=this.currentTrack;if(!n||(null==r?void 0:r.length)!==(null==n?void 0:n.length)||null!=n&&n.some((e=>-1===(null==r?void 0:r.indexOf(e))))){this.groupIds=n,this.trackId=-1,this.currentTrack=null;const e=this.tracks.filter((e=>!n||-1!==n.indexOf(e.groupId)));if(e.length)this.selectDefaultTrack&&!e.some((e=>e.default))&&(this.selectDefaultTrack=!1),e.forEach(((e,t)=>{e.id=t}));else if(!s&&!this.tracksInGroup.length)return;this.tracksInGroup=e;const t=this.hls.config.subtitlePreference;if(!s&&t){this.selectDefaultTrack=!1;const n=ot(t,e);if(n>-1)s=e[n];else{const e=ot(t,this.tracks);s=this.tracks[e]}}let r=this.findTrackId(s);-1===r&&s&&(r=this.findTrackId(null));const i={subtitleTracks:e};this.log(`Updating subtitle tracks, ${e.length} track(s) found in "${null==n?void 0:n.join(",")}" group-id`),this.hls.trigger(l.SUBTITLE_TRACKS_UPDATED,i),-1!==r&&-1===this.trackId&&this.setSubtitleTrack(r)}}findTrackId(e){const t=this.tracksInGroup,n=this.selectDefaultTrack;for(let r=0;r<t.length;r++){const s=t[r];if((!n||s.default)&&(n||e)&&(!e||lt(s,e)))return r}if(e){for(let n=0;n<t.length;n++){const r=t[n];if(pi(e.attrs,r.attrs,["LANGUAGE","ASSOC-LANGUAGE","CHARACTERISTICS"]))return n}for(let n=0;n<t.length;n++){const r=t[n];if(pi(e.attrs,r.attrs,["LANGUAGE"]))return n}}return-1}findTrackForTextTrack(e){if(e){const t=this.tracksInGroup;for(let n=0;n<t.length;n++){if(gi(t[n],e))return n}}return-1}onError(e,t){!t.fatal&&t.context&&(t.context.type!==h||t.context.id!==this.trackId||this.groupIds&&-1===this.groupIds.indexOf(t.context.groupId)||this.checkRetry(t))}get allSubtitleTracks(){return this.tracks}get subtitleTracks(){return this.tracksInGroup}get subtitleTrack(){return this.trackId}set subtitleTrack(e){this.selectDefaultTrack=!1,this.setSubtitleTrack(e)}setSubtitleOption(e){if(this.hls.config.subtitlePreference=e,e){if(-1===e.id)return this.setSubtitleTrack(-1),null;const t=this.allSubtitleTracks;if(this.selectDefaultTrack=!1,t.length){const n=this.currentTrack;if(n&&lt(e,n))return n;const r=ot(e,this.tracksInGroup);if(r>-1){const e=this.tracksInGroup[r];return this.setSubtitleTrack(r),e}if(n)return null;{const n=ot(e,t);if(n>-1)return t[n]}}}return null}loadPlaylist(e){super.loadPlaylist(),this.shouldLoadPlaylist(this.currentTrack)&&this.scheduleLoading(this.currentTrack,e)}loadingPlaylist(e,t){super.loadingPlaylist(e,t);const n=e.id,r=e.groupId,s=this.getUrlWithDirectives(e.url,t),i=e.details,a=null==i?void 0:i.age;this.log(`Loading subtitle ${n} "${e.name}" lang:${e.lang} group:${r}${void 0!==(null==t?void 0:t.msn)?" at sn "+t.msn+" part "+t.part:""}${a&&i.live?" age "+a.toFixed(1)+(i.type?" "+i.type||0:""):""} ${s}`),this.hls.trigger(l.SUBTITLE_TRACK_LOADING,{url:s,id:n,groupId:r,deliveryDirectives:t||null,track:e})}toggleTrackModes(){const{media:e}=this;if(!e)return;const t=Ca(e.textTracks),n=this.currentTrack;let r;if(n&&(r=t.filter((e=>gi(n,e)))[0],r||this.warn(`Unable to find subtitle TextTrack with name "${n.name}" and language "${n.lang}"`)),[].slice.call(t).forEach((e=>{"disabled"!==e.mode&&e!==r&&(e.mode="disabled")})),r){const e=this.subtitleDisplay?"showing":"hidden";r.mode!==e&&(r.mode=e)}}setSubtitleTrack(e){const t=this.tracksInGroup;if(!this.media)return void(this.queuedDefaultTrack=e);if(e<-1||e>=t.length||!r(e))return void this.warn(`Invalid subtitle track id: ${e}`);this.selectDefaultTrack=!1;const n=this.currentTrack,s=t[e]||null;if(this.trackId=e,this.currentTrack=s,this.toggleTrackModes(),!s)return void this.hls.trigger(l.SUBTITLE_TRACK_SWITCH,{id:e});const i=!!s.details&&!s.details.live;if(e===this.trackId&&s===n&&i)return;this.log(`Switching to subtitle-track ${e}`+(s?` "${s.name}" lang:${s.lang} group:${s.groupId}`:""));const{id:a,groupId:o="",name:c,type:u,url:d}=s;this.hls.trigger(l.SUBTITLE_TRACK_SWITCH,{id:a,groupId:o,name:c,type:u,url:d});const h=this.switchParams(s.url,null==n?void 0:n.details,s.details);this.loadPlaylist(h)}},timelineController:class{constructor(e){this.hls=void 0,this.media=null,this.config=void 0,this.enabled=!0,this.Cues=void 0,this.textTracks=[],this.tracks=[],this.initPTS=[],this.unparsedVttFrags=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.cea608Parser1=void 0,this.cea608Parser2=void 0,this.lastCc=-1,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs={ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!0}},this.captionsProperties=void 0,this.hls=e,this.config=e.config,this.Cues=e.config.cueHandler,this.captionsProperties={textTrack1:{label:this.config.captionsTextTrack1Label,languageCode:this.config.captionsTextTrack1LanguageCode},textTrack2:{label:this.config.captionsTextTrack2Label,languageCode:this.config.captionsTextTrack2LanguageCode},textTrack3:{label:this.config.captionsTextTrack3Label,languageCode:this.config.captionsTextTrack3LanguageCode},textTrack4:{label:this.config.captionsTextTrack4Label,languageCode:this.config.captionsTextTrack4LanguageCode}}
1,e.on(l.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(l.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(l.MANIFEST_LOADING,this.onManifestLoading,this),e.on(l.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(l.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.on(l.FRAG_LOADING,this.onFragLoading,this),e.on(l.FRAG_LOADED,this.onFragLoaded,this),e.on(l.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.on(l.FRAG_DECRYPTED,this.onFragDecrypted,this),e.on(l.INIT_PTS_FOUND,this.onInitPtsFound,this),e.on(l.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.on(l.BUFFER_FLUSHING,this.onBufferFlushing,this)}destroy(){const{hls:e}=this;e.off(l.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(l.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(l.MANIFEST_LOADING,this.onManifestLoading,this),e.off(l.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(l.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.off(l.FRAG_LOADING,this.onFragLoading,this),e.off(l.FRAG_LOADED,this.onFragLoaded,this),e.off(l.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.off(l.FRAG_DECRYPTED,this.onFragDecrypted,this),e.off(l.INIT_PTS_FOUND,this.onInitPtsFound,this),e.off(l.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.off(l.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.media=null,this.cea608Parser1=this.cea608Parser2=void 0}initCea608Parsers(){const e=new Do(this,"textTrack1"),t=new Do(this,"textTrack2"),n=new Do(this,"textTrack3"),r=new Do(this,"textTrack4");this.cea608Parser1=new ao(1,e,t),this.cea608Parser2=new ao(3,n,r)}addCues(e,t,n,r,s){let i=!1;for(let e=s.length;e--;){const r=s[e],l=(a=r[0],o=r[1],c=t,u=n,Math.min(o,u)-Math.max(a,c));if(l>=0&&(r[0]=Math.min(r[0],t),r[1]=Math.max(r[1],n),i=!0,l/(n-t)>.5))return}var a,o,c,u;if(i||s.push([t,n]),this.config.renderTextTracksNatively){const s=this.captionsTracks[e];this.Cues.newCue(s,t,n,r)}else{const s=this.Cues.newCue(null,t,n,r);this.hls.trigger(l.CUES_PARSED,{type:"captions",cues:s,track:e})}}onInitPtsFound(e,{frag:t,id:n,initPTS:r,timescale:s,trackId:i}){const{unparsedVttFrags:a}=this;n===f&&(this.initPTS[t.cc]={baseTime:r,timescale:s,trackId:i}),a.length&&(this.unparsedVttFrags=[],a.forEach((e=>{this.initPTS[e.frag.cc]?this.onFragLoaded(l.FRAG_LOADED,e):this.hls.trigger(l.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:e.frag,error:new Error("Subtitle discontinuity domain does not match main")})})))}getExistingTrack(e,t){const{media:n}=this;if(n)for(let r=0;r<n.textTracks.length;r++){const s=n.textTracks[r];if(Uo(s,{name:e,lang:t,characteristics:"transcribes-spoken-dialog,describes-music-and-sound"}))return s}return null}createCaptionsTrack(e){this.config.renderTextTracksNatively?this.createNativeTrack(e):this.createNonNativeTrack(e)}createNativeTrack(e){if(this.captionsTracks[e])return;const{captionsProperties:t,captionsTracks:n,media:r}=this,{label:s,languageCode:i}=t[e],a=this.getExistingTrack(s,i);if(a)n[e]=a,Aa(n[e]),ba(n[e],r);else{const t=this.createTextTrack("captions",s,i);t&&(t[e]=!0,n[e]=t)}}createNonNativeTrack(e){if(this.nonNativeCaptionsTracks[e])return;const t=this.captionsProperties[e];if(!t)return;const n={_id:e,label:t.label,kind:"captions",default:!!t.media&&!!t.media.default,closedCaptions:t.media};this.nonNativeCaptionsTracks[e]=n,this.hls.trigger(l.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[n]})}createTextTrack(e,t,n){const r=this.media;if(r)return r.addTextTrack(e,t,n)}onMediaAttaching(e,t){this.media=t.media,t.mediaSource||this._cleanTracks()}onMediaDetaching(e,t){const n=!!t.transferMedia;if(this.media=null,n)return;const{captionsTracks:r}=this;Object.keys(r).forEach((e=>{Aa(r[e]),delete r[e]})),this.nonNativeCaptionsTracks={}}onManifestLoading(){this.lastCc=-1,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs={ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!0}},this._cleanTracks(),this.tracks=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.textTracks=[],this.unparsedVttFrags=[],this.initPTS=[],this.cea608Parser1&&this.cea608Parser2&&(this.cea608Parser1.reset(),this.cea608Parser2.reset())}_cleanTracks(){const{media:e}=this;if(!e)return;const t=e.textTracks;
1if(t)for(let e=0;e<t.length;e++)Aa(t[e])}onSubtitleTracksUpdated(e,t){const n=t.subtitleTracks||[],r=n.some((e=>e.textCodec===Io));if(this.config.enableWebVTT||r&&this.config.enableIMSC1){if(fi(this.tracks,n))return void(this.tracks=n);if(this.textTracks=[],this.tracks=n,this.config.renderTextTracksNatively){const e=this.media,t=e?Ca(e.textTracks):null;if(this.tracks.forEach(((e,n)=>{let r;if(t){let n=null;for(let r=0;r<t.length;r++)if(t[r]&&Uo(t[r],e)){n=t[r],t[r]=null;break}n&&(r=n)}if(r)Aa(r);else{const t=xo(e);r=this.createTextTrack(t,e.name,e.lang),r&&(r.mode="disabled")}r&&this.textTracks.push(r)})),null!=t&&t.length){const e=t.filter((e=>null!==e)).map((e=>e.label));e.length&&this.hls.logger.warn(`Media element contains unused subtitle tracks: ${e.join(", ")}. Replace media element for each source to clear TextTracks and captions menu.`)}}else if(this.tracks.length){const e=this.tracks.map((e=>({label:e.name,kind:e.type.toLowerCase(),default:e.default,subtitleTrack:e})));this.hls.trigger(l.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:e})}}}onManifestLoaded(e,t){this.config.enableCEA708Captions&&t.captions&&t.captions.forEach((e=>{const t=/(?:CC|SERVICE)([1-4])/.exec(e.instreamId);if(!t)return;const n=`textTrack${t[1]}`,r=this.captionsProperties[n];r&&(r.label=e.name,e.lang&&(r.languageCode=e.lang),r.media=e)}))}closedCaptionsForLevel(e){const t=this.hls.levels[e.level];return null==t?void 0:t.attrs["CLOSED-CAPTIONS"]}onFragLoading(e,t){if(this.enabled&&t.frag.type===f){var n,r;const{cea608Parser1:e,cea608Parser2:s,lastSn:i}=this,{cc:a,sn:o}=t.frag,l=null!=(n=null==(r=t.part)?void 0:r.index)?n:-1;e&&s&&(o!==i+1||o===i&&l!==this.lastPartIndex+1||a!==this.lastCc)&&(e.reset(),s.reset()),this.lastCc=a,this.lastSn=o,this.lastPartIndex=l}}onFragLoaded(e,t){const{frag:n,payload:r}=t;if(n.type===g)if(r.byteLength){const e=n.decryptdata,s="stats"in t;if(null==e||!e.encrypted||s){const e=this.tracks[n.level],s=this.vttCCs;s[n.cc]||(s[n.cc]={start:n.start,prevCC:this.prevCC,new:!0},this.prevCC=n.cc),e&&e.textCodec===Io?this._parseIMSC1(n,r):this._parseVTTs(t)}}else this.hls.trigger(l.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:n,error:new Error("Empty subtitle payload")})}_parseIMSC1(e,t){const n=this.hls;ko(t,this.initPTS[e.cc],(t=>{this._appendCues(t,e.level),n.trigger(l.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:e})}),(t=>{n.logger.log(`Failed to parse IMSC1: ${t}`),n.trigger(l.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:e,error:t})}))}_parseVTTs(e){var t;const{frag:n,payload:r}=e,{initPTS:s,unparsedVttFrags:i}=this,a=s.length-1;if(!s[n.cc]&&-1===a)return void i.push(e);const o=this.hls;bo(null!=(t=n.initSegment)&&t.data?me(n.initSegment.data,new Uint8Array(r)).buffer:r,this.initPTS[n.cc],this.vttCCs,n.cc,n.start,(e=>{this._appendCues(e,n.level),o.trigger(l.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:n})}),(t=>{const s="Missing initPTS for VTT MPEGTS"===t.message;s?i.push(e):this._fallbackToIMSC1(n,r),o.logger.log(`Failed to parse VTT cue: ${t}`),s&&a>n.cc||o.trigger(l.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:n,error:t})}))}_fallbackToIMSC1(e,t){const n=this.tracks[e.level];n.textCodec||ko(t,this.initPTS[e.cc],(()=>{n.textCodec=Io,this._parseIMSC1(e,t)}),(()=>{n.textCodec="wvtt"}))}_appendCues(e,t){const n=this.hls;if(this.config.renderTextTracksNatively){const n=this.textTracks[t];if(!n||"disabled"===n.mode)return;e.forEach((e=>Ia(n,e)))}else{const r=this.tracks[t];if(!r)return;const s=r.default?"default":"subtitles"+t;n.trigger(l.CUES_PARSED,{type:"subtitles",cues:e,track:s})}}onFragDecrypted(e,t){const{frag:n}=t;n.type===g&&this.onFragLoaded(l.FRAG_LOADED,t)}onSubtitleTracksCleared(){this.tracks=[],this.captionsTracks={}}onFragParsingUserdata(e,t){if(!this.enabled||!this.config.enableCEA708Captions)return;const{frag:n,samples:r}=t;if(n.type!==f||"NONE"!==this.closedCaptionsForLevel(n))for(let e=0;e<r.length;e++){const t=r[e].bytes;if(t){this.cea608Parser1||this.initCea608Parsers();const n=this.extractCea608Data(t);this.cea608Parser1.addData(r[e].pts,n[0]),this.cea608Parser2.addData(r[e].pts,n[1])}}}onBufferFlushing(e,{startOffset:t,endOffset:n,endOffsetSubtitles:r,type:s}){const{media:i}=this;
1if(i&&!(i.currentTime<n)){if(!s||"video"===s){const{captionsTracks:e}=this;Object.keys(e).forEach((r=>Ra(e[r],t,n)))}if(this.config.renderTextTracksNatively&&0===t&&void 0!==r){const{textTracks:e}=this;Object.keys(e).forEach((n=>Ra(e[n],t,r)))}}}extractCea608Data(e){const t=[[],[]],n=31&e[0];let r=2;for(let s=0;s<n;s++){const n=e[r++],s=127&e[r++],i=127&e[r++];if(0===s&&0===i)continue;if(!!(4&n)){const e=3&n;0!==e&&1!==e||(t[e].push(s),t[e].push(i))}}return t}},audioStreamController:class extends Mr{constructor(e,t,n){super(e,t,n,"audio-stream-controller",p),this.mainAnchor=null,this.mainFragLoading=null,this.audioOnly=!1,this.bufferedTrack=null,this.switchingTrack=null,this.trackId=-1,this.waitingData=null,this.mainDetails=null,this.flushing=!1,this.bufferFlushed=!1,this.cachedTrackLoadedData=null,this.registerListeners()}onHandlerDestroying(){this.unregisterListeners(),super.onHandlerDestroying(),this.resetItem()}resetItem(){this.mainDetails=this.mainAnchor=this.mainFragLoading=this.bufferedTrack=this.switchingTrack=this.waitingData=this.cachedTrackLoadedData=null}registerListeners(){super.registerListeners();const{hls:e}=this;e.on(l.LEVEL_LOADED,this.onLevelLoaded,this),e.on(l.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),e.on(l.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(l.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.on(l.BUFFER_RESET,this.onBufferReset,this),e.on(l.BUFFER_CREATED,this.onBufferCreated,this),e.on(l.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(l.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(l.INIT_PTS_FOUND,this.onInitPtsFound,this),e.on(l.FRAG_LOADING,this.onFragLoading,this),e.on(l.FRAG_BUFFERED,this.onFragBuffered,this)}unregisterListeners(){const{hls:e}=this;e&&(super.unregisterListeners(),e.off(l.LEVEL_LOADED,this.onLevelLoaded,this),e.off(l.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),e.off(l.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(l.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.off(l.BUFFER_RESET,this.onBufferReset,this),e.off(l.BUFFER_CREATED,this.onBufferCreated,this),e.off(l.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(l.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(l.INIT_PTS_FOUND,this.onInitPtsFound,this),e.off(l.FRAG_LOADING,this.onFragLoading,this),e.off(l.FRAG_BUFFERED,this.onFragBuffered,this))}onInitPtsFound(e,{frag:t,id:n,initPTS:r,timescale:s,trackId:i}){if(n===f){const e=t.cc,n=this.fragCurrent;if(this.initPTS[e]={baseTime:r,timescale:s,trackId:i},this.log(`InitPTS for cc: ${e} found from main: ${r/s} (${r}/${s}) trackId: ${i}`),this.mainAnchor=t,this.state===wr){const n=this.waitingData;(!n&&!this.loadingParts||n&&n.frag.cc!==e)&&this.syncWithAnchor(t,null==n?void 0:n.frag)}else!this.hls.hasEnoughToStart&&n&&n.cc!==e?(n.abortRequests(),this.syncWithAnchor(t,n)):this.state===br&&this.tick()}}getLoadPosition(){return!this.startFragRequested&&this.nextLoadPosition>=0?this.nextLoadPosition:super.getLoadPosition()}syncWithAnchor(e,t){var n;const r=(null==(n=this.mainFragLoading)?void 0:n.frag)||null;if(t&&(null==r?void 0:r.cc)===t.cc)return;const s=(r||e).cc,i=mt(this.getLevelDetails(),s,this.getLoadPosition());i&&(this.log(`Syncing with main frag at ${i.start} cc ${i.cc}`),this.startFragRequested=!1,this.nextLoadPosition=i.start,this.resetLoadingState(),this.state===br&&this.doTickIdle())}startLoad(e,t){if(!this.levels)return this.startPosition=e,void(this.state=vr);const n=this.lastCurrentTime;this.stopLoad(),this.setInterval(100),n>0&&-1===e?(this.log(`Override startPosition with lastCurrentTime @${n.toFixed(3)}`),e=n,this.state=br):this.state=Cr,this.nextLoadPosition=this.lastCurrentTime=e+this.timelineOffset,this.startPosition=t?-1:e,this.tick()}doTick(){switch(this.state){case br:this.doTickIdle();break;case Cr:{const{levels:e,trackId:t}=this,n=null==e?void 0:e[t],r=null==n?void 0:n.details;if(r&&!this.waitForLive(n)){if(this.waitForCdnTuneIn(r))break;this.state=wr}break}case Rr:this.checkRetryDate();break;case wr:{const e=this.waitingData;if(e){const{frag:t,part:n,cache:r,complete:s}=e,i=this.mainAnchor;if(void 0!==this.initPTS[t.cc]){this.waitingData=null,this.state=Ar;const e={frag:t,part:n,payload:r.flush().buffer,networkDetails:null};this._handleFragmentLoadProgress(e),s&&super._handleFragmentLoadComplete(e)}else i&&i.cc!==e.frag.cc&&this.syncWithAnchor(i,e.frag)}else this.state=br}}this.onTickEnd()}
1resetLoadingState(){const e=this.waitingData;e&&(this.fragmentTracker.removeFragment(e.frag),this.waitingData=null),super.resetLoadingState()}onTickEnd(){const{media:e}=this;null!=e&&e.readyState&&(this.lastCurrentTime=e.currentTime)}doTickIdle(){var e;const{hls:t,levels:n,media:r,trackId:s}=this,i=t.config;if(!this.buffering||!r&&!this.primaryPrefetch&&(this.startFragRequested||!i.startFragPrefetch)||null==n||!n[s])return;const a=n[s],o=a.details;if(!o||this.waitForLive(a)||this.waitForCdnTuneIn(o))return this.state=Cr,void(this.startFragRequested=!1);const c=this.mediaBuffer?this.mediaBuffer:this.media;this.bufferFlushed&&c&&(this.bufferFlushed=!1,this.afterBufferFlushed(c,W,p));const u=this.getFwdBufferInfo(c,p);if(null===u)return;if(!this.switchingTrack&&this._streamEnded(u,o))return t.trigger(l.BUFFER_EOS,{type:"audio"}),void(this.state=Or);const d=u.len,h=t.maxBufferLength,g=o.fragments,m=g[0].start,_=this.getLoadPosition(),T=this.flushing?_:u.end;if(this.switchingTrack&&r){const e=_;o.PTSKnown&&e<m&&(u.end>m||u.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),r.currentTime=m+.05)}if(d>=h&&!this.switchingTrack&&T<g[g.length-1].start)return;let E=this.getNextFragment(T,o);if(E&&this.isLoopLoading(E,T)&&(E=this.getNextFragmentLoopLoading(E,o,u,f,h)),!E)return void(this.bufferFlushed=!0);let y=(null==(e=this.mainFragLoading)?void 0:e.frag)||null;if(!this.audioOnly&&this.startFragRequested&&y&&Y(E)&&!E.endList&&(!o.live||!this.loadingParts&&T<this.hls.liveSyncPosition)&&(this.fragmentTracker.getState(y)===Ut&&(this.mainFragLoading=y=null),y&&Y(y))){if(E.start>y.end){const e=this.fragmentTracker.getFragAtPos(T,f);e&&e.end>y.end&&(y=e,this.mainFragLoading={frag:e,targetBufferTime:null})}if(E.start>y.end)return}this.loadFragment(E,a,T)}onMediaDetaching(e,t){this.bufferFlushed=this.flushing=!1,super.onMediaDetaching(e,t)}onAudioTracksUpdated(e,{audioTracks:t}){this.resetTransmuxer(),this.levels=t.map((e=>new et(e)))}onAudioTrackSwitching(e,t){const n=!!t.url;this.trackId=t.id;const{fragCurrent:r}=this;r&&(r.abortRequests(),this.removeUnbufferedFrags(r.start)),this.resetLoadingState(),n?(this.switchingTrack=t,this.flushAudioIfNeeded(t),this.state!==vr&&(this.setInterval(100),this.state=br,this.tick())):(this.resetTransmuxer(),this.switchingTrack=null,this.bufferedTrack=t,this.clearInterval())}onManifestLoading(){super.onManifestLoading(),this.bufferFlushed=this.flushing=this.audioOnly=!1,this.resetItem(),this.trackId=-1}onLevelLoaded(e,t){this.mainDetails=t.details;const n=this.cachedTrackLoadedData;n&&(this.cachedTrackLoadedData=null,this.onAudioTrackLoaded(l.AUDIO_TRACK_LOADED,n))}onAudioTrackLoaded(e,t){var n;const{levels:r}=this,{details:s,id:i,groupId:a,track:o}=t;if(!r)return void this.warn(`Audio tracks reset while loading track ${i} "${o.name}" of "${a}"`);const c=this.mainDetails;if(!c||s.endCC>c.endCC||c.expired)return this.cachedTrackLoadedData=t,void(this.state!==vr&&(this.state=Cr));this.cachedTrackLoadedData=null,this.log(`Audio track ${i} "${o.name}" of "${a}" loaded [${s.startSN},${s.endSN}]${s.lastPartSn?`[part-${s.lastPartSn}-${s.lastPartIndex}]`:""},duration:${s.totalduration}`);const u=r[i];let d=0;if(s.live||null!=(n=u.details)&&n.live){if(this.checkLiveUpdate(s),s.deltaUpdateFailed)return;var h;if(u.details)d=this.alignPlaylists(s,u.details,null==(h=this.levelLastLoaded)?void 0:h.details);s.alignedSliding||(_r(s,c),s.alignedSliding||Tr(s,c),d=s.fragmentStart)}u.details=s,this.levelLastLoaded=u,this.startFragRequested||this.setStartPosition(c,d),this.hls.trigger(l.AUDIO_TRACK_UPDATED,{details:s,id:i,groupId:t.groupId}),this.state!==Cr||this.waitForCdnTuneIn(s)||(this.state=br),this.tick()}_handleFragmentLoadProgress(e){var t;const n=e.frag,{part:r,payload:s}=e,{config:i,trackId:a,levels:o}=this;if(!o)return void this.warn(`Audio tracks were reset while fragment load was in progress. Fragment ${n.sn} of level ${n.level} will not be buffered`);const l=o[a];if(!l)return void this.warn("Audio track is undefined on fragment load progress");const c=l.details;if(!c)return this.warn("Audio track details undefined on fragment load progress"),void this.removeUnbufferedFrags(n.start);const u=i.defaultAudioCodec||l.audioCodec||"mp4a.40.2";let d=this.transmuxer;
1d||(d=this.transmuxer=new di(this.hls,p,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));const h=this.initPTS[n.cc],f=null==(t=n.initSegment)?void 0:t.data;if(void 0!==h){const e=!1,t=r?r.index:-1,i=-1!==t,a=new en(n.level,n.sn,n.stats.chunkCount,s.byteLength,t,i);d.push(s,f,u,"",n,r,c.totalduration,e,a,h)}else{this.log(`Unknown video PTS for cc ${n.cc}, waiting for video PTS before demuxing audio frag ${n.sn} of [${c.startSN} ,${c.endSN}],track ${a}`);const{cache:e}=this.waitingData=this.waitingData||{frag:n,part:r,cache:new xr,complete:!1};e.push(new Uint8Array(s)),this.state!==vr&&(this.state=wr)}}_handleFragmentLoadComplete(e){this.waitingData?this.waitingData.complete=!0:super._handleFragmentLoadComplete(e)}onBufferReset(){this.mediaBuffer=null}onBufferCreated(e,t){this.bufferFlushed=this.flushing=!1;const n=t.tracks.audio;n&&(this.mediaBuffer=n.buffer||null)}onFragLoading(e,t){!this.audioOnly&&t.frag.type===f&&Y(t.frag)&&(this.mainFragLoading=t,this.state===br&&this.tick())}onFragBuffered(e,t){const{frag:n,part:r}=t;if(n.type===p)if(this.fragContextChanged(n))this.warn(`Fragment ${n.sn}${r?" p: "+r.index:""} of level ${n.level} finished buffering, but was aborted. state: ${this.state}, audioSwitch: ${this.switchingTrack?this.switchingTrack.name:"false"}`);else{if(Y(n)){this.fragPrevious=n;const e=this.switchingTrack;e&&(this.bufferedTrack=e,this.switchingTrack=null,this.hls.trigger(l.AUDIO_TRACK_SWITCHED,S({},e)))}this.fragBufferedComplete(n,r),this.media&&this.tick()}else this.audioOnly||n.type!==f||n.elementaryStreams.video||n.elementaryStreams.audiovideo||(this.audioOnly=!0,this.mainFragLoading=null)}onError(e,t){var n;if(t.fatal)this.state=Nr;else switch(t.details){case o.FRAG_GAP:case o.FRAG_PARSING_ERROR:case o.FRAG_DECRYPT_ERROR:case o.FRAG_LOAD_ERROR:case o.FRAG_LOAD_TIMEOUT:case o.KEY_LOAD_ERROR:case o.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(p,t);break;case o.AUDIO_TRACK_LOAD_ERROR:case o.AUDIO_TRACK_LOAD_TIMEOUT:case o.LEVEL_PARSING_ERROR:t.levelRetry||this.state!==Cr||(null==(n=t.context)?void 0:n.type)!==d||(this.state=br);break;case o.BUFFER_ADD_CODEC_ERROR:case o.BUFFER_APPEND_ERROR:if("audio"!==t.parent)return;this.reduceLengthAndFlushBuffer(t)||this.resetLoadingState();break;case o.BUFFER_FULL_ERROR:if("audio"!==t.parent)return;this.reduceLengthAndFlushBuffer(t)&&(this.bufferedTrack=null,super.flushMainBuffer(0,Number.POSITIVE_INFINITY,"audio"));break;case o.INTERNAL_EXCEPTION:this.recoverWorkerError(t)}}onBufferFlushing(e,{type:t}){t!==K&&(this.flushing=!0)}onBufferFlushed(e,{type:t}){if(t!==K){this.flushing=!1,this.bufferFlushed=!0,this.state===Or&&(this.state=br);const e=this.mediaBuffer||this.media;e&&(this.afterBufferFlushed(e,t,p),this.tick())}}_handleTransmuxComplete(e){var t;const n="audio",{hls:r}=this,{remuxResult:s,chunkMeta:i}=e,a=this.getCurrentContext(i);if(!a)return void this.resetWhenMissingContext(i);const{frag:o,part:c,level:u}=a,{details:d}=u,{audio:h,text:f,id3:p,initSegment:g}=s;if(!this.fragContextChanged(o)&&d){if(this.state=kr,this.switchingTrack&&h&&this.completeAudioSwitch(this.switchingTrack),null!=g&&g.tracks){const e=o.initSegment||o;if(this.unhandledEncryptionError(g,o))return;this._bufferInitSegment(u,g.tracks,e,i),r.trigger(l.FRAG_PARSING_INIT_SEGMENT,{frag:e,id:n,tracks:g.tracks})}if(h){const{startPTS:e,endPTS:t,startDTS:n,endDTS:r}=h;c&&(c.elementaryStreams[W]={startPTS:e,endPTS:t,startDTS:n,endDTS:r}),o.setElementaryStreamInfo(W,e,t,n,r),this.bufferFragmentData(h,o,c,i)}if(null!=p&&null!=(t=p.samples)&&t.length){const e=E({id:n,frag:o,details:d},p);r.trigger(l.FRAG_PARSING_METADATA,e)}if(f){const e=E({id:n,frag:o,details:d},f);r.trigger(l.FRAG_PARSING_USERDATA,e)}}else this.fragmentTracker.removeFragment(o)}_bufferInitSegment(e,t,n,r){if(this.state!==kr)return;if(t.video&&delete t.video,t.audiovideo&&delete t.audiovideo,!t.audio)return;const s=t.audio;s.id=p;const i=e.audioCodec;this.log(`Init audio buffer, container:${s.container}, codecs[level/parsed]=[${i}/${s.codec}]`),i&&1===i.split(",").length&&(s.levelCodec=i),this.hls.trigger(l.BUFFER_CODECS,t);const a=s.initSegment;if(null!=a&&a.byteLength){const e={type:"audio",frag:n,part:null,chunkMeta:r,parent:n.type,data:a};this.hls.trigger(l.BUFFER_APPENDING,e)}this.tickImmediate()}loadFragment(e,t,n){const r=this.fragmentTracker.getState(e);var s;if(this.switchingTrack||r===Mt||r===xt)if(Y(e))if(null!=(s=t.details)&&s.live&&!this.initPTS[e.cc]){this.log(`Waiting for video PTS in continuity counter ${e.cc} of live stream before loading audio fragment ${e.sn} of level ${this.trackId}`),this.state=wr;const n=this.mainDetails;n&&n.fragmentStart!==t.details.fragmentStart&&Tr(t.details,n)}else super.loadFragment(e,t,n);else this._loadInitSegment(e,t);else this.clearTrackerIfNeeded(e)}flushAudioIfNeeded(e){if(this.media&&this.bufferedTrack){const{name:t,lang:n,assocLang:r,characteristics:s,audioCodec:i,channels:a}=this.bufferedTrack;lt({name:t,lang:n,assocLang:r,characteristics:s,audioCodec:i,channels:a}
1,e,ct)||(dt(e.url,this.hls)?(this.log("Switching audio track : flushing all audio"),super.flushMainBuffer(0,Number.POSITIVE_INFINITY,"audio"),this.bufferedTrack=null):this.bufferedTrack=e)}}completeAudioSwitch(e){const{hls:t}=this;this.flushAudioIfNeeded(e),this.bufferedTrack=e,this.switchingTrack=null,t.trigger(l.AUDIO_TRACK_SWITCHED,S({},e))}},audioTrackController:class extends hi{constructor(e){super(e,"audio-track-controller"),this.tracks=[],this.groupIds=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0,this.registerListeners()}registerListeners(){const{hls:e}=this;e.on(l.MANIFEST_LOADING,this.onManifestLoading,this),e.on(l.MANIFEST_PARSED,this.onManifestParsed,this),e.on(l.LEVEL_LOADING,this.onLevelLoading,this),e.on(l.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(l.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.on(l.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(l.MANIFEST_LOADING,this.onManifestLoading,this),e.off(l.MANIFEST_PARSED,this.onManifestParsed,this),e.off(l.LEVEL_LOADING,this.onLevelLoading,this),e.off(l.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(l.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.off(l.ERROR,this.onError,this)}destroy(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.currentTrack=null,super.destroy()}onManifestLoading(){this.tracks=[],this.tracksInGroup=[],this.groupIds=null,this.currentTrack=null,this.trackId=-1,this.selectDefaultTrack=!0}onManifestParsed(e,t){this.tracks=t.audioTracks||[]}onAudioTrackLoaded(e,t){const{id:n,groupId:r,details:s}=t,i=this.tracksInGroup[n];if(!i||i.groupId!==r)return void this.warn(`Audio track with id:${n} and group:${r} not found in active group ${null==i?void 0:i.groupId}`);const a=i.details;i.details=t.details,this.log(`Audio track ${n} "${i.name}" lang:${i.lang} group:${r} loaded [${s.startSN}-${s.endSN}]`),n===this.trackId&&this.playlistLoaded(n,t,a)}onLevelLoading(e,t){this.switchLevel(t.level)}onLevelSwitching(e,t){this.switchLevel(t.level)}switchLevel(e){const t=this.hls.levels[e];if(!t)return;const n=t.audioGroups||null,r=this.groupIds;let s=this.currentTrack;if(!n||(null==r?void 0:r.length)!==(null==n?void 0:n.length)||null!=n&&n.some((e=>-1===(null==r?void 0:r.indexOf(e))))){this.groupIds=n,this.trackId=-1,this.currentTrack=null;const e=this.tracks.filter((e=>!n||-1!==n.indexOf(e.groupId)));if(e.length)this.selectDefaultTrack&&!e.some((e=>e.default))&&(this.selectDefaultTrack=!1),e.forEach(((e,t)=>{e.id=t}));else if(!s&&!this.tracksInGroup.length)return;this.tracksInGroup=e;const t=this.hls.config.audioPreference;if(!s&&t){const n=ot(t,e,ct);if(n>-1)s=e[n];else{const e=ot(t,this.tracks);s=this.tracks[e]}}let r=this.findTrackId(s);-1===r&&s&&(r=this.findTrackId(null));const c={audioTracks:e};this.log(`Updating audio tracks, ${e.length} track(s) found in group(s): ${null==n?void 0:n.join(",")}`),this.hls.trigger(l.AUDIO_TRACKS_UPDATED,c);const u=this.trackId;if(-1!==r&&-1===u)this.setAudioTrack(r);else if(e.length&&-1===u){var i;const t=new Error(`No audio track selected for current audio group-ID(s): ${null==(i=this.groupIds)?void 0:i.join(",")} track count: ${e.length}`);this.warn(t.message),this.hls.trigger(l.ERROR,{type:a.MEDIA_ERROR,details:o.AUDIO_TRACK_LOAD_ERROR,fatal:!0,error:t})}}}onError(e,t){!t.fatal&&t.context&&(t.context.type!==d||t.context.id!==this.trackId||this.groupIds&&-1===this.groupIds.indexOf(t.context.groupId)||this.checkRetry(t))}get allAudioTracks(){return this.tracks}get audioTracks(){return this.tracksInGroup}get audioTrack(){return this.trackId}set audioTrack(e){this.selectDefaultTrack=!1,this.setAudioTrack(e)}setAudioOption(e){const t=this.hls;if(t.config.audioPreference=e,e){const n=this.allAudioTracks;
1if(this.selectDefaultTrack=!1,n.length){const r=this.currentTrack;if(r&&lt(e,r,ct))return r;const s=ot(e,this.tracksInGroup,ct);if(s>-1){const e=this.tracksInGroup[s];return this.setAudioTrack(s),e}if(r){let r=t.loadLevel;-1===r&&(r=t.firstAutoLevel);const s=function(e,t,n,r,s){const i=t[r],a=t.reduce(((e,t,n)=>{const r=t.uri;return(e[r]||(e[r]=[])).push(n),e}),{})[i.uri];a.length>1&&(r=Math.max.apply(Math,a));const o=i.videoRange,l=i.frameRate,c=i.codecSet.substring(0,4),u=ut(t,r,(t=>{if(t.videoRange!==o||t.frameRate!==l||t.codecSet.substring(0,4)!==c)return!1;const r=t.audioGroups,i=n.filter((e=>!r||-1!==r.indexOf(e.groupId)));return ot(e,i,s)>-1}));return u>-1?u:ut(t,r,(t=>{const r=t.audioGroups,i=n.filter((e=>!r||-1!==r.indexOf(e.groupId)));return ot(e,i,s)>-1}))}(e,t.levels,n,r,ct);if(-1===s)return null;t.nextLoadLevel=s}if(e.channels||e.audioCodec){const t=ot(e,n);if(t>-1)return n[t]}}}return null}setAudioTrack(e){const t=this.tracksInGroup;if(e<0||e>=t.length)return void this.warn(`Invalid audio track id: ${e}`);this.selectDefaultTrack=!1;const n=this.currentTrack,r=t[e],s=r.details&&!r.details.live;if(e===this.trackId&&r===n&&s)return;if(this.log(`Switching to audio-track ${e} "${r.name}" lang:${r.lang} group:${r.groupId} channels:${r.channels}`),this.trackId=e,this.currentTrack=r,this.hls.trigger(l.AUDIO_TRACK_SWITCHING,S({},r)),s)return;const i=this.switchParams(r.url,null==n?void 0:n.details,r.details);this.loadPlaylist(i)}findTrackId(e){const t=this.tracksInGroup;for(let n=0;n<t.length;n++){const r=t[n];if((!this.selectDefaultTrack||r.default)&&(!e||lt(e,r,ct)))return n}if(e){const{name:n,lang:r,assocLang:s,characteristics:i,audioCodec:a,channels:o}=e;for(let e=0;e<t.length;e++){if(lt({name:n,lang:r,assocLang:s,characteristics:i,audioCodec:a,channels:o},t[e],ct))return e}for(let n=0;n<t.length;n++){const r=t[n];if(pi(e.attrs,r.attrs,["LANGUAGE","ASSOC-LANGUAGE","CHARACTERISTICS"]))return n}for(let n=0;n<t.length;n++){const r=t[n];if(pi(e.attrs,r.attrs,["LANGUAGE"]))return n}}return-1}loadPlaylist(e){super.loadPlaylist();const t=this.currentTrack;this.shouldLoadPlaylist(t)&&dt(t.url,this.hls)&&this.scheduleLoading(t,e)}loadingPlaylist(e,t){super.loadingPlaylist(e,t);const n=e.id,r=e.groupId,s=this.getUrlWithDirectives(e.url,t),i=e.details,a=null==i?void 0:i.age;this.log(`Loading audio-track ${n} "${e.name}" lang:${e.lang} group:${r}${void 0!==(null==t?void 0:t.msn)?" at sn "+t.msn+" part "+t.part:""}${a&&i.live?" age "+a.toFixed(1)+(i.type?" "+i.type||0:""):""} ${s}`),this.hls.trigger(l.AUDIO_TRACK_LOADING,{url:s,id:n,groupId:r,deliveryDirectives:t||null,track:e})}},emeController:Ta,cmcdController:class{constructor(e){this.hls=void 0,this.config=void 0,this.media=void 0,this.sid=void 0,this.cid=void 0,this.useHeaders=!1,this.includeKeys=void 0,this.initialized=!1,this.starved=!1,this.buffering=!0,this.audioBuffer=void 0,this.videoBuffer=void 0,this.onWaiting=()=>{this.initialized&&(this.starved=!0),this.buffering=!0},this.onPlaying=()=>{this.initialized||(this.initialized=!0),this.buffering=!1},this.applyPlaylistData=e=>{try{this.apply(e,{ot:bi.MANIFEST,su:!this.initialized})}catch(e){this.hls.logger.warn("Could not generate manifest CMCD data.",e)}},this.applyFragmentData=e=>{try{const{frag:t,part:n}=e,r=this.hls.levels[t.level],s=this.getObjectType(t),i={d:1e3*(n||t).duration,ot:s};s!==bi.VIDEO&&s!==bi.AUDIO&&s!=bi.MUXED||(i.br=r.bitrate/1e3,i.tb=this.getTopBandwidth(s)/1e3,i.bl=this.getBufferLength(s));const a=n?this.getNextPart(n):this.getNextFrag(t);null!=a&&a.url&&a.url!==t.url&&(i.nor=a.url),this.apply(e,i)}catch(e){this.hls.logger.warn("Could not generate segment CMCD data.",e)}},this.hls=e;const t=this.config=e.config,{cmcd:n}=t;null!=n&&(t.pLoader=this.createPlaylistLoader(),t.fLoader=this.createFragmentLoader(),this.sid=n.sessionId||e.sessionId,this.cid=n.contentId,this.useHeaders=!0===n.useHeaders,this.includeKeys=n.includeKeys,this.registerListeners())}registerListeners(){const e=this.hls;
1e.on(l.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(l.MEDIA_DETACHED,this.onMediaDetached,this),e.on(l.BUFFER_CREATED,this.onBufferCreated,this)}unregisterListeners(){const e=this.hls;e.off(l.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(l.MEDIA_DETACHED,this.onMediaDetached,this),e.off(l.BUFFER_CREATED,this.onBufferCreated,this)}destroy(){this.unregisterListeners(),this.onMediaDetached(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null,this.onWaiting=this.onPlaying=this.media=null}onMediaAttached(e,t){this.media=t.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)}onMediaDetached(){this.media&&(this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null)}onBufferCreated(e,t){var n,r;this.audioBuffer=null==(n=t.tracks.audio)?void 0:n.buffer,this.videoBuffer=null==(r=t.tracks.video)?void 0:r.buffer}createData(){var e;return{v:1,sf:Ii.HLS,sid:this.sid,cid:this.cid,pr:null==(e=this.media)?void 0:e.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}}apply(e,t={}){E(t,this.createData());const n=t.ot===bi.INIT||t.ot===bi.VIDEO||t.ot===bi.MUXED;this.starved&&n&&(t.bs=!0,t.su=!0,this.starved=!1),null==t.su&&(t.su=this.buffering);const{includeKeys:r}=this;r&&(t=Object.keys(t).reduce(((e,n)=>(r.includes(n)&&(e[n]=t[n]),e)),{}));const s={baseUrl:e.url};this.useHeaders?(e.headers||(e.headers={}),ha(e.headers,t,s)):e.url=ga(e.url,t,s)}getNextFrag(e){var t;const n=null==(t=this.hls.levels[e.level])?void 0:t.details;if(n){const t=e.sn-n.startSN;return n.fragments[t+1]}}getNextPart(e){var t;const{index:n,fragment:r}=e,s=null==(t=this.hls.levels[r.level])||null==(t=t.details)?void 0:t.partList;if(s){const{sn:e}=r;for(let t=s.length-1;t>=0;t--){const r=s[t];if(r.index===n&&r.fragment.sn===e)return s[t+1]}}}getObjectType(e){const{type:t}=e;return"subtitle"===t?bi.TIMED_TEXT:"initSegment"===e.sn?bi.INIT:"audio"===t?bi.AUDIO:"main"===t?this.hls.audioTracks.length?bi.VIDEO:bi.MUXED:void 0}getTopBandwidth(e){let t,n=0;const r=this.hls;if(e===bi.AUDIO)t=r.audioTracks;else{const e=r.maxAutoLevel,n=e>-1?e+1:r.levels.length;t=r.levels.slice(0,n)}return t.forEach((e=>{e.bitrate>n&&(n=e.bitrate)})),n>0?n:NaN}getBufferLength(e){const t=this.media,n=e===bi.AUDIO?this.audioBuffer:this.videoBuffer;if(!n||!t)return NaN;return 1e3*nn.bufferInfo(n,t.currentTime,this.config.maxBufferHole).len}createPlaylistLoader(){const{pLoader:e}=this.config,t=this.applyPlaylistData,n=e||this.config.loader;return class{constructor(e){this.loader=void 0,this.loader=new n(e)}get stats(){return this.loader.stats}get context(){return this.loader.context}destroy(){this.loader.destroy()}abort(){this.loader.abort()}load(e,n,r){t(e),this.loader.load(e,n,r)}}}createFragmentLoader(){const{fLoader:e}=this.config,t=this.applyFragmentData,n=e||this.config.loader;return class{constructor(e){this.loader=void 0,this.loader=new n(e)}get stats(){return this.loader.stats}get context(){return this.loader.context}destroy(){this.loader.destroy()}abort(){this.loader.abort()}load(e,n,r){t(e),this.loader.load(e,n,r)}}}},contentSteeringController:class extends v{constructor(e){super("content-steering",e.logger),this.hls=void 0,this.loader=null,this.uri=null,this.pathwayId=".",this._pathwayPriority=null,this.timeToLoad=300,this.reloadTimer=-1,this.updated=0,this.started=!1,this.enabled=!0,this.levels=null,this.audioTracks=null,this.subtitleTracks=null,this.penalizedPathways={},this.hls=e,this.registerListeners()}registerListeners(){const e=this.hls;e.on(l.MANIFEST_LOADING,this.onManifestLoading,this),e.on(l.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(l.MANIFEST_PARSED,this.onManifestParsed,this),e.on(l.ERROR,this.onError,this)}unregisterListeners(){const e=this.hls;e&&(e.off(l.MANIFEST_LOADING,this.onManifestLoading,this),e.off(l.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(l.MANIFEST_PARSED,this.onManifestParsed,this),e.off(l.ERROR,this.onError,this))}pathways(){return(this.levels||[]).reduce(((e,t)=>(-1===e.indexOf(t.pathwayId)&&e.push(t.pathwayId),e)),[])}get pathwayPriority(){return this._pathwayPriority}set pathwayPriority(e){this.updatePathwayPriority(e)}
vendor: 4,988 bytes, line 1
1startLoad(){if(this.started=!0,this.clearTimeout(),this.enabled&&this.uri){if(this.updated){const e=1e3*this.timeToLoad-(performance.now()-this.updated);if(e>0)return void this.scheduleRefresh(this.uri,e)}this.loadSteeringManifest(this.uri)}}stopLoad(){this.started=!1,this.loader&&(this.loader.destroy(),this.loader=null),this.clearTimeout()}clearTimeout(){-1!==this.reloadTimer&&(self.clearTimeout(this.reloadTimer),this.reloadTimer=-1)}destroy(){this.unregisterListeners(),this.stopLoad(),this.hls=null,this.levels=this.audioTracks=this.subtitleTracks=null}removeLevel(e){const t=this.levels;t&&(this.levels=t.filter((t=>t!==e)))}onManifestLoading(){this.stopLoad(),this.enabled=!0,this.timeToLoad=300,this.updated=0,this.uri=null,this.pathwayId=".",this.levels=this.audioTracks=this.subtitleTracks=null}onManifestLoaded(e,t){const{contentSteering:n}=t;null!==n&&(this.pathwayId=n.pathwayId,this.uri=n.uri,this.started&&this.startLoad())}onManifestParsed(e,t){this.audioTracks=t.audioTracks,this.subtitleTracks=t.subtitleTracks}onError(e,t){const{errorAction:n}=t;if((null==n?void 0:n.action)===Rt&&n.flags===Ot){const e=this.levels;let r=this._pathwayPriority,s=this.pathwayId;if(t.context){const{groupId:n,pathwayId:r,type:i}=t.context;n&&e?s=this.getPathwayForGroupId(n,i,s):r&&(s=r)}s in this.penalizedPathways||(this.penalizedPathways[s]=performance.now()),!r&&e&&(r=this.pathways()),r&&r.length>1&&(this.updatePathwayPriority(r),n.resolved=this.pathwayId!==s),t.details!==o.BUFFER_APPEND_ERROR||t.fatal?n.resolved||this.warn(`Could not resolve ${t.details} ("${t.error.message}") with content-steering for Pathway: ${s} levels: ${e?e.length:e} priorities: ${rt(r)} penalized: ${rt(this.penalizedPathways)}`):n.resolved=!0}}filterParsedLevels(e){this.levels=e;let t=this.getLevelsForPathway(this.pathwayId);if(0===t.length){const n=e[0].pathwayId;this.log(`No levels found in Pathway ${this.pathwayId}. Setting initial Pathway to "${n}"`),t=this.getLevelsForPathway(n),this.pathwayId=n}return t.length!==e.length&&this.log(`Found ${t.length}/${e.length} levels in Pathway "${this.pathwayId}"`),t}getLevelsForPathway(e){return null===this.levels?[]:this.levels.filter((t=>e===t.pathwayId))}updatePathwayPriority(e){let t;this._pathwayPriority=e;const n=this.penalizedPathways,r=performance.now();Object.keys(n).forEach((e=>{r-n[e]>3e5&&delete n[e]}));for(let r=0;r<e.length;r++){const s=e[r];if(s in n)continue;if(s===this.pathwayId)return;const i=this.hls.nextLoadLevel,a=this.hls.levels[i];if(t=this.getLevelsForPathway(s),t.length>0){this.log(`Setting Pathway to "${s}"`),this.pathwayId=s,dr(t),this.hls.trigger(l.LEVELS_UPDATED,{levels:t});const e=this.hls.levels[i];a&&e&&this.levels&&(e.attrs["STABLE-VARIANT-ID"]!==a.attrs["STABLE-VARIANT-ID"]&&e.bitrate!==a.bitrate&&this.log(`Unstable Pathways change from bitrate ${a.bitrate} to ${e.bitrate}`),this.hls.nextLoadLevel=i);break}}}getPathwayForGroupId(e,t,n){const r=this.getLevelsForPathway(n).concat(this.levels||[]);for(let n=0;n<r.length;n++)if(t===d&&r[n].hasAudioGroup(e)||t===h&&r[n].hasSubtitleGroup(e))return r[n].pathwayId;return n}clonePathways(e){const t=this.levels;if(!t)return;const n={},r={};e.forEach((e=>{const{ID:s,"BASE-ID":i,"URI-REPLACEMENT":a}=e;if(t.some((e=>e.pathwayId===s)))return;const o=this.getLevelsForPathway(i).map((e=>{const t=new dn(e.attrs);t["PATHWAY-ID"]=s;const i=t.AUDIO&&`${t.AUDIO}_clone_${s}`,o=t.SUBTITLES&&`${t.SUBTITLES}_clone_${s}`;i&&(n[t.AUDIO]=i,t.AUDIO=i),o&&(r[t.SUBTITLES]=o,t.SUBTITLES=o);const l=_a(e.uri,t["STABLE-VARIANT-ID"],"PER-VARIANT-URIS",a),c=new et({attrs:t,audioCodec:e.audioCodec,bitrate:e.bitrate,height:e.height,name:e.name,url:l,videoCodec:e.videoCodec,width:e.width});if(e.audioGroups)for(let t=1;t<e.audioGroups.length;t++)c.addGroupId("audio",`${e.audioGroups[t]}_clone_${s}`);if(e.subtitleGroups)for(let t=1;t<e.subtitleGroups.length;t++)c.addGroupId("text",`${e.subtitleGroups[t]}_clone_${s}`);return c}));t.push(...o),ma(this.audioTracks,n,a,s),ma(this.subtitleTracks,r,a,s)}))}loadSteeringManifest(e){const t=this.hls.config,n=t.loader;let r;this.loader&&this.loader.destroy(),this.loader=new n(t);try{r=new self.URL(e)}catch(t){return this.enabled=!1,void this.log(`Failed to parse Steering Manifest URI: ${e}`)}if("data:"!==r.protocol){const e=0|(this.hls.bandwidthEstimate||t.abrEwmaDefaultEstimate);r.searchParams.set("_HLS_pathway",this.pathwayId),r.searchParams.set("_HLS_throughput",""+e)}const s={responseType:"json",url:r.href},i=t.steeringManifestLoadPolicy.default,a=i.errorRetry||i.timeoutRetry||{},o={loadPolicy:i,timeout:i.maxLoadTimeMs,maxRetry:a.maxNumRetry||0,retryDelay:a.retryDelayMs||0,maxRetryDelay:a.maxRetryDelayMs||0},c={onSuccess:(e,t,n,s)=>{this.log(`Loaded steering manifest: "${r}"`);const i=e.data;if(1!==(null==i?void 0:i.VERSION))return void this.log(`Steering VERSION ${i.VERSION} not supported!`);this.updated=performance.now(),this.timeToLoad=i.TTL;const{"RELOAD-URI":a,"PATHWAY-CLONES":o,"PATHWAY-PRIORITY":c}=i;
1if(a)try{this.uri=new self.URL(a,r).href}catch(e){return this.enabled=!1,void this.log(`Failed to parse Steering Manifest RELOAD-URI: ${a}`)}this.scheduleRefresh(this.uri||n.url),o&&this.clonePathways(o);const u={steeringManifest:i,url:r.toString()};this.hls.trigger(l.STEERING_MANIFEST_LOADED,u),c&&this.updatePathwayPriority(c)},onError:(e,t,n,r)=>{if(this.log(`Error loading steering manifest: ${e.code} ${e.text} (${t.url})`),this.stopLoad(),410===e.code)return this.enabled=!1,void this.log(`Steering manifest ${t.url} no longer available`);let s=1e3*this.timeToLoad;if(429!==e.code)this.scheduleRefresh(this.uri||t.url,s);else{const e=this.loader;if("function"==typeof(null==e?void 0:e.getResponseHeader)){const t=e.getResponseHeader("Retry-After");t&&(s=1e3*parseFloat(t))}this.log(`Steering manifest ${t.url} rate limited`)}},onTimeout:(e,t,n)=>{this.log(`Timeout loading steering manifest (${t.url})`),this.scheduleRefresh(this.uri||t.url)}};this.log(`Requesting steering manifest: ${r}`),this.loader.load(s,o,c)}scheduleRefresh(e,t=1e3*this.timeToLoad){this.clearTimeout(),this.reloadTimer=self.setTimeout((()=>{var t;const n=null==(t=this.hls)?void 0:t.media;!n||n.ended?this.scheduleRefresh(e,1e3*this.timeToLoad):this.loadSteeringManifest(e)}),t)}},interstitialsController:class extends v{constructor(e,t){super("interstitials",e.logger),this.HlsPlayerClass=void 0,this.hls=void 0,this.assetListLoader=void 0,this.mediaSelection=null,this.altSelection=null,this.media=null,this.detachedData=null,this.requiredTracks=null,this.manager=null,this.playerQueue=[],this.bufferedPos=-1,this.timelinePos=-1,this.schedule=void 0,this.playingItem=null,this.bufferingItem=null,this.waitingItem=null,this.endedItem=null,this.playingAsset=null,this.endedAsset=null,this.bufferingAsset=null,this.shouldPlay=!1,this.onPlay=()=>{this.shouldPlay=!0},this.onPause=()=>{this.shouldPlay=!1},this.onSeeking=()=>{const e=this.currentTime;if(void 0===e||this.playbackDisabled||!this.schedule)return;const t=e-this.timelinePos;if(Math.abs(t)<1/7056e5)return;const n=t<=-.01;this.timelinePos=e,this.bufferedPos=e;const r=this.playingItem;if(!r)return void this.checkBuffer();if(n){this.schedule.resetErrorsInRange(e,e-t)&&this.updateSchedule(!0)}if(this.checkBuffer(),n&&e<r.start||e>=r.end){var s;const t=this.findItemIndex(r);let i=this.schedule.findItemIndexAtTime(e);if(-1===i&&(i=t+(n?-1:1),this.log(`seeked ${n?"back ":""}to position not covered by schedule ${e} (resolving from ${t} to ${i})`)),!this.isInterstitial(r)&&null!=(s=this.media)&&s.paused&&(this.shouldPlay=!1),!n&&i>t){const e=this.schedule.findJumpRestrictedIndex(t+1,i);if(e>t)return void this.setSchedulePosition(e)}return void this.setSchedulePosition(i)}const i=this.playingAsset;if(!i){if(this.playingLastItem&&this.isInterstitial(r)){const t=r.event.assetList[0];t&&(this.endedItem=this.playingItem,this.playingItem=null,this.setScheduleToAssetAtTime(e,t))}return}const a=i.timelineStart,o=i.duration||0;var l;(n&&e<a||e>=a+o)&&(null!=(l=r.event)&&l.appendInPlace&&(this.clearAssetPlayers(r.event,r),this.flushFrontBuffer(e)),this.setScheduleToAssetAtTime(e,i))},this.onTimeupdate=()=>{const e=this.currentTime;if(void 0===e||this.playbackDisabled)return;if(!(e>this.timelinePos))return;this.timelinePos=e,e>this.bufferedPos&&this.checkBuffer();const t=this.playingItem;if(!t||this.playingLastItem)return;if(e>=t.end){this.timelinePos=t.end;const e=this.findItemIndex(t);this.setSchedulePosition(e+1)}const n=this.playingAsset;if(!n)return;e>=n.timelineStart+(n.duration||0)&&this.setScheduleToAssetAtTime(e,n)},this.onScheduleUpdate=(e,t)=>{const n=this.schedule;if(!n)return;const r=this.playingItem,s=n.events||[],i=n.items||[],a=n.durations,o=e.map((e=>e.identifier)),c=!(!s.length&&!o.length);(c||t)&&this.log(`INTERSTITIALS_UPDATED (${s.length}): ${s}\nSchedule: ${i.map((e=>Fa(e)))} pos: ${this.timelinePos}`),o.length&&this.log(`Removed events ${o}`);let u=null,d=null;r&&(u=this.updateItem(r,this.timelinePos),this.itemsMatch(r,u)?this.playingItem=u:this.waitingItem=this.endedItem=null),this.waitingItem=this.updateItem(this.waitingItem),this.endedItem=this.updateItem(this.endedItem);const h=this.bufferingItem;if(h&&(d=this.updateItem(h,this.bufferedPos),this.itemsMatch(h,d)?this.bufferingItem=d:h.event&&(this.bufferingItem=this.playingItem,this.clearInterstitial(h.event,null))),e.forEach((e=>{e.assetList.forEach((e=>{this.clearAssetPlayer(e.identifier,null)}))})),this.playerQueue.forEach((e=>{if(e.interstitial.appendInPlace){const t=e.assetItem.timelineStart,n=e.timelineOffset-t;if(n)try{e.timelineOffset=t}catch(r){Math.abs(n)>La&&this.warn(`${r} ("${e.assetId}" ${e.timelineOffset}->${t})`)}}})),c||t){if(this.hls.trigger(l.INTERSTITIALS_UPDATED,{events:s.slice(0),schedule:i.slice(0),durations:a,removedIds:o}
1),this.isInterstitial(r)&&o.includes(r.event.identifier))return this.warn(`Interstitial "${r.event.identifier}" removed while playing`),void this.primaryFallback(r.event);r&&this.trimInPlace(u,r),h&&d!==u&&this.trimInPlace(d,h),this.checkBuffer()}},this.hls=e,this.HlsPlayerClass=t,this.assetListLoader=new $a(e),this.schedule=new Ba(this.onScheduleUpdate,e.logger),this.registerListeners()}registerListeners(){const e=this.hls;e&&(e.on(l.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(l.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(l.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(l.MANIFEST_LOADING,this.onManifestLoading,this),e.on(l.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(l.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(l.AUDIO_TRACK_UPDATED,this.onAudioTrackUpdated,this),e.on(l.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.on(l.SUBTITLE_TRACK_UPDATED,this.onSubtitleTrackUpdated,this),e.on(l.EVENT_CUE_ENTER,this.onInterstitialCueEnter,this),e.on(l.ASSET_LIST_LOADED,this.onAssetListLoaded,this),e.on(l.BUFFER_APPENDED,this.onBufferAppended,this),e.on(l.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(l.BUFFERED_TO_END,this.onBufferedToEnd,this),e.on(l.MEDIA_ENDED,this.onMediaEnded,this),e.on(l.ERROR,this.onError,this),e.on(l.DESTROYING,this.onDestroying,this))}unregisterListeners(){const e=this.hls;
1e&&(e.off(l.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(l.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(l.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(l.MANIFEST_LOADING,this.onManifestLoading,this),e.off(l.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(l.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(l.AUDIO_TRACK_UPDATED,this.onAudioTrackUpdated,this),e.off(l.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.off(l.SUBTITLE_TRACK_UPDATED,this.onSubtitleTrackUpdated,this),e.off(l.EVENT_CUE_ENTER,this.onInterstitialCueEnter,this),e.off(l.ASSET_LIST_LOADED,this.onAssetListLoaded,this),e.off(l.BUFFER_CODECS,this.onBufferCodecs,this),e.off(l.BUFFER_APPENDED,this.onBufferAppended,this),e.off(l.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(l.BUFFERED_TO_END,this.onBufferedToEnd,this),e.off(l.MEDIA_ENDED,this.onMediaEnded,this),e.off(l.ERROR,this.onError,this),e.off(l.DESTROYING,this.onDestroying,this))}startLoad(){this.resumeBuffering()}stopLoad(){this.pauseBuffering()}resumeBuffering(){var e;null==(e=this.getBufferingPlayer())||e.resumeBuffering()}pauseBuffering(){var e;null==(e=this.getBufferingPlayer())||e.pauseBuffering()}destroy(){this.unregisterListeners(),this.stopLoad(),this.assetListLoader&&this.assetListLoader.destroy(),this.emptyPlayerQueue(),this.clearScheduleState(),this.schedule&&this.schedule.destroy(),this.media=this.detachedData=this.mediaSelection=this.requiredTracks=this.altSelection=this.schedule=this.manager=null,this.hls=this.HlsPlayerClass=this.log=null,this.assetListLoader=null,this.onPlay=this.onPause=this.onSeeking=this.onTimeupdate=null,this.onScheduleUpdate=null}onDestroying(){const e=this.primaryMedia||this.media;e&&this.removeMediaListeners(e)}removeMediaListeners(e){yr(e,"play",this.onPlay),yr(e,"pause",this.onPause),yr(e,"seeking",this.onSeeking),yr(e,"timeupdate",this.onTimeupdate)}onMediaAttaching(e,t){const n=this.media=t.media;Er(n,"seeking",this.onSeeking),Er(n,"timeupdate",this.onTimeupdate),Er(n,"play",this.onPlay),Er(n,"pause",this.onPause)}onMediaAttached(e,t){const n=this.effectivePlayingItem,r=this.detachedData;if(this.detachedData=null,null===n)this.checkStart();else if(!r){this.clearScheduleState();const e=this.findItemIndex(n);this.setSchedulePosition(e)}}clearScheduleState(){this.log("clear schedule state"),this.playingItem=this.bufferingItem=this.waitingItem=this.endedItem=this.playingAsset=this.endedAsset=this.bufferingAsset=null}onMediaDetaching(e,t){const n=!!t.transferMedia,r=this.media;if(this.media=null,!n&&(r&&this.removeMediaListeners(r),this.detachedData)){const e=this.getBufferingPlayer();e&&(this.log(`Removing schedule state for detachedData and ${e}`),this.playingAsset=this.endedAsset=this.bufferingAsset=this.bufferingItem=this.waitingItem=this.detachedData=null,e.detachMedia()),this.shouldPlay=!1}}get interstitialsManager(){if(!this.hls)return null;if(this.manager)return this.manager;const e=this,t=()=>e.bufferingItem||e.waitingItem,n=t=>t?e.getAssetPlayer(t.identifier):t,r=(t,r,i,a,o)=>{if(t){let l=t[r].start;const c=t.event;if(c){if("playout"===r||c.timelineOccupancy!==Oa.Point){const e=n(i);(null==e?void 0:e.interstitial)===c&&(l+=e.assetItem.startOffset+e[o])}}else{l+=("bufferedPos"===a?s():e[a])-t.start}return l}return 0},s=()=>{const t=e.bufferedPos;return t===Number.MAX_VALUE?i("primary"):Math.max(t,0)},i=t=>{var n,r;return null!=(n=e.primaryDetails)&&n.live?e.primaryDetails.edge:(null==(r=e.schedule)?void 0:r.durations[t])||0},a=(t,s)=>{var i,a;const o=e.effectivePlayingItem;if(null!=o&&null!=(i=o.event)&&i.restrictions.skip||!e.schedule)return;e.log(`seek to ${t} "${s}"`);const l=e.effectivePlayingItem,c=e.schedule.findItemIndexAtTime(t,s),u=null==(a=e.schedule.items)?void 0:a[c],d=e.getBufferingPlayer(),h=null==d?void 0:d.interstitial,f=null==h?void 0:h.appendInPlace,p=l&&e.itemsMatch(l,u);if(l&&(f||p)){const i=n(e.playingAsset),a=(null==i?void 0:i.media)||e.primaryMedia;if(a){const n="primary"===s?a.currentTime:r(l,s,e.playingAsset,"timelinePos","currentTime"),o=t-n,c=(f?n:a.currentTime)+o;if(c>=0&&(!i||f||c<=i.duration))return void(a.currentTime=c)}}if(u){let n=t;if("primary"!==s){const e=t-u[s].start;n=u.start+e}const r=!e.isInterstitial(u);if(e.isInterstitial(l)&&!l.event.appendInPlace||!r&&!u.event.appendInPlace){if(l){const i=e.findItemIndex(l);if(c>i){const t=e.schedule.findJumpRestrictedIndex(i+1,c);if(t>i)return void e.setSchedulePosition(t)}let a=0;if(r)e.timelinePos=n,e.checkBuffer();else{const e=u.event.assetList,n=t-(u[s]||u).start;for(let t=e.length;t--;){const r=e[t];if(r.duration&&n>=r.startOffset&&n<r.startOffset+r.duration){a=t;break}}}e.setSchedulePosition(c,a)}}else{const t=e.media||(f?null==d?void 0:d.media:null);t&&(t.currentTime=n)}}},o=()=>{const n=e.effectivePlayingItem;if(e.isInterstitial(n))return n;const r=t();return e.isInterstitial(r)?r:null},l={get bufferedEnd(){const n=t(),s=e.bufferingItem;var i;return s&&s===n&&(r(s,"playout",e.bufferingAsset,"bufferedPos","bufferedEnd")-s.playout.start||(null==(i=e.bufferingAsset)?void 0:i.startOffset))||0},get currentTime(){const t=o(),n=e.effectivePlayingItem;return n&&n===t?r(n,"playout",e.effectivePlayingAsset,"timelinePos","currentTime")-n.playout.start:0},set currentTime(t){const n=o(),r=e.effectivePlayingItem;r&&r===n&&a(t+r.playout.start,"playout")},get duration(){const e=o();return e?e.playout.end-e.playout.start:0},get assetPlayers(){var t;const n=null==(t=o())?void 0:t.event.assetList;return n?n.map((t=>e.getAssetPlayer(t.identifier))):[]},get playingIndex(){var t;const n=null==(t=o())?void 0:t.event;return n&&e.effectivePlayingAsset?n.findAssetIndex(e.effectivePlayingAsset):-1},get scheduleItem(){return o()}};return this.manager={get events(){var t;return(null==(t=e.schedule)||null==(t=t.events)?void 0:t.slice(0))||[]},get schedule(){var t;return(null==(t=e.schedule)||null==(t=t.items)?void 0:t.slice(0))||[]},get interstitialPlayer(){return o()?l:null},get playerQueue(){return e.playerQueue.slice(0)},get bufferingAsset(){return e.bufferingAsset},get bufferingItem(){return t()},get bufferingIndex(){const n=t();return e.findItemIndex(n)},get playingAsset(){return e.effectivePlayingAsset},get playingItem(){return e.effectivePlayingItem},get playingIndex(){const t=e.effectivePlayingItem;return e.findItemIndex(t)},primary:{get bufferedEnd(){return s()},get currentTime(){const t=e.timelinePos;return t>0?t:0},set currentTime(e){a(e,"primary")},get duration(){return i("primary")},get seekableStart(){var t;return(null==(t=e.primaryDetails)?void 0:t.fragmentStart)||0}},integrated:{get bufferedEnd(){return r(t(),"integrated",e.bufferingAsset,"bufferedPos","bufferedEnd")},get currentTime(){return r(e.effectivePlayingItem,"integrated",e.effectivePlayingAsset,"timelinePos","currentTime")},set currentTime(e){a(e,"integrated")},get duration(){return i("integrated")},get seekableStart(){var t;return((t,n)=>{var r;if(0!==t&&"primary"!==n&&null!=(r=e.schedule)&&r.length){var s;const r=e.schedule.findItemIndexAtTime(t),i=null==(s=e.schedule.items)?void 0:s[r];if(i)return t+(i[n].start-i.start)}return t})((null==(t=e.primaryDetails)?void 0:t.fragmentStart)||0,"integrated")}},skip:()=>{const t=e.effectivePlayingItem,n=null==t?void 0:t.event;if(n&&!n.restrictions.skip){const r=e.findItemIndex(t);if(n.appendInPlace){const e=t.playout.start+t.event.duration;a(e+.001,"playout")}else e.advanceAfterAssetEnded(n,r,1/0)}}}}get effectivePlayingItem(){return this.waitingItem||this.playingItem||this.endedItem}get effectivePlayingAsset(){return this.playingAsset||this.endedAsset}get playingLastItem(){var e;const t=this.playingItem,n=null==(e=this.schedule)?void 0:e.items;return!!(this.playbackStarted&&t&&n)&&this.findItemIndex(t)===n.length-1}get playbackStarted(){return null!==this.effectivePlayingItem}get currentTime(){var e,t;if(null===this.mediaSelection)return;const n=this.waitingItem||this.playingItem;if(this.isInterstitial(n)&&!n.event.appendInPlace)return;let s=this.media;!s&&null!=(e=this.bufferingItem)&&null!=(e=e.event)&&e.appendInPlace&&(s=this.primaryMedia);const i=null==(t=s)?void 0:t.currentTime;return void 0!==i&&r(i)?i:void 0}get primaryMedia(){var e;return this.media||(null==(e=this.detachedData)?void 0:e.media)||null}isInterstitial(e){return!(null==e||!e.event)}retreiveMediaSource(e,t){const n=this.getAssetPlayer(e);n&&this.transferMediaFromPlayer(n,t)}transferMediaFromPlayer(e,t){const n=e.interstitial.appendInPlace,r=e.media;if(n&&r===this.primaryMedia){if(this.bufferingAsset=null,(!t||this.isInterstitial(t)&&!t.event.appendInPlace)&&t&&r)return void(this.detachedData={media:r});const n=e.transferMedia();this.log(`transfer MediaSource from ${e} ${rt(n)}`),this.detachedData=n}else t&&r&&(this.shouldPlay||(this.shouldPlay=!r.paused))}transferMediaTo(e,t){var n,r;if(e.media===t)return;let s=null;const i=this.hls,a=e!==i,o=a&&e.interstitial.appendInPlace,l=null==(n=this.detachedData)?void 0:n.mediaSource;let c;if(i.media)o&&(s=i.transferMedia(),this.detachedData=s),c="Primary";
1else if(l){const e=this.getBufferingPlayer();e?(s=e.transferMedia(),c=`${e}`):c="detached MediaSource"}else c="detached media";if(!s)if(l)s=this.detachedData,this.log(`using detachedData: MediaSource ${rt(s)}`);else if(!this.detachedData||i.media===t){const e=this.playerQueue;e.length>1&&e.forEach((e=>{if(a&&e.interstitial.appendInPlace!==o){const t=e.interstitial;this.clearInterstitial(e.interstitial,null),t.appendInPlace=!1,t.appendInPlace&&this.warn(`Could not change append strategy for queued assets ${t}`)}})),this.hls.detachMedia(),this.detachedData={media:t}}const u=s&&"mediaSource"in s&&"closed"!==(null==(r=s.mediaSource)?void 0:r.readyState),d=u&&s?s:t;this.log(`${u?"transfering MediaSource":"attaching media"} to ${a?e:"Primary"} from ${c} (media.currentTime: ${t.currentTime})`);const h=this.schedule;if(d===s&&h){const t=a&&e.assetId===h.assetIdAtEnd;d.overrides={duration:h.duration,endOfStream:!a||t,cueRemoval:!a}}e.attachMedia(d)}onInterstitialCueEnter(){this.onTimeupdate()}checkStart(){const e=this.schedule,t=null==e?void 0:e.events;if(!t||this.playbackDisabled||!this.media)return;-1===this.bufferedPos&&(this.bufferedPos=0);const n=this.timelinePos,r=this.effectivePlayingItem;if(-1===n){const n=this.hls.startPosition;if(this.log(Ha("checkStart",n)),this.timelinePos=n,t.length&&t[0].cue.pre){const n=e.findEventIndex(t[0].identifier);this.setSchedulePosition(n)}else if(n>=0||!this.primaryLive){const t=this.timelinePos=n>0?n:0,r=e.findItemIndexAtTime(t);this.setSchedulePosition(r)}}else if(r&&!this.playingItem){const t=e.findItemIndex(r);this.setSchedulePosition(t)}}advanceAssetBuffering(e,t){const n=e.event,r=n.findAssetIndex(t),s=Da(n,r);if(n.isAssetPastPlayoutLimit(s)){if(this.schedule){var i;const t=null==(i=this.schedule.items)?void 0:i[this.findItemIndex(e)+1];t&&this.bufferedToItem(t)}}else this.bufferedToEvent(e,s)}advanceAfterAssetEnded(e,t,n){const r=Da(e,n);if(e.isAssetPastPlayoutLimit(r)){if(this.schedule){const n=this.schedule.items;if(n){const r=t+1;if(r>=n.length)return void this.setSchedulePosition(-1);const s=e.resumeTime;this.timelinePos<s&&(this.log(Ha("advanceAfterAssetEnded",s)),this.timelinePos=s,e.appendInPlace&&this.advanceInPlace(s),this.checkBuffer(this.bufferedPos<s)),this.setSchedulePosition(r)}}}else{if(e.appendInPlace){const t=e.assetList[r];t&&this.advanceInPlace(t.timelineStart)}this.setSchedulePosition(t,r)}}setScheduleToAssetAtTime(e,t){const n=this.schedule;if(!n)return;const r=t.parentIdentifier,s=n.getEvent(r);if(s){const t=n.findEventIndex(r),i=n.findAssetIndex(s,e);this.advanceAfterAssetEnded(s,t,i-1)}}setSchedulePosition(e,t){var n;const r=null==(n=this.schedule)?void 0:n.items;if(!r||this.playbackDisabled)return;const s=e>=0?r[e]:null;this.log(`setSchedulePosition ${e}, ${t} (${s?Fa(s):s}) pos: ${this.timelinePos}`);const i=this.waitingItem||this.playingItem,a=this.playingLastItem;if(this.isInterstitial(i)){const n=i.event,u=this.playingAsset,d=null==u?void 0:u.identifier,h=d?this.getAssetPlayer(d):null;if(h&&d&&(!this.eventItemsMatch(i,s)||void 0!==t&&d!==n.assetList[t].identifier)){var o;const t=n.findAssetIndex(u);if(this.log(`INTERSTITIAL_ASSET_ENDED ${t+1}/${n.assetList.length} ${xa(u)}`),this.endedAsset=u,this.playingAsset=null,this.hls.trigger(l.INTERSTITIAL_ASSET_ENDED,{asset:u,assetListIndex:t,event:n,schedule:r.slice(0),scheduleIndex:e,player:h}),i!==this.playingItem)return void(this.itemsMatch(i,this.playingItem)&&!this.playingAsset&&this.advanceAfterAssetEnded(n,this.findItemIndex(this.playingItem),t));this.retreiveMediaSource(d,s),!h.media||null!=(o=this.detachedData)&&o.mediaSource||h.detachMedia()}if(!this.eventItemsMatch(i,s)&&(this.endedItem=i,this.playingItem=null,this.log(`INTERSTITIAL_ENDED ${n} ${Fa(i)}`),n.hasPlayed=!0,this.hls.trigger(l.INTERSTITIAL_ENDED,{event:n,schedule:r.slice(0),scheduleIndex:e}),n.cue.once)){var c;this.updateSchedule();const e=null==(c=this.schedule)?void 0:c.items;if(s&&e){const n=this.findItemIndex(s);this.advanceSchedule(n,e,t,i,a)}return}}this.advanceSchedule(e,r,t,i,a)}advanceSchedule(e,t,n,r,s){const i=this.schedule;if(!i)return;const a=t[e]||null,o=this.primaryMedia,c=this.playerQueue;
1if(c.length&&c.forEach((t=>{const n=t.interstitial,r=i.findEventIndex(n.identifier);(r<e||r>e+1)&&this.clearInterstitial(n,a)})),this.isInterstitial(a)){this.timelinePos=Math.min(Math.max(this.timelinePos,a.start),a.end);const s=a.event;if(void 0===n){const t=Da(s,(n=i.findAssetIndex(s,this.timelinePos))-1);if(s.isAssetPastPlayoutLimit(t)||s.appendInPlace&&this.timelinePos===a.end)return void this.advanceAfterAssetEnded(s,e,n);n=t}const c=this.waitingItem;this.assetsBuffered(a,o)||this.setBufferingItem(a);let u=this.preloadAssets(s,n);if(this.eventItemsMatch(a,c||r)||(this.waitingItem=a,this.log(`INTERSTITIAL_STARTED ${Fa(a)} ${s.appendInPlace?"append in place":""}`),this.hls.trigger(l.INTERSTITIAL_STARTED,{event:s,schedule:t.slice(0),scheduleIndex:e})),!s.assetListLoaded)return void this.log(`Waiting for ASSET-LIST to complete loading ${s}`);if(s.assetListLoader&&(s.assetListLoader.destroy(),s.assetListLoader=void 0),!o)return void this.log(`Waiting for attachMedia to start Interstitial ${s}`);this.waitingItem=this.endedItem=null,this.playingItem=a;const d=s.assetList[n];if(!d)return void this.advanceAfterAssetEnded(s,e,n||0);if(u||(u=this.getAssetPlayer(d.identifier)),null===u||u.destroyed){const e=s.assetList.length;this.warn(`asset ${n+1}/${e} player destroyed ${s}`),u=this.createAssetPlayer(s,d,n),u.loadSource()}if(!this.eventItemsMatch(a,this.bufferingItem)&&s.appendInPlace&&this.isAssetBuffered(d))return;this.startAssetPlayer(u,n,t,e,o),this.shouldPlay&&Ga(u.media)}else a?(this.resumePrimary(a,e,r),this.shouldPlay&&Ga(this.hls.media)):s&&this.isInterstitial(r)&&(this.endedItem=null,this.playingItem=r,r.event.appendInPlace||this.attachPrimary(i.durations.primary,null))}get playbackDisabled(){return!1===this.hls.config.enableInterstitialPlayback}get primaryDetails(){var e;return null==(e=this.mediaSelection)?void 0:e.main.details}get primaryLive(){var e;return!(null==(e=this.primaryDetails)||!e.live)}resumePrimary(e,t,n){var r,s;if(this.playingItem=e,this.playingAsset=this.endedAsset=null,this.waitingItem=this.endedItem=null,this.bufferedToItem(e),this.log(`resuming ${Fa(e)}`),null==(r=this.detachedData)||!r.mediaSource){let n=this.timelinePos;(n<e.start||n>=e.end)&&(n=this.getPrimaryResumption(e,t),this.log(Ha("resumePrimary",n)),this.timelinePos=n),this.attachPrimary(n,e)}if(!n)return;const i=null==(s=this.schedule)?void 0:s.items;i&&(this.log(`INTERSTITIALS_PRIMARY_RESUMED ${Fa(e)}`),this.hls.trigger(l.INTERSTITIALS_PRIMARY_RESUMED,{schedule:i.slice(0),scheduleIndex:t}),this.checkBuffer())}getPrimaryResumption(e,t){const n=e.start;if(this.primaryLive){const e=this.primaryDetails;if(0===t)return this.hls.startPosition;if(e&&(n<e.fragmentStart||n>e.edge))return this.hls.liveSyncPosition||-1}return n}isAssetBuffered(e){const t=this.getAssetPlayer(e.identifier);if(null!=t&&t.hls)return t.hls.bufferedToEnd;return nn.bufferInfo(this.primaryMedia,this.timelinePos,0).end+1>=e.timelineStart+(e.duration||0)}attachPrimary(e,t,n){t?this.setBufferingItem(t):this.bufferingItem=this.playingItem,this.bufferingAsset=null;const r=this.primaryMedia;if(!r)return;const s=this.hls;s.media?this.checkBuffer():(this.transferMediaTo(s,r),n&&this.startLoadingPrimaryAt(e,n)),n||(this.log(Ha("attachPrimary",e)),this.timelinePos=e,this.startLoadingPrimaryAt(e,n))}startLoadingPrimaryAt(e,t){var n;const r=this.hls;!r.loadingEnabled||!r.media||Math.abs(((null==(n=r.mainForwardBufferInfo)?void 0:n.start)||r.media.currentTime)-e)>.5?r.startLoad(e,t):r.bufferingEnabled||r.resumeBuffering()}onManifestLoading(){var e;this.stopLoad(),null==(e=this.schedule)||e.reset(),this.emptyPlayerQueue(),this.clearScheduleState(),this.shouldPlay=!1,this.bufferedPos=this.timelinePos=-1,this.mediaSelection=this.altSelection=this.manager=this.requiredTracks=null,this.hls.off(l.BUFFER_CODECS,this.onBufferCodecs,this),this.hls.on(l.BUFFER_CODECS,this.onBufferCodecs,this)}onLevelUpdated(e,t){if(-1===t.level||!this.schedule)return;const n=this.hls.levels[t.level];if(!n.details)return;const r=S(S({},this.mediaSelection||this.altSelection),{},{main:n});this.mediaSelection=r,this.schedule.parseInterstitialDateRanges(r,this.hls.config.interstitialAppendInPlace),!this.effectivePlayingItem&&this.schedule.items&&this.checkStart()}onAudioTrackUpdated(e,t){const n=this.hls.audioTracks[t.id],r=this.mediaSelection;if(!r)return void(this.altSelection=S(S({},this.altSelection),{},{audio:n}));const s=S(S({},r),{},{audio:n});this.mediaSelection=s}onSubtitleTrackUpdated(e,t){const n=this.hls.subtitleTracks[t.id],r=this.mediaSelection;if(!r)return void(this.altSelection=S(S({},this.altSelection),{},{subtitles:n}));const s=S(S({},r),{},{subtitles:n});this.mediaSelection=s}onAudioTrackSwitching(e,t){const n=at(t);this.playerQueue.forEach((({hls:e})=>e&&(e.setAudioOption(t)||e.setAudioOption(n))))}onSubtitleTrackSwitch(e,t){const n=at(t);this.playerQueue.forEach((({hls:e})=>e&&(e.setSubtitleOption(t)||-1!==t.id&&e.setSubtitleOption(n))))}onBufferCodecs(e,t){const n=t.tracks;n&&(this.requiredTracks=n)}onBufferAppended(e,t){this.checkBuffer()}onBufferFlushed(e,t){const n=this.playingItem;if(n&&!this.itemsMatch(n,this.bufferingItem)&&!this.isInterstitial(n)){const e=this.timelinePos;this.bufferedPos=e,this.checkBuffer()}}onBufferedToEnd(e){if(!this.schedule)return;const t=this.schedule.events;if(this.bufferedPos<Number.MAX_VALUE&&t){for(let e=0;e<t.length;e++){const r=t[e];if(r.cue.post){var n;const e=this.schedule.findEventIndex(r.identifier),t=null==(n=this.schedule.items)?void 0:n[e];this.isInterstitial(t)&&this.eventItemsMatch(t,this.bufferingItem)&&this.bufferedToItem(t,0);break}}this.bufferedPos=Number.MAX_VALUE}}onMediaEnded(e){const t=this.playingItem;if(!this.playingLastItem&&t){const e=this.findItemIndex(t);this.setSchedulePosition(e+1)}else this.shouldPlay=!1}
1updateItem(e,t){var n;const r=null==(n=this.schedule)?void 0:n.items;if(e&&r){return r[this.findItemIndex(e,t)]||null}return null}trimInPlace(e,t){if(this.isInterstitial(e)&&e.event.appendInPlace&&t.end-e.end>.25){e.event.assetList.forEach(((t,n)=>{e.event.isAssetPastPlayoutLimit(n)&&this.clearAssetPlayer(t.identifier,null)}));const n=e.end+.25,r=nn.bufferInfo(this.primaryMedia,n,0);if(r.end>n||(r.nextStart||0)>n){this.log(`trim buffered interstitial ${Fa(e)} (was ${Fa(t)})`);const r=!0;this.attachPrimary(n,null,r),this.flushFrontBuffer(n)}}}itemsMatch(e,t){return!!t&&(e===t||e.event&&t.event&&this.eventItemsMatch(e,t)||!e.event&&!t.event&&this.findItemIndex(e)===this.findItemIndex(t))}eventItemsMatch(e,t){var n;return!!t&&(e===t||e.event.identifier===(null==(n=t.event)?void 0:n.identifier))}findItemIndex(e,t){return e&&this.schedule?this.schedule.findItemIndex(e,t):-1}updateSchedule(e=!1){var t;const n=this.mediaSelection;n&&(null==(t=this.schedule)||t.updateSchedule(n,[],e))}checkBuffer(e){var t;const n=null==(t=this.schedule)?void 0:t.items;if(!n)return;const r=nn.bufferInfo(this.primaryMedia,this.timelinePos,0);e&&(this.bufferedPos=this.timelinePos),e||(e=r.len<1),this.updateBufferedPos(r.end,n,e)}updateBufferedPos(e,t,n){const r=this.schedule,s=this.bufferingItem;if(this.bufferedPos>e||!r)return;if(1===t.length&&this.itemsMatch(t[0],s))return void(this.bufferedPos=e);const i=this.playingItem,a=this.findItemIndex(i);let o=r.findItemIndexAtTime(e);if(this.bufferedPos<e){var l;const n=this.findItemIndex(s),r=Math.min(n+1,t.length-1),i=t[r];if((-1===o&&s&&e>=s.end||null!=(l=i.event)&&l.appendInPlace&&e+.01>=i.start)&&(o=r),this.isInterstitial(s)){const e=s.event;if(r-a>1&&!1===e.appendInPlace)return;if(0===e.assetList.length&&e.assetListLoader)return}if(this.bufferedPos=e,o>n&&o>a)this.bufferedToItem(i);else{const t=this.primaryDetails;this.primaryLive&&t&&e>t.edge-t.targetduration&&i.start<t.edge+this.hls.config.interstitialLiveLookAhead&&this.isInterstitial(i)&&this.preloadAssets(i.event,0)}}else n&&i&&!this.itemsMatch(i,s)&&(o===a?this.bufferedToItem(i):o===a+1&&this.bufferedToItem(t[o]))}assetsBuffered(e,t){return 0!==e.event.assetList.length&&!e.event.assetList.some((e=>{const n=this.getAssetPlayer(e.identifier);return!(null!=n&&n.bufferedInPlaceToEnd(t))}))}setBufferingItem(e){const t=this.bufferingItem,n=this.schedule;if(!this.itemsMatch(e,t)&&n){const{items:r,events:s}=n;if(!r||!s)return t;const i=this.isInterstitial(e),a=this.getBufferingPlayer();this.bufferingItem=e,this.bufferedPos=Math.max(e.start,Math.min(e.end,this.timelinePos));const o=a?a.remaining:t?t.end-this.timelinePos:0;if(this.log(`INTERSTITIALS_BUFFERED_TO_BOUNDARY ${Fa(e)}`+(t?` (${o.toFixed(2)} remaining)`:"")),!this.playbackDisabled)if(i){const t=n.findAssetIndex(e.event,this.bufferedPos);e.event.assetList.forEach(((e,n)=>{const r=this.getAssetPlayer(e.identifier);r&&(n===t&&r.loadSource(),r.resumeBuffering())}))}else this.hls.resumeBuffering(),this.playerQueue.forEach((e=>e.pauseBuffering()));this.hls.trigger(l.INTERSTITIALS_BUFFERED_TO_BOUNDARY,{events:s.slice(0),schedule:r.slice(0),bufferingIndex:this.findItemIndex(e),playingIndex:this.findItemIndex(this.playingItem)})}else this.bufferingItem!==e&&(this.bufferingItem=e);return t}bufferedToItem(e,t=0){const n=this.setBufferingItem(e);if(!this.playbackDisabled)if(this.isInterstitial(e))this.bufferedToEvent(e,t);else if(null!==n){this.bufferingAsset=null;const t=this.detachedData;if(t)if(t.mediaSource){const t=!0;this.attachPrimary(e.start,e,t)}else this.preloadPrimary(e);else this.preloadPrimary(e)}}preloadPrimary(e){const t=this.findItemIndex(e),n=this.getPrimaryResumption(e,t);this.startLoadingPrimaryAt(n)}bufferedToEvent(e,t){const n=e.event,r=0===n.assetList.length&&!n.assetListLoader,s=n.cue.once;if(r||!s){const e=this.preloadAssets(n,t);if(null!=e&&e.interstitial.appendInPlace){const t=this.primaryMedia;t&&this.bufferAssetPlayer(e,t)}}}preloadAssets(e,t){const n=e.assetUrl,r=e.assetList.length,s=0===r&&!e.assetListLoader,i=e.cue.once;if(s){const s=e.timelineStart;if(e.appendInPlace){var a;const t=this.playingItem;this.isInterstitial(t)||(null==t||null==(a=t.nextEvent)?void 0:a.identifier)!==e.identifier||this.flushFrontBuffer(s+.25)}let i,o=0;if(!this.playingItem&&this.primaryLive&&(o=this.hls.startPosition,-1===o&&(o=this.hls.liveSyncPosition||0)),o&&!e.cue.pre&&!e.cue.post){const e=o-s;e>0&&(i=Math.round(1e3*e)/1e3)}if(this.log(`Load interstitial asset ${t+1}/${n?1:r} ${e}${i?` live-start: ${o} start-offset: ${i}`:""}`),n)return this.createAsset(e,0,0,s,e.duration,n);const l=this.assetListLoader.loadAssetList(e,i);l&&(e.assetListLoader=l)}else if(!i&&r){for(let n=t;n<r;n++){const t=e.assetList[n],r=this.getAssetPlayerQueueIndex(t.identifier);-1!==r&&!this.playerQueue[r].destroyed||t.error||this.createAssetPlayer(e,t,n)}const n=e.assetList[t];if(n){const e=this.getAssetPlayer(n.identifier);return e&&e.loadSource(),e}}return null}flushFrontBuffer(e){const t=this.requiredTracks;
1if(!t)return;this.log(`Removing front buffer starting at ${e}`);Object.keys(t).forEach((t=>{this.hls.trigger(l.BUFFER_FLUSHING,{startOffset:e,endOffset:1/0,type:t})}))}getAssetPlayerQueueIndex(e){const t=this.playerQueue;for(let n=0;n<t.length;n++)if(e===t[n].assetId)return n;return-1}getAssetPlayer(e){const t=this.getAssetPlayerQueueIndex(e);return this.playerQueue[t]||null}getBufferingPlayer(){const{playerQueue:e,primaryMedia:t}=this;if(t)for(let n=0;n<e.length;n++)if(e[n].media===t)return e[n];return null}createAsset(e,t,n,r,s,i){const a={parentIdentifier:e.identifier,identifier:Na(e,i,t),duration:s,startOffset:n,timelineStart:r,uri:i};return this.createAssetPlayer(e,a,t)}createAssetPlayer(e,t,n){const r=this.hls,s=r.userConfig;let i=s.videoPreference;const c=r.loadLevelObj||r.levels[r.currentLevel];(i||c)&&(i=E({},i),c.videoCodec&&(i.videoCodec=c.videoCodec),c.videoRange&&(i.allowedVideoRanges=[c.videoRange]));const u=r.audioTracks[r.audioTrack],d=r.subtitleTracks[r.subtitleTrack];let h=0;if(this.primaryLive||e.appendInPlace){const e=this.timelinePos-t.timelineStart;if(e>1){const n=t.duration;n&&e<n&&(h=e)}}const f=t.identifier,p=S(S({},s),{},{maxMaxBufferLength:Math.min(180,r.config.maxMaxBufferLength),autoStartLoad:!0,startFragPrefetch:!0,primarySessionId:r.sessionId,assetPlayerId:f,abrEwmaDefaultEstimate:r.bandwidthEstimate,interstitialsController:void 0,startPosition:h,liveDurationInfinity:!1,testBandwidth:!1,videoPreference:i,audioPreference:u||s.audioPreference,subtitlePreference:d||s.subtitlePreference});e.appendInPlace&&(e.appendInPlaceStarted=!0,t.timelineStart&&(p.timelineOffset=t.timelineStart));const g=p.cmcd;null!=g&&g.sessionId&&g.contentId&&(p.cmcd=E({},g,{contentId:ka(t.uri)})),this.getAssetPlayer(f)&&this.warn(`Duplicate date range identifier ${e} and asset ${f}`);const m=new Ua(this.HlsPlayerClass,p,e,t);this.playerQueue.push(m),e.assetList[n]=t;let _=!0;const T=r=>{if(r.live){var s;const t=new Error(`Interstitials MUST be VOD assets ${e}`),r={fatal:!0,type:a.OTHER_ERROR,details:o.INTERSTITIAL_ASSET_ITEM_ERROR,error:t},i=(null==(s=this.schedule)?void 0:s.findEventIndex(e.identifier))||-1;return void this.handleAssetItemError(r,e,i,n,t.message)}const i=r.edge-r.fragmentStart,l=t.duration;(_||null===l||i>l)&&(_=!1,this.log(`Interstitial asset "${f}" duration change ${l} > ${i}`),t.duration=i,this.updateSchedule())};m.on(l.LEVEL_UPDATED,((e,{details:t})=>T(t))),m.on(l.LEVEL_PTS_UPDATED,((e,{details:t})=>T(t))),m.on(l.EVENT_CUE_ENTER,(()=>this.onInterstitialCueEnter()));const y=(e,t)=>{const n=this.getAssetPlayer(f);if(n&&t.tracks){n.off(l.BUFFER_CODECS,y),n.tracks=t.tracks;const e=this.primaryMedia;this.bufferingAsset===n.assetItem&&e&&!n.media&&this.bufferAssetPlayer(n,e)}};m.on(l.BUFFER_CODECS,y);m.on(l.BUFFERED_TO_END,(()=>{var n;const r=this.getAssetPlayer(f);if(this.log(`buffered to end of asset ${r}`),!r||!this.schedule)return;const s=this.schedule.findEventIndex(e.identifier),i=null==(n=this.schedule.items)?void 0:n[s];this.isInterstitial(i)&&this.advanceAssetBuffering(i,t)}));const v=t=>()=>{if(!this.getAssetPlayer(f)||!this.schedule)return;this.shouldPlay=!0;const n=this.schedule.findEventIndex(e.identifier);this.advanceAfterAssetEnded(e,n,t)};return m.once(l.MEDIA_ENDED,v(n)),m.once(l.PLAYOUT_LIMIT_REACHED,v(1/0)),m.on(l.ERROR,((t,r)=>{if(!this.schedule)return;const s=this.getAssetPlayer(f);if(r.details===o.BUFFER_STALLED_ERROR)return null!=s&&s.appendInPlace?void this.handleInPlaceStall(e):(this.onTimeupdate(),void this.checkBuffer(!0));this.handleAssetItemError(r,e,this.schedule.findEventIndex(e.identifier),n,`Asset player error ${r.error} ${e}`)})),m.on(l.DESTROYING,(()=>{if(!this.getAssetPlayer(f)||!this.schedule)return;const t=new Error(`Asset player destroyed unexpectedly ${f}`),r={fatal:!0,type:a.OTHER_ERROR,details:o.INTERSTITIAL_ASSET_ITEM_ERROR,error:t};this.handleAssetItemError(r,e,this.schedule.findEventIndex(e.identifier),n,t.message)})),this.log(`INTERSTITIAL_ASSET_PLAYER_CREATED ${xa(t)}`),this.hls.trigger(l.INTERSTITIAL_ASSET_PLAYER_CREATED,{asset:t,assetListIndex:n,event:e,player:m}),m}clearInterstitial(e,t){this.clearAssetPlayers(e,t),e.reset()}clearAssetPlayers(e,t){e.assetList.forEach((e=>{this.clearAssetPlayer(e.identifier,t)}))}resetAssetPlayer(e){const t=this.getAssetPlayerQueueIndex(e);if(-1!==t){this.log(`reset asset player "${e}" after error`);const n=this.playerQueue[t];this.transferMediaFromPlayer(n,null),n.resetDetails()}}clearAssetPlayer(e,t){const n=this.getAssetPlayerQueueIndex(e);if(-1!==n){const e=this.playerQueue[n];this.log(`clear ${e} toSegment: ${t?Fa(t):t}`),this.transferMediaFromPlayer(e,t),this.playerQueue.splice(n,1),e.destroy()}}emptyPlayerQueue(){let e;for(;e=this.playerQueue.pop();)e.destroy();this.playerQueue=[]}
1startAssetPlayer(e,t,n,r,s){const{interstitial:i,assetItem:a,assetId:o}=e,c=i.assetList.length,u=this.playingAsset;this.endedAsset=null,this.playingAsset=a,u&&u.identifier===o||(u&&(this.clearAssetPlayer(u.identifier,n[r]),delete u.error),this.log(`INTERSTITIAL_ASSET_STARTED ${t+1}/${c} ${xa(a)}`),this.hls.trigger(l.INTERSTITIAL_ASSET_STARTED,{asset:a,assetListIndex:t,event:i,schedule:n.slice(0),scheduleIndex:r,player:e})),this.bufferAssetPlayer(e,s)}bufferAssetPlayer(e,t){var n,r;if(!this.schedule)return;const{interstitial:s,assetItem:i}=e,l=this.schedule.findEventIndex(s.identifier),c=null==(n=this.schedule.items)?void 0:n[l];if(!c)return;e.loadSource(),this.setBufferingItem(c),this.bufferingAsset=i;const u=this.getBufferingPlayer();if(u===e)return;const d=s.appendInPlace;if(d&&!1===(null==u?void 0:u.interstitial.appendInPlace))return;const h=(null==u?void 0:u.tracks)||(null==(r=this.detachedData)?void 0:r.tracks)||this.requiredTracks;if(d&&i!==this.playingAsset){if(!e.tracks)return void this.log(`Waiting for track info before buffering ${e}`);if(h&&!O(h,e.tracks)){const t=new Error(`Asset ${xa(i)} SourceBuffer tracks ('${Object.keys(e.tracks)}') are not compatible with primary content tracks ('${Object.keys(h)}')`),n={fatal:!0,type:a.OTHER_ERROR,details:o.INTERSTITIAL_ASSET_ITEM_ERROR,error:t},r=s.findAssetIndex(i);return void this.handleAssetItemError(n,s,l,r,t.message)}}this.transferMediaTo(e,t)}handleInPlaceStall(e){const t=this.schedule,n=this.primaryMedia;if(!t||!n)return;const r=n.currentTime,s=t.findAssetIndex(e,r),i=e.assetList[s];if(i){const a=this.getAssetPlayer(i.identifier);if(a){const o=a.currentTime||r-i.timelineStart,l=a.duration-o;if(this.warn(`Stalled at ${o} of ${o+l} in ${a} ${e} (media.currentTime: ${r})`),o&&(l/n.playbackRate<.5||a.bufferedInPlaceToEnd(n))&&a.hls){const n=t.findEventIndex(e.identifier);this.advanceAfterAssetEnded(e,n,s)}}}}advanceInPlace(e){const t=this.primaryMedia;t&&t.currentTime<e&&(t.currentTime=e)}handleAssetItemError(e,t,n,r,s){if(e.details===o.BUFFER_STALLED_ERROR)return;const i=t.assetList[r]||null;if(this.warn(`INTERSTITIAL_ASSET_ERROR ${i?xa(i):i} ${e.error}`),!this.schedule)return;const a=(null==i?void 0:i.identifier)||"",c=this.getAssetPlayerQueueIndex(a),u=this.playerQueue[c]||null,d=this.schedule.items,h=E({},e,{fatal:!1,errorAction:Pt(!0),asset:i,assetListIndex:r,event:t,schedule:d,scheduleIndex:n,player:u});if(this.hls.trigger(l.INTERSTITIAL_ASSET_ERROR,h),!e.fatal)return;const f=this.playingAsset,p=this.bufferingAsset,g=new Error(s);if(i&&(this.clearAssetPlayer(a,null),i.error=g),t.assetList.some((e=>!e.error)))for(let e=r;e<t.assetList.length;e++)this.resetAssetPlayer(t.assetList[e].identifier);else t.error=g;this.updateSchedule(!0),t.error?this.primaryFallback(t):f&&f.identifier===a?this.advanceAfterAssetEnded(t,n,r):p&&p.identifier===a&&this.isInterstitial(this.bufferingItem)&&this.advanceAssetBuffering(this.bufferingItem,p)}primaryFallback(e){const t=e.timelineStart,n=this.effectivePlayingItem;let r=this.timelinePos;if(n){this.log(`Fallback to primary from event "${e.identifier}" start: ${t} pos: ${r} playing: ${Fa(n)} error: ${e.error}`),-1===r&&(r=this.hls.startPosition);const s=this.updateItem(n,r);this.itemsMatch(n,s)&&this.clearInterstitial(e,null),e.appendInPlace&&(this.attachPrimary(t,null),this.flushFrontBuffer(t))}else if(-1===r)return void this.checkStart();if(!this.schedule)return;const s=this.schedule.findItemIndexAtTime(r);this.setSchedulePosition(s)}onAssetListLoaded(e,t){var n,r;const s=t.event,i=s.identifier,a=t.assetListResponse.ASSETS;if(null==(n=this.schedule)||!n.hasEvent(i))return;const o=s.timelineStart,l=s.duration;let c=0;a.forEach(((e,t)=>{const n=parseFloat(e.DURATION);this.createAsset(s,t,c,o+c,n,e.URI),c+=n})),s.duration=c,this.log(`Loaded asset-list with duration: ${c} (was: ${l}) ${s}`);const u=this.waitingItem,d=(null==u?void 0:u.event.identifier)===i;this.updateSchedule();const h=null==(r=this.bufferingItem)?void 0:r.event;if(d){var f;const e=this.schedule.findEventIndex(i),t=null==(f=this.schedule.items)?void 0:f[e];if(t){if(!this.playingItem&&this.timelinePos>t.end){if(this.schedule.findItemIndexAtTime(this.timelinePos)!==e)return s.error=new Error(`Interstitial ${a.length?"no longer within playback range":"asset-list is empty"} ${this.timelinePos} ${s}`),this.log(s.error.message),this.updateSchedule(!0),void this.primaryFallback(s)}this.setBufferingItem(t)}this.setSchedulePosition(e)}else if((null==h?void 0:h.identifier)===i){const e=s.assetList[0];if(e){const t=this.getAssetPlayer(e.identifier);if(h.appendInPlace){const e=this.primaryMedia;t&&e&&this.bufferAssetPlayer(t,e)}else t&&t.loadSource()}}}onError(e,t){if(this.schedule)switch(t.details){case o.ASSET_LIST_PARSING_ERROR:case o.ASSET_LIST_LOAD_ERROR:case o.ASSET_LIST_LOAD_TIMEOUT:{const e=t.interstitial;e&&(this.updateSchedule(!0),this.primaryFallback(e));break}case o.BUFFER_STALLED_ERROR:{const e=this.endedItem||this.waitingItem||this.playingItem;if(this.isInterstitial(e)&&e.event.appendInPlace)return void this.handleInPlaceStall(e.event);this.log(`Primary player stall @${this.timelinePos} bufferedPos: ${this.bufferedPos}`),this.onTimeupdate(),this.checkBuffer(!0);break}}}}});function qo(e){return e&&"object"==typeof e?Array.isArray(e)?e.map(qo):Object.keys(e).reduce(((t,n)=>(t[n]=qo(e[n]),t)),{}):e}function Yo(e,t){const n=e.loader;if(n!==Go&&n!==Ko)t.log("[config]: Custom loader detected, cannot enable progressive streaming"),e.progressive=!1;else{(function(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(e){}return!1}
vendor: 7,818 bytes, line 1
1)()&&(e.loader=Go,e.progressive=!0,e.enableSoftwareAES=!0,t.log("[config]: Progressive streaming enabled, using FetchLoader"))}}class zo extends Zt{constructor(e,t){super("gap-controller",e.logger),this.hls=void 0,this.fragmentTracker=void 0,this.media=null,this.mediaSource=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.buffered={},this.lastCurrentTime=0,this.ended=0,this.waiting=0,this.onMediaPlaying=()=>{this.ended=0,this.waiting=0},this.onMediaWaiting=()=>{var e;null!=(e=this.media)&&e.seeking||(this.waiting=self.performance.now(),this.tick())},this.onMediaEnded=()=>{var e;this.hls&&(this.ended=(null==(e=this.media)?void 0:e.currentTime)||1,this.hls.trigger(l.MEDIA_ENDED,{stalled:!1}))},this.hls=e,this.fragmentTracker=t,this.registerListeners()}registerListeners(){const{hls:e}=this;e&&(e.on(l.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(l.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(l.BUFFER_APPENDED,this.onBufferAppended,this))}unregisterListeners(){const{hls:e}=this;e&&(e.off(l.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(l.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(l.BUFFER_APPENDED,this.onBufferAppended,this))}destroy(){super.destroy(),this.unregisterListeners(),this.media=this.hls=this.fragmentTracker=null,this.mediaSource=void 0}onMediaAttached(e,t){this.setInterval(100),this.mediaSource=t.mediaSource;const n=this.media=t.media;Er(n,"playing",this.onMediaPlaying),Er(n,"waiting",this.onMediaWaiting),Er(n,"ended",this.onMediaEnded)}onMediaDetaching(e,t){this.clearInterval();const{media:n}=this;n&&(yr(n,"playing",this.onMediaPlaying),yr(n,"waiting",this.onMediaWaiting),yr(n,"ended",this.onMediaEnded),this.media=null),this.mediaSource=void 0}onBufferAppended(e,t){this.buffered=t.timeRanges}get hasBuffered(){return Object.keys(this.buffered).length>0}tick(){var e;if(null==(e=this.media)||!e.readyState||!this.hasBuffered)return;const t=this.media.currentTime;this.poll(t,this.lastCurrentTime),this.lastCurrentTime=t}poll(e,t){var n,r;const s=null==(n=this.hls)?void 0:n.config;if(!s)return;const i=this.media;if(!i)return;const{seeking:a}=i,o=this.seeking&&!a,c=!this.seeking&&a,u=i.paused&&!a||i.ended||0===i.playbackRate;if(this.seeking=a,e!==t)return t&&(this.ended=0),this.moved=!0,a||(this.nudgeRetry=0,s.nudgeOnVideoHole&&!u&&e>t&&this.nudgeOnVideoHole(e,t)),void(0===this.waiting&&this.stallResolved(e));if(c||o)return void(o&&this.stallResolved(e));if(u)return this.nudgeRetry=0,this.stallResolved(e),void(!this.ended&&i.ended&&this.hls&&(this.ended=e||1,this.hls.trigger(l.MEDIA_ENDED,{stalled:!1})));if(!nn.getBuffered(i).length)return void(this.nudgeRetry=0);const d=nn.bufferInfo(i,e,0),h=d.nextStart||0,f=this.fragmentTracker;if(a&&f&&this.hls){const t=Jo(this.hls.inFlightFragments,e),n=d.len>2,r=!h||t||h-e>2&&!f.getPartialFragment(e);if(n||r)return;this.moved=!1}const p=null==(r=this.hls)?void 0:r.latestLevelDetails;if(!this.moved&&null!==this.stalled&&f){if(!(d.len>0)&&!h)return;const t=Math.max(h,d.start||0)-e,n=!(null==p||!p.live)?2*p.targetduration:2,r=Qo(e,f);if(t>0&&(t<=n||r))return void(i.paused||this._trySkipBufferHole(r))}const g=s.detectStallWithCurrentTimeMs,m=self.performance.now(),_=this.waiting;let T=this.stalled;if(null===T){if(!(_>0&&m-_<g))return void(this.stalled=m);T=this.stalled=_}const E=m-T;if(!a&&(E>=g||_)&&this.hls){var y;if("ended"===(null==(y=this.mediaSource)?void 0:y.readyState)&&(null==p||!p.live)&&Math.abs(e-((null==p?void 0:p.edge)||0))<1){if(this.ended)return;return this.ended=e||1,void this.hls.trigger(l.MEDIA_ENDED,{stalled:!0})}if(this._reportStall(d),!this.media||!this.hls)return}const S=nn.bufferInfo(i,e,s.maxBufferHole);this._tryFixBufferStall(S,E,e)}stallResolved(e){const t=this.stalled;if(t&&this.hls&&(this.stalled=null,this.stallReported)){const n=self.performance.now()-t;this.log(`playback not stuck anymore @${e}, after ${Math.round(n)}ms`),this.stallReported=!1,this.waiting=0,this.hls.trigger(l.STALL_RESOLVED,{})}}nudgeOnVideoHole(e,t){var n;const r=this.buffered.video;if(this.hls&&this.media&&this.fragmentTracker&&null!=(n=this.buffered.audio)&&n.length&&r&&r.length>1&&e>r.end(0)){const n=nn.bufferedInfo(nn.timeRangesToArray(this.buffered.audio),e,0);if(n.len>1&&t>=n.start){const n=nn.timeRangesToArray(r),s=nn.bufferedInfo(n,t,0).bufferedIndex;if(s>-1&&s<n.length-1){const t=nn.bufferedInfo(n,e,0).bufferedIndex,r=n[s].end,i=n[s+1].start;if((-1===t||t>s)&&i-r<1&&e-r<2){const n=new Error(`nudging playhead to flush pipeline after video hole. currentTime: ${e} hole: ${r} -> ${i} buffered index: ${t}`);this.warn(n.message),this.media.currentTime+=1e-6;let s=Qo(e,this.fragmentTracker);s&&"fragment"in s?s=s.fragment:s||(s=void 0);const c=nn.bufferInfo(this.media,e,0);this.hls.trigger(l.ERROR,{type:a.MEDIA_ERROR,details:o.BUFFER_SEEK_OVER_HOLE,fatal:!1,error:n,reason:n.message,frag:s,buffer:c.len,bufferInfo:c})}}}}}_tryFixBufferStall(e,t,n){var r,s;const{fragmentTracker:i,media:a}=this,o=null==(r=this.hls)?void 0:r.config;if(!a||!i||!o)return;const l=null==(s=this.hls)?void 0:s.latestLevelDetails,c=Qo(n,i);if(c||null!=l&&l.live&&n<l.fragmentStart){if(this._trySkipBufferHole(c)||!this.media)return}const u=e.buffered,d=this.adjacentTraversal(e,n);(u&&u.length>1&&e.len>o.maxBufferHole||e.nextStart&&(e.nextStart-n<o.maxBufferHole||d))&&(t>1e3*o.highBufferWatchdogPeriod||this.waiting)&&(this.warn("Trying to nudge playhead over buffer-hole"),this._tryNudgeBuffer(e))}adjacentTraversal(e,t){const n=this.fragmentTracker,r=e.nextStart;if(n&&r){const e=n.getFragAtPos(t,f),s=n.getFragAtPos(r,f);if(e&&s)return s.sn-e.sn<2}return!1}_reportStall(e){const{hls:t,media:n,stallReported:r,stalled:s}=this;if(!r&&null!==s&&n&&t){this.stallReported=!0;const r=new Error(`Playback stalling at @${n.currentTime} due to low buffer (${rt(e)})`);this.warn(r.message),t.trigger(l.ERROR,{type:a.MEDIA_ERROR,details:o.BUFFER_STALLED_ERROR,fatal:!1,error:r,buffer:e.len,bufferInfo:e,stalled:{start:s}})}}_trySkipBufferHole(e){var t;const{fragmentTracker:n,media:r}=this,s=null==(t=this.hls)?void 0:t.config;if(!r||!n||!s)return 0;const i=r.currentTime,c=nn.bufferInfo(r,i,0),u=i<c.start?c.start:c.nextStart;if(u&&this.hls){const t=c.len<=s.maxBufferHole,h=c.len>0&&c.len<1&&r.readyState<3,p=u-i;if(p>0&&(t||h)){if(p>s.maxBufferHole){let t=!1;if(0===i){const e=n.getAppendedFrag(0,f);e&&u<e.end&&(t=!0)}if(!t&&e){var d;if(null==(d=this.hls.loadLevelObj)||!d.details)return 0;if(Jo(this.hls.inFlightFragments,u))return 0;let t=!1,r=e.end;for(;r<u;){const e=Qo(r,n);if(!e){t=!0;break}r+=e.duration}if(t)return 0}}const t=Math.max(u+.05,i+.1);if(this.warn(`skipping hole, adjusting currentTime from ${i} to ${t}`),this.moved=!0,r.currentTime=t,null==e||!e.gap){const n=new Error(`fragment loaded with buffer holes, seeking from ${i} to ${t}`),r={type:a.MEDIA_ERROR,details:o.BUFFER_SEEK_OVER_HOLE,fatal:!1,error:n,reason:n.message,buffer:c.len,bufferInfo:c};e&&("fragment"in e?r.part=e:r.frag=e),this.hls.trigger(l.ERROR,r)}return t}}return 0}_tryNudgeBuffer(e){const{hls:t,media:n,nudgeRetry:r}=this,s=null==t?void 0:t.config;if(!n||!s)return 0;const i=n.currentTime;if(this.nudgeRetry++,r<s.nudgeMaxRetry){const c=i+(r+1)*s.nudgeOffset,u=new Error(`Nudging 'currentTime' from ${i} to ${c}`);this.warn(u.message),n.currentTime=c,t.trigger(l.ERROR,{type:a.MEDIA_ERROR,details:o.BUFFER_NUDGE_ON_STALL,error:u,fatal:!1,buffer:e.len,bufferInfo:e})}else{const n=new Error(`Playhead still not moving while enough data buffered @${i} after ${s.nudgeMaxRetry} nudges`);this.error(n.message),t.trigger(l.ERROR,{type:a.MEDIA_ERROR,details:o.BUFFER_STALLED_ERROR,error:n,fatal:!0,buffer:e.len,bufferInfo:e})}}}function Jo(e,t){const n=Xo(e.main);if(n&&n.start<=t)return n;const r=Xo(e.audio);return r&&r.start<=t?r:null}function Xo(e){if(!e)return null;
1switch(e.state){case br:case vr:case Or:case Nr:return null}return e.frag}function Qo(e,t){return t.getAppendedFrag(e,f)||t.getPartialFragment(e)}function Zo(){if("undefined"!=typeof self)return self.VTTCue||self.TextTrackCue}function el(e,t,n,r,s){let i=new e(t,n,"");try{i.value=r,s&&(i.type=s)}catch(a){i=new e(t,n,rt(s?S({type:s},r):r))}return i}const tl=(()=>{const e=Zo();try{e&&new e(0,Number.POSITIVE_INFINITY,"")}catch(e){return Number.MAX_VALUE}return Number.POSITIVE_INFINITY})();class nl{constructor(e){this.hls=void 0,this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.removeCues=!0,this.assetCue=void 0,this.onEventCueEnter=()=>{this.hls&&this.hls.trigger(l.EVENT_CUE_ENTER,{})},this.hls=e,this._registerListeners()}destroy(){this._unregisterListeners(),this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.hls=this.onEventCueEnter=null}_registerListeners(){const{hls:e}=this;e&&(e.on(l.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(l.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(l.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(l.MANIFEST_LOADING,this.onManifestLoading,this),e.on(l.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.on(l.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(l.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(l.LEVEL_PTS_UPDATED,this.onLevelPtsUpdated,this))}_unregisterListeners(){const{hls:e}=this;
vendor: 37,813 bytes, line 1
1e&&(e.off(l.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(l.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(l.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(l.MANIFEST_LOADING,this.onManifestLoading,this),e.off(l.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.off(l.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(l.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(l.LEVEL_PTS_UPDATED,this.onLevelPtsUpdated,this))}onMediaAttaching(e,t){var n;this.media=t.media,!1===(null==(n=t.overrides)?void 0:n.cueRemoval)&&(this.removeCues=!1)}onMediaAttached(){var e;const t=null==(e=this.hls)?void 0:e.latestLevelDetails;t&&this.updateDateRangeCues(t)}onMediaDetaching(e,t){this.media=null;!!t.transferMedia||(this.id3Track&&(this.removeCues&&Aa(this.id3Track,this.onEventCueEnter),this.id3Track=null),this.dateRangeCuesAppended={})}onManifestLoading(){this.dateRangeCuesAppended={}}createTrack(e){const t=this.getID3Track(e.textTracks);return t.mode="hidden",t}getID3Track(e){if(this.media){for(let t=0;t<e.length;t++){const n=e[t];if("metadata"===n.kind&&"id3"===n.label)return ba(n,this.media),n}return this.media.addTextTrack("metadata","id3")}}onFragParsingMetadata(e,t){if(!this.media||!this.hls)return;const{enableEmsgMetadataCues:n,enableID3MetadataCues:r}=this.hls.config;if(!n&&!r)return;const{samples:s}=t;this.id3Track||(this.id3Track=this.createTrack(this.media));const i=Zo();if(i)for(let e=0;e<s.length;e++){const t=s[e].type;if(t===us.emsg&&!n||!r)continue;const a=as(s[e].data),o=s[e].pts;let l=o+s[e].duration;l>tl&&(l=tl);l-o<=0&&(l=o+.25);for(let e=0;e<a.length;e++){const n=a[e];if(!os(n)){this.updateId3CueEnds(o,t);const e=el(i,o,l,n,t);e&&this.id3Track.addCue(e)}}}}updateId3CueEnds(e,t){var n;const r=null==(n=this.id3Track)?void 0:n.cues;if(r)for(let n=r.length;n--;){const s=r[n];s.type===t&&s.startTime<e&&s.endTime===tl&&(s.endTime=e)}}onBufferFlushing(e,{startOffset:t,endOffset:n,type:r}){const{id3Track:s,hls:i}=this;if(!i)return;const{config:{enableEmsgMetadataCues:a,enableID3MetadataCues:o}}=i;if(s&&(a||o)){let e;e="audio"===r?e=>e.type===us.audioId3&&o:"video"===r?e=>e.type===us.emsg&&a:e=>e.type===us.audioId3&&o||e.type===us.emsg&&a,Ra(s,t,n,e)}}onLevelUpdated(e,{details:t}){this.updateDateRangeCues(t,!0)}onLevelPtsUpdated(e,t){Math.abs(t.drift)>.01&&this.updateDateRangeCues(t.details)}updateDateRangeCues(e,t){if(!this.hls||!this.media)return;const{assetPlayerId:n,timelineOffset:s,enableDateRangeMetadataCues:i,interstitialsController:a}=this.hls.config;if(!i)return;const o=Zo();if(n&&s&&!a){const{fragmentStart:t,fragmentEnd:r}=e;let s=this.assetCue;s?(s.startTime=t,s.endTime=r):o&&(s=this.assetCue=el(o,t,r,{assetPlayerId:this.hls.config.assetPlayerId},"hlsjs.interstitial.asset"),s&&(s.id=n,this.id3Track||(this.id3Track=this.createTrack(this.media)),this.id3Track.addCue(s),s.addEventListener("enter",this.onEventCueEnter)))}if(!e.hasProgramDateTime)return;const{id3Track:l}=this,{dateRanges:c}=e,u=Object.keys(c);let d=this.dateRangeCuesAppended;var h;if(l&&t)if(null!=(h=l.cues)&&h.length){const e=Object.keys(d).filter((e=>!u.includes(e)));for(let t=e.length;t--;){var f;const n=e[t],r=null==(f=d[n])?void 0:f.cues;delete d[n],r&&Object.keys(r).forEach((e=>{const t=r[e];if(t){t.removeEventListener("enter",this.onEventCueEnter);try{l.removeCue(t)}catch(e){}}}))}}else d=this.dateRangeCuesAppended={};const p=e.fragments[e.fragments.length-1];if(0!==u.length&&r(null==p?void 0:p.programDateTime)){this.id3Track||(this.id3Track=this.createTrack(this.media));for(let e=0;e<u.length;e++){const t=u[e],n=c[t],r=n.startTime,s=d[t],i=(null==s?void 0:s.cues)||{};let l=(null==s?void 0:s.durationKnown)||!1,h=tl;const{duration:f,endDate:p}=n;if(p&&null!==f)h=r+f,l=!0;else if(n.endOnNext&&!l){const e=u.reduce(((e,t)=>{if(t!==n.id){const r=c[t];if(r.class===n.class&&r.startDate>n.startDate&&(!e||n.startDate<e.startDate))return r}return e}),null);e&&(h=e.startTime,l=!0)}const m=Object.keys(n.attr);for(let e=0;e<m.length;e++){const c=m[e];if("ID"===(g=c)||"CLASS"===g||"CUE"===g||"START-DATE"===g||"DURATION"===g||"END-DATE"===g||"END-ON-NEXT"===g)continue;const u=i[c];if(u)!l||null!=s&&s.durationKnown?Math.abs(u.startTime-r)>.01&&(u.startTime=r,u.endTime=h):u.endTime=h;else if(o){let e=n.attr[c];hn(c)&&(e=P(e));const s=el(o,r,h,{key:c,data:e},us.dateRange);s&&(s.id=t,this.id3Track.addCue(s),i[c]=s,a&&("X-ASSET-LIST"!==c&&"X-ASSET-URL"!==c||s.addEventListener("enter",this.onEventCueEnter)))}}d[t]={cues:i,dateRange:n,durationKnown:l}}var g}}}class rl{constructor(e){this.hls=void 0,this.config=void 0,this.media=null,this.currentTime=0,this.stallCount=0,this._latency=null,this._targetLatencyUpdated=!1,this.onTimeupdate=()=>{const{media:e}=this,t=this.levelDetails;if(!e||!t)return;this.currentTime=e.currentTime;const n=this.computeLatency();if(null===n)return;this._latency=n;const{lowLatencyMode:r,maxLiveSyncPlaybackRate:s}=this.config;if(!r||1===s||!t.live)return;const i=this.targetLatency;if(null===i)return;const a=n-i;if(a<Math.min(this.maxLatency,i+t.targetduration)&&a>.05&&this.forwardBufferLength>1){const t=Math.min(2,Math.max(1,s)),n=Math.round(2/(1+Math.exp(-.75*a-this.edgeStalled))*20)/20,r=Math.min(t,Math.max(1,n));this.changeMediaPlaybackRate(e,r)}else 1!==e.playbackRate&&0!==e.playbackRate&&this.changeMediaPlaybackRate(e,1)},this.hls=e,this.config=e.config,this.registerListeners()}get levelDetails(){var e;return(null==(e=this.hls)?void 0:e.latestLevelDetails)||null}get latency(){return this._latency||0}get maxLatency(){const{config:e}=this;if(void 0!==e.liveMaxLatencyDuration)return e.liveMaxLatencyDuration;const t=this.levelDetails;return t?e.liveMaxLatencyDurationCount*t.targetduration:0}get targetLatency(){const e=this.levelDetails;if(null===e||null===this.hls)return null;const{holdBack:t,partHoldBack:n,targetduration:r}=e,{liveSyncDuration:s,liveSyncDurationCount:i,lowLatencyMode:a}=this.config,o=this.hls.userConfig;let l=a&&n||t;(this._targetLatencyUpdated||o.liveSyncDuration||o.liveSyncDurationCount||0===l)&&(l=void 0!==s?s:i*r);const c=r;return l+Math.min(this.stallCount*this.config.liveSyncOnStallIncrease,c)}set targetLatency(e){this.stallCount=0,this.config.liveSyncDuration=e,this._targetLatencyUpdated=!0}get liveSyncPosition(){const e=this.estimateLiveEdge(),t=this.targetLatency;if(null===e||null===t)return null;const n=this.levelDetails;if(null===n)return null;const r=n.edge,s=e-t-this.edgeStalled,i=r-n.totalduration,a=r-(this.config.lowLatencyMode&&n.partTarget||n.targetduration);return Math.min(Math.max(i,s),a)}get drift(){const e=this.levelDetails;return null===e?1:e.drift}get edgeStalled(){const e=this.levelDetails;if(null===e)return 0;const t=3*(this.config.lowLatencyMode&&e.partTarget||e.targetduration);return Math.max(e.age-t,0)}get forwardBufferLength(){const{media:e}=this,t=this.levelDetails;if(!e||!t)return 0;const n=e.buffered.length;return(n?e.buffered.end(n-1):t.edge)-this.currentTime}destroy(){this.unregisterListeners(),this.onMediaDetaching(),this.hls=null}registerListeners(){const{hls:e}=this;e&&(e.on(l.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(l.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(l.MANIFEST_LOADING,this.onManifestLoading,this),e.on(l.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(l.ERROR,this.onError,this))}unregisterListeners(){const{hls:e}=this;e&&(e.off(l.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(l.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(l.MANIFEST_LOADING,this.onManifestLoading,this),e.off(l.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(l.ERROR,this.onError,this))}onMediaAttached(e,t){this.media=t.media,this.media.addEventListener("timeupdate",this.onTimeupdate)}onMediaDetaching(){this.media&&(this.media.removeEventListener("timeupdate",this.onTimeupdate),this.media=null)}onManifestLoading(){this._latency=null,this.stallCount=0}onLevelUpdated(e,{details:t}){t.advanced&&this.onTimeupdate(),!t.live&&this.media&&this.media.removeEventListener("timeupdate",this.onTimeupdate)}onError(e,t){var n;t.details===o.BUFFER_STALLED_ERROR&&(this.stallCount++,this.hls&&null!=(n=this.levelDetails)&&n.live&&this.hls.logger.warn("[latency-controller]: Stall detected, adjusting target latency"))}changeMediaPlaybackRate(e,t){var n,r;e.playbackRate!==t&&(null==(n=this.hls)||n.logger.debug(`[latency-controller]: latency=${this.latency.toFixed(3)}, targetLatency=${null==(r=this.targetLatency)?void 0:r.toFixed(3)}, forwardBufferLength=${this.forwardBufferLength.toFixed(3)}: adjusting playback rate from ${e.playbackRate} to ${t}`),e.playbackRate=t)}estimateLiveEdge(){const e=this.levelDetails;return null===e?null:e.edge+e.age}computeLatency(){const e=this.estimateLiveEdge();return null===e?null:e-this.currentTime}}class sl extends hi{constructor(e,t){super(e,"level-controller"),this._levels=[],this._firstLevel=-1,this._maxAutoLevel=-1,this._startLevel=void 0,this.currentLevel=null,this.currentLevelIndex=-1,this.manualLevelIndex=-1,this.steering=void 0,this.onParsedComplete=void 0,this.steering=t,this._registerListeners()}_registerListeners(){const{hls:e}=this;e.on(l.MANIFEST_LOADING,this.onManifestLoading,this),e.on(l.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(l.LEVEL_LOADED,this.onLevelLoaded,this),e.on(l.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(l.FRAG_BUFFERED,this.onFragBuffered,this),e.on(l.ERROR,this.onError,this)}_unregisterListeners(){const{hls:e}=this;e.off(l.MANIFEST_LOADING,this.onManifestLoading,this),e.off(l.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(l.LEVEL_LOADED,this.onLevelLoaded,this),e.off(l.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(l.FRAG_BUFFERED,this.onFragBuffered,this),e.off(l.ERROR,this.onError,this)}destroy(){this._unregisterListeners(),this.steering=null,this.resetLevels(),super.destroy()}stopLoad(){this._levels.forEach((e=>{e.loadError=0,e.fragmentError=0})),super.stopLoad()}resetLevels(){this._startLevel=void 0,this.manualLevelIndex=-1,this.currentLevelIndex=-1,this.currentLevel=null,this._levels=[],this._maxAutoLevel=-1}onManifestLoading(e,t){this.resetLevels()}onManifestLoaded(e,t){const n=this.hls.config.preferManagedMediaSource,r=[],s={},i={};let a=!1,o=!1,l=!1;t.levels.forEach((e=>{const t=e.attrs;let{audioCodec:c,videoCodec:u}=e;c&&(e.audioCodec=c=Me(c,n)||void 0),u&&(u=e.videoCodec=function(e){const t=e.split(",");for(let e=0;e<t.length;e++){const n=t[e].split(".");n.length>2&&"avc1"===n[0]&&(t[e]=`avc1.${parseInt(n[1]).toString(16)}${("000"+parseInt(n[2]).toString(16)).slice(-4)}`)}return t.join(",")}(u));const{width:d,height:h,unknownCodecs:f}=e,p=(null==f?void 0:f.length)||0;if(a||(a=!(!d||!h)),o||(o=!!u),l||(l=!!c),p||c&&!this.isAudioSupported(c)||u&&!this.isVideoSupported(u))return void this.log(`Some or all CODECS not supported "${t.CODECS}"`);const{CODECS:g,"FRAME-RATE":m,"HDCP-LEVEL":_,"PATHWAY-ID":T,RESOLUTION:E,"VIDEO-RANGE":y}=t,S=`${`${T||"."}-`}${e.bitrate}-${E}-${m}-${g}-${y}-${_}`;if(s[S])if(s[S].uri===e.url||e.attrs["PATHWAY-ID"])s[S].addGroupId("audio",t.AUDIO),s[S].addGroupId("text",t.SUBTITLES);else{const t=i[S]+=1;e.attrs["PATHWAY-ID"]=new Array(t+1).join(".");const n=this.createLevel(e);s[S]=n,r.push(n)}else{const t=this.createLevel(e);s[S]=t,i[S]=1,r.push(t)}})),this.filterAndSortMediaOptions(r,t,a,o,l)}createLevel(e){const t=new et(e),n=e.supplemental;if(null!=n&&n.videoCodec&&!this.isVideoSupported(n.videoCodec)){const e=new Error(`SUPPLEMENTAL-CODECS not supported "${n.videoCodec}"`);this.log(e.message),t.supportedResult=He(e,[])}return t}isAudioSupported(e){return Ce(e,"audio",this.hls.config.preferManagedMediaSource)}isVideoSupported(e){return Ce(e,"video",this.hls.config.preferManagedMediaSource)}filterAndSortMediaOptions(e,t,n,r,s){var i;let c=[],u=[],d=e;const h=(null==(i=t.stats)?void 0:i.parsing)||{};if((n||r)&&s&&(d=d.filter((({videoCodec:e,videoRange:t,width:n,height:r})=>{return(!!e||!(!n||!r))&&(!!(s=t)&&Ye.indexOf(s)>-1);var s}))),0===d.length)return Promise.resolve().then((()=>{if(this.hls){let e="no level with compatible codecs found in manifest",n=e;t.levels.length&&(n=`one or more CODECS in variant not supported: ${rt(t.levels.map((e=>e.attrs.CODECS)).filter(((e,t,n)=>n.indexOf(e)===t)))}`,this.warn(n),e+=` (${n})`);const r=new Error(e);this.hls.trigger(l.ERROR,{type:a.MEDIA_ERROR,details:o.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:t.url,error:r,reason:n})}})),void(h.end=performance.now());t.audioTracks&&(c=t.audioTracks.filter((e=>!e.audioCodec||this.isAudioSupported(e.audioCodec))),il(c)),t.subtitles&&(u=t.subtitles,il(u));const f=d.slice(0);d.sort(((e,t)=>{if(e.attrs["HDCP-LEVEL"]!==t.attrs["HDCP-LEVEL"])return(e.attrs["HDCP-LEVEL"]||"")>(t.attrs["HDCP-LEVEL"]||"")?1:-1;if(n&&e.height!==t.height)return e.height-t.height;if(e.frameRate!==t.frameRate)return e.frameRate-t.frameRate;if(e.videoRange!==t.videoRange)return Ye.indexOf(e.videoRange)-Ye.indexOf(t.videoRange);if(e.videoCodec!==t.videoCodec){const n=Oe(e.videoCodec),r=Oe(t.videoCodec);if(n!==r)return r-n}if(e.uri===t.uri&&e.codecSet!==t.codecSet){const n=Ne(e.codecSet),r=Ne(t.codecSet);if(n!==r)return r-n}return e.averageBitrate!==t.averageBitrate?e.averageBitrate-t.averageBitrate:0}));let p=f[0];if(this.steering&&(d=this.steering.filterParsedLevels(d),d.length!==f.length))for(let e=0;e<f.length;e++)if(f[e].pathwayId===d[0].pathwayId){p=f[e];break}this._levels=d;for(let e=0;e<d.length;e++)if(d[e]===p){var g;this._firstLevel=e;const t=p.bitrate,n=this.hls.bandwidthEstimate;if(this.log(`manifest loaded, ${d.length} level(s) found, first bitrate: ${t}`),void 0===(null==(g=this.hls.userConfig)?void 0:g.abrEwmaDefaultEstimate)){const e=Math.min(t,this.hls.config.abrEwmaDefaultEstimateMax);e>n&&n===this.hls.abrEwmaDefaultEstimate&&(this.hls.bandwidthEstimate=e)}break}const m=s&&!r,_=this.hls.config,T=!(!_.audioStreamController||!_.audioTrackController),E={levels:d,audioTracks:c,subtitleTracks:u,sessionData:t.sessionData,sessionKeys:t.sessionKeys,firstLevel:this._firstLevel,stats:t.stats,audio:s,video:r,altAudio:T&&!m&&c.some((e=>!!e.url))};h.end=performance.now(),this.hls.trigger(l.MANIFEST_PARSED,E)}get levels(){return 0===this._levels.length?null:this._levels}get loadLevelObj(){return this.currentLevel}get level(){return this.currentLevelIndex}set level(e){const t=this._levels;if(0===t.length)return;if(e<0||e>=t.length){const n=new Error("invalid level idx"),r=e<0;if(this.hls.trigger(l.ERROR,{type:a.OTHER_ERROR,details:o.LEVEL_SWITCH_ERROR,level:e,fatal:r,error:n,reason:n.message}),r)return;e=Math.min(e,t.length-1)}const n=this.currentLevelIndex,r=this.currentLevel,s=r?r.attrs["PATHWAY-ID"]:void 0,i=t[e],c=i.attrs["PATHWAY-ID"];if(this.currentLevelIndex=e,this.currentLevel=i,n===e&&r&&s===c)return;this.log(`Switching to level ${e} (${i.height?i.height+"p ":""}${i.videoRange?i.videoRange+" ":""}${i.codecSet?i.codecSet+" ":""}@${i.bitrate})${c?" with Pathway "+c:""} from level ${n}${s?" with Pathway "+s:""}`);const u={level:e,attrs:i.attrs,details:i.details,bitrate:i.bitrate,averageBitrate:i.averageBitrate,maxBitrate:i.maxBitrate,realBitrate:i.realBitrate,width:i.width,height:i.height,codecSet:i.codecSet,audioCodec:i.audioCodec,videoCodec:i.videoCodec,audioGroups:i.audioGroups,subtitleGroups:i.subtitleGroups,loaded:i.loaded,loadError:i.loadError,fragmentError:i.fragmentError,name:i.name,id:i.id,uri:i.uri,url:i.url,urlId:0,audioGroupIds:i.audioGroupIds,textGroupIds:i.textGroupIds};this.hls.trigger(l.LEVEL_SWITCHING,u);const d=i.details;if(!d||d.live){const e=this.switchParams(i.uri,null==r?void 0:r.details,d);this.loadPlaylist(e)}}get manualLevel(){return this.manualLevelIndex}set manualLevel(e){this.manualLevelIndex=e,void 0===this._startLevel&&(this._startLevel=e),-1!==e&&(this.level=e)}get firstLevel(){return this._firstLevel}set firstLevel(e){this._firstLevel=e}get startLevel(){if(void 0===this._startLevel){const e=this.hls.config.startLevel;return void 0!==e?e:this.hls.firstAutoLevel}return this._startLevel}set startLevel(e){this._startLevel=e}get pathways(){return this.steering?this.steering.pathways():[]}get pathwayPriority(){return this.steering?this.steering.pathwayPriority:null}set pathwayPriority(e){if(this.steering){const t=this.steering.pathways(),n=e.filter((e=>-1!==t.indexOf(e)));if(e.length<1)return void this.warn(`pathwayPriority ${e} should contain at least one pathway from list: ${t}`);this.steering.pathwayPriority=n}}onError(e,t){!t.fatal&&t.context&&t.context.type===u&&t.context.level===this.level&&this.checkRetry(t)}onFragBuffered(e,{frag:t}){if(void 0!==t&&t.type===f){const e=t.elementaryStreams;if(!Object.keys(e).some((t=>!!e[t])))return;const n=this._levels[t.level];null!=n&&n.loadError&&(this.log(`Resetting level error count of ${n.loadError} on frag buffered`),n.loadError=0)}}onLevelLoaded(e,t){var n;const{level:r,details:s}=t,i=t.levelInfo;var a;if(!i)return this.warn(`Invalid level index ${r}`),void(null!=(a=t.deliveryDirectives)&&a.skip&&(s.deltaUpdateFailed=!0));if(i===this.currentLevel||t.withoutMultiVariant){0===i.fragmentError&&(i.loadError=0);let e=i.details;e===t.details&&e.advanced&&(e=void 0),this.playlistLoaded(r,t,e)}else null!=(n=t.deliveryDirectives)&&n.skip&&(s.deltaUpdateFailed=!0)}loadPlaylist(e){super.loadPlaylist(),this.shouldLoadPlaylist(this.currentLevel)&&this.scheduleLoading(this.currentLevel,e)}loadingPlaylist(e,t){super.loadingPlaylist(e,t);const n=this.getUrlWithDirectives(e.uri,t),r=this.currentLevelIndex,s=e.attrs["PATHWAY-ID"],i=e.details,a=null==i?void 0:i.age;this.log(`Loading level index ${r}${void 0!==(null==t?void 0:t.msn)?" at sn "+t.msn+" part "+t.part:""}${s?" Pathway "+s:""}${a&&i.live?" age "+a.toFixed(1)+(i.type?" "+i.type||0:""):""} ${n}`),this.hls.trigger(l.LEVEL_LOADING,{url:n,level:r,levelInfo:e,pathwayId:e.attrs["PATHWAY-ID"],id:0,deliveryDirectives:t||null})}get nextLoadLevel(){return-1!==this.manualLevelIndex?this.manualLevelIndex:this.hls.nextAutoLevel}set nextLoadLevel(e){this.level=e,-1===this.manualLevelIndex&&(this.hls.nextAutoLevel=e)}removeLevel(e){var t;if(1===this._levels.length)return;const n=this._levels.filter(((t,n)=>n!==e||(this.steering&&this.steering.removeLevel(t),t===this.currentLevel&&(this.currentLevel=null,this.currentLevelIndex=-1,t.details&&t.details.fragments.forEach((e=>e.level=-1))),!1)));dr(n),this._levels=n,this.currentLevelIndex>-1&&null!=(t=this.currentLevel)&&t.details&&(this.currentLevelIndex=this.currentLevel.details.fragments[0].level),this.manualLevelIndex>-1&&(this.manualLevelIndex=this.currentLevelIndex);const r=n.length-1;this._firstLevel=Math.min(this._firstLevel,r),this._startLevel&&(this._startLevel=Math.min(this._startLevel,r)),this.hls.trigger(l.LEVELS_UPDATED,{levels:n})}onLevelsUpdated(e,{levels:t}){this._levels=t}checkMaxAutoUpdated(){const{autoLevelCapping:e,maxAutoLevel:t,maxHdcpLevel:n}=this.hls;this._maxAutoLevel!==t&&(this._maxAutoLevel=t,this.hls.trigger(l.MAX_AUTO_LEVEL_UPDATED,{autoLevelCapping:e,levels:this.levels,maxAutoLevel:t,minAutoLevel:this.hls.minAutoLevel,maxHdcpLevel:n}))}}function il(e){const t={};e.forEach((e=>{const n=e.groupId||"";e.id=t[n]=t[n]||0,t[n]++}))}function al(){return self.SourceBuffer||self.WebKitSourceBuffer}function ol(){if(!L())return!1;const e=al();return!e||e.prototype&&"function"==typeof e.prototype.appendBuffer&&"function"==typeof e.prototype.remove}class ll extends Mr{constructor(e,t,n){super(e,t,n,"stream-controller",f),this.audioCodecSwap=!1,this.level=-1,this._forceStartLoad=!1,this._hasEnoughToStart=!1,this.altAudio=0,this.audioOnly=!1,this.fragPlaying=null,this.fragLastKbps=0,this.couldBacktrack=!1,this.backtrackFragment=null,this.audioCodecSwitch=!1,this.videoBuffer=null,this.onMediaPlaying=()=>{this.tick()},this.onMediaSeeked=()=>{const e=this.media,t=e?e.currentTime:null;if(null===t||!r(t))return;if(this.log(`Media seeked to ${t.toFixed(3)}`),!this.getBufferedFrag(t))return;const n=this.getFwdBufferInfoAtPos(e,t,f,0);null!==n&&0!==n.len?this.tick():this.warn(`Main forward buffer length at ${t} on "seeked" event ${n?n.len:"empty"})`)},this.registerListeners()}registerListeners(){super.registerListeners();const{hls:e}=this;e.on(l.MANIFEST_PARSED,this.onManifestParsed,this),e.on(l.LEVEL_LOADING,this.onLevelLoading,this),e.on(l.LEVEL_LOADED,this.onLevelLoaded,this),e.on(l.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),e.on(l.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(l.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.on(l.BUFFER_CREATED,this.onBufferCreated,this),e.on(l.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(l.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(l.FRAG_BUFFERED,this.onFragBuffered,this)}unregisterListeners(){super.unregisterListeners();const{hls:e}=this;e.off(l.MANIFEST_PARSED,this.onManifestParsed,this),e.off(l.LEVEL_LOADED,this.onLevelLoaded,this),e.off(l.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),e.off(l.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(l.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.off(l.BUFFER_CREATED,this.onBufferCreated,this),e.off(l.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(l.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(l.FRAG_BUFFERED,this.onFragBuffered,this)}onHandlerDestroying(){this.onMediaPlaying=this.onMediaSeeked=null,this.unregisterListeners(),super.onHandlerDestroying()}startLoad(e,t){if(this.levels){const{lastCurrentTime:n,hls:r}=this;if(this.stopLoad(),this.setInterval(100),this.level=-1,!this.startFragRequested){let e=r.startLevel;-1===e&&(r.config.testBandwidth&&this.levels.length>1?(e=0,this.bitrateTest=!0):e=r.firstAutoLevel),r.nextLoadLevel=e,this.level=r.loadLevel,this._hasEnoughToStart=!!t}n>0&&-1===e&&!t&&(this.log(`Override startPosition with lastCurrentTime @${n.toFixed(3)}`),e=n),this.state=br,this.nextLoadPosition=this.lastCurrentTime=e+this.timelineOffset,this.startPosition=t?-1:e,this.tick()}else this._forceStartLoad=!0,this.state=vr}stopLoad(){this._forceStartLoad=!1,super.stopLoad()}doTick(){switch(this.state){case Pr:{const{levels:e,level:t}=this,n=null==e?void 0:e[t],r=null==n?void 0:n.details;if(r&&(!r.live||this.levelLastLoaded===n&&!this.waitForLive(n))){if(this.waitForCdnTuneIn(r))break;this.state=br;break}if(this.hls.nextLoadLevel!==this.level){this.state=br;break}break}case Rr:this.checkRetryDate()}this.state===br&&this.doTickIdle(),this.onTickEnd()}onTickEnd(){var e;super.onTickEnd(),null!=(e=this.media)&&e.readyState&&!1===this.media.seeking&&(this.lastCurrentTime=this.media.currentTime),this.checkFragmentChanged()}doTickIdle(){const{hls:e,levelLastLoaded:t,levels:n,media:r}=this;if(null===t||!r&&!this.primaryPrefetch&&(this.startFragRequested||!e.config.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;const s=this.buffering?e.nextLoadLevel:e.loadLevel;if(null==n||!n[s])return;const i=n[s],a=this.getMainFwdBufferInfo();if(null===a)return;const o=this.getLevelDetails();if(o&&this._streamEnded(a,o)){const e={};return 2===this.altAudio&&(e.type="video"),this.hls.trigger(l.BUFFER_EOS,e),void(this.state=Or)}if(!this.buffering)return;e.loadLevel!==s&&-1===e.manualLevel&&this.log(`Adapting to level ${s} from level ${this.level}`),this.level=e.nextLoadLevel=s;const c=i.details;if(!c||this.state===Pr||this.waitForLive(i))return this.level=s,this.state=Pr,void(this.startFragRequested=!1);const u=a.len,d=this.getMaxBufferLength(i.maxBitrate);if(u>=d)return;this.backtrackFragment&&this.backtrackFragment.start>a.end&&(this.backtrackFragment=null);const h=this.backtrackFragment?this.backtrackFragment.start:a.end;let p=this.getNextFragment(h,c);if(this.couldBacktrack&&!this.fragPrevious&&p&&Y(p)&&this.fragmentTracker.getState(p)!==Ut){var g;const e=(null!=(g=this.backtrackFragment)?g:p).sn-c.startSN,t=c.fragments[e-1];t&&p.cc===t.cc&&(p=t,this.fragmentTracker.removeFragment(t))}else this.backtrackFragment&&a.len&&(this.backtrackFragment=null);if(p&&this.isLoopLoading(p,h)){if(!p.gap){const e=this.audioOnly&&!this.altAudio?W:K,t=(e===K?this.videoBuffer:this.mediaBuffer)||this.media;t&&this.afterBufferFlushed(t,e,f)}p=this.getNextFragmentLoopLoading(p,c,a,f,d)}p&&(!p.initSegment||p.initSegment.data||this.bitrateTest||(p=p.initSegment),this.loadFragment(p,i,h))}loadFragment(e,t,n){const r=this.fragmentTracker.getState(e);r===Mt||r===xt?Y(e)?this.bitrateTest?(this.log(`Fragment ${e.sn} of level ${e.level} is being downloaded to test bitrate and will not be buffered`),this._loadBitrateTestFrag(e,t)):super.loadFragment(e,t,n):this._loadInitSegment(e,t):this.clearTrackerIfNeeded(e)}getBufferedFrag(e){return this.fragmentTracker.getBufferedFrag(e,f)}followingBufferedFrag(e){return e?this.getBufferedFrag(e.end+.5):null}immediateLevelSwitch(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)}nextLevelSwitch(){const{levels:e,media:t}=this;if(null!=t&&t.readyState){let n;const r=this.getAppendedFrag(t.currentTime);r&&r.start>1&&this.flushMainBuffer(0,r.start-1);const s=this.getLevelDetails();if(null!=s&&s.live){const e=this.getMainFwdBufferInfo();if(!e||e.len<2*s.targetduration)return}if(!t.paused&&e){const t=e[this.hls.nextLoadLevel],r=this.fragLastKbps;n=r&&this.fragCurrent?this.fragCurrent.duration*t.maxBitrate/(1e3*r)+1:0}else n=0;const i=this.getBufferedFrag(t.currentTime+n);if(i){const e=this.followingBufferedFrag(i);if(e){this.abortCurrentFrag();const t=e.maxStartPTS?e.maxStartPTS:e.start,n=e.duration,r=Math.max(i.end,t+Math.min(Math.max(n-this.config.maxFragLookUpTolerance,n*(this.couldBacktrack?.5:.125)),n*(this.couldBacktrack?.75:.25)));this.flushMainBuffer(r,Number.POSITIVE_INFINITY)}}}}abortCurrentFrag(){const e=this.fragCurrent;switch(this.fragCurrent=null,this.backtrackFragment=null,e&&(e.abortRequests(),this.fragmentTracker.removeFragment(e)),this.state){case Ir:case Ar:case Rr:case kr:case Lr:this.state=br}this.nextLoadPosition=this.getLoadPosition()}flushMainBuffer(e,t){super.flushMainBuffer(e,t,2===this.altAudio?"video":null)}onMediaAttached(e,t){super.onMediaAttached(e,t);const n=t.media;Er(n,"playing",this.onMediaPlaying),Er(n,"seeked",this.onMediaSeeked)}onMediaDetaching(e,t){const{media:n}=this;n&&(yr(n,"playing",this.onMediaPlaying),yr(n,"seeked",this.onMediaSeeked)),this.videoBuffer=null,this.fragPlaying=null,super.onMediaDetaching(e,t);!!t.transferMedia||(this._hasEnoughToStart=!1)}onManifestLoading(){super.onManifestLoading(),this.log("Trigger BUFFER_RESET"),this.hls.trigger(l.BUFFER_RESET,void 0),this.couldBacktrack=!1,this.fragLastKbps=0,this.fragPlaying=this.backtrackFragment=null,this.altAudio=0,this.audioOnly=!1}onManifestParsed(e,t){let n=!1,r=!1;for(let e=0;e<t.levels.length;e++){const s=t.levels[e].audioCodec;s&&(n=n||-1!==s.indexOf("mp4a.40.2"),r=r||-1!==s.indexOf("mp4a.40.5"))}this.audioCodecSwitch=n&&r&&!function(){var e;const t=al();return"function"==typeof(null==t||null==(e=t.prototype)?void 0:e.changeType)}(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=t.levels,this.startFragRequested=!1}onLevelLoading(e,t){const{levels:n}=this;if(!n||this.state!==br)return;const r=t.levelInfo;(!r.details||r.details.live&&(this.levelLastLoaded!==r||r.details.expired)||this.waitForCdnTuneIn(r.details))&&(this.state=Pr)}onLevelLoaded(e,t){var n;const{levels:r,startFragRequested:s}=this,i=t.level,a=t.details,o=a.totalduration;if(!r)return void this.warn(`Levels were reset while loading level ${i}`);this.log(`Level ${i} loaded [${a.startSN},${a.endSN}]${a.lastPartSn?`[part-${a.lastPartSn}-${a.lastPartIndex}]`:""}, cc [${a.startCC}, ${a.endCC}] duration:${o}`);const c=t.levelInfo,u=this.fragCurrent;!u||this.state!==Ar&&this.state!==Rr||u.level!==t.level&&u.loader&&this.abortCurrentFrag();let d=0;if(a.live||null!=(n=c.details)&&n.live){var h;if(this.checkLiveUpdate(a),a.deltaUpdateFailed)return;d=this.alignPlaylists(a,c.details,null==(h=this.levelLastLoaded)?void 0:h.details)}if(c.details=a,this.levelLastLoaded=c,s||this.setStartPosition(a,d),this.hls.trigger(l.LEVEL_UPDATED,{details:a,level:i}),this.state===Pr){if(this.waitForCdnTuneIn(a))return;this.state=br}s&&a.live&&this.synchronizeToLiveEdge(a),this.tick()}synchronizeToLiveEdge(e){const{config:t,media:n}=this;if(!n)return;const r=this.hls.liveSyncPosition,s=this.getLoadPosition(),i=e.fragmentStart,a=e.edge,o=s>=i-t.maxFragLookUpTolerance&&s<=a;if(null!==r&&n.duration>r&&(s<r||!o)){const i=void 0!==t.liveMaxLatencyDuration?t.liveMaxLatencyDuration:t.liveMaxLatencyDurationCount*e.targetduration;if((!o&&n.readyState<4||s<a-i)&&(this._hasEnoughToStart||(this.nextLoadPosition=r),n.readyState))if(this.warn(`Playback: ${s.toFixed(3)} is located too far from the end of live sliding playlist: ${a}, reset currentTime to : ${r.toFixed(3)}`),"buffered"===this.config.liveSyncMode){var l;const e=nn.bufferInfo(n,r,0);if(null==(l=e.buffered)||!l.length)return void(n.currentTime=r);if(e.start<=s)return void(n.currentTime=r);const{nextStart:t}=nn.bufferedInfo(e.buffered,s,0);t&&(n.currentTime=t)}else n.currentTime=r}}_handleFragmentLoadProgress(e){var t;const n=e.frag,{part:r,payload:s}=e,{levels:i}=this;if(!i)return void this.warn(`Levels were reset while fragment load was in progress. Fragment ${n.sn} of level ${n.level} will not be buffered`);const a=i[n.level];if(!a)return void this.warn(`Level ${n.level} not found on progress`);const o=a.details;if(!o)return this.warn(`Dropping fragment ${n.sn} of level ${n.level} after level details were reset`),void this.fragmentTracker.removeFragment(n);const l=a.videoCodec,c=o.PTSKnown||!o.live,u=null==(t=n.initSegment)?void 0:t.data,d=this._getAudioCodec(a),h=this.transmuxer=this.transmuxer||new di(this.hls,f,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),p=r?r.index:-1,g=-1!==p,m=new en(n.level,n.sn,n.stats.chunkCount,s.byteLength,p,g),_=this.initPTS[n.cc];h.push(s,u,d,l,n,r,o.totalduration,c,m,_)}onAudioTrackSwitching(e,t){const n=this.hls,r=0!==this.altAudio;if(dt(t.url,n))this.altAudio=1;else{if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;const e=this.fragCurrent;e&&(this.log("Switching to main audio track, cancel main fragment load"),e.abortRequests(),this.fragmentTracker.removeFragment(e)),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();if(r)return this.altAudio=0,this.fragmentTracker.removeAllFragments(),n.once(l.BUFFER_FLUSHED,(()=>{this.hls&&this.hls.trigger(l.AUDIO_TRACK_SWITCHED,t)})),void n.trigger(l.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:null});n.trigger(l.AUDIO_TRACK_SWITCHED,t)}}onAudioTrackSwitched(e,t){const n=dt(t.url,this.hls);if(n){const e=this.videoBuffer;e&&this.mediaBuffer!==e&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=e)}this.altAudio=n?2:0,this.tick()}onBufferCreated(e,t){const n=t.tracks;let r,s,i=!1;for(const e in n){const t=n[e];if("main"===t.id){if(s=e,r=t,"video"===e){const t=n[e];t&&(this.videoBuffer=t.buffer)}}else i=!0}i&&r?(this.log(`Alternate track found, use ${s}.buffered to schedule main fragment loading`),this.mediaBuffer=r.buffer):this.mediaBuffer=this.media}onFragBuffered(e,t){const{frag:n,part:r}=t,s=n.type===f;if(s){if(this.fragContextChanged(n))return this.warn(`Fragment ${n.sn}${r?" p: "+r.index:""} of level ${n.level} finished buffering, but was aborted. state: ${this.state}`),void(this.state===Lr&&(this.state=br));const e=r?r.stats:n.stats;this.fragLastKbps=Math.round(8*e.total/(e.buffering.end-e.loading.first)),Y(n)&&(this.fragPrevious=n),this.fragBufferedComplete(n,r)}const i=this.media;i&&(!this._hasEnoughToStart&&nn.getBuffered(i).length&&(this._hasEnoughToStart=!0,this.seekToStartPos()),s&&this.tick())}get hasEnoughToStart(){return this._hasEnoughToStart}onError(e,t){var n;if(t.fatal)this.state=Nr;else switch(t.details){case o.FRAG_GAP:case o.FRAG_PARSING_ERROR:case o.FRAG_DECRYPT_ERROR:case o.FRAG_LOAD_ERROR:case o.FRAG_LOAD_TIMEOUT:case o.KEY_LOAD_ERROR:case o.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(f,t);break;case o.LEVEL_LOAD_ERROR:case o.LEVEL_LOAD_TIMEOUT:case o.LEVEL_PARSING_ERROR:t.levelRetry||this.state!==Pr||(null==(n=t.context)?void 0:n.type)!==u||(this.state=br);break;case o.BUFFER_ADD_CODEC_ERROR:case o.BUFFER_APPEND_ERROR:if("main"!==t.parent)return;this.reduceLengthAndFlushBuffer(t)&&this.resetLoadingState();break;case o.BUFFER_FULL_ERROR:if("main"!==t.parent)return;if(this.reduceLengthAndFlushBuffer(t)){!this.config.interstitialsController&&this.config.assetPlayerId?this._hasEnoughToStart=!0:this.flushMainBuffer(0,Number.POSITIVE_INFINITY)}break;case o.INTERNAL_EXCEPTION:this.recoverWorkerError(t)}}onFragLoadEmergencyAborted(){this.state=br,this._hasEnoughToStart||(this.startFragRequested=!1,this.nextLoadPosition=this.lastCurrentTime),this.tickImmediate()}onBufferFlushed(e,{type:t}){if(t!==W||!this.altAudio){const e=(t===K?this.videoBuffer:this.mediaBuffer)||this.media;e&&(this.afterBufferFlushed(e,t,f),this.tick())}}onLevelsUpdated(e,t){this.level>-1&&this.fragCurrent&&(this.level=this.fragCurrent.level,-1===this.level&&this.resetWhenMissingContext(this.fragCurrent)),this.levels=t.levels}swapAudioCodec(){this.audioCodecSwap=!this.audioCodecSwap}seekToStartPos(){const{media:e}=this;if(!e)return;const t=e.currentTime;let n=this.startPosition;if(n>=0&&t<n){if(e.seeking)return void this.log(`could not seek to ${n}, already seeking at ${t}`);const r=this.timelineOffset;r&&n&&(n+=r);const s=this.getLevelDetails(),i=nn.getBuffered(e),a=i.length?i.start(0):0,o=a-n,l=Math.max(this.config.maxBufferHole,this.config.maxFragLookUpTolerance);(this.config.startOnSegmentBoundary||o>0&&(o<l||this.loadingParts&&o<2*((null==s?void 0:s.partTarget)||0)))&&(this.log(`adjusting start position by ${o} to match buffer start`),n+=o,this.startPosition=n),t<n&&(this.log(`seek to target start position ${n} from current time ${t} buffer start ${a}`),e.currentTime=n)}}_getAudioCodec(e){let t=this.config.defaultAudioCodec||e.audioCodec;return this.audioCodecSwap&&t&&(this.log("Swapping audio codec"),t=-1!==t.indexOf("mp4a.40.5")?"mp4a.40.2":"mp4a.40.5"),t}_loadBitrateTestFrag(e,t){e.bitrateTest=!0,this._doFragLoad(e,t).then((e=>{const{hls:n}=this,r=null==e?void 0:e.frag;if(!r||this.fragContextChanged(r))return;t.fragmentError=0,this.state=br,this.startFragRequested=!1,this.bitrateTest=!1;const s=r.stats;s.parsing.start=s.parsing.end=s.buffering.start=s.buffering.end=self.performance.now(),n.trigger(l.FRAG_LOADED,e),r.bitrateTest=!1})).catch((t=>{this.state!==vr&&this.state!==Nr&&(this.warn(t),this.resetFragmentLoading(e))}))}_handleTransmuxComplete(e){const t=this.playlistType,{hls:n}=this,{remuxResult:s,chunkMeta:i}=e,a=this.getCurrentContext(i);if(!a)return void this.resetWhenMissingContext(i);const{frag:o,part:c,level:u}=a,{video:d,text:h,id3:f,initSegment:p}=s,{details:g}=u,m=this.altAudio?void 0:s.audio;if(this.fragContextChanged(o))this.fragmentTracker.removeFragment(o);else{if(this.state=kr,p){const e=p.tracks;if(e){const r=o.initSegment||o;if(this.unhandledEncryptionError(p,o))return;this._bufferInitSegment(u,e,r,i),n.trigger(l.FRAG_PARSING_INIT_SEGMENT,{frag:r,id:t,tracks:e})}const s=p.initPTS,a=p.timescale,c=this.initPTS[o.cc];if(r(s)&&(!c||c.baseTime!==s||c.timescale!==a)){const e=p.trackId;this.initPTS[o.cc]={baseTime:s,timescale:a,trackId:e},n.trigger(l.INIT_PTS_FOUND,{frag:o,id:t,initPTS:s,timescale:a,trackId:e})}}if(d&&g){m&&"audiovideo"===d.type&&this.logMuxedErr(o);const e=g.fragments[o.sn-1-g.startSN],t=o.sn===g.startSN,n=!e||o.cc>e.cc;if(!1!==s.independent){const{startPTS:e,endPTS:r,startDTS:s,endDTS:a}=d;if(c)c.elementaryStreams[d.type]={startPTS:e,endPTS:r,startDTS:s,endDTS:a};else if(d.firstKeyFrame&&d.independent&&1===i.id&&!n&&(this.couldBacktrack=!0),d.dropped&&d.independent){const s=this.getMainFwdBufferInfo(),i=(s?s.end:this.getLoadPosition())+this.config.maxBufferHole,l=d.firstKeyFramePTS?d.firstKeyFramePTS:e;if(!t&&i<l-this.config.maxBufferHole&&!n)return void this.backtrack(o);n&&(o.gap=!0),o.setElementaryStreamInfo(d.type,o.start,r,o.start,a,!0)}else t&&e-(g.appliedTimelineOffset||0)>2&&(o.gap=!0);o.setElementaryStreamInfo(d.type,e,r,s,a),this.backtrackFragment&&(this.backtrackFragment=o),this.bufferFragmentData(d,o,c,i,t||n)}else{if(!t&&!n)return void this.backtrack(o);o.gap=!0}}if(m){const{startPTS:e,endPTS:t,startDTS:n,endDTS:r}=m;c&&(c.elementaryStreams[W]={startPTS:e,endPTS:t,startDTS:n,endDTS:r}),o.setElementaryStreamInfo(W,e,t,n,r),this.bufferFragmentData(m,o,c,i)}if(g&&null!=f&&f.samples.length){const e={id:t,frag:o,details:g,samples:f.samples};n.trigger(l.FRAG_PARSING_METADATA,e)}if(g&&h){const e={id:t,frag:o,details:g,samples:h.samples};n.trigger(l.FRAG_PARSING_USERDATA,e)}}}logMuxedErr(e){this.warn(`${Y(e)?"Media":"Init"} segment with muxed audiovideo where only video expected: ${e.url}`)}_bufferInitSegment(e,t,n,r){if(this.state!==kr)return;this.audioOnly=!!t.audio&&!t.video,this.altAudio&&!this.audioOnly&&(delete t.audio,t.audiovideo&&this.logMuxedErr(n));const{audio:s,video:i,audiovideo:a}=t;if(s){const n=e.audioCodec;let r=De(s.codec,n);"mp4a"===r&&(r="mp4a.40.5");const i=navigator.userAgent.toLowerCase();if(this.audioCodecSwitch){r&&(r=-1!==r.indexOf("mp4a.40.5")?"mp4a.40.2":"mp4a.40.5");const e=s.metadata;e&&"channelCount"in e&&1!==(e.channelCount||1)&&-1===i.indexOf("firefox")&&(r="mp4a.40.5")}r&&-1!==r.indexOf("mp4a.40.5")&&-1!==i.indexOf("android")&&"audio/mpeg"!==s.container&&(r="mp4a.40.2",this.log(`Android: force audio codec to ${r}`)),n&&n!==r&&this.log(`Swapping manifest audio codec "${n}" for "${r}"`),s.levelCodec=r,s.id=f,this.log(`Init audio buffer, container:${s.container}, codecs[selected/level/parsed]=[${r||""}/${n||""}/${s.codec}]`),delete t.audiovideo}if(i){i.levelCodec=e.videoCodec,i.id=f;
1const n=i.codec;if(4===(null==n?void 0:n.length))switch(n){case"hvc1":case"hev1":i.codec="hvc1.1.6.L120.90";break;case"av01":i.codec="av01.0.04M.08";break;case"avc1":i.codec="avc1.42e01e"}this.log(`Init video buffer, container:${i.container}, codecs[level/parsed]=[${e.videoCodec||""}/${n}]${i.codec!==n?" parsed-corrected="+i.codec:""}${i.supplemental?" supplemental="+i.supplemental:""}`),delete t.audiovideo}a&&(this.log(`Init audiovideo buffer, container:${a.container}, codecs[level/parsed]=[${e.codecs}/${a.codec}]`),delete t.video,delete t.audio);const o=Object.keys(t);if(o.length){if(this.hls.trigger(l.BUFFER_CODECS,t),!this.hls)return;o.forEach((e=>{const s=t[e].initSegment;null!=s&&s.byteLength&&this.hls.trigger(l.BUFFER_APPENDING,{type:e,data:s,frag:n,part:null,chunkMeta:r,parent:n.type})}))}this.tickImmediate()}getMainFwdBufferInfo(){const e=this.mediaBuffer&&2===this.altAudio?this.mediaBuffer:this.media;return this.getFwdBufferInfo(e,f)}get maxBufferLength(){const{levels:e,level:t}=this,n=null==e?void 0:e[t];return n?this.getMaxBufferLength(n.maxBitrate):this.config.maxBufferLength}backtrack(e){this.couldBacktrack=!0,this.backtrackFragment=e,this.resetTransmuxer(),this.flushBufferGap(e),this.fragmentTracker.removeFragment(e),this.fragPrevious=null,this.nextLoadPosition=e.start,this.state=br}checkFragmentChanged(){const e=this.media;let t=null;if(e&&e.readyState>1&&!1===e.seeking){const n=e.currentTime;if(nn.isBuffered(e,n)?t=this.getAppendedFrag(n):nn.isBuffered(e,n+.1)&&(t=this.getAppendedFrag(n+.1)),t){this.backtrackFragment=null;const e=this.fragPlaying,n=t.level;e&&t.sn===e.sn&&e.level===n||(this.fragPlaying=t,this.hls.trigger(l.FRAG_CHANGED,{frag:t}),e&&e.level===n||this.hls.trigger(l.LEVEL_SWITCHED,{level:n}))}}}get nextLevel(){const e=this.nextBufferedFrag;return e?e.level:-1}get currentFrag(){var e;if(this.fragPlaying)return this.fragPlaying;const t=(null==(e=this.media)?void 0:e.currentTime)||this.lastCurrentTime;return r(t)?this.getAppendedFrag(t):null}get currentProgramDateTime(){var e;const t=(null==(e=this.media)?void 0:e.currentTime)||this.lastCurrentTime;if(r(t)){const e=this.getLevelDetails(),n=this.currentFrag||(e?ft(null,e.fragments,t):null);if(n){const e=n.programDateTime;if(null!==e){const r=e+1e3*(t-n.start);return new Date(r)}}}return null}get currentLevel(){const e=this.currentFrag;return e?e.level:-1}get nextBufferedFrag(){const e=this.currentFrag;return e?this.followingBufferedFrag(e):null}get forceStartLoad(){return this._forceStartLoad}}class cl extends v{constructor(e,t){super("key-loader",t),this.config=void 0,this.keyIdToKeyInfo={},this.emeController=null,this.config=e}abort(e){for(const n in this.keyIdToKeyInfo){const r=this.keyIdToKeyInfo[n].loader;if(r){var t;if(e&&e!==(null==(t=r.context)?void 0:t.frag.type))return;r.abort()}}}detach(){for(const e in this.keyIdToKeyInfo){const t=this.keyIdToKeyInfo[e];(t.mediaKeySessionContext||t.decryptdata.isCommonEncryption)&&delete this.keyIdToKeyInfo[e]}}destroy(){this.detach();for(const e in this.keyIdToKeyInfo){const t=this.keyIdToKeyInfo[e].loader;t&&t.destroy()}this.keyIdToKeyInfo={}}createKeyLoadError(e,t=o.KEY_LOAD_ERROR,n,r,s){return new Qt({type:a.NETWORK_ERROR,details:t,fatal:!1,frag:e,response:s,error:n,networkDetails:r})}loadClear(e,t,n){if(this.emeController&&this.config.emeEnabled&&!this.emeController.getSelectedKeySystemFormats().length){if(t.length)for(let r=0,s=t.length;r<s;r++){const i=t[r];if(e.cc<=i.cc&&(!Y(e)||!Y(i)||e.sn<i.sn)||!n&&r==s-1)return this.emeController.selectKeySystemFormat(i).then((e=>{if(!this.emeController)return;i.setKeyFormat(e);const t=Ln(e);return t?this.emeController.getKeySystemAccess([t]):void 0}))}if(this.config.requireKeySystemAccessOnStart){const e=Nn(this.config);if(e.length)return this.emeController.getKeySystemAccess(e)}}return null}load(e){return!e.decryptdata&&e.encrypted&&this.emeController&&this.config.emeEnabled?this.emeController.selectKeySystemFormat(e).then((t=>this.loadInternal(e,t))):this.loadInternal(e)}loadInternal(e,t){var n,r;t&&e.setKeyFormat(t);const s=e.decryptdata;if(!s){const n=new Error(t?`Expected frag.decryptdata to be defined after setting format ${t}`:`Missing decryption data on fragment in onKeyLoading (emeEnabled with controller: ${this.emeController&&this.config.emeEnabled})`);return Promise.reject(this.createKeyLoadError(e,o.KEY_LOAD_ERROR,n))}const i=s.uri;if(!i)return Promise.reject(this.createKeyLoadError(e,o.KEY_LOAD_ERROR,new Error(`Invalid key URI: "${i}"`)));const a=ul(s);let l=this.keyIdToKeyInfo[a];if(null!=(n=l)&&n.decryptdata.key)return s.key=l.decryptdata.key,Promise.resolve({frag:e,keyInfo:l});if(this.emeController&&null!=(r=l)&&r.keyLoadPromise){switch(this.emeController.getKeyStatus(l.decryptdata)){case"usable":case"usable-in-future":return l.keyLoadPromise.then((t=>{const{keyInfo:n}=t;return s.key=n.decryptdata.key,{frag:e,keyInfo:n}}))}}switch(this.log(`${this.keyIdToKeyInfo[a]?"Rel":"L"}oading${s.keyId?" keyId: "+w(s.keyId):""} URI: ${s.uri} from ${e.type} ${e.level}`),l=this.keyIdToKeyInfo[a]={decryptdata:s,keyLoadPromise:null,loader:null,mediaKeySessionContext:null},s.method){case"SAMPLE-AES":case"SAMPLE-AES-CENC":case"SAMPLE-AES-CTR":return"identity"===s.keyFormat?this.loadKeyHTTP(l,e):this.loadKeyEME(l,e);case"AES-128":case"AES-256":case"AES-256-CTR":return this.loadKeyHTTP(l,e);default:return Promise.reject(this.createKeyLoadError(e,o.KEY_LOAD_ERROR,new Error(`Key supplied with unsupported METHOD: "${s.method}"`)))}}loadKeyEME(e,t){const n={frag:t,keyInfo:e};if(this.emeController&&this.config.emeEnabled){var r;if(!e.decryptdata.keyId&&null!=(r=t.initSegment)&&r.data){const n=function(e){const t=[];return pe(e,(e=>t.push(e.subarray(8,24)))),t}
vendor: 23,004 bytes, line 1
1(t.initSegment.data);if(n.length){let t=n[0];t.some((e=>0!==e))?(this.log(`Using keyId found in init segment ${w(t)}`),xn.setKeyIdForUri(e.decryptdata.uri,t)):(t=xn.addKeyIdForUri(e.decryptdata.uri),this.log(`Generating keyId to patch media ${w(t)}`)),e.decryptdata.keyId=t}}if(!e.decryptdata.keyId&&!Y(t))return Promise.resolve(n);const s=this.emeController.loadKey(n);return(e.keyLoadPromise=s.then((t=>(e.mediaKeySessionContext=t,n)))).catch((n=>{throw e.keyLoadPromise=null,"data"in n&&(n.data.frag=t),n}))}return Promise.resolve(n)}loadKeyHTTP(e,t){const n=this.config,r=new(0,n.loader)(n);return t.keyLoader=e.loader=r,e.keyLoadPromise=new Promise(((s,i)=>{const a={keyInfo:e,frag:t,responseType:"arraybuffer",url:e.decryptdata.uri},l=n.keyLoadPolicy.default,c={loadPolicy:l,timeout:l.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},u={onSuccess:(e,t,n,r)=>{const{frag:a,keyInfo:l}=n,c=ul(l.decryptdata);if(!a.decryptdata||l!==this.keyIdToKeyInfo[c])return i(this.createKeyLoadError(a,o.KEY_LOAD_ERROR,new Error("after key load, decryptdata unset or changed"),r));l.decryptdata.key=a.decryptdata.key=new Uint8Array(e.data),a.keyLoader=null,l.loader=null,s({frag:a,keyInfo:l})},onError:(e,n,r,s)=>{this.resetLoader(n),i(this.createKeyLoadError(t,o.KEY_LOAD_ERROR,new Error(`HTTP Error ${e.code} loading key ${e.text}`),r,S({url:a.url,data:void 0},e)))},onTimeout:(e,n,r)=>{this.resetLoader(n),i(this.createKeyLoadError(t,o.KEY_LOAD_TIMEOUT,new Error("key loading timed out"),r))},onAbort:(e,n,r)=>{this.resetLoader(n),i(this.createKeyLoadError(t,o.INTERNAL_ABORTED,new Error("key loading aborted"),r))}};r.load(a,c,u)}))}resetLoader(e){const{frag:t,keyInfo:n,url:r}=e,s=n.loader;t.keyLoader===s&&(t.keyLoader=null,n.loader=null);const i=ul(n.decryptdata)||r;delete this.keyIdToKeyInfo[i],s&&s.destroy()}}function ul(e){if(e.keyFormat!==Rn){const t=e.keyId;if(t)return w(t)}return e.uri}function dl(e){const{type:t}=e;switch(t){case d:return p;case h:return g;default:return f}}function hl(e,t){let n=e.url;return void 0!==n&&0!==n.indexOf("data:")||(n=t.url),n}class fl{constructor(e){this.hls=void 0,this.loaders=Object.create(null),this.variableList=null,this.onManifestLoaded=this.checkAutostartLoad,this.hls=e,this.registerListeners()}startLoad(e){}stopLoad(){this.destroyInternalLoaders()}registerListeners(){const{hls:e}=this;e.on(l.MANIFEST_LOADING,this.onManifestLoading,this),e.on(l.LEVEL_LOADING,this.onLevelLoading,this),e.on(l.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.on(l.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this),e.on(l.LEVELS_UPDATED,this.onLevelsUpdated,this)}unregisterListeners(){const{hls:e}=this;e.off(l.MANIFEST_LOADING,this.onManifestLoading,this),e.off(l.LEVEL_LOADING,this.onLevelLoading,this),e.off(l.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.off(l.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this),e.off(l.LEVELS_UPDATED,this.onLevelsUpdated,this)}createInternalLoader(e){const t=this.hls.config,n=t.pLoader,r=t.loader,s=new(n||r)(t);return this.loaders[e.type]=s,s}getInternalLoader(e){return this.loaders[e.type]}resetInternalLoader(e){this.loaders[e]&&delete this.loaders[e]}destroyInternalLoaders(){for(const e in this.loaders){const t=this.loaders[e];t&&t.destroy(),this.resetInternalLoader(e)}}destroy(){this.variableList=null,this.unregisterListeners(),this.destroyInternalLoaders()}onManifestLoading(e,t){const{url:n}=t;this.variableList=null,this.load({id:null,level:0,responseType:"text",type:c,url:n,deliveryDirectives:null,levelOrTrack:null})}onLevelLoading(e,t){const{id:n,level:r,pathwayId:s,url:i,deliveryDirectives:a,levelInfo:o}=t;this.load({id:n,level:r,pathwayId:s,responseType:"text",type:u,url:i,deliveryDirectives:a,levelOrTrack:o})}onAudioTrackLoading(e,t){const{id:n,groupId:r,url:s,deliveryDirectives:i,track:a}=t;this.load({id:n,groupId:r,level:null,responseType:"text",type:d,url:s,deliveryDirectives:i,levelOrTrack:a})}onSubtitleTrackLoading(e,t){const{id:n,groupId:r,url:s,deliveryDirectives:i,track:a}=t;this.load({id:n,groupId:r,level:null,responseType:"text",type:h,url:s,deliveryDirectives:i,levelOrTrack:a})}onLevelsUpdated(e,t){const n=this.loaders[u];if(n){const e=n.context;e&&!t.levels.some((t=>t===e.levelOrTrack))&&(n.abort(),delete this.loaders[u])}}load(e){var t;const n=this.hls.config;let s,i=this.getInternalLoader(e);if(i){const t=this.hls.logger,n=i.context;if(n&&n.levelOrTrack===e.levelOrTrack&&(n.url===e.url||n.deliveryDirectives&&!e.deliveryDirectives))return void(n.url===e.url?t.log(`[playlist-loader]: ignore ${e.url} ongoing request`):t.log(`[playlist-loader]: ignore ${e.url} in favor of ${n.url}`));t.log(`[playlist-loader]: aborting previous loader for type: ${e.type}`),i.abort()}if(s=e.type===c?n.manifestLoadPolicy.default:E({},n.playlistLoadPolicy.default,{timeoutRetry:null,errorRetry:null}),i=this.createInternalLoader(e),r(null==(t=e.deliveryDirectives)?void 0:t.part)){let t;if(e.type===u&&null!==e.level?t=this.hls.levels[e.level].details:e.type===d&&null!==e.id?t=this.hls.audioTracks[e.id].details:e.type===h&&null!==e.id&&(t=this.hls.subtitleTracks[e.id].details),t){const e=t.partTarget,n=t.targetduration;if(e&&n){const t=1e3*Math.max(3*e,.8*n);s=E({},s,{maxTimeToFirstByteMs:Math.min(t,s.maxTimeToFirstByteMs),maxLoadTimeMs:Math.min(t,s.maxTimeToFirstByteMs)})}}}const a=s.errorRetry||s.timeoutRetry||{},o={loadPolicy:s,timeout:s.maxLoadTimeMs,maxRetry:a.maxNumRetry||0,retryDelay:a.retryDelayMs||0,maxRetryDelay:a.maxRetryDelayMs||0},l={onSuccess:(e,t,n,r)=>{const s=this.getInternalLoader(n);this.resetInternalLoader(n.type);const i=e.data;t.parsing.start=performance.now(),jn.isMediaPlaylist(i)||n.type!==c?this.handleTrackOrLevelPlaylist(e,t,n,r||null,s):this.handleMasterPlaylist(e,t,n,r)},onError:(e,t,n,r)=>{this.handleNetworkError(t,n,!1,e,r)},onTimeout:(e,t,n)=>{this.handleNetworkError(t,n,!0,void 0,e)}};i.load(e,o,l)}checkAutostartLoad(){if(!this.hls)return;const{config:{autoStartLoad:e,startPosition:t},forceStartLoad:n}=this.hls;(e||n)&&(this.hls.logger.log(`${e?"auto":"force"} startLoad with configured startPosition ${t}`),this.hls.startLoad(t))}handleMasterPlaylist(e,t,n,r){const s=this.hls,i=e.data,a=hl(e,n),o=jn.parseMasterPlaylist(i,a);if(o.playlistParsingError)return t.parsing.end=performance.now(),void this.handleManifestParsingError(e,n,o.playlistParsingError,r,t);const{contentSteering:c,levels:u,sessionData:d,sessionKeys:h,startTimeOffset:f,variableList:p}=o;this.variableList=p,u.forEach((e=>{const{unknownCodecs:t}=e;if(t){const{preferManagedMediaSource:n}=this.hls.config;let{audioCodec:r,videoCodec:s}=e;for(let i=t.length;i--;){const a=t[i];Ce(a,"audio",n)?(e.audioCodec=r=r?`${r},${a}`:a,Ae.audio[r.substring(0,4)]=2,t.splice(i,1)):Ce(a,"video",n)&&(e.videoCodec=s=s?`${s},${a}`:a,Ae.video[s.substring(0,4)]=2,t.splice(i,1))}}}));const{AUDIO:g=[],SUBTITLES:m,"CLOSED-CAPTIONS":_}=jn.parseMasterPlaylistMedia(i,a,o);if(g.length){g.some((e=>!e.url))||!u[0].audioCodec||u[0].attrs.AUDIO||(this.hls.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),g.unshift({type:"main",name:"main",groupId:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new dn({}),bitrate:0,url:""}))}s.trigger(l.MANIFEST_LOADED,{levels:u,audioTracks:g,subtitles:m,captions:_,contentSteering:c,url:a,stats:t,networkDetails:r,sessionData:d,sessionKeys:h,startTimeOffset:f,variableList:p})}handleTrackOrLevelPlaylist(e,t,n,s,i){const a=this.hls,{id:o,level:u,type:d}=n,h=hl(e,n),f=r(u)?u:r(o)?o:0,p=dl(n),g=jn.parseLevelPlaylist(e.data,h,f,p,0,this.variableList);if(d===c){const e={attrs:new dn({}),bitrate:0,details:g,name:"",url:h};g.requestScheduled=t.loading.start+or(g,0),a.trigger(l.MANIFEST_LOADED,{levels:[e],audioTracks:[],url:h,stats:t,networkDetails:s,sessionData:null,sessionKeys:null,contentSteering:null,startTimeOffset:null,variableList:null})}t.parsing.end=performance.now(),n.levelDetails=g,this.handlePlaylistLoaded(g,e,t,n,s,i)}handleManifestParsingError(e,t,n,r,s){this.hls.trigger(l.ERROR,{type:a.NETWORK_ERROR,details:o.MANIFEST_PARSING_ERROR,fatal:t.type===c,url:e.url,err:n,error:n,reason:n.message,response:e,context:t,networkDetails:r,stats:s})}handleNetworkError(e,t,n=!1,r,s){let i=`A network ${n?"timeout":"error"+(r?" (status "+r.code+")":"")} occurred while loading ${e.type}`;e.type===u?i+=`: ${e.level} id: ${e.id}`:e.type!==d&&e.type!==h||(i+=` id: ${e.id} group-id: "${e.groupId}"`);const f=new Error(i);this.hls.logger.warn(`[playlist-loader]: ${i}`);let p=o.UNKNOWN,g=!1;const m=this.getInternalLoader(e);switch(e.type){case c:p=n?o.MANIFEST_LOAD_TIMEOUT:o.MANIFEST_LOAD_ERROR,g=!0;break;case u:p=n?o.LEVEL_LOAD_TIMEOUT:o.LEVEL_LOAD_ERROR,g=!1;break;case d:p=n?o.AUDIO_TRACK_LOAD_TIMEOUT:o.AUDIO_TRACK_LOAD_ERROR,g=!1;break;case h:p=n?o.SUBTITLE_TRACK_LOAD_TIMEOUT:o.SUBTITLE_LOAD_ERROR,g=!1}m&&this.resetInternalLoader(e.type);const _={type:a.NETWORK_ERROR,details:p,fatal:g,url:e.url,loader:m,context:e,error:f,networkDetails:t,stats:s};if(r){const n=(null==t?void 0:t.url)||e.url;_.response=S({url:n,data:void 0},r)}this.hls.trigger(l.ERROR,_)}handlePlaylistLoaded(e,t,n,r,s,i){const p=this.hls,{type:g,level:m,levelOrTrack:_,id:T,groupId:E,deliveryDirectives:y}=r,S=hl(t,r),v=dl(r);let b="number"==typeof r.level&&v===f?m:void 0;const I=e.playlistParsingError;if(I){if(this.hls.logger.warn(`${I} ${e.url}`),!p.config.ignorePlaylistParsingErrors)return void p.trigger(l.ERROR,{type:a.NETWORK_ERROR,details:o.LEVEL_PARSING_ERROR,fatal:!1,url:S,error:I,reason:I.message,response:t,context:r,level:b,parent:v,networkDetails:s,stats:n});e.playlistParsingError=null}if(e.fragments.length)switch(e.live&&i&&(i.getCacheAge&&(e.ageHeader=i.getCacheAge()||0),i.getCacheAge&&!isNaN(e.ageHeader)||(e.ageHeader=0)),g){case c:case u:if(b)if(_){if(_!==p.levels[b]){const e=p.levels.indexOf(_);e>-1&&(b=e)}}else b=0;p.trigger(l.LEVEL_LOADED,{details:e,levelInfo:_||p.levels[0],level:b||0,id:T||0,stats:n,networkDetails:s,deliveryDirectives:y,withoutMultiVariant:g===c});break;case d:p.trigger(l.AUDIO_TRACK_LOADED,{details:e,track:_,id:T||0,groupId:E||"",stats:n,networkDetails:s,deliveryDirectives:y});break;case h:p.trigger(l.SUBTITLE_TRACK_LOADED,{details:e,track:_,id:T||0,groupId:E||"",stats:n,networkDetails:s,deliveryDirectives:y})}else{const i=e.playlistParsingError=new Error("No Segments found in Playlist");p.trigger(l.ERROR,{type:a.NETWORK_ERROR,details:o.LEVEL_EMPTY_ERROR,fatal:!1,url:S,error:i,reason:i.message,response:t,context:r,level:b,parent:v,networkDetails:s,stats:n})}}}class pl{static get version(){return Gr}static isMSESupported(){return ol()}static isSupported(){return function(){if(!ol())return!1;const e=L();return"function"==typeof(null==e?void 0:e.isTypeSupported)&&(["avc1.42E01E,mp4a.40.2","av01.0.01M.08","vp09.00.50.08"].some((t=>e.isTypeSupported(Le(t,"video"))))||["mp4a.40.2","fLaC"].some((t=>e.isTypeSupported(Le(t,"audio")))))}()}static getMediaSource(){return L()}static get Events(){return l}static get MetadataSchema(){return us}static get ErrorTypes(){return a}static get ErrorDetails(){return o}static get DefaultConfig(){return pl.defaultConfig?pl.defaultConfig:Vo}static set DefaultConfig(e){pl.defaultConfig=e}constructor(e={}){this.config=void 0,this.userConfig=void 0,this.logger=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new $r,this._autoLevelCapping=-1,this._maxHdcpLevel=null,this.abrController=void 0,this.bufferController=void 0,this.capLevelController=void 0,this.latencyController=void 0,this.levelController=void 0,this.streamController=void 0,this.audioStreamController=void 0,this.subtititleStreamController=void 0,this.audioTrackController=void 0,this.subtitleTrackController=void 0,this.interstitialsController=void 0,this.gapController=void 0,this.emeController=void 0,this.cmcdController=void 0,this._media=null,this._url=null,this._sessionId=void 0,this.triggeringException=void 0,this.started=!1;const t=this.logger=function(e,t,n){const r=A();if("object"==typeof console&&!0===e||"object"==typeof e){const s=["debug","log","info","warn","error"];s.forEach((t=>{r[t]=R(t,e,n)}));try{r.log(`Debug logs enabled for "${t}" in hls.js version 1.6.15`)}catch(e){return A()}s.forEach((t=>{C[t]=R(t,e)}))}else E(C,r);return r}(e.debug||!1,"Hls instance",e.assetPlayerId),n=this.config=function(e,t,n){if((t.liveSyncDurationCount||t.liveMaxLatencyDurationCount)&&(t.liveSyncDuration||t.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(void 0!==t.liveMaxLatencyDurationCount&&(void 0===t.liveSyncDurationCount||t.liveMaxLatencyDurationCount<=t.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(void 0!==t.liveMaxLatencyDuration&&(void 0===t.liveSyncDuration||t.liveMaxLatencyDuration<=t.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');const r=qo(e),s=["TimeOut","MaxRetry","RetryDelay","MaxRetryTimeout"];return["manifest","level","frag"].forEach((e=>{const i=`${"level"===e?"playlist":e}LoadPolicy`,a=void 0===t[i],o=[];s.forEach((n=>{const s=`${e}Loading${n}`,l=t[s];if(void 0!==l&&a){o.push(s);const e=r[i].default;switch(t[i]={default:e},n){case"TimeOut":e.maxLoadTimeMs=l,e.maxTimeToFirstByteMs=l;break;case"MaxRetry":e.errorRetry.maxNumRetry=l,e.timeoutRetry.maxNumRetry=l;break;case"RetryDelay":e.errorRetry.retryDelayMs=l,e.timeoutRetry.retryDelayMs=l;break;case"MaxRetryTimeout":e.errorRetry.maxRetryDelayMs=l,e.timeoutRetry.maxRetryDelayMs=l}}})),o.length&&n.warn(`hls.js config: "${o.join('", "')}" setting(s) are deprecated, use "${i}": ${rt(t[i])}`)})),S(S({},r),t)}(pl.DefaultConfig,e,t);this.userConfig=e,n.progressive&&Yo(n,t);const{abrController:r,bufferController:s,capLevelController:i,errorController:a,fpsController:o}=n,c=new a(this),u=this.abrController=new r(this),d=new Bt(this),h=n.interstitialsController,f=h?this.interstitialsController=new h(this,pl):null,p=this.bufferController=new s(this,d),g=this.capLevelController=new i(this),m=new o(this),_=new fl(this),T=n.contentSteeringController,y=T?new T(this):null,v=this.levelController=new sl(this,y),b=new nl(this),I=new cl(this.config,this.logger),k=this.streamController=new ll(this,d,I),L=this.gapController=new zo(this,d);g.setStreamController(k),m.setStreamController(k);const O=[_,v,k];f&&O.splice(1,0,f),y&&O.splice(1,0,y),this.networkControllers=O;const N=[u,p,L,g,m,b,d];this.audioTrackController=this.createController(n.audioTrackController,O);const w=n.audioStreamController;w&&O.push(this.audioStreamController=new w(this,d,I)),this.subtitleTrackController=this.createController(n.subtitleTrackController,O);const P=n.subtitleStreamController;P&&O.push(this.subtititleStreamController=new P(this,d,I)),this.createController(n.timelineController,N),I.emeController=this.emeController=this.createController(n.emeController,N),this.cmcdController=this.createController(n.cmcdController,N),this.latencyController=this.createController(rl,N),this.coreComponents=N,O.push(c);const M=c.onErrorOut;"function"==typeof M&&this.on(l.ERROR,M,c),this.on(l.MANIFEST_LOADED,_.onManifestLoaded,_)}createController(e,t){if(e){const n=new e(this);return t&&t.push(n),n}return null}on(e,t,n=this){this._emitter.on(e,t,n)}once(e,t,n=this){this._emitter.once(e,t,n)}removeAllListeners(e){this._emitter.removeAllListeners(e)}off(e,t,n=this,r){this._emitter.off(e,t,n,r)}listeners(e){return this._emitter.listeners(e)}emit(e,t,n){return this._emitter.emit(e,t,n)}trigger(e,t){if(this.config.debug)return this.emit(e,e,t);try{return this.emit(e,e,t)}catch(t){if(this.logger.error("An internal error happened while handling event "+e+'. Error message: "'+t.message+'". Here is a stacktrace:',t),!this.triggeringException){this.triggeringException=!0;const n=e===l.ERROR;this.trigger(l.ERROR,{type:a.OTHER_ERROR,details:o.INTERNAL_EXCEPTION,fatal:n,event:e,error:t}),this.triggeringException=!1}}return!1}listenerCount(e){return this._emitter.listenerCount(e)}destroy(){this.logger.log("destroy"),this.trigger(l.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this._url=null,this.networkControllers.forEach((e=>e.destroy())),this.networkControllers.length=0,this.coreComponents.forEach((e=>e.destroy())),this.coreComponents.length=0;const e=this.config;e.xhrSetup=e.fetchSetup=void 0,this.userConfig=null}attachMedia(e){if(!e||"media"in e&&!e.media){const t=new Error(`attachMedia failed: invalid argument (${e})`);return void this.trigger(l.ERROR,{type:a.OTHER_ERROR,details:o.ATTACH_MEDIA_ERROR,fatal:!0,error:t})}this.logger.log("attachMedia"),this._media&&(this.logger.warn("media must be detached before attaching"),this.detachMedia());const t="media"in e,n=t?e.media:e,r=t?e:{media:n};this._media=n,this.trigger(l.MEDIA_ATTACHING,r)}detachMedia(){this.logger.log("detachMedia"),this.trigger(l.MEDIA_DETACHING,{}),this._media=null}transferMedia(){this._media=null;const e=this.bufferController.transferMedia();return this.trigger(l.MEDIA_DETACHING,{transferMedia:e}),e}loadSource(e){this.stopLoad();const t=this.media,n=this._url,r=this._url=H.buildAbsoluteURL(self.location.href,e,{alwaysNormalize:!0});this._autoLevelCapping=-1,this._maxHdcpLevel=null,this.logger.log(`loadSource:${r}`),t&&n&&(n!==r||this.bufferController.hasSourceTypes())&&(this.detachMedia(),this.attachMedia(t)),this.trigger(l.MANIFEST_LOADING,{url:e})}get url(){return this._url}get hasEnoughToStart(){return this.streamController.hasEnoughToStart}get startPosition(){return this.streamController.startPositionValue}startLoad(e=-1,t){this.logger.log(`startLoad(${e+(t?", <skip seek to start>":"")})`),this.started=!0,this.resumeBuffering();for(let n=0;n<this.networkControllers.length&&(this.networkControllers[n].startLoad(e,t),this.started&&this.networkControllers);n++);}stopLoad(){this.logger.log("stopLoad"),this.started=!1;for(let e=0;e<this.networkControllers.length&&(this.networkControllers[e].stopLoad(),!this.started&&this.networkControllers);e++);}get loadingEnabled(){return this.started}get bufferingEnabled(){return this.streamController.bufferingEnabled}resumeBuffering(){this.bufferingEnabled||(this.logger.log("resume buffering"),this.networkControllers.forEach((e=>{e.resumeBuffering&&e.resumeBuffering()})))}pauseBuffering(){this.bufferingEnabled&&(this.logger.log("pause buffering"),this.networkControllers.forEach((e=>{e.pauseBuffering&&e.pauseBuffering()})))}get inFlightFragments(){const e={[f]:this.streamController.inFlightFrag};return this.audioStreamController&&(e[p]=this.audioStreamController.inFlightFrag),this.subtititleStreamController&&(e[g]=this.subtititleStreamController.inFlightFrag),e}swapAudioCodec(){this.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()}recoverMediaError(){this.logger.log("recoverMediaError");const e=this._media,t=null==e?void 0:e.currentTime;this.detachMedia(),e&&(this.attachMedia(e),t&&this.startLoad(t))}removeLevel(e){this.levelController.removeLevel(e)}get sessionId(){let e=this._sessionId;return e||(e=this._sessionId=function(){try{return crypto.randomUUID()}catch(e){try{const e=URL.createObjectURL(new Blob),t=e.toString();return URL.revokeObjectURL(e),t.slice(t.lastIndexOf("/")+1)}catch(e){let t=(new Date).getTime();const n="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(e=>{const n=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"==e?n:3&n|8).toString(16)}));return n}}}()),e}get levels(){const e=this.levelController.levels;return e||[]}get latestLevelDetails(){return this.streamController.getLevelDetails()||null}get loadLevelObj(){return this.levelController.loadLevelObj}get currentLevel(){return this.streamController.currentLevel}set currentLevel(e){this.logger.log(`set currentLevel:${e}`),this.levelController.manualLevel=e,this.streamController.immediateLevelSwitch()}get nextLevel(){return this.streamController.nextLevel}set nextLevel(e){this.logger.log(`set nextLevel:${e}`),this.levelController.manualLevel=e,this.streamController.nextLevelSwitch()}get loadLevel(){return this.levelController.level}set loadLevel(e){this.logger.log(`set loadLevel:${e}`),this.levelController.manualLevel=e}get nextLoadLevel(){return this.levelController.nextLoadLevel}set nextLoadLevel(e){this.levelController.nextLoadLevel=e}get firstLevel(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)}set firstLevel(e){this.logger.log(`set firstLevel:${e}`),this.levelController.firstLevel=e}get startLevel(){const e=this.levelController.startLevel;return-1===e&&this.abrController.forcedAutoLevel>-1?this.abrController.forcedAutoLevel:e}set startLevel(e){this.logger.log(`set startLevel:${e}`),-1!==e&&(e=Math.max(e,this.minAutoLevel)),this.levelController.startLevel=e}get capLevelToPlayerSize(){return this.config.capLevelToPlayerSize}set capLevelToPlayerSize(e){const t=!!e;t!==this.config.capLevelToPlayerSize&&(t?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=t)}get autoLevelCapping(){return this._autoLevelCapping}get bandwidthEstimate(){const{bwEstimator:e}=this.abrController;return e?e.getEstimate():NaN}set bandwidthEstimate(e){this.abrController.resetEstimator(e)}get abrEwmaDefaultEstimate(){const{bwEstimator:e}=this.abrController;return e?e.defaultEstimate:NaN}get ttfbEstimate(){const{bwEstimator:e}=this.abrController;return e?e.getEstimateTTFB():NaN}set autoLevelCapping(e){this._autoLevelCapping!==e&&(this.logger.log(`set autoLevelCapping:${e}`),this._autoLevelCapping=e,this.levelController.checkMaxAutoUpdated())}get maxHdcpLevel(){return this._maxHdcpLevel}set maxHdcpLevel(e){(function(e){return qe.indexOf(e)>-1})(e)&&this._maxHdcpLevel!==e&&(this._maxHdcpLevel=e,this.levelController.checkMaxAutoUpdated())}get autoLevelEnabled(){return-1===this.levelController.manualLevel}get manualLevel(){return this.levelController.manualLevel}get minAutoLevel(){const{levels:e,config:{minAutoBitrate:t}}=this;if(!e)return 0;const n=e.length;for(let r=0;r<n;r++)if(e[r].maxBitrate>=t)return r;return 0}get maxAutoLevel(){const{levels:e,autoLevelCapping:t,maxHdcpLevel:n}=this;let r;if(r=-1===t&&null!=e&&e.length?e.length-1:t,n)for(let t=r;t--;){const r=e[t].attrs["HDCP-LEVEL"];if(r&&r<=n)return t}return r}get firstAutoLevel(){return this.abrController.firstAutoLevel}get nextAutoLevel(){return this.abrController.nextAutoLevel}set nextAutoLevel(e){this.abrController.nextAutoLevel=e}get playingDate(){return this.streamController.currentProgramDateTime}get mainForwardBufferInfo(){return this.streamController.getMainFwdBufferInfo()}get maxBufferLength(){return this.streamController.maxBufferLength}setAudioOption(e){var t;return(null==(t=this.audioTrackController)?void 0:t.setAudioOption(e))||null}
1setSubtitleOption(e){var t;return(null==(t=this.subtitleTrackController)?void 0:t.setSubtitleOption(e))||null}get allAudioTracks(){const e=this.audioTrackController;return e?e.allAudioTracks:[]}get audioTracks(){const e=this.audioTrackController;return e?e.audioTracks:[]}get audioTrack(){const e=this.audioTrackController;return e?e.audioTrack:-1}set audioTrack(e){const t=this.audioTrackController;t&&(t.audioTrack=e)}get allSubtitleTracks(){const e=this.subtitleTrackController;return e?e.allSubtitleTracks:[]}get subtitleTracks(){const e=this.subtitleTrackController;return e?e.subtitleTracks:[]}get subtitleTrack(){const e=this.subtitleTrackController;return e?e.subtitleTrack:-1}get media(){return this._media}set subtitleTrack(e){const t=this.subtitleTrackController;t&&(t.subtitleTrack=e)}get subtitleDisplay(){const e=this.subtitleTrackController;return!!e&&e.subtitleDisplay}set subtitleDisplay(e){const t=this.subtitleTrackController;t&&(t.subtitleDisplay=e)}get lowLatencyMode(){return this.config.lowLatencyMode}set lowLatencyMode(e){this.config.lowLatencyMode=e}get liveSyncPosition(){return this.latencyController.liveSyncPosition}get latency(){return this.latencyController.latency}get maxLatency(){return this.latencyController.maxLatency}get targetLatency(){return this.latencyController.targetLatency}set targetLatency(e){this.latencyController.targetLatency=e}get drift(){return this.latencyController.drift}get forceStartLoad(){return this.streamController.forceStartLoad}get pathways(){return this.levelController.pathways}get pathwayPriority(){return this.levelController.pathwayPriority}set pathwayPriority(e){this.levelController.pathwayPriority=e}get bufferedToEnd(){var e;return!(null==(e=this.bufferController)||!e.bufferedToEnd)}get interstitialsManager(){var e;return(null==(e=this.interstitialsController)?void 0:e.interstitialsManager)||null}getMediaDecodingInfo(e,t=this.allAudioTracks){return We(e,it(t),navigator.mediaCapabilities)}}pl.defaultConfig=void 0;var gl,ml,_l,Tl,El={d:(e,t)=>{for(var n in t)El.o(t,n)&&!El.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)},yl={};El.d(yl,{GP:()=>_l,fZ:()=>vl,vn:()=>Tl}),(gl=_l||(_l={})).LOADED="loaded",gl.SEEKING="seeking",gl.SEEKED="seeked",gl.BUFFERING="buffering",gl.BUFFERED="buffered",gl.PLAY="play",gl.PLAYING="playing",gl.PAUSE="pause",gl.ENDED="ended",gl.TIME_UPDATE="timeupdate",(ml=Tl||(Tl={})).loadstart="loadstart",ml.progress="progress",ml.suspend="suspend",ml.abort="abort",ml.error="error",ml.emptied="emptied",ml.stalled="stalled",ml.loadedmetadata="loadedmetadata",ml.loadeddata="loadeddata",ml.canplay="canplay",ml.canplaythrough="canplaythrough",ml.playing="playing",ml.waiting="waiting",ml.seeking="seeking",ml.seeked="seeked",ml.ended="ended",ml.durationchange="durationchange",ml.timeupdate="timeupdate",ml.play="play",ml.pause="pause",ml.ratechange="ratechange",ml.resize="resize",ml.volumechange="volumechange";let Sl={paused:!1,ended:!1,loading:!0,buffering:!1,seeking:!1,initialPlayFired:!1,deferCanPlay:!1,deferCanPlayThroughHandling:!1,deferPlayingEvent:!1,deferSeekedEvent:!1,playRequested:!1},vl=({mediaElement:e,callback:t,mp4Mode:n=!1})=>{let r=null,s=()=>{"number"==typeof r&&clearTimeout(r)},i={...Sl},a=()=>{s(),i={...Sl}},o=()=>i.loading||i.ended,l=()=>{o()?n&&c():0!==e.playbackRate?(i={...i,deferCanPlay:!1},s(),i.buffering?(i={...i,buffering:!1},t("buffered"),i.deferPlayingEvent&&f()):i.seeking&&(i={...i,seeking:!1,deferSeekedEvent:!1},t("seeked"),i.deferPlayingEvent&&f())):i={...i,deferCanPlay:!0}},c=()=>{n||!i.loading||0!==e.playbackRate?i.loading&&(i={...i,loading:!1,deferCanPlayThroughHandling:!1},t("loaded")):i={...i,deferCanPlayThroughHandling:!0}},u=()=>{o()||(i.buffering&&t("buffered"),i={...i,seeking:!0,buffering:!1},t("seeking"))},d=()=>{if(!o()&&i.seeking){if(0===e.playbackRate)return void(i={...i,deferSeekedEvent:!0});e.readyState>=HTMLMediaElement.HAVE_FUTURE_DATA&&(i={...i,seeking:!1,deferSeekedEvent:!1},t("seeked"),i.deferPlayingEvent&&f())}},h=()=>{if(s(),!e.ended&&!o()&&!i.seeking){if(e.seeking)return void u();i.buffering||(i={...i,buffering:!0},t("buffering"))}},f=()=>{0===e.playbackRate||i.paused&&i.playRequested&&(i.seeking||i.buffering)?
1i={...i,deferPlayingEvent:!0}:((i={...i,deferPlayingEvent:!1}).loading&&c(),i.initialPlayFired||(i={...i,initialPlayFired:!0,paused:!1,playRequested:!1},t("playing")),i.paused&&i.playRequested&&(i={...i,paused:!1,playRequested:!1},t("playing")))},p=()=>!i.seeking&&!i.buffering&&0===e.playbackRate&&!e.seeking,g=[["canplay",l],["canplaythrough",c],["playing",f],["waiting",h],["seeking",u],["seeked",d],["ended",()=>{o()||(i={...i,ended:!0,buffering:!1,seeking:!1,loading:!1,paused:!0},s(),t("ended"))}],["timeupdate",()=>{o()||(i.buffering&&!e.paused&&e.readyState>=HTMLMediaElement.HAVE_FUTURE_DATA&&0!==e.playbackRate&&(i={...i,buffering:!1},t("buffered")),t("timeupdate"))}],["play",()=>{i.ended?a():!o()&&i.paused&&i.initialPlayFired&&(i={...i,playRequested:!0},t("play"))}],["pause",()=>{e.ended||!i.playRequested&&i.paused||((i={...i,playRequested:!1}).deferCanPlayThroughHandling&&c(),i={...i,paused:!0},t("pause"))}],["ratechange",()=>{if(s(),e.ended)return;let n=e.playbackRate>0;i.deferCanPlayThroughHandling&&n&&c(),i.deferCanPlay&&n&&l(),i.deferSeekedEvent&&n&&d(),i.deferPlayingEvent&&n&&f(),!o()&&(p()?r=window.setTimeout((()=>{p()&&h()}),50):i.buffering&&n&&(i={...i,buffering:!1},t("buffered")))}],["emptied",()=>{a()}]];return g.forEach((([t,n])=>e.addEventListener(t,n))),{teardown:()=>{s(),g.forEach((([t,n])=>e.removeEventListener(t,n)))}}};var bl,Il,Al=yl.GP,Rl=yl.fZ;class Cl{constructor(e){this.originalError=e}}function kl(){return"undefined"!=typeof window?window.navigator.userAgent.toLowerCase():""}function Ll(){let e=Il.UNKNOWN;return/firefox/.test(kl())?e=Il.FIREFOX:/edge/.test(kl())&&/windows/.test(kl())?e=Il.MS_EDGE:/chrome/.test(kl())?e=Il.CHROME:/safari/.test(kl())&&/apple computer/.test("undefined"!=typeof window&&"undefined"!=typeof navigator?window.navigator.vendor.toLowerCase():"")&&!/tizen/.test(kl())&&!/sopopenbrowser/.test(kl())?e=Il.SAFARI:/trident.*rv:11\./.test(kl())&&(e=Il.MS_IE),e}!function(e){e.HLS="HLS",e.MP4="MP4",e.MP3="MP3",e.M4A="M4A"}(bl||(bl={})),function(e){e.CHROME="CHROME",e.SAFARI="SAFARI",e.MS_IE="MS_IE",e.MS_EDGE="MS_EDGE",e.FIREFOX="FIREFOX",e.UNKNOWN="UNKNOWN"}(Il||(Il={}));var Ol,Nl=n(13269);class wl extends Nl.bk{setState(e){this.state={...this.state,...e},this.emit("stateChanged",this.state)}getState(){return this.state}onError(e){this.setState({playbackState:"error"}),this.emit("error",new Cl(e))}constructor(e){super(),this.options=e,this.hasExternalTextTracks=!1,this.state={playbackState:"idle",muted:!1,volume:0,duration:0,currentTime:0,textTracks:[],playbackRate:1,qualityLevels:[]},this.options.mediaElement.addEventListener("error",this.onError.bind(this)),this.options.mediaElement.addEventListener("volumechange",(()=>{this.setState({muted:this.options.mediaElement.muted,volume:this.options.mediaElement.volume})})),this.options.mediaElement.addEventListener("ratechange",(()=>{this.setState({playbackRate:this.options.mediaElement.playbackRate})})),this.mediaEventFilter=Rl({mp4Mode:[bl.M4A,bl.MP3,bl.MP4].includes(this.options.format),mediaElement:this.options.mediaElement,callback:e=>{switch(e){case Al.BUFFERED:case Al.SEEKED:this.setState({playbackState:this.options.mediaElement.paused?"paused":"playing"});break;case Al.BUFFERING:case Al.SEEKING:this.setState({playbackState:"buffering"});break;case Al.LOADED:this.setState({playbackState:"ready",engineName:this.name,muted:this.options.mediaElement.muted,duration:this.options.mediaElement.duration,currentTime:this.options.mediaElement.currentTime,textTracks:this.getTextTracks(),playbackRate:this.options.mediaElement.playbackRate,volume:this.options.mediaElement.volume,qualityLevels:this.getQualityLevels()}),this.emit("loaded",void 0);break;case Al.PLAY:this.emit("play",void 0);break;case Al.PLAYING:this.setState({playbackState:"playing"}),this.emit("playing",void 0);break;case Al.PAUSE:this.setState({playbackState:"paused"});break;case Al.ENDED:this.setState({playbackState:"ended"}),this.emit("ended",void 0);break;case Al.TIME_UPDATE:this.setState({currentTime:this.options.mediaElement.currentTime}),this.emit("timeupdate",this.options.mediaElement.currentTime)}}})}onTextTrackChanged(){this.setState({textTracks:this.getTextTracks()})}addExternalTextTrack(e){const t=this.options.mediaElement,n=document.createElement("track");n.kind="subtitles",n.src=e.src,n.label=e.label||"";const r=document.createAttribute("crossorigin");r.value="anonymous",n.setAttributeNode(r),t.setAttribute("crossorigin","anonymous"),e.language&&(n.srclang=e.language),n.id=`ext-${Date.now()}-${Math.random().toString(36).slice(2)}`,t.appendChild(n),this.hasExternalTextTracks=!0,n.addEventListener("load",(()=>{this.onTextTrackChanged()})),setTimeout((()=>this.onTextTrackChanged()),1e3)}play(){this.options.mediaElement.play()}pause(){this.options.mediaElement.pause()}seekToPercentage(e){const t=this.options.mediaElement.duration*(e/100);this.options.mediaElement.currentTime=t,this.setState({currentTime:t})}
1seekToTime({diff:e,absolute:t}){let n=this.options.mediaElement.currentTime;e?n+=e:void 0!==t&&(n=t),this.options.mediaElement.currentTime=(0,Nl.qE)(n,0,this.options.mediaElement.duration),this.setState({currentTime:n})}togglePlay(){"playing"===this.state.playbackState?this.pause():this.play()}toggleAudio(){this.options.mediaElement.muted=!this.options.mediaElement.muted}setPlaybackRate(e){this.options.mediaElement.playbackRate=e}setVolume(e){this.options.mediaElement.volume=e,this.setState({volume:e})}stop(){this.options.mediaElement.src=""}}class Pl extends wl{constructor(e){super(e),this.hlsEngineOptions=e,this.name="HlsJS",this.hls=new pl,this.hls.on(pl.Events.LEVEL_SWITCHED,this.onLevelSwitched.bind(this))}findLevelByQualityOption(e){switch(e){case"low":return this.hls.levels.reduce(((e,t)=>{const n=Math.min(e.bitrate,t.bitrate);return e.bitrate===n?e:t}));case"medium":{const e=Math.round((this.hls.levels.length-1)/2);return this.hls.levels[e]}case"high":return this.hls.levels.reduce(((e,t)=>{const n=Math.max(e.bitrate,t.bitrate);return e.bitrate===n?e:t}))}}onLevelSwitched(){this.setState({qualityLevels:this.getQualityLevels(),selectedQualityLevel:this.getQualityLevel()})}getQualityLevels(){const e=this.hls.levels.map(((e,t)=>({id:t,width:e.width,height:e.height,bitrate:e.bitrate})));return e.unshift({id:-1,width:-1,height:-1,bitrate:-1,label:"Auto"}),e}setQualityLevel(e){const t=e?e.id:-1;this.hls.currentLevel=t,this.hls.nextLevel=t}getQualityLevel(){return this.getQualityLevels().find((e=>e.id===this.hls.currentLevel))}onHLSError(e,t){t.fatal&&this.onError(t)}load(e,t){this.hls.loadSource(e),this.hls.attachMedia(this.hlsEngineOptions.mediaElement),this.hls.on(pl.Events.ERROR,this.onHLSError.bind(this)),this.hls.on(pl.Events.MANIFEST_PARSED,(()=>{if(this.hlsEngineOptions.hlsLevel){const e=this.findLevelByQualityOption(this.hlsEngineOptions.hlsLevel);e&&(this.hls.loadLevel=this.hls.levels.indexOf(e))}const n=t?.startTime?Math.floor(t.startTime):-1;this.currentSource=e,this.setState({playbackState:"loading"}),this.hls.startLoad(n),this.hlsEngineOptions.autoPlay&&this.hlsEngineOptions.mediaElement.play()})),this.hls.on(pl.Events.SUBTITLE_TRACK_SWITCH,this.onTextTrackChanged.bind(this))}getTextTracks(){if(this.hasExternalTextTracks){return Array.from(this.hlsEngineOptions.mediaElement.textTracks).map(((e,t)=>({id:t.toString(),label:e.label||e.language||`Track ${t+1}`,language:e.language,active:"showing"===e.mode})))}return this.hls.subtitleTracks.map((e=>({id:e.id.toString(),label:e.name,language:e.lang,active:e.id.toString()===this.getSelectedTextTrack()})))}getSelectedTextTrack(){if(this.hasExternalTextTracks){const e=Array.from(this.hlsEngineOptions.mediaElement.textTracks).findIndex((e=>"showing"===e.mode));return e>=0?e.toString():void 0}return this.hls.subtitleTrack.toString()}getCurrentSource(){return this.currentSource}setActiveTextTrack(e){if(this.hasExternalTextTracks){return Array.from(this.hlsEngineOptions.mediaElement.textTracks).forEac
1h(((t,n)=>{t.mode=""!==e&&n.toString()===e?"showing":"disabled"})),void this.onTextTrackChanged()}this.hls.subtitleTrack=""===e?-1:parseInt(e,10),this.onTextTrackChanged()}}let Ml;!function(e){e.CAST_SUPPORTED="cast:supported",e.CAST_CONNECTED="cast:connected",e.CAST_DISCONNECTED="cast:disconnected",e.CAST_CONNECTING="cast:connecting",e.CAST_STATE_CHANGED="stateChanged",e.CAST_RESUMED="cast:resumed",e.CAST_ERROR="cast:error"}(Ol||(Ol={}));class Dl extends Nl.bk{setState(e){this.state={...this.state,...e},this.emit(Ol.CAST_STATE_CHANGED,this.state)}getState(){return this.state}constructor({castAppId:e=chrome.cast.media.DEFAULT_MEDIA_RECEIVER_APP_ID}){super(),this.hasStarted=!1,this.state={playbackState:"idle",muted:!1,duration:0,currentTime:0,textTracks:[],volume:1,playbackRate:1,qualityLevels:[]},function(e){return Ml||(Ml=new Promise(((t,n)=>{const r=document.createElement("script");r.src="//www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1",document.body.appendChild(r),window.__onGCastApiAvailable=function(r){r&&(cast.framework.CastContext.getInstance().setOptions({receiverApplicationId:e,autoJoinPolicy:chrome.cast.AutoJoinPolicy.PAGE_SCOPED}),t()),n("Cast is not available")}})),Ml)}(e).then((()=>{this.remotePlayer=new cast.framework.RemotePlayer,this.playerController=new cast.framework.RemotePlayerController(this.remotePlayer),this.emit(Ol.CAST_SUPPORTED,void 0),this.setupListeners()}))}getCompleteState(){if(!this.remotePlayer)return{};const{playerState:e,currentTime:t,duration:n,volumeLevel:r,isMuted:s}=this.remotePlayer;return{currentTime:t,duration:n,playbackState:this.getPlaybackStateFromPlayerState(e),volume:r,muted:s,textTracks:this.getTextTracks(),playbackRate:1}}getPlaybackStateFromPlayerState(e){switch(e){case chrome.cast.media.PlayerState.BUFFERING:return"buffering";case chrome.cast.media.PlayerState.PAUSED:return"paused";case chrome.cast.media.PlayerState.PLAYING:return this.hasStarted=!0,"playing";case chrome.cast.media.PlayerState.IDLE:default:return this.hasStarted&&"idle"!==this.state.playbackState?"ended":"idle"}}setupListeners(){cast.framework.CastContext.getInstance().addEventListener(cast.framework.CastContextEventType.SESSION_STATE_CHANGED,(e=>{switch(e.sessionState){case cast.framework.SessionState.SESSION_STARTING:this.emit(Ol.CAST_CONNECTING,void 0);break;case cast.framework.SessionState.SESSION_STARTED:case cast.framework.SessionState.SESSION_RESUMED:this.setState(this.getCompleteState()),this.onAnyChange(),this.emit(Ol.CAST_CONNECTED,void 0);break;case cast.framework.SessionState.SESSION_ENDED:this.setState({playbackState:"idle"}),this.emit(Ol.CAST_DISCONNECTED,void 0)}})),this.playerController?.addEventListener(cast.framework.RemotePlayerEventType.ANY_CHANGE,this.onAnyChange.bind(this))}onAnyChange(){this.setState(this.getCompleteState())}seekToPercentage(e){this.remotePlayer&&(this.remotePlayer.currentTime=Math.min(e,99.9)/100*this.remotePlayer.duration,this.playerController?.seek())}seekToTime({diff:e,absolute:t}){if(!this.remotePlayer)return;let n=this.remotePlayer.currentTime;e?n+=e:void 0!==t&&(n=t),this.remotePlayer.currentTime=(0,Nl.qE)(n,0,this.remotePlayer.duration),this.playerController?.seek()}load(e,t){const n=cast.framework.CastContext.getInstance().getCurrentSession();if(!n)return;const r=new chrome.cast.media.MediaInfo(e,"video/mp4");t?.textTracks.forEach(((e,t)=>{r.tracks||(r.tracks=[]);const n=this.getTrackFromExternalTextTrack(e,t);r.tracks?.push(n)}));const s=new chrome.cast.media.LoadRequest(r);return t?.startTime&&(s.currentTime=t.startTime),n.loadMedia(s).catch((e=>{"timeout"!==e&&this.emit(Ol.CAST_ERROR,e)}))}getCurrentSource(){return this.remotePlayer?.mediaInfo?.contentId}play(){this.playerController?.playOrPause()}pause(){this.playerController?.playOrPause()}togglePlay(){this.playerController?.playOrPause()}
1toggleAudio(){this.playerController?.muteOrUnmute()}setVolume(e){this.remotePlayer&&(this.remotePlayer.volumeLevel=e,this.playerController?.setVolumeLevel())}getTextTracks(){const e=cast.framework.CastContext.getInstance().getCurrentSession();if(!e)return[];const t=e.getMediaSession(),n=t?.media?.tracks;return n?n.filter((e=>"TEXT"===e.type)).map((e=>({id:e.trackId.toString(),label:e.name||e.language||`Track ${e.trackId}`,language:e.language,active:!!Array.isArray(t.activeTrackIds)&&t.activeTrackIds.includes(e.trackId)}))):[]}getSelectedTextTrack(){const e=cast.framework.CastContext.getInstance().getCurrentSession();if(!e)return;const t=e.getMediaSession(),n=t?.media?.tracks;if(!n||!Array.isArray(t.activeTrackIds))return;const r=t.activeTrackIds.find((e=>n.some((t=>t.trackId===e&&"TEXT"===t.type))));return void 0!==r?r.toString():void 0}setActiveTextTrack(e){const t=cast.framework.CastContext.getInstance().getCurrentSession();if(!t)return;const n=t.getMediaSession(),r=n?.media?.tracks;if(!r)return;const s=Array.isArray(n.activeTrackIds)?n.activeTrackIds.filter((e=>{const t=r.find((t=>t.trackId===e));return t&&"TEXT"!==t.type})):[];if(""!==e){const t=r.find((t=>t.trackId.toString()===e));t&&s.push(t.trackId)}n?.editTracksInfo(new chrome.cast.media.EditTracksInfoRequest(s),(()=>{}),(()=>{})),this.setState({textTracks:this.getTextTracks()})}getTrackFromExternalTextTrack(e,t){return{trackId:t,type:chrome.cast.media.TrackType.TEXT,trackContentId:e.src,trackContentType:"srt"===e.type?"application/x-subrip":"text/vtt",name:e.label||"",language:e.language||"und",subtype:chrome.cast.media.TextTrackType.SUBTITLES,customData:{}}}getDeviceName(){return cast.framework.CastContext.getInstance().getCurrentSession()?.getCastDevice().friendlyName||""}}class xl extends wl{constructor(e){super(e),this.nativeEngineOptions=e,this.name="Native"}load(e,t){this.setState({playbackState:"loading"}),this.nativeEngineOptions.mediaElement.src=e,this.nativeEngineOptions.mediaElement.load(),t?.startTime&&(this.nativeEngineOptions.mediaElement.currentTime=t.startTime)}getTextTracks(){const e=this.nativeEngineOptions.mediaElement.textTracks,t=[];for(let n=0;n<e.length;n++){const r=e[n];t.push({id:r.id||n.toString(),label:r.label||r.language||`Track ${n+1}`,language:r.language,active:"showing"===r.mode})}return t}getSelectedTextTrack(){const e=this.nativeEngineOptions.mediaElement.textTracks;for(let t=0;t<e.length;t++){const n=e[t];if("showing"===n.mode)return n.id||t.toString()}}getCurrentSource(){return this.currentSource}setActiveTextTrack(e){const t=this.nativeEngineOptions.mediaElement.textTracks;for(let n=0;n<t.length;n++){const r=t[n];r.mode=r.id===e?"showing":"disabled"}this.onTextTrackChanged()}getQualityLevels(){return[]}}var Ul;!function(e){e.AVAILABILITY_CHANGED="airplay:availability_changed",e.CONNECTED="airplay:connected",e.DISCONNECTED="airplay:disconnected"}(Ul||(Ul={}));class Bl extends Nl.bk{constructor(e){super(),this.isAvailable=!1,this.video=e,window.WebKitPlaybackTargetAvailabilityEvent?(e.addEventListener("webkitplaybacktargetavailabilitychanged",this.onAvailabilityChanged=this.onAvailabilityChanged.bind(this)),e.addEventListener("webkitcurrentplaybacktargetiswirelesschanged",this.onTargetChanged=this.onTargetChanged.bind(this))):this.emit(Ul.AVAILABILITY_CHANGED,{available:!1})}onAvailabilityChanged({availability:e}){this.isAvailable="available"===e,this.emit(Ul.AVAILABILITY_CHANGED,{available:this.isAvailable})}onTargetChanged(){this.video.webkitCurrentPlaybackTargetIsWireless?this.emit(Ul.CONNECTED,void 0):this.emit(Ul.DISCONNECTED,void 0)}toggleAirPlay(){this.video.webkitShowPlaybackTargetPicker()}destroy(){this.video.removeEventListener("webkitplaybacktargetavailabilitychanged",this.onAvailabilityChanged),this.video.removeEventListener("webkitcurrentplaybacktargetiswirelesschanged",this.onTargetChanged)}}class Fl{constructor(e){this.video=e}isSupported(){return"pictureInPictureEnabled"in document&&document.pictureInPictureEnabled}isPictureInPicture(){return!!document.pictureInPictureElement}requestPictureInPicture(){this.video.requestPictureInPicture?.()}exitPictureInPicture(){document.exitPictureInPicture?.()}togglePictureInPicture(){this.isPictureInPicture()?this.exitPictureInPicture():this.requestPictureInPicture()}destroy(){this.isPictureInPicture()&&this.exitPictureInPicture()}}class $l extends Nl.bk{constructor(e,t){super(),this.containerElement=e,this.mediaElement=t,this.element=this.containerElement.requestFullscreen||this.containerElement.webkitRequestFullscreen?this.containerElement:this.mediaElement,this.element.addEventListener("fullscreenchange",(()=>
1{this.emit("change",{isFullscreen:this.isFullscreen()})}))}isFullscreen(){return!(!document.fullscreenElement&&!document.webkitFullscreenElement)}toggleFullscreen(){this.isFullscreen()?this.exitFullscreen():this.enterFullscreen()}enterFullscreen(){(this.element.requestFullscreen||this.element.webkitRequestFullscreen||this.element.webkitEnterFullscreen)?.call(this.element)}exitFullscreen(){(document.exitFullscreen||document.webkitExitFullscreen)?.call(document)}}class Gl extends Nl.bk{setState(e){this.state={...this.state,...e},this.emit("stateChanged",this.state)}getState(){return this.state}get isCasting(){return this.state.isCasting}get isAirplayAvailable(){return this.state.isAirplayAvailable}get isAirplayOngoing(){return this.state.isAirplayOngoing}get isPiPAvailable(){return this.state.isPiPAvailable}getContainerElement(){return this.options.containerElement}constructor(e){super(),this.options=e,this.castSender=null,this.airplaySender=null,this.pipSender=null,this.defaultCastAppId="E06DDFCD",this.fullscreenManager=null,this.state={playbackState:"idle",playbackRate:1,muted:!1,volume:0,duration:0,currentTime:0,textTracks:[],isCastSupported:!1,isCasting:!1,isAirplayAvailable:!1,isAirplayOngoing:!1,isPiPAvailable:!1,isFullscreen:!1,qual
1ityLevels:[]},this.videoElement=document.createElement("video"),this.onCastSenderStateUpdate=this.onCastSenderStateUpdate.bind(this),this.onEngineStateUpdate=this.onEngineStateUpdate.bind(this),this.initiateAirplay(),!1!==e.playsInline&&(this.videoElement.playsInline=!0),e.poster&&(this.videoElement.poster=e.poster),e.nativeControls&&(this.videoElement.controls=!0),e.muted&&(this.videoElement.muted=!0),e.autoPlay&&(this.videoElement.muted=!0,this.videoElement.autoplay=e.autoPlay),e.loop&&(this.videoElement.loop=!0),e.allowPictureInPicture?this.initiatePiPManager():this.videoElement.disablePictureInPicture=!0,this.engine=this.selectEngine(this.options.src);this.getMappedExternalTextTracks().forEach((e=>{this.addExternalTextTrack(e)})),e.disableChromecast||this.initiateCastSender(e.castAppId||this.defaultCastAppId,e.src),this.engine.on("stateChanged",this.onEngineStateUpdate),this.engine.onAll(this.onEngineEvent.bind(this)),this.setDefaultStyling(),e.containerElement.appendChild(this.videoElement),this.fullscreenManager=new $l(this.options.containerElement,this.videoElement),this.fullscreenManager.on("change",(({isFullscreen:e})=>{console.log("fullscreen change",e),this.setState({isFullscreen:e})}))}onEngineEvent(e,t){switch(e){case"stateChanged":break;case"error":this.isCasting||this.emit("error",t);break;
1default:this.emit(e,t)}}getMappedExternalTextTracks(){if(this.options.externalTextTracks?.length){const e=new Intl.DisplayNames([this.options.language||"en"],{type:"language"});return this.options.externalTextTracks.map((t=>{let n="";return t.label?n=t.label:t.language&&(n=e.of(t.language)||t.language),{...t,label:n}}))}return[]}setDefaultStyling(){this.videoElement.style.width="100%",this.videoElement.style.backgroundColor="#000",this.options.containerElement.style.position="relative",this.options.containerElement.style.display="flex"}load(e){if(this.isCasting){const t=void 0!==e?.startTime?e.startTime:this.engine.getState().currentTime;return this.castSender?.load(this.options.src,{startTime:t,textTracks:this.getMappedExternalTextTracks()})}const t=e||{startTime:this.options.startTime??0};return this.engine.load(this.options.src,t)}play(){return this.isCasting?this.castSender?.play():this.engine.play()}pause(){return this.isCasting?this.castSender?.pause():this.engine.pause()}togglePlay(){return this.isCasting?this.castSender?.togglePlay():this.engine.togglePlay()}toggleAudio(){return this.isCasting?this.castSender?.toggleAudio():this.engine.toggleAudio()}seekToPercentage(e){if(e=(0,Nl.qE)(e,0,100),this.isCasting)return this.castSender?.seekToPercentage(e);this.engine.seekToPercentage(e)}seekToTime({diff:e,absolute:t}){if(this.isCasting)return this.castSender?.seekToTime({diff:e,absolute:t});this.engine.seekToTime({diff:e,absolute:t})}setVolume(e){if(this.isCasting)return this.castSender?.setVolume(e);this.engine.setVolume(e)}isFullscreen(){return this.fullscreenManager?.isFullscreen()||!1}async toggleFullscreen(){this.fullscreenManager?.toggleFullscreen()}selectEngine(e){const t=function(e){const t=e.match(/\.([^.?#]+)(?:[?#]|$)/);switch(t?t[1].toLowerCase():""){case"m3u8":return bl.HLS;case"mp4":return bl.MP4;case"mp3":return bl.MP3;case"m4a":return bl.M4A;default:return null}}(e);if(!t)throw new Error("No suitable playback engine found for the provided stream URL.");const n={mediaElement:this.videoElement,autoPlay:this.options.autoPlay||!1,format:t};return function(e){let t="";switch(e){case bl.HLS:if(Ll()===Il.CHROME)return!1;t="application/vnd.apple.mpegurl";break;case bl.MP4:t="video/mp4";break;case bl.MP3:t="audio/mpeg";break;case bl.M4A:t="audio/mp4";break;default:return!1}try{return!!document.createElement("video").canPlayType(t)}catch{return!1}}(t)&&!this.options.hlsLevel?new xl(n):new Pl({...n,hlsLevel:this.options.hlsLevel})}onEngineStateUpdate(e){this.setState(e)}onCastSenderStateUpdate(e){this.setState(e)}initiateCastSender(e,t){this.castSender=new Dl({castAppId:e}),this.castSender.on(Ol.CAST_SUPPORTED,(()=>this.setState({isCastSupported:!0}))),this.castSender.on(Ol.CAST_CONNECTING,(()=>{this.engine.pause()})),this.castSender.on(Ol.CAST_CONNECTED,(()=>{const e=this.engine.getCurrentSource();this.setState({isCasting:!0}),e&&this.castSender?.load(e,{startTime:this.engine.getState().currentTime,textTracks:this.getMappedExternalTextTracks()}),this.engine.off("stateChanged",this.onEngineStateUpdate),this.engine.stop(),this.castSender?.on(Ol.CAST_STATE_CHANGED,this.onCastSenderStateUpdate)})),this.castSender.on(Ol.CAST_DISCONNECTED,(async()=>{this.setState({isCasting:!1}),this.engine.on("stateChanged",this.onEngineStateUpdate),this.castSender?.off(Ol.CAST_STATE_CHANGED,this.onCastSenderStateUpdate),this.engine.load(t,{startTime:this.castSender?.getState().currentTime}),this.play()})),this.castSender.on(Ol.CAST_ERROR,(e=>{console.error(e)}))}initiateAirplay(){this.airplaySender=new Bl(this.videoElement),this.airplaySender.on(Ul.AVAILABILITY_CHANGED,(e=>{this.setState({isAirplayAvailable:e.available&&this.engine instanceof xl})})),this.airplaySender.on(Ul.CONNECTED,(()=>{this.setState({isAirplayOngoing:!0})})),this.airplaySender.on(Ul.DISCONNECTED,(()=>{this.setState({isAirplayOngoing:!1})}
1))}restart(){this.load({startTime:0}),this.once("loaded",(()=>{this.play()}))}toggleAirplay(){this.isAirplayAvailable&&this.airplaySender?.toggleAirPlay()}initiatePiPManager(){this.pipSender=new Fl(this.videoElement),this.pipSender.isSupported()&&this.setState({isPiPAvailable:!0})}togglePiP(){this.pipSender&&this.pipSender.isSupported()&&this.pipSender.togglePictureInPicture()}setPlaybackRate(e){this.engine.setPlaybackRate(e)}setActiveTextTrack(e){this.isCasting&&this.castSender&&this.castSender.setActiveTextTrack?this.castSender.setActiveTextTrack(e):this.engine&&this.engine.setActiveTextTrack&&this.engine.setActiveTextTrack(e)}addExternalTextTrack(e){this.engine&&this.engine.addExternalTextTrack&&this.engine.addExternalTextTrack(e)}getCastDeviceName(){return this.castSender?.getDeviceName()}setQualityLevel(e){if(this.engine instanceof Pl)return this.engine.setQualityLevel(e)}getQualityLevel(){if(this.engine instanceof Pl)return this.engine.getQualityLevel()}destroy(){this.engine.destroy(),this.castSender?.destroy(),this.airplaySender?.destroy(),this.pipSender?.destroy(),this.videoElement.remove(),super.destroy()}}class Hl extends Nl.bk{constructor(e,t){super(),this.player=e,this.trackingMilestones=[10,20,30,40,50,60,70,80,90,95],this.passedMileStones=new Set,this.debugLogger=new Nl.k$("Tracking helper",!!t?.debug),this.onTimeUpdate=this.onTimeUpdate.bind(this),this.onPlaying=this.onPlaying.bind(this),this.onEnded=this.onEnded.bind(this),t?.trackingMilestones&&(this.trackingMilestones=t.trackingMilestones),this.player.on("loaded",this.setupListeners.bind(this))}reset(){this.player.off("playing",this.onPlaying),this.player.off("ended",this.onEnded),this.player.off("timeupdate",this.onTimeUpdate)}setupListeners(){this.passedMileStones=new Set,this.player.once("playing",this.onPlaying),this.player.once("ended",this.onEnded),this.player.on("timeupdate",this.onTimeUpdate)}onEnded(){this.debugLogger.log("onEnded"),this.emit("ended",void 0),this.reset()}onPlaying(){this.debugLogger.log("onPlaying"),this.emit("playing",void 0)}onTimeUpdate(e){const t=this.player.getState().duration,n=Math.round(e/t*100),r=this.trackingMilestones.filter((e=>n>=e&&!this.passedMileStones.has(e)));let s=0;r.forEach((e=>{e>s&&(s=e),this.passedMileStones.add(e)})),0!==s&&(this.debugLogger.log("onTimeUpdate",`Percentage passed: ${s}`),this.emit("percentilePassed",s))}}},13269(e,t,n){"use strict";n.d(t,{k$:()=>o,bk:()=>a,pI:()=>s,Rr:()=>r,Q$:()=>u,qE:()=>i,ih:()=>c});class r{constructor(e){this.activeCodes=[],this.callables={},this.setFocusToElement=e=>{const t=e.currentTarget;t&&t instanceof HTMLElement&&(t.tabIndex=0,t.focus())},this.onKeyDown=e=>{this.activeCodes.includes(e.code)||this.activeCodes.push(e.code);for(const t in this.callables){t.split("+").every((e=>this.activeCodes.includes(e)))&&(e.preventDefault(),this.callables[t]())}},this.onKeyUp=e=>{const t=this.activeCodes.indexOf(e.code);t>-1&&this.activeCodes.splice(t,1)},this.node=e??document,this.node.addEventListener("click",this.setFocusToElement),this.node.addEventListener("keydown",this.onKeyDown),this.node.addEventListener("keyup",this.onKeyUp)}listen(e,t){const n=this.shortcutKey(e);this.callables[n]=t}unlisten(e){const t=this.shortcutKey(e);delete this.callables[t]}shortcutKey(e){return e.slice().sort().join("+")}destroy(){this.activeCodes=[],this.callables={},this.node.removeEventListener("click",this.setFocusToElement),this.node.removeEventListener("keydown",this.onKeyDown),this.node.removeEventListener("keyup",this.onKeyUp)}}var s;!function(e){e.A="KeyA",e.B="KeyB",e.C="KeyC",e.D="KeyD",e.E="KeyE",e.F="KeyF",e.G="KeyG",e.H="KeyH",e.I="KeyI",e.J="KeyJ",e.K="KeyK",e.L="KeyL",e.M="KeyM",e.N="KeyN",e.O="KeyO",e.P="KeyP",e.Q="KeyQ",e.R="KeyR",e.S="KeyS",e.T="KeyT",e.U="KeyU",e.V="KeyV",e.W="KeyW",e.X="KeyX",e.Y="KeyY",e.Z="KeyZ",e.Digit0="Digit0",e.Digit1="Digit1",e.Digit2="Digit2",e.Digit3="Digit3",e.Digit4="Digit4",e.Digit5="Digit5",e.Digit6="Digit6",e.Digit7="Digit7",e.Digit8="Digit8",e.Digit9="Digit9",e.Space="Space",e.Enter="Enter",e.Escape="Escape",e.Backspace="Backspace",e.Tab="Tab",e.ShiftLeft="ShiftLeft",e.ShiftRight="ShiftRight",e.ControlLeft="Control
1Left",e.ControlRight="ControlRight",e.AltLeft="AltLeft",e.AltRight="AltRight",e.ArrowUp="ArrowUp",e.ArrowDown="ArrowDown",e.ArrowLeft="ArrowLeft",e.ArrowRight="ArrowRight"}(s||(s={}));const i=(e,t,n)=>Math.min(Math.max(e,t),n);class a{constructor(){var e;this.emitter={all:e=e||new Map,on:function(t,n){var r=e.get(t);r?r.push(n):e.set(t,[n])},off:function(t,n){var r=e.get(t);r&&(n?r.splice(r.indexOf(n)>>>0,1):e.set(t,[]))},emit:function(t,n){var r=e.get(t);r&&r.slice().map((function(e){e(n)})),(r=e.get("*"))&&r.slice().map((function(e){e(t,n)}))}}}emit(e,t){this.emitter?this.emitter.emit(e,t):console.warn("[EmitterBaseClass] trying to emit on destroyed emitter")}on(e,t){this.emitter?.on(e,t)}once(e,t){const n=r=>{this.emitter?.off(e,n),t(r)};this.emitter?.on(e,n)}onAll(e){this.emitter?.on("*",e)}off(e,t){this.emitter?.off(e,t)}destroy(){this.emitter?.off("*"),this.emitter=void 0}}class o{constructor(e,t){this.prefix=e,this.enabled=t}log(...e){this.enabled&&console.log(`[${this.prefix}]`,...e)}warn(...e){this.enabled&&console.warn(`[${this.prefix}]`,...e)}error(...e){this.enabled&&console.error(`[${this.prefix}]`,...e)}}const l={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#039;","/":"&#x2F;","`":"&#x60;","=":"&#x3D;"};function c(e){return e?e.replace(/[&<>"'/`=]/g,(e=>l[e])):""}const u={"fa-right":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640"><path d="M566.6 342.6C579.1 330.1 579.1 309.8 566.6 297.3L406.6 137.3C394.1 124.8 373.8 124.8 361.3 137.3C348.8 149.8 348.8 170.1 361.3 182.6L466.7 288L96 288C78.3 288 64 302.3 64 320C64 337.7 78.3 352 96 352L466.7 352L361.3 457.4C348.8 469.9 348.8 490.2 361.3 502.7C373.8 515.2 394.1 515.2 406.6 502.7L566.6 342.7z"/></svg>',"fa-left":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640"><path d="M73.4 297.4C60.9 309.9 60.9 330.2 73.4 342.7L233.4 502.7C245.9 515.2 266.2 515.2 278.7 502.7C291.2 490.2 291.2 469.9 278.7 457.4L173.3 352L544 352C561.7 352 576 337.7 576 320C576 302.3 561.7 288 544 288L173.3 288L278.7 182.6C291.2 170.1 291.2 149.8 278.7 137.3C266.2 124.8 245.9 124.8 233.4 137.3L73.4 297.3z"/></svg>',"fa-download":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640"><path d="M352 96C352 78.3 337.7 64 320 64C302.3 64 288 78.3 288 96L288 306.7L246.6 265.3C234.1 252.8 213.8 252.8 201.3 265.3C188.8 277.8 188.8 298.1 201.3 310.6L297.3 406.6C309.8 419.1 330.1 419.1 342.6 406.6L438.6 310.6C451.1 298.1 451.1 277.8 438.6 265.3C426.1 252.8 405.8 252.8 393.3 265.3L352 306.7L352 96zM160 384C124.7 384 96 412.7 96 448L96 480C96 515.3 124.7 544 160 544L480 544C515.3 544 544 515.3 544 480L544 448C544 412.7 515.3 384 480 384L433.1 384L376.5 440.6C345.3 471.8 294.6 471.8 263.4 440.6L206.9 384L160 384zM464 440C477.3 440 488 450.7 488 464C488 477.3 477.3 488 464 488C450.7 488 440 477.3 440 464C440 450.7 450.7 440 464 440z"/></svg>',"fa-close":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640"><path d="M183.1 137.4C170.6 124.9 150.3 124.9 137.8 137.4C125.3 149.9 125.3 170.2 137.8 182.7L275.2 320L137.9 457.4C125.4 469.9 125.4 490.2 137.9 502.7C150.4 515.2 170.7 515.2 183.2 502.7L320.5 365.3L457.9 502.6C470.4 515.1 490.7 515.1 503.2 502.6C515.7 490.1 515.7 469.8 503.2 457.3L365.8 320L503.1 182.6C515.6 170.1 515.6 149.8 503.1 137.3C490.6 124.8 470.3 124.8 457.8 137.3L320.5 274.7L183.1 137.4z"/></svg>',angle_right:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640">\x3c!--!Font Awesome Pro v7.1.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2025 Fonticons, Inc.--\x3e<path d="M433.5 303C442.9 312.4 442.9 327.6 433.5 336.9L273.5 497C264.1 506.4 248.9 506.4 239.6 497C230.3 487.6 230.2 472.4 239.6 463.1L382.6 320.1L239.6 177.1C230.2 167.7 230.2 152.5 239.6 143.2C249 133.9 264.2 133.8 273.5 143.2L433.5 303.2z"/></svg>',angle_left:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640">\x3c!--!Font Awesome Pro v7.1.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2025 Fonticons, Inc.--\x3e<path d="M207.5 303C198.1 312.4 198.1 327.
16 207.5 336.9L367.5 496.9C376.9 506.3 392.1 506.3 401.4 496.9C410.7 487.5 410.8 472.3 401.4 463L258.4 320L401.4 177C410.8 167.6 410.8 152.4 401.4 143.1C392 133.8 376.8 133.7 367.5 143.1L207.5 303z"/></svg>'}},41199(e,t,n){"use strict";n.r(t),n.d(t,{BaseMediaPlayerController:()=>Vn,CSSwiperController:()=>zn,DialogController:()=>Yn,ImageModalGalleryController:()=>gr,TestController:()=>s,TruncateTextController:()=>qn});var r=n(52891);class s extends r.Controller{connect(){this.element.innerHTML="<h1>Hello, this is generated by a test component</h1>"}}var i,a,o,l,c,u,d,h,f,p,g,m,_=n(13060),T={},E=[],y=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,S=Array.isArray;function v(e,t){for(var n in t)e[n]=t[n];return e}function b(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function I(e,t,n){var r,s,a,o={};for(a in t)"key"==a?r=t[a]:"ref"==a?s=t[a]:o[a]=t[a];if(arguments.length>2&&(o.children=arguments.length>3?i.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(a in e.defaultProps)void 0===o[a]&&(o[a]=e.defaultProps[a]
vendor: 9,201 bytes, line 1
1);return A(e,o,r,s,null)}function A(e,t,n,r,s){var i={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==s?++o:s,__i:-1,__u:0};return null==s&&null!=a.vnode&&a.vnode(i),i}function R(e){return e.children}function C(e,t){this.props=e,this.context=t}function k(e,t){if(null==t)return e.__?k(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?k(e):null}function L(e){if(e.__P&&e.__d){var t=e.__v,n=t.__e,r=[],s=[],i=v({},t);i.__v=t.__v+1,a.vnode&&a.vnode(i),G(e.__P,i,t,e.__n,e.__P.namespaceURI,32&t.__u?[n]:null,r,null==n?k(t):n,!!(32&t.__u),s),i.__v=t.__v,i.__.__k[i.__i]=i,j(r,i,s),t.__e=t.__=null,i.__e!=n&&O(i)}}function O(e){if(null!=(e=e.__)&&null!=e.__c)return e.__e=e.__c.base=null,e.__k.some((function(t){if(null!=t&&null!=t.__e)return e.__e=e.__c.base=t.__e})),O(e)}function N(e){(!e.__d&&(e.__d=!0)&&l.push(e)&&!w.__r++||c!=a.debounceRendering)&&((c=a.debounceRendering)||u)(w)}function w(){for(var e,t=1;l.length;)l.length>t&&l.sort(d),e=l.shift(),t=l.length,L(e);w.__r=0}function P(e,t,n,r,s,i,a,o,l,c,u){var d,h,f,p,g,m,_,y=r&&r.__k||E,S=t.length;for(l=M(n,t,y,l,S),d=0;d<S;d++)null!=(f=n.__k[d])&&(h=-1!=f.__i&&y[f.__i]||T,f.__i=d,m=G(e,f,h,s,i,a,o,l,c,u),p=f.__e,f.ref&&h.ref!=f.ref&&(h.ref&&V(h.ref,null,f),u.push(f.ref,f.__c||p,f)),null==g&&null!=p&&(g=p),(_=!!(4&f.__u))||h.__k===f.__k?l=D(f,l,e,_):"function"==typeof f.type&&void 0!==m?l=m:p&&(l=p.nextSibling),f.__u&=-7);return n.__e=g,l}function M(e,t,n,r,s){var i,a,o,l,c,u=n.length,d=u,h=0;for(e.__k=new Array(s),i=0;i<s;i++)null!=(a=t[i])&&"boolean"!=typeof a&&"function"!=typeof a?("string"==typeof a||"number"==typeof a||"bigint"==typeof a||a.constructor==String?a=e.__k[i]=A(null,a,null,null,null):S(a)?a=e.__k[i]=A(R,{children:a},null,null,null):void 0===a.constructor&&a.__b>0?a=e.__k[i]=A(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):e.__k[i]=a,l=i+h,a.__=e,a.__b=e.__b+1,o=null,-1!=(c=a.__i=U(a,n,l,d))&&(d--,(o=n[c])&&(o.__u|=2)),null==o||null==o.__v?(-1==c&&(s>u?h--:s<u&&h++),"function"!=typeof a.type&&(a.__u|=4)):c!=l&&(c==l-1?h--:c==l+1?h++:(c>l?h--:h++,a.__u|=4))):e.__k[i]=null;if(d)for(i=0;i<u;i++)null!=(o=n[i])&&!(2&o.__u)&&(o.__e==r&&(r=k(o)),q(o,o));return r}function D(e,t,n,r){var s,i;if("function"==typeof e.type){for(s=e.__k,i=0;s&&i<s.length;i++)s[i]&&(s[i].__=e,t=D(s[i],t,n,r));return t}e.__e!=t&&(r&&(t&&e.type&&!t.parentNode&&(t=k(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do{t=t&&t.nextSibling}while(null!=t&&8==t.nodeType);return t}function x(e,t){return t=t||[],null==e||"boolean"==typeof e||(S(e)?e.some((function(e){x(e,t)})):t.push(e)),t}function U(e,t,n,r){var s,i,a,o=e.key,l=e.type,c=t[n],u=null!=c&&!(2&c.__u);if(null===c&&null==o||u&&o==c.key&&l==c.type)return n;if(r>(u?1:0))for(s=n-1,i=n+1;s>=0||i<t.length;)if(null!=(c=t[a=s>=0?s--:i++])&&!(2&c.__u)&&o==c.key&&l==c.type)return a;return-1}function B(e,t,n){"-"==t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||y.test(t)?n:n+"px"}function F(e,t,n,r,s){var i,a;e:if("style"==t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof r&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||B(e.style,t,"");if(n)for(t in n)r&&n[t]==r[t]||B(e.style,t,n[t])}else if("o"==t[0]&&"n"==t[1])i=t!=(t=t.replace(h,"$1")),a=t.toLowerCase(),t=a in e||"onFocusOut"==t||"onFocusIn"==t?a.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=n,n?r?n.u=r.u:(n.u=f,e.addEventListener(t,i?g:p,i)):e.removeEventListener(t,i?g:p,i);else{if("http://www.w3.org/2000/svg"==s)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=t&&"height"!=t&&"href"!=t&&"list"!=t&&"form"!=t&&"tabIndex"!=t&&"download"!=t&&"rowSpan"!=t&&"colSpan"!=t&&"role"!=t&&"popover"!=t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null==n||!1===n&&"-"!=t[4]?e.removeAttribute(t):e.setAttribute(t,"popover"==t&&1==n?"":n))}}function $(e){return function(t){if(this.l){var n=this.l[t.type+e];if(null==t.t)t.t=f++;else if(t.t<n.u)return;return n(a.event?a.event(t):t)}}}function G(e,t,n,r,s,i,o,l,c,u){var d,h,f,p,g,m,_,T,y,I,A,k,L,O,N,w=t.type;if(void 0!==t.constructor)return null;128&n.__u&&(c=!!(32&n.__u),i=[l=t.__e=n.__e]),(d=a.__b)&&d(t);e:if("function"==typeof w)try{if(T=t.props,y="prototype"in w&&w.prototype.render,I=(d=w.contextType)&&r[d.__c],A=d?I?I.props.value:d.__:r,n.__c?_=(h=t.__c=n.__c).__=h.__E:(y?t.__c=h=new w(T,A):(t.__c=h=new C(T,A),h.constructor=w,h.render=Y),I&&I.sub(h),h.state||(h.state={}),h.__n=r,f=h.__d=!0,h.__h=[],h._sb=[]),y&&null==h.__s&&(h.__s=h.state),y&&null!=w.getDerivedStateFromProps&&(h.__s==h.state&&(h.__s=v({},h.__s)),v(h.__s,w.getDerivedStateFromProps(T,h.__s))),p=h.props,g=h.state,h.__v=t,f)y&&null==w.getDerivedStateFromProps&&null!=h.componentWillMount&&h.componentWillMount(),y&&null!=h.componentDidMount&&h.__h.push(h.componentDidMount);else{if(y&&null==w.getDerivedStateFromProps&&T!==p&&null!=h.componentWillReceiveProps&&h.componentWillReceiveProps(T,A),t.__v==n.__v||!h.__e&&null!=h.shouldComponentUpdate&&!1===h.shouldComponentUpdate(T,h.__s,A)){t.__v!=n.__v&&(h.props=T,h.state=h.__s,h.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some((function(e){e&&(e.__=t)})),E.push.apply(h.__h,h._sb),h._sb=[],h.__h.length&&o.push(h);break e}null!=h.componentWillUpdate&&h.componentWillUpdate(T,h.__s,A),y&&null!=h.componentDidUpdate&&h.__h.push((function(){h.componentDidUpdate(p,g,m)}))}if(h.context=A,h.props=T,h.__P=e,h.__e=!1,k=a.__r,L=0,y)h.state=h.__s,h.__d=!1,k&&k(t),d=h.render(h.props,h.state,h.context),E.push.apply(h.__h,h._sb),h._sb=[];else do{h.__d=!1,k&&k(t),d=h.render(h.props,h.state,h.context),h.state=h.__s}while(h.__d&&++L<25);h.state=h.__s,null!=h.getChildContext&&(r=v(v({},r),h.getChildContext())),y&&!f&&null!=h.getSnapshotBeforeUpdate&&(m=h.getSnapshotBeforeUpdate(p,g)),O=null!=d&&d.type===R&&null==d.key?W(d.props.children):d,l=P(e,S(O)?O:[O],t,n,r,s,i,o,l,c,u),h.base=t.__e,t.__u&=-161,h.__h.length&&o.push(h),_&&(h.__E=h.__=null)}catch(e){if(t.__v=null,c||null!=i)if(e.then){for(t.__u|=c?160:128;l&&8==l.nodeType&&l.nextSibling;)l=l.nextSibling;i[i.indexOf(l)]=null,t.__e=l}else{for(N=i.length;N--;)b(i[N]);H(t)}else t.__e=n.__e,t.__k=n.__k,e.then||H(t);a.__e(e,t,n)}else null==i&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):l=t.__e=K(n.__e,t,n,r,s,i,o,c,u);return(d=a.diffed)&&d(t),128&t.__u?void 0:l}function H(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(H))}function j(e,t,n){for(var r=0;r<n.length;r++)V(n[r],n[++r],n[++r]);a.__c&&a.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){a.__e(e,t.__v)}}))}function W(e){return"object"!=typeof e||null==e||e.__b>0?e:S(e)?e.map(W):v({},e)}function K(e,t,n,r,s,o,l,c,u){var d,h,f,p,g,m,_,E=n.props||T,y=t.props,v=t.type;if("svg"==v?s="http://www.w3.org/2000/svg":"math"==v?s="http://www.w3.org/1998/Math/MathML":s||(s="http://www.w3.org/1999/xhtml"),null!=o)for(d=0;d<o.length;d++)if((g=o[d])&&"setAttribute"in g==!!v&&(v?g.localName==v:3==g.nodeType)){e=g,o[d]=null;break}if(null==e){if(null==v)return document.createTextNode(y);e=document.createElementNS(s,v,y.is&&y),c&&(a.__m&&a.__m(t,o),c=!1),o=null}if(null==v)E===y||c&&e.data==y||(e.data=y);else{if(o=o&&i.call(e.childNodes),!c&&null!=o)for(E={},d=0;d<e.attributes.length;d++)E[(g=e.attributes[d]).name]=g.value;for(d in E)g=E[d],"dangerouslySetInnerHTML"==d?f=g:"children"==d||d in y||"value"==d&&"defaultValue"in y||"checked"==d&&"defaultChecked"in y||F(e,d,null,g,s);for(d in y)g=y[d],"children"==d?p=g:"dangerouslySetInnerHTML"==d?h=g:"value"==d?m=g:"checked"==d?_=g:c&&"function"!=typeof g||E[d]===g||F(e,d,g,E[d],s);if(h)c||f&&(h.__html==f.__html||h.__html==e.innerHTML)||(e.innerHTML=h.__html),t.__k=[];else if(f&&(e.innerHTML=""),P("template"==t.type?e.content:e,S(p)?p:[p],t,n,r,"foreignObject"==v?"http://www.w3.org/1999/xhtml":s,o,l,o?o[0]:n.__k&&k(n,0),c,u),null!=o)for(d=o.length;d--;)b(o[d]);c||(d="value","progress"==v&&null==m?e.removeAttribute("value"):null!=m&&(m!==e[d]||"progress"==v&&!m||"option"==v&&m!=E[d])&&F(e,d,m,E[d],s),d="checked",null!=_&&_!=e[d]&&F(e,d,_,E[d],s))}return e}function V(e,t,n){try{if("function"==typeof e){var r="function"==typeof e.__u;r&&e.__u(),r&&null==t||(e.__u=e(t))}else e.current=t}catch(e){a.__e(e,n)}}function q(e,t,n){var r,s;if(a.unmount&&a.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||V(r,null,t)),null!=(r=e.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){a.__e(e,t)}r.base=r.__P=null}if(r=e.__k)for(s=0;s<r.length;s++)r[s]&&q(r[s],t,n||"function"!=typeof e.type);n||b(e.__e),e.__c=e.__=e.__e=void 0}function Y(e,t,n){return this.constructor(e,n)}function z(e,t,n){var r,s,o,l;t==document&&(t=document.documentElement),a.__&&a.__(e,t),s=(r="function"==typeof n)?null:n&&n.__k||t.__k,o=[],l=[],G(t,e=(!r&&n||t).__k=I(R,null,[e]),s||T,T,t.namespaceURI,!r&&n?[n]:s?null:t.firstChild?i.call(t.childNodes):null,o,!r&&n?n:s?s.__e:t.firstChild,r,l),j(o,e,l)}function J(e){function t(e){var n,r;return this.getChildContext||(n=new Set,(r={})[t.__c]=this,this.getChildContext=function(){return r},this.componentWillUnmount=function(){n=null},this.shouldComponentUpdate=function(e){this.props.value!=e.value&&n.forEac
1h((function(e){e.__e=!0,N(e)}))},this.sub=function(e){n.add(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n&&n.delete(e),t&&t.call(e)}}),e.children}return t.__c="__cC"+m++,t.__=e,t.Provider=t.__l=(t.Consumer=function(e,t){return e.children(t)}).contextType=t,t}i=E.slice,a={__e:function(e,t,n,r){for(var s,i,a;t=t.__;)if((s=t.__c)&&!s.__)try{if((i=s.constructor)&&null!=i.getDerivedStateFromError&&(s.setState(i.getDerivedStateFromError(e)),a=s.__d),null!=s.componentDidCatch&&(s.componentDidCatch(e,r||{}),a=s.__d),a)return s.__E=s}catch(t){e=t}throw e}},o=0,C.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=v({},this.state),"function"==typeof e&&(e=e(v({},n),this.props)),e&&v(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),N(this))},C.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),N(this))},C.prototype.render=R,l=[],u="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,d=function(e,t){return e.__v.__b-t.__v.__b},w.__r=0,h=/(PointerCapture)$|Capture$/i,f=0,p=$(!1),g=$(!0),m=0;var X=0;Array.isArray;function Q(e,t,n,r,s,i){t||(t={});var o,l,c=t;if("ref"in c)for(l in c={},t)"ref"==l?o=t[l]:c[l]=t[l];var u={type:e,props:c,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--X,__i:-1,__u:0,__source:s,__self:i};if("function"==typeof e&&(o=e.defaultProps))for(l in o)void 0===c[l]&&(c[l]=o[l]);return a.vnode&&a.vnode(u),u}var Z,ee,te,ne,re=0,se=[],ie=a,ae=ie.__b,oe=ie.__r,le=ie.diffed,ce=ie.__c,ue=ie.unmount,de=ie.__;function he(e,t){ie.__h&&ie.__h(ee,e,re||t),re=0;var n=ee.__H||(ee.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function fe(e){return re=1,pe(Re,e)}function pe(e,t,n){var r=he(Z++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):Re(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);t!==n&&(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=ee,!ee.__f)){var s=function(e,t,n){if(!r.__c.__H)return!0;var s=r.__c.__H.__.filter((function(e){return e.__c}));if(s.every((function(e){return!e.__N})))return!i||i.call(this,e,t,n);var a=r.__c.props!==e;return s.some((function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(a=!0)}})),i&&i.call(this,e,t,n)||a};ee.__f=!0;var i=ee.shouldComponentUpdate,a=ee.componentWillUpdate;ee.componentWillUpdate=function(e,t,n){if(this.__e){var r=i;i=void 0,s(e,t,n),i=r}a&&a.call(this,e,t,n)},ee.shouldComponentUpdate=s}return r.__N||r.__}function ge(e,t){var n=he(Z++,3);!ie.__s&&Ae(n.__H,t)&&(n.__=e,n.u=t,ee.__H.__h.push(n))}function me(e){return re=5,_e((function(){return{current:e}}),[])}function _e(e,t){var n=he(Z++,7);return Ae(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function Te(e,t){return re=8,_e((function(){return e}),t)}function Ee(e){var t=ee.context[e.__c],n=he(Z++,9);return n.c=e,t?(null==n.__&&(n.__=!0,t.sub(ee)),t.props.value):e.__}function ye(){for(var e;e=se.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(be),t.__h.some(Ie),t.__h=[]}catch(n){t.__h=[],ie.__e(n,e.__v)}}}ie.__b=function(e){ee=null,ae&&ae(e)},ie.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),de&&de(e,t)},ie.__r=function(e){oe&&oe(e),Z=0;var t=(ee=e.__c).__H;t&&(te===ee?(t.__h=[],ee.__h=[],t.__.some((function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0}))):(t.__h.some(be),t.__h.some(Ie),t.__h=[],Z=0)),te=ee},ie.diffed=function(e){le&&le(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==se.push(t)&&ne===ie.requestAnimationFrame||((ne=ie.requestAnimationFrame)||ve)(ye)),t.__H.__.some((function(e){e.u&&(e.__H=e.u),e.u=void 0}))),te=ee=null},ie.__c=function(e,t){t.some((function(e){try{e.__h.some(be),e.__h=e.__h.filter((function(e){return!e.__||Ie(e)}))}catch(n){t.some((function(e){e.__h&&(e.__h=[])})),t=[],ie.__e(n,e.__v)}})),ce&&ce(e,t)},ie.unmount=function(e){ue&&ue(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.some((function(e){try{be(e)}catch(e){t=e}})),n.__H=void 0,t&&ie.__e(t,n.__v))};var Se="function"==typeof requestAnimationFrame;function ve(e){var t,n=function(){clearTimeout(r),Se&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);Se&&(t=requestAnimationFrame(n))}function be(e){var t=ee,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),ee=t}function Ie(e){var t=ee;e.__c=e.__(),ee=t}function Ae(e,t){return!e||e.length!==t.length||t.some((function(t,n){return t!==e[n]}))}function Re(e,t){return"function"==typeof t?t(e):t}function Ce(e,t){for(var n in t)e[n]=t[n];return e}function ke(e,t){for(var n in e)if("__source"!==n&&!(n in t))return!0;for(var r in t)if("__source"!==r&&e[r]!==t[r])return!0;return!1}function Le(e,t){this.props=e,this.context=t}(Le.prototype=new C).isPureReactComponent=!0,Le.prototype.shouldComponentUpdate=function(e,t){return ke(this.props,e)||ke(this.state,t)};var Oe=a.__b;a.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),Oe&&Oe(e)};"undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref");var Ne=a.__e;a.__e=function(e,t,n,r){if(e.then)for(var s,i=t;i=i.__;)if((s=i.__c)&&s.__c)return null==t.__e&&(t.__e=n.__e,t.__k=n.__k),s.__c(e,t);Ne(e,t,n,r)};var we=a.unmount;function Pe(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach((function(e){"function"==typeof e.__c&&e.__c()})),e.__c.__H=null),null!=(e=Ce({},e)).__c&&(e.__c.__P===n&&(e.__c.__P=t),e.__c.__e=!0,e.__c=null),e.__k=e.__k&&e.__k.map((function(e){return Pe(e,t,n)}))),e}function Me(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map((function(e){return Me(e,t,n)})),e.__c&&e.__c.__P===t&&(e.__e&&n.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=n)),e}function De(){this.__u=0,this.o=null,this.__b=null}function xe(e){if(!e.__)return null;var t=e.__.__c;return t&&t.__a&&t.__a(e)}function Ue(){this.i=null,this.l=null}a.unmount=function(e){var t=e.__c;t&&(t.__z=!0),t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),we&&we(e)},(De.prototype=new C).__c=function(e,t){var n=t.__c,r=this;null==r.o&&(r.o=[]),r.o.push(n);var s=xe(r.__v),i=!1,a=function(){i||r.__z||(i=!0,n.__R=null,s?s(l):l())};n.__R=a;var o=n.__P;n.__P=null;var l=function(){if(! --r.__u){if(r.state.__a){var e=r.state.__a;r.__v.__k[0]=Me(e,e.__c.__P,e.__c.__O)}var t;for(r.setState({__a:r.__b=null});t=r.o.pop();)t.__P=o,t.forceUpdate()}};r.__u++||32&t.__u||r.setState({__a:r.__b=r.__v.__k[0]}),e.then(a,a)},De.prototype.componentWillUnmount=function(){this.o=[]},De.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=Pe(this.__b,n,r.__O=r.__P)}this.__b=null}var s=t.__a&&I(R,null,e.fallback);return s&&(s.__u&=-33),[I(R,null,t.__a?null:e.children),s]};var Be=function(e,t,n){if(++n[1]===n[0]&&e.l.delete(t),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!e.l.size))for(n=e.i;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.i=n=n[2]}};(Ue.prototype=new C).__a=function(e){var t=this,n=xe(t.__v),r=t.l.get(e);return r[0]++,function(s){var i=function(){t.props.revealOrder?(r.push(s),Be(t,e,r)):s()};n?n(i):i()}},Ue.prototype.render=function(e){this.i=null,this.l=new Map;var t=x(e.children);e.revealOrder&&"b"===e.revealOrder[0]&&t.reverse();for(var n=t.length;n--;)this.l.set(t[n],this.i=[1,0,this.i]);return e.children},Ue.prototype.componentDidUpdate=Ue.prototype.componentDidMount=function(){var e=this;this.l.forEach((function(t,n){Be(e,n,t)}))};var Fe="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,$e=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,Ge=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,He=/[A-Z0-9]/g,je="undefined"!=typeof document,We=function(e){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/:/fil|che|ra/).test(e)};C.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach((function(e){Object.defineProperty(C.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})}));var Ke=a.event;function Ve(){}function qe(){return this.cancelBubble}function Ye(){return this.defaultPrevented}a.event=function(e){return Ke&&(e=Ke(e)),e.persist=Ve,e.isPropagationStopped=qe,e.isDefaultPrevented=Ye,e.nativeEvent=e};
1var ze={enumerable:!1,configurable:!0,get:function(){return this.class}},Je=a.vnode;a.vnode=function(e){"string"==typeof e.type&&function(e){var t=e.props,n=e.type,r={},s=-1===n.indexOf("-");for(var i in t){var a=t[i];if(!("value"===i&&"defaultValue"in t&&null==a||je&&"children"===i&&"noscript"===n||"class"===i||"className"===i)){var o=i.toLowerCase();"defaultValue"===i&&"value"in t&&null==t.value?i="value":"download"===i&&!0===a?a="":"translate"===o&&"no"===a?a=!1:"o"===o[0]&&"n"===o[1]?"ondoubleclick"===o?i="ondblclick":"onchange"!==o||"input"!==n&&"textarea"!==n||We(t.type)?"onfocus"===o?i="onfocusin":"onblur"===o?i="onfocusout":Ge.test(i)&&(i=o):o=i="oninput":s&&$e.test(i)?i=i.replace(He,"-$&").toLowerCase():null===a&&(a=void 0),"oninput"===o&&r[i=o]&&(i="oninputCapture"),r[i]=a}}"select"==n&&r.multiple&&Array.isArray(r.value)&&(r.value=x(t.children).forEach((function(e){e.props.selected=-1!=r.value.indexOf(e.props.value)}))),"select"==n&&null!=r.defaultValue&&(r.value=x(t.children).forEach((function(e){e.props.selected=r.multiple?-1!=r.defaultValue.indexOf(e.props.value):r.defaultValue==e.props.value}))),t.class&&!t.className?(r.class=t.class,Object.defineProperty(r,"className",ze)):t.className&&(r.class=r.className=t.className),e.props=r}(e),e.$$typeof=Fe,Je&&Je(e)};var Xe=a.__r;a.__r=function(e){Xe&&Xe(e),e.__c};var Qe=a.diffed;a.diffed=function(e){Qe&&Qe(e);var t=e.props,n=e.__e;null!=n&&"textarea"===e.type&&"value"in t&&t.value!==n.value&&(n.value=null==t.value?"":t.value)};function Ze(e){return e&&e.__esModule?e.default:e}function et(e,t,n,r){Object.defineProperty(e,t,{get:n,set:r,enumerable:!0,configurable:!0})}var tt,nt,rt,st,it,at,ot,lt,ct,ut,dt,ht,ft={};et(ft,"bigPlayButton",(()=>tt),(e=>tt=e)),et(ft,"clickableOverlay",(()=>nt),(e=>nt=e)),et(ft,"container",(()=>rt),(e=>rt=e)),et(ft,"controlsContainer",(()=>st),(e=>st=e)),et(ft,"controlsSection",(()=>it),(e=>it=e)),et(ft,"fullPage",(()=>at),(e=>at=e)),et(ft,"iconButton",(()=>ot),(e=>ot=e)),et(ft,"jumpIndicator",(()=>lt),(e=>lt=e)),et(ft,"left",(()=>ct),(e=>ct=e)),et(ft,"right",(()=>ut),(e=>ut=e)),et(ft,"show",(()=>dt),(e=>dt=e)),et(ft,"skinContainer",(()=>ht),(e=>ht=e)),tt="_3fwmTG_bigPlayButton",nt="_3fwmTG_clickableOverlay",rt="_3fwmTG_container",st="_3fwmTG_controlsContainer",it="_3fwmTG_controlsSection",at="_3fwmTG_fullPage",ot="_3fwmTG_iconButton",lt="_3fwmTG_jumpIndicator",ct="_3fwmTG_left",ut="_3fwmTG_right",dt="_3fwmTG_show",ht="_3fwmTG_skinContainer";var pt,gt,mt,_t={};et(_t,"container",(()=>pt),(e=>pt=e)),et(_t,"seek",(()=>gt),(e=>gt=e)),et(_t,"timestamp",(()=>mt),(e=>mt=e)),pt="MHFShW_container",gt="MHFShW_seek",mt="MHFShW_timestamp";var Tt,Et,yt,St,vt,bt={};function It(e){return _e((()=>"horizontal"===e?{height:"4px",width:"100%"}:{height:"100%",width:"4px"}),[e])}function At(e,t){return _e((()=>"horizontal"===t?{left:`${e}%`,transform:"translateX(-50%)"}:{bottom:`${e}%`,transform:"translateY(50%)"}),[t,e])}function Rt(e,t){return _e((()=>"horizontal"===t?{transform:"translate(-50%, -150%)",left:`${e}%`}:{bottom:`${e}%`,transform:"translate(-110%, 50%)"}),[t,e])}function Ct(e,t){return _e((()=>"horizontal"===t?{width:`${e}%`}:{height:`${e}%`,position:"absolute",width:"4px",bottom:0}),[e,t])}function kt(e){return parseFloat(e.toFixed(2))}function Lt(e,t){const n=e.changedTouches[0],r=e.currentTarget;if("horizontal"===t){const e=n.clientX-r.getBoundingClientRect().left;return Math.min(kt(e/r.offsetWidth*100),99.99)}return 0}function Ot(e,t){return kt("horizontal"===t?e.offsetX/e.target.clientWidth*100:100-e.offsetY/e.target.clientHeight*100)}function Nt(e,t=!1){return t?5*Math.ceil(e/5):e}function wt({onClick:e,value:t,TimestampComponent:n,direction:r,staggerPosition:s=!1}){const[i,a]=fe(),[o,l]=fe(!1),c=Te((t=>{a(void 0),e(Nt(Ot(t,r),s))}),[r,e,s]),u=Te((t=>{const n=Nt(Lt(t,r),s);l(!1),a(void 0),e(n)}),[e,r,s]),d=Te((e=>{a(Nt(Ot(e,r),s))}),[r,s]),h=Te((e=>{const t=Lt(e,r);a(Nt(t,s))}),[r,s]),f=It(r),p=At(o&&i?i:t,r),g=Ct(t,r),m=Rt(i||0,r);return Q("div",{className:Ze(bt).sliderContainer,onMouseMove:d,onTouchMove:h,onTouchEnd:u,onMouseLeave:()=>a(void 0),onClick:c,onMouseDown:()=>l(!0),onTouchStart:()=>l(!0),onMouseUp:()=>l(!1),children:[Q("div",{onClick:e=>e.stopPropagation(),onMouseEnter:e=>e.stopPropagation(),onMouseMove:e=>e.stopPropagation(),onMouseLeave:e=>e.stopPropagation(),onMouseUp:()=>
1{i&&(a(void 0),e(Nt(i,s)))},style:p,class:Ze(bt).seekDot}),Q("div",{style:f,className:Ze(bt).timeline,children:[Q("div",{className:Ze(bt).timeline,style:g}),i&&Q("div",{style:m,className:`${Ze(bt).timestamp} ${Ze(bt).seek}`,children:Q(n,{positionPercentage:i})})]})]})}function Pt(e,t=!1){const n=e,r=Math.floor(n/3600),s=Math.floor(n%3600/60),i=Math.floor(n%60);return t?`${String(s).padStart(2,"0")}:${String(i).padStart(2,"0")}`:`${String(r).padStart(2,"0")}:${String(s).padStart(2,"0")}:${String(i).padStart(2,"0")}`}function Mt(e,t){return e*(t/100)}function Dt({currentTime:e,duration:t,onSeek:n}){if(!e||!t)return null;const r=e/t*100,s=Pt(t,t<3600);return Q("div",{className:Ze(_t).container,children:[Q("div",{class:Ze(_t).timestamp,children:Pt(e,t<3600)}),Q(wt,{direction:"horizontal",value:r,onClick:n,TimestampComponent:({positionPercentage:e})=>Q("div",{style:{left:`${e}%`},className:`${Ze(_t).timestamp} ${Ze(_t).seek}`,children:Pt(Mt(t,e),t<3600)})}),Q("span",{class:Ze(_t).timestamp,children:s})]})}et(bt,"seek",(()=>Tt),(e=>Tt=e)),et(bt,"seekDot",(()=>Et),(e=>Et=e)),et(bt,"sliderContainer",(()=>yt),(e=>yt=e)),et(bt,"timeline",(()=>St),(e=>St=e)),et(bt,"timestamp",(()=>vt),(e=>vt=e)),Tt="Pdpjvq_seek",Et="Pdpjvq_seekDot",yt="Pdpjvq_sliderContainer",St="Pdpjvq_timeline",vt="Pdpjvq_timestamp";const xt=()=>Q("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 384 512",children:Q("path",{d:"M73 39c-14.8-9.1-33.4-9.4-48.5-.9S0 62.6 0 80L0 432c0 17.4 9.4 33.4 24.5 41.9s33.7 8.1 48.5-.9L361 297c14.3-8.7 23-24.2 23-41s-8.7-32.2-23-41L73 39z"})}),Ut=()=>Q("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 320 512",children:Q("path",{d:"M48 64C21.5 64 0 85.5 0 112L0 400c0 26.5 21.5 48 48 48l32 0c26.5 0 48-21.5 48-48l0-288c0-26.5-21.5-48-48-48L48 64zm192 0c-26.5 0-48 21.5-48 48l0 288c0 26.5 21.5 48 48 48l32 0c26.5 0 48-21.5 48-48l0-288c0-26.5-21.5-48-48-48l-32 0z"})}),Bt=()=>Q("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512",children:Q("path",{d:"M32 32C14.3 32 0 46.3 0 64l0 96c0 17.7 14.3 32 32 32s32-14.3 32-32l0-64 64 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L32 32zM64 352c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 96c0 17.7 14.3 32 32 32l96 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-64 0 0-64zM320 32c-17.7 0-32 14.3-32 32s14.3 32 32 32l64 0 0 64c0 17.7 14.3 32 32 32s32-14.3 32-32l0-96c0-17.7-14.3-32-32-32l-96 0zM448 352c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 64-64 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l96 0c17.7 0 32-14.3 32-32l0-96z"})}),Ft=()=>Q("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512",children:Q("path",{d:"M160 64c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 64-64 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l96 0c17.7 0 32-14.3 32-32l0-96zM32 320c-17.7 0-32 14.3-32 32s14.3 32 32 32l64 0 0 64c0 17.7 14.3 32 32 32s32-14.3 32-32l0-96c0-17.7-14.3-32-32-32l-96 0zM352 64c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 96c0 17.7 14.3 32 32 32l96 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-64 0 0-64zM320 320c-17.7 0-32 14.3-32 32l0 96c0 17.7 14.3 32 32 32s32-14.3 32-32l0-64 64 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-96 0z"})}),$t=()=>Q("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 576 512",children:Q("path",{d:"M333.1 34.8C344.6 40 352 51.4 352 64l0 384c0 12.6-7.4 24-18.9 29.2s-25 3.1-34.4-5.3L163.8 352 96 352c-35.3 0-64-28.7-64-64l0-64c0-35.3 28.7-64 64-64l67.8 0L298.7 40.1c9.4-8.4 22.9-10.4 34.4-5.3zm172 72.2c43.2 35.2 70.9 88.9 70.9 149s-27.7 113.8-70.9 149c-10.3 8.4-25.4 6.8-33.8-3.5s-6.8-25.4 3.5-33.8C507.3 341.3 528 301.1 528 256s-20.7-85.3-53.2-111.8c-10.3-8.4-11.8-23.5-3.5-33.8s23.5-11.8 33.8-3.5zm-60.5 74.5C466.1 199.1 480 225.9 480 256s-13.9 56.9-35.4 74.5c-10.3 8.4-25.4 6.8-33.8-3.5s-6.8-25.4 3.5-33.8C425.1 284.4 432 271 432 256s-6.9-28.4-17.7-37.3c-10.3-8.4-11.8-23.5-3.5-33.8s23.5-11.8 33.8-3.5z"})}),Gt=()=>Q("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 640 512",children:Q("path",{d:"M38.8 5.1C28.4-3.1 13.3-1.2 5.1 9.2S-1.2 34.7 9.2 42.9l592 464c10.4 8.2 25.5 6.3 33.7-4.1s6.3-25.5-4.1-33.7L525.1 386.2C556.7 352 576 306.3 576 256c0-60.1-27.7-113.8-70.9-149c-10.3-8.4-25.4-6.8-33.8 3.5s-6.8 25.4 3.5 33.8C507.3 170.7 528 210.9 528 256c0 39.1-15.6 74.5-40.9 100.5L449 326.6c19-17.5 31-42.7 31-70.6c0-30.1-13.9-56.9-35.4-74.5c-10.3-8.4-25.4-6.8-33.8 3.5s-6.8 25.4 3.5 33.8C425.1 227.6 432 241 432 256s-6.9 28.4-17.7 37.3c-1.3 1-2.4 2.2-3.4 3.4L352 250.6 352 64c0-12.6-7.4-24-18.9-29.2s-25-3.1-34.4 5.3L197.8 129.8 38.8 5.
11zM352 373.3L82.9 161.3C53.8 167.4 32 193.1 32 224l0 64c0 35.3 28.7 64 64 64l67.8 0L298.7 471.9c9.4 8.4 22.9 10.4 34.4 5.3S352 460.6 352 448l0-74.7z"})}),Ht=()=>Q("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 576 512",children:Q("path",{d:"M480 96L96 96c-17.7 0-32 14.3-32 32l0 192c0 17.7 14.3 32 32 32l69.5 0-50.7 50.7c-4 4-7.4 8.5-10.2 13.3L96 416c-53 0-96-43-96-96L0 128C0 75 43 32 96 32l384 0c53 0 96 43 96 96l0 192c0 53-43 96-96 96l-8.6 0c-2.8-4.8-6.2-9.2-10.2-13.3L410.5 352l69.5 0c17.7 0 32-14.3 32-32l0-192c0-17.7-14.3-32-32-32zM265.4 297.4c12.5-12.5 32.8-12.5 45.3 0l128 128c9.2 9.2 11.9 22.9 6.9 34.9s-16.6 19.8-29.6 19.8l-256 0c-12.9 0-24.6-7.8-29.6-19.8s-2.2-25.7 6.9-34.9l128-128z"})}),jt=()=>Q("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",children:Q("path",{d:"M288 448L64 448l0-224 64 0 0-64-64 0c-35.3 0-64 28.7-64 64L0 448c0 35.3 28.7 64 64 64l224 0c35.3 0 64-28.7 64-64l0-64-64 0 0 64zm-64-96l224 0c35.3 0 64-28.7 64-64l0-224c0-35.3-28.7-64-64-64L224 0c-35.3 0-64 28.7-64 64l0 224c0 35.3 28.7 64 64 64z"})}),Wt=()=>Q("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 576 512",children:Q("path",{d:"M64 80c-8.8 0-16 7.2-16 16l0 320c0 8.8 7.2 16 16 16l448 0c8.8 0 16-7.2 16-16l0-320c0-8.8-7.2-16-16-16L64 80zM0 96C0 60.7 28.7 32 64 32l448 0c35.3 0 64 28.7 64 64l0 320c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64L0 96zM120 240l176 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-176 0c-13.3 0-24-10.7-24-24s10.7-24 24-24zm256 0l80 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-80 0c-13.3 0-24-10.7-24-24s10.7-24 24-24zM120 336l80 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-80 0c-13.3 0-24-10.7-24-24s10.7-24 24-24zm160 0l176 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-176 0c-13.3 0-24-10.7-24-24s10.7-24 24-24z"})}),Kt=e=>Q("svg",{xmlns:"http://www.w3.org/2000/svg",...e,viewBox:"0 0 640 640",children:Q("path",{d:"M512 128L128.2 128C104.6 128 85.5 147.1 85.5 170.7L85.5 234.6L128.2 234.6L128.2 170.7L512 170.7L512 469.3L362.8 469.3L362.8 512L512.2 512C535.8 512 554.9 492.9 554.9 469.3L554.9 170.7C554.9 147.1 535.6 128 512 128zM85.5 447.6L85.5 511.5L149.4 511.5C149.4 476.2 120.8 447.6 85.5 447.6zM85.5 362.6L85.5 405C144.4 405 192.1 453.1 192.1 512L234.8 512C234.9 429.6 167.9 362.7 85.5 362.6zM277.6 512L320.3 512C319.8 382.5 215 277.7 85.5 277.4L85.5 319.8C191.5 319.6 277.5 406 277.6 512z"})}),Vt=e=>Q("svg",{xmlns:"http://www.w3.org/2000/svg",...e,viewBox:"0 0 640 640",children:Q("path",{d:"M320 576C461.4 576 576 461.4 576 320C576 178.6 461.4 64 320 64C178.6 64 64 178.6 64 320C64 461.4 178.6 576 320 576zM261.5 478C253.8 488.8 238.8 491.2 228 483.5C217.2 475.8 214.8 460.8 222.5 450C244.2 419.8 279.8 400 320 400C360.2 400 395.7 419.8 417.5 450C425.2 460.8 422.8 475.8 412 483.5C401.2 491.2 386.2 488.8 378.5 478C365.4 459.8 344.1 448 320 448C295.9 448 274.6 459.8 261.5 478zM278.1 334.1L270.7 341.5C246.5 365.7 215.4 381.7 181.7 387.3L179.2 387.7C168.3 389.5 158 382.2 156.2 371.3C154.4 360.4 161.7 350.1 172.6 348.3L175.1 347.9C200.6 343.7 224.1 331.5 242.4 313.3L249.8 305.9C257.6 298.1 270.3 298.1 278.1 305.9C285.9 313.7 285.9 326.4 278.1 334.2zM369.2 341.5L361.8 334.1C354 326.3 354 313.6 361.8 305.8C369.6 298 382.3 298 390.1 305.8L397.5 313.2C415.8 331.5 439.3 343.6 464.8 347.8L467.3 348.2C478.2 350 485.6 360.3 483.7 371.2C481.8 382.1 471.6 389.5 460.7 387.6L458.2 387.2C424.5 381.6 393.4 365.6 369.2 341.4z"})}),qt=e=>Q("svg",{xmlns:"http://www.w3.org/2000/svg",...e,viewBox:"0 0 640 640",children:Q("path",{d:"M96 128C78.3 128 64 142.3 64 160C64 177.7 78.3 192 96 192L182.7 192C195 220.3 223.2 240 256 240C288.8 240 317 220.3 329.3 192L544 192C561.7 192 576 177.7 576 160C576 142.3 561.7 128 544 128L329.3 128C317 99.7 288.8 80 256 80C223.2 80 195 99.7 182.7 128L96 128zM96 288C78.3 288 64 302.3 64 320C64 337.7 78.3 352 96 352L342.7 352C355 380.3 383.2 400 416 400C448.8 400 477 380.3 489.3 352L544 352C561.7 352 576 337.7 576 320C576 302.3 561.7 288 544 288L489.3 288C477 259.7 448.8 240 416 240C383.2 240 355 259.7 342.7 288L96 288zM96 448C78.3 448 64 462.3 64 480C64 497.7 78.3 512 96 512L150.7 512C163 540.3 191.2 560 224 560C256.8 560 285 540.3 297.3 512L544 512C561.7 512 576 497.7 576 480C576 462.3 561.7 448 544 448L297.3 448C285 419.7 256.8 400 224 400C191.2 400 163 419.7 150.7 448L96 448z"})}),Yt=e=>Q("svg",{xmlns:"http://www.w3.org/2000/svg",...e,viewBox:"0 0 640 640",children:Q("path",{d:"M96 160L96 400L544 400L544 160L96 160zM32 160C32 124.7 60.7 96 96 96L544 96C579.3 96 608 124.7 608 160L608 400C608 435.3 579.3 464 544 464L96 464C60.7 464 32 435.3 32 400L32 160zM192 512L448 512C465.7 512 480 526.3 480 544C480 561.7 465.7 576 448 576L192 576C174.3 576 160 561.7 160 544C160 526.3 174.3 512 192 512z"})}),zt=e=>Q("svg",{xmlns:"http://www.w3.org/2000/svg",...e,viewBox:"0 0 512 512",children:Q("path",{d:"M255.545 8c-66.269.119-126.438 26.233-170.86 68.685L48.971 40.971C33.851 25.851 8 36.559 8 57.941V192c0 13.255 10.745 24 24 24h134.059c21.382 0 32.09-25.851 16.971-40.971l-41.75-41.75c30.864-28.899 70.801-44.907 113.23-45.273 92.398-.798 170.283 73.977 169.484 169.442C423.236 348.009 349.816 424 256 424c-41.127 0-79.997-14.678-110.63-41.556-4.743-4.161-11.906-3.908-16.368.553L89.34 422.659c-4.872 4.872-4.631 12.815.482 17.433C133.798 479.813 192.074 504 256 504c136.966 0 247.999-111.033 248-247.998C504.001 119.193 392.354 7.755 255.545 8z"})}),Jt=e=>Q("svg",{xmlns:"http://www.w3.org/2000/svg",...e,viewBox:"0 0 640 640",children:Q("path",{d:"M88 256L232 256C241.7 256 250.5 250.2 254.2 241.2C257.9 232.2 255.9 221.9 249 215L202.3 168.3C277.6 109.7 386.6 115 455.8 184.2C530.8 259.2 530.8 380.7 455.8 455.7C380.8 530.7 259.3 530.7 184.3 455.7C174.1 445.5 165.3 434.4 157.9 422.7C148.4 407.8 128.6 403.4 113.7 412.9C98.8 422.4 94.4 442.2 103.9 457.1C113.7 472.7 125.4 487.5 139 501C239 601 401 601 501 501C601 401 601 239 501 139C406.8 44.7 257.3 39.3 156.7 122.8L105 71C98.1 64.2 87.8 62.1 78.8 65.8C69.8 69.5 64 78.3 64 88L64 232C64 245.3 74.7 256 88 256z"})}),Xt={UNKNOWN_ERROR:"Something went wrong",PLAY:"Play",PAUSE:"Pause",TEXT_TRACK_LANGUAGE:"Subtitle language",PLAYBACK_SPEED:"Playback speed",VOLUME:"Volume",QUALITY_LEVEL:"Quality level",ENTER_FULLSCREEN:"Enter fullscreen",EXIT_FULLSCREEN:"Exit fullscreen",ENTER_THEATRE:"Enter theatre mode",EXIT_THEATRE:"Exit theatre mode",PICTURE_IN_PICTURE:"Picture in picture",JUMP_BACK:"Back"};class Qt{constructor(e){this.translations=e}get(e){return this.translations[e]}}const Zt=J({translator:new Qt(Xt),states:{},setState:()=>{},controls:{toggleFullPage:()=>{}}});const en=({playerCore:e,children:t,onControls:n,onStateChanged:r,translator:s})=>{const[i,a]=fe({}),o=Te(((e,t)=>{a((n=>({...n,[e]:t})))}),[]),l=function(e,t){return _e((()=>({toggleFullPage:()=>{e.getContainerElement().classList.contains(Ze(ft).fullPage)?(e.getContainerElement().classList.remove(Ze(ft).fullPage),t("isFullPage",!1)):(e.getContainerElement().classList.add(Ze(ft).fullPage),t("isFullPage",!0))}})),[e,t])}(e,o);return ge((()=>{n(l)}),[l,n]),ge((()=>{r(i)}),[r,i]),Q(Zt.Provider,{value:{states:i,setState:o,controls:l,translator:s},children:t})},tn=()=>{const e=Ee(Zt);if(void 0===e)throw new Error("usePlayerSkinState must be used within a PlayerSkinStateProvider");return e};function nn(){return Ee(Zt).translator}function rn(e){const{states:t,controls:n,translator:r}=tn();return Q(R,{children:!e.playerState?.isFullscreen&&Q("button",{"data-cs-align":"right","data-cs-tooltip":t.isFullPage?r.get("EXIT_THEATRE"):r.get("ENTER_THEATRE"),class:Ze(ft).iconButton,onClick:n.toggleFullPage,children:Q(Yt,{})})})}function sn(e){const{states:t,translator:n}=tn();return Q(R,{children:!t.isFullPage&&Q("button",{"data-cs-align":"right","data-cs-tooltip":e.playerState?.isFullscreen?n.get("EXIT_FULLSCREEN"):n.get("ENTER_FULLSCREEN"),class:Ze(ft).iconButton,onClick:()=>e.playerCore.toggleFullscreen(),children:e.playerState?.isFullscreen?Q(Ft,{}):Q(Bt,{})})})}function an({playbackState:e}){switch(e){case"playing":return Q(Ut,{});case"ended":return Q(zt,{});default:return Q(xt,{})}}function on(e){const t=nn(),n=function(e){return"ended"===e.playerState?.playbackState?e.playerCore.restart.bind(e.playerCore):e.playerCore.togglePlay.bind(e.playerCore)}(e);return e.playerState?.playbackState?Q(R,{children:Q("button",{"data-cs-tooltip":"playing"===e.playerState?.playbackState?t.get("PAUSE"):t.get("PLAY"),className:Ze(ft).iconButton,onClick:n,children:Q(an,{playbackState:e.playerState?.playbackState})})}):null}function ln(e){const t=nn(),{playerCore:n}=e;return Q("button",{"data-cs-tooltip":`${t.get("JUMP_BACK")} 10s`,className:Ze(ft).iconButton,onClick:()=>{n?.seekToTime({diff:-10})},type:"button",children:Q(Jt,{})})}function cn(e){return Q(R,{children:e.playerState?.isCastSupported&&Q("google-cast-launcher",{})})}function un({playerCore:e,seekSeconds:t=10,doubleTapThresholdMS:n=300}){const r=me(null),s=me(null),i=me(0),a=me(null),[o,l]=fe(null);function c(o){let c=null;switch(!0){case o instanceof PointerEvent:c=o.clientX;break;case o instanceof TouchEvent:c=o.changedTouches&&o.changedTouches.length>0?o.changedTouches[0].clientX:null}null!=c&&function(o){const c=Date.now(),u=c-i.current;i.current=c;const d=r.current?.getBoundingClientRect(),h=o-(d?.left??0)<(d?.width??window.innerWidth)/2;u>0&&u<n?(s.current&&(window.clearTimeout(s.current),s.current=null),e.seekToTime({diff:h?-t:t}),a.current&&window.clearTimeout(a.current),a.current=window.setTimeout((()=>{l(null),a.current=null}),600)):s.current=window.setTimeout((()=>{e.togglePlay(),s.current=null}),n)}(c)}return ge((()=>()=>{s.current&&window.clearTimeout(s.current)}),[]),Q("div",{ref:r,class:Ze(ft).clickableOverlay,onPointerUp:e=>c(e),onTouchEnd:e=>c(e),children:a.current&&o&&Q("div",{class:`${Ze(ft).jumpIndicator} ${"left"===o?Ze(ft).left:Ze(ft).right} ${Ze(ft).show}
1`,children:"left"===o?`-${t}s`:`+${t}s`})})}var dn,hn,fn={};function pn({playerCore:e,playerState:t}){const n=Te((t=>{e.setVolume(t/100)}),[e]);return t?Q("div",{class:Ze(fn).volumeControlContainer,children:Q(wt,{staggerPosition:!0,onClick:n,direction:"vertical",value:t.muted?0:100*t.volume,TimestampComponent:({positionPercentage:e})=>Q("div",{children:`${e}%`})})}):null}function gn({playerCore:e,playerState:t}){const n=nn();return t?Q("div",{class:Ze(fn).container,children:[Q(pn,{playerCore:e,playerState:t}),Q("button",{"data-cs-tooltip":n.get("VOLUME"),"data-cs-placement":"right",className:Ze(ft).iconButton,onClick:()=>e.toggleAudio(),children:Q(t?.muted?Gt:$t,{})})]}):null}function mn(e){return Q(R,{children:e.playerState?.isAirplayAvailable&&Q("button",{class:Ze(ft).iconButton,onClick:()=>e.playerCore.toggleAirplay(),children:Q(Ht,{})})})}function _n(e){const t=nn();return Q(R,{children:e.playerState?.isPiPAvailable&&Q("button",{"data-cs-tooltip":t.get("PICTURE_IN_PICTURE"),class:Ze(ft).iconButton,onClick:()=>e.playerCore.togglePiP(),children:Q(jt,{})})})}et(fn,"container",(()=>dn),(e=>dn=e)),et(fn,"volumeControlContainer",(()=>hn),(e=>hn=e)),dn="RM2v4a_container",hn="RM2v4a_volumeControlContainer";var Tn,En,yn,Sn={};function vn(e,t){ge((()=>{function n(n){e.every((e=>e.current&&!e.current.contains(n.target)))&&t(n)}return document.addEventListener("mousedown",n),()=>document.removeEventListener("mousedown",n)}),[t])}et(Sn,"container",(()=>Tn),(e=>Tn=e)),et(Sn,"speedButton",(()=>En),(e=>En=e)),et(Sn,"speedButtonContainer",(()=>yn),(e=>yn=e)),Tn="ywa05W_container",En="ywa05W_speedButton",yn="ywa05W_speedButtonContainer";var bn,In,An={};function Rn(e){return Q("ul",{style:{display:e.isVisible?"initial":"none"},class:Ze(An).container,ref:e.listRef,children:e.items.map(((e,t)=>Q("li",{onClick:e.onClick,className:`${e.isActive?Ze(An).active:""}`,children:e.label},t)))})}et(An,"active",(()=>bn),(e=>bn=e)),et(An,"container",(()=>In),(e=>In=e)),bn="_8PR0XG_active",In="_8PR0XG_container";const Cn=[{value:.75,label:"0.75x"},{value:1,label:"1x"},{value:1.25,label:"1.25x"},{value:1.5,label:"1.5x"},{value:2,label:"2x"}];function kn(e){const[t,n]=fe(!1),r=me(null),s=me(null),i=nn();vn([r,s],Te((()=>n(!1)),[]));const a=function(e){return _e((()=>Cn.map((t=>({label:t.label,onClick:()=>e.playerCore.setPlaybackRate(t.value),isActive:e.playerState?.playbackRate===t.value})))),[e.playerCore,e.playerState?.playbackRate])}(e);return e.playerState?Q("div",{ref:s,className:`cs-position-relative ${Ze(Sn).container}`,children:[Q(Rn,{isVisible:t,listRef:r,items:a}),Q("button",{"data-cs-tooltip":i.get("PLAYBACK_SPEED"),class:Ze(ft).iconButton,style:{width:"auto"},onClick:()=>n(!t),children:`${e.playerState?.playbackRate}x`})]}):null}const Ln="cs-player-preferred-subtitle-language";function On(e){try{e?localStorage.setItem(Ln,e):localStorage.removeItem(Ln)}catch(e){console.warn("Failed to update subtitle language preference:",e)}}function Nn(e,t){const n=me(!1);ge((()=>{const r=t?.textTracks||[];if(r.length>0&&!n.current&&!r.some((e=>e.active))){try{const t=localStorage.getItem(Ln);if(t){const n=r.find((e=>e.language===t));n&&e.setActiveTextTrack(n.id)}}catch(e){console.warn("Failed to retrieve subtitle language preference:",e)}n.current=!0}0===r.length&&(n.current=!1)}),[t?.textTracks,e])}function wn(e){const[t,n]=fe(!1),r=nn(),s=me(null),i=me(null);vn([s,i],Te((()=>n(!1)),[]));const a=function(e){return _e((()=>{const t=(e.playerState?.textTracks||[]).find((e=>e.active)),n=t?t.id:"";if(!e.playerState?.textTracks||0===e.playerState.textTracks.length)return[];const r=e.playerState?.textTracks.map((t=>({isActive:t.active,label:t.label||t.language||`Track ${t.id}`,onClick:()=>{e.playerCore.setActiveTextTrack(t.id),On(t.language||"")}})));return[{label:"Off",isActive:""===n,onClick:()=>{e.playerCore.setActiveTextTrack(""),On("")}},...r]}),[e.playerState?.textTracks,e.playerCore])}(e);return a.length?Q("div",{ref:i,style:{position:"relative"},children:[Q("button",{"data-cs-tooltip":r.get("TEXT_TRACK_LANGUAGE"),class:Ze(ft).iconButton,onClick:()=>n((e=>!e)),children:Q(Wt,{})}),Q(Rn,{isVisible:t,listRef:s,items:a})]}):null}var Pn,Mn,Dn,xn={};function Un(){return Q("span",{className:Ze(xn).loader})}function Bn(e){return Q("div",{className:"cs-flex cs-flex-row cs-flex-align-center cs-flex-justify-center cs-flex-1",children:Q("div",{className:"cs-flex cs-flex-row cs-p-2 cs-bg-black cs-gap-2 cs-flex-align-center cs-flex-justify-center",style:{borderRadius:"4px",opacity:.8},children:e.children})})}function Fn(e){return e.playerState?.isCasting?Q(Bn,{children:[Q(Kt,{width:50,fill:"#14bfdd"}),Q("h4",{class:"cs-color-white cs-m-0",style:{fontSize:"14px"},children:`${e.playerCore.getCastDeviceName()}`}),"buffering"===e.playerState.playbackState&&Q(Un,{})]}):null}function $n(e){return"ready"!==e.playerState?.playbackState?null:Q("button",{className:Ze(ft).bigPlayButton,onClick:()=>e.playerCore.togglePlay(),children:Q(xt,{})})}function Gn({playerCore:e,playerState:t}){const[n,r]=fe(!1),s=me(null),i=me(null),[a,o]=fe(!0);vn([s,i],Te((()=>r(!1)),[]));const l=nn(),c=_e((()=>
1{if(!t)return[];const n=t.qualityLevels.map((n=>({label:n.label??`${n.width}x${n.height}`,onClick:()=>(o(-1===n.id),e.setQualityLevel(n)),isActive:n.id===(a?-1:t.selectedQualityLevel?.id)})));return n}),[t,a,e]);return c.length?Q("div",{ref:i,style:{position:"relative"},children:[Q("button",{"data-cs-tooltip":l.get("QUALITY_LEVEL"),class:Ze(ft).iconButton,onClick:()=>r((e=>!e)),children:Q(qt,{})}),Q(Rn,{isVisible:n,listRef:s,items:c})]}):null}et(xn,"loader",(()=>Pn),(e=>Pn=e)),et(xn,"prixClipFix",(()=>Mn),(e=>Mn=e)),et(xn,"rotate",(()=>Dn),(e=>Dn=e)),Pn="hGEE9q_loader",Mn="hGEE9q_prixClipFix",Dn="hGEE9q_rotate";const Hn={useRabbitButton:!0,useFullPageButton:!0,userActivityTimeoutMS:3e3};function jn({useRabbitButton:e,userActivityTimeoutMS:t,useFullPageButton:n,playerCore:r,onControls:s,onStateChanged:i,translator:a}){const[o,l]=fe(),[c,u]=fe();ge((()=>(r.on("stateChanged",l),r.on("error",u),()=>{u(void 0)})),[r]),Nn(r,o);const d=me(null),[h,f]=fe(!1),p=Te((()=>{f(!0),d.current&&clearTimeout(d.current),d.current=window.setTimeout((()=>{f(!1)}),t||Hn.userActivityTimeoutMS)}),[t]),g=["loading","buffering"].includes(o?.playbackState),m=g||h||["paused","ready","error"].includes(o?.playbackState);return Q(en,{translator:a,onControls:s,onStateChanged:i,playerCore:r,children:Q("div",{class:Ze(ft).skinContainer,onMouseMove:p,onTouchMove:p,style:{opacity:m?1:0},children:[Q(un,{playerCore:r}),Q($n,{playerState:o,playerCore:r}),Q(Fn,{playerState:o,playerCore:r}),!o?.isCasting&&g&&Q("div",{className:"cs-flex cs-flex-row cs-flex-align-center cs-flex-justify-center cs-flex-1",children:Q(Un,{})}),c&&Q(Bn,{children:[Q(Vt,{width:50,fill:"#fff"}),Q("h4",{children:a.get("UNKNOWN_ERROR")})]}),Q("div",{className:Ze(ft).controlsContainer,style:{display:["ready","loading"].includes(o?.playbackState)?"none":"flex"},children:[Q("div",{className:Ze(ft).controlsSection,children:[Q(on,{playerState:o,playerCore:r}),Q(gn,{playerState:o,playerCore:r}),Q(ln,{playerState:o,playerCore:r})]}),Q(Dt,{duration:o?.duration,currentTime:o?.currentTime,onSeek:e=>r.seekToPercentage(e)}),Q("div",{className:Ze(ft).controlsSection,children:[Q(wn,{playerState:o,playerCore:r}),Q(Gn,{playerState:o,playerCore:r}),e&&Q(kn,{playerState:o,playerCore:r}),Q(_n,{playerState:o,playerCore:r}),n&&Q(rn,{playerState:o,playerCore:r}),Q(sn,{playerState:o,playerCore:r}),Q(cn,{playerState:o,playerCore:r}),Q(mn,{playerState:o,playerCore:r})]})]})]})})}class Wn{constructor(e,t){this.player=e,this.controls=null,this.state=null,this.skinContainer=null;const n={...Hn,...t};this.skinContainer=document.createElement("div");e.getContainerElement().appendChild(this.skinContainer),this.skinContainer.classList.add(Ze(ft).container);z(Q(jn,{translator:new Qt({...Xt,...t.translations}),playerCore:e,...n,onControls:e=>{this.controls=e},onStateChanged:e=>{this.state=e}}),this.skinContainer)}destroy(){this.skinContainer&&this.player?.getContainerElement().removeChild(this.skinContainer)}isFullPage(){return!!this.state?.isFullPage}toggleFullPage(){this.controls?.toggleFullPage()}}var Kn=n(13269);class Vn extends r.Controller{constructor(){super(...arguments),this.playerCore=null,this.playerSkin=null,this.keyboardManager=null}resolveSubtitles(){const e=this.element.getAttribute("data-subtitles"),t=null!==e?JSON.parse(e):null;return t?Object.keys(t).map((e=>({language:e,src:t[e]}))):void 0}getPlayerSettings(){const e=this.element.getAttribute("data-src"),t=this.element.getAttribute("data-poster")||void 0,n="false"!==this.element.getAttribute("data-controls"),r=null!==this.element.getAttribute("data-allowPictureInPicture"),s="false"!==this.element.getAttribute("data-skin-useRabbitButton"),i="false"!==this.element.getAttribute("data-skin-useFullPageButton"),a=this.getUserActivityTimeoutMS(),o="false"!==this.element.getAttribute("data-useKeyboardControls");return{src:e,poster:t,useControls:n,allowPictureInPicture:r,useRabbitButton:s,useFullPageButton:i,userActivityTimeoutMS:a,subtitles:this.resolveSubtitles(),useKeyboardControls:o}}setupPlayer(){const{src:e,poster:t,useControls:n,useFullPageButton:r,useRabbitButton:s,userActivityTimeoutMS:i,subtitles:a,useKeyboardControls:o,allowPictureInPicture:l}=this.getPlayerSettings();if(!e)return null;const c={containerElement:this.element,src:e,poster:t,externalTextTracks:a};if(this.playerCore=new _.CSWebPlayerCore({containerElement:this.element,src:e,poster:t,externalTextTracks:a,allowPictureInPicture:l}),n&&(this.playerSkin=new Wn(this.playerCore,{useRabbitButton:s,useFullPageButton:r,userActivityTimeoutMS:i})),o){const e=new Kn.Rr(c.containerElement);c.containerElement.style.outline="none",e.listen([Kn.pI.Space],this.playerCore.togglePlay.bind(this.playerCore)),e.listen([Kn.pI.M],this.playerCore.toggleAudio.bind(this.playerCore)),e.listen([Kn.pI.F],this.playerCore.toggleFullscreen.bind(this.playerCore)),e.listen([Kn.pI.Escape],(()=>{this.playerSkin?.isFullPage()&&this.playerSkin.toggleFullPage(),this.playerCore?.isFullscreen()&&this.playerCore.toggleFullscreen()})),e.listen([Kn.pI.ArrowLeft],(()=>{this.playerCore?.seekToTime({diff:-10})})),e.listen([Kn.pI.ArrowRight],(()=>{this.playerCore?.seekToTime({diff:10})})),this.keyboardManager=e}return this.playerCore}getUserActivityTimeoutMS(){const e=this.element.getAttribute("data-skin-userActivityTimeoutMS");if(null===e)return 3e3;const t=parseInt(e);return isNaN(t)?3e3:t}connect(){const e=this.setupPlayer();e&&e.load()}disconnect(){this.playerCore?.destroy(),this.keyboardManager?.destroy()}}class qn extends r.Controller{connect(){this.element.classList.add("cs-truncated-text");const e=Number(getComputedStyle(this.element,"::after").getPropertyValue("height").slice(0,-2))+1;new ResizeObserver((()=>{const t=Math.round(this.element.clientHeight/e);this.element.style.setProperty("--lines",t.toString())})).observe(this.element)}}class Yn extends r.Controller{constructor(){super(...arguments),this.dialogSelector=null,this.action=null,this.isListeningOnClose=!1}connect(){const e=this.element.getAttribute("data-action");e&&["open","close"].includes(e)?(this.action=e,this.dialogSelector=this.element.getAttribute("data-dialogSelector"),this.dialogSelector?(this.onClick=this.onClick.bind(this),this.element.addEventListener("click",this.onClick)):console.warn("no data-dialogSelector attribute provided")):console.error("missing or invalid action provided")}disconnect(){this.element.removeEventListener("click",this.onClick)}onClick(e){e.preventDefault(),"open"===this.action?this.open():"close"===this.action&&this.close()}open(){if(!this.dialogSelector)return;const e=document.querySelector(this.dialogSelector);e?(this.setupCloseListener(e),e.showModal(),e.open&&this.onOpen(e)):console.warn(`No element found for selector ${this.dialogSelector}`)}close(){if(!this.dialogSelector)return;const e=document.querySelector(this.dialogSelector);e?e.animate([{opacity:0}
1],{duration:200}).finished.then((()=>e.close())):console.warn(`No element found for selector ${this.dialogSelector}`)}setupCloseListener(e){this.isListeningOnClose||(e.addEventListener("close",this.onNativeOnClose.bind(this)),this.isListeningOnClose=!0)}onNativeOnClose(e){this.onClose(e.target)}onOpen(e){}onClose(e){}}if("undefined"!=typeof window&&!("onscrollend"in window)){const mr=new Set;document.addEventListener("touchstart",(e=>{for(let t of e.changedTouches)mr.add(t.identifier)}),{passive:!0}),document.addEventListener("touchend",(e=>{for(let t of e.changedTouches)mr.delete(t.identifier)}),{passive:!0}),document.addEventListener("touchcancel",(e=>{for(let t of e.changedTouches)mr.delete(t.identifier)}),{passive:!0});let _r=new WeakMap;function Tr(e,t,n){let r=e[t];e[t]=function(){let e=Array.prototype.slice.apply(arguments,[0]);r.apply(this,e),e.unshift(r),n.apply(this,e)}}function Er(e,t,n,r){if("scroll"!=t&&"scrollend"!=t)return;let s=this,i=_r.get(s);if(void 0===i){let t=0;i={scrollListener:e=>{clearTimeout(t),t=setTimeout((()=>{mr.size?setTimeout(i.scrollListener,100):(s&&s.dispatchEvent(new Event("scrollend")),t=0)}),100)},listeners:0},e.apply(s,["scroll",i.scrollListener,{passive:!0}]),_r.set(s,i)}i.listeners++}function yr(e,t,n){if("scroll"!=t&&"scrollend"!=t)return;let r=this,s=_r.get(r);void 0!==s&&(--s.listeners>0||(e.apply(r,["scroll",s.scrollListener]),_r.delete(r)))}Tr(Element.prototype,"addEventListener",Er),Tr(window,"addEventListener",Er),Tr(document,"addEventListener",Er),Tr(Element.prototype,"removeEventListener",yr),Tr(window,"removeEventListener",yr),Tr(document,"removeEventListener",yr)}class zn extends r.Controller{connect(){const e=this.element.querySelector("[data-cs-swiper-track]");if(!e)return void console.error("found no track");const t=void 0!==this.element.dataset.autoplay;new Jn(this.element,e,{autoPlay:t})}}class Jn{constructor(e,t,n){this.container=e,this.track=t,this.items=[],this.isDragging=!1,this.startX=0,this.autoPlay=!1,this.items=Array.from(this.track.querySelectorAll("[data-cs-swiper-item]")),this.prevArrow=document.createElement("span"),this.prevArrow.innerHTML=Kn.Q$.angle_left,this.prevArrow.className="swiper-arrow previous",this.prevArrow.addEventListener("click",this.onPrevClick.bind(this)),this.container.appendChild(this.prevArrow),this.nextArrow=document.createElement("span"),this.nextArrow.innerHTML=Kn.Q$.angle_right,this.nextArrow.className="swiper-arrow -right next",this.nextArrow.addEventListener("click",this.onNextClick.bind(this)),this.container.appendChild(this.nextArrow),this.autoPlay=n.autoPlay,this.initEvents(),this.autoPlay&&this.setupAutoPlay(),this.updateUi()}setupAutoPlay(){this.autoPlay&&(this.autoPlayInterval&&clearInterval(this.autoPlayInterval),this.autoPlayInterval=setInterval((()=>{this.findNextItem()?this.onNextClick():this.scrollToElement(this.items[0])}),6e3))}initEvents(){this.container.addEventListener("mousedown",this.startDrag.bind(this)),this.container.addEventListener("mouseleave",this.onMouseLeave.bind(this)),this.container.addEventListener("mouseup",this.endDrag.bind(this)),this.container.addEventListener("mousemove",this.handleDrag.bind(this)),this.container.addEventListener("mouseenter",this.onMouseEnter.bind(this)),this.container.addEventListener("dragstart",(e=>e.preventDefault())),this.container.addEventListener("focusin",this.onMouseEnter.bind(this)),this.container.addEventListener("focusout",this.onMouseLeave.bind(this)),this.track.addEventListener("scrollend",this.onScrollEnd.bind(this))}disableItemsClick(){this.items.forEach((e=>{e.style.pointerEvents="none"}))}enableItemsClick(){this.items.forEach((e=>{e.style.pointerEvents="initial"}))}onMouseEnter(){clearInterval(this.autoPlayInterval)}onMouseLeave(){this.setupAutoPlay(),this.endDrag()}onScrollEnd(){this.updateUi()}scrollToIndex(e){const t=this.items[e];t&&this.scrollToElement(t)}scrollToElement(e){this.setupAutoPlay(),this.track.scrollTo({left:e.offsetLeft})}updateUi(){const e=0===this.track.scrollLeft?"none":"flex";this.prevArrow.style.display=e;const t=Math.ceil(this.track.scrollLeft+this.track.clientWidth)===this.track.scrollWidth?"
1none":"flex";this.nextArrow.style.display=t}findNextItem(){const e=this.items.filter((e=>e.offsetLeft>this.track.scrollLeft&&e.offsetLeft<this.track.scrollLeft+this.track.clientWidth));return e.length>1?e[1]:this.items.find((e=>e.offsetLeft+e.clientWidth>this.track.scrollLeft+this.track.clientWidth))}findPrevItem(){const e=this.items.filter((e=>e.offsetLeft+e.clientWidth<this.track.scrollLeft));if(e.length>0)return e[e.length-1]}onNextClick(){const e=this.findNextItem();e&&this.scrollToElement(e)}onPrevClick(){const e=this.findPrevItem();e?this.scrollToElement(e):this.track.scrollTo({left:0})}startDrag(e){this.isDragging=!0,this.track.classList.add("dragging"),setTimeout((()=>{this.isDragging&&this.disableItemsClick()}),200),this.startX=e.pageX-this.track.offsetLeft}endDrag(){this.isDragging=!1,this.enableItemsClick(),this.track.classList.remove("dragging"),this.track.scrollLeft=this.track.scrollLeft+0}handleDrag(e){if(!this.isDragging)return;e.preventDefault();const t=e.pageX-this.track.offsetLeft-this.startX;if(t>150){if(!this.findPrevItem())return;return this.isDragging=!1,void this.onPrevClick()}if(t<-150){if(!this.findNextItem())return;return this.isDragging=!1,void this.onNextClick()}this.track.scrollLeft=this.track.scrollLeft-t}}const Xn="cs-image-modal-gallery",Qn="cs-image-modal-gallery__dialog",Zn="cs-image-modal-gallery__dialog--visible",er="cs-image-modal-gallery__content",tr="cs-image-modal-gallery__image-container",nr="cs-image-modal-gallery__image-wrapper",rr="cs-image-modal-gallery__nav-arrow",sr="cs-image-modal-gallery__nav-arrow--left",ir="cs-image-modal-gallery__nav-arrow--right",ar="cs-image-modal-gallery__nav-arrow--hidden",or="cs-image-modal-gallery__info",lr="cs-image-modal-gallery__caption",cr="cs-image-modal-gallery__actions",ur="cs-image-modal-gallery__download",dr="cs-image-modal-gallery__previews",hr="cs-image-modal-gallery__preview-box",fr="cs-image-modal-gallery__preview-box--interactive",pr="cs-image-modal-gallery__close-btn";class gr extends r.Controller{constructor(){super(...arguments),this.CONTENT_PADDING=50,this.IMAGE_PADDING=40,this.FADE_DURATION=180,this.currentIndex=-1,this.resize=()=>this.layout()}connect(){this.itemTargets.forEach(((e,t)=>{this.initializeItem(e,t)}))}disconnect(){this.cleanup(),this.dialogWrapper?.remove()}initializeItem(e,t){e.addEventListener("click",(()=>this.openAtIndex(t)))}itemTargetConnected(e){const t=this.itemTargets.indexOf(e);-1!==t&&this.initializeItem(e,t)}openAtIndex(e){e<0||e>=this.itemTargets.length||(this.currentIndex=e,this.ensureDialogExists(),this.updateDialogContent(),this.showDialog())}ensureDialogExists(){this.dialog||(this.dialogWrapper=document.createElement("div"),this.dialogWrapper.className=Xn,document.body.appendChild(this.dialogWrapper),this.dialog=this.buildDialog(),this.dialogWrapper.appendChild(this.dialog),this.cacheDialogRefs())}buildDialog(){const e=document.createElement("dialog");return e.className=Qn,e.innerHTML=`\n      <div class="${er}">\n        <div class="${tr}">\n          <div class="${nr}"></div>\n          \n          <button class="${rr} ${sr}" type="button" aria-label="Previous image">\n            ${this.getSvgIcon("fa-left")}\n          </button>\n          \n          <button class="${rr} ${ir}" type="button" aria-label="Next image">\n            ${this.getSvgIcon("fa-right")}\n          </button>\n        </div>\n        \n        <div class="${or}">\n          <div class="${lr}"></div>\n          \n          <div class="${cr}">\n            <div class="${dr}"></div>\n          </div>\n        </div>\n        \n        <button class="${pr}" type="button" aria-label="Close">\n          ${this.getSvgIcon("fa-close")}\n        </button>\n      </div>\n    `,this.attachEventListeners(e),e}attachEventListeners(e){e.addEventListener("click",(t=>{const n=e.querySelector(`.${er}`);n&&!n.contains(t.target)&&this.close()})),e.querySelector(`.${pr}`)?.addEventListener("click",(()=>{this.close()})),e.querySelector(`.${sr}`)?.addEventListener("click",(e=>{e.stopPropagation(),this.prev()})),e.querySelector(`.${ir}`)?.addEventListener("click",(e=>{e.stopPropagation(),this.next()}))}cacheDialogRefs(){this.dialog&&(this.imageContainer=this.dialog.querySelector(`.${tr}`)??void 0,this.imageWrapper=this.dialog.querySelector(`.${nr}`)??void 0,this.infoSection=this.dialog.querySelector(`.${or}`)??void 0,this.leftArrow=this.dialog.querySelector(`.${sr}`)??void 0,this.rightArrow=this.dialog.querySelector(`.${ir}`)??void 0)}updateDialogContent(){if(!this.dialog||!this.imageWrapper)return;const e=this.itemTargets[this.currentIndex];if(!e)return;const t=e.dataset.src||"",n=e.dataset.alt||"",r=this.readSlots(e);n&&this.dialog.setAttribute("aria-label",n),this.imageWrapper.innerHTML=`\n      <div style="position: relative;">\n        <img src="${(0,Kn.ih)(t)}" alt="${(0,Kn.ih)(n)}" loading="eager" />\n        ${r.imageHtml??""}\n      </div>\n    `;const s=this.dialog.querySelector(`.${lr}`);s&&(s.innerHTML=r.contentHtml??""),this.buildActions(e),this.setupImageLoadHandler()}buildActions(e){const t=this.dialog?.querySelector(`.${cr}`);if(!t)return;const n=e.dataset.downloadUrl;if(t.replaceChildren(),n){const e=document.createElement("a");e.href=n,e.className=ur,e.target="_blank",e.download="",e.innerHTML=this.getSvgIcon("fa-download"),t.appendChild(e)}const r=document.createElement("div");r.className=dr,t.appendChild(r),this.buildPreviews(r)}buildPreviews(e){e.innerHTML="";const t=[this.itemTargets[this.currentIndex+1],this.itemTargets[this.currentIndex+2]];t.forEach(((t,n)=>{t&&this.addPreviewBox(e,t,100*n)}));const n=Math.max(0,this.itemTargets.length-this.currentIndex-1-t.filter(Boolean).length);if(n>0){const t=document.createElement("div");t.className=hr,t.innerHTML=`<span>+${n}</span>`,e.appendChild(t)}}addPreviewBox(e,t,n){const r=t.dataset.src;if(!r)return;const s=document.createElement("div");s.className=`${hr} ${fr}`,s.innerHTML=`<img src="${(0,Kn.ih)(r)}" alt="Next image preview" />`;const i=this.itemTargets.indexOf(t);s.addEventListener("click",(e=>{e.stopPropagation();const t=this.currentIndex;this.currentIndex=i,this.updateDialogContent(),this.layout(),this.updateArrows(),this.dialog&&this.onChange(this.dialog,this.currentIndex,t)})),e.appendChild(s),this.animateIn(s,n)}setupImageLoadHandler(){const e=this.imageWrapper?.querySelector("img");this.imageLoadHandler&&e&&e.removeEventListener("load",this.imageLoadHandler),e&&!e.complete&&(this.imageLoadHandler=()=>this.layout(),e.addEventListener("load",this.imageLoadHandler))}showDialog(){this.dialog&&!this.dialog.open&&(this.dialog.style.display="",this.dialog.showModal(),requestAnimationFrame((()=>{this.dialog.classList.add(Zn)})),this.dialog.focus(),this.bindGlobalListeners(),this.layout(),this.updateArrows(),this.onOpen(this.dialog,this.currentIndex))}close(){this.dialog&&this.dialog.open&&(this.closeTimeout&&clearTimeout(this.closeTimeout),this.dialog.classList.remove(Zn),this.closeTimeout=window.setTimeout((()=>{this.dialog&&(this.dialog.close(),this.dialog.style.display="none",this.onClose(this.dialog,this.currentIndex)),this.unbindGlobalListeners(),this.closeTimeout=void 0}),this.FADE_DURATION))}next(){const e=this.currentIndex+1;if(e<this.itemTargets.length){const t=this.currentIndex;this.currentIndex=e,this.updateDialogContent(),this.layout(),this.updateArrows(),this.dialog&&this.onChange(this.dialog,this.currentIndex,t)}}prev(){const e=this.currentIndex-1;if(e>=0){const t=this.currentIndex;this.currentIndex=e,this.updateDialogContent(),this.layout(),this.updateArrows(),this.dialog&&this.onChange(this.dialog,this.currentIndex,t)}}layout(){if(!(this.dialog&&this.imageContainer&&this.infoSection&&this.imageWrapper))return;const e=this.imageWrapper.querySelector("img");if(!e)return;const t=this.dialog.clientHeight,n=this.infoSection.offsetHeight+this.CONTENT_PADDING;this.imageContainer.style.height=t-n+"px";const r=this.imageWrapper.parentElement?.getBoundingClientRect(),s=(r?.width??this.imageWrapper.offsetWidth)-this.IMAGE_PADDING,i=(r?.height??this.imageWrapper.offsetHeight)-this.IMAGE_PADDING,a=Math.min(s/e.naturalWi
1dth,i/e.naturalHeight,1);Object.assign(this.imageWrapper.style,{width:`${Math.round(e.naturalWidth*a)}px`,height:`${Math.round(e.naturalHeight*a)}px`,margin:"0 auto"})}updateArrows(){this.leftArrow?.classList.toggle(ar,this.currentIndex<=0),this.rightArrow?.classList.toggle(ar,this.currentIndex>=this.itemTargets.length-1)}animateIn(e,t){Object.assign(e.style,{transform:"translateY(20px)",opacity:"0",transition:"transform .3s ease-out, opacity .3s ease-out"}),requestAnimationFrame((()=>setTimeout((()=>{e.style.transform="translateY(0)",e.style.opacity="1"}),t)))}bindGlobalListeners(){this.dialog&&(this.keyboardManager=new Kn.Rr(this.dialog),this.keyboardManager.listen([Kn.pI.Escape],(()=>this.close())),this.keyboardManager.listen([Kn.pI.ArrowRight],(()=>this.next())),this.keyboardManager.listen([Kn.pI.ArrowDown],(()=>this.next())),this.keyboardManager.listen([Kn.pI.ArrowLeft],(()=>this.prev())),this.keyboardManager.listen([Kn.pI.ArrowUp],(()=>this.prev())),window.addEventListener("resize",this.resize))}unbindGlobalListeners(){this.keyboardManager?.destroy(),this.keyboardManager=void 0,window.removeEventListener("resize",this.resize)}cleanup(){this.closeTimeout&&clearTimeout(this.closeTimeout);const e=this.imageWrapper?.querySelector("img");e&&this.imageLoadHandler&&e.removeEventListener("load",this.imageLoadHandler),this.unbindGlobalListeners()}readSlots(e){const t=t=>e.querySelector(`template[data-slot="${t}"]`)?.innerHTML?.trim();return{imageHtml:t("image"),contentHtml:t("content")}}getSvgIcon(e){return Kn.Q$[e]}onOpen(e,t){}onClose(e,t){}onChange(e,t,n){}}gr.targets=["item"]},52891(e,t,n){"use strict";n.r(t),n.d(t,{Application:()=>te,AttributeObserver:()=>S,Context:()=>F,Controller:()=>de,ElementObserver:()=>y,IndexedMultimap:()=>C,Multimap:()=>R,SelectorObserver:()=>k,StringMapObserver:()=>L,TokenListObserver:()=>O,ValueListObserver:()=>N,add:()=>v,defaultSchema:()=>Z,del:()=>b,fetch:()=>I,prune:()=>A});class r{constructor(e,t,n){this.eventTarget=e,this.eventName=t,this.eventOptions=n,this.unorderedBindings=new Set}connect(){this.eventTarget.addEventListener(this.eventName,this,this.eventOptions)}disconnect(){this.eventTarget.removeEventListener(this.eventName,this,this.eventOptions)}bindingConnected(e){this.unorderedBindings.add(e)}bindingDisconnected(e){this.unorderedBindings.delete(e)}handleEvent(e){const t=function(e){if("immediatePropagationStopped"in e)return e;{const{stopImmediatePropagation:t}=e;return Object.assign(e,{immediatePropagationStopped:!1,stopImmediatePropagation(){this.immediatePropagationStopped=!0,t.call(this)}})}}(e);for(const e of this.bindings){if(t.immediatePropagationStopped)break;e.handleEvent(t)}}hasBindings(){return this.unorderedBindings.size>0}get bindings(){return Array.from(this.unorderedBindings).sort(((e,t)=>{const n=e.index,r=t.index;return n<r?-1:n>r?1:0}))}}class s{constructor(e){this.application=e,this.eventListenerMaps=new Map,this.started=!1}start(){this.started||(this.started=!0,this.eventListeners.forEach((e=>e.connect())))}stop(){this.started&&(this.started=!1,this.eventListeners.forEach((e=>e.disconnect())))}get eventListeners(){return Array.from(this.eventListenerMaps.values()).reduce(((e,t)=>e.concat(Array.from(t.values()))),[])}bindingConnected(e){this.fetchEventListenerForBinding(e).bindingConnected(e)}bindingDisconnected(e,t=!1){this.fetchEventListenerForBinding(e).bindingDisconnected(e),t&&this.clearEventListenersForBinding(e)}handleError(e,t,n={}){this.application.handleError(e,`Error ${t}`,n)}clearEventListenersForBinding(e){const t=this.fetchEventListenerForBinding(e);t.hasBindings()||(t.disconnect(),this.removeMappedEventListenerFor(e))}removeMappedEventListenerFor(e){const{eventTarget:t,eventName:n,eventOptions:r}=e,s=this.fetchEventListenerMapForEventTarget(t),i=this.cacheKey(n,r);s.delete(i),0==s.size&&this.eventListenerMaps.delete(t)}fetchEventListenerForBinding(e){const{eventTarget:t,eventName:n,eventOptions:r}=e;return this.fetchEventListener(t,n,r)}fetchEventListener(e,t,n){const r=this.fetchEventListenerMapForEventTarget(e),s=this.cacheKey(t,n);let i=r.get(s);
1return i||(i=this.createEventListener(e,t,n),r.set(s,i)),i}createEventListener(e,t,n){const s=new r(e,t,n);return this.started&&s.connect(),s}fetchEventListenerMapForEventTarget(e){let t=this.eventListenerMaps.get(e);return t||(t=new Map,this.eventListenerMaps.set(e,t)),t}cacheKey(e,t){const n=[e];return Object.keys(t).sort().forEach((e=>{n.push(`${t[e]?"":"!"}${e}`)})),n.join(":")}}const i={stop:({event:e,value:t})=>(t&&e.stopPropagation(),!0),prevent:({event:e,value:t})=>(t&&e.preventDefault(),!0),self:({event:e,value:t,element:n})=>!t||n===e.target},a=/^(?:(?:([^.]+?)\+)?(.+?)(?:\.(.+?))?(?:@(window|document))?->)?(.+?)(?:#([^:]+?))(?::(.+))?$/;function o(e){return"window"==e?window:"document"==e?document:void 0}function l(e){return e.replace(/(?:[_-])([a-z0-9])/g,((e,t)=>t.toUpperCase()))}function c(e){return l(e.replace(/--/g,"-").replace(/__/g,"_"))}function u(e){return e.charAt(0).toUpperCase()+e.slice(1)}function d(e){return e.replace(/([A-Z])/g,((e,t)=>`-${t.toLowerCase()}`))}function h(e){return null!=e}function f(e,t){return Object.prototype.hasOwnProperty.call(e,t)}const p=["meta","ctrl","alt","shift"];class g{constructor(e,t,n,r){this.element=e,this.index=t,this.eventTarget=n.eventTarget||e,this.eventName=n.eventName||function(e){const t=e.tagName.toLowerCase();if(t in m)return m[t](e)}(e)||_("missing event name"),this.eventOptions=n.eventOptions||{},this.identifier=n.identifier||_("missing identifier"),this.methodName=n.methodName||_("missing method name"),this.keyFilter=n.keyFilter||"",this.schema=r}static forToken(e,t){return new this(e.element,e.index,function(e){const t=e.trim().match(a)||[];let n=t[2],r=t[3];return r&&!["keydown","keyup","keypress"].includes(n)&&(n+=`.${r}`,r=""),{eventTarget:o(t[4]),eventName:n,eventOptions:t[7]?(s=t[7],s.split(":").reduce(((e,t)=>Object.assign(e,{[t.replace(/^!/,"")]:!/^!/.test(t)})),{})):{},identifier:t[5],methodName:t[6],keyFilter:t[1]||r};var s}(e.content),t)}toString(){const e=this.keyFilter?`.${this.keyFilter}`:"",t=this.eventTargetName?`@${this.eventTargetName}`:"";return`${this.eventName}${e}${t}->${this.identifier}#${this.methodName}`}shouldIgnoreKeyboardEvent(e){if(!this.keyFilter)return!1;const t=this.keyFilter.split("+");if(this.keyFilterDissatisfied(e,t))return!0;const n=t.filter((e=>!p.includes(e)))[0];return!!n&&(f(this.keyMappings,n)||_(`contains unknown key filter: ${this.keyFilter}`),this.keyMappings[n].toLowerCase()!==e.key.toLowerCase())}shouldIgnoreMouseEvent(e){if(!this.keyFilter)return!1;const t=[this.keyFilter];return!!this.keyFilterDissatisfied(e,t)}get params(){const e={},t=new RegExp(`^data-${this.identifier}-(.+)-param$`,"i");for(const{name:n,value:r}of Array.from(this.element.attributes)){const s=n.match(t),i=s&&s[1];i&&(e[l(i)]=T(r))}return e}get eventTargetName(){return(e=this.eventTarget)==window?"window":e==document?"document":void 0;var e}get keyMappings(){return this.schema.keyMappings}keyFilterDissatisfied(e,t){const[n,r,s,i]=p.map((e=>t.includes(e)));return e.metaKey!==n||e.ctrlKey!==r||e.altKey!==s||e.shiftKey!==i}}const m={a:()=>"click",button:()=>"click",form:()=>"submit",details:()=>"toggle",input:e=>"submit"==e.getAttribute("type")?"click":"input",select:()=>"change",textarea:()=>"input"};function _(e){throw new Error(e)}function T(e){try{return JSON.parse(e)}catch(t){return e}}class E{constructor(e,t){this.context=e,this.action=t}get index(){return this.action.index}get eventTarget(){return this.action.eventTarget}get eventOptions(){return this.action.eventOptions}get identifier(){return this.context.identifier}handleEvent(e){const t=this.prepareActionEvent(e);this.willBeInvokedByEvent(e)&&this.applyEventModifiers(t)&&this.invokeWithEvent(t)}get eventName(){return this.action.eventName}get method(){const e=this.controller[this.methodName];if("function"==typeof e)return e;throw new Error(`Action "${this.action}" references undefined method "${this.methodName}"`)}applyEventModifiers(e){const{element:t}=this.action,{actionDescriptorFilters:n}=this.context.application,{controller:r}=this.context;let s=!0;for(const[i,a]of Object.entries(this.eventOptions))if(i in n){const o=n[i];s=s&&o({name:i,value:a,event:e,element:t,controller:r})}return s}prepareActionEvent(e){return Object.assign(e,{params:this.action.params})}invokeWithEvent(e){const{target:t,currentTarget:n}=e;try{this.method.call(this.controller,e),this.context.logDebugActivity(this.methodName,{event:e,target:t,currentTarget:n,action:this.methodName})}catch(t){const{identifier:n,controller:r,element:s,index:i}=this,a={identifier:n,controller:r,element:s,index:i,event:e};this.context.handleError(t,`invoking action "${this.action}"`,a)}}willBeInvokedByEvent(e){const t=e.target;return!(e instanceof KeyboardEvent&&this.action.shouldIgnoreKeyboardEvent(e))&&(!(e instanceof MouseEvent&&this.action.shouldIgnoreMouseEvent(e))&&(this.element===t||(t instanceof Element&&this.element.contains(t)?this.scope.containsElement(t):this.scope.containsElement(this.action.element))))}get controller(){return this.context.controller}get methodName(){return this.action.methodName}
1get element(){return this.scope.element}get scope(){return this.context.scope}}class y{constructor(e,t){this.mutationObserverInit={attributes:!0,childList:!0,subtree:!0},this.element=e,this.started=!1,this.delegate=t,this.elements=new Set,this.mutationObserver=new MutationObserver((e=>this.processMutations(e)))}start(){this.started||(this.started=!0,this.mutationObserver.observe(this.element,this.mutationObserverInit),this.refresh())}pause(e){this.started&&(this.mutationObserver.disconnect(),this.started=!1),e(),this.started||(this.mutationObserver.observe(this.element,this.mutationObserverInit),this.started=!0)}stop(){this.started&&(this.mutationObserver.takeRecords(),this.mutationObserver.disconnect(),this.started=!1)}refresh(){if(this.started){const e=new Set(this.matchElementsInTree());for(const t of Array.from(this.elements))e.has(t)||this.removeElement(t);for(const t of Array.from(e))this.addElement(t)}}processMutations(e){if(this.started)for(const t of e)this.processMutation(t)}processMutation(e){"attributes"==e.type?this.processAttributeChange(e.target,e.attributeName):"childList"==e.type&&(this.processRemovedNodes(e.removedNodes),this.processAddedNodes(e.addedNodes))}processAttributeChange(e,t){this.elements.has(e)?this.delegate.elementAttributeChanged&&this.matchElement(e)?this.delegate.elementAttributeChanged(e,t):this.removeElement(e):this.matchElement(e)&&this.addElement(e)}processRemovedNodes(e){for(const t of Array.from(e)){const e=this.elementFromNode(t);e&&this.processTree(e,this.removeElement)}}processAddedNodes(e){for(const t of Array.from(e)){const e=this.elementFromNode(t);e&&this.elementIsActive(e)&&this.processTree(e,this.addElement)}}matchElement(e){return this.delegate.matchElement(e)}matchElementsInTree(e=this.element){return this.delegate.matchElementsInTree(e)}processTree(e,t){for(const n of this.matchElementsInTree(e))t.call(this,n)}elementFromNode(e){if(e.nodeType==Node.ELEMENT_NODE)return e}elementIsActive(e){return e.isConnected==this.element.isConnected&&this.element.contains(e)}addElement(e){this.elements.has(e)||this.elementIsActive(e)&&(this.elements.add(e),this.delegate.elementMatched&&this.delegate.elementMatched(e))}removeElement(e){this.elements.has(e)&&(this.elements.delete(e),this.delegate.elementUnmatched&&this.delegate.elementUnmatched(e))}}class S{constructor(e,t,n){this.attributeName=t,this.delegate=n,this.elementObserver=new y(e,this)}get element(){return this.elementObserver.element}get selector(){return`[${this.attributeName}]`}start(){this.elementObserver.start()}pause(e){this.elementObserver.pause(e)}stop(){this.elementObserver.stop()}refresh(){this.elementObserver.refresh()}get started(){return this.elementObserver.started}matchElement(e){return e.hasAttribute(this.attributeName)}matchElementsInTree(e){const t=this.matchElement(e)?[e]:[],n=Array.from(e.querySelectorAll(this.selector));return t.concat(n)}elementMatched(e){this.delegate.elementMatchedAttribute&&this.delegate.elementMatchedAttribute(e,this.attributeName)}elementUnmatched(e){this.delegate.elementUnmatchedAttribute&&this.delegate.elementUnmatchedAttribute(e,this.attributeName)}elementAttributeChanged(e,t){this.delegate.elementAttributeValueChanged&&this.attributeName==t&&this.delegate.elementAttributeValueChanged(e,t)}}function v(e,t,n){I(e,t).add(n)}function b(e,t,n){I(e,t).delete(n),A(e,t)}function I(e,t){let n=e.get(t);return n||(n=new Set,e.set(t,n)),n}function A(e,t){const n=e.get(t);null!=n&&0==n.size&&e.delete(t)}class R{constructor(){this.valuesByKey=new Map}get keys(){return Array.from(this.valuesByKey.keys())}get values(){return Array.from(this.valuesByKey.values()).reduce(((e,t)=>e.concat(Array.from(t))),[])}get size(){return Array.from(this.valuesByKey.values()).reduce(((e,t)=>e+t.size),0)}add(e,t){v(this.valuesByKey,e,t)}delete(e,t){b(this.valuesByKey,e,t)}has(e,t){const n=this.valuesByKey.get(e);return null!=n&&n.has(t)}hasKey(e){return this.valuesByKey.has(e)}hasValue(e){return Array.from(this.valuesByKey.values()).some((t=>t.has(e)))}getValuesForKey(e){const t=this.valuesByKey.get(e);return t?Array.from(t):[]}getKeysForValue(e){return Array.from(this.valuesByKey).filter((([t,n])=>n.has(e))).map((([e,t])=>e))}}class C extends R{constructor(){super(),this.keysByValue=new Map}get values(){return Array.from(this.keysByValue.keys())}add(e,t){super.add(e,t),v(this.keysByValue,t,e)}delete(e,t){super.delete(e,t),b(this.keysByValue,t,e)}hasValue(e){return this.keysByValue.has(e)}getKeysForValue(e){const t=this.keysByValue.get(e);return t?Array.from(t):[]}}class k{constructor(e,t,n,r){this._selector=t,this.details=r,this.elementObserver=new y(e,this),this.delegate=n,this.matchesByElement=new R}get started(){return this.elementObserver.started}get selector(){return this._selector}set selector(e){this._selector=e,this.refresh()}start(){this.elementObserver.start()}pause(e){this.elementObserver.pause(e)}stop(){this.elementObserver.stop()}refresh(){this.elementObserver.refresh()}
1get element(){return this.elementObserver.element}matchElement(e){const{selector:t}=this;if(t){const n=e.matches(t);return this.delegate.selectorMatchElement?n&&this.delegate.selectorMatchElement(e,this.details):n}return!1}matchElementsInTree(e){const{selector:t}=this;if(t){const n=this.matchElement(e)?[e]:[],r=Array.from(e.querySelectorAll(t)).filter((e=>this.matchElement(e)));return n.concat(r)}return[]}elementMatched(e){const{selector:t}=this;t&&this.selectorMatched(e,t)}elementUnmatched(e){const t=this.matchesByElement.getKeysForValue(e);for(const n of t)this.selectorUnmatched(e,n)}elementAttributeChanged(e,t){const{selector:n}=this;if(n){const t=this.matchElement(e),r=this.matchesByElement.has(n,e);t&&!r?this.selectorMatched(e,n):!t&&r&&this.selectorUnmatched(e,n)}}selectorMatched(e,t){this.delegate.selectorMatched(e,t,this.details),this.matchesByElement.add(t,e)}selectorUnmatched(e,t){this.delegate.selectorUnmatched(e,t,this.details),this.matchesByElement.delete(t,e)}}class L{constructor(e,t){this.element=e,this.delegate=t,this.started=!1,this.stringMap=new Map,this.mutationObserver=new MutationObserver((e=>this.processMutations(e)))}start(){this.started||(this.started=!0,this.mutationObserver.observe(this.element,{attributes:!0,attributeOldValue:!0}),this.refresh())}stop(){this.started&&(this.mutationObserver.takeRecords(),this.mutationObserver.disconnect(),this.started=!1)}refresh(){if(this.started)for(const e of this.knownAttributeNames)this.refreshAttribute(e,null)}processMutations(e){if(this.started)for(const t of e)this.processMutation(t)}processMutation(e){const t=e.attributeName;t&&this.refreshAttribute(t,e.oldValue)}refreshAttribute(e,t){const n=this.delegate.getStringMapKeyForAttribute(e);if(null!=n){this.stringMap.has(e)||this.stringMapKeyAdded(n,e);const r=this.element.getAttribute(e);if(this.stringMap.get(e)!=r&&this.stringMapValueChanged(r,n,t),null==r){const t=this.stringMap.get(e);this.stringMap.delete(e),t&&this.stringMapKeyRemoved(n,e,t)}else this.stringMap.set(e,r)}}stringMapKeyAdded(e,t){this.delegate.stringMapKeyAdded&&this.delegate.stringMapKeyAdded(e,t)}stringMapValueChanged(e,t,n){this.delegate.stringMapValueChanged&&this.delegate.stringMapValueChanged(e,t,n)}stringMapKeyRemoved(e,t,n){this.delegate.stringMapKeyRemoved&&this.delegate.stringMapKeyRemoved(e,t,n)}get knownAttributeNames(){return Array.from(new Set(this.currentAttributeNames.concat(this.recordedAttributeNames)))}get currentAttributeNames(){return Array.from(this.element.attributes).map((e=>e.name))}get recordedAttributeNames(){return Array.from(this.stringMap.keys())}}class O{constructor(e,t,n){this.attributeObserver=new S(e,t,this),this.delegate=n,this.tokensByElement=new R}get started(){return this.attributeObserver.started}start(){this.attributeObserver.start()}pause(e){this.attributeObserver.pause(e)}stop(){this.attributeObserver.stop()}refresh(){this.attributeObserver.refresh()}get element(){return this.attributeObserver.element}get attributeName(){return this.attributeObserver.attributeName}elementMatchedAttribute(e){this.tokensMatched(this.readTokensForElement(e))}elementAttributeValueChanged(e){const[t,n]=this.refreshTokensForElement(e);this.tokensUnmatched(t),this.tokensMatched(n)}elementUnmatchedAttribute(e){this.tokensUnmatched(this.tokensByElement.getValuesForKey(e))}tokensMatched(e){e.forEach((e=>this.tokenMatched(e)))}tokensUnmatched(e){e.forEach((e=>this.tokenUnmatched(e)))}tokenMatched(e){this.delegate.tokenMatched(e),this.tokensByElement.add(e.element,e)}tokenUnmatched(e){this.delegate.tokenUnmatched(e),this.tokensByElement.delete(e.element,e)}refreshTokensForElement(e){const t=this.tokensByElement.getValuesForKey(e),n=this.readTokensForElement(e),r=function(e,t){const n=Math.max(e.length,t.length);return Array.from({length:n},((n,r)=>[e[r],t[r]]))}(t,n).findIndex((([e,t])=>{return r=t,!((n=e)&&r&&n.index==r.index&&n.content==r.content);var n,r}));return-1==r?[[],[]]:[t.slice(r),n.slice(r)]}readTokensForElement(e){const t=this.attributeName;return function(e,t,n){return e.trim().split(/\s+/).filter((e=>e.length)).map(((e,r)=>({element:t,attributeName:n,content:e,index:r})))}(e.getAttribute(t)||"",e,t)}}class N{constructor(e,t,n){this.tokenListObserver=new O(e,t,this),this.delegate=n,this.parseResultsByToken=new WeakMap,this.valuesByTokenByElement=new WeakMap}get started(){return this.tokenListObserver.started}start(){this.tokenListObserver.start()}stop(){this.tokenListObserver.stop()}refresh(){this.tokenListObserver.refresh()}
vendor: 1,657 bytes, line 1
1get element(){return this.tokenListObserver.element}get attributeName(){return this.tokenListObserver.attributeName}tokenMatched(e){const{element:t}=e,{value:n}=this.fetchParseResultForToken(e);n&&(this.fetchValuesByTokenForElement(t).set(e,n),this.delegate.elementMatchedValue(t,n))}tokenUnmatched(e){const{element:t}=e,{value:n}=this.fetchParseResultForToken(e);n&&(this.fetchValuesByTokenForElement(t).delete(e),this.delegate.elementUnmatchedValue(t,n))}fetchParseResultForToken(e){let t=this.parseResultsByToken.get(e);return t||(t=this.parseToken(e),this.parseResultsByToken.set(e,t)),t}fetchValuesByTokenForElement(e){let t=this.valuesByTokenByElement.get(e);return t||(t=new Map,this.valuesByTokenByElement.set(e,t)),t}parseToken(e){try{return{value:this.delegate.parseValueForToken(e)}}catch(e){return{error:e}}}}class w{constructor(e,t){this.context=e,this.delegate=t,this.bindingsByAction=new Map}start(){this.valueListObserver||(this.valueListObserver=new N(this.element,this.actionAttribute,this),this.valueListObserver.start())}stop(){this.valueListObserver&&(this.valueListObserver.stop(),delete this.valueListObserver,this.disconnectAllActions())}get element(){return this.context.element}get identifier(){return this.context.identifier}get actionAttribute(){return this.schema.actionAttribute}get schema(){return this.context.schema}get bindings(){return Array.from(this.bindingsByAction.values())}connectAction(e){const t=new E(this.context,e);this.bindingsByAction.set(e,t),this.delegate.bindingConnected(t)}disconnectAction(e){const t=this.bindingsByAction.get(e);t&&(this.bindingsByAction.delete(e),this.delegate.bindingDisconnected(t))}
1disconnectAllActions(){this.bindings.forEach((e=>this.delegate.bindingDisconnected(e,!0))),this.bindingsByAction.clear()}parseValueForToken(e){const t=g.forToken(e,this.schema);if(t.identifier==this.identifier)return t}elementMatchedValue(e,t){this.connectAction(t)}elementUnmatchedValue(e,t){this.disconnectAction(t)}}class P{constructor(e,t){this.context=e,this.receiver=t,this.stringMapObserver=new L(this.element,this),this.valueDescriptorMap=this.controller.valueDescriptorMap}start(){this.stringMapObserver.start(),this.invokeChangedCallbacksForDefaultValues()}stop(){this.stringMapObserver.stop()}get element(){return this.context.element}get controller(){return this.context.controller}getStringMapKeyForAttribute(e){if(e in this.valueDescriptorMap)return this.valueDescriptorMap[e].name}stringMapKeyAdded(e,t){const n=this.valueDescriptorMap[t];this.hasValue(e)||this.invokeChangedCallback(e,n.writer(this.receiver[e]),n.writer(n.defaultValue))}stringMapValueChanged(e,t,n){const r=this.valueDescriptorNameMap[t];null!==e&&(null===n&&(n=r.writer(r.defaultValue)),this.invokeChangedCallback(t,e,n))}stringMapKeyRemoved(e,t,n){const r=this.valueDescriptorNameMap[e];this.hasValue(e)?this.invokeChangedCallback(e,r.writer(this.receiver[e]),n):this.invokeChangedCallback(e,r.writer(r.defaultValue),n)}invokeChangedCallbacksForDefaultValues(){for(const{key:e,name:t,defaultValue:n,writer:r}of this.valueDescriptors)null==n||this.controller.data.has(e)||this.invokeChangedCallback(t,r(n),void 0)}invokeChangedCallback(e,t,n){const r=`${e}Changed`,s=this.receiver[r];if("function"==typeof s){const r=this.valueDescriptorNameMap[e];try{const e=r.reader(t);let i=n;n&&(i=r.reader(n)),s.call(this.receiver,e,i)}catch(e){throw e instanceof TypeError&&(e.message=`Stimulus Value "${this.context.identifier}.${r.name}" - ${e.message}`),e}}}get valueDescriptors(){const{valueDescriptorMap:e}=this;return Object.keys(e).map((t=>e[t]))}get valueDescriptorNameMap(){const e={};return Object.keys(this.valueDescriptorMap).forEach((t=>{const n=this.valueDescriptorMap[t];e[n.name]=n})),e}hasValue(e){const t=`has${u(this.valueDescriptorNameMap[e].name)}`;return this.receiver[t]}}class M{constructor(e,t){this.context=e,this.delegate=t,this.targetsByName=new R}start(){this.tokenListObserver||(this.tokenListObserver=new O(this.element,this.attributeName,this),this.tokenListObserver.start())}stop(){this.tokenListObserver&&(this.disconnectAllTargets(),this.tokenListObserver.stop(),delete this.tokenListObserver)}tokenMatched({element:e,content:t}){this.scope.containsElement(e)&&this.connectTarget(e,t)}tokenUnmatched({element:e,content:t}){this.disconnectTarget(e,t)}connectTarget(e,t){var n;this.targetsByName.has(t,e)||(this.targetsByName.add(t,e),null===(n=this.tokenListObserver)||void 0===n||n.pause((()=>this.delegate.targetConnected(e,t))))}disconnectTarget(e,t){var n;this.targetsByName.has(t,e)&&(this.targetsByName.delete(t,e),null===(n=this.tokenListObserver)||void 0===n||n.pause((()=>this.delegate.targetDisconnected(e,t))))}disconnectAllTargets(){for(const e of this.targetsByName.keys)for(const t of this.targetsByName.getValuesForKey(e))this.disconnectTarget(t,e)}get attributeName(){return`data-${this.context.identifier}-target`}get element(){return this.context.element}get scope(){return this.context.scope}}function D(e,t){const n=U(e);return Array.from(n.reduce(((e,n)=>(function(e,t){const n=e[t];return Array.isArray(n)?n:[]}(n,t).forEach((t=>e.add(t))),e)),new Set))}function x(e,t){return U(e).reduce(((e,n)=>(e.push(...function(e,t){const n=e[t];return n?Object.keys(n).map((e=>[e,n[e]])):[]}(n,t)),e)),[])}function U(e){const t=[];for(;e;)t.push(e),e=Object.getPrototypeOf(e);return t.reverse()}class B{constructor(e,t){this.started=!1,this.context=e,this.delegate=t,this.outletsByName=new R,this.outletElementsByName=new R,this.selectorObserverMap=new Map,this.attributeObserverMap=new Map}start(){this.started||(this.outletDefinitions.forEach((e=>{this.setupSelectorObserverForOutlet(e),this.setupAttributeObserverForOutlet(e)}
1)),this.started=!0,this.dependentContexts.forEach((e=>e.refresh())))}refresh(){this.selectorObserverMap.forEach((e=>e.refresh())),this.attributeObserverMap.forEach((e=>e.refresh()))}stop(){this.started&&(this.started=!1,this.disconnectAllOutlets(),this.stopSelectorObservers(),this.stopAttributeObservers())}stopSelectorObservers(){this.selectorObserverMap.size>0&&(this.selectorObserverMap.forEach((e=>e.stop())),this.selectorObserverMap.clear())}stopAttributeObservers(){this.attributeObserverMap.size>0&&(this.attributeObserverMap.forEach((e=>e.stop())),this.attributeObserverMap.clear())}selectorMatched(e,t,{outletName:n}){const r=this.getOutlet(e,n);r&&this.connectOutlet(r,e,n)}selectorUnmatched(e,t,{outletName:n}){const r=this.getOutletFromMap(e,n);r&&this.disconnectOutlet(r,e,n)}selectorMatchElement(e,{outletName:t}){const n=this.selector(t),r=this.hasOutlet(e,t),s=e.matches(`[${this.schema.controllerAttribute}~=${t}]`);return!!n&&(r&&s&&e.matches(n))}elementMatchedAttribute(e,t){const n=this.getOutletNameFromOutletAttributeName(t);n&&this.updateSelectorObserverForOutlet(n)}elementAttributeValueChanged(e,t){const n=this.getOutletNameFromOutletAttributeName(t);n&&this.updateSelectorObserverForOutlet(n)}elementUnmatchedAttribute(e,t){const n=this.getOutletNameFromOutletAttributeName(t);n&&this.updateSelectorObserverForOutlet(n)}connectOutlet(e,t,n){var r;this.outletElementsByName.has(n,t)||(this.outletsByName.add(n,e),this.outletElementsByName.add(n,t),null===(r=this.selectorObserverMap.get(n))||void 0===r||r.pause((()=>this.delegate.outletConnected(e,t,n))))}disconnectOutlet(e,t,n){var r;this.outletElementsByName.has(n,t)&&(this.outletsByName.delete(n,e),this.outletElementsByName.delete(n,t),null===(r=this.selectorObserverMap.get(n))||void 0===r||r.pause((()=>this.delegate.outletDisconnected(e,t,n))))}disconnectAllOutlets(){for(const e of this.outletElementsByName.keys)for(const t of this.outletElementsByName.getValuesForKey(e))for(const n of this.outletsByName.getValuesForKey(e))this.disconnectOutlet(n,t,e)}updateSelectorObserverForOutlet(e){const t=this.selectorObserverMap.get(e);t&&(t.selector=this.selector(e))}setupSelectorObserverForOutlet(e){const t=this.selector(e),n=new k(document.body,t,this,{outletName:e});this.selectorObserverMap.set(e,n),n.start()}setupAttributeObserverForOutlet(e){const t=this.attributeNameForOutletName(e),n=new S(this.scope.element,t,this);this.attributeObserverMap.set(e,n),n.start()}selector(e){return this.scope.outlets.getSelectorForOutletName(e)}attributeNameForOutletName(e){return this.scope.schema.outletAttributeForScope(this.identifier,e)}getOutletNameFromOutletAttributeName(e){return this.outletDefinitions.find((t=>this.attributeNameForOutletName(t)===e))}get outletDependencies(){const e=new R;return this.router.modules.forEach((t=>{D(t.definition.controllerConstructor,"outlets").forEach((n=>e.add(n,t.identifier)))})),e}get outletDefinitions(){return this.outletDependencies.getKeysForValue(this.identifier)}get dependentControllerIdentifiers(){return this.outletDependencies.getValuesForKey(this.identifier)}get dependentContexts(){const e=this.dependentControllerIdentifiers;return this.router.contexts.filter((t=>e.includes(t.identifier)))}hasOutlet(e,t){return!!this.getOutlet(e,t)||!!this.getOutletFromMap(e,t)}getOutlet(e,t){return this.application.getControllerForElementAndIdentifier(e,t)}getOutletFromMap(e,t){return this.outletsByName.getValuesForKey(t).find((t=>t.element===e))}get scope(){return this.context.scope}get schema(){return this.context.schema}get identifier(){return this.context.identifier}get application(){return this.context.application}get router(){return this.application.router}}class F{constructor(e,t){this.logDebugActivity=(e,t={})=>{const{identifier:n,controller:r,element:s}=this;t=Object.assign({identifier:n,controller:r,element:s},t),this.application.logDebugActivity(this.identifier,e,t)},this.module=e,this.scope=t,this.controller=new e.controllerConstructor(this),this.bindingObserver=new w(this,this.dispatcher),this.valueObserver=new P(this,this.controller),this.targetObserver=new M(this,this),this.outletObserver=new B(this,this);try{this.controller.initialize(),this.logDebugActivity("initialize")}catch(e){this.handleError(e,"initializing controller")}}connect(){this.bindingObserver.start(),this.valueObserver.start(),this.targetObserver.start(),this.outletObserver.start();try{this.controller.connect(),this.logDebugActivity("connect")}catch(e){this.handleError(e,"connecting controller")}}refresh(){this.outletObserver.refresh()}disconnect(){try{this.controller.disconnect(),this.logDebugActivity("disconnect")}catch(e){this.handleError(e,"disconnecting controller")}this.outletObserver.stop(),this.targetObserver.stop(),this.valueObserver.stop(),this.bindingObserver.stop()}get application(){return this.module.application}get identifier(){return this.module.identifier}get schema(){return this.application.schema}get dispatcher(){return this.application.dispatcher}
1get element(){return this.scope.element}get parentElement(){return this.element.parentElement}handleError(e,t,n={}){const{identifier:r,controller:s,element:i}=this;n=Object.assign({identifier:r,controller:s,element:i},n),this.application.handleError(e,`Error ${t}`,n)}targetConnected(e,t){this.invokeControllerMethod(`${t}TargetConnected`,e)}targetDisconnected(e,t){this.invokeControllerMethod(`${t}TargetDisconnected`,e)}outletConnected(e,t,n){this.invokeControllerMethod(`${c(n)}OutletConnected`,e,t)}outletDisconnected(e,t,n){this.invokeControllerMethod(`${c(n)}OutletDisconnected`,e,t)}invokeControllerMethod(e,...t){const n=this.controller;"function"==typeof n[e]&&n[e](...t)}}function $(e){return function(e,t){const n=H(e),r=function(e,t){return G(t).reduce(((n,r)=>{const s=function(e,t,n){const r=Object.getOwnPropertyDescriptor(e,n);if(!r||!("value"in r)){const e=Object.getOwnPropertyDescriptor(t,n).value;return r&&(e.get=r.get||e.get,e.set=r.set||e.set),e}}(e,t,r);return s&&Object.assign(n,{[r]:s}),n}),{})}(e.prototype,t);return Object.defineProperties(n.prototype,r),n}(e,function(e){const t=D(e,"blessings");return t.reduce(((t,n)=>{const r=n(e);for(const e in r){const n=t[e]||{};t[e]=Object.assign(n,r[e])}return t}),{})}(e))}const G="function"==typeof Object.getOwnPropertySymbols?e=>[...Object.getOwnPropertyNames(e),...Object.getOwnPropertySymbols(e)]:Object.getOwnPropertyNames,H=(()=>{function e(e){function t(){return Reflect.construct(e,arguments,new.target)}return t.prototype=Object.create(e.prototype,{constructor:{value:t}}),Reflect.setPrototypeOf(t,e),t}try{return function(){const t=e((function(){this.a.call(this)}));t.prototype.a=function(){},new t}(),e}catch(e){return e=>class extends e{}}})();class j{constructor(e,t){this.application=e,this.definition=function(e){return{identifier:e.identifier,controllerConstructor:$(e.controllerConstructor)}}(t),this.contextsByScope=new WeakMap,this.connectedContexts=new Set}get identifier(){return this.definition.identifier}get controllerConstructor(){return this.definition.controllerConstructor}get contexts(){return Array.from(this.connectedContexts)}connectContextForScope(e){const t=this.fetchContextForScope(e);this.connectedContexts.add(t),t.connect()}disconnectContextForScope(e){const t=this.contextsByScope.get(e);t&&(this.connectedContexts.delete(t),t.disconnect())}fetchContextForScope(e){let t=this.contextsByScope.get(e);return t||(t=new F(this,e),this.contextsByScope.set(e,t)),t}}class W{constructor(e){this.scope=e}has(e){return this.data.has(this.getDataKey(e))}get(e){return this.getAll(e)[0]}getAll(e){const t=this.data.get(this.getDataKey(e))||"";return t.match(/[^\s]+/g)||[]}getAttributeName(e){return this.data.getAttributeNameForKey(this.getDataKey(e))}getDataKey(e){return`${e}-class`}get data(){return this.scope.data}}class K{constructor(e){this.scope=e}get element(){return this.scope.element}get identifier(){return this.scope.identifier}get(e){const t=this.getAttributeNameForKey(e);return this.element.getAttribute(t)}set(e,t){const n=this.getAttributeNameForKey(e);return this.element.setAttribute(n,t),this.get(e)}has(e){const t=this.getAttributeNameForKey(e);return this.element.hasAttribute(t)}delete(e){if(this.has(e)){const t=this.getAttributeNameForKey(e);return this.element.removeAttribute(t),!0}return!1}getAttributeNameForKey(e){return`data-${this.identifier}-${d(e)}`}}class V{constructor(e){this.warnedKeysByObject=new WeakMap,this.logger=e}warn(e,t,n){let r=this.warnedKeysByObject.get(e);r||(r=new Set,this.warnedKeysByObject.set(e,r)),r.has(t)||(r.add(t),this.logger.warn(n,e))}}function q(e,t){return`[${e}~="${t}"]`}class Y{constructor(e){this.scope=e}get element(){return this.scope.element}get identifier(){return this.scope.identifier}get schema(){return this.scope.schema}has(e){return null!=this.find(e)}find(...e){return e.reduce(((e,t)=>e||this.findTarget(t)||this.findLegacyTarget(t)),void 0)}findAll(...e){return e.reduce(((e,t)=>[...e,...this.findAllTargets(t),...this.findAllLegacyTargets(t)]),[])}findTarget(e){const t=this.getSelectorForTargetName(e);return this.scope.findElement(t)}findAllTargets(e){const t=this.getSelectorForTargetName(e);return this.scope.findAllElements(t)}getSelectorForTargetName(e){return q(this.schema.targetAttributeForScope(this.identifier),e)}findLegacyTarget(e){const t=this.getLegacySelectorForTargetName(e);return this.deprecate(this.scope.findElement(t),e)}findAllLegacyTargets(e){const t=this.getLegacySelectorForTargetName(e);return this.scope.findAllElements(t).map((t=>this.deprecate(t,e)))}getLegacySelectorForTargetName(e){const t=`${this.identifier}.${e}`;return q(this.schema.targetAttribute,t)}deprecate(e,t){if(e){const{identifier:n}=this,r=this.schema.targetAttribute,s=this.schema.targetAttributeForScope(n);this.guide.warn(e,`target:${t}`,`Please replace ${r}="${n}.${t}" with ${s}="${t}". The ${r} attribute is deprecated and will be removed in a future version of Stimulus.`)}return e}get guide(){return this.scope.guide}}class z{constructor(e,t){this.scope=e,this.controllerElement=t}
1get element(){return this.scope.element}get identifier(){return this.scope.identifier}get schema(){return this.scope.schema}has(e){return null!=this.find(e)}find(...e){return e.reduce(((e,t)=>e||this.findOutlet(t)),void 0)}findAll(...e){return e.reduce(((e,t)=>[...e,...this.findAllOutlets(t)]),[])}getSelectorForOutletName(e){const t=this.schema.outletAttributeForScope(this.identifier,e);return this.controllerElement.getAttribute(t)}findOutlet(e){const t=this.getSelectorForOutletName(e);if(t)return this.findElement(t,e)}findAllOutlets(e){const t=this.getSelectorForOutletName(e);return t?this.findAllElements(t,e):[]}findElement(e,t){return this.scope.queryElements(e).filter((n=>this.matchesElement(n,e,t)))[0]}findAllElements(e,t){return this.scope.queryElements(e).filter((n=>this.matchesElement(n,e,t)))}matchesElement(e,t,n){const r=e.getAttribute(this.scope.schema.controllerAttribute)||"";return e.matches(t)&&r.split(" ").includes(n)}}class J{constructor(e,t,n,r){this.targets=new Y(this),this.classes=new W(this),this.data=new K(this),this.containsElement=e=>e.closest(this.controllerSelector)===this.element,this.schema=e,this.element=t,this.identifier=n,this.guide=new V(r),this.outlets=new z(this.documentScope,t)}findElement(e){return this.element.matches(e)?this.element:this.queryElements(e).find(this.containsElement)}findAllElements(e){return[...this.element.matches(e)?[this.element]:[],...this.queryElements(e).filter(this.containsElement)]}queryElements(e){return Array.from(this.element.querySelectorAll(e))}get controllerSelector(){return q(this.schema.controllerAttribute,this.identifier)}get isDocumentScope(){return this.element===document.documentElement}get documentScope(){return this.isDocumentScope?this:new J(this.schema,document.documentElement,this.identifier,this.guide.logger)}}class X{constructor(e,t,n){this.element=e,this.schema=t,this.delegate=n,this.valueListObserver=new N(this.element,this.controllerAttribute,this),this.scopesByIdentifierByElement=new WeakMap,this.scopeReferenceCounts=new WeakMap}start(){this.valueListObserver.start()}stop(){this.valueListObserver.stop()}get controllerAttribute(){return this.schema.controllerAttribute}parseValueForToken(e){const{element:t,content:n}=e;return this.parseValueForElementAndIdentifier(t,n)}parseValueForElementAndIdentifier(e,t){const n=this.fetchScopesByIdentifierForElement(e);let r=n.get(t);return r||(r=this.delegate.createScopeForElementAndIdentifier(e,t),n.set(t,r)),r}elementMatchedValue(e,t){const n=(this.scopeReferenceCounts.get(t)||0)+1;this.scopeReferenceCounts.set(t,n),1==n&&this.delegate.scopeConnected(t)}elementUnmatchedValue(e,t){const n=this.scopeReferenceCounts.get(t);n&&(this.scopeReferenceCounts.set(t,n-1),1==n&&this.delegate.scopeDisconnected(t))}fetchScopesByIdentifierForElement(e){let t=this.scopesByIdentifierByElement.get(e);return t||(t=new Map,this.scopesByIdentifierByElement.set(e,t)),t}}class Q{constructor(e){this.application=e,this.scopeObserver=new X(this.element,this.schema,this),this.scopesByIdentifier=new R,this.modulesByIdentifier=new Map}get element(){return this.application.element}get schema(){return this.application.schema}get logger(){return this.application.logger}get controllerAttribute(){return this.schema.controllerAttribute}get modules(){return Array.from(this.modulesByIdentifier.values())}get contexts(){return this.modules.reduce(((e,t)=>e.concat(t.contexts)),[])}start(){this.scopeObserver.start()}stop(){this.scopeObserver.stop()}loadDefinition(e){this.unloadIdentifier(e.identifier);const t=new j(this.application,e);this.connectModule(t);const n=e.controllerConstructor.afterLoad;n&&n.call(e.controllerConstructor,e.identifier,this.application)}unloadIdentifier(e){const t=this.modulesByIdentifier.get(e);t&&this.disconnectModule(t)}getContextForElementAndIdentifier(e,t){const n=this.modulesByIdentifier.get(t);if(n)return n.contexts.find((t=>t.element==e))}proposeToConnectScopeForElementAndIdentifier(e,t){const n=this.scopeObserver.parseValueForElementAndIdentifier(e,t);n?this.scopeObserver.elementMatchedValue(n.element,n):console.error(`Couldn't find or create scope for identifier: "${t}" and element:`,e)}handleError(e,t,n){this.application.handleError(e,t,n)}
1createScopeForElementAndIdentifier(e,t){return new J(this.schema,e,t,this.logger)}scopeConnected(e){this.scopesByIdentifier.add(e.identifier,e);const t=this.modulesByIdentifier.get(e.identifier);t&&t.connectContextForScope(e)}scopeDisconnected(e){this.scopesByIdentifier.delete(e.identifier,e);const t=this.modulesByIdentifier.get(e.identifier);t&&t.disconnectContextForScope(e)}connectModule(e){this.modulesByIdentifier.set(e.identifier,e);this.scopesByIdentifier.getValuesForKey(e.identifier).forEach((t=>e.connectContextForScope(t)))}disconnectModule(e){this.modulesByIdentifier.delete(e.identifier);this.scopesByIdentifier.getValuesForKey(e.identifier).forEach((t=>e.disconnectContextForScope(t)))}}const Z={controllerAttribute:"data-controller",actionAttribute:"data-action",targetAttribute:"data-target",targetAttributeForScope:e=>`data-${e}-target`,outletAttributeForScope:(e,t)=>`data-${e}-${t}-outlet`,keyMappings:Object.assign(Object.assign({enter:"Enter",tab:"Tab",esc:"Escape",space:" ",up:"ArrowUp",down:"ArrowDown",left:"ArrowLeft",right:"ArrowRight",home:"Home",end:"End",page_up:"PageUp",page_down:"PageDown"},ee("abcdefghijklmnopqrstuvwxyz".split("").map((e=>[e,e])))),ee("0123456789".split("").map((e=>[e,e]))))};function ee(e){return e.reduce(((e,[t,n])=>Object.assign(Object.assign({},e),{[t]:n})),{})}class te{constructor(e=document.documentElement,t=Z){this.logger=console,this.debug=!1,this.logDebugActivity=(e,t,n={})=>{this.debug&&this.logFormattedMessage(e,t,n)},this.element=e,this.schema=t,this.dispatcher=new s(this),this.router=new Q(this),this.actionDescriptorFilters=Object.assign({},i)}static start(e,t){const n=new this(e,t);return n.start(),n}async start(){await new Promise((e=>{"loading"==document.readyState?document.addEventListener("DOMContentLoaded",(()=>e())):e()})),this.logDebugActivity("application","starting"),this.dispatcher.start(),this.router.start(),this.logDebugActivity("application","start")}stop(){this.logDebugActivity("application","stopping"),this.dispatcher.stop(),this.router.stop(),this.logDebugActivity("application","stop")}register(e,t){this.load({identifier:e,controllerConstructor:t})}registerActionOption(e,t){this.actionDescriptorFilters[e]=t}load(e,...t){(Array.isArray(e)?e:[e,...t]).forEach((e=>{e.controllerConstructor.shouldLoad&&this.router.loadDefinition(e)}))}unload(e,...t){(Array.isArray(e)?e:[e,...t]).forEach((e=>this.router.unloadIdentifier(e)))}get controllers(){return this.router.contexts.map((e=>e.controller))}getControllerForElementAndIdentifier(e,t){const n=this.router.getContextForElementAndIdentifier(e,t);return n?n.controller:null}handleError(e,t,n){var r;this.logger.error("%s\n\n%o\n\n%o",t,e,n),null===(r=window.onerror)||void 0===r||r.call(window,t,"",0,0,e)}logFormattedMessage(e,t,n={}){n=Object.assign({application:this},n),this.logger.groupCollapsed(`${e} #${t}`),this.logger.log("details:",Object.assign({},n)),this.logger.groupEnd()}}function ne(e,t,n){return e.application.getControllerForElementAndIdentifier(t,n)}function re(e,t,n){let r=ne(e,t,n);return r||(e.application.router.proposeToConnectScopeForElementAndIdentifier(t,n),r=ne(e,t,n),r||void 0)}function se([e,t],n){return function(e){const{token:t,typeDefinition:n}=e,r=`${d(t)}-value`,s=function(e){const{controller:t,token:n,typeDefinition:r}=e,s={controller:t,token:n,typeObject:r},i=function(e){const{controller:t,token:n,typeObject:r}=e,s=h(r.type),i=h(r.default),a=s&&i,o=s&&!i,l=!s&&i,c=ie(r.type),u=ae(e.typeObject.default);if(o)return c;if(l)return u;if(c!==u){throw new Error(`The specified default value for the Stimulus Value "${t?`${t}.${n}`:n}" must match the defined type "${c}". The provided default value of "${r.default}" is of type "${u}".`)}if(a)return c}(s),a=ae(r),o=ie(r),l=i||a||o;if(l)return l;const c=t?`${t}.${r}`:n;throw new Error(`Unknown value type "${c}" for "${n}" value`)}(e);return{type:s,key:r,name:l(r),get defaultValue(){return function(e){const t=ie(e);if(t)return oe[t];const n=f(e,"default"),r=f(e,"type"),s=e;if(n)return s.default;if(r){const{type:e}=s,t=ie(e);if(t)return oe[t]}return e}(n)},get hasCustomDefaultValue(){return void 0!==ae(n)}
1,reader:le[s],writer:ce[s]||ce.default}}({controller:n,token:e,typeDefinition:t})}function ie(e){switch(e){case Array:return"array";case Boolean:return"boolean";case Number:return"number";case Object:return"object";case String:return"string"}}function ae(e){switch(typeof e){case"boolean":return"boolean";case"number":return"number";case"string":return"string"}return Array.isArray(e)?"array":"[object Object]"===Object.prototype.toString.call(e)?"object":void 0}const oe={get array(){return[]},boolean:!1,number:0,get object(){return{}},string:""},le={array(e){const t=JSON.parse(e);if(!Array.isArray(t))throw new TypeError(`expected value of type "array" but instead got value "${e}" of type "${ae(t)}"`);return t},boolean:e=>!("0"==e||"false"==String(e).toLowerCase()),number:e=>Number(e.replace(/_/g,"")),object(e){const t=JSON.parse(e);if(null===t||"object"!=typeof t||Array.isArray(t))throw new TypeError(`expected value of type "object" but instead got value "${e}" of type "${ae(t)}"`);return t},string:e=>e},ce={default:function(e){return`${e}`},array:ue,object:ue};function ue(e){return JSON.stringify(e)}class de{constructor(e){this.context=e}static get shouldLoad(){return!0}static afterLoad(e,t){}get application(){return this.context.application}get scope(){return this.context.scope}get element(){return this.scope.element}get identifier(){return this.scope.identifier}get targets(){return this.scope.targets}get outlets(){return this.scope.outlets}get classes(){return this.scope.classes}get data(){return this.scope.data}initialize(){}connect(){}disconnect(){}dispatch(e,{target:t=this.element,detail:n={},prefix:r=this.identifier,bubbles:s=!0,cancelable:i=!0}={}){const a=new CustomEvent(r?`${r}:${e}`:e,{detail:n,bubbles:s,cancelable:i});return t.dispatchEvent(a),a}}de.blessings=[function(e){return D(e,"classes").reduce(((e,t)=>{return Object.assign(e,(n=t,{[`${n}Class`]:{get(){const{classes:e}=this;if(e.has(n))return e.get(n);{const t=e.getAttributeName(n);throw new Error(`Missing attribute "${t}"`)}}},[`${n}Classes`]:{get(){return this.classes.getAll(n)}},[`has${u(n)}Class`]:{get(){return this.classes.has(n)}}}));var n}),{})},function(e){return D(e,"targets").reduce(((e,t)=>{return Object.assign(e,(n=t,{[`${n}Target`]:{get(){const e=this.targets.find(n);if(e)return e;throw new Error(`Missing target element "${n}" for "${this.identifier}" controller`)}},[`${n}Targets`]:{get(){return this.targets.findAll(n)}},[`has${u(n)}Target`]:{get(){return this.targets.has(n)}}}));var n}),{})},function(e){const t=x(e,"values"),n={valueDescriptorMap:{get(){return t.reduce(((e,t)=>{const n=se(t,this.identifier),r=this.data.getAttributeNameForKey(n.key);return Object.assign(e,{[r]:n})}),{})}}};return t.reduce(((e,t)=>Object.assign(e,function(e,t){const n=se(e,t),{key:r,name:s,reader:i,writer:a}=n;return{[s]:{get(){const e=this.data.get(r);return null!==e?i(e):n.defaultValue},set(e){void 0===e?this.data.delete(r):this.data.set(r,a(e))}},[`has${u(s)}`]:{get(){return this.data.has(r)||n.hasCustomDefaultValue}}}}(t))),n)},function(e){return D(e,"outlets").reduce(((e,t)=>Object.assign(e,function(e){const t=c(e);return{[`${t}Outlet`]:{get(){const t=this.outlets.find(e),n=this.outlets.getSelectorForOutletName(e);if(t){const n=re(this,t,e);if(n)return n;throw new Error(`The provided outlet element is missing an outlet controller "${e}" instance for host controller "${this.identifier}"`)}throw new Error(`Missing outlet element "${e}" for host controller "${this.identifier}". Stimulus couldn't find a matching outlet element using selector "${n}".`)}},[`${t}Outlets`]:{get(){const t=this.outlets.findAll(e);return t.length>0?t.map((t=>{const n=re(this,t,e);if(n)return n;console.warn(`The provided outlet element is missing an outlet controller "${e}" instance for host controller "${this.identifier}"`,t)})).filter((e=>e)):[]}},[`${t}OutletElement`]:{get(){const t=this.outlets.find(e),n=this.outlets.getSelectorForOutletName(e);if(t)return t;throw new Error(`Missing outlet element "${e}" for host controller "${this.identifier}". Stimulus couldn't find a matching outlet element using selector "${n}".`)}},[`${t}OutletElements`]:{get(){return this.outlets.findAll(e)}},[`has${u(t)}Outlet`]:{get(){return this.outlets.has(e)}}}}(t))),{})}],de.targets=[],de.outlets=[],de.values={}},78981(e,t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const n="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__;t.DEBUG_BUILD=n},64666(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(37872),s=n(78981),i=n(57742),a={};function o(e){const t=a[e];if(t)return t;let n=i.WINDOW[e];if(r.isNativeFunction(n))return a[e]=n.bind(i.WINDOW);const o=i.WINDOW.document;if(o&&"function"==typeof o.createElement)try{const t=o.createElement("iframe");t.hidden=!0,o.head.appendChild(t);const r=t.contentWindow;r?.[e]&&(n=r[e]),o.head.removeChild(t)}catch(t){s.DEBUG_BUILD&&r.debug.warn(`Could not create sandbox iframe for ${e} check, bailing to window.${e}: `,t)}return n?a[e]=n.bind(i.WINDOW):n}t.clearCachedImplementation=function(e){a[e]=void 0},t.fetch=function(...e){return o("fetch")(...e)},t.getNativeImplementation=o,t.setTimeout=function(...e){return o("setTimeout")(...e)}
1},81015(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(23872),s=n(94624),i=n(12507),a=n(71604),o=n(15028),l=n(30677),c=n(78577),u=n(64666),d=n(30139),h=n(82028),f=n(62843),p=n(48412);t.addClsInstrumentationHandler=r.addClsInstrumentationHandler,t.addInpInstrumentationHandler=r.addInpInstrumentationHandler,t.addLcpInstrumentationHandler=r.addLcpInstrumentationHandler,t.addPerformanceInstrumentationHandler=r.addPerformanceInstrumentationHandler,t.addTtfbInstrumentationHandler=r.addTtfbInstrumentationHandler,t.addPerformanceEntries=s.addPerformanceEntries,t.startTrackingInteractions=s.startTrackingInteractions,t.startTrackingLongAnimationFrames=s.startTrackingLongAnimationFrames,t.startTrackingLongTasks=s.startTrackingLongTasks,t.startTrackingWebVitals=s.startTrackingWebVitals,t.elementTimingIntegration=i.elementTimingIntegration,t.startTrackingElementTiming=i.startTrackingElementTiming,t.extractNetworkProtocol=a.extractNetworkProtocol,t.trackClsAsSpan=o.trackClsAsSpan,t.trackInpAsSpan=o.trackInpAsSpan,t.trackLcpAsSpan=o.trackLcpAsSpan,t.addClickKeypressInstrumentationHandler=l.addClickKeypressInstrumentationHandler,t.addHistoryInstrumentationHandler=c.addHistoryInstrumentationHandler,t.clearCachedImplementation=u.clearCachedImplementation,t.fetch=u.fetch,t.getNativeImplementation=u.getNativeImplementation,t.setTimeout=u.setTimeout,t.SENTRY_XHR_DATA_KEY=d.SENTRY_XHR_DATA_KEY,t.addXhrInstrumentationHandler=d.addXhrInstrumentationHandler,t.getBodyString=h.getBodyString,t.getFetchRequestArgBody=h.getFetchRequestArgBody,t.parseXhrResponseHeaders=h.parseXhrResponseHeaders,t.serializeFormData=h.serializeFormData,t.resourceTimingToSpanAttributes=f.resourceTimingToSpanAttributes,t.registerInpInteractionListener=p.registerInpInteractionListener,t.startTrackingINP=p.startTrackingINP},30677(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(37872),s=n(57742);let i,a,o;function l(){if(!s.WINDOW.document)return;const e=r.triggerHandlers.bind(null,"dom"),t=c(e,!0);s.WINDOW.document.addEventListener("click",t,!1),s.WINDOW.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach((t=>{const n=s.WINDOW,i=n[t]?.prototype;i?.hasOwnProperty?.("addEventListener")&&(r.fill(i,"addEventListener",(function(t){return function(n,r,s){if("click"===n||"keypress"==n)try{const r=this.__sentry_instrumentation_handlers__=this.__sentry_instrumentation_handlers__||{},i=r[n]=r[n]||{refCount:0};if(!i.handler){const r=c(e);i.handler=r,t.call(this,n,r,s)}i.refCount++}catch{}return t.call(this,n,r,s)}})),r.fill(i,"removeEventListener",(function(e){return function(t,n,r){if("click"===t||"keypress"==t)try{const n=this.__sentry_instrumentation_handlers__||{},s=n[t];s&&(s.refCount--,s.refCount<=0&&(e.call(this,t,s.handler,r),s.handler=void 0,delete n[t]),0===Object.keys(n).length&&delete this.__sentry_instrumentation_handlers__)}catch{}return e.call(this,t,n,r)}})))}))}function c(e,t=!1){return n=>{if(!n||n._sentryCaptured)return;const l=function(e){try{return e.target}catch{return null}}(n);if(function(e,t){return"keypress"===e&&(!t?.tagName||"INPUT"!==t.tagName&&"TEXTAREA"!==t.tagName&&!t.isContentEditable)}(n.type,l))return;r.addNonEnumerableProperty(n,"_sentryCaptured",!0),l&&!l._sentryId&&r.addNonEnumerableProperty(l,"_sentryId",r.uuid4());const c="keypress"===n.type?"input":n.type;if(!function(e){if(e.type!==a)return!1;try{if(!e.target||e.target._sentryId!==o)return!1}catch{}return!0}(n)){e({event:n,name:c,global:t}),a=n.type,o=l?l._sentryId:void 0}clearTimeout(i),i=s.WINDOW.setTimeout((()=>{o=void 0,a=void 0}),1e3)}}t.addClickKeypressInstrumentationHandler=function(e){r.addHandler("dom",e),r.maybeInstrument("dom",l)},t.instrumentDOM=l},78577(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(37872),s=n(57742);let i;function a(){function e(e){return function(...t){const n=t.length>2?t[2]:void 0;if(n){const a=i,o=function(e){try{return new URL(e,s.WINDOW.location.origin).toString()}catch{return e}}(String(n));if(i=o,a===o)return e.apply(this,t);const l={from:a,to:o};r.triggerHandlers("history",l)}return e.apply(this,t)}}s.WINDOW.addEventListener("popstate",(()=>{const e=s.WINDOW.location.href,t=i;if(i=e,t===e)return;const n={from:t,to:e};r.triggerHandlers("history",n)})),r.supportsHistory()&&(r.fill(s.WINDOW.history,"pushState",e),r.f
1ill(s.WINDOW.history,"replaceState",e))}t.addHistoryInstrumentationHandler=function(e){const t="history";r.addHandler(t,e),r.maybeInstrument(t,a)},t.instrumentHistory=a},30139(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(37872),s=n(57742),i="__sentry_xhr_v3__";function a(){if(!s.WINDOW.XMLHttpRequest)return;const e=XMLHttpRequest.prototype;e.open=new Proxy(e.open,{apply(e,t,n){const s=new Error,a=1e3*r.timestampInSeconds(),o=r.isString(n[0])?n[0].toUpperCase():void 0,l=function(e){if(r.isString(e))return e;try{return e.toString()}catch{}return}(n[1]);if(!o||!l)return e.apply(t,n);t[i]={method:o,url:l,request_headers:{}},"POST"===o&&l.match(/sentry_key/)&&(t.__sentry_own_request__=!0);const c=()=>{const e=t[i];if(e&&4===t.readyState){try{e.status_code=t.status}catch{}const n={endTimestamp:1e3*r.timestampInSeconds(),startTimestamp:a,xhr:t,virtualError:s};r.triggerHandlers("xhr",n)}};return"onreadystatechange"in t&&"function"==typeof t.onreadystatechange?t.onreadystatechange=new Proxy(t.onreadystatechange,{apply:(e,t,n)=>(c(),e.apply(t,n))}):t.addEventListener("readystatechange",c),t.setRequestHeader=new Proxy(t.setRequestHeader,{apply(e,t,n){const[s,a]=n,o=t[i];return o&&r.isString(s)&&r.isString(a)&&(o.request_headers[s.toLowerCase()]=a),e.apply(t,n)}}),e.apply(t,n)}}),e.send=new Proxy(e.send,{apply(e,t,n){const s=t[i];if(!s)return e.apply(t,n);void 0!==n[0]&&(s.body=n[0]);const a={startTimestamp:1e3*r.timestampInSeconds(),xhr:t};return r.triggerHandlers("xhr",a),e.apply(t,n)}})}t.SENTRY_XHR_DATA_KEY=i,t.addXhrInstrumentationHandler=function(e){r.addHandler("xhr",e),r.maybeInstrument("xhr",a)},t.instrumentXHR=a},94624(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(37872),s=n(57742),i=n(22501),a=n(23872),o=n(9986),l=n(62843),c=n(71604),u=n(12990),d=n(45476),h=n(30750),f=n(78981);let p,g,m=0,_={};function T(e,t,n,s,i,a){if(function(e){if("measure"===e?.entryType)try{return"Components ⚛"===e.detail.devtools.track}catch{return}}(t))return;if(["mark","measure"].includes(t.entryType)&&r.stringMatchesSomePattern(t.name,a))return;const o=d.getNavigationEntry(!1),l=c.msToSec(o?o.requestStart:0),u=i+Math.max(n,l),h=i+n,f=h+s,p={[r.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]:"auto.resource.browser.metrics"};u!==h&&(p["sentry.browser.measure_happened_before_request"]=!0,p["sentry.browser.measure_start_time"]=u),function(e,t){try{const n=t.detail;if(!n)return;if("object"==typeof n){for(const[t,s]of Object.entries(n))if(s&&r.isPrimitive(s))e[`sentry.browser.measure.detail.${t}`]=s;else if(void 0!==s)try{e[`sentry.browser.measure.detail.${t}`]=JSON.stringify(s)}catch{}return}if(r.isPrimitive(n))return void(e["sentry.browser.measure.detail"]=n);try{e["sentry.browser.measure.detail"]=JSON.stringify(n)}catch{}}catch{}}(p,t),u<=f&&c.startAndEndSpan(e,u,f,{name:t.name,op:t.entryType,attributes:p})}function E(e,t,n){["unloadEvent","redirect","domContentLoadedEvent","loadEvent","connect"].forEach((r=>{y(e,t,r,n)})),y(e,t,"secureConnection",n,"TLS/SSL"),y(e,t,"fetch",n,"cache"),y(e,t,"domainLookup",n,"DNS"),function(e,t,n){const s=n+c.msToSec(t.requestStart),i=n+c.msToSec(t.responseEnd),a=n+c.msToSec(t.responseStart);t.responseEnd&&(c.startAndEndSpan(e,s,i,{op:"browser.request",name:t.name,attributes:{[r.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]:"auto.ui.browser.metrics"}}),c.startAndEndSpan(e,a,i,{op:"browser.response",name:t.name,attributes:{[r.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]:"auto.ui.browser.metrics"}}))}(e,t,n)}function y(e,t,n,s,i=n){const a=function(e){if("secureConnection"===e)return"connectEnd";if("fetch"===e)return"domainLookupStart";return`${e}End`}(n),o=t[a],l=t[`${n}Start`];l&&o&&c.startAndEndSpan(e,s+c.msToSec(l),s+c.msToSec(o),{op:`browser.${i}`,name:t.name,attributes:{[r.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]:"auto.ui.browser.metrics",..."redirect"===n&&null!=t.redirectCount?{"http.redirect_count":t.redirectCount}:{}}})}function S(e,t,n,i,a,o,u){if("xmlhttprequest"===t.initiatorType||"fetch"===t.initiatorType)return;const d=t.initiatorType?`resource.${t.initiatorType}`:"resource.other";if(u?.includes(d))return;const h={[r.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]:"auto.resource.browser.metrics"},f=r.parseUrl(n);f.protocol&&(h["url.scheme"]=f.protocol.split(":").pop()),f.host&&(h["server.address"]=f.host),h["url.same_origin"]=n.includes(s.WINDOW.location.origin),v(t,h,[["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"]]);const p={...h,...l.resourceTimingToSpanAttributes(t)},g=o+i,m=g+a;c.startAndEndSpan(e,g,m,{name:n.replace(s.WINDOW.location.origin,""),op:d,attributes:p})}
1function v(e,t,n){n.forEach((([n,r])=>{const s=e[n];null!=s&&("number"==typeof s&&s<2147483647||"string"==typeof s)&&(t[r]=s)}))}t._addMeasureSpans=T,t._addNavigationSpans=E,t._addResourceSpans=S,t._setResourceRequestAttributes=v,t.addPerformanceEntries=function(e,t){const n=c.getBrowserPerformanceAPI(),i=r.browserPerformanceTimeOrigin();if(!n?.getEntries||!i)return;const{spanStreamingEnabled:a,ignorePerformanceApiSpans:o,ignoreResourceSpans:l,recordClsOnPageloadSpan:y,recordLcpOnPageloadSpan:v}=t,b=c.msToSec(i),I=n.getEntries(),{op:A,start_timestamp:R}=r.spanToJSON(e);if(I.slice(m).forEach((t=>{const n=c.msToSec(t.startTime),r=c.msToSec(Math.max(0,t.duration));if(!("navigation"===A&&R&&b+n<R))switch(t.entryType){case"navigation":E(e,t,b);break;case"mark":case"paint":case"measure":{T(e,t,n,r,b,o);const s=h.getVisibilityWatcher(),i=t.startTime<s.firstHiddenTime;"first-paint"===t.name&&i&&(_.fp={value:t.startTime,unit:"millisecond"}),"first-contentful-paint"===t.name&&i&&(_.fcp={value:t.startTime,unit:"millisecond"});break}case"resource":S(e,t,t.name,n,r,b,l)}})),m=Math.max(I.length-1,0),function(e,t){const n=s.WINDOW.navigator;if(!n)return;const r=n.connection;r&&(r.effectiveType&&e.setAttribute(t?"network.connection.effective_type":"effectiveConnectionType",r.effectiveType),r.type&&e.setAttribute(t?"network.connection.type":"connectionType",r.type),c.isMeasurementValue(r.rtt)&&(_["connection.rtt"]={value:r.rtt,unit:"millisecond"},t&&e.setAttribute("network.connection.rtt",r.rtt)));c.isMeasurementValue(n.deviceMemory)&&(t?e.setAttribute("device.memory.estimated_capacity",n.deviceMemory):e.setAttribute("deviceMemory",`${n.deviceMemory} GB`));c.isMeasurementValue(n.hardwareConcurrency)&&(t?e.setAttribute("device.processor_count",n.hardwareConcurrency):e.setAttribute("hardwareConcurrency",String(n.hardwareConcurrency)))}(e,a),"pageload"===A){if(function(e){const t=d.getNavigationEntry(!1);if(!t)return;const{responseStart:n,requestStart:r}=t;r<=n&&(e["ttfb.requestTime"]={value:n-r,unit:"millisecond"})}(_),a){const t=(t,n,s)=>{const i=s??`browser.web_vital.${t}.value`;e.setAttribute(i,n),f.DEBUG_BUILD&&r.debug.log("Setting web vital attribute",{[i]:n},"on pageload span")};["ttfb","fp","fcp"].forEach((e=>{_[e]&&t(e,_[e].value)})),_["ttfb.requestTime"]&&t("ttfb.requestTime",_["ttfb.requestTime"].value,"browser.web_vital.ttfb.request_time")}else y||delete _.cls,v||delete _.lcp,Object.entries(_).forEach((([e,t])=>{r.setMeasurement(e,t.value,t.unit)})),function(e,t){p&&t.recordLcpOnPageloadSpan&&(p.element&&e.setAttribute("lcp.element",r.htmlTreeAsString(p.element)),p.id&&e.setAttribute("lcp.id",p.id),p.url&&e.setAttribute("lcp.url",p.url.trim().slice(0,200)),null!=p.loadTime&&e.setAttribute("lcp.loadTime",p.loadTime),null!=p.renderTime&&e.setAttribute("lcp.renderTime",p.renderTime),e.setAttribute("lcp.size",p.size));g?.sources&&t.recordClsOnPageloadSpan&&g.sources.forEach(((t,n)=>e.setAttribute(`cls.source.${n+1}`,r.htmlTreeAsString(t.node))))}(e,t);e.setAttribute(a?"browser.performance.time_origin":"performance.timeOrigin",b),e.setAttribute(a?"browser.performance.navigation.activation_start":"performance.activationStart",u.getActivationStart())}p=void 0,g=void 0,_={}},t.startTrackingInteractions=function(){a.addPerformanceInstrumentationHandler("event",(({entries:e})=>{const t=r.getActiveSpan();if(t)for(const n of e)if("click"===n.name){const e=c.msToSec(r.browserPerformanceTimeOrigin()+n.startTime),s=c.msToSec(n.duration),i={name:r.htmlTreeAsString(n.target),op:`ui.interaction.${n.name}`,startTime:e,attributes:{[r.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]:"auto.ui.browser.metrics"}},a=r.getComponentName(n.target);a&&(i.attributes["ui.component_name"]=a),c.startAndEndSpan(t,e,e+s,i)}}))},t.startTrackingLongAnimationFrames=function(){new PerformanceObserver((e=>{const t=r.getActiveSpan();if(t)for(const n of e.getEntries()){if(!n.scripts[0])continue;const e=c.msToSec(r.browserPerformanceTimeOrigin()+n.startTime),{start_timestamp:s,op:i}=r.spanToJSON(t);if("navigation"===i&&s&&e<s)continue;const a=c.msToSec(n.duration),o={[r.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]:"auto.ui.browser.metrics"},l=n.scripts[0],{invoker:u,invokerType:d,sourceURL:h,sourceFunctionName:f,sourceCharPosition:p}=l;o["browser.script.invoker"]=u,o["browser.script.invoker_type"]=d,h&&(o["code.filepath"]=h),f&&(o["code.function"]=f),-1!==p&&(o["browser.script.source_char_position"]=p),c.startAndEndSpan(t,e,e+a,{name:"Main UI thread blocked",op:"ui.long-animation-frame",attributes:o})}})).observe({type:"long-animation-frame",buffered:!0})},t.startTrackingLongTasks=function(){a.addPerformanceInstrumentationHandler("longtask",(({entries:e})=>{const t=r.getActiveSpan();if(!t)return;const{op:n,start_timestamp:s}=r.spanToJSON(t);for(const i of e){const e=c.msToSec(r.browserPerformanceTimeOrigin()+i.startTime),a=c.msToSec(i.duration);
1"navigation"===n&&s&&e<s||c.startAndEndSpan(t,e,e+a,{name:"Main UI thread blocked",op:"ui.long-task",attributes:{[r.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]:"auto.ui.browser.metrics"}})}}))},t.startTrackingWebVitals=function({recordClsStandaloneSpans:e,recordLcpStandaloneSpans:t,client:n}){const l=c.getBrowserPerformanceAPI();if(l&&r.browserPerformanceTimeOrigin()){l.mark&&s.WINDOW.performance.mark("sentry-tracing-init");const r=t?o.trackLcpAsStandaloneSpan(n):!1===t?a.addLcpInstrumentationHandler((({metric:e})=>{const t=e.entries[e.entries.length-1];t&&o.isValidLcpMetric(e.value)&&(_.lcp={value:e.value,unit:"millisecond"},p=t)}),!0):void 0,c=e?i.trackClsAsStandaloneSpan(n):!1===e?a.addClsInstrumentationHandler((({metric:e})=>{const t=e.entries[e.entries.length-1];t&&(_.cls={value:e.value,unit:""},g=t)}),!0):void 0,u=a.addTtfbInstrumentationHandler((({metric:e})=>{e.entries[e.entries.length-1]&&(_.ttfb={value:e.value,unit:"millisecond"})}));return()=>{u(),r?.(),c?.()}}return()=>{}}},22501(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(37872),s=n(78981),i=n(23872),a=n(71604);function o(e,t,n,i){s.DEBUG_BUILD&&r.debug.log(`Sending CLS span (${e})`);const o=t?a.msToSec((r.browserPerformanceTimeOrigin()||0)+t.startTime):r.timestampInSeconds(),l=r.getCurrentScope().getScopeData().transactionName,c=t?r.htmlTreeAsString(t.sources[0]?.node):"Layout shift",u={[r.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]:"auto.http.browser.cls",[r.SEMANTIC_ATTRIBUTE_SENTRY_OP]:"ui.webvital.cls",[r.SEMANTIC_ATTRIBUTE_EXCLUSIVE_TIME]:0,"sentry.pageload.span_id":n,"sentry.report_event":i};t?.sources&&t.sources.forEach(((e,t)=>{u[`cls.source.${t+1}`]=r.htmlTreeAsString(e.node)}));const d=a.startStandaloneWebVitalSpan({name:c,transaction:l,attributes:u,startTime:o});d&&(d.addEvent("cls",{[r.SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_UNIT]:"",[r.SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_VALUE]:e}),d.end(o))}t._sendStandaloneClsSpan=o,t.trackClsAsStandaloneSpan=function(e){let t,n=0;if(!a.supportsWebVital("layout-shift"))return;const r=i.addClsInstrumentationHandler((({metric:e})=>{const r=e.entries[e.entries.length-1];r&&(n=e.value,t=r)}),!0);a.listenForWebVitalReportEvents(e,((e,s)=>{o(n,t,s,e),r()}))}},12507(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(37872),s=n(23872),i=n(71604),a=r.defineIntegration((()=>({name:"ElementTiming",setup(){i.getBrowserPerformanceAPI()&&r.browserPerformanceTimeOrigin()&&s.addPerformanceInstrumentationHandler("element",(({entries:e})=>{for(const t of e){const e=t;if(!e.identifier)continue;const n=e.identifier,s=e.name,i=e.renderTime,a=e.loadTime,o={"sentry.origin":"auto.ui.browser.element_timing","ui.element.identifier":n};s&&(o["ui.element.paint_type"]=s),e.id&&(o["ui.element.id"]=e.id),e.element&&(o["ui.element.type"]=e.element.tagName.toLowerCase()),e.url&&(o["ui.element.url"]=e.url),e.naturalWidth&&(o["ui.element.width"]=e.naturalWidth),e.naturalHeight&&(o["ui.element.height"]=e.naturalHeight),i>0&&r.metrics.distribution("ui.element.render_time",i,{unit:"millisecond",attributes:o}),a>0&&r.metrics.distribution("ui.element.load_time",a,{unit:"millisecond",attributes:o})}}))}})));t.elementTimingIntegration=a,t.startTrackingElementTiming=function(){return()=>{}}},48412(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(37872),s=n(57742),i=n(23872),a=n(71604),o=[],l=new Map,c=new Map;const u={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 d(){return i.addInpInstrumentationHandler(h)}const h=({metric:e})=>{if(null==e.value)return;const t=a.msToSec(e.value);if(t>60)return;const n=e.entries.find((t=>t.duration===e.value&&u[t.name]));if(!n)return;const{interactionId:s}=n,i=u[n.name],o=a.msToSec(r.browserPerformanceTimeOrigin()+n.startTime),c=r.getActiveSpan(),d=c?r.getRootSpan(c):void 0,h=null!=s?l.get(s):void 0,f=h?.span||d,p=f?r.spanToJSON(f).description:r.getCurrentScope().getScopeData().transactionName,g=h?.elementName||r.htmlTreeAsString(n.target),m={[r.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]:"auto.http.browser.inp",[r.SEMANTIC_ATTRIBUTE_SENTRY_OP]:`ui.interaction.${i}`,[r.SEMANTIC_ATTRIBUTE_EXCLUSIVE_TIME]:n.duration},_=a.startStandaloneWebVitalSpan({name:g,transaction:p,attributes:m,startTime:o});_&&(_.addEvent("inp",{[r.SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_UNIT]:"millisecond",[r.SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_VALUE]:e.value}),_.end(o+t))};t.INP_ENTRY_MAP=u,t.MAX_PLAUSIBLE_INP_DURATION=60,t._onInp=h,t._trackINP=d,t.getCachedInteractionContext=function(e){return null!=e?l.get(e):void 0},t.registerInpInteractionListener=function(){const e=Object.keys(u);function t(e){const t=e.target;if(!t)return;const n=r.htmlTreeAsString(t),s=Math.round(e.timeStamp);if(c.set(s,n),c.size>50){const e=c.keys().next().value;void 0!==e&&c.delete(e)}}r.isBrowser()&&e.forEach((e=>{s.WINDOW.addEventListener(e,t,{capture:!0,passive:!0})}
1));const n=({entries:e})=>{const t=r.getActiveSpan(),n=t&&r.getRootSpan(t);e.forEach((e=>{if(!i.isPerformanceEventTiming(e))return;const t=e.interactionId;if(null==t)return;if(l.has(t))return;const s=e.target?r.htmlTreeAsString(e.target):function(e){const t=Math.round(e.startTime);let n=c.get(t);if(!n)for(let e=-5;e<=5;e++){const r=c.get(t+e);if(r){n=r;break}}return n||"<unknown>"}(e);if(o.length>10){const e=o.shift();l.delete(e)}o.push(t),l.set(t,{span:n,elementName:s})}))};i.addPerformanceInstrumentationHandler("event",n),i.addPerformanceInstrumentationHandler("first-input",n)},t.startTrackingINP=function(){if(a.getBrowserPerformanceAPI()&&r.browserPerformanceTimeOrigin()){const e=d();return()=>{e()}}return()=>{}}},23872(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(37872),s=n(78981),i=n(99462),a=n(28879),o=n(96505),l=n(1188),c=n(10763),u={},d={};let h,f,p,g;function m(e,t){const n=u[e];if(n?.length)for(const i of n)try{i(t)}catch(t){s.DEBUG_BUILD&&r.debug.error(`Error while triggering instrumentation handler.\nType: ${e}\nName: ${r.getFunctionName(i)}\nError:`,t)}}function _(){return i.onCLS((e=>{m("cls",{metric:e}),h=e}),{reportAllChanges:!0})}function T(){return o.onLCP((e=>{m("lcp",{metric:e}),f=e}),{reportAllChanges:!0})}function E(){return c.onTTFB((e=>{m("ttfb",{metric:e}),p=e}))}function y(){return a.onINP((e=>{m("inp",{metric:e}),g=e}))}function S(e,t,n,r,s=!1){let i;return v(e,t),d[e]||(i=n(),d[e]=!0),r&&t({metric:r}),b(e,t,s?i:void 0)}function v(e,t){u[e]=u[e]||[],u[e].push(t)}function b(e,t,n){return()=>{n&&n();const r=u[e];if(!r)return;const s=r.indexOf(t);-1!==s&&r.splice(s,1)}}t.addClsInstrumentationHandler=function(e,t=!1){return S("cls",e,_,h,t)},t.addInpInstrumentationHandler=function(e){return S("inp",e,y,g)},t.addLcpInstrumentationHandler=function(e,t=!1){return S("lcp",e,T,f,t)},t.addPerformanceInstrumentationHandler=function(e,t){return v(e,t),d[e]||(!function(e){const t={};"event"===e&&(t.durationThreshold=0);l.observe(e,(t=>{m(e,{entries:t})}),t)}(e),d[e]=!0),b(e,t)},t.addTtfbInstrumentationHandler=function(e){return S("ttfb",e,E,p)},t.isPerformanceEventTiming=function(e){return"duration"in e}},9986(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(37872),s=n(78981),i=n(23872),a=n(71604);function o(e){return null!=e&&e>0&&e<=6e4}function l(e,t,n,i){if(!o(e))return;s.DEBUG_BUILD&&r.debug.log(`Sending LCP span (${e})`);const l=a.msToSec((r.browserPerformanceTimeOrigin()||0)+(t?.startTime||0)),c=r.getCurrentScope().getScopeData().transactionName,u=t?r.htmlTreeAsString(t.element):"Largest contentful paint",d={[r.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]:"auto.http.browser.lcp",[r.SEMANTIC_ATTRIBUTE_SENTRY_OP]:"ui.webvital.lcp",[r.SEMANTIC_ATTRIBUTE_EXCLUSIVE_TIME]:0,"sentry.pageload.span_id":n,"sentry.report_event":i};t&&(t.element&&(d["lcp.element"]=r.htmlTreeAsString(t.element)),t.id&&(d["lcp.id"]=t.id),t.url&&(d["lcp.url"]=t.url),null!=t.loadTime&&(d["lcp.loadTime"]=t.loadTime),null!=t.renderTime&&(d["lcp.renderTime"]=t.renderTime),null!=t.size&&(d["lcp.size"]=t.size));const h=a.startStandaloneWebVitalSpan({name:u,transaction:c,attributes:d,startTime:l});h&&(h.addEvent("lcp",{[r.SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_UNIT]:"millisecond",[r.SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_VALUE]:e}),h.end(l))}t.MAX_PLAUSIBLE_LCP_DURATION=6e4,t._sendStandaloneLcpSpan=l,t.isValidLcpMetric=o,t.trackLcpAsStandaloneSpan=function(e){let t,n=0;if(!a.supportsWebVital("largest-contentful-paint"))return;const r=i.addLcpInstrumentationHandler((({metric:e})=>{const r=e.entries[e.entries.length-1];r&&o(e.value)&&(n=e.value,t=r)}),!0);a.listenForWebVitalReportEvents(e,((e,s)=>{l(n,t,s,e),r()}))}},62843(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(37872),s=n(71604);function i(e){return e?((r.browserPerformanceTimeOrigin()||performance.timeOrigin)+e)/1e3:e}t.resourceTimingToSpanAttributes=function(e){const t={};if(null!=e.nextHopProtocol){const{name:n,version:r}=s.extractNetworkProtocol(e.nextHopProtocol);t["network.protocol.version"]=r,t["network.protocol.name"]=n}return r.browserPerformanceTimeOrigin()||s.getBrowserPerformanceAPI()?.timeOrigin?(n={...t,"http.request.redirect_start":i(e.redirectStart),"http.request.redirect_end":i(e.redirectEnd),"http.request.worker_start":i(e.workerStart),"http.request.fetch_start":i(e.fetchStart),"http.request.domain_lookup_start":i(e.domainLookupStart),"http.request.domain_lookup_end":i(e.domainLookupEnd),"http.request.connect_start":i(e.connectStart),"http.request.secure_connection_start":i(e.secureConnectionStart),"http.request.connection_end":i(e.connectEnd),"http.request.request_start":i(e.requestStart),"http.request.response_start":i(e.responseStart),"http.request.response_end":i(e.responseEnd),"http.request.time_to_first_byte":null!=e.responseStart?e.responseStart/1e3:void 0},Object.fromEntries(Object.entries(n).filter((([,e])=>null!=e)))):t;var n}},71604(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(37872),s=n(57742),i=n(33851);t.extractNetworkProtocol=function(e){let t="unknown",n="unknown",r="";for(const s of e){if("/"===s){[t,n]=e.split("/");break}if(!isNaN(Number(s))){t="h"===r?"http":r,n=e.split(r)[1];break}r+=s}
1return r===e&&(t=r),{name:t,version:n}},t.getBrowserPerformanceAPI=function(){return s.WINDOW.addEventListener&&s.WINDOW.performance},t.isMeasurementValue=function(e){return"number"==typeof e&&isFinite(e)},t.listenForWebVitalReportEvents=function(e,t){let n,r=!1;function s(e){!r&&n&&t(e,n.spanContext().spanId,n),r=!0}i.onHidden((()=>{s("pagehide")}));const a=e.on("beforeStartNavigationSpan",((e,t)=>{t?.isRedirect||(s("navigation"),a(),o())})),o=e.on("afterStartPageLoadSpan",(e=>{n=e,o()}))},t.msToSec=function(e){return e/1e3},t.startAndEndSpan=function(e,t,n,{...s}){const i=r.spanToJSON(e).start_timestamp;return i&&i>t&&"function"==typeof e.updateStartTime&&e.updateStartTime(t),r.withActiveSpan(e,(()=>{const e=r.startInactiveSpan({startTime:t,...s});return e&&e.end(n),e}))},t.startStandaloneWebVitalSpan=function(e){const t=r.getClient();if(!t)return;const{name:n,transaction:i,attributes:a,startTime:o}=e,{release:l,environment:c,sendDefaultPii:u}=t.getOptions(),d=t.getIntegrationByName("Replay"),h=d?.getReplayId(),f=r.getCurrentScope(),p=f.getUser(),g=void 0!==p?p.email||p.id||p.ip_address:void 0;let m;try{m=f.getScopeData().contexts.profile.profile_id}catch{}const _={release:l,environment:c,user:g||void 0,profile_id:m||void 0,replay_id:h||void 0,transaction:i,"user_agent.original":s.WINDOW.navigator?.userAgent,"client.address":u?"{{auto}}":void 0,...a};return r.startInactiveSpan({name:n,attributes:_,startTime:o,experimental:{standalone:!0}})},t.supportsWebVital=function(e){try{return PerformanceObserver.supportedEntryTypes.includes(e)}catch{return!1}}},99462(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(57742),s=n(91872),i=n(30750),a=n(3940),o=n(29167),l=n(80099),c=n(1188),u=n(79212),d=n(79750),h=[.1,.25];t.CLSThresholds=h,t.onCLS=(e,t={})=>{d.onFCP(u.runOnce((()=>{const n=a.initMetric("CLS",0);let u;const d=i.getVisibilityWatcher(),f=o.initUnique(t,l.LayoutShiftManager),p=e=>{for(const t of e)f._processEntry(t);f._sessionValue>n.value&&(n.value=f._sessionValue,n.entries=f._sessionEntries,u())},g=c.observe("layout-shift",p);g&&(u=s.bindReporter(e,n,h,t.reportAllChanges),d.onHidden((()=>{p(g.takeRecords()),u(!0)})),r.WINDOW?.setTimeout?.(u))})))}},28879(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(91872),s=n(30750),i=n(3940),a=n(29167),o=n(93181),l=n(1188),c=n(45135),u=n(20135),d=n(37185),h=[200,500];t.INPThresholds=h,t.onINP=(e,t={})=>{if(!globalThis.PerformanceEventTiming||!("interactionId"in PerformanceEventTiming.prototype))return;const n=s.getVisibilityWatcher();u.whenActivated((()=>{c.initInteractionCountPolyfill();const s=i.initMetric("INP");let u;const f=a.initUnique(t,o.InteractionManager),p=e=>{d.whenIdleOrHidden((()=>{for(const t of e)f._processEntry(t);const t=f._estimateP98LongestInteraction();t&&t._latency!==s.value&&(s.value=t._latency,s.entries=t.entries,u())}))},g=l.observe("event",p,{durationThreshold:t.durationThreshold??40});u=r.bindReporter(e,s,h,t.reportAllChanges),g&&(g.observe({type:"first-input",buffered:!0}),n.onHidden((()=>{p(g.takeRecords()),u(!0)})))}))}},96505(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(91872),s=n(12990),i=n(30750),a=n(41752),o=n(3940),l=n(29167),c=n(41632),u=n(1188),d=n(79212),h=n(20135),f=n(37185),p=[2500,4e3];t.LCPThresholds=p,t.onLCP=(e,t={})=>{h.whenActivated((()=>{const n=i.getVisibilityWatcher(),h=o.initMetric("LCP");let g;const m=l.initUnique(t,c.LCPEntryManager),_=e=>{t.reportAllChanges||(e=e.slice(-1));for(const t of e)m._processEntry(t),t.startTime<n.firstHiddenTime&&(h.value=Math.max(t.startTime-s.getActivationStart(),0),h.entries=[t],g())},T=u.observe("largest-contentful-paint",_);if(T){g=r.bindReporter(e,h,p,t.reportAllChanges);const n=d.runOnce((()=>{_(T.takeRecords()),T.disconnect(),g(!0)})),s=e=>{e.isTrusted&&(f.whenIdleOrHidden(n),a.removePageListener(e.type,s,{capture:!0}))};for(const e of["keydown","click","visibilitychange"])a.addPageListener(e,s,{capture:!0})}}))}},93181(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(45135);let s=0;class i{constructor(){i.prototype.__init.call(this),i.prototype.__init2.call(this)}__init(){this._longestInteractionList=[]}__init2(){this._longestInteractionMap=new Map}_resetInteractions(){s=r.getInteractionCount(),this._longestInteractionList.length=0,this._longestInteractionMap.clear()}_estimateP98LongestInteraction(){const e=Math.min(this._longestInteractionList.length-1,Math.floor((r.getInteractionCount()-s)/50));return this._longestInteractionList[e]}_processEntry(e){if(this._onBeforeProcessingEntry?.(e),!e.interactionId&&"first-input"!==e.entryType)return;const t=this._longestInteractionList.at(-1);let n=this._longestInteractionMap.get(e.interactionId);if(n||this._longestInteractionList.length<10||e.duration>t._latency){if(n?e.duration>n._latency?(n.entries=[e],n._latency=e.duration):e.duration===n._latency&&e.startTime===n.entries[0].startTime&&n.entries.push(e):(n={id:e.interactionId,entries:[e],_latency:e.duration},this._longestInteractionMap.set(n.id,n),this._longestInteractionList.push(n)),this._longestInteractionList.sort(((e,t)=>t._latency-e._latency)),this._longestInteractionList.length>10){const e=this._longestInteractionList.splice(10);for(const t of e)this._longestInteractionMap.delete(t.id)}this._onAfterProcessingINPCandidate?.(n)}}}t.InteractionManager=i},41632(e,t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});t.LCPEntryManager=class{_processEntry(e){this._onBeforeProcessingEntry?.(e)}}},80099(e,t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});
1class n{constructor(){n.prototype.__init.call(this),n.prototype.__init2.call(this)}__init(){this._sessionValue=0}__init2(){this._sessionEntries=[]}_processEntry(e){if(e.hadRecentInput)return;const t=this._sessionEntries[0],n=this._sessionEntries[this._sessionEntries.length-1];this._sessionValue&&t&&n&&e.startTime-n.startTime<1e3&&e.startTime-t.startTime<5e3?(this._sessionValue+=e.value,this._sessionEntries.push(e)):(this._sessionValue=e.value,this._sessionEntries=[e]),this._onAfterProcessingUnexpectedShift?.(e)}}t.LayoutShiftManager=n},91872(e,t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});t.bindReporter=(e,t,n,r)=>{let s,i;return a=>{t.value>=0&&(a||r)&&(i=t.value-(s??0),(i||void 0===s)&&(s=t.value,t.delta=i,t.rating=((e,t)=>e>t[1]?"poor":e>t[0]?"needs-improvement":"good")(t.value,n),e(t)))}}},47295(e,t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});t.generateUniqueID=()=>`v5-${Date.now()}-${Math.floor(8999999999999*Math.random())+1e12}`},12990(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(45476);t.getActivationStart=()=>{const e=r.getNavigationEntry();return e?.activationStart??0}},45476(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(57742);t.getNavigationEntry=(e=!0)=>{const t=r.WINDOW.performance?.getEntriesByType?.("navigation")[0];if(!e||t&&t.responseStart>0&&t.responseStart<performance.now())return t}},30750(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(57742),s=n(12990),i=n(41752);let a=-1;const o=new Set,l=e=>{if(function(e){return"pagehide"===e.type||"hidden"===r.WINDOW.document?.visibilityState}(e)&&a>-1){if("visibilitychange"===e.type||"pagehide"===e.type)for(const e of o)e();isFinite(a)||(a="visibilitychange"===e.type?e.timeStamp:0,i.removePageListener("prerenderingchange",l,!0))}};t.getVisibilityWatcher=()=>{if(r.WINDOW.document&&a<0){const e=s.getActivationStart(),t=r.WINDOW.document.prerendering?void 0:globalThis.performance.getEntriesByType("visibility-state").filter((t=>"hidden"===t.name&&t.startTime>e))[0]?.startTime;a=t??("hidden"!==r.WINDOW.document?.visibilityState||r.WINDOW.document?.prerendering?1/0:0),i.addPageListener("visibilitychange",l,!0),i.addPageListener("pagehide",l,!0),i.addPageListener("prerenderingchange",l,!0)}return{get firstHiddenTime(){return a},onHidden(e){o.add(e)}}}},41752(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(57742);t.addPageListener=function(e,t,n){r.WINDOW.document&&r.WINDOW.addEventListener(e,t,n)},t.removePageListener=function(e,t,n){r.WINDOW.document&&r.WINDOW.removeEventListener(e,t,n)}},3940(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(57742),s=n(47295),i=n(12990),a=n(45476);t.initMetric=(e,t=-1)=>{const n=a.getNavigationEntry();let o="navigate";n&&(r.WINDOW.document?.prerendering||i.getActivationStart()>0?o="prerender":r.WINDOW.document?.wasDiscarded?o="restore":n.type&&(o=n.type.replace(/_/g,"-")));return{name:e,value:t,rating:"good",delta:0,entries:[],id:s.generateUniqueID(),navigationType:o}}},29167(e,t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const n=new WeakMap;t.initUnique=function(e,t){try{return n.get(e)||n.set(e,new t),n.get(e)}catch(e){return new t}}},1188(e,t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});t.observe=(e,t,n={})=>{try{if(PerformanceObserver.supportedEntryTypes.includes(e)){const r=new PerformanceObserver((e=>{Promise.resolve().then((()=>{t(e.getEntries())}))}));return r.observe({type:e,buffered:!0,...n}),r}}catch{}}},33851(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(57742),s=n(41752);t.onHidden=e=>{const t=t=>{"pagehide"!==t.type&&"hidden"!==r.WINDOW.document?.visibilityState||e(t)};s.addPageListener("visibilitychange",t,{capture:!0,once:!0}),s.addPageListener("pagehide",t,{capture:!0,once:!0})}},45135(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(1188);let s=0,i=1/0,a=0;const o=e=>{e.forEach((e=>{e.interactionId&&(i=Math.min(i,e.interactionId),a=Math.max(a,e.interactionId),s=a?(a-i)/7+1:0)}))};let l;t.getInteractionCount=()=>l?s:performance.interactionCount||0,t.initInteractionCountPolyfill=()=>{"interactionCount"in performance||l||(l=r.observe("event",o,{type:"event",buffered:!0,durationThreshold:0}))}},79212(e,t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});t.runOnce=e=>{let t=!1;return()=>{t||(e(),t=!0)}}},20135(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(57742);t.whenActivated=e=>{r.WINDOW.document?.prerendering?addEventListener("prerenderingchange",(()=>e()),!0):e()}},37185(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(57742),s=n(41752),i=n(79212);t.whenIdleOrHidden=e=>{const t=r.WINDOW.requestIdleCallback||r.WINDOW.setTimeout;"hidden"===r.WINDOW.document?.visibilityState?e():(e=i.runOnce(e),s.addPageListener("visibilitychange",e,{once:!0,capture:!0}),s.addPageListener("pagehide",e,{once:!0,capture:!0}),t((()=>{e(),s.removePageListener("visibilitychange",e,{capture:!0}),s.removePageListener("pagehide",e,{capture:!0})}
1)))}},79750(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(91872),s=n(12990),i=n(30750),a=n(3940),o=n(1188),l=n(20135),c=[1800,3e3];t.FCPThresholds=c,t.onFCP=(e,t={})=>{l.whenActivated((()=>{const n=i.getVisibilityWatcher(),l=a.initMetric("FCP");let u;const d=o.observe("paint",(e=>{for(const t of e)"first-contentful-paint"===t.name&&(d.disconnect(),t.startTime<n.firstHiddenTime&&(l.value=Math.max(t.startTime-s.getActivationStart(),0),l.entries.push(t),u(!0)))}));d&&(u=r.bindReporter(e,l,c,t.reportAllChanges))}))}},10763(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(57742),s=n(91872),i=n(12990),a=n(45476),o=n(3940),l=n(20135),c=[800,1800],u=e=>{r.WINDOW.document?.prerendering?l.whenActivated((()=>u(e))):"complete"!==r.WINDOW.document?.readyState?addEventListener("load",(()=>u(e)),!0):setTimeout(e)};t.TTFBThresholds=c,t.onTTFB=(e,t={})=>{const n=o.initMetric("TTFB"),r=s.bindReporter(e,n,c,t.reportAllChanges);u((()=>{const e=a.getNavigationEntry();e&&(n.value=Math.max(e.responseStart-i.getActivationStart(),0),n.entries=[e],r(!0))}))}},15028(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(37872),s=n(78981),i=n(57742),a=n(48412),o=n(23872),l=n(9986),c=n(71604);function u(e){const{name:t,op:n,origin:s,metricName:a,value:o,attributes:l,parentSpan:c,reportEvent:u,startTime:d,endTime:h}=e,f=r.getCurrentScope().getScopeData().transactionName,p={[r.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]:s,[r.SEMANTIC_ATTRIBUTE_SENTRY_OP]:n,[r.SEMANTIC_ATTRIBUTE_EXCLUSIVE_TIME]:0,[`browser.web_vital.${a}.value`]:o,"sentry.transaction":f,"user_agent.original":i.WINDOW.navigator?.userAgent,...l};c&&"pageload"===r.spanToStreamedSpanJSON(c).attributes?.[r.SEMANTIC_ATTRIBUTE_SENTRY_OP]&&(p["sentry.pageload.span_id"]=c.spanContext().spanId),u&&(p[`browser.web_vital.${a}.report_event`]=u);const g=r.startInactiveSpan({name:t,attributes:p,startTime:d,parentSpan:c});g&&g.end(h??d)}function d(e,t,n,i){if(!l.isValidLcpMetric(e))return;s.DEBUG_BUILD&&r.debug.log(`Sending LCP span (${e})`);const a=r.browserPerformanceTimeOrigin()||0,o=c.msToSec(a),d=c.msToSec(a+(t?.startTime||0)),h=t?r.htmlTreeAsString(t.element):"Largest contentful paint",f={};t?.element&&(f["browser.web_vital.lcp.element"]=r.htmlTreeAsString(t.element)),t?.id&&(f["browser.web_vital.lcp.id"]=t.id),t?.url&&(f["browser.web_vital.lcp.url"]=t.url),null!=t?.loadTime&&(f["browser.web_vital.lcp.load_time"]=t.loadTime),null!=t?.renderTime&&(f["browser.web_vital.lcp.render_time"]=t.renderTime),null!=t?.size&&(f["browser.web_vital.lcp.size"]=t.size),u({name:h,op:"ui.webvital.lcp",origin:"auto.http.browser.lcp",metricName:"lcp",value:e,attributes:f,parentSpan:n,reportEvent:i,startTime:o,endTime:d})}function h(e,t,n,i){s.DEBUG_BUILD&&r.debug.log(`Sending CLS span (${e})`);const a=t?c.msToSec((r.browserPerformanceTimeOrigin()||0)+t.startTime):r.timestampInSeconds(),o=t?r.htmlTreeAsString(t.sources[0]?.node):"Layout shift",l={};t?.sources&&t.sources.forEach(((e,t)=>{l[`browser.web_vital.cls.source.${t+1}`]=r.htmlTreeAsString(e.node)})),u({name:o,op:"ui.webvital.cls",origin:"auto.http.browser.cls",metricName:"cls",value:e,attributes:l,parentSpan:n,reportEvent:i,startTime:a})}function f(e,t){s.DEBUG_BUILD&&r.debug.log(`Sending INP span (${e})`);const n=c.msToSec(r.browserPerformanceTimeOrigin()+t.startTime),i=c.msToSec(e),o=a.INP_ENTRY_MAP[t.name],l=a.getCachedInteractionContext(t.interactionId),d=r.getActiveSpan(),h=d?r.getRootSpan(d):void 0,f=l?.span||h,p=f?r.spanToStreamedSpanJSON(f).name:r.getCurrentScope().getScopeData().transactionName;u({name:l?.elementName||r.htmlTreeAsString(t.target),op:`ui.interaction.${o}`,origin:"auto.http.browser.inp",metricName:"inp",value:e,attributes:{[r.SEMANTIC_ATTRIBUTE_EXCLUSIVE_TIME]:t.duration,"sentry.transaction":p},startTime:n,endTime:n+i,parentSpan:f})}t._emitWebVitalSpan=u,t._sendClsSpan=h,t._sendInpSpan=f,t._sendLcpSpan=d,t.trackClsAsSpan=function(e){let t,n=0;if(!c.supportsWebVital("layout-shift"))return;const r=o.addClsInstrumentationHandler((({metric:e})=>{const r=e.entries[e.entries.length-1];r&&(n=e.value,t=r)}),!0);c.listenForWebVitalReportEvents(e,((e,s,i)=>{h(n,t,i,e),r()}))},t.trackInpAsSpan=function(){if(!c.getBrowserPerformanceAPI()||!r.browserPerformanceTimeOrigin())return;o.addInpInstrumentationHandler((({metric:e})=>
1{if(null==e.value)return;if(c.msToSec(e.value)>a.MAX_PLAUSIBLE_INP_DURATION)return;const t=e.entries.find((t=>t.duration===e.value&&a.INP_ENTRY_MAP[t.name]));t&&f(e.value,t)}))},t.trackLcpAsSpan=function(e){let t,n=0;if(!c.supportsWebVital("largest-contentful-paint"))return;const r=o.addLcpInstrumentationHandler((({metric:e})=>{const r=e.entries[e.entries.length-1];r&&l.isValidLcpMetric(e.value)&&(n=e.value,t=r)}),!0);c.listenForWebVitalReportEvents(e,((e,s,i)=>{d(n,t,i,e),r()}))}},82028(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(37872),s=n(78981),i=Symbol.for("sentry__originalRequestBody");function a(e){return new URLSearchParams(e).toString()}t.ORIGINAL_REQ_BODY=i,t.getBodyString=function(e,t=r.debug){try{if("string"==typeof e)return[e];if(e instanceof URLSearchParams)return[e.toString()];if(e instanceof FormData)return[a(e)];if(!e)return[void 0]}catch(n){return s.DEBUG_BUILD&&t.error(n,"Failed to serialize body",e),[void 0,"BODY_PARSE_ERROR"]}return s.DEBUG_BUILD&&t.log("Skipping network body because of body type",e),[void 0,"UNPARSEABLE_BODY_TYPE"]},t.getFetchRequestArgBody=function(e=[]){if(e.length>=2&&e[1]&&"object"==typeof e[1]&&"body"in e[1])return e[1].body;if(e.length>=1&&e[0]instanceof Request){const t=e[0][i];return void 0!==t?t:void 0}},t.parseXhrResponseHeaders=function(e){let t;try{t=e.getAllResponseHeaders()}catch(t){return s.DEBUG_BUILD&&r.debug.error(t,"Failed to get xhr response headers",e),{}}return t?t.split("\r\n").reduce(((e,t)=>{const[n,r]=t.split(": ");return r&&(e[n.toLowerCase()]=r),e}),{}):{}},t.serializeFormData=a},57742(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(37872).GLOBAL_OBJ;t.WINDOW=r},66532(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(37872),s=r.GLOBAL_OBJ,i=s.document,a=s.navigator,o="Report a Bug",l="Unable to submit feedback with empty message",c="No client setup, cannot send feedback.",u="Unable to determine if Feedback was correctly sent.",d="Unable to send feedback. This could be because this domain is not in your list of allowed domains.",h="Unable to send feedback. This could be because of network issues, or because you are using an ad-blocker.",f={ERROR_EMPTY_MESSAGE:l,ERROR_NO_CLIENT:c,ERROR_TIMEOUT:u,ERROR_FORBIDDEN:d,ERROR_GENERIC:h};function p(e,t){return t?.[e]??f[e]}function g(e,t){return new Error(p(e,t))}const m=(e,t={includeReplay:!0})=>{const n=t.errorMessages;if(!e.message)throw g("ERROR_EMPTY_MESSAGE",n);const s=r.getClient();if(!s)throw g("ERROR_NO_CLIENT",n);e.tags&&Object.keys(e.tags).length&&r.getCurrentScope().setTags(e.tags);const i=r.captureFeedback({source:"api",url:r.getLocationHref(),...e},t);return new Promise(((e,t)=>{const r=setTimeout((()=>{a(),t(p("ERROR_TIMEOUT",n))}),3e4),a=s.on("afterSendEvent",((s,o)=>{if(s.event_id===i)return clearTimeout(r),a(),o?.statusCode&&o.statusCode>=200&&o.statusCode<300?e(i):t(p(403===o?.statusCode?"ERROR_FORBIDDEN":"ERROR_GENERIC",n))}
1))}))},_="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__;function T(e,t){return{...e,...t,tags:{...e.tags,...t.tags},onFormOpen:()=>{t.onFormOpen?.(),e.onFormOpen?.()},onFormClose:()=>{t.onFormClose?.(),e.onFormClose?.()},onSubmitSuccess:(n,r)=>{t.onSubmitSuccess?.(n,r),e.onSubmitSuccess?.(n,r)},onSubmitError:n=>{t.onSubmitError?.(n),e.onSubmitError?.(n)},onFormSubmitted:()=>{t.onFormSubmitted?.(),e.onFormSubmitted?.()},themeDark:{...e.themeDark,...t.themeDark},themeLight:{...e.themeLight,...t.themeLight}}}function E(e,t){return Object.entries(t).forEach((([t,n])=>{e.setAttributeNS(null,t,n)})),e}function y({triggerLabel:e,triggerAriaLabel:t,shadow:n,styleNonce:r}){const a=i.createElement("button");if(a.type="button",a.className="widget__actor",a.ariaHidden="false",a.ariaLabel=t||e||o,a.appendChild(function(){const e=e=>s.document.createElementNS("http://www.w3.org/2000/svg",e),t=E(e("svg"),{width:"20",height:"20",viewBox:"0 0 20 20",fill:"var(--actor-color, var(--foreground))"}),n=E(e("g"),{clipPath:"url(#clip0_57_80)"}),r=E(e("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"});t.appendChild(n).appendChild(r);const i=e("defs"),a=E(e("clipPath"),{id:"clip0_57_80"}),o=E(e("rect"),{width:"20",height:"20",fill:"white"});return a.appendChild(o),i.appendChild(a),t.appendChild(i).appendChild(a).appendChild(o),t}()),e){const t=i.createElement("span");t.appendChild(i.createTextNode(e)),a.appendChild(t)}const l=function(e){const t=i.createElement("style");return t.textContent='\n.widget__actor {\n  position: fixed;\n  z-index: var(--z-index);\n  margin: var(--page-margin);\n  inset: var(--actor-inset);\n\n  display: flex;\n  align-items: center;\n  gap: 8px;\n  padding: 16px;\n\n  font-family: inherit;\n  font-size: var(--font-size);\n  font-weight: 600;\n  line-height: 1.14em;\n  text-decoration: none;\n\n  background: var(--actor-background, var(--background));\n  border-radius: var(--actor-border-radius, 1.7em/50%);\n  border: var(--actor-border, var(--border));
1\n  box-shadow: var(--actor-box-shadow, var(--box-shadow));\n  color: var(--actor-color, var(--foreground));\n  fill: var(--actor-color, var(--foreground));\n  cursor: pointer;\n  opacity: 1;\n  transition: transform 0.2s ease-in-out;\n  transform: translate(0, 0) scale(1);\n}\n.widget__actor[aria-hidden="true"] {\n  opacity: 0;\n  pointer-events: none;\n  visibility: hidden;\n  transform: translate(0, 16px) scale(0.98);\n}\n\n.widget__actor:hover {\n  background: var(--actor-hover-background, var(--background));\n  filter: var(--interactive-filter);\n}\n\n.widget__actor svg {\n  width: 1.14em;\n  height: 1.14em;\n}\n\n@media (max-width: 600px) {\n  .widget__actor span {\n    display: none;\n  }\n}\n',e&&t.setAttribute("nonce",e),t}(r);return{el:a,appendToDom(){n.appendChild(l),n.appendChild(a)},removeFromDom(){a.remove(),l.remove()},show(){a.ariaHidden="false"},hide(){a.ariaHidden="true"}}}const S="rgba(88, 74, 192, 1)",v={foreground:"#2b2233",background:"#ffffff",accentForeground:"white",accentBackground:S,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%)"},b={foreground:"#ebe6ef",background:"#29232f",accentForeground:"white",accentBackground:S,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 I(e){return`\n  --foreground: ${e.foreground};\n  --background: ${e.background};\n  --accent-foreground: ${e.accentForeground};\n  --accent-background: ${e.accentBackground};\n  --success-color: ${e.successColor};\n  --error-color: ${e.errorColor};\n  --border: ${e.border};\n  --box-shadow: ${e.boxShadow};\n  --outline: ${e.outline};\n  --interactive-filter: ${e.interactiveFilter};\n  `}function A({colorScheme:e,themeDark:t,themeLight:n,styleNonce:r}){const s=i.createElement("style");return s.textContent=`\n:host {\n  --font-family: system-ui, 'Helvetica Neue', Arial, sans-serif;\n  --font-size: 14px;\n  --z-index: 100000;\n\n  --page-margin: 16px;\n  --inset: auto 0 0 auto;\n  --actor-inset: var(--inset);\n\n  font-family: var(--font-family);\n  font-size: var(--font-size);\n\n  ${"system"!==e?`color-scheme: only ${e};`:""}\n\n  ${I("dark"===e?{...b,...t}:{...v,...n})}\n}\n\n${"system"===e?`\n@media (prefers-color-scheme: dark) {\n  :host {\n    color-scheme: only dark;\n\n    ${I({...b,...t})}\n  }\n}`:""}\n`,r&&s.setAttribute("nonce",r),s}var R,C,k,L,O,N,w,P={},M=[],D=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,x=Array.isArray;function U(e,t){for(var n in t)e[n]=t[n];return e}function B(e){var t=e.parentNode;t&&t.removeChild(e)}function F(e,t,n){var r,s,i,a={};for(i in t)"key"==i?r=t[i]:"ref"==i?s=t[i]:a[i]=t[i];if(arguments.length>2&&(a.children=arguments.length>3?R.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(i in e.defaultProps)void 0===a[i]&&(a[i]=e.defaultProps[i]);return $(e,a,r,s,null)}function $(e,t,n,r,s){var i={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==s?++k:s,__i:-1,__u:0};return null==s&&null!=C.vnode&&C.vnode(i),i}function G(e){return e.children}function H(e,t){this.props=e,this.context=t}function j(e,t){if(null==t)return e.__?j(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?j(e):null}function W(e,t,n){var r,s=e.__v,i=s.__e,a=e.__P;if(a)return(r=U({},s)).__v=s.__v+1,C.vnode&&C.vnode(r),te(a,r,s,e.__n,void 0!==a.ownerSVGElement,32&s.__u?[i]:null,t,null==i?j(s):i,!!(32&s.__u),n),r.__.__k[r.__i]=r,r.__d=void 0,r.__e!=i&&K(r),r}function K(e){var t,n;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e){e.__e=e.__c.base=n.__e;break}return K(e)}}function V(e){(!e.__d&&(e.__d=!0)&&L.push(e)&&!q.__r++||O!==C.debounceRendering)&&((O=C.debounceRendering)||N)(q)}function q(){var e,t,n,r=[],s=[];for(L.sort(w);e=L.shift();)e.__d&&(n=L.length,t=W(e,r,s)||t,0===n||L.length>n?(ne(r,t,s),s.length=r.length=0,t=void 0,L.sort(w)):t&&C.__c&&C.__c(t,M));t&&ne(r,t,s),q.__r=0}function Y(e,t,n,r,s,i,a,o,l,c,u){var d,h,f,p,g,m=r&&r.__k||M,_=t.length;for(n.__d=l,function(e,t,n){var r,s,i,a,o,l=t.length,c=n.length,u=c,d=0;for(e.__k=[],r=0;r<l;r++)null!=(s=e.__k[r]=null==(s=t[r])||"boolean"==typeof s||"function"==typeof s?null:"string"==typeof s||"number"==typeof s||"bigint"==typeof s||s.constructor==String?$(null,s,null,null,s):x(s)?$(G,{children:s},null,null,null):void 0===s.constructor&&s.__b>0?$(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):s)?(s.__=e,s.__b=e.__b+1,o=J(s,n,a=r+d,u),s.__i=o,i=null,-1!==o&&(u--,(i=n[o])&&(i.__u|=131072)),null==i||null===i.__v?(-1==o&&d--,"function"!=typeof s.type&&(s.__u|=65536)):o!==a&&(o===a+1?d++:o>a?u>
vendor: 4,595 bytes, line 1
1l-a?d+=o-a:d--:d=o<a&&o==a-1?o-a:0,o!==r+d&&(s.__u|=65536))):(i=n[r])&&null==i.key&&i.__e&&(i.__e==e.__d&&(e.__d=j(i)),ie(i,i,!1),n[r]=null,u--);if(u)for(r=0;r<c;r++)null!=(i=n[r])&&!(131072&i.__u)&&(i.__e==e.__d&&(e.__d=j(i)),ie(i,i))}(n,t,m),l=n.__d,d=0;d<_;d++)null!=(f=n.__k[d])&&"boolean"!=typeof f&&"function"!=typeof f&&(h=-1===f.__i?P:m[f.__i]||P,f.__i=d,te(e,f,h,s,i,a,o,l,c,u),p=f.__e,f.ref&&h.ref!=f.ref&&(h.ref&&se(h.ref,null,f),u.push(f.ref,f.__c||p,f)),null==g&&null!=p&&(g=p),65536&f.__u||h.__k===f.__k?l=z(f,l,e):"function"==typeof f.type&&void 0!==f.__d?l=f.__d:p&&(l=p.nextSibling),f.__d=void 0,f.__u&=-196609);n.__d=l,n.__e=g}function z(e,t,n){var r,s;if("function"==typeof e.type){for(r=e.__k,s=0;r&&s<r.length;s++)r[s]&&(r[s].__=e,t=z(r[s],t,n));return t}e.__e!=t&&(n.insertBefore(e.__e,t||null),t=e.__e);do{t=t&&t.nextSibling}while(null!=t&&8===t.nodeType);return t}function J(e,t,n,r){var s=e.key,i=e.type,a=n-1,o=n+1,l=t[n];if(null===l||l&&s==l.key&&i===l.type)return n;if(r>(null==l||131072&l.__u?0:1))for(;a>=0||o<t.length;){if(a>=0){if((l=t[a])&&!(131072&l.__u)&&s==l.key&&i===l.type)return a;a--}if(o<t.length){if((l=t[o])&&!(131072&l.__u)&&s==l.key&&i===l.type)return o;o++}}return-1}function X(e,t,n){"-"===t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||D.test(t)?n:n+"px"}function Q(e,t,n,r,s){var i;e:if("style"===t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof r&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||X(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||X(e.style,t,n[t])}else if("o"===t[0]&&"n"===t[1])i=t!==(t=t.replace(/(PointerCapture)$|Capture$/i,"$1")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=n,n?r?n.u=r.u:(n.u=Date.now(),e.addEventListener(t,i?ee:Z,i)):e.removeEventListener(t,i?ee:Z,i);else{if(s)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!==t&&"height"!==t&&"href"!==t&&"list"!==t&&"form"!==t&&"tabIndex"!==t&&"download"!==t&&"rowSpan"!==t&&"colSpan"!==t&&"role"!==t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null==n||!1===n&&"-"!==t[4]?e.removeAttribute(t):e.setAttribute(t,n))}}function Z(e){if(this.l){var t=this.l[e.type+!1];if(e.t){if(e.t<=t.u)return}else e.t=Date.now();return t(C.event?C.event(e):e)}}function ee(e){if(this.l)return this.l[e.type+!0](C.event?C.event(e):e)}function te(e,t,n,r,s,i,a,o,l,c){var u,d,h,f,p,g,m,_,T,E,y,S,v,b,I,A=t.type;if(void 0!==t.constructor)return null;128&n.__u&&(l=!!(32&n.__u),i=[o=t.__e=n.__e]),(u=C.__b)&&u(t);e:if("function"==typeof A)try{if(_=t.props,T=(u=A.contextType)&&r[u.__c],E=u?T?T.props.value:u.__:r,n.__c?m=(d=t.__c=n.__c).__=d.__E:("prototype"in A&&A.prototype.render?t.__c=d=new A(_,E):(t.__c=d=new H(_,E),d.constructor=A,d.render=ae),T&&T.sub(d),d.props=_,d.state||(d.state={}),d.context=E,d.__n=r,h=d.__d=!0,d.__h=[],d._sb=[]),null==d.__s&&(d.__s=d.state),null!=A.getDerivedStateFromProps&&(d.__s==d.state&&(d.__s=U({},d.__s)),U(d.__s,A.getDerivedStateFromProps(_,d.__s))),f=d.props,p=d.state,d.__v=t,h)null==A.getDerivedStateFromProps&&null!=d.componentWillMount&&d.componentWillMount(),null!=d.componentDidMount&&d.__h.push(d.componentDidMount);else{if(null==A.getDerivedStateFromProps&&_!==f&&null!=d.componentWillReceiveProps&&d.componentWillReceiveProps(_,E),!d.__e&&(null!=d.shouldComponentUpdate&&!1===d.shouldComponentUpdate(_,d.__s,E)||t.__v===n.__v)){for(t.__v!==n.__v&&(d.props=_,d.state=d.__s,d.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.forEach((function(e){e&&(e.__=t)})),y=0;y<d._sb.length;y++)d.__h.push(d._sb[y]);d._sb=[],d.__h.length&&a.push(d);break e}null!=d.componentWillUpdate&&d.componentWillUpdate(_,d.__s,E),null!=d.componentDidUpdate&&d.__h.push((function(){d.componentDidUpdate(f,p,g)}))}if(d.context=E,d.props=_,d.__P=e,d.__e=!1,S=C.__r,v=0,"prototype"in A&&A.prototype.render){for(d.state=d.__s,d.__d=!1,S&&S(t),u=d.render(d.props,d.state,d.context),b=0;b<d._sb.length;b++)d.__h.push(d._sb[b]);d._sb=[]}else do{d.__d=!1,S&&S(t),u=d.render(d.props,d.state,d.context),d.state=d.__s}while(d.__d&&++v<25);d.state=d.__s,null!=d.getChildContext&&(r=U(U({},r),d.getChildContext())),h||null==d.getSnapshotBeforeUpdate||(g=d.getSnapshotBeforeUpdate(f,p)),Y(e,x(I=null!=u&&u.type===G&&null==u.key?u.props.children:u)?I:[I],t,n,r,s,i,a,o,l,c),d.base=t.__e,t.__u&=-161,d.__h.length&&a.push(d),m&&(d.__E=d.__=null)}catch(e){t.__v=null,l||null!=i?(t.__e=o,t.__u|=l?160:32,i[i.indexOf(o)]=null):(t.__e=n.__e,t.__k=n.__k),C.__e(e,t,n)}else null==i&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=re(n.__e,t,n,r,s,i,a,l,c);(u=C.diffed)&&u(t)}
vendor: 2,614 bytes, line 1
1function ne(e,t,n){for(var r=0;r<n.length;r++)se(n[r],n[++r],n[++r]);C.__c&&C.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){C.__e(e,t.__v)}}))}function re(e,t,n,r,s,i,a,o,l){var c,u,d,h,f,p,g,m=n.props,_=t.props,T=t.type;if("svg"===T&&(s=!0),null!=i)for(c=0;c<i.length;c++)if((f=i[c])&&"setAttribute"in f==!!T&&(T?f.localName===T:3===f.nodeType)){e=f,i[c]=null;break}if(null==e){if(null===T)return document.createTextNode(_);e=s?document.createElementNS("http://www.w3.org/2000/svg",T):document.createElement(T,_.is&&_),i=null,o=!1}if(null===T)m===_||o&&e.data===_||(e.data=_);else{if(i=i&&R.call(e.childNodes),m=n.props||P,!o&&null!=i)for(m={},c=0;c<e.attributes.length;c++)m[(f=e.attributes[c]).name]=f.value;for(c in m)f=m[c],"children"==c||("dangerouslySetInnerHTML"==c?d=f:"key"===c||c in _||Q(e,c,null,f,s));for(c in _)f=_[c],"children"==c?h=f:"dangerouslySetInnerHTML"==c?u=f:"value"==c?p=f:"checked"==c?g=f:"key"===c||o&&"function"!=typeof f||m[c]===f||Q(e,c,f,m[c],s);if(u)o||d&&(u.__html===d.__html||u.__html===e.innerHTML)||(e.innerHTML=u.__html),t.__k=[];else if(d&&(e.innerHTML=""),Y(e,x(h)?h:[h],t,n,r,s&&"foreignObject"!==T,i,a,i?i[0]:n.__k&&j(n,0),o,l),null!=i)for(c=i.length;c--;)null!=i[c]&&B(i[c]);o||(c="value",void 0!==p&&(p!==e[c]||"progress"===T&&!p||"option"===T&&p!==m[c])&&Q(e,c,p,m[c],!1),c="checked",void 0!==g&&g!==e[c]&&Q(e,c,g,m[c],!1))}return e}function se(e,t,n){try{"function"==typeof e?e(t):e.current=t}catch(e){C.__e(e,n)}}function ie(e,t,n){var r,s;if(C.unmount&&C.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||se(r,null,t)),null!=(r=e.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){C.__e(e,t)}r.base=r.__P=null,e.__c=void 0}if(r=e.__k)for(s=0;s<r.length;s++)r[s]&&ie(r[s],t,n||"function"!=typeof e.type);n||null==e.__e||B(e.__e),e.__=e.__e=e.__d=void 0}function ae(e,t,n){return this.constructor(e,n)}R=M.slice,C={__e:function(e,t,n,r){for(var s,i,a;t=t.__;)if((s=t.__c)&&!s.__)try{if((i=s.constructor)&&null!=i.getDerivedStateFromError&&(s.setState(i.getDerivedStateFromError(e)),a=s.__d),null!=s.componentDidCatch&&(s.componentDidCatch(e,r||{}),a=s.__d),a)return s.__E=s}catch(t){e=t}throw e}},k=0,H.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=U({},this.state),"function"==typeof e&&(e=e(U({},n),this.props)),e&&U(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),V(this))},H.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),V(this))},H.prototype.render=G,L=[],N="function"==typeof Promise?Promise.prototype.then.bind(Prom
1ise.resolve()):setTimeout,w=function(e,t){return e.__v.__b-t.__v.__b},q.__r=0;var oe,le,ce,ue,de=0,he=[],fe=[],pe=C,ge=pe.__b,me=pe.__r,_e=pe.diffed,Te=pe.__c,Ee=pe.unmount,ye=pe.__;function Se(e,t){pe.__h&&pe.__h(le,e,de||t),de=0;var n=le.__H||(le.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({__V:fe}),n.__[e]}function ve(e){return de=1,be(Pe,e)}function be(e,t,n){var r=Se(oe++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):Pe(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);t!==n&&(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=le,!le.u)){var s=function(e,t,n){if(!r.__c.__H)return!0;var s=r.__c.__H.__.filter((function(e){return!!e.__c}));if(s.every((function(e){return!e.__N})))return!i||i.call(this,e,t,n);var a=!1;return s.forEach((function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(a=!0)}})),!(!a&&r.__c.props===e)&&(!i||i.call(this,e,t,n))};le.u=!0;var i=le.shouldComponentUpdate,a=le.componentWillUpdate;le.componentWillUpdate=function(e,t,n){if(this.__e){var r=i;i=void 0,s(e,t,n),i=r}a&&a.call(this,e,t,n)},le.shouldComponentUpdate=s}return r.__N||r.__}function Ie(e,t){var n=Se(oe++,4);!pe.__s&&we(n.__H,t)&&(n.__=e,n.i=t,le.__h.push(n))}function Ae(e,t){var n=Se(oe++,7);return we(n.__H,t)?(n.__V=e(),n.i=t,n.__h=e,n.__V):n.__}function Re(e,t){return de=8,Ae((function(){return e}),t)}function Ce(){for(var e;e=he.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Oe),e.__H.__h.forEach(Ne),e.__H.__h=[]}catch(t){e.__H.__h=[],pe.__e(t,e.__v)}}pe.__b=function(e){le=null,ge&&ge(e)},pe.__=function(e,t){t.__k&&t.__k.__m&&(e.__m=t.__k.__m),ye&&ye(e,t)},pe.__r=function(e){me&&me(e),oe=0;var t=(le=e.__c).__H;t&&(ce===le?(t.__h=[],le.__h=[],t.__.forEach((function(e){e.__N&&(e.__=e.__N),e.__V=fe,e.__N=e.i=void 0}))):(t.__h.forEach(Oe),t.__h.forEach(Ne),t.__h=[],oe=0)),ce=le},pe.diffed=function(e){_e&&_e(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==he.push(t)&&ue===pe.requestAnimationFrame||((ue=pe.requestAnimationFrame)||Le)(Ce)),t.__H.__.forEach((function(e){e.i&&(e.__H=e.i),e.__V!==fe&&(e.__=e.__V),e.i=void 0,e.__V=fe}))),ce=le=null},pe.__c=function(e,t){t.some((function(e){try{e.__h.forEach(Oe),e.__h=e.__h.filter((function(e){return!e.__||Ne(e)}))}catch(n){t.some((function(e){e.__h&&(e.__h=[])})),t=[],pe.__e(n,e.__v)}})),Te&&Te(e,t)},pe.unmount=function(e){Ee&&Ee(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach((function(e){try{Oe(e)}catch(e){t=e}})),n.__H=void 0,t&&pe.__e(t,n.__v))};var ke="function"==typeof requestAnimationFrame;function Le(e){var t,n=function(){clearTimeout(r),ke&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);ke&&(t=requestAnimationFrame(n))}function Oe(e){var t=le,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),le=t}function Ne(e){var t=le;e.__c=e.__(),le=t}function we(e,t){return!e||e.length!==t.length||t.some((function(t,n){return t!==e[n]}))}function Pe(e,t){return"function"==typeof t?t(e):t}const Me=Object.defineProperty({__proto__:null,useCallback:Re,useContext:function(e){var t=le.context[e.__c],n=Se(oe++,9);return n.c=e,t?(null==n.__&&(n.__=!0,t.sub(le)),t.props.value):e.__},useDebugValue:function(e,t){pe.useDebugValue&&pe.useDebugValue(t?t(e):e)},useEffect:function(e,t){var n=Se(oe++,3);!pe.__s&&we(n.__H,t)&&(n.__=e,n.i=t,le.__H.__h.push(n))},useErrorBoundary:function(e){var t=Se(oe++,10),n=ve();return t.__=e,le.componentDidCatch||(le.componentDidCatch=function(e,r){t.__&&t.__(e,r),n[1](e)}),[n[0],function(){n[1](void 0)}]},useId:function(){var e=Se(oe++,11);if(!e.__){for(var t=le.__v;null!==t&&!t.__m&&null!==t.__;)t=t.__;var n=t.__m||(t.__m=[0,0]);e.__="P"+n[0]+"-"+n[1]++}return e.__},useImperativeHandle:function(e,t,n){de=6,Ie((function(){return"function"==typeof e?(e(t()),function(){return e(null)}):e?(e.current=t(),function(){return e.current=null}):void 0}),null==n?n:n.concat(e))},useLayoutEffect:Ie,useMemo:Ae,useReducer:be,useRef:function(e){return de=5,Ae((function(){return{current:e}}),[])},useState:ve},Symbol.toStringTag,{value:"Module"});function De(){const e=e=>i.createElementNS("http://www.w3.org/2000/svg",e),t=E(e("svg"),{width:"32",height:"30",viewBox:"0 0 72 66",fill:"inherit"}),n=E(e("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 t.appendChild(n),t}function xe({options:e}){const t=Ae((()=>({__html:De().outerHTML})),[]);return F("h2",{class:"dialog__header"},F("span",{class:"dialog__title"},e.formTitle),e.showBranding?F("a",{class:"brand-link",target:"_blank",href:"https://sentry.io/welcome/",title:"Powered by Sentry",rel:"noopener noreferrer",dangerouslySetInnerHTML:t}):null)}function Ue(e,t){const n=e.get(t);return"string"==typeof n?n.trim():""}function Be({options:e,defaultEmail:t,defaultName:n,onFormClose:s,onSubmit:i,onSubmitSuccess:a,onSubmitError:o,showEmail
1:l,showName:c,screenshotInput:u}){const{tags:d,addScreenshotButtonLabel:h,removeScreenshotButtonLabel:f,cancelButtonLabel:p,emailLabel:g,emailPlaceholder:m,isEmailRequired:T,isNameRequired:E,messageLabel:y,messagePlaceholder:S,nameLabel:v,namePlaceholder:b,submitButtonLabel:I,isRequiredLabel:A}=e,[R,C]=ve(!1),[k,L]=ve(null),[O,N]=ve(!1),w=u?.input,[P,M]=ve(null),D=Re((e=>{M(e),N(!1)}),[]),x=Re((e=>{const t=function(e,t){const n=[];return t.isNameRequired&&!e.name&&n.push(t.nameLabel),t.isEmailRequired&&!e.email&&n.push(t.emailLabel),e.message||n.push(t.messageLabel),n}(e,{emailLabel:g,isEmailRequired:T,isNameRequired:E,messageLabel:y,nameLabel:v});return t.length>0?L(`Please enter in the following required fields: ${t.join(", ")}`):L(null),0===t.length}),[g,T,E,y,v]),U=Re((async e=>{C(!0);try{if(e.preventDefault(),!(e.target instanceof HTMLFormElement))return;const t=new FormData(e.target),n=await(u&&O?u.value():void 0),s={name:Ue(t,"name"),email:Ue(t,"email"),message:Ue(t,"message"),attachments:n?[n]:void 0};if(!x(s))return;try{const e=await i({name:s.name,email:s.email,message:s.message,source:"widget",tags:d},{attachments:s.attachments});a(s,e)}catch(e){_&&r.debug.error(e);const t=e instanceof Error?e:new Error(String(e));L(t.message),o(t)}}finally{C(!1)}}),[u&&O,a,o]);return F("form",{class:"form",onSubmit:U},w&&O?F(w,{onError:D}):null,F("fieldset",{class:"form__right","data-sentry-feedback":!0,disabled:R},F("div",{class:"form__top"},k?F("div",{class:"form__error-container"},k):null,c?F("label",{for:"name",class:"form__label"},F(Fe,{label:v,isRequiredLabel:A,isRequired:E}),F("input",{class:"form__input",defaultValue:n,id:"name",name:"name",placeholder:b,required:E,type:"text"})):F("input",{"aria-hidden":!0,value:n,name:"name",type:"hidden"}),l?F("label",{for:"email",class:"form__label"},F(Fe,{label:g,isRequiredLabel:A,isRequired:T}),F("input",{class:"form__input",defaultValue:t,id:"email",name:"email",placeholder:m,required:T,type:"email"})):F("input",{"aria-hidden":!0,value:t,name:"email",type:"hidden"}),F("label",{for:"message",class:"form__label"},F(Fe,{label:y,isRequiredLabel:A,isRequired:!0}),F("textarea",{autoFocus:!0,class:"form__input form__input--textarea",id:"message",name:"message",placeholder:S,required:!0,rows:5})),w?F("label",{for:"screenshot",class:"form__label"},F("button",{class:"btn btn--default",disabled:R,type:"button",onClick:()=>{M(null),N((e=>!e))}},O?f:h),P?F("div",{class:"form__error-container"},P.message):null):null),F("div",{class:"btn-group"},F("button",{class:"btn btn--primary",disabled:R,type:"submit"},I),F("button",{class:"btn btn--default",disabled:R,type:"button",onClick:s},p))))}function Fe({label:e,isRequired:t,isRequiredLabel:n}){return F("span",{class:"form__label__text"},e,t&&F("span",{class:"form__label__text--required"},n))}function $e(){const e=e=>s.document.createElementNS("http://www.w3.org/2000/svg",e),t=E(e("svg"),{width:"16",height:"17",viewBox:"0 0 16 17",fill:"inherit"}),n=E(e("g"),{clipPath:"url(#clip0_57_156)"}),r=E(e("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"}),i=E(e("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 
110.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"});t.appendChild(n).append(i,r);const a=e("defs"),o=E(e("clipPath"),{id:"clip0_57_156"}),l=E(e("rect"),{width:"16",height:"16",fill:"white",transform:"translate(0 0.5)"});return o.appendChild(l),a.appendChild(o),t.appendChild(a).appendChild(o).appendChild(l),t}function Ge({open:e,onFormSubmitted:t,...n}){const r=n.options,s=Ae((()=>({__html:$e().outerHTML})),[]),[i,a]=ve(null),o=Re((()=>{i&&(clearTimeout(i),a(null)),t()}),[i]),l=Re(((e,r)=>{n.onSubmitSuccess(e,r),a(setTimeout((()=>{t(),a(null)}),5e3))}),[t]);return F(G,null,i?F("div",{class:"success__position",onClick:o},F("div",{class:"success__content"},r.successMessageText,F("span",{class:"success__icon",dangerouslySetInnerHTML:s}))):F("dialog",{class:"dialog",onClick:r.onFormClose,open:e},F("div",{class:"dialog__position"},F("div",{class:"dialog__content",onClick:e=>{e.stopPropagation()}},F(xe,{options:r}),F(Be,{...n,onSubmitSuccess:l})))))}function He(e){const t=i.createElement("style"),n="#1A141F",r="#302735";return t.textContent=`\n.editor {\n  display: flex;\n  flex-grow: 1;\n  flex-direction: column;\n}\n\n.editor__image-container {\n  justify-items: center;\n  padding: 15px;\n  position: relative;\n  height: 100%;\n  border-radius: var(--menu-border-radius, 6px);\n\n  background-color: ${n};\n  background-image: repeating-linear-gradient(\n      -145deg,\n      transparent,\n      transparent 8px,\n      ${n} 8px,\n      ${n} 11px\n    ),\n    repeating-linear-gradient(\n      -45deg,\n      transparent,\n      transparent 15px,\n      ${r} 15px,\n      ${r} 16px\n    );\n}\n\n.editor__canvas-container {\n  width: 100%;\n  height: 100%;\n  position: relative;\n  display: flex;\n  align-items: center;\n  justify-content: center;\n}\n\n.editor__canvas-container > * {\n  object-fit: contain;\n  position: absolute;\n}\n\n.editor__tool-container {\n  padding-top: 8px;\n  display: flex;\n  justify-content: center;\n}\n\n.editor__tool-bar {\n  display: flex;\n  gap: 8px;\n}\n\n.editor__tool {\n  display: flex;\n  padding: 8px 12px;\n  justify-content: center;\n  align-items: center;\n  border: var(--button-border, var(--border));\n  border-radius: var(--button-border-radius, 6px);\n  background: var(--button-background, var(--background));\n  color: var(--button-color, var(--foreground));\n}\n\n.editor__tool--active {\n  background: var(--button-primary-background, var(--accent-background));\n  color: var(--button-primary-color, var(--accent-foreground));\n}\n\n.editor__rect {\n  position: absolute;\n  z-index: 2;\n}\n\n.editor__rect button {\n  opacity: 0;\n  position: absolute;\n  top: -12px;\n  right: -12px;\n  cursor: pointer;\n  padding: 0;\n  z-index: 3;\n  border: none;\n  background: none;\n}\n\n.editor__rect:hover button {\n  opacity: 1;\n}\n`,e&&t.setAttribute("nonce",e),t}function je({hooks:e}){return function({onBeforeScreenshot:t,onScreenshot:n,onAfterScreenshot:r,onError:o}){const l=function(){const[t,n]=e.useState(s.devicePixelRatio??1);return e.useEffect((()=>{const e=()=>{n(s.devicePixelRatio)},t=matchMedia(`(resolution: ${s.devicePixelRatio}dppx)`);return t.addEventListener("change",e),()=>{t.removeEventListener("change",e)}}),[]),t}();e.useEffect((()=>{(async()=>{t();const e=await a.mediaDevices.getDisplayMedia({video:{width:s.innerWidth*l,height:s.innerHeight*l},audio:!1,monitorTypeSurfaces:"exclude",preferCurrentTab:!0,selfBrowserSurface:"include",surfaceSwitching:"exclude"}),o=i.createElement("video");await new Promise(((t,r)=>{o.srcObject=e,o.onloadedmetadata=()=>{n(o,l),e.getTracks().forEach((e=>e.stop())),t()},o.play().catch(r)})),r()})().catch(o)}),[])}}function We(e,t,n){if(!e)return;const r=e.getContext("2d",t);r&&n(e,r)}function Ke(e,t){We(e,{alpha:!0},((e,n)=>{n.drawImage(t,0,0,t.width,t.height,0,0,e.width,e.height)}))}function Ve(e,t,n){We(e,{alpha:!0},((e,r)=>{n.length&&(r.fillStyle="rgba(0, 0, 0, 0.25)",r.fillRect(0,0,e.width,e.height)),n.forEac
1h((e=>{!function(e,t,n){switch(e.type){case"highlight":t.shadowColor="rgba(0, 0, 0, 0.7)",t.shadowBlur=50,t.fillStyle=n,t.fillRect(e.x-1,e.y-1,e.w+2,e.h+2),t.clearRect(e.x,e.y,e.w,e.h);break;case"hide":t.fillStyle="rgb(0, 0, 0)",t.fillRect(e.x,e.y,e.w,e.h)}}(e,r,t)}))}))}function qe({h:e,hooks:t,outputBuffer:n,dialog:r,options:a}){const o=je({hooks:t}),l=function({h:e}){return function({action:t,setAction:n,options:r}){return e("div",{class:"editor__tool-container"},e("div",{class:"editor__tool-bar"},e("button",{type:"button",class:"editor__tool "+("highlight"===t?"editor__tool--active":""),onClick:()=>{n("highlight"===t?"":"highlight")}},r.highlightToolText),e("button",{type:"button",class:"editor__tool "+("hide"===t?"editor__tool--active":""),onClick:()=>{n("hide"===t?"":"hide")}},r.hideToolText)))}}({h:e}),c=function({h:e}){return function(){return e("svg",{"data-test-id":"icon-close",viewBox:"0 0 16 16",fill:"#2B2233",height:"25px",width:"25px"},e("circle",{r:"7",cx:"8",cy:"8",fill:"white"}),e("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"}),e("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"}),e("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"}))}}({h:e}),u={__html:He(a.styleNonce).innerText},d=r.el.style,h=({screenshot:r})=>{const[o,d]=t.useState("highlight"),[h,f]=t.useState([]),p=t.useRef(null),g=t.useRef(null),m=t.useRef(null),_=t.useRef(null),[T,E]=t.useState(1),y=t.useMemo((()=>{const e=i.getElementById(a.id);if(!e)return"white";const t=getComputedStyle(e);return t.getPropertyValue("--button-primary-background")||t.getPropertyValue("--accent-background")}),[a.id]);t.useLayoutEffect((()=>{const e=()=>{const t=p.current;t&&(We(r.canvas,{alpha:!1},(e=>{const n=Math.min(t.clientWidth/e.width,t.clientHeight/e.height);E(n)})),0!==t.clientHeight&&0!==t.clientWidth||setTimeout(e,0))};return e(),s.addEventListener("resize",e),()=>{s.removeEventListener("resize",e)}}),[r]);const S=t.useCallback(((e,t)=>{We(e,{alpha:!0},((e,n)=>{n.scale(t,t),e.width=r.canvas.width,e.height=r.canvas.height}))}),[r]);t.useEffect((()=>{S(g.current,r.dpi),Ke(g.current,r.canvas)}),[r]),t.useEffect((()=>{S(m.current,r.dpi),We(m.current,{alpha:!0},((e,t)=>{t.clearRect(0,0,e.width,e.height)})),Ve(m.current,y,h)}),[h,y]),t.useEffect((()=>{S(n,r.dpi),Ke(n,r.canvas),We(i.createElement("canvas"),{alpha:!0},((e,t)=>{t.scale(r.dpi,r.dpi),e.width=r.canvas.width,e.height=r.canvas.height,Ve(e,y,h),Ke(n,e)}))}),[h,r,y]);const v=t.useCallback((e=>t=>{t.preventDefault(),t.stopPropagation(),f((t=>{const n=[...t];return n.splice(e,1),n}))}),[]),b={width:r.canvas.width*T+"px",height:r.canvas.height*T+"px"},I=e=>{e.stopPropagation()};return e("div",{class:"editor"},e("style",{nonce:a.styleNonce,dangerouslySetInnerHTML:u}),e("div",{class:"editor__image-container"},e("div",{class:"editor__canvas-container",ref:p},e("canvas",{ref:g,id:"background",style:b}),e("canvas",{ref:m,id:"foreground",style:b}),e("div",{ref:_,onMouseDown:e=>{if(!o||!_.current)return;const t=_.current.getBoundingClientRect(),n={type:o,x:e.offsetX/T,y:e.offsetY/T},r=(e,n)=>{const r=(n.clientX-t.x)/T,s=(n.clientY-t.y)/T;return{type:e.type,x:Math.min(e.x,r),y:Math.min(e.y,s),w:Math.abs(r-e.x),h:Math.abs(s-e.y)}},s=e=>{We(m.current,{alpha:!0},((e,t)=>{t.clearRect(0,0,e.width,e.height)})),Ve(m.current,y,[...h,r(n,e)])},a=e=>{const t=r(n,e);t.w*T>=1&&t.h*T>=1&&f((e=>[...e,t])),i.removeEventListener("mousemove",s),i.removeEventListener("mouseup",a)};i.addEventListener("mousemove",s),i.addEventListener("mouseup",a)},style:b},h.map(((t,n)=>e("div",{key:n,class:"editor__rect",style:{top:t.y*T+"px",left:t.x*T+"px",width:t.w*T+"px",height:t.h*T+"px"}},e("button",{"aria-label":a.removeHighlightText,onClick:v(n),onMouseDown:I,onMouseUp:I,type:"button"},e(c,null)))))))),e(l,{options:a,action:o,setAction:d}))};return function({onError:r}){const[s,a]=t.useState();return o({onBeforeScreenshot:t.useCallback((()=>{d.display="none"}),[]),onScreenshot:t.useCallback(((e,t)=>{We(i.createElement("canvas"),{alpha:!1},((n,r)=>{r.scale(t,t),n.width=e.videoWidth,n.height=e.videoHeight,r.drawImage(e,0,0,n.width,n.height),a({canvas:n,dpi:t})})),n.width=e.videoWidth,n.height=e.videoHeight}),[]),onAfterScreenshot:t.useCallback((()=>{d.display="block"}),[]),onError:t.useCallback((e=>{d.display="block",r(e)}),[])}),s?e(h,{screenshot:s}):e("div",null)}}t.buildFeedbackIntegration=({lazyLoadIntegration:e,getModalIntegration:t,getScreenshotIntegration:n})=>({id:s="sentry-feedback",autoInject:f=!0,showBranding:p=!0,isEmailRequired:g=!1,isNameRequired:E=!1,showEmail
1:S=!0,showName:v=!0,enableScreenshot:b=!0,useSentryUser:I={email:"email",name:"username"},tags:R,styleNonce:C,scriptNonce:k,colorScheme:L="system",themeLight:O={},themeDark:N={},addScreenshotButtonLabel:w="Add a screenshot",cancelButtonLabel:P="Cancel",confirmButtonLabel:M="Confirm",emailLabel:D="Email",emailPlaceholder:x="[email protected]",formTitle:U="Report a Bug",isRequiredLabel:B="(required)",messageLabel:F="Description",messagePlaceholder:$="What's the bug? What did you expect?",nameLabel:G="Name",namePlaceholder:H="Your Name",removeScreenshotButtonLabel:j="Remove screenshot",submitButtonLabel:W="Send Bug Report",successMessageText:K="Thank you for your report!",triggerLabel:V=o,triggerAriaLabel:q="",highlightToolText:Y="Highlight",hideToolText:z="Hide",removeHighlightText:J="Remove",errorEmptyMessageText:X=l,errorNoClientText:Q=c,errorTimeoutText:Z=u,errorForbiddenText:ee=d,errorGenericText:te=h,onFormOpen:ne,onFormClose:re,onSubmitSuccess:se,onSubmitError:ie,onFormSubmitted:ae}={})=>{const oe={id:s,autoInject:f,showBranding:p,isEmailRequired:g,isNameRequired:E,showEmail:S,showName:v,enableScreenshot:b,useSentryUser:I,tags:R,styleNonce:C,scriptNonce:k,colorScheme:L,themeDark:N,themeLight:O,triggerLabel:V,triggerAriaLabel:q,cancelButtonLabel:P,submitButtonLabel:W,confirmButtonLabel:M,formTitle:U,emailLabel:D,emailPlaceholder:x,messageLabel:F,messagePlaceholder:$,nameLabel:G,namePlaceholder:H,successMessageText:K,isRequiredLabel:B,addScreenshotButtonLabel:w,removeScreenshotButtonLabel:j,highlightToolText:Y,hideToolText:z,removeHighlightText:J,errorEmptyMessageText:X,errorNoClientText:Q,errorTimeoutText:Z,errorForbiddenText:ee,errorGenericText:te,onFormClose:re,onFormOpen:ne,onSubmitError:ie,onSubmitSuccess:se,onFormSubmitted:ae};let le=null,ce=null,ue=[];const de=e=>{if(!le){const t=i.createElement("div");t.id=String(e.id),i.body.appendChild(t),le=t.attachShadow({mode:"open"}),ce=A(e),le.appendChild(ce)}return le},he=async s=>{const i=s.enableScreenshot&&!(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(a.userAgent)||/Macintosh/i.test(a.userAgent)&&a.maxTouchPoints&&a.maxTouchPoints>1||!isSecureContext);let o,l;try{o=(t?t():await e("feedbackModalIntegration",k))(),r.addIntegration(o)}catch{throw _&&r.debug.error("[Feedback] Error when trying to load feedback integrations. Try using `feedbackSyncIntegration` in your `Sentry.init`."),new Error("[Feedback] Missing feedback modal integration!")}try{const t=i?n?n():await e("feedbackScreenshotIntegration",k):void 0;t&&(l=t(),r.addIntegration(l))}catch{_&&r.debug.error("[Feedback] Missing feedback screenshot integration. Proceeding without screenshots.")}const c={ERROR_EMPTY_MESSAGE:s.errorEmptyMessageText,ERROR_NO_CLIENT:s.errorNoClientText,ERROR_TIMEOUT:s.errorTimeoutText,ERROR_FORBIDDEN:s.errorForbiddenText,ERROR_GENERIC:s.errorGenericText},u=o.createDialog({options:{...s,onFormClose:()=>{u?.close(),s.onFormClose?.()},onFormSubmitted:()=>{u?.close(),s.onFormSubmitted?.()}},screenshotIntegration:l,sendFeedback:(e,t)=>m(e,{includeReplay:!0,...t,errorMessages:c}),shadow:de(s)});return u},fe=(e,t={})=>{const n=T(oe,t),s="string"==typeof e?i.querySelector(e):"function"==typeof e.addEventListener?e:null;if(!s)throw _&&r.debug.error("[Feedback] Unable to attach to target element"),new Error("Unable to attach to target element");let a=null;const o=async()=>{a||(a=await he({...n,onFormSubmitted:()=>{a?.removeFromDom(),n.onFormSubmitted?.()}})),a.appendToDom(),a.open()};s.addEventListener("click",o);const l=()=>{ue=ue.filter((e=>e!==l)),a?.removeFromDom(),a=null,s.removeEventListener("click",o)};return ue.push(l),l},pe=(e={})=>{const t=T(oe,e),n=de(t),r=y({triggerLabel:t.triggerLabel,triggerAriaLabel:t.triggerAriaLabel,shadow:n,styleNonce:C});return fe(r.el,{...t,onFormOpen(){r.hide()},onFormClose(){r.show()},onFormSubmitted(){r.show()}}),r};return{name:"Feedback",setupOnce(){r.isBrowser()&&oe.autoInject&&("loading"===i.readyState?i.addEventListener("DOMContentLoaded",(()=>pe().appendToDom())):pe().appendToDom())},attachTo:fe,createWidget(e={}){const t=pe(T(oe,e));return t.appendToDom(),t},createForm:async(e={})=>he(T(oe,e)),setTheme(e){if(oe.colorScheme=e,le){const e=A(oe);
1ce?le.replaceChild(e,ce):le.prepend(e),ce=e}},remove(){le&&(le.parentElement?.remove(),le=null,ce=null),ue.forEach((e=>e())),ue=[]}}},t.feedbackModalIntegration=()=>({name:"FeedbackModal",setupOnce(){},createDialog:({options:e,screenshotIntegration:t,sendFeedback:n,shadow:s})=>{const a=s,o=e.useSentryUser,l=function(){const e=r.getCurrentScope().getUser(),t=r.getIsolationScope().getUser(),n=r.getGlobalScope().getUser();return e&&Object.keys(e).length?e:t&&Object.keys(t).length?t:n}(),c=i.createElement("div"),u=function(e){const t=i.createElement("style");return t.textContent="\n:host {\n  --dialog-inset: var(--inset);\n}\n\n\n.dialog {\n  position: fixed;\n  z-index: var(--z-index);\n  margin: 0;\n  inset: 0;\n\n  display: flex;\n  align-items: center;\n  justify-content: center;\n  padding: 0;\n  height: 100vh;\n  width: 100vw;\n\n  color: var(--dialog-color, var(--foreground));\n  fill: var(--dialog-color, var(--foreground));\n  line-height: 1.75em;\n\n  background-color: rgba(0, 0, 0, 0.05);\n  border: none;\n  inset: 0;\n  opacity: 1;\n  transition: opacity 0.2s ease-in-out;\n}\n\n.dialog__position {\n  position: fixed;\n  z-index: var(--z-index);\n  inset: var(--dialog-inset);\n  padding: var(--page-margin);\n  display: flex;\n  max-height: calc(100vh - (2 * var(--page-margin)));\n}\n@media (max-width: 600px) {\n  .dialog__position {\n    inset: var(--page-margin);\n    padding: 0;\n  }\n}\n\n.dialog__position:has(.editor) {\n  inset: var(--page-margin);\n  padding: 0;\n}\n\n.dialog:not([open]) {\n  opacity: 0;\n  pointer-events: none;\n  visibility: hidden;\n}\n.dialog:not([open]) .dialog__content {\n  transform: translate(0, -16px) scale(0.98);\n}\n\n.dialog__content {\n  display: flex;\n  flex-direction: column;\n  gap: 16px;\n  padding: var(--dialog-padding, 24px);\n  max-width: 100%;\n  width: 100%;\n  max-height: 100%;\n  overflow: auto;\n\n  background: var(--dialog-background, var(--background));\n  border-radius: var(--dialog-border-radius, 20px);\n  border: var(--dialog-border, var(--border));
1\n  box-shadow: var(--dialog-box-shadow, var(--box-shadow));\n  transform: translate(0, 0) scale(1);\n  transition: transform 0.2s ease-in-out;\n}\n\n\n\n.dialog__header {\n  display: flex;\n  gap: 4px;\n  justify-content: space-between;\n  font-weight: var(--dialog-header-weight, 600);\n  margin: 0;\n}\n.dialog__title {\n  align-self: center;\n  width: var(--form-width, 272px);\n}\n\n@media (max-width: 600px) {\n  .dialog__title {\n    width: auto;\n  }\n}\n\n.dialog__position:has(.editor) .dialog__title {\n  width: auto;\n}\n\n\n.brand-link {\n  display: inline-flex;\n}\n.brand-link:focus-visible {\n  outline: var(--outline);\n}\n\n\n.form {\n  display: flex;\n  overflow: auto;\n  flex-direction: row;\n  gap: 16px;\n  flex: 1 0;\n}\n\n.form fieldset {\n  border: none;\n  margin: 0;\n  padding: 0;\n}\n\n.form__right {\n  flex: 0 0 auto;\n  display: flex;\n  overflow: auto;\n  flex-direction: column;\n  justify-content: space-between;\n  gap: 20px;\n  width: var(--form-width, 100%);\n}\n\n.dialog__position:has(.editor) .form__right {\n  width: var(--form-width, 272px);\n}\n\n.form__top {\n  display: flex;\n  flex-direction: column;\n  gap: 8px;\n}\n\n.form__error-container {\n  color: var(--error-color);\n  fill: var(--error-color);\n}\n\n.form__label {\n  display: flex;\n  flex-direction: column;\n  gap: 4px;\n  margin: 0px;\n}\n\n.form__label__text {\n  display: flex;\n  gap: 4px;\n  align-items: center;\n}\n\n.form__label__text--required {\n  font-size: 0.85em;\n}\n\n.form__input {\n  font-family: inherit;\n  line-height: inherit;\n  background: transparent;\n  box-sizing: border-box;\n  border: var(--input-border, var(--border));\n  border-radius: var(--input-border-radius, 6px);\n  color: var(--input-color, inherit);\n  fill: var(--input-color, inherit);\n  font-size: var(--input-font-size, inherit);\n  font-weight: var(--input-font-weight, 500);\n  padding: 6px 12px;\n}\n\n.form__input::placeholder {\n  opacity: 0.65;\n  color: var(--input-placeholder-color, inherit);\n  filter: var(--interactive-filter);\n}\n\n.form__input:focus-visible {\n  outline: var(--input-focus-outline, var(--outline));\n}\n\n.form__input--textarea {\n  font-family: inherit;\n  resize: vertical;\n}\n\n.error {\n  color: var(--error-color);\n  fill: var(--error-color);\n}\n\n\n.btn-group {\n  display: grid;\n  gap: 8px;\n}\n\n.btn {\n  line-height: inherit;\n  border: var(--button-border, var(--border));\n  border-radius: var(--button-border-radius, 6px);\n  cursor: pointer;\n  font-family: inherit;\n  font-size: var(--button-font-size, inherit);\n  font-weight: var(--button-font-weight, 600);\n  padding: var(--button-padding, 6px 16px);\n}\n.btn[disabled] {\n  opacity: 0.6;\n  pointer-events: none;\n}\n\n.btn--primary {\n  color: var(--button-primary-color, var(--accent-foreground));\n  fill: var(--button-primary-color, var(--accent-foreground));\n  background: var(--button-primary-background, var(--accent-background));\n  border: var(--button-primary-border, var(--border));\n  border-radius: var(--button-primary-border-radius, 6px);\n  font-weight: var(--button-primary-font-weight, 500);\n}\n.btn--primary:hover {\n  color: var(--button-primary-hover-color, var(--accent-foreground));\n  fill: var(--button-primary-hover-color, var(--accent-foreground));\n  background: var(--button-primary-hover-background, var(--accent-background));\n  filter: var(--interactive-filter);\n}\n.btn--primary:focus-visible {\n  background: var(--button-primary-hover-background, var(--accent-background));\n  filter: var(--interactive-filter);\n  outline: var(--button-primary-focus-outline, var(--outline));\n}\n\n.btn--default {\n  color: var(--button-color, var(--foreground));\n  fill: var(--button-color, var(--foreground));\n  background: var(--button-background, var(--background));\n  border: var(--button-border, var(--border));\n  border-radius: var(--button-border-radius, 6px);\n  font-weight: var(--button-font-weight, 500);\n}\n.btn--default:hover {\n  color: var(--button-color, var(--foreground));\n  fill: var(--button-color, var(--foreground));\n  background: var(--button-hover-background, var(--background));\n  filter: var(--interactive-filter);\n}\n.btn--default:focus-visible {\n  background: var(--button-hover-background, var(--background));\n  filter: var(--interactive-filter);\n  outline: var(--button-focus-outline, var(--outline));\n}\n\n\n.success__position {\n  position: fixed;\n  inset: var(--dialog-inset);\n  padding: var(--page-margin);\n  z-index: var(--z-index);\n}\n.success__content {\n  background: var(--success-background, var(--background));\n  border: var(--success-border, var(--border));\n  border-radius: var(--success-border-radius, 1.7em/50%);
1\n  box-shadow: var(--success-box-shadow, var(--box-shadow));\n  font-weight: var(--success-font-weight, 600);\n  color: var(--success-color);\n  fill: var(--success-color);\n  padding: 12px 24px;\n  line-height: 1.75em;\n\n  display: grid;\n  align-items: center;\n  grid-auto-flow: column;\n  gap: 6px;\n  cursor: default;\n}\n\n.success__icon {\n  display: flex;\n}\n\n",e&&t.setAttribute("nonce",e),t}(e.styleNonce);let d="";const h={get el(){return c},appendToDom(){a.contains(u)||a.contains(c)||(a.appendChild(u),a.appendChild(c))},removeFromDom(){c.remove(),u.remove(),i.body.style.overflow=d},open(){p(!0),e.onFormOpen?.(),r.getClient()?.emit("openFeedbackWidget"),d=i.body.style.overflow,i.body.style.overflow="hidden"},close(){p(!1),i.body.style.overflow=d}},f=t?.createInput({h:F,hooks:Me,dialog:h,options:e}),p=t=>{!function(e,t){var n,r,s;C.__&&C.__(e,t),n=t.__k,r=[],s=[],te(t,e=t.__k=F(G,null,[e]),n||P,P,void 0!==t.ownerSVGElement,n?null:t.firstChild?R.call(t.childNodes):null,r,n?n.__e:t.firstChild,!1,s),e.__d=void 0,ne(r,e,s)}(F(Ge,{options:e,screenshotInput:f,showName:e.showName||e.isNameRequired,showEmail:e.showEmail||e.isEmailRequired,defaultName:String(o&&l?.[o.name]||""),defaultEmail:String(o&&l?.[o.email]||""),onFormClose:()=>{p(!1),e.onFormClose?.()},onSubmit:n,onSubmitSuccess:(t,n)=>{p(!1),e.onSubmitSuccess?.(t,n)},onSubmitError:t=>{e.onSubmitError?.(t)},onFormSubmitted:()=>{e.onFormSubmitted?.()},open:t}),c)};return h}}),t.feedbackScreenshotIntegration=()=>({name:"FeedbackScreenshot",setupOnce(){},createInput:({h:e,hooks:t,dialog:n,options:r})=>{const s=i.createElement("canvas");return{input:qe({h:e,hooks:t,outputBuffer:s,dialog:n,options:r}),value:async()=>{const e=await new Promise((e=>{s.toBlob(e,"image/png")}));if(e){return{data:new Uint8Array(await e.arrayBuffer()),filename:"screenshot.png",contentType:"application/png"}}}}}}),t.getFeedback=function(){const e=r.getClient();return e?.getIntegrationByName("Feedback")},t.sendFeedback=m},57143(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(37872);var s=Object.defineProperty,i=(e,t,n)=>((e,t,n)=>t in e?s(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n);class a{constructor(){i(this,"idNodeMap",new Map),i(this,"nodeMetaMap",new WeakMap)}getId(e){if(!e)return-1;const t=this.getMeta(e)?.id;return t??-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){const t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach((e=>this.removeNodeFromMap(e)))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){const n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)}replace(e,t){const n=this.getNode(e);if(n){const e=this.nodeMetaMap.get(n);e&&this.nodeMetaMap.set(t,e)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function o(e,t,n=1/0,r=0){return e?e.nodeType!==e.ELEMENT_NODE||r>n?-1:t(e)?r:o(e.parentNode,t,n,r+1):-1}function l(e,t){return n=>{const r=n;if(null===r)return!1;try{if(e)if("string"==typeof e){if(r.matches(`.${e}`))return!0}else if(function(e,t){for(let n=e.classList.length;n--;){const r=e.classList[n];if(t.test(r))return!0}return!1}(r,e))return!0;return!(!t||!r.matches(t))}catch{return!1}}}const c="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.";let u={map:{},getId:()=>(console.error(c),-1),getNode:()=>(console.error(c),null),removeNodeFromMap(){console.error(c)},has:()=>(console.error(c),!1),reset(){console.error(c)}};function d(e,t,n,r,s=window){const i=s.Object.getOwnPropertyDescriptor(e,t);return s.Object.defineProperty(e,t,r?n:{set(e){_((()=>{n.set.call(this,e)}),0),i&&i.set&&i.set.call(this,e)}}),()=>d(e,t,i||{},!0)}function h(e,t,n){try{if(!(t in e))return()=>{};const r=e[t],s=n(r);return"function"==typeof s&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=s,()=>{e[t]=r}}catch{return()=>{}}}
1function f(e,t,n,r,s){if(!e)return!1;const i=function(e){if(!e)return null;try{return e.nodeType===e.ELEMENT_NODE?e:e.parentElement}catch(e){return null}}(e);if(!i)return!1;const a=l(t,n);if(!s){const e=r&&i.matches(r);return a(i)&&!e}const c=o(i,a);let u=-1;return!(c<0)&&(r&&(u=o(i,l(null,r))),c>-1&&u<0||c<u)}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(u=new Proxy(u,{get:(e,t,n)=>("map"===t&&console.error(c),Reflect.get(e,t,n))})),Date.now().toString();const p={};function g(e){const t=p[e];if(t)return t;const n=window.document;let r=window[e];if(n&&"function"==typeof n.createElement)try{const t=n.createElement("iframe");t.hidden=!0,n.head.appendChild(t);const s=t.contentWindow;s&&s[e]&&(r=s[e]),n.head.removeChild(t)}catch(e){}return p[e]=r.bind(window)}function m(...e){return g("requestAnimationFrame")(...e)}function _(...e){return g("setTimeout")(...e)}var T=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(T||{});let E;const y=e=>{if(!E)return e;return(...t)=>{try{return e(...t)}catch(e){if(E&&!0===E(e))return()=>{};throw e}}};for(var S="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",v="undefined"==typeof Uint8Array?[]:new Uint8Array(256),b=0;b<64;b++)v[S.charCodeAt(b)]=b;const I=new Map;const A=(e,t,n)=>{if(!e||!k(e,t)&&"object"!=typeof e)return;const r=function(e,t){let n=I.get(e);return n||(n=new Map,I.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}(n,e.constructor.name);let s=r.indexOf(e);return-1===s&&(s=r.length,r.push(e)),s};function R(e,t,n){if(e instanceof Array)return e.map((e=>R(e,t,n)));if(null===e)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray){return{rr_type:e.constructor.name,args:[Object.values(e)]}}if(e instanceof ArrayBuffer){return{rr_type:e.constructor.name,base64:function(e){var t,n=new Uint8Array(e),r=n.length,s="";for(t=0;t<r;t+=3)s+=S[n[t]>>2],s+=S[(3&n[t])<<4|n[t+1]>>4],s+=S[(15&n[t+1])<<2|n[t+2]>>6],s+=S[63&n[t+2]];return r%3==2?s=s.substring(0,s.length-1)+"=":r%3==1&&(s=s.substring(0,s.length-2)+"=="),s}(e)}}if(e instanceof DataView){return{rr_type:e.constructor.name,args:[R(e.buffer,t,n),e.byteOffset,e.byteLength]}}if(e instanceof HTMLImageElement){const t=e.constructor.name,{src:n}=e;return{rr_type:t,src:n}}if(e instanceof HTMLCanvasElement){return{rr_type:"HTMLImageElement",src:e.toDataURL()}}if(e instanceof ImageData){return{rr_type:e.constructor.name,args:[R(e.data,t,n),e.width,e.height]}}if(k(e,t)||"object"==typeof e){return{rr_type:e.constructor.name,index:A(e,t,n)}}return e}const C=(e,t,n)=>e.map((e=>R(e,t,n))),k=(e,t)=>{const n=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((e=>"function"==typeof t[e]));return Boolean(n.find((n=>e instanceof t[n])))};function L(e,t,n,r,s){const i=[];try{const a=h(e.HTMLCanvasElement.prototype,"getContext",(function(e){return function(i,...a){if(!f(this,t,n,r,!0)){const e=function(e){return"experimental-webgl"===e?"webgl":e}(i);if("__context"in this||(this.__context=e),s&&["webgl","webgl2"].includes(e))if(a[0]&&"object"==typeof a[0]){const e=a[0];e.preserveDrawingBuffer||(e.preserveDrawingBuffer=!0)}else a.splice(0,1,{preserveDrawingBuffer:!0})}return e.apply(this,[i,...a])}}));i.push(a)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{i.forEach((e=>e()))}}function O(e,t,n,r,s,i,a,o){const l=[],c=Object.getOwnPropertyNames(e);for(const a of c)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(a))try{if("function"!=typeof e[a])continue;const c=h(e,a,(function(e){return function(...l){const c=e.apply(this,l);if(A(c,o,this),"tagName"in this.canvas&&!f(this.canvas,r,s,i,!0)){const e=C(l,o,this),r={type:t,property:a,args:e};n(this.canvas,r)}return c}}));l.push(c)}catch{const r=d(e,a,{set(e){n(this.canvas,{type:t,property:a,args:[e],setter:!0})}});l.push(r)}return l}class N{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=(e,t)=>{!(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId)&&this.rafStamps.invokeId||(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(e)||this.pendingCanvasMutations.set(e,[]),this.pendingCanvasMutations.get(e).push(t)};const{enableManualSnapshot:t,sampling:n="all",win:r,recordCanvas:s,errorHandler:i}=e;e.sampling=n,this.mutationCb=e.mutationCb,this.mirror=e.mirror,this.options=e,i&&(E=i),(s&&"number"==typeof n||t)&&(this.worker=this.initFPSWorker()),this.addWindow(r),t||y((()=>{s&&"all"===n&&(this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher()),s&&"number"==typeof n&&this.initCanvasFPSObserver()}))()}reset(){this.pendingCanvasMutations.clear(),this.restoreHandlers.forEac
1h((e=>{try{e()}catch(e){}})),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){const{sampling:t="all",blockClass:n,blockSelector:r,unblockSelector:s,recordCanvas:i,enableManualSnapshot:a}=this.options;if(!this.windowsSet.has(e)){if(a)return this.windowsSet.add(e),void this.windows.push(new WeakRef(e));y((()=>{if(i&&"all"===t&&this.initCanvasMutationObserver(e,n,r,s),i&&"number"==typeof t){const t=L(e,n,r,s,!0);this.restoreHandlers.push((()=>{t()}))}}))(),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,t){t?.skipRequestAnimationFrame?this.takeSnapshot(performance.now(),!0,e):m((t=>this.takeSnapshot(t,!0,e)))}initFPSWorker(){const e=new Worker(function(){const e=new Blob(['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)}};']);return URL.createObjectURL(e)}());return e.onmessage=e=>{const t=e.data,{id:n}=t;if(this.snapshotInProgressMap.set(n,!1),!("base64"in t))return;const{base64:r,type:s,width:i,height:a}=t;this.mutationCb({id:n,type:T["2D"],commands:[{property:"clearRect",args:[0,0,i,a]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:r}],type:s}]},0,0,i,a]}]})},e}initCanvasFPSObserver(){let e;if(!this.windows.length&&!this.shadowDoms.size)return;const t=n=>{this.takeSnapshot(n,!1),e=m(t)};e=m(t),this.restoreHandlers.push((()=>{e&&cancelAnimationFrame(e)}))}initCanvasMutationObserver(e,t,n,r){const s=L(e,t,n,r,!1),i=function(e,t,n,r,s){const i=[],a=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const o of a)try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[o])continue;
1const a=h(t.CanvasRenderingContext2D.prototype,o,(function(i){return function(...a){return f(this.canvas,n,r,s,!0)||_((()=>{const n=C(a,t,this);e(this.canvas,{type:T["2D"],property:o,args:n})}),0),i.apply(this,a)}}));i.push(a)}catch{const n=d(t.CanvasRenderingContext2D.prototype,o,{set(t){e(this.canvas,{type:T["2D"],property:o,args:[t],setter:!0})}});i.push(n)}return()=>{i.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,n,r),a=function(e,t,n,r,s){const i=[];return i.push(...O(t.WebGLRenderingContext.prototype,T.WebGL,e,n,r,s,0,t)),void 0!==t.WebGL2RenderingContext&&i.push(...O(t.WebGL2RenderingContext.prototype,T.WebGL2,e,n,r,s,0,t)),()=>{i.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,n,r,this.mirror);this.restoreHandlers.push((()=>{s(),i(),a()}))}getCanvasElements(e,t,n){const r=[],s=s=>{s.querySelectorAll("canvas").forEach((s=>{f(s,e,t,n,!0)||r.push(s)}))};for(const e of this.windows){const t=e.deref();let n;try{n=t&&t.document}catch{}n&&s(n)}for(const e of this.shadowDoms){const t=e.deref();t&&s(t)}return r}takeSnapshot(e,t,n){const{sampling:r,blockClass:s,blockSelector:i,unblockSelector:a,dataURLOptions:o,maxCanvasSize:l}=this.options,c=1e3/("all"===r?2:r||2);if(this.lastSnapshotTime&&e-this.lastSnapshotTime<c)return!1;this.lastSnapshotTime=e;return(n?[n]:this.getCanvasElements(s,i,a)).forEach((e=>{const n=this.mirror.getId(e);if(this.mirror.hasNode(e)&&e.width&&e.height&&!this.snapshotInProgressMap.get(n)){if(this.snapshotInProgressMap.set(n,!0),!t&&["webgl","webgl2"].includes(e.__context)){const t=e.getContext(e.__context);!1===t?.getContextAttributes()?.preserveDrawingBuffer&&t.clear(t.COLOR_BUFFER_BIT)}createImageBitmap(e).then((t=>{this.worker?.postMessage({id:n,bitmap:t,width:e.width,height:e.height,dataURLOptions:o,maxCanvasSize:l},[t])})).catch((e=>{y((()=>{throw this.snapshotInProgressMap.delete(n),e}))()}))}})),!0}startPendingCanvasMutationFlusher(){m((()=>this.flushPendingCanvasMutations()))}startRAFTimestamping(){const e=t=>{this.rafStamps.latestId=t,m(e)};m(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach(((e,t)=>{const n=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,n)})),m((()=>this.flushPendingCanvasMutations()))}flushPendingCanvasMutationFor(e,t){if(this.frozen||this.locked)return;const n=this.pendingCanvasMutations.get(e);if(!n||-1===t)return;const r=n.map((e=>{const{type:t,...n}=e;return n})),{type:s}=n[0];this.mutationCb({id:t,type:s,commands:r}),this.pendingCanvasMutations.delete(e)}}try{if(2!==Array.from([1],(e=>2*e))[0]){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=e.contentWindow?.Array.from||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}var w,P;new a,(P=w||(w={}))[P.NotStarted=0]="NotStarted",P[P.Running=1]="Running",P[P.Stopped=2]="Stopped";const M={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}}},D=1280,x=r.defineIntegration(((e={})=>{const[t,n]=e.maxCanvasSize||[],r={quality:e.quality||"medium",enableManualSnapshot:e.enableManualSnapshot,maxCanvasSize:[t?Math.min(t,D):D,n?Math.min(n,D):D]};let s,i;const a=new Promise((e=>i=e));return{name:"ReplayCanvas",getOptions(){const{quality:e,enableManualSnapshot:t,maxCanvasSize:n}=r;return{enableManualSnapshot:t,recordCanvas:!0,getCanvasManager:e=>{const r=new N({...e,enableManualSnapshot:t,maxCanvasSize:n,errorHandler:e=>{try{"object"==typeof e&&(e.__rrweb__=!0)}catch{}}});return s=r,i(r),r},...M[e]||M.medium}},async snapshot(e,t){(s||await a).snapshot(e,t)}}}));t.replayCanvasIntegration=x},2992(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(37872),s=n(81015),i=r.GLOBAL_OBJ,a="sentryReplaySession",o="Unable to send Replay",l=15e4,c=5e3,u=2e7,d=36e5;var h=Object.defineProperty,f=(e,t,n)=>((e,t,n)=>t in e?h(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n),p=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(p||{});function g(e){const t=e?.host;return Boolean(t?.shadowRoot===e)}function m(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function _(e){try{const n=e.rules||e.cssRules;return n?((t=Array.from(n,T).join("")).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):null}catch(e){return null}var t}function T(e){let t;if(function(e){return"styleSheet"in e}(e))try{t=_(e.styleSheet)||function(e){const{cssText:t}=e;if(t.split('"').length<3)return t;const n=["@import",`url(${JSON.stringify(e.href)})`];return""===e.layerName?n.push("layer"):e.layerName&&n.push(`layer(${e.layerName})`),e.supportsText&&n.push(`supports(${e.supportsText})`),e.media.length&&n.push(e.media.mediaText),n.join(" ")+";"}(e)}catch(e){}else if(function(e){return"selectorText"in e}(e)){let t=e.cssText;const n=e.selectorText.includes(":"),r="string"==typeof e.style.all&&e.style.all;if(r&&(t=function(e){let t="";for(let n=0;n<e.style.length;n++){const r=e.style,s=r[n],i=r.getPropertyPriority(s);t+=`${s}:${r.getPropertyValue(s)}
1${i?" !important":""};`}return`${e.selectorText} { ${t} }`}(e)),n&&(t=function(e){const t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}(t)),n||r)return t}return t||e.cssText}class E{constructor(){f(this,"idNodeMap",new Map),f(this,"nodeMetaMap",new WeakMap)}getId(e){if(!e)return-1;const t=this.getMeta(e)?.id;return t??-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){const t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach((e=>this.removeNodeFromMap(e)))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){const n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)}replace(e,t){const n=this.getNode(e);if(n){const e=this.nodeMetaMap.get(n);e&&this.nodeMetaMap.set(t,e)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function y({maskInputOptions:e,tagName:t,type:n}){return"OPTION"===t&&(t="SELECT"),Boolean(e[t.toLowerCase()]||n&&e[n]||"password"===n||"INPUT"===t&&!n&&e.text)}function S({isMasked:e,element:t,value:n,maskInputFn:r}){let s=n||"";return e?(r&&(s=r(s,t)),"*".repeat(s.length)):s}function v(e){return e.toLowerCase()}function b(e){return e.toUpperCase()}const I="__rrweb_original__";function A(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?v(t):null}function R(e,t,n){return"INPUT"!==t||"radio"!==n&&"checkbox"!==n?e.value:e.getAttribute("value")||""}function C(e,t){let n;try{n=new URL(e,t??window.location.href)}catch(e){return null}const r=n.pathname.match(/\.([0-9a-z]+)(?:$)/i);return r?.[1]??null}const k={};function L(e){const t=k[e];if(t)return t;const n=window.document;let r=window[e];if(n&&"function"==typeof n.createElement)try{const t=n.createElement("iframe");t.hidden=!0,n.head.appendChild(t);const s=t.contentWindow;s&&s[e]&&(r=s[e]),n.head.removeChild(t)}catch(e){}return k[e]=r.bind(window)}function O(...e){return L("setTimeout")(...e)}function N(...e){return L("clearTimeout")(...e)}function w(e){try{return e.contentDocument}catch{}}let P=1;const M=new RegExp("[^a-z0-9-_:]");function D(){return P++}let x,U;const B=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,F=/^(?:[a-z+]+:)?\/\//i,$=/^www\..*/i,G=/^(data:)([^,]*),(.*)/i;function H(e,t){return(e||"").replace(B,((e,n,r,s,i,a)=>{const o=r||i||a,l=n||s||"";if(!o)return e;if(F.test(o)||$.test(o))return`url(${l}${o}${l})`;if(G.test(o))return`url(${l}${o}${l})`;if("/"===o[0])return`url(${l}${function(e){let t="";return t=e.indexOf("//")>-1?e.split("/").slice(0,3).join("/"):e.split("/")[0],t=t.split("?")[0],t}(t)+o}${l})`;const c=t.split("/"),u=o.split("/");c.pop();for(const e of u)"."!==e&&(".."===e?c.pop():c.push(e));return`url(${l}${c.join("/")}${l})`}))}const j=/^[^ \t\n\r\u000c]+/,W=/^[, \t\n\r\u000c]+/;const K=new WeakMap;function V(e,t){return t&&""!==t.trim()?Y(e,t):t}function q(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function Y(e,t){let n=K.get(e);if(n||(n=e.createElement("a"),K.set(e,n)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return n.setAttribute("href",t),n.href}function z(e,t,n,r,s,i,a){if(!r)return r;if("src"===n||"href"===n&&("use"!==t||"#"!==r[0]))return V(e,r);if("xlink:href"===n&&"#"!==r[0])return V(e,r);if("background"===n&&("table"===t||"td"===t||"th"===t))return V(e,r);if("srcset"===n)return function(e,t){if(""===t.trim())return t;let n=0;function r(e){let r;const s=e.exec(t.substring(n));return s?(r=s[0],n+=r.length,r):""}const s=[];for(;r(W),!(n>=t.length);){let i=r(j);if(","===i.slice(-1))i=V(e,i.substring(0,i.length-1)),s.push(i);else{let r="";i=V(e,i);let a=!1;for(;;){const e=t.charAt(n);if(""===e){s.push((i+r).trim());break}if(a)")"===e&&(a=!1);else{if(","===e){n+=1,s.push((i+r).trim());break}"("===e&&(a=!0)}r+=e,n+=1}}}return s.join(", ")}(e,r);if("style"===n){let t=H(r,Y(e));return a&&a.size>0&&(t=function(e,t){if(!e||0===t.size)return e;try{const n=e.split(";"),r=[];for(let e of n){if(e=e.trim(),!e)continue;const n=e.indexOf(":");if(-1===n){r.push(e);continue}const s=e.slice(0,n).trim();t.has(s)||r.push(e)}return r.join("; ")+(r.length>0&&e.endsWith(";")?";":"")}catch(t){return console.warn("Error filtering CSS properties:",t),e}}(t,a)),t}return"object"===t&&"data"===n?V(e,r):"function"==typeof i?i(n,r,s):r}function J(e,t,n){return("video"===e||"audio"===e)&&"autoplay"===t}function X(e,t,n=1/0,r=0){return e?e.nodeType!==e.ELEMENT_NODE||r>n?-1:t(e)?r:X(e.parentNode,t,n,r+1):-1}function Q(e,t){return n=>{const r=n;if(null===r)return!1;try{if(e)if("string"==typeof e){if(r.matches(`.${e}`))return!0}else if(function(e,t){for(let n=e.classList.length;n--;){const r=e.classList[n];if(t.test(r))return!0}return!1}(r,e))return!0;return!(!t||!r.matches(t))}catch{return!1}}}function Z(e,t,n,r,s,i){try{const a=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(null===a)return!1;if("INPUT"===a.tagName){const e=a.getAttribute("autocomplete");if(["current-password","new-password","cc-number","cc-exp","cc-exp-month","cc-exp-year","cc-csc"].includes(e))return!0}let o=-1,l=-1;if(i){if(l=X(a,Q(r,s)),l<0)return!0;o=X(a,Q(t,n),l>=0?l:1/0)}else{if(o=X(a,Q(t,n)),o<0)return!1;l=X(a,Q(r,s),o>=0?o:1/0)}return o>=0?!(l>=0)||o<=l:!(l>=0)&&!!i}catch(e){}return!!i}function ee(e,t){const{doc:n,mirror:r,blockClass:s,blockSelector:i,unblockSelector:a,maskAllText:o,maskAttributeFn:l,maskTextClass:c,unmaskTextClass:u,maskTextSelector:d,unmaskTextSelector:h,inlineStylesheet:f,maskInputOptions:g={},maskTextFn:m,maskInputFn:T,dataURLOptions:E={}
1,inlineImages:C,recordCanvas:k,keepIframeSrcFn:L,newlyAddedElement:O=!1,ignoreCSSAttributes:N}=t,P=function(e,t){if(!t.hasNode(e))return;const n=t.getId(e);return 1===n?void 0:n}(n,r);switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:p.Document,childNodes:[],compatMode:e.compatMode}:{type:p.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:p.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:P};case e.ELEMENT_NODE:return function(e,t){const{doc:n,blockClass:r,blockSelector:s,unblockSelector:i,inlineStylesheet:a,maskInputOptions:o={},maskAttributeFn:l,maskInputFn:c,dataURLOptions:u={},inlineImages:d,recordCanvas:h,keepIframeSrcFn:f,newlyAddedElement:g=!1,rootId:m,maskTextClass:T,unmaskTextClass:E,maskTextSelector:C,unmaskTextSelector:k,ignoreCSSAttributes:L}=t,O=function(e,t,n,r){try{if(r&&e.matches(r))return!1;if("string"==typeof t){if(e.classList.contains(t))return!0}else for(let n=e.classList.length;n--;){const r=e.classList[n];if(t.test(r))return!0}if(n)return e.matches(n)}catch(e){}return!1}(e,r,s,i),N=function(e){if(e instanceof HTMLFormElement)return"form";const t=v(e.tagName);return M.test(t)?"div":t}(e);let P={};const D=e.attributes.length;for(let t=0;t<D;t++){const r=e.attributes[t];r.name&&!J(N,r.name,r.value)&&(P[r.name]=z(n,N,v(r.name),r.value,e,l,L))}if("link"===N&&a){const t=Array.from(n.styleSheets).find((t=>t.href===e.href));let r=null;t&&(r=_(t)),r&&(P.rel=null,P.href=null,P.crossorigin=null,P._cssText=H(r,t.href))}if("style"===N&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){const t=_(e.sheet);t&&(P._cssText=H(t,Y(n)))}if("input"===N||"textarea"===N||"select"===N||"option"===N){const t=e,n=A(t),r=R(t,b(N),n),s=t.checked;if("submit"!==n&&"button"!==n&&r){const e=Z(t,T,C,E,k,y({type:n,tagName:b(N),maskInputOptions:o}));P.value=S({isMasked:e,element:t,value:r,maskInputFn:c})}s&&(P.checked=s)}"option"===N&&(e.selected&&!o.select?P.selected=!0:delete P.selected);if("canvas"===N&&h)if("2d"===e.__context)(function(e){const t=e.getContext("2d");if(!t)return!0;for(let n=0;n<e.width;n+=50)for(let r=0;r<e.height;r+=50){const s=t.getImageData,i=I in s?s[I]:s;if(new Uint32Array(i.call(t,n,r,Math.min(50,e.width-n),Math.min(50,e.height-r)).data.buffer).some((e=>0!==e)))return!1}return!0})(e)||(P.rr_dataURL=e.toDataURL(u.type,u.quality));else if(!("__context"in e)){const t=e.toDataURL(u.type,u.quality),r=n.createElement("canvas");r.width=e.width,r.height=e.height;t!==r.toDataURL(u.type,u.quality)&&(P.rr_dataURL=t)}if("img"===N&&d){x||(x=n.createElement("canvas"),U=x.getContext("2d"));const t=e,r=t.currentSrc||t.getAttribute("src")||"<unknown-src>",s=t.crossOrigin,i=()=>{t.removeEventListener("load",i);try{x.width=t.naturalWidth,x.height=t.naturalHeight,U.drawImage(t,0,0),P.rr_dataURL=x.toDataURL(u.type,u.quality)}catch(e){if("anonymous"!==t.crossOrigin)return t.crossOrigin="anonymous",void(t.complete&&0!==t.naturalWidth?i():t.addEventListener("load",i));console.warn(`Cannot inline img src=${r}! Error: ${e}`)}"anonymous"===t.crossOrigin&&(s?P.crossOrigin=s:t.removeAttribute("crossorigin"))};t.complete&&0!==t.naturalWidth?i():t.addEventListener("load",i)}"audio"!==N&&"video"!==N||(P.rr_mediaState=e.paused?"paused":"played",P.rr_mediaCurrentTime=e.currentTime);g||(e.scrollLeft&&(P.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(P.rr_scrollTop=e.scrollTop));if(O){const{width:t,height:n}=e.getBoundingClientRect();P={class:P.class,rr_width:`${t}px`,rr_height:`${n}px`}}"iframe"!==N||f(P.src)||(O||w(e)||(P.rr_src=P.src),delete P.src);let B;try{customElements.get(N)&&(B=!0)}catch(e){}return{type:p.Element,tagName:N,attributes:P,childNodes:[],isSVG:q(e)||void 0,needBlock:O,rootId:m,isCustom:B}}(e,{doc:n,blockClass:s,blockSelector:i,unblockSelector:a,inlineStylesheet:f,maskAttributeFn:l,maskInputOptions:g,maskInputFn:T,dataURLOptions:E,inlineImages:C,recordCanvas:k,keepIframeSrcFn:L,newlyAddedElement:O,rootId:P,maskTextClass:c,unmaskTextClass:u,maskTextSelector:d,unmaskTextSelector:h,ignoreCSSAttributes:N});case e.TEXT_NODE:return function(e,t){const{maskAllText:n,maskTextClass:r,unmaskTextClass:s,maskTextSelector:i,unmaskTextSelector:a,maskTextFn:o,maskInputOptions:l,maskInputFn:c,rootId:u}=t,d=e.parentNode&&e.parentNode.tagName;let h=e.textContent;const f="STYLE"===d||void 0,g="SCRIPT"===d||void 0,m="TEXTAREA"===d||void 0;if(f&&h){try{e.nextSibling||e.previousSibling||e.parentNode.sheet?.cssRules&&(h=_(e.parentNode.sheet))}catch(t){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${t}`,e)}h=H(h,Y(t.doc))}g&&(h="SCRIPT_PLACEHOLDER");const T=Z(e,r,i,s,a,n);f||g||m||!h||!T||(h=o?o(h,e.parentElement):h.replace(/[\S]/g,"*"));m&&h&&(l.textarea||T)&&(h=c?c(h,e.parentNode):h.replace(/[\S]/g,"*"));if("OPTION"===d&&h){h=S({isMasked:Z(e,r,i,s,a,y({type:null,tagName:d,maskInputOptions:l})),element:e,value:h,maskInputFn:c})}return{type:p.Text,textContent:h||"",isStyle:f,rootId:u}}(e,{doc:n,maskAllText:o,maskTextClass:c,unmaskTextClass:u,maskTextSelector:d,unmaskTextSelector:h,maskTextFn:m,maskInputOptions:g,maskInputFn:T,rootId:P});case e.CDATA_SECTION_NODE:return{type:p.CDATA,textContent:"",rootId:P};case e.COMMENT_NODE:return{type:p.Comment,textContent:e.textContent||"",rootId:P};default:return!1}}function te(e){return null==e?"":e.toLowerCase()}function ne(e,t){const{doc:n,mirror:r,blockClass:s,blockSelector:i,unblockSelector:a,maskAllText:o,maskTextClass:l,unmaskTextClass:c,maskTextSelector:u,unmaskTextSelector:d,skipChild:h=!1,inl
1ineStylesheet:f=!0,maskInputOptions:_={},maskAttributeFn:T,maskTextFn:E,maskInputFn:y,slimDOMOptions:S,dataURLOptions:v={},inlineImages:b=!1,recordCanvas:I=!1,onSerialize:A,onIframeLoad:R,iframeLoadTimeout:k=5e3,onBlockedImageLoad:L,onStylesheetLoad:P,stylesheetLoadTimeout:M=5e3,keepIframeSrcFn:x=()=>!1,newlyAddedElement:U=!1,ignoreCSSAttributes:B}=t;let{preserveWhiteSpace:F=!0}=t;const $=ee(e,{doc:n,mirror:r,blockClass:s,blockSelector:i,maskAllText:o,unblockSelector:a,maskTextClass:l,unmaskTextClass:c,maskTextSelector:u,unmaskTextSelector:d,inlineStylesheet:f,maskInputOptions:_,maskAttributeFn:T,maskTextFn:E,maskInputFn:y,dataURLOptions:v,inlineImages:b,recordCanvas:I,keepIframeSrcFn:x,newlyAddedElement:U,ignoreCSSAttributes:B});if(!$)return console.warn(e,"not serialized"),null;let G;G=r.hasNode(e)?r.getId(e):!function(e,t){if(t.comment&&e.type===p.Comment)return!0;if(e.type===p.Element){if(t.script&&("script"===e.tagName||"link"===e.tagName&&("preload"===e.attributes.rel||"modulepreload"===e.attributes.rel)||"link"===e.tagName&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&"js"===C(e.attributes.href)))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(te(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===te(e.attributes.name)||"icon"===te(e.attributes.rel)||"apple-touch-icon"===te(e.attributes.rel)||"shortcut icon"===te(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&te(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(te(e.attributes.property).match(/^(og|twitter|fb):/)||te(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===te(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===te(e.attributes.name)||"googlebot"===te(e.attributes.name)||"bingbot"===te(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===te(e.attributes.name)||"generator"===te(e.attributes.name)||"framework"===te(e.attributes.name)||"publisher"===te(e.attributes.name)||"progid"===te(e.attributes.name)||te(e.attributes.property).match(/^article:/)||te(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===te(e.attributes.name)||"yandex-verification"===te(e.attributes.name)||"csrf-token"===te(e.attributes.name)||"p:domain_verify"===te(e.attributes.name)||"verify-v1"===te(e.attributes.name)||"verification"===te(e.attributes.name)||"shopify-checkout-api-token"===te(e.attributes.name)))return!0}}return!1}($,S)&&(F||$.type!==p.Text||$.isStyle||$.textContent.trim().length)?D():-2;const H=Object.assign($,{id:G});if(r.add(e,H),-2===G)return null;A&&A(e);let j=!h;if(H.type===p.Element){j=j&&!H.needBlock;const t=e.shadowRoot;t&&m(t)&&(H.isShadowHost=!0)}if((H.type===p.Document||H.type===p.Element)&&j){S.headWhitespace&&H.type===p.Element&&"head"===H.tagName&&(F=!1);const t={doc:n,mirror:r,blockClass:s,blockSelector:i,maskAllText:o,unblockSelector:a,maskTextClass:l,unmaskTextClass:c,maskTextSelector:u,unmaskTextSelector:d,skipChild:h,inlineStylesheet:f,maskInputOptions:_,maskAttributeFn:T,maskTextFn:E,maskInputFn:y,slimDOMOptions:S,dataURLOptions:v,inlineImages:b,recordCanvas:I,preserveWhiteSpace:F,onSerialize:A,onIframeLoad:R,iframeLoadTimeout:k,onBlockedImageLoad:L,onStylesheetLoad:P,stylesheetLoadTimeout:M,keepIframeSrcFn:x,ignoreCSSAttributes:B},g=e.childNodes?Array.from(e.childNodes):[];for(const e of g){const n=ne(e,t);n&&H.childNodes.push(n)}if(function(e){return e.nodeType===e.ELEMENT_NODE}(e)&&e.shadowRoot)for(const n of Array.from(e.shadowRoot.childNodes)){const r=ne(n,t);r&&(m(e.shadowRoot)&&(r.isShadow=!0),H.childNodes.push(r))}}if(e.parentNode&&g(e.parentNode)&&m(e.parentNode)&&(H.isShadow=!0),H.type!==p.Element||"iframe"!==H.tagName||H.needBlock||function(e,t,n){const r=function(e){try{return e.contentWindow}catch{}}(e);if(!r)return;let s,i=!1;try{s=r.document.readyState}catch(e){return}if("complete"!==s){const r=O((()=>{i||(t(),i=!0)}),n);return void e.addEventListener("load",(()=>{N(r),i=!0,t()}))}const a="about:blank";if(r.location.href!==a||e.src===a||""===e.src)return O(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}(e,(()=>{const t=w(e);if(t&&R){const n=ne(t,{doc:t,mirror:r,blockClass:s,blockSelector:i,unblockSelector:a,maskAllText:o,maskTextClass:l,unmaskTextClass:c,maskTextSelector:u,unmaskTextSelector:d,skipChild:!1,inlineStylesheet:f,maskInputOptions:_,maskAttributeFn:T,maskTextFn:E,maskInputFn:y,slimDOMOptions:S,dataURLOptions:v,inlineImages:b,recordCanvas:I,preserveWhiteSpace:F,onSerialize:A,onIframeLoad:R,iframeLoadTimeout:k,onStylesheetLoad:P,stylesheetLoadTimeout:M,keepIframeSrcFn:x,ignoreCSSAttributes:B});n&&R(e,n)}}),k),H.type===p.Element&&"img"===H.tagName&&!e.complete&&H.needBlock){const t=e,n=()=>
1{if(t.isConnected&&!t.complete&&L)try{const e=t.getBoundingClientRect();e.width>0&&e.height>0&&L(t,H,e)}catch(e){}t.removeEventListener("load",n)};t.isConnected&&t.addEventListener("load",n)}return H.type===p.Element&&"link"===H.tagName&&"string"==typeof H.attributes.rel&&("stylesheet"===H.attributes.rel||"preload"===H.attributes.rel&&"string"==typeof H.attributes.href&&"css"===C(H.attributes.href))&&function(e,t,n){let r,s=!1;try{r=e.sheet}catch(e){r=null}if(r)return;const i=O((()=>{s||(t(),s=!0)}),n);e.addEventListener("load",(()=>{N(i),s=!0,t()}))}(e,(()=>{if(P){const t=ne(e,{doc:n,mirror:r,blockClass:s,blockSelector:i,unblockSelector:a,maskAllText:o,maskTextClass:l,unmaskTextClass:c,maskTextSelector:u,unmaskTextSelector:d,skipChild:!1,inlineStylesheet:f,maskInputOptions:_,maskAttributeFn:T,maskTextFn:E,maskInputFn:y,slimDOMOptions:S,dataURLOptions:v,inlineImages:b,recordCanvas:I,preserveWhiteSpace:F,onSerialize:A,onIframeLoad:R,iframeLoadTimeout:k,onStylesheetLoad:P,stylesheetLoadTimeout:M,keepIframeSrcFn:x,ignoreCSSAttributes:B});t&&P(e,t)}}),M),H.type===p.Element&&delete H.needBlock,H}function re(e){try{return e.contentDocument}catch(e){}}function se(e){try{return e.contentWindow}catch(e){}}function ie(e,t,n=document){const r={capture:!0,passive:!0};return n.addEventListener(e,t,r),()=>n.removeEventListener(e,t,r)}const ae="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.";let oe={map:{},getId:()=>(console.error(ae),-1),getNode:()=>(console.error(ae),null),removeNodeFromMap(){console.error(ae)},has:()=>(console.error(ae),!1),reset(){console.error(ae)}};function le(e,t,n={}){let r=null,s=0;return function(...i){const a=Date.now();s||!1!==n.leading||(s=a);const o=t-(a-s),l=this;o<=0||o>t?(r&&(!function(...e){ke("clearTimeout")(...e)}(r),r=null),s=a,e.apply(l,i)):r||!1===n.trailing||(r=Le((()=>{s=!1===n.leading?0:Date.now(),r=null,e.apply(l,i)}),o))}}function ce(e,t,n,r,s=window){const i=s.Object.getOwnPropertyDescriptor(e,t);return s.Object.defineProperty(e,t,r?n:{set(e){Le((()=>{n.set.call(this,e)}),0),i&&i.set&&i.set.call(this,e)}}),()=>ce(e,t,i||{},!0)}function ue(e,t,n){try{if(!(t in e))return()=>{};const r=e[t],s=n(r);return"function"==typeof s&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=s,()=>{e[t]=r}}catch{return()=>{}}}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(oe=new Proxy(oe,{get:(e,t,n)=>("map"===t&&console.error(ae),Reflect.get(e,t,n))}));let de=Date.now;function he(e){const t=e.document;return{left:t.scrollingElement?t.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:t?.documentElement.scrollLeft||t?.body?.parentElement?.scrollLeft||t?.body?.scrollLeft||0,top:t.scrollingElement?t.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:t?.documentElement.scrollTop||t?.body?.parentElement?.scrollTop||t?.body?.scrollTop||0}}function fe(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function pe(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function ge(e){if(!e)return null;try{return e.nodeType===e.ELEMENT_NODE?e:e.parentElement}catch(e){return null}}function me(e,t,n,r,s){if(!e)return!1;const i=ge(e);if(!i)return!1;const a=Q(t,n);if(!s){const e=r&&i.matches(r);return a(i)&&!e}const o=X(i,a);let l=-1;return!(o<0)&&(r&&(l=X(i,Q(null,r))),o>-1&&l<0||o<l)}function _e(e,t){return-2===t.getId(e)}function Te(e,t){if(g(e))return!1;const n=t.getId(e);return!t.has(n)||(!e.parentNode||e.parentNode.nodeType!==e.DOCUMENT_NODE)&&(!e.parentNode||Te(e.parentNode,t))}function Ee(e){return Boolean(e.changedTouches)}function ye(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function Se(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function ve(e){return Boolean(e?.shadowRoot)}/[1-9][0-9]{12}/.test(Date.now().toString())||(de=()=>(new Date).getTime());class be{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,t){if(this.has(e))return this.getId(e);let n;return n=void 0===t?this.id++:t,this.styleIDMap.set(e,n),this.idStyleMap.set(n,e),n}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 Ie(e){let t=null;return e.getRootNode?.()?.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&e.getRootNode().host&&(t=e.getRootNode().host),t}function Ae(e){const t=e.ownerDocument;if(!t)return!1;const n=function(e){let t,n=e;for(;t=Ie(n);)n=t;return n}(e);return t.contains(n)}function Re(e){const t=e.ownerDocument;return!!t&&(t.contains(e)||Ae(e))}const Ce={};function ke(e){const t=Ce[e];
1if(t)return t;const n=window.document;let r=window[e];if(n&&"function"==typeof n.createElement)try{const t=n.createElement("iframe");t.hidden=!0,n.head.appendChild(t);const s=t.contentWindow;s&&s[e]&&(r=s[e]),n.head.removeChild(t)}catch(e){}return Ce[e]=r.bind(window)}function Le(...e){return ke("setTimeout")(...e)}var Oe=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(Oe||{}),Ne=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(Ne||{}),we=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(we||{}),Pe=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(Pe||{}),Me=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e[e.RateChange=4]="RateChange",e))(Me||{});class De{constructor(e){this.doc=e,this.unattachedDoc=null}parse(e){return this.parseWithConstructableStylesheet(e)||this.parseWithDetachedElement(e)}parseWithConstructableStylesheet(e){if("undefined"==typeof CSSStyleSheet||"function"!=typeof CSSStyleSheet.prototype.replaceSync)return null;try{const t=new CSSStyleSheet;t.replaceSync(`x { ${e} }`);const n=t.cssRules[0];return n&&n.type===CSSRule.STYLE_RULE?n.style:null}catch{return null}}parseWithDetachedElement(e){const t=this.getUnattachedDoc().createElement("span");return t.setAttribute("style",e),t.style}getUnattachedDoc(){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch{this.unattachedDoc=this.doc}return this.unattachedDoc}}function xe(e){return"__ln"in e}class Ue{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 t=this.head;for(let n=0;n<e;n++)t=t?.next||null;return t}addNode(e){const t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&xe(e.previousSibling)){const n=e.previousSibling.__ln.next;t.next=n,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,n&&(n.previous=t)}else if(e.nextSibling&&xe(e.nextSibling)&&e.nextSibling.__ln.previous){const n=e.nextSibling.__ln.previous;t.previous=n,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,n&&(n.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;null===t.next&&(this.tail=t),this.length++}removeNode(e){const t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next?t.next.previous=t.previous:this.tail=t.previous):(this.head=t.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--)}}const Be=(e,t)=>`${e}@${t}`;class Fe{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;const e=[],t=new Set,n=new Ue,r=e=>{let t=e,n=-2;for(;-2===n;)t=t&&t.nextSibling,n=t&&this.mirror.getId(t);return n},s=s=>{if(!s.parentNode||!Re(s))return;const i=g(s.parentNode)?this.mirror.getId(Ie(s)):this.mirror.getId(s.parentNode),a=r(s);if(-1===i||-1===a)return n.addNode(s);const o=ne(s,{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.inl
1ineStylesheet,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:e=>{ye(e,this.mirror)&&!me(e,this.blockClass,this.blockSelector,this.unblockSelector,!1)&&this.iframeManager.addIframe(e),Se(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),ve(s)&&this.shadowDomManager.addShadowRoot(s.shadowRoot,this.doc)},onIframeLoad:(e,t)=>{if(me(e,this.blockClass,this.blockSelector,this.unblockSelector,!1))return;this.iframeManager.attachIframe(e,t);const n=se(e);n&&this.canvasManager.addWindow(n),this.shadowDomManager.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{this.stylesheetManager.attachLinkElement(e,t)},onBlockedImageLoad:(e,t,{width:n,height:r})=>{this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:{style:{width:`${n}px`,height:`${r}px`}}}]})},ignoreCSSAttributes:this.ignoreCSSAttributes});o&&(e.push({parentId:i,nextId:a,node:o}),t.add(o.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const e of this.movedSet)Ge(this.removes,e,this.mirror)&&!this.movedSet.has(e.parentNode)||s(e);for(const e of this.addedSet)He(this.droppedSet,e)||Ge(this.removes,e,this.mirror)?He(this.movedSet,e)?s(e):this.droppedSet.add(e):s(e);let i=null;for(;n.length;){let e=null;if(i){const t=this.mirror.getId(i.value.parentNode),n=r(i.value);-1!==t&&-1!==n&&(e=i)}if(!e){let t=n.tail;for(;t;){const n=t;if(t=t.previous,n){const t=this.mirror.getId(n.value.parentNode);if(-1===r(n.value))continue;if(-1!==t){e=n;break}{const t=n.value;if(t.parentNode&&t.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const r=t.parentNode.host;if(-1!==this.mirror.getId(r)){e=n;break}}}}}}if(!e){for(;n.head;)n.removeNode(n.head.value);break}i=e.previous,n.removeNode(e.value),s(e.value)}const a={texts:this.texts.map((e=>({id:this.mirror.getId(e.node),value:e.value}))).filter((e=>!t.has(e.id))).filter((e=>this.mirror.has(e.id))),attributes:this.attributes.map((e=>{const{attributes:t}=e;if("string"==typeof t.style){const n=JSON.stringify(e.styleDiff),r=JSON.stringify(e._unchangedStyles);n.length<t.style.length&&(n+r).split("var(").length===t.style.split("var(").length&&(t.style=e.styleDiff)}return{id:this.mirror.getId(e.node),attributes:t}})).filter((e=>!t.has(e.id))).filter((e=>this.mirror.has(e.id))),removes:this.removes,adds:e};(a.texts.length||a.attributes.length||a.removes.length||a.adds.length)&&(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(a))},this.processMutation=e=>{if(!_e(e.target,this.mirror))switch(e.type){case"characterData":{const t=e.target.textContent;me(e.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||t===e.oldValue||this.texts.push({value:Z(e.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,this.maskAllText)&&t?this.maskTextFn?this.maskTextFn(t,ge(e.target)):t.replace(/[\S]/g,"*"):t,node:e.target});break}case"attributes":{const t=e.target;let n=e.attributeName,r=e.target.getAttribute(n);if("value"===n){const n=A(t),s=t.tagName;r=R(t,s,n);const i=y({maskInputOptions:this.maskInputOptions,tagName:s,type:n});r=S({isMasked:Z(e.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,i),element:t,value:r,maskInputFn:this.maskInputFn})}if(me(e.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||r===e.oldValue)return;let s=this.attributeMap.get(e.target);if("IFRAME"===t.tagName&&"src"===n&&!this.keepIframeSrcFn(r)){if(re(t))return;n="rr_src"}if(s||(s={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(s),this.attributeMap.set(e.target,s)),"type"===n&&"INPUT"===t.tagName&&"password"===(e.oldValue||"").toLowerCase()&&t.setAttribute("data-rr-is-password","true"),!J(t.tagName,n)&&(s.attributes[n]=z(this.doc,v(t.tagName),v(n),r,t,this.maskAttributeFn),"style"===n)){const n=e.oldValue?this.styleDeclarationParser.parse(e.oldValue):null;for(const e of Array.from(t.style)){const r=t.style.getPropertyValue(e),i=t.style.getPropertyPriority(e);r!==(n?.getPropertyValue(e)||"")||i!==(n?.getPropertyPriority(e)||"")?s.styleDiff[e]=""===i?r:[r,i]:s._unchangedStyles[e]=[r,i]}if(n)for(const e of Array.from(n))""===t.style.getPropertyValue(e)&&(s.styleDiff[e]=!1)}break}case"childList":if(me(e.target,this.blockClass,this.blockSelector,this.unblockSelector,!0))return;
1e.addedNodes.forEach((t=>this.genAdds(t,e.target))),e.removedNodes.forEach((t=>{const n=this.mirror.getId(t),r=g(e.target)?this.mirror.getId(e.target.host):this.mirror.getId(e.target);me(e.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||_e(t,this.mirror)||!function(e,t){return-1!==t.getId(e)}(t,this.mirror)||(this.addedSet.has(t)?($e(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===n||Te(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[Be(n,r)]?$e(this.movedSet,t):this.removes.push({parentId:r,id:n,isShadow:!(!g(e.target)||!m(e.target))||void 0})),this.mapRemoves.push(t))}))}},this.genAdds=(e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!this.addedSet.has(e)&&!this.movedSet.has(e)){if(this.mirror.hasNode(e)){if(_e(e,this.mirror))return;this.movedSet.add(e);let n=null;t&&this.mirror.hasNode(t)&&(n=this.mirror.getId(t)),n&&-1!==n&&(this.movedMap[Be(this.mirror.getId(e),n)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);me(e,this.blockClass,this.blockSelector,this.unblockSelector,!1)||(e.childNodes&&e.childNodes.forEach((e=>this.genAdds(e))),ve(e)&&e.shadowRoot.childNodes.forEach((t=>{this.processedNodeManager.add(t,this),this.genAdds(t,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((t=>{this[t]=e[t]})),this.styleDeclarationParser=new De(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 $e(e,t){e.delete(t),t.childNodes?.forEach((t=>$e(e,t)))}function Ge(e,t,n){return 0!==e.length&&function(e,t,n){let r=t.parentNode;for(;r;){const t=n.getId(r);if(e.some((e=>e.id===t)))return!0;r=r.parentNode}return!1}(e,t,n)}function He(e,t){return 0!==e.size&&je(e,t)}function je(e,t){const{parentNode:n}=t;return!!n&&(!!e.has(n)||je(e,n))}let We;const Ke=e=>{if(!We)return e;return(...t)=>{try{return e(...t)}catch(e){if(We&&!0===We(e))return()=>{};throw e}}},Ve=[];function qe(e){try{if("composedPath"in e){const t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch{}return e&&e.target}function Ye(e,t){const n=new Fe;Ve.push(n),n.init(e);let r=window.MutationObserver||window.__rrMutationObserver;const s=window?.Zone?.__symbol__?.("MutationObserver");s&&window[s]&&(r=window[s]);const i=new r(Ke((t=>{e.onMutation&&!1===e.onMutation(t)||n.processMutations.bind(n)(t)})));return i.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),i}function ze({mouseInteractionCb:e,doc:t,mirror:n,blockClass:r,blockSelector:s,unblockSelector:i,sampling:a}){if(!1===a.mouseInteraction)return()=>{};const o=!0===a.mouseInteraction||void 0===a.mouseInteraction?{}:a.mouseInteraction,l=[];let c=null;return Object.keys(we).filter((e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==o[e])).forEach((a=>{let o=v(a);const u=(t=>a=>{const o=qe(a);if(me(o,r,s,i,!0))return;let l=null,u=t;if("pointerType"in a){switch(a.pointerType){case"mouse":l=Pe.Mouse;break;case"touch":l=Pe.Touch;break;case"pen":l=Pe.Pen}l===Pe.Touch?we[t]===we.MouseDown?u="TouchStart":we[t]===we.MouseUp&&(u="TouchEnd"):Pe.Pen}else Ee(a)&&(l=Pe.Touch);null!==l?(c=l,(u.startsWith("Touch")&&l===Pe.Touch||u.startsWith("Mouse")&&l===Pe.Mouse)&&(l=null)):we[t]===we.Click&&(l=c,c=null);const d=Ee(a)?a.changedTouches[0]:a;if(!d)return;const h=n.getId(o),{clientX:f,clientY:p}=d;Ke(e)({type:we[u],id:h,x:f,y:p,...null!==l&&{pointerType:l}})})(a);if(window.PointerEvent)switch(we[a]){case we.MouseDown:case we.MouseUp:o=o.replace("mouse","pointer");break;case we.TouchStart:case we.TouchEnd:return}l.push(ie(o,u,t))})),Ke((()=>{l.forEach((e=>e()))}))}function Je({scrollCb:e,doc:t,mirror:n,blockClass:r,blockSelector:s,unblockSelector:i,sampling:a}){return ie("scroll",Ke(le(Ke((a=>{const o=qe(a);if(!o||me(o,r,s,i,!0))return;const l=n.getId(o);if(o===t&&t.defaultView){const n=he(t.defaultView);e({id:l,x:n.left,y:n.top})}else e({id:l,x:o.scrollLeft,y:o.scrollTop})})),a.scroll||100)),t)}const Xe=["INPUT","TEXTAREA","SELECT"],Qe=new WeakMap;function Ze({inputCb:e,doc:t,mirror:n,blockClass:r,blockSelector:s,unblockSelector:i,ignoreClass:a,ignoreSelector:o,maskInputOptions:l,maskInputFn:c,sampling:u,userTriggeredOnInput:d,maskTextClass:h,unmaskTextClass:f,maskTextSelector:p,unmaskTextSelector:g}){function m(e){let n=qe(e);const u=e.isTrusted,m=n&&b(n.tagName);if("OPTION"===m&&(n=n.parentElement),!n||!m||Xe.indexOf(m)<0||me(n,r,s,i,!0))return;const T=n;if(T.classList.contains(a)||o&&T.matches(o))return;const E=A(n);let v=R(T,m,E),I=!1;const C=y({maskInputOptions:l,tagName:m,type:E}),k=Z(n,h,p,f,g,C);"radio"!==E&&"checkbox"!==E||(I=n.checked),v=S({isMasked:k,element:n,value:v,maskInputFn:c}
vendor: 9,342 bytes, line 1
1),_(n,d?{text:v,isChecked:I,userTriggered:u}:{text:v,isChecked:I});const L=n.name;"radio"===E&&L&&I&&t.querySelectorAll(`input[type="radio"][name="${L}"]`).forEach((e=>{if(e!==n){const t=S({isMasked:k,element:e,value:R(e,m,E),maskInputFn:c});_(e,d?{text:t,isChecked:!I,userTriggered:!1}:{text:t,isChecked:!I})}}))}function _(t,r){const s=Qe.get(t);if(!s||s.text!==r.text||s.isChecked!==r.isChecked){Qe.set(t,r);const s=n.getId(t);Ke(e)({...r,id:s})}}const T=("last"===u.input?["change"]:["input","change"]).map((e=>ie(e,Ke(m),t))),E=t.defaultView;if(!E)return()=>{T.forEach((e=>e()))};const v=E.Object.getOwnPropertyDescriptor(E.HTMLInputElement.prototype,"value"),I=[[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 v&&v.set&&T.push(...I.map((e=>ce(e[0],e[1],{set(){Ke(m)({target:this,isTrusted:!1})}},!1,E)))),Ke((()=>{T.forEach((e=>e()))}))}function et(e){return function(e,t){if(st("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||st("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||st("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||st("CSSConditionRule")&&e.parentRule instanceof CSSConditionRule){const n=Array.from(e.parentRule.cssRules).indexOf(e);t.unshift(n)}else if(e.parentStyleSheet){const n=Array.from(e.parentStyleSheet.cssRules).indexOf(e);t.unshift(n)}return t}(e,[])}function tt(e,t,n){let r,s;return e?(e.ownerNode?r=t.getId(e.ownerNode):s=n.getId(e),{styleId:s,id:r}):{}}function nt({mirror:e,stylesheetManager:t},n){let r=null;r="#document"===n.nodeName?e.getId(n):e.getId(n.host);const s="#document"===n.nodeName?n.defaultView?.Document:n.ownerDocument?.defaultView?.ShadowRoot,i=s?.prototype?Object.getOwnPropertyDescriptor(s?.prototype,"adoptedStyleSheets"):void 0;return null!==r&&-1!==r&&s&&i?(Object.defineProperty(n,"adoptedStyleSheets",{configurable:i.configurable,enumerable:i.enumerable,get(){return i.get?.call(this)},set(e){const n=i.set?.call(this,e);if(null!==r&&-1!==r)try{t.adoptStyleSheets(e,r)}catch(e){}return n}}),Ke((()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:i.configurable,enumerable:i.enumerable,get:i.get,set:i.set})}))):()=>{}}function rt(e,t={}){const n=e.doc.defaultView;if(!n)return()=>{};let r;e.recordDOM&&(r=Ye(e,e.doc));const s=function({mousemoveCb:e,sampling:t,doc:n,mirror:r}){if(!1===t.mousemove)return()=>{};const s="number"==typeof t.mousemove?t.mousemove:50,i="number"==typeof t.mousemoveCallback?t.mousemoveCallback:500;let a,o=[];const l=le(Ke((t=>{const n=Date.now()-a;e(o.map((e=>(e.timeOffset-=n,e))),t),o=[],a=null})),i),c=Ke(le(Ke((e=>{const t=qe(e),{clientX:n,clientY:s}=Ee(e)?e.changedTouches[0]:e;a||(a=de()),o.push({x:n,y:s,id:r.getId(t),timeOffset:de()-a}),l("undefined"!=typeof DragEvent&&e instanceof DragEvent?Ne.Drag:e instanceof MouseEvent?Ne.MouseMove:Ne.TouchMove)})),s,{trailing:!1})),u=[ie("mousemove",c,n),ie("touchmove",c,n),ie("drag",c,n)];return Ke((()=>{u.forEach((e=>e()))}))}(e),i=ze(e),a=Je(e),o=function({viewportResizeCb:e},{win:t}){let n=-1,r=-1;return ie("resize",Ke(le(Ke((()=>{const t=fe(),s=pe();n===t&&r===s||(e({width:Number(s),height:Number(t)}),n=t,r=s)})),200)),t)}(e,{win:n}),l=Ze(e),c=function({mediaInteractionCb:e,blockClass:t,blockSelector:n,unblockSelector:r,mirror:s,sampling:i,doc:a}){const o=Ke((a=>le(Ke((i=>{const o=qe(i);if(!o||me(o,t,n,r,!0))return;const{currentTime:l,volume:c,muted:u,playbackRate:d}=o;e({type:a,id:s.getId(o),currentTime:l,volume:c,muted:u,playbackRate:d})})),i.media||500))),l=[ie("play",o(Me.Play),a),ie("pause",o(Me.Pause),a),ie("seeked",o(Me.Seeked),a),ie("volumechange",o(Me.VolumeChange),a),ie("ratechange",o(Me.RateChange),a)];return Ke((()=>{l.forEach((e=>e()))}))}(e);let u=()=>{},d=()=>{},h=()=>{},f=()=>{};e.recordDOM&&(u=function({styleSheetRuleCb:e,mirror:t,stylesheetManager:n},{win:r}){if(!r.CSSStyleSheet||!r.CSSStyleSheet.prototype)return()=>{};const s=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=new Proxy(s,{apply:Ke(((r,s,i)=>{const[a,o]=i,{id:l,styleId:c}=tt(s,t,n.styleMirror);return(l&&-1!==l||c&&-1!==c)&&e({id:l,styleId:c,adds:[{rule:a,index:o}]}),r.apply(s,i)}))});const i=r.CSSStyleSheet.prototype.deleteRule;let a,o;r.CSSStyleSheet.prototype.deleteRule=new Proxy(i,{apply:Ke(((r,s,i)=>{const[a]=i,{id:o,styleId:l}=tt(s,t,n.styleMirror);return(o&&-1!==o||l&&-1!==l)&&e({id:o,styleId:l,removes:[{index:a}]}),r.apply(s,i)}))}),r.CSSStyleSheet.prototype.replace&&(a=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(a,{apply:Ke(((r,s,i)=>{const[a]=i,{id:o,styleId:l}=tt(s,t,n.styleMirror);return(o&&-1!==o||l&&-1!==l)&&e({id:o,styleId:l,replace:a}),r.apply(s,i)}))})),r.CSSStyleSheet.prototype.replaceSync&&(o=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(o,{apply:Ke(((r,s,i)=>{const[a]=i,{id:o,styleId:l}=tt(s,t,n.styleMirror);return(o&&-1!==o||l&&-1!==l)&&e({id:o,styleId:l,replaceSync:a}),r.apply(s,i)}))}));const l={};it("CSSGroupingRule")?l.CSSGroupingRule=r.CSSGroupingRule:(it("CSSMediaRule")&&(l.CSSMediaRule=r.CSSMediaRule),it("CSSConditionRule")&&(l.CSSConditionRule=r.CSSConditionRule),it("CSSSupportsRule")&&(l.CSSSupportsRule=r.CSSSupportsRule));const c={};return Object.entries(l).forEach((([r,s])=>{c[r]={insertRule:s.prototype.insertRule,deleteRule:s.prototype.deleteRule},s.prototype.insertRule=new Proxy(c[r].insertRule,{apply:Ke(((r,s,i)=>{const[a,o]=i,{id:l,styleId:c}=tt(s.parentStyleSheet,t,n.styleMirror);return(l&&-1!==l||c&&-1!==c)&&e({id:l,styleId:c,adds:[{rule:a,index:[...et(s),o||0]}]}),r.apply(s,i)}))}),s.prototype.deleteRule=new Proxy(c[r].deleteRule,{apply:Ke(((r,s,i)=>{const[a]=i,{id:o,styleId:l}=tt(s.parentStyleSheet,t,n.styleMirror);return(o&&-1!==o||l&&-1!==l)&&e({id:o,styleId:l,removes:[{index:[...et(s),a]}]}),r.apply(s,i)}))})})),Ke((()=>{r.CSSStyleSheet.prototype.insertRule=s,r.CSSStyleSheet.prototype.deleteRule=i,a&&(r.CSSStyleSheet.prototype.replace=a),o&&(r.CSSStyleSheet.prototype.replaceSync=o),Object.entries(l).forEach((([e,t])=>{t.prototype.insertRule=c[e].insertRule,t.prototype.deleteRule=c[e].deleteRule}))}))}(e,{win:n}),d=nt(e,e.doc),h=function({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:n,stylesheetManager:r},{win:s}){const i=s.CSSStyleDeclaration.prototype.setProperty;s.CSSStyleDeclaration.prototype.setProperty=new Proxy(i,{apply:Ke(((s,a,o)=>{const[l,c,u]=o;if(n.has(l))return i.apply(a,[l,c,u]);const{id:d,styleId:h}=tt(a.parentRule?.parentStyleSheet,t,r.styleMirror);return(d&&-1!==d||h&&-1!==h)&&e({id:d,styleId:h,set:{property:l,value:c,priority:u},index:et(a.parentRule)}),s.apply(a,o)}))});const a=s.CSSStyleDeclaration.prototype.removeProperty;return s.CSSStyleDeclaration.prototype.removeProperty=new Proxy(a,{apply:Ke(((s,i,o)=>{const[l]=o;if(n.has(l))return a.apply(i,[l]);const{id:c,styleId:u}=tt(i.parentRule?.parentStyleSheet,t,r.styleMirror);return(c&&-1!==c||u&&-1!==u)&&e({id:c,styleId:u,remove:{property:l},index:et(i.parentRule)}),s.apply(i,o)}))}),Ke((()=>{s.CSSStyleDeclaration.prototype.setProperty=i,s.CSSStyleDeclaration.prototype.removeProperty=a}))}(e,{win:n}),e.collectFonts&&(f=function({fontCb:e,doc:t}){const n=t.defaultView;if(!n)return()=>{};const r=[],s=new WeakMap,i=n.FontFace;n.FontFace=function(e,t,n){const r=new i(e,t,n);return s.set(r,{family:e,buffer:"string"!=typeof t,descriptors:n,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),r};const a=ue(t.fonts,"add",(function(t){return function(n){return Le(Ke((()=>{const t=s.get(n);t&&(e(t),s.delete(n))})),0),t.apply(this,[n])}}));return r.push((()=>{n.FontFace=i})),r.push(a),Ke((()=>{r.forEach((e=>e()))}))}(e)));const p=function(e){const{doc:t,mirror:n,blockClass:r,blockSelector:s,unblockSelector:i,selectionCb:a}=e;let o=!0;const l=Ke((()=>{const e=t.getSelection();if(!e||o&&e?.isCollapsed)return;o=e.isCollapsed||!1;const l=[],c=e.rangeCount||0;for(let t=0;t<c;t++){const a=e.getRangeAt(t),{startContainer:o,startOffset:c,endContainer:u,endOffset:d}=a;me(o,r,s,i,!0)||me(u,r,s,i,!0)||l.push({start:n.getId(o),startOffset:c,end:n.getId(u),endOffset:d})}a({ranges:l})}));return l(),ie("selectionchange",l)}(e),g=function({doc:e,customElementCb:t}){const n=e.defaultView;return n&&n.customElements?ue(n.customElements,"define",(function(e){return function(n,r,s){try{t({define:{name:n}})}catch(e){}return e.apply(this,[n,r,s])}})):()=>{}}(e),m=[];for(const t of e.plugins)m.push(t.observer(t.callback,n,t.options));return Ke((()=>{Ve.forEach((e=>e.reset())),r?.disconnect(),s(),i(),a(),o(),l(),c(),u(),d(),h(),f(),p(),g(),m.forEach((e=>e()))}))}function st(e){return void 0!==window[e]}function it(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class at{constructor(e){this.generateIdFn=e,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}getId(e,t,n,r){const s=n||this.getIdToRemoteIdMap(e),i=r||this.getRemoteIdToIdMap(e);let a=s.get(t);return a||(a=this.generateIdFn(),s.set(t,a),i.set(a,t)),a}getIds(e,t){const n=this.getIdToRemoteIdMap(e),r=this.getRemoteIdToIdMap(e);return t.map((t=>this.getId(e,t,n,r)))}
1getRemoteId(e,t,n){const r=n||this.getRemoteIdToIdMap(e);if("number"!=typeof t)return t;const s=r.get(t);return s||-1}getRemoteIds(e,t){const n=this.getRemoteIdToIdMap(e);return t.map((t=>this.getRemoteId(e,t,n)))}reset(e){if(!e)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){let t=this.iframeIdToRemoteIdMap.get(e);return t||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}getRemoteIdToIdMap(e){let t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}}class ot{constructor(){this.crossOriginIframeMirror=new at(D),this.crossOriginIframeRootIdMap=new WeakMap}addIframe(){}addLoadListener(){}attachIframe(){}}class lt{constructor(e){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new at(D),this.crossOriginIframeRootIdMap=new WeakMap,this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new at(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);const t=se(e);t&&this.crossOriginIframeMap.set(t,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,t){this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&se(e)?.addEventListener("message",this.handleMessage.bind(this)),this.loadListener?.(e);const n=re(e);n&&n.adoptedStyleSheets&&n.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(n.adoptedStyleSheets,this.mirror.getId(n))}handleMessage(e){const t=e;if("rrweb"!==t.data.type||t.origin!==t.data.origin)return;if(!e.source)return;const n=this.crossOriginIframeMap.get(e.source);if(!n)return;const r=this.transformCrossOriginEvent(n,t.data.event);r&&this.wrappedEmit(r,t.data.isCheckout)}transformCrossOriginEvent(e,t){switch(t.type){case Oe.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);const n=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,n),this.patchRootIdOnNode(t.data.node,n),{timestamp:t.timestamp,type:Oe.IncrementalSnapshot,data:{source:Ne.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case Oe.Meta:case Oe.Load:case Oe.DomContentLoaded:return!1;case Oe.Plugin:return t;case Oe.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case Oe.IncrementalSnapshot:switch(t.data.source){case Ne.Mutation:return t.data.adds.forEach((t=>{this.replaceIds(t,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(t.node,e);const n=this.crossOriginIframeRootIdMap.get(e);n&&this.patchRootIdOnNode(t.node,n)})),t.data.removes.forEach((t=>{this.replaceIds(t,e,["parentId","id"])})),t.data.attributes.forEach((t=>{this.replaceIds(t,e,["id"])})),t.data.texts.forEach((t=>{this.replaceIds(t,e,["id"])})),t;case Ne.Drag:case Ne.TouchMove:case Ne.MouseMove:return t.data.positions.forEach((t=>{this.replaceIds(t,e,["id"])})),t;case Ne.ViewportResize:return!1;case Ne.MediaInteraction:case Ne.MouseInteraction:case Ne.Scroll:case Ne.CanvasMutation:case Ne.Input:return this.replaceIds(t.data,e,["id"]),t;case Ne.StyleSheetRule:case Ne.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case Ne.Font:return t;case Ne.Selection:return t.data.ranges.forEach((t=>{this.replaceIds(t,e,["start","end"])})),t;case Ne.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),t.data.styles?.forEach((t=>{this.replaceStyleIds(t,e,["styleId"])})),t}}return!1}replace(e,t,n,r){for(const s of r)(Array.isArray(t[s])||"number"==typeof t[s])&&(Array.isArray(t[s])?t[s]=e.getIds(n,t[s]):t[s]=e.getId(n,t[s]));return t}replaceIds(e,t,n){return this.replace(this.crossOriginIframeMirror,e,t,n)}replaceStyleIds(e,t,n){return this.replace(this.crossOriginIframeStyleMirror,e,t,n)}replaceIdOnNode(e,t){this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEac
1h((e=>{this.replaceIdOnNode(e,t)}))}patchRootIdOnNode(e,t){e.type===p.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach((e=>{this.patchRootIdOnNode(e,t)}))}}class ct{init(){}addShadowRoot(){}observeAttachShadow(){}reset(){}}class ut{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,t){if(!m(e))return;if(this.shadowDoms.has(e))return;this.shadowDoms.add(e),this.bypassOptions.canvasManager.addShadowRoot(e);const n=Ye({...this.bypassOptions,doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push((()=>n.disconnect())),this.restoreHandlers.push(Je({...this.bypassOptions,scrollCb:this.scrollCb,doc:e,mirror:this.mirror})),Le((()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(e.host)),this.restoreHandlers.push(nt({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e))}),0)}observeAttachShadow(e){const t=re(e),n=se(e);t&&n&&this.patchAttachShadow(n.Element,t)}patchAttachShadow(e,t){const n=this;this.restoreHandlers.push(ue(e.prototype,"attachShadow",(function(e){return function(r){const s=e.call(this,r);return this.shadowRoot&&Re(this)&&n.addShadowRoot(this.shadowRoot,t),s}})))}reset(){this.restoreHandlers.forEach((e=>{try{e()}catch(e){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet,this.bypassOptions.canvasManager.resetShadowRoots()}}for(var dt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ht="undefined"==typeof Uint8Array?[]:new Uint8Array(256),ft=0;ft<64;ft++)ht[dt.charCodeAt(ft)]=ft;class pt{reset(){}freeze(){}unfreeze(){}lock(){}unlock(){}snapshot(){}addWindow(){}addShadowRoot(){}resetShadowRoots(){}}class gt{constructor(e){this.trackedLinkElements=new WeakSet,this.styleMirror=new be,this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,t){if(0===e.length)return;const n={id:t,styleIds:[]},r=[];for(const t of e){let e;this.styleMirror.has(t)?e=this.styleMirror.getId(t):(e=this.styleMirror.add(t),r.push({styleId:e,rules:Array.from(t.rules||CSSRule,((e,t)=>({rule:T(e),index:t})))})),n.styleIds.push(e)}r.length>0&&(n.styles=r),this.adoptedStyleSheetCb(n)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}class mt{constructor(){this.nodeMap=new WeakMap,this.active=!1}inOtherBuffer(e,t){const n=this.nodeMap.get(e);return n&&Array.from(n).some((e=>e!==t))}add(e,t){this.active||(this.active=!0,function(...e){ke("requestAnimationFrame")(...e)}((()=>{this.nodeMap=new WeakMap,this.active=!1}))),this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}destroy(){}}let _t,Tt;try{if(2!==Array.from([1],(e=>2*e))[0]){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=e.contentWindow?.Array.from||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}const Et=new E;function yt(e={}){const{emit:t,checkoutEveryNms:n,checkoutEveryNth:r,blockClass:s="rr-block",blockSelector:i=null,unblockSelector:a=null,ignoreClass:o="rr-ignore",ignoreSelector:l=null,maskAllText:c=!1,maskTextClass:u="rr-mask",unmaskTextClass:d=null,maskTextSelector:h=null,unmaskTextSelector:f=null,inlineStylesheet:p=!0,maskAllInputs:g,maskInputOptions:m,slimDOMOptions:_,maskAttributeFn:T,maskInputFn:y,maskTextFn:S,maxCanvasSize:v=null,packFn:b,sampling:I={},dataURLOptions:A={},mousemoveWait:R,recordDOM:C=!0,recordCanvas:k=!1,recordCrossOriginIframes:L=!1,recordAfter:O=("DOMContentLoaded"===e.recordAfter?e.recordAfter:"load"),userTriggeredOnInput:N=!1,collectFonts:w=!1,inlineImages:P=!1,plugins:M,keepIframeSrcFn:D=()=>!1,ignoreCSSAttributes:x=new Set([]),errorHandler:U,onMutation:B,getCanvasManager:F}=e;We=U;const $=!L||window.parent===window;let G=!1;if(!$)try{window.parent.document&&(G=!1)}catch(e){G=!0}if($&&!t)throw new Error("emit function is required");if(!$&&!G)return()=>{};void 0!==R&&void 0===I.mousemove&&(I.mousemove=R),Et.reset();const H=!0===g?{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}:void 0!==m?m:{},j=!0===_||"all"===_?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===_,headMetaDescKeywords:"all"===_}:_||{};let W;!function(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=(...e)=>{let t=e[0];if(!(0 in e))throw new TypeError("1 argument is required");do{if(this===t)return!0}while(t=t&&t.parentNode);return!1})}();let K=0;const V=e=>{for(const t of M||[])t.eventProcessor&&(e=t.eventProcessor(e));return b&&!G&&(e=b(e)),e};_t=(e,s)=>{const i=e;if(i.timestamp=de(),!Ve[0]?.isFrozen()||i.type===Oe.FullSnapshot||i.type===Oe.IncrementalSnapshot&&i.data.source===Ne.Mutation||Ve.forEach((e=>e.unfreeze())),$)t?.(V(i),s);else if(G){const e={type:"rrweb",event:V(i),origin:window.location.origin,isCheckout:s};window.parent.postMessage(e,"*")}if(i.type===Oe.FullSnapshot)W=i,K=0;else if(i.type===Oe.IncrementalSnapshot){if(i.data.source===Ne.Mutation&&i.data.isAttachIframe)return;K++;const e=r&&K>=r,t=n&&W&&i.timestamp-W.timestamp>n;(e||t)&&te(!0)}};const q=e=>{_t({type:Oe.IncrementalSnapshot,data:{source:Ne.Mutation,...e}})},Y=e=>_t({type:Oe.IncrementalSnapshot,data:{source:Ne.Scroll,...e}}),z=e=>_t({type:Oe.IncrementalSnapshot,data:{source:Ne.CanvasMutation,...e}}),J=new gt({mutationCb:q,adoptedStyleSheetCb:e=>_t({type:Oe.IncrementalSnapshot,data:{source:Ne.AdoptedStyleSheet,...e}})}),X="boolean"==typeof __RRWEB_EXCLUDE_IFRAME__&&__RRWEB_EXCLUDE_IFRAME__?new ot:new lt({mirror:Et,mutationCb:q,stylesheetManager:J,recordCrossOriginIframes:L,wrappedEmit:_t});for(const e of M||[])e.getMirror&&e.getMirror({nodeMirror:Et,crossOriginIframeMirror:X.crossOriginIframeMirror,crossOriginIframeStyleMirror:X.crossOriginIframeStyleMirror});const Q=new mt,Z=function(e,t){try{return e?e(t):new pt}catch{return console.warn("Unable to initialize CanvasManager"),new pt}}(F,{mirror:Et,win:window,mutationCb:e=>_t({type:Oe.IncrementalSnapshot,data:{source:Ne.CanvasMutation,...e}}),recordCanvas:k,blockClass:s,blockSelector:i,unblockSelector:a,maxCanvasSize:v,sampling:I.canvas,dataURLOptions:A,errorHandler:U}),ee="boolean"==typeof __RRWEB_EXCLUDE_SHADOW_DOM__&&__RRWEB_EXCLUDE_SHADOW_DOM__?new ct:ne
1w ut({mutationCb:q,scrollCb:Y,bypassOptions:{onMutation:B,blockClass:s,blockSelector:i,unblockSelector:a,maskAllText:c,maskTextClass:u,unmaskTextClass:d,maskTextSelector:h,unmaskTextSelector:f,inlineStylesheet:p,maskInputOptions:H,dataURLOptions:A,maskAttributeFn:T,maskTextFn:S,maskInputFn:y,recordCanvas:k,inlineImages:P,sampling:I,slimDOMOptions:j,iframeManager:X,stylesheetManager:J,canvasManager:Z,keepIframeSrcFn:D,processedNodeManager:Q,ignoreCSSAttributes:x},mirror:Et}),te=(e=!1)=>{if(!C)return;_t({type:Oe.Meta,data:{href:window.location.href,width:pe(),height:fe()}},e),J.reset(),ee.init(),Ve.forEach((e=>e.lock()));const t=function(e,t){const{mirror:n=new E,blockClass:r="rr-block",blockSelector:s=null,unblockSelector:i=null,maskAllText:a=!1,maskTextClass:o="rr-mask",unmaskTextClass:l=null,maskTextSelector:c=null,unmaskTextSelector:u=null,inlineStylesheet:d=!0,inlineImages:h=!1,recordCanvas:f=!1,maskAllInputs:p=!1,maskAttributeFn:g,maskTextFn:m,maskInputFn:_,slimDOM:T=!1,dataURLOptions:y,preserveWhiteSpace:S,onSerialize:v,onIframeLoad:b,iframeLoadTimeout:I,onBlockedImageLoad:A,onStylesheetLoad:R,stylesheetLoadTimeout:C,keepIframeSrcFn:k=()=>!1,ignoreCSSAttributes:L=new Set([])}=t||{};return ne(e,{doc:e,mirror:n,blockClass:r,blockSelector:s,unblockSelector:i,maskAllText:a,maskTextClass:o,unmaskTextClass:l,maskTextSelector:c,unmaskTextSelector:u,skipChild:!1,inlineStylesheet:d,maskInputOptions:!0===p?{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}:!1===p?{}:p,maskAttributeFn:g,maskTextFn:m,maskInputFn:_,slimDOMOptions:!0===T||"all"===T?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===T,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===T?{}:T,dataURLOptions:y,inlineImages:h,recordCanvas:f,preserveWhiteSpace:S,onSerialize:v,onIframeLoad:b,iframeLoadTimeout:I,onBlockedImageLoad:A,onStylesheetLoad:R,stylesheetLoadTimeout:C,keepIframeSrcFn:k,newlyAddedElement:!1,ignoreCSSAttributes:L})}(document,{mirror:Et,blockClass:s,blockSelector:i,unblockSelector:a,maskAllText:c,maskTextClass:u,unmaskTextClass:d,maskTextSelector:h,unmaskTextSelector:f,inlineStylesheet:p,maskAllInputs:H,maskAttributeFn:T,maskInputFn:y,maskTextFn:S,slimDOM:j,dataURLOptions:A,recordCanvas:k,inlineImages:P,onSerialize:e=>{ye(e,Et)&&X.addIframe(e),Se(e,Et)&&J.trackLinkElement(e),ve(e)&&ee.addShadowRoot(e.shadowRoot,document)},onIframeLoad:(e,t)=>{X.attachIframe(e,t);const n=se(e);n&&Z.addWindow(n),ee.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{J.attachLinkElement(e,t)},onBlockedImageLoad:(e,t,{width:n,height:r})=>{q({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:{style:{width:`${n}px`,height:`${r}px`}}}]})},keepIframeSrcFn:D,ignoreCSSAttributes:x});if(!t)return console.warn("Failed to snapshot the document");_t({type:Oe.FullSnapshot,data:{node:t,initialOffset:he(window)}}),Ve.forEach((e=>e.unlock())),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&J.adoptStyleSheets(document.adoptedStyleSheets,Et.getId(document))};Tt=te;try{const e=[],t=e=>Ke(rt)({onMutation:B,mutationCb:q,mousemoveCb:(e,t)=>_t({type:Oe.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>_t({type:Oe.IncrementalSnapshot,data:{source:Ne.MouseInteraction,...e}}),scrollCb:Y,viewportResizeCb:e=>_t({type:Oe.IncrementalSnapshot,data:{source:Ne.ViewportResize,...e}}),inputCb:e=>_t({type:Oe.IncrementalSnapshot,data:{source:Ne.Input,...e}}),mediaInteractionCb:e=>_t({type:Oe.IncrementalSnapshot,data:{source:Ne.MediaInteraction,...e}}),styleSheetRuleCb:e=>_t({type:Oe.IncrementalSnapshot,data:{source:Ne.StyleSheetRule,...e}}),styleDeclarationCb:e=>_t({type:Oe.IncrementalSnapshot,data:{source:Ne.StyleDeclaration,...e}}),canvasMutationCb:z,fontCb:e=>_t({type:Oe.IncrementalSnapshot,data:{source:Ne.Font,...e}}),selectionCb:e=>{_t({type:Oe.IncrementalSnapshot,data:{source:Ne.Selection,...e}})},customElementCb:e=>{_t({type:Oe.IncrementalSnapshot,data:{source:Ne.CustomElement,...e}})},blockClass:s,ignoreClass:o,ignoreSelector:l,maskAllText:c,maskTextClass:u,unmaskTextClass:d,maskTextSelector:h,unmaskTextSelector:f,maskInputOptions:H,inlineStylesheet:p,sampling:I,recordDOM:C,recordCanvas:k,inlineImages:P,userTriggeredOnInput:N,collectFonts:w,doc:e,maskAttributeFn:T,maskInputFn:y,maskTextFn:S,keepIframeSrcFn:D,blockSelector:i,unblockSelector:a,slimDOMOptions:j,dataURLOptions:A,mirror:Et,iframeManager:X,stylesheetManager:J,shadowDomManager:ee,processedNodeManager:Q,canvasManager:Z,ignoreCSSAttributes:x,plugins:M?.filter((e=>e.observer))?.map((e=>({observer:e.observer,options:e.options,callback:t=>_t({type:Oe.Plugin,data:{plugin:e.name,payload:t}}
1)})))||[]},{});X.addLoadListener((n=>{try{e.push(t(n.contentDocument))}catch(e){console.warn(e)}}));const n=()=>{te(),e.push(t(document))};return"interactive"===document.readyState||"complete"===document.readyState?n():(e.push(ie("DOMContentLoaded",(()=>{_t({type:Oe.DomContentLoaded,data:{}}),"DOMContentLoaded"===O&&n()}))),e.push(ie("load",(()=>{_t({type:Oe.Load,data:{}}),"load"===O&&n()}),window))),()=>{e.forEach((e=>e())),Q.destroy(),Tt=void 0,We=void 0}}catch(e){console.warn(e)}}var St,vt;yt.mirror=Et,yt.takeFullSnapshot=function(e){if(!Tt)throw new Error("please take full snapshot after start recording");Tt(e)},(vt=St||(St={}))[vt.NotStarted=0]="NotStarted",vt[vt.Running=1]="Running",vt[vt.Stopped=2]="Stopped";function bt(e){return e>9999999999?e:1e3*e}function It(e){return e>9999999999?e/1e3:e}function At(e,t){"sentry.transaction"!==t.category&&(["ui.click","ui.input"].includes(t.category)?e.triggerUserActivity():e.checkAndHandleExpiredSession(),e.addUpdate((()=>(e.throttledAddEvent({type:Oe.Custom,timestamp:1e3*(t.timestamp||0),data:{tag:"breadcrumb",payload:r.normalize(t,10,1e3)}}),"console"===t.category))))}function Rt(e){return e.closest("button,a")||e}function Ct(e){const t=kt(e);return t&&t instanceof Element?Rt(t):t}function kt(e){return function(e){return"object"==typeof e&&!!e&&"target"in e}(e)?e.target:e}let Lt;function Ot(e){return Lt||(Lt=[],r.fill(i,"open",(function(e){return function(...t){if(Lt)try{Lt.forEach((e=>e()))}catch{}return e.apply(i,t)}}))),Lt.push(e),()=>{const t=Lt?Lt.indexOf(e):-1;t>-1&&Lt.splice(t,1)}}const Nt=new Set([Ne.Mutation,Ne.StyleSheetRule,Ne.StyleDeclaration,Ne.AdoptedStyleSheet,Ne.CanvasMutation,Ne.Selection,Ne.MediaInteraction]);class wt{constructor(e,t,n=At){this._lastMutation=0,this._lastScroll=0,this._clicks=[],this._timeout=t.timeout/1e3,this._threshold=t.threshold/1e3,this._scrollTimeout=t.scrollTimeout/1e3,this._replay=e,this._ignoreSelector=t.ignoreSelector,this._addBreadcrumbEvent=n}addListeners(){const e=Ot((()=>{this._lastMutation=Mt()}));this._teardown=()=>{e(),this._clicks=[],this._lastMutation=0,this._lastScroll=0}}removeListeners(){this._teardown&&this._teardown(),this._checkClickTimeout&&clearTimeout(this._checkClickTimeout)}handleClick(e,t){if(function(e,t){if(!Pt.includes(e.tagName))return!0;if("INPUT"===e.tagName&&!["submit","button"].includes(e.getAttribute("type")||""))return!0;if("A"===e.tagName&&(e.hasAttribute("download")||e.hasAttribute("target")&&"_self"!==e.getAttribute("target")))return!0;if(t&&e.matches(t))return!0;return!1}(t,this._ignoreSelector)||!function(e){return!(!e.data||"number"!=typeof e.data.nodeId||!e.timestamp)}(e))return;const n={timestamp:It(e.timestamp),clickBreadcrumb:e,clickCount:0,node:t};this._clicks.some((e=>e.node===n.node&&Math.abs(e.timestamp-n.timestamp)<1))||(this._clicks.push(n),1===this._clicks.length&&this._scheduleCheckClicks())}registerMutation(e=Date.now()){this._lastMutation=It(e)}registerScroll(e=Date.now()){this._lastScroll=It(e)}registerClick(e){const t=Rt(e);this._handleMultiClick(t)}_handleMultiClick(e){this._getClicks(e).forEach((e=>{e.clickCount++}))}_getClicks(e){return this._clicks.filter((t=>t.node===e))}_checkClicks(){const e=[],t=Mt();this._clicks.forEach((n=>{!n.mutationAfter&&this._lastMutation&&(n.mutationAfter=n.timestamp<=this._lastMutation?this._lastMutation-n.timestamp:void 0),!n.scrollAfter&&this._lastScroll&&(n.scrollAfter=n.timestamp<=this._lastScroll?this._lastScroll-n.timestamp:void 0),n.timestamp+this._timeout<=t&&e.push(n)}));for(const t of e){const e=this._clicks.indexOf(t);e>-1&&(this._generateBreadcrumbs(t),this._clicks.splice(e,1))}this._clicks.length&&this._scheduleCheckClicks()}_generateBreadcrumbs(e){const t=this._replay,n=e.scrollAfter&&e.scrollAfter<=this._scrollTimeout,r=e.mutationAfter&&e.mutationAfter<=this._threshold,s=!n&&!r,{clickCount:a,clickBreadcrumb:o}=e;if(s){const n=1e3*Math.min(e.mutationAfter||this._timeout,this._timeout),r=n<1e3*this._timeout?"mutation":"timeout",s={type:"default",message:o.message,timestamp:o.timestamp,category:"ui.slowClickDetected",data:{...o.data,url:i.location.href,route:t.getCurrentRoute(),timeAfterClickMs:n,endReason:r,clickCount:a||1}};this._addBreadcrumbEvent(t,s)}else if(a>1){const e={type:"default",message:o.message,timestamp:o.timestamp,category:"ui.multiClick",data:{...o.data,url:i.location.href,route:t.getCurrentRoute(),clickCount:a,metric:!0}};this._addBreadcrumbEvent(t,e)}}_scheduleCheckClicks(){this._checkClickTimeout&&clearTimeout(this._checkClickTimeout),this._checkClickTimeout=s.setTimeout((()=>this._checkClicks()),1e3)}}const Pt=["A","BUTTON","INPUT"];function Mt(){return Date.now()/1e3}function Dt(e,t){try{if(!function(e){return 3===e.type}(t))return;const{source:n}=t.data;if(Nt.has(n)&&e.registerMutation(t.timestamp),n===Ne.Scroll&&e.registerScroll(t.timestamp),function(e){return e.data.source===Ne.MouseInteraction}(t)){const{type:n,id:r}=t.data,s=yt.mirror.getNode(r);s instanceof HTMLElement&&n===we.Click&&e.registerClick(s)}}catch{}}function xt(e){return{timestamp:Date.now()/1e3,type:"default",...e}}var Ut=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(Ut||{});const Bt=new Set(["id","class","aria-label","role","name","alt","title","data-test-id","data-testid","disabled","aria-disabled","data-sentry-component"]);function Ft(e){const t={};!e["data-sentry-component"]&&e["data-sentry-element"]&&(e["data-sentry-component"]=e["data-sentry-element"]);for(const n in e)if(Bt.has(n)){let r=n;"data-testid"!==n&&"data-test-id"!==n||(r="testId"),t[r]=e[n]}return t}const $t=e=>t=>{if(!e.isEnabled())return;const n=function(e){const{target:t,message:n}=function(e){const t="click"===e.name;let n,s=null;try{s=t?Ct(e.event):kt(e.event),n=r.htmlTreeAsString(s,{maxStringLength:200})||"<unknown>"}catch{n="<unknown>"}return{target:s,message:n}}(e);return xt({category:`ui.${e.name}`,...Gt(t,n)})}(t);if(!n)return;const s="click"===t.name,i=s?t.event:void 0;var a,o,l;!(s&&e.clickDetector&&i?.target)||i.altKey||i.metaKey||i.ctrlKey||i.shiftKey||(a=e.clickDetector,o=n,l=Ct(t.event),a.handleClick(o,l)),At(e,n)};function Gt(e,t){const n=yt.mirror.getId(e),r=n&&yt.mirror.getNode(n),s=r&&yt.mirror.getMeta(r),i=s&&function(e){return e.type===Ut.Element}(s)?s:null;return{message:t,data:i?{nodeId:n,node:{id:n,tagName:i.tagName,textContent:Array.from(i.childNodes).map((e=>
1e.type===Ut.Text&&e.textContent)).filter(Boolean).map((e=>e.trim())).join(""),attributes:Ft(i.attributes)}}:{}}}function Ht(e,t){if(!e.isEnabled())return;e.updateUserActivity();const n=function(e){const{metaKey:t,shiftKey:n,ctrlKey:s,altKey:i,key:a,target:o}=e;if(!o||function(e){return"INPUT"===e.tagName||"TEXTAREA"===e.tagName||e.isContentEditable}(o)||!a)return null;const l=t||s||i,c=1===a.length;if(!l&&c)return null;const u=r.htmlTreeAsString(o,{maxStringLength:200})||"<unknown>",d=Gt(o,u);return xt({category:"ui.keyDown",message:u,data:{...d.data,metaKey:t,shiftKey:n,ctrlKey:s,altKey:i,key:a}})}(t);n&&At(e,n)}const jt={resource:function(e){const{entryType:t,initiatorType:n,name:r,responseEnd:s,startTime:i,decodedBodySize:a,encodedBodySize:o,responseStatus:l,transferSize:c}=e;if(["fetch","xmlhttprequest"].includes(n))return null;return{type:`${t}.${n}`,start:Vt(i),end:Vt(s),name:r,data:{size:c,statusCode:l,decodedBodySize:a,encodedBodySize:o}}},paint:function(e){const{duration:t,entryType:n,name:r,startTime:s}=e,i=Vt(s);return{type:n,name:r,start:i,end:i+t,data:void 0}},navigation:function(e){const{entryType:t,name:n,decodedBodySize:r,duration:s,domComplete:i,encodedBodySize:a,domContentLoadedEventStart:o,domContentLoadedEventEnd:l,domInteractive:c,loadEventStart:u,loadEventEnd:d,redirectCount:h,startTime:f,transferSize:p,type:g}=e;if(0===s)return null;return{type:`${t}.${g}`,start:Vt(f),end:Vt(i),name:n,data:{size:p,decodedBodySize:r,encodedBodySize:a,duration:s,domInteractive:c,domContentLoadedEventStart:o,domContentLoadedEventEnd:l,loadEventStart:u,loadEventEnd:d,domComplete:i,redirectCount:h}}}};function Wt(e,t){return({metric:n})=>{t.replayPerformanceEntries.push(e(n))}}function Kt(e){const t=jt[e.entryType];return t?t(e):null}function Vt(e){return((r.browserPerformanceTimeOrigin()||i.performance.timeOrigin)+e)/1e3}function qt(e){const t=e.entries[e.entries.length-1];return Xt(e,"largest-contentful-paint",t?.element?[t.element]:void 0)}function Yt(e){return void 0!==e.sources}function zt(e){const t=[],n=[];for(const r of e.entries)if(Yt(r)){const e=[];for(const t of r.sources)if(t.node){n.push(t.node);const r=yt.mirror.getId(t.node);r&&e.push(r)}t.push({value:r.value,nodeIds:e.length?e:void 0})}return Xt(e,"cumulative-layout-shift",n,t)}function Jt(e){const t=e.entries[e.entries.length-1];return Xt(e,"interaction-to-next-paint",t?.target?[t.target]:void 0)}function Xt(e,t,n,r){const s=e.value,i=e.rating,a=Vt(s);return{type:"web-vital",name:t,start:a,end:a,data:{value:s,size:s,rating:i,nodeIds:n?n.map((e=>yt.mirror.getId(e))):void 0,attributions:r}}}const Qt="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__;const Zt=["log","warn","error"],en="[Replay] ";function tn(e,t="info"){r.addBreadcrumb({category:"console",data:{logger:"replay"},level:t,message:`${en}${e}`},{level:t})}const nn=function(){let e=!1,t=!1;const n={exception:()=>{},infoTick:()=>{},setConfig:n=>{e=!!n.captureExceptions,t=!!n.traceInternals}};return Qt?(Zt.forEach((e=>{n[e]=(...n)=>{r.debug[e](en,...n),t&&tn(n.join(""),r.severityLevelFromString(e))}})),n.exception=(s,...i)=>{i.length&&n.error&&n.error(...i),r.debug.error(en,s),e?r.captureException(s,{mechanism:{handled:!0,type:"auto.function.replay.debug"}}):t&&tn(s,"error")},n.infoTick=(...e)=>{r.debug.log(en,...e),t&&setTimeout((()=>tn(e[0])),0)}):Zt.forEach((e=>{n[e]=()=>{}})),n}();class rn extends Error{constructor(){super("Event buffer exceeded maximum size of 20000000.")}}class sn{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){const t=JSON.stringify(e).length;if(this._totalSize+=t,this._totalSize>u)throw new rn;this.events.push(e)}finish(){return new Promise((e=>{const t=this.events;this.clear(),e(JSON.stringify(t))}))}clear(){this.events=[],this._totalSize=0,this.hasCheckout=!1}getEarliestTimestamp(){let e=null;for(const{timestamp:t}of this.events)(null===e||t<e)&&(e=t);return null===e?e:bt(e)}}class an{constructor(e){an.prototype.__init.call(this),this._worker=e,this._id=0,this._pending=new Map,this._worker.addEventListener("message",this._onMessage)}ensureReady(){return this._ensureReadyPromise||(this._ensureReadyPromise=new Promise(((e,t)=>{this._worker.addEventListener("message",(({data:n})=>{n.success?e():(Qt&&nn.warn("Received worker message with unsuccessful status",n),t(ne
1w Error("Received worker message with unsuccessful status")))}),{once:!0}),this._worker.addEventListener("error",(e=>{Qt&&nn.warn("Failed to load Replay compression worker",e),t(new Error(`Failed to load Replay compression worker: ${e instanceof ErrorEvent&&e.message?e.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(){Qt&&nn.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,t){const n=this._getAndIncrementId();return new Promise(((r,s)=>{this._pending.set(n,{method:e,resolve:r,reject:s});try{this._worker.postMessage({id:n,method:e,arg:t})}catch(e){this._pending.delete(n),s(e)}}))}__init(){this._onMessage=({data:e})=>{const t=e;if("number"!=typeof t.id)return;const n=this._pending.get(t.id);if(n&&n.method===t.method){if(this._pending.delete(t.id),!t.success)return Qt&&nn.error("Error in compression worker: ",t.response),void n.reject(new Error("Error in compression worker"));n.resolve(t.response)}}}_getAndIncrementId(){return this._id++}}class on{constructor(e){this._worker=new an(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){const t=bt(e.timestamp);(!this._earliestTimestamp||t<this._earliestTimestamp)&&(this._earliestTimestamp=t);const n=JSON.stringify(e);return this._totalSize+=n.length,this._totalSize>u?Promise.reject(new rn):this._sendEventToWorker(n)}finish(){return this._finishRequest()}clear(){this._earliestTimestamp=null,this._totalSize=0,this.hasCheckout=!1,this._worker.postMessage("clear").then(null,(e=>{Qt&&nn.exception(e,'Sending "clear" message to worker failed',e)}))}getEarliestTimestamp(){return this._earliestTimestamp}_sendEventToWorker(e){return this._worker.postMessage("addEvent",e)}async _finishRequest(){const e=await this._worker.postMessage("finish");return this._earliestTimestamp=null,this._totalSize=0,e}}class ln{constructor(e){this._fallback=new sn,this._compression=new on(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){return void(Qt&&nn.exception(e,"Failed to load the compression worker, falling back to simple buffer"))}await this._switchToCompressionWorker()}async _switchToCompressionWorker(){const{events:e,hasCheckout:t,waitForCheckout:n}=this._fallback,r=[];for(const t of e)r.push(this._compression.addEvent(t));this._compression.hasCheckout=t,this._compression.waitForCheckout=n,this._used=this._compression;try{await Promise.all(r),this._fallback.clear()}catch(e){Qt&&nn.exception(e,"Failed to add events when switching buffers.")}}}function cn({useCompression:e,workerUrl:t}){if(e&&window.Worker){const e=function(e){try{const t=e||function(){if("undefined"==typeof __SENTRY_EXCLUDE_REPLAY_WORKER__||!__SENTRY_EXCLUDE_REPLAY_WORKER__)return function(){const e=new Blob(['
vendor: 10,329 bytes, line 1
1var 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});
1']);return URL.createObjectURL(e)}();return""}();if(!t)return;Qt&&nn.log("Using compression worker"+(e?` from ${e}`:""));const n=new Worker(t);return new ln(n)}catch(e){Qt&&nn.exception(e,"Failed to create compression worker")}}(t);if(e)return e}return Qt&&nn.log("Using simple buffer"),new sn}function un(){try{return"sessionStorage"in i&&!!i.sessionStorage}catch{return!1}}function dn(e){!function(){if(!un())return;try{i.sessionStorage.removeItem(a)}catch{}}(),e.session=void 0}function hn(e){return void 0!==e&&Math.random()<e}function fn(e){if(un())try{i.sessionStorage.setItem(a,JSON.stringify(e))}catch{}}function pn(e){const t=Date.now();return{id:e.id||r.uuid4(),started:e.started||t,lastActivity:e.lastActivity||t,segmentId:e.segmentId||0,sampled:e.sampled,previousSessionId:e.previousSessionId,dirty:e.dirty||!1}}function gn({sessionSampleRate:e,allowBuffering:t,stickySession:n=!1},{previousSessionId:r}={}){const s=function(e,t){return hn(e)?"session":!!t&&"buffer"}(e,t),i=pn({sampled:s,previousSessionId:r});return n&&fn(i),i}function mn(e,t,n=+new Date){return null===e||void 0===t||t<0||0!==t&&e+t<=n}function _n(e,{sessionIdleExpire:t,maxReplayDuration:n}){return!!function(e,{maxReplayDuration:t,sessionIdleExpire:n,targetTime:r=Date.now()}){return mn(e.started,t,r)||mn(e.lastActivity,n,r)}(e,{sessionIdleExpire:t,maxReplayDuration:n})&&("buffer"!==e.sampled||0!==e.segmentId)}function Tn({sessionIdleExpire:e,maxReplayDuration:t,previousSessionId:n},r){const s=r.stickySession&&function(){if(!un())return null;try{const e=i.sessionStorage.getItem(a);if(!e)return null;const t=JSON.parse(e);return Qt&&nn.infoTick("Loading existing session"),pn(t)}catch{return null}}();return s?_n(s,{sessionIdleExpire:e,maxReplayDuration:t})?(Qt&&nn.infoTick("Session in sessionStorage is expired, creating new one..."),gn(r,{previousSessionId:s.id})):s:(Qt&&nn.infoTick("Creating new session"),gn(r,{previousSessionId:n}))}function En(e,t,n){return!!Sn(e,t)&&(yn(e,t,n),!0)}async function yn(e,t,n){const{eventBuffer:s}=e;if(!s||s.waitForCheckout&&!n)return null;const i="buffer"===e.recordingMode;try{n&&i&&s.clear(),n&&(s.hasCheckout=!0,s.waitForCheckout=!1);const r=function(e,t){try{if("function"==typeof t&&function(e){return e.type===Oe.Custom}(e))return t(e)}catch(e){return Qt&&nn.exception(e,"An error occurred in the `beforeAddRecordingEvent` callback, skipping the event..."),null}return e}(t,e.getOptions().beforeAddRecordingEvent);if(!r)return;return await s.addEvent(r)}catch(t){const n=t&&t instanceof rn,a=n?"eventBufferOverflow":"eventBufferError",o=r.getClient();if(o){const e=n?"buffer_overflow":"internal_sdk_error";o.recordDroppedEvent(e,"replay")}if(n&&i)return s.clear(),s.waitForCheckout=!0,null;e.handleException(t),await e.stop({reason:a})}}function Sn(e,t){if(!e.eventBuffer||e.isPaused()||!e.isEnabled())return!1;const n=bt(t.timestamp);return!(n+e.timeouts.sessionIdlePause<Date.now())&&(!(n>e.getContext().initialTimestamp+e.getOptions().maxReplayDuration)||(Qt&&nn.infoTick(`Skipping event with timestamp ${n} because it is after maxReplayDuration`),!1))}function vn(e){return!e.type}function bn(e){return"transaction"===e.type}function In(e){return"feedback"===e.type}function An(e){return(t,n)=>{if(!e.isEnabled()||!vn(t)&&!bn(t))return;const r=n.statusCode;!r||r<200||r>=300||(bn(t)?function(e,t){const n=e.getContext();t.contexts?.trace?.trace_id&&n.traceIds.size<100&&n.traceIds.add(t.contexts.trace.trace_id)}(e,t):function(e,t){const n=e.getContext();t.event_id&&n.errorIds.size<100&&n.errorIds.add(t.event_id);if("buffer"!==e.recordingMode||!t.tags?.replayId)return;const{beforeErrorSampling:r}=e.getOptions();if("function"==typeof r&&!r(t))return;s.setTimeout((async()=>{try{await e.sendBufferedReplayOrFlush()}catch(t){e.handleException(t)}}))}(e,t))}}function Rn(e){return t=>{e.isEnabled()&&vn(t)&&function(e,t){const n=t.exception?.values?.[0]?.value;if("string"!=typeof n)return;if(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)){At(e,xt({category:"replay.hydrate-error",data:{url:r.getLocationHref()}}))}}(e,t)}}function Cn(e){const t=r.getClient();t&&t.on("beforeAddBreadcrumb",(t=>function(e,t){if(!e.isEnabled()||!kn(t))return;const n=function(e){if(!kn(e)||["fetch","xhr","sentry.event","sentry.transaction"].includes(e.category)||e.category.startsWith("ui."))return null;if("console"===e.category)return function(e){const t=e.data?.arguments;if(!Array.isArray(t)||0===t.length)return xt(e);let n=!1;const s=t.map((e=>{if(!e)return e;if("string"==typeof e)return e.length>c?(n=!0,`${e.slice(0,c)}…`):e;if("object"==typeof e)try{const t=r.normalize(e,7);return JSON.stringify(t).length>c?(n=!0,`${JSON.stringify(t,null,2).slice(0,c)}…`):t}catch{}return e}));return xt({...e,data:{...e.data,arguments:s,...n?{_meta:{warnings:["CONSOLE_ARG_TRUNCATED"]}}:{}}})}(e);return xt(e)}(t);n&&At(e,n)}(e,t)))}function kn(e){return!!e.category}function Ln(){const e=r.getCurrentScope().getPropagationContext().dsc;e&&delete e.replay_id;const t=r.getActiveSpan();if(t){delete r.getDynamicSamplingContextFromSpan(t).replay_id}}function On(e){return Object.assign(((t,n)=>{if(e.session&&_n(e.session,{maxReplayDuration:e.getOptions().maxReplayDuration,sessionIdleExpire:e.timeouts.sessionIdleExpire}
1)&&Ln(),!e.isEnabled()||e.isPaused())return t;if(function(e){return"replay_event"===e.type}(t))return delete t.breadcrumbs,t;if(!vn(t)&&!bn(t)&&!In(t))return t;if(!e.checkAndHandleExpiredSession())return Ln(),t;if(In(t))return e.flush(),t.contexts.feedback.replay_id=e.getSessionId(),function(e,t){e.triggerUserActivity(),e.addUpdate((()=>!t.timestamp||(e.throttledAddEvent({type:Oe.Custom,timestamp:1e3*t.timestamp,data:{tag:"breadcrumb",payload:{timestamp:t.timestamp,type:"default",category:"sentry.feedback",data:{feedbackId:t.event_id}}}}),!1)))}(e,t),t;if(function(e,t){return!(e.type||!e.exception?.values?.length||!t.originalException?.__rrweb__)}(t,n)&&!e.getOptions()._experiments.captureExceptions)return Qt&&nn.log("Ignoring error from rrweb internals",t),null;const r=function(e,t){return"buffer"===e.recordingMode&&t.message!==o&&!(!t.exception||t.type)&&hn(e.getOptions().errorSampleRate)}(e,t);if((r||"session"===e.recordingMode)&&(t.tags={...t.tags,replayId:e.getSessionId()}),r&&"buffer"===e.recordingMode&&"buffer"===e.session?.sampled){const t=e.session;t.dirty=!0,e.getOptions().stickySession&&fn(t)}return t}),{id:"Replay"})}function Nn(e,t){return t.map((({type:t,start:n,end:r,name:s,data:i})=>{const a=e.throttledAddEvent({type:Oe.Custom,timestamp:n,data:{tag:"performanceSpan",payload:{op:t,description:s,startTimestamp:n,endTimestamp:r,data:i}}});return"string"==typeof a?Promise.resolve(null):a}))}function wn(e){return t=>{if(!e.isEnabled())return;const n=function(e){const{from:t,to:n}=e,r=Date.now()/1e3;return{type:"navigation.push",start:r,end:r,name:n,data:{previous:t}}}(t);null!==n&&(e.getContext().urls.push(n.name),e.triggerUserActivity(),e.addUpdate((()=>(Nn(e,[n]),!1))))}}function Pn(e,t){e.isEnabled()&&null!==t&&(function(e,t){return(!Qt||!e.getOptions()._experiments.traceInternals)&&r.isSentryRequestUrl(t,r.getClient())}(e,t.name)||e.addUpdate((()=>(Nn(e,[t]),!0))))}function Mn(e){if(!e)return;const t=new TextEncoder;try{if("string"==typeof e)return t.encode(e).length;if(e instanceof URLSearchParams)return t.encode(e.toString()).length;if(e instanceof FormData){const n=s.serializeFormData(e);return t.encode(n).length}if(e instanceof Blob)return e.size;if(e instanceof ArrayBuffer)return e.byteLength}catch{}}function Dn(e){if(!e)return;const t=parseInt(e,10);return isNaN(t)?void 0:t}function xn(e,t){if(!e)return{headers:{},size:void 0,_meta:{warnings:[t]}};const n={...e._meta},r=n.warnings||[];return n.warnings=[...r,t],e._meta=n,e}function Un(e,t){if(!t)return null;const{startTimestamp:n,endTimestamp:r,url:s,method:i,statusCode:a,request:o,response:l}=t;return{type:e,start:n/1e3,end:r/1e3,name:s,data:{method:i,statusCode:a,request:o,response:l}}}function Bn(e){return{headers:{},size:e,_meta:{warnings:["URL_SKIPPED"]}}}function Fn(e,t,n){if(!t&&0===Object.keys(e).length)return;if(!t)return{headers:e};if(!n)return{headers:e,size:t};const r={headers:e,size:t},{body:s,warnings:i}=function(e){if(!e||"string"!=typeof e)return{body:e};const t=e.length>l,n=function(e){const t=e[0],n=e[e.length-1];return"["===t&&"]"===n||"{"===t&&"}"===n}(e);if(t){const t=e.slice(0,l);return n?{body:t,warnings:["MAYBE_JSON_TRUNCATED"]}:{body:`${t}…`,warnings:["TEXT_TRUNCATED"]}}if(n)try{return{body:JSON.parse(e)}}catch{}return{body:e}}(n);return r.body=s,i?.length&&(r._meta={warnings:i}),r}function $n(e,t){return Object.entries(e).reduce(((n,[r,s])=>{const i=r.toLowerCase();return t.includes(i)&&e[r]&&(n[i]=s),n}),{})}function Gn(e,t){const n=function(e,t=i.document.baseURI){if(e.startsWith("http://")||e.startsWith("https://")||e.startsWith(i.location.origin))return e;const n=new URL(e,t);if(n.origin!==new URL(t).origin)return e;const r=n.href;if(!e.endsWith("/")&&r.endsWith("/"))return r.slice(0,-1);return r}(e);return r.stringMatchesSomePattern(n,t)}async function Hn(e,t,n){try{const r=await async function(e,t,n){const r=Date.now(),{startTimestamp:i=r,endTimestamp:a=r}=t,{url:o,method:l,status_code:c=0,request_body_size:u,response_body_size:d}=e.data,h=Gn(o,n.networkDetailAllowUrls)&&!Gn(o,n.networkDetailDenyUrls),f=h?function({networkCaptureBodies:e,networkRequestHeaders:t},n,r){const i=n?function(e,t){if(1===e.length&&"string"!=typeof e[0])return Wn(e[0],t);
1if(2===e.length)return Wn(e[1],t);return{}}(n,t):{};if(!e)return Fn(i,r,void 0);const a=s.getFetchRequestArgBody(n),[o,l]=s.getBodyString(a,nn),c=Fn(i,r,o);if(l)return xn(c,l);return c}(n,t.input,u):Bn(u),p=await async function(e,{networkCaptureBodies:t,networkResponseHeaders:n},r,i){if(!e&&void 0!==i)return Bn(i);const a=r?jn(r.headers,n):{};if(!r||!t&&void 0!==i)return Fn(a,i,void 0);const[o,l]=await async function(e){const t=function(e){try{return e.clone()}catch(e){Qt&&nn.exception(e,"Failed to clone response body")}}(e);if(!t)return[void 0,"BODY_PARSE_ERROR"];try{const e=await function(e){return new Promise(((t,n)=>{const r=s.setTimeout((()=>n(new Error("Timeout while trying to read response body"))),500);(async function(e){return await e.text()})(e).then((e=>t(e)),(e=>n(e))).finally((()=>clearTimeout(r)))}))}(t);return[e]}catch(e){return e instanceof Error&&e.message.indexOf("Timeout")>-1?(Qt&&nn.warn("Parsing text body from response timed out"),[void 0,"BODY_PARSE_TIMEOUT"]):(Qt&&nn.exception(e,"Failed to get text body from response"),[void 0,"BODY_PARSE_ERROR"])}}(r),c=function(e,{networkCaptureBodies:t,responseBodySize:n,captureDetails:r,headers:s}){try{const i=e?.length&&void 0===n?Mn(e):n;return r?Fn(s,i,t?e:void 0):Bn(i)}catch(e){return Qt&&nn.exception(e,"Failed to serialize response body"),Fn(s,n,void 0)}}(o,{networkCaptureBodies:t,responseBodySize:i,captureDetails:e,headers:a});if(l)return xn(c,l);return c}(h,n,t.response,d);return{startTimestamp:i,endTimestamp:a,url:o,method:l,statusCode:c,request:f,response:p}}(e,t,n),i=Un("resource.fetch",r);Pn(n.replay,i)}catch(e){Qt&&nn.exception(e,"Failed to capture fetch breadcrumb")}}function jn(e,t){const n={};return t.forEach((t=>{e.get(t)&&(n[t]=e.get(t))})),n}function Wn(e,t){if(!e)return{};const n=e.headers;return n?n instanceof Headers?jn(n,t):Array.isArray(n)?{}:$n(n,t):{}}async function Kn(e,t,n){try{const r=function(e,t,n){const r=Date.now(),{startTimestamp:i=r,endTimestamp:a=r,input:o,xhr:l}=t,{url:c,method:u,status_code:d=0,request_body_size:h,response_body_size:f}=e.data;if(!c)return null;if(!l||!Gn(c,n.networkDetailAllowUrls)||Gn(c,n.networkDetailDenyUrls)){return{startTimestamp:i,endTimestamp:a,url:c,method:u,statusCode:d,request:Bn(h),response:Bn(f)}}const p=l[s.SENTRY_XHR_DATA_KEY],g=p?$n(p.request_headers,n.networkRequestHeaders):{},m=$n(s.parseXhrResponseHeaders(l),n.networkResponseHeaders),[_,T]=n.networkCaptureBodies?s.getBodyString(o,nn):[void 0],[E,y]=n.networkCaptureBodies?function(e){const t=[];try{return[e.responseText]}catch(e){t.push(e)}try{return function(e,t){try{if("string"==typeof e)return[e];if(e instanceof Document)return[e.body.outerHTML];if("json"===t&&e&&"object"==typeof e)return[JSON.stringify(e)];if(!e)return[void 0]}catch(t){return Qt&&nn.exception(t,"Failed to serialize body",e),[void 0,"BODY_PARSE_ERROR"]}return Qt&&nn.log("Skipping network body because of body type",e),[void 0,"UNPARSEABLE_BODY_TYPE"]}(e.response,e.responseType)}catch(e){t.push(e)}return Qt&&nn.warn("Failed to get xhr response body",...t),[void 0]}(l):[void 0],S=Fn(g,h,_),v=Fn(m,f,E);return{startTimestamp:i,endTimestamp:a,url:c,method:u,statusCode:d,request:T?xn(S,T):S,response:y?xn(v,y):v}}(e,t,n),i=Un("resource.xhr",r);Pn(n.replay,i)}catch(e){Qt&&nn.exception(e,"Failed to capture xhr breadcrumb")}}function Vn(e,t){const{xhr:n,input:r}=t;if(!n)return;const s=Mn(r),i=n.getResponseHeader("content-length")?Dn(n.getResponseHeader("content-length")):function(e,t){try{return Mn("json"===t&&e&&"object"==typeof e?JSON.stringify(e):e)}catch{return}}(n.response,n.responseType);void 0!==s&&(e.data.request_body_size=s),void 0!==i&&(e.data.response_body_size=i)}function qn(e){const t=r.getClient();try{const{networkDetailAllowUrls:n,networkDetailDenyUrls:r,networkCaptureBodies:i,networkRequestHeaders:a,networkResponseHeaders:o}=e.getOptions(),l={replay:e,networkDetailAllowUrls:n,networkDetailDenyUrls:r,networkCaptureBodies:i,networkRequestHeaders:a,networkResponseHeaders:o};t&&t.on("beforeAddBreadcrumb",((e,t)=>function(e,t,n){if(!t.data)return;try{(function(e){return"xhr"===e.category})(t)&&function(e){return e?.xhr}(n)&&(Vn(t,n),Kn(t,n,e)),function(e){return"fetch"===e.category}(t)&&function(e){return void 0!==e?.input}(n)&&(!function(e,t){const{input:n,response:r}=t,i=Mn(n?s.getFetchRequestArgBody(n):void 0),a=r?Dn(r.headers.get("content-length")):void 0;void 0!==i&&(e.data.request_body_size=i),void 0!==a&&(e.data.response_body_size=a
1)}(t,n),Hn(t,n,e))}catch(e){Qt&&nn.exception(e,"Error when enriching network breadcrumb")}}(l,e,t)))}catch{}}function Yn(e){const{jsHeapSizeLimit:t,totalJSHeapSize:n,usedJSHeapSize:r}=e,s=Date.now()/1e3;return{type:"memory",name:"memory",start:s,end:s,data:{memory:{jsHeapSizeLimit:t,totalJSHeapSize:n,usedJSHeapSize:r}}}}const zn=r.GLOBAL_OBJ.navigator;function Jn(e){let t=!1;return(n,r)=>{if(!e.checkAndHandleExpiredSession())return void(Qt&&nn.warn("Received replay event after session expired."));const s=r||!t;t=!0,function(e){const t=e.data;if(!(e.type===Oe.IncrementalSnapshot&&t&&"object"==typeof t&&"source"in t&&t.source===Ne.Mutation&&"attributes"in t&&Array.isArray(t.attributes)))return;for(const e of t.attributes){const t=yt.mirror.getNode(e.id),n=t&&yt.mirror.getMeta(t);if(n?.type===Ut.Element)for(const[t,r]of Object.entries(e.attributes))null===r?delete n.attributes[t]:n.attributes[t]=r}}(n),e.clickDetector&&Dt(e.clickDetector,n),e.addUpdate((()=>{if("buffer"===e.recordingMode&&s&&e.setInitialState(),!En(e,n,s))return!0;if(!s)return!1;const t=e.session;if(function(e,t){if(!t||0!==e.session?.segmentId)return;En(e,function(e){const t=e.getOptions();return{type:Oe.Custom,timestamp:Date.now(),data:{tag:"options",payload:{shouldRecordCanvas:e.isRecordingCanvas(),sessionSampleRate:t.sessionSampleRate,errorSampleRate:t.errorSampleRate,useCompressionOption:t.useCompression,blockAllMedia:t.blockAllMedia,maskAllText:t.maskAllText,maskAllInputs:t.maskAllInputs,useCompression:!!e.eventBuffer&&"worker"===e.eventBuffer.type,networkDetailHasUrls:t.networkDetailAllowUrls.length>0,networkCaptureBodies:t.networkCaptureBodies,networkRequestHasHeaders:t.networkRequestHeaders.length>0,networkResponseHasHeaders:t.networkResponseHeaders.length>0}}}}(e),!1)}(e,s),"buffer"===e.recordingMode&&t&&e.eventBuffer&&!t.dirty){const n=e.eventBuffer.getEarliestTimestamp();n&&(Qt&&nn.log(`Updating session start time to earliest event in buffer to ${new Date(n)}`),t.started=n,e.getOptions().stickySession&&fn(t))}return t?.previousSessionId||"session"===e.recordingMode&&e.flush(),!0}))}}async function Xn({recordingData:e,replayId:t,segmentId:n,eventContext:s,timestamp:i,session:a}){const l=function({recordingData:e,headers:t}){let n;const r=`${JSON.stringify(t)}\n`;if("string"==typeof e)n=`${r}${e}`;else{const t=(new TextEncoder).encode(r);n=new Uint8Array(t.length+e.length),n.set(t),n.set(e,t.length)}return n}({recordingData:e,headers:{segment_id:n}}),{urls:c,errorIds:u,traceIds:d,initialTimestamp:h}=s,f=r.getClient(),p=r.getCurrentScope(),g=f?.getTransport(),m=f?.getDsn();if(!(f&&g&&m&&a.sampled))return Promise.resolve({});const _={type:"replay_event",replay_start_timestamp:h/1e3,timestamp:i/1e3,error_ids:u,trace_ids:d,urls:c,replay_id:t,segment_id:n,replay_type:a.sampled},T=await async function({client:e,scope:t,replayId:n,event:s}){const i={event_id:n,integrations:"object"!=typeof e._integrations||null===e._integrations||Array.isArray(e._integrations)?void 0:Object.keys(e._integrations)};e.emit("preprocessEvent",s,i);const a=await r.prepareEvent(e.getOptions(),s,i,t,e,r.getIsolationScope());if(!a)return null;e.emit("postprocessEvent",a,i),a.platform=a.platform||"javascript";const o=e.getSdkMetadata(),{name:l,version:c,settings:u}=o?.sdk||{};return a.sdk={...a.sdk,name:l||"sentry.javascript.unknown",version:c||"0.0.0",settings:u},a}({scope:p,client:f,replayId:t,event:_});if(!T)return f.recordDroppedEvent("event_processor","replay"),Qt&&nn.log("An event processor returned `null`, will not send event."),Promise.resolve({});delete T.sdkProcessingMetadata;const E=function(e,t,n,s){return r.createEnvelope(r.createEventEnvelopeHeaders(e,r.getSdkMetadataForEnvelopeHeader(e),s,n),[[{type:"replay_event"},e],[{type:"replay_recording",length:"string"==typeof t?(new TextEncoder).encode(t).length:t.length},t]])}(T,l,m,f.getOptions().tunnel);let y;try{y=await g.send(E)}catch(e){const t=new Error(o);try{t.cause=e}catch{}throw t}const S=r.updateRateLimits({},y);if(r.isRateLimited(S,"replay"))throw new Zn(S);if("number"==typeof y.statusCode&&(y.statusCode<200||y.statusCode>=300))throw new Qn(y.statusCode);return y}
1class Qn extends Error{constructor(e){super(`Transport returned status code ${e}`)}}class Zn extends Error{constructor(e){super("Rate limit hit"),this.rateLimits=e}}class er extends Error{constructor(){super("Session is too long, not sending replay")}}async function tr(e,t={count:0,interval:5e3}){const{recordingData:n,onError:i}=e;if(n.length)try{return await Xn(e),!0}catch(n){if(n instanceof Qn||n instanceof Zn)throw n;if(r.setContext("Replays",{_retryCount:t.count}),i&&i(n),t.count>=3){const e=new Error(`${o} - max retries exceeded`);try{e.cause=n}catch{}throw e}return t.interval*=++t.count,new Promise(((n,r)=>{s.setTimeout((async()=>{try{await tr(e,t),n(!0)}catch(e){r(e)}}),t.interval)}))}}const nr="__THROTTLED";function rr(e,t,n){const r=new Map;let s=!1;return(...i)=>{const a=Math.floor(Date.now()/1e3);if((e=>{const t=e-n;r.forEach(((e,n)=>{n<t&&r.delete(n)}))})(a),[...r.values()].reduce(((e,t)=>e+t),0)>=t){const e=s;return s=!0,e?"__SKIPPED":nr}s=!1;const o=r.get(a)||0;return r.set(a,o+1),e(...i)}}class sr{constructor({options:e,recordingOptions:t}){this.eventBuffer=null,this.performanceEntries=[],this.replayPerformanceEntries=[],this.recordingMode="session",this.timeouts={sessionIdlePause:3e5,sessionIdleExpire:9e5},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=t,this._options=e,this._debouncedFlush=function(e,t,n){return r.debounce(e,t,{...n,setTimeoutImpl:s.setTimeout})}((()=>this._flush()),this._options.flushMinDelay,{maxWait:this._options.flushMaxDelay}),this._throttledAddEvent=rr(((e,t)=>function(e,t,n){return Sn(e,t)?yn(e,t,n):Promise.resolve(null)}(this,e,t)),300,5);const{slowClickTimeout:n,slowClickIgnoreSelectors:a}=this.getOptions(),o=n?{threshold:Math.min(3e3,n),timeout:n,scrollTimeout:300,ignoreSelector:a?a.join(","):""}:void 0;if(o&&(this.clickDetector=new wt(this,o)),Qt){const t=e._experiments;nn.setConfig({captureExceptions:!!t.captureExceptions,traceInternals:!!t.traceInternals})}this._handleVisibilityChange=()=>{"visible"===i.document.visibilityState?this._doChangeToForegroundTasks():this._doChangeToBackgroundTasks()},this._handleWindowBlur=()=>{const e=xt({category:"ui.blur"});this._doChangeToBackgroundTasks(e)},this._handleWindowFocus=()=>{const e=xt({category:"ui.focus"});this._doChangeToForegroundTasks(e)},this._handleKeyboardEvent=e=>{Ht(this,e)}}getContext(){return this._context}isEnabled(){return this._isEnabled}isPaused(){return this._isPaused}isRecordingCanvas(){return Boolean(this._canvas)}getOptions(){return this._options}handleException(e){Qt&&nn.exception(e),this._options.onError&&this._options.onError(e)}initializeSampling(e){const{errorSampleRate:t,sessionSampleRate:n}=this._options,r=t<=0&&n<=0;this._requiresManualStart=r,r||(this._initializeSessionForSampling(e),this.session?!1!==this.session.sampled&&(this.recordingMode="buffer"===this.session.sampled&&0===this.session.segmentId?"buffer":"session",Qt&&nn.infoTick(`Starting replay in ${this.recordingMode} mode`),this._initializeRecording()):Qt&&nn.exception(new Error("Unable to initialize and create session")))}start(){if(this._isEnabled&&"session"===this.recordingMode)return void(Qt&&nn.log("Recording is already in progress"));if(this._isEnabled&&"buffer"===this.recordingMode)return void(Qt&&nn.log("Buffering is in progress, call `flush()` to save the replay"));Qt&&nn.infoTick("Starting replay in session mode"),this._updateUserActivity();const e=Tn({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)return void(Qt&&nn.log("Buffering is in progress, call `flush()` to save the replay"));Qt&&nn.infoTick("Starting replay in buffer mode");const e=Tn({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{const e=this._canvas;this._stopRecording=yt({...this._recordingOptions,..."buffer"===this.recordingMode?{checkoutEveryNms:6e4}:this._options._experiments.continuousCheckout&&{checkoutEveryNms:Math.max(36e4,this._options._experiments.continuousCheckout)},emit:Jn(this),.../iPhone|iPad|iPod/i.test(zn?.userAgent??"")||/Macintosh/i.test(zn?.userAgent??"")&&zn?.maxTouchPoints&&zn?.maxTouchPoints>1?{sampling:{mousemove:!1}}:{},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:t}={}){if(!this._isEnabled)return;this._isEnabled=!1,this.recordingMode="buffer";const n=t??"manual";r.getClient()?.emit("replayEnd",{sessionId:this.session?.id,reason:n});try{Qt&&nn.log(`Stopping Replay triggered by ${n}`),Ln(),this._removeListeners(),this.stopRecording(),this._debouncedFlush.cancel(),e&&await this._flush({force:!0}),this.eventBuffer?.destroy(),this.eventBuffer=null,dn(this)}catch(e){this.handleException(e)}}pause(){this._isPaused||(this._isPaused=!0,this.stopRecording(),Qt&&nn.log("Pausing replay"))}resume(){this._isPaused&&this._checkSession()&&(this._isPaused=!1,this.startRecording(),Qt&&nn.log("Resuming replay"))}async sendBufferedReplayOrFlush({continueRecording:e=!0}={}){if("session"===this.recordingMode)return this.flushImmediate();const t=Date.now();Qt&&nn.log("Converting buffer to session"),await this.flushImmediate();const n=this.stopRecording();e&&n&&"session"!==this.recordingMode&&(this.recordingMode="session",this.session&&(this.session.dirty=!1,this._updateUserActivity(t),this._updateSessionActivity(t),this._maybeSaveSession()),this.startRecording())}addUpdate(e){const t=e();"buffer"!==this.recordingMode&&this._isEnabled&&!0!==t&&this._debouncedFlush()}triggerUserActivity(){if(this._updateUserActivity(),this._stopRecording)this.checkAndHandleExpiredSession(),this._updateSessionActivity();else{if(!this._checkSession())return;this.resume()}}updateUserActivity(){this._updateUserActivity(),this._updateSessionActivity()}conditionalFlush(){return"buffer"===this.recordingMode?Promise.resolve():this.flushImmediate()}flush(){return this._debouncedFlush()}flushImmediate(){return this._debouncedFlush(),this._debouncedFlush.flush()}cancelFlush(){this._debouncedFlush.cancel()}getSessionId(e){if(!e||!1!==this.session?.sampled)return this.session?.id}
1checkAndHandleExpiredSession(){if(!this._lastActivity||!mn(this._lastActivity,this.timeouts.sessionIdlePause)||"session"!==this.session?.sampled)return!!this._checkSession();this.pause()}setInitialState(){const e=`${i.location.pathname}${i.location.hash}${i.location.search}`,t=`${i.location.origin}${e}`;this.performanceEntries=[],this.replayPerformanceEntries=[],this._clearContext(),this._context.initialUrl=t,this._context.initialTimestamp=Date.now(),this._context.urls.push(t)}throttledAddEvent(e,t){const n=this._throttledAddEvent(e,t);if(n===nr){const e=xt({category:"replay.throttled"});this.addUpdate((()=>!En(this,{type:5,timestamp:e.timestamp||0,data:{tag:"breadcrumb",payload:e,metric:!0}})))}return n}getCurrentRoute(){const e=this.lastActiveSpan||r.getActiveSpan(),t=e&&r.getRootSpan(e),n=(t&&r.spanToJSON(t).data||{})[r.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE];if(t&&n&&["route","custom"].includes(n))return r.spanToJSON(t).description}_initializeRecording(){this.setInitialState(),this._updateSessionActivity(),this.eventBuffer=cn({useCompression:this._options.useCompression,workerUrl:this._options.workerUrl}),this._removeListeners(),this._addListeners(),this._isEnabled=!0,this._isPaused=!1,this.session&&r.getClient()?.emit("replayStart",{sessionId:this.session.id,recordingMode:this.recordingMode}),this.startRecording(),"session"===this.recordingMode&&this.session&&function(e){const t=r.getCurrentScope().getPropagationContext().dsc;t&&(t.replay_id=e);const n=r.getActiveSpan();n&&(r.getDynamicSamplingContextFromSpan(n).replay_id=e)}(this.session.id)}_initializeSessionForSampling(e){const t=this._options.errorSampleRate>0,n=Tn({sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration,previousSessionId:e},{stickySession:this._options.stickySession,sessionSampleRate:this._options.sessionSampleRate,allowBuffering:t});this.session=n}_checkSession(){if(!this.session)return!1;const e=this.session;return!_n(e,{sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration})||(this._refreshSession(e),!1)}async _refreshSession(e){this._isEnabled&&(await this.stop({reason:"sessionExpired"}),this.initializeSampling(e.id))}_addListeners(){try{i.document.addEventListener("visibilitychange",this._handleVisibilityChange),i.addEventListener("blur",this._handleWindowBlur),i.addEventListener("focus",this._handleWindowFocus),i.addEventListener("keydown",this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.addListeners(),this._hasInitializedCoreListeners||(!function(e){const t=r.getClient();s.addClickKeypressInstrumentationHandler($t(e)),s.addHistoryInstrumentationHandler(wn(e)),Cn(e),qn(e);const n=On(e);r.addEventProcessor(n),t&&(t.on("beforeSendEvent",Rn(e)),t.on("afterSendEvent",An(e)),t.on("createDsc",(t=>{const n=e.getSessionId();n&&e.isEnabled()&&"session"===e.recordingMode&&e.checkAndHandleExpiredSession()&&(t.replay_id=n)})),t.on("spanStart",(t=>{e.lastActiveSpan=t})),t.on("spanEnd",(t=>{e.lastActiveSpan=t})),t.on("beforeSendFeedback",(async(t,n)=>{const r=e.getSessionId();n?.includeReplay&&e.isEnabled()&&r&&t.contexts?.feedback&&("api"===t.contexts.feedback.source&&await e.sendBufferedReplayOrFlush(),t.contexts.feedback.replay_id=r)})),t.on("openFeedbackWidget",(async()=>{await e.sendBufferedReplayOrFlush()})))}(this),this._hasInitializedCoreListeners=!0)}catch(e){this.handleException(e)}this._performanceCleanupCallback=function(e){function t(t){e.performanceEntries.includes(t)||e.performanceEntries.push(t)}function n({entries:e}){e.forEach(t)}const r=[];return["navigation","paint","resource"].forEach((e=>{r.push(s.addPerformanceInstrumentationHandler(e,n))})),r.push(s.addLcpInstrumentationHandler(Wt(qt,e)),s.addClsInstrumentationHandler(Wt(zt,e)),s.addInpInstrumentationHandler(Wt(Jt,e))),()=>{r.forEach((e=>e()))}}(this)}_removeListeners(){try{i.document.removeEventListener("visibilitychange",this._handleVisibilityChange),i.removeEventListener("blur",this._handleWindowBlur),i.removeEventListener("focus",this._handleWindowFocus),i.removeEventListener("keydown",this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.removeListeners(),this._performanceCleanupCallback&&this._performanceCleanupCallback()}catch(e){this.handleException(e)}}
1_doChangeToBackgroundTasks(e){if(!this.session)return;_n(this.session,{maxReplayDuration:this._options.maxReplayDuration,sessionIdleExpire:this.timeouts.sessionIdleExpire})?Ln():(e&&this._createCustomBreadcrumb(e),this.conditionalFlush())}_doChangeToForegroundTasks(e){if(!this.session)return;this.checkAndHandleExpiredSession()?e&&this._createCustomBreadcrumb(e):Qt&&nn.log("Document has become active, but session has expired")}_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:Oe.Custom,timestamp:e.timestamp||0,data:{tag:"breadcrumb",payload:e}})}))}_addPerformanceEntries(){let e=(t=this.performanceEntries,t.map(Kt).filter(Boolean)).concat(this.replayPerformanceEntries);var t;if(this.performanceEntries=[],this.replayPerformanceEntries=[],this._requiresManualStart){const t=this._context.initialTimestamp/1e3;e=e.filter((e=>e.start>=t))}return Promise.all(Nn(this,e))}_clearContext(){this._context.errorIds.clear(),this._context.traceIds.clear(),this._context.urls=[]}_updateInitialTimestampFromEventBuffer(){const{session:e,eventBuffer:t}=this;if(!e||!t||this._requiresManualStart)return;if(e.segmentId)return;const n=t.getEarliestTimestamp();n&&n<this._context.initialTimestamp&&(this._context.initialTimestamp=n)}_popEventContext(){const 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(){const e=this.getSessionId();if(this.session&&this.eventBuffer&&e){if(await this._addPerformanceEntries(),this.eventBuffer?.hasEvents&&(await async function(e){try{return Promise.all(Nn(e,[Yn(i.performance.memory)]))}catch{return[]}}(this),this.eventBuffer&&e===this.getSessionId()))try{this._updateInitialTimestampFromEventBuffer();const t=Date.now();if(t-this._context.initialTimestamp>this._options.maxReplayDuration+3e4)throw new er;const n=this._popEventContext(),r=this.session.segmentId++;this._maybeSaveSession();const s=await this.eventBuffer.finish();await tr({replayId:e,recordingData:s,segmentId:r,eventContext:n,session:this.session,timestamp:t,onError:e=>this.handleException(e)})}catch(e){this.handleException(e),this.stop({reason:"sendError"});const t=r.getClient();if(t){let n;n=e instanceof Zn?"ratelimit_backoff":e instanceof er?"invalid":"send_error",t.recordDroppedEvent(n,"replay")}}}else Qt&&nn.error("No session or eventBuffer found to flush.")}async _flush({force:e=!1}={}){if(!this._isEnabled&&!e)return;if(!this.checkAndHandleExpiredSession())return void(Qt&&nn.error("Attempting to finish replay event after session expired."));if(!this.session)return;const t=this.session.started,n=Date.now()-t;this._debouncedFlush.cancel();const r=n<this._options.minReplayDuration,s=n>this._options.maxReplayDuration+5e3;if(r||s)return Qt&&nn.log(`Session duration (${Math.floor(n/1e3)}s) is too ${r?"short":"long"}, not sending replay.`),void(r&&this._debouncedFlush());const i=this.eventBuffer;i&&0===this.session.segmentId&&!i.hasCheckout&&Qt&&nn.log("Flushing initial segment without checkout.");const a=!!this._flushLock;this._flushLock||(this._flushLock=this._runFlush());try{await this._flushLock}catch(e){this.handleException(e)}finally{this._flushLock=void 0,a&&this._debouncedFlush()}}_maybeSaveSession(){this.session&&this._options.stickySession&&fn(this.session)}_onMutationHandler(e){const{ignoreMutations:t}=this._options._experiments;if(t?.length&&e.some((e=>{const n=function(e){if(!e)return null;try{return e.nodeType===e.ELEMENT_NODE?e:e.parentElement}catch{return null}}(e.target),r=t.join(",");return n?.matches(r)})))return!1;const n=e.length,r=this._options.mutationLimit,s=r&&n>r;if(n>this._options.mutationBreadcrumbLimit||s){const e=xt({category:"replay.mutations",data:{count:n,limit:s}});this._createCustomBreadcrumb(e)}return!s||(this.stop({reason:"mutationLimit",forceFlush:"session"===this.recordingMode}),!1)}}function ir(e,t){return[...e,...t].join(",")}const ar='img,image,svg,video,object,picture,embed,map,audio,link[rel="icon"],link[rel="apple-touch-icon"]',or=["content-length","content-type","accept"],lr=Symbol.for("sentry__originalRequestBody");let cr=!1,ur=!1;class dr{constructor({flushMinDelay:e=5e3,flushMaxDelay:t=5500,minReplayDuration:n=4999,maxReplayDuration:s=36e5,stickySession:i=!0,useCompression:a=!0,workerUrl:o,_experiments:l={},maskAllText:c=!0,maskAllInputs:u=!0,blockAllMedia:h=!0,mutationBreadcrumbLimit:f=750,mutationLimit:p=1e4,slowClickTimeout:g=7e3,slowClickIgnoreSelectors:m=[],networkDetailAllowUrls:_=[],networkDetailDenyUrls:T=[],networkCaptureBodies:E=!0,networkRequestHeaders:y=[],networkResponseHeaders:S=[],mask:v=[],maskAttributes:b=["title","placeholder","aria-label"],unmask:I=[],block:A=[],unblock:R=[],ignore:C=[],maskFn:k,beforeAddRecordingEvent:L,beforeErrorSampling:O,onError:N,attachRawBodyFromRequest:w=!1}={}){this.name="Replay";const P=function({mask:e,unmask:t,block:n,unblock:r,ignore:s}){return{maskTextSelector:ir(e,[".sentry-mask","[data-sentry-mask]"]),unmaskTextSelector:ir(t,[]),blockSelector:ir(n,[".sentry-block","[data-sentry-block]","base","iframe[srcdoc]:not
1([src])"]),unblockSelector:ir(r,[]),ignoreSelector:ir(s,[".sentry-ignore","[data-sentry-ignore]",'input[type="file"]'])}}({mask:v,unmask:I,block:A,unblock:R,ignore:C});if(this._recordingOptions={maskAllInputs:u,maskAllText:c,maskInputOptions:{password:!0},maskTextFn:k,maskInputFn:k,maskAttributeFn:(e,t,n)=>function({el:e,key:t,maskAttributes:n,maskAllText:r,privacyOptions:s,value:i}){if(s.unmaskTextSelector&&e.matches(s.unmaskTextSelector))return i;const a=n.includes(t),o=r&&"value"===t&&"INPUT"===e.tagName&&["submit","button"].includes(e.getAttribute("type")||"");return a||o?i.replace(/[\S]/g,"*"):i}({maskAttributes:b,maskAllText:c,privacyOptions:P,key:e,value:t,el:n}),...P,slimDOMOptions:"all",inlineStylesheet:!0,inlineImages:!1,collectFonts:!0,errorHandler:e=>{try{e.__rrweb__=!0}catch{}},recordCrossOriginIframes:Boolean(l.recordCrossOriginIframes)},this._initialOptions={flushMinDelay:e,flushMaxDelay:t,minReplayDuration:Math.min(n,5e4),maxReplayDuration:Math.min(s,d),stickySession:i,useCompression:a,workerUrl:o,blockAllMedia:h,maskAllInputs:u,maskAllText:c,mutationBreadcrumbLimit:f,mutationLimit:p,slowClickTimeout:g,slowClickIgnoreSelectors:m,networkDetailAllowUrls:_,networkDetailDenyUrls:T,networkCaptureBodies:E,networkRequestHeaders:hr(y),networkResponseHeaders:hr(S),beforeAddRecordingEvent:L,beforeErrorSampling:O,onError:N,attachRawBodyFromRequest:w,_experiments:l},this._initialOptions.blockAllMedia&&(this._recordingOptions.blockSelector=this._recordingOptions.blockSelector?`${this._recordingOptions.blockSelector},${ar}`:ar,this._recordingOptions.ignoreCSSAttributes=new Set(["background-image"])),this._isInitialized&&r.isBrowser())throw new Error("Multiple Sentry Session Replay instances are not supported");this._isInitialized=!0}get _isInitialized(){return cr}set _isInitialized(e){cr=e}afterAllSetup(e){r.isBrowser()&&!this._replay&&(this._initialOptions.attachRawBodyFromRequest&&function(){if("undefined"==typeof Request||ur)return;const e=Request;try{const t=function(t,n){const r=new e(t,n);return null!=n?.body&&(r[lr]=n.body),r};t.prototype=e.prototype,r.GLOBAL_OBJ.Request=t,ur=!0}catch{}}(),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:"session"===this._replay.recordingMode,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}_initialize(e){this._replay&&(this._maybeLoadFromReplayCanvasIntegration(e),this._replay.initializeSampling())}_setup(e){const t=function(e,t){const n=t.getOptions(),s={sessionSampleRate:0,errorSampleRate:0,...e},i=r.parseSampleRate(n.replaysSessionSampleRate),a=r.parseSampleRate(n.replaysOnErrorSampleRate);null==i&&null==a&&r.consoleSandbox((()=>{console.warn("Replay is disabled because neither `replaysSessionSampleRate` nor `replaysOnErrorSampleRate` are set.")}));null!=i&&(s.sessionSampleRate=i);null!=a&&(s.errorSampleRate=a);return s}(this._initialOptions,e);this._replay=new sr({options:t,recordingOptions:this._recordingOptions})}_maybeLoadFromReplayCanvasIntegration(e){try{const t=e.getIntegrationByName("ReplayCanvas");if(!t)return;this._replay._canvas=t.getOptions()}catch{}}}function hr(e){return[...or,...e.map((e=>e.toLowerCase()))]}t.getReplay=function(){const e=r.getClient();return e?.getIntegrationByName("Replay")},t.replayIntegration=e=>new dr(e)},44186(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(63020),s=n(80866),i=n(44572);class a extends r.Client{constructor(e){const t=o(e),n=i.WINDOW.SENTRY_SDK_SOURCE||r.getSDKSource();r.applySdkMetadata(t,"browser",["browser"],n),t._metadata?.sdk&&(t._metadata.sdk.settings={infer_ip:t.sendDefaultPii?"auto":"never",...t._metadata.sdk.settings}),super(t);const{sendDefaultPii:s,sendClientReports:a,enableLogs:l,_experiments:c,enableMetrics:u}=this._options,d=u??c?.enableMetrics??!0;i.WINDOW.document&&(a||l||d)&&i.WINDOW.document.addEventListener("visibilitychange",(()=>{"hidden"===i.WINDOW.document.visibilityState&&(a&&this._flushOutcomes(),l&&r._INTERNAL_flushLogsBuffer(this),d&&r._INTERNAL_flushMetricsBuffer(this))})),s&&this.on("beforeSendSession",r.addAutoIpAddressToSession)}eventFromException(e,t){return s.eventFromException(this._options.stackParser,e,t,this._options.attachStacktrace)}eventFromMessage(e,t="info",n){return s.eventFromMessage(this._options.stackParser,e,t,n,this._options.attachStacktrace)}_prepareEvent(e,t,n,r){return e.platform=e.platform||"javascript",super._prepareEvent(e,t,n,r)}}function o(e){return{release:"string"==typeof __SENTRY_RELEASE__?__SENTRY_RELEASE__:i.WINDOW.SENTRY_RELEASE?.id,sendClientReports:!0,parentSpanIsAlwaysRootSpan:!0,...e}}t.BrowserClient=a,t.applyDefaultOptions=o},43471(e,t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const n="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__;t.DEBUG_BUILD=n},60520(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(63020);t.diagnoseSdkConnectivity=async function(){const e=r.getClient();if(!e)return"no-client-active";if(!e.getDsn())return"no-dsn-configured";const t=e.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 r.suppressTracing((()=>fetch(t,{body:"{}",method:"POST",mode:"cors",credentials:"omit"})))}catch{return"sentry-unreachable"}}},80866(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(63020);function s(e,t){const n=o(e,t),r={type:u(t),value:d(t)};return n.length&&(r.stacktrace={frames:n}),void 0===r.type&&""===r.value&&(r.value="Unrecoverable error caught"),r}function i(e,t,n,i){const a=r.getClient(),l=a?.getOptions().normalizeDepth,c=(u=t,Object.values(u).find((e=>e instanceof Error)));var u;const d={__serialized__:r.normalizeToSize(t,l)};if(c)return{exception:{values:[s(e,c)]},extra:d};const h={exception:{values:[{type:r.isEvent(t)?t.constructor.name:i?"UnhandledRejection":"Error",value:p(t,{isUnhandledRejection:i})}]},extra:d};if(n){const t=o(e,n);t.length&&(h.exception.values[0].stacktrace={frames:t})}return h}function a(e,t){return{exception:{values:[s(e,t)]}}}function o(e,t){const n=t.stacktrace||t.stack||"",r=function(e){if(e&&l.test(e.message))return 1;return 0}(t),s=function(e){if("number"==typeof e.framesToPop)return e.framesToPop;return 0}(t);try{return e(n,r,s)}catch{}return[]}const l=/Minified React error #\d+;/i;function c(e){return"undefined"!=typeof WebAssembly&&void 0!==WebAssembly.Exception&&e instanceof WebAssembly.Exception}function u(e){const t=e?.name;if(!t&&c(e)){return e.message&&Array.isArray(e.message)&&2==e.message.length?e.message[0]:"WebAssembly.Exception"}return t}function d(e){const t=e?.message;return c(e)?Array.isArray(e.message)&&2==e.message.length?e.message[1]:"wasm exception":t?t.error&&"string"==typeof t.error.message?r._INTERNAL_enhanceErrorWithSentryInfo(t.error):r._INT
1ERNAL_enhanceErrorWithSentryInfo(e):"No error message"}function h(e,t,n,s,o){let l;if(r.isErrorEvent(t)&&t.error){return a(e,t.error)}if(r.isDOMError(t)||r.isDOMException(t)){const i=t;if("stack"in t)l=a(e,t);else{const t=i.name||(r.isDOMError(i)?"DOMError":"DOMException"),a=i.message?`${t}: ${i.message}`:t;l=f(e,a,n,s),r.addExceptionTypeValue(l,a)}return"code"in i&&(l.tags={...l.tags,"DOMException.code":`${i.code}`}),l}if(r.isError(t))return a(e,t);if(r.isPlainObject(t)||r.isEvent(t)){return l=i(e,t,n,o),r.addExceptionMechanism(l,{synthetic:!0}),l}return l=f(e,t,n,s),r.addExceptionTypeValue(l,`${t}`,void 0),r.addExceptionMechanism(l,{synthetic:!0}),l}function f(e,t,n,s){const i={};if(s&&n){const s=o(e,n);s.length&&(i.exception={values:[{value:t,stacktrace:{frames:s}}]}),r.addExceptionMechanism(i,{synthetic:!0})}if(r.isParameterizedString(t)){const{__sentry_template_string__:e,__sentry_template_values__:n}=t;return i.logentry={message:e,params:n},i}return i.message=t,i}function p(e,{isUnhandledRejection:t}){const n=r.extractExceptionKeysForMessage(e),s=t?"promise rejection":"exception";if(r.isErrorEvent(e))return`Event \`ErrorEvent\` captured as ${s} with message \`${e.message}\``;if(r.isEvent(e)){return`Event \`${function(e){try{const t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{}}(e)}\` (type=${e.type}) captured as ${s}`}return`Object captured as ${s} with keys: ${n}`}t.eventFromException=function(e,t,n,s){const i=h(e,t,n?.syntheticException||void 0,s);return r.addExceptionMechanism(i),i.level="error",n?.event_id&&(i.event_id=n.event_id),r.resolvedSyncPromise(i)},t.eventFromMessage=function(e,t,n="info",s,i){const a=f(e,t,s?.syntheticException||void 0,i);return a.level=n,s?.event_id&&(a.event_id=s.event_id),r.resolvedSyncPromise(a)},t.eventFromUnknownInput=h,t.exceptionFromError=s,t.extractMessage=d,t.extractType=u},82696(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(66532),s=n(21555),i=r.buildFeedbackIntegration({lazyLoadIntegration:s.lazyLoadIntegration});t.feedbackAsyncIntegration=i},15801(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(66532),s=r.buildFeedbackIntegration({getModalIntegration:()=>r.feedbackModalIntegration,getScreenshotIntegration:()=>r.feedbackScreenshotIntegration});t.feedbackSyncIntegration=s},44572(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(63020),s=r.GLOBAL_OBJ;let i=0;function a(){i++,setTimeout((()=>{i--}))}t.WINDOW=s,t.getHttpRequestData=function(){const e=r.getLocationHref(),{referrer:t}=s.document||{},{userAgent:n}=s.navigator||{};return{url:e,headers:{...t&&{Referer:t},...n&&{"User-Agent":n}}}},t.ignoreNextOnError=a,t.shouldIgnoreOnError=function(){return i>0},t.wrap=function e(t,n={}){if(!function(e){return"function"==typeof e}(t))return t;try{const e=t.__sentry_wrapped__;if(e)return"function"==typeof e?e:t;if(r.getOriginalFunction(t))return t}catch{return t}const s=function(...s){try{const r=s.map((t=>e(t,n)));return t.apply(this,r)}catch(e){throw a(),r.withScope((t=>{t.addEventProcessor((e=>(n.mechanism&&(r.addExceptionTypeValue(e,void 0,void 0),r.addExceptionMechanism(e,n.mechanism)),e.extra={...e.extra,arguments:s},e))),r.captureException(e)})),e}};try{for(const e in t)Object.prototype.hasOwnProperty.call(t,e)&&(s[e]=t[e])}catch{}r.markFunctionWrapped(s,t),r.addNonEnumerableProperty(t,"__sentry_wrapped__",s);try{Object.getOwnPropertyDescriptor(s,"name").configurable&&Object.defineProperty(s,"name",{get:()=>t.name})}catch{}return s}},49345(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(82696),s=n(15801),i=n(63020),a=n(44572),o=n(44186),l=n(34260),c=n(55232),u=n(10120),d=n(80866),h=n(7589),f=n(79949),p=n(36376),g=n(9239),m=n(15331),_=n(48290),T=n(50011),E=n(87698),y=n(77833),S=n(21555),v=n(23897),b=n(82478),I=n(71383),A=n(81891),R=n(16258),C=n(2992),k=n(57143),L=n(66532),O=n(39917),N=n(19228),w=n(81015),P=n(69982),M=n(37722),D=n(24957),x=n(45971),U=n(88078),B=n(20941),F=n(40639),$=n(32398),G=n(48132),H=n(29626),j=n(8192),W=n(74685),K=n(60520),V=n(91337);t.feedbackAsyncIntegration=r.feedbackAsyncIntegration,t.feedbackIntegration=s.feedbackSyncIntegration,t.feedbackSyncIntegration=s.feedbackSyncIntegration,t.MULTIPLEXED_TRANSPORT_EXTRA_KEY=i.MULTIPLEXED_TRANSPORT_EXTRA_KEY,t.
1SDK_VERSION=i.SDK_VERSION,t.SEMANTIC_ATTRIBUTE_SENTRY_OP=i.SEMANTIC_ATTRIBUTE_SENTRY_OP,t.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN=i.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,t.SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE=i.SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE,t.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE=i.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE,t.Scope=i.Scope,t.addBreadcrumb=i.addBreadcrumb,t.addEventProcessor=i.addEventProcessor,t.addIntegration=i.addIntegration,t.captureConsoleIntegration=i.captureConsoleIntegration,t.captureEvent=i.captureEvent,t.captureException=i.captureException,t.captureFeedback=i.captureFeedback,t.captureMessage=i.captureMessage,t.captureSession=i.captureSession,t.close=i.close,t.consoleLoggingIntegration=i.consoleLoggingIntegration,t.continueTrace=i.continueTrace,t.createConsolaReporter=i.createConsolaReporter,t.createLangChainCallbackHandler=i.createLangChainCallbackHandler,t.createTransport=i.createTransport,t.dedupeIntegration=i.dedupeIntegration,t.endSession=i.endSession,t.eventFiltersIntegration=i.eventFiltersIntegration,t.extraErrorDataIntegration=i.extraErrorDataIntegration,t.featureFlagsIntegration=i.featureFlagsIntegration,t.flush=i.flush,t.functionToStringIntegration=i.functionToStringIntegration,t.getActiveSpan=i.getActiveSpan,t.getClient=i.getClient,t.getCurrentScope=i.getCurrentScope,t.getGlobalScope=i.getGlobalScope,t.getIsolationScope=i.getIsolationScope,t.getRootSpan=i.getRootSpan,t.getSpanDescendants=i.getSpanDescendants,t.getSpanStatusFromHttpCode=i.getSpanStatusFromHttpCode,t.getTraceData=i.getTraceData,t.inboundFiltersIntegration=i.inboundFiltersIntegration,t.instrumentAnthropicAiClient=i.instrumentAnthropicAiClient,t.instrumentCreateReactAgent=i.instrumentCreateReactAgent,t.instrumentGoogleGenAIClient=i.instrumentGoogleGenAIClient,t.instrumentLangChainEmbeddings=i.instrumentLangChainEmbeddings,t.instrumentLangGraph=i.instrumentLangGraph,t.instrumentOpenAiClient=i.instrumentOpenAiClient,t.instrumentSupabaseClient=i.instrumentSupabaseClient,t.isEnabled=i.isEnabled,t.isInitialized=i.isInitialized,t.lastEventId=i.lastEventId,t.logger=i.logger,t.makeMultiplexedTransport=i.makeMultiplexedTransport,t.metrics=i.metrics,t.moduleMetadataIntegration=i.moduleMetadataIntegration,t.parameterize=i.parameterize,t.registerSpanErrorInstrumentation=i.registerSpanErrorInstrumentation,t.rewriteFramesIntegration=i.rewriteFramesIntegration,t.setContext=i.setContext,t.setConversationId=i.setConversationId,t.setCurrentClient=i.setCurrentClient,t.setExtra=i.setExtra,t.setExtras=i.setExtras,t.setHttpStatus=i.setHttpStatus,t.setMeasurement=i.setMeasurement,t.setTag=i.setTag,t.setTags=i.setTags,t.setUser=i.setUser,t.spanToBaggageHeader=i.spanToBaggageHeader,t.spanToJSON=i.spanToJSON,t.spanToTraceHeader=i.spanToTraceHeader,t.startInactiveSpan=i.startInactiveSpan,t.startNewTrace=i.startNewTrace,t.startSession=i.startSession,t.startSpan=i.startSpan,t.startSpanManual=i.startSpanManual,t.supabaseIntegration=i.supabaseIntegration,t.suppressTracing=i.suppressTracing,t.thirdPartyErrorFilterIntegration=i.thirdPartyErrorFilterIntegration,t.updateSpanName=i.updateSpanName,t.withActiveSpan=i.withActiveSpan,t.withIsolationScope=i.withIsolationScope,t.withScope=i.withScope,t.withStreamedSpan=i.withStreamedSpan,t.zodErrorsIntegration=i.zodErrorsIntegration,t.WINDOW=a.WINDOW,t.BrowserClient=o.BrowserClient,t.makeFetchTransport=l.makeFetchTransport,t.uiProfiler=c.uiProfiler,t.chromeStackLineParser=u.chromeStackLineParser,t.defaultStackLineParsers=u.defaultStackLineParsers,t.defaultStackParser=u.defaultStackParser,t.geckoStackLineParser=u.geckoStackLineParser,t.opera10StackLineParser=u.opera10StackLineParser,t.opera11StackLineParser=u.opera11StackLineParser,t.winjsStackLineParser=u.winjsStackLineParser,t.eventFromException=d.eventFromException,t.eventFromMessage=d.eventFromMessage,t.exceptionFromError=d.exceptionFromError,t.createUserFeedbackEnvelope=h.createUserFeedbackEnvelope,t.forceLoad=f.forceLoad,t.getDefaultIntegrations=f.getDefaultIntegrations,t.init=f.init,t.onLoad=f.onLoad,t.showReportDialog=p.showReportDialog,t.breadcrumbsIntegration=g.breadcrumbsIntegration,t.globalHandlersIntegration=m.globalHandlersIntegration,t.httpContextIntegration=_.httpContextIntegration,t.linkedErrorsIntegration=T.linkedErrorsIntegration,t.browserApiErrorsIntegration=E.browserApiErrorsIntegration,t.browserSessionIntegration=y.browserSessionIntegration,t.lazyLoadIntegration=S.lazyLoadIntegration,t.reportingObserverIntegration=v.reportingObserverIntegration,t.httpClientIntegration=b.httpClientIntegration,t.contextLinesIntegration=I.contextLinesIntegration,t.graphqlClientIntegration=A.graphqlClientIntegration,t.viewHierarchyIntegration=R.viewHierarchyIntegration,t.getReplay=C.getReplay,t.replayIntegration=C.replayIntegration,t.replayCanvasIntegration=k.replayCanvasIntegration,t.getFeedback=L.getFeedback,t.sendFeedback=L.sendFeedback,t.defaultRequestInstrumentationOptions=O.defaultRequestInstrumentationOptions,t.instrumentOutgoingRequests=O.instrumentOutgoingRequests,t.browserTracingIntegration=N.browserTracingIntegration,t.isBotUserAgent=N.isBotUserAgent,t.startBrowserTracingNavigationSpan=N.startBrowserTracingNavigationSpan,t.startBrowserTracingPageLoadSpan=N.startBrowserTracingPageLoadSpan,t.elementTimingIntegration=w.elementTimingIntegration,t.reportPageLoaded=P.reportPageLoaded,t.setActiveSpanInBrowser=M.setActiveSpanInBrowser,t.spanStreamingIntegration=D.spanStreamingIntegration,t.makeBrowserOfflineTransport=x.makeBrowserOfflineTransport,t.browserProfilingIntegration=U.browserProfilingIntegration,t.spotlightBrowserIntegration=B.spotlightBrowserIntegration,t.cultureContextIntegration=F.cultureContextIntegration,t.buildLaunchDarklyFlagUsedHandler=$.buildLaunchDarklyFlagUsedHandler,t.launchDarklyIntegration=$.launchDarklyIntegration,t.OpenFeatureIntegrationHook=G.OpenFeatureIntegrationHook,t.openFeatureIntegration=G.openFeatureIntegration,t.unleashIntegration=H.unleashIntegration,t.growthbookIntegration=j.growthbookIntegration,t.statsigIntegration=W.statsigIntegration,t.diagnoseSdkConnectivity=K.diagnoseSdkConnectivity,t.registerWebWorker=V.registerWebWorker,t.webWorkerIntegration=V.webWorkerIntegration},9239(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(63020),s=n(81015),i=n(43471),a=n(44572),o=1024,l=r.defineIntegration(((e={})=>{const t={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e};return{name:"Breadcrumbs",setup(e){t.console&&r.addConsoleInstrumentationHandler(function(e){return function(t){if(r.getClient()!==e)return;const n={category:"console",data:{arguments:t.args,logger:"console"},level:r.severityLevelFromString(t.level),message:r.safeJoin(t.args," ")};if("assert"===t.level){if(!1!==t.args[0])return;n.message=`Assertion failed: ${r.safeJoin(t.args.slice(1)," ")||"console.assert"}`,n.data.arguments=t.args.slice(1)}r.addBreadcrumb(n,{input:t.args,level:t.level})}}(e)),t.dom&&s.addClickKeypressInstrumentationHandler(function(e,t){return function(n){if(r.getClient()!==e)return;let s,a,l="object"==typeof t?t.serializeAttribute:void 0,c="object"==typeof t&&"number"==typeof t.maxStringLength?t.maxStringLength:void 0;c&&c>o&&(i.DEBUG_BUILD&&r.debug.warn(`\`dom.maxStringLength\` cannot exceed 1024, but a value of ${c} was configured. Sentry will use 1024 instead.`),c=o),"string"==typeof l&&(l=[l]);try{const e=n.event,t=function(e){return!!e&&!!e.target}(e)?e.target:e;s=r.htmlTreeAsString(t,{keyAttrs:l,maxStringLength:c}),a=r.getComponentName(t)}catch{s="<unknown>"}if(0===s.length)return;const u={category:`ui.${n.name}`,message:s};a&&(u.data={"ui.component_name":a}),r.addBreadcrumb(u,{event:n.event,name:n.name,global:n.global})}}(e,t.dom)),t.xhr&&s.addXhrInstrumentationHandler(function(e){return function(t){if(r.getClient()!==e)return;const{startTimestamp:n,endTimestamp:i}=t,a=t.xhr[s.SENTRY_XHR_DATA_KEY];if(!n||!i||!a)return;const{method:o,url:l,status_code:c,body:u}=a,d={method:o,url:l,status_code:c},h={xhr:t.xhr,input:u,startTimestamp:n,endTimestamp:i},f={category:"xhr",data:d,type:"http",level:r.getBreadcrumbLogLevelFromHttpStatusCode(c)};e.emit("beforeOutgoingRequestBreadcrumb",f,h),r.addBreadcrumb(f,h)}}(e)),t.fetch&&r.addFetchInstrumentationHandler(function(e){return function(t){if(r.getClient()!==e)return;const{startTimestamp:n,endTimestamp:s}=t;
1if(s&&(!t.fetchData.url.match(/sentry_key/)||"POST"!==t.fetchData.method))if(t.error){const i={data:t.error,input:t.args,startTimestamp:n,endTimestamp:s},a={category:"fetch",data:t.fetchData,level:"error",type:"http"};e.emit("beforeOutgoingRequestBreadcrumb",a,i),r.addBreadcrumb(a,i)}else{const i=t.response,a={...t.fetchData,status_code:i?.status},o={input:t.args,response:i,startTimestamp:n,endTimestamp:s},l={category:"fetch",data:a,type:"http",level:r.getBreadcrumbLogLevelFromHttpStatusCode(a.status_code)};e.emit("beforeOutgoingRequestBreadcrumb",l,o),r.addBreadcrumb(l,o)}}}(e)),t.history&&s.addHistoryInstrumentationHandler(function(e){return function(t){if(r.getClient()!==e)return;let n=t.from,s=t.to;const i=r.parseUrl(a.WINDOW.location.href);let o=n?r.parseUrl(n):void 0;const l=r.parseUrl(s);o?.path||(o=i),i.protocol===l.protocol&&i.host===l.host&&(s=l.relative),i.protocol===o.protocol&&i.host===o.host&&(n=o.relative),r.addBreadcrumb({category:"navigation",data:{from:n,to:s}})}}(e)),t.sentry&&e.on("beforeSendEvent",function(e){return function(t){r.getClient()===e&&r.addBreadcrumb({category:"sentry."+("transaction"===t.type?"transaction":"event"),event_id:t.event_id,level:t.level,message:r.getEventDescription(t)},{event:t})}}(e))}}}));t.breadcrumbsIntegration=l},87698(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(63020),s=n(44572),i="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(","),a=r.defineIntegration(((e={})=>{const t={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,unregisterOriginalCallbacks:!1,...e};return{name:"BrowserApiErrors",setupOnce(){t.setTimeout&&r.fill(s.WINDOW,"setTimeout",o),t.setInterval&&r.fill(s.WINDOW,"setInterval",o),t.requestAnimationFrame&&r.fill(s.WINDOW,"requestAnimationFrame",l),t.XMLHttpRequest&&"XMLHttpRequest"in s.WINDOW&&r.fill(XMLHttpRequest.prototype,"send",c);const e=t.eventTarget;if(e){(Array.isArray(e)?e:i).forEach((e=>function(e,t){const n=s.WINDOW,i=n[e]?.prototype;if(!i?.hasOwnProperty?.("addEventListener"))return;r.fill(i,"addEventListener",(function(n){return function(i,a,o){try{"function"==typeof a.handleEvent&&(a.handleEvent=s.wrap(a.handleEvent,{mechanism:{data:{handler:r.getFunctionName(a),target:e},handled:!1,type:"auto.browser.browserapierrors.handleEvent"}}))}catch{}return t.unregisterOriginalCallbacks&&function(e,t,n){e&&"object"==typeof e&&"removeEventListener"in e&&"function"==typeof e.removeEventListener&&e.removeEventListener(t,n)}(this,i,a),n.apply(this,[i,s.wrap(a,{mechanism:{data:{handler:r.getFunctionName(a),target:e},handled:!1,type:"auto.browser.browserapierrors.addEventListener"}}),o])}})),r.fill(i,"removeEventListener",(function(e){return function(t,n,r){try{const s=n.__sentry_wrapped__;s&&e.call(this,t,s,r)}catch{}return e.call(this,t,n,r)}}))}(e,t)))}}}}));function o(e){return function(...t){const n=t[0];return t[0]=s.wrap(n,{mechanism:{handled:!1,type:`auto.browser.browserapierrors.${r.getFunctionName(e)}`}}),e.apply(this,t)}}function l(e){return function(t){return e.apply(this,[s.wrap(t,{mechanism:{data:{handler:r.getFunctionName(e)},handled:!1,type:"auto.browser.browserapierrors.requestAnimationFrame"}})])}}function c(e){return function(...t){const n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach((e=>{e in n&&"function"==typeof n[e]&&r.fill(n,e,(function(t){const n={mechanism:{data:{handler:r.getFunctionName(t)},handled:!1,type:`auto.browser.browserapierrors.xhr.${e}`}},i=r.getOriginalFunction(t);return i&&(n.mechanism.data.handler=r.getFunctionName(i)),s.wrap(t,n)}))})),e.apply(this,t)}}t.browserApiErrorsIntegration=a},77833(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(63020),s=n(81015),i=n(43471),a=n(44572),o=r.defineIntegration(((e={})=>{const t=e.lifecycle??"route";return{name:"BrowserSession",setupOnce(){if(void 0===a.WINDOW.document)return void(i.DEBUG_BUILD&&r.debug.warn("Using the `browserSessionIntegration` in non-browser environments is not supported."));r.startSession({ignoreDuration:!0}),r.captureSession();const e=r.getIsolationScope();let n=e.getUser();e.addScopeListener((e=>{const t=e.getUser();
1n?.id===t?.id&&n?.ip_address===t?.ip_address||(r.captureSession(),n=t)})),"route"===t&&s.addHistoryInstrumentationHandler((({from:e,to:t})=>{e!==t&&(r.startSession({ignoreDuration:!0}),r.captureSession())}))}}}));t.browserSessionIntegration=o},71383(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(63020),s=r.GLOBAL_OBJ,i=r.defineIntegration(((e={})=>{const t=null!=e.frameContextLines?e.frameContextLines:7;return{name:"ContextLines",processEvent:e=>function(e,t){const n=s.document,i=s.location&&r.stripUrlQueryAndFragment(s.location.href);if(!n||!i)return e;const o=e.exception?.values;if(!o?.length)return e;const l=n.documentElement.innerHTML;if(!l)return e;const c=["<!DOCTYPE html>","<html>",...l.split("\n"),"</html>"];return o.forEach((e=>{const n=e.stacktrace;n?.frames&&(n.frames=n.frames.map((e=>a(e,c,i,t))))})),e}(e,t)}}));function a(e,t,n,s){return e.filename===n&&e.lineno&&t.length?(r.addContextToFrame(t,e,s),e):e}t.applySourceContextToFrame=a,t.contextLinesIntegration=i},40639(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(63020),s=n(44572),i=r.defineIntegration((()=>({name:"CultureContext",preprocessEvent(e){const t=a();t&&(e.contexts={...e.contexts,culture:{...t,...e.contexts?.culture}})},processSegmentSpan(e){const t=a();t&&r.safeSetSpanJSONAttributes(e,{"culture.locale":t.locale,"culture.timezone":t.timezone,"culture.calendar":t.calendar})}})));function a(){try{const e=s.WINDOW.Intl;if(!e)return;const t=e.DateTimeFormat().resolvedOptions();return{locale:t.locale,timezone:t.timeZone,calendar:t.calendar}}catch{return}}t.cultureContextIntegration=i},8192(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(63020);t.growthbookIntegration=({growthbookClass:e})=>r.growthbookIntegration({growthbookClass:e})},32398(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(63020),s=r.defineIntegration((()=>
1({name:"LaunchDarkly",processEvent:(e,t,n)=>r._INTERNAL_copyFlagsFromScopeToEvent(e)})));t.buildLaunchDarklyFlagUsedHandler=function(){return{name:"sentry-flag-auditor",type:"flag-used",synchronous:!0,method:(e,t,n)=>{r._INTERNAL_insertFlagToScope(e,t.value),r._INTERNAL_addFeatureFlagToActiveSpan(e,t.value)}}},t.launchDarklyIntegration=s},48132(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(63020),s=r.defineIntegration((()=>({name:"OpenFeature",processEvent:(e,t,n)=>r._INTERNAL_copyFlagsFromScopeToEvent(e)})));t.OpenFeatureIntegrationHook=class{after(e,t){r._INTERNAL_insertFlagToScope(t.flagKey,t.value),r._INTERNAL_addFeatureFlagToActiveSpan(t.flagKey,t.value)}error(e,t,n){r._INTERNAL_insertFlagToScope(e.flagKey,e.defaultValue),r._INTERNAL_addFeatureFlagToActiveSpan(e.flagKey,e.defaultValue)}},t.openFeatureIntegration=s},74685(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(63020),s=r.defineIntegration((({featureFlagClient:e})=>({name:"Statsig",setup(t){e.on("gate_evaluation",(e=>{r._INTERNAL_insertFlagToScope(e.gate.name,e.gate.value),r._INTERNAL_addFeatureFlagToActiveSpan(e.gate.name,e.gate.value)}))}
1,processEvent:(e,t,n)=>r._INTERNAL_copyFlagsFromScopeToEvent(e)})));t.statsigIntegration=s},29626(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(63020),s=n(43471),i=r.defineIntegration((({featureFlagClientClass:e})=>({name:"Unleash",setupOnce(){const t=e.prototype;r.fill(t,"isEnabled",a)},processEvent:(e,t,n)=>r._INTERNAL_copyFlagsFromScopeToEvent(e)})));function a(e){return function(...t){const n=t[0],i=e.apply(this,t);return"string"==typeof n&&"boolean"==typeof i?(r._INTERNAL_insertFlagToScope(n,i),r._INTERNAL_addFeatureFlagToActiveSpan(n,i)):s.DEBUG_BUILD&&r.debug.error(`[Feature Flags] UnleashClient.isEnabled does not match expected signature. arg0: ${n} (${typeof n}), result: ${i} (${typeof i})`),i}}t.unleashIntegration=i},15331(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(63020),s=n(43471),i=n(80866),a=n(44572),o=r.defineIntegration(((e={})=>{const t={onerror:!0,onunhandledrejection:!0,...e};return{name:"GlobalHandlers",setupOnce(){Error.stackTraceLimit=50},setup(e){t.onerror&&(!function(e){r.addGlobalErrorInstrumentationHandler((t=>{const{stackParser:n,attachStacktrace:s}=d();if(r.getClient()!==e||a.shouldIgnoreOnError())return;const{msg:o,url:l,line:c,column:u,error:f}=t,p=function(e,t,n,s){const i=e.exception=e.exception||{},a=i.values=i.values||[],o=a[0]=a[0]||{},l=o.stacktrace=o.stacktrace||{},c=l.frames=l.frames||[];0===c.length&&c.push({colno:s,lineno:n,filename:h(t)??r.getLocationHref(),function:r.UNKNOWN_FUNCTION,in_app:!0});return e}(i.eventFromUnknownInput(n,f||o,void 0,s,!1),l,c,u);p.level="error",r.captureEvent(p,{originalException:f,mechanism:{handled:!1,type:"auto.browser.global_handlers.onerror"}})}))}(e),u("onerror")),t.onunhandledrejection&&(!function(e){r.addGlobalUnhandledRejectionInstrumentationHandler((t=>{const{stackParser:n,attachStacktrace:s}=d();if(r.getClient()!==e||a.shouldIgnoreOnError())return;const o=l(t),u=r.isPrimitive(o)?c(o):i.eventFromUnknownInput(n,o,void 0,s,!0);u.level="error",r.captureEvent(u,{originalException:o,mechanism:{handled:!1,type:"auto.browser.global_handlers.onunhandledrejection"}})}))}(e),u("onunhandledrejection"))}}}));function l(e){if(r.isPrimitive(e))return e;try{if("reason"in e)return e.reason;if("detail"in e&&"reason"in e.detail)return e.detail.reason}catch{}return e}function c(e){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(e)}`}]}}}function u(e){s.DEBUG_BUILD&&r.debug.log(`Global Handler attached: ${e}`)}function d(){const e=r.getClient();return e?.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}function h(e){if(r.isString(e)&&0!==e.length)return e.startsWith("data:")?`<${r.stripDataUrlContent(e,!1)}>`:e}t._eventFromRejectionWithPrimitive=c,t._getUnhandledRejectionError=l,t.globalHandlersIntegration=o},81891(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(63020),s=n(81015);function i(e){if(u(e))return`persisted ${e.operationName}`;if(c(e)){const{query:t,operationName:n}=e,{operationName:r=n,operationType:s}=o(t);return r?`${s} ${r}`:`${s}`}return"unknown"}function a(e){let t;if("xhr"in e){const n=e.xhr[s.SENTRY_XHR_DATA_KEY];t=n&&s.getBodyString(n.body)[0]}else{const n=s.getFetchRequestArgBody(e.input);t=s.getBodyString(n)[0]}return t}function o(e){const t=e.match(/^(?:\s*)(query|mutation|subscription)(?:\s*)(\w+)(?:\s*)[{(]/);if(t)return{operationType:t[1],operationName:t[2]};const n=e.match(/^(?:\s*)(query|mutation|subscription)(?:\s*)[{(]/);return n?{operationType:n[1],operationName:void 0}:{operationType:void 0,operationName:void 0}}function l(e){return"object"==typeof e&&null!==e}function c(e){return l(e)&&"string"==typeof e.query}function u(e){return l(e)&&"string"==typeof e.operationName&&l(e.extensions)&&l(e.extensions.persistedQuery)&&"string"==typeof e.extensions.persistedQuery.sha256Hash&&"number"==typeof e.extensions.persistedQuery.version}function d(e){try{const t=JSON.parse(e);return c(t)||u(t)?t:void 0}catch{return}}const h=r.defineIntegration((e=>({name:"GraphQLClient",setup(t){!function(e,t){e.on("beforeOutgoingRequestSpan",((e,n)=>{const s=r.spanToJSON(e).data||{};if(!("http.client"===s[r.SEMANTIC_ATTRIBUTE_SENTRY_OP]))return;const o=s[r.SEMANTIC_ATTRIBUTE_URL_FULL]||s["http.url"]||s.url,l=s[r.SEMANTIC_ATTRIBUTE_HTTP_REQUEST_METHOD]||s["http.method"];
1if(!r.isString(o)||!r.isString(l))return;const{endpoints:h}=t,f=r.stringMatchesSomePattern(o,h),p=a(n);if(f&&p){const t=d(p);if(t){const n=i(t);e.updateName(`${l} ${o} (${n})`),c(t)&&e.setAttribute("graphql.document",t.query),u(t)&&(e.setAttribute("graphql.persisted_query.hash.sha256",t.extensions.persistedQuery.sha256Hash),e.setAttribute("graphql.persisted_query.version",t.extensions.persistedQuery.version))}}}))}(t,e),function(e,t){e.on("beforeOutgoingRequestBreadcrumb",((e,n)=>{const{category:s,type:o,data:l}=e;if("http"===o&&("fetch"===s||"xhr"===s)){const e=l?.url,{endpoints:s}=t,o=r.stringMatchesSomePattern(e,s),h=a(n);if(o&&l&&h){const e=d(h);if(!l.graphql&&e){const t=i(e);l["graphql.operation"]=t,c(e)&&(l["graphql.document"]=e.query),u(e)&&(l["graphql.persisted_query.hash.sha256"]=e.extensions.persistedQuery.sha256Hash,l["graphql.persisted_query.version"]=e.extensions.persistedQuery.version)}}}}))}(t,e)}})));t._getGraphQLOperation=i,t.getGraphQLRequestPayload=d,t.getRequestPayloadXhrOrFetch=a,t.graphqlClientIntegration=h,t.parseGraphQLQuery=o},82478(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(63020),s=n(81015),i=n(43471),a=r.defineIntegration(((e={})=>{const t={failedRequestStatusCodes:[[500,599]],failedRequestTargets:[/.*/],...e};return{name:"HttpClient",setup(e){!function(e,t){if(!r.supportsNativeFetch())return;r.addFetchInstrumentationHandler((n=>{if(r.getClient()!==e)return;const{response:s,args:i,error:a,virtualError:l}=n,[c,f]=i;s&&function(e,t,n,s,i){if(u(e,n.status,n.url)){const e=function(e,t){if(!t&&e instanceof Request)return e;if(e instanceof Request&&e.bodyUsed)return e;return new Request(e,t)}(t,s);let a,l,c,u;h()&&([a,c]=o("Cookie",e),[l,u]=o("Set-Cookie",n));const f=d({url:e.url,method:e.method,status:n.status,requestHeaders:a,responseHeaders:l,requestCookies:c,responseCookies:u,error:i,type:"fetch"});r.captureEvent(f)}}(t,c,s,f,a||l)}),!1)}(e,t),function(e,t){if(!("XMLHttpRequest"in r.GLOBAL_OBJ))return;s.addXhrInstrumentationHandler((n=>{if(r.getClient()!==e)return;const{error:a,virtualError:o}=n,l=n.xhr,f=l[s.SENTRY_XHR_DATA_KEY];if(!f)return;const{method:p,request_headers:g}=f;try{!function(e,t,n,s,i){if(u(e,t.status,t.responseURL)){let e,a,o;if(h()){try{const e=t.getResponseHeader("Set-Cookie")||t.getResponseHeader("set-cookie")||void 0;e&&(a=c(e))}catch{}try{o=function(e){const t=e.getAllResponseHeaders();if(!t)return{};return t.split("\r\n").reduce(((e,t)=>{const[n,r]=t.split(": ");return n&&r&&(e[n]=r),e}),{})}(t)}catch{}e=s}const l=d({url:t.responseURL,method:n,status:t.status,requestHeaders:e,responseHeaders:o,responseCookies:a,error:i,type:"xhr"});r.captureEvent(l)}}(t,l,p,g,a||o)}catch(e){i.DEBUG_BUILD&&r.debug.warn("Error while extracting response event form XHR response",e)}}))}(e,t)}}}));function o(e,t){const n=function(e){const t={};return e.forEach(((e,n)=>{t[n]=e})),t}(t.headers);let r;try{const t=n[e]||n[e.toLowerCase()]||void 0;t&&(r=c(t))}catch{}return[n,r]}function l(e){if(e){const t=e["Content-Length"]||e["content-length"];if(t)return parseInt(t,10)}}function c(e){return e.split("; ").reduce(((e,t)=>{const[n,r]=t.split("=");return n&&r&&(e[n]=r),e}),{})}function u(e,t,n){return function(e,t){return e.some((e=>"number"==typeof e?e===t:t>=e[0]&&t<=e[1]))}(e.failedRequestStatusCodes,t)&&(s=e.failedRequestTargets,i=n,s.some((e=>"string"==typeof e?i.includes(e):e.test(i))))&&!r.isSentryRequestUrl(n,r.getClient());var s,i}function d(e){const t=r.getClient(),n=t&&e.error&&e.error instanceof Error?e.error.stack:void 0,s=n&&t?t.getOptions().stackParser(n,0,1):void 0,i=`HTTP Client Error with status code: ${e.status}`,a={message:i,exception:{values:[{type:"Error",value:i,stacktrace:s?{frames:s}:void 0}]},request:{url:e.url,method:e.method,headers:e.requestHeaders,cookies:e.requestCookies},contexts:{response:{status_code:e.status,headers:e.responseHeaders,cookies:e.responseCookies,body_size:l(e.responseHeaders)}}};return r.addExceptionMechanism(a,{type:`auto.http.client.${e.type}`,handled:!1}),a}function h(){const e=r.getClient();return!!e&&Boolean(e.getOptions().sendDefaultPii)}t.httpClientIntegration=a},48290(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(63020),s=n(44572),i=r.defineIntegration((()=>({name:"HttpContext",preprocessEvent(e){if(!s.WINDOW.navigator&&!s.WINDOW.location&&!s.WINDOW.document)return;const t=s.getHttpRequestData(),n={...t.headers,...e.request?.headers};e.request={...t,...e.request,headers:n}},processSegmentSpan(e){if(!s.WINDOW.navigator&&!s.WINDOW.location&&!s.WINDOW.document)return;const t=s.getHttpRequestData();r.safeSetSpanJSONAttributes(e,{"url.full":t.url||void 0,"http.request.header.user_agent":t.headers["User-Agent"],"http.request.header.referer":t.headers.Referer})}})));t.httpContextIntegration=i},50011(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(63020),s=n(80866),i=r.defineIntegration(((e={})=>{const t=e.limit||5,n=e.key||"cause";return{name:"LinkedErrors",preprocessEvent(e,i,a){const o=a.getOptions();r.applyAggregateErrorsToEvent(s.exceptionFromError,o.stackParser,n,t,e,i)}}}));t.linkedErrorsIntegration=i},23897(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(63020),s=r.GLOBAL_OBJ,i=new WeakMap,a=r.defineIntegration(((e={})=>{const t=e.types||["crash","deprecation","intervention"];function n(e){if(i.has(r.getClient()))for(const t of e)r.withScope((e=>{e.setExtra("url",t.url);const n=`ReportingObserver [${t.type}]`;let s="No details available";if(t.body){const n={};for(const e in t.body)n[e]=t.body[e];if(e.setExtra("body",n),"crash"===t.type){const e=t.body;s=[e.crashId||"",e.reason||""].join(" ").trim()||s}else{s=t.body.message||s}}r.captureMessage(`${n}: ${s}`)}))}return{name:"ReportingObserver",setupOnce(){if(!r.supportsReportingObserver())return;new s.ReportingObserver(n,{buffered:!0,types:t}).observe()},setup(e){i.set(e,!0)}}}));t.reportingObserverIntegration=a},24957(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(63020),s=n(43471),i=r.defineIntegration((()=>({name:"SpanStreaming",beforeSetup(e){const t=e.getOptions();t.traceLifecycle||(s.DEBUG_BUILD&&r.debug.log('[SpanStreaming] setting `traceLifecycle` to "stream"'),t.traceLifecycle="stream")},setup(e){const t="SpanStreaming integration requires",n="Falling back to static trace lifecycle.",i=e.getOptions();if(!r.hasSpanStreamingEnabled(e))return i.traceLifecycle="static",void(s.DEBUG_BUILD&&r.debug.warn(`${t} \`traceLifecycle\` to be set to "stream"! ${n}`));const a=i.beforeSendSpan;if(a&&!r.isStreamedBeforeSendSpanCallback(a))return i.traceLifecycle="static",void(s.DEBUG_BUILD&&r.debug.warn(`${t} a beforeSendSpan callback using \`withStreamedSpan\`! ${n}`));const o=new r.SpanBuffer(e);e.on("afterSpanEnd",(t=>{r.spanIsSampled(t)&&o.add(r.captureSpan(t,e))})),e.on("afterSegmentSpanEnd",(e=>{const t=e.spanContext().traceId;setTimeout((()=>{o.flush(t)}),500)}))}})));t.spanStreamingIntegration=i}
1,20941(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(63020),s=n(81015),i=n(43471),a="SpotlightBrowser",o=[{op:"ui.interaction.click",name:"#sentry-spotlight"}];const l=r.defineIntegration(((e={})=>{const t=e.sidecarUrl||"http://localhost:8969/stream";return{name:a,setup:()=>{i.DEBUG_BUILD&&r.debug.log("Using Sidecar URL",t)},beforeSetup(e){const t=e.getOptions();t.ignoreSpans=[...t.ignoreSpans||[],...o]},afterAllSetup:e=>{!function(e,t){const n=s.getNativeImplementation("fetch");let i=0;e.on("beforeEnvelope",(e=>{i>3?r.debug.warn("[Spotlight] Disabled Sentry -> Spotlight integration due to too many failed requests:",i):n(t,{method:"POST",body:r.serializeEnvelope(e),headers:{"Content-Type":"application/x-sentry-envelope"},mode:"cors"}).then((e=>{e.status>=200&&e.status<400&&(i=0)}),(e=>{i++,r.debug.error("Sentry SDK can't connect to Sidecar is it running? See: https://spotlightjs.com/sidecar/npx/",e)}))}))}(e,t)}}}));t.INTEGRATION_NAME=a,t.SPOTLIGHT_IGNORE_SPANS=o,t.spotlightBrowserIntegration=l},16258(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(63020),s=n(44572),i=r.defineIntegration(((e={})=>{const t=["script"];function n(s,i,a=0){if(!s)return;const o="shadowRoot"in s&&s.shadowRoot?s.shadowRoot.children:s.children;for(const s of o){if(!(s instanceof HTMLElement))continue;const o=r.getComponentName(s,1)||void 0,l=s.tagName.toLowerCase();if(t.includes(l))continue;const c=e.onElement?.({element:s,componentName:o,tagName:l,depth:a})||{};if("skip"===c)continue;if("children"===c){n(s,i,a+1);continue}const{x:u,y:d,width:h,height:f}=s.getBoundingClientRect(),p={identifier:s.id||void 0,type:o||l,visible:!0,alpha:1,height:f,width:h,x:u,y:d,...c},g=[];p.children=g,n(s,p.children,a+1),i.push(p)}}return{name:"ViewHierarchy",processEvent:(t,r)=>{if(void 0!==t.type||!1===e.shouldAttach?.(t,r))return t;const i={rendering_system:"DOM",positioning:"absolute",windows:[]};n(e.rootElement?.()||s.WINDOW.document.body,i.windows);const a={filename:"view-hierarchy.json",attachmentType:"event.view_hierarchy",contentType:"application/json",data:JSON.stringify(i)};return r.attachments=r.attachments||[],r.attachments.push(a),t}}}));t.viewHierarchyIntegration=i},91337(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(63020),s=n(43471),i=n(80866),a=n(44572),o=n(15331),l="WebWorker",c=r.defineIntegration((({worker:e})=>({name:l,setupOnce:()=>{(Array.isArray(e)?e:[e]).forEach((e=>u(e)))},addWorker:e=>u(e)})));function u(e){e.addEventListener("message",(e=>{if(function(e){if(!r.isPlainObject(e)||!0!==e._sentryMessage)return!1;const t="_sentryDebugIds"in e,n="_sentryModuleMetadata"in e,s="_sentryWorkerError"in e,i="_sentryWasmImages"in e;if(!(t||n||s||i))return!1;if(t&&!r.isPlainObject(e._sentryDebugIds)&&void 0!==e._sentryDebugIds)return!1;if(n&&!r.isPlainObject(e._sentryModuleMetadata)&&void 0!==e._sentryModuleMetadata)return!1;if(s&&!r.isPlainObject(e._sentryWorkerError))return!1;if(i&&(!Array.isArray(e._sentryWasmImages)||!e._sentryWasmImages.every((e=>r.isPlainObject(e)&&"string"==typeof e.code_file))))return!1;return!0}(e.data)){if(e.stopImmediatePropagation(),e.data._sentryDebugIds&&(s.DEBUG_BUILD&&r.debug.log("Sentry debugId web worker message received",e.data),a.WINDOW._sentryDebugIds={...e.data._sentryDebugIds,...a.WINDOW._sentryDebugIds}),e.data._sentryModuleMetadata&&(s.DEBUG_BUILD&&r.debug.log("Sentry module metadata web worker message received",e.data),a.WINDOW._sentryModuleMetadata={...e.data._sentryModuleMetadata,...a.WINDOW._sentryModuleMetadata}),e.data._sentryWasmImages){s.DEBUG_BUILD&&r.debug.log("Sentry WASM images web worker message received",e.data);const t=a.WINDOW._sentryWasmImages||[],n=e.data._sentryWasmImages.filter((e=>r.isPlainObject(e)&&"string"==typeof e.code_file&&!t.some((t=>t.code_file===e.code_file))));a.WINDOW._sentryWasmImages=[...t,...n]}e.data._sentryWorkerError&&(s.DEBUG_BUILD&&r.debug.log("Sentry worker rejection message received",e.data._sentryWorkerError),function(e){const t=r.getClient();if(!t)return;const n=t.getOptions().stackParser,a=t.getOptions().attachStacktrace,l=e.reason,c=r.isPrimitive(l)?o._eventFromRejectionWithPrimitive(l):i.eventFromUnknownInput(n,l,void 0,a,!0);c.level="error",e.filename&&(c.contexts={...c.contexts,worker:{filename:e.filename}});r.captureEvent(c,{originalException:l,mechanism:{handled:!1,type:"auto.browser.web_worker.onunhandledrejection"}}),s.DEBUG_BUILD&&r.debug.log("Captured worker unhandled rejection",l)}(e.data._sentryWorkerError))}}))}t.INTEGRATION_NAME=l,t.registerWebWorker=function({self:e}){e.postMessage({_sentryMessage:!0,_sentryDebugIds:e._sentryDebugIds??void 0,_sentryModuleMetadata:e._sentryModuleMetadata??void 0}),e.addEventListener("unhandledrejection",(t=>{const n={reason:o._getUnhandledRejectionError(t),filename:e.location?.href};e.postMessage({_sentryMessage:!0,_sentryWorkerError:n}),s.DEBUG_BUILD&&r.debug.log("[Sentry Worker] Forwarding unhandled rejection to parent",n)})),s.DEBUG_BUILD&&r.debug.log("[Sentry Worker] Registered worker with unhandled rejection handling")},t.webWorkerIntegration=c},1773(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(63020),s=n(43471),i=n(81625);t.UIProfiler=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){const t=e.getOptions().profileLifecycle,n=i.shouldProfileSession(e.getOptions());s.DEBUG_BUILD&&r.debug.log(`[Profiling] Initializing profiler (lifecycle='${t}').`),n||s.DEBUG_BUILD&&r.debug.log("[Profiling] Session not sampled. Skipping lifecycle profiler initialization."),this._profilerId=r.uuid4(),this._client=e,this._sessionSampled=n,this._lifecycleMode=t,"trace"===t&&this._setupTraceLifecycleListeners(e),e.on("spanStart",(e=>{this._isRunning&&i.setThreadAttributes(e)}))}start(){"trace"!==this._lifecycleMode?this._isRunning?s.DEBUG_BUILD&&r.debug.warn("[Profiling] Profile session is already running, `uiProfiler.start()` is a 
1no-op."):this._sessionSampled?this._beginProfiling():s.DEBUG_BUILD&&r.debug.warn("[Profiling] Session is not sampled, `uiProfiler.start()` is a no-op."):s.DEBUG_BUILD&&r.debug.warn('[Profiling] `profileLifecycle` is set to "trace". Calls to `uiProfiler.start()` are ignored in trace mode.')}stop(){"trace"!==this._lifecycleMode?this._isRunning?this._endProfiling():s.DEBUG_BUILD&&r.debug.warn("[Profiling] Profiler is not running, `uiProfiler.stop()` is a no-op."):s.DEBUG_BUILD&&r.debug.warn('[Profiling] `profileLifecycle` is set to "trace". Calls to `uiProfiler.stop()` are ignored in trace mode.')}notifyRootSpanActive(e){if("trace"!==this._lifecycleMode||!this._sessionSampled)return;const t=e.spanContext().spanId;if(!t||this._activeRootSpanIds.has(t))return;this._registerTraceRootSpan(t);const n=this._activeRootSpanIds.size;1===n&&(s.DEBUG_BUILD&&r.debug.log("[Profiling] Detected already active root span during setup. Active root spans now:",n),this._beginProfiling()),this._isRunning&&i.setThreadAttributes(e)}_beginProfiling(){if(!this._isRunning){if(this._isRunning=!0,s.DEBUG_BUILD&&r.debug.log("[Profiling] Started profiling with profiler ID:",this._profilerId),r.getGlobalScope().setContext("profile",{profiler_id:this._profilerId}),this._startProfilerInstance(),!this._profiler)return s.DEBUG_BUILD&&r.debug.log("[Profiling] Failed to start JS Profiler; stopping."),void this._resetProfilerInfo();this._startPeriodicChunking()}}_endProfiling(){this._isRunning&&(this._isRunning=!1,this._chunkTimer&&(clearTimeout(this._chunkTimer),this._chunkTimer=void 0),this._clearAllRootSpanTimeouts(),this._collectCurrentChunk().catch((e=>{s.DEBUG_BUILD&&r.debug.error("[Profiling] Failed to collect current profile chunk on `stop()`:",e)})),"manual"===this._lifecycleMode&&r.getGlobalScope().setContext("profile",{}))}_setupTraceLifecycleListeners(e){e.on("spanStart",(e=>{if(!this._sessionSampled)return void(s.DEBUG_BUILD&&r.debug.log("[Profiling] Span not profiled because of negative sampling decision for user session."));if(e!==r.getRootSpan(e))return;if(!e.isRecording())return void(s.DEBUG_BUILD&&r.debug.log("[Profiling] Discarding profile because root span was not sampled."));const t=e.spanContext().spanId;if(!t||this._activeRootSpanIds.has(t))return;this._registerTraceRootSpan(t);const n=this._activeRootSpanIds.size;1===n&&(s.DEBUG_BUILD&&r.debug.log(`[Profiling] Root span ${t} started. Profiling active while there are active root spans (count=${n}).`),this._beginProfiling())})),e.on("spanEnd",(e=>{if(!this._sessionSampled)return;const t=e.spanContext().spanId;if(!t||!this._activeRootSpanIds.has(t))return;this._activeRootSpanIds.delete(t);const n=this._activeRootSpanIds.size;s.DEBUG_BUILD&&r.debug.log(`[Profiling] Root span with ID ${t} ended. Will continue profiling for as long as there are active root spans (currently: ${n}).`),0===n&&(this._collectCurrentChunk().catch((e=>{s.DEBUG_BUILD&&r.debug.error("[Profiling] Failed to collect current profile chunk on last `spanEnd`:",e)})),this._endProfiling())}))}_resetProfilerInfo(){this._isRunning=!1,r.getGlobalScope().setContext("profile",{})}_clearAllRootSpanTimeouts(){this._rootSpanTimeouts.forEach((e=>clearTimeout(e))),this._rootSpanTimeouts.clear()}_registerTraceRootSpan(e){this._activeRootSpanIds.add(e);const t=setTimeout((()=>this._onRootSpanTimeout(e)),3e5);this._rootSpanTimeouts.set(e,t)}_startProfilerInstance(){if(!1===this._profiler?.stopped)return;const e=i.startJSSelfProfile();e?this._profiler=e:s.DEBUG_BUILD&&r.debug.log("[Profiling] Failed to start JS Profiler.")}_startPeriodicChunking(){this._isRunning&&(this._chunkTimer=setTimeout((()=>{if(this._collectCurrentChunk().catch((e=>{s.DEBUG_BUILD&&r.debug.error("[Profiling] Failed to collect current profile chunk during periodic chunking:",e)})),this._isRunning){if(this._startProfilerInstance(),!this._profiler)return void this._resetProfilerInfo();this._startPeriodicChunking()}}),6e4))}_onRootSpanTimeout(e){this._rootSpanTimeouts.has(e)&&(this._rootSpanTimeouts.delete(e),this._activeRootSpanIds.has(e)&&(s.DEBUG_BUILD&&r.debug.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),0===this._activeRootSpanIds.size&&this._endProfiling()))}async _collectCurrentChunk(){const e=this._profiler;
1if(this._profiler=void 0,e)try{const t=await e.stop(),n=i.createProfileChunkPayload(t,this._client,this._profilerId),a=i.validateProfileChunk(n);if("reason"in a)return void(s.DEBUG_BUILD&&r.debug.log("[Profiling] Discarding invalid profile chunk (this is probably a bug in the SDK):",a.reason));this._sendProfileChunk(n),s.DEBUG_BUILD&&r.debug.log("[Profiling] Collected browser profile chunk.")}catch(e){s.DEBUG_BUILD&&r.debug.log("[Profiling] Error while stopping JS Profiler for chunk:",e)}}_sendProfileChunk(e){const t=this._client,n=r.getSdkMetadataForEnvelopeHeader(t.getSdkMetadata?.()),i=t.getDsn(),a=t.getOptions().tunnel,o=r.createEnvelope({event_id:r.uuid4(),sent_at:(new Date).toISOString(),...n&&{sdk:n},...!!a&&i&&{dsn:r.dsnToString(i)}},[[{type:"profile_chunk",platform:"javascript"},e]]);t.sendEnvelope(o).then(null,(e=>{s.DEBUG_BUILD&&r.debug.error("Error while sending profile chunk envelope:",e)}))}}},55232(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(63020),s=n(43471);const i={startProfiler:function(){const e=r.getClient();if(!e)return void(s.DEBUG_BUILD&&r.debug.warn("No Sentry client available, profiling is not started"));e.getIntegrationByName("BrowserProfiling")?e.emit("startUIProfiler"):s.DEBUG_BUILD&&r.debug.warn("BrowserProfiling integration is not available")},stopProfiler:function(){const e=r.getClient();if(!e)return void(s.DEBUG_BUILD&&r.debug.warn("No Sentry client available, profiling is not started"));e.getIntegrationByName("BrowserProfiling")?e.emit("stopUIProfiler"):s.DEBUG_BUILD&&r.debug.warn("ProfilingIntegration is not available")}};t.uiProfiler=i},88078(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(63020),s=n(43471),i=n(44572),a=n(86624),o=n(1773),l=n(81625),c=r.defineIntegration((()=>({name:"BrowserProfiling",setup(e){const t=e.getOptions(),n=new o.UIProfiler;if(l.hasLegacyProfiling(t)||t.profileLifecycle||(t.profileLifecycle="manual"),l.hasLegacyProfiling(t)&&!t.profilesSampleRate)return void(s.DEBUG_BUILD&&r.debug.log("[Profiling] Profiling disabled, no profiling options found."));const c=r.getActiveSpan(),u=c&&r.getRootSpan(c);if(l.hasLegacyProfiling(t)&&void 0!==t.profileSessionSampleRate&&s.DEBUG_BUILD&&r.debug.warn("[Profiling] Both legacy profiling (`profilesSampleRate`) and UI profiling settings are defined. `profileSessionSampleRate` has no effect when legacy profiling is enabled."),l.hasLegacyProfiling(t))u&&l.isAutomatedPageLoadSpan(u)&&l.shouldProfileSpanLegacy(u)&&a.startProfileForSpan(u),e.on("spanStart",(e=>{const t=r.getRootSpan(e);e===t?l.shouldProfileSpanLegacy(e)&&a.startProfileForSpan(e):l.PROFILED_ROOT_SPANS.has(t)&&l.setThreadAttributes(e)})),e.on("beforeEnvelope",(e=>{if(!l.getActiveProfilesCount())return;const t=l.findProfiledTransactionsFromEnvelope(e);if(!t.length)return;const n=[];for(const e of t){const t=e?.contexts,i=t?.profile?.profile_id,a=t?.profile?.start_timestamp;if("string"!=typeof i){s.DEBUG_BUILD&&r.debug.log("[Profiling] cannot find profile for a span without a profile context");continue}if(!i){s.DEBUG_BUILD&&r.debug.log("[Profiling] cannot find profile for a span without a profile context");continue}t?.profile&&delete t.profile;const o=l.takeProfileFromGlobalCache(i);if(!o){s.DEBUG_BUILD&&r.debug.log(`[Profiling] Could not retrieve profile for span: ${i}`);continue}const c=l.createProfilingEvent(i,a,o,e);c&&n.push(c)}l.addProfilesToEnvelope(e,n)}));else{const a=t.profileLifecycle;if(e.on("startUIProfiler",(()=>n.start())),e.on("stopUIProfiler",(()=>n.stop())),"manual"===a)n.initialize(e);else if("trace"===a){if(!r.hasSpansEnabled(t))return void(s.DEBUG_BUILD&&r.debug.warn("[Profiling] `profileLifecycle` is 'trace' but tracing is disabled. Set a `tracesSampleRate` or `tracesSampler` to enable span tracing."));n.initialize(e),u&&n.notifyRootSpanActive(u),i.WINDOW.setTimeout((()=>{const e=r.getActiveSpan(),t=e&&r.getRootSpan(e);t&&n.notifyRootSpanActive(t)}),0)}}}})));t.browserProfilingIntegration=c},86624(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(63020),s=n(43471),i=n(44572),a=n(81625);t.startProfileForSpan=function(e){let t;a.isAutomatedPageLoadSpan(e)&&(t=1e3*r.timestampInSeconds());const n=a.startJSSelfProfile();if(!n)return;s.DEBUG_BUILD&&r.debug.log(`[Profiling] started profiling span: ${r.spanToJSON(e).description}`);const o=r.uuid4();let l=null;async function c(){if(e&&n){if(!l)return n.stop().then((t=>{u&&(i.WINDOW.clearTimeout(u),u=void 0),s.DEBUG_BUILD&&r.debug.log(`[Profiling] stopped profiling of span: ${r.spanToJSON(e).description}`),t?(l=t,a.addProfileToGlobalCache(o,t)):s.DEBUG_BUILD&&r.debug.log(`[Profiling] profiler returned null profile for: ${r.spanToJSON(e).description}`,"this may indicate an overlapping span or a call to stopProfiling with a profile title that was never started")})).catch((e=>{s.DEBUG_BUILD&&r.debug.log("[Profiling] error while stopping profiler:",e)}));s.DEBUG_BUILD&&r.debug.log("[Profiling] profile for:",r.spanToJSON(e).description,"already exists, returning early")}}r.getCurrentScope().setContext("profile",{profile_id:o,start_timestamp:t}),a.PROFILED_ROOT_SPANS.add(e),a.setThreadAttributes(e);let u=i.WINDOW.setTimeout((()=>{s.DEBUG_BUILD&&r.debug.log("[Profiling] max profile duration elapsed, stopping profiling for:",r.spanToJSON(e).description),c()}),a.MAX_PROFILE_DURATION_MS);const d=e.end.bind(e);e.end=function(){return e?(c().then((()=>{d()}),(()=>{d()})),e):d()}}},81625(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(63020),s=n(43471),i=n(44572),a=1e6,o="window"in r.GLOBAL_OBJ&&r.GLOBAL_OBJ.window===r.GLOBAL_OBJ&&"undefined"==typeof importScripts,l=String(0),c=o?"main":"worker",u=i.WINDOW.navigator;let d="",h="",f="",p=u?.userAgent||"",g="";
1const m=u?.language||u?.languages?.[0]||"";const _=u?.userAgentData;var T;function E(e){return function(e){return!("thread_metadata"in e)}(e)?S(e):e}function y(e,t,n,a){if("transaction"!==a.type)throw new TypeError("Profiling events may only be attached to transactions, this should never occur.");if(null==n)throw new TypeError(`Cannot construct profiling event envelope without a valid profile. Got ${n} instead.`);const o=function(e){const t=e.contexts?.trace?.trace_id;return"string"==typeof t&&32!==t.length&&s.DEBUG_BUILD&&r.debug.log(`[Profiling] Invalid traceId: ${t} on profiled event`),"string"!=typeof t?"":t}(a),c=E(n),u=t||("number"==typeof a.start_timestamp?1e3*a.start_timestamp:1e3*r.timestampInSeconds()),_="number"==typeof a.timestamp?1e3*a.timestamp:1e3*r.timestampInSeconds();return{event_id:e,timestamp:new Date(u).toISOString(),platform:"javascript",version:"1",release:a.release||"",environment:a.environment||r.DEFAULT_ENVIRONMENT,runtime:{name:"javascript",version:i.WINDOW.navigator.userAgent},os:{name:d,version:h,build_number:p},device:{locale:m,model:g,manufacturer:p,architecture:f,is_emulator:!1},debug_meta:{images:v(n.resources)},profile:c,transactions:[{name:a.transaction||"",id:a.event_id||r.uuid4(),trace_id:o,active_thread_id:l,relative_start_ns:"0",relative_end_ns:(1e6*(_-u)).toFixed(0)}]}}function S(e){let t,n=0;const s={samples:[],stacks:[],frames:[],thread_metadata:{[l]:{name:c}}},i=e.samples[0];if(!i)return s;const o=i.timestamp,u=r.browserPerformanceTimeOrigin(),d="number"==typeof performance.timeOrigin?performance.timeOrigin:u||0,h=d-(u||d);return e.samples.forEach(((r,i)=>{if(void 0===r.stackId)return void 0===t&&(t=n,s.stacks[t]=[],n++),void(s.samples[i]={elapsed_since_start_ns:((r.timestamp+h-o)*a).toFixed(0),stack_id:t,thread_id:l});let c=e.stacks[r.stackId];const u=[];for(;c;){u.push(c.frameId);const t=e.frames[c.frameId];t&&void 0===s.frames[c.frameId]&&(s.frames[c.frameId]={function:t.name,abs_path:"number"==typeof t.resourceId?e.resources[t.resourceId]:void 0,lineno:t.line,colno:t.column}),c=void 0===c.parentId?void 0:e.stacks[c.parentId]}const d={elapsed_since_start_ns:((r.timestamp+h-o)*a).toFixed(0),stack_id:n,thread_id:l};s.stacks[n]=u,s.samples[i]=d,n++})),s}function v(e){const t=r.getClient(),n=t?.getOptions(),s=n?.stackParser;return s?r.getDebugImagesForResources(s,e):[]}function b(e){return"number"!=typeof e&&"boolean"!=typeof e||"number"==typeof e&&isNaN(e)?(s.DEBUG_BUILD&&r.debug.warn(`[Profiling] Invalid sample rate. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(e)} of type ${JSON.stringify(typeof e)}.`),!1):!0===e||!1===e||(!(e<0||e>1)||(s.DEBUG_BUILD&&r.debug.warn(`[Profiling] Invalid sample rate. Sample rate must be between 0 and 1. Got ${e}.`),!1))}"object"==typeof(T=_)&&null!==T&&"getHighEntropyValues"in T&&_.getHighEntropyValues(["architecture","model","platform","platformVersion","fullVersionList"]).then((e=>{if(d=e.platform||"",f=e.architecture||"",g=e.model||"",h=e.platformVersion||"",e.fullVersionList?.length){const t=e.fullVersionList[e.fullVersionList.length-1];p=`${t.brand} ${t.version}`}})).catch((e=>{}));let I=!1;const A=new Map;const R=new WeakSet;t.MAX_PROFILE_DURATION_MS=3e4,t.PROFILED_ROOT_SPANS=R,t.PROFILER_THREAD_ID_STRING=l,t.PROFILER_THREAD_NAME=c,t.addProfileToGlobalCache=function(e,t){if(A.set(e,t),A.size>30){const e=A.keys().next().value;void 0!==e&&A.delete(e)}},t.addProfilesToEnvelope=function(e,t){if(!t.length)return e;for(const n of t)e[1].push([{type:"profile"},n]);return e},t.applyDebugMetadata=v,t.convertJSSelfProfileToSampledFormat=S,t.createProfileChunkPayload=function(e,t,n){if(null==e)throw new TypeError(`Cannot construct profiling event envelope without a valid profile. Got ${e} instead.`);const s=function(e){const t=[];for(let n=0;n<e.frames.length;n++){const r=e.frames[n];r&&(t[n]={function:r.name,abs_path:"number"==typeof r.resourceId?e.resources[r.resourceId]:void 0,lineno:r.line,colno:r.column})}const n=[];for(let t=0;t<e.stacks.length;t++){const r=e.stacks[t];if(!r)continue;const s=[];let i=r;for(;i;)s.push(i.frameId),i=void 0===i.parentId?void 0:e.stacks[i.parentId];n[t]=s}const s=r.browserPerformanceTimeOrigin(),i="number"==typeof performance.timeOrigin?performance.timeOrigin:s||0,a=i-(s||i),o=[];for(let t=0;t<e.samples.length;t++){const n=e.samples[t];if(!n)continue;const r=(i+(n.timestamp-a))/1e3;o[t]={stack_id:n.stackId??0,thread_id:l,timestamp:r}}return{frames:t,stacks:n,samples:o,thread_metadata:{[l]:{name:c}}}}(e),i=t.getOptions(),a=t.getSdkMetadata?.()?.sdk;return{chunk_id:r.uuid4(),client_sdk:{name:a?.name??"sentry.javascript.browser",version:a?.version??"0.0.0"},profiler_id:n||r.uuid4(),platform:"javascript",version:"2",release:i.release??"",environment:i.environment??"production",debug_meta:{images:v(e.resources)},profile:s}},t.createProfilePayload=y,t.createProfilingEvent=function(e,t,n,i){return function(e){return e.samples.length<2?(s.DEBUG_BUILD&&r.debug.log("[Profiling] Discarding profile because it c
1ontains less than 2 samples"),!1):!!e.frames.length||(s.DEBUG_BUILD&&r.debug.log("[Profiling] Discarding profile because it contains no frames"),!1)}(n)?y(e,t,n,i):null},t.enrichWithThreadInformation=E,t.findProfiledTransactionsFromEnvelope=function(e){const t=[];return r.forEachEnvelopeItem(e,((e,n)=>{if("transaction"===n)for(let n=1;n<e.length;n++){const r=e[n];r?.contexts?.profile?.profile_id&&t.push(e[n])}})),t},t.getActiveProfilesCount=function(){return A.size},t.hasLegacyProfiling=function(e){return void 0!==e.profilesSampleRate},t.isAutomatedPageLoadSpan=function(e){return"pageload"===r.spanToJSON(e).op},t.isValidSampleRate=b,t.setThreadAttributes=function(e){e.setAttribute("thread.id",l),e.setAttribute("thread.name",c)},t.shouldProfileSession=function(e){if(I)return s.DEBUG_BUILD&&r.debug.log("[Profiling] Profiling has been disabled for the duration of the current user session as the JS Profiler could not be started."),!1;if("trace"!==e.profileLifecycle&&"manual"!==e.profileLifecycle)return s.DEBUG_BUILD&&r.debug.warn("[Profiling] Session not sampled. Invalid `profileLifecycle` option."),!1;const t=e.profileSessionSampleRate;return b(t)?t?Math.random()<=t:(s.DEBUG_BUILD&&r.debug.log("[Profiling] Discarding profile because profileSessionSampleRate is not defined or set to 0"),!1):(s.DEBUG_BUILD&&r.debug.warn("[Profiling] Discarding profile because of invalid profileSessionSampleRate."),!1)},t.shouldProfileSpanLegacy=function(e){if(I)return s.DEBUG_BUILD&&r.debug.log("[Profiling] Profiling has been disabled for the duration of the current user session."),!1;if(!e.isRecording())return s.DEBUG_BUILD&&r.debug.log("[Profiling] Discarding profile because root span was not sampled."),!1;const t=r.getClient(),n=t?.getOptions();if(!n)return s.DEBUG_BUILD&&r.debug.log("[Profiling] Profiling disabled, no options found."),!1;const i=n.profilesSampleRate;return b(i)?i?!!(!0===i||Math.random()<i)||(s.DEBUG_BUILD&&r.debug.log(`[Profiling] Discarding profile because it's not included in the random sample (sampling rate = ${Number(i)})`),!1):(s.DEBUG_BUILD&&r.debug.log("[Profiling] Discarding profile because a negative sampling decision was inherited or profileSampleRate is set to 0"),!1):(s.DEBUG_BUILD&&r.debug.warn("[Profiling] Discarding profile because of invalid sample rate."),!1)},t.startJSSelfProfile=function(){const e=i.WINDOW.Profiler;if("function"!=typeof e)return void(s.DEBUG_BUILD&&r.debug.log("[Profiling] Profiling is not supported by this browser, Profiler interface missing on window object."));const t=Math.floor(3e3);try{return new e({sampleInterval:10,maxBufferSize:t})}catch(e){s.DEBUG_BUILD&&(r.debug.log("[Profiling] Failed to initialize the Profiling constructor, this is likely due to a missing 'Document-Policy': 'js-profiling' header."),r.debug.log("[Profiling] Disabling profiling for current user session.")),I=!0}},t.takeProfileFromGlobalCache=function(e){const t=A.get(e);return t&&A.delete(e),t},t.validateProfileChunk=function(e){try{if(!e||"object"!=typeof e)return{reason:"chunk is not an object"};const t=e=>"string"==typeof e&&/^[a-f0-9]{32}$/.test(e);if(!t(e.profiler_id))return{reason:"missing or invalid profiler_id"};if(!t(e.chunk_id))return{reason:"missing or invalid chunk_id"};if(!e.client_sdk)return{reason:"missing client_sdk metadata"};const n=e.profile;return n?Array.isArray(n.frames)&&n.frames.length?Array.isArray(n.stacks)&&n.stacks.length?Array.isArray(n.samples)&&n.samples.length?{valid:!0}:{reason:"profile has no samples"}:{reason:"profile has no stacks"}:{reason:"profile has no frames"}:{reason:"missing profile data"}}catch(e){return{reason:`unknown validation error: ${e}`}}}},36376(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(63020),s=n(43471),i=n(44572);t.showReportDialog=function(e={}){const t=i.WINDOW.document,n=t?.head||t?.body;if(!n)return void(s.DEBUG_BUILD&&r.debug.error("[showReportDialog] Global document not defined"));const a=r.getCurrentScope(),o=r.getClient(),l=o?.getDsn();if(!l)return void(s.DEBUG_BUILD&&r.debug.error("[showReportDialog] DSN not configured"));const c={...e,user:{...a.getUser(),...e.user},eventId:e.eventId||r.lastEventId()},u=i.WINDOW.document.createElement("script");u.async=!0,u.crossOrigin="anonymous",u.src=r.getReportDialogEndpoint(l,c);const{onLoad:d,onClose:h}=c;if(d&&(u.onload=d),h){const e=t=>{if("__sentry_reportdialog_closed__"===t.data)try{h()}finally{i.WINDOW.removeEventListener("message",e)}};i.WINDOW.addEventListener("message",e)}n.appendChild(u)}},79949(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(63020),s=n(44186),i=n(9239),a=n(87698),o=n(77833),l=n(40639),c=n(15331),u=n(48290),d=n(50011),h=(n(20941),n(10120)),f=n(34260),p=n(40845);function g(e){return[r.inboundFiltersIntegration(),r.functionToStringIntegration(),r.conversationIdIntegration(),a.browserApiErrorsIntegration(),i.breadcrumbsIntegration(),c.globalHandlersIntegration(),d.linkedErrorsIntegration(),r.dedupeIntegration(),u.httpContextIntegration(),l.cultureContextIntegration(),o.browserSessionIntegration()]}t.forceLoad=function(){},t.getDefaultIntegrations=g,t.init=function(e={}){const t=!e.skipBrowserExtensionCheck&&p.checkAndWarnIfIsEmbeddedBrowserExtension();let n=null==e.defaultIntegrations?g():e.defaultIntegrations;const i={...e,enabled:!t&&e.enabled,stackParser:r.stackParserFromStackParserOptions(e.stackParser||h.defaultStackParser),integrations:r.getIntegrationsToSetup({integrations:e.integrations,defaultIntegrations:n}),transport:e.transport||f.makeFetchTransport};return r.initAndBind(s.BrowserClient,i)},t.onLoad=function(e){e()}},10120(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(63020);function s(e,t,n,s){const i={filename:e,function:"<anonymous>"===t?r.UNKNOWN_FUNCTION:t,in_app:!0};return void 0!==n&&(i.lineno=n),void 0!==s&&(i.colno=s),i}
1const i=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,a=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,o=/\((\S*)(?::(\d+))(?::(\d+))\)/,l=/at (.+?) ?\(data:(.+?),/,c=[30,e=>{const t=e.match(l);if(t)return{filename:`<data:${t[2]}>`,function:t[1]};const n=i.exec(e);if(n){const[,e,t,i]=n;return s(e,r.UNKNOWN_FUNCTION,+t,+i)}const c=a.exec(e);if(c){if(0===c[2]?.indexOf("eval")){const e=o.exec(c[2]);e&&(c[2]=e[1],c[3]=e[2],c[4]=e[3])}const[e,t]=S(c[1]||r.UNKNOWN_FUNCTION,c[2]);return s(t,e,c[3]?+c[3]:void 0,c[4]?+c[4]:void 0)}}],u=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,d=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,h=[50,e=>{const t=u.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){const e=d.exec(t[3]);e&&(t[1]=t[1]||"eval",t[3]=e[1],t[4]=e[2],t[5]="")}let e=t[3],n=t[1]||r.UNKNOWN_FUNCTION;return[n,e]=S(n,e),s(e,n,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}}],f=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:[-a-z]+):.*?):(\d+)(?::(\d+))?\)?\s*$/i,p=[40,e=>{const t=f.exec(e);return t?s(t[2],t[1]||r.UNKNOWN_FUNCTION,+t[3],t[4]?+t[4]:void 0):void 0}],g=/ line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i,m=[10,e=>{const t=g.exec(e);return t?s(t[2],t[3]||r.UNKNOWN_FUNCTION,+t[1]):void 0}],_=/ line (\d+), column (\d+)\s*(?:in (?:<anonymous function: ([^>]+)>|([^)]+))\(.*\))? in (.*):\s*$/i,T=[20,e=>{const t=_.exec(e);return t?s(t[5],t[3]||t[4]||r.UNKNOWN_FUNCTION,+t[1],+t[2]):void 0}],E=[c,h],y=r.createStackParser(...E),S=(e,t)=>{const n=-1!==e.indexOf("safari-extension"),s=-1!==e.indexOf("safari-web-extension");return n||s?[-1!==e.indexOf("@")?e.split("@")[0]:r.UNKNOWN_FUNCTION,n?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]};t.chromeStackLineParser=c,t.defaultStackLineParsers=E,t.defaultStackParser=y,t.geckoStackLineParser=h,t.opera10StackLineParser=m,t.opera11StackLineParser=T,t.winjsStackLineParser=p},77555(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(63020),s=n(43471),i=n(44572);t.registerBackgroundTabDetection=function(){i.WINDOW.document?i.WINDOW.document.addEventListener("visibilitychange",(()=>{const e=r.getActiveSpan();if(!e)return;const t=r.getRootSpan(e);if(i.WINDOW.document.hidden&&t){const e="cancelled",{op:n,status:i}=r.spanToJSON(t);s.DEBUG_BUILD&&r.debug.log(`[Tracing] Transaction: ${e} -> since tab moved to the background, op: ${n}`),i||t.setStatus({code:r.SPAN_STATUS_ERROR,message:e}),t.setAttribute("sentry.cancellation_reason","document.hidden"),t.end()}})):s.DEBUG_BUILD&&r.debug.warn("[Tracing] Could not set up background tab detection due to lack of global document")}},19228(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(63020),s=n(81015),i=n(43471),a=n(44572),o=n(77555),l=n(27737),c=n(39917),u="BrowserTracing",d=/Googlebot|Google-InspectionTool|Storebot-Google|Bingbot|Slurp|DuckDuckBot|Baiduspider|YandexBot|Facebot|facebookexternalhit|LinkedInBot|Twitterbot|Applebot/i;function h(){const e=a.WINDOW.navigator;return!!e?.userAgent&&d.test(e.userAgent)}const f={...r.TRACING_DEFAULTS,instrumentNavigation:!0,instrumentPageLoad:!0,markBackgroundSpan:!0,enableLongTask:!0,enableLongAnimationFrame:!0,enableInp:!0,ignoreResourceSpans:[],ignorePerformanceApiSpans:[],detectRedirects:!0,linkPreviousTrace:"in-memory",consistentTraceSampling:!1,enableReportPageLoaded:!1,_experiments:{},...c.defaultRequestInstrumentationOptions};function p(e,t,n){e.emit("startPageLoadSpan",t,n),r.getCurrentScope().setTransactionName(t.name);const s=E(e);return s&&e.emit("afterStartPageLoadSpan",s),s}function g(e,t,n){const{url:s,isRedirect:i}=n||{};e.emit("beforeStartNavigationSpan",t,{isRedirect:i}),e.emit("startNavigationSpan",t,{isRedirect:i});const o=r.getCurrentScope();return o.setTransactionName(t.name),s&&!i&&o.setSDKProcessingMetadata({normalizedRequest:{...a.getHttpRequestData(),url:s}}),E(e)}function m(e){const t=a.WINDOW.document,n=t?.querySelector(`meta[name=${e}]`);return n?.getAttribute("content")||void 0}function _(e){const t=a.WINDOW.performance?.getEntriesByType?.("navigation")[0],n=t?.serverTiming?.find((t=>t.name===e));return n?.description}const T="_sentry_idleSpan";function E(e){return e[T]}function y(e,t){r.addNonEnumerableProperty(e,T,t)}const S=1.5;t.BROWSER_TRACING_INTEGRATION_ID=u,t.browserTracingIntegration=(e={})=>{"enableElementTiming"in e&&r.consoleSandbox((()=>{console.warn("[Sentry] `enableElementTiming` is deprecated and no longer has any effect. Use the standalone `elementTimingIntegration` instead.")}));const t={name:void 0,source:void 0},n=a.WINDOW.document,{enableInp:d,enableLongTask:T,enableLongAnimationFrame:v,_experiments:{enableInteractions:b,enableStandaloneClsSpans:I,enableStandaloneLcpSpans:A},beforeStartSpan:R,idleTimeout:C,finalTimeout:k,childSpanTimeout:L,markBackgroun
1dSpan:O,traceFetch:N,traceXHR:w,trackFetchStreamPerformance:P,shouldCreateSpanForRequest:M,enableHTTPTimings:D,ignoreResourceSpans:x,ignorePerformanceApiSpans:U,instrumentPageLoad:B,instrumentNavigation:F,detectRedirects:$,linkPreviousTrace:G,consistentTraceSampling:H,enableReportPageLoaded:j,onRequestSpanStart:W,onRequestSpanEnd:K}={...f,...e},V=h();let q,Y,z;function J(e,i,a=!0){const o="pageload"===i.op,l=i.name,c=R?R(i):i,u=c.attributes||{};if(l!==c.name&&(u[r.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]="custom",c.attributes=u),!a){const e=r.dateTimestampInSeconds();return void r.startInactiveSpan({...c,startTime:e}).end(e)}t.name=c.name,t.source=u[r.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE];const d=r.startIdleSpan(c,{idleTimeout:C,finalTimeout:k,childSpanTimeout:L,disableAutoFinish:o,beforeSpanEnd:t=>{q?.();const n=r.hasSpanStreamingEnabled(e);s.addPerformanceEntries(t,{recordClsOnPageloadSpan:!n&&!I,recordLcpOnPageloadSpan:!n&&!A,ignoreResourceSpans:x,ignorePerformanceApiSpans:U,spanStreamingEnabled:n}),y(e,void 0);const i=r.getCurrentScope(),a=i.getPropagationContext();i.setPropagationContext({...a,traceId:d.spanContext().traceId,sampled:r.spanIsSampled(d),dsc:r.getDynamicSamplingContextFromSpan(t)}),o&&(z=void 0)},trimIdleSpanEndTimestamp:!j});function h(){n&&["interactive","complete"].includes(n.readyState)&&e.emit("idleSpanEnableAutoFinish",d)}o&&j&&(z=d),y(e,d),o&&!j&&n&&(n.addEventListener("readystatechange",(()=>{h()})),h())}return{name:u,setup(e){if(V)return void(i.DEBUG_BUILD&&r.debug.log("[Tracing] Skipping browserTracingIntegration setup for bot user agent."));r.registerSpanErrorInstrumentation();const t=r.hasSpanStreamingEnabled(e);if(q=s.startTrackingWebVitals({recordClsStandaloneSpans:t?void 0:I||!1,recordLcpStandaloneSpans:t?void 0:A||!1,client:e}),t?(s.trackLcpAsSpan(e),s.trackClsAsSpan(e),d&&s.trackInpAsSpan()):d&&s.startTrackingINP(),v&&r.GLOBAL_OBJ.PerformanceObserver&&PerformanceObserver.supportedEntryTypes?.includes("long-animation-frame")?s.startTrackingLongAnimationFrames():T&&s.startTrackingLongTasks(),b&&s.startTrackingInteractions(),$&&n){const e=()=>{Y=r.timestampInSeconds()};addEventListener("click",e,{capture:!0}),addEventListener("keydown",e,{capture:!0,passive:!0})}function o(){const t=E(e);t&&!r.spanToJSON(t).timestamp&&(i.DEBUG_BUILD&&r.debug.log(`[Tracing] Finishing current active span with op: ${r.spanToJSON(t).op}`),t.setAttribute(r.SEMANTIC_ATTRIBUTE_SENTRY_IDLE_SPAN_FINISH_REASON,"cancelled"),t.end())}e.on("startNavigationSpan",((t,n)=>{if(r.getClient()!==e)return;if(n?.isRedirect)return i.DEBUG_BUILD&&r.debug.warn("[Tracing] Detected redirect, navigation span will not be the root span, but a child span."),void J(e,{op:"navigation.redirect",...t},!1);Y=void 0,o(),r.getIsolationScope().setPropagationContext({traceId:r.generateTraceId(),sampleRand:Math.random(),propagationSpanId:r.hasSpansEnabled()?void 0:r.generateSpanId()});const s=r.getCurrentScope();s.setPropagationContext({traceId:r.generateTraceId(),sampleRand:Math.random(),propagationSpanId:r.hasSpansEnabled()?void 0:r.generateSpanId()}),s.setSDKProcessingMetadata({normalizedRequest:void 0}),J(e,{op:"navigation",...t,parentSpan:null,forceTransaction:!0})})),e.on("startPageLoadSpan",((t,n={})=>{if(r.getClient()!==e)return;o();const s=n.sentryTrace||m("sentry-trace")||_("sentry-trace"),i=n.baggage||m("baggage")||_("baggage"),l=r.propagationContextFromHeaders(s,i),c=r.getCurrentScope();c.setPropagationContext(l),r.hasSpansEnabled()||(c.getPropagationContext().propagationSpanId=r.generateSpanId()),c.setSDKProcessingMetadata({normalizedRequest:a.getHttpRequestData()}),J(e,{op:"pageload",...t})})),e.on("endPageloadSpan",(()=>{j&&z&&(z.setAttribute(r.SEMANTIC_ATTRIBUTE_SENTRY_IDLE_SPAN_FINISH_REASON,"reportPageLoaded"),z.end())}))},afterAllSetup(e){if(V)return;let n=r.getLocationHref();if("off"!==G&&l.linkTraces(e,{linkPreviousTrace:G,consistentTraceSampling:H}),a.WINDOW.location){if(B){const t=r.browserPerformanceTimeOrigin();p(e,{name:a.WINDOW.location.pathname,startTime:t?t/1e3:void 0,attributes:{[r.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]:"url",[r.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]:"auto.pageload.browser"}})}F&&s.addHistoryInstrumentationHandler((({to:t,from:s})=>{if(void 0===s&&-1!==n?.indexOf(t))return void(n=void 0);n=void 0;const i=r.parseStringToURLObject(t),o=E(e),l=o&&$&&function(e,t){const n=r.spanToJSON(e),s=r.dateTimestampInSeconds(),i=n.start_timestamp;if(s-i>S)return!1;if(t&&s-t<=S)return!1;return!0}(o,Y);g(e,{name:i?.pathname||a.WINDOW.location.pathname,attributes:{[r.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]:"url",[r.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]:"auto.navigation.browser"}},{url:t,isRedirect:l})}))}
1O&&o.registerBackgroundTabDetection(),b&&function(e,t,n,s,o){const l=a.WINDOW.document;let c;const u=()=>{const a="ui.action.click",l=E(e);if(l){const e=r.spanToJSON(l).op;if(["navigation","pageload"].includes(e))return void(i.DEBUG_BUILD&&r.debug.warn(`[Tracing] Did not create ${a} span because a pageload or navigation span is in progress.`))}c&&(c.setAttribute(r.SEMANTIC_ATTRIBUTE_SENTRY_IDLE_SPAN_FINISH_REASON,"interactionInterrupted"),c.end(),c=void 0),o.name?c=r.startIdleSpan({name:o.name,op:a,attributes:{[r.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]:o.source||"url"}},{idleTimeout:t,finalTimeout:n,childSpanTimeout:s}):i.DEBUG_BUILD&&r.debug.warn(`[Tracing] Did not create ${a} transaction because _latestRouteName is missing.`)};l&&addEventListener("click",u,{capture:!0})}(e,C,k,L,t),d&&s.registerInpInteractionListener(),c.instrumentOutgoingRequests(e,{traceFetch:N,traceXHR:w,trackFetchStreamPerformance:P,tracePropagationTargets:e.getOptions().tracePropagationTargets,shouldCreateSpanForRequest:M,enableHTTPTimings:D,onRequestSpanStart:W,onRequestSpanEnd:K})}}},t.getMetaContent=m,t.getServerTiming=_,t.isBotUserAgent=h,t.startBrowserTracingNavigationSpan=g,t.startBrowserTracingPageLoadSpan=p},27737(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(63020),s=n(43471),i=n(44572);n(81015),n(10120),n(9239),n(87698),n(77833),n(40639),n(15331),n(48290),n(50011),n(20941);const a="sentry_previous_trace",o="sentry.previous_trace";function l(e,t,n){const i=r.spanToJSON(t);const a={spanContext:t.spanContext(),startTimestamp:i.start_timestamp,sampleRate:function(){try{return Number(n.dsc?.sample_rate)??Number(i.data?.[r.SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE])}catch{return 0}}(),sampleRand:n.sampleRand};if(!e)return a;const l=e.spanContext;return l.traceId===i.trace_id?e:(Date.now()/1e3-e.startTimestamp<=3600&&(s.DEBUG_BUILD&&r.debug.log(`Adding previous_trace \`${JSON.stringify(l)}\` link to span \`${JSON.stringify({op:i.op,...t.spanContext()})}\``),t.addLink({context:l,attributes:{[r.SEMANTIC_LINK_ATTRIBUTE_LINK_TYPE]:"previous_trace"}}),t.setAttribute(o,`${l.traceId}-${l.spanId}-${d(l)?1:0}`)),a)}function c(e){try{i.WINDOW.sessionStorage.setItem(a,JSON.stringify(e))}catch(e){s.DEBUG_BUILD&&r.debug.warn("Could not store previous trace in sessionStorage",e)}}function u(){try{const e=i.WINDOW.sessionStorage?.getItem(a);return JSON.parse(e)}catch{return}}function d(e){return 1===e.traceFlags}t.PREVIOUS_TRACE_KEY=a,t.PREVIOUS_TRACE_MAX_DURATION=3600,t.PREVIOUS_TRACE_TMP_SPAN_ATTRIBUTE=o,t.addPreviousTraceSpanLink=l,t.getPreviousTraceFromSessionStorage=u,t.linkTraces=function(e,{linkPreviousTrace:t,consistentTraceSampling:n}){const s="session-storage"===t;let i=s?u():void 0;e.on("spanStart",(e=>{if(r.getRootSpan(e)!==e)return;const t=r.getCurrentScope().getPropagationContext();i=l(i,e,t),s&&c(i)}));let a=!0;n&&e.on("beforeSampling",(e=>{if(!i)return;const t=r.getCurrentScope(),n=t.getPropagationContext();a&&n.parentSpanId?a=!1:(t.setPropagationContext({...n,dsc:{...n.dsc,sample_rate:String(i.sampleRate),sampled:String(d(i.spanContext))},sampleRand:i.sampleRand}),e.parentSampled=d(i.spanContext),e.parentSampleRate=i.sampleRate,e.spanAttributes={...e.spanAttributes,[r.SEMANTIC_ATTRIBUTE_SENTRY_PREVIOUS_TRACE_SAMPLE_RATE]:i.sampleRate})}))},t.spanContextSampled=d,t.storePreviousTraceInSessionStorage=c},69982(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(63020);t.reportPageLoaded=function(e=r.getClient()){e?.emit("endPageloadSpan")}},39917(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(63020),s=n(81015),i=n(37337),a=new WeakMap,o=new Map,l={traceFetch:!0,traceXHR:!0,enableHTTPTimings:!0,trackFetchStreamPerformance:!1};function c(e,t){const{url:n}=r.spanToJSON(e).data;if(!n||"string"!=typeof n)return;let a=()=>{setTimeout(o)};if(r.hasSpanStreamingEnabled(t)){const t=e.end.bind(e);e.end=e=>{const n=e??r.timestampInSeconds();let s=!1;const i=()=>{s||(s=!0,setTimeout(o),t(n),clearTimeout(l))};a=i;const l=setTimeout(i,300)}}const o=s.addPerformanceInstrumentationHandler("resource",(({entries:t})=>{t.forEach((t=>{i.isPerformanceResourceTiming(t)&&t.name.endsWith(n)&&(e.setAttributes(s.resourceTimingToSpanAttributes(t)),a())}))}))}function u(e,t){const n=r.getLocationHref();if(n){let s,i;try{s=new URL(e,n),i=new URL(n).origin}catch{return!1}const a=s.origin===i;return t?r.stringMatchesSomePattern(s.toString(),t)||a&&r.stringMatchesSomePattern(s.pathname,t):a}{const n=!!e.match(/^\/(?!\/)/);return t?r.stringMatchesSomePattern(e,t):n}}t.defaultRequestInstrumentationOptions=l,t.instrumentOutgoingRequests=function(e,t){const{traceFetch:n,traceXHR:d,trackFetchStreamPerformance:h,shouldCreateSpanForRequest:f,enableHTTPTimings:p,tracePropagationTargets:g,onRequestSpanStart:m,onRequestSpanEnd:_}={...l,...t},T="function"==typeof f?f:e=>!0,E=e=>u(e,g),y={},S=e.getOptions().propagateTraceparent;n&&(e.addEventProcessor((e=>("transaction"===e.type&&e.spans&&e.spans.forEach((e=>{if("http.client"===e.op){const t=o.get(e.span_id);t&&(e.timestamp=t/1e3,o.delete(e.span_id))}})),e))),h&&r.addFetchEndInstrumentationHandler((e=>{if(e.response){const t=a.get(e.response);t&&e.endTimestamp&&o.set(t,e.endTimestamp)}})),r.addFetchInstrumentationHandler((t=>
1{const n=r.instrumentFetchRequest(t,T,E,y,{propagateTraceparent:S,onRequestSpanEnd:_});if(t.response&&t.fetchData.__span&&a.set(t.response,t.fetchData.__span),n){const s=i.getFullURL(t.fetchData.url),a=s?r.parseUrl(s).host:void 0;n.setAttributes({"http.url":s?r.stripDataUrlContent(s):void 0,"server.address":a}),p&&c(n,e),m?.(n,{headers:t.headers})}}))),d&&s.addXhrInstrumentationHandler((t=>{const n=function(e,t,n,a,o,l){const c=e.xhr,u=c?.[s.SENTRY_XHR_DATA_KEY];if(!c||c.__sentry_own_request__||!u)return;const{url:d,method:h}=u,f=r.hasSpansEnabled()&&t(d);if(e.endTimestamp){const t=c.__sentry_xhr_span_id__;if(!t)return;const n=a[t];return void(n&&(f&&void 0!==u.status_code&&(r.setHttpStatus(n,u.status_code),n.end(),l?.(n,{headers:i.createHeadersSafely(s.parseXhrResponseHeaders(c)),error:e.error})),delete a[t]))}const p=i.getFullURL(d),g=p?r.parseUrl(p):r.parseUrl(d),m=r.stripDataUrlContent(r.stripUrlQueryAndFragment(d)),_=r.getClient(),T=!!r.getActiveSpan()||!!_&&r.hasSpanStreamingEnabled(_),E=f&&T?r.startInactiveSpan({name:`${h} ${m}`,attributes:{url:r.stripDataUrlContent(d),type:"xhr","http.method":h,"http.url":p?r.stripDataUrlContent(p):void 0,"server.address":g?.host,[r.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]:"auto.http.browser",[r.SEMANTIC_ATTRIBUTE_SENTRY_OP]:"http.client",...g?.search&&{"http.query":g?.search},...g?.hash&&{"http.fragment":g?.hash}}}):new r.SentryNonRecordingSpan;f&&!T&&_?.recordDroppedEvent("no_parent_span","span");c.__sentry_xhr_span_id__=E.spanContext().spanId,a[c.__sentry_xhr_span_id__]=E,n(d)&&function(e,t,n){const{"sentry-trace":s,baggage:a,traceparent:o}=r.getTraceData({span:t,propagateTraceparent:n});s&&function(e,t,n,r){const s=e.__sentry_xhr_v3__?.request_headers;if(s?.["sentry-trace"]||!e.setRequestHeader)return;try{if(e.setRequestHeader("sentry-trace",t),r&&!s?.traceparent&&e.setRequestHeader("traceparent",r),n){const t=s?.baggage;t&&i.baggageHeaderHasSentryValues(t)||e.setRequestHeader("baggage",n)}}catch{}}(e,s,a,o)}(c,r.hasSpansEnabled()&&T?E:void 0,o);_&&_.emit("beforeOutgoingRequestSpan",E,e);return E}(t,T,E,y,S,_);n&&(p&&c(n,e),m?.(n,{headers:i.createHeadersSafely(t.xhr.__sentry_xhr_v3__?.request_headers)}))}))},t.shouldAttachHeaders=u},37722(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(63020);t.setActiveSpanInBrowser=function(e){const t=r.getActiveSpan();if(t===e)return;const n=r.getCurrentScope();e.end=new Proxy(e.end,{apply:(e,s,i)=>
1(r._INTERNAL_setSpanForScope(n,t),Reflect.apply(e,s,i))}),r._INTERNAL_setSpanForScope(n,e)}},37337(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(44572);t.baggageHeaderHasSentryValues=function(e){return e.split(",").some((e=>e.trim().startsWith("sentry-")))},t.createHeadersSafely=function(e){try{return new Headers(e)}catch{return}},t.getFullURL=function(e){try{return new URL(e,r.WINDOW.location.origin).href}catch{return}},t.isPerformanceResourceTiming=function(e){return"resource"===e.entryType&&"initiatorType"in e&&"string"==typeof e.nextHopProtocol&&("fetch"===e.initiatorType||"xmlhttprequest"===e.initiatorType)}},34260(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(63020),s=n(81015);t.makeFetchTransport=function(e,t=s.getNativeImplementation("fetch")){let n=0,i=0;return r.createTransport(e,(async function(r){const a=r.body.length;n+=a,i++;const o={body:r.body,method:"POST",referrerPolicy:"strict-origin",headers:e.headers,keepalive:n<=6e4&&i<15,...e.fetchOptions};try{const n=await t(e.url,o);return{statusCode:n.status,headers:{"x-sentry-rate-limits":n.headers.get("X-Sentry-Rate-Limits"),"retry-after":n.headers.get("Retry-After")}}}catch(e){throw s.clearCachedImplementation("fetch"),e}finally{n-=a,i--}}),r.makePromiseBuffer(e.bufferSize||40))}},45971(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(63020),s=n(44572),i=n(34260);function a(e){return new Promise(((t,n)=>{e.oncomplete=e.onsuccess=()=>t(e.result),e.onabort=e.onerror=()=>n(e.error)}))}function o(e,t){const n=indexedDB.open(e);n.onupgradeneeded=()=>n.result.createObjectStore(t);const r=a(n);return e=>r.then((n=>e(n.transaction(t,"readwrite").objectStore(t))))}function l(e){return a(e.getAllKeys())}function c(e,t,n){return e((e=>l(e).then((r=>{if(!(r.length>=n))return e.put(t,Math.max(...r,0)+1),a(e.transaction)}))))}function u(e,t,n){return e((e=>l(e).then((r=>{if(!(r.length>=n))return e.put(t,Math.min(...r,0)-1),a(e.transaction)}))))}function d(e){return e((e=>l(e).then((t=>{const n=t[0];if(null!=n)return a(e.get(n)).then((t=>(e.delete(n),a(e.transaction).then((()=>t)))))}))))}function h(e){let t;function n(){return null==t&&(t=o(e.dbName||"sentry-offline",e.storeName||"queue")),t}return{push:async t=>{try{const s=r.serializeEnvelope(t);await c(n(),s,e.maxQueueSize||30)}catch{}},unshift:async t=>{try{const s=r.serializeEnvelope(t);await u(n(),s,e.maxQueueSize||30)}catch{}},shift:async()=>{try{const e=await d(n());if(e)return r.parseEnvelope(e)}catch{}}}}t.createStore=o,t.makeBrowserOfflineTransport=function(e=i.makeFetchTransport){return function(e){return t=>{const n=e({...t,createStore:h});return s.WINDOW.addEventListener("online",(async e=>{await n.flush()})),n}}(r.makeOfflineTransport(e))},t.push=c,t.shift=d,t.unshift=u},7589(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(63020);t.createUserFeedbackEnvelope=function(e,{metadata:t,tunnel:n,dsn:s}){const i={event_id:e.event_id,sent_at:(new Date).toISOString(),...t?.sdk&&{sdk:{name:t.sdk.name,version:t.sdk.version}},...!!n&&!!s&&{dsn:r.dsnToString(s)}},a=function(e){return[{type:"user_report"},e]}(e);return r.createEnvelope(i,[a])}},40845(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(63020),s=n(43471),i=n(44572);t.checkAndWarnIfIsEmbeddedBrowserExtension=function(){return!!function(){if(void 0===i.WINDOW.window)return!1;const e=i.WINDOW;if(e.nw)return!1;const t=e.chrome||e.browser;if(!t?.runtime?.id)return!1;const n=r.getLocationHref();return!(i.WINDOW===i.WINDOW.top&&/^(?:chrome-extension|moz-extension|ms-browser-extension|safari-web-extension):\/\//.test(n))}()&&(s.DEBUG_BUILD&&r.consoleSandbox((()=>{console.error("[Sentry] You cannot use Sentry.init() in a browser extension, see: https://docs.sentry.io/platforms/javascript/best-practices/browser-extensions/")})),!0)}},21555(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(63020),s=n(44572),i=["replayIntegration","replayCanvasIntegration","feedbackIntegration","feedbackModalIntegration","feedbackScreenshotIntegration","captureConsoleIntegration","contextLinesIntegration","linkedErrorsIntegration","dedupeIntegration","extraErrorDataIntegration","graphqlClientIntegration","httpClientIntegration","reportingObserverIntegration","rewriteFramesIntegration","browserProfilingIntegration","moduleMetadataIntegration","instrumentAnthropicAiClient","
1instrumentOpenAiClient","instrumentGoogleGenAIClient","instrumentLangGraph","createLangChainCallbackHandler","instrumentLangChainEmbeddings"],a={replayCanvasIntegration:"replay-canvas",feedbackModalIntegration:"feedback-modal",feedbackScreenshotIntegration:"feedback-screenshot"};const o=s.WINDOW;t.lazyLoadIntegration=async function(e,t){const n=i.includes(e)?function(e){return a[e]||e.replace("Integration","").toLowerCase()}(e):void 0,l=o.Sentry=o.Sentry||{};if(!n)throw new Error(`Cannot lazy load integration: ${e}`);const c=l[e];if("function"==typeof c&&!("_isShim"in c))return c;const u=function(e){const t=r.getClient(),n=t?.getOptions()?.cdnBaseUrl||"https://browser.sentry-cdn.com";return new URL(`/${r.SDK_VERSION}/${e}.min.js`,n).toString()}(n),d=s.WINDOW.document.createElement("script");d.src=u,d.crossOrigin="anonymous",d.referrerPolicy="strict-origin",t&&d.setAttribute("nonce",t);const h=new Promise(((e,t)=>{d.addEventListener("load",(()=>e())),d.addEventListener("error",t)})),f=s.WINDOW.document.currentScript,p=s.WINDOW.document.body||s.WINDOW.document.head||f?.parentElement;if(!p)throw new Error(`Could not find parent element to insert lazy-loaded ${e} script`);p.appendChild(d);try{await h}catch{throw new Error(`Error when loading integration: ${e}`)}const g=l[e];if("function"!=typeof g)throw new Error(`Could not load integration: ${e}`);return g}},85740(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(21811);function s(e){const t=e.protocol?`${e.protocol}:`:"",n=e.port?`:${e.port}`:"";return`${t}//${e.host}${n}${e.path?`/${e.path}`:""}/api/`}t.SENTRY_API_VERSION="7",t.getEnvelopeEndpointWithUrlEncodedAuth=function(e,t,n){return t||`${function(e){return`${s(e)}${e.projectId}/envelope/`}(e)}?${function(e,t){const n={sentry_version:"7"};return e.publicKey&&(n.sentry_key=e.publicKey),t&&(n.sentry_client=`${t.name}/${t.version}`),new URLSearchParams(n).toString()}(e,n)}`},t.getReportDialogEndpoint=function(e,t){const n=r.makeDsn(e);if(!n)return"";const i=`${s(n)}embed/error-page/`;let a=`dsn=${r.dsnToString(n)}`;for(const e in t)if("dsn"!==e&&"onClose"!==e)if("user"===e){const e=t.user;if(!e)continue;e.name&&(a+=`&name=${encodeURIComponent(e.name)}`),e.email&&(a+=`&email=${encodeURIComponent(e.email)}`)}else a+=`&${encodeURIComponent(e)}=${encodeURIComponent(t[e])}`;return`${i}?${a}`}},42810(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(73220),s=n(5475);t.getAsyncContextStrategy=function(e){const t=r.getSentryCarrier(e);return t.acs?t.acs:s.getStackAsyncContextStrategy()},t.setAsyncContextStrategy=function(e){const t=r.getMainCarrier();r.getSentryCarrier(t).acs=e}},5475(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(37320),s=n(69640),i=n(15470),a=n(88532),o=n(73220);class l{constructor(e,t){let n,r;n=e||new s.Scope,r=t||new s.Scope,this._stack=[{scope:n}],this._isolationScope=r}withScope(e){const t=this._pushScope();let n;try{n=e(t)}catch(e){throw this._popScope(),e}return a.isThenable(n)?i.chainAndCopyPromiseLike(n,(()=>this._popScope()),(()=>this._popScope())):(this._popScope(),n)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){const e=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:e}),e}_popScope(){return!(this._stack.length<=1)&&!!this._stack.pop()}}function c(){const e=o.getMainCarrier(),t=o.getSentryCarrier(e);return t.stack=t.stack||new l(r.getDefaultCurrentScope(),r.getDefaultIsolationScope())}function u(e){return c().withScope(e)}function d(e,t){const n=c();return n.withScope((()=>(n.getStackTop().scope=e,t(e))))}function h(e){return c().withScope((()=>e(c().getIsolationScope())))}t.AsyncContextStack=l,t.getStackAsyncContextStrategy=function(){return{withIsolationScope:h,withScope:u,withSetScope:d,withSetIsolationScope:(e,t)=>h(t),getCurrentScope:()=>c().getScope(),getIsolationScope:()=>c().getIsolationScope()}}},22147(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(88532);function s(e){return"object"==typeof e&&null!=e&&!Array.isArray(e)&&Object.keys(e).includes("value")}function i(e,t){const{value:n,unit:r}=s(e)?e:{value:e,unit:void 0},i=function(e){const t="string"==typeof e?"string":"boolean"==typeof e?"boolean":"number"!=typeof e||Number.isNaN(e)?null:Number.isInteger(e)?"integer":"double";if(t)return{value:e,type:t}}(n),a=r&&"string"==typeof r?{unit:r}:{};if(i)return{...i,...a};
1if(!t||"skip-undefined"===t&&void 0===n)return;let o="";try{o=JSON.stringify(n)??""}catch{}return{value:o,type:"string",...a}}function a(e){return"string"==typeof e?2*e.length:"boolean"==typeof e?4:"number"==typeof e?8:0}t.attributeValueToTypedAttributeValue=i,t.estimateTypedAttributesSizeInBytes=function(e){if(!e)return 0;let t=0;for(const[n,s]of Object.entries(e)){t+=2*n.length,t+=2*s.type.length,t+=2*(s.unit?.length??0);const e=s.value;Array.isArray(e)?t+=a(e[0])*e.length:r.isPrimitive(e)?t+=a(e):t+=100}return t},t.isAttributeObject=s,t.serializeAttributes=function(e,t=!1){const n={};for(const[r,s]of Object.entries(e??{})){const e=i(s,t);e&&(n[r]=e)}return n}},87990(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(49564),s=n(85110),i=n(26869),a=100;t.addBreadcrumb=function(e,t){const n=r.getClient(),o=r.getIsolationScope();if(!n)return;const{beforeBreadcrumb:l=null,maxBreadcrumbs:c=a}=n.getOptions();if(c<=0)return;const u={timestamp:i.dateTimestampInSeconds(),...e},d=l?s.consoleSandbox((()=>l(u,t))):u;null!==d&&(n.emit&&n.emit("beforeAddBreadcrumb",d,t),o.addBreadcrumb(d,c))}},63020(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(44038),s=n(64284),i=n(57011),a=n(30242),o=n(67392),l=n(15363),c=n(55908),u=n(93754),d=n(28945),h=n(79816),f=n(8346),p=n(47473),g=n(52751),m=n(30238),_=n(79183),T=n(49564),E=n(37320),y=n(42810),S=n(73220),v=n(11348),b=n(69640),I=n(51929),A=n(85740),R=n(83913),C=n(27008),k=n(64450),L=n(52256),O=n(14082),N=n(82430),w=n(52311),P=n(83412),M=n(37402),D=n(31485),x=n(60251),U=n(51228),B=n(95150),F=n(46877),$=n(76354),G=n(72979),H=n(78182),j=n(78949),W=n(54583),K=n(64865),V=n(10393),q=n(55303),Y=n(20647),z=n(78371),J=n(145),X=n(19367),Q=n(23879),Z=n(87687),ee=n(56011),te=n(42501),ne=n(87990),re=n(68360),se=n(51179),ie=n(92958),ae=n(55873),oe=n(92215),le=n(75003),ce=n(431),ue=n(41312),de=n(17536),he=n(60262),fe=n(24208),pe=n(80699),ge=n(14867),me=n(70875),_e=n(98398),Te=n(94966),Ee=n(83090),ye=n(31096),Se=n(6933),ve=n(97373),be=n(85296),Ie=n(78604),Ae=n(63717),Re=n(39320),Ce=n(19575),ke=n(61038),Le=n(67935),Oe=n(57471),Ne=n(49464),we=n(47277),Pe=n(7747),Me=n(82054),De=n(13860),xe=n(60393),Ue=n(37135),Be=n(1170),Fe=n(50162),$e=n(92579),Ge=n(13161),He=n(85526),je=n(61126),We=n(83609),Ke=n(90153),Ve=n(72833),qe=n(21811),Ye=n(69960),ze=n(73969),Je=n(83389),Xe=n(39048),Qe=n(49759),Ze=n(53551),et=n(91535),tt=n(88532),nt=n(64702),rt=n(85110),st=n(96940),it=n(88585),at=n(77765),ot=n(96159),lt=n(73155),ct=n(31901),ut=n(89499),dt=n(23513),ht=n(70561),ft=n(79721),pt=n(21148),gt=n(94486),mt=n(26869),_t=n(23336),Tt=n(81857),Et=n(99188),yt=n(64841),St=n(28119),vt=n(5684),bt=n(9635),It=n(93395),At=n(43807),Rt=n(58913),Ct=n(6102),kt=n(47274),Lt=n(36823),Ot=n(89235),Nt=n(83031),wt=n(3138),Pt=n(48937);t.registerSpanErrorInstrumentation=r.registerSpanErrorInstrumentation,t.getCapturedScopesOnSpan=s.getCapturedScopesOnSpan,t.setCapturedScopesOnSpan=s.setCapturedScopesOnSpan,t.TRACING_DEFAULTS=i.TRACING_DEFAULTS,t.startIdleSpan=i.startIdleSpan,t.SentrySpan=a.SentrySpan,t.SentryNonRecordingSpan=o.SentryNonRecordingSpan,t.SPAN_STATUS_ERROR=l.SPAN_STATUS_ERROR,t.SPAN_STATUS_OK=l.SPAN_STATUS_OK,t.SPAN_STATUS_UNSET=l.SPAN_STATUS_UNSET,t.getSpanStatusFromHttpCode=l.getSpanStatusFromHttpCode,t.setHttpStatus=l.setHttpStatus,t.SUPPRESS_TRACING_KEY=c.SUPPRESS_TRACING_KEY,t.continueTrace=c.continueTrace,t.startInactiveSpan=c.startInactiveSpan,t.startNewTrace=c.startNewTrace,t.startSpan=c.startSpan,t.startSpanManual=c.startSpanManual,t.suppressTracing=c.suppressTracing,t.withActiveSpan=c.withActiveSpan,t.getDynamicSamplingContextFromClient=u.getDynamicSamplingContextFromClient,t.getDynamicSamplingContextFromScope=u.getDynamicSamplingContextFromScope,t.getDynamicSamplingContextFromSpan=u.getDynamicSamplingContextFromSpan,t.spanToBaggageHeader=u.spanToBaggageHeader,t.setMeasurement=d.setMeasurement,t.timedEventsToMeasurements=d.timedEventsToMeasurements,t.sampleSpan=h.sampleSpan,t.logSpanEnd=f.logSpanEnd,t.logSpanStart=f.logSpanStart,t.captureSpan=p.captureSpan,t.safeSetSpanJSONAttributes=p.safeSetSpanJSONAttributes,t.GEN_AI_CONVERSATION_ID_ATTRIBUTE=g.GEN_AI_CONVERSATION_ID_ATTRIBUTE,t.SEMANTIC_ATTRIBUTE_CACHE_HIT=g.SEMANTIC_ATTRIBUTE_CACHE_HIT,t.SEMANTIC_ATTRIBUTE_CACHE_ITEM_SIZE=g.SEMANTIC_ATTRIBUTE_CACHE_ITEM_SIZE,t.SEMANTIC_ATTRIBUTE_CACHE_KEY=g.SEMANTIC_ATTRIBUTE_CACHE_KEY,t.SEMANTIC_ATTRIBUTE_EXCLUSIVE_TIME=g.SEMANTIC_ATTRIBUTE_EXCLUSIVE_TIME,t.SEMANTIC_ATTRIBUTE_HTTP_REQUEST_METHOD=g.SEMANTIC_ATTRIBUTE_HTTP_REQUEST_METHOD,t.SEMANTIC_ATTRIBUTE_PROFILE_ID=g.SEMANTIC_ATTRIBUTE_PROFILE_ID,t.SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME=g.SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME,t.SEMANTIC_ATTRIBUTE_SENTRY_ENVIRONMENT=g.SEMANTIC_ATTRIBUTE_SENTRY_ENVIRONMENT,t.SEMANTIC_ATTRIBUTE_SENTRY_IDLE_SPAN_FINISH_REASON=g.SEMANTIC_ATTRIBUTE_SENTRY_IDLE_SPAN_FINISH_REASON,t.SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_UNIT=g.SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_UNIT,t.SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_VALUE=g.SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_VALUE,t.SEMANTIC_ATTRIBUTE_SENTRY_OP=g.SEMANTIC_ATTRIBUTE_SENTRY_OP,t.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN=g.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,t.SEMANTIC_ATTRIBUTE_SENTRY_PREVIOUS_TRACE_SAMPLE_RATE=g.SEMANTIC_ATTRIBUTE_SENTRY_PREVIOUS_TRACE_SAMPLE_RATE,t.SEMANTIC_ATTRIBUTE_SENTRY_RELEASE=g.SEMANTIC_ATTRIBUTE_SENTRY_RELEASE,t.SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE=g.SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE,t.SEMANTIC_ATTRIBUTE_SENTRY_SDK_NAME=g.SEMANTIC_ATTRIBUTE_SENTRY_SDK_NAME,t.SEMANTIC_ATTRIBUTE_SENTRY_SDK_VERSION=g.SEMANTIC_ATTRIBUTE_SENTRY_SDK_VERSION,t.SEMANTIC_ATTRIBUTE_SENTRY_SEGMENT_ID=g.SEMANTIC_ATTRIBUTE_SENTRY_SEGMENT_ID,t.SEMANTIC_ATTRIBUTE_SENTRY_SEGMENT_NAME=g.SEMANTIC_ATTRIBUTE_SENTRY_SEGMENT_NAME,t.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE=g.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE,t.SEMANTIC_ATTRIBUTE_URL_FULL=g.SEMANTIC_ATTRIBUTE_URL_FULL,t.SEMANTIC_ATTRIBUTE_USER_EMAIL=g.SEMANTIC_ATTRIBUTE_USER_EMAIL,t.SEMANTIC_ATTRIBUTE_USER_ID=g.SEMANTIC_ATTRIBUTE_USER_ID,t.SEMANTIC_ATTRIBUTE_USER_IP_ADDRESS=g.SEMANTIC_ATTRIBUTE_USER_IP_ADDRESS,t.SEMANTIC_ATTRIBUTE_USER_USERNAME=g.SEMANTIC_ATTRIBUTE_USER_USERNAME,t.SEMANTIC_LINK_ATTRIBUTE_LINK_TYPE=g.SEMANTIC_LINK_ATTRIBUTE_LINK_TYPE,t.createEventEnvelope=m.createEventEnvelope,t.createSessionEnvelope=m.createSessionEnvelope,t.createSpanEnvelope=m.createSpanEnvelope,t.addEventProcessor=_.addEventProcessor,t.captureCheckIn=_.captureCheckIn,t.captureEvent=_.captureEvent,t.captureException=_.captureException,t.captureMessage=_.captureMessage,t.captureSession=_.captureSession,t.close=_.close,t.endSession=_.endSession,t.flush=_.flush,t.isEnabled=_.isEnabled,t.isInitialized=_.isInitialized,t.lastEventId=_.lastEventId,t.setContext=_.setContext,t.setConversationId=_.setConversationId,t.setExtra=_.setExtra,t.setExtras=_.setExtras,t.setTag=_.setTag,t.setTags=_.setTags,t.setUser=_.setUser,t.startSession=_.startSession,t.withMonitor=_.withMonitor,t.getClient=T.getClient,t.getCurrentScope=T.getCurrentScope,t.getExternalPropagationContext=T.getExternalPropagationContext,t.getGlobalScope=T.getGlobalScope,t.getIsolationScope=T.getIsolationScope,t.getTraceContextFromScope=T.getTraceContextFromScope,t.hasExternalPropagationContext=T.hasExternalPropagationContext,t.registerExternalPropagationContext=T.registerExternalPropagationContext,t.withIsolationScope=T.withIsolationScope,t.withScope=T.withScope,t.getDefaultCurrentScope=E.getDefaultCurrentScope,t.getDefaultIsolationScope=E.getDefaultIsolationScope,t.setAsyncContextStrategy=y.setAsyncContextStrategy,t.getGlobalSingleton=S.getGlobalSingleton,t.getMainCarrier=S.getMainCarrier,t.closeSession=v.closeSession,t.makeSession=v.makeSession,t.updateSession=v.updateSession,t.Scope=b.Scope,t.notifyEventProcessors=I.notifyEventProcessors,t.SENTRY_API_VERSION=A.SENTRY_API_VERSION,t.getEnvelopeEndpointWithUrlEncodedAuth=A.getEnvelopeEndpointWithUrlEncodedAuth,t.getReportDialogEndpoint=A.getReportDialogEndpoint,t.Client=R.Client,t.initAndBind=C.initAndBind,t.setCurrentClient=C.setCurrentClient,t.createTransport=k.createTransport,t.makeOfflineTransport=L.makeOfflineTransport,t.MULTIPLEXED_TRANSPORT_EXTRA_KEY=O.MULTIPLEXED_TRANSPORT_EXTRA_KEY,t.makeMultiplexedTransport=O.makeMultiplexedTransport,t.addIntegration=N.addIntegration,t.defineIntegration=N.defineIntegration,t.getIntegrationsToSetup=N.getIntegrationsToSetup,t.installedIntegrations=N.installedIntegrations,t._INTERNAL_clearAiProvi
1derSkips=w._INTERNAL_clearAiProviderSkips,t._INTERNAL_shouldSkipAiProviderWrapping=w._INTERNAL_shouldSkipAiProviderWrapping,t._INTERNAL_skipAiProviderWrapping=w._INTERNAL_skipAiProviderWrapping,t.envToBool=P.envToBool,t.applyScopeDataToEvent=M.applyScopeDataToEvent,t.getCombinedScopeData=M.getCombinedScopeData,t.mergeScopeData=M.mergeScopeData,t.prepareEvent=D.prepareEvent,t.createCheckInEnvelope=x.createCheckInEnvelope,t.hasSpansEnabled=U.hasSpansEnabled,t.isStreamedBeforeSendSpanCallback=B.isStreamedBeforeSendSpanCallback,t.withStreamedSpan=B.withStreamedSpan,t.isSentryRequestUrl=F.isSentryRequestUrl,t.handleCallbackErrors=$.handleCallbackErrors,t.fmt=G.fmt,t.parameterize=G.parameterize,t.handleTunnelRequest=H.handleTunnelRequest,t.addAutoIpAddressToSession=j.addAutoIpAddressToSession,t.addAutoIpAddressToUser=j.addAutoIpAddressToUser,t.INTERNAL_getSegmentSpan=W.INTERNAL_getSegmentSpan,t.addChildSpanToSpan=W.addChildSpanToSpan,t.convertSpanLinksForEnvelope=W.convertSpanLinksForEnvelope,t.getActiveSpan=W.getActiveSpan,t.getRootSpan=W.getRootSpan,t.getSpanDescendants=W.getSpanDescendants,t.getStatusMessage=W.getStatusMessage,t.spanIsSampled=W.spanIsSampled,t.spanTimeInputToSeconds=W.spanTimeInputToSeconds,t.spanToJSON=W.spanToJSON,t.spanToStreamedSpanJSON=W.spanToStreamedSpanJSON,t.spanToTraceContext=W.spanToTraceContext,t.spanToTraceHeader=W.spanToTraceHeader,t.updateSpanName=W.updateSpanName,t._INTERNAL_setSpanForScope=K._setSpanForScope,t.parseSampleRate=V.parseSampleRate,t.applySdkMetadata=q.applySdkMetadata,t.getTraceData=Y.getTraceData,t.shouldPropagateTraceForUrl=z.shouldPropagateTraceForUrl,t.getTraceMetaTags=J.getTraceMetaTags,t.debounce=X.debounce,t.derefWeakRef=Q.derefWeakRef,t.makeWeakRef=Q.makeWeakRef,t.shouldIgnoreSpan=Z.shouldIgnoreSpan,t.MAX_BODY_BYTE_LENGTH=ee.MAX_BODY_BYTE_LENGTH,t.captureBodyFromWinterCGRequest=ee.captureBodyFromWinterCGRequest,t.extractQueryParamsFromUrl=ee.extractQueryParamsFromUrl,t.getMaxBodyByteLength=ee.getMaxBodyByteLength,t.headersToDict=ee.headersToDict,t.httpHeadersToSpanAttributes=ee.httpHeadersToSpanAttributes,t.httpRequestToRequestData=ee.httpRequestToRequestData,t.winterCGHeadersToDict=ee.winterCGHeadersToDict,t.winterCGRequestToRequestData=ee.winterCGRequestToRequestData,t.DEFAULT_ENVIRONMENT=te.DEFAULT_ENVIRONMENT,t.DEV_ENVIRONMENT=te.DEV_ENVIRONMENT,t.addBreadcrumb=ne.addBreadcrumb,t.functionToStringIntegration=re.functionToStringIntegration,t.eventFiltersIntegration=se.eventFiltersIntegration,t.inboundFiltersIntegration=se.inboundFiltersIntegration,t.linkedErrorsIntegration=ie.linkedErrorsIntegration,t.moduleMetadataIntegration=ae.moduleMetadataIntegration,t.requestDataIntegration=oe.requestDataIntegration,t.captureConsoleIntegration=le.captureConsoleIntegration,t.dedupeIntegration=ce.dedupeIntegration,t.extraErrorDataIntegration=ue.extraErrorDataIntegration,t.rewriteFramesIntegration=de.rewriteFramesIntegration,t.instrumentSupabaseClient=he.instrumentSupabaseClient,t.supabaseIntegration=he.supabaseIntegration,t.zodErrorsIntegration=fe.zodErrorsIntegration,t.thirdPartyErrorFilterIntegration=pe.thirdPartyErrorFilterIntegration,t.consoleIntegration=ge.consoleIntegration,t.featureFlagsIntegration=me.featureFlagsIntegration,t.growthbookIntegration=_e.growthbookIntegration,t.conversationIdIntegration=Te.conversationIdIntegration,t.profiler=Ee.profiler,t._INTERNAL_getTracingHeadersForFetchRequest=ye._INTERNAL_getTracingHeadersForFetchRequest,t.instrumentFetchRequest=ye.instrumentFetchRequest,t.captureFeedback=Se.captureFeedback,t._INTERNAL_captureLog=ve._INTERNAL_captureLog,t._INTERNAL_captureSerializedLog=ve._INTERNAL_captureSerializedLog,t._INTERNAL_flushLogsBuffer=ve._INTERNAL_flushLogsBuffer,t.logger=be,t.consoleLoggingIntegration=Ie.consoleLoggingIntegration,t._INTERNAL_captureMetric=Ae._INT
1ERNAL_captureMetric,t._INTERNAL_captureSerializedMetric=Ae._INTERNAL_captureSerializedMetric,t._INTERNAL_flushMetricsBuffer=Ae._INTERNAL_flushMetricsBuffer,t.metrics=Re,t.createConsolaReporter=Ce.createConsolaReporter,t.addVercelAiProcessors=ke.addVercelAiProcessors,t._INTERNAL_cleanupToolCallSpanContext=Le._INTERNAL_cleanupToolCallSpanContext,t._INTERNAL_getSpanContextForToolCallId=Le._INTERNAL_getSpanContextForToolCallId,t._INTERNAL_toolCallSpanContextMap=Oe.toolCallSpanContextMap,t.instrumentOpenAiClient=Ne.instrumentOpenAiClient,t.OPENAI_INTEGRATION_NAME=we.OPENAI_INTEGRATION_NAME,t.instrumentAnthropicAiClient=Pe.instrumentAnthropicAiClient,t.ANTHROPIC_AI_INTEGRATION_NAME=Me.ANTHROPIC_AI_INTEGRATION_NAME,t.instrumentGoogleGenAIClient=De.instrumentGoogleGenAIClient,t.GOOGLE_GENAI_INTEGRATION_NAME=xe.GOOGLE_GENAI_INTEGRATION_NAME,t.createLangChainCallbackHandler=Ue.createLangChainCallbackHandler,t.LANGCHAIN_INTEGRATION_NAME=Be.LANGCHAIN_INTEGRATION_NAME,t.instrumentCreateReactAgent=Fe.instrumentCreateReactAgent,t.instrumentLangGraph=Fe.instrumentLangGraph,t.instrumentStateGraphCompile=Fe.instrumentStateGraphCompile,t.LANGGRAPH_INTEGRATION_NAME=$e.LANGGRAPH_INTEGRATION_NAME,t.SpanBuffer=Ge.SpanBuffer,t.hasSpanStreamingEnabled=He.hasSpanStreamingEnabled,t.spanStreamingIntegration=je.spanStreamingIntegration,t._INTERNAL_FLAG_BUFFER_SIZE=We._INTERNAL_FLAG_BUFFER_SIZE,t._INTERNAL_MAX_FLAGS_PER_SPAN=We._INTERNAL_MAX_FLAGS_PER_SPAN,t._INTERNAL_addFeatureFlagToActiveSpan=We._INTERNAL_addFeatureFlagToActiveSpan,t._INTERNAL_copyFlagsFromScopeToEvent=We._INTERNAL_copyFlagsFromScopeToEvent,t._INTERNAL_insertFlagToScope=We._INTERNAL_insertFlagToScope,t.applyAggregateErrorsToEvent=Ke.applyAggregateErrorsToEvent,t.getBreadcrumbLogLevelFromHttpStatusCode=Ve.getBreadcrumbLogLevelFromHttpStatusCode,t.dsnFromString=qe.dsnFromString,t.dsnToString=qe.dsnToString,t.makeDsn=qe.makeDsn,t.SentryError=Ye.SentryError,t.GLOBAL_OBJ=ze.GLOBAL_OBJ,t.addConsoleInstrumentationFilter=Je.addConsoleInstrumentationFilter,t.addConsoleInstrumentationHandler=Je.addConsoleInstrumentationHandler,t.addFetchEndInstrumentationHandler=Xe.addFetchEndInstrumentationHandler,t.addFetchInstrumentationHandler=Xe.addFetchInstrumentationHandler,t.addGlobalErrorInstrumentationHandler=Qe.addGlobalErrorInstrumentationHandler,t.addGlobalUnhandledRejectionInstrumentationHandler=Ze.addGlobalUnhandledRejectionInstrumentationHandler,t.addHandler=et.addHandler,t.maybeInstrument=et.maybeInstrument,t.resetInstrumentationHandlers=et.resetInstrumentationHandlers,t.triggerHandlers=et.triggerHandlers,t.isDOMError=tt.isDOMError,t.isDOMException=tt.isDOMException,t.isElement=tt.isElement,t.isError=tt.isError,t.isErrorEvent=tt.isErrorEvent,t.isEvent=tt.isEvent,t.isInstanceOf=tt.isInstanceOf,t.isParameterizedString=tt.isParameterizedString,t.isPlainObject=tt.isPlainObject,t.isPrimitive=tt.isPrimitive,t.isRegExp=tt.isRegExp,t.isString=tt.isString,t.isSyntheticEvent=tt.isSyntheticEvent,t.isThenable=tt.isThenable,t.isVueViewModel=tt.isVueViewModel,t.isBrowser=nt.isBrowser,t.CONSOLE_LEVELS=rt.CONSOLE_LEVELS,t.consoleSandbox=rt.consoleSandbox,t.debug=rt.debug,t.originalConsoleMethods=rt.originalConsoleMethods,t.addContextToFrame=st.addContextToFrame,t.addExceptionMechanism=st.addExceptionMechanism,t.addExceptionTypeValue=st.addExceptionTypeValue,t.checkOrSetAlreadyCaught=st.checkOrSetAlreadyCaught,t.getEventDescription=st.getEventDescription,t.isAlreadyCaptured=st.isAlreadyCaptured,t.parseSemver=st.parseSemver,t.uuid4=st.uuid4,t.normalize=it.normalize,t.normalizeToSize=it.normalizeToSize,t.normalizeUrlToBase=it.normalizeUrlToBase,t.setNormalizationDepthOverrideHint=at.setNormalizationDepthOverrideHint,t.setSkipNormalizationHint=at.setSkipNormalizationHint,t.addNonEnumerableProperty=ot.addNonEnumerableProperty,t.convertToPlainObject=ot.convertToPlainObject,t.dropUndefinedKeys=ot.dropUndefinedKeys,t.extractExceptionKeysForMessage=ot.extractExceptionKeysForMessage,t.fill=ot.fill,t.getOriginalFunction=ot.getOriginalFunction,t.markFunctionWrapped=ot.markFunctionWrapped,t.objectify=ot.objectify,t.basename=lt.basename,t.dirname=lt.dirname,t.isAbsolute=lt.isAbsolute,t.join=lt.join,t.normalizePath=lt.normalizePath,t.relative=lt.relative,t.resolve=lt.resolve,t.SENTRY_BUFFER_FULL_ERROR=ct.SENTRY_BUFFER_FULL_ERROR,t.makePromiseBuffer=ct.makePromiseBuffer,t.severityLevelFromString=ut.severityLevelFromString,t.replaceExports=dt.replaceExports,t.UNKNOWN_FUNCTION=ht.UNKNOWN_FUNCTION,t.createStackParser=ht.createStackParser,t.getFramesFromEvent=ht.getFramesFromEvent,t.getFunctionName=ht.getFunctionName,t.stackParserFromStackParserOptions=ht.stackParserFromStackParserOptions,t.stripSentryFramesAndReverse=ht.
1stripSentryFramesAndReverse,t.isMatchingPattern=ft.isMatchingPattern,t.safeJoin=ft.safeJoin,t.snipLine=ft.snipLine,t.stringMatchesSomePattern=ft.stringMatchesSomePattern,t.truncate=ft.truncate,t.isNativeFunction=pt.isNativeFunction,t.supportsDOMError=pt.supportsDOMError,t.supportsDOMException=pt.supportsDOMException,t.supportsErrorEvent=pt.supportsErrorEvent,t.supportsFetch=pt.supportsFetch,t.supportsHistory=pt.supportsHistory,t.supportsNativeFetch=pt.supportsNativeFetch,t.supportsReferrerPolicy=pt.supportsReferrerPolicy,t.supportsReportingObserver=pt.supportsReportingObserver,t.SyncPromise=gt.SyncPromise,t.rejectedSyncPromise=gt.rejectedSyncPromise,t.resolvedSyncPromise=gt.resolvedSyncPromise,t.browserPerformanceTimeOrigin=mt.browserPerformanceTimeOrigin,t.dateTimestampInSeconds=mt.dateTimestampInSeconds,t.timestampInSeconds=mt.timestampInSeconds,t.TRACEPARENT_REGEXP=_t.TRACEPARENT_REGEXP,t.extractTraceparentData=_t.extractTraceparentData,t.generateSentryTraceHeader=_t.generateSentryTraceHeader,t.generateTraceparentHeader=_t.generateTraceparentHeader,t.propagationContextFromHeaders=_t.propagationContextFromHeaders,t.shouldContinueTrace=_t.shouldContinueTrace,t.getSDKSource=Tt.getSDKSource,t.isBrowserBundle=Tt.isBrowserBundle,t.addItemToEnvelope=Et.addItemToEnvelope,t.createAttachmentEnvelopeItem=Et.createAttachmentEnvelopeItem,t.createEnvelope=Et.createEnvelope,t.createEventEnvelopeHeaders=Et.createEventEnvelopeHeaders,t.createSpanEnvelopeItem=Et.createSpanEnvelopeItem,t.envelopeContainsItemType=Et.envelopeContainsItemType,t.envelopeItemTypeToDataCategory=Et.envelopeItemTypeToDataCategory,t.forEachEnvelopeItem=Et.forEachEnvelopeItem,t.getSdkMetadataForEnvelopeHeader=Et.getSdkMetadataForEnvelopeHeader,t.parseEnvelope=Et.parseEnvelope,t.serializeEnvelope=Et.serializeEnvelope,t.createClientReportEnvelope=yt.createClientReportEnvelope,t.DEFAULT_RETRY_AFTER=St.DEFAULT_RETRY_AFTER,t.disabledUntil=St.disabledUntil,t.isRateLimited=St.isRateLimited,t.parseRetryAfterHeader=St.parseRetryAfterHeader,t.updateRateLimits=St.updateRateLimits,t.MAX_BAGGAGE_STRING_LENGTH=vt.MAX_BAGGAGE_STRING_LENGTH,t.SENTRY_BAGGAGE_KEY_PREFIX=vt.SENTRY_BAGGAGE_KEY_PREFIX,t.SENTRY_BAGGAGE_KEY_PREFIX_REGEX=vt.SENTRY_BAGGAGE_KEY_PREFIX_REGEX,t.baggageHeaderToDynamicSamplingContext=vt.baggageHeaderToDynamicSamplingContext,t.dynamicSamplingContextToSentryBaggageHeader=vt.dynamicSamplingContextToSentryBaggageHeader,t.mergeBaggageHeaders=vt.mergeBaggageHeaders,t.objectToBaggageHeader=vt.objectToBaggageHeader,t.parseBaggageHeader=vt.parseBaggageHeader,t.getHttpSpanDetail
1sFromUrlObject=bt.getHttpSpanDetailsFromUrlObject,t.getSanitizedUrlString=bt.getSanitizedUrlString,t.getSanitizedUrlStringFromUrlObject=bt.getSanitizedUrlStringFromUrlObject,t.isURLObjectRelative=bt.isURLObjectRelative,t.parseStringToURLObject=bt.parseStringToURLObject,t.parseUrl=bt.parseUrl,t.stripDataUrlContent=bt.stripDataUrlContent,t.stripUrlQueryAndFragment=bt.stripUrlQueryAndFragment,t._INTERNAL_enhanceErrorWithSentryInfo=It._enhanceErrorWithSentryInfo,t.eventFromMessage=It.eventFromMessage,t.eventFromUnknownInput=It.eventFromUnknownInput,t.exceptionFromError=It.exceptionFromError,t.parseStackFrames=It.parseStackFrames,t.LRUMap=At.LRUMap,t.generateSpanId=Rt.generateSpanId,t.generateTraceId=Rt.generateTraceId,t.SDK_VERSION=Ct.SDK_VERSION,t.getDebugImagesForResources=kt.getDebugImagesForResources,t.getFilenameToDebugIdMap=kt.getFilenameToDebugIdMap,t.getFilenameToMetadataMap=Lt.getFilenameToMetadataMap,t.escapeStringForRegex=Ot.escapeStringForRegex,t._INTERNAL_safeDateNow=Nt.safeDateNow,t._INTERNAL_safeMathRandom=Nt.safeMathRandom,t._INTERNAL_withRandomSafeContext=Nt.withRandomSafeContext,t.getComponentName=wt.getComponentName,t.getLocationHref=wt.getLocationHref,t.htmlTreeAsString=wt.htmlTreeAsString,t.instrumentLangChainEmbeddings=Pt.instrumentLangChainEmbeddings},73220(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(6102),s=n(73969);function i(e){const t=e.__SENTRY__=e.__SENTRY__||{};return t.version=t.version||r.SDK_VERSION,t[r.SDK_VERSION]=t[r.SDK_VERSION]||{}}t.getGlobalSingleton=function(e,t,n=s.GLOBAL_OBJ){const i=n.__SENTRY__=n.__SENTRY__||{},a=i[r.SDK_VERSION]=i[r.SDK_VERSION]||{};return a[e]||(a[e]=t())},t.getMainCarrier=function(){return i(s.GLOBAL_OBJ),s.GLOBAL_OBJ},t.getSentryCarrier=i},60251(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(21811),s=n(99188);t.createCheckInEnvelope=function(e,t,n,i,a){const o={sent_at:(new Date).toISOString()};n?.sdk&&(o.sdk={name:n.sdk.name,version:n.sdk.version}),i&&a&&(o.dsn=r.dsnToString(a)),t&&(o.trace=t);const l=function(e){return[{type:"check_in"},e]}(e);return s.createEnvelope(o,[l])}},83913(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85740),s=n(42501),i=n(49564),a=n(68974),o=n(30238),l=n(82430),c=n(97373),u=n(63717),d=n(11348),h=n(93754),f=n(95150),p=n(34983),g=n(64450),m=n(64841),_=n(85110),T=n(21811),E=n(99188),y=n(27389),S=n(88532),v=n(19090),b=n(96940),I=n(10393),A=n(31485),R=n(31901),C=n(83031),k=n(87687),L=n(54583),O=n(94486),N=n(41335),w=n(73324),P="Not capturing exception because it's already been captured.",M="Discarded session because of missing or non-string release",D=Symbol.for("SentryInternalError"),x=Symbol.for("SentryDoNotSendEventError");function U(e){return{message:e,[D]:!0}}function B(e){return{message:e,[x]:!0}}function F(e){return!!e&&"object"==typeof e&&D in e}function $(e){return!!e&&"object"==typeof e&&x in e}function G(e,t,n,r,s){let i,a=0,o=!1;e.on(n,(()=>{a=0,clearTimeout(i),o=!1})),e.on(t,(t=>{a+=r(t),a>=8e5?s(e):o||(o=!0,i=N.safeUnref(setTimeout((()=>{s(e)}),5e3)))})),e.on("flush",(()=>{s(e)}))}function H(e){return"replay_event"===e?"replay":e||"error"}function j(e){return void 0===e.type}function W(e){return"transaction"===e.type}function K(e){let t=0;return e.name&&(t+=2*e.name.length),t+=8,t+q(e.attributes)}function V(e){let t=0;return e.message&&(t+=2*e.message.length),t+q(e.attributes)}function q(e){if(!e)return 0;let t=0;return Object.values(e).forEach((e=>{Array.isArray(e)?t+=e.length*Y(e[0]):S.isPrimitive(e)?t+=Y(e):t+=100})),t}function Y(e){return"string"==typeof e?2*e.length:"number"==typeof e?8:"boolean"==typeof e?4:0}t.Client=class{constructor(e){if(this._options=e,this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],this._promiseBuffer=R.makePromiseBuffer(e.transportOptions?.bufferSize??g.DEFAULT_TRANSPORT_BUFFER_SIZE),e.dsn?this._dsn=T.makeDsn(e.dsn):a.DEBUG_BUILD&&_.debug.warn("No DSN provided, client will not send events."),this._dsn){const t=r.getEnvelopeEndpointWithUrlEncodedAuth(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:t})}this._options.enableLogs=this._options.enableLogs??this._options._experiments?.enableLogs,this._options.enableLogs&&G(this,"afterCaptureLog","flushLogs",V,c._INTERNAL_flushLogsBuffer);(this._options.enableMetrics??this._options._experiments?.enableMetrics??!0)&&G(this,"afterCaptureMetric","flushMetrics",K,u._INTERNAL_flushMetricsBuffer)}captureException(e,t,n){const r=b.uuid4();if(b.checkOrSetAlreadyCaught(e))return a.DEBUG_BUILD&&_.debug.log(P),r;const s={event_id:r,...t};return this._process((()=>this.eventFromException(e,s).then((e=>this._captureEvent(e,s,n))).then((e=>e))),"error"),s.event_id}captureMessage(e,t,n,r){const s={event_id:b.uuid4(),...n},i=S.isParameterizedString(e)?e:String(e),a=S.isPrimitive(e),o=a?this.eventFromMessage(i,t,s):this.eventFromException(e,s);return this._process((()=>o.then((e=>this._captureEvent(e,s,r)))),a?"unknown":"error"),s.event_id}captureEvent(e,t,n){const r=b.uuid4();if(t?.originalException&&b.checkOrSetAlreadyCaught(t.originalException))return a.DEBUG_BUILD&&_.debug.log(P),r;const s={event_id:r,...t},i=e.sdkProcessingMetadata||{},o=i.capturedSpanScope,l=i.capturedSpanIsolationScope,c=H(e.type);return this._process((()=>this._captureEvent(e,s,o||n,l)),c),s.event_id}captureSession(e){this.sendSession(e),d.updateSession(e,{init:!1})}getDsn(){return this._dsn}getOptions(){return this._options}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}async flush(e){const t=this._transport;
1if(this.emit("flush"),!t)return!0;const n=await this._isClientDoneProcessing(e),r=await t.flush(e);return n&&r}async close(e){c._INTERNAL_flushLogsBuffer(this);const t=await this.flush(e);return this.getOptions().enabled=!1,this.emit("close"),t}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]}addIntegration(e){const t=this._integrations[e.name];!t&&e.beforeSetup&&e.beforeSetup(this),l.setupIntegration(this,e,this._integrations),t||l.afterSetupIntegrations(this,[e])}sendEvent(e,t={}){this.emit("beforeSendEvent",e,t);const n=p.extractGenAiSpansFromEvent(e,this);let r=o.createEventEnvelope(e,this._dsn,this._options._metadata,this._options.tunnel);for(const e of t.attachments||[])r=E.addItemToEnvelope(r,E.createAttachmentEnvelopeItem(e));n&&(r=E.addItemToEnvelope(r,n)),this.sendEnvelope(r).then((t=>this.emit("afterSendEvent",e,t)))}sendSession(e){const{release:t,environment:n=s.DEFAULT_ENVIRONMENT}=this._options;if("aggregates"in e){const r=e.attrs||{};if(!r.release&&!t)return void(a.DEBUG_BUILD&&_.debug.warn(M));r.release=r.release||t,r.environment=r.environment||n,e.attrs=r}else{if(!e.release&&!t)return void(a.DEBUG_BUILD&&_.debug.warn(M));e.release=e.release||t,e.environment=e.environment||n}this.emit("beforeSendSession",e);const r=o.createSessionEnvelope(e,this._dsn,this._options._metadata,this._options.tunnel);this.sendEnvelope(r)}recordDroppedEvent(e,t,n=1){if(this._options.sendClientReports){const r=`${e}:${t}`;a.DEBUG_BUILD&&_.debug.log(`Recording outcome: "${r}"${n>1?` (${n} times)`:""}`),this._outcomes[r]=(this._outcomes[r]||0)+n}}on(e,t){const n=this._hooks[e]=this._hooks[e]||new Set,r=(...e)=>t(...e);return n.add(r),()=>{n.delete(r)}}emit(e,...t){const n=this._hooks[e];n&&n.forEach((e=>e(...t)))}async sendEnvelope(e){if(this.emit("beforeEnvelope",e),this._isEnabled()&&this._transport)try{return await this._transport.send(e)}catch(e){return a.DEBUG_BUILD&&_.debug.error("Error while sending envelope:",e),{}}return a.DEBUG_BUILD&&_.debug.error("Transport disabled"),{}}registerCleanup(e){}dispose(){}_setupIntegrations(){const{integrations:e}=this._options;this._integrations=l.setupIntegrations(this,e),l.afterSetupIntegrations(this,e)}_updateSessionFromEvent(e,t){let n="fatal"===t.level,r=!1;const s=t.exception?.values;if(s){r=!0,n=!1;for(const e of s)if(!1===e.mechanism?.handled){n=!0;break}}const i="ok"===e.status;(i&&0===e.errors||i&&n)&&(d.updateSession(e,{...n&&{status:"crashed"},errors:e.errors||Number(r||n)}),this.captureSession(e))}async _isClientDoneProcessing(e){let t=0;for(;!e||t<e;){if(await new Promise((e=>setTimeout(e,1))),!this._numProcessing)return!0;t++}return!1}_isEnabled(){return!1!==this.getOptions().enabled&&void 0!==this._transport}_prepareEvent(e,t,n,r){const s=this.getOptions(),a=Object.keys(this._integrations);return!t.integrations&&a?.length&&(t.integrations=a),this.emit("preprocessEvent",e,t),e.type||r.setLastEventId(e.event_id||t.event_id),A.prepareEvent(s,e,t,n,this,r).then((e=>{if(null===e)return e;this.emit("postprocessEvent",e,t),e.contexts={trace:{...e.contexts?.trace,...i.getTraceContextFromScope(n)},...e.contexts};const r=h.getDynamicSamplingContextFromScope(this,n);return e.sdkProcessingMetadata={dynamicSamplingContext:r,...e.sdkProcessingMetadata},e}))}_captureEvent(e,t={},n=i.getCurrentScope(),r=i.getIsolationScope()){return a.DEBUG_BUILD&&j(e)&&_.debug.log(`Captured error event \`${y.getPossibleEventMessages(e)[0]||"<unknown>"}\``),this._processEvent(e,t,n,r).then((e=>e.event_id),(e=>{a.DEBUG_BUILD&&($(e)?_.debug.log(e.message):F(e)?_.debug.warn(e.message):_.debug.warn(e))}))}_processEvent(e,t,n,r){const s=this.getOptions(),{sampleRate:i}=s,a=W(e),o=j(e),l=`before send for type \`${e.type||"error"}\``,c=void 0===i?void 0:I.parseSampleRate(i);if(o&&"number"==typeof c&&C.safeMathRandom()>c)return this.recordDroppedEvent("sample_rate","error"),O.rejectedSyncPromise(B(`Discarding event because it's not included in the random sample (sampling rate = ${i})`));const u=H(e.type);return this._prepareEvent(e,t,n,r).then((e=>{if(null===e)throw this.recordDroppedEvent("event_processor",u),B("An event processor returned `null`, will not send event.");if(!0===t.data?.__sentry__)return e;const n=function(e,t,n,r){const{beforeSend:s,beforeSendTransaction:i,ignoreSpans:a}=t,o=!f.isStreamedBeforeSendSpanCallback(t.beforeSendSpan)&&t.beforeSendSpan;let l=n;if(j(l)&&s)return s(l,r);if(W(l)){if(o||a){const t=w.convertTransactionEventToSpanJson(l);if(a?.length&&k.shouldIgnoreSpan({description:t.description,op:t.op,attributes:t.data},a))return null;if(o){const e=o(t);e?l=v.merge(n,w.convertSpanJsonToTransactionEvent(e)):L.showSpanDropWarning()}if(l.spans){const t=[],n=l.spans;for(const e of n)if(a?.length&&k.shouldIgnoreSpan({description:e.description,op:e.op,attributes:e.data},a))k.reparentChildSpans(n,e);else if(o){const n=o(e);n?t.push(n):(L.showSpanDropWarning(),t.push(e))}else t.push(e);const r=l.spans.length-t.length;r&&e.recordDroppedEvent("before_send","span",r),l.spans=t}}if(i){if(l.spans){const e=l.spans.length;l.sdkProcessingMetadata={...n.sdkProcessingMetadata,spanCountBeforeProcessing:e}}return i(l,r)}}return l}(this,s,e,t);return function(e,t){const n=`${t} must return \`null\` or a valid event.`;if(S.isThenable(e))return e.then((e=>{if(!S.isPlainObject(e)&&null!==e)throw U(n);return e}),(e=>{throw U(`${t} rejected with ${e}`)}));if(!S.isPlainObject(e)&&null!==e)throw U(n);return e}(n,l)})).then((s=>{if(null===s){if(this.recordDroppedEvent("before_send",u),a){const t=1+(e.spans||[]).length;this.recordDroppedEvent("before_send","span",t)}throw B(`${l} returned \`null\`, will not send event.`)}const i=n.getSession()||r.getSession();if(o&&i&&this._updateSessionFromEvent(i,s),a){const e=(s.sdkProcessingMetadata?.spanCountBeforeProcessing||0)-(s.spans?s.spans.length:0);e>0&&this.recordDroppedEvent("before_send","span",e)}const c=s.transaction_info;if(a&&c&&s.transaction!==e.transaction){const e="custom";s.transaction_info={...c,source:e}}return this.sendEvent(s,t),s})).then(null,(e=>{if($(e)||F(e))throw e;throw this.captureException(e,{mechanism:{handled:!1,type:"internal"},data:{__sentry__:!0},originalException:e}),U(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.\nReason: ${e}`)}))}_process(e,t){this._numProcessing++,this._promiseBuffer.add(e).then((e=>(this._numProcessing--,e)),(e=>(this._numProcessing--,e===R.SENTRY_BUFFER_FULL_ERROR&&this.recordDroppedEvent("queue_overflow",t),e)))}_clearOutcomes(){const e=this._outcomes;return this._outcomes={},Object.entries(e).map((([e,t])=>{const[n,r]=e.split(":");return{reason:n,category:r,quantity:t}}))}_flushOutcomes(){a.DEBUG_BUILD&&_.debug.log("Flushing outcomes...");const e=this._clearOutcomes();if(0===e.length)return void(a.DEBUG_BUILD&&_.debug.log("No outcomes to send"));if(!this._dsn)return void(a.DEBUG_BUILD&&_.debug.log("No dsn provided, will not send outcomes"));a.DEBUG_BUILD&&_.debug.log("Sending outcomes:",e);const t=m.createClientReportEnvelope(e,this._options.tunnel&&T.dsnToString(this._dsn));this.sendEnvelope(t)}}},42501(e,t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});t.DEFAULT_ENVIRONMENT="production",t.DEV_ENVIRONMENT="development"},49564(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(42810),s=n(73220),i=n(69640),a=n(58913);let o;function l(){return o?.()}function c(){const e=s.getMainCarrier();return r.getAsyncContextStrategy(e).getCurrentScope()}t.getClient=function(){return c().getClient()},t.getCurrentScope=c,t.getExternalPropagationContext=l,t.getGlobalScope=function(){return s.getGlobalSingleton("globalScope",(()=>new i.Scope))},t.getIsolationScope=function(){const e=s.getMainCarrier();return r.getAsyncContextStrategy(e).getIsolationScope()},t.getTraceContextFromScope=function(e){const t=l();if(t)return{trace_id:t.traceId,span_id:t.spanId};const n=e.getPropagationContext(),{traceId:r,parentSpanId:s,propagationSpanId:i}=n,o={trace_id:r,span_id:i||a.generateSpanId()};return s&&(o.parent_span_id=s),o},t.hasExternalPropagationContext=function(){return void 0!==o},t.registerExternalPropagationContext=function(e){o=e},t.withIsolationScope=function(...e){const t=s.getMainCarrier(),n=r.getAsyncContextStrategy(t);if(2===e.length){const[t,r]=e;return t?n.withSetIsolationScope(t,r):n.withIsolationScope(r)}return n.withIsolationScope(e[0])},t.withScope=function(...e){const t=s.getMainCarrier(),n=r.getAsyncContextStrategy(t);if(2===e.length){const[t,r]=e;return t?n.withSetScope(t,r):n.withScope(r)}return n.withScope(e[0])}},68974(e,t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const n="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__;t.DEBUG_BUILD=n}
1,37320(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(73220),s=n(69640);t.getDefaultCurrentScope=function(){return r.getGlobalSingleton("defaultCurrentScope",(()=>new s.Scope))},t.getDefaultIsolationScope=function(){return r.getGlobalSingleton("defaultIsolationScope",(()=>new s.Scope))}},30238(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(93754),s=n(95150),i=n(21811),a=n(99188),o=n(87687),l=n(54583);function c(e,t){if(!t)return e;const n=e.sdk||{};return e.sdk={...n,name:n.name||t.name,version:n.version||t.version,integrations:[...e.sdk?.integrations||[],...t.integrations||[]],packages:[...e.sdk?.packages||[],...t.packages||[]],settings:e.sdk?.settings||t.settings?{...e.sdk?.settings,...t.settings}:void 0},e}t._enhanceEventWithSdkInfo=c,t.createEventEnvelope=function(e,t,n,r){const s=a.getSdkMetadataForEnvelopeHeader(n),i=e.type&&"replay_event"!==e.type?e.type:"event";c(e,n?.sdk);const o=a.createEventEnvelopeHeaders(e,s,r,t);delete e.sdkProcessingMetadata;const l=[{type:i},e];return a.createEnvelope(o,[l])},t.createSessionEnvelope=function(e,t,n,r){const s=a.getSdkMetadataForEnvelopeHeader(n),o={sent_at:(new Date).toISOString(),...s&&{sdk:s},...!!r&&t&&{dsn:i.dsnToString(t)}},l="aggregates"in e?[{type:"sessions"},e]:[{type:"session"},e.toJSON()];return a.createEnvelope(o,[l])},t.createSpanEnvelope=function(e,t){const n=r.getDynamicSamplingContextFromSpan(e[0]),c=t?.getDsn(),u=t?.getOptions().tunnel,d={sent_at:(new Date).toISOString(),...function(e){return!!e.trace_id&&!!e.public_key}(n)&&{trace:n},...!!u&&c&&{dsn:i.dsnToString(c)}},{beforeSendSpan:h,ignoreSpans:f}=t?.getOptions()||{},p=f?.length?e.filter((e=>{const t=l.spanToJSON(e);return!o.shouldIgnoreSpan({description:t.description,op:t.op,attributes:t.data},f)})):e,g=e.length-p.length;g&&t?.recordDroppedEvent("before_send","span",g);const m=h?e=>{const t=l.spanToJSON(e),n=s.isStreamedBeforeSendSpanCallback(h)?t:h(t);return n||(l.showSpanDropWarning(),t)}:l.spanToJSON,_=[];for(const e of p){const t=m(e);t&&_.push(a.createSpanEnvelopeItem(t))}return a.createEnvelope(d,_)}},51929(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(68974),s=n(85110),i=n(88532),a=n(94486);function o(e,t,n,a){const l=n[a];if(!e||!l)return e;const c=l({...e},t);return r.DEBUG_BUILD&&null===c&&s.debug.log(`Event processor "${l.id||"?"}" dropped event`),i.isThenable(c)?c.then((e=>o(e,t,n,a+1))):o(c,t,n,a+1)}t.notifyEventProcessors=function(e,t,n,r=0){try{const s=o(t,n,e,r);return i.isThenable(s)?s:a.resolvedSyncPromise(s)}catch(e){return a.rejectedSyncPromise(e)}}},79183(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(49564),s=n(68974),i=n(11348),a=n(55908),o=n(85110),l=n(88532),c=n(96940),u=n(31485),d=n(37402),h=n(26869),f=n(73969);function p(e,t){const n=r.getCurrentScope(),i=r.getClient();if(i){if(i.captureCheckIn)return i.captureCheckIn(e,t,n);s.DEBUG_BUILD&&o.debug.warn("Cannot capture check-in. Client does not support sending check-ins.")}else s.DEBUG_BUILD&&o.debug.warn("Cannot capture check-in. No client defined.");return c.uuid4()}function g(){const e=r.getIsolationScope(),t=r.getCurrentScope().getSession()||e.getSession();t&&i.closeSession(t),m(),e.setSession()}function m(){const e=r.getIsolationScope(),t=r.getClient(),n=e.getSession();n&&t&&t.captureSession(n)}t.addEventProcessor=function(e){r.getIsolationScope().addEventProcessor(e)},t.captureCheckIn=p,t.captureEvent=function(e,t){return r.getCurrentScope().captureEvent(e,t)},t.captureException=function(e,t){return r.getCurrentScope().captureException(e,u.parseEventHintOrCaptureContext(t))},t.captureMessage=function(e,t){const n="string"==typeof t?t:void 0,s="string"!=typeof t?{captureContext:t}:void 0;return r.getCurrentScope().captureMessage(e,n,s)},t.captureSession=function(e=!1){e?g():m()},t.close=async function(e){const t=r.getClient();return t?t.close(e):(s.DEBUG_BUILD&&o.debug.warn("Cannot flush events and disable SDK. No client defined."),Promise.resolve(!1))},t.endSession=g,t.flush=async function(e){const t=r.getClient();return t?t.flush(e):(s.DEBUG_BUILD&&o.debug.warn("Cannot flush events. No client defined."),Promise.resolve(!1))},t.isEnabled=function(){const e=r.getClient();return!1!==e?.getOptions().enabled&&!!e?.getTransport()},t.isInitialized=function(){return!!r.getClient()},t.lastEventId=function(){return r.getIsolationScope().lastEventId()},t.setContext=function(e,t){r.getIsolationScope().setContext(e,t)},t.setConversationId=function(e){r.getIsolationScope().setConversationId(e)},t.setExtra=function(e,t){r.getIsolationScope().setExtra(e,t)},t.setExtras=function(e){r.getIsolationScope().setExtras(e)},t.setTag=function(e,t){r.getIsolationScope().setTag(e,t)},t.setTags=function(e){r.getIsolationScope().setTags(e)},t.setUser=function(e){r.getIsolationScope().setUser(e)},t.startSession=function(e){const t=r.getIsolationScope(),{user:n}=d.getCombinedScopeData(t,r.getCurrentScope()),{userAgent:s}=f.GLOBAL_OBJ.navigator||{},a=i.makeSession({user:n,...s&&{userAgent:s},...e}),o=t.getSession();return"ok"===o?.status&&i.updateSession(o,{status:"exited"}),g(),t.setSession(a),a},t.withMonitor=function(e,t,n){function s(){const r=p({monitorSlug:e,status:"in_progress"},n),s=h.timestampInSeconds();function i(t){p({monitorSlug:e,status:t,checkInId:r,duration:h.timestampInSeconds()-s})}let a;try{a=t()}catch(e){throw i("error"),e}return l.isThenable(a)?a.then((e=>(i("ok"),e)),(e=>{throw i("error"),e})):(i("ok"),a)}return r.withIsolationScope((()=>n?.isolateTrace?a.startNewTrace(s):s()))}},6933(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(49564);t.captureFeedback=function(e,t={},n=r.getCurrentScope()){const{message:s,name:i,email:a,url:o,source:l,associatedEventId:c,tags:u}=e,d={contexts:{feedback:{contact_email:a,name:i,message:s,url:o,source:l,associated_event_id:c}},type:"feedback",level:"info",tags:u},h=n?.getClient()||r.getClient();return h&&h.emit("beforeSendFeedback",d,t),n.captureEvent(d,t)}}
1,31096(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(49564),s=n(52751),i=n(54583),a=n(15363),o=n(88532),l=n(51228),c=n(5684),u=n(67392),d=n(85526),h=n(55908),f=n(9635),p=n(20647);function g(e,t,n){const r="object"==typeof n&&null!==n?n.onRequestSpanEnd:void 0;r?.(e,{headers:t.response?.headers,error:t.error})}function m(e,t,n,r){const s=p.getTraceData({span:n,propagateTraceparent:r}),i=s["sentry-trace"],a=s.baggage,l=s.traceparent;if(!i)return;const c=t.headers||(o.isRequest(e)?e.headers:void 0);if(c){if(u=c,"undefined"!=typeof Headers&&o.isInstanceOf(u,Headers)){const e=new Headers(c);if(e.get("sentry-trace")||e.set("sentry-trace",i),r&&l&&!e.get("traceparent")&&e.set("traceparent",l),a){const t=e.get("baggage");t?_(t)||e.set("baggage",`${t},${a}`):e.set("baggage",a)}return e}if(function(e){if(!Array.isArray(e))return!1;return e.every((e=>Array.isArray(e)&&2===e.length&&"string"==typeof e[0]))}(c)){const e=[...c];e.find((e=>"sentry-trace"===e[0]))||e.push(["sentry-trace",i]),r&&l&&!e.find((e=>"traceparent"===e[0]))&&e.push(["traceparent",l]);const t=c.find((e=>"baggage"===e[0]&&"string"==typeof e[1]&&_(e[1])));return a&&!t&&e.push(["baggage",a]),e}{const e="sentry-trace"in c?c["sentry-trace"]:void 0,t="traceparent"in c?c.traceparent:void 0,n="baggage"in c?c.baggage:void 0,s=n?Array.isArray(n)?[...n]:[n]:[],o=n&&(Array.isArray(n)?n.find((e=>_(e))):_(n));a&&!o&&s.push(a);const u=Object.assign({},c,{"sentry-trace":e??i,baggage:s.length>0?s.join(","):void 0});return r&&l&&!t&&(u.traceparent=l),u}}return{...s};var u}function _(e){return"string"==typeof e&&e.split(",").some((e=>e.trim().startsWith(c.SENTRY_BAGGAGE_KEY_PREFIX)))}function T(e,t,n){if(e.startsWith("data:")){return{name:`${t} ${f.stripDataUrlContent(e)}`,attributes:E(e,void 0,t,n)}}const r=f.parseStringToURLObject(e);return{name:`${t} ${r?f.getSanitizedUrlStringFromUrlObject(r):e}`,attributes:E(e,r,t,n)}}function E(e,t,n,r){const i={url:f.stripDataUrlContent(e),type:"fetch","http.method":n,[s.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]:r,[s.SEMANTIC_ATTRIBUTE_SENTRY_OP]:"http.client"};return t&&(f.isURLObjectRelative(t)||(i["http.url"]=f.stripDataUrlContent(t.href),i["server.address"]=t.host),t.search&&(i["http.query"]=t.search),t.hash&&(i["http.fragment"]=t.hash)),i}t._INTERNAL_getTracingHeadersForFetchRequest=m,t._callOnRequestSpanEnd=g,t.instrumentFetchRequest=function(e,t,n,s,o){if(!e.fetchData)return;const{method:c,url:f}=e.fetchData,p=l.hasSpansEnabled()&&t(f);if(e.endTimestamp){const t=e.fetchData.__span;if(!t)return;const n=s[t];return void(n&&(p&&(!function(e,t){if(t.response){a.setHttpStatus(e,t.response.status);const n=t.response?.headers?.get("content-length");if(n){const t=parseInt(n);t>0&&e.setAttribute("http.response_content_length",t)}}else t.error&&e.setStatus({code:a.SPAN_STATUS_ERROR,message:"internal_error"});e.end()}(n,e),g(n,e,o)),delete s[t]))}const{spanOrigin:_="auto.http.browser",propagateTraceparent:E=!1}="object"==typeof o?o:{spanOrigin:o},y=r.getClient(),S=!!i.getActiveSpan()||!!y&&d.hasSpanStreamingEnabled(y),v=p&&S?h.startInactiveSpan(T(f,c,_)):new u.SentryNonRecordingSpan;if(p&&!S&&y?.recordDroppedEvent("no_parent_span","span"),e.fetchData.__span=v.spanContext().spanId,s[v.spanContext().spanId]=v,n(e.fetchData.url)){const t=e.args[0],n={...e.args[1]||{}},r=m(t,n,l.hasSpansEnabled()&&S?v:void 0,E);r&&(e.args[1]=n,n.headers=r)}if(y){const t={input:e.args,response:e.response,startTimestamp:e.startTimestamp,endTimestamp:e.endTimestamp};y.emit("beforeOutgoingRequestSpan",v,t)}return v}},37872(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(44038),s=n(64284),i=n(57011),a=n(30242),o=n(67392),l=n(15363),c=n(55908),u=n(93754),d=n(28945),h=n(79816),f=n(8346),p=n(47473),g=n(52751),m=n(30238),_=n(79183),T=n(49564),E=n(37320),y=n(42810),S=n(73220),v=n(11348),b=n(69640),I=n(51929),A=n(85740),R=n(83913),C=n(27008),k=n(64450),L=n(52256),O=n(14082),N=n(82430),w=n(52311),P=n(83412),M=n(37402),D=n(31485),x=n(60251),U=n(51228),B=n(95150),F=n(46877),$=n(76354),G=n(72979),H=n(78182),j=n(78949),W=n(54583),K=n(64865),V=n(10393),q=n(55303),Y=n(20647),z=n(78371),J=n(145),X=n(19367),Q=n(23879),Z=n(87687),ee=n(56011),te=n(42501),ne=n(87990),re=n(68360),se=n(51179),ie=n(92958),ae=n(55873),oe=n(92215),le=n(75003),ce=n(431),ue=n(41312),de=n(17536),he=n(60262),fe=n(24208),pe=n(80699),ge=n(14867),me=n(70875),_e=n(98398),Te=n(94966),Ee=n(83090),ye=n(31096),Se=n(6933),ve=n(97373),be=n(85296),Ie=n(78604),Ae=n(63717),Re=n(39320),Ce=n(19575),ke=n(61038),Le=n(67935),Oe=n(57471),Ne=n(49464),we=n(47277),Pe=n(7747),Me=n(82054),De=n(13860),xe=n(60393),Ue=n(37135),Be=n(1170),Fe=n(50162),$e=n(92579),Ge=n(13161),He=n(85526),je=n(61126),We=n(83609),Ke=n(90153),Ve=n(72833),qe=n(21811),Ye=n(69960),ze=n(73969),Je=n(83389),Xe=n(39048),Qe=n(49759),Ze=n(53551),et=n(91535),tt=n(88532),nt=n(64702),rt=n(85110),st=n(96940),it=n(88585),at=n(77765),ot=n(96159),lt=n(73155),ct=n(31901),ut=n(89499),dt=n(23513),ht=n(70561),ft=n(79721),pt=n(21148),gt=n(94486),mt=n(26869),_t=n(23336),Tt=n(81857
1),Et=n(99188),yt=n(64841),St=n(28119),vt=n(5684),bt=n(9635),It=n(93395),At=n(43807),Rt=n(58913),Ct=n(6102),kt=n(47274),Lt=n(36823),Ot=n(89235),Nt=n(83031),wt=n(24842),Pt=n(58414),Mt=n(6855),Dt=n(86744),xt=n(69025),Ut=n(64548),Bt=n(13053),Ft=n(10537),$t=n(41335),Gt=n(56953),Ht=n(68904),jt=n(10571),Wt=n(31223),Kt=n(25073),Vt=n(36707),qt=n(52366),Yt=n(3138),zt=n(48937);t.registerSpanErrorInstrumentation=r.registerSpanErrorInstrumentation,t.getCapturedScopesOnSpan=s.getCapturedScopesOnSpan,t.setCapturedScopesOnSpan=s.setCapturedScopesOnSpan,t.TRACING_DEFAULTS=i.TRACING_DEFAULTS,t.startIdleSpan=i.startIdleSpan,t.SentrySpan=a.SentrySpan,t.SentryNonRecordingSpan=o.SentryNonRecordingSpan,t.SPAN_STATUS_ERROR=l.SPAN_STATUS_ERROR,t.SPAN_STATUS_OK=l.SPAN_STATUS_OK,t.SPAN_STATUS_UNSET=l.SPAN_STATUS_UNSET,t.getSpanStatusFromHttpCode=l.getSpanStatusFromHttpCode,t.setHttpStatus=l.setHttpStatus,t.SUPPRESS_TRACING_KEY=c.SUPPRESS_TRACING_KEY,t.continueTrace=c.continueTrace,t.startInactiveSpan=c.startInactiveSpan,t.startNewTrace=c.startNewTrace,t.startSpan=c.startSpan,t.startSpanManual=c.startSpanManual,t.suppressTracing=c.suppressTracing,t.withActiveSpan=c.withActiveSpan,t.getDynamicSamplingContextFromClient=u.getDynamicSamplingContextFromClient,t.getDynamicSamplingContextFromScope=u.getDynamicSamplingContextFromScope,t.getDynamicSamplingContextFromSpan=u.getDynamicSamplingContextFromSpan,t.spanToBaggageHeader=u.spanToBaggageHeader,t.setMeasurement=d.setMeasurement,t.timedEventsToMeasurements=d.timedEventsToMeasurements,t.sampleSpan=h.sampleSpan,t.logSpanEnd=f.logSpanEnd,t.logSpanStart=f.logSpanStart,t.captureSpan=p.captureSpan,t.safeSetSpanJSONAttributes=p.safeSetSpanJSONAttributes,t.GEN_AI_CONVERSATION_ID_ATTRIBUTE=g.GEN_AI_CONVERSATION_ID_ATTRIBUTE,t.SEMANTIC_ATTRIBUTE_CACHE_HIT=g.SEMANTIC_ATTRIBUTE_CACHE_HIT,t.SEMANTIC_ATTRIBUTE_CACHE_ITEM_SIZE=g.SEMANTIC_ATTRIBUTE_CACHE_ITEM_SIZE,t.SEMANTIC_ATTRIBUTE_CACHE_KEY=g.SEMANTIC_ATTRIBUTE_CACHE_KEY,t.SEMANTIC_ATTRIBUTE_EXCLUSIVE_TIME=g.SEMANTIC_ATTRIBUTE_EXCLUSIVE_TIME,t.SEMANTIC_ATTRIBUTE_HTTP_REQUEST_METHOD=g.SEMANTIC_ATTRIBUTE_HTTP_REQUEST_METHOD,t.SEMANTIC_ATTRIBUTE_PROFILE_ID=g.SEMANTIC_ATTRIBUTE_PROFILE_ID,t.SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME=g.SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME,t.SEMANTIC_ATTRIBUTE_SENTRY_ENVIRONMENT=g.SEMANTIC_ATTRIBUTE_SENTRY_ENVIRONMENT,t.SEMANTIC_ATTRIBUTE_SENTRY_IDLE_SPAN_FINISH_REASON=g.SEMANTIC_ATTRIBUTE_SENTRY_IDLE_SPAN_FINISH_REASON,t.SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_UNIT=g.SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_UNIT,t.SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_VALUE=g.SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_VALUE,t.SEMANTIC_ATTRIBUTE_SENTRY_OP=g.SEMANTIC_ATTRIBUTE_SENTRY_OP,t.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN=g.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,t.SEMANTIC_ATTRIBUTE_SENTRY_PREVIOUS_TRACE_SAMPLE_RATE=g.SEMANTIC_ATTRIBUTE_SENTRY_PREVIOUS_TRACE_SAMPLE_RATE,t.SEMANTIC_ATTRIBUTE_SENTRY_RELEASE=g.SEMANTIC_ATTRIBUTE_SENTRY_RELEASE,t.SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE=g.SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE,t.SEMANTIC_ATTRIBUTE_SENTRY_SDK_NAME=g.SEMANTIC_ATTRIBUTE_SENTRY_SDK_NAME,t.SEMANTIC_ATTRIBUTE_SENTRY_SDK_VERSION=g.SEMANTIC_ATTRIBUTE_SENTRY_SDK_VERSION,t.SEMANTIC_ATTRIBUTE_SENTRY_SEGMENT_ID=g.SEMANTIC_ATTRIBUTE_SENTRY_SEGMENT_ID,t.SEMANTIC_ATTRIBUTE_SENTRY_SEGMENT_NAME=g.SEMANTIC_ATTRIBUTE_SENTRY_SEGMENT_NAME,t.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE=g.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE,t.SEMANTIC_ATTRIBUTE_URL_FULL=g.SEMANTIC_ATTRIBUTE_URL_FULL,t.SEMANTIC_ATTRIBUTE_USER_EMAIL=g.SEMANTIC_ATTRIBUTE_USER_EMAIL,t.SEMANTIC_ATTRIBUTE_USER_ID=g.SEMANTIC_ATTRIBUTE_USER_ID,t.SEMANTIC_ATTRIBUTE_USER_IP_ADDRESS=g.SEMANTIC_ATTRIBUTE_USER_IP_ADDRESS,t.SEMANTIC_ATTRIBUTE_USER_USERNAME=g.SEMANTIC_ATTRIBUTE_USER_USERNAME,t.SEMANTIC_LINK_ATTRIBUTE_LINK_TYPE=g.SEMANTIC_LINK_ATTRIBUTE_LINK_TYPE,t.createEventEnvelope=m.createEventEnvelope,t.createSessionEnvelope=m.createSessionEnvelope,t.createSpanEnvelope=m.createSpanEnvelope,t.addEventProcessor=_.addEventProcessor,t.captureCheckIn=_.captureCheckIn,t.captureEvent=_.captureEvent,t.captureException=_.captureException,t.captureMessage=_.captureMessage,t.captureSession=_.captureSession,t.close=_.close,t.endSession=_.endSession,t.flush=_.flush,t.isEnabled=_.isEnabled,t.isInitialized=_.isInitialized,t.lastEventId=_.lastEventId,t.setContext=_.setContext,t.setConversationId=_.setConversationId,t.setExtra=_.setExtra,t.setExtras=_.setExtras,t.setTag=_.setTag,t.setTags=_.setTags,t.setUser=_.setUser,t.startSession=_.startSession,t.withMonitor=_.withMonitor,t.getClient=T.getClient,t.getCurrentScope=T.getCurrentScope,t.getExternalPropagationContext=T.getExternalPropagationContext,t.getGlobalScope=T.getGlobalScope,t.getIsolationScope=T.getIsolationScope,t.getTraceContextFromScope=T.getTraceContextFromScope,t.hasExternalPropagationContext=T.hasExternalPropagationContext,t.registerExternalPropagationContext=T.registerExternalPropagationContext,t.withIsolationScope=T.withIsolationScope,t.withScope=T.withScope,t.getDefaultCurrentScope=E.getDefaultCurrentScope,t.getDefaultIsolationScope=E.getDefaultIsolationScope,t.setAsyncContextStrategy=y.setAsyncContextStrategy,t.getGlobalSingleton=S.getGlobalSingleton,t.getMainCarrier=S.getMainCarrier,t.closeSession=v.closeSession,t.makeSession=v.makeSession,t.updateSession=v.updateSession,t.Scope=b.Scope,t.notifyEventProcessors=I.notifyEventProcessors,t.SENTRY_API_VERSION=A.SENTRY_API_VERSION,t.getEnvelopeEndpointWithUrlEncodedAuth=A.getEnvelopeEndpointWithUrlEncodedAuth,t.getReportDialogEndpoint=A.getReportDialogEndpoint,t.Client=R.Client,t.initAndBind=C.initAndBind,t.setCurrentClient=C.setCurrentClient,t.createTransport=k.createTransport,t.makeOfflineTransport=L.makeOfflineTransport,t.MULTIPLEXED_TRANSPORT_EXTRA_KEY=O.MULTIPLEXED_TRANSPORT_EXTRA_KEY,t.makeMultiplexedTransport=O.makeMultiplexedTransport,t.addIntegration=N.addIntegration,t.defineIntegration=N.defineIntegration,t.getIntegrationsToSetup=N.getIntegrationsToSetup,t.installedIntegrations=N.installedIntegrations,t._INTERNAL_clearAiProvi
1derSkips=w._INTERNAL_clearAiProviderSkips,t._INTERNAL_shouldSkipAiProviderWrapping=w._INTERNAL_shouldSkipAiProviderWrapping,t._INTERNAL_skipAiProviderWrapping=w._INTERNAL_skipAiProviderWrapping,t.envToBool=P.envToBool,t.applyScopeDataToEvent=M.applyScopeDataToEvent,t.getCombinedScopeData=M.getCombinedScopeData,t.mergeScopeData=M.mergeScopeData,t.prepareEvent=D.prepareEvent,t.createCheckInEnvelope=x.createCheckInEnvelope,t.hasSpansEnabled=U.hasSpansEnabled,t.isStreamedBeforeSendSpanCallback=B.isStreamedBeforeSendSpanCallback,t.withStreamedSpan=B.withStreamedSpan,t.isSentryRequestUrl=F.isSentryRequestUrl,t.handleCallbackErrors=$.handleCallbackErrors,t.fmt=G.fmt,t.parameterize=G.parameterize,t.handleTunnelRequest=H.handleTunnelRequest,t.addAutoIpAddressToSession=j.addAutoIpAddressToSession,t.addAutoIpAddressToUser=j.addAutoIpAddressToUser,t.INTERNAL_getSegmentSpan=W.INTERNAL_getSegmentSpan,t.addChildSpanToSpan=W.addChildSpanToSpan,t.convertSpanLinksForEnvelope=W.convertSpanLinksForEnvelope,t.getActiveSpan=W.getActiveSpan,t.getRootSpan=W.getRootSpan,t.getSpanDescendants=W.getSpanDescendants,t.getStatusMessage=W.getStatusMessage,t.spanIsSampled=W.spanIsSampled,t.spanTimeInputToSeconds=W.spanTimeInputToSeconds,t.spanToJSON=W.spanToJSON,t.spanToStreamedSpanJSON=W.spanToStreamedSpanJSON,t.spanToTraceContext=W.spanToTraceContext,t.spanToTraceHeader=W.spanToTraceHeader,t.updateSpanName=W.updateSpanName,t._INTERNAL_setSpanForScope=K._setSpanForScope,t.parseSampleRate=V.parseSampleRate,t.applySdkMetadata=q.applySdkMetadata,t.getTraceData=Y.getTraceData,t.shouldPropagateTraceForUrl=z.shouldPropagateTraceForUrl,t.getTraceMetaTags=J.getTraceMetaTags,t.debounce=X.debounce,t.derefWeakRef=Q.derefWeakRef,t.makeWeakRef=Q.makeWeakRef,t.shouldIgnoreSpan=Z.shouldIgnoreSpan,t.MAX_BODY_BYTE_LENGTH=ee.MAX_BODY_BYTE_LENGTH,t.captureBodyFromWinterCGRequest=ee.captureBodyFromWinterCGRequest,t.extractQueryParamsFromUrl=ee.extractQueryParamsFromUrl,t.getMaxBodyByteLength=ee.getMaxBodyByteLength,t.headersToDict=ee.headersToDict,t.httpHeadersToSpanAttributes=ee.httpHeadersToSpanAttributes,t.httpRequestToRequestData=ee.httpRequestToRequestData,t.winterCGHeadersToDict=ee.winterCGHeadersToDict,t.winterCGRequestToRequestData=ee.winterCGRequestToRequestData,t.DEFAULT_ENVIRONMENT=te.DEFAULT_ENVIRONMENT,t.DEV_ENVIRONMENT=te.DEV_ENVIRONMENT,t.addBreadcrumb=ne.addBreadcrumb,t.functionToStringIntegration=re.functionToStringIntegration,t.eventFiltersIntegration=se.eventFiltersIntegration,t.inboundFiltersIntegration=se.inboundFiltersIntegration,t.linkedErrorsIntegration=ie.linkedErrorsIntegration,t.moduleMetadataIntegration=ae.moduleMetadataIntegration,t.requestDataIntegration=oe.requestDataIntegration,t.captureConsoleIntegration=le.captureConsoleIntegration,t.dedupeIntegration=ce.dedupeIntegration,t.extraErrorDataIntegration=ue.extraErrorDataIntegration,t.rewriteFramesIntegration=de.rewriteFramesIntegration,t.instrumentSupabaseClient=he.instrumentSupabaseClient,t.supabaseIntegration=he.supabaseIntegration,t.zodErrorsIntegration=fe.zodErrorsIntegration,t.thirdPartyErrorFilterIntegration=pe.thirdPartyErrorFilterIntegration,t.consoleIntegration=ge.consoleIntegration,t.featureFlagsIntegration=me.featureFlagsIntegration,t.growthbookIntegration=_e.growthbookIntegration,t.conversationIdIntegration=Te.conversationIdIntegration,t.profiler=Ee.profiler,t._INTERNAL_getTracingHeadersForFetchRequest=ye._INTERNAL_getTracingHeadersForFetchRequest,t.instrumentFetchRequest=ye.instrumentFetchRequest,t.captureFeedback=Se.captureFeedback,t._INTERNAL_captureLog=ve._INTERNAL_captureLog,t._INTERNAL_captureSerializedLog=ve._INTERNAL_captureSerializedLog,t._INTERNAL_flushLogsBuffer=ve._INTERNAL_flushLogsBuffer,t.logger=be,t.consoleLoggingIntegration=Ie.consoleLoggingIntegration,t._INTERNAL_captureMetric=Ae._INT
1ERNAL_captureMetric,t._INTERNAL_captureSerializedMetric=Ae._INTERNAL_captureSerializedMetric,t._INTERNAL_flushMetricsBuffer=Ae._INTERNAL_flushMetricsBuffer,t.metrics=Re,t.createConsolaReporter=Ce.createConsolaReporter,t.addVercelAiProcessors=ke.addVercelAiProcessors,t._INTERNAL_cleanupToolCallSpanContext=Le._INTERNAL_cleanupToolCallSpanContext,t._INTERNAL_getSpanContextForToolCallId=Le._INTERNAL_getSpanContextForToolCallId,t._INTERNAL_toolCallSpanContextMap=Oe.toolCallSpanContextMap,t.instrumentOpenAiClient=Ne.instrumentOpenAiClient,t.OPENAI_INTEGRATION_NAME=we.OPENAI_INTEGRATION_NAME,t.instrumentAnthropicAiClient=Pe.instrumentAnthropicAiClient,t.ANTHROPIC_AI_INTEGRATION_NAME=Me.ANTHROPIC_AI_INTEGRATION_NAME,t.instrumentGoogleGenAIClient=De.instrumentGoogleGenAIClient,t.GOOGLE_GENAI_INTEGRATION_NAME=xe.GOOGLE_GENAI_INTEGRATION_NAME,t.createLangChainCallbackHandler=Ue.createLangChainCallbackHandler,t.LANGCHAIN_INTEGRATION_NAME=Be.LANGCHAIN_INTEGRATION_NAME,t.instrumentCreateReactAgent=Fe.instrumentCreateReactAgent,t.instrumentLangGraph=Fe.instrumentLangGraph,t.instrumentStateGraphCompile=Fe.instrumentStateGraphCompile,t.LANGGRAPH_INTEGRATION_NAME=$e.LANGGRAPH_INTEGRATION_NAME,t.SpanBuffer=Ge.SpanBuffer,t.hasSpanStreamingEnabled=He.hasSpanStreamingEnabled,t.spanStreamingIntegration=je.spanStreamingIntegration,t._INTERNAL_FLAG_BUFFER_SIZE=We._INTERNAL_FLAG_BUFFER_SIZE,t._INTERNAL_MAX_FLAGS_PER_SPAN=We._INTERNAL_MAX_FLAGS_PER_SPAN,t._INTERNAL_addFeatureFlagToActiveSpan=We._INTERNAL_addFeatureFlagToActiveSpan,t._INTERNAL_copyFlagsFromScopeToEvent=We._INTERNAL_copyFlagsFromScopeToEvent,t._INTERNAL_insertFlagToScope=We._INTERNAL_insertFlagToScope,t.applyAggregateErrorsToEvent=Ke.applyAggregateErrorsToEvent,t.getBreadcrumbLogLevelFromHttpStatusCode=Ve.getBreadcrumbLogLevelFromHttpStatusCode,t.dsnFromString=qe.dsnFromString,t.dsnToString=qe.dsnToString,t.makeDsn=qe.makeDsn,t.SentryError=Ye.SentryError,t.GLOBAL_OBJ=ze.GLOBAL_OBJ,t.addConsoleInstrumentationFilter=Je.addConsoleInstrumentationFilter,t.addConsoleInstrumentationHandler=Je.addConsoleInstrumentationHandler,t.addFetchEndInstrumentationHandler=Xe.addFetchEndInstrumentationHandler,t.addFetchInstrumentationHandler=Xe.addFetchInstrumentationHandler,t.addGlobalErrorInstrumentationHandler=Qe.addGlobalErrorInstrumentationHandler,t.addGlobalUnhandledRejectionInstrumentationHandler=Ze.addGlobalUnhandledRejectionInstrumentationHandler,t.addHandler=et.addHandler,t.maybeInstrument=et.maybeInstrument,t.resetInstrumentationHandlers=et.resetInstrumentationHandlers,t.triggerHandlers=et.triggerHandlers,t.isDOMError=tt.isDOMError,t.isDOMException=tt.isDOMException,t.isElement=tt.isElement,t.isError=tt.isError,t.isErrorEvent=tt.isErrorEvent,t.isEvent=tt.isEvent,t.isInstanceOf=tt.isInstanceOf,t.isParameterizedString=tt.isParameterizedString,t.isPlainObject=tt.isPlainObject,t.isPrimitive=tt.isPrimitive,t.isRegExp=tt.isRegExp,t.isString=tt.isString,t.isSyntheticEvent=tt.isSyntheticEvent,t.isThenable=tt.isThenable,t.isVueViewModel=tt.isVueViewModel,t.isBrowser=nt.isBrowser,t.CONSOLE_LEVELS=rt.CONSOLE_LEVELS,t.consoleSandbox=rt.consoleSandbox,t.debug=rt.debug,t.originalConsoleMethods=rt.originalConsoleMethods,t.addContextToFrame=st.addContextToFrame,t.addExceptionMechanism=st.addExceptionMechanism,t.addExceptionTypeValue=st.addExceptionTypeValue,t.checkOrSetAlreadyCaught=st.checkOrSetAlreadyCaught,t.getEventDescription=st.getEventDescription,t.isAlreadyCaptured=st.isAlreadyCaptured,t.parseSemver=st.parseSemver,t.uuid4=st.uuid4,t.normalize=it.normalize,t.normalizeToSize=it.normalizeToSize,t.normalizeUrlToBase=it.normalizeUrlToBase,t.setNormalizationDepthOverrideHint=at.setNormalizationDepthOverrideHint,t.setSkipNormalizationHint=at.setSkipNormalizationHint,t.addNonEnumerableProperty=ot.addNonEnumerableProperty,t.convertToPlainObject=ot.convertToPlainObject,t.dropUndefinedKeys=ot.dropUndefinedKeys,t.extractExceptionKeysForMessage=ot.extractExceptionKeysForMessage,t.fill=ot.fill,t.getOriginalFunction=ot.getOriginalFunction,t.markFunctionWrapped=ot.markFunctionWrapped,t.objectify=ot.objectify,t.basename=lt.basename,t.dirname=lt.dirname,t.isAbsolute=lt.isAbsolute,t.join=lt.join,t.normalizePath=lt.normalizePath,t.relative=lt.relative,t.resolve=lt.resolve,t.SENTRY_BUFFER_FULL_ERROR=ct.SENTRY_BUFFER_FULL_ERROR,t.makePromiseBuffer=ct.makePromiseBuffer,t.severityLevelFromString=ut.severityLevelFromString,t.replaceExports=dt.replaceExports,t.UNKNOWN_FUNCTION=ht.UNKNOWN_FUNCTION,t.createStackParser=ht.createStackParser,t.getFramesFromEvent=ht.getFramesFromEvent,t.getFunctionName=ht.getFunctionName,t.stackParserFromStackParserOptions=ht.stackParserFromStackParserOptions,t.stripSentryFramesAndReverse=ht.
1stripSentryFramesAndReverse,t.isMatchingPattern=ft.isMatchingPattern,t.safeJoin=ft.safeJoin,t.snipLine=ft.snipLine,t.stringMatchesSomePattern=ft.stringMatchesSomePattern,t.truncate=ft.truncate,t.isNativeFunction=pt.isNativeFunction,t.supportsDOMError=pt.supportsDOMError,t.supportsDOMException=pt.supportsDOMException,t.supportsErrorEvent=pt.supportsErrorEvent,t.supportsFetch=pt.supportsFetch,t.supportsHistory=pt.supportsHistory,t.supportsNativeFetch=pt.supportsNativeFetch,t.supportsReferrerPolicy=pt.supportsReferrerPolicy,t.supportsReportingObserver=pt.supportsReportingObserver,t.SyncPromise=gt.SyncPromise,t.rejectedSyncPromise=gt.rejectedSyncPromise,t.resolvedSyncPromise=gt.resolvedSyncPromise,t.browserPerformanceTimeOrigin=mt.browserPerformanceTimeOrigin,t.dateTimestampInSeconds=mt.dateTimestampInSeconds,t.timestampInSeconds=mt.timestampInSeconds,t.TRACEPARENT_REGEXP=_t.TRACEPARENT_REGEXP,t.extractTraceparentData=_t.extractTraceparentData,t.generateSentryTraceHeader=_t.generateSentryTraceHeader,t.generateTraceparentHeader=_t.generateTraceparentHeader,t.propagationContextFromHeaders=_t.propagationContextFromHeaders,t.shouldContinueTrace=_t.shouldContinueTrace,t.getSDKSource=Tt.getSDKSource,t.isBrowserBundle=Tt.isBrowserBundle,t.addItemToEnvelope=Et.addItemToEnvelope,t.createAttachmentEnvelopeItem=Et.createAttachmentEnvelopeItem,t.createEnvelope=Et.createEnvelope,t.createEventEnvelopeHeaders=Et.createEventEnvelopeHeaders,t.createSpanEnvelopeItem=Et.createSpanEnvelopeItem,t.envelopeContainsItemType=Et.envelopeContainsItemType,t.envelopeItemTypeToDataCategory=Et.envelopeItemTypeToDataCategory,t.forEachEnvelopeItem=Et.forEachEnvelopeItem,t.getSdkMetadataForEnvelopeHeader=Et.getSdkMetadataForEnvelopeHeader,t.parseEnvelope=Et.parseEnvelope,t.serializeEnvelope=Et.serializeEnvelope,t.createClientReportEnvelope=yt.createClientReportEnvelope,t.DEFAULT_RETRY_AFTER=St.DEFAULT_RETRY_AFTER,t.disabledUntil=St.disabledUntil,t.isRateLimited=St.isRateLimited,t.parseRetryAfterHeader=St.parseRetryAfterHeader,t.updateRateLimits=St.updateRateLimits,t.MAX_BAGGAGE_STRING_LENGTH=vt.MAX_BAGGAGE_STRING_LENGTH,t.SENTRY_BAGGAGE_KEY_PREFIX=vt.SENTRY_BAGGAGE_KEY_PREFIX,t.SENTRY_BAGGAGE_KEY_PREFIX_REGEX=vt.SENTRY_BAGGAGE_KEY_PREFIX_REGEX,t.baggageHeaderToDynamicSamplingContext=vt.baggageHeaderToDynamicSamplingContext,t.dynamicSamplingContextToSentryBaggageHeader=vt.dynamicSamplingContextToSentryBaggageHeader,t.mergeBaggageHeaders=vt.mergeBaggageHeaders,t.objectToBaggageHeader=vt.objectToBaggageHeader,t.parseBaggageHeader=vt.parseBaggageHeader,t.getHttpSpanDetail
1sFromUrlObject=bt.getHttpSpanDetailsFromUrlObject,t.getSanitizedUrlString=bt.getSanitizedUrlString,t.getSanitizedUrlStringFromUrlObject=bt.getSanitizedUrlStringFromUrlObject,t.isURLObjectRelative=bt.isURLObjectRelative,t.parseStringToURLObject=bt.parseStringToURLObject,t.parseUrl=bt.parseUrl,t.stripDataUrlContent=bt.stripDataUrlContent,t.stripUrlQueryAndFragment=bt.stripUrlQueryAndFragment,t._INTERNAL_enhanceErrorWithSentryInfo=It._enhanceErrorWithSentryInfo,t.eventFromMessage=It.eventFromMessage,t.eventFromUnknownInput=It.eventFromUnknownInput,t.exceptionFromError=It.exceptionFromError,t.parseStackFrames=It.parseStackFrames,t.LRUMap=At.LRUMap,t.generateSpanId=Rt.generateSpanId,t.generateTraceId=Rt.generateTraceId,t.SDK_VERSION=Ct.SDK_VERSION,t.getDebugImagesForResources=kt.getDebugImagesForResources,t.getFilenameToDebugIdMap=kt.getFilenameToDebugIdMap,t.getFilenameToMetadataMap=Lt.getFilenameToMetadataMap,t.escapeStringForRegex=Ot.escapeStringForRegex,t._INTERNAL_safeDateNow=Nt.safeDateNow,t._INTERNAL_safeMathRandom=Nt.safeMathRandom,t._INTERNAL_withRandomSafeContext=Nt.withRandomSafeContext,t.ServerRuntimeClient=wt.ServerRuntimeClient,t.trpcMiddleware=Pt.trpcMiddleware,t.wrapMcpServerWithSentry=Mt.wrapMcpServerWithSentry,t.isNodeEnv=Dt.isNodeEnv,t.loadModule=Dt.loadModule,t.filenameIsInApp=xt.filenameIsInApp,t.node=xt.node,t.nodeStackLineParser=xt.nodeStackLineParser,t.vercelWaitUntil=Ut.vercelWaitUntil,t.flushIfServerless=Bt.flushIfServerless,t.callFrameToStackFrame=Ft.callFrameToStackFrame,t.watchdogTimer=Ft.watchdogTimer,t._INTERNAL_safeUnref=$t.safeUnref,t.expressErrorHandler=Gt.expressErrorHandler,t.patchExpressModule=Gt.patchExpressModule,t.setupExpressErrorHandler=Gt.setupExpressErrorHandler,t.instrumentPostgresJsSql=Ht.instrumentPostgresJsSql,t.patchHttpModuleClient=jt.patchHttpModuleClient,t.getHttpClientSubscriptions=Wt.getHttpClientSubscriptions,t.addOutgoingRequestBreadcrumb=Kt.addOutgoingRequestBreadcrumb,t.getRequestOptions=Vt.getRequestOptions,t.getRequestUrl=Vt.getRequestUrl,t.getRequestUrlFromClientRequest=Vt.getRequestUrlFromClientRequest,t.getRequestUrlObject=Vt.getRequestUrlObject,t.HTTP_ON_CLIENT_REQUEST=qt.HTTP_ON_CLIENT_REQUEST,t.HTTP_ON_SERVER_REQUEST=qt.HTTP_ON_SERVER_REQUEST,t.getComponentName=Yt.getComponentName,t.getLocationHref=Yt.getLocationHref,t.htmlTreeAsString=Yt.htmlTreeAsString,t.instrumentLangChainEmbeddings=zt.instrumentLangChainEmbeddings},83389(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(68974),s=n(85110),i=n(96159),a=n(79721),o=n(73969),l=n(91535),c=new Set([]);function u(){"console"in o.GLOBAL_OBJ&&s.CONSOLE_LEVELS.forEach((function(e){e in o.GLOBAL_OBJ.console&&i.fill(o.GLOBAL_OBJ.console,e,(function(t){return s.originalConsoleMethods[e]=t,function(...t){const n=t[0],i=s.originalConsoleMethods[e],u=c.size&&"string"==typeof n&&a.stringMatchesSomePattern(n,c);u||l.triggerHandlers("console",{args:t,level:e}),(!u||r.DEBUG_BUILD&&s.debug.isEnabled())&&i?.apply(o.GLOBAL_OBJ.console,t)}}))}))}t.addConsoleInstrumentationFilter=function(e){for(const t of e)c.add(t);return()=>{for(const t of e)c.delete(t)}},t.addConsoleInstrumentationHandler=function(e){const t="console",n=l.addHandler(t,e);return l.maybeInstrument(t,u),n}},39048(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(49564),s=n(88532),i=n(96159),a=n(21148),o=n(26869),l=n(73969),c=n(91535);function u(e,t=!1){t&&!a.supportsNativeFetch()||i.fill(l.GLOBAL_OBJ,"fetch",(function(t){return function(...n){const a=new Error,{method:u,url:d}=p(n),h={args:n,fetchData:{method:u,url:d},startTimestamp:1e3*o.timestampInSeconds(),virtualError:a,headers:g(n)};return e||c.triggerHandlers("fetch",{...h}),t.apply(l.GLOBAL_OBJ,n).then((async t=>(e?e(t):c.triggerHandlers("fetch",{...h,endTimestamp:1e3*o.timestampInSeconds(),response:t}),t)),(e=>{c.triggerHandlers("fetch",{...h,endTimestamp:1e3*o.timestampInSeconds(),error:e}),s.isError(e)&&void 0===e.stack&&(e.stack=a.stack,i.addNonEnumerableProperty(e,"framesToPop",1));const t=r.getClient(),n=t?.getOptions().enhanceFetchErrorMessages??"always";if(!1!==n&&e instanceof TypeError&&("Failed to fetch"===e.message||"Load failed"===e.message||"NetworkError when attempting to fetch resource."===e.message))try{const t=new URL(h.fetchData.url).host;"always"===n?e.message=`${e.message} (${t})`:i.addNonEnumerableProperty(e,"__sentry_fetch_url_host__",t)}catch{}throw e}))}}))}function d(e){let t;try{t=e.clone()}catch{return}!async function(e,t){if(e?.body){const n=e.body,r=n.getReader(),s=setTimeout((()=>{n.cancel().then(null,(()=>{}))}),9e4);let i=!0;for(;i;){let e;try{e=setTimeout((()=>{n.cancel().then(null,(()=>{}))}),5e3);const{done:s}=await r.read();clearTimeout(e),s&&(t(),i=!1)}catch{i=!1}finally{clearTimeout(e)}}clearTimeout(s),r.releaseLock(),n.cancel().then(null,(()=>{}))}}(t,(()=>{c.triggerHandlers("fetch-body-resolved",{endTimestamp:1e3*o.timestampInSeconds(),response:e})}))}function h(e,t){return!!e&&"object"==typeof e&&!!e[t]}function f(e){return"string"==typeof e?e:e?h(e,"url")?e.url:e.toString?e.toString():"":""}function p(e){if(0===e.length)return{method:"GET",url:""};if(2===e.length){const[t,n]=e;return{url:f(t),method:h(n,"method")?String(n.method).toUpperCase():s.isRequest(t)&&h(t,"method")?String(t.method).toUpperCase():"GET"}}const t=e[0];return{url:f(t),method:h(t,"method")?String(t.method).toUpperCase():"GET"}}function g(e){const[t,n]=e;try{if("object"==typeof n&&null!==n&&"headers"in n&&n.headers)return new Headers(n.headers);if(s.isRequest(t))return new Headers(t.headers)}catch{}}t.addFetchEndInstrumentationHandler=function(e){const t="fetch-body-resolved",n=c.addHandler(t,e);return c.maybeInstrument(t,(()=>u(d))),n},t.addFetchInstrumentationHandler=function(e,t){const n="fetch",r=c.addHandler(n,e);return c.maybeInstrument(n,(()=>u(void 0,t))),r},t.parseFetchArgs=p},49759(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(73969),s=n(91535);let i=null;function a(){i=r.GLOBAL_OBJ.onerror,r.GLOBAL_OBJ.onerror=function(e,t,n,r,a){const o={column:r,error:a,line:n,msg:e,url:t};return s.triggerHandlers("error",o),!!i&&i.apply(this,arguments)},r.GLOBAL_OBJ.onerror.__SENTRY_INSTRUMENTED__=!0}t.addGlobalErrorInstrumentationHandler=function(e){const t="error";s.addHandler(t,e),s.maybeInstrument(t,a)}},53551(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(73969),s=n(91535);let i=null;function a(){i=r.GLOBAL_OBJ.onunhandledrejection,r.GLOBAL_OBJ.onunhandledrejection=function(e){const t=e;return s.triggerHandlers("unhandledrejection",t),!i||i.apply(this,arguments)},r.GLOBAL_OBJ.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}t.addGlobalUnhandledRejectionInstrumentationHandler=function(e){const t="unhandledrejection";s.addHandler(t,e),s.maybeInstrument(t,a)}},91535(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(68974),s=n(85110),i=n(70561),a={},o={};t.addHandler=function(e,t){return a[e]=a[e]||[],a[e].push(t),()=>{const n=a[e];if(n){const e=n.indexOf(t);-1!==e&&n.splice(e,1)}}},t.maybeInstrument=function(e,t){if(!o[e]){o[e]=!0;try{t()}catch(t){r.DEBUG_BUILD&&s.debug.error(`Error while instrumenting ${e}`,t)}}},t.resetInstrumentationHandlers=function(){Object.keys(a).forEac
1h((e=>{a[e]=void 0}))},t.triggerHandlers=function(e,t){const n=e&&a[e];if(n)for(const a of n)try{a(t)}catch(t){r.DEBUG_BUILD&&s.debug.error(`Error while triggering instrumentation handler.\nType: ${e}\nName: ${i.getFunctionName(a)}\nError:`,t)}}},82430(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(49564),s=n(68974),i=n(85110),a=[];function o(e,t,n){if(n[t.name])s.DEBUG_BUILD&&i.debug.log(`Integration skipped because it was already installed: ${t.name}`);else{if(n[t.name]=t,a.includes(t.name)||"function"!=typeof t.setupOnce||(t.setupOnce(),a.push(t.name)),t.setup&&"function"==typeof t.setup&&t.setup(e),"function"==typeof t.preprocessEvent){const n=t.preprocessEvent.bind(t);e.on("preprocessEvent",((t,r)=>n(t,r,e)))}if("function"==typeof t.processEvent){const n=t.processEvent.bind(t),r=Object.assign(((t,r)=>n(t,r,e)),{id:t.name});e.addEventProcessor(r)}["processSpan","processSegmentSpan"].forEach((n=>{const r=t[n];"function"==typeof r&&e.on(n,(n=>r.call(t,n,e)))})),s.DEBUG_BUILD&&i.debug.log(`Integration installed: ${t.name}`)}}t.addIntegration=function(e){const t=r.getClient();t?t.addIntegration(e):s.DEBUG_BUILD&&i.debug.warn(`Cannot add integration "${e.name}" because no SDK Client is available.`)},t.afterSetupIntegrations=function(e,t){for(const n of t)n?.afterAllSetup&&n.afterAllSetup(e)},t.defineIntegration=function(e){return e},t.getIntegrationsToSetup=function(e){const t=e.defaultIntegrations||[],n=e.integrations;let r;if(t.forEach((e=>{e.isDefaultInstance=!0})),Array.isArray(n))r=[...t,...n];else if("function"==typeof n){const e=n(t);r=Array.isArray(e)?e:[e]}else r=t;return function(e){const t={};return e.forEach((e=>{const{name:n}=e,r=t[n];r&&!r.isDefaultInstance&&e.isDefaultInstance||(t[n]=e)})),Object.values(t)}(r)},t.installedIntegrations=a,t.setupIntegration=o,t.setupIntegrations=function(e,t){const n={};return t.forEach((t=>{t?.beforeSetup&&t.beforeSetup(e)})),t.forEach((t=>{t&&o(e,t,n)})),n}},75003(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(49564),s=n(79183),i=n(83389),a=n(82430),o=n(85110),l=n(96940),c=n(89499),u=n(79721),d=n(73969),h=a.defineIntegration(((e={})=>{const t=e.levels||o.CONSOLE_LEVELS,n=e.handled??!0;return{name:"CaptureConsole",setup(e){"console"in d.GLOBAL_OBJ&&i.addConsoleInstrumentationHandler((({args:i,level:a})=>{r.getClient()===e&&t.includes(a)&&function(e,t,n){const i=c.severityLevelFromString(t),a=new Error,o={level:c.severityLevelFromString(t),extra:{arguments:e}};r.withScope((r=>{if(r.addEventProcessor((e=>(e.logger="console",l.addExceptionMechanism(e,{handled:n,type:"auto.core.capture_console"}),e))),"assert"===t){if(!e[0]){const t=`Assertion failed: ${u.safeJoin(e.slice(1)," ")||"console.assert"}`;r.setExtra("arguments",e.slice(1)),r.captureMessage(t,i,{captureContext:o,syntheticException:a})}return}const c=e.find((e=>e instanceof Error));if(c)return void s.captureException(c,o);const d=u.safeJoin(e," ");r.captureMessage(d,i,{captureContext:o,syntheticException:a})}))}(i,a,n)}))}}}));t.captureConsoleIntegration=h},19575(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(49564),s=n(97373),i=n(59075),a=n(88532),o=n(88585),l=["trace","debug","info","warn","error","fatal"];const c={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"},u={0:"fatal",1:"warn",2:"info",3:"info",4:"debug",5:"trace"};t.createConsolaReporter=function(e={}){const t=new Set(e.levels??l),n=e.client;return{log(e){const{type:l,level:d,message:h,args:f,tag:p,date:g,...m}=e,_=n||r.getClient();if(!_)return;const T=function(e,t){if("verbose"===e)return"debug";if("silent"===e)return"trace";if(e){const t=c[e];if(t)return t}if("number"==typeof t){const e=u[t];if(e)return e}return"info"}(l,d);if(!t.has(T))return;const{normalizeDepth:E=3,normalizeMaxBreadth:y=1e3}=_.getOptions(),S={};for(const[e,t]of Object.entries(m))S[e]=o.normalize(t,E,y);S["sentry.origin"]="auto.log.consola",p&&(S["consola.tag"]=p),l&&(S["consola.type"]=l),null!=d&&"number"==typeof d&&(S["consola.level"]=d);const v=function(e,t,n){const{message:r,attributes:s,messageTemplate:a,messageParameters:l}=e,c={};if(a&&l){const e=i.createConsoleTemplateAttributes(a,l);for(const[r,s]of Object.entries(e))c[r]=r.startsWith("sentry.message.parameter.")?o.normalize(s,t,n):s}else l&&l.length>0&&l.forEach(((e,r)=>{c[`sentry.message.parameter.${r}`]=o.normalize(e,t,n)}));return{message:r,attributes:{...o.normalize(s,t,n),...c}}}(function(e,t,n){if(!e?.length)return{message:""};const r=i.formatConsoleArgs(e,t,n),s=e[0];if(a.isPlainObject(s)){const t="string"==typeof e[1]?2:1;return{message:r,attributes:s,messageParameters:e.slice(t)}}{const t=e.slice(1),n=t.length>0&&"string"==typeof s&&!i.hasConsoleSubstitutions(s);return{message:r,messageTemplate:n?s:void 0,messageParameters:n?t:void 0}}}(f,E,y),E,y);v?.attributes&&Object.assign(S,v.attributes),s._INTERNAL_captureLog({level:T,message:v?.message||h||f&&i.formatConsoleArgs(f,E,y)||"",attributes:S})}}}}
1,14867(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(87990),s=n(49564),i=n(83389),a=n(82430),o=n(85110),l=n(89499),c=n(79721),u=n(73969),d=a.defineIntegration(((e={})=>{const t=new Set(e.levels||o.CONSOLE_LEVELS);return{name:"Console",setup(n){const r=i.addConsoleInstrumentationHandler((({args:e,level:r})=>{s.getClient()===n&&t.has(r)&&h(r,e)}));if(n.registerCleanup(r),e.filter){const t=i.addConsoleInstrumentationFilter(e.filter);n.registerCleanup(t)}}}}));function h(e,t){const n={category:"console",data:{arguments:t,logger:"console"},level:l.severityLevelFromString(e),message:f(t)};if("assert"===e){if(!1!==t[0])return;{const e=t.slice(1);n.message=e.length>0?`Assertion failed: ${f(e)}`:"Assertion failed",n.data.arguments=e}}r.addBreadcrumb(n,{input:t,level:e})}function f(e){return"util"in u.GLOBAL_OBJ&&"function"==typeof u.GLOBAL_OBJ.util.format?u.GLOBAL_OBJ.util.format(...e):c.safeJoin(e," ")}t.addConsoleBreadcrumb=h,t.consoleIntegration=d},94966(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(49564),s=n(82430),i=n(52751),a=n(54583),o=s.defineIntegration((()=>({name:"ConversationId",setup(e){e.on("spanStart",(e=>{const t=r.getCurrentScope().getScopeData(),n=r.getIsolationScope().getScopeData(),s=t.conversationId||n.conversationId;if(s){const{op:t,data:n,description:r}=a.spanToJSON(e);if(!t?.startsWith("gen_ai.")&&!n["ai.operationId"]&&!r?.startsWith("ai."))return;e.setAttribute(i.GEN_AI_CONVERSATION_ID_ATTRIBUTE,s)}}))}})));t.conversationIdIntegration=o},431(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(68974),s=n(82430),i=n(85110),a=n(70561),o=s.defineIntegration((()=>{let e;return{name:"Dedupe",processEvent(t){if(t.type)return t;try{if(l(t,e))return r.DEBUG_BUILD&&i.debug.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return e=t}}}));function l(e,t){return!!t&&(!!function(e,t){const n=e.message,r=t.message;if(!n&&!r)return!1;if(n&&!r||!n&&r)return!1;if(n!==r)return!1;if(!u(e,t))return!1;if(!c(e,t))return!1;return!0}(e,t)||!!function(e,t){const n=d(t),r=d(e);if(!n||!r)return!1;if(n.type!==r.type||n.value!==r.value)return!1;if(!u(e,t))return!1;if(!c(e,t))return!1;return!0}(e,t))}function c(e,t){let n=a.getFramesFromEvent(e),r=a.getFramesFromEvent(t);if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;if(r.length!==n.length)return!1;for(let e=0;e<r.length;e++){const t=r[e],s=n[e];if(t.filename!==s.filename||t.lineno!==s.lineno||t.colno!==s.colno||t.function!==s.function)return!1}return!0}function u(e,t){let n=e.fingerprint,r=t.fingerprint;if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;try{return!(n.join("")!==r.join(""))}catch{return!1}}function d(e){return e.exception?.values?.[0]}t._shouldDropEvent=l,t.dedupeIntegration=o},51179(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(68974),s=n(82430),i=n(85110),a=n(27389),o=n(96940),l=n(79721),c=[/^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$/],u=s.defineIntegration(((e={})=>{let t;return{name:"EventFilters",setup(n){const r=n.getOptions();t=h(e,r)},processEvent(n,s,c){if(!t){const n=c.getOptions();t=h(e,n)}return function(e,t){if(e.type){if("transaction"===e.type&&function(e,t){if(!t?.length)return!1;const n=e.transaction;return!!n&&l.stringMatchesSomePattern(n,t)}(e,t.ignoreTransactions))return r.DEBUG_BUILD&&i.debug.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.\nEvent: ${o.getEventDescription(e)}`),!0}else{if(function(e,t){if(!t?.length)return!1;return a.getPossibleEventMessages(e).some((e=>l.stringMatchesSomePattern(e,t)))}(e,t.ignoreErrors))return r.DEBUG_BUILD&&i.debug.warn(`Event dropped due to being matched by \`ignoreErrors\` option.\nEvent: ${o.getEventDescription(e)}`),!0;if(function(e){if(!e.exception?.values?.length)return!1;return!e.message&&!e.exception.values.some((e=>e.stacktrace||e.type&&"Error"!==e.type||e.value))}(e))return r.DEBUG_BUILD&&i.debug.warn(`Event dropped due to not having an error message, error type or stacktrace.\nEvent: ${o.getEventDescription(e)}`),!0;if(function(e,t){if(!t?.length)return!1;const n=f(e);return!!n&&l.stringMatchesSomePattern(n,t)}(e,t.denyUrls))return r.DEBUG_BUILD&&i.debug.warn(`Event dropped due to being matched by \`denyUrls\` option.\nEvent: ${o.getEventDescription(e)}.\nUrl: ${f(e)}`),!0;if(!function(e,t){if(!t?.length)return!0;const n=f(e);return!n||l.stringMatchesSomePattern(n,t)}(e,t.allowUrls))return r.DEBUG_BUILD&&i.debug.warn(`Event dropped due to not being matched by \`allowUrls\` option.\nEvent: ${o.getEventDescription(e)}.\nUrl: ${f(e)}`),!0}return!1}(n,t)?null:n}}})),d=s.defineIntegration(((e={})=>({...u(e),name:"InboundFilters"})));function h(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...e.disableErrorDefaults?[]:c],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[]]}}function f(e){try{const t=[...e.exception?.values??[]].reverse().find((e=>void 0===e.mechanism?.parent_id&&e.stacktrace?.frames?.length)),n=t?.stacktrace?.frames;return n?function(e=[]){for(let t=e.length-1;t>=0;t--){const n=e[t];if(n&&"<anonymous>"!==n.filename&&"[native code]"!==n.filename)return n.filename||null}return null}(n):null}catch{return r.DEBUG_BUILD&&i.debug.error(`Cannot extract url for event ${o.getEventDescription(e)}`),null}}t.eventFiltersIntegration=u,t.inboundFiltersIntegration=d},56953(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85110),s=n(79183),i=n(68974),a=n(14036),o=n(96159),l=n(73855),c=n(89058),u=n(29057);let d=!1;function h(e){return function(t,n,r,i){c.setSDKProcessingMetadata(n);if((e?.shouldHandleError||a.defaultShouldHandleError)(t)){const e=s.captureException(t,{mechanism:{type:"auto.middleware.express",handled:!1}});r.sentry=e}i(t)}}t.expressErrorHandler=h,t.patchExpressModule=function(e,t){let n,s;if(!t&&e.express){const{express:t,...a}=e;s=t,n=()=>a,d||(d=!0,i.DEBUG_BUILD&&r.debug.warn("[Express] `patchExpressModule(options)` is deprecated. Use `patchExpressModule(moduleExports, getOptions)` instead."))}else{if("function"!=typeof t)throw new TypeError("`patchExpressModule(moduleExports, getOptions)` requires a `getOptions` callback");n=t,s=e}const c=u.getDefaultExport(s),h=a.isExpressWithRouterPrototype(c)?c.Router.prototype:a.isExpressWithoutRouterPrototype(c)?c.Router:void 0;if(!h)throw new TypeError("no valid Express route function to instrument");const f=h.route;try{o.wrapMethod(h,"route",(function(...e){const t=f.apply(this,e),r=this.stack[this.stack.length-1];return l.patchLayer(n,r,a.getLayerPath(e)),t}))}catch(e){i.DEBUG_BUILD&&r.debug.error("Failed to patch express route method:",e)}const p=h.use;try{o.wrapMethod(h,"use",(function(...e){const t=p.apply(this,e),r=this.stack[this.stack.length-1];return r?(l.patchLayer(n,r,a.getLayerPath(e)),t):t}))}catch(e){i.DEBUG_BUILD&&r.debug.error("Failed to patch express use method:",e)}const{application:g}=c,m=g.use;try{o.wrapMethod(g,"use",(function(...e){const t=m.apply(this,e),r=a.isExpressWithRouterPrototype(c)?this.router:this._router;if(r){const t=r.stack[r.stack.length-1];t&&l.patchLayer(n,t,a.getLayerPath(e))}return t}))}catch(e){i.DEBUG_BUILD&&r.debug.error("Failed to patch express application.use method:",e)}return c},t.setupExpressErrorHandler=function(e,t){e.use((function(e,t,n){c.setSDKProcessingMetadata(e),n()})),e.use(h(t))}},73855(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(68974),s=n(52751),i=n(85110),a=n(54583),o=n(15363),l=n(96159),c=n(49564),u=n(55908),d=n(10096),h=n(66568),f=n(14036),p=n(37320),g=n(89058);t.patchLayer=function(e,t,n){if(!t?.handle)return;const m=t,_=m.handle;if(!l.getOriginalFunction(_)&&4!==_.length){for(const e in _)e in T||Object.defineProperty(T,e,{get:()=>_[e],set(t){_[e]=t}});l.markFunctionWrapped(T,_),Object.defineProperty(m,"handle",{enumerable:!0,configurable:!0,writable:!0,value:T})}function T(t,l,...T){const E=e();g.setSDKProcessingMetadata(t);const y=a.getActiveSpan();if(!y)return _.apply(this,[t,l,...T]);n&&d.storeLayer(t,n);const S=d.getStoredLayers(t),v=!!n,b=f.getConstructedRoute(t),I=f.getActualMatchedRoute(t,b);E.onRouteResolved?.(I);const A=f.getLayerMetadata(b,m,n),R=A.attributes[h.ATTR_EXPRESS_NAME],C=A.attributes[h.ATTR_EXPRESS_TYPE],k=Object.assign(A.attributes,{[s.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]:"auto.http.express",[s.SEMANTIC_ATTRIBUTE_SENTRY_OP]:`${C}.express`});if(I&&(k[h.ATTR_HTTP_ROUTE]=I),f.isLayerIgnored(A.attributes[h.ATTR_EXPRESS_NAME],C,E)
1)return v&&S.pop(),_.apply(this,[t,l,...T]);const L=c.getIsolationScope();if(L!==p.getDefaultIsolationScope()){if("request_handler"===C){const e=t.method?t.method.toUpperCase():"GET";L.setTransactionName(`${e} ${b}`)}}else r.DEBUG_BUILD&&i.debug.warn("Isolation scope is still default isolation scope - skipping setting transactionName");return u.startSpanManual({name:R,attributes:k},(e=>{let n=!1;A.attributes[h.ATTR_EXPRESS_TYPE]===h.ExpressLayerType_ROUTER&&(e.end(),n=!0);const r=()=>{n||(n=!0,e.end())};for(let s=0;s<T.length;s++){const i=T[s];if("function"==typeof i){T[s]=function(...s){const a=s[0],c=!!a&&"route"!==a&&"router"!==a;if(!n&&c){const[t,n]=f.asErrorAndMessage(a);e.setStatus({code:o.SPAN_STATUS_ERROR,message:n})}return n||(n=!0,l.removeListener("finish",r),e.end()),t.route&&c||!v||S.pop(),u.withActiveSpan(y,(()=>i.apply(this,s)))};break}}try{return _.apply(this,[t,l,...T])}catch(t){const[n,r]=f.asErrorAndMessage(t);throw e.setStatus({code:o.SPAN_STATUS_ERROR,message:r}),t}finally{n||l.once("finish",r)}}))}}},10096(e,t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const n=new WeakMap;t.getStoredLayers=e=>{let t=n.get(e);return t||(t=[],n.set(e,t)),t},t.storeLayer=(e,t)=>{const r=n.get(e);r?r.push(t):n.set(e,[t])}},89058(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(49564),s=n(56011);t.setSDKProcessingMetadata=function(e){const t=r.getIsolationScope()?.getScopeData()?.sdkProcessingMetadata;if(!t?.normalizedRequest){const t=s.httpRequestToRequestData(e);r.getIsolationScope().setSDKProcessingMetadata({normalizedRequest:t})}}},66568(e,t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});t.ATTR_EXPRESS_NAME="express.name",t.ATTR_EXPRESS_TYPE="express.type",t.ATTR_HTTP_ROUTE="http.route",t.ExpressLayerType_MIDDLEWARE="middleware",t.ExpressLayerType_REQUEST_HANDLER="request_handler",t.ExpressLayerType_ROUTER="router"},14036(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(10096),s=n(66568),i=n(79721);function a(e){return e.includes(":")||e.includes("*")}const o=(e,t)=>{const n=Array.isArray(t.handle?.stack)?t.handle?.stack?.[0]:void 0;return n?.route?.path?`${e}${n.route.path}`:n&&Array.isArray(n?.handle?.stack)?o(e,n):e};const l=e=>"string"==typeof e?e:e instanceof RegExp||"number"==typeof e?String(e):void 0,c=e=>u(e?.Router?.prototype),u=e=>("object"==typeof e||"function"==typeof e)&&!!e&&"route"in e&&"function"==typeof e.route;t.asErrorAndMessage=e=>e instanceof Error?[e,e.message]:[String(e),String(e)],t.defaultShouldHandleError=function(e){return function(e){const t=e.status||e.statusCode||e.status_code||e.output?.statusCode;return t?parseInt(t,10):500}(e)>=500},t.getActualMatchedRoute=function(e,t){const n=r.getStoredLayers(e);if(0===n.length)return;if(n.every((e=>"/"===e)))return"/"===e.originalUrl?"/":void 0;if("*"===t)return t;if(t.includes("/")&&(t.includes(",")||t.includes("\\")||t.includes("*")||t.includes("[")))return t;const s=t.startsWith("/")?t:`/${t}`;return s.length>0&&(e.originalUrl===s||e.originalUrl.startsWith(s)||a(s))?s:void 0},t.getConstructedRoute=function(e){const t=r.getStoredLayers(e);let n="";for(const e of t)"/"!==e&&"/*"!==e&&(n+=!n||n.endsWith("/")?e:`/${e}`);return n.replace(/\/{2,}/g,"/")},t.getLayerMetadata=(e,t,n)=>{if("router"===t.name){const r=o("",t),i=r||(n||e||"/");return{attributes:{[s.ATTR_EXPRESS_NAME]:i,[s.ATTR_EXPRESS_TYPE]:s.ExpressLayerType_ROUTER},name:`router - ${i}`}}return"bound dispatch"===t.name||"handle"===t.name?{attributes:{[s.ATTR_EXPRESS_NAME]:(e||n)??"request handler",[s.ATTR_EXPRESS_TYPE]:s.ExpressLayerType_REQUEST_HANDLER},name:"request handler"+(t.path?` - ${e||n}`:"")}:{attributes:{[s.ATTR_EXPRESS_NAME]:t.name,[s.ATTR_EXPRESS_TYPE]:s.ExpressLayerType_MIDDLEWARE},name:`middleware - ${t.name}`}},t.getLayerPath=e=>{const t=e[0];return Array.isArray(t)?t.map((e=>l(e)||"")).join(","):l(t)},t.getRouterPath=o,t.isExpressWithRouterPrototype=c,t.isExpressWithoutRouterPrototype=e=>u(e.Router)&&!c(e),t.isLayerIgnored=(e,t,n)=>{if(Array.isArray(n?.ignoreLayersType)&&n?.ignoreLayersType?.includes(t))return!0;
1if(!Array.isArray(n?.ignoreLayers))return!1;try{return i.stringMatchesSomePattern(e,n.ignoreLayers,!0)}catch{}return!1},t.isRoutePattern=a},41312(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(68974),s=n(82430),i=n(85110),a=n(88532),o=n(88585),l=n(77765),c=n(79721),u=s.defineIntegration(((e={})=>{const{depth:t=3,captureErrorCause:n=!0}=e;return{name:"ExtraErrorData",processEvent(e,r,s){const{maxValueLength:i}=s.getOptions();return function(e,t={},n,r,s){if(!t.originalException||!a.isError(t.originalException))return e;const i=t.originalException.name||t.originalException.constructor.name,c=d(t.originalException,r,s);if(c){const t={...e.contexts},r=o.normalize(c,n);return a.isPlainObject(r)&&(l.setSkipNormalizationHint(r),t[i]=r),{...e,contexts:t}}return e}(e,r,t,n,i)}}}));function d(e,t,n){try{const r=["name","message","stack","line","column","fileName","lineNumber","columnNumber","toJSON"],s={};for(const t of Object.keys(e)){if(-1!==r.indexOf(t))continue;const i=e[t];s[t]=a.isError(i)||"string"==typeof i?n?c.truncate(`${i}`,n):`${i}`:i}if(t&&void 0!==e.cause)if(a.isError(e.cause)){const t=e.cause.name||e.cause.constructor.name;s.cause={[t]:d(e.cause,!1,n)}}else s.cause=e.cause;if("function"==typeof e.toJSON){const t=e.toJSON();for(const e of Object.keys(t)){const n=t[e];s[e]=a.isError(n)?n.toString():n}}return s}catch(e){r.DEBUG_BUILD&&i.debug.error("Unable to extract extra data from the Error object:",e)}return null}t.extraErrorDataIntegration=u},70875(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(82430),s=n(83609),i=r.defineIntegration((()=>
1({name:"FeatureFlags",processEvent:(e,t,n)=>s._INTERNAL_copyFlagsFromScopeToEvent(e),addFeatureFlag(e,t){s._INTERNAL_insertFlagToScope(e,t),s._INTERNAL_addFeatureFlagToActiveSpan(e,t)}})));t.featureFlagsIntegration=i},98398(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(82430),s=n(83609),i=n(96159),a=r.defineIntegration((({growthbookClass:e})=>({name:"GrowthBook",setupOnce(){const t=e.prototype;"function"==typeof t.isOn&&i.fill(t,"isOn",o),"function"==typeof t.getFeatureValue&&i.fill(t,"getFeatureValue",o)},processEvent:(e,t,n)=>s._INTERNAL_copyFlagsFromScopeToEvent(e)})));function o(e){return function(...t){const n=t[0],r=e.apply(this,t);return"string"==typeof n&&"boolean"==typeof r&&(s._INTERNAL_insertFlagToScope(n,r),s._INTERNAL_addFeatureFlagToActiveSpan(n,r)),r}}t.growthbookIntegration=a},68360(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(49564),s=n(82430),i=n(96159);let a;const o=new WeakMap,l=s.defineIntegration((()=>({name:"FunctionToString",setupOnce(){a=Function.prototype.toString;try{Function.prototype.toString=function(...e){const t=i.getOriginalFunction(this),n=o.has(r.getClient())&&void 0!==t?t:this;return a.apply(n,e)}}catch{}},setup(e){o.set(e,!0)}})));t.functionToStringIntegration=l},25073(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(87990),s=n(72833),i=n(9635),a=n(36707);t.addOutgoingRequestBreadcrumb=function(e,t){const n=a.getRequestUrlFromClientRequest(e),o=i.parseUrl(n),l=t?.statusCode,c=s.getBreadcrumbLogLevelFromHttpStatusCode(l);r.addBreadcrumb({category:"http",data:{status_code:l,url:i.getSanitizedUrlString(o),"http.method":e.method||"GET",...o.search?{"http.query":o.search}:{},...o.hash?{"http.fragment":o.hash}:{}},type:"http",level:c},{event:"response",request:e,response:t})}},10571(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(29057),s=n(52366),i=n(96159),a=n(31223);function o(e,t={}){const n=r.getDefaultExport(e),l=e;if(n!==e){o(n,t);for(const e of["get","request"]){const t=Object.getOwnPropertyDescriptor(n,e);t&&Object.defineProperty(l,e,t)}return l}return function(e,t){if(!i.getOriginalFunction(e.request)){const{[s.HTTP_ON_CLIENT_REQUEST]:n}=a.getHttpClientSubscriptions({...t,http:e}),r=e.request;i.wrapMethod(e,"request",(function(...e){const t=r.apply(this,e);return n({request:t},s.HTTP_ON_CLIENT_REQUEST),t}))}}(l,t),function(e){i.getOriginalFunction(e.get)||i.wrapMethod(e,"get",(function(t,n,r){const s=e.request.call(this,t,n,r);return s.end(),s}))}(l),e}t.patchHttpModuleClient=(e,t={})=>o(e,t)},31223(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(25073),s=n(68974),i=n(85110),a=n(49564),o=n(15363),l=n(51228),c=n(55908),u=n(43807),d=n(5540),h=n(36707),f=n(60134),p=n(52366),g=n(25422);t.getHttpClientSubscriptions=function(e){const t=new u.LRUMap(100);return{[p.HTTP_ON_CLIENT_REQUEST]:n=>{if(!0===a.getCurrentScope().getScopeData().sdkProcessingMetadata[c.SUPPRESS_TRACING_KEY])return;const u=a.getClient()?.getOptions(),{errorMonitor:m="error",spans:_=!u||l.hasSpansEnabled(u),propagateTrace:T=!1,breadcrumbs:E=!0,http:y,https:S,suppressOtelWarning:v=!1}=e,{request:b}=n;if(e.ignoreOutgoingRequests?.(h.getRequestUrlFromClientRequest(b),b))return;let I=!1;function A(e,t){I||(I=!0,r.addOutgoingRequestBreadcrumb(e,t))}if(!_)return E&&function(e){e.on(m,(()=>A(e,void 0))),e.prependListener("response",(t=>{e.listenerCount("response")<=1&&t.resume(),t.on("end",(()=>A(e,t))),t.on(m,(()=>A(e,t)))}))}(b),void(T&&f.injectTracePropagationHeaders(b,t));v||(y&&g.doubleWrapWarning(y),S&&g.doubleWrapWarning(S));const R=c.startInactiveSpan(d.getOutgoingRequestSpanData(b));e.outgoingRequestHook?.(R,b),T&&(R.isRecording()?c.withActiveSpan(R,(()=>{f.injectTracePropagationHeaders(b,t)})):f.injectTracePropagationHeaders(b,t));let C=!1;function k(e){C||(C=!0,R.setStatus(e),R.end())}const L=()=>k({code:o.SPAN_STATUS_UNSET});b.on("close",L),b.on(m,(e=>{s.DEBUG_BUILD&&i.debug.log(p.LOG_PREFIX,"outgoingRequest on request error()",e),E&&A(b,void 0),k({code:o.SPAN_STATUS_ERROR})})),b.prependListener("response",(t=>{b.removeListener("close",L),b.listenerCount("response")<=1&&t.resume(),d.setIncomingResponseSpanData(t,R),e.outgoingResponseHook?.(R,t);let n=!1;function r(r){if(!n){n=!0,r&&s.DEBUG_BUILD&&i.debug.log(p.LOG_PREFIX,"outgoingRequest on response error()",r),E&&A(b,t);const a=t.aborted&&!t.complete,l=r||"number"!=typeof t.statusCode||a?{code:o.SPAN_STATUS_ERROR}:o.getSpanStatusFromHttpCode(t.statusCode);e.applyCustomAttributesOnSpan?.(R,b,t),k(l)}}t.on("end",(()=>r())),t.on(m,r)}))}}}},52366(e,t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});t.HTTP_ON_CLIENT_REQUEST="http.client.request.created",t.HTTP_ON_SERVER_REQUEST="http.server.request.start",t.LOG_PREFIX="@sentry/instrumentation-http"},25422(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(68974),s=n(85110),i=e=>"function"==typeof e.__unwrap,a="Double-wrapped http.client detected. Either disable spans in Sentry.httpIntegration, or disable the OpenTelemetry HTTP instrumentation.";let o=!1;const l=r.DEBUG_BUILD?e=>{o||(i(e.request)||i(e.get))&&(o=!0,s.debug.warn(a))}:()=>{};t.doubleWrapWarning=l,t.warning=a},5540(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(52751),s=n(9635),i=n(36707);function a(e){if(!e)return{};const{remoteAddress:t,remotePort:n}=e;return{"network.peer.address":t,"network.peer.port":n,"net.peer.ip":t,"net.peer.port":n}}function o(e){const{headers:t}=e,n=t["content-length"],r=n?parseInt(String(n),10):-1,s=t["content-encoding"];return r>=0?s&&"identity"!==s?{"http.response_content_length":r}:{"http.response_content_length_uncompressed":r}:{}}t.getOutgoingRequestSpanData=function(e){const t=i.getRequestUrlFromClientRequest(e),[n,a]=s.getHttpSpanDetail
1sFromUrlObject(s.parseStringToURLObject(t),"client","auto.http.client",e),o=e.getHeader("user-agent");return{name:n,attributes:{[r.SEMANTIC_ATTRIBUTE_SENTRY_OP]:"http.client","otel.kind":"CLIENT","http.url":t,"http.method":e.method,"http.target":e.path||"/","net.peer.name":e.host,"http.host":e.getHeader("host"),...o?{"user_agent.original":o}:{},...a},onlyIfParent:!0}},t.setIncomingResponseSpanData=function(e,t){const{statusCode:n,statusMessage:r,httpVersion:s,socket:i}=e,l="QUIC"!==s?.toUpperCase()?"ip_tcp":"ip_udp";t.setAttributes({"http.response.status_code":n,"network.protocol.version":s,"http.flavor":s,"network.transport":l,"net.transport":l,"http.status_text":r?.toUpperCase(),"http.status_code":n,...o(e),...a(i)})}},36707(e,t){function n(e){const t=e.host||"",n=/^(.*):(\d+)$/.exec(t),r=n?n[1]:t,s=e.port??(n?Number(n[2]):void 0);return{method:e.method,port:s,protocol:e.protocol,host:e.host,hostname:r,path:e.path,headers:e.getHeaders()}}function r(e){return String(s(e))}function s(e){const t=e.protocol||"http:",n=e.headers?.host&&String(e.headers?.host)||e.hostname||e.host||"",r=!e.port||80===e.port||443===e.port||/^(.*):(\d+)$/.test(n)?"":`:${e.port}`,s=e.path?e.path:"/";return new URL(s,`${t}//${n}${r}`)}Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),t.getRequestOptions=n,t.getRequestUrl=r,t.getRequestUrlFromClientRequest=function(e){return String(r(n(e)))},t.getRequestUrlObject=s},60134(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(49564),s=n(68974),i=n(85110),a=n(88532),o=n(20647),l=n(78371),c=n(52366),u=n(36707),d=n(5684);t.injectTracePropagationHeaders=function(e,t){const n=u.getRequestUrlFromClientRequest(e),h=r.getClient()?.getOptions(),{tracePropagationTargets:f,propagateTraceparent:p}=h??{};if(!l.shouldPropagateTraceForUrl(n,f,t))return;if(!!e.getHeader("sentry-trace"))return;const g=o.getTraceData({propagateTraceparent:p});if(!g)return;const{"sentry-trace":m,baggage:_,traceparent:T}=g;if(m)try{e.setHeader("sentry-trace",m),s.DEBUG_BUILD&&i.debug.log(c.LOG_PREFIX,"Added sentry-trace header")}catch(e){s.DEBUG_BUILD&&i.debug.error(c.LOG_PREFIX,"Failed to set sentry-trace header:",a.isError(e)?e.message:"Unknown error")}if(T&&!e.getHeader("traceparent"))try{e.setHeader("traceparent",T),s.DEBUG_BUILD&&i.debug.log(c.LOG_PREFIX,"Added traceparent header")}catch(e){s.DEBUG_BUILD&&i.debug.error(c.LOG_PREFIX,"Failed to set traceparent header:",a.isError(e)?e.message:"Unknown error")}if(_){const t=d.mergeBaggageHeaders(e.getHeader("baggage"),_);if(t)try{e.setHeader("baggage",t),s.DEBUG_BUILD&&i.debug.log(c.LOG_PREFIX,"Added baggage header")}catch(e){s.DEBUG_BUILD&&i.debug.error(c.LOG_PREFIX,"Failed to set baggage header:",a.isError(e)?e.message:"Unknown error")}}}},92958(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(82430),s=n(90153),i=n(93395),a=r.defineIntegration(((e={})=>{const t=e.limit||5,n=e.key||"cause";return{name:"LinkedErrors",preprocessEvent(e,r,a){const o=a.getOptions();s.applyAggregateErrorsToEvent(i.exceptionFromError,o.stackParser,n,t,e,r)}}}));t.linkedErrorsIntegration=a},65870(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(9635),s=n(2230),i=n(6332);function a(e,t,n){const i={};switch(e){case"notifications/cancelled":t?.requestId&&(i["mcp.cancelled.request_id"]=String(t.requestId)),t?.reason&&(i["mcp.cancelled.reason"]=String(t.reason));break;case"notifications/message":t?.level&&(i[s.MCP_LOGGING_LEVEL_ATTRIBUTE]=String(t.level)),t?.logger&&(i[s.MCP_LOGGING_LOGGE
1R_ATTRIBUTE]=String(t.logger)),void 0!==t?.data&&(i[s.MCP_LOGGING_DATA_TYPE_ATTRIBUTE]=typeof t.data,n&&(i[s.MCP_LOGGING_MESSAGE_ATTRIBUTE]="string"==typeof(a=t.data)?a:JSON.stringify(a)));break;case"notifications/progress":t?.progressToken&&(i["mcp.progress.token"]=String(t.progressToken)),"number"==typeof t?.progress&&(i["mcp.progress.current"]=t.progress),"number"==typeof t?.total&&(i["mcp.progress.total"]=t.total,"number"==typeof t?.progress&&(i["mcp.progress.percentage"]=t.progress/t.total*100)),t?.message&&(i["mcp.progress.message"]=String(t.message));break;case"notifications/resources/updated":if(t?.uri){i[s.MCP_RESOURCE_URI_ATTRIBUTE]=String(t.uri);const e=r.parseStringToURLObject(String(t.uri));e&&!r.isURLObjectRelative(e)&&(i["mcp.resource.protocol"]=e.protocol.replace(":",""))}break;case"notifications/initialized":i["mcp.lifecycle.phase"]="initialization_complete",i["mcp.protocol.ready"]=1}var a;return i}t.buildTypeSpecificAttributes=function(e,t,n,r){if("request"===e){const e=t,a=i.extractTargetInfo(e.method,n||{});return{...void 0!==e.id&&{[s.MCP_REQUEST_ID_ATTRIBUTE]:String(e.id)},...a.attributes,...r?i.getRequestArguments(e.method,n||{}):{}}}return a(t.method,n||{},r)},t.getNotificationAttributes=a},2230(e,t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});t.CLIENT_ADDRESS_ATTRIBUTE="client.address",t.CLIENT_PORT_ATTRIBUTE="client.port",t.MCP_FUNCTION_ORIGIN_VALUE="auto.function.mcp_server",t.MCP_LOGGING_DATA_TYPE_ATTRIBUTE="mcp.logging.data_type",t.MCP_LOGGING_LEVEL_ATTRIBUTE="mcp.logging.level",t.MCP_LOGGING_LOGGE
1R_ATTRIBUTE="mcp.logging.logger",t.MCP_LOGGING_MESSAGE_ATTRIBUTE="mcp.logging.message",t.MCP_METHOD_NAME_ATTRIBUTE="mcp.method.name",t.MCP_NOTIFICATION_CLIENT_TO_SERVER_OP_VALUE="mcp.notification.client_to_server",t.MCP_NOTIFICATION_ORIGIN_VALUE="auto.mcp.notification",t.MCP_NOTIFICATION_SERVER_TO_CLIENT_OP_VALUE="mcp.notification.server_to_client",t.MCP_PROMPT_NAME_ATTRIBUTE="mcp.prompt.name",t.MCP_PROMPT_RESULT_DESCRIPTION_ATTRIBUTE="mcp.prompt.result.description",t.MCP_PROMPT_RESULT_MESSAGE_COUNT_ATTRIBUTE="mcp.prompt.result.message_count",t.MCP_PROTOCOL_VERSION_ATTRIBUTE="mcp.protocol.version",t.MCP_REQUEST_ARGUMENT="mcp.request.argument",t.MCP_REQUEST_ID_ATTRIBUTE="mcp.request.id",t.MCP_RESOURCE_URI_ATTRIBUTE="mcp.resource.uri",t.MCP_ROUTE_SOURCE_VALUE="route",t.MCP_SERVER_NAME_ATTRIBUTE="mcp.server.name",t.MCP_SERVER_OP_VALUE="mcp.server",t.MCP_SERVER_TITLE_ATTRIBUTE="mcp.server.title",t.MCP_SERVER_VERSION_ATTRIBUTE="mcp.server.version",t.MCP_SESSION_ID_ATTRIBUTE="mcp.session.id",t.MCP_TOOL_NAME_ATTRIBUTE="mcp.tool.name",t.MCP_TOOL_RESULT_CONTENT_COUNT_ATTRIBUTE="mcp.tool.result.content_count",t.MCP_TOOL_RESULT_IS_ERROR_ATTRIBUTE="mcp.tool.result.is_error",t.MCP_TRANSPORT_ATTRIBUTE="mcp.transport",t.NETWORK_PROTOCOL_VERSION_ATTRIBUTE="network.protocol.version",t.NETWORK_TRANSPORT_ATTRIBUTE="network.transport"},94815(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(15363),s=n(2230),i=n(91303),a=n(69562),o=new Map,l=new WeakMap;function c(e){const t=e.sessionId;if(t){let e=o.get(t);return e||(e=new Map,o.set(t,e)),e}let n=l.get(e);return n||(n=new Map,l.set(e,n)),n}t.cleanupPendingSpansForTransport=function(e){const t=e.sessionId;if(t){const e=o.get(t);if(e){for(const[,t]of e)t.span.setStatus({code:r.SPAN_STATUS_ERROR,message:"cancelled"}),t.span.end();o.delete(t)}return}const n=l.get(e);if(n){for(const[,e]of n)e.span.setStatus({code:r.SPAN_STATUS_ERROR,message:"cancelled"}),e.span.end();n.clear()}},t.completeSpanWithResults=function(e,t,n,o,l=!1){const u=c(e),d=u.get(t);if(d){const{span:e,method:c}=d;if(l)e.setStatus({code:r.SPAN_STATUS_ERROR,message:"internal_error"});else if("initialize"===c){const t=a.extractSessionDataFromInitializeResponse(n),r={...a.buildServerAttributesFromInfo(t.serverInfo)};t.protocolVersion&&(r[s.MCP_PROTOCOL_VERSION_ATTRIBUTE]=t.protocolVersion),e.setAttributes(r)}else if("tools/call"===c){const t=i.extractToolResultAttributes(n,o.recordOutputs);e.setAttributes(t)}else if("prompts/get"===c){const t=i.extractPromptResultAttributes(n,o.recordOutputs);e.setAttributes(t)}e.end(),u.delete(t)}},t.storeSpanForRequest=function(e,t,n,r){c(e).set(t,{span:n,method:r,startTime:Date.now()})}},67695(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(49564),s=n(79183),i=n(54583),a=n(15363);t.captureError=function(e,t,n){try{if(!r.getClient())return;const o=i.getActiveSpan();o?.isRecording()&&o.setStatus({code:a.SPAN_STATUS_ERROR,message:"internal_error"}),s.captureException(e,{mechanism:{type:"auto.ai.mcp_server",handled:!1,data:{error_type:t||"handler_execution",...n}}})}catch{}}},34514(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(68974),s=n(85110),i=n(96159),a=n(67695);function o(e,t){i.fill(e,t,(e=>function(n,...r){const s=r[r.length-1];if("function"!=typeof s)return e.call(this,n,...r);const i=l(s,t,n);return e.call(this,n,...r.slice(0,-1),i)}))}function l(e,t,n){return function(...i){try{return c.call(this,e,t,n,i)}catch(t){return r.DEBUG_BUILD&&s.debug.warn("MCP handler wrapping failed:",t),e.apply(this,i)}}}function c(e,t,n,r){try{const s=e.apply(this,r);return s&&"object"==typeof s&&"function"==typeof s.then?Promise.resolve(s).catch((e=>{throw u(e,t,n),e})):s}catch(e){throw u(e,t,n),e}}function u(e,t,n){try{const r={};"tool"===t||"registerTool"===t?(r.tool_name=n,"ProtocolValidationError"===e.name||e.message.includes("validation")||e.message.includes("protocol")?a.captureError(e,"validation",r):"ServerTimeoutError"===e.name||e.message.includes("timed out")||e.message.includes("timeout")?a.captureError(e,"timeout",r):a.captureError(e,"tool_execution",r)):"resource"===t||"registerResource"===t?(r.resource_uri=n,a.captureError(e,"resource_execution",r)):"prompt"!==t&&"registerPrompt"!==t||(r.prompt_name=n,a.captureError(e,"prompt_execution",r))}catch(e){}}function d(e){"function"==typeof e.tool&&o(e,"tool"),"function"==typeof e.registerTool&&o(e,"registerTool")}function h(e){"function"==typeof e.resource&&o(e,"resource"),"function"==typeof e.registerResource&&o(e,"registerResource")}function f(e){"function"==typeof e.prompt&&o(e,"prompt"),"function"==typeof e.registerPrompt&&o(e,"registerPrompt")}t.wrapAllMCPHandlers=function(e){d(e),h(e),f(e)},t.wrapExistingHandlers=function(e){const t=e,n=t._registeredTools;if(n&&"object"==typeof n)for(const[e,t]of Object.entries(n))"function"==typeof t.executor&&(t.executor=l(t.executor,"registerTool",e));const r=t._registeredResources;if(r&&"object"==typeof r)for(const[e,t]of Object.entries(r))"function"==typeof t.readCallback&&(t.readCallback=l(t.readCallback,"registerResource",e));const s=t._registeredResourceTemplates;if(s&&"object"==typeof s)for(const[e,t]of Object.entries(s))"function"==typeof t.readCallback&&(t.readCallback=l(t.readCallback,"registerResource",e));const i=t._registeredPrompts;if(i&&"object"==typeof i)for(const[e,t]of Object.entries(i))"function"==typeof t.handler&&(t.handler=l(t.handler,"registerPrompt",e))},t.wrapPromptHandlers=f,t.wrapResourceHandlers=h,t.wrapToolHandlers=d},6855(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(49564),s=n(96159),i=n(34514),a=n(80170),o=n(86748),l=new WeakSet;t.wrapMcpServerWithSentry=function(e,t){if(l.has(e))return e;
1if(!o.validateMcpServerInstance(e))return e;const n=e,c=r.getClient(),u=Boolean(c?.getOptions().sendDefaultPii),d={recordInputs:t?.recordInputs??u,recordOutputs:t?.recordOutputs??u};return s.fill(n,"connect",(e=>async function(t,...n){const r=await e.call(this,t,...n);return a.wrapTransportOnMessage(t,d),a.wrapTransportSend(t,d),a.wrapTransportOnClose(t),a.wrapTransportError(t),r})),i.wrapAllMCPHandlers(n),i.wrapExistingHandlers(n),l.add(e),e}},6332(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(2230),s={"tools/call":{targetField:"name",targetAttribute:r.MCP_TOOL_NAME_ATTRIBUTE,captureArguments:!0,argumentsField:"arguments"},"resources/read":{targetField:"uri",targetAttribute:r.MCP_RESOURCE_URI_ATTRIBUTE,captureUri:!0},"resources/subscribe":{targetField:"uri",targetAttribute:r.MCP_RESOURCE_URI_ATTRIBUTE},"resources/unsubscribe":{targetField:"uri",targetAttribute:r.MCP_RESOURCE_URI_ATTRIBUTE},"prompts/get":{targetField:"name",targetAttribute:r.MCP_PROMPT_NAME_ATTRIBUTE,captureName:!0,captureArguments:!0,argumentsField:"arguments"}};t.extractTargetInfo=function(e,t){const n=s[e];if(!n)return{attributes:{}};const r=n.targetField&&"string"==typeof t?.[n.targetField]?t[n.targetField]:void 0;return{target:r,attributes:r&&n.targetAttribute?{[n.targetAttribute]:r}:{}}},t.getRequestArguments=function(e,t){const n={},i=s[e];if(!i)return n;if(i.captureArguments&&i.argumentsField&&t?.[i.argumentsField]){const e=t[i.argumentsField];if("object"==typeof e&&null!==e)for(const[t,s]of Object.entries(e))n[`${r.MCP_REQUEST_ARGUMENT}.${t.toLowerCase()}`]=JSON.stringify(s)}return i.captureUri&&t?.uri&&(n[`${r.MCP_REQUEST_ARGUMENT}.uri`]=JSON.stringify(t.uri)),i.captureName&&t?.name&&(n[`${r.MCP_REQUEST_ARGUMENT}.name`]=JSON.stringify(t.name)),n}},54827(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(2230),s=new Set([r.CLIENT_ADDRESS_ATTRIBUTE,r.CLIENT_PORT_ATTRIBUTE,r.MCP_RESOURCE_URI_ATTRIBUTE]);t.filterMcpPiiFromSpanData=function(e,t){return t?e:Object.entries(e).reduce(((e,[t,n])=>(function(e){return s.has(e)}(t)||(e[t]=n),e)),{})}},91303(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(2230),s=n(86748);t.extractPromptResultAttributes=function(e,t){const n={};if(!s.isValidContentItem(e))return n;if(t&&"string"==typeof e.description&&(n[r.MCP_PROMPT_RESULT_DESCRIPTION_ATTRIBUTE]=e.description),Array.isArray(e.messages)&&(n[r.MCP_PROMPT_RESULT_MESSAGE_COUNT_ATTRIBUTE]=e.messages.length,t)){const t=e.messages;for(const[e,r]of t.entries()){if(!s.isValidContentItem(r))continue;const i=1===t.length?"mcp.prompt.result":`mcp.prompt.result.${e}`;if(((e,r)=>{if("string"==typeof r){const s=1===t.length?`${i}.message_${e}`:`${i}.${e}`;n[s]=r}})("role",r.role),s.isValidContentItem(r.content)){const e=r.content;if("string"==typeof e.text){const r=1===t.length?`${i}.message_content`:`${i}.content`;n[r]=e.text}}}}return n},t.extractToolResultAttributes=function(e,t){if(!s.isValidContentItem(e))return{};const n=Array.isArray(e.content)?function(e,t){const n={[r.MCP_TOOL_RESULT_CONTENT_COUNT_ATTRIBUTE]:e.length};for(const[r,i]of e.entries()){if(!s.isValidContentItem(i))continue;const a=1===e.length?"mcp.tool.result":`mcp.tool.result.${r}`;if("string"==typeof i.type&&(n[`${a}.content_type`]=i.type),t){const e=(e,t)=>{"string"==typeof t&&(n[`${a}.${e}`]=t)};e("mime_type",i.mimeType),e("uri",i.uri),e("name",i.name),"string"==typeof i.text&&(n[`${a}.content`]=i.text),"string"==typeof i.data&&(n[`${a}.data_size`]=i.data.length);const t=i.resource;s.isValidContentItem(t)&&(e("resource_uri",t.uri),e("resource_mime_type",t.mimeType))}}return n}(e.content,t):{};return"boolean"==typeof e.isError&&(n[r.MCP_TOOL_RESULT_IS_ERROR_ATTRIBUTE]=e.isError),n}},69562(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(2230),s=n(45208),i=n(86748);function a(e){const t={};return i.isValidContentItem(e)&&("string"==typeof e.name&&(t.name=e.name),"string"==typeof e.title&&(t.title=e.title),"string"==typeof e.version&&(t.version=e.version)),t}function o(e){const t=s.getClientInfoForTransport(e),n={};return t?.name&&(n["mcp.client.name"]=t.name),t?.title&&(n["mcp.client.title"]=t.title),t?.version&&(n["mcp.client.version"]=t.version),n}function l(e){const t=s.getSessionDataForTransport(e)?.serverInfo,n={};return t?.name&&(n[r.MCP_SERVER_NAME_ATTRIBUTE]=t.name),t?.title&&(n[r.MCP_SERVER_TIT
1LE_ATTRIBUTE]=t.title),t?.version&&(n[r.MCP_SERVER_VERSION_ATTRIBUTE]=t.version),n}function c(e){return{address:e?.requestInfo?.remoteAddress||e?.clientAddress||e?.request?.ip||e?.request?.connection?.remoteAddress,port:e?.requestInfo?.remotePort||e?.clientPort||e?.request?.connection?.remotePort}}function u(e){if(!e?.constructor)return{mcpTransport:"unknown",networkTransport:"unknown"};const t="string"==typeof e.constructor?.name?e.constructor.name:"unknown";let n="unknown";const r=t.toLowerCase();return r.includes("stdio")?n="pipe":(r.includes("http")||r.includes("sse"))&&(n="tcp"),{mcpTransport:t,networkTransport:n}}t.buildClientAttributesFromInfo=function(e){const t={};return e?.name&&(t["mcp.client.name"]=e.name),e?.title&&(t["mcp.client.title"]=e.title),e?.version&&(t["mcp.client.version"]=e.version),t},t.buildServerAttributesFromInfo=function(e){const t={};return e?.name&&(t[r.MCP_SERVER_NAME_ATTRIBUTE]=e.name),e?.title&&(t[r.MCP_SERVER_TITLE_ATTRIBUTE]=e.title),e?.version&&(t[r.MCP_SERVER_VERSION_ATTRIBUTE]=e.version),t},t.buildTransportAttributes=function(e,t){const n=e&&"sessionId"in e?e.sessionId:void 0,i=t?c(t):{},{mcpTransport:a,networkTransport:d}=u(e),h=o(e),f=l(e),p=s.getProtocolVersionForTransport(e);return{...n&&{[r.MCP_SESSION_ID_ATTRIBUTE]:n},...i.address&&{[r.CLIENT_ADDRESS_ATTRIBUTE]:i.address},...i.port&&{[r.CLIENT_PORT_ATTRIBUTE]:i.port},[r.MCP_TRANSPORT_ATTRIBUTE]:a,[r.NETWORK_TRANSPORT_ATTRIBUTE]:d,[r.NETWORK_PROTOCOL_VERSION_ATTRIBUTE]:"2.0",...p&&{[r.MCP_PROTOCOL_VERSION_ATTRIBUTE]:p},...h,...f}},t.extractClientInfo=c,t.extractSessionDataFromInitializeRequest=function(e){const t={};return i.isValidContentItem(e.params)&&("string"==typeof e.params.protocolVersion&&(t.protocolVersion=e.params.protocolVersion),e.params.clientInfo&&(t.clientInfo=a(e.params.clientInfo))),t},t.extractSessionDataFromInitializeResponse=function(e){const t={};return i.isValidContentItem(e)&&("string"==typeof e.protocolVersion&&(t.protocolVersion=e.protocolVersion),e.serverInfo&&(t.serverInfo=a(e.serverInfo))),t},t.getClientAttributes=o,t.getServerAttributes=l,t.getTransportTypes=u},45208(e,t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const n=new Map,r=new WeakMap;function s(e){const t=e.sessionId;return t?n.get(t):r.get(e)}function i(e,t){const s=e.sessionId;s?n.set(s,t):r.set(e,t)}t.cleanupSessionDataForTransport=function(e){const t=e.sessionId;t&&n.delete(t)},t.getClientInfoForTransport=function(e){return s(e)?.clientInfo},t.getProtocolVersionForTransport=function(e){return s(e)?.protocolVersion},t.getSessionDataForTransport=function(e){return s(e)},t.storeSessionDataForTransport=function(e,t){i(e,t)},t.updateSessionDataForTransport=function(e,t){i(e,{...s(e)||{},...t})}},68998(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(49564),s=n(52751),i=n(55908),a=n(65870),o=n(2230),l=n(6332),c=n(54827),u=n(69562);function d(e,t){return t?`${e} ${t}`:e}function h(e){let t,n;switch(e){case"request":t=o.MCP_SERVER_OP_VALUE,n=o.MCP_FUNCTION_ORIGIN_VALUE;break;case"notification-incoming":t=o.MCP_NOTIFICATION_CLIENT_TO_SERVER_OP_VALUE,n=o.MCP_NOTIFICATION_ORIGIN_VALUE;break;case"notification-outgoing":t=o.MCP_NOTIFICATION_SERVER_TO_CLIENT_OP_VALUE,n=o.MCP_NOTIFICATION_ORIGIN_VALUE}return{[s.SEMANTIC_ATTRIBUTE_SENTRY_OP]:t,[s.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]:n,[s.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]:o.MCP_ROUTE_SOURCE_VALUE}}function f(e){const{type:t,message:n,transport:s,extra:f,callback:p,options:g}=e,{method:m}=n,_=n.params;let T;if("request"===t){T=d(m,l.extractTargetInfo(m,_||{}).target)}else T=m;const E={...u.buildTransportAttributes(s,f),[o.MCP_METHOD_NAME_ATTRIBUTE]:m,...a.buildTypeSpecificAttributes(t,n,_,g?.recordInputs),...h(t)},y=r.getClient(),S=Boolean(y?.getOptions().sendDefaultPii),v=c.filterMcpPiiFromSpanData(E,S);return i.startSpan({name:T,forceTransaction:!0,attributes:v},p)}t.buildMcpServerSpanConfig=function(e,t,n,s){const{method:i}=e,f=e.params,p=d(i,l.extractTargetInfo(i,f||{}).target),g={...u.buildTransportAttributes(t,n),[o.MCP_METHOD_NAME_ATTRIBUTE]:i,...a.buildTypeSpecificAttributes("request",e,f,s?.recordInputs),...h("request")},m=r.getClient(),_=Boolean(m?.getOptions().sendDefaultPii),T=c.filterMcpPiiFromSpanData(g,_);return{name:p,op:o.MCP_SERVER_OP_VALUE,forceTransaction:!0,attributes:T}}
1,t.createMcpNotificationSpan=function(e,t,n,r,s){return f({type:"notification-incoming",message:e,transport:t,extra:n,callback:s,options:r})},t.createMcpOutgoingNotificationSpan=function(e,t,n,r){return f({type:"notification-outgoing",message:e,transport:t,options:n,callback:r})}},80170(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(49564),s=n(96159),i=n(55908),a=n(2230),o=n(94815),l=n(67695),c=n(69562),u=n(45208),d=n(68998),h=n(86748);t.wrapTransportError=function(e){e.onerror&&s.fill(e,"onerror",(e=>function(t){return function(e){try{l.captureError(e,"transport")}catch{}}(t),e.call(this,t)}))},t.wrapTransportOnClose=function(e){e.onclose&&s.fill(e,"onclose",(t=>function(...n){return o.cleanupPendingSpansForTransport(e),u.cleanupSessionDataForTransport(e),t.call(this,...n)}))},t.wrapTransportOnMessage=function(e,t){e.onmessage&&s.fill(e,"onmessage",(n=>function(s,l){if(h.isJsonRpcRequest(s)){const h="initialize"===s.method;let f;if(h)try{f=c.extractSessionDataFromInitializeRequest(s),u.storeSessionDataForTransport(e,f)}catch{}const p=r.getIsolationScope().clone();return r.withIsolationScope(p,(()=>{const r=d.buildMcpServerSpanConfig(s,e,l,t),u=i.startInactiveSpan(r);return h&&f&&u.setAttributes({...c.buildClientAttributesFromInfo(f.clientInfo),...f.protocolVersion&&{[a.MCP_PROTOCOL_VERSION_ATTRIBUTE]:f.protocolVersion}}),o.storeSpanForRequest(e,s.id,u,s.method),i.withActiveSpan(u,(()=>n.call(this,s,l)))}))}return h.isJsonRpcNotification(s)?d.createMcpNotificationSpan(s,e,l,t,(()=>n.call(this,s,l))):n.call(this,s,l)}))},t.wrapTransportSend=function(e,t){e.send&&s.fill(e,"send",(n=>async function(...r){const[s]=r;if(h.isJsonRpcNotification(s))return d.createMcpOutgoingNotificationSpan(s,e,t,(()=>n.call(this,...r)));if(h.isJsonRpcResponse(s)&&null!==s.id&&void 0!==s.id){if(s.error&&function(e){try{if(e&&"object"==typeof e&&"code"in e&&"message"in e){const t=e;if(-32603===t.code||t.code>=-32099&&t.code<=-32e3){const e=new Error(t.message);e.name=`JsonRpcError_${t.code}`,l.captureError(e,"protocol")}}}catch{}}(s.error),h.isValidContentItem(s.result)&&(s.result.protocolVersion||s.result.serverInfo))try{const t=c.extractSessionDataFromInitializeResponse(s.result);u.updateSessionDataForTransport(e,t)}catch{}o.completeSpanWithResults(e,s.id,s.result,t,!!s.error)}return n.call(this,...r)}))}},86748(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(68974),s=n(85110);t.isJsonRpcNotification=function(e){return"object"==typeof e&&null!==e&&"jsonrpc"in e&&"2.0"===e.jsonrpc&&"method"in e&&!("id"in e)},t.isJsonRpcRequest=function(e){return"object"==typeof e&&null!==e&&"jsonrpc"in e&&"2.0"===e.jsonrpc&&"method"in e&&"id"in e},t.isJsonRpcResponse=function(e){return"object"==typeof e&&null!==e&&"jsonrpc"in e&&"2.0"===e.jsonrpc&&"id"in e&&("result"in e||"error"in e)},t.isValidContentItem=function(e){return null!=e&&"object"==typeof e},t.validateMcpServerInstance=function(e){return"object"==typeof e&&null!==e&&"connect"in e&&("tool"in e&&"resource"in e&&"prompt"in e||"registerTool"in e&&"registerResource"in e&&"registerPrompt"in e)||(r.DEBUG_BUILD&&s.debug.warn("Did not patch MCP server. Interface is incompatible."),!1)}},55873(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(82430),s=n(36823),i=n(99188),a=r.defineIntegration((()=>({name:"ModuleMetadata",setup(e){e.on("beforeEnvelope",(e=>{i.forEachEnvelopeItem(e,((e,t)=>{if("event"===t){const t=Array.isArray(e)?e[1]:void 0;t&&(s.stripMetadataFromStackFrames(t),e[1]=t)}}))})),e.on("applyFrameMetadata",(t=>{if(t.type)return;const n=e.getOptions().stackParser;s.addMetadataToStackFrames(n,t)}))}})));t.moduleMetadataIntegration=a},68904(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(68974),s=n(52751),i=n(85110),a=n(54583),o=n(15363),l=n(55908),c=/^(SELECT|INSERT|UPDATE|DELETE|CREATE|DROP|ALTER)/i,u=Symbol("sentryPostgresConnectionContext"),d=Symbol.for("sentry.instrumented.postgresjs"),h=Symbol.for("sentry.query.from.instrumented.sql");function f(e,t,n){if(e[d])return e;const r=new Proxy(e,{apply(e,n,s){const i=Reflect.apply(e,n,s);return i&&"object"==typeof i&&"handle"in i&&p(i,r,t),i},get(e,n){const s=e[n];return"string"!=typeof n||"function"!=typeof s?s:"unsafe"===n||"file"===n?function(e,t,n,r){return function(...s){const i=Reflect.apply(e,t,s);return i&&"object"==typeof i&&"handle"in i&&p(i,n,r),i}}(s,e,r,t):"begin"===n||"reserve"===n?function(e,t,n,r){return function(...s){const i=n[u];if(!("function"==typeof s[s.length-1])){const n=Reflect.apply(e,t,s);return n&&"function"==typeof n.then?n.then((e=>f(e,r,i))):n}const a=1===s.length?s[0]:s[1],o=function(e){const t=f(e,r,i);return a(t)},l=1===s.length?[o]:[s[0],o];return Reflect.apply(e,t,l)}}(s,e,r,t):s}});return n?r[u]=n:function(e,t){const n=e;if(!n.options||"object"!=typeof n.options)return;const r=n.options,s=r.host?.[0]||"localhost",i=r.port?.[0]||5432,a={ATTR_DB_NAMESPACE:"string"==typeof r.database&&""!==r.database?r.database:void 0,ATTR_SERVER_ADDRESS:s,ATTR_SERVER_PORT:String(i)};t[u]=a}(e,r),e[d]=!0,r[d]=!0,r}function p(e,t,n){if(e.handle?.__sentryWrapped)return;e[h]=!0;const c=e.handle,d=async function(...d){if(!function(e){return void 0!==a.getActiveSpan()||!e.requireParentSpan}(n))return c.apply(this,d);const h=_(g(e.strings));return l.startSpanManual({name:h||"postgresjs.query",op:"db"},(e=>{e.setAttribute(s.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,"auto.db.postgresjs"),e.setAttributes({"db.system.name":"postgres","db.query.text":h});const a=t?t[u]:void 0;if(function(e,t){if(!t)return;t.ATTR_DB_NAMESPACE&&e.setAttribute("db.namespace",t.ATTR_DB_NAMESPACE);t.ATTR_SERVER_ADDRESS&&e.setAttribute("server.address",t.ATTR_SERVER_ADDRESS);if(void 0!==t.ATTR_SERVER_PORT){const n=parseInt(t.ATTR_SERVER_PORT,10);isNaN(n)||e.setAttribute("server.port",n)}}(e,a),n.requestHook)try{n.requestHook(e,h,a)}catch(t){e.setAttribute("sentry.hook.error","requestHook failed"),r.DEBUG_BUILD&&i.debug.error("Error in requestHook for PostgresJs instrumentation:",t)}const l=this;l.resolve=new Proxy(l.resolve,{apply:(t,n,s)=>{try{T(e,h,s?.[0]?.command),e.end()}catch(e){r.DEBUG_BUILD&&i.debug.error("Error ending span in resolve callback:",e)}return Reflect.apply(t,n,s)}}),l.reject=new Proxy(l.reject,{apply:(t,n,s)=>{try{e.setStatus({code:o.SPAN_STATUS_ERROR,message:s?.[0]?.message||"unknown_error"}),e.setAttribute("db.response.status_code",s?.[0]?.code||"unknown"),e.setAttribute("error.type",s?.[0]?.name||"unknown"),T(e,h),e.end()}catch(e){r.DEBUG_BUILD&&i.debug.error("Error ending span in reject callback:",e)}return Reflect.apply(t,n,s)}});try{return c.apply(this,d)}catch(t){throw e.setStatus({code:o.SPAN_STATUS_ERROR,message:t instanceof Error?t.message:"unknown_error"}),e.end(),t}}))};d.__sentryWrapped=!0,e.handle=d}function g(e){if(e?.length)return 1===e.length?e[0]||void 0:e.reduce(((e,t,n)=>0===n?t:`${e}$${n}${t}`),"")}let m;function _(e){return e?(m||(m=new RegExp("(?<!\\$)-?\\b\\d+\\b","g")),e.replace(/--.*$/gm,"").replace(/\/\*[\s\S]*?\*\//g,"").replace(/;\s*$/,"").replace(/\s+/g," ").trim().replace(/\bX'[0-9A-Fa-f]*'/gi,"?").replace(/\bB'[01]*'/gi,"?").replace(/'(?:[^']|'')*'/g,"?").replace(/\b0x[0-9A-Fa-f]+/gi,"?").replace(/\b(?:TRUE|FALSE)\b/gi,"?").replace(/-?\b\d+\.?\d*[eE][+-]?\d+\b/g,"?").replace(/-?\b\d+\.\d+\b/g,"?").replace(/-?\.\d+\b/g,"?").replace(m,"?").replace(/\bIN\b\s*\(\s*\?(?:\s*,\s*\?)*\s*\)/gi,"IN (?)").replace(/\bIN\b\s*\(\s*\$\d+(?:\s*,\s*\$\d+)*\s*\)/gi,"IN ($?)")):"Unknown SQL Query"}function T(e,t,n){if(n)return void e.setAttribute("db.operation.name",n);const r=t?.match(c);r?.[1]&&e.setAttribute("db.operation.name",r[1].toUpperCase())}t._reconstructQuery=g,t._sanitizeSqlQuery=_,t.instrumentPostgresJsSql=function(e,t){return e&&"function"==typeof e?f(e,{requireParentSpan:!0,...t}):(r.DEBUG_BUILD&&i.debug.warn("instrumentPostgresJsSql: provided value is not a valid postgres.js sql instance"),e)}}
1,92215(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(49564),s=n(82430),i=n(52751),a=n(81894),o=n(56011),l=n(49764),c=n(47473),u={cookies:!0,data:!0,headers:!0,query_string:!0,url:!0},d=s.defineIntegration(((e={})=>{const t={...u,...e.include};return{name:"RequestData",processEvent(e,n,r){const{sdkProcessingMetadata:s={}}=e,{normalizedRequest:i,ipAddress:a}=s,o={...t,ip:t.ip??r.getOptions().sendDefaultPii};return i&&function(e,t,n,r){if(e.request={...e.request,...h(t,r)},r.ip){const r=t.headers&&l.getClientIPAddress(t.headers)||n.ipAddress;r&&(e.user={...e.user,ip_address:r})}}(e,i,{ipAddress:a},o),e},processSegmentSpan(e,n){const{sdkProcessingMetadata:s={}}=r.getIsolationScope().getScopeData(),{normalizedRequest:a,ipAddress:u}=s;if(!a)return;const{sendDefaultPii:d}=n.getOptions();!function(e,t,n,r,s){const a=h(t,r),u={};a.url&&(u["url.full"]=a.url);a.method&&(u["http.request.method"]=a.method);a.query_string&&(u["url.query"]=function(e){if("string"==typeof e)return e||void 0;const t=Array.isArray(e)?e:Object.entries(e);return t.map((([e,t])=>`${e}=${t}`)).join("&")||void 0}(a.query_string));if(c.safeSetSpanJSONAttributes(e,u),a.cookies&&Object.keys(a.cookies).length>0){const t=Object.entries(a.cookies).map((([e,t])=>`${e}=${t}`)).join("; "),n=o.httpHeadersToSpanAttributes({cookie:t},s??!1,"request");c.safeSetSpanJSONAttributes(e,n)}if(a.headers){const t=o.httpHeadersToSpanAttributes(a.headers,s??!1,"request");c.safeSetSpanJSONAttributes(e,t)}if(null!=a.data){const t="string"==typeof a.data?a.data:JSON.stringify(a.data);t&&c.safeSetSpanJSONAttributes(e,{"http.request.body.data":t})}if(r.ip){const r=t.headers&&l.getClientIPAddress(t.headers)||n||void 0;r&&c.safeSetSpanJSONAttributes(e,{[i.SEMANTIC_ATTRIBUTE_USER_IP_ADDRESS]:r})}}(e,a,u,{...t,ip:t.ip??d},d)}}}));function h(e,t){const n={},r={...e.headers};if(t.headers&&(n.headers=r,t.cookies||delete r.cookie,!t.ip)){const e=new Set(l.ipHeaderNames.map((e=>e.toLowerCase())));for(const t of Object.keys(r))e.has(t.toLowerCase())&&delete r[t]}if(n.method=e.method,t.url&&(n.url=e.url),t.cookies){const t=e.cookies||(r?.cookie?a.parseCookie(r.cookie):void 0);n.cookies=t||{}}return t.query_string&&(n.query_string=e.query_string),t.data&&(n.data=e.data),n}t.requestDataIntegration=d},17536(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(82430),s=n(73155),i=n(73969),a=r.defineIntegration(((e={})=>{const t=e.root,n=e.prefix||"app:///",r="window"in i.GLOBAL_OBJ&&!!i.GLOBAL_OBJ.window,s=e.iteratee||o({isBrowser:r,root:t,prefix:n});return{name:"RewriteFrames",processEvent(e){let t=e;return e.exception&&Array.isArray(e.exception.values)&&(t=function(e){try{return{...e,exception:{...e.exception,values:e.exception.values.map((e=>{return{...e,...e.stacktrace&&{stacktrace:(t=e.stacktrace,{...t,frames:t?.frames?.map((e=>s(e)))})}};var t}))}}}catch{return e}}(t)),t}}}));function o({isBrowser:e,root:t,prefix:n}){return r=>{if(!r.filename)return r;const i=/^[a-zA-Z]:\\/.test(r.filename)||r.filename.includes("\\")&&!r.filename.includes("/"),a=/^\//.test(r.filename);if(e){if(t){const e=r.filename;0===e.indexOf(t)&&(r.filename=e.replace(t,n))}}else if(i||a){const e=i?r.filename.replace(/^[a-zA-Z]:/,"").replace(/\\/g,"/"):r.filename,a=t?s.relative(t,e):s.basename(e);r.filename=`${n}${a}`}return r}}t.generateIteratee=o,t.rewriteFramesIntegration=a},61126(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(68974),s=n(82430),i=n(95150),a=n(47473),o=n(85526),l=n(13161),c=n(85110),u=n(54583),d=s.defineIntegration((()=>({name:"SpanStreaming",setup(e){const t="SpanStreaming integration requires",n="Falling back to static trace lifecycle.",s=e.getOptions();if(!o.hasSpanStreamingEnabled(e))return s.traceLifecycle="static",void(r.DEBUG_BUILD&&c.debug.warn(`${t} \`traceLifecycle\` to be set to "stream"! ${n}`));const d=s.beforeSendSpan;if(d&&!i.isStreamedBeforeSendSpanCallback(d))return s.traceLifecycle="static",void(r.DEBUG_BUILD&&c.debug.warn(`${t} a beforeSendSpan callback using \`withStreamedSpan\`! ${n}`));const h=new l.SpanBuffer(e);e.on("afterSpanEnd",(t=>{u.spanIsSampled(t)&&h.add(a.captureSpan(t,e))}))}})));t.spanStreamingIntegration=d},60262(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(87990),s=n(49564),i=n(68974),a=n(79183),o=n(82430),l=n(52751),c=n(85110),u=n(96940),d=n(88532),h=n(15363),f=n(55908),p=["reauthenticate","signInAnonymously","signInWithOAuth","signInWithIdToken","signInWithOtp","signInWithPassword","signInWithSSO","signOut","signUp","verifyOtp"],g=["createUser","deleteUser","listUsers","getUserById","updateUserById","inviteUserByEmail"],m={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"},_=["select","insert","upsert","update","delete"];function T(e){try{e.__SENTRY_INSTRUMENTED__=!0}catch{}}function E(e){try{return e.__SENTRY_INSTRUMENTED__}catch{return!1}}function y(e,t){return Object.keys(t).length>0?t:Array.isArray(e)&&e.length>0?e:void 0}function S(e,t={}){switch(e){case"GET":return"select";case"POST":return t.Prefer?.includes("resolution=")?"upsert":"insert";case"PATCH":return"update";case"DELETE":return"delete";default:return"<unknown-op>"}}function v(e,t){if(""===t||"*"===t)return"select(*)";if("select"===e)return`select(${t})`;if("or"===e||e.endsWith(".or"))return`${e}${t}`;const[n,...r]=t.split(".");let s;return s=n?.startsWith("fts")?"textSearch":n?.startsWith("plfts")?"textSearch[plain]":n?.startsWith("phfts")?"textSearch[phrase]":n?.startsWith("wfts")?"textSearch[websearch]":n&&m[n]||"filter",`${s}(${e}, ${r.join(".")})`}function b(e,t=!1){return new Proxy(e,{apply:(n,r,s)=>f.startSpan({name:`auth ${t?"(admin) ":""}${e.name}`,attributes:{[l.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]:"auto.db.supabase",[l.SEMANTIC_ATTRIBUTE_SENTRY_OP]:"db","db.system":"postgresql","db.operation":`auth.${t?"admin.":""}${e.name}`}},(e=>Reflect.apply(n,r,s).then((t=>(t&&"object"==typeof t&&"error"in t&&t.error?(e.setStatus({code:h.SPAN_STATUS_ERROR}),a.captureException(t.error,{mechanism:{handled:!1,type:"auto.db.supabase.auth"}})):e.setStatus({code:h.SPAN_STATUS_OK}),e.end(),t))).catch((t=>{throw e.setStatus({code:h.SPAN_STATUS_ERROR}),e.end(),a.captureException(t,{mechanism:{handled:!1,type:"auto.db.supabase.auth"}}),t})).then(...s)))})}function I(e){E(e.prototype.from)||(e.prototype.from=new Proxy(e.prototype.from,{apply(e,t,n){const r=Reflect.apply(e,t,n);return function(e){for(const t of _)E(e.prototype[t])||(e.prototype[t]=new Proxy(e.prototype[t],{apply(e,n,r){const s=Reflect.apply(e,n,r),a=s.constructor;return i.DEBUG_BUILD&&c.debug.log(`Instrumenting ${t} operation's PostgRESTFilterBuilder`),A(a),s}}),T(e.prototype[t]))}(r.constructor),r}}),T(e.prototype.from))}function A(e){E(e.prototype.then)||(e.prototype.then=new Proxy(e.prototype.then,{apply(e,t,n){const i=_,o=t,c=S(o.method,o.headers);if(!i.includes(c))return Reflect.apply(e,t,n);if(!o?.url?.pathname||"string"!=typeof o.url.pathname)return Reflect.apply(e,t,n);const p=o.url.pathname.split("/"),g=p.length>0?p[p.length-1]:"",m=[];
1for(const[e,t]of o.url.searchParams.entries())m.push(v(e,t));const T=Object.create(null);if(d.isPlainObject(o.body))for(const[e,t]of Object.entries(o.body))T[e]=t;const E=Boolean(s.getClient()?.getOptions().sendDefaultPii),b=y(o.body,T),I="select"===c?"":`${c}${A=o.body,R=T,void 0!==y(A,R)?"(...) ":""}`;var A,R;const C=E?m.join(" "):m.length>0?"[redacted]":"",k=[I.trimEnd(),C].filter(Boolean).join(" "),L=k?`${k} from(${g})`:`from(${g})`,O={"db.table":g,"db.schema":o.schema,"db.url":o.url.origin,"db.sdk":o.headers["X-Client-Info"],"db.system":"postgresql","db.operation":c,[l.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]:"auto.db.supabase",[l.SEMANTIC_ATTRIBUTE_SENTRY_OP]:"db"};return m.length&&E&&(O["db.query"]=m),void 0!==b&&E&&(O["db.body"]=b),f.startSpan({name:L,attributes:O},(s=>Reflect.apply(e,t,[]).then((e=>{if(s&&(e&&"object"==typeof e&&"status"in e&&h.setHttpStatus(s,e.status||500),s.end()),e?.error){const t=new Error(e.error.message);e.error.code&&(t.code=e.error.code),e.error.details&&(t.details=e.error.details);const n={};m.length&&E&&(n.query=m),void 0!==b&&E&&(n.body=b),a.captureException(t,(e=>(e.addEventProcessor((e=>(u.addExceptionMechanism(e,{handled:!1,type:"auto.db.supabase.postgres"}),e))),e.setContext("supabase",n),e)))}const t={type:"supabase",category:`db.${c}`,message:L},n={};return m.length&&E&&(n.query=m),void 0!==b&&E&&(n.body=b),Object.keys(n).length&&(t.data=n),r.addBreadcrumb(t),e}),(e=>{throw s&&(h.setHttpStatus(s,500),s.end()),e})).then(...n)))}}),T(e.prototype.then))}const R=e=>{if(!e)return void(i.DEBUG_BUILD&&c.debug.warn("Supabase integration was not installed because no Supabase client was provided."));I(e.constructor===Function?e:e.constructor),function(e){const t=e.auth;if(t&&!E(e.auth)){for(const n of p){const r=t[n];r&&"function"==typeof e.auth[n]&&(e.auth[n]=b(r))}for(const n of g){const r=t.admin[n];r&&"function"==typeof e.auth.admin[n]&&(e.auth.admin[n]=b(r,!0))}T(e.auth)}}(e)},C=o.defineIntegration((e=>{return t=e.supabaseClient,{setupOnce(){R(t)},name:"Supabase"};var t}));t.DB_OPERATIONS_TO_INSTRUMENT=_,t.FILTER_MAPPINGS=m,t.extractOperation=S,t.instrumentSupabaseClient=R,t.supabaseIntegration=C,t.translateFiltersIntoMethods=v},80699(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(82430),s=n(36823),i=n(99188),a=n(70561),o=r.defineIntegration((e=>({name:"ThirdPartyErrorsFilter",setup(e){e.on("beforeEnvelope",(e=>{i.forEachEnvelopeItem(e,((e,t)=>{if("event"===t){const t=Array.isArray(e)?e[1]:void 0;t&&(s.stripMetadataFromStackFrames(t),e[1]=t)}}))})),e.on("applyFrameMetadata",(t=>{if(t.type)return;const n=e.getOptions().stackParser;s.addMetadataToStackFrames(n,t)}))},processEvent(t){const n=function(e,t){const n=a.getFramesFromEvent(e);if(!n)return;return n.filter(((e,n)=>!!e.filename&&((null!=e.lineno||null!=e.colno||null!=e.instruction_addr)&&(!t||!function(e,t){if(0!==t||!e.context_line||!e.filename)return!1;if(!e.filename.includes("sentry")||!e.filename.includes("helpers")||!e.context_line.includes(u))return!1;if(e.pre_context){const t=e.pre_context.length;for(let n=0;n<t;n++)if(e.pre_context[n]?.includes(c))return!0}return!1}(e,n))))).map((e=>e.module_metadata?Object.keys(e.module_metadata).filter((e=>e.startsWith(l))).map((e=>e.slice(l.length))):[]))}(t,e.ignoreSentryInternalFrames);if(n){if(n["drop-error-if-contains-third-party-frames"===e.behaviour||"apply-tag-if-contains-third-party-frames"===e.behaviour?"some":"every"]((t=>!t.some((t=>e.filterKeys.includes(t)))))){if("drop-error-if-contains-third-party-frames"===e.behaviour||"drop-error-if-exclusively-contains-third-party-frames"===e.behaviour)return null;t.tags={...t.tags,third_party_code:!0}}}return t}})));const l="_sentryBundlerPluginAppKey:",c="Attempt to invoke user-land function",u="fn.apply(this, wrappedArguments)";t.thirdPartyErrorFilterIntegration=o},24208(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(82430),s=n(88532),i=n(79721);function a(e){return{...e,path:"path"in e&&Array.isArray(e.path)?e.path.join("."):void 0,keys:"keys"in e?JSON.stringify(e.keys):void 0,unionErrors:"unionErrors"in e?JSON.stringify(e.unionErrors):void 0}}function o(e){return e.map((e=>"number"==typeof e?"<array>":e)).join(".")}function l(e){const t=new Set;for(const n of e.issues){const e=o(n.path);e.length>0&&t.add(e)}const n=Array.from(t);if(0===n.length){let t="variable";if(e.issues.length>0){const n=e.issues[0];void 0!==n&&"expected"in n&&"string"==typeof n.expected&&(t=n.expected)}return`Failed to validate ${t}`}return`Failed to validate keys: ${i.truncate(n.join(", "),100)}`}function c(e,t=!1,n,r){if(!(n.exception?.values&&r.originalException&&(i=r.originalException,s.isError(i)&&"ZodError"===i.name&&Array.isArray(i.issues))&&0!==r.originalException.issues.length))return n;var i;try{const s=(t?r.originalException.issues:r.originalException.issues.slice(0,e)).map(a);return t&&(Array.isArray(r.attachments)||(r.attachments=[]),r.attachments.push({f
1ilename:"zod_issues.json",data:JSON.stringify({issues:s})})),{...n,exception:{...n.exception,values:[{...n.exception.values[0],value:l(r.originalException)},...n.exception.values.slice(1)]},extra:{...n.extra,"zoderror.issues":s.slice(0,e)}}}catch(e){return{...n,extra:{...n.extra,"zoderrors sentry integration parse error":{message:"an exception was thrown while processing ZodError within applyZodErrorsToEvent()",error:e instanceof Error?`${e.name}: ${e.message}\n${e.stack}`:"unknown"}}}}}const u=r.defineIntegration(((e={})=>{const t=e.limit??10;return{name:"ZodErrors",processEvent:(n,r)=>c(t,e.saveZodIssuesAsAttachment,n,r)}}));t.applyZodErrorsToEvent=c,t.flattenIssue=a,t.flattenIssuePath=o,t.formatIssueMessage=l,t.zodErrorsIntegration=u},78604(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(49564),s=n(68974),i=n(83389),a=n(82430),o=n(52751),l=n(85110),c=n(97373),u=n(59075),d={[o.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]:"auto.log.console"},h=a.defineIntegration(((e={})=>{const t=e.levels||l.CONSOLE_LEVELS;return{name:"ConsoleLogs",setup(e){const{enableLogs:n,normalizeDepth:a=3,normalizeMaxBreadth:o=1e3}=e.getOptions();if(!n)return void(s.DEBUG_BUILD&&l.debug.warn("`enableLogs` is not enabled, ConsoleLogs integration disabled"));const h=i.addConsoleInstrumentationHandler((({args:n,level:s})=>{if(r.getClient()!==e||!t.includes(s))return;const i=n[0],l=n.slice(1);if("assert"===s){if(!i){const e=l.length>0?`Assertion failed: ${u.formatConsoleArgs(l,a,o)}`:"Assertion failed";c._INTERNAL_captureLog({level:"error",message:e,attributes:d})}return}const h="log"===s,f=n.length>1&&"string"==typeof n[0]&&!u.hasConsoleSubstitutions(n[0]),p={...d,...f?u.createConsoleTemplateAttributes(i,l):{}};c._INTERNAL_captureLog({level:h?"info":s,message:u.formatConsoleArgs(n,a,o),severityNumber:h?10:void 0,attributes:p})}));e.registerCleanup(h)}}}));t.consoleLoggingIntegration=h},80851(e,t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});t.SEVERITY_TEXT_TO_SEVERITY_NUMBER={trace:1,debug:5,info:9,warn:13,error:17,fatal:21}},85236(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(21811),s=n(99188),i=n(64702);function a(e,t){const n=t?"auto":"never";return[{type:"log",item_count:e.length,content_type:"application/vnd.sentry.items.log+json"},{version:2,...i.isBrowser()&&{ingest_settings:{infer_ip:n,infer_user_agent:n}},items:e}]}t.createLogContainerEnvelopeItem=a,t.createLogEnvelope=function(e,t,n,i,o){const l={};return t?.sdk&&(l.sdk={name:t.sdk.name,version:t.sdk.version}),n&&i&&(l.dsn=r.dsnToString(i)),s.createEnvelope(l,[a(e,o)])}},97373(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(22147),s=n(73220),i=n(49564),a=n(68974),o=n(85110),l=n(88532),c=n(37402),u=n(64865),d=n(26869),h=n(69483),f=n(61872),p=n(80851),g=n(85236);function m(e,t,n,r=!0){!n||e[t]&&!r||(e[t]=n)}function _(e,t){const n=y(),r=E(e);void 0===r?n.set(e,[t]):r.length>=100?(T(e,r),n.set(e,[t])):n.set(e,[...r,t])}function T(e,t){const n=t??E(e)??[];if(0===n.length)return;const r=e.getOptions(),s=g.createLogEnvelope(n,r._metadata,r.tunnel,e.getDsn(),r.sendDefaultPii);y().set(e,[]),e.emit("flushLogs"),e.sendEnvelope(s)}function E(e){return y().get(e)}function y(){return s.getGlobalSingleton("clientToLogBufferMap",(()=>new WeakMap))}t._INTERNAL_captureLog=function(e,t=i.getCurrentScope(),n=_){const s=t?.getClient()??i.getClient();if(!s)return void(a.DEBUG_BUILD&&o.debug.warn("No client available to capture log."));const{release:g,environment:T,enableLogs:E=!1,beforeSendLog:y}=s.getOptions();if(!E)return void(a.DEBUG_BUILD&&o.debug.warn("logging option not enabled, log will not be captured."));const[,S]=f._getTraceInfoFromScope(s,t),v={...e.attributes},{user:{id:b,email:I,username:A},attributes:R={}}=c.getCombinedScopeData(i.getIsolationScope(),t);m(v,"user.id",b,!1),m(v,"user.email",I,!1),m(v,"user.name",A,!1),m(v,"sentry.release",g),m(v,"sentry.environment",T);const{name:C,version:k}=s.getSdkMetadata()?.sdk??{};m(v,"sentry.sdk.name",C),m(v,"sentry.sdk.version",k);const L=s.getIntegrationByName("Replay"),O=L?.getReplayId(!0);m(v,"sentry.replay_id",O),O&&"buffer"===L?.getRecordingMode()&&m(v,"sentry._internal.replay_is_buffering",!0);const N=e.message;
1if(l.isParameterizedString(N)){const{__sentry_template_string__:e,__sentry_template_values__:t=[]}=N;t?.length&&(v["sentry.message.template"]=e),t.forEach(((e,t)=>{v[`sentry.message.parameter.${t}`]=e}))}const w=u._getSpanForScope(t);m(v,"sentry.trace.parent_span_id",w?.spanContext().spanId);const P={...e,attributes:v};s.emit("beforeCaptureLog",P);const M=y?o.consoleSandbox((()=>y(P))):P;if(!M)return s.recordDroppedEvent("before_send","log_item",1),void(a.DEBUG_BUILD&&o.debug.warn("beforeSendLog returned null, log will not be captured."));const{level:D,message:x,attributes:U={},severityNumber:B}=M,F=d.timestampInSeconds(),$=h.getSequenceAttribute(F);n(s,{timestamp:F,level:D,body:x,trace_id:S?.trace_id,severity_number:B??p.SEVERITY_TEXT_TO_SEVERITY_NUMBER[D],attributes:{...r.serializeAttributes(R),...r.serializeAttributes(U,!0),[$.key]:$.value}}),s.emit("afterCaptureLog",M)},t._INTERNAL_captureSerializedLog=_,t._INTERNAL_flushLogsBuffer=T,t._INTERNAL_getLogBuffer=E},85296(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(97373),s=n(72979);function i(e,t,n,s,i){r._INTERNAL_captureLog({level:e,message:t,attributes:n,severityNumber:i},s)}t.fmt=s.fmt,t.debug=function(e,t,{scope:n}={}){i("debug",e,t,n)},t.error=function(e,t,{scope:n}={}){i("error",e,t,n)},t.fatal=function(e,t,{scope:n}={}){i("fatal",e,t,n)},t.info=function(e,t,{scope:n}={}){i("info",e,t,n)},t.trace=function(e,t,{scope:n}={}){i("trace",e,t,n)},t.warn=function(e,t,{scope:n}={}){i("warn",e,t,n)}},59075(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(88532),s=n(88585),i=n(73969);function a(e,t,n){return e.map((e=>r.isPrimitive(e)?String(e):JSON.stringify(s.normalize(e,t,n)))).join(" ")}t.createConsoleTemplateAttributes=function(e,t){const n={},r=new Array(t.length).fill("{}").join(" ");return n["sentry.message.template"]=`${e} ${r}`,t.forEach(((e,t)=>{n[`sentry.message.parameter.${t}`]=e})),n},t.formatConsoleArgs=function(e,t,n){return"util"in i.GLOBAL_OBJ&&"function"==typeof i.GLOBAL_OBJ.util.format?i.GLOBAL_OBJ.util.format(...e):a(e,t,n)},t.hasConsoleSubstitutions=function(e){return/%[sdifocO]/.test(e)},t.safeJoinConsoleArgs=a},36823(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(73969),s=new Map,i=new Set;function a(e,t){return function(e){if(r.GLOBAL_OBJ._sentryModuleMetadata)for(const t of Object.keys(r.GLOBAL_OBJ._sentryModuleMetadata)){const n=r.GLOBAL_OBJ._sentryModuleMetadata[t];if(i.has(t))continue;i.add(t);const a=e(t);for(const e of a.reverse())if(e.filename){s.set(e.filename,n);break}}}(e),s.get(t)}t.addMetadataToStackFrames=function(e,t){t.exception?.values?.forEach((t=>{t.stacktrace?.frames?.forEach((t=>{if(!t.filename||t.module_metadata)return;const n=a(e,t.filename);n&&(t.module_metadata=n)}))}))},t.getFilenameToMetadataMap=function(e){if(!r.GLOBAL_OBJ._sentryModuleMetadata)return{};const t={};for(const n of Object.keys(r.GLOBAL_OBJ._sentryModuleMetadata)){const s=r.GLOBAL_OBJ._sentryModuleMetadata[n],i=e(n);for(const e of i.reverse())if(e.filename){t[e.filename]=s;break}}return t},t.getMetadataForUrl=a,t.stripMetadataFromStackFrames=function(e){e.exception?.values?.forEach((e=>{e.stacktrace?.frames?.forEach((e=>{delete e.module_metadata}))}))}},8844(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(21811),s=n(99188),i=n(64702);function a(e,t){const n=t?"auto":"never";return[{type:"trace_metric",item_count:e.length,content_type:"application/vnd.sentry.items.trace-metric+json"},{version:2,...i.isBrowser()&&{ingest_settings:{infer_ip:n,infer_user_agent:n}},items:e}]}t.createMetricContainerEnvelopeItem=a,t.createMetricEnvelope=function(e,t,n,i,o){const l={};return t?.sdk&&(l.sdk={name:t.sdk.name,version:t.sdk.version}),n&&i&&(l.dsn=r.dsnToString(i)),s.createEnvelope(l,[a(e,o)])}},63717(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(22147),s=n(73220),i=n(49564),a=n(68974),o=n(85110),l=n(37402),c=n(64865),u=n(26869),d=n(69483),h=n(61872),f=n(8844);function p(e,t,n,r=!0){!n||!r&&t in e||(e[t]=n)}function g(e,t){const n=T(),r=_(e);void 0===r?n.set(e,[t]):r.length>=1e3?(m(e,r),n.set(e,[t])):n.set(e,[...r,t])}function m(e,t){const n=t??_(e)??[];if(0===n.length)return;const r=e.getOptions(),s=f.createMetricEnvelope(n,r._metadata,r.tunnel,e.getDsn(),r.sendDefaultPii);T().set(e,[]),e.emit("flushMetrics"),e.sendEnvelope(s)}function _(e){return T().get(e)}function T(){return s.getGlobalSingleton("clientToMetricBufferMap",(()=>new WeakMap))}
1t._INTERNAL_captureMetric=function(e,t){const n=t?.scope??i.getCurrentScope(),s=t?.captureSerializedMetric??g,f=n?.getClient()??i.getClient();if(!f)return void(a.DEBUG_BUILD&&o.debug.warn("No client available to capture metric."));const{_experiments:m,enableMetrics:_,beforeSendMetric:T}=f.getOptions();if(!(_??m?.enableMetrics??!0))return void(a.DEBUG_BUILD&&o.debug.warn("metrics option not enabled, metric will not be captured."));const{user:E,attributes:y}=l.getCombinedScopeData(i.getIsolationScope(),n),S=function(e,t,n){const{release:r,environment:s}=t.getOptions(),i={...e.attributes};p(i,"user.id",n.id,!1),p(i,"user.email",n.email,!1),p(i,"user.name",n.username,!1),p(i,"sentry.release",r),p(i,"sentry.environment",s);const{name:a,version:o}=t.getSdkMetadata()?.sdk??{};p(i,"sentry.sdk.name",a),p(i,"sentry.sdk.version",o);const l=t.getIntegrationByName("Replay"),c=l?.getReplayId(!0);return p(i,"sentry.replay_id",c),c&&"buffer"===l?.getRecordingMode()&&p(i,"sentry._internal.replay_is_buffering",!0),{...e,attributes:i}}(e,f,E);f.emit("processMetric",S);const v=T||m?.beforeSendMetric,b=v?v(S):S;if(!b)return void(a.DEBUG_BUILD&&o.debug.log("`beforeSendMetric` returned `null`, will not send metric."));const I=function(e,t,n,s){const[,i]=h._getTraceInfoFromScope(t,n),a=c._getSpanForScope(n),o=a?a.spanContext().traceId:i?.trace_id,l=a?a.spanContext().spanId:void 0,f=u.timestampInSeconds(),p=d.getSequenceAttribute(f);return{timestamp:f,trace_id:o??"",span_id:l,name:e.name,type:e.type,unit:e.unit,value:e.value,attributes:{...r.serializeAttributes(s),...r.serializeAttributes(e.attributes,"skip-undefined"),[p.key]:p.value}}}(b,f,n,y);a.DEBUG_BUILD&&o.debug.log("[Metric]",I),s(f,I),f.emit("afterCaptureMetric",b)},t._INTERNAL_captureSerializedMetric=g,t._INTERNAL_flushMetricsBuffer=m,t._INTERNAL_getMetricBuffer=_},39320(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(63717);function s(e,t,n,s){r._INTERNAL_captureMetric({type:e,name:t,value:n,unit:s?.unit,attributes:s?.attributes},{scope:s?.scope})}t.count=function(e,t=1,n){s("counter",e,t,n)},t.distribution=function(e,t,n){s("distribution",e,t,n)},t.gauge=function(e,t,n){s("gauge",e,t,n)}},83090(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(49564),s=n(68974),i=n(85110);function a(e){return!!e&&void 0!==e._profiler&&"function"==typeof e._profiler.start&&"function"==typeof e._profiler.stop}const o={startProfiler:function(){const e=r.getClient();if(!e)return void(s.DEBUG_BUILD&&i.debug.warn("No Sentry client available, profiling is not started"));const t=e.getIntegrationByName("ProfilingIntegration");t?a(t)?t._profiler.start():s.DEBUG_BUILD&&i.debug.warn("Profiler is not available on profiling integration."):s.DEBUG_BUILD&&i.debug.warn("ProfilingIntegration is not available")},stopProfiler:function(){const e=r.getClient();if(!e)return void(s.DEBUG_BUILD&&i.debug.warn("No Sentry client available, profiling is not started"));const t=e.getIntegrationByName("ProfilingIntegration");t?a(t)?t._profiler.stop():s.DEBUG_BUILD&&i.debug.warn("Profiler is not available on profiling integration."):s.DEBUG_BUILD&&i.debug.warn("ProfilingIntegration is not available")}};t.profiler=o},69640(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(68974),s=n(11348),i=n(85110),a=n(88532),o=n(19090),l=n(96940),c=n(58913),u=n(83031),d=n(64865),h=n(79721),f=n(26869);class p{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:c.generateTraceId(),sampleRand:u.safeMathRandom()}}clone(){const e=new p;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,d._setSpanForScope(e,d._getSpanForScope(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&&s.updateSession(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,t){return this.setTags({[e]:t})}setAttributes(e){return this._attributes={...this._attributes,...e},this._notifyScopeListeners(),this}setAttribute(e,t){return this.setAttributes({[e]:t})}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,t){return this._extra={...this._extra,[e]:t},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,t){return null===t?delete this._contexts[e]:this._contexts[e]=t,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;const t="function"==typeof e?e(this):e,n=t instanceof p?t.getScopeData():a.isPlainObject(t)?e:void 0,{tags:r,attributes:s,extra:i,user:o,contexts:l,level:c,fingerprint:u=[],propagationContext:d,conversationId:h}=n||{};return this._tags={...this._tags,...r},this._attributes={...this._attributes,...s},this._extra={...this._extra,...i},this._contexts={...this._contexts,...l},o&&Object.keys(o).length&&(this._user=o),c&&(this._level=c),u.length&&(this._fingerprint=u),d&&(this._propagationContext=d),h&&(this._conversationId=h),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,d._setSpanForScope(this,void 0),this._attachments=[],this.setPropagationContext({traceId:c.generateTraceId(),sampleRand:u.safeMathRandom()}),this._notifyScopeListeners(),this}addBreadcrumb(e,t){const n="number"==typeof t?t:100;if(n<=0)return this;const r={timestamp:f.dateTimestampInSeconds(),...e,message:e.message?h.truncate(e.message,2048):e.message};return this._breadcrumbs.push(r),this._breadcrumbs.length>n&&(this._breadcrumbs=this._breadcrumbs.slice(-n),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:d._getSpanForScope(this),conversationId:this._conversationId}}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata=o.merge(this._sdkProcessingMetadata,e,2),this}setPropagationContext(e){return this._propagationContext=e,this}getPropagationContext(){return this._propagationContext}captureException(e,t){const n=t?.event_id||l.uuid4();if(!this._client)return r.DEBUG_BUILD&&i.debug.warn("No client configured on scope - will not capture exception!"),n;const s=new Error("Sentry syntheticException");return this._client.captureException(e,{originalException:e,syntheticException:s,...t,event_id:n},this),n}captureMessage(e,t,n){const s=n?.event_id||l.uuid4();if(!this._client)return r.DEBUG_BUILD&&i.debug.warn("No client configured on scope - will not capture message!"),s;const a=n?.syntheticException??new Error(e);return this._client.captureMessage(e,t,{originalException:e,syntheticException:a,...n,event_id:s},this),s}captureEvent(e,t){const n=e.event_id||t?.event_id||l.uuid4();return this._client?(this._client.captureEvent(e,{...t,event_id:n},this),n):(r.DEBUG_BUILD&&i.debug.warn("No client configured on scope - will not capture event!"),n)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEac
1h((e=>{e(this)})),this._notifyingListeners=!1)}}t.Scope=p},27008(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(49564),s=n(68974),i=n(85110);function a(e){r.getCurrentScope().setClient(e)}t.initAndBind=function(e,t){!0===t.debug&&(s.DEBUG_BUILD?i.debug.enable():i.consoleSandbox((()=>{console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.")}))),r.getCurrentScope().update(t.initialScope);const n=new e(t);return a(n),n.init(),n},t.setCurrentClient=a},52751(e,t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});t.GEN_AI_CONVERSATION_ID_ATTRIBUTE="gen_ai.conversation.id",t.SEMANTIC_ATTRIBUTE_CACHE_HIT="cache.hit",t.SEMANTIC_ATTRIBUTE_CACHE_ITEM_SIZE="cache.item_size",t.SEMANTIC_ATTRIBUTE_CACHE_KEY="cache.key",t.SEMANTIC_ATTRIBUTE_EXCLUSIVE_TIME="sentry.exclusive_time",t.SEMANTIC_ATTRIBUTE_HTTP_REQUEST_METHOD="http.request.method",t.SEMANTIC_ATTRIBUTE_PROFILE_ID="sentry.profile_id",t.SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME="sentry.custom_span_name",t.SEMANTIC_ATTRIBUTE_SENTRY_ENVIRONMENT="sentry.environment",t.SEMANTIC_ATTRIBUTE_SENTRY_IDLE_SPAN_FINISH_REASON="sentry.idle_span_finish_reason",t.SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_UNIT="sentry.measurement_unit",t.SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_VALUE="sentry.measurement_value",t.SEMANTIC_ATTRIBUTE_SENTRY_OP="sentry.op",t.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN="sentry.origin",t.SEMANTIC_ATTRIBUTE_SENTRY_PREVIOUS_TRACE_SAMPLE_RATE="sentry.previous_trace_sample_rate",t.SEMANTIC_ATTRIBUTE_SENTRY_RELEASE="sentry.release",t.SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE="sentry.sample_rate",t.SEMANTIC_ATTRIBUTE_SENTRY_SDK_NAME="sentry.sdk.name",t.SEMANTIC_ATTRIBUTE_SENTRY_SDK_VERSION="sentry.sdk.version",t.SEMANTIC_ATTRIBUTE_SENTRY_SEGMENT_ID="sentry.segment.id",t.SEMANTIC_ATTRIBUTE_SENTRY_SEGMENT_NAME="sentry.segment.name",t.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE="sentry.source",t.SEMANTIC_ATTRIBUTE_URL_FULL="url.full",t.SEMANTIC_ATTRIBUTE_USER_EMAIL="user.email",t.SEMANTIC_ATTRIBUTE_USER_ID="user.id",t.SEMANTIC_ATTRIBUTE_USER_IP_ADDRESS="user.ip_address",t.SEMANTIC_ATTRIBUTE_USER_USERNAME="user.name",t.SEMANTIC_LINK_ATTRIBUTE_LINK_TYPE="sentry.link.type"},24842(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(60251),s=n(83913),i=n(49564),a=n(68974),o=n(44038),l=n(85110),c=n(96940),u=n(64450),d=n(62299),h=n(93395),f=n(31901),p=n(94486),g=n(61872);class m extends s.Client{__init(){this._disposeCallbacks=[]}constructor(e){o.registerSpanErrorInstrumentation(),d.addUserAgentToTransportHeaders(e),super(e),m.prototype.__init.call(this),this._setUpMetricsProcessing()}eventFromException(e,t){const n=h.eventFromUnknownInput(this,this._options.stackParser,e,t);return n.level="error",p.resolvedSyncPromise(n)}eventFromMessage(e,t="info",n){return p.resolvedSyncPromise(h.eventFromMessage(this._options.stackParser,e,t,n,this._options.attachStacktrace))}captureException(e,t,n){return _(t),super.captureException(e,t,n)}captureEvent(e,t,n){return!e.type&&e.exception?.values&&e.exception.values.length>0&&_(t),super.captureEvent(e,t,n)}captureCheckIn(e,t,n){const s="checkInId"in e&&e.checkInId?e.checkInId:c.uuid4();if(!this._isEnabled())return a.DEBUG_BUILD&&l.debug.warn("SDK not enabled, will not capture check-in."),s;const i=this.getOptions(),{release:o,environment:u,tunnel:d}=i,h={check_in_id:s,monitor_slug:e.monitorSlug,status:e.status,release:o,environment:u};"duration"in e&&(h.duration=e.duration),t&&(h.monitor_config={schedule:t.schedule,checkin_margin:t.checkinMargin,max_runtime:t.maxRuntime,timezone:t.timezone,failure_issue_threshold:t.failureIssueThreshold,recovery_threshold:t.recoveryThreshold});const[f,p]=g._getTraceInfoFromScope(this,n);p&&(h.contexts={trace:p});const m=r.createCheckInEnvelope(h,f,this.getSdkMetadata(),d,this.getDsn());return a.DEBUG_BUILD&&l.debug.log("Sending checkin:",e.monitorSlug,e.status),this.sendEnvelope(m),s}registerCleanup(e){this._disposeCallbacks.push(e)}dispose(){a.DEBUG_BUILD&&l.debug.log("Disposing client...");for(const e of this._disposeCallbacks)try{e()}catch{}this._disposeCallbacks.length=0;for(const e of Object.keys(this._hooks))this._hooks[e]?.clear();this._hooks={},this._eventProcessors.length=0,this._integrations={},this._outcomes={},this._transport=void 0,this._promiseBuffer=f.makePromiseBuffer(u.DEFAULT_TRANSPORT_BUFFER_SIZE)}_prepareEvent(e,t,n,r){return this._options.platform&&(e.platform=e.platform||this._options.platform),this._options.runtime&&(e.contexts={...e.contexts,runtime:e.contexts?.runtime||this._options.runtime}),this._options.serverName&&(e.server_name=e.server_name||this._options.serverName),super._prepareEvent(e,t,n,r)}_setUpMetricsProcessing(){this.on("processMetric",(e=>{this._options.serverName&&(e.attributes={"server.address":this._options.serverName,...e.attributes})}))}}function _(e){const t=i.getIsolationScope().getScopeData().sdkProcessingMetadata.requestSession;if(t){const n=e?.mechanism?.handled??!0;n&&"crashed"!==t.status?t.status="errored":n||(t.status="crashed")}}t.ServerRuntimeClient=m},11348(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(96940),s=n(26869);function i(e,t={}){if(t.user&&(!e.ipAddress&&t.user.ip_address&&(e.ipAddress=t.user.ip_address),e.did||t.did||(e.did=t.user.id||t.user.email||t.user.username)),e.timestamp=t.timestamp||s.timestampInSeconds(),t.abnormal_mechanism&&(e.abnormal_mechanism=t.abnormal_mechanism),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=32===t.sid.length?t.sid:r.uuid4()),void 0!==t.init&&(e.init=t.init),!e.did&&t.did&&(e.did=`${t.did}`),"number"==typeof t.started&&(e.started=t.started),e.ignoreDuration)e.duration=void 0;else if("number"==typeof t.duration)e.duration=t.duration;else{const t=e.timestamp-e.started;e.duration=t>=0?t:0}t.release&&(e.release=t.release),t.environment&&(e.environment=t.environment),!e.ipAddress&&t.ipAddress&&(e.ipAddress=t.ipAddress),!e.userAgent&&t.userAgent&&(e.userAgent=t.userAgent),"number"==typeof t.errors&&(e.errors=t.errors),t.status&&(e.status=t.status)}t.closeSession=function(e,t){let n={};t?n={status:t}:"ok"===e.status&&(n={status:"exited"}
1),i(e,n)},t.makeSession=function(e){const t=s.timestampInSeconds(),n={sid:r.uuid4(),init:!0,timestamp:t,started:t,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>function(e){return{sid:`${e.sid}`,init:e.init,started:new Date(1e3*e.started).toISOString(),timestamp:new Date(1e3*e.timestamp).toISOString(),status:e.status,errors:e.errors,did:"number"==typeof e.did||"string"==typeof e.did?`${e.did}`:void 0,duration:e.duration,abnormal_mechanism:e.abnormal_mechanism,attrs:{release:e.release,environment:e.environment,ip_address:e.ipAddress,user_agent:e.userAgent}}}(n)};return e&&i(n,e),n},t.updateSession=i},24231(e,t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});t.GEN_AI_AGENT_NAME_ATTRIBUTE="gen_ai.agent.name",t.GEN_AI_CONVERSATION_ID_ATTRIBUTE="gen_ai.conversation.id",t.GEN_AI_EMBEDDINGS_INPUT_ATTRIBUTE="gen_ai.embeddings.input",t.GEN_AI_EMBEDDINGS_OPERATION_ATTRIBUTE="gen_ai.embeddings",t.GEN_AI_EXECUTE_TOOL_OPERATION_ATTRIBUTE="gen_ai.execute_tool",t.GEN_AI_INPUT_MESSAGES_ATTRIBUTE="gen_ai.input.messages",t.GEN_AI_INPUT_MESSAGES_ORIGINAL_LENGTH_ATTRIBUTE="sentry.sdk_meta.gen_ai.input.messages.original_length",t.GEN_AI_INVOKE_AGENT_OPERATION_ATTRIBUTE="gen_ai.invoke_agent",t.GEN_AI_OPERATION_NAME_ATTRIBUTE="gen_ai.operation.name",t.GEN_AI_OUTPUT_MESSAGES_ATTRIBUTE="gen_ai.output.messages",t.GEN_AI_PIPELINE_NAME_ATTRIBUTE="gen_ai.pipeline.name",t.GEN_AI_PROMPT_ATTRIBUTE="gen_ai.prompt",t.GEN_AI_REQUEST_AVAILABLE_TOOLS_ATTRIBUTE="gen_ai.request.available_tools",t.GEN_AI_REQUEST_DIMENSIONS_ATTRIBUTE="gen_ai.request.dimensions",t.GEN_AI_REQUEST_ENCODING_FORMAT_ATTRIBUTE="gen_ai.request.encoding_format",t.GEN_AI_REQUEST_FREQUENCY_PENA
1LTY_ATTRIBUTE="gen_ai.request.frequency_penalty",t.GEN_AI_REQUEST_MAX_TOKENS_ATTRIBUTE="gen_ai.request.max_tokens",t.GEN_AI_REQUEST_MODEL_ATTRIBUTE="gen_ai.request.model",t.GEN_AI_REQUEST_PRESENCE_PENALTY_ATTRIBUTE="gen_ai.request.presence_penalty",t.GEN_AI_REQUEST_STREAM_ATTRIBUTE="gen_ai.request.stream",t.GEN_AI_REQUEST_TEMPERATURE_ATTRIBUTE="gen_ai.request.temperature",t.GEN_AI_REQUEST_TOP_K_ATTRIBUTE="gen_ai.request.top_k",t.GEN_AI_REQUEST_TOP_P_ATTRIBUTE="gen_ai.request.top_p",t.GEN_AI_RESPONSE_FINISH_REASONS_ATTRIBUTE="gen_ai.response.finish_reasons",t.GEN_AI_RESPONSE_ID_ATTRIBUTE="gen_ai.response.id",t.GEN_AI_RESPONSE_MODEL_ATTRIBUTE="gen_ai.response.model",t.GEN_AI_RESPONSE_STOP_REASON_ATTRIBUTE="gen_ai.response.stop_reason",t.GEN_AI_RESPONSE_STREAMING_ATTRIBUTE="gen_ai.response.streaming",t.GEN_AI_RESPONSE_TEXT_ATTRIBUTE="gen_ai.response.text",t.GEN_AI_RESPONSE_TOOL_CALLS_ATTRIBUTE="gen_ai.response.tool_calls",t.GEN_AI_SYSTEM_ATTRIBUTE="gen_ai.system",t.GEN_AI_SYSTEM_INSTRUCTIONS_ATTRIBUTE="gen_ai.system_instructions",t.GEN_AI_TOOL_CALL_ID_ATTRIBUTE="gen_ai.tool.call.id",t.GEN_AI_TOOL_DESCRIPTION_ATTRIBUTE="gen_ai.tool.description",t.GEN_AI_TOOL_INPUT_ATTRIBUTE="gen_ai.tool.input",t.GEN_AI_TOOL_NAME_ATTRIBUTE="gen_ai.tool.name",t.GEN_AI_TOOL_OUTPUT_ATTRIBUTE="gen_ai.tool.output",t.GEN_AI_TOOL_TYPE_ATTRIBUTE="gen_ai.tool.type",t.GEN_AI_USAGE_CACHE_CREATION_INPUT_TOKENS_ATTRIBUTE="gen_ai.usage.cache_creation_input_tokens",t.GEN_AI_USAGE_CACHE_READ_INPUT_TOKENS_ATTRIBUTE="gen_ai.usage.cache_read_input_tokens",t.GEN_AI_USAGE_INPUT_TOKENS_ATTRIBUTE="gen_ai.usage.input_tokens",t.GEN_AI_USAGE_INPUT_TOKENS_CACHED_ATTRIBUTE="gen_ai.usage.input_tokens.cached",t.GEN_AI_USAGE_INPUT_TOKENS_CACHE_WRITE_ATTRIBUTE="gen_ai.usage.input_tokens.cache_write",t.GEN_AI_USAGE_OUTPUT_TOKENS_ATTRIBUTE="gen_ai.usage.output_tokens",t.GEN_AI_USAGE_TOTAL_TOKENS_ATTRIBUTE="gen_ai.usage.total_tokens"},53620(e,t){function n(e){return!(!e||"object"!=typeof e)&&(function(e){return"type"in e&&"string"==typeof e.type&&"source"in e&&n(e.source)}(e)||s(e)||function(e){return"image_url"in e&&("string"==typeof e.image_url?e.image_url.startsWith("data:"):r(e))}(e)||i(e)||a(e)||function(e){return"media_type"in e&&"string"==typeof e.media_type&&"data"in e}(e)||function(e){return"type"in e&&"file"===e.type&&"mediaType"in e&&"string"==typeof e.mediaType&&"data"in e&&"string"==typeof e.data&&!e.data.startsWith("http://")&&!e.data.startsWith("https://")}(e)||function(e){return"type"in e&&"image"===e.type&&"image"in e&&"string"==typeof e.image&&!e.image.startsWith("http://")&&!e.image.startsWith("https://")}(e)||function(e){return"type"in e&&("blob"===e.type||"base64"===e.type)}(e)||function(e){return"b64_json"in e}(e)||function(e){return"type"in e&&"result"in e&&"image_generation"===e.type}(e)||function(e){return"uri"in e&&"string"==typeof e.uri&&e.uri.startsWith("data:")}(e))}function r(e){return"image_url"in e&&!!e.image_url&&"object"==typeof e.image_url&&"url"in e.image_url&&"string"==typeof e.image_url.url&&e.image_url.url.startsWith("data:")}function s(e){return"inlineData"in e&&!!e.inlineData&&"object"==typeof e.inlineData&&"data"in e.inlineData&&"string"==typeof e.inlineData.data}function i(e){return"type"in e&&"input_audio"===e.type&&"input_audio"in e&&!!e.input_audio&&"object"==typeof e.input_audio&&"data"in e.input_audio&&"string"==typeof e.input_audio.data}function a(e){return"type"in e&&"file"===e.type&&"file"in e&&!!e.file&&"object"==typeof e.file&&"file_data"in e.file&&"string"==typeof e.file.file_data}Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const o="[Blob substitute]",l=["image_url","data","content","b64_json","result","uri","image"];t.isContentMedia=n,t.stripInlineMediaFromSingleMessage=function e(t){const c={...t};n(c.source)&&(c.source=e(c.source)),s(t)&&(c.inlineData={...t.inlineData,data:o}),r(t)&&(c.image_url={...t.image_url,url:o}),i(t)&&(c.input_audio={...t.input_audio,data:o}),a(t)&&(c.file={...t.file,file_data:o});for(const e of l)"string"==typeof c[e]&&(c[e]=o);return c}},69144(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(53620),s=2e4,i=e=>(new TextEncoder).encode(e).length,a=e=>i(JSON.stringify(e));function o(e,t){if(i(e)<=t)return e;let n=0,r=e.length,s="";for(;n<=r;){const a=Math.floor((n+r)/2),o=e.slice(0,a);i(o)<=t?(s=o,n=a+1):r=a-1}return s}function l(e){return"string"==typeof e?e:"text"in e&&"string"==typeof e.text?e.text:""}function c(e,t){return"string"==typeof e?t:{...e,text:t}}function u(e){return null!==e&&"object"==typeof e&&"content"in e&&Array.isArray(e.content)}function d(e){return null!==e&&"object"==typeof e&&"parts"in e&&Array.isArray(e.parts)&&e.parts.length>0}function h(e,t){const{key:n,items:r}=function(e){return"parts"in e&&Array.isArray(e.parts)?{key:"parts",items:e.parts}
1:"content"in e&&Array.isArray(e.content)?{key:"content",items:e.content}:{key:null,items:[]}}(e);if(null===n||0===r.length)return[];const s=r.map((e=>c(e,"")));let u=t-a({...e,[n]:s});if(u<=0)return[];const d=[];for(const e of r){const t=l(e),n=i(t);if(!(n<=u)){if(0===d.length){const n=o(t,u);n&&d.push(c(e,n));break}break}d.push(e),u-=n}return d.length<=0?[]:[{...e,[n]:d}]}function f(e,t){if(!e)return[];if("string"==typeof e){const n=o(e,t);return n?[n]:[]}return"object"!=typeof e?[]:function(e){return null!==e&&"object"==typeof e&&"content"in e&&"string"==typeof e.content}(e)?function(e,t){const n={...e,content:""},r=t-a(n);if(r<=0)return[];const s=o(e.content,r);return[{...e,content:s}]}(e,t):u(e)||d(e)?h(e,t):[]}function p(e){return e.map((e=>{let t;return e&&"object"==typeof e&&(u(e)?t={...e,content:p(e.content)}:"content"in e&&r.isContentMedia(e.content)&&(t={...e,content:r.stripInlineMediaFromSingleMessage(e.content)}),d(e)&&(t={...t??e,parts:p(e.parts)}),r.isContentMedia(t)?t=r.stripInlineMediaFromSingleMessage(t):r.isContentMedia(e)&&(t=r.stripInlineMediaFromSingleMessage(e))),t??e}))}function g(e,t){if(!Array.isArray(e)||0===e.length)return e;const n=t-2,r=p([e[e.length-1]]),s=r[0];return a(s)<=n?r:f(s,n)}t.DEFAULT_GEN_AI_MESSAGES_BYTE_LIMIT=s,t.truncateGenAiMessages=function(e){return g(e,s)},t.truncateGenAiStringInput=function(e){return o(e,s)}},2881(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(79183),s=n(49564),i=n(85526),a=n(88532),o=n(24231),l=n(69144);t.buildMethodPath=function(e,t){return e?`${e}.${t}`:t},t.endStreamSpan=function(e,t,n){if(!e.isRecording())return;const r={[o.GEN_AI_RESPONSE_STREAMING_ATTRIBUTE]:!0};t.responseId&&(r[o.GEN_AI_RESPONSE_ID_ATTRIBUTE]=t.responseId),t.responseModel&&(r[o.GEN_AI_RESPONSE_MODEL_ATTRIBUTE]=t.responseModel),void 0!==t.promptTokens&&(r[o.GEN_AI_USAGE_INPUT_TOKENS_ATTRIBUTE]=t.promptTokens),void 0!==t.completionTokens&&(r[o.GEN_AI_USAGE_OUTPUT_TOKENS_ATTRIBUTE]=t.completionTokens),void 0!==t.totalTokens?r[o.GEN_AI_USAGE_TOTAL_TOKENS_ATTRIBUTE]=t.totalTokens:void 0===t.promptTokens&&void 0===t.completionTokens&&void 0===t.cacheCreationInputTokens&&void 0===t.cacheReadInputTokens||(r[o.GEN_AI_USAGE_TOTAL_TOKENS_ATTRIBUTE]=(t.promptTokens??0)+(t.completionTokens??0)+(t.cacheCreationInputTokens??0)+(t.cacheReadInputTokens??0)),t.finishReasons.length&&(r[o.GEN_AI_RESPONSE_FINISH_REASONS_ATTRIBUTE]=JSON.stringify(t.finishReasons)),n&&t.responseTexts.length&&(r[o.GEN_AI_RESPONSE_TEXT_ATTRIBUTE]=t.responseTexts.join("")),n&&t.toolCalls.length&&(r[o.GEN_AI_RESPONSE_TOOL_CALLS_ATTRIBUTE]=JSON.stringify(t.toolCalls)),e.setAttributes(r),e.end()},t.extractSystemInstructions=function(e){if(!Array.isArray(e))return{systemInstructions:void 0,filteredMessages:e};const t=e.findIndex((e=>e&&"object"==typeof e&&"role"in e&&"system"===e.role));if(-1===t)return{systemInstructions:void 0,filteredMessages:e};const n=e[t],r="string"==typeof n.content?n.content:void 0!==n.content?JSON.stringify(n.content):void 0;return r?{systemInstructions:JSON.stringify([{type:"text",content:r}]),filteredMessages:[...e.slice(0,t),...e.slice(t+1)]}:{systemInstructions:void 0,filteredMessages:e}},t.getJsonString=function(e){return"string"==typeof e?e:JSON.stringify(e)},t.getTruncatedJsonString=function(e){if("string"==typeof e)return l.truncateGenAiStringInput(e);if(Array.isArray(e)){const t=l.truncateGenAiMessages(e);return JSON.stringify(t)}return JSON.stringify(e)},t.resolveAIRecordingOptions=function(e){const t=Boolean(s.getClient()?.getOptions().sendDefaultPii);return{...e,recordInputs:e?.recordInputs??t,recordOutputs:e?.recordOutputs??t}},t.setTokenUsageAttributes=function(e,t,n,r,s){if(void 0!==t&&e.setAttributes({[o.GEN_AI_USAGE_INPUT_TOKENS_ATTRIBUTE]:t}),void 0!==n&&e.setAttributes({[o.GEN_AI_USAGE_OUTPUT_TOKENS_ATTRIBUTE]:n}),void 0!==t||void 0!==n||void 0!==r||void 0!==s){const i=(t??0)+(n??0)+(r??0)+(s??0);e.setAttributes({[o.GEN_AI_USAGE_TOTAL_TOKENS_ATTRIBUTE]:i})}},t.shouldEnableTruncation=function(e){const t=s.getClient();return e??!(t&&i.hasSpanStreamingEnabled(t))},t.wrapPromiseWithMethods=function(e,t,n){return a.isThenable(e)?new Proxy(e,{get(e,s){const i=s in Promise.prototype||s===Symbol.toStringTag?t:e,a=Reflect.get(i,s);return"withResponse"===s&&"function"==typeof a?function(){return async function(e,t,n){const s=e.catch((e=>{throw r.captureException(e,{mechanism:{handled:!1,type:n}}),e})),i=await t,a=await s;return a&&"object"==typeof a&&"data"in a?{...a,data:i}:i}(a.call(e),t,n)}:"function"==typeof a?a.bind(i):a}}):t}},82054(e,t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});t.ANTHROPIC_AI_INTEGRATION_NAME="Anthropic_AI",t.ANTHROPIC_METHOD_REGISTRY={"messages.create":{operation:"chat"},"messages.stream":{operation:"chat",streaming:!0},"messages.countTokens":{operation:"chat"},"models.get":{operation:"models"}
1,"completions.create":{operation:"chat"},"models.retrieve":{operation:"models"},"beta.messages.create":{operation:"chat"}}},7747(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(79183),s=n(52751),i=n(15363),a=n(55908),o=n(24231),l=n(2881),c=n(82054),u=n(10135),d=n(82526);function h(e,t,n){const r=d.messagesFromParams(t);d.setMessagesAttribute(e,r,n),"prompt"in t&&e.setAttributes({[o.GEN_AI_PROMPT_ATTRIBUTE]:JSON.stringify(t.prompt)})}function f(e,t,n){t&&"object"==typeof t&&("type"in t&&"error"===t.type?d.handleResponseError(e,t):(n&&function(e,t){if("content"in t&&Array.isArray(t.content)){e.setAttributes({[o.GEN_AI_RESPONSE_TEXT_ATTRIBUTE]:t.content.map((e=>e.text)).filter((e=>!!e)).join("")});const n=[];for(const e of t.content)"tool_use"!==e.type&&"server_tool_use"!==e.type||n.push(e);n.length>0&&e.setAttributes({[o.GEN_AI_RESPONSE_TOOL_CALLS_ATTRIBUTE]:JSON.stringify(n)})}"completion"in t&&e.setAttributes({[o.GEN_AI_RESPONSE_TEXT_ATTRIBUTE]:t.completion}),"input_tokens"in t&&e.setAttributes({[o.GEN_AI_RESPONSE_TEXT_ATTRIBUTE]:JSON.stringify(t.input_tokens)})}(e,t),function(e,t){"id"in t&&"model"in t&&(e.setAttributes({[o.GEN_AI_RESPONSE_ID_ATTRIBUTE]:t.id,[o.GEN_AI_RESPONSE_MODEL_ATTRIBUTE]:t.model}),"usage"in t&&t.usage&&l.setTokenUsageAttributes(e,t.usage.input_tokens,t.usage.output_tokens,t.usage.cache_creation_input_tokens,t.usage.cache_read_input_tokens))}(e,t)))}function p(e,t,n){throw r.captureException(e,{mechanism:{handled:!1,type:"auto.ai.anthropic",data:{function:n}}}),t.isRecording()&&(t.setStatus({code:i.SPAN_STATUS_ERROR,message:"internal_error"}),t.end()),e}function g(e,t,n,i,c){return new Proxy(e,{apply(d,g,m){const _=n.operation||"unknown",T=function(e,t,n){const r={[o.GEN_AI_SYSTEM_ATTRIBUTE]:"anthropic",[o.GEN_AI_OPERATION_NAME_ATTRIBUTE]:n,[s.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]:"auto.ai.anthropic"};if(e.length>0&&"object"==typeof e[0]&&null!==e[0]){const t=e[0];t.tools&&Array.isArray(t.tools)&&(r[o.GEN_AI_REQUEST_AVAILABLE_TOOLS_ATTRIBUTE]=JSON.stringify(t.tools)),r[o.GEN_AI_REQUEST_MODEL_ATTRIBUTE]=t.model??"unknown","temperature"in t&&(r[o.GEN_AI_REQUEST_TEMPERATURE_ATTRIBUTE]=t.temperature),"top_p"in t&&(r[o.GEN_AI_REQUEST_TOP_P_ATTRIBUTE]=t.top_p),"stream"in t&&(r[o.GEN_AI_REQUEST_STREAM_ATTRIBUTE]=t.stream),"top_k"in t&&(r[o.GEN_AI_REQUEST_TOP_K_ATTRIBUTE]=t.top_k),"frequency_penalty"in t&&(r[o.GEN_AI_REQUEST_FREQUENCY_PENA
1LTY_ATTRIBUTE]=t.frequency_penalty),"max_tokens"in t&&(r[o.GEN_AI_REQUEST_MAX_TOKENS_ATTRIBUTE]=t.max_tokens)}else r[o.GEN_AI_REQUEST_MODEL_ATTRIBUTE]="models.retrieve"===t||"models.get"===t?e[0]:"unknown";return r}(m,t,_),E=T[o.GEN_AI_REQUEST_MODEL_ATTRIBUTE]??"unknown",y="object"==typeof m[0]?m[0]:void 0,S=Boolean(y?.stream),v=!0===n.streaming;if(S||v)return function(e,t,n,r,s,i,c,d,f,g,m){const _={name:`${i} ${s[o.GEN_AI_REQUEST_MODEL_ATTRIBUTE]??"unknown"}`,op:`gen_ai.${i}`,attributes:s};if(g&&!m){let t;const s=a.startSpanManual(_,(s=>(t=e.apply(n,r),f.recordInputs&&d&&h(s,d,l.shouldEnableTruncation(f.enableTruncation)),(async()=>{try{const e=await t;return u.instrumentAsyncIterableStream(e,s,f.recordOutputs??!1)}catch(e){return p(e,s,c)}})())));return l.wrapPromiseWithMethods(t,s,"auto.ai.anthropic")}return a.startSpanManual(_,(e=>{try{f.recordInputs&&d&&h(e,d,l.shouldEnableTruncation(f.enableTruncation));const s=t.apply(n,r);return u.instrumentMessageStream(s,e,f.recordOutputs??!1)}catch(t){return p(t,e,c)}}))}(e,d,i,m,T,_,t,y,c,S,v);let b;const I=a.startSpan({name:`${_} ${E}`,op:`gen_ai.${_}`,attributes:T},(e=>(b=d.apply(i,m),c.recordInputs&&y&&h(e,y,l.shouldEnableTruncation(c.enableTruncation)),b.then((t=>(f(e,t,c.recordOutputs),t)),(e=>{throw r.captureException(e,{mechanism:{handled:!1,type:"auto.ai.anthropic",data:{function:t}}}),e})))));return l.wrapPromiseWithMethods(b,I,"auto.ai.anthropic")}})}function m(e,t="",n){return new Proxy(e,{get(e,r){const s=e[r],i=l.buildMethodPath(t,String(r)),a=c.ANTHROPIC_METHOD_REGISTRY[i];return"function"==typeof s&&a?g(s,i,a,e,n):"function"==typeof s?s.bind(e):s&&"object"==typeof s?m(s,i,n):s}})}t.instrumentAnthropicAiClient=function(e,t){return m(e,"",l.resolveAIRecordingOptions(t))}},10135(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(79183),s=n(15363),i=n(2881),a=n(82526);function o(e,t,n,i){if(!e||"object"!=typeof e)return;const o=function(e,t){return"type"in e&&"string"==typeof e.type&&"error"===e.type&&(t.setStatus({code:s.SPAN_STATUS_ERROR,message:a.mapAnthropicErrorToStatusMessage(e.error?.type)}),r.captureException(e.error,{mechanism:{handled:!1,type:"auto.ai.anthropic.anthropic_error"}}),!0)}(e,i);o||(function(e,t){if("message_delta"===e.type&&e.usage&&"output_tokens"in e.usage&&"number"==typeof e.usage.output_tokens&&(t.completionTokens=e.usage.output_tokens),e.message){const n=e.message;n.id&&(t.responseId=n.id),n.model&&(t.responseModel=n.model),n.stop_reason&&t.finishReasons.push(n.stop_reason),n.usage&&("number"==typeof n.usage.input_tokens&&(t.promptTokens=n.usage.input_tokens),"number"==typeof n.usage.cache_creation_input_tokens&&(t.cacheCreationInputTokens=n.usage.cache_creation_input_tokens),"number"==typeof n.usage.cache_read_input_tokens&&(t.cacheReadInputTokens=n.usage.cache_read_input_tokens))}}(e,t),function(e,t){"content_block_start"===e.type&&"number"==typeof e.index&&e.content_block&&("tool_use"!==e.content_block.type&&"server_tool_use"!==e.content_block.type||(t.activeToolBlocks[e.index]={id:e.content_block.id,name:e.content_block.name,inputJsonParts:[]}))}(e,t),function(e,t,n){if("content_block_delta"===e.type&&e.delta){if("number"==typeof e.index&&"partial_json"in e.delta&&"string"==typeof e.delta.partial_json){const n=t.activeToolBlocks[e.index];n&&n.inputJsonParts.push(e.delta.partial_json)}n&&"string"==typeof e.delta.text&&t.responseTexts.push(e.delta.text)}}(e,t,n),function(e,t){if("content_block_stop"!==e.type||"number"!=typeof e.index)return;const n=t.activeToolBlocks[e.index];if(!n)return;const r=n.inputJsonParts.join("");let s;try{s=r?JSON.parse(r):{}}catch{s={__unparsed:r}}t.toolCalls.push({type:"tool_use",id:n.id,name:n.name,input:s}),delete t.activeToolBlocks[e.index]}(e,t))}t.instrumentAsyncIterableStream=async function*(e,t,n){const r={responseTexts:[],finishReasons:[],responseId:"",responseModel:"",promptTokens:void 0,completionTokens:void 0,cacheCreationInputTokens:void 0,cacheReadInputTokens:void 0,toolCalls:[],activeToolBlocks:{}};try{for await(const s of e)o(s,r,n,t),yield s}finally{i.endStreamSpan(t,r,n)}},t.instrumentMessageStream=function(e,t,n){const a={responseTexts:[],finishReasons:[],responseId:"",responseModel:"",promptTokens:void 0,completionTokens:void 0,cacheCreationInputTokens:void 0,cacheReadInputTokens:void 0,toolCalls:[],activeToolBlocks:{}};return e.on("streamEvent",(e=>{o(e,a,n,t)})),e.on("message",(()=>{i.endStreamSpan(t,a,n)})),e.on("error",(e=>{r.captureException(e,{mechanism:{handled:!1,type:"auto.ai.anthropic.stream_error"}}),t.isRecording()&&(t.setStatus({code:s.SPAN_STATUS_ERROR,message:"internal_error"}),t.end())})),e}},82526(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(79183),s=n(15363),i=n(24231),a=n(2881);const o={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 l(e){return e&&o[e]||"internal_error"}t.handleResponseError=function(e,t){t.error&&(e.setStatus({code:s.SPAN_STATUS_ERROR,message:l(t.error.type)}),r.captureException(t.error,{mechanism:{handled:!1,type:"auto.ai.anthropic.anthropic_error"}}))},t.mapAnthropicErrorToStatusMessage=l,t.messagesFromParams=function(e){const{system:t,messages:n,input:r}=e,s="string"==typeof t?[{role:"system",content:e.system}]:[],i=Array.isArray(r)?r:null!=r?[r]:void 0,a=Array.isArray(n)?n:null!=n?[n]:[];return[...s,...i??a]},t.setMessagesAttribute=function(e,t,n){if(Array.isArray(t)&&0===t.length)return;const{systemInstructions:r,filteredMessages:s}=a.extractSystemInstructions(t);r&&e.setAttributes({[i.GEN_AI_SYSTEM_INSTRUCTIONS_ATTRIBUTE]:r});const o=Array.isArray(s)?s.length:1;
1e.setAttributes({[i.GEN_AI_INPUT_MESSAGES_ATTRIBUTE]:n?a.getTruncatedJsonString(s):a.getJsonString(s),[i.GEN_AI_INPUT_MESSAGES_ORIGINAL_LENGTH_ATTRIBUTE]:o})}},93754(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(42501),s=n(49564),i=n(52751),a=n(5684),o=n(21811),l=n(51228),c=n(96159),u=n(54583),d=n(64284),h="_frozenDsc";function f(e,t){const n=t.getOptions(),{publicKey:s}=t.getDsn()||{},i={environment:n.environment||r.DEFAULT_ENVIRONMENT,release:n.release,public_key:s,trace_id:e,org_id:o.extractOrgIdFromClient(t)};return t.emit("createDsc",i),i}function p(e){const t=s.getClient();if(!t)return{};const n=u.getRootSpan(e),r=u.spanToJSON(n),o=r.data,c=n.spanContext().traceState,p=c?.get("sentry.sample_rate")??o[i.SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE]??o[i.SEMANTIC_ATTRIBUTE_SENTRY_PREVIOUS_TRACE_SAMPLE_RATE];function g(e){return"number"!=typeof p&&"string"!=typeof p||(e.sample_rate=`${p}`),e}const m=n[h];if(m)return g(m);const _=c?.get("sentry.dsc"),T=_&&a.baggageHeaderToDynamicSamplingContext(_);if(T)return g(T);const E=f(e.spanContext().traceId,t),y=o[i.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]??o["sentry.span.source"],S=r.description;return"url"!==y&&S&&(E.transaction=S),l.hasSpansEnabled()&&(E.sampled=String(u.spanIsSampled(n)),E.sample_rand=c?.get("sentry.sample_rand")??d.getCapturedScopesOnSpan(n).scope?.getPropagationContext().sampleRand.toString()),g(E),t.emit("createDsc",E,n),E}t.freezeDscOnSpan=function(e,t){const n=e;c.addNonEnumerableProperty(n,h,t)},t.getDynamicSamplingContextFromClient=f,t.getDynamicSamplingContextFromScope=function(e,t){const n=t.getPropagationContext();return n.dsc||f(n.traceId,e)},t.getDynamicSamplingContextFromSpan=p,t.spanToBaggageHeader=function(e){const t=p(e);return a.dynamicSamplingContextToSentryBaggageHeader(t)}},44038(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(68974),s=n(49759),i=n(53551),a=n(85110),o=n(54583),l=n(15363);let c=!1;t.registerSpanErrorInstrumentation=function(){function e(){const e=o.getActiveSpan(),t=e&&o.getRootSpan(e);if(t){const e="internal_error";r.DEBUG_BUILD&&a.debug.log(`[Tracing] Root span: ${e} -> Global error occurred`),t.setStatus({code:l.SPAN_STATUS_ERROR,message:e})}}c||(e.tag="sentry_tracingErrorCallback",c=!0,s.addGlobalErrorInstrumentationHandler(e),i.addGlobalUnhandledRejectionInstrumentationHandler(e))}},60393(e,t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});t.GOOGLE_GENAI_INTEGRATION_NAME="Google_GenAI",t.GOOGLE_GENAI_METHOD_REGISTRY={"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}},t.GOOGLE_GENAI_SYSTEM_NAME="google_genai"},13860(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(79183),s=n(52751),i=n(15363),a=n(55908),o=n(76354),l=n(24231),c=n(2881),u=n(60393),d=n(77844),h=n(56141);function f(e,t){if("model"in e&&"string"==typeof e.model)return e.model;if(t&&"object"==typeof t){const e=t;if("model"in e&&"string"==typeof e.model)return e.model;if("modelVersion"in e&&"string"==typeof e.modelVersion)return e.modelVersion}return"unknown"}function p(e,t,n){const r={[l.GEN_AI_SYSTEM_ATTRIBUTE]:u.GOOGLE_GENAI_SYSTEM_NAME,[l.GEN_AI_OPERATION_NAME_ATTRIBUTE]:e,[s.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]:"auto.ai.google_genai"};if(t){if(r[l.GEN_AI_REQUEST_MODEL_ATTRIBUTE]=f(t,n),"config"in t&&"object"==typeof t.config&&t.config){const e=t.config;if(Object.assign(r,function(e){const t={};return"temperature"in e&&"number"==typeof e.temperature&&(t[l.GEN_AI_REQUEST_TEMPERATURE_ATTRIBUTE]=e.temperature),"topP"in e&&"number"==typeof e.topP&&(t[l.GEN_AI_REQUEST_TOP_P_ATTRIBUTE]=e.topP),"topK"in e&&"number"==typeof e.topK&&(t[l.GEN_AI_REQUEST_TOP_K_ATTRIBUTE]=e.topK),"maxOutputTokens"in e&&"number"==typeof e.maxOutputTokens&&(t[l.GEN_AI_REQUEST_MAX_TOKENS_ATTRIBUTE]=e.maxOutputTokens),"frequencyPenalty"in e&&"number"==typeof e.frequencyPenalty&&(t[l.GEN_AI_REQUEST_FREQUENCY_PENA
1LTY_ATTRIBUTE]=e.frequencyPenalty),"presencePenalty"in e&&"number"==typeof e.presencePenalty&&(t[l.GEN_AI_REQUEST_PRESENCE_PENALTY_ATTRIBUTE]=e.presencePenalty),t}(e)),"tools"in e&&Array.isArray(e.tools)){const t=e.tools.flatMap((e=>e.functionDeclarations));r[l.GEN_AI_REQUEST_AVAILABLE_TOOLS_ATTRIBUTE]=JSON.stringify(t)}}}else r[l.GEN_AI_REQUEST_MODEL_ATTRIBUTE]=f({},n);return r}function g(e,t,n,r){if(n){const n=t.contents;return void(null!=n&&e.setAttribute(l.GEN_AI_EMBEDDINGS_INPUT_ATTRIBUTE,"string"==typeof n?n:JSON.stringify(n)))}const s=[];if("config"in t&&t.config&&"object"==typeof t.config&&"systemInstruction"in t.config&&t.config.systemInstruction&&s.push(...h.contentUnionToMessages(t.config.systemInstruction,"system")),"history"in t&&s.push(...h.contentUnionToMessages(t.history,"user")),"contents"in t&&s.push(...h.contentUnionToMessages(t.contents,"user")),"message"in t&&s.push(...h.contentUnionToMessages(t.message,"user")),Array.isArray(s)&&s.length){const{systemInstructions:t,filteredMessages:n}=c.extractSystemInstructions(s);t&&e.setAttribute(l.GEN_AI_SYSTEM_INSTRUCTIONS_ATTRIBUTE,t);const i=Array.isArray(n)?n.length:0;e.setAttributes({[l.GEN_AI_INPUT_MESSAGES_ORIGINAL_LENGTH_ATTRIBUTE]:i,[l.GEN_AI_INPUT_MESSAGES_ATTRIBUTE]:r?c.getTruncatedJsonString(n):c.getJsonString(n)})}}function m(e,t,n,s,u){const h="embeddings"===n.operation;return new Proxy(e,{apply(e,f,m){const _=n.operation||"unknown",T=m[0],E=p(_,T,s),y=E[l.GEN_AI_REQUEST_MODEL_ATTRIBUTE]??"unknown";return n.streaming?a.startSpanManual({name:`${_} ${y}`,op:`gen_ai.${_}`,attributes:E},(async n=>{try{u.recordInputs&&T&&g(n,T,h,c.shouldEnableTruncation(u.enableTruncation));const t=await e.apply(s,m);return d.instrumentStream(t,n,Boolean(u.recordOutputs))}catch(e){throw n.setStatus({code:i.SPAN_STATUS_ERROR,message:"internal_error"}),r.captureException(e,{mechanism:{handled:!1,type:"auto.ai.google_genai",data:{function:t}}}),n.end(),e}})):a.startSpan({name:`${_} ${y}`,op:`gen_ai.${_}`,attributes:E},(n=>(u.recordInputs&&T&&g(n,T,h,c.shouldEnableTruncation(u.enableTruncation)),o.handleCallbackErrors((()=>e.apply(s,m)),(e=>{r.captureException(e,{mechanism:{handled:!1,type:"auto.ai.google_genai",data:{function:t}}})}),(()=>{}),(e=>{h||function(e,t,n){if(t&&"object"==typeof t){if(t.modelVersion&&e.setAttribute(l.GEN_AI_RESPONSE_MODEL_ATTRIBUTE,t.modelVersion),t.usageMetadata&&"object"==typeof t.usageMetadata){const n=t.usageMetadata;"number"==typeof n.promptTokenCount&&e.setAttributes({[l.GEN_AI_USAGE_INPUT_TOKENS_ATTRIBUTE]:n.promptTokenCount}),"number"==typeof n.candidatesTokenCount&&e.setAttributes({[l.GEN_AI_USAGE_OUTPUT_TOKENS_ATTRIBUTE]:n.candidatesTokenCount}),"number"==typeof n.totalTokenCount&&e.setAttributes({[l.GEN_AI_USAGE_TOTAL_TOKENS_ATTRIBUTE]:n.totalTokenCount})}if(n&&Array.isArray(t.candidates)&&t.candidates.length>0){const n=t.candidates.map((e=>e.content?.parts&&Array.isArray(e.content.parts)?e.content.parts.map((e=>"string"==typeof e.text?e.text:"")).filter((e=>e.length>0)).join(""):"")).filter((e=>e.length>0));n.length>0&&e.setAttributes({[l.GEN_AI_RESPONSE_TEXT_ATTRIBUTE]:n.join("")})}if(n&&t.functionCalls){const n=t.functionCalls;Array.isArray(n)&&n.length>0&&e.setAttributes({[l.GEN_AI_RESPONSE_TOOL_CALLS_ATTRIBUTE]:JSON.stringify(n)})}}}(n,e,u.recordOutputs)})))))}})}function _(e,t="",n){return new Proxy(e,{get:(e,r,s)=>{const i=Reflect.get(e,r,s),a=c.buildMethodPath(t,String(r)),o=u.GOOGLE_GENAI_METHOD_REGISTRY[a];if("function"==typeof i&&o){const t=o.operation?m(i,a,o,e,n):i.bind(e);return o.proxyResultPath?function(...e){const r=t(...e);return r&&"object"==typeof r?_(r,o.proxyResultPath,n):r}:t}return"function"==typeof i?i.bind(e):i&&"object"==typeof i?_(i,a,n):i}})}t.extractModel=f,t.instrumentGoogleGenAIClient=function(e,t){return _(e,"",c.resolveAIRecordingOptions(t))}},77844(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(79183),s=n(15363),i=n(2881);function a(e,t,n,i){e&&!function(e,t){const n=e?.promptFeedback;if(n?.blockReason){const e=n.blockReasonMessage??n.blockReason;return t.setStatus({code:s.SPAN_STATUS_ERROR,message:"internal_error"}),r.captureException(`Content blocked: ${e}`,{mechanism:{handled:!1,type:"auto.ai.google_genai"}}),!0}return!1}(e,i)&&(function(e,t){"string"==typeof e.responseId&&(t.responseId=e.responseId),"string"==typeof e.modelVersion&&(t.responseModel=e.modelVersion);const n=e.usageMetadata;n&&("number"==typeof n.promptTokenCount&&(t.promptTokens=n.promptTokenCount),"number"==typeof n.candidatesTokenCount&&(t.completionTokens=n.candidatesTokenCount),"number"==typeof n.totalTokenCount&&(t.totalTokens=n.totalTokenCount))}(e,t),function(e,t,n){Array.isArray(e.functionCalls)&&t.toolCalls.push(...e.functionCalls);for(const r of e.candidates??[]){r?.finishReason&&!t.finishReasons.includes(r.finishReason)&&t.finishReasons.push(r.finishReason);for(const e of r?.content?.parts??[])n&&e.text&&t.responseTexts.push(e.text),e.functionCall&&t.toolCalls.push({type:"function",id:e.functionCall.id,name:e.functionCall.name,arguments:e.functionCall.args})}}
1(e,t,n))}t.instrumentStream=async function*(e,t,n){const r={responseTexts:[],finishReasons:[],toolCalls:[]};try{for await(const s of e)a(s,r,n,t),yield s}finally{i.endStreamSpan(t,r,n)}}},56141(e,t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),t.contentUnionToMessages=function e(t,n="user"){return"string"==typeof t?[{role:n,content:t}]:Array.isArray(t)?t.flatMap((t=>e(t,n))):"object"==typeof t&&t?"role"in t&&"string"==typeof t.role?[t]:"parts"in t?[{...t,role:n}]:[{role:n,content:t}]:[]}},57011(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(49564),s=n(68974),i=n(52751),a=n(85110),o=n(51228),l=n(87687),c=n(64865),u=n(54583),d=n(26869),h=n(93754),f=n(67392),p=n(30242),g=n(15363),m=n(55908),_={idleTimeout:1e3,finalTimeout:3e4,childSpanTimeout:15e3};t.TRACING_DEFAULTS=_,t.startIdleSpan=function(e,t={}){const n=new Map;let T,E=!1,y="externalFinish",S=!t.disableAutoFinish;const v=[],{idleTimeout:b=_.idleTimeout,finalTimeout:I=_.finalTimeout,childSpanTimeout:A=_.childSpanTimeout,beforeSpanEnd:R,trimIdleSpanEndTimestamp:C=!0}=t,k=r.getClient();if(!k||!o.hasSpansEnabled()){const e=new f.SentryNonRecordingSpan,t={sample_rate:"0",sampled:"false",...h.getDynamicSamplingContextFromSpan(e)};return h.freezeDscOnSpan(e,t),e}const L=r.getCurrentScope(),O=u.getActiveSpan(),N=function(e){const t=m.startInactiveSpan(e);return c._setSpanForScope(r.getCurrentScope(),t),s.DEBUG_BUILD&&a.debug.log("[Tracing] Started span is an idle span"),t}(e);function w(){T&&(clearTimeout(T),T=void 0)}function P(e){w(),T=setTimeout((()=>{!E&&0===n.size&&S&&(y="idleTimeout",N.end(e))}),b)}function M(e){T=setTimeout((()=>{!E&&S&&(y="heartbeatFailed",N.end(e))}),A)}function D(e){E=!0,n.clear(),v.forEach((e=>e())),c._setSpanForScope(L,O);const t=u.spanToJSON(N),{start_timestamp:r}=t;if(!r)return;t.data[i.SEMANTIC_ATTRIBUTE_SENTRY_IDLE_SPAN_FINISH_REASON]||N.setAttribute(i.SEMANTIC_ATTRIBUTE_SENTRY_IDLE_SPAN_FINISH_REASON,y);const o=t.status;o&&"unknown"!==o||N.setStatus({code:g.SPAN_STATUS_OK}),a.debug.log(`[Tracing] Idle span "${t.op}" finished`);const l=u.getSpanDescendants(N).filter((e=>e!==N));let d=0;l.forEach((t=>{t.isRecording()&&(t.setStatus({code:g.SPAN_STATUS_ERROR,message:"cancelled"}),t.end(e),s.DEBUG_BUILD&&a.debug.log("[Tracing] Cancelling span since span ended early",JSON.stringify(t,void 0,2)));const n=u.spanToJSON(t),{timestamp:r=0,start_timestamp:i=0}=n,o=i<=e,l=r-i<=(I+b)/1e3;if(s.DEBUG_BUILD){const e=JSON.stringify(t,void 0,2);o?l||a.debug.log("[Tracing] Discarding span since it finished after idle span final timeout",e):a.debug.log("[Tracing] Discarding span since it happened after idle span was finished",e)}l&&o||(u.removeChildSpanFromSpan(N,t),d++)})),d>0&&N.setAttribute("sentry.idle_span_discarded_spans",d)}return N.end=new Proxy(N.end,{apply(e,t,n){if(R&&R(N),t instanceof f.SentryNonRecordingSpan)return;const[r,...s]=n,i=r||d.timestampInSeconds(),a=u.spanTimeInputToSeconds(i),o=u.getSpanDescendants(N).filter((e=>e!==N)),c=u.spanToJSON(N);if(!o.length||!C)return D(a),Reflect.apply(e,t,[a,...s]);const h=k.getOptions().ignoreSpans,p=o?.reduce(((e,t)=>{const n=u.spanToJSON(t);return n.timestamp?h&&l.shouldIgnoreSpan({description:n.description,op:n.op,attributes:n.data},h)?e:e?Math.max(e,n.timestamp):n.timestamp:e}),void 0),g=c.start_timestamp,m=Math.min(g?g+I/1e3:1/0,Math.max(g||-1/0,Math.min(a,p||1/0)));return D(m),Reflect.apply(e,t,[m,...s])}}),v.push(k.on("spanStart",(e=>{if(E||e===N||u.spanToJSON(e).timestamp||e instanceof p.SentrySpan&&e.isStandaloneSpan())return;var t;u.getSpanDescendants(N).includes(e)&&(t=e.spanContext().spanId,w(),n.set(t,!0),M(d.timestampInSeconds()+A/1e3))}))),v.push(k.on("spanEnd",(e=>{var t;E||(t=e.spanContext().spanId,n.has(t)&&n.delete(t),0===n.size&&P(d.timestampInSeconds()+b/1e3))}))),v.push(k.on("idleSpanEnableAutoFinish",(e=>{e===N&&(S=!0,P(),n.size&&M())}))),t.disableAutoFinish||P(),setTimeout((()=>{E||(N.setStatus({code:g.SPAN_STATUS_ERROR,message:"deadline_exceeded"}),y="finalTimeout",N.end())}),I),N}},1170(e,t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});t.LANGCHAIN_INTEGRATION_NAME="LangChain",t.LANGCHAIN_ORIGIN="auto.ai.langchain",t.ROLE_MAP={human:"user",ai:"assistant",assistant:"assistant",system:"system",function:"function",tool:"tool"}},48937(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(79183),s=n(52751),i=n(55908),a=n(24231),o=n(2881),l=n(1170);function c(e,t={}){const{recordInputs:n}=o.resolveAIRecordingOptions(t);return new Proxy(e,{apply(e,t,o){const c=function(e){const t=e??{},n={[s.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]:l.LANGCHAIN_ORIGIN,[s.SEMANTIC_ATTRIBUTE_SENTRY_OP]:a.GEN_AI_EMBEDDINGS_OPERATION_ATTRIBUTE,[a.GEN_AI_OPERATION_NAME_ATTRIBUTE]:"embeddings",[a.GEN_AI_REQUEST_MODEL_ATTRIBUTE]:t.model??"unknown"};return n[a.GEN_AI_SYSTEM_ATTRIBUTE]=function(e){const t=e.constructor?.name??"";return t.includes("OpenAI")?"openai":t.includes("Google")?"google_genai":t.includes("Mistral")?"mistralai":t.includes("Vertex")?"google_vertexai":t.includes("Bedrock")?"aws_bedrock":t.includes("Ollama")?"ollama":t.includes("Cloudflare")?"cloudflare":t.includes("Cohere")?"cohere":"langchain"}(t),"dimensions"in t&&(n[a.GEN_AI_REQUEST_DIMENSIONS_ATTRIBUTE]=t.dimensions),"encodingFormat"in t&&(n[a.GEN_AI_REQUEST_ENCODING_FORMAT_ATTRIBUTE]=t.encodingFormat),n}(t),u=c[a.GEN_AI_REQUEST_MODEL_ATTRIBUTE]||"unknown";if(n){const e=o[0];null!=e&&(c[a.GEN_AI_EMBEDDINGS_INPUT_ATTRIBUTE]="string"==typeof e?e:JSON.stringify(e))}return i.startSpan({name:`embeddings ${u}`,op:a.GEN_AI_EMBEDDINGS_OPERATION_ATTRIBUTE,attributes:c},(()=>Reflect.apply(e,t,o).then(void 0,(e=>{throw r.captureException(e,{mechanism:{handled:!1,type:"auto.ai.langchain"}}),e}))))}})}t.instrumentEmbeddingMethod=c,t.instrumentLangChainEmbeddings=function(e,t){const n=e;return"function"==typeof n.embedQuery&&(n.embedQuery=c(n.embedQuery,t)),"function"==typeof n.embedDocuments&&(n.embedDocuments=c(n.embedDocuments,t)),e}},37135(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(79183),s=n(52751),i=n(15363),a=n(55908),o=n(24231),l=n(2881),c=n(1170),u=n(65226);t.createLangChainCallbackHandler=function(e={}){const{recordInputs:t,recordOutputs:n}=l.resolveAIRecordingOptions(e),d=l.shouldEnableTruncation(e.enableTruncation),h=new Map,f=e=>{const t=h.get(e);t?.isRecording()&&(t.end(),h.delete(e))}
1,p={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(e,n,r,i,l,c,f,p){const g=u.getInvocationParams(c),m=u.extractLLMRequestAttributes(e,n,t,d,g,f),_=m[o.GEN_AI_REQUEST_MODEL_ATTRIBUTE],T=m[o.GEN_AI_OPERATION_NAME_ATTRIBUTE];a.startSpanManual({name:`${T} ${_}`,op:"gen_ai.chat",attributes:{...u.getAgentNameFromMetadata(f),...m,[s.SEMANTIC_ATTRIBUTE_SENTRY_OP]:"gen_ai.chat"}},(e=>(h.set(r,e),e)))},handleChatModelStart(e,n,r,i,l,c,f,p){const g=u.getInvocationParams(c),m=u.extractChatModelRequestAttributes(e,n,t,d,g,f),_=u.extractToolDefinitions(l);_&&(m[o.GEN_AI_REQUEST_AVAILABLE_TOOLS_ATTRIBUTE]=_);const T=m[o.GEN_AI_REQUEST_MODEL_ATTRIBUTE],E=m[o.GEN_AI_OPERATION_NAME_ATTRIBUTE];a.startSpanManual({name:`${E} ${T}`,op:"gen_ai.chat",attributes:{...u.getAgentNameFromMetadata(f),...m,[s.SEMANTIC_ATTRIBUTE_SENTRY_OP]:"gen_ai.chat"}},(e=>(h.set(r,e),e)))},handleLLMEnd(e,t,r,s,i){const a=h.get(t);if(a?.isRecording()){const r=u.extractLlmResponseAttributes(e,n);r&&a.setAttributes(r),f(t)}},handleLLMError(e,t){const n=h.get(t);n?.isRecording()&&(n.setStatus({code:i.SPAN_STATUS_ERROR,message:"internal_error"}),f(t)),r.captureException(e,{mechanism:{handled:!1,type:`${c.LANGCHAIN_ORIGIN}.llm_error_handler`}})},handleChainStart(e,n,r,i,o,l,c,u){if(l?.__sentry_langgraph__)return;const d=u||e.name||"unknown_chain",f={[s.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]:"auto.ai.langchain","langchain.chain.name":d};t&&(f["langchain.chain.inputs"]=JSON.stringify(n)),a.startSpanManual({name:`chain ${d}`,op:"gen_ai.invoke_agent",attributes:{...f,[s.SEMANTIC_ATTRIBUTE_SENTRY_OP]:"gen_ai.invoke_agent"}},(e=>(h.set(r,e),e)))},handleChainEnd(e,t){const r=h.get(t);r?.isRecording()&&(n&&r.setAttributes({"langchain.chain.outputs":JSON.stringify(e)}),f(t))},handleChainError(e,t){const n=h.get(t);n?.isRecording()&&(n.setStatus({code:i.SPAN_STATUS_ERROR,message:"internal_error"}),f(t)),r.captureException(e,{mechanism:{handled:!1,type:`${c.LANGCHAIN_ORIGIN}.chain_error_handler`}})},handleToolStart(e,n,r,i,l,d,f){if(d?.__sentry_langgraph__)return;const p=f||e.name||"unknown_tool",g={...u.getAgentNameFromMetadata(d),[s.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]:c.LANGCHAIN_ORIGIN,[o.GEN_AI_OPERATION_NAME_ATTRIBUTE]:"execute_tool",[o.GEN_AI_TOOL_NAME_ATTRIBUTE]:p};t&&(g[o.GEN_AI_TOOL_INPUT_ATTRIBUTE]=n),a.startSpanManual({name:`execute_tool ${p}`,op:"gen_ai.execute_tool",attributes:{...g,[s.SEMANTIC_ATTRIBUTE_SENTRY_OP]:"gen_ai.execute_tool"}},(e=>(h.set(r,e),e)))},handleToolEnd(e,t){const r=h.get(t);if(r?.isRecording()){if(n){const t=e&&"object"==typeof e&&"content"in e?e.content:e;r.setAttributes({[o.GEN_AI_TOOL_OUTPUT_ATTRIBUTE]:"string"==typeof t?t:JSON.stringify(t)})}f(t)}},handleToolError(e,t){const n=h.get(t);n?.isRecording()&&(n.setStatus({code:i.SPAN_STATUS_ERROR,message:"internal_error"}),f(t)),r.captureException(e,{mechanism:{handled:!1,type:`${c.LANGCHAIN_ORIGIN}.tool_error_handler`}})},copy:()=>p,toJSON:()=>({lc:1,type:"not_implemented",id:p.lc_id}),toJSONNotImplemented:()=>({lc:1,type:"not_implemented",id:p.lc_id})};return p}},65226(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(52751),s=n(24231),i=n(53620),a=n(2881),o=n(1170),l=(e,t,n)=>{null!=n&&(e[t]=n)},c=(e,t,n)=>{const r=Number(n);Number.isNaN(r)||(e[t]=r)};function u(e){if("string"==typeof e)return e;try{return JSON.stringify(e)}catch{return String(e)}}function d(e){if(Array.isArray(e))try{const t=e.map((e=>e&&"object"==typeof e&&i.isContentMedia(e)?i.stripInlineMediaFromSingleMessage(e):e));return JSON.stringify(t)}catch{return String(e)}return u(e)}function h(e){const t=e.toLowerCase();return o.ROLE_MAP[t]??t}function f(e){return e.includes("System")?"system":e.includes("Human")?"user":e.includes("AI")||e.includes("Assistant")?"assistant":e.includes("Function")?"function":e.includes("Tool")?"tool":"user"}function p(e){return e.map((e=>{const t=e._getType;if("function"==typeof t){return{role:h(t.call(e)),content:d(e.content)}}if(1===e.lc&&e.kwargs){const t=e.id,n=Array.isArray(t)&&t.length>0?t[t.length-1]:"";return{role:h("string"==typeof n?f(n):"user"),content:d(e.kwargs?.content)}}if(e.type){return{role:h(String(e.type).toLowerCase()),content:d(e.content)}}if(e.role)return{role:h(String(e.role)),content:d(e.content)};const n=e.constructor?.name;return n&&"Object"!==n?{role:h(f(n)),content:d(e.content)}:{role:"user",content:d(e.content)}}))}function g(e,t,n){const r={},i="kwargs"in e?e.kwargs:void 0,a=t?.temperature??n?.ls_temperature??i?.temperature;c(r,s.GEN_AI_REQUEST_TEMPERATURE_ATTRIBUTE,a);const o=t?.max_tokens??n?.ls_max_tokens??i?.max_tokens;c(r,s.GEN_AI_REQUEST_MAX_TOKENS_ATTRIBUTE,o);const u=t?.top_p??i?.top_p;c(r,s.GEN_AI_REQUEST_TOP_P_ATTRIBUTE,u);const d=t?.frequency_penalty;
1c(r,s.GEN_AI_REQUEST_FREQUENCY_PENALTY_ATTRIBUTE,d);const h=t?.presence_penalty;return c(r,s.GEN_AI_REQUEST_PRESENCE_PENALTY_ATTRIBUTE,h),t&&"stream"in t&&l(r,s.GEN_AI_REQUEST_STREAM_ATTRIBUTE,Boolean(t.stream)),r}function m(e,t,n,i,a){return{[s.GEN_AI_SYSTEM_ATTRIBUTE]:u(e??"langchain"),[s.GEN_AI_OPERATION_NAME_ATTRIBUTE]:"chat",[s.GEN_AI_REQUEST_MODEL_ATTRIBUTE]:u(t),[r.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]:o.LANGCHAIN_ORIGIN,...g(n,i,a)}}t.extractChatModelRequestAttributes=function(e,t,n,r,i,o){const c=m(o?.ls_provider??e.id?.[2],i?.model??o?.ls_model_name??"unknown",e,i,o);if(n&&Array.isArray(t)&&t.length>0){const e=p(t.flat()),{systemInstructions:n,filteredMessages:i}=a.extractSystemInstructions(e);n&&l(c,s.GEN_AI_SYSTEM_INSTRUCTIONS_ATTRIBUTE,n);const o=Array.isArray(i)?i.length:0;l(c,s.GEN_AI_INPUT_MESSAGES_ORIGINAL_LENGTH_ATTRIBUTE,o),l(c,s.GEN_AI_INPUT_MESSAGES_ATTRIBUTE,r?a.getTruncatedJsonString(i):a.getJsonString(i))}return c},t.extractLLMRequestAttributes=function(e,t,n,r,i,o){const c=o?.ls_provider,u=m(c,i?.model??o?.ls_model_name??"unknown",e,i,o);if(n&&Array.isArray(t)&&t.length>0){l(u,s.GEN_AI_INPUT_MESSAGES_ORIGINAL_LENGTH_ATTRIBUTE,t.length);const e=t.map((e=>({role:"user",content:e})));l(u,s.GEN_AI_INPUT_MESSAGES_ATTRIBUTE,r?a.getTruncatedJsonString(e):a.getJsonString(e))}return u},t.extractLlmResponseAttributes=function(e,t){if(!e)return;const n={};if(Array.isArray(e.generations)){const r=e.generations.flat().map((e=>e.generationInfo?.finish_reason?e.generationInfo.finish_reason:e.generation_info?.finish_reason?e.generation_info.finish_reason:null)).filter((e=>"string"==typeof e));if(r.length>0&&l(n,s.GEN_AI_RESPONSE_FINISH_REASONS_ATTRIBUTE,u(r)),function(e,t){const n=[],r=e.flat();for(const e of r){const t=e.message,r=t?.tool_calls;if(Array.isArray(r)&&r.length>0)n.push(...r);else{const t=e.message?.content;if(Array.isArray(t))for(const e of t){const t=e;"tool_use"===t.type&&n.push(t)}}}n.length>0&&l(t,s.GEN_AI_RESPONSE_TOOL_CALLS_ATTRIBUTE,u(n))}(e.generations,n),t){const t=e.generations.flat().map((e=>e.text??e.message?.content)).filter((e=>"string"==typeof e));t.length>0&&l(n,s.GEN_AI_RESPONSE_TEXT_ATTRIBUTE,u(t))}}!function(e,t){if(!e)return;const n=e.tokenUsage,r=e.usage;if(n)c(t,s.GEN_AI_USAGE_INPUT_TOKENS_ATTRIBUTE,n.promptTokens),c(t,s.GEN_AI_USAGE_OUTPUT_TOKENS_ATTRIBUTE,n.completionTokens),c(t,s.GEN_AI_USAGE_TOTAL_TOKENS_ATTRIBUTE,n.totalTokens);else if(r){c(t,s.GEN_AI_USAGE_INPUT_TOKENS_ATTRIBUTE,r.input_tokens),c(t,s.GEN_AI_USAGE_OUTPUT_TOKENS_ATTRIBUTE,r.output_tokens);const e=Number(r.input_tokens),n=Number(r.output_tokens),i=(Number.isNaN(e)?0:e)+(Number.isNaN(n)?0:n);i>0&&c(t,s.GEN_AI_USAGE_TOTAL_TOKENS_ATTRIBUTE,i),void 0!==r.cache_creation_input_tokens&&c(t,s.GEN_AI_USAGE_CACHE_CREATION_INPUT_TOKENS_ATTRIBUTE,r.cache_creation_input_tokens),void 0!==r.cache_read_input_tokens&&c(t,s.GEN_AI_USAGE_CACHE_READ_INPUT_TOKENS_ATTRIBUTE,r.cache_read_input_tokens)}}(e.llmOutput,n);const r=e.llmOutput,i=e.generations?.[0]?.[0],a=i?.message,o=r?.model_name??r?.model??a?.response_metadata?.model_name;o&&l(n,s.GEN_AI_RESPONSE_MODEL_ATTRIBUTE,o);const d=r?.id??a?.id;d&&l(n,s.GEN_AI_RESPONSE_ID_ATTRIBUTE,d);const h=r?.stop_reason??a?.response_metadata?.finish_reason;return h&&l(n,s.GEN_AI_RESPONSE_STOP_REASON_ATTRIBUTE,u(h)),n},t.extractToolDefinitions=function(e){const t=(e?.invocation_params)?.tools??(e?.options)?.tools;if(!Array.isArray(t)||0===t.length)return;const n=t.map((e=>{const t=e.function;return{type:"function",name:e.name??t?.name??"",description:e.description??t?.description}}));return JSON.stringify(n)},t.getAgentNameFromMetadata=function(e){const t={},n=e?.lc_agent_name;return"string"==typeof n&&(t[s.GEN_AI_AGENT_NAME_ATTRIBUTE]=n),t},t.getInvocationParams=function(e){if(e&&!Array.isArray(e))return e.invocation_params},t.normalizeLangChainMessages=p},92579(e,t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});t.LANGGRAPH_INTEGRATION_NAME="LangGraph",t.LANGGRAPH_ORIGIN="auto.ai.langgraph"},50162(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(79183),s=n(52751),i=n(15363),a=n(55908),o=n(24231),l=n(2881),c=n(37135),u=n(65226),d=n(92579),h=n(43795);let f=!1;const p="__sentry_patched__";function g(e,t){if(Object.prototype.hasOwnProperty.call(e,p))return e;const n=c.createLangChainCallbackHandler(t),l=new Proxy(e,{apply:(e,l,c)=>f?Reflect.apply(e,l,c):a.startSpan({op:"gen_ai.create_agent",name:"create_agent",attributes:{[s.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]:d.LANGGRAPH_ORIGIN,[s.SEMANTIC_ATTRIBUTE_SENTRY_OP]:"gen_ai.create_agent",[o.GEN_AI_OPERATION_NAME_ATTRIBUTE]:"create_agent"}},(s=>{try{const r=Reflect.apply(e,l,c),i=c.length>0?c[0]:{};i?.name&&"string"==typeof i.name&&(s.setAttribute(o.GEN_AI_AGENT_NAME_ATTRIBUTE,i.name),s.updateName(`create_agent ${i.name}`));const a=r.invoke;return a&&"function"==typeof a&&(r.invoke=m(a.bind(r),r,i,t,void 0,n)),r}catch(e){throw s.setStatus({code:i.SPAN_STATUS_ERROR,message:"internal_error"}),r.captureException(e,{mechanism:{handled:!1,type:"auto.ai.langgraph.error"}}),e}}))});return Object.defineProperty(l,p,{value:!0,enumerable:!1}),l}function m(e,t,n,c,f,p){return new Proxy(e,{apply(e,g,m){const _=f?.modelName??f?.model;return a.startSpan({op:"gen_ai.invoke_agent",name:"invoke_agent",attributes:{[s.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]:d.LANGGRAPH_ORIGIN,[s.SEMANTIC_ATTRIBUTE_SENTRY_OP]:o.GEN_AI_INVOKE_AGENT_OPERATION_ATTRIBUTE,[o.GEN_AI_OPERATION_NAME_ATTRIBUTE]:"invoke_agent"}},(async s=>{try{const r=n?.name;r&&"string"==typeof r&&(s.setAttribute(o.GEN_AI_PIPELINE_NAME_ATTRIBUTE,r),s.setAttribute(o.GEN_AI_AGENT_NAME_ATTRIBUTE,r),s.updateName(`invoke_agent ${r}`)),_&&s.setAttribute(o.GEN_AI_REQUEST_MODEL_ATTRIBUTE,_);const i=m.length>1?m[1]:void 0,a=i?.configurable,d=a?.thread_id;if(d&&"string"==typeof d&&s.setAttribute(o.GEN_AI_CONVERSATION_ID_ATTRIBUTE,d),p){const e=m[1]??{};m[1]=e;const t=e.metadata??{};e.metadata={...t,__sentry_langgraph__:!0,..."string"==typeof r?{lc_agent_name:r}:{}},e.callbacks=h.mergeSentryCallback(e.callbacks,p)}const f=h.extractToolsFromCompiledGraph(t);f&&s.setAttribute(o.GEN_AI_REQUEST_AVAILABLE_TOOLS_ATTRIBUTE,JSON.stringify(f));const T=c.recordInputs,E=c.recordOutputs,y=m.length>0?m[0]?.messages??[]:[];if(y&&T){const e=u.normalizeLangChainMessages(y),{systemInstructions:t,filteredMessages:n}=l.extractSystemInstructions(e);t&&s.setAttribute(o.GEN_AI_SYSTEM_INSTRUCTIONS_ATTRIBUTE,t);const r=l.shouldEnableTruncation(c.enableTruncation),i=Array.isArray(n)?n.length:0;s.setAttributes({[o.GEN_AI_INPUT_MESSAGES_ATTRIBUTE]:r?l.getTruncatedJsonString(n):l.getJsonString(n),[o.GEN_AI_INPUT_MESSAGES_ORIGINAL_LENGTH_ATTRIBUTE]:i})}const S=await Reflect.apply(e,g,m);return E&&h.setResponseAttributes(s,y??null,S),S}catch(e){throw s.setStatus({code:i.SPAN_STATUS_ERROR,message:"internal_error"}),r.captureException(e,{mechanism:{handled:!1,type:"auto.ai.langgraph.error"}}),e}}))}})}t.instrumentCreateReactAgent=function(e,t){if(Object.prototype.hasOwnProperty.call(e,p))return e;const n=l.resolveAIRecordingOptions(t),r=c.createLangChainCallbackHandler(n),s=new Proxy(e,{apply(e,t,s){const i=h.extractLLMFromParams(s),a=h.extractAgentNameFromParams(s),o=s[0];let l;o&&Array.isArray(o.tools)&&o.tools.length>0&&h.wrapToolsWithSpans(o.tools,n,a??void 0),f=!0;try{l=Reflect.apply(e,t,s)}finally{f=!1}const c=l.invoke;if(c&&"function"==typeof c){const e={};
1a&&(e.name=a),l.invoke=m(c.bind(l),l,e,n,i,r)}return l}});return Object.defineProperty(s,p,{value:!0,enumerable:!1}),s},t.instrumentLangGraph=function(e,t){return e.compile=g(e.compile,l.resolveAIRecordingOptions(t)),e},t.instrumentStateGraphCompile=g},43795(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(79183),s=n(52751),i=n(15363),a=n(55908),o=n(24231),l=n(65226),c=n(92579);function u(e){if(!e||0===e.length)return null;const t=[];for(const n of e)if(n&&"object"==typeof n){const e=n.tool_calls;e&&Array.isArray(e)&&t.push(...e)}return t.length>0?t:null}function d(e){const t=e;let n=0,r=0,s=0;if(t.usage_metadata&&"object"==typeof t.usage_metadata){const e=t.usage_metadata;return"number"==typeof e.input_tokens&&(n=e.input_tokens),"number"==typeof e.output_tokens&&(r=e.output_tokens),"number"==typeof e.total_tokens&&(s=e.total_tokens),{inputTokens:n,outputTokens:r,totalTokens:s}}if(t.response_metadata&&"object"==typeof t.response_metadata){const e=t.response_metadata;if(e.tokenUsage&&"object"==typeof e.tokenUsage){const t=e.tokenUsage;"number"==typeof t.promptTokens&&(n=t.promptTokens),"number"==typeof t.completionTokens&&(r=t.completionTokens),"number"==typeof t.totalTokens&&(s=t.totalTokens)}}return{inputTokens:n,outputTokens:r,totalTokens:s}}function h(e,t){const n=t;if(n.response_metadata&&"object"==typeof n.response_metadata){const t=n.response_metadata;t.model_name&&"string"==typeof t.model_name&&e.setAttribute(o.GEN_AI_RESPONSE_MODEL_ATTRIBUTE,t.model_name),t.finish_reason&&"string"==typeof t.finish_reason&&e.setAttribute(o.GEN_AI_RESPONSE_FINISH_REASONS_ATTRIBUTE,[t.finish_reason])}}t.extractAgentNameFromParams=function(e){const t=e[0];return"object"==typeof t&&t&&"name"in t&&"string"==typeof t.name?t.name:null},t.extractLLMFromParams=function(e){const t=e[0];if("object"!=typeof t||!t||!("llm"in t)||!t.llm||"object"!=typeof t.llm)return null;const n=t.llm;return"string"!=typeof n.modelName&&"string"!=typeof n.model?null:n},t.extractModelMetadata=h,t.extractTokenUsageFromMessage=d,t.extractToolCalls=u,t.extractToolsFromCompiledGraph=function(e){if(!e.builder?.nodes?.tools?.runnable?.tools)return null;const t=e.builder?.nodes?.tools?.runnable?.tools;return t&&Array.isArray(t)&&0!==t.length?t.map((e=>({name:e.lc_kwargs?.name,description:e.lc_kwargs?.description,schema:e.lc_kwargs?.schema}))):null},t.mergeSentryCallback=function(e,t){if(!e)return[t];if(Array.isArray(e))return e.includes(t)?e:[...e,t];const n=e;if("function"==typeof n.addHandler){Array.isArray(n.handlers)&&n.handlers.includes(t)||n.addHandler(t)}return e},t.setResponseAttributes=function(e,t,n){const r=n,s=r?.messages;if(!s||!Array.isArray(s))return;const i=t?.length??0,a=s.length>i?s.slice(i):[];if(0===a.length)return;const c=u(a);c&&e.setAttribute(o.GEN_AI_RESPONSE_TOOL_CALLS_ATTRIBUTE,JSON.stringify(c));const f=l.normalizeLangChainMessages(a);e.setAttribute(o.GEN_AI_RESPONSE_TEXT_ATTRIBUTE,JSON.stringify(f));let p=0,g=0,m=0;for(const t of a){const n=d(t);p+=n.inputTokens,g+=n.outputTokens,m+=n.totalTokens,h(e,t)}p>0&&e.setAttribute(o.GEN_AI_USAGE_INPUT_TOKENS_ATTRIBUTE,p),g>0&&e.setAttribute(o.GEN_AI_USAGE_OUTPUT_TOKENS_ATTRIBUTE,g),m>0&&e.setAttribute(o.GEN_AI_USAGE_TOTAL_TOKENS_ATTRIBUTE,m)},t.wrapToolsWithSpans=function(e,t,n){const l="__sentry_tool_wrapped__";for(const u of e){if(!u||"object"!=typeof u)continue;const e=u,d=e.invoke;if("function"!=typeof d||Object.prototype.hasOwnProperty.call(e,l))continue;const h="string"==typeof e.name?e.name:"unknown_tool",f="string"==typeof e.description?e.description:void 0,p=new Proxy(d,{apply(e,l,u){const d={[s.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]:c.LANGGRAPH_ORIGIN,[s.SEMANTIC_ATTRIBUTE_SENTRY_OP]:o.GEN_AI_EXECUTE_TOOL_OPERATION_ATTRIBUTE,[o.GEN_AI_OPERATION_NAME_ATTRIBUTE]:"execute_tool",[o.GEN_AI_TOOL_NAME_ATTRIBUTE]:h,[o.GEN_AI_TOOL_TYPE_ATTRIBUTE]:"function"},p=u[1],g=(p?.metadata)?.lc_agent_name??n;"string"==typeof g&&(d[o.GEN_AI_AGENT_NAME_ATTRIBUTE]=g),f&&(d[o.GEN_AI_TOOL_DESCRIPTION_ATTRIBUTE]=f);const m=u[0];if("object"==typeof m&&m&&("id"in m&&"string"==typeof m.id&&(d[o.GEN_AI_TOOL_CALL_ID_ATTRIBUTE]=m.id),t.recordInputs)){const e="args"in m&&"object"==typeof m.args?m.args:m;try{d[o.GEN_AI_TOOL_INPUT_ATTRIBUTE]=JSON.stringify(e)}catch{}}return a.startSpan({op:o.GEN_AI_EXECUTE_TOOL_OPERATION_ATTRIBUTE,name:`execute_tool ${h}`,attributes:d},(async n=>{try{const r=await Reflect.apply(e,l,u);if(t.recordOutputs)try{const e=r&&"object"==typeof r&&"content"in r?r.content:r;n.setAttribute(o.GEN_AI_TOOL_OUTPUT_ATTRIBUTE,"string"==typeof e?e:JSON.stringify(e))}catch{}return r}catch(e){throw n.setStatus({code:i.SPAN_STATUS_ERROR,message:"internal_error"}),r.captureException(e,{mechanism:{handled:!1,type:"auto.ai.langgraph.error"}}),e}}))}});e.invoke=p,Object.defineProperty(e,l,{value:!0,enumerable:!1})}return e}}
1,8346(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(68974),s=n(85110),i=n(54583);t.logSpanEnd=function(e){if(!r.DEBUG_BUILD)return;const{description:t="< unknown name >",op:n="< unknown op >"}=i.spanToJSON(e),{spanId:a}=e.spanContext(),o=`[Tracing] Finishing "${n}" ${i.getRootSpan(e)===e?"root ":""}span "${t}" with ID ${a}`;s.debug.log(o)},t.logSpanStart=function(e){if(!r.DEBUG_BUILD)return;const{description:t="< unknown name >",op:n="< unknown op >",parent_span_id:a}=i.spanToJSON(e),{spanId:o}=e.spanContext(),l=i.spanIsSampled(e),c=i.getRootSpan(e),u=c===e,d=`[Tracing] Starting ${l?"sampled":"unsampled"} ${u?"root ":""}span`,h=[`op: ${n}`,`name: ${t}`,`ID: ${o}`];if(a&&h.push(`parent ID: ${a}`),!u){const{op:e,description:t}=i.spanToJSON(c);h.push(`root ID: ${c.spanContext().spanId}`),e&&h.push(`root op: ${e}`),t&&h.push(`root description: ${t}`)}s.debug.log(`${d}\n  ${h.join("\n  ")}`)}},28945(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(68974),s=n(52751),i=n(85110),a=n(54583);t.setMeasurement=function(e,t,n,o=a.getActiveSpan()){const l=o&&a.getRootSpan(o);l&&(r.DEBUG_BUILD&&i.debug.log(`[Measurement] Setting measurement on root span: ${e} = ${t} ${n}`),l.addEvent(e,{[s.SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_VALUE]:t,[s.SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_UNIT]:n}))},t.timedEventsToMeasurements=function(e){if(!e||0===e.length)return;const t={};return e.forEach((e=>{const n=e.attributes||{},r=n[s.SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_UNIT],i=n[s.SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_VALUE];"string"==typeof r&&"number"==typeof i&&(t[e.name]={value:i,unit:r})})),t}},47277(e,t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const n=["response.output_item.added","response.function_call_arguments.delta","response.function_call_arguments.done","response.output_item.done"],r=["response.created","response.in_progress","response.failed","response.completed","response.incomplete","response.queued","response.output_text.delta",...n];t.OPENAI_INTEGRATION_NAME="OpenAI",t.OPENAI_METHOD_REGISTRY={"responses.create":{operation:"chat"},"chat.completions.create":{operation:"chat"},"embeddings.create":{operation:"embeddings"},"conversations.create":{operation:"chat"}},t.RESPONSES_TOOL_CALL_EVENT_TYPES=n,t.RESPONSE_EVENT_TYPES=r},49464(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(68974),s=n(79183),i=n(52751),a=n(85110),o=n(15363),l=n(55908),c=n(24231),u=n(2881),d=n(47277),h=n(92104),f=n(55201);function p(e,t){const n={[c.GEN_AI_SYSTEM_ATTRIBUTE]:"openai",[c.GEN_AI_OPERATION_NAME_ATTRIBUTE]:t,[i.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]:"auto.ai.openai"};if(e.length>0&&"object"==typeof e[0]&&null!==e[0]){const t=e[0],s=function(e){const t=[...Array.isArray(e.tools)?e.tools:[],...e.web_search_options&&"object"==typeof e.web_search_options?[{type:"web_search_options",...e.web_search_options}]:[]];if(0!==t.length)try{return JSON.stringify(t)}catch(e){return void(r.DEBUG_BUILD&&a.debug.error("Failed to serialize OpenAI tools:",e))}}(t);s&&(n[c.GEN_AI_REQUEST_AVAILABLE_TOOLS_ATTRIBUTE]=s),Object.assign(n,f.extractRequestParameters(t))}else n[c.GEN_AI_REQUEST_MODEL_ATTRIBUTE]="unknown";return n}function g(e,t,n,r){if("embeddings"===n&&"input"in t){const n=t.input;if(null==n)return;if("string"==typeof n&&0===n.length)return;if(Array.isArray(n)&&0===n.length)return;return void e.setAttribute(c.GEN_AI_EMBEDDINGS_INPUT_ATTRIBUTE,"string"==typeof n?n:JSON.stringify(n))}const s="input"in t?t.input:"messages"in t?t.messages:void 0;if(!s)return;if(Array.isArray(s)&&0===s.length)return;const{systemInstructions:i,filteredMessages:a}=u.extractSystemInstructions(s);i&&e.setAttribute(c.GEN_AI_SYSTEM_INSTRUCTIONS_ATTRIBUTE,i),e.setAttribute(c.GEN_AI_INPUT_MESSAGES_ATTRIBUTE,r?u.getTruncatedJsonString(a):u.getJsonString(a)),Array.isArray(a)?e.setAttribute(c.GEN_AI_INPUT_MESSAGES_ORIGINAL_LENGTH_ATTRIBUTE,a.length):e.setAttribute(c.GEN_AI_INPUT_MESSAGES_ORIGINAL_LENGTH_ATTRIBUTE,1)}function m(e,t="",n){return new Proxy(e,{get(e,r){const i=e[r],a=u.buildMethodPath(t,String(r)),_=d.OPENAI_METHOD_REGISTRY[a];return"function"==typeof i&&_?function(e,t,n,r,i){return function(...a){const d=n.operation||"unknown",m=p(a,d),_=m[c.GEN_AI_REQUEST_MODEL_ATTRIBUTE]||"unknown",T=a[0],E=T&&"object"==typeof T&&!0===T.stream,y={name:`${d} ${_}`,op:`gen_ai.${d}`,attributes:m};if(E){let n;const c=l.startSpanManual(y,(l=>(n=e.apply(r,a),i.recordInputs&&T&&g(l,T,d,u.shouldEnableTruncation(i.enableTruncation)),(async()=>{try{const e=await n;return h.instrumentStream(e,l,i.recordOutputs??!1)}catch(e){throw l.setStatus({code:o.SPAN_STATUS_ERROR,message:"internal_error"}),s.captureException(e,{mechanism:{handled:!1,type:"auto.ai.openai.stream",data:{function:t}}}),l.end(),e}})())));return u.wrapPromiseWithMethods(n,c,"auto.ai.openai")}let S;const v=l.startSpan(y,(n=>(S=e.apply(r,a),i.recordInputs&&T&&g(n,T,d,u.shouldEnableTruncation(i.enableTruncation)),S.then((e=>(f.addResponseAttributes(n,e,i.recordOutputs),e)),(e=>{throw s.captureException(e,{mechanism:{handled:!1,type:"auto.ai.openai",data:{function:t}}}),e}
1)))));return u.wrapPromiseWithMethods(S,v,"auto.ai.openai")}}(i,a,_,e,n):"function"==typeof i?i.bind(e):i&&"object"==typeof i?m(i,a,n):i}})}t.instrumentOpenAiClient=function(e,t){return m(e,"",u.resolveAIRecordingOptions(t))}},92104(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(79183),s=n(15363),i=n(2881),a=n(47277),o=n(55201);function l(e,t){for(const n of e){const e=n.index;if(void 0!==e&&n.function)if(e in t.chatCompletionToolCalls){const r=t.chatCompletionToolCalls[e];n.function.arguments&&r?.function&&(r.function.arguments+=n.function.arguments)}else t.chatCompletionToolCalls[e]={...n,function:{name:n.function.name,arguments:n.function.arguments||""}}}}function c(e,t,n){t.responseId=e.id??t.responseId,t.responseModel=e.model??t.responseModel,e.usage&&(t.promptTokens=e.usage.prompt_tokens,t.completionTokens=e.usage.completion_tokens,t.totalTokens=e.usage.total_tokens);for(const r of e.choices??[])n&&(r.delta?.content&&t.responseTexts.push(r.delta.content),r.delta?.tool_calls&&l(r.delta.tool_calls,t)),r.finish_reason&&t.finishReasons.push(r.finish_reason)}function u(e,t,n,i){if(!e||"object"!=typeof e)return void t.eventTypes.push("unknown:non-object");if(e instanceof Error)return i.setStatus({code:s.SPAN_STATUS_ERROR,message:"internal_error"}),void r.captureException(e,{mechanism:{handled:!1,type:"auto.ai.openai.stream-response"}});if(!("type"in e))return;const o=e;if(a.RESPONSE_EVENT_TYPES.includes(o.type)){if(n&&("response.output_item.done"===o.type&&"item"in o&&t.responsesApiToolCalls.push(o.item),"response.output_text.delta"===o.type&&"delta"in o&&o.delta))t.responseTexts.push(o.delta);else if("response"in o){const{response:e}=o;t.responseId=e.id??t.responseId,t.responseModel=e.model??t.responseModel,e.usage&&(t.promptTokens=e.usage.input_tokens,t.completionTokens=e.usage.output_tokens,t.totalTokens=e.usage.total_tokens),e.status&&t.finishReasons.push(e.status),n&&e.output_text&&t.responseTexts.push(e.output_text)}}else t.eventTypes.push(o.type)}t.instrumentStream=async function*(e,t,n){const r={eventTypes:[],responseTexts:[],finishReasons:[],responseId:"",responseModel:"",promptTokens:void 0,completionTokens:void 0,totalTokens:void 0,chatCompletionToolCalls:{},responsesApiToolCalls:[]};try{for await(const s of e)o.isChatCompletionChunk(s)?c(s,r,n):o.isResponsesApiStreamEvent(s)&&u(s,r,n,t),yield s}finally{const e=[...Object.values(r.chatCompletionToolCalls),...r.responsesApiToolCalls];i.endStreamSpan(t,{...r,toolCalls:e},n)}}},55201(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(24231);t.addResponseAttributes=function(e,t,n){if(!t||"object"!=typeof t)return;const s=t,i={};if("string"==typeof s.id&&(i[r.GEN_AI_RESPONSE_ID_ATTRIBUTE]=s.id),"string"==typeof s.model&&(i[r.GEN_AI_RESPONSE_MODEL_ATTRIBUTE]=s.model),"conversation"===s.object&&"string"==typeof s.id&&(i[r.GEN_AI_CONVERSATION_ID_ATTRIBUTE]=s.id),s.usage&&"object"==typeof s.usage){const e=s.usage,t=e.prompt_tokens??e.input_tokens;"number"==typeof t&&(i[r.GEN_AI_USAGE_INPUT_TOKENS_ATTRIBUTE]=t);const n=e.completion_tokens??e.output_tokens;"number"==typeof n&&(i[r.GEN_AI_USAGE_OUTPUT_TOKENS_ATTRIBUTE]=n),"number"==typeof e.total_tokens&&(i[r.GEN_AI_USAGE_TOTAL_TOKENS_ATTRIBUTE]=e.total_tokens)}if(Array.isArray(s.choices)){const e=s.choices,t=e.map((e=>e.finish_reason)).filter((e=>"string"==typeof e));if(t.length>0&&(i[r.GEN_AI_RESPONSE_FINISH_REASONS_ATTRIBUTE]=JSON.stringify(t)),n){const t=e.map((e=>{const t=e.message;return t?.content||""}));i[r.GEN_AI_RESPONSE_TEXT_ATTRIBUTE]=JSON.stringify(t);const n=e.map((e=>{const t=e.message;return t?.tool_calls})).filter((e=>Array.isArray(e)&&e.length>0)).flat();n.length>0&&(i[r.GEN_AI_RESPONSE_TOOL_CALLS_ATTRIBUTE]=JSON.stringify(n))}}if("string"==typeof s.status&&(i[r.GEN_AI_RESPONSE_FINISH_REASONS_ATTRIBUTE]||(i[r.GEN_AI_RESPONSE_FINISH_REASONS_ATTRIBUTE]=JSON.stringify([s.status]))),n&&("string"!=typeof s.output_text||i[r.GEN_AI_RESPONSE_TEXT_ATTRIBUTE]||(i[r.GEN_AI_RESPONSE_TEXT_ATTRIBUTE]=s.output_text),Array.isArray(s.output)&&s.output.length>0&&!i[r.GEN_AI_RESPONSE_TOOL_CALLS_ATTRIBUTE])){const e=s.output.f
1ilter((e=>"function_call"===e?.type));e.length>0&&(i[r.GEN_AI_RESPONSE_TOOL_CALLS_ATTRIBUTE]=JSON.stringify(e))}e.setAttributes(i)},t.extractRequestParameters=function(e){const t={[r.GEN_AI_REQUEST_MODEL_ATTRIBUTE]:e.model??"unknown"};"temperature"in e&&(t[r.GEN_AI_REQUEST_TEMPERATURE_ATTRIBUTE]=e.temperature),"top_p"in e&&(t[r.GEN_AI_REQUEST_TOP_P_ATTRIBUTE]=e.top_p),"frequency_penalty"in e&&(t[r.GEN_AI_REQUEST_FREQUENCY_PENALTY_ATTRIBUTE]=e.frequency_penalty),"presence_penalty"in e&&(t[r.GEN_AI_REQUEST_PRESENCE_PENALTY_ATTRIBUTE]=e.presence_penalty),"stream"in e&&(t[r.GEN_AI_REQUEST_STREAM_ATTRIBUTE]=e.stream),"encoding_format"in e&&(t[r.GEN_AI_REQUEST_ENCODING_FORMAT_ATTRIBUTE]=e.encoding_format),"dimensions"in e&&(t[r.GEN_AI_REQUEST_DIMENSIONS_ATTRIBUTE]=e.dimensions);const n=function(e){return"conversation"in e&&"string"==typeof e.conversation?e.conversation:"previous_response_id"in e&&"string"==typeof e.previous_response_id?e.previous_response_id:void 0}(e);return n&&(t[r.GEN_AI_CONVERSATION_ID_ATTRIBUTE]=n),t},t.isChatCompletionChunk=function(e){return null!==e&&"object"==typeof e&&"object"in e&&"chat.completion.chunk"===e.object},t.isResponsesApiStreamEvent=function(e){return null!==e&&"object"==typeof e&&"type"in e&&"string"==typeof e.type&&e.type.startsWith("response.")}},79816(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(68974),s=n(85110),i=n(51228),a=n(10393);t.sampleSpan=function(e,t,n){if(!i.hasSpansEnabled(e))return[!1];let o,l;"function"==typeof e.tracesSampler?(l=e.tracesSampler({...t,inheritOrSampleWith:e=>"number"==typeof t.parentSampleRate?t.parentSampleRate:"boolean"==typeof t.parentSampled?Number(t.parentSampled):e}),o=!0):void 0!==t.parentSampled?l=t.parentSampled:void 0!==e.tracesSampleRate&&(l=e.tracesSampleRate,o=!0);const c=a.parseSampleRate(l);if(void 0===c)return r.DEBUG_BUILD&&s.debug.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(l)} of type ${JSON.stringify(typeof l)}.`),[!1];if(!c)return r.DEBUG_BUILD&&s.debug.log("[Tracing] Discarding transaction because "+("function"==typeof e.tracesSampler?"tracesSampler returned 0 or false":"a negative sampling decision was inherited or tracesSampleRate is set to 0")),[!1,c,o];const u=n<c;return u||r.DEBUG_BUILD&&s.debug.log(`[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(l)})`),[u,c,o]}},67392(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(58913),s=n(54583);t.SentryNonRecordingSpan=class{constructor(e={}){this._traceId=e.traceId||r.generateTraceId(),this._spanId=e.spanId||r.generateSpanId(),this.dropReason=e.dropReason}spanContext(){return{spanId:this._spanId,traceId:this._traceId,traceFlags:s.TRACE_FLAG_NONE}}end(e){}setAttribute(e,t){return this}setAttributes(e){return this}setStatus(e){return this}updateName(e){return this}isRecording(){return!1}addEvent(e,t,n){return this}addLink(e){return this}addLinks(e){return this}recordException(e,t){}}},30242(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(49564),s=n(68974),i=n(30238),a=n(52751),o=n(85110),l=n(58913),c=n(54583),u=n(26869),d=n(93754),h=n(8346),f=n(28945),p=n(85526),g=n(64284);class m{constructor(e={}){this._traceId=e.traceId||l.generateTraceId(),this._spanId=e.spanId||l.generateSpanId(),this._startTime=e.startTimestamp||u.timestampInSeconds(),this._links=e.links,this._attributes={},this.setAttributes({[a.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]:"manual",[a.SEMANTIC_ATTRIBUTE_SENTRY_OP]: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,t){}spanContext(){const{_spanId:e,_traceId:t,_sampled:n}=this;return{spanId:e,traceId:t,traceFlags:n?c.TRACE_FLAG_SAMPLED:c.TRACE_FLAG_NONE}}setAttribute(e,t){return void 0===t?delete this._attributes[e]:this._attributes[e]=t,this}setAttributes(e){return Object.keys(e).forEach((t=>this.setAttribute(t,e[t]))),this}updateStartTime(e){this._startTime=c.spanTimeInputToSeconds(e)}setStatus(e){return this._status=e,this}updateName(e){return this._name=e,this.setAttribute(a.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE,"custom"),this}end(e){this._endTime||(this._endTime=c.spanTimeInputToSeconds(e),h.logSpanEnd(this),this._onSpanEnded())}getSpanJSON(){return{data:this._attributes,description:this._name,op:this._attributes[a.SEMANTIC_ATTRIBUTE_SENTRY_OP],parent_span_id:this._parentSpanId,span_id:this._spanId,start_timestamp:this._startTime,status:c.getStatusMessage(this._status),timestamp:this._endTime,trace_id:this._traceId,origin:this._attributes[a.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN],profile_id:this._attributes[a.SEMANTIC_ATTRIBUTE_PROFILE_ID],exclusive_time:this._attributes[a.SEMANTIC_ATTRIBUTE_EXCLUSIVE_TIME],measurements:f.timedEventsToMeasurements(this._events),is_segment:this._isStandaloneSpan&&c.getRootSpan(this)===this||void 0,segment_id:this._isStandaloneSpan?c.getRootSpan(this).spanContext().spanId:void 0,links:c.convertSpanLinksForEnvelope(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===c.getRootSpan(this),status:c.getSimpleStatusMessage(this._status),attributes:this._attributes,links:c.getStreamedSpanLinks(this._links)}}isRecording(){return!this._endTime&&!!this._sampled}addEvent(e,t,n){s.DEBUG_BUILD&&o.debug.log("[Tracing] Adding an event to span:",e);const r=_(t)?t:n||u.timestampInSeconds(),i=_(t)?{}:t||{},a={name:e,time:c.spanTimeInputToSeconds(r),attributes:i};return this._events.push(a),this}isStandaloneSpan(){return!!this._isStandaloneSpan}_onSpanEnded(){const e=r.getClient();e&&(e.emit("spanEnd",this),this._isStandaloneSpan||e.emit("afterSpanEnd",this));if(!(this._isStandaloneSpan||this===c.getRootSpan(this)))return;if(this._isStandaloneSpan)return void(this._sampled?function(e){const t=r.getClient();if(!t)return;const n=e[1];
1if(!n||0===n.length)return void t.recordDroppedEvent("before_send","span");t.sendEnvelope(e)}(i.createSpanEnvelope([this],e)):(s.DEBUG_BUILD&&o.debug.log("[Tracing] Discarding standalone span because its trace was not chosen to be sampled."),e&&e.recordDroppedEvent("sample_rate","span")));if(e&&p.hasSpanStreamingEnabled(e))return void e.emit("afterSegmentSpanEnd",this);const t=this._convertSpanToTransaction();if(t){(g.getCapturedScopesOnSpan(this).scope||r.getCurrentScope()).captureEvent(t)}}_convertSpanToTransaction(){if(!T(c.spanToJSON(this)))return;this._name||(s.DEBUG_BUILD&&o.debug.warn("Transaction has no name, falling back to `<unlabeled transaction>`."),this._name="<unlabeled transaction>");const{scope:e,isolationScope:t}=g.getCapturedScopesOnSpan(this),n=e?.getScopeData().sdkProcessingMetadata?.normalizedRequest;if(!0!==this._sampled)return;const r=c.getSpanDescendants(this).filter((e=>e!==this&&!function(e){return e instanceof m&&e.isStandaloneSpan()}(e))).map((e=>c.spanToJSON(e))).filter(T),i=this._attributes[a.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE];delete this._attributes[a.SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME];let l=!1;r.forEach((e=>{delete e.data[a.SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME],e.op?.startsWith("gen_ai.")&&(l=!0)}));const u={contexts:{trace:c.spanToTransactionTraceContext(this)},spans:r.length>1e3?r.sort(((e,t)=>e.start_timestamp-t.start_timestamp)).slice(0,1e3):r,start_timestamp:this._startTime,timestamp:this._endTime,transaction:this._name,type:"transaction",sdkProcessingMetadata:{capturedSpanScope:e,capturedSpanIsolationScope:t,dynamicSamplingContext:d.getDynamicSamplingContextFromSpan(this),hasGenAiSpans:l},request:n,...i&&{transaction_info:{source:i}}},h=f.timedEventsToMeasurements(this._events);return h&&Object.keys(h).length&&(s.DEBUG_BUILD&&o.debug.log("[Measurements] Adding measurements to transaction event",JSON.stringify(h,void 0,2)),u.measurements=h),u}}function _(e){return e&&"number"==typeof e||e instanceof Date||Array.isArray(e)}function T(e){return!!(e.start_timestamp&&e.timestamp&&e.span_id&&e.trace_id)}t.SentrySpan=m},95150(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(96159);t.isStreamedBeforeSendSpanCallback=function(e){return!!e&&"function"==typeof e&&"_streamed"in e&&!!e._streamed},t.withStreamedSpan=function(e){return r.addNonEnumerableProperty(e,"_streamed",!0),e}},47473(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(52751),s=n(37402),i=n(9635),a=n(54583),o=n(64284),l=n(95150);function c(e,t){const n=e.attributes??(e.attributes={});Object.entries(t).forEach((([e,t])=>{null==t||e in n||(n[e]=t)}))}function u(e,t){const n=t(e);return n||(a.showSpanDropWarning(),e)}function d(e,t){const n=e.attributes;if(!n)return;const s=n["http.request.method"]||n["http.method"];if(s)return void function(e,t,n,s){const a=["http"];2===n?a.push("client"):1===n&&a.push("server");t["sentry.http.prefetch"]&&a.push("prefetch");c(e,{[r.SEMANTIC_ATTRIBUTE_SENTRY_OP]:a.join(".")});const o=t[r.SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME];if("string"==typeof o)return void(e.name=o);if("custom"===t[r.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE])return;const l=t["http.route"];if("string"==typeof l)e.name=`${s} ${l}`,c(e,{[r.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]:"route"});else{if(2===n||1===n){const r=function(e,t){const n=e["http.url"]||e["url.full"],r=e["http.target"],s="string"==typeof n?i.parseUrl(n):void 0,a=s?i.getSanitizedUrlString(s):void 0;if(1===t&&"string"==typeof r)return i.stripUrlQueryAndFragment(r);if(a)return a;if("string"==typeof r)return i.stripUrlQueryAndFragment(r);return}(t,n);r&&(e.name=`${s} ${r}`)}c(e,{[r.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]:"url"})}}(e,n,t,s);const a=n["db.system.name"]||n["db.system"],o="string"==typeof n[r.SEMANTIC_ATTRIBUTE_SENTRY_OP]&&`${n[r.SEMANTIC_ATTRIBUTE_SENTRY_OP]}`.startsWith("cache.");if(a&&!o)return void function(e,t){c(e,{[r.SEMANTIC_ATTRIBUTE_SENTRY_OP]:"db"});const n=t[r.SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME];if("string"==typeof n)return void(e.name=n);if("custom"===t[r.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE])return;const s=t["db.statement"];
1s&&(e.name=`${s}`,c(e,{[r.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]:"task"}))}(e,n);if(n["rpc.service"])return void c(e,{[r.SEMANTIC_ATTRIBUTE_SENTRY_OP]:"rpc"});if(n["messaging.system"])return void c(e,{[r.SEMANTIC_ATTRIBUTE_SENTRY_OP]:"message"});const l=n["faas.trigger"];l&&c(e,{[r.SEMANTIC_ATTRIBUTE_SENTRY_OP]:`${l}`})}t.applyBeforeSendSpanCallback=u,t.captureSpan=function(e,t){const n=a.spanToStreamedSpanJSON(e),i=a.INTERNAL_getSegmentSpan(e),h=a.spanToStreamedSpanJSON(i),{isolationScope:f,scope:p}=o.getCapturedScopesOnSpan(e);!function(e,t,n,s){const i=n.getSdkMetadata(),{release:a,environment:o}=n.getOptions();c(e,{[r.SEMANTIC_ATTRIBUTE_SENTRY_RELEASE]:a,[r.SEMANTIC_ATTRIBUTE_SENTRY_ENVIRONMENT]:o,[r.SEMANTIC_ATTRIBUTE_SENTRY_SEGMENT_NAME]:t.name,[r.SEMANTIC_ATTRIBUTE_SENTRY_SEGMENT_ID]:t.span_id,[r.SEMANTIC_ATTRIBUTE_SENTRY_SDK_NAME]:i?.sdk?.name,[r.SEMANTIC_ATTRIBUTE_SENTRY_SDK_VERSION]:i?.sdk?.version,[r.SEMANTIC_ATTRIBUTE_USER_ID]:s.user?.id,[r.SEMANTIC_ATTRIBUTE_USER_EMAIL]:s.user?.email,[r.SEMANTIC_ATTRIBUTE_USER_IP_ADDRESS]:s.user?.ip_address,[r.SEMANTIC_ATTRIBUTE_USER_USERNAME]:s.user?.username,...s.attributes})}(n,h,t,s.getCombinedScopeData(f,p)),d(n,e.kind),n.is_segment&&t.emit("processSegmentSpan",n),t.emit("processSpan",n);const{beforeSendSpan:g}=t.getOptions(),m=g&&l.isStreamedBeforeSendSpanCallback(g)?u(n,g):n,_=m.attributes?.[r.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE];return _&&c(m,{"sentry.span.source":_}),{...a.streamedSpanJsonToSerializedSpan(m),_segmentSpan:i}},t.inferSpanDataFromOtelAttributes=d,t.safeSetSpanJSONAttributes=c},26287(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(21811),s=n(99188),i=n(64702);function a(e){return!!e.trace_id&&!!e.public_key}t.createStreamedSpanEnvelope=function(e,t,n){const o=n.getOptions(),l=n.getDsn(),c=o.tunnel,u=s.getSdkMetadataForEnvelopeHeader(o._metadata),d={sent_at:(new Date).toISOString(),...a(t)&&{trace:t},...u&&{sdk:u},...!!c&&l&&{dsn:r.dsnToString(l)}},h=o.sendDefaultPii?"auto":"never",f=[{type:"span",item_count:e.length,content_type:"application/vnd.sentry.items.span.v2+json"},{version:2,...i.isBrowser()&&{ingest_settings:{infer_ip:h,infer_user_agent:h}},items:e}];return s.createEnvelope(d,[f])}},13696(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(22147);t.estimateSerializedSpanSizeInBytes=function(e){let t=156;if(t+=2*e.name.length,t+=r.estimateTypedAttributesSizeInBytes(e.attributes),e.links&&e.links.length>0){const n=e.links[0],s=n?.attributes;t+=(100+(s?r.estimateTypedAttributesSizeInBytes(s):0))*e.links.length}return t}},34983(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(64702),s=n(85526),i=n(4805);t.extractGenAiSpansFromEvent=function(e,t){if("transaction"!==e.type||!e.spans?.length||!e.sdkProcessingMetadata?.hasGenAiSpans||!t.getOptions().streamGenAiSpans||s.hasSpanStreamingEnabled(t))return;const n=[],a=[];for(const t of e.spans)t.op?.startsWith("gen_ai.")?n.push(i.spanJsonToSerializedStreamedSpan(t)):a.push(t);if(0===n.length)return;e.spans=a;const o=t.getOptions().sendDefaultPii?"auto":"never";return[{type:"span",item_count:n.length,content_type:"application/vnd.sentry.items.span.v2+json"},{version:2,...r.isBrowser()&&{ingest_settings:{infer_ip:o,infer_user_agent:o}},items:n}]}},85526(e,t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),t.hasSpanStreamingEnabled=function(e){return"stream"===e.getOptions().traceLifecycle}},13161(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(68974),s=n(85110),i=n(41335),a=n(93754),o=n(26287),l=n(13696);t.SpanBuffer=class{constructor(e,t){this._traceBuckets=new Map,this._client=e;const{maxSpanLimit:n,flushInterval:r,maxTraceWeightInBytes:s}=t??{};this._maxSpanLimit=n&&n>0&&n<=1e3?n:1e3,this._flushInterval=r&&r>0?r:5e3,this._maxTraceWeight=s&&s>0?s:5e6,this._client.on("flush",(()=>{this.drain()})),this._client.on("close",(()=>{this._traceBuckets.forEach((e=>{clearTimeout(e.timeout)})),this._traceBuckets.clear()}))}add(e){const t=e.trace_id;let n=this._traceBuckets.get(t);n||(n={spans:new Set,size:0,timeout:i.safeUnref(setTimeout((()=>{this.flush(t)}),this._flushInterval))},this._traceBuckets.set(t,n)),n.spans.add(e),n.size+=l.estimateSerializedSpanSizeInBytes(e),(n.spans.size>=this._maxSpanLimit||n.size>=this._maxTraceWeight)&&this.flush(t)}drain(){this._traceBuckets.size&&(r.DEBUG_BUILD&&s.debug.log(`Flushing span tree map with ${this._traceBuckets.size}
1 traces`),this._traceBuckets.forEach(((e,t)=>{this.flush(t)})))}flush(e){const t=this._traceBuckets.get(e);if(!t)return;if(!t.spans.size)return void this._removeTrace(e);const n=Array.from(t.spans),i=n[0]?._segmentSpan;if(!i)return r.DEBUG_BUILD&&s.debug.warn("No segment span reference found on span JSON, cannot compute DSC"),void this._removeTrace(e);const l=a.getDynamicSamplingContextFromSpan(i),c=n.map((e=>{const{_segmentSpan:t,...n}=e;return n})),u=o.createStreamedSpanEnvelope(c,l,this._client);r.DEBUG_BUILD&&s.debug.log(`Sending span envelope for trace ${e} with ${c.length} spans`),this._client.sendEnvelope(u).then(null,(e=>{r.DEBUG_BUILD&&s.debug.error("Error while sending streamed span envelope:",e)})),this._removeTrace(e)}_removeTrace(e){const t=this._traceBuckets.get(e);t&&clearTimeout(t.timeout),this._traceBuckets.delete(e)}}},4805(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(54583);t.spanJsonToSerializedStreamedSpan=function(e){const t={trace_id:e.trace_id,span_id:e.span_id,parent_span_id:e.parent_span_id,name:e.description||"",start_timestamp:e.start_timestamp,end_timestamp:e.timestamp||e.start_timestamp,status:e.status&&"ok"!==e.status&&"cancelled"!==e.status?"error":"ok",is_segment:!1,attributes:{...e.data},links:e.links};return r.streamedSpanJsonToSerializedSpan(t)}},15363(e,t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});function n(e){if(e<400&&e>=100)return{code:1};if(e>=400&&e<500)switch(e){case 401:return{code:2,message:"unauthenticated"};case 403:return{code:2,message:"permission_denied"};case 404:return{code:2,message:"not_found"};case 409:return{code:2,message:"already_exists"};case 413:return{code:2,message:"failed_precondition"};case 429:return{code:2,message:"resource_exhausted"};case 499:return{code:2,message:"cancelled"};default:return{code:2,message:"invalid_argument"}}if(e>=500&&e<600)switch(e){case 501:return{code:2,message:"unimplemented"};case 503:return{code:2,message:"unavailable"};case 504:return{code:2,message:"deadline_exceeded"};default:return{code:2,message:"internal_error"}}return{code:2,message:"internal_error"}}t.SPAN_STATUS_ERROR=2,t.SPAN_STATUS_OK=1,t.SPAN_STATUS_UNSET=0,t.getSpanStatusFromHttpCode=n,t.setHttpStatus=function(e,t){e.setAttribute("http.response.status_code",t);const r=n(t);"unknown_error"!==r.message&&e.setStatus(r)}},55908(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(42810),s=n(73220),i=n(49564),a=n(68974),o=n(52751),l=n(5684),c=n(85110),u=n(76354),d=n(51228),h=n(87687),f=n(85526),p=n(10393),g=n(58913),m=n(83031),_=n(64865),T=n(54583),E=n(23336),y=n(93754),S=n(8346),v=n(79816),b=n(67392),I=n(30242),A=n(15363),R=n(64284),C="__SENTRY_SUPPRESS_TRACING__";function k(e,t){const n=w();return n.withActiveSpan?n.withActiveSpan(e,t):i.withScope((n=>(_._setSpanForScope(n,e||void 0),t(n))))}function L(e){const t=w();return t.startNewTrace?t.startNewTrace(e):i.withScope((t=>(t.setPropagationContext({traceId:g.generateTraceId(),sampleRand:m.safeMathRandom()}),a.DEBUG_BUILD&&c.debug.log(`Starting a new trace with id ${t.getPropagationContext().traceId}`),k(null,e))))}function O({parentSpan:e,spanArguments:t,forceTransaction:n,scope:r}){if(!d.hasSpansEnabled()){const r=new b.SentryNonRecordingSpan;if(n||!e){const e={sampled:"false",sample_rate:"0",transaction:t.name,...y.getDynamicSamplingContextFromSpan(r)};y.freezeDscOnSpan(r,e)}return r}const s=i.getClient();if(function(e,t){const n=e?.getOptions().ignoreSpans;if(!e||!f.hasSpanStreamingEnabled(e)||!n?.length)return!1;return h.shouldIgnoreSpan({description:t.name||"",op:t.attributes?.[o.SEMANTIC_ATTRIBUTE_SENTRY_OP]||t.op,attributes:t.attributes},n)}(s,t))return U(r)||s?.recordDroppedEvent("ignored","span"),new b.SentryNonRecordingSpan({dropReason:"ignored",traceId:e?.spanContext().traceId??r.getPropagationContext().traceId});const a=i.getIsolationScope();let l;if(e&&!n)l=function(e,t,n){const{spanId:r,traceId:s}=e.spanContext(),a=U(t),o=!a&&T.spanIsSampled(e),l=o?new I.SentrySpan({...n,parentSpanId:r,traceId:s,sampled:o}):new b.SentryNonRecordingSpan({traceId:s});T.addChildSpanToSpan(e,l);const c=i.getClient();if(!c)return l;f.hasSpanStreamingEnabled(c)&&l instanceof b.SentryNonRecordingSpan&&(e instanceof b.SentryNonRecordingSpan&&e.dropReason?(l.dropReason=e.dropReason,c.recordDroppedEvent(e.dropReason,"span")):a||(l.dropReason="sample_rate",c.recordDroppedEvent("sample_rate","span")));
1c.emit("spanStart",l),n.endTimestamp&&(c.emit("spanEnd",l),c.emit("afterSpanEnd",l));return l}(e,r,t),T.addChildSpanToSpan(e,l);else if(e){const n=y.getDynamicSamplingContextFromSpan(e),{traceId:s,spanId:i}=e.spanContext(),a=T.spanIsSampled(e);l=P({traceId:s,parentSpanId:i,...t},r,a),y.freezeDscOnSpan(l,n)}else{const{traceId:e,dsc:n,parentSpanId:s,sampled:i}={...a.getPropagationContext(),...r.getPropagationContext()};l=P({traceId:e,parentSpanId:s,...t},r,i),n&&y.freezeDscOnSpan(l,n)}return S.logSpanStart(l),R.setCapturedScopesOnSpan(l,r,a),l}function N(e){const t={isStandalone:(e.experimental||{}).standalone,...e};if(e.startTime){const n={...t};return n.startTimestamp=T.spanTimeInputToSeconds(e.startTime),delete n.startTime,n}return t}function w(){const e=s.getMainCarrier();return r.getAsyncContextStrategy(e)}function P(e,t,n){const r=i.getClient(),s=r?.getOptions()||{},{name:l=""}=e,u={spanAttributes:{...e.attributes},spanName:l,parentSampled:n};r?.emit("beforeSampling",u,{decision:!1});const d=u.parentSampled??n,h=u.spanAttributes,g=t.getPropagationContext(),m=U(t),[_,T,E]=m?[!1]:v.sampleSpan(s,{name:l,parentSampled:d,attributes:h,parentSampleRate:p.parseSampleRate(g.dsc?.sample_rate)},g.sampleRand),y=new I.SentrySpan({...e,attributes:{[o.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]:"custom",[o.SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE]:void 0!==T&&E?T:void 0,...h},sampled:_});return _||!r||m||(a.DEBUG_BUILD&&c.debug.log("[Tracing] Discarding root span because its trace was not chosen to be sampled."),r.recordDroppedEvent("sample_rate",f.hasSpanStreamingEnabled(r)?"span":"transaction")),r&&r.emit("spanStart",y),y}function M(e,t){if(t)return t;if(null===t)return;const n=_._getSpanForScope(e);if(!n)return;const r=i.getClient();return(r?r.getOptions():{}).parentSpanIsAlwaysRootSpan?T.getRootSpan(n):n}function D(e){return void 0!==e?t=>k(e,t):e=>e()}function x(e){return e instanceof b.SentryNonRecordingSpan&&"ignored"===e.dropReason}function U(e){return!0===e.getScopeData().sdkProcessingMetadata[C]}t.SUPPRESS_TRACING_KEY=C,t.continueTrace=(e,t)=>{const n=s.getMainCarrier(),a=r.getAsyncContextStrategy(n);if(a.continueTrace)return a.continueTrace(e,t);const{sentryTrace:o,baggage:c}=e,u=i.getClient(),d=l.baggageHeaderToDynamicSamplingContext(c);return u&&!E.shouldContinueTrace(u,d?.org_id)?L(t):i.withScope((e=>{const n=E.propagationContextFromHeaders(o,c);return e.setPropagationContext(n),_._setSpanForScope(e,void 0),t()}))},t.startInactiveSpan=function(e){const t=w();if(t.startInactiveSpan)return t.startInactiveSpan(e);const n=N(e),{forceTransaction:r,parentSpan:s}=e;return(e.scope?t=>i.withScope(e.scope,t):void 0!==s?e=>k(s,e):e=>e())((()=>{const t=i.getCurrentScope(),a=M(t,s),o=i.getClient();return e.onlyIfParent&&!a?(o?.recordDroppedEvent("no_parent_span","span"),new b.SentryNonRecordingSpan):O({parentSpan:a,spanArguments:n,forceTransaction:r,scope:t})}))},t.startNewTrace=L,t.startSpan=function(e,t){const n=w();if(n.startSpan)return n.startSpan(e,t);const r=N(e),{forceTransaction:s,parentSpan:a,scope:o}=e,l=o?.clone();return i.withScope(l,(()=>D(a)((()=>{const n=i.getCurrentScope(),o=M(n,a),l=i.getClient(),c=e.onlyIfParent&&!o,d=c?new b.SentryNonRecordingSpan:O({parentSpan:o,spanArguments:r,forceTransaction:s,scope:n});return c&&l?.recordDroppedEvent("no_parent_span","span"),x(d)&&o||_._setSpanForScope(n,d),u.handleCallbackErrors((()=>t(d)),(()=>{const{status:e}=T.spanToJSON(d);!d.isRecording()||e&&"ok"!==e||d.setStatus({code:A.SPAN_STATUS_ERROR,message:"internal_error"})}),(()=>{d.end()}))}))))},t.startSpanManual=function(e,t){const n=w();if(n.startSpanManual)return n.startSpanManual(e,t);const r=N(e),{forceTransaction:s,parentSpan:a,scope:o}=e,l=o?.clone();return i.withScope(l,(()=>D(a)((()=>{const n=i.getCurrentScope(),o=M(n,a),l=e.onlyIfParent&&!o,c=l?new b.SentryNonRecordingSpan:O({parentSpan:o,spanArguments:r,forceTransaction:s,scope:n});return l&&i.getClient()?.recordDroppedEvent("no_parent_span","span"),x(c)&&o||_._setSpanForScope(n,c),u.handleCallbackErrors((()=>t(c,(()=>c.end()))),(()=>{const{status:e}=T.spanToJSON(c);!c.isRecording()||e&&"ok"!==e||c.setStatus({code:A.SPAN_STATUS_ERROR,message:"internal_error"})}))}))))},t.suppressTracing=function(e){const t=w();return t.suppressTracing?t.suppressTracing(e):i.withScope((t=>{t.setSDKProcessingMetadata({[C]:!0});const n=e();return t.setSDKProcessingMetadata({[C]:void 0}),n}))},t.withActiveSpan=k},64284(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(96159),s=n(23879),i="_sentryScope",a="_sentryIsolationScope";t.getCapturedScopesOnSpan=function(e){const t=e;return{scope:t[i],isolationScope:s.derefWeakRef(t[a])}},t.setCapturedScopesOnSpan=function(e,t,n){e&&(r.addNonEnumerableProperty(e,a,s.makeWeakRef(n)),r.addNonEnumerableProperty(e,i,t))}},57471(e,t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const n=new Map,r=new Map,s=new Map([["ai.generateText","invoke_agent"],["ai.streamText","invoke_agent"],["ai.generateObject","invoke_agent"],["ai.streamObject","invoke_agent"],["ai.generateText.doGenerate","generate_content"],["ai.streamText.doStream","generate_content"],["ai.generateObject.doGenerate","generate_content"],["ai.streamObject.doStream","generate_content"],["ai.embed.doEmbed","embeddings"],["ai.embedMany.doEmbed","embeddings"],["ai.rerank.doRerank","rerank"],["ai.toolCall","execute_tool"]]);t.SPAN_TO_OPERATION_NAME=s,t.toolCallSpanContextMap=n,t.toolDescriptionMap=r},61038(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(49564),s=n(52751),i=n(2881),a=n(54583),o=n(24231),l=n(57471),c=n(85526),u=n(67935),d=n(87350);function h(e){const{data:t,description:n}=a.spanToJSON(e);if(!n)return;if(t[d.AI_TOOL_CALL_NAME_ATTRIBUTE]&&t[d.AI_TOOL_CALL_ID_ATTRIBUTE]&&"ai.toolCall"===n)return void function(e,t){e.setAttribute(s.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,"auto.vercelai.otel"),e.setAttribute(s.SEMANTIC_ATTRIBUTE_SENTRY_OP,"gen_ai.execute_tool"),e.setAttribute(o.GEN_AI_OPERATION_NAME_ATTRIBUTE,"execute_tool"),_(t,d.AI_TOOL_CALL_NAME_ATTRIBUTE,o.GEN_AI_TOOL_NAME_ATTRIBUTE),_(t,d.AI_TOOL_CALL_ID_ATTRIBUTE,o.GEN_AI_TOOL_CALL_ID_ATTRIBUTE);const n=t[o.GEN_AI_TOOL_CALL_ID_ATTRIBUTE];"string"==typeof n&&l.toolCallSpanContextMap.set(n,e.spanContext());t[o.GEN_AI_TOOL_TYPE_ATTRIBUTE]||e.setAttribute(o.GEN_AI_TOOL_TYPE_ATTRIBUTE,"function");const r=t[o.GEN_AI_TOOL_NAME_ATTRIBUTE];r&&e.updateName(`execute_tool ${r}`)}(e,t);
1if(!t[d.AI_OPERATION_ID_ATTRIBUTE]&&!n.startsWith("ai."))return;const h=r.getClient(),f=h?.getIntegrationByName("VercelAI");!function(e,t,n,i){e.setAttribute(s.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,"auto.vercelai.otel");const h=t.replace("ai.","");e.setAttribute("ai.pipeline.name",h),e.updateName(h);const f=n[d.AI_TELEMETRY_FUNCTION_ID_ATTRIBUTE];f&&"string"==typeof f&&e.setAttribute("gen_ai.function_id",f);u.requestMessagesFromPrompt(e,n,i),n[d.AI_MODEL_ID_ATTRIBUTE]&&!n[o.GEN_AI_RESPONSE_MODEL_ATTRIBUTE]&&e.setAttribute(o.GEN_AI_RESPONSE_MODEL_ATTRIBUTE,n[d.AI_MODEL_ID_ATTRIBUTE]);e.setAttribute("ai.streaming",t.includes("stream"));const p=l.SPAN_TO_OPERATION_NAME.get(t);p?e.setAttribute(s.SEMANTIC_ATTRIBUTE_SENTRY_OP,`gen_ai.${p}`):t.startsWith("ai.stream")&&e.setAttribute(s.SEMANTIC_ATTRIBUTE_SENTRY_OP,"ai.run");if("invoke_agent"===p)return void(f&&"string"==typeof f?e.updateName(`invoke_agent ${f}`):e.updateName("invoke_agent"));const g=n[d.AI_MODEL_ID_ATTRIBUTE];g&&p&&e.updateName(`${p} ${g}`);const m=r.getClient();if(m&&c.hasSpanStreamingEnabled(m)&&n[d.AI_PROMPT_TOOLS_ATTRIBUTE]&&Array.isArray(n[d.AI_PROMPT_TOOLS_ATTRIBUTE])){const t=new Map;for(const e of n[d.AI_PROMPT_TOOLS_ATTRIBUTE])try{const n="string"==typeof e?JSON.parse(e):e;n?.name&&n?.description&&t.set(n.name,n.description)}catch{}if(t.size>0){const n=a.spanToJSON(e).parent_span_id;n&&l.toolDescriptionMap.set(n,t)}}}(e,n,t,i.shouldEnableTruncation(f?.options?.enableTruncation))}function f(e){if("transaction"===e.type&&e.spans){const t=new Map;for(const n of e.spans)m(n),u.accumulateTokensForParent(n,t);u.applyToolDescriptionsAndTokens(e.spans,t);const n=e.contexts?.trace;"gen_ai.invoke_agent"===n?.op&&u.applyAccumulatedTokens(n,t)}return e}function p(e){return"string"!=typeof e?"stop":"tool-calls"===e?"tool_call":e}function g(e){if(_(e,d.AI_USAGE_COMPLETION_TOKENS_ATTRIBUTE,o.GEN_AI_USAGE_OUTPUT_TOKENS_ATTRIBUTE),_(e,d.AI_USAGE_PROMPT_TOKENS_ATTRIBUTE,o.GEN_AI_USAGE_INPUT_TOKENS_ATTRIBUTE),_(e,d.AI_USAGE_CACHED_INPUT_TOKENS_ATTRIBUTE,o.GEN_AI_USAGE_INPUT_TOKENS_CACHED_ATTRIBUTE),_(e,"ai.usage.inputTokens",o.GEN_AI_USAGE_INPUT_TOKENS_ATTRIBUTE),_(e,"ai.usage.outputTokens",o.GEN_AI_USAGE_OUTPUT_TOKENS_ATTRIBUTE),_(e,d.AI_USAGE_TOKENS_ATTRIBUTE,o.GEN_AI_USAGE_INPUT_TOKENS_ATTRIBUTE),_(e,"ai.response.avgOutputTokensPerSecond","ai.response.avgCompletionTokensPerSecond"),"number"==typeof e[o.GEN_AI_USAGE_INPUT_TOKENS_ATTRIBUTE]&&"number"==typeof e[o.GEN_AI_USAGE_INPUT_TOKENS_CACHED_ATTRIBUTE]&&(e[o.GEN_AI_USAGE_INPUT_TOKENS_ATTRIBUTE]=e[o.GEN_AI_USAGE_INPUT_TOKENS_ATTRIBUTE]+e[o.GEN_AI_USAGE_INPUT_TOKENS_CACHED_ATTRIBUTE]),"number"==typeof e[o.GEN_AI_USAGE_INPUT_TOKENS_ATTRIBUTE]){const t="number"==typeof e[o.GEN_AI_USAGE_OUTPUT_TOKENS_ATTRIBUTE]?e[o.GEN_AI_USAGE_OUTPUT_TOKENS_ATTRIBUTE]:0;e[o.GEN_AI_USAGE_TOTAL_TOKENS_ATTRIBUTE]=t+e[o.GEN_AI_USAGE_INPUT_TOKENS_ATTRIBUTE]}if(e[d.AI_PROMPT_TOOLS_ATTRIBUTE]&&Array.isArray(e[d.AI_PROMPT_TOOLS_ATTRIBUTE])&&(e[d.AI_PROMPT_TOOLS_ATTRIBUTE]=u.convertAvailableToolsToJsonString(e[d.AI_PROMPT_TOOLS_ATTRIBUTE])),e[d.OPERATION_NAME_ATTRIBUTE]){const t=e[d.AI_OPERATION_ID_ATTRIBUTE]?e[d.AI_OPERATION_ID_ATTRIBUTE]:e[d.OPERATION_NAME_ATTRIBUTE],n=l.SPAN_TO_OPERATION_NAME.get(t)??t;e[o.GEN_AI_OPERATION_NAME_ATTRIBUTE]=n,delete e[d.OPERATION_NAME_ATTRIBUTE]}if(_(e,d.AI_PROMPT_MESSAGES_ATTRIBUTE,o.GEN_AI_INPUT_MESSAGES_ATTRIBUTE),function(e){const t=e[d.AI_RESPONSE_TEXT_ATTRIBUTE],n=e[d.AI_RESPONSE_TOOL_CALLS_ATTRIBUTE],r=e[d.AI_RESPONSE_FINISH_REASON_ATTRIBUTE];if(null==t&&null==n)return;const s=[];if("string"==typeof t&&t.length>0&&s.push({type:"text",content:t}),null!=n)try{const t="string"==typeof n?JSON.parse(n):n;if(Array.isArray(t)){for(const e of t){const t=e.input??e.args;s.push({type:"tool_call",id:e.toolCallId,name:e.toolName,arguments:"string"==typeof t?t:JSON.stringify(t??{})})}delete e[d.AI_RESPONSE_TOOL_CALLS_ATTRIBUTE]}}catch{}if(s.length>0){const t={role:"assistant",parts:s,finish_reason:p(r)};e[o.GEN_AI_OUTPUT_MESSAGES_ATTRIBUTE]=JSON.stringify([t]),delete e[d.AI_RESPONSE_TEXT_ATTRIBUTE]}}(e),_(e,d.AI_RESPONSE_OBJECT_ATTRIBUTE,"gen_ai.response.object"),_(e,d.AI_PROMPT_TOOLS_ATTRIBUTE,"gen_ai.request.available_tools"),_(e,d.AI_TOOL_CALL_ARGS_ATTRIBUTE,o.GEN_AI_TOOL_INPUT_ATTRIBUTE),_(e,d.AI_TOOL_CALL_RESULT_ATTRIBUTE,o.GEN_AI_TOOL_OUTPUT_ATTRIBUTE),_(e,d.AI_SCHEMA_ATTRIBUTE,"gen_ai.request.schema"),_(e,d.AI_MODEL_ID_ATTRIBUTE,o.GEN_AI_REQUEST_MODEL_ATTRIBUTE),Array.isArray(e[d.AI_VALUES_ATTRIBUTE])){const t=e[d.AI_VALUES_ATTRIBUTE].map((e=>{try{return JSON.parse(e)}catch{return e}}));e[o.GEN_AI_EMBEDDINGS_INPUT_ATTRIBUTE]=1===t.length?t[0]:JSON.stringify(t)}!function(e){const t=e[d.AI_RESPONSE_PROVIDER_METADATA_ATTRIBUTE];if(t)try{const n=JSON.parse(t),r=n.openai??n.azure;if(r&&(T(e,o.GEN_AI_USAGE_INPUT_TOKENS_CACHED_ATTRIBUTE,r.cachedPromptTokens),T(e,"gen_ai.usage.output_tokens.reasoning",r.reasoningTokens),T(e,"gen_ai.usage.output_tokens.prediction_accepted",r.acceptedPredictionTokens),T(e,"gen_ai.usage.output_tokens.prediction_rejected",r.rejectedPredictionTokens),e["gen_ai.conversation.id"]||T(e,"gen_ai.conversation.id",r.responseId)),n.anthropic){const t=n.anthropic.usage?.cache_read_input_tokens??n.anthropic.cacheReadInputTokens;T(e,o.GEN_AI_USAGE_INPUT_TOKENS_CACHED_ATTRIBUTE,t);const r=n.anthropic.usage?.cache_creation_input_tokens??n.anthropic.cacheCreationInputTokens;T(e,o.GEN_AI_USAGE_INPUT_TOKENS_CACHE_WRITE_ATTRIBUTE,r)}n.bedrock?.usage&&(T(e,o.GEN_AI_USAGE_INPUT_TOKENS_CACHED_ATTRIBUTE,n.bedrock.usage.cacheReadInputTokens),T(e,o.GEN_AI_USAGE_INPUT_TOKENS_CACHE_WRITE_ATTRIBUTE,n.bedrock.usage.cacheWriteInputTokens)),n.deepseek&&(T(e,o.GEN_AI_USAGE_INPUT_TOKENS_CACHED_ATTRIBUTE,n.deepseek.promptCacheHitTokens),T(e,"gen_ai.usage.input_tokens.cache_miss",n.deepseek.promptCacheMissTokens))}catch{}}(e);for(const t of Object.keys(e))Array.isArray(e[t])&&(e[t]=JSON.stringify(e[t])),t.startsWith("ai.")&&_(e,t,`vercel.${t}`)}function m(e){const{data:t,origin:n}=e;"auto.vercelai.otel"===n&&(e.status&&"ok"!==e.status&&(e.status="internal_error"),g(t))}function _(e,t,n){null!=e[t]&&(e[n]=e[t],delete e[t])}function T(e,t,n){null!=n&&(e[t]=n)}t.addVercelAiProcessors=function(e){e.on("spanStart",h),e.addEventProcessor(Object.assign(f,{id:"VercelAiEventProcessor"})),e.on("processSpan",(e=>{!function(e){const t=e.attributes;if("auto.vercelai.otel"===t?.[s.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]){if(g(t),"gen_ai.execute_tool"===t[s.SEMANTIC_ATTRIBUTE_SENTRY_OP]&&e.parent_span_id){const n=l.toolDescriptionMap.get(e.parent_span_id);if(n){const e=t[o.GEN_AI_TOOL_NAME_ATTRIBUTE];if("string"==typeof e){const r=n.get(e);r&&(t[o.GEN_AI_TOOL_DESCRIPTION_ATTRIBUTE]=r)}}}l.toolDescriptionMap.delete(e.span_id)}}(e)}))},t.processVercelAiSpanAttributes=g},67935(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(24231),s=n(2881),i=n(57471),a=n(87350);function o(e,t){const n=t.get(e.span_id);n&&e.data&&(n.inputTokens>0&&(e.data[r.GEN_AI_USAGE_INPUT_TOKENS_ATTRIBUTE]=n.inputTokens),n.outputTokens>0&&(e.data[r.GEN_AI_USAGE_OUTPUT_TOKENS_ATTRIBUTE]=n.outputTokens),(n.inputTokens>0||n.outputTokens>0)&&(e.data["gen_ai.usage.total_tokens"]=n.inputTokens+n.outputTokens))}function l(e){return e.filter((e=>!!e&&"object"==typeof e&&"role"in e&&"content"in e))}function c(e){try{const t=JSON.parse(e);if(t&&"object"==typeof t){let{messages:e}=t;const{prompt:n,system:r}=t,s=[];if("string"==typeof r&&s.push({role:"system",content:r}),"string"==typeof e)try{e=JSON.parse(e)}catch{}if(Array.isArray(e))return s.push(...l(e)),s;if(Array.isArray(n))return s.push(...l(n)),s;if("string"==typeof n&&s.push({role:"user",content:n}),s.length>0)return s}}catch{}return[]}t._INTERNAL_cleanupToolCallSpanContext=function(e){i.toolCallSpanContextMap.delete(e)},t._INTERNAL_getSpanContextForToolCallId=function(e){return i.toolCallSpanContextMap.get(e)},t.accumulateTokensForParent=function(e,t){const n=e.parent_span_id;if(!n)return;const s=e.data[r.GEN_AI_USAGE_INPUT_TOKENS_ATTRIBUTE],i=e.data[r.GEN_AI_USAGE_OUTPUT_TOKENS_ATTRIBUTE];if("number"==typeof s||"number"==typeof i){const e=t.get(n)||{inputTokens:0,outputTokens:0};"number"==typeof s&&(e.inputTokens+=s),"number"==typeof i&&(e.outputTokens+=i),t.set(n,e)}},t.applyAccumulatedTokens=o,t.applyToolDescriptionsAndTokens=function(e,t){const n=function(e){const t=new Map;for(const n of e){const e=n.data[r.GEN_AI_REQUEST_AVAILABLE_TOOLS_ATTRIBUTE];if("string"==typeof e)try{const n=JSON.parse(e);for(const e of n)e.name&&e.description&&!t.has(e.name)&&t.set(e.name,e.description)}catch{}}return t}(e);for(const s of e){if("gen_ai.execute_tool"===s.op){const e=s.data[r.GEN_AI_TOOL_NAME_ATTRIBUTE];if("string"==typeof e){const t=n.get(e);t&&(s.data[r.GEN_AI_TOOL_DESCRIPTION_ATTRIBUTE]=t)}}"gen_ai.invoke_agent"===s.op&&o(s,t)}},t.convertAvailableToolsToJsonString=function(e){const t=e.map((e=>{if("string"==typeof e)try{return JSON.parse(e)}catch{return e}return e}));return JSON.stringify(t)},t.convertUserInputToMessagesFormat=c,t.requestMessagesFromPrompt=function(e,t,n){if("string"!=typeof t[a.AI_PROMPT_ATTRIBUTE]||t[r.GEN_AI_INPUT_MESSAGES_ATTRIBUTE]||t[a.AI_PROMPT_MESSAGES_ATTRIBUTE]){if
1("string"==typeof t[a.AI_PROMPT_MESSAGES_ATTRIBUTE])try{const i=JSON.parse(t[a.AI_PROMPT_MESSAGES_ATTRIBUTE]);if(Array.isArray(i)){const{systemInstructions:t,filteredMessages:o}=s.extractSystemInstructions(i);t&&e.setAttribute(r.GEN_AI_SYSTEM_INSTRUCTIONS_ATTRIBUTE,t);const l=Array.isArray(o)?o.length:0,c=n?s.getTruncatedJsonString(o):s.getJsonString(o);e.setAttributes({[a.AI_PROMPT_MESSAGES_ATTRIBUTE]:c,[r.GEN_AI_INPUT_MESSAGES_ATTRIBUTE]:c,[r.GEN_AI_INPUT_MESSAGES_ORIGINAL_LENGTH_ATTRIBUTE]:l})}}catch{}}else{const i=c(t[a.AI_PROMPT_ATTRIBUTE]);if(i.length){const{systemInstructions:t,filteredMessages:o}=s.extractSystemInstructions(i);t&&e.setAttribute(r.GEN_AI_SYSTEM_INSTRUCTIONS_ATTRIBUTE,t);const l=Array.isArray(o)?o.length:0,c=n?s.getTruncatedJsonString(o):s.getJsonString(o);e.setAttributes({[a.AI_PROMPT_ATTRIBUTE]:c,[r.GEN_AI_INPUT_MESSAGES_ATTRIBUTE]:c,[r.GEN_AI_INPUT_MESSAGES_ORIGINAL_LENGTH_ATTRIBUTE]:l})}}}},87350(e,t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});t.AI_MODEL_ID_ATTRIBUTE="ai.model.id",t.AI_OPERATION_ID_ATTRIBUTE="ai.operationId",t.AI_PROMPT_ATTRIBUTE="ai.prompt",t.AI_PROMPT_MESSAGES_ATTRIBUTE="ai.prompt.messages",t.AI_PROMPT_TOOLS_ATTRIBUTE="ai.prompt.tools",t.AI_RESPONSE_FINISH_REASON_ATTRIBUTE="ai.response.finishReason",t.AI_RESPONSE_OBJECT_ATTRIBUTE="ai.response.object",t.AI_RESPONSE_PROVIDER_METADATA_ATTRIBUTE="ai.response.providerMetadata",t.AI_RESPONSE_TEXT_ATTRIBUTE="ai.response.text",t.AI_RESPONSE_TOOL_CALLS_ATTRIBUTE="ai.response.toolCalls",t.AI_SCHEMA_ATTRIBUTE="ai.schema",t.AI_TELEMETRY_FUNCTION_ID_ATTRIBUTE="ai.telemetry.functionId",t.AI_TOOL_CALL_ARGS_ATTRIBUTE="ai.toolCall.args",t.AI_TOOL_CALL_ID_ATTRIBUTE="ai.toolCall.id",t.AI_TOOL_CALL_NAME_ATTRIBUTE="ai.toolCall.name",t.AI_TOOL_CALL_RESULT_ATTRIBUTE="ai.toolCall.result",t.AI_USAGE_CACHED_INPUT_TOKENS_ATTRIBUTE="ai.usage.cachedInputTokens",t.AI_USAGE_COMPLETION_TOKENS_ATTRIBUTE="ai.usage.completionTokens",t.AI_USAGE_PROMPT_TOKENS_ATTRIBUTE="ai.usage.promptTokens",t.AI_USAGE_TOKENS_ATTRIBUTE="ai.usage.tokens",t.AI_VALUES_ATTRIBUTE="ai.values",t.OPERATION_NAME_ATTRIBUTE="operation.name"},64450(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(68974),s=n(85110),i=n(99188),a=n(31901),o=n(28119);t.DEFAULT_TRANSPORT_BUFFER_SIZE=64,t.createTransport=function(e,t,n=a.makePromiseBuffer(e.bufferSize||64)){let l={};return{send:function(c){const u=[];if(i.forEachEnvelopeItem(c,((t,n)=>{const r=i.envelopeItemTypeToDataCategory(n);o.isRateLimited(l,r)?e.recordDroppedEvent("ratelimit_backoff",r):u.push(t)})),0===u.length)return Promise.resolve({});const d=i.createEnvelope(c[0],u),h=t=>{i.envelopeContainsItemType(d,["client_report"])?r.DEBUG_BUILD&&s.debug.warn(`Dropping client report. Will not send outcomes (reason: ${t}).`):i.forEachEnvelopeItem(d,((n,r)=>{e.recordDroppedEvent(t,i.envelopeItemTypeToDataCategory(r))}))};return n.add((()=>t({body:i.serializeEnvelope(d)}).then((e=>413===e.statusCode?(r.DEBUG_BUILD&&s.debug.error("Sentry responded with status code 413. Envelope was discarded due to exceeding size limits."),h("send_error"),e):(r.DEBUG_BUILD&&void 0!==e.statusCode&&(e.statusCode<200||e.statusCode>=300)&&s.debug.warn(`Sentry responded with status code ${e.statusCode} to sent event.`),l=o.updateRateLimits(l,e),e)),(e=>{throw h("network_error"),r.DEBUG_BUILD&&s.debug.error("Encountered error running transport request:",e),e})))).then((e=>e),(e=>{if(e===a.SENTRY_BUFFER_FULL_ERROR)return r.DEBUG_BUILD&&s.debug.error("Skipped sending event because buffer is full."),h("queue_overflow"),Promise.resolve({});throw e}))},flush:e=>n.drain(e)}}},14082(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85740),s=n(21811),i=n(99188),a="MULTIPLEXED_TRANSPORT_EXTRA_KEY";function o(e,t){let n;return i.forEachEnvelopeItem(e,((e,r)=>(t.includes(r)&&(n=Array.isArray(e)?e[1]:void 0),!!n))),n}function l(e,t){return i.createEnvelope(t?{...e[0],dsn:t}:e[0],e[1])}t.MULTIPLEXED_TRANSPORT_EXTRA_KEY=a,t.eventFromEnvelope=o,t.makeMultiplexedTransport=function(e,t){return n=>{const i=e(n),c=new Map,u=t||(e=>{const t=e.getEvent();return t?.extra?.[a]&&Array.isArray(t.extra[a])?t.extra[a]:[]});function d(t,i){const a=i?`${t}:${i}`:t;let l=c.get(a);if(!l){const u=s.dsnFromString(t);if(!u)return;const d=r.getEnvelopeEndpointWithUrlEncodedAuth(u,n.tunnel);l=i?function(e,t){return n=>{const r=e(n);return{...r,send:async e=>{const n=o(e,["event","transaction","profile","replay_event"]);return n&&(n.release=t),r.send(e)}}}}(e,i)({...n,url:d}):e({...n,url:d}),c.set(a,l)}return[t,l]}return{send:async function(e){const t=u({envelope:e,getEvent:function(t){return o(e,t?.length?t:["event"])}}).map((e=>"string"==typeof e?d(e,void 0):d(e.dsn,e.release))).filter((e=>!!e)),n=t.length?t:[["",i]],r=await Promise.all(n.map((([t,n])=>n.send(l(e,t)))));return r[0]},flush:async function(e){const t=[...c.values(),i];return(await Promise.all(t.map((t=>t.flush(e))))).every((e=>e))}}}}},52256(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(68974),s=n(85110),i=n(99188),a=n(28119),o=n(41335),l=100,c=5e3;t.MIN_DELAY=l,t.START_DELAY=c,t.makeOfflineTransport=function(e){function t(...e){r.DEBUG_BUILD&&s.debug.log("[Offline]:",...e)}return n=>{const r=e(n);if(!n.createStore)throw new Error("No `createStore` function was provided");const s=n.createStore(n);let u,d=c;function h(e){u&&clearTimeout(u),u=o.safeUnref(setTimeout((async()=>{u=void 0;const e=await s.shift();e&&(t("Attempting to send previously queued event"),e[0].sent_at=(new Date).toISOString(),p(e,!0).catch((e=>{t("Failed to retry sending",e)})))}),e))}function f(){u||(h(d),d=Math.min(2*d,36e5))}async function p(e,o=!1){if(!o&&i.envelopeContainsItemType(e,["replay_event","replay_recording"]))return await s.push(e),h(l),{};
1try{if(n.shouldSend&&!1===await n.shouldSend(e))throw new Error("Envelope not sent because `shouldSend` callback returned false");const t=await r.send(e);let s=l;if(t)if(t.headers?.["retry-after"])s=a.parseRetryAfterHeader(t.headers["retry-after"]);else if(t.headers?.["x-sentry-rate-limits"])s=6e4;else if((t.statusCode||0)>=400)return t;return h(s),d=c,t}catch(r){if(await function(e,t,r){return!i.envelopeContainsItemType(e,["client_report"])&&(!n.shouldStore||n.shouldStore(e,t,r))}(e,r,d))return o?await s.unshift(e):await s.push(e),f(),t("Error sending. Event queued.",r),{};throw r}}return n.flushAtStartup&&f(),{send:p,flush:e=>(void 0===e&&(d=c,h(l)),r.flush(e))}}}},62299(e,t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),t.addUserAgentToTransportHeaders=function(e){const t=e._metadata?.sdk,n=t?.name&&t?.version?`${t?.name}/${t?.version}`:void 0;e.transportOptions={...e.transportOptions,headers:{...n&&{"user-agent":n},...e.transportOptions?.headers}}}},58414(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(49564),s=n(79183),i=n(52751),a=n(88585),o=n(55908),l=n(77765),c={mechanism:{handled:!1,type:"auto.rpc.trpc.middleware"}};t.trpcMiddleware=function(e={}){return async function(t){const{path:n,type:u,next:d,rawInput:h,getRawInput:f}=t,p=r.getClient(),g=p?.getOptions(),m={procedure_path:n,procedure_type:u};if(l.setNormalizationDepthOverrideHint(m,1+(g?.normalizeDepth??5)),(void 0!==e.attachRpcInput?e.attachRpcInput:g?.sendDefaultPii)&&(void 0!==h&&(m.input=a.normalize(h)),void 0!==f&&"function"==typeof f))try{const e=await f();m.input=a.normalize(e)}catch{}return r.withIsolationScope((t=>(t.setContext("trpc",m),o.startSpanManual({name:`trpc/${n}`,op:"rpc.server",attributes:{[i.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]:"route",[i.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]:"auto.rpc.trpc"},forceTransaction:!!e.forceTransaction},(async e=>{try{const t=await d();return function(e){"object"==typeof e&&null!==e&&"ok"in e&&!e.ok&&"error"in e&&s.captureException(e.error,c)}(t),e.end(),t}catch(t){throw s.captureException(t,c),e.end(),t}})))))}}},90153(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(88532);function s(e,t,n,l,c,u,d,h){if(u.length>=n+1)return u;let f=[...u];if(r.isInstanceOf(l[c],Error)){a(d,h,l);const r=e(t,l[c]),i=f.length;o(r,c,i,h),f=s(e,t,n,l[c],c,[r,...f],r,i)}return i(l)&&l.errors.forEach(((i,u)=>{if(r.isInstanceOf(i,Error)){a(d,h,l);const r=e(t,i),p=f.length;o(r,`errors[${u}]`,p,h),f=s(e,t,n,i,c,[r,...f],r,p)}})),f}function i(e){return Array.isArray(e.errors)}function a(e,t,n){e.mechanism={handled:!0,type:"auto.core.linked_errors",...i(n)&&{is_exception_group:!0},...e.mechanism,exception_id:t}}function o(e,t,n,r){e.mechanism={handled:!0,...e.mechanism,type:"chained",source:t,exception_id:n,parent_id:r}}t.applyAggregateErrorsToEvent=function(e,t,n,i,a,o){if(!a.exception?.values||!o||!r.isInstanceOf(o.originalException,Error))return;const l=a.exception.values.length>0?a.exception.values[a.exception.values.length-1]:void 0;l&&(a.exception.values=s(e,t,i,o.originalException,n,a.exception.values,l,0))}},52311(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(68974),s=n(85110),i=new Set;t._INTERNAL_clearAiProviderSkips=function(){i.clear(),r.DEBUG_BUILD&&s.debug.log("Cleared AI provider skip registrations")},t._INTERNAL_shouldSkipAiProviderWrapping=function(e){return i.has(e)},t._INTERNAL_skipAiProviderWrapping=function(e){e.forEach((e=>{i.add(e),r.DEBUG_BUILD&&s.debug.log(`AI provider "${e}" wrapping will be skipped`)}))}},10537(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(69025),s=n(70561);t.callFrameToStackFrame=function(e,t,n){const i=t?t.replace(/^file:\/\//,""):void 0,a=e.location.columnNumber?e.location.columnNumber+1:void 0,o=e.location.lineNumber?e.location.lineNumber+1:void 0;return{filename:i,module:n(i),function:e.functionName||s.UNKNOWN_FUNCTION,colno:a,lineno:o,in_app:i?r.filenameIsInApp(i):void 0}},t.watchdogTimer=function(e,t,n,r){const s=e();let i=!1,a=!0;return setInterval((()=>{const e=s.getTimeMs();!1===i&&e>t+n&&(i=!0,a&&r()),e<t+n&&(i=!1)}),20),{poll:()=>{s.reset()},enabled:e=>{a=e}}}},5684(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(68974),s=n(85110),i=n(88532),a="sentry-";function o(e){if(e&&(i.isString(e)||Array.isArray(e)))return Array.isArray(e)?e.reduce(((e,t)=>{const n=l(t);
1return Object.entries(n).forEach((([t,n])=>{e[t]=n})),e}),{}):l(e)}function l(e){return e.split(",").map((e=>{const t=e.indexOf("=");if(-1===t)return[];return[e.slice(0,t),e.slice(t+1)].map((e=>{try{return decodeURIComponent(e.trim())}catch{return}}))})).reduce(((e,[t,n])=>(t&&n&&(e[t]=n),e)),{})}function c(e){if(0!==Object.keys(e).length)return Object.entries(e).reduce(((e,[t,n],i)=>{const a=`${encodeURIComponent(t)}=${encodeURIComponent(n)}`,o=0===i?a:`${e},${a}`;return o.length>8192?(r.DEBUG_BUILD&&s.debug.warn(`Not adding key: ${t} with val: ${n} to baggage header due to exceeding baggage size limits.`),e):o}),"")}t.MAX_BAGGAGE_STRING_LENGTH=8192,t.SENTRY_BAGGAGE_KEY_PREFIX=a,t.SENTRY_BAGGAGE_KEY_PREFIX_REGEX=/^sentry-/,t.baggageHeaderToDynamicSamplingContext=function(e){const t=o(e);if(!t)return;const n=Object.entries(t).reduce(((e,[t,n])=>{if(t.startsWith(a)){e[t.slice(7)]=n}return e}),{});return Object.keys(n).length>0?n:void 0},t.dynamicSamplingContextToSentryBaggageHeader=function(e){if(!e)return;return c(Object.entries(e).reduce(((e,[t,n])=>(n&&(e[`${a}${t}`]=n),e)),{}))},t.mergeBaggageHeaders=function(e,t){if(!e)return t;const n=o(e),r=o(t);if(!r)return e;const s={};let i=!1;const l={},u={};for(const[e,t]of Object.entries(r))e.startsWith(a)?(l[e]=t,i=!0):u[e]=t;if(n)for(const[e,t]of Object.entries(n))i&&e.startsWith(a)||(s[e]=t);i&&Object.assign(s,l);for(const[e,t]of Object.entries(u))s[e]??=t;return c(s)},t.objectToBaggageHeader=c,t.parseBaggageHeader=o},72833(e,t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),t.getBreadcrumbLogLevelFromHttpStatusCode=function(e){return void 0===e?void 0:e>=400&&e<500?"warning":e>=500?"error":void 0}},3138(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(88532),s=n(73969).GLOBAL_OBJ;function i(e,t){const n=e,i=[];if(!n?.tagName)return"";if(s.HTMLElement&&n instanceof HTMLElement&&n.dataset){if(n.dataset.sentryComponent)return n.dataset.sentryComponent;if(n.dataset.sentryElement)return n.dataset.sentryElement}i.push(n.tagName.toLowerCase());const a=t?.length?t.filter((e=>n.getAttribute(e))).map((e=>[e,n.getAttribute(e)])):null;if(a?.length)a.forEach((e=>{i.push(`[${e[0]}="${e[1]}"]`)}));else{n.id&&i.push(`#${n.id}`);const e=n.className;if(e&&r.isString(e)){const t=e.split(/\s+/);for(const e of t)i.push(`.${e}`)}}for(const e of["aria-label","type","name","title","alt"]){const t=n.getAttribute(e);t&&i.push(`[${e}="${t}"]`)}return i.join("")}t.getComponentName=function(e,t=5){if(!s.HTMLElement)return null;let n=e;for(let e=0;e<t;e++){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},t.getLocationHref=function(){try{return s.document.location.href}catch{return""}},t.htmlTreeAsString=function(e,t={}){if(!e)return"<unknown>";try{let n=e;const r=5,s=[];let a=0,o=0;const l=" > ",c=l.length;let u;const d=Array.isArray(t)?t:t.keyAttrs,h=!Array.isArray(t)&&t.maxStringLength||80;for(;n&&a++<r&&(u=i(n,d),!("html"===u||a>1&&o+s.length*c+u.length>=h));)s.push(u),o+=u.length,n=n.parentNode;return s.reverse().join(l)}catch{return"<unknown>"}}},15470(e,t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const n=e=>e instanceof Promise&&!e[r],r=Symbol("chained PromiseLike"),s=(e,t)=>{if(!t)return e;let n=!1;for(const r in e){if(r in t)continue;n=!0;const s=e[r];"function"==typeof s?Object.defineProperty(t,r,{value:(...t)=>s.apply(e,t),enumerable:!0,configurable:!0,writable:!0}):t[r]=s}return n&&Object.assign(t,{[r]:!0}),t};t.chainAndCopyPromiseLike=(e,t,r)=>{const i=e.then((e=>(t(e),e)),(e=>{throw r(e),e}));return n(i)&&n(e)?i:s(e,i)}},64841(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(99188),s=n(26869);t.createClientReportEnvelope=function(e,t,n){const i=[{type:"client_report"},{timestamp:n||s.dateTimestampInSeconds(),discarded_events:e}];return r.createEnvelope(t?{dsn:t}:{},[i])}},81894(e,t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),t.parseCookie=function(e){const t={};let n=0;for(;n<e.length;){const r=e.indexOf("=",n);if(-1===r)break;let s=e.indexOf(";",n);if(-1===s)s=e.length;else if(s<r){n=e.lastIndexOf(";",r-1)+1;continue}const i=e.slice(n,r).trim();if(void 0===t[i]){let n=e.slice(r+1,s).trim();
134===n.charCodeAt(0)&&(n=n.slice(1,-1));try{t[i]=-1!==n.indexOf("%")?decodeURIComponent(n):n}catch{t[i]=n}}n=s+1}return t}},19367(e,t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),t.debounce=function(e,t,n){let r,s,i;const a=n?.maxWait?Math.max(n.maxWait,t):0,o=n?.setTimeoutImpl||setTimeout;function l(){return c(),r=e(),r}function c(){void 0!==s&&clearTimeout(s),void 0!==i&&clearTimeout(i),s=i=void 0}function u(){return s&&clearTimeout(s),s=o(l,t),a&&void 0===i&&(i=o(l,a)),r}return u.cancel=c,u.flush=function(){return void 0!==s||void 0!==i?l():r},u}},47274(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(70561),s=n(73969);let i,a,o,l;function c(e){const t=s.GLOBAL_OBJ._sentryDebugIds,n=s.GLOBAL_OBJ._debugIds;if(!t&&!n)return{};const r=t?Object.keys(t):[],c=n?Object.keys(n):[];if(l&&r.length===a&&c.length===o)return l;a=r.length,o=c.length,l={},i||(i={});const u=(t,n)=>{for(const r of t){const t=n[r],s=i?.[r];if(s&&l&&t)l[s[0]]=t,i&&(i[r]=[s[0],t]);else if(t){const n=e(r);for(let e=n.length-1;e>=0;e--){const s=n[e],a=s?.filename;if(a&&l&&i){l[a]=t,i[r]=[a,t];break}}}}};return t&&u(r,t),n&&u(c,n),l}t.getDebugImagesForResources=function(e,t){const n=c(e);if(!n)return[];const s=[];for(const e of t){const t=r.normalizeStackTracePath(e);t&&n[t]&&s.push({type:"sourcemap",code_file:e,debug_id:n[t]})}return s},t.getFilenameToDebugIdMap=c},85110(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(73220),s=n(68974),i=n(73969),a={};function o(e){if(!("console"in i.GLOBAL_OBJ))return e();const t=i.GLOBAL_OBJ.console,n={},r=Object.keys(a);r.forEach((e=>{const r=a[e];n[e]=t[e],t[e]=r}));try{return e()}finally{r.forEach((e=>{t[e]=n[e]}))}}function l(){return u().enabled}function c(e,...t){s.DEBUG_BUILD&&l()&&o((()=>{i.GLOBAL_OBJ.console[e](`Sentry Logger [${e}]:`,...t)}))}function u(){return s.DEBUG_BUILD?r.getGlobalSingleton("loggerSettings",(()=>({enabled:!1}))):{enabled:!1}}const d={enable:function(){u().enabled=!0},disable:function(){u().enabled=!1},isEnabled:l,log:function(...e){c("log",...e)},warn:function(...e){c("warn",...e)},error:function(...e){c("error",...e)}};t.CONSOLE_LEVELS=["debug","info","warn","error","log","assert","trace"],t.consoleSandbox=o,t.debug=d,t.originalConsoleMethods=a},21811(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(68974),s=n(85110),i=/^o(\d+)\./,a=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)((?:\[[:.%\w]+\]|[\w.-]+))(?::(\d+))?\/(.+)/;function o(e){const t=a.exec(e);if(!t)return void s.consoleSandbox((()=>{console.error(`Invalid Sentry Dsn: ${e}`)}));const[n,r,i="",o="",c="",u=""]=t.slice(1);let d="",h=u;const f=h.split("/");if(f.length>1&&(d=f.slice(0,-1).join("/"),h=f.pop()),h){const e=h.match(/^\d+/);e&&(h=e[0])}return l({host:o,pass:i,path:d,projectId:h,port:c,protocol:n,publicKey:r})}function l(e){return{protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}function c(e){const t=e.match(i);return t?.[1]}t.dsnFromString=o,t.dsnToString=function(e,t=!1){const{host:n,path:r,pass:s,port:i,projectId:a,protocol:o,publicKey:l}=e;return`${o}://${l}${t&&s?`:${s}`:""}@${n}${i?`:${i}`:""}/${r?`${r}/`:r}${a}`},t.extractOrgIdFromClient=function(e){const t=e.getOptions(),{host:n}=e.getDsn()||{};let r;return t.orgId?r=String(t.orgId):n&&(r=c(n)),r},t.extractOrgIdFromDsnHost=c,t.makeDsn=function(e){const t="string"==typeof e?o(e):l(e);if(t&&function(e){if(!r.DEBUG_BUILD)return!0;const{port:t,projectId:n,protocol:i}=e;return!(["protocol","publicKey","host","projectId"].find((t=>!e[t]&&(s.debug.error(`Invalid Sentry Dsn: ${t} missing`),!0)))||(n.match(/^\d+$/)?function(e){return"http"===e||"https"===e}(i)?t&&isNaN(parseInt(t,10))&&(s.debug.error(`Invalid Sentry Dsn: Invalid port ${t}`),1):(s.debug.error(`Invalid Sentry Dsn: Invalid protocol ${i}`),1):(s.debug.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),1)))}(t))return t}},81857(e,t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),t.getSDKSource=function(){return"npm"}
1,t.isBrowserBundle=function(){return"undefined"!=typeof __SENTRY_BROWSER_BUNDLE__&&!!__SENTRY_BROWSER_BUNDLE__}},83412(e,t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const n=new Set(["false","f","n","no","off","0"]),r=new Set(["true","t","y","yes","on","1"]);t.FALSY_ENV_VALUES=n,t.TRUTHY_ENV_VALUES=r,t.envToBool=function(e,t){const s=String(e).toLowerCase();return!n.has(s)&&(!!r.has(s)||(t?.strict?null:Boolean(e)))}},99188(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(73220),s=n(21811),i=n(88585),a=n(73969);function o(e,t){const n=e[1];for(const e of n){if(t(e,e[0].type))return!0}return!1}function l(e){const t=r.getSentryCarrier(a.GLOBAL_OBJ);return t.encodePolyfill?t.encodePolyfill(e):(new TextEncoder).encode(e)}const c={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"};t.addItemToEnvelope=function(e,t){const[n,r]=e;return[n,[...r,t]]},t.createAttachmentEnvelopeItem=function(e){const t="string"==typeof e.data?l(e.data):e.data;return[{type:"attachment",length:t.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType},t]},t.createEnvelope=function(e,t=[]){return[e,t]},t.createEventEnvelopeHeaders=function(e,t,n,r){const i=e.sdkProcessingMetadata?.dynamicSamplingContext;return{event_id:e.event_id,sent_at:(new Date).toISOString(),...t&&{sdk:t},...!!n&&r&&{dsn:s.dsnToString(r)},...i&&{trace:i}}},t.createSpanEnvelopeItem=function(e){return[{type:"span"},e]},t.envelopeContainsItemType=function(e,t){return o(e,((e,n)=>t.includes(n)))},t.envelopeItemTypeToDataCategory=function(e){return function(e){return e in c}(e)?c[e]:e},t.forEachEnvelopeItem=o,t.getSdkMetadataForEnvelopeHeader=function(e){if(!e?.sdk)return;const{name:t,version:n}=e.sdk;return{name:t,version:n}},t.parseEnvelope=function(e){let t="string"==typeof e?l(e):e;function n(e){const n=t.subarray(0,e);return t=t.subarray(e+1),n}function s(){let e=t.indexOf(10);return e<0&&(e=t.length),JSON.parse(function(e){const t=r.getSentryCarrier(a.GLOBAL_OBJ);return t.decodePolyfill?t.decodePolyfill(e):(new TextDecoder).decode(e)}(n(e)))}const i=s(),o=[];for(;t.length;){const e=s(),t="number"==typeof e.length?e.length:void 0;o.push([e,t?n(t):s()])}return[i,o]},t.serializeEnvelope=function(e){const[t,n]=e;let r=JSON.stringify(t);function s(e){"string"==typeof r?r="string"==typeof e?r+e:[l(r),e]:r.push("string"==typeof e?l(e):e)}for(const e of n){const[t,n]=e;if(s(`\n${JSON.stringify(t)}\n`),"string"==typeof n||n instanceof Uint8Array)s(n);else{let e;try{e=JSON.stringify(n)}catch{e=JSON.stringify(i.normalize(n))}s(e)}}return"string"==typeof r?r:function(e){const t=e.reduce(((e,t)=>e+t.length),0),n=new Uint8Array(t);let r=0;for(const t of e)n.set(t,r),r+=t.length;return n}(r)}},69960(e,t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});class n extends Error{constructor(e,t="warn"){super(e),this.message=e,this.logLevel=t}}t.SentryError=n},27389(e,t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),t.getPossibleEventMessages=function(e){const t=[];e.message&&t.push(e.message);try{const n=e.exception.values[e.exception.values.length-1];n?.value&&(t.push(n.value),n.type&&t.push(`${n.type}: ${n.value}`))}catch{}return t}},93395(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(88532),s=n(96940),i=n(88585),a=n(96159);function o(e,t){return e(t.stack||"",1)}function l(e){return function(e){return r.isError(e)&&"__sentry_fetch_url_host__"in e&&"string"==typeof e.__sentry_fetch_url_host__}(e)?`${e.message} (${e.__sentry_fetch_url_host__})`:e.message}function c(e,t){const n={type:t.name||t.constructor.name,value:l(t)},r=o(e,t);return r.length&&(n.stacktrace={frames:r}),n}function u(e){if("name"in e&&"string"==typeof e.name){let t=`'${e.name}' captured as exception`;return"message"in e&&"string"==typeof e.message&&(t+=` with message '${e.message}'`),t}if("message"in e&&"string"==typeof e.message)return e.message;const t=a.extractExceptionKeysForMessage(e);if(r.isErrorEvent(e))return`Event \`ErrorEvent\` captured as exception with message \`${e.message}\``;const n=function(e){try{const t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{}}(e);return`${n&&"Object"!==n?`'${n}'`:"Object"} captured as exception with keys: ${t}`}function d(e,t,n,s){if(r.isError(n))return[n,void 0];if(t.synthetic=!0,r.isPlainObject(n)){const t=e?.getOptions().normalizeDepth,r={__serialized__:i.normalizeToSize(n,t)},a=function(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)){const n=e[t];if(n instanceof Error)return n}}(n);if(a)return[a,r];const o=u(n),l=s?.syntheticException||new Error(o);return l.message=o,[l,r]}const a=s?.syntheticException||new Error(n);return a.message=`${n}`,[a,void 0]}t._enhanceErrorWithSentryInfo=l,t.eventFromMessage=function(e,t,n="info",i,a){const l={event_id:i?.event_id,level:n};if(a&&i?.syntheticException){const n=o(e,i.syntheticException);n.length&&(l.exception={values:[{value:t,stacktrace:{frames:n}}]},s.addExceptionMechanism(l,{synthetic:!0}))}
1if(r.isParameterizedString(t)){const{__sentry_template_string__:e,__sentry_template_values__:n}=t;return l.logentry={message:e,params:n},l}return l.message=t,l},t.eventFromUnknownInput=function(e,t,n,r){const i=r?.data&&r.data.mechanism||{handled:!0,type:"generic"},[a,o]=d(e,i,n,r),l={exception:{values:[c(t,a)]}};return o&&(l.extra=o),s.addExceptionTypeValue(l,void 0,void 0),s.addExceptionMechanism(l,i),{...l,event_id:r?.event_id}},t.exceptionFromError=c,t.parseStackFrames=o},23513(e,t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),t.replaceExports=function(e,t,n){const r=e[t];if("function"==typeof r){try{e[t]=n}catch{Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0,enumerable:!0})}if(e.default===r)try{e.default=n}catch{Object.defineProperty(e,"default",{value:n,writable:!0,configurable:!0,enumerable:!0})}}}},83609(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(49564),s=n(68974),i=n(85110),a=n(54583),o="flag.evaluation.";function l(e,t,n,r){if("boolean"!=typeof n)return;if(e.length>r)return void(s.DEBUG_BUILD&&i.debug.error(`[Feature Flags] insertToFlagBuffer called on a buffer larger than maxSize=${r}`));const a=e.findIndex((e=>e.flag===t));-1!==a&&e.splice(a,1),e.length===r&&e.shift(),e.push({flag:t,result:n})}t._INTERNAL_FLAG_BUFFER_SIZE=100,t._INTERNAL_MAX_FLAGS_PER_SPAN=10,t._INTERNAL_addFeatureFlagToActiveSpan=function(e,t,n=10){if("boolean"!=typeof t)return;const r=a.getActiveSpan();if(!r)return;const s=a.spanToJSON(r).data;if(`${o}${e}`in s)return void r.setAttribute(`${o}${e}`,t);Object.keys(s).filter((e=>e.startsWith(o))).length<n&&r.setAttribute(`${o}${e}`,t)},t._INTERNAL_copyFlagsFromScopeToEvent=function(e){if(e.type)return e;const t=r.getCurrentScope().getScopeData().contexts.flags,n=t?t.values:[];return n.length?(void 0===e.contexts&&(e.contexts={}),e.contexts.flags={values:[...n]},e):e},t._INTERNAL_insertFlagToScope=function(e,t,n=100){const s=r.getCurrentScope().getScopeData().contexts;s.flags||(s.flags={values:[]}),l(s.flags.values,e,t,n)},t._INTERNAL_insertToFlagBuffer=l},13053(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(79183),s=n(85110),i=n(64548),a=n(73969);async function o(e){try{s.debug.log("Flushing events..."),await r.flush(e),s.debug.log("Done flushing events")}catch(e){s.debug.log("Error while flushing events:\n",e)}}t.flushIfServerless=async function(e={}){const{timeout:t=2e3}=e;if("cloudflareWaitUntil"in e&&"function"==typeof e?.cloudflareWaitUntil)return void e.cloudflareWaitUntil(o(t));if("cloudflareCtx"in e&&"function"==typeof e.cloudflareCtx?.waitUntil)return void e.cloudflareCtx.waitUntil(o(t));if(a.GLOBAL_OBJ[Symbol.for("@vercel/request-context")])return void i.vercelWaitUntil(o(t));if("undefined"==typeof process)return;!!(process.env.FUNCTIONS_WORKER_RUNTIME||process.env.LAMBDA_TASK_ROOT||process.env.K_SERVICE||process.env.CF_PAGES||process.env.VERCEL||process.env.NETLIFY)&&await o(t)}},29057(e,t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),t.getDefaultExport=function(e){return!!e&&"object"==typeof e&&"default"in e&&e.default||e}},76354(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(15470),s=n(88532);t.handleCallbackErrors=function(e,t,n=()=>{},i=()=>{}){let a;try{a=e()}catch(e){throw t(e),n(),e}return function(e,t,n,i){if(s.isThenable(e))return r.chainAndCopyPromiseLike(e,(e=>{n(),i(e)}),(e=>{t(e),n()}));return n(),i(e),e}(a,t,n,i)}},51228(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(49564);t.hasSpansEnabled=function(e){if("boolean"==typeof __SENTRY_TRACING__&&!__SENTRY_TRACING__)return!1;const t=e||r.getClient()?.getOptions();return!(!t||null==t.tracesSampleRate&&!t.tracesSampler)}},78949(e,t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),t.addAutoIpAddressToSession=function(e){"aggregates"in e?void 0===e.attrs?.ip_address&&(e.attrs={...e.attrs,ip_address:"{{auto}}"}):void 0===e.ipAddress&&(e.ipAddress="{{auto}}")},t.addAutoIpAddressToUser=function(e){void 0===e.user?.ip_address&&(e.user={...e.user,ip_address:"{{auto}}"})}},88532(e,t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const n=Object.prototype.toString;function r(e,t){return n.call(e)===`[object ${t}]`}function s(e){return"object"==typeof e&&null!==e&&"__sentry_template_str
1ing__"in e&&"__sentry_template_values__"in e}function i(e){return r(e,"Object")}function a(e,t){try{return e instanceof t}catch{return!1}}t.isDOMError=function(e){return r(e,"DOMError")},t.isDOMException=function(e){return r(e,"DOMException")},t.isElement=function(e){return"undefined"!=typeof Element&&a(e,Element)},t.isError=function(e){switch(n.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return a(e,Error)}},t.isErrorEvent=function(e){return r(e,"ErrorEvent")},t.isEvent=function(e){return"undefined"!=typeof Event&&a(e,Event)},t.isInstanceOf=a,t.isParameterizedString=s,t.isPlainObject=i,t.isPrimitive=function(e){return null===e||s(e)||"object"!=typeof e&&"function"!=typeof e},t.isRegExp=function(e){return r(e,"RegExp")},t.isRequest=function(e){return"undefined"!=typeof Request&&a(e,Request)},t.isString=function(e){return r(e,"String")},t.isSyntheticEvent=function(e){return i(e)&&"nativeEvent"in e&&"preventDefault"in e&&"stopPropagation"in e},t.isThenable=function(e){return Boolean(e?.then&&"function"==typeof e.then)},t.isVueViewModel=function(e){return!("object"!=typeof e||null===e||!(e.__isVue||e._isVue||e.__v_isVNode))}},64702(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(86744),s=n(73969);t.isBrowser=function(){return"undefined"!=typeof window&&(!r.isNodeEnv()||function(){const e=s.GLOBAL_OBJ.process;return"renderer"===e?.type}())}},46877(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(9635);function s(e,t){const n=r.parseStringToURLObject(e);return!(!n||r.isURLObjectRelative(n))&&(!!t&&(s=n.hostname,i=t.host,(s===i||i.length>0&&s.endsWith(`.${i}`))&&/(^|&|\?)sentry_key=/.test(n.search)));var s,i}function i(e){return"/"===e[e.length-1]?e.slice(0,-1):e}t.isSentryRequestUrl=function(e,t){const n=t?.getDsn(),r=t?.getOptions().tunnel;return s(e,n)||function(e,t){if(!t)return!1;return i(e)===i(t)}(e,r)}},43807(e,t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});t.LRUMap=class{constructor(e){this._maxSize=e,this._cache=new Map}get size(){return this._cache.size}get(e){const t=this._cache.get(e);if(void 0!==t)return this._cache.delete(e),this._cache.set(e,t),t}set(e,t){if(this._cache.size>=this._maxSize){const e=this._cache.keys().next().value;this._cache.delete(e)}this._cache.set(e,t)}remove(e){const t=this._cache.get(e);return t&&this._cache.delete(e),t}clear(){this._cache.clear()}keys(){return Array.from(this._cache.keys())}values(){const e=[];return this._cache.forEach((t=>e.push(t))),e}}},19090(e,t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),t.merge=function e(t,n,r=2){if(!n||"object"!=typeof n||r<=0)return n;if(t&&0===Object.keys(n).length)return t;const s={...t};for(const t in n)Object.prototype.hasOwnProperty.call(n,t)&&(s[t]=e(s[t],n[t],r-1));return s}},145(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(20647);t.getTraceMetaTags=function(e){return Object.entries(e||r.getTraceData()).map((([e,t])=>`<meta name="${e}" content="${t}"/>`)).join("\n")}},96940(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(96159),s=n(83031),i=n(79721),a=n(73969);let o;function l(e){return e.exception?.values?.[0]}const c=/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/;function u(e){return parseInt(e||"",10)}function d(e){try{return e.__sentry_captured__}catch{}}t.addContextToFrame=function(e,t,n=5){if(void 0===t.lineno)return;const r=e.length,s=Math.max(Math.min(r-1,t.lineno-1),0);t.pre_context=e.slice(Math.max(0,s-n),s).map((e=>i.snipLine(e,0)));const a=Math.min(r-1,s);t.context_line=i.snipLine(e[a],t.colno||0),t.post_context=e.slice(Math.min(s+1,r),s+1+n).map((e=>i.snipLine(e,0)))},t.addExceptionMechanism=function(e,t){const n=l(e);if(!n)return;const r=n.mechanism;if(n.mechanism={type:"generic",handled:!0,...r,...t},t&&"data"in t){const e={...r?.data,...t.data};n.mechanism.data=e}},t.addExceptionTypeValue=function(e,t,n){const r=e.exception=e.exception||{},s=r.values=r.values||[],i=s[0]=s[0]||{};i.value||(i.value=t||""),i.type||(i.type=n||"Error")},t.checkOrSetAlreadyCaught=function(e){if(d(e))return!0;try{r.addNonEnumerableProperty(e,"__sentry_captured__",!0)}catch{}return!1},t.getEventDescription=function(e){const{message:t,event_id:n}=e;if(t)return t;const r=l(e);return r?r.type&&r.value?`${r.type}: ${r.value}
1`:r.type||r.value||n||"<unknown>":n||"<unknown>"},t.isAlreadyCaptured=d,t.parseSemver=function(e){const t=e.match(c)||[],n=u(t[1]),r=u(t[2]),s=u(t[3]);return{buildmetadata:t[5],major:isNaN(n)?void 0:n,minor:isNaN(r)?void 0:r,patch:isNaN(s)?void 0:s,prerelease:t[4]}},t.uuid4=function(e=function(){const e=a.GLOBAL_OBJ;return e.crypto||e.msCrypto}()){try{if(e?.randomUUID)return s.withRandomSafeContext((()=>e.randomUUID())).replace(/-/g,"")}catch{}return o||(o=[1e7]+1e3+4e3+8e3+1e11),o.replace(/[018]/g,(e=>(e^(16*s.safeMathRandom()&15)>>e/4).toString(16)))}},69025(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(70561);function s(e,t=!1){return!(t||e&&!e.startsWith("/")&&!e.match(/^[A-Z]:/)&&!e.startsWith(".")&&!e.match(/^[a-zA-Z]([a-zA-Z0-9.\-+])*:\/\//))&&void 0!==e&&!e.includes("node_modules/")}function i(e){const t=/^\s*[-]{4,}$/,n=/at (?:async )?(?:(.+?)\s+\()?(?:(.+):(\d+):(\d+)?|([^)]+))\)?/,i=/at (?:async )?(.+?) \(data:(.*?),/;return o=>{const l=o.match(i);if(l)return{filename:`<data:${l[2]}>`,function:l[1]};const c=o.match(n);if(c){let t,n,i,o,l;if(c[1]){i=c[1];let e=i.lastIndexOf(".");if("."===i[e-1]&&e--,e>0){t=i.slice(0,e),n=i.slice(e+1);const r=t.indexOf(".Module");r>0&&(i=i.slice(r+1),t=t.slice(0,r))}o=void 0}n&&(o=t,l=n),"<anonymous>"===n&&(l=void 0,i=void 0),void 0===i&&(l=l||r.UNKNOWN_FUNCTION,i=o?`${o}.${l}`:l);let u=r.normalizeStackTracePath(c[2]);const d="native"===c[5];u||!c[5]||d||(u=c[5]);const h=u?function(e){try{return decodeURI(e)}catch{return}}(u):void 0;return{filename:h??u,module:h&&e?.(h),function:i,lineno:a(c[3]),colno:a(c[4]),in_app:s(u||"",d)}}return o.match(t)?{filename:o}:void 0}}function a(e){return parseInt(e||"",10)||void 0}t.filenameIsInApp=s,t.node=i,t.nodeStackLineParser=function(e){return[90,i(e)]}},86744(e,t,n){e=n.nmd(e),Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(81857);function s(e,t){return e.require(t)}t.isNodeEnv=function(){return!r.isBrowserBundle()&&"[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0)},t.loadModule=function(t,n=e){let r;try{r=s(n,t)}catch{}if(!r)try{const{cwd:e}=s(n,"process");r=s(n,`${e()}/node_modules/${t}`)}catch{}return r}},77765(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(96159),s=Symbol.for("sentry.skipNormalization"),i=Symbol.for("sentry.overrideNormalizationDepth");t.getNormalizationDepthOverrideHint=function(e){const t=e[i];return"number"==typeof t?t:void 0},t.hasSkipNormalizationHint=function(e){return Boolean(e[s])},t.setNormalizationDepthOverrideHint=function(e,t){r.addNonEnumerableProperty(e,i,t)},t.setSkipNormalizationHint=function(e){r.addNonEnumerableProperty(e,s,!0)}},88585(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(88532),s=n(77765),i=n(96159),a=n(70561);function o(e,t=100,n=1/0){try{return l("",e,t,n)}catch(e){return{ERROR:`**non-serializable** (${e})`}}}function l(e,t,o=1/0,c=1/0,u=function(){const e=new WeakSet;function t(t){return!!e.has(t)||(e.add(t),!1)}function n(t){e.delete(t)}return[t,n]}()){const[d,h]=u;if(null==t||["boolean","string"].includes(typeof t)||"number"==typeof t&&Number.isFinite(t))return t;const f=function(e,t){try{if("domain"===e&&t&&"object"==typeof t&&t._events)return"[Domain]";if("domainEmitter"===e)return"[DomainEmitter]";if(void 0!==n.g&&t===n.g)return"[Global]";if("undefined"!=typeof window&&t===window)return"[Window]";if("undefined"!=typeof document&&t===document)return"[Document]";if(r.isVueViewModel(t))return a.getVueInternalName(t);if(r.isSyntheticEvent(t))return"[SyntheticEvent]";if("number"==typeof t&&!Number.isFinite(t))return`[${t}]`;if("function"==typeof t)return`[Function: ${a.getFunctionName(t)}]`;if("symbol"==typeof t)return`[${String(t)}]`;if("bigint"==typeof t)return`[BigInt: ${String(t)}]`;const s=function(e){const t=Object.getPrototypeOf(e);return t?.constructor?t.constructor.name:"null prototype"}(t);return/^HTML(\w*)Element$/.test(s)?`[HTMLElement: ${s}]`:`[object ${s}]`}catch(e){return`**non-serializable** (${e})`}}(e,t);if(!f.startsWith("[object "))return f;if(s.hasSkipNormalizationHint(t))return t;const p=s.getNormalizationDepthOverrideHint(t),g=void 0!==p?p:o;if(0===g)return f.replace("object ","");if(d(t))return"[Circular ~]";const m=t;if(m&&"function"==typeof m.toJSON)try{return l("",m.toJSON(),g-1,c,u)}catch{}const _=Array.isArray(t)?[]:{};let T=0;const E=i.convertToPlainObject(t);for(const e in E){if(!Object.prototype.hasOwnProperty.call(E,e))continue;if(T>=c){_[e]="[MaxProperties ~]";break}const t=E[e];_[e]=l(e,t,g-1,c,u),T++}return h(t),_}t.normalize=o,t.normalizeToSize=function e(t,n=3,r=102400){const s=o(t,n);return i=s,function(e){return~-encodeURI(e).split(/%..|./).length}(JSON.stringify(i))>r?e(t,n-1,r):s;var i},t.normalizeUrlToBase=function(e,t){const n=t.replace(/\\/g,"/").replace(/[|\\{}()[\]^$+*?.]/g,"\\$&");let r=e;try{r=decodeURI(e)}catch{}return r.replace(/\\/g,"/").replace(/webpack:\/?/g,"").replace(new RegExp(`(file://)?/*${n}/*`,"ig"),"app:///")}},96159(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(68974),s=n(3138),i=n(85110),a=n(88532);function o(e,t,n){try{Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0})}catch{r.DEBUG_BUILD&&i.debug.log(`Failed to add non-enumerable property "${String(t)}" to object`,e)}}function l(e,t){try{const n=t.prototype||{};e.prototype=t.prototype=n,o(e,"__sentry_original__",t)}catch{}}function c(e){return e.__sentry_original__}function u(e){if(a.isError(e))return{message:e.message,name:e.name,stack:e.stack,...h(e)};if(a.isEvent(e)){const t={type:e.type,target:d(e.target),currentTarget:d(e.currentTarget),...h(e)};return"undefined"!=typeof CustomEvent&&a.isInstanceOf(e,CustomEvent)&&(t.detail=e.detail),t}return e}function d(e){try{return a.isElement(e)?s.htmlTreeAsString(e):Object.prototype.toString.call(e)}catch{return"<unknown>"}}function h(e){return"object"==typeof e&&null!==e?Object.fromEntries(Object.entries(e)):{}}function f(e,t){if(null===e||"object"!=typeof e)return e;const n=t.get(e);if(void 0!==n)return n;if(Array.isArray(e)){const n=[];return t.set(e,n),e.forEach((e=>{n.push(f(e,t))})),n}if(function(e){const t=e.constructor;return t===Object||void 0===t}(e)){const n={};t.set(e,n);return Object.keys(e).forEach((r=>{const s=e[r];void 0!==s&&(n[r]=f(s,t))})),n}return e}t.addNonEnumerableProperty=o,t.convertToPlainObject=u,t.dropUndefinedKeys=function(e){return f(e,new Map)},t.extractExceptionKeysForMessage=function(e){const t=Object.keys(u(e));return t.sort(),t[0]?t.join(", "):"[object has no keys]"},t.fill=function(e,t,n){if(!(t in e))return;const s=e[t];if("function"!=typeof s)return;const a=n(s);"function"==typeof a&&l(a,s);try{e[t]=a}catch{r.DEBUG_BUILD&&i.debug.log(`Failed to replace method "${t}" in object`,e)}},t.getOriginalFunction=c,t.markFunctionWrapped=l,t.objectify=function(e){let t;switch(!0){case null==e:t=new String(e);break;case"symbol"==typeof e||"bigint"==typeof e:t=Object(e);break;case a.isPrimitive(e):t=new e.constructor(e);break;default:t=e}return t},t.wrapMethod=function(e,t,n,r=!0){const s=e[t];if("function"!=typeof s)throw new Error(`Cannot wrap method: ${t} is not a function`);if(c(s))throw new Error(`Attempting to wrap method ${t} multiple times`);l(n,s),Object.defineProperty(e,t,{writable:!0,configurable:!0,enumerable:r,value:n})}},72979(e,t){function n(e,...t){const n=new String(String.raw(e,...t));
1return n.__sentry_template_string__=e.join("\0").replace(/%/g,"%%").replace(/\0/g,"%s"),n.__sentry_template_values__=t,n}Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n;t.fmt=r,t.parameterize=n},10393(e,t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),t.parseSampleRate=function(e){if("boolean"==typeof e)return Number(e);const t="string"==typeof e?parseFloat(e):e;return"number"!=typeof t||isNaN(t)||t<0||t>1?void 0:t}},73155(e,t){function n(e,t){let n=0;for(let t=e.length-1;t>=0;t--){const r=e[t];"."===r?e.splice(t,1):".."===r?(e.splice(t,1),n++):n&&(e.splice(t,1),n--)}if(t)for(;n--;n)e.unshift("..");return e}Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=/^(\S+:\\|\/?)([\s\S]*?)((?:\.{1,2}|[^/\\]+?|)(\.[^./\\]*|))(?:[/\\]*)$/;function s(e){const t=e.length>1024?`<truncated>${e.slice(-1024)}`:e,n=r.exec(t);return n?n.slice(1):[]}function i(...e){let t="",r=!1;for(let n=e.length-1;n>=-1&&!r;n--){const s=n>=0?e[n]:"/";s&&(t=`${s}/${t}`,r="/"===s.charAt(0))}return t=n(t.split("/").filter((e=>!!e)),!r).join("/"),(r?"/":"")+t||"."}function a(e){let t=0;for(;t<e.length&&""===e[t];t++);let n=e.length-1;for(;n>=0&&""===e[n];n--);return t>n?[]:e.slice(t,n-t+1)}function o(e){const t=l(e),r="/"===e.slice(-1);let s=n(e.split("/").filter((e=>!!e)),!t).join("/");return s||t||(s="."),s&&r&&(s+="/"),(t?"/":"")+s}function l(e){return"/"===e.charAt(0)}t.basename=function(e,t){let n=s(e)[2]||"";return t&&n.slice(-1*t.length)===t&&(n=n.slice(0,n.length-t.length)),n},t.dirname=function(e){const t=s(e),n=t[0]||"";let r=t[1];return n||r?(r&&(r=r.slice(0,r.length-1)),n+r):"."},t.isAbsolute=l,t.join=function(...e){return o(e.join("/"))},t.normalizePath=o,t.relative=function(e,t){e=i(e).slice(1),t=i(t).slice(1);const n=a(e.split("/")),r=a(t.split("/")),s=Math.min(n.length,r.length);let o=s;for(let e=0;e<s;e++)if(n[e]!==r[e]){o=e;break}let l=[];for(let e=o;e<n.length;e++)l.push("..");return l=l.concat(r.slice(o)),l.join("/")},t.resolve=i},31485(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(42501),s=n(51929),i=n(69640),a=n(47274),o=n(96940),l=n(88585),c=n(37402),u=n(79721),d=n(94486),h=n(26869);function f(e,t){const{environment:n,release:s,dist:i,maxValueLength:a}=t;e.environment=e.environment||n||r.DEFAULT_ENVIRONMENT,!e.release&&s&&(e.release=s),!e.dist&&i&&(e.dist=i);const o=e.request;o?.url&&a&&(o.url=u.truncate(o.url,a)),a&&e.exception?.values?.forEach((e=>{e.value&&(e.value=u.truncate(e.value,a))}))}function p(e,t){const n=a.getFilenameToDebugIdMap(t);e.exception?.values?.forEach((e=>{e.stacktrace?.frames?.forEach((e=>{e.filename&&(e.debug_id=n[e.filename])}))}))}function g(e){const t={};if(e.exception?.values?.forEach((e=>{e.stacktrace?.frames?.forEach((e=>{e.debug_id&&(e.abs_path?t[e.abs_path]=e.debug_id:e.filename&&(t[e.filename]=e.debug_id),delete e.debug_id)}))})),0===Object.keys(t).length)return;e.debug_meta=e.debug_meta||{},e.debug_meta.images=e.debug_meta.images||[];const n=e.debug_meta.images;Object.entries(t).forEach((([e,t])=>{n.push({type:"sourcemap",code_file:e,debug_id:t})}))}function m(e,t){if(!t)return e;const n=e?e.clone():new i.Scope;return n.update(t),n}const _=["user","level","extra","contexts","tags","fingerprint","propagationContext"];t.applyClientOptions=f,t.applyDebugIds=p,t.applyDebugMeta=g,t.parseEventHintOrCaptureContext=function(e){if(e)return function(e){return e instanceof i.Scope||"function"==typeof e}(e)||function(e){return Object.keys(e).some((e=>_.includes(e)))}(e)?{captureContext:e}:e},t.prepareEvent=function(e,t,n,r,i,a){const{normalizeDepth:u=3,normalizeMaxBreadth:_=1e3}=e,T={...t,event_id:t.event_id||n.event_id||o.uuid4(),timestamp:t.timestamp||h.dateTimestampInSeconds()},E=n.integrations||e.integrations.map((e=>e.name));f(T,e),function(e,t){t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=[...e.sdk.integrations||[],...t])}(T,E),i&&i.emit("applyFrameMetadata",t),void 0===t.type&&p(T,e.stackParser);const y=m(r,n.captureContext);n.mechanism&&o.addExceptionMechanism(T,n.mechanism);const S=i?i.getEventProcessors():[],v=c.getCombinedScopeData(a,y),b=[...n.attachments||[],...v.attachments];
1b.length&&(n.attachments=b),c.applyScopeDataToEvent(T,v);const I=[...S,...v.eventProcessors];return(n.data&&!0===n.data.__sentry__?d.resolvedSyncPromise(T):s.notifyEventProcessors(I,T,n)).then((e=>(e&&g(e),"number"==typeof u&&u>0?function(e,t,n){if(!e)return null;const r={...e,...e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map((e=>({...e,...e.data&&{data:l.normalize(e.data,t,n)}})))},...e.user&&{user:l.normalize(e.user,t,n)},...e.contexts&&{contexts:l.normalize(e.contexts,t,n)},...e.extra&&{extra:l.normalize(e.extra,t,n)}};e.contexts?.trace&&r.contexts&&(r.contexts.trace=e.contexts.trace,e.contexts.trace.data&&(r.contexts.trace.data=l.normalize(e.contexts.trace.data,t,n)));e.spans&&(r.spans=e.spans.map((e=>({...e,...e.data&&{data:l.normalize(e.data,t,n)}}))));e.contexts?.flags&&r.contexts&&(r.contexts.flags=l.normalize(e.contexts.flags,3,n));return r}(e,u,_):e)))}},31901(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(94486),s=n(41335),i=Symbol.for("SentryBufferFullError");t.SENTRY_BUFFER_FULL_ERROR=i,t.makePromiseBuffer=function(e=100){const t=new Set;function n(e){t.delete(e)}return{get $(){return Array.from(t)},add:function(s){if(!(t.size<e))return r.rejectedSyncPromise(i);const a=s();return t.add(a),a.then((()=>n(a)),(()=>n(a))),a},drain:function(e){if(!t.size)return r.resolvedSyncPromise(!0);const n=Promise.allSettled(Array.from(t)).then((()=>!0));if(!e)return n;const i=[n,new Promise((t=>s.safeUnref(setTimeout((()=>t(!1)),e))))];return Promise.race(i)}}}},58913(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(96940);t.generateSpanId=function(){return r.uuid4().substring(16)},t.generateTraceId=function(){return r.uuid4()}},83031(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(73969);let s;function i(e){if(void 0!==s)return s?s(e):e();const t=Symbol.for("__SENTRY_SAFE_RANDOM_ID_WRAPPER__"),n=r.GLOBAL_OBJ;return t in n&&"function"==typeof n[t]?(s=n[t],s(e)):(s=null,e())}t.safeDateNow=function(){return i((()=>Date.now()))},t.safeMathRandom=function(){return i((()=>Math.random()))},t.withRandomSafeContext=i},28119(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(83031);function s(e,t=r.safeDateNow()){const n=parseInt(`${e}`,10);if(!isNaN(n))return 1e3*n;const s=Date.parse(`${e}`);return isNaN(s)?6e4:s-t}function i(e,t){return e[t]||e.all||0}t.DEFAULT_RETRY_AFTER=6e4,t.disabledUntil=i,t.isRateLimited=function(e,t,n=r.safeDateNow()){return i(e,t)>n},t.parseRetryAfterHeader=s,t.updateRateLimits=function(e,{statusCode:t,headers:n},i=r.safeDateNow()){const a={...e},o=n?.["x-sentry-rate-limits"],l=n?.["retry-after"];if(o)for(const e of o.trim().split(",")){const[t,n,,,r]=e.split(":",5),s=parseInt(t,10),o=1e3*(isNaN(s)?60:s);if(n)for(const e of n.split(";"))"metric_bucket"===e&&r&&!r.split(";").includes("custom")||(a[e]=i+o);else a.all=i+o}else l?a.all=i+s(l,i):429===t&&(a.all=i+6e4);return a}},56011(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(68974),s=n(85110),i=n(41335),a=1048576,o=["text/","application/json","application/x-www-form-urlencoded","application/xml","application/graphql"];function l(e){return"small"===e?1e3:"medium"===e?1e4:a}function c(e){const t={};try{e.forEach(((e,n)=>{"string"==typeof e&&(t[n]=e)}))}catch{}return t}function u(e){const t=Object.create(null);try{Object.entries(e).forEach((([e,n])=>{"string"==typeof n&&(t[e]=n)}))}catch{}return t}const d=["auth","token","secret","session","password","passwd","pwd","key","jwt","bearer","sso","saml","csrf","xsrf","credentials","set-cookie","cookie"],h=[".sid","sessid","remember","oidc","pkce","nonce","__secure-","__host-","awsalb","awselb","akamai","__stripe","cognito","firebase","supabase","sb-","mfa","2fa"],f=["x-forwarded-","-user"];function p(e){return e.replace(/-/g,"_")}function g({spanAttributes:e,headerKey:t,cookieKey:n,value:r,sendDefaultPii:s,lifecycle:i}){const a=function(e,t,n,r=!1){const s=r?[...d,...h]:d;if(n?s.some((t=>e.includes(t))):[...f,...s].some((t=>e.includes(t))))return"[Filtered]";if(Array.isArray(t))return t.map((e=>null!=e?String(e):e)).join(";");if("string"==typeof t)return t;return}(n||t,r,s,Boolean(n));if(null==a)return;e[`http.${i}.header.${p(t)}${n?`.${p(n)}`:""}`]=a}function m(e){if(e)try{const t=new URL(e,"http://s.io").search.slice(1);return t.length?t:void 0}catch{return}}t.MAX_BODY_BYTE_LENGTH=a,t.captureBodyFromWinterCGRequest=async function(e,t,n){try{const c=e.headers.get("content-type");if(!function(e){if(!e)return!1;const t=e.toLowerCase();return o.some((e=>t.includes(e)))}(c))return void(r.DEBUG_BUILD&&s.debug.log("Skipping body capture for non-textual content type:",c));if(!e.body)return;const u=e.headers.get("content-length"),d=l(n);if(u){const e=parseInt(u,10);if(!isNaN(e)&&e>a)return void(r.DEBUG_BUILD&&s.debug.log("Skipping body capture: body too large",e))}const h=e.clone().text(),f=new Promise((e=>{i.safeUnref(setTimeout((()=>e(null)),2e3))})),p=await Promise.race([h,f]);if(null===p)return void(r.DEBUG_BUILD&&s.debug.log("Timeout reading request body"));if(!p)return;const g=(new TextEncoder).encode(p),m=g.length;let _;if(m>d){_=`${(new TextDecoder).decode(g.slice(0,d-3))}...`}else _=p;t.setSDKProcessingMetadata({normalizedRequest:{data:_}}),r.DEBUG_BUILD&&s.debug.log("Captured request body:",m,"bytes")}catch(e){r.DEBUG_BUILD&&s.debug.error("Error capturing request body:",e)}},t.extractQueryParamsFromUrl=m,t.getMaxBodyByteLength=l,t.headersToDict=u,t.httpHeadersToSpanAttributes=function(e,t=!1,n="request"){const r={};try{Object.entries(e).forEach((([e,s])=>{if(null==s)return;const i=e.toLowerCase();if(("cookie"===i||"set-cookie"===i)&&"string"==typeof s&&""!==s){const e="set-cookie"===i,a=s.indexOf(";"),o=e&&-1!==a?s.substring(0,a):s,l=e?[o]:o.split("; ");for(const e of l){const s=e.indexOf("="),a=-1!==s?e.substring(0,s):e,o=-1!==s?e.substring(s+1):"",l=a.toLowerCase();g({spanAttributes:r,headerKey:i,cookieKey:l,value:o,sendDefaultPii:t,lifecycle:n})}}else g({spanAttributes:r,headerKey:i,value:s,sendDefaultPii:t,lifecycle:n})}))}catch{}return r},t.httpRequestToRequestData=function(e){const t=e.headers||{},n=("string"==typeof t["x-forwarded-host"]?t["x-forwarded-host"]:void 0)||("string"==typeof t.host?t.host:void 0),r=("string"==typeof t["x-forwarded-proto"]?t["x-forwarded-proto"]:void 0)||e.protocol||(e.socket?.encrypted?"https":"http"),s=e.url||"",i=function({url:e,protocol:t,host:n}){if(e?.startsWith("http"))return e;if(e&&n)return`${t}://${n}${e}`;return}({url:s,host:n,protocol:r}),a=e.body||void 0,o=e.cookies;return{url:i,method:e.method,query_string:m(s),headers:u(t),cookies:o,data:a}},t.winterCGHeadersToDict=c,t.winterCGRequestToRequestData=function(e){const t=c(e.headers);return{method:e.method,url:e.url,query_string:m(e.url),headers:t}}},37402(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(49564),s=n(93754),i=n(19090),a=n(54583);function o(e,t){const{extra:n,tags:r,attributes:s,user:a,contexts:o,level:c,sdkProcessingMetadata:u,breadcrumbs:d,fingerprint:h,eventProcessors:f,attachments:p,propagationContext:g,transactionName:m,span:_}=t;l(e,"extra",n),l(e,"tags",r),l(e,"attributes",s),l(e,"user",a),l(e,"contexts",o),e.sdkProcessingMetadata=i.merge
1(e.sdkProcessingMetadata,u,2),c&&(e.level=c),m&&(e.transactionName=m),_&&(e.span=_),d.length&&(e.breadcrumbs=[...e.breadcrumbs,...d]),h.length&&(e.fingerprint=[...e.fingerprint,...h]),f.length&&(e.eventProcessors=[...e.eventProcessors,...f]),p.length&&(e.attachments=[...e.attachments,...p]),e.propagationContext={...e.propagationContext,...g}}function l(e,t,n){e[t]=i.merge(e[t],n,1)}t.applyScopeDataToEvent=function(e,t){const{fingerprint:n,span:r,breadcrumbs:i,sdkProcessingMetadata:o}=t;!function(e,t){const{extra:n,tags:r,user:s,contexts:i,level:a,transactionName:o}=t;Object.keys(n).length&&(e.extra={...n,...e.extra});Object.keys(r).length&&(e.tags={...r,...e.tags});Object.keys(s).length&&(e.user={...s,...e.user});Object.keys(i).length&&(e.contexts={...i,...e.contexts});a&&(e.level=a);o&&"transaction"!==e.type&&(e.transaction=o)}(e,t),r&&function(e,t){e.contexts={trace:a.spanToTraceContext(t),...e.contexts},e.sdkProcessingMetadata={dynamicSamplingContext:s.getDynamicSamplingContextFromSpan(t),...e.sdkProcessingMetadata};const n=a.getRootSpan(t),r=a.spanToJSON(n).description;r&&!e.transaction&&"transaction"===e.type&&(e.transaction=r)}(e,r),function(e,t){e.fingerprint=e.fingerprint?Array.isArray(e.fingerprint)?e.fingerprint:[e.fingerprint]:[],t&&(e.fingerprint=e.fingerprint.concat(t));e.fingerprint.length||delete e.fingerprint}(e,n),function(e,t){const n=[...e.breadcrumbs||[],...t];e.breadcrumbs=n.length?n:void 0}(e,i),function(e,t){e.sdkProcessingMetadata={...e.sdkProcessingMetadata,...t}}(e,o)},t.getCombinedScopeData=function(e,t){const n=r.getGlobalScope().getScopeData();return e&&o(n,e.getScopeData()),t&&o(n,t.getScopeData()),n},t.mergeAndOverwriteScopeData=l,t.mergeScopeData=o},55303(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(6102);t.applySdkMetadata=function(e,t,n=[t],s="npm"){const i=(e._metadata=e._metadata||{}).sdk=e._metadata.sdk||{};i.name||(i.name=`sentry.javascript.${t}`,i.packages=n.map((e=>({name:`${s}:@sentry/${e}`,version:r.SDK_VERSION}))),i.version=r.SDK_VERSION)}},89499(e,t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),t.severityLevelFromString=function(e){return"warn"===e?"warning":["fatal","error","warning","log","info","debug"].includes(e)?e:"log"}},87687(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(68974),s=n(85110),i=n(79721);function a(e){s.debug.log(`Ignoring span ${e.op} - ${e.description} because it matches \`ignoreSpans\`.`)}function o(e,t){return"string"==typeof e&&("string"==typeof t||t instanceof RegExp)?i.isMatchingPattern(e,t):Array.isArray(e)&&Array.isArray(t)?e.length===t.length&&e.every(((e,n)=>e===t[n])):e===t}t.reparentChildSpans=function(e,t){const n=t.parent_span_id,r=t.span_id;if(n)for(const t of e)t.parent_span_id===r&&(t.parent_span_id=n)},t.shouldIgnoreSpan=function(e,t){if(!t?.length)return!1;for(const s of t){if("string"==typeof(n=s)||n instanceof RegExp){if(e.description&&i.isMatchingPattern(e.description,s))return r.DEBUG_BUILD&&a(e),!0;continue}const t=!!s.attributes&&Object.keys(s.attributes).length>0;if(!s.name&&!s.op&&!t)continue;const l=!s.name||e.description&&i.isMatchingPattern(e.description,s.name),c=!s.op||e.op&&i.isMatchingPattern(e.op,s.op),u=!s.attributes||Object.entries(s.attributes).every((([t,n])=>o(e.attributes?.[t],n)));if(l&&c&&u)return r.DEBUG_BUILD&&a(e),!0}var n;return!1}},64865(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(96159),s="_sentrySpan";t._getSpanForScope=function(e){return e[s]},t._setSpanForScope=function(e,t){t?r.addNonEnumerableProperty(e,s,t):delete e[s]}},54583(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(42810),s=n(22147),i=n(73220),a=n(49564),o=n(52751),l=n(15363),c=n(64284),u=n(96159),d=n(58913),h=n(26869),f=n(23336),p=n(85110),g=n(64865);let m=!1;function _(e){return e&&e.length>0?e.map((({context:{spanId:e,traceId:t,traceFlags:n,...r},attributes:s})=>({span_id:e,trace_id:t,sampled:1===n,attributes:s,...r}))):void 0}function T(e){return e?.length?e.map((({context:{spanId:e,traceId:t,traceFlags:n},attributes:r})=>({span_id:e,trace_id:t,sampled:1===n,attributes:r}))):void 0}function E(e){return"number"==typeof e?y(e):Array.isArray(e)?e[0]+e[1]/1e9:e instanceof Date?y(e.getTime()):h.timestampInSeconds()}function y(e){return e>9999999999?e/1e3:e}function S(e){if(I(e))return e.getSpanJSON();const{spanId:t,traceId:n}=e.spanContext();if(b(e)){const{attributes:r,startTime:s,name:i,endTime:a,status:l,links:c}=e;return{span_id:t,trace_id:n,data:r,description:i,parent_span_id:v(e),start_timestamp:E(s),timestamp:E(a)||void 0,status:R(l),op:r[o.SEMANTIC_ATTRIBUTE_SENTRY_OP],origin:r[o.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN],links:_(c)}}return{span_id:t,trace_id:n,start_timestamp:0,data:{}}}function v(e){return"parentSpanId"in e?e.parentSpanId:"parentSpanContext"in e?e.parentSpanContext?.spanId:void 0}function b(e){const t=e;return!!(t.attributes&&t.startTime&&t.name&&t.endTime&&t.status)}function I(e){return"function"==typeof e.getSpanJSON}function A(e){const{traceFlags:t}=e.spanContext();return 1===t}function R(e){if(e&&e.code!==l.SPAN_STATUS_UNSET)return e.code===l.SPAN_STATUS_OK?"ok":e.message||"internal_error"}function C(e){return e&&e.code!==l.SPAN_STATUS_OK&&e.code!==l.SPAN_STATUS_UNSET&&"cancelled"!==e.message?"error":"ok"}const k="_sentryChildSpans",L="_sentryRootSpan";const O=N;function N(e){return e[L]||e}t.INTERNAL_getSegmentSpan=N,t.TRACE_FLAG_NONE=0,t.TRACE_FLAG_SAMPLED=1,t.addChildSpanToSpan=function(e,t){const n=e[L]||e;u.addNonEnumerableProperty(t,L,n),e[k]?e[k].add(t):u.addNonEnumerableProperty(e,k,new Set([t]))},t.convertSpanLinksForEnvelope=_,t.getActiveSpan=function(){const e=i.getMainCarrier(),t=r.getAsyncContextStrategy(e);return t.getActiveSpan?t.getActiveSpan():g._getSpanForScope(a.getCurrentScope())},t.getRootSpan=O,t.getSimpleStatusMessage=C,t.getSpanDescendants=function(e){const t=new Set;return function e(n){if(!t.has(n)&&A(n)){t.add(n);const r=n[k]?Array.from(n[k]):[];for(const t of r)e(t)}}(e),Array.from(t)},t.getStatusMessage=R,t.getStreamedSpanLinks=T,t.removeChildSpanFromSpan=function(e,t){e[k]&&e[k].delete(t)},t.showSpanDropWarning=function(){m||(p.consoleSandbox((()=>{console.warn("[Sentry] Returning null from `beforeSendSpan` is disallowed. To drop certain spans, configure the respective integrations directly or use `ignoreSpans`.")})),m=!0)},t.spanIsSampled=A,t.spanTimeInputToSeconds=E,t.spanToJSON=S,t.spanToStreamedSpanJSON=function(e){if(I(e))return e.getStreamedSpanJSON();const{spanId:t,traceId:n}=e.spanContext();if(b(e)){const{attributes:r,startTime:s,name:i,endTime:a,status:o,links:l}=e;return{name:i,span_id:t,trace_id:n,parent_span_id:v(e),start_timestamp:E(s),end_timestamp:E(a),is_segment:e===N(e),status:C(o),attributes:r,links:T(l)}}return{span_id:t,trace_id:n,start_timestamp:0,name:"",end_timestamp:0,status:"ok",is_segment:e===N(e)}},t.spanToTraceContext=function(e){const{spanId:t,traceId:n,isRemote:r}=e.spanContext(),s=r?t:S(e).parent_span_id,i=c.getCapturedScopesOnSpan(e).scope;return{parent_span_id:s,span_id:r?i?.getPropagationContext().propagationSpanId||d.generateSpanId():t,trace_id:n}},t.spanToTraceHeader=function(e){const{traceId:t,spanId:n}=e.spanContext(),r=A(e);return f.generateSentryTraceHeader(t,n,r)},t.spanToTraceparentHeader=function(e){const{traceId:t,spanId:n}=e.spanContext(),r=A(e);return f.generateTraceparentHeader(t,n,r)},t.spanToTransactionTraceContext=function(e){const{spanId:t,traceId:n}=e.spanContext(),{data:r,op:s,parent_span_id:i,status:a,origin:o,links:l}=S(e);return{parent_span_id:i,span_id:t,trace_id:n,data:r,op:s,status:a,origin:o,links:l}},t.streamedSpanJsonToSerializedSpan=function(e){return{...e,attributes:s.serializeAttributes(e.attributes),links:e.links?.map((e=>({...e,attributes:s.serializeAttributes(e.attributes)})))}},t.updateSpanName=function(e,t){e.updateName(t),e.setAttributes({[o.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]:"custom",[o.SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME]:t})}},70561(e,t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const n=/\(error: (.*)\)/,r=/captureMessage|captureException/;function s(...e){const t=e.sort(((e,t)=>e[0]-t[0])).map((e=>e[1]));return(e,r=0,s=0)=>{const a=[],o=e.split("\n");for(let e=r;e<o.length;e++){let r=o[e];r.length>1024&&(r=r.slice(0,1024));const i=n.test(r)?r.replace(n,"$1"):r;if(!i.includes("Error: ")){for(const e of t){const t=e(i);if(t){a.push(t);break}}if(a.length>=50+s)break}}return i(a.slice(s))}}function i(e){if(!e.length)return[];const t=Array.from(e);return/sentryWrapped/.test(a(t).function||"")&&t.pop(),t.reverse(),r.test(a(t).function||"")&&(t.pop(),r.test(a(t).function||"")&&t.pop()),t.slice(0,50).map((e=>({...e,filename:e.filename||a(t).filename,function:e.function||"?"})))}function a(e){return e[e.length-1]||{}}const o="<anonymous>";t.UNKNOWN_FUNCTION="?",t.createStackParser=s,t.getFramesFromEvent=function(e){const t=e.exception;if(t){const e=[];
1try{return t.values.forEach((t=>{t.stacktrace.frames&&e.push(...t.stacktrace.frames)})),e}catch{return}}},t.getFunctionName=function(e){try{return e&&"function"==typeof e&&e.name||o}catch{return o}},t.getVueInternalName=function(e){return"__v_isVNode"in e&&e.__v_isVNode?"[VueVNode]":"[VueViewModel]"},t.normalizeStackTracePath=function(e){let t=e?.startsWith("file://")?e.slice(7):e;return t?.match(/\/[A-Z]:/)&&(t=t.slice(1)),t},t.stackParserFromStackParserOptions=function(e){return Array.isArray(e)?s(...e):e},t.stripSentryFramesAndReverse=i},79721(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(88532),s=n(70561);function i(e,t,n=!1){return!!r.isString(e)&&(r.isRegExp(t)?t.test(e):r.isString(t)?n?e===t:e.includes(t):"function"==typeof t&&t(e))}t.isMatchingPattern=i,t.safeJoin=function(e,t){if(!Array.isArray(e))return"";const n=[];for(let t=0;t<e.length;t++){const i=e[t];try{r.isVueViewModel(i)?n.push(s.getVueInternalName(i)):n.push(String(i))}catch{n.push("[value cannot be serialized]")}}return n.join(t)},t.snipLine=function(e,t){let n=e;const r=n.length;if(r<=150)return n;t>r&&(t=r);let s=Math.max(t-60,0);s<5&&(s=0);let i=Math.min(s+140,r);return i>r-5&&(i=r),i===r&&(s=Math.max(i-140,0)),n=n.slice(s,i),s>0&&(n=`'{snip} ${n}`),i<r&&(n+=" {snip}"),n},t.stringMatchesSomePattern=function(e,t=[],n=!1){for(const r of t)if(i(e,r,n))return!0;return!1},t.truncate=function(e,t=0){return"string"!=typeof e||0===t||e.length<=t?e:`${e.slice(0,t)}...`}},21148(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(68974),s=n(85110),i=n(73969).GLOBAL_OBJ;const a=o;function o(){if(!("fetch"in i))return!1;try{return new Headers,new Request("data:,"),new Response,!0}catch{return!1}}function l(e){return e&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}t.isNativeFunction=l,t.supportsDOMError=function(){try{return new DOMError(""),!0}catch{return!1}},t.supportsDOMException=function(){try{return new DOMException(""),!0}catch{return!1}},t.supportsErrorEvent=function(){try{return new ErrorEvent(""),!0}catch{return!1}},t.supportsFetch=a,t.supportsHistory=function(){return"history"in i&&!!i.history},t.supportsNativeFetch=function(){if("string"==typeof EdgeRuntime)return!0;if(!o())return!1;if(l(i.fetch))return!0;let e=!1;const t=i.document;if(t&&"function"==typeof t.createElement)try{const n=t.createElement("iframe");n.hidden=!0,t.head.appendChild(n),n.contentWindow?.fetch&&(e=l(n.contentWindow.fetch)),t.head.removeChild(n)}catch(e){r.DEBUG_BUILD&&s.debug.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",e)}return e},t.supportsReferrerPolicy=function(){if(!o())return!1;try{return new Request("_",{referrerPolicy:"origin"}),!0}catch{return!1}},t.supportsReportingObserver=function(){return"ReportingObserver"in i}},94486(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(88532);class s{constructor(e){this._state=0,this._handlers=[],this._runExecutor(e)}then(e,t){return new s(((n,r)=>{this._handlers.push([!1,t=>{if(e)try{n(e(t))}catch(e){r(e)}else n(t)},e=>{if(t)try{n(t(e))}catch(e){r(e)}else r(e)}]),this._executeHandlers()}))}catch(e){return this.then((e=>e),e)}finally(e){return new s(((t,n)=>{let r,s;return this.then((t=>{s=!1,r=t,e&&e()}),(t=>{s=!0,r=t,e&&e()})).then((()=>{s?n(r):t(r)}))}))}_executeHandlers(){if(0===this._state)return;const e=this._handlers.slice();this._handlers=[],e.forEach((e=>{e[0]||(1===this._state&&e[1](this._value),2===this._state&&e[2](this._value),e[0]=!0)}))}_runExecutor(e){const t=(e,t)=>{0===this._state&&(r.isThenable(t)?t.then(n,s):(this._state=e,this._value=t,this._executeHandlers()))},n=e=>{t(1,e)},s=e=>{t(2,e)};try{e(n,s)}catch(e){s(e)}}}t.SyncPromise=s,t.rejectedSyncPromise=function(e){return new s(((t,n)=>{n(e)}))},t.resolvedSyncPromise=function(e){return new s((t=>{t(e)}))}},26869(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(83031),s=n(73969);
1function i(){return r.safeDateNow()/1e3}let a;let o=null;t.browserPerformanceTimeOrigin=function(){return null===o&&(o=function(){const{performance:e}=s.GLOBAL_OBJ;if(!e?.now)return;const t=3e5,n=r.withRandomSafeContext((()=>e.now())),i=r.safeDateNow(),a=e.timeOrigin;if("number"==typeof a&&Math.abs(a+n-i)<t)return a;const o=e.timing?.navigationStart;if("number"==typeof o&&Math.abs(o+n-i)<t)return o;return i-n}()),o},t.dateTimestampInSeconds=i,t.timestampInSeconds=function(){return(a??(a=function(){const{performance:e}=s.GLOBAL_OBJ;if(!e?.now||!e.timeOrigin)return i;const t=e.timeOrigin;return()=>(t+r.withRandomSafeContext((()=>e.now())))/1e3}()))()}},41335(e,t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),t.safeUnref=function(e){return"object"==typeof e&&"function"==typeof e.unref&&e.unref(),e}},69483(e,t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});let n,r=0;t.getSequenceAttribute=function(e){const t=Math.floor(1e3*e);void 0!==n&&t!==n&&(r=0);const s=r;return r++,n=t,{key:"sentry.timestamp.sequence",value:{value:s,type:"integer"}}}},61872(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(49564),s=n(93754),i=n(54583);t._getTraceInfoFromScope=function(e,t){return t?r.withScope(t,(()=>{const n=i.getActiveSpan(),a=n?i.spanToTraceContext(n):r.getTraceContextFromScope(t);return[n?s.getDynamicSamplingContextFromSpan(n):s.getDynamicSamplingContextFromScope(e,t),a]})):[void 0,void 0]}},20647(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(42810),s=n(73220),i=n(49564),a=n(79183),o=n(85110),l=n(54583),c=n(93754),u=n(5684),d=n(23336);t.getTraceData=function(e={}){const t=e.client||i.getClient();if(!a.isEnabled()||!t)return{};const n=s.getMainCarrier(),h=r.getAsyncContextStrategy(n);if(h.getTraceData)return h.getTraceData(e);const f=e.scope||i.getCurrentScope(),p=e.span||l.getActiveSpan();if(!p&&i.hasExternalPropagationContext())return{};const g=p?l.spanToTraceHeader(p):function(e){const{traceId:t,sampled:n,propagationSpanId:r}=e.getPropagationContext();return d.generateSentryTraceHeader(t,r,n)}(f),m=p?c.getDynamicSamplingContextFromSpan(p):c.getDynamicSamplingContextFromScope(t,f),_=u.dynamicSamplingContextToSentryBaggageHeader(m);
1if(!d.TRACEPARENT_REGEXP.test(g))return o.debug.warn("Invalid sentry-trace data. Cannot generate trace data"),{};const T={"sentry-trace":g,baggage:_};return e.propagateTraceparent&&(T.traceparent=p?l.spanToTraceparentHeader(p):function(e){const{traceId:t,sampled:n,propagationSpanId:r}=e.getPropagationContext();return d.generateTraceparentHeader(t,r,n)}(f)),T}},78371(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(68974),s=n(85110),i=n(79721),a="[Tracing] Not injecting trace data for url because it does not match tracePropagationTargets:";t.shouldPropagateTraceForUrl=function(e,t,n){if("string"!=typeof e||!t)return!0;const o=n?.get(e);if(void 0!==o)return r.DEBUG_BUILD&&!o&&s.debug.log(a,e),o;const l=i.stringMatchesSomePattern(e,t);return n?.set(e,l),r.DEBUG_BUILD&&!l&&s.debug.log(a,e),l}},23336(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85110),s=n(5684),i=n(21811),a=n(10393),o=n(58913),l=n(83031),c=new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");function u(e){if(!e)return;const t=e.match(c);if(!t)return;let n;return"1"===t[3]?n=!0:"0"===t[3]&&(n=!1),{traceId:t[1],parentSampled:n,parentSpanId:t[2]}}t.TRACEPARENT_REGEXP=c,t.extractTraceparentData=u,t.generateSentryTraceHeader=function(e=o.generateTraceId(),t=o.generateSpanId(),n){let r="";return void 0!==n&&(r=n?"-1":"-0"),`${e}-${t}${r}`},t.generateTraceparentHeader=function(e=o.generateTraceId(),t=o.generateSpanId(),n){return`00-${e}-${t}-${n?"01":"00"}`},t.propagationContextFromHeaders=function(e,t){const n=u(e),r=s.baggageHeaderToDynamicSamplingContext(t);if(!n?.traceId)return{traceId:o.generateTraceId(),sampleRand:l.safeMathRandom()};const i=function(e,t){const n=a.parseSampleRate(t?.sample_rand);if(void 0!==n)return n;const r=a.parseSampleRate(t?.sample_rate);return r&&void 0!==e?.parentSampled?e.parentSampled?l.safeMathRandom()*r:r+l.safeMathRandom()*(1-r):l.safeMathRandom()}(n,r);r&&(r.sample_rand=i.toString());const{traceId:c,parentSpanId:d,parentSampled:h}=n;return{traceId:c,parentSpanId:d,sampled:h,dsc:r||{},sampleRand:i}},t.shouldContinueTrace=function(e,t){const n=i.extractOrgIdFromClient(e);return t&&n&&t!==n?(r.debug.log(`Won't continue trace because org IDs don't match (incoming baggage: ${t}, SDK options: ${n})`),!1):!(e.getOptions().strictTraceContinuation||!1)||!(t&&!n||!t&&n)||(r.debug.log(`Starting a new trace because strict trace continuation is enabled but one org ID is missing (incoming baggage: ${t}, Sentry client: ${n})`),!1)}},73324(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(52751);t.convertSpanJsonToTransactionEvent=function(e){return{type:"transaction",timestamp:e.timestamp,start_timestamp:e.start_timestamp,transaction:e.description,contexts:{trace:{trace_id:e.trace_id,span_id:e.span_id,parent_span_id:e.parent_span_id,op:e.op,status:e.status,origin:e.origin,data:{...e.data,...e.profile_id&&{[r.SEMANTIC_ATTRIBUTE_PROFILE_ID]:e.profile_id},...e.exclusive_time&&{[r.SEMANTIC_ATTRIBUTE_EXCLUSIVE_TIME]:e.exclusive_time}}}},measurements:e.measurements}},t.convertTransactionEventToSpanJson=function(e){const{trace_id:t,parent_span_id:n,span_id:s,status:i,origin:a,data:o,op:l}=e.contexts?.trace??{};return{data:o??{},description:e.transaction,op:l,parent_span_id:n,span_id:s??"",start_timestamp:e.start_timestamp??0,status:i,timestamp:e.timestamp,trace_id:t??"",origin:a,profile_id:o?.[r.SEMANTIC_ATTRIBUTE_PROFILE_ID],exclusive_time:o?.[r.SEMANTIC_ATTRIBUTE_EXCLUSIVE_TIME],measurements:e.measurements,is_segment:!0}}},78182(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85740),s=n(85110),i=n(21811),a=n(99188);t.handleTunnelRequest=async function(e){const{request:t,allowedDsns:n}=e;if(0===n.length)return new Response("Tunnel not configured",{status:500});const o=new Uint8Array(await t.arrayBuffer());let l;try{[l]=a.parseEnvelope(o)}catch{return new Response("Invalid envelope",{status:400})}if(!l)return new Response("Invalid envelope: missing header",{status:400});const c=l.dsn;if(!c)return new Response("Invalid envelope: missing DSN",{status:400});if(!n.some((e=>e===c)))return s.debug.warn(`Sentry tunnel: rejected request with unauthorized DSN (${c})`),new Response("DSN not allowed",{status:403});const u=i.makeDsn(c);if(!u)return s.debug.warn(`Could not extract DSN Components from: ${c}`),new Response("Invalid DSN",{status:403});const d=r.getEnvelopeEndpointWithUrlEncodedAuth(u);try{return await fetch(d,{method:"POST",headers:{"Content-Type":"application/x-sentry-envelope"},body:o})}catch(e){return s.debug.error("Sentry tunnel: failed to forward envelope",e),new Response("Failed to forward envelope to Sentry",{status:500})}}},9635(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(52751);function s(e){return"isRelative"in e}function i(e){if(s(e))return e.pathname;const t=new URL(e);return t.search="",t.hash="",["80","443"].includes(t.port)&&(t.port=""),t.password&&(t.password="%filtered%"),t.username&&(t.username="%filtered%"),t.toString()}function a(e,t,n,r){return`${n?.method?.toUpperCase()??"GET"} ${r||(e?"client"===t?i(e):e.pathname:"/")}`}
1t.getHttpSpanDetailsFromUrlObject=function(e,t,n,i,o){const l={[r.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]:n,[r.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]:"url"};return o&&(l["server"===t?"http.route":"url.template"]=o,l[r.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]="route"),i?.method&&(l[r.SEMANTIC_ATTRIBUTE_HTTP_REQUEST_METHOD]=i.method.toUpperCase()),e&&(e.search&&(l["url.query"]=e.search),e.hash&&(l["url.fragment"]=e.hash),e.pathname&&(l["url.path"]=e.pathname,"/"===e.pathname&&(l[r.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]="route")),s(e)||(l[r.SEMANTIC_ATTRIBUTE_URL_FULL]=e.href,e.port&&(l["url.port"]=e.port),e.protocol&&(l["url.scheme"]=e.protocol),e.hostname&&(l["server"===t?"server.address":"url.domain"]=e.hostname))),[a(e,t,i,o),l]},t.getSanitizedUrlString=function(e){const{protocol:t,host:n,path:r}=e;return`${t?`${t}://`:""}${n?.replace(/^.*@/,"[filtered]:[filtered]@").replace(/(:80)$/,"").replace(/(:443)$/,"")||""}${r}`},t.getSanitizedUrlStringFromUrlObject=i,t.isURLObjectRelative=s,t.parseStringToURLObject=function(e,t){const n=e.indexOf("://")<=0&&0!==e.indexOf("//"),r=t??(n?"thismessage:/":void 0);try{if("canParse"in URL&&!URL.canParse(e,r))return;const t=new URL(e,r);return n?{isRelative:n,pathname:t.pathname,search:t.search,hash:t.hash}:t}catch{}},t.parseUrl=function(e){if(!e)return{};const t=e.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};const n=t[6]||"",r=t[8]||"";return{host:t[4],path:t[5],protocol:t[2],search:n,hash:r,relative:t[5]+n+r}},t.stripDataUrlContent=function(e,t=!0){if(e.startsWith("data:")){const n=e.match(/^data:([^;,]+)/),r=n?n[1]:"text/plain",s=e.includes(";base64,"),i=e.indexOf(",");let a="";if(t&&-1!==i){const t=e.slice(i+1);a=t.length>10?`${t.slice(0,10)}... [truncated]`:t}return`data:${r}${s?",base64":""}${a?`,${a}`:""}`}return e},t.stripUrlQueryAndFragment=function(e){return e.split(/[?#]/,1)[0]}},64548(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(73969);t.vercelWaitUntil=function(e){if("string"!=typeof EdgeRuntime)return;const t=r.GLOBAL_OBJ[Symbol.for("@vercel/request-context")],n=t?.get?.();n?.waitUntil&&n.waitUntil(e)}},6102(e,t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});t.SDK_VERSION="10.53.1"},23879(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(73969);t.derefWeakRef=function(e){if(e){if("object"==typeof e&&"deref"in e&&"function"==typeof e.deref)try{return e.deref()}catch{return}return e}},t.makeWeakRef=function(e){try{const t=r.GLOBAL_OBJ.WeakRef;if("function"==typeof t)return new t(e)}catch{}return e}},73969(e,t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const n=globalThis;t.GLOBAL_OBJ=n},89235(e,t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),t.escapeStringForRegex=function(e){return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}},49764(e,t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const n=["X-Client-IP","X-Forwarded-For","Fly-Client-IP","CF-Connecting-IP","Fastly-Client-Ip","True-Client-Ip","X-Real-IP","X-Cluster-Client-IP","X-Forwarded","Forwarded-For","Forwarded","X-Vercel-Forwarded-For"];t.getClientIPAddress=function(e){const t={};for(const n of Object.keys(e))t[n.toLowerCase()]=e[n];return n.map((e=>{const n=t[e.toLowerCase()],r=Array.isArray(n)?n.join(";"):n;return"Forwarded"===e?function(e){if(!e)return null;for(const t of e.split(";"))if(t.startsWith("for="))return t.slice(4);return null}(r):r?.split(",").map((e=>e.trim()))})).reduce(((e,t)=>t?e.concat(t):e),[]).find((e=>null!==e&&/(?:^(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}$)|(?:^(?:(?:[a-fA-F\d]{1,4}:){7}(?:[a-fA-F\d]{1,4}|:)|(?:[a-fA-F\d]{1,4}:){6}(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|:[a-fA-F\d]{1,4}|:)|(?:[a-fA-F\d]{1,4}:){5}(?::(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,2}|:)|(?:[a-fA-F\d]{1,4}:){4}(?:(?::[a-fA-F\d]{1,4}){0,1}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,3}|:)|(?:[a-fA-F\d]{1,4}:){3}(?:(?::[a-fA-F\d]{1,4}){0,2}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,4}|:)|(?:[a-fA-F\d]{1,4}:){2}(?:(?::[a-fA-F\d]{1,4}){0,3}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,5}|:)|(?:[a-fA-F\d]{1,4}:){1}(?:(?::[a-fA-F\d]{1,4}){0,4}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,6}|:)|(?::(?:(?::[a-fA-F\d]{1,4}){0,5}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,7}|:)))(?:%[0-9a-zA-Z]{1,})?$)/.test(e)))||null},t.ipHeaderNames=n},3066(e,t,n){"use strict";n.r(t),n.d(t,{startStimulusApp:()=>a});var r=n(52891),s=n(35828);function i(e){return e.keys().map((t=>function(e,t){const n=function(e){const t=(e.match(/^(?:\.\/)?(.+)(?:[_-]controller\..+?)$/)||[])[1];if(t)return t.replace(/_/g,"-").replace(/\//g,"--")}(t);if(n)return function(e,t){const n=e.default;if("function"==typeof n)return{identifier:t,controllerConstructor:n}}(e(t),n)}(e,t))).filter((e=>e))}function a(e){const t=r.Application.start();e&&t.load(i(e));for(const e in s.A)s.A.hasOwnProperty(e)&&t.register(e,s.A[e]);return t}},35548(e,t,n){"use strict";var r=n(33517),s=n(16823),i=TypeError;e.exports=function(e){if(r(e))return e;throw new i(s(e)+" is not a constructor")}}
vendor: 4,580 bytes, line 1
1,97080(e,t,n){"use strict";var r=n(94402).has;e.exports=function(e){return r(e),e}},57829(e,t,n){"use strict";var r=n(68183).charAt;e.exports=function(e,t,n){return t+(n?r(e,t).length:1)}},15652(e,t,n){"use strict";var r=n(79039);e.exports=r((function(){if("function"==typeof ArrayBuffer){var e=new ArrayBuffer(8);Object.isExtensible(e)&&Object.defineProperty(e,"a",{value:8})}}))},90235(e,t,n){"use strict";var r=n(59213).forEach,s=n(34598)("forEach");e.exports=s?[].forEach:function(e){return r(this,e,arguments.length>1?arguments[1]:void 0)}},97916(e,t,n){"use strict";var r=n(76080),s=n(69565),i=n(48981),a=n(96319),o=n(44209),l=n(33517),c=n(26198),u=n(97040),d=n(70081),h=n(50851),f=Array;e.exports=function(e){var t=i(e),n=l(this),p=arguments.length,g=p>1?arguments[1]:void 0,m=void 0!==g;m&&(g=r(g,p>2?arguments[2]:void 0));var _,T,E,y,S,v,b=h(t),I=0;if(!b||this===f&&o(b))for(_=c(t),T=n?new this(_):f(_);_>I;I++)v=m?g(t[I],I):t[I],u(T,I,v);else for(T=n?new this:[],S=(y=d(t,b)).next;!(E=s(S,y)).done;I++)v=m?a(y,g,[E.value,I],!0):E.value,u(T,I,v);return T.length=I,T}},70597(e,t,n){"use strict";var r=n(79039),s=n(78227),i=n(39519),a=s("species");e.exports=function(e){return i>=51||!r((function(){var t=[];return(t.constructor={})[a]=function(){return{foo:1}},1!==t[e](Boolean).foo}))}},80926(e,t,n){"use strict";var r=n(79306),s=n(48981),i=n(47055),a=n(26198),o=TypeError,l="Reduce of empty array with no initial value",c=function(e){return function(t,n,c,u){var d=s(t),h=i(d),f=a(d);if(r(n),0===f&&c<2)throw new o(l);var p=e?f-1:0,g=e?-1:1;if(c<2)for(;;){if(p in h){u=h[p],p+=g;break}if(p+=g,e?p<0:f<=p)throw new o(l)}for(;e?p>=0:f>p;p+=g)p in h&&(u=n(u,h[p],p,d));return u}};e.exports={left:c(!1),right:c(!0)}},34527(e,t,n){"use strict";var r=n(43724),s=n(34376),i=TypeError,a=Object.getOwnPropertyDescriptor,o=r&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(e){return e instanceof TypeError}}();e.exports=o?function(e,t){if(s(e)&&!a(e,"length").writable)throw new i("Cannot set read only .length");return e.length=t}:function(e,t){return e.length=t}},74488(e,t,n){"use strict";var r=n(67680),s=Math.floor,i=function(e,t){var n=e.length;if(n<8)for(var a,o,l=1;l<n;){for(o=l,a=e[l];o&&t(e[o-1],a)>0;)e[o]=e[--o];o!==l++&&(e[o]=a)}else for(var c=s(n/2),u=i(r(e,0,c),t),d=i(r(e,c),t),h=u.length,f=d.length,p=0,g=0;p<h||g<f;)e[p+g]=p<h&&g<f?t(u[p],d[g])<=0?u[p++]:d[g++]:p<h?u[p++]:d[g++];return e};e.exports=i},96319(e,t,n){"use strict";var r=n(28551),s=n(9539);e.exports=function(e,t,n,i){try{return i?t(r(n)[0],n[1]):t(n)}catch(t){s(e,"throw",t)}}},84428(e,t,n){"use strict";var r=n(78227)("iterator"),s=!1;try{var i=0,a={next:function(){return{done:!!i++}},return:function(){s=!0}};a[r]=function(){return this},Array.from(a,(function(){throw 2}))}catch(e){}e.exports=function(e,t){try{if(!t&&!s)return!1}catch(e){return!1}var n=!1;try{var i={};i[r]=function(){return{next:function(){return{done:n=!0}}}},e(i)}catch(e){}return n}},86938(e,t,n){"use strict";var r=n(2360),s=n(62106),i=n(56279),a=n(76080),o=n(90679),l=n(64117),c=n(72652),u=n(51088),d=n(62529),h=n(87633),f=n(43724),p=n(3451).fastKey,g=n(91181),m=g.set,_=g.getterFor;e.exports={getConstructor:function(e,t,n,u){var d=e((function(e,s){o(e,h),m(e,{type:t,index:r(null),first:null,last:null,size:0}),f||(e.size=0),l(s)||c(s,e[u],{that:e,AS_ENTRIES:n})})),h=d.prototype,g=_(t),T=function(e,t,n){var r,s,i=g(e),a=E(e,t);return a?a.value=n:(i.last=a={index:s=p(t,!0),key:t,value:n,previous:r=i.last,next:null,removed:!1},i.first||(i.first=a),r&&(r.next=a),f?i.size++:e.size++,"F"!==s&&(i.index[s]=a)),e},E=function(e,t){var n,r=g(e),s=p(t);if("F"!==s)return r.index[s];for(n=r.first;n;n=n.next)if(n.key===t)return n};return i(h,{clear:function(){for(var e=g(this),t=e.first;t;)t.removed=!0,t.previous&&(t.previous=t.previous.next=null),t=t.next;e.first=e.last=null,e.index=r(null),f?e.size=0:this.size=0},delete:function(e){var t=this,n=g(t),r=E(t,e);if(r){var s=r.next,i=r.previous;delete n.index[r.index],r.removed=!0,i&&(i.next=s),s&&(s.previous=i),n.first===r&&(n.first=s),n.last===r&&(n.last=i),f?n.size--:t.size--}return!!r},forEach:function(e){for(var t,n=g(this),r=a(e,arguments.length>1?arguments[1]:void 0);t=t?t.next:n.first;)for(r(t.value,t.key,this);t&&t.removed;)t=t.previous},has:function(e){return!!E(this,e)}}),i(h,n?{get:function(e){var t=E(this,e);return t&&t.value},set:function(e,t){return T(this,0===e?0:e,t)}}:{add:function(e){return T(this,e=0===e?0:e,e)}}),f&&s(h,"size",{configurable:!0,get:function(){return g(this).size}}
vendor: 15,478 bytes, line 1
1),d},setStrong:function(e,t,n){var r=t+" Iterator",s=_(t),i=_(r);u(e,t,(function(e,t){m(this,{type:r,target:e,state:s(e),kind:t,last:null})}),(function(){for(var e=i(this),t=e.kind,n=e.last;n&&n.removed;)n=n.previous;return e.target&&(e.last=n=n?n.next:e.state.first)?d("keys"===t?n.key:"values"===t?n.value:[n.key,n.value],!1):(e.target=null,d(void 0,!0))}),n?"entries":"values",!n,!0),h(t)}}},91625(e,t,n){"use strict";var r=n(79504),s=n(56279),i=n(3451).getWeakData,a=n(90679),o=n(28551),l=n(64117),c=n(20034),u=n(72652),d=n(59213),h=n(39297),f=n(91181),p=f.set,g=f.getterFor,m=d.find,_=d.findIndex,T=r([].splice),E=0,y=function(e){return e.frozen||(e.frozen=new S)},S=function(){this.entries=[]},v=function(e,t){return m(e.entries,(function(e){return e[0]===t}))};S.prototype={get:function(e){var t=v(this,e);if(t)return t[1]},has:function(e){return!!v(this,e)},set:function(e,t){var n=v(this,e);n?n[1]=t:this.entries.push([e,t])},delete:function(e){var t=_(this.entries,(function(t){return t[0]===e}));return~t&&T(this.entries,t,1),!!~t}},e.exports={getConstructor:function(e,t,n,r){var d=e((function(e,s){a(e,f),p(e,{type:t,id:E++,frozen:null}),l(s)||u(s,e[r],{that:e,AS_ENTRIES:n})})),f=d.prototype,m=g(t),_=function(e,t,n){var r=m(e),s=i(o(t),!0);return!0===s?y(r).set(t,n):s[r.id]=n,e};return s(f,{delete:function(e){var t=m(this);if(!c(e))return!1;var n=i(e);return!0===n?y(t).delete(e):n&&h(n,t.id)&&delete n[t.id]},has:function(e){var t=m(this);if(!c(e))return!1;var n=i(e);return!0===n?y(t).has(e):n&&h(n,t.id)}}),s(f,n?{get:function(e){var t=m(this);if(c(e)){var n=i(e);if(!0===n)return y(t).get(e);if(n)return n[t.id]}},set:function(e,t){return _(this,e,t)}}:{add:function(e){return _(this,e,!0)}}),d}}},16468(e,t,n){"use strict";var r=n(46518),s=n(44576),i=n(79504),a=n(92796),o=n(36840),l=n(3451),c=n(72652),u=n(90679),d=n(94901),h=n(64117),f=n(20034),p=n(79039),g=n(84428),m=n(10687),_=n(23167);e.exports=function(e,t,n){var T=-1!==e.indexOf("Map"),E=-1!==e.indexOf("Weak"),y=T?"set":"add",S=s[e],v=S&&S.prototype,b=S,I={},A=function(e){var t=i(v[e]);o(v,e,"add"===e?function(e){return t(this,0===e?0:e),this}:"delete"===e?function(e){return!(E&&!f(e))&&t(this,0===e?0:e)}:"get"===e?function(e){return E&&!f(e)?void 0:t(this,0===e?0:e)}:"has"===e?function(e){return!(E&&!f(e))&&t(this,0===e?0:e)}:function(e,n){return t(this,0===e?0:e,n),this})};if(a(e,!d(S)||!(E||v.forEach&&!p((function(){(new S).entries().next()})))))b=n.getConstructor(t,e,T,y),l.enable();else if(a(e,!0)){var R=new b,C=R[y](E?{}:-0,1)!==R,k=p((function(){R.has(1)})),L=g((function(e){new S(e)})),O=!E&&p((function(){for(var e=new S,t=5;t--;)e[y](t,t);return!e.has(-0)}));L||((b=t((function(e,t){u(e,v);var n=_(new S,e,b);return h(t)||c(t,n[y],{that:n,AS_ENTRIES:T}),n}))).prototype=v,v.constructor=b),(k||O)&&(A("delete"),A("has"),T&&A("get")),(O||C)&&A(y),E&&v.clear&&delete v.clear}return I[e]=b,r({global:!0,constructor:!0,forced:b!==S},I),m(b,e),E||n.setStrong(b,e,T),b}},41436(e,t,n){"use strict";var r=n(78227)("match");e.exports=function(e){var t=/./;try{"/./"[e](t)}catch(n){try{return t[r]=!1,"/./"[e](t)}catch(e){}}return!1}},62529(e){"use strict";e.exports=function(e,t){return{value:e,done:t}}},70380(e,t,n){"use strict";var r=n(79504),s=n(79039),i=n(60533).start,a=RangeError,o=isFinite,l=Math.abs,c=Date.prototype,u=c.toISOString,d=r(c.getTime),h=r(c.getUTCDate),f=r(c.getUTCFullYear),p=r(c.getUTCHours),g=r(c.getUTCMilliseconds),m=r(c.getUTCMinutes),_=r(c.getUTCMonth),T=r(c.getUTCSeconds);e.exports=s((function(){return"0385-07-25T07:06:39.999Z"!==u.call(new Date(-50000000000001))}))||!s((function(){u.call(new Date(NaN))}))?function(){if(!o(d(this)))throw new a("Invalid time value");var e=this,t=f(e),n=g(e),r=t<0?"-":t>9999?"+":"";return r+i(l(t),r?6:4,0)+"-"+i(_(e)+1,2,0)+"-"+i(h(e),2,0)+"T"+i(p(e),2,0)+":"+i(m(e),2,0)+":"+i(T(e),2,0)+"."+i(n,3,0)+"Z"}:u},53640(e,t,n){"use strict";var r=n(28551),s=n(84270),i=TypeError;e.exports=function(e){if(r(this),"string"===e||"default"===e)e="string";else if("number"!==e)throw new i("Incorrect hint");return s(this,e)}},56279(e,t,n){"use strict";var r=n(36840);e.exports=function(e,t,n){for(var s in t)r(e,s,t[s],n);return e}},84606(e,t,n){"use strict";var r=n(16823),s=TypeError;e.exports=function(e,t){if(!delete e[t])throw new s("Cannot delete property "+r(t)+" of "+r(e))}},96837(e){"use strict";var t=TypeError;e.exports=function(e){if(e>9007199254740991)throw t("Maximum allowed index exceeded");return e}},67400(e){"use strict";e.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},79296(e,t,n){"use strict";var r=n(4055)("span").classList,s=r&&r.constructor&&r.constructor.prototype;e.exports=s===Object.prototype?void 0:s},44265(e,t,n){"use strict";var r=n(82839);e.exports=/ipad|iphone|ipod/i.test(r)&&"undefined"!=typeof Pebble},89544(e,t,n){"use strict";var r=n(82839);e.exports=/(?:ipad|iphone|ipod).*applewebkit/i.test(r)},38574(e,t,n){"use strict";var r=n(84215);e.exports="NODE"===r},7860(e,t,n){"use strict";var r=n(82839);e.exports=/web0s(?!.*chrome)/i.test(r)},89228(e,t,n){"use strict";n(27495);var r=n(69565),s=n(36840),i=n(57323),a=n(79039),o=n(78227),l=n(66699),c=o("species"),u=RegExp.prototype;e.exports=function(e,t,n,d){var h=o(e),f=!a((function(){var t={};return t[h]=function(){return 7},7!==""[e](t)})),p=f&&!a((function(){var t=!1,n=/a/;return"split"===e&&((n={}).constructor={},n.constructor[c]=function(){return n},n.flags="",n[h]=/./[h]),n.exec=function(){return t=!0,null},n[h](""),!t}));if(!f||!p||n){var g=/./[h],m=t(h,""[e],(function(e,t,n,s,a){var o=t.exec;return o===i||o===u.exec?f&&!a?{done:!0,value:r(g,t,n,s)}:{done:!0,value:r(e,n,t,s)}:{done:!1}}));s(String.prototype,e,m[0]),s(u,h,m[1])}d&&l(u[h],"sham",!0)}},92744(e,t,n){"use strict";var r=n(79039);e.exports=!r((function(){return Object.isExtensible(Object.preventExtensions({}))}))},30566(e,t,n){"use strict";var r=n(79504),s=n(79306),i=n(20034),a=n(39297),o=n(67680),l=n(40616),c=Function,u=r([].concat),d=r([].join),h={};e.exports=l?c.bind:function(e){var t=s(this),n=t.prototype,r=o(arguments,1),l=function(){var n=u(r,o(arguments));return this instanceof l?function(e,t,n){if(!a(h,t)){for(var r=[],s=0;s<t;s++)r[s]="a["+s+"]";h[t]=c("C,a","return new C("+d(r,",")+")")}return h[t](e,n)}(t,n.length,n):t.apply(e,n)};return i(n)&&(l.prototype=n),l}},66933(e,t,n){"use strict";var r=n(79504),s=n(34376),i=n(94901),a=n(22195),o=n(655),l=r([].push);e.exports=function(e){if(i(e))return e;if(s(e)){for(var t=e.length,n=[],r=0;r<t;r++){var c=e[r];"string"==typeof c?l(n,c):"number"!=typeof c&&"Number"!==a(c)&&"String"!==a(c)||l(n,o(c))}var u=n.length,d=!0;return function(e,t){if(d)return d=!1,t;if(s(this))return t;for(var r=0;r<u;r++)if(n[r]===e)return t}}}},83789(e,t,n){"use strict";var r=n(79306),s=n(28551),i=n(69565),a=n(91291),o=n(1767),l="Invalid size",c=RangeError,u=TypeError,d=Math.max,h=function(e,t){this.set=e,this.size=d(t,0),this.has=r(e.has),this.keys=r(e.keys)};h.prototype={getIterator:function(){return o(s(i(this.keys,this.set)))},includes:function(e){return i(this.has,this.set,e)}},e.exports=function(e){s(e);var t=+e.size;if(t!=t)throw new u(l);var n=a(t);if(n<0)throw new c(l);return new h(e,n)}},2478(e,t,n){"use strict";var r=n(79504),s=n(48981),i=Math.floor,a=r("".charAt),o=r("".replace),l=r("".slice),c=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,u=/\$([$&'`]|\d{1,2})/g;e.exports=function(e,t,n,r,d,h){var f=n+e.length,p=r.length,g=u;return void 0!==d&&(d=s(d),g=c),o(h,g,(function(s,o){var c;switch(a(o,0)){case"$":return"$";case"&":return e;case"`":return l(t,0,n);case"'":return l(t,f);case"<":c=d[l(o,1,-1)];break;default:var u=+o;if(0===u)return s;if(u>p){var h=i(u/10);return 0===h?s:h<=p?void 0===r[h-1]?a(o,1):r[h-1]+a(o,1):s}c=r[u-1]}return void 0===c?"":c}))}},90757(e){"use strict";e.exports=function(e,t){try{1===arguments.length?console.error(e):console.error(e,t)}catch(e){}}},3451(e,t,n){"use strict";var r=n(46518),s=n(79504),i=n(30421),a=n(20034),o=n(39297),l=n(24913).f,c=n(38480),u=n(10298),d=n(34124),h=n(33392),f=n(92744),p=!1,g=h("meta"),m=0,_=function(e){l(e,g,{value:{objectID:"O"+m++,weakData:{}}})},T=e.exports={enable:function(){T.enable=function(){},p=!0;var e=c.f,t=s([].splice),n={};n[g]=1,e(n).length&&(c.f=function(n){for(var r=e(n),s=0,i=r.length;s<i;s++)if(r[s]===g){t(r,s,1);break}return r},r({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:u.f}))},fastKey:function(e,t){if(!a(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!o(e,g)){if(!d(e))return"F";if(!t)return"E";_(e)}return e[g].objectID},getWeakData:function(e,t){if(!o(e,g)){if(!d(e))return!0;if(!t)return!1;_(e)}return e[g].weakData},onFreeze:function(e){return f&&p&&d(e)&&!o(e,g)&&_(e),e}};i[g]=!0},16575(e,t,n){"use strict";var r=n(39297);e.exports=function(e){return void 0!==e&&(r(e,"value")||r(e,"writable"))}},60788(e,t,n){"use strict";var r=n(20034),s=n(22195),i=n(78227)("match");e.exports=function(e){var t;return r(e)&&(void 0!==(t=e[i])?!!t:"RegExp"===s(e))}},40507(e,t,n){"use strict";var r=n(69565);e.exports=function(e,t,n){for(var s,i,a=n?e:e.iterator,o=e.next;!(s=r(o,a)).done;)if(void 0!==(i=t(s.value)))return i}},33994(e,t,n){"use strict";var r=n(57657).IteratorPrototype,s=n(2360),i=n(6980),a=n(10687),o=n(26269),l=function(){return this};e.exports=function(e,t,n,c){var u=t+" Iterator";return e.prototype=s(r,{next:i(+!c,n)}),a(e,u,!1,!0),o[u]=l,e}},19462(e,t,n){"use strict";var r=n(69565),s=n(2360),i=n(66699),a=n(56279),o=n(78227),l=n(91181),c=n(55966),u=n(57657).IteratorPrototype,d=n(62529),h=n(9539),f=o("toStringTag"),p="IteratorHelper",g="WrapForValidIterator",m=l.set,_=function(e){var t=l.getterFor(e?g:p);return a(s(u),{next:function(){var n=t(this);if(e)return n.nextHandler();try{var r=n.done?void 0:n.nextHandler();return d(r,n.done)}catch(e){throw n.done=!0,e}},return:function(){var n=t(this),s=n.iterator;if(n.done=!0,e){var i=c(s,"return");return i?r(i,s):d(void 0,!0)}if(n.inner)try{h(n.inner.iterator,"normal")}catch(e){return h(s,"throw",e)}return s&&h(s,"normal"),d(void 0,!0)}})},T=_(!0),E=_(!1);i(E,f,"Iterator Helper"),e.exports=function(e,t){var n=function(n,r){r?(r.iterator=n.iterator,r.next=n.next):r=n,r.type=t?g:p,r.nextHandler=e,r.counter=0,r.done=!1,m(this,r)};return n.prototype=t?T:E,n}},51088(e,t,n){"use strict";var r=n(46518),s=n(69565),i=n(96395),a=n(10350),o=n(94901),l=n(33994),c=n(42787),u=n(52967),d=n(10687),h=n(66699),f=n(36840),p=n(78227),g=n(26269),m=n(57657),_=a.PROPER,T=a.CONFIGURABLE,E=m.IteratorPrototype,y=m.BUGGY_SAFARI_ITERATORS,S=p("iterator"),v="keys",b="values",I="entries",A=function(){return this};e.exports=function(e,t,n,a,p,m,R){l(n,t,a);var C,k,L,O=function(e){if(e===p&&D)return D;if(!y&&e&&e in P)return P[e];switch(e){case v:case b:case I:return function(){return new n(this,e)}}return function(){return new n(this)}},N=t+" Iterator",w=!1,P=e.prototype,M=P[S]||P["@@iterator"]||p&&P[p],D=!y&&M||O(p),x="Array"===t&&P.entries||M;if(x&&(C=c(x.call(new e)))!==Object.prototype&&C.next&&(i||c(C)===E||(u?u(C,E):o(C[S])||f(C,S,A)),d(C,N,!0,!0),i&&(g[N]=A)),_&&p===b&&M&&M.name!==b&&(!i&&T?h(P,"name",b):(w=!0,D=function(){return s(M,this)})),p)if(k={values:O(b),keys:m?D:O(v),entries:O(I)},R)for(L in k)(y||w||!(L in P))&&f(P,L,k[L]);else r({target:t,proto:!0,forced:y||w},k);return i&&!R||P[S]===D||f(P,S,D,{name:p}),g[t]=D,k}},20713(e,t,n){"use strict";var r=n(69565),s=n(79306),i=n(28551),a=n(1767),o=n(19462),l=n(96319),c=o((function(){var e=this.iterator,t=i(r(this.next,e));if(!(this.done=!!t.done))return l(e,this.mapper,[t.value,this.counter++],!0)}));e.exports=function(e){return i(this),s(e),new c(a(this),{mapper:e})}},91955(e,t,n){"use strict";var r,s,i,a,o,l=n(44576),c=n(93389),u=n(76080),d=n(59225).set,h=n(18265),f=n(89544),p=n(44265),g=n(7860),m=n(38574),_=l.MutationObserver||l.WebKitMutationObserver,T=l.document,E=l.process,y=l.Promise,S=c("queueMicrotask");if(!S){var v=new h,b=function(){var e,t;for(m&&(e=E.domain)&&e.exit();t=v.get();)try{t()}catch(e){throw v.head&&r(),e}e&&e.enter()};f||m||g||!_||!T?!p&&y&&y.resolve?((a=y.resolve(void 0)).constructor=y,o=u(a.then,a),r=function(){o(b)}):m?r=function(){E.nextTick(b)}:(d=u(d,l),r=function(){d(b)}):(s=!0,i=T.createTextNode(""),new _(b).observe(i,{characterData:!0}),r=function(){i.data=s=!s}),S=function(e){v.head||r(),v.add(e)}}e.exports=S},36043(e,t,n){"use strict";var r=n(79306),s=TypeError,i=function(e){var t,n;this.promise=new e((function(e,r){if(void 0!==t||void 0!==n)throw new s("Bad Promise constructor");t=e,n=r})),this.resolve=r(t),this.reject=r(n)};e.exports.f=function(e){return new i(e)}},60511(e,t,n){"use strict";var r=n(60788),s=TypeError;e.exports=function(e){if(r(e))throw new s("The method doesn't accept regular expressions");return e}},33904(e,t,n){"use strict";var r=n(44576),s=n(79039),i=n(79504),a=n(655),o=n(43802).trim,l=n(47452),c=i("".charAt),u=r.parseFloat,d=r.Symbol,h=d&&d.iterator,f=1/u(l+"-0")!=-1/0||h&&!s((function(){u(Object(h))}));e.exports=f?function(e){var t=o(a(e)),n=u(t);return 0===n&&"-"===c(t,0)?-0:n}:u},44213(e,t,n){"use strict";var r=n(43724),s=n(79504),i=n(69565),a=n(79039),o=n(71072),l=n(33717),c=n(48773),u=n(48981),d=n(47055),h=Object.assign,f=Object.defineProperty,p=s([].concat);e.exports=!h||a((function(){if(r&&1!==h({b:1},h(f({},"a",{enumerable:!0,get:function(){f(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},n=Symbol("assign detection"),s="abcdefghijklmnopqrst";return e[n]=7,s.split("").forEach((function(e){t[e]=e})),7!==h({},e)[n]||o(h({},t)).join("")!==s}))?function(e,t){for(var n=u(e),s=arguments.length,a=1,h=l.f,f=c.f;s>a;)for(var g,m=d(arguments[a++]),_=h?p(o(m),h(m)):o(m),T=_.length,E=0;T>E;)g=_[E++],r&&!i(f,m,g)||(n[g]=m[g]);return n}:h},10298(e,t,n){"use strict";var r=n(22195),s=n(25397),i=n(38480).f,a=n(67680),o="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];e.exports.f=function(e){return o&&"Window"===r(e)?function(e){try{return i(e)}catch(e){return a(o)}}(e):i(s(e))}},34124(e,t,n){"use strict";var r=n(79039),s=n(20034),i=n(22195),a=n(15652),o=Object.isExtensible,l=r((function(){o(1)}));e.exports=l||a?function(e){return!!s(e)&&((!a||"ArrayBuffer"!==i(e))&&(!o||o(e)))}:o},32357(e,t,n){"use strict";var r=n(43724),s=n(79039),i=n(79504),a=n(42787),o=n(71072),l=n(25397),c=i(n(48773).f),u=i([].push),d=r&&s((function(){var e=Object.create(null);return e[2]=2,!c(e,2)})),h=function(e){return function(t){for(var n,s=l(t),i=o(s),h=d&&null===a(s),f=i.length,p=0,g=[];f>p;)n=i[p++],r&&!(h?n in s:c(s,n))||u(g,e?[n,s[n]]:s[n]);return g}};e.exports={entries:h(!0),values:h(!1)}},19167(e,t,n){"use strict";var r=n(44576);e.exports=r},1103(e){"use strict";e.exports=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}}},10916(e,t,n){"use strict";var r=n(44576),s=n(80550),i=n(94901),a=n(92796),o=n(33706),l=n(78227),c=n(84215),u=n(96395),d=n(39519),h=s&&s.prototype,f=l("species"),p=!1,g=i(r.PromiseRejectionEvent),m=a("Promise",(function(){var e=o(s),t=e!==String(s);if(!t&&66===d)return!0;
vendor: 13,344 bytes, line 1
1if(u&&(!h.catch||!h.finally))return!0;if(!d||d<51||!/native code/.test(e)){var n=new s((function(e){e(1)})),r=function(e){e((function(){}),(function(){}))};if((n.constructor={})[f]=r,!(p=n.then((function(){}))instanceof r))return!0}return!(t||"BROWSER"!==c&&"DENO"!==c||g)}));e.exports={CONSTRUCTOR:m,REJECTION_EVENT:g,SUBCLASSING:p}},80550(e,t,n){"use strict";var r=n(44576);e.exports=r.Promise},93438(e,t,n){"use strict";var r=n(28551),s=n(20034),i=n(36043);e.exports=function(e,t){if(r(e),s(t)&&t.constructor===e)return t;var n=i.f(e);return(0,n.resolve)(t),n.promise}},90537(e,t,n){"use strict";var r=n(80550),s=n(84428),i=n(10916).CONSTRUCTOR;e.exports=i||!s((function(e){r.all(e).then(void 0,(function(){}))}))},18265(e){"use strict";var t=function(){this.head=null,this.tail=null};t.prototype={add:function(e){var t={item:e,next:null},n=this.tail;n?n.next=t:this.head=t,this.tail=t},get:function(){var e=this.head;if(e)return null===(this.head=e.next)&&(this.tail=null),e.item}},e.exports=t},56682(e,t,n){"use strict";var r=n(69565),s=n(28551),i=n(94901),a=n(22195),o=n(57323),l=TypeError;e.exports=function(e,t){var n=e.exec;if(i(n)){var c=r(n,e,t);return null!==c&&s(c),c}if("RegExp"===a(e))return r(o,e,t);throw new l("RegExp#exec called on incompatible receiver")}},57323(e,t,n){"use strict";var r,s,i=n(69565),a=n(79504),o=n(655),l=n(67979),c=n(58429),u=n(25745),d=n(2360),h=n(91181).get,f=n(83635),p=n(18814),g=u("native-string-replace",String.prototype.replace),m=RegExp.prototype.exec,_=m,T=a("".charAt),E=a("".indexOf),y=a("".replace),S=a("".slice),v=(s=/b*/g,i(m,r=/a/,"a"),i(m,s,"a"),0!==r.lastIndex||0!==s.lastIndex),b=c.BROKEN_CARET,I=void 0!==/()??/.exec("")[1];(v||I||b||f||p)&&(_=function(e){var t,n,r,s,a,c,u,f=this,p=h(f),A=o(e),R=p.raw;if(R)return R.lastIndex=f.lastIndex,t=i(_,R,A),f.lastIndex=R.lastIndex,t;var C=p.groups,k=b&&f.sticky,L=i(l,f),O=f.source,N=0,w=A;if(k&&(L=y(L,"y",""),-1===E(L,"g")&&(L+="g"),w=S(A,f.lastIndex),f.lastIndex>0&&(!f.multiline||f.multiline&&"\n"!==T(A,f.lastIndex-1))&&(O="(?: "+O+")",w=" "+w,N++),n=new RegExp("^(?:"+O+")",L)),I&&(n=new RegExp("^"+O+"$(?!\\s)",L)),v&&(r=f.lastIndex),s=i(m,k?n:f,w),k?s?(s.input=S(s.input,N),s[0]=S(s[0],N),s.index=f.lastIndex,f.lastIndex+=s[0].length):f.lastIndex=0:v&&s&&(f.lastIndex=f.global?s.index+s[0].length:r),I&&s&&s.length>1&&i(g,s[0],n,(function(){for(a=1;a<arguments.length-2;a++)void 0===arguments[a]&&(s[a]=void 0)})),s&&C)for(s.groups=c=d(null),a=0;a<C.length;a++)c[(u=C[a])[0]]=s[u[1]];return s}),e.exports=_},58429(e,t,n){"use strict";var r=n(79039),s=n(44576).RegExp,i=r((function(){var e=s("a","y");return e.lastIndex=2,null!==e.exec("abcd")})),a=i||r((function(){return!s("a","y").sticky})),o=i||r((function(){var e=s("^r","gy");return e.lastIndex=2,null!==e.exec("str")}));e.exports={BROKEN_CARET:o,MISSED_STICKY:a,UNSUPPORTED_Y:i}},83635(e,t,n){"use strict";var r=n(79039),s=n(44576).RegExp;e.exports=r((function(){var e=s(".","s");return!(e.dotAll&&e.test("\n")&&"s"===e.flags)}))},18814(e,t,n){"use strict";var r=n(79039),s=n(44576).RegExp;e.exports=r((function(){var e=s("(?<a>b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$<a>c")}))},93389(e,t,n){"use strict";var r=n(44576),s=n(43724),i=Object.getOwnPropertyDescriptor;e.exports=function(e){if(!s)return r[e];var t=i(r,e);return t&&t.value}},3470(e){"use strict";e.exports=Object.is||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}},89286(e,t,n){"use strict";var r=n(94402),s=n(38469),i=r.Set,a=r.add;e.exports=function(e){var t=new i;return s(e,(function(e){a(t,e)})),t}},83440(e,t,n){"use strict";var r=n(97080),s=n(94402),i=n(89286),a=n(25170),o=n(83789),l=n(38469),c=n(40507),u=s.has,d=s.remove;e.exports=function(e){var t=r(this),n=o(e),s=i(t);return a(t)<=n.size?l(t,(function(e){n.includes(e)&&d(s,e)})):c(n.getIterator(),(function(e){u(t,e)&&d(s,e)})),s}},94402(e,t,n){"use strict";var r=n(79504),s=Set.prototype;e.exports={Set,add:r(s.add),has:r(s.has),remove:r(s.delete),proto:s}},68750(e,t,n){"use strict";var r=n(97080),s=n(94402),i=n(25170),a=n(83789),o=n(38469),l=n(40507),c=s.Set,u=s.add,d=s.has;e.exports=function(e){var t=r(this),n=a(e),s=new c;return i(t)>n.size?l(n.getIterator(),(function(e){d(t,e)&&u(s,e)})):o(t,(function(e){n.includes(e)&&u(s,e)})),s}},64449(e,t,n){"use strict";var r=n(97080),s=n(94402).has,i=n(25170),a=n(83789),o=n(38469),l=n(40507),c=n(9539);e.exports=function(e){var t=r(this),n=a(e);if(i(t)<=n.size)return!1!==o(t,(function(e){if(n.includes(e))return!1}),!0);var u=n.getIterator();return!1!==l(u,(function(e){if(s(t,e))return c(u,"normal",!1)}))}},53838(e,t,n){"use strict";var r=n(97080),s=n(25170),i=n(38469),a=n(83789);e.exports=function(e){var t=r(this),n=a(e);return!(s(t)>n.size)&&!1!==i(t,(function(e){if(!n.includes(e))return!1}),!0)}},28527(e,t,n){"use strict";var r=n(97080),s=n(94402).has,i=n(25170),a=n(83789),o=n(40507),l=n(9539);e.exports=function(e){var t=r(this),n=a(e);if(i(t)<n.size)return!1;var c=n.getIterator();return!1!==o(c,(function(e){if(!s(t,e))return l(c,"normal",!1)}))}},38469(e,t,n){"use strict";var r=n(79504),s=n(40507),i=n(94402),a=i.Set,o=i.proto,l=r(o.forEach),c=r(o.keys),u=c(new a).next;e.exports=function(e,t,n){return n?s({iterator:c(e),next:u},t):l(e,t)}},84916(e,t,n){"use strict";var r=n(97751),s=function(e){return{size:e,has:function(){return!1},keys:function(){return{next:function(){return{done:!0}}}}}};e.exports=function(e){var t=r("Set");try{(new t)[e](s(0));try{return(new t)[e](s(-1)),!1}catch(e){return!0}}catch(e){return!1}}},25170(e,t,n){"use strict";var r=n(46706),s=n(94402);e.exports=r(s.proto,"size","get")||function(e){return e.size}},87633(e,t,n){"use strict";var r=n(97751),s=n(62106),i=n(78227),a=n(43724),o=i("species");e.exports=function(e){var t=r(e);a&&t&&!t[o]&&s(t,o,{configurable:!0,get:function(){return this}})}},83650(e,t,n){"use strict";var r=n(97080),s=n(94402),i=n(89286),a=n(83789),o=n(40507),l=s.add,c=s.has,u=s.remove;e.exports=function(e){var t=r(this),n=a(e).getIterator(),s=i(t);return o(n,(function(e){c(t,e)?u(s,e):l(s,e)})),s}},10687(e,t,n){"use strict";var r=n(24913).f,s=n(39297),i=n(78227)("toStringTag");e.exports=function(e,t,n){e&&!n&&(e=e.prototype),e&&!s(e,i)&&r(e,i,{configurable:!0,value:t})}},44204(e,t,n){"use strict";var r=n(97080),s=n(94402).add,i=n(89286),a=n(83789),o=n(40507);e.exports=function(e){var t=r(this),n=a(e).getIterator(),l=i(t);return o(n,(function(e){s(l,e)})),l}},2293(e,t,n){"use strict";var r=n(28551),s=n(35548),i=n(64117),a=n(78227)("species");e.exports=function(e,t){var n,o=r(e).constructor;return void 0===o||i(n=r(o)[a])?t:s(n)}},68183(e,t,n){"use strict";var r=n(79504),s=n(91291),i=n(655),a=n(67750),o=r("".charAt),l=r("".charCodeAt),c=r("".slice),u=function(e){return function(t,n){var r,u,d=i(a(t)),h=s(n),f=d.length;return h<0||h>=f?e?"":void 0:(r=l(d,h))<55296||r>56319||h+1===f||(u=l(d,h+1))<56320||u>57343?e?o(d,h):r:e?c(d,h,h+2):u-56320+(r-55296<<10)+65536}};e.exports={codeAt:u(!1),charAt:u(!0)}},60533(e,t,n){"use strict";var r=n(79504),s=n(18014),i=n(655),a=n(72333),o=n(67750),l=r(a),c=r("".slice),u=Math.ceil,d=function(e){return function(t,n,r){var a,d,h=i(o(t)),f=s(n),p=h.length,g=void 0===r?" ":i(r);return f<=p||""===g?h:((d=l(g,u((a=f-p)/g.length))).length>a&&(d=c(d,0,a)),e?h+d:d+h)}};e.exports={start:d(!1),end:d(!0)}},3717(e,t,n){"use strict";var r=n(79504),s=2147483647,i=/[^\0-\u007E]/,a=/[.\u3002\uFF0E\uFF61]/g,o="Overflow: input needs wider integers to process",l=RangeError,c=r(a.exec),u=Math.floor,d=String.fromCharCode,h=r("".charCodeAt),f=r([].join),p=r([].push),g=r("".replace),m=r("".split),_=r("".toLowerCase),T=function(e){return e+22+75*(e<26)},E=function(e,t,n){var r=0;for(e=n?u(e/700):e>>1,e+=u(e/t);e>455;)e=u(e/35),r+=36;return u(r+36*e/(e+38))},y=function(e){var t=[];e=function(e){for(var t=[],n=0,r=e.length;n<r;){var s=h(e,n++);if(s>=55296&&s<=56319&&n<r){var i=h(e,n++);56320==(64512&i)?p(t,((1023&s)<<10)+(1023&i)+65536):(p(t,s),n--)}else p(t,s)}return t}(e);var n,r,i=e.length,a=128,c=0,g=72;for(n=0;n<e.length;n++)(r=e[n])<128&&p(t,d(r));var m=t.length,_=m;for(m&&p(t,"-");_<i;){var y=s;for(n=0;n<e.length;n++)(r=e[n])>=a&&r<y&&(y=r);var S=_+1;if(y-a>u((s-c)/S))throw new l(o);for(c+=(y-a)*S,a=y,n=0;n<e.length;n++){if((r=e[n])<a&&++c>s)throw new l(o);if(r===a){for(var v=c,b=36;;){var I=b<=g?1:b>=g+26?26:b-g;if(v<I)break;var A=v-I,R=36-I;p(t,d(T(I+A%R))),v=u(A/R),b+=36}p(t,d(T(v))),g=E(c,S,_===m),c=0,_++}}c++,a++}return f(t,"")};e.exports=function(e){var t,n,r=[],s=m(g(_(e),a,"."),".");for(t=0;t<s.length;t++)n=s[t],p(r,c(i,n)?"xn--"+y(n):n);return f(r,".")}},72333(e,t,n){"use strict";var r=n(91291),s=n(655),i=n(67750),a=RangeError;e.exports=function(e){var t=s(i(this)),n="",o=r(e);if(o<0||o===1/0)throw new a("Wrong number of repetitions");for(;o>0;(o>>>=1)&&(t+=t))1&o&&(n+=t);return n}},60706(e,t,n){"use strict";var r=n(10350).PROPER,s=n(79039),i=n(47452);e.exports=function(e){return s((function(){return!!i[e]()||"​…᠎"!=="​…᠎"[e]()||r&&i[e].name!==e}))}},58242(e,t,n){"use strict";var r=n(69565),s=n(97751),i=n(78227),a=n(36840);e.exports=function(){var e=s("Symbol"),t=e&&e.prototype,n=t&&t.valueOf,o=i("toPrimitive");t&&!t[o]&&a(t,o,(function(e){return r(n,this)}),{arity:1})}},91296(e,t,n){"use strict";var r=n(4495);e.exports=r&&!!Symbol.for&&!!Symbol.keyFor},59225(e,t,n){"use strict";var r,s,i,a,o=n(44576),l=n(18745),c=n(76080),u=n(94901),d=n(39297),h=n(79039),f=n(20397),p=n(67680),g=n(4055),m=n(22812),_=n(89544),T=n(38574),E=o.setImmediate,y=o.clearImmediate,S=o.process,v=o.Dispatch,b=o.Function,I=o.MessageChannel,A=o.String,R=0,C={},k="onreadystatechange";h((function(){r=o.location}));var L=function(e){if(d(C,e)){var t=C[e];delete C[e],t()}},O=function(e){return function(){L(e)}},N=function(e){L(e.data)},w=function(e){o.postMessage(A(e),r.protocol+"//"+r.host)};E&&y||(E=function(e){m(arguments.length,1);var t=u(e)?e:b(e),n=p(arguments,1);return C[++R]=function(){l(t,void 0,n)},s(R),R},y=function(e){delete C[e]},T?s=function(e){S.nextTick(O(e))}:v&&v.now?s=function(e){v.now(O(e))}:I&&!_?(a=(i=new I).port2,i.port1.onmessage=N,s=c(a.postMessage,a)):o.addEventListener&&u(o.postMessage)&&!o.importScripts&&r&&"file:"!==r.protocol&&!h(w)?(s=w,o.addEventListener("message",N,!1)):s=k in g("script")?function(e){f.appendChild(g("script"))[k]=function(){f.removeChild(this),L(e)}}:function(e){setTimeout(O(e),0)}),e.exports={set:E,clear:y}},31240(e,t,n){"use strict";var r=n(79504);e.exports=r(1..valueOf)},67416(e,t,n){"use strict";var r=n(79039),s=n(78227),i=n(43724),a=n(96395),o=s("iterator");e.exports=!r((function(){var e=new URL("b?a=1&b=2&c=3","https://a"),t=e.searchParams,n=new URLSearchParams("a=1&a=2&b=3"),r="";return e.pathname="c%20d",t.forEach((function(e,n){t.delete("b"),r+=n+e})),n.delete("a",2),n.delete("b",void 0),a&&(!e.toJSON||!n.has("a",1)||n.has("a",2)||!n.has("a",void 0)||n.has("b"))||!t.size&&(a||!i)||!t.sort||"https://a/c%20d?a=1&c=3"!==e.href||"3"!==t.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!t[o]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("https://тест").host||"#%D0%B1"!==new URL("https://a#б").hash||"a1c3"!==r||"x"!==new URL("https://x",void 0).host}))},70511(e,t,n){"use strict";var r=n(19167),s=n(39297),i=n(1951),a=n(24913).f;e.exports=function(e){var t=r.Symbol||(r.Symbol={});s(t,e)||a(t,e,{value:i.f(e)})}},1951(e,t,n){"use strict";var r=n(78227);t.f=r},28706(e,t,n){"use strict";var r=n(46518),s=n(79039),i=n(34376),a=n(20034),o=n(48981),l=n(26198),c=n(96837),u=n(97040),d=n(1469),h=n(70597),f=n(78227),p=n(39519),g=f("isConcatSpreadable"),m=p>=51||!s((function(){var e=[];return e[g]=!1,e.concat()[0]!==e})),_=function(e){if(!a(e))return!1;var t=e[g];return void 0!==t?!!t:i(e)};r({target:"Array",proto:!0,arity:1,forced:!m||!h("concat")},{concat:function(e){var t,n,r,s,i,a=o(this),h=d(a,0),f=0;for(t=-1,r=arguments.length;t<r;t++)if(_(i=-1===t?a:arguments[t]))for(s=l(i),c(f+s),n=0;n<s;n++,f++)n in i&&u(h,f,i[n]);else c(f+1),u(h,f++,i);return h.length=f,h}})},2008(e,t,n){"use strict";var r=n(46518),s=n(59213).filter;r({target:"Array",proto:!0,forced:!n(70597)("filter")},{filter:function(e){return s(this,e,arguments.length>1?arguments[1]:void 0)}})},51629(e,t,n){"use strict";var r=n(46518),s=n(90235);r({target:"Array",proto:!0,forced:[].forEach!==s},{forEach:s})},23418(e,t,n){"use strict";var r=n(46518),s=n(97916);r({target:"Array",stat:!0,forced:!n(84428)((function(e){Array.from(e)}))},{from:s})},74423(e,t,n){"use strict";var r=n(46518),s=n(19617).includes,i=n(79039),a=n(6469);r({target:"Array",proto:!0,forced:i((function(){return!Array(1).includes()}))},{includes:function(e){return s(this,e,arguments.length>1?arguments[1]:void 0)}}),a("includes")},64346(e,t,n){"use strict";n(46518)({target:"Array",stat:!0},{isArray:n(34376)})},23792(e,t,n){"use strict";var r=n(25397),s=n(6469),i=n(26269),a=n(91181),o=n(24913).f,l=n(51088),c=n(62529),u=n(96395),d=n(43724),h="Array Iterator",f=a.set,p=a.getterFor(h);e.exports=l(Array,"Array",(function(e,t){f(this,{type:h,target:r(e),index:0,kind:t})}),(function(){var e=p(this),t=e.target,n=e.index++;if(!t||n>=t.length)return e.target=null,c(void 0,!0);switch(e.kind){case"keys":return c(n,!1);case"values":return c(t[n],!1)}return c([n,t[n]],!1)}),"values");var g=i.Arguments=i.Array;
vendor: 6,645 bytes, line 1
1if(s("keys"),s("values"),s("entries"),!u&&d&&"values"!==g.name)try{o(g,"name",{value:"values"})}catch(e){}},48598(e,t,n){"use strict";var r=n(46518),s=n(79504),i=n(47055),a=n(25397),o=n(34598),l=s([].join);r({target:"Array",proto:!0,forced:i!==Object||!o("join",",")},{join:function(e){return l(a(this),void 0===e?",":e)}})},62062(e,t,n){"use strict";var r=n(46518),s=n(59213).map;r({target:"Array",proto:!0,forced:!n(70597)("map")},{map:function(e){return s(this,e,arguments.length>1?arguments[1]:void 0)}})},44114(e,t,n){"use strict";var r=n(46518),s=n(48981),i=n(26198),a=n(34527),o=n(96837);r({target:"Array",proto:!0,arity:1,forced:n(79039)((function(){return 4294967297!==[].push.call({length:4294967296},1)}))||!function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(e){return e instanceof TypeError}}()},{push:function(e){var t=s(this),n=i(t),r=arguments.length;o(n+r);for(var l=0;l<r;l++)t[n]=arguments[l],n++;return a(t,n),n}})},72712(e,t,n){"use strict";var r=n(46518),s=n(80926).left,i=n(34598),a=n(39519);r({target:"Array",proto:!0,forced:!n(38574)&&a>79&&a<83||!i("reduce")},{reduce:function(e){var t=arguments.length;return s(this,e,t,t>1?arguments[1]:void 0)}})},94490(e,t,n){"use strict";var r=n(46518),s=n(79504),i=n(34376),a=s([].reverse),o=[1,2];r({target:"Array",proto:!0,forced:String(o)===String(o.reverse())},{reverse:function(){return i(this)&&(this.length=this.length),a(this)}})},34782(e,t,n){"use strict";var r=n(46518),s=n(34376),i=n(33517),a=n(20034),o=n(35610),l=n(26198),c=n(25397),u=n(97040),d=n(78227),h=n(70597),f=n(67680),p=h("slice"),g=d("species"),m=Array,_=Math.max;r({target:"Array",proto:!0,forced:!p},{slice:function(e,t){var n,r,d,h=c(this),p=l(h),T=o(e,p),E=o(void 0===t?p:t,p);if(s(h)&&(n=h.constructor,(i(n)&&(n===m||s(n.prototype))||a(n)&&null===(n=n[g]))&&(n=void 0),n===m||void 0===n))return f(h,T,E);for(r=new(void 0===n?m:n)(_(E-T,0)),d=0;T<E;T++,d++)T in h&&u(r,d,h[T]);return r.length=d,r}})},15086(e,t,n){"use strict";var r=n(46518),s=n(59213).some;r({target:"Array",proto:!0,forced:!n(34598)("some")},{some:function(e){return s(this,e,arguments.length>1?arguments[1]:void 0)}})},54554(e,t,n){"use strict";var r=n(46518),s=n(48981),i=n(35610),a=n(91291),o=n(26198),l=n(34527),c=n(96837),u=n(1469),d=n(97040),h=n(84606),f=n(70597)("splice"),p=Math.max,g=Math.min;r({target:"Array",proto:!0,forced:!f},{splice:function(e,t){var n,r,f,m,_,T,E=s(this),y=o(E),S=i(e,y),v=arguments.length;for(0===v?n=r=0:1===v?(n=0,r=y-S):(n=v-2,r=g(p(a(t),0),y-S)),c(y+n-r),f=u(E,r),m=0;m<r;m++)(_=S+m)in E&&d(f,m,E[_]);if(f.length=r,n<r){for(m=S;m<y-r;m++)T=m+n,(_=m+r)in E?E[T]=E[_]:h(E,T);for(m=y;m>y-r+n;m--)h(E,m-1)}else if(n>r)for(m=y-r;m>S;m--)T=m+n-1,(_=m+r-1)in E?E[T]=E[_]:h(E,T);for(m=0;m<n;m++)E[m+S]=arguments[m+2];return l(E,y-r+n),f}})},13609(e,t,n){"use strict";var r=n(46518),s=n(48981),i=n(26198),a=n(34527),o=n(84606),l=n(96837);r({target:"Array",proto:!0,arity:1,forced:1!==[].unshift(0)||!function(){try{Object.defineProperty([],"length",{writable:!1}).unshift()}catch(e){return e instanceof TypeError}}()},{unshift:function(e){var t=s(this),n=i(t),r=arguments.length;if(r){l(n+r);for(var c=n;c--;){var u=c+r;c in t?t[u]=t[c]:o(t,u)}for(var d=0;d<r;d++)t[d]=arguments[d]}return a(t,n+r)}})},1688(e,t,n){"use strict";var r=n(46518),s=n(70380);r({target:"Date",proto:!0,forced:Date.prototype.toISOString!==s},{toISOString:s})},60739(e,t,n){"use strict";var r=n(46518),s=n(79039),i=n(48981),a=n(72777);r({target:"Date",proto:!0,arity:1,forced:s((function(){return null!==new Date(NaN).toJSON()||1!==Date.prototype.toJSON.call({toISOString:function(){return 1}})}))},{toJSON:function(e){var t=i(this),n=a(t,"number");return"number"!=typeof n||isFinite(n)?t.toISOString():null}})},89572(e,t,n){"use strict";var r=n(39297),s=n(36840),i=n(53640),a=n(78227)("toPrimitive"),o=Date.prototype;r(o,a)||s(o,a,i)},94170(e,t,n){"use strict";var r=n(46518),s=n(30566);r({target:"Function",proto:!0,forced:Function.bind!==s},{bind:s})},62010(e,t,n){"use strict";var r=n(43724),s=n(10350).EXISTS,i=n(79504),a=n(62106),o=Function.prototype,l=i(o.toString),c=/function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/,u=i(c.exec);r&&!s&&a(o,"name",{configurable:!0,get:function(){try{return u(c,l(this))[1]}catch(e){return""}}})},22489(e,t,n){"use strict";var r=n(46518),s=n(69565),i=n(79306),a=n(28551),o=n(1767),l=n(19462),c=n(96319),u=n(96395),d=l((function(){for(var e,t,n=this.iterator,r=this.predicate,i=this.next;;){if(e=a(s(i,n)),this.done=!!e.done)return;if(t=e.value,c(n,r,[t,this.counter++],!0))return t}}));r({target:"Iterator",proto:!0,real:!0,forced:u},{filter:function(e){return a(this),i(e),new d(o(this),{predicate:e})}})},7588(e,t,n){"use strict";var r=n(46518),s=n(72652),i=n(79306),a=n(28551),o=n(1767);r({target:"Iterator",proto:!0,real:!0},{forEach:function(e){a(this),i(e);var t=o(this),n=0;s(t,(function(t){e(t,n++)}),{IS_RECORD:!0})}})},61701(e,t,n){"use strict";var r=n(46518),s=n(20713);r({target:"Iterator",proto:!0,real:!0,forced:n(96395)},{map:s})},18237(e,t,n){"use strict";var r=n(46518),s=n(72652),i=n(79306),a=n(28551),o=n(1767),l=TypeError;r({target:"Iterator",proto:!0,real:!0},{reduce:function(e){a(this),i(e);var t=o(this),n=arguments.length<2,r=n?void 0:arguments[1],c=0;if(s(t,(function(t){n?(n=!1,r=t):r=e(r,t,c),c++}),{IS_RECORD:!0}),n)throw new l("Reduce of empty iterator with no initial value");return r}})},13579(e,t,n){"use strict";var r=n(46518),s=n(72652),i=n(79306),a=n(28551),o=n(1767);r({target:"Iterator",proto:!0,real:!0},{some:function(e){a(this),i(e);var t=o(this),n=0;return s(t,(function(t,r){if(e(t,n++))return r()}),{IS_RECORD:!0,INTERRUPTED:!0}).stopped}})},33110(e,t,n){"use strict";var r=n(46518),s=n(97751),i=n(18745),a=n(69565),o=n(79504),l=n(79039),c=n(94901),u=n(10757),d=n(67680),h=n(66933),f=n(4495),p=String,g=s("JSON","stringify"),m=o(/./.exec),_=o("".charAt),T=o("".charCodeAt),E=o("".replace),y=o(1..toString),S=/[\uD800-\uDFFF]/g,v=/^[\uD800-\uDBFF]$/,b=/^[\uDC00-\uDFFF]$/,I=!f||l((function(){var e=s("Symbol")("stringify detection");return"[null]"!==g([e])||"{}"!==g({a:e})||"{}"!==g(Object(e))})),A=l((function(){return'"\\udf06\\ud834"'!==g("\udf06\ud834")||'"\\udead"'!==g("\udead")})),R=function(e,t){var n=d(arguments),r=h(t);if(c(r)||void 0!==e&&!u(e))return n[1]=function(e,t){if(c(r)&&(t=a(r,this,p(e),t)),!u(t))return t},i(g,null,n)},C=function(e,t,n){var r=_(n,t-1),s=_(n,t+1);return m(v,e)&&!m(b,s)||m(b,e)&&!m(v,r)?"\\u"+y(T(e,0),16):e};g&&r({target:"JSON",stat:!0,arity:3,forced:I||A},{stringify:function(e,t,n){var r=d(arguments),s=i(I?R:g,null,r);return A&&"string"==typeof s?E(s,S,C):s}})}
1,4731(e,t,n){"use strict";var r=n(44576);n(10687)(r.JSON,"JSON",!0)},48523(e,t,n){"use strict";n(16468)("Map",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),n(86938))},36033(e,t,n){"use strict";n(48523)},60479(e,t,n){"use strict";n(10687)(Math,"Math",!0)},2892(e,t,n){"use strict";var r=n(46518),s=n(96395),i=n(43724),a=n(44576),o=n(19167),l=n(79504),c=n(92796),u=n(39297),d=n(23167),h=n(1625),f=n(10757),p=n(72777),g=n(79039),m=n(38480).f,_=n(77347).f,T=n(24913).f,E=n(31240),y=n(43802).trim,S="Number",v=a[S],b=o[S],I=v.prototype,A=a.TypeError,R=l("".slice),C=l("".charCodeAt),k=function(e){var t,n,r,s,i,a,o,l,c=p(e,"number");if(f(c))throw new A("Cannot convert a Symbol value to a number");if("string"==typeof c&&c.length>2)if(c=y(c),43===(t=C(c,0))||45===t){if(88===(n=C(c,2))||120===n)return NaN}else if(48===t){switch(C(c,1)){case 66:case 98:r=2,s=49;break;case 79:case 111:r=8,s=55;break;default:return+c}for(a=(i=R(c,2)).length,o=0;o<a;o++)if((l=C(i,o))<48||l>s)return NaN;return parseInt(i,r)}return+c},L=c(S,!v(" 0o1")||!v("0b1")||v("+0x1")),O=function(e){var t,n=arguments.length<1?0:v(function(e){var t=p(e,"number");return"bigint"==typeof t?t:k(t)}(e));return h(I,t=this)&&g((function(){E(t)}))?d(Object(n),this,O):n};O.prototype=I,L&&!s&&(I.constructor=O),r({global:!0,constructor:!0,wrap:!0,forced:L},{Number:O});var N=function(e,t){for(var n,r=i?m(t):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,isFinite,isInteger,isNaN,isSafeInteger,parseFloat,parseInt,fromString,range".split(","),s=0;r.length>s;s++)u(t,n=r[s])&&!u(e,n)&&T(e,n,_(t,n))};s&&b&&N(o[S],b),(L||s)&&N(o[S],v)},87220(e,t,n){"use strict";var r=n(46518),s=n(33904);r({target:"Number",stat:!0,forced:Number.parseFloat!==s},{parseFloat:s})},25843(e,t,n){"use strict";var r=n(46518),s=n(52703);r({target:"Number",stat:!0,forced:Number.parseInt!==s},{parseInt:s})},69085(e,t,n){"use strict";var r=n(46518),s=n(44213);r({target:"Object",stat:!0,arity:2,forced:Object.assign!==s},{assign:s})},59904(e,t,n){"use strict";n(46518)({target:"Object",stat:!0,sham:!n(43724)},{create:n(2360)})},67945(e,t,n){"use strict";var r=n(46518),s=n(43724),i=n(96801).f;r({target:"Object",stat:!0,forced:Object.defineProperties!==i,sham:!s},{defineProperties:i})},84185(e,t,n){"use strict";var r=n(46518),s=n(43724),i=n(24913).f;r({target:"Object",stat:!0,forced:Object.defineProperty!==i,sham:!s},{defineProperty:i})},5506(e,t,n){"use strict";var r=n(46518),s=n(32357).entries;r({target:"Object",stat:!0},{entries:function(e){return s(e)}})},83851(e,t,n){"use strict";var r=n(46518),s=n(79039),i=n(25397),a=n(77347).f,o=n(43724);r({target:"Object",stat:!0,forced:!o||s((function(){a(1)})),sham:!o},{getOwnPropertyDescriptor:function(e,t){return a(i(e),t)}})},81278(e,t,n){"use strict";var r=n(46518),s=n(43724),i=n(35031),a=n(25397),o=n(77347),l=n(97040);r({target:"Object",stat:!0,sham:!s},{getOwnPropertyDescriptors:function(e){for(var t,n,r=a(e),s=o.f,c=i(r),u={},d=0;c.length>d;)void 0!==(n=s(r,t=c[d++]))&&l(u,t,n);return u}})},1480(e,t,n){"use strict";var r=n(46518),s=n(79039),i=n(10298).f;r({target:"Object",stat:!0,forced:s((function(){return!Object.getOwnPropertyNames(1)}))},{getOwnPropertyNames:i})},49773(e,t,n){"use strict";
vendor: 4,195 bytes, line 1
1var r=n(46518),s=n(4495),i=n(79039),a=n(33717),o=n(48981);r({target:"Object",stat:!0,forced:!s||i((function(){a.f(1)}))},{getOwnPropertySymbols:function(e){var t=a.f;return t?t(o(e)):[]}})},40875(e,t,n){"use strict";var r=n(46518),s=n(79039),i=n(48981),a=n(42787),o=n(12211);r({target:"Object",stat:!0,forced:s((function(){a(1)})),sham:!o},{getPrototypeOf:function(e){return a(i(e))}})},79432(e,t,n){"use strict";var r=n(46518),s=n(48981),i=n(71072);r({target:"Object",stat:!0,forced:n(79039)((function(){i(1)}))},{keys:function(e){return i(s(e))}})},63548(e,t,n){"use strict";var r=n(43724),s=n(62106),i=n(20034),a=n(13925),o=n(48981),l=n(67750),c=Object.getPrototypeOf,u=Object.setPrototypeOf,d=Object.prototype,h="__proto__";if(r&&c&&u&&!(h in d))try{s(d,h,{configurable:!0,get:function(){return c(o(this))},set:function(e){var t=l(this);a(e)&&i(t)&&u(t,e)}})}catch(e){}},10287(e,t,n){"use strict";n(46518)({target:"Object",stat:!0},{setPrototypeOf:n(52967)})},16034(e,t,n){"use strict";var r=n(46518),s=n(32357).values;r({target:"Object",stat:!0},{values:function(e){return s(e)}})},16499(e,t,n){"use strict";var r=n(46518),s=n(69565),i=n(79306),a=n(36043),o=n(1103),l=n(72652);r({target:"Promise",stat:!0,forced:n(90537)},{all:function(e){var t=this,n=a.f(t),r=n.resolve,c=n.reject,u=o((function(){var n=i(t.resolve),a=[],o=0,u=1;l(e,(function(e){var i=o++,l=!1;u++,s(n,t,e).then((function(e){l||(l=!0,a[i]=e,--u||r(a))}),c)})),--u||r(a)}));return u.error&&c(u.value),n.promise}})},82003(e,t,n){"use strict";var r=n(46518),s=n(96395),i=n(10916).CONSTRUCTOR,a=n(80550),o=n(97751),l=n(94901),c=n(36840),u=a&&a.prototype;if(r({target:"Promise",proto:!0,forced:i,real:!0},{catch:function(e){return this.then(void 0,e)}}),!s&&l(a)){var d=o("Promise").prototype.catch;u.catch!==d&&c(u,"catch",d,{unsafe:!0})}},10436(e,t,n){"use strict";var r,s,i,a=n(46518),o=n(96395),l=n(38574),c=n(44576),u=n(69565),d=n(36840),h=n(52967),f=n(10687),p=n(87633),g=n(79306),m=n(94901),_=n(20034),T=n(90679),E=n(2293),y=n(59225).set,S=n(91955),v=n(90757),b=n(1103),I=n(18265),A=n(91181),R=n(80550),C=n(10916),k=n(36043),L="Promise",O=C.CONSTRUCTOR,N=C.REJECTION_EVENT,w=C.SUBCLASSING,P=A.getterFor(L),M=A.set,D=R&&R.prototype,x=R,U=D,B=c.TypeError,F=c.document,$=c.process,G=k.f,H=G,j=!!(F&&F.createEvent&&c.dispatchEvent),W="unhandledrejection",K=function(e){var t;return!(!_(e)||!m(t=e.then))&&t},V=function(e,t){var n,r,s,i=t.value,a=1===t.state,o=a?e.ok:e.fail,l=e.resolve,c=e.reject,d=e.domain;try{o?(a||(2===t.rejection&&X(t),t.rejection=1),!0===o?n=i:(d&&d.enter(),n=o(i),d&&(d.exit(),s=!0)),n===e.promise?c(new B("Promise-chain cycle")):(r=K(n))?u(r,n,l,c):l(n)):c(i)}catch(e){d&&!s&&d.exit(),c(e)}},q=function(e,t){e.notified||(e.notified=!0,S((function(){for(var n,r=e.reactions;n=r.get();)V(n,e);e.notified=!1,t&&!e.rejection&&z(e)})))},Y=function(e,t,n){var r,s;j?((r=F.createEvent("Event")).promise=t,r.reason=n,r.initEvent(e,!1,!0),c.dispatchEvent(r)):r={promise:t,reason:n},!N&&(s=c["on"+e])?s(r):e===W&&v("Unhandled promise rejection",n)},z=function(e){u(y,c,(function(){var t,n=e.facade,r=e.value;if(J(e)&&(t=b((function(){l?$.emit("unhandledRejection",r,n):Y(W,n,r)})),e.rejection=l||J(e)?2:1,t.error))throw t.value}))},J=function(e){return 1!==e.rejection&&!e.parent},X=function(e){u(y,c,(function(){var t=e.facade;l?$.emit("rejectionHandled",t):Y("rejectionhandled",t,e.value)}))},Q=function(e,t,n){return function(r){e(t,r,n)}},Z=function(e,t,n){e.done||(e.done=!0,n&&(e=n),e.value=t,e.state=2,q(e,!0))},ee=function(e,t,n){if(!e.done){e.done=!0,n&&(e=n);try{if(e.facade===t)throw new B("Promise can't be resolved itself");var r=K(t);r?S((function(){var n={done:!1};try{u(r,t,Q(ee,n,e),Q(Z,n,e))}catch(t){Z(n,t,e)}})):(e.value=t,e.state=1,q(e,!1))}catch(t){Z({done:!1},t,e)}}};if(O&&(U=(x=function(e){T(this,U),g(e),u(r,this);var t=P(this);try{e(Q(ee,t),Q(Z,t))}catch(e){Z(t,e)}}).prototype,(r=function(e){M(this,{type:L,done:!1,notified:!1,parent:!1,reactions:new I,rejection:!1,state:0,value:null})}).prototype=d(U,"then",(function(e,t){var n=P(this),r=G(E(this,x));return n.parent=!0,r.ok=!m(e)||e,r.fail=m(t)&&t,r.domain=l?$.domain:void 0,0===n.state?n.reactions.add(r):S((function(){V(r,n)}
vendor: 4,599 bytes, line 1
1)),r.promise})),s=function(){var e=new r,t=P(e);this.promise=e,this.resolve=Q(ee,t),this.reject=Q(Z,t)},k.f=G=function(e){return e===x||undefined===e?new s(e):H(e)},!o&&m(R)&&D!==Object.prototype)){i=D.then,w||d(D,"then",(function(e,t){var n=this;return new x((function(e,t){u(i,n,e,t)})).then(e,t)}),{unsafe:!0});try{delete D.constructor}catch(e){}h&&h(D,U)}a({global:!0,constructor:!0,wrap:!0,forced:O},{Promise:x}),f(x,L,!1,!0),p(L)},3362(e,t,n){"use strict";n(10436),n(16499),n(82003),n(7743),n(51481),n(40280)},7743(e,t,n){"use strict";var r=n(46518),s=n(69565),i=n(79306),a=n(36043),o=n(1103),l=n(72652);r({target:"Promise",stat:!0,forced:n(90537)},{race:function(e){var t=this,n=a.f(t),r=n.reject,c=o((function(){var a=i(t.resolve);l(e,(function(e){s(a,t,e).then(n.resolve,r)}))}));return c.error&&r(c.value),n.promise}})},51481(e,t,n){"use strict";var r=n(46518),s=n(36043);r({target:"Promise",stat:!0,forced:n(10916).CONSTRUCTOR},{reject:function(e){var t=s.f(this);return(0,t.reject)(e),t.promise}})},40280(e,t,n){"use strict";var r=n(46518),s=n(97751),i=n(96395),a=n(80550),o=n(10916).CONSTRUCTOR,l=n(93438),c=s("Promise"),u=i&&!o;r({target:"Promise",stat:!0,forced:i||o},{resolve:function(e){return l(u&&this===c?a:this,e)}})},60825(e,t,n){"use strict";var r=n(46518),s=n(97751),i=n(18745),a=n(30566),o=n(35548),l=n(28551),c=n(20034),u=n(2360),d=n(79039),h=s("Reflect","construct"),f=Object.prototype,p=[].push,g=d((function(){function e(){}return!(h((function(){}),[],e)instanceof e)})),m=!d((function(){h((function(){}))})),_=g||m;r({target:"Reflect",stat:!0,forced:_,sham:_},{construct:function(e,t){o(e),l(t);var n=arguments.length<3?e:o(arguments[2]);if(m&&!g)return h(e,t,n);if(e===n){switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3])}var r=[null];return i(p,r,t),new(i(a,e,r))}var s=n.prototype,d=u(c(s)?s:f),_=i(e,d,t);return c(_)?_:d}})},40888(e,t,n){"use strict";var r=n(46518),s=n(69565),i=n(20034),a=n(28551),o=n(16575),l=n(77347),c=n(42787);r({target:"Reflect",stat:!0},{get:function e(t,n){var r,u,d=arguments.length<3?t:arguments[2];return a(t)===d?t[n]:(r=l.f(t,n))?o(r)?r.value:void 0===r.get?void 0:s(r.get,d):i(u=c(t))?e(u,n,d):void 0}})},27495(e,t,n){"use strict";var r=n(46518),s=n(57323);r({target:"RegExp",proto:!0,forced:/./.exec!==s},{exec:s})},90906(e,t,n){"use strict";n(27495);var r,s,i=n(46518),a=n(69565),o=n(94901),l=n(28551),c=n(655),u=(r=!1,(s=/[ac]/).exec=function(){return r=!0,/./.exec.apply(this,arguments)},!0===s.test("abc")&&r),d=/./.test;i({target:"RegExp",proto:!0,forced:!u},{test:function(e){var t=l(this),n=c(e),r=t.exec;if(!o(r))return a(d,t,n);var s=a(r,t,n);return null!==s&&(l(s),!0)}})},92405(e,t,n){"use strict";n(16468)("Set",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),n(86938))},17642(e,t,n){"use strict";var r=n(46518),s=n(83440);r({target:"Set",proto:!0,real:!0,forced:!n(84916)("difference")},{difference:s})},58004(e,t,n){"use strict";var r=n(46518),s=n(79039),i=n(68750);r({target:"Set",proto:!0,real:!0,forced:!n(84916)("intersection")||s((function(){return"3,2"!==String(Array.from(new Set([1,2,3]).intersection(new Set([3,2]))))}))},{intersection:i})},33853(e,t,n){"use strict";var r=n(46518),s=n(64449);r({target:"Set",proto:!0,real:!0,forced:!n(84916)("isDisjointFrom")},{isDisjointFrom:s})},45876(e,t,n){"use strict";var r=n(46518),s=n(53838);r({target:"Set",proto:!0,real:!0,forced:!n(84916)("isSubsetOf")},{isSubsetOf:s})},32475(e,t,n){"use strict";var r=n(46518),s=n(28527);r({target:"Set",proto:!0,real:!0,forced:!n(84916)("isSupersetOf")},{isSupersetOf:s})},31415(e,t,n){"use strict";n(92405)},15024(e,t,n){"use strict";var r=n(46518),s=n(83650);r({target:"Set",proto:!0,real:!0,forced:!n(84916)("symmetricDifference")},{symmetricDifference:s})},31698(e,t,n){"use strict";var r=n(46518),s=n(44204);r({target:"Set",proto:!0,real:!0,forced:!n(84916)("union")},{union:s})},27337(e,t,n){"use strict";var r=n(46518),s=n(79504),i=n(35610),a=RangeError,o=String.fromCharCode,l=String.fromCodePoint,c=s([].join);r({target:"String",stat:!0,arity:1,forced:!!l&&1!==l.length},{fromCodePoint:function(e){for(var t,n=[],r=arguments.length,s=0;r>s;){if(t=+arguments[s++],i(t,1114111)!==t)throw new a(t+" is not a valid code point");n[s]=t<65536?o(t):o(55296+((t-=65536)>>10),t%1024+56320)}return c(n,"")}})},21699(e,t,n){"use strict";var r=n(46518),s=n(79504),i=n(60511),a=n(67750),o=n(655),l=n(41436),c=s("".indexOf);r({target:"String",proto:!0,forced:!l("includes")}
vendor: 12,556 bytes, line 1
1,{includes:function(e){return!!~c(o(a(this)),o(i(e)),arguments.length>1?arguments[1]:void 0)}})},47764(e,t,n){"use strict";var r=n(68183).charAt,s=n(655),i=n(91181),a=n(51088),o=n(62529),l="String Iterator",c=i.set,u=i.getterFor(l);a(String,"String",(function(e){c(this,{type:l,string:s(e),index:0})}),(function(){var e,t=u(this),n=t.string,s=t.index;return s>=n.length?o(void 0,!0):(e=r(n,s),t.index+=e.length,o(e,!1))}))},71761(e,t,n){"use strict";var r=n(69565),s=n(89228),i=n(28551),a=n(64117),o=n(18014),l=n(655),c=n(67750),u=n(55966),d=n(57829),h=n(56682);s("match",(function(e,t,n){return[function(t){var n=c(this),s=a(t)?void 0:u(t,e);return s?r(s,t,n):new RegExp(t)[e](l(n))},function(e){var r=i(this),s=l(e),a=n(t,r,s);if(a.done)return a.value;if(!r.global)return h(r,s);var c=r.unicode;r.lastIndex=0;for(var u,f=[],p=0;null!==(u=h(r,s));){var g=l(u[0]);f[p]=g,""===g&&(r.lastIndex=d(s,o(r.lastIndex),c)),p++}return 0===p?null:f}]}))},25440(e,t,n){"use strict";var r=n(18745),s=n(69565),i=n(79504),a=n(89228),o=n(79039),l=n(28551),c=n(94901),u=n(64117),d=n(91291),h=n(18014),f=n(655),p=n(67750),g=n(57829),m=n(55966),_=n(2478),T=n(56682),E=n(78227)("replace"),y=Math.max,S=Math.min,v=i([].concat),b=i([].push),I=i("".indexOf),A=i("".slice),R="$0"==="a".replace(/./,"$0"),C=!!/./[E]&&""===/./[E]("a","$0");a("replace",(function(e,t,n){var i=C?"$":"$0";return[function(e,n){var r=p(this),i=u(e)?void 0:m(e,E);return i?s(i,e,r,n):s(t,f(r),e,n)},function(e,s){var a=l(this),o=f(e);if("string"==typeof s&&-1===I(s,i)&&-1===I(s,"$<")){var u=n(t,a,o,s);if(u.done)return u.value}var p=c(s);p||(s=f(s));var m,E=a.global;E&&(m=a.unicode,a.lastIndex=0);for(var R,C=[];null!==(R=T(a,o))&&(b(C,R),E);){""===f(R[0])&&(a.lastIndex=g(o,h(a.lastIndex),m))}for(var k,L="",O=0,N=0;N<C.length;N++){for(var w,P=f((R=C[N])[0]),M=y(S(d(R.index),o.length),0),D=[],x=1;x<R.length;x++)b(D,void 0===(k=R[x])?k:String(k));var U=R.groups;if(p){var B=v([P],D,M,o);void 0!==U&&b(B,U),w=f(r(s,void 0,B))}else w=_(P,o,M,D,U,s);M>=O&&(L+=A(o,O,M)+w,O=M+P.length)}return L+A(o,O)}]}),!!o((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")}))||!R||C)},5746(e,t,n){"use strict";var r=n(69565),s=n(89228),i=n(28551),a=n(64117),o=n(67750),l=n(3470),c=n(655),u=n(55966),d=n(56682);s("search",(function(e,t,n){return[function(t){var n=o(this),s=a(t)?void 0:u(t,e);return s?r(s,t,n):new RegExp(t)[e](c(n))},function(e){var r=i(this),s=c(e),a=n(t,r,s);if(a.done)return a.value;var o=r.lastIndex;l(o,0)||(r.lastIndex=0);var u=d(r,s);return l(r.lastIndex,o)||(r.lastIndex=o),null===u?-1:u.index}]}))},42762(e,t,n){"use strict";var r=n(46518),s=n(43802).trim;r({target:"String",proto:!0,forced:n(60706)("trim")},{trim:function(){return s(this)}})},66412(e,t,n){"use strict";n(70511)("asyncIterator")},6761(e,t,n){"use strict";var r=n(46518),s=n(44576),i=n(69565),a=n(79504),o=n(96395),l=n(43724),c=n(4495),u=n(79039),d=n(39297),h=n(1625),f=n(28551),p=n(25397),g=n(56969),m=n(655),_=n(6980),T=n(2360),E=n(71072),y=n(38480),S=n(10298),v=n(33717),b=n(77347),I=n(24913),A=n(96801),R=n(48773),C=n(36840),k=n(62106),L=n(25745),O=n(66119),N=n(30421),w=n(33392),P=n(78227),M=n(1951),D=n(70511),x=n(58242),U=n(10687),B=n(91181),F=n(59213).forEach,$=O("hidden"),G="Symbol",H="prototype",j=B.set,W=B.getterFor(G),K=Object[H],V=s.Symbol,q=V&&V[H],Y=s.RangeError,z=s.TypeError,J=s.QObject,X=b.f,Q=I.f,Z=S.f,ee=R.f,te=a([].push),ne=L("symbols"),re=L("op-symbols"),se=L("wks"),ie=!J||!J[H]||!J[H].findChild,ae=function(e,t,n){var r=X(K,t);r&&delete K[t],Q(e,t,n),r&&e!==K&&Q(K,t,r)},oe=l&&u((function(){return 7!==T(Q({},"a",{get:function(){return Q(this,"a",{value:7}).a}})).a}))?ae:Q,le=function(e,t){var n=ne[e]=T(q);return j(n,{type:G,tag:e,description:t}),l||(n.description=t),n},ce=function(e,t,n){e===K&&ce(re,t,n),f(e);var r=g(t);return f(n),d(ne,r)?(n.enumerable?(d(e,$)&&e[$][r]&&(e[$][r]=!1),n=T(n,{enumerable:_(0,!1)})):(d(e,$)||Q(e,$,_(1,T(null))),e[$][r]=!0),oe(e,r,n)):Q(e,r,n)},ue=function(e,t){f(e);var n=p(t),r=E(n).concat(pe(n));return F(r,(function(t){l&&!i(de,n,t)||ce(e,t,n[t])})),e},de=function(e){var t=g(e),n=i(ee,this,t);return!(this===K&&d(ne,t)&&!d(re,t))&&(!(n||!d(this,t)||!d(ne,t)||d(this,$)&&this[$][t])||n)},he=function(e,t){var n=p(e),r=g(t);if(n!==K||!d(ne,r)||d(re,r)){var s=X(n,r);return!s||!d(ne,r)||d(n,$)&&n[$][r]||(s.enumerable=!0),s}},fe=function(e){var t=Z(p(e)),n=[];return F(t,(function(e){d(ne,e)||d(N,e)||te(n,e)})),n},pe=function(e){var t=e===K,n=Z(t?re:p(e)),r=[];return F(n,(function(e){!d(ne,e)||t&&!d(K,e)||te(r,ne[e])})),r};c||(V=function(){if(h(q,this))throw new z("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?m(arguments[0]):void 0,t=w(e),n=function(e){var r=void 0===this?s:this;r===K&&i(n,re,e),d(r,$)&&d(r[$],t)&&(r[$][t]=!1);var a=_(1,e);try{oe(r,t,a)}catch(e){if(!(e instanceof Y))throw e;ae(r,t,a)}};return l&&ie&&oe(K,t,{configurable:!0,set:n}),le(t,e)},C(q=V[H],"toString",(function(){return W(this).tag})),C(V,"withoutSetter",(function(e){return le(w(e),e)})),R.f=de,I.f=ce,A.f=ue,b.f=he,y.f=S.f=fe,v.f=pe,M.f=function(e){return le(P(e),e)},l&&(k(q,"description",{configurable:!0,get:function(){return W(this).description}}),o||C(K,"propertyIsEnumerable",de,{unsafe:!0}))),r({global:!0,constructor:!0,wrap:!0,forced:!c,sham:!c},{Symbol:V}),F(E(se),(function(e){D(e)})),r({target:G,stat:!0,forced:!c},{useSetter:function(){ie=!0},useSimple:function(){ie=!1}}),r({target:"Object",stat:!0,forced:!c,sham:!l},{create:function(e,t){return void 0===t?T(e):ue(T(e),t)},defineProperty:ce,defineProperties:ue,getOwnPropertyDescriptor:he}),r({target:"Object",stat:!0,forced:!c},{getOwnPropertyNames:fe}),x(),U(V,G),N[$]=!0},89463(e,t,n){"use strict";var r=n(46518),s=n(43724),i=n(44576),a=n(79504),o=n(39297),l=n(94901),c=n(1625),u=n(655),d=n(62106),h=n(77740),f=i.Symbol,p=f&&f.prototype;if(s&&l(f)&&(!("description"in p)||void 0!==f().description)){var g={},m=function(){var e=arguments.length<1||void 0===arguments[0]?void 0:u(arguments[0]),t=c(p,this)?new f(e):void 0===e?f():f(e);return""===e&&(g[t]=!0),t};h(m,f),m.prototype=p,p.constructor=m;var _="Symbol(description detection)"===String(f("description detection")),T=a(p.valueOf),E=a(p.toString),y=/^Symbol\((.*)\)[^)]+$/,S=a("".replace),v=a("".slice);d(p,"description",{configurable:!0,get:function(){var e=T(this);if(o(g,e))return"";var t=E(e),n=_?v(t,7,-1):S(t,y,"$1");return""===n?void 0:n}}),r({global:!0,constructor:!0,forced:!0},{Symbol:m})}},81510(e,t,n){"use strict";var r=n(46518),s=n(97751),i=n(39297),a=n(655),o=n(25745),l=n(91296),c=o("string-to-symbol-registry"),u=o("symbol-to-string-registry");r({target:"Symbol",stat:!0,forced:!l},{for:function(e){var t=a(e);if(i(c,t))return c[t];var n=s("Symbol")(t);return c[t]=n,u[n]=t,n}})},2259(e,t,n){"use strict";n(70511)("iterator")},52675(e,t,n){"use strict";n(6761),n(81510),n(97812),n(33110),n(49773)},97812(e,t,n){"use strict";var r=n(46518),s=n(39297),i=n(10757),a=n(16823),o=n(25745),l=n(91296),c=o("symbol-to-string-registry");r({target:"Symbol",stat:!0,forced:!l},{keyFor:function(e){if(!i(e))throw new TypeError(a(e)+" is not a symbol");if(s(c,e))return c[e]}})},45700(e,t,n){"use strict";var r=n(70511),s=n(58242);r("toPrimitive"),s()},78125(e,t,n){"use strict";var r=n(97751),s=n(70511),i=n(10687);s("toStringTag"),i(r("Symbol"),"Symbol")},65746(e,t,n){"use strict";var r,s=n(92744),i=n(44576),a=n(79504),o=n(56279),l=n(3451),c=n(16468),u=n(91625),d=n(20034),h=n(91181).enforce,f=n(79039),p=n(58622),g=Object,m=Array.isArray,_=g.isExtensible,T=g.isFrozen,E=g.isSealed,y=g.freeze,S=g.seal,v=!i.ActiveXObject&&"ActiveXObject"in i,b=function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}},I=c("WeakMap",b,u),A=I.prototype,R=a(A.set);if(p)if(v){r=u.getConstructor(b,"WeakMap",!0),l.enable();var C=a(A.delete),k=a(A.has),L=a(A.get);o(A,{delete:function(e){if(d(e)&&!_(e)){var t=h(this);return t.frozen||(t.frozen=new r),C(this,e)||t.frozen.delete(e)}return C(this,e)},has:function(e){if(d(e)&&!_(e)){var t=h(this);return t.frozen||(t.frozen=new r),k(this,e)||t.frozen.has(e)}return k(this,e)},get:function(e){if(d(e)&&!_(e)){var t=h(this);return t.frozen||(t.frozen=new r),k(this,e)?L(this,e):t.frozen.get(e)}return L(this,e)},set:function(e,t){if(d(e)&&!_(e)){var n=h(this);n.frozen||(n.frozen=new r),k(this,e)?R(this,e,t):n.frozen.set(e,t)}else R(this,e,t);return this}})}else s&&f((function(){var e=y([]);return R(new I,e,1),!T(e)}))&&o(A,{set:function(e,t){var n;return m(e)&&(T(e)?n=y:E(e)&&(n=S)),R(this,e,t),n&&n(e),this}})},73772(e,t,n){"use strict";n(65746)},54520(e,t,n){"use strict";n(22489)},3949(e,t,n){"use strict";n(7588)},81454(e,t,n){"use strict";n(61701)},8872(e,t,n){"use strict";n(18237)},37550(e,t,n){"use strict";n(13579)},23500(e,t,n){"use strict";var r=n(44576),s=n(67400),i=n(79296),a=n(90235),o=n(66699),l=function(e){if(e&&e.forEach!==a)try{o(e,"forEach",a)}catch(t){e.forEach=a}};for(var c in s)s[c]&&l(r[c]&&r[c].prototype);l(i)},62953(e,t,n){"use strict";var r=n(44576),s=n(67400),i=n(79296),a=n(23792),o=n(66699),l=n(10687),c=n(78227)("iterator"),u=a.values,d=function(e,t){if(e){if(e[c]!==u)try{o(e,c,u)}catch(t){e[c]=u}if(l(e,t,!0),s[t])for(var n in a)if(e[n]!==a[n])try{o(e,n,a[n])}catch(t){e[n]=a[n]}}};for(var h in s)d(r[h]&&r[h].prototype,h);d(i,"DOMTokenList")},98406(e,t,n){"use strict";n(23792),n(27337);var r=n(46518),s=n(44576),i=n(93389),a=n(97751),o=n(69565),l=n(79504),c=n(43724),u=n(67416),d=n(36840),h=n(62106),f=n(56279),p=n(10687),g=n(33994),m=n(91181),_=n(90679),T=n(94901),E=n(39297),y=n(76080),S=n(36955),v=n(28551),b=n(20034),I=n(655),A=n(2360),R=n(6980),C=n(70081),k=n(50851),L=n(62529),O=n(22812),N=n(78227),w=n(74488),P=N("iterator"),M="URLSearchParams",D=M+"Iterator",x=m.set,U=m.getterFor(M),B=m.getterFor(D),F=i("fetch"),$=i("Request"),G=i("Headers"),H=$&&$.prototype,j=G&&G.prototype,W=s.TypeError,K=s.encodeURIComponent,V=String.fromCharCode,q=a("String","fromCodePoint"),Y=parseInt,z=l("".charAt),J=l([].join),X=l([].push),Q=l("".replace),Z=l([].shift),ee=l([].splice),te=l("".split),ne=l("".slice),re=l(/./.exec),se=/\+/g,ie=/^[0-9a-f]+$/i,ae=function(e,t){var n=ne(e,t,t+2);return re(ie,n)?Y(n,16):NaN},oe=function(e){for(var t=0,n=128;n>0&&e&n;n>>=1)t++;return t},le=function(e){var t=null;switch(e.length){case 1:t=e[0];break;case 2:t=(31&e[0])<<6|63&e[1];break;case 3:t=(15&e[0])<<12|(63&e[1])<<6|63&e[2];break;case 4:t=(7&e[0])<<18|(63&e[1])<<12|(63&e[2])<<6|63&e[3]}return t>1114111?null:t},ce=function(e){for(var t=(e=Q(e,se," ")).length,n="",r=0;r<t;){var s=z(e,r);if("%"===s){if("%"===z(e,r+1)||r+3>t){n+="%",r++;continue}var i=ae(e,r+1);if(i!=i){n+=s,r++;continue}r+=2;var a=oe(i);if(0===a)s=V(i);else{if(1===a||a>4){n+="�",r++;continue}for(var o=[i],l=1;l<a&&!(++r+3>t||"%"!==z(e,r));){var c=ae(e,r+1);if(c!=c){r+=3;break}if(c>191||c<128)break;X(o,c),r+=2,l++}if(o.length!==a){n+="�";continue}var u=le(o);null===u?n+="�":s=q(u)}}n+=s,r++}return n},ue=/[!'()~]|%20/g,de={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},he=function(e){return de[e]},fe=function(e){return Q(K(e),ue,he)},pe=g((function(e,t){x(this,{type:D,target:U(e).entries,index:0,kind:t})}),M,(function(){var e=B(this),t=e.target,n=e.index++;if(!t||n>=t.length)return e.target=null,L(void 0,!0);var r=t[n];switch(e.kind){case"keys":return L(r.key,!1);case"values":return L(r.value,!1)}return L([r.key,r.value],!1)}),!0),ge=function(e){this.entries=[],this.url=null,void 0!==e&&(b(e)?this.parseObject(e):this.parseQuery("string"==typeof e?"?"===z(e,0)?ne(e,1):e:I(e)))};ge.prototype={type:M,bindURL:function(e){this.url=e,this.update()},parseObject:function(e){var t,n,r,s,i,a,l,c=this.entries,u=k(e);if(u)for(n=(t=C(e,u)).next;!(r=o(n,t)).done;){if(i=(s=C(v(r.value))).next,(a=o(i,s)).done||(l=o(i,s)).done||!o(i,s).done)throw new W("Expected sequence with length 2");X(c,{key:I(a.value),value:I(l.value)})}else for(var d in e)E(e,d)&&X(c,{key:d,value:I(e[d])})},parseQuery:function(e){if(e)for(var t,n,r=this.entries,s=te(e,"&"),i=0;i<s.length;)(t=s[i++]).length&&(n=te(t,"="),X(r,{key:ce(Z(n)),value:ce(J(n,"="))}))},serialize:function(){for(var e,t=this.entries,n=[],r=0;r<t.length;)e=t[r++],X(n,fe(e.key)+"="+fe(e.value));return J(n,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var me=function(){_(this,_e);var e=x(this,new ge(arguments.length>0?arguments[0]:void 0));c||(this.size=e.entries.length)},_e=me.prototype;if(f(_e,{append:function(e,t){var n=U(this);
vendor: 16,194 bytes, line 1
1O(arguments.length,2),X(n.entries,{key:I(e),value:I(t)}),c||this.length++,n.updateURL()},delete:function(e){for(var t=U(this),n=O(arguments.length,1),r=t.entries,s=I(e),i=n<2?void 0:arguments[1],a=void 0===i?i:I(i),o=0;o<r.length;){var l=r[o];if(l.key!==s||void 0!==a&&l.value!==a)o++;else if(ee(r,o,1),void 0!==a)break}c||(this.size=r.length),t.updateURL()},get:function(e){var t=U(this).entries;O(arguments.length,1);for(var n=I(e),r=0;r<t.length;r++)if(t[r].key===n)return t[r].value;return null},getAll:function(e){var t=U(this).entries;O(arguments.length,1);for(var n=I(e),r=[],s=0;s<t.length;s++)t[s].key===n&&X(r,t[s].value);return r},has:function(e){for(var t=U(this).entries,n=O(arguments.length,1),r=I(e),s=n<2?void 0:arguments[1],i=void 0===s?s:I(s),a=0;a<t.length;){var o=t[a++];if(o.key===r&&(void 0===i||o.value===i))return!0}return!1},set:function(e,t){var n=U(this);O(arguments.length,1);for(var r,s=n.entries,i=!1,a=I(e),o=I(t),l=0;l<s.length;l++)(r=s[l]).key===a&&(i?ee(s,l--,1):(i=!0,r.value=o));i||X(s,{key:a,value:o}),c||(this.size=s.length),n.updateURL()},sort:function(){var e=U(this);w(e.entries,(function(e,t){return e.key>t.key?1:-1})),e.updateURL()},forEach:function(e){for(var t,n=U(this).entries,r=y(e,arguments.length>1?arguments[1]:void 0),s=0;s<n.length;)r((t=n[s++]).value,t.key,this)},keys:function(){return new pe(this,"keys")},values:function(){return new pe(this,"values")},entries:function(){return new pe(this,"entries")}},{enumerable:!0}),d(_e,P,_e.entries,{name:"entries"}),d(_e,"toString",(function(){return U(this).serialize()}),{enumerable:!0}),c&&h(_e,"size",{get:function(){return U(this).entries.length},configurable:!0,enumerable:!0}),p(me,M),r({global:!0,constructor:!0,forced:!u},{URLSearchParams:me}),!u&&T(G)){var Te=l(j.has),Ee=l(j.set),ye=function(e){if(b(e)){var t,n=e.body;if(S(n)===M)return t=e.headers?new G(e.headers):new G,Te(t,"content-type")||Ee(t,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),A(e,{body:R(0,I(n)),headers:R(0,t)})}return e};if(T(F)&&r({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(e){return F(e,arguments.length>1?ye(arguments[1]):{})}}),T($)){var Se=function(e){return _(this,H),new $(e,arguments.length>1?ye(arguments[1]):{})};H.constructor=Se,Se.prototype=H,r({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:Se})}}e.exports={URLSearchParams:me,getState:U}},14603(e,t,n){"use strict";var r=n(36840),s=n(79504),i=n(655),a=n(22812),o=URLSearchParams,l=o.prototype,c=s(l.append),u=s(l.delete),d=s(l.forEach),h=s([].push),f=new o("a=1&a=2&b=3");f.delete("a",1),f.delete("b",void 0),f+""!="a=2"&&r(l,"delete",(function(e){var t=arguments.length,n=t<2?void 0:arguments[1];if(t&&void 0===n)return u(this,e);var r=[];d(this,(function(e,t){h(r,{key:t,value:e})})),a(t,1);for(var s,o=i(e),l=i(n),f=0,p=0,g=!1,m=r.length;f<m;)s=r[f++],g||s.key===o?(g=!0,u(this,s.key)):p++;for(;p<m;)(s=r[p++]).key===o&&s.value===l||c(this,s.key,s.value)}),{enumerable:!0,unsafe:!0})},47566(e,t,n){"use strict";var r=n(36840),s=n(79504),i=n(655),a=n(22812),o=URLSearchParams,l=o.prototype,c=s(l.getAll),u=s(l.has),d=new o("a=1");!d.has("a",2)&&d.has("a",void 0)||r(l,"has",(function(e){var t=arguments.length,n=t<2?void 0:arguments[1];if(t&&void 0===n)return u(this,e);var r=c(this,e);a(t,1);for(var s=i(n),o=0;o<r.length;)if(r[o++]===s)return!0;return!1}),{enumerable:!0,unsafe:!0})},48408(e,t,n){"use strict";n(98406)},98721(e,t,n){"use strict";var r=n(43724),s=n(79504),i=n(62106),a=URLSearchParams.prototype,o=s(a.forEach);r&&!("size"in a)&&i(a,"size",{get:function(){var e=0;return o(this,(function(){e++})),e},configurable:!0,enumerable:!0})},45806(e,t,n){"use strict";n(47764);var r,s=n(46518),i=n(43724),a=n(67416),o=n(44576),l=n(76080),c=n(79504),u=n(36840),d=n(62106),h=n(90679),f=n(39297),p=n(44213),g=n(97916),m=n(67680),_=n(68183).codeAt,T=n(3717),E=n(655),y=n(10687),S=n(22812),v=n(98406),b=n(91181),I=b.set,A=b.getterFor("URL"),R=v.URLSearchParams,C=v.getState,k=o.URL,L=o.TypeError,O=o.parseInt,N=Math.floor,w=Math.pow,P=c("".charAt),M=c(/./.exec),D=c([].join),x=c(1..toString),U=c([].pop),B=c([].push),F=c("".replace),$=c([].shift),G=c("".split),H=c("".slice),j=c("".toLowerCase),W=c([].unshift),K="Invalid scheme",V="Invalid host",q="Invalid port",Y=/[a-z]/i,z=/[\d+-.a-z]/i,J=/\d/,X=/^0x/i,Q=/^[0-7]+$/,Z=/^\d+$/,ee=/^[\da-f]+$/i,te=/[\0\t\n\r #%/:<>?@[\\\]^|]/,ne=/[\0\t\n\r #/:<>?@[\\\]^|]/,re=/^[\u0000-\u0020]+/,se=/(^|[^\u0000-\u0020])[\u0000-\u0020]+$/,ie=/[\t\n\r]/g,ae=function(e){var t,n,r,s;if("number"==typeof e){for(t=[],n=0;n<4;n++)W(t,e%256),e=N(e/256);return D(t,".")}if("object"==typeof e){for(t="",r=function(e){for(var t=null,n=1,r=null,s=0,i=0;i<8;i++)0!==e[i]?(s>n&&(t=r,n=s),r=null,s=0):(null===r&&(r=i),++s);return s>n?r:t}(e),n=0;n<8;n++)s&&0===e[n]||(s&&(s=!1),r===n?(t+=n?":":"::",s=!0):(t+=x(e[n],16),n<7&&(t+=":")));return"["+t+"]"}return e},oe={},le=p({},oe,{" ":1,'"':1,"<":1,">":1,"`":1}),ce=p({},le,{"#":1,"?":1,"{":1,"}":1}),ue=p({},ce,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),de=function(e,t){var n=_(e,0);return n>32&&n<127&&!f(t,e)?e:encodeURIComponent(e)},he={ftp:21,file:null,http:80,https:443,ws:80,wss:443},fe=function(e,t){var n;return 2===e.length&&M(Y,P(e,0))&&(":"===(n=P(e,1))||!t&&"|"===n)},pe=function(e){var t;return e.length>1&&fe(H(e,0,2))&&(2===e.length||"/"===(t=P(e,2))||"\\"===t||"?"===t||"#"===t)},ge=function(e){return"."===e||"%2e"===j(e)},me={},_e={},Te={},Ee={},ye={},Se={},ve={},be={},Ie={},Ae={},Re={},Ce={},ke={},Le={},Oe={},Ne={},we={},Pe={},Me={},De={},xe={},Ue=function(e,t,n){var r,s,i,a=E(e);if(t){if(s=this.parse(a))throw new L(s);this.searchParams=null}else{if(void 0!==n&&(r=new Ue(n,!0)),s=this.parse(a,null,r))throw new L(s);(i=C(new R)).bindURL(this),this.searchParams=i}};Ue.prototype={type:"URL",parse:function(e,t,n){var s,i,a,o,l,c=this,u=t||me,d=0,h="",p=!1,_=!1,T=!1;for(e=E(e),t||(c.scheme="",c.username="",c.password="",c.host=null,c.port=null,c.path=[],c.query=null,c.fragment=null,c.cannotBeABaseURL=!1,e=F(e,re,""),e=F(e,se,"$1")),e=F(e,ie,""),s=g(e);d<=s.length;){switch(i=s[d],u){case me:if(!i||!M(Y,i)){if(t)return K;u=Te;continue}h+=j(i),u=_e;break;case _e:if(i&&(M(z,i)||"+"===i||"-"===i||"."===i))h+=j(i);else{if(":"!==i){if(t)return K;h="",u=Te,d=0;continue}if(t&&(c.isSpecial()!==f(he,h)||"file"===h&&(c.includesCredentials()||null!==c.port)||"file"===c.scheme&&!c.host))return;if(c.scheme=h,t)return void(c.isSpecial()&&he[c.scheme]===c.port&&(c.port=null));h="","file"===c.scheme?u=Le:c.isSpecial()&&n&&n.scheme===c.scheme?u=Ee:c.isSpecial()?u=be:"/"===s[d+1]?(u=ye,d++):(c.cannotBeABaseURL=!0,B(c.path,""),u=Me)}break;case Te:if(!n||n.cannotBeABaseURL&&"#"!==i)return K;if(n.cannotBeABaseURL&&"#"===i){c.scheme=n.scheme,c.path=m(n.path),c.query=n.query,c.fragment="",c.cannotBeABaseURL=!0,u=xe;break}u="file"===n.scheme?Le:Se;continue;case Ee:if("/"!==i||"/"!==s[d+1]){u=Se;continue}u=Ie,d++;break;case ye:if("/"===i){u=Ae;break}u=Pe;continue;case Se:if(c.scheme=n.scheme,i===r)c.username=n.username,c.password=n.password,c.host=n.host,c.port=n.port,c.path=m(n.path),c.query=n.query;else if("/"===i||"\\"===i&&c.isSpecial())u=ve;else if("?"===i)c.username=n.username,c.password=n.password,c.host=n.host,c.port=n.port,c.path=m(n.path),c.query="",u=De;else{if("#"!==i){c.username=n.username,c.password=n.password,c.host=n.host,c.port=n.port,c.path=m(n.path),c.path.length--,u=Pe;continue}c.username=n.username,c.password=n.password,c.host=n.host,c.port=n.port,c.path=m(n.path),c.query=n.query,c.fragment="",u=xe}break;case ve:if(!c.isSpecial()||"/"!==i&&"\\"!==i){if("/"!==i){c.username=n.username,c.password=n.password,c.host=n.host,c.port=n.port,u=Pe;continue}u=Ae}else u=Ie;break;case be:if(u=Ie,"/"!==i||"/"!==P(h,d+1))continue;d++;break;case Ie:if("/"!==i&&"\\"!==i){u=Ae;continue}break;case Ae:if("@"===i){p&&(h="%40"+h),p=!0,a=g(h);for(var y=0;y<a.length;y++){var S=a[y];if(":"!==S||T){var v=de(S,ue);T?c.password+=v:c.username+=v}else T=!0}h=""}else if(i===r||"/"===i||"?"===i||"#"===i||"\\"===i&&c.isSpecial()){if(p&&""===h)return"Invalid authority";d-=g(h).length+1,h="",u=Re}else h+=i;break;case Re:case Ce:if(t&&"file"===c.scheme){u=Ne;continue}if(":"!==i||_){if(i===r||"/"===i||"?"===i||"#"===i||"\\"===i&&c.isSpecial()){if(c.isSpecial()&&""===h)return V;if(t&&""===h&&(c.includesCredentials()||null!==c.port))return;if(o=c.parseHost(h))return o;if(h="",u=we,t)return;continue}"["===i?_=!0:"]"===i&&(_=!1),h+=i}else{if(""===h)return V;if(o=c.parseHost(h))return o;if(h="",u=ke,t===Ce)return}break;case ke:if(!M(J,i)){if(i===r||"/"===i||"?"===i||"#"===i||"\\"===i&&c.isSpecial()||t){if(""!==h){var b=O(h,10);if(b>65535)return q;c.port=c.isSpecial()&&b===he[c.scheme]?null:b,h=""}if(t)return;u=we;continue}return q}h+=i;break;case Le:if(c.scheme="file","/"===i||"\\"===i)u=Oe;else{if(!n||"file"!==n.scheme){u=Pe;continue}switch(i){case r:c.host=n.host,c.path=m(n.path),c.query=n.query;break;case"?":c.host=n.host,c.path=m(n.path),c.query="",u=De;break;case"#":c.host=n.host,c.path=m(n.path),c.query=n.query,c.fragment="",u=xe;break;default:pe(D(m(s,d),""))||(c.host=n.host,c.path=m(n.path),c.shortenPath()),u=Pe;continue}}break;case Oe:if("/"===i||"\\"===i){u=Ne;break}n&&"file"===n.scheme&&!pe(D(m(s,d),""))&&(fe(n.path[0],!0)?B(c.path,n.path[0]):c.host=n.host),u=Pe;continue;case Ne:if(i===r||"/"===i||"\\"===i||"?"===i||"#"===i){if(!t&&fe(h))u=Pe;else if(""===h){if(c.host="",t)return;u=we}else{if(o=c.parseHost(h))return o;if("localhost"===c.host&&(c.host=""),t)return;h="",u=we}continue}h+=i;break;case we:if(c.isSpecial()){if(u=Pe,"/"!==i&&"\\"!==i)continue}else if(t||"?"!==i)if(t||"#"!==i){if(i!==r&&(u=Pe,"/"!==i))continue}else c.fragment="",u=xe;else c.query="",u=De;break;case Pe:if(i===r||"/"===i||"\\"===i&&c.isSpecial()||!t&&("?"===i||"#"===i)){if(".."===(l=j(l=h))||"%2e."===l||".%2e"===l||"%2e%2e"===l?(c.shortenPath(),"/"===i||"\\"===i&&c.isSpecial()||B(c.path,"")):ge(h)?"/"===i||"\\"===i&&c.isSpecial()||B(c.path,""):("file"===c.scheme&&!c.path.length&&fe(h)&&(c.host&&(c.host=""),h=P(h,0)+":"),B(c.path,h)),h="","file"===c.scheme&&(i===r||"?"===i||"#"===i))for(;c.path.length>1&&""===c.path[0];)$(c.path);"?"===i?(c.query="",u=De):"#"===i&&(c.fragment="",u=xe)}else h+=de(i,ce);break;case Me:"?"===i?(c.query="",u=De):"#"===i?(c.fragment="",u=xe):i!==r&&(c.path[0]+=de(i,oe));break;case De:t||"#"!==i?i!==r&&("'"===i&&c.isSpecial()?c.query+="%27":c.query+="#"===i?"%23":de(i,oe)):(c.fragment="",u=xe);break;case xe:i!==r&&(c.fragment+=de(i,le))}d++}},parseHost:function(e){var t,n,r;if("["===P(e,0)){if("]"!==P(e,e.length-1))return V;if(t=function(e){var t,n,r,s,i,a,o,l=[0,0,0,0,0,0,0,0],c=0,u=null,d=0,h=function(){return P(e,d)};if(":"===h()){if(":"!==P(e,1))return;d+=2,u=++c}for(;h();){if(8===c)return;if(":"!==h()){for(t=n=0;n<4&&M(ee,h());)t=16*t+O(h(),16),d++,n++;if("."===h()){if(0===n)return;if(d-=n,c>6)return;for(r=0;h();){if(s=null,r>0){if(!("."===h()&&r<4))return;d++}if(!M(J,h()))return;for(;M(J,h());){if(i=O(h(),10),null===s)s=i;else{if(0===s)return;s=10*s+i}if(s>255)return;d++}l[c]=256*l[c]+s,2!=++r&&4!==r||c++}if(4!==r)return;break}if(":"===h()){if(d++,!h())return}else if(h())return;l[c++]=t}else{if(null!==u)return;d++,u=++c}}if(null!==u)for(a=c-u,c=7;0!==c&&a>0;)o=l[c],l[c--]=l[u+a-1],l[u+--a]=o;else if(8!==c)return;return l}(H(e,1,-1)),!t)return V;this.host=t}else if(this.isSpecial()){if(e=T(e),M(te,e))return V;if(t=function(e){var t,n,r,s,i,a,o,l=G(e,".");if(l.length&&""===l[l.length-1]&&l.length--,(t=l.length)>4)return e;for(n=[],r=0;r<t;r++){if(""===(s=l[r]))return e;if(i=10,s.length>1&&"0"===P(s,0)&&(i=M(X,s)?16:8,s=H(s,8===i?1:2)),""===s)a=0;else{if(!M(10===i?Z:8===i?Q:ee,s))return e;a=O(s,i)}B(n,a)}for(r=0;r<t;r++)if(a=n[r],r===t-1){if(a>=w(256,5-t))return null}else if(a>255)return null;for(o=U(n),r=0;r<n.length;r++)o+=n[r]*w(256,3-r);return o}(e),null===t)return V;this.host=t}else{if(M(ne,e))return V;for(t="",n=g(e),r=0;r<n.length;r++)t+=de(n[r],oe);this.host=t}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||"file"===this.scheme},includesCredentials:function(){return""!==this.username||""!==this.password},isSpecial:function(){return f(he,this.scheme)},shortenPath:function(){var e=this.path,t=e.length;!t||"file"===this.scheme&&1===t&&fe(e[0],!0)||e.length--},serialize:function(){var e=this,t=e.scheme,n=e.username,r=e.password,s=e.host,i=e.port,a=e.path,o=e.query,l=e.fragment,c=t+":";return null!==s?(c+="//",e.includesCredentials()&&(c+=n+(r?":"+r:"")+"@"),c+=ae(s),null!==i&&(c+=":"+i)):"file"===t&&(c+="//"),c+=e.cannotBeABaseURL?a[0]:a.length?"/"+D(a,"/"):"",null!==o&&(c+="?"+o),null!==l&&(c+="#"+l),c},setHref:function(e){var t=this.parse(e);if(t)throw new L(t);this.searchParams.update()},getOrigin:function(){var e=this.scheme,t=this.port;if("blob"===e)try{return new Be(e.path[0]).origin}catch(e){return"null"}return"file"!==e&&this.isSpecial()?e+"://"+ae(this.host)+(null!==t?":"+t:""):"null"},getProtocol:function(){return this.scheme+":"},setProtocol:function(e){this.parse(E(e)+":",me)},getUsername:function(){return this.username},setUsername:function(e){var t=g(E(e));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var n=0;n<t.length;n++)this.username+=de(t[n],ue)}},getPassword:function(){return this.password},setPassword:function(e){var t=g(E(e));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var n=0;n<t.length;n++)this.password+=de(t[n],ue)}},getHost:function(){var e=this.host,t=this.port;return null===e?"":null===t?ae(e):ae(e)+":"+t},setHost:function(e){this.cannotBeABaseURL||this.parse(e,Re)},getHostname:function(){var e=this.host;return null===e?"":ae(e)},setHostname:function(e){this.cannotBeABaseURL||this.parse(e,Ce)},getPort:function(){var e=this.port;return null===e?"":E(e)},setPort:function(e){this.cannotHaveUsernamePasswordPort()||(""===(e=E(e))?this.port=null:this.parse(e,ke))},getPathname:function(){var e=this.path;return this.cannotBeABaseURL?e[0]:e.length?"/"+D(e,"/"):""},setPathname:function(e){this.cannotBeABaseURL||(this.path=[],this.parse(e,we))},getSearch:function(){var e=this.query;return e?"?"+e:""},setSearch:function(e){""===(e=E(e))?this.query=null:("?"===P(e,0)&&(e=H(e,1)),this.query="",this.parse(e,De)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var e=this.fragment;return e?"#"+e:""},setHash:function(e){""!==(e=E(e))?("#"===P(e,0)&&(e=H(e,1)),this.fragment="",this.parse(e,xe)):this.fragment=null},update:function(){this.query=this.searchParams.serialize()||null}};var Be=function(e){var t=h(this,Fe),n=S(arguments.length,1)>1?arguments[1]:void 0,r=I(t,new Ue(e,!1,n));i||(t.href=r.serialize(),t.origin=r.getOrigin(),t.protocol=r.getProtocol(),t.username=r.getUsername(),t.password=r.getPassword(),t.host=r.getHost(),t.hostname=r.getHostname(),t.port=r.getPort(),t.pathname=r.getPathname(),t.search=r.getSearch(),t.searchParams=r.getSearchParams(),t.hash=r.getHash())},Fe=Be.prototype,$e=function(e,t){return{get:function(){return A(this)[e]()},set:t&&function(e){return A(this)[t](e)},configurable:!0,enumerable:!0}};if(i&&(d(Fe,"href",$e("serialize","setHref")),d(Fe,"origin",$e("getOrigin")),d(Fe,"protocol",$e("getProtocol","setProtocol")),d(Fe,"username",$e("getUsername","setUsername")),d(Fe,"password",$e("getPassword","setPassword")),d(Fe,"host",$e("getHost","setHost")),d(Fe,"hostname",$e("getHostname","setHostname")),d(Fe,"port",$e("getPort","setPort")),d(Fe,"pathname",$e("getPathname","setPathname")),d(Fe,"search",$e("getSearch","setSearch")),d(Fe,"searchParams",$e("getSearchParams")),d(Fe,"hash",$e("getHash","setHash"))),u(Fe,"toJSON",(function(){return A(this).serialize()}),{enumerable:!0}),u(Fe,"toString",(function(){return A(this).serialize()}),{enumerable:!0}),k){var Ge=k.createObjectURL,He=k.revokeObjectURL;Ge&&u(Be,"createObjectURL",l(Ge,k)),He&&u(Be,"revokeObjectURL",l(He,k))}y(Be,"URL"),s({global:!0,constructor:!0,forced:!a,sham:!i},{URL:Be})},3296(e,t,n){"use strict";n(45806)},27208(e,t,n){"use strict";var r=n(46518),s=n(69565);r({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return s(URL.prototype.toString,this)}})}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.