1(self.webpackChunkcs_pressweb=self.webpackChunkcs_pressweb||[]).push([[994],{710(e,t,n){"use strict";n.r(t),n.d(t,{CSWebPlayerCore:()=>Pu,CSWebPlayerCoreError:()=>Eu,CSWebPlayerCoreTrackingHelper:()=>Du,EventPool:()=>Mu});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.PLAYLIST_UNCHANGED_ERROR="playlistUnchangedError",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_APPEND_NO_PROGRESS="bufferAppendNoProgress",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.MEDIA_SOURCE_REQUIRES_RESET="mediaSourceRequiresReset",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}({});function c(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var u,d={exports:{}};var h,f,p,g,m,_=(u||(u=1,h=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,f=/^(?=([^\/?#]*))\1([^]*)$/,p=/(?:\/|^)\.(?=\/)/g,g=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,d.exports=m={buildAbsoluteURL:function(e,t,n){if(n=n||{},e=e.trim(),!(t=t.trim())){if(!n.alwaysNormalize)return e;var r=m.parseURL(e);if(!r)throw new Error("Error trying to parse base URL.");return r.path=m.normalizePath(r.path),m.buildURLFromParts(r)}var s=m.parseURL(t);if(!s)throw new Error("Error trying to parse relative URL.");if(s.scheme)return n.alwaysNormalize?(s.path=m.normalizePath(s.path),m.buildURLFromParts(s)):t;var i=m.parseURL(e);if(!i)throw new Error("Error trying to parse base URL.");if(!i.netLoc&&i.path&&"/"!==i.path[0]){var a=f.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=m.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?m.normalizePath(s.path):s.path),m.buildURLFromParts(o)},parseURL:function(e){var t=h.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(p,"");e.length!==(e=e.replace(g,"")).length;);return e.split("").reverse().join("")},buildURLFromParts:function(e){return e.scheme+e.netLoc+e.path+e.params+e.query+e.fragment}}
vendor: 4,908 bytes, line 1
1),d.exports);class T{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}}}let E=function(e){return e.MANIFEST="manifest",e.LEVEL="level",e.AUDIO_TRACK="audioTrack",e.SUBTITLE_TRACK="subtitleTrack",e.MEDIA_FRAGMENT="media-fragment",e.KEY="key",e.STEERING_MANIFEST="steering-manifest",e.SERVER_CERTIFICATE="server-certificate",e.INTERSTITIAL_ASSET_LIST="interstitial-asset-list",e}({}),y=function(e){return e.MAIN="main",e.AUDIO="audio",e.SUBTITLE="subtitle",e}({});var S="audio",v="video",b="audiovideo";class I{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=O(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={[S]:null,[v]:null,[b]: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 T),this._stats}set stats(e){this._stats=e}get url(){return!this._url&&this.relurl&&(this._url=_.buildAbsoluteURL(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""}set url(e){this._url=e}clearElementaryStreamInfo(){const{elementaryStreams:e}=this;e[S]=null,e[v]=null,e[b]=null,this.url=null}}function A(e){return"initSegment"!==e.sn}function R(e,t){return e.sn===(null==t?void 0:t.sn)&&e.level===t.level}function k(e,t){return e.sn===(null==t?void 0:t.sn)&&e.level===t.level&&e.cc===t.cc}class C extends I{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;if(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 A(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}}}
vendor: 47,153 bytes, line 1
1class L extends I{constructor(e,t,n,r,s){super(n),this.fragOffset=0,this.duration=0,this.independent=!1,this.relurl=void 0,this.fragment=void 0,this.index=void 0,this.gap=!1,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||this.fragment.type===y.SUBTITLE&&this.stats.loading.end>0)}}function O(e,t){const n=Object.getPrototypeOf(e);if(n){const e=Object.getOwnPropertyDescriptor(n,t);return e||O(n,t)}}function N(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 w(){return w=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},w.apply(null,arguments)}function P(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 M(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?P(Object(n),!0).forEach((function(t){N(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):P(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function D(e,t){if(null==e)return{};var n,r,s=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(s[n]=e[n])}return s}function x(e){switch(e.details){case o.FRAG_LOAD_TIMEOUT:case o.KEY_LOAD_TIMEOUT:case o.LEVEL_LOAD_TIMEOUT:case o.MANIFEST_LOAD_TIMEOUT:case o.AUDIO_TRACK_LOAD_TIMEOUT:case o.SUBTITLE_TRACK_LOAD_TIMEOUT:case o.ASSET_LIST_LOAD_TIMEOUT:return!0}return!1}function U(e){return e.details.startsWith("key")}function B(e){return U(e)&&!!e.frag&&!e.frag.decryptdata}function F(e,t){const n=x(t);return e.default[(n?"timeout":"error")+"Retry"]}function $(e,t){const n="linear"===e.backoff?1:Math.pow(2,t);return Math.min(n*e.retryDelayMs,e.maxRetryDelayMs)}function G(e){return M(M({},e),{errorRetry:null,timeoutRetry:null})}function H(e,t,n,r){if(!e)return!1;const s=null==r?void 0:r.code,i=t<e.maxNumRetry&&(function(e){return j(e)||!!e&&(e<400||e>499)}(s)||!!n);return e.shouldRetry?e.shouldRetry(e,t,n,r,i):i}function j(e){return 0===e&&!1===navigator.onLine}function W(e,t){return t>0&&e.loadError>0&&0!==e.loadErrorTime&&self.performance.now()-e.loadErrorTime>t}class V{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 K{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_=new V(e),this.fast_=new V(t),this.defaultTTFB_=r,this.ttfb_=new V(e)}update(e,t){const{slow_:n,fast_:r,ttfb_:s}=this;n.halfLife!==e&&(this.slow_=new V(e,n.getEstimate(),n.getTotalWeight())),r.halfLife!==t&&(this.fast_=new V(t,r.getEstimate(),r.getTotalWeight())),s.halfLife!==e&&(this.ttfb_=new V(e,s.getEstimate(),s.getTotalWeight()))}sample(e,t){if(t<=0)return;const n=Math.min(this.minDelayMs_,t/1e5),r=8*t,s=Math.max(e,n)/1e3,i=r/s;this.fast_.sample(s,i),this.slow_.sample(s,i)}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(){}}class q{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=Y,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 Y=function(){},z={trace:Y,debug:Y,log:Y,warn:Y,info:Y,error:Y};function J(){return w({},z)}function X(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}] >`):Y}(e,n)}const Q=J();const Z=Q;function ee(e=!0){if("undefined"==typeof self)return;return(e||!self.MediaSource)&&self.ManagedMediaSource||self.MediaSource||self.WebKitMediaSource}function te(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 ne(e){return e instanceof ArrayBuffer||"undefined"!=typeof SharedArrayBuffer&&e instanceof SharedArrayBuffer}const re="utf-16be",se="utf-16le",ie="utf-8";function ae(e,t){if(e<0)return-ae(-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 oe(){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();return"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)}))}}}function le(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 ce(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 ue(e,t){return le(e,t)&&ce(e,t+6)+10<=e.length-t}function de(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 he(e,t){const n=t;let r=0;for(;le(e,t);){r+=10;r+=ce(e,t+6),de(e,t+10)&&(r+=10),t+=r}if(r>0)return e.subarray(n,n+r)}function fe(e,t=0,n=1/0){return function(e,t,n,r){const s=(i=e,ne(i)?i:i.buffer);var i;let a=1;"BYTES_PER_ELEMENT"in r&&(a=r.BYTES_PER_ELEMENT);const o=(d=e,d&&ne(d.buffer)&&void 0!==d.byteLength&&void 0!==d.byteOffset?e.byteOffset:0),l=(o+e.byteLength)/a,c=(o+t)/a,u=Math.floor(Math.max(0,Math.min(c,l)));var d;return new r(s,u,Math.floor(Math.min(u+Math.max(n,0),l))-u)}(e,t,n,Uint8Array)}function pe(e,t=!1){const n=t?e.indexOf(0):e.length,r=function(e,t={}){let n;n=ne(e)?new DataView(e):new DataView(e.buffer,e.byteOffset,e.byteLength);let r=0,{encoding:s}=t;if(!s){const e=n.getUint8(0),t=n.getUint8(1);239==e&&187==t&&191==n.getUint8(2)?(s=ie,r=3):254==e&&255==t?(s=re,r=2):255==e&&254==t?(s=se,r=2):s=ie}if("undefined"!=typeof TextDecoder)return new TextDecoder(s).decode(n);const{byteLength:i}=n,a=s!==re;let o,l="";for(;r<i;){switch(s){case ie:if(o=n.getUint8(r),o<128)r++;else if(o>=194&&o<=223)if(r+1<i){const e=n.getUint8(r+1);e>=128&&e<=191?(o=(31&o)<<6|63&e,r+=2):r++}else r++;else if(o>=224&&o<=239)if(r+2<=i-1){const e=n.getUint8(r+1),t=n.getUint8(r+2);e>=128&&e<=191&&t>=128&&t<=191?(o=(15&o)<<12|(63&e)<<6|63&t,r+=3):r++}else r++;else if(o>=240&&o<=244)if(r+3<=i-1){const e=n.getUint8(r+1),t=n.getUint8(r+2),s=n.getUint8(r+3);e>=128&&e<=191&&t>=128&&t<=191&&s>=128&&s<=191?(o=(7&o)<<18|(63&e)<<12|(63&t)<<6|63&s,r+=4):r++}else r++;else r++;break;case re:case"utf-16":case se:o=n.getUint16(r,a),r+=2}l+=String.fromCodePoint(o)}return l}(new DataView(e.buffer,e.byteOffset,n),{encoding:ie});return t?r:r.replace(/\0/g,"")}function ge(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=pe(fe(e.data,1,n)),s=e.data[2+n],i=e.data.subarray(3+n).indexOf(0);if(-1===i)return;const a=pe(fe(e.data,3+n,i));let o;var l;return"--\x3e"===r?o=pe(fe(e.data,4+n+i)):o=ne(l=e.data.subarray(4+n+i))?l:0==l.byteOffset&&l.byteLength==l.buffer.byteLength?l.buffer:new Uint8Array(l).buffer,t.mimeType=r,t.pictureType=s,t.description=a,t.data=o,t}function me(e){return"PRIV"===e.type?function(e){if(e.size<2)return;const t=pe(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=pe(e.data.subarray(t),!0);t+=n.length+1;const r=pe(e.data.subarray(t));return{key:e.type,info:n,data:r}}const t=pe(e.data);return{key:e.type,info:"",data:t}}(e):"APIC"===e.type?ge(e):function(e){if(e.size<2)return;if("TXXX"===e.type){let t=1;const{data:n}=e,r=pe(n.subarray(t),!0);t+=r.length+1;const s=pe(n.subarray(t));return{key:e.type,info:r,data:s}}const t=pe(e.data.subarray(1));return{key:e.type,info:"",data:t}}(e)}function _e(e){const t=String.fromCharCode(e[0],e[1],e[2],e[3]),n=ce(e,4);return{type:t,size:n,data:e.subarray(10,10+n)}}function Te(e){let t=0;const n=[];for(;le(e,t);){const r=ce(e,t+6);e[t+5]>>6&1&&(t+=10),t+=10;const s=t+r;for(;t+10<s;){const r=_e(e.subarray(t)),s=me(r);s&&n.push(s),t+=r.size+10}de(e,t)&&(t+=10)}return n}function Ee(e){return e&&"PRIV"===e.key&&"com.apple.streaming.transportStreamTimestamp"===e.info}function ye(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 Se(e){const t=Te(e);for(const e of t)if(Ee(e))return ye(e)}function ve(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 be(e){return Uint8Array.from(e.replace(/^0x/,"").replace(/([\da-fA-F]{2}) ?/g,"0x$1 ").replace(/ +$/,"").split(" ")).buffer}function Ie(e){return Uint8Array.from(atob(e),(e=>e.charCodeAt(0)))}function Ae(e){return String.fromCharCode.apply(null,e)}const Re=Math.pow(2,32)-1,ke={avc1:1635148593,avcC:1635148611,hvc1:1752589105,hvcC:1752589123,btrt:1651798644,dinf:1684631142,dref:1685218662,esds:1702061171,free:1718773093,ftyp:1718909296,hdlr:1751411826,mdat:1835295092,mdhd:1835296868,mdia:1835297121,mfhd:1835427940,minf:1835626086,moof:1836019558,moov:1836019574,mp4a:1836069985,".mp3":778924083,dac3:1684103987,"ac-3":1633889587,mvex:1836475768,mvhd:1836476516,pasp:1885434736,sdtp:1935963248,stbl:1937007212,stco:1937007471,stsc:1937011555,stsd:1937011556,stsz:1937011578,stts:1937011827,tfdt:1952867444,tfhd:1952868452,traf:1953653094,trak:1953653099,trun:1953658222,trex:1953654136,tkhd:1953196132,vmhd:1986881636,smhd:1936549988},Ce={video:1,audio:2,id3:3,text:4};function Le(e,t){const n=e[t]<<8|e[t+1];return n<0?65536+n:n}function Oe(e,t){const n=e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3];return n<0?4294967296+n:n}function Ne(e,t){let n=Oe(e,t);return n*=Math.pow(2,32),n+=Oe(e,t+4),n}function we(e,t){let n="";for(let r=t;r<e.length;r++)if(n+=String.fromCharCode(e[r]),0===e[r])return n;return null}function Pe(e,t){return e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3]}function Me(e,t,n){e[t]=n>>24,e[t+1]=n>>16&255,e[t+2]=n>>8&255,e[t+3]=255&n}function De(e,t,n){const r=t.byteOffset-e.byteOffset-8,s=8+n,i=t.byteLength+8-s;i<8||(Me(e,r,s),Me(e,r+s,i),Me(e,r+s+4,ke.free))}function xe(e,t){return[e.byteOffset-t-8,e.byteOffset-t+e.byteLength]}function Ue(e,t){t.sort(((e,t)=>e[0]-t[0]));const n=t.reduce(((e,[t,n])=>e+n-t),0),r=new Uint8Array(e.byteLength-n);let s=0,i=0;for(let n=0;n<t.length;n++){const[a,o]=t[n];r.set(e.subarray(s,a),i),i+=a-s,s=o}r.set(e.subarray(s),i);return{result:r,dropped:n,droppedBefore:e=>t.reduce(((t,[n,r])=>r<=e?t+r-n:t),0)}}function Be(e,t){const n=[];return t.length?(Fe(e,t,0,0,e.byteLength,n),n):n}function Fe(e,t,n,r,s,i){const a=t[n];if(4!==(null==a?void 0:a.length))return;const o=a.charCodeAt(0),l=a.charCodeAt(1),c=a.charCodeAt(2),u=a.charCodeAt(3),d=t.length-1;for(let a=r;a<s;){const r=a+8<=s,h=a+4<=s?16777216*e[a]+(e[a+1]<<16|e[a+2]<<8|e[a+3]):Oe(e,a),f=h>1?a+h:s;if(r&&e[a+4]===o&&e[a+5]===l&&e[a+6]===c&&e[a+7]===u){const r=Math.min(f,s);n===d?i.push(e.subarray(a+8,r)):Fe(e,t,n+1,a+8,r,i)}a=f}}function $e(e){const t=[],n=e[0];let r=8;const s=Oe(e,r);r+=4;let i=0,a=0;0===n?(i=Oe(e,r),a=Oe(e,r+4),r+=8):(i=Ne(e,r),a=Ne(e,r+8),r+=16),r+=2;let o=e.length+a;const l=Le(e,r);r+=2;for(let n=0;n<l;n++){let n=r;const i=Oe(e,n);n+=4;const a=2147483647&i;if(1===(2147483648&i)>>>31)return Z.warn("SIDX has hierarchical references (not supported)"),null;const l=Oe(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 Ge(e){const t=[],n=Be(e,["moov","trak"]);for(let e=0;e<n.length;e++){const r=n[e],s=Be(r,["tkhd"])[0];if(s){let e=s[0];const n=Oe(s,0===e?12:20),i=Be(r,["mdia","mdhd"])[0];if(i){e=i[0];const s=Oe(i,0===e?12:20),a=Be(r,["mdia","hdlr"])[0];if(a){const e=Ae(a.subarray(8,12)),i={soun:S,vide:v}[e],o=He(Be(r,["mdia","minf","stbl","stsd"])[0]);i?(t[n]={timescale:s,type:i,stsd:o},t[i]=M({timescale:s,id:n},o)):t[n]={timescale:s,type:e,stsd:o}}}}}return Be(e,["moov","mvex","trex"]).forEach((e=>{const n=Oe(e,4),r=t[n];r&&(r.default={duration:Oe(e,12),sampleSize:Oe(e,16),flags:Oe(e,20)})})),t}function He(e){const t=e.subarray(8),n=t.subarray(86),r=Ae(t.subarray(4,8));let s,i=r;const a="enca"===r||"encv"===r;if(a){const e=Be(t,[r])[0];Be(e.subarray("enca"===r?28:78),["sinf"]).forEach((e=>{const t=Be(e,["schm"])[0];if(t){const n=Ae(t.subarray(4,8));if("cbcs"===n||"cenc"===n){const t=Be(e,["frma"])[0];t&&(i=Ae(t))}}}))}const o=i;switch(i){case"avc1":case"avc2":case"avc3":case"avc4":{const e=Be(n,["avcC"])[0];e&&e.length>3&&(i+="."+Ve(e[1])+Ve(e[2])+Ve(e[3]),s=je("avc1"===o?"dva1":"dvav",n));break}case"mp4a":{const e=Be(t,[r])[0],n=Be(e.subarray(28),["esds"])[0];if(n&&n.length>7){let e=4;if(3!==n[e++])break;e=We(n,e),e+=2;const t=n[e++];if(128&t&&(e+=2),64&t&&(e+=n[e++]),4!==n[e++])break;e=We(n,e);const r=n[e++];if(64!==r)break;if(i+="."+Ve(r),e+=12,5!==n[e++])break;e=We(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=Be(n,["hvcC"])[0];if(e&&e.length>12){const t=e[1],n=["","A","B","C"][t>>6],r=31&t,s=Oe(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=je("hev1"==o?"dvhe":"dvh1",n);break}case"dvh1":case"dvhe":case"dvav":case"dva1":case"dav1":i=je(i,n)||i;break;case"vp09":{const e=Be(n,["vpcC"])[0];if(e&&e.length>6){const t=e[4],n=e[5],r=e[6]>>4&15;i+="."+Ke(t)+"."+Ke(n)+"."+Ke(r)}break}case"av01":{const e=Be(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+"."+Ke(r)+a+"."+Ke(c)+"."+u+"."+d+h+f+"."+Ke(p)+"."+Ke(g)+"."+Ke(m)+"."+_,s=je("dav1",n)}break}}return{codec:i,encrypted:a,supplemental:s}}function je(e,t){const n=Be(t,["dvvC"]),r=n.length?n[0]:Be(t,["dvcC"])[0];if(r){const t=r[2]>>1&127,n=r[2]<<5&32|r[3]>>3&31;return e+"."+Ke(t)+"."+Ke(n)}}function We(e,t){const n=t+5;for(;128&e[t++]&&t<n;);return t}function Ve(e){return("0"+e.toString(16).toUpperCase()).slice(-2)}function Ke(e){return(e<10?"0":"")+e}function qe(e,t){Be(e,["moov","trak"]).forEach((e=>{const n=Be(e,["mdia","minf","stbl","stsd"])[0];if(!n)return;const r=n.subarray(8);let s=Be(r,["enca"]);const i=s.length>0;i||(s=Be(r,["encv"])),s.forEach((e=>{Be(i?e.subarray(28):e.subarray(78),["sinf"]).forEach((e=>{const n=Ye(e);n&&t(n,i)}))}))}))}function Ye(e){const t=Be(e,["schm"])[0];if(t){const n=Ae(t.subarray(4,8));if("cbcs"===n||"cenc"===n){const t=Be(e,["schi","tenc"])[0];if(t)return t}}}let ze;function Je(e){if("undefined"==typeof TextDecoder)return pe(e);return(ze||(ze=new TextDecoder("utf-8"))).decode(e).replace(/\0/g,"")}function Xe(e,t,n,s,i){const a={};let o=!1;const l=function(e){const t=e.byteLength,n=[];for(let r=0;r<t;){const s=r+8<=t,i=r+4<=t?16777216*e[r]+(e[r+1]<<16|e[r+2]<<8|e[r+3]):Oe(e,r),a=i>1?r+i:t;if(s&&109===e[r+4]&&111===e[r+5]&&111===e[r+6]&&102===e[r+7]){const s=Math.min(a,t);for(let t=r+8;t<s;){const i=t+8<=s,a=t+4<=s?16777216*e[t]+(e[t+1]<<16|e[t+2]<<8|e[t+3]):Oe(e,t),o=a>1?t+a:s;if(i&&116===e[t+4]&&114===e[t+5]&&97===e[t+6]&&102===e[t+7]){const i=Math.min(o,s);let a,l;const c=[];for(let n=t+8;n<i;){const t=n+8<=i,r=n+4<=i?16777216*e[n]+(e[n+1]<<16|e[n+2]<<8|e[n+3]):Oe(e,n),s=r>1?n+r:i;if(t&&116===e[n+4]){const t=Math.min(s,i);102===e[n+5]&&104===e[n+6]&&100===e[n+7]?l||(l=e.subarray(n+8,t)):102===e[n+5]&&100===e[n+6]&&116===e[n+7]?a||(a=e.subarray(n+8,t)):114===e[n+5]&&117===e[n+6]&&110===e[n+7]&&c.push(e.subarray(n+8,t))}n=s}n.push({moofOffset:e.byteOffset+r,tfdt:a,tfhd:l,truns:c})}t=o}}r=a}return n}(e),c=e.byteLength;for(let h=0;h<l.length;h++){const{moofOffset:f,tfdt:p,tfhd:g,truns:m}=l[h],_=Oe(g,4),T=t[_];if(!T)continue;const E=a[_]||(a[_]={start:NaN,duration:0,sampleCount:0,trun:[],timescale:T.timescale,type:T.type});let y;if(p){const e=p[0];y=Oe(p,4),1===e&&(y===Re?n.warn("[mp4-demuxer]: Ignoring assumed invalid signed 64-bit track fragment decode time"):(y*=Re+1,y+=Oe(p,8))),r(y)&&(!r(E.start)||y<E.start)&&(E.start=y),i&&r(y)&&(i.timeOffset=y/i.timescale)}const S=(null==i?void 0:i.trackId)===_&&T.type===v,b=T.default,I=16777215&Oe(g,0);let A,R=(null==b?void 0:b.duration)||0,k=(null==b?void 0:b.sampleSize)||0,C=8;1&I&&(C+=8),2&I&&(C+=4),8&I&&(R=Oe(g,C),A=g.byteOffset-e.byteOffset+C,C+=4),16&I&&(k=Oe(g,C));let L=0;const O=!!(1&I),N=!O&&!!(131072&I);O?(L=Oe(g,8),L*=Math.pow(2,32),L+=Oe(g,12)):N&&(L=f);let w=y||0,P=0,M=R;for(let t=0;t<m.length;t++){const n=m[t],a=Oe(n,4),o=E.sampleCount;E.sampleCount+=a;const l=1&n[3];let h=0;const f=4&n[3],p=1&n[2],g=2&n[2],_=4&n[2],T=8&n[2];let y=8;if(l&&(h=Pe(n,y),y+=4),f){1&n[y+1]||void 0!==E.keyFrameIndex||(E.keyFrameIndex=o),y+=4}let v,b,I,C=L+h;if(s||0!==n[1]||6!==n[2]||1!==n[3]){s&&(v=[],b={sampleOffset:C,samples:v,defaultSampleDurationOffset:A},C<=c&&E.trun.push(b));for(let t=0;t<a;t++){let a,o,l;p?(s&&(a=n.byteOffset-e.byteOffset+y),M=Oe(n,y),y+=4):M=R,g?(I=Oe(n,y),y+=4):I=k,_&&(l=1&n[y+1]?1:0,s&&(o={isNonSync:l,dependsOn:1==(3&n[y])?1:2}),y+=4);let u=0;if(T){u=0===n[0]?Oe(n,y):Pe(n,y),y+=4}if(S){let t=C,n=0;for(;n<I;){const r=Oe(e,t);t+=4,et(i.isHEVCFlavor,e[t])&&tt(e.subarray(t,t+r),i.isHEVCFlavor?2:1,i.timeOffset+u/i.timescale,i.samples),t+=r,n+=r+4}i.timeOffset+=M/i.timescale}if(C+=I,C<=c){b&&void 0!==a&&(b.lastSampleDurationOffset=a),0===l&&void 0===E.keyFrameIndex&&(E.keyFrameIndex=t,E.keyFrameStart=w);const e=w+u;(!r(E.ptsMin)||e<E.ptsMin)&&(E.ptsMin=e),(!r(E.ptsMax)||e+M>E.ptsMax)&&(E.ptsMax=e+M),v&&(v[t]={cts:u,duration:M,flags:o,size:I})}w+=M,P+=M}!P&&R&&(P+=R*a)}else{var u,d;const t=w,s=C,o=y;let l=-1,h=0,f=0,p=null!=(u=null==i?void 0:i.timeOffset)?u:0;const g=R/(null!=(d=null==i?void 0:i.timescale)?d:1),m=!0===(null==i?void 0:i.isHEVCFlavor),_=m?2:1;for(let t=0;t<a;t++){const r=0===n[y]?n[y+1]<<16|n[y+2]<<8|n[y+3]:Oe(n,y),s=-1===l&&void 0===E.keyFrameIndex&&!(1&n[y+5]);y+=8;const a=C+r;if(S){if(r>0){let t=C;do{const n=0===e[t]?e[t+1]<<16|e[t+2]<<8|e[t+3]:Oe(e,t);t+=4;const r=e[t],s=m?r>>1&63:31&r;(m?39===s||40===s:6===s)&&tt(e.subarray(t,t+n),_,p,i.samples),t+=n}while(t<a)}p+=g}C=a,s&&(l=t,h=C)}if(C<=c)f=a;else{let e=s,t=o;for(let r=0;r<a;r++){if(e+=0===n[t]?n[t+1]<<16|n[t+2]<<8|n[t+3]:Oe(n,t),e>c)break;f=r+1,t+=8}}if(S&&(i.timeOffset=p),-1!==l&&h<=c&&void 0===E.keyFrameIndex&&(E.keyFrameIndex=l,E.keyFrameStart=t+l*R),f){(!r(E.ptsMin)||t<E.ptsMin)&&(E.ptsMin=t);const e=t+f*R;(!r(E.ptsMax)||e>E.ptsMax)&&(E.ptsMax=e)}const T=R*a;w=t+T,P+=T}}E.duration+=P,E.duration&&(o=!0)}if(!o){let t=1/0,n=0;const s=Be(e,["sidx"]);for(let e=0;e<s.length;e++){const r=$e(s[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(a).forEach((e=>{a[e].duration||(a[e].duration=n*a[e].timescale-a[e].start)}))}return a}function Qe(e,t){const n=new Uint8Array(e.length+t.length);return n.set(e),n.set(t,e.length),n}function Ze(e){if(!e)return!1;const t=e.substring(0,4);return"hvc1"===t||"hev1"===t||"dvh1"===t||"dvhe"===t}function et(e,t){if(e){const e=t>>1&63;return 39===e||40===e}return 6===(31&t)}function tt(e,t,n,r){const s=nt(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){Z.error(`Malformed SEI payload. ${o} is too small, only ${e} bytes left to parse.`);break}if(4===a){if(181===s[t++]){const e=Le(s,t);if(t+=2,49===e){const e=Oe(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:Je(l),userDataBytes:l})}}}function nt(e){const t=e.byteLength;let n,r=e.indexOf(3,3);for(;-1!==r;)0===e[r-1]&&0===e[r-2]&&(n||(n=[])).push(r),r=e.indexOf(3,r+1);if(!n)return e;const s=t-n.length,i=new Uint8Array(s);let a=0,o=0;for(let t=0;t<s;o++,t++)o===n[a]&&(o++,a++),i[t]=e[o];return i}function rt(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 st(e){const t=[];if(e instanceof ArrayBuffer){const n=e.byteLength;let r=0;for(;r+32<n;){const n=it(new DataView(e,r));t.push(n),r+=n.size}}return t}function it(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=ve(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),0===s&&(o=function(e){const t=[];for(let n=0;n<e.length;){const r=e[n++],s=7&r;if(0===s){for(;128&e[n++];);continue}if(2!==s){n+=1===s?8:4;continue}let i=0;for(let t=0,r=128;128&r;t+=7)i|=(127&(r=e[n++]))<<t;if(r>>3==2)if(32===i){const r=new Uint8Array(16);for(let t=0;t<16;t++)r[t]=parseInt(String.fromCharCode(e[n+2*t],e[n+2*t+1]),16);t.push(r)}else 16===i&&t.push(e.subarray(n,n+16));n+=i}return t}(l)),{version:s,systemId:a,kids:o,data:l,offset:n,size:t})}const at=dt("userAgent"),ot=dt("vendor");let lt,ct,ut;function dt(e){try{return navigator[e]||""}catch(e){}return""}function ht(){if(void 0===lt){const e=at.match(/Chrome\/(\d+)/i);lt=e?parseInt(e[1]):0}return lt}function ft(){return/\(Windows.+Firefox\//i.test(at)}const pt={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},image:{mjpg:1}};function gt(e,t){const n=pt[t];return!!n&&!!n[e.slice(0,4)]}function mt(e,t,n=!0){return!e.split(",").some((e=>!_t(e,t,n)))}function _t(e,t,n=!0){var r;const s=ee(n);return null!=(r=null==s?void 0:s.isTypeSupported(Tt(e,t)))&&r}function Tt(e,t){return`${t}/mp4;codecs=${e}`}function Et(e){if(e){const t=e.substring(0,4);return pt.video[t]}return 2}function yt(e){const t=ft();return e.split(",").reduce(((e,n)=>{const r=t&&Ze(n)?9:pt.video[n];return r?(2*r+e)/(e?3:2):(pt.audio[n]+e)/(e?2:1)}),0)}const St={};const vt=/flac|opus|mp4a\.40\.34/i;function bt(e,t=!0){return e.replace(vt,(e=>function(e,t=!0){if(St[e])return St[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(_t(n[s],"audio",t))return St[e]=n[s],n[s];if("mp3"===n[s]&&null!=(r=ee(t))&&r.isTypeSupported("audio/mpeg"))return""}return e}(e.toLowerCase(),t)))}function It(e,t){if(e&&(e.length>4||-1!==["ac-3","ec-3","alac","fLaC","Opus"].indexOf(e))&&(At(e,"audio")||At(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 At(e,t){return gt(e,t)&&_t(e,t)}function Rt(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 kt(e){const t=ee(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 Ct(e){return e.replace(/^.+codecs=["']?([^"']+).*$/,"$1")}const Lt={supported:!1,smooth:!1,powerEfficient:!1},Ot={supported:!0,configurations:[],decodingInfoResults:[{supported:!0,powerEfficient:!0,smooth:!0}]};function Nt(e,t){return{supported:!1,configurations:t,decodingInfoResults:[Lt],error:e}}function wt(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=>Ze(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 Pt(e,t,n,r={}){const s=e.videoCodec;if(!s&&!e.audioCodec||!n)return Promise.resolve(Ot);const i=[],a=function(e){var t;const n=null==(t=e.videoCodec)?void 0:t.split(","),r=Dt(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:Tt(Rt(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=Dt(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:Tt(t,"audio"),bitrate:n?Mt(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=>Ze(e)))&&ft())return Promise.resolve(Nt(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+=`${Ct(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?"_":""}${Ct(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 Mt(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)}function Dt(e){return 1e3*Math.ceil(Math.max(.9*e.bitrate,e.averageBitrate)/1e3)||1}function xt(e,t,n){const r=encodeURIComponent(t),s=`${r}=${encodeURIComponent(n)}`;let i=!1;const a=[];e.search.substring(1).split("&").forEach((e=>{e===r||e.startsWith(r+"=")?i||(a.push(s),i=!0):e&&a.push(e)})),i||a.push(s),e.search=a.join("&")}const Ut=["NONE","TYPE-0","TYPE-1",null];const Bt=["SDR","PQ","HLG"];var Ft="",$t="YES",Gt="v2";function Ht(e){const{canSkipUntil:t,canSkipDateRanges:n,age:r}=e;return t&&r<t/2?n?Gt:$t:Ft}class jt{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&&xt(t,"_HLS_msn",this.msn.toString()),void 0!==this.part&&xt(t,"_HLS_part",this.part.toString()),this.skip&&xt(t,"_HLS_skip",this.skip),t.href}}class Wt{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.imageCodec=void 0,this.iframes=void 0,this.details=void 0,this.fragmentError=0,this.loadError=0,this.loadErrorTime=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,"imageCodec"in e&&(this.imageCodec=e.imageCodec),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)}`)}"iframes"in e&&e.iframes?this.iframes=!0:(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 Vt(this._audioGroups,e)}hasSubtitleGroup(e){return Vt(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 Vt(e,t){return!(!t||!e)&&-1!==e.indexOf(t)}function Kt(e,t){let n=!1,r=[];if(e&&(n="SDR"!==e,r=[e]),t){r=t.allowedVideoRanges||Bt.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 qt=(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 Yt(e,t){Z.log(`[abr] start candidates with "${e}" ignored because ${t}`)}function zt(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 Jt(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 Xt(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(Qt(e,t[r],n))return r}return-1}function Qt(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===a||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 Zt(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 en(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 tn(e,t){var n;return!!e&&e!==(null==(n=t.loadLevelObj)?void 0:n.uri)}function nn(e,t){return!t||-1!==t.indexOf(e)}function rn(e,t){if(t||e){const n=w({},t);return e&&(e.videoCodec&&(n.videoCodec=e.videoCodec),e.videoRange&&(n.allowedVideoRanges=[e.videoRange])),n}}const sn=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 an(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===on(n,r,i)||function(e,t,n){if(0===(null==t?void 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=sn(t,on.bind(null,n,r));return!a||a===e&&i?i:a}function on(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 ln(e,t,n){const r=1e3*Math.min(t,n.duration+(n.deltaPTS?n.deltaPTS:0));return(n.endProgramDateTime||0)-r>e}function cn(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)),sn(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 un(e,t){return t===e.endSN&&e.fragmentHint?e.fragmentHint:e.fragments[1+t-e.startSN]||null}var dn=0,hn=2,fn=3,pn=5,gn=0,mn=1,_n=2,Tn=4,En=8,yn=16;function Sn(e){const t=e.details;return t===o.BUFFER_ADD_CODEC_ERROR||t===o.MEDIA_SOURCE_REQUIRES_RESET||t===o.BUFFER_APPEND_ERROR&&!vn(e)}function vn(e){return e.details===o.BUFFER_APPEND_ERROR&&("QuotaExceededError"===e.error.name||"InvalidStateError"===e.error.name)}function bn(e){const t={action:dn,flags:gn};return e&&(t.resolved=!0),t}var In="NOT_LOADED",An="APPENDING",Rn="PARTIAL",kn="OK";class Cn{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,i){this.timeRanges&&(this.timeRanges[e]=t);const a=(null==s?void 0:s.fragment.sn)||-1;Object.keys(this.fragments).forEach((s=>{const o=this.fragments[s];if(!o||!this.hls)return;const c=o.body;if(a>=c.sn)return;if(!o.buffered&&(!o.loaded||i))return void(c.type===n&&this.removeFragment(c));const u=o.range[e];if(u)if(0!==u.time.length){if(u.time.some((e=>{const n=!this.isTimeBuffered(e.startPTS,e.endPTS,t);return n&&this.removeFragment(c),n})),r&&r!==c&&ht()){const e=r.endPTS,t=c.startPTS;if(e&&t&&o.range.video){const n=t-e;n<0&&n>-.1&&(this.removeFragment(c),this.hls.trigger(l.BUFFER_FLUSHING,{startOffset:e+.004,endOffset:1/0,type:"video"}))}}}else this.removeFragment(c)}))}detectPartialFragments(e){const t=this.timeRanges,{frag:n,part:r,id:s}=e;if(!t||!A(n))return;const i=On(n),a=this.fragments[i];if(!a||a.buffered&&n.gap)return;const o=!n.relurl;Object.keys(t).forEach((e=>{const i=n.elementaryStreams[e];if(!i)return;const l=t[e],c=o||!0===i.partial;a.range[e]=this.getBufferedTimes(n,r,c,l),this.detectEvictedFragments(e,l,s,n,r)})),a.loaded=null;const l=Object.keys(a.range);if(l.length){if(this.bufferedEnd(a,n),Ln(a)||this.removeParts(n.sn-1,n.type),!r){const e=Math.min(.004,n.duration);l.some((t=>{var r;const s=null==(r=a.range[t])?void 0:r.time,i=0===s.length||1===s.length&&s[0].endPTS-s[0].startPTS<e;return i&&this.addAsGap(n),i}))}}else this.removeFragment(n)}addAsGap(e){e.gap=!0,this.removeFragment(e),this.fragBuffered(e,!0)}bufferedEnd(e,t){e.buffered=!0;(e.body.endList=t.endList||e.body.endList)&&!t.gap&&(this.endListFragments[e.body.type]=e)}removeParts(e,t){const n=this.activePartLists[t];n&&(this.activePartLists[t]=Nn(n,(t=>t.fragment.sn>=e)))}fragBuffered(e,t){const n=On(e);let r=this.fragments[n];return!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)),r}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&&Ln(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||Ln(t))}getState(e){const t=On(e),n=this.fragments[t];return n?n.buffered?Ln(n)?Rn:kn:An:In}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(!A(t.frag)||t.frag.bitrateTest)return;const n=t.frag,r=t.part?null:t,s=On(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}=t;if(!A(n))return;const i=n.type;if(r){let e=this.activePartLists[i];e||(this.activePartLists[i]=e=[]),e.push(r)}this.timeRanges=s}onFragBuffered(e,t){this.detectPartialFragments(t)}hasFragment(e){const t=On(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)}getBackBufferEvictionEnd(e,t,n){const{fragments:r}=this;let s=0,i=0;const a=Object.keys(r);for(let o=0;o<a.length;o++){const l=r[a[o]];if(!l||!l.buffered||l.body.type!==t)continue;const c=l.body;if(c.gap)return 0;const u=c.hasStats&&c.stats.loaded||c.byteLength||c.bitrate&&8*c.bitrate*c.duration;if(c.end<=e&&u&&(s+=u,i=Math.max(i,c.end),s>=n))return i}return i>0?i:0}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=On(e);e.clearElementaryStreamInfo();const n=this.activePartLists[e.type];if(n){const t=e.sn;this.activePartLists[e.type]=Nn(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 Ln(e){var t,n,r,s;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||null!=(s=e.range.subs)&&s.partial)}function On(e){return`${e.type}_${e.level}_${e.sn}`}function Nn(e,t){return e.filter((e=>{const n=t(e);return n||e.clearElementaryStreamInfo(),n}))}var wn=0,Pn=1;class Mn{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 wn:return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},t,e);case Pn: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 Dn{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,k,C,L,O,N;const w=this.networkToHostOrderSwap;for(;t<m.length;){for(R=w(m[t]),k=w(m[t+1]),C=w(m[t+2]),L=w(m[t+3]),v=R^s[0],b=L^s[1],I=C^s[2],A=k^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>>
vendor: 8,202 bytes, line 1
18&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=k,p=C,g=L,t+=4}return _.buffer}}class xn{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 wn:return"AES-CBC";case Pn: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 Un{constructor(e,t){if(this.logEnabled=!0,this.decryptRange=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,!0!==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);this.reset();const r=this.decryptRange;return r?0===r.start&&r.end>=n.length?n:n.slice(r.start,r.end):function(e){const t=e.byteLength,n=t&&new DataView(e.buffer).getUint8(t-1);return n?e.slice(0,t-n):e}(n)}reset(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)}decrypt(e,t,n,r,s){return this.decryptRange=s,this.useSoftware||s?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!==wn||16!==t.byteLength)return Z.warn("SoftwareDecrypt: can only handle AES-128-CBC"),null;this.logOnce("JS AES decrypt"),a&&(e=Qe(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 Dn),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 xn(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 Mn(this.subtle,new Uint8Array(n),r).decrypt(e.buffer,t)})).catch((s=>(Z.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&&(Z.log(`[decrypter]: ${e}`),this.logEnabled=!1)}}const Bn=Math.pow(2,17);class Fn{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,n,r){const s=e.url;if(!s)return Promise.reject(new jn({type:a.NETWORK_ERROR,details:o.FRAG_LOAD_ERROR,fatal:!1,frag:e,error:new Error("Fragment does not have a "+(s?"part list":"url")),networkDetails:null}));this.abort();const i=this.config,l=i.fLoader,c=i.loader;return new Promise(((u,d)=>{if(this.loader&&this.loader.destroy(),e.gap){if(e.tagList.some((e=>"GAP"===e[0])))return void d(Hn(e));e.gap=!1}const h=this.loader=l?new l(i):new c(i),f=$n(e,null,t);e.loader=h;const p=G(i.fragLoadPolicy.default),g={loadPolicy:p,timeout:p.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:"initSegment"===e.sn?1/0:Bn};h.stats.retry=e.stats.retry,e.stats=h.stats;const m={onSuccess:(t,n,r,s)=>{this.resetLoader(e,h);let i=t.data;r.resetIV&&e.decryptdata&&(e.decryptdata.iv=new Uint8Array(i.slice(0,16)),i=i.slice(16)),u({frag:e,part:null,payload:i,networkDetails:s})},onError:(t,n,r,i)=>{this.resetLoader(e,h),d(new jn({type:a.NETWORK_ERROR,details:o.FRAG_LOAD_ERROR,fatal:!1,frag:e,response:M({url:s,data:void 0},t),error:new Error(`HTTP Error ${t.code} ${t.text}`),networkDetails:r,stats:i}))},onAbort:(t,n,r)=>{this.resetLoader(e,h),d(new jn({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,h),d(new jn({type:a.NETWORK_ERROR,details:o.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,error:new Error(`Timeout after ${g.timeout}ms`),networkDetails:r,stats:t}))}};if(n){const t=this.gateProgress(n,r);m.onProgress=(n,r,s,i)=>t({frag:e,part:null,payload:s,networkDetails:i})}h.load(f,g,m)}))}gateProgress(e,t){let n=e;if(t){const r=[];let s=!1;t.then((()=>{s=!0,r.forEach((t=>e(t))),r.length=0})).catch((()=>{})),n=t=>{s?e(t):r.push(t)}}return n}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(Hn(e,t));const u=this.loader=s?new s(r):new i(r),d=$n(e,t);e.loader=u;const h=G(r.fragLoadPolicy.default),f={loadPolicy:h,timeout:h.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:Bn};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 jn({type:a.NETWORK_ERROR,details:o.FRAG_LOAD_ERROR,fatal:!1,frag:e,part:t,response:M({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 jn({type:a.NETWORK_ERROR,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 jn({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,e.url=null,this.loader===t&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),t.destroy()}}function $n(e,t=null,n){const r=t||e,s={type:E.MEDIA_FRAGMENT,frag:e,part:t,responseType:"arraybuffer",url:r.url,headers:{},rangeStart:0,rangeEnd:0},i=Gn(e,t,n);return i.resetIV&&(s.resetIV=!0),i.byteRange&&(s.rangeStart=i.byteRange.start,s.rangeEnd=i.byteRange.end),s}function Gn(e,t=null,n){const s={},i=t||e,a=i.byteRangeStartOffset,o=i.byteRangeEndOffset;var l,c;if(r(a)&&r(o))if("initSegment"!==e.sn&&!n||"AES-128"!==(c=null==(l=e.decryptdata)?void 0:l.method)&&"AES-256"!==c)s.byteRange={start:a,end:o};else{let e=16*Math.floor(a/16);const t=16*Math.ceil(o/16);s.decryptRange={start:a-e,end:o-e},e>=16&&(s.resetIV=!0,e-=16),s.byteRange={start:e,end:t}}return s}function Hn(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 jn(r)}
vendor: 9,651 bytes, line 1
1class jn extends Error{constructor(e){super(e.error.message),this.data=void 0,this.data=e}}class Wn extends q{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):(this.log(`possible exception thrown in task-loop (${this.constructor.name}.doTick)`),this._tickCallCount=0)}tickImmediate(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)}doTick(){}}class Vn{constructor(e,t,n,r=0,s=-1,i=!1,a,o,l){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.iframe=void 0,this.duration=void 0,this.decryptRange=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,this.duration=a||0,this.decryptRange=l,this.iframe=o||!1}}const Kn={length:0,start:()=>0,end:()=>0};class qn{static isBuffered(e,t){if(e){const n=qn.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=qn.getBuffered(e);return qn.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=qn.bufferedRanges(e);if(r.length)return qn.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||Kn}catch(e){return Z.log("failed to get media.buffered",e),Kn}}}const Yn=/\{\$([a-zA-Z0-9-_]+)\}/g;function zn(e){return Yn.lastIndex=0,Yn.test(e)}function Jn(e,t){if(null!==e.variableList||e.hasVariableRefs){const n=e.variableList;return t.replace(Yn,(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 Xn(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 Qn(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 Zn=/^(\d+)x(\d+)$/,er=/(.+?)=(".*?"|.*?)(?:,|$)/g;class tr{constructor(e,t){"string"==typeof e&&(e=tr.parseAttrList(e,t)),w(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=Zn.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(er.lastIndex=0;null!==(n=er.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=Jn(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":Z.warn(`${e}: attribute ${s} is missing quotes`)}r[s]=i}return r}}function nr(e){return"SCTE35-OUT"===e||"SCTE35-IN"===e||"SCTE35-CMD"===e}class rr{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]){Z.warn(`DATERANGE tag attribute: "${t}" does not match for tags with ID: "${e.ID}"`),this._badValueForSameId=t;break}e=w(new tr({}),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 e){const n=(null==t?void 0:t.endDate)||new Date(e["END-DATE"]);r(n.getTime())&&(this._endDate=n)}}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?(Z.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)}get invalidReason(){return this.id?this._badValueForSameId?`Date range ${this._badValueForSameId} mismatch`:r(this.startDate.getTime())?!this.isInterstitial||"X-ASSET-URI"in this.attr||"X-ASSET-LIST"in this.attr?this.isValid?null:"Unknown (check DURATION(|END|NEXT), CLASS, and CUE)":"Interstitial Date range missing X-ASSET-(LIST|URI)":"Date range invalid start date":"Missing ID"}}class sr{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.iframesOnly=!1,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.drift
vendor: 4,694 bytes, line 1
1StartTime=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=0: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 ir(e,t){return e.length===t.length&&!e.some(((e,n)=>e!==t[n]))}function ar(e,t){return!e&&!t||!(!e||!t)&&ir(e,t)}function or(e){return"AES-128"===e||"AES-256"===e||"AES-256-CTR"===e}function lr(e){switch(e){case"AES-128":case"AES-256":return wn;case"AES-256-CTR":return Pn;default:throw new Error(`invalid full segment method ${e}`)}}function cr(e){return Uint8Array.from(unescape(encodeURIComponent(e)),(e=>e.charCodeAt(0)))}function ur(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 dr(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=Ie(s)):n=function(e){const t=cr(e).subarray(0,16),n=new Uint8Array(16);return n.set(t,16-t.length),n}(s)}}return n}const hr="undefined"!=typeof self?self:void 0;var fr={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.fps",PLAYREADY:"com.microsoft.playready",WIDEVINE:"com.widevine.alpha"},pr="org.w3.clearkey",gr="com.apple.streamingkeydelivery",mr="com.microsoft.playready",_r="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed";function Tr(e){switch(e){case gr:return fr.FAIRPLAY;case mr:return fr.PLAYREADY;case _r:return fr.WIDEVINE;case pr:return fr.CLEARKEY}}var Er="edef8ba979d64acea3c827dcd51d21ed";function yr(e){switch(e){case fr.FAIRPLAY:return gr;case fr.PLAYREADY:return mr;case fr.WIDEVINE:return _r;case fr.CLEARKEY:return pr}}function Sr(e){const{drmSystems:t,widevineLicenseUrl:n}=e,r=t?[fr.FAIRPLAY,fr.WIDEVINE,fr.PLAYREADY,fr.CLEARKEY].filter((e=>!!t[e])):[];return!r[fr.WIDEVINE]&&n&&r.push(fr.WIDEVINE),r}const vr=null!=hr&&null!=(br=hr.navigator)&&br.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null;var br;function Ir(e){const t=Ae(new Uint16Array(e.buffer,e.byteOffset,e.byteLength/2)),n=t.substring(t.indexOf("<"),t.length),r=(new DOMParser).parseFromString(n,"text/xml").getElementsByTagName("KID")[0];if(r){const e=r.childNodes[0]?r.childNodes[0].nodeValue:r.getAttribute("VALUE");if(e){const t=Ie(e).subarray(0,16);return ur(t),t}}return null}let Ar={};class Rr{static clearKeyUriToKeyIdMap(){Ar={}}static setKeyIdForUri(e,t){Ar[e]=t}static addKeyIdForUri(e){const t=Object.keys(Ar).length%Number.MAX_SAFE_INTEGER,n=new Uint8Array(16);return new DataView(n.buffer,12,4).setUint32(0,t),Ar[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.pss
vendor: 15,290 bytes, line 1
1h=null,this.scheme=void 0,this.method=e,this.uri=t,this.keyFormat=n,this.keyFormatVersions=r,this.iv=s,this.encrypted=!!e&&"NONE"!==e,this.isCommonEncryption=this.encrypted&&!or(e),null!=i&&i.startsWith("0x")&&(this.keyId=new Uint8Array(be(i)))}matches(e){return e.uri===this.uri&&e.method===this.method&&e.encrypted===this.encrypted&&e.keyFormat===this.keyFormat&&ir(e.keyFormatVersions,this.keyFormatVersions)&&ar(e.iv,this.iv)&&ar(e.keyId,this.keyId)}isSupported(){if(this.method){if(or(this.method)||"NONE"===this.method)return!0;if("identity"===this.keyFormat)return"SAMPLE-AES"===this.method;switch(this.keyFormat){case gr:case _r:case mr:case pr:return-1!==["SAMPLE-AES","SAMPLE-AES-CENC","SAMPLE-AES-CTR"].indexOf(this.method)}}return!1}getDecryptData(e,t){var n;if(!this.encrypted||!this.uri)return null;if(or(this.method)){let t=this.iv;t||("number"!=typeof e&&(Z.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 Rr(this.method,this.uri,"identity",this.keyFormatVersions,t)}if(this.keyId){const e=Ar[this.uri];if(e&&!ir(this.keyId,e)&&Rr.setKeyIdForUri(this.uri,this.keyId),this.pssh)return this}const r=dr(this.uri);if(r)switch(this.keyFormat){case _r:if(this.pssh=r,!this.keyId){const e=st(r.buffer).filter((e=>e.systemId===Er));if(e.length){var s;const t=e[0];this.keyId=null!=(s=t.kids)&&s.length?t.kids[0]:null}}this.keyId||(this.keyId=kr(t));break;case mr:{const e=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]);this.pssh=rt(e,0,r),this.keyId=Ir(r);break}default:{let e=r.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(16!==(null==(n=this.keyId)?void 0:n.byteLength)){let e;e=function(e){const t=null==e?void 0:e[_r];if(t)return t.keyId;return null}(t),e||(e=kr(t),e||(e=Ar[this.uri])),e&&(this.keyId=e,Rr.setKeyIdForUri(this.uri,e))}return this}}function kr(e){const t=null==e?void 0:e[mr];if(t){const e=dr(t.uri);if(e)return Ir(e)}return null}const Cr=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-(I-FRAME-STREAM-INF|SESSION-DATA|SESSION-KEY|DEFINE|CONTENT-STEERING|START):([^\r\n]*)(?:[\r\n]+|$)/g,Lr=/#EXT-X-MEDIA:(.*)/g,Or=/^#EXT(?:INF|-X-TARGETDURATION):/m,Nr=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[^\r\n]*)/.source,/#.*/.source].join("|"),"g"),wr=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|I-FRAMES-ONLY)/.source,/(#)([^:]*):(.*)/.source,/(#)(.*)(?:.*)\r?\n?/.source].join("|"));class Pr{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 _.buildAbsoluteURL(t,e,{alwaysNormalize:!0})}static isMediaPlaylist(e){return Or.test(e)}static parseMasterPlaylist(e,t){const n={contentSteering:null,levels:[],iframeVariants:[],playlistParsingError:null,sessionData:null,sessionKeys:null,startTimeOffset:null,variableList:null,hasVariableRefs:zn(e)},r=[];if(Cr.lastIndex=0,!e.startsWith("#EXTM3U"))return n.playlistParsingError=new Error("no EXTM3U delimiter"),n;let s;for(;null!=(s=Cr.exec(e));)if(s[1]){const e=Mr(new tr(s[1],n),s[2],t,n,r);e&&n.levels.push(e)}else if(s[3]){const e=s[3],i=s[4];switch(e){case"I-FRAME-STREAM-INF":{const e=new tr(i,n),s=Mr(e,e.URI,t,n,r,!0);s&&n.iframeVariants.push(s)}break;case"SESSION-DATA":{const e=new tr(i,n),t=e["DATA-ID"];t&&(null===n.sessionData&&(n.sessionData={}),n.sessionData[t]=e);break}case"SESSION-KEY":{const e=Ur(i,t,n);e.encrypted&&e.isSupported()?(null===n.sessionKeys&&(n.sessionKeys=[]),n.sessionKeys.push(e)):Z.warn(`[Keys] Ignoring invalid EXT-X-SESSION-KEY tag: "${i}"`);break}case"DEFINE":Xn(n,new tr(i,n),t);break;case"CONTENT-STEERING":{const e=new tr(i,n);n.contentSteering={uri:Pr.resolve(e["SERVER-URI"],t),pathwayId:e["PATHWAY-ID"]||"."};break}case"START":n.startTimeOffset=Br(i)}}const i=r.length>0&&r.length<n.levels.length;return n.levels=i?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(Lr.lastIndex=0;null!==(r=Lr.exec(e));){const e=new tr(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?Pr.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=Pr.findGroup(n,f.groupId)||n[0];$r(f,e,"audioCodec"),$r(f,e,"textCodec")}r.push(f)}}return s}static parseLevelPlaylist(e,t,n,s,i,a){var o;const l={url:t},c=new sr(t),u=c.fragments,d=[];let h,f,p,g,m=null,_=0,T=0,E=0,y=0,S=0,v=null,b=new C(s,l),I=-1,A=!1,R=null;if(Nr.lastIndex=0,c.m3u8=e,c.hasVariableRefs=zn(e),"#EXTM3U"!==(null==(o=Nr.exec(e))?void 0:o[0]))return c.playlistParsingError=new Error("Missing format identifier #EXTM3U"),c;for(;null!==(h=Nr.exec(e));){A&&(A=!1,b=new C(s,l),b.playlistOffset=E,b.setStart(E),b.sn=_,b.cc=y,S&&(b.bitrate=S),b.level=n,m&&(b.initSegment=m,m.rawProgramDateTime&&(b.rawProgramDateTime=m.rawProgramDateTime,m.rawProgramDateTime=null),R&&(b.setByteRange(R),R=null)));const e=h[1];if(e){b.duration=parseFloat(e);const t=(" "+h[2]).slice(1);b.title=t||null,b.tagList.push(t?["INF",e,t]:["INF",e])}else if(h[3]){if(r(b.duration)){var k;b.playlistOffset=E,b.setStart(E),p&&jr(b,p,c),b.sn=_,b.level=n,b.cc=y;const e=(" "+h[3]).slice(1);b.relurl=Jn(c,e),Gr(b,v,d),v=b,E+=b.duration,_++,T=0;const t=b.byteRange;if(2===t.length&&(b.bitrate=8*(t[1]-t[0])/b.duration|0),c.iframesOnly&&t[0]&&(null==(k=m)?void 0:k.cc)!==y){const e=new C(s,l);e.relurl=b.relurl,e.setByteRange(`${Math.min(t[0],1316)}@0`),e.level=n,e.sn="initSegment",p&&(e.levelkeys=p,p.identity&&(e._decryptdata=p.identity.getDecryptData(0))),m=e,b.initSegment=m}u.push(b),A=!0}}else{if(h=h[0].match(wr),!h){Z.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":v?b.setByteRange(i,v):b.setByteRange(i);break;case"PROGRAM-DATE-TIME":b.rawProgramDateTime=i,b.tagList.push(["PROGRAM-DATE-TIME",i]),-1===I&&(I=u.length);break;case"PLAYLIST-TYPE":c.type&&Wr(c,e,h),c.type=i.toUpperCase();break;case"MEDIA-SEQUENCE":0!==c.startSN?Wr(c,e,h):null!==v&&Vr(c,e,h),c.startSN=parseInt(i),_=c.startSN+c.skippedSegments;break;case"SKIP":{c.skippedSegments&&Wr(c,e,h);const t=new tr(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&&Wr(c,e,h),c.targetduration=Math.max(parseInt(i),1);break;case"VERSION":null!==c.version&&Wr(c,e,h),c.version=parseInt(i);break;case"INDEPENDENT-SEGMENTS":break;case"I-FRAMES-ONLY":c.iframesOnly=!0;break;case"ENDLIST":c.live||Wr(c,e,h),c.live=!1;break;case"#":(i||o)&&b.tagList.push(o?[i,o]:[i]);break;case"DISCONTINUITY":y++,b.tagList.push(["DIS"]);break;case"GAP":b.gap=!0,b.tagList.push([e]);break;case"BITRATE":b.tagList.push([e,i]),S=1e3*parseInt(i),r(S)?b.bitrate=S:S=0;break;case"DATERANGE":{const e=new tr(i,c),t=new rr(e,c.dateRanges[e.ID],c.dateRangeTagCount);c.dateRangeTagCount++,t.isValid||c.skippedSegments?c.dateRanges[t.id]=t:Z.log(`Ignoring invalid DATERANGE tag: ${t.invalidReason}: ${i}`),b.tagList.push(["EXT-X-DATERANGE",i]);break}case"DEFINE":{const e=new tr(i,c);"IMPORT"in e?Qn(c,e,a):Xn(c,e,t)}break;case"DISCONTINUITY-SEQUENCE":0!==c.startCC&&Wr(c,e,h),c.startCC=y=parseInt(i),u.forEach((e=>e&&(e.cc=y)));break;case"KEY":{const e=Ur(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=w({},p)),p[e.keyFormat]=e)}else Z.warn(`[Keys] Ignoring unsupported EXT-X-KEY tag: "${i}"`);break}case"START":c.startTimeOffset=Br(i);break;case"MAP":{const e=new tr(i,c);if(b.duration){const t=new C(s,l);Hr(t,e,n,p),m=t,b.initSegment=m,m.rawProgramDateTime&&!b.rawProgramDateTime&&(b.rawProgramDateTime=m.rawProgramDateTime)}else{const t=b.byteRangeEndOffset;if(t){const e=b.byteRangeStartOffset;R=`${t-e}@${e}`}else R=null;Hr(b,e,n,p),m=b,A=!0}m.cc=y;break}case"SERVER-CONTROL":g&&Wr(c,e,h),g=new tr(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&&Wr(c,e,h);const t=new tr(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 tr(i,c),s=new L(r,b,l,n,t);e.push(s),b.duration+=s.duration;break}case"PRELOAD-HINT":{const e=new tr(i,c);c.preloadHint=e;break}case"RENDITION-REPORT":{const e=new tr(i,c);c.renditionReports=c.renditionReports||[],c.renditionReports.push(e);break}default:Z.warn(`line parsed but not handled: ${h}`)}}}v&&!v.relurl?(u.pop(),E-=v.duration,c.partList&&(c.fragmentHint=v)):c.partList&&(Gr(b,v,d),b.cc=y,c.fragmentHint=b,p&&jr(b,p,c)),c.targetduration||(c.playlistParsingError=new Error("Missing Target Duration"));const O=u.length,N=u[0],P=u[O-1];if(E+=c.skippedSegments*c.targetduration,E>0&&O&&P){c.averagetargetduration=E/O;const e=P.sn;c.endSN="initSegment"!==e?e:0,c.live||(P.endList=!0),I>0&&(!function(e,t,n){if(n||(n=e[t]),!n)return;for(let r=t;r--;){const t=e[r];if(!t)return;t.programDateTime=n.programDateTime-1e3*t.duration,n=t}}(u,I,I>O-1?b:null),N&&d.unshift(N))}return c.fragmentHint&&(E+=c.fragmentHint.duration),c.totalduration=E,d.length&&c.dateRangeTagCount&&N&&Dr(d,c),c.endCC=y,c}}function Mr(e,t,n,r,s,i){var a;if(void 0===t)return null;const o=Jn(r,t),l={attrs:e,bitrate:e.decimalInteger("BANDWIDTH")||e.decimalInteger("AVERAGE-BANDWIDTH"),name:e.NAME,url:Pr.resolve(o,n)},c=e.decimalResolution("RESOLUTION");c&&(l.width=c.width,l.height=c.height),Fr(e.CODECS,l);const u=e["SUPPLEMENTAL-CODECS"];return u&&(l.supplemental={},Fr(u,l.supplemental)),null!=(a=l.unknownCodecs)&&a.length||s.push(l),i&&(l.iframes=!0),l}function Dr(e,t){let n=e.length;if(!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=xr(t,c,e,r,s);if(n){l.tagAnchor=n.ref;break}}}}function xr(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=i.sn-e.startSN,a=e.fragments;if(s>=0&&s<a.length){if(a.length>n.length){const i=n[r+1]||a[a.length-1];for(let n=Math.min(i.sn-e.startSN,a.length-1);n>s;n--){const e=a[n].programDateTime;if(t>=e&&t<e+1e3*a[n].duration)return a[n]}}return a[s]}}}}return null}function Ur(e,t,n){var r,s;const i=new tr(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&&Z.error(`Invalid IV: ${i.IV}`);const d=o?Pr.resolve(o,t):"",h=(c||"1").split("/").map(Number).filter(Number.isFinite);return new Rr(a,d,u,h,l,i.KEYID)}function Br(e){const t=new tr(e).decimalFloatingPoint("TIME-OFFSET");return r(t)?t:null}function Fr(e,t){let n=(e||"").split(/[ ,]+/).filter((e=>e));["video","audio","text","image"].forEach((e=>{const r=n.filter((t=>gt(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 $r(e,t,n){const r=t[n];r&&(e[n]=r)}function Gr(e,t,n){e.rawProgramDateTime?n.push(e):null!=t&&t.programDateTime&&(e.programDateTime=t.endProgramDateTime)}function Hr(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 jr(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 Wr(e,t,n){e.playlistParsingError=new Error(`#EXT-X-${t} must not appear more than once (${n[0]})`)}function Vr(e,t,n){e.playlistParsingError=new Error(`#EXT-X-${t} must appear before the first Media Segment (${n[0]})`)}function Kr(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 qr(e,t,n,s,i,a,o,l){s-n<=0&&(l.warn("Fragment should have a positive duration",t),s=n+t.duration,a=i+t.duration);let c=n,u=s;const d=t.startPTS,h=t.endPTS;if(r(d)){const o=Math.abs(d-n);e&&o>e.totalduration?l.warn(`media timestamps and playlist times differ by ${o}s for level ${t.level} ${e.url}`):r(t.deltaPTS)?t.deltaPTS=Math.max(o,t.deltaPTS):t.deltaPTS=o,c=Math.max(n,d),n=Math.min(n,d),i=void 0!==t.startDTS?Math.min(i,t.startDTS):i,u=Math.min(s,h),s=Math.max(s,h),a=void 0!==t.endDTS?Math.max(a,t.endDTS):a}const f=n-t.start;0!==t.start&&t.setStart(n),t.setDuration(s-t.start),t.startPTS=n,t.maxStartPTS=c,t.startDTS=i,t.endPTS=s,t.minEndPTS=u,t.endDTS=a;const p=t.sn;if(!e||p<e.startSN||p>e.endSN)return 0;let g;const m=p-e.startSN,_=e.fragments;for(_[m]=t,g=m;g>0;g--)Kr(_[g],_[g-1]);for(g=m;g<_.length-1;g++)Kr(_[g],_[g+1]);return e.fragmentHint&&Kr(_[_.length-1],e.fragmentHint),e.PTSKnown=e.alignedSliding=!0,f}function Yr(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){var r;const s=t.skippedSegments,i=Math.max(e.startSN,t.startSN)-t.startSN,a=(e.fragmentHint?1:0)+(s?t.endSN:Math.min(e.endSN,t.endSN))-t.startSN,o=t.startSN-e.startSN,l=t.fragmentHint?t.fragments.concat(t.fragmentHint):t.fragments,c=null!=(r=e.fragmentHint)&&r.duration?e.fragments.concat(e.fragmentHint):e.fragments;for(let r=i;r<=a;r++){const i=c[o+r];let a=l[r];if(s&&!a&&i&&(a=t.fragments[r]=i),i&&a){n(i,a,r,l);const s=i.relurl,o=a.relurl;if(s&&ns(s,o))return void(t.playlistParsingError=zr(`media sequence mismatch ${a.sn}:`,e,t,i,a));if(i.cc!==a.cc)return void(t.playlistParsingError=zr(`discontinuity sequence mismatch (${i.cc}!=${a.cc})`,e,t,i,a))}}}(e,t,((e,n,i,o)=>
vendor: 3,719 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=w({},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 rr(r[e].attr,t);s.isValid?(i[e]=s,t||(s.tagOrder+=a)):n.warn(`Ignoring invalid Playlist Delta Update DATERANGE tag: "${qt(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&&Gr(l[e],l[e-1],r);Dr(r,t)}t.endCC=o[o.length-1].cc}if(!t.startCC){var c;const n=Qr(e,t.startSN-1);t.startCC=null!=(c=null==n?void 0:n.cc)?c:o[0].cc}if(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,t.gap=e.gap||t.gap})),a){t.iframesOnly&&(a.type,y.MAIN);qr(t,a,a.startPTS,a.endPTS,a.startDTS,a.endDTS,0,n)}else Jr(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 zr(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 Jr(e,t,n=!0,r){const s=t.startSN+t.skippedSegments-e.startSN,i=e.fragments,a=s>=0;let o=0;if(a&&s<i.length)o=i[s].start,null==r||r.log(`Aligning playlists based on SN ${t.startSN} (diff: ${o})`);else if(a&&t.startSN===e.endSN+1)o=e.fragmentEnd,null==r||r.log(`Aligning playlists based on first/last SN ${t.startSN} (diff: ${o})`);else if(a&&n)o=e.fragmentStart+s*t.levelTargetDuration;else{if(t.skippedSegments||0!==t.fragmentStart)return o;o=e.fragmentStart,null==r||r.log(`Aligning playlists based on first SN ${t.startSN} (diff: ${o})`)}return function(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)}}(t,o),o}function Xr(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>0&&e<n&&(n=e)}}else n/=2;return Math.round(n)}function Qr(e,t,n){var r;if(!e)return null;let s=e.fragments[t-e.startSN];return s||(s=e.fragmentHint,(null==(r=s)?void 0:r.sn)===t?s:n&&t<e.startSN&&n.sn===t?n:null)}function Zr(e,t,n){return e?es(e.partList,t,n):null}
vendor: 4,313 bytes, line 1
1function es(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 ts(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 ns(e,t){return!(e===t||!t)&&rs(e)!==rs(t)}function rs(e){return e.replace(/\?[^?]*$/,"")}function ss(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 is(e,t){const n=e.start+t;e.setStart(n)}function as(e,t){const n=t.fragments;for(let t=0,r=n.length;t<r;t++)is(n[t],e);t.fragmentHint&&is(t.fragmentHint,e),t.alignedSliding=!0}function os(e,t,n){e&&(!function(e,t,n){if(!function(e,t){return!!(e&&t.startCC<e.endCC&&t.endCC>e.startCC)}(t,e))return;const r=Math.min(t.endCC,e.endCC),s=ss(t.fragments,r),i=ss(e.fragments,r);if(!s||!i)return;const a=s.start-i.start;n.log(`Aligning playlists using dicontinuity sequence ${r} (diff: ${a})`),as(a,e)}(t,e,n),t.alignedSliding||function(e,t,n){if(!e.hasProgramDateTime||!t.hasProgramDateTime)return;const r=e.fragments,s=t.fragments;if(!r.length||!s.length)return;let i,a;const o=Math.min(t.endCC,e.endCC);t.startCC<o&&e.startCC<o&&(i=ss(s,o),a=ss(r,o));i&&a||(i=s[Math.floor(s.length/2)]||s.filter((e=>!!e))[0],a=ss(r,i.cc)||r[Math.floor(r.length/2)]);const l=i.programDateTime,c=a.programDateTime;if(!l||!c)return;const u=(c-l)/1e3;if(Math.abs(u)>Math.max(60,e.totalduration))return void n.log(`Cannot align playlists using PDT without overlap (${Math.abs(u)} > ${e.totalduration})`);const d=u-(a.start-i.start);n.log(`Aligning playlists using PDT (diff: ${d})`),as(d,e)}(t,e,n),t.alignedSliding||t.skippedSegments||Jr(e,t,!1,n))}function ls(e,t,n){cs(e,t,n),e.addEventListener(t,n)}function cs(e,t,n){e.removeEventListener(t,n)}function us(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}const ds="STOPPED",hs="IDLE",fs="KEY_LOADING",ps="FRAG_LOADING",gs="FRAG_LOADING_WAITING_RETRY",ms="WAITING_TRACK",_s="PARSING",Ts="PARSED",Es="ENDED",ys="ERROR",Ss="WAITING_INIT_PTS",vs="WAITING_LEVEL";class bs extends Wn{constructor(e,t,n,r,s){super(r,e.logger),this.hls=void 0,this.fragPrevious=null,this.fragCurrent=null,this.fragPlaying=null,this.fragmentTracker=void 0,this.transmuxer=null,this._state=ds,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=-1,this.startTimeOffset=null,this.retryDate=0,this.levels=null,this.fragmentLoader=void 0,this.initFragmentLoader=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:r,state:s}=this,i=n?n.currentTime:0,a=qn.bufferInfo(r||n,i,e.maxBufferHole),o=a.len;if(this.log(`Media seeking to ${i}, state: ${s}, ${o?"in":"out of"} buffer`),this.state===Es)this.resetLoadingState();else if(t){const n=e.maxFragLookUpTolerance,r=t.start-n,s=t.start+t.duration+n;if(!o||s<a.start||r>a.end){const e=i<r,n=i>s;(e||n)&&(!t.loader||!n&&this.isFragmentNearlyDownloaded(t)?this.fragPrevious=null:(this.log(`Cancelling fragment load for seek (sn: ${t.sn}) - ${e?"backward":"forward"} seek`),t.abortRequests(),this.resetLoadingState()))}}if(n){this.fragmentTracker.removeFragmentsInRange(i,1/0,this.playlistType,!0);if(i>this.lastCurrentTime&&(this.lastCurrentTime=i),!this.loadingParts){const e=Math.max(a.end,i),t=this.shouldLoadParts(this.getLevelDetails(),e);t&&(this.log(`LL-Part loading ON after seeking to ${i} with buffer @${e}`),this.loadingParts=t)}}const l=!qn.isBuffered(n,i);this.hls.hasEnoughToStart&&!l||(this.log(`Setting ${l?"startPosition":"nextLoadPosition"} to ${i} for seek without enough to start`),this.nextLoadPosition=i,l&&(this.startPosition=i)),o<1&&this.state===hs&&this.tickImmediate()},this.onMediaEnded=()=>{this.log("setting startPosition to 0 because media ended"),this.startPosition=this.lastCurrentTime=0},this.playlistType=s,this.hls=e,this.fragmentLoader=new Fn(e.config),this.initFragmentLoader=new Fn(e.config),this.keyLoader=n,this.fragmentTracker=t,this.config=e.config,this.decrypter=new
vendor: 15,191 bytes, line 1
1Un(e.config)}registerListeners(){const{hls:e}=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.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===ds)return;this.fragmentLoader.abort(),this.initFragmentLoader.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=ds}get startPositionValue(){const{nextLoadPosition:e,startPosition:t}=this;if(-1===t&&e){const t=this.getLevelDetails();if(null!=t&&t.live){return(this.hls.liveSyncPosition||t.fragmentStart)+this.timelineOffset}return e}return t}get bufferingEnabled(){return this.buffering}get backtrackFragment(){}set backtrackFragment(e){}get couldBacktrack(){return!1}set couldBacktrack(e){}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=qn.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 qn.isBuffered(this.media,e.start+e.duration/2)}const o=t.fragments[t.fragments.length-1];return this.fragmentTracker.isEndListAppended(o.type)}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;ls(n,"seeking",this.onMediaSeeking),ls(n,"ended",this.onMediaEnded);const r=this.config;this.levels&&r.autoStartLoad&&this.state===ds&&this.startLoad(r.startPosition)}onMediaDetaching(e,t){this.fragPlaying=null;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),cs(r,"seeking",this.onMediaSeeking),cs(r,"ended",this.onMediaEnded),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.fragPlaying=this.levels=this.levelLastLoaded=this.fragCurrent=null,this.lastCurrentTime=0,this.startPosition=-1,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=ds,this.fragmentLoader&&this.fragmentLoader.destroy(),this.initFragmentLoader&&this.initFragmentLoader.destroy(),this.keyLoader&&this.keyLoader.destroy(),this.decrypter&&this.decrypter.destroy(),this.hls=this.decrypter=this.keyLoader=null,this.fragmentLoader=this.initFragmentLoader=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);const n=++t.stats.chunkCount;this.log(`load progress ${t.type} sn: ${t.sn}${e.part?" part: "+e.part.index:""} of ${this.fragInfo(t,!1,e.part)} chunk: ${n}`),this._handleFragmentLoadProgress(e)})).then((e=>{if(!e)return;const t=this.state,n=e.frag;this.fragContextChanged(n)?(t===ps||!this.fragCurrent&&t===_s)&&(this.fragmentTracker.removeFragment(n),this.state=hs):("payload"in e&&(this.log(`Loaded ${n.type} sn: ${n.sn} of ${this.playlistLabel()} ${n.level} (bytes ${n.stats.loaded})`),this.hls.trigger(l.FRAG_LOADED,e)),this._handleFragmentLoadComplete(e))})).catch((t=>{this.state!==ds&&this.state!==ys&&(this.log(`Frag error ${e.type} sn:${e.sn} cc:${e.cc}: ${(null==t?void 0:t.message)||t}`),this.resetFragmentLoading(e))}))}clearTrackerIfNeeded(e){var t;const{fragmentTracker:n}=this;if(n.getState(e)===An){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)===Rn&&n.removeFragment(e))}checkLiveUpdate(e){if(e.updated&&!e.live){const t=this.fragmentTracker,n=e.fragments[e.fragments.length-1];if(n.endList&&!t.isEndListAppended(this.playlistType)){const e=t.getPartialFragment(n.end);e&&(t.removeFragment(e),t.fragBuffered(n,!0))}t.detectPartialFragments({frag:n,part:null,stats:n.stats,id:n.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){const{hls:t}=this;return this.initFragmentLoader.abort(),t.trigger(l.FRAG_LOADING,{frag:e,targetBufferTime:0}),this.initFragmentLoader.load(e).then((e=>{var t;const n=e.frag;if(!this.levels||!k(n,null==(t=this.fragCurrent)?void 0:t.initSegment))throw new jn({type:a.NETWORK_ERROR,details:o.INTERNAL_ABORTED,error:new Error("init load aborted"),fatal:!1,frag:n,networkDetails:null});return e})).then((e=>{const{frag:n,payload:r}=e,s=n.decryptdata;if(r&&r.byteLength>0&&null!=s&&s.key&&s.iv&&or(s.method)){const i=self.performance.now(),{decryptRange:c}=Gn(n,null,this.iframesOnly);return this.decrypter.decrypt(new Uint8Array(r),s.key.buffer,s.iv.buffer,lr(s.method),c).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}),this.fragmentLoader.abort(),e})).then((r=>{const s=self.performance.now();return t.trigger(l.FRAG_DECRYPTED,{frag:n,part:null,payload:r,stats:{tstart:i,tdecrypt:s}}),e.payload=r,this.completeInitSegmentLoad(e)}))}return this.completeInitSegmentLoad(e)}))}completeInitSegmentLoad(e){const t=e.frag.stats;e.frag.data=new Uint8Array(e.payload),t.parsing.start=t.buffering.start=self.performance.now(),t.parsing.end=t.buffering.end=self.performance.now()}loadInitSegmentIfNeeded(e){const{initSegment:t}=e;if(!this.bitrateTest&&A(e)&&t&&!t.data){var n;return(!t.encrypted||null!=(n=t.decryptdata)&&n.key?this._loadInitSegment(t):this.keyLoader.load(t).then((()=>this._loadInitSegment(t)))).catch((t=>{if(this.state===ds||this.state===ys)throw t;throw"data"in t&&(t.data.frag=e,this.fragmentLoader.abort(),this.handleFragLoadError(t)),this.resetFragmentLoading(e),t}))}}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||!k(e,t)}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?us(qn.getBuffered(n)):"(detached)"})`),A(e)){var r;if(e.type!==y.SUBTITLE){const t=e.elementaryStreams;if(!Object.keys(t).some((e=>!!t[e])))return void(this.state=hs)}const n=null==(r=this.levels)?void 0:r[e.level];null!=n&&n.fragmentError&&(t||this.fragmentTracker.getState(e)!==Rn)&&(this.log(`Resetting level fragment error count of ${n.fragmentError} on frag buffered`),n.fragmentError=0,e.stats.retry=0)}this.state=hs}_handleFragmentLoadComplete(e){const{transmuxer:t}=this;if(!t)return;const n=e.frag,{part:r,partsLoaded:s}=e,i=!s||0===s.length||s.some((e=>!e)),{decryptRange:a}=Gn(n,r),o=new Vn(n.level,n.sn,n.stats.chunkCount+1,0,r?r.index:-1,!i,n.duration,this.iframesOnly,a);this.log(`load complete ${n.type} sn: ${n.sn}${r?" part: "+r.index:""} of ${this.fragInfo(n,!1,r)}`),t.flush(o)}_handleFragmentLoadProgress(e){}loadKeyFor(e,t,n){var r;let s=null;return!e.encrypted||null!=(r=e.decryptdata)&&r.key?e.encrypted||(s=this.keyLoader.loadClear(e,t.encryptedFragments,this.startFragRequested),s&&this.log(`[eme] blocking frag sn: ${e.sn} load until media-keys acquired`)):(this.log(`Loading key for ${e.sn} of [${t.startSN}-${t.endSN}], ${this.playlistLabel()} ${e.level}`),this.state=fs,s=this.keyLoader.load(e,n).then((e=>{if(!this.fragContextChanged(e.frag))return this.hls.trigger(l.KEY_LOADED,e),this.state===fs&&(this.state=hs),e})),this.hls.trigger(l.KEY_LOADING,{frag:e})),s}_doFragLoad(e,t,n=null,s){this.fragCurrent=e;const i=t.details;if(!this.levels||!i)throw new Error(`frag load aborted, missing level${i?"":" detail"}s`);const a=this.fragPrevious;if(!R(e,a)){const n=this.shouldLoadParts(t.details,e.end);n!==this.loadingParts&&(this.log(`LL-Part loading ${n?"ON":"OFF"} loading sn ${null==a?void 0:a.sn}->${e.sn}`),this.loadingParts=n)}if(n=Math.max(e.start,n||0),this.loadingParts){const r=i.partList;if(r&&s){n>i.fragmentEnd&&i.fragmentHint&&(e=i.fragmentHint);const o=this.getNextPart(r,e,n);if(o>-1){const c=r[o];if(!R(e=this.fragCurrent=c.fragment,a)&&!this.shouldLoadParts(t.details,e.end))return this.log(`LL-Part loading OFF @${this.playhead} next part: ${this.fragInfo(e,!1,c)}`),this.loadingParts=!1,Promise.resolve(null);if(!this.filterReplacedPrimary(c,t.details))return Promise.resolve(null);const u=this.loadKeyFor(e,i);if(this.fragContextChanged(e))return Promise.resolve(null);let d;this.log(`Loading ${e.type} sn: ${e.sn} part: ${c.index} (${o}/${r.length-1}) of ${this.fragInfo(e,!1,c)} cc: ${e.cc} [${i.startSN}-${i.endSN}], target: ${n}${c.byteRange.length?` range:${c.byteRange.join("-")}`:""}`),this.nextLoadPosition=c.start+c.duration,this.state=ps;const h=this.loadInitSegmentIfNeeded(e);if(u||h){const n=!!u;d=Promise.all([u,h]).then((([r])=>!n||r&&!this.fragContextChanged(r.frag)?this.doFragPartsLoad(e,c,t,s):null)).catch((e=>this.handleFragLoadError(e)))}else d=this.doFragPartsLoad(e,c,t,s).catch((e=>this.handleFragLoadError(e)));return 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")):d}if(!e.url||this.loadedEndOfParts(r,n))return Promise.resolve(null)}}var o;if(this.loadingParts)this.log(`LL-Part loading OFF after next part miss @${n} Check buffer at sn: ${e.sn} loaded parts: ${null==(o=i.partList)?void 0:o.filter((e=>e.loaded)).map((e=>`[${e.start}-${e.end}]`))}`),this.loadingParts=!1;else if(!e.url)return Promise.resolve(null);if(!this.filterReplacedPrimary(e,t.details))return Promise.resolve(null);const c=this.loadInitSegmentIfNeeded(e),u=this.loadKeyFor(e,i,c);var d;if(this.fragContextChanged(e))return this.log(`Context changed in KEY_LOADING sn: ${e.sn} ${e.relurl} > ${null==(d=this.fragCurrent)?void 0:d.relurl}`),null==c||c.catch((()=>null)),null==u||u.catch((()=>null)),Promise.resolve(null);this.log(`Loading ${e.type} sn: ${e.sn} of ${this.fragInfo(e,!1)} cc: ${e.cc} ${"["+i.startSN+"-"+i.endSN+"]"}, target: ${n}${e.byteRange.length?` range:${e.byteRange.join("-")}`:""}`),r(e.sn)&&!this.bitrateTest&&(this.nextLoadPosition=e.start+e.duration),this.state=ps;const h=this.config.progressive&&e.type!==y.SUBTITLE;let f;return f=h&&u?u.then((t=>!t||this.fragContextChanged(t.frag)?null:this.fragmentLoader.load(e,this.iframesOnly,s,c))).catch((e=>this.handleFragLoadError(e))):Promise.all([this.fragmentLoader.load(e,this.iframesOnly,h?s:void 0,h?c:void 0),u,c]).then((([e])=>(!h&&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")):Promise.all([f,c]).then((([e])=>e))}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=Zr(n.details,e.sn,t.index+1)||es(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.fatal&&(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!==_s)return void(this.fragCurrent||this.state===ds||this.state===ys||(this.state=hs));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}`),this.loadingParts=o),this.updateLevelTiming(n,r,s,e)}shouldLoadParts(e,t){if(this.config.lowLatencyMode){if(!e)return this.loadingParts;if(e.partList&&!this.iframesOnly){var n;const r=e.partList[0];if(t>=r.end+((null==(n=e.fragmentHint)?void 0:n.duration)||0)){if(this.playhead>r.start-r.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?Zr(o,s,i):null,c=l?l.fragment:Qr(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!==_s)return;A(t)&&!this.fragContextChanged(t)&&(this.fragPrevious=t);const{data1:i,data2:a}=e;let o=i;
vendor: 9,121 bytes, line 1
1if(a&&(o=Qe(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(!qn.isBuffered(t,t.currentTime))return void this.flushMainBuffer(0,e.start);const n=t.currentTime,r=qn.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 r=this.playhead,s=this.lastCurrentTime>r||null!=(n=this.media)&&n.paused?0:this.config.maxBufferHole;return this.getFwdBufferInfoAtPos(e,r,t,s)}getFwdBufferInfoAtPos(e,t,n,r){const s=qn.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 qn.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)}exceedsMaxBuffer(e,t,n){const r=e.nextStart;if(r&&n.start>r){const r=e.buffered;if(r){let s=e.len;const i=e.bufferedIndex;for(let e=r.length-1;e>i;e--)r[e].start<n.start&&(s+=r[e].end-r[e].start);return s>=t}}return!1}reduceMaxBufferLength(e,t){const n=this.config,r=Math.max(Math.min(e-t,n.maxBufferLength),t/2),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){const t=this.fragmentTracker?this.fragmentTracker.getAppendedFrag(e,this.playlistType):null;return t&&"fragment"in t?t.fragment:t}getNextFragment(e,t){const n=t.fragments,r=n.length;if(!r)return null;const{config:s}=this,i=t.fragmentStart,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(this.startFragRequested||!a||this.loadingParts||(this.log("LL-Part loading ON for initial live fragment"),this.loadingParts=!0),!t.PTSKnown&&!this.startFragRequested&&-1===this.startPosition||e<i){var l;o=this.getInitialLiveFragment(t);const n=this.config.startPosition,r=this.hls.startPosition,s=this.hls.liveSyncPosition,a=(null==(l=o)?void 0:l.start)||0;let c,u;if(-1!==r&&r>=i?(c=r,u=r===n?"config":"next load start"):s?(c=s,u="live edge"):(c=e,u="buffer pos"),c<a&&(c=a,u="live frag start"),c<i&&(c=i,u="playlist start"),this.startPosition!=c||this.nextLoadPosition!=c){const l=t.live&&!this.filterReplacedPrimary(o,t)?-1:c;this.log(`Setting startPosition to ${l} next load ${c} ${-1===r?"":`(from ${n}) `}based on ${u}. live edge: ${s} live frag start: ${a} playlist start: ${i} buffer pos: ${e}`),this.startPosition=l,this.nextLoadPosition=c}}}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);return!c&&o&&(c=un(t,o.sn),c&&(this.nextLoadPosition=c.start)),c}isLoopLoading(e,t){if(this.nextLoadPosition<=t)return!1;const n=this.fragmentTracker.getState(e);if(n===kn)return!0;if(n===Rn){if(e.gap)return!0;if(e.stats.retry>1)return!0}return!1}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(As(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(As(this.config)&&("type"in e?e:e.fragment).type!==y.SUBTITLE){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&&!r.nextEvent.hasPlayed||e.start-r.end>1))return null}}if(Is(e,null==n?void 0:n.playerQueue,this.playhead))return null}return e}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||o.gap;l?r=-1:(s||(o.independent||i)&&o.fragment===t)&&(r=a),s=l&&!o.gap}const a=e[r];return a&&a.fragment!==t&&this.log(`Need buffer at ${n} but next unloaded part starts at ${a.start} (sn: ${t.sn} -> ${a.fragment.sn})`),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&&(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(ln(t,n,s))return s}return null}(t,n.endProgramDateTime,this.config.maxFragLookUpTolerance),s&&this.log(`Live playlist, switching playlist, load frag with same PDT: ${n.programDateTime}`)),!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=cn(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),s&&this.fragmentTracker.getState(s)===In&&(s=null),e<t){var h;d=an(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===kn||t===Rn&&d.gap)&&(s=d),R(d,s)&&(!u||c[0].fragment.sn>d.sn||!n.live)){const t=i[e+1];d=d.sn<a&&this.fragmentTracker.getState(t)!==kn?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){os(n,e,this);const r=e.fragmentStart;return this.log(`Live playlist sliding: ${r} 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;if(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;else if(e.live){const e=this.hls.liveSyncPosition;n=e||t,this.log(`Setting startPosition to -1 to start at ${e?"live edge":"playlist start"} ${n}`),this.startPosition=-1}else 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&&!this.iframesOnly?n=t.currentTime:this.nextLoadPosition>=0&&(n=this.nextLoadPosition),n}get playhead(){var e;if(null!=(e=this.hls)&&e.hasEnoughToStart){var t;const e=null==(t=this.media)?void 0:t.currentTime;return r(e)?e:this.lastCurrentTime}return this.getLoadPosition()}get iframesOnly(){var e;if(this.playlistType!==y.MAIN)return!1;const t=this.getLevelDetails();return t?t.iframesOnly:null==(e=this.levelLastLoaded)?void 0:e.iframes}handleFragLoadAborted(e,t){this.transmuxer&&e.type===this.playlistType&&A(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===gs)||(this.state=hs)}onFragmentOrKeyLoadError(e,t){if(t.chunkMeta&&!t.frag){const e=this.getCurrentContext(t.chunkMeta);e&&(t.frag=e.frag)}const{frag:n,part:r}=t;if(!n||!this.levels||n.type!==e)return;var s;if(this.fragContextChanged(n))return void this.warn(`Frag load error must match current frag to retry ${n.relurl} > ${null==(s=this.fragCurrent)?void 0:s.relurl}`);const i=t.details===o.FRAG_GAP;i&&this.fragmentTracker.addAsGap(n);const a=t.errorAction;if(!a)return void(this.state=ys);const{action:l,flags:c,retryCount:u=0,retryConfig:d}
1=a,h=!!d,f=h&&l===pn,p=h&&!a.resolved&&c&mn,g=this.hls.latestLevelDetails,m=null==g?void 0:g.live;if(!f&&p&&A(n)&&m&&n.sn<g.endSN&&!B(t))this.resetFragmentErrors(e),r?r.gap=!0:this.treatAsGap(n),a.resolved=!0;else if((f||p)&&u<d.maxNumRetry){var _;const r=j(null==(_=t.response)?void 0:_.code),s=$(d,u);if(this.resetStartWhenNotLoaded(),this.retryDate=self.performance.now()+s,this.state=gs,a.resolved=!0,r)return this.log("Waiting for connection (offline)"),this.retryDate=1/0,void(t.reason="offline");this.warn(`Fragment ${n.sn} of ${e} ${n.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===fn||(a.resolved=!0)}else this.state=l===hn?vs:ys;this.tickImmediate()}checkRetryDate(){const e=self.performance.now(),t=this.retryDate,n=t===1/0;(!t||e>=t||n&&!j(0))&&(n&&this.log("Connection restored (online)"),this.resetStartWhenNotLoaded(),this.state=hs)}reduceLengthAndFlushBuffer(e){if(this.state===_s||this.state===Ts){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.playhead}) is not buffered, flush ${n} buffer`):r.nextStart&&t&&r.nextStart>t.start&&this.flushMainBuffer(r.nextStart,Number.POSITIVE_INFINITY,n===y.AUDIO?n:void 0),t&&(this.fragmentTracker.removeFragment(t),this.nextLoadPosition=t.start),this.resetLoadingState(),i}return!1}resetFragmentErrors(e){e===y.AUDIO&&(this.fragCurrent=null),this.hls.hasEnoughToStart||(this.startFragRequested=!1),this.state!==ds&&(this.state=hs)}afterBufferFlushed(e,t){if(!e)return;const n=qn.getBuffered(e);this.fragmentTracker.detectEvictedFragments(t,n,this.playlistType),this.state===Es&&this.resetLoadingState()}resetLoadingState(){this.log("Reset loading state"),this.fragCurrent=null,this.fragPrevious=null,this.state!==ds&&(this.state=hs)}resetStartWhenNotLoaded(){if(!this.hls.hasEnoughToStart){this.startFragRequested=!1;const e=this.getLevelDetails();null!=e&&e.live?(this.log("resetting startPosition for live start"),this.startPosition=-1,this.setStartPosition(e,e.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");this.log(`update level timing ${e.type} sn: ${e.sn}${t?" part: "+t.index:""} of ${this.fragInfo(e,!1,t)}`);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.partial?0:qr(s,e,a.startPTS,a.endPTS,a.startDTS,a.endDTS,this.iframesOnly,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,c,u,d;const r=null===(null==(i=this.transmuxer)?void 0:i.error),s=null!=(null==(c=this.transmuxer)?void 0:c.error),h=(null!=(u=null==(d=this.levels)?void 0:d.length)?u:0)>1;if((0===n.fragmentError||r&&(n.fragmentError<2||e.endList)||s&&h)&&this.treatAsGap(e,n),r){const r=new Error(`Found no media in ${this.playlistLabel()} ${e.level} ${t?`part: ${t.index} of `:""}sn: ${e.sn} at playlist time: ${e.start}. Resetting transmuxer to fallback to playlist timing`);if(this.warn(r.message),this.hls.trigger(l.ERROR,{type:a.MEDIA_ERROR,details:o.FRAG_PARSING_ERROR,fatal:!1,error:r,frag:e,reason:`Found no media in msn ${e.sn} of ${this.playlistLabel()} "${n.url}"`}),!this.hls)return;this.resetTransmuxer()}}this.state=Ts,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,chunkMeta:r})}playlistLabel(){return`${this.playlistType} playlist`}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}-${null!=(s=t&&!n?e.endPTS:(n||e).end)?s:NaN}]${n&&"main"===e.type?"INDEPENDENT="+(n.independent?"YES":"NO"):""})`}treatAsGap(e,t){t&&t.fragmentError++,this.fragmentTracker.addAsGap(e)}resetTransmuxer(){var e;null==(e=this.transmuxer)||e.reset()}
vendor: 49,388 bytes, line 1
1isFragmentNearlyDownloaded(e){var t;const n=null==(t=e.loader)?void 0:t.stats;if(!n)return!1;const r=n.loading.first>0,s=(n.total-n.loaded)/(this.hls.bandwidthEstimate||this.hls.config.abrEwmaDefaultEstimate);return r&&s<=.15}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}calculateOptimalSwitchPoint(e,t){let n=0;const{hls:r,media:s,config:i,levels:a,playlistType:o}=this,l=this.getLevelDetails();if(s&&!s.paused&&a){var c;const t=o===y.AUDIO?Mt(e.audioCodec,128e3):e.maxBitrate,s=1+r.ttfbEstimate/1e3,a=r.bandwidthEstimate*i.abrBandWidthUpFactor;n=s+t*(l&&(this.loadingParts?l.partTarget:l.averagetargetduration)||(null==(c=this.fragCurrent)?void 0:c.duration)||6)/a,e.details||(n+=s)}const u=this.playhead;return{fetchdelay:n,okToFlushForwardBuffer:!(null!=l&&l.live)||t.end-u>1.5*n}}scheduleTrackSwitch(e,t,n){const{media:r,playlistType:s}=this;if(!r||!e)return;const i=n?this.getBufferedFrag(this.playhead+t):null;if(i){const e=this.followingBufferedFrag(i);if(e){var a;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)));if(((null==(a=this.getLevelDetails())?void 0:a.fragmentStart)||0)>r)return;const o=s===y.MAIN?null:"audio";this.flushMainBuffer(r,Number.POSITIVE_INFINITY,o),this.cleanupBackBuffer()}}}cleanupBackBuffer(){const{media:e,playlistType:t}=this;if(!e)return;const n=this.getAppendedFrag(this.playhead);if(n&&n.start>1){const e=t===y.AUDIO;this.flushMainBuffer(0,n.start-(e?0:1),e?"audio":null)}}getBufferedFrag(e){return this.fragmentTracker.getBufferedFrag(e,this.playlistType)}followingBufferedFrag(e){return e?this.getBufferedFrag(e.end+.5):null}abortCurrentFrag(){const e=this.fragCurrent;switch(this.fragCurrent=null,e&&(e.abortRequests(),this.fragmentTracker.removeFragment(e)),this.state){case fs:case ps:case gs:case _s:case Ts:this.state=hs}this.nextLoadPosition=this.playhead}checkFragPlaying(){const e=this.media;let t=null;if(e&&e.readyState>1&&!1===e.seeking){const n=e.currentTime;if(qn.isBuffered(e,n)?t=this.getAppendedFrag(n):qn.isBuffered(e,n+.1)&&(t=this.getAppendedFrag(n+.1)),t&&(this.backtrackFragment=void 0,!R(t,this.fragPlaying)))return this.fragPlaying=t,!0}return!1}getBufferOutput(){return null}nextLevelSwitch(){const{levels:e,media:t,hls:n,config:r,playlistType:s}=this;if(null!=t&&t.readyState&&e&&n&&r){const t=this.getBufferOutput(),r=this.getFwdBufferInfo(t,s);if(!r)return;const i=e[s===y.AUDIO?n.nextAudioTrack:n.nextLoadLevel],{fetchdelay:a,okToFlushForwardBuffer:o}=this.calculateOptimalSwitchPoint(i,r);this.scheduleTrackSwitch(r,a,o)}this.tickImmediate()}}function Is(e,t,n){if(t)for(let r=t.length;r--;){const s=t[r].interstitial,i=s.startTime,a=Math.min(i+s.duration,s.resumeTime);if(s.appendInPlace){if(e.start>=i&&e.end<=a)return!0;if(n>e.start&&e.end>i&&e.start<a)return!0}}return!1}function As(e){return!!e.interstitialsController&&!1!==e.enableInterstitialPlayback}class Rs{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 ks,Cs={exports:{}};var Ls=(ks||(ks=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}(Cs)),Cs.exports),Os=c(Ls);const Ns="1.7.3",ws={};function Ps(e,t){return 255===e[t]&&240==(246&e[t+1])}function Ms(e,t){return 1&e[t+1]?7:9}function Ds(e,t){return(3&e[t+3])<<11|e[t+4]<<3|(224&e[t+5])>>>5}function xs(e,t){return t+1<e.length&&Ps(e,t)}function Us(e,t){if(xs(e,t)){const n=Ms(e,t);if(t+n>=e.length)return!1;const r=Ds(e,t);if(r<=n)return!1;const s=t+r;return s===e.length||xs(e,s)}return!1}function Bs(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=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350][i];let h,f=i;5!==c&&29!==c||(f-=3);const p=(14&f)>>1,g=(1&f)<<7|u<<3;let m=0;if(1===c&&i>=6){m=5;const e=i-3;h=[m<<3|p,g|(14&e)>>1,(1&e)<<7|8,0]}else h=[c<<3|p,g];const _="mp4a.40."+(m||c);return Z.log(`manifest codec:${r}, parsed codec:${_}, channels:${u}, rate:${d} (ADTS object type:${c} sampling index:${i} esds config:[${h.join(",")}])`),{config:h,samplerate:d,channelCount:u,codec:_,parsedCodec:_,manifestCodec:r}}(t,n,r,s);if(!i)return;w(e,i)}}function Fs(e){return 9216e4/e}function $s(e,t,n,r,s){const i=r+s*Fs(e.samplerate),a=function(e,t){const n=Ms(e,t);if(t+n<=e.length){const r=Ds(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}}let Gs=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 Hs(e="",t=9e4){return{type:e,id:-1,pid:-1,inputTimeScale:t,sequenceNumber:-1,samples:[],dropped:0}}class js{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=Qe(this.cachedData,e),this.cachedData=null);let n,s=he(e,0),i=s?s.length:0;const a=this._audioTrack,o=this._id3Track,l=s?Se(s):void 0,c=e.length;for((null===this.basePTS||0===this.frameIndex&&r(l))&&(this.basePTS=Ws(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:Gs.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 ue(e,i)?(s=he(e,i),o.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:s,type:Gs.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=Qe(this.cachedData,t):this.cachedData=t}}return{audioTrack:a,videoTrack:Hs(),id3Track:o,textTrack:Hs()}}demuxSampleAes(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:Hs(),id3Track:this._id3Track,textTrack:Hs()}}destroy(){this.cachedData=null,this._audioTrack=this._id3Track=void 0}}const Ws=(e,t,n)=>{if(r(e))return 90*e;return 9e4*t+(n?9e4*n.baseTime/n.timescale:0)},Vs=[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],Ks=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],qs=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],Ys=[0,1,1,4];function zs(e,t,n,r,s){if(n+24>t.length)return;const i=Js(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 Js(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*Vs[14*(3===n?3-r:3===r?3:4)+s-1],c=Ks[3*(3===n?0:2===n?1:2)+i],u=3===o?1:2,d=qs[n][r],h=Ys[r],f=8*d*h,p=Math.floor(d*l/c+a)*h,g=ht();return!!g&&g<=87&&2===r&&l>=224e3&&0===o&&(e[t+3]=128|e[t+3]),{sampleRate:c,channelCount:u,frameLength:p,samplesPerFrame:f}}}function Xs(e,t){return!(255!==e[t]||224&~e[t+1]||!(6&e[t+1]))}function Qs(e,t){return t+1<e.length&&Xs(e,t)}function Zs(e,t){if(t+1<e.length&&Xs(e,t)){const n=4,r=Js(e,t);let s=n;null!=r&&r.frameLength&&(s=r.frameLength);const i=t+s;return i===e.length||Qs(e,i)}return!1}class ei{constructor(e,t,n){this.keyData=void 0,this.decrypter=void 0,this.keyData=n,this.decrypter=new Un(t,!0)}decryptBuffer(e){return this.decrypter.decrypt(e,this.keyData.key.buffer,this.keyData.iv.buffer,wn,{start:0,end:e.byteLength})}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)}decryptAacSamples(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=nt(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}}}}const ti=(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 ni extends js{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=ri(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=he(e,0);if(!t)return!1;const n=t.length;if(11===e[n]&&119===e[n+1]&&void 0!==Se(t)){if(ti(e,n)<16)return!0;throw new Error("Containerless ec-3 is not supported")}return!1}}function ri(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 si=/\/emsg[-/]ID3/i;function ii(e,t){return r(e.presentationTime)?e.presentationTime/e.timeScale:t+e.presentationTimeDelta/e.timeScale}class ai{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;if(0===r)return[];const s=e.naluState||0,i=-1===s?0:s,a=[];let o=0,l=0,c=-1,u=0;for(-1===s&&(c=0,u=this.getNALuType(t,0),l=1);l<r;){const n=t.indexOf(1,l);if(-1===n)break;l=n+1;let s=n;for(;s>0&&0===t[s-1];)s--;if(!(n-s+(0===s?i:0)<2)){if(c>=0)a.push({data:t.subarray(c,s),type:u});else{const n=this.getLastNalUnit(e.samples);n&&(s>0?n.data=Qe(n.data,t.subarray(0,s)):i>0&&(n.data=n.data.subarray(0,n.data.byteLength-i)),n.state=0)}if(!(l<r)){o=-1,c=-1;break}c=l,u=this.getNALuType(t,l)}}if(-1!==o){let e=r;for(;e>0&&0===t[e-1];)e--;o=r-e+(0===e?i:0)}if(c>=0)a.push({data:t.subarray(c),type:u,state:o});else if(0===a.length&&-1!==o){const n=this.getLastNalUnit(e.samples);n&&(n.data=Qe(n.data,t),n.state=o)}return e.naluState=o,a}}class oi{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&&Z.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)}}class li extends ai{parsePES(e,t,n,r,s){const i=s.iframe,a=this.parseNALu(e,n.data,r);let o,l=this.VideoSample,c=!1;n.data=null,l&&a.length&&!e.audFound&&(this.pushAccessUnit(l,e),l=this.VideoSample=this.createVideoSample(!1,n.pts,n.dts)),a.forEach((r=>{var s,a;switch(r.type){case 1:{if(i)break;let t=!1;o=!0;const s=r.data;if(c&&s.length>4){const e=this.readSliceType(s);2!==e&&4!==e&&7!==e&&9!==e||(t=!0)}var u;if(t)null!=(u=l)&&u.frame&&!l.key&&(this.pushAccessUnit(l,e),l=this.VideoSample=null);l||(l=this.VideoSample=this.createVideoSample(!0,n.pts,n.dts)),l.frame=!0,l.key=t;break}case 5:o=!0,null!=(s=l)&&s.frame&&!l.key&&(this.pushAccessUnit(l,e),l=this.VideoSample=null),l||(l=this.VideoSample=this.createVideoSample(!0,n.pts,n.dts)),l.key=!0,l.frame=!0;break;case 6:if(i)break;o=!0,tt(r.data,1,n.pts,t.samples);break;case 7:{var d,h;o=!0,c=!0;const t=r.data,n=this.readSPS(t);if(!e.sps||e.width!==n.width||e.height!==n.height||(null==(d=e.pixelRatio)?void 0:d[0])!==n.pixelRatio[0]||(null==(h=e.pixelRatio)?void 0:h[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:o=!0,e.pps=[r.data];break;case 9:o=!0,e.audFound=!0,null!=(a=l)&&a.frame&&(this.pushAccessUnit(l,e),l=null),l||(l=this.VideoSample=this.createVideoSample(!1,n.pts,n.dts));break;case 12:o=!0;break;default:o=!1}if(l&&o){l.units.push(r)}})),r&&l&&(this.pushAccessUnit(l,e),this.VideoSample=null)}getNALuType(e,t){return 31&e[t]}readSliceType(e){const t=new oi(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 oi(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 ci extends ai{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;const l=e=>(a=this.VideoSample=this.createVideoSample(e,n.pts,n.dts),a);s.forEach(((r,s)=>{var c,u;if(this.startsNewAccessUnit(a,e,r,s)){this.pushAccessUnit(a,e);const t=r.type>=16&&r.type<=23;a=l(t),o=!1}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=l(!1)),a.frame=!0,i=!0;break;case 16:case 17:case 18:case 21:case 22:case 23:var d;if(i=!0,o)null!=(d=a)&&d.frame&&!a.key&&(this.pushAccessUnit(a,e),a=this.VideoSample=null);a||(a=l(!0)),a.key=!0,a.frame=!0;break;case 19:case 20:i=!0,null!=(c=a)&&c.frame&&!a.key&&(this.pushAccessUnit(a,e),a=this.VideoSample=null),a||(a=l(!0)),a.key=!0,a.frame=!0;break;case 39:i=!0,tt(r.data,2,n.pts,t.samples);break;case 32:i=!0,e.vps||("object"!=typeof e.params&&(e.params={}),e.params=w(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=l(!1));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!=(u=a)&&u.frame&&(this.pushAccessUnit(a,e),a=null),a||(a=l(!1));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)}startsNewAccessUnit(e,t,n,r){if(!e)return!1;if(!t.audFound&&0===r)return!0;if(!e.frame)return!1;const{type:s,data:i}=n;return!!(s>=32&&s<=35||39===s||s>=41&&s<=44||s>=48&&s<=55)||s<=31&&i.length>2&&!!(128&i[2])}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 oi(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 oi(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 k=t.readUEG(),C=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:k+8,bit_depth_luma_minus8:k,bit_depth_chroma_minus8:C,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 oi(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 Ae(e).substring(3)===Ae(t).substring(3)}}const ui=188;class di{constructor(e,t,n,r){this.logger=void 0,this.observer=void 0,this.config=void 0,this.typeSupported=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._klvPid=-1,this.aacOverFlow=null,this.remainderData=null,this.videoParser=void 0,this.videoIntegrityChecker=null,this.observer=e,this.config=t,this.typeSupported=n,this.logger=r,this.videoParser=null}static probe(e,t){const n=di.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-ui)+1,r=0;for(;r<n;){let s=!1,i=-1,a=0;for(let o=r;o<t;o+=ui){if(71!==e[o]||t-o!==ui&&71!==e[o+ui]){if(a)return-1;break}if(a++,-1===i&&(i=o,0!==i&&(n=Math.min(i+18612,e.length-ui)+1)),s||(s=0===hi(e,o)),s&&a>1&&(0===i&&a>2||o+ui>n))return i}r++}return-1}static createTrack(e,t){return{container:"video"===e||"audio"===e?"video/mp2t":void 0,type:e,id:Ce[e],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:"audio"===e?t:void 0}}resetInitSegment(e,t,n,r,s,i){this.pmtParsed=!1,this._pmtId=-1,this._videoTrack=di.createTrack("video"),this._videoTrack.duration=r,this.videoIntegrityChecker="skip"===this.config.handleMpegTsVideoIntegrityErrors?new Ti(this.logger):null,this._audioTrack=di.createTrack("audio",r),this._id3Track=di.createTrack("id3"),this._txtTrack=di.createTrack("text"),this._audioTrack.segmentCodec="aac",this.videoParser=null,this.aacOverFlow=null,this.remainderData=null,this.audioCodec=t,this.videoCodec=n,e&&this.demux(e,0,i,"SAMPLE-AES"===(null==s?void 0:s.method))}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,r=!1,s=!1){let i;r||(this.sampleAes=null);const a=this._videoTrack,o=this.videoIntegrityChecker,l=this._audioTrack,c=this._id3Track,u=this._txtTrack,d=n.iframe;let h=a.pid,f=a.pesData,p=l.pid,g=c.pid,m=this._klvPid,_=l.pesData,T=c.pesData,E=null,y=null,S=this.pmtParsed,v=this._pmtId,b=e.length;if(this.remainderData&&(b=(e=Qe(this.remainderData,e)).length,this.remainderData=null),b<ui&&!s)return this.remainderData=e,{audioTrack:l,videoTrack:a,id3Track:c,textTrack:u};const I=Math.max(0,di.syncOffset(e));b-=(b-I)%ui,b<e.byteLength&&!s&&(this.remainderData=new Uint8Array(e.buffer,b,e.buffer.byteLength-b));let A=0;for(let t=I;t<b;t+=ui)if(71===e[t]){const s=!!(64&e[t+1]),b=hi(e,t);let A;if((48&e[t+3])>>4>1){if(A=t+5+e[t+4],A===t+ui)continue}else A=t+4;switch(b){case h:s&&(!f||null!=o&&o.isCorrupted||!(i=_i(f,this.logger))||(this.readyVideoParser(a.segmentCodec),null!==this.videoParser&&this.videoParser.parsePES(a,u,i,!1,n)),f={data:[],size:0},null==o||o.reset(h)),null==o||o.handlePacket(e.subarray(t)),f&&(f.data.push(e.subarray(A,t+ui)),f.size+=t+ui-A);break;case p:if(d)break;if(s){if(_&&(i=_i(_,this.logger)))switch(l.segmentCodec){case"aac":this.parseAACPES(l,i,n);break;case"mp3":this.parseMPEGPES(l,i);break;case"ac3":this.parseAC3PES(l,i)}_={data:[],size:0}}_&&(_.data.push(e.subarray(A,t+ui)),_.size+=t+ui-A);break;case g:if(d)break;s&&(T&&(i=_i(T,this.logger))&&this.parseID3PES(c,i),T={data:[],size:0}),T&&(T.data.push(e.subarray(A,t+ui)),T.size+=t+ui-A);break;case m:if(d)break;s&&(E&&(i=_i(E,this.logger))&&this.parseKlvPES(c,i),E={data:[],size:0}),E&&(E.data.push(e.subarray(A,t+ui)),E.size+=t+ui-A);break;case 0:s&&(A+=e[A]+1),v=this._pmtId=fi(e,A);break;case v:{s&&(A+=e[A]+1);const i=pi(e,A,this.typeSupported,r,this.observer,this.logger,this.config,n);h=i.videoPid,h>0&&(a.pid=h,a.segmentCodec=i.segmentVideoCodec),p=i.audioPid,p>0&&(l.pid=p,l.segmentCodec=i.segmentAudioCodec),g=i.id3Pid,g>0&&(c.pid=g),m=i.klvPid,m>0&&(this._klvPid=m),null===y||S||(this.logger.warn(`MPEG-TS PMT found at ${t} after unknown PID '${y}'. Backtracking to sync byte @${I} to parse all TS packets.`),y=null,t=I-188),S=this.pmtParsed=!0;break}case 17:case 8191:break;default:y=b}}else A++;A>0&&gi(this.observer,new Error(`Found ${A} TS packet/s that do not start with 0x47`),n,void 0,this.logger),a.pesData=f,l.pesData=_,c.pesData=T;const R={audioTrack:l,videoTrack:a,id3Track:c,textTrack:u};return s&&this.extractRemainingSamples(R,n),R}flush(e,t){const{remainderData:n}=this;let r;return this.remainderData=null,r=n?this.demux(n,0,t,!1,!0):{videoTrack:this._videoTrack,audioTrack:this._audioTrack,id3Track:this._id3Track,textTrack:this._txtTrack},this.extractRemainingSamples(r,t),this.sampleAes?this.decrypt(r,this.sampleAes):r}extractRemainingSamples(e,t){const{audioTrack:n,videoTrack:r,id3Track:s,textTrack:i}=e,a=r.pesData,o=n.pesData,l=s.pesData,c=this.videoIntegrityChecker;let u;if(!a||null!=c&&c.isCorrupted||!(u=_i(a,this.logger))?r.pesData=a:(this.readyVideoParser(r.segmentCodec),null!==this.videoParser&&(this.videoParser.parsePES(r,i,u,!0,t),r.pesData=null)),o&&(u=_i(o,this.logger))){switch(n.segmentCodec){case"aac":this.parseAACPES(n,u,t);break;case"mp3":this.parseMPEGPES(n,u);break;case"ac3":this.parseAC3PES(n,u)}n.pesData=null}else null!=o&&o.size&&this.logger.log("last AAC PES packet truncated,might overlap between fragments"),n.pesData=o;l&&(u=_i(l,this.logger))?(this.parseID3PES(s,u),s.pesData=null):s.pesData=l}demuxSampleAes(e,t,n,r){const s=this.demux(e,n,r,!0,!this.config.progressive),i=this.sampleAes=new ei(this.observer,this.config,t);return this.decrypt(s,i)}readyVideoParser(e){null===this.videoParser&&("avc"===e?this.videoParser=new li:"hevc"===e&&(this.videoParser=new ci))}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,this.videoIntegrityChecker=null}parseAACPES(e,t,n){let r=0;const s=this.aacOverFlow;let i,a,o,l=t.data;if(s){this.aacOverFlow=null;const t=s.missing,n=s.sample.unit.byteLength;if(-1===t)l=Qe(s.sample.unit,l);else{const i=n-t;s.sample.unit.set(l.subarray(0,t),i),e.samples.push(s.sample),r=s.missing}}for(i=r,a=l.length;i<a-1&&!xs(l,i);i++);if(i!==r){let e;const t=i<a-1;if(e=t?`AAC PES did not start with ADTS header,offset:${i}`:"No ADTS header found in AAC PES",gi(this.observer,new Error(e),n,t,this.logger),!t)return}if(Bs(e,this.observer,l,i,this.audioCodec),void 0!==t.pts)o=t.pts;else{if(!s)return void this.logger.warn("[tsdemuxer]: AAC PES unknown PTS");{const t=Fs(e.samplerate);o=s.sample.pts+t}}let c,u=0;for(;i<a;){if(c=$s(e,l,i,o,u),i+=c.length,c.missing){this.aacOverFlow=c;break}for(u++;i<a-1&&!xs(l,i);i++);}}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(Qs(n,i)){const t=zs(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=ri(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=w({},t,{type:this._videoTrack?Gs.emsg:Gs.audioId3,duration:Number.POSITIVE_INFINITY});e.samples.push(n)}parseKlvPES(e,t){var n;const r=null!=(n=t.pts)?n:t.dts;if(void 0===r)return void this.logger.warn("[tsdemuxer]: KLV PES unknown PTS and DTS");const s=t.data;if(s.length<16)return void this.logger.warn("[tsdemuxer]: KLV PES payload too short");let i=0;for(;i<s.length;){var a;if(i+16>s.length)break;const n=i;if(i+=16,i>=s.length)break;const o=s[i];i+=1;let l=0;if(128&o){const e=127&o;if(0===e||e>4||i+e>s.length){this.logger.warn("[tsdemuxer]: Invalid KLV length encoding");break}for(let t=0;t<e;t++)l=l<<8|s[i+t];i+=e}else l=o;if(i+l>s.length){this.logger.warn("[tsdemuxer]: KLV value extends beyond PES payload");break}const c=i+l,u=s.subarray(n,c),d={data:u,len:u.byteLength,pts:r,dts:null!=(a=t.dts)?a:r,type:Gs.misbklv,duration:Number.POSITIVE_INFINITY};e.samples.push(d),i=c}}}function hi(e,t){return((31&e[t+1])<<8)+e[t+2]}function fi(e,t){return(31&e[t+10])<<8|e[t+11]}function pi(e,t,n,r,s,i,a,o){const l={audioPid:-1,videoPid:-1,id3Pid:-1,klvPid:-1,segmentVideoCodec:"avc",segmentAudioCodec:"aac"},c=t+3+((15&e[t+1])<<8|e[t+2])-4;for(t+=12+((15&e[t+10])<<8|e[t+11]);t<c;){const c=hi(e,t),u=(15&e[t+3])<<8|e[t+4];switch(e[t]){case 207:if(!r){mi("ADTS AAC",i);break}case 15:-1===l.audioPid&&(l.audioPid=c);break;case 21:-1===l.id3Pid&&(l.id3Pid=c);break;case 219:if(!r){mi("H.264",i);break}case 27:-1===l.videoPid&&(l.videoPid=c);break;case 3:case 4:n.mpeg||n.mp3?-1===l.audioPid&&(l.audioPid=c,l.segmentAudioCodec="mp3"):i.log("MPEG audio found, not supported in this browser");break;case 193:if(!r){mi("AC-3",i);break}case 129:n.ac3?-1===l.audioPid&&(l.audioPid=c,l.segmentAudioCodec="ac3"):i.log("AC-3 audio found, not supported in this browser");break;case 6:if(u>0){let r=t+5,s=u;for(;s>2;){switch(e[r]){case 106:-1===l.audioPid&&(!0!==n.ac3?i.log("AC-3 audio found, not supported in this browser for now"):(l.audioPid=c,l.segmentAudioCodec="ac3"));break;case 5:-1===l.klvPid&&a.enableEmsgKLVMetadata&&(l.klvPid=c,i.log(`KLV metadata PID found: ${c}`))}const t=e[r+1]+2;r+=t,s-=t}}break;case 194:case 135:return gi(s,new Error("Unsupported EC-3 in M2TS found"),o,void 0,i),l;case 36:-1===l.videoPid&&(l.videoPid=c,l.segmentVideoCodec="hevc",i.log("HEVC in M2TS found"))}t+=u+5}return l}function gi(e,t,n,r,s){s.warn(`parsing error: ${t.message}`),e.emit(l.ERROR,l.ERROR,{type:a.MEDIA_ERROR,details:o.FRAG_PARSING_ERROR,fatal:!1,levelRetry:r,chunkMeta:n,error:t,reason:t.message})}function mi(e,t){t.log(`${e} with AES-128-CBC encryption found in unencrypted stream`)}function _i(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]=Qe(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 Ti{constructor(e){this.logger=void 0,this.pid=0,this.lastContinuityCounter=-1,this.integrityState="ok",this.logger=e}get isCorrupted(){return"ok"!==this.integrityState}reset(e){this.pid=e,this.lastContinuityCounter=-1,this.integrityState="ok"}handlePacket(e){if(e.byteLength<4)return;const t=hi(e,0);if(t!==this.pid)return void this.logger.debug(`Packet PID mismatch, expected ${this.pid} got ${t}`);const n=(48&e[3])>>4;if(0===n)return;const r=15&e[3],s=this.lastContinuityCounter;this.lastContinuityCounter=r;const i=!!(1&n);if(!!(2&n)&&0!=e[4]&&!!(128&e[5]))return;if(s<0)return;const a=i?s+1&15:s;return r!==a?(this.logger.warn(`MPEG-TS Continuity Counter check failed for PID='${t}', CC=${r}, Expected-CC=${a} Last-CC=${s}`),void(this.integrityState="cc-failed")):128&e[1]?(this.logger.warn(`MPEG-TS Packet had TEI flag set for PID='${t}'`),void(this.integrityState="tei-bit")):void 0}}class Ei{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])}}}var yi;const Si={video: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]),audio: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])},vi=new Uint8Array([0,0,0,0,0,0,0,0]),bi=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),Ii=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),Ai=new Uint8Array([0,0,0,0,0,0,0,0]),Ri=new Uint8Array([0,0,0,0,0,0,0,1]),ki=new Uint8Array([105,115,111,109]),Ci=new Uint8Array([97,118,99,49]),Li=new Uint8Array([0,0,0,1]);class Oi{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(Me(i,0,n),Me(i,4,e),r=0,n=8;r<s;r++)i.set(t[r],n),n+=t[r].byteLength;return i}static hdlr(e){return Oi.box(ke.hdlr,Si[e])}static mdat(e){return Oi.box(ke.mdat,e)}static mdhd(e,t){t*=e;const n=Math.floor(t/(Re+1)),r=Math.floor(t%(Re+1));return Oi.box(ke.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 Oi.box(ke.mdia,Oi.mdhd(e.timescale||0,e.duration||0),Oi.hdlr(e.type),Oi.minf(e))}static mfhd(e){return Oi.box(ke.mfhd,new Uint8Array([0,0,0,0,e>>24,e>>16&255,e>>8&255,255&e]))}static minf(e){return"audio"===e.type?Oi.box(ke.minf,Oi.box(ke.smhd,Ai),Oi.DINF,Oi.stbl(e)):Oi.box(ke.minf,Oi.box(ke.vmhd,Ii),Oi.DINF,Oi.stbl(e))}static moof(e,t,n){return Oi.box(ke.moof,Oi.mfhd(e),Oi.traf(n,t))}static moov(e){let t=e.length;const n=[];for(;t--;)n[t]=Oi.trak(e[t]);return Oi.box.apply(null,[ke.moov,Oi.mvhd(e[0].timescale||0,e[0].duration||0)].concat(n).concat(Oi.mvex(e)))}static mvex(e){let t=e.length;const n=[];for(;t--;)n[t]=Oi.trex(e[t]);return Oi.box.apply(null,[ke.mvex,...n])}static mvhd(e,t){t*=e;const n=Math.floor(t/(Re+1)),r=Math.floor(t%(Re+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 Oi.box(ke.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 Oi.box(ke.sdtp,n)}static stbl(e){return Oi.box(ke.stbl,Oi.stsd(e),Oi.box(ke.stts,vi),Oi.box(ke.stsc,vi),Oi.box(ke.stsz,bi),Oi.box(ke.stco,vi))}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=Oi.box(ke.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 Oi.box(ke.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,Oi.box(ke.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),Oi.box(ke.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,n=t.length;return new Uint8Array([0,0,0,0,3,23+n,0,1,0,4,15+n,64,21,0,0,0,0,0,0,0,0,0,0,0,5,n,...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 Oi.box(ke.mp4a,Oi.audioStsd(e),Oi.box(ke.esds,Oi.esds(e)))}static mp3(e){return Oi.box(ke[".mp3"],Oi.audioStsd(e))}static ac3(e){return Oi.box(ke["ac-3"],Oi.audioStsd(e),Oi.box(ke.dac3,e.config))}static stsd(e){const{segmentCodec:t}=e;if("audio"===e.type){if("aac"===t)return Oi.box(ke.stsd,Ri,Oi.mp4a(e));if("ac3"===t&&e.config)return Oi.box(ke.stsd,Ri,Oi.ac3(e));if("mp3"===t&&"mp3"===e.codec)return Oi.box(ke.stsd,Ri,Oi.mp3(e))}else{if(!e.pps||!e.sps)throw new Error("video track missing pps or sps");if("avc"===t)return Oi.box(ke.stsd,Ri,Oi.avc1(e));if("hevc"===t&&e.vps)return Oi.box(ke.stsd,Ri,Oi.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/(Re+1)),a=Math.floor(n%(Re+1));return Oi.box(ke.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=Oi.sdtp(e),r=e.id,s=Math.floor(t/(Re+1)),i=Math.floor(t%(Re+1));return Oi.box(ke.traf,Oi.box(ke.tfhd,new Uint8Array([0,0,0,0,r>>24,r>>16&255,r>>8&255,255&r])),Oi.box(ke.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])),Oi.trun(e,n.length+16+20+8+16+8+8),n)}static trak(e){return e.duration=e.duration||4294967295,Oi.box(ke.trak,Oi.tkhd(e),Oi.mdia(e))}static trex(e){const t=e.id;return Oi.box(ke.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 Oi.box(ke.trun,i)}static initSegment(e){const t=Oi.moov(e);return Qe(Oi.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=Oi.box(ke.hvcC,i),l=e.width,c=e.height,u=e.pixelRatio[0],d=e.pixelRatio[1];return Oi.box(ke.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,Oi.box(ke.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),Oi.box(ke.pasp,new Uint8Array([u>>24,u>>16&255,u>>8&255,255&u,d>>24,d>>16&255,d>>8&255,255&d])))}}yi=Oi,Oi.FTYP=yi.box(ke.ftyp,ki,Li,ki,Ci),Oi.DINF=yi.box(ke.dinf,yi.box(ke.dref,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1])));function Ni(e,t,n=1,r=!1){const s=e*t*n;return r?Math.round(s):s}function wi(e,t=!1){return Ni(e,1e3,1/9e4,t)}function Pi(e){const{baseTime:t,timescale:n,trackId:r}=e;return`${t/n} (${t}/${n}) trackId: ${r}`}const Mi=8589934592;function Di(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,paddingValue:0}}}class xi extends q{constructor(e,t,n,r){super("mp4-remuxer",r),this.observer=void 0,this.config=void 0,this.typeSupp
vendor: 6,138 bytes, line 1
1orted=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}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?Pi(t):t} > ${e?Pi(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=Ui(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,l){let c,u,d,h,f,p,g=s,m=s;const _=!l.iframe&&e.pid>-1,T=t.pid>-1,E=t.samples.length,S=e.samples.length>0,v=a&&E>0||E>1;if((!_||S)&&(!T||v)||this.ISGenerated||a){if(this.ISGenerated){var b,I,A,R;const e=this.videoTrackConfig;(e&&(t.width!==e.width||t.height!==e.height||(null==(b=t.pixelRatio)?void 0:b[0])!==(null==(I=e.pixelRatio)?void 0:I[0])||(null==(A=t.pixelRatio)?void 0:A[1])!==(null==(R=e.pixelRatio)?void 0:R[1]))||!e&&v||null===this.nextAudioTs&&S)&&this.resetInitSegment()}this.ISGenerated||(d=this.generateIS(e,t,s,i));const n=this.isVideoContiguous;let r,a=-1;if(v&&(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(p=!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`),p=!1);if(this.ISGenerated){if(S&&v&&s){const n=this.getVideoStartPts(t.samples),r=(Ui(e.samples[0].pts,n)-n)/t.inputTimeScale;g+=Math.max(0,r),m+=Math.max(0,-r)}if(S){if(e.samplerate||(this.warn("regenerate InitSegment as audio detected"),d=this.generateIS(e,t,s,i)),u=this.remuxAudio(e,g,this.isAudioContiguous,i,T||v||o===y.AUDIO?m:void 0,l),v){const r=u?u.endPTS-u.startPTS:0;t.inputTimeScale||(this.warn("regenerate InitSegment as video detected"),d=this.generateIS(e,t,s,i)),c=this.remuxVideo(t,m,n,r,l)}}else v&&(c=this.remuxVideo(t,m,n,0,l));c&&(c.firstKeyFrame=a,c.independent=-1!==a,c.firstKeyFramePTS=r)}}return this.ISGenerated&&this._initPTS&&this._initDTS&&(n.samples.length&&(f=Bi(n,s,this._initPTS,this._initDTS)),r.samples.length&&(h=Fi(r,s,this._initPTS))),{audio:u,video:c,initSegment:d,independent:p,text:h,id3:f}}computeInitPts(e,t,n,r){const s=Math.round(n*t);let i=Ui(e,s);if(i<s)for(this.log(`Adjusting PTS for rollover in timeline near ${(s-i)/t} ${r}`);i<s;)i+=Mi;return i-s}generateIS(e,t,n,s){const i=e.samples,a=t.samples,o=this.typeSupported,l={},c=this._initPTS,u=!c||s;let d,h,f,p="audio/mp4",g=-1;if(u&&(d=h=1/0),e.config&&i.length){switch(e.timescale=e.samplerate,e.segmentCodec){case"mp3":o.mpeg?(p="audio/mpeg",e.codec=""):o.mp3&&(e.codec="mp3");break;case"ac3":e.codec="ac-3"}if(l.audio={id:"audio",container:p,codec:e.codec,initSegment:"mp3"===e.segmentCodec&&o.mpeg?new Uint8Array(0):Oi.initSegment([e]),metadata:{channelCount:e.channelCount}},u){g=e.id,f=e.inputTimeScale;const t=this.computeInitPts(i[0].pts,f,n,"audio");(!c||f!==c.timescale||0===n&&t<c.baseTime)&&(d=h=t)}}if(t.sps&&t.pps&&a.length){if(t.timescale=t.inputTimeScale,l.video={id:"main",container:"video/mp4",codec:t.codec,initSegment:Oi.initSegment([t]),metadata:{width:t.width,height:t.height}},u){g=t.id,f=t.inputTimeScale;const e=this.getVideoStartPts(a),s=Ui(a[0].dts,e),i=this.computeInitPts(s,f,n,"video"),o=this.computeInitPts(e,f,n,"video");(!c||f!==c.timescale||r(d)||0===n&&o<c.baseTime)&&(h=Math.min(h,i),d=Math.min(d,i))}this.videoTrackConfig={width:t.width,height:t.height,pixelRatio:t.pixelRatio}}if(Object.keys(l).length)return this.ISGenerated=!0,u&&r(d)?(c&&this.warn(`Timestamps at playlist time: ${s?"":"~"}${n} ${d/f} != initPTS: ${c.baseTime/c.timescale} (${c.baseTime}/${c.timescale}) trackId: ${c.trackId}`),this.log(`Found initPTS at playlist time: ${n} offset: ${d/f} (${d}/${f}) trackId: ${g}`),this._initPTS={baseTime:d,timescale:f,trackId:g},this._initDTS={baseTime:h,timescale:f,trackId:g}):d=f=void 0,{tracks:l,initPTS:d,timescale:f,trackId:g}}remuxVideo(e,t,n,r,s){const i=e.inputTimeScale,c=e.samples,u=[],d=c.length,h=this._initPTS,f=h.baseTime*i/h.timescale;let p,g,m=this.nextVideoTs,_=8,T=this.videoSampleDuration,E=Number.POSITIVE_INFINITY,y=Number.NEGATIVE_INFINITY,S=!1;if(!n||null===m){const e=f+t*i,r=c[0].pts-Ui(c[0].dts,c[0].pts);ht()&&null!==m&&Math.abs(e-r-(m+f))<15e3?n=!0:m=e-r-f}const v=m+f;for(let e=0;e<d;e++){const t=c[e];t.pts=Ui(t.pts,v),t.dts=Ui(t.dts,v),t.dts<c[e>0?e-1:e].dts&&(S=!0)}S&&c.sort((function(e,t){const n=e.dts-t.dts,r=e.pts-t.pts;return n||r})),p=c[0].dts,g=c[c.length-1].dts;const b=g-p,I=b?Math.round(b/(d-1)):T||e.inputTimeScale/30;if(n){const n=p-v,r=n>I,s=n<-1;if((r||s)&&(r?this.warn(`${(e.segmentCodec||"").toUpperCase()}: ${wi(n,!0)} ms (${n}dts) hole between fragments detected at ${t.toFixed(3)}`):this.warn(`${(e.segmentCodec||"").toUpperCase()}: ${wi(-n,!0)} ms (${n}dts) overlapping between fragments detected at ${t.toFixed(3)}`),!s||v>=c[0].pts||ht())){p=v;const e=c[0].pts-n;if(r)c[0].dts=p,c[0].pts=e;else{let t=!0;for(let r=0;r<c.length&&!(c[r].dts>e&&t);r++){const e=c[r].pts;if(c[r].dts-=n,c[r].pts-=n,r<c.length-1){const n=c[r+1].pts;t=n<=c[r].pts==n<=e}}}this.log(`Video: Initial PTS/DTS adjusted: ${wi(e,!0)}/${wi(p,!0)}, delta: ${wi(n,!0)} ms`)}}p=Math.max(0,p);let A=0,R=0,k=p;for(let e=0;e<d;e++){const t=c[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<k?(t.dts=k,k+=I/4|0||1):k=t.dts,E=Math.min(t.pts,E),y=Math.max(t.pts,y)}g=c[d-1].dts;const C=R+4*A+8;let L;try{L=new Uint8Array(C)}
vendor: 8,048 bytes, line 1
1catch(e){return void this.observer.emit(l.ERROR,l.ERROR,{type:a.MUX_ERROR,details:o.REMUX_ALLOC_ERROR,fatal:!1,chunkMeta:s,error:e,bytes:C,reason:`fail allocating video mdat ${C}`})}Me(L,0,C),Me(L,4,ke.mdat);let O=!1,N=Number.POSITIVE_INFINITY,P=Number.POSITIVE_INFINITY,M=Number.NEGATIVE_INFINITY,D=Number.NEGATIVE_INFINITY;for(let e=0;e<d;e++){const t=c[e],a=t.units;let o,l=0;for(let e=0,t=a.length;e<t;e++){const t=a[e],n=t.data,r=t.data.byteLength;Me(L,_,r),_+=4,L.set(n,_),_+=r,l+=4+r}if(e<d-1)T=c[e+1].dts-t.dts,o=c[e+1].pts-t.pts;else{const n=this.config,s=e>0?t.dts-c[e-1].dts:I;if(o=e>0?t.pts-c[e-1].pts:I,n.stretchShortVideoTrack&&null!==this.nextAudioTs){const e=Math.floor(n.maxBufferHole*i),a=(r?E+r*i:this.nextAudioTs+f)-t.pts;a>e?(T=a-s,T<0?T=s:O=!0,this.log(`It is approximately ${a/90} ms to the next segment; using duration ${T/90} ms for the last video frame.`)):T=s}else T=s}let h=Math.round(t.pts-t.dts);if(N=Math.min(N,T),M=Math.max(M,T),P=Math.min(P,o),D=Math.max(D,o),!n&&0===e&&h>T){const e=Math.round(h/I)*I;e-h==1&&(this.log(`pad first CTS ${h} -> ${e} of sn: ${s.sn}`),h=e)}u.push(Di(t.key,T,l,h))}if(u.length){const e=ht();if(e){if(e<70){const e=u[0].flags;e.dependsOn=2,e.isNonSync=0}}else if(function(){if(void 0===ut){const e=at.match(/Safari\/(\d+)/i);ut=e?parseInt(e[1]):0}return ut}()&&D-P<M-N&&I/M<.025&&0===u[0].cts){this.warn("Found irregular gaps in sample duration. Using PTS instead of DTS to determine MP4 sample duration.");let e=p;for(let t=0,n=u.length;t<n;t++){const r=e+u[t].duration,s=e+u[t].cts;if(t<n-1){const e=r+u[t+1].cts;u[t].duration=e-s}else u[t].duration=t?u[t-1].duration:I;u[t].cts=0,e=r}}}T=O||!T?I:T;const x=g+T;this.nextVideoTs=m=x-f,this.videoSampleDuration=T,this.isVideoContiguous=!0,s.iframe&&(1===u.length?(u[0].duration=T=s.duration*i,this.nextVideoTs=m=p+T-f):this.warn(`Not adjusting IFrame duration (sample count ${u.length})`));const U={data1:Oi.moof(s.sn,p,w(e,{samples:u})),data2:L,startPTS:(E-f)/i,endPTS:(y+T-f)/i,startDTS:(p-f)/i,endDTS:m/i,type:"video",hasAudio:!1,hasVideo:!0,nb:u.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,i){const c=e.inputTimeScale,u=c/(e.samplerate?e.samplerate:c),d=this.getSamplesPerFrame(e),h=d*u,f=this._initPTS,p="mp3"===e.segmentCodec&&this.typeSupported.mpeg,g=[],m=void 0!==s;let _=e.samples,T=p?0:8,E=this.nextAudioTs||-1;const y=f.baseTime*c/f.timescale,S=y+t*c;if(this.isAudioContiguous=n=n||_.length&&E>0&&(r&&Math.abs(S-(E+y))<9e3||Math.abs(Ui(_[0].pts,S)-(E+y))<20*h),_.forEach((function(e){e.pts=Ui(e.pts,S)})),!n||E<0){const e=_.length;if(_=_.filter((e=>e.pts>=0)),e!==_.length&&this.warn(`Removed ${_.length-e} of ${e} samples (initPTS ${y} / ${c})`),!_.length)return;E=0===s?0:r&&!m?Math.max(0,S-y):_[0].pts-y}if("aac"===e.segmentCodec){const t=this.config.maxAudioFramesDrift;for(let n=0,r=E+y;n<_.length;n++){const s=_[n],i=s.pts,a=i-r,o=Math.abs(1e3*a/c);if(a<=-t*h&&m)0===n&&(this.warn(`Audio frame @ ${(i/c).toFixed(3)}s overlaps marker by ${Math.round(1e3*a/c)} ms.`),this.nextAudioTs=E=i-y,r=i);else if(a>=t*h&&o<1e4&&m){let t=Math.round(a/h);for(r=i-t*h;r<0&&t&&h;)t--,r+=h;0===n&&(this.nextAudioTs=E=r-y),this.warn(`Injecting ${t} audio frames @ ${((r-y)/c).toFixed(3)}s due to ${Math.round(1e3*a/c)} ms gap.`);for(let i=0;i<t;i++){let t=Ei.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()),_.splice(n,0,{unit:t,pts:r}),r+=h,n++}}s.pts=r,r+=h}}let v,b=null,I=null,A=0,R=_.length;for(;R--;)A+=_[R].unit.byteLength;for(let t=0,r=_.length;t<r;t++){const r=_[t],s=r.unit;let c=r.pts;if(null!==I){g[t-1].duration=Math.round((c-I)/u)}else{if(n&&"aac"===e.segmentCodec&&(c=E+y),b=c,!(A>0))return;A+=T;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,chunkMeta:i,error:e,bytes:A,reason:`fail allocating audio mdat ${A}`})}p||(Me(v,0,A),Me(v,4,ke.mdat))}v&&v.set(s,T);const h=s.byteLength;T+=h,g.push(Di(!0,d,h,0)),I=c}const k=g.length;if(!k)return;const C=g[g.length-1];E=I-y,this.nextAudioTs=E+u*C.duration;const L=p?new Uint8Array(0):Oi.moof(e.sequenceNumber++,b/u,w({},e,{samples:g}));e.samples=[];const O=(b-y)/c,N=this.nextAudioTs/c,P={data1:L,data2:v,startPTS:O,endPTS:N,startDTS:O,endDTS:N,type:"audio",hasAudio:!0,hasVideo:!1,nb:k};return this.isAudioContiguous=!0,P}}function Ui(e,t){let n;if(null===t)return e;for(n=t<e?-8589934592:Mi;Math.abs(e-t)>4294967296;)e+=n;return e}function Bi(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=Ui(s.pts-n.baseTime*i/n.timescale,t*i)/i,s.dts=Ui(s.dts-r.baseTime*i/r.timescale,t*i)/i}const a=e.samples;return e.samples=[],{samples:a}}function Fi(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=Ui(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 $i(e,t,n=!1){return void 0!==(null==e?void 0:e.start)?(e.start+(n?e.duration:0))/e.timescale:t}function Gi(e,t,n){const r=e.codec;if(r&&r.length>4)return r;if(t===S){if("ec-3"===r||"ac-3"===r||"alac"===r)return r;if("fLaC"===r||"Opus"===r){return bt(r,!1)}return n.warn(`Unhandled audio codec "${r}" in mp4 MAP`),r||"mp4a"}return"mjpg"===r?r:(n.warn(`Unhandled video codec "${r}" in mp4 MAP`),r||"avc1")}let Hi;try{Hi=self.performance.now.bind(self.performance)}catch(e){Hi=Date.now}const ji=[{demux:class{constructor(e,t,n,r=Z){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.initData=void 0,this.logger=void 0,this.config=t,this.logger=r}resetTimeStamp(){}resetInitSegment(e,t,n,r){const s=this.videoTrack=Hs("video",1),i=this.audioTrack=Hs("audio",1),a=this.txtTrack=Hs("text",1);if(this.id3Track=Hs("id3",1),this.initData=void 0,this.timeOffset=0,null==e||!e.byteLength)return;const o=this.initData=Ge(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=Ce.text,s.sampleDuration=0,s.duration=i.duration=r}resetContiguity(){this.remainderData=null}static probe(e){return function(e,t){const n=e.byteLength;for(let r=0;r<n;){const s=Oe(e,r);if(s>8&&Oe(e,r+4)===ke[t])return!0;r=s>1?r+s:n}return!1}(e,"moof")}demux(e,t,n){this.timeOffset=t;let r=e;const s=this.videoTrack,i=this.txtTrack;if(this.config.progressive){this.remainderData&&(r=Qe(this.remainderData,e));const t=function(e){const t={valid:null,remainder:null},n=Be(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}(r);this.remainderData=t.remainder,s.samples=t.valid||new Uint8Array}else s.samples=r;const a=this.extractID3Track(s,t),o=this.parseFragment(s,i,t,n);return{videoTrack:s,audioTrack:this.audioTrack,id3Track:a,textTrack:this.txtTrack,initData:this.initData,sampleData:o}}flush(e,t){const n=this.timeOffset,r=this.videoTrack,s=this.txtTrack;r.samples=this.remainderData||new Uint8Array,this.remainderData=null;const i=this.extractID3Track(r,this.timeOffset),a=this.parseFragment(r,s,n,t);return{videoTrack:r,audioTrack:Hs(),id3Track:i,textTrack:Hs(),initData:this.initData,sampleData:a}}parseFragment(e,t,n,r){const s=this.initData;if(s&&r){const{samples:i,sampleData:a}=function(e,t,n,r,s=!1){const i=[];return{samples:i,sampleData:{includeSampleDetails:s,tracks:Xe(t.samples,n,r,s,{isHEVCFlavor:Ze(t.codec),samples:i,timeOffset:e,timescale:t.timescale,trackId:t.id})}}}(n,e,s,this.logger,r.iframe);return t.samples=i,a}t.samples=function(e,t){const n=[],r=t.samples,s=t.timescale,i=t.
vendor: 1,627 bytes, line 1
1id;let a=!1;return Be(r,["moof"]).map((o=>{const l=o.byteOffset-8;Be(o,["traf"]).map((o=>{const c=Be(o,["tfdt"]).map((e=>{const t=e[0];let n=Oe(e,4);return 1===t&&(n*=Math.pow(2,32),n+=Oe(e,8)),n/s}))[0];return void 0!==c&&(e=c),Be(o,["tfhd"]).map((c=>{const u=Oe(c,4),d=16777215&Oe(c,0),h=!!(1&d);let f=0;const p=!!(2&d),g=!!(8&d);let m=0;const _=!!(16&d);let T=0;const E=!!(32&d),y=!h&&!!(131072&d);let S=8;u===i&&(h?(f=Oe(c,S),S+=4,f*=Math.pow(2,32),f+=Oe(c,S),S+=4):y&&(f=l),p&&(S+=4),g&&(m=Oe(c,S),S+=4),_&&(T=Oe(c,S),S+=4),E&&(S+=4),"video"===t.type&&(a=Ze(t.codec)),Be(o,["trun"]).map((i=>{const o=i[0],l=16777215&Oe(i,0),c=!!(1&l);let u=0;const d=!!(4&l),h=!!(256&l);let p=0;const g=!!(512&l);let _=0;const E=!!(1024&l),y=!!(2048&l);let S=0;const b=Oe(i,4);let I=8;c&&(u=Oe(i,I),I+=4),d&&(I+=4);let A=f+u;for(let l=0;l<b;l++){if(h?(p=Oe(i,I),I+=4):p=m,g?(_=Oe(i,I),I+=4):_=T,E&&(I+=4),y&&(S=0===o?Oe(i,I):Pe(i,I),I+=4),t.type===v){let t=0;for(;t<_;){const i=Oe(r,A);A+=4,et(a,r[A])&&tt(r.subarray(A,A+i),a?2:1,e+S/s,n),A+=i,t+=i+4}}e+=p/s}})))}))}))})),n}(n,e)}extractID3Track(e,t){const n=this.id3Track;if(e.samples.length){const r=Be(e.samples,["emsg"]);r&&r.forEach((e=>{const r=function(e){const t=e[0];let n,r="",i="",a=0,o=0,l=0,c=0,u=4;if(0===t){const t=we(e,u),n=null!==t?we(e,u+t.length):null;null!==t&&null!==n?(r=t,i=n,u+=t.length+n.length,a=Oe(e,u),u+=4,o=Oe(e,u),u+=4,l=Oe(e,u),u+=4,c=Oe(e,u),u+=4):(Z.warn(`Unterminated ${null===t?"scheme_id_uri":"value"} in parsing emsg box: version 0 box ends inside a string, dropping all of its fields`),u=e.length)}else if(1===t){a=Oe(e,u),u+=4;const t=Oe(e,u);u+=4;
vendor: 15,999 bytes, line 1
1const o=Oe(e,u);u+=4,n=2**32*t+o,s(n)||(n=Number.MAX_SAFE_INTEGER,Z.warn("Presentation time exceeds safe integer limit and wrapped to max safe integer in parsing emsg box")),l=Oe(e,u),u+=4,c=Oe(e,u),u+=4;const d=we(e,u),h=null!==d?we(e,u+d.length):null;null!==d&&(r=d,u+=d.length),null!==h?(i=h,u+=h.length):(Z.warn(`Unterminated ${null===d?"scheme_id_uri":"value"} in parsing emsg box: version 1 box ends inside a string, dropping its ${null===d?"strings and payload":"value and payload"}`),u=e.length)}return{schemeIdUri:r,value:i,timeScale:a,presentationTime:n,presentationTimeDelta:o,eventDuration:l,id:c,payload:e.subarray(u,e.byteLength)}}(e);if(si.test(r.schemeIdUri)){const e=ii(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:Gs.emsg,duration:s})}else if(this.config.enableEmsgKLVMetadata){const e=this.config.emsgKLVSchemaUri||Gs.misbklv;if(r.schemeIdUri.startsWith(e)){const e=ii(r,t);n.samples.push({data:r.payload,len:r.payload.byteLength,dts:e,pts:e,type:Gs.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,this.initData=void 0}},remux:class extends q{constructor(e,t,n,r){super("passthrough-remuxer",r),this.observer=void 0,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,this.videoOnlyRemux=!1,this.decryptdata=null,this.pendingInitSegment=void 0,this.observer=e}destroy(){this.observer&&this.observer.removeAllListeners(),this.observer=null}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.decryptdata=r,this.pendingInitSegment=e,this.videoOnlyRemux=!1,this.initTracks=void 0,this.initData=void 0,this.emitInitSegment=!0}generateInitSegment(e,t,n){this.videoOnlyRemux=!1;let{audioCodec:r,videoCodec:s}=this;if(null==e||!e.byteLength)return this.initTracks=void 0,void(this.initData=void 0);const{audio:i,video:a}=this.initData=n||Ge(e);if(t)!function(e,t){if(!e||!t)return;const n=t.keyId;16===(null==n?void 0:n.byteLength)&&t.isCommonEncryption&&qe(e,((e,t)=>{const r=e.subarray(8,24);r.some((e=>0!==e))||(Z.log(`[eme] Patching keyId in 'enc${t?"a":"v"}>sinf>>tenc' box: ${ve(r)} -> ${ve(n)}`),e.set(n,8))}))}(e,t);else{const e=i||a;null!=e&&e.encrypted&&this.warn(`Init segment with encrypted track with has no key ("${e.codec}")!`)}i&&(r=Gi(i,S,this)),a&&(s=Gi(a,v,this));const o={};i&&a?o.audiovideo={container:"video/mp4",codec:r+","+s,supplemental:a.supplemental,encrypted:a.encrypted,initSegment:e,id:"main"}:i?o.audio={container:"audio/mp4",codec:r,encrypted:i.encrypted,initSegment:e,id:"audio"}:a?o.video={container:"video/mp4",codec:s,supplemental:a.supplemental,encrypted:a.encrypted,initSegment:e,id:"main"}:this.warn("initSegment does not contain moov or trak boxes."),this.initTracks=o}remux(e,t,n,s,i,a,o,l,c,u,d){var h,f;let{initPTS:p,lastEndTime:g}=this;const m={audio:void 0,video:void 0,text:void 0,id3:n,initSegment:void 0};r(g)||(g=this.lastEndTime=i||0);const _=t.samples;if(!_.length)return m;const T=this.pendingInitSegment;T&&(this.pendingInitSegment=void 0,this.generateInitSegment(T,this.decryptdata,u));const E={initPTS:void 0,timescale:void 0,trackId:void 0};let y=this.initData;if(null!=(h=y)&&h.length||(this.generateInitSegment(_),y=this.initData),null==(f=y)||!f.length)return this.warn("Failed to generate initSegment."),m;if(c.iframe&&y.audio&&y.video){var S;const e=null==(S=this.initTracks)||null==(S=S.audiovideo)?void 0:S.initSegment,t=e?function(e){const t=Be(e,["moov"]);if(1!==t.length||Be(e,["moof"]).length)return null;const n=e.byteOffset,r=[],s=[];let i=!1;const a=Be(t[0],["trak"]);for(let e=0;e<a.length;e++){const t=a[e],o=Be(t,["mdia","hdlr"])[0];if("vide"===(o?Ae(o.subarray(8,12)):"")){i=!0;continue}const l=Be(t,["tkhd"])[0];if(!l)return null;const c=l[0];s.push(Oe(l,0===c?12:20)),r.push(xe(t,n))}if(!i||!r.length)return null;const o=Be(t[0],["mvex"])[0];let l=0;if(o){const e=Be(o,["trex"]);for(let t=0;t<e.length;t++){const i=e[t];-1!==s.indexOf(Oe(i,4))&&(r.push(xe(i,n)),l+=i.byteLength+8)}}const{result:c,dropped:u,droppedBefore:d}=Ue(e,r);if(Me(c,t[0].byteOffset-n-8,t[0].byteLength+8-u),o&&l){const e=o.byteOffset-n-8;Me(c,e-d(e),o.byteLength+8-l)}return c}(e):null;var v;if(t)this.log("Converted muxed init segment to video-only for I-Frame playback"),this.generateInitSegment(t,this.decryptdata),null!=(v=this.initData)&&v.length&&(y=this.initData,this.emitInitSegment=!0,this.videoOnlyRemux=!0)}this.emitInitSegment&&(E.tracks=this.initTracks,m.initSegment=E,this.emitInitSegment=!1);const b=c.iframe,I=!d||b&&!d.includeSampleDetails?function(e,t,n,r,s=!0){return Xe(e,t,r,s)}(_,y,0,this,b):d.tracks,A=y.audio?I[y.audio.id]:null,R=y.video?I[y.video.id]:null,k=!!y.audio,C=!!y.video;let L="";k&&(L+="audio"),C&&(L+="video");const O=$i(R,1/0),N=$i(A,1/0),w=$i(R,0,!0),P=$i(A,0,!0);let M=i,D=0;R&&A&&y.audio&&(N>w||O>P)&&this.warn(`audio and video track sample timestamps do not overlap. v: ${O}-${w} a: ${N}-${P}}`,R,A);const x=!!A&&(!R||!p&&N<O||!!p&&p.trackId===y.audio.id),U=x?A:R;if(!U)return this.log(`No media samples found in ${l} ${c.level} ${-1===c.part?"":`part: ${c.part} of`} sn: ${c.sn} at playlist time: ${i}`),m;let B,F=_;if(R&&R.sampleCount>=1&&y.video&&c.iframe){const{trun:e,start:t}=R,n=1===e.length,r=e.length?n?e[0].samples:e[0].samples.concat(...e.slice(1).map((e=>e.samples))):[];if(r.length){const s=e[0];let i=s;for(let t=e.length;t--;)if(e[t].samples.length){i=e[t];break}const a=i.lastSampleDurationOffset,{defaultSampleDurationOffset:o}=s,l=Math.abs(c.duration-(w-O))>.05,u=r.length<R.sampleCount;if(l||u||this.videoOnlyRemux||!n){const e=u?i.sampleOffset+i.samples.reduce(((e,t)=>e+t.size),0):void 0,n=l?c.duration:w-O,s=function(e,t,n,r){if(void 0!==n){const r=e[e.length-1];let s=t;for(let t=0;t<e.length-1;t++)s-=e[t].duration;return s<=0&&(s=r.duration),r.duration=s,{durationOffset:n,value:s}}if(void 0===r)return;const s=Math.round(t/e.length);for(let t=0;t<e.length;t++)e[t].duration=s;return{durationOffset:r,value:s}}(r,n*y.video.timescale,a,o),d=function(e,t,n,r,s){if(n<1)return null;const i=Be(e,["moof"]);if(1!==i.length)return null;const a=i[0],o=e.byteOffset,l=[],c=[],u=Be(a,["traf"]);let d=!0;for(let e=0;e<u.length;e++){const n=u[e],r=Be(n,["tfhd"])[0];if(!r)return null;Oe(r,4)===t?(l.push(n),131072&Oe(r,0)||(d=!1)):c.push(xe(n,o))}if(!l.length)return null;if(c.length&&!d)return null;if(void 0!==r){let t=n;for(let n=0;n<l.length;n++){const r=l[n];let s=0;const i=Be(r,["trun"]);for(let n=0;n<i.length;n++){const r=i[n],a=Math.min(t,Oe(r,4));if(a){Me(e,r.byteOffset-o+4,a);const t=16777215&Oe(r,0);De(e,r,8+(1&t?4:0)+(4&t?4:0)+a*((256&t?4:0)+(512&t?4:0)+(1024&t?4:0)+(2048&t?4:0)))}else Me(e,r.byteOffset-o-4,ke.free);t-=a,s+=a}const a=Be(r,["senc"])[0];a&&Me(e,a.byteOffset-o+4,s);const c=Be(r,["saiz"])[0];if(c){let t=4;1&(c[1]<<16|c[2]<<8|c[3])&&(t+=8);const n=c[t];t+=1,Me(e,c.byteOffset-o+t,s),De(e,c,t+4+(0===n?s:0))}}const s=Be(e,["mdat"]);if(1===s.length){const t=s[0].byteOffset-o-8;Me(e,t,r-t)}}let h=e,f=0,p=()=>0;if(c.length){({result:h,dropped:f,droppedBefore:p}=Ue(e,c)),Me(h,a.byteOffset-o-8,a.byteLength+8-f);for(let e=0;e<l.length;e++){const t=l[e],n=p(t.byteOffset-o),r=Be(t,["trun"]);for(let e=0;e<r.length;e++){const t=r[e];1&Oe(t,0)&&Me(h,t.byteOffset-o-n+8,Oe(t,8)-f)}if(n){const e=Be(t,["saio"]);for(let t=0;t<e.length;t++){const r=e[t],s=0===r[0]?4:8;let i=1&Oe(r,0)?12:4,a=Oe(r,i);for(i+=4;a--;i+=s){const e=i+s-4;Me(h,r.byteOffset-o-n+e,Oe(r,e)-n)}}}}}if(s){const{durationOffset:e,value:t}=s;Me(h,e-p(e),t)}return void 0!==r?h.subarray(0,r-f):h}(_,y.video.id,r.length,e,s);d?(F=d,B=function(e,t){let n=e,r=e;for(let e=0;e<t.length;e++){const{cts:s,duration:i}=t[e];r=Math.max(r,n+(s||0)+i),n+=i}return r}(t,r)):this.warn(`IFrame remux skipped (sn ${c.sn}); using native sample duration`),D=d&&s?n:w-O}else D=w-O}else this.warn(`Could not remux IFrame track fragment (no samples in range, trun count ${e.length})`),D=w-O}else D=x?P-N:w-O;if(this.videoOnlyRemux&&F===_)return this.warn(`Dropping muxed I-Frame fragment that could not be remuxed to video-only (sn: ${c.sn})`),m;const $=U.timescale,G=U.start-i*$,H=x?y.audio.id:y.video.id;if(M=U.start/$,(a||!p)&&(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}(p,M,i,D)||$!==p.timescale)){let e=!1;const t=x?"audio":"video";if(p){const n=0!==i?M/i:1+M/1;e=M>=0&&Math.abs(1-n)<.001,this.log(`${t} timestamps in track ${H} at playlist time: ${a?"":"~"}${i} maps to ${M} with initPTS: ${p.baseTime/p.timescale} (${G/$-p.baseTime/p.timescale}s diff) (${L}) drift estimate: ${n} ${e?"(ignoring drift)":"remapping timestamps (initPTS)"}`)}e||(this.log(`Found initPTS in ${t} track ${H} at playlist time: ${i} offset: ${M-i} (${G}/${$})`),p=null,E.initPTS=G,E.timescale=$,E.trackId=H)}p?(E.initPTS=p.baseTime,E.timescale=p.timescale,E.trackId=p.trackId):(E.timescale&&void 0!==E.trackId&&void 0!==E.initPTS||(this.warn("Could not set initPTS"),E.initPTS=M,E.timescale=1,E.trackId=-1),this.initPTS=p={baseTime:E.initPTS,timescale:E.timescale,trackId:E.trackId});const j=M-p.baseTime/p.timescale,W=j+D,V=C&&void 0!==(null==U?void 0:U.ptsMin)?U.ptsMin/U.timescale-p.baseTime/p.timescale:j,K=void 0!==B&&R?B/R.timescale-p.baseTime/p.timescale:C&&null!=U&&U.ptsMax?U.ptsMax/U.timescale-p.baseTime/p.timescale:W;D>0?this.lastEndTime=W:(this.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());const q={data1:F,data2:undefined,startPTS:V,startDTS:j,endPTS:K,endDTS:W,type:L,hasAudio:k,hasVideo:C,nb:1,dropped:0,encrypted:!!y.audio&&y.audio.encrypted||!!y.video&&y.video.encrypted};m.audio=k&&!C?q:void 0,m.video=C?q:void 0;const Y=this.isVideoContiguous,z=null==R?void 0:R.sampleCount;if(z){const e=R.keyFrameIndex,t=-1!==e;q.nb=z,q.dropped=0===e||Y?0:t?e:z,q.independent=t,q.firstKeyFrame=e,t&&R.keyFrameStart&&(q.firstKeyFramePTS=(R.keyFrameStart-p.baseTime)/p.timescale),Y||(m.independent=t),this.isVideoContiguous||(this.isVideoContiguous=t),q.dropped&&this.warn(`fmp4 does not start with IDR: firstIDR ${e}/${z} dropped: ${q.dropped} start: ${q.firstKeyFramePTS||"NA"}`)}return m.initSegment=E,m.id3=Bi(n,i,p,p),s.samples.length&&(m.text=Fi(s,i,p)),m}}},{demux:di,remux:xi},{demux:class extends js{constructor(e,t){super(),this.observer=void 0,this.config=void 0,this.sampleAes=null,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=he(e,0);let r=(null==n?void 0:n.length)||0;if(Zs(e,r))return!1;for(let n=e.length;r<n;r++)if(Us(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)&&Ps(e,t)&&Ds(e,t)<=e.length-t}(e,t)}appendFrame(e,t,n){Bs(e,this.observer,t,n,e.manifestCodec);const r=$s(e,t,n,this.basePTS,this.frameIndex);if(0===(null==r?void 0:r.missing))return r}demuxSampleAes(e,t,n){const r=this.demux(e,n),s=this.sampleAes=new ei(this.observer,this.config,t);return new Promise((e=>{s.decryptAacSamples(r.audioTrack.samples,0,(()=>{e(r)}))}))}},remux:xi},{demux:class extends js{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=he(e,0);let n=(null==t?void 0:t.length)||0;if(t&&11===e[n]&&119===e[n+1]&&void 0!==Se(t)&&ti(e,n)<=16)return!1;for(let t=e.length;n<t;n++)if(Zs(e,n))return Z.log("MPEG Audio sync word found !"),!0;return!1}canParse(e,t){return function(e,t){return Xs(e,t)&&4<=e.length-t}(e,t)}appendFrame(e,t,n){if(null!==this.basePTS)return zs(e,t,n,this.basePTS,this.frameIndex)}},remux:xi}];ji.splice(2,0,{demux:ni,remux:xi});class Wi{constructor(e,t,n,r,s,i){this.asyncResult=!1,this.logger=void 0,this.observer=void 0,this.typeSupported=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){if(!this.observer)return Vi(n);const s=n.transmuxing;s.executeStart=Hi();const i=new Uint8Array(e),{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&&or(v.method)){const e=this.getDecrypter(),t=lr(v.method);return this.asyncResult=!0,this.decryptionPromise=e.decrypt(i,v.key.buffer,v.iv.buffer,t,n.decryptRange).then((e=>{const t=this.push(e,null,n);return this.decryptionPromise=null,t})),this.decryptionPromise}const b=this.needsProbing(h,f);if(b){const e=n.iframe&&S&&di.probe(S,this.logger)?S:i,t=this.configureTransmuxer(e);if(t)return this.logger.warn(`[transmuxer] ${t.message}`),this.observer.emit(l.ERROR,l.ERROR,{type:a.MEDIA_ERROR,details:o.FRAG_PARSING_ERROR,fatal:!1,error:t,reason:t.message}),s.executeEnd=Hi(),Vi(n)}(h||f||m||b)&&this.resetInitSegment(S,_,T,y,t,n),(h||m||b)&&this.resetInitialTimestamp(E),d||this.resetContiguity();const I=this.transmux(i,v,g,p,n);this.asyncResult=Ki(I);const A=this.currentTransmuxState;return A.contiguous=!0,A.discontinuity=!1,A.trackSwitch=!1,s.executeEnd=Hi(),I}flush(e){const t=e.transmuxing;t.executeStart=Hi();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=Hi();const n=[Vi(e)];return this.asyncResult?Promise.resolve(n):n}const c=o.flush(a,e);return Ki(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){if(!this.remuxer)return;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} playlist ${n.level}`);const c=this.remuxer.remux(r,s,i,a,l,o,!0,this.id,n,t.initData,t.sampleData);e.push({remuxResult:c,chunkMeta:n}),n.transmuxing.executeEnd=Hi()}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,i){const{demuxer:a,remuxer:o}=this;a&&o&&(a.resetInitSegment(e,t,n,r,s,i),o.resetInitSegment(e,t,n,s))}destroy(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0),this.observer&&this.observer.removeAllListeners(),this.decryptionPromise=null,this.decrypter=this.observer=void 0,this.logger=this.config=this.probe=void 0}
vendor: 4,316 bytes, line 1
1transmux(e,t,n,r,s){let i;return i="SAMPLE-AES"===(null==t?void 0:t.method)?this.transmuxSampleAes(e,t,n,r,s):this.transmuxUnencrypted(e,n,r,s),i}transmuxUnencrypted(e,t,n,r){const{demuxer:s,remuxer:i}=this;if(!s||!i)return Vi(r);const a=s.demux(e,t,r,!1,!this.config.progressive),{audioTrack:o,videoTrack:l,id3Track:c,textTrack:u}=a;return{remuxResult:i.remux(o,l,c,u,t,n,!1,this.id,r,a.initData,a.sampleData),chunkMeta:r}}transmuxSampleAes(e,t,n,r,s){return this.demuxer?this.demuxer.demuxSampleAes(e,t,n,s).then((e=>({remuxResult:this.remuxer.remux(e.audioTrack,e.videoTrack,e.id3Track,e.textTrack,n,r,!1,this.id,s,e.initData,e.sampleData),chunkMeta:s}))):Promise.reject(new Error("no demuxer"))}configureTransmuxer(e){const{config:t,observer:n,typeSupported:r}=this;if(!n)return;let s;try{for(let t=0,n=ji.length;t<n;t++){var i;if(null!=(i=ji[t].demux)&&i.probe(e,this.logger)){s=ji[t];break}}}catch(e){return e}if(!s)return new Error("Failed to find demuxer by probing fragment data");const a=this.demuxer,o=this.remuxer,l=s.demux,c=s.remux;a&&a instanceof l||(this.logger.log(`Using ${l.name}`),this.demuxer=new l(n,t,r,this.logger),this.probe=l.probe),o&&o instanceof c||(this.logger.log(`Using ${c.name}`),this.remuxer=new c(n,t,r,this.logger))}needsProbing(e,t){return!this.demuxer||!this.remuxer||e||t}getDecrypter(){let e=this.decrypter;return e||(e=this.decrypter=new Un(this.config)),e}}const Vi=e=>({remuxResult:{},chunkMeta:e});function Ki(e){return"then"in e&&e.then instanceof Function}class qi{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 Yi{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 zi=0;class Ji{constructor(e,t,n,r){this.error=null,this.hls=void 0,this.id=void 0,this.instanceNo=zi++,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 Os,this.observer.on(l.FRAG_DECRYPTED,i),this.observer.on(l.ERROR,i);const c=kt(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=ws[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 ws[e]=r,r}(s.workerPath)):(n.log(`injecting Web Worker for "${t}"`),this.workerContext=function(){const e=ws[Ns];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"}
vendor: 4,125 bytes, line 1
1),n=self.URL.createObjectURL(t),r={worker:new self.Worker(n),objectURL:n,clientCount:1};return ws[Ns]=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:qt(s)})}catch(r){n.warn(`Error setting up "${t}" Web Worker, fallback to inline`,r),this.terminateWorker(),this.error=null,this.transmuxer=new Wi(this.observer,c,s,"",t,e.logger)}return}}this.transmuxer=new Wi(this.observer,c,s,"",t,e.logger)}reset(){if(this.frag=null,this.part=null,this.workerContext){const e=this.instanceNo;this.instanceNo=zi++;const t=this.hls.config,n=kt(t.preferManagedMediaSource);this.workerContext.worker.postMessage({instanceNo:this.instanceNo,cmd:"reset",resetNo:e,typeSupported:n,id:this.id,config:qt(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=ws[e||Ns];if(t&&1==t.clientCount--){const{worker:n,objectURL:r}=t;delete ws[e||Ns],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:f}=this,p=i?i.start:s.start,g=s.decryptdata,m=this.frag,_=!m||s.cc!==m.cc,T=!m||l.level!==m.level,E=m?l.sn-m.sn:-1,y=this.part?l.part-this.part.index:-1,S=0===E&&l.id>1&&l.id===(null==m?void 0:m.stats.chunkCount),v=!T&&(1===E||0===E&&(1===y||S&&y<=0)),b=self.performance.now();(T||E||0===s.stats.parsing.start)&&(s.stats.parsing.start=b),!i||!y&&v||(i.stats.parsing.start=b);const I=!(m&&(null==(u=s.initSegment)?void 0:u.url)===(null==(d=m.initSegment)?void 0:d.url)),A=new Yi(_,v,o,T,p,I);if(!v||_||I){this.hls.logger.log(`[transmuxer-interface]: Starting new transmux session for ${s.type} sn: ${l.sn}${l.part>-1?" part: "+l.part:""} ${this.id} playlist: ${l.level} id: ${l.id}\n discontinuity: ${_}\n trackSwitch: ${T}\n contiguous: ${v}\n accurateTimeOffset: ${o}\n timeOffset: ${p}\n initSegmentChange: ${I}`);const e=new qi(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:g,chunkMeta:l,state:A},e instanceof ArrayBuffer?[e]:[]);else if(f){const t=f.push(e,g,l,A);Ki(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);Ki(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 Xi extends q{constructor(e,t){super(t,e.logger),this.hls=void 0,this.canLoad=!1,this.timer=-1,this.loadingSync=!1,this.hls=e}destroy(){this.clearTimer(),this.hls=null}clearTimer(){-1!==this.timer&&(self.clearTimeout(this.timer),this.timer=-1)}
vendor: 4,907 bytes, line 1
1startLoad(){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&&Ht(n);return new jt(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=r.fragments,c=self.performance.now(),u=s.loading.first?Math.max(0,Math.floor(c-s.loading.first)):0;r.advancedDateTime=Date.now()-u;const d=this.hls.config.timelineOffset;if(d!==r.appliedTimelineOffset){const e=Math.max(d||0,0);r.appliedTimelineOffset=e,i.forEach((t=>{null==t||t.setStart(t.playlistOffset+e)}))}if(r.live||null!=n&&n.live){var h;const d="levelInfo"in t?t.levelInfo:t.track;r.reloaded(n);const f=null==(h=i[i.length-1])?void 0:h.type;if(r.misses>=this.hls.config.liveMaxUnchangedPlaylistRefresh){const e=new Error(`${f} playlist ${d.id} hit max allowed unchanged reloads.`);this.warn(e);const{networkDetails:n,context:i}=t;return void this.hls.trigger(l.ERROR,{type:a.NETWORK_ERROR,details:o.PLAYLIST_UNCHANGED_ERROR,fatal:!1,url:r.url,error:e,reason:e.message,level:t.level,parent:f,context:i,networkDetails:n,stats:s})}if(n){Yr(n,r,this);const e=r.playlistParsingError;if(e){this.warn(e);const n=this.hls;if(!n.config.ignorePlaylistParsingErrors){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,parent:f,networkDetails:i,stats:s})}r.playlistParsingError=null}}-1===r.requestScheduled&&(r.requestScheduled=s.loading.start);const p=this.hls.mainForwardBufferInfo,g=p?p.end-p.len:0,m=Xr(r,1e3*(r.edge-g));r.requestScheduled+m<c?r.requestScheduled=c:r.requestScheduled<=c&&(r.requestScheduled+=m);const _=t.deliveryDirectives;if(this.log(`live playlist ${e} ${r.advanced?`REFRESHED ${r.lastPartSn} - ${r.lastPartIndex}`:r.updated?"UPDATED":`MISSED (received ${r.lastPartSn} - ${r.lastPartIndex}${_?` | requested ${_.msn} - ${_.part}`:""})`}`),!this.canLoad||!r.live)return;let T,E,y;if(r.canBlockReload&&r.advanced){const e=this.hls.config.lowLatencyMode,s=r.lastPartSn,i=r.endSN,a=r.lastPartIndex,o=s===i;-1!==a?o?(E=i+1,y=e?0:a):(E=s,y=e?a+1:r.maxPartIndex):E=i+1;const l=r.age,u=l+r.ageHeader;let h=Math.min(u-r.partTarget,1.5*r.targetduration);if(h>0){if(u>3*r.targetduration)this.log(`Playlist last advanced ${l.toFixed(2)}s ago. Omitting segment and part directives.`),E=void 0,y=void 0;else if(null!=n&&n.tuneInGoal&&u-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(E+=e,void 0!==y){y+=Math.round(h%r.targetduration/r.partTarget)}this.log(`CDN Tune-in age: ${r.ageHeader}s last advanced ${l.toFixed(2)}s goal: ${h} skip sn ${e} to part ${y}`)}r.tuneInGoal=h}if(T=this.getDeliveryDirectives(r,t.deliveryDirectives,E,y),e||!o)return r.requestScheduled=c,void this.loadingPlaylist(d,T)}else(r.canBlockReload||r.canSkipUntil)&&(T=this.getDeliveryDirectives(r,t.deliveryDirectives,E,y));T&&void 0!==E&&r.canBlockReload&&(r.requestScheduled=s.loading.first+Math.max(m-2*u,m/2)),this.scheduleLoading(d,T,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&&!this.loadingSync)return this.loadingSync=!0,this.loadingPlaylist(e,t),void(this.loadingSync=!1);const a=Math.max(i-s,0);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=Ht(e);return null!=t&&t.skip&&e.deltaUpdateFailed&&(n=t.msn,r=t.part,s=Ft),new jt(n,r,s)}checkRetry(e){const t=e.details,n=x(e),r=e.errorAction,{action:s,retryCount:i=0,retryConfig:a}=r||{},o=!!r&&!!a&&(s===pn||!r.resolved&&s===hn);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{var c;const n=j(null==(c=e.response)?void 0:c.code);
vendor: 11,006 bytes, line 1
1if(this.clearTimer(),n)this.log("Waiting for connection (offline)"),e.reason="offline",this.timer=self.setTimeout((()=>this.checkOfflineStatus()),1e3);else{const e=$(a,i);this.warn(`Retrying playlist loading ${i+1}/${a.maxNumRetry} after "${t}" in ${e}ms`),this.timer=self.setTimeout((()=>this.loadPlaylist()),e)}}e.levelRetry=!0,r.resolved=!0}return o}checkOfflineStatus(){this.clearTimer(),j(0)?this.timer=self.setTimeout((()=>this.checkOfflineStatus()),1e3):(this.log("Connection restored (online)"),this.loadPlaylist())}}function Qi(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Zi(e[n].attrs,t[n].attrs))return!1;return!0}function Zi(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]))}class ea{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].forEach((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)):"block-audio"===n&&e.splice(0,1)}))}insertNext(e,t){null!==this.queues&&this.queues[t].splice(1,0,...e)}unblockAudio(){var e;null!==this.queues&&"block-audio"===(null==(e=this.current("audio"))?void 0:e.label)&&this.shiftAndExecuteNext("audio")}audioBlocking(){return null!==this.queues&&this.queues.audio.some((e=>"block-audio"===e.label))}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 ta=/(avc[1234]|hvc1|hev1|dvh[1e]|vp09|av01)(?:\.[^.,]+)+/,na="HlsJsTrackRemovedError";class ra extends Error{constructor(e){super(e),this.name=na}}function sa(e){const t=e.querySelectorAll("source");[].slice.call(t).forEach((t=>{e.removeChild(t)}))}function ia(e){return"audio"===e?1:0}function aa(e,t){return`${e?"":" - triggering recovery"}${t?" with HTMLMediaElement Error: "+t.message:""}`}function oa(e){return`${e.type}_${e.sn}_${e.level}`}function la(e,t){const{start:n,end:r}=t;let s=0;for(let t=0;t<e.length;t++){const i=e[t];if(i.start>=r)break;const a=Math.max(n,i.start),o=Math.min(r,i.end);o>a&&(s+=o-a)}return s}function ca(e,t){return t.duration-e<=.05}class ua{constructor(e){this.hls=null,this.autoLevelCapping=void 0,this.media=void 0,this.restrictedLevels=void 0,this.timer=void 0,this.observer=void 0,this.clientRect=void 0,this.streamController=void 0,this.hls=e,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.media=null,this.restrictedLevels=[],this.clientRect=null,this.registerListeners()}setStreamController(e){this.streamController=e}destroy(){this.hls&&this.unregisterListener(),(this.timer||this.observer)&&this.stopCapping(),this.media=this.clientRect=this.hls=null,this.streamController=void 0}registerListeners(){const{hls:e}=this;e&&(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&&(e.off(l.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),e.off(l.MEDIA_ATTACHING,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){if(!this.hls)return;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){const n=t.media;this.clientRect=null,this.hls&&(n instanceof HTMLVideoElement?(this.media=n,this.hls.config.capLevelToPlayerSize&&this.observe()):this.media=null,(this.timer||this.observer)&&this.hls.levels.length>1&&this.detectPlayerSize())}onManifestParsed(e,t){this.restrictedLevels=[],t.video&&this.startCapping(),this.onLevelsUpdated()}onLevelsUpdated(){if(this.hls)if((this.timer||this.observer)&&(r(this.autoLevelCapping)||this.clientRect))this.detectPlayerSize();else if(void 0===this.observer&&void 0===this.timer){const e=this.hls.levels;e.length>1&&e.some((e=>!!e.videoCodec))&&this.startCapping()}}onBufferCodecs(e,t){t.video&&this.startCapping()}onMediaDetaching(){this.stopCapping(),this.media=null}detectPlayerSize(){if(this.media){if(this.mediaHeight<=0||this.mediaWidth<=0||!this.hls)return void(this.clientRect=null);const e=this.hls.levels;if(e.length>1){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}else 1===e.length&&this.stopCapping()}}getMaxLevel(e){if(!this.hls)return-1;const t=this.hls.levels;if(!t.length)return-1;const n=t.filter(((t,n)=>this.isLevelAllowed(t)&&n<=e));return this.observer||(this.clientRect=null),ua.getMaxLevelByMediaSize(n,this.mediaWidth,this.mediaHeight)}observe(){const e=self.ResizeObserver;e&&(this.observer=new e((e=>{var t;const n=null==(t=e[0])?void 0:t.contentRect;n&&(this.clientRect=n,this.detectPlayerSize())}))),this.observer&&this.media&&this.observer.observe(this.media)}startCapping(){var e;this.timer||this.observer||null==(e=this.hls)||!e.config.capLevelToPlayerSize||(self.clearInterval(this.timer),this.timer=void 0,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.observe(),this.observer||(this.timer=self.setInterval(this.detectPlayerSize.bind(this),1e3)),this.detectPlayerSize())}stopCapping(){this.restrictedLevels=[],this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0),this.observer&&(this.observer.disconnect(),this.observer=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)return e;const{ignoreDevicePixelRatio:t,maxDevicePixelRatio:n}=this.hls.config;if(!t)try{e=self.devicePixelRatio}catch(e){}return Math.min(e,n)}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}}var da=class e{constructor(t,n){Array.isArray(t)&&(t=t.map((t=>t instanceof e?t:new e(t)))),this.value=t,this.params=n}};function ha(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}const fa="Bare Item";const pa=/[\x00-\x1f\x7f]+/;var ga=class{constructor(e){this.description=e}};function ma(e,t,n){return ha("serialize",e,t,n)}function _a(e){if(!1===ArrayBuffer.isView(e))throw ma(e,"Byte Sequence");return`:${t=e,btoa(String.fromCharCode(...t))}:`;var t}function Ta(e){if(function(e){return e<-999999999999999||999999999999999<e}(e))throw ma(e,"Integer");return e.toString()}function Ea(e){const t=ae(e,3);if(Math.floor(Math.abs(t)).toString().length>12)throw ma(e,"Decimal");const n=t.toString();return n.includes(".")?n:`${n}.0`}function ya(e){const t=(n=e).description||n.toString().slice(7,-1);var n;if(!1===/^([a-zA-Z*])([!#$%&'*+\-.^_`|~\w:/]*)$/.test(t))throw ma(t,"Token");return t}function Sa(e){switch(typeof e){case"number":if(!r(e))throw ma(e,fa);return Number.isInteger(e)?Ta(e):Ea(e);case"string":return function(e){if(pa.test(e))throw ma(e,"String");return`"${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}(e);case"symbol":return ya(e);case"boolean":return function(e){if("boolean"!=typeof e)throw ma(e,"Boolean");return e?"?1":"?0"}(e);case"object":if(e instanceof Date)return function(e){return`@${Ta(e.getTime()/1e3)}`}(e);if(e instanceof Uint8Array)return _a(e);if(e instanceof ga)return ya(e);default:throw ma(e,fa)}}function va(e){if(!1===/^[a-z*][a-z0-9\-_.*]*$/.test(e))throw ma(e,"Key");return e}function ba(e){return null==e?"":Object.entries(e).map((([e,t])=>!0===t?`;${va(e)}`:`;${va(e)}=${Sa(t)}`)).join("")}function Ia(e){return e instanceof da?`${Sa(e.value)}${ba(e.params)}`:Sa(e)}function Aa(e,t={whitespace:!0}){if("object"!=typeof e||null==e)throw ma(e,"Dict");const n=e instanceof Map?e.entries():Object.entries(e),r=null!=t&&t.whitespace?" ":"";return Array.from(n).map((([e,t])=>{t instanceof da==!1&&(t=new da(t));let n=va(e);var r;return!0===t.value?n+=ba(t.params):(n+="=",Array.isArray(t.value)?n+=`(${(r=t).value.map(Ia).join(" ")})${ba(r.params)}`:n+=Ia(t)),n})).join(`,${r}`)}function Ra(e,t){return Aa(e,t)}const ka=["url"],Ca=["version","eventTargets","sid","transmissionMode"],La=["customData","headers"],Oa=e
1=>e instanceof da?new da(Math.round(e.value),e.params):Math.round(e),Na=e=>Array.isArray(e)?e.map(Oa):Oa(e),wa=(e,t)=>Array.isArray(e)?e.map((e=>wa(e,t))):e instanceof da&&"string"==typeof e.value?new da(wa(e.value,t),e.params):(t.baseUrl&&(e=function(e,t){let n;try{n=new URL(e)}catch(t){return e}const 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),a=Math.min(s.length,i.length);for(let e=0;e<a&&s[e]===i[e];e++)s.shift(),i.shift();for(;i.length;)i.shift(),s.unshift("..");return s.join("/")+n.search+n.hash}(e,function(e){const t="string"==typeof e?new URL(e):e;return t.origin+t.pathname.substring(0,t.pathname.lastIndexOf("/")+1)}(t.baseUrl))),1===t.version?encodeURIComponent(e):e),Pa=e=>e instanceof da?new da(100*Math.round(e.value/100),e.params):100*Math.round(e/100),Ma=e=>Array.isArray(e)?e.map(Pa):Pa(e),Da={br:Na,d:Na,bl:Ma,dl:Ma,mtp:Ma,nor:(e,t)=>{let n=e;return t.version>=2&&(e instanceof da&&"string"==typeof e.value?n=new da([e]):"string"==typeof e&&(n=[e])),wa(n,t)},rtp:Ma,tb:Na},xa=2,Ua="rr",Ba="bc",Fa="e",$a=Ua,Ga="ce",Ha=new Map([["ps","sta"],["pr","pr"],["c","cid"],["b","bg"],["bc","br"]]),ja="event",Wa="request",Va=["cen","e","h","ts"],Ka=["ab","bg","bl","br","bs","bsa","bsd","bsda","cdn","cid","cs","d","dfa","dl","ec","lab","lb","ltc","msd","mtp","nor","nr","ot","pb","pr","pt","rtp","sf","sid","sn","st","sta","su","tab","tb","tbl","tpb","v"],qa=/^[a-zA-Z0-9-.]+-[a-zA-Z0-9-.]+$/;function Ya(e){return qa.test(e)}const za=new Set(Ka);function Ja(e){return za.has(e)||Ya(e)}const Xa=["cmsdd","cmsds","rc","smrt","ttfb","ttfbb","ttlb","url"],Qa=new Set(Xa);function Za(e){return Qa.has(e)}const eo=new Set(Va);const to=new Set(["ab","bl","br","bsa","bsd","bsda","lab","lb","mtp","pb","tab","tb","tbl","tpb"]),no=["bl","br","bs","cid","d","dl","mtp","nor","nrr","ot","pr","rtp","sf","sid","st","su","tb","v"],ro=new Set(no);function so(e){return ro.has(e)||Ya(e)}const io=new Set(["ot","sf","st","e","sta"]);function ao(e){return io.has(e)}function oo(e){return"number"==typeof e?r(e):null!=e&&""!==e&&!1!==e}const lo={[ja]:function(e){return Ja(e)||Za(e)||eo.has(e)},[Wa]:Ja};function co(e,t){if(Array.isArray(e)){let n;return t&&(n=e.find((e=>{var n;return(null==(n=e.params)?void 0:n.ot)===t}))),n||(n=e[0]),co(n)}return e instanceof da?e.value:e}function uo(e,t={}){const n={};if(null==e||"object"!=typeof e)return n;
1const s=t.version||e.v||xa,i=t.reportingMode||Wa,a=1===s?function(e){const t={};for(const[r,s]of Object.entries(e))if(null!=s)if("nor"===r){const e=(Array.isArray(s)?s:[s])[0];var n;e instanceof da?(t.nor=e.value,null!=(n=e.params)&&n.r&&(t.nrr=e.params.r)):t.nor=e}else to.has(r)?t[r]=co(s,e.ot):t[r]=s;else t[r]=s;return t}(e):e,o=1===s?so:lo[i];let l=Object.keys(a).filter(o);a.e&&a.e!==Ua&&(l=l.filter((e=>!Za(e))));const c=t.filter;"function"==typeof c&&(l=l.filter(c));const u=i===ja;if(u){const e=a.e;l.includes("e")||null==e||l.push("e"),l.includes("ts")||l.push("ts"),l.includes("cen")||null==a.cen||"ce"!==e||l.push("cen");const t=e?Ha.get(e):void 0;t&&null!=a[t]&&!l.includes(t)&&l.push(t)}if(0===l.length)return n;s>1&&!l.includes("v")&&l.push("v");const d={version:s,reportingMode:i,baseUrl:t.baseUrl};l.sort();for(const e of l){var h,f;let i=a[e];const o=null!=(h=null==(f=t.formatters)?void 0:f[e])?h:Da[e];if("function"==typeof o&&(i=o(i,d)),"v"===e){if(1===s)continue;i=s}if("pr"===e&&1===i&&(!u||"pr"!==a.e))continue;u&&"ts"===e&&!r(i)&&(i=Date.now());const l=u&&!1===i&&"bg"===e&&"b"===a.e;(oo(i)||l)&&(ao(e)&&"string"==typeof i&&(i=new ga(i)),n[e]=i)}return n}const ho="CMCD-Object",fo="CMCD-Request",po="CMCD-Session",go="CMCD-Status",mo=fo,_o={ab:ho,br:ho,d:ho,lab:ho,lb:ho,ot:ho,tab:ho,tb:ho,tpb:ho,bl:fo,cs:fo,dfa:fo,dl:fo,ltc:fo,mtp:fo,nor:fo,nrr:fo,pb:fo,sn:fo,sta:fo,su:fo,tbl:fo,cid:po,msd:po,sf:po,sid:po,st:po,v:po,bg:go,bs:go,bsa:go,bsd:go,bsda:go,cdn:go,ec:go,nr:go,pr:go,pt:go,rtp:go};function To(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])||n.forEach((n=>e[n]=t)),e}),{})):{};var i;for(const t of r){var a;const r=_o[t]||s[t]||mo;(null!=(a=n[r])?a:n[r]={})[t]=e[t]}return n}const Eo="CMCD";function yo(e){return Ra(e,{whitespace:!1})}const So=[...no,...Ka,...Xa,...Va].filter(((e,t,n)=>n.indexOf(e)===t)),vo="m",bo="a",Io="v",Ao="av",Ro="i",ko="tt",Co="s",Lo="p",Oo="k",No="r",wo="a",Po="e",Mo="f",Do="d",xo="query",Uo="headers";function Bo(e,t,n){var r;const s=new Set(null!=(r=t.enabledKeys)?r:[]);return{version:t.version||xa,reportingMode:e,filter:e=>s.has(e),baseUrl:n}}const Fo=Object.is,$o=e=>e,Go=Array.from(Ha,(([e,t])=>"br"===t?{event:e,field:t,equal:(e,t)=>void 0===e||void 0===t?e===t:function(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++){const r=e[n],s=t[n];if(r===s)continue;if("number"==typeof r||"number"==typeof s)return!1;if(r.value!==s.value)return!1;const i=r.params,a=s.params,o=i&&Object.keys(i)[0],l=a&&Object.keys(a)[0];if(o!==l)return!1;if(void 0!==o&&void 0!==l&&i&&a&&i[o]!==a[l])return!1}return!0}(e,t),snapshot:e=>e.slice()}:{event:e,field:t,equal:Fo,snapshot:$o})),Ho=new Map(Go.map((e=>[e.event,e])));function jo(e){const{url:t}=e,n=D(e,ka);return fetch(t,n)}var Wo=class{constructor(e,t=jo){var n;this.timeOrigin=performance.timeOrigin||(null==(n=performance.timing)?void 0:n.fetchStart)||Date.now()-performance.now(),this.data={},this.msd=NaN,this.eventTargets=new Map,this.lastEmitted={},this.requestTarget={sn:0,msdSent:!1},this.config=function(e){const{version:t=xa,eventTargets:n=[],sid:r=oe(),transmissionMode:s=xo}=e;return M(M({},D(e,Ca)),{},{version:t,transmissionMode:s,sid:r,eventTargets:n.reduce(((e,t)=>{var n,r,s;return null!=t&&t.url&&null!=(n=t.events)&&n.length&&e.push({version:t.version||xa,enabledKeys:(null==(r=t.enabledKeys)?void 0:r.slice())||[],url:t.url,events:t.events.slice(),interval:null!=(s=t.interval)?s:30,batchSize:t.batchSize||1}),e}),[])})}(e),this.data={cid:this.config.cid,sid:this.config.sid,v:this.config.version},this.requester=t;for(const e of this.config.eventTargets)this.eventTargets.set(e,{intervalId:void 0,sn:0,msdSent:!1,queue:[]})}start(){this.eventTargets.forEach(((e,t)=>{if(this.disarmInterval(e),0===t.interval||!t.events.includes("t"))return;const n=()=>{this.recordTargetEvent(e,t,"t"),this.processEventTargets()};e.intervalId=setInterval(n,1e3*t.interval),n()}))}stop(e=!1){e&&this.flush(),this.eventTargets.forEach((e=>{this.disarmInterval(e)}))}flush(){this.processEventTargets(!0)}update(e){e.sid&&e.sid!==this.data.sid&&this.resetSession(),e.msd&&!isNaN(e.msd)&&(this.msd=e.msd),this.data=M(M(M({},this.data),e),{},{msd:void 0});for(const t of Go)t.field in e&&!t.equal(this.data[t.field],this.lastEmitted[t.field])&&this.recordEvent(t.event)}recordEvent(e,t={}){const n=Ho.get(e);if(n){const e=n.field,r=t[e];void 0!==r&&w(this.data,{[e]:r});const s=this.data[e];if(void 0===s)return;if(n.equal(s,this.lastEmitted[e]))return;w(this.lastEmitted,{[e]:n.snapshot(s)})}
1this.eventTargets.forEach(((n,r)=>{this.recordTargetEvent(n,r,e,t)})),this.processEventTargets()}recordTargetEvent(e,t,n,r={}){var s;if(!t.events.includes(n))return;const i=M(M(M({},this.data),r),{},{e:n,ts:null!=(s=r.ts)?s:Date.now(),sn:e.sn++});isNaN(this.msd)||e.msdSent||(i.msd=this.msd,e.msdSent=!0),e.queue.push(i)}recordResponseReceived(e,t={}){var n,r,s;const{request:i}=e,a=null!=(n=t.url)?n:null==i?void 0:i.url;if(!a)return;const o=new URL(a);o.searchParams.delete(Eo);const l={url:o.toString(),rc:e.status},c=e.resourceTiming;c&&(null!=c.startTime&&(l.ts=Math.round(this.timeOrigin+c.startTime),null!=c.responseStart&&(l.ttfb=Math.round(c.responseStart-c.startTime))),null!=c.duration&&(l.ttlb=Math.round(c.duration)));const u=null!=(r=null==(s=i.customData)?void 0:s.cmcd)?r:{};this.recordEvent(Ua,M(M(M({},u),l),t))}applyRequestReport(e){var t;return null!=(t=this.createRequestReport(e))?t:e}isRequestReportingEnabled(){var e;return!(null==(e=this.config.enabledKeys)||!e.length)}createRequestReport(e,t){var n;const{customData:r={},headers:s={}}=e,i=M(M({},D(e,La)),{},{headers:M({},s),customData:M(M({},r),{},{cmcd:{}})});if(null==(n=this.config.enabledKeys)||!n.length||!i.url)return i;const a=new URL(i.url),o=M(M(M({},this.data),t),{},{sn:this.requestTarget.sn++}),l=Bo(Wa,this.config,i.url);isNaN(this.msd)||this.requestTarget.msdSent||(o.msd=this.msd,this.requestTarget.msdSent=!0);const c=i.customData.cmcd=uo(o,l);switch(this.config.transmissionMode){case xo:const e=yo(c);e&&(a.searchParams.set(Eo,e),i.url=a.toString());break;case Uo:w(i.headers,function(e,t){const n={},r=To(e,t);for(const[e,t]of Object.entries(r)){const r=Ra(t,{whitespace:!1});r&&(n[e]=r)}return n}(c,l.customHeaderMap))}return i}processEventTargets(e=!1){let t=!1;this.eventTargets.forEach(((n,r)=>{const{queue:s}=n;if(!s.length)return;if(s.length<r.batchSize&&!e)return;const i=e?s.length:r.batchSize,a=s.splice(0,i);this.sendEventReport(r,a).catch((()=>{n.queue.unshift(...a)})),t||(t=s.length>0)})),t&&this.processEventTargets()}async sendEventReport(e,t){const n=Bo(ja,e),{status:r}=await this.requester({url:e.url,method:"POST",headers:{"Content-Type":"application/cmcd"},body:t.map((e=>function(e,t={}){return e?yo(uo(e,t)):""}(e,n))).join("\n")+"\n"});if(410===r)this.disposeEventTarget(e);else if(429===r||r>499&&r<600)throw new Error(`Event report failed with status ${r}`)}disarmInterval(e){clearInterval(e.intervalId),e.intervalId=void 0}disposeEventTarget(e){const t=this.eventTargets.get(e);t&&(this.disarmInterval(t),this.eventTargets.delete(e))}resetSession(){this.eventTargets.forEach((e=>e.sn=0)),this.requestTarget.sn=0,this.lastEmitted={}}};const Vo="h",Ko="v",qo="l",Yo="ll";new Set(no),new Set(So);const zo=["includeKeys"];function Jo(e){return Object.keys(e).every(Ya)}function Xo(e,t,n,r){e&&Object.keys(t).forEach((s=>{const i=e.filter((e=>e.groupId===s)).map((e=>{const i=w({},e);return i.details=void 0,i.attrs=new tr(i.attrs),i.url=i.attrs.URI=Qo(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 Qo(e,t,n,r){if(t){const{[n]:e}=r;if(e){const n=e[t];if(n)return n}}const{HOST:s,PARAMS:i}=r,a=new self.URL(e);return s&&(a.hostname=s),i&&Object.keys(i).sort().forEach((e=>{e&&xt(a,e,i[e])})),a.href}class Zo{constructor(){this.status="initialized",this.requestErrors=[],this.licenseXhr=void 0,this.onmessage=void 0,this.onkeystatuseschange=void 0,this.emitter=new Os,this.error=void 0,this.ok=void 0}get errored(){return this.error}set errored(e){this.error=e,this.emitter.eventNames().length&&this.emitter.emit("error",e)}get hasListeners(){return this.emitter.eventNames().length>0}get resolved(){return this.ok}resolve(){this.ok=!0,this.emitter.emit("resolved")}get useable(){return this.ok?Promise.resolve():this.error?Promise.reject(this.error):new Promise(((e,t)=>{this.emitter.on("error",t),this.emitter.on("resolved",e)}))}reset(){this.emitter.removeAllListeners();const e=this.licenseXhr;e&&(e.readyState!==XMLHttpRequest.DONE&&e.abort(),this.licenseXhr=void 0),this.onmessage=this.onkeystatuseschange=void 0}}
1class el 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}}class tl extends q{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.sessionSetupByUri={},this.mediaKeySessions=[],this.activeKeys={},this.mediaKeys=null,this.setMediaKeysQueue=tl.CDMCleanupPromise?[tl.CDMCleanupPromise]:[],this.onMediaEncrypted=e=>{const{initDataType:t,initData:n}=e,r=`"${e.type}" event: init data type: "${t}"`;if(this.log(r),null!==n){if(!this.keyFormatPromise){let e=Object.keys(this.keySystemAccessPromises);e.length||(e=Sr(this.config));const t=e.map(yr).filter((e=>!!e));this.keyFormatPromise=this.getKeyFormatPromise(t)}this.keyFormatPromise.then((s=>{let i;const a=Tr(s),o=this.activeLevelKeys();if(a===fr.FAIRPLAY&&"sinf"===t)try{const e=Ae(new Uint8Array(n)),t=Ye(Ie(JSON.parse(e).sinf));if(!t)throw new Error("'schm' box missing or not cbcs/cenc with schi > tenc");i=new Uint8Array(t.subarray(8,24))}catch(e){return void this.warn(`${r} Failed to parse sinf: ${e}`)}else if(a===fr.PLAYREADY)i=Ir(new Uint8Array(n));else if(a===fr.WIDEVINE){const e=st(n).filter((e=>e.systemId===Er));if(e.length){var l;const t=e[0];i=null!=(l=t.kids)&&l.length?t.kids[0]:null}}let c;if(i){const e=ve(i);for(let r=0;r<o.length;r++){const s=o[r];if(s.keyId&&(ir(i,s.keyId)||-1!==s.uri.replace(/-/g,"").indexOf(e))){s.pssh||(s.scheme=t,s.pssh=new Uint8Array(n),s.keyId=i,Rr.setKeyIdForUri(s.uri,i)),c=this.getSessionForKey(s,"encrypted-event-key-match");break}}}if(!c){var u,d;if(o.length)return(u=o[0]).scheme||(u.scheme=t),(d=o[0]).pssh||(d.pssh=new Uint8Array(n)),this.getSessionForKey(o[0],"encrypted-event-no-match");if(i)throw new Error(`Key ID ${ve(i)} not encountered in playlist`);this.log(`Ignoring "${e.type}" event - could not determine keyId`)}return c})).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=null,this.onMediaEncrypted=this.onWaitingForKey=null}registerListeners(){const{hls:e}=this;
1e&&(e.on(l.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(l.MEDIA_DETACHED,this.onMediaDetached,this),e.on(l.MANIFEST_LOADING,this.onManifestLoading,this),e.on(l.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(l.DESTROYING,this.onDestroying,this))}unregisterListeners(){const{hls:e}=this;e&&(e.off(l.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(l.MEDIA_DETACHED,this.onMediaDetached,this),e.off(l.MANIFEST_LOADING,this.onManifestLoading,this),e.off(l.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(l.DESTROYING,this.onDestroying,this))}attemptKeySystemAccess(e){if(!this.hls)return Promise.reject(new Error("destroyed"));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 el?t:new el({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===vr&&"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 fr.FAIRPLAY:s=["cenc","sinf"];break;case fr.WIDEVINE:case fr.PLAYREADY:s=["cenc"];break;case fr.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: ${qt(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.throwIfDestroyed(),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))}getMediaKeySessionContext(e,t,n,r){const{mediaKeySessions:s}=this,i=` key-session "${e}" keyId: ${ve(n.keyId||[])} keyUri: ${n.uri} for "${r}"`;for(let e=0;e<s.length;e++){const t=s[e];if(!t.initialized&&t.createdFor.levelKey.uri===n.uri)return this.log(`Reusing${i}`),t}this.log(`Creating${i}`);const a=t.createSession(),o={keySystem:e,mediaKeys:t,mediaKeysSession:a,keyRequests:{},keyStatuses:{},createdFor:{levelKey:n,reason:r},initialized:!1};return s.push(o),o}resetMediaKeys(){var e;const t=null==(e=this.mediaKeySessions[0])?void 0:e.keySystem,n=this.keySystemAccessPromises[t];n&&(this.log("reset mediaKeys"),this.mediaKeys=null,n.hasMediaKeys=!1,delete n.mediaKeys,delete this.keySystemAccessPromises[t])}updateKeySession(e,t,n){const r=e.mediaKeysSession;return this.log(`Updating key-session "${r.sessionId}" for keyId ${ve(t.keyId||[])}\n } (data length: ${n.byteLength})`),r.update(n)}getSelectedKeySystemFormats(){return Object.keys(this.keySystemAccessPromises).map((e=>({keySystem:e,hasMediaKeys:this.keySystemAccessPromises[e].hasMediaKeys}))).filter((({hasMediaKeys:e})=>!!e)).map((({keySystem:e})=>yr(e))).filter((e=>!!e))}getKeySystemAccess(e){return this.getKeySystemSelectionPromise(e).then((({keySystem:e,mediaKeys:t})=>this.attemptSetMediaKeys(e,t)))}selectKeySystem(e){return this.getKeySystemSelectionPromise(e).then((({keySystem:e})=>{const t=yr(e);
1if(!t)throw new Error(`Unable to find format for key-system "${e}"`);return t}))}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=Sr(this.config),n=e.map(Tr).filter((e=>!!e&&-1!==t.indexOf(e)));return this.selectKeySystem(n)}loadClear(e,t,n){if(this.config.emeEnabled&&!this.getSelectedKeySystemFormats().length){if(t.length)for(let r=0,s=t.length;r<s;r++){const i=t[r];if(e.cc<=i.cc&&(!A(e)||!A(i)||e.sn<i.sn)||!n&&r==s-1)return this.selectKeySystemFormat(i).then((e=>{if(!this.hls)return;i.setKeyFormat(e);const t=Tr(e);return t?this.getKeySystemAccess([t]):void 0}))}if(this.config.requireKeySystemAccessOnStart){const e=Sr(this.config);if(e.length)return this.getKeySystemAccess(e)}}return null}getKeyStatus(e){const{mediaKeySessions:t}=this;for(let n=0;n<t.length;n++){const r=nl(e,t[n]);if(r)return r}}loadKey(e){const t=e.decryptdata,n=this.getKeyStatus(t);if("internal-error"===n){const r=rl(n,t);return r.data.frag=e,this.error(`${r.message} (${ve(t.keyId||[])})`),Promise.reject(r)}const r=e.type,s=this.activeKeys,i=s[r];i&&!t.matches(i.decryptdata)&&(s.previous||(s.previous=[]),s.previous.push(i),delete s[r]),s[r]||(s[r]=e);for(let e=this.mediaKeySessions.length;e--;){const n=this.mediaKeySessions[e];if(t.keyId&&"expired"===n.keyStatuses[ve(t.keyId)])return this.renewKeySession(t,n)}return this.updateUsablePromise(t,"playlist-key",e)}renewKeySession(e,t){return this.resetMediaKeys(),this.removeSession(t).then((()=>(this.throwIfDestroyed(),this.updateUsablePromise(e,"expired"))))}updateUsablePromise(e,t,n){const r=this.getSessionForKey(e,t);return r.catch((e=>this.handleError(e,n))),r.then((t=>e))}getSessionForKey(e,t){const n=this.findContextForKey(e);if(void 0!==n)return Promise.resolve(n);const r=e.uri,s=this.sessionSetupByUri[r];let i;i=void 0===s?this.resolveSessionForKey(e,t):s.catch((()=>{})).then((()=>(this.throwIfDestroyed(),this.resolveSessionForKey(e,t)))),this.sessionSetupByUri[r]=i;const a=()=>{this.sessionSetupByUri[r]===i&&delete this.sessionSetupByUri[r]};return i.then(a,a),i}findContextForKey(e){const{mediaKeySessions:t}=this;for(let n=t.length;n--;){const r=t[n];if(nl(e,r))return r}}resolveSessionForKey(e,t){return this.getKeySystemForKeyPromise(e).then((({keySystem:n,mediaKeys:r})=>{this.throwIfDestroyed();for(let n=this.mediaKeySessions.length;n--;){const r=this.mediaKeySessions[n];if(nl(e,r))return r;const s=this.getUsableKeyPromise(r,e,t);if(s)return s}return this.attemptSetMediaKeys(n,r).then((()=>(this.throwIfDestroyed(),this.getMediaKeySessionContext(n,r,e,t)))).then((n=>{this.throwIfDestroyed();const r=e.scheme||"cenc",s=e.pssh?e.pssh.buffer:null;return this.generateRequestWithPreferredKeySession(n,e,r,s,t)}))}))}getUsableKeyPromise(e,t,n){const r=e.keyRequests[t.uri];if(r)return this.log(`Waiting for usable key (${n} keyId: ${function(e){if(e.keyFormat===gr)return e.uri;if(null===e.keyId)throw new Error("keyId is null");return ve(e.keyId)}(t)} format: "${t.keyFormat}" URI: ${t.uri})`),r.useable.then((()=>e))}throwIfDestroyed(e="Invalid state"){if(!this.hls)throw new Error("invalid state")}handleError(e,t){if(this.hls)if(e instanceof el){t&&(e.data.frag=t);const n=e.data.decryptdata;this.error(`${e.message}${n?` (${ve(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})}getKeySystemForKeyPromise(e){const t=Tr(e.keyFormat),n=t?[t]:Sr(this.config);return this.attemptKeySystemAccess(n)}getKeySystemSelectionPromise(e){if(e.length||(e=Sr(this.config)),0===e.length)throw new el({type:a.KEY_SYSTEM_ERROR,details:o.KEY_SYSTEM_NO_CONFIGURED_LICENSE,fatal:!0},`Missing key-system license configuration options ${qt({drmSystems:this.config.drmSystems})}`);return this.attemptKeySystemAccess(e)}activeLevelKeys(){const e=this.activeKeys,t=(e.previous||[]).map((e=>e.decryptdata));return e.audio&&t.unshift(e.audio.decryptdata),e.main&&t.unshift(e.main.decryptdata),t}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=()=>
1{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)))}))}filterInitData(e,t,n,r,s){var i;const a=null==(i=this.config.drmSystems)||null==(i=i[e.keySystem])?void 0:i.generateRequest;if(a)try{const i=a.call(this.hls,n,r,w({},e,{decryptdata:t,reason:s}),s);if(!i)throw new Error("Invalid response from configured generateRequest filter");t.scheme=i.initDataType?i.initDataType:"cenc";const o=i.initData?i.initData:null;return t.pssh=o?new Uint8Array(o):null,i}catch(e){var o;if(this.warn(e.message),null!=(o=this.hls)&&o.config.debug)throw e}return{initDataType:n,initData:r}}generateRequestWithPreferredKeySession(e,t,n,r,s){const i=this.getUsableKeyPromise(e,t,s);if(i)return i;const a=this.filterInitData(e,t,n,r,s);if(a&&(r=a.initData?a.initData:null,n=a.initDataType),null===r)return s.startsWith("encrypted-event")?Promise.reject(new Error(`missing initialization data for "${s}"`)):(this.log(`Skipping key-session request for "${s}" (no initData)`),Promise.resolve(e));const o=t.uri,l=new Zo;e.keyRequests[o]=l;const c=n=>{const r=e.mediaKeysSession;if(!r){const e=new Error("invalid state");return void(l.errored=e)}const{messageType:s,message:i}=n;l.status=s,this.log(`"${s}" message event for session "${r.sessionId}" message size: ${i.byteLength}`),"license-request"===s||"license-renewal"===s?this.renewLicense(e,t,i).catch((t=>{l.errored=t,l.hasListeners||this.handleError(t),this.removeSession(e)})):"license-release"===s?e.keySystem===fr.FAIRPLAY&&this.updateKeySession(e,t,cr("acknowledged")).then((()=>this.removeSession(e))).catch((e=>this.handleError(e))):this.warn(`unhandled media key message type "${s}"`)};l.onmessage=c,ls(e.mediaKeysSession,"message",c);return this.generateRequest(e,t,n,r,s,!1)}generateRequest(e,t,n,r,s,i){if(i){const i=this.filterInitData(e,t,n,r,s);i&&(r=i.initData?i.initData:r,n=i.initDataType)}const l=t.uri,c=e.keyRequests[l],u=ve(t.keyId||[]),d=e=>{let n;e.startsWith("usable")?c.resolve():"internal-error"===e||"output-restricted"===e||"output-downscaled"===e?n=rl(e,t):"expired"===e?n=new Error(`key expired (keyId: ${u})`):"released"===e?n=new Error("key released"):"status-pending"===e||this.warn(`unhandled key status change "${e}" (keyId: ${u})`),n&&(c.errored=n,c.hasListeners||this.handleError(n))},h=n=>{if(!e.mediaKeysSession){const e=new Error("invalid state");return void(c.errored=e)}const r=e.keyStatuses=this.getKeyStatuses(e);if(!Object.keys(r).some((e=>"status-pending"!==r[e])))return;const s=this.activeLevelKeys();for(let n=0;n<s.length;n++){const a=ve(s[n].keyId||[]);if("expired"===r[a]){var i;this.log(`Expired key ${qt(r)} in key-session "${null==(i=e.mediaKeysSession)?void 0:i.sessionId}"`),this.renewKeySession(t,e).catch((e=>this.handleError(e)));break}}let a=r[u];if(a)d(a);else{var o;const n=1e3;e.keyStatusTimeouts||(e.keyStatusTimeouts={}),(o=e.keyStatusTimeouts)[u]||(o[u]=self.setTimeout((()=>{var r;if(!e.mediaKeysSession)return;const s=this.getKeyStatus(t);var i;if(s&&"status-pending"!==s)return this.log(`No status for keyId ${u} in key-session "${null==(i=e.mediaKeysSession)?void 0:i.sessionId}". Using session key-status ${s} from other session.`),d(s);this.log(`key status for ${u} in key-session "${null==(r=e.mediaKeysSession)?void 0:r.sessionId}" timed out after ${n}ms`),a="internal-error",d(a)}),n)),this.log(`No status for keyId ${u} (${qt(r)}).`)}};c.onkeystatuseschange=h,ls(e.mediaKeysSession,"keystatuseschange",h);const f=c.useable;return this.log(`Generating key-session request for "${s}" keyId: ${u} URI: ${l} (init data type: ${n} length: ${r.byteLength})`),c.status="started",e.initialized=!0,e.mediaKeysSession.generateRequest(n,r).then((()=>{var t;c.status="generated",this.log(`Request generated for key-session "${null==(t=e.mediaKeysSession)?void 0:t.sessionId}" keyId: ${u} URI: ${l}`)})).catch((e=>{throw this.log(`mediaKeysSession.generateRequest failed: ${e}`),new el({type:a.KEY_SYSTEM_ERROR,details:o.KEY_SYSTEM_NO_SESSION,error:e,decryptdata:t,fatal:!1},`Error generating key-session request: ${e}`)})).then((()=>f)).catch((t=>{var n;this.log(`mediaKeysSession.generateRequest failed: ${t}`);const r=null==(n=t.data)?void 0:n.details;return r!==o.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED&&r!==o.KEY_SYSTEM_STATUS_INTERNAL_ERROR||!Object.keys(e.keyStatuses).some((t=>"usable"===e.keyStatuses[t]))?this.removeSession(e).then((()=>{throw t})):(this.handleError(t),e)})).then((()=>e))}getKeyStatuses(e){const t={},n=e.mediaKeysSession.sessionId;
1return e.mediaKeysSession.keyStatuses.forEach(((r,s)=>{if("string"==typeof s&&"object"==typeof r){const e=s;s=r,r=e}const i="buffer"in s?new Uint8Array(s.buffer,s.byteOffset,s.byteLength):new Uint8Array(s);if(e.keySystem===fr.PLAYREADY&&16===i.length){const e=ve(i);t[e]=r,ur(i)}const a=ve(i);this.log(`key status change "${r}" for keyStatuses keyId: ${a} key-session "${n}"`),t[a]=r})),t}fetchServerCertificate(e){const t=this.config,n=new(0,t.loader)(t),r=function(e,t){const{drmSystems:n}=t,r=null==n?void 0:n[e];if(r)return r.serverCertificateUrl}(e,t);return r?(this.log(`Fetching server certificate for "${e}"`),new Promise(((s,i)=>{const l={type:E.SERVER_CERTIFICATE,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 el({type:a.KEY_SYSTEM_ERROR,details:o.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:s,response:M({url:l.url,data:void 0},t)},`"${e}" certificate request failed (${r}). Status: ${t.code} (${t.text})`))},onTimeout:(t,n,s)=>{i(new el({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)}))):(this.log(`No Server Certificate in config.drmSystems["${e}"]`),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 el({type:a.KEY_SYSTEM_ERROR,details:o.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED,error:e,fatal:!0},e.message))}))}))}renewLicense(e,t,n){return this.requestLicense(e,t,new Uint8Array(n)).then((n=>this.updateKeySession(e,t,new Uint8Array(n)).catch((e=>{throw new el({type:a.KEY_SYSTEM_ERROR,details:o.KEY_SYSTEM_SESSION_UPDATE_FAILED,decryptdata:t,error:e,fatal:!1},e.message)}))))}unpackPlayReadyKeyMessage(e,t){const n=Ae(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 cr(atob(l))}setupLicenseXHR(e,t,n,r,s){const i=this.config.licenseXhrSetup;return i?Promise.resolve().then((()=>(this.throwIfDestroyed(),i.call(this.hls,e,t,M(M({},n),{},{decryptdata:r}),s)))).catch((a=>{if(!n.mediaKeysSession)throw a;return e.open("POST",t,!0),i.call(this.hls,e,t,M(M({},n),{},{decryptdata:r}),s)})).then((n=>{e.readyState||e.open("POST",t,!0);return{xhr:e,licenseChallenge:n||s}})):(e.open("POST",t,!0),Promise.resolve({xhr:e,licenseChallenge:s}))}requestLicense(e,t,n){return new Promise(((r,s)=>{const i=function(e,t){const{drmSystems:n,widevineLicenseUrl:r}=t,s=null==n?void 0:n[e];if(s)return s.licenseUrl;if(e===fr.WIDEVINE&&r)return r}(e.keySystem,this.config);if(!i)return s(new Error(`no license server URL configured for key-system "${e.keySystem}"`));const l=e.keyRequests[t.uri];if(!l)return s(new Error("License emitter removed"));this.log(`Sending license request to URL: ${i}`);const c=this.config.keyLoadPolicy.default,u=new XMLHttpRequest;u.responseType="arraybuffer",u.onreadystatechange=()=>{if(!this.hls||!e.mediaKeysSession)return s(new Error("invalid state"));if(4===u.readyState)if(200===u.status){l.requestErrors=[];let n=u.response;this.log(`License received ${n instanceof ArrayBuffer?n.byteLength:n}`);const s=this.config.licenseResponseCallback;if(s)try{n=s.call(this.hls,u,i,M(M({},e),{},{decryptdata:t}))}catch(e){this.error(e)}r(n)}else{const d=c.errorRetry,h=d?d.maxNumRetry:0;if(l.requestErrors.push({status:u.status,message:u.statusText}),l.requestErrors.length>h||u.status>=400&&u.status<500)s(new el({type:a.KEY_SYSTEM_ERROR,details:o.KEY_SYSTEM_LICENSE_REQUEST_FAILED,decryptdata:t,fatal:!0,networkDetails:u,response:{url:i,data:void 0,code:u.status,text:u.statusText}},`License Request XHR failed (${i}). Status: ${u.status} (${u.statusText})`));else{const i=h-l.requestErrors.length;this.warn(`Retrying license request, ${i} attempts left`),this.requestLicense(e,t,n).then(r,s)}}},l.licenseXhr&&l.licenseXhr.readyState!==XMLHttpRequest.DONE&&l.licenseXhr.abort(),l.licenseXhr=u,this.setupLicenseXHR(u,i,e,t,n).then((({xhr:t,licenseChallenge:n})=>{e.keySystem==fr.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,ls(n,"encrypted",this.onMediaEncrypted),ls(n,"waitingforkey",this.onWaitingForKey);const r=this.mediaResolved;r?r():this.mediaKeys=n.mediaKeys}onMediaDetached(){const e=this.media;e&&(cs(e,"encrypted",this.onMediaEncrypted),cs(e,"waitingforkey",this.onWaitingForKey),this.media=null,this.mediaKeys=null)}_clear(){var e;this.keyFormatPromise=null,this.keySystemAccessPromises={},this.activeKeys={},this.sessionSetupByUri={};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,Rr.clearKeyUriToKeyIdMap();const s=r.length;tl.CDMCleanupPromise=Promise.all(r.map((e=>this.removeSession(e))).concat((null==n||null==(e=n.setMediaKeys(null))?void 0:e.catch((e=>
1{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(),this.keyFormatPromise=null}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),this.keyFormatPromise.catch((()=>{}))}}removeSession(e){const{mediaKeysSession:t}=e;if(t){this.log(`Remove licenses and keys and close session "${t.sessionId}"`),Object.keys(e.keyRequests).forEach((n=>{const r=e.keyRequests[n];r.onmessage&&t.removeEventListener("message",r.onmessage),r.onkeystatuseschange&&t.removeEventListener("keystatuseschange",r.onkeystatuseschange),r.reset(),e.keyRequests[n]=void 0})),e.mediaKeysSession=void 0;const n=this.mediaKeySessions.indexOf(e);n>-1&&this.mediaKeySessions.splice(n,1);const{keyStatusTimeouts:r}=e;r&&Object.keys(r).forEach((e=>self.clearTimeout(r[e])));const{drmSystemOptions:s}=this.config,i=function(e){var t;return!(!e||"persistent-license"!==e.sessionType&&(null==(t=e.sessionTypes)||!t.some((e=>"persistent-license"===e))))}(s)?new Promise(((e,n)=>{self.setTimeout((()=>n(new Error("MediaKeySession.remove() timeout"))),8e3),t.remove().then(e).catch(n)})):Promise.resolve();return i.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())).then((()=>t.closed)).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 nl(e,t){const n=e.keyId,r=t.mediaKeysSession;if(n&&r){const e=t.mediaKeysSession.keyStatuses;if(e.size)return e.has(n)?e.get(n):t.keyStatuses[ve(n)]}}function rl(e,t){const n="output-restricted"===e,r=n?o.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED:o.KEY_SYSTEM_STATUS_INTERNAL_ERROR;return new el({type:a.KEY_SYSTEM_ERROR,details:r,fatal:!1,decryptdata:t},n?"HDCP level output restricted":`key status changed to "${e}"`)}tl.CDMCleanupPromise=void 0;var sl=function(){if(null!=hr&&hr.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 il{decode(e,t){if(!e)return"";if("string"!=typeof e)throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))}}function al(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 ol{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 ll(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 cl=new sl(0,0,""),ul="middle"===cl.align?"middle":"center";function dl(e,t,n){const r=e;function s(){const t=al(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 ol;ll(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",ul,"end"]);break;case"position":s=t.split(","),r.percent(e,s[0]),2===s.length&&r.alt("positionAlign",s[1],["start",ul,"end","line-left","line-right","auto"]);break;case"size":r.percent(e,t);break;case"align":r.alt(e,t,["start",ul,"end","left","right"])}}),/:/,/\s/),t.region=r.get("region",null),t.vertical=r.get("vertical","");let s=r.get("line","auto");"auto"===s&&-1===cl.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",ul);let i=r.get("position","auto");"auto"===i&&50===cl.position&&(i="start"===t.align||"left"===t.align?0:"end"===t.align||"right"===t.align?100:50),t.position=i}(e,t)}function hl(e){return e.replace(/<br(?: \/)?>/gi,"\n")}class fl{constructor(){this.state="INITIAL",this.buffer="",this.decoder=new il,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=hl(e);n<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)?ll(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 sl(0,0,""),t.state="CUE",-1===e.indexOf("--\x3e")){t.cue.id=e;continue}case"CUE":if(!t.cue){t.state="BADCUE";continue}try{dl(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");
1if(!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}}function pl(e){let t=5381,n=e.length;for(;n;)t=33*t^e.charCodeAt(--n);return(t>>>0).toString()}const gl=/\r\n|\n\r|\n|\r/g,ml="Missing initPTS for VTT ";function _l(e,t,n){return pl(e.toString())+pl(t.toString())+pl(n)}function Tl(e,t,n,s,i,a,o){const l=new fl,c=pe(new Uint8Array(e)).trim().replace(gl,"\n").split("\n"),u=[],d=t?function(e,t=1){return Ni(e,9e4,1/t)}(t.baseTime,t.timescale):0;let h,f="00:00.000",p=0,g=0,m=!1,_=!0;l.oncue=function(e){const r=n[s];let a=n.ccOffset;const o=(p-d)/9e4;if(m){if(null!=r&&r.new&&(a=n.ccOffset=r.start),o){if(!t)return void(h=new Error(ml+"MPEGTS"));a=o-n.presentationOffset}}else{if(!t)return void(h=new Error(ml+"without X-TIMESTAMP-MAP"));a=-t.baseTime/t.timescale}const l=e.endTime-e.startTime,c=Ui(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?s&&(e.id=`hlsjscc${s}_${e.id}`):e.id=_l(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(_){if(e.startsWith("X-TIMESTAMP-MAP=")){_=!1,m=!0,e.slice(16).split(",").forEach((e=>{e.startsWith("LOCAL:")?f=e.slice(6):e.startsWith("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&&(_=!1)}l.parse(e+"\n")})),l.flush()}const El="stpp.ttml.im1t",yl=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,Sl=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,vl={left:"start",center:"center",right:"end",start:"start",end:"end"};function bl(e,t,n,r){const s=Be(new Uint8Array(e),["mdat"]);if(0===s.length)return void r(new Error("Could not parse IMSC1 mdat"));const i=s.map((e=>pe(e))),a=function(e,t,n=1,r=!1){return Ni(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:1},i=Object.keys(s).reduce(((e,t)=>(e[t]=r.getAttribute(`ttp:${t}`)||s[t],e)),{});!r.getAttribute("ttp:tickRate")&&r.getAttribute("ttp:frameRate")&&(i.tickRate=Number(i.frameRate)*Number(i.subFrameRate));const a="preserve"!==r.getAttribute("xml:space"),o=Al(Il(r,"styling","style")),l=Al(Il(r,"layout","region")),c=Il(r,"body","[begin]");return[].map.call(c,(e=>{const n=Rl(e,a);if(!n||!e.hasAttribute("begin"))return null;const r=Ll(e.getAttribute("begin"),i),s=Ll(e.getAttribute("dur"),i);let c=Ll(e.getAttribute("end"),i);if(null===r)throw Cl(e);if(null===c){if(null===s)throw Cl(e);c=r+s}const u=new sl(r-t,c-t,n);u.id=_l(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)=>{const a=kl(t,r,i)||kl(e,r,i)||kl(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=vl[h];e&&(u.lineAlign=e),u.align=h}return w(u,d),u})).filter((e=>null!==e))}(e,a))))}catch(e){r(e)}}function Il(e,t,n){const r=e.getElementsByTagName(t)[0];return r?[].slice.call(r.querySelectorAll(n)):[]}function Al(e){return e.reduce(((e,t)=>{const n=t.getAttribute("xml:id");return n&&(e[n]=t),e}),{})}function Rl(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?Rl(n,t):t?e+n.textContent.trim().replace(/\s+/g," "):e+n.textContent}),"")}function kl(e,t,n){return e&&e.hasAttributeNS(t,n)?e.getAttributeNS(t,n):null}function Cl(e){return new Error(`Could not parse ttml timestamp ${e}`)}function Ll(e,t){if(!e)return null;let n=al(e);return null===n&&(yl.test(e)?n=function(e,t){const n=yl.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):Sl.test(e)&&(n=function(e,t){const n=Sl.exec(e),r=Number(n[1]);switch(n[2]){case"h":return 3600*r;case"m":return 60*r;case"ms":return r/1e3;case"f":return r/t.frameRate;case"t":return r/t.tickRate}return r}(e,t))),n}function Ol(e,t,n,r="",s="disabled"){const i=e.ownerDocument.createElement("track");return i.kind=t,i.label=n,r&&(i.srclang=r),i.src="data:,WEBVTT",i.track.mode=s,e.appendChild(i),i}function Nl(e){return e.forced&&(ot.indexOf("Apple")>-1||/iPhone|iPad|iPod/.test(at))?"forced":e.characteristics&&/transcribes-spoken-dialog/gi.test(e.characteristics)&&/describes-music-and-sound/gi.test(e.characteristics)?"captions":"subtitles"}function wl(e,t){const n=e.mode;if("disabled"===n&&(e.mode="hidden"),e.cues&&!e.cues.getCueById(t.id))try{if
1(e.addCue(t),!e.cues.getCueById(t.id))throw new Error(`addCue is failed for: ${t}`)}catch(n){Z.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){Z.debug(`[texttrack-utils]: Legacy TextTrackCue fallback failed: ${e}`)}}"disabled"===n&&(e.mode=n)}function Pl(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 Ml(e,t){const n=Dl(e.main);if(n&&n.start<=t)return n;const r=Dl(e.audio);return r&&r.start<=t?r:null}function Dl(e){if(!e)return null;switch(e.state){case hs:case ds:case Es:case ys:return null}return e.frag}function xl(e,t){return t.getAppendedFrag(e,y.MAIN)||t.getPartialFragment(e)}function Ul(e,t,n,r){const s=r.latestLevelDetails,i=xl(t,n);if(As(r.config)&&!e.nextStart&&s&&i&&r.interstitialsManager){const n="type"in i?i:i.fragment,a=un(s,n.sn);(null==a?void 0:a.level)===n.level&&Is(a,r.interstitialsManager.playerQueue,t)&&(e.nextStart=a.start)}}function Bl(){if("undefined"!=typeof self)return self.VTTCue||self.TextTrackCue}function Fl(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,qt(s?M({type:s},r):r))}return i}const $l=(()=>{const e=Bl();try{e&&new e(0,Number.POSITIVE_INFINITY,"")}catch(e){return Number.MAX_VALUE}return Number.POSITIVE_INFINITY})();function Gl(){return self.SourceBuffer||self.WebKitSourceBuffer}function Hl(){if(!ee())return!1;const e=Gl();return!e||e.prototype&&"function"==typeof e.prototype.appendBuffer&&"function"==typeof e.prototype.remove}var jl=0,Wl=1,Vl=2;class Kl extends bs{constructor(e,t,n){super(e,t,n,"stream-controller",y.MAIN),this.audioCodecSwap=!1,this.level=-1,this._forceStartLoad=!1,this._hasEnoughToStart=!1,this.altAudio=jl,this.audioOnly=!1,this._couldBacktrack=!1,this._backtrackFragment=void 0,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}`),!this.getBufferedFrag(t))return;const n=this.getFwdBufferInfoAtPos(e,t,y.MAIN,0);n&&0!==n.len?this.tick():this.log(`Main buffer empty at ${t} on "seeked" event: ${n?n.len:n}`)},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.initPTS.length&&(this.log(`Override startPosition with lastCurrentTime @${n}`),e=n),this.state=hs,this.nextLoadPosition=this.lastCurrentTime=e+this.timelineOffset,this.startPosition=t?-1:e,t||this.fragmentTracker.hasFragments(this.playlistType)||(this._hasEnoughToStart=this.startFragRequested=!1),this.tick()}else this._forceStartLoad=!0,this.state=ds}stopLoad(){this._forceStartLoad=!1,super.stopLoad()}doTick(){switch(this.state){case vs:{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=hs;break}if(this.hls.nextLoadLevel!==this.level){this.state=hs;break}break}case gs:this.checkRetryDate()}this.state===hs&&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;
vendor: 8,409 bytes, line 1
1const 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={type:this.targetBufferType()};return this.hls.trigger(l.BUFFER_EOS,e),void(this.state=Es)}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===vs||this.waitForLive(i))return this.level=s,this.state=vs,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=void 0);const h=this.backtrackFragment?this.backtrackFragment.start:a.end;let f=this.getNextFragment(h,c);if(this.couldBacktrack&&!this.fragPrevious&&f&&A(f)&&this.fragmentTracker.getState(f)!==kn){var p;const e=(null!=(p=this.backtrackFragment)?p:f).sn-c.startSN,t=c.fragments[e-1];t&&f.cc===t.cc&&(f=t,this.fragmentTracker.removeFragment(t))}else this.backtrackFragment&&a.len&&(this.backtrackFragment=void 0);if(f&&this.isLoopLoading(f,h)){if(!f.gap){const e=this.audioOnly&&!this.altAudio?S:v,t=(e===v?this.videoBuffer:this.mediaBuffer)||this.media;t&&this.afterBufferFlushed(t,e)}f=this.getNextFragmentLoopLoading(f,c,a,y.MAIN,d)}f&&(this.exceedsMaxBuffer(a,d,f)||this.loadFragment(f,i,h))}loadFragment(e,t,n){const r=this.fragmentTracker.getState(e);r===In||r===Rn?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.clearTrackerIfNeeded(e)}immediateLevelSwitch(){if(this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY),this.altAudio!==jl){var e;((null==(e=this.getLevelDetails())?void 0:e.fragmentStart)||0)>this.lastCurrentTime&&super.flushMainBuffer(0,Number.POSITIVE_INFINITY,"audio")}}getBufferOutput(){return this.mediaBuffer&&this.altAudio===Vl?this.mediaBuffer:this.media}checkFragmentChanged(){const e=this.fragPlaying;if(!this.checkFragPlaying())return!1;const t=this.fragPlaying;if(t){const n=t.level;this.hls.trigger(l.FRAG_CHANGED,{frag:t,previousFrag:e}),(null==e?void 0:e.level)!==n&&this.hls.trigger(l.LEVEL_SWITCHED,{level:n})}return!0}get backtrackFragment(){return this._backtrackFragment}set backtrackFragment(e){this._backtrackFragment=e}get couldBacktrack(){return this._couldBacktrack}set couldBacktrack(e){this._couldBacktrack=e}abortCurrentFrag(){this.backtrackFragment=void 0,super.abortCurrentFrag()}flushMainBuffer(e,t){super.flushMainBuffer(e,t,this.targetBufferType())}targetBufferType(){return this.altAudio!==Vl||this.audioOnly?null:"video"}onMediaAttached(e,t){super.onMediaAttached(e,t);const n=t.media;ls(n,"playing",this.onMediaPlaying),ls(n,"seeked",this.onMediaSeeked)}onMediaDetaching(e,t){const{media:n}=this;n&&(cs(n,"playing",this.onMediaPlaying),cs(n,"seeked",this.onMediaSeeked)),this.videoBuffer=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.backtrackFragment=void 0,this.altAudio=jl,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=Gl();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!==hs)return;const r=t.levelInfo;(!r.details||r.details.live&&(this.levelLastLoaded!==r||r.details.expired)||this.waitForCdnTuneIn(r.details))&&(this.state=vs)}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!==ps&&this.state!==gs||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===vs){if(this.waitForCdnTuneIn(a))return;this.state=hs}s&&a.live&&this.synchronizeToLiveEdge(a),this.initPTS.some(((e,t)=>{if(t>=a.startCC)return!0;delete this.initPTS[t]})),this.tick()}synchronizeToLiveEdge(e){const{config:t,media:n}=this;if(!n)return;const r=this.hls.liveSyncPosition,s=this.playhead,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} is located too far from the end of live sliding playlist: ${a}, reset currentTime to : ${r}`),"buffered"===this.config.liveSyncMode){var l;const e=qn.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}=qn.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 Ji(this.hls,y.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),f=r?r.index:-1,p=-1!==f,{decryptRange:g,byteRange:m}=Gn(n,r,this.iframesOnly),_=new Vn(n.level,n.sn,n.stats.chunkCount,m?m.end-m.start:s.byteLength,f,p,n.duration,this.iframesOnly,g),T=this.initPTS[n.cc];h.push(s,u,d,l,n,r,o.totalduration,c,_,T)}onAudioTrackSwitching(e,t){const n=this.hls,r=this.altAudio!==jl;if(tn(t.url,n))this.altAudio=Wl;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=jl,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=tn(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?Vl:jl,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===y.MAIN;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}
1`),void(this.state===Ts&&(this.state=hs));let e=!1;if(A(n)&&(e=!!n.gap&&!n.tagList.some((e=>"GAP"===e[0]))),this.fragBufferedComplete(n,r),e){var i;n.stats.retry++;const e=null==(i=this.levels)?void 0:i[n.level];e&&e.fragmentError++}}const a=this.media;a&&(!this._hasEnoughToStart&&qn.getBuffered(a).length&&(this._hasEnoughToStart=!0,this.seekToStartPos()),s&&this.tick())}get hasEnoughToStart(){return this._hasEnoughToStart}onError(e,t){var n;if(t.fatal)this.state=ys;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(y.MAIN,t);break;case o.LEVEL_LOAD_ERROR:case o.LEVEL_LOAD_TIMEOUT:case o.LEVEL_PARSING_ERROR:t.levelRetry||this.state!==vs||(null==(n=t.context)?void 0:n.type)!==E.LEVEL||(this.state=hs);break;case o.BUFFER_APPEND_NO_PROGRESS:if("main"!==t.parent)return;t.frag&&(t.appendsWithoutProgress||0)>=this.config.appendErrorMaxRetry&&(this.warn(`Marking fragment ${t.frag.sn} of level ${t.frag.level} as a gap after ${t.appendsWithoutProgress} appends without buffered range growth, to prevent loop loading`),this.fragmentTracker.addAsGap(t.frag));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=hs,this._hasEnoughToStart||(this.startFragRequested=!1,this.nextLoadPosition=this.lastCurrentTime),this.tickImmediate()}onBufferFlushed(e,{type:t}){if(t!==S||!this.altAudio){const e=(t===v?this.videoBuffer:this.mediaBuffer)||this.media;e&&(this.afterBufferFlushed(e,t),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=qn.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=hs,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!==ds&&this.state!==ys&&(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=_s,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};const r=this.initPTS.slice(0);n.trigger(l.INIT_PTS_FOUND,{timestampOffsets:r,frag:o,id:t,initPTS:s,timescale:a,trackId:e})}}
vendor: 4,486 bytes, line 1
1if(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[S]={startPTS:e,endPTS:t,startDTS:n,endDTS:r}),o.setElementaryStreamInfo(S,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(`${A(e)?"Media":"Init"} segment with muxed audiovideo where only video expected: ${e.url}`)}_bufferInitSegment(e,t,n,r){if(this.state!==_s)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=It(s.codec,n);if("mp4a"===r&&(r="mp4a.40.5"),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)&&!function(){if(void 0===ct){const e=at.match(/Firefox\/(\d+)/i);ct=e?parseInt(e[1]):0}return ct}()&&(r="mp4a.40.5")}r&&-1!==r.indexOf("mp4a.40.5")&&/Android/.test(at)&&"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=y.MAIN,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=y.MAIN;const 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.iframesOnly&&this.logMuxedErr(n),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.getBufferOutput();return this.getFwdBufferInfo(e,y.MAIN)}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=hs}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?an(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}}
1class ql extends Kl{constructor(...e){super(...e),this.currentOp=void 0,this.nextOp=void 0,this.cached=[],this.cachedSize=0,this.cacheFragmentData=!0,this.initDetails=void 0,this.onBufferedToEnd=()=>{const e=this.media;null!=e&&e.seeking&&(e.currentTime=e.currentTime)},this.onMediaSeeking=()=>{}}setInitPts(e){this.initPTS=e.slice()}loadMediaAt(e,t){if(!this.hls)return;const{seekOnAppend:n}=t,r=e+this.timelineOffset;switch(this.nextLoadPosition=this.lastCurrentTime=r,this.startPosition=e,this.state){case ds:case Es:case ys:this.state=hs}this.state===hs?(this.hls.resumeBuffering(),this.tick(),this.currentOp=[r,t]):this.nextOp=[r,t],this.hls.off(l.BUFFERED_TO_END,this.onBufferedToEnd);const s=this.media;if(n&&s){this.seekTo(r)&&(this.currentOp=[r,t],this.nextOp=void 0,this.flushPipeline(r,!0))}}seekTo(e){const t=this.media;if(t){var n;const r=null==(n=this.getLevelDetails())?void 0:n.edge,s=void 0!==r?r:t.duration;e>=s&&(e=s-.01);if(qn.bufferInfo(t,e,0).len>0&&this.getBufferedAt(e))return t.currentTime=e,!0}return!1}getBufferedAt(e){return this.fragmentTracker.getBufferedFrag(e,y.MAIN)}cacheSet(e,t){if(!this.hls)return;e.data=t;const n=this.cached;n.push(e),this.cachedSize+=t.buffer.byteLength;const r=this.hls.config.iframeCacheLimit;for(;this.cachedSize>r&&n.length>1;){const e=n.shift();if(!e.data){this.cached=n.filter((e=>!!e.data)),this.cachedSize=n.reduce(((e,{data:t})=>t?t.buffer.byteLength:0),0);break}this.cachedSize-=e.data.byteLength,e.data=void 0}}onHandlerDestroying(){this.cached.length=0,this.cachedSize=0,super.onHandlerDestroying()}_handleFragmentLoadProgress(e){const t=e.frag,{part:n,payload:r}=e;this.cacheFragmentData&&!n&&null!=r&&r.byteLength&&!t.data&&A(t)&&this.cacheSet(t,new Uint8Array(r.slice(0))),super._handleFragmentLoadProgress(e)}loadFragment(e,t,n){const r=this.fragmentTracker.getState(e);r!==In&&r!==Rn||!this.canReplayCached(e)?super.loadFragment(e,t,n):this.replayCachedFragment(e)}canReplayCached(e){var t;if(!this.cacheFragmentData||null==(t=e.data)||!t.byteLength)return!1;const n=e.decryptdata;return"identity"!==(null==n?void 0:n.keyFormat)||!!n.key}replayCachedFragment(e){const t=e.data.slice().buffer;this.log(`Buffering cached ${e.type} sn: ${e.sn} of level ${e.level} (${t.byteLength} bytes)`),this.fragCurrent=e,this.startFragRequested=!0;const n=e.stats=new T;n.loading.start=n.loading.first=n.loading.end=self.performance.now(),n.loaded=n.total=t.byteLength,n.chunkCount=1,this.state=ps;const r={frag:e,part:null,payload:t,networkDetails:null};this._handleFragmentLoadProgress(r),this.hls.trigger(l.FRAG_LOADED,r),this._handleFragmentLoadComplete(r)}fragBufferedComplete(e,t){super.fragBufferedComplete(e,t);const{currentOp:n,nextOp:r}=this;this.currentOp=this.nextOp=void 0,this.state=ds,null!=n&&n[1].seekOnAppend&&(this.flushPipeline(n[0],!r),this.seekTo(n[0])||this.log(`Could not seek to ${n[0]} after fragment buffered (superseded or flushed) buffer: ${this.media?us(qn.getBuffered(this.media)):"none"}`)),r&&this.loadMediaAt.apply(this,r)}flushPipeline(e,t){if(t){const t=this.media;if(t){const n=qn.bufferInfo(t,e,0),r=n.len?n.nextStart:0;r&&(this.fragmentTracker.removeFragmentsInRange(r,1/0,y.MAIN),this.flushMainBuffer(r,1/0))}this.hls.once(l.BUFFERED_TO_END,this.onBufferedToEnd)}this.hls.trigger(l.BUFFER_EOS,{type:"video"})}get playhead(){return this.nextLoadPosition}startLoad(){if(!this.startFragRequested){const e=this.hls;
1e.nextLoadLevel=-1===e.startLevel?0:e.firstAutoLevel}}seekToStartPos(){}setStartPosition(){}alignPlaylists(e,t,n){const r=this.initDetails;return this.initDetails=null,super.alignPlaylists(e,t,n||r||void 0)}getMainFwdBufferInfo(){const e=this.playhead,t=this.getBufferedAt(e);if(t){const n=t.duration;return{len:n,start:e,end:e+n,bufferedIndex:-1}}return{len:0,start:e,end:e,bufferedIndex:-1}}_streamEnded(){const e=this.playhead,t=this.fragmentTracker.getBufferedFrag(e,y.MAIN);return!(null==t||!t.endList)}}class Yl extends ql{constructor(...e){super(...e),this._img=void 0,this.queued=void 0,this.cacheFragmentData=!1}get image(){return this._img}set image(e){var t;const n=null==(t=this._img)?void 0:t.src;n&&self.URL.revokeObjectURL(n),this._img=e}loadMediaAt(e){if(!this.hls)return;const t=e+this.timelineOffset;switch(this.nextLoadPosition=this.lastCurrentTime=t,this.startPosition=e,this.state){case ds:case Es:case ys:this.state=hs}if(this.state===hs){if(this.hls.resumeBuffering(),this.media||(this.media={}),this.tick(),this.state===hs){const t=this.getBufferedAt(e);t&&(this.fragCurrent=t,this.updateImage(t,null))}}else{const n=this.fragCurrent;(!n||e>=n.start&&e<n.end)&&(this.queued=[t])}}updateImage(e,t,n){const r=e.data;r||this.fragmentTracker.removeFragment(e);const s=this._img;if(s&&r){const i=self.performance.now();(t?t.stats:e.stats).buffering.start=e.stats.buffering.start=i,s.onload=()=>{if(!this.hls)return;const r=this.hls.levels[e.level];null!=r&&r.fragmentError&&(r.fragmentError=0,e.stats.retry=0);const s=self.performance.now(),i=t?t.stats:e.stats;i.buffering.end=e.stats.buffering.end=s,this.hls.trigger(l.FRAG_BUFFERED,{frag:e,part:t,stats:i,id:e.type,chunkMeta:n})},s.onerror=()=>{this.handleError("Image decode error",e,t,n)};const a=s.src;a&&self.URL.revokeObjectURL(a);const o=new Blob([r],{type:"image/jpeg"});s.src=self.URL.createObjectURL(o)}else this.state=ds,this.processQueued()}processQueued(){const e=this.queued;this.queued=void 0,e&&this.loadMediaAt.apply(this,e)}handleError(e,t,n,r){if(!this.hls)return;const s=new Error(e);this.hls.trigger(l.ERROR,{type:a.MEDIA_ERROR,details:o.FRAG_PARSING_ERROR,chunkMeta:r,frag:t,part:n,fatal:!1,error:s,err:s})}_bufferInitSegment(){}bufferFragmentData(e,t,n,r){super.bufferFragmentData(e,t,n,r,!0);const s=Be(new Uint8Array(e.data1),["mdat"]);if(0===s.length)return void this.handleError("Could not find I-Frame mdat",t,n,r);const i=t;this.cacheSet(i,s[0]),this.updateImage(i,n,r)}fragBufferedComplete(e,t){this.fragmentTracker.fragBuffered(e,!0),super.fragBufferedComplete(e,t),this.processQueued()}checkFragPlaying(){var e;const t=null==(e=this.fragPrevious)?void 0:e.start;if(void 0!==t){const e=this.getAppendedFrag(t);if(e&&!R(e,this.fragPlaying))return this.fragPlaying=e,!0}return!1}getMainFwdBufferInfo(){return{len:0,start:this.playhead,end:this.playhead,bufferedIndex:-1}}}const zl="Image I-Frame player does not accept HTMLMediaElements",Jl={seekOnAppend:!0};let Xl,Ql;const Zl=.025;let ec=function(e){return e[e.Point=0]="Point",e[e.Range=1]="Range",e}({});function tc(e,t,n){return`${e.identifier}-${n+1}-${pl(t)}`}class nc{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 sc(t,e)?rc(e,t):e}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-rc(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 sc(t,e)?rc(e,t):e}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)<Zl))}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"]?ec.Range:ec.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 rc(e,t){return e-t.start<t.duration/2&&!(Math.abs(e-(t.start+t.duration))<Zl)?t.start:t.start+t.duration}function sc(e,t){return t>e.start-Zl&&t<e.start+e.duration+Zl}function ic(e,t,n){const r=new self.URL(e,n);return"data:"!==r.protocol&&xt(r,"_HLS_primary_id",t),r}function ac(e,t){for(;null!=(n=e.assetList[++t])&&n.error;)var n;return t}function oc(e){const t=e.timelineStart,n=e.duration||0;return`["${e.identifier}" ${t.toFixed(2)}-${(t+n).toFixed(2)}]`}class lc{constructor(e,t,n,r){this.hls=void 0,this.interstitial=void 0,this.assetItem=void 0,this.tracks=null,this.hasDetail
1s=!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=ic(t,e.config.primarySessionId||"").href}catch(e){}e.loadSource(t)}}bufferedInPlaceToEnd(e,t){var n;if(!this.appendInPlace)return!1;if(null!=(n=this.hls)&&n.bufferedToEnd)return!0;if(!e)return!1;const r=Math.min(this._bufferedEosTime||1/0,this.duration),s=this.timelineOffset+(t||0),i=qn.bufferInfo(e,s,.02);return this.getAssetTime(i.end)>=r-.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=qn.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: ${oc(this.assetItem)} ${null==(e=this.hls)?void 0:e.sessionId} ${this.appendInPlace?"append-in-place":""}`}}const cc=.033;class uc extends q{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];t&&"primary"!==t&&(s=s[t]);const i=s.start,a=n[r].event,o=null!=a&&a.cue.pre?a.duration:s.end;if(e===i||e>i&&e<o)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,n=0){const r=e.main.details,{dateRanges:s}=r,i=this.events,a=this.parseDateRanges(s,{url:r.url},t),o=Object.keys(s),l=i?i.filter((e=>-1===o.indexOf(e.identifier))):[];a.length&&a.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=a,l.forEach((e=>{this.removeEvent(e)})),this.updateSchedule(e,l,n)}updateSchedule(e,t=[],n=0,r=!1){const s=this.events||[];
1if(s.length||t.length||this.length<2){const i=this.items,a=this.parseSchedule(s,e,n),o=r||t.length||(null==i?void 0:i.length)!==a.length||a.some(((e,t)=>Math.abs(e.playout.start-i[t].playout.start)>.005||Math.abs(e.playout.end-i[t].playout.end)>.005));o&&(this.items=a,this.onScheduleUpdate(t,i))}}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 nc(o,t),this.eventMap[a]=e,!1===n&&(e.appendInPlace=n)),r.push(e)}}return r}parseSchedule(e,t,n=0){const r=[],s=t.main.details,i=s.live?1/0:s.edge;let a=0;if((e=e.filter((e=>!(e.error||e.cue.once&&e.hasPlayed)))).length){this.resolveOffsets(e,t);let l=0,c=0;if(e.forEach(((t,o)=>{const u=t.cue.pre,d=t.cue.post,h=e[o-1]||null,f=t.appendInPlace,p=d?i:t.startOffset,g=t.duration,m=t.timelineOccupancy===ec.Range?g:0,_=u&&s.live?n+(t.resumeOffset||0):0,T=_||t.resumptionOffset,E=(null==h?void 0:h.startTime)===p,y=p+t.cumulativeDuration;let S=f?y+g:p+T;if(u||!d&&p<=0){const e=c;c+=m,t.timelineStart=y;const n=a;a+=g,r.push({event:t,start:y,end:S,playout:{start:n,end:a},integrated:{start:e,end:c}})}else{if(!(p<=i))return;{if(!E){const n=p-l;if(n>cc){const s=l,i=c;c+=n;const u=a;a+=n;const d={previousEvent:e[o-1]||null,nextEvent:t,start:s,end:s+n,playout:{start:u,end:a},integrated:{start:i,end:c}};r.push(d)}else n>0&&h&&(h.cumulativeDuration+=n,r[r.length-1].end=p)}d&&(S=y),t.timelineStart=y;const n=c;c+=m;const s=a;a+=g,r.push({event:t,start:y,end:S,playout:{start:s,end:a},integrated:{start:n,end:c}})}}const v=_||t.resumeTime;l=d||v>i?i:!u&&S&&t.appendInPlaceStarted&&v-S>cc?S:v})),l<i){var o;const e=l,t=c,n=i-l;c+=n;const s=a;a+=n,r.push({previousEvent:(null==(o=r[r.length-1])?void 0:o.event)||null,nextEvent:null,start:l,end:e+n,playout:{start:s,end:a},integrated:{start:t,end:c}})}this.setDurations(i,a,c)}else{const e=0;r.push({previousEvent:null,nextEvent:null,start:e,end:i,playout:{start:e,end:i},integrated:{start:e,end:i}}),this.setDurations(i,i,i)}return r}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=an(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<cc&&(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)>Zl)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=an(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)<Zl+o||Math.abs(a.end-n)<Zl+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 dc(e){return`[${e.event?'"'+e.event.identifier+'"':"primary"}: ${e.start.toFixed(2)}-${e.end.toFixed(2)}]`}class hc{constructor(e){this.hls=void 0,this.hls=e}destroy(){this.hls=null}loadAssetList(e,t){const n=e.assetListUrl;let r;try{r=ic(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&&xt(r,"_HLS_start_offset",""+t);const s=this.hls.config,i=new(0,s.loader)(s),a={type:E.INTERSTITIAL_ASSET_LIST,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
1RROR,details:t,fatal:!1,interstitial:e,url:r,error:n,networkDetails:i,stats:s}}}function fc(e){var t;null==e||null==(t=e.play())||t.catch((()=>{}))}function pc(e,t){return`[${e}] Advancing timeline position to ${t}`}class gc{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 mc={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},_c=e=>String.fromCharCode(mc[e]||e),Tc=15,Ec=42,yc={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},Sc={17:2,18:4,21:6,22:8,23:10,19:13,20:15},vc={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},bc={25:2,26:4,29:6,30:8,31:10,27:13,28:15},Ic=["white","green","blue","cyan","red","yellow","magenta","black","transparent"];class Ac{constructor(){this.time=null,this.verboseLevel=0}log(e,t){if(this.verboseLevel>=e){const n="function"==typeof t?t():t;Z.log(`${this.time} [${e}] ${n}`)}}}const Rc=function(e){const t=[];for(let n=0;n<e.length;n++)t.push(e[n].toString(16));return t},kc=Object.freeze({foreground:"white",underline:!1,italics:!1,background:"black",flash:!1});class Cc{constructor(){this.styles=kc}get foreground(){return this.styles.foreground}set foreground(e){const t=this.styles;this.styles={foreground:e,underline:t.underline,italics:t.italics,background:t.background,flash:t.flash}}get underline(){return this.styles.underline}set underline(e){const t=this.styles;this.styles={foreground:t.foreground,underline:e,italics:t.italics,background:t.background,flash:t.flash}}get italics(){return this.styles.italics}set italics(e){const t=this.styles;this.styles={foreground:t.foreground,underline:t.underline,italics:e,background:t.background,flash:t.flash}}get background(){return this.styles.background}set background(e){const t=this.styles;this.styles={foreground:t.foreground,underline:t.underline,italics:t.italics,background:e,flash:t.flash}}get flash(){return this.styles.flash}set flash(e){const t=this.styles;this.styles={foreground:t.foreground,underline:t.underline,italics:t.italics,background:t.background,flash:e}}reset(){this.styles=kc}setStyles(e){const t=this.styles,n=Object.prototype.hasOwnProperty;this.styles={foreground:n.call(e,"foreground")?e.foreground:t.foreground,underline:n.call(e,"underline")?e.underline:t.underline,italics:n.call(e,"italics")?e.italics:t.italics,background:n.call(e,"background")?e.background:t.background,flash:n.call(e,"flash")?e.flash:t.flash}}toString(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash}}class Lc{constructor(){this.uchar=" ",this.penState=new Cc}reset(){this.uchar=" ",this.penState.reset()}setChar(e,t){this.uchar=e,this.penState.styles=t.styles}setPenState(e){this.penState.styles=e.styles}copy(e){this.uchar=e.uchar,this.penState.styles=e.penState.styles}}class Oc{constructor(e){this.chars=[],this.pos=0,this.currPenState=new Cc,this.cueStartTime=null,this.logger=void 0;for(let e=0;e<Ec;e++)this.chars.push(new Lc);this.logger=e}equals(e){const t=this.chars,n=e.chars;for(let e=0;e<Ec;e++){const r=t[e],s=n[e];if(r.uchar!==s.uchar)return!1;const i=r.penState.styles,a=s.penState.styles;if(i!==a&&(i.foreground!==a.foreground||i.underline!==a.underline||i.italics!==a.italics||i.background!==a.background||i.flash!==a.flash))return!1}return!0}copy(e){for(let t=0;t<Ec;t++)this.chars[t].copy(e.chars[t])}isEmpty(){const e=this.chars;for(let t=0;t<Ec;t++){const n=e[t];if(" "!==n.uchar)return!1;const r=n.penState.styles;if(r!==kc&&("white"!==r.foreground||r.underline||r.italics||"black"!==r.background||r.flash))return!1}return!0}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>=Ec&&(this.logger.log(3,"Too large cursor position "+this.pos),this.pos=41)}moveCursor(e){const t=Math.min(this.pos+e,Ec);if(e>1)for(let e=this.pos+1;e<t;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=_c(e);this.pos>=Ec?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<Ec;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<Ec;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 Nc{constructor(e){this.rows=[],this.currRow=14,this.nrRollUpRows=null,this.lastOutputScreen=null,this.logger=void 0;for(let t=0;t<Tc;t++)this.rows.push(new Oc(e));this.logger=e}reset(){for(let e=0;e<Tc;e++)this.rows[e].clear();this.currRow=14}equals(e){let t=!0;for(let n=0;n<Tc;n++)if(!this.rows[n].equals(e.rows[n])){t=!1;break}return t}copy(e){for(let t=0;t<Tc;t++){const n=this.rows[t].chars,r=e.rows[t].chars;for(let e=0;e<Ec;e++){const t=n[e],s=r[e];t.uchar=s.uchar,t.penState.styles=s.penState.styles}}}isEmpty(){let e=!0;for(let t=0;t<Tc;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 = "+qt(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<Tc;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 = "+qt(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<Tc;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 wc{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 Nc(n),this.nonDisplayedMemory=new Nc(n),this.lastOutputScreen=new Nc(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})}
1ccRDC(){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: "+qt(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 Pc{constructor(e,t,n){this.channels=[null,null,null],this.currentChannel=0,this.cmdHistory={a:null,b:null},this.logger=void 0,this.field=void 0,this.outputFilters=void 0,this.logger=new Ac,this.field=e,this.outputFilters=[null,t,n]}getHandler(e){return this.outputFilters[e]}setHandler(e,t){var n;this.outputFilters[e]=t,null==(n=this.channels[e])||n.setHandler(t)}getChannel(e){let t=this.channels[e];return t||(t=this.channels[e]=new wc(this.field+e-1,this.outputFilters[e],this.logger)),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,(()=>"["+Rc([t[e],t[e+1]])+"] -> ("+Rc([n,r])+")"));const a=this.cmdHistory;if(n>=16&&n<=31){if(Dc(n,r,a)){Mc(null,null,a),this.logger.log(3,(()=>"Repeated command ("+Rc([n,r])+") is dropped"));continue}Mc(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 Mc(null,null,a);if(!s&&(i=this.parseChars(n,r),i)){const e=this.currentChannel;if(e&&e>0){this.getChannel(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 "+Rc([n,r])+" orig: "+Rc([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.getChannel(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 ("+Rc([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?yc[e]:vc[e]:1===r?Sc[e]:bc[e];return this.getChannel(r).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>
195?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 '"+_c(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 = "+Rc(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=Ic[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.getChannel(s).setBkgData(r),!0}reset(){for(let e=0;e<Object.keys(this.channels).length;e++){const t=this.channels[e];t&&t.reset()}Mc(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 Mc(e,t,n){n.a=e,n.b=t}function Dc(e,t,n){return n.a===e&&n.b===t}class xc{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}}const Uc=/\s/,Bc={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++)Uc.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=hl(c.trim()),f=_l(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: 10,496 bytes, line 1
18?t.line-e.line:e.line-t.line)),s.forEach((t=>wl(e,t)))),s}};class Fc{constructor(){this.requestTimeout=void 0,this.retryTimeout=void 0,this.retryDelay=0,this.config=null,this.callbacks=null,this.context=null,this.stats=new T}destroy(){this.callbacks=this.context=this.config=null,this.abortInternal(),this.stats=null}load(e,t,n){const r=this.stats;if(r.loading.start)throw new Error("Loader can only be used once.");r.loading.start=self.performance.now(),this.context=e,this.config=t,this.callbacks=n,this.loadInternal()}abort(){var e;this.abortInternal(),null!=(e=this.callbacks)&&e.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.getNetworkDetails())}loadtimeout(){if(!this.config)return;const e=this.config.loadPolicy.timeoutRetry;if(H(e,this.stats.retry,!0))this.retry(e);else{var t;Z.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.getNetworkDetails()))}}retry(e){const{context:t,stats:n}=this;this.retryDelay=$(e,n.retry),n.retry++,Z.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.resetInternalLoader(),self.clearTimeout(this.retryTimeout),this.retryTimeout=self.setTimeout((()=>this.loadInternal()),this.retryDelay)}}const $c=/(\d+)-(\d+)\/(\d+)/;class Gc extends Fc{constructor(e){super(),this.fetchSetup=void 0,this.request=null,this.response=null,this.controller=null,this.fetchSetup=e.fetchSetup||Hc}destroy(){this.request=null,super.destroy(),this.response=null,this.controller=null,this.fetchSetup=null}abortInternal(){self.clearTimeout(this.retryTimeout),this.controller&&!this.stats.loading.end&&(this.stats.aborted=!0,this.controller.abort())}getNetworkDetails(){return this.response}resetInternalLoader(){this.response=null}loadInternal(){const{config:e,context:t,stats:n}=this;if(!e||!t)return;n.loading.first=0,n.loaded=0,n.aborted=!1,this.controller=new self.AbortController;const s=function(e,t){const n={method:"GET",mode:"cors",credentials:"same-origin",signal:t,headers:new self.Headers(w({},e.headers))};e.rangeEnd&&n.headers.set("Range","bytes="+e.rangeStart+"-"+String(e.rangeEnd-1));return n}(t,this.controller.signal),i="arraybuffer"===t.responseType,a=i?"byteLength":"length",{maxTimeToFirstByteMs:o,maxLoadTimeMs:l}=e.loadPolicy;this.request=this.fetchSetup(t,s),self.clearTimeout(this.requestTimeout),e.timeout=o&&r(o)?o:l,this.requestTimeout=self.setTimeout((()=>{this.loadtimeout()}),e.timeout);(Ki(this.request)?this.request.then(self.fetch):self.fetch(this.request)).then((s=>{var a;this.response=s;const o=Math.max(self.performance.now(),n.loading.start);if(self.clearTimeout(this.requestTimeout),e.timeout=l,this.requestTimeout=self.setTimeout((()=>{this.loadtimeout()}),l-(o-n.loading.start)),!s.ok){const{status:e,statusText:t}=s;throw new jc(t||"fetch, bad network response",e,s)}n.loading.first=o,n.total=function(e){const t=e.get("Content-Range");if(t){const e=function(e){const t=$c.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)}(s.headers)||n.total;const c=null==(a=this.callbacks)?void 0:a.onProgress;return c&&r(e.highWaterMark)?this.loadProgressively(s,n,t,e.highWaterMark,c):i?s.arrayBuffer():"json"===t.responseType?s.json():s.text()})).then((s=>{var i,o;const l=this.response;if(!l)throw new Error("loader destroyed");self.clearTimeout(this.requestTimeout),n.loading.end=Math.max(self.performance.now(),n.loading.first);const c=s[a];c&&(n.loaded=n.total=c);const u={url:l.url,data:s,code:l.status},d=null==(i=this.callbacks)?void 0:i.onProgress;d&&!r(e.highWaterMark)&&d(n,t,s,l),null==(o=this.callbacks)||o.onSuccess(u,n,t,l)})).catch((r=>{if(self.clearTimeout(this.requestTimeout),n.aborted)return;const s=r&&r.code||0,i=r?r.message:null,a=e.loadPolicy.errorRetry;var o;H(a,n.retry,!1,{url:t.url,data:void 0,code:s})?this.retry(a):(Z.error(`${s} while loading ${t.url}`),null==(o=this.callbacks)||o.onError({code:s,text:i},t,r?r.details:null,n))}))}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 Rs,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 Hc(e,t){return new self.Request(e.url,t)}class jc extends Error{constructor(e,t,n){super(e),this.code=void 0,this.details=void 0,this.code=t,this.details=n}}const Wc=/^age:\s*[\d.]+\s*$/im;class Vc extends Fc{constructor(e){super(),this.xhrSetup=void 0,this.loader=null,this.xhrSetup=e.xhrSetup||null}destroy(){super.destroy(),this.loader=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()))}getNetworkDetails(){return this.loader}resetInternalLoader(){this.loader=null}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.call(this,n,t.url,t)})).catch((e=>{if(this.loader===n&&!this.stats.aborted)return n.open("GET",t.url,!0),s.call(this,n,t.url,t)})).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 e.rangeEnd&&o!==e.rangeEnd-e.rangeStart&&Z.warn(`Payload length ${o} does not match requested Range: bytes=${e.rangeStart}-${e.rangeEnd-1}`),void(null==(a=this.callbacks)||a.onSuccess(c,n,e,t))}}const c=s.loadPolicy.errorRetry;var o;if(H(c,n.retry,!1,{url:e.url,data:void 0,code:r}))this.retry(c);else Z.error(`${r} while loading ${e.url}`),null==(o=this.callbacks)||o.onError({code:r,text:t.statusText},e,t,n)}}loadprogress(e){const t=this.stats;t.loaded=e.loaded,e.lengthComputable&&(t.total=e.total)}getCacheAge(){let e=null;if(this.loader&&Wc.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 Kc=M(M({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,ignoreDevicePixelRatio:!1,maxDevicePixelRatio:Number.POSITIVE_INFINITY,preferManagedMediaSource:!1,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:1/0,frontBufferFlushThreshold:1/0,loopBackBufferFlush:void 0,startOnSegmentBoundary:!1,nextAudioTrackBufferFlushForwardOffset:.25,maxBufferSize:6e7,maxFragLookUpTolerance:.25,maxBufferHole:.1,detectStallWithCurrentTimeMs:1250,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,nudgeOnVideoHole:!0,skipBufferHolePadding:.1,liveSyncMode:"edge",liveSyncDurationCount:3,liveSyncOnStallIncrease:1,liveMaxLatencyDurationCount:1/0,liveMaxUnchangedPlaylistRefresh: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,appendTimeout:1/0,ignorePlaylistParsingErrors:!1,loader:Vc,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,stretchShortVideoTrack:!1,maxAudioFramesDrift:1,forceKeyFrameOnDiscontinuity:!0,handleMpegTsVideoIntegrityErrors:"process",abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrEwmaDefaultEstimateMax:5e6,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,abrSwitchInterval:0,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0,emeEnabled:!1,widevineLicenseUrl:void 0,drmSystems:{},drmSystemOptions:{},requestMediaKeySystemAccessFunc:vr,requireKeySystemAccessOnStart:!1,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0,enableDateRangeMetadataCues:!0,enableEmsgMetadataCues:!0,enableEmsgKLVMetadata:!1,enableID3MetadataCues:!0,emsgKLVSchemaUri:void 0,enableInterstitialPlayback:!0,interstitialAppendInPlace:!0,interstitialLiveLookAhead:10,iframeCacheLimit:2097152,useMediaCapabilities:!0,preserveManualLevelOnError:!1,errorPenaltyExpireMs:0,certLoa
1dPolicy:{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,streamController:Kl,abrController:class extends q{constructor(e){super("abr",e.logger),this.hls=void 0,this.lastLevelLoadSec=0,this.lastLoadedFragLevel=-1,this.firstSelection=-1,this.firstAutoFloor=-1,this._nextAutoLevel=-1,this.nextAutoLevelKey="",this.audioTracksByGroup=null,this.co
vendor: 8,466 bytes, line 1
1decTiers=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;if(!i)return;const{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],k=Math.max(u.loaded,Math.round(d*(n.bitrate||R.averageBitrate)/8));let C=b?h-v:h;C<1&&b&&(C=Math.min(h,8*u.loaded/I));const L=b?1e3*u.loaded/C:0,O=E/1e3,N=L?(k-u.loaded)/L:8*k/I+O;if(N<=S)return;const w=L?8*L:I,P=!0===(null==(t=(null==e?void 0:e.details)||i.latestLevelDetails)?void 0:t.live),M=i.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.firstAutoFloor=Math.min(D,i.firstLevel),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=()=>{this.clearTimer();const e=this.hls;if(this.fragCurrent===n&&e.loadLevel===D&&D>0){const t=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: ${t.toFixed(3)} s`),n.abortRequests(),this.fragCurrent=this.partCurrent=null,D>f){let n=this.findBestLevel(e.levels[f].bitrate,f,D,0,t,1,1);-1===n&&(n=f),e.nextLoadLevel=e.nextAutoLevel=n,this.firstAutoFloor=Math.min(n,e.firstLevel),this.resetEstimator(e.levels[n].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){this.hls&&(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 K(e.abrEwmaSlowVoD,e.abrEwmaFastVoD,e.abrEwmaDefaultEstimate)}registerListeners(){const e=this.hls;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.audioTracksByGroup=this.codecTiers=this.fragCurrent=this.partCurrent=null}onManifestLoading(e,t){this.lastLoadedFragLevel=-1,this.firstSelection=-1,this.firstAutoFloor=-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&&k(e,n)){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,t){var n;const{frag:r,part:s}=t,i=s?s.stats:r.stats;if(r.type===y.MAIN&&this.bwEstimator.sampleTTFB(i.loading.first-i.loading.start),!this.ignoreFragment(r)){if(this.clearTimer(),r.level===this._nextAutoLevel&&(this._nextAutoLevel=-1),this.firstSelection=-1,null!=(n=this.hls)&&n.config.abrMaxWithRealBitrate){const e=s?s.duration:r.duration,t=this.hls.levels[r.level],n=(t.loaded?t.loaded.bytes:0)+i.loaded,a=(t.loaded?t.loaded.duration:0)+e;t.loaded={bytes:n,duration:a},t.realBitrate=Math.round(8*n/a)}if(r.bitrateTest){const e={stats:i,frag:r,part:s,id:r.type};this.onFragBuffered(l.FRAG_BUFFERED,e),r.bitrateTest=!1}else this.lastLoadedFragLevel=r.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=((n.bitrate||0)>=1e5?s.parsing.end:s.loading.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,this.firstAutoFloor>-1&&this.bwEstimator.canEstimate()&&(this.firstAutoFloor=-1))}ignoreFragment(e){return e.type!==y.MAIN||"initSegment"===e.sn}clearTimer(){this.timer>-1&&(self.clearInterval(this.timer),this.timer=-1)}get firstAutoLevel(){const{hls:e}=this;if(!e)return 0;const{maxAutoLevel:t,minAutoLevel:n}=e,r=this.getBwEstimate(),s=this.getStarvationDelay(),i=e.config.maxStarvationDelay,a=this.findBestLevel(r,n,t,s/2,i,1,1);if(a>-1)return a;const o=e.firstLevel,l=-1===this.firstAutoFloor?1/0:this.firstAutoFloor,c=Math.min(Math.max(o,n),t,l);return this.warn(`Could not find best starting auto level. Defaulting to first in playlist ${o} clamped to ${c}`),c}get forcedAutoLevel(){return this.nextAutoLevelKey?-1:this._nextAutoLevel}get nextAutoLevel(){if(!this.hls)return-1;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)return-1;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=null==e?void 0: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.getEstimate()}findBestLevel(e,t,n,s,i,a,o){const{hls:l,lastLoadedFragLevel:c,fragCurrent:u,partCurrent:d}=this;if(!l)return-1;const h=s+i,f=-1===c?l.firstLevel:c,{levels:p,allAudioTracks:g,loadLevel:m,latestLevelDetails:_,config:T}=l;if(1===p.length)return 0;const E=p[f],y=!(null==_||!_.live),S=-1===m||-1===c;let v,b="SDR",I=(null==E?void 0:E.frameRate)||0;const{audioPreference:A,videoPreference:R}=T,k=this.audioTracksByGroup||(this.audioTracksByGroup=zt(g));let C=-1;if(S){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,k,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}=Kt(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 Yt(r,`min bitrate of ${s.minBitrate} > current estimate of ${n}`),t;if(!s.hasDefaultAudio)return Yt(r,"no renditions with default or auto-select sound found"),t;if(l&&r.indexOf(l.substring(0,4))%5!=0)return Yt(r,`audio codec preference "${l}" not found`),t;if(o&&!u){if(!s.channels[o])return Yt(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 Yt(r,"no renditions with stereo sound found"),t;if(s.minHeight>S)return Yt(r,`min resolution of ${s.minHeight} > maximum of ${S}`),t;if(s.minFramerate>v)return Yt(r,`min framerate of ${s.minFramerate} > maximum of ${v}`),t;if(!T.some((e=>s.videoRanges[e]>0)))return Yt(r,`no variants with VIDEO-RANGE of ${qt(T)} found`),t;if(c&&r.indexOf(c.substring(0,4))%5!=0)return Yt(r,`video codec preference "${c}" not found`),t;if(s.maxScore<_)return Yt(r,`max score of ${s.maxScore} < selected max of ${_}`),t}return t&&(yt(r)>=yt(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}}
vendor: 3,822 bytes, line 1
1(s,b,e,A,R),{codecSet:a,videoRanges:o,minFramerate:l,minBitrate:c,minIndex:u,preferHDR:d}=i;C=u,v=a,b=d?o[o.length-1]:o[0],I=l,e=Math.max(e,c),this.log(`picked start tier ${qt(i)}`)}else v=null==E?void 0:E.codecSet,b=null==E?void 0:E.videoRange;const L=d?d.duration:u?u.duration:0,O=this.bwEstimator.getEstimateTTFB()/1e3,N=[];for(let l=n;l>=t;l--){var w;const t=p[l],u=l>f;if(!t)continue;if(T.useMediaCapabilities&&!t.supportedResult&&!t.supportedPromise){const n=navigator.mediaCapabilities;"function"==typeof(null==n?void 0:n.decodingInfo)&&wt(t,k,b,I,e,A)?(t.supportedPromise=Pt(t,k,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} ${qt(e)}`):e.supported?e.decodingInfoResults.some((e=>!1===e.smooth||!1===e.powerEfficient))&&this.log(`MediaCapabilities decodingInfo for level ${r} not smooth or powerEfficient: ${qt(e)}`):(this.warn(`Unsupported MediaCapabilities decodingInfo result for level ${r} ${qt(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=Ot}if((v&&t.codecSet!==v||b&&t.videoRange!==b||u&&I>t.frameRate||!u&&I>0&&I<t.frameRate||null!=(w=t.supportedResult)&&null!=(w=w.decodingInfoResults)&&w.some((e=>!1===e.smooth)))&&(!S||l!==C)){N.push(l);continue}const g=t.details,_=(d?null==g?void 0:g.partTarget:null==g?void 0:g.averagetargetduration)||L||1;let E;E=u?o*e:a*e;const R=L&&s>=2*L&&0===i?t.averageBitrate:t.maxBitrate,P=this.getTimeToLoadFrag(O,E,R*_,!g||g.live);if(E>=R&&(l===c||0===t.loadError&&0===t.fragmentError||W(t,T.errorPenaltyExpireMs))&&(P<=O||!r(P)||y&&!this.bitrateTestDelay||P<h)){const e=this.forcedAutoLevel;return l===m||-1!==e&&e===m||(N.length&&this.trace(`Skipped level(s) ${N.join(",")} of ${n} max with CODECS and VIDEO-RANGE:"${p[N[0]].codecs}" ${p[N[0]].videoRange}; not compatible with "${v}" ${b}`),this.info(`switch candidate:${f}->${l} adjustedbw(${Math.round(E)})-bitrate=${Math.round(E-R)} ttfb:${O.toFixed(1)} avgDuration:${_.toFixed(1)} maxFetchDuration:${h.toFixed(1)} fetchDuration:${P.toFixed(1)} firstSelection:${S} codecSet:${t.codecSet} videoRange:${t.videoRange} hls.loadLevel:${m}`)),S&&(this.firstSelection=l),l}}return-1}set nextAutoLevel(e){const t=this.deriveNextAutoLevel(e);this._nextAutoLevel!==t&&(this.nextAutoLevelKey="",this._nextAutoLevel=t)}deriveNextAutoLevel(e){if(!this.hls)return-1;const{maxAutoLevel:t,minAutoLevel:n}=this.hls;return Math.min(Math.max(e,n),t)}},bufferController:class extends q{constructor(e,t){var n;super("buffer-controller",e.logger),this.hls=void 0,this.fragmentTracker=void 0,this.fragmentAppendProgress=Object.create(null),this.appendsWithoutProgress=Object.create(null),this.details=null,this._objectUrl=null,this.operationQueue=null,this.bufferCodecEventsTotal=0,this.media=null,this.mediaSource=null,this.lastMpegAudioChunk=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.appendError=void 0,this._quotaEvictionPending={},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.media&&!this.media.seeking&&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&&(cs(n,"sourceopen",this._onMediaSourceOpen),cs(t,"emptied",this._onMediaEmptied),this.updateDuration(),this.hls.trigger(l.MEDIA_ATTA
vendor: 5,511 bytes, line 1
1CHED,{media:t,mediaSource:n}),null!==this.mediaSource&&this.checkPendingTracks())},this._onMediaSourceClose=()=>{if(this.log("Media source closed"),this.media){const e=this.media.error,{appendError:t,appendErrors:n}=this;let r=!1;if(!t&&e){r=Math.max(++n.audio,++n.video,++n.audiovideo)>=this.hls.config.appendErrorMaxRetry}const s=new Error(`MediaSource closed while media attached${aa(r,e)}`);this.warn(s),this.hls.trigger(l.ERROR,w({fatal:r},t,{type:a.MEDIA_ERROR,details:o.MEDIA_SOURCE_REQUIRES_RESET,error:s}))}},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._onMediaError=()=>{const{media:e}=this;var t,n;e&&this.log(`Media error (code: ${null==(t=e.error)?void 0:t.code}): ${null==(n=e.error)?void 0:n.message}`)},this.hls=e,this.fragmentTracker=t,this.appendSource=(n=ee(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=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,this._onMediaEmptied=this._onMediaError=null}registerListeners(){const{hls:e}=this;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_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 r&&!this.sourceBufferCount&&r.mediaSource===t?w(n,r.tracks):this.sourceBuffers.forEach((e=>{const[t]=e;t&&(n[t]=w({},this.tracks[t]),this.removeBuffer(t)),e[0]=e[1]=null})),{media:e,mediaSource:t,tracks:n}}initTracks(){this.resetAppendProgress(),this.sourceBuffers=[[null,null],[null,null]],this.tracks={},this.resetQueue(),this.lastMpegAudioChunk=null,this.lastVideoAppendEnd=0}onManifestLoading(){this.bufferCodecEventsTotal=0,this.details=null,this.resetAppendErrors(),this.resetAppendProgress()}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=ee(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,sa(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}ls(n,"emptied",this._onMediaEmptied),ls(n,"error",this._onMediaError),this.appendSource&&ls(n,"seeking",this._onStartStreaming)}}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}`),ls(e,"sourceopen",this._onMediaSourceOpen),ls(e,"sourceended",this._onMediaSourceEnded),ls(e,"sourceclose",this._onMediaSourceClose),this.appendSource&&(ls(e,"startstreaming",this._onStartStreaming),ls(e,"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()}))};
vendor: 7,568 bytes, line 1
1if(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: ${qt(n,((e,t)=>"initSegment"===e?void 0:t))};\ntransfer tracks: ${qt(r,((e,t)=>"initSegment"===e?void 0:t))}}`),!te(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=qn.getBuffered(e);r.detectEvictedFragments(t,n,s,null,null,!0)}const i=ia(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()}cs(s,"sourceopen",this._onMediaSourceOpen),cs(s,"sourceended",this._onMediaSourceEnded),cs(s,"sourceclose",this._onMediaSourceClose),this.appendSource&&(cs(s,"startstreaming",this._onStartStreaming),cs(s,"endstreaming",this._onEndStreaming)),this.mediaSource=null,this._objectUrl=null}r&&(cs(r,"emptied",this._onMediaEmptied),cs(r,"error",this._onMediaError),cs(r,"seeking",this._onStartStreaming),n||(i&&self.URL.revokeObjectURL(i),this.mediaSrc===i?(r.removeAttribute("src"),this.appendSource&&sa(r),r.load()):this.warn("media|source.src was changed by a third party - skip cleanup")),this.media=null)}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[ia(e)]=[null,null];const t=this.tracks[e];t&&(this.clearBufferAppendTimeoutId(t),t.buffer=void 0)}resetQueue(){this.operationQueue&&this.operationQueue.destroy(),this.operationQueue=new ea(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 _=It(g,m),T=null==_?void 0:_.replace(ta,"$1");let E=It(o,l);const y=null==(s=E)?void 0:s.replace(ta,"$1");E&&_&&T!==y&&("audio"===e.slice(0,5)&&(E=bt(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,y.MAIN))?void 0:t.gap))return;const s={label:"block-audio",execute:()=>{var e,t;(this.lastVideoAppendEnd>r||qn.isBuffered(null==(e=this.tracks.video)?void 0:e.buffer,r)||!0===(null==(t=this.fragmentTracker.getAppendedFrag(r,y.MAIN))?void 0:t.gap))&&this.unblockAudio()},onStart:()=>{},onComplete:()=>{},onError:e=>{this.warn("Error executing block-audio operation",e)}};this.append(s,"audio",!0)}unblockAudio(){this.operationQueue&&this.operationQueue.unblockAudio()}onBufferAppending(e,t){const{tracks:n}=this,{data:s,type:i,parent:c,frag:u,part:d,chunkMeta:h,offset:f}=t,p=h.buffering[i],g=A(u)&&!d&&!u.gap&&!h.partial&&!h.iframe;let m=null,_=!1;const{sn:T,cc:E}=u,y=self.performance.now();p.start=y;const S=u.stats.buffering,v=d?d.stats.buffering:null;0===S.start&&(S.start=y),0===(null==v?void 0:v.start)&&(v.start=y);const b=n.audio;let I=!1;"audio"===i&&"audio/mpeg"===(null==b?void 0:b.container)&&(I=!this.lastMpegAudioChunk||1===h.id||this.lastMpegAudioChunk.sn!==h.sn,this.lastMpegAudioChunk=h);const R=n.video,k=null==R?void 0:R.buffer;if(k&&"initSegment"!==T&&void 0!==f){const e=null==b?void 0:b.buffer,t=d||u;if("audio"===i&&"main"!==c&&!R.ending&&!R.ended&&e&&qn.getBuffered(e).length){const e=t.start+.05*t.duration,n=qn.getBuffered(k),r=this.currentOp("video");n.length||r?!qn.isBuffered(k,e)&&this.lastVideoAppendEnd<e&&this.blockAudio(t):this.blockAudio(t)}else if("video"===i){const e=t.end,n=this.lastVideoAppendEnd-e;this.lastVideoAppendEnd=e,n<0||n>t.duration?this.unblockAudio():this.isAudioBlocked()&&this.executeNext("audio")}}const C=(d||u).start,L={label:`append-${i}`,execute:()=>{var e;p.executeStart=self.performance.now();const t=null==(e=this.tracks[i])?void 0:e.buffer;t&&(g&&(m=qn.timeRangesToArray(qn.getBuffered(t)),_=ca(la(m,u),u)),I?this.updateTimestampOffset(t,C,.1,i,T,E):void 0!==f&&r(f)&&this.updateTimestampOffset(t,f,1e-6,i,T,E)),this.appendExecutor(s,i)},onStart:()=>{},onComplete:()=>{this.clearBufferAppendTimeoutId(this.tracks[i]);const e=self.performance.now();p.executeEnd=p.end=e,0===S.first&&(S.first=e),0===(null==v?void 0:v.first)&&(v.first=e);const t={};
vendor: 22,775 bytes, line 1
1if(this.sourceBuffers.forEach((([e,n])=>{e&&(t[e]=qn.getBuffered(n))})),g){const e=this.getFragmentAppendProgress(u),n=t[i];if(n&&m){const t=la(qn.timeRangesToArray(n),u);e.progressed||(e.progressed=t-la(m,u)>.001);const r=_&&ca(t,u);e.fullyBuffered[i]=(void 0===e.fullyBuffered[i]||e.fullyBuffered[i])&&r}}this.hls.trigger(l.BUFFER_APPENDED,{type:i,frag:u,part:d,chunkMeta:h,parent:c,timeRanges:t})},onError:e=>{var t;this.clearBufferAppendTimeoutId(this.tracks[i]);const n=e.code===DOMException.QUOTA_EXCEEDED_ERR||"QuotaExceededError"==e.name||"quota"in e;if(n&&!this._quotaEvictionPending[i]){const e=this.getBackBufferEvictionTarget(i,s.byteLength,u.type);if(e>0){this._quotaEvictionPending[i]=!0,this.log(`QuotaExceededError on "${i}" append sn: ${T} - evicting back buffer to ${e.toFixed(3)}s and retrying`);const t=this.getFlushOp(i,0,e),n=this.getClearEvictionPendingOp(i);return void this.insertNext([t,L,n],i)}this.warn(`QuotaExceededError on "${i}" sn: ${T} - no back buffer available to evict`)}g&&(this.getFragmentAppendProgress(u).errored=!0);const r={type:a.MEDIA_ERROR,parent:c,details:o.BUFFER_APPEND_ERROR,sourceBufferName:i,frag:u,part:d,chunkMeta:h,error:e,err:e,fatal:!1},f=null==(t=this.media)?void 0:t.error;if(e.name!==na||0!==this.sourceBufferCount||this.media&&0!==this.pendingTrackCount){var p;n&&(r.details=o.BUFFER_FULL_ERROR);const t=++this.appendErrors[i],s=this.hls.config.appendErrorMaxRetry;this.warn(`Failed ${t}/${s+1} times to append segment in "${i}" sourceBuffer with error: ${e.message}`),t>=s&&(r.fatal=!n);const a=null==(p=this.mediaSource)?void 0:p.readyState;("ended"===a||"closed"===a||f)&&(this.warn(`MediaSource readyState "${a}" during SourceBuffer${aa(r.fatal,f)}`),r.details=o.MEDIA_SOURCE_REQUIRES_RESET)}else r.errorAction=bn(!0);this.appendError=r,this.hls.trigger(l.ERROR,r),n&&this.hls&&this.trimBuffers(u.start,1)}};this.log(`queuing "${i}" append sn: ${T}${d?" p: "+d.index:""} of ${c} playlist ${u.level} cc: ${E} offset: ${f} bytes: ${s.byteLength}`),this.append(L,i,this.isPending(this.tracks[i]))}getClearEvictionPendingOp(e){return{label:"clear",execute:()=>{this._quotaEvictionPending[e]=!1,this.shiftAndExecuteNext(e)},onStart:()=>{},onComplete:()=>{},onError:()=>{}}}getFlushOp(e,t,n){return this.log(`queuing "${e}" remove ${t}-${n}`),{label:"remove",execute:()=>{this.removeExecutor(e,t,n)},onStart:()=>{},onComplete:()=>{var r;const s=null==(r=this.tracks[e])?void 0:r.buffer;this.log(`Remove request ${t}-${n} from ${e} Source Buffer complete > buffer: ${s?us(qn.getBuffered(s)):"(detached)"}`),this.hls.trigger(l.BUFFER_FLUSHED,{type:e,start:t,end:n})},onError:r=>{this.warn(`Failed to remove ${t}-${n} from "${e}" SourceBuffer`,r),this.hls.trigger(l.BUFFER_FLUSHED,{type:e,start:0,end:0,error:r})}}}onBufferFlushing(e,t){const{type:n,startOffset:r,endOffset:s}=t;n&&"audio"!==n||this.unblockAudio(),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,chunkMeta:s}=t,i=[],a=r?r.elementaryStreams:n.elementaryStreams;a[b]?i.push("audiovideo"):(a[S]&&i.push("audio"),a[v]&&i.push("video"));0===i.length&&this.log(`Fragments must have at least one ElementaryStreamType set. ${n.type} ${n.level} ${r?`part: ${r.index} of `:""}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.checkAppendProgress(n,r,s,i),this.hls&&(this.hls.trigger(l.FRAG_BUFFERED,{frag:n,part:r,stats:t,id:n.type,chunkMeta:s}),!r&&n.gap&&t.retry&&this.log(`Nothing buffered for ${n.type} level: ${n.level} sn: ${n.sn} retries ${t.retry}`))}),i).catch((e=>{this.warn(`Fragment buffered callback ${e.message}`),this.stepOperationQueue(this.sourceBufferTypes)}))}onFragChanged(e,t){var n,r;const s=null==(n=this.hls)?void 0:n.config;if(!s)return;const{backBufferLength:i,frontBufferFlushThreshold:a}=s;this.trimBuffers(a,i,t.frag,t.previousFrag);const o=t.frag.elementaryStreams,{appendErrors:l}=this,c=null==(r=this.appendError)?void 0:r.sourceBufferName;Object.keys(o).forEach((e=>{o[e]&&(l[e]=0,e===c&&(this.appendError=void 0),"audio"===e||"video"===e?(l.audiovideo=0,"audiovideo"===c&&(this.appendError=void 0)):(l.audio=0,l.video=0,"audiovideo"!==c&&(this.appendError=void 0)))}))}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)}))?(this.unblockAudio(),r?(this.log("Queueing EOS"),this.blockUntilOpen((()=>{this.tracksEnded();const{mediaSource:e}=this;"open"===(null==e?void 0: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()}}getBackBufferEvictionTarget(e,t,n){const{media:r}=this;return r?this.fragmentTracker.getBackBufferEvictionEnd(r.currentTime,n,t):0}getFragmentAppendProgress(e){var t;const n=oa(e);let r=this.fragmentAppendProgress[n];return(null==(t=r)?void 0:t.stats)!==e.stats&&(r={stats:e.stats,progressed:!1,errored:!1,fullyBuffered:Object.create(null)},this.fragmentAppendProgress[n]=r),r}checkAppendProgress(e,t,n,r){if(t||!A(e)||e.gap||n.iframe||n.partial)return;const s=oa(e),i=this.fragmentAppendProgress[s];delete this.fragmentAppendProgress[s];const c=e.stats.buffering;if(c.start&&!c.first)return;const u=(null==i?void 0:i.stats)===e.stats?i:void 0;if(null!=u&&u.errored)return;const d=r.length>0&&r.every((e=>!0===(null==u?void 0:u.fullyBuffered[e])));if(null!=u&&u.progressed||d)return void delete this.appendsWithoutProgress[s];if(!u&&0===r.length)return;const h=(this.appendsWithoutProgress[s]||0)+1,f=this.hls;h>=f.config.appendErrorMaxRetry?delete this.appendsWithoutProgress[s]:this.appendsWithoutProgress[s]=h,this.warn(`Fragment ${e.sn} of ${e.type} playlist ${e.level} appended ${h} time${h>1?"s":""} without buffered range growth`),f.trigger(l.ERROR,{type:a.MEDIA_ERROR,details:o.BUFFER_APPEND_NO_PROGRESS,fatal:!1,frag:e,chunkMeta:n,parent:e.type,appendsWithoutProgress:h,error:new Error(`Fragment append did not increase buffered coverage (${h})`)})}resetAppendProgress(){this.fragmentAppendProgress=Object.create(null),this.appendsWithoutProgress=Object.create(null)}resetAppendErrors(){this.appendErrors={audio:0,video:0,audiovideo:0},this.appendError=void 0}trimBuffers(e,t,n,s){const{hls:i,details:a,media:o}=this;if(!o||null===a)return;if(!this.sourceBufferCount)return;const l=i.config,c=o.currentTime,u=a.levelTargetDuration;t=a.live&&null!==l.liveBackBufferLength?l.liveBackBufferLength:t;let d=-1/0;if(r(t)&&t>=0){const e=Math.max(t,u);d=Math.floor(c/u)*u-e}if(n){const e=this.getLoopBackBufferFlushEnd(n,null!=s?s:null);e>0&&(d=Math.max(d,e))}if(d>0&&this.flushBackBuffer(c,u,d),r(e)&&e>0){const t=Math.max(l.maxBufferLength,e),n=Math.max(t,u),r=Math.floor(c/u)*u+n;this.flushFrontBuffer(c,u,r)}}getLoopBackBufferFlushEnd(e,t){var n;const{media:r}=this;if(!1===(null==(n=this.hls)?void 0:n.config.loopBackBufferFlush)||null==r||!r.loop||!t||e.level<=t.level)return 0;const{video:s,audiovideo:i}=e.elementaryStreams;if(null!=s&&s.partial||null!=i&&i.partial)return 0;const a=this.getEarliestElementaryStreamStart(e)-.25;return a<=0?0:(this.log(`Flushing lower quality back buffer for loop: level ${e.level}, range [0-${a.toFixed(3)}]`),a)}getEarliestElementaryStreamStart(e){const{audio:t,video:n,audiovideo:r}=e.elementaryStreams;let s=e.start;return r?s=Math.min(s,r.startDTS):(t&&(s=Math.min(s,t.startDTS)),n&&(s=Math.min(s,n.startDTS))),s}flushBackBuffer(e,t,n){this.sourceBuffers.forEach((([e,t])=>{if(t){const a=qn.getBuffered(t);if(a.length>0&&n>a.start(0)){var r,s,i;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&&(null==(s=this.media)||!s.loop||!1===(null==(i=this.hls)?void 0:i.config.loopBackBufferFlush)))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=qn.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;s&&this.media&&"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}) ${qt(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":""} ${qt(c)}`);try{const e=n.addSourceBuffer(s),r=ia(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()}clearBufferAppendTimeoutId(e){e&&(self.clearTimeout(e.bufferAppendTimeoutId),e.bufferAppendTimeoutId=void 0)}getTrackCodec(e,t){const n=e.supplemental;let r=e.codec;n&&("video"===t||"audiovideo"===t)&&mt(n,"video")&&(r=function(e,t){const n=[];if(e){const t=e.split(",");for(let e=0;e<t.length;e++)gt(t[e],"video")||n.push(t[e])}return t&&n.push(t),n.join(",")}(r,n));const s=It(r,e.levelCodec);return s?"audio"===t.slice(0,5)?bt(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.log(`${e} buffer removed ${us(n)}`),this.hls.trigger(l.BUFFER_FLUSHED,{type:e,start:n.start(0),end:n.end(n.length-1)}))}))}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,n;if("closed"===(null==(t=this.mediaSource)?void 0:t.readyState))return void this.resetBuffer(e);const r=this.currentOp(e);if(!r)return;r.onComplete();if(null==(n=this.tracks[e])||null==(n=n.buffer)?void 0:n.updating)return this.log(`${e} SourceBuffer updating on "updateend"`),void this.blockUntilOpen((()=>{this.shiftAndExecuteNext(e)}));this.shiftAndExecuteNext(e)}onSBUpdateError(e,t){var n;const r=null==(n=this.mediaSource)?void 0:n.readyState,s=new Error(`${e} SourceBuffer error. MediaSource readyState: ${r}`);this.error(`${s.message}`,t),this.hls.trigger(l.ERROR,{type:a.MEDIA_ERROR,details:o.BUFFER_APPENDING_ERROR,sourceBufferName:e,error:s,fatal:!1});const i=this.currentOp(e);i&&i.onError(s)}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)throw new Error(`Attempting to remove from the ${e} SourceBuffer, but it does not exist`);const l=r(s.duration)?s.duration:1/0,c=r(i.duration)?i.duration:1/0,u=Math.max(0,t);var d;if(u>=c)return null==(d=this.currentOp(e))||d.onComplete(),void this.shiftAndExecuteNext(e);const h=Math.min(n,l,c);if(!(h>u)||a.ending&&!a.ended)throw new Error(`Cannot remove ${h<=u?`invalid range (${u} >= ${h}) `:""}from the ${e} SourceBuffer${a.ending?" while track ending":""}`);a.ended=!1,this.log(`Removing [${u},${h}] from the ${e} SourceBuffer`),o.remove(u,h)}appendExecutor(e,t){const n=this.tracks[t],r=null==n?void 0:n.buffer;if(!r)throw new ra(`Attempting to append to the ${t} SourceBuffer, but it does not exist`);if(n.ending=!1,n.ended=!1,this.hls.config.appendTimeout!==1/0){const e=this.calculateAppendTimeoutTime(r);n.bufferAppendTimeoutId=self.setTimeout((()=>this.appendTimeoutHandler(t,r,e)),e)}r.appendBuffer(e)}appendTimeoutHandler(e,t,n){this.log(`Received timeout after ${n}ms for append on ${e} source buffer. Aborting and triggering error.`);try{t.abort()}catch(t){this.log(`Failed to abort append on ${e} source buffer after timeout.`)}const r=this.currentOp(e);r&&r.onError(new Error(`${e}-append-timeout`))}calculateAppendTimeoutTime(e){let t=10;this.details&&(t=this.details.levelTargetDuration);let n=2*t*1e3;if(null===this.media)return n;const r=qn.bufferInfo(e,this.media.currentTime,0);return r.len?(n=Math.max(1e3*r.len,n),Math.max(this.hls.config.appendTimeout,n)):n}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}isAudioBlocked(){var e;return"block-audio"===(null==(e=this.currentOp("audio"))?void 0:e.label)}isAudioBlocking(){return!!this.operationQueue&&this.operationQueue.audioBlocking()}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=2===t.length&&this.isAudioBlocking()?[this.appendBlocker("video")]:t.map((e=>this.appendBlocker(e)));return 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||"audio"===e&&this.isAudioBlocked()||this.shiftAndExecuteNext(e)}))}append(e,t,n){this.operationQueue&&this.operationQueue.append(e,t,n)}insertNext(e,t){this.operationQueue&&this.operationQueue.insertNext(e,t)}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}),ls(s,t,i)}removeBufferListeners(e){const t=this.tracks[e];if(!t)return;const n=t.buffer;n&&(t.listeners.forEach((e=>{cs(n,e.event,e.listener)})),t.listeners.length=0)}},capLevelController:ua,errorController:class extends q{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)===y.MAIN?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=bn());case o.FRAG_GAP:case o.FRAG_DECRYPT_ERROR:return t.errorAction=this.getFragRetryOrSwitchAction(t),void(t.errorAction.action=hn);case o.PLAYLIST_UNCHANGED_ERROR:case o.LEVEL_EMPTY_ERROR:case o.LEVEL_PARSING_ERROR:{var i;const e=t.parent===y.MAIN?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===E.AUDIO_TRACK&&e.hasAudioGroup(s.groupId)||s.type===E.SUBTITLE_TRACK&&e.hasSubtitleGroup(s.groupId)))return t.errorAction=this.getPlaylistRetryOrSwitchAction(t,r.loadLevel),t.errorAction.action=hn,void(t.errorAction.flags=mn)}return;case o.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED:return void(t.errorAction={action:hn,flags:_n});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:hn,flags:Tn});case o.BUFFER_ADD_CODEC_ERROR:case o.REMUX_ALLOC_ERROR:case o.BUFFER_APPEND_ERROR:return void(t.errorAction||(t.errorAction=this.getLevelSwitchAction(t,t.level)));case o.MEDIA_SOURCE_REQUIRES_RESET:return t.errorAction||(t.errorAction=this.getLevelSwitchAction(t,t.level)),void(t.errorAction.flags|=yn|En);case o.INTERNAL_EXCEPTION:case o.BUFFER_APPENDING_ERROR:case o.BUFFER_APPEND_NO_PROGRESS: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=bn())}t.type===a.KEY_SYSTEM_ERROR&&(t.levelRetry=!1,t.errorAction=bn())}getPlaylistRetryOrSwitchAction(e,t){const n=F(this.hls.config.playlistLoadPolicy,e),r=this.playlistError++;if(H(n,r,x(e),e.response))return{action:pn,flags:gn,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=F(U(e)?i:s,e),l=t.levels.reduce(((e,t)=>e+t.fragmentError),0);if(r&&(e.details!==o.FRAG_GAP&&r.fragmentError++,!B(e))){if(H(a,l,x(e),e.response))return{action:pn,flags:gn,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++,r.loadErrorTime=self.performance.now(),t===o.BUFFER_APPEND_ERROR&&r.fragmentError++;let c=-1;const{levels:u,loadLevel:d,minAutoLevel:h,maxAutoLevel:f}=n;
1n.autoLevelEnabled||n.config.preserveManualLevelOnError||(n.loadLevel=-1);const p=null==(s=e.frag)?void 0:s.type,g=(p===y.AUDIO&&t===o.FRAG_PARSING_ERROR||"audio"===e.sourceBufferName&&Sn(e))&&u.some((({audioCodec:e})=>r.audioCodec!==e)),m="video"===e.sourceBufferName&&Sn(e)&&u.some((({codecSet:e,audioCodec:t})=>r.codecSet!==e&&r.audioCodec===t)),{type:_,groupId:T}=null!=(i=e.context)?i:{};for(let s=u.length;s--;){const i=(s+d)%u.length;if(i!==d&&i>=h&&i<=f&&(0===u[i].loadError||W(u[i],n.config.errorPenaltyExpireMs))){var a,l;const n=u[i];if(t===o.FRAG_GAP&&p===y.MAIN&&e.frag){const t=u[i].details;if(t){const n=an(e.frag,t.fragments,e.frag.start);if(null!=n&&n.gap)continue}}else{if(_===E.AUDIO_TRACK&&n.hasAudioGroup(T)||_===E.SUBTITLE_TRACK&&n.hasSubtitleGroup(T))continue;if(p===y.AUDIO&&null!=(a=r.audioGroups)&&a.some((e=>n.hasAudioGroup(e)))||p===y.SUBTITLE&&null!=(l=r.subtitleGroups)&&l.some((e=>n.hasSubtitleGroup(e)))||g&&r.audioCodec===n.audioCodec||m&&r.codecSet===n.codecSet||!g&&r.audioCodec!==n.audioCodec)continue}c=i;break}}if(c>-1&&n.loadLevel!==c)return e.levelRetry=!0,this.playlistError=0,{action:hn,flags:gn,nextAutoLevel:c}}return{action:hn,flags:mn}}onErrorOut(e,t){var n,r;switch(null==(n=t.errorAction)?void 0:n.action){case dn:break;case hn:this.sendAlternateToPenaltyBox(t),t.errorAction.resolved||t.details===o.FRAG_GAP||t.details===o.PLAYLIST_UNCHANGED_ERROR||vn(t)||(t.fatal=!0)}((null==(r=t.errorAction)?void 0:r.flags)||0)&yn&&this.hls.recoverMediaError(),t.fatal&&this.hls.stopLoad()}sendAlternateToPenaltyBox(e){const t=this.hls,n=e.errorAction;if(!n)return;let r=n.nextAutoLevel;if(n.flags===gn)this.switchLevel(e,r);else if(n.flags&En){const e=this.hls.levels;for(let t=e.length;t--;)"SDR"!==e[t].videoRange?(e[t].fragmentError++,e[t].loadError++):void 0===r&&(r=t)}else if(n.flags&_n){const r=this.getVariantLevelIndex(e.frag),s=t.levels[r],i=null==s?void 0:s.attrs["HDCP-LEVEL"];n.hdcpLevel=i;const a="NONE"===i;i&&!a?(t.maxHdcpLevel=Ut[Ut.indexOf(i)-1],n.resolved=!0,this.warn(`Restricting playback to HDCP-LEVEL of "${t.maxHdcpLevel}" or lower`)):(a&&this.warn("HDCP policy resticted output with HDCP-LEVEL=NONE"),n.flags|=Tn)}if(n.flags&Tn){const t=e.decryptdata;if(t){const r=this.hls.levels,a=r.length;for(let n=a;n--;){var s,i;if(this.variantHasKey(r[n],t))this.log(`Banned key found in level ${n} (${r[n].bitrate}bps) or audio group "${null==(s=r[n].audioGroups)?void 0:s.join(",")}" (${null==(i=e.frag)?void 0:i.type} fragment) ${ve(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<a)n.resolved=!0;else if(o&&o.type!==y.MAIN){const e=o.decryptdata;e&&!t.matches(e)&&(n.resolved=!0)}}}n.resolved||this.switchLevel(e,r)}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=Ct(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}
vendor: 2,171 bytes, line 1
1registerListeners(){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)}},id3TrackController:class{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;
1e&&(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;e&&(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){this.media=t.media}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.id3Track.remove(),this.id3Track=null),this.dateRangeCuesAppended={})}onManifestLoading(){this.dateRangeCuesAppended={}}createTrack(e){return Ol(e,"metadata","id3","","hidden")}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=Bl();if(i)for(let e=0;e<s.length;e++){const t=s[e].type;if(t===Gs.emsg&&!n||!r)continue;const a=Te(s[e].data),o=s[e].pts;let l=o+s[e].duration;l>$l&&(l=$l);l-o<=0&&(l=o+.25);for(let e=0;e<a.length;e++){const n=a[e];if(!Ee(n)){this.updateId3CueEnds(o,t);const e=Fl(i,o,l,n,t);e&&this.id3Track.track.addCue(e)}}}}updateId3CueEnds(e,t){var n;const r=null==(n=this.id3Track)?void 0:n.track.cues;if(r)for(let n=r.length;n--;){const s=r[n];s.type===t&&s.startTime<e&&s.endTime===$l&&(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===Gs.audioId3&&o:"video"===r?e=>e.type===Gs.emsg&&a:e=>e.type===Gs.audioId3&&o||e.type===Gs.emsg&&a,Pl(s.track,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=Bl();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=Fl(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.track.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.track.cues)&&h.length){const e=Object.keys(d).filter((e=>-1===u.indexOf(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.track.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=$l;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];
1if("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];nr(c)&&(e=be(e));const s=Fl(o,r,h,{key:c,data:e},Gs.dateRange);s&&(s.id=t,this.id3Track.track.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}}},gapController:class extends Wn{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.skipRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.buffered={},this.lastCurrentTime=void 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.lastCurrentTime=this.getCurrentTime(),this.registerListeners()}registerListeners(){const{hls:e}=this;
vendor: 10,105 bytes, line 1
1e&&(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;ls(n,"playing",this.onMediaPlaying),ls(n,"waiting",this.onMediaWaiting),ls(n,"ended",this.onMediaEnded)}onMediaDetaching(e,t){this.clearInterval();const{media:n}=this;n&&(cs(n,"playing",this.onMediaPlaying),cs(n,"waiting",this.onMediaWaiting),cs(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}getCurrentTime(){var e;const t=(null==(e=this.hls)?void 0:e.config.timelineOffset)||0;return this.media?Math.max(this.media.currentTime,t):t}tick(){var e;if(null==(e=this.media)||!e.readyState||!this.hasBuffered)return;const t=this.getCurrentTime();this.media.currentTime<t||(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.skipRetry=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.skipRetry=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(!qn.getBuffered(i).length)return void(this.skipRetry=this.nudgeRetry=0);const d=qn.bufferInfo(i,e,0),h=this.fragmentTracker;h&&this.hls&&Ul(d,e,h,this.hls);const f=d.nextStart||0;if(a&&h&&this.hls){const t=Ml(this.hls.inFlightFragments,e),n=d.len>2,r=!f||t||f-e>2&&!h.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&&h){if(!(d.len>0)&&!f)return;const t=Math.max(f,d.start||0)-e,n=!(null==p||!p.live)?2*p.targetduration:2,r=xl(e,h);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.moved)&&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;if(i.currentTime!==e){const t=e;return e=i.currentTime,this.moved=!0,void this.log(`currentTime changed ${t} > ${e}`)}}const S=qn.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=qn.bufferedInfo(qn.timeRangesToArray(this.buffered.audio),e,0);if(n.len>1&&t>=n.start){const n=qn.timeRangesToArray(r),s=qn.bufferedInfo(n,t,0).bufferedIndex;if(s>-1&&s<n.length-1){const t=qn.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=xl(e,this.fragmentTracker);s&&"fragment"in s?s=s.fragment:s||(s=void 0);const c=qn.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=xl(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,y.MAIN),s=n.getFragAtPos(r,y.MAIN);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 (${qt(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){const{fragmentTracker:t,media:n,hls:r}=this,s=null==r?void 0:r.config;if(!n||!t||!s)return 0;const i=n.currentTime,c=qn.bufferInfo(n,i,0);Ul(c,i,t,r);const u=i<c.start?c.start:c.nextStart;if(u){const h=c.len<=s.maxBufferHole,f=c.len>0&&c.len<1&&n.readyState<3,p=u-i;if(p>0&&(h||f)){if(p>s.maxBufferHole){let n=!1;if(0===i){const e=t.getAppendedFrag(0,y.MAIN);e&&u<e.end&&(n=!0)}if(!n&&e){var d;if(null==(d=r.loadLevelObj)||!d.details)return 0;if(Ml(r.inFlightFragments,u))return 0;let n=!1,s=e.end;for(;s<u;){const e=xl(s,t),r=e?e.duration:0;if(!(r>0)){n=!0;break}s+=r}if(n)return 0}}const{nudgeMaxRetry:h,skipBufferHolePadding:f}=s,g=++this.skipRetry>h,m=Math.max(u,i)+f;if(g||(this.warn(`skipping hole, adjusting currentTime from ${i} to ${m}`),this.moved=!0,n.currentTime=m),null==e||!e.gap||g){const t=new Error(g?`Playhead still not moving after seeking over buffer hole from ${i} to ${m} after ${s.nudgeMaxRetry} attempts.`:`fragment loaded with buffer holes, seeking from ${i} to ${m}`),n={type:a.MEDIA_ERROR,details:o.BUFFER_SEEK_OVER_HOLE,fatal:g,error:t,reason:t.message,buffer:c.len,bufferInfo:c};e&&("fragment"in e?n.part=e:n.frag=e),r.trigger(l.ERROR,n)}return m}}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})}}},latencyController:class{constructor(e){this.hls=void 0,this.media=null,this.currentTime=0,this.stallCount=0,this._latency=null,this._targetLatencyUpdated=!1,this.onTimeupdate=()=>{var e;const{media:t}=this,n=this.levelDetails;if(!t||!n||!this.hls)return;this.currentTime=t.currentTime;const r=this.hls.config,s=this.computeLatency();if(null===s)return;this._latency=s;const{lowLatencyMode:i,maxLiveSyncPlaybackRate:a}=r;if(!i||1===a||!n.live)return;const o=this.targetLatency;if(null===o)return;const l=s-o,c=l<Math.min(this.maxLatency,o+n.targetduration),u=As(r)&&!(null==(e=this.hls.interstitialsManager)||null==(e=e.playingItem)||!e.event);if(c&&l>.05&&this.forwardBufferLength>1&&!u){const e=Math.min(2,Math.max(1,a)),n=Math.round(2/(1+Math.exp(-.75*l-this.edgeStalled))*20)/20,r=Math.min(e,Math.max(1,n));this.changeMediaPlaybackRate(t,r)}else 1!==t.playbackRate&&0!==t.playbackRate&&this.changeMediaPlaybackRate(t,1)},this.hls=e,this.registerListeners()}get levelDetails(){var e;return(null==(e=this.hls)?void 0:e.latestLevelDetails)||null}get latency(){return this._latency||0}get maxLatency(){var e;const t=null==(e=this.hls)?void 0:e.config;if(!t)return 0;if(void 0!==t.liveMaxLatencyDuration)return t.liveMaxLatencyDuration;const n=this.levelDetails;return n?t.liveMaxLatencyDurationCount*n.targetduration:0}get targetLatency(){const e=this.levelDetails;if(null===e||!this.hls)return null;const t=this.hls.config,{holdBack:n,partHoldBack:r,targetduration:s}=e,{liveSyncDuration:i,liveSyncDurationCount:a,lowLatencyMode:o}=t,l=this.hls.userConfig;let c=o&&r||n;(this._targetLatencyUpdated||l.liveSyncDuration||l.liveSyncDurationCount||0===c)&&(c=void 0!==i?i:a*s);const u=s;return c+Math.min(this.stallCount*t.liveSyncOnStallIncrease,u)}set targetLatency(e){this.hls&&(this.stallCount=0,this.hls.config.liveSyncDuration=e,this._targetLatencyUpdated=!0)}get liveSyncPosition(){const e=this.estimateLiveEdge(),t=this.targetLatency;if(null===e||null===t||!this.hls)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.hls.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||!this.hls)return 0;const t=3*(this.hls.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;
1e&&(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),e.on(l.INTERSTITIAL_ASSET_STARTED,this.onAssetStarted,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),e.off(l.INTERSTITIAL_ASSET_STARTED,this.onAssetStarted,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)}onAssetStarted(e,t){var n;const r=this.hls,s=this.media||t.event.appendInPlace&&(null==r||null==(n=r.interstitialsManager)?void 0:n.playerQueue.reduce(((e,t)=>e||t.media),null));r&&s&&s.playbackRate>1&&s.playbackRate<=r.config.maxLiveSyncPlaybackRate&&this.changeMediaPlaybackRate(s,1)}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}}},{cueHandler:Bc,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 bs{constructor(e,t,n){super(e,t,n,"subtitle-stream-controller",y.SUBTITLE),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=hs,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,part:r,success:s}=t;if(!s)return;const i=this.tracksBuffered[this.currentTrackId];if(!i)return;let a;const o=(r||n).start;for(let e=0;e<i.length;e++)if(o>=i[e].start&&o<=i[e].end){a=i[e];break}const l=o+(r||n).duration;if(a?a.end=l:(a={start:o,end:l},i.push(a)),!r||l>=n.end){const e=this.fragmentTracker.fragBuffered(n);r&&e&&(e.range.subs={time:[{startPTS:n.start,endPTS:l}],partial:!0}),A(n)&&!this.fragContextChanged(n)&&(this.fragPrevious=n),this.fragBufferedComplete(n,r),this.media&&this.tickImmediate()}}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=>{if(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,y.SUBTITLE)}}onError(e,t){const n=t.frag;(null==n?void 0:n.type)===y.SUBTITLE&&(t.details===o.FRAG_GAP&&this.fragmentTracker.addAsGap(n),this.fragCurrent&&this.fragCurrent.abortRequests(),this.state!==ds&&(this.state=hs))}
1onSubtitleTracksUpdated(e,{subtitleTracks:t}){this.levels&&Qi(this.levels,t)?this.levels=t.map((e=>new Wt(e))):(this.tracksBuffered=[],this.levels=t.map((e=>{const t=new Wt(e);return this.tracksBuffered[t.id]=[],t})),this.fragmentTracker.removeFragmentsInRange(0,Number.POSITIVE_INFINITY,y.SUBTITLE),this.fragPrevious=null,this.mediaBuffer=null)}onSubtitleTrackSwitch(e,t){var n;if(this.currentTrackId=t.id,this.abortCurrentFrag(),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.state!==ds&&this.setInterval(500)):this.mediaBuffer=null}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;const c=this.mainDetails;let u=0;if(i.live||null!=(n=o.details)&&n.live){if(i.deltaUpdateFailed)return;if(!c)return void(this.startFragRequested=!1);var d;if(o.details)u=this.alignPlaylists(i,o.details,null==(d=this.levelLastLoaded)?void 0:d.details);i.alignedSliding||(os(c,i,this),u=i.fragmentStart)}o.details=i,this.levelLastLoaded=o,c&&!this.startFragRequested&&this.setStartPosition(c,u),a===r&&(this.hls.trigger(l.SUBTITLE_TRACK_UPDATED,{details:i,id:a,groupId:t.groupId}),this.tickImmediate())}_handleFragmentLoadProgress(e){const{frag:t,part:n,payload:r}=e;n&&null!=r&&r.byteLength&&this.shouldDecrypt(t)&&this.decryptPayload(r,t,n)}_handleFragmentLoadComplete(e){const{frag:t,payload:n}=e;!this.fragContextChanged(t)&&null!=n&&n.byteLength&&this.shouldDecrypt(t)&&this.decryptPayload(n,t,null)}shouldDecrypt(e){const t=e.decryptdata;return!!(null!=t&&t.key&&t.iv&&or(t.method))}decryptPayload(e,t,n){const r=t.decryptdata,s=performance.now();this.decrypter.decrypt(new Uint8Array(e),r.key.buffer,r.iv.buffer,lr(r.method)).then((e=>{this.fragContextChanged(t)||this.hls.trigger(l.FRAG_DECRYPTED,{frag:t,part:n,payload:e,stats:{tstart:s,tdecrypt:performance.now()}})})).catch((e=>{this.hls.trigger(l.ERROR,{type:a.MEDIA_ERROR,details:o.FRAG_DECRYPT_ERROR,fatal:!1,error:e,reason:e.message,frag:t,part:n}),n||(this.warn(`${e.name}: ${e.message}`),this.state=hs)}))}doTick(){if(this.state===hs&&this.levels){var e;if(!this.media&&!this.primaryPrefetch&&(this.startFragRequested||!this.config.startFragPrefetch))return;const{currentTrackId:n,levels:r}=this,s=r[n],i=null==s?void 0:s.details;if(!i||this.waitForLive(s)||this.waitForCdnTuneIn(i))return void(this.startFragRequested=!1);const{config:a}=this,o=this.playhead,l=qn.bufferedInfo(this.tracksBuffered[this.currentTrackId]||[],o,a.maxBufferHole),{end:c,len:u}=l;if(u>Math.max(this.hls.maxBufferLength+i.levelTargetDuration,(null==(e=this.hls.mainForwardBufferInfo)?void 0:e.len)||0)||u&&!this.buffering)return;let d=this.getNextFragment(c,i);if(!d)return;if(A(d)){var t;const e=d.sn-i.startSN,n=i.fragments[e-1];d.cc!==(null==n?void 0:n.cc)||null!=(t=i.partList)&&t.length||this.fragmentTracker.getState(n)!==In||(d=n)}this.loadFragment(d,s,c)}}loadFragment(e,t,n){const r=this.fragmentTracker.getState(e);r!==In&&r!==Rn||super.loadFragment(e,t,n)}get mediaBufferTimeRanges(){return new gc(this.tracksBuffered[this.currentTrackId]||[])}},subtitleTrackController:class extends Xi{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=-1,t=!1;if(this.currentTrack){var n;const r=null==(n=this.currentTrack.trackNode)?void 0:n.track.mode;"showing"===r?(e=this.trackId,t=!0):"hidden"===r&&(e=this.trackId)}if(!t)for(let t=0;t<this.tracksInGroup.length;t++){var r;const n=null==(r=this.tracksInGroup[t].trackNode)?void 0:r.track.mode;if("showing"===n){e=t;break}e<0&&"hidden"===n&&(e=t)}var s;e>-1&&(this._subtitleDisplay="showing"===(null==(s=this.tracksInGroup[e].trackNode)?void 0:s.track.mode));this.setSubtitleTrack(e,!0)},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;
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)}createTracksInGroup(){var e;if(!this.media||!this.hls.config.renderTextTracksNatively)return;this.tracksInGroup.forEach((e=>{e.trackNode||(e.trackNode=Ol(this.media,Nl(e),e.name,e.lang))}));const t=null==(e=this.currentTrack)||null==(e=e.trackNode)?void 0:e.track;"disabled"===(null==t?void 0:t.mode)&&(t.mode=this._subtitleDisplay?"showing":"hidden")}onMediaAttached(e,t){const n=t.media;this.media=n;let r=this.trackId;this.queuedDefaultTrack>-1&&(r=this.queuedDefaultTrack,this.queuedDefaultTrack=-1),this.setSubtitleTrack(r),this.createTracksInGroup(),this.useTextTrackPolling=!(n.textTracks&&"onchange"in n.textTracks),this.useTextTrackPolling?this.pollTrackChange(500):n.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;self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||n.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId,this.setSubtitleTrack(-1)),this.media=null,r||this.hls.config.renderTextTracksNatively&&this.tracksInGroup.forEach((e=>{const t=e.trackNode;t&&(t.track.mode="hidden",t.remove(),e.trackNode=void 0)}))}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;const e=[];if(this.tracks.forEach((t=>{(t.textCodec===El?this.hls.config.enableIMSC1:this.hls.config.enableWebVTT)&&(!n||n.indexOf(t.groupId)>-1?(t.id=e.length,e.push(t)):t.trackNode&&(t.trackNode.remove(),t.trackNode=void 0))})),e.length===this.tracksInGroup.length){let t=!1;for(let n=0;n<e.length;n++)if(e[n]!==this.tracksInGroup[n]){t=!0;break}if(!t)return}e.length&&this.selectDefaultTrack&&!e.some((e=>e.default))&&(this.selectDefaultTrack=!1),this.tracksInGroup=e,this.trackId=-1,this.currentTrack=null;const t=this.hls.config.subtitlePreference;if(!s&&t){this.selectDefaultTrack=!1;const n=Xt(t,e);if(n>-1)s=e[n];else{const e=Xt(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),this.setSubtitleTrack(r),this.createTracksInGroup()}}findTrackId(e){const t=this.tracksInGroup,n=this.selectDefaultTrack;for(let r=0;r<t.length;r++){const s=t[r];
1if((!n||s.default)&&(n||e)&&(!e||Qt(s,e)))return r}if(e){for(let n=0;n<t.length;n++){const r=t[n];if(Zi(e.attrs,r.attrs,["LANGUAGE","ASSOC-LANGUAGE","CHARACTERISTICS"]))return n}for(let n=0;n<t.length;n++){const r=t[n];if(Zi(e.attrs,r.attrs,["LANGUAGE"]))return n}}return-1}onError(e,t){!t.fatal&&t.context&&t.context.type===E.SUBTITLE_TRACK&&t.context.id===this.trackId&&nn(t.context.groupId,this.groupIds)&&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,!0)}setSubtitleOption(e){if(this.hls.config.subtitlePreference=e,e){if(-1===e.id)return this.setSubtitleTrack(-1,!0),null;const t=this.allSubtitleTracks;if(this.selectDefaultTrack=!1,t.length){const n=this.currentTrack;if(n&&Qt(e,n))return n;const r=Xt(e,this.tracksInGroup);if(r>-1){const e=this.tracksInGroup[r];return this.setSubtitleTrack(r,!0),e}if(n)return null;{const n=Xt(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(){if(!this.media||!this.hls.config.renderTextTracksNatively)return;const e=this.currentTrack;this.tracksInGroup.forEach((t=>{if(t.trackNode){const n=t===e?this._subtitleDisplay?"showing":"hidden":"disabled",r=t.trackNode.track;r.mode!==n&&(r.mode=n)}}))}setSubtitleTrack(e,t=!1){const n=this.tracksInGroup;if(this.media||(this.queuedDefaultTrack=e),e<-1||e>=n.length||!r(e))return void this.warn(`Invalid subtitle track id: ${e}`);const s=this.currentTrack,i=n[e]||null;if(this.trackId=e,this.currentTrack=i,t&&this.toggleTrackModes(),!i)return void(s&&this.hls.trigger(l.SUBTITLE_TRACK_SWITCH,{id:e}));const a=!!i.details&&!i.details.live;if(i===s&&a)return;this.log(`Switching to subtitle-track ${e}`+(i?` "${i.name}" lang:${i.lang} group:${i.groupId}`:""));const{id:o,groupId:c="",name:u,type:d,url:h}=i;this.hls.trigger(l.SUBTITLE_TRACK_SWITCH,{id:o,groupId:c,name:u,type:d,url:h});const f=this.switchParams(i.url,null==s?void 0:s.details,i.details);this.loadPlaylist(f)}},timelineController:class{constructor(e){this.hls=void 0,this.media=null,this.config=void 0,this.enabled=!0,this.Cues=void 0,this.tracks=[],this.initPTS=[],this.unparsedVttFrags=[],this.captionsTracks={},this.cueCache={},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.cueCache={},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_APPENDED,this.onBufferAppended,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_APPENDED,this.onBufferAppended,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 xc(this,"textTrack1"),t=new xc(this,"textTrack2"),n=new xc(this,"textTrack3"),r=new xc(this,"textTrack4");this.cea608Parser1=new Pc(1,e,t),this.cea608Parser2=new Pc(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.cueCache[e];if(s){const e=this.Cues.newCue(null,t,n,r);e.length&&s.push.apply(s,e)}else{const s=this.captionsTracks[e].track;this.Cues.newCue(s,t,n,r)}}else{var d;const s=this.Cues.newCue(null,t,n,r),i=null==(d=this.captionsProperties[e])?void 0:d.media;this.hls.trigger(l.CUES_PARSED,{type:"captions",cues:s,track:e,closedCaptions:i})}}onInitPtsFound(e,{id:t,timestampOffsets:n}){const{unparsedVttFrags:r}=this;t===y.MAIN&&(this.initPTS=n),r.length&&(this.unparsedVttFrags=[],r.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,part:null,error:new Error("Subtitle discontinuity domain does not match main")})})))}createCaptionsTrack(e){this.config.renderTextTracksNatively?this.createNativeTrack(e):this.createNonNativeTrack(e)}createNativeTrack(e){if(this.captionsTracks[e])return;const{captionsProperties:t,captionsTracks:n,cueCache:r,media:s}=this,{label:i,languageCode:a}=t[e];s&&(r[e]=[],n[e]=Ol(s,"captions",i,a,"hidden"))}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]})}onMediaAttaching(e,t){this.media=t.media}onMediaDetaching(e,t){const n=!!t.transferMedia;if(this.media=null,!n){if(this.config.renderTextTracksNatively){const{captionsTracks:e,cueCache:t}=this;for(const n in e)e[n].remove(),delete t[n]}this.cueCache={},this.captionsTracks={},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.tracks=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.unparsedVttFrags=[],this.initPTS=[],this.cea608Parser1&&this.cea608Parser2&&(this.cea608Parser1.reset(),this.cea608Parser2.reset())}onSubtitleTracksUpdated(e,t){const n=t.subtitleTracks||[];if(n.length&&!this.config.renderTextTracksNatively&&!Qi(this.tracks,n)){const e=n.map((e=>
1({label:e.name,kind:e.type.toLowerCase(),default:e.default,subtitleTrack:e})));this.hls.trigger(l.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:e})}this.tracks=n}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===y.MAIN){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;var s;if(n.level<this.tracks.length&&n.type===y.SUBTITLE)if(r.byteLength||null!=(s=n.initSegment)&&null!=(s=s.data)&&s.byteLength){const e=n.decryptdata,r="stats"in t;if(null==e||!e.encrypted||r){const e=this.tracks[n.level],r=this.vttCCs;r[n.cc]||(r[n.cc]={start:n.start,prevCC:this.prevCC,new:!0},this.prevCC=n.cc),(null==e?void 0:e.textCodec)===El?this._parseIMSC1(t):this._parseVTTs(t)}}else{const e="part"in t?t.part:null;this.hls.trigger(l.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:n,part:e,error:new Error("Empty subtitle payload")})}}_parseIMSC1(e){const{frag:t,payload:n}=e,r="part"in e?e.part:null,s=this.hls;bl(n,this.initPTS[t.cc],(e=>{this._appendCues(e,t.level),s.trigger(l.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:t,part:r})}),(e=>{s.logger.log(`Cannot parse IMSC1 (sn: ${t.sn} @${t.start}): ${e}`),s.trigger(l.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:t,part:r,error:e})}))}_parseVTTs(e){var t;const{frag:n,payload:r}=e,s="part"in e?e.part:null,{initPTS:i,unparsedVttFrags:a}=this,o=i.length-1;if(!i[n.cc]&&-1===o)return void a.push(e);const c=this.hls,u=null==(t=n.initSegment)?void 0:t.data;Tl(u?Qe(u,new Uint8Array(r)).buffer:r,this.initPTS[n.cc],this.vttCCs,n.cc,(s&&!u?s:n).start,(e=>{this._appendCues(e,n.level),c.trigger(l.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:n,part:s})}),(t=>{const r=t.message.startsWith("Missing initPTS");c.logger.log(`${r?"Deferred parsing of":"Cannot parse"} VTT cue (sn: ${n.sn} @${n.start}): ${t}`),r?a.push(e):(this.config.enableIMSC1&&this._fallbackToIMSC1(e),c.trigger(l.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:n,part:s,error:t}))}))}_fallbackToIMSC1(e){const{frag:t,payload:n}=e,r=this.tracks[t.level];r.textCodec||bl(n,this.initPTS[t.cc],(()=>{r.textCodec=El,this._parseIMSC1(e)}),(()=>{r.textCodec="wvtt"}))}_appendCues(e,t){const n=this.hls;if(this.config.renderTextTracksNatively){var r;const n=null==(r=this.tracks[t].trackNode)?void 0:r.track;if(!n||"disabled"===n.mode)return;e.forEach((e=>wl(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,subtitleTrack:r})}}onFragDecrypted(e,t){const{frag:n}=t;n.type===y.SUBTITLE&&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!==y.MAIN||"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])}}}onBufferAppended(e,t){if(this.config.renderTextTracksNatively){var n;const{type:e,timeRanges:r}=t;if("video"===e&&null!=(n=r[e])&&n.length){const{captionsTracks:e,cueCache:t}=this;Object.keys(t).forEach((n=>{var r;const s=null==(r=e[n])?void 0:r.track;if(s){const e=t[n];for(let t=0;t<e.length;t++)wl(s,e[t])}delete t[n]}))}}}onBufferFlushing(e,t){const{startOffset:n,endOffset:r,endOffsetSubtitles:s,type:i}=t,{media:a}=this;if(a&&!(a.currentTime<r)){if(!i||"video"===i){const{captionsTracks:e,cueCache:t}=this;Object.keys(e).forEach((t=>Pl(e[t].track,n,r))),Object.keys(t).forEach((e=>{const s=t[e];for(let e=s.length;e--;){const t=s[e];t.startTime>=n&&t.endTime<=r&&s.splice(e,1)}}))}this.config.renderTextTracksNatively&&0===n&&void 0!==s&&this.tracks.forEach((e=>{var t;const r=null==(t=e.trackNode)?void 0:t.track;r&&Pl(r,n,s)}))}}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;
1if(!!(4&n)){const e=3&n;0!==e&&1!==e||(t[e].push(s),t[e].push(i))}}return t}},audioStreamController:class extends bs{constructor(e,t,n){super(e,t,n,"audio-stream-controller",y.AUDIO),this.mainAnchor=null,this.mainFragLoading=null,this.audioOnly=!1,this.bufferedTrack=null,this.switchingTrack=null,this.trackId=-1,this.nextTrackId=-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,t){const{frag:n,id:r,initPTS:s,timescale:i,trackId:a,timestampOffsets:o}=t;if(r===y.MAIN){const e=n.cc,t=this.fragCurrent;if(this.initPTS=o,this.log(`InitPTS for cc: ${e} found from main: ${s/i} (${s}/${i}) trackId: ${a}`),this.mainAnchor=n,this.state===Ss){const t=this.waitingData;(!t&&!this.loadingParts||t&&t.frag.cc!==e)&&this.syncWithAnchor(n,null==t?void 0:t.frag)}else!this.hls.hasEnoughToStart&&t&&t.cc!==e?(t.abortRequests(),this.syncWithAnchor(n,t)):this.state===hs&&this.tick()}}getLoadPosition(){var e;return!this.startFragRequested&&this.nextLoadPosition>=0&&!1!==(null==(e=this.switchingTrack)?void 0:e.flushImmediate)?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=cn(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===hs&&this.doTickIdle())}startLoad(e,t){if(!this.levels)return this.startPosition=e,void(this.state=ds);const n=this.lastCurrentTime;this.stopLoad(),this.setInterval(100),n>0&&-1===e&&!t&&this.initPTS.length&&(this.log(`Override startPosition with lastCurrentTime @${n.toFixed(3)}`),e=n),this.state=hs,this.nextLoadPosition=this.lastCurrentTime=e+this.timelineOffset,this.startPosition=t?-1:e,t||this.fragmentTracker.hasFragments(this.playlistType)||(this.startFragRequested=!1),this.tick()}doTick(){switch(this.state){case hs:this.doTickIdle();break;case ms:{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=Ss}break}case gs:this.checkRetryDate();break;case Ss:{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=ps;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=hs}}this.onTickEnd()}
vendor: 4,487 bytes, line 1
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,this.checkFragmentChanged())}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=ms,void(this.startFragRequested=!1);const c=this.getBufferOutput();this.bufferFlushed&&c&&(this.bufferFlushed=!1,this.afterBufferFlushed(c,S));const u=this.getFwdBufferInfo();if(null===u)return;if(!this.switchingTrack&&this._streamEnded(u,o))return t.trigger(l.BUFFER_EOS,{type:"audio"}),void(this.state=Es);const d=u.len,h=t.maxBufferLength,f=o.fragments,p=f[0].start,g=this.getLoadPosition(),m=this.flushing||this.switchingTrack&&!this.switchingTrack.flushImmediate?g:u.end;if(this.switchingTrack&&r){const e=g;o.PTSKnown&&e<p&&e>=this.timelineOffset&&(u.end>p||u.nextStart)&&(this.log(`Alt audio track ahead of main track, seek to start of alt audio track ${e} -> ${p} + 0.05`),r.currentTime=p+.05)}if(d>=h&&!this.switchingTrack&&m<f[f.length-1].start)return;let _=this.getNextFragment(m,o);if(_&&this.isLoopLoading(_,m)&&(_=this.getNextFragmentLoopLoading(_,o,u,y.MAIN,h)),!_)return void(this.bufferFlushed=!0);if(this.exceedsMaxBuffer(u,h,_))return;let T=(null==(e=this.mainFragLoading)?void 0:e.frag)||null;if(!this.audioOnly&&this.startFragRequested&&T&&A(_)&&!_.endList&&(!o.live||!this.loadingParts&&m<this.hls.liveSyncPosition)&&(this.fragmentTracker.getState(T)===kn&&(this.mainFragLoading=T=null),T&&A(T))){if(_.start>T.end){const e=this.fragmentTracker.getFragAtPos(m,y.MAIN);e&&e.end>T.end&&(T=e,this.mainFragLoading={frag:e,targetBufferTime:null})}if(_.start>T.end)return}this.loadFragment(_,a,m)}onMediaDetaching(e,t){this.bufferFlushed=this.flushing=!1,super.onMediaDetaching(e,t)}onAudioTracksUpdated(e,{audioTracks:t}){this.resetTransmuxer(),this.levels=t.map((e=>new Wt(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,t.flushImmediate||(this.nextTrackId=t.id,this.nextLevelSwitch()),this.flushAudioIfNeeded(t),this.state!==ds&&(this.setInterval(100),this.state=hs,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!==ds&&(this.state=ms));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||(os(c,s,this),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!==ms||this.waitForCdnTuneIn(s)||(this.state=hs),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 Ji(this.hls,y.AUDIO,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 Vn(n.level,n.sn,n.stats.chunkCount,s.byteLength,t,i,n.duration);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 Rs,complete:!1};e.push(new Uint8Array(s)),this.state!==ds&&(this.state=Ss)}}_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===y.MAIN&&A(t.frag)&&(this.mainFragLoading=t,this.state===hs&&this.tick())}onFragBuffered(e,t){const{frag:n,part:r}=t;if(n.type===y.AUDIO)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(A(n)){const e=this.switchingTrack;e&&(this.bufferedTrack=e)}this.fragBufferedComplete(n,r),this.media&&this.tick()}else this.audioOnly||n.type!==y.MAIN||n.elementaryStreams.video||n.elementaryStreams.audiovideo||(this.audioOnly=!0,this.mainFragLoading=null)}getFwdBufferInfo(){const e=this.getBufferOutput();return super.getFwdBufferInfo(e,y.AUDIO)}getBufferOutput(){return this.mediaBuffer?this.mediaBuffer:this.media}checkFragmentChanged(){const e=this.fragPlaying;if(!this.checkFragPlaying())return!1;const t=this.fragPlaying,n=null==e?void 0:e.level;return t&&t.level===n||(e&&this.cleanupBackBuffer(),this.switchingTrack&&this.completeAudioSwitch(this.switchingTrack)),!0}onError(e,t){var n;if(t.fatal)this.state=ys;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(y.AUDIO,t);break;case o.AUDIO_TRACK_LOAD_ERROR:case o.AUDIO_TRACK_LOAD_TIMEOUT:case o.LEVEL_PARSING_ERROR:t.levelRetry||this.state!==ms||(null==(n=t.context)?void 0:n.type)!==E.AUDIO_TRACK||(this.state=hs);break;case o.BUFFER_APPEND_NO_PROGRESS:if("audio"!==t.parent)return;t.frag&&(t.appendsWithoutProgress||0)>=this.config.appendErrorMaxRetry&&(this.warn(`Marking fragment ${t.frag.sn} of track ${t.frag.level} as a gap after ${t.appendsWithoutProgress} appends without buffered range growth, to prevent loop loading`),this.fragmentTracker.addAsGap(t.frag));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!==v&&(this.flushing=!0)}onBufferFlushed(e,{type:t}){if(t!==v){this.flushing=!1,this.bufferFlushed=!0,this.state===Es&&(this.state=hs);const e=this.getBufferOutput();e&&(this.afterBufferFlushed(e,t),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)return this.fragmentTracker.removeFragment(o),void(null!=g&&g.tracks&&this.resetTransmuxer());if(this.state=_s,h&&this.switchingTrack&&!this.switchingTrack.flushImmediate){const{config:e}=this,t=e.nextAudioTrackBufferFlushForwardOffset,n=Math.max(this.getLoadPosition()+t,o.start);super.flushMainBuffer(n,Number.POSITIVE_INFINITY,y.AUDIO)}if(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[S]={startPTS:e,endPTS:t,startDTS:n,endDTS:r}),o.setElementaryStreamInfo(S,e,t,n,r),this.bufferFragmentData(h,o,
vendor: 4,890 bytes, line 1
1c,i)}if(null!=p&&null!=(t=p.samples)&&t.length){const e=w({id:n,frag:o,details:d},p);r.trigger(l.FRAG_PARSING_METADATA,e)}if(f){const e=w({id:n,frag:o,details:d},f);r.trigger(l.FRAG_PARSING_USERDATA,e)}}_bufferInitSegment(e,t,n,r){if(this.state!==_s)return;if(t.video&&delete t.video,t.audiovideo&&delete t.audiovideo,!t.audio)return;const s=t.audio;s.id=y.AUDIO;const i=e.audioCodec;this.log(`Init audio buffer, container:${s.container}, codecs[level/parsed]=[${i}/${s.codec}]`),1===(null==i?void 0: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===In||r===Rn)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=Ss;const n=this.mainDetails;n&&n.fragmentStart!==t.details.fragmentStart&&os(n,t.details,this)}else super.loadFragment(e,t,n);else this.clearTrackerIfNeeded(e)}flushAudioIfNeeded(e){if(this.media&&this.bufferedTrack&&e.flushImmediate){const{name:t,lang:n,assocLang:r,characteristics:s,audioCodec:i,channels:a}=this.bufferedTrack;Qt({name:t,lang:n,assocLang:r,characteristics:s,audioCodec:i,channels:a},e,Zt)||(tn(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.bufferedTrack=e,this.switchingTrack=null,t.trigger(l.AUDIO_TRACK_SWITCHED,M({},e))}get nextAudioTrack(){return this.nextTrackId}},audioTrackController:class extends Xi{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=>nn(e.groupId,n)));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=Xt(t,e,Zt);if(n>-1)s=e[n];else{const e=Xt(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===E.AUDIO_TRACK&&t.context.
1id===this.trackId&&nn(t.context.groupId,this.groupIds)&&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)}get nextAudioTrack(){return this.trackId}set nextAudioTrack(e){this.selectDefaultTrack=!1,this.setAudioTrack(e,!1)}setAudioOption(e){const t=this.hls;if(t.config.audioPreference=e,e){const n=this.allAudioTracks;if(this.selectDefaultTrack=!1,n.length){const r=this.currentTrack;if(r&&Qt(e,r,Zt))return r;const s=Xt(e,this.tracksInGroup,Zt);if(s>-1){const t=this.tracksInGroup[s];return this.setAudioTrack(s,"flushImmediate"in e&&e.flushImmediate),t}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=en(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=>nn(e.groupId,r)));return Xt(e,i,s)>-1}));return u>-1?u:en(t,r,(t=>{const r=t.audioGroups,i=n.filter((e=>nn(e.groupId,r)));return Xt(e,i,s)>-1}))}(e,t.levels,n,r,Zt);if(-1===s)return null;t.nextLoadLevel=s}if(e.channels||e.audioCodec){const t=Xt(e,n);if(t>-1)return n[t]}}}return null}setAudioTrack(e,t=!0){const n=this.tracksInGroup;if(e<0||e>=n.length)return void this.warn(`Invalid audio track id: ${e}`);this.selectDefaultTrack=!1;const r=this.currentTrack,s=n[e],i=s.details&&!s.details.live;if(e===this.trackId&&s===r&&i)return;if(this.log(`Switching to audio-track ${e} "${s.name}" lang:${s.lang} group:${s.groupId} channels:${s.channels}`),this.trackId=e,this.currentTrack=s,this.hls.trigger(l.AUDIO_TRACK_SWITCHING,M(M({},s),{},{flushImmediate:t})),i)return;const a=this.switchParams(s.url,null==r?void 0:r.details,s.details);this.loadPlaylist(a)}findTrackId(e){const t=this.tracksInGroup;for(let n=0;n<t.length;n++){const r=t[n];if((!this.selectDefaultTrack||r.default)&&(!e||Qt(e,r,Zt)))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(Qt({name:n,lang:r,assocLang:s,characteristics:i,audioCodec:a,channels:o},t[e],Zt))return e}for(let n=0;n<t.length;n++){const r=t[n];if(Zi(e.attrs,r.attrs,["LANGUAGE","ASSOC-LANGUAGE","CHARACTERISTICS"]))return n}for(let n=0;n<t.length;n++){const r=t[n];if(Zi(e.attrs,r.attrs,["LANGUAGE"]))return n}}return-1}loadPlaylist(e){super.loadPlaylist();const t=this.currentTrack;this.shouldLoadPlaylist(t)&&tn(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:tl,cmcdController:class{constructor(e){this.hls=void 0,this.config=void 0,this.media=void 0,this.initialized=!1,this.starved=!1,this.buffering=!0,this.playerState=void 0,this.reporter=void 0,this.playheadLevel=void 0,this.onWaiting=()=>{this.initialized&&(this.starved=!0,this.setPlayerState(No)),this.buffering=!0},this.onPlay=()=>{this.initialized||this.setPlayerState(Co)},this.onPlaying=()=>{this.initialized||(this.initialized=!0),this.buffering=!1,this.setPlayerState(Lo)},this.onPause=()=>{this.media&&!this.media.ended&&this.setPlayerState(wo)},this.onSeeking=()=>{this.initialized&&this.setPlayerState(Oo)},this.onSeeked=()=>{var e;this.initialized&&null!=(e=this.media)&&e.paused&&this.setPlayerState(wo)},this.onRateChange=()=>{this.reporter&&this.media&&this.reporter.update({pr:this.media.playbackRate})},this.applyPlaylistData=e=>{try{this.apply(e,{ot:vo,su:!this.initialized})}catch(e){this.hls.logger.warn("Could not generate manifest CMCD data.",e)}},this.applyFragmentData=e=>{try{const{frag:a,part:o}=e,l=this.hls.levels[a.level],c=this.getObjectType(a,l),u={d:1e3*(o||a).duration,ot:c};if(c===Io||c===bo||c===Ao||null==c&&("main"===a.type||"audio"===a.type)){var t;const e=l.bitrate/1e3;u.br=[e];const{cmcd:s}=this.config,i=null!=(t=null==s?void 0:s.rtpSafetyFactor)?t:5;if(u.rtp=100*Math.round(e*i/100),c===Ao||null==c&&"main"===a.type){const e=this.getTopBandwidth()/1e3;
1r(e)&&(u.tb=[e]);const t=this.getLowestBandwidth()/1e3;r(t)&&(u.lb=[t])}const o=this.getBufferLength(a);if(r(o)){var n;u.bl=[o];const e=(null==(n=this.media)?void 0:n.playbackRate)||1;u.dl=100*Math.round(o/e/100)}this.playheadLevel&&(u.pb=[this.playheadLevel.bitrate/1e3]);const d=this.hls.maxAutoLevel;if(d>=0){const e=this.hls.levels[d];e&&(u.tpb=[e.bitrate/1e3])}}const d=o?this.getNextPart(o):this.getNextFrag(a);null!=d&&d.url&&d.url!==a.url&&(d.byteRange.length>0?u.nor=[(s=d.url,i={r:`${d.byteRange[0]}-${d.byteRange[1]}`},new da(s,i))]:u.nor=[d.url]),this.apply(e,u)}catch(e){this.hls.logger.warn("Could not generate segment CMCD data.",e)}var s,i},this.recordFragmentResponse=(e,t,n)=>{var r;const{cmcd:s}=this.config,i=null==s||null==(r=s.eventTargets)?void 0:r.some((e=>{var t;return null==(t=e.events)?void 0:t.includes($a)}));if(this.reporter&&n.loading.first>0&&i)try{this.reporter.recordResponseReceived({request:{url:e},status:t.code,resourceTiming:{startTime:n.loading.start,responseStart:n.loading.first,duration:n.loading.end-n.loading.start,encodedBodySize:n.total}})}catch(e){this.hls.logger.warn("Could not record fragment response 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.registerListeners())}createReporter(){var e,t;const{cmcd:n}=this.config;if(null==n)return;const r=n.version||1;if(this.reporter=new Wo({sid:n.sessionId||this.hls.sessionId,cid:n.contentId,version:r,transmissionMode:!0===n.useHeaders?Uo:xo,enabledKeys:null!=(e=n.includeKeys)?e:[...r>=xa?So:no],eventTargets:(null!=(t=n.eventTargets)?t:[]).map((e=>{let{includeKeys:t}=e;return M(M({},D(e,zo)),{},{enabledKeys:null!=t?t:So})}))},n.loader),this.reporter.update({sf:Vo,sta:this.playerState}),n.reporterCallback){const e=this.reporter,t={updateCustomData:t=>{Jo(t)&&e.update(t)},recordCustomEvent:(t,n={})=>{Jo(n)&&e.recordEvent(Ga,M({cen:t},n))}};n.reporterCallback(t)}this.reporter.start()}registerListeners(){const e=this.hls;e.on(l.MANIFEST_LOADING,this.onManifestLoading,this),e.on(l.MEDIA_ATTA
1CHING,this.onMediaAttaching,this),e.on(l.MEDIA_DETACHED,this.onMediaDetached,this),e.on(l.MEDIA_ENDED,this.onMediaEnded,this),e.on(l.ERROR,this.onError,this),e.on(l.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(l.LEVEL_SWITCHED,this.onLevelSwitched,this),e.on(l.BUFFER_APPENDED,this.onBufferInfoChange,this),e.on(l.BUFFER_FLUSHED,this.onBufferInfoChange,this)}unregisterListeners(){const e=this.hls;e.off(l.MANIFEST_LOADING,this.onManifestLoading,this),e.off(l.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(l.MEDIA_DETACHED,this.onMediaDetached,this),e.off(l.MEDIA_ENDED,this.onMediaEnded,this),e.off(l.ERROR,this.onError,this),e.off(l.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(l.LEVEL_SWITCHED,this.onLevelSwitched,this),e.off(l.BUFFER_APPENDED,this.onBufferInfoChange,this),e.off(l.BUFFER_FLUSHED,this.onBufferInfoChange,this)}destroy(){this.unregisterListeners(),this.onMediaDetached(),this.reporter&&(this.reporter.stop(!0),this.reporter=void 0),this.hls=this.config=null,this.onWaiting=this.onPlay=this.onPlaying=this.onPause=null,this.onSeeking=this.onSeeked=this.onRateChange=this.media=null}onMediaAttaching(e,t){const n=this.media=t.media;this.setPlayerState(this.media.autoplay?Co:Do),ls(n,"waiting",this.onWaiting),ls(n,"play",this.onPlay),ls(n,"playing",this.onPlaying),ls(n,"pause",this.onPause),ls(n,"seeking",this.onSeeking),ls(n,"seeked",this.onSeeked),ls(n,"ratechange",this.onRateChange)}onMediaDetached(){const e=this.media;
1e&&(cs(e,"waiting",this.onWaiting),cs(e,"play",this.onPlay),cs(e,"playing",this.onPlaying),cs(e,"pause",this.onPause),cs(e,"seeking",this.onSeeking),cs(e,"seeked",this.onSeeked),cs(e,"ratechange",this.onRateChange),this.media=null)}onMediaEnded(e,t){this.setPlayerState(Po)}onManifestLoading(e,t){this.initialized=!1,this.starved=!1,this.buffering=!0,this.reporter&&(this.reporter.stop(!0),this.reporter=void 0),this.createReporter(),this.media||this.setPlayerState(Do)}onError(e,t){t.fatal&&(this.setPlayerState(Mo),this.reporter&&this.reporter.recordEvent(Fa,{ec:[t.details]}))}onLevelSwitching(e,t){var n;if(!this.reporter)return;const r={br:[t.bitrate/1e3]},s=null==(n=t.details)?void 0:n.fragments[0];s&&(r.ot=this.getObjectType(s,t)),this.reporter.recordEvent(Ba,r)}onLevelSwitched(e,t){const n=this.hls.levels[t.level];n&&(this.playheadLevel=n)}setPlayerState(e){this.playerState=e,this.reporter&&this.reporter.update({sta:e})}getStreamType(){const e=this.hls.latestLevelDetails;if(e)return e.live?e.partList&&e.canBlockReload?Yo:qo:Ko}apply(e,t={}){var n;if(!this.reporter)return;this.reporter.update({mtp:[this.hls.bandwidthEstimate/1e3],pr:null==(n=this.media)?void 0:n.playbackRate,st:this.getStreamType()});const r=t.ot===Ro||t.ot===Io||t.ot===Ao;this.starved&&r&&(t.bs=!0,t.su=!0,this.starved=!1),null==t.su&&(t.su=this.buffering);const s=this.reporter.createRequestReport({url:e.url,headers:e.headers},t);e.url=s.url,e.headers=s.headers}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,t){const{type:n}=e;if("subtitle"===n)return ko;if("initSegment"===e.sn)return Ro;if("audio"===n)return bo;if("main"===n){if(e.hasStreams){const t=e.elementaryStreams;if(t.audiovideo)return Ao;if(t.video)return Io;if(t.audio)return bo}if(t){const{audioCodec:e,videoCodec:n}=t;if(!this.hls.audioTracks.length){if(e&&n)return Ao;if(e)return bo}if(n)return Io}}}getTopBandwidth(){let e=0;const t=this.hls,n=t.maxAutoLevel,r=n>-1?n+1:t.levels.length;return t.levels.slice(0,r).forEach((t=>{t.bitrate>e&&(e=t.bitrate)})),e>0?e:NaN}getLowestBandwidth(){let e=1/0;const t=this.hls,n=t.maxAutoLevel,s=n>-1?n+1:t.levels.length;return t.levels.slice(0,s).forEach((t=>{t.bitrate<e&&(e=t.bitrate)})),r(e)?e:NaN}getBufferLength(e){if(!this.media)return NaN;const t="audio"===e.type?this.hls.audioForwardBufferInfo:this.hls.mainForwardBufferInfo;return t?1e3*t.len:NaN}getEventBufferLength(){if(!this.media)return NaN;const e=this.hls.mainForwardBufferInfo,t=this.hls.audioForwardBufferInfo;if(e&&t)return 1e3*Math.min(e.len,t.len);const n=e||t;return n?1e3*n.len:NaN}onBufferInfoChange(e,t){if(!this.reporter)return;const n=this.getEventBufferLength();r(n)&&this.reporter.update({bl:[n]})}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=this.recordFragmentResponse,r=e||this.config.loader;return class{constructor(e){this.loader=void 0,this.loader=new r(e)}get stats(){return this.loader.stats}get context(){return this.loader.context}destroy(){this.loader.destroy()}abort(){this.loader.abort()}load(e,r,s){t(e);const{onSuccess:i}=s;this.loader.load(e,r,M(M({},s),{},{onSuccess:(t,r,s,a)=>{i(t,r,s,a),n(e.url,t,r)}}))}}}},contentSteeringController:class extends q{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,998 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)===hn&&n.flags&mn){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,n.resolved||t.details===o.BUFFER_APPEND_ERROR&&!t.fatal||this.warn(`Could not resolve ${t.details} ("${t.error.message}") with content-steering for Pathway: ${s} levels: ${e?e.length:e} priorities: ${qt(r)} penalized: ${qt(this.penalizedPathways)}`))}}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,ts(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===E.AUDIO_TRACK&&r[n].hasAudioGroup(e)||t===E.SUBTITLE_TRACK&&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 tr(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=Qo(e.uri,t["STABLE-VARIANT-ID"],"PER-VARIANT-URIS",a),c=new Wt({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),Xo(this.audioTracks,n,a,s),Xo(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);xt(r,"_HLS_pathway",this.pathwayId),xt(r,"_HLS_throughput",""+e)}const s={type:E.STEERING_MANIFEST,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)}},iframeController:class extends q{constructor(e,t){var n;super("iframes",e.logger),this.hls=void 0,this.stats=void 0,this.variableList=null,this.initPTS=[],this.iframeInstances=void 0,this.instanceCounter=0,Xl||(n=t,Xl=class extends n{constructor(e,t,n,r){e.streamController||(e.streamController=ql),super(e),this._url=t,this.streamController.setInitPts(n),this.streamController.initDetails=r}loadSource(){}loadMediaAt(e,t=Jl){if(e<0)return;const n=M(M({},Jl),t);this.loadingEnabled||this.startLoad(e),this.streamController.loadMediaAt(e,n)}}),Ql||(Ql=function(e){return class extends e{constructor(e,t,n,r){e.cmcdController=void 0,e.emeController=void 0,e.streamController||(e.streamController=Yl),e.capLevelController=void 0,e.bufferController=void 0,super(e,t,n,r)}attachImage(e){this.streamController.image=e}detachImage(){this.streamController.image=void 0}loadSource(){}attachMedia(){throw new Error(zl)}detachMedia(){}recoverMediaError(){}transferMedia(){return null}loadMediaAt(e){if(e<0)return null;this.loadingEnabled||this.startLoad(e),this.streamController.loadMediaAt(e)}}}(Xl)),this.hls=e,this.iframeInstances=[],this.registerListeners()}registerListeners(){const e=this.hls;e&&(e.on(l.MANIFEST_LOADING,this.clearAsset,this),e.on(l.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(l.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(l.INIT_PTS_FOUND,this.onInitPtsFound,this),e.on(l.FRAG_BUFFERED,this.onFragBuffered,this),e.on(l.DESTROYING,this.onDestroying,this))}unregisterListeners(){const e=this.hls;e&&(e.off(l.MANIFEST_LOADING,this.clearAsset,this),e.off(l.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(l.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(l.INIT_PTS_FOUND,this.onInitPtsFound,this),e.off(l.FRAG_BUFFERED,this.onFragBuffered,this),e.off(l.DESTROYING,this.onDestroying,this))}clearAsset(){this.stats=void 0,this.variableList=null,this.initPTS=[],this.iframeInstances.forEach((e=>e.destroy())),this.iframeInstances.length=0}onDestroying(){this.unregisterListeners(),this.clearAsset(),this.hls=void 0}onManifestLoaded(e,t){this.stats=t.stats,this.variableList=t.variableList}onLevelsUpdated(e,{levels:t}){var n;const r=null==(n=this.hls)?void 0:n.pathwayPriority;t.length&&r&&this.iframeInstances.forEach((e=>{e.pathwayPriority=r}))}onInitPtsFound(e,{id:t,timestampOffsets:n}){t===y.MAIN&&(this.initPTS=n)}onFragBuffered(e,t){var n;const r=this.hls;r&&r.hasEnoughToStart&&((null==(n=r.mainForwardBufferInfo)?void 0:n.len)||0)>10&&this.iframeInstances.forEach((e=>{var t;e.loadingEnabled||e.startLoad((null==(t=this.hls)||null==(t=t.media)?void 0:t.currentTime)||0)}))}createIFramePlayer(e){var t;return this.createInstance(Xl,null==(t=this.hls)?void 0:t.iframeVariants,e)}createImageIFramePlayer(e){var t;const n=null==(t=this.hls)?void 0:t.iframeVariants.filter((e=>e.imageCodec));return this.createInstance(Ql,n,e,"image-")}createInstance(e,t,n,r){const{hls:s}=this;if(!s)return null;const{url:i,userConfig:a,latestLevelDetails:o,loadLevelObj:c,loadLevel:u,bandwidthEstimate:d,sessionId:h}=s,{stats:f,variableList:p}=this;if(null==t||!t.length||!f||!i)return null;const g=`${r||""}
1iframe-player-${this.instanceCounter++}`,m=s.levels,_=c||m[u],T=rn(_,a.videoPreference),E=(null==_?void 0:_.pathwayId)||".",y=new e(M(M({},a),{},{loggerId:g,primarySessionId:h,videoPreference:T,abrEwmaDefaultEstimate:d,streamController:void 0,audioStreamController:void 0,audioTrackController:void 0,subtitleStreamController:void 0,subtitleTrackController:void 0,timelineController:void 0,id3TrackController:void 0,fpsController:void 0,gapController:void 0,iframeController:void 0,cmcd:void 0,interstitialsController:void 0,backBufferLength:1/0,maxMaxBufferLength:1,capLevelToPlayerSize:!0,enableWorker:!1,autoStartLoad:!1,startFragPrefetch:!1,testBandwidth:!1,progressive:!1},n),i,this.initPTS,o);return this.iframeInstances=this.iframeInstances.filter((e=>!e.url)),this.iframeInstances.push(y),y.trigger(l.MANIFEST_LOADED,{levels:t,contentSteering:{uri:"",pathwayId:E},sessionKeys:null,audioTracks:[],iframeVariants:[],sessionData:null,startTimeOffset:null,stats:f,networkDetails:null,url:i,variableList:p}),y}},interstitialsController:class extends q{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.bufferPastEdge=!1,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;-1!==this.timelinePos||this.effectivePlayingItem||this.checkStart(),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(-1!==this.timelinePos||this.effectivePlayingItem||this.checkStart(),!(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=>dc(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=null),this.waitingItem=this.updateItem(this.waitingItem);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)>Zl&&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.indexOf(r.event.identifier)>-1)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 hc(e),this.schedule=new uc(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=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){cs(e,"play",this.onPlay),cs(e,"pause",this.onPause),cs(e,"seeking",this.onSeeking),cs(e,"timeupdate",this.onTimeupdate)}onMediaAttaching(e,t){const n=this.media=t.media;ls(n,"seeking",this.onSeeking),ls(n,"timeupdate",this.onTimeupdate),ls(n,"play",this.onPlay),ls(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!==ec.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(){return e.seekableStart}},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(){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})(e.seekableStart,"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} ${qt(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{const e=this.getBufferingPlayer();e?(s=e.transferMedia(),this.detachedData=s,c=`${e}`):c=l?"detached MediaSource":"detached media"}if(!s)if(l)s=this.detachedData,this.log(`using detachedData: MediaSource ${qt(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);if(this.log(`${u?"transfering MediaSource":"attaching media"} to ${a?e:"Primary"} from ${c} (media.currentTime: ${t.currentTime})`),!u&&!a)return void e.attachMedia(t);const d=u&&s?M({},s):{media:t},h=this.schedule;if(h&&a){const t=e.assetId===h.assetIdAtEnd;d.overrides={duration:h.duration,endOfStream:t||!1===e.appendInPlace}}if(!u&&o){const t=e,n=t.assetItem.timelineStart;if(n){const e=t.hls,r=Math.max(this.timelinePos-n,Number.EPSILON);e.startPosition!==r&&(this.log(`Set ${t} startPosition: ${r}`),e.config.startPosition=r,e.loadingEnabled&&e.startLoad(r))}}e.attachMedia(d)}onInterstitialCueEnter(){this.onTimeupdate()}checkStart(){const e=this.schedule,t=null==e?void 0:e.events,n=this.hls;if(!t||this.playbackDisabled||!this.media||!n)return;-1===this.bufferedPos&&(this.bufferedPos=0);const r=this.timelinePos,s=this.effectivePlayingItem;if(-1===r){if(!n.loadingEnabled)return void this.log("waiting for startLoad( <startPosition> )");const r=n.startPosition;if(this.timelinePos=r,0===t.length)this.setSchedulePosition(0);else if(t[0].cue.pre){this.log(pc("checkStart (preroll)",r));const n=e.findEventIndex(t[0].identifier);this.setSchedulePosition(n)}else if(r>=0||!this.primaryLive){this.log(pc("checkStart",r));const t=this.timelinePos=r>0?r:0,n=e.findItemIndexAtTime(t);this.setSchedulePosition(n)}else 0===n.liveSyncPosition?this.setSchedulePosition(0):this.log("[checkStart] waiting for live start")}else if(s&&!this.playingItem){this.log(pc("checkStart (playing item)",s.start));const t=e.findItemIndex(s);this.setSchedulePosition(t)}}advanceAssetBuffering(e,t){const n=e.event,r=n.findAssetIndex(t),s=ac(n,r);if(n.isAssetPastPlayoutLimit(s)){if(this.schedule){var i;const t=this.getNextItemIndex(e,!0),n=null==(i=this.schedule.items)?void 0:i[t];n&&this.bufferedToItem(n)}}else this.bufferedToEvent(e,s)}livePrerollResumption(e,t){if(e.cue.pre&&this.primaryLive&&!r(e.resumeOffset)&&this.hls){const e=this.getLiveStartPos();if(t){const t=this.getBufferingPlayer();return e+(null!=t&&t.interstitial.cue.pre?t.remaining:0)}return e}}getNextItemIndex(e,t){if(this.schedule){const n=this.livePrerollResumption(e.event,t);if(void 0!==n)return this.log(`find next item index @${n}`),this.schedule.findItemIndexAtTime(n)}return this.findItemIndex(e)+1}advanceAfterAssetEnded(e,t,n){const r=ac(e,n);if(e.isAssetPastPlayoutLimit(r)){if(this.schedule){const n=this.schedule.items;if(n){const r=n[t],s=r.event?this.getNextItemIndex(r):t+1;if(s>=n.length)return void this.setSchedulePosition(-1);const i=e.resumeTime;this.timelinePos<i&&(this.log(pc("advanceAfterAssetEnded",i)),this.timelinePos=i,e.appendInPlace&&!n[s].event&&this.hls.startLoad(i+.01),this.checkBuffer(this.bufferedPos<i)),this.setSchedulePosition(s)}}}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?dc(s):s}) pos: ${this.timelinePos}`);const i=this.waitingItem||this.playingItem,a=this.playingLastItem;if(this.isInterstitial(i)){const n=i.event,d=this.playingAsset,h=null==d?void 0:d.identifier,f=h?this.getAssetPlayer(h):null;if(f&&h&&(!this.eventItemsMatch(i,s)||void 0!==t&&h!==n.assetList[t].identifier)){var o;const t=n.findAssetIndex(d);if(this.log(`INTERSTITIAL_ASSET_ENDED ${t+1}/${n.assetList.length} ${oc(d)}`),this.endedAsset=d,this.playingAsset=null,this.hls.trigger(l.INTERSTITIAL_ASSET_ENDED,{asset:d,assetListIndex:t,event:n,schedule:r.slice(0),scheduleIndex:e,player:f}),i!==this.playingItem)return void(this.itemsMatch(i,this.playingItem)&&!this.playingAsset&&this.advanceAfterAssetEnded(n,this.findItemIndex(this.playingItem),t));this.retreiveMediaSource(h,s),!f.media||null!=(o=this.detachedData)&&o.mediaSource||f.detachMedia()}if(!this.eventItemsMatch(i,s)&&(this.endedItem=i,this.playingItem=this.waitingItem=null,this.log(`INTERSTITIAL_ENDED ${n} ${dc(i)}`),n.hasPlayed=!0,this.hls.trigger(l.INTERSTITIAL_ENDED,{event:n,schedule:r.slice(0),scheduleIndex:e}),n.cue.once&&this.hls)){var c;this.updateSchedule();const e=null==(c=this.schedule)?void 0:c.items;if(s&&e){const o=this.findItemIndex(s),l=this.livePrerollResumption(n);if(void 0!==l){let t=l;const s=this.getNextItemIndex(i);if(!this.isInterstitial(r[s])){var u;const e=null==(u=this.primaryDetails)?void 0:u.fragments;if(n.snapOptions.in&&e){const n=an(null,e,l);n&&(t=Math.min(Math.max(r[s].start,rc(t,n)),r[s].end))}}if(this.log(pc("live join (preroll)",t)),this.timelinePos=t,s!==o&&(s||0===s))return void this.advanceSchedule(s,e,void 0,i,a)}this.advanceSchedule(o,e,t,i,a)}return}}this.advanceSchedule(e,r,t,i,a)}
1advanceSchedule(e,t,n,r,s){const i=this.schedule;if(!i)return;const a=t[e]||null,o=this.primaryMedia,c=this.playerQueue;if(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=ac(s,(n=s.cue.pre?0: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 ${dc(a)} ${s.appendInPlace?"append in place":""}`),s.hasPlayed=!1,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&&fc(u.media)}else a?(this.resumePrimary(a,e,r),this.shouldPlay&&fc(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;this.playingItem=e,this.playingAsset=this.endedAsset=null,this.waitingItem=null,this.bufferedToItem(e),this.endedItem=null,this.log(`resuming ${dc(e)}`);let i=this.timelinePos;if(null!=(r=this.detachedData)&&r.mediaSource?this.primaryLive&&this.startLoadingPrimaryAt(i):((i<e.start||i>=e.end||i<this.seekableStart)&&(i=this.getPrimaryResumption(e,t),this.log(pc("resumePrimary",i)),this.timelinePos=i),this.attachPrimary(i,e)),!n)return;const a=null==(s=this.schedule)?void 0:s.items;a&&(this.log(`INTERSTITIALS_PRIMARY_RESUMED ${dc(e)}`),this.hls.trigger(l.INTERSTITIALS_PRIMARY_RESUMED,{schedule:a.slice(0),scheduleIndex:t}),this.checkBuffer())}get seekableStart(){var e;return this.primaryLive&&(null==(e=this.primaryDetails)?void 0:e.fragmentStart)||0}getPrimaryResumption(e,t,n){const r=e.start;if(this.primaryLive){if(0===t)return this.hls.startPosition;const e=this.endedItem||this.playingItem,s=null!=e&&e.event?this.livePrerollResumption(e.event,n):void 0;if(void 0!==s)return s;const i=this.primaryDetails;if(i){const{fragmentStart:e,edge:t}=i;if(r<e||r>t&&!n){const n=this.hls.liveSyncPosition;return this.log(`primary resumption out of bounds (${r} [${e}-${t}]) snapping to liveSync ${n}`),n||e}}}return this.log(`primary resumption itemStart: ${r}`),r}getLiveStartPos(){var e;const t=this.hls.startPosition,n=this.hls.liveSyncPosition||0,r=3*((null==(e=this.primaryDetails)?void 0:e.targetduration)||10);return-1===t||n&&n-t<r?n||0:t}isAssetBuffered(e){const t=this.getAssetPlayer(e.identifier);if(null!=t&&t.hls)return t.hls.bufferedToEnd;return qn.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(pc("attachPrimary",e)),this.timelinePos=e,this.startLoadingPrimaryAt(e,n))}
1startLoadingPrimaryAt(e,t){const n=this.hls,{loadingEnabled:r,bufferingEnabled:s,startPosition:i}=n,a=n.hasEnoughToStart;if(this.log(`Start loading primary @${e} bufferedPos: ${this.bufferedPos} startPosition: ${i} skip seek: ${t} has enough ${a} loadingEnabled: ${r} bufferingEnabled: ${s}`),!t&&a||!r||Math.abs(i-e)>.1){const r=this.primaryDetails;if(null!=r&&r.live&&e+.5>=r.edge){const t=this.bufferingItem;return this.log(`Resume primary loading when live passes ${e} buffering item: ${t?dc(t):null}`),n.pauseBuffering(),void(this.bufferPastEdge=!0)}n.startLoad(e,t)}else s||n.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=M(M({},this.mediaSelection||this.altSelection),{},{main:n});this.mediaSelection=r;const s=this.hls.startPosition;this.schedule.parseInterstitialDateRanges(r,this.hls.config.interstitialAppendInPlace,-1===s?0:s);if(this.schedule.items)if(this.effectivePlayingItem){if(this.bufferPastEdge){const e=this.primaryDetails,t=this.bufferedPos;if(null!=e&&e.live&&t+.5<e.edge){this.bufferPastEdge=!1;const n=this.bufferingItem;this.log(`Live edge ${e.edge} passed buffer: ${t} buffering item: ${n?dc(n):null}`);if((null==n?void 0:n.end)===1/0){const e=this.playingItem,r=this.isInterstitial(e)&&e.event.appendInPlace;this.hls.startLoad(Math.max(t,n.start),r)}else{const e=this.getBufferingPlayer();if(e){e.bufferedInPlaceToEnd(this.primaryMedia,e.currentTime)&&e.hls&&e.hls.trigger(l.BUFFERED_TO_END,void 0)}}}}}else this.checkStart()}onAudioTrackUpdated(e,t){const n=this.hls.audioTracks[t.id],r=this.mediaSelection;if(!r)return void(this.altSelection=M(M({},this.altSelection),{},{audio:n}));const s=M(M({},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=M(M({},this.altSelection),{},{subtitles:n}));const s=M(M({},r),{},{subtitles:n});this.mediaSelection=s}onAudioTrackSwitching(e,t){const n=Jt(t);this.playerQueue.forEach((({hls:e})=>e&&(e.setAudioOption(t)||e.setAudioOption(n))))}onSubtitleTrackSwitch(e,t){const n=Jt(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 n=t[e];if(n.cue.post){const e=this.getEventItem(n.identifier);e&&this.eventItemsMatch(e,this.bufferingItem)&&this.bufferedToItem(e,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}updateItem(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=qn.bufferInfo(this.primaryMedia,n,0);if(r.end>n||(r.nextStart||0)>n){this.log(`trim buffered interstitial ${dc(e)} (was ${dc(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;
1return!!t&&(e===t||e.event.identifier===(null==(n=t.event)?void 0:n.identifier))}findEventIndex(e){return this.schedule?this.schedule.findEventIndex(e):-1}getEventItem(e){if(this.schedule){var t;const n=null==(t=this.schedule.items)?void 0:t[this.findEventIndex(e)];if(this.isInterstitial(n)&&n.event.identifier===e)return n}}findItemIndex(e,t){return e&&this.schedule?this.schedule.findItemIndex(e,t):-1}updateSchedule(e=!1){var t,n;const r=this.mediaSelection;if(!r)return;const s=(null==(t=this.hls)?void 0:t.liveSyncPosition)||0;null==(n=this.schedule)||n.updateSchedule(r,[],s,e)}checkBuffer(e){var t;const n=null==(t=this.schedule)?void 0:t.items;if(!n)return;const r=qn.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 ${dc(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.getPrimaryResumption(e,this.findItemIndex(e),!0),n=this.bufferedPos=Math.max(t,Math.min(this.bufferedPos,e.end),this.timelinePos,e.start),r=this.detachedData;if(r)if(r.mediaSource){const t=!0;this.attachPrimary(n,e,t)}else this.startLoadingPrimaryAt(n);else{const e=this.playingItem,t=this.isInterstitial(e)&&e.event.appendInPlace;this.startLoadingPrimaryAt(n,t)}}}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,i=this.playingItem,o=this.getBufferingPlayer();var a;if(e.appendInPlace)this.isInterstitial(i)||(null==i||null==(a=i.nextEvent)?void 0:a.identifier)!==e.identifier||this.flushFrontBuffer(s+.25);let l,c=0;if(o&&!o.interstitial.cue.pre||!this.primaryLive||(c=this.getLiveStartPos(),o&&(c+=o.remaining)),c&&!e.cue.pre&&!e.cue.post){const e=c-s;e>0&&(l=Math.round(1e3*e)/1e3)}if(this.log(`Load interstitial asset ${t+1}/${n?1:r} ${e}${c?` live-start: ${c} start-offset: ${l} (timeline-start: ${s})`:""}`),n)return this.createAsset(e,0,0,s,e.duration,n);const u=this.assetListLoader.loadAssetList(e,l);u&&(e.assetListLoader=u)}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;const n=this.primaryDetails;if(n&&e>=n.edge)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:tc(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,i=rn(r.loadLevelObj||r.levels[r.currentLevel],s.videoPreference),c=r.audioTracks[r.audioTrack],u=r.subtitleTracks[r.subtitleTrack];let d=0;if(this.primaryLive||e.appendInPlace){const e=this.timelinePos-t.timelineStart;if(e>=0){const n=t.duration;n&&e<n&&(d=e)}}const h=t.identifier,f=M(M({},s),{},{maxMaxBufferLength:Math.min(15,r.config.maxMaxBufferLength),autoStartLoad:!0,startFragPrefetch:!0,primarySessionId:r.sessionId,assetPlayerId:h,abrEwmaDefaultEstimate:r.bandwidthEstimate,interstitialsController:void 0,startPosition:d,liveDurationInfinity:!1,testBandwidth:!1,videoPreference:i,audioPreference:c||s.audioPreference,subtitlePreference:u||s.subtitlePreference});e.appendInPlace&&(e.appendInPlaceStarted=!0,t.timelineStart&&(f.timelineOffset=t.timelineStart));const p=f.cmcd;null!=p&&p.sessionId&&p.contentId&&(f.cmcd=w({},p,{contentId:pl(t.uri)})),this.getAssetPlayer(h)&&this.warn(`Duplicate date range identifier ${e} and asset ${h}`);const g=new lc(this.HlsPlayerClass,f,e,t);this.playerQueue.push(g),e.assetList[n]=t;let m=!0;const _=r=>{if(r.live){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},s=this.findEventIndex(e.identifier);return void this.handleAssetItemError(r,e,s,n,t.message)}const s=r.edge-r.fragmentStart,i=t.duration;(m||null===i||s>i)&&(m=!1,this.log(`Interstitial asset "${h}" duration change ${i} > ${s}`),t.duration=s,this.updateSchedule())};g.on(l.LEVEL_UPDATED,((e,{details:t})=>_(t))),g.on(l.LEVEL_PTS_UPDATED,((e,{details:t})=>_(t))),g.on(l.EVENT_CUE_ENTER,(()=>this.onInterstitialCueEnter()));const T=(e,t)=>{const n=this.getAssetPlayer(h);if(n&&t.tracks){n.off(l.BUFFER_CODECS,T),n.tracks=t.tracks;const e=this.primaryMedia;this.bufferingAsset===n.assetItem&&e&&!n.media&&this.bufferAssetPlayer(n,e)}};g.on(l.BUFFER_CODECS,T);g.on(l.BUFFERED_TO_END,(()=>{const t=this.getAssetPlayer(h);if(this.log(`buffered to end of asset ${t}`),!t||!this.schedule)return;const n=this.getEventItem(e.identifier);n&&this.advanceAssetBuffering(n,t.assetItem)}));const E=t=>()=>{if(!this.getAssetPlayer(h)||!this.schedule)return;this.shouldPlay=!0;const n=this.findEventIndex(e.identifier);this.advanceAfterAssetEnded(e,n,t)};return g.once(l.MEDIA_ENDED,E(n)),g.once(l.PLAYOUT_LIMIT_REACHED,E(1/0)),g.on(l.ERROR,((t,r)=>{if(!this.schedule)return;const s=this.getAssetPlayer(h);if(r.details===o.BUFFER_STALLED_ERROR)return null!=s&&s.appendInPlace?void this.handleInPlaceStall(e):(this.onTimeupdate(),void this.checkBuffer(!0));r.details!==o.BUFFER_SEEK_OVER_HOLE&&this.handleAssetItemError(r,e,this.findEventIndex(e.identifier),n,`Asset player error ${r.error} ${e}`)})),g.on(l.DESTROYING,(()=>{if(!this.getAssetPlayer(h)||!this.schedule)return;const t=new Error(`Asset player destroyed unexpectedly ${h}`),r={fatal:!0,type:a.OTHER_ERROR,details:o.INTERSTITIAL_ASSET_ITEM_ERROR,error:t};this.handleAssetItemError(r,e,this.findEventIndex(e.identifier),n,t.message)})),this.log(`INTERSTITIAL_ASSET_PLAYER_CREATED ${oc(t)}`),this.hls.trigger(l.INTERSTITIAL_ASSET_PLAYER_CREATED,{asset:t,assetListIndex:n,event:e,player:g}),g}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?dc(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,(null==u?void 0:u.identifier)!==o&&(u&&(this.clearAssetPlayer(u.identifier,n[r]),delete u.error),this.log(`INTERSTITIAL_ASSET_STARTED ${t+1}/${c} ${oc(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;if(!this.schedule)return;const{interstitial:r,assetItem:s}=e,i=this.getEventItem(r.identifier);if(!i)return;if(e.loadSource(),this.setBufferingItem(i),this.bufferingAsset=s,e.bufferedInPlaceToEnd(this.primaryMedia,e.currentTime))return void this.advanceAssetBuffering(i,s);const l=this.getBufferingPlayer();if(l===e)return;const c=r.appendInPlace;if(c&&!1===(null==l?void 0:l.interstitial.appendInPlace))return;const u=(null==l?void 0:l.tracks)||(null==(n=this.detachedData)?void 0:n.tracks)||this.requiredTracks;if(c&&s!==this.playingAsset){if(!e.tracks)return void this.log(`Waiting for track info before buffering ${e}`);if(u&&!te(u,e.tracks)){const t=new Error(`Asset ${oc(s)} SourceBuffer tracks ('${Object.keys(e.tracks)}') are not compatible with primary content tracks ('${Object.keys(u)}')`),n={fatal:!0,type:a.OTHER_ERROR,details:o.INTERSTITIAL_ASSET_ITEM_ERROR,error:t},i=r.findAssetIndex(s);return void this.handleAssetItemError(n,r,this.findEventIndex(r.identifier),i,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.currentTime))&&a.hls){const n=t.findEventIndex(e.identifier);this.advanceAfterAssetEnded(e,n,s)}}}}advanceInPlace(e){const t=this.primaryMedia;if(t&&t.currentTime<e){const n=`advance currentTime to ${e}, duration: ${t.duration}`;t.duration>e?(this.log(n),t.currentTime=e):this.log(`Cannot ${n}`)}}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?oc(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=w({},e,{fatal:!1,errorAction:bn(!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):(null==f?void 0:f.identifier)===a?this.advanceAfterAssetEnded(t,n,r):(null==p?void 0:p.identifier)===a&&this.isInterstitial(this.bufferingItem)&&this.advanceAssetBuffering(this.bufferingItem,p)}primaryFallback(e){const t=e.timelineStart,n=this.effectivePlayingItem,r=this.playingItem,s=this.seekableStart,i=this.hls.startPosition;let a=this.timelinePos;if(this.isInterstitial(n)){this.log(`Fallback to primary from event "${e.identifier}" start: ${t} pos: ${a} playing: ${dc(n)} startPosition: ${i} seekableStart: ${s} error: ${e.error}`),-1===a&&(a=i),a=Math.max(a,s);const r=this.updateItem(n,a);this.itemsMatch(n,r)&&this.clearInterstitial(e,null),e.appendInPlace&&(this.attachPrimary(t,null),this.flushFrontBuffer(t))}else if(-1===a)return void this.checkStart();if(!this.schedule)return;if(!this.isInterstitial(r))return;const o=this.schedule.findItemIndexAtTime(a);this.setSchedulePosition(o)}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}`);
1const 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){const e=this.findEventIndex(i),t=this.getEventItem(i);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);const t=this.primaryMedia;this.log(`Primary player stall @${this.timelinePos} currentTime: ${null==t?void 0:t.currentTime} bufferedPos: ${this.bufferedPos}`),this.onTimeupdate(),this.checkBuffer(!0);break}}}}});function qc(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"');if(void 0!==t.liveMaxUnchangedPlaylistRefresh){const e=t.liveMaxUnchangedPlaylistRefresh,a=(r=e,s=2,i=1/0,Math.max(s,Math.min(r,i)));a!==e&&n.warn(`hls.js config: "liveMaxUnchangedPlaylistRefresh" clamped from ${e} to ${a}.`),t.liveMaxUnchangedPlaylistRefresh=a}var r,s,i;const a=Yc(e),o=["TimeOut","MaxRetry","RetryDelay","MaxRetryTimeout"];return["manifest","level","frag"].forEach((e=>{const r=`${"level"===e?"playlist":e}LoadPolicy`,s=void 0===t[r],i=[];o.forEach((n=>{const o=`${e}Loading${n}`,l=t[o];if(void 0!==l&&s){i.push(o);const e=a[r].default;switch(t[r]={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}}})),i.length&&n.warn(`hls.js config: "${i.join('", "')}" setting(s) are deprecated, use "${r}": ${qt(t[r])}`)})),M(M({},a),t)}function Yc(e){return e&&"object"==typeof e?Array.isArray(e)?e.map(Yc):Object.keys(e).reduce(((t,n)=>(t[n]=Yc(e[n]),t)),{}):e}function zc(e,t){const n=e.loader;if(n!==Gc&&n!==Vc)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})()&&(e.loader=Gc,e.progressive=!0,e.enableSoftwareAES=!0,t.log("[config]: Progressive streaming enabled, using FetchLoader"))}}class Jc extends Xi{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.lastABRSwitchTime=-1,this._iframeVariants=[],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()}
vendor: 36,864 bytes, line 1
1stopLoad(){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,this._iframeVariants=[]}onManifestLoading(e,t){this.resetLevels()}onManifestLoaded(e,t){const n=this.hls.config.preferManagedMediaSource,r=[],s={},i={};let a=!1,o=!1,l=!1,c=!1;t.levels.forEach((e=>{const t=e.attrs,u=Zc(e,n),{audioCodec:d,videoCodec:h,imageCodec:f,width:p,height:g}=e;if(!u)return void this.log(`Some or all CODECS not supported "${t.CODECS}"`);a||(a=!(!p||!g)),o||(o=!!h),l||(l=!!d),c||(c=!!f);const{CODECS:m,"FRAME-RATE":_,"HDCP-LEVEL":T,"PATHWAY-ID":E,RESOLUTION:y,"VIDEO-RANGE":S}=t,v=`${`${E||"."}-`}${e.bitrate}-${y}-${_}-${m}-${S}-${T}`;if(s[v])if(s[v].uri===e.url||e.attrs["PATHWAY-ID"])e.iframes||(s[v].addGroupId("audio",t.AUDIO),s[v].addGroupId("text",t.SUBTITLES));else{const t=i[v]+=1;e.attrs["PATHWAY-ID"]=new Array(t+1).join(".");const n=this.createLevel(e);s[v]=n,r.push(n)}else{const t=this.createLevel(e);s[v]=t,i[v]=1,r.push(t)}})),this.filterAndSortMediaOptions(r,t,a,o,l,c)}createLevel(e){const t=new Wt(e),n=e.supplemental;if(null!=n&&n.videoCodec&&!Qc(n.videoCodec,this.hls.config.preferManagedMediaSource)){const e=new Error(`SUPPLEMENTAL-CODECS not supported "${n.videoCodec}"`);this.log(e.message),t.supportedResult=Nt(e,[])}return t}filterAndSortMediaOptions(e,t,n,r,s,i){var c;let u=[],d=[],h=e;const f=(null==(c=t.stats)?void 0:c.parsing)||{},p=this.hls.config.preferManagedMediaSource;if((n||r)&&s&&(h=h.filter((({videoCodec:e,videoRange:t,width:n,height:r})=>{return(!!e||!(!n||!r))&&(!!(s=t)&&Bt.indexOf(s)>-1);var s}))),r&&i&&(h=h.filter((e=>!e.imageCodec))),0===h.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: ${qt(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(f.end=performance.now());t.audioTracks&&(u=t.audioTracks.filter((e=>!e.audioCodec||Xc(e.audioCodec,p))),eu(u)),t.subtitles&&(d=t.subtitles,eu(d));const g=h.slice(0);h.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 Bt.indexOf(e.videoRange)-Bt.indexOf(t.videoRange);if(e.videoCodec!==t.videoCodec){const n=Et(e.videoCodec),r=Et(t.videoCodec);if(n!==r)return r-n}if(e.uri===t.uri&&e.codecSet!==t.codecSet){const n=yt(e.codecSet),r=yt(t.codecSet);if(n!==r)return r-n}return e.averageBitrate!==t.averageBitrate?e.averageBitrate-t.averageBitrate:0}));let m=g[0];if(this.steering&&(h=this.steering.filterParsedLevels(h),h.length!==g.length))for(let e=0;e<g.length;e++)if(g[e].pathwayId===h[0].pathwayId){m=g[e];break}this._levels=h;for(let e=0;e<h.length;e++)if(h[e]===m){var _;this._firstLevel=e;const t=m.bitrate,n=this.hls.bandwidthEstimate;if(this.log(`manifest loaded, ${h.length} level(s) found, first bitrate: ${t}`),void 0===(null==(_=this.hls.userConfig)?void 0:_.abrEwmaDefaultEstimate)){const e=Math.min(t,this.hls.config.abrEwmaDefaultEstimateMax);e>n&&n===this.hls.abrEwmaDefaultEstimate&&(this.hls.bandwidthEstimate=e)}break}const T=t.iframeVariants.filter((e=>Zc(e,p)));this._iframeVariants=T;const E=s&&!r,y=this.hls.config,S=!(!y.audioStreamController||!y.audioTrackController),v={levels:h,audioTracks:u,subtitleTracks:d,iframeVariants:T,sessionData:t.sessionData,sessionKeys:t.sessionKeys,firstLevel:this._firstLevel,stats:t.stats,audio:s,video:r,altAudio:S&&!E&&u.some((e=>!!e.url))};f.end=performance.now(),this.hls.trigger(l.MANIFEST_PARSED,v)}get iframeVariants(){return 0===this._iframeVariants.length?null:this._iframeVariants}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===E.LEVEL&&t.context.level===this.level&&this.checkRetry(t)}onFragBuffered(e,{frag:t}){if(t.type===y.MAIN){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){const t=this.currentLevelIndex;if(-1===this.manualLevelIndex&&e!==t&&-1!==e){const n=this.hls.config.abrSwitchInterval;if(n>0){const r=performance.now(),s=r-this.lastABRSwitchTime,i=1e3*n;if(this.lastABRSwitchTime>-1&&s<i)return void this.warn(`Preventing ABR level switch: ${t} -> ${e} (${Math.round(s)}ms < ${i}ms / ${n}s)`);this.lastABRSwitchTime=r,this.log(`Allowing ABR level switch: ${t} -> ${e} (${Math.round(s)}ms >= ${i}ms / ${n}s)`)}}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)));ts(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 Xc(e,t){return mt(e,"audio",t)}function Qc(e,t){return mt(e,"video",t)}function Zc(e,t){let{audioCodec:n,videoCodec:r}=e;n&&(e.audioCodec=n=bt(n,t)||void 0),r&&(r=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(",")}(r));const{unknownCodecs:s}=e;return!((null==s?void 0:s.length)||0||n&&!Xc(n,t)||r&&!Qc(r,t))}function eu(e){const t={};e.forEach((e=>{const n=e.groupId||"";e.id=t[n]=t[n]||0,t[n]++}))}class tu extends q{constructor(e,t){super("key-loader",t),this.config=void 0,this.keyLoaderInfo={},this.emeController=null,this.config=e}abort(e){for(const n in this.keyLoaderInfo){const r=this.keyLoaderInfo[n].loader;if(r){var t;if(e&&e!==(null==(t=r.context)?void 0:t.frag.type))return;r.abort()}}}destroy(){for(const e in this.keyLoaderInfo){const t=this.keyLoaderInfo[e].loader;t&&t.destroy()}this.emeController=null,this.keyLoaderInfo={}}loadClear(e,t,n){return this.emeController?this.emeController.loadClear(e,t,n):null}load(e,t){return!e.decryptdata&&e.encrypted&&this.emeController&&this.config.emeEnabled?this.emeController.selectKeySystemFormat(e).then((n=>this.loadInternal(e,t,n))):this.loadInternal(e,t)}loadInternal(e,t,n){n&&e.setKeyFormat(n);const r=e.decryptdata;if(!r){const t=new Error(n?`Expected frag.decryptdata to be defined after setting format ${n}`:`Missing decryption data on fragment in onKeyLoading (emeEnabled with controller: ${this.emeController&&this.config.emeEnabled})`);return Promise.reject(nu(e,o.KEY_LOAD_ERROR,t))}const s=e;switch(r.method){case"SAMPLE-AES":case"SAMPLE-AES-CENC":case"SAMPLE-AES-CTR":return"identity"===r.keyFormat?this.loadKeyHTTP(s):t?t.then((()=>this.loadKeyEME(s))):this.loadKeyEME(s);case"AES-128":case"AES-256":case"AES-256-CTR":return this.loadKeyHTTP(s);default:return Promise.reject(nu(e,o.KEY_LOAD_ERROR,new Error(`Key supplied with unsupported METHOD: "${r.method}"`)))}}loadKeyEME(e){if(this.emeController&&this.config.emeEnabled){var t;if(!e.decryptdata.keyId&&null!=(t=e.initSegment)&&t.data){const t=function(e){const t=[];return qe(e,(e=>t.push(e.subarray(8,24)))),t}(e.initSegment.data);if(t.length){let n=t[0];const r=e.decryptdata.uri;if(n.some((e=>0!==e)))this.log(`Using keyId found in init segment ${ve(n)} keyUri: ${r}`),Rr.setKeyIdForUri(r,n);else{const e=Rr.addKeyIdForUri(r);this.log(`Patching empty keyId with ${ve(e)} keyUri: ${r}`),n=e}e.decryptdata.keyId=n}}return this.emeController.loadKey(e).then((()=>({frag:e,keyInfo:{decryptdata:e.decryptdata}})))}return Promise.reject(nu(e,o.KEY_LOAD_ERROR,new Error(`emeEnabled with controller: ${this.emeController&&this.config.emeEnabled})`)))}loadKeyHTTP(e){const t=e.decryptdata,n=t.uri;if(!n)return Promise.reject(nu(e,o.KEY_LOAD_ERROR,new Error(`Invalid key URI: "${n}"`)));const r=this.keyLoaderInfo[n];if(r){if(r.decryptdata.key)return t.key=r.decryptdata.key,r.keyLoadPromise=null,Promise.resolve({frag:e,keyInfo:r});if(r.keyLoadPromise)return r.keyLoadPromise.then((n=>(t.key=r.decryptdata.key,M(M({},n),{},{frag:e}))))}this.log(`Loading${t.keyId?" keyId: "+ve(t.keyId):""} URI: ${t.uri} from ${e.type} ${e.level}`);const s=this.config,i=new(0,s.loader)(s);e.keyLoader=i;const a=this.keyLoaderInfo[n]={decryptdata:t,keyLoadPromise:null,loader:i};return a.keyLoadPromise=new Promise(((t,r)=>{const l={type:E.KEY,keyInfo:a,frag:e,responseType:"arraybuffer",url:n},c=s.keyLoadPolicy.default,u={loadPolicy:c,timeout:c.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},d={onSuccess:(e,n,s,i)=>{const{frag:a,keyInfo:l,url:c}=s;if(!a.decryptdata||l!==this.keyLoaderInfo[c])return r(nu(a,o.KEY_LOAD_ERROR,new Error("after key load, decryptdata unset or changed"),i));l.decryptdata.key=a.decryptdata.key=new Uint8Array(e.data),a.keyLoader=l.loader=l.keyLoadPromise=null,t({frag:a,keyInfo:l})},onError:(t,s,i,a)=>{this.resetLoader(s),r(nu(e,o.KEY_LOAD_ERROR,new Error(`HTTP Error ${t.code} loading key ${t.text}`),i,M({url:n,data:void 0},t)))},onTimeout:(t,n,s)=>{this.resetLoader(n),r(nu(e,o.KEY_LOAD_TIMEOUT,new Error("key loading timed out"),s))},onAbort:(t,n,s)=>{this.resetLoader(n),r(nu(e,o.INTERNAL_ABORTED,new Error("key loading aborted"),s))}};i.load(l,u,d)}))}resetLoader(e){const{frag:t,keyInfo:n,url:r}=e,s=n.loader;t.keyLoader===s&&(t.keyLoader=n.loader=n.keyLoadPromise=null),delete this.keyLoaderInfo[r],s&&s.destroy()}}function nu(e,t=o.KEY_LOAD_ERROR,n,r,s){return new jn({type:a.NETWORK_ERROR,details:t,fatal:!1,frag:e,response:s,error:n,networkDetails:r||null})}function ru(e){const{type:t}=e;switch(t){case E.AUDIO_TRACK:return y.AUDIO;case E.SUBTITLE_TRACK:return y.SUBTITLE;default:return y.MAIN}}function su(e,t){let n=e.url;return void 0!==n&&0!==n.indexOf("data:")||(n=t.url),n}class iu{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:E.MANIFEST,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:E.LEVEL,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:E.AUDIO_TRACK,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:E.SUBTITLE_TRACK,url:s,deliveryDirectives:i,levelOrTrack:a})}onLevelsUpdated(e,t){const n=this.loaders[E.LEVEL];if(n){const e=n.context;e&&!t.levels.some((t=>t===e.levelOrTrack))&&(n.abort(),delete this.loaders[E.LEVEL])}}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((null==n?void 0: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===E.MANIFEST?n.manifestLoadPolicy.default:w({},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===E.LEVEL&&null!==e.level?t=this.hls.levels[e.level].details:e.type===E.AUDIO_TRACK&&null!==e.id?t=this.hls.audioTracks[e.id].details:e.type===E.SUBTITLE_TRACK&&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=w({},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(),Pr.isMediaPlaylist(i)||n.type!==E.MANIFEST?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=su(e,n),o=Pr.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,iframeVariants:d,sessionData:h,sessionKeys:f,startTimeOffset:p,variableList:g}=o;this.variableList=g,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];mt(a,"audio",n)?(e.audioCodec=r=r?`${r},${a}`:a,pt.audio[r.substring(0,4)]=2,t.splice(i,1)):mt(a,"video",n)&&(e.videoCodec=s=s?`${s},${a}`:a,pt.video[s.substring(0,4)]=2,t.splice(i,1))}}}));const{AUDIO:m=[],SUBTITLES:_,"CLOSED-CAPTIONS":T}=Pr.parseMasterPlaylistMedia(i,a,o);if(m.length){m.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"),m.unshift({type:"main",name:"main",groupId:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new tr({}),bitrate:0,url:""}))}s.trigger(l.MANIFEST_LOADED,{levels:u,audioTracks:m,subtitles:_,iframeVariants:d,captions:T,contentSteering:c,url:a,stats:t,networkDetails:r,sessionData:h,sessionKeys:f,startTimeOffset:p,variableList:g})}handleTrackOrLevelPlaylist(e,t,n,s,i){const a=this.hls,{id:o,level:c,type:u}=n,d=su(e,n),h=r(c)?c:r(o)?o:0,f=ru(n),p=Pr.parseLevelPlaylist(e.data,d,h,f,0,this.variableList);if(u===E.MANIFEST){const e={attrs:new tr({}),bitrate:0,details:p,name:"",url:d};p.requestScheduled=t.loading.start+Xr(p,0),a.trigger(l.MANIFEST_LOADED,{levels:[e],audioTracks:[],iframeVariants:[],url:d,stats:t,networkDetails:s,sessionData:null,sessionKeys:null,contentSteering:null,startTimeOffset:null,variableList:null})}t.parsing.end=performance.now(),n.levelDetails=p,this.handlePlaylistLoaded(p,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===E.MANIFEST,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===E.LEVEL?i+=`: ${e.level} id: ${e.id}`:e.type!==E.AUDIO_TRACK&&e.type!==E.SUBTITLE_TRACK||(i+=` id: ${e.id} group-id: "${e.groupId}"`);const c=new Error(i);this.hls.logger.warn(`[playlist-loader]: ${i}`);let u=o.UNKNOWN,d=!1;const h=this.getInternalLoader(e);switch(e.type){case E.MANIFEST:u=n?o.MANIFEST_LOAD_TIMEOUT:o.MANIFEST_LOAD_ERROR,d=!0;break;case E.LEVEL:u=n?o.LEVEL_LOAD_TIMEOUT:o.LEVEL_LOAD_ERROR,d=!1;break;case E.AUDIO_TRACK:u=n?o.AUDIO_TRACK_LOAD_TIMEOUT:o.AUDIO_TRACK_LOAD_ERROR,d=!1;break;case E.SUBTITLE_TRACK:u=n?o.SUBTITLE_TRACK_LOAD_TIMEOUT:o.SUBTITLE_LOAD_ERROR,d=!1}h&&this.resetInternalLoader(e.type);const f={type:a.NETWORK_ERROR,details:u,fatal:d,url:e.url,loader:h,context:e,error:c,networkDetails:t,stats:s};if(r){let n=e.url;t&&"url"in t&&(n=t.url),f.response=M({url:n,data:void 0},r)}this.hls.trigger(l.ERROR,f)}handlePlaylistLoaded(e,t,n,r,s,i){const c=this.hls,{type:u,level:d,levelOrTrack:h,id:f,groupId:p,deliveryDirectives:g}=r,m=su(t,r),_=ru(r);let T="number"==typeof r.level&&_===y.MAIN?d:void 0;h&&"iframes"in h&&h.iframes&&!e.iframesOnly&&(e.playlistParsingError=new Error("EXT-X-I-FRAME-STREAM-INF media playlist MUST contain an EXT-X-I-FRAMES-ONLY tag"),e.iframesOnly=!0);const S=e.playlistParsingError;if(S){if(this.hls.logger.warn(`${S} ${e.url}`),!c.config.ignorePlaylistParsingErrors)return void c.trigger(l.ERROR,{type:a.NETWORK_ERROR,details:o.LEVEL_PARSING_ERROR,fatal:!1,url:m,error:S,reason:S.message,response:t,context:r,level:T,parent:_,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)),u){case E.MANIFEST:case E.LEVEL:if(T)if(h){if(h!==c.levels[T]){const e=c.levels.indexOf(h);e>-1&&(T=e)}}else T=0;c.trigger(l.LEVEL_LOADED,{details:e,levelInfo:h||c.levels[0],level:T||0,id:f||0,stats:n,networkDetails:s,deliveryDirectives:g,withoutMultiVariant:u===E.MANIFEST,context:r});break;case E.AUDIO_TRACK:c.trigger(l.AUDIO_TRACK_LOADED,{details:e,track:h,id:f||0,groupId:p||"",stats:n,networkDetails:s,deliveryDirectives:g,context:r});break;case E.SUBTITLE_TRACK:c.trigger(l.SUBTITLE_TRACK_LOADED,{details:e,track:h,id:f||0,groupId:p||"",stats:n,networkDetails:s,deliveryDirectives:g,context:r})}else{const i=e.playlistParsingError=new Error("No Segments found in Playlist");c.trigger(l.ERROR,{type:a.NETWORK_ERROR,details:o.LEVEL_EMPTY_ERROR,fatal:!1,url:m,error:i,reason:i.message,response:t,context:r,level:T,parent:_,networkDetails:s,stats:n})}}}class au{static get version(){return Ns}static isMSESupported(){return Hl()}static isSupported(){return function(){if(!Hl())return!1;const e=ee();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(Tt(t,"video"))))||["mp4a.40.2","fLaC"].some((t=>e.isTypeSupported(Tt(t,"audio")))))}()}static getMediaSource(){return ee()}static get Events(){return l}static get MetadataSchema(){return Gs}static get ErrorTypes(){return a}static get ErrorDetails(){return o}static get DefaultConfig(){return au.defaultConfig?au.defaultConfig:Kc}static set DefaultConfig(e){au.defaultConfig=e}constructor(e={}){this.config=void 0,this.userConfig=void 0,this.logger=void 0,this._url=null,this.streamController=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new Os,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.audioStreamController=void 0,this.subtititleStreamController=void 0,this.audioTrackController=void 0,this.subtitleTrackController=void 0,this.interstitialsController=void 0,this.iframeController=void 0,this.gapController=void 0,this.emeController=void 0,this.cmcdController=void 0,this._media=null,this._sessionId=void 0,this.triggeringException=void 0,this.started=!1;const t=this.logger=function(e,t,n){const r=J();if("object"==typeof console&&!0===e||"object"==typeof e){const s=["debug","log","info","warn","error"];s.forEach((t=>{r[t]=X(t,e,n)}));try{r.log(`Debug logs enabled for "${t}" in hls.js version 1.7.3`)}catch(e){return J()}s.forEach((t=>{Q[t]=X(t,e)}))}else w(Q,r);return r}(e.debug||!1,"Hls instance",e.loggerId||e.assetPlayerId),n=this.config=qc(au.DefaultConfig,e,t);this.userConfig=e,n.progressive&&zc(n,t);const{streamController:r,abrController:s,bufferController:i,capLevelController:a,errorController:o,fpsController:c,id3TrackController:u,iframeController:d,gapController:h}=n,f=new o(this),p=this.abrController=new s(this),g=new Cn(this),m=n.interstitialsController,_=m?this.interstitialsController=new m(this,au):null,T=i?this.bufferController=new i(this,g):null,E=a?this.capLevelController=new a(this):null,y=c?new c(this):null,S=n.cmcdController,v=S?this.cmcdController=new S(this):null,b=new iu(this),I=n.contentSteeringController,A=I?new I(this):null,R=this.levelController=new Jc(this,A),k=u?new u(this):void 0,C=new tu(this.config,this.logger),L=this.streamController=new r(this,g,C),O=this.gapController=h?new h(this,g):void 0;E&&E.setStreamController(L);const N=[b,R,L];_&&N.splice(1,0,_),A&&N.splice(1,0,A),this.networkControllers=N;const P=[p];T&&P.push(T),O&&P.push(O),E&&P.push(E),y&&(y.setStreamController(L),P.push(y)),k&&P.push(k),P.push(g),this.audioTrackController=this.createController(n.audioTrackController,N);const M=n.audioStreamController;M&&N.push(this.audioStreamController=new M(this,g,C)),this.subtitleTrackController=this.createController(n.subtitleTrackController,N);const D=n.subtitleStreamController;D&&N.push(this.subtititleStreamController=new D(this,g,C)),this.createController(n.timelineController,P),C.emeController=this.emeController=this.createController(n.emeController,P),v&&P.push(v),this.latencyController=this.createController(n.latencyController,P),this.coreComponents=P,this.iframeController=d?new d(this,au):void 0,N.push(f);const x=f.onErrorOut;"function"==typeof x&&this.on(l.ERROR,x,f),this.on(l.MANIFEST_LOADED,b.onManifestLoaded,b)}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,this.iframeController=void 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");const e={};this.trigger(l.MEDIA_DETACHING,e),this._media=null,this.trigger(l.MEDIA_DETACHED,e)}transferMedia(){var e;this._media=null;const t=(null==(e=this.bufferController)?void 0:e.transferMedia())||null,n={transferMedia:t};return this.trigger(l.MEDIA_DETACHING,n),this.trigger(l.MEDIA_DETACHED,n),t}loadSource(e){var t;this.stopLoad();const n=this.media,r=this._url,s=this._url=_.buildAbsoluteURL(self.location.href,e,{alwaysNormalize:!0});this._autoLevelCapping=-1,this._maxHdcpLevel=null,this.logger.log(`loadSource:${s}`),n&&r&&(r!==s||null!=(t=this.bufferController)&&t.hasSourceTypes())&&(this.detachMedia(),this.attachMedia(n)),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&&this.streamController.state!==ds}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={[y.MAIN]:this.streamController.inFlightFrag};return this.audioStreamController&&(e[y.AUDIO]=this.audioStreamController.inFlightFrag),this.subtititleStreamController&&(e[y.SUBTITLE]=this.subtititleStreamController.inFlightFrag),e}swapAudioCodec(){this.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()}recoverMediaError(){this.logger.log("recoverMediaError");const e=this._media,t=this.started,n=null==e?void 0:e.currentTime;this.detachMedia(),e&&(this.attachMedia(e),t&&(n?this.startLoad(n):this.config.autoStartLoad||this.startLoad()))}removeLevel(e){this.levelController.removeLevel(e)}get sessionId(){let e=this._sessionId;return e||(e=this._sessionId=oe()),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=this.capLevelController,n=!!e;t&&n!==this.config.capLevelToPlayerSize&&(n?t.startCapping():(t.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=n)}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 Ut.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 audioForwardBufferInfo(){var e;return(null==(e=this.audioStreamController)?void 0:e.getFwdBufferInfo())||null}get maxBufferLength(){return this.streamController.maxBufferLength}setAudioOption(e){var t;return(null==(t=this.audioTrackController)?void 0:t.setAudioOption(e))||null}setSubtitleOption(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 nextAudioTrack(){var e,t;return null!=(e=null==(t=this.audioStreamController)?void 0:t.nextAudioTrack)?e:-1}set nextAudioTrack(e){const{audioTrackController:t}=this;t&&(t.nextAudioTrack=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(){var e,t;return null!=(e=null==(t=this.latencyController)?void 0:t.liveSyncPosition)?e:null}get latency(){var e;return(null==(e=this.latencyController)?void 0:e.latency)||0}get maxLatency(){var e;return(null==(e=this.latencyController)?void 0:e.maxLatency)||0}get targetLatency(){var e;return(null==(e=this.latencyController)?void 0:e.targetLatency)||null}set targetLatency(e){this.latencyController&&(this.latencyController.targetLatency=e)}get drift(){var e;return(null==(e=this.latencyController)?void 0:e.drift)||null}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(){return this.interstitialsController?this.interstitialsController.interstitialsManager:null}get iframeVariants(){const e=this.levelController.iframeVariants;return e||[]}
1createIFramePlayer(e){return this._url&&this.iframeController?this.iframeController.createIFramePlayer(e):null}createImageIFramePlayer(e){return this._url&&this.iframeController?this.iframeController.createImageIFramePlayer(e):null}getMediaDecodingInfo(e,t=this.allAudioTracks){return Pt(e,zt(t),navigator.mediaCapabilities)}}au.defaultConfig=void 0;var ou,lu,cu,uu,du={d:(e,t)=>{for(var n in t)du.o(t,n)&&!du.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)},hu={};du.d(hu,{GP:()=>cu,fZ:()=>pu,vn:()=>uu}),(ou=cu||(cu={})).LOADED="loaded",ou.SEEKING="seeking",ou.SEEKED="seeked",ou.BUFFERING="buffering",ou.BUFFERED="buffered",ou.PLAY="play",ou.PLAYING="playing",ou.PAUSE="pause",ou.ENDED="ended",ou.TIME_UPDATE="timeupdate",(lu=uu||(uu={})).loadstart="loadstart",lu.progress="progress",lu.suspend="suspend",lu.abort="abort",lu.error="error",lu.emptied="emptied",lu.stalled="stalled",lu.loadedmetadata="loadedmetadata",lu.loadeddata="loadeddata",lu.canplay="canplay",lu.canplaythrough="canplaythrough",lu.playing="playing",lu.waiting="waiting",lu.seeking="seeking",lu.seeked="seeked",lu.ended="ended",lu.durationchange="durationchange",lu.timeupdate="timeupdate",lu.play="play",lu.pause="pause",lu.ratechange="ratechange",lu.resize="resize",lu.volumechange="volumechange";let fu={paused:!1,ended:!1,loading:!0,buffering:!1,seeking:!1,initialPlayFired:!1,deferCanPlay:!1,deferCanPlayThroughHandling:!1,deferPlayingEvent:!1,deferSeekedEvent:!1,playRequested:!1},pu=({mediaElement:e,callback:t,mp4Mode:n=!1})=>{let r=null,s=()=>{"number"==typeof r&&clearTimeout(r)},i={...fu},a=()=>{s(),i={...fu}},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)?i={...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 gu,mu,_u=hu.GP,Tu=hu.fZ;class Eu{constructor(e){this.originalError=e}}function yu(){return"undefined"!=typeof window?window.navigator.userAgent.toLowerCase():""}function Su(){let e=mu.UNKNOWN;return/firefox/.test(yu())?e=mu.FIREFOX:/edge/.test(yu())&&/windows/.test(yu())?e=mu.MS_EDGE:/chrome/.test(yu())?e=mu.CHROME:/safari/.test(yu())&&/apple computer/.test("undefined"!=typeof window&&"undefined"!=typeof navigator?window.navigator.vendor.toLowerCase():"")&&!/tizen/.test(yu())&&!/sopopenbrowser/.test(yu())?e=mu.SAFARI:/trident.*rv:11\./.test(yu())&&(e=mu.MS_IE),e}!function(e){e.HLS="HLS",e.MP4="MP4",e.MP3="MP3",e.M4A="M4A"}(gu||(gu={})),function(e){e.CHROME="CHROME",e.SAFARI="SAFARI",e.MS_IE="MS_IE",e.MS_EDGE="MS_EDGE",e.FIREFOX="FIREFOX",e.UNKNOWN="UNKNOWN"}(mu||(mu={}));var vu,bu=n(13269);class Iu extends bu.bk{setState(e){this.state={...this.state,...e}
1,this.emit("stateChanged",this.state)}getState(){return this.state}onError(e){this.setState({playbackState:"error"}),this.emit("error",new Eu(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:[],isLive:!1},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=Tu({mp4Mode:[gu.M4A,gu.MP3,gu.MP4].includes(this.options.format),mediaElement:this.options.mediaElement,callback:e=>{switch(e){case _u.BUFFERED:case _u.SEEKED:this.setState({playbackState:this.options.mediaElement.paused?"paused":"playing"});break;case _u.BUFFERING:case _u.SEEKING:this.setState({playbackState:"buffering"});break;case _u.LOADED:this.setState({playbackState:"ready",engineName:this.name,muted:this.options.mediaElement.muted,duration:this.options.mediaElement.duration||0,currentTime:this.options.mediaElement.currentTime,textTracks:this.getTextTracks(),playbackRate:this.options.mediaElement.playbackRate,volume:this.options.mediaElement.volume,qualityLevels:this.getQualityLevels(),isLive:this.isLive()}),this.emit("loaded",void 0);break;case _u.PLAY:this.emit("play",void 0);break;case _u.PLAYING:this.setState({playbackState:"playing"}),this.emit("playing",void 0);break;case _u.PAUSE:this.setState({playbackState:"paused"});break;case _u.ENDED:this.setState({playbackState:"ended"}),this.emit("ended",void 0);break;case _u.TIME_UPDATE:this.setState({currentTime:this.options.mediaElement.currentTime,duration:this.options.mediaElement.duration||0}),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})}seekToTime({diff:e,absolute:t}){let n=this.options.mediaElement.currentTime;e?n+=e:void 0!==t&&(n=t),this.options.mediaElement.currentTime=(0,bu.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=""}seekToLive(){const e=this.getSeekable().end;e&&(this.options.mediaElement.currentTime=e)}getSeekable(){const e=this.options.mediaElement.seekable;return e.length>0?{start:e.start(0),end:e.end(0)}:{start:0,end:0}}}class Au extends Iu{constructor(e){super(e),this.hlsEngineOptions=e,this.name="HlsJS",this.hls=new au,this.hls.config.liveSyncDuration=12,this.hls.on(au.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}
1)));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(au.Events.ERROR,this.onHLSError.bind(this)),this.hls.on(au.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(au.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()}isLive(){return this.hls.latestLevelDetails?.live??!1}seekToLive(){const e=this.hls.liveSyncPosition;e&&(this.hlsEngineOptions.mediaElement.currentTime=e)}}let Ru;!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"}(vu||(vu={}));class ku extends bu.bk{setState(e){this.state={...this.state,...e},this.emit(vu.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:[],isLive:!1},function(e){return Ru||(Ru=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")}})),Ru)}(e).then((()=>{this.remotePlayer=new cast.framework.RemotePlayer,this.playerController=new cast.framework.RemotePlayerController(this.remotePlayer),this.emit(vu.CAST_SUPPORTED,void 0),this.setupListeners()})).catch((e=>{console.log(e)}))}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(vu.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(vu.CAST_CONNECTED,void 0);break;case cast.framework.SessionState.SESSION_ENDED:this.setState({playbackState:"idle"}),this.emit(vu.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,bu.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");r.streamType=t?.isLive?chrome.cast.media.StreamType.LIVE:chrome.cast.media.StreamType.BUFFERED,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(vu.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 Cu extends Iu{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[]}isLive(){return this.nativeEngineOptions.mediaElement.duration===1/0}}var Lu;!function(e){e.AVAILABILITY_CHANGED="airplay:availability_changed",e.CONNECTED="airplay:connected",e.DISCONNECTED="airplay:disconnected"}(Lu||(Lu={}));class Ou extends bu.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(Lu.AVAILABILITY_CHANGED,{available:!1})}onAvailabilityChanged({availability:e}){this.isAvailable="available"===e,this.emit(Lu.AVAILABILITY_CHANGED,{available:this.isAvailable})}onTargetChanged(){this.video.webkitCurrentPlaybackTargetIsWireless?this.emit(Lu.CONNECTED,void 0):this.emit(Lu.DISCONNECTED,void 0)}toggleAirPlay(){this.video.webkitShowPlaybackTargetPicker()}destroy(){this.video.removeEventListener("webkitplaybacktargetavailabilitychanged",this.onAvailabilityChanged),this.video.removeEventListener("webkitcurrentplaybacktargetiswirelesschanged",this.onTargetChanged)}}class Nu{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 wu extends bu.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 Pu extends bu.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}get startTime(){return this.configuredStartTime}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.configuredStartTime=0,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:[],isLive:!1},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 wu(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){const t=e?.startTime??this.options.startTime??0;if(this.configuredStartTime=Number.isFinite(t)?Math.max(0,t):0,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(),isLive:this.state.isLive})}const n=e||{startTime:this.options.startTime??0};return this.engine.load(this.options.src,n)}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,bu.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 gu.HLS;case"mp4":return gu.MP4;case"mp3":return gu.MP3;case"m4a":return gu.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 gu.HLS:if(Su()===mu.CHROME)return!1;t="application/vnd.apple.mpegurl";break;case gu.MP4:t="video/mp4";break;case gu.MP3:t="audio/mpeg";break;case gu.M4A:t="audio/mp4";break;default:return!1}try{return!!document.createElement("video").canPlayType(t)}catch{return!1}}(t)&&!this.options.hlsLevel?new Cu(n):new Au({...n,hlsLevel:this.options.hlsLevel})}onEngineStateUpdate(e){this.setState(e)}onCastSenderStateUpdate(e){this.setState(e)}initiateCastSender(e,t){this.castSender=new ku({castAppId:e}),this.castSender.on(vu.CAST_SUPPORTED,(()=>this.setState({isCastSupported:!0}))),this.castSender.on(vu.CAST_CONNECTING,(()=>{this.engine.pause()})),this.castSender.on(vu.CAST_CONNECTED,(()=>{const e=this.engine.getCurrentSource();this.setState({isCasting:!0}),e&&this.castSender?.load(e,{startTime:this.engine.getState().currentTime,textTracks:this.getMappedExternalTextTracks(),isLive:this.state.isLive}),this.engine.off("stateChanged",this.onEngineStateUpdate),this.engine.stop(),this.castSender?.on(vu.CAST_STATE_CHANGED,this.onCastSenderStateUpdate)})),this.castSender.on(vu.CAST_DISCONNECTED,(async()=>{this.setState({isCasting:!1}),this.engine.on("stateChanged",this.onEngineStateUpdate),this.castSender?.off(vu.CAST_STATE_CHANGED,this.onCastSenderStateUpdate),this.engine.load(t,{startTime:this.castSender?.getState().currentTime}),this.play()})),this.castSender.on(vu.CAST_ERROR,(e=>{console.error(e)}))}initiateAirplay(){this.airplaySender=new Ou(this.videoElement),this.airplaySender.on(Lu.AVAILABILITY_CHANGED,(e=>{this.setState({isAirplayAvailable:e.available&&this.engine instanceof Cu})})),this.airplaySender.on(Lu.CONNECTED,(()=>{this.setState({isAirplayOngoing:!0})})),this.airplaySender.on(Lu.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 Nu(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 Au)return this.engine.setQualityLevel(e)}getQualityLevel(){if(this.engine instanceof Au)return this.engine.getQualityLevel()}seekToLive(){this.isCasting||this.engine.seekToLive()}destroy(){this.engine.destroy(),this.castSender?.destroy(),this.airplaySender?.destroy(),this.pipSender?.destroy(),this.videoElement.remove(),super.destroy()}}class Mu extends bu.bk{constructor({dispatchIntervalTimeMS:e=3e4}={}){super(),this.events=[],this.dispatchInterval=null,this.dispatchEvents=this.dispatchEvents.bind(this),document.addEventListener("visibilitychange",this.dispatchEvents,{capture:!0}),document.addEventListener("pagehide",this.dispatchEvents,{capture:!0}),this.dispatchInterval=window.setInterval(this.dispatchEvents,e)}addEvent(e){"heartbeat"===e.type&&(this.events=this.events.filter((e=>"heartbeat"!==e.type))),this.events.push(e)}dispatchEvents(){if(!1===navigator.onLine||0===this.events.length)return;const e=this.events;this.events=[],this.emit("dispatch",{events:e})}destroy(){super.destroy(),this.dispatchInterval&&(clearInterval(this.dispatchInterval),this.dispatchInterval=null),document.removeEventListener("visibilitychange",this.dispatchEvents,{capture:!0}),document.removeEventListener("pagehide",this.dispatchEvents,{capture:!0})}}class Du extends bu.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.heartbeatInterval=null,this.eventPool=null,this.debugLogger=new bu.k$("Tracking helper",!!t?.debug),this.heartbeatIntervalTimeMS=t?.heartbeatIntervalTimeMS??1e4,this.onTimeUpdate=this.onTimeUpdate.bind(this),this.onPlaying=this.onPlaying.bind(this),this.onEnded=this.onEnded.bind(this),this.setupListeners=this.setupListeners.bind(this),t?.trackingMilestones&&(this.trackingMilestones=t.trackingMilestones),t?.enableEventPool&&(this.eventPool=new Mu({dispatchIntervalTimeMS:t?.eventPoolDispatchIntervalTimeMS??3e4})),this.player.on("loaded",this.setupListeners)}reset(){this.player.off("playing",this.onPlaying),this.player.off("ended",this.onEnded),this.player.off("timeupdate",this.onTimeUpdate),this.stopHeartbeat()}setupListeners(){this.passedMileStones=new Set,this.player.on("playing",this.onPlaying),this.player.on("ended",this.onEnded),this.player.on("timeupdate",this.onTimeUpdate),this.eventPool&&(this.eventPool.off("dispatch"),this.eventPool.on("dispatch",(e=>{this.debugLogger.log("onEventPoolDispatch",e),this.emit("eventPoolDispatch",e)})),this.stopHeartbeat(),this.startHeartbeat())}startHeartbeat(){this.heartbeatInterval=window.setInterval((()=>{const e=this.player.getState().currentTime,t=this.player.getState().duration;this.eventPool&&this.eventPool.addEvent({type:"heartbeat",data:{currentTime:e,duration:t}})}),this.heartbeatIntervalTimeMS)}stopHeartbeat(){this.heartbeatInterval&&(clearInterval(this.heartbeatInterval),this.heartbeatInterval=null)}onEnded(){this.debugLogger.log("onEnded"),this.emit("ended",void 0),this.reset()}onPlaying(){this.player.off("playing",this.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}
1`),this.emit("percentilePassed",s))}destroy(){this.player.off("loaded",this.setupListeners),this.reset(),this.eventPool?.destroy(),super.destroy()}}},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="ControlLeft",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={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};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">
1<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.6 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>'}},6179(e,t,n){"use strict";n.r(t),n.d(t,{BackToTopController:()=>Cr,BaseMediaPlayerController:()=>nr,CSSwiperController:()=>ir,DialogController:()=>sr,ImageModalGalleryController:()=>Ar,ListFilterController:()=>Lr,ResetInputController:()=>kr,ShowPasswordController:()=>Rr,TestController:()=>s,TruncateTextController:()=>rr});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,_,T,E,y=n(710),S={},v=[],b=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,I=Array.isArray;function A(e,t){for(var n in t)e[n]=t[n];return e}function R(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function k(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: 6,246 bytes, line 1
1);return C(e,o,r,s,null)}function C(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 L(e){return e.children}function O(e,t){this.props=e,this.context=t}function N(e,t){if(null==t)return e.__?N(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?N(e):null}function w(e){if(e.__P&&e.__d){var t=e.__v,n=t.__e,r=[],s=[],i=A({},t);i.__v=t.__v+1,a.vnode&&a.vnode(i),W(e.__P,i,t,e.__n,e.__P.namespaceURI,32&t.__u?[n]:null,r,null==n?N(t):n,!!(32&t.__u),s),i.__v=t.__v,i.__.__k[i.__i]=i,K(r,i,s),t.__e=t.__=null,i.__e!=n&&P(i)}}function P(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})),P(e)}function M(e){(!e.__d&&(e.__d=!0)&&l.push(e)&&!D.__r++||c!=a.debounceRendering)&&((c=a.debounceRendering)||u)(D)}function D(){try{for(var e,t=1;l.length;)l.length>t&&l.sort(d),e=l.shift(),t=l.length,w(e)}finally{l.length=D.__r=0}}function x(e,t,n,r,s,i,a,o,l,c,u){var d,h,f,p,g,m,_=r&&r.__k||v,T=t.length;for(l=U(n,t,_,l,T),d=0;d<T;d++)null!=(f=n.__k[d])&&(h=-1!=f.__i&&_[f.__i]||S,f.__i=d,m=W(e,f,h,s,i,a,o,l,c,u),p=f.__e,f.ref&&h.ref!=f.ref&&(h.ref&&z(h.ref,null,f),u.push(f.ref,f.__c||p,f)),null==g&&null!=p&&(g=p),4&f.__u?(l=B(f,l,e),h.__e&&(h.__e=null)):"function"==typeof f.type&&void 0!==m?l=m:p&&(l=p.nextSibling),f.__u&=-7);return n.__e=g,l}function U(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]=C(null,a,null,null,null):I(a)?a=e.__k[i]=C(L,{children:a},null,null,null):void 0===a.constructor&&a.__b>0?a=e.__k[i]=C(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=$(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=N(o)),J(o,o));return r}function B(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=B(r[s],t,n));return t}e.__e!=t&&(t&&e.type&&!t.parentNode&&(t=N(e)),t=n.insertBefore(e.__e,t||null));do{t=t&&t.nextSibling}while(null!=t&&8==t.nodeType);return t}function F(e,t){return t=t||[],null==e||"boolean"==typeof e||(I(e)?e.some((function(e){F(e,t)})):t.push(e)),t}function $(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 G(e,t,n){"-"==t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||b.test(t)?n:n+"px"}function H(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||G(e.style,t,"");if(n)for(t in n)r&&n[t]==r[t]||G(e.style,t,n[t])}else if("o"==t[0]&&"n"==t[1])i=t!=(t=t.replace(g,"$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[p]=r[p]:(n[p]=m,e.addEventListener(t,i?T:_,i)):e.removeEventListener(t,i?T:_,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 j(e){return function(t){if(this.l){var n=this.l[t.type+e];if(null==t[f])t[f]=m++;else if(t[f]<n[p])return;return n(a.event?a.event(t):t)}}}function W(e,t,n,r,s,i,o,l,c,u){var d,h,f,p,g,m,_,T,E,y,S,b,k,C,w,P,M=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 M){h=o.length;try{if(E=t.props,y=M.prototype&&M.prototype.render,S=(d=M.contextType)&&r[d.__c],b=d?S?S.props.value:d.__:r,n.__c?T=(f=t.__c=n.__c).__=f.__E:(y?t.__c=f=new M(E,b):(t.__c=f=new O(E,b),f.constructor=M,f.render=X),S&&S.sub(f),f.state||(f.state={}),f.__n=r,p=f.__d=!0,f.__h=[],f._sb=[]),y&&null==f.__s&&(f.__s=f.state),y&&null!=M.getDerivedStateFromProps&&(f.__s==f.state&&(f.__s=A({},f.__s)),A(f.__s,M.getDerivedStateFromProps(E,f.__s))),g=f.props,m=f.state,f.__v=t,p)y&&null==M.getDerivedStateFromProps&&null!=f.componentWillMount&&f.componentWillMount(),y&&null!=f.componentDidMount&&f.__h.push(f.componentDidMount);else{if(y&&null==M.getDerivedStateFromProps&&E!==g&&null!=f.componentWillReceiveProps&&f.componentWillReceiveProps(E,b),t.__v==n.__v||!f.__e&&null!=f.shouldComponentUpdate&&!1===f.shouldComponentUpdate(E,f.__s,b)){t.__v!=n.__v&&(f.props=E,f.state=f.__s,f.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some((function(e){e&&(e.__=t)})),v.push.apply(f.__h,f._sb),f._sb=[],f.__h.length&&o.push(f),l=N(n);break e}null!=f.componentWillUpdate&&f.componentWillUpdate(E,f.__s,b),y&&null!=f.componentDidUpdate&&f.__h.push((function(){f.componentDidUpdate(g,m,_)}))}if(f.context=b,f.props=E,f.__P=e,f.__e=!1,k=a.__r,C=0,y)f.state=f.__s,f.__d=!1,k&&k(t),d=f.render(f.props,f.state,f.context),v.push.apply(f.__h,f._sb),f._sb=[];else do{f.__d=!1,k&&k(t),d=f.render(f.props,f.state,f.context),f.state=f.__s}while(f.__d&&++C<25);f.state=f.__s,null!=f.getChildContext&&(r=A(A({},r),f.getChildContext())),y&&!p&&null!=f.getSnapshotBeforeUpdate&&(_=f.getSnapshotBeforeUpdate(g,m)),w=null!=d&&d.type===L&&null==d.key?q(d.props.children):d,l=x(e,I(w)?w:[w],t,n,r,s,i,o,l,c,u),f.base=t.__e,t.__u&=-161,f.__h.length&&o.push(f),T&&(f.__E=f.__=null)}catch(e){if(o.length=h,t.__v=null,c||null!=i){if(e.then){for(t.__u|=c?160:128;l&&8==l.nodeType&&l.nextSibling;)l=l.nextSibling;null!=i&&(i[i.indexOf(l)]=null),t.__e=l}else if(null!=i)for(P=i.length;P--;)R(i[P])}else t.__e=n.__e;
vendor: 4,121 bytes, line 1
1null==t.__k&&(t.__k=n.__k||[]),e.then||V(t),a.__e(e,t,n)}}else null==i&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):l=t.__e=Y(n.__e,t,n,r,s,i,o,c,u);return(d=a.diffed)&&d(t),128&t.__u?void 0:l}function V(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(V))}function K(e,t,n){for(var r=0;r<n.length;r++)z(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 q(e){return"object"!=typeof e||null==e||e.__b>0?e:I(e)?e.map(q):void 0!==e.constructor?null:A({},e)}function Y(e,t,n,r,s,o,l,c,u){var d,h,f,p,g,m,_,T=n.props||S,E=t.props,y=t.type;if("svg"==y?s="http://www.w3.org/2000/svg":"math"==y?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==!!y&&(y?g.localName==y:3==g.nodeType)){e=g,o[d]=null;break}if(null==e){if(null==y)return document.createTextNode(E);e=document.createElementNS(s,y,E.is&&E),c&&(a.__m&&a.__m(t,o),c=!1),o=null}if(null==y)T===E||c&&e.data==E||(e.data=E);else{if(o="textarea"==y&&null!=E.defaultValue?null:o&&i.call(e.childNodes),!c&&null!=o)for(T={},d=0;d<e.attributes.length;d++)T[(g=e.attributes[d]).name]=g.value;for(d in T)g=T[d],"dangerouslySetInnerHTML"==d?f=g:"children"==d||d in E||"value"==d&&"defaultValue"in E||"checked"==d&&"defaultChecked"in E||H(e,d,null,g,s);for(d in E)g=E[d],"children"==d?p=g:"dangerouslySetInnerHTML"==d?h=g:"value"==d?m=g:"checked"==d?_=g:c&&"function"!=typeof g||T[d]===g||H(e,d,g,T[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=""),x("template"==t.type?e.content:e,I(p)?p:[p],t,n,r,"foreignObject"==y?"http://www.w3.org/1999/xhtml":s,o,l,o?o[0]:n.__k&&N(n,0),c,u),null!=o)for(d=o.length;d--;)R(o[d]);c&&"textarea"!=y||(d="value","progress"==y&&null==m?e.removeAttribute("value"):null!=m&&(m!==e[d]||"progress"==y&&!m||"option"==y&&m!=T[d])&&H(e,d,m,T[d],s),d="checked",null!=_&&_!=e[d]&&H(e,d,_,T[d],s))}return e}function z(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 J(e,t,n){var r,s;if(a.unmount&&a.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||z(r,null,t)),null!=(r=e.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){a.__e(e,t)}r.base=r.__P=r.__n=null}if(r=e.__k)for(s=0;s<r.length;s++)r[s]&&J(r[s],t,n||"function"!=typeof e.type);n||R(e.__e),e.__c=e.__=e.__e=void 0}function X(e,t,n){return this.constructor(e,n)}function Q(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=[],W(t,e=(!r&&n||t).__k=k(L,null,[e]),s||S,S,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),K(o,e,l),e.props.children=null}function Z(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.forEach((function(e){e.__e=!0,M(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"+E++,t.__=e,t.Provider=t.__l=(t.Consumer=function(e,t){return e.children(t)}).contextType=t,t}i=v.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,O.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=A({},this.state),"function"==typeof e&&(e=e(A({},n),this.props)),e&&A(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),M(this))},O.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),M(this))},O.prototype.render=L,l=[],u="function"==typeof Promise?Promise.prototype.then.bind(Prom
1ise.resolve()):setTimeout,d=function(e,t){return e.__v.__b-t.__v.__b},D.__r=0,h=Math.random().toString(8),f="__d"+h,p="__a"+h,g=/(PointerCapture)$|Capture$/i,m=0,_=j(!1),T=j(!0),E=0;var ee=0;Array.isArray;function te(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:--ee,__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 ne,re,se,ie,ae=0,oe=[],le=a,ce=le.__b,ue=le.__r,de=le.diffed,he=le.__c,fe=le.unmount,pe=le.__;function ge(e,t){le.__h&&le.__h(re,e,ae||t),ae=0;var n=re.__H||(re.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function me(e){return ae=1,_e(Le,e)}function _e(e,t,n){var r=ge(ne++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):Le(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=re,!re.__f)){var s=function(e,t,n){if(!r.__c.__H)return!0;var s=!1,a=r.__c.props!==e;if(r.__c.__H.__.some((function(e){if(e.__N){s=!0;var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(a=!0)}})),i){var o=i.call(this,e,t,n);return s?o||a:o}return!s||a};re.__f=!0;var i=re.shouldComponentUpdate,a=re.componentWillUpdate;re.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)},re.shouldComponentUpdate=s}return r.__N||r.__}function Te(e,t){var n=ge(ne++,3);!le.__s&&Ce(n.__H,t)&&(n.__=e,n.u=t,re.__H.__h.push(n))}function Ee(e){return ae=5,ye((function(){return{current:e}}),[])}function ye(e,t){var n=ge(ne++,7);return Ce(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function Se(e,t){return ae=8,ye((function(){return e}),t)}function ve(e){var t=re.context[e.__c],n=ge(ne++,9);return n.c=e,t?(null==n.__&&(n.__=!0,t.sub(re)),t.props.value):e.__}function be(){for(var e;e=oe.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(Re),t.__h.some(ke),t.__h=[]}catch(n){t.__h=[],le.__e(n,e.__v)}}}le.__b=function(e){re=null,ce&&ce(e)},le.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),pe&&pe(e,t)},le.__r=function(e){ue&&ue(e),ne=0;var t=(re=e.__c).__H;t&&(se===re?(t.__h=[],re.__h=[],t.__.some((function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0}))):(t.__h.some(Re),t.__h.some(ke),t.__h=[],ne=0)),se=re},le.diffed=function(e){de&&de(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==oe.push(t)&&ie===le.requestAnimationFrame||((ie=le.requestAnimationFrame)||Ae)(be)),t.__H.__.some((function(e){e.u&&(e.__H=e.u,e.u=void 0)}))),se=re=null},le.__c=function(e,t){t.some((function(e){try{e.__h.some(Re),e.__h=e.__h.filter((function(e){return!e.__||ke(e)}))}catch(n){t.some((function(e){e.__h&&(e.__h=[])})),t=[],le.__e(n,e.__v)}})),he&&he(e,t)},le.unmount=function(e){fe&&fe(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.some((function(e){try{Re(e)}catch(e){t=e}})),n.__H=void 0,t&&le.__e(t,n.__v))};var Ie="function"==typeof requestAnimationFrame;function Ae(e){var t,n=function(){clearTimeout(r),Ie&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);Ie&&(t=requestAnimationFrame(n))}function Re(e){var t=re,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),re=t}function ke(e){var t=re;e.__c=e.__(),re=t}function Ce(e,t){return!e||e.length!==t.length||t.some((function(t,n){return t!==e[n]}))}function Le(e,t){return"function"==typeof t?t(e):t}function Oe(e,t){for(var n in t)e[n]=t[n];return e}function Ne(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 we(e,t){this.props=e,this.context=t}(we.prototype=new O).isPureReactComponent=!0,we.prototype.shouldComponentUpdate=function(e,t){return Ne(this.props,e)||Ne(this.state,t)};var Pe=a.__b;a.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),Pe&&Pe(e)};"undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref");var Me=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);Me(e,t,n,r)};var De=a.unmount;function xe(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=Oe({},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 xe(e,t,n)}))),e}function Ue(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map((function(e){return Ue(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 Be(){this.__u=0,this.o=null,this.__b=null}function Fe(e){var t=e.__&&e.__.__c;return t&&t.__a&&t.__a(e)}function $e(){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),De&&De(e)},(Be.prototype=new O).__c=function(e,t){var n=t.__c,r=this;null==r.o&&(r.o=[]),r.o.push(n);var s=Fe(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]=Ue(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)},Be.prototype.componentWillUnmount=function(){this.o=[]},Be.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]=xe(this.__b,n,r.__O=r.__P)}this.__b=null}var s=t.__a&&k(L,null,e.fallback);return s&&(s.__u&=-33),[k(L,null,t.__a?null:e.children),s]};var Ge=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]}};($e.prototype=new O).__a=function(e){var t=this,n=Fe(t.__v),r=t.l.get(e);return r[0]++,function(s){var i=function(){t.props.revealOrder?(r.push(s),Ge(t,e,r)):s()};n?n(i):i()}},$e.prototype.render=function(e){this.i=null,this.l=new Map;var t=F(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},$e.prototype.componentDidUpdate=$e.prototype.componentDidMount=function(){var e=this;this.l.forEach((function(t,n){Ge(e,n,t)}))};var He="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,je=/^(?: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]/,We=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,Ve=/[A-Z0-9]/g,Ke="undefined"!=typeof document,qe=function(e){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/:/fil|che|ra/).test(e)};O.prototype.isReactComponent=!0,["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach((function(e){Object.defineProperty(O.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})}));var Ye=a.event;a.event=function(e){return Ye&&(e=Ye(e)),e.persist=function(){},e.isPropagationStopped=function(){return this.cancelBubble},e.isDefaultPrevented=function(){return this.defaultPrevented},e.nativeEvent=e};var ze={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||Ke&&"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||qe(t.type)?"onfocus"===o?i="onfocusin":"onblur"===o?i="onfocusout":We.test(i)&&(i=o):o=i="onin
1put":s&&je.test(i)?i=i.replace(Ve,"-$&").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=F(t.children).forEach((function(e){e.props.selected=-1!=r.value.indexOf(e.props.value)}))),null!=r.defaultValue&&(r.value=F(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=He,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,pt,gt,mt={};et(mt,"bigPlayButton",(()=>tt),(e=>tt=e)),et(mt,"clickableOverlay",(()=>nt),(e=>nt=e)),et(mt,"container",(()=>rt),(e=>rt=e)),et(mt,"controlsContainer",(()=>st),(e=>st=e)),et(mt,"controlsSection",(()=>it),(e=>it=e)),et(mt,"fullPage",(()=>at),(e=>at=e)),et(mt,"hideOnMobile",(()=>ot),(e=>ot=e)),et(mt,"iconButton",(()=>lt),(e=>lt=e)),et(mt,"jumpIndicator",(()=>ct),(e=>ct=e)),et(mt,"left",(()=>ut),(e=>ut=e)),et(mt,"liveButton",(()=>dt),(e=>dt=e)),et(mt,"liveDot",(()=>ht),(e=>ht=e)),et(mt,"right",(()=>ft),(e=>ft=e)),et(mt,"show",(()=>pt),(e=>pt=e)),et(mt,"skinContainer",(()=>gt),(e=>gt=e)),tt="_3fwmTG_bigPlayButton",nt="_3fwmTG_clickableOverlay",rt="_3fwmTG_container",st="_3fwmTG_controlsContainer",it="_3fwmTG_controlsSection",at="_3fwmTG_fullPage",ot="_3fwmTG_hideOnMobile",lt="_3fwmTG_iconButton",ct="_3fwmTG_jumpIndicator",ut="_3fwmTG_left",dt="_3fwmTG_liveButton",ht="_3fwmTG_liveDot",ft="_3fwmTG_right",pt="_3fwmTG_show",gt="_3fwmTG_skinContainer";var _t,Tt,Et,yt={};et(yt,"container",(()=>_t),(e=>_t=e)),et(yt,"seek",(()=>Tt),(e=>Tt=e)),et(yt,"timestamp",(()=>Et),(e=>Et=e)),_t="MHFShW_container",Tt="MHFShW_seek",Et="MHFShW_timestamp";var St,vt,bt,It,At,Rt={};function kt(e){return ye((()=>"horizontal"===e?{height:"4px",width:"100%"}:{height:"100%",width:"4px"}),[e])}function Ct(e,t){return ye((()=>"horizontal"===t?{left:`${e}%`,transform:"translateX(-50%)"}:{bottom:`${e}%`,transform:"translateY(50%)"}),[t,e])}function Lt(e,t){return ye((()=>"horizontal"===t?{transform:"translate(-50%, -150%)",left:`${e}%`}:{bottom:`${e}%`,transform:"translate(-110%, 50%)"}),[t,e])}function Ot(e,t){return ye((()=>"horizontal"===t?{width:`${e}%`}:{height:`${e}%`,position:"absolute",width:"4px",bottom:0}),[e,t])}function Nt(e){return parseFloat(e.toFixed(2))}function wt(e,t){const n=e.changedTouches[0],r=e.currentTarget;if("horizontal"===t){const e=n.clientX-r.getBoundingClientRect().left;return Math.min(Nt(e/r.offsetWidth*100),99.99)}return 0}function Pt(e,t){return Nt("horizontal"===t?e.offsetX/e.target.clientWidth*100:100-e.offsetY/e.target.clientHeight*100)}function Mt(e,t=!1){return t?5*Math.ceil(e/5):e}function Dt({onClick:e,value:t,TimestampComponent:n,direction:r,staggerPosition:s=!1}){const[i,a]=me(),[o,l]=me(!1),c=Se((t=>{a(void 0),e(Mt(Pt(t,r),s))}),[r,e,s]),u=Se((t=>{const n=Mt(wt(t,r),s);l(!1),a(void 0),e(n)}),[e,r,s]),d=Se((e=>{a(Mt(Pt(e,r),s))}),[r,s]),h=Se((e=>{const t=wt(e,r);a(Mt(t,s))}),[r,s]),f=kt(r),p=Ct(o&&i?i:t,r),g=Ot(t,r),m=Lt(i||0,r);return te("div",{className:Ze(Rt).sliderContainer,onMouseMove:d,onTouchMove:h,onTouchEnd:u,onMouseLeave:()=>a(void 0),onClick:c,onMouseDown:()=>l(!0),onTouchStart:()=>l(!0),onMouseUp:()=>l(!1),children:[te("div",{onClick:e=>e.stopPropagation(),onMouseEnter:e=>e.stopPropagation(),onMouseMove:e=>e.stopPropagation(),onMouseLeave:e=>e.stopPropagation(),onMouseUp:()=>{i&&(a(void 0),e(Mt(i,s)))},style:p,class:Ze(Rt).seekDot}),te("div",{style:f,className:Ze(Rt).timeline,children:[te("div",{className:Ze(Rt).timeline,style:g}),i&&te("div",{style:m,className:`${Ze(Rt).timestamp} ${Ze(Rt).seek}`,children:te(n,{positionPercentage:i})})]})]})}function xt(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")}
1:${String(i).padStart(2,"0")}`:`${String(r).padStart(2,"0")}:${String(s).padStart(2,"0")}:${String(i).padStart(2,"0")}`}function Ut(e,t){return e*(t/100)}function Bt({currentTime:e,duration:t,onSeek:n}){if(!e||!t)return null;const r=e/t*100,s=xt(t,t<3600);return te("div",{className:Ze(yt).container,children:[te("div",{className:Ze(yt).timestamp,children:xt(e,t<3600)}),te(Dt,{direction:"horizontal",value:r,onClick:n,TimestampComponent:({positionPercentage:e})=>te("div",{style:{left:`${e}%`},className:`${Ze(yt).timestamp} ${Ze(yt).seek}`,children:xt(Ut(t,e),t<3600)})}),te("span",{className:Ze(yt).timestamp,children:s})]})}et(Rt,"seek",(()=>St),(e=>St=e)),et(Rt,"seekDot",(()=>vt),(e=>vt=e)),et(Rt,"sliderContainer",(()=>bt),(e=>bt=e)),et(Rt,"timeline",(()=>It),(e=>It=e)),et(Rt,"timestamp",(()=>At),(e=>At=e)),St="Pdpjvq_seek",vt="Pdpjvq_seekDot",bt="Pdpjvq_sliderContainer",It="Pdpjvq_timeline",At="Pdpjvq_timestamp";const Ft=()=>te("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 384 512",children:te("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"})}),$t=()=>te("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 320 512",children:te("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"})}),Gt=()=>te("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512",children:te("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"})}),Ht=()=>te("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512",children:te("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"})}),jt=()=>te("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 576 512",children:te("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"})}),Wt=()=>te("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 640 512",children:te("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.1zM352 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"})}),Vt=()=>te("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 576 512",children:te("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"})}),Kt=()=>te("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",children:te("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"})}),qt=()=>te("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 576 512",children:te("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"})}),Yt=e=>te("svg",{xmlns:"http://www.w3.org/2000/svg",...e,viewBox:"0 0 640 640",children:te("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"})}),zt=e=>te("svg",{xmlns:"http://www.w3.org/2000/svg",...e,viewBox:"0 0 640 640",children:te("path",{d:"M320 576C461.4 576 576 461.4 576 320C576 178.6 461.4 64 320 64
1C178.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"})}),Jt=e=>te("svg",{xmlns:"http://www.w3.org/2000/svg",...e,viewBox:"0 0 640 640",children:te("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"})}),Xt=e=>te("svg",{xmlns:"http://www.w3.org/2000/svg",...e,viewBox:"0 0 640 640",children:te("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"})}),Qt=e=>te("svg",{xmlns:"http://www.w3.org/2000/svg",...e,viewBox:"0 0 512 512",children:te("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"})}),Zt=e=>te("svg",{xmlns:"http://www.w3.org/2000/svg",...e,viewBox:"0 0 640 640",children:te("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"})}),en=e=>te("svg",{xmlns:"http://www.w3.org/2000/svg",...e,viewBox:"0 0 640 640",children:te("path",{d:"M512 96L512 64L576 64L576 256L384 256L384 192L463.1 192C427.9 152.7 376.8 128 320 128C214 128 128 214 128 320C128 426 214 512 320 512C395 512 460 469 491.6 406.2L548.8 435C506.8 518.5 420.1 576 320 576C178.6 576 64 461.4 64 320C64 178.6 178.6 64 320 64C396.5 64 465.1 97.6 512 150.7L512 96z"})}),tn={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",JUMP_FORWARD:"Forward",LIVE_TOOLTIP:"Go to live",START_FROM_BEGINNING:"Start from beginning",RESUME_FROM:"Resume from {time}",YOU_LEFT_OFF_AT:"You left off at {time}"};class nn{constructor(e){this.translations=e}get(e){return this.translations[e]}}const rn=Z({translator:new nn(tn),states:{},setState:()=>{},controls:{toggleFullPage:()=>{}}});const sn=({playerCore:e,children:t,onControls:n,onStateChanged:r,translator:s})=>{const[i,a]=me({}),o=Se(((e,t)=>{a((n=>({...n,[e]:t})))}),[]),l=function(e,t){return ye((()=>({toggleFullPage:()=>{e.getContainerElement().classList.contains(Ze(mt).fullPage)?(e.getContainerElement().classList.remove(Ze(mt).fullPage),t("isFullPage",!1)):(e.getContainerElement().classList.add(Ze(mt).fullPage),t("isFullPage",!0))}})),[e,t])}(e,o);return Te((()=>{n(l)}),[l,n]),Te((()=>{r(i)}),[r,i]),te(rn.Provider,{value:{states:i,setState:o,controls:l,translator:s},children:t})},an=()=>{const e=ve(rn);if(void 0===e)throw new Error("usePlayerSkinState must be used within a PlayerSkinStateProvider");return e};function on(){return ve(rn).translator}function ln(e){const{states:t,controls:n,translator:r}=an();return te(L,{children:!e.playerState?.isFullscreen&&te("button",{"data-cs-align":"right","data-cs-tooltip":t.isFullPage?r.get("EXIT_THEATRE"):r.get("ENTER_THEATRE"),class:`${Ze(mt).iconButton} ${Ze(mt).hideOnMobile}`,onClick:n.toggleFullPage,children:te(Xt,{})})})}function cn(e){const{states:t,translator:n}=an();return te(L,{children:!t.isFullPage&&te("button",{"data-cs-align":"right","data-cs-tooltip":e.playerState?.isFullscreen?n.get("EXIT_FULLSCREEN"):n.get("ENTER_FULLSCREEN"),class:Ze(mt).iconButton,onClick:()=>e.playerCore.toggleFullscreen(),children:e.playerState?.isFullscreen?te(Ht,{}):te(Gt,{})})})}function un({playbackState:e}){switch(e){case"playing":return te($t,{});case"ended":return te(Qt,{});default:return te(Ft,{})}}function dn(e){const t=on(),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?te(L,{children:te("button",{"data-cs-tooltip":"playing"===e.playerState?.playbackState?t.get("PAUSE"):t.get("PLAY"),className:Ze(mt).iconButton,onClick:n,children:te(un,{playbackState:e.playerState?.playbackState})})}):null}function hn(e){const t=on(),{playerCore:n}=e;return e.playerState?.isLive?null:te("button",{"data-cs-tooltip":`${t.get("JUMP_BACK")} 10s`,className:Ze(mt).iconButton,onClick:()=>{n?.seekToTime({diff:-10})},type:"button",children:te(Zt,{})})}function fn(e){return te(L,{children:e.playerState?.isCastSupported&&te("google-cast-launcher",{})})}function pn({playerCore:e,seekSeconds:t=10,doubleTapThresholdMS:n=300}){const r=Ee(null),s=Ee(null),i=Ee(0),a=Ee(null),[o,l]=me(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 Te((()=>()=>{s.current&&window.clearTimeout(s.current)}),[]),te("div",{ref:r,class:Ze(mt).clickableOverlay,onPointerUp:e=>c(e),onTouchEnd:e=>c(e),children:a.current&&o&&te("div",{class:`${Ze(mt).jumpIndicator} ${"left"===o?Ze(mt).left:Ze(mt).right} ${Ze(mt).show}`,children:"left"===o?`-${t}
1s`:`+${t}s`})})}var gn,mn,_n={};function Tn({playerCore:e,playerState:t}){const n=Se((t=>{e.setVolume(t/100)}),[e]);return t?te("div",{class:Ze(_n).volumeControlContainer,children:te(Dt,{staggerPosition:!0,onClick:n,direction:"vertical",value:t.muted?0:100*t.volume,TimestampComponent:({positionPercentage:e})=>te("div",{children:`${e}%`})})}):null}function En({playerCore:e,playerState:t}){const n=on();return t?te("div",{class:Ze(_n).container,children:[te(Tn,{playerCore:e,playerState:t}),te("button",{"data-cs-tooltip":n.get("VOLUME"),"data-cs-placement":"right",className:Ze(mt).iconButton,onClick:()=>e.toggleAudio(),children:te(t?.muted?Wt:jt,{})})]}):null}function yn(e){return te(L,{children:e.playerState?.isAirplayAvailable&&te("button",{class:Ze(mt).iconButton,onClick:()=>e.playerCore.toggleAirplay(),children:te(Vt,{})})})}function Sn(e){const t=on();return te(L,{children:e.playerState?.isPiPAvailable&&te("button",{"data-cs-tooltip":t.get("PICTURE_IN_PICTURE"),class:Ze(mt).iconButton,onClick:()=>e.playerCore.togglePiP(),children:te(Kt,{})})})}et(_n,"container",(()=>gn),(e=>gn=e)),et(_n,"volumeControlContainer",(()=>mn),(e=>mn=e)),gn="RM2v4a_container",mn="RM2v4a_volumeControlContainer";var vn,bn,In,An={};function Rn(e,t){Te((()=>{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(An,"container",(()=>vn),(e=>vn=e)),et(An,"speedButton",(()=>bn),(e=>bn=e)),et(An,"speedButtonContainer",(()=>In),(e=>In=e)),vn="ywa05W_container",bn="ywa05W_speedButton",In="ywa05W_speedButtonContainer";var kn,Cn,Ln={};function On(e){return te("ul",{style:{display:e.isVisible?"initial":"none"},class:Ze(Ln).container,ref:e.listRef,children:e.items.map(((e,t)=>te("li",{onClick:e.onClick,className:`${e.isActive?Ze(Ln).active:""}`,children:e.label},t)))})}et(Ln,"active",(()=>kn),(e=>kn=e)),et(Ln,"container",(()=>Cn),(e=>Cn=e)),kn="_8PR0XG_active",Cn="_8PR0XG_container";const Nn=[{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 wn(e){const[t,n]=me(!1),r=Ee(null),s=Ee(null),i=on();Rn([r,s],Se((()=>n(!1)),[]));const a=function(e){return ye((()=>Nn.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||e.playerState.isLive?null:te("div",{ref:s,className:`cs-position-relative ${Ze(An).container}`,children:[te(On,{isVisible:t,listRef:r,items:a}),te("button",{"data-cs-tooltip":i.get("PLAYBACK_SPEED"),class:Ze(mt).iconButton,style:{width:"auto"},onClick:()=>n(!t),children:`${e.playerState?.playbackRate}x`})]})}const Pn="cs-player-preferred-subtitle-language";function Mn(e){try{e?localStorage.setItem(Pn,e):localStorage.removeItem(Pn)}catch(e){console.warn("Failed to update subtitle language preference:",e)}}function Dn(e,t){const n=Ee(!1);Te((()=>{const r=t?.textTracks||[];if(r.length>0&&!n.current&&!r.some((e=>e.active))){try{const t=localStorage.getItem(Pn);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 xn(e){const[t,n]=me(!1),r=on(),s=Ee(null),i=Ee(null);Rn([s,i],Se((()=>n(!1)),[]));const a=function(e){return ye((()=>{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),Mn(t.language||"")}})));return[{label:"Off",isActive:""===n,onClick:()=>{e.playerCore.setActiveTextTrack(""),Mn("")}},...r]}),[e.playerState?.textTracks,e.playerCore])}(e);return a.length?te("div",{ref:i,style:{position:"relative"},children:[te("button",{"data-cs-tooltip":r.get("TEXT_TRACK_LANGUAGE"),class:Ze(mt).iconButton,onClick:()=>n((e=>!e)),children:te(qt,{})}),te(On,{isVisible:t,listRef:s,items:a})]}):null}var Un,Bn,Fn,$n={};function Gn(){return te("span",{className:Ze($n).loader})}function Hn(e){return te("div",{className:"cs-flex cs-flex-row cs-flex-align-center cs-flex-justify-center cs-flex-1",children:te("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 jn(e){return e.playerState?.isCasting?te(Hn,{children:[te(Yt,{width:50,fill:"#14bfdd"}),te("h4",{class:"cs-color-white cs-m-0",style:{fontSize:"14px"},children:`${e.playerCore.getCastDeviceName()}`}),"buffering"===e.playerState.playbackState&&te(Gn,{})]}):null}function Wn(e){return"ready"!==e.playerState?.playbackState?null:te("button",{className:Ze(mt).bigPlayButton,onClick:()=>e.playerCore.togglePlay(),children:te(Ft,{})})}function Vn({playerCore:e,playerState:t}){const[n,r]=me(!1),s=Ee(null),i=Ee(null),[a,o]=me(!0);Rn([s,i],Se((()=>r(!1)),[]));const l=on(),c=ye((()=>
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?te("div",{ref:i,style:{position:"relative"},children:[te("button",{"data-cs-tooltip":l.get("QUALITY_LEVEL"),class:Ze(mt).iconButton,onClick:()=>r((e=>!e)),children:te(Jt,{})}),te(On,{isVisible:n,listRef:s,items:c})]}):null}function Kn(e){const t=on();return te(L,{children:e.playerState?.isLive&&te("button",{"data-cs-tooltip":t.get("LIVE_TOOLTIP"),className:`${Ze(mt).iconButton} ${Ze(mt).liveButton}`,onClick:()=>e.playerCore.seekToLive(),children:[te("span",{className:Ze(mt).liveDot}),"LIVE"]})})}function qn(e){const t=on(),{playerCore:n}=e;return e.playerState?.isLive?null:te("button",{"data-cs-tooltip":`${t.get("JUMP_FORWARD")} 10s`,className:Ze(mt).iconButton,onClick:()=>{n?.seekToTime({diff:10})},type:"button",children:te(en,{})})}et($n,"loader",(()=>Un),(e=>Un=e)),et($n,"prixClipFix",(()=>Bn),(e=>Bn=e)),et($n,"rotate",(()=>Fn),(e=>Fn=e)),Un="hGEE9q_loader",Bn="hGEE9q_prixClipFix",Fn="hGEE9q_rotate";var Yn,zn,Jn={};function Xn({playerCore:e}){const t=on();return te("div",{style:{width:"100%",height:"100%",zIndex:1e3},className:"cs-position-absolute cs-flex cs-flex-col cs-flex-align-center cs-flex-justify-center cs-gap-2",children:te("div",{style:{backgroundColor:"rgba(0, 0, 0, 0.4)"},className:"cs-p-4 cs-flex cs-flex-col cs-gap-2 cs-flex-align-center cs-color-white",children:[te("p",{className:Ze(Jn).continueWatchingText,children:t.get("YOU_LEFT_OFF_AT").replace("{time}",xt(e.startTime))}),te("div",{className:"cs-flex cs-flex-row cs-gap-2",children:[te("button",{type:"button",className:`cs-button-white ${Ze(Jn).continueWatchingTextButton}`,onClick:()=>{e.seekToTime({absolute:e.startTime}),e.play()},children:t.get("RESUME_FROM").replace("{time}",xt(e.startTime))}),te("button",{className:`cs-button-white ${Ze(Jn).continueWatchingTextButton}`,type:"button",onClick:()=>{e.seekToPercentage(0),e.play()},children:t.get("START_FROM_BEGINNING")})]})]})})}et(Jn,"continueWatchingText",(()=>Yn),(e=>Yn=e)),et(Jn,"continueWatchingTextButton",(()=>zn),(e=>zn=e)),Yn="q3V0DW_continueWatchingText",zn="q3V0DW_continueWatchingTextButton";const Qn={useRabbitButton:!0,useFullPageButton:!0,userActivityTimeoutMS:3e3,promptContinueWatching:!1};function Zn({useRabbitButton:e,userActivityTimeoutMS:t,useFullPageButton:n,promptContinueWatching:r,playerCore:s,onControls:i,onStateChanged:a,translator:o}){const[l,c]=me(),[u,d]=me();Te((()=>(s.on("stateChanged",c),s.on("error",d),()=>{d(void 0)})),[s]),Dn(s,l);const h=Ee(null),[f,p]=me(!1),g=Se((()=>{p(!0),h.current&&clearTimeout(h.current),h.current=window.setTimeout((()=>{p(!1)}),t||Qn.userActivityTimeoutMS)}),[t]),m=["loading","buffering"].includes(l?.playbackState),_=m||f||["paused","ready","error"].includes(l?.playbackState),T="ready"===l?.playbackState&&r&&s.startTime>0;return te(sn,{translator:o,onControls:i,onStateChanged:a,playerCore:s,children:te("div",{class:Ze(mt).skinContainer,onMouseMove:g,onTouchMove:g,style:{opacity:_?1:0},children:[T&&te(Xn,{playerCore:s}),te(pn,{playerCore:s}),!T&&te(Wn,{playerState:l,playerCore:s}),te(jn,{playerState:l,playerCore:s}),!l?.isCasting&&m&&te("div",{className:"cs-flex cs-flex-row cs-flex-align-center cs-flex-justify-center cs-flex-1",children:te(Gn,{})}),u&&te(Hn,{children:[te(zt,{width:50,fill:"#fff"}),te("h4",{children:o.get("UNKNOWN_ERROR")})]}),te("div",{className:Ze(mt).controlsContainer,style:{display:["ready","loading"].includes(l?.playbackState)?"none":"flex"},children:[te("div",{className:Ze(mt).controlsSection,children:[te(dn,{playerState:l,playerCore:s}),te(En,{playerState:l,playerCore:s}),te(hn,{playerState:l,playerCore:s}),te(qn,{playerState:l,playerCore:s})]}),!l?.isLive&&te(Bt,{duration:l?.duration,currentTime:l?.currentTime,onSeek:e=>s.seekToPercentage(e)}),te("div",{className:Ze(mt).controlsSection,children:[te(Kn,{playerState:l,playerCore:s}),te(xn,{playerState:l,playerCore:s}),te(Vn,{playerState:l,playerCore:s}),e&&te(wn,{playerState:l,playerCore:s}),te(Sn,{playerState:l,playerCore:s}),n&&te(ln,{playerState:l,playerCore:s}),te(cn,{playerState:l,playerCore:s}),te(fn,{playerState:l,playerCore:s}),te(yn,{playerState:l,playerCore:s})]})]})]})})}class er{constructor(e,t){this.player=e,this.controls=null,this.state=null,this.skinContainer=null;const n={...Qn,...t};this.skinContainer=document.createElement("div");e.getContainerElement().appendChild(this.skinContainer),this.skinContainer.classList.add(Ze(mt).container);Q(te(Zn,{translator:new nn({...tn,...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 tr=n(13269);class nr extends r.Controller{constructor(){super(...arguments),this.playerCore=null,this.playerSkin=null,this.keyboardManager=null}async getTranslations(e){return tn}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"),l="true"===this.element.getAttribute("data-skin-promptContinueWatching"),c=this.element.getAttribute("data-skin-language")||"en";return{src:e,poster:t,useControls:n,allowPictureInPicture:r,useRabbitButton:s,useFullPageButton:i,userActivityTimeoutMS:a,subtitles:this.resolveSubtitles(),useKeyboardControls:o,promptContinueWatching:l,language:c}}async setupPlayer(){const{src:e,poster:t,useControls:n,useFullPageButton:r,useRabbitButton:s,userActivityTimeoutMS:i,subtitles:a,useKeyboardControls:o,allowPictureInPicture:l,promptContinueWatching:c,language:u}=this.getPlayerSettings();if(!e)return null;const d={containerElement:this.element,src:e,poster:t,externalTextTracks:a};if(this.playerCore=new y.CSWebPlayerCore({containerElement:this.element,src:e,poster:t,externalTextTracks:a,allowPictureInPicture:l,autoPlay:!1}
1),n&&(this.playerSkin=new er(this.playerCore,{useRabbitButton:s,useFullPageButton:r,userActivityTimeoutMS:i,promptContinueWatching:c,translations:await this.getTranslations(u)})),o){const e=new tr.Rr(d.containerElement);d.containerElement.style.outline="none",e.listen([tr.pI.Space],this.playerCore.togglePlay.bind(this.playerCore)),e.listen([tr.pI.M],this.playerCore.toggleAudio.bind(this.playerCore)),e.listen([tr.pI.F],this.playerCore.toggleFullscreen.bind(this.playerCore)),e.listen([tr.pI.Escape],(()=>{this.playerSkin?.isFullPage()&&this.playerSkin.toggleFullPage(),this.playerCore?.isFullscreen()&&this.playerCore.toggleFullscreen()})),e.listen([tr.pI.ArrowLeft],(()=>{this.playerCore?.seekToTime({diff:-10})})),e.listen([tr.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}async connect(){const e=this.element.getAttribute("data-startTime");let t=e?parseFloat(e):0;(isNaN(t)||t<0)&&(t=0);const n=await this.setupPlayer();n&&n.load({startTime:t})}disconnect(){this.playerCore?.destroy(),this.keyboardManager?.destroy()}}class rr 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 sr 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}],{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 Or=new Set;document.addEventListener("touchstart",(e=>{for(let t of e.changedTouches)Or.add(t.identifier)}),{passive:!0}),document.addEventListener("touchend",(e=>{for(let t of e.changedTouches)Or.delete(t.identifier)}),{passive:!0}),document.addEventListener("touchcancel",(e=>{for(let t of e.changedTouches)Or.delete(t.identifier)}),{passive:!0});let Nr=new WeakMap;function wr(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 Pr(e,t,n,r){if("scroll"!=t&&"scrollend"!=t)return;let s=this,i=Nr.get(s);if(void 0===i){let t=0;i={scrollListener:e=>{clearTimeout(t),t=setTimeout((()=>{Or.size?setTimeout(i.scrollListener,100):(s&&s.dispatchEvent(new Event("scrollend")),t=0)}),100)},listeners:0},e.apply(s,["scroll",i.scrollListener,{passive:!0}]),Nr.set(s,i)}i.listeners++}function Mr(e,t,n){if("scroll"!=t&&"scrollend"!=t)return;let r=this,s=Nr.get(r);void 0!==s&&(--s.listeners>0||(e.apply(r,["scroll",s.scrollListener]),Nr.delete(r)))}wr(Element.prototype,"addEventListener",Pr),wr(window,"addEventListener",Pr),wr(document,"addEventListener",Pr),wr(Element.prototype,"removeEventListener",Mr),wr(window,"removeEventListener",Mr),wr(document,"removeEventListener",Mr)}class ir 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 ar(this.element,e,{autoPlay:t})}}class ar{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=tr.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=tr.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))}
1disableItemsClick(){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?"none":"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 or="cs-image-modal-gallery",lr="cs-image-modal-gallery__dialog",cr="cs-image-modal-gallery__dialog--visible",ur="cs-image-modal-gallery__content",dr="cs-image-modal-gallery__image-container",hr="cs-image-modal-gallery__image-wrapper",fr="cs-image-modal-gallery__nav-arrow",pr="cs-image-modal-gallery__nav-arrow--left",gr="cs-image-modal-gallery__nav-arrow--right",mr="cs-image-modal-gallery__nav-arrow--hidden",_r="cs-image-modal-gallery__info",Tr="cs-image-modal-gallery__caption",Er="cs-image-modal-gallery__actions",yr="cs-image-modal-gallery__download",Sr="cs-image-modal-gallery__previews",vr="cs-image-modal-gallery__preview-box",br="cs-image-modal-gallery__preview-box--interactive",Ir="cs-image-modal-gallery__close-btn";class Ar 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=or,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=lr,e.innerHTML=`\n <div class="${ur}">\n <div class="${dr}">\n <div class="${hr}"></div>\n \n <button class="${fr} ${pr}" type="button" aria-label="Previous image">\n ${this.getSvgIcon("fa-left")}\n </button>\n \n <button class="${fr} ${gr}" type="button" aria-label="Next image">\n ${this.getSvgIcon("fa-right")}\n </button>\n </div>\n \n <div class="${_r}">\n <div class="${Tr}"></div>\n \n <div class="${Er}">\n <div class="${Sr}"></div>\n </div>\n </div>\n \n <button class="${Ir}" type="button" aria-label="Close">
1\n ${this.getSvgIcon("fa-close")}\n </button>\n </div>\n `,this.attachEventListeners(e),e}attachEventListeners(e){e.addEventListener("click",(t=>{const n=e.querySelector(`.${ur}`);n&&!n.contains(t.target)&&this.close()})),e.querySelector(`.${Ir}`)?.addEventListener("click",(()=>{this.close()})),e.querySelector(`.${pr}`)?.addEventListener("click",(e=>{e.stopPropagation(),this.prev()})),e.querySelector(`.${gr}`)?.addEventListener("click",(e=>{e.stopPropagation(),this.next()}))}cacheDialogRefs(){this.dialog&&(this.imageContainer=this.dialog.querySelector(`.${dr}`)??void 0,this.imageWrapper=this.dialog.querySelector(`.${hr}`)??void 0,this.infoSection=this.dialog.querySelector(`.${_r}`)??void 0,this.leftArrow=this.dialog.querySelector(`.${pr}`)??void 0,this.rightArrow=this.dialog.querySelector(`.${gr}`)??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,tr.ih)(t)}" alt="${(0,tr.ih)(n)}" loading="eager" />\n ${r.imageHtml??""}\n </div>\n `;const s=this.dialog.querySelector(`.${Tr}`);s&&(s.innerHTML=r.contentHtml??""),this.buildActions(e),this.setupImageLoadHandler()}buildActions(e){const t=this.dialog?.querySelector(`.${Er}`);if(!t)return;const n=e.dataset.downloadUrl;if(t.replaceChildren(),n){const e=document.createElement("a");e.href=n,e.className=yr,e.target="_blank",e.download="",e.innerHTML=this.getSvgIcon("fa-download"),t.appendChild(e)}const r=document.createElement("div");r.className=Sr,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=vr,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=`${vr} ${br}`,s.innerHTML=`<img src="${(0,tr.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(cr)})),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(cr),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(mr,this.currentIndex<=0),this.rightArrow?.classList.toggle(mr,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 tr.Rr(this.dialog),this.keyboardManager.listen([tr.pI.Escape],(()=>this.close())),this.keyboardManager.listen([tr.pI.ArrowRight],(()=>this.next())),this.keyboardManager.listen([tr.pI.ArrowDown],(()=>this.next())),this.keyboardManager.listen([tr.pI.ArrowLeft],(()=>this.prev())),this.keyboardManager.listen([tr.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 tr.Q$[e]}onOpen(e,t){}onClose(e,t){}onChange(e,t,n){}}Ar.targets=["item"];class Rr extends r.Controller{constructor(){super(...arguments),this.visibleIcon="fa-eye",this.hiddenIcon="fa-eye-slash"}connect(){this.togglePasswordVisibility=this.togglePasswordVisibility.bind(this),this.iconTarget.addEventListener("click",this.togglePasswordVisibility)}disconnect(){this.iconTarget.removeEventListener("click",this.togglePasswordVisibility)}togglePasswordVisibility(){const e="text"===this.inputTarget.type;this.inputTarget.type=e?"password":"text",this.iconTarget.classList.toggle(this.visibleIcon,e),this.iconTarget.classList.toggle(this.hiddenIcon,!e)}}Rr.targets=["input","icon"];class kr extends r.Controller{connect(){this.setResetButtonVisibility=this.setResetButtonVisibility.bind(this),this.inputTarget.addEventListener("input",this.setResetButtonVisibility),this.setResetButtonVisibility(),this.resetInput=this.resetInput.bind(this),this.resetButtonTarget.addEventListener("click",this.resetInput)}disconnect(){this.inputTarget.removeEventListener("input",this.setResetButtonVisibility),this.resetButtonTarget.removeEventListener("click",this.resetInput)}resetInput(){this.inputTarget.value="",this.inputTarget.dispatchEvent(new Event("input",{bubbles:!0})),this.inputTarget.dispatchEvent(new Event("change",{bubbles:!0})),this.setResetButtonVisibility(),this.inputTarget.focus()}setResetButtonVisibility(){this.inputTarget.value?this.resetButtonTarget.style.display="block":this.resetButtonTarget.style.display="none"}}kr.targets=["input","resetButton"];class Cr extends r.Controller{connect(){this.handleScroll=this.handleScroll.bind(this),this.onClick=this.onClick.bind(this),window.addEventListener("scroll",this.handleScroll),this.element.addEventListener("click",this.onClick)}disconnect(){window.removeEventListener("scroll",this.handleScroll),this.element.removeEventListener("click",this.onClick)}onClick(){window.scrollTo({top:0,left:0,behavior:"smooth"})}handleScroll(){const e=window.scrollY||document.documentElement.scrollTop;this.element.style.display=e>300?"flex":"none"}}class Lr extends r.Controller{constructor(){super(...arguments),this.handleInput=e=>{const t=e.target;t instanceof HTMLInputElement&&this.applyFilter(t.value)}}connect(){this.hasInputTarget&&(this.inputTarget.addEventListener("input",this.handleInput),this.autofocusValue&&this.inputTarget.focus(),this.applyFilter(this.inputTarget.value))}disconnect(){this.hasInputTarget&&this.inputTarget.removeEventListener("input",this.handleInput)}applyFilter(e){const t=e.trim().toLowerCase();t.length<this.minLengthValue?this.showAllItems():this.itemTargets.forEac
1h((e=>{const n=this.getItemSearchText(e);this.setItemVisibility(e,n.includes(t))}))}showAllItems(){this.itemTargets.forEach((e=>{this.setItemVisibility(e,!0)}))}setItemVisibility(e,t){e.style.display=t?this.displayTypeValue:"none"}getItemSearchText(e){const t=e.getAttribute("data-list-filter-search-text");return t?t.toLowerCase():(e.textContent??"").toLowerCase()}}Lr.targets=["input","item"],Lr.values={minLength:{type:Number,default:3},displayType:{type:String,default:"block"},autofocus:{type:Boolean,default:!1}}},52891(e,t,n){"use strict";n.r(t),n.d(t,{Application:()=>te,AttributeObserver:()=>S,Context:()=>F,Controller:()=>de,ElementObserver:()=>y,IndexedMultimap:()=>k,Multimap:()=>R,SelectorObserver:()=>C,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);return 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 n
1ame"),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}get 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
1),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 k 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 C{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()}get 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);
1if(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()}get 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 C(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 V{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 K{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 V(this),this.containsElement=e=>e.closest(this.controllerSelector)===this.element,this.schema=e,this.element=t,this.identifier=n,this.guide=new K(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,k,C,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?++C:s,__i:-1,__u:0};return null==s&&null!=k.vnode&&k.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,k.vnode&&k.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&&V(r),r}function V(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 V(e)}}function K(e){(!e.__d&&(e.__d=!0)&&L.push(e)&&!q.__r++||O!==k.debounceRendering)&&((O=k.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&&k.__c&&k.__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(k.event?k.event(e):e)}}function ee(e){if(this.l)return this.l[e.type+!0](k.event?k.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=k.__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=k.__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),k.__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=k.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]);k.__c&&k.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){k.__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){k.__e(e,n)}}function ie(e,t,n){var r,s;if(k.unmount&&k.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){k.__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,k={__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}},C=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),K(this))},H.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),K(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=k,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 ke(){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)(ke)),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 Ce="function"==typeof requestAnimationFrame;function Le(e){var t,n=function(){clearTimeout(r),Ce&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);Ce&&(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,k]=ve(!1),[C,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=>{k(!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{k(!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"},C?F("div",{class:"form__error-container"}
1,C):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 10.77 4.79999L6.88 10.57L5.13 8.56999C5.06508 8.49566 4.98613 8.43488 4.89768 8.39111C4.80922 8.34735 4.713 8.32148 4.61453 8.31498C4.51605 8.30847 4.41727 8.32147 4.32382 8.35322C4.23038 8.38497 4.14413 8.43484 4.07 8.49999C3.92511 8.63217 3.83692 8.81523 3.82387 9.01092C3.81083 9.2066 3.87393 9.39976 4 9.54999L6.43 12.24C6.50187 12.3204 6.58964 12.385 6.68775 12.4297Z"});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,\
1n ${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 Ve(e,t){We(e,{alpha:!0},((e,n)=>{n.drawImage(t,0,0,t.width,t.height,0,0,e.width,e.height)}))}function Ke(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.forEach((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=>
1{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),Ve(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)})),Ke(m.current,y,h)}),[h,y]),t.useEffect((()=>{S(n,r.dpi),Ve(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,Ke(e,y,h),Ve(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)})),Ke(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:S=!0,showName:v=!0,enableScreenshot:b=!0,useSentryUser:I={email:"email",name:"username"},tags:R,styleNonce:k,scriptNonce:C,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:V="Thank you for your report!",triggerLabel:K=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:k,scriptNonce:C,colorScheme:L,themeDark:N,themeLight:O,triggerLabel:K,triggerAriaLabel:q,cancelButtonLabel:P,submitButtonLabel:W,confirmButtonLabel:M,formTitle:U,emailLabel:D,emailPlaceholder:x,messageLabel:F,messagePlaceholder:$,nameLabel:G,namePlaceholder:H,successMessageText:V,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",C))(),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",C):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,E
1RROR_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:k});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);ce?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;k.__&&k.__(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||!C(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(C(e,t)||"object"==typeof e){return{rr_type:e.constructor.name,index:A(e,t,n)}}return e}const k=(e,t,n)=>e.map((e=>R(e,t,n))),C=(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=k(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=k(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 k(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 C={};function L(e){const t=C[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 C[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 V=new WeakMap;function K(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=V.get(e);if(n||(n=e.createElement("a"),V.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 K(e,r);if("xlink:href"===n&&"#"!==r[0])return K(e,r);if("background"===n&&("table"===t||"td"===t||"th"===t))return K(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=K(e,i.substring(0,i.length-1)),s.push(i);else{let r="";i=K(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?K(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:k,recordCanvas:C,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:k,unmaskTextSelector:C,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,k,E,C,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:k,recordCanvas:C,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:C=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"===k(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:C,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:C,onStylesheetLoad:P,stylesheetLoadTimeout:M,keepIframeSrcFn:x,ignoreCSSAttributes:B});n&&R(e,n)}}),C),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"===k(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:C,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){Ce("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 ke={};function Ce(e){const t=ke[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 ke[e]=r.bind(window)}function Le(...e){return Ce("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 Ve=e=>{if(!We)return e;return(...t)=>{try{return e(...t)}catch(e){if(We&&!0===We(e))return()=>{};throw e}}},Ke=[];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;Ke.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(Ve((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;Ve(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))})),Ve((()=>{l.forEach((e=>e()))}))}function Je({scrollCb:e,doc:t,mirror:n,blockClass:r,blockSelector:s,unblockSelector:i,sampling:a}){return ie("scroll",Ve(le(Ve((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 k=y({maskInputOptions:l,tagName:m,type:E}),C=Z(n,h,p,f,g,k);"radio"!==E&&"checkbox"!==E||(I=n.checked),v=S({isMasked:C,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:C,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);Ve(e)({...r,id:s})}}const T=("last"===u.input?["change"]:["input","change"]).map((e=>ie(e,Ve(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(){Ve(m)({target:this,isTrusted:!1})}},!1,E)))),Ve((()=>{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}}),Ve((()=>{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(Ve((t=>{const n=Date.now()-a;e(o.map((e=>(e.timeOffset-=n,e))),t),o=[],a=null})),i),c=Ve(le(Ve((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 Ve((()=>{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",Ve(le(Ve((()=>{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=Ve((a=>le(Ve((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 Ve((()=>{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:Ve(((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:Ve(((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:Ve(((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:Ve(((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:Ve(((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:Ve(((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)}))})})),Ve((()=>{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:Ve(((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:Ve(((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)}))}),Ve((()=>{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(Ve((()=>{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),Ve((()=>{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=Ve((()=>{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 Ve((()=>{Ke.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){Ce("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:k=!0,recordCanvas:C=!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 V=0;const K=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(),!Ke[0]?.isFrozen()||i.type===Oe.FullSnapshot||i.type===Oe.IncrementalSnapshot&&i.data.source===Ne.Mutation||Ke.forEach((e=>e.unfreeze())),$)t?.(K(i),s);else if(G){const e={type:"rrweb",event:K(i),origin:window.location.origin,isCheckout:s};window.parent.postMessage(e,"*")}if(i.type===Oe.FullSnapshot)W=i,V=0;else if(i.type===Oe.IncrementalSnapshot){if(i.data.source===Ne.Mutation&&i.data.isAttachIframe)return;V++;const e=r&&V>=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:C,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:C,inlineImages:P,sampling:I,slimDOMOptions:j,iframeManager:X,stylesheetManager:J,canvasManager:Z,keepIframeSrcFn:D,processedNodeManager:Q,ignoreCSSAttributes:x},mirror:Et}),te=(e=!1)=>{if(!k)return;_t({type:Oe.Meta,data:{href:window.location.href,width:pe(),height:fe()}},e),J.reset(),ee.init(),Ke.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:k,keepIframeSrcFn:C=()=>!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:k,keepIframeSrcFn:C,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:C,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)}}),Ke.forEach((e=>e.unlock())),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&J.adoptStyleSheets(document.adoptedStyleSheets,Et.getId(document))};Tt=te;try{const e=[],t=e=>Ve(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:k,recordCanvas:C,inl
1ineImages: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}})})))||[]},{});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 kt(e){const t=Ct(e);return t&&t instanceof Element?Rt(t):t}function Ct(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?kt(e.event):Ct(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=kt(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:Kt(i),end:Kt(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=Kt(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:Kt(f),end:Kt(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 Vt(e){const t=jt[e.entryType];return t?t(e):null}function Kt(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=Kt(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 kn(e){const t=r.getClient();t&&t.on("beforeAddBreadcrumb",(t=>function(e,t){if(!e.isEnabled()||!Cn(t))return;const n=function(e){if(!Cn(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 Cn(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 Vn(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 Kn(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)&&(Kn(t,n),Vn(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)),kn(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(Vt).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:k=[],maskFn:C,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:k});if(this._recordingOptions={maskAllInputs:u,maskAllText:c,maskInputOptions:{password:!0},maskTextFn:C,maskInputFn:C,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),k=n(2992),C=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),V=n(60520),K=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=k.getReplay,t.replayIntegration=k.replayIntegration,t.replayCanvasIntegration=C.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=V.diagnoseSdkConnectivity,t.registerWebWorker=K.registerWebWorker,t.webWorkerIntegration=K.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:k,finalTimeout:C,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:V}={...f,...e},K=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:k,finalTimeout:C,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(K)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(K)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,k,C,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:V})}}},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),k=n(27008),C=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),V=n(64865),K=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),ke=n(19575),Ce=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),Ve=n(90153),Ke=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),kt=n(6102),Ct=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=k.initAndBind,t.setCurrentClient=k.setCurrentClient,t.createTransport=C.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=V._setSpanForScope,t.parseSampleRate=K.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=ke.createConsolaReporter,t.addVercelAiProcessors=Ce.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=Ve.applyAggregateErrorsToEvent,t.getBreadcrumbLogLevelFromHttpStatusCode=Ke.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=kt.SDK_VERSION,t.getDebugImagesForResources=Ct.getDebugImagesForResources,t.getFilenameToDebugIdMap=Ct.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),k=n(83031),C=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 V(e){let t=0;return e.name&&(t+=2*e.name.length),t+=8,t+q(e.attributes)}function K(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",K,c._INTERNAL_flushLogsBuffer);(this._options.enableMetrics??this._options._experiments?.enableMetrics??!0)&&G(this,"afterCaptureMetric","flushMetrics",V,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&&k.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&&C.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&&C.shouldIgnoreSpan({description:e.description,op:e.op,attributes:e.data},a))C.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),k=n(27008),C=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),V=n(64865),K=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),ke=n(19575),Ce=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),Ve=n(90153),Ke=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),kt=n(6102),Ct=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),Vt=n(25073),Kt=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=k.initAndBind,t.setCurrentClient=k.setCurrentClient,t.createTransport=C.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=V._setSpanForScope,t.parseSampleRate=K.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=ke.createConsolaReporter,t.addVercelAiProcessors=Ce.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=Ve.applyAggregateErrorsToEvent,t.getBreadcrumbLogLevelFromHttpStatusCode=Ke.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=kt.SDK_VERSION,t.getDebugImagesForResources=Ct.getDebugImagesForResources,t.getFilenameToDebugIdMap=Ct.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=Vt.addOutgoingRequestBreadcrumb,t.getRequestOptions=Kt.getRequestOptions,t.getRequestUrl=Kt.getRequestUrl,t.getRequestUrlFromClientRequest=Kt.getRequestUrlFromClientRequest,t.getRequestUrlObject=Kt.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],k=A.attributes[h.ATTR_EXPRESS_TYPE],C=Object.assign(A.attributes,{[s.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]:"auto.http.express",[s.SEMANTIC_ATTRIBUTE_SENTRY_OP]:`${k}.express`});if(I&&(C[h.ATTR_HTTP_ROUTE]=I),f.isLayerIgnored(A.attributes[h.ATTR_EXPRESS_NAME],k,E))return v&&S.pop(),_.apply(this,[t,l,...T]);const L=c.getIsolationScope();if(L!==p.getDefaultIsolationScope()){if("request_handler"===k){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:C},(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"}
1,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;if(!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 k=!1;function C(e){k||(k=!0,R.setStatus(e),R.end())}const L=()=>C({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),C({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),C(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 k=E?m.join(" "):m.length>0?"[redacted]":"",C=[I.trimEnd(),k].filter(Boolean).join(" "),L=C?`${C} 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)},k=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=k,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:k,version:C}=s.getSdkMetadata()?.sdk??{};m(v,"sentry.sdk.name",k),m(v,"sentry.sdk.version",C);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:k=!0}=t,C=r.getClient();if(!C||!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||!k)return D(a),Reflect.apply(e,t,[a,...s]);const h=C.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(C.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(C.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(C.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),k="__SENTRY_SUPPRESS_TRACING__";function C(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}`),C(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=>C(e,t):e=>e()}function x(e){return e instanceof b.SentryNonRecordingSpan&&"ignored"===e.dropReason}function U(e){return!0===e.getScopeData().sdkProcessingMetadata[k]}t.SUPPRESS_TRACING_KEY=k,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=>C(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({[k]:!0});const n=e();return t.setSDKProcessingMetadata({[k]:void 0}),n}))},t.withActiveSpan=C},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 k(e){return e&&e.code!==l.SPAN_STATUS_OK&&e.code!==l.SPAN_STATUS_UNSET&&"cancelled"!==e.message?"error":"ok"}const C="_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[C]?e[C].add(t):u.addNonEnumerableProperty(e,C,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=k,t.getSpanDescendants=function(e){const t=new Set;return function e(n){if(!t.has(n)&&A(n)){t.add(n);const r=n[C]?Array.from(n[C]):[];for(const t of r)e(t)}}(e),Array.from(t)},t.getStatusMessage=R,t.getStreamedSpanLinks=T,t.removeChildSpanFromSpan=function(e,t){e[C]&&e[C].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:k(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: 4,764 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,k=R[y](E?{}:-0,1)!==R,C=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),(C||O)&&(A("delete"),A("has"),T&&A("get")),(O||k)&&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}},55002(e){"use strict";e.exports={IndexSizeError:{s:"INDEX_SIZE_ERR",c:1,m:1},DOMStringSizeError:{s:"DOMSTRING_SIZE_ERR",c:2,m:0},HierarchyRequestError:{s:"HIERARCHY_REQUEST_ERR",c:3,m:1},WrongDocumentError:{s:"WRONG_DOCUMENT_ERR",c:4,m:1},InvalidCharacterError:{s:"INVALID_CHARACTER_ERR",c:5,m:1}
1,NoDataAllowedError:{s:"NO_DATA_ALLOWED_ERR",c:6,m:0},NoModificationAllowedError:{s:"NO_MODIFICATION_ALLOWED_ERR",c:7,m:1},NotFoundError:{s:"NOT_FOUND_ERR",c:8,m:1},NotSupportedError:{s:"NOT_SUPPORTED_ERR",c:9,m:1},InUseAttributeError:{s:"INUSE_ATTRIBUTE_ERR",c:10,m:1},InvalidStateError:{s:"INVALID_STATE_ERR",c:11,m:1},SyntaxError:{s:"SYNTAX_ERR",c:12,m:1},InvalidModificationError:{s:"INVALID_MODIFICATION_ERR",c:13,m:1},NamespaceError:{s:"NAMESPACE_ERR",c:14,m:1},InvalidAccessError:{s:"INVALID_ACCESS_ERR",c:15,m:1},ValidationError:{s:"VALIDATION_ERR",c:16,m:0},TypeMismatchError:{s:"TYPE_MISMATCH_ERR",c:17,m:1},SecurityError:{s:"SECURITY_ERR",c:18,m:1},NetworkError:{s:"NETWORK_ERR",c:19,m:1},AbortError:{s:"ABORT_ERR",c:20,m:1},URLMismatchError:{s:"URL_MISMATCH_ERR",c:21,m:1},QuotaExceededError:{s:"QUOTA_EXCEEDED_ERR",c:22,m:1},TimeoutError:{s:"TIMEOUT_ERR",c:23,m:1},InvalidNodeTypeError:{s:"INVALID_NODE_TYPE_ERR",c:24,m:1},DataCloneError:{s:"DATA_CLONE_ERR",c:25,m:1}}},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);
vendor: 5,898 bytes, line 1
1e.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}},89429(e,t,n){"use strict";var r=n(44576),s=n(38574);e.exports=function(e){if(s){try{return r.process.getBuiltinModule(e)}catch(e){}try{return Function('return require("'+e+'")')()}catch(e){}}}},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="entr
1ies",A=function(){return this};e.exports=function(e,t,n,a,p,m,R){l(n,t,a);var k,C,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&&(k=c(x.call(new e)))!==Object.prototype&&k.next&&(i||c(k)===E||(u?u(k,E):o(k[S])||f(k,S,A)),d(k,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(C={values:O(b),keys:m?D:O(v),entries:O(I)},R)for(L in C)(y||w||!(L in P))&&f(P,L,C[L]);else r({target:t,proto:!0,forced:y||w},C);return i&&!R||P[S]===D||f(P,S,D,{name:p}),g[t]=D,C}},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}},50360(e,t,n){"use strict";var r=n(44576).isFinite;e.exports=Number.isFinite||function(e){return"number"==typeof e&&r(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 k=p.groups,C=b&&f.sticky,L=i(l,f),O=f.source,N=0,w=A;if(C&&(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,C?n:f,w),C?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&&k)for(s.groups=c=d(null),a=0;a<k.length;a++)c[(u=k[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,k={},C="onreadystatechange";h((function(){r=o.location}));var L=function(e){if(d(k,e)){var t=k[e];delete k[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 k[++R]=function(){l(t,void 0,n)},s(R),R},y=function(e){delete k[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=C in g("script")?function(e){f.appendChild(g("script"))[C]=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,602 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)},k=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);
1return A&&"string"==typeof s?E(s,S,k):s}})},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),k=l("".charCodeAt),C=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=k(c,0))||45===t){if(88===(n=k(c,2))||120===n)return NaN}else if(48===t){switch(k(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=k(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:C(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)},25428(e,t,n){"use strict";n(46518)({target:"Number",stat:!0},{isFinite:n(50360)})},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,300 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)}})},78459(e,t,n){"use strict";var r=n(46518),s=n(33904);r({global:!0,forced:parseFloat!==s},{parseFloat:s})},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),k=n(10916),C=n(36043),L="Promise",O=k.CONSTRUCTOR,N=k.REJECTION_EVENT,w=k.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=C.f,H=G,j=!!(F&&F.createEvent&&c.dispatchEvent),W="unhandledrejection",V=function(e){var t;return!(!_(e)||!m(t=e.then))&&t},K=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=V(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();)K(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=V(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(){K(r,n)}
vendor: 4,717 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)},C.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}})},15472(e,t,n){"use strict";var r=n(46518),s=n(44576),i=n(10687);r({global:!0},{Reflect:{}}),i(s.Reflect,"Reflect",!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: 8,480 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"),k=!!/./[E]&&""===/./[E]("a","$0");a("replace",(function(e,t,n){var i=k?"$":"$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,k=[];null!==(R=T(a,o))&&(b(k,R),E);){""===f(R[0])&&(a.lastIndex=g(o,h(a.lastIndex),m))}for(var C,L="",O=0,N=0;N<k.length;N++){for(var w,P=f((R=k[N])[0]),M=y(S(d(R.index),o.length),0),D=[],x=1;x<R.length;x++)b(D,void 0===(C=R[x])?C:String(C));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||k)},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),k=n(36840),C=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),V=Object[H],K=s.Symbol,q=K&&K[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(V,t);r&&delete V[t],Q(e,t,n),r&&e!==V&&Q(V,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===V&&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===V&&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!==V||!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===V,n=Z(t?re:p(e)),r=[];return F(n,(function(e){!d(ne,e)||t&&!d(V,e)||te(r,ne[e])})),r};c||(K=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===V&&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(V,t,{configurable:!0,set:n}),le(t,e)},k(q=K[H],"toString",(function(){return W(this).tag})),k(K,"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&&(C(q,"description",{configurable:!0,get:function(){return W(this).description}}),o||k(V,"propertyIsEnumerable",de,{unsafe:!0}))),r({global:!0,constructor:!0,wrap:!0,forced:!c,sham:!c},{Symbol:K}),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(K,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 k=a(A.delete),C=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),k(this,e)||t.frozen.delete(e)}return k(this,e)},has:function(e){if(d(e)&&!_(e)){var t=h(this);return t.frozen||(t.frozen=new r),C(this,e)||t.frozen.has(e)}return C(this,e)},get:function(e){if(d(e)&&!_(e)){var t=h(this);return t.frozen||(t.frozen=new r),C(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),C(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)}
vendor: 4,947 bytes, line 1
1))&&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")},55815(e,t,n){"use strict";var r=n(46518),s=n(97751),i=n(89429),a=n(79039),o=n(2360),l=n(6980),c=n(24913).f,u=n(36840),d=n(62106),h=n(39297),f=n(90679),p=n(28551),g=n(77536),m=n(32603),_=n(55002),T=n(16193),E=n(91181),y=n(43724),S=n(96395),v="DOMException",b="DATA_CLONE_ERR",I=s("Error"),A=s(v)||function(){try{(new(s("MessageChannel")||i("worker_threads").MessageChannel)).port1.postMessage(new WeakMap)}catch(e){if(e.name===b&&25===e.code)return e.constructor}}(),R=A&&A.prototype,k=I.prototype,C=E.set,L=E.getterFor(v),O="stack"in new I(v),N=function(e){return h(_,e)&&_[e].m?_[e].c:0},w=function(){f(this,P);var e=arguments.length,t=m(e<1?void 0:arguments[0]),n=m(e<2?void 0:arguments[1],"Error"),r=N(n);if(C(this,{type:v,name:n,message:t,code:r}),y||(this.name=n,this.message=t,this.code=r),O){var s=new I(t);s.name=v,c(this,"stack",l(1,T(s.stack,1)))}},P=w.prototype=o(k),M=function(e){return{enumerable:!0,configurable:!0,get:e}},D=function(e){return M((function(){return L(this)[e]}))};y&&(d(P,"code",D("code")),d(P,"message",D("message")),d(P,"name",D("name"))),c(P,"constructor",l(1,w));var x=a((function(){return!(new A instanceof I)})),U=x||a((function(){return k.toString!==g||"2: 1"!==String(new A(1,2))})),B=x||a((function(){return 25!==new A(1,"DataCloneError").code})),F=x||25!==A[b]||25!==R[b],$=S?U||B||F:x;r({global:!0,constructor:!0,forced:$},{DOMException:$?w:A});var G=s(v),H=G.prototype;for(var j in U&&(S||A===G)&&u(H,"toString",g),B&&y&&A===G&&d(H,"code",M((function(){return N(p(this).name)}))),_)if(h(_,j)){var W=_[j],V=W.s,K=l(6,W.c);h(G,V)||c(G,V,K),h(H,V)||c(H,V,K)}},64979(e,t,n){"use strict";var r=n(46518),s=n(44576),i=n(97751),a=n(6980),o=n(24913).f,l=n(39297),c=n(90679),u=n(23167),d=n(32603),h=n(55002),f=n(16193),p=n(43724),g=n(96395),m="DOMException",_=i("Error"),T=i(m),E=function(){c(this,y);var e=arguments.length,t=d(e<1?void 0:arguments[0]),n=d(e<2?void 0:arguments[1],"Error"),r=new T(t,n),s=new _(t);return s.name=m,o(r,"stack",a(1,f(s.stack,1))),u(r,this,E),r},y=E.prototype=T.prototype,S="stack"in new _(m),v="stack"in new T(1,2),b=T&&p&&Object.getOwnPropertyDescriptor(s,m),I=!(!b||b.writable&&b.configurable),A=S&&!I&&!v;r({global:!0,constructor:!0,forced:g||A},{DOMException:A?E:T});var R=i(m),k=R.prototype;if(k.constructor!==R)for(var C in g||o(k,"constructor",a(1,R)),h)if(l(h,C)){var L=h[C],O=L.s;l(R,O)||o(R,O,a(6,L.c))}},79739(e,t,n){"use strict";var r=n(97751),s="DOMException";n(10687)(r(s),s)},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),k=n(70081),C=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,V=s.encodeURIComponent,K=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=K(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}
vendor: 17,777 bytes, line 1
1,ue=/[!'()~]|%20/g,de={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},he=function(e){return de[e]},fe=function(e){return Q(V(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=C(e);if(u)for(n=(t=k(e,u)).next;!(r=o(n,t)).done;){if(i=(s=k(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);O(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,k=v.getState,C=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),V="Invalid scheme",K="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={},ke={},Ce={},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=k(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 V;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 V;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 V;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 ke:if(t&&"file"===c.scheme){u=Ne;continue}if(":"!==i||_){if(i===r||"/"===i||"?"===i||"#"===i||"\\"===i&&c.isSpecial()){if(c.isSpecial()&&""===h)return K;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 K;if(o=c.parseHost(h))return o;if(h="",u=Ce,t===ke)return}break;case Ce: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 K;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 K;this.host=t}else if(this.isSpecial()){if(e=T(e),M(te,e))return K;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 K;this.host=t}else{if(M(ne,e))return K;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,ke)},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,Ce))},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}),C){var Ge=C.createObjectURL,He=C.revokeObjectURL;Ge&&u(Be,"createObjectURL",l(Ge,C)),He&&u(Be,"revokeObjectURL",l(He,C))}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.