From 9b4e0435c5ea73f25590f1f8bef74e9a9fc49c33 Mon Sep 17 00:00:00 2001 From: Andrew S Date: Mon, 9 Dec 2024 20:01:47 -0600 Subject: [PATCH] Fix yt --- chrome/player/modules/yt.mjs | 54 +++++++++++++-------------- chrome/player/players/yt/YTPlayer.mjs | 1 + 2 files changed, 28 insertions(+), 27 deletions(-) diff --git a/chrome/player/modules/yt.mjs b/chrome/player/modules/yt.mjs index dd4459b3..de9dd06d 100644 --- a/chrome/player/modules/yt.mjs +++ b/chrome/player/modules/yt.mjs @@ -1,50 +1,50 @@ /* eslint-disable */ /* LuanRT/YouTube.js */ // Minified to reduce loading time (https://minify-js.com/) -var D0=Object.defineProperty;var o=(t,e)=>D0(t,"name",{value:e,configurable:!0});var ye=(t,e)=>{for(var i in e)D0(t,i,{get:e[i],enumerable:!0})};function L0(t,e){var i={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(i[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(t);r=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}o(B0,"__values");function Ui(t){return this instanceof Ui?(this.v=t,this):new Ui(t)}o(Ui,"__await");function F0(t,e,i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=i.apply(t,e||[]),r,a=[];return r={},c("next"),c("throw"),c("return"),r[Symbol.asyncIterator]=function(){return this},r;function c(v){n[v]&&(r[v]=function(w){return new Promise(function(k,S){a.push([v,w,k,S])>1||p(v,w)})})}function p(v,w){try{d(n[v](w))}catch(k){x(a[0][3],k)}}function d(v){v.value instanceof Ui?Promise.resolve(v.value.v).then(_,f):x(a[0][2],v)}function _(v){p("next",v)}function f(v){p("throw",v)}function x(v,w){v(w),a.shift(),a.length&&p(a[0][0],a[0][1])}}o(F0,"__asyncGenerator");function Y0(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],i;return e?e.call(t):(t=typeof B0=="function"?B0(t):t[Symbol.iterator](),i={},n("next"),n("throw"),n("return"),i[Symbol.asyncIterator]=function(){return this},i);function n(a){i[a]=t[a]&&function(c){return new Promise(function(p,d){c=t[a](c),r(p,d,c.done,c.value)})}}function r(a,c,p,d){Promise.resolve(d).then(function(_){a({value:_,done:p})},c)}}o(Y0,"__asyncValues");function m(t,e,i,n){if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return i==="m"?n:i==="a"?n.call(t):n?n.value:e.get(t)}o(m,"__classPrivateFieldGet");function E(t,e,i,n,r){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!r:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?r.call(t,i):r?r.value=i:e.set(t,i),i}o(E,"__classPrivateFieldSet");var Go={};ye(Go,{ChannelError:()=>ko,InnertubeError:()=>b,MissingParamError:()=>Bf,OAuth2Error:()=>ex,ParsingError:()=>st,Platform:()=>W,PlayerError:()=>Tt,SessionError:()=>Tn,base64ToU8:()=>Px,concatMemos:()=>Hx,debugFetch:()=>nS,deepCompare:()=>Yf,escapeStringRegexp:()=>d0,findFunction:()=>f0,generateRandomString:()=>Fi,generateSidAuth:()=>tS,getCookie:()=>oS,getRandomUserAgent:()=>Gi,getStringBetweenStrings:()=>Fe,hasKeys:()=>iS,isTextRun:()=>je,streamToIterable:()=>fx,throwIfMissing:()=>Uo,timeToSeconds:()=>ke,u8ToBase64:()=>Ge});var dx={};ye(dx,{Maybe:()=>Wi,Memo:()=>ti,SuperParsedResult:()=>kt,YTNode:()=>s,observe:()=>X});var Ie,Oe=class{static doLog(e,i,n){if(!this.log_map_[e]||!this.log_level_.includes(e))return;let r=[`[${this.YTJS_TAG}]`];i&&r.push(`[${i}]`),this.log_map_[e](`${r.join("")}:`,...n||[])}static setLevel(...e){this.log_level_=e}};o(Oe,"Log");Ie=Oe;Oe.YTJS_TAG="YOUTUBEJS";Oe.Level={NONE:0,ERROR:1,WARNING:2,INFO:3,DEBUG:4};Oe.log_map_={[Ie.Level.ERROR]:(...t)=>console.error(...t),[Ie.Level.WARNING]:(...t)=>console.warn(...t),[Ie.Level.INFO]:(...t)=>console.info(...t),[Ie.Level.DEBUG]:(...t)=>console.debug(...t)};Oe.log_level_=[Ie.Level.WARNING];Oe.one_time_warnings_issued_=new Set;Oe.warnOnce=(t,...e)=>{Ie.one_time_warnings_issued_.has(t)||(Ie.doLog(Ie.Level.WARNING,t,e),Ie.one_time_warnings_issued_.add(t))};Oe.warn=(t,...e)=>Ie.doLog(Ie.Level.WARNING,t,e);Oe.error=(t,...e)=>Ie.doLog(Ie.Level.ERROR,t,e);Oe.info=(t,...e)=>Ie.doLog(Ie.Level.INFO,t,e);Oe.debug=(t,...e)=>Ie.doLog(Ie.Level.DEBUG,t,e);var j=Oe;var cx,U0,be,px,le,It,Ut,ji,j0=Symbol("ObservedArray.isObserved"),s=class{constructor(){cx.add(this),this.type=this.constructor.type}is(...e){return e.some(i=>m(this,cx,"m",U0).call(this,i))}as(...e){if(!this.is(...e))throw new st(`Cannot cast ${this.type} to one of ${e.map(i=>i.type).join(", ")}`);return this}hasKey(e){return Reflect.has(this,e)}key(e){if(!this.hasKey(e))throw new st(`Missing key ${e}`);return new Wi(this[e])}};o(s,"YTNode");cx=new WeakSet,U0=o(function(e){return this.type===e.type},"_YTNode_is");s.type="YTNode";var Wi=class{constructor(e){be.add(this),px.set(this,"Maybe"),le.set(this,void 0),E(this,le,e,"f")}get typeof(){return typeof m(this,le,"f")}string(){return m(this,be,"m",Ut).call(this,"string")}isString(){return m(this,be,"m",It).call(this,"string")}number(){return m(this,be,"m",Ut).call(this,"number")}isNumber(){return m(this,be,"m",It).call(this,"number")}bigint(){return m(this,be,"m",Ut).call(this,"bigint")}isBigint(){return m(this,be,"m",It).call(this,"bigint")}boolean(){return m(this,be,"m",Ut).call(this,"boolean")}isBoolean(){return m(this,be,"m",It).call(this,"boolean")}symbol(){return m(this,be,"m",Ut).call(this,"symbol")}isSymbol(){return m(this,be,"m",It).call(this,"symbol")}undefined(){return m(this,be,"m",Ut).call(this,"undefined")}isUndefined(){return m(this,be,"m",It).call(this,"undefined")}null(){if(m(this,le,"f")!==null)throw new TypeError(`Expected null, got ${typeof m(this,le,"f")}`);return m(this,le,"f")}isNull(){return m(this,le,"f")===null}object(){return m(this,be,"m",Ut).call(this,"object")}isObject(){return m(this,be,"m",It).call(this,"object")}function(){return m(this,be,"m",Ut).call(this,"function")}isFunction(){return m(this,be,"m",It).call(this,"function")}array(){if(!Array.isArray(m(this,le,"f")))throw new TypeError(`Expected array, got ${typeof m(this,le,"f")}`);return m(this,le,"f")}arrayOfMaybe(){let e=[];return new Proxy(this.array(),{get(i,n){return Reflect.has(e,n)?Reflect.get(i,n):new Wi(Reflect.get(i,n))}})}isArray(){return Array.isArray(m(this,le,"f"))}node(){if(!(m(this,le,"f")instanceof s))throw new TypeError(`Expected YTNode, got ${m(this,le,"f").constructor.name}`);return m(this,le,"f")}isNode(){return m(this,le,"f")instanceof s}nodeOfType(...e){return this.node().as(...e)}isNodeOfType(...e){return this.isNode()&&this.node().is(...e)}observed(){if(!this.isObserved())throw new TypeError(`Expected ObservedArray, got ${typeof m(this,le,"f")}`);return m(this,le,"f")}isObserved(){var e;return(e=m(this,le,"f"))===null||e===void 0?void 0:e[j0]}parsed(){if(!(m(this,le,"f")instanceof kt))throw new TypeError(`Expected SuperParsedResult, got ${typeof m(this,le,"f")}`);return m(this,le,"f")}isParsed(){return m(this,le,"f")instanceof kt}any(){return j.warn(m(this,px,"f"),"This call is not meant to be used outside of debugging. Please use the specific type getter instead."),m(this,le,"f")}instanceof(e){if(!this.isInstanceof(e))throw new TypeError(`Expected instance of ${e.name}, got ${m(this,le,"f").constructor.name}`);return m(this,le,"f")}isInstanceof(e){return m(this,le,"f")instanceof e}};o(Wi,"Maybe");px=new WeakMap,le=new WeakMap,be=new WeakSet,It=o(function(e){return typeof m(this,le,"f")===e},"_Maybe_checkPrimative"),Ut=o(function(e){if(!m(this,be,"m",It).call(this,e))throw new TypeError(`Expected ${e}, got ${this.typeof}`);return m(this,le,"f")},"_Maybe_assertPrimative");var kt=class{constructor(e){ji.set(this,void 0),E(this,ji,e,"f")}get is_null(){return m(this,ji,"f")===null}get is_array(){return!this.is_null&&Array.isArray(m(this,ji,"f"))}get is_node(){return!this.is_array}array(){if(!this.is_array)throw new TypeError("Expected an array, got a node");return m(this,ji,"f")}item(){if(!this.is_node)throw new TypeError("Expected a node, got an array");return m(this,ji,"f")}};o(kt,"SuperParsedResult");ji=new WeakMap;function X(t){return new Proxy(t,{get(e,i){return i=="get"?(n,r)=>e.find((a,c)=>{let p=Yf(n,a);return p&&r&&e.splice(c,1),p}):i==j0?!0:i=="getAll"?(n,r)=>e.filter((a,c)=>{let p=Yf(n,a);return p&&r&&e.splice(c,1),p}):i=="matchCondition"?n=>e.find(r=>n(r)):i=="filterType"?(...n)=>X(e.filter(r=>!!r.is(...n))):i=="firstOfType"?(...n)=>e.find(r=>!!r.is(...n)):i=="first"?()=>e[0]:i=="as"?(...n)=>X(e.map(r=>{if(r.is(...n))return r;throw new st(`Expected node of any type ${n.map(a=>a.type).join(", ")}, got ${r.type}`)})):i=="remove"?n=>e.splice(n,1):Reflect.get(e,i)}})}o(X,"observe");var ti=class extends Map{getType(...e){return e=e.flat(),X(e.flatMap(i=>this.get(i.type)||[]))}};o(ti,"Memo");var qx={};ye(qx,{Author:()=>D,ChildElement:()=>Ph,EmojiRun:()=>oi,Format:()=>bg,Text:()=>u,TextRun:()=>ri,Thumbnail:()=>y,VideoDetails:()=>Si});var ge={};ye(ge,{CLIENTS:()=>re,INNERTUBE_HEADERS_BASE:()=>X1,OAUTH:()=>q1,STREAM_HEADERS:()=>jt,SUPPORTED_CLIENTS:()=>Uf,URLS:()=>et});var et=Object.freeze({YT_BASE:"https://www.youtube.com",YT_MUSIC_BASE:"https://music.youtube.com",YT_SUGGESTIONS:"https://suggestqueries.google.com/complete/",YT_UPLOAD:"https://upload.youtube.com/",API:Object.freeze({BASE:"https://youtubei.googleapis.com",PRODUCTION_1:"https://www.youtube.com/youtubei/",PRODUCTION_2:"https://youtubei.googleapis.com/youtubei/",STAGING:"https://green-youtubei.sandbox.googleapis.com/youtubei/",RELEASE:"https://release-youtubei.sandbox.googleapis.com/youtubei/",TEST:"https://test-youtubei.sandbox.googleapis.com/youtubei/",CAMI:"http://cami-youtubei.sandbox.googleapis.com/youtubei/",UYTFE:"https://uytfe.sandbox.google.com/youtubei/"})}),q1=Object.freeze({REGEX:Object.freeze({TV_SCRIPT:new RegExp(']*><\\/script>'),CLIENT_IDENTITY:new RegExp('clientId:"(?[^"]+)",[^"]*?:"(?[^"]+)"')})}),re=Object.freeze({IOS:{NAME_ID:"5",NAME:"iOS",VERSION:"18.06.35",USER_AGENT:"com.google.ios.youtube/18.06.35 (iPhone; CPU iPhone OS 14_4 like Mac OS X; en_US)",DEVICE_MODEL:"iPhone10,6"},WEB:{NAME_ID:"1",NAME:"WEB",VERSION:"2.20240111.09.00",API_KEY:"AIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8",API_VERSION:"v1",STATIC_VISITOR_ID:"6zpwvWUNAco"},WEB_KIDS:{NAME_ID:"76",NAME:"WEB_KIDS",VERSION:"2.20230111.00.00"},YTMUSIC:{NAME_ID:"67",NAME:"WEB_REMIX",VERSION:"1.20211213.00.00"},ANDROID:{NAME_ID:"3",NAME:"ANDROID",VERSION:"18.48.37",SDK_VERSION:33,USER_AGENT:"com.google.android.youtube/18.48.37(Linux; U; Android 13; en_US; sdk_gphone64_x86_64 Build/UPB4.230623.005) gzip"},YTSTUDIO_ANDROID:{NAME_ID:"14",NAME:"ANDROID_CREATOR",VERSION:"22.43.101"},YTMUSIC_ANDROID:{NAME_ID:"21",NAME:"ANDROID_MUSIC",VERSION:"5.34.51"},TV_EMBEDDED:{NAME_ID:"85",NAME:"TVHTML5_SIMPLY_EMBEDDED_PLAYER",VERSION:"2.0"}}),jt=Object.freeze({accept:"*/*",origin:"https://www.youtube.com",referer:"https://www.youtube.com",DNT:"?1"}),X1=Object.freeze({accept:"*/*","accept-encoding":"gzip, deflate","content-type":"application/json"}),Uf=["IOS","WEB","YTKIDS","YTMUSIC","ANDROID","YTSTUDIO_ANDROID","YTMUSIC_ANDROID","TV_EMBEDDED"];var l={};ye(l,{addRuntimeParser:()=>Fx,applyCommentsMutations:()=>LT,applyMutations:()=>BT,getDynamicParsers:()=>_k,getParserByName:()=>mf,hasParser:()=>xg,parse:()=>We,parseActions:()=>DT,parseArray:()=>Ve,parseC:()=>MT,parseFormats:()=>jx,parseItem:()=>ie,parseLC:()=>Ux,parseRR:()=>wg,parseResponse:()=>Yx,sanitizeClassName:()=>_f,setParserErrorHandler:()=>mk,shouldIgnore:()=>VT});var on={};ye(on,{AboutChannel:()=>Zf,AboutChannelView:()=>Qf,AccountChannel:()=>em,AccountItemSection:()=>im,AccountItemSectionHeader:()=>tm,AccountSectionList:()=>nm,AddBannerToLiveChatCommand:()=>Xy,AddChatItemAction:()=>t_,AddLiveChatTickerItemAction:()=>Qy,Alert:()=>Nn,AlertWithButton:()=>cm,AnalyticsMainAppKeyMetrics:()=>nv,AnalyticsRoot:()=>ov,AnalyticsShortsCarouselCard:()=>rv,AnalyticsVideo:()=>dm,AnalyticsVodCarouselCard:()=>sv,AnchoredSection:()=>fg,AppendContinuationItemsAction:()=>Ki,AttributionView:()=>fm,AudioOnlyPlayability:()=>mm,AuthorCommentBadge:()=>sh,AutomixPreviewVideo:()=>hm,AvatarView:()=>_m,BackstageImage:()=>gm,BackstagePost:()=>si,BackstagePostThread:()=>lv,BadgeView:()=>ai,BrowseFeedActions:()=>vm,BrowserMediaSession:()=>cv,Button:()=>I,ButtonView:()=>St,C4TabbedHeader:()=>Fn,CallToActionButton:()=>pv,Card:()=>dv,CardCollection:()=>Gm,CarouselHeader:()=>$m,CarouselItem:()=>fv,CarouselLockup:()=>Um,Channel:()=>Km,ChannelAboutFullMetadata:()=>Ys,ChannelAgeGate:()=>mv,ChannelExternalLinkView:()=>Xf,ChannelFeaturedContent:()=>hv,ChannelHeaderLinks:()=>ym,ChannelHeaderLinksView:()=>bm,ChannelMetadata:()=>qm,ChannelMobileHeader:()=>_v,ChannelOptions:()=>Xm,ChannelOwnerEmptyState:()=>gv,ChannelSubMenu:()=>$s,ChannelTagline:()=>Hm,ChannelThumbnailWithLink:()=>xv,ChannelVideoPlayer:()=>vv,Chapter:()=>Qm,ChildVideo:()=>yv,ChipBarView:()=>bv,ChipCloud:()=>Yn,ChipCloudChip:()=>Ye,ChipView:()=>Zm,ClipAdState:()=>Im,ClipCreation:()=>km,ClipCreationScrubber:()=>Tm,ClipCreationTextInput:()=>wm,ClipSection:()=>Sm,CollaboratorInfoCardContent:()=>wv,CollageHeroImage:()=>Tv,CollectionThumbnailView:()=>oh,Comment:()=>Hn,CommentActionButtons:()=>Rn,CommentDialog:()=>gy,CommentReplies:()=>fh,CommentReplyDialog:()=>Un,CommentSimplebox:()=>gh,CommentThread:()=>xh,CommentView:()=>_i,CommentsEntryPointHeader:()=>_h,CommentsEntryPointTeaser:()=>hh,CommentsHeader:()=>hi,CommentsSimplebox:()=>mh,CompactChannel:()=>xy,CompactLink:()=>zn,CompactMix:()=>vy,CompactMovie:()=>yy,CompactPlaylist:()=>by,CompactStation:()=>wy,CompactVideo:()=>Bn,ConfirmDialog:()=>Ty,ContentMetadataView:()=>Kn,ContentPreviewImageView:()=>Dn,ContinuationItem:()=>ce,ConversationBar:()=>Iy,CopyLink:()=>vh,CreatePlaylistDialog:()=>Gf,CreatorHeart:()=>xm,CtaGoToCreatorStudio:()=>av,DataModelSection:()=>pm,DecoratedAvatarView:()=>yh,DecoratedPlayerBar:()=>Ih,DefaultPromoPanel:()=>ky,DescriptionPreviewView:()=>kh,DidYouMean:()=>Sy,DimChatItemAction:()=>Zy,DislikeButtonView:()=>Sh,DownloadButton:()=>Ch,Dropdown:()=>ni,DropdownItem:()=>zf,DynamicTextView:()=>Eh,Element:()=>qn,EmergencyOnebox:()=>Cy,EmojiPicker:()=>dh,EmojiPickerCategory:()=>Ey,EmojiPickerCategoryButton:()=>Py,EmojiPickerUpsellCategory:()=>Ny,EndScreenPlaylist:()=>Rh,EndScreenVideo:()=>Ah,Endscreen:()=>Nh,EndscreenElement:()=>Ry,EngagementPanelSectionList:()=>pi,EngagementPanelTitleHeader:()=>Cm,EomSettingsDisclaimer:()=>Ay,ExpandableMetadata:()=>Mm,ExpandableTab:()=>Xn,ExpandableVideoDescriptionBody:()=>Rm,ExpandedShelfContents:()=>Vy,Factoid:()=>ci,FancyDismissibleDialog:()=>My,FeedFilterChipBar:()=>vt,FeedNudge:()=>Dy,FeedTabbedHeader:()=>Vh,FlexibleActionsView:()=>Mh,GameCard:()=>Am,GameDetails:()=>By,Grid:()=>Ly,GridChannel:()=>Dh,GridHeader:()=>Oy,GridMix:()=>Fy,GridMovie:()=>Yy,GridPlaylist:()=>Bh,GridShow:()=>Uy,GridVideo:()=>Fh,GuideCollapsibleEntry:()=>jy,GuideCollapsibleSectionEntry:()=>Wy,GuideDownloadsEntry:()=>Jy,GuideEntry:()=>nn,GuideSection:()=>Qn,GuideSubscriptionsSection:()=>Yh,HashtagHeader:()=>Uh,HashtagTile:()=>Hy,HeatMarker:()=>bh,Heatmap:()=>wh,HeroPlaylistThumbnail:()=>zy,HighlightsCarousel:()=>Gy,HistorySuggestion:()=>$y,HorizontalCardList:()=>ui,HorizontalList:()=>Vm,HorizontalMovieList:()=>Ky,IconLink:()=>Wh,ImageBannerView:()=>Jh,IncludingResultsFor:()=>qy,InfoPanelContainer:()=>zh,InfoPanelContent:()=>Hh,InfoRow:()=>Ym,InteractiveTabbedHeader:()=>Gh,ItemSection:()=>tt,ItemSectionHeader:()=>Zn,ItemSectionTab:()=>$h,ItemSectionTabbedHeader:()=>eo,KidsBlocklistPicker:()=>vT,KidsBlocklistPickerItem:()=>mg,KidsCategoriesHeader:()=>yT,KidsCategoryTab:()=>hg,KidsHomeScreen:()=>bT,LikeButton:()=>qh,LikeButtonView:()=>Xh,LiveChat:()=>Qh,LiveChatActionPanel:()=>n_,LiveChatAuthorBadge:()=>Ib,LiveChatAutoModMessage:()=>eb,LiveChatBanner:()=>e_,LiveChatBannerHeader:()=>Zh,LiveChatBannerPoll:()=>tb,LiveChatDialog:()=>kb,LiveChatHeader:()=>l_,LiveChatItemList:()=>c_,LiveChatMembershipItem:()=>ib,LiveChatMessageInput:()=>Sb,LiveChatPaidMessage:()=>nb,LiveChatPaidSticker:()=>ob,LiveChatParticipant:()=>p_,LiveChatParticipantsList:()=>d_,LiveChatPlaceholderItem:()=>rb,LiveChatProductItem:()=>sb,LiveChatRestrictedParticipation:()=>ab,LiveChatTextMessage:()=>ub,LiveChatTickerPaidMessageItem:()=>i_,LiveChatTickerPaidStickerItem:()=>lb,LiveChatTickerSponsorItem:()=>cb,LiveChatViewerEngagementMessage:()=>pb,LockupMetadataView:()=>f_,LockupView:()=>m_,MacroMarkersInfoItem:()=>Em,MacroMarkersList:()=>Pm,MacroMarkersListItem:()=>Vn,MarkChatItemAsDeletedAction:()=>fb,MarkChatItemsByAuthorAsDeletedAction:()=>mb,Menu:()=>F,MenuNavigationItem:()=>h_,MenuPopup:()=>Cb,MenuServiceItem:()=>vi,MenuServiceItemDownload:()=>Eb,MerchandiseItem:()=>Rb,MerchandiseShelf:()=>v_,Message:()=>gi,MetadataBadge:()=>ze,MetadataRow:()=>Ab,MetadataRowContainer:()=>y_,MetadataRowHeader:()=>Vb,MetadataScreen:()=>Mb,MicroformatData:()=>yi,Mix:()=>Db,ModalWithTitleAndButton:()=>Bb,Movie:()=>Lb,MovingThumbnail:()=>Ob,MultiMarkersPlayerBar:()=>Th,MultiPageMenu:()=>Pb,MultiPageMenuNotificationSection:()=>Nb,MusicCardShelf:()=>Fb,MusicCardShelfHeaderBasic:()=>b_,MusicCarouselShelf:()=>Kb,MusicCarouselShelfBasicHeader:()=>w_,MusicDescriptionShelf:()=>E_,MusicDetailHeader:()=>qb,MusicDownloadStateBadge:()=>Xb,MusicEditablePlaylistDetailHeader:()=>Qb,MusicElementHeader:()=>Zb,MusicHeader:()=>ew,MusicImmersiveHeader:()=>tw,MusicInlineBadge:()=>io,MusicItemThumbnailOverlay:()=>Pt,MusicLargeCardItemCarousel:()=>iw,MusicMenuItemDivider:()=>__,MusicMultiRowListItem:()=>T_,MusicMultiSelectMenu:()=>g_,MusicMultiSelectMenuItem:()=>to,MusicNavigationButton:()=>I_,MusicPlayButton:()=>no,MusicPlaylistEditHeader:()=>nw,MusicPlaylistShelf:()=>ow,MusicQueue:()=>R_,MusicResponsiveHeader:()=>rw,MusicResponsiveListItem:()=>bi,MusicResponsiveListItemFixedColumn:()=>k_,MusicResponsiveListItemFlexColumn:()=>S_,MusicShelf:()=>sw,MusicSideAlignedItem:()=>aw,MusicSortFilterButton:()=>uw,MusicTastebuilderShelf:()=>lw,MusicTastebuilderShelfThumbnail:()=>A_,MusicThumbnail:()=>Ne,MusicTwoRowItem:()=>C_,MusicVisualHeader:()=>cw,NavigationEndpoint:()=>g,Notification:()=>V_,OpenPopupAction:()=>$f,PageHeader:()=>Nt,PageHeaderView:()=>M_,PageIntroduction:()=>D_,PdgCommentChip:()=>ah,PivotButton:()=>B_,PlayerAnnotationsExpanded:()=>L_,PlayerCaptionsTracklist:()=>O_,PlayerControlsOverlay:()=>pw,PlayerErrorMessage:()=>dw,PlayerLegacyDesktopYpcOffer:()=>fw,PlayerLegacyDesktopYpcTrailer:()=>up,PlayerLiveStoryboardSpec:()=>U_,PlayerMicroformat:()=>nt,PlayerOverflow:()=>F_,PlayerOverlay:()=>J_,PlayerOverlayAutoplay:()=>j_,PlayerStoryboardSpec:()=>Hi,Playlist:()=>Et,PlaylistCustomThumbnail:()=>Gn,PlaylistHeader:()=>H_,PlaylistInfoCardContent:()=>mw,PlaylistMetadata:()=>z_,PlaylistPanel:()=>N_,PlaylistPanelVideo:()=>Jt,PlaylistPanelVideoWrapper:()=>P_,PlaylistSidebar:()=>hw,PlaylistSidebarPrimaryInfo:()=>G_,PlaylistSidebarSecondaryInfo:()=>$_,PlaylistVideo:()=>ro,PlaylistVideoList:()=>_w,PlaylistVideoThumbnail:()=>$n,Poll:()=>gw,PollHeader:()=>db,Post:()=>K_,PostMultiImage:()=>xw,ProductList:()=>Nm,ProductListHeader:()=>vw,ProductListItem:()=>yw,ProfileColumn:()=>bw,ProfileColumnStats:()=>ww,ProfileColumnStatsEntry:()=>Tw,ProfileColumnUserInfo:()=>Iw,Quiz:()=>kw,RecognitionShelf:()=>Sw,ReelItem:()=>so,ReelPlayerHeader:()=>q_,ReelPlayerOverlay:()=>Cw,ReelShelf:()=>On,RelatedChipCloud:()=>X_,RemoveBannerForLiveChatCommand:()=>hb,RemoveChatItemAction:()=>_b,RemoveChatItemByAuthorAction:()=>gb,ReplaceChatItemAction:()=>xb,ReplayChatItemAction:()=>vb,RichGrid:()=>wi,RichItem:()=>Ew,RichListHeader:()=>Pw,RichMetadata:()=>Up,RichMetadataRow:()=>Wp,RichSection:()=>Nw,RichShelf:()=>Q_,SearchBox:()=>Rw,SearchFilter:()=>Z_,SearchFilterGroup:()=>ao,SearchFilterOptionsDialog:()=>Aw,SearchHeader:()=>eg,SearchRefinementCard:()=>qi,SearchSubMenu:()=>tg,SearchSuggestion:()=>jh,SearchSuggestionsSection:()=>Vw,SecondarySearchContainer:()=>Mw,SectionList:()=>ve,SegmentedLikeDislikeButton:()=>sn,SegmentedLikeDislikeButtonView:()=>an,SettingBoolean:()=>Dw,SettingsCheckbox:()=>ig,SettingsOptions:()=>lo,SettingsSidebar:()=>ng,SettingsSwitch:()=>uo,SharedPost:()=>og,Shelf:()=>co,ShortsLockupView:()=>po,ShowCustomThumbnail:()=>Lh,ShowLiveChatActionPanelAction:()=>yb,ShowLiveChatDialogAction:()=>bb,ShowLiveChatTooltipCommand:()=>wb,ShowingResultsFor:()=>Bw,SimpleCardContent:()=>Lw,SimpleCardTeaser:()=>Ow,SimpleMenuHeader:()=>x_,SimpleTextSection:()=>Fw,SingleActionEmergencySupport:()=>Yw,SingleColumnBrowseResults:()=>rg,SingleColumnMusicWatchNextResults:()=>Uw,SingleHeroImage:()=>jw,SlimOwner:()=>Ww,SlimVideoMetadata:()=>Jw,SortFilterHeader:()=>Kh,SortFilterSubMenu:()=>gt,SponsorCommentBadge:()=>uh,StatRow:()=>uv,StructuredDescriptionContent:()=>Qi,StructuredDescriptionPlaylistLockup:()=>jm,SubFeedOption:()=>sg,SubFeedSelector:()=>Hw,SubscribeButton:()=>Se,SubscriptionNotificationToggleButton:()=>zm,Tab:()=>Re,Tabbed:()=>zw,TabbedSearchResults:()=>Gw,TextHeader:()=>$w,ThumbnailBadgeView:()=>th,ThumbnailHoverOverlayView:()=>eh,ThumbnailLandscapePortrait:()=>Kw,ThumbnailOverlayBadgeView:()=>ih,ThumbnailOverlayBottomPanel:()=>Oh,ThumbnailOverlayEndorsement:()=>qw,ThumbnailOverlayHoverText:()=>Xw,ThumbnailOverlayInlineUnplayable:()=>Qw,ThumbnailOverlayLoadingPreview:()=>Zw,ThumbnailOverlayNowPlaying:()=>eT,ThumbnailOverlayPinking:()=>tT,ThumbnailOverlayPlaybackStatus:()=>iT,ThumbnailOverlayResumePlayback:()=>nT,ThumbnailOverlaySidePanel:()=>oT,ThumbnailOverlayTimeStatus:()=>Xi,ThumbnailOverlayToggleButton:()=>rT,ThumbnailView:()=>nh,TimedMarkerDecoration:()=>sT,TitleAndButtonListHeader:()=>aT,ToggleButton:()=>xe,ToggleButtonView:()=>xi,ToggleMenuServiceItem:()=>uT,Tooltip:()=>lT,TopicChannelDetails:()=>cT,Transcript:()=>Pn,TranscriptFooter:()=>om,TranscriptSearchBox:()=>rm,TranscriptSearchPanel:()=>lm,TranscriptSectionHeader:()=>sm,TranscriptSegment:()=>am,TranscriptSegmentList:()=>um,TwoColumnBrowseResults:()=>Rt,TwoColumnSearchResults:()=>ag,TwoColumnWatchNextResults:()=>lg,UniversalWatchCard:()=>cg,UpdateDateTextAction:()=>o_,UpdateDescriptionAction:()=>r_,UpdateEngagementPanelAction:()=>iv,UpdateLiveChatPollAction:()=>Tb,UpdateTitleAction:()=>s_,UpdateToggleButtonTextAction:()=>a_,UpdateViewershipAction:()=>u_,UploadTimeFactoid:()=>Bm,UpsellDialog:()=>pT,VerticalList:()=>dT,VerticalWatchCardList:()=>fT,Video:()=>Mn,VideoAttributeView:()=>li,VideoAttributesSectionView:()=>Jm,VideoCard:()=>Dm,VideoDescriptionCourseSection:()=>Wm,VideoDescriptionHeader:()=>Om,VideoDescriptionInfocardsSection:()=>Fm,VideoDescriptionMusicSection:()=>Ln,VideoDescriptionTranscriptSection:()=>Is,VideoInfoCardContent:()=>mT,VideoOwner:()=>fo,VideoPrimaryInfo:()=>pg,VideoSecondaryInfo:()=>Zd,ViewCountFactoid:()=>Lm,WatchCardCompactVideo:()=>dg,WatchCardHeroVideo:()=>hT,WatchCardRichHeader:()=>_T,WatchCardSectionSequence:()=>gT,WatchNextEndScreen:()=>W_,WatchNextTabbedResults:()=>xT,YpcTrailer:()=>Y_});var Ji,jf=class{constructor(e,i){Ji.set(this,void 0),E(this,Ji,new W.shim.Cache(e,i),"f")}get cache_dir(){return m(this,Ji,"f").cache_dir}get(e){return m(this,Ji,"f").get(e)}set(e,i){return m(this,Ji,"f").set(e,i)}remove(e){return m(this,Ji,"f").remove(e)}};o(jf,"UniversalCache");Ji=new WeakMap;var Q1=jf;var En,Wf=class extends EventTarget{constructor(){super(),En.set(this,new Map)}emit(e,...i){let n=new W.shim.CustomEvent(e,{detail:i});this.dispatchEvent(n)}on(e,i){let n=o(r=>{r instanceof W.shim.CustomEvent?i(...r.detail):i(r)},"wrapper");m(this,En,"f").set(i,n),this.addEventListener(e,n)}once(e,i){let n=o(r=>{r instanceof W.shim.CustomEvent?i(...r.detail):i(r),this.off(e,i)},"wrapper");m(this,En,"f").set(i,n),this.addEventListener(e,n)}off(e,i){let n=m(this,En,"f").get(i);n&&(this.removeEventListener(e,n),m(this,En,"f").delete(i))}};o(Wf,"EventEmitterLike");En=new WeakMap;var Wo=Wf;var zi={};ye(zi,{chooseFormat:()=>ev,download:()=>II,toDash:()=>Z0});var Z1={"&":"&",'"':""","'":"'","<":"<",">":">"};function W0(t){return t.replace(/([&"<>'])/g,(e,i)=>Z1[i])}o(W0,"escapeXMLString");function eI(t){return t==="mpd"?"MPD":t==="base-url"?"BaseURL":t.split("-").map(i=>i.charAt(0).toUpperCase()+i.slice(1)).join("")}o(eI,"normalizeTag");function se(t,e,...i){let n=i.flat().map(r=>typeof r=="string"?tI(r):r);return typeof t=="function"?t(Object.assign(Object.assign({},e),{children:n})):{type:eI(t),props:Object.assign(Object.assign({},e),{children:n})}}o(se,"createElement");function tI(t){return{type:"TEXT_ELEMENT",props:{nodeValue:t}}}o(tI,"createTextElement");function J0(t){return T(this,void 0,void 0,function*(){if(t.type==="TEXT_ELEMENT")return W0(typeof t.props.nodeValue=="string"?t.props.nodeValue:"");let e=`<${t.type}`;if(t.props){let i=Object.keys(t.props).filter(n=>!["children","nodeValue"].includes(n)&&t.props[n]!==void 0).map(n=>`${n}="${W0(`${t.props[n]}`)}"`);i.length>0&&(e+=` ${i.join(" ")}`)}if(t.props.children){let i=yield Promise.all((yield Promise.all(t.props.children.flat())).flat().filter(n=>!!n).map(n=>J0(n)));if(i.length>0)return e+=`>${i.join("")}`,e}return`${e}/>`})}o(J0,"renderElementToString");function H0(t){return T(this,void 0,void 0,function*(){return`${yield J0(yield t)}`})}o(H0,"renderToString");function z0(t){return t.children}o(z0,"Fragment");var Jo=class extends s{constructor(e){super();let i=e.spec.split("|"),n=new URL(i.shift());this.boards=i.map((r,a)=>{let[c,p,d,_,f,x,v,w]=r.split("#");n.searchParams.set("sigh",w);let k=Math.ceil(parseInt(d,10)/(parseInt(_,10)*parseInt(f,10)));return{type:"vod",template_url:n.toString().replace("$L",a).replace("$N",v),thumbnail_width:parseInt(c,10),thumbnail_height:parseInt(p,10),thumbnail_count:parseInt(d,10),interval:parseInt(x,10),columns:parseInt(_,10),rows:parseInt(f,10),storyboard_count:k}})}};o(Jo,"PlayerStoryboardSpec");Jo.type="PlayerStoryboardSpec";var Hi=Jo;var nI="StreamingInfo";function oI(t,e){var i,n,r;let a=new Map,c=t.some(p=>!!p.audio_track);for(let p of t){if((!p.index_range||!p.init_range)&&!p.is_type_otf&&!e)continue;let d=p.mime_type.split(";")[0],_=(i=Fe(p.mime_type,'codecs="','"'))===null||i===void 0?void 0:i.split(".")[0],f=p.color_info?Object.values(p.color_info).join("-"):"",x=((n=p.audio_track)===null||n===void 0?void 0:n.id)||"",v=p.is_drc?"drc":"",w=`${d}-${_}-${f}-${x}-${v}`;a.has(w)||a.set(w,[]),(r=a.get(w))===null||r===void 0||r.push(p)}return{groups:Array.from(a.values()),has_multiple_audio_tracks:c}}o(oI,"getFormatGroupings");function $0(t,e){if(t.length>1&&new Set(t.map(i=>Fe(i.mime_type,'codecs="','"'))).size===1)return e.push("codecs"),Fe(t[0].mime_type,'codecs="','"')}o($0,"hoistCodecsIfPossible");function K0(t,e,i){if(t.length>1&&new Set(t.map(n=>n.fps)).size===1)return i.push(e),Number(t[0][e])}o(K0,"hoistNumberAttributeIfPossible");function rI(t,e){if(t.length>1&&new Set(t.map(i=>i.audio_channels||2)).size===1)return e.push("AudioChannelConfiguration"),t[0].audio_channels}o(rI,"hoistAudioChannelsIfPossible");function sI(t,e){return T(this,void 0,void 0,function*(){var i;let n=yield e.session.http.fetch_function(`${t}&rn=0&sq=0`,{method:"GET",headers:jt,redirect:"follow"}),r=n.url.replace("&rn=0","").replace("&sq=0",""),a=yield n.text(),c=(i=Fe(a,"Segment-Durations-Ms:",`\r -`))===null||i===void 0?void 0:i.split(",");if(!c)throw new b("Failed to extract the segment durations from this OTF stream",{url:t});let p=[];for(let d of c){let _=d.trim();if(_.length===0)continue;let f,x=Fe(_,"(r=",")");x&&(f=parseInt(x)),p.push({duration:parseInt(_),repeat_count:f})}return{init_url:`${r}&sq=0`,media_url:`${r}&sq=$Number$`,timeline:p}})}o(sI,"getOTFSegmentTemplate");function q0(t,e){return T(this,void 0,void 0,function*(){let i=yield e.session.http.fetch_function(`${t}&rn=0&sq=0`,{method:"HEAD",headers:jt,redirect:"follow"}),n=parseInt(i.headers.get("X-Head-Time-Millis")||""),r=parseInt(i.headers.get("X-Head-Seqnum")||"");if(isNaN(n)||isNaN(r))throw new b("Failed to extract the duration or segment count for this Post Live DVR video");return{duration:n/1e3,segment_count:r}})}o(q0,"getPostLiveDvrInfo");function aI(t,e,i,n,r,a){return T(this,void 0,void 0,function*(){if(!t.item){let c=new URL(yield e.decipher(r));c.searchParams.set("cpn",a||"");let p=i(c).toString();t.item=yield q0(p,n)}return t.item.duration})}o(aI,"getPostLiveDvrDuration");function X0(t,e,i,n,r,a){return T(this,void 0,void 0,function*(){let c=new URL(yield t.decipher(n));c.searchParams.set("cpn",r||"");let p=e(c).toString();if(t.is_type_otf){if(!i)throw new b("Unable to get segment durations for this OTF stream without an Actions instance",{format:t});return{is_oft:!0,is_post_live_dvr:!1,getSegmentTemplate(){return sI(p,i)}}}if(a){if(!i)throw new b("Unable to get segment count for this Post Live DVR video without an Actions instance",{format:t});let _=t.target_duration_dec;if(typeof _!="number")throw new b("Format is missing target_duration_dec",{format:t});return{is_oft:!1,is_post_live_dvr:!0,getSegmentTemplate(){return T(this,void 0,void 0,function*(){return a.item||(a.item=yield q0(p,i)),{media_url:`${p}&sq=$Number$`,timeline:[{duration:_*1e3,repeat_count:a.item.segment_count}]}})}}}if(!t.index_range||!t.init_range)throw new b("Index and init ranges not available",{format:t});return{is_oft:!1,is_post_live_dvr:!1,base_url:p,index_range:t.index_range,init_range:t.init_range}})}o(X0,"getSegmentInfo");function uI(t,e,i,n,r,a,c){return T(this,void 0,void 0,function*(){new URL(yield t.decipher(r)).searchParams.set("cpn",a||"");let d=[t.itag.toString()];return t.audio_track&&d.push(t.audio_track.id),t.is_drc&&d.push("drc"),{uid:d.join("-"),bitrate:t.bitrate,codecs:e.includes("codecs")?void 0:Fe(t.mime_type,'codecs="','"'),audio_sample_rate:e.includes("audio_sample_rate")?void 0:t.audio_sample_rate,channels:e.includes("AudioChannelConfiguration")?void 0:t.audio_channels||2,segment_info:yield X0(t,i,n,r,a,c)}})}o(uI,"getAudioRepresentation");function lI(t,e){if(!t.audio_track&&!e)return;let i=[t.is_original?"main":"alternate"];return t.is_dubbed&&i.push("dub"),t.is_descriptive&&i.push("description"),t.is_drc&&i.push("enhanced-audio-intelligibility"),i}o(lI,"getTrackRoles");function cI(t,e,i,n,r,a,c){return T(this,void 0,void 0,function*(){var p;let d=t[0],{audio_track:_}=d,f=[],x=!!c,v;return _?x&&d.is_drc?v=c.label_drc_mutiple(_.display_name):v=_.display_name:x&&(v=d.is_drc?c.label_drc:c.label_original),{mime_type:d.mime_type.split(";")[0],language:(p=d.language)!==null&&p!==void 0?p:void 0,codecs:$0(t,f),audio_sample_rate:K0(t,"audio_sample_rate",f),track_name:v,track_roles:lI(d,x),channels:rI(t,f),representations:yield Promise.all(t.map(k=>uI(k,f,e,i,n,r,a)))}})}o(cI,"getAudioSet");var pI={BT709:"1",BT2020:"9"},G0={BT709:"1",BT2020_10:"14",SMPTEST2084:"16",ARIB_STD_B67:"18"},dI={BT709:"1",BT2020_NCL:"14"};function fI(t){var e;let i=t.color_info,n,r,a;if(i){if(i.primaries&&(n=pI[i.primaries]),i.transfer_characteristics&&(r=G0[i.transfer_characteristics]),i.matrix_coefficients&&(a=dI[i.matrix_coefficients],!a)){let p=new URL(t.url),d=JSON.parse(JSON.stringify(t));d.url="REDACTED",d.signature_cipher="REDACTED",d.cipher="REDACTED",j.warn(nI,`Unknown matrix coefficients "${i.matrix_coefficients}", the DASH manifest is still usuable without this. -Please report it at ${W.shim.info.bugs_url} so we can add support for it. -InnerTube client: ${p.searchParams.get("c")} -format:`,d)}}else!((e=Fe(t.mime_type,'codecs="','"'))===null||e===void 0)&&e.startsWith("avc1")&&(r=G0.BT709);return{primaries:n,transfer_characteristics:r,matrix_coefficients:a}}o(fI,"getColorInfo");function mI(t,e,i,n,r,a,c){return T(this,void 0,void 0,function*(){return{uid:t.itag.toString(),bitrate:t.bitrate,width:t.width,height:t.height,codecs:i.includes("codecs")?void 0:Fe(t.mime_type,'codecs="','"'),fps:i.includes("fps")?void 0:t.fps,segment_info:yield X0(t,e,r,n,a,c)}})}o(mI,"getVideoRepresentation");function hI(t,e,i,n,r,a){return T(this,void 0,void 0,function*(){let c=t[0],p=fI(c),d=[];return{mime_type:c.mime_type.split(";")[0],color_info:p,codecs:$0(t,d),fps:K0(t,"fps",d),representations:yield Promise.all(t.map(f=>mI(f,e,d,i,n,r,a)))}})}o(hI,"getVideoSet");function _I(t){var e;let i=new Map,n=t.is(Hi)?t.boards:[t.board];for(let r of n){let a=new URL(r.template_url).pathname.split(".").pop(),c=`image/${a==="jpg"?"jpeg":a}`;i.has(c)||i.set(c,[]),(e=i.get(c))===null||e===void 0||e.push(r)}return i}o(_I,"getStoryboardInfo");function gI(t,e,i,n,r){return T(this,void 0,void 0,function*(){let a=e.template_url,c=i(new URL(a.replace("$M","0"))),p=r.response?r.response:t.session.http.fetch_function(c,{method:"HEAD",headers:jt});return r.response=p,(yield p).headers.get("Content-Type")||n})}o(gI,"getStoryboardMimeType");function xI(t,e,i){return T(this,void 0,void 0,function*(){let n=e.template_url,r=[],a=Math.min(e.type==="vod"?e.storyboard_count:5,10);for(let _=0;_({probable_mime_type:c,getMimeType(){return gI(e,p[0],n,c,a)},representations:p.map(d=>vI(t,e,d,n,a))}))}o(yI,"getImageSets");function bI(t,e,i){let n=e==="vtt"?"text/vtt":"application/ttml+xml";return t.map(r=>{let a=new URL(r.base_url);a.searchParams.set("fmt",e);let c=["caption"];return a.searchParams.has("tlang")&&c.push("dub"),{mime_type:n,language:r.language_code,track_name:r.name.toString(),track_roles:c,representation:{uid:`text-${r.vss_id}`,base_url:i(a).toString()}}})}o(bI,"getTextSets");function Jf(t){return T(this,arguments,void 0,function*(e,i=!1,n=x=>x,r,a,c,p,d,_,f){if(!e)throw new b("Streaming data not available");let x=r?e.adaptive_formats.filter(G=>!r(G)):e.adaptive_formats,v,w;if(i){if(w={},!p)throw new b("Unable to get duration or segment count for this Post Live DVR video without an Actions instance");v=o(()=>w?aI(w,x[0],n,p,c,a):Promise.resolve(0),"getDuration")}else{let G=x[0].approx_duration_ms/1e3;v=o(()=>Promise.resolve(G),"getDuration")}let{groups:k,has_multiple_audio_tracks:S}=oI(x,i),{video_groups:P,audio_groups:A}=k.reduce((G,Y)=>Y[0].has_audio?(S&&!Y[0].audio_track||G.audio_groups.push(Y),G):(G.video_groups.push(Y),G),{video_groups:[],audio_groups:[]}),M;A.flat().some(G=>G.is_drc)&&(M={label_original:(f==null?void 0:f.label_original)||"Original",label_drc:(f==null?void 0:f.label_drc)||"Stable Volume",label_drc_mutiple:(f==null?void 0:f.label_drc_mutiple)||(G=>`${G} (Stable Volume)`)});let B=yield Promise.all(A.map(G=>cI(G,n,p,c,a,w,M))),$=yield Promise.all(P.map(G=>hI(G,n,c,p,a,w))),te=[];if(d&&p){let G;if(d.is(Hi))G=x[0].approx_duration_ms/1e3;else{let Y=x[0].target_duration_dec;if(typeof Y!="number")throw new b("Format is missing target_duration_dec",{format:x[0]});G=Y}te=yI(G,p,d,n)}let ue=[];if(_&&(f==null?void 0:f.captions_format)){if(f.captions_format!=="vtt"&&f.captions_format!=="ttml")throw new b("Invalid captions format",f.captions_format);ue=bI(_,f.captions_format,n)}return{getDuration:v,audio_sets:B,video_sets:$,image_sets:te,text_sets:ue}})}o(Jf,"getStreamingInfo");function wI(t){return T(this,arguments,void 0,function*({info:e}){if(!e.is_oft&&!e.is_post_live_dvr)return null;let i=yield e.getSegmentTemplate();return se("segment-template",{startNumber:i.init_url?"1":"0",timescale:"1000",initialization:i.init_url,media:i.media_url},se("segment-timeline",null,i.timeline.map(n=>se("s",{d:n.duration,r:n.repeat_count}))))})}o(wI,"OTFPostLiveDvrSegmentInfo");function Q0({info:t}){return t.is_oft||t.is_post_live_dvr?se(wI,{info:t}):se(z0,null,se("base-url",null,t.base_url),se("segment-base",{indexRange:`${t.index_range.start}-${t.index_range.end}`},se("initialization",{range:`${t.init_range.start}-${t.init_range.end}`})))}o(Q0,"SegmentInfo");function TI(t){return T(this,arguments,void 0,function*({streamingData:e,isPostLiveDvr:i,transformURL:n,rejectFormat:r,cpn:a,player:c,actions:p,storyboards:d,captionTracks:_,options:f}){let{getDuration:x,audio_sets:v,video_sets:w,image_sets:k,text_sets:S}=yield Jf(e,i,n,r,a,c,p,d,_,f);return se("mpd",{xmlns:"urn:mpeg:dash:schema:mpd:2011",minBufferTime:"PT1.500S",profiles:"urn:mpeg:dash:profile:isoff-main:2011",type:"static",mediaPresentationDuration:`PT${yield x()}S`,"xmlns:xsi":"http://www.w3.org/2001/XMLSchema-instance","xsi:schemaLocation":"urn:mpeg:dash:schema:mpd:2011 http://standards.iso.org/ittf/PubliclyAvailableStandards/MPEG-DASH_schema_files/DASH-MPD.xsd"},se("period",null,v.map((P,A)=>se("adaptation-set",{id:A,mimeType:P.mime_type,startWithSAP:"1",subsegmentAlignment:"true",lang:P.language,codecs:P.codecs,audioSamplingRate:P.audio_sample_rate,contentType:"audio"},P.track_roles&&P.track_roles.map(M=>se("role",{schemeIdUri:"urn:mpeg:dash:role:2011",value:M})),P.track_name&&se("label",{id:A},P.track_name),P.channels&&se("audio-channel-configuration",{schemeIdUri:"urn:mpeg:dash:23003:3:audio_channel_configuration:2011",value:P.channels}),P.representations.map(M=>se("representation",{id:M.uid,bandwidth:M.bitrate,codecs:M.codecs,audioSamplingRate:M.audio_sample_rate},M.channels&&se("audio-channel-configuration",{schemeIdUri:"urn:mpeg:dash:23003:3:audio_channel_configuration:2011",value:M.channels}),se(Q0,{info:M.segment_info}))))),w.map((P,A)=>se("adaptation-set",{id:A+v.length,mimeType:P.mime_type,startWithSAP:"1",subsegmentAlignment:"true",codecs:P.codecs,maxPlayoutRate:"1",frameRate:P.fps,contentType:"video"},P.color_info.primaries&&se("essential-property",{schemeIdUri:"urn:mpeg:mpegB:cicp:ColourPrimaries",value:P.color_info.primaries}),P.color_info.transfer_characteristics&&se("essential-property",{schemeIdUri:"urn:mpeg:mpegB:cicp:TransferCharacteristics",value:P.color_info.transfer_characteristics}),P.color_info.matrix_coefficients&&se("essential-property",{schemeIdUri:"urn:mpeg:mpegB:cicp:MatrixCoefficients",value:P.color_info.matrix_coefficients}),P.representations.map(M=>se("representation",{id:M.uid,bandwidth:M.bitrate,width:M.width,height:M.height,codecs:M.codecs,frameRate:M.fps},se(Q0,{info:M.segment_info}))))),k.map((P,A)=>T(this,void 0,void 0,function*(){return se("adaptation-set",{id:A+v.length+w.length,mimeType:yield P.getMimeType(),contentType:"image"},P.representations.map(M=>T(this,void 0,void 0,function*(){return se("representation",{id:`thumbnails_${M.thumbnail_width}x${M.thumbnail_height}`,bandwidth:yield M.getBitrate(),width:M.sheet_width,height:M.sheet_height},se("essential-property",{schemeIdUri:"http://dashif.org/thumbnail_tile",value:`${M.columns}x${M.rows}`}),se("segment-template",{media:M.template_url,duration:M.template_duration,startNumber:"0"}))})))})),S.map((P,A)=>se("adaptation-set",{id:A+v.length+w.length+k.length,mimeType:P.mime_type,lang:P.language,contentType:"text"},P.track_roles.map(M=>se("role",{schemeIdUri:"urn:mpeg:dash:role:2011",value:M})),se("label",{id:A+v.length},P.track_name),se("representation",{id:P.representation.uid,bandwidth:"0"},se("base-url",null,P.representation.base_url))))))})}o(TI,"DashManifest");function Z0(t,e=!1,i=f=>f,n,r,a,c,p,d,_){if(!t)throw new b("Streaming data not available");return H0(se(TI,{streamingData:t,isPostLiveDvr:e,transformURL:i,options:_,rejectFormat:n,cpn:r,player:a,actions:c,storyboards:p,captionTracks:d}))}o(Z0,"toDash");function II(t,e,i,n,r,a){return T(this,void 0,void 0,function*(){if((i==null?void 0:i.status)==="UNPLAYABLE")throw new b("Video is unplayable",{error_type:"UNPLAYABLE"});if((i==null?void 0:i.status)==="LOGIN_REQUIRED")throw new b("Video is login required",{error_type:"LOGIN_REQUIRED"});if(!n)throw new b("Streaming data not available.",{error_type:"NO_STREAMING_DATA"});let c=Object.assign({quality:"360p",type:"video+audio",format:"mp4",range:void 0},t),p=ev(c,n),d=yield p.decipher(r);if(c.type==="video+audio"&&!t.range){let S=yield e.session.http.fetch_function(`${d}&cpn=${a}`,{method:"GET",headers:jt,redirect:"follow"});if(!S.ok)throw new b("The server responded with a non 2xx status code",{error_type:"FETCH_FAILED",response:S});let P=S.body;if(!P)throw new b("Could not get ReadableStream from fetch Response.",{error_type:"FETCH_FAILED",response:S});return P}let _=1048576*10,f=t.range?t.range.start:0,x=t.range?t.range.end:_,v=!1,w;return new W.shim.ReadableStream({start(){},pull:S=>T(this,void 0,void 0,function*(){if(v){S.close();return}return(x>=(p.content_length?p.content_length:0)||t.range)&&(v=!0),new Promise((P,A)=>T(this,void 0,void 0,function*(){var M,B,$,te;try{w=new AbortController;let Y=yield e.session.http.fetch_function(`${d}&cpn=${a}&range=${f}-${x||""}`,{method:"GET",headers:Object.assign({},jt),signal:w.signal});if(!Y.ok)throw new b("The server responded with a non 2xx status code",{error_type:"FETCH_FAILED",response:Y});let V=Y.body;if(!V)throw new b("Could not get ReadableStream from fetch Response.",{error_type:"FETCH_FAILED",response:Y});try{for(var ue=!0,pe=Y0(fx(V)),G;G=yield pe.next(),M=G.done,!M;ue=!0){te=G.value,ue=!1;let q=te;S.enqueue(q)}}catch(q){B={error:q}}finally{try{!ue&&!M&&($=pe.return)&&(yield $.call(pe))}finally{if(B)throw B.error}}f=x+1,x+=_,P()}catch(Y){A(Y)}}))}),cancel(S){return T(this,void 0,void 0,function*(){w.abort(S)})}},{highWaterMark:1,size(S){return S.byteLength}})})}o(II,"download");function ev(t,e){if(!e)throw new b("Streaming data not available");let i=[...e.formats||[],...e.adaptive_formats||[]],n=t.type?t.type.includes("audio"):!0,r=t.type?t.type.includes("video"):!0,a=t.language||"original",c=t.quality||"best",p=-1,d=["best","bestefficiency"].includes(c),_=c!=="best",f=i.filter(x=>n&&!x.has_audio||r&&!x.has_video||t.format!=="any"&&!x.mime_type.includes(t.format||"mp4")||!d&&x.quality_label!==c?!1:(x.width&&px.width===p)),n&&!r){let x=f.filter(v=>a!=="original"?!v.has_video&&!v.has_text&&v.language===a:!v.has_video&&!v.has_text&&v.is_original);x.length>0&&(f=x)}return _?f.sort((x,v)=>x.bitrate-v.bitrate):f.sort((x,v)=>v.bitrate-x.bitrate),f[0]}o(ev,"chooseFormat");var mx,ii,hx,Ho,tv,Hf=class{constructor(e,i,n){mx.add(this),ii.set(this,void 0),hx.set(this,void 0),Ho.set(this,void 0),E(this,ii,e,"f"),E(this,hx,i,"f"),E(this,Ho,n||W.shim.fetch,"f")}get fetch_function(){return m(this,Ho,"f")}fetch(e,i){return T(this,arguments,void 0,function*(n,r,a={}){let c=et.API.PRODUCTION_1+m(this,ii,"f").api_version,p=(r==null?void 0:r.baseURL)||c,d=typeof n=="string"?!p.endsWith("/")&&!n.startsWith("/")?new URL(`${p}/${n}`):new URL(p+n):n instanceof URL?n:new URL(n.url,p),_=(r==null?void 0:r.headers)||(n instanceof W.shim.Request?n.headers:new W.shim.Headers)||new W.shim.Headers,f=(r==null?void 0:r.body)||(n instanceof W.shim.Request?n.body:void 0),x=new W.shim.Headers(_);x.set("Accept","*/*"),x.set("Accept-Language","*"),x.set("X-Goog-Visitor-Id",(a==null?void 0:a.visitor_data)||m(this,ii,"f").context.client.visitorData||""),x.set("X-Youtube-Client-Version",m(this,ii,"f").context.client.clientVersion||"");let v=Object.values(re).find(M=>M.NAME===m(this,ii,"f").context.client.clientName);v&&x.set("X-Youtube-Client-Name",v.NAME_ID),W.shim.server&&(x.set("User-Agent",Gi("desktop")),x.set("Origin",d.origin)),d.searchParams.set("prettyPrint","false"),d.searchParams.set("alt","json");let w=x.get("Content-Type"),k=f,S=p===c||p===et.YT_UPLOAD;if(w==="application/json"&&S&&typeof f=="string"){let M=JSON.parse(f),B=Object.assign(Object.assign({},M),{context:JSON.parse(JSON.stringify(m(this,ii,"f").context))});m(this,mx,"m",tv).call(this,B.context,B.client),x.set("X-Youtube-Client-Version",B.context.client.clientVersion);let $=Object.values(re).find(te=>te.NAME===B.context.client.clientName);$&&x.set("X-Youtube-Client-Name",$.NAME_ID),delete B.client,B.context.client.clientName==="ANDROID"||B.context.client.clientName==="ANDROID_MUSIC"?(x.set("User-Agent",re.ANDROID.USER_AGENT),x.set("X-GOOG-API-FORMAT-VERSION","2")):B.context.client.clientName==="iOS"&&x.set("User-Agent",re.IOS.USER_AGENT),k=JSON.stringify(B)}else w==="application/x-protobuf"&&W.shim.server&&(x.set("User-Agent",re.ANDROID.USER_AGENT),x.set("X-GOOG-API-FORMAT-VERSION","2"),x.delete("X-Youtube-Client-Version"));let P=new W.shim.Request(d,n instanceof W.shim.Request?n:r),A=yield m(this,Ho,"f").call(this,P,Object.assign({body:k,headers:x,redirect:n instanceof W.shim.Request?n.redirect:(r==null?void 0:r.redirect)||"follow"},W.shim.runtime!=="cf-worker"?{credentials:"include"}:{}));if(A.ok)return A;throw new b(`Request to ${A.url} failed with status ${A.status}`,yield A.text())})}};o(Hf,"HTTPClient");ii=new WeakMap,hx=new WeakMap,Ho=new WeakMap,mx=new WeakSet,tv=o(function(e,i){if(!!i){if(!Uf.includes(i.toUpperCase()))throw new b(`Invalid client: ${i}`,{available_innertube_clients:Uf});switch((i==="ANDROID"||i==="YTMUSIC_ANDROID"||i==="YTMUSIC_ANDROID"||i==="YTSTUDIO_ANDROID")&&(e.client.androidSdkVersion=re.ANDROID.SDK_VERSION,e.client.userAgent=re.ANDROID.USER_AGENT,e.client.osName="Android",e.client.osVersion="13",e.client.platform="MOBILE"),i.toUpperCase()){case"IOS":e.client.deviceMake="Apple",e.client.deviceModel=re.IOS.DEVICE_MODEL,e.client.clientVersion=re.IOS.VERSION,e.client.clientName=re.IOS.NAME,e.client.platform="MOBILE",e.client.osName="iOS",delete e.client.browserName,delete e.client.browserVersion;break;case"YTMUSIC":e.client.clientVersion=re.YTMUSIC.VERSION,e.client.clientName=re.YTMUSIC.NAME;break;case"ANDROID":e.client.clientVersion=re.ANDROID.VERSION,e.client.clientFormFactor="SMALL_FORM_FACTOR",e.client.clientName=re.ANDROID.NAME;break;case"YTMUSIC_ANDROID":e.client.clientVersion=re.YTMUSIC_ANDROID.VERSION,e.client.clientFormFactor="SMALL_FORM_FACTOR",e.client.clientName=re.YTMUSIC_ANDROID.NAME;break;case"YTSTUDIO_ANDROID":e.client.clientVersion=re.YTSTUDIO_ANDROID.VERSION,e.client.clientFormFactor="SMALL_FORM_FACTOR",e.client.clientName=re.YTSTUDIO_ANDROID.NAME;break;case"TV_EMBEDDED":e.client.clientName=re.TV_EMBEDDED.NAME,e.client.clientVersion=re.TV_EMBEDDED.VERSION,e.client.clientScreen="EMBED",e.thirdParty={embedUrl:et.YT_BASE};break;case"YTKIDS":e.client.clientVersion=re.WEB_KIDS.VERSION,e.client.clientName=re.WEB_KIDS.NAME,e.client.kidsAppInfo={categorySettings:{enabledCategories:["approved_for_you","black_joy","camp","collections","earth","explore","favorites","gaming","halloween","hero","learning","move","music","reading","shared_by_parents","shows","soccer","sports","spotlight","winter"]},contentSettings:{corpusPreference:"KIDS_CORPUS_PREFERENCE_YOUNGER",kidsNoSearchMode:"YT_KIDS_NO_SEARCH_MODE_OFF"}};break;default:break}}},"_HTTPClient_adjustContext");var _x=Hf;var _t={};ye(_t,{compress:()=>kI,decompress:()=>SI});function kI(t){let e=[],i={};for(let a=0;a<256;a++)i[String.fromCharCode(a)]=a;let n="",r=256;for(let a=0;aString.fromCharCode(a)).join("")}o(kI,"compress");function SI(t){let e={},i=t.split(""),n=[i.shift()],r=i.length>>>0,a=256,c=n[0],p=c;for(let d=0;d=4&&e&1<x.endsWith("Endpoint")||x.endsWith("Command"));this.payload=f?Reflect.get(e,f):{},(Reflect.has(this.payload,"dialog")||Reflect.has(this.payload,"content"))&&(this.dialog=l.parseItem(this.payload.dialog||this.payload.content)),Reflect.has(this.payload,"modal")&&(this.modal=l.parseItem(this.payload.modal)),Reflect.has(this.payload,"nextEndpoint")&&(this.next_endpoint=new $i(this.payload.nextEndpoint)),e!=null&&e.serviceEndpoint&&(e=e.serviceEndpoint),this.metadata={},!((n=(i=e==null?void 0:e.commandMetadata)===null||i===void 0?void 0:i.webCommandMetadata)===null||n===void 0)&&n.url&&(this.metadata.url=e.commandMetadata.webCommandMetadata.url),!((a=(r=e==null?void 0:e.commandMetadata)===null||r===void 0?void 0:r.webCommandMetadata)===null||a===void 0)&&a.webPageType&&(this.metadata.page_type=e.commandMetadata.webCommandMetadata.webPageType),!((p=(c=e==null?void 0:e.commandMetadata)===null||c===void 0?void 0:c.webCommandMetadata)===null||p===void 0)&&p.apiUrl?this.metadata.api_url=e.commandMetadata.webCommandMetadata.apiUrl.replace("/youtubei/v1/",""):f&&(this.metadata.api_url=this.getEndpoint(f)),!((_=(d=e==null?void 0:e.commandMetadata)===null||d===void 0?void 0:d.webCommandMetadata)===null||_===void 0)&&_.sendPost&&(this.metadata.send_post=e.commandMetadata.webCommandMetadata.sendPost),e!=null&&e.createPlaylistEndpoint&&e!=null&&e.createPlaylistEndpoint.createPlaylistDialog&&(this.dialog=l.parseItem(e==null?void 0:e.createPlaylistEndpoint.createPlaylistDialog,Gf))}getEndpoint(e){switch(e){case"browseEndpoint":return"/browse";case"watchEndpoint":case"reelWatchEndpoint":return"/player";case"searchEndpoint":return"/search";case"watchPlaylistEndpoint":return"/next";case"liveChatItemContextMenuEndpoint":return"/live_chat/get_item_context_menu"}}call(e,i){if(!e)throw new Error("An active caller must be provided");if(!this.metadata.api_url)throw new Error("Expected an api_url, but none was found, this is a bug.");return e.execute(this.metadata.api_url,Object.assign(Object.assign({},this.payload),i))}toURL(){if(!!this.metadata.url&&!!this.metadata.page_type)return this.metadata.page_type==="WEB_PAGE_TYPE_UNKNOWN"?this.metadata.url:`https://www.youtube.com${this.metadata.url}`}};o($i,"NavigationEndpoint");$i.type="NavigationEndpoint";var g=$i;var y=class{constructor(e){this.url=e.url,this.width=e.width,this.height=e.height}static fromResponse(e){if(!e)return[];let i;return e.thumbnails?i=e.thumbnails:e.sources&&(i=e.sources),i?i.map(n=>new y(n)).sort((n,r)=>r.width-n.width):[]}};o(y,"Thumbnail");var oi=class{constructor(e){var i,n,r,a,c,p;this.text=((i=e.emoji)===null||i===void 0?void 0:i.emojiId)||((r=(n=e.emoji)===null||n===void 0?void 0:n.shortcuts)===null||r===void 0?void 0:r[0])||e.text||"",this.emoji={emoji_id:e.emoji.emojiId,shortcuts:((a=e.emoji)===null||a===void 0?void 0:a.shortcuts)||[],search_terms:((c=e.emoji)===null||c===void 0?void 0:c.searchTerms)||[],image:y.fromResponse(e.emoji.image),is_custom:!!(!((p=e.emoji)===null||p===void 0)&&p.isCustomEmoji)}}toString(){return this.text}toHTML(){let e=Kf(this.text);return`${e}`}};o(oi,"EmojiRun");var ri=class{constructor(e){this.text=e.text,this.bold=Boolean(e.bold),this.italics=Boolean(e.italics),this.strikethrough=Boolean(e.strikethrough),Reflect.has(e,"navigationEndpoint")&&(this.endpoint=new g(e.navigationEndpoint)),this.attachment=e.attachment}toString(){return this.text}toHTML(){let e=[];this.bold&&e.push("b"),this.italics&&e.push("i"),this.strikethrough&&e.push("s");let i=Kf(this.text),r=`${e.map(a=>`<${a}>`).join("")+i+e.map(a=>``).join("")}`;if(this.attachment&&this.attachment.element.type.imageType.image.sources.length){let{url:a}=this.attachment.element.type.imageType.image.sources[0];if(this.endpoint){let c=this.endpoint.toURL();if(c)return`${r}`}}if(this.endpoint){let a=this.endpoint.toURL();if(a)return`${r}`}return r}};o(ri,"TextRun");function Kf(t){return t.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}o(Kf,"escape");var Zo="Text",u=class{constructor(e){var i,n,r,a;typeof e=="object"&&e!==null&&Reflect.has(e,"runs")&&Array.isArray(e.runs)?(this.runs=e.runs.map(c=>c.emoji?new oi(c):new ri(c)),this.text=this.runs.map(c=>c.text).join("")):this.text=e==null?void 0:e.simpleText,typeof e=="object"&&e!==null&&Reflect.has(e,"navigationEndpoint")&&(this.endpoint=new g(e.navigationEndpoint)),typeof e=="object"&&e!==null&&Reflect.has(e,"titleNavigationEndpoint")&&(this.endpoint=new g(e.titleNavigationEndpoint)),this.endpoint||!((n=(i=this.runs)===null||i===void 0?void 0:i[0])===null||n===void 0)&&n.endpoint&&(this.endpoint=(a=(r=this.runs)===null||r===void 0?void 0:r[0])===null||a===void 0?void 0:a.endpoint)}static fromAttributed(e){var i,n,r;let{content:a,styleRuns:c,commandRuns:p,attachmentRuns:d}=e,_=[{text:a,startIndex:0}];if(c||p||d){if(c)for(let f of c)if(f.italic||f.strikethrough==="LINE_STYLE_SINGLE"||f.weightLabel==="FONT_WEIGHT_MEDIUM"||f.weightLabel==="FONT_WEIGHT_BOLD"){let x=gx(_,f);if(!x){j.warn(Zo,"Unable to find matching run for style run. Skipping...",{style_run:f,input_data:e,parsed_runs:JSON.parse(JSON.stringify(_))});continue}qf(_,x,f,{bold:f.weightLabel==="FONT_WEIGHT_MEDIUM"||f.weightLabel==="FONT_WEIGHT_BOLD",italics:f.italic,strikethrough:f.strikethrough==="LINE_STYLE_SINGLE"})}else j.debug(Zo,"Skipping style run as it is doesn't have any information that we parse.",{style_run:f,input_data:e});if(p)for(let f of p)if(f.onTap){let x=gx(_,f);if(!x){j.warn(Zo,"Unable to find matching run for command run. Skipping...",{command_run:f,input_data:e,parsed_runs:JSON.parse(JSON.stringify(_))});continue}qf(_,x,f,{navigationEndpoint:f.onTap})}else j.debug(Zo,'Skipping command run as it is missing the "doTap" property.',{command_run:f,input_data:e});if(d)for(let f of d){let x=gx(_,f);if(!x){j.warn(Zo,"Unable to find matching run for attachment run. Skipping...",{attachment_run:f,input_data:e,parsed_runs:JSON.parse(JSON.stringify(_))});continue}if(f.length===0)x.attachment=f;else{let v=f.startIndex-x.startIndex,w=x.text.substring(v,v+f.length),k=/^:[^:]+:$/.test(w);if(((r=(n=(i=f.element)===null||i===void 0?void 0:i.type)===null||n===void 0?void 0:n.imageType)===null||r===void 0?void 0:r.image)&&(k||new RegExp("^(?:\\p{Emoji}|\\u200d)+$","u").test(w))){let S={image:f.element.type.imageType.image,isCustomEmoji:k,shortcuts:k?[w]:void 0};qf(_,x,f,{emoji:S})}else qf(_,x,f,{attachment:f})}}}return new u({runs:_})}toHTML(){return this.runs?this.runs.map(e=>e.toHTML()).join(""):this.text}isEmpty(){return this.text===void 0}toString(){return this.text||"N/A"}};o(u,"Text");function gx(t,e){return t.find(i=>i.startIndex<=e.startIndex&&e.startIndex+e.length<=i.startIndex+i.text.length)}o(gx,"findMatchingRun");function qf(t,e,i,n){let r=t.indexOf(e),a=[],c=i.startIndex-e.startIndex;i.startIndex>e.startIndex&&a.push(Object.assign(Object.assign({},e),{text:e.text.substring(0,c)})),a.push(Object.assign(Object.assign(Object.assign({},e),{text:e.text.substring(c,c+i.length),startIndex:i.startIndex}),n)),i.startIndex+i.lengthnew rr(i.accountItem))),this.header=l.parseItem(e.header,tm)}};o(sr,"AccountItemSection");sr.type="AccountItemSection";var im=sr;var ar=class extends s{constructor(e){super(),this.contents=l.parseItem(e.contents[0],im),this.footers=l.parseItem(e.footers[0],em)}};o(ar,"AccountSectionList");ar.type="AccountSectionList";var nm=ar;var ur=class extends s{constructor(e){super(),this.contents=l.parseArray(e.continuationItems),this.target=e.target}};o(ur,"AppendContinuationItemsAction");ur.type="AppendContinuationItemsAction";var Ki=ur;var lr=class extends s{constructor(e){super(),Reflect.has(e,"title")&&(this.title=e.title),Reflect.has(e,"icon")&&(this.icon_type=e.icon.iconType),Reflect.has(e,"accessibility")&&(this.label=e.accessibility.accessibilityData.label),Reflect.has(e,"tooltip")&&(this.tooltip=e.tooltip),Reflect.has(e,"subMenuItems")&&(this.sub_menu_items=e.subMenuItems.map(i=>{var n,r;return{title:i.title,selected:i.selected,continuation:(r=(n=i.continuation)===null||n===void 0?void 0:n.reloadContinuationData)===null||r===void 0?void 0:r.continuation,endpoint:new g(i.serviceEndpoint||i.navigationEndpoint),subtitle:i.subtitle||null}}))}};o(lr,"SortFilterSubMenu");lr.type="SortFilterSubMenu";var gt=lr;var cr=class extends s{constructor(e){super(),this.language_menu=l.parseItem(e.languageMenu,gt)}};o(cr,"TranscriptFooter");cr.type="TranscriptFooter";var om=cr;var pr=class extends s{constructor(e){super(),this.formatted_placeholder=new u(e.formattedPlaceholder),this.clear_button=l.parseItem(e.clearButton,I),this.endpoint=new g(e.onTextChangeCommand),this.search_button=l.parseItem(e.searchButton,I)}};o(pr,"TranscriptSearchBox");pr.type="TranscriptSearchBox";var rm=pr;var dr=class extends s{constructor(e){super(),this.start_ms=e.startMs,this.end_ms=e.endMs,this.snippet=new u(e.snippet)}};o(dr,"TranscriptSectionHeader");dr.type="TranscriptSectionHeader";var sm=dr;var fr=class extends s{constructor(e){super(),this.start_ms=e.startMs,this.end_ms=e.endMs,this.snippet=new u(e.snippet),this.start_time_text=new u(e.startTimeText),this.target_id=e.targetId}};o(fr,"TranscriptSegment");fr.type="TranscriptSegment";var am=fr;var mr=class extends s{constructor(e){super(),this.initial_segments=l.parseArray(e.initialSegments,[am,sm]),this.no_result_label=new u(e.noResultLabel),this.retry_label=new u(e.retryLabel),this.touch_captions_enabled=e.touchCaptionsEnabled}};o(mr,"TranscriptSegmentList");mr.type="TranscriptSegmentList";var um=mr;var hr=class extends s{constructor(e){super(),this.header=l.parseItem(e.header,rm),this.body=l.parseItem(e.body,um),this.footer=l.parseItem(e.footer,om),this.target_id=e.targetId}};o(hr,"TranscriptSearchPanel");hr.type="TranscriptSearchPanel";var lm=hr;var _r=class extends s{constructor(e){super(),this.content=l.parseItem(e.content,lm)}};o(_r,"Transcript");_r.type="Transcript";var Pn=_r;var gr=class extends s{constructor(e){super(),this.target_id=e.targetId,this.content=l.parseItem(e.content,Pn)}};o(gr,"UpdateEngagementPanelAction");gr.type="UpdateEngagementPanelAction";var iv=gr;var xr=class extends s{constructor(e){super(),this.text=new u(e.text),this.alert_type=e.type}};o(xr,"Alert");xr.type="Alert";var Nn=xr;var vr=class extends s{constructor(e){super(),this.text=new u(e.text),this.alert_type=e.type,this.dismiss_button=l.parseItem(e.dismissButton,I)}};o(vr,"AlertWithButton");vr.type="AlertWithButton";var cm=vr;var yr=class extends s{constructor(e){super(),this.title=e.title,this.subtitle=e.subtitle,this.metric_value=e.metricValue,this.comparison_indicator=e.comparisonIndicator;let i=e.seriesConfiguration.lineSeries;this.series_configuration={line_series:{lines_data:{x:i.linesData[0].x,y:i.linesData[0].y,style:{line_width:i.linesData[0].style.lineWidth,line_color:i.linesData[0].style.lineColor}},domain_axis:{tick_values:i.domainAxis.tickValues,custom_formatter:i.domainAxis.customFormatter},measure_axis:{tick_values:i.measureAxis.tickValues,custom_formatter:i.measureAxis.customFormatter}}}}};o(yr,"DataModelSection");yr.type="DataModelSection";var pm=yr;var br=class extends s{constructor(e){super(),this.period=e.cardData.periodLabel;let i=e.cardData.sections[0].analyticsKeyMetricsData;this.sections=i.dataModel.sections.map(n=>new pm(n))}};o(br,"AnalyticsMainAppKeyMetrics");br.type="AnalyticsMainAppKeyMetrics";var nv=br;var wr=class extends s{constructor(e){super();let i=e.analyticsTableCarouselData.data.tableCards;this.title=e.analyticsTableCarouselData.carouselTitle,this.selected_card_index_key=e.analyticsTableCarouselData.selectedCardIndexKey,this.table_cards=i.map(n=>({title:n.cardData.title,rows:n.cardData.rows.map(r=>({label:r.label,display_value:r.displayValue,display_value_a11y:r.displayValueA11y,bar_ratio:r.barRatio,bar_color:r.barColor,bar_opacity:r.barOpacity}))})),this.use_main_app_specs=e.analyticsTableCarouselData.useMainAppSpecs}};o(wr,"AnalyticsRoot");wr.type="AnalyticsRoot";var ov=wr;var Tr=class extends s{constructor(e){super(),this.title=e.title,this.shorts=e.shortsCarouselData.shorts.map(i=>({description:i.shortsDescription,thumbnail_url:i.thumbnailUrl,endpoint:new g(i.videoEndpoint)}))}};o(Tr,"AnalyticsShortsCarouselCard");Tr.type="AnalyticsShortsCarouselCard";var rv=Tr;var Ir=class extends s{constructor(e){super(),this.title=e.videoTitle,this.metadata={views:e.videoDescription.split("\xB7")[0].trim(),published:e.videoDescription.split("\xB7")[1].trim(),thumbnails:y.fromResponse(e.thumbnailDetails),duration:e.formattedLength,is_short:e.isShort}}};o(Ir,"AnalyticsVideo");Ir.type="AnalyticsVideo";var dm=Ir;var kr=class extends s{constructor(e){super(),this.title=e.title,Reflect.has(e,"noDataMessage")&&(this.no_data_message=e.noDataMessage),Reflect.has(e,"videoCarouselData")&&Reflect.has(e.videoCarouselData,"videos")&&(this.videos=e.videoCarouselData.videos.map(i=>new dm(i)))}};o(kr,"AnalyticsVodCarouselCard");kr.type="AnalyticsVodCarouselCard";var sv=kr;var Sr=class extends s{constructor(e){super(),this.title=e.buttonLabel,this.use_new_specs=e.useNewSpecs}};o(Sr,"CtaGoToCreatorStudio");Sr.type="CtaGoToCreatorStudio";var av=Sr;var Cr=class extends s{constructor(e){super(),this.title=new u(e.title),this.contents=new u(e.contents)}};o(Cr,"StatRow");Cr.type="StatRow";var uv=Cr;var Er=class extends s{constructor(e){super(),this.text=u.fromAttributed(e.text),this.suffix=u.fromAttributed(e.suffix)}};o(Er,"AttributionView");Er.type="AttributionView";var fm=Er;var Pr=class extends s{constructor(e){super(),this.audio_only_availability=e.audioOnlyAvailability}};o(Pr,"AudioOnlyPlayability");Pr.type="AudioOnlyPlayability";var mm=Pr;var Nr=class extends s{constructor(e){var i,n;super(),!((n=(i=e==null?void 0:e.content)===null||i===void 0?void 0:i.automixPlaylistVideoRenderer)===null||n===void 0)&&n.navigationEndpoint&&(this.playlist_video={endpoint:new g(e.content.automixPlaylistVideoRenderer.navigationEndpoint)})}};o(Nr,"AutomixPreviewVideo");Nr.type="AutomixPreviewVideo";var hm=Nr;var Rr=class extends s{constructor(e){super(),this.image=y.fromResponse(e.image),this.image_processor={border_image_processor:{circular:e.image.processor.borderImageProcessor.circular}},this.avatar_image_size=e.avatarImageSize}};o(Rr,"AvatarView");Rr.type="AvatarView";var _m=Rr;var Ar=class extends s{constructor(e){super(),this.image=y.fromResponse(e.image),this.endpoint=new g(e.command)}};o(Ar,"BackstageImage");Ar.type="BackstageImage";var gm=Ar;var Vr=class extends s{constructor(e){var i,n,r,a,c,p,d,_,f;super(),this.text=new u(e.defaultText),this.toggled_text=new u(e.toggledText),this.tooltip=e.defaultTooltip,this.toggled_tooltip=e.toggledTooltip,this.is_toggled=e.isToggled,this.is_disabled=e.isDisabled,this.icon_type=(i=e.defaultIcon)===null||i===void 0?void 0:i.iconType;let x=((a=(r=(n=e==null?void 0:e.defaultText)===null||n===void 0?void 0:n.accessibility)===null||r===void 0?void 0:r.accessibilityData)===null||a===void 0?void 0:a.label)||((p=(c=e==null?void 0:e.accessibilityData)===null||c===void 0?void 0:c.accessibilityData)===null||p===void 0?void 0:p.label)||((d=e==null?void 0:e.accessibility)===null||d===void 0?void 0:d.label);this.icon_type=="LIKE"&&(this.like_count=parseInt(x.replace(/\D/g,"")),this.short_like_count=new u(e.defaultText).toString()),this.endpoint=!((f=(_=e.defaultServiceEndpoint)===null||_===void 0?void 0:_.commandExecutorCommand)===null||f===void 0)&&f.commands?new g(e.defaultServiceEndpoint.commandExecutorCommand.commands.pop()):new g(e.defaultServiceEndpoint),this.toggled_endpoint=new g(e.toggledServiceEndpoint),Reflect.has(e,"toggleButtonSupportedData")&&Reflect.has(e.toggleButtonSupportedData,"toggleButtonIdData")&&(this.button_id=e.toggleButtonSupportedData.toggleButtonIdData.id),Reflect.has(e,"targetId")&&(this.target_id=e.targetId)}};o(Vr,"ToggleButton");Vr.type="ToggleButton";var xe=Vr;var Mr=class extends s{constructor(e){var i,n;super(),this.creator_thumbnail=y.fromResponse(e.creatorThumbnail),Reflect.has(e,"heartIcon")&&Reflect.has(e.heartIcon,"iconType")&&(this.heart_icon_type=e.heartIcon.iconType),this.heart_color={basic_color_palette_data:{foreground_title_color:(n=(i=e.heartColor)===null||i===void 0?void 0:i.basicColorPaletteData)===null||n===void 0?void 0:n.foregroundTitleColor}},this.hearted_tooltip=e.heartedTooltip,this.is_hearted=e.isHearted,this.is_enabled=e.isEnabled,this.kennedy_heart_color_string=e.kennedyHeartColorString}};o(Mr,"CreatorHeart");Mr.type="CreatorHeart";var xm=Mr;var Dr=class extends s{constructor(e){super(),this.like_button=l.parseItem(e.likeButton,xe),this.dislike_button=l.parseItem(e.dislikeButton,xe),this.reply_button=l.parseItem(e.replyButton,I),this.creator_heart=l.parseItem(e.creatorHeart,xm)}};o(Dr,"CommentActionButtons");Dr.type="CommentActionButtons";var Rn=Dr;var Br=class extends s{constructor(e){super(),this.items=l.parseArray(e.items),this.top_level_buttons=l.parseArray(e.topLevelButtons),Reflect.has(e,"accessibility")&&Reflect.has(e.accessibility,"accessibilityData")&&(this.label=e.accessibility.accessibilityData.label)}get contents(){return this.items}};o(Br,"Menu");Br.type="Menu";var F=Br;var Lr=class extends s{constructor(e){super(),this.id=e.postId,this.author=new D(Object.assign(Object.assign({},e.authorText),{navigationEndpoint:e.authorEndpoint}),null,e.authorThumbnail),this.content=new u(e.contentText),this.published=new u(e.publishedTimeText),Reflect.has(e,"pollStatus")&&(this.poll_status=e.pollStatus),Reflect.has(e,"voteStatus")&&(this.vote_status=e.voteStatus),Reflect.has(e,"voteCount")&&(this.vote_count=new u(e.voteCount)),Reflect.has(e,"actionMenu")&&(this.menu=l.parseItem(e.actionMenu,F)),Reflect.has(e,"actionButtons")&&(this.action_buttons=l.parseItem(e.actionButtons,Rn)),Reflect.has(e,"voteButton")&&(this.vote_button=l.parseItem(e.voteButton,I)),Reflect.has(e,"navigationEndpoint")&&(this.endpoint=new g(e.navigationEndpoint)),Reflect.has(e,"backstageAttachment")&&(this.attachment=l.parseItem(e.backstageAttachment)),this.surface=e.surface}};o(Lr,"BackstagePost");Lr.type="BackstagePost";var si=Lr;var Or=class extends s{constructor(e){super(),this.post=l.parseItem(e.post)}};o(Or,"BackstagePostThread");Or.type="BackstagePostThread";var lv=Or;var ai=class extends s{constructor(e){super(),this.text=e.badgeText,this.style=e.badgeStyle,this.accessibility_label=e.accessibilityLabel}};o(ai,"BadgeView");var Fr=class extends s{constructor(e){super(),this.contents=l.parseArray(e.contents)}};o(Fr,"BrowseFeedActions");Fr.type="BrowseFeedActions";var vm=Fr;var Yr=class extends s{constructor(e){super(),this.album=new u(e.album),this.thumbnails=y.fromResponse(e.thumbnailDetails)}};o(Yr,"BrowserMediaSession");Yr.type="BrowserMediaSession";var cv=Yr;var Ur=class extends s{constructor(e){super(),this.icon_name=e.iconName,this.title=e.title,this.accessibility_text=e.accessibilityText,this.style=e.style,this.is_full_width=e.isFullWidth,this.button_type=e.type,this.button_size=e.buttonSize,this.on_tap=new g(e.onTap)}};o(Ur,"ButtonView");Ur.type="ButtonView";var St=Ur;var An=class extends s{constructor(e){super(),this.endpoint=new g(e.navigationEndpoint),this.icon=y.fromResponse(e.icon),this.title=new u(e.title)}};o(An,"HeaderLink");An.type="HeaderLink";var jr=class extends s{constructor(e){var i,n;super(),this.primary=X(((i=e.primaryLinks)===null||i===void 0?void 0:i.map(r=>new An(r)))||[]),this.secondary=X(((n=e.secondaryLinks)===null||n===void 0?void 0:n.map(r=>new An(r)))||[])}};o(jr,"ChannelHeaderLinks");jr.type="ChannelHeaderLinks";var ym=jr;var Wr=class extends s{constructor(e){super(),Reflect.has(e,"firstLink")&&(this.first_link=u.fromAttributed(e.firstLink)),Reflect.has(e,"more")&&(this.more=u.fromAttributed(e.more))}};o(Wr,"ChannelHeaderLinksView");Wr.type="ChannelHeaderLinksView";var bm=Wr;var Jr=class extends s{constructor(e){super(),this.placeholder_text=new u(e.placeholderText),this.max_character_limit=e.maxCharacterLimit}};o(Jr,"ClipCreationTextInput");Jr.type="ClipCreationTextInput";var wm=Jr;var Hr=class extends s{constructor(e){var i,n,r,a,c,p;super(),this.length_template=e.lengthTemplate,this.max_length_ms=e.maxLengthMs,this.min_length_ms=e.minLengthMs,this.default_length_ms=e.defaultLengthMs,this.window_size_ms=e.windowSizeMs,this.start_label=(n=(i=e.startAccessibility)===null||i===void 0?void 0:i.accessibilityData)===null||n===void 0?void 0:n.label,this.end_label=(a=(r=e.endAccessibility)===null||r===void 0?void 0:r.accessibilityData)===null||a===void 0?void 0:a.label,this.duration_label=(p=(c=e.durationAccessibility)===null||c===void 0?void 0:c.accessibilityData)===null||p===void 0?void 0:p.label}};o(Hr,"ClipCreationScrubber");Hr.type="ClipCreationScrubber";var Tm=Hr;var zr=class extends s{constructor(e){super(),this.title=new u(e.title),this.body=new u(e.body)}};o(zr,"ClipAdState");zr.type="ClipAdState";var Im=zr;var Gr=class extends s{constructor(e){super(),this.user_avatar=y.fromResponse(e.userAvatar),this.title_input=l.parseItem(e.titleInput,[wm]),this.scrubber=l.parseItem(e.scrubber,[Tm]),this.save_button=l.parseItem(e.saveButton,[I]),this.display_name=new u(e.displayName),this.publicity_label=e.publicityLabel,this.cancel_button=l.parseItem(e.cancelButton,[I]),this.ad_state_overlay=l.parseItem(e.adStateOverlay,[Im]),this.external_video_id=e.externalVideoId,this.publicity_label_icon=e.publicityLabelIcon}};o(Gr,"ClipCreation");Gr.type="ClipCreation";var km=Gr;var $r=class extends s{constructor(e){super(),this.contents=l.parse(e.contents,!0,[km])}};o($r,"ClipSection");$r.type="ClipSection";var Sm=$r;var Kr=class extends s{constructor(e){super(),this.trigger=e.trigger,Reflect.has(e,"button")&&(this.button=l.parseItem(e.button,I)),this.endpoint=new g(e.continuationEndpoint)}};o(Kr,"ContinuationItem");Kr.type="ContinuationItem";var ce=Kr;var qr=class extends s{constructor(e){super(),this.title=new u(e.title),this.visibility_button=l.parseItem(e.visibilityButton,I)}};o(qr,"EngagementPanelTitleHeader");qr.type="EngagementPanelTitleHeader";var Cm=qr;var Xr=class extends s{constructor(e){super(),this.info_text=new u(e.infoText),this.menu=l.parseItem(e.menu,F)}};o(Xr,"MacroMarkersInfoItem");Xr.type="MacroMarkersInfoItem";var Em=Xr;var Qr=class extends s{constructor(e){super(),this.title=new u(e.title),this.time_description=new u(e.timeDescription),this.thumbnail=y.fromResponse(e.thumbnail),this.on_tap_endpoint=new g(e.onTap),this.layout=e.layout,this.is_highlighted=!!e.isHighlighted}};o(Qr,"MacroMarkersListItem");Qr.type="MacroMarkersListItem";var Vn=Qr;var Zr=class extends s{constructor(e){super(),this.contents=l.parseArray(e.contents,[Em,Vn]),this.sync_button_label=new u(e.syncButtonLabel)}};o(Zr,"MacroMarkersList");Zr.type="MacroMarkersList";var Pm=Zr;var es=class extends s{constructor(e){super(),this.contents=l.parseArray(e.contents)}};o(es,"ProductList");es.type="ProductList";var Nm=es;var ts=class extends s{constructor(e){super(),this.contents=l.parseArray(e.contents),Reflect.has(e,"targetId")&&(this.target_id=e.targetId),Reflect.has(e,"continuations")&&(Reflect.has(e.continuations[0],"nextContinuationData")?this.continuation=e.continuations[0].nextContinuationData.continuation:Reflect.has(e.continuations[0],"reloadContinuationData")&&(this.continuation=e.continuations[0].reloadContinuationData.continuation)),Reflect.has(e,"header")&&(this.header=l.parseItem(e.header)),Reflect.has(e,"subMenu")&&(this.sub_menu=l.parseItem(e.subMenu))}};o(ts,"SectionList");ts.type="SectionList";var ve=ts;var is=class extends s{constructor(e){var i;super(),this.show_more_text=new u(e.showMoreText),this.show_less_text=new u(e.showLessText),Reflect.has(e,"attributedDescriptionBodyText")&&(this.attributed_description_body_text=(i=e.attributedDescriptionBodyText)===null||i===void 0?void 0:i.content)}};o(is,"ExpandableVideoDescriptionBody");is.type="ExpandableVideoDescriptionBody";var Rm=is;var ns=class extends s{constructor(e){super(),this.thumbnails=y.fromResponse(e.thumbnail),this.endpoint=new g(e.searchEndpoint),this.query=new u(e.query).toString()}};o(ns,"SearchRefinementCard");ns.type="SearchRefinementCard";var qi=ns;var os=class extends s{constructor(e){super(),this.game=l.parseItem(e.game)}};o(os,"GameCard");os.type="GameCard";var Am=os;var rs=class extends s{constructor(e){super(),this.visible_item_count=e.visibleItemCount,this.items=l.parseArray(e.items)}get contents(){return this.items}};o(rs,"HorizontalList");rs.type="HorizontalList";var Vm=rs;var ss=class extends s{constructor(e){super(),Reflect.has(e,"header")&&(this.header={collapsed_title:new u(e.header.collapsedTitle),collapsed_thumbnail:y.fromResponse(e.header.collapsedThumbnail),collapsed_label:new u(e.header.collapsedLabel),expanded_title:new u(e.header.expandedTitle)}),this.expanded_content=l.parseItem(e.expandedContent,[ui,Vm]),this.expand_button=l.parseItem(e.expandButton,I),this.collapse_button=l.parseItem(e.collapseButton,I)}};o(ss,"ExpandableMetadata");ss.type="ExpandableMetadata";var Mm=ss;var as=class extends s{constructor(e){super(),Reflect.has(e,"icon")&&(this.icon_type=e.icon.iconType),Reflect.has(e,"style")&&(this.style=e.style),Reflect.has(e,"label")&&(this.label=e.label),(Reflect.has(e,"tooltip")||Reflect.has(e,"iconTooltip"))&&(this.tooltip=e.tooltip||e.iconTooltip)}};o(as,"MetadataBadge");as.type="MetadataBadge";var ze=as;var us=class extends s{constructor(e){super(),this.text=new u(e.text).toString(),this.style=e.style}};o(us,"ThumbnailOverlayTimeStatus");us.type="ThumbnailOverlayTimeStatus";var Xi=us;var ls=class extends s{constructor(e){var i,n,r;super();let a=((i=e.thumbnailOverlays.find(c=>c.thumbnailOverlayTimeStatusRenderer))===null||i===void 0?void 0:i.thumbnailOverlayTimeStatusRenderer.text)||"N/A";this.id=e.videoId,this.title=new u(e.title),Reflect.has(e,"descriptionSnippet")&&(this.description_snippet=new u(e.descriptionSnippet)),Reflect.has(e,"detailedMetadataSnippets")&&(this.snippets=e.detailedMetadataSnippets.map(c=>({text:new u(c.snippetText),hover_text:new u(c.snippetHoverText)}))),this.expandable_metadata=l.parseItem(e.expandableMetadata,Mm),this.thumbnails=y.fromResponse(e.thumbnail),this.thumbnail_overlays=l.parseArray(e.thumbnailOverlays),Reflect.has(e,"richThumbnail")&&(this.rich_thumbnail=l.parseItem(e.richThumbnail)),this.author=new D(e.ownerText,e.ownerBadges,(r=(n=e.channelThumbnailSupportedRenderers)===null||n===void 0?void 0:n.channelThumbnailWithLinkRenderer)===null||r===void 0?void 0:r.thumbnail),this.badges=l.parseArray(e.badges,ze),this.endpoint=new g(e.navigationEndpoint),this.published=new u(e.publishedTimeText),this.view_count=new u(e.viewCountText),this.short_view_count=new u(e.shortViewCountText),Reflect.has(e,"upcomingEventData")&&(this.upcoming=new Date(Number(`${e.upcomingEventData.startTime}000`))),this.duration={text:e.lengthText?new u(e.lengthText).toString():new u(a).toString(),seconds:ke(e.lengthText?new u(e.lengthText).toString():new u(a).toString())},this.show_action_menu=!!e.showActionMenu,this.is_watched=!!e.isWatched,this.menu=l.parseItem(e.menu,F),Reflect.has(e,"searchVideoResultEntityKey")&&(this.search_video_result_entity_key=e.searchVideoResultEntityKey)}get description(){var e;return this.snippets?this.snippets.map(i=>i.text.toString()).join(""):((e=this.description_snippet)===null||e===void 0?void 0:e.toString())||""}get is_live(){var e;return this.badges.some(i=>{if(i.style==="BADGE_STYLE_TYPE_LIVE_NOW"||i.label==="LIVE")return!0})||((e=this.thumbnail_overlays.firstOfType(Xi))===null||e===void 0?void 0:e.style)==="LIVE"}get is_upcoming(){return this.upcoming&&this.upcoming>new Date}get is_premiere(){return this.badges.some(e=>e.label==="PREMIERE")}get is_4k(){return this.badges.some(e=>e.label==="4K")}get has_captions(){return this.badges.some(e=>e.label==="CC")}get best_thumbnail(){return this.thumbnails[0]}};o(ls,"Video");ls.type="Video";var Mn=ls;var cs=class extends Mn{constructor(e){super(e)}};o(cs,"VideoCard");cs.type="VideoCard";var Dm=cs;var ps=class extends s{constructor(e){super(),this.image=y.fromResponse(e.image),this.style=e.style}};o(ps,"ContentPreviewImageView");ps.type="ContentPreviewImageView";var Dn=ps;var ds=class extends s{constructor(e){var i;super(),!((i=e.image)===null||i===void 0)&&i.sources?this.image=y.fromResponse(e.image):this.image=l.parseItem(e.image,Dn),this.image_style=e.imageStyle,this.title=e.title,this.subtitle=e.subtitle,this.secondary_subtitle={content:e.secondarySubtitle.content},this.orientation=e.orientation,this.sizing_rule=e.sizingRule,this.overflow_menu_on_tap=new g(e.overflowMenuOnTap),this.overflow_menu_a11y_label=e.overflowMenuA11yLabel}};o(ds,"VideoAttributeView");ds.type="VideoAttributeView";var li=ds;var fs=class extends s{constructor(e){super(),this.cards=l.parseArray(e.cards,[li,qi,Vn,Am,Dm]),this.header=l.parseItem(e.header),this.previous_button=l.parseItem(e.previousButton,I),this.next_button=l.parseItem(e.nextButton,I)}};o(fs,"HorizontalCardList");fs.type="HorizontalCardList";var ui=fs;var ms=class extends s{constructor(e){super(),this.label=new u(e.label),this.value=new u(e.value),this.accessibility_text=e.accessibilityText}};o(ms,"Factoid");ms.type="Factoid";var ci=ms;var hs=class extends s{constructor(e){super(),this.factoid=l.parseItem(e.factoid,ci)}};o(hs,"UploadTimeFactoid");hs.type="UploadTimeFactoid";var Bm=hs;var _s=class extends s{constructor(e){super(),this.view_count_entity_key=e.viewCountEntityKey,this.factoid=l.parseItem(e.factoid,[ci]),this.view_count_type=e.viewCountType}};o(_s,"ViewCountFactoid");_s.type="ViewCountFactoid";var Lm=_s;var gs=class extends s{constructor(e){super(),this.title=new u(e.title),this.channel=new u(e.channel),this.channel_navigation_endpoint=new g(e.channelNavigationEndpoint),this.channel_thumbnail=y.fromResponse(e.channelThumbnail),this.publish_date=new u(e.publishDate),this.views=new u(e.views),this.factoids=l.parseArray(e.factoid,[ci,Lm,Bm])}};o(gs,"VideoDescriptionHeader");gs.type="VideoDescriptionHeader";var Om=gs;var xs=class extends s{constructor(e){super(),this.section_title=new u(e.sectionTitle),this.creator_videos_button=l.parseItem(e.creatorVideosButton,I),this.creator_about_button=l.parseItem(e.creatorAboutButton,I),this.section_subtitle=new u(e.sectionSubtitle),this.channel_avatar=y.fromResponse(e.channelAvatar),this.channel_endpoint=new g(e.channelEndpoint)}};o(xs,"VideoDescriptionInfocardsSection");xs.type="VideoDescriptionInfocardsSection";var Fm=xs;var vs=class extends s{constructor(e){super(),this.title=new u(e.title),Reflect.has(e,"defaultMetadata")&&(this.default_metadata=new u(e.defaultMetadata)),Reflect.has(e,"expandedMetadata")&&(this.expanded_metadata=new u(e.expandedMetadata)),Reflect.has(e,"infoRowExpandStatusKey")&&(this.info_row_expand_status_key=e.infoRowExpandStatusKey)}};o(vs,"InfoRow");vs.type="InfoRow";var Ym=vs;var ys=class extends s{constructor(e){super(),this.id=e.videoId,this.thumbnails=y.fromResponse(e.thumbnail)||null,Reflect.has(e,"richThumbnail")&&(this.rich_thumbnail=l.parseItem(e.richThumbnail)),this.title=new u(e.title),this.author=new D(e.longBylineText,e.ownerBadges,e.channelThumbnail),this.view_count=new u(e.viewCountText),this.short_view_count=new u(e.shortViewCountText),this.published=new u(e.publishedTimeText),this.badges=l.parseArray(e.badges,ze),this.duration={text:new u(e.lengthText).toString(),seconds:ke(new u(e.lengthText).toString())},this.thumbnail_overlays=l.parseArray(e.thumbnailOverlays),this.endpoint=new g(e.navigationEndpoint),this.menu=l.parseItem(e.menu,F)}get best_thumbnail(){return this.thumbnails[0]}get is_fundraiser(){return this.badges.some(e=>e.label==="Fundraiser")}get is_live(){return this.badges.some(e=>{if(e.style==="BADGE_STYLE_TYPE_LIVE_NOW"||e.label==="LIVE")return!0})}get is_new(){return this.badges.some(e=>e.label==="New")}get is_premiere(){return this.badges.some(e=>e.style==="PREMIERE")}};o(ys,"CompactVideo");ys.type="CompactVideo";var Bn=ys;var bs=class extends s{constructor(e){super(),this.info_rows=l.parseArray(e.infoRows,Ym),this.video_lockup=l.parseItem(e.videoLockup,Bn)}};o(bs,"CarouselLockup");bs.type="CarouselLockup";var Um=bs;var ws=class extends s{constructor(e){super(),this.carousel_lockups=l.parseArray(e.carouselLockups,Um),this.section_title=new u(e.sectionTitle)}};o(ws,"VideoDescriptionMusicSection");ws.type="VideoDescriptionMusicSection";var Ln=ws;var Ts=class extends s{constructor(e){super(),this.section_title=new u(e.sectionTitle),this.sub_header_text=new u(e.subHeaderText),this.primary_button=l.parseItem(e.primaryButton,I)}};o(Ts,"VideoDescriptionTranscriptSection");Ts.type="VideoDescriptionTranscriptSection";var Is=Ts;var ks=class extends s{constructor(e){super(),this.thumbnail=y.fromResponse(e.thumbnail),this.title=new u(e.title),this.short_byline_text=new u(e.shortBylineText),this.video_count_short_text=new u(e.videoCountShortText),this.endpoint=new g(e.navigationEndpoint),this.thumbnail_width=e.thumbnailWidth,this.aspect_ratio=e.aspectRatio,this.max_lines_title=e.maxLinesTitle,this.max_lines_short_byline_text=e.maxLinesShortBylineText,this.overlay_position=e.overlayPosition}};o(ks,"StructuredDescriptionPlaylistLockup");ks.type="StructuredDescriptionPlaylistLockup";var jm=ks;var Ss=class extends s{constructor(e){super(),this.section_title=new u(e.sectionTitle),this.media_lockups=l.parseArray(e.mediaLockups,[jm])}};o(Ss,"VideoDescriptionCourseSection");Ss.type="VideoDescriptionCourseSection";var Wm=Ss;var Cs=class extends s{constructor(e){super(),this.title=new u(e.title),this.items=l.parseArray(e.items),Reflect.has(e,"endpoint")&&(this.endpoint=new g(e.endpoint))}get contents(){return this.items}};o(Cs,"ReelShelf");Cs.type="ReelShelf";var On=Cs;var Es=class extends s{constructor(e){super(),this.header_title=e.headerTitle,this.header_subtitle=e.headerSubtitle,this.video_attributes=l.parseArray(e.videoAttributeViewModels,li),this.previous_button=l.parseItem(e.previousButton,St),this.next_button=l.parseItem(e.nextButton,St)}};o(Es,"VideoAttributesSectionView");Es.type="VideoAttributesSectionView";var Jm=Es;var Ps=class extends s{constructor(e){super(),this.items=l.parseArray(e.items,[Om,Rm,Ln,Fm,Wm,Is,Is,ui,On,Jm])}};o(Ps,"StructuredDescriptionContent");Ps.type="StructuredDescriptionContent";var Qi=Ps;var Ns=class extends s{constructor(e){super(),this.header=l.parseItem(e.header,Cm),this.content=l.parseItem(e.content,[li,ve,ce,Sm,Qi,Pm,Nm]),this.panel_identifier=e.panelIdentifier,this.identifier=e.identifier?{surface:e.identifier.surface,tag:e.identifier.tag}:void 0,this.target_id=e.targetId,this.visibility=e.visibility}};o(Ns,"EngagementPanelSectionList");Ns.type="EngagementPanelSectionList";var pi=Ns;var Rs=class extends s{constructor(e){super(),this.content=e.content,this.max_lines=e.maxLines,this.more_endpoint=e.moreEndpoint.showEngagementPanelEndpoint?{show_engagement_panel_endpoint:{engagement_panel:l.parseItem(e.moreEndpoint.showEngagementPanelEndpoint.engagementPanel,pi),engagement_panel_popup_type:e.moreEndpoint.showEngagementPanelEndpoint.engagementPanelPresentationConfigs.engagementPanelPopupPresentationConfig.popupType,identifier:{surface:e.moreEndpoint.showEngagementPanelEndpoint.identifier.surface,tag:e.moreEndpoint.showEngagementPanelEndpoint.identifier.tag}}}:new g(e.moreEndpoint),this.more_icon_type=e.moreIcon.iconType,this.more_label=e.moreLabel,this.target_id=e.targetId}};o(Rs,"ChannelTagline");Rs.type="ChannelTagline";var Hm=Rs;var As=class extends s{constructor(e){super(),this.states=e.states.map(i=>({id:i.stateId,next_id:i.nextStateId,state:l.parse(i.state)})),this.current_state_id=e.currentStateId,this.target_id=e.targetId}};o(As,"SubscriptionNotificationToggleButton");As.type="SubscriptionNotificationToggleButton";var zm=As;var Vs=class extends s{constructor(e){var i,n;super(),this.title=new u(e.buttonText),this.subscribed=e.subscribed,this.enabled=e.enabled,this.item_type=e.type,this.channel_id=e.channelId,this.show_preferences=e.showPreferences,this.subscribed_text=new u(e.subscribedButtonText),this.unsubscribed_text=new u(e.unsubscribedButtonText),this.notification_preference_button=l.parseItem(e.notificationPreferenceButton,zm),this.endpoint=new g(((i=e.serviceEndpoints)===null||i===void 0?void 0:i[0])||((n=e.onSubscribeEndpoints)===null||n===void 0?void 0:n[0]))}};o(Vs,"SubscribeButton");Vs.type="SubscribeButton";var Se=Vs;var Ms=class extends s{constructor(e){super(),this.author=new D({simpleText:e.title,navigationEndpoint:e.navigationEndpoint},e.badges,e.avatar),Reflect.has(e,"banner")&&(this.banner=y.fromResponse(e.banner)),Reflect.has(e,"tv_banner")&&(this.tv_banner=y.fromResponse(e.tvBanner)),Reflect.has(e,"mobile_banner")&&(this.mobile_banner=y.fromResponse(e.mobileBanner)),Reflect.has(e,"subscriberCountText")&&(this.subscribers=new u(e.subscriberCountText)),Reflect.has(e,"videosCountText")&&(this.videos_count=new u(e.videosCountText)),Reflect.has(e,"sponsorButton")&&(this.sponsor_button=l.parseItem(e.sponsorButton,I)),Reflect.has(e,"subscribeButton")&&(this.subscribe_button=l.parseItem(e.subscribeButton,[Se,I])),Reflect.has(e,"headerLinks")&&(this.header_links=l.parseItem(e.headerLinks,[ym,bm])),Reflect.has(e,"channelHandleText")&&(this.channel_handle=new u(e.channelHandleText)),Reflect.has(e,"channelId")&&(this.channel_id=e.channelId),Reflect.has(e,"tagline")&&(this.tagline=l.parseItem(e.tagline,Hm))}};o(Ms,"C4TabbedHeader");Ms.type="C4TabbedHeader";var Fn=Ms;var Ds=class extends s{constructor(e){super(),this.label=new u(e.label),this.icon_type=e.icon.iconType,this.style=e.style}};o(Ds,"CallToActionButton");Ds.type="CallToActionButton";var pv=Ds;var Bs=class extends s{constructor(e){super(),this.teaser=l.parseItem(e.teaser),this.content=l.parseItem(e.content),Reflect.has(e,"cardId")&&(this.card_id=e.cardId),Reflect.has(e,"feature")&&(this.feature=e.feature),this.cue_ranges=e.cueRanges.map(i=>({start_card_active_ms:i.startCardActiveMs,end_card_active_ms:i.endCardActiveMs,teaser_duration_ms:i.teaserDurationMs,icon_after_teaser_ms:i.iconAfterTeaserMs}))}};o(Bs,"Card");Bs.type="Card";var dv=Bs;var Ls=class extends s{constructor(e){super(),this.cards=l.parseArray(e.cards),this.header=new u(e.headerText),this.allow_teaser_dismiss=e.allowTeaserDismiss}};o(Ls,"CardCollection");Ls.type="CardCollection";var Gm=Ls;var Os=class extends s{constructor(e){super(),this.contents=l.parseArray(e.contents)}};o(Os,"CarouselHeader");Os.type="CarouselHeader";var $m=Os;var Fs=class extends s{constructor(e){super(),this.items=l.parseArray(e.carouselItems),this.background_color=e.backgroundColor,this.layout_style=e.layoutStyle,this.pagination_thumbnails=y.fromResponse(e.paginationThumbnails),this.paginator_alignment=e.paginatorAlignment}get contents(){return this.items}};o(Fs,"CarouselItem");Fs.type="CarouselItem";var fv=Fs;var di=class extends s{constructor(e){super(),this.id=e.channelId,this.author=new D(Object.assign(Object.assign({},e.title),{navigationEndpoint:e.navigationEndpoint}),e.ownerBadges,e.thumbnail),this.subscriber_count=new u(e.subscriberCountText),this.video_count=new u(e.videoCountText),this.long_byline=new u(e.longBylineText),this.short_byline=new u(e.shortBylineText),this.endpoint=new g(e.navigationEndpoint),this.subscribe_button=l.parseItem(e.subscribeButton,[Se,I]),this.description_snippet=new u(e.descriptionSnippet)}get subscribers(){return j.warnOnce(di.type,"Channel#subscribers is deprecated. Please use Channel#subscriber_count instead."),this.subscriber_count}get videos(){return j.warnOnce(di.type,"Channel#videos is deprecated. Please use Channel#video_count instead."),this.video_count}};o(di,"Channel");di.type="Channel";var Km=di;var fi=class extends s{constructor(e){var i,n;super(),this.id=e.channelId,this.name=new u(e.title),this.avatar=y.fromResponse(e.avatar),this.canonical_channel_url=e.canonicalChannelUrl,this.primary_links=(n=(i=e.primaryLinks)===null||i===void 0?void 0:i.map(r=>({endpoint:new g(r.navigationEndpoint),icon:y.fromResponse(r.icon),title:new u(r.title)})))!==null&&n!==void 0?n:[],this.view_count=new u(e.viewCountText),this.joined_date=new u(e.joinedDateText),this.description=new u(e.description),this.email_reveal=new g(e.onBusinessEmailRevealClickCommand),this.can_reveal_email=!e.signInForBusinessEmail,this.country=new u(e.country),this.buttons=l.parseArray(e.actionButtons,I)}get views(){return j.warnOnce(fi.type,"ChannelAboutFullMetadata#views is deprecated. Please use ChannelAboutFullMetadata#view_count instead."),this.view_count}get joined(){return j.warnOnce(fi.type,"ChannelAboutFullMetadata#joined is deprecated. Please use ChannelAboutFullMetadata#joined_date instead."),this.joined_date}};o(fi,"ChannelAboutFullMetadata");fi.type="ChannelAboutFullMetadata";var Ys=fi;var Us=class extends s{constructor(e){super(),this.channel_title=e.channelTitle,this.avatar=y.fromResponse(e.avatar),this.header=new u(e.header),this.main_text=new u(e.mainText),this.sign_in_button=l.parseItem(e.signInButton,I),this.secondary_text=new u(e.secondaryText)}};o(Us,"ChannelAgeGate");Us.type="ChannelAgeGate";var mv=Us;var js=class extends s{constructor(e){super(),this.title=new u(e.title),this.items=l.parseArray(e.items)}};o(js,"ChannelFeaturedContent");js.type="ChannelFeaturedContent";var hv=js;var Ws=class extends s{constructor(e){super(),this.title=e.title,this.description=e.description,this.url=e.channelUrl,this.rss_url=e.rssUrl,this.vanity_channel_url=e.vanityChannelUrl,this.external_id=e.externalId,this.is_family_safe=e.isFamilySafe,this.keywords=e.keywords,this.avatar=y.fromResponse(e.avatar),this.music_artist_name=typeof e.musicArtistName=="string"&&e.musicArtistName.length>0?e.musicArtistName:void 0,this.available_countries=e.availableCountryCodes,this.android_deep_link=e.androidDeepLink,this.android_appindexing_link=e.androidAppindexingLink,this.ios_appindexing_link=e.iosAppindexingLink}};o(Ws,"ChannelMetadata");Ws.type="ChannelMetadata";var qm=Ws;var Js=class extends s{constructor(e){super(),this.title=new u(e.title)}};o(Js,"ChannelMobileHeader");Js.type="ChannelMobileHeader";var _v=Js;var Hs=class extends s{constructor(e){super(),this.avatar=y.fromResponse(e.avatar),this.endpoint=new g(e.avatarEndpoint),this.name=e.name,this.links=e.links.map(i=>new u(i))}};o(Hs,"ChannelOptions");Hs.type="ChannelOptions";var Xm=Hs;var zs=class extends s{constructor(e){super(),this.illustration=y.fromResponse(e.illustration),this.description=new u(e.description)}};o(zs,"ChannelOwnerEmptyState");zs.type="ChannelOwnerEmptyState";var gv=zs;var Gs=class extends s{constructor(e){super(),this.content_type_sub_menu_items=e.contentTypeSubMenuItems.map(i=>({endpoint:new g(i.navigationEndpoint||i.endpoint),selected:i.selected,title:i.title})),this.sort_setting=l.parseItem(e.sortSetting)}};o(Gs,"ChannelSubMenu");Gs.type="ChannelSubMenu";var $s=Gs;var Ks=class extends s{constructor(e){var i,n;super(),this.thumbnails=y.fromResponse(e.thumbnail),this.endpoint=new g(e.navigationEndpoint),this.label=(n=(i=e.accessibility)===null||i===void 0?void 0:i.accessibilityData)===null||n===void 0?void 0:n.label}};o(Ks,"ChannelThumbnailWithLink");Ks.type="ChannelThumbnailWithLink";var xv=Ks;var mi=class extends s{constructor(e){super(),this.id=e.videoId,this.title=new u(e.title),this.description=new u(e.description),this.view_count=new u(e.viewCountText),this.published_time=new u(e.publishedTimeText)}get views(){return j.warnOnce(mi.type,"ChannelVideoPlayer#views is deprecated. Please use ChannelVideoPlayer#view_count instead."),this.view_count}get published(){return j.warnOnce(mi.type,"ChannelVideoPlayer#published is deprecated. Please use ChannelVideoPlayer#published_time instead."),this.published_time}};o(mi,"ChannelVideoPlayer");mi.type="ChannelVideoPlayer";var vv=mi;var qs=class extends s{constructor(e){super(),this.title=new u(e.title),this.time_range_start_millis=e.timeRangeStartMillis,this.thumbnail=y.fromResponse(e.thumbnail)}};o(qs,"Chapter");qs.type="Chapter";var Qm=qs;var Xs=class extends s{constructor(e){super(),this.id=e.videoId,this.title=new u(e.title),this.duration={text:e.lengthText.simpleText,seconds:ke(e.lengthText.simpleText)},this.endpoint=new g(e.navigationEndpoint)}};o(Xs,"ChildVideo");Xs.type="ChildVideo";var yv=Xs;var Qs=class extends s{constructor(e){super(),this.text=e.text,this.display_type=e.displayType,this.endpoint=new g(e.tapCommand),this.chip_entity_key=e.chipEntityKey}};o(Qs,"ChipView");Qs.type="ChipView";var Zm=Qs;var Zs=class extends s{constructor(e){super(),this.chips=l.parseArray(e.chips,Zm)}};o(Zs,"ChipBarView");Zs.type="ChipBarView";var bv=Zs;var ea=class extends s{constructor(e){super(),this.is_selected=e.isSelected,Reflect.has(e,"navigationEndpoint")&&(this.endpoint=new g(e.navigationEndpoint)),this.text=new u(e.text).toString()}};o(ea,"ChipCloudChip");ea.type="ChipCloudChip";var Ye=ea;var ta=class extends s{constructor(e){super(),this.chips=l.parseArray(e.chips,Ye),this.next_button=l.parseItem(e.nextButton,I),this.previous_button=l.parseItem(e.previousButton,I),this.horizontal_scrollable=e.horizontalScrollable}};o(ta,"ChipCloud");ta.type="ChipCloud";var Yn=ta;var ia=class extends s{constructor(e){super(),this.channel_avatar=y.fromResponse(e.channelAvatar),this.custom_text=new u(e.customText),this.channel_name=new u(e.channelName),this.subscriber_count=new u(e.subscriberCountText),this.endpoint=new g(e.endpoint)}};o(ia,"CollaboratorInfoCardContent");ia.type="CollaboratorInfoCardContent";var wv=ia;var na=class extends s{constructor(e){super(),this.left=y.fromResponse(e.leftThumbnail),this.top_right=y.fromResponse(e.topRightThumbnail),this.bottom_right=y.fromResponse(e.bottomRightThumbnail),this.endpoint=new g(e.navigationEndpoint)}};o(na,"CollageHeroImage");na.type="CollageHeroImage";var Tv=na;var oa=class extends s{constructor(e){super(),this.icon_name=e.icon.sources[0].clientResource.imageName,this.text=u.fromAttributed(e.text),this.style=e.style}};o(oa,"ThumbnailHoverOverlayView");oa.type="ThumbnailHoverOverlayView";var eh=oa;var ra=class extends s{constructor(e){super(),this.text=e.text,this.badge_style=e.badgeStyle,e.backgroundColor&&(this.background_color={light_theme:e.backgroundColor.lightTheme,dark_theme:e.backgroundColor.darkTheme}),e.iconName&&(this.icon_name=e.icon.sources[0].clientResource.imageName)}};o(ra,"ThumbnailBadgeView");ra.type="ThumbnailBadgeView";var th=ra;var sa=class extends s{constructor(e){super(),this.badges=l.parseArray(e.thumbnailBadges,th),this.position=e.position}};o(sa,"ThumbnailOverlayBadgeView");sa.type="ThumbnailOverlayBadgeView";var ih=sa;var aa=class extends s{constructor(e){super(),this.image=y.fromResponse(e.image),this.overlays=l.parseArray(e.overlays,[ih,eh]),e.backgroundColor&&(this.background_color={light_theme:e.backgroundColor.lightTheme,dark_theme:e.backgroundColor.darkTheme})}};o(aa,"ThumbnailView");aa.type="ThumbnailView";var nh=aa;var ua=class extends s{constructor(e){super(),this.primary_thumbnail=l.parseItem(e.primaryThumbnail,nh),e.stackColor&&(this.stack_color={light_theme:e.stackColor.lightTheme,dark_theme:e.stackColor.darkTheme})}};o(ua,"CollectionThumbnailView");ua.type="CollectionThumbnailView";var oh=ua;var rh,la=class extends s{constructor(e){super(),rh.set(this,void 0),Reflect.has(e,"icon")&&Reflect.has(e.icon,"iconType")&&(this.icon_type=e.icon.iconType),this.tooltip=e.iconTooltip,this.tooltip==="Verified"&&(this.style="BADGE_STYLE_TYPE_VERIFIED",e.style="BADGE_STYLE_TYPE_VERIFIED"),E(this,rh,e,"f")}get orig_badge(){return m(this,rh,"f")}};o(la,"AuthorCommentBadge");rh=new WeakMap;la.type="AuthorCommentBadge";var sh=la;var ca=class extends s{constructor(e){super(),this.reply_button=l.parseItem(e.replyButton,I),this.cancel_button=l.parseItem(e.cancelButton,I),this.author_thumbnail=y.fromResponse(e.authorThumbnail),this.placeholder=new u(e.placeholderText),this.error_message=new u(e.errorMessage)}};o(ca,"CommentReplyDialog");ca.type="CommentReplyDialog";var Un=ca;var pa=class extends s{constructor(e){var i,n;super(),this.text=new u(e.chipText),this.color_pallette={background_color:(i=e.chipColorPalette)===null||i===void 0?void 0:i.backgroundColor,foreground_title_color:(n=e.chipColorPalette)===null||n===void 0?void 0:n.foregroundTitleColor},Reflect.has(e,"chipIcon")&&Reflect.has(e.chipIcon,"iconType")&&(this.icon_type=e.chipIcon.iconType)}};o(pa,"PdgCommentChip");pa.type="PdgCommentChip";var ah=pa;var da=class extends s{constructor(e){super(),this.custom_badge=y.fromResponse(e.customBadge),this.tooltip=e.tooltip}};o(da,"SponsorCommentBadge");da.type="SponsorCommentBadge";var uh=da;var Ct={};ye(Ct,{decodeVisitorData:()=>Sx,encodeChannelAnalyticsParams:()=>ZI,encodeCommentActionParams:()=>fa,encodeCommentParams:()=>nk,encodeCommentsSectionParams:()=>ik,encodeCustomThumbnailPayload:()=>sk,encodeHashtag:()=>ak,encodeMessageParams:()=>Cx,encodeMusicSearchFilters:()=>tk,encodeNotificationPref:()=>ok,encodeReelSequence:()=>Ex,encodeSearchFilters:()=>ek,encodeShortsParam:()=>uk,encodeVideoMetadataPayload:()=>rk,encodeVisitorData:()=>kx});var N;(function(t){t[t.Varint=0]="Varint",t[t.Fixed64=1]="Fixed64",t[t.LengthDelimited=2]="LengthDelimited",t[t.StartGroup=3]="StartGroup",t[t.EndGroup=4]="EndGroup",t[t.Fixed32=5]="Fixed32"})(N||(N={}));var U=class extends Uint32Array{constructor(e=0,i=0){super([e,i])}toString(e=!0){let[i,n]=this;if(i===0&&n===0)return"0";if(e&&n>2147483647)return"-"+ch(xx(this),lh).toString(!1);let r=[],a=new U(i,n);for(;PI(a,CI);){let[c,p]=EI(a);r.push(p),a=c}return r.reverse().join("")}static parse(e){let i=parseInt(e,10),n=i<0;if(Number.isNaN(i))return new U(0);if(e.length<10)return i<0?ch(xx(new U(-i)),lh):new U(i);let r=new U,a=lh;for(let c of e.split("").reverse())parseInt(c)&&(r=ch(r,Iv(new U(parseInt(c)),a))),a=Iv(a,new U(10));return n?ch(xx(r),lh):r}};o(U,"Long");var CI=new U(0),lh=new U(1);function ph(t){let[e,i]=t;return[e&65535,e>>>16,i&65535,i>>>16]}o(ph,"makeChunk");function ch(t,e){let[i,n,r,a]=ph(t),[c,p,d,_]=ph(e),f=0,x=0,v=0,w=0;return w+=i+c,v+=w>>>16,w&=65535,v+=n+p,x+=v>>>16,v&=65535,x+=r+d,f+=x>>>16,x&=65535,f+=a+_,f&=65535,new U(v<<16|w,f<<16|x)}o(ch,"add");function Iv(t,e){let[i,n,r,a]=ph(t),[c,p,d,_]=ph(e),f=0,x=0,v=0,w=0;return w+=i*c,v+=w>>>16,w&=65535,v+=i*p+n*c,x+=v>>>16,v&=65535,x+=i*d+r*c+n*p,f+=x>>>16,x&=65535,f+=i*_+n*d+r*p+a*c,f&=65535,new U(v<<16|w,f<<16|x)}o(Iv,"mul");function EI(t){let[e,i]=t;return[new U((i%10*(4294967295+1)+e)/10|0,i/10|0),(i%10*(4294967295+1)+e)%10]}o(EI,"divByTen");function PI(t,e){let[i,n]=t,[r,a]=e;return n!==a?n-a:i-r}o(PI,"compare");function xx(t){let[e,i]=t;return new U(~e,~i)}o(xx,"negate");function jn(t){let e=[],r=typeof t=="number"?new U(t):t;for(;r[0]||r[1];){let[a,c]=r,p=a&127,d=c>>>7,_=a>>>7|(c&127)<<32-7;r=new U(_,d);let f=r[0]||r[1]?p|128:p;e.push(f)}return e.length<1?new Uint8Array(1):Uint8Array.from(e)}o(jn,"encode");function Wn(t){let e=new U(0),i=0;for(;;){let n=t.getUint8(i);if(e=NI(e,RI(new U(n&127),i*7)),++i,!(n>>>7))return[i,e]}}o(Wn,"decode");function NI(t,e){return new U(t[0]|e[0],t[1]|e[1])}o(NI,"or");function RI(t,e){return e===0?t:e>=32?new U(0,t[0]<>>32-e)}o(RI,"leftshift");function R(t){let e=[];return t.forEach(([i,n])=>{switch(e.push(jn(i<<3|n.type)),n.type){case N.Varint:e.push(jn(n.value));break;case N.Fixed64:{let r=new Uint8Array(8),a=new DataView(r.buffer);a.setUint32(0,n.value[0],!0),a.setUint32(4,n.value[1],!0),e.push(r);break}case N.LengthDelimited:e.push(jn(n.value.byteLength)),e.push(n.value);break;case N.Fixed32:{let r=new Uint8Array(4);new DataView(r.buffer).setUint32(0,n.value,!0),e.push(r);break}}}),vx(e)}o(R,"serialize");function vx(t){let e=t.reduce((n,r)=>n+r.byteLength,0),i=new Uint8Array(e);return t.reduce((n,r)=>(i.set(r,n),n+r.byteLength),0),i}o(vx,"concat");function yx(t){if(t instanceof U){let e=new U(t[0]<<1,t[1]<<1|t[0]>>>31),i=t[1]>>>31?new U(4294967295,4294967295):new U;return new U(e[0]^i[0],e[1]^i[1])}return(t*2^t>>31)>>>0}o(yx,"encode");function bx(t){if(t instanceof U){let e=new U(t[0]>>>1|t[1]<<31,t[1]>>>1),i=t[0]&1?new U(4294967295,4294967295):new U;return new U(e[0]^i[0],e[1]^i[1])}return t>>>1^-(t&1)}o(bx,"decode");var wx={int32:t=>t[0]|0,int64:t=>t.toString(!0),uint32:t=>t[0]>>>0,uint64:t=>t.toString(!1),sint32:t=>bx(t[0]),sint64:t=>bx(t).toString(!0),bool:t=>t[0]!==0},Tx={int32:t=>new U(t),int64:t=>U.parse(t),uint32:t=>new U(t),uint64:t=>U.parse(t),sint32:t=>yx(new U(t)),sint64:t=>yx(U.parse(t)),bool:t=>new U(+t)},AI=Object.fromEntries(Object.entries(wx).map(([t,e])=>[t,i=>{if(i.type===N.Varint)return e(i.value)}])),VI=Object.fromEntries(Object.entries(Tx).map(([t,e])=>[t,i=>({type:N.Varint,value:e(i)})])),J=Object.assign(Object.assign({},AI),{double:t=>t.type!==N.Fixed64?void 0:new DataView(t.value.buffer).getFloat64(0,!0),float:t=>t.type!==N.Fixed32?void 0:new DataView(new Uint32Array([t.value]).buffer).getFloat32(0,!0),fixed32:t=>{if(t.type===N.Fixed32)return t.value>>>0},fixed64:t=>{if(t.type===N.Fixed64)return t.value.toString(!1)},sfixed32:t=>{if(t.type===N.Fixed32)return t.value|0},sfixed64:t=>{if(t.type===N.Fixed64)return t.value.toString(!0)},string:t=>t.type!==N.LengthDelimited?void 0:new TextDecoder().decode(t.value),bytes:t=>{if(t.type===N.LengthDelimited)return t.value}}),C=Object.assign(Object.assign({},VI),{double:t=>{let e=new U;return new DataView(e.buffer).setFloat64(0,t,!0),{type:N.Fixed64,value:e}},float:t=>{let e=new Uint32Array(1),i=new DataView(e.buffer);return i.setFloat32(0,t,!0),{type:N.Fixed32,value:i.getUint32(0,!0)}},fixed32:t=>({type:N.Fixed32,value:t>>>0}),fixed64:t=>({type:N.Fixed64,value:U.parse(t)}),sfixed32:t=>({type:N.Fixed32,value:t|0}),sfixed64:t=>({type:N.Fixed64,value:U.parse(t)}),string:t=>{let e=new TextEncoder;return{type:N.LengthDelimited,value:e.encode(t)}},bytes:t=>({type:N.LengthDelimited,value:t})}),MI=Object.fromEntries(Object.keys(wx).map(t=>[t,function*(e){for(let i of e){let n=J[t](i);if(n!=null)yield n;else for(let r of OI(i))yield wx[t](r)}}])),rB=Object.assign(Object.assign({},MI),{*double(t){for(let e of t){let i=J.double(e);i!=null?yield i:yield*BI(e)}},*float(t){for(let e of t){let i=J.float(e);i!=null?yield i:yield*LI(e)}},*fixed32(t){for(let e of t){let i=J.fixed32(e);if(i!=null)yield i;else for(let n of kv(e))yield n>>>0}},*fixed64(t){for(let e of t){let i=J.fixed64(e);if(i!=null)yield i;else for(let n of Sv(e))yield n.toString(!1)}},*sfixed32(t){for(let e of t){let i=J.sfixed32(e);if(i!=null)yield i;else for(let n of kv(e))yield n|0}},*sfixed64(t){for(let e of t){let i=J.sfixed64(e);if(i!=null)yield i;else for(let n of Sv(e))yield n.toString(!0)}}}),DI=Object.fromEntries(Object.keys(Tx).map(t=>[t,function(e){return{type:N.LengthDelimited,value:vx(e.map(i=>{let n=Tx[t](i);return jn(n)}))}}]));function Jn(t,e){return o(function(n){let r=new Uint8Array(n.length*t),a=new DataView(r.buffer);for(let c=0;c{t.setFloat64(e,i,!0)}),float:Jn(4,(t,e,i)=>{t.setFloat32(e,i,!0)}),fixed32:Jn(4,(t,e,i)=>{t.setUint32(e,i,!0)}),fixed64:Jn(8,(t,e,i)=>{let n=U.parse(i);t.setUint32(e,n[0],!0),t.setUint32(e+4,n[1],!0)}),sfixed32:Jn(4,(t,e,i)=>{t.setInt32(e,i,!0)}),sfixed64:Jn(8,(t,e,i)=>{let n=U.parse(i);t.setUint32(e,n[0],!0),t.setUint32(e+4,n[1],!0)})});function*BI(t){if(t.type!==N.LengthDelimited)return;let{value:e}=t,i=0,n=new DataView(e.buffer,e.byteOffset);for(;i>>3;switch(p){default:throw new Error(`Unknown wire type ${p}`);case N.Varint:{let[x,v]=Wn(new DataView(t.buffer,i+e));n.push([d,{type:p,value:v}]),e+=x;break}case N.Fixed64:let _=r.getUint32(e,!0),f=r.getUint32(e+=4,!0);e+=4,n.push([d,{type:p,value:new U(_,f)}]);break;case N.LengthDelimited:{let[x,v]=Wn(new DataView(t.buffer,i+e));n.push([d,{type:p,value:t.subarray(e+=x,e+=v[0])}]);break}case N.StartGroup:case N.EndGroup:n.push([d,{type:p}]);break;case N.Fixed32:n.push([d,{type:p,value:r.getUint32(e,!0)}]),e+=4;break}}return n}o(H,"deserialize");function FI(){return{id:"",timestamp:0}}o(FI,"getDefaultValue");function Cv(t){let e=[];if(t.id!==void 0){let i=t.id;e.push([1,C.string(i)])}if(t.timestamp!==void 0){let i=t.timestamp;e.push([5,C.int32(i)])}return R(e)}o(Cv,"encodeBinary");function Ev(t){let e=FI(),i=H(t),n=new Map(i);e:{let r=n.get(1);if(r===void 0)break e;let a=J.string(r);if(a===void 0)break e;e.id=a}e:{let r=n.get(5);if(r===void 0)break e;let a=J.int32(r);if(a===void 0)break e;e.timestamp=a}return e}o(Ev,"decodeBinary");function Pv(t){let e=[];if(t.channelId!==void 0){let i=t.channelId;e.push([1001,C.string(i)])}return R(e)}o(Pv,"encodeBinary");function Nv(t){let e=[];if(t.params!==void 0){let i=t.params;e.push([32,{type:N.LengthDelimited,value:Pv(i)}])}return R(e)}o(Nv,"encodeBinary");function Rv(t){let e=[];if(t.uploadDate!==void 0){let i=t.uploadDate;e.push([1,C.int32(i)])}if(t.type!==void 0){let i=t.type;e.push([2,C.int32(i)])}if(t.duration!==void 0){let i=t.duration;e.push([3,C.int32(i)])}if(t.featuresHd!==void 0){let i=t.featuresHd;e.push([4,C.int32(i)])}if(t.featuresSubtitles!==void 0){let i=t.featuresSubtitles;e.push([5,C.int32(i)])}if(t.featuresCreativeCommons!==void 0){let i=t.featuresCreativeCommons;e.push([6,C.int32(i)])}if(t.features3d!==void 0){let i=t.features3d;e.push([7,C.int32(i)])}if(t.featuresLive!==void 0){let i=t.featuresLive;e.push([8,C.int32(i)])}if(t.featuresPurchased!==void 0){let i=t.featuresPurchased;e.push([9,C.int32(i)])}if(t.features4k!==void 0){let i=t.features4k;e.push([14,C.int32(i)])}if(t.features360!==void 0){let i=t.features360;e.push([15,C.int32(i)])}if(t.featuresLocation!==void 0){let i=t.featuresLocation;e.push([23,C.int32(i)])}if(t.featuresHdr!==void 0){let i=t.featuresHdr;e.push([25,C.int32(i)])}if(t.featuresVr180!==void 0){let i=t.featuresVr180;e.push([26,C.int32(i)])}return R(e)}o(Rv,"encodeBinary");function Av(t){let e=[];if(t.sortBy!==void 0){let i=t.sortBy;e.push([1,C.int32(i)])}if(t.filters!==void 0){let i=t.filters;e.push([2,{type:N.LengthDelimited,value:Rv(i)}])}if(t.noFilter!==void 0){let i=t.noFilter;e.push([19,C.int32(i)])}return R(e)}o(Av,"encodeBinary");function Vv(t){let e=[];if(t.song!==void 0){let i=t.song;e.push([1,C.int32(i)])}if(t.video!==void 0){let i=t.video;e.push([2,C.int32(i)])}if(t.album!==void 0){let i=t.album;e.push([3,C.int32(i)])}if(t.artist!==void 0){let i=t.artist;e.push([4,C.int32(i)])}if(t.playlist!==void 0){let i=t.playlist;e.push([5,C.int32(i)])}return R(e)}o(Vv,"encodeBinary");function Mv(t){let e=[];if(t.type!==void 0){let i=t.type;e.push([17,{type:N.LengthDelimited,value:Vv(i)}])}return R(e)}o(Mv,"encodeBinary");function Dv(t){let e=[];if(t.filters!==void 0){let i=t.filters;e.push([2,{type:N.LengthDelimited,value:Mv(i)}])}return R(e)}o(Dv,"encodeBinary");function Bv(t){let e=[];if(t.channelId!==void 0){let i=t.channelId;e.push([1,C.string(i)])}if(t.videoId!==void 0){let i=t.videoId;e.push([2,C.string(i)])}return R(e)}o(Bv,"encodeBinary");function Lv(t){let e=[];if(t.ids!==void 0){let i=t.ids;e.push([5,{type:N.LengthDelimited,value:Bv(i)}])}return R(e)}o(Lv,"encodeBinary");function Ov(t){let e=[];if(t.params!==void 0){let i=t.params;e.push([1,{type:N.LengthDelimited,value:Lv(i)}])}if(t.number0!==void 0){let i=t.number0;e.push([2,C.int32(i)])}if(t.number1!==void 0){let i=t.number1;e.push([3,C.int32(i)])}return R(e)}o(Ov,"encodeBinary");function Fv(t){let e=[];if(t.videoId!==void 0){let i=t.videoId;e.push([2,C.string(i)])}return R(e)}o(Fv,"encodeBinary");function Yv(t){let e=[];if(t.unkParam!==void 0){let i=t.unkParam;e.push([1,C.int32(i)])}return R(e)}o(Yv,"encodeBinary");function Uv(t){let e=[];if(t.commentId!==void 0){let i=t.commentId;e.push([2,C.string(i)])}if(t.unkopts!==void 0){let i=t.unkopts;e.push([4,{type:N.LengthDelimited,value:Yv(i)}])}if(t.channelId!==void 0){let i=t.channelId;e.push([5,C.string(i)])}if(t.videoId!==void 0){let i=t.videoId;e.push([6,C.string(i)])}if(t.unkParam1!==void 0){let i=t.unkParam1;e.push([8,C.int32(i)])}if(t.unkParam2!==void 0){let i=t.unkParam2;e.push([9,C.int32(i)])}return R(e)}o(Uv,"encodeBinary");function jv(t){let e=[];if(t.videoId!==void 0){let i=t.videoId;e.push([4,C.string(i)])}if(t.sortBy!==void 0){let i=t.sortBy;e.push([6,C.int32(i)])}if(t.type!==void 0){let i=t.type;e.push([15,C.int32(i)])}if(t.commentId!==void 0){let i=t.commentId;e.push([16,C.string(i)])}return R(e)}o(jv,"encodeBinary");function Wv(t){let e=[];if(t.unkToken!==void 0){let i=t.unkToken;e.push([1,C.string(i)])}if(t.repliesOpts!==void 0){let i=t.repliesOpts;e.push([3,{type:N.LengthDelimited,value:Uv(i)}])}if(t.opts!==void 0){let i=t.opts;e.push([4,{type:N.LengthDelimited,value:jv(i)}])}if(t.page!==void 0){let i=t.page;e.push([5,C.int32(i)])}if(t.target!==void 0){let i=t.target;e.push([8,C.string(i)])}return R(e)}o(Wv,"encodeBinary");function Jv(t){let e=[];if(t.ctx!==void 0){let i=t.ctx;e.push([2,{type:N.LengthDelimited,value:Fv(i)}])}if(t.unkParam!==void 0){let i=t.unkParam;e.push([3,C.int32(i)])}if(t.params!==void 0){let i=t.params;e.push([6,{type:N.LengthDelimited,value:Wv(i)}])}return R(e)}o(Jv,"encodeBinary");function Hv(t){let e=[];if(t.index!==void 0){let i=t.index;e.push([1,C.int32(i)])}return R(e)}o(Hv,"encodeBinary");function zv(t){let e=[];if(t.videoId!==void 0){let i=t.videoId;e.push([2,C.string(i)])}if(t.params!==void 0){let i=t.params;e.push([5,{type:N.LengthDelimited,value:Hv(i)}])}if(t.number!==void 0){let i=t.number;e.push([10,C.int32(i)])}return R(e)}o(zv,"encodeBinary");function Gv(t){let e=[];if(t.text!==void 0){let i=t.text;e.push([1,C.string(i)])}return R(e)}o(Gv,"encodeBinary");function $v(t){let e=[];if(t.comment!==void 0){let i=t.comment;e.push([1,{type:N.LengthDelimited,value:Gv(i)}])}return R(e)}o($v,"encodeBinary");function Kv(t){let e=[];if(t.commentId!==void 0){let i=t.commentId;e.push([2,C.string(i)])}if(t.params!==void 0){let i=t.params;e.push([3,{type:N.LengthDelimited,value:$v(i)}])}if(t.targetLanguage!==void 0){let i=t.targetLanguage;e.push([4,C.string(i)])}return R(e)}o(Kv,"encodeBinary");function qv(t){let e=[];if(t.type!==void 0){let i=t.type;e.push([1,C.int32(i)])}if(t.unkNum!==void 0){let i=t.unkNum;e.push([2,C.int32(i)])}if(t.commentId!==void 0){let i=t.commentId;e.push([3,C.string(i)])}if(t.videoId!==void 0){let i=t.videoId;e.push([5,C.string(i)])}if(t.channelId!==void 0){let i=t.channelId;e.push([23,C.string(i)])}if(t.translateCommentParams!==void 0){let i=t.translateCommentParams;e.push([31,{type:N.LengthDelimited,value:Kv(i)}])}return R(e)}o(qv,"encodeBinary");function Xv(t){let e=[];if(t.index!==void 0){let i=t.index;e.push([1,C.int32(i)])}return R(e)}o(Xv,"encodeBinary");function Qv(t){let e=[];if(t.channelId!==void 0){let i=t.channelId;e.push([1,C.string(i)])}if(t.prefId!==void 0){let i=t.prefId;e.push([2,{type:N.LengthDelimited,value:Xv(i)}])}if(t.number0!==void 0){let i=t.number0;e.push([3,C.int32(i)])}if(t.number1!==void 0){let i=t.number1;e.push([4,C.int32(i)])}return R(e)}o(Qv,"encodeBinary");function Zv(t){let e=[];if(t.deviceMake!==void 0){let i=t.deviceMake;e.push([12,C.string(i)])}if(t.deviceModel!==void 0){let i=t.deviceModel;e.push([13,C.string(i)])}if(t.nameId!==void 0){let i=t.nameId;e.push([16,C.int32(i)])}if(t.clientVersion!==void 0){let i=t.clientVersion;e.push([17,C.string(i)])}if(t.osName!==void 0){let i=t.osName;e.push([18,C.string(i)])}if(t.osVersion!==void 0){let i=t.osVersion;e.push([19,C.string(i)])}if(t.acceptLanguage!==void 0){let i=t.acceptLanguage;e.push([21,C.string(i)])}if(t.acceptRegion!==void 0){let i=t.acceptRegion;e.push([22,C.string(i)])}if(t.androidSdkVersion!==void 0){let i=t.androidSdkVersion;e.push([34,C.int32(i)])}if(t.windowWidthPoints!==void 0){let i=t.windowWidthPoints;e.push([37,C.int32(i)])}if(t.windowHeightPoints!==void 0){let i=t.windowHeightPoints;e.push([38,C.int32(i)])}return R(e)}o(Zv,"encodeBinary");function ey(t){let e=[];if(t.client!==void 0){let i=t.client;e.push([1,{type:N.LengthDelimited,value:Zv(i)}])}return R(e)}o(ey,"encodeBinary");function ty(t){let e=[];if(t.text!==void 0){let i=t.text;e.push([1,C.string(i)])}return R(e)}o(ty,"encodeBinary");function iy(t){let e=[];if(t.text!==void 0){let i=t.text;e.push([1,C.string(i)])}return R(e)}o(iy,"encodeBinary");function ny(t){let e=[];for(let i of t.list)e.push([1,C.string(i)]);return R(e)}o(ny,"encodeBinary");function oy(t){let e=[];if(t.id!==void 0){let i=t.id;e.push([1,C.int32(i)])}return R(e)}o(oy,"encodeBinary");function ry(t){let e=[];if(t.type!==void 0){let i=t.type;e.push([1,C.string(i)])}return R(e)}o(ry,"encodeBinary");function sy(t){let e=[];if(t.imageData!==void 0){let i=t.imageData;e.push([1,C.bytes(i)])}return R(e)}o(sy,"encodeBinary");function ay(t){let e=[];if(t.type!==void 0){let i=t.type;e.push([1,C.int32(i)])}if(t.thumbnail!==void 0){let i=t.thumbnail;e.push([3,{type:N.LengthDelimited,value:sy(i)}])}return R(e)}o(ay,"encodeBinary");function uy(t){let e=[];if(t.type!==void 0){let i=t.type;e.push([1,C.int32(i)])}return R(e)}o(uy,"encodeBinary");function ly(t){let e=[];if(t.unkparam!==void 0){let i=t.unkparam;e.push([1,C.int32(i)])}if(t.choice!==void 0){let i=t.choice;e.push([2,C.int32(i)])}return R(e)}o(ly,"encodeBinary");function cy(t){let e=[];if(t.unkparam!==void 0){let i=t.unkparam;e.push([1,C.int32(i)])}if(t.choice!==void 0){let i=t.choice;e.push([2,C.int32(i)])}return R(e)}o(cy,"encodeBinary");function Ix(t){let e=[];if(t.context!==void 0){let i=t.context;e.push([1,{type:N.LengthDelimited,value:ey(i)}])}if(t.videoId!==void 0){let i=t.videoId;e.push([2,C.string(i)])}if(t.title!==void 0){let i=t.title;e.push([3,{type:N.LengthDelimited,value:ty(i)}])}if(t.description!==void 0){let i=t.description;e.push([4,{type:N.LengthDelimited,value:iy(i)}])}if(t.tags!==void 0){let i=t.tags;e.push([6,{type:N.LengthDelimited,value:ny(i)}])}if(t.category!==void 0){let i=t.category;e.push([7,{type:N.LengthDelimited,value:oy(i)}])}if(t.license!==void 0){let i=t.license;e.push([8,{type:N.LengthDelimited,value:ry(i)}])}if(t.videoThumbnail!==void 0){let i=t.videoThumbnail;e.push([20,{type:N.LengthDelimited,value:ay(i)}])}if(t.privacy!==void 0){let i=t.privacy;e.push([38,{type:N.LengthDelimited,value:uy(i)}])}if(t.madeForKids!==void 0){let i=t.madeForKids;e.push([68,{type:N.LengthDelimited,value:ly(i)}])}if(t.ageRestricted!==void 0){let i=t.ageRestricted;e.push([69,{type:N.LengthDelimited,value:cy(i)}])}return R(e)}o(Ix,"encodeBinary");function py(t){let e=[];if(t.hashtag!==void 0){let i=t.hashtag;e.push([1,C.string(i)])}if(t.type!==void 0){let i=t.type;e.push([3,C.int32(i)])}return R(e)}o(py,"encodeBinary");function dy(t){let e=[];if(t.params!==void 0){let i=t.params;e.push([93,{type:N.LengthDelimited,value:py(i)}])}return R(e)}o(dy,"encodeBinary");function fy(t){let e=[];if(t.number!==void 0){let i=t.number;e.push([3,C.int32(i)])}return R(e)}o(fy,"encodeBinary");function my(t){let e=[];if(t.shortId!==void 0){let i=t.shortId;e.push([1,C.string(i)])}if(t.params!==void 0){let i=t.params;e.push([5,{type:N.LengthDelimited,value:fy(i)}])}if(t.feature2!==void 0){let i=t.feature2;e.push([10,C.int32(i)])}if(t.feature3!==void 0){let i=t.feature3;e.push([13,C.int32(i)])}return R(e)}o(my,"encodeBinary");function hy(t){let e=[];if(t.p1!==void 0){let i=t.p1;e.push([1,C.int32(i)])}return R(e)}o(hy,"encodeBinary");function _y(t){let e=[];if(t.f1!==void 0){let i=t.f1;e.push([1,{type:N.LengthDelimited,value:hy(i)}])}if(t.p59!==void 0){let i=t.p59;e.push([59,C.int32(i)])}return R(e)}o(_y,"encodeBinary");function kx(t,e){let i=Cv({id:t,timestamp:e});return encodeURIComponent(Ge(i).replace(/\+/g,"-").replace(/\//g,"_"))}o(kx,"encodeVisitorData");function Sx(t){return Ev(Px(decodeURIComponent(t).replace(/-/g,"+").replace(/_/g,"/")))}o(Sx,"decodeVisitorData");function ZI(t){let e=Nv({params:{channelId:t}});return encodeURIComponent(Ge(e))}o(ZI,"encodeChannelAnalyticsParams");function ek(t){let e={all:void 0,hour:1,today:2,week:3,month:4,year:5},i={all:void 0,video:1,channel:2,playlist:3,movie:4},n={all:void 0,short:1,long:2,medium:3},r={relevance:void 0,rating:1,upload_date:2,view_count:3},a={hd:"featuresHd",subtitles:"featuresSubtitles",creative_commons:"featuresCreativeCommons","3d":"features3D",live:"featuresLive",purchased:"featuresPurchased","4k":"features4K",360:"features360",location:"featuresLocation",hdr:"featuresHdr",vr180:"featuresVr180"},c={};if(t?c.filters={}:c.noFilter=0,c.filters&&(t.upload_date&&(c.filters.uploadDate=e[t.upload_date]),t.type&&(c.filters.type=i[t.type]),t.duration&&(c.filters.duration=n[t.duration]),t.sort_by&&t.sort_by!=="relevance"&&(c.sortBy=r[t.sort_by]),t.features))for(let d of t.features)c.filters[a[d]]=1;let p=Av(c);return encodeURIComponent(Ge(p))}o(ek,"encodeSearchFilters");function tk(t){var e;let i={filters:{type:{}}};t.type&&t.type!=="all"&&((e=i.filters)===null||e===void 0?void 0:e.type)&&(i.filters.type[t.type]=1);let n=Dv(i);return encodeURIComponent(Ge(n))}o(tk,"encodeMusicSearchFilters");function Cx(t,e){let i=Ov({params:{ids:{channelId:t,videoId:e}},number0:1,number1:4});return btoa(encodeURIComponent(Ge(i)))}o(Cx,"encodeMessageParams");function ik(t,e={}){let n=Jv({ctx:{videoId:t},unkParam:6,params:{opts:{videoId:t,sortBy:{TOP_COMMENTS:0,NEWEST_FIRST:1}[e.sort_by||"TOP_COMMENTS"],type:e.type||2,commentId:e.comment_id||""},target:"comments-section"}});return encodeURIComponent(Ge(n))}o(ik,"encodeCommentsSectionParams");function nk(t){let e=zv({videoId:t,params:{index:0},number:7});return encodeURIComponent(Ge(e))}o(nk,"encodeCommentParams");function fa(t,e={}){let i={type:t,commentId:e.comment_id||" ",videoId:e.video_id||" ",channelId:" ",unkNum:2};if(e.hasOwnProperty("text")){if(typeof e.target_language!="string")throw new Error("target_language must be a string");e.comment_id&&delete i.unkNum,i.translateCommentParams={params:{comment:{text:e.text}},commentId:e.comment_id||" ",targetLanguage:e.target_language}}let n=qv(i);return encodeURIComponent(Ge(n))}o(fa,"encodeCommentActionParams");function ok(t,e){let i=Qv({channelId:t,prefId:{index:e},number0:0,number1:4});return encodeURIComponent(Ge(i))}o(ok,"encodeNotificationPref");function rk(t,e){let i={context:{client:{nameId:3,osName:"Android",androidSdkVersion:re.ANDROID.SDK_VERSION,osVersion:"13",acceptLanguage:"en-US",acceptRegion:"US",deviceMake:"Google",deviceModel:"sdk_gphone64_x86_64",windowHeightPoints:840,windowWidthPoints:432,clientVersion:re.ANDROID.VERSION}},videoId:t};if(Reflect.has(e,"title")&&(i.title={text:e.title||""}),Reflect.has(e,"description")&&(i.description={text:e.description||""}),Reflect.has(e,"license")&&(i.license={type:e.license||""}),Reflect.has(e,"tags")&&(i.tags={list:e.tags||[]}),Reflect.has(e,"category")&&(i.category={id:e.category||0}),Reflect.has(e,"privacy"))switch(e.privacy){case"PUBLIC":i.privacy={type:1};break;case"UNLISTED":i.privacy={type:2};break;case"PRIVATE":i.privacy={type:3};break;default:throw new Error("Invalid visibility option")}return Reflect.has(e,"made_for_kids")&&(i.madeForKids={unkparam:1,choice:e.made_for_kids?1:2}),Reflect.has(e,"age_restricted")&&(i.ageRestricted={unkparam:1,choice:e.age_restricted?1:2}),Ix(i)}o(rk,"encodeVideoMetadataPayload");function sk(t,e){let i={context:{client:{nameId:3,osName:"Android",androidSdkVersion:re.ANDROID.SDK_VERSION,osVersion:"13",acceptLanguage:"en-US",acceptRegion:"US",deviceMake:"Google",deviceModel:"sdk_gphone64_x86_64",windowHeightPoints:840,windowWidthPoints:432,clientVersion:re.ANDROID.VERSION}},videoId:t,videoThumbnail:{type:3,thumbnail:{imageData:e}}};return Ix(i)}o(sk,"encodeCustomThumbnailPayload");function ak(t){let e=dy({params:{hashtag:t,type:1}});return encodeURIComponent(Ge(e))}o(ak,"encodeHashtag");function Ex(t){let e=my({shortId:t,params:{number:5},feature2:25,feature3:0});return encodeURIComponent(Ge(e))}o(Ex,"encodeReelSequence");function uk(){let t=_y({f1:{p1:1},p59:1});return encodeURIComponent(Ge(t))}o(uk,"encodeShortsParam");var xt,ma=class extends s{constructor(e){var i,n,r,a,c,p,d;super(),xt.set(this,void 0),this.content=new u(e.contentText),this.published=new u(e.publishedTimeText),this.author_is_channel_owner=e.authorIsChannelOwner,this.current_user_reply_thumbnail=y.fromResponse(e.currentUserReplyThumbnail),this.sponsor_comment_badge=l.parseItem(e.sponsorCommentBadge,uh),this.paid_comment_chip=l.parseItem(e.paidCommentChipRenderer,ah),this.author_badge=l.parseItem(e.authorCommentBadge,sh),this.author=new D(Object.assign(Object.assign({},e.authorText),{navigationEndpoint:e.authorEndpoint}),this.author_badge?[{metadataBadgeRenderer:(i=this.author_badge)===null||i===void 0?void 0:i.orig_badge}]:null,e.authorThumbnail),this.action_menu=l.parseItem(e.actionMenu,F),this.action_buttons=l.parseItem(e.actionButtons,Rn),this.comment_id=e.commentId,this.vote_status=e.voteStatus,this.vote_count=e.voteCount?new u(e.voteCount).toString():"0",this.reply_count=e.replyCount||0,this.is_liked=!!(!((r=(n=this.action_buttons)===null||n===void 0?void 0:n.like_button)===null||r===void 0)&&r.is_toggled),this.is_disliked=!!(!((c=(a=this.action_buttons)===null||a===void 0?void 0:a.dislike_button)===null||c===void 0)&&c.is_toggled),this.is_hearted=!!(!((d=(p=this.action_buttons)===null||p===void 0?void 0:p.creator_heart)===null||d===void 0)&&d.is_hearted),this.is_pinned=!!e.pinnedCommentBadge,this.is_member=!!e.sponsorCommentBadge}like(){return T(this,void 0,void 0,function*(){var e;if(!m(this,xt,"f"))throw new b("An active caller must be provide to perform this operation.");let i=(e=this.action_buttons)===null||e===void 0?void 0:e.like_button;if(!i)throw new b("Like button was not found.",{comment_id:this.comment_id});if(i.is_toggled)throw new b("This comment is already liked",{comment_id:this.comment_id});return yield i.endpoint.call(m(this,xt,"f"),{parse:!1})})}dislike(){return T(this,void 0,void 0,function*(){var e;if(!m(this,xt,"f"))throw new b("An active caller must be provide to perform this operation.");let i=(e=this.action_buttons)===null||e===void 0?void 0:e.dislike_button;if(!i)throw new b("Dislike button was not found.",{comment_id:this.comment_id});if(i.is_toggled)throw new b("This comment is already disliked",{comment_id:this.comment_id});return yield i.endpoint.call(m(this,xt,"f"),{parse:!1})})}reply(e){return T(this,void 0,void 0,function*(){var i,n,r;if(!m(this,xt,"f"))throw new b("An active caller must be provide to perform this operation.");if(!(!((i=this.action_buttons)===null||i===void 0)&&i.reply_button))throw new b("Cannot reply to another reply. Try mentioning the user instead.",{comment_id:this.comment_id});let a=(n=this.action_buttons)===null||n===void 0?void 0:n.reply_button;if(!(!((r=a.endpoint)===null||r===void 0)&&r.dialog))throw new b("Reply button endpoint did not have a dialog.");let p=a.endpoint.dialog.as(Un).reply_button;if(!p)throw new b("Reply button was not found in the dialog.",{comment_id:this.comment_id});if(!p.endpoint)throw new b("Reply button endpoint was not found.",{comment_id:this.comment_id});return yield p.endpoint.call(m(this,xt,"f"),{commentText:e})})}translate(e){return T(this,void 0,void 0,function*(){var i,n,r,a,c,p;if(!m(this,xt,"f"))throw new b("An active caller must be provide to perform this operation.");let _={text:this.content.toString().replace(/[^\p{L}\p{N}\p{P}\p{Z}]/gu,""),target_language:e,comment_id:this.comment_id},f=fa(22,_),x=yield m(this,xt,"f").execute("comment/perform_comment_action",{action:f,client:"ANDROID"}),v=(n=(i=x.data.frameworkUpdates)===null||i===void 0?void 0:i.entityBatchUpdate)===null||n===void 0?void 0:n.mutations,w=(p=(c=(a=(r=v==null?void 0:v[0])===null||r===void 0?void 0:r.payload)===null||a===void 0?void 0:a.commentEntityPayload)===null||c===void 0?void 0:c.translatedContent)===null||p===void 0?void 0:p.content;return Object.assign(Object.assign({},x),{content:w})})}setActions(e){E(this,xt,e,"f")}};o(ma,"Comment");xt=new WeakMap;ma.type="Comment";var Hn=ma;var ha=class extends s{constructor(e){super(),this.id=e.id,this.categories=l.parseArray(e.categories),this.category_buttons=l.parseArray(e.categoryButtons),this.search_placeholder=new u(e.searchPlaceholderText),this.search_no_results=new u(e.searchNoResultsText),this.pick_skin_tone=new u(e.pickSkinToneText),this.clear_search_label=e.clearSearchLabel,this.skin_tone_generic_label=e.skinToneGenericLabel,this.skin_tone_light_label=e.skinToneLightLabel,this.skin_tone_medium_light_label=e.skinToneMediumLightLabel,this.skin_tone_medium_label=e.skinToneMediumLabel,this.skin_tone_medium_dark_label=e.skinToneMediumDarkLabel,this.skin_tone_dark_label=e.skinToneDarkLabel}};o(ha,"EmojiPicker");ha.type="EmojiPicker";var dh=ha;var _a=class extends s{constructor(e){super(),this.editable_text=new u(e.editableText),this.author_thumbnail=y.fromResponse(e.authorThumbnail),this.submit_button=l.parseItem(e.submitButton,I),this.cancel_button=l.parseItem(e.cancelButton,I),this.placeholder=new u(e.placeholderText),this.emoji_button=l.parseItem(e.emojiButton,I),this.emoji_picker=l.parseItem(e.emojiPicker,dh)}};o(_a,"CommentDialog");_a.type="CommentDialog";var gy=_a;var ga=class extends s{constructor(e){super(),this.contents=l.parseArray(e.contents),this.view_replies=l.parseItem(e.viewReplies,I),this.hide_replies=l.parseItem(e.hideReplies,I),this.view_replies_creator_thumbnail=y.fromResponse(e.viewRepliesCreatorThumbnail),this.has_channel_owner_replied=!!e.viewRepliesCreatorThumbnail}};o(ga,"CommentReplies");ga.type="CommentReplies";var fh=ga;var xa=class extends s{constructor(e){super(),this.simplebox_avatar=y.fromResponse(e.simpleboxAvatar),this.simplebox_placeholder=new u(e.simpleboxPlaceholder)}};o(xa,"CommentsSimplebox");xa.type="CommentsSimplebox";var mh=xa;var va=class extends s{constructor(e){super(),Reflect.has(e,"teaserAvatar")&&(this.teaser_avatar=y.fromResponse(e.teaserAvatar)),Reflect.has(e,"teaserContent")&&(this.teaser_content=new u(e.teaserContent))}};o(va,"CommentsEntryPointTeaser");va.type="CommentsEntryPointTeaser";var hh=va;var ya=class extends s{constructor(e){super(),Reflect.has(e,"headerText")&&(this.header=new u(e.headerText)),Reflect.has(e,"commentCount")&&(this.comment_count=new u(e.commentCount)),(Reflect.has(e,"teaserAvatar")||Reflect.has(e,"simpleboxAvatar"))&&(this.teaser_avatar=y.fromResponse(e.teaserAvatar||e.simpleboxAvatar)),Reflect.has(e,"teaserContent")&&(this.teaser_content=new u(e.teaserContent)),Reflect.has(e,"contentRenderer")&&(this.content_renderer=l.parseItem(e.contentRenderer,[hh,mh])),Reflect.has(e,"simpleboxPlaceholder")&&(this.simplebox_placeholder=new u(e.simpleboxPlaceholder))}};o(ya,"CommentsEntryPointHeader");ya.type="CommentsEntryPointHeader";var _h=ya;var ba=class extends s{constructor(e){super(),this.title=new u(e.titleText),this.count=new u(e.countText),this.comments_count=new u(e.commentsCount),this.create_renderer=l.parseItem(e.createRenderer),this.sort_menu=l.parseItem(e.sortMenu,gt),Reflect.has(e,"customEmojis")&&(this.custom_emojis=e.customEmojis.map(i=>({emoji_id:i.emojiId,shortcuts:i.shortcuts,search_terms:i.searchTerms,image:y.fromResponse(i.image),is_custom_emoji:i.isCustomEmoji})))}};o(ba,"CommentsHeader");ba.type="CommentsHeader";var hi=ba;var wa=class extends s{constructor(e){super(),this.submit_button=l.parseItem(e.submitButton,I),this.cancel_button=l.parseItem(e.cancelButton,I),this.author_thumbnail=y.fromResponse(e.authorThumbnail),this.placeholder=new u(e.placeholderText),this.avatar_size=e.avatarSize}};o(wa,"CommentSimplebox");wa.type="CommentSimplebox";var gh=wa;var Ue,Ta=class extends s{constructor(e){super(),Ue.set(this,void 0),this.comment_id=e.commentId,this.is_pinned=!!e.pinnedText,this.keys={comment:e.commentKey,comment_surface:e.commentSurfaceKey,toolbar_state:e.toolbarStateKey,toolbar_surface:e.toolbarSurfaceKey,shared:e.sharedKey}}applyMutations(e,i,n){e&&(this.content=u.fromAttributed(e.properties.content),this.published_time=e.properties.publishedTime,this.author_is_channel_owner=!!e.author.isCreator,this.like_count=e.toolbar.likeCountNotliked?e.toolbar.likeCountNotliked:"0",this.reply_count=e.toolbar.replyCount?e.toolbar.replyCount:"0",this.is_member=!!e.author.sponsorBadgeUrl,Reflect.has(e.author,"sponsorBadgeUrl")&&(this.member_badge={url:e.author.sponsorBadgeUrl,a11y:e.author.A11y}),this.author=new D({simpleText:e.author.displayName,navigationEndpoint:e.avatar.endpoint},e.author,e.avatar.image,e.author.channelId)),i&&(this.is_hearted=i.heartState==="TOOLBAR_HEART_STATE_HEARTED",this.is_liked=i.likeState==="TOOLBAR_LIKE_STATE_LIKED",this.is_disliked=i.likeState==="TOOLBAR_LIKE_STATE_DISLIKED"),n&&!Reflect.has(n,"prepareAccountCommand")&&(this.like_command=new g(n.likeCommand),this.dislike_command=new g(n.dislikeCommand),this.unlike_command=new g(n.unlikeCommand),this.undislike_command=new g(n.undislikeCommand),this.reply_command=new g(n.replyCommand))}like(){return T(this,void 0,void 0,function*(){if(!m(this,Ue,"f"))throw new b("Actions instance not set for this comment.");if(!this.like_command)throw new b("Like command not found.");if(this.is_liked)throw new b("This comment is already liked.",{comment_id:this.comment_id});return this.like_command.call(m(this,Ue,"f"))})}dislike(){return T(this,void 0,void 0,function*(){if(!m(this,Ue,"f"))throw new b("Actions instance not set for this comment.");if(!this.dislike_command)throw new b("Dislike command not found.");if(this.is_disliked)throw new b("This comment is already disliked.",{comment_id:this.comment_id});return this.dislike_command.call(m(this,Ue,"f"))})}unlike(){return T(this,void 0,void 0,function*(){if(!m(this,Ue,"f"))throw new b("Actions instance not set for this comment.");if(!this.unlike_command)throw new b("Unlike command not found.");if(!this.is_liked)throw new b("This comment is not liked.",{comment_id:this.comment_id});return this.unlike_command.call(m(this,Ue,"f"))})}undislike(){return T(this,void 0,void 0,function*(){if(!m(this,Ue,"f"))throw new b("Actions instance not set for this comment.");if(!this.undislike_command)throw new b("Undislike command not found.");if(!this.is_disliked)throw new b("This comment is not disliked.",{comment_id:this.comment_id});return this.undislike_command.call(m(this,Ue,"f"))})}reply(e){return T(this,void 0,void 0,function*(){var i;if(!m(this,Ue,"f"))throw new b("Actions instance not set for this comment.");if(!this.reply_command)throw new b("Reply command not found.");let n=(i=this.reply_command.dialog)===null||i===void 0?void 0:i.as(Un);if(!n)throw new b("Reply dialog not found.");let r=n.reply_button;if(!r)throw new b("Reply button not found in the dialog.");if(!r.endpoint)throw new b("Reply button endpoint not found.");return r.endpoint.call(m(this,Ue,"f"),{commentText:e})})}translate(e){return T(this,void 0,void 0,function*(){var i,n,r,a,c,p;if(!m(this,Ue,"f"))throw new b("Actions instance not set for this comment.");if(!this.content)throw new b("Comment content not found.",{comment_id:this.comment_id});let _={text:this.content.toString().replace(/[^\p{L}\p{N}\p{P}\p{Z}]/gu,""),target_language:e},f=fa(22,_),x=yield m(this,Ue,"f").execute("comment/perform_comment_action",{action:f,client:"ANDROID"}),v=(n=(i=x.data.frameworkUpdates)===null||i===void 0?void 0:i.entityBatchUpdate)===null||n===void 0?void 0:n.mutations,w=(p=(c=(a=(r=v==null?void 0:v[0])===null||r===void 0?void 0:r.payload)===null||a===void 0?void 0:a.commentEntityPayload)===null||c===void 0?void 0:c.translatedContent)===null||p===void 0?void 0:p.content;return Object.assign(Object.assign({},x),{content:w})})}setActions(e){E(this,Ue,e,"f")}};o(Ta,"CommentView");Ue=new WeakMap;Ta.type="CommentView";var _i=Ta;var Wt,Zi,Ia=class extends s{constructor(e){super(),Wt.set(this,void 0),Zi.set(this,void 0),Reflect.has(e,"commentViewModel")?this.comment=l.parseItem(e.commentViewModel,_i):this.comment=l.parseItem(e.comment,Hn),this.comment_replies_data=l.parseItem(e.replies,fh),this.is_moderated_elq_comment=e.isModeratedElqComment,this.has_replies=!!this.comment_replies_data}getReplies(){return T(this,void 0,void 0,function*(){var e;if(!m(this,Wt,"f"))throw new b("Actions instance not set for this thread.");if(!this.comment_replies_data)throw new b("This comment has no replies.",this);let i=(e=this.comment_replies_data.contents)===null||e===void 0?void 0:e.firstOfType(ce);if(!i)throw new b("Replies continuation not found.");let n=yield i.endpoint.call(m(this,Wt,"f"),{parse:!0});if(!n.on_response_received_endpoints_memo)throw new b("Unexpected response.",n);return this.replies=X(n.on_response_received_endpoints_memo.getType(Hn,_i).map(r=>(r.setActions(m(this,Wt,"f")),r))),E(this,Zi,n==null?void 0:n.on_response_received_endpoints_memo.getType(ce).first(),"f"),this})}getContinuation(){return T(this,void 0,void 0,function*(){var e;if(!this.replies)throw new b("Cannot retrieve continuation because this thread's replies have not been loaded.");if(!m(this,Zi,"f"))throw new b("Continuation not found.");if(!m(this,Wt,"f"))throw new b("Actions instance not set for this thread.");let i=(e=m(this,Zi,"f").button)===null||e===void 0?void 0:e.as(I);if(!i)throw new b('"Load more" button not found.');let n=yield i.endpoint.call(m(this,Wt,"f"),{parse:!0});if(!n.on_response_received_endpoints_memo)throw new b("Unexpected response.",n);return this.replies=X(n.on_response_received_endpoints_memo.getType(Hn,_i).map(r=>(r.setActions(m(this,Wt,"f")),r))),E(this,Zi,n.on_response_received_endpoints_memo.getType(ce).first(),"f"),this})}get has_continuation(){if(!this.replies)throw new b("Cannot determine if there is a continuation because this thread's replies have not been loaded.");return!!m(this,Zi,"f")}setActions(e){E(this,Wt,e,"f")}};o(Ia,"CommentThread");Wt=new WeakMap,Zi=new WeakMap;Ia.type="CommentThread";var xh=Ia;var ka=class extends s{constructor(e){super(),this.title=new u(e.title),this.channel_id=e.channelId,this.thumbnail=y.fromResponse(e.thumbnail),this.display_name=new u(e.displayName),this.video_count=new u(e.videoCountText),this.subscriber_count=new u(e.subscriberCountText),this.endpoint=new g(e.navigationEndpoint),this.tv_banner=y.fromResponse(e.tvBanner),this.menu=l.parseItem(e.menu,F)}};o(ka,"CompactChannel");ka.type="CompactChannel";var xy=ka;var Sa=class extends s{constructor(e){super(),this.title=new u(e.title).toString(),this.endpoint=new g(e.navigationEndpoint),this.style=e.style}};o(Sa,"CompactLink");Sa.type="CompactLink";var zn=Sa;var Ca=class extends s{constructor(e){super(),this.thumbnail=y.fromResponse(e.thumbnail)}};o(Ca,"PlaylistCustomThumbnail");Ca.type="PlaylistCustomThumbnail";var Gn=Ca;var Ea=class extends s{constructor(e){super(),this.thumbnail=y.fromResponse(e.thumbnail)}};o(Ea,"PlaylistVideoThumbnail");Ea.type="PlaylistVideoThumbnail";var $n=Ea;var Pa=class extends s{constructor(e){var i;super(),this.id=e.playlistId,this.title=new u(e.title),this.author=!((i=e.shortBylineText)===null||i===void 0)&&i.simpleText?new u(e.shortBylineText):new D(e.longBylineText,e.ownerBadges,null),this.thumbnails=y.fromResponse(e.thumbnail||{thumbnails:e.thumbnails.map(n=>n.thumbnails).flat(1)}),this.video_count=new u(e.thumbnailText),this.video_count_short=new u(e.videoCountShortText),this.first_videos=l.parseArray(e.videos),this.share_url=e.shareUrl||null,this.menu=l.parseItem(e.menu),this.badges=l.parseArray(e.ownerBadges),this.endpoint=new g(e.navigationEndpoint),this.thumbnail_overlays=l.parseArray(e.thumbnailOverlays),Reflect.has(e,"thumbnailRenderer")&&(this.thumbnail_renderer=l.parseItem(e.thumbnailRenderer,[$n,Gn])||void 0),Reflect.has(e,"viewPlaylistText")&&(this.view_playlist=new u(e.viewPlaylistText))}};o(Pa,"Playlist");Pa.type="Playlist";var Et=Pa;var Na=class extends Et{constructor(e){super(e)}};o(Na,"CompactMix");Na.type="CompactMix";var vy=Na;var Ra=class extends s{constructor(e){var i;super();let n=((i=e.thumbnailOverlays.find(a=>a.thumbnailOverlayTimeStatusRenderer))===null||i===void 0?void 0:i.thumbnailOverlayTimeStatusRenderer.text)||"N/A";this.id=e.videoId,this.title=new u(e.title),this.top_metadata_items=new u(e.topMetadataItems),this.thumbnails=y.fromResponse(e.thumbnail),this.thumbnail_overlays=l.parseArray(e.thumbnailOverlays),this.author=new D(e.shortBylineText);let r=e.lengthText?new u(e.lengthText).toString():new u(n).toString();this.duration={text:r,seconds:ke(r)},this.endpoint=new g(e.navigationEndpoint),this.badges=l.parseArray(e.badges),this.use_vertical_poster=e.useVerticalPoster,this.menu=l.parseItem(e.menu,F)}};o(Ra,"CompactMovie");Ra.type="CompactMovie";var yy=Ra;var Aa=class extends Et{constructor(e){super(e)}};o(Aa,"CompactPlaylist");Aa.type="CompactPlaylist";var by=Aa;var Va=class extends s{constructor(e){super(),this.title=new u(e.title),this.description=new u(e.description),this.video_count=new u(e.videoCountText),this.endpoint=new g(e.navigationEndpoint),this.thumbnail=y.fromResponse(e.thumbnail)}};o(Va,"CompactStation");Va.type="CompactStation";var wy=Va;var Ma=class extends s{constructor(e){super(),this.title=new u(e.title),this.confirm_button=l.parseItem(e.confirmButton,I),this.cancel_button=l.parseItem(e.cancelButton,I),this.dialog_messages=e.dialogMessages.map(i=>new u(i))}};o(Ma,"ConfirmDialog");Ma.type="ConfirmDialog";var Ty=Ma;var Da=class extends s{constructor(e){super(),this.metadata_rows=e.metadataRows.map(i=>{var n;return{metadata_parts:(n=i.metadataParts)===null||n===void 0?void 0:n.map(r=>({text:u.fromAttributed(r.text)}))}}),this.delimiter=e.delimiter}};o(Da,"ContentMetadataView");Da.type="ContentMetadataView";var Kn=Da;var Ba=class extends s{constructor(e){super(),this.text=new u(e.text)}};o(Ba,"Message");Ba.type="Message";var gi=Ba;var La=class extends s{constructor(e){super(),this.availability_message=l.parseItem(e.availabilityMessage,gi)}};o(La,"ConversationBar");La.type="ConversationBar";var Iy=La;var Oa=class extends s{constructor(e){super(),this.copy_button=l.parseItem(e.copyButton,I),this.short_url=e.shortUrl,this.style=e.style}};o(Oa,"CopyLink");Oa.type="CopyLink";var vh=Oa;var Fa=class extends s{constructor(e){var i,n;super(),this.avatar=l.parseItem(e.avatar,_m),this.a11y_label=e.a11yLabel,!((n=(i=e.rendererContext)===null||i===void 0?void 0:i.commandContext)===null||n===void 0)&&n.onTap&&(this.on_tap_endpoint=new g(e.rendererContext.commandContext.onTap))}};o(Fa,"DecoratedAvatarView");Fa.type="DecoratedAvatarView";var yh=Fa;var Ya=class extends s{constructor(e){super(),this.time_range_start_millis=e.timeRangeStartMillis,this.marker_duration_millis=e.markerDurationMillis,this.heat_marker_intensity_score_normalized=e.heatMarkerIntensityScoreNormalized}};o(Ya,"HeatMarker");Ya.type="HeatMarker";var bh=Ya;var Ua=class extends s{constructor(e){super(),this.max_height_dp=e.maxHeightDp,this.min_height_dp=e.minHeightDp,this.show_hide_animation_duration_millis=e.showHideAnimationDurationMillis,this.heat_markers=l.parseArray(e.heatMarkers,bh),this.heat_markers_decorations=l.parseArray(e.heatMarkersDecorations)}};o(Ua,"Heatmap");Ua.type="Heatmap";var wh=Ua;var ja=class extends s{constructor(e){super(),this.marker_key=e.key,this.value={},Reflect.has(e,"value")&&(Reflect.has(e.value,"heatmap")&&(this.value.heatmap=l.parseItem(e.value.heatmap,wh)),Reflect.has(e.value,"chapters")&&(this.value.chapters=l.parseArray(e.value.chapters,Qm)))}};o(ja,"Marker");ja.type="Marker";var Wa=class extends s{constructor(e){var i;super(),this.markers_map=X(((i=e.markersMap)===null||i===void 0?void 0:i.map(n=>new ja(n)))||[])}};o(Wa,"MultiMarkersPlayerBar");Wa.type="MultiMarkersPlayerBar";var Th=Wa;var Ja=class extends s{constructor(e){super(),this.player_bar=l.parseItem(e.playerBar,Th),this.player_bar_action_button=l.parseItem(e.playerBarActionButton,I)}};o(Ja,"DecoratedPlayerBar");Ja.type="DecoratedPlayerBar";var Ih=Ja;var Ha=class extends s{constructor(e){super(),this.title=new u(e.title),this.description=new u(e.description),this.endpoint=new g(e.navigationEndpoint),this.large_form_factor_background_thumbnail=l.parseItem(e.largeFormFactorBackgroundThumbnail),this.small_form_factor_background_thumbnail=l.parseItem(e.smallFormFactorBackgroundThumbnail),this.scrim_color_values=e.scrimColorValues,this.min_panel_display_duration_ms=e.minPanelDisplayDurationMs,this.min_video_play_duration_ms=e.minVideoPlayDurationMs,this.scrim_duration=e.scrimDuration,this.metadata_order=e.metadataOrder,this.panel_layout=e.panelLayout}};o(Ha,"DefaultPromoPanel");Ha.type="DefaultPromoPanel";var ky=Ha;var za=class extends s{constructor(e){var i,n,r,a,c,p;if(super(),this.description=u.fromAttributed(e.description),this.max_lines=parseInt(e.maxLines),this.truncation_text=u.fromAttributed(e.truncationText),this.always_show_truncation_text=!!e.alwaysShowTruncationText,!((r=(n=(i=e.rendererContext.commandContext)===null||i===void 0?void 0:i.onTap)===null||n===void 0?void 0:n.innertubeCommand)===null||r===void 0)&&r.showEngagementPanelEndpoint){let d=(p=(c=(a=e.rendererContext.commandContext)===null||a===void 0?void 0:a.onTap)===null||c===void 0?void 0:c.innertubeCommand)===null||p===void 0?void 0:p.showEngagementPanelEndpoint;this.more_endpoint={show_engagement_panel_endpoint:{engagement_panel:l.parseItem(d.engagementPanel,pi),engagement_panel_popup_type:d.engagementPanelPresentationConfigs.engagementPanelPopupPresentationConfig.popupType,identifier:{surface:d.identifier.surface,tag:d.identifier.tag}}}}}};o(za,"DescriptionPreviewView");za.type="DescriptionPreviewView";var kh=za;var Ga=class extends s{constructor(e){super(),this.text=new u(e.didYouMean).toString(),this.corrected_query=new u(e.correctedQuery),this.endpoint=new g(e.navigationEndpoint||e.correctedQueryEndpoint)}};o(Ga,"DidYouMean");Ga.type="DidYouMean";var Sy=Ga;var $a=class extends s{constructor(e){super(),this.default_button=l.parseItem(e.defaultButtonViewModel,St),this.toggled_button=l.parseItem(e.toggledButtonViewModel,St),this.identifier=e.identifier,this.is_toggling_disabled=e.isTogglingDisabled}};o($a,"ToggleButtonView");$a.type="ToggleButtonView";var xi=$a;var Ka=class extends s{constructor(e){super(),this.toggle_button=l.parseItem(e.toggleButtonViewModel,xi),this.dislike_entity_key=e.dislikeEntityKey}};o(Ka,"DislikeButtonView");Ka.type="DislikeButtonView";var Sh=Ka;var qa=class extends s{constructor(e){super(),this.style=e.style,this.size=e.size,this.endpoint=new g(e.command),this.target_id=e.targetId}};o(qa,"DownloadButton");qa.type="DownloadButton";var Ch=qa;var Xa=class extends s{constructor(e){super(),this.text=u.fromAttributed(e.text),this.max_lines=parseInt(e.maxLines)}};o(Xa,"DynamicTextView");Xa.type="DynamicTextView";var Eh=Xa;var en=class extends s{constructor(e){var i;super(),Reflect.has(e,"type")&&Reflect.has(e.type,"textType")&&(this.text=(i=e.type.textType.text)===null||i===void 0?void 0:i.content),this.properties=e.properties,Reflect.has(e,"childElements")&&(this.child_elements=e.childElements.map(n=>new en(n)))}};o(en,"ChildElement");en.type="ChildElement";var Ph=en;var tn=class extends s{constructor(e){var i;if(super(),Reflect.has(e,"elementRenderer"))return l.parseItem(e,tn);let n=e.newElement.type.componentType;this.model=l.parseItem(n==null?void 0:n.model),Reflect.has(e,"newElement")&&Reflect.has(e.newElement,"childElements")&&(this.child_elements=X(((i=e.newElement.childElements)===null||i===void 0?void 0:i.map(r=>new Ph(r)))||[]))}};o(tn,"Element");tn.type="Element";var qn=tn;var Qa=class extends s{constructor(e){super(),this.title=new u(e.title),this.first_option=l.parseItem(e.firstOption),this.menu=l.parseItem(e.menu,F)}};o(Qa,"EmergencyOnebox");Qa.type="EmergencyOnebox";var Cy=Qa;var Za=class extends s{constructor(e){super(),this.category_id=e.categoryId,this.title=new u(e.title),this.emoji_ids=e.emojiIds,this.image_loading_lazy=!!e.imageLoadingLazy,this.category_type=e.categoryType}};o(Za,"EmojiPickerCategory");Za.type="EmojiPickerCategory";var Ey=Za;var eu=class extends s{constructor(e){var i;super(),this.category_id=e.categoryId,Reflect.has(e,"icon")&&(this.icon_type=(i=e.icon)===null||i===void 0?void 0:i.iconType),this.tooltip=e.tooltip}};o(eu,"EmojiPickerCategoryButton");eu.type="EmojiPickerCategoryButton";var Py=eu;var tu=class extends s{constructor(e){super(),this.category_id=e.categoryId,this.title=new u(e.title),this.upsell=new u(e.upsell),this.emoji_tooltip=e.emojiTooltip,this.endpoint=new g(e.command),this.emoji_ids=e.emojiIds}};o(tu,"EmojiPickerUpsellCategory");tu.type="EmojiPickerUpsellCategory";var Ny=tu;var iu=class extends s{constructor(e){super(),this.elements=l.parseArray(e.elements),this.start_ms=e.startMs}};o(iu,"Endscreen");iu.type="Endscreen";var Nh=iu;var nu=class extends s{constructor(e){super(),this.style=e.style,this.title=new u(e.title),this.endpoint=new g(e.endpoint),Reflect.has(e,"image")&&(this.image=y.fromResponse(e.image)),Reflect.has(e,"icon")&&(this.icon=y.fromResponse(e.icon)),Reflect.has(e,"metadata")&&(this.metadata=new u(e.metadata)),Reflect.has(e,"callToAction")&&(this.call_to_action=new u(e.callToAction)),Reflect.has(e,"hovercardButton")&&(this.hovercard_button=l.parseItem(e.hovercardButton)),Reflect.has(e,"isSubscribe")&&(this.is_subscribe=!!e.isSubscribe),Reflect.has(e,"playlistLength")&&(this.playlist_length=new u(e.playlistLength)),Reflect.has(e,"thumbnailOverlays")&&(this.thumbnail_overlays=l.parseArray(e.thumbnailOverlays)),this.left=parseFloat(e.left),this.width=parseFloat(e.width),this.top=parseFloat(e.top),this.aspect_ratio=parseFloat(e.aspectRatio),this.start_ms=parseFloat(e.startMs),this.end_ms=parseFloat(e.endMs),this.id=e.id}};o(nu,"EndscreenElement");nu.type="EndscreenElement";var Ry=nu;var ou=class extends s{constructor(e){super(),this.id=e.playlistId,this.title=new u(e.title),this.author=new u(e.longBylineText),this.endpoint=new g(e.navigationEndpoint),this.thumbnails=y.fromResponse(e.thumbnail),this.video_count=new u(e.videoCountText)}};o(ou,"EndScreenPlaylist");ou.type="EndScreenPlaylist";var Rh=ou;var ru=class extends s{constructor(e){super(),this.id=e.videoId,this.title=new u(e.title),this.thumbnails=y.fromResponse(e.thumbnail),this.thumbnail_overlays=l.parseArray(e.thumbnailOverlays),this.author=new D(e.shortBylineText,e.ownerBadges),this.endpoint=new g(e.navigationEndpoint),this.short_view_count=new u(e.shortViewCountText),this.badges=l.parseArray(e.badges),this.duration={text:new u(e.lengthText).toString(),seconds:e.lengthInSeconds}}};o(ru,"EndScreenVideo");ru.type="EndScreenVideo";var Ah=ru;var su=class extends s{constructor(e){super(),this.disclaimer=new u(e.disclaimer),this.info_icon={icon_type:e.infoIcon.iconType},this.usage_scenario=e.usageScenario}};o(su,"EomSettingsDisclaimer");su.type="EomSettingsDisclaimer";var Ay=su;var au=class extends s{constructor(e){super(),this.title=e.title,this.endpoint=new g(e.endpoint),this.selected=e.selected,this.content=l.parseItem(e.content)}};o(au,"ExpandableTab");au.type="ExpandableTab";var Xn=au;var uu=class extends s{constructor(e){super(),this.items=l.parseArray(e.items)}get contents(){return this.items}};o(uu,"ExpandedShelfContents");uu.type="ExpandedShelfContents";var Vy=uu;var lu=class extends s{constructor(e){super(),this.dialog_message=new u(e.dialogMessage),this.confirm_label=new u(e.confirmLabel)}};o(lu,"FancyDismissibleDialog");lu.type="FancyDismissibleDialog";var My=lu;var cu=class extends s{constructor(e){super(),this.contents=l.parseArray(e.contents,Ye)}};o(cu,"FeedFilterChipBar");cu.type="FeedFilterChipBar";var vt=cu;var pu=class extends s{constructor(e){super(),this.title=new u(e.title),this.subtitle=new u(e.subtitle),this.endpoint=new g(e.impressionEndpoint),this.apply_modernized_style=e.applyModernizedStyle,this.trim_style=e.trimStyle,this.background_style=e.backgroundStyle}};o(pu,"FeedNudge");pu.type="FeedNudge";var Dy=pu;var du=class extends s{constructor(e){super(),this.title=new u(e.title)}};o(du,"FeedTabbedHeader");du.type="FeedTabbedHeader";var Vh=du;var fu=class extends s{constructor(e){super(),this.actions_rows=e.actionsRows.map(i=>({actions:l.parseArray(i.actions,[St,xi])})),this.style=e.style}};o(fu,"FlexibleActionsView");fu.type="FlexibleActionsView";var Mh=fu;var mu=class extends s{constructor(e){super(),this.title=new u(e.title),this.box_art=y.fromResponse(e.boxArt),this.box_art_overlay_text=new u(e.boxArtOverlayText),this.endpoint=new g(e.endpoint),this.is_official_box_art=!!e.isOfficialBoxArt}};o(mu,"GameDetails");mu.type="GameDetails";var By=mu;var hu=class extends s{constructor(e){var i,n,r;super(),this.items=l.parseArray(e.items),Reflect.has(e,"header")&&(this.header=l.parseItem(e.header)),Reflect.has(e,"isCollapsible")&&(this.is_collapsible=e.isCollapsible),Reflect.has(e,"visibleRowCount")&&(this.visible_row_count=e.visibleRowCount),Reflect.has(e,"targetId")&&(this.target_id=e.targetId),this.continuation=((r=(n=(i=e.continuations)===null||i===void 0?void 0:i[0])===null||n===void 0?void 0:n.nextContinuationData)===null||r===void 0?void 0:r.continuation)||null}get contents(){return this.items}};o(hu,"Grid");hu.type="Grid";var Ly=hu;var _u=class extends s{constructor(e){super(),this.id=e.channelId,this.author=new D(Object.assign(Object.assign({},e.title),{navigationEndpoint:e.navigationEndpoint}),e.ownerBadges,e.thumbnail),this.subscribers=new u(e.subscriberCountText),this.video_count=new u(e.videoCountText),this.endpoint=new g(e.navigationEndpoint),this.subscribe_button=l.parseItem(e.subscribeButton)}};o(_u,"GridChannel");_u.type="GridChannel";var Dh=_u;var gu=class extends s{constructor(e){super(),this.title=new u(e.title)}};o(gu,"GridHeader");gu.type="GridHeader";var Oy=gu;var xu=class extends s{constructor(e){var i,n;super(),this.id=e.playlistId,this.title=new u(e.title),this.author=!((i=e.shortBylineText)===null||i===void 0)&&i.simpleText?new u(e.shortBylineText):!((n=e.longBylineText)===null||n===void 0)&&n.simpleText?new u(e.longBylineText):null,this.thumbnails=y.fromResponse(e.thumbnail),this.video_count=new u(e.videoCountText),this.video_count_short=new u(e.videoCountShortText),this.endpoint=new g(e.navigationEndpoint),this.secondary_endpoint=new g(e.secondaryNavigationEndpoint),this.thumbnail_overlays=l.parseArray(e.thumbnailOverlays)}};o(xu,"GridMix");xu.type="GridMix";var Fy=xu;var vu=class extends s{constructor(e){var i;super();let n=(i=e.thumbnailOverlays.find(r=>r.hasOwnProperty("thumbnailOverlayTimeStatusRenderer")))===null||i===void 0?void 0:i.thumbnailOverlayTimeStatusRenderer;this.id=e.videoId,this.title=new u(e.title),this.thumbnails=y.fromResponse(e.thumbnail),this.duration=e.lengthText?new u(e.lengthText):n!=null&&n.text?new u(n.text):null,this.endpoint=new g(e.navigationEndpoint),this.badges=l.parseArray(e.badges,ze),this.metadata=new u(e.metadata),this.thumbnail_overlays=l.parseArray(e.thumbnailOverlays)}};o(vu,"GridMovie");vu.type="GridMovie";var Yy=vu;var yu=class extends s{constructor(e){var i;super(),this.id=e.playlistId,this.title=new u(e.title),Reflect.has(e,"shortBylineText")&&(this.author=new D(e.shortBylineText,e.ownerBadges)),this.badges=l.parseArray(e.ownerBadges),this.endpoint=new g(e.navigationEndpoint),this.view_playlist=new u(e.viewPlaylistText),this.thumbnails=y.fromResponse(e.thumbnail),this.thumbnail_renderer=l.parseItem(e.thumbnailRenderer),this.sidebar_thumbnails=[].concat(...((i=e.sidebarThumbnails)===null||i===void 0?void 0:i.map(n=>y.fromResponse(n)))||[])||null,this.video_count=new u(e.thumbnailText),this.video_count_short=new u(e.videoCountShortText)}};o(yu,"GridPlaylist");yu.type="GridPlaylist";var Bh=yu;var bu=class extends s{constructor(e){super(),this.thumbnail=y.fromResponse(e.thumbnail)}};o(bu,"ShowCustomThumbnail");bu.type="ShowCustomThumbnail";var Lh=bu;var wu=class extends s{constructor(e){super(),Reflect.has(e,"text")&&(this.text=new u(e.text)),Reflect.has(e,"icon")&&Reflect.has(e.icon,"iconType")&&(this.icon_type=e.icon.iconType)}};o(wu,"ThumbnailOverlayBottomPanel");wu.type="ThumbnailOverlayBottomPanel";var Oh=wu;var Tu=class extends s{constructor(e){super(),this.title=new u(e.title),this.thumbnail_renderer=ie(e.thumbnailRenderer,Lh),this.endpoint=new g(e.navigationEndpoint),this.long_byline_text=new u(e.longBylineText),this.thumbnail_overlays=Ve(e.thumbnailOverlays,Oh),this.author=new D(e.shortBylineText,void 0)}};o(Tu,"GridShow");Tu.type="GridShow";var Uy=Tu;var Iu=class extends s{constructor(e){var i,n;super();let r=(i=e.thumbnailOverlays.find(a=>a.hasOwnProperty("thumbnailOverlayTimeStatusRenderer")))===null||i===void 0?void 0:i.thumbnailOverlayTimeStatusRenderer;this.id=e.videoId,this.title=new u(e.title),this.thumbnails=y.fromResponse(e.thumbnail),this.thumbnail_overlays=l.parseArray(e.thumbnailOverlays),this.rich_thumbnail=l.parseItem(e.richThumbnail),this.published=new u(e.publishedTimeText),this.duration=e.lengthText?new u(e.lengthText):r!=null&&r.text?new u(r.text):null,this.author=e.shortBylineText&&new D(e.shortBylineText,e.ownerBadges),this.views=new u(e.viewCountText),this.short_view_count=new u(e.shortViewCountText),this.endpoint=new g(e.navigationEndpoint),this.menu=l.parseItem(e.menu,F),Reflect.has(e,"buttons")&&(this.buttons=l.parseArray(e.buttons)),Reflect.has(e,"upcomingEventData")&&(this.upcoming=new Date(Number(`${e.upcomingEventData.startTime}000`)),this.upcoming_text=new u(e.upcomingEventData.upcomingEventText),this.is_reminder_set=!!(!((n=e.upcomingEventData)===null||n===void 0)&&n.isReminderSet))}get is_upcoming(){return Boolean(this.upcoming&&this.upcoming>new Date)}};o(Iu,"GridVideo");Iu.type="GridVideo";var Fh=Iu;var ku=class extends s{constructor(e){super(),this.title=new u(e.formattedTitle),this.endpoint=new g(e.navigationEndpoint||e.serviceEndpoint),Reflect.has(e,"icon")&&Reflect.has(e.icon,"iconType")&&(this.icon_type=e.icon.iconType),Reflect.has(e,"thumbnail")&&(this.thumbnails=y.fromResponse(e.thumbnail)),Reflect.has(e,"badges")&&(this.badges=e.badges),this.is_primary=!!e.isPrimary}};o(ku,"GuideEntry");ku.type="GuideEntry";var nn=ku;var Su=class extends s{constructor(e){super(),this.expander_item=ie(e.expanderItem,nn),this.collapser_item=ie(e.collapserItem,nn),this.expandable_items=Ve(e.expandableItems)}};o(Su,"GuideCollapsibleEntry");Su.type="GuideCollapsibleEntry";var jy=Su;var Cu=class extends s{constructor(e){super(),this.header_entry=ie(e.headerEntry),this.expander_icon=e.expanderIcon.iconType,this.collapser_icon=e.collapserIcon.iconType,this.section_items=Ve(e.sectionItems)}};o(Cu,"GuideCollapsibleSectionEntry");Cu.type="GuideCollapsibleSectionEntry";var Wy=Cu;var Eu=class extends nn{constructor(e){super(e.entryRenderer.guideEntryRenderer),this.always_show=!!e.alwaysShow}};o(Eu,"GuideDownloadsEntry");Eu.type="GuideDownloadsEntry";var Jy=Eu;var Pu=class extends s{constructor(e){super(),Reflect.has(e,"formattedTitle")&&(this.title=new u(e.formattedTitle)),this.items=Ve(e.items)}};o(Pu,"GuideSection");Pu.type="GuideSection";var Qn=Pu;var Nu=class extends Qn{};o(Nu,"GuideSubscriptionsSection");Nu.type="GuideSubscriptionsSection";var Yh=Nu;var Ru=class extends s{constructor(e){super(),this.hashtag=new u(e.hashtag),this.hashtag_info=new u(e.hashtagInfoText)}};o(Ru,"HashtagHeader");Ru.type="HashtagHeader";var Uh=Ru;var Au=class extends s{constructor(e){super(),this.hashtag=new u(e.hashtag),this.hashtag_info_text=new u(e.hashtagInfoText),this.hashtag_thumbnail=y.fromResponse(e.hashtagThumbnail),this.endpoint=new g(e.onTapCommand),this.hashtag_background_color=e.hashtagBackgroundColor,this.hashtag_video_count=new u(e.hashtagVideoCount),this.hashtag_channel_count=new u(e.hashtagChannelCount)}};o(Au,"HashtagTile");Au.type="HashtagTile";var Hy=Au;var Vu=class extends s{constructor(e){super(),this.thumbnails=y.fromResponse(e.thumbnail),this.on_tap_endpoint=new g(e.onTap)}};o(Vu,"HeroPlaylistThumbnail");Vu.type="HeroPlaylistThumbnail";var zy=Vu;var Mu=class extends s{constructor(e){super(),e.thumbnail&&(this.thumbnail={image:y.fromResponse(e.thumbnail.image),endpoint:new g(e.thumbnail.onTap),on_long_press_endpoint:new g(e.thumbnail.onLongPress),content_mode:e.thumbnail.contentMode,crop_options:e.thumbnail.cropOptions}),this.background_image={image:y.fromResponse(e.backgroundImage.image),gradient_image:y.fromResponse(e.backgroundImage.gradientImage)},this.strapline=e.strapline,this.title=e.title,this.description=e.description,this.cta={icon_name:e.cta.iconName,title:e.cta.title,endpoint:new g(e.cta.onTap),accessibility_text:e.cta.accessibilityText,state:e.cta.state},this.text_on_tap_endpoint=new g(e.textOnTap)}};o(Mu,"Panel");Mu.type="Panel";var Du=class extends s{constructor(e){super(),this.panels=X(e.highlightsCarousel.panels.map(i=>new Mu(i)))}};o(Du,"HighlightsCarousel");Du.type="HighlightsCarousel";var Gy=Du;var Bu=class extends s{constructor(e){super(),this.suggestion=new u(e.suggestion),this.endpoint=new g(e.navigationEndpoint),Reflect.has(e,"icon")&&(this.icon_type=e.icon.iconType),Reflect.has(e,"serviceEndpoint")&&(this.service_endpoint=new g(e.serviceEndpoint))}};o(Bu,"SearchSuggestion");Bu.type="SearchSuggestion";var jh=Bu;var Lu=class extends jh{constructor(e){super(e)}};o(Lu,"HistorySuggestion");Lu.type="HistorySuggestion";var $y=Lu;var Ou=class extends s{constructor(e){super(),this.items=l.parseArray(e.items),this.previous_button=l.parseItem(e.previousButton,I),this.next_button=l.parseItem(e.nextButton,I)}get contents(){return this.items}};o(Ou,"HorizontalMovieList");Ou.type="HorizontalMovieList";var Ky=Ou;var Fu=class extends s{constructor(e){var i;super(),this.icon_type=(i=e.icon)===null||i===void 0?void 0:i.iconType,Reflect.has(e,"tooltip")&&(this.tooltip=new u(e.tooltip).toString()),this.endpoint=new g(e.navigationEndpoint)}};o(Fu,"IconLink");Fu.type="IconLink";var Wh=Fu;var Yu=class extends s{constructor(e){super(),this.image=y.fromResponse(e.image),this.style=e.style}};o(Yu,"ImageBannerView");Yu.type="ImageBannerView";var Jh=Yu;var Uu=class extends s{constructor(e){super(),this.including_results_for=new u(e.includingResultsFor),this.corrected_query=new u(e.correctedQuery),this.corrected_query_endpoint=new g(e.correctedQueryEndpoint),this.search_only_for=Reflect.has(e,"searchOnlyFor")?new u(e.searchOnlyFor):void 0,this.original_query=Reflect.has(e,"originalQuery")?new u(e.originalQuery):void 0,this.original_query_endpoint=Reflect.has(e,"originalQueryEndpoint")?new g(e.originalQueryEndpoint):void 0}};o(Uu,"IncludingResultsFor");Uu.type="IncludingResultsFor";var qy=Uu;var ju=class extends s{constructor(e){super(),this.title=new u(e.title),this.source=new u(e.source),Reflect.has(e,"paragraphs")&&(this.paragraphs=e.paragraphs.map(i=>new u(i))),Reflect.has(e,"attributedParagraphs")&&(this.attributed_paragraphs=e.attributedParagraphs.map(i=>u.fromAttributed(i))),this.thumbnail=y.fromResponse(e.thumbnail),this.source_endpoint=new g(e.sourceEndpoint),this.truncate_paragraphs=!!e.truncateParagraphs,this.background=e.background,Reflect.has(e,"inlineLinkIcon")&&Reflect.has(e.inlineLinkIcon,"iconType")&&(this.inline_link_icon_type=e.inlineLinkIcon.iconType)}};o(ju,"InfoPanelContent");ju.type="InfoPanelContent";var Hh=ju;var Wu=class extends s{constructor(e){var i;super(),this.title=new u(e.title),this.menu=l.parseItem(e.menu,F),this.content=l.parseItem(e.content,Hh),e.headerEndpoint&&(this.header_endpoint=new g(e.headerEndpoint)),this.background=e.background,this.title_style=e.titleStyle,Reflect.has(e,"icon")&&(this.icon_type=(i=e.icon)===null||i===void 0?void 0:i.iconType)}};o(Wu,"InfoPanelContainer");Wu.type="InfoPanelContainer";var zh=Wu;var Ju=class extends s{constructor(e){super(),this.header_type=e.type,this.title=new u(e.title),this.description=new u(e.description),this.metadata=new u(e.metadata),this.badges=l.parseArray(e.badges,ze),this.box_art=y.fromResponse(e.boxArt),this.banner=y.fromResponse(e.banner),this.buttons=l.parseArray(e.buttons,[Se,I]),this.auto_generated=new u(e.autoGenerated)}};o(Ju,"InteractiveTabbedHeader");Ju.type="InteractiveTabbedHeader";var Gh=Ju;var Hu=class extends s{constructor(e){super(),this.title=new u(e.title)}};o(Hu,"ItemSectionHeader");Hu.type="ItemSectionHeader";var Zn=Hu;var zu=class extends s{constructor(e){super(),this.title=new u(e.title),this.selected=!!e.selected,this.endpoint=new g(e.endpoint)}};o(zu,"ItemSectionTab");zu.type="Tab";var $h=zu;var Gu=class extends s{constructor(e){super(),this.title=new u(e.title),this.tabs=l.parseArray(e.tabs,$h),Reflect.has(e,"endItems")&&(this.end_items=l.parseArray(e.endItems))}};o(Gu,"ItemSectionTabbedHeader");Gu.type="ItemSectionTabbedHeader";var eo=Gu;var $u=class extends s{constructor(e){super(),this.filter_menu=l.parseItem(e.filterMenu,on.SortFilterSubMenu)}};o($u,"SortFilterHeader");$u.type="SortFilterHeader";var Kh=$u;var Ku=class extends s{constructor(e){var i,n,r;super(),this.header=l.parseItem(e.header,[hi,Zn,eo,Kh,vt]),this.contents=l.parseArray(e.contents),(e.targetId||e.sectionIdentifier)&&(this.target_id=e.targetId||e.sectionIdentifier),e.continuations&&(this.continuation=(r=(n=(i=e.continuations)===null||i===void 0?void 0:i.at(0))===null||n===void 0?void 0:n.nextContinuationData)===null||r===void 0?void 0:r.continuation)}};o(Ku,"ItemSection");Ku.type="ItemSection";var tt=Ku;var qu=class extends s{constructor(e){super(),this.target={video_id:e.target.videoId},this.like_status=e.likeStatus,this.likes_allowed=e.likesAllowed,Reflect.has(e,"serviceEndpoints")&&(this.endpoints=e.serviceEndpoints.map(i=>new g(i)))}};o(qu,"LikeButton");qu.type="LikeButton";var qh=qu;var Xu=class extends s{constructor(e){super(),this.toggle_button=l.parseItem(e.toggleButtonViewModel,xi),this.like_status_entity_key=e.likeStatusEntityKey,this.like_status_entity={key:e.likeStatusEntity.key,like_status:e.likeStatusEntity.likeStatus}}};o(Xu,"LikeButtonView");Xu.type="LikeButtonView";var Xh=Xu;var Qu=class extends s{constructor(e){var i,n;super(),this.header=l.parseItem(e.header),this.initial_display_state=e.initialDisplayState,this.continuation=(n=(i=e.continuations[0])===null||i===void 0?void 0:i.reloadContinuationData)===null||n===void 0?void 0:n.continuation,this.client_messages={reconnect_message:new u(e.clientMessages.reconnectMessage),unable_to_reconnect_message:new u(e.clientMessages.unableToReconnectMessage),fatal_error:new u(e.clientMessages.fatalError),reconnected_message:new u(e.clientMessages.reconnectedMessage),generic_error:new u(e.clientMessages.genericError)},this.is_replay=!!e.isReplay}};o(Qu,"LiveChat");Qu.type="LiveChat";var Qh=Qu;var Zu=class extends s{constructor(e){super(),this.text=new u(e.text),Reflect.has(e,"icon")&&Reflect.has(e.icon,"iconType")&&(this.icon_type=e.icon.iconType),this.context_menu_button=l.parseItem(e.contextMenuButton,I)}};o(Zu,"LiveChatBannerHeader");Zu.type="LiveChatBannerHeader";var Zh=Zu;var el=class extends s{constructor(e){super(),this.header=l.parseItem(e.header,Zh),this.contents=l.parseItem(e.contents),this.action_id=e.actionId,this.viewer_is_creator=e.viewerIsCreator,this.target_id=e.targetId,this.is_stackable=e.isStackable,this.background_type=e.backgroundType}};o(el,"LiveChatBanner");el.type="LiveChatBanner";var e_=el;var tl=class extends s{constructor(e){super(),this.banner=l.parseItem(e.bannerRenderer,e_)}};o(tl,"AddBannerToLiveChatCommand");tl.type="AddBannerToLiveChatCommand";var Xy=tl;var il=class extends s{constructor(e){super(),this.item=l.parseItem(e.item),Reflect.has(e,"clientId")&&(this.client_id=e.clientId)}};o(il,"AddChatItemAction");il.type="AddChatItemAction";var t_=il;var nl=class extends s{constructor(e){super(),this.item=l.parseItem(e.item),this.duration_sec=e.durationSec}};o(nl,"AddLiveChatTickerItemAction");nl.type="AddLiveChatTickerItemAction";var Qy=nl;var ol=class extends s{constructor(e){super(),this.client_assigned_id=e.clientAssignedId}};o(ol,"DimChatItemAction");ol.type="DimChatItemAction";var Zy=ol;var rl=class extends s{constructor(e){super(),this.menu_endpoint=new g(e.contextMenuEndpoint),this.moderation_buttons=l.parseArray(e.moderationButtons,I),this.auto_moderated_item=l.parseItem(e.autoModeratedItem),this.header_text=new u(e.headerText),this.timestamp=Math.floor(parseInt(e.timestampUsec)/1e3),this.id=e.id}};o(rl,"LiveChatAutoModMessage");rl.type="LiveChatAutoModMessage";var eb=rl;var sl=class extends s{constructor(e){super(),this.poll_question=new u(e.pollQuestion),this.author_photo=y.fromResponse(e.authorPhoto),this.choices=e.pollChoices.map(i=>({option_id:i.pollOptionId,text:new u(i.text).toString()})),this.collapsed_state_entity_key=e.collapsedStateEntityKey,this.live_chat_poll_state_entity_key=e.liveChatPollStateEntityKey,this.context_menu_button=l.parseItem(e.contextMenuButton,I)}};o(sl,"LiveChatBannerPoll");sl.type="LiveChatBannerPoll";var tb=sl;var al=class extends s{constructor(e){super(),this.id=e.id,this.timestamp=Math.floor(parseInt(e.timestampUsec)/1e3),this.header_subtext=new u(e.headerSubtext),this.author=new D(e.authorName,e.authorBadges,e.authorPhoto,e.authorExternalChannelId),this.menu_endpoint=new g(e.contextMenuEndpoint)}};o(al,"LiveChatMembershipItem");al.type="LiveChatMembershipItem";var ib=al;var ul=class extends s{constructor(e){super(),this.message=new u(e.message),this.author=new D(e.authorName,e.authorBadges,e.authorPhoto,e.authorExternalChannelId),this.header_background_color=e.headerBackgroundColor,this.header_text_color=e.headerTextColor,this.body_background_color=e.bodyBackgroundColor,this.body_text_color=e.bodyTextColor,this.purchase_amount=new u(e.purchaseAmountText).toString(),this.menu_endpoint=new g(e.contextMenuEndpoint),this.timestamp=Math.floor(parseInt(e.timestampUsec)/1e3),this.timestamp_text=new u(e.timestampText).toString(),this.id=e.id}};o(ul,"LiveChatPaidMessage");ul.type="LiveChatPaidMessage";var nb=ul;var ll=class extends s{constructor(e){super(),this.id=e.id,this.author=new D(e.authorName,e.authorBadges,e.authorPhoto,e.authorExternalChannelId),this.money_chip_background_color=e.moneyChipBackgroundColor,this.money_chip_text_color=e.moneyChipTextColor,this.background_color=e.backgroundColor,this.author_name_text_color=e.authorNameTextColor,this.sticker=y.fromResponse(e.sticker),this.purchase_amount=new u(e.purchaseAmountText).toString(),this.menu_endpoint=new g(e.contextMenuEndpoint),this.context_menu=this.menu_endpoint,this.timestamp=Math.floor(parseInt(e.timestampUsec)/1e3)}};o(ll,"LiveChatPaidSticker");ll.type="LiveChatPaidSticker";var ob=ll;var cl=class extends s{constructor(e){super(),this.id=e.id,this.timestamp=Math.floor(parseInt(e.timestampUsec)/1e3)}};o(cl,"LiveChatPlaceholderItem");cl.type="LiveChatPlaceholderItem";var rb=cl;var pl=class extends s{constructor(e){super(),this.title=e.title,this.accessibility_title=e.accessibilityTitle,this.thumbnail=y.fromResponse(e.thumbnail),this.price=e.price,this.vendor_name=e.vendorName,this.from_vendor_text=e.fromVendorText,this.information_button=l.parseItem(e.informationButton),this.endpoint=new g(e.onClickCommand),this.creator_message=e.creatorMessage,this.creator_name=e.creatorName,this.author_photo=y.fromResponse(e.authorPhoto),this.information_dialog=l.parseItem(e.informationDialog),this.is_verified=e.isVerified,this.creator_custom_message=new u(e.creatorCustomMessage)}};o(pl,"LiveChatProductItem");pl.type="LiveChatProductItem";var sb=pl;var dl=class extends s{constructor(e){super(),this.message=new u(e.message),Reflect.has(e,"icon")&&Reflect.has(e.icon,"iconType")&&(this.icon_type=e.icon.iconType)}};o(dl,"LiveChatRestrictedParticipation");dl.type="LiveChatRestrictedParticipation";var ab=dl;var rn=class extends s{constructor(e){super(),this.message=new u(e.message),this.inline_action_buttons=l.parseArray(e.inlineActionButtons,I),this.timestamp=Math.floor(parseInt(e.timestampUsec)/1e3),this.id=e.id}};o(rn,"LiveChatMessageBase");rn.type="LiveChatMessageBase";var fl=class extends rn{constructor(e){super(e),this.author=new D(e.authorName,e.authorBadges,e.authorPhoto,e.authorExternalChannelId),this.menu_endpoint=new g(e.contextMenuEndpoint)}};o(fl,"LiveChatTextMessage");fl.type="LiveChatTextMessage";var ub=fl;var ml=class extends s{constructor(e){var i,n;super(),this.author=new D(e.authorName,e.authorBadges,e.authorPhoto,e.authorExternalChannelId),this.amount=new u(e.amount),this.duration_sec=e.durationSec,this.full_duration_sec=e.fullDurationSec,this.show_item=l.parseItem((n=(i=e.showItemEndpoint)===null||i===void 0?void 0:i.showLiveChatItemEndpoint)===null||n===void 0?void 0:n.renderer),this.show_item_endpoint=new g(e.showItemEndpoint),this.id=e.id}};o(ml,"LiveChatTickerPaidMessageItem");ml.type="LiveChatTickerPaidMessageItem";var i_=ml;var hl=class extends i_{};o(hl,"LiveChatTickerPaidStickerItem");hl.type="LiveChatTickerPaidStickerItem";var lb=hl;var _l=class extends s{constructor(e){super(),this.id=e.id,this.detail=new u(e.detailText),this.author=new D(e.authorName,e.authorBadges,e.sponsorPhoto,e.authorExternalChannelId),this.duration_sec=e.durationSec}};o(_l,"LiveChatTickerSponsorItem");_l.type="LiveChatTickerSponsorItem";var cb=_l;var gl=class extends rn{constructor(e){super(e),Reflect.has(e,"icon")&&Reflect.has(e.icon,"iconType")&&(this.icon_type=e.icon.iconType),this.action_button=l.parseItem(e.actionButton)}};o(gl,"LiveChatViewerEngagementMessage");gl.type="LiveChatViewerEngagementMessage";var pb=gl;var xl=class extends s{constructor(e){super(),this.poll_question=new u(e.pollQuestion),this.thumbnails=y.fromResponse(e.thumbnail),this.metadata=new u(e.metadataText),this.live_chat_poll_type=e.liveChatPollType,this.context_menu_button=l.parseItem(e.contextMenuButton,I)}};o(xl,"PollHeader");xl.type="PollHeader";var db=xl;var vl=class extends s{constructor(e){super(),this.id=e.id,this.contents=l.parse(e.contents),this.target_id=e.targetId}};o(vl,"LiveChatActionPanel");vl.type="LiveChatActionPanel";var n_=vl;var yl=class extends s{constructor(e){super(),this.deleted_state_message=new u(e.deletedStateMessage),this.target_item_id=e.targetItemId}};o(yl,"MarkChatItemAsDeletedAction");yl.type="MarkChatItemAsDeletedAction";var fb=yl;var bl=class extends s{constructor(e){super(),this.deleted_state_message=new u(e.deletedStateMessage),this.external_channel_id=e.externalChannelId}};o(bl,"MarkChatItemsByAuthorAsDeletedAction");bl.type="MarkChatItemsByAuthorAsDeletedAction";var mb=bl;var wl=class extends s{constructor(e){super(),this.target_action_id=e.targetActionId}};o(wl,"RemoveBannerForLiveChatCommand");wl.type="RemoveBannerForLiveChatCommand";var hb=wl;var Tl=class extends s{constructor(e){super(),this.target_item_id=e.targetItemId}};o(Tl,"RemoveChatItemAction");Tl.type="RemoveChatItemAction";var _b=Tl;var Il=class extends s{constructor(e){super(),this.external_channel_id=e.externalChannelId}};o(Il,"RemoveChatItemByAuthorAction");Il.type="RemoveChatItemByAuthorAction";var gb=Il;var kl=class extends s{constructor(e){super(),this.target_item_id=e.targetItemId,this.replacement_item=l.parseItem(e.replacementItem)}};o(kl,"ReplaceChatItemAction");kl.type="ReplaceChatItemAction";var xb=kl;var Sl=class extends s{constructor(e){var i;super(),this.actions=l.parseArray((i=e.actions)===null||i===void 0?void 0:i.map(n=>(delete n.clickTrackingParams,n))),this.video_offset_time_msec=e.videoOffsetTimeMsec}};o(Sl,"ReplayChatItemAction");Sl.type="ReplayChatItemAction";var vb=Sl;var Cl=class extends s{constructor(e){super(),this.panel_to_show=l.parseItem(e.panelToShow,n_)}};o(Cl,"ShowLiveChatActionPanelAction");Cl.type="ShowLiveChatActionPanelAction";var yb=Cl;var El=class extends s{constructor(e){super(),this.dialog=l.parseItem(e.dialog)}};o(El,"ShowLiveChatDialogAction");El.type="ShowLiveChatDialogAction";var bb=El;var Pl=class extends s{constructor(e){super(),this.tooltip=l.parseItem(e.tooltip)}};o(Pl,"ShowLiveChatTooltipCommand");Pl.type="ShowLiveChatTooltipCommand";var wb=Pl;var Nl=class extends s{constructor(e){super(),this.date_text=new u(e.dateText).toString()}};o(Nl,"UpdateDateTextAction");Nl.type="UpdateDateTextAction";var o_=Nl;var Rl=class extends s{constructor(e){super(),this.description=new u(e.description)}};o(Rl,"UpdateDescriptionAction");Rl.type="UpdateDescriptionAction";var r_=Rl;var Al=class extends s{constructor(e){super(),this.poll_to_update=l.parseItem(e.pollToUpdate)}};o(Al,"UpdateLiveChatPollAction");Al.type="UpdateLiveChatPollAction";var Tb=Al;var Vl=class extends s{constructor(e){super(),this.title=new u(e.title)}};o(Vl,"UpdateTitleAction");Vl.type="UpdateTitleAction";var s_=Vl;var Ml=class extends s{constructor(e){super(),this.default_text=new u(e.defaultText).toString(),this.toggled_text=new u(e.toggledText).toString(),this.button_id=e.buttonId}};o(Ml,"UpdateToggleButtonTextAction");Ml.type="UpdateToggleButtonTextAction";var a_=Ml;var Dl=class extends s{constructor(e){super();let i=e.viewCount.videoViewCountRenderer;this.view_count=new u(i.viewCount),this.extra_short_view_count=new u(i.extraShortViewCount),this.original_view_count=parseInt(i.originalViewCount),this.unlabeled_view_count_value=new u(i.unlabeledViewCountValue),this.is_live=i.isLive}};o(Dl,"UpdateViewershipAction");Dl.type="UpdateViewershipAction";var u_=Dl;var Bl=class extends ze{constructor(e){super(e),this.custom_thumbnail=y.fromResponse(e.customThumbnail)}};o(Bl,"LiveChatAuthorBadge");Bl.type="LiveChatAuthorBadge";var Ib=Bl;var Ll=class extends s{constructor(e){super(),this.confirm_button=l.parseItem(e.confirmButton,I),this.dialog_messages=e.dialogMessages.map(i=>new u(i))}};o(Ll,"LiveChatDialog");Ll.type="LiveChatDialog";var kb=Ll;var Ol=class extends s{constructor(e){super(),this.overflow_menu=l.parseItem(e.overflowMenu,F),this.collapse_button=l.parseItem(e.collapseButton,I),this.view_selector=l.parseItem(e.viewSelector,gt)}};o(Ol,"LiveChatHeader");Ol.type="LiveChatHeader";var l_=Ol;var Fl=class extends s{constructor(e){super(),this.max_items_to_display=e.maxItemsToDisplay,this.more_comments_below_button=l.parseItem(e.moreCommentsBelowButton,I)}};o(Fl,"LiveChatItemList");Fl.type="LiveChatItemList";var c_=Fl;var Yl=class extends s{constructor(e){super(),this.author_name=new u(e.authorName),this.author_photo=y.fromResponse(e.authorPhoto),this.send_button=l.parseItem(e.sendButton,I),this.target_id=e.targetId}};o(Yl,"LiveChatMessageInput");Yl.type="LiveChatMessageInput";var Sb=Yl;var Ul=class extends s{constructor(e){super(),this.name=new u(e.authorName),this.photo=y.fromResponse(e.authorPhoto),this.badges=l.parseArray(e.authorBadges)}};o(Ul,"LiveChatParticipant");Ul.type="LiveChatParticipant";var p_=Ul;var jl=class extends s{constructor(e){super(),this.title=new u(e.title),this.participants=l.parseArray(e.participants,p_)}};o(jl,"LiveChatParticipantsList");jl.type="LiveChatParticipantsList";var d_=jl;var Wl=class extends s{constructor(e){super(),this.title=u.fromAttributed(e.title),this.metadata=l.parseItem(e.metadata,Kn)}};o(Wl,"LockupMetadataView");Wl.type="LockupMetadataView";var f_=Wl;var Jl=class extends s{constructor(e){super(),this.content_image=l.parseItem(e.contentImage,oh),this.metadata=l.parseItem(e.metadata,f_),this.content_id=e.contentId,this.content_type=e.contentType.replace("LOCKUP_CONTENT_TYPE_",""),this.on_tap_endpoint=new g(e.rendererContext.commandContext.onTap)}};o(Jl,"LockupView");Jl.type="LockupView";var m_=Jl;var Hl=class extends I{constructor(e){super(e)}};o(Hl,"MenuNavigationItem");Hl.type="MenuNavigationItem";var h_=Hl;var zl=class extends I{constructor(e){super(e)}};o(zl,"MenuServiceItem");zl.type="MenuServiceItem";var vi=zl;var Gl=class extends s{constructor(e){super(),this.items=l.parseArray(e.items,[h_,vi])}};o(Gl,"MenuPopup");Gl.type="MenuPopup";var Cb=Gl;var $l=class extends s{constructor(e){super(),this.has_separator=!!e.hasSeparator,this.endpoint=new g(e.navigationEndpoint||e.serviceEndpoint)}};o($l,"MenuServiceItemDownload");$l.type="MenuServiceItemDownload";var Eb=$l;var Kl=class extends s{constructor(e){super(),this.header=l.parseItem(e.header),this.sections=l.parseArray(e.sections),this.style=e.style}};o(Kl,"MultiPageMenu");Kl.type="MultiPageMenu";var Pb=Kl;var ql=class extends s{constructor(e){super(),this.items=l.parse(e.items)}get contents(){return this.items}};o(ql,"MultiPageMenuNotificationSection");ql.type="MultiPageMenuNotificationSection";var Nb=ql;var Xl=class extends s{constructor(e){super()}};o(Xl,"MusicMenuItemDivider");Xl.type="MusicMenuItemDivider";var __=Xl;var Ql=class extends s{constructor(e){super(),this.title=new u(e.title).toString(),this.form_item_entity_key=e.formItemEntityKey,Reflect.has(e,"selectedIcon")&&(this.selected_icon_type=e.selectedIcon.iconType),Reflect.has(e,"selectedCommand")&&(this.endpoint=new g(e.selectedCommand)),this.selected=!!this.endpoint}};o(Ql,"MusicMultiSelectMenuItem");Ql.type="MusicMultiSelectMenuItem";var to=Ql;var Zl=class extends s{constructor(e){var i;super(),Reflect.has(e,"title")&&Reflect.has(e.title,"musicMenuTitleRenderer")&&(this.title=new u((i=e.title.musicMenuTitleRenderer)===null||i===void 0?void 0:i.primaryText)),this.options=l.parseArray(e.options,[to,__])}};o(Zl,"MusicMultiSelectMenu");Zl.type="MusicMultiSelectMenu";var g_=Zl;var ec=class extends s{constructor(e){super(),this.title=new u(e.title),this.buttons=l.parseArray(e.buttons,I)}};o(ec,"SimpleMenuHeader");ec.type="SimpleMenuHeader";var x_=ec;var tc=class extends s{constructor(e){super(),this.title=e.title,this.description=e.description,this.thumbnails=y.fromResponse(e.thumbnail),this.price=e.price,this.vendor_name=e.vendorName,this.button_text=e.buttonText,this.button_accessibility_text=e.buttonAccessibilityText,this.from_vendor_text=e.fromVendorText,this.additional_fees_text=e.additionalFeesText,this.region_format=e.regionFormat,this.endpoint=new g(e.buttonCommand)}};o(tc,"MerchandiseItem");tc.type="MerchandiseItem";var Rb=tc;var ic=class extends s{constructor(e){super(),this.title=e.title,this.menu=l.parseItem(e.actionButton),this.items=l.parseArray(e.items)}get contents(){return this.items}};o(ic,"MerchandiseShelf");ic.type="MerchandiseShelf";var v_=ic;var nc=class extends s{constructor(e){super(),this.title=new u(e.title),this.contents=e.contents.map(i=>new u(i))}};o(nc,"MetadataRow");nc.type="MetadataRow";var Ab=nc;var oc=class extends s{constructor(e){super(),this.rows=l.parseArray(e.rows),this.collapsed_item_count=e.collapsedItemCount}};o(oc,"MetadataRowContainer");oc.type="MetadataRowContainer";var y_=oc;var rc=class extends s{constructor(e){super(),this.content=new u(e.content),this.has_divider_line=e.hasDividerLine}};o(rc,"MetadataRowHeader");rc.type="MetadataRowHeader";var Vb=rc;var sc=class extends s{constructor(e){super(),this.section_list=l.parseItem(e)}};o(sc,"MetadataScreen");sc.type="MetadataScreen";var Mb=sc;var ac=class extends s{constructor(e){super(),this.url_canonical=e.urlCanonical,this.title=e.title,this.description=e.description,this.thumbnail=y.fromResponse(e.thumbnail),this.site_name=e.siteName,this.app_name=e.appName,this.android_package=e.androidPackage,this.ios_app_store_id=e.iosAppStoreId,this.ios_app_arguments=e.iosAppArguments,this.og_type=e.ogType,this.url_applinks_web=e.urlApplinksWeb,this.url_applinks_ios=e.urlApplinksIos,this.url_applinks_android=e.urlApplinksAndroid,this.url_twitter_ios=e.urlTwitterIos,this.url_twitter_android=e.urlTwitterAndroid,this.twitter_card_type=e.twitterCardType,this.twitter_site_handle=e.twitterSiteHandle,this.schema_dot_org_type=e.schemaDotOrgType,this.noindex=e.noindex,this.is_unlisted=e.unlisted,this.is_family_safe=e.familySafe,this.tags=e.tags,this.available_countries=e.availableCountries}};o(ac,"MicroformatData");ac.type="MicroformatData";var yi=ac;var uc=class extends Et{constructor(e){super(e)}};o(uc,"Mix");uc.type="Mix";var Db=uc;var lc=class extends s{constructor(e){super(),this.title=new u(e.title),this.content=new u(e.content),this.button=l.parseItem(e.button,I)}};o(lc,"ModalWithTitleAndButton");lc.type="ModalWithTitleAndButton";var Bb=lc;var cc=class extends s{constructor(e){var i,n,r;super();let a=((i=e.thumbnailOverlays.find(c=>c.thumbnailOverlayTimeStatusRenderer))===null||i===void 0?void 0:i.thumbnailOverlayTimeStatusRenderer.text)||"N/A";this.id=e.videoId,this.title=new u(e.title),Reflect.has(e,"descriptionSnippet")&&(this.description_snippet=new u(e.descriptionSnippet)),this.top_metadata_items=new u(e.topMetadataItems),this.thumbnails=y.fromResponse(e.thumbnail),this.thumbnail_overlays=l.parseArray(e.thumbnailOverlays),this.author=new D(e.longBylineText,e.ownerBadges,(r=(n=e.channelThumbnailSupportedRenderers)===null||n===void 0?void 0:n.channelThumbnailWithLinkRenderer)===null||r===void 0?void 0:r.thumbnail),this.duration={text:e.lengthText?new u(e.lengthText).toString():new u(a).toString(),seconds:ke(e.lengthText?new u(e.lengthText).toString():new u(a).toString())},this.endpoint=new g(e.navigationEndpoint),this.badges=l.parseArray(e.badges),this.use_vertical_poster=e.useVerticalPoster,this.show_action_menu=e.showActionMenu,this.menu=l.parseItem(e.menu,F)}};o(cc,"Movie");cc.type="Movie";var Lb=cc;var pc=class extends s{constructor(e){var i;return super(),(i=e.movingThumbnailDetails)===null||i===void 0?void 0:i.thumbnails.map(n=>new y(n)).sort((n,r)=>r.width-n.width)}};o(pc,"MovingThumbnail");pc.type="MovingThumbnail";var Ob=pc;var dc=class extends s{constructor(e){super(),this.title=new u(e.title)}};o(dc,"MusicCardShelfHeaderBasic");dc.type="MusicCardShelfHeaderBasic";var b_=dc;var fc=class extends s{constructor(e){super(),this.icon_type=e.icon.iconType,this.label=e.accessibilityData.accessibilityData.label}};o(fc,"MusicInlineBadge");fc.type="MusicInlineBadge";var io=fc;var mc=class extends s{constructor(e){var i,n;super(),this.endpoint=new g(e.playNavigationEndpoint),this.play_icon_type=e.playIcon.iconType,this.pause_icon_type=e.pauseIcon.iconType,Reflect.has(e,"accessibilityPlayData")&&(this.play_label=(i=e.accessibilityPlayData.accessibilityData)===null||i===void 0?void 0:i.label),Reflect.has(e,"accessibilityPauseData")&&(this.pause_label=(n=e.accessibilityPauseData.accessibilityData)===null||n===void 0?void 0:n.label),this.icon_color=e.iconColor}};o(mc,"MusicPlayButton");mc.type="MusicPlayButton";var no=mc;var hc=class extends s{constructor(e){super(),this.content=l.parseItem(e.content,no),this.content_position=e.contentPosition,this.display_style=e.displayStyle}};o(hc,"MusicItemThumbnailOverlay");hc.type="MusicItemThumbnailOverlay";var Pt=hc;var _c=class extends s{constructor(e){super(),this.contents=y.fromResponse(e.thumbnail)}};o(_c,"MusicThumbnail");_c.type="MusicThumbnail";var Ne=_c;var gc=class extends s{constructor(e){super(),this.thumbnail=l.parseItem(e.thumbnail,Ne),this.title=new u(e.title),this.subtitle=new u(e.subtitle),this.buttons=l.parseArray(e.buttons,I),this.menu=l.parseItem(e.menu,F),this.on_tap=new g(e.onTap),this.header=l.parseItem(e.header,b_),Reflect.has(e,"endIcon")&&Reflect.has(e.endIcon,"iconType")&&(this.end_icon_type=e.endIcon.iconType),this.subtitle_badges=l.parseArray(e.subtitleBadges,io),this.thumbnail_overlay=l.parseItem(e.thumbnailOverlay,Pt),Reflect.has(e,"contents")&&(this.contents=l.parseArray(e.contents))}};o(gc,"MusicCardShelf");gc.type="MusicCardShelf";var Fb=gc;var xc=class extends s{constructor(e){super(),this.title=new u(e.title),Reflect.has(e,"strapline")&&(this.strapline=new u(e.strapline)),Reflect.has(e,"thumbnail")&&(this.thumbnail=l.parseItem(e.thumbnail,Ne)),Reflect.has(e,"moreContentButton")&&(this.more_content=l.parseItem(e.moreContentButton,I)),Reflect.has(e,"endIcons")&&(this.end_icons=l.parseArray(e.endIcons,Wh))}};o(xc,"MusicCarouselShelfBasicHeader");xc.type="MusicCarouselShelfBasicHeader";var w_=xc;var vc=class extends s{constructor(e){super(),this.thumbnail=l.parseItem(e.thumbnail,Ne),this.overlay=l.parseItem(e.overlay,Pt),this.on_tap=new g(e.onTap),this.menu=l.parseItem(e.menu,F),this.subtitle=new u(e.subtitle),this.title=new u(e.title),Reflect.has(e,"secondTitle")&&(this.second_title=new u(e.secondTitle)),Reflect.has(e,"description")&&(this.description=new u(e.description)),Reflect.has(e,"displayStyle")&&(this.display_style=e.displayStyle)}};o(vc,"MusicMultiRowListItem");vc.type="MusicMultiRowListItem";var T_=vc;var yc=class extends s{constructor(e){super(),this.button_text=new u(e.buttonText).toString(),this.endpoint=new g(e.clickCommand)}};o(yc,"MusicNavigationButton");yc.type="MusicNavigationButton";var I_=yc;var bc=class extends s{constructor(e){super(),this.title=new u(e.text),this.display_priority=e.displayPriority}};o(bc,"MusicResponsiveListItemFixedColumn");bc.type="musicResponsiveListItemFlexColumnRenderer";var k_=bc;var wc=class extends s{constructor(e){super(),this.title=new u(e.text),this.display_priority=e.displayPriority}};o(wc,"MusicResponsiveListItemFlexColumn");wc.type="MusicResponsiveListItemFlexColumn";var S_=wc;var it,oo,Nx,jb,Yb,Ub,Wb,Jb,Hb,zb,Gb,$b,Tc=class extends s{constructor(e){var i,n,r,a,c,p;super(),it.add(this),oo.set(this,void 0),this.flex_columns=l.parseArray(e.flexColumns,S_),this.fixed_columns=l.parseArray(e.fixedColumns,k_),E(this,oo,{video_id:((i=e==null?void 0:e.playlistItemData)===null||i===void 0?void 0:i.videoId)||null,playlist_set_video_id:((n=e==null?void 0:e.playlistItemData)===null||n===void 0?void 0:n.playlistSetVideoId)||null},"f"),Reflect.has(e,"navigationEndpoint")&&(this.endpoint=new g(e.navigationEndpoint));let d=(p=(c=(a=(r=this.endpoint)===null||r===void 0?void 0:r.payload)===null||a===void 0?void 0:a.browseEndpointContextSupportedConfigs)===null||c===void 0?void 0:c.browseEndpointContextMusicConfig)===null||p===void 0?void 0:p.pageType;switch(d||this.flex_columns.find(f=>{var x,v,w,k;return((k=(w=(v=(x=f.title.endpoint)===null||x===void 0?void 0:x.payload)===null||v===void 0?void 0:v.browseEndpointContextSupportedConfigs)===null||w===void 0?void 0:w.browseEndpointContextMusicConfig)===null||k===void 0?void 0:k.pageType)==="MUSIC_PAGE_TYPE_NON_MUSIC_AUDIO_TRACK_PAGE"})&&(d="MUSIC_PAGE_TYPE_NON_MUSIC_AUDIO_TRACK_PAGE"),d){case"MUSIC_PAGE_TYPE_ALBUM":this.item_type="album",m(this,it,"m",Gb).call(this);break;case"MUSIC_PAGE_TYPE_PLAYLIST":this.item_type="playlist",m(this,it,"m",$b).call(this);break;case"MUSIC_PAGE_TYPE_ARTIST":case"MUSIC_PAGE_TYPE_USER_CHANNEL":this.item_type="artist",m(this,it,"m",Wb).call(this);break;case"MUSIC_PAGE_TYPE_LIBRARY_ARTIST":this.item_type="library_artist",m(this,it,"m",Jb).call(this);break;case"MUSIC_PAGE_TYPE_NON_MUSIC_AUDIO_TRACK_PAGE":this.item_type="non_music_track",m(this,it,"m",Hb).call(this);break;case"MUSIC_PAGE_TYPE_PODCAST_SHOW_DETAIL_PAGE":this.item_type="podcast_show",m(this,it,"m",zb).call(this);break;default:this.flex_columns[1]?m(this,it,"m",jb).call(this):m(this,it,"m",Nx).call(this)}Reflect.has(e,"index")&&(this.index=new u(e.index)),Reflect.has(e,"thumbnail")&&(this.thumbnail=l.parseItem(e.thumbnail,Ne)),Reflect.has(e,"badges")&&(this.badges=l.parseArray(e.badges)),Reflect.has(e,"menu")&&(this.menu=l.parseItem(e.menu,F)),Reflect.has(e,"overlay")&&(this.overlay=l.parseItem(e.overlay,Pt))}get thumbnails(){var e;return((e=this.thumbnail)===null||e===void 0?void 0:e.contents)||[]}};o(Tc,"MusicResponsiveListItem");oo=new WeakMap,it=new WeakSet,Nx=o(function(){this.title=this.flex_columns.first().title.toString(),this.endpoint?this.item_type="endpoint":this.item_type="unknown"},"_MusicResponsiveListItem_parseOther"),jb=o(function(){var e,i,n,r,a,c,p;switch((p=(c=(a=(r=(n=(i=(e=this.flex_columns.at(0))===null||e===void 0?void 0:e.title.runs)===null||i===void 0?void 0:i.at(0))===null||n===void 0?void 0:n.endpoint)===null||r===void 0?void 0:r.payload)===null||a===void 0?void 0:a.watchEndpointMusicSupportedConfigs)===null||c===void 0?void 0:c.watchEndpointMusicConfig)===null||p===void 0?void 0:p.musicVideoType){case"MUSIC_VIDEO_TYPE_UGC":case"MUSIC_VIDEO_TYPE_OMV":this.item_type="video",m(this,it,"m",Ub).call(this);break;case"MUSIC_VIDEO_TYPE_ATV":this.item_type="song",m(this,it,"m",Yb).call(this);break;default:m(this,it,"m",Nx).call(this)}},"_MusicResponsiveListItem_parseVideoOrSong"),Yb=o(function(){var e,i,n,r,a,c,p,d,_,f,x,v,w,k,S;this.id=m(this,oo,"f").video_id||((i=(e=this.endpoint)===null||e===void 0?void 0:e.payload)===null||i===void 0?void 0:i.videoId),this.title=this.flex_columns.first().title.toString();let P=((a=(r=(n=this.flex_columns.at(1))===null||n===void 0?void 0:n.title.runs)===null||r===void 0?void 0:r.find(B=>/^\d+$/.test(B.text.replace(/:/g,""))))===null||a===void 0?void 0:a.text)||((p=(c=this.fixed_columns.first())===null||c===void 0?void 0:c.title)===null||p===void 0?void 0:p.toString());P&&(this.duration={text:P,seconds:ke(P)});let A=((_=(d=this.flex_columns.at(1))===null||d===void 0?void 0:d.title.runs)===null||_===void 0?void 0:_.find(B=>je(B)&&B.endpoint&&B.endpoint.payload.browseId.startsWith("MPR")))||((x=(f=this.flex_columns.at(2))===null||f===void 0?void 0:f.title.runs)===null||x===void 0?void 0:x.find(B=>je(B)&&B.endpoint&&B.endpoint.payload.browseId.startsWith("MPR")));A&&je(A)&&(this.album={id:(w=(v=A.endpoint)===null||v===void 0?void 0:v.payload)===null||w===void 0?void 0:w.browseId,name:A.text,endpoint:A.endpoint});let M=(S=(k=this.flex_columns.at(1))===null||k===void 0?void 0:k.title.runs)===null||S===void 0?void 0:S.filter(B=>je(B)&&B.endpoint&&B.endpoint.payload.browseId.startsWith("UC"));M&&(this.artists=M.map(B=>{var $,te;return{name:B.text,channel_id:je(B)?(te=($=B.endpoint)===null||$===void 0?void 0:$.payload)===null||te===void 0?void 0:te.browseId:void 0,endpoint:je(B)?B.endpoint:void 0}}))},"_MusicResponsiveListItem_parseSong"),Ub=o(function(){var e,i,n,r,a,c,p,d,_,f;this.id=m(this,oo,"f").video_id,this.title=this.flex_columns.first().title.toString(),this.views=(n=(i=(e=this.flex_columns.at(1))===null||e===void 0?void 0:e.title.runs)===null||i===void 0?void 0:i.find(w=>w.text.match(/(.*?) views/)))===null||n===void 0?void 0:n.toString();let x=(a=(r=this.flex_columns.at(1))===null||r===void 0?void 0:r.title.runs)===null||a===void 0?void 0:a.filter(w=>je(w)&&w.endpoint&&w.endpoint.payload.browseId.startsWith("UC"));x&&(this.authors=x.map(w=>{var k,S;return{name:w.text,channel_id:je(w)?(S=(k=w.endpoint)===null||k===void 0?void 0:k.payload)===null||S===void 0?void 0:S.browseId:void 0,endpoint:je(w)?w.endpoint:void 0}}));let v=((p=(c=this.flex_columns[1].title.runs)===null||c===void 0?void 0:c.find(w=>/^\d+$/.test(w.text.replace(/:/g,""))))===null||p===void 0?void 0:p.text)||((f=(_=(d=this.fixed_columns.first())===null||d===void 0?void 0:d.title.runs)===null||_===void 0?void 0:_.find(w=>/^\d+$/.test(w.text.replace(/:/g,""))))===null||f===void 0?void 0:f.text);v&&(this.duration={text:v,seconds:ke(v)})},"_MusicResponsiveListItem_parseVideo"),Wb=o(function(){var e,i,n,r,a,c;this.id=(i=(e=this.endpoint)===null||e===void 0?void 0:e.payload)===null||i===void 0?void 0:i.browseId,this.name=this.flex_columns.first().title.toString(),this.subtitle=(n=this.flex_columns.at(1))===null||n===void 0?void 0:n.title,this.subscribers=((c=(a=(r=this.subtitle)===null||r===void 0?void 0:r.runs)===null||a===void 0?void 0:a.find(p=>/^(\d*\.)?\d+[M|K]? subscribers?$/i.test(p.text)))===null||c===void 0?void 0:c.text)||""},"_MusicResponsiveListItem_parseArtist"),Jb=o(function(){var e,i,n,r;this.name=this.flex_columns.first().title.toString(),this.subtitle=(e=this.flex_columns.at(1))===null||e===void 0?void 0:e.title,this.song_count=((r=(n=(i=this.subtitle)===null||i===void 0?void 0:i.runs)===null||n===void 0?void 0:n.find(a=>/^\d+(,\d+)? songs?$/i.test(a.text)))===null||r===void 0?void 0:r.text)||""},"_MusicResponsiveListItem_parseLibraryArtist"),Hb=o(function(){var e,i;this.id=m(this,oo,"f").video_id||((i=(e=this.endpoint)===null||e===void 0?void 0:e.payload)===null||i===void 0?void 0:i.videoId),this.title=this.flex_columns.first().title.toString()},"_MusicResponsiveListItem_parseNonMusicTrack"),zb=o(function(){var e,i;this.id=(i=(e=this.endpoint)===null||e===void 0?void 0:e.payload)===null||i===void 0?void 0:i.browseId,this.title=this.flex_columns.first().title.toString()},"_MusicResponsiveListItem_parsePodcastShow"),Gb=o(function(){var e,i,n,r,a,c,p,d,_;this.id=(i=(e=this.endpoint)===null||e===void 0?void 0:e.payload)===null||i===void 0?void 0:i.browseId,this.title=this.flex_columns.first().title.toString();let f=(r=(n=this.flex_columns.at(1))===null||n===void 0?void 0:n.title.runs)===null||r===void 0?void 0:r.find(x=>je(x)&&x.endpoint&&x.endpoint.payload.browseId.startsWith("UC"));f&&je(f)&&(this.author={name:f.text,channel_id:(c=(a=f.endpoint)===null||a===void 0?void 0:a.payload)===null||c===void 0?void 0:c.browseId,endpoint:f.endpoint}),this.year=(_=(d=(p=this.flex_columns.at(1))===null||p===void 0?void 0:p.title.runs)===null||d===void 0?void 0:d.find(x=>/^[12][0-9]{3}$/.test(x.text)))===null||_===void 0?void 0:_.text},"_MusicResponsiveListItem_parseAlbum"),$b=o(function(){var e,i,n,r,a,c,p,d;this.id=(i=(e=this.endpoint)===null||e===void 0?void 0:e.payload)===null||i===void 0?void 0:i.browseId,this.title=this.flex_columns.first().title.toString();let _=(r=(n=this.flex_columns.at(1))===null||n===void 0?void 0:n.title.runs)===null||r===void 0?void 0:r.find(x=>x.text.match(/\d+ (song|songs)/));this.item_count=_?_.text:void 0;let f=(c=(a=this.flex_columns.at(1))===null||a===void 0?void 0:a.title.runs)===null||c===void 0?void 0:c.find(x=>je(x)&&x.endpoint&&x.endpoint.payload.browseId.startsWith("UC"));f&&je(f)&&(this.author={name:f.text,channel_id:(d=(p=f.endpoint)===null||p===void 0?void 0:p.payload)===null||d===void 0?void 0:d.browseId,endpoint:f.endpoint})},"_MusicResponsiveListItem_parsePlaylist");Tc.type="MusicResponsiveListItem";var bi=Tc;var Ic=class extends s{constructor(e){var i,n,r,a,c,p,d,_,f,x,v,w,k,S,P,A,M,B,$,te,ue,pe;switch(super(),this.title=new u(e.title),this.endpoint=new g(e.navigationEndpoint),this.id=((n=(i=this.endpoint)===null||i===void 0?void 0:i.payload)===null||n===void 0?void 0:n.browseId)||((a=(r=this.endpoint)===null||r===void 0?void 0:r.payload)===null||a===void 0?void 0:a.videoId),this.subtitle=new u(e.subtitle),this.badges=l.parse(e.subtitleBadges),(_=(d=(p=(c=this.endpoint)===null||c===void 0?void 0:c.payload)===null||p===void 0?void 0:p.browseEndpointContextSupportedConfigs)===null||d===void 0?void 0:d.browseEndpointContextMusicConfig)===null||_===void 0?void 0:_.pageType){case"MUSIC_PAGE_TYPE_ARTIST":this.item_type="artist";break;case"MUSIC_PAGE_TYPE_PLAYLIST":this.item_type="playlist";break;case"MUSIC_PAGE_TYPE_ALBUM":this.item_type="album";break;default:((x=(f=this.endpoint)===null||f===void 0?void 0:f.metadata)===null||x===void 0?void 0:x.api_url)==="/next"?this.item_type="endpoint":!((v=this.subtitle.runs)===null||v===void 0)&&v[0]?this.subtitle.runs[0].text!=="Song"?this.item_type="video":this.item_type="song":this.endpoint?this.item_type="endpoint":this.item_type="unknown";break}if(this.item_type=="artist")this.subscribers=((k=(w=this.subtitle.runs)===null||w===void 0?void 0:w.find(Y=>/^(\d*\.)?\d+[M|K]? subscribers?$/i.test(Y.text)))===null||k===void 0?void 0:k.text)||"";else if(this.item_type=="playlist"){let Y=(S=this.subtitle.runs)===null||S===void 0?void 0:S.find(V=>V.text.match(/\d+ songs|song/));this.item_count=Y?Y.text:null}else if(this.item_type=="album"){let Y=(P=this.subtitle.runs)===null||P===void 0?void 0:P.filter(V=>{var q,oe;return(oe=(q=V.endpoint)===null||q===void 0?void 0:q.payload)===null||oe===void 0?void 0:oe.browseId.startsWith("UC")});Y&&(this.artists=Y.map(V=>{var q,oe;return{name:V.text,channel_id:(oe=(q=V.endpoint)===null||q===void 0?void 0:q.payload)===null||oe===void 0?void 0:oe.browseId,endpoint:V.endpoint}})),this.year=(A=this.subtitle.runs)===null||A===void 0?void 0:A.slice(-1)[0].text,isNaN(Number(this.year))&&delete this.year}else if(this.item_type=="video"){this.views=((B=(M=this===null||this===void 0?void 0:this.subtitle.runs)===null||M===void 0?void 0:M.find(V=>V==null?void 0:V.text.match(/(.*?) views/)))===null||B===void 0?void 0:B.text)||"N/A";let Y=($=this.subtitle.runs)===null||$===void 0?void 0:$.find(V=>{var q,oe,Te;return(Te=(oe=(q=V.endpoint)===null||q===void 0?void 0:q.payload)===null||oe===void 0?void 0:oe.browseId)===null||Te===void 0?void 0:Te.startsWith("UC")});Y&&(this.author={name:Y==null?void 0:Y.text,channel_id:(ue=(te=Y==null?void 0:Y.endpoint)===null||te===void 0?void 0:te.payload)===null||ue===void 0?void 0:ue.browseId,endpoint:Y==null?void 0:Y.endpoint})}else if(this.item_type=="song"){let Y=(pe=this.subtitle.runs)===null||pe===void 0?void 0:pe.filter(V=>{var q,oe;return(oe=(q=V.endpoint)===null||q===void 0?void 0:q.payload)===null||oe===void 0?void 0:oe.browseId.startsWith("UC")});Y&&(this.artists=Y.map(V=>{var q,oe;return{name:V==null?void 0:V.text,channel_id:(oe=(q=V==null?void 0:V.endpoint)===null||q===void 0?void 0:q.payload)===null||oe===void 0?void 0:oe.browseId,endpoint:V==null?void 0:V.endpoint}}))}this.thumbnail=y.fromResponse(e.thumbnailRenderer.musicThumbnailRenderer.thumbnail),this.thumbnail_overlay=l.parseItem(e.thumbnailOverlay,Pt),this.menu=l.parseItem(e.menu,F)}};o(Ic,"MusicTwoRowItem");Ic.type="MusicTwoRowItem";var C_=Ic;var kc=class extends s{constructor(e){super(),this.header=l.parseItem(e.header,w_),this.contents=l.parseArray(e.contents,[C_,bi,T_,I_]),Reflect.has(e,"numItemsPerColumn")&&(this.num_items_per_column=parseInt(e.numItemsPerColumn))}};o(kc,"MusicCarouselShelf");kc.type="MusicCarouselShelf";var Kb=kc;var Sc=class extends s{constructor(e){super(),this.description=new u(e.description),Reflect.has(e,"maxCollapsedLines")&&(this.max_collapsed_lines=e.maxCollapsedLines),Reflect.has(e,"maxExpandedLines")&&(this.max_expanded_lines=e.maxExpandedLines),this.footer=new u(e.footer)}};o(Sc,"MusicDescriptionShelf");Sc.type="MusicDescriptionShelf";var E_=Sc;var Cc=class extends s{constructor(e){var i,n,r,a,c,p,d,_,f;super(),this.title=new u(e.title),this.description=new u(e.description),this.subtitle=new u(e.subtitle),this.second_subtitle=new u(e.secondSubtitle),this.year=((n=(i=this.subtitle.runs)===null||i===void 0?void 0:i.find(v=>/^[12][0-9]{3}$/.test(v.text)))===null||n===void 0?void 0:n.text)||"",this.song_count=((a=(r=this.second_subtitle.runs)===null||r===void 0?void 0:r[0])===null||a===void 0?void 0:a.text)||"",this.total_duration=((p=(c=this.second_subtitle.runs)===null||c===void 0?void 0:c[2])===null||p===void 0?void 0:p.text)||"",this.thumbnails=y.fromResponse(e.thumbnail.croppedSquareThumbnailRenderer.thumbnail),this.badges=l.parseArray(e.subtitleBadges);let x=(d=this.subtitle.runs)===null||d===void 0?void 0:d.find(v=>{var w,k;return(k=(w=v==null?void 0:v.endpoint)===null||w===void 0?void 0:w.payload)===null||k===void 0?void 0:k.browseId.startsWith("UC")});x&&(this.author={name:x.text,channel_id:(f=(_=x.endpoint)===null||_===void 0?void 0:_.payload)===null||f===void 0?void 0:f.browseId,endpoint:x.endpoint}),this.menu=l.parseItem(e.menu)}};o(Cc,"MusicDetailHeader");Cc.type="MusicDetailHeader";var qb=Cc;var Ec=class extends s{constructor(e){super(),this.playlist_id=e.playlistId,this.supported_download_states=e.supportedDownloadStates}};o(Ec,"MusicDownloadStateBadge");Ec.type="MusicDownloadStateBadge";var Xb=Ec;var Pc=class extends s{constructor(e){super(),this.header=l.parseItem(e.header),this.edit_header=l.parseItem(e.editHeader),this.playlist_id=e.playlistId}};o(Pc,"MusicEditablePlaylistDetailHeader");Pc.type="MusicEditablePlaylistDetailHeader";var Qb=Pc;var Nc=class extends s{constructor(e){super(),this.element=Reflect.has(e,"elementRenderer")?l.parseItem(e,qn):null}};o(Nc,"MusicElementHeader");Nc.type="MusicElementHeader";var Zb=Nc;var Rc=class extends s{constructor(e){super(),Reflect.has(e,"header")&&(this.header=l.parseItem(e.header)),Reflect.has(e,"title")&&(this.title=new u(e.title))}};o(Rc,"MusicHeader");Rc.type="MusicHeader";var ew=Rc;var Ac=class extends s{constructor(e){super(),this.title=new u(e.title),this.description=new u(e.description),this.thumbnail=l.parseItem(e.thumbnail,Ne)}};o(Ac,"MusicImmersiveHeader");Ac.type="MusicImmersiveHeader";var tw=Ac;var Vc=class{constructor(e){this.icon_name=e.iconName,this.endpoint=new g(e.onTap),this.a11y_text=e.a11yText,this.style=e.style}};o(Vc,"ActionButton");Vc.type="ActionButton";var Mc=class{constructor(e){this.image=y.fromResponse(e.image.image),this.content_mode=e.image.contentMode,this.crop_options=e.image.cropOptions,this.image_aspect_ratio=e.imageAspectRatio,this.caption=e.caption,this.action_buttons=e.actionButtons.map(i=>new Vc(i))}};o(Mc,"Panel");Mc.type="Panel";var Dc=class extends s{constructor(e){super(),this.header=e.shelf.header,this.panels=e.shelf.panels.map(i=>new Mc(i))}};o(Dc,"MusicLargeCardItemCarousel");Dc.type="MusicLargeCardItemCarousel";var iw=Dc;var Bc=class extends s{constructor(e){super(),this.title=new u(e.title),this.edit_title=new u(e.editTitle),this.edit_description=new u(e.editDescription),this.privacy=e.privacy,this.playlist_id=e.playlistId,this.endpoint=new g(e.collaborationSettingsCommand),this.privacy_dropdown=l.parseItem(e.privacyDropdown,ni)}};o(Bc,"MusicPlaylistEditHeader");Bc.type="MusicPlaylistEditHeader";var nw=Bc;var Lc=class extends s{constructor(e){var i,n,r;super(),this.playlist_id=e.playlistId,this.contents=l.parseArray(e.contents,bi),this.collapsed_item_count=e.collapsedItemCount,this.continuation=((r=(n=(i=e.continuations)===null||i===void 0?void 0:i[0])===null||n===void 0?void 0:n.nextContinuationData)===null||r===void 0?void 0:r.continuation)||null}};o(Lc,"MusicPlaylistShelf");Lc.type="MusicPlaylistShelf";var ow=Lc;var Oc=class extends s{constructor(e){var i,n,r,a,c;super(),this.title=new u(e.title),this.thumbnail=y.fromResponse(e.thumbnail),this.endpoint=new g(e.navigationEndpoint),this.selected=e.selected,this.video_id=e.videoId,this.duration={text:new u(e.lengthText).toString(),seconds:ke(new u(e.lengthText).toString())};let p=(i=new u(e.longBylineText).runs)===null||i===void 0?void 0:i.find(_=>{var f,x,v;return(v=(x=(f=_.endpoint)===null||f===void 0?void 0:f.payload)===null||x===void 0?void 0:x.browseId)===null||v===void 0?void 0:v.startsWith("MPR")}),d=(n=new u(e.longBylineText).runs)===null||n===void 0?void 0:n.filter(_=>{var f,x,v;return(v=(x=(f=_.endpoint)===null||f===void 0?void 0:f.payload)===null||x===void 0?void 0:x.browseId)===null||v===void 0?void 0:v.startsWith("UC")});this.author=new u(e.shortBylineText).toString(),p&&(this.album={id:(a=(r=p.endpoint)===null||r===void 0?void 0:r.payload)===null||a===void 0?void 0:a.browseId,name:p.text,year:(c=new u(e.longBylineText).runs)===null||c===void 0?void 0:c.slice(-1)[0].text,endpoint:p.endpoint}),d&&(this.artists=d.map(_=>{var f,x;return{name:_.text,channel_id:(x=(f=_.endpoint)===null||f===void 0?void 0:f.payload)===null||x===void 0?void 0:x.browseId,endpoint:_.endpoint}})),this.badges=l.parseArray(e.badges),this.menu=l.parseItem(e.menu),this.set_video_id=e.playlistSetVideoId}};o(Oc,"PlaylistPanelVideo");Oc.type="PlaylistPanelVideo";var Jt=Oc;var Fc=class extends s{constructor(e){super(),this.primary=l.parseItem(e.primaryRenderer,Jt),Reflect.has(e,"counterpart")&&(this.counterpart=X(e.counterpart.map(i=>l.parseItem(i.counterpartRenderer,Jt))||[]))}};o(Fc,"PlaylistPanelVideoWrapper");Fc.type="PlaylistPanelVideoWrapper";var P_=Fc;var Yc=class extends s{constructor(e){var i,n,r,a,c,p;super(),this.title=e.title,this.title_text=new u(e.titleText),this.contents=l.parseArray(e.contents,[P_,Jt,hm]),this.playlist_id=e.playlistId,this.is_infinite=e.isInfinite,this.continuation=((r=(n=(i=e.continuations)===null||i===void 0?void 0:i[0])===null||n===void 0?void 0:n.nextRadioContinuationData)===null||r===void 0?void 0:r.continuation)||((p=(c=(a=e.continuations)===null||a===void 0?void 0:a[0])===null||c===void 0?void 0:c.nextContinuationData)===null||p===void 0?void 0:p.continuation),this.is_editable=e.isEditable,this.preview_description=e.previewDescription,this.num_items_to_show=e.numItemsToShow}};o(Yc,"PlaylistPanel");Yc.type="PlaylistPanel";var N_=Yc;var Uc=class extends s{constructor(e){super(),this.content=l.parseItem(e.content,N_)}};o(Uc,"MusicQueue");Uc.type="MusicQueue";var R_=Uc;var jc=class extends s{constructor(e){super(),this.thumbnail=l.parseItem(e.thumbnail,Ne),this.buttons=l.parseArray(e.buttons,[Ch,xe,no,I,F]),this.title=new u(e.title),this.subtitle=new u(e.subtitle),this.strapline_text_one=new u(e.straplineTextOne),this.strapline_thumbnail=l.parseItem(e.straplineThumbnail,Ne),this.second_subtitle=new u(e.secondSubtitle),Reflect.has(e,"subtitleBadge")&&(this.subtitle_badge=l.parseArray(e.subtitleBadge,io)),Reflect.has(e,"description")&&(this.description=l.parseItem(e.description,E_))}};o(jc,"MusicResponsiveHeader");jc.type="MusicResponsiveHeader";var rw=jc;var Wc=class extends s{constructor(e){var i,n,r,a;super(),this.title=new u(e.title),this.contents=l.parseArray(e.contents,bi),Reflect.has(e,"bottomEndpoint")&&(this.endpoint=new g(e.bottomEndpoint)),Reflect.has(e,"continuations")&&(this.continuation=((n=(i=e.continuations)===null||i===void 0?void 0:i[0].nextContinuationData)===null||n===void 0?void 0:n.continuation)||((a=(r=e.continuations)===null||r===void 0?void 0:r[0].reloadContinuationData)===null||a===void 0?void 0:a.continuation)),Reflect.has(e,"bottomText")&&(this.bottom_text=new u(e.bottomText)),Reflect.has(e,"bottomButton")&&(this.bottom_button=l.parseItem(e.bottomButton,I)),Reflect.has(e,"subheaders")&&(this.subheaders=l.parseArray(e.subheaders))}};o(Wc,"MusicShelf");Wc.type="MusicShelf";var sw=Wc;var Jc=class extends s{constructor(e){super(),Reflect.has(e,"startItems")&&(this.start_items=l.parseArray(e.startItems)),Reflect.has(e,"endItems")&&(this.end_items=l.parseArray(e.endItems))}};o(Jc,"MusicSideAlignedItem");Jc.type="MusicSideAlignedItem";var aw=Jc;var Hc=class extends s{constructor(e){super(),this.title=new u(e.title).toString(),Reflect.has(e,"icon")&&(this.icon_type=e.icon.iconType),this.menu=l.parseItem(e.menu,g_)}};o(Hc,"MusicSortFilterButton");Hc.type="MusicSortFilterButton";var uw=Hc;var zc=class extends s{constructor(e){super(),this.thumbnail=y.fromResponse(e.thumbnail)}};o(zc,"MusicTastebuilderShelfThumbnail");zc.type="MusicTastebuilderShelfThumbnail";var A_=zc;var Gc=class extends s{constructor(e){super(),this.thumbnail=l.parseItem(e.thumbnail,A_),this.primary_text=new u(e.primaryText),this.secondary_text=new u(e.secondaryText),this.action_button=l.parseItem(e.actionButton,I),this.is_visible=e.isVisible}};o(Gc,"MusicTasteBuilderShelf");Gc.type="MusicTasteBuilderShelf";var lw=Gc;var $c=class extends s{constructor(e){var i,n;super(),this.title=new u(e.title),this.thumbnail=e.thumbnail?y.fromResponse((i=e.thumbnail.musicThumbnailRenderer)===null||i===void 0?void 0:i.thumbnail):[],this.menu=l.parseItem(e.menu,F),this.foreground_thumbnail=e.foregroundThumbnail?y.fromResponse((n=e.foregroundThumbnail.musicThumbnailRenderer)===null||n===void 0?void 0:n.thumbnail):[]}};o($c,"MusicVisualHeader");$c.type="MusicVisualHeader";var cw=$c;var Kc=class extends s{constructor(e){super(),this.thumbnails=y.fromResponse(e.thumbnail),this.video_thumbnails=y.fromResponse(e.videoThumbnail),this.short_message=new u(e.shortMessage),this.sent_time=new u(e.sentTimeText),this.notification_id=e.notificationId,this.endpoint=new g(e.navigationEndpoint),this.record_click_endpoint=new g(e.recordClickEndpoint),this.menu=l.parseItem(e.contextualMenu),this.read=e.read}};o(Kc,"Notification");Kc.type="Notification";var V_=Kc;var qc=class extends s{constructor(e){super(),this.title=l.parseItem(e.title,Eh),this.image=l.parseItem(e.image,[Dn,yh]),this.metadata=l.parseItem(e.metadata,Kn),this.actions=l.parseItem(e.actions,Mh),this.description=l.parseItem(e.description,kh),this.attributation=l.parseItem(e.attributation,fm),this.banner=l.parseItem(e.banner,Jh)}};o(qc,"PageHeaderView");qc.type="PageHeaderView";var M_=qc;var Xc=class extends s{constructor(e){super(),this.page_title=e.pageTitle,this.content=l.parseItem(e.content,M_)}};o(Xc,"PageHeader");Xc.type="PageHeader";var Nt=Xc;var Qc=class extends s{constructor(e){super(),this.header_text=new u(e.headerText).toString(),this.body_text=new u(e.bodyText).toString(),this.page_title=new u(e.pageTitle).toString(),this.header_icon_type=e.headerIcon.iconType}};o(Qc,"PageIntroduction");Qc.type="PageIntroduction";var D_=Qc;var Zc=class extends s{constructor(e){super(),this.thumbnail=y.fromResponse(e.thumbnail),this.endpoint=new g(e.onClickCommand),this.content_description=new u(e.contentDescription),this.target_id=e.targetId,this.sound_attribution_title=new u(e.soundAttributionTitle),this.waveform_animation_style=e.waveformAnimationStyle,this.background_animation_style=e.backgroundAnimationStyle}};o(Zc,"PivotButton");Zc.type="PivotButton";var B_=Zc;var ep=class extends s{constructor(e){super(),Reflect.has(e,"featuredChannel")&&(this.featured_channel={start_time_ms:e.featuredChannel.startTimeMs,end_time_ms:e.featuredChannel.endTimeMs,watermark:y.fromResponse(e.featuredChannel.watermark),channel_name:e.featuredChannel.channelName,endpoint:new g(e.featuredChannel.navigationEndpoint),subscribe_button:l.parseItem(e.featuredChannel.subscribeButton)}),this.allow_swipe_dismiss=e.allowSwipeDismiss,this.annotation_id=e.annotationId}};o(ep,"PlayerAnnotationsExpanded");ep.type="PlayerAnnotationsExpanded";var L_=ep;var tp=class extends s{constructor(e){super(),Reflect.has(e,"captionTracks")&&(this.caption_tracks=e.captionTracks.map(i=>({base_url:i.baseUrl,name:new u(i.name),vss_id:i.vssId,language_code:i.languageCode,kind:i.kind,is_translatable:i.isTranslatable}))),Reflect.has(e,"audioTracks")&&(this.audio_tracks=e.audioTracks.map(i=>({audio_track_id:i.audioTrackId,captions_initial_state:i.captionsInitialState,default_caption_track_index:i.defaultCaptionTrackIndex,has_default_track:i.hasDefaultTrack,visibility:i.visibility,caption_track_indices:i.captionTrackIndices}))),Reflect.has(e,"defaultAudioTrackIndex")&&(this.default_audio_track_index=e.defaultAudioTrackIndex),Reflect.has(e,"translationLanguages")&&(this.translation_languages=e.translationLanguages.map(i=>({language_code:i.languageCode,language_name:new u(i.languageName)})))}};o(tp,"PlayerCaptionsTracklist");tp.type="PlayerCaptionsTracklist";var O_=tp;var ip=class extends s{constructor(e){super(),this.endpoint=new g(e.endpoint),this.enable_listen_first=e.enableListenFirst}};o(ip,"PlayerOverflow");ip.type="PlayerOverflow";var F_=ip;var np=class extends s{constructor(e){super(),this.overflow=l.parseItem(e.overflow,F_)}};o(np,"PlayerControlsOverlay");np.type="PlayerControlsOverlay";var pw=np;var op=class extends s{constructor(e){super(),this.subreason=new u(e.subreason),this.reason=new u(e.reason),this.proceed_button=l.parseItem(e.proceedButton,I),this.thumbnails=y.fromResponse(e.thumbnail),Reflect.has(e,"icon")&&(this.icon_type=e.icon.iconType)}};o(op,"PlayerErrorMessage");op.type="PlayerErrorMessage";var dw=op;var rp=class extends s{constructor(e){super(),this.title=e.itemTitle,this.thumbnail=e.itemThumbnail,this.offer_description=e.offerDescription,this.offer_id=e.offerId}};o(rp,"PlayerLegacyDesktopYpcOffer");rp.type="PlayerLegacyDesktopYpcOffer";var fw=rp;var sp=class extends s{constructor(e){super(),this.video_message=e.fullVideoMessage,this.player_response=e.unserializedPlayerResponse}};o(sp,"YpcTrailer");sp.type="YpcTrailer";var Y_=sp;var ap=class extends s{constructor(e){super(),this.video_id=e.trailerVideoId,this.title=e.itemTitle,this.thumbnail=e.itemThumbnail,this.offer_headline=e.offerHeadline,this.offer_description=e.offerDescription,this.offer_id=e.offerId,this.offer_button_text=e.offerButtonText,this.video_message=e.fullVideoMessage,this.trailer=l.parseItem(e.ypcTrailer,Y_)}};o(ap,"PlayerLegacyDesktopYpcTrailer");ap.type="PlayerLegacyDesktopYpcTrailer";var up=ap;var lp=class extends s{constructor(e){super();let[i,n,r,a,c]=e.spec.split("#");this.board={type:"live",template_url:i,thumbnail_width:parseInt(n,10),thumbnail_height:parseInt(r,10),columns:parseInt(a,10),rows:parseInt(c,10)}}};o(lp,"PlayerLiveStoryboardSpec");lp.type="PlayerLiveStoryboardSpec";var U_=lp;var cp=class extends s{constructor(e){var i,n;super(),this.title=new u(e.title),this.description=new u(e.description),this.thumbnails=y.fromResponse(e.thumbnail),Reflect.has(e,"embed")&&(this.embed={iframe_url:e.embed.iframeUrl,flash_url:e.embed.flashUrl,flash_secure_url:e.embed.flashSecureUrl,width:e.embed.width,height:e.embed.height}),this.length_seconds=parseInt(e.lengthSeconds),this.channel={id:e.externalChannelId,name:e.ownerChannelName,url:e.ownerProfileUrl},this.is_family_safe=!!e.isFamilySafe,this.is_unlisted=!!e.isUnlisted,this.has_ypc_metadata=!!e.hasYpcMetadata,this.view_count=parseInt(e.viewCount),this.category=e.category,this.publish_date=e.publishDate,this.upload_date=e.uploadDate,this.available_countries=e.availableCountries,this.start_timestamp=!((i=e.liveBroadcastDetails)===null||i===void 0)&&i.startTimestamp?new Date(e.liveBroadcastDetails.startTimestamp):null,this.end_timestamp=!((n=e.liveBroadcastDetails)===null||n===void 0)&&n.endTimestamp?new Date(e.liveBroadcastDetails.endTimestamp):null}};o(cp,"PlayerMicroformat");cp.type="PlayerMicroformat";var nt=cp;var pp=class extends s{constructor(e){super(),this.title=new u(e.title),this.video_id=e.videoId,this.video_title=new u(e.videoTitle),this.short_view_count=new u(e.shortViewCountText),this.prefer_immediate_redirect=e.preferImmediateRedirect,this.count_down_secs_for_fullscreen=e.countDownSecsForFullscreen,this.published=new u(e.publishedTimeText),this.background=y.fromResponse(e.background),this.thumbnail_overlays=l.parseArray(e.thumbnailOverlays),this.author=new D(e.byline),this.cancel_button=l.parseItem(e.cancelButton,I),this.next_button=l.parseItem(e.nextButton,I),this.close_button=l.parseItem(e.closeButton,I)}};o(pp,"PlayerOverlayAutoplay");pp.type="PlayerOverlayAutoplay";var j_=pp;var dp=class extends s{constructor(e){super(),this.results=l.parseArray(e.results,[Ah,Rh]),this.title=new u(e.title).toString()}};o(dp,"WatchNextEndScreen");dp.type="WatchNextEndScreen";var W_=dp;var fp=class extends s{constructor(e){super(),this.end_screen=l.parseItem(e.endScreen,W_),this.autoplay=l.parseItem(e.autoplay,j_),this.share_button=l.parseItem(e.shareButton,I),this.add_to_menu=l.parseItem(e.addToMenu,F),this.fullscreen_engagement=l.parseItem(e.fullscreenEngagement),this.actions=l.parseArray(e.actions),this.browser_media_session=l.parseItem(e.browserMediaSession),this.decorated_player_bar=l.parseItem(e.decoratedPlayerBarRenderer,Ih)}};o(fp,"PlayerOverlay");fp.type="PlayerOverlay";var J_=fp;var mp=class extends s{constructor(e){super(),this.id=e.playlistId,this.title=new u(e.title),this.subtitle=e.subtitle?new u(e.subtitle):null,this.stats=e.stats.map(i=>new u(i)),this.brief_stats=e.briefStats.map(i=>new u(i)),this.author=e.ownerText||e.ownerEndpoint?new D(Object.assign(Object.assign({},e.ownerText),{navigationEndpoint:e.ownerEndpoint}),e.ownerBadges,null):null,this.description=new u(e.descriptionText),this.num_videos=new u(e.numVideosText),this.view_count=new u(e.viewCountText),this.can_share=e.shareData.canShare,this.can_delete=e.editableDetails.canDelete,this.is_editable=e.isEditable,this.privacy=e.privacy,this.save_button=l.parseItem(e.saveButton),this.shuffle_play_button=l.parseItem(e.shufflePlayButton),this.menu=l.parseItem(e.moreActionsMenu),this.banner=l.parseItem(e.playlistHeaderBanner)}};o(mp,"PlaylistHeader");mp.type="PlaylistHeader";var H_=mp;var hp=class extends s{constructor(e){super(),this.title=new u(e.playlistTitle),this.thumbnails=y.fromResponse(e.thumbnail),this.video_count=new u(e.playlistVideoCount),this.channel_name=new u(e.channelName),this.endpoint=new g(e.action)}};o(hp,"PlaylistInfoCardContent");hp.type="PlaylistInfoCardContent";var mw=hp;var _p=class extends s{constructor(e){super(),this.title=e.title,this.description=e.description||null}};o(_p,"PlaylistMetadata");_p.type="PlaylistMetadata";var z_=_p;var gp=class extends s{constructor(e){super(),this.items=l.parseArray(e.items)}get contents(){return this.items}};o(gp,"PlaylistSidebar");gp.type="PlaylistSidebar";var hw=gp;var xp=class extends s{constructor(e){super(),this.stats=e.stats.map(i=>new u(i)),this.thumbnail_renderer=l.parseItem(e.thumbnailRenderer),this.title=new u(e.title),this.menu=l.parseItem(e.menu),this.endpoint=new g(e.navigationEndpoint),this.description=new u(e.description)}};o(xp,"PlaylistSidebarPrimaryInfo");xp.type="PlaylistSidebarPrimaryInfo";var G_=xp;var vp=class extends s{constructor(e){super(),this.owner=l.parseItem(e.videoOwner),this.button=l.parseItem(e.button)}};o(vp,"PlaylistSidebarSecondaryInfo");vp.type="PlaylistSidebarSecondaryInfo";var $_=vp;var yp=class extends s{constructor(e){super(),this.id=e.videoId,this.index=new u(e.index),this.title=new u(e.title),this.author=new D(e.shortBylineText),this.thumbnails=y.fromResponse(e.thumbnail),this.thumbnail_overlays=l.parseArray(e.thumbnailOverlays),this.set_video_id=e==null?void 0:e.setVideoId,this.endpoint=new g(e.navigationEndpoint),this.is_playable=e.isPlayable,this.menu=l.parseItem(e.menu,F),this.video_info=new u(e.videoInfo),this.accessibility_label=e.title.accessibility.accessibilityData.label,Reflect.has(e,"style")&&(this.style=e.style);let i=e.upcomingEventData&&Number(`${e.upcomingEventData.startTime}000`);i&&(this.upcoming=new Date(i)),this.duration={text:new u(e.lengthText).toString(),seconds:parseInt(e.lengthSeconds)}}get is_live(){var e;return((e=this.thumbnail_overlays.firstOfType(Xi))===null||e===void 0?void 0:e.style)==="LIVE"}get is_upcoming(){var e;return((e=this.thumbnail_overlays.firstOfType(Xi))===null||e===void 0?void 0:e.style)==="UPCOMING"}};o(yp,"PlaylistVideo");yp.type="PlaylistVideo";var ro=yp;var bp=class extends s{constructor(e){super(),this.id=e.playlistId,this.is_editable=e.isEditable,this.can_reorder=e.canReorder,this.videos=l.parseArray(e.contents)}};o(bp,"PlaylistVideoList");bp.type="PlaylistVideoList";var _w=bp;var wp=class extends s{constructor(e){super(),this.choices=e.choices.map(i=>({text:new u(i.text),select_endpoint:i.selectServiceEndpoint?new g(i.selectServiceEndpoint):null,deselect_endpoint:i.deselectServiceEndpoint?new g(i.deselectServiceEndpoint):null,vote_ratio_if_selected:(i==null?void 0:i.voteRatioIfSelected)||null,vote_percentage_if_selected:new u(i.votePercentageIfSelected),vote_ratio_if_not_selected:(i==null?void 0:i.voteRatioIfSelected)||null,vote_percentage_if_not_selected:new u(i.votePercentageIfSelected),image:i.image?y.fromResponse(i.image):null})),Reflect.has(e,"type")&&(this.poll_type=e.type),Reflect.has(e,"totalVotes")&&(this.total_votes=new u(e.totalVotes)),Reflect.has(e,"liveChatPollId")&&(this.live_chat_poll_id=e.liveChatPollId)}};o(wp,"Poll");wp.type="Poll";var gw=wp;var Tp=class extends si{constructor(e){super(e)}};o(Tp,"Post");Tp.type="Post";var K_=Tp;var Ip=class extends s{constructor(e){super(),this.images=l.parseArray(e.images,gm)}};o(Ip,"PostMultiImage");Ip.type="PostMultiImage";var xw=Ip;var kp=class extends s{constructor(e){super(),this.title=new u(e.title),this.suppress_padding_disclaimer=!!e.suppressPaddingDisclaimer}};o(kp,"ProductListHeader");kp.type="ProductListHeader";var vw=kp;var Sp=class extends s{constructor(e){super(),this.title=new u(e.title),this.accessibility_title=e.accessibilityTitle,this.thumbnail=y.fromResponse(e.thumbnail),this.price=e.price,this.endpoint=new g(e.onClickCommand),this.merchant_name=e.merchantName,this.stay_in_app=!!e.stayInApp,this.view_button=l.parseItem(e.viewButton,I)}};o(Sp,"ProductListItem");Sp.type="ProductListItem";var yw=Sp;var Cp=class extends s{constructor(e){super(),this.items=l.parseArray(e.items)}get contents(){return this.items}};o(Cp,"ProfileColumn");Cp.type="ProfileColumn";var bw=Cp;var Ep=class extends s{constructor(e){super(),this.items=l.parseArray(e.items)}get contents(){return this.items}};o(Ep,"ProfileColumnStats");Ep.type="ProfileColumnStats";var ww=Ep;var Pp=class extends s{constructor(e){super(),this.label=new u(e.label),this.value=new u(e.value)}};o(Pp,"ProfileColumnStatsEntry");Pp.type="ProfileColumnStatsEntry";var Tw=Pp;var Np=class extends s{constructor(e){super(),this.title=new u(e.title),this.thumbnails=y.fromResponse(e.thumbnail)}};o(Np,"ProfileColumnUserInfo");Np.type="ProfileColumnUserInfo";var Iw=Np;var Rp=class extends s{constructor(e){super(),this.choices=e.choices.map(i=>({text:new u(i.text),is_correct:i.isCorrect})),this.total_votes=new u(e.totalVotes)}};o(Rp,"Quiz");Rp.type="Quiz";var kw=Rp;var Ap=class extends s{constructor(e){super(),this.title=new u(e.title),this.subtitle=new u(e.subtitle),this.avatars=e.avatars.map(i=>new y(i)),this.button=l.parseItem(e.button,I),this.surface=e.surface}};o(Ap,"RecognitionShelf");Ap.type="RecognitionShelf";var Sw=Ap;var Vp=class extends s{constructor(e){super(),this.id=e.videoId,this.title=new u(e.headline),this.thumbnails=y.fromResponse(e.thumbnail),this.views=new u(e.viewCountText),this.endpoint=new g(e.navigationEndpoint),this.accessibility_label=e.accessibility.accessibilityData.label}};o(Vp,"ReelItem");Vp.type="ReelItem";var so=Vp;var Mp=class extends s{constructor(e){super(),this.reel_title_text=new u(e.reelTitleText),this.timestamp_text=new u(e.timestampText),this.channel_title_text=new u(e.channelTitleText),this.channel_thumbnail=y.fromResponse(e.channelThumbnail),this.author=new D(e.channelNavigationEndpoint,void 0)}};o(Mp,"ReelPlayerHeader");Mp.type="ReelPlayerHeader";var q_=Mp;var Dp=class extends s{constructor(e){super(),this.like_button=l.parseItem(e.likeButton,qh),this.reel_player_header_supported_renderers=l.parseItem(e.reelPlayerHeaderSupportedRenderers,q_),this.menu=l.parseItem(e.menu,F),this.next_item_button=l.parseItem(e.nextItemButton,I),this.prev_item_button=l.parseItem(e.prevItemButton,I),this.subscribe_button_renderer=l.parseItem(e.subscribeButtonRenderer,[I,Se]),this.style=e.style,this.view_comments_button=l.parseItem(e.viewCommentsButton,I),this.share_button=l.parseItem(e.shareButton,I),this.pivot_button=l.parseItem(e.pivotButton,B_),this.info_panel=l.parseItem(e.infoPanel,zh)}};o(Dp,"ReelPlayerOverlay");Dp.type="ReelPlayerOverlay";var Cw=Dp;var Bp=class extends s{constructor(e){super(),this.content=l.parseItem(e.content)}};o(Bp,"RelatedChipCloud");Bp.type="RelatedChipCloud";var X_=Bp;var Lp=class extends s{constructor(e){super(),this.header=l.parseItem(e.header),this.contents=l.parseArray(e.contents)}};o(Lp,"RichGrid");Lp.type="RichGrid";var wi=Lp;var Op=class extends s{constructor(e){super(),this.content=l.parseItem(e.content)}};o(Op,"RichItem");Op.type="RichItem";var Ew=Op;var Fp=class extends s{constructor(e){super(),this.title=new u(e.title),this.subtitle=new u(e.subtitle),Reflect.has(e,"titleStyle")&&(this.title_style=e.titleStyle.style),Reflect.has(e,"icon")&&(this.icon_type=e.icon.iconType)}};o(Fp,"RichListHeader");Fp.type="RichListHeader";var Pw=Fp;var Yp=class extends s{constructor(e){super(),this.thumbnail=y.fromResponse(e.thumbnail),this.title=new u(e.title),this.subtitle=new u(e.subtitle),this.call_to_action=new u(e.callToAction),Reflect.has(e,"callToActionIcon")&&(this.icon_type=e.callToActionIcon.iconType),this.endpoint=new g(e.endpoint)}};o(Yp,"RichMetadata");Yp.type="RichMetadata";var Up=Yp;var jp=class extends s{constructor(e){super(),this.contents=l.parseArray(e.contents)}};o(jp,"RichMetadataRow");jp.type="RichMetadataRow";var Wp=jp;var Jp=class extends s{constructor(e){super(),this.content=l.parseItem(e.content)}};o(Jp,"RichSection");Jp.type="RichSection";var Nw=Jp;var Hp=class extends s{constructor(e){super(),this.title=new u(e.title),this.contents=l.parseArray(e.contents),Reflect.has(e,"endpoint")&&(this.endpoint=new g(e.endpoint))}};o(Hp,"RichShelf");Hp.type="RichShelf";var Q_=Hp;var zp=class extends s{constructor(e){super(),this.endpoint=new g(e.endpoint),this.search_button=l.parseItem(e.searchButton,I),this.clear_button=l.parseItem(e.clearButton,I),this.placeholder_text=new u(e.placeholderText)}};o(zp,"SearchBox");zp.type="SearchBox";var Rw=zp;var Gp=class extends s{constructor(e){super(),this.label=new u(e.label),this.endpoint=new g(e.endpoint||e.navigationEndpoint),this.tooltip=e.tooltip,Reflect.has(e,"status")&&(this.status=e.status)}get disabled(){return this.status==="FILTER_STATUS_DISABLED"}get selected(){return this.status==="FILTER_STATUS_SELECTED"}};o(Gp,"SearchFilter");Gp.type="SearchFilter";var Z_=Gp;var $p=class extends s{constructor(e){super(),this.title=new u(e.title),this.filters=l.parseArray(e.filters,Z_)}};o($p,"SearchFilterGroup");$p.type="SearchFilterGroup";var ao=$p;var Kp=class extends s{constructor(e){super(),this.title=new u(e.title),this.groups=l.parseArray(e.groups,ao)}};o(Kp,"SearchFilterOptionsDialog");Kp.type="SearchFilterOptionsDialog";var Aw=Kp;var qp=class extends s{constructor(e){super(),this.chip_bar=l.parseItem(e.chipBar,Yn),this.search_filter_button=l.parseItem(e.searchFilterButton,I)}};o(qp,"SearchHeader");qp.type="SearchHeader";var eg=qp;var Xp=class extends s{constructor(e){super(),Reflect.has(e,"title")&&(this.title=new u(e.title)),Reflect.has(e,"groups")&&(this.groups=l.parseArray(e.groups,ao)),Reflect.has(e,"button")&&(this.button=l.parseItem(e.button,xe))}};o(Xp,"SearchSubMenu");Xp.type="SearchSubMenu";var tg=Xp;var Qp=class extends s{constructor(e){super(),this.contents=l.parseArray(e.contents)}};o(Qp,"SearchSuggestionsSection");Qp.type="SearchSuggestionsSection";var Vw=Qp;var Zp=class extends s{constructor(e){super(),this.contents=l.parseArray(e.contents)}};o(Zp,"SecondarySearchContainer");Zp.type="SecondarySearchContainer";var Mw=Zp;var ed=class extends s{constructor(e){super(),this.like_button=l.parseItem(e.likeButton,[xe,I]),this.dislike_button=l.parseItem(e.dislikeButton,[xe,I])}};o(ed,"SegmentedLikeDislikeButton");ed.type="SegmentedLikeDislikeButton";var sn=ed;var td=class extends s{constructor(e){if(super(),this.like_button=l.parseItem(e.likeButtonViewModel,Xh),this.dislike_button=l.parseItem(e.dislikeButtonViewModel,Sh),this.icon_type=e.iconType,this.like_button&&this.like_button.toggle_button){let i=this.like_button.toggle_button;i.default_button?(this.short_like_count=i.default_button.title,this.like_count=parseInt(i.default_button.accessibility_text.replace(/\D/g,""))):i.toggled_button&&(this.short_like_count=i.toggled_button.title,this.like_count=parseInt(i.toggled_button.accessibility_text.replace(/\D/g,"")))}this.like_count_entity={key:e.likeCountEntity.key},this.dynamic_like_count_update_data={update_status_key:e.dynamicLikeCountUpdateData.updateStatusKey,placeholder_like_count_values_key:e.dynamicLikeCountUpdateData.placeholderLikeCountValuesKey,update_delay_loop_id:e.dynamicLikeCountUpdateData.updateDelayLoopId,update_delay_sec:e.dynamicLikeCountUpdateData.updateDelaySec}}};o(td,"SegmentedLikeDislikeButtonView");td.type="SegmentedLikeDislikeButtonView";var an=td;var id=class extends s{constructor(e){super(),Reflect.has(e,"title")&&(this.title=new u(e.title)),Reflect.has(e,"summary")&&(this.summary=new u(e.summary)),Reflect.has(e,"enableServiceEndpoint")&&(this.enable_endpoint=new g(e.enableServiceEndpoint)),Reflect.has(e,"disableServiceEndpoint")&&(this.disable_endpoint=new g(e.disableServiceEndpoint)),this.item_id=e.itemId}};o(id,"SettingBoolean");id.type="SettingBoolean";var Dw=id;var nd=class extends s{constructor(e){super(),this.title=new u(e.title),this.help_text=new u(e.helpText),this.enabled=e.enabled,this.disabled=e.disabled,this.id=e.id}};o(nd,"SettingsCheckbox");nd.type="SettingsCheckbox";var ig=nd;var od=class extends s{constructor(e){super(),this.title=new u(e.title),this.subtitle=new u(e.subtitle),this.enabled=e.enabled,this.enable_endpoint=new g(e.enableServiceEndpoint),this.disable_endpoint=new g(e.disableServiceEndpoint)}};o(od,"SettingsSwitch");od.type="SettingsSwitch";var uo=od;var rd=class extends s{constructor(e){super(),this.title=new u(e.title),Reflect.has(e,"text")&&(this.text=new u(e.text).toString()),Reflect.has(e,"options")&&(this.options=l.parseArray(e.options,[uo,ni,vh,ig,Xm]))}};o(rd,"SettingsOptions");rd.type="SettingsOptions";var lo=rd;var sd=class extends s{constructor(e){super(),this.title=new u(e.title),this.items=l.parseArray(e.items,zn)}get contents(){return this.items}};o(sd,"SettingsSidebar");sd.type="SettingsSidebar";var ng=sd;var ad=class extends s{constructor(e){super(),this.thumbnail=y.fromResponse(e.thumbnail),this.content=new u(e.content),this.published=new u(e.publishedTimeText),this.menu=ie(e.actionMenu,F),this.original_post=ie(e.originalPost,si),this.id=e.postId,this.endpoint=new g(e.navigationEndpoint),this.expand_button=ie(e.expandButton,I),this.author=new D(e.displayName,void 0)}};o(ad,"SharedPost");ad.type="SharedPost";var og=ad;var ud=class extends s{constructor(e){super(),this.title=new u(e.title),Reflect.has(e,"endpoint")&&(this.endpoint=new g(e.endpoint)),this.content=l.parseItem(e.content),Reflect.has(e,"icon")&&(this.icon_type=e.icon.iconType),Reflect.has(e,"menu")&&(this.menu=l.parseItem(e.menu)),Reflect.has(e,"playAllButton")&&(this.play_all_button=l.parseItem(e.playAllButton,I))}};o(ud,"Shelf");ud.type="Shelf";var co=ud;var ld=class extends s{constructor(e){var i;super(),this.entity_id=e.entityId,this.accessibility_text=e.accessibilityText,this.thumbnail=y.fromResponse(e.thumbnail),this.on_tap_endpoint=new g(e.onTap),this.menu_on_tap=new g(e.menuOnTap),this.index_in_collection=e.indexInCollection,this.menu_on_tap_a11y_label=e.menuOnTapA11yLabel,this.overlay_metadata={primary_text:u.fromAttributed(e.overlayMetadata.primaryText),secondary_text:e.overlayMetadata.secondaryText?u.fromAttributed(e.overlayMetadata.secondaryText):void 0},!((i=e.inlinePlayerData)===null||i===void 0)&&i.onVisible&&(this.inline_player_data=new g(e.inlinePlayerData.onVisible)),e.badge&&(this.badge=l.parseItem(e.badge,ai))}};o(ld,"ShortsLockupView");ld.type="ShortsLockupView";var po=ld;var cd=class extends s{constructor(e){super(),this.corrected_query=new u(e.correctedQuery),this.original_query=new u(e.originalQuery),this.corrected_query_endpoint=new g(e.correctedQueryEndpoint),this.original_query_endpoint=new g(e.originalQueryEndpoint),this.search_instead_for=new u(e.searchInsteadFor),this.showing_results_for=new u(e.showingResultsFor)}};o(cd,"ShowingResultsFor");cd.type="ShowingResultsFor";var Bw=cd;var pd=class extends s{constructor(e){super(),this.image=y.fromResponse(e.image),this.title=new u(e.title),this.display_domain=new u(e.displayDomain),this.show_link_icon=e.showLinkIcon,this.call_to_action=new u(e.callToAction),this.endpoint=new g(e.command)}};o(pd,"SimpleCardContent");pd.type="SimpleCardContent";var Lw=pd;var dd=class extends s{constructor(e){super(),this.message=new u(e.message),this.prominent=e.prominent}};o(dd,"SimpleCardTeaser");dd.type="SimpleCardTeaser";var Ow=dd;var fd=class extends s{constructor(e){super(),this.lines=e.lines.map(i=>new u(i)),this.style=e.layoutStyle}};o(fd,"SimpleTextSection");fd.type="SimpleTextSection";var Fw=fd;var md=class extends s{constructor(e){super(),this.action_text=new u(e.actionText),this.nav_text=new u(e.navigationText),this.details=new u(e.detailsText),this.icon_type=e.icon.iconType,this.endpoint=new g(e.navigationEndpoint)}};o(md,"SingleActionEmergencySupport");md.type="SingleActionEmergencySupport";var Yw=md;var hd=class extends s{constructor(e){super(),this.title=e.title||"N/A",this.selected=!!e.selected,this.endpoint=new g(e.endpoint),this.content=l.parseItem(e.content,[ve,R_,wi])}};o(hd,"Tab");hd.type="Tab";var Re=hd;var _d=class extends s{constructor(e){super(),this.tabs=l.parseArray(e.tabs,Re)}};o(_d,"SingleColumnBrowseResults");_d.type="SingleColumnBrowseResults";var rg=_d;var gd=class extends s{constructor(e){super(),this.contents=l.parse(e)}};o(gd,"SingleColumnMusicWatchNextResults");gd.type="SingleColumnMusicWatchNextResults";var Uw=gd;var xd=class extends s{constructor(e){super(),this.thumbnails=y.fromResponse(e.thumbnail),this.style=e.style}};o(xd,"SingleHeroImage");xd.type="SingleHeroImage";var jw=xd;var vd=class extends s{constructor(e){super(),this.thumbnail=y.fromResponse(e.thumbnail),this.title=new u(e.title),this.endpoint=new g(e.navigationEndpoint),this.subscribe_button=l.parseItem(e.subscribeButton,Se)}};o(vd,"SlimOwner");vd.type="SlimOwner";var Ww=vd;var yd=class extends s{constructor(e){super(),this.title=new u(e.title),this.collapsed_subtitle=new u(e.collapsedSubtitle),this.expanded_subtitle=new u(e.expandedSubtitle),this.owner=l.parseItem(e.owner),this.description=new u(e.description),this.video_id=e.videoId,this.date=new u(e.dateText)}};o(yd,"SlimVideoMetadata");yd.type="SlimVideoMetadata";var Jw=yd;var bd=class extends s{constructor(e){super(),this.name=new u(e.name),this.is_selected=e.isSelected,this.endpoint=new g(e.navigationEndpoint)}};o(bd,"SubFeedOption");bd.type="SubFeedOption";var sg=bd;var wd=class extends s{constructor(e){super(),this.title=new u(e.title),this.options=l.parseArray(e.options,sg)}};o(wd,"SubFeedSelector");wd.type="SubFeedSelector";var Hw=wd;var Td=class extends s{constructor(e){super(),this.contents=l.parse(e)}};o(Td,"Tabbed");Td.type="Tabbed";var zw=Td;var Id=class extends s{constructor(e){super(),this.tabs=l.parseArray(e.tabs,Re)}};o(Id,"TabbedSearchResults");Id.type="TabbedSearchResults";var Gw=Id;var kd=class extends s{constructor(e){super(),this.title=new u(e.title),this.style=e.style}};o(kd,"TextHeader");kd.type="TextHeader";var $w=kd;var Sd=class extends s{constructor(e){super(),this.landscape=y.fromResponse(e.landscape),this.portrait=y.fromResponse(e.portrait)}};o(Sd,"ThumbnailLandscapePortrait");Sd.type="ThumbnailLandscapePortrait";var Kw=Sd;var Cd=class extends s{constructor(e){super(),this.text=new u(e.text).toString()}};o(Cd,"ThumbnailOverlayEndorsement");Cd.type="ThumbnailOverlayEndorsement";var qw=Cd;var Ed=class extends s{constructor(e){super(),this.text=new u(e.text),this.icon_type=e.icon.iconType}};o(Ed,"ThumbnailOverlayHoverText");Ed.type="ThumbnailOverlayHoverText";var Xw=Ed;var Pd=class extends s{constructor(e){super(),this.text=new u(e.text).toString(),this.icon_type=e.icon.iconType}};o(Pd,"ThumbnailOverlayInlineUnplayable");Pd.type="ThumbnailOverlayInlineUnplayable";var Qw=Pd;var Nd=class extends s{constructor(e){super(),this.text=new u(e.text)}};o(Nd,"ThumbnailOverlayLoadingPreview");Nd.type="ThumbnailOverlayLoadingPreview";var Zw=Nd;var Rd=class extends s{constructor(e){super(),this.text=new u(e.text).toString()}};o(Rd,"ThumbnailOverlayNowPlaying");Rd.type="ThumbnailOverlayNowPlaying";var eT=Rd;var Ad=class extends s{constructor(e){super(),this.hack=e.hack}};o(Ad,"ThumbnailOverlayPinking");Ad.type="ThumbnailOverlayPinking";var tT=Ad;var Vd=class extends s{constructor(e){super(),this.texts=e.texts.map(i=>new u(i))}};o(Vd,"ThumbnailOverlayPlaybackStatus");Vd.type="ThumbnailOverlayPlaybackStatus";var iT=Vd;var Md=class extends s{constructor(e){super(),this.percent_duration_watched=e.percentDurationWatched}};o(Md,"ThumbnailOverlayResumePlayback");Md.type="ThumbnailOverlayResumePlayback";var nT=Md;var Dd=class extends s{constructor(e){super(),this.text=new u(e.text),this.icon_type=e.icon.iconType}};o(Dd,"ThumbnailOverlaySidePanel");Dd.type="ThumbnailOverlaySidePanel";var oT=Dd;var Bd=class extends s{constructor(e){super(),Reflect.has(e,"isToggled")&&(this.is_toggled=e.isToggled),this.icon_type={toggled:e.toggledIcon.iconType,untoggled:e.untoggledIcon.iconType},this.tooltip={toggled:e.toggledTooltip,untoggled:e.untoggledTooltip},e.toggledServiceEndpoint&&(this.toggled_endpoint=new g(e.toggledServiceEndpoint)),e.untoggledServiceEndpoint&&(this.untoggled_endpoint=new g(e.untoggledServiceEndpoint))}};o(Bd,"ThumbnailOverlayToggleButton");Bd.type="ThumbnailOverlayToggleButton";var rT=Bd;var Ld=class extends s{constructor(e){super(),this.visible_time_range_start_millis=e.visibleTimeRangeStartMillis,this.visible_time_range_end_millis=e.visibleTimeRangeEndMillis,this.decoration_time_millis=e.decorationTimeMillis,this.label=new u(e.label),this.icon=e.icon}};o(Ld,"TimedMarkerDecoration");Ld.type="TimedMarkerDecoration";var sT=Ld;var Od=class extends s{constructor(e){super(),this.title=new u(e.title)}};o(Od,"TitleAndButtonListHeader");Od.type="TitleAndButtonListHeader";var aT=Od;var Fd=class extends s{constructor(e){super(),this.text=new u(e.defaultText),this.toggled_text=new u(e.toggledText),this.icon_type=e.defaultIcon.iconType,this.toggled_icon_type=e.toggledIcon.iconType,this.default_endpoint=new g(e.defaultServiceEndpoint),this.toggled_endpoint=new g(e.toggledServiceEndpoint)}};o(Fd,"ToggleMenuServiceItem");Fd.type="ToggleMenuServiceItem";var uT=Fd;var Yd=class extends s{constructor(e){super(),this.promo_config={promo_id:e.promoConfig.promoId,impression_endpoints:e.promoConfig.impressionEndpoints.map(i=>new g(i)),accept:new g(e.promoConfig.acceptCommand),dismiss:new g(e.promoConfig.dismissCommand)},this.target_id=e.targetId,this.details=new u(e.detailsText),this.suggested_position=e.suggestedPosition.type,this.dismiss_stratedy=e.dismissStrategy.type,this.dwell_time_ms=parseInt(e.dwellTimeMs)}};o(Yd,"Tooltip");Yd.type="Tooltip";var lT=Yd;var Ud=class extends s{constructor(e){var i;super(),this.title=new u(e.title),this.avatar=y.fromResponse((i=e.thumbnail)!==null&&i!==void 0?i:e.avatar),this.subtitle=new u(e.subtitle),this.subscribe_button=l.parseItem(e.subscribeButton,Se),this.endpoint=new g(e.navigationEndpoint)}};o(Ud,"TopicChannelDetails");Ud.type="TopicChannelDetails";var cT=Ud;var jd=class extends s{constructor(e){super(),this.tabs=l.parse(e.tabs),this.secondary_contents=l.parse(e.secondaryContents)}};o(jd,"TwoColumnBrowseResults");jd.type="TwoColumnBrowseResults";var Rt=jd;var Wd=class extends s{constructor(e){super(),this.primary_contents=l.parse(e.primaryContents),this.secondary_contents=l.parse(e.secondaryContents)}};o(Wd,"TwoColumnSearchResults");Wd.type="TwoColumnSearchResults";var ag=Wd;var ug,Rx,Jd=class extends s{constructor(e){var i,n,r,a,c;super(),ug.add(this),this.results=l.parseArray((i=e.results)===null||i===void 0?void 0:i.results.contents),this.secondary_results=l.parseArray((n=e.secondaryResults)===null||n===void 0?void 0:n.secondaryResults.results),this.conversation_bar=l.parseItem(e==null?void 0:e.conversationBar);let p=(r=e.playlist)===null||r===void 0?void 0:r.playlist;p&&(this.playlist={id:p.playlistId,title:p.title,author:!((a=p.shortBylineText)===null||a===void 0)&&a.simpleText?new u(p.shortBylineText):new D(p.longBylineText),contents:l.parseArray(p.contents),current_index:p.currentIndex,is_infinite:!!p.isInfinite,menu:l.parseItem(p.menu,F)});let d=(c=e.autoplay)===null||c===void 0?void 0:c.autoplay;d&&(this.autoplay={sets:d.sets.map(_=>m(this,ug,"m",Rx).call(this,_))},d.modifiedSets&&(this.autoplay.modified_sets=d.modifiedSets.map(_=>m(this,ug,"m",Rx).call(this,_))),d.countDownSecs&&(this.autoplay.count_down_secs=d.countDownSecs))}};o(Jd,"TwoColumnWatchNextResults");ug=new WeakSet,Rx=o(function(e){let i={autoplay_video:new g(e.autoplayVideo)};return e.nextButtonVideo&&(i.next_button_video=new g(e.nextButtonVideo)),i},"_TwoColumnWatchNextResults_parseAutoplaySet");Jd.type="TwoColumnWatchNextResults";var lg=Jd;var Hd=class extends s{constructor(e){super(),this.header=l.parseItem(e.header),this.call_to_action=l.parseItem(e.callToAction),this.sections=l.parseArray(e.sections),Reflect.has(e,"collapsedLabel")&&(this.collapsed_label=new u(e.collapsedLabel))}};o(Hd,"UniversalWatchCard");Hd.type="UniversalWatchCard";var cg=Hd;var zd=class extends s{constructor(e){super(),this.message_title=new u(e.dialogMessageTitle),this.message_text=new u(e.dialogMessageText),this.action_button=l.parseItem(e.actionButton,I),this.dismiss_button=l.parseItem(e.dismissButton,I),this.is_visible=e.isVisible}};o(zd,"UpsellDialog");zd.type="UpsellDialog";var pT=zd;var Gd=class extends s{constructor(e){super(),this.items=l.parseArray(e.items),this.collapsed_item_count=e.collapsedItemCount,this.collapsed_state_button_text=new u(e.collapsedStateButtonText)}get contents(){return this.items}};o(Gd,"VerticalList");Gd.type="VerticalList";var dT=Gd;var $d=class extends s{constructor(e){super(),this.items=l.parseArray(e.items),this.view_all_text=new u(e.viewAllText),this.view_all_endpoint=new g(e.viewAllEndpoint)}get contents(){return this.items}};o($d,"VerticalWatchCardList");$d.type="VerticalWatchCardList";var fT=$d;var Kd=class extends s{constructor(e){super(),this.title=new u(e.videoTitle),this.channel_name=new u(e.channelName),this.view_count=new u(e.viewCountText),this.video_thumbnails=y.fromResponse(e.videoThumbnail),this.duration=new u(e.lengthString),this.endpoint=new g(e.action)}};o(Kd,"VideoInfoCardContent");Kd.type="VideoInfoCardContent";var mT=Kd;var qd=class extends s{constructor(e){super(),this.subscription_button=e.subscriptionButton,this.subscriber_count=new u(e.subscriberCountText),this.author=new D(Object.assign(Object.assign({},e.title),{navigationEndpoint:e.navigationEndpoint}),e.badges,e.thumbnail)}};o(qd,"VideoOwner");qd.type="VideoOwner";var fo=qd;var Xd=class extends s{constructor(e){var i,n,r,a;super(),this.title=new u(e.title),Reflect.has(e,"superTitleLink")&&(this.super_title_link=new u(e.superTitleLink)),this.view_count=new u((n=(i=e.viewCount)===null||i===void 0?void 0:i.videoViewCountRenderer)===null||n===void 0?void 0:n.viewCount),this.short_view_count=new u((a=(r=e.viewCount)===null||r===void 0?void 0:r.videoViewCountRenderer)===null||a===void 0?void 0:a.shortViewCount),this.badges=l.parseArray(e.badges,ze),this.published=new u(e.dateText),this.relative_date=new u(e.relativeDateText),this.menu=l.parseItem(e.videoActions,F)}};o(Xd,"VideoPrimaryInfo");Xd.type="VideoPrimaryInfo";var pg=Xd;var Qd=class extends s{constructor(e){super(),this.owner=l.parseItem(e.owner,fo),this.description=new u(e.description),Reflect.has(e,"attributedDescription")&&(this.description=u.fromAttributed(e.attributedDescription)),this.subscribe_button=l.parseItem(e.subscribeButton,[Se,I]),this.metadata=l.parseItem(e.metadataRowContainer,y_),this.show_more_text=e.showMoreText,this.show_less_text=e.showLessText,this.default_expanded=e.defaultExpanded,this.description_collapsed_lines=e.descriptionCollapsedLines}};o(Qd,"VideoSecondaryInfo");Qd.type="VideoSecondaryInfo";var Zd=Qd;var ef=class extends s{constructor(e){super(),this.title=new u(e.title),this.subtitle=new u(e.subtitle),this.duration={text:new u(e.lengthText).toString(),seconds:ke(e.lengthText.simpleText)},this.style=e.style}};o(ef,"WatchCardCompactVideo");ef.type="WatchCardCompactVideo";var dg=ef;var tf=class extends s{constructor(e){var i;super(),this.endpoint=new g(e.navigationEndpoint),this.call_to_action_button=l.parseItem(e.callToActionButton),this.hero_image=l.parseItem(e.heroImage),this.label=((i=e.lengthText)===null||i===void 0?void 0:i.accessibility.accessibilityData.label)||""}};o(tf,"WatchCardHeroVideo");tf.type="WatchCardHeroVideo";var hT=tf;var nf=class extends s{constructor(e){super(),this.title=new u(e.title),this.title_endpoint=new g(e.titleNavigationEndpoint),this.subtitle=new u(e.subtitle),this.author=new D(e,e.titleBadge?[e.titleBadge]:null,e.avatar),this.author.name=this.title.toString(),this.style=e.style}};o(nf,"WatchCardRichHeader");nf.type="WatchCardRichHeader";var _T=nf;var of=class extends s{constructor(e){super(),this.lists=l.parseArray(e.lists)}};o(of,"WatchCardSectionSequence");of.type="WatchCardSectionSequence";var gT=of;var rf=class extends Rt{constructor(e){super(e)}};o(rf,"WatchNextTabbedResults");rf.type="WatchNextTabbedResults";var xT=rf;var sf=class extends s{constructor(e){var i,n;super(),this.title=e.title,this.content=l.parseItem(e.content,ve),this.endpoint=new g(e.navigationEndpoint),this.category_assets={asset_key:(i=e.categoryAssets)===null||i===void 0?void 0:i.assetKey,background_color:(n=e.categoryAssets)===null||n===void 0?void 0:n.backgroundColor},this.category_type=e.categoryType}};o(sf,"AnchoredSection");sf.type="AnchoredSection";var fg=sf;var af,uf=class extends s{constructor(e){super(),af.set(this,void 0),this.child_display_name=new u(e.childDisplayName),this.child_account_description=new u(e.childAccountDescription),this.avatar=y.fromResponse(e.avatar),this.block_button=l.parseItem(e.blockButton,[xe]),this.blocked_entity_key=e.blockedEntityKey}blockChannel(){return T(this,void 0,void 0,function*(){if(!m(this,af,"f"))throw new b("An active caller must be provide to perform this operation.");let e=this.block_button;if(!e)throw new b("Block button was not found.",{child_display_name:this.child_display_name});if(e.is_toggled)throw new b("This channel is already blocked.",{child_display_name:this.child_display_name});return yield e.endpoint.call(m(this,af,"f"),{parse:!1})})}setActions(e){E(this,af,e,"f")}};o(uf,"KidsBlocklistPickerItem");af=new WeakMap;uf.type="KidsBlocklistPickerItem";var mg=uf;var lf=class extends s{constructor(e){super(),this.title=new u(e.title),this.child_rows=l.parse(e.childRows,!0,[mg]),this.done_button=l.parseItem(e.doneButton,[I]),this.successful_toast_action_message=new u(e.successfulToastActionMessage)}};o(lf,"KidsBlocklistPicker");lf.type="KidsBlocklistPicker";var vT=lf;var cf=class extends s{constructor(e){var i,n;super(),this.title=new u(e.title),this.category_assets={asset_key:(i=e.categoryAssets)===null||i===void 0?void 0:i.assetKey,background_color:(n=e.categoryAssets)===null||n===void 0?void 0:n.backgroundColor},this.category_type=e.categoryType,this.endpoint=new g(e.endpoint)}};o(cf,"KidsCategoryTab");cf.type="KidsCategoryTab";var hg=cf;var pf=class extends s{constructor(e){super(),this.category_tabs=l.parseArray(e.categoryTabs,hg),this.privacy_button=l.parseItem(e.privacyButtonRenderer,I)}};o(pf,"KidsCategoriesHeader");pf.type="kidsCategoriesHeader";var yT=pf;var df=class extends s{constructor(e){super(),this.anchors=l.parseArray(e.anchors,fg)}};o(df,"KidsHomeScreen");df.type="kidsHomeScreen";var bT=df;var Ox={};ye(Ox,{camelToSnake:()=>un,createRuntimeClass:()=>RT,generateRuntimeClass:()=>hf,generateTypescriptClass:()=>gg,inferType:()=>_g,introspect:()=>Mx,isArrayType:()=>PT,isIgnoredKey:()=>NT,isMiscType:()=>ET,isRenderer:()=>Vx,isRendererList:()=>CT,mergeKeyInfo:()=>ff,parse:()=>Lx,toParser:()=>Bx,toTypeDeclaration:()=>Dx});var lk=new Set(["trackingParams","accessibility","accessibilityData"]),Ax={};function un(t){return t.replace(/[A-Z]/g,e=>`_${e.toLowerCase()}`)}o(un,"camelToSnake");function _g(t,e){let i=!1;if(typeof e=="object"&&e!=null){if(i=Vx(e))return Ax[i]=Reflect.get(e,Reflect.ownKeys(e)[0]),{type:"renderer",renderers:[i],optional:!1};if(i=CT(e)){for(let[r,a]of Object.entries(i))Ax[r]=a;return{type:"array",array_type:"renderer",renderers:Object.keys(i),optional:!1}}if((i=ET(t,e))||(i=PT(e)))return i}let n=typeof e;return n==="object"?{type:"object",keys:Object.entries(e).map(([r,a])=>[r,_g(r,a)]),optional:!1}:{type:"primative",typeof:[n],optional:!1}}o(_g,"inferType");function CT(t){let e=Array.isArray(t);return e&&t.length===0?!1:e&&t.every(n=>Vx(n))?Object.fromEntries(t.map(n=>{let r=Reflect.ownKeys(n)[0].toString();return[_f(r),n[r]]})):!1}o(CT,"isRendererList");function ET(t,e){if(typeof e=="object"&&e!==null){if(t.endsWith("Endpoint")||t.endsWith("Command")||t==="endpoint")return{type:"misc",endpoint:new g(e),optional:!1,misc_type:"NavigationEndpoint"};if(Reflect.has(e,"simpleText")||Reflect.has(e,"runs")){let i=new u(e);return{type:"misc",misc_type:"Text",optional:!1,endpoint:i.endpoint,text:i.toString()}}if(Reflect.has(e,"thumbnails")&&Array.isArray(Reflect.get(e,"thumbnails")))return{type:"misc",misc_type:"Thumbnail",optional:!1}}return!1}o(ET,"isMiscType");function Vx(t){if(!(typeof t=="object"))return!1;let i=Reflect.ownKeys(t);if(i.length===1){let n=i[0].toString();if(n.endsWith("Renderer")||n.endsWith("Model"))return _f(n)}return!1}o(Vx,"isRenderer");function PT(t){if(!Array.isArray(t))return!1;if(t.length===0)return{type:"array",array_type:"primitive",items:{type:"primative",typeof:["never"],optional:!1},optional:!1};let e=t.map(a=>typeof a);if(!e.every(a=>a===e[0]))return{type:"array",array_type:"primitive",items:{type:"primative",typeof:["unknown"],optional:!1},optional:!1};let n=e[0];if(n!=="object")return{type:"array",array_type:"primitive",items:{type:"primative",typeof:[n],optional:!1},optional:!1};let r=[];for(let a=0;a[p,_g(p,d)]);if(a===0){r=c;continue}r=ff(r,c).resolved_key_info}return{type:"array",array_type:"object",items:{type:"object",keys:r,optional:!1},optional:!1}}o(PT,"isArrayType");function ck(t){if(typeof t!="object"||t===null)throw new b("Generator: Cannot introspect non-object",{classdata:t});return Reflect.ownKeys(t).filter(i=>!NT(i)).filter(i=>typeof i=="string").map(i=>{let n=Reflect.get(t,i),r=_g(i,n);return[i,r]})}o(ck,"introspectKeysFirstPass");function pk(t){var e;let n=t.filter(([,p])=>{var d;return p.type!=="misc"||!(p.misc_type==="NavigationEndpoint"||p.misc_type==="Text")?!1:((d=p.endpoint)===null||d===void 0?void 0:d.metadata.page_type)==="WEB_PAGE_TYPE_CHANNEL"}).sort(([,p],[,d])=>p.type!=="misc"||d.type!=="misc"||p.misc_type!=="Text"||d.misc_type!=="Text"?0:d.text.length-p.text.length),r=new Set,a=n[0],c;if(a){r.add(a[0]);let d=t.map(([w])=>w).filter(w=>w.endsWith("Badges")||w==="badges"),f=(e=d.filter(w=>w.startsWith("owner")||w.startsWith("author"))[0])!==null&&e!==void 0?e:d[0],x=t.find(([w])=>w===f),v=x?x[1].type==="array"&&x[1].array_type==="renderer"&&Reflect.has(x[1].renderers,"MetadataBadge"):!1;v&&f&&r.add(f),c={type:"misc",misc_type:"Author",optional:!1,params:[a[0],v?f:void 0]}}return c&&t.push(["author",c]),t.filter(([p])=>!r.has(p))}o(pk,"introspectKeysSecondPass");function dk(t){let e=ck(t);return pk(e)}o(dk,"introspect2");function Mx(t){let e=dk(t),i=new Map;for(let[,r]of e)if(r.type==="renderer"||r.type==="array"&&r.array_type==="renderer")for(let a of r.renderers){let c=Ax[a];c&&i.set(a,c)}let n=Array.from(i).filter(([r])=>!xg(r));return{key_info:e,unimplemented_dependencies:n}}o(Mx,"introspect");function NT(t){return typeof t=="string"&&lk.has(t)}o(NT,"isIgnoredKey");function RT(t,e,i){var n,r;i({error_type:"class_not_found",classname:t,key_info:e});let a=(n=o(class extends s{static set key_info(c){E(this,n,new Map(c),"f",r)}static get key_info(){return[...m(this,n,"f",r).entries()]}constructor(c){super();let{key_info:p,unimplemented_dependencies:d}=Mx(c),{resolved_key_info:_,changed_keys:f}=ff(a.key_info,p);f.length>0&&(a.key_info=_,i({error_type:"class_changed",classname:t,key_info:a.key_info,changed_keys:f}));for(let[v,w]of d)hf(v,w,i);for(let[v,w]of p){let k=un(v);w.type==="misc"&&w.misc_type==="NavigationEndpoint"&&(k="endpoint"),Reflect.set(this,k,Lx(v,w,c))}}},"_a"),O0(n,"node"),n.type=t,r={value:new Map},n);return a.key_info=e,Object.defineProperty(a,"name",{value:t,writable:!1}),a}o(RT,"createRuntimeClass");function hf(t,e,i){let{key_info:n,unimplemented_dependencies:r}=Mx(e),a=RT(t,n,i);Fx(t,a);for(let[c,p]of r)hf(c,p,i);return a}o(hf,"generateRuntimeClass");function gg(t,e){let i=[],n=["super();"];for(let[r,a]of e){let c=un(r);a.type==="misc"&&a.misc_type==="NavigationEndpoint"&&(c="endpoint"),i.push(`${c}${a.optional?"?":""}: ${Dx(a)};`),n.push(`this.${c} = ${Bx(r,a)};`)}return`class ${t} extends YTNode { +var Mw=Object.defineProperty;var r=(t,e)=>Mw(t,"name",{value:e,configurable:!0});var Xe=(t,e)=>{for(var i in e)Mw(t,i,{get:e[i],enumerable:!0})};function Lw(t,e,i){return typeof e=="symbol"&&(e=e.description?"[".concat(e.description,"]"):""),Object.defineProperty(t,"name",{configurable:!0,value:i?"".concat(i," ",e):e})}r(Lw,"__setFunctionName");function u(t,e,i,s){if(i==="a"&&!s)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!s:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return i==="m"?s:i==="a"?s.call(t):s?s.value:e.get(t)}r(u,"__classPrivateFieldGet");function I(t,e,i,s,o){if(s==="m")throw new TypeError("Private method is not writable");if(s==="a"&&!o)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!o:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return s==="a"?o.call(t,i):o?o.value=i:e.set(t,i),i}r(I,"__classPrivateFieldSet");var Js={};Xe(Js,{ChannelError:()=>Ns,InnertubeError:()=>g,MissingParamError:()=>td,OAuth2Error:()=>le,ParsingError:()=>Qe,Platform:()=>M,PlayerError:()=>Ct,SessionError:()=>Ar,base64ToU8:()=>rg,concatMemos:()=>jg,debugFetch:()=>xC,deepCompare:()=>pd,escapeStringRegexp:()=>uw,findFunction:()=>id,generateRandomString:()=>$i,generateSidAuth:()=>dC,getCookie:()=>yC,getRandomUserAgent:()=>Zi,getStringBetweenStrings:()=>Ee,hasKeys:()=>_C,isTextRun:()=>Oe,streamToIterable:()=>jb,throwIfMissing:()=>Hs,timeToSeconds:()=>_e,u8ToBase64:()=>zt});var Gb={};Xe(Gb,{Maybe:()=>zi,Memo:()=>ui,SuperParsedResult:()=>Nt,YTNode:()=>n,observe:()=>G});var O={};Xe(O,{Level:()=>ht,debug:()=>xk,error:()=>dk,info:()=>_k,setLevel:()=>yk,warn:()=>Ht,warnOnce:()=>hk});var mk="YOUTUBEJS",ht={NONE:0,ERROR:1,WARNING:2,INFO:3,DEBUG:4},Ow={[ht.ERROR]:(...t)=>console.error(...t),[ht.WARNING]:(...t)=>console.warn(...t),[ht.INFO]:(...t)=>console.info(...t),[ht.DEBUG]:(...t)=>console.debug(...t)},Bw=[ht.WARNING],Dw=new Set;function qs(t,e,i){if(!Ow[t]||!Bw.includes(t))return;let s=[`[${mk}]`];e&&s.push(`[${e}]`),Ow[t](`${s.join("")}:`,...i||[])}r(qs,"doLog");var hk=r((t,...e)=>{Dw.has(t)||(qs(ht.WARNING,t,e),Dw.add(t))},"warnOnce"),Ht=r((t,...e)=>qs(ht.WARNING,t,e),"warn"),dk=r((t,...e)=>qs(ht.ERROR,t,e),"error"),_k=r((t,...e)=>qs(ht.INFO,t,e),"info"),xk=r((t,...e)=>qs(ht.DEBUG,t,e),"debug");function yk(...t){Bw=t}r(yk,"setLevel");var Wb,Yw,fe,Q,Pt,$t,qi,Vw=Symbol("ObservedArray.isObserved"),n=class{constructor(){Wb.add(this),this.type=this.constructor.type}is(...e){return e.some(i=>u(this,Wb,"m",Yw).call(this,i))}as(...e){if(!this.is(...e))throw new Qe(`Cannot cast ${this.type} to one of ${e.map(i=>i.type).join(", ")}`);return this}hasKey(e){return Reflect.has(this,e)}key(e){if(!this.hasKey(e))throw new Qe(`Missing key ${e}`);return new zi(this[e])}};r(n,"YTNode");Wb=new WeakSet,Yw=r(function(e){return this.type===e.type},"_YTNode_is");n.type="YTNode";var bk="Maybe",zi=class{constructor(e){fe.add(this),Q.set(this,void 0),I(this,Q,e,"f")}get typeof(){return typeof u(this,Q,"f")}string(){return u(this,fe,"m",$t).call(this,"string")}isString(){return u(this,fe,"m",Pt).call(this,"string")}number(){return u(this,fe,"m",$t).call(this,"number")}isNumber(){return u(this,fe,"m",Pt).call(this,"number")}bigint(){return u(this,fe,"m",$t).call(this,"bigint")}isBigint(){return u(this,fe,"m",Pt).call(this,"bigint")}boolean(){return u(this,fe,"m",$t).call(this,"boolean")}isBoolean(){return u(this,fe,"m",Pt).call(this,"boolean")}symbol(){return u(this,fe,"m",$t).call(this,"symbol")}isSymbol(){return u(this,fe,"m",Pt).call(this,"symbol")}undefined(){return u(this,fe,"m",$t).call(this,"undefined")}isUndefined(){return u(this,fe,"m",Pt).call(this,"undefined")}null(){if(u(this,Q,"f")!==null)throw new TypeError(`Expected null, got ${typeof u(this,Q,"f")}`);return u(this,Q,"f")}isNull(){return u(this,Q,"f")===null}object(){return u(this,fe,"m",$t).call(this,"object")}isObject(){return u(this,fe,"m",Pt).call(this,"object")}function(){return u(this,fe,"m",$t).call(this,"function")}isFunction(){return u(this,fe,"m",Pt).call(this,"function")}array(){if(!Array.isArray(u(this,Q,"f")))throw new TypeError(`Expected array, got ${typeof u(this,Q,"f")}`);return u(this,Q,"f")}arrayOfMaybe(){let e=[];return new Proxy(this.array(),{get(i,s){return Reflect.has(e,s)?Reflect.get(i,s):new zi(Reflect.get(i,s))}})}isArray(){return Array.isArray(u(this,Q,"f"))}node(){if(!(u(this,Q,"f")instanceof n))throw new TypeError(`Expected YTNode, got ${u(this,Q,"f").constructor.name}`);return u(this,Q,"f")}isNode(){return u(this,Q,"f")instanceof n}nodeOfType(...e){return this.node().as(...e)}isNodeOfType(...e){return this.isNode()&&this.node().is(...e)}observed(){if(!this.isObserved())throw new TypeError(`Expected ObservedArray, got ${typeof u(this,Q,"f")}`);return u(this,Q,"f")}isObserved(){var e;return(e=u(this,Q,"f"))==null?void 0:e[Vw]}parsed(){if(!(u(this,Q,"f")instanceof Nt))throw new TypeError(`Expected SuperParsedResult, got ${typeof u(this,Q,"f")}`);return u(this,Q,"f")}isParsed(){return u(this,Q,"f")instanceof Nt}any(){return Ht(bk,"This call is not meant to be used outside of debugging. Please use the specific type getter instead."),u(this,Q,"f")}instanceof(e){if(!this.isInstanceof(e))throw new TypeError(`Expected instance of ${e.name}, got ${u(this,Q,"f").constructor.name}`);return u(this,Q,"f")}isInstanceof(e){return u(this,Q,"f")instanceof e}};r(zi,"Maybe");Q=new WeakMap,fe=new WeakSet,Pt=r(function(e){return typeof u(this,Q,"f")===e},"_Maybe_checkPrimitive"),$t=r(function(e){if(!u(this,fe,"m",Pt).call(this,e))throw new TypeError(`Expected ${e}, got ${this.typeof}`);return u(this,Q,"f")},"_Maybe_assertPrimitive");var Nt=class{constructor(e){qi.set(this,void 0),I(this,qi,e,"f")}get is_null(){return u(this,qi,"f")===null}get is_array(){return!this.is_null&&Array.isArray(u(this,qi,"f"))}get is_node(){return!this.is_array}array(){if(!this.is_array)throw new TypeError("Expected an array, got a node");return u(this,qi,"f")}item(){if(!this.is_node)throw new TypeError("Expected a node, got an array");return u(this,qi,"f")}};r(Nt,"SuperParsedResult");qi=new WeakMap;function G(t){return new Proxy(t,{get(e,i){return i=="get"?(s,o)=>e.find((a,l)=>{let f=pd(s,a);return f&&o&&e.splice(l,1),f}):i==Vw?!0:i=="getAll"?(s,o)=>e.filter((a,l)=>{let f=pd(s,a);return f&&o&&e.splice(l,1),f}):i=="matchCondition"?s=>e.find(o=>s(o)):i=="filterType"?(...s)=>G(e.filter(o=>!!o.is(...s))):i=="firstOfType"?(...s)=>e.find(o=>!!o.is(...s)):i=="first"?()=>e[0]:i=="as"?(...s)=>G(e.map(o=>{if(o.is(...s))return o;throw new Qe(`Expected node of any type ${s.map(a=>a.type).join(", ")}, got ${o.type}`)})):i=="remove"?s=>e.splice(s,1):Reflect.get(e,i)}})}r(G,"observe");var ui=class extends Map{getType(...e){return e=e.flat(),G(e.flatMap(i=>this.get(i.type)||[]))}};r(ui,"Memo");var zg={};Xe(zg,{Author:()=>P,ChildElement:()=>ox,EmojiRun:()=>_i,Format:()=>rb,Text:()=>p,TextRun:()=>xi,Thumbnail:()=>y,VideoDetails:()=>Li});var z={};Xe(z,{CLIENTS:()=>V,INNERTUBE_HEADERS_BASE:()=>wk,OAUTH:()=>gk,STREAM_HEADERS:()=>Kt,SUPPORTED_CLIENTS:()=>cd,URLS:()=>We});var We=Object.freeze({YT_BASE:"https://www.youtube.com",YT_MUSIC_BASE:"https://music.youtube.com",YT_SUGGESTIONS:"https://suggestqueries.google.com/complete/",YT_UPLOAD:"https://upload.youtube.com/",API:Object.freeze({BASE:"https://youtubei.googleapis.com",PRODUCTION_1:"https://www.youtube.com/youtubei/",PRODUCTION_2:"https://youtubei.googleapis.com/youtubei/",STAGING:"https://green-youtubei.sandbox.googleapis.com/youtubei/",RELEASE:"https://release-youtubei.sandbox.googleapis.com/youtubei/",TEST:"https://test-youtubei.sandbox.googleapis.com/youtubei/",CAMI:"http://cami-youtubei.sandbox.googleapis.com/youtubei/",UYTFE:"https://uytfe.sandbox.google.com/youtubei/"}),GOOGLE_SEARCH_BASE:"https://www.google.com/"}),gk=Object.freeze({REGEX:Object.freeze({TV_SCRIPT:new RegExp(']*><\\/script>'),CLIENT_IDENTITY:new RegExp('clientId:"(?[^"]+)",[^"]*?:"(?[^"]+)"')})}),V=Object.freeze({IOS:{NAME_ID:"5",NAME:"iOS",VERSION:"18.06.35",USER_AGENT:"com.google.ios.youtube/18.06.35 (iPhone; CPU iPhone OS 14_4 like Mac OS X; en_US)",DEVICE_MODEL:"iPhone10,6"},WEB:{NAME_ID:"1",NAME:"WEB",VERSION:"2.20241121.01.00",API_KEY:"AIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8",API_VERSION:"v1",STATIC_VISITOR_ID:"6zpwvWUNAco"},MWEB:{NAME_ID:"2",NAME:"MWEB",VERSION:"2.20241205.01.00",API_VERSION:"v1"},WEB_KIDS:{NAME_ID:"76",NAME:"WEB_KIDS",VERSION:"2.20230111.00.00"},YTMUSIC:{NAME_ID:"67",NAME:"WEB_REMIX",VERSION:"1.20211213.00.00"},ANDROID:{NAME_ID:"3",NAME:"ANDROID",VERSION:"19.35.36",SDK_VERSION:33,USER_AGENT:"com.google.android.youtube/19.35.36(Linux; U; Android 13; en_US; SM-S908E Build/TP1A.220624.014) gzip"},YTSTUDIO_ANDROID:{NAME_ID:"14",NAME:"ANDROID_CREATOR",VERSION:"22.43.101"},YTMUSIC_ANDROID:{NAME_ID:"21",NAME:"ANDROID_MUSIC",VERSION:"5.34.51"},TV:{NAME_ID:"7",NAME:"TVHTML5",VERSION:"7.20241016.15.00",USER_AGENT:"Mozilla/5.0 (ChromiumStylePlatform) Cobalt/Version"},TV_EMBEDDED:{NAME_ID:"85",NAME:"TVHTML5_SIMPLY_EMBEDDED_PLAYER",VERSION:"2.0"},WEB_EMBEDDED:{NAME_ID:"56",NAME:"WEB_EMBEDDED_PLAYER",VERSION:"2.20240111.09.00",API_KEY:"AIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8",API_VERSION:"v1",STATIC_VISITOR_ID:"6zpwvWUNAco"},WEB_CREATOR:{NAME_ID:"62",NAME:"WEB_CREATOR",VERSION:"1.20240918.03.00",API_KEY:"AIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8",API_VERSION:"v1",STATIC_VISITOR_ID:"6zpwvWUNAco"}}),Kt=Object.freeze({accept:"*/*",origin:"https://www.youtube.com",referer:"https://www.youtube.com",DNT:"?1"}),wk=Object.freeze({accept:"*/*","accept-encoding":"gzip, deflate","content-type":"application/json"}),cd=["IOS","WEB","MWEB","YTKIDS","YTMUSIC","ANDROID","YTSTUDIO_ANDROID","YTMUSIC_ANDROID","TV","TV_EMBEDDED","WEB_EMBEDDED","WEB_CREATOR"];var c={};Xe(c,{addRuntimeParser:()=>Bg,applyCommentsMutations:()=>iE,applyMutations:()=>tE,getDynamicParsers:()=>E1,getParserByName:()=>xs,hasParser:()=>Dh,parse:()=>De,parseActions:()=>eE,parseArray:()=>Ce,parseC:()=>ZS,parseCommand:()=>JS,parseCommands:()=>N1,parseFormats:()=>Ug,parseItem:()=>q,parseLC:()=>Vg,parseRR:()=>sb,parseResponse:()=>Yg,sanitizeClassName:()=>ys,setParserErrorHandler:()=>I1,shouldIgnore:()=>Wg});var mr={};Xe(mr,{AboutChannel:()=>vd,AboutChannelView:()=>Td,AccountChannel:()=>Id,AccountItem:()=>Sd,AccountItemSection:()=>kd,AccountItemSectionHeader:()=>Ed,AccountSectionList:()=>Cd,AddBannerToLiveChatCommand:()=>sv,AddChatItemAction:()=>Rx,AddLiveChatTickerItemAction:()=>ov,AddToPlaylist:()=>CT,AddToPlaylistCommand:()=>HT,AddToPlaylistEndpoint:()=>d0,AddToPlaylistServiceEndpoint:()=>ax,Alert:()=>Br,AlertWithButton:()=>Vd,AnchoredSection:()=>Xy,AppendContinuationItemsAction:()=>er,AttributionView:()=>Ud,AudioOnlyPlayability:()=>Fd,AuthorCommentBadge:()=>QT,AutomixPreviewVideo:()=>Wd,AvatarView:()=>Gd,BackstageImage:()=>jd,BackstagePost:()=>bi,BackstagePostThread:()=>PT,BadgeView:()=>gi,BrowseEndpoint:()=>_0,BrowseFeedActions:()=>Qd,BrowserMediaSession:()=>NT,Button:()=>v,ButtonView:()=>Te,C4TabbedHeader:()=>$r,CallToActionButton:()=>AT,Card:()=>RT,CardCollection:()=>S_,CarouselHeader:()=>E_,CarouselItem:()=>MT,CarouselLockup:()=>b_,ChangeEngagementPanelVisibilityAction:()=>wT,Channel:()=>k_,ChannelAboutFullMetadata:()=>pa,ChannelAgeGate:()=>LT,ChannelExternalLinkView:()=>wd,ChannelFeaturedContent:()=>OT,ChannelHeaderLinks:()=>Jd,ChannelHeaderLinksView:()=>Zd,ChannelMetadata:()=>C_,ChannelMobileHeader:()=>DT,ChannelOptions:()=>P_,ChannelOwnerEmptyState:()=>BT,ChannelSubMenu:()=>_a,ChannelSwitcherHeader:()=>YT,ChannelSwitcherPage:()=>Nd,ChannelTagline:()=>v_,ChannelThumbnailWithLink:()=>VT,ChannelVideoPlayer:()=>UT,Chapter:()=>N_,ChildVideo:()=>FT,ChipBarView:()=>WT,ChipCloud:()=>Kr,ChipCloudChip:()=>je,ChipView:()=>A_,ClipAdState:()=>i_,ClipCreation:()=>r_,ClipCreationScrubber:()=>t_,ClipCreationTextInput:()=>e_,ClipSection:()=>s_,CollaboratorInfoCardContent:()=>GT,CollageHeroImage:()=>jT,CollectionThumbnailView:()=>D_,CommandExecutorCommand:()=>$T,CommentActionButtons:()=>$d,CommentDialog:()=>JT,CommentReplies:()=>V_,CommentReplyDialog:()=>U_,CommentSimplebox:()=>j_,CommentThread:()=>$_,CommentView:()=>or,CommentsEntryPointHeader:()=>G_,CommentsEntryPointTeaser:()=>W_,CommentsHeader:()=>Si,CommentsSimplebox:()=>F_,CompactChannel:()=>t0,CompactLink:()=>yi,CompactMix:()=>i0,CompactMovie:()=>r0,CompactPlaylist:()=>s0,CompactStation:()=>o0,CompactVideo:()=>Gr,ConfirmDialog:()=>n0,ContentMetadataView:()=>Xr,ContentPreviewImageView:()=>rr,ContinuationCommand:()=>KT,ContinuationItem:()=>J,ConversationBar:()=>a0,CopyLink:()=>Qr,CreateCommentEndpoint:()=>x0,CreatePlaylistDialog:()=>yd,CreatePlaylistDialogFormView:()=>z_,CreatePlaylistServiceEndpoint:()=>y0,CreatorHeart:()=>Hd,DecoratedAvatarView:()=>Jr,DecoratedPlayerBar:()=>Z_,DefaultPromoPanel:()=>p0,DeletePlaylistEndpoint:()=>b0,DescriptionPreviewView:()=>ex,DialogHeaderView:()=>tx,DialogView:()=>c0,DidYouMean:()=>l0,DimChatItemAction:()=>nv,DislikeButtonView:()=>qd,DownloadButton:()=>Yr,Dropdown:()=>hi,DropdownItem:()=>xd,DropdownView:()=>K_,DynamicTextView:()=>sx,Element:()=>nx,EmergencyOnebox:()=>u0,EmojiPicker:()=>Y_,EmojiPickerCategory:()=>f0,EmojiPickerCategoryButton:()=>m0,EmojiPickerUpsellCategory:()=>h0,EndScreenPlaylist:()=>lx,EndScreenVideo:()=>ux,Endscreen:()=>cx,EndscreenElement:()=>Y0,EngagementPanelSectionList:()=>Ii,EngagementPanelTitleHeader:()=>o_,EomSettingsDisclaimer:()=>V0,ExpandableMetadata:()=>f_,ExpandableTab:()=>es,ExpandableVideoDescriptionBody:()=>c_,ExpandedShelfContents:()=>U0,Factoid:()=>vi,FancyDismissibleDialog:()=>F0,FeedFilterChipBar:()=>vt,FeedNudge:()=>W0,FeedTabbedHeader:()=>fx,FeedbackEndpoint:()=>g0,FlexibleActionsView:()=>mx,FormFooterView:()=>rx,GameCard:()=>l_,GameDetails:()=>G0,GetAccountsListInnertubeEndpoint:()=>w0,GetKidsBlocklistPickerCommand:()=>qT,GetMultiPageMenuAction:()=>TT,Grid:()=>j0,GridChannel:()=>hx,GridHeader:()=>H0,GridMix:()=>$0,GridMovie:()=>K0,GridPlaylist:()=>dx,GridShow:()=>q0,GridVideo:()=>yx,GuideCollapsibleEntry:()=>z0,GuideCollapsibleSectionEntry:()=>X0,GuideDownloadsEntry:()=>Q0,GuideEntry:()=>fr,GuideSection:()=>ts,GuideSubscriptionsSection:()=>bx,HashtagHeader:()=>gx,HashtagTile:()=>J0,HeatMarker:()=>X_,Heatmap:()=>Q_,HeroPlaylistThumbnail:()=>Z0,HideEngagementPanelEndpoint:()=>T0,HighlightsCarousel:()=>ev,HistorySuggestion:()=>tv,HorizontalCardList:()=>wi,HorizontalList:()=>u_,HorizontalMovieList:()=>iv,IconLink:()=>Tx,ImageBannerView:()=>vx,IncludingResultsFor:()=>rv,InfoPanelContainer:()=>Sx,InfoPanelContent:()=>Ix,InfoRow:()=>y_,InteractiveTabbedHeader:()=>Ex,ItemSection:()=>It,ItemSectionHeader:()=>is,ItemSectionTab:()=>kx,ItemSectionTabbedHeader:()=>rs,KidsBlocklistPicker:()=>YS,KidsBlocklistPickerItem:()=>Qy,KidsCategoriesHeader:()=>VS,KidsCategoryTab:()=>Jy,KidsHomeScreen:()=>US,LikeButton:()=>Vr,LikeButtonView:()=>Kd,LikeEndpoint:()=>v0,LiveChat:()=>Px,LiveChatActionPanel:()=>Dx,LiveChatAuthorBadge:()=>Mx,LiveChatAutoModMessage:()=>av,LiveChatBanner:()=>Ax,LiveChatBannerChatSummary:()=>pv,LiveChatBannerHeader:()=>Nx,LiveChatBannerPoll:()=>cv,LiveChatBannerRedirect:()=>lv,LiveChatDialog:()=>Dv,LiveChatHeader:()=>Wx,LiveChatItemContextMenuEndpoint:()=>I0,LiveChatItemList:()=>Gx,LiveChatMembershipItem:()=>uv,LiveChatMessageInput:()=>Bv,LiveChatModeChangeMessage:()=>fv,LiveChatPaidMessage:()=>mv,LiveChatPaidSticker:()=>hv,LiveChatParticipant:()=>jx,LiveChatParticipantsList:()=>Hx,LiveChatPlaceholderItem:()=>dv,LiveChatProductItem:()=>_v,LiveChatRestrictedParticipation:()=>xv,LiveChatSponsorshipsGiftPurchaseAnnouncement:()=>yv,LiveChatSponsorshipsGiftRedemptionAnnouncement:()=>bv,LiveChatSponsorshipsHeader:()=>Lx,LiveChatTextMessage:()=>gv,LiveChatTickerPaidMessageItem:()=>Ox,LiveChatTickerPaidStickerItem:()=>wv,LiveChatTickerSponsorItem:()=>Tv,LiveChatViewerEngagementMessage:()=>vv,LockupMetadataView:()=>$x,LockupView:()=>Kx,MacroMarkersInfoItem:()=>n_,MacroMarkersList:()=>a_,MacroMarkersListItem:()=>Fr,MarkChatItemAsDeletedAction:()=>Sv,MarkChatItemsByAuthorAsDeletedAction:()=>Ev,Menu:()=>R,MenuFlexibleItem:()=>Xd,MenuNavigationItem:()=>qx,MenuPopup:()=>Yv,MenuServiceItem:()=>At,MenuServiceItemDownload:()=>zd,MenuTitle:()=>Bd,MerchandiseItem:()=>Uv,MerchandiseShelf:()=>Jx,Message:()=>ki,MetadataBadge:()=>Ge,MetadataRow:()=>Fv,MetadataRowContainer:()=>Zx,MetadataRowHeader:()=>Wv,MetadataScreen:()=>Gv,MicroformatData:()=>Ci,Mix:()=>jv,MobileTopbar:()=>gI,ModalWithTitleAndButton:()=>Hv,ModifyChannelNotificationPreferenceEndpoint:()=>S0,Movie:()=>$v,MovingThumbnail:()=>Kv,MultiMarkersPlayerBar:()=>J_,MultiPageMenu:()=>Pd,MultiPageMenuNotificationSection:()=>Vv,MultiPageMenuSection:()=>wI,MusicCardShelf:()=>qv,MusicCardShelfHeaderBasic:()=>ey,MusicCarouselShelf:()=>sI,MusicCarouselShelfBasicHeader:()=>ty,MusicDescriptionShelf:()=>ay,MusicDetailHeader:()=>oI,MusicDownloadStateBadge:()=>nI,MusicEditablePlaylistDetailHeader:()=>aI,MusicElementHeader:()=>pI,MusicHeader:()=>cI,MusicImmersiveHeader:()=>lI,MusicInlineBadge:()=>os,MusicItemThumbnailOverlay:()=>Mt,MusicLargeCardItemCarousel:()=>uI,MusicMenuItemDivider:()=>zx,MusicMultiRowListItem:()=>iy,MusicMultiSelectMenu:()=>Xx,MusicMultiSelectMenuItem:()=>ss,MusicNavigationButton:()=>ry,MusicPlayButton:()=>ns,MusicPlaylistEditHeader:()=>fI,MusicPlaylistShelf:()=>mI,MusicQueue:()=>ly,MusicResponsiveHeader:()=>hI,MusicResponsiveListItem:()=>Pi,MusicResponsiveListItemFixedColumn:()=>sy,MusicResponsiveListItemFlexColumn:()=>oy,MusicShelf:()=>dI,MusicSideAlignedItem:()=>_I,MusicSortFilterButton:()=>xI,MusicTastebuilderShelf:()=>yI,MusicTastebuilderShelfThumbnail:()=>uy,MusicThumbnail:()=>Ie,MusicTwoRowItem:()=>ny,MusicVisualHeader:()=>bI,NavigationEndpoint:()=>d,Notification:()=>fy,NotificationAction:()=>SI,OpenPopupAction:()=>_d,PageHeader:()=>Lt,PageHeaderView:()=>my,PageIntroduction:()=>hy,PanelFooterView:()=>ix,PdgCommentChip:()=>ZT,PerformCommentActionEndpoint:()=>E0,PivotBar:()=>TI,PivotBarItem:()=>vI,PivotButton:()=>dy,PlayerAnnotationsExpanded:()=>_y,PlayerCaptionsTracklist:()=>xy,PlayerControlsOverlay:()=>EI,PlayerErrorMessage:()=>kI,PlayerLegacyDesktopYpcOffer:()=>CI,PlayerLegacyDesktopYpcTrailer:()=>Tf,PlayerLiveStoryboardSpec:()=>gy,PlayerMicroformat:()=>et,PlayerOverflow:()=>yy,PlayerOverlay:()=>Iy,PlayerOverlayAutoplay:()=>wy,PlayerOverlayVideoDetails:()=>Ty,PlayerStoryboardSpec:()=>Qi,Playlist:()=>Rt,PlaylistAddToOption:()=>Yd,PlaylistCustomThumbnail:()=>qr,PlaylistEditEndpoint:()=>k0,PlaylistHeader:()=>Sy,PlaylistInfoCardContent:()=>PI,PlaylistMetadata:()=>Ey,PlaylistPanel:()=>cy,PlaylistPanelVideo:()=>ei,PlaylistPanelVideoWrapper:()=>py,PlaylistSidebar:()=>NI,PlaylistSidebarPrimaryInfo:()=>ky,PlaylistSidebarSecondaryInfo:()=>Cy,PlaylistVideo:()=>ps,PlaylistVideoList:()=>AI,PlaylistVideoThumbnail:()=>zr,Poll:()=>RI,PollHeader:()=>Iv,Post:()=>cs,PostMultiImage:()=>MI,PrefetchWatchCommand:()=>C0,PremiereTrailerBadge:()=>LI,ProductList:()=>p_,ProductListHeader:()=>OI,ProductListItem:()=>DI,ProfileColumn:()=>BI,ProfileColumnStats:()=>YI,ProfileColumnStatsEntry:()=>VI,ProfileColumnUserInfo:()=>UI,Quiz:()=>FI,RecognitionShelf:()=>WI,ReelItem:()=>ls,ReelPlayerHeader:()=>Py,ReelPlayerOverlay:()=>GI,ReelShelf:()=>Hr,ReelWatchEndpoint:()=>P0,RelatedChipCloud:()=>Ny,RemoveBannerForLiveChatCommand:()=>kv,RemoveChatItemAction:()=>Cv,RemoveChatItemByAuthorAction:()=>Pv,ReplaceChatItemAction:()=>Nv,ReplayChatItemAction:()=>Av,RichGrid:()=>Ni,RichItem:()=>jI,RichListHeader:()=>HI,RichMetadata:()=>rm,RichMetadataRow:()=>om,RichSection:()=>$I,RichShelf:()=>Ay,RunAttestationCommand:()=>zT,SearchBox:()=>KI,SearchEndpoint:()=>N0,SearchFilter:()=>Ry,SearchFilterGroup:()=>us,SearchFilterOptionsDialog:()=>qI,SearchHeader:()=>My,SearchRefinementCard:()=>tr,SearchSubMenu:()=>Ly,SearchSuggestion:()=>wx,SearchSuggestionsSection:()=>zI,SecondarySearchContainer:()=>XI,SectionList:()=>de,SegmentedLikeDislikeButton:()=>dr,SegmentedLikeDislikeButtonView:()=>Xt,SendFeedbackAction:()=>vT,SettingBoolean:()=>QI,SettingsCheckbox:()=>Oy,SettingsOptions:()=>ms,SettingsSidebar:()=>Dy,SettingsSwitch:()=>fs,ShareEndpoint:()=>A0,ShareEntityEndpoint:()=>R0,ShareEntityServiceEndpoint:()=>Zr,SharePanelHeader:()=>Yy,SharePanelTitleV15:()=>JI,ShareTarget:()=>Vy,SharedPost:()=>By,Shelf:()=>hs,ShortsLockupView:()=>ds,ShowCustomThumbnail:()=>_x,ShowDialogCommand:()=>XT,ShowEngagementPanelEndpoint:()=>M0,ShowLiveChatActionPanelAction:()=>Rv,ShowLiveChatDialogAction:()=>Mv,ShowLiveChatTooltipCommand:()=>Lv,ShowingResultsFor:()=>ZI,SignalAction:()=>IT,SignalServiceEndpoint:()=>L0,SimpleCardContent:()=>eS,SimpleCardTeaser:()=>tS,SimpleMenuHeader:()=>Qx,SimpleTextSection:()=>iS,SingleActionEmergencySupport:()=>rS,SingleColumnBrowseResults:()=>sS,SingleColumnMusicWatchNextResults:()=>oS,SingleHeroImage:()=>nS,SlimOwner:()=>aS,SlimVideoMetadata:()=>pS,SortFilterHeader:()=>Cx,SortFilterSubMenu:()=>xt,SponsorCommentBadge:()=>e0,StartAt:()=>Uy,StructuredDescriptionContent:()=>sr,StructuredDescriptionPlaylistLockup:()=>g_,SubFeedOption:()=>Fy,SubFeedSelector:()=>cS,SubscribeButton:()=>xe,SubscribeEndpoint:()=>O0,SubscriptionNotificationToggleButton:()=>I_,Tab:()=>Se,Tabbed:()=>lS,TabbedSearchResults:()=>uS,TextFieldView:()=>q_,TextHeader:()=>fS,ThirdPartyShareTargetSection:()=>Wy,ThumbnailBadgeView:()=>M_,ThumbnailHoverOverlayView:()=>R_,ThumbnailLandscapePortrait:()=>mS,ThumbnailOverlayBadgeView:()=>L_,ThumbnailOverlayBottomPanel:()=>xx,ThumbnailOverlayEndorsement:()=>hS,ThumbnailOverlayHoverText:()=>dS,ThumbnailOverlayInlineUnplayable:()=>_S,ThumbnailOverlayLoadingPreview:()=>xS,ThumbnailOverlayNowPlaying:()=>yS,ThumbnailOverlayPinking:()=>bS,ThumbnailOverlayPlaybackStatus:()=>gS,ThumbnailOverlayResumePlayback:()=>wS,ThumbnailOverlaySidePanel:()=>TS,ThumbnailOverlayTimeStatus:()=>ir,ThumbnailOverlayToggleButton:()=>vS,ThumbnailView:()=>O_,TimedMarkerDecoration:()=>IS,TitleAndButtonListHeader:()=>SS,ToggleButton:()=>se,ToggleButtonView:()=>yt,ToggleMenuServiceItem:()=>ES,Tooltip:()=>kS,TopbarMenuButton:()=>II,TopicChannelDetails:()=>CS,Transcript:()=>Dr,TranscriptFooter:()=>Ad,TranscriptSearchBox:()=>Rd,TranscriptSearchPanel:()=>Dd,TranscriptSectionHeader:()=>Md,TranscriptSegment:()=>Ld,TranscriptSegmentList:()=>Od,TwoColumnBrowseResults:()=>Ot,TwoColumnSearchResults:()=>Gy,TwoColumnWatchNextResults:()=>Hy,UnifiedSharePanel:()=>PS,UniversalWatchCard:()=>$y,UnsubscribeEndpoint:()=>D0,UpdateChannelSwitcherPageAction:()=>ST,UpdateDateTextAction:()=>Bx,UpdateDescriptionAction:()=>Yx,UpdateEngagementPanelAction:()=>ET,UpdateLiveChatPollAction:()=>Ov,UpdateSubscribeButtonAction:()=>kT,UpdateTitleAction:()=>Vx,UpdateToggleButtonTextAction:()=>Ux,UpdateViewershipAction:()=>Fx,UploadTimeFactoid:()=>h_,UpsellDialog:()=>NS,VerticalList:()=>AS,VerticalWatchCardList:()=>RS,Video:()=>Wr,VideoAttributeView:()=>Ti,VideoAttributesSectionView:()=>T_,VideoCard:()=>m_,VideoDescriptionCourseSection:()=>w_,VideoDescriptionHeader:()=>__,VideoDescriptionInfocardsSection:()=>x_,VideoDescriptionMusicSection:()=>jr,VideoDescriptionTranscriptSection:()=>jn,VideoInfoCardContent:()=>MS,VideoOwner:()=>_s,VideoPrimaryInfo:()=>qy,VideoSecondaryInfo:()=>wh,VideoViewCount:()=>Ky,ViewCountFactoid:()=>d_,WatchCardCompactVideo:()=>zy,WatchCardHeroVideo:()=>LS,WatchCardRichHeader:()=>OS,WatchCardSectionSequence:()=>DS,WatchEndpoint:()=>px,WatchNextEndScreen:()=>vy,WatchNextEndpoint:()=>B0,WatchNextTabbedResults:()=>BS,YpcTrailer:()=>by});var Xi,ld=class{constructor(e,i){Xi.set(this,void 0),I(this,Xi,new M.shim.Cache(e,i),"f")}get cache_dir(){return u(this,Xi,"f").cache_dir}get(e){return u(this,Xi,"f").get(e)}set(e,i){return u(this,Xi,"f").set(e,i)}remove(e){return u(this,Xi,"f").remove(e)}};r(ld,"UniversalCache");Xi=new WeakMap;var Tk=ld;var Or,ud=class extends EventTarget{constructor(){super(),Or.set(this,new Map)}emit(e,...i){let s=new M.shim.CustomEvent(e,{detail:i});this.dispatchEvent(s)}on(e,i){let s=r(o=>{o instanceof M.shim.CustomEvent?i(...o.detail):i(o)},"wrapper");u(this,Or,"f").set(i,s),this.addEventListener(e,s)}once(e,i){let s=r(o=>{o instanceof M.shim.CustomEvent?i(...o.detail):i(o),this.off(e,i)},"wrapper");u(this,Or,"f").set(i,s),this.addEventListener(e,s)}off(e,i){let s=u(this,Or,"f").get(i);s&&(this.removeEventListener(e,s),u(this,Or,"f").delete(i))}};r(ud,"EventEmitterLike");Or=new WeakMap;var zs=ud;var Ji={};Xe(Ji,{chooseFormat:()=>Qw,download:()=>qk,toDash:()=>Xw});var vk={"&":"&",'"':""","'":"'","<":"<",">":">"};function Uw(t){return t.replace(/([&"<>'])/g,(e,i)=>vk[i])}r(Uw,"escapeXMLString");function Ik(t){return t==="mpd"?"MPD":t==="base-url"?"BaseURL":t.split("-").map(i=>i.charAt(0).toUpperCase()+i.slice(1)).join("")}r(Ik,"normalizeTag");function H(t,e,...i){let s=i.flat().map(o=>typeof o=="string"?Sk(o):o);return typeof t=="function"?t({...e,children:s}):{type:Ik(t),props:{...e,children:s}}}r(H,"createElement");function Sk(t){return{type:"TEXT_ELEMENT",props:{nodeValue:t}}}r(Sk,"createTextElement");async function Fw(t){if(t.type==="TEXT_ELEMENT")return Uw(typeof t.props.nodeValue=="string"?t.props.nodeValue:"");let e=`<${t.type}`;if(t.props){let i=Object.keys(t.props).filter(s=>!["children","nodeValue"].includes(s)&&t.props[s]!==void 0).map(s=>`${s}="${Uw(`${t.props[s]}`)}"`);i.length>0&&(e+=` ${i.join(" ")}`)}if(t.props.children){let i=await Promise.all((await Promise.all(t.props.children.flat())).flat().filter(s=>!!s).map(s=>Fw(s)));if(i.length>0)return e+=`>${i.join("")}`,e}return`${e}/>`}r(Fw,"renderElementToString");async function Ww(t){return`${await Fw(await t)}`}r(Ww,"renderToString");function Gw(t){return t.children}r(Gw,"Fragment");var Xs=class extends n{constructor(e){super();let i=e.spec.split("|"),s=new URL(i.shift());this.boards=i.map((o,a)=>{let[l,f,m,x,_,b,T,w]=o.split("#");s.searchParams.set("sigh",w);let S=Math.ceil(parseInt(m,10)/(parseInt(x,10)*parseInt(_,10)));return{type:"vod",template_url:s.toString().replace("$L",a).replace("$N",T),thumbnail_width:parseInt(l,10),thumbnail_height:parseInt(f,10),thumbnail_count:parseInt(m,10),interval:parseInt(b,10),columns:parseInt(x,10),rows:parseInt(_,10),storyboard_count:S}})}};r(Xs,"PlayerStoryboardSpec");Xs.type="PlayerStoryboardSpec";var Qi=Xs;var kk="StreamingInfo";function Ck(t,e){var o,a,l;let i=new Map,s=t.some(f=>!!f.audio_track);for(let f of t){if((!f.index_range||!f.init_range)&&!f.is_type_otf&&!e)continue;let m=f.mime_type.split(";")[0],x=(o=Ee(f.mime_type,'codecs="','"'))==null?void 0:o.split(".")[0],_=f.color_info?Object.values(f.color_info).join("-"):"",b=((a=f.audio_track)==null?void 0:a.id)||"",T=f.is_drc?"drc":"",w=`${m}-${x}-${_}-${b}-${T}`;i.has(w)||i.set(w,[]),(l=i.get(w))==null||l.push(f)}return{groups:Array.from(i.values()),has_multiple_audio_tracks:s}}r(Ck,"getFormatGroupings");function Hw(t,e){if(t.length>1&&new Set(t.map(i=>Ee(i.mime_type,'codecs="','"'))).size===1)return e.push("codecs"),Ee(t[0].mime_type,'codecs="','"')}r(Hw,"hoistCodecsIfPossible");function $w(t,e,i){if(t.length>1&&new Set(t.map(s=>s.fps)).size===1)return i.push(e),Number(t[0][e])}r($w,"hoistNumberAttributeIfPossible");function Pk(t,e){if(t.length>1&&new Set(t.map(i=>i.audio_channels||2)).size===1)return e.push("AudioChannelConfiguration"),t[0].audio_channels}r(Pk,"hoistAudioChannelsIfPossible");async function Nk(t,e){var f;let i=await e.session.http.fetch_function(`${t}&rn=0&sq=0`,{method:"GET",headers:Kt,redirect:"follow"}),s=i.url.replace("&rn=0","").replace("&sq=0",""),o=await i.text(),a=(f=Ee(o,"Segment-Durations-Ms:",`\r +`))==null?void 0:f.split(",");if(!a)throw new g("Failed to extract the segment durations from this OTF stream",{url:t});let l=[];for(let m of a){let x=m.trim();if(x.length===0)continue;let _,b=Ee(x,"(r=",")");b&&(_=parseInt(b)),l.push({duration:parseInt(x),repeat_count:_})}return{init_url:`${s}&sq=0`,media_url:`${s}&sq=$Number$`,timeline:l}}r(Nk,"getOTFSegmentTemplate");async function Kw(t,e){let i=await e.session.http.fetch_function(`${t}&rn=0&sq=0`,{method:"HEAD",headers:Kt,redirect:"follow"}),s=parseInt(i.headers.get("X-Head-Time-Millis")||""),o=parseInt(i.headers.get("X-Head-Seqnum")||"");if(isNaN(s)||isNaN(o))throw new g("Failed to extract the duration or segment count for this Post Live DVR video");return{duration:s/1e3,segment_count:o}}r(Kw,"getPostLiveDvrInfo");async function Ak(t,e,i,s,o,a){if(!t.item){let l=new URL(await e.decipher(o));l.searchParams.set("cpn",a||"");let f=i(l).toString();t.item=await Kw(f,s)}return t.item.duration}r(Ak,"getPostLiveDvrDuration");async function qw(t,e,i,s,o,a){let l=new URL(await t.decipher(s));l.searchParams.set("cpn",o||"");let f=e(l).toString();if(t.is_type_otf){if(!i)throw new g("Unable to get segment durations for this OTF stream without an Actions instance",{format:t});return{is_oft:!0,is_post_live_dvr:!1,getSegmentTemplate(){return Nk(f,i)}}}if(a){if(!i)throw new g("Unable to get segment count for this Post Live DVR video without an Actions instance",{format:t});let x=t.target_duration_dec;if(typeof x!="number")throw new g("Format is missing target_duration_dec",{format:t});return{is_oft:!1,is_post_live_dvr:!0,async getSegmentTemplate(){return a.item||(a.item=await Kw(f,i)),{media_url:`${f}&sq=$Number$`,timeline:[{duration:x*1e3,repeat_count:a.item.segment_count}]}}}}if(!t.index_range||!t.init_range)throw new g("Index and init ranges not available",{format:t});return{is_oft:!1,is_post_live_dvr:!1,base_url:f,index_range:t.index_range,init_range:t.init_range}}r(qw,"getSegmentInfo");async function Rk(t,e,i,s,o,a,l){new URL(await t.decipher(o)).searchParams.set("cpn",a||"");let m=[t.itag.toString()];return t.audio_track&&m.push(t.audio_track.id),t.is_drc&&m.push("drc"),{uid:m.join("-"),bitrate:t.bitrate,codecs:e.includes("codecs")?void 0:Ee(t.mime_type,'codecs="','"'),audio_sample_rate:e.includes("audio_sample_rate")?void 0:t.audio_sample_rate,channels:e.includes("AudioChannelConfiguration")?void 0:t.audio_channels||2,segment_info:await qw(t,i,s,o,a,l)}}r(Rk,"getAudioRepresentation");function Mk(t,e){if(!t.audio_track&&!e)return;let i=[t.is_original?"main":"alternate"];return(t.is_dubbed||t.is_auto_dubbed)&&i.push("dub"),t.is_descriptive&&i.push("description"),t.is_drc&&i.push("enhanced-audio-intelligibility"),i}r(Mk,"getTrackRoles");async function Lk(t,e,i,s,o,a,l){var w;let f=t[0],{audio_track:m}=f,x=[],_=!!l,b;return m?_&&f.is_drc?b=l.label_drc_multiple(m.display_name):b=m.display_name:_&&(b=f.is_drc?l.label_drc:l.label_original),{mime_type:f.mime_type.split(";")[0],language:(w=f.language)!=null?w:void 0,codecs:Hw(t,x),audio_sample_rate:$w(t,"audio_sample_rate",x),track_name:b,track_roles:Mk(f,_),channels:Pk(t,x),representations:await Promise.all(t.map(S=>Rk(S,x,e,i,s,o,a)))}}r(Lk,"getAudioSet");var Ok={BT709:"1",BT2020:"9"},jw={BT709:"1",BT2020_10:"14",SMPTEST2084:"16",ARIB_STD_B67:"18"},Dk={BT709:"1",BT2020_NCL:"14"};function Bk(t){var l;let e=t.color_info,i,s,o;if(e){if(e.primaries&&(i=Ok[e.primaries]),e.transfer_characteristics&&(s=jw[e.transfer_characteristics]),e.matrix_coefficients&&(o=Dk[e.matrix_coefficients],!o)){let f=new URL(t.url),m=JSON.parse(JSON.stringify(t));m.url="REDACTED",m.signature_cipher="REDACTED",m.cipher="REDACTED",Ht(kk,`Unknown matrix coefficients "${e.matrix_coefficients}". The DASH manifest is still usable without this. +Please report it at ${M.shim.info.bugs_url} so we can add support for it. +InnerTube client: ${f.searchParams.get("c")} +format:`,m)}}else(l=Ee(t.mime_type,'codecs="','"'))!=null&&l.startsWith("avc1")&&(s=jw.BT709);return{primaries:i,transfer_characteristics:s,matrix_coefficients:o}}r(Bk,"getColorInfo");async function Yk(t,e,i,s,o,a,l){return{uid:t.itag.toString(),bitrate:t.bitrate,width:t.width,height:t.height,codecs:i.includes("codecs")?void 0:Ee(t.mime_type,'codecs="','"'),fps:i.includes("fps")?void 0:t.fps,segment_info:await qw(t,e,o,s,a,l)}}r(Yk,"getVideoRepresentation");async function Vk(t,e,i,s,o,a){let l=t[0],f=Bk(l),m=[];return{mime_type:l.mime_type.split(";")[0],color_info:f,codecs:Hw(t,m),fps:$w(t,"fps",m),representations:await Promise.all(t.map(_=>Yk(_,e,m,i,s,o,a)))}}r(Vk,"getVideoSet");function Uk(t){var s;let e=new Map,i=t.is(Qi)?t.boards:[t.board];for(let o of i){let a=new URL(o.template_url).pathname.split(".").pop(),l=`image/${a==="jpg"?"jpeg":a}`;e.has(l)||e.set(l,[]),(s=e.get(l))==null||s.push(o)}return e}r(Uk,"getStoryboardInfo");async function Fk(t,e,i,s,o){let a=e.template_url,l=i(new URL(a.replace("$M","0"))),f=o.response?o.response:t.session.http.fetch_function(l,{method:"HEAD",headers:Kt});return o.response=f,(await f).headers.get("Content-Type")||s}r(Fk,"getStoryboardMimeType");async function Wk(t,e,i){let s=e.template_url,o=[],a=Math.min(e.type==="vod"?e.storyboard_count:5,10);for(let m=0;m({probable_mime_type:l,getMimeType(){return Fk(e,f[0],s,l,a)},representations:f.map(m=>Gk(t,e,m,s,a))}))}r(jk,"getImageSets");function Hk(t,e,i){let s=e==="vtt"?"text/vtt":"application/ttml+xml";return t.map(o=>{let a=new URL(o.base_url);a.searchParams.set("fmt",e);let l=["caption"];return a.searchParams.has("tlang")&&l.push("dub"),{mime_type:s,language:o.language_code,track_name:o.name.toString(),track_roles:l,representation:{uid:`text-${o.vss_id}`,base_url:i(a).toString()}}})}r(Hk,"getTextSets");async function fd(t,e=!1,i=_=>_,s,o,a,l,f,m,x){if(!t)throw new g("Streaming data not available");let _=s?t.adaptive_formats.filter(Y=>!s(Y)):t.adaptive_formats,b,T;if(e){if(T={},!l)throw new g("Unable to get duration or segment count for this Post Live DVR video without an Actions instance");b=r(()=>T?Ak(T,_[0],i,l,a,o):Promise.resolve(0),"getDuration")}else{let Y=_[0].approx_duration_ms/1e3;b=r(()=>Promise.resolve(Y),"getDuration")}let{groups:w,has_multiple_audio_tracks:S}=Ck(_,e),{video_groups:E,audio_groups:C}=w.reduce((Y,te)=>te[0].has_audio?(S&&!te[0].audio_track||Y.audio_groups.push(te),Y):(Y.video_groups.push(te),Y),{video_groups:[],audio_groups:[]}),k;C.flat().some(Y=>Y.is_drc)&&(k={label_original:(x==null?void 0:x.label_original)||"Original",label_drc:(x==null?void 0:x.label_drc)||"Stable Volume",label_drc_multiple:(x==null?void 0:x.label_drc_multiple)||(Y=>`${Y} (Stable Volume)`)});let U=await Promise.all(C.map(Y=>Lk(Y,i,l,a,o,T,k))),L=await Promise.all(E.map(Y=>Vk(Y,i,a,l,o,T))),K=[];if(f&&l){let Y;if(f.is(Qi))Y=_[0].approx_duration_ms/1e3;else{let te=_[0].target_duration_dec;if(te===void 0)throw new g("Format is missing target_duration_dec",{format:_[0]});Y=te}K=jk(Y,l,f,i)}let re=[];if(m&&(x==null?void 0:x.captions_format)){if(x.captions_format!=="vtt"&&x.captions_format!=="ttml")throw new g("Invalid captions format",x.captions_format);re=Hk(m,x.captions_format,i)}return{getDuration:b,audio_sets:U,video_sets:L,image_sets:K,text_sets:re}}r(fd,"getStreamingInfo");async function $k({info:t}){if(!t.is_oft&&!t.is_post_live_dvr)return null;let e=await t.getSegmentTemplate();return H("segment-template",{startNumber:e.init_url?"1":"0",timescale:"1000",initialization:e.init_url,media:e.media_url},H("segment-timeline",null,e.timeline.map(i=>H("s",{d:i.duration,r:i.repeat_count}))))}r($k,"OTFPostLiveDvrSegmentInfo");function zw({info:t}){return t.is_oft||t.is_post_live_dvr?H($k,{info:t}):H(Gw,null,H("base-url",null,t.base_url),H("segment-base",{indexRange:`${t.index_range.start}-${t.index_range.end}`},H("initialization",{range:`${t.init_range.start}-${t.init_range.end}`})))}r(zw,"SegmentInfo");async function Kk({streamingData:t,isPostLiveDvr:e,transformURL:i,rejectFormat:s,cpn:o,player:a,actions:l,storyboards:f,captionTracks:m,options:x}){let{getDuration:_,audio_sets:b,video_sets:T,image_sets:w,text_sets:S}=await fd(t,e,i,s,o,a,l,f,m,x);return H("mpd",{xmlns:"urn:mpeg:dash:schema:mpd:2011",minBufferTime:"PT1.500S",profiles:"urn:mpeg:dash:profile:isoff-main:2011",type:"static",mediaPresentationDuration:`PT${await _()}S`,"xmlns:xsi":"http://www.w3.org/2001/XMLSchema-instance","xsi:schemaLocation":"urn:mpeg:dash:schema:mpd:2011 http://standards.iso.org/ittf/PubliclyAvailableStandards/MPEG-DASH_schema_files/DASH-MPD.xsd"},H("period",null,b.map((E,C)=>H("adaptation-set",{id:C,mimeType:E.mime_type,startWithSAP:"1",subsegmentAlignment:"true",lang:E.language,codecs:E.codecs,audioSamplingRate:E.audio_sample_rate,contentType:"audio"},E.track_roles&&E.track_roles.map(k=>H("role",{schemeIdUri:"urn:mpeg:dash:role:2011",value:k})),E.track_name&&H("label",{id:C},E.track_name),E.channels&&H("audio-channel-configuration",{schemeIdUri:"urn:mpeg:dash:23003:3:audio_channel_configuration:2011",value:E.channels}),E.representations.map(k=>H("representation",{id:k.uid,bandwidth:k.bitrate,codecs:k.codecs,audioSamplingRate:k.audio_sample_rate},k.channels&&H("audio-channel-configuration",{schemeIdUri:"urn:mpeg:dash:23003:3:audio_channel_configuration:2011",value:k.channels}),H(zw,{info:k.segment_info}))))),T.map((E,C)=>H("adaptation-set",{id:C+b.length,mimeType:E.mime_type,startWithSAP:"1",subsegmentAlignment:"true",codecs:E.codecs,maxPlayoutRate:"1",frameRate:E.fps,contentType:"video"},E.color_info.primaries&&H("supplemental-property",{schemeIdUri:"urn:mpeg:mpegB:cicp:ColourPrimaries",value:E.color_info.primaries}),E.color_info.transfer_characteristics&&H("supplemental-property",{schemeIdUri:"urn:mpeg:mpegB:cicp:TransferCharacteristics",value:E.color_info.transfer_characteristics}),E.color_info.matrix_coefficients&&H("supplemental-property",{schemeIdUri:"urn:mpeg:mpegB:cicp:MatrixCoefficients",value:E.color_info.matrix_coefficients}),E.representations.map(k=>H("representation",{id:k.uid,bandwidth:k.bitrate,width:k.width,height:k.height,codecs:k.codecs,frameRate:k.fps},H(zw,{info:k.segment_info}))))),w.map(async(E,C)=>H("adaptation-set",{id:C+b.length+T.length,mimeType:await E.getMimeType(),contentType:"image"},E.representations.map(async k=>H("representation",{id:`thumbnails_${k.thumbnail_width}x${k.thumbnail_height}`,bandwidth:await k.getBitrate(),width:k.sheet_width,height:k.sheet_height},H("essential-property",{schemeIdUri:"http://dashif.org/thumbnail_tile",value:`${k.columns}x${k.rows}`}),H("segment-template",{media:k.template_url,duration:k.template_duration,startNumber:"0"}))))),S.map((E,C)=>H("adaptation-set",{id:C+b.length+T.length+w.length,mimeType:E.mime_type,lang:E.language,contentType:"text"},E.track_roles.map(k=>H("role",{schemeIdUri:"urn:mpeg:dash:role:2011",value:k})),H("label",{id:C+b.length},E.track_name),H("representation",{id:E.representation.uid,bandwidth:"0"},H("base-url",null,E.representation.base_url))))))}r(Kk,"DashManifest");function Xw(t,e=!1,i=_=>_,s,o,a,l,f,m,x){if(!t)throw new g("Streaming data not available");return Ww(H(Kk,{streamingData:t,isPostLiveDvr:e,transformURL:i,options:x,rejectFormat:s,cpn:o,player:a,actions:l,storyboards:f,captionTracks:m}))}r(Xw,"toDash");async function qk(t,e,i,s,o,a){if((i==null?void 0:i.status)==="UNPLAYABLE")throw new g("Video is unplayable",{error_type:"UNPLAYABLE"});if((i==null?void 0:i.status)==="LOGIN_REQUIRED")throw new g("Video is login required",{error_type:"LOGIN_REQUIRED"});if(!s)throw new g("Streaming data not available.",{error_type:"NO_STREAMING_DATA"});let l={quality:"360p",type:"video+audio",format:"mp4",range:void 0,...t},f=Qw(l,s),m=await f.decipher(o);if(l.type==="video+audio"&&!t.range){let S=await e.session.http.fetch_function(`${m}&cpn=${a}`,{method:"GET",headers:Kt,redirect:"follow"});if(!S.ok)throw new g("The server responded with a non 2xx status code",{error_type:"FETCH_FAILED",response:S});let E=S.body;if(!E)throw new g("Could not get ReadableStream from fetch Response.",{error_type:"FETCH_FAILED",response:S});return E}let x=1048576*10,_=t.range?t.range.start:0,b=t.range?t.range.end:x,T=!1,w;return new M.shim.ReadableStream({start(){},pull:async S=>{if(T){S.close();return}return(b>=(f.content_length?f.content_length:0)||t.range)&&(T=!0),new Promise(async(E,C)=>{try{w=new AbortController;let k=await e.session.http.fetch_function(`${m}&cpn=${a}&range=${_}-${b||""}`,{method:"GET",headers:{...Kt},signal:w.signal});if(!k.ok)throw new g("The server responded with a non 2xx status code",{error_type:"FETCH_FAILED",response:k});let U=k.body;if(!U)throw new g("Could not get ReadableStream from fetch Response.",{error_type:"FETCH_FAILED",response:k});for await(let L of jb(U))S.enqueue(L);_=b+1,b+=x,E()}catch(k){C(k)}})},async cancel(S){w.abort(S)}},{highWaterMark:1,size(S){return S.byteLength}})}r(qk,"download");function Qw(t,e){if(!e)throw new g("Streaming data not available");let i=[...e.formats||[],...e.adaptive_formats||[]],s=t.type?t.type.includes("audio"):!0,o=t.type?t.type.includes("video"):!0,a=t.language||"original",l=t.quality||"best",f=-1,m=["best","bestefficiency"].includes(l),x=l!=="best",_=i.filter(b=>s&&!b.has_audio||o&&!b.has_video||t.format!=="any"&&!b.mime_type.includes(t.format||"mp4")||!m&&b.quality_label!==l?!1:(b.width&&fb.width===f)),s&&!o){let b=_.filter(T=>a!=="original"?!T.has_video&&!T.has_text&&T.language===a:!T.has_video&&!T.has_text&&T.is_original);b.length>0&&(_=b)}return x?_.sort((b,T)=>b.bitrate-T.bitrate):_.sort((b,T)=>T.bitrate-b.bitrate),_[0]}r(Qw,"chooseFormat");var Hb,fi,$b,Qs,Jw,md=class{constructor(e,i,s){Hb.add(this),fi.set(this,void 0),$b.set(this,void 0),Qs.set(this,void 0),I(this,fi,e,"f"),I(this,$b,i,"f"),I(this,Qs,s||M.shim.fetch,"f")}get fetch_function(){return u(this,Qs,"f")}async fetch(e,i,s={}){let o=We.API.PRODUCTION_1+u(this,fi,"f").api_version,a=(i==null?void 0:i.baseURL)||o,l=typeof e=="string"?!a.endsWith("/")&&!e.startsWith("/")?new URL(`${a}/${e}`):new URL(a+e):e instanceof URL?e:new URL(e.url,a),f=(i==null?void 0:i.headers)||(e instanceof M.shim.Request?e.headers:new M.shim.Headers)||new M.shim.Headers,m=(i==null?void 0:i.body)||(e instanceof M.shim.Request?e.body:void 0),x=new M.shim.Headers(f);x.set("Accept","*/*"),x.set("Accept-Language","*"),x.set("X-Goog-Visitor-Id",(s==null?void 0:s.visitor_data)||u(this,fi,"f").context.client.visitorData||""),x.set("X-Youtube-Client-Version",u(this,fi,"f").context.client.clientVersion||"");let _=Object.values(V).find(C=>C.NAME===u(this,fi,"f").context.client.clientName);_&&x.set("X-Youtube-Client-Name",_.NAME_ID),M.shim.server&&(x.set("User-Agent",Zi("desktop")),x.set("Origin",l.origin)),l.searchParams.set("prettyPrint","false"),l.searchParams.set("alt","json");let b=x.get("Content-Type"),T=m,w=a===o||a===We.YT_UPLOAD;if(b==="application/json"&&w&&typeof m=="string"){let k={...JSON.parse(m),context:JSON.parse(JSON.stringify(u(this,fi,"f").context))};u(this,Hb,"m",Jw).call(this,k.context,k.client),x.set("X-Youtube-Client-Version",k.context.client.clientVersion);let U=Object.values(V).find(L=>L.NAME===k.context.client.clientName);U&&x.set("X-Youtube-Client-Name",U.NAME_ID),delete k.client,k.context.client.clientName==="ANDROID"||k.context.client.clientName==="ANDROID_MUSIC"?(x.set("User-Agent",V.ANDROID.USER_AGENT),x.set("X-GOOG-API-FORMAT-VERSION","2")):k.context.client.clientName==="iOS"&&x.set("User-Agent",V.IOS.USER_AGENT),T=JSON.stringify(k)}else b==="application/x-protobuf"&&M.shim.server&&(x.set("User-Agent",V.ANDROID.USER_AGENT),x.set("X-GOOG-API-FORMAT-VERSION","2"),x.delete("X-Youtube-Client-Version"));let S=new M.shim.Request(l,e instanceof M.shim.Request?e:i),E=await u(this,Qs,"f").call(this,S,{body:T,headers:x,redirect:e instanceof M.shim.Request?e.redirect:(i==null?void 0:i.redirect)||"follow",...M.shim.runtime!=="cf-worker"?{credentials:"include"}:{}});if(E.ok)return E;throw new g(`Request to ${E.url} failed with status ${E.status}`,await E.text())}};r(md,"HTTPClient");fi=new WeakMap,$b=new WeakMap,Qs=new WeakMap,Hb=new WeakSet,Jw=r(function(e,i){if(!!i){if(!cd.includes(i.toUpperCase()))throw new g(`Invalid client: ${i}`,{available_innertube_clients:cd});switch((i==="ANDROID"||i==="YTMUSIC_ANDROID"||i==="YTMUSIC_ANDROID"||i==="YTSTUDIO_ANDROID")&&(e.client.androidSdkVersion=V.ANDROID.SDK_VERSION,e.client.userAgent=V.ANDROID.USER_AGENT,e.client.osName="Android",e.client.osVersion="13",e.client.platform="MOBILE"),i.toUpperCase()){case"MWEB":e.client.clientVersion=V.MWEB.VERSION,e.client.clientName=V.MWEB.NAME,e.client.clientFormFactor="SMALL_FORM_FACTOR",e.client.platform="MOBILE";break;case"IOS":e.client.deviceMake="Apple",e.client.deviceModel=V.IOS.DEVICE_MODEL,e.client.clientVersion=V.IOS.VERSION,e.client.clientName=V.IOS.NAME,e.client.platform="MOBILE",e.client.osName="iOS",delete e.client.browserName,delete e.client.browserVersion;break;case"YTMUSIC":e.client.clientVersion=V.YTMUSIC.VERSION,e.client.clientName=V.YTMUSIC.NAME;break;case"ANDROID":e.client.clientVersion=V.ANDROID.VERSION,e.client.clientFormFactor="SMALL_FORM_FACTOR",e.client.clientName=V.ANDROID.NAME;break;case"YTMUSIC_ANDROID":e.client.clientVersion=V.YTMUSIC_ANDROID.VERSION,e.client.clientFormFactor="SMALL_FORM_FACTOR",e.client.clientName=V.YTMUSIC_ANDROID.NAME;break;case"YTSTUDIO_ANDROID":e.client.clientVersion=V.YTSTUDIO_ANDROID.VERSION,e.client.clientFormFactor="SMALL_FORM_FACTOR",e.client.clientName=V.YTSTUDIO_ANDROID.NAME;break;case"TV":{e.client.clientVersion=V.TV.VERSION,e.client.clientName=V.TV.NAME,e.client.userAgent=V.TV.USER_AGENT;break}case"TV_EMBEDDED":e.client.clientName=V.TV_EMBEDDED.NAME,e.client.clientVersion=V.TV_EMBEDDED.VERSION,e.client.clientScreen="EMBED",e.thirdParty={embedUrl:We.YT_BASE};break;case"YTKIDS":e.client.clientVersion=V.WEB_KIDS.VERSION,e.client.clientName=V.WEB_KIDS.NAME,e.client.kidsAppInfo={categorySettings:{enabledCategories:["approved_for_you","black_joy","camp","collections","earth","explore","favorites","gaming","halloween","hero","learning","move","music","reading","shared_by_parents","shows","soccer","sports","spotlight","winter"]},contentSettings:{corpusPreference:"KIDS_CORPUS_PREFERENCE_YOUNGER",kidsNoSearchMode:"YT_KIDS_NO_SEARCH_MODE_OFF"}};break;case"WEB_EMBEDDED":e.client.clientName=V.WEB_EMBEDDED.NAME,e.client.clientVersion=V.WEB_EMBEDDED.VERSION,e.client.clientScreen="EMBED",e.thirdParty={embedUrl:We.GOOGLE_SEARCH_BASE};break;case"WEB_CREATOR":e.client.clientName=V.WEB_CREATOR.NAME,e.client.clientVersion=V.WEB_CREATOR.VERSION;break;default:break}}},"_HTTPClient_adjustContext");var Kb=md;var dt={};Xe(dt,{compress:()=>zk,decompress:()=>Xk});function zk(t){let e=[],i={};for(let a=0;a<256;a++)i[String.fromCharCode(a)]=a;let s="",o=256;for(let a=0;aString.fromCharCode(a)).join("")}r(zk,"compress");function Xk(t){let e={},i=t.split(""),s=[i.shift()],o=i.length>>>0,a=256,l=s[0],f=l;for(let m=0;mx1,encodeCommentActionParams:()=>ig,encodeNextParams:()=>y1,encodeVisitorData:()=>_1});function eT(){let t=0,e=0;for(let s=0;s<28;s+=7){let o=this.buf[this.pos++];if(t|=(o&127)<>4,(i&128)==0)return this.assertBounds(),[t,e];for(let s=3;s<=31;s+=7){let o=this.buf[this.pos++];if(e|=(o&127)<>>a,f=!(l>>>7==0&&e==0),m=(f?l|128:l)&255;if(i.push(m),!f)return}let s=t>>>28&15|(e&7)<<4,o=e>>3!=0;if(i.push((o?s|128:s)&255),!!o){for(let a=3;a<31;a=a+7){let l=e>>>a,f=l>>>7!=0,m=(f?l|128:l)&255;if(i.push(m),!f)return}i.push(e>>>31&1)}}r(dd,"varint64write");var hd=4294967296;function qb(t){let e=t[0]==="-";e&&(t=t.slice(1));let i=1e6,s=0,o=0;function a(l,f){let m=Number(t.slice(l,f));o*=i,s=s*i+m,s>=hd&&(o=o+(s/hd|0),s=s%hd)}return r(a,"add1e6digit"),a(-24,-18),a(-18,-12),a(-12,-6),a(-6),e?iT(s,o):Xb(s,o)}r(qb,"int64FromString");function tT(t,e){let i=Xb(t,e),s=i.hi&2147483648;s&&(i=iT(i.lo,i.hi));let o=zb(i.lo,i.hi);return s?"-"+o:o}r(tT,"int64ToString");function zb(t,e){if({lo:t,hi:e}=Qk(t,e),e<=2097151)return String(hd*e+t);let i=t&16777215,s=(t>>>24|e<<8)&16777215,o=e>>16&65535,a=i+s*6777216+o*6710656,l=s+o*8147497,f=o*2,m=1e7;return a>=m&&(l+=Math.floor(a/m),a%=m),l>=m&&(f+=Math.floor(l/m),l%=m),f.toString()+Zw(l)+Zw(a)}r(zb,"uInt64ToString");function Qk(t,e){return{lo:t>>>0,hi:e>>>0}}r(Qk,"toUnsigned");function Xb(t,e){return{lo:t|0,hi:e|0}}r(Xb,"newBits");function iT(t,e){return e=~e,t?t=~t+1:e+=1,Xb(t,e)}r(iT,"negate");var Zw=r(t=>{let e=String(t);return"0000000".slice(e.length)+e},"decimalFrom1e7WithLeadingZeros");function Qb(t,e){if(t>=0){for(;t>127;)e.push(t&127|128),t=t>>>7;e.push(t)}else{for(let i=0;i<9;i++)e.push(t&127|128),t=t>>7;e.push(1)}}r(Qb,"varint32write");function rT(){let t=this.buf[this.pos++],e=t&127;if((t&128)==0)return this.assertBounds(),e;if(t=this.buf[this.pos++],e|=(t&127)<<7,(t&128)==0)return this.assertBounds(),e;if(t=this.buf[this.pos++],e|=(t&127)<<14,(t&128)==0)return this.assertBounds(),e;if(t=this.buf[this.pos++],e|=(t&127)<<21,(t&128)==0)return this.assertBounds(),e;t=this.buf[this.pos++],e|=(t&15)<<28;for(let i=5;(t&128)!==0&&i<10;i++)t=this.buf[this.pos++];if((t&128)!=0)throw new Error("invalid varint");return this.assertBounds(),e>>>0}r(rT,"varint32read");var _t=Jk();function Jk(){let t=new DataView(new ArrayBuffer(8));if(typeof BigInt=="function"&&typeof t.getBigInt64=="function"&&typeof t.getBigUint64=="function"&&typeof t.setBigInt64=="function"&&typeof t.setBigUint64=="function"&&(typeof process!="object"||typeof process.env!="object"||process.env.BUF_BIGINT_DISABLE!=="1")){let i=BigInt("-9223372036854775808"),s=BigInt("9223372036854775807"),o=BigInt("0"),a=BigInt("18446744073709551615");return{zero:BigInt(0),supported:!0,parse(l){let f=typeof l=="bigint"?l:BigInt(l);if(f>s||fa||f>>0)}raw(e){return this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]),this.chunks.push(e),this}uint32(e){for(nT(e);e>127;)this.buf.push(e&127|128),e=e>>>7;return this.buf.push(e),this}int32(e){return eg(e),Qb(e,this.buf),this}bool(e){return this.buf.push(e?1:0),this}bytes(e){return this.uint32(e.byteLength),this.raw(e)}string(e){let i=this.encodeUtf8(e);return this.uint32(i.byteLength),this.raw(i)}float(e){s1(e);let i=new Uint8Array(4);return new DataView(i.buffer).setFloat32(0,e,!0),this.raw(i)}double(e){let i=new Uint8Array(8);return new DataView(i.buffer).setFloat64(0,e,!0),this.raw(i)}fixed32(e){nT(e);let i=new Uint8Array(4);return new DataView(i.buffer).setUint32(0,e,!0),this.raw(i)}sfixed32(e){eg(e);let i=new Uint8Array(4);return new DataView(i.buffer).setInt32(0,e,!0),this.raw(i)}sint32(e){return eg(e),e=(e<<1^e>>31)>>>0,Qb(e,this.buf),this}sfixed64(e){let i=new Uint8Array(8),s=new DataView(i.buffer),o=_t.enc(e);return s.setInt32(0,o.lo,!0),s.setInt32(4,o.hi,!0),this.raw(i)}fixed64(e){let i=new Uint8Array(8),s=new DataView(i.buffer),o=_t.uEnc(e);return s.setInt32(0,o.lo,!0),s.setInt32(4,o.hi,!0),this.raw(i)}int64(e){let i=_t.enc(e);return dd(i.lo,i.hi,this.buf),this}sint64(e){let i=_t.enc(e),s=i.hi>>31,o=i.lo<<1^s,a=(i.hi<<1|i.lo>>>31)^s;return dd(o,a,this.buf),this}uint64(e){let i=_t.uEnc(e);return dd(i.lo,i.hi,this.buf),this}};r(Re,"BinaryWriter");var ee=class{constructor(e,i=Zb().decodeUtf8){this.decodeUtf8=i,this.varint64=eT,this.uint32=rT,this.buf=e,this.len=e.length,this.pos=0,this.view=new DataView(e.buffer,e.byteOffset,e.byteLength)}tag(){let e=this.uint32(),i=e>>>3,s=e&7;if(i<=0||s<0||s>5)throw new Error("illegal tag: field no "+i+" wire type "+s);return[i,s]}skip(e,i){let s=this.pos;switch(e){case mi.Varint:for(;this.buf[this.pos++]&128;);break;case mi.Bit64:this.pos+=4;case mi.Bit32:this.pos+=4;break;case mi.LengthDelimited:let o=this.uint32();this.pos+=o;break;case mi.StartGroup:for(;;){let[a,l]=this.tag();if(l===mi.EndGroup){if(i!==void 0&&a!==i)throw new Error("invalid end group tag");break}this.skip(l,a)}break;default:throw new Error("cant skip wire type "+e)}return this.assertBounds(),this.buf.subarray(s,this.pos)}assertBounds(){if(this.pos>this.len)throw new RangeError("premature EOF")}int32(){return this.uint32()|0}sint32(){let e=this.uint32();return e>>>1^-(e&1)}int64(){return _t.dec(...this.varint64())}uint64(){return _t.uDec(...this.varint64())}sint64(){let[e,i]=this.varint64(),s=-(e&1);return e=(e>>>1|(i&1)<<31)^s,i=i>>>1^s,_t.dec(e,i)}bool(){let[e,i]=this.varint64();return e!==0||i!==0}fixed32(){return this.view.getUint32((this.pos+=4)-4,!0)}sfixed32(){return this.view.getInt32((this.pos+=4)-4,!0)}fixed64(){return _t.uDec(this.sfixed32(),this.sfixed32())}sfixed64(){return _t.dec(this.sfixed32(),this.sfixed32())}float(){return this.view.getFloat32((this.pos+=4)-4,!0)}double(){return this.view.getFloat64((this.pos+=8)-8,!0)}bytes(){let e=this.uint32(),i=this.pos;return this.pos+=e,this.assertBounds(),this.buf.subarray(i,i+e)}string(){return this.decodeUtf8(this.bytes())}};r(ee,"BinaryReader");function eg(t){if(typeof t=="string")t=Number(t);else if(typeof t!="number")throw new Error("invalid int32: "+typeof t);if(!Number.isInteger(t)||t>i1||tt1||t<0)throw new Error("invalid uint32: "+t)}r(nT,"assertUInt32");function s1(t){if(typeof t=="string"){let e=t;if(t=Number(t),isNaN(t)&&e!=="NaN")throw new Error("invalid float32: "+e)}else if(typeof t!="number")throw new Error("invalid float32: "+typeof t);if(Number.isFinite(t)&&(t>Zk||t>>3){case 1:if(a!==10)break;o.id=i.string();continue;case 5:if(a!==40)break;o.timestamp=i.int32();continue}if((a&7)===4||a===0)break;i.skip(a&7)}return o}};function n1(){return{params:void 0,number0:void 0,number1:void 0}}r(n1,"createBaseLiveMessageParams");var xT={encode(t,e=new Re){return t.params!==void 0&&uT.encode(t.params,e.uint32(10).fork()).join(),t.number0!==void 0&&e.uint32(16).int32(t.number0),t.number1!==void 0&&e.uint32(24).int32(t.number1),e},decode(t,e){let i=t instanceof ee?t:new ee(t),s=e===void 0?i.len:i.pos+e,o=n1();for(;i.pos>>3){case 1:if(a!==10)break;o.params=uT.decode(i,i.uint32());continue;case 2:if(a!==16)break;o.number0=i.int32();continue;case 3:if(a!==24)break;o.number1=i.int32();continue}if((a&7)===4||a===0)break;i.skip(a&7)}return o}};function a1(){return{ids:void 0}}r(a1,"createBaseLiveMessageParams_Params");var uT={encode(t,e=new Re){return t.ids!==void 0&&fT.encode(t.ids,e.uint32(42).fork()).join(),e},decode(t,e){let i=t instanceof ee?t:new ee(t),s=e===void 0?i.len:i.pos+e,o=a1();for(;i.pos>>3){case 5:if(a!==42)break;o.ids=fT.decode(i,i.uint32());continue}if((a&7)===4||a===0)break;i.skip(a&7)}return o}};function p1(){return{channelId:"",videoId:""}}r(p1,"createBaseLiveMessageParams_Params_Ids");var fT={encode(t,e=new Re){return t.channelId!==""&&e.uint32(10).string(t.channelId),t.videoId!==""&&e.uint32(18).string(t.videoId),e},decode(t,e){let i=t instanceof ee?t:new ee(t),s=e===void 0?i.len:i.pos+e,o=p1();for(;i.pos>>3){case 1:if(a!==10)break;o.channelId=i.string();continue;case 2:if(a!==18)break;o.videoId=i.string();continue}if((a&7)===4||a===0)break;i.skip(a&7)}return o}};function c1(){return{type:0,commentId:"",videoId:"",unkNum:void 0,channelId:void 0,translateCommentParams:void 0}}r(c1,"createBasePeformCommentActionParams");var yT={encode(t,e=new Re){return t.type!==0&&e.uint32(8).int32(t.type),t.commentId!==""&&e.uint32(26).string(t.commentId),t.videoId!==""&&e.uint32(42).string(t.videoId),t.unkNum!==void 0&&e.uint32(16).int32(t.unkNum),t.channelId!==void 0&&e.uint32(186).string(t.channelId),t.translateCommentParams!==void 0&&mT.encode(t.translateCommentParams,e.uint32(250).fork()).join(),e},decode(t,e){let i=t instanceof ee?t:new ee(t),s=e===void 0?i.len:i.pos+e,o=c1();for(;i.pos>>3){case 1:if(a!==8)break;o.type=i.int32();continue;case 3:if(a!==26)break;o.commentId=i.string();continue;case 5:if(a!==42)break;o.videoId=i.string();continue;case 2:if(a!==16)break;o.unkNum=i.int32();continue;case 23:if(a!==186)break;o.channelId=i.string();continue;case 31:if(a!==250)break;o.translateCommentParams=mT.decode(i,i.uint32());continue}if((a&7)===4||a===0)break;i.skip(a&7)}return o}};function l1(){return{params:void 0,commentId:"",targetLanguage:""}}r(l1,"createBasePeformCommentActionParams_TranslateCommentParams");var mT={encode(t,e=new Re){return t.params!==void 0&&hT.encode(t.params,e.uint32(26).fork()).join(),t.commentId!==""&&e.uint32(18).string(t.commentId),t.targetLanguage!==""&&e.uint32(34).string(t.targetLanguage),e},decode(t,e){let i=t instanceof ee?t:new ee(t),s=e===void 0?i.len:i.pos+e,o=l1();for(;i.pos>>3){case 3:if(a!==26)break;o.params=hT.decode(i,i.uint32());continue;case 2:if(a!==18)break;o.commentId=i.string();continue;case 4:if(a!==34)break;o.targetLanguage=i.string();continue}if((a&7)===4||a===0)break;i.skip(a&7)}return o}};function u1(){return{comment:void 0}}r(u1,"createBasePeformCommentActionParams_TranslateCommentParams_Params");var hT={encode(t,e=new Re){return t.comment!==void 0&&dT.encode(t.comment,e.uint32(10).fork()).join(),e},decode(t,e){let i=t instanceof ee?t:new ee(t),s=e===void 0?i.len:i.pos+e,o=u1();for(;i.pos>>3){case 1:if(a!==10)break;o.comment=dT.decode(i,i.uint32());continue}if((a&7)===4||a===0)break;i.skip(a&7)}return o}};function f1(){return{text:""}}r(f1,"createBasePeformCommentActionParams_TranslateCommentParams_Params_Comment");var dT={encode(t,e=new Re){return t.text!==""&&e.uint32(10).string(t.text),e},decode(t,e){let i=t instanceof ee?t:new ee(t),s=e===void 0?i.len:i.pos+e,o=f1();for(;i.pos>>3){case 1:if(a!==10)break;o.text=i.string();continue}if((a&7)===4||a===0)break;i.skip(a&7)}return o}};function m1(){return{shortId:"",params:void 0,feature2:0,feature3:0}}r(m1,"createBaseReelSequence");var bT={encode(t,e=new Re){return t.shortId!==""&&e.uint32(10).string(t.shortId),t.params!==void 0&&_T.encode(t.params,e.uint32(42).fork()).join(),t.feature2!==0&&e.uint32(80).int32(t.feature2),t.feature3!==0&&e.uint32(104).int32(t.feature3),e},decode(t,e){let i=t instanceof ee?t:new ee(t),s=e===void 0?i.len:i.pos+e,o=m1();for(;i.pos>>3){case 1:if(a!==10)break;o.shortId=i.string();continue;case 5:if(a!==42)break;o.params=_T.decode(i,i.uint32());continue;case 10:if(a!==80)break;o.feature2=i.int32();continue;case 13:if(a!==104)break;o.feature3=i.int32();continue}if((a&7)===4||a===0)break;i.skip(a&7)}return o}};function h1(){return{number:0}}r(h1,"createBaseReelSequence_Params");var _T={encode(t,e=new Re){return t.number!==0&&e.uint32(24).int32(t.number),e},decode(t,e){let i=t instanceof ee?t:new ee(t),s=e===void 0?i.len:i.pos+e,o=h1();for(;i.pos>>3){case 3:if(a!==24)break;o.number=i.int32();continue}if((a&7)===4||a===0)break;i.skip(a&7)}return o}};function d1(){return{videoId:[]}}r(d1,"createBaseNextParams");var gT={encode(t,e=new Re){for(let i of t.videoId)e.uint32(42).string(i);return e},decode(t,e){let i=t instanceof ee?t:new ee(t),s=e===void 0?i.len:i.pos+e,o=d1();for(;i.pos>>3){case 5:if(a!==42)break;o.videoId.push(i.string());continue}if((a&7)===4||a===0)break;i.skip(a&7)}return o}};function _1(t,e){let i=tg.encode({id:t,timestamp:e});return encodeURIComponent(zt(i.finish()).replace(/\+/g,"-").replace(/\//g,"_"))}r(_1,"encodeVisitorData");function x1(t){return tg.decode(rg(decodeURIComponent(t).replace(/-/g,"+").replace(/_/g,"/")))}r(x1,"decodeVisitorData");function ig(t,e={}){let i={type:t,commentId:e.comment_id||" ",videoId:e.video_id||" ",channelId:" ",unkNum:2};if(e.hasOwnProperty("text")){if(typeof e.target_language!="string")throw new Error("target_language must be a string");e.comment_id&&delete i.unkNum,i.translateCommentParams={params:{comment:{text:e.text}},commentId:e.comment_id||" ",targetLanguage:e.target_language}}let s=yT.encode(i);return encodeURIComponent(zt(s.finish()))}r(ig,"encodeCommentActionParams");function y1(t){let e=gT.encode({videoId:t});return encodeURIComponent(zt(e.finish()).replace(/\+/g,"-").replace(/\//g,"_"))}r(y1,"encodeNextParams");var Zs=class extends n{constructor(e){super(),this.popup=c.parseItem(e.popup),this.popup_type=e.popupType}};r(Zs,"OpenPopupAction");Zs.type="OpenPopupAction";var _d=Zs;var eo=class extends n{constructor(e){super(),Reflect.has(e,"text")&&(this.text=new p(e.text).toString()),Reflect.has(e,"accessibility")&&Reflect.has(e.accessibility,"label")&&(this.label=e.accessibility.label),Reflect.has(e,"tooltip")&&(this.tooltip=e.tooltip),Reflect.has(e,"icon")&&Reflect.has(e.icon,"iconType")&&(this.icon_type=e.icon.iconType),Reflect.has(e,"isDisabled")&&(this.is_disabled=e.isDisabled),this.endpoint=new d(e.navigationEndpoint||e.serviceEndpoint||e.command)}};r(eo,"Button");eo.type="Button";var v=eo;var to=class extends n{constructor(e){var i;super(),this.label=new p(e.label).toString(),this.selected=!!e.isSelected,Reflect.has(e,"int32Value")?this.value=e.int32Value:e.stringValue&&(this.value=e.stringValue),Reflect.has(e,"onSelectCommand")&&(this.endpoint=new d(e.onSelectCommand)),Reflect.has(e,"icon")&&(this.icon_type=(i=e.icon)==null?void 0:i.iconType),Reflect.has(e,"descriptionText")&&(this.description=new p(e.descriptionText))}};r(to,"DropdownItem");to.type="DropdownItem";var xd=to;var io=class extends n{constructor(e){super(),this.label=e.label||"",this.entries=c.parseArray(e.entries,xd)}};r(io,"Dropdown");io.type="Dropdown";var hi=io;var ro=class extends n{constructor(e){super(),this.title=new p(e.dialogTitle).toString(),this.title_placeholder=e.titlePlaceholder||"",this.privacy_option=c.parseItem(e.privacyOption,hi),this.create_button=c.parseItem(e.cancelButton,v),this.cancel_button=c.parseItem(e.cancelButton,v)}};r(ro,"CreatePlaylistDialog");ro.type="CreatePlaylistDialog";var yd=ro;var di=class extends n{constructor(e){var i,s,o,a,l,f,m,x;if(super(),e){if(e.serialCommand||e.parallelCommand){let _=e.serialCommand||e.parallelCommand;this.commands=_.commands.map(b=>new di(b))}(e.innertubeCommand||e.command||e.performOnceCommand)&&(e=e.innertubeCommand||e.command||e.performOnceCommand)}this.command=c.parseCommand(e),Reflect.has(e||{},"openPopupAction")&&(this.open_popup=new _d(e.openPopupAction)),this.name=Object.keys(e||{}).find(_=>_.endsWith("Endpoint")||_.endsWith("Command")),this.payload=this.name?Reflect.get(e,this.name):{},(Reflect.has(this.payload,"dialog")||Reflect.has(this.payload,"content"))&&(this.dialog=c.parseItem(this.payload.dialog||this.payload.content)),Reflect.has(this.payload,"modal")&&(this.modal=c.parseItem(this.payload.modal)),Reflect.has(this.payload,"nextEndpoint")&&(this.next_endpoint=new di(this.payload.nextEndpoint)),e!=null&&e.serviceEndpoint&&(e=e.serviceEndpoint),this.metadata={},(s=(i=e==null?void 0:e.commandMetadata)==null?void 0:i.webCommandMetadata)!=null&&s.url&&(this.metadata.url=e.commandMetadata.webCommandMetadata.url),(a=(o=e==null?void 0:e.commandMetadata)==null?void 0:o.webCommandMetadata)!=null&&a.webPageType&&(this.metadata.page_type=e.commandMetadata.webCommandMetadata.webPageType),(f=(l=e==null?void 0:e.commandMetadata)==null?void 0:l.webCommandMetadata)!=null&&f.apiUrl?this.metadata.api_url=e.commandMetadata.webCommandMetadata.apiUrl.replace("/youtubei/v1/",""):this.name&&(this.metadata.api_url=this.getPath(this.name)),(x=(m=e==null?void 0:e.commandMetadata)==null?void 0:m.webCommandMetadata)!=null&&x.sendPost&&(this.metadata.send_post=e.commandMetadata.webCommandMetadata.sendPost),e!=null&&e.createPlaylistEndpoint&&e!=null&&e.createPlaylistEndpoint.createPlaylistDialog&&(this.dialog=c.parseItem(e==null?void 0:e.createPlaylistEndpoint.createPlaylistDialog,yd))}getPath(e){switch(e){case"browseEndpoint":return"/browse";case"watchEndpoint":case"reelWatchEndpoint":return"/player";case"searchEndpoint":return"/search";case"watchPlaylistEndpoint":return"/next";case"liveChatItemContextMenuEndpoint":return"/live_chat/get_item_context_menu"}}call(e,i){if(!e)throw new Error("An API caller must be provided");if(this.command){let s=this.command;return e.execute(s.getApiPath(),{...s.buildRequest(),...i})}if(!this.metadata.api_url)throw new Error("Expected an api_url, but none was found.");return e.execute(this.metadata.api_url,{...this.payload,...i})}toURL(){if(!!this.metadata.url&&!!this.metadata.page_type)return this.metadata.page_type==="WEB_PAGE_TYPE_UNKNOWN"?this.metadata.url:`https://www.youtube.com${this.metadata.url}`}};r(di,"NavigationEndpoint");di.type="NavigationEndpoint";var d=di;var y=class{constructor(e){this.url=e.url,this.width=e.width,this.height=e.height}static fromResponse(e){if(!e)return[];let i;return e.thumbnails?i=e.thumbnails:e.sources&&(i=e.sources),i?i.map(s=>new y(s)).sort((s,o)=>o.width-s.width):[]}};r(y,"Thumbnail");var _i=class{constructor(e){var i,s,o,a,l,f;this.text=((i=e.emoji)==null?void 0:i.emojiId)||((o=(s=e.emoji)==null?void 0:s.shortcuts)==null?void 0:o[0])||e.text||"",this.emoji={emoji_id:e.emoji.emojiId,shortcuts:((a=e.emoji)==null?void 0:a.shortcuts)||[],search_terms:((l=e.emoji)==null?void 0:l.searchTerms)||[],image:y.fromResponse(e.emoji.image),is_custom:!!((f=e.emoji)!=null&&f.isCustomEmoji)}}toString(){return this.text}toHTML(){let e=bd(this.text);return`${e}`}};r(_i,"EmojiRun");var xi=class{constructor(e){this.text=e.text,this.bold=Boolean(e.bold),this.italics=Boolean(e.italics),this.strikethrough=Boolean(e.strikethrough),this.deemphasize=Boolean(e.deemphasize),Reflect.has(e,"navigationEndpoint")&&(this.endpoint=new d(e.navigationEndpoint)),this.attachment=e.attachment}toString(){return this.text}toHTML(){let e=[];this.bold&&e.push("b"),this.italics&&e.push("i"),this.strikethrough&&e.push("s"),this.deemphasize&&e.push("small");let i=bd(this.text),o=`${e.map(a=>`<${a}>`).join("")+i+e.map(a=>``).join("")}`;if(this.attachment&&this.attachment.element.type.imageType.image.sources.length){let{url:a}=this.attachment.element.type.imageType.image.sources[0];if(this.endpoint){let l=this.endpoint.toURL();if(l)return`${o}`}}if(this.endpoint){let a=this.endpoint.toURL();if(a)return`${o}`}return o}};r(xi,"TextRun");function bd(t){return t.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}r(bd,"escape");var so="Text",p=class{constructor(e){var i,s,o,a;typeof e=="object"&&e!==null&&Reflect.has(e,"runs")&&Array.isArray(e.runs)?(this.runs=e.runs.map(l=>l.emoji?new _i(l):new xi(l)),this.text=this.runs.map(l=>l.text).join("")):this.text=e==null?void 0:e.simpleText,typeof e=="object"&&e!==null&&Reflect.has(e,"navigationEndpoint")&&(this.endpoint=new d(e.navigationEndpoint)),typeof e=="object"&&e!==null&&Reflect.has(e,"titleNavigationEndpoint")&&(this.endpoint=new d(e.titleNavigationEndpoint)),this.endpoint||(s=(i=this.runs)==null?void 0:i[0])!=null&&s.endpoint&&(this.endpoint=(a=(o=this.runs)==null?void 0:o[0])==null?void 0:a.endpoint)}static fromAttributed(e){var f,m,x;let{content:i,styleRuns:s,commandRuns:o,attachmentRuns:a}=e,l=[{text:i,startIndex:0}];if(s||o||a){if(s)for(let _ of s)if(_.italic||_.strikethrough==="LINE_STYLE_SINGLE"||_.weightLabel==="FONT_WEIGHT_MEDIUM"||_.weightLabel==="FONT_WEIGHT_BOLD"){let b=sg(l,_);if(!b){O.warn(so,"Unable to find matching run for style run. Skipping...",{style_run:_,input_data:e,parsed_runs:JSON.parse(JSON.stringify(l))});continue}gd(l,b,_,{bold:_.weightLabel==="FONT_WEIGHT_MEDIUM"||_.weightLabel==="FONT_WEIGHT_BOLD",italics:_.italic,strikethrough:_.strikethrough==="LINE_STYLE_SINGLE"})}else O.debug(so,"Skipping style run as it is doesn't have any information that we parse.",{style_run:_,input_data:e});if(o)for(let _ of o)if(_.onTap){let b=sg(l,_);if(!b){O.warn(so,"Unable to find matching run for command run. Skipping...",{command_run:_,input_data:e,parsed_runs:JSON.parse(JSON.stringify(l))});continue}gd(l,b,_,{navigationEndpoint:_.onTap})}else O.debug(so,'Skipping command run as it is missing the "doTap" property.',{command_run:_,input_data:e});if(a)for(let _ of a){let b=sg(l,_);if(!b){O.warn(so,"Unable to find matching run for attachment run. Skipping...",{attachment_run:_,input_data:e,parsed_runs:JSON.parse(JSON.stringify(l))});continue}if(_.length===0)b.attachment=_;else{let T=_.startIndex-b.startIndex,w=b.text.substring(T,T+_.length),S=/^:[^:]+:$/.test(w);if(((x=(m=(f=_.element)==null?void 0:f.type)==null?void 0:m.imageType)==null?void 0:x.image)&&(S||/^(?:\p{Emoji}|\u200d)+$/u.test(w))){let E={image:_.element.type.imageType.image,isCustomEmoji:S,shortcuts:S?[w]:void 0};gd(l,b,_,{emoji:E})}else gd(l,b,_,{attachment:_})}}}return new p({runs:l})}toHTML(){return this.runs?this.runs.map(e=>e.toHTML()).join(""):this.text}isEmpty(){return this.text===void 0}toString(){return this.text||"N/A"}};r(p,"Text");function sg(t,e){return t.find(i=>i.startIndex<=e.startIndex&&e.startIndex+e.length<=i.startIndex+i.text.length)}r(sg,"findMatchingRun");function gd(t,e,i,s){let o=t.indexOf(e),a=[],l=i.startIndex-e.startIndex;i.startIndex>e.startIndex&&a.push({...e,text:e.text.substring(0,l)}),a.push({...e,text:e.text.substring(l,l+i.length),startIndex:i.startIndex,...s}),i.startIndex+i.length{var s,o;return{title:i.title,selected:i.selected,continuation:(o=(s=i.continuation)==null?void 0:s.reloadContinuationData)==null?void 0:o.continuation,endpoint:new d(i.serviceEndpoint||i.navigationEndpoint),subtitle:i.subtitle||null}}))}};r(vo,"SortFilterSubMenu");vo.type="SortFilterSubMenu";var xt=vo;var Io=class extends n{constructor(e){super(),this.language_menu=c.parseItem(e.languageMenu,xt)}};r(Io,"TranscriptFooter");Io.type="TranscriptFooter";var Ad=Io;var So=class extends n{constructor(e){super(),this.formatted_placeholder=new p(e.formattedPlaceholder),this.clear_button=c.parseItem(e.clearButton,v),this.endpoint=new d(e.onTextChangeCommand),this.search_button=c.parseItem(e.searchButton,v)}};r(So,"TranscriptSearchBox");So.type="TranscriptSearchBox";var Rd=So;var Eo=class extends n{constructor(e){super(),this.start_ms=e.startMs,this.end_ms=e.endMs,this.snippet=new p(e.snippet)}};r(Eo,"TranscriptSectionHeader");Eo.type="TranscriptSectionHeader";var Md=Eo;var ko=class extends n{constructor(e){super(),this.start_ms=e.startMs,this.end_ms=e.endMs,this.snippet=new p(e.snippet),this.start_time_text=new p(e.startTimeText),this.target_id=e.targetId}};r(ko,"TranscriptSegment");ko.type="TranscriptSegment";var Ld=ko;var Co=class extends n{constructor(e){super(),this.initial_segments=c.parseArray(e.initialSegments,[Ld,Md]),this.no_result_label=new p(e.noResultLabel),this.retry_label=new p(e.retryLabel),this.touch_captions_enabled=e.touchCaptionsEnabled}};r(Co,"TranscriptSegmentList");Co.type="TranscriptSegmentList";var Od=Co;var Po=class extends n{constructor(e){super(),this.header=c.parseItem(e.header,Rd),this.body=c.parseItem(e.body,Od),this.footer=c.parseItem(e.footer,Ad),this.target_id=e.targetId}};r(Po,"TranscriptSearchPanel");Po.type="TranscriptSearchPanel";var Dd=Po;var No=class extends n{constructor(e){super(),this.content=c.parseItem(e.content,Dd)}};r(No,"Transcript");No.type="Transcript";var Dr=No;var Ao=class extends n{constructor(e){super(),this.target_id=e.targetId,this.content=c.parseItem(e.content,Dr)}};r(Ao,"UpdateEngagementPanelAction");Ao.type="UpdateEngagementPanelAction";var ET=Ao;var Ro=class extends n{constructor(e){super(),this.channel_id=e.channelId,this.subscribed=e.subscribed}};r(Ro,"UpdateSubscribeButtonAction");Ro.type="UpdateSubscribeButtonAction";var kT=Ro;var Mo=class extends n{constructor(e){super(),this.title=new p(e.title)}};r(Mo,"MenuTitle");Mo.type="MenuTitle";var Bd=Mo;var Lo=class extends n{constructor(e){var i;super(),this.add_to_playlist_service_endpoint=new d(e.addToPlaylistServiceEndpoint),this.contains_selected_videos=e.containsSelectedVideos,this.playlist_id=e.playlistId,this.privacy=e.privacy,this.privacy_icon={icon_type:((i=e.privacyIcon)==null?void 0:i.iconType)||null},this.remove_from_playlist_service_endpoint=new d(e.removeFromPlaylistServiceEndpoint),this.title=new p(e.title)}};r(Lo,"PlaylistAddToOption");Lo.type="PlaylistAddToOption";var Yd=Lo;var Oo=class extends n{constructor(e){super(),this.actions=c.parseArray(e.actions,[Bd,v]),this.playlists=c.parseArray(e.playlists,Yd)}};r(Oo,"AddToPlaylist");Oo.type="AddToPlaylist";var CT=Oo;var Do=class extends n{constructor(e){super(),this.text=new p(e.text),this.alert_type=e.type}};r(Do,"Alert");Do.type="Alert";var Br=Do;var Bo=class extends n{constructor(e){super(),this.text=new p(e.text),this.alert_type=e.type,this.dismiss_button=c.parseItem(e.dismissButton,v)}};r(Bo,"AlertWithButton");Bo.type="AlertWithButton";var Vd=Bo;var Yo=class extends n{constructor(e){super(),this.text=p.fromAttributed(e.text),this.suffix=p.fromAttributed(e.suffix)}};r(Yo,"AttributionView");Yo.type="AttributionView";var Ud=Yo;var Vo=class extends n{constructor(e){super(),this.audio_only_availability=e.audioOnlyAvailability}};r(Vo,"AudioOnlyPlayability");Vo.type="AudioOnlyPlayability";var Fd=Vo;var Uo=class extends n{constructor(e){var i,s;super(),(s=(i=e==null?void 0:e.content)==null?void 0:i.automixPlaylistVideoRenderer)!=null&&s.navigationEndpoint&&(this.playlist_video={endpoint:new d(e.content.automixPlaylistVideoRenderer.navigationEndpoint)})}};r(Uo,"AutomixPreviewVideo");Uo.type="AutomixPreviewVideo";var Wd=Uo;var Fo=class extends n{constructor(e){super(),this.image=y.fromResponse(e.image),this.avatar_image_size=e.avatarImageSize,e.image.processor&&(this.image_processor={border_image_processor:{circular:e.image.processor.borderImageProcessor.circular}})}};r(Fo,"AvatarView");Fo.type="AvatarView";var Gd=Fo;var Wo=class extends n{constructor(e){super(),this.image=y.fromResponse(e.image),this.endpoint=new d(e.command)}};r(Wo,"BackstageImage");Wo.type="BackstageImage";var jd=Wo;var Go=class extends n{constructor(e){var s,o,a,l,f,m,x,_,b;super(),this.text=new p(e.defaultText),this.toggled_text=new p(e.toggledText),this.tooltip=e.defaultTooltip,this.toggled_tooltip=e.toggledTooltip,this.is_toggled=e.isToggled,this.is_disabled=e.isDisabled,this.icon_type=(s=e.defaultIcon)==null?void 0:s.iconType;let i=((l=(a=(o=e==null?void 0:e.defaultText)==null?void 0:o.accessibility)==null?void 0:a.accessibilityData)==null?void 0:l.label)||((m=(f=e==null?void 0:e.accessibilityData)==null?void 0:f.accessibilityData)==null?void 0:m.label)||((x=e==null?void 0:e.accessibility)==null?void 0:x.label);this.icon_type=="LIKE"&&(this.like_count=parseInt(i.replace(/\D/g,"")),this.short_like_count=new p(e.defaultText).toString()),this.endpoint=(b=(_=e.defaultServiceEndpoint)==null?void 0:_.commandExecutorCommand)!=null&&b.commands?new d(e.defaultServiceEndpoint.commandExecutorCommand.commands.pop()):new d(e.defaultServiceEndpoint),this.toggled_endpoint=new d(e.toggledServiceEndpoint),Reflect.has(e,"toggleButtonSupportedData")&&Reflect.has(e.toggleButtonSupportedData,"toggleButtonIdData")&&(this.button_id=e.toggleButtonSupportedData.toggleButtonIdData.id),Reflect.has(e,"targetId")&&(this.target_id=e.targetId)}};r(Go,"ToggleButton");Go.type="ToggleButton";var se=Go;var jo=class extends n{constructor(e){var i,s;super(),this.creator_thumbnail=y.fromResponse(e.creatorThumbnail),Reflect.has(e,"heartIcon")&&Reflect.has(e.heartIcon,"iconType")&&(this.heart_icon_type=e.heartIcon.iconType),this.heart_color={basic_color_palette_data:{foreground_title_color:(s=(i=e.heartColor)==null?void 0:i.basicColorPaletteData)==null?void 0:s.foregroundTitleColor}},this.hearted_tooltip=e.heartedTooltip,this.is_hearted=e.isHearted,this.is_enabled=e.isEnabled,this.kennedy_heart_color_string=e.kennedyHeartColorString}};r(jo,"CreatorHeart");jo.type="CreatorHeart";var Hd=jo;var Ho=class extends n{constructor(e){super(),this.like_button=c.parseItem(e.likeButton,se),this.dislike_button=c.parseItem(e.dislikeButton,se),this.reply_button=c.parseItem(e.replyButton,v),this.creator_heart=c.parseItem(e.creatorHeart,Hd)}};r(Ho,"CommentActionButtons");Ho.type="CommentActionButtons";var $d=Ho;var $o=class extends n{constructor(e){super(),this.icon_name=e.iconName,this.title=e.title,this.accessibility_text=e.accessibilityText,this.style=e.style,this.is_full_width=e.isFullWidth,this.button_type=e.type,this.button_size=e.buttonSize,this.on_tap=new d(e.onTap)}};r($o,"ButtonView");$o.type="ButtonView";var Te=$o;var Ko=class extends n{constructor(e){super(),this.default_button=c.parseItem(e.defaultButtonViewModel,Te),this.toggled_button=c.parseItem(e.toggledButtonViewModel,Te),this.identifier=e.identifier,this.is_toggling_disabled=e.isTogglingDisabled}};r(Ko,"ToggleButtonView");Ko.type="ToggleButtonView";var yt=Ko;var qo=class extends n{constructor(e){super(),this.toggle_button=c.parseItem(e.toggleButtonViewModel,yt),this.like_status_entity_key=e.likeStatusEntityKey,this.like_status_entity={key:e.likeStatusEntity.key,like_status:e.likeStatusEntity.likeStatus}}};r(qo,"LikeButtonView");qo.type="LikeButtonView";var Kd=qo;var zo=class extends n{constructor(e){super(),this.toggle_button=c.parseItem(e.toggleButtonViewModel,yt),this.dislike_entity_key=e.dislikeEntityKey}};r(zo,"DislikeButtonView");zo.type="DislikeButtonView";var qd=zo;var Xo=class extends n{constructor(e){if(super(),this.like_button=c.parseItem(e.likeButtonViewModel,Kd),this.dislike_button=c.parseItem(e.dislikeButtonViewModel,qd),this.icon_type=e.iconType,this.like_button&&this.like_button.toggle_button){let i=this.like_button.toggle_button;i.default_button?(this.short_like_count=i.default_button.title,this.like_count=parseInt(i.default_button.accessibility_text.replace(/\D/g,""))):i.toggled_button&&(this.short_like_count=i.toggled_button.title,this.like_count=parseInt(i.toggled_button.accessibility_text.replace(/\D/g,"")))}this.like_count_entity={key:e.likeCountEntity.key},this.dynamic_like_count_update_data={update_status_key:e.dynamicLikeCountUpdateData.updateStatusKey,placeholder_like_count_values_key:e.dynamicLikeCountUpdateData.placeholderLikeCountValuesKey,update_delay_loop_id:e.dynamicLikeCountUpdateData.updateDelayLoopId,update_delay_sec:e.dynamicLikeCountUpdateData.updateDelaySec}}};r(Xo,"SegmentedLikeDislikeButtonView");Xo.type="SegmentedLikeDislikeButtonView";var Xt=Xo;var Qo=class extends v{constructor(e){super(e)}};r(Qo,"MenuServiceItem");Qo.type="MenuServiceItem";var At=Qo;var Jo=class extends n{constructor(e){super(),this.style=e.style,this.size=e.size,this.endpoint=new d(e.command),this.target_id=e.targetId}};r(Jo,"DownloadButton");Jo.type="DownloadButton";var Yr=Jo;var Zo=class extends n{constructor(e){super(),this.has_separator=!!e.hasSeparator,this.endpoint=new d(e.navigationEndpoint||e.serviceEndpoint)}};r(Zo,"MenuServiceItemDownload");Zo.type="MenuServiceItemDownload";var zd=Zo;var en=class extends n{constructor(e){super(),this.menu_item=c.parseItem(e.menuItem,[At,zd]),this.top_level_button=c.parseItem(e.topLevelButton,[Yr,Te,v])}};r(en,"MenuFlexibleItem");en.type="MenuFlexibleItem";var Xd=en;var tn=class extends n{constructor(e){super(),this.target={video_id:e.target.videoId},this.like_status=e.likeStatus,this.likes_allowed=e.likesAllowed,Reflect.has(e,"serviceEndpoints")&&(this.endpoints=e.serviceEndpoints.map(i=>new d(i)))}};r(tn,"LikeButton");tn.type="LikeButton";var Vr=tn;var rn=class extends n{constructor(e){super(),this.items=c.parseArray(e.items),this.flexible_items=c.parseArray(e.flexibleItems,Xd),this.top_level_buttons=c.parseArray(e.topLevelButtons,[se,Vr,v,Te,Xt]),Reflect.has(e,"accessibility")&&Reflect.has(e.accessibility,"accessibilityData")&&(this.label=e.accessibility.accessibilityData.label)}get contents(){return this.items}};r(rn,"Menu");rn.type="Menu";var R=rn;var sn=class extends n{constructor(e){super(),this.id=e.postId,this.author=new P({...e.authorText,navigationEndpoint:e.authorEndpoint},null,e.authorThumbnail),this.content=new p(e.contentText),this.published=new p(e.publishedTimeText),Reflect.has(e,"pollStatus")&&(this.poll_status=e.pollStatus),Reflect.has(e,"voteStatus")&&(this.vote_status=e.voteStatus),Reflect.has(e,"voteCount")&&(this.vote_count=new p(e.voteCount)),Reflect.has(e,"actionMenu")&&(this.menu=c.parseItem(e.actionMenu,R)),Reflect.has(e,"actionButtons")&&(this.action_buttons=c.parseItem(e.actionButtons,$d)),Reflect.has(e,"voteButton")&&(this.vote_button=c.parseItem(e.voteButton,v)),Reflect.has(e,"navigationEndpoint")&&(this.endpoint=new d(e.navigationEndpoint)),Reflect.has(e,"backstageAttachment")&&(this.attachment=c.parseItem(e.backstageAttachment)),this.surface=e.surface}};r(sn,"BackstagePost");sn.type="BackstagePost";var bi=sn;var on=class extends n{constructor(e){super(),this.post=c.parseItem(e.post)}};r(on,"BackstagePostThread");on.type="BackstagePostThread";var PT=on;var gi=class extends n{constructor(e){super(),this.text=e.badgeText,this.style=e.badgeStyle,this.accessibility_label=e.accessibilityLabel}};r(gi,"BadgeView");var nn=class extends n{constructor(e){super(),this.contents=c.parseArray(e.contents)}};r(nn,"BrowseFeedActions");nn.type="BrowseFeedActions";var Qd=nn;var an=class extends n{constructor(e){super(),this.album=new p(e.album),this.thumbnails=y.fromResponse(e.thumbnailDetails)}};r(an,"BrowserMediaSession");an.type="BrowserMediaSession";var NT=an;var Ur=class extends n{constructor(e){super(),this.endpoint=new d(e.navigationEndpoint),this.icon=y.fromResponse(e.icon),this.title=new p(e.title)}};r(Ur,"HeaderLink");Ur.type="HeaderLink";var pn=class extends n{constructor(e){var i,s;super(),this.primary=G(((i=e.primaryLinks)==null?void 0:i.map(o=>new Ur(o)))||[]),this.secondary=G(((s=e.secondaryLinks)==null?void 0:s.map(o=>new Ur(o)))||[])}};r(pn,"ChannelHeaderLinks");pn.type="ChannelHeaderLinks";var Jd=pn;var cn=class extends n{constructor(e){super(),Reflect.has(e,"firstLink")&&(this.first_link=p.fromAttributed(e.firstLink)),Reflect.has(e,"more")&&(this.more=p.fromAttributed(e.more))}};r(cn,"ChannelHeaderLinksView");cn.type="ChannelHeaderLinksView";var Zd=cn;var ln=class extends n{constructor(e){super(),this.placeholder_text=new p(e.placeholderText),this.max_character_limit=e.maxCharacterLimit}};r(ln,"ClipCreationTextInput");ln.type="ClipCreationTextInput";var e_=ln;var un=class extends n{constructor(e){var i,s,o,a,l,f;super(),this.length_template=e.lengthTemplate,this.max_length_ms=e.maxLengthMs,this.min_length_ms=e.minLengthMs,this.default_length_ms=e.defaultLengthMs,this.window_size_ms=e.windowSizeMs,this.start_label=(s=(i=e.startAccessibility)==null?void 0:i.accessibilityData)==null?void 0:s.label,this.end_label=(a=(o=e.endAccessibility)==null?void 0:o.accessibilityData)==null?void 0:a.label,this.duration_label=(f=(l=e.durationAccessibility)==null?void 0:l.accessibilityData)==null?void 0:f.label}};r(un,"ClipCreationScrubber");un.type="ClipCreationScrubber";var t_=un;var fn=class extends n{constructor(e){super(),this.title=new p(e.title),this.body=new p(e.body)}};r(fn,"ClipAdState");fn.type="ClipAdState";var i_=fn;var mn=class extends n{constructor(e){super(),this.user_avatar=y.fromResponse(e.userAvatar),this.title_input=c.parseItem(e.titleInput,[e_]),this.scrubber=c.parseItem(e.scrubber,[t_]),this.save_button=c.parseItem(e.saveButton,[v]),this.display_name=new p(e.displayName),this.publicity_label=e.publicityLabel,this.cancel_button=c.parseItem(e.cancelButton,[v]),this.ad_state_overlay=c.parseItem(e.adStateOverlay,[i_]),this.external_video_id=e.externalVideoId,this.publicity_label_icon=e.publicityLabelIcon}};r(mn,"ClipCreation");mn.type="ClipCreation";var r_=mn;var hn=class extends n{constructor(e){super(),this.contents=c.parse(e.contents,!0,[r_])}};r(hn,"ClipSection");hn.type="ClipSection";var s_=hn;var dn=class extends n{constructor(e){super(),this.trigger=e.trigger,Reflect.has(e,"button")&&(this.button=c.parseItem(e.button,v)),this.endpoint=new d(e.continuationEndpoint)}};r(dn,"ContinuationItem");dn.type="ContinuationItem";var J=dn;var _n=class extends n{constructor(e){super(),this.title=new p(e.title),this.contextual_info=e.contextualInfo?new p(e.contextualInfo):void 0,this.visibility_button=c.parseItem(e.visibilityButton,v),this.menu=c.parseItem(e.menu)}};r(_n,"EngagementPanelTitleHeader");_n.type="EngagementPanelTitleHeader";var o_=_n;var xn=class extends n{constructor(e){super(),this.info_text=new p(e.infoText),this.menu=c.parseItem(e.menu,R)}};r(xn,"MacroMarkersInfoItem");xn.type="MacroMarkersInfoItem";var n_=xn;var yn=class extends n{constructor(e){super(),this.title=new p(e.title),this.time_description=new p(e.timeDescription),this.thumbnail=y.fromResponse(e.thumbnail),this.on_tap_endpoint=new d(e.onTap),this.layout=e.layout,this.is_highlighted=!!e.isHighlighted}};r(yn,"MacroMarkersListItem");yn.type="MacroMarkersListItem";var Fr=yn;var bn=class extends n{constructor(e){super(),this.contents=c.parseArray(e.contents,[n_,Fr]),this.sync_button_label=new p(e.syncButtonLabel)}};r(bn,"MacroMarkersList");bn.type="MacroMarkersList";var a_=bn;var gn=class extends n{constructor(e){super(),this.contents=c.parseArray(e.contents)}};r(gn,"ProductList");gn.type="ProductList";var p_=gn;var wn=class extends n{constructor(e){super(),this.contents=c.parseArray(e.contents),Reflect.has(e,"targetId")&&(this.target_id=e.targetId),Reflect.has(e,"continuations")&&(Reflect.has(e.continuations[0],"nextContinuationData")?this.continuation=e.continuations[0].nextContinuationData.continuation:Reflect.has(e.continuations[0],"reloadContinuationData")&&(this.continuation=e.continuations[0].reloadContinuationData.continuation)),Reflect.has(e,"header")&&(this.header=c.parseItem(e.header)),Reflect.has(e,"subMenu")&&(this.sub_menu=c.parseItem(e.subMenu))}};r(wn,"SectionList");wn.type="SectionList";var de=wn;var Tn=class extends n{constructor(e){super(),this.show_more_text=new p(e.showMoreText),this.show_less_text=new p(e.showLessText),Reflect.has(e,"attributedDescriptionBodyText")&&(this.attributed_description_body_text=p.fromAttributed(e.attributedDescriptionBodyText))}};r(Tn,"ExpandableVideoDescriptionBody");Tn.type="ExpandableVideoDescriptionBody";var c_=Tn;var vn=class extends n{constructor(e){super(),this.thumbnails=y.fromResponse(e.thumbnail),this.endpoint=new d(e.searchEndpoint),this.query=new p(e.query).toString()}};r(vn,"SearchRefinementCard");vn.type="SearchRefinementCard";var tr=vn;var In=class extends n{constructor(e){super(),this.game=c.parseItem(e.game)}};r(In,"GameCard");In.type="GameCard";var l_=In;var Sn=class extends n{constructor(e){super(),this.visible_item_count=e.visibleItemCount,this.items=c.parseArray(e.items)}get contents(){return this.items}};r(Sn,"HorizontalList");Sn.type="HorizontalList";var u_=Sn;var En=class extends n{constructor(e){super(),Reflect.has(e,"header")&&(this.header={collapsed_title:new p(e.header.collapsedTitle),collapsed_thumbnail:y.fromResponse(e.header.collapsedThumbnail),collapsed_label:new p(e.header.collapsedLabel),expanded_title:new p(e.header.expandedTitle)}),this.expanded_content=c.parseItem(e.expandedContent,[wi,u_]),this.expand_button=c.parseItem(e.expandButton,v),this.collapse_button=c.parseItem(e.collapseButton,v)}};r(En,"ExpandableMetadata");En.type="ExpandableMetadata";var f_=En;var kn=class extends n{constructor(e){super(),Reflect.has(e,"icon")&&(this.icon_type=e.icon.iconType),Reflect.has(e,"style")&&(this.style=e.style),Reflect.has(e,"label")&&(this.label=e.label),(Reflect.has(e,"tooltip")||Reflect.has(e,"iconTooltip"))&&(this.tooltip=e.tooltip||e.iconTooltip)}};r(kn,"MetadataBadge");kn.type="MetadataBadge";var Ge=kn;var Cn=class extends n{constructor(e){super(),this.text=new p(e.text).toString(),this.style=e.style}};r(Cn,"ThumbnailOverlayTimeStatus");Cn.type="ThumbnailOverlayTimeStatus";var ir=Cn;var Pn=class extends n{constructor(e){var s,o,a;super();let i=((s=e.thumbnailOverlays.find(l=>l.thumbnailOverlayTimeStatusRenderer))==null?void 0:s.thumbnailOverlayTimeStatusRenderer.text)||"N/A";this.id=e.videoId,this.title=new p(e.title),Reflect.has(e,"descriptionSnippet")&&(this.description_snippet=new p(e.descriptionSnippet)),Reflect.has(e,"detailedMetadataSnippets")&&(this.snippets=e.detailedMetadataSnippets.map(l=>({text:new p(l.snippetText),hover_text:new p(l.snippetHoverText)}))),this.expandable_metadata=c.parseItem(e.expandableMetadata,f_),this.thumbnails=y.fromResponse(e.thumbnail),this.thumbnail_overlays=c.parseArray(e.thumbnailOverlays),Reflect.has(e,"richThumbnail")&&(this.rich_thumbnail=c.parseItem(e.richThumbnail)),this.author=new P(e.ownerText,e.ownerBadges,(a=(o=e.channelThumbnailSupportedRenderers)==null?void 0:o.channelThumbnailWithLinkRenderer)==null?void 0:a.thumbnail),this.badges=c.parseArray(e.badges,Ge),this.endpoint=new d(e.navigationEndpoint),this.published=new p(e.publishedTimeText),this.view_count=new p(e.viewCountText),this.short_view_count=new p(e.shortViewCountText),Reflect.has(e,"upcomingEventData")&&(this.upcoming=new Date(Number(`${e.upcomingEventData.startTime}000`))),this.duration={text:e.lengthText?new p(e.lengthText).toString():new p(i).toString(),seconds:_e(e.lengthText?new p(e.lengthText).toString():new p(i).toString())},this.show_action_menu=!!e.showActionMenu,this.is_watched=!!e.isWatched,this.menu=c.parseItem(e.menu,R),Reflect.has(e,"searchVideoResultEntityKey")&&(this.search_video_result_entity_key=e.searchVideoResultEntityKey)}get description(){var e;return this.snippets?this.snippets.map(i=>i.text.toString()).join(""):((e=this.description_snippet)==null?void 0:e.toString())||""}get is_live(){var e;return this.badges.some(i=>{if(i.style==="BADGE_STYLE_TYPE_LIVE_NOW"||i.label==="LIVE")return!0})||((e=this.thumbnail_overlays.firstOfType(ir))==null?void 0:e.style)==="LIVE"}get is_upcoming(){return this.upcoming&&this.upcoming>new Date}get is_premiere(){return this.badges.some(e=>e.label==="PREMIERE")}get is_4k(){return this.badges.some(e=>e.label==="4K")}get has_captions(){return this.badges.some(e=>e.label==="CC")}get best_thumbnail(){return this.thumbnails[0]}};r(Pn,"Video");Pn.type="Video";var Wr=Pn;var Nn=class extends Wr{constructor(e){var i,s;if(super(e),Reflect.has(e,"metadataText")){let o=new p(e.metadataText);o.text&&(this.short_view_count=new p({simpleText:o.text.split("\xB7")[0].trim()}),this.published=new p({simpleText:o.text.split("\xB7")[1].trim()}))}Reflect.has(e,"bylineText")&&(this.author=new P(e.bylineText,e.ownerBadges,(s=(i=e.channelThumbnailSupportedRenderers)==null?void 0:i.channelThumbnailWithLinkRenderer)==null?void 0:s.thumbnail))}};r(Nn,"VideoCard");Nn.type="VideoCard";var m_=Nn;var An=class extends n{constructor(e){super(),this.image=y.fromResponse(e.image),this.style=e.style}};r(An,"ContentPreviewImageView");An.type="ContentPreviewImageView";var rr=An;var Rn=class extends n{constructor(e){var i;super(),(i=e.image)!=null&&i.sources?this.image=y.fromResponse(e.image):this.image=c.parseItem(e.image,rr),this.image_style=e.imageStyle,this.title=e.title,this.subtitle=e.subtitle,Reflect.has(e,"secondarySubtitle")&&(this.secondary_subtitle={content:e.secondarySubtitle.content}),this.orientation=e.orientation,this.sizing_rule=e.sizingRule,this.overflow_menu_on_tap=new d(e.overflowMenuOnTap),this.overflow_menu_a11y_label=e.overflowMenuA11yLabel}};r(Rn,"VideoAttributeView");Rn.type="VideoAttributeView";var Ti=Rn;var Mn=class extends n{constructor(e){super(),this.cards=c.parseArray(e.cards,[Ti,tr,Fr,l_,m_]),this.header=c.parseItem(e.header),this.previous_button=c.parseItem(e.previousButton,v),this.next_button=c.parseItem(e.nextButton,v)}};r(Mn,"HorizontalCardList");Mn.type="HorizontalCardList";var wi=Mn;var Ln=class extends n{constructor(e){super(),this.label=new p(e.label),this.value=new p(e.value),this.accessibility_text=e.accessibilityText}};r(Ln,"Factoid");Ln.type="Factoid";var vi=Ln;var On=class extends n{constructor(e){super(),this.factoid=c.parseItem(e.factoid,vi)}};r(On,"UploadTimeFactoid");On.type="UploadTimeFactoid";var h_=On;var Dn=class extends n{constructor(e){super(),this.view_count_entity_key=e.viewCountEntityKey,this.factoid=c.parseItem(e.factoid,[vi]),this.view_count_type=e.viewCountType}};r(Dn,"ViewCountFactoid");Dn.type="ViewCountFactoid";var d_=Dn;var Bn=class extends n{constructor(e){super(),this.title=new p(e.title),this.channel=new p(e.channel),this.channel_navigation_endpoint=new d(e.channelNavigationEndpoint),this.channel_thumbnail=y.fromResponse(e.channelThumbnail),this.publish_date=new p(e.publishDate),this.views=new p(e.views),this.factoids=c.parseArray(e.factoid,[vi,d_,h_])}};r(Bn,"VideoDescriptionHeader");Bn.type="VideoDescriptionHeader";var __=Bn;var Yn=class extends n{constructor(e){super(),this.section_title=new p(e.sectionTitle),this.creator_videos_button=c.parseItem(e.creatorVideosButton,v),this.creator_about_button=c.parseItem(e.creatorAboutButton,v),this.section_subtitle=new p(e.sectionSubtitle),this.channel_avatar=y.fromResponse(e.channelAvatar),this.channel_endpoint=new d(e.channelEndpoint)}};r(Yn,"VideoDescriptionInfocardsSection");Yn.type="VideoDescriptionInfocardsSection";var x_=Yn;var Vn=class extends n{constructor(e){super(),this.title=new p(e.title),Reflect.has(e,"defaultMetadata")&&(this.default_metadata=new p(e.defaultMetadata)),Reflect.has(e,"expandedMetadata")&&(this.expanded_metadata=new p(e.expandedMetadata)),Reflect.has(e,"infoRowExpandStatusKey")&&(this.info_row_expand_status_key=e.infoRowExpandStatusKey)}};r(Vn,"InfoRow");Vn.type="InfoRow";var y_=Vn;var Un=class extends n{constructor(e){super(),this.id=e.videoId,this.thumbnails=y.fromResponse(e.thumbnail)||null,Reflect.has(e,"richThumbnail")&&(this.rich_thumbnail=c.parseItem(e.richThumbnail)),this.title=new p(e.title),this.author=new P(e.longBylineText,e.ownerBadges,e.channelThumbnail),this.view_count=new p(e.viewCountText),this.short_view_count=new p(e.shortViewCountText),this.published=new p(e.publishedTimeText),this.badges=c.parseArray(e.badges,Ge),this.duration={text:new p(e.lengthText).toString(),seconds:_e(new p(e.lengthText).toString())},this.thumbnail_overlays=c.parseArray(e.thumbnailOverlays),this.endpoint=new d(e.navigationEndpoint),this.menu=c.parseItem(e.menu,R)}get best_thumbnail(){return this.thumbnails[0]}get is_fundraiser(){return this.badges.some(e=>e.label==="Fundraiser")}get is_live(){return this.badges.some(e=>{if(e.style==="BADGE_STYLE_TYPE_LIVE_NOW"||e.label==="LIVE")return!0})}get is_new(){return this.badges.some(e=>e.label==="New")}get is_premiere(){return this.badges.some(e=>e.style==="PREMIERE")}};r(Un,"CompactVideo");Un.type="CompactVideo";var Gr=Un;var Fn=class extends n{constructor(e){super(),this.info_rows=c.parseArray(e.infoRows,y_),this.video_lockup=c.parseItem(e.videoLockup,Gr)}};r(Fn,"CarouselLockup");Fn.type="CarouselLockup";var b_=Fn;var Wn=class extends n{constructor(e){super(),this.carousel_lockups=c.parseArray(e.carouselLockups,b_),this.section_title=new p(e.sectionTitle)}};r(Wn,"VideoDescriptionMusicSection");Wn.type="VideoDescriptionMusicSection";var jr=Wn;var Gn=class extends n{constructor(e){super(),this.section_title=new p(e.sectionTitle),this.sub_header_text=new p(e.subHeaderText),this.primary_button=c.parseItem(e.primaryButton,v)}};r(Gn,"VideoDescriptionTranscriptSection");Gn.type="VideoDescriptionTranscriptSection";var jn=Gn;var Hn=class extends n{constructor(e){super(),this.thumbnail=y.fromResponse(e.thumbnail),this.title=new p(e.title),this.short_byline_text=new p(e.shortBylineText),this.video_count_short_text=new p(e.videoCountShortText),this.endpoint=new d(e.navigationEndpoint),this.thumbnail_width=e.thumbnailWidth,this.aspect_ratio=e.aspectRatio,this.max_lines_title=e.maxLinesTitle,this.max_lines_short_byline_text=e.maxLinesShortBylineText,this.overlay_position=e.overlayPosition}};r(Hn,"StructuredDescriptionPlaylistLockup");Hn.type="StructuredDescriptionPlaylistLockup";var g_=Hn;var $n=class extends n{constructor(e){super(),this.section_title=new p(e.sectionTitle),this.media_lockups=c.parseArray(e.mediaLockups,[g_])}};r($n,"VideoDescriptionCourseSection");$n.type="VideoDescriptionCourseSection";var w_=$n;var Kn=class extends n{constructor(e){super(),this.title=new p(e.title),this.items=c.parseArray(e.items),Reflect.has(e,"endpoint")&&(this.endpoint=new d(e.endpoint))}get contents(){return this.items}};r(Kn,"ReelShelf");Kn.type="ReelShelf";var Hr=Kn;var qn=class extends n{constructor(e){super(),this.header_title=e.headerTitle,this.header_subtitle=e.headerSubtitle,this.video_attributes=c.parseArray(e.videoAttributeViewModels,Ti),this.previous_button=c.parseItem(e.previousButton,Te),this.next_button=c.parseItem(e.nextButton,Te)}};r(qn,"VideoAttributesSectionView");qn.type="VideoAttributesSectionView";var T_=qn;var zn=class extends n{constructor(e){super(),this.items=c.parseArray(e.items,[__,c_,jr,x_,w_,jn,jn,wi,Hr,T_])}};r(zn,"StructuredDescriptionContent");zn.type="StructuredDescriptionContent";var sr=zn;var Xn=class extends n{constructor(e){super(),this.header=c.parseItem(e.header,o_),this.content=c.parseItem(e.content,[Ti,de,J,s_,sr,a_,p_]),this.panel_identifier=e.panelIdentifier,this.identifier=e.identifier?{surface:e.identifier.surface,tag:e.identifier.tag}:void 0,this.target_id=e.targetId,this.visibility=e.visibility}};r(Xn,"EngagementPanelSectionList");Xn.type="EngagementPanelSectionList";var Ii=Xn;var Qn=class extends n{constructor(e){super(),this.content=e.content,this.max_lines=e.maxLines,this.more_endpoint=e.moreEndpoint.showEngagementPanelEndpoint?{show_engagement_panel_endpoint:{engagement_panel:c.parseItem(e.moreEndpoint.showEngagementPanelEndpoint.engagementPanel,Ii),engagement_panel_popup_type:e.moreEndpoint.showEngagementPanelEndpoint.engagementPanelPresentationConfigs.engagementPanelPopupPresentationConfig.popupType,identifier:{surface:e.moreEndpoint.showEngagementPanelEndpoint.identifier.surface,tag:e.moreEndpoint.showEngagementPanelEndpoint.identifier.tag}}}:new d(e.moreEndpoint),this.more_icon_type=e.moreIcon.iconType,this.more_label=e.moreLabel,this.target_id=e.targetId}};r(Qn,"ChannelTagline");Qn.type="ChannelTagline";var v_=Qn;var Jn=class extends n{constructor(e){super(),this.states=e.states.map(i=>({id:i.stateId,next_id:i.nextStateId,state:c.parse(i.state)})),this.current_state_id=e.currentStateId,this.target_id=e.targetId}};r(Jn,"SubscriptionNotificationToggleButton");Jn.type="SubscriptionNotificationToggleButton";var I_=Jn;var Zn=class extends n{constructor(e){var i,s;super(),this.button_text=new p(e.buttonText),this.subscribed=e.subscribed,this.enabled=e.enabled,this.item_type=e.type,this.channel_id=e.channelId,this.show_preferences=e.showPreferences,this.subscribed_text=new p(e.subscribedButtonText),this.unsubscribed_text=new p(e.unsubscribedButtonText),this.notification_preference_button=c.parseItem(e.notificationPreferenceButton,I_),Reflect.has(e,"serviceEndpoints")&&(this.service_endpoints=e.serviceEndpoints.map(o=>new d(o))),Reflect.has(e,"onSubscribeEndpoints")&&(this.on_subscribe_endpoints=e.onSubscribeEndpoints.map(o=>new d(o))),Reflect.has(e,"onUnsubscribeEndpoints")&&(this.on_unsubscribe_endpoints=e.onUnsubscribeEndpoints.map(o=>new d(o))),Reflect.has(e,"subscribedEntityKey")&&(this.subscribed_entity_key=e.subscribedEntityKey),Reflect.has(e,"targetId")&&(this.target_id=e.targetId),Reflect.has(e,"subscribeAccessibility")&&(this.subscribe_accessibility_label=(i=e.subscribeAccessibility.accessibilityData)==null?void 0:i.label),Reflect.has(e,"unsubscribeAccessibility")&&(this.unsubscribe_accessibility_label=(s=e.unsubscribeAccessibility.accessibilityData)==null?void 0:s.label)}};r(Zn,"SubscribeButton");Zn.type="SubscribeButton";var xe=Zn;var ea=class extends n{constructor(e){super(),this.author=new P({simpleText:e.title,navigationEndpoint:e.navigationEndpoint},e.badges,e.avatar),Reflect.has(e,"banner")&&(this.banner=y.fromResponse(e.banner)),Reflect.has(e,"tv_banner")&&(this.tv_banner=y.fromResponse(e.tvBanner)),Reflect.has(e,"mobile_banner")&&(this.mobile_banner=y.fromResponse(e.mobileBanner)),Reflect.has(e,"subscriberCountText")&&(this.subscribers=new p(e.subscriberCountText)),Reflect.has(e,"videosCountText")&&(this.videos_count=new p(e.videosCountText)),Reflect.has(e,"sponsorButton")&&(this.sponsor_button=c.parseItem(e.sponsorButton,v)),Reflect.has(e,"subscribeButton")&&(this.subscribe_button=c.parseItem(e.subscribeButton,[xe,v])),Reflect.has(e,"headerLinks")&&(this.header_links=c.parseItem(e.headerLinks,[Jd,Zd])),Reflect.has(e,"channelHandleText")&&(this.channel_handle=new p(e.channelHandleText)),Reflect.has(e,"channelId")&&(this.channel_id=e.channelId),Reflect.has(e,"tagline")&&(this.tagline=c.parseItem(e.tagline,v_))}};r(ea,"C4TabbedHeader");ea.type="C4TabbedHeader";var $r=ea;var ta=class extends n{constructor(e){super(),this.label=new p(e.label),this.icon_type=e.icon.iconType,this.style=e.style}};r(ta,"CallToActionButton");ta.type="CallToActionButton";var AT=ta;var ia=class extends n{constructor(e){super(),this.teaser=c.parseItem(e.teaser),this.content=c.parseItem(e.content),Reflect.has(e,"cardId")&&(this.card_id=e.cardId),Reflect.has(e,"feature")&&(this.feature=e.feature),this.cue_ranges=e.cueRanges.map(i=>({start_card_active_ms:i.startCardActiveMs,end_card_active_ms:i.endCardActiveMs,teaser_duration_ms:i.teaserDurationMs,icon_after_teaser_ms:i.iconAfterTeaserMs}))}};r(ia,"Card");ia.type="Card";var RT=ia;var ra=class extends n{constructor(e){super(),this.cards=c.parseArray(e.cards),this.header=new p(e.headerText),this.allow_teaser_dismiss=e.allowTeaserDismiss}};r(ra,"CardCollection");ra.type="CardCollection";var S_=ra;var sa=class extends n{constructor(e){super(),this.contents=c.parseArray(e.contents)}};r(sa,"CarouselHeader");sa.type="CarouselHeader";var E_=sa;var oa=class extends n{constructor(e){super(),this.items=c.parseArray(e.carouselItems),this.background_color=e.backgroundColor,this.layout_style=e.layoutStyle,this.pagination_thumbnails=y.fromResponse(e.paginationThumbnails),this.paginator_alignment=e.paginatorAlignment}get contents(){return this.items}};r(oa,"CarouselItem");oa.type="CarouselItem";var MT=oa;var na=class extends n{constructor(e){super(),this.id=e.channelId,this.author=new P({...e.title,navigationEndpoint:e.navigationEndpoint},e.ownerBadges,e.thumbnail),this.subscriber_count=new p(e.subscriberCountText),this.video_count=new p(e.videoCountText),this.long_byline=new p(e.longBylineText),this.short_byline=new p(e.shortBylineText),this.endpoint=new d(e.navigationEndpoint),this.subscribe_button=c.parseItem(e.subscribeButton,[xe,v]),this.description_snippet=new p(e.descriptionSnippet)}};r(na,"Channel");na.type="Channel";var k_=na;var aa=class extends n{constructor(e){var i,s;super(),this.id=e.channelId,this.name=new p(e.title),this.avatar=y.fromResponse(e.avatar),this.canonical_channel_url=e.canonicalChannelUrl,this.primary_links=(s=(i=e.primaryLinks)==null?void 0:i.map(o=>({endpoint:new d(o.navigationEndpoint),icon:y.fromResponse(o.icon),title:new p(o.title)})))!=null?s:[],this.view_count=new p(e.viewCountText),this.joined_date=new p(e.joinedDateText),this.description=new p(e.description),this.email_reveal=new d(e.onBusinessEmailRevealClickCommand),this.can_reveal_email=!e.signInForBusinessEmail,this.country=new p(e.country),this.buttons=c.parseArray(e.actionButtons,v)}};r(aa,"ChannelAboutFullMetadata");aa.type="ChannelAboutFullMetadata";var pa=aa;var ca=class extends n{constructor(e){super(),this.channel_title=e.channelTitle,this.avatar=y.fromResponse(e.avatar),this.header=new p(e.header),this.main_text=new p(e.mainText),this.sign_in_button=c.parseItem(e.signInButton,v),this.secondary_text=new p(e.secondaryText)}};r(ca,"ChannelAgeGate");ca.type="ChannelAgeGate";var LT=ca;var la=class extends n{constructor(e){super(),this.title=new p(e.title),this.items=c.parseArray(e.items)}};r(la,"ChannelFeaturedContent");la.type="ChannelFeaturedContent";var OT=la;var ua=class extends n{constructor(e){super(),this.title=e.title,this.description=e.description,this.url=e.channelUrl,this.rss_url=e.rssUrl,this.vanity_channel_url=e.vanityChannelUrl,this.external_id=e.externalId,this.is_family_safe=e.isFamilySafe,this.keywords=e.keywords,this.avatar=y.fromResponse(e.avatar),this.music_artist_name=typeof e.musicArtistName=="string"&&e.musicArtistName.length>0?e.musicArtistName:void 0,this.available_countries=e.availableCountryCodes,this.android_deep_link=e.androidDeepLink,this.android_appindexing_link=e.androidAppindexingLink,this.ios_appindexing_link=e.iosAppindexingLink}};r(ua,"ChannelMetadata");ua.type="ChannelMetadata";var C_=ua;var fa=class extends n{constructor(e){super(),this.title=new p(e.title)}};r(fa,"ChannelMobileHeader");fa.type="ChannelMobileHeader";var DT=fa;var ma=class extends n{constructor(e){super(),this.avatar=y.fromResponse(e.avatar),this.endpoint=new d(e.avatarEndpoint),this.name=e.name,this.links=e.links.map(i=>new p(i))}};r(ma,"ChannelOptions");ma.type="ChannelOptions";var P_=ma;var ha=class extends n{constructor(e){super(),this.illustration=y.fromResponse(e.illustration),this.description=new p(e.description)}};r(ha,"ChannelOwnerEmptyState");ha.type="ChannelOwnerEmptyState";var BT=ha;var da=class extends n{constructor(e){super(),this.content_type_sub_menu_items=e.contentTypeSubMenuItems.map(i=>({endpoint:new d(i.navigationEndpoint||i.endpoint),selected:i.selected,title:i.title})),this.sort_setting=c.parseItem(e.sortSetting)}};r(da,"ChannelSubMenu");da.type="ChannelSubMenu";var _a=da;var xa=class extends n{constructor(e){super(),this.title=new p(e.title).toString(),Reflect.has(e,"button")&&(this.button=c.parseItem(e.button,v))}};r(xa,"ChannelSwitcherHeader");xa.type="ChannelSwitcherHeader";var YT=xa;var ya=class extends n{constructor(e){var i,s;super(),this.thumbnails=y.fromResponse(e.thumbnail),this.endpoint=new d(e.navigationEndpoint),this.label=(s=(i=e.accessibility)==null?void 0:i.accessibilityData)==null?void 0:s.label}};r(ya,"ChannelThumbnailWithLink");ya.type="ChannelThumbnailWithLink";var VT=ya;var ba=class extends n{constructor(e){super(),this.id=e.videoId,this.title=new p(e.title),this.description=new p(e.description),this.view_count=new p(e.viewCountText),this.published_time=new p(e.publishedTimeText)}};r(ba,"ChannelVideoPlayer");ba.type="ChannelVideoPlayer";var UT=ba;var ga=class extends n{constructor(e){super(),this.title=new p(e.title),this.time_range_start_millis=e.timeRangeStartMillis,this.thumbnail=y.fromResponse(e.thumbnail)}};r(ga,"Chapter");ga.type="Chapter";var N_=ga;var wa=class extends n{constructor(e){super(),this.id=e.videoId,this.title=new p(e.title),this.duration={text:e.lengthText.simpleText,seconds:_e(e.lengthText.simpleText)},this.endpoint=new d(e.navigationEndpoint)}};r(wa,"ChildVideo");wa.type="ChildVideo";var FT=wa;var Ta=class extends n{constructor(e){super(),this.text=e.text,this.display_type=e.displayType,this.endpoint=new d(e.tapCommand),this.chip_entity_key=e.chipEntityKey}};r(Ta,"ChipView");Ta.type="ChipView";var A_=Ta;var va=class extends n{constructor(e){super(),this.chips=c.parseArray(e.chips,A_)}};r(va,"ChipBarView");va.type="ChipBarView";var WT=va;var Ia=class extends n{constructor(e){super(),this.is_selected=e.isSelected,Reflect.has(e,"navigationEndpoint")&&(this.endpoint=new d(e.navigationEndpoint)),this.text=new p(e.text).toString()}};r(Ia,"ChipCloudChip");Ia.type="ChipCloudChip";var je=Ia;var Sa=class extends n{constructor(e){super(),this.chips=c.parseArray(e.chips,je),this.next_button=c.parseItem(e.nextButton,v),this.previous_button=c.parseItem(e.previousButton,v),this.horizontal_scrollable=e.horizontalScrollable}};r(Sa,"ChipCloud");Sa.type="ChipCloud";var Kr=Sa;var Ea=class extends n{constructor(e){super(),this.channel_avatar=y.fromResponse(e.channelAvatar),this.custom_text=new p(e.customText),this.channel_name=new p(e.channelName),this.subscriber_count=new p(e.subscriberCountText),this.endpoint=new d(e.endpoint)}};r(Ea,"CollaboratorInfoCardContent");Ea.type="CollaboratorInfoCardContent";var GT=Ea;var ka=class extends n{constructor(e){super(),this.left=y.fromResponse(e.leftThumbnail),this.top_right=y.fromResponse(e.topRightThumbnail),this.bottom_right=y.fromResponse(e.bottomRightThumbnail),this.endpoint=new d(e.navigationEndpoint)}};r(ka,"CollageHeroImage");ka.type="CollageHeroImage";var jT=ka;var Ca=class extends n{constructor(e){super(),this.icon_name=e.icon.sources[0].clientResource.imageName,this.text=p.fromAttributed(e.text),this.style=e.style}};r(Ca,"ThumbnailHoverOverlayView");Ca.type="ThumbnailHoverOverlayView";var R_=Ca;var Pa=class extends n{constructor(e){super(),this.text=e.text,this.badge_style=e.badgeStyle,e.backgroundColor&&(this.background_color={light_theme:e.backgroundColor.lightTheme,dark_theme:e.backgroundColor.darkTheme}),e.iconName&&(this.icon_name=e.icon.sources[0].clientResource.imageName)}};r(Pa,"ThumbnailBadgeView");Pa.type="ThumbnailBadgeView";var M_=Pa;var Na=class extends n{constructor(e){super(),this.badges=c.parseArray(e.thumbnailBadges,M_),this.position=e.position}};r(Na,"ThumbnailOverlayBadgeView");Na.type="ThumbnailOverlayBadgeView";var L_=Na;var Aa=class extends n{constructor(e){super(),this.image=y.fromResponse(e.image),this.overlays=c.parseArray(e.overlays,[L_,R_]),e.backgroundColor&&(this.background_color={light_theme:e.backgroundColor.lightTheme,dark_theme:e.backgroundColor.darkTheme})}};r(Aa,"ThumbnailView");Aa.type="ThumbnailView";var O_=Aa;var Ra=class extends n{constructor(e){super(),this.primary_thumbnail=c.parseItem(e.primaryThumbnail,O_),e.stackColor&&(this.stack_color={light_theme:e.stackColor.lightTheme,dark_theme:e.stackColor.darkTheme})}};r(Ra,"CollectionThumbnailView");Ra.type="CollectionThumbnailView";var D_=Ra;var Ma=class extends n{constructor(e){super(),this.open_miniplayer=e.openMiniplayer,this.video_id=e.videoId,this.list_type=e.listType,this.endpoint=new d(e.onCreateListCommand),this.video_ids=e.videoIds}};r(Ma,"AddToPlaylistCommand");Ma.type="AddToPlaylistCommand";var HT=Ma;var La=class extends n{constructor(e){super(),this.commands=c.parseCommands(e.commands)}};r(La,"CommandExecutorCommand");La.type="CommandExecutorCommand";var $T=La;var bt,Oa=class extends n{constructor(e){super(),bt.set(this,void 0),I(this,bt,e,"f")}getApiPath(){switch(u(this,bt,"f").request){case"CONTINUATION_REQUEST_TYPE_WATCH_NEXT":return"next";case"CONTINUATION_REQUEST_TYPE_BROWSE":return"browse";case"CONTINUATION_REQUEST_TYPE_SEARCH":return"search";case"CONTINUATION_REQUEST_TYPE_ACCOUNTS_LIST":return"account/accounts_list";case"CONTINUATION_REQUEST_TYPE_COMMENTS_NOTIFICATION_MENU":return"notification/get_notification_menu";case"CONTINUATION_REQUEST_TYPE_COMMENT_REPLIES":return"comment/get_comment_replies";case"CONTINUATION_REQUEST_TYPE_REEL_WATCH_SEQUENCE":return"reel/reel_watch_sequence";case"CONTINUATION_REQUEST_TYPE_GET_PANEL":return"get_panel";default:return""}}buildRequest(){let e={};return u(this,bt,"f").formData&&(e.formData=u(this,bt,"f").formData),u(this,bt,"f").token&&(e.continuation=u(this,bt,"f").token),u(this,bt,"f").request==="CONTINUATION_REQUEST_TYPE_COMMENTS_NOTIFICATION_MENU"&&(e.notificationsMenuRequestType="NOTIFICATIONS_MENU_REQUEST_TYPE_COMMENTS",u(this,bt,"f").token&&(e.fetchCommentsParams={continuation:u(this,bt,"f").token},delete e.continuation)),e}};r(Oa,"ContinuationCommand");bt=new WeakMap;Oa.type="ContinuationCommand";var KT=Oa;var og,Da,Ba=class extends n{constructor(e){super(),og.set(this,"kids/get_kids_blocklist_picker"),Da.set(this,void 0),I(this,Da,e,"f")}getApiPath(){return u(this,og,"f")}buildRequest(){let e={};return u(this,Da,"f").blockedForKidsContent&&(e.blockedForKidsContent=u(this,Da,"f").blockedForKidsContent),e}};r(Ba,"GetKidsBlocklistPickerCommand");og=new WeakMap,Da=new WeakMap;Ba.type="GetKidsBlocklistPickerCommand";var qT=Ba;var Ya=class extends n{constructor(e){super(),this.engagement_type=e.engagementType,Reflect.has(e,"ids")&&(this.ids=e.ids.map(i=>({encrypted_video_id:i.encryptedVideoId,external_channel_id:i.externalChannelId,comment_id:i.commentId,external_owner_id:i.externalOwnerId,artist_id:i.artistId,playlist_id:i.playlistId,external_post_id:i.externalPostId,share_id:i.shareId})))}};r(Ya,"RunAttestationCommand");Ya.type="RunAttestationCommand";var zT=Ya;var Va=class extends n{constructor(e){var i;super(),this.inline_content=c.parseItem((i=e.panelLoadingStrategy)==null?void 0:i.inlineContent),this.remove_default_padding=!!e.removeDefaultPadding}};r(Va,"ShowDialogCommand");Va.type="ShowDialogCommand";var XT=Va;var B_,Ua=class extends n{constructor(e){super(),B_.set(this,void 0),Reflect.has(e,"icon")&&Reflect.has(e.icon,"iconType")&&(this.icon_type=e.icon.iconType),this.tooltip=e.iconTooltip,this.tooltip==="Verified"&&(this.style="BADGE_STYLE_TYPE_VERIFIED",e.style="BADGE_STYLE_TYPE_VERIFIED"),I(this,B_,e,"f")}get orig_badge(){return u(this,B_,"f")}};r(Ua,"AuthorCommentBadge");B_=new WeakMap;Ua.type="AuthorCommentBadge";var QT=Ua;var Fa=class extends n{constructor(e){super(),this.id=e.id,this.categories=c.parseArray(e.categories),this.category_buttons=c.parseArray(e.categoryButtons),this.search_placeholder=new p(e.searchPlaceholderText),this.search_no_results=new p(e.searchNoResultsText),this.pick_skin_tone=new p(e.pickSkinToneText),this.clear_search_label=e.clearSearchLabel,this.skin_tone_generic_label=e.skinToneGenericLabel,this.skin_tone_light_label=e.skinToneLightLabel,this.skin_tone_medium_light_label=e.skinToneMediumLightLabel,this.skin_tone_medium_label=e.skinToneMediumLabel,this.skin_tone_medium_dark_label=e.skinToneMediumDarkLabel,this.skin_tone_dark_label=e.skinToneDarkLabel}};r(Fa,"EmojiPicker");Fa.type="EmojiPicker";var Y_=Fa;var Wa=class extends n{constructor(e){super(),this.editable_text=new p(e.editableText),this.author_thumbnail=y.fromResponse(e.authorThumbnail),this.submit_button=c.parseItem(e.submitButton,v),this.cancel_button=c.parseItem(e.cancelButton,v),this.placeholder=new p(e.placeholderText),this.emoji_button=c.parseItem(e.emojiButton,v),this.emoji_picker=c.parseItem(e.emojiPicker,Y_)}};r(Wa,"CommentDialog");Wa.type="CommentDialog";var JT=Wa;var Ga=class extends n{constructor(e){super(),this.contents=c.parseArray(e.contents),this.view_replies=c.parseItem(e.viewReplies,v),this.hide_replies=c.parseItem(e.hideReplies,v),this.view_replies_creator_thumbnail=y.fromResponse(e.viewRepliesCreatorThumbnail),this.has_channel_owner_replied=!!e.viewRepliesCreatorThumbnail}};r(Ga,"CommentReplies");Ga.type="CommentReplies";var V_=Ga;var ja=class extends n{constructor(e){super(),this.reply_button=c.parseItem(e.replyButton,v),this.cancel_button=c.parseItem(e.cancelButton,v),this.author_thumbnail=y.fromResponse(e.authorThumbnail),this.placeholder=new p(e.placeholderText),this.error_message=new p(e.errorMessage)}};r(ja,"CommentReplyDialog");ja.type="CommentReplyDialog";var U_=ja;var Ha=class extends n{constructor(e){super(),this.simplebox_avatar=y.fromResponse(e.simpleboxAvatar),this.simplebox_placeholder=new p(e.simpleboxPlaceholder)}};r(Ha,"CommentsSimplebox");Ha.type="CommentsSimplebox";var F_=Ha;var $a=class extends n{constructor(e){super(),Reflect.has(e,"teaserAvatar")&&(this.teaser_avatar=y.fromResponse(e.teaserAvatar)),Reflect.has(e,"teaserContent")&&(this.teaser_content=new p(e.teaserContent))}};r($a,"CommentsEntryPointTeaser");$a.type="CommentsEntryPointTeaser";var W_=$a;var Ka=class extends n{constructor(e){super(),Reflect.has(e,"headerText")&&(this.header=new p(e.headerText)),Reflect.has(e,"commentCount")&&(this.comment_count=new p(e.commentCount)),(Reflect.has(e,"teaserAvatar")||Reflect.has(e,"simpleboxAvatar"))&&(this.teaser_avatar=y.fromResponse(e.teaserAvatar||e.simpleboxAvatar)),Reflect.has(e,"teaserContent")&&(this.teaser_content=new p(e.teaserContent)),Reflect.has(e,"contentRenderer")&&(this.content_renderer=c.parseItem(e.contentRenderer,[W_,F_])),Reflect.has(e,"simpleboxPlaceholder")&&(this.simplebox_placeholder=new p(e.simpleboxPlaceholder))}};r(Ka,"CommentsEntryPointHeader");Ka.type="CommentsEntryPointHeader";var G_=Ka;var qa=class extends n{constructor(e){super(),this.title=new p(e.titleText),this.count=new p(e.countText),this.comments_count=new p(e.commentsCount),this.create_renderer=c.parseItem(e.createRenderer),this.sort_menu=c.parseItem(e.sortMenu,xt),Reflect.has(e,"customEmojis")&&(this.custom_emojis=e.customEmojis.map(i=>({emoji_id:i.emojiId,shortcuts:i.shortcuts,search_terms:i.searchTerms,image:y.fromResponse(i.image),is_custom_emoji:i.isCustomEmoji})))}};r(qa,"CommentsHeader");qa.type="CommentsHeader";var Si=qa;var za=class extends n{constructor(e){super(),this.submit_button=c.parseItem(e.submitButton,v),this.cancel_button=c.parseItem(e.cancelButton,v),this.author_thumbnail=y.fromResponse(e.authorThumbnail),this.placeholder=new p(e.placeholderText),this.avatar_size=e.avatarSize}};r(za,"CommentSimplebox");za.type="CommentSimplebox";var j_=za;var Me,Xa=class extends n{constructor(e){super(),Me.set(this,void 0),this.comment_id=e.commentId,this.is_pinned=!!e.pinnedText,this.keys={comment:e.commentKey,comment_surface:e.commentSurfaceKey,toolbar_state:e.toolbarStateKey,toolbar_surface:e.toolbarSurfaceKey,shared:e.sharedKey}}applyMutations(e,i,s){e&&(this.content=p.fromAttributed(e.properties.content),this.published_time=e.properties.publishedTime,this.author_is_channel_owner=!!e.author.isCreator,this.like_count=e.toolbar.likeCountNotliked?e.toolbar.likeCountNotliked:"0",this.reply_count=e.toolbar.replyCount?e.toolbar.replyCount:"0",this.is_member=!!e.author.sponsorBadgeUrl,Reflect.has(e.author,"sponsorBadgeUrl")&&(this.member_badge={url:e.author.sponsorBadgeUrl,a11y:e.author.A11y}),this.author=new P({simpleText:e.author.displayName,navigationEndpoint:e.avatar.endpoint},e.author,e.avatar.image,e.author.channelId)),i&&(this.is_hearted=i.heartState==="TOOLBAR_HEART_STATE_HEARTED",this.is_liked=i.likeState==="TOOLBAR_LIKE_STATE_LIKED",this.is_disliked=i.likeState==="TOOLBAR_LIKE_STATE_DISLIKED"),s&&!Reflect.has(s,"prepareAccountCommand")&&(this.like_command=new d(s.likeCommand),this.dislike_command=new d(s.dislikeCommand),this.unlike_command=new d(s.unlikeCommand),this.undislike_command=new d(s.undislikeCommand),this.reply_command=new d(s.replyCommand))}async like(){if(!u(this,Me,"f"))throw new g("Actions instance not set for this comment.");if(!this.like_command)throw new g("Like command not found.");if(this.is_liked)throw new g("This comment is already liked.",{comment_id:this.comment_id});return this.like_command.call(u(this,Me,"f"))}async dislike(){if(!u(this,Me,"f"))throw new g("Actions instance not set for this comment.");if(!this.dislike_command)throw new g("Dislike command not found.");if(this.is_disliked)throw new g("This comment is already disliked.",{comment_id:this.comment_id});return this.dislike_command.call(u(this,Me,"f"))}async unlike(){if(!u(this,Me,"f"))throw new g("Actions instance not set for this comment.");if(!this.unlike_command)throw new g("Unlike command not found.");if(!this.is_liked)throw new g("This comment is not liked.",{comment_id:this.comment_id});return this.unlike_command.call(u(this,Me,"f"))}async undislike(){if(!u(this,Me,"f"))throw new g("Actions instance not set for this comment.");if(!this.undislike_command)throw new g("Undislike command not found.");if(!this.is_disliked)throw new g("This comment is not disliked.",{comment_id:this.comment_id});return this.undislike_command.call(u(this,Me,"f"))}async reply(e){var o;if(!u(this,Me,"f"))throw new g("Actions instance not set for this comment.");if(!this.reply_command)throw new g("Reply command not found.");let i=(o=this.reply_command.dialog)==null?void 0:o.as(U_);if(!i)throw new g("Reply dialog not found.");let s=i.reply_button;if(!s)throw new g("Reply button not found in the dialog.");if(!s.endpoint)throw new g("Reply button endpoint not found.");return s.endpoint.call(u(this,Me,"f"),{commentText:e})}async translate(e){var m,x,_,b,T,w;if(!u(this,Me,"f"))throw new g("Actions instance not set for this comment.");if(!this.content)throw new g("Comment content not found.",{comment_id:this.comment_id});let s={text:this.content.toString().replace(/[^\p{L}\p{N}\p{P}\p{Z}]/gu,""),target_language:e},o=ig(22,s),a=await u(this,Me,"f").execute("comment/perform_comment_action",{action:o}),l=(x=(m=a.data.frameworkUpdates)==null?void 0:m.entityBatchUpdate)==null?void 0:x.mutations,f=(w=(T=(b=(_=l==null?void 0:l[0])==null?void 0:_.payload)==null?void 0:b.commentEntityPayload)==null?void 0:T.translatedContent)==null?void 0:w.content;return{...a,content:f}}setActions(e){I(this,Me,e,"f")}};r(Xa,"CommentView");Me=new WeakMap;Xa.type="CommentView";var or=Xa;var H_,Ei,nr,ng,Qa=class extends n{constructor(e){super(),H_.add(this),Ei.set(this,void 0),nr.set(this,void 0),this.comment=c.parseItem(e.commentViewModel,or),this.comment_replies_data=c.parseItem(e.replies,V_),this.is_moderated_elq_comment=e.isModeratedElqComment,this.has_replies=!!this.comment_replies_data}get has_continuation(){if(!this.replies)throw new g("Cannot determine if there is a continuation because this thread's replies have not been loaded.");return!!u(this,nr,"f")}async getReplies(){var s;if(!u(this,Ei,"f"))throw new g("Actions instance not set for this thread.");if(!this.comment_replies_data)throw new g("This comment has no replies.",this);let e=(s=this.comment_replies_data.contents)==null?void 0:s.firstOfType(J);if(!e)throw new g("Replies continuation not found.");let i=await e.endpoint.call(u(this,Ei,"f"),{parse:!0});if(!i.on_response_received_endpoints_memo)throw new g("Unexpected response.",i);return this.replies=u(this,H_,"m",ng).call(this,i.on_response_received_endpoints_memo),I(this,nr,i.on_response_received_endpoints_memo.getType(J).first(),"f"),this}async getContinuation(){var s;if(!this.replies)throw new g("Cannot retrieve continuation because this thread's replies have not been loaded.");if(!u(this,nr,"f"))throw new g("Continuation not found.");if(!u(this,Ei,"f"))throw new g("Actions instance not set for this thread.");let e=(s=u(this,nr,"f").button)==null?void 0:s.as(v);if(!e)throw new g('"Load more" button not found.');let i=await e.endpoint.call(u(this,Ei,"f"),{parse:!0});if(!i.on_response_received_endpoints_memo)throw new g("Unexpected response.",i);return this.replies=u(this,H_,"m",ng).call(this,i.on_response_received_endpoints_memo),I(this,nr,i.on_response_received_endpoints_memo.getType(J).first(),"f"),this}setActions(e){I(this,Ei,e,"f")}};r(Qa,"CommentThread");Ei=new WeakMap,nr=new WeakMap,H_=new WeakSet,ng=r(function(e){return G(e.getType(or).map(i=>(i.setActions(u(this,Ei,"f")),i)))},"_CommentThread_getPatchedReplies");Qa.type="CommentThread";var $_=Qa;var Ja=class extends n{constructor(e){var i,s;super(),this.text=new p(e.chipText),this.color_pallette={background_color:(i=e.chipColorPalette)==null?void 0:i.backgroundColor,foreground_title_color:(s=e.chipColorPalette)==null?void 0:s.foregroundTitleColor},Reflect.has(e,"chipIcon")&&Reflect.has(e.chipIcon,"iconType")&&(this.icon_type=e.chipIcon.iconType)}};r(Ja,"PdgCommentChip");Ja.type="PdgCommentChip";var ZT=Ja;var Za=class extends n{constructor(e){super(),this.custom_badge=y.fromResponse(e.customBadge),this.tooltip=e.tooltip}};r(Za,"SponsorCommentBadge");Za.type="SponsorCommentBadge";var e0=Za;var ep=class extends n{constructor(e){super(),this.title=new p(e.title),this.channel_id=e.channelId,this.thumbnail=y.fromResponse(e.thumbnail),this.display_name=new p(e.displayName),this.video_count=new p(e.videoCountText),this.subscriber_count=new p(e.subscriberCountText),this.endpoint=new d(e.navigationEndpoint),this.tv_banner=y.fromResponse(e.tvBanner),this.menu=c.parseItem(e.menu,R)}};r(ep,"CompactChannel");ep.type="CompactChannel";var t0=ep;var tp=class extends n{constructor(e){super(),this.thumbnail=y.fromResponse(e.thumbnail)}};r(tp,"PlaylistCustomThumbnail");tp.type="PlaylistCustomThumbnail";var qr=tp;var ip=class extends n{constructor(e){super(),this.thumbnail=y.fromResponse(e.thumbnail)}};r(ip,"PlaylistVideoThumbnail");ip.type="PlaylistVideoThumbnail";var zr=ip;var rp=class extends n{constructor(e){var i;super(),this.id=e.playlistId,this.title=new p(e.title),this.author=(i=e.shortBylineText)!=null&&i.simpleText?new p(e.shortBylineText):new P(e.longBylineText,e.ownerBadges,null),this.thumbnails=y.fromResponse(e.thumbnail||{thumbnails:e.thumbnails.map(s=>s.thumbnails).flat(1)}),this.video_count=new p(e.thumbnailText),this.video_count_short=new p(e.videoCountShortText),this.first_videos=c.parseArray(e.videos),this.share_url=e.shareUrl||null,this.menu=c.parseItem(e.menu),this.badges=c.parseArray(e.ownerBadges),this.endpoint=new d(e.navigationEndpoint),this.thumbnail_overlays=c.parseArray(e.thumbnailOverlays),Reflect.has(e,"thumbnailRenderer")&&(this.thumbnail_renderer=c.parseItem(e.thumbnailRenderer,[zr,qr])||void 0),Reflect.has(e,"viewPlaylistText")&&(this.view_playlist=new p(e.viewPlaylistText))}};r(rp,"Playlist");rp.type="Playlist";var Rt=rp;var sp=class extends Rt{constructor(e){super(e)}};r(sp,"CompactMix");sp.type="CompactMix";var i0=sp;var op=class extends n{constructor(e){var o;super();let i=((o=e.thumbnailOverlays.find(a=>a.thumbnailOverlayTimeStatusRenderer))==null?void 0:o.thumbnailOverlayTimeStatusRenderer.text)||"N/A";this.id=e.videoId,this.title=new p(e.title),this.top_metadata_items=new p(e.topMetadataItems),this.thumbnails=y.fromResponse(e.thumbnail),this.thumbnail_overlays=c.parseArray(e.thumbnailOverlays),this.author=new P(e.shortBylineText);let s=e.lengthText?new p(e.lengthText).toString():new p(i).toString();this.duration={text:s,seconds:_e(s)},this.endpoint=new d(e.navigationEndpoint),this.badges=c.parseArray(e.badges),this.use_vertical_poster=e.useVerticalPoster,this.menu=c.parseItem(e.menu,R)}};r(op,"CompactMovie");op.type="CompactMovie";var r0=op;var np=class extends Rt{constructor(e){super(e)}};r(np,"CompactPlaylist");np.type="CompactPlaylist";var s0=np;var ap=class extends n{constructor(e){super(),this.title=new p(e.title),this.description=new p(e.description),this.video_count=new p(e.videoCountText),this.endpoint=new d(e.navigationEndpoint),this.thumbnail=y.fromResponse(e.thumbnail)}};r(ap,"CompactStation");ap.type="CompactStation";var o0=ap;var pp=class extends n{constructor(e){super(),this.title=new p(e.title),this.confirm_button=c.parseItem(e.confirmButton,v),this.cancel_button=c.parseItem(e.cancelButton,v),this.dialog_messages=e.dialogMessages.map(i=>new p(i))}};r(pp,"ConfirmDialog");pp.type="ConfirmDialog";var n0=pp;var cp=class extends n{constructor(e){super(),this.metadata_rows=e.metadataRows.map(i=>{var s;return{metadata_parts:(s=i.metadataParts)==null?void 0:s.map(o=>({text:p.fromAttributed(o.text||{})}))}}),this.delimiter=e.delimiter}};r(cp,"ContentMetadataView");cp.type="ContentMetadataView";var Xr=cp;var lp=class extends n{constructor(e){super(),this.text=new p(e.text)}};r(lp,"Message");lp.type="Message";var ki=lp;var up=class extends n{constructor(e){super(),this.availability_message=c.parseItem(e.availabilityMessage,ki)}};r(up,"ConversationBar");up.type="ConversationBar";var a0=up;var fp=class extends n{constructor(e){super(),this.copy_button=c.parseItem(e.copyButton,v),this.short_url=e.shortUrl,this.style=e.style}};r(fp,"CopyLink");fp.type="CopyLink";var Qr=fp;var mp=class extends n{constructor(e){super(),this.label=new p(e.label),this.placeholder_text=new p(e.placeholderText),this.disabled=!!e.disabled,this.dropdown_type=e.type,this.id=e.id,Reflect.has(e,"options")&&(this.options=e.options.map(i=>{var s;return{title:new p(i.title),subtitle:new p(i.subtitle),leading_image:y.fromResponse(i.leadingImage),value:{privacy_status_value:(s=i.value)==null?void 0:s.privacyStatusValue},on_tap:new d(i.onTap),is_selected:!!i.isSelected}}))}};r(mp,"DropdownView");mp.type="DropdownView";var K_=mp;var hp=class extends n{constructor(e){super(),Reflect.has(e,"displayProperties")&&(this.display_properties={isMultiline:!!e.displayProperties.isMultiline,disableNewLines:!!e.displayProperties.disableNewLines}),Reflect.has(e,"contentProperties")&&(this.content_properties={labelText:e.contentProperties.labelText,placeholderText:e.contentProperties.placeholderText,maxCharacterCount:e.contentProperties.maxCharacterCount}),Reflect.has(e,"initialState")&&(this.initial_state={isFocused:!!e.initialState.isFocused}),Reflect.has(e,"formFieldMetadata")&&(this.form_field_metadata={formId:e.formFieldMetadata.formId,fieldId:e.formFieldMetadata.fieldId})}};r(hp,"TextFieldView");hp.type="TextFieldView";var q_=hp;var dp=class extends n{constructor(e){super(),this.playlist_title=c.parseItem(e.playlistTitle,q_),this.playlist_visibility=c.parseItem(e.playlistVisibility,K_),this.disable_playlist_collaborate=!!e.disablePlaylistCollaborate,this.create_playlist_params_collaboration_enabled=e.createPlaylistParamsCollaborationEnabled,this.create_playlist_params_collaboration_disabled=e.createPlaylistParamsCollaborationDisabled,this.video_ids=e.videoIds}};r(dp,"CreatePlaylistDialogFormView");dp.type="CreatePlaylistDialogFormView";var z_=dp;var _p=class extends n{constructor(e){var i,s;super(),this.avatar=c.parseItem(e.avatar,Gd),this.a11y_label=e.a11yLabel,(s=(i=e.rendererContext)==null?void 0:i.commandContext)!=null&&s.onTap&&(this.on_tap_endpoint=new d(e.rendererContext.commandContext.onTap))}};r(_p,"DecoratedAvatarView");_p.type="DecoratedAvatarView";var Jr=_p;var xp=class extends n{constructor(e){super(),this.time_range_start_millis=e.timeRangeStartMillis,this.marker_duration_millis=e.markerDurationMillis,this.heat_marker_intensity_score_normalized=e.heatMarkerIntensityScoreNormalized}};r(xp,"HeatMarker");xp.type="HeatMarker";var X_=xp;var yp=class extends n{constructor(e){super(),this.max_height_dp=e.maxHeightDp,this.min_height_dp=e.minHeightDp,this.show_hide_animation_duration_millis=e.showHideAnimationDurationMillis,this.heat_markers=c.parseArray(e.heatMarkers,X_),this.heat_markers_decorations=c.parseArray(e.heatMarkersDecorations)}};r(yp,"Heatmap");yp.type="Heatmap";var Q_=yp;var bp=class extends n{constructor(e){super(),this.marker_key=e.key,this.value={},Reflect.has(e,"value")&&(Reflect.has(e.value,"heatmap")&&(this.value.heatmap=c.parseItem(e.value.heatmap,Q_)),Reflect.has(e.value,"chapters")&&(this.value.chapters=c.parseArray(e.value.chapters,N_)))}};r(bp,"Marker");bp.type="Marker";var gp=class extends n{constructor(e){var i;super(),this.markers_map=G(((i=e.markersMap)==null?void 0:i.map(s=>new bp(s)))||[])}};r(gp,"MultiMarkersPlayerBar");gp.type="MultiMarkersPlayerBar";var J_=gp;var wp=class extends n{constructor(e){super(),this.player_bar=c.parseItem(e.playerBar,J_),this.player_bar_action_button=c.parseItem(e.playerBarActionButton,v)}};r(wp,"DecoratedPlayerBar");wp.type="DecoratedPlayerBar";var Z_=wp;var Tp=class extends n{constructor(e){super(),this.title=new p(e.title),this.description=new p(e.description),this.endpoint=new d(e.navigationEndpoint),this.large_form_factor_background_thumbnail=c.parseItem(e.largeFormFactorBackgroundThumbnail),this.small_form_factor_background_thumbnail=c.parseItem(e.smallFormFactorBackgroundThumbnail),this.scrim_color_values=e.scrimColorValues,this.min_panel_display_duration_ms=e.minPanelDisplayDurationMs,this.min_video_play_duration_ms=e.minVideoPlayDurationMs,this.scrim_duration=e.scrimDuration,this.metadata_order=e.metadataOrder,this.panel_layout=e.panelLayout}};r(Tp,"DefaultPromoPanel");Tp.type="DefaultPromoPanel";var p0=Tp;var vp=class extends n{constructor(e){var i,s,o,a,l,f;if(super(),this.description=p.fromAttributed(e.description),this.max_lines=parseInt(e.maxLines),this.truncation_text=p.fromAttributed(e.truncationText),this.always_show_truncation_text=!!e.alwaysShowTruncationText,(o=(s=(i=e.rendererContext.commandContext)==null?void 0:i.onTap)==null?void 0:s.innertubeCommand)!=null&&o.showEngagementPanelEndpoint){let m=(f=(l=(a=e.rendererContext.commandContext)==null?void 0:a.onTap)==null?void 0:l.innertubeCommand)==null?void 0:f.showEngagementPanelEndpoint;this.more_endpoint={show_engagement_panel_endpoint:{engagement_panel:c.parseItem(m.engagementPanel,Ii),engagement_panel_popup_type:m.engagementPanelPresentationConfigs.engagementPanelPopupPresentationConfig.popupType,identifier:{surface:m.identifier.surface,tag:m.identifier.tag}}}}}};r(vp,"DescriptionPreviewView");vp.type="DescriptionPreviewView";var ex=vp;var Ip=class extends n{constructor(e){super(),this.headline=p.fromAttributed(e.headline)}};r(Ip,"DialogHeaderView");Ip.type="DialogHeaderView";var tx=Ip;var Sp=class extends n{constructor(e){super(),this.primary_button=c.parseItem(e.primaryButton,Te),this.secondary_button=c.parseItem(e.secondaryButton,Te),this.should_hide_divider=!!e.shouldHideDivider}};r(Sp,"PanelFooterView");Sp.type="PanelFooterView";var ix=Sp;var Ep=class extends n{constructor(e){super(),this.panel_footer=c.parseItem(e.panelFooter,ix),this.form_id=e.formId,this.container_type=e.containerType}};r(Ep,"FormFooterView");Ep.type="FormFooterView";var rx=Ep;var kp=class extends n{constructor(e){super(),this.header=c.parseItem(e.header,tx),this.footer=c.parseItem(e.footer,rx),this.custom_content=c.parseItem(e.customContent,z_)}};r(kp,"DialogView");kp.type="DialogView";var c0=kp;var Cp=class extends n{constructor(e){super(),this.text=new p(e.didYouMean).toString(),this.corrected_query=new p(e.correctedQuery),this.endpoint=new d(e.navigationEndpoint||e.correctedQueryEndpoint)}};r(Cp,"DidYouMean");Cp.type="DidYouMean";var l0=Cp;var Pp=class extends n{constructor(e){super(),this.text=p.fromAttributed(e.text),this.max_lines=parseInt(e.maxLines)}};r(Pp,"DynamicTextView");Pp.type="DynamicTextView";var sx=Pp;var ar=class extends n{constructor(e){var i;super(),Reflect.has(e,"type")&&Reflect.has(e.type,"textType")&&(this.text=(i=e.type.textType.text)==null?void 0:i.content),this.properties=e.properties,Reflect.has(e,"childElements")&&(this.child_elements=e.childElements.map(s=>new ar(s)))}};r(ar,"ChildElement");ar.type="ChildElement";var ox=ar;var pr=class extends n{constructor(e){var s;if(super(),Reflect.has(e,"elementRenderer"))return c.parseItem(e,pr);let i=e.newElement.type.componentType;this.model=c.parseItem(i==null?void 0:i.model),Reflect.has(e,"newElement")&&Reflect.has(e.newElement,"childElements")&&(this.child_elements=G(((s=e.newElement.childElements)==null?void 0:s.map(o=>new ox(o)))||[]))}};r(pr,"Element");pr.type="Element";var nx=pr;var Np=class extends n{constructor(e){super(),this.title=new p(e.title),this.first_option=c.parseItem(e.firstOption),this.menu=c.parseItem(e.menu,R)}};r(Np,"EmergencyOnebox");Np.type="EmergencyOnebox";var u0=Np;var Ap=class extends n{constructor(e){super(),this.category_id=e.categoryId,this.title=new p(e.title),this.emoji_ids=e.emojiIds,this.image_loading_lazy=!!e.imageLoadingLazy,this.category_type=e.categoryType}};r(Ap,"EmojiPickerCategory");Ap.type="EmojiPickerCategory";var f0=Ap;var Rp=class extends n{constructor(e){var i;super(),this.category_id=e.categoryId,Reflect.has(e,"icon")&&(this.icon_type=(i=e.icon)==null?void 0:i.iconType),this.tooltip=e.tooltip}};r(Rp,"EmojiPickerCategoryButton");Rp.type="EmojiPickerCategoryButton";var m0=Rp;var Mp=class extends n{constructor(e){super(),this.category_id=e.categoryId,this.title=new p(e.title),this.upsell=new p(e.upsell),this.emoji_tooltip=e.emojiTooltip,this.endpoint=new d(e.command),this.emoji_ids=e.emojiIds}};r(Mp,"EmojiPickerUpsellCategory");Mp.type="EmojiPickerUpsellCategory";var h0=Mp;var ag,gt,Lp=class extends n{constructor(e){super(),ag.set(this,"playlist/get_add_to_playlist"),gt.set(this,void 0),I(this,gt,e,"f")}getApiPath(){return u(this,ag,"f")}buildRequest(){let e={};return e.videoIds=u(this,gt,"f").videoIds?u(this,gt,"f").videoIds:[u(this,gt,"f").videoId],u(this,gt,"f").playlistId&&(e.playlistId=u(this,gt,"f").playlistId),u(this,gt,"f").params&&(e.params=u(this,gt,"f").params),e.excludeWatchLater=!!u(this,gt,"f").excludeWatchLater,e}};r(Lp,"AddToPlaylistServiceEndpoint");ag=new WeakMap,gt=new WeakMap;Lp.type="AddToPlaylistServiceEndpoint";var ax=Lp;var Op=class extends ax{constructor(e){super(e)}};r(Op,"AddToPlaylistEndpoint");Op.type="AddToPlaylistEndpoint";var d0=Op;var pg,ye,Dp=class extends n{constructor(e){super(),pg.set(this,"browse"),ye.set(this,void 0),I(this,ye,e,"f")}getApiPath(){return u(this,pg,"f")}buildRequest(){let e={};return u(this,ye,"f").browseId&&(e.browseId=u(this,ye,"f").browseId),u(this,ye,"f").params&&(e.params=u(this,ye,"f").params),u(this,ye,"f").query&&(e.query=u(this,ye,"f").query),u(this,ye,"f").browseId==="FEsubscriptions"&&(e.subscriptionSettingsState=u(this,ye,"f").subscriptionSettingsState||"MY_SUBS_SETTINGS_STATE_LAYOUT_FORMAT_LIST"),u(this,ye,"f").browseId==="SPaccount_playback"&&(e.formData=u(this,ye,"f").formData||{accountSettingsFormData:{flagCaptionsDefaultOff:!1,flagAutoCaptionsDefaultOn:!1,flagDisableInlinePreview:!1,flagAudioDescriptionDefaultOn:!1}}),u(this,ye,"f").browseId==="FEwhat_to_watch"&&(u(this,ye,"f").browseRequestSupportedMetadata&&(e.browseRequestSupportedMetadata=u(this,ye,"f").browseRequestSupportedMetadata),u(this,ye,"f").inlineSettingStatus&&(e.inlineSettingStatus=u(this,ye,"f").inlineSettingStatus)),e}};r(Dp,"BrowseEndpoint");pg=new WeakMap,ye=new WeakMap;Dp.type="BrowseEndpoint";var _0=Dp;var cg,ue,Bp=class extends n{constructor(e){super(),cg.set(this,"comment/create_comment"),ue.set(this,void 0),I(this,ue,e,"f")}getApiPath(){return u(this,cg,"f")}buildRequest(){let e={};if(u(this,ue,"f").createCommentParams&&(e.createCommentParams=u(this,ue,"f").createCommentParams),u(this,ue,"f").commentText&&(e.commentText=u(this,ue,"f").commentText),u(this,ue,"f").attachedVideoId?e.videoAttachment={videoId:u(this,ue,"f").attachedVideoId}:u(this,ue,"f").pollOptions?e.pollAttachment={choices:u(this,ue,"f").pollOptions}:u(this,ue,"f").imageBlobId?e.imageAttachment={encryptedBlobId:u(this,ue,"f").imageBlobId}:u(this,ue,"f").sharedPostId&&(e.sharedPostAttachment={postId:u(this,ue,"f").sharedPostId}),u(this,ue,"f").accessRestrictions&&typeof u(this,ue,"f").accessRestrictions=="number"){let i=u(this,ue,"f").accessRestrictions===1?"RESTRICTION_TYPE_EVERYONE":"RESTRICTION_TYPE_SPONSORS_ONLY";e.accessRestrictions={restriction:i}}return u(this,ue,"f").botguardResponse&&(e.botguardResponse=u(this,ue,"f").botguardResponse),e}};r(Bp,"CreateCommentEndpoint");cg=new WeakMap,ue=new WeakMap;Bp.type="CreateCommentEndpoint";var x0=Bp;var lg,Le,Yp=class extends n{constructor(e){super(),lg.set(this,"playlist/create"),Le.set(this,void 0),I(this,Le,e,"f")}getApiPath(){return u(this,lg,"f")}buildRequest(){let e={};return u(this,Le,"f").title&&(e.title=u(this,Le,"f").title),u(this,Le,"f").privacyStatus&&(e.privacyStatus=u(this,Le,"f").privacyStatus),u(this,Le,"f").description&&(e.description=u(this,Le,"f").description),u(this,Le,"f").videoIds&&(e.videoIds=u(this,Le,"f").videoIds),u(this,Le,"f").params&&(e.params=u(this,Le,"f").params),u(this,Le,"f").sourcePlaylistId&&(e.sourcePlaylistId=u(this,Le,"f").sourcePlaylistId),e}};r(Yp,"CreatePlaylistServiceEndpoint");lg=new WeakMap,Le=new WeakMap;Yp.type="CreatePlaylistServiceEndpoint";var y0=Yp;var ug,Vp,Up=class extends n{constructor(e){super(),ug.set(this,"playlist/delete"),Vp.set(this,void 0),I(this,Vp,e,"f")}getApiPath(){return u(this,ug,"f")}buildRequest(){let e={};return u(this,Vp,"f").playlistId&&(e.playlistId=u(this,Vp,"f").sourcePlaylistId),e}};r(Up,"DeletePlaylistEndpoint");ug=new WeakMap,Vp=new WeakMap;Up.type="DeletePlaylistEndpoint";var b0=Up;var fg,Qt,Fp=class extends n{constructor(e){super(),fg.set(this,"feedback"),Qt.set(this,void 0),I(this,Qt,e,"f")}getApiPath(){return u(this,fg,"f")}buildRequest(){let e={};return u(this,Qt,"f").feedbackToken&&(e.feedbackTokens=[u(this,Qt,"f").feedbackToken]),u(this,Qt,"f").cpn&&(e.feedbackContext={cpn:u(this,Qt,"f").cpn}),e.isFeedbackTokenUnencrypted=!!u(this,Qt,"f").isFeedbackTokenUnencrypted,e.shouldMerge=!!u(this,Qt,"f").shouldMerge,e}};r(Fp,"FeedbackEndpoint");fg=new WeakMap,Qt=new WeakMap;Fp.type="FeedbackEndpoint";var g0=Fp;var mg,ne,Wp=class extends n{constructor(e){super(),mg.set(this,"account/accounts_list"),ne.set(this,void 0),I(this,ne,e,"f")}getApiPath(){return u(this,mg,"f")}buildRequest(){let e={};return u(this,ne,"f").requestType&&(e.requestType=u(this,ne,"f").requestType,(u(this,ne,"f").requestType==="ACCOUNTS_LIST_REQUEST_TYPE_CHANNEL_SWITCHER"||u(this,ne,"f").requestType==="ACCOUNTS_LIST_REQUEST_TYPE_IDENTITY_PROMPT")&&u(this,ne,"f").nextUrl&&(e.nextNavendpoint={urlEndpoint:{url:u(this,ne,"f").nextUrl}})),u(this,ne,"f").channelSwitcherQuery&&(e.channelSwitcherQuery=u(this,ne,"f").channelSwitcherQuery),u(this,ne,"f").triggerChannelCreation&&(e.triggerChannelCreation=u(this,ne,"f").triggerChannelCreation),u(this,ne,"f").contentOwnerConfig&&u(this,ne,"f").contentOwnerConfig.externalContentOwnerId&&(e.contentOwnerConfig=u(this,ne,"f").contentOwnerConfig),u(this,ne,"f").obfuscatedSelectedGaiaId&&(e.obfuscatedSelectedGaiaId=u(this,ne,"f").obfuscatedSelectedGaiaId),u(this,ne,"f").selectedSerializedDelegationContext&&(e.selectedSerializedDelegationContext=u(this,ne,"f").selectedSerializedDelegationContext),u(this,ne,"f").callCircumstance&&(e.callCircumstance=u(this,ne,"f").callCircumstance),e}};r(Wp,"GetAccountsListInnertubeEndpoint");mg=new WeakMap,ne=new WeakMap;Wp.type="GetAccountsListInnertubeEndpoint";var w0=Wp;var Gp=class extends n{constructor(e){super(),this.panel_identifier=e.panelIdentifier}};r(Gp,"HideEngagementPanelEndpoint");Gp.type="HideEngagementPanelEndpoint";var T0=Gp;var hg,dg,_g,wt,jp=class extends n{constructor(e){super(),hg.set(this,"like/like"),dg.set(this,"like/dislike"),_g.set(this,"like/removelike"),wt.set(this,void 0),I(this,wt,e,"f")}getApiPath(){return u(this,wt,"f").status==="DISLIKE"?u(this,dg,"f"):u(this,wt,"f").status==="INDIFFERENT"?u(this,_g,"f"):u(this,hg,"f")}buildRequest(){let e={};u(this,wt,"f").target&&(e.target=u(this,wt,"f").target);let i=this.getParams();return i&&(e.params=i),e}getParams(){switch(u(this,wt,"f").status){case"LIKE":return u(this,wt,"f").likeParams;case"DISLIKE":return u(this,wt,"f").dislikeParams;case"INDIFFERENT":return u(this,wt,"f").removeLikeParams;default:return}}};r(jp,"LikeEndpoint");hg=new WeakMap,dg=new WeakMap,_g=new WeakMap,wt=new WeakMap;jp.type="LikeEndpoint";var v0=jp;var xg,Hp,$p=class extends n{constructor(e){super(),xg.set(this,"live_chat/get_item_context_menu"),Hp.set(this,void 0),I(this,Hp,e,"f")}getApiPath(){return u(this,xg,"f")}buildRequest(){let e={};return u(this,Hp,"f").params&&(e.params=u(this,Hp,"f").params),e}};r($p,"LiveChatItemContextMenuEndpoint");xg=new WeakMap,Hp=new WeakMap;$p.type="LiveChatItemContextMenuEndpoint";var I0=$p;var yg,cr,Kp=class extends n{constructor(e){super(),yg.set(this,"notification/modify_channel_preference"),cr.set(this,void 0),I(this,cr,e,"f")}getApiPath(){return u(this,yg,"f")}buildRequest(){let e={};return u(this,cr,"f").params&&(e.params=u(this,cr,"f").params),u(this,cr,"f").secondaryParams&&(e.secondaryParams=u(this,cr,"f").secondaryParams),e}};r(Kp,"ModifyChannelNotificationPreferenceEndpoint");yg=new WeakMap,cr=new WeakMap;Kp.type="ModifyChannelNotificationPreferenceEndpoint";var S0=Kp;var bg,lr,qp=class extends n{constructor(e){super(),bg.set(this,"comment/perform_comment_action"),lr.set(this,void 0),I(this,lr,e,"f")}getApiPath(){return u(this,bg,"f")}buildRequest(){let e={};return u(this,lr,"f").actions&&(e.actions=u(this,lr,"f").actions),u(this,lr,"f").action&&(e.actions=[u(this,lr,"f").action]),e}};r(qp,"PerformCommentActionEndpoint");bg=new WeakMap,lr=new WeakMap;qp.type="PerformCommentActionEndpoint";var E0=qp;var gg,Jt,zp=class extends n{constructor(e){super(),gg.set(this,"browse/edit_playlist"),Jt.set(this,void 0),I(this,Jt,e,"f")}getApiPath(){return u(this,gg,"f")}buildRequest(){let e={};return u(this,Jt,"f").actions&&(e.actions=u(this,Jt,"f").actions),u(this,Jt,"f").playlistId&&(e.playlistId=u(this,Jt,"f").playlistId),u(this,Jt,"f").params&&(e.params=u(this,Jt,"f").params),e}};r(zp,"PlaylistEditEndpoint");gg=new WeakMap,Jt=new WeakMap;zp.type="PlaylistEditEndpoint";var k0=zp;var wg,ce,Xp=class extends n{constructor(e){super(),wg.set(this,"player"),ce.set(this,void 0),I(this,ce,e,"f")}getApiPath(){return u(this,wg,"f")}buildRequest(){let e={};return u(this,ce,"f").videoId&&(e.videoId=u(this,ce,"f").videoId),u(this,ce,"f").playlistId&&(e.playlistId=u(this,ce,"f").playlistId),(u(this,ce,"f").index!==void 0||u(this,ce,"f").playlistIndex!==void 0)&&(e.playlistIndex=u(this,ce,"f").index||u(this,ce,"f").playlistIndex),(u(this,ce,"f").playerParams||u(this,ce,"f").params)&&(e.params=u(this,ce,"f").playerParams||u(this,ce,"f").params),u(this,ce,"f").startTimeSeconds&&(e.startTimeSecs=u(this,ce,"f").startTimeSeconds),u(this,ce,"f").overrideMutedAtStart&&(e.overrideMutedAtStart=u(this,ce,"f").overrideMutedAtStart),e.racyCheckOk=!!u(this,ce,"f").racyCheckOk,e.contentCheckOk=!!u(this,ce,"f").contentCheckOk,e}};r(Xp,"WatchEndpoint");wg=new WeakMap,ce=new WeakMap;Xp.type="WatchEndpoint";var px=Xp;var Qp=class extends px{constructor(e){super(e)}};r(Qp,"PrefetchWatchCommand");Qp.type="PrefetchWatchCommand";var C0=Qp;var Tg,ke,Jp=class extends n{constructor(e){super(),Tg.set(this,"reel/reel_item_watch"),ke.set(this,void 0),I(this,ke,e,"f")}getApiPath(){return u(this,Tg,"f")}buildRequest(){let e={};return u(this,ke,"f").videoId&&(e.playerRequest={videoId:u(this,ke,"f").videoId}),e.playerRequest&&(u(this,ke,"f").playerParams&&(e.playerRequest.params=u(this,ke,"f").playerParams),u(this,ke,"f").racyCheckOk&&(e.playerRequest.racyCheckOk=!!u(this,ke,"f").racyCheckOk),u(this,ke,"f").contentCheckOk&&(e.playerRequest.contentCheckOk=!!u(this,ke,"f").contentCheckOk)),u(this,ke,"f").params&&(e.params=u(this,ke,"f").params),u(this,ke,"f").inputType&&(e.inputType=u(this,ke,"f").inputType),e.disablePlayerResponse=!!u(this,ke,"f").disablePlayerResponse,e}};r(Jp,"ReelWatchEndpoint");Tg=new WeakMap,ke=new WeakMap;Jp.type="ReelWatchEndpoint";var P0=Jp;var vg,Tt,Zp=class extends n{constructor(e){super(),vg.set(this,"search"),Tt.set(this,void 0),I(this,Tt,e,"f")}getApiPath(){return u(this,vg,"f")}buildRequest(){let e={};return u(this,Tt,"f").query&&(e.query=u(this,Tt,"f").query),u(this,Tt,"f").params&&(e.params=u(this,Tt,"f").params),u(this,Tt,"f").webSearchboxStatsUrl&&(e.webSearchboxStatsUrl=u(this,Tt,"f").webSearchboxStatsUrl),u(this,Tt,"f").suggestStats&&(e.suggestStats=u(this,Tt,"f").suggestStats),e}};r(Zp,"SearchEndpoint");vg=new WeakMap,Tt=new WeakMap;Zp.type="SearchEndpoint";var N0=Zp;var Ig,ur,ec=class extends n{constructor(e){super(),Ig.set(this,"share/get_share_panel"),ur.set(this,void 0),I(this,ur,e,"f")}getApiPath(){return u(this,Ig,"f")}buildRequest(){let e={};return u(this,ur,"f").serializedShareEntity&&(e.serializedSharedEntity=u(this,ur,"f").serializedShareEntity),u(this,ur,"f").clientParams&&(e.clientParams=u(this,ur,"f").clientParams),e}};r(ec,"ShareEntityServiceEndpoint");Ig=new WeakMap,ur=new WeakMap;ec.type="ShareEntityServiceEndpoint";var Zr=ec;var tc=class extends Zr{constructor(e){super(e)}};r(tc,"ShareEndpoint");tc.type="ShareEndpoint";var A0=tc;var ic=class extends Zr{constructor(e){super(e)}};r(ic,"ShareEntityEndpoint");ic.type="ShareEntityEndpoint";var R0=ic;var rc=class extends n{constructor(e){super(),this.panel_identifier=e.panelIdentifier,this.source_panel_identifier=e.sourcePanelIdentifier}};r(rc,"ShowEngagementPanelEndpoint");rc.type="ShowEngagementPanelEndpoint";var M0=rc;var sc=class extends n{constructor(e){super(),Array.isArray(e.actions)&&(this.actions=c.parseArray(e.actions.map(i=>(delete i.clickTrackingParams,i)))),this.signal=e.signal}};r(sc,"SignalServiceEndpoint");sc.type="SignalServiceEndpoint";var L0=sc;var Sg,Je,oc=class extends n{constructor(e){super(),Sg.set(this,"subscription/subscribe"),Je.set(this,void 0),I(this,Je,e,"f")}getApiPath(){return u(this,Sg,"f")}buildRequest(){let e={};return u(this,Je,"f").channelIds&&(e.channelIds=u(this,Je,"f").channelIds),u(this,Je,"f").siloName&&(e.siloName=u(this,Je,"f").siloName),u(this,Je,"f").params&&(e.params=u(this,Je,"f").params),u(this,Je,"f").botguardResponse&&(e.botguardResponse=u(this,Je,"f").botguardResponse),u(this,Je,"f").feature&&(e.clientFeature=u(this,Je,"f").feature),e}};r(oc,"SubscribeEndpoint");Sg=new WeakMap,Je=new WeakMap;oc.type="SubscribeEndpoint";var O0=oc;var Eg,Zt,nc=class extends n{constructor(e){super(),Eg.set(this,"subscription/unsubscribe"),Zt.set(this,void 0),I(this,Zt,e,"f")}getApiPath(){return u(this,Eg,"f")}buildRequest(){let e={};return u(this,Zt,"f").channelIds&&(e.channelIds=u(this,Zt,"f").channelIds),u(this,Zt,"f").siloName&&(e.siloName=u(this,Zt,"f").siloName),u(this,Zt,"f").params&&(e.params=u(this,Zt,"f").params),e}};r(nc,"UnsubscribeEndpoint");Eg=new WeakMap,Zt=new WeakMap;nc.type="UnsubscribeEndpoint";var D0=nc;var kg,ve,ac=class extends n{constructor(e){super(),kg.set(this,"next"),ve.set(this,void 0),I(this,ve,e,"f")}getApiPath(){return u(this,kg,"f")}buildRequest(){let e={};return u(this,ve,"f").videoId&&(e.videoId=u(this,ve,"f").videoId),u(this,ve,"f").playlistId&&(e.playlistId=u(this,ve,"f").playlistId),(u(this,ve,"f").index!==void 0||u(this,ve,"f").playlistIndex!==void 0)&&(e.playlistIndex=u(this,ve,"f").index||u(this,ve,"f").playlistIndex),(u(this,ve,"f").playerParams||u(this,ve,"f").params)&&(e.params=u(this,ve,"f").playerParams||u(this,ve,"f").params),e.racyCheckOk=!!u(this,ve,"f").racyCheckOk,e.contentCheckOk=!!u(this,ve,"f").contentCheckOk,e}};r(ac,"WatchNextEndpoint");kg=new WeakMap,ve=new WeakMap;ac.type="WatchNextEndpoint";var B0=ac;var pc=class extends n{constructor(e){super(),this.elements=c.parseArray(e.elements),this.start_ms=e.startMs}};r(pc,"Endscreen");pc.type="Endscreen";var cx=pc;var cc=class extends n{constructor(e){super(),this.style=e.style,this.title=new p(e.title),this.endpoint=new d(e.endpoint),Reflect.has(e,"image")&&(this.image=y.fromResponse(e.image)),Reflect.has(e,"icon")&&(this.icon=y.fromResponse(e.icon)),Reflect.has(e,"metadata")&&(this.metadata=new p(e.metadata)),Reflect.has(e,"callToAction")&&(this.call_to_action=new p(e.callToAction)),Reflect.has(e,"hovercardButton")&&(this.hovercard_button=c.parseItem(e.hovercardButton)),Reflect.has(e,"isSubscribe")&&(this.is_subscribe=!!e.isSubscribe),Reflect.has(e,"playlistLength")&&(this.playlist_length=new p(e.playlistLength)),Reflect.has(e,"thumbnailOverlays")&&(this.thumbnail_overlays=c.parseArray(e.thumbnailOverlays)),this.left=parseFloat(e.left),this.width=parseFloat(e.width),this.top=parseFloat(e.top),this.aspect_ratio=parseFloat(e.aspectRatio),this.start_ms=parseFloat(e.startMs),this.end_ms=parseFloat(e.endMs),this.id=e.id}};r(cc,"EndscreenElement");cc.type="EndscreenElement";var Y0=cc;var lc=class extends n{constructor(e){super(),this.id=e.playlistId,this.title=new p(e.title),this.author=new p(e.longBylineText),this.endpoint=new d(e.navigationEndpoint),this.thumbnails=y.fromResponse(e.thumbnail),this.video_count=new p(e.videoCountText)}};r(lc,"EndScreenPlaylist");lc.type="EndScreenPlaylist";var lx=lc;var uc=class extends n{constructor(e){super(),this.id=e.videoId,this.title=new p(e.title),this.thumbnails=y.fromResponse(e.thumbnail),this.thumbnail_overlays=c.parseArray(e.thumbnailOverlays),this.author=new P(e.shortBylineText,e.ownerBadges),this.endpoint=new d(e.navigationEndpoint),this.short_view_count=new p(e.shortViewCountText),this.badges=c.parseArray(e.badges),this.duration={text:new p(e.lengthText).toString(),seconds:e.lengthInSeconds}}};r(uc,"EndScreenVideo");uc.type="EndScreenVideo";var ux=uc;var fc=class extends n{constructor(e){super(),this.disclaimer=new p(e.disclaimer),this.info_icon={icon_type:e.infoIcon.iconType},this.usage_scenario=e.usageScenario}};r(fc,"EomSettingsDisclaimer");fc.type="EomSettingsDisclaimer";var V0=fc;var mc=class extends n{constructor(e){super(),this.title=e.title,this.endpoint=new d(e.endpoint),this.selected=e.selected,this.content=c.parseItem(e.content)}};r(mc,"ExpandableTab");mc.type="ExpandableTab";var es=mc;var hc=class extends n{constructor(e){super(),this.items=c.parseArray(e.items)}get contents(){return this.items}};r(hc,"ExpandedShelfContents");hc.type="ExpandedShelfContents";var U0=hc;var dc=class extends n{constructor(e){super(),this.dialog_message=new p(e.dialogMessage),this.confirm_label=new p(e.confirmLabel)}};r(dc,"FancyDismissibleDialog");dc.type="FancyDismissibleDialog";var F0=dc;var _c=class extends n{constructor(e){super(),this.contents=c.parseArray(e.contents,je)}};r(_c,"FeedFilterChipBar");_c.type="FeedFilterChipBar";var vt=_c;var xc=class extends n{constructor(e){super(),this.title=new p(e.title),this.subtitle=new p(e.subtitle),this.endpoint=new d(e.impressionEndpoint),this.apply_modernized_style=e.applyModernizedStyle,this.trim_style=e.trimStyle,this.background_style=e.backgroundStyle}};r(xc,"FeedNudge");xc.type="FeedNudge";var W0=xc;var yc=class extends n{constructor(e){super(),this.title=new p(e.title)}};r(yc,"FeedTabbedHeader");yc.type="FeedTabbedHeader";var fx=yc;var bc=class extends n{constructor(e){super(),this.actions_rows=e.actionsRows.map(i=>({actions:c.parseArray(i.actions,[Te,yt])})),this.style=e.style}};r(bc,"FlexibleActionsView");bc.type="FlexibleActionsView";var mx=bc;var gc=class extends n{constructor(e){super(),this.title=new p(e.title),this.box_art=y.fromResponse(e.boxArt),this.box_art_overlay_text=new p(e.boxArtOverlayText),this.endpoint=new d(e.endpoint),this.is_official_box_art=!!e.isOfficialBoxArt}};r(gc,"GameDetails");gc.type="GameDetails";var G0=gc;var wc=class extends n{constructor(e){var i,s,o;super(),this.items=c.parseArray(e.items),Reflect.has(e,"header")&&(this.header=c.parseItem(e.header)),Reflect.has(e,"isCollapsible")&&(this.is_collapsible=e.isCollapsible),Reflect.has(e,"visibleRowCount")&&(this.visible_row_count=e.visibleRowCount),Reflect.has(e,"targetId")&&(this.target_id=e.targetId),this.continuation=((o=(s=(i=e.continuations)==null?void 0:i[0])==null?void 0:s.nextContinuationData)==null?void 0:o.continuation)||null}get contents(){return this.items}};r(wc,"Grid");wc.type="Grid";var j0=wc;var Tc=class extends n{constructor(e){super(),this.id=e.channelId,this.author=new P({...e.title,navigationEndpoint:e.navigationEndpoint},e.ownerBadges,e.thumbnail),this.subscribers=new p(e.subscriberCountText),this.video_count=new p(e.videoCountText),this.endpoint=new d(e.navigationEndpoint),this.subscribe_button=c.parseItem(e.subscribeButton)}};r(Tc,"GridChannel");Tc.type="GridChannel";var hx=Tc;var vc=class extends n{constructor(e){super(),this.title=new p(e.title)}};r(vc,"GridHeader");vc.type="GridHeader";var H0=vc;var Ic=class extends n{constructor(e){var i,s;super(),this.id=e.playlistId,this.title=new p(e.title),this.author=(i=e.shortBylineText)!=null&&i.simpleText?new p(e.shortBylineText):(s=e.longBylineText)!=null&&s.simpleText?new p(e.longBylineText):null,this.thumbnails=y.fromResponse(e.thumbnail),this.video_count=new p(e.videoCountText),this.video_count_short=new p(e.videoCountShortText),this.endpoint=new d(e.navigationEndpoint),this.secondary_endpoint=new d(e.secondaryNavigationEndpoint),this.thumbnail_overlays=c.parseArray(e.thumbnailOverlays)}};r(Ic,"GridMix");Ic.type="GridMix";var $0=Ic;var Sc=class extends n{constructor(e){var s;super();let i=(s=e.thumbnailOverlays.find(o=>o.hasOwnProperty("thumbnailOverlayTimeStatusRenderer")))==null?void 0:s.thumbnailOverlayTimeStatusRenderer;this.id=e.videoId,this.title=new p(e.title),this.thumbnails=y.fromResponse(e.thumbnail),this.duration=e.lengthText?new p(e.lengthText):i!=null&&i.text?new p(i.text):null,this.endpoint=new d(e.navigationEndpoint),this.badges=c.parseArray(e.badges,Ge),this.metadata=new p(e.metadata),this.thumbnail_overlays=c.parseArray(e.thumbnailOverlays)}};r(Sc,"GridMovie");Sc.type="GridMovie";var K0=Sc;var Ec=class extends n{constructor(e){var i;super(),this.id=e.playlistId,this.title=new p(e.title),Reflect.has(e,"shortBylineText")&&(this.author=new P(e.shortBylineText,e.ownerBadges)),this.badges=c.parseArray(e.ownerBadges),this.endpoint=new d(e.navigationEndpoint),this.view_playlist=new p(e.viewPlaylistText),this.thumbnails=y.fromResponse(e.thumbnail),this.thumbnail_renderer=c.parseItem(e.thumbnailRenderer),this.sidebar_thumbnails=[].concat(...((i=e.sidebarThumbnails)==null?void 0:i.map(s=>y.fromResponse(s)))||[])||null,this.video_count=new p(e.thumbnailText),this.video_count_short=new p(e.videoCountShortText)}};r(Ec,"GridPlaylist");Ec.type="GridPlaylist";var dx=Ec;var kc=class extends n{constructor(e){super(),this.thumbnail=y.fromResponse(e.thumbnail)}};r(kc,"ShowCustomThumbnail");kc.type="ShowCustomThumbnail";var _x=kc;var Cc=class extends n{constructor(e){super(),Reflect.has(e,"text")&&(this.text=new p(e.text)),Reflect.has(e,"icon")&&Reflect.has(e.icon,"iconType")&&(this.icon_type=e.icon.iconType)}};r(Cc,"ThumbnailOverlayBottomPanel");Cc.type="ThumbnailOverlayBottomPanel";var xx=Cc;var Pc=class extends n{constructor(e){super(),this.title=new p(e.title),this.thumbnail_renderer=q(e.thumbnailRenderer,_x),this.endpoint=new d(e.navigationEndpoint),this.long_byline_text=new p(e.longBylineText),this.thumbnail_overlays=Ce(e.thumbnailOverlays,xx),this.author=new P(e.shortBylineText,void 0)}};r(Pc,"GridShow");Pc.type="GridShow";var q0=Pc;var Nc=class extends n{constructor(e){var s,o;super();let i=(s=e.thumbnailOverlays.find(a=>a.hasOwnProperty("thumbnailOverlayTimeStatusRenderer")))==null?void 0:s.thumbnailOverlayTimeStatusRenderer;this.id=e.videoId,this.title=new p(e.title),this.thumbnails=y.fromResponse(e.thumbnail),this.thumbnail_overlays=c.parseArray(e.thumbnailOverlays),this.rich_thumbnail=c.parseItem(e.richThumbnail),this.published=new p(e.publishedTimeText),this.duration=e.lengthText?new p(e.lengthText):i!=null&&i.text?new p(i.text):null,this.author=e.shortBylineText&&new P(e.shortBylineText,e.ownerBadges),this.views=new p(e.viewCountText),this.short_view_count=new p(e.shortViewCountText),this.endpoint=new d(e.navigationEndpoint),this.menu=c.parseItem(e.menu,R),Reflect.has(e,"buttons")&&(this.buttons=c.parseArray(e.buttons)),Reflect.has(e,"upcomingEventData")&&(this.upcoming=new Date(Number(`${e.upcomingEventData.startTime}000`)),this.upcoming_text=new p(e.upcomingEventData.upcomingEventText),this.is_reminder_set=!!((o=e.upcomingEventData)!=null&&o.isReminderSet))}get is_upcoming(){return Boolean(this.upcoming&&this.upcoming>new Date)}};r(Nc,"GridVideo");Nc.type="GridVideo";var yx=Nc;var Ac=class extends n{constructor(e){super(),this.title=new p(e.formattedTitle),this.endpoint=new d(e.navigationEndpoint||e.serviceEndpoint),Reflect.has(e,"icon")&&Reflect.has(e.icon,"iconType")&&(this.icon_type=e.icon.iconType),Reflect.has(e,"thumbnail")&&(this.thumbnails=y.fromResponse(e.thumbnail)),Reflect.has(e,"badges")&&(this.badges=e.badges),this.is_primary=!!e.isPrimary}};r(Ac,"GuideEntry");Ac.type="GuideEntry";var fr=Ac;var Rc=class extends n{constructor(e){super(),this.expander_item=q(e.expanderItem,fr),this.collapser_item=q(e.collapserItem,fr),this.expandable_items=Ce(e.expandableItems)}};r(Rc,"GuideCollapsibleEntry");Rc.type="GuideCollapsibleEntry";var z0=Rc;var Mc=class extends n{constructor(e){super(),this.header_entry=q(e.headerEntry),this.expander_icon=e.expanderIcon.iconType,this.collapser_icon=e.collapserIcon.iconType,this.section_items=Ce(e.sectionItems)}};r(Mc,"GuideCollapsibleSectionEntry");Mc.type="GuideCollapsibleSectionEntry";var X0=Mc;var Lc=class extends fr{constructor(e){super(e.entryRenderer.guideEntryRenderer),this.always_show=!!e.alwaysShow}};r(Lc,"GuideDownloadsEntry");Lc.type="GuideDownloadsEntry";var Q0=Lc;var Oc=class extends n{constructor(e){super(),Reflect.has(e,"formattedTitle")&&(this.title=new p(e.formattedTitle)),this.items=Ce(e.items)}};r(Oc,"GuideSection");Oc.type="GuideSection";var ts=Oc;var Dc=class extends ts{};r(Dc,"GuideSubscriptionsSection");Dc.type="GuideSubscriptionsSection";var bx=Dc;var Bc=class extends n{constructor(e){super(),this.hashtag=new p(e.hashtag),this.hashtag_info=new p(e.hashtagInfoText)}};r(Bc,"HashtagHeader");Bc.type="HashtagHeader";var gx=Bc;var Yc=class extends n{constructor(e){super(),this.hashtag=new p(e.hashtag),this.hashtag_info_text=new p(e.hashtagInfoText),this.hashtag_thumbnail=y.fromResponse(e.hashtagThumbnail),this.endpoint=new d(e.onTapCommand),this.hashtag_background_color=e.hashtagBackgroundColor,this.hashtag_video_count=new p(e.hashtagVideoCount),this.hashtag_channel_count=new p(e.hashtagChannelCount)}};r(Yc,"HashtagTile");Yc.type="HashtagTile";var J0=Yc;var Vc=class extends n{constructor(e){super(),this.thumbnails=y.fromResponse(e.thumbnail),this.on_tap_endpoint=new d(e.onTap)}};r(Vc,"HeroPlaylistThumbnail");Vc.type="HeroPlaylistThumbnail";var Z0=Vc;var Uc=class extends n{constructor(e){super(),e.thumbnail&&(this.thumbnail={image:y.fromResponse(e.thumbnail.image),endpoint:new d(e.thumbnail.onTap),on_long_press_endpoint:new d(e.thumbnail.onLongPress),content_mode:e.thumbnail.contentMode,crop_options:e.thumbnail.cropOptions}),this.background_image={image:y.fromResponse(e.backgroundImage.image),gradient_image:y.fromResponse(e.backgroundImage.gradientImage)},this.strapline=e.strapline,this.title=e.title,this.description=e.description,this.cta={icon_name:e.cta.iconName,title:e.cta.title,endpoint:new d(e.cta.onTap),accessibility_text:e.cta.accessibilityText,state:e.cta.state},this.text_on_tap_endpoint=new d(e.textOnTap)}};r(Uc,"Panel");Uc.type="Panel";var Fc=class extends n{constructor(e){super(),this.panels=G(e.highlightsCarousel.panels.map(i=>new Uc(i)))}};r(Fc,"HighlightsCarousel");Fc.type="HighlightsCarousel";var ev=Fc;var Wc=class extends n{constructor(e){super(),this.suggestion=new p(e.suggestion),this.endpoint=new d(e.navigationEndpoint),Reflect.has(e,"icon")&&(this.icon_type=e.icon.iconType),Reflect.has(e,"serviceEndpoint")&&(this.service_endpoint=new d(e.serviceEndpoint))}};r(Wc,"SearchSuggestion");Wc.type="SearchSuggestion";var wx=Wc;var Gc=class extends wx{constructor(e){super(e)}};r(Gc,"HistorySuggestion");Gc.type="HistorySuggestion";var tv=Gc;var jc=class extends n{constructor(e){super(),this.items=c.parseArray(e.items),this.previous_button=c.parseItem(e.previousButton,v),this.next_button=c.parseItem(e.nextButton,v)}get contents(){return this.items}};r(jc,"HorizontalMovieList");jc.type="HorizontalMovieList";var iv=jc;var Hc=class extends n{constructor(e){var i;super(),this.icon_type=(i=e.icon)==null?void 0:i.iconType,Reflect.has(e,"tooltip")&&(this.tooltip=new p(e.tooltip).toString()),this.endpoint=new d(e.navigationEndpoint)}};r(Hc,"IconLink");Hc.type="IconLink";var Tx=Hc;var $c=class extends n{constructor(e){super(),this.image=y.fromResponse(e.image),this.style=e.style}};r($c,"ImageBannerView");$c.type="ImageBannerView";var vx=$c;var Kc=class extends n{constructor(e){super(),this.including_results_for=new p(e.includingResultsFor),this.corrected_query=new p(e.correctedQuery),this.corrected_query_endpoint=new d(e.correctedQueryEndpoint),this.search_only_for=Reflect.has(e,"searchOnlyFor")?new p(e.searchOnlyFor):void 0,this.original_query=Reflect.has(e,"originalQuery")?new p(e.originalQuery):void 0,this.original_query_endpoint=Reflect.has(e,"originalQueryEndpoint")?new d(e.originalQueryEndpoint):void 0}};r(Kc,"IncludingResultsFor");Kc.type="IncludingResultsFor";var rv=Kc;var qc=class extends n{constructor(e){super(),this.title=new p(e.title),this.source=new p(e.source),Reflect.has(e,"paragraphs")&&(this.paragraphs=e.paragraphs.map(i=>new p(i))),Reflect.has(e,"attributedParagraphs")&&(this.attributed_paragraphs=e.attributedParagraphs.map(i=>p.fromAttributed(i))),this.thumbnail=y.fromResponse(e.thumbnail),this.source_endpoint=new d(e.sourceEndpoint),this.truncate_paragraphs=!!e.truncateParagraphs,this.background=e.background,Reflect.has(e,"inlineLinkIcon")&&Reflect.has(e.inlineLinkIcon,"iconType")&&(this.inline_link_icon_type=e.inlineLinkIcon.iconType)}};r(qc,"InfoPanelContent");qc.type="InfoPanelContent";var Ix=qc;var zc=class extends n{constructor(e){var i;super(),this.title=new p(e.title),this.menu=c.parseItem(e.menu,R),this.content=c.parseItem(e.content,Ix),e.headerEndpoint&&(this.header_endpoint=new d(e.headerEndpoint)),this.background=e.background,this.title_style=e.titleStyle,Reflect.has(e,"icon")&&(this.icon_type=(i=e.icon)==null?void 0:i.iconType)}};r(zc,"InfoPanelContainer");zc.type="InfoPanelContainer";var Sx=zc;var Xc=class extends n{constructor(e){super(),this.header_type=e.type,this.title=new p(e.title),this.description=new p(e.description),this.metadata=new p(e.metadata),this.badges=c.parseArray(e.badges,Ge),this.box_art=y.fromResponse(e.boxArt),this.banner=y.fromResponse(e.banner),this.buttons=c.parseArray(e.buttons,[xe,v]),this.auto_generated=new p(e.autoGenerated)}};r(Xc,"InteractiveTabbedHeader");Xc.type="InteractiveTabbedHeader";var Ex=Xc;var Qc=class extends n{constructor(e){super(),this.title=new p(e.title)}};r(Qc,"ItemSectionHeader");Qc.type="ItemSectionHeader";var is=Qc;var Jc=class extends n{constructor(e){super(),this.title=new p(e.title),this.selected=!!e.selected,this.endpoint=new d(e.endpoint)}};r(Jc,"ItemSectionTab");Jc.type="Tab";var kx=Jc;var Zc=class extends n{constructor(e){super(),this.title=new p(e.title),this.tabs=c.parseArray(e.tabs,kx),Reflect.has(e,"endItems")&&(this.end_items=c.parseArray(e.endItems))}};r(Zc,"ItemSectionTabbedHeader");Zc.type="ItemSectionTabbedHeader";var rs=Zc;var el=class extends n{constructor(e){super(),this.filter_menu=c.parseItem(e.filterMenu,mr.SortFilterSubMenu)}};r(el,"SortFilterHeader");el.type="SortFilterHeader";var Cx=el;var tl=class extends n{constructor(e){var i,s,o;super(),this.header=c.parseItem(e.header,[Si,is,rs,Cx,vt]),this.contents=c.parseArray(e.contents),(e.targetId||e.sectionIdentifier)&&(this.target_id=e.targetId||e.sectionIdentifier),e.continuations&&(this.continuation=(o=(s=(i=e.continuations)==null?void 0:i.at(0))==null?void 0:s.nextContinuationData)==null?void 0:o.continuation)}};r(tl,"ItemSection");tl.type="ItemSection";var It=tl;var il=class extends n{constructor(e){var i,s;super(),this.header=c.parseItem(e.header),this.initial_display_state=e.initialDisplayState,this.continuation=(s=(i=e.continuations[0])==null?void 0:i.reloadContinuationData)==null?void 0:s.continuation,this.client_messages={reconnect_message:new p(e.clientMessages.reconnectMessage),unable_to_reconnect_message:new p(e.clientMessages.unableToReconnectMessage),fatal_error:new p(e.clientMessages.fatalError),reconnected_message:new p(e.clientMessages.reconnectedMessage),generic_error:new p(e.clientMessages.genericError)},this.is_replay=!!e.isReplay}};r(il,"LiveChat");il.type="LiveChat";var Px=il;var rl=class extends n{constructor(e){super(),this.text=new p(e.text),Reflect.has(e,"icon")&&Reflect.has(e.icon,"iconType")&&(this.icon_type=e.icon.iconType),this.context_menu_button=c.parseItem(e.contextMenuButton,v)}};r(rl,"LiveChatBannerHeader");rl.type="LiveChatBannerHeader";var Nx=rl;var sl=class extends n{constructor(e){super(),this.header=c.parseItem(e.header,Nx),this.contents=c.parseItem(e.contents),this.action_id=e.actionId,this.viewer_is_creator=e.viewerIsCreator,this.target_id=e.targetId,this.is_stackable=e.isStackable,this.background_type=e.backgroundType}};r(sl,"LiveChatBanner");sl.type="LiveChatBanner";var Ax=sl;var ol=class extends n{constructor(e){super(),this.banner=c.parseItem(e.bannerRenderer,Ax)}};r(ol,"AddBannerToLiveChatCommand");ol.type="AddBannerToLiveChatCommand";var sv=ol;var nl=class extends n{constructor(e){super(),this.item=c.parseItem(e.item),Reflect.has(e,"clientId")&&(this.client_id=e.clientId)}};r(nl,"AddChatItemAction");nl.type="AddChatItemAction";var Rx=nl;var al=class extends n{constructor(e){super(),this.item=c.parseItem(e.item),this.duration_sec=e.durationSec}};r(al,"AddLiveChatTickerItemAction");al.type="AddLiveChatTickerItemAction";var ov=al;var pl=class extends n{constructor(e){super(),this.client_assigned_id=e.clientAssignedId}};r(pl,"DimChatItemAction");pl.type="DimChatItemAction";var nv=pl;var cl=class extends n{constructor(e){super(),this.menu_endpoint=new d(e.contextMenuEndpoint),this.moderation_buttons=c.parseArray(e.moderationButtons,v),this.auto_moderated_item=c.parseItem(e.autoModeratedItem),this.header_text=new p(e.headerText),this.timestamp=Math.floor(parseInt(e.timestampUsec)/1e3),this.id=e.id}};r(cl,"LiveChatAutoModMessage");cl.type="LiveChatAutoModMessage";var av=cl;var ll=class extends n{constructor(e){super(),this.id=e.liveChatSummaryId,this.chat_summary=new p(e.chatSummary),this.icon_type=e.icon.iconType,this.like_feedback_button=c.parseItem(e.likeFeedbackButton,yt),this.dislike_feedback_button=c.parseItem(e.dislikeFeedbackButton,yt)}};r(ll,"LiveChatBannerChatSummary");ll.type="LiveChatBannerChatSummary";var pv=ll;var ul=class extends n{constructor(e){super(),this.poll_question=new p(e.pollQuestion),this.author_photo=y.fromResponse(e.authorPhoto),this.choices=e.pollChoices.map(i=>({option_id:i.pollOptionId,text:new p(i.text).toString()})),this.collapsed_state_entity_key=e.collapsedStateEntityKey,this.live_chat_poll_state_entity_key=e.liveChatPollStateEntityKey,this.context_menu_button=c.parseItem(e.contextMenuButton,v)}};r(ul,"LiveChatBannerPoll");ul.type="LiveChatBannerPoll";var cv=ul;var fl=class extends n{constructor(e){super(),this.banner_message=new p(e.bannerMessage),this.author_photo=y.fromResponse(e.authorPhoto),this.inline_action_button=c.parseItem(e.inlineActionButton,v),this.context_menu_button=c.parseItem(e.contextMenuButton,v)}};r(fl,"LiveChatBannerRedirect");fl.type="LiveChatBannerRedirect";var lv=fl;var ml=class extends n{constructor(e){super(),this.id=e.id,this.timestamp=Math.floor(parseInt(e.timestampUsec)/1e3),this.header_subtext=new p(e.headerSubtext),this.author=new P(e.authorName,e.authorBadges,e.authorPhoto,e.authorExternalChannelId),this.menu_endpoint=new d(e.contextMenuEndpoint)}};r(ml,"LiveChatMembershipItem");ml.type="LiveChatMembershipItem";var uv=ml;var hl=class extends n{constructor(e){super(),this.id=e.id,this.icon_type=e.icon.iconType,this.text=new p(e.text),this.subtext=new p(e.subtext),this.timestamp=Math.floor(parseInt(e.timestampUsec)/1e3),this.timestamp_usec=e.timestampUsec,this.timestamp_text=new p(e.timestampText)}};r(hl,"LiveChatModeChangeMessage");hl.type="LiveChatModeChangeMessage";var fv=hl;var dl=class extends n{constructor(e){super(),this.message=new p(e.message),this.author=new P(e.authorName,e.authorBadges,e.authorPhoto,e.authorExternalChannelId),this.header_background_color=e.headerBackgroundColor,this.header_text_color=e.headerTextColor,this.body_background_color=e.bodyBackgroundColor,this.body_text_color=e.bodyTextColor,this.purchase_amount=new p(e.purchaseAmountText).toString(),this.menu_endpoint=new d(e.contextMenuEndpoint),this.timestamp=Math.floor(parseInt(e.timestampUsec)/1e3),this.timestamp_text=new p(e.timestampText).toString(),this.id=e.id}};r(dl,"LiveChatPaidMessage");dl.type="LiveChatPaidMessage";var mv=dl;var _l=class extends n{constructor(e){super(),this.id=e.id,this.author=new P(e.authorName,e.authorBadges,e.authorPhoto,e.authorExternalChannelId),this.money_chip_background_color=e.moneyChipBackgroundColor,this.money_chip_text_color=e.moneyChipTextColor,this.background_color=e.backgroundColor,this.author_name_text_color=e.authorNameTextColor,this.sticker=y.fromResponse(e.sticker),this.purchase_amount=new p(e.purchaseAmountText).toString(),this.menu_endpoint=new d(e.contextMenuEndpoint),this.context_menu=this.menu_endpoint,this.timestamp=Math.floor(parseInt(e.timestampUsec)/1e3)}};r(_l,"LiveChatPaidSticker");_l.type="LiveChatPaidSticker";var hv=_l;var xl=class extends n{constructor(e){super(),this.id=e.id,this.timestamp=Math.floor(parseInt(e.timestampUsec)/1e3)}};r(xl,"LiveChatPlaceholderItem");xl.type="LiveChatPlaceholderItem";var dv=xl;var yl=class extends n{constructor(e){super(),this.title=e.title,this.accessibility_title=e.accessibilityTitle,this.thumbnail=y.fromResponse(e.thumbnail),this.price=e.price,this.vendor_name=e.vendorName,this.from_vendor_text=e.fromVendorText,this.information_button=c.parseItem(e.informationButton),this.endpoint=new d(e.onClickCommand),this.creator_message=e.creatorMessage,this.creator_name=e.creatorName,this.author_photo=y.fromResponse(e.authorPhoto),this.information_dialog=c.parseItem(e.informationDialog),this.is_verified=e.isVerified,this.creator_custom_message=new p(e.creatorCustomMessage)}};r(yl,"LiveChatProductItem");yl.type="LiveChatProductItem";var _v=yl;var bl=class extends n{constructor(e){super(),this.message=new p(e.message),Reflect.has(e,"icon")&&Reflect.has(e.icon,"iconType")&&(this.icon_type=e.icon.iconType)}};r(bl,"LiveChatRestrictedParticipation");bl.type="LiveChatRestrictedParticipation";var xv=bl;var gl=class extends Ge{constructor(e){super(e),this.custom_thumbnail=y.fromResponse(e.customThumbnail)}};r(gl,"LiveChatAuthorBadge");gl.type="LiveChatAuthorBadge";var Mx=gl;var wl=class extends n{constructor(e){super(),this.author_name=new p(e.authorName),this.author_photo=y.fromResponse(e.authorPhoto),this.author_badges=c.parseArray(e.authorBadges,Mx),this.primary_text=new p(e.primaryText),this.menu_endpoint=new d(e.contextMenuEndpoint),this.context_menu_accessibility_label=e.contextMenuAccessibility.accessibilityData.label,this.image=y.fromResponse(e.image)}};r(wl,"LiveChatSponsorshipsHeader");wl.type="LiveChatSponsorshipsHeader";var Lx=wl;var Tl=class extends n{constructor(e){super(),this.id=e.id,this.timestamp_usec=e.timestampUsec,this.author_external_channel_id=e.authorExternalChannelId,this.header=c.parseItem(e.header,Lx)}};r(Tl,"LiveChatSponsorshipsGiftPurchaseAnnouncement");Tl.type="LiveChatSponsorshipsGiftPurchaseAnnouncement";var yv=Tl;var vl=class extends n{constructor(e){super(),this.id=e.id,this.timestamp_usec=e.timestampUsec,this.timestamp_text=new p(e.timestampText),this.author=new P(e.authorName,e.authorBadges,e.authorPhoto,e.authorExternalChannelId),this.message=new p(e.message),this.menu_endpoint=new d(e.contextMenuEndpoint),this.context_menu_accessibility_label=e.contextMenuAccessibility.accessibilityData.label}};r(vl,"LiveChatSponsorshipsGiftRedemptionAnnouncement");vl.type="LiveChatSponsorshipsGiftRedemptionAnnouncement";var bv=vl;var hr=class extends n{constructor(e){super(),this.message=new p(e.message),this.inline_action_buttons=c.parseArray(e.inlineActionButtons,v),this.timestamp=Math.floor(parseInt(e.timestampUsec)/1e3),this.id=e.id}};r(hr,"LiveChatMessageBase");hr.type="LiveChatMessageBase";var Il=class extends hr{constructor(e){super(e),this.author=new P(e.authorName,e.authorBadges,e.authorPhoto,e.authorExternalChannelId),this.menu_endpoint=new d(e.contextMenuEndpoint)}};r(Il,"LiveChatTextMessage");Il.type="LiveChatTextMessage";var gv=Il;var Sl=class extends n{constructor(e){var i,s;super(),this.author=new P(e.authorName,e.authorBadges,e.authorPhoto,e.authorExternalChannelId),this.amount=new p(e.amount),this.duration_sec=e.durationSec,this.full_duration_sec=e.fullDurationSec,this.show_item=c.parseItem((s=(i=e.showItemEndpoint)==null?void 0:i.showLiveChatItemEndpoint)==null?void 0:s.renderer),this.show_item_endpoint=new d(e.showItemEndpoint),this.id=e.id}};r(Sl,"LiveChatTickerPaidMessageItem");Sl.type="LiveChatTickerPaidMessageItem";var Ox=Sl;var El=class extends Ox{};r(El,"LiveChatTickerPaidStickerItem");El.type="LiveChatTickerPaidStickerItem";var wv=El;var kl=class extends n{constructor(e){super(),this.id=e.id,this.detail=new p(e.detailText),this.author=new P(e.authorName,e.authorBadges,e.sponsorPhoto,e.authorExternalChannelId),this.duration_sec=e.durationSec}};r(kl,"LiveChatTickerSponsorItem");kl.type="LiveChatTickerSponsorItem";var Tv=kl;var Cl=class extends hr{constructor(e){super(e),Reflect.has(e,"icon")&&Reflect.has(e.icon,"iconType")&&(this.icon_type=e.icon.iconType),this.action_button=c.parseItem(e.actionButton)}};r(Cl,"LiveChatViewerEngagementMessage");Cl.type="LiveChatViewerEngagementMessage";var vv=Cl;var Pl=class extends n{constructor(e){super(),this.poll_question=new p(e.pollQuestion),this.thumbnails=y.fromResponse(e.thumbnail),this.metadata=new p(e.metadataText),this.live_chat_poll_type=e.liveChatPollType,this.context_menu_button=c.parseItem(e.contextMenuButton,v)}};r(Pl,"PollHeader");Pl.type="PollHeader";var Iv=Pl;var Nl=class extends n{constructor(e){super(),this.id=e.id,this.contents=c.parse(e.contents),this.target_id=e.targetId}};r(Nl,"LiveChatActionPanel");Nl.type="LiveChatActionPanel";var Dx=Nl;var Al=class extends n{constructor(e){super(),this.deleted_state_message=new p(e.deletedStateMessage),this.target_item_id=e.targetItemId}};r(Al,"MarkChatItemAsDeletedAction");Al.type="MarkChatItemAsDeletedAction";var Sv=Al;var Rl=class extends n{constructor(e){super(),this.deleted_state_message=new p(e.deletedStateMessage),this.external_channel_id=e.externalChannelId}};r(Rl,"MarkChatItemsByAuthorAsDeletedAction");Rl.type="MarkChatItemsByAuthorAsDeletedAction";var Ev=Rl;var Ml=class extends n{constructor(e){super(),this.target_action_id=e.targetActionId}};r(Ml,"RemoveBannerForLiveChatCommand");Ml.type="RemoveBannerForLiveChatCommand";var kv=Ml;var Ll=class extends n{constructor(e){super(),this.target_item_id=e.targetItemId}};r(Ll,"RemoveChatItemAction");Ll.type="RemoveChatItemAction";var Cv=Ll;var Ol=class extends n{constructor(e){super(),this.external_channel_id=e.externalChannelId}};r(Ol,"RemoveChatItemByAuthorAction");Ol.type="RemoveChatItemByAuthorAction";var Pv=Ol;var Dl=class extends n{constructor(e){super(),this.target_item_id=e.targetItemId,this.replacement_item=c.parseItem(e.replacementItem)}};r(Dl,"ReplaceChatItemAction");Dl.type="ReplaceChatItemAction";var Nv=Dl;var Bl=class extends n{constructor(e){var i;super(),this.actions=c.parseArray((i=e.actions)==null?void 0:i.map(s=>(delete s.clickTrackingParams,s))),this.video_offset_time_msec=e.videoOffsetTimeMsec}};r(Bl,"ReplayChatItemAction");Bl.type="ReplayChatItemAction";var Av=Bl;var Yl=class extends n{constructor(e){super(),this.panel_to_show=c.parseItem(e.panelToShow,Dx)}};r(Yl,"ShowLiveChatActionPanelAction");Yl.type="ShowLiveChatActionPanelAction";var Rv=Yl;var Vl=class extends n{constructor(e){super(),this.dialog=c.parseItem(e.dialog)}};r(Vl,"ShowLiveChatDialogAction");Vl.type="ShowLiveChatDialogAction";var Mv=Vl;var Ul=class extends n{constructor(e){super(),this.tooltip=c.parseItem(e.tooltip)}};r(Ul,"ShowLiveChatTooltipCommand");Ul.type="ShowLiveChatTooltipCommand";var Lv=Ul;var Fl=class extends n{constructor(e){super(),this.date_text=new p(e.dateText).toString()}};r(Fl,"UpdateDateTextAction");Fl.type="UpdateDateTextAction";var Bx=Fl;var Wl=class extends n{constructor(e){super(),this.description=new p(e.description)}};r(Wl,"UpdateDescriptionAction");Wl.type="UpdateDescriptionAction";var Yx=Wl;var Gl=class extends n{constructor(e){super(),this.poll_to_update=c.parseItem(e.pollToUpdate)}};r(Gl,"UpdateLiveChatPollAction");Gl.type="UpdateLiveChatPollAction";var Ov=Gl;var jl=class extends n{constructor(e){super(),this.title=new p(e.title)}};r(jl,"UpdateTitleAction");jl.type="UpdateTitleAction";var Vx=jl;var Hl=class extends n{constructor(e){super(),this.default_text=new p(e.defaultText).toString(),this.toggled_text=new p(e.toggledText).toString(),this.button_id=e.buttonId}};r(Hl,"UpdateToggleButtonTextAction");Hl.type="UpdateToggleButtonTextAction";var Ux=Hl;var $l=class extends n{constructor(e){super();let i=e.viewCount.videoViewCountRenderer;this.view_count=new p(i.viewCount),this.extra_short_view_count=new p(i.extraShortViewCount),this.original_view_count=parseInt(i.originalViewCount),this.unlabeled_view_count_value=new p(i.unlabeledViewCountValue),this.is_live=i.isLive}};r($l,"UpdateViewershipAction");$l.type="UpdateViewershipAction";var Fx=$l;var Kl=class extends n{constructor(e){super(),this.confirm_button=c.parseItem(e.confirmButton,v),this.dialog_messages=e.dialogMessages.map(i=>new p(i))}};r(Kl,"LiveChatDialog");Kl.type="LiveChatDialog";var Dv=Kl;var ql=class extends n{constructor(e){super(),this.overflow_menu=c.parseItem(e.overflowMenu,R),this.collapse_button=c.parseItem(e.collapseButton,v),this.view_selector=c.parseItem(e.viewSelector,xt)}};r(ql,"LiveChatHeader");ql.type="LiveChatHeader";var Wx=ql;var zl=class extends n{constructor(e){super(),this.max_items_to_display=e.maxItemsToDisplay,this.more_comments_below_button=c.parseItem(e.moreCommentsBelowButton,v)}};r(zl,"LiveChatItemList");zl.type="LiveChatItemList";var Gx=zl;var Xl=class extends n{constructor(e){super(),this.author_name=new p(e.authorName),this.author_photo=y.fromResponse(e.authorPhoto),this.send_button=c.parseItem(e.sendButton,v),this.target_id=e.targetId}};r(Xl,"LiveChatMessageInput");Xl.type="LiveChatMessageInput";var Bv=Xl;var Ql=class extends n{constructor(e){super(),this.name=new p(e.authorName),this.photo=y.fromResponse(e.authorPhoto),this.badges=c.parseArray(e.authorBadges)}};r(Ql,"LiveChatParticipant");Ql.type="LiveChatParticipant";var jx=Ql;var Jl=class extends n{constructor(e){super(),this.title=new p(e.title),this.participants=c.parseArray(e.participants,jx)}};r(Jl,"LiveChatParticipantsList");Jl.type="LiveChatParticipantsList";var Hx=Jl;var Zl=class extends n{constructor(e){super(),this.title=p.fromAttributed(e.title),this.metadata=c.parseItem(e.metadata,Xr),this.image=c.parseItem(e.image,Jr)}};r(Zl,"LockupMetadataView");Zl.type="LockupMetadataView";var $x=Zl;var eu=class extends n{constructor(e){super(),this.content_image=c.parseItem(e.contentImage,D_),this.metadata=c.parseItem(e.metadata,$x),this.content_id=e.contentId,this.content_type=e.contentType.replace("LOCKUP_CONTENT_TYPE_",""),this.on_tap_endpoint=new d(e.rendererContext.commandContext.onTap)}};r(eu,"LockupView");eu.type="LockupView";var Kx=eu;var tu=class extends v{constructor(e){super(e)}};r(tu,"MenuNavigationItem");tu.type="MenuNavigationItem";var qx=tu;var iu=class extends n{constructor(e){super(),this.items=c.parseArray(e.items,[qx,At])}};r(iu,"MenuPopup");iu.type="MenuPopup";var Yv=iu;var ru=class extends n{constructor(e){super(),this.items=c.parse(e.items)}get contents(){return this.items}};r(ru,"MultiPageMenuNotificationSection");ru.type="MultiPageMenuNotificationSection";var Vv=ru;var su=class extends n{constructor(e){super()}};r(su,"MusicMenuItemDivider");su.type="MusicMenuItemDivider";var zx=su;var ou=class extends n{constructor(e){super(),this.title=new p(e.title).toString(),this.form_item_entity_key=e.formItemEntityKey,Reflect.has(e,"selectedIcon")&&(this.selected_icon_type=e.selectedIcon.iconType),Reflect.has(e,"selectedCommand")&&(this.endpoint=new d(e.selectedCommand)),this.selected=!!this.endpoint}};r(ou,"MusicMultiSelectMenuItem");ou.type="MusicMultiSelectMenuItem";var ss=ou;var nu=class extends n{constructor(e){var i;super(),Reflect.has(e,"title")&&Reflect.has(e.title,"musicMenuTitleRenderer")&&(this.title=new p((i=e.title.musicMenuTitleRenderer)==null?void 0:i.primaryText)),this.options=c.parseArray(e.options,[ss,zx])}};r(nu,"MusicMultiSelectMenu");nu.type="MusicMultiSelectMenu";var Xx=nu;var au=class extends n{constructor(e){super(),this.title=new p(e.title),this.buttons=c.parseArray(e.buttons,v)}};r(au,"SimpleMenuHeader");au.type="SimpleMenuHeader";var Qx=au;var pu=class extends n{constructor(e){super(),this.title=e.title,this.description=e.description,this.thumbnails=y.fromResponse(e.thumbnail),this.price=e.price,this.vendor_name=e.vendorName,this.button_text=e.buttonText,this.button_accessibility_text=e.buttonAccessibilityText,this.from_vendor_text=e.fromVendorText,this.additional_fees_text=e.additionalFeesText,this.region_format=e.regionFormat,this.endpoint=new d(e.buttonCommand)}};r(pu,"MerchandiseItem");pu.type="MerchandiseItem";var Uv=pu;var cu=class extends n{constructor(e){super(),this.title=e.title,this.menu=c.parseItem(e.actionButton),this.items=c.parseArray(e.items)}get contents(){return this.items}};r(cu,"MerchandiseShelf");cu.type="MerchandiseShelf";var Jx=cu;var lu=class extends n{constructor(e){super(),this.title=new p(e.title),this.contents=e.contents.map(i=>new p(i))}};r(lu,"MetadataRow");lu.type="MetadataRow";var Fv=lu;var uu=class extends n{constructor(e){super(),this.rows=c.parseArray(e.rows),this.collapsed_item_count=e.collapsedItemCount}};r(uu,"MetadataRowContainer");uu.type="MetadataRowContainer";var Zx=uu;var fu=class extends n{constructor(e){super(),this.content=new p(e.content),this.has_divider_line=e.hasDividerLine}};r(fu,"MetadataRowHeader");fu.type="MetadataRowHeader";var Wv=fu;var mu=class extends n{constructor(e){super(),this.section_list=c.parseItem(e)}};r(mu,"MetadataScreen");mu.type="MetadataScreen";var Gv=mu;var hu=class extends n{constructor(e){super(),this.url_canonical=e.urlCanonical,this.title=e.title,this.description=e.description,this.thumbnail=y.fromResponse(e.thumbnail),this.site_name=e.siteName,this.app_name=e.appName,this.android_package=e.androidPackage,this.ios_app_store_id=e.iosAppStoreId,this.ios_app_arguments=e.iosAppArguments,this.og_type=e.ogType,this.url_applinks_web=e.urlApplinksWeb,this.url_applinks_ios=e.urlApplinksIos,this.url_applinks_android=e.urlApplinksAndroid,this.url_twitter_ios=e.urlTwitterIos,this.url_twitter_android=e.urlTwitterAndroid,this.twitter_card_type=e.twitterCardType,this.twitter_site_handle=e.twitterSiteHandle,this.schema_dot_org_type=e.schemaDotOrgType,this.noindex=e.noindex,this.is_unlisted=e.unlisted,this.is_family_safe=e.familySafe,this.tags=e.tags,this.available_countries=e.availableCountries}};r(hu,"MicroformatData");hu.type="MicroformatData";var Ci=hu;var du=class extends Rt{constructor(e){super(e)}};r(du,"Mix");du.type="Mix";var jv=du;var _u=class extends n{constructor(e){super(),this.title=new p(e.title),this.content=new p(e.content),this.button=c.parseItem(e.button,v)}};r(_u,"ModalWithTitleAndButton");_u.type="ModalWithTitleAndButton";var Hv=_u;var xu=class extends n{constructor(e){var s,o,a;super();let i=((s=e.thumbnailOverlays.find(l=>l.thumbnailOverlayTimeStatusRenderer))==null?void 0:s.thumbnailOverlayTimeStatusRenderer.text)||"N/A";this.id=e.videoId,this.title=new p(e.title),Reflect.has(e,"descriptionSnippet")&&(this.description_snippet=new p(e.descriptionSnippet)),this.top_metadata_items=new p(e.topMetadataItems),this.thumbnails=y.fromResponse(e.thumbnail),this.thumbnail_overlays=c.parseArray(e.thumbnailOverlays),this.author=new P(e.longBylineText,e.ownerBadges,(a=(o=e.channelThumbnailSupportedRenderers)==null?void 0:o.channelThumbnailWithLinkRenderer)==null?void 0:a.thumbnail),this.duration={text:e.lengthText?new p(e.lengthText).toString():new p(i).toString(),seconds:_e(e.lengthText?new p(e.lengthText).toString():new p(i).toString())},this.endpoint=new d(e.navigationEndpoint),this.badges=c.parseArray(e.badges),this.use_vertical_poster=e.useVerticalPoster,this.show_action_menu=e.showActionMenu,this.menu=c.parseItem(e.menu,R)}};r(xu,"Movie");xu.type="Movie";var $v=xu;var yu=class extends n{constructor(e){var i;return super(),(i=e.movingThumbnailDetails)==null?void 0:i.thumbnails.map(s=>new y(s)).sort((s,o)=>o.width-s.width)}};r(yu,"MovingThumbnail");yu.type="MovingThumbnail";var Kv=yu;var bu=class extends n{constructor(e){super(),this.title=new p(e.title)}};r(bu,"MusicCardShelfHeaderBasic");bu.type="MusicCardShelfHeaderBasic";var ey=bu;var gu=class extends n{constructor(e){super(),this.icon_type=e.icon.iconType,this.label=e.accessibilityData.accessibilityData.label}};r(gu,"MusicInlineBadge");gu.type="MusicInlineBadge";var os=gu;var wu=class extends n{constructor(e){var i,s;super(),this.endpoint=new d(e.playNavigationEndpoint),this.play_icon_type=e.playIcon.iconType,this.pause_icon_type=e.pauseIcon.iconType,Reflect.has(e,"accessibilityPlayData")&&(this.play_label=(i=e.accessibilityPlayData.accessibilityData)==null?void 0:i.label),Reflect.has(e,"accessibilityPauseData")&&(this.pause_label=(s=e.accessibilityPauseData.accessibilityData)==null?void 0:s.label),this.icon_color=e.iconColor}};r(wu,"MusicPlayButton");wu.type="MusicPlayButton";var ns=wu;var Tu=class extends n{constructor(e){super(),this.content=c.parseItem(e.content,ns),this.content_position=e.contentPosition,this.display_style=e.displayStyle}};r(Tu,"MusicItemThumbnailOverlay");Tu.type="MusicItemThumbnailOverlay";var Mt=Tu;var vu=class extends n{constructor(e){super(),this.contents=y.fromResponse(e.thumbnail)}};r(vu,"MusicThumbnail");vu.type="MusicThumbnail";var Ie=vu;var Iu=class extends n{constructor(e){super(),this.thumbnail=c.parseItem(e.thumbnail,Ie),this.title=new p(e.title),this.subtitle=new p(e.subtitle),this.buttons=c.parseArray(e.buttons,v),this.menu=c.parseItem(e.menu,R),this.on_tap=new d(e.onTap),this.header=c.parseItem(e.header,ey),Reflect.has(e,"endIcon")&&Reflect.has(e.endIcon,"iconType")&&(this.end_icon_type=e.endIcon.iconType),this.subtitle_badges=c.parseArray(e.subtitleBadges,os),this.thumbnail_overlay=c.parseItem(e.thumbnailOverlay,Mt),Reflect.has(e,"contents")&&(this.contents=c.parseArray(e.contents))}};r(Iu,"MusicCardShelf");Iu.type="MusicCardShelf";var qv=Iu;var Su=class extends n{constructor(e){super(),this.title=new p(e.title),Reflect.has(e,"strapline")&&(this.strapline=new p(e.strapline)),Reflect.has(e,"thumbnail")&&(this.thumbnail=c.parseItem(e.thumbnail,Ie)),Reflect.has(e,"moreContentButton")&&(this.more_content=c.parseItem(e.moreContentButton,v)),Reflect.has(e,"endIcons")&&(this.end_icons=c.parseArray(e.endIcons,Tx))}};r(Su,"MusicCarouselShelfBasicHeader");Su.type="MusicCarouselShelfBasicHeader";var ty=Su;var Eu=class extends n{constructor(e){super(),this.thumbnail=c.parseItem(e.thumbnail,Ie),this.overlay=c.parseItem(e.overlay,Mt),this.on_tap=new d(e.onTap),this.menu=c.parseItem(e.menu,R),this.subtitle=new p(e.subtitle),this.title=new p(e.title),Reflect.has(e,"secondTitle")&&(this.second_title=new p(e.secondTitle)),Reflect.has(e,"description")&&(this.description=new p(e.description)),Reflect.has(e,"displayStyle")&&(this.display_style=e.displayStyle)}};r(Eu,"MusicMultiRowListItem");Eu.type="MusicMultiRowListItem";var iy=Eu;var ku=class extends n{constructor(e){super(),this.button_text=new p(e.buttonText).toString(),this.endpoint=new d(e.clickCommand)}};r(ku,"MusicNavigationButton");ku.type="MusicNavigationButton";var ry=ku;var Cu=class extends n{constructor(e){super(),this.title=new p(e.text),this.display_priority=e.displayPriority}};r(Cu,"MusicResponsiveListItemFixedColumn");Cu.type="musicResponsiveListItemFlexColumnRenderer";var sy=Cu;var Pu=class extends n{constructor(e){super(),this.title=new p(e.text),this.display_priority=e.displayPriority}};r(Pu,"MusicResponsiveListItemFlexColumn");Pu.type="MusicResponsiveListItemFlexColumn";var oy=Pu;var Ze,as,Cg,Qv,zv,Xv,Jv,Zv,eI,tI,iI,rI,Nu=class extends n{constructor(e){var s,o,a,l,f,m;super(),Ze.add(this),as.set(this,void 0),this.flex_columns=c.parseArray(e.flexColumns,oy),this.fixed_columns=c.parseArray(e.fixedColumns,sy),I(this,as,{video_id:((s=e==null?void 0:e.playlistItemData)==null?void 0:s.videoId)||null,playlist_set_video_id:((o=e==null?void 0:e.playlistItemData)==null?void 0:o.playlistSetVideoId)||null},"f"),Reflect.has(e,"navigationEndpoint")&&(this.endpoint=new d(e.navigationEndpoint));let i=(m=(f=(l=(a=this.endpoint)==null?void 0:a.payload)==null?void 0:l.browseEndpointContextSupportedConfigs)==null?void 0:f.browseEndpointContextMusicConfig)==null?void 0:m.pageType;switch(i||this.flex_columns.find(_=>{var b,T,w,S;return((S=(w=(T=(b=_.title.endpoint)==null?void 0:b.payload)==null?void 0:T.browseEndpointContextSupportedConfigs)==null?void 0:w.browseEndpointContextMusicConfig)==null?void 0:S.pageType)==="MUSIC_PAGE_TYPE_NON_MUSIC_AUDIO_TRACK_PAGE"})&&(i="MUSIC_PAGE_TYPE_NON_MUSIC_AUDIO_TRACK_PAGE"),i){case"MUSIC_PAGE_TYPE_ALBUM":this.item_type="album",u(this,Ze,"m",iI).call(this);break;case"MUSIC_PAGE_TYPE_PLAYLIST":this.item_type="playlist",u(this,Ze,"m",rI).call(this);break;case"MUSIC_PAGE_TYPE_ARTIST":case"MUSIC_PAGE_TYPE_USER_CHANNEL":this.item_type="artist",u(this,Ze,"m",Jv).call(this);break;case"MUSIC_PAGE_TYPE_LIBRARY_ARTIST":this.item_type="library_artist",u(this,Ze,"m",Zv).call(this);break;case"MUSIC_PAGE_TYPE_NON_MUSIC_AUDIO_TRACK_PAGE":this.item_type="non_music_track",u(this,Ze,"m",eI).call(this);break;case"MUSIC_PAGE_TYPE_PODCAST_SHOW_DETAIL_PAGE":this.item_type="podcast_show",u(this,Ze,"m",tI).call(this);break;default:this.flex_columns[1]?u(this,Ze,"m",Qv).call(this):u(this,Ze,"m",Cg).call(this)}Reflect.has(e,"index")&&(this.index=new p(e.index)),Reflect.has(e,"thumbnail")&&(this.thumbnail=c.parseItem(e.thumbnail,Ie)),Reflect.has(e,"badges")&&(this.badges=c.parseArray(e.badges)),Reflect.has(e,"menu")&&(this.menu=c.parseItem(e.menu,R)),Reflect.has(e,"overlay")&&(this.overlay=c.parseItem(e.overlay,Mt))}get thumbnails(){var e;return((e=this.thumbnail)==null?void 0:e.contents)||[]}};r(Nu,"MusicResponsiveListItem");as=new WeakMap,Ze=new WeakSet,Cg=r(function(){this.title=this.flex_columns.first().title.toString(),this.endpoint?this.item_type="endpoint":this.item_type="unknown"},"_MusicResponsiveListItem_parseOther"),Qv=r(function(){var i,s,o,a,l,f,m;switch((m=(f=(l=(a=(o=(s=(i=this.flex_columns.at(0))==null?void 0:i.title.runs)==null?void 0:s.at(0))==null?void 0:o.endpoint)==null?void 0:a.payload)==null?void 0:l.watchEndpointMusicSupportedConfigs)==null?void 0:f.watchEndpointMusicConfig)==null?void 0:m.musicVideoType){case"MUSIC_VIDEO_TYPE_UGC":case"MUSIC_VIDEO_TYPE_OMV":this.item_type="video",u(this,Ze,"m",Xv).call(this);break;case"MUSIC_VIDEO_TYPE_ATV":this.item_type="song",u(this,Ze,"m",zv).call(this);break;default:u(this,Ze,"m",Cg).call(this)}},"_MusicResponsiveListItem_parseVideoOrSong"),zv=r(function(){var o,a,l,f,m,x,_,b,T,w,S,E,C,k,U;this.id=u(this,as,"f").video_id||((a=(o=this.endpoint)==null?void 0:o.payload)==null?void 0:a.videoId),this.title=this.flex_columns.first().title.toString();let e=((m=(f=(l=this.flex_columns.at(1))==null?void 0:l.title.runs)==null?void 0:f.find(L=>/^\d+$/.test(L.text.replace(/:/g,""))))==null?void 0:m.text)||((_=(x=this.fixed_columns.first())==null?void 0:x.title)==null?void 0:_.toString());e&&(this.duration={text:e,seconds:_e(e)});let i=((T=(b=this.flex_columns.at(1))==null?void 0:b.title.runs)==null?void 0:T.find(L=>Oe(L)&&L.endpoint&&L.endpoint.payload.browseId.startsWith("MPR")))||((S=(w=this.flex_columns.at(2))==null?void 0:w.title.runs)==null?void 0:S.find(L=>Oe(L)&&L.endpoint&&L.endpoint.payload.browseId.startsWith("MPR")));i&&Oe(i)&&(this.album={id:(C=(E=i.endpoint)==null?void 0:E.payload)==null?void 0:C.browseId,name:i.text,endpoint:i.endpoint});let s=(U=(k=this.flex_columns.at(1))==null?void 0:k.title.runs)==null?void 0:U.filter(L=>Oe(L)&&L.endpoint&&L.endpoint.payload.browseId.startsWith("UC"));s&&(this.artists=s.map(L=>{var K,re;return{name:L.text,channel_id:Oe(L)?(re=(K=L.endpoint)==null?void 0:K.payload)==null?void 0:re.browseId:void 0,endpoint:Oe(L)?L.endpoint:void 0}}))},"_MusicResponsiveListItem_parseSong"),Xv=r(function(){var s,o,a,l,f,m,x,_,b,T;this.id=u(this,as,"f").video_id,this.title=this.flex_columns.first().title.toString(),this.views=(a=(o=(s=this.flex_columns.at(1))==null?void 0:s.title.runs)==null?void 0:o.find(w=>w.text.match(/(.*?) views/)))==null?void 0:a.toString();let e=(f=(l=this.flex_columns.at(1))==null?void 0:l.title.runs)==null?void 0:f.filter(w=>Oe(w)&&w.endpoint&&w.endpoint.payload.browseId.startsWith("UC"));e&&(this.authors=e.map(w=>{var S,E;return{name:w.text,channel_id:Oe(w)?(E=(S=w.endpoint)==null?void 0:S.payload)==null?void 0:E.browseId:void 0,endpoint:Oe(w)?w.endpoint:void 0}}));let i=((x=(m=this.flex_columns[1].title.runs)==null?void 0:m.find(w=>/^\d+$/.test(w.text.replace(/:/g,""))))==null?void 0:x.text)||((T=(b=(_=this.fixed_columns.first())==null?void 0:_.title.runs)==null?void 0:b.find(w=>/^\d+$/.test(w.text.replace(/:/g,""))))==null?void 0:T.text);i&&(this.duration={text:i,seconds:_e(i)})},"_MusicResponsiveListItem_parseVideo"),Jv=r(function(){var e,i,s,o,a,l;this.id=(i=(e=this.endpoint)==null?void 0:e.payload)==null?void 0:i.browseId,this.name=this.flex_columns.first().title.toString(),this.subtitle=(s=this.flex_columns.at(1))==null?void 0:s.title,this.subscribers=((l=(a=(o=this.subtitle)==null?void 0:o.runs)==null?void 0:a.find(f=>/^(\d*\.)?\d+[M|K]? subscribers?$/i.test(f.text)))==null?void 0:l.text)||""},"_MusicResponsiveListItem_parseArtist"),Zv=r(function(){var e,i,s,o;this.name=this.flex_columns.first().title.toString(),this.subtitle=(e=this.flex_columns.at(1))==null?void 0:e.title,this.song_count=((o=(s=(i=this.subtitle)==null?void 0:i.runs)==null?void 0:s.find(a=>/^\d+(,\d+)? songs?$/i.test(a.text)))==null?void 0:o.text)||""},"_MusicResponsiveListItem_parseLibraryArtist"),eI=r(function(){var e,i;this.id=u(this,as,"f").video_id||((i=(e=this.endpoint)==null?void 0:e.payload)==null?void 0:i.videoId),this.title=this.flex_columns.first().title.toString()},"_MusicResponsiveListItem_parseNonMusicTrack"),tI=r(function(){var e,i;this.id=(i=(e=this.endpoint)==null?void 0:e.payload)==null?void 0:i.browseId,this.title=this.flex_columns.first().title.toString()},"_MusicResponsiveListItem_parsePodcastShow"),iI=r(function(){var i,s,o,a,l,f,m,x,_;this.id=(s=(i=this.endpoint)==null?void 0:i.payload)==null?void 0:s.browseId,this.title=this.flex_columns.first().title.toString();let e=(a=(o=this.flex_columns.at(1))==null?void 0:o.title.runs)==null?void 0:a.find(b=>Oe(b)&&b.endpoint&&b.endpoint.payload.browseId.startsWith("UC"));e&&Oe(e)&&(this.author={name:e.text,channel_id:(f=(l=e.endpoint)==null?void 0:l.payload)==null?void 0:f.browseId,endpoint:e.endpoint}),this.year=(_=(x=(m=this.flex_columns.at(1))==null?void 0:m.title.runs)==null?void 0:x.find(b=>/^[12][0-9]{3}$/.test(b.text)))==null?void 0:_.text},"_MusicResponsiveListItem_parseAlbum"),rI=r(function(){var s,o,a,l,f,m,x,_;this.id=(o=(s=this.endpoint)==null?void 0:s.payload)==null?void 0:o.browseId,this.title=this.flex_columns.first().title.toString();let e=(l=(a=this.flex_columns.at(1))==null?void 0:a.title.runs)==null?void 0:l.find(b=>b.text.match(/\d+ (song|songs)/));this.item_count=e?e.text:void 0;let i=(m=(f=this.flex_columns.at(1))==null?void 0:f.title.runs)==null?void 0:m.find(b=>Oe(b)&&b.endpoint&&b.endpoint.payload.browseId.startsWith("UC"));i&&Oe(i)&&(this.author={name:i.text,channel_id:(_=(x=i.endpoint)==null?void 0:x.payload)==null?void 0:_.browseId,endpoint:i.endpoint})},"_MusicResponsiveListItem_parsePlaylist");Nu.type="MusicResponsiveListItem";var Pi=Nu;var Au=class extends n{constructor(e){var s,o,a,l,f,m,x,_,b,T,w,S,E,C,k,U,L,K,re,he,Y,te;switch(super(),this.title=new p(e.title),this.endpoint=new d(e.navigationEndpoint),this.id=((o=(s=this.endpoint)==null?void 0:s.payload)==null?void 0:o.browseId)||((l=(a=this.endpoint)==null?void 0:a.payload)==null?void 0:l.videoId),this.subtitle=new p(e.subtitle),this.badges=c.parse(e.subtitleBadges),(_=(x=(m=(f=this.endpoint)==null?void 0:f.payload)==null?void 0:m.browseEndpointContextSupportedConfigs)==null?void 0:x.browseEndpointContextMusicConfig)==null?void 0:_.pageType){case"MUSIC_PAGE_TYPE_ARTIST":this.item_type="artist";break;case"MUSIC_PAGE_TYPE_PLAYLIST":this.item_type="playlist";break;case"MUSIC_PAGE_TYPE_ALBUM":this.item_type="album";break;default:((T=(b=this.endpoint)==null?void 0:b.metadata)==null?void 0:T.api_url)==="/next"?this.item_type="endpoint":(w=this.subtitle.runs)!=null&&w[0]?this.subtitle.runs[0].text!=="Song"?this.item_type="video":this.item_type="song":this.endpoint?this.item_type="endpoint":this.item_type="unknown";break}if(this.item_type=="artist")this.subscribers=((E=(S=this.subtitle.runs)==null?void 0:S.find(F=>/^(\d*\.)?\d+[M|K]? subscribers?$/i.test(F.text)))==null?void 0:E.text)||"";else if(this.item_type=="playlist"){let F=(C=this.subtitle.runs)==null?void 0:C.find(B=>B.text.match(/\d+ songs|song/));this.item_count=F?F.text:null}else if(this.item_type=="album"){let F=(k=this.subtitle.runs)==null?void 0:k.filter(B=>{var X,Z;return(Z=(X=B.endpoint)==null?void 0:X.payload)==null?void 0:Z.browseId.startsWith("UC")});F&&(this.artists=F.map(B=>{var X,Z;return{name:B.text,channel_id:(Z=(X=B.endpoint)==null?void 0:X.payload)==null?void 0:Z.browseId,endpoint:B.endpoint}})),this.year=(U=this.subtitle.runs)==null?void 0:U.slice(-1)[0].text,isNaN(Number(this.year))&&delete this.year}else if(this.item_type=="video"){this.views=((K=(L=this==null?void 0:this.subtitle.runs)==null?void 0:L.find(B=>B==null?void 0:B.text.match(/(.*?) views/)))==null?void 0:K.text)||"N/A";let F=(re=this.subtitle.runs)==null?void 0:re.find(B=>{var X,Z,Ue;return(Ue=(Z=(X=B.endpoint)==null?void 0:X.payload)==null?void 0:Z.browseId)==null?void 0:Ue.startsWith("UC")});F&&(this.author={name:F==null?void 0:F.text,channel_id:(Y=(he=F==null?void 0:F.endpoint)==null?void 0:he.payload)==null?void 0:Y.browseId,endpoint:F==null?void 0:F.endpoint})}else if(this.item_type=="song"){let F=(te=this.subtitle.runs)==null?void 0:te.filter(B=>{var X,Z;return(Z=(X=B.endpoint)==null?void 0:X.payload)==null?void 0:Z.browseId.startsWith("UC")});F&&(this.artists=F.map(B=>{var X,Z;return{name:B==null?void 0:B.text,channel_id:(Z=(X=B==null?void 0:B.endpoint)==null?void 0:X.payload)==null?void 0:Z.browseId,endpoint:B==null?void 0:B.endpoint}}))}this.thumbnail=y.fromResponse(e.thumbnailRenderer.musicThumbnailRenderer.thumbnail),this.thumbnail_overlay=c.parseItem(e.thumbnailOverlay,Mt),this.menu=c.parseItem(e.menu,R)}};r(Au,"MusicTwoRowItem");Au.type="MusicTwoRowItem";var ny=Au;var Ru=class extends n{constructor(e){super(),this.header=c.parseItem(e.header,ty),this.contents=c.parseArray(e.contents,[ny,Pi,iy,ry]),Reflect.has(e,"numItemsPerColumn")&&(this.num_items_per_column=parseInt(e.numItemsPerColumn))}};r(Ru,"MusicCarouselShelf");Ru.type="MusicCarouselShelf";var sI=Ru;var Mu=class extends n{constructor(e){super(),this.description=new p(e.description),Reflect.has(e,"maxCollapsedLines")&&(this.max_collapsed_lines=e.maxCollapsedLines),Reflect.has(e,"maxExpandedLines")&&(this.max_expanded_lines=e.maxExpandedLines),this.footer=new p(e.footer)}};r(Mu,"MusicDescriptionShelf");Mu.type="MusicDescriptionShelf";var ay=Mu;var Lu=class extends n{constructor(e){var s,o,a,l,f,m,x,_,b;super(),this.title=new p(e.title),this.description=new p(e.description),this.subtitle=new p(e.subtitle),this.second_subtitle=new p(e.secondSubtitle),this.year=((o=(s=this.subtitle.runs)==null?void 0:s.find(T=>/^[12][0-9]{3}$/.test(T.text)))==null?void 0:o.text)||"",this.song_count=((l=(a=this.second_subtitle.runs)==null?void 0:a[0])==null?void 0:l.text)||"",this.total_duration=((m=(f=this.second_subtitle.runs)==null?void 0:f[2])==null?void 0:m.text)||"",this.thumbnails=y.fromResponse(e.thumbnail.croppedSquareThumbnailRenderer.thumbnail),this.badges=c.parseArray(e.subtitleBadges);let i=(x=this.subtitle.runs)==null?void 0:x.find(T=>{var w,S;return(S=(w=T==null?void 0:T.endpoint)==null?void 0:w.payload)==null?void 0:S.browseId.startsWith("UC")});i&&(this.author={name:i.text,channel_id:(b=(_=i.endpoint)==null?void 0:_.payload)==null?void 0:b.browseId,endpoint:i.endpoint}),this.menu=c.parseItem(e.menu)}};r(Lu,"MusicDetailHeader");Lu.type="MusicDetailHeader";var oI=Lu;var Ou=class extends n{constructor(e){super(),this.playlist_id=e.playlistId,this.supported_download_states=e.supportedDownloadStates}};r(Ou,"MusicDownloadStateBadge");Ou.type="MusicDownloadStateBadge";var nI=Ou;var Du=class extends n{constructor(e){super(),this.header=c.parseItem(e.header),this.edit_header=c.parseItem(e.editHeader),this.playlist_id=e.playlistId}};r(Du,"MusicEditablePlaylistDetailHeader");Du.type="MusicEditablePlaylistDetailHeader";var aI=Du;var Bu=class extends n{constructor(e){super(),this.element=Reflect.has(e,"elementRenderer")?c.parseItem(e,nx):null}};r(Bu,"MusicElementHeader");Bu.type="MusicElementHeader";var pI=Bu;var Yu=class extends n{constructor(e){super(),Reflect.has(e,"header")&&(this.header=c.parseItem(e.header)),Reflect.has(e,"title")&&(this.title=new p(e.title))}};r(Yu,"MusicHeader");Yu.type="MusicHeader";var cI=Yu;var Vu=class extends n{constructor(e){super(),this.title=new p(e.title),this.description=new p(e.description),this.thumbnail=c.parseItem(e.thumbnail,Ie)}};r(Vu,"MusicImmersiveHeader");Vu.type="MusicImmersiveHeader";var lI=Vu;var Uu=class{constructor(e){this.icon_name=e.iconName,this.endpoint=new d(e.onTap),this.a11y_text=e.a11yText,this.style=e.style}};r(Uu,"ActionButton");Uu.type="ActionButton";var Fu=class{constructor(e){this.image=y.fromResponse(e.image.image),this.content_mode=e.image.contentMode,this.crop_options=e.image.cropOptions,this.image_aspect_ratio=e.imageAspectRatio,this.caption=e.caption,this.action_buttons=e.actionButtons.map(i=>new Uu(i))}};r(Fu,"Panel");Fu.type="Panel";var Wu=class extends n{constructor(e){super(),this.header=e.shelf.header,this.panels=e.shelf.panels.map(i=>new Fu(i))}};r(Wu,"MusicLargeCardItemCarousel");Wu.type="MusicLargeCardItemCarousel";var uI=Wu;var Gu=class extends n{constructor(e){super(),this.title=new p(e.title),this.edit_title=new p(e.editTitle),this.edit_description=new p(e.editDescription),this.privacy=e.privacy,this.playlist_id=e.playlistId,this.endpoint=new d(e.collaborationSettingsCommand),this.privacy_dropdown=c.parseItem(e.privacyDropdown,hi)}};r(Gu,"MusicPlaylistEditHeader");Gu.type="MusicPlaylistEditHeader";var fI=Gu;var ju=class extends n{constructor(e){var i,s,o;super(),this.playlist_id=e.playlistId,this.contents=c.parseArray(e.contents,Pi),this.collapsed_item_count=e.collapsedItemCount,this.continuation=((o=(s=(i=e.continuations)==null?void 0:i[0])==null?void 0:s.nextContinuationData)==null?void 0:o.continuation)||null}};r(ju,"MusicPlaylistShelf");ju.type="MusicPlaylistShelf";var mI=ju;var Hu=class extends n{constructor(e){var o,a,l,f,m;super(),this.title=new p(e.title),this.thumbnail=y.fromResponse(e.thumbnail),this.endpoint=new d(e.navigationEndpoint),this.selected=e.selected,this.video_id=e.videoId,this.duration={text:new p(e.lengthText).toString(),seconds:_e(new p(e.lengthText).toString())};let i=(o=new p(e.longBylineText).runs)==null?void 0:o.find(x=>{var _,b,T;return(T=(b=(_=x.endpoint)==null?void 0:_.payload)==null?void 0:b.browseId)==null?void 0:T.startsWith("MPR")}),s=(a=new p(e.longBylineText).runs)==null?void 0:a.filter(x=>{var _,b,T;return(T=(b=(_=x.endpoint)==null?void 0:_.payload)==null?void 0:b.browseId)==null?void 0:T.startsWith("UC")});this.author=new p(e.shortBylineText).toString(),i&&(this.album={id:(f=(l=i.endpoint)==null?void 0:l.payload)==null?void 0:f.browseId,name:i.text,year:(m=new p(e.longBylineText).runs)==null?void 0:m.slice(-1)[0].text,endpoint:i.endpoint}),s&&(this.artists=s.map(x=>{var _,b;return{name:x.text,channel_id:(b=(_=x.endpoint)==null?void 0:_.payload)==null?void 0:b.browseId,endpoint:x.endpoint}})),this.badges=c.parseArray(e.badges),this.menu=c.parseItem(e.menu),this.set_video_id=e.playlistSetVideoId}};r(Hu,"PlaylistPanelVideo");Hu.type="PlaylistPanelVideo";var ei=Hu;var $u=class extends n{constructor(e){super(),this.primary=c.parseItem(e.primaryRenderer,ei),Reflect.has(e,"counterpart")&&(this.counterpart=G(e.counterpart.map(i=>c.parseItem(i.counterpartRenderer,ei))||[]))}};r($u,"PlaylistPanelVideoWrapper");$u.type="PlaylistPanelVideoWrapper";var py=$u;var Ku=class extends n{constructor(e){var i,s,o,a,l,f;super(),this.title=e.title,this.title_text=new p(e.titleText),this.contents=c.parseArray(e.contents,[py,ei,Wd]),this.playlist_id=e.playlistId,this.is_infinite=e.isInfinite,this.continuation=((o=(s=(i=e.continuations)==null?void 0:i[0])==null?void 0:s.nextRadioContinuationData)==null?void 0:o.continuation)||((f=(l=(a=e.continuations)==null?void 0:a[0])==null?void 0:l.nextContinuationData)==null?void 0:f.continuation),this.is_editable=e.isEditable,this.preview_description=e.previewDescription,this.num_items_to_show=e.numItemsToShow}};r(Ku,"PlaylistPanel");Ku.type="PlaylistPanel";var cy=Ku;var qu=class extends n{constructor(e){super(),this.content=c.parseItem(e.content,cy)}};r(qu,"MusicQueue");qu.type="MusicQueue";var ly=qu;var zu=class extends n{constructor(e){super(),this.thumbnail=c.parseItem(e.thumbnail,Ie),this.buttons=c.parseArray(e.buttons,[Yr,se,ns,v,R]),this.title=new p(e.title),this.subtitle=new p(e.subtitle),this.strapline_text_one=new p(e.straplineTextOne),this.strapline_thumbnail=c.parseItem(e.straplineThumbnail,Ie),this.second_subtitle=new p(e.secondSubtitle),Reflect.has(e,"subtitleBadge")&&(this.subtitle_badge=c.parseArray(e.subtitleBadge,os)),Reflect.has(e,"description")&&(this.description=c.parseItem(e.description,ay))}};r(zu,"MusicResponsiveHeader");zu.type="MusicResponsiveHeader";var hI=zu;var Xu=class extends n{constructor(e){var i,s,o,a;super(),this.title=new p(e.title),this.contents=c.parseArray(e.contents,Pi),Reflect.has(e,"bottomEndpoint")&&(this.endpoint=new d(e.bottomEndpoint)),Reflect.has(e,"continuations")&&(this.continuation=((s=(i=e.continuations)==null?void 0:i[0].nextContinuationData)==null?void 0:s.continuation)||((a=(o=e.continuations)==null?void 0:o[0].reloadContinuationData)==null?void 0:a.continuation)),Reflect.has(e,"bottomText")&&(this.bottom_text=new p(e.bottomText)),Reflect.has(e,"bottomButton")&&(this.bottom_button=c.parseItem(e.bottomButton,v)),Reflect.has(e,"subheaders")&&(this.subheaders=c.parseArray(e.subheaders))}};r(Xu,"MusicShelf");Xu.type="MusicShelf";var dI=Xu;var Qu=class extends n{constructor(e){super(),Reflect.has(e,"startItems")&&(this.start_items=c.parseArray(e.startItems)),Reflect.has(e,"endItems")&&(this.end_items=c.parseArray(e.endItems))}};r(Qu,"MusicSideAlignedItem");Qu.type="MusicSideAlignedItem";var _I=Qu;var Ju=class extends n{constructor(e){super(),this.title=new p(e.title).toString(),Reflect.has(e,"icon")&&(this.icon_type=e.icon.iconType),this.menu=c.parseItem(e.menu,Xx)}};r(Ju,"MusicSortFilterButton");Ju.type="MusicSortFilterButton";var xI=Ju;var Zu=class extends n{constructor(e){super(),this.thumbnail=y.fromResponse(e.thumbnail)}};r(Zu,"MusicTastebuilderShelfThumbnail");Zu.type="MusicTastebuilderShelfThumbnail";var uy=Zu;var ef=class extends n{constructor(e){super(),this.thumbnail=c.parseItem(e.thumbnail,uy),this.primary_text=new p(e.primaryText),this.secondary_text=new p(e.secondaryText),this.action_button=c.parseItem(e.actionButton,v),this.is_visible=e.isVisible}};r(ef,"MusicTasteBuilderShelf");ef.type="MusicTasteBuilderShelf";var yI=ef;var tf=class extends n{constructor(e){var i,s;super(),this.title=new p(e.title),this.thumbnail=e.thumbnail?y.fromResponse((i=e.thumbnail.musicThumbnailRenderer)==null?void 0:i.thumbnail):[],this.menu=c.parseItem(e.menu,R),this.foreground_thumbnail=e.foregroundThumbnail?y.fromResponse((s=e.foregroundThumbnail.musicThumbnailRenderer)==null?void 0:s.thumbnail):[]}};r(tf,"MusicVisualHeader");tf.type="MusicVisualHeader";var bI=tf;var rf=class extends n{constructor(e){super(),this.placeholder_text=new p(e.placeholderText),this.buttons=c.parseArray(e.buttons),Reflect.has(e,"logo")&&Reflect.has(e.logo,"iconType")&&(this.logo_type=e.logo.iconType)}};r(rf,"MobileTopbar");rf.type="MobileTopbar";var gI=rf;var sf=class extends n{constructor(e){super(),this.items=c.parseArray(e.items)}};r(sf,"MultiPageMenuSection");sf.type="MultiPageMenuSection";var wI=sf;var of=class extends n{constructor(e){super(),this.items=c.parseArray(e.items)}};r(of,"PivotBar");of.type="PivotBar";var TI=of;var nf=class extends n{constructor(e){super(),this.pivot_identifier=e.pivotIdentifier,this.endpoint=new d(e.navigationEndpoint),this.title=new p(e.title),Reflect.has(e,"accessibility")&&Reflect.has(e.accessibility,"accessibilityData")&&(this.accessibility_label=e.accessibility.accessibilityData.label),Reflect.has(e,"icon")&&Reflect.has(e.icon,"iconType")&&(this.icon_type=e.icon.iconType)}};r(nf,"PivotBarItem");nf.type="PivotBarItem";var vI=nf;var af=class extends n{constructor(e){super(),Reflect.has(e,"icon")&&Reflect.has(e.icon,"iconType")&&(this.icon_type=e.icon.iconType),this.menu_renderer=c.parseItem(e.menuRenderer),this.target_id=e.targetId}};r(af,"TopbarMenuButton");af.type="TopbarMenuButton";var II=af;var pf=class extends n{constructor(e){super(),this.thumbnails=y.fromResponse(e.thumbnail),this.video_thumbnails=y.fromResponse(e.videoThumbnail),this.short_message=new p(e.shortMessage),this.sent_time=new p(e.sentTimeText),this.notification_id=e.notificationId,this.endpoint=new d(e.navigationEndpoint),this.record_click_endpoint=new d(e.recordClickEndpoint),this.menu=c.parseItem(e.contextualMenu),this.read=e.read}};r(pf,"Notification");pf.type="Notification";var fy=pf;var cf=class extends n{constructor(e){super(),this.response_text=new p(e.responseText)}};r(cf,"NotificationAction");cf.type="NotificationAction";var SI=cf;var lf=class extends n{constructor(e){super(),this.title=c.parseItem(e.title,sx),this.image=c.parseItem(e.image,[rr,Jr]),this.animated_image=c.parseItem(e.animatedImage,rr),this.metadata=c.parseItem(e.metadata,Xr),this.actions=c.parseItem(e.actions,mx),this.description=c.parseItem(e.description,ex),this.attributation=c.parseItem(e.attributation,Ud),this.banner=c.parseItem(e.banner,vx)}};r(lf,"PageHeaderView");lf.type="PageHeaderView";var my=lf;var uf=class extends n{constructor(e){super(),this.page_title=e.pageTitle,this.content=c.parseItem(e.content,my)}};r(uf,"PageHeader");uf.type="PageHeader";var Lt=uf;var ff=class extends n{constructor(e){super(),this.header_text=new p(e.headerText).toString(),this.body_text=new p(e.bodyText).toString(),this.page_title=new p(e.pageTitle).toString(),this.header_icon_type=e.headerIcon.iconType}};r(ff,"PageIntroduction");ff.type="PageIntroduction";var hy=ff;var mf=class extends n{constructor(e){super(),this.thumbnail=y.fromResponse(e.thumbnail),this.endpoint=new d(e.onClickCommand),this.content_description=new p(e.contentDescription),this.target_id=e.targetId,this.sound_attribution_title=new p(e.soundAttributionTitle),this.waveform_animation_style=e.waveformAnimationStyle,this.background_animation_style=e.backgroundAnimationStyle}};r(mf,"PivotButton");mf.type="PivotButton";var dy=mf;var hf=class extends n{constructor(e){super(),Reflect.has(e,"featuredChannel")&&(this.featured_channel={start_time_ms:e.featuredChannel.startTimeMs,end_time_ms:e.featuredChannel.endTimeMs,watermark:y.fromResponse(e.featuredChannel.watermark),channel_name:e.featuredChannel.channelName,endpoint:new d(e.featuredChannel.navigationEndpoint),subscribe_button:c.parseItem(e.featuredChannel.subscribeButton)}),this.allow_swipe_dismiss=e.allowSwipeDismiss,this.annotation_id=e.annotationId}};r(hf,"PlayerAnnotationsExpanded");hf.type="PlayerAnnotationsExpanded";var _y=hf;var df=class extends n{constructor(e){super(),Reflect.has(e,"captionTracks")&&(this.caption_tracks=e.captionTracks.map(i=>({base_url:i.baseUrl,name:new p(i.name),vss_id:i.vssId,language_code:i.languageCode,kind:i.kind,is_translatable:i.isTranslatable}))),Reflect.has(e,"audioTracks")&&(this.audio_tracks=e.audioTracks.map(i=>({audio_track_id:i.audioTrackId,captions_initial_state:i.captionsInitialState,default_caption_track_index:i.defaultCaptionTrackIndex,has_default_track:i.hasDefaultTrack,visibility:i.visibility,caption_track_indices:i.captionTrackIndices}))),Reflect.has(e,"defaultAudioTrackIndex")&&(this.default_audio_track_index=e.defaultAudioTrackIndex),Reflect.has(e,"translationLanguages")&&(this.translation_languages=e.translationLanguages.map(i=>({language_code:i.languageCode,language_name:new p(i.languageName)})))}};r(df,"PlayerCaptionsTracklist");df.type="PlayerCaptionsTracklist";var xy=df;var _f=class extends n{constructor(e){super(),this.endpoint=new d(e.endpoint),this.enable_listen_first=e.enableListenFirst}};r(_f,"PlayerOverflow");_f.type="PlayerOverflow";var yy=_f;var xf=class extends n{constructor(e){super(),this.overflow=c.parseItem(e.overflow,yy)}};r(xf,"PlayerControlsOverlay");xf.type="PlayerControlsOverlay";var EI=xf;var yf=class extends n{constructor(e){super(),this.subreason=new p(e.subreason),this.reason=new p(e.reason),this.proceed_button=c.parseItem(e.proceedButton,v),this.thumbnails=y.fromResponse(e.thumbnail),Reflect.has(e,"icon")&&(this.icon_type=e.icon.iconType)}};r(yf,"PlayerErrorMessage");yf.type="PlayerErrorMessage";var kI=yf;var bf=class extends n{constructor(e){super(),this.title=e.itemTitle,this.thumbnail=e.itemThumbnail,this.offer_description=e.offerDescription,this.offer_id=e.offerId}};r(bf,"PlayerLegacyDesktopYpcOffer");bf.type="PlayerLegacyDesktopYpcOffer";var CI=bf;var gf=class extends n{constructor(e){super(),this.video_message=e.fullVideoMessage,this.player_response=e.unserializedPlayerResponse}};r(gf,"YpcTrailer");gf.type="YpcTrailer";var by=gf;var wf=class extends n{constructor(e){super(),this.video_id=e.trailerVideoId,this.title=e.itemTitle,this.thumbnail=e.itemThumbnail,this.offer_headline=e.offerHeadline,this.offer_description=e.offerDescription,this.offer_id=e.offerId,this.offer_button_text=e.offerButtonText,this.video_message=e.fullVideoMessage,this.trailer=c.parseItem(e.ypcTrailer,by)}};r(wf,"PlayerLegacyDesktopYpcTrailer");wf.type="PlayerLegacyDesktopYpcTrailer";var Tf=wf;var vf=class extends n{constructor(e){super();let[i,s,o,a,l]=e.spec.split("#");this.board={type:"live",template_url:i,thumbnail_width:parseInt(s,10),thumbnail_height:parseInt(o,10),columns:parseInt(a,10),rows:parseInt(l,10)}}};r(vf,"PlayerLiveStoryboardSpec");vf.type="PlayerLiveStoryboardSpec";var gy=vf;var If=class extends n{constructor(e){var i,s;super(),this.title=new p(e.title),this.description=new p(e.description),this.thumbnails=y.fromResponse(e.thumbnail),Reflect.has(e,"embed")&&(this.embed={iframe_url:e.embed.iframeUrl,flash_url:e.embed.flashUrl,flash_secure_url:e.embed.flashSecureUrl,width:e.embed.width,height:e.embed.height}),this.length_seconds=parseInt(e.lengthSeconds),this.channel={id:e.externalChannelId,name:e.ownerChannelName,url:e.ownerProfileUrl},this.is_family_safe=!!e.isFamilySafe,this.is_unlisted=!!e.isUnlisted,this.has_ypc_metadata=!!e.hasYpcMetadata,this.view_count=parseInt(e.viewCount),this.category=e.category,this.publish_date=e.publishDate,this.upload_date=e.uploadDate,this.available_countries=e.availableCountries,this.start_timestamp=(i=e.liveBroadcastDetails)!=null&&i.startTimestamp?new Date(e.liveBroadcastDetails.startTimestamp):null,this.end_timestamp=(s=e.liveBroadcastDetails)!=null&&s.endTimestamp?new Date(e.liveBroadcastDetails.endTimestamp):null}};r(If,"PlayerMicroformat");If.type="PlayerMicroformat";var et=If;var Sf=class extends n{constructor(e){super(),this.title=new p(e.title),this.video_id=e.videoId,this.video_title=new p(e.videoTitle),this.short_view_count=new p(e.shortViewCountText),this.prefer_immediate_redirect=e.preferImmediateRedirect,this.count_down_secs_for_fullscreen=e.countDownSecsForFullscreen,this.published=new p(e.publishedTimeText),this.background=y.fromResponse(e.background),this.thumbnail_overlays=c.parseArray(e.thumbnailOverlays),this.author=new P(e.byline),this.cancel_button=c.parseItem(e.cancelButton,v),this.next_button=c.parseItem(e.nextButton,v),this.close_button=c.parseItem(e.closeButton,v)}};r(Sf,"PlayerOverlayAutoplay");Sf.type="PlayerOverlayAutoplay";var wy=Sf;var Ef=class extends n{constructor(e){super(),this.title=new p(e.title),this.subtitle=new p(e.subtitle)}};r(Ef,"PlayerOverlayVideoDetails");Ef.type="PlayerOverlayVideoDetails";var Ty=Ef;var kf=class extends n{constructor(e){super(),this.results=c.parseArray(e.results,[ux,lx]),this.title=new p(e.title).toString()}};r(kf,"WatchNextEndScreen");kf.type="WatchNextEndScreen";var vy=kf;var Cf=class extends n{constructor(e){super(),this.end_screen=c.parseItem(e.endScreen,vy),this.autoplay=c.parseItem(e.autoplay,wy),this.share_button=c.parseItem(e.shareButton,v),this.add_to_menu=c.parseItem(e.addToMenu,R),this.fullscreen_engagement=c.parseItem(e.fullscreenEngagement),this.actions=c.parseArray(e.actions),this.browser_media_session=c.parseItem(e.browserMediaSession),this.decorated_player_bar=c.parseItem(e.decoratedPlayerBarRenderer,Z_),this.video_details=c.parseItem(e.videoDetails,Ty)}};r(Cf,"PlayerOverlay");Cf.type="PlayerOverlay";var Iy=Cf;var Pf=class extends n{constructor(e){super(),this.id=e.playlistId,this.title=new p(e.title),this.subtitle=e.subtitle?new p(e.subtitle):null,this.stats=e.stats.map(i=>new p(i)),this.brief_stats=e.briefStats.map(i=>new p(i)),this.author=e.ownerText||e.ownerEndpoint?new P({...e.ownerText,navigationEndpoint:e.ownerEndpoint},e.ownerBadges,null):null,this.description=new p(e.descriptionText),this.num_videos=new p(e.numVideosText),this.view_count=new p(e.viewCountText),this.can_share=e.shareData.canShare,this.can_delete=e.editableDetails.canDelete,this.is_editable=e.isEditable,this.privacy=e.privacy,this.save_button=c.parseItem(e.saveButton),this.shuffle_play_button=c.parseItem(e.shufflePlayButton),this.menu=c.parseItem(e.moreActionsMenu),this.banner=c.parseItem(e.playlistHeaderBanner)}};r(Pf,"PlaylistHeader");Pf.type="PlaylistHeader";var Sy=Pf;var Nf=class extends n{constructor(e){super(),this.title=new p(e.playlistTitle),this.thumbnails=y.fromResponse(e.thumbnail),this.video_count=new p(e.playlistVideoCount),this.channel_name=new p(e.channelName),this.endpoint=new d(e.action)}};r(Nf,"PlaylistInfoCardContent");Nf.type="PlaylistInfoCardContent";var PI=Nf;var Af=class extends n{constructor(e){super(),this.title=e.title,this.description=e.description||null}};r(Af,"PlaylistMetadata");Af.type="PlaylistMetadata";var Ey=Af;var Rf=class extends n{constructor(e){super(),this.items=c.parseArray(e.items)}get contents(){return this.items}};r(Rf,"PlaylistSidebar");Rf.type="PlaylistSidebar";var NI=Rf;var Mf=class extends n{constructor(e){super(),this.stats=e.stats.map(i=>new p(i)),this.thumbnail_renderer=c.parseItem(e.thumbnailRenderer),this.title=new p(e.title),this.menu=c.parseItem(e.menu),this.endpoint=new d(e.navigationEndpoint),this.description=new p(e.description)}};r(Mf,"PlaylistSidebarPrimaryInfo");Mf.type="PlaylistSidebarPrimaryInfo";var ky=Mf;var Lf=class extends n{constructor(e){super(),this.owner=c.parseItem(e.videoOwner),this.button=c.parseItem(e.button)}};r(Lf,"PlaylistSidebarSecondaryInfo");Lf.type="PlaylistSidebarSecondaryInfo";var Cy=Lf;var Of=class extends n{constructor(e){super(),this.id=e.videoId,this.index=new p(e.index),this.title=new p(e.title),this.author=new P(e.shortBylineText),this.thumbnails=y.fromResponse(e.thumbnail),this.thumbnail_overlays=c.parseArray(e.thumbnailOverlays),this.set_video_id=e==null?void 0:e.setVideoId,this.endpoint=new d(e.navigationEndpoint),this.is_playable=e.isPlayable,this.menu=c.parseItem(e.menu,R),this.video_info=new p(e.videoInfo),this.accessibility_label=e.title.accessibility.accessibilityData.label,Reflect.has(e,"style")&&(this.style=e.style);let i=e.upcomingEventData&&Number(`${e.upcomingEventData.startTime}000`);i&&(this.upcoming=new Date(i)),this.duration={text:new p(e.lengthText).toString(),seconds:parseInt(e.lengthSeconds)}}get is_live(){var e;return((e=this.thumbnail_overlays.firstOfType(ir))==null?void 0:e.style)==="LIVE"}get is_upcoming(){var e;return((e=this.thumbnail_overlays.firstOfType(ir))==null?void 0:e.style)==="UPCOMING"}};r(Of,"PlaylistVideo");Of.type="PlaylistVideo";var ps=Of;var Df=class extends n{constructor(e){super(),this.id=e.playlistId,this.is_editable=e.isEditable,this.can_reorder=e.canReorder,this.videos=c.parseArray(e.contents)}};r(Df,"PlaylistVideoList");Df.type="PlaylistVideoList";var AI=Df;var Bf=class extends n{constructor(e){super(),this.choices=e.choices.map(i=>({text:new p(i.text),select_endpoint:i.selectServiceEndpoint?new d(i.selectServiceEndpoint):null,deselect_endpoint:i.deselectServiceEndpoint?new d(i.deselectServiceEndpoint):null,vote_ratio_if_selected:(i==null?void 0:i.voteRatioIfSelected)||null,vote_percentage_if_selected:new p(i.votePercentageIfSelected),vote_ratio_if_not_selected:(i==null?void 0:i.voteRatioIfSelected)||null,vote_percentage_if_not_selected:new p(i.votePercentageIfSelected),image:i.image?y.fromResponse(i.image):null})),Reflect.has(e,"type")&&(this.poll_type=e.type),Reflect.has(e,"totalVotes")&&(this.total_votes=new p(e.totalVotes)),Reflect.has(e,"liveChatPollId")&&(this.live_chat_poll_id=e.liveChatPollId)}};r(Bf,"Poll");Bf.type="Poll";var RI=Bf;var Yf=class extends bi{constructor(e){super(e)}};r(Yf,"Post");Yf.type="Post";var cs=Yf;var Vf=class extends n{constructor(e){super(),this.images=c.parseArray(e.images,jd)}};r(Vf,"PostMultiImage");Vf.type="PostMultiImage";var MI=Vf;var Uf=class extends n{constructor(e){super(),this.label=new p(e.label)}};r(Uf,"PremiereTrailerBadge");Uf.type="PremiereTrailerBadge";var LI=Uf;var Ff=class extends n{constructor(e){super(),this.title=new p(e.title),this.suppress_padding_disclaimer=!!e.suppressPaddingDisclaimer}};r(Ff,"ProductListHeader");Ff.type="ProductListHeader";var OI=Ff;var Wf=class extends n{constructor(e){super(),this.title=new p(e.title),this.accessibility_title=e.accessibilityTitle,this.thumbnail=y.fromResponse(e.thumbnail),this.price=e.price,this.endpoint=new d(e.onClickCommand),this.merchant_name=e.merchantName,this.stay_in_app=!!e.stayInApp,this.view_button=c.parseItem(e.viewButton,v)}};r(Wf,"ProductListItem");Wf.type="ProductListItem";var DI=Wf;var Gf=class extends n{constructor(e){super(),this.items=c.parseArray(e.items)}get contents(){return this.items}};r(Gf,"ProfileColumn");Gf.type="ProfileColumn";var BI=Gf;var jf=class extends n{constructor(e){super(),this.items=c.parseArray(e.items)}get contents(){return this.items}};r(jf,"ProfileColumnStats");jf.type="ProfileColumnStats";var YI=jf;var Hf=class extends n{constructor(e){super(),this.label=new p(e.label),this.value=new p(e.value)}};r(Hf,"ProfileColumnStatsEntry");Hf.type="ProfileColumnStatsEntry";var VI=Hf;var $f=class extends n{constructor(e){super(),this.title=new p(e.title),this.thumbnails=y.fromResponse(e.thumbnail)}};r($f,"ProfileColumnUserInfo");$f.type="ProfileColumnUserInfo";var UI=$f;var Kf=class extends n{constructor(e){super(),this.choices=e.choices.map(i=>({text:new p(i.text),is_correct:i.isCorrect})),this.total_votes=new p(e.totalVotes)}};r(Kf,"Quiz");Kf.type="Quiz";var FI=Kf;var qf=class extends n{constructor(e){super(),this.title=new p(e.title),this.subtitle=new p(e.subtitle),this.avatars=e.avatars.map(i=>new y(i)),this.button=c.parseItem(e.button,v),this.surface=e.surface}};r(qf,"RecognitionShelf");qf.type="RecognitionShelf";var WI=qf;var zf=class extends n{constructor(e){super(),this.id=e.videoId,this.title=new p(e.headline),this.thumbnails=y.fromResponse(e.thumbnail),this.views=new p(e.viewCountText),this.endpoint=new d(e.navigationEndpoint),this.accessibility_label=e.accessibility.accessibilityData.label}};r(zf,"ReelItem");zf.type="ReelItem";var ls=zf;var Xf=class extends n{constructor(e){super(),this.reel_title_text=new p(e.reelTitleText),this.timestamp_text=new p(e.timestampText),this.channel_title_text=new p(e.channelTitleText),this.channel_thumbnail=y.fromResponse(e.channelThumbnail),this.author=new P(e.channelNavigationEndpoint,void 0)}};r(Xf,"ReelPlayerHeader");Xf.type="ReelPlayerHeader";var Py=Xf;var Qf=class extends n{constructor(e){super(),this.like_button=c.parseItem(e.likeButton,Vr),this.reel_player_header_supported_renderers=c.parseItem(e.reelPlayerHeaderSupportedRenderers,Py),this.menu=c.parseItem(e.menu,R),this.next_item_button=c.parseItem(e.nextItemButton,v),this.prev_item_button=c.parseItem(e.prevItemButton,v),this.subscribe_button_renderer=c.parseItem(e.subscribeButtonRenderer,[v,xe]),this.style=e.style,this.view_comments_button=c.parseItem(e.viewCommentsButton,v),this.share_button=c.parseItem(e.shareButton,v),this.pivot_button=c.parseItem(e.pivotButton,dy),this.info_panel=c.parseItem(e.infoPanel,Sx)}};r(Qf,"ReelPlayerOverlay");Qf.type="ReelPlayerOverlay";var GI=Qf;var Jf=class extends n{constructor(e){super(),this.content=c.parseItem(e.content)}};r(Jf,"RelatedChipCloud");Jf.type="RelatedChipCloud";var Ny=Jf;var Zf=class extends n{constructor(e){super(),this.header=c.parseItem(e.header),this.contents=c.parseArray(e.contents)}};r(Zf,"RichGrid");Zf.type="RichGrid";var Ni=Zf;var em=class extends n{constructor(e){super(),this.content=c.parseItem(e.content)}};r(em,"RichItem");em.type="RichItem";var jI=em;var tm=class extends n{constructor(e){super(),this.title=new p(e.title),this.subtitle=new p(e.subtitle),Reflect.has(e,"titleStyle")&&(this.title_style=e.titleStyle.style),Reflect.has(e,"icon")&&(this.icon_type=e.icon.iconType)}};r(tm,"RichListHeader");tm.type="RichListHeader";var HI=tm;var im=class extends n{constructor(e){super(),this.thumbnail=y.fromResponse(e.thumbnail),this.title=new p(e.title),this.subtitle=new p(e.subtitle),this.call_to_action=new p(e.callToAction),Reflect.has(e,"callToActionIcon")&&(this.icon_type=e.callToActionIcon.iconType),this.endpoint=new d(e.endpoint)}};r(im,"RichMetadata");im.type="RichMetadata";var rm=im;var sm=class extends n{constructor(e){super(),this.contents=c.parseArray(e.contents)}};r(sm,"RichMetadataRow");sm.type="RichMetadataRow";var om=sm;var nm=class extends n{constructor(e){super(),this.content=c.parseItem(e.content)}};r(nm,"RichSection");nm.type="RichSection";var $I=nm;var am=class extends n{constructor(e){super(),this.title=new p(e.title),this.contents=c.parseArray(e.contents),Reflect.has(e,"endpoint")&&(this.endpoint=new d(e.endpoint)),Reflect.has(e,"subtitle")&&(this.subtitle=new p(e.subtitle))}};r(am,"RichShelf");am.type="RichShelf";var Ay=am;var pm=class extends n{constructor(e){super(),this.endpoint=new d(e.endpoint),this.search_button=c.parseItem(e.searchButton,v),this.clear_button=c.parseItem(e.clearButton,v),this.placeholder_text=new p(e.placeholderText)}};r(pm,"SearchBox");pm.type="SearchBox";var KI=pm;var cm=class extends n{constructor(e){super(),this.label=new p(e.label),this.endpoint=new d(e.endpoint||e.navigationEndpoint),this.tooltip=e.tooltip,Reflect.has(e,"status")&&(this.status=e.status)}get disabled(){return this.status==="FILTER_STATUS_DISABLED"}get selected(){return this.status==="FILTER_STATUS_SELECTED"}};r(cm,"SearchFilter");cm.type="SearchFilter";var Ry=cm;var lm=class extends n{constructor(e){super(),this.title=new p(e.title),this.filters=c.parseArray(e.filters,Ry)}};r(lm,"SearchFilterGroup");lm.type="SearchFilterGroup";var us=lm;var um=class extends n{constructor(e){super(),this.title=new p(e.title),this.groups=c.parseArray(e.groups,us)}};r(um,"SearchFilterOptionsDialog");um.type="SearchFilterOptionsDialog";var qI=um;var fm=class extends n{constructor(e){super(),this.chip_bar=c.parseItem(e.chipBar,Kr),this.search_filter_button=c.parseItem(e.searchFilterButton,v)}};r(fm,"SearchHeader");fm.type="SearchHeader";var My=fm;var mm=class extends n{constructor(e){super(),Reflect.has(e,"title")&&(this.title=new p(e.title)),Reflect.has(e,"groups")&&(this.groups=c.parseArray(e.groups,us)),Reflect.has(e,"button")&&(this.button=c.parseItem(e.button,se))}};r(mm,"SearchSubMenu");mm.type="SearchSubMenu";var Ly=mm;var hm=class extends n{constructor(e){super(),this.contents=c.parseArray(e.contents)}};r(hm,"SearchSuggestionsSection");hm.type="SearchSuggestionsSection";var zI=hm;var dm=class extends n{constructor(e){super(),this.contents=c.parseArray(e.contents)}};r(dm,"SecondarySearchContainer");dm.type="SecondarySearchContainer";var XI=dm;var _m=class extends n{constructor(e){super(),this.like_button=c.parseItem(e.likeButton,[se,v]),this.dislike_button=c.parseItem(e.dislikeButton,[se,v])}};r(_m,"SegmentedLikeDislikeButton");_m.type="SegmentedLikeDislikeButton";var dr=_m;var xm=class extends n{constructor(e){super(),Reflect.has(e,"title")&&(this.title=new p(e.title)),Reflect.has(e,"summary")&&(this.summary=new p(e.summary)),Reflect.has(e,"enableServiceEndpoint")&&(this.enable_endpoint=new d(e.enableServiceEndpoint)),Reflect.has(e,"disableServiceEndpoint")&&(this.disable_endpoint=new d(e.disableServiceEndpoint)),this.item_id=e.itemId}};r(xm,"SettingBoolean");xm.type="SettingBoolean";var QI=xm;var ym=class extends n{constructor(e){super(),this.title=new p(e.title),this.help_text=new p(e.helpText),this.enabled=e.enabled,this.disabled=e.disabled,this.id=e.id}};r(ym,"SettingsCheckbox");ym.type="SettingsCheckbox";var Oy=ym;var bm=class extends n{constructor(e){super(),this.title=new p(e.title),this.subtitle=new p(e.subtitle),this.enabled=e.enabled,this.enable_endpoint=new d(e.enableServiceEndpoint),this.disable_endpoint=new d(e.disableServiceEndpoint)}};r(bm,"SettingsSwitch");bm.type="SettingsSwitch";var fs=bm;var gm=class extends n{constructor(e){super(),this.title=new p(e.title),Reflect.has(e,"text")&&(this.text=new p(e.text).toString()),Reflect.has(e,"options")&&(this.options=c.parseArray(e.options,[fs,hi,Qr,Oy,P_]))}};r(gm,"SettingsOptions");gm.type="SettingsOptions";var ms=gm;var wm=class extends n{constructor(e){super(),this.title=new p(e.title),this.items=c.parseArray(e.items,yi)}get contents(){return this.items}};r(wm,"SettingsSidebar");wm.type="SettingsSidebar";var Dy=wm;var Tm=class extends n{constructor(e){super(),this.thumbnail=y.fromResponse(e.thumbnail),this.content=new p(e.content),this.published=new p(e.publishedTimeText),this.menu=c.parseItem(e.actionMenu,R),this.original_post=c.parseItem(e.originalPost,[bi,cs]),this.id=e.postId,this.endpoint=new d(e.navigationEndpoint),this.expand_button=c.parseItem(e.expandButton,v),this.author=new P(e.displayName,void 0)}};r(Tm,"SharedPost");Tm.type="SharedPost";var By=Tm;var vm=class extends n{constructor(e){super(),this.title=c.parseItem(e.title)}};r(vm,"SharePanelHeader");vm.type="SharePanelHeader";var Yy=vm;var Im=class extends n{constructor(e){super(),this.title=new p(e.title)}};r(Im,"SharePanelTitleV15");Im.type="SharePanelTitleV15";var JI=Im;var Sm=class extends n{constructor(e){super(),Reflect.has(e,"serviceEndpoint")?this.endpoint=new d(e.serviceEndpoint):Reflect.has(e,"navigationEndpoint")&&(this.endpoint=new d(e.navigationEndpoint)),this.service_name=e.serviceName,this.target_id=e.targetId,this.title=new p(e.title)}};r(Sm,"ShareTarget");Sm.type="ShareTarget";var Vy=Sm;var Em=class extends n{constructor(e){super(),this.title=new p(e.title),Reflect.has(e,"endpoint")&&(this.endpoint=new d(e.endpoint)),this.content=c.parseItem(e.content),Reflect.has(e,"icon")&&(this.icon_type=e.icon.iconType),Reflect.has(e,"menu")&&(this.menu=c.parseItem(e.menu)),Reflect.has(e,"playAllButton")&&(this.play_all_button=c.parseItem(e.playAllButton,v)),Reflect.has(e,"subtitle")&&(this.subtitle=new p(e.subtitle))}};r(Em,"Shelf");Em.type="Shelf";var hs=Em;var km=class extends n{constructor(e){var i;super(),this.entity_id=e.entityId,this.accessibility_text=e.accessibilityText,this.thumbnail=y.fromResponse(e.thumbnail),this.on_tap_endpoint=new d(e.onTap),this.menu_on_tap=new d(e.menuOnTap),this.index_in_collection=e.indexInCollection,this.menu_on_tap_a11y_label=e.menuOnTapA11yLabel,this.overlay_metadata={primary_text:e.overlayMetadata.primaryText?p.fromAttributed(e.overlayMetadata.primaryText):void 0,secondary_text:e.overlayMetadata.secondaryText?p.fromAttributed(e.overlayMetadata.secondaryText):void 0},(i=e.inlinePlayerData)!=null&&i.onVisible&&(this.inline_player_data=new d(e.inlinePlayerData.onVisible)),e.badge&&(this.badge=c.parseItem(e.badge,gi))}};r(km,"ShortsLockupView");km.type="ShortsLockupView";var ds=km;var Cm=class extends n{constructor(e){super(),this.corrected_query=new p(e.correctedQuery),this.original_query=new p(e.originalQuery),this.corrected_query_endpoint=new d(e.correctedQueryEndpoint),this.original_query_endpoint=new d(e.originalQueryEndpoint),this.search_instead_for=new p(e.searchInsteadFor),this.showing_results_for=new p(e.showingResultsFor)}};r(Cm,"ShowingResultsFor");Cm.type="ShowingResultsFor";var ZI=Cm;var Pm=class extends n{constructor(e){super(),this.image=y.fromResponse(e.image),this.title=new p(e.title),this.display_domain=new p(e.displayDomain),this.show_link_icon=e.showLinkIcon,this.call_to_action=new p(e.callToAction),this.endpoint=new d(e.command)}};r(Pm,"SimpleCardContent");Pm.type="SimpleCardContent";var eS=Pm;var Nm=class extends n{constructor(e){super(),this.message=new p(e.message),this.prominent=e.prominent}};r(Nm,"SimpleCardTeaser");Nm.type="SimpleCardTeaser";var tS=Nm;var Am=class extends n{constructor(e){super(),this.lines=e.lines.map(i=>new p(i)),this.style=e.layoutStyle}};r(Am,"SimpleTextSection");Am.type="SimpleTextSection";var iS=Am;var Rm=class extends n{constructor(e){super(),this.action_text=new p(e.actionText),this.nav_text=new p(e.navigationText),this.details=new p(e.detailsText),this.icon_type=e.icon.iconType,this.endpoint=new d(e.navigationEndpoint)}};r(Rm,"SingleActionEmergencySupport");Rm.type="SingleActionEmergencySupport";var rS=Rm;var Mm=class extends n{constructor(e){super(),this.title=e.title||"N/A",this.selected=!!e.selected,this.endpoint=new d(e.endpoint),this.content=c.parseItem(e.content,[de,ly,Ni])}};r(Mm,"Tab");Mm.type="Tab";var Se=Mm;var Lm=class extends n{constructor(e){super(),this.tabs=c.parseArray(e.tabs,Se)}};r(Lm,"SingleColumnBrowseResults");Lm.type="SingleColumnBrowseResults";var sS=Lm;var Om=class extends n{constructor(e){super(),this.contents=c.parse(e)}};r(Om,"SingleColumnMusicWatchNextResults");Om.type="SingleColumnMusicWatchNextResults";var oS=Om;var Dm=class extends n{constructor(e){super(),this.thumbnails=y.fromResponse(e.thumbnail),this.style=e.style}};r(Dm,"SingleHeroImage");Dm.type="SingleHeroImage";var nS=Dm;var Bm=class extends n{constructor(e){super(),this.thumbnail=y.fromResponse(e.thumbnail),this.title=new p(e.title),this.endpoint=new d(e.navigationEndpoint),this.subscribe_button=c.parseItem(e.subscribeButton,xe)}};r(Bm,"SlimOwner");Bm.type="SlimOwner";var aS=Bm;var Ym=class extends n{constructor(e){super(),this.title=new p(e.title),this.collapsed_subtitle=new p(e.collapsedSubtitle),this.expanded_subtitle=new p(e.expandedSubtitle),this.owner=c.parseItem(e.owner),this.description=new p(e.description),this.video_id=e.videoId,this.date=new p(e.dateText)}};r(Ym,"SlimVideoMetadata");Ym.type="SlimVideoMetadata";var pS=Ym;var Vm=class extends n{constructor(e){super(),this.start_at_option_label=new p(e.startAtOptionLabel)}};r(Vm,"StartAt");Vm.type="StartAt";var Uy=Vm;var Um=class extends n{constructor(e){super(),this.name=new p(e.name),this.is_selected=e.isSelected,this.endpoint=new d(e.navigationEndpoint)}};r(Um,"SubFeedOption");Um.type="SubFeedOption";var Fy=Um;var Fm=class extends n{constructor(e){super(),this.title=new p(e.title),this.options=c.parseArray(e.options,Fy)}};r(Fm,"SubFeedSelector");Fm.type="SubFeedSelector";var cS=Fm;var Wm=class extends n{constructor(e){super(),this.contents=c.parse(e)}};r(Wm,"Tabbed");Wm.type="Tabbed";var lS=Wm;var Gm=class extends n{constructor(e){super(),this.tabs=c.parseArray(e.tabs,Se)}};r(Gm,"TabbedSearchResults");Gm.type="TabbedSearchResults";var uS=Gm;var jm=class extends n{constructor(e){super(),this.title=new p(e.title),this.style=e.style}};r(jm,"TextHeader");jm.type="TextHeader";var fS=jm;var Hm=class extends n{constructor(e){super(),this.share_targets=c.parseArray(e.shareTargets,Vy)}};r(Hm,"ThirdPartyShareTargetSection");Hm.type="ThirdPartyShareTargetSection";var Wy=Hm;var $m=class extends n{constructor(e){super(),this.landscape=y.fromResponse(e.landscape),this.portrait=y.fromResponse(e.portrait)}};r($m,"ThumbnailLandscapePortrait");$m.type="ThumbnailLandscapePortrait";var mS=$m;var Km=class extends n{constructor(e){super(),this.text=new p(e.text).toString()}};r(Km,"ThumbnailOverlayEndorsement");Km.type="ThumbnailOverlayEndorsement";var hS=Km;var qm=class extends n{constructor(e){super(),this.text=new p(e.text),this.icon_type=e.icon.iconType}};r(qm,"ThumbnailOverlayHoverText");qm.type="ThumbnailOverlayHoverText";var dS=qm;var zm=class extends n{constructor(e){super(),this.text=new p(e.text).toString(),this.icon_type=e.icon.iconType}};r(zm,"ThumbnailOverlayInlineUnplayable");zm.type="ThumbnailOverlayInlineUnplayable";var _S=zm;var Xm=class extends n{constructor(e){super(),this.text=new p(e.text)}};r(Xm,"ThumbnailOverlayLoadingPreview");Xm.type="ThumbnailOverlayLoadingPreview";var xS=Xm;var Qm=class extends n{constructor(e){super(),this.text=new p(e.text).toString()}};r(Qm,"ThumbnailOverlayNowPlaying");Qm.type="ThumbnailOverlayNowPlaying";var yS=Qm;var Jm=class extends n{constructor(e){super(),this.hack=e.hack}};r(Jm,"ThumbnailOverlayPinking");Jm.type="ThumbnailOverlayPinking";var bS=Jm;var Zm=class extends n{constructor(e){super(),this.texts=e.texts.map(i=>new p(i))}};r(Zm,"ThumbnailOverlayPlaybackStatus");Zm.type="ThumbnailOverlayPlaybackStatus";var gS=Zm;var eh=class extends n{constructor(e){super(),this.percent_duration_watched=e.percentDurationWatched}};r(eh,"ThumbnailOverlayResumePlayback");eh.type="ThumbnailOverlayResumePlayback";var wS=eh;var th=class extends n{constructor(e){super(),this.text=new p(e.text),this.icon_type=e.icon.iconType}};r(th,"ThumbnailOverlaySidePanel");th.type="ThumbnailOverlaySidePanel";var TS=th;var ih=class extends n{constructor(e){super(),Reflect.has(e,"isToggled")&&(this.is_toggled=e.isToggled),this.icon_type={toggled:e.toggledIcon.iconType,untoggled:e.untoggledIcon.iconType},this.tooltip={toggled:e.toggledTooltip,untoggled:e.untoggledTooltip},e.toggledServiceEndpoint&&(this.toggled_endpoint=new d(e.toggledServiceEndpoint)),e.untoggledServiceEndpoint&&(this.untoggled_endpoint=new d(e.untoggledServiceEndpoint))}};r(ih,"ThumbnailOverlayToggleButton");ih.type="ThumbnailOverlayToggleButton";var vS=ih;var rh=class extends n{constructor(e){super(),this.visible_time_range_start_millis=e.visibleTimeRangeStartMillis,this.visible_time_range_end_millis=e.visibleTimeRangeEndMillis,this.decoration_time_millis=e.decorationTimeMillis,this.label=new p(e.label),this.icon=e.icon}};r(rh,"TimedMarkerDecoration");rh.type="TimedMarkerDecoration";var IS=rh;var sh=class extends n{constructor(e){super(),this.title=new p(e.title)}};r(sh,"TitleAndButtonListHeader");sh.type="TitleAndButtonListHeader";var SS=sh;var oh=class extends n{constructor(e){super(),this.text=new p(e.defaultText),this.toggled_text=new p(e.toggledText),this.icon_type=e.defaultIcon.iconType,this.toggled_icon_type=e.toggledIcon.iconType,this.default_endpoint=new d(e.defaultServiceEndpoint),this.toggled_endpoint=new d(e.toggledServiceEndpoint)}};r(oh,"ToggleMenuServiceItem");oh.type="ToggleMenuServiceItem";var ES=oh;var nh=class extends n{constructor(e){super(),this.promo_config={promo_id:e.promoConfig.promoId,impression_endpoints:e.promoConfig.impressionEndpoints.map(i=>new d(i)),accept:new d(e.promoConfig.acceptCommand),dismiss:new d(e.promoConfig.dismissCommand)},this.target_id=e.targetId,this.details=new p(e.detailsText),this.suggested_position=e.suggestedPosition.type,this.dismiss_stratedy=e.dismissStrategy.type,this.dwell_time_ms=parseInt(e.dwellTimeMs)}};r(nh,"Tooltip");nh.type="Tooltip";var kS=nh;var ah=class extends n{constructor(e){var i;super(),this.title=new p(e.title),this.avatar=y.fromResponse((i=e.thumbnail)!=null?i:e.avatar),this.subtitle=new p(e.subtitle),this.subscribe_button=c.parseItem(e.subscribeButton,xe),this.endpoint=new d(e.navigationEndpoint)}};r(ah,"TopicChannelDetails");ah.type="TopicChannelDetails";var CS=ah;var ph=class extends n{constructor(e){super(),this.tabs=c.parse(e.tabs),this.secondary_contents=c.parse(e.secondaryContents)}};r(ph,"TwoColumnBrowseResults");ph.type="TwoColumnBrowseResults";var Ot=ph;var ch=class extends n{constructor(e){super(),this.primary_contents=c.parse(e.primaryContents),this.secondary_contents=c.parse(e.secondaryContents)}};r(ch,"TwoColumnSearchResults");ch.type="TwoColumnSearchResults";var Gy=ch;var jy,Pg,lh=class extends n{constructor(e){var o,a,l,f,m;super(),jy.add(this),this.results=c.parseArray((o=e.results)==null?void 0:o.results.contents),this.secondary_results=c.parseArray((a=e.secondaryResults)==null?void 0:a.secondaryResults.results),this.conversation_bar=c.parseItem(e==null?void 0:e.conversationBar);let i=(l=e.playlist)==null?void 0:l.playlist;i&&(this.playlist={id:i.playlistId,title:i.title,author:(f=i.shortBylineText)!=null&&f.simpleText?new p(i.shortBylineText):new P(i.longBylineText),contents:c.parseArray(i.contents),current_index:i.currentIndex,is_infinite:!!i.isInfinite,menu:c.parseItem(i.menu,R)});let s=(m=e.autoplay)==null?void 0:m.autoplay;s&&(this.autoplay={sets:s.sets.map(x=>u(this,jy,"m",Pg).call(this,x))},s.modifiedSets&&(this.autoplay.modified_sets=s.modifiedSets.map(x=>u(this,jy,"m",Pg).call(this,x))),s.countDownSecs&&(this.autoplay.count_down_secs=s.countDownSecs))}};r(lh,"TwoColumnWatchNextResults");jy=new WeakSet,Pg=r(function(e){let i={autoplay_video:new d(e.autoplayVideo)};return e.nextButtonVideo&&(i.next_button_video=new d(e.nextButtonVideo)),i},"_TwoColumnWatchNextResults_parseAutoplaySet");lh.type="TwoColumnWatchNextResults";var Hy=lh;var uh=class extends n{constructor(e){if(super(),e.contents){let i=e.contents.find(s=>s.thirdPartyNetworkSection);i&&(this.third_party_network_section={share_target_container:c.parseItem(i.thirdPartyNetworkSection.shareTargetContainer,Wy),copy_link_container:c.parseItem(i.thirdPartyNetworkSection.copyLinkContainer,Qr),start_at_container:c.parseItem(i.thirdPartyNetworkSection.startAtContainer,Uy)})}this.header=c.parseItem(e.header,Yy),this.share_panel_version=e.sharePanelVersion,Reflect.has(e,"showLoadingSpinner")&&(this.show_loading_spinner=e.showLoadingSpinner)}};r(uh,"UnifiedSharePanel");uh.type="UnifiedSharePanel";var PS=uh;var fh=class extends n{constructor(e){super(),this.header=c.parseItem(e.header),this.call_to_action=c.parseItem(e.callToAction),this.sections=c.parseArray(e.sections),Reflect.has(e,"collapsedLabel")&&(this.collapsed_label=new p(e.collapsedLabel))}};r(fh,"UniversalWatchCard");fh.type="UniversalWatchCard";var $y=fh;var mh=class extends n{constructor(e){super(),this.message_title=new p(e.dialogMessageTitle),this.message_text=new p(e.dialogMessageText),this.action_button=c.parseItem(e.actionButton,v),this.dismiss_button=c.parseItem(e.dismissButton,v),this.is_visible=e.isVisible}};r(mh,"UpsellDialog");mh.type="UpsellDialog";var NS=mh;var hh=class extends n{constructor(e){super(),this.items=c.parseArray(e.items),this.collapsed_item_count=e.collapsedItemCount,this.collapsed_state_button_text=new p(e.collapsedStateButtonText)}get contents(){return this.items}};r(hh,"VerticalList");hh.type="VerticalList";var AS=hh;var dh=class extends n{constructor(e){super(),this.items=c.parseArray(e.items),this.view_all_text=new p(e.viewAllText),this.view_all_endpoint=new d(e.viewAllEndpoint)}get contents(){return this.items}};r(dh,"VerticalWatchCardList");dh.type="VerticalWatchCardList";var RS=dh;var _h=class extends n{constructor(e){super(),this.title=new p(e.videoTitle),this.channel_name=new p(e.channelName),this.view_count=new p(e.viewCountText),this.video_thumbnails=y.fromResponse(e.videoThumbnail),this.duration=new p(e.lengthString),this.endpoint=new d(e.action)}};r(_h,"VideoInfoCardContent");_h.type="VideoInfoCardContent";var MS=_h;var xh=class extends n{constructor(e){super(),this.subscription_button=e.subscriptionButton,this.subscriber_count=new p(e.subscriberCountText),this.author=new P({...e.title,navigationEndpoint:e.navigationEndpoint},e.badges,e.thumbnail)}};r(xh,"VideoOwner");xh.type="VideoOwner";var _s=xh;var yh=class extends n{constructor(e){super(),this.original_view_count=e.originalViewCount,this.short_view_count=new p(e.shortViewCount),this.extra_short_view_count=new p(e.extraShortViewCount),this.view_count=new p(e.viewCount)}};r(yh,"VideoViewCount");yh.type="VideoViewCount";var Ky=yh;var bh=class extends n{constructor(e){super(),this.title=new p(e.title),Reflect.has(e,"superTitleLink")&&(this.super_title_link=new p(e.superTitleLink)),this.view_count=c.parseItem(e.viewCount,Ky),this.badges=c.parseArray(e.badges,Ge),this.published=new p(e.dateText),this.relative_date=new p(e.relativeDateText),this.menu=c.parseItem(e.videoActions,R)}};r(bh,"VideoPrimaryInfo");bh.type="VideoPrimaryInfo";var qy=bh;var gh=class extends n{constructor(e){super(),this.owner=c.parseItem(e.owner,_s),this.description=new p(e.description),Reflect.has(e,"attributedDescription")&&(this.description=p.fromAttributed(e.attributedDescription)),this.subscribe_button=c.parseItem(e.subscribeButton,[xe,v]),this.metadata=c.parseItem(e.metadataRowContainer,Zx),this.show_more_text=new p(e.showMoreText),this.show_less_text=new p(e.showLessText),this.default_expanded=e.defaultExpanded,this.description_collapsed_lines=e.descriptionCollapsedLines}};r(gh,"VideoSecondaryInfo");gh.type="VideoSecondaryInfo";var wh=gh;var Th=class extends n{constructor(e){super(),this.title=new p(e.title),this.subtitle=new p(e.subtitle),this.duration={text:new p(e.lengthText).toString(),seconds:_e(e.lengthText.simpleText)},this.style=e.style}};r(Th,"WatchCardCompactVideo");Th.type="WatchCardCompactVideo";var zy=Th;var vh=class extends n{constructor(e){var i;super(),this.endpoint=new d(e.navigationEndpoint),this.call_to_action_button=c.parseItem(e.callToActionButton),this.hero_image=c.parseItem(e.heroImage),this.label=((i=e.lengthText)==null?void 0:i.accessibility.accessibilityData.label)||""}};r(vh,"WatchCardHeroVideo");vh.type="WatchCardHeroVideo";var LS=vh;var Ih=class extends n{constructor(e){super(),this.title=new p(e.title),this.title_endpoint=new d(e.titleNavigationEndpoint),this.subtitle=new p(e.subtitle),this.author=new P(e,e.titleBadge?[e.titleBadge]:null,e.avatar),this.author.name=this.title.toString(),this.style=e.style}};r(Ih,"WatchCardRichHeader");Ih.type="WatchCardRichHeader";var OS=Ih;var Sh=class extends n{constructor(e){super(),this.lists=c.parseArray(e.lists)}};r(Sh,"WatchCardSectionSequence");Sh.type="WatchCardSectionSequence";var DS=Sh;var Eh=class extends Ot{constructor(e){super(e)}};r(Eh,"WatchNextTabbedResults");Eh.type="WatchNextTabbedResults";var BS=Eh;var kh=class extends n{constructor(e){var i,s;super(),this.title=e.title,this.content=c.parseItem(e.content,de),this.endpoint=new d(e.navigationEndpoint),this.category_assets={asset_key:(i=e.categoryAssets)==null?void 0:i.assetKey,background_color:(s=e.categoryAssets)==null?void 0:s.backgroundColor},this.category_type=e.categoryType}};r(kh,"AnchoredSection");kh.type="AnchoredSection";var Xy=kh;var Ch,Ph=class extends n{constructor(e){super(),Ch.set(this,void 0),this.child_display_name=new p(e.childDisplayName),this.child_account_description=new p(e.childAccountDescription),this.avatar=y.fromResponse(e.avatar),this.block_button=c.parseItem(e.blockButton,[se]),this.blocked_entity_key=e.blockedEntityKey}async blockChannel(){if(!u(this,Ch,"f"))throw new g("An active caller must be provide to perform this operation.");let e=this.block_button;if(!e)throw new g("Block button was not found.",{child_display_name:this.child_display_name});if(e.is_toggled)throw new g("This channel is already blocked.",{child_display_name:this.child_display_name});return await e.endpoint.call(u(this,Ch,"f"),{parse:!1})}setActions(e){I(this,Ch,e,"f")}};r(Ph,"KidsBlocklistPickerItem");Ch=new WeakMap;Ph.type="KidsBlocklistPickerItem";var Qy=Ph;var Nh=class extends n{constructor(e){super(),this.title=new p(e.title),this.child_rows=c.parse(e.childRows,!0,[Qy]),this.done_button=c.parseItem(e.doneButton,[v]),this.successful_toast_action_message=new p(e.successfulToastActionMessage)}};r(Nh,"KidsBlocklistPicker");Nh.type="KidsBlocklistPicker";var YS=Nh;var Ah=class extends n{constructor(e){var i,s;super(),this.title=new p(e.title),this.category_assets={asset_key:(i=e.categoryAssets)==null?void 0:i.assetKey,background_color:(s=e.categoryAssets)==null?void 0:s.backgroundColor},this.category_type=e.categoryType,this.endpoint=new d(e.endpoint)}};r(Ah,"KidsCategoryTab");Ah.type="KidsCategoryTab";var Jy=Ah;var Rh=class extends n{constructor(e){super(),this.category_tabs=c.parseArray(e.categoryTabs,Jy),this.privacy_button=c.parseItem(e.privacyButtonRenderer,v)}};r(Rh,"KidsCategoriesHeader");Rh.type="kidsCategoriesHeader";var VS=Rh;var Mh=class extends n{constructor(e){super(),this.anchors=c.parseArray(e.anchors,Xy)}};r(Mh,"KidsHomeScreen");Mh.type="kidsHomeScreen";var US=Mh;var Dg={};Xe(Dg,{camelToSnake:()=>_r,createRuntimeClass:()=>XS,generateRuntimeClass:()=>Oh,generateTypescriptClass:()=>eb,inferType:()=>Zy,introspect:()=>Rg,isArrayType:()=>qS,isIgnoredKey:()=>zS,isMiscType:()=>KS,isRenderer:()=>Ag,isRendererList:()=>$S,mergeKeyInfo:()=>Lh,parse:()=>Og,toParser:()=>Lg,toTypeDeclaration:()=>Mg});var b1=new Set(["trackingParams","accessibility","accessibilityData"]),Ng={};function _r(t){return t.replace(/[A-Z]/g,e=>`_${e.toLowerCase()}`)}r(_r,"camelToSnake");function Zy(t,e){let i=!1;if(typeof e=="object"&&e!=null){if(i=Ag(e))return Ng[i]=Reflect.get(e,Reflect.ownKeys(e)[0]),{type:"renderer",renderers:[i],optional:!1};if(i=$S(e)){for(let[o,a]of Object.entries(i))Ng[o]=a;return{type:"array",array_type:"renderer",renderers:Object.keys(i),optional:!1}}if((i=KS(t,e))||(i=qS(e)))return i}let s=typeof e;return s==="object"?{type:"object",keys:Object.entries(e).map(([o,a])=>[o,Zy(o,a)]),optional:!1}:{type:"primitive",typeof:[s],optional:!1}}r(Zy,"inferType");function $S(t){let e=Array.isArray(t);return e&&t.length===0?!1:e&&t.every(s=>Ag(s))?Object.fromEntries(t.map(s=>{let o=Reflect.ownKeys(s)[0].toString();return[ys(o),s[o]]})):!1}r($S,"isRendererList");function KS(t,e){if(typeof e=="object"&&e!==null){if(t.endsWith("Endpoint")||t.endsWith("Command")||t==="endpoint")return{type:"misc",endpoint:new d(e),optional:!1,misc_type:"NavigationEndpoint"};if(Reflect.has(e,"simpleText")||Reflect.has(e,"runs")){let i=new p(e);return{type:"misc",misc_type:"Text",optional:!1,endpoint:i.endpoint,text:i.toString()}}if(Reflect.has(e,"thumbnails")&&Array.isArray(Reflect.get(e,"thumbnails")))return{type:"misc",misc_type:"Thumbnail",optional:!1}}return!1}r(KS,"isMiscType");function Ag(t){if(!(typeof t=="object"))return!1;let i=Reflect.ownKeys(t);if(i.length===1){let s=i[0].toString();if(s.endsWith("Renderer")||s.endsWith("Model"))return ys(s)}return!1}r(Ag,"isRenderer");function qS(t){if(!Array.isArray(t))return!1;if(t.length===0)return{type:"array",array_type:"primitive",items:{type:"primitive",typeof:["never"],optional:!1},optional:!1};let e=t.map(a=>typeof a);if(!e.every(a=>a===e[0]))return{type:"array",array_type:"primitive",items:{type:"primitive",typeof:["unknown"],optional:!1},optional:!1};let s=e[0];if(s!=="object")return{type:"array",array_type:"primitive",items:{type:"primitive",typeof:[s],optional:!1},optional:!1};let o=[];for(let a=0;a[f,Zy(f,m)]);if(a===0){o=l;continue}o=Lh(o,l).resolved_key_info}return{type:"array",array_type:"object",items:{type:"object",keys:o,optional:!1},optional:!1}}r(qS,"isArrayType");function g1(t){if(typeof t!="object"||t===null)throw new g("Generator: Cannot introspect non-object",{classdata:t});return Reflect.ownKeys(t).filter(i=>!zS(i)).filter(i=>typeof i=="string").map(i=>{let s=Reflect.get(t,i),o=Zy(i,s);return[i,o]})}r(g1,"introspectKeysFirstPass");function w1(t){var l;let i=t.filter(([,f])=>{var m;return f.type!=="misc"||!(f.misc_type==="NavigationEndpoint"||f.misc_type==="Text")?!1:((m=f.endpoint)==null?void 0:m.metadata.page_type)==="WEB_PAGE_TYPE_CHANNEL"}).sort(([,f],[,m])=>f.type!=="misc"||m.type!=="misc"||f.misc_type!=="Text"||m.misc_type!=="Text"?0:m.text.length-f.text.length),s=new Set,o=i[0],a;if(o){s.add(o[0]);let m=t.map(([w])=>w).filter(w=>w.endsWith("Badges")||w==="badges"),_=(l=m.filter(w=>w.startsWith("owner")||w.startsWith("author"))[0])!=null?l:m[0],b=t.find(([w])=>w===_),T=b?b[1].type==="array"&&b[1].array_type==="renderer"&&Reflect.has(b[1].renderers,"MetadataBadge"):!1;T&&_&&s.add(_),a={type:"misc",misc_type:"Author",optional:!1,params:[o[0],T?_:void 0]}}return a&&t.push(["author",a]),t.filter(([f])=>!s.has(f))}r(w1,"introspectKeysSecondPass");function T1(t){let e=g1(t);return w1(e)}r(T1,"introspect2");function Rg(t){let e=T1(t),i=new Map;for(let[,o]of e)if(o.type==="renderer"||o.type==="array"&&o.array_type==="renderer")for(let a of o.renderers){let l=Ng[a];l&&i.set(a,l)}let s=Array.from(i).filter(([o])=>!Dh(o));return{key_info:e,unimplemented_dependencies:s}}r(Rg,"introspect");function zS(t){return typeof t=="string"&&b1.has(t)}r(zS,"isIgnoredKey");function XS(t,e,i){var s,o;i({error_type:"class_not_found",classname:t,key_info:e});let a=(s=r(class extends n{static set key_info(l){I(this,s,new Map(l),"f",o)}static get key_info(){return[...u(this,s,"f",o).entries()]}constructor(l){super();let{key_info:f,unimplemented_dependencies:m}=Rg(l),{resolved_key_info:x,changed_keys:_}=Lh(a.key_info,f);_.length>0&&(a.key_info=x,i({error_type:"class_changed",classname:t,key_info:a.key_info,changed_keys:_}));for(let[T,w]of m)Oh(T,w,i);for(let[T,w]of f){let S=_r(T);w.type==="misc"&&w.misc_type==="NavigationEndpoint"&&(S="endpoint"),Reflect.set(this,S,Og(T,w,l))}}},"_a"),Lw(s,"node"),s.type=t,o={value:new Map},s);return a.key_info=e,Object.defineProperty(a,"name",{value:t,writable:!1}),a}r(XS,"createRuntimeClass");function Oh(t,e,i){let{key_info:s,unimplemented_dependencies:o}=Rg(e),a=XS(t,s,i);Bg(t,a);for(let[l,f]of o)Oh(l,f,i);return a}r(Oh,"generateRuntimeClass");function eb(t,e){let i=[],s=["super();"];for(let[o,a]of e){let l=_r(o);a.type==="misc"&&a.misc_type==="NavigationEndpoint"&&(l="endpoint"),i.push(`${l}${a.optional?"?":""}: ${Mg(a)};`),s.push(`this.${l} = ${Lg(o,a)};`)}return`class ${t} extends YTNode { static type = '${t}'; ${i.join(` `)} constructor(data: RawNode) { - ${n.join(` + ${s.join(` `)} } } -`}o(gg,"generateTypescriptClass");function wT(t,e){return`{ -${e.map(([i,n])=>`${" ".repeat((t+2)*2)}${un(i)}${n.optional?"?":""}: ${Dx(n,t+1)}`).join(`, +`}r(eb,"generateTypescriptClass");function FS(t,e){return`{ +${e.map(([i,s])=>`${" ".repeat((t+2)*2)}${_r(i)}${s.optional?"?":""}: ${Mg(s,t+1)}`).join(`, `)} -${" ".repeat((t+1)*2)}}`}o(wT,"toTypeDeclarationObject");function Dx(t,e=0){switch(t.type){case"renderer":return`${t.renderers.map(i=>`YTNodes.${i}`).join(" | ")} | null`;case"array":switch(t.array_type){case"renderer":return`ObservedArray<${t.renderers.map(i=>`YTNodes.${i}`).join(" | ")}> | null`;case"primitive":{let i=t.items.typeof;return t.items.optional&&!i.includes("undefined")&&i.push("undefined"),`${i.length===1?`${i[0]}`:`(${i.join(" | ")})`}[]`}case"object":return`${wT(e,t.items.keys)}[]`;default:throw new Error("Unreachable code reached! Switch missing case!")}case"object":return wT(e,t.keys);case"misc":switch(t.misc_type){case"Thumbnail":return"Thumbnail[]";default:return t.misc_type}case"primative":return t.typeof.join(" | ")}}o(Dx,"toTypeDeclaration");function TT(t,e,i,n){let r=[...i,n];return`{ -${e.map(([a,c])=>`${" ".repeat((t+2)*2)}${un(a)}: ${Bx(a,c,r,t+1)}`).join(`, +${" ".repeat((t+1)*2)}}`}r(FS,"toTypeDeclarationObject");function Mg(t,e=0){switch(t.type){case"renderer":return`${t.renderers.map(i=>`YTNodes.${i}`).join(" | ")} | null`;case"array":switch(t.array_type){case"renderer":return`ObservedArray<${t.renderers.map(i=>`YTNodes.${i}`).join(" | ")}> | null`;case"primitive":{let i=t.items.typeof;return t.items.optional&&!i.includes("undefined")&&i.push("undefined"),`${i.length===1?`${i[0]}`:`(${i.join(" | ")})`}[]`}case"object":return`${FS(e,t.items.keys)}[]`;default:throw new Error("Unreachable code reached! Switch missing case!")}case"object":return FS(e,t.keys);case"misc":switch(t.misc_type){case"Thumbnail":return"Thumbnail[]";default:return t.misc_type}case"primitive":return t.typeof.join(" | ")}}r(Mg,"toTypeDeclaration");function WS(t,e,i,s){let o=[...i,s];return`{ +${e.map(([a,l])=>`${" ".repeat((t+2)*2)}${_r(a)}: ${Lg(a,l,o,t+1)}`).join(`, `)} -${" ".repeat((t+1)*2)}}`}o(TT,"toParserObject");function Bx(t,e,i=["data"],n=1){let r="undefined";switch(e.type){case"renderer":r=`Parser.parseItem(${i.join(".")}.${t}, ${IT(e.renderers)})`;break;case"array":switch(e.array_type){case"renderer":r=`Parser.parse(${i.join(".")}.${t}, true, ${IT(e.renderers)})`;break;case"object":r=`${i.join(".")}.${t}.map((item: any) => (${TT(n,e.items.keys,[],"item")}))`;break;case"primitive":r=`${i.join(".")}.${t}`;break;default:throw new Error("Unreachable code reached! Switch missing case!")}break;case"object":r=TT(n,e.keys,i,t);break;case"misc":switch(e.misc_type){case"Thumbnail":r=`Thumbnail.fromResponse(${i.join(".")}.${t})`;break;case"Author":{let a=`new Author(${i.join(".")}.${e.params[0]}, ${e.params[1]?`${i.join(".")}.${e.params[1]}`:"undefined"})`;return e.optional?`Reflect.has(${i.join(".")}, '${e.params[0]}') ? ${a} : undefined`:a}default:r=`new ${e.misc_type}(${i.join(".")}.${t})`;break}if(r==="undefined")throw new Error("Unreachable code reached! Switch missing case!");break;case"primative":r=`${i.join(".")}.${t}`;break}return e.optional?`Reflect.has(${i.join(".")}, '${t}') ? ${r} : undefined`:r}o(Bx,"toParser");function IT(t){return t.length===1?`YTNodes.${t[0]}`:`[ ${t.map(e=>`YTNodes.${e}`).join(", ")} ]`}o(IT,"toParserValidTypes");function At(t,e){let i=t;for(let n of e)i=i[n];return i}o(At,"accessDataFromKeyPath");function kT(t,e){let i=t;for(let n of e)if(Reflect.has(i,n))i=i[n];else return!1;return!0}o(kT,"hasDataFromKeyPath");function ST(t,e,i,n,r){let a={},c=[...i,t];for(let[p,d]of n)a[p]=r?Lx(p,d,e,c):void 0;return a}o(ST,"parseObject");function Lx(t,e,i,n=["data"]){let r=!e.optional||kT({data:i},[...n,t]);switch(e.type){case"renderer":return r?ie(At({data:i},[...n,t]),e.renderers.map(a=>mf(a))):void 0;case"array":{switch(e.array_type){case"renderer":return r?We(At({data:i},[...n,t]),!0,e.renderers.map(a=>mf(a))):void 0;case"object":return r?At({data:i},[...n,t]).map((a,c)=>ST(`${c}`,i,[...n,t],e.items.keys,r)):void 0;case"primitive":return r?At({data:i},[...n,t]):void 0}throw new Error("Unreachable code reached! Switch missing case!")}case"object":return ST(t,i,n,e.keys,r);case"misc":switch(e.misc_type){case"NavigationEndpoint":return r?new g(At({data:i},[...n,t])):void 0;case"Text":return r?new u(At({data:i},[...n,t])):void 0;case"Thumbnail":return r?y.fromResponse(At({data:i},[...n,t])):void 0;case"Author":return!e.optional||kT({data:i},[...n,e.params[0]])?new D(At({data:i},[...n,e.params[0]]),e.params[1]?At({data:i},[...n,e.params[1]]):void 0):void 0}throw new Error("Unreachable code reached! Switch missing case!");case"primative":return At({data:i},[...n,t])}}o(Lx,"parse");function ff(t,e){let i=new Map,n=new Set(t.map(([v])=>v)),r=new Set(e.map(([v])=>v)),a=e.filter(([v])=>!n.has(v)),c=t.filter(([v])=>!r.has(v)),p=t.filter(([v])=>r.has(v)),d=new Map(e);for(let[v,w]of p){let k=d.get(v);if(!!k){if(w.type!==k.type){i.set(v,{type:"primative",typeof:["unknown"],optional:!0});continue}switch(w.type){case"object":{if(k.type!=="object")continue;let{resolved_key_info:S}=ff(w.keys,k.keys),P={type:"object",keys:S,optional:w.optional||k.optional};JSON.stringify(P)!==JSON.stringify(w)&&i.set(v,P)}break;case"renderer":{if(k.type!=="renderer")continue;let S=Object.assign(Object.assign({},w.renderers),k.renderers),P=w.optional||k.optional,A={type:"renderer",renderers:S,optional:P};JSON.stringify(Object.assign(Object.assign({},A),{renderers:Object.keys(A.renderers)}))!==JSON.stringify(Object.assign(Object.assign({},w),{renderers:Object.keys(w.renderers)}))&&i.set(v,A)}break;case"array":{if(k.type!=="array")continue;switch(w.array_type){case"renderer":{if(k.array_type!=="renderer"){i.set(v,{type:"array",array_type:"primitive",items:{type:"primative",typeof:["unknown"],optional:!0},optional:!0});continue}let S=Object.assign(Object.assign({},w.renderers),k.renderers),P=w.optional||k.optional,A={type:"array",array_type:"renderer",renderers:S,optional:P};JSON.stringify(Object.assign(Object.assign({},A),{renderers:Object.keys(A.renderers)}))!==JSON.stringify(Object.assign(Object.assign({},w),{renderers:Object.keys(w.renderers)}))&&i.set(v,A)}break;case"object":{if(k.array_type==="primitive"&&k.items.typeof.length==1&&k.items.typeof[0]==="never")continue;if(k.array_type!=="object"){i.set(v,{type:"array",array_type:"primitive",items:{type:"primative",typeof:["unknown"],optional:!0},optional:!0});continue}let{resolved_key_info:S}=ff(w.items.keys,k.items.keys),P={type:"array",array_type:"object",items:{type:"object",keys:S,optional:w.items.optional||k.items.optional},optional:w.optional||k.optional};JSON.stringify(P)!==JSON.stringify(w)&&i.set(v,P)}break;case"primitive":{if(w.items.typeof.includes("never")&&k.array_type==="object"){i.set(v,k);continue}if(k.array_type!=="primitive"){i.set(v,{type:"array",array_type:"primitive",items:{type:"primative",typeof:["unknown"],optional:!0},optional:!0});continue}let S=new Set([...k.items.typeof,...w.items.typeof]);S.size>1&&S.has("never")&&S.delete("never");let P={type:"array",array_type:"primitive",items:{type:"primative",typeof:Array.from(S),optional:w.items.optional||k.items.optional},optional:w.optional||k.optional};JSON.stringify(P)!==JSON.stringify(w)&&i.set(v,P)}break;default:throw new Error("Unreachable code reached! Switch missing case!")}}break;case"misc":{if(k.type!=="misc")continue;switch(w.misc_type!==k.misc_type&&i.set(v,{type:"primative",typeof:["unknown"],optional:!0}),w.misc_type){case"Author":{if(k.misc_type!=="Author")break;let S=w.params[1]||k.params[1],P=w.optional||k.optional,A={type:"misc",misc_type:"Author",optional:P,params:[k.params[0],S]};JSON.stringify(A)!==JSON.stringify(w)&&i.set(v,A)}break}}break;case"primative":{if(k.type!=="primative")continue;let S={type:"primative",typeof:Array.from(new Set([...k.typeof,...w.typeof])),optional:w.optional||k.optional};JSON.stringify(S)!==JSON.stringify(w)&&i.set(v,S)}break}}}for(let[v,w]of a)i.set(v,Object.assign(Object.assign({},w),{optional:!0}));for(let[v,w]of c)i.set(v,Object.assign(Object.assign({},w),{optional:!0}));let _=t.filter(([v])=>!i.has(v));return{resolved_key_info:[...new Map([..._,...i]).entries()],changed_keys:[...i.entries()]}}o(ff,"mergeKeyInfo");var mo=class extends s{constructor(e){var i,n,r;super(),this.contents=Ve(e.contents),Array.isArray(e.continuations)&&(this.continuation=(r=(n=(i=e.continuations)===null||i===void 0?void 0:i.at(0))===null||n===void 0?void 0:n.nextContinuationData)===null||r===void 0?void 0:r.continuation)}};o(mo,"ItemSectionContinuation");mo.type="itemSectionContinuation";var Ti=class extends s{constructor(e){super(),this.endpoint=new g(e.endpoint)}};o(Ti,"NavigateAction");Ti.type="navigateAction";var ho=class extends s{constructor(e){super(),this.miniplayer_command=new g(e.miniplayerCommand),this.show_premium_branding=e.showPremiumBranding}};o(ho,"ShowMiniplayerCommand");ho.type="showMiniplayerCommand";var Ii=class extends s{constructor(e){super(),this.target_id=e.targetId,this.contents=We(e.continuationItems,!0),this.slot=e==null?void 0:e.slot}};o(Ii,"ReloadContinuationItemsCommand");Ii.type="reloadContinuationItemsCommand";var _o=class extends s{constructor(e){var i,n,r,a,c,p;super(),this.contents=We(e.contents,!0),this.continuation=((r=(n=(i=e.continuations)===null||i===void 0?void 0:i[0])===null||n===void 0?void 0:n.nextContinuationData)===null||r===void 0?void 0:r.continuation)||((p=(c=(a=e.continuations)===null||a===void 0?void 0:a[0])===null||c===void 0?void 0:c.reloadContinuationData)===null||p===void 0?void 0:p.continuation)||null}};o(_o,"SectionListContinuation");_o.type="sectionListContinuation";var go=class extends s{constructor(e){var i;super(),this.contents=We(e.contents,!0),this.continuation=((i=e.continuations)===null||i===void 0?void 0:i[0].nextContinuationData.continuation)||null}};o(go,"MusicPlaylistShelfContinuation");go.type="musicPlaylistShelfContinuation";var xo=class extends s{constructor(e){var i,n,r,a;super(),this.contents=Ve(e.contents),this.continuation=((n=(i=e.continuations)===null||i===void 0?void 0:i[0].nextContinuationData)===null||n===void 0?void 0:n.continuation)||((a=(r=e.continuations)===null||r===void 0?void 0:r[0].reloadContinuationData)===null||a===void 0?void 0:a.continuation)||null}};o(xo,"MusicShelfContinuation");xo.type="musicShelfContinuation";var vo=class extends s{constructor(e){var i;super(),this.items=We(e.items,!0),this.continuation=((i=e.continuations)===null||i===void 0?void 0:i[0].nextContinuationData.continuation)||null}get contents(){return this.items}};o(vo,"GridContinuation");vo.type="gridContinuation";var yo=class extends s{constructor(e){var i,n,r,a,c,p;super(),this.contents=Ve(e.contents),this.continuation=((r=(n=(i=e.continuations)===null||i===void 0?void 0:i[0])===null||n===void 0?void 0:n.nextContinuationData)===null||r===void 0?void 0:r.continuation)||((p=(c=(a=e.continuations)===null||a===void 0?void 0:a[0])===null||c===void 0?void 0:c.nextRadioContinuationData)===null||p===void 0?void 0:p.continuation)||null}};o(yo,"PlaylistPanelContinuation");yo.type="playlistPanelContinuation";var ln=class extends s{constructor(e){var i,n,r;super(),this.continuation_type=e.type,this.timeout_ms=(i=e.continuation)===null||i===void 0?void 0:i.timeoutMs,this.time_until_last_message_ms=(n=e.continuation)===null||n===void 0?void 0:n.timeUntilLastMessageMsec,this.token=(r=e.continuation)===null||r===void 0?void 0:r.continuation}};o(ln,"Continuation");ln.type="continuation";var ki=class extends s{constructor(e){var i,n,r,a,c,p,d,_;super(),this.actions=We((i=e.actions)===null||i===void 0?void 0:i.map(v=>(delete v.clickTrackingParams,v)),!0)||X([]),this.action_panel=ie(e.actionPanel),this.item_list=ie(e.itemList,c_),this.header=ie(e.header,l_),this.participants_list=ie(e.participantsList,d_),this.popout_message=ie(e.popoutMessage,gi),this.emojis=((n=e.emojis)===null||n===void 0?void 0:n.map(v=>({emoji_id:v.emojiId,shortcuts:v.shortcuts,search_terms:v.searchTerms,image:y.fromResponse(v.image),is_custom_emoji:v.isCustomEmoji})))||[];let f,x;!((r=e.continuations)===null||r===void 0)&&r[0].timedContinuationData?(x="timed",f=(a=e.continuations)===null||a===void 0?void 0:a[0].timedContinuationData):!((c=e.continuations)===null||c===void 0)&&c[0].invalidationContinuationData?(x="invalidation",f=(p=e.continuations)===null||p===void 0?void 0:p[0].invalidationContinuationData):!((d=e.continuations)===null||d===void 0)&&d[0].liveChatReplayContinuationData&&(x="replay",f=(_=e.continuations)===null||_===void 0?void 0:_[0].liveChatReplayContinuationData),this.continuation=new ln({continuation:f,type:x}),this.viewer_name=e.viewerName}};o(ki,"LiveChatContinuation");ki.type="liveChatContinuation";var Ht=class extends s{constructor(e){super(),this.request=e.request,this.token=e.token}};o(Ht,"ContinuationCommand");Ht.type="ContinuationCommand";var vg,yg=class{constructor(e,i){var n,r,a,c,p,d,_,f;if(vg.set(this,void 0),i&&E(this,vg,i,"f"),this.itag=e.itag,this.mime_type=e.mimeType,this.is_type_otf=e.type==="FORMAT_STREAM_TYPE_OTF",this.bitrate=e.bitrate,this.average_bitrate=e.averageBitrate,Reflect.has(e,"width")&&Reflect.has(e,"height")&&(this.width=parseInt(e.width),this.height=parseInt(e.height)),Reflect.has(e,"projectionType")&&(this.projection_type=e.projectionType),Reflect.has(e,"stereoLayout")&&(this.stereo_layout=(n=e.stereoLayout)===null||n===void 0?void 0:n.replace("STEREO_LAYOUT_","")),Reflect.has(e,"initRange")&&(this.init_range={start:parseInt(e.initRange.start),end:parseInt(e.initRange.end)}),Reflect.has(e,"indexRange")&&(this.index_range={start:parseInt(e.indexRange.start),end:parseInt(e.indexRange.end)}),this.last_modified=new Date(Math.floor(parseInt(e.lastModified)/1e3)),Reflect.has(e,"contentLength")&&(this.content_length=parseInt(e.contentLength)),Reflect.has(e,"quality")&&(this.quality=e.quality),Reflect.has(e,"qualityLabel")&&(this.quality_label=e.qualityLabel),Reflect.has(e,"fps")&&(this.fps=e.fps),Reflect.has(e,"url")&&(this.url=e.url),Reflect.has(e,"cipher")&&(this.cipher=e.cipher),Reflect.has(e,"signatureCipher")&&(this.signature_cipher=e.signatureCipher),Reflect.has(e,"audioQuality")&&(this.audio_quality=e.audioQuality),this.approx_duration_ms=parseInt(e.approxDurationMs),Reflect.has(e,"audioSampleRate")&&(this.audio_sample_rate=parseInt(e.audioSampleRate)),Reflect.has(e,"audioChannels")&&(this.audio_channels=e.audioChannels),Reflect.has(e,"loudnessDb")&&(this.loudness_db=e.loudnessDb),Reflect.has(e,"spatialAudioType")&&(this.spatial_audio_type=(r=e.spatialAudioType)===null||r===void 0?void 0:r.replace("SPATIAL_AUDIO_TYPE_","")),Reflect.has(e,"maxDvrDurationSec")&&(this.max_dvr_duration_sec=e.maxDvrDurationSec),Reflect.has(e,"targetDurationSec")&&(this.target_duration_dec=e.targetDurationSec),this.has_audio=!!e.audioBitrate||!!e.audioQuality,this.has_video=!!e.qualityLabel,this.has_text=!!e.captionTrack,Reflect.has(e,"xtags")&&(this.xtags=e.xtags),Reflect.has(e,"fairPlayKeyUri")&&(this.fair_play_key_uri=e.fairPlayKeyUri),Reflect.has(e,"drmFamilies")&&(this.drm_families=e.drmFamilies),Reflect.has(e,"drmTrackType")&&(this.drm_track_type=e.drmTrackType),Reflect.has(e,"distinctParams")&&(this.distinct_params=e.distinctParams),Reflect.has(e,"trackAbsoluteLoudnessLkfs")&&(this.track_absolute_loudness_lkfs=e.trackAbsoluteLoudnessLkfs),Reflect.has(e,"highReplication")&&(this.high_replication=e.highReplication),Reflect.has(e,"colorInfo")&&(this.color_info={primaries:(a=e.colorInfo.primaries)===null||a===void 0?void 0:a.replace("COLOR_PRIMARIES_",""),transfer_characteristics:(c=e.colorInfo.transferCharacteristics)===null||c===void 0?void 0:c.replace("COLOR_TRANSFER_CHARACTERISTICS_",""),matrix_coefficients:(p=e.colorInfo.matrixCoefficients)===null||p===void 0?void 0:p.replace("COLOR_MATRIX_COEFFICIENTS_","")}),Reflect.has(e,"audioTrack")&&(this.audio_track={audio_is_default:e.audioTrack.audioIsDefault,display_name:e.audioTrack.displayName,id:e.audioTrack.id}),Reflect.has(e,"captionTrack")&&(this.caption_track={display_name:e.captionTrack.displayName,vss_id:e.captionTrack.vssId,language_code:e.captionTrack.languageCode,kind:e.captionTrack.kind,id:e.captionTrack.id}),this.has_audio||this.has_text){let x=new URLSearchParams(this.cipher||this.signature_cipher),w=(d=new URLSearchParams(x.get("url")||this.url).get("xtags"))===null||d===void 0?void 0:d.split(":");if(this.language=((_=w==null?void 0:w.find(k=>k.startsWith("lang=")))===null||_===void 0?void 0:_.split("=")[1])||null,this.has_audio){this.is_drc=!!e.isDrc||!!(w!=null&&w.includes("drc=1"));let k=(f=w==null?void 0:w.find(S=>S.startsWith("acont=")))===null||f===void 0?void 0:f.split("=")[1];this.is_dubbed=k==="dubbed",this.is_descriptive=k==="descriptive",this.is_secondary=k==="secondary",this.is_original=k==="original"||!this.is_dubbed&&!this.is_descriptive&&!this.is_secondary&&!this.is_drc}this.has_text&&!this.language&&this.caption_track&&(this.language=this.caption_track.language_code)}}decipher(e){if(!e)throw new b("Cannot decipher format, this session appears to have no valid player.");return e.decipher(this.url,this.signature_cipher,this.cipher,m(this,vg,"f"))}};o(yg,"Format");vg=new WeakMap;var bg=yg;var Si=class{constructor(e){this.id=e.videoId,this.channel_id=e.channelId,this.title=e.title,this.duration=parseInt(e.lengthSeconds),this.keywords=e.keywords,this.is_owner_viewing=!!e.isOwnerViewing,this.short_description=e.shortDescription,this.thumbnail=y.fromResponse(e.thumbnail),this.allow_ratings=!!e.allowRatings,this.view_count=parseInt(e.viewCount),this.author=e.author,this.is_private=!!e.isPrivate,this.is_live=!!e.isLive,this.is_live_content=!!e.isLiveContent,this.is_live_dvr_enabled=!!e.isLiveDvrEnabled,this.is_low_latency_live_stream=!!e.isLowLatencyLiveStream,this.is_upcoming=!!e.isUpcoming,this.is_post_live_dvr=!!e.isPostLiveDvr,this.is_crawlable=!!e.isCrawlable,this.live_chunk_readahead=e.liveChunkReadahead}};o(Si,"VideoDetails");var cn="Parser",fk=new Set(["AdSlot","DisplayAd","SearchPyv","MealbarPromo","PrimetimePromo","BackgroundPromo","PromotedSparklesWeb","RunAttestationCommand","CompactPromotedVideo","BrandVideoShelf","BrandVideoSingleton","StatementBanner","GuideSigninPromo","AdsEngagementPanelContent","MiniGameCardView"]),Wx=new Map(Object.entries(on)),AT=new Map,pn=null,Ci=o(t=>{var{classname:e}=t,i=L0(t,["classname"]);switch(i.error_type){case"parse":i.error instanceof Error&&j.warn(cn,new b(`Something went wrong at ${e}! -This is a bug, please report it at ${W.shim.info.bugs_url}`,{stack:i.error.stack,classdata:JSON.stringify(i.classdata,null,2)}));break;case"typecheck":j.warn(cn,new st(`Type mismatch, got ${e} expected ${Array.isArray(i.expected)?i.expected.join(" | "):i.expected}.`,i.classdata));break;case"mutation_data_missing":j.warn(cn,new b(`Mutation data required for processing ${e}, but none found. -This is a bug, please report it at ${W.shim.info.bugs_url}`));break;case"mutation_data_invalid":j.warn(cn,new b(`Mutation data missing or invalid for ${i.failed} out of ${i.total} MusicMultiSelectMenuItems. The titles of the failed items are: ${i.titles.join(", ")}. -This is a bug, please report it at ${W.shim.info.bugs_url}`));break;case"class_not_found":j.warn(cn,new b(`${e} not found! -This is a bug, want to help us fix it? Follow the instructions at ${W.shim.info.repo_url}/blob/main/docs/updating-the-parser.md or report it at ${W.shim.info.bugs_url}! +${" ".repeat((t+1)*2)}}`}r(WS,"toParserObject");function Lg(t,e,i=["data"],s=1){let o="undefined";switch(e.type){case"renderer":o=`Parser.parseItem(${i.join(".")}.${t}, ${GS(e.renderers)})`;break;case"array":switch(e.array_type){case"renderer":o=`Parser.parse(${i.join(".")}.${t}, true, ${GS(e.renderers)})`;break;case"object":o=`${i.join(".")}.${t}.map((item: any) => (${WS(s,e.items.keys,[],"item")}))`;break;case"primitive":o=`${i.join(".")}.${t}`;break;default:throw new Error("Unreachable code reached! Switch missing case!")}break;case"object":o=WS(s,e.keys,i,t);break;case"misc":switch(e.misc_type){case"Thumbnail":o=`Thumbnail.fromResponse(${i.join(".")}.${t})`;break;case"Author":{let a=`new Author(${i.join(".")}.${e.params[0]}, ${e.params[1]?`${i.join(".")}.${e.params[1]}`:"undefined"})`;return e.optional?`Reflect.has(${i.join(".")}, '${e.params[0]}') ? ${a} : undefined`:a}default:o=`new ${e.misc_type}(${i.join(".")}.${t})`;break}if(o==="undefined")throw new Error("Unreachable code reached! Switch missing case!");break;case"primitive":o=`${i.join(".")}.${t}`;break}return e.optional?`Reflect.has(${i.join(".")}, '${t}') ? ${o} : undefined`:o}r(Lg,"toParser");function GS(t){return t.length===1?`YTNodes.${t[0]}`:`[ ${t.map(e=>`YTNodes.${e}`).join(", ")} ]`}r(GS,"toParserValidTypes");function Dt(t,e){let i=t;for(let s of e)i=i[s];return i}r(Dt,"accessDataFromKeyPath");function jS(t,e){let i=t;for(let s of e)if(Reflect.has(i,s))i=i[s];else return!1;return!0}r(jS,"hasDataFromKeyPath");function HS(t,e,i,s,o){let a={},l=[...i,t];for(let[f,m]of s)a[f]=o?Og(f,m,e,l):void 0;return a}r(HS,"parseObject");function Og(t,e,i,s=["data"]){let o=!e.optional||jS({data:i},[...s,t]);switch(e.type){case"renderer":return o?q(Dt({data:i},[...s,t]),e.renderers.map(a=>xs(a))):void 0;case"array":switch(e.array_type){case"renderer":return o?De(Dt({data:i},[...s,t]),!0,e.renderers.map(a=>xs(a))):void 0;case"object":return o?Dt({data:i},[...s,t]).map((a,l)=>HS(`${l}`,i,[...s,t],e.items.keys,o)):void 0;case"primitive":return o?Dt({data:i},[...s,t]):void 0;default:throw new Error("Unreachable code reached! Switch missing case!")}case"object":return HS(t,i,s,e.keys,o);case"misc":switch(e.misc_type){case"NavigationEndpoint":return o?new d(Dt({data:i},[...s,t])):void 0;case"Text":return o?new p(Dt({data:i},[...s,t])):void 0;case"Thumbnail":return o?y.fromResponse(Dt({data:i},[...s,t])):void 0;case"Author":return!e.optional||jS({data:i},[...s,e.params[0]])?new P(Dt({data:i},[...s,e.params[0]]),e.params[1]?Dt({data:i},[...s,e.params[1]]):void 0):void 0;default:throw new Error("Unreachable code reached! Switch missing case!")}case"primitive":return Dt({data:i},[...s,t])}}r(Og,"parse");function Lh(t,e){let i=new Map,s=new Set(t.map(([T])=>T)),o=new Set(e.map(([T])=>T)),a=e.filter(([T])=>!s.has(T)),l=t.filter(([T])=>!o.has(T)),f=t.filter(([T])=>o.has(T)),m=new Map(e);for(let[T,w]of f){let S=m.get(T);if(!!S){if(w.type!==S.type){i.set(T,{type:"primitive",typeof:["unknown"],optional:!0});continue}switch(w.type){case"object":{if(S.type!=="object")continue;let{resolved_key_info:E}=Lh(w.keys,S.keys),C={type:"object",keys:E,optional:w.optional||S.optional};JSON.stringify(C)!==JSON.stringify(w)&&i.set(T,C)}break;case"renderer":{if(S.type!=="renderer")continue;let E={...w.renderers,...S.renderers},C=w.optional||S.optional,k={type:"renderer",renderers:E,optional:C};JSON.stringify({...k,renderers:Object.keys(k.renderers)})!==JSON.stringify({...w,renderers:Object.keys(w.renderers)})&&i.set(T,k)}break;case"array":{if(S.type!=="array")continue;switch(w.array_type){case"renderer":{if(S.array_type!=="renderer"){i.set(T,{type:"array",array_type:"primitive",items:{type:"primitive",typeof:["unknown"],optional:!0},optional:!0});continue}let E={...w.renderers,...S.renderers},C=w.optional||S.optional,k={type:"array",array_type:"renderer",renderers:E,optional:C};JSON.stringify({...k,renderers:Object.keys(k.renderers)})!==JSON.stringify({...w,renderers:Object.keys(w.renderers)})&&i.set(T,k)}break;case"object":{if(S.array_type==="primitive"&&S.items.typeof.length==1&&S.items.typeof[0]==="never")continue;if(S.array_type!=="object"){i.set(T,{type:"array",array_type:"primitive",items:{type:"primitive",typeof:["unknown"],optional:!0},optional:!0});continue}let{resolved_key_info:E}=Lh(w.items.keys,S.items.keys),C={type:"array",array_type:"object",items:{type:"object",keys:E,optional:w.items.optional||S.items.optional},optional:w.optional||S.optional};JSON.stringify(C)!==JSON.stringify(w)&&i.set(T,C)}break;case"primitive":{if(w.items.typeof.includes("never")&&S.array_type==="object"){i.set(T,S);continue}if(S.array_type!=="primitive"){i.set(T,{type:"array",array_type:"primitive",items:{type:"primitive",typeof:["unknown"],optional:!0},optional:!0});continue}let E=new Set([...S.items.typeof,...w.items.typeof]);E.size>1&&E.has("never")&&E.delete("never");let C={type:"array",array_type:"primitive",items:{type:"primitive",typeof:Array.from(E),optional:w.items.optional||S.items.optional},optional:w.optional||S.optional};JSON.stringify(C)!==JSON.stringify(w)&&i.set(T,C)}break;default:throw new Error("Unreachable code reached! Switch missing case!")}break}case"misc":{if(S.type!=="misc")continue;switch(w.misc_type!==S.misc_type&&i.set(T,{type:"primitive",typeof:["unknown"],optional:!0}),w.misc_type){case"Author":{if(S.misc_type!=="Author")break;let E=w.params[1]||S.params[1],C=w.optional||S.optional,k={type:"misc",misc_type:"Author",optional:C,params:[S.params[0],E]};JSON.stringify(k)!==JSON.stringify(w)&&i.set(T,k)}break}}break;case"primitive":{if(S.type!=="primitive")continue;let E={type:"primitive",typeof:Array.from(new Set([...S.typeof,...w.typeof])),optional:w.optional||S.optional};JSON.stringify(E)!==JSON.stringify(w)&&i.set(T,E)}break}}}for(let[T,w]of a)i.set(T,{...w,optional:!0});for(let[T,w]of l)i.set(T,{...w,optional:!0});let x=t.filter(([T])=>!i.has(T));return{resolved_key_info:[...new Map([...x,...i]).entries()],changed_keys:[...i.entries()]}}r(Lh,"mergeKeyInfo");var bs=class extends n{constructor(e){var i,s,o;super(),this.contents=Ce(e.contents),Array.isArray(e.continuations)&&(this.continuation=(o=(s=(i=e.continuations)==null?void 0:i.at(0))==null?void 0:s.nextContinuationData)==null?void 0:o.continuation)}};r(bs,"ItemSectionContinuation");bs.type="itemSectionContinuation";var Ai=class extends n{constructor(e){super(),this.endpoint=new d(e.endpoint)}};r(Ai,"NavigateAction");Ai.type="navigateAction";var gs=class extends n{constructor(e){super(),this.miniplayer_command=new d(e.miniplayerCommand),this.show_premium_branding=e.showPremiumBranding}};r(gs,"ShowMiniplayerCommand");gs.type="showMiniplayerCommand";var Ri=class extends n{constructor(e){super(),this.target_id=e.targetId,this.contents=De(e.continuationItems,!0),this.slot=e==null?void 0:e.slot}};r(Ri,"ReloadContinuationItemsCommand");Ri.type="reloadContinuationItemsCommand";var ws=class extends n{constructor(e){var i,s,o,a,l,f;super(),this.contents=De(e.contents,!0),this.continuation=((o=(s=(i=e.continuations)==null?void 0:i[0])==null?void 0:s.nextContinuationData)==null?void 0:o.continuation)||((f=(l=(a=e.continuations)==null?void 0:a[0])==null?void 0:l.reloadContinuationData)==null?void 0:f.continuation)||null}};r(ws,"SectionListContinuation");ws.type="sectionListContinuation";var Ts=class extends n{constructor(e){var i;super(),this.contents=De(e.contents,!0),this.continuation=((i=e.continuations)==null?void 0:i[0].nextContinuationData.continuation)||null}};r(Ts,"MusicPlaylistShelfContinuation");Ts.type="musicPlaylistShelfContinuation";var vs=class extends n{constructor(e){var i,s,o,a;super(),this.contents=Ce(e.contents),this.continuation=((s=(i=e.continuations)==null?void 0:i[0].nextContinuationData)==null?void 0:s.continuation)||((a=(o=e.continuations)==null?void 0:o[0].reloadContinuationData)==null?void 0:a.continuation)||null}};r(vs,"MusicShelfContinuation");vs.type="musicShelfContinuation";var Is=class extends n{constructor(e){var i;super(),this.items=De(e.items,!0),this.continuation=((i=e.continuations)==null?void 0:i[0].nextContinuationData.continuation)||null}get contents(){return this.items}};r(Is,"GridContinuation");Is.type="gridContinuation";var Ss=class extends n{constructor(e){var i,s,o,a,l,f;super(),this.contents=Ce(e.contents),this.continuation=((o=(s=(i=e.continuations)==null?void 0:i[0])==null?void 0:s.nextContinuationData)==null?void 0:o.continuation)||((f=(l=(a=e.continuations)==null?void 0:a[0])==null?void 0:l.nextRadioContinuationData)==null?void 0:f.continuation)||null}};r(Ss,"PlaylistPanelContinuation");Ss.type="playlistPanelContinuation";var xr=class extends n{constructor(e){var i,s,o;super(),this.continuation_type=e.type,this.timeout_ms=(i=e.continuation)==null?void 0:i.timeoutMs,this.time_until_last_message_ms=(s=e.continuation)==null?void 0:s.timeUntilLastMessageMsec,this.token=(o=e.continuation)==null?void 0:o.continuation}};r(xr,"Continuation");xr.type="continuation";var Mi=class extends n{constructor(e){var o,a,l,f,m,x,_,b;super(),this.actions=De((o=e.actions)==null?void 0:o.map(T=>(delete T.clickTrackingParams,T)),!0)||G([]),this.action_panel=q(e.actionPanel),this.item_list=q(e.itemList,Gx),this.header=q(e.header,Wx),this.participants_list=q(e.participantsList,Hx),this.popout_message=q(e.popoutMessage,ki),this.emojis=((a=e.emojis)==null?void 0:a.map(T=>({emoji_id:T.emojiId,shortcuts:T.shortcuts,search_terms:T.searchTerms,image:y.fromResponse(T.image),is_custom_emoji:T.isCustomEmoji})))||[];let i,s;(l=e.continuations)!=null&&l[0].timedContinuationData?(s="timed",i=(f=e.continuations)==null?void 0:f[0].timedContinuationData):(m=e.continuations)!=null&&m[0].invalidationContinuationData?(s="invalidation",i=(x=e.continuations)==null?void 0:x[0].invalidationContinuationData):(_=e.continuations)!=null&&_[0].liveChatReplayContinuationData&&(s="replay",i=(b=e.continuations)==null?void 0:b[0].liveChatReplayContinuationData),this.continuation=new xr({continuation:i,type:s}),this.viewer_name=e.viewerName}};r(Mi,"LiveChatContinuation");Mi.type="liveChatContinuation";var ti=class extends n{constructor(e){super(),this.request=e.request,this.token=e.token}};r(ti,"ContinuationCommand");ti.type="ContinuationCommand";var tb,ib=class{constructor(e,i){var s,o,a,l,f,m,x,_;if(tb.set(this,void 0),i&&I(this,tb,i,"f"),this.itag=e.itag,this.mime_type=e.mimeType,this.is_type_otf=e.type==="FORMAT_STREAM_TYPE_OTF",this.bitrate=e.bitrate,this.average_bitrate=e.averageBitrate,Reflect.has(e,"width")&&Reflect.has(e,"height")&&(this.width=parseInt(e.width),this.height=parseInt(e.height)),Reflect.has(e,"projectionType")&&(this.projection_type=e.projectionType),Reflect.has(e,"stereoLayout")&&(this.stereo_layout=(s=e.stereoLayout)==null?void 0:s.replace("STEREO_LAYOUT_","")),Reflect.has(e,"initRange")&&(this.init_range={start:parseInt(e.initRange.start),end:parseInt(e.initRange.end)}),Reflect.has(e,"indexRange")&&(this.index_range={start:parseInt(e.indexRange.start),end:parseInt(e.indexRange.end)}),this.last_modified=new Date(Math.floor(parseInt(e.lastModified)/1e3)),this.last_modified_ms=e.lastModified,Reflect.has(e,"contentLength")&&(this.content_length=parseInt(e.contentLength)),Reflect.has(e,"quality")&&(this.quality=e.quality),Reflect.has(e,"qualityLabel")&&(this.quality_label=e.qualityLabel),Reflect.has(e,"fps")&&(this.fps=e.fps),Reflect.has(e,"url")&&(this.url=e.url),Reflect.has(e,"cipher")&&(this.cipher=e.cipher),Reflect.has(e,"signatureCipher")&&(this.signature_cipher=e.signatureCipher),Reflect.has(e,"audioQuality")&&(this.audio_quality=e.audioQuality),this.approx_duration_ms=parseInt(e.approxDurationMs),Reflect.has(e,"audioSampleRate")&&(this.audio_sample_rate=parseInt(e.audioSampleRate)),Reflect.has(e,"audioChannels")&&(this.audio_channels=e.audioChannels),Reflect.has(e,"loudnessDb")&&(this.loudness_db=e.loudnessDb),Reflect.has(e,"spatialAudioType")&&(this.spatial_audio_type=(o=e.spatialAudioType)==null?void 0:o.replace("SPATIAL_AUDIO_TYPE_","")),Reflect.has(e,"maxDvrDurationSec")&&(this.max_dvr_duration_sec=e.maxDvrDurationSec),Reflect.has(e,"targetDurationSec")&&(this.target_duration_dec=e.targetDurationSec),this.has_audio=!!e.audioBitrate||!!e.audioQuality,this.has_video=!!e.qualityLabel,this.has_text=!!e.captionTrack,Reflect.has(e,"xtags")&&(this.xtags=e.xtags),Reflect.has(e,"fairPlayKeyUri")&&(this.fair_play_key_uri=e.fairPlayKeyUri),Reflect.has(e,"drmFamilies")&&(this.drm_families=e.drmFamilies),Reflect.has(e,"drmTrackType")&&(this.drm_track_type=e.drmTrackType),Reflect.has(e,"distinctParams")&&(this.distinct_params=e.distinctParams),Reflect.has(e,"trackAbsoluteLoudnessLkfs")&&(this.track_absolute_loudness_lkfs=e.trackAbsoluteLoudnessLkfs),Reflect.has(e,"highReplication")&&(this.high_replication=e.highReplication),Reflect.has(e,"colorInfo")&&(this.color_info={primaries:(a=e.colorInfo.primaries)==null?void 0:a.replace("COLOR_PRIMARIES_",""),transfer_characteristics:(l=e.colorInfo.transferCharacteristics)==null?void 0:l.replace("COLOR_TRANSFER_CHARACTERISTICS_",""),matrix_coefficients:(f=e.colorInfo.matrixCoefficients)==null?void 0:f.replace("COLOR_MATRIX_COEFFICIENTS_","")}),Reflect.has(e,"audioTrack")&&(this.audio_track={audio_is_default:e.audioTrack.audioIsDefault,display_name:e.audioTrack.displayName,id:e.audioTrack.id}),Reflect.has(e,"captionTrack")&&(this.caption_track={display_name:e.captionTrack.displayName,vss_id:e.captionTrack.vssId,language_code:e.captionTrack.languageCode,kind:e.captionTrack.kind,id:e.captionTrack.id}),this.has_audio||this.has_text){let b=new URLSearchParams(this.cipher||this.signature_cipher),w=(m=new URLSearchParams(b.get("url")||this.url).get("xtags"))==null?void 0:m.split(":");if(this.language=((x=w==null?void 0:w.find(S=>S.startsWith("lang=")))==null?void 0:x.split("=")[1])||null,this.has_audio){this.is_drc=!!e.isDrc||!!(w!=null&&w.includes("drc=1"));let S=(_=w==null?void 0:w.find(E=>E.startsWith("acont=")))==null?void 0:_.split("=")[1];this.is_dubbed=S==="dubbed",this.is_descriptive=S==="descriptive",this.is_secondary=S==="secondary",this.is_auto_dubbed=S==="dubbed-auto",this.is_original=S==="original"||!this.is_dubbed&&!this.is_descriptive&&!this.is_secondary&&!this.is_auto_dubbed&&!this.is_drc}this.has_text&&!this.language&&this.caption_track&&(this.language=this.caption_track.language_code)}}async decipher(e){return e?e.decipher(this.url,this.signature_cipher,this.cipher,u(this,tb,"f")):this.url||""}};r(ib,"Format");tb=new WeakMap;var rb=ib;var Li=class{constructor(e){this.id=e.videoId,this.channel_id=e.channelId,this.title=e.title,this.duration=parseInt(e.lengthSeconds),this.keywords=e.keywords,this.is_owner_viewing=!!e.isOwnerViewing,this.short_description=e.shortDescription,this.thumbnail=y.fromResponse(e.thumbnail),this.allow_ratings=!!e.allowRatings,this.view_count=parseInt(e.viewCount),this.author=e.author,this.is_private=!!e.isPrivate,this.is_live=!!e.isLive,this.is_live_content=!!e.isLiveContent,this.is_live_dvr_enabled=!!e.isLiveDvrEnabled,this.is_low_latency_live_stream=!!e.isLowLatencyLiveStream,this.is_upcoming=!!e.isUpcoming,this.is_post_live_dvr=!!e.isPostLiveDvr,this.is_crawlable=!!e.isCrawlable,this.live_chunk_readahead=e.liveChunkReadahead}};r(Li,"VideoDetails");var yr="Parser",v1=new Set(["AdSlot","DisplayAd","SearchPyv","MealbarPromo","PrimetimePromo","BackgroundPromo","PromotedSparklesWeb","CompactPromotedVideo","BrandVideoShelf","BrandVideoSingleton","StatementBanner","GuideSigninPromo","AdsEngagementPanelContent","MiniGameCardView"]),Fg=new Map(Object.entries(mr)),QS=new Map,br=null,ii=r(({classname:t,...e})=>{switch(e.error_type){case"parse":e.error instanceof Error&&O.warn(yr,new g(`Something went wrong at ${t}! +This is a bug, please report it at ${M.shim.info.bugs_url}`,{stack:e.error.stack,classdata:JSON.stringify(e.classdata,null,2)}));break;case"typecheck":O.warn(yr,new Qe(`Type mismatch, got ${t} expected ${Array.isArray(e.expected)?e.expected.join(" | "):e.expected}.`,e.classdata));break;case"mutation_data_missing":O.warn(yr,new g(`Mutation data required for processing ${t}, but none found. +This is a bug, please report it at ${M.shim.info.bugs_url}`));break;case"mutation_data_invalid":O.warn(yr,new g(`Mutation data missing or invalid for ${e.failed} out of ${e.total} MusicMultiSelectMenuItems. The titles of the failed items are: ${e.titles.join(", ")}. +This is a bug, please report it at ${M.shim.info.bugs_url}`));break;case"class_not_found":O.warn(yr,new g(`${t} not found! +This is a bug, want to help us fix it? Follow the instructions at ${M.shim.info.repo_url}/blob/main/docs/updating-the-parser.md or report it at ${M.shim.info.bugs_url}! Introspected and JIT generated this class in the meantime: -${gg(e,i.key_info)}`));break;case"class_changed":j.warn(cn,`${e} changed! -The following keys where altered: ${i.changed_keys.map(([n])=>un(n)).join(", ")} +${eb(t,e.key_info)}`));break;case"class_changed":O.warn(yr,`${t} changed! +The following keys where altered: ${e.changed_keys.map(([i])=>_r(i)).join(", ")} The class has changed to: -${gg(e,i.key_info)}`);break;default:j.warn(cn,"Unreachable code reached at ParserErrorHandler");break}},"ERROR_HANDLER");function mk(t){Ci=t}o(mk,"setParserErrorHandler");function Vt(){pn=null}o(Vt,"_clearMemo");function Mt(){pn=new ti}o(Mt,"_createMemo");function hk(t,e){if(!pn)return;let i=pn.get(t);if(!i)return pn.set(t,[e]);i.push(e)}o(hk,"_addToMemo");function Dt(){if(!pn)throw new Error("Parser#getMemo() called before Parser#createMemo()");return pn}o(Dt,"_getMemo");function VT(t){return fk.has(t)}o(VT,"shouldIgnore");function _f(t){return(t.charAt(0).toUpperCase()+t.slice(1)).replace(/Renderer|Model/g,"").replace(/Radio/g,"Mix").trim()}o(_f,"sanitizeClassName");function mf(t){let e=Wx.get(t);if(!e){let i=new Error(`Module not found: ${t}`);throw i.code="MODULE_NOT_FOUND",i}return e}o(mf,"getParserByName");function xg(t){return Wx.has(t)}o(xg,"hasParser");function Fx(t,e){Wx.set(t,e),AT.set(t,e)}o(Fx,"addRuntimeParser");function _k(){return Object.fromEntries(AT)}o(_k,"getDynamicParsers");function Yx(t){var e,i,n,r,a,c,p,d,_,f,x,v,w,k;let S={};Mt();let P=We(t.contents),A=Dt();P&&(S.contents=P,S.contents_memo=A),Vt(),Mt();let M=t.onResponseReceivedActions?wg(t.onResponseReceivedActions):null,B=Dt();M&&(S.on_response_received_actions=M,S.on_response_received_actions_memo=B),Vt(),Mt();let $=t.onResponseReceivedEndpoints?wg(t.onResponseReceivedEndpoints):null,te=Dt();$&&(S.on_response_received_endpoints=$,S.on_response_received_endpoints_memo=te),Vt(),Mt();let ue=t.onResponseReceivedCommands?wg(t.onResponseReceivedCommands):null,pe=Dt();ue&&(S.on_response_received_commands=ue,S.on_response_received_commands_memo=pe),Vt(),Mt();let G=t.continuationContents?Ux(t.continuationContents):null,Y=Dt();G&&(S.continuation_contents=G,S.continuation_contents_memo=Y),Vt(),Mt();let V=t.actions?DT(t.actions):null,q=Dt();V&&(S.actions=V,S.actions_memo=q),Vt(),Mt();let oe=t.liveChatItemContextMenuSupportedRenderers?ie(t.liveChatItemContextMenuSupportedRenderers):null,Te=Dt();oe&&(S.live_chat_item_context_menu_supported_renderers=oe,S.live_chat_item_context_menu_supported_renderers_memo=Te),Vt(),Mt();let Qe=t.header?We(t.header):null,ot=Dt();Qe&&(S.header=Qe,S.header_memo=ot),Vt(),Mt();let K=t.sidebar?ie(t.sidebar):null,De=Dt();K&&(S.sidebar=K,S.sidebar_memo=De),Vt(),Mt();let Ae=We(t.items);Ae&&(S.items=Ae,S.items_memo=Dt()),Vt(),BT(A,(i=(e=t.frameworkUpdates)===null||e===void 0?void 0:e.entityBatchUpdate)===null||i===void 0?void 0:i.mutations),te&<(te,(r=(n=t.frameworkUpdates)===null||n===void 0?void 0:n.entityBatchUpdate)===null||r===void 0?void 0:r.mutations);let he=t.continuation?MT(t.continuation):null;he&&(S.continuation=he);let de=t.continuationEndpoint?Ux(t.continuationEndpoint):null;de&&(S.continuation_endpoint=de);let Be=We(t.metadata);Be&&(S.metadata=Be);let _e=ie(t.microformat);_e&&(S.microformat=_e);let Le=ie(t.overlay);Le&&(S.overlay=Le);let Ze=Ve(t.alerts,[Nn,cm]);Ze.length&&(S.alerts=Ze);let me=t.refinements;me&&(S.refinements=me);let b0=t.estimatedResults?parseInt(t.estimatedResults):null;b0&&(S.estimated_results=b0);let w0=We(t.playerOverlays);w0&&(S.player_overlays=w0);let T0=ie(t.background,Ne);T0&&(S.background=T0);let I0=t.playbackTracking?{videostats_watchtime_url:t.playbackTracking.videostatsWatchtimeUrl.baseUrl,videostats_playback_url:t.playbackTracking.videostatsPlaybackUrl.baseUrl}:null;I0&&(S.playback_tracking=I0);let k0=t.playabilityStatus?{status:t.playabilityStatus.status,reason:t.playabilityStatus.reason||"",embeddable:!!t.playabilityStatus.playableInEmbed||!1,audio_only_playablility:ie(t.playabilityStatus.audioOnlyPlayability,mm),error_screen:ie(t.playabilityStatus.errorScreen)}:null;if(k0&&(S.playability_status=k0),t.streamingData){let rt=new Map;console.log(t);let K1={expires:new Date(Date.now()+parseInt(t.streamingData.expiresInSeconds)*1e3),formats:jx(t.streamingData.formats,rt),adaptive_formats:jx(t.streamingData.adaptiveFormats,rt),dash_manifest_url:t.streamingData.dashManifestUrl||null,hls_manifest_url:t.streamingData.hlsManifestUrl||null};S.streaming_data=K1}if(t.playerConfig){let rt={audio_config:{loudness_db:(a=t.playerConfig.audioConfig)===null||a===void 0?void 0:a.loudnessDb,perceptual_loudness_db:(c=t.playerConfig.audioConfig)===null||c===void 0?void 0:c.perceptualLoudnessDb,enable_per_format_loudness:(p=t.playerConfig.audioConfig)===null||p===void 0?void 0:p.enablePerFormatLoudness},stream_selection_config:{max_bitrate:((d=t.playerConfig.streamSelectionConfig)===null||d===void 0?void 0:d.maxBitrate)||"0"},media_common_config:{dynamic_readahead_config:{max_read_ahead_media_time_ms:((f=(_=t.playerConfig.mediaCommonConfig)===null||_===void 0?void 0:_.dynamicReadaheadConfig)===null||f===void 0?void 0:f.maxReadAheadMediaTimeMs)||0,min_read_ahead_media_time_ms:((v=(x=t.playerConfig.mediaCommonConfig)===null||x===void 0?void 0:x.dynamicReadaheadConfig)===null||v===void 0?void 0:v.minReadAheadMediaTimeMs)||0,read_ahead_growth_rate_ms:((k=(w=t.playerConfig.mediaCommonConfig)===null||w===void 0?void 0:w.dynamicReadaheadConfig)===null||k===void 0?void 0:k.readAheadGrowthRateMs)||0}}};S.player_config=rt}let S0=t.currentVideoEndpoint?new g(t.currentVideoEndpoint):null;S0&&(S.current_video_endpoint=S0);let C0=t.endpoint?new g(t.endpoint):null;C0&&(S.endpoint=C0);let E0=ie(t.captions,O_);E0&&(S.captions=E0);let P0=t.videoDetails?new Si(t.videoDetails):null;P0&&(S.video_details=P0);let N0=Ve(t.annotations,L_);N0.length&&(S.annotations=N0);let R0=ie(t.storyboards,[Hi,U_]);R0&&(S.storyboards=R0);let A0=ie(t.endscreen,Nh);A0&&(S.endscreen=A0);let V0=ie(t.cards,Gm);V0&&(S.cards=V0);let M0=Ve(t.engagementPanels,pi);if(M0.length&&(S.engagement_panels=M0),t.playerResponse){let rt=Yx(t.playerResponse);S.player_response=rt}if(t.watchNextResponse){let rt=Yx(t.watchNextResponse);S.watch_next_response=rt}if(t.cpnInfo){let rt={cpn:t.cpnInfo.cpn,cpn_source:t.cpnInfo.cpnSource};S.cpn_info=rt}return t.entries&&(S.entries=t.entries.map(rt=>new g(rt))),S}o(Yx,"parseResponse");function ie(t,e){if(!t)return null;let i=Object.keys(t);if(!i.length)return null;let n=_f(i[0]);if(!VT(n))try{let a=xg(n)?mf(n):hf(n,t[i[0]],Ci);if(e){if(Array.isArray(e)){if(!e.some(p=>p.type===a.type))return Ci({classdata:t[i[0]],classname:n,error_type:"typecheck",expected:e.map(p=>p.type)}),null}else if(a.type!==e.type)return Ci({classdata:t[i[0]],classname:n,error_type:"typecheck",expected:e.type}),null}let c=new a(t[i[0]]);return hk(n,c),c}catch(r){return Ci({classname:n,classdata:t[i[0]],error:r,error_type:"parse"}),null}return null}o(ie,"parseItem");function Ve(t,e){if(Array.isArray(t)){let i=[];for(let n of t){let r=ie(n,e);r&&i.push(r)}return X(i)}else if(!t)return X([]);throw new st("Expected array but got a single item")}o(Ve,"parseArray");function We(t,e,i){if(!t)return null;if(Array.isArray(t)){let n=[];for(let a of t){let c=ie(a,i);c&&n.push(c)}let r=X(n);return e?r:new kt(r)}else if(e)throw new st("Expected array but got a single item");return new kt(ie(t,i))}o(We,"parse");function MT(t){return t.timedContinuationData?new ln({continuation:t.timedContinuationData,type:"timed"}):null}o(MT,"parseC");function Ux(t){return t.itemSectionContinuation?new mo(t.itemSectionContinuation):t.sectionListContinuation?new _o(t.sectionListContinuation):t.liveChatContinuation?new ki(t.liveChatContinuation):t.musicPlaylistShelfContinuation?new go(t.musicPlaylistShelfContinuation):t.musicShelfContinuation?new xo(t.musicShelfContinuation):t.gridContinuation?new vo(t.gridContinuation):t.playlistPanelContinuation?new yo(t.playlistPanelContinuation):t.continuationCommand?new Ht(t.continuationCommand):null}o(Ux,"parseLC");function wg(t){return X(t.map(e=>{if(e.navigateAction)return new Ti(e.navigateAction);if(e.showMiniplayerCommand)return new ho(e.showMiniplayerCommand);if(e.reloadContinuationItemsCommand)return new Ii(e.reloadContinuationItemsCommand);if(e.appendContinuationItemsAction)return new Ki(e.appendContinuationItemsAction)}).filter(e=>e))}o(wg,"parseRR");function DT(t){return Array.isArray(t)?We(t.map(e=>(delete e.clickTrackingParams,e))):new kt(ie(t))}o(DT,"parseActions");function jx(t,e){return(t==null?void 0:t.map(i=>new bg(i,e)))||[]}o(jx,"parseFormats");function BT(t,e){let i=t.getType(to);if(i.length>0&&!e)Ci({error_type:"mutation_data_missing",classname:"MusicMultiSelectMenuItem"});else{let n=[];for(let r of i){let a=e.find(p=>{var d,_;return((_=(d=p.payload)===null||d===void 0?void 0:d.musicFormBooleanChoice)===null||_===void 0?void 0:_.id)===r.form_item_entity_key}),c=a==null?void 0:a.payload.musicFormBooleanChoice;(c==null?void 0:c.selected)!==void 0&&(c==null?void 0:c.opaqueToken)?r.selected=c.selected:n.push(`'${r.title}'`)}n.length>0&&Ci({error_type:"mutation_data_invalid",classname:"MusicMultiSelectMenuItem",total:i.length,failed:n.length,titles:n})}}o(BT,"applyMutations");function LT(t,e){var i,n,r,a,c,p;let d=t.getType(_i);if(d.length>0){e||Ci({error_type:"mutation_data_missing",classname:"CommentView"});for(let _ of d){let f=(n=(i=e.find(w=>{var k,S;return((S=(k=w.payload)===null||k===void 0?void 0:k.commentEntityPayload)===null||S===void 0?void 0:S.key)===_.keys.comment}))===null||i===void 0?void 0:i.payload)===null||n===void 0?void 0:n.commentEntityPayload,x=(a=(r=e.find(w=>{var k,S;return((S=(k=w.payload)===null||k===void 0?void 0:k.engagementToolbarStateEntityPayload)===null||S===void 0?void 0:S.key)===_.keys.toolbar_state}))===null||r===void 0?void 0:r.payload)===null||a===void 0?void 0:a.engagementToolbarStateEntityPayload,v=(p=(c=e.find(w=>w.entityKey===_.keys.toolbar_surface))===null||c===void 0?void 0:c.payload)===null||p===void 0?void 0:p.engagementToolbarSurfaceEntityPayload;_.applyMutations(f,x,v)}}}o(LT,"applyCommentsMutations");var Kx={};ye(Kx,{AccountInfo:()=>OT,Analytics:()=>FT,Channel:()=>Ee,ChannelListContinuation:()=>_n,Comments:()=>UT,FilteredChannelList:()=>Ri,Guide:()=>jT,HashtagFeed:()=>Ai,History:()=>Lt,HomeFeed:()=>zt,ItemMenu:()=>Vg,Library:()=>JT,LiveChat:()=>jg,NotificationsMenu:()=>zT,Playlist:()=>No,Search:()=>Kt,Settings:()=>GT,SmoothedQueue:()=>Og,TimeWatched:()=>$T,TranscriptInfo:()=>Eg,VideoInfo:()=>Ef});var bo,Tg=class{constructor(e){if(bo.set(this,void 0),E(this,bo,l.parseResponse(e.data),"f"),!m(this,bo,"f").contents)throw new b("Page contents not found");let i=m(this,bo,"f").contents.array().as(nm).first();if(!i)throw new b("Account section list not found");this.contents=i.contents,this.footers=i.footers}get page(){return m(this,bo,"f")}};o(Tg,"AccountInfo");bo=new WeakMap;var OT=Tg;var gf,Ig=class{constructor(e){var i;gf.set(this,void 0),E(this,gf,l.parseResponse(e.data),"f"),this.sections=(i=m(this,gf,"f").contents_memo)===null||i===void 0?void 0:i.getType(qn).map(n=>n.model).flatMap(n=>n||[])}get page(){return m(this,gf,"f")}};o(Ig,"Analytics");gf=new WeakMap;var FT=Ig;var xf,Me,dn,vf,$e,YT,Jx,Ei=class{constructor(e,i,n=!1){xf.add(this),Me.set(this,void 0),dn.set(this,void 0),vf.set(this,void 0),$e.set(this,void 0),m(this,xf,"m",YT).call(this,i)||n?E(this,Me,i,"f"):E(this,Me,l.parseResponse(i.data),"f");let r=Hx(m(this,Me,"f").contents_memo,m(this,Me,"f").continuation_contents_memo,m(this,Me,"f").on_response_received_commands_memo,m(this,Me,"f").on_response_received_endpoints_memo,m(this,Me,"f").on_response_received_actions_memo,m(this,Me,"f").sidebar_memo,m(this,Me,"f").header_memo);if(!r)throw new b("No memo found in feed");E(this,$e,r,"f"),E(this,vf,e,"f")}static getVideosFromMemo(e){return e.getType(Mn,Fh,so,po,Bn,ro,Jt,dg)}static getPlaylistsFromMemo(e){let i=e.getType(Et,Bh),n=e.getType(m_).filter(r=>["PLAYLIST","ALBUM","PODCAST"].includes(r.content_type));return n.length>0&&i.push(...n),i}get videos(){return Ei.getVideosFromMemo(m(this,$e,"f"))}get posts(){return m(this,$e,"f").getType(si,K_,og)}get channels(){return m(this,$e,"f").getType(Km,Dh)}get playlists(){return Ei.getPlaylistsFromMemo(m(this,$e,"f"))}get memo(){return m(this,$e,"f")}get page_contents(){var e;let i=(e=m(this,$e,"f").getType(Re))===null||e===void 0?void 0:e.first().content,n=m(this,$e,"f").getType(Ii).first(),r=m(this,$e,"f").getType(Ki).first();return i||n||r}get shelves(){return m(this,$e,"f").getType(co,Q_,On)}getShelf(e){return this.shelves.get({title:e})}get secondary_contents(){var e,i;if(!(!((e=m(this,Me,"f").contents)===null||e===void 0)&&e.is_node))return;let n=(i=m(this,Me,"f").contents)===null||i===void 0?void 0:i.item();if(!!n.is(Rt,ag))return n.secondary_contents}get actions(){return m(this,vf,"f")}get page(){return m(this,Me,"f")}get has_continuation(){return m(this,xf,"m",Jx).call(this).length>0}getContinuationData(){return T(this,void 0,void 0,function*(){if(m(this,dn,"f")){if(m(this,dn,"f").length===0)throw new b("There are no continuations.");return yield m(this,dn,"f")[0].endpoint.call(m(this,vf,"f"),{parse:!0})}if(E(this,dn,m(this,xf,"m",Jx).call(this),"f"),m(this,dn,"f"))return this.getContinuationData()})}getContinuation(){return T(this,void 0,void 0,function*(){let e=yield this.getContinuationData();if(!e)throw new b("Could not get continuation data");return new Ei(this.actions,e,!0)})}};o(Ei,"Feed");Me=new WeakMap,dn=new WeakMap,vf=new WeakMap,$e=new WeakMap,xf=new WeakSet,YT=o(function(e){return!("data"in e)},"_Feed_isParsed"),Jx=o(function(){if(m(this,Me,"f").header_memo){let e=m(this,Me,"f").header_memo.getType(ce);return m(this,$e,"f").getType(ce).filter(i=>!e.includes(i))}return m(this,$e,"f").getType(ce)},"_Feed_getBodyContinuations");var Ce=Ei;var wo,kg=class extends Ce{constructor(e,i,n=!1){super(e,i,n),wo.set(this,void 0)}get filter_chips(){var e,i;if(m(this,wo,"f"))return m(this,wo,"f")||[];if(((e=this.memo.getType(vt))===null||e===void 0?void 0:e.length)>1)throw new b("There are too many feed filter chipbars, you'll need to find the correct one yourself in this.page");if(((i=this.memo.getType(vt))===null||i===void 0?void 0:i.length)===0)throw new b("There are no feed filter chipbars");return E(this,wo,this.memo.getType(Ye),"f"),m(this,wo,"f")||[]}get filters(){return this.filter_chips.map(e=>e.text.toString())||[]}getFilteredFeed(e){return T(this,void 0,void 0,function*(){var i;let n;if(typeof e=="string"){if(!this.filters.includes(e))throw new b("Filter not found",{available_filters:this.filters});n=this.filter_chips.find(a=>a.text.toString()===e)}else if(e.type==="ChipCloudChip")n=e;else throw new b("Invalid filter");if(!n)throw new b("Filter not found");if(n.is_selected)return this;let r=yield(i=n.endpoint)===null||i===void 0?void 0:i.call(this.actions,{parse:!0});if(!r)throw new b("Failed to get filtered feed");return new Ce(this.actions,r,!0)})}};o(kg,"FilterableFeed");wo=new WeakMap;var Pi=kg;var zx={};ye(zx,{Feed:()=>Ce,FilterableFeed:()=>Pi,MediaInfo:()=>Io,TabbedFeed:()=>yf});var Ni,yt,To,Sg,Cg=class{constructor(e,i,n){var r,a,c,p,d,_,f,x,v,w,k,S,P,A,M,B,$,te,ue,pe,G,Y;Ni.set(this,void 0),yt.set(this,void 0),To.set(this,void 0),Sg.set(this,void 0),E(this,yt,i,"f");let V=l.parseResponse(e[0].data.playerResponse?e[0].data.playerResponse:e[0].data),q=!((r=e[1])===null||r===void 0)&&r.data?l.parseResponse(e[1].data):void 0;if(E(this,Ni,[V,q],"f"),E(this,To,n,"f"),((a=V.playability_status)===null||a===void 0?void 0:a.status)==="ERROR")throw new b("This video is unavailable",V.playability_status);if(V.microformat&&!(!((c=V.microformat)===null||c===void 0)&&c.is(nt,yi)))throw new b("Unsupported microformat",V.microformat);this.basic_info=Object.assign(Object.assign(Object.assign({},V.video_details),{embed:!((p=V.microformat)===null||p===void 0)&&p.is(nt)?(d=V.microformat)===null||d===void 0?void 0:d.embed:null,channel:!((_=V.microformat)===null||_===void 0)&&_.is(nt)?(f=V.microformat)===null||f===void 0?void 0:f.channel:null,is_unlisted:(x=V.microformat)===null||x===void 0?void 0:x.is_unlisted,is_family_safe:(v=V.microformat)===null||v===void 0?void 0:v.is_family_safe,category:!((w=V.microformat)===null||w===void 0)&&w.is(nt)?(k=V.microformat)===null||k===void 0?void 0:k.category:null,has_ypc_metadata:!((S=V.microformat)===null||S===void 0)&&S.is(nt)?(P=V.microformat)===null||P===void 0?void 0:P.has_ypc_metadata:null,start_timestamp:!((A=V.microformat)===null||A===void 0)&&A.is(nt)?V.microformat.start_timestamp:null,end_timestamp:!((M=V.microformat)===null||M===void 0)&&M.is(nt)?V.microformat.end_timestamp:null,view_count:((B=V.microformat)===null||B===void 0?void 0:B.is(nt))&&isNaN(($=V.video_details)===null||$===void 0?void 0:$.view_count)?V.microformat.view_count:(te=V.video_details)===null||te===void 0?void 0:te.view_count,url_canonical:!((ue=V.microformat)===null||ue===void 0)&&ue.is(yi)?(pe=V.microformat)===null||pe===void 0?void 0:pe.url_canonical:null,tags:!((G=V.microformat)===null||G===void 0)&&G.is(yi)?(Y=V.microformat)===null||Y===void 0?void 0:Y.tags:null}),{like_count:void 0,is_liked:void 0,is_disliked:void 0}),this.annotations=V.annotations,this.storyboards=V.storyboards,this.endscreen=V.endscreen,this.captions=V.captions,this.cards=V.cards,this.streaming_data=V.streaming_data,this.playability_status=V.playability_status,this.player_config=V.player_config,E(this,Sg,V.playback_tracking,"f")}toDash(e,i){return T(this,arguments,void 0,function*(n,r,a={include_thumbnails:!1}){var c,p;let d=m(this,Ni,"f")[0];if(d.video_details&&d.video_details.is_live)throw new b("Generating DASH manifests for live videos is not supported. Please use the DASH and HLS manifests provided by YouTube in `streaming_data.dash_manifest_url` and `streaming_data.hls_manifest_url` instead.");let _,f;return a.include_thumbnails&&d.storyboards&&(_=d.storyboards),typeof a.captions_format=="string"&&((c=d.captions)===null||c===void 0?void 0:c.caption_tracks)&&(f=d.captions.caption_tracks),zi.toDash(this.streaming_data,(p=this.page[0].video_details)===null||p===void 0?void 0:p.is_post_live_dvr,n,r,m(this,To,"f"),m(this,yt,"f").session.player,m(this,yt,"f"),_,f,a)})}getStreamingInfo(e,i){var n;return Jf(this.streaming_data,(n=this.page[0].video_details)===null||n===void 0?void 0:n.is_post_live_dvr,e,i,this.cpn,m(this,yt,"f").session.player,m(this,yt,"f"),m(this,Ni,"f")[0].storyboards?m(this,Ni,"f")[0].storyboards:void 0)}chooseFormat(e){return zi.chooseFormat(e,this.streaming_data)}download(){return T(this,arguments,void 0,function*(e={}){let i=m(this,Ni,"f")[0];if(i.video_details&&(i.video_details.is_live||i.video_details.is_post_live_dvr))throw new b("Downloading is not supported for live and Post-Live-DVR videos, as they are split up into 5 second segments that are individual files, which require using a tool such as ffmpeg to stitch them together, so they cannot be returned in a single stream.");return zi.download(e,m(this,yt,"f"),this.playability_status,this.streaming_data,m(this,yt,"f").session.player,this.cpn)})}getTranscript(){return T(this,void 0,void 0,function*(){var e;let i=this.page[1];if(!i)throw new b("Cannot get transcript from basic video info.");if(!i.engagement_panels)throw new b("Engagement panels not found. Video likely has no transcript.");let n=i.engagement_panels.get({panel_identifier:"engagement-panel-searchable-transcript"});if(!n)throw new b("Transcript panel not found. Video likely has no transcript.");let r=(e=n.content)===null||e===void 0?void 0:e.as(ce);if(!r)throw new b("Transcript continuation not found.");let a=yield r.endpoint.call(this.actions);return new Eg(this.actions,a)})}addToWatchHistory(){return T(this,arguments,void 0,function*(e={}){var i;let n=ge.CLIENTS.WEB.NAME,r=ge.CLIENTS.WEB.VERSION,a="https://www.",c=(e==null?void 0:e.url)||((i=m(this,Sg,"f"))===null||i===void 0?void 0:i.videostats_playback_url);if(!c)throw new b("Playback tracking not available");let p={cpn:m(this,To,"f"),fmt:251,rtn:0,rt:0},d=c.replace("https://s.",a);return yield m(this,yt,"f").stats(d,{client_name:n,client_version:r,visitor_data:e==null?void 0:e.visitor_data},p)})}get actions(){return m(this,yt,"f")}get cpn(){return m(this,To,"f")}get page(){return m(this,Ni,"f")}};o(Cg,"MediaInfo");Ni=new WeakMap,yt=new WeakMap,To=new WeakMap,Sg=new WeakMap;var Io=Cg;var fn,mn,hn=class extends Ce{constructor(e,i,n=!1){var r;super(e,i,n),fn.set(this,void 0),mn.set(this,void 0),E(this,mn,e,"f"),E(this,fn,(r=this.page.contents_memo)===null||r===void 0?void 0:r.getType(Re),"f")}get tabs(){var e,i;return(i=(e=m(this,fn,"f"))===null||e===void 0?void 0:e.map(n=>n.title.toString()))!==null&&i!==void 0?i:[]}getTabByName(e){return T(this,void 0,void 0,function*(){var i;let n=(i=m(this,fn,"f"))===null||i===void 0?void 0:i.find(a=>a.title.toLowerCase()===e.toLowerCase());if(!n)throw new b(`Tab "${e}" not found`);if(n.selected)return this;let r=yield n.endpoint.call(m(this,mn,"f"));return new hn(m(this,mn,"f"),r,!1)})}getTabByURL(e){return T(this,void 0,void 0,function*(){var i;let n=(i=m(this,fn,"f"))===null||i===void 0?void 0:i.find(a=>{var c;return((c=a.endpoint.metadata.url)===null||c===void 0?void 0:c.split("/").pop())===e});if(!n)throw new b(`Tab "${e}" not found`);if(n.selected)return this;let r=yield n.endpoint.call(m(this,mn,"f"));return new hn(m(this,mn,"f"),r,!1)})}hasTabWithURL(e){var i,n;return(n=(i=m(this,fn,"f"))===null||i===void 0?void 0:i.some(r=>{var a;return((a=r.endpoint.metadata.url)===null||a===void 0?void 0:a.split("/").pop())===e}))!==null&&n!==void 0?n:!1}get title(){var e,i,n;return(n=(i=(e=this.page.contents_memo)===null||e===void 0?void 0:e.getType(Re))===null||i===void 0?void 0:i.find(r=>r.selected))===null||n===void 0?void 0:n.title.toString()}};o(hn,"TabbedFeed");fn=new WeakMap,mn=new WeakMap;var yf=hn;var Ee=class extends yf{constructor(e,i,n=!1){var r,a,c,p,d,_;super(e,i,n),this.header=(a=(r=this.page.header)===null||r===void 0?void 0:r.item())===null||a===void 0?void 0:a.as(Fn,$m,Gh,Nt);let f=(c=this.page.metadata)===null||c===void 0?void 0:c.item().as(qm),x=(p=this.page.microformat)===null||p===void 0?void 0:p.as(yi);if(this.page.alerts){let v=this.page.alerts.first();if((v==null?void 0:v.alert_type)==="ERROR")throw new ko(v.text.toString())}if(!f&&!this.page.contents)throw new b("Invalid channel",this);this.metadata=Object.assign(Object.assign({},f),x||{}),this.subscribe_button=(d=this.page.header_memo)===null||d===void 0?void 0:d.getType(Se).first(),this.current_tab=(_=this.page.contents)===null||_===void 0?void 0:_.item().as(Rt).tabs.array().filterType(Re,Xn).get({selected:!0})}applyFilter(e){return T(this,void 0,void 0,function*(){var i;let n,r=this.memo.getType(vt).first();if(typeof e=="string"){if(n=r==null?void 0:r.contents.get({text:e}),!n)throw new b(`Filter ${e} not found`,{available_filters:this.filters})}else e instanceof Ye&&(n=e);if(!n)throw new b("Invalid filter",e);let a=yield(i=n.endpoint)===null||i===void 0?void 0:i.call(this.actions,{parse:!0});if(!a)throw new b("No page returned",{filter:n});return new Ri(this.actions,a,!0)})}applySort(e){return T(this,void 0,void 0,function*(){var i,n;let r=this.memo.getType(gt).first();if(!r)throw new b("No sort filter sub menu found");let a=(i=r==null?void 0:r.sub_menu_items)===null||i===void 0?void 0:i.find(p=>p.title===e);if(!a)throw new b(`Sort filter ${e} not found`,{available_sort_filters:this.sort_filters});if(a.selected)return this;let c=yield(n=a.endpoint)===null||n===void 0?void 0:n.call(this.actions,{parse:!0});return new Ee(this.actions,c,!0)})}applyContentTypeFilter(e){return T(this,void 0,void 0,function*(){var i,n,r,a;let c=(r=(n=(i=this.current_tab)===null||i===void 0?void 0:i.content)===null||n===void 0?void 0:n.as(ve).sub_menu)===null||r===void 0?void 0:r.as($s);if(!c)throw new b("Sub menu not found");let p=c.content_type_sub_menu_items.find(_=>_.title===e);if(!p)throw new b(`Sub menu item ${e} not found`,{available_filters:this.content_type_filters});if(p.selected)return this;let d=yield(a=p.endpoint)===null||a===void 0?void 0:a.call(this.actions,{parse:!0});return new Ee(this.actions,d,!0)})}get filters(){var e,i;return((i=(e=this.memo.getType(vt))===null||e===void 0?void 0:e[0])===null||i===void 0?void 0:i.contents.filterType(Ye).map(n=>n.text))||[]}get sort_filters(){var e;let i=this.memo.getType(gt).first();return((e=i==null?void 0:i.sub_menu_items)===null||e===void 0?void 0:e.map(n=>n.title))||[]}get content_type_filters(){var e,i,n;let r=(n=(i=(e=this.current_tab)===null||e===void 0?void 0:e.content)===null||i===void 0?void 0:i.as(ve).sub_menu)===null||n===void 0?void 0:n.as($s);return(r==null?void 0:r.content_type_sub_menu_items.map(a=>a.title))||[]}getHome(){return T(this,void 0,void 0,function*(){let e=yield this.getTabByURL("featured");return new Ee(this.actions,e.page,!0)})}getVideos(){return T(this,void 0,void 0,function*(){let e=yield this.getTabByURL("videos");return new Ee(this.actions,e.page,!0)})}getShorts(){return T(this,void 0,void 0,function*(){let e=yield this.getTabByURL("shorts");return new Ee(this.actions,e.page,!0)})}getLiveStreams(){return T(this,void 0,void 0,function*(){let e=yield this.getTabByURL("streams");return new Ee(this.actions,e.page,!0)})}getReleases(){return T(this,void 0,void 0,function*(){let e=yield this.getTabByURL("releases");return new Ee(this.actions,e.page,!0)})}getPodcasts(){return T(this,void 0,void 0,function*(){let e=yield this.getTabByURL("podcasts");return new Ee(this.actions,e.page,!0)})}getPlaylists(){return T(this,void 0,void 0,function*(){let e=yield this.getTabByURL("playlists");return new Ee(this.actions,e.page,!0)})}getCommunity(){return T(this,void 0,void 0,function*(){let e=yield this.getTabByURL("community");return new Ee(this.actions,e.page,!0)})}getAbout(){return T(this,void 0,void 0,function*(){var e,i,n,r,a;if(this.hasTabWithURL("about"))return(yield this.getTabByURL("about")).memo.getType(Ys)[0];let c=((e=this.header)===null||e===void 0?void 0:e.is(Fn))&&this.header.tagline;if(c||((i=this.header)===null||i===void 0?void 0:i.is(Nt))&&((n=this.header.content)===null||n===void 0?void 0:n.description)){if(c&&c.more_endpoint instanceof g){let _=yield c.more_endpoint.call(this.actions);return new yf(this.actions,_,!1).memo.getType(Ys)[0]}let p=(a=(r=this.page.header_memo)===null||r===void 0?void 0:r.getType(ce)[0])===null||a===void 0?void 0:a.endpoint;if(!p)throw new b("Failed to extract continuation to get channel about");let d=yield p.call(this.actions,{parse:!0});if(!d.on_response_received_endpoints_memo)throw new b("Unexpected response while fetching channel about",{response:d});return d.on_response_received_endpoints_memo.getType(Zf)[0]}throw new b("About not found")})}search(e){return T(this,void 0,void 0,function*(){var i,n;let r=(i=this.memo.getType(Xn))===null||i===void 0?void 0:i[0];if(!r)throw new b("Search tab not found",this);let a=yield(n=r.endpoint)===null||n===void 0?void 0:n.call(this.actions,{query:e,parse:!0});return new Ee(this.actions,a,!0)})}get has_home(){return this.hasTabWithURL("featured")}get has_videos(){return this.hasTabWithURL("videos")}get has_shorts(){return this.hasTabWithURL("shorts")}get has_live_streams(){return this.hasTabWithURL("streams")}get has_releases(){return this.hasTabWithURL("releases")}get has_podcasts(){return this.hasTabWithURL("podcasts")}get has_playlists(){return this.hasTabWithURL("playlists")}get has_community(){return this.hasTabWithURL("community")}get has_about(){var e,i,n,r,a;return this.hasTabWithURL("about")||!!(((e=this.header)===null||e===void 0?void 0:e.is(Fn))&&((i=this.header.tagline)===null||i===void 0?void 0:i.more_endpoint))||!!(((n=this.header)===null||n===void 0?void 0:n.is(Nt))&&((a=(r=this.header.content)===null||r===void 0?void 0:r.description)===null||a===void 0?void 0:a.more_endpoint))}get has_search(){var e;return((e=this.memo.getType(Xn))===null||e===void 0?void 0:e.length)>0}getContinuation(){let e=Object.create(null,{getContinuationData:{get:()=>super.getContinuationData}});return T(this,void 0,void 0,function*(){let i=yield e.getContinuationData.call(this);if(!i)throw new b("Could not get continuation data");return new _n(this.actions,i,!0)})}};o(Ee,"Channel");var _n=class extends Ce{constructor(e,i,n=!1){var r,a;super(e,i,n),this.contents=((r=this.page.on_response_received_actions)===null||r===void 0?void 0:r.first())||((a=this.page.on_response_received_endpoints)===null||a===void 0?void 0:a.first())}getContinuation(){let e=Object.create(null,{getContinuationData:{get:()=>super.getContinuationData}});return T(this,void 0,void 0,function*(){let i=yield e.getContinuationData.call(this);if(!i)throw new b("Could not get continuation data");return new _n(this.actions,i,!0)})}};o(_n,"ChannelListContinuation");var Ri=class extends Pi{constructor(e,i,n=!1){var r;super(e,i,n),this.applied_filter=this.memo.getType(Ye).get({is_selected:!0}),this.page.on_response_received_actions&&this.page.on_response_received_actions.length>1&&this.page.on_response_received_actions.shift(),this.contents=(r=this.page.on_response_received_actions)===null||r===void 0?void 0:r.first()}applyFilter(e){let i=Object.create(null,{getFilteredFeed:{get:()=>super.getFilteredFeed}});return T(this,void 0,void 0,function*(){let n=yield i.getFilteredFeed.call(this,e);return new Ri(this.actions,n.page,!0)})}getContinuation(){let e=Object.create(null,{getContinuationData:{get:()=>super.getContinuationData}});return T(this,void 0,void 0,function*(){let i=yield e.getContinuationData.call(this);if(!(i!=null&&i.on_response_received_actions_memo))throw new b("Unexpected continuation data",i);return i.on_response_received_actions_memo.set("FeedFilterChipBar",this.memo.getType(vt)),i.on_response_received_actions_memo.set("ChipCloudChip",this.memo.getType(Ye)),new Ri(this.actions,i,!0)})}};o(Ri,"FilteredChannelList");var So,Bt,Co,gn=class{constructor(e,i,n=!1){var r,a,c;So.set(this,void 0),Bt.set(this,void 0),Co.set(this,void 0),E(this,So,n?i:l.parseResponse(i),"f"),E(this,Bt,e,"f");let p=m(this,So,"f").on_response_received_endpoints;if(!p)throw new b("Comments page did not have any content.");let d=p.at(0),_=p.at(1);this.header=(r=d==null?void 0:d.contents)===null||r===void 0?void 0:r.firstOfType(hi);let f=((a=_==null?void 0:_.contents)===null||a===void 0?void 0:a.filterType(xh))||[];this.contents=X(f.map(x=>{var v;return(v=x.comment)===null||v===void 0||v.setActions(m(this,Bt,"f")),x.setActions(m(this,Bt,"f")),x})),E(this,Co,(c=_==null?void 0:_.contents)===null||c===void 0?void 0:c.firstOfType(ce),"f")}applySort(e){return T(this,void 0,void 0,function*(){var i,n,r,a;if(!this.header)throw new b("Page header is missing. Cannot apply sort option.");let c;if(e==="TOP_COMMENTS"?c=(n=(i=this.header.sort_menu)===null||i===void 0?void 0:i.sub_menu_items)===null||n===void 0?void 0:n.at(0):e==="NEWEST_FIRST"&&(c=(a=(r=this.header.sort_menu)===null||r===void 0?void 0:r.sub_menu_items)===null||a===void 0?void 0:a.at(1)),!c)throw new b("Could not find target button.");if(c.selected)return this;let p=yield c.endpoint.call(m(this,Bt,"f"),{parse:!0});return new gn(m(this,Bt,"f"),p,!0)})}createComment(e){return T(this,void 0,void 0,function*(){var i;if(!this.header)throw new b("Page header is missing. Cannot create comment.");let n=(i=this.header.create_renderer)===null||i===void 0?void 0:i.as(gh).submit_button;if(!n)throw new b("Could not find target button. You are probably not logged in.");if(!n.endpoint)throw new b("Button does not have an endpoint.");return yield n.endpoint.call(m(this,Bt,"f"),{commentText:e})})}getContinuation(){return T(this,void 0,void 0,function*(){if(!m(this,Co,"f"))throw new b("Continuation not found");let e=yield m(this,Co,"f").endpoint.call(m(this,Bt,"f"),{parse:!0}),i=Object.assign({},m(this,So,"f"));if(!i.on_response_received_endpoints||!e.on_response_received_endpoints)throw new b("Invalid reponse format, missing on_response_received_endpoints.");return i.on_response_received_endpoints.pop(),i.on_response_received_endpoints.push(e.on_response_received_endpoints[0]),new gn(m(this,Bt,"f"),i,!0)})}get has_continuation(){return!!m(this,Co,"f")}get page(){return m(this,So,"f")}};o(gn,"Comments");So=new WeakMap,Bt=new WeakMap,Co=new WeakMap;var UT=gn;var Eo,Pg=class{constructor(e){Eo.set(this,void 0),E(this,Eo,l.parseResponse(e),"f"),m(this,Eo,"f").items&&(this.contents=m(this,Eo,"f").items.array().as(Qn,Yh))}get page(){return m(this,Eo,"f")}};o(Pg,"Guide");Eo=new WeakMap;var jT=Pg;var Lt=class extends Ce{constructor(e,i,n=!1){super(e,i,n),this.sections=this.memo.getType(tt),this.feed_actions=this.memo.getType(vm).first()}getContinuation(){return T(this,void 0,void 0,function*(){let e=yield this.getContinuationData();if(!e)throw new Error("No continuation data found");return new Lt(this.actions,e,!0)})}};o(Lt,"History");var zt=class extends Pi{constructor(e,i,n=!1){var r;super(e,i,n),this.header=this.memo.getType(Vh).first(),this.contents=this.memo.getType(wi).first()||((r=this.page.on_response_received_actions)===null||r===void 0?void 0:r.first())}applyFilter(e){let i=Object.create(null,{getFilteredFeed:{get:()=>super.getFilteredFeed}});return T(this,void 0,void 0,function*(){let n=yield i.getFilteredFeed.call(this,e);return new zt(this.actions,n.page,!0)})}getContinuation(){let e=Object.create(null,{getContinuation:{get:()=>super.getContinuation}});return T(this,void 0,void 0,function*(){var i;let n=yield e.getContinuation.call(this);return n.page.header=this.page.header,this.header&&((i=n.page.header_memo)===null||i===void 0||i.set(this.header.type,[this.header])),new zt(this.actions,n.page,!0)})}};o(zt,"HomeFeed");var Ai=class extends Pi{constructor(e,i){if(super(e,i),!this.page.contents_memo)throw new b("Unexpected response",this.page);let n=this.page.contents_memo.getType(Re).first();if(!n.content)throw new b("Content tab has no content",n);this.page.header&&(this.header=this.page.header.item().as(Uh,Nt)),this.contents=n.content.as(wi)}applyFilter(e){let i=Object.create(null,{getFilteredFeed:{get:()=>super.getFilteredFeed}});return T(this,void 0,void 0,function*(){let n=yield i.getFilteredFeed.call(this,e);return new Ai(this.actions,n.page)})}};o(Ai,"HashtagFeed");var Ng,Rg,bf,Ag=class{constructor(e,i){Ng.set(this,void 0),Rg.set(this,void 0),bf.set(this,void 0),E(this,Ng,e,"f"),E(this,Rg,i,"f");let n=e==null?void 0:e.live_chat_item_context_menu_supported_renderers;if(!n||!n.is(F))throw new b('Response did not have a "live_chat_item_context_menu_supported_renderers" property. The call may have failed.');E(this,bf,n.as(F).items,"f")}selectItem(e){return T(this,void 0,void 0,function*(){let i;if(e instanceof I){if(!e.endpoint)throw new b("Item does not have an endpoint.");i=e.endpoint}else{let r=m(this,bf,"f").find(a=>a.is(vi)?a.as(vi).icon_type===e:!1);if(!r||!r.is(vi))throw new b(`Button "${e}" not found.`);i=r.endpoint}if(!i)throw new b("Target button does not have an endpoint.");return yield i.call(m(this,Rg,"f"),{parse:!0})})}items(){return m(this,bf,"f")}page(){return m(this,Ng,"f")}};o(Ag,"ItemMenu");Ng=new WeakMap,Rg=new WeakMap,bf=new WeakMap;var Vg=Ag;var wf,Mg,Po=class extends Ce{constructor(e,i,n=!1){var r,a,c,p,d;super(e,i,n),wf.add(this);let _=this.memo.getType(H_).first(),f=this.memo.getType(G_).first(),x=this.memo.getType($_).first(),v=(r=this.page.alerts)===null||r===void 0?void 0:r.firstOfType(Nn);if(v&&v.alert_type==="ERROR")throw new b(v.text.toString(),v);if(!f&&!x&&Object.keys(this.page).length===0)throw new b("Got empty continuation response. This is likely the end of the playlist.");this.info=Object.assign(Object.assign({},(a=this.page.metadata)===null||a===void 0?void 0:a.item().as(z_)),{subtitle:_?_.subtitle:null,author:(p=(c=x==null?void 0:x.owner)===null||c===void 0?void 0:c.as(fo).author)!==null&&p!==void 0?p:_==null?void 0:_.author,thumbnails:(d=f==null?void 0:f.thumbnail_renderer)===null||d===void 0?void 0:d.as($n,Gn).thumbnail,total_items:m(this,wf,"m",Mg).call(this,0,f),views:m(this,wf,"m",Mg).call(this,1,f),last_updated:m(this,wf,"m",Mg).call(this,2,f),can_share:_==null?void 0:_.can_share,can_delete:_==null?void 0:_.can_delete,is_editable:_==null?void 0:_.is_editable,privacy:_==null?void 0:_.privacy}),this.menu=f==null?void 0:f.menu,this.endpoint=f==null?void 0:f.endpoint,this.messages=this.memo.getType(gi)}get items(){return X(this.videos.as(ro,so,po).filter(e=>e.style!=="PLAYLIST_VIDEO_RENDERER_STYLE_RECOMMENDED_VIDEO"))}get has_continuation(){let e=this.memo.getType(ve).first();return e?!!this.memo.getType(ce).find(i=>!e.contents.includes(i)):super.has_continuation}getContinuationData(){let e=Object.create(null,{getContinuationData:{get:()=>super.getContinuationData}});return T(this,void 0,void 0,function*(){let i=this.memo.getType(ve).first();if(!i)return yield e.getContinuationData.call(this);let n=this.memo.getType(ce).find(a=>!i.contents.includes(a));if(!n)throw new b("There are no continuations.");return yield n.endpoint.call(this.actions,{parse:!0})})}getContinuation(){return T(this,void 0,void 0,function*(){let e=yield this.getContinuationData();if(!e)throw new b("Could not get continuation data");return new Po(this.actions,e,!0)})}};o(Po,"Playlist");wf=new WeakSet,Mg=o(function(e,i){var n;return!i||!i.stats?"N/A":((n=i.stats[e])===null||n===void 0?void 0:n.toString())||"N/A"},"_Playlist_getStat");var No=Po;var Gx,WT,Dg=class extends Ce{constructor(e,i){if(super(e,i),Gx.add(this),!this.page.contents_memo)throw new b("Page contents not found");this.header=this.memo.getType(Nt).first();let n=this.page.contents_memo.getType(co);this.sections=n.map(r=>{var a;return{type:r.icon_type,title:r.title,contents:((a=r.content)===null||a===void 0?void 0:a.key("items").array())||[],getAll:()=>m(this,Gx,"m",WT).call(this,r)}})}get history(){return this.sections.find(e=>e.type==="WATCH_HISTORY")}get watch_later(){return this.sections.find(e=>e.type==="WATCH_LATER")}get liked_videos(){return this.sections.find(e=>e.type==="LIKE")}get playlists_section(){return this.sections.find(e=>e.type==="PLAYLISTS")}get clips(){return this.sections.find(e=>e.type==="CONTENT_CUT")}};o(Dg,"Library");Gx=new WeakSet,WT=o(function(e){return T(this,void 0,void 0,function*(){var i;if(!(!((i=e.menu)===null||i===void 0)&&i.as(F).hasKey("top_level_buttons")))throw new b(`The ${e.title.text} shelf doesn't have more items`);let n=e.menu.as(F).top_level_buttons.firstOfType(I);if(!n)throw new b("Did not find target button.");let r=yield n.as(I).endpoint.call(this.actions,{parse:!0});switch(e.icon_type){case"LIKE":case"WATCH_LATER":return new No(this.actions,r,!0);case"WATCH_HISTORY":return new Lt(this.actions,r,!0);case"CONTENT_CUT":return new Ce(this.actions,r,!0);default:throw new b("Target shelf not implemented.")}})},"_Library_getAll");var JT=Dg;var Gt,Vi,xn,at,bt,Ke;function gk(t){let e=[];for(let i of t)if(Array.isArray(i))for(let n of i)e.push(n);else e.push(i);return e}o(gk,"flattenQueue");var Bg=class{constructor(){this.front=[],this.back=[]}isEmpty(){return!this.front.length&&!this.back.length}clear(){this.front=[],this.back=[]}getValues(){return this.front.concat(this.back.reverse())}};o(Bg,"DelayQueue");var Lg=class{constructor(){Gt.set(this,void 0),Vi.set(this,void 0),xn.set(this,void 0),at.set(this,void 0),bt.set(this,void 0),Ke.set(this,void 0),E(this,Gt,null,"f"),E(this,Vi,null,"f"),E(this,xn,null,"f"),E(this,at,[],"f"),E(this,bt,null,"f"),E(this,Ke,new Bg,"f")}enqueueActionGroup(e){if(m(this,Gt,"f")!==null){let i=Date.now()-m(this,Gt,"f");m(this,Ke,"f").back.push(i),5T(this,void 0,void 0,function*(){r.length?r.length<10?yield m(this,Pe,"m",Yg).call(this,r):this.is_replay?(m(this,Pe,"m",Yg).call(this,r),yield m(this,Pe,"m",vn).call(this,2e3)):m(this,Pe,"m",Yg).call(this,r):yield m(this,Pe,"m",vn).call(this,2e3),this.running&&m(this,Pe,"m",$x).call(this)})}on(e,i){super.on(e,i)}once(e,i){super.once(e,i)}start(){this.running||(this.running=!0,m(this,Pe,"m",$x).call(this),m(this,Pe,"m",HT).call(this))}stop(){this.smoothed_queue.clear(),this.running=!1}sendMessage(e){return T(this,void 0,void 0,function*(){let i=yield m(this,$t,"f").execute("/live_chat/send_message",{params:Cx(m(this,Fg,"f"),m(this,kf,"f")),richMessage:{textSegments:[{text:e}]},clientMessageId:W.shim.uuidv4(),client:"ANDROID",parse:!0});if(!i.actions)throw new b("Unexpected response from send_message",i);return i.actions.array().as(t_)})}applyFilter(e){var i,n,r,a,c,p,d;if(!this.initial_info)throw new b("Cannot apply filter before initial info is retrieved.");let _=(r=(n=(i=this.initial_info)===null||i===void 0?void 0:i.header)===null||n===void 0?void 0:n.view_selector)===null||r===void 0?void 0:r.sub_menu_items;if(e==="TOP_CHAT"){if(!((a=_==null?void 0:_.at(0))===null||a===void 0)&&a.selected)return;E(this,yn,(c=_==null?void 0:_.at(0))===null||c===void 0?void 0:c.continuation,"f")}else{if(!((p=_==null?void 0:_.at(1))===null||p===void 0)&&p.selected)return;E(this,yn,(d=_==null?void 0:_.at(1))===null||d===void 0?void 0:d.continuation,"f")}}getItemMenu(e){return T(this,void 0,void 0,function*(){if(!e.hasKey("menu_endpoint")||!e.key("menu_endpoint").isInstanceof(g))throw new b("This item does not have a menu.",e);let i=yield e.key("menu_endpoint").instanceof(g).call(m(this,$t,"f"),{parse:!0});if(!i)throw new b("Could not retrieve item menu.",e);return new Vg(i,m(this,$t,"f"))})}selectButton(e){return T(this,void 0,void 0,function*(){return yield e.endpoint.call(m(this,$t,"f"),{parse:!0})})}};o(Ug,"LiveChat");$t=new WeakMap,kf=new WeakMap,Fg=new WeakMap,yn=new WeakMap,Tf=new WeakMap,If=new WeakMap,Pe=new WeakSet,$x=o(function t(){T(this,void 0,void 0,function*(){var e,i;try{let n=yield m(this,$t,"f").execute(this.is_replay?"live_chat/get_live_chat_replay":"live_chat/get_live_chat",{continuation:m(this,yn,"f"),parse:!0}),r=n.continuation_contents;if(r||(this.emit("error",new b("Unexpected live chat incremental continuation response",n)),this.emit("end"),this.stop()),!(r instanceof ki)){this.stop(),this.emit("end");return}E(this,yn,r.continuation.token,"f"),r.header?(this.initial_info=r,this.emit("start",r),this.running&&m(this,Pe,"m",t).call(this)):this.smoothed_queue.enqueueActionGroup(r.actions),E(this,If,0,"f")}catch(n){this.emit("error",n),E(this,If,(i=m(this,If,"f"),e=i++,i),"f"),e<10?(yield m(this,Pe,"m",vn).call(this,2e3),m(this,Pe,"m",t).call(this)):(this.emit("error",new b("Reached retry limit for incremental continuation requests",n)),this.emit("end"),this.stop())}})},"_LiveChat_pollLivechat"),Yg=o(function(e){return T(this,void 0,void 0,function*(){let n=e.length<125?1:Math.ceil(e.length/125),r=n==1?(n=1e4/e.length,n*=Math.random()+.5,n=Math.min(1e3,n),n=Math.max(80,n)):n=80;for(let a of e)yield m(this,Pe,"m",vn).call(this,r),this.emit("chat-update",a)})},"_LiveChat_emitSmoothedActions"),HT=o(function t(){T(this,void 0,void 0,function*(){var e,i,n,r,a,c,p,d,_,f,x;try{let v={videoId:m(this,kf,"f")};m(this,Tf,"f")&&(v.continuation=m(this,Tf,"f"));let w=yield m(this,$t,"f").execute("/updated_metadata",v),k=l.parseResponse(w.data);E(this,Tf,(e=k.continuation)===null||e===void 0?void 0:e.token,"f"),this.metadata={title:((i=k.actions)===null||i===void 0?void 0:i.array().firstOfType(s_))||((n=this.metadata)===null||n===void 0?void 0:n.title),description:((r=k.actions)===null||r===void 0?void 0:r.array().firstOfType(r_))||((a=this.metadata)===null||a===void 0?void 0:a.description),views:((c=k.actions)===null||c===void 0?void 0:c.array().firstOfType(u_))||((p=this.metadata)===null||p===void 0?void 0:p.views),likes:((d=k.actions)===null||d===void 0?void 0:d.array().firstOfType(a_))||((_=this.metadata)===null||_===void 0?void 0:_.likes),date:((f=k.actions)===null||f===void 0?void 0:f.array().firstOfType(o_))||((x=this.metadata)===null||x===void 0?void 0:x.date)},this.emit("metadata-update",this.metadata),yield m(this,Pe,"m",vn).call(this,5e3),this.running&&m(this,Pe,"m",t).call(this)}catch(v){yield m(this,Pe,"m",vn).call(this,2e3),this.running&&m(this,Pe,"m",t).call(this)}})},"_LiveChat_pollMetadata"),vn=o(function(e){return T(this,void 0,void 0,function*(){return new Promise(i=>setTimeout(()=>i(),e))})},"_LiveChat_wait");var jg=Ug;var Mi,Sf,Ro=class{constructor(e,i){if(Mi.set(this,void 0),Sf.set(this,void 0),E(this,Sf,e,"f"),E(this,Mi,l.parseResponse(i.data),"f"),!m(this,Mi,"f").actions_memo)throw new b("Page actions not found");this.header=m(this,Mi,"f").actions_memo.getType(x_).first(),this.contents=m(this,Mi,"f").actions_memo.getType(V_)}getContinuation(){return T(this,void 0,void 0,function*(){var e;let i=(e=m(this,Mi,"f").actions_memo)===null||e===void 0?void 0:e.getType(ce).first();if(!i)throw new b("Continuation not found");let n=yield i.endpoint.call(m(this,Sf,"f"),{parse:!1});return new Ro(m(this,Sf,"f"),n)})}get page(){return m(this,Mi,"f")}};o(Ro,"NotificationsMenu");Mi=new WeakMap,Sf=new WeakMap;var zT=Ro;var Kt=class extends Ce{constructor(e,i,n=!1){var r,a,c;super(e,i,n);let p=((r=this.page.contents_memo)===null||r===void 0?void 0:r.getType(ve).first().contents)||((a=this.page.on_response_received_commands)===null||a===void 0?void 0:a.first().contents);if(!p)throw new b("No contents found in search response");this.page.header&&(this.header=this.page.header.item().as(eg)),this.results=X(p.filterType(tt).flatMap(d=>d.contents)),this.refinements=this.page.refinements||[],this.estimated_results=this.page.estimated_results||0,this.page.contents_memo&&(this.sub_menu=this.page.contents_memo.getType(tg).first(),this.watch_card=this.page.contents_memo.getType(cg).first()),this.refinement_cards=(c=this.results)===null||c===void 0?void 0:c.firstOfType(ui)}selectRefinementCard(e){return T(this,void 0,void 0,function*(){var i,n;let r;if(typeof e=="string"){if(!this.refinement_cards)throw new b("No refinement cards found.");if(r=(n=(i=this.refinement_cards)===null||i===void 0?void 0:i.cards.get({query:e}))===null||n===void 0?void 0:n.as(qi),!r)throw new b(`Refinement card "${e}" not found`,{available_cards:this.refinement_card_queries})}else if(e.type==="SearchRefinementCard")r=e;else throw new b("Invalid refinement card!");let a=yield r.endpoint.call(this.actions,{parse:!0});return new Kt(this.actions,a,!0)})}get refinement_card_queries(){var e;return((e=this.refinement_cards)===null||e===void 0?void 0:e.cards.as(qi).map(i=>i.query))||[]}getContinuation(){return T(this,void 0,void 0,function*(){let e=yield this.getContinuationData();if(!e)throw new b("Could not get continuation data");return new Kt(this.actions,e,!0)})}};o(Kt,"Search");var bn,Cf,Ao=class{constructor(e,i){var n,r,a,c;if(bn.set(this,void 0),Cf.set(this,void 0),E(this,Cf,e,"f"),E(this,bn,l.parseResponse(i.data),"f"),this.sidebar=(n=m(this,bn,"f").sidebar)===null||n===void 0?void 0:n.as(ng),!m(this,bn,"f").contents)throw new b("Page contents not found");let p=m(this,bn,"f").contents.item().as(Rt).tabs.array().as(Re).get({selected:!0});if(!p)throw new b("Target tab not found");let d=(r=p.content)===null||r===void 0?void 0:r.as(ve).contents.as(tt);this.introduction=(c=(a=d==null?void 0:d.shift())===null||a===void 0?void 0:a.contents)===null||c===void 0?void 0:c.firstOfType(D_),this.sections=d==null?void 0:d.map(_=>{var f;return{title:!((f=_.header)===null||f===void 0)&&f.is(hi,Zn,eo)?_.header.title.toString():null,contents:_.contents}})}selectSidebarItem(e){return T(this,void 0,void 0,function*(){if(!this.sidebar)throw new b("Sidebar not available");let i;if(typeof e=="string"){if(i=this.sidebar.items.get({title:e}),!i)throw new b(`Item "${e}" not found`,{available_items:this.sidebar_items})}else if(e!=null&&e.is(zn))i=e;else throw new b("Invalid item",{target_item:e});let n=yield i.endpoint.call(m(this,Cf,"f"),{parse:!1});return new Ao(m(this,Cf,"f"),n)})}getSettingOption(e){var i;if(!this.sections)throw new b("Sections not available");for(let n of this.sections)if(!!n.contents)for(let r of n.contents){let a=r.as(lo).options;if(a){for(let c of a)if(c.is(uo)&&((i=c.title)===null||i===void 0?void 0:i.toString())===e)return c}}throw new b(`Option "${e}" not found`,{available_options:this.setting_options})}get setting_options(){if(!this.sections)throw new b("Sections not available");let e=[];for(let i of this.sections)if(!!i.contents)for(let n of i.contents)n.as(lo).options&&(e=e.concat(n.as(lo).options));return e.map(i=>{var n;return(n=i.title)===null||n===void 0?void 0:n.toString()}).filter(i=>i)}get sidebar_items(){if(!this.sidebar)throw new b("Sidebar not available");return this.sidebar.items.map(e=>e.title.toString())}get page(){return m(this,bn,"f")}};o(Ao,"Settings");bn=new WeakMap,Cf=new WeakMap;var GT=Ao;var Vo,Wg=class{constructor(e){var i;if(Vo.set(this,void 0),E(this,Vo,l.parseResponse(e.data),"f"),!m(this,Vo,"f").contents)throw new b("Page contents not found");let n=m(this,Vo,"f").contents.item().as(rg).tabs.get({selected:!0});if(!n)throw new b("Could not find target tab.");this.contents=(i=n.content)===null||i===void 0?void 0:i.as(ve).contents.as(tt)}get page(){return m(this,Vo,"f")}};o(Wg,"TimeWatched");Vo=new WeakMap;var $T=Wg;var Di,Mo=class extends Io{constructor(e,i,n){var r,a,c,p,d,_,f,x,v,w,k,S,P,A,M,B,$,te,ue,pe,G,Y,V,q,oe,Te,Qe,ot,K;super(e,i,n),Di.set(this,void 0);let[De,Ae]=this.page;if(this.streaming_data){let _e=this.streaming_data.adaptive_formats.find(Le=>{var Ze;return(Ze=Le.audio_track)===null||Ze===void 0?void 0:Ze.audio_is_default});if(_e)this.streaming_data.formats.forEach(Le=>Le.language=_e.language);else if(((r=this.captions)===null||r===void 0?void 0:r.caption_tracks)&&((a=this.captions)===null||a===void 0?void 0:a.caption_tracks.length)>0){let Le=this.captions.caption_tracks.find(me=>me.kind==="asr"),Ze=Le==null?void 0:Le.language_code;this.streaming_data.adaptive_formats.forEach(me=>{me.has_audio&&(me.language=Ze)}),this.streaming_data.formats.forEach(me=>me.language=Ze)}}let he=(c=Ae==null?void 0:Ae.contents)===null||c===void 0?void 0:c.item().as(lg),de=he==null?void 0:he.results,Be=he==null?void 0:he.secondary_results;if(de&&Be){if(((p=De.microformat)===null||p===void 0?void 0:p.is(nt))&&((d=De.microformat)===null||d===void 0?void 0:d.category)==="Gaming"){let me=(x=(f=(_=de.firstOfType(Zd))===null||_===void 0?void 0:_.metadata)===null||f===void 0?void 0:f.rows)===null||x===void 0?void 0:x.firstOfType(Wp);me!=null&&me.is(Wp)&&(this.game_info={title:(w=(v=me==null?void 0:me.contents)===null||v===void 0?void 0:v.firstOfType(Up))===null||w===void 0?void 0:w.title,release_year:(S=(k=me==null?void 0:me.contents)===null||k===void 0?void 0:k.firstOfType(Up))===null||S===void 0?void 0:S.subtitle})}this.primary_info=de.firstOfType(pg),this.secondary_info=de.firstOfType(Zd),this.merchandise=de.firstOfType(v_),this.related_chip_cloud=(P=Be.firstOfType(X_))===null||P===void 0?void 0:P.content.as(Yn),he!=null&&he.playlist&&(this.playlist=he.playlist),this.watch_next_feed=((A=Be.firstOfType(tt))===null||A===void 0?void 0:A.contents)||Be,this.watch_next_feed&&Array.isArray(this.watch_next_feed)&&((M=this.watch_next_feed.at(-1))===null||M===void 0?void 0:M.is(ce))&&E(this,Di,(B=this.watch_next_feed.pop())===null||B===void 0?void 0:B.as(ce),"f"),this.player_overlays=($=Ae==null?void 0:Ae.player_overlays)===null||$===void 0?void 0:$.item().as(J_),he!=null&&he.autoplay&&(this.autoplay=he.autoplay);let _e=(ue=(te=this.primary_info)===null||te===void 0?void 0:te.menu)===null||ue===void 0?void 0:ue.top_level_buttons.firstOfType(sn);((pe=_e==null?void 0:_e.like_button)===null||pe===void 0?void 0:pe.is(xe))&&((G=_e==null?void 0:_e.dislike_button)===null||G===void 0?void 0:G.is(xe))&&(this.basic_info.like_count=(Y=_e==null?void 0:_e.like_button)===null||Y===void 0?void 0:Y.like_count,this.basic_info.is_liked=(V=_e==null?void 0:_e.like_button)===null||V===void 0?void 0:V.is_toggled,this.basic_info.is_disliked=(q=_e==null?void 0:_e.dislike_button)===null||q===void 0?void 0:q.is_toggled);let Le=(Te=(oe=this.primary_info)===null||oe===void 0?void 0:oe.menu)===null||Te===void 0?void 0:Te.top_level_buttons.firstOfType(an);if(Le&&(this.basic_info.like_count=Le.like_count,Le.like_button)){let me=Le.like_button.like_status_entity.like_status;this.basic_info.is_liked=me==="LIKE",this.basic_info.is_disliked=me==="DISLIKE"}let Ze=(Qe=de.get({target_id:"comments-entry-point"}))===null||Qe===void 0?void 0:Qe.as(tt);this.comments_entry_point_header=(ot=Ze==null?void 0:Ze.contents)===null||ot===void 0?void 0:ot.firstOfType(_h),this.livechat=(K=Ae==null?void 0:Ae.contents_memo)===null||K===void 0?void 0:K.getType(Qh).first()}}selectFilter(e){return T(this,void 0,void 0,function*(){var i,n,r,a;if(!this.related_chip_cloud)throw new b("Chip cloud not found, cannot apply filter");let c;if(typeof e=="string"){let _=(n=(i=this.related_chip_cloud)===null||i===void 0?void 0:i.chips)===null||n===void 0?void 0:n.get({text:e});if(!_)throw new b("Invalid filter",{available_filters:this.filters});c=_}else if(e!=null&&e.is(Ye))c=e;else throw new b("Invalid cloud chip",e);if(c.is_selected)return this;let p=yield(r=c.endpoint)===null||r===void 0?void 0:r.call(this.actions,{parse:!0}),d=(a=p==null?void 0:p.on_response_received_endpoints)===null||a===void 0?void 0:a.get({target_id:"watch-next-feed"});return this.watch_next_feed=d==null?void 0:d.contents,this})}addToWatchHistory(){let e=Object.create(null,{addToWatchHistory:{get:()=>super.addToWatchHistory}});return T(this,arguments,void 0,function*(i={}){return e.addToWatchHistory.call(this,i)})}getWatchNextContinuation(){return T(this,void 0,void 0,function*(){var e,i,n,r,a;if(!m(this,Di,"f"))throw new b("Watch next feed continuation not found");let c=yield(e=m(this,Di,"f"))===null||e===void 0?void 0:e.endpoint.call(this.actions,{parse:!0}),p=(i=c==null?void 0:c.on_response_received_endpoints)===null||i===void 0?void 0:i.get({type:"AppendContinuationItemsAction"});if(!p)throw new b("AppendContinuationItemsAction not found");return this.watch_next_feed=p==null?void 0:p.contents,!((r=(n=this.watch_next_feed)===null||n===void 0?void 0:n.at(-1))===null||r===void 0)&&r.is(ce)?E(this,Di,(a=this.watch_next_feed.pop())===null||a===void 0?void 0:a.as(ce),"f"):E(this,Di,void 0,"f"),this})}like(){return T(this,void 0,void 0,function*(){var e,i,n,r,a;let c=(i=(e=this.primary_info)===null||e===void 0?void 0:e.menu)===null||i===void 0?void 0:i.top_level_buttons.firstOfType(an);if(c){let f=(n=c==null?void 0:c.like_button)===null||n===void 0?void 0:n.toggle_button;if(!f||!f.default_button||!c.like_button)throw new b("Like button not found",{video_id:this.basic_info.id});if(c.like_button.like_status_entity.like_status==="LIKE")throw new b("This video is already liked",{video_id:this.basic_info.id});return yield new g(f.default_button.on_tap.payload.commands.find(k=>k.innertubeCommand)).call(this.actions)}let p=(a=(r=this.primary_info)===null||r===void 0?void 0:r.menu)===null||a===void 0?void 0:a.top_level_buttons.firstOfType(sn),d=p==null?void 0:p.like_button;if(!d)throw new b("Like button not found",{video_id:this.basic_info.id});if(!d.is(xe))throw new b("Like button is not a toggle button. This action is likely disabled for this video.",{video_id:this.basic_info.id});if(d.is_toggled)throw new b("This video is already liked",{video_id:this.basic_info.id});return yield d.endpoint.call(this.actions)})}dislike(){return T(this,void 0,void 0,function*(){var e,i,n,r,a;let c=(i=(e=this.primary_info)===null||e===void 0?void 0:e.menu)===null||i===void 0?void 0:i.top_level_buttons.firstOfType(an);if(c){let f=(n=c==null?void 0:c.dislike_button)===null||n===void 0?void 0:n.toggle_button;if(!f||!f.default_button||!c.dislike_button||!c.like_button)throw new b("Dislike button not found",{video_id:this.basic_info.id});if(c.like_button.like_status_entity.like_status==="DISLIKE")throw new b("This video is already disliked",{video_id:this.basic_info.id});return yield new g(f.default_button.on_tap.payload.commands.find(k=>k.innertubeCommand)).call(this.actions)}let p=(a=(r=this.primary_info)===null||r===void 0?void 0:r.menu)===null||a===void 0?void 0:a.top_level_buttons.firstOfType(sn),d=p==null?void 0:p.dislike_button;if(!d)throw new b("Dislike button not found",{video_id:this.basic_info.id});if(!d.is(xe))throw new b("Dislike button is not a toggle button. This action is likely disabled for this video.",{video_id:this.basic_info.id});if(d.is_toggled)throw new b("This video is already disliked",{video_id:this.basic_info.id});return yield d.endpoint.call(this.actions)})}removeRating(){return T(this,void 0,void 0,function*(){var e,i,n,r,a,c,p;let d,_=(i=(e=this.primary_info)===null||e===void 0?void 0:e.menu)===null||i===void 0?void 0:i.top_level_buttons.firstOfType(an);if(_){let k=(n=_==null?void 0:_.like_button)===null||n===void 0?void 0:n.toggle_button;if(!k||!k.default_button||!_.like_button)throw new b("Like button not found",{video_id:this.basic_info.id});let S=_.like_button.like_status_entity.like_status;if(S==="LIKE")d=(r=_==null?void 0:_.like_button)===null||r===void 0?void 0:r.toggle_button;else if(S==="DISLIKE")d=(a=_==null?void 0:_.dislike_button)===null||a===void 0?void 0:a.toggle_button;else throw new b("This video is not liked/disliked",{video_id:this.basic_info.id});if(!d||!d.toggled_button)throw new b("Like/Dislike button not found",{video_id:this.basic_info.id});return yield new g(d.toggled_button.on_tap.payload.commands.find(M=>M.innertubeCommand)).call(this.actions)}let f=(p=(c=this.primary_info)===null||c===void 0?void 0:c.menu)===null||p===void 0?void 0:p.top_level_buttons.firstOfType(sn),x=f==null?void 0:f.like_button,v=f==null?void 0:f.dislike_button;if(!(x!=null&&x.is(xe))||!(v!=null&&v.is(xe)))throw new b("Like/Dislike button is not a toggle button. This action is likely disabled for this video.",{video_id:this.basic_info.id});if(x!=null&&x.is_toggled?d=x:v!=null&&v.is_toggled&&(d=v),!d)throw new b("This video is not liked/disliked",{video_id:this.basic_info.id});return yield d.toggled_endpoint.call(this.actions)})}getLiveChat(){if(!this.livechat)throw new b("Live Chat is not available",{video_id:this.basic_info.id});return new jg(this)}getTrailerInfo(){var e,i;if(this.has_trailer&&this.playability_status){let n=(i=(e=this.playability_status.error_screen)===null||e===void 0?void 0:e.as(up).trailer)===null||i===void 0?void 0:i.player_response;if(n)return new Mo([{data:n}],this.actions,this.cpn)}return null}get filters(){var e,i;return((i=(e=this.related_chip_cloud)===null||e===void 0?void 0:e.chips)===null||i===void 0?void 0:i.map(n=>{var r;return(r=n.text)===null||r===void 0?void 0:r.toString()}))||[]}get wn_has_continuation(){return!!m(this,Di,"f")}get autoplay_video_endpoint(){var e,i,n;return((n=(i=(e=this.autoplay)===null||e===void 0?void 0:e.sets)===null||i===void 0?void 0:i[0])===null||n===void 0?void 0:n.autoplay_video)||null}get has_trailer(){var e,i;return!!(!((i=(e=this.playability_status)===null||e===void 0?void 0:e.error_screen)===null||i===void 0)&&i.is(up))}get music_tracks(){var e,i,n,r,a,c;let p=(i=(e=this.page[1])===null||e===void 0?void 0:e.engagement_panels)===null||i===void 0?void 0:i.filter(d=>{var _;return(_=d.content)===null||_===void 0?void 0:_.is(Qi)});if(p!==void 0&&p.length>0){let d=(a=(r=(n=p[0].content)===null||n===void 0?void 0:n.as(Qi))===null||r===void 0?void 0:r.items)===null||a===void 0?void 0:a.filterType(Ln);if(d!==void 0&&d.length>0)return(c=d[0].carousel_lockups)===null||c===void 0?void 0:c.map(_=>{var f,x,v,w,k,S,P,A,M,B,$,te,ue,pe,G,Y,V,q,oe;let Te,Qe,ot,K,De,Ae;Te=(x=(f=_.video_lockup)===null||f===void 0?void 0:f.title)===null||x===void 0?void 0:x.toString(),De=(v=_.video_lockup)===null||v===void 0?void 0:v.endpoint.payload.videoId;for(let he=0;he<_.info_rows.length;he++){let de=_.info_rows[he];if(de.info_row_expand_status_key===void 0)if(Te===void 0){if(Te=((w=de.default_metadata)===null||w===void 0?void 0:w.toString())||((k=de.expanded_metadata)===null||k===void 0?void 0:k.toString()),De===void 0){let Be=((S=de.default_metadata)===null||S===void 0?void 0:S.endpoint)||((P=de.expanded_metadata)===null||P===void 0?void 0:P.endpoint);De=(A=Be==null?void 0:Be.payload)===null||A===void 0?void 0:A.videoId}}else ot=((M=de.default_metadata)===null||M===void 0?void 0:M.toString())||((B=de.expanded_metadata)===null||B===void 0?void 0:B.toString());else{if((($=de.info_row_expand_status_key)===null||$===void 0?void 0:$.indexOf("structured-description-music-section-artists-row-state-id"))!==-1&&(Qe=((te=de.default_metadata)===null||te===void 0?void 0:te.toString())||((ue=de.expanded_metadata)===null||ue===void 0?void 0:ue.toString()),Ae===void 0)){let Be=((pe=de.default_metadata)===null||pe===void 0?void 0:pe.endpoint)||((G=de.expanded_metadata)===null||G===void 0?void 0:G.endpoint);Ae=(Y=Be==null?void 0:Be.payload)===null||Y===void 0?void 0:Y.browseId}((V=de.info_row_expand_status_key)===null||V===void 0?void 0:V.indexOf("structured-description-music-section-licenses-row-state-id"))!==-1&&(K=((q=de.default_metadata)===null||q===void 0?void 0:q.toString())||((oe=de.expanded_metadata)===null||oe===void 0?void 0:oe.toString()))}}return{song:Te,artist:Qe,album:ot,license:K,videoId:De,channelId:Ae}})}return[]}};o(Mo,"VideoInfo");Di=new WeakMap;var Ef=Mo;var Do,Pf,Bo=class{constructor(e,i){if(Do.set(this,void 0),Pf.set(this,void 0),E(this,Do,l.parseResponse(i.data),"f"),E(this,Pf,e,"f"),!m(this,Do,"f").actions_memo)throw new Error("Page actions not found");this.transcript=m(this,Do,"f").actions_memo.getType(Pn).first()}selectLanguage(e){return T(this,void 0,void 0,function*(){var i,n,r,a;let c=(a=(r=(n=(i=this.transcript.content)===null||i===void 0?void 0:i.footer)===null||n===void 0?void 0:n.language_menu)===null||r===void 0?void 0:r.sub_menu_items)===null||a===void 0?void 0:a.find(d=>d.title.toString()===e);if(!c)throw new Error(`Language not found: ${e}`);if(c.selected)return this;let p=yield m(this,Pf,"f").execute("/get_transcript",{params:c.continuation});return new Bo(m(this,Pf,"f"),p)})}get languages(){var e,i,n,r;return((r=(n=(i=(e=this.transcript.content)===null||e===void 0?void 0:e.footer)===null||i===void 0?void 0:i.language_menu)===null||n===void 0?void 0:n.sub_menu_items)===null||r===void 0?void 0:r.map(a=>a.title.toString()))||[]}get selectedLanguage(){var e,i,n,r,a;return((a=(r=(n=(i=(e=this.transcript.content)===null||e===void 0?void 0:e.footer)===null||i===void 0?void 0:i.language_menu)===null||n===void 0?void 0:n.sub_menu_items)===null||r===void 0?void 0:r.find(c=>c.selected))===null||a===void 0?void 0:a.title.toString())||""}get page(){return m(this,Do,"f")}};o(Bo,"TranscriptInfo");Do=new WeakMap,Pf=new WeakMap;var Eg=Bo;var KT={};var D=class{constructor(e,i,n,r){var a,c,p,d,_,f,x,v,w,k,S,P,A,M,B,$,te,ue,pe,G,Y,V,q,oe,Te,Qe,ot;let K=new u(e);this.id=r||((d=(p=(c=(a=K==null?void 0:K.runs)===null||a===void 0?void 0:a[0])===null||c===void 0?void 0:c.endpoint)===null||p===void 0?void 0:p.payload)===null||d===void 0?void 0:d.browseId)||((f=(_=K==null?void 0:K.endpoint)===null||_===void 0?void 0:_.payload)===null||f===void 0?void 0:f.browseId)||"N/A",this.name=(K==null?void 0:K.text)||"N/A",this.thumbnails=n?y.fromResponse(n):[],this.endpoint=((v=(x=K==null?void 0:K.runs)===null||x===void 0?void 0:x[0])===null||v===void 0?void 0:v.endpoint)||(K==null?void 0:K.endpoint),i?Array.isArray(i)?(this.badges=l.parseArray(i),this.is_moderator=(w=this.badges)===null||w===void 0?void 0:w.some(De=>De.icon_type=="MODERATOR"),this.is_verified=(k=this.badges)===null||k===void 0?void 0:k.some(De=>De.style=="BADGE_STYLE_TYPE_VERIFIED"),this.is_verified_artist=(S=this.badges)===null||S===void 0?void 0:S.some(De=>De.style=="BADGE_STYLE_TYPE_VERIFIED_ARTIST")):(this.badges=X([]),this.is_verified=!!i.isVerified,this.is_verified_artist=!!i.isArtist):this.badges=X([]),this.url=((B=(M=(A=(P=K==null?void 0:K.runs)===null||P===void 0?void 0:P[0])===null||A===void 0?void 0:A.endpoint)===null||M===void 0?void 0:M.metadata)===null||B===void 0?void 0:B.api_url)==="/browse"&&`${et.YT_BASE}${((pe=(ue=(te=($=K==null?void 0:K.runs)===null||$===void 0?void 0:$[0])===null||te===void 0?void 0:te.endpoint)===null||ue===void 0?void 0:ue.payload)===null||pe===void 0?void 0:pe.canonicalBaseUrl)||`/u/${(q=(V=(Y=(G=K==null?void 0:K.runs)===null||G===void 0?void 0:G[0])===null||Y===void 0?void 0:Y.endpoint)===null||V===void 0?void 0:V.payload)===null||q===void 0?void 0:q.browseId}`}`||`${et.YT_BASE}${((Te=(oe=K==null?void 0:K.endpoint)===null||oe===void 0?void 0:oe.payload)===null||Te===void 0?void 0:Te.canonicalBaseUrl)||`/u/${(ot=(Qe=K==null?void 0:K.endpoint)===null||Qe===void 0?void 0:Qe.payload)===null||ot===void 0?void 0:ot.browseId}`}`}get best_thumbnail(){return this.thumbnails[0]}};o(D,"Author");var xk=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,370,1,81,2,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,10,1,2,0,49,6,4,4,14,9,5351,0,7,14,13835,9,87,9,39,4,60,6,26,9,1014,0,2,54,8,3,82,0,12,1,19628,1,4706,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,983,6,110,6,6,9,4759,9,787719,239],t1=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,68,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,349,41,7,1,79,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,4026,582,8634,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,43,8,8936,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,757,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4153,7,221,3,5761,15,7472,16,621,2467,541,1507,4938,6,4191],vk="\u200C\u200D\xB7\u0300-\u036F\u0387\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u0669\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07C0-\u07C9\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0966-\u096F\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09E6-\u09EF\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A66-\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AE6-\u0AEF\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B66-\u0B6F\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE6-\u0BEF\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CE6-\u0CEF\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D66-\u0D6F\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0E50-\u0E59\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0ED0-\u0ED9\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1040-\u1049\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109D\u135D-\u135F\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u17E0-\u17E9\u180B-\u180D\u180F-\u1819\u18A9\u1920-\u192B\u1930-\u193B\u1946-\u194F\u19D0-\u19DA\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AB0-\u1ABD\u1ABF-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BF3\u1C24-\u1C37\u1C40-\u1C49\u1C50-\u1C59\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u200C\u200D\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\u30FB\uA620-\uA629\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F1\uA8FF-\uA909\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9D0-\uA9D9\uA9E5\uA9F0-\uA9F9\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA50-\uAA59\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uABF0-\uABF9\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFF10-\uFF19\uFF3F\uFF65",i1="\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC",Xx={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},Qx="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",yk={5:Qx,"5module":Qx+" export import",6:Qx+" const class extends export import super"},bk=/^in(stanceof)?$/,wk=new RegExp("["+i1+"]"),Tk=new RegExp("["+i1+vk+"]");function e0(t,e){for(var i=65536,n=0;nt)return!1;if(i+=e[n+1],i>=t)return!0}return!1}o(e0,"isInAstralSet");function qt(t,e){return t<65?t===36:t<91?!0:t<97?t===95:t<123?!0:t<=65535?t>=170&&wk.test(String.fromCharCode(t)):e===!1?!1:e0(t,t1)}o(qt,"isIdentifierStart");function Lo(t,e){return t<48?t===36:t<58?!0:t<65?!1:t<91?!0:t<97?t===95:t<123?!0:t<=65535?t>=170&&Tk.test(String.fromCharCode(t)):e===!1?!1:e0(t,t1)||e0(t,xk)}o(Lo,"isIdentifierChar");var ae=o(function(e,i){i===void 0&&(i={}),this.label=e,this.keyword=i.keyword,this.beforeExpr=!!i.beforeExpr,this.startsExpr=!!i.startsExpr,this.isLoop=!!i.isLoop,this.isAssign=!!i.isAssign,this.prefix=!!i.prefix,this.postfix=!!i.postfix,this.binop=i.binop||null,this.updateContext=null},"TokenType");function ut(t,e){return new ae(t,{beforeExpr:!0,binop:e})}o(ut,"binop");var lt={beforeExpr:!0},qe={startsExpr:!0},o0={};function ne(t,e){return e===void 0&&(e={}),e.keyword=t,o0[t]=new ae(t,e)}o(ne,"kw");var h={num:new ae("num",qe),regexp:new ae("regexp",qe),string:new ae("string",qe),name:new ae("name",qe),privateId:new ae("privateId",qe),eof:new ae("eof"),bracketL:new ae("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new ae("]"),braceL:new ae("{",{beforeExpr:!0,startsExpr:!0}),braceR:new ae("}"),parenL:new ae("(",{beforeExpr:!0,startsExpr:!0}),parenR:new ae(")"),comma:new ae(",",lt),semi:new ae(";",lt),colon:new ae(":",lt),dot:new ae("."),question:new ae("?",lt),questionDot:new ae("?."),arrow:new ae("=>",lt),template:new ae("template"),invalidTemplate:new ae("invalidTemplate"),ellipsis:new ae("...",lt),backQuote:new ae("`",qe),dollarBraceL:new ae("${",{beforeExpr:!0,startsExpr:!0}),eq:new ae("=",{beforeExpr:!0,isAssign:!0}),assign:new ae("_=",{beforeExpr:!0,isAssign:!0}),incDec:new ae("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new ae("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:ut("||",1),logicalAND:ut("&&",2),bitwiseOR:ut("|",3),bitwiseXOR:ut("^",4),bitwiseAND:ut("&",5),equality:ut("==/!=/===/!==",6),relational:ut("/<=/>=",7),bitShift:ut("<>/>>>",8),plusMin:new ae("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:ut("%",10),star:ut("*",10),slash:ut("/",10),starstar:new ae("**",{beforeExpr:!0}),coalesce:ut("??",1),_break:ne("break"),_case:ne("case",lt),_catch:ne("catch"),_continue:ne("continue"),_debugger:ne("debugger"),_default:ne("default",lt),_do:ne("do",{isLoop:!0,beforeExpr:!0}),_else:ne("else",lt),_finally:ne("finally"),_for:ne("for",{isLoop:!0}),_function:ne("function",qe),_if:ne("if"),_return:ne("return",lt),_switch:ne("switch"),_throw:ne("throw",lt),_try:ne("try"),_var:ne("var"),_const:ne("const"),_while:ne("while",{isLoop:!0}),_with:ne("with"),_new:ne("new",{beforeExpr:!0,startsExpr:!0}),_this:ne("this",qe),_super:ne("super",qe),_class:ne("class",qe),_extends:ne("extends",lt),_export:ne("export"),_import:ne("import",qe),_null:ne("null",qe),_true:ne("true",qe),_false:ne("false",qe),_in:ne("in",{beforeExpr:!0,binop:7}),_instanceof:ne("instanceof",{beforeExpr:!0,binop:7}),_typeof:ne("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:ne("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:ne("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},dt=/\r\n?|\n|\u2028|\u2029/,Ik=new RegExp(dt.source,"g");function Oo(t){return t===10||t===13||t===8232||t===8233}o(Oo,"isNewLine");function n1(t,e,i){i===void 0&&(i=t.length);for(var n=e;n>10)+55296,(t&1023)+56320))}o(Li,"codePointToString");var Ck=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,Rf=o(function(e,i){this.line=e,this.column=i},"Position");Rf.prototype.offset=o(function(e){return new Rf(this.line,this.column+e)},"offset");var Kg=o(function(e,i,n){this.start=i,this.end=n,e.sourceFile!==null&&(this.source=e.sourceFile)},"SourceLocation");function s1(t,e){for(var i=1,n=0;;){var r=n1(t,n,e);if(r<0)return new Rf(i,e-n);++i,n=r}}o(s1,"getLineInfo");var t0={ecmaVersion:null,sourceType:"script",onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,checkPrivateFields:!0,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},QT=!1;function Ek(t){var e={};for(var i in t0)e[i]=t&&Vf(t,i)?t[i]:t0[i];if(e.ecmaVersion==="latest"?e.ecmaVersion=1e8:e.ecmaVersion==null?(!QT&&typeof console=="object"&&console.warn&&(QT=!0,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required. -Defaulting to 2020, but this will stop working in the future.`)),e.ecmaVersion=11):e.ecmaVersion>=2015&&(e.ecmaVersion-=2009),e.allowReserved==null&&(e.allowReserved=e.ecmaVersion<5),(!t||t.allowHashBang==null)&&(e.allowHashBang=e.ecmaVersion>=14),qT(e.onToken)){var n=e.onToken;e.onToken=function(r){return n.push(r)}}return qT(e.onComment)&&(e.onComment=Pk(e,e.onComment)),e}o(Ek,"getOptions");function Pk(t,e){return function(i,n,r,a,c,p){var d={type:i?"Block":"Line",value:n,start:r,end:a};t.locations&&(d.loc=new Kg(this,c,p)),t.ranges&&(d.range=[r,a]),e.push(d)}}o(Pk,"pushComment");var Af=1,Fo=2,r0=4,a1=8,u1=16,l1=32,s0=64,c1=128,Mf=256,a0=Af|Fo|Mf;function u0(t,e){return Fo|(t?r0:0)|(e?a1:0)}o(u0,"functionFlags");var Hg=0,l0=1,Qt=2,p1=3,d1=4,f1=5,we=o(function(e,i,n){this.options=e=Ek(e),this.sourceFile=e.sourceFile,this.keywords=Bi(yk[e.ecmaVersion>=6?6:e.sourceType==="module"?"5module":5]);var r="";e.allowReserved!==!0&&(r=Xx[e.ecmaVersion>=6?6:e.ecmaVersion===5?5:3],e.sourceType==="module"&&(r+=" await")),this.reservedWords=Bi(r);var a=(r?r+" ":"")+Xx.strict;this.reservedWordsStrict=Bi(a),this.reservedWordsStrictBind=Bi(a+" "+Xx.strictBind),this.input=String(i),this.containsEsc=!1,n?(this.pos=n,this.lineStart=this.input.lastIndexOf(` -`,n-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(dt).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=h.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule=e.sourceType==="module",this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.potentialArrowInForAwait=!1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports=Object.create(null),this.pos===0&&e.allowHashBang&&this.input.slice(0,2)==="#!"&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(Af),this.regexpState=null,this.privateNameStack=[]},"Parser"),Ot={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},canAwait:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0},allowNewDotTarget:{configurable:!0},inClassStaticBlock:{configurable:!0}};we.prototype.parse=o(function(){var e=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(e)},"parse");Ot.inFunction.get=function(){return(this.currentVarScope().flags&Fo)>0};Ot.inGenerator.get=function(){return(this.currentVarScope().flags&a1)>0&&!this.currentVarScope().inClassFieldInit};Ot.inAsync.get=function(){return(this.currentVarScope().flags&r0)>0&&!this.currentVarScope().inClassFieldInit};Ot.canAwait.get=function(){for(var t=this.scopeStack.length-1;t>=0;t--){var e=this.scopeStack[t];if(e.inClassFieldInit||e.flags&Mf)return!1;if(e.flags&Fo)return(e.flags&r0)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction};Ot.allowSuper.get=function(){var t=this.currentThisScope(),e=t.flags,i=t.inClassFieldInit;return(e&s0)>0||i||this.options.allowSuperOutsideMethod};Ot.allowDirectSuper.get=function(){return(this.currentThisScope().flags&c1)>0};Ot.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())};Ot.allowNewDotTarget.get=function(){var t=this.currentThisScope(),e=t.flags,i=t.inClassFieldInit;return(e&(Fo|Mf))>0||i};Ot.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&Mf)>0};we.extend=o(function(){for(var e=[],i=arguments.length;i--;)e[i]=arguments[i];for(var n=this,r=0;r=,?^&]/.test(r)||r==="!"&&this.input.charAt(n+1)==="=")}t+=e[0].length,ct.lastIndex=t,t+=ct.exec(this.input)[0].length,this.input[t]===";"&&t++}};Je.eat=function(t){return this.type===t?(this.next(),!0):!1};Je.isContextual=function(t){return this.type===h.name&&this.value===t&&!this.containsEsc};Je.eatContextual=function(t){return this.isContextual(t)?(this.next(),!0):!1};Je.expectContextual=function(t){this.eatContextual(t)||this.unexpected()};Je.canInsertSemicolon=function(){return this.type===h.eof||this.type===h.braceR||dt.test(this.input.slice(this.lastTokEnd,this.start))};Je.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0};Je.semicolon=function(){!this.eat(h.semi)&&!this.insertSemicolon()&&this.unexpected()};Je.afterTrailingComma=function(t,e){if(this.type===t)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),e||this.next(),!0};Je.expect=function(t){this.eat(t)||this.unexpected()};Je.unexpected=function(t){this.raise(t!=null?t:this.start,"Unexpected token")};var qg=o(function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1},"DestructuringErrors");Je.checkPatternErrors=function(t,e){if(!!t){t.trailingComma>-1&&this.raiseRecoverable(t.trailingComma,"Comma is not permitted after the rest element");var i=e?t.parenthesizedAssign:t.parenthesizedBind;i>-1&&this.raiseRecoverable(i,e?"Assigning to rvalue":"Parenthesized pattern")}};Je.checkExpressionErrors=function(t,e){if(!t)return!1;var i=t.shorthandAssign,n=t.doubleProto;if(!e)return i>=0||n>=0;i>=0&&this.raise(i,"Shorthand property assignments are valid only in destructuring patterns"),n>=0&&this.raiseRecoverable(n,"Redefinition of __proto__ property")};Je.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos55295&&n<56320)return!0;if(qt(n,!0)){for(var r=i+1;Lo(n=this.input.charCodeAt(r),!0);)++r;if(n===92||n>55295&&n<56320)return!0;var a=this.input.slice(i,r);if(!bk.test(a))return!0}return!1};O.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;ct.lastIndex=this.pos;var t=ct.exec(this.input),e=this.pos+t[0].length,i;return!dt.test(this.input.slice(this.pos,e))&&this.input.slice(e,e+8)==="function"&&(e+8===this.input.length||!(Lo(i=this.input.charCodeAt(e+8))||i>55295&&i<56320))};O.parseStatement=function(t,e,i){var n=this.type,r=this.startNode(),a;switch(this.isLet(t)&&(n=h._var,a="let"),n){case h._break:case h._continue:return this.parseBreakContinueStatement(r,n.keyword);case h._debugger:return this.parseDebuggerStatement(r);case h._do:return this.parseDoStatement(r);case h._for:return this.parseForStatement(r);case h._function:return t&&(this.strict||t!=="if"&&t!=="label")&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(r,!1,!t);case h._class:return t&&this.unexpected(),this.parseClass(r,!0);case h._if:return this.parseIfStatement(r);case h._return:return this.parseReturnStatement(r);case h._switch:return this.parseSwitchStatement(r);case h._throw:return this.parseThrowStatement(r);case h._try:return this.parseTryStatement(r);case h._const:case h._var:return a=a||this.value,t&&a!=="var"&&this.unexpected(),this.parseVarStatement(r,a);case h._while:return this.parseWhileStatement(r);case h._with:return this.parseWithStatement(r);case h.braceL:return this.parseBlock(!0,r);case h.semi:return this.parseEmptyStatement(r);case h._export:case h._import:if(this.options.ecmaVersion>10&&n===h._import){ct.lastIndex=this.pos;var c=ct.exec(this.input),p=this.pos+c[0].length,d=this.input.charCodeAt(p);if(d===40||d===46)return this.parseExpressionStatement(r,this.parseExpression())}return this.options.allowImportExportEverywhere||(e||this.raise(this.start,"'import' and 'export' may only appear at the top level"),this.inModule||this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")),n===h._import?this.parseImport(r):this.parseExport(r,i);default:if(this.isAsyncFunction())return t&&this.unexpected(),this.next(),this.parseFunctionStatement(r,!0,!t);var _=this.value,f=this.parseExpression();return n===h.name&&f.type==="Identifier"&&this.eat(h.colon)?this.parseLabeledStatement(r,_,f,t):this.parseExpressionStatement(r,f)}};O.parseBreakContinueStatement=function(t,e){var i=e==="break";this.next(),this.eat(h.semi)||this.insertSemicolon()?t.label=null:this.type!==h.name?this.unexpected():(t.label=this.parseIdent(),this.semicolon());for(var n=0;n=6?this.eat(h.semi):this.semicolon(),this.finishNode(t,"DoWhileStatement")};O.parseForStatement=function(t){this.next();var e=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(c0),this.enterScope(0),this.expect(h.parenL),this.type===h.semi)return e>-1&&this.unexpected(e),this.parseFor(t,null);var i=this.isLet();if(this.type===h._var||this.type===h._const||i){var n=this.startNode(),r=i?"let":this.value;return this.next(),this.parseVar(n,!0,r),this.finishNode(n,"VariableDeclaration"),(this.type===h._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&n.declarations.length===1?(this.options.ecmaVersion>=9&&(this.type===h._in?e>-1&&this.unexpected(e):t.await=e>-1),this.parseForIn(t,n)):(e>-1&&this.unexpected(e),this.parseFor(t,n))}var a=this.isContextual("let"),c=!1,p=this.containsEsc,d=new qg,_=this.start,f=e>-1?this.parseExprSubscripts(d,"await"):this.parseExpression(!0,d);return this.type===h._in||(c=this.options.ecmaVersion>=6&&this.isContextual("of"))?(e>-1?(this.type===h._in&&this.unexpected(e),t.await=!0):c&&this.options.ecmaVersion>=8&&(f.start===_&&!p&&f.type==="Identifier"&&f.name==="async"?this.unexpected():this.options.ecmaVersion>=9&&(t.await=!1)),a&&c&&this.raise(f.start,"The left-hand side of a for-of loop may not start with 'let'."),this.toAssignable(f,!1,d),this.checkLValPattern(f),this.parseForIn(t,f)):(this.checkExpressionErrors(d,!0),e>-1&&this.unexpected(e),this.parseFor(t,f))};O.parseFunctionStatement=function(t,e,i){return this.next(),this.parseFunction(t,Nf|(i?0:i0),!1,e)};O.parseIfStatement=function(t){return this.next(),t.test=this.parseParenExpression(),t.consequent=this.parseStatement("if"),t.alternate=this.eat(h._else)?this.parseStatement("if"):null,this.finishNode(t,"IfStatement")};O.parseReturnStatement=function(t){return!this.inFunction&&!this.options.allowReturnOutsideFunction&&this.raise(this.start,"'return' outside of function"),this.next(),this.eat(h.semi)||this.insertSemicolon()?t.argument=null:(t.argument=this.parseExpression(),this.semicolon()),this.finishNode(t,"ReturnStatement")};O.parseSwitchStatement=function(t){this.next(),t.discriminant=this.parseParenExpression(),t.cases=[],this.expect(h.braceL),this.labels.push(Rk),this.enterScope(0);for(var e,i=!1;this.type!==h.braceR;)if(this.type===h._case||this.type===h._default){var n=this.type===h._case;e&&this.finishNode(e,"SwitchCase"),t.cases.push(e=this.startNode()),e.consequent=[],this.next(),n?e.test=this.parseExpression():(i&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),i=!0,e.test=null),this.expect(h.colon)}else e||this.unexpected(),e.consequent.push(this.parseStatement(null));return this.exitScope(),e&&this.finishNode(e,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(t,"SwitchStatement")};O.parseThrowStatement=function(t){return this.next(),dt.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw"),t.argument=this.parseExpression(),this.semicolon(),this.finishNode(t,"ThrowStatement")};var Ak=[];O.parseCatchClauseParam=function(){var t=this.parseBindingAtom(),e=t.type==="Identifier";return this.enterScope(e?l1:0),this.checkLValPattern(t,e?d1:Qt),this.expect(h.parenR),t};O.parseTryStatement=function(t){if(this.next(),t.block=this.parseBlock(),t.handler=null,this.type===h._catch){var e=this.startNode();this.next(),this.eat(h.parenL)?e.param=this.parseCatchClauseParam():(this.options.ecmaVersion<10&&this.unexpected(),e.param=null,this.enterScope(0)),e.body=this.parseBlock(!1),this.exitScope(),t.handler=this.finishNode(e,"CatchClause")}return t.finalizer=this.eat(h._finally)?this.parseBlock():null,!t.handler&&!t.finalizer&&this.raise(t.start,"Missing catch or finally clause"),this.finishNode(t,"TryStatement")};O.parseVarStatement=function(t,e,i){return this.next(),this.parseVar(t,!1,e,i),this.semicolon(),this.finishNode(t,"VariableDeclaration")};O.parseWhileStatement=function(t){return this.next(),t.test=this.parseParenExpression(),this.labels.push(c0),t.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(t,"WhileStatement")};O.parseWithStatement=function(t){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),t.object=this.parseParenExpression(),t.body=this.parseStatement("with"),this.finishNode(t,"WithStatement")};O.parseEmptyStatement=function(t){return this.next(),this.finishNode(t,"EmptyStatement")};O.parseLabeledStatement=function(t,e,i,n){for(var r=0,a=this.labels;r=0;d--){var _=this.labels[d];if(_.statementStart===t.start)_.statementStart=this.start,_.kind=p;else break}return this.labels.push({name:e,kind:p,statementStart:this.start}),t.body=this.parseStatement(n?n.indexOf("label")===-1?n+"label":n:"label"),this.labels.pop(),t.label=i,this.finishNode(t,"LabeledStatement")};O.parseExpressionStatement=function(t,e){return t.expression=e,this.semicolon(),this.finishNode(t,"ExpressionStatement")};O.parseBlock=function(t,e,i){for(t===void 0&&(t=!0),e===void 0&&(e=this.startNode()),e.body=[],this.expect(h.braceL),t&&this.enterScope(0);this.type!==h.braceR;){var n=this.parseStatement(null);e.body.push(n)}return i&&(this.strict=!1),this.next(),t&&this.exitScope(),this.finishNode(e,"BlockStatement")};O.parseFor=function(t,e){return t.init=e,this.expect(h.semi),t.test=this.type===h.semi?null:this.parseExpression(),this.expect(h.semi),t.update=this.type===h.parenR?null:this.parseExpression(),this.expect(h.parenR),t.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(t,"ForStatement")};O.parseForIn=function(t,e){var i=this.type===h._in;return this.next(),e.type==="VariableDeclaration"&&e.declarations[0].init!=null&&(!i||this.options.ecmaVersion<8||this.strict||e.kind!=="var"||e.declarations[0].id.type!=="Identifier")&&this.raise(e.start,(i?"for-in":"for-of")+" loop variable declaration may not have an initializer"),t.left=e,t.right=i?this.parseExpression():this.parseMaybeAssign(),this.expect(h.parenR),t.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(t,i?"ForInStatement":"ForOfStatement")};O.parseVar=function(t,e,i,n){for(t.declarations=[],t.kind=i;;){var r=this.startNode();if(this.parseVarId(r,i),this.eat(h.eq)?r.init=this.parseMaybeAssign(e):!n&&i==="const"&&!(this.type===h._in||this.options.ecmaVersion>=6&&this.isContextual("of"))?this.unexpected():!n&&r.id.type!=="Identifier"&&!(e&&(this.type===h._in||this.isContextual("of")))?this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):r.init=null,t.declarations.push(this.finishNode(r,"VariableDeclarator")),!this.eat(h.comma))break}return t};O.parseVarId=function(t,e){t.id=this.parseBindingAtom(),this.checkLValPattern(t.id,e==="var"?l0:Qt,!1)};var Nf=1,i0=2,m1=4;O.parseFunction=function(t,e,i,n,r){this.initFunction(t),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!n)&&(this.type===h.star&&e&i0&&this.unexpected(),t.generator=this.eat(h.star)),this.options.ecmaVersion>=8&&(t.async=!!n),e&Nf&&(t.id=e&m1&&this.type!==h.name?null:this.parseIdent(),t.id&&!(e&i0)&&this.checkLValSimple(t.id,this.strict||t.generator||t.async?this.treatFunctionsAsVar?l0:Qt:p1));var a=this.yieldPos,c=this.awaitPos,p=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(u0(t.async,t.generator)),e&Nf||(t.id=this.type===h.name?this.parseIdent():null),this.parseFunctionParams(t),this.parseFunctionBody(t,i,!1,r),this.yieldPos=a,this.awaitPos=c,this.awaitIdentPos=p,this.finishNode(t,e&Nf?"FunctionDeclaration":"FunctionExpression")};O.parseFunctionParams=function(t){this.expect(h.parenL),t.params=this.parseBindingList(h.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()};O.parseClass=function(t,e){this.next();var i=this.strict;this.strict=!0,this.parseClassId(t,e),this.parseClassSuper(t);var n=this.enterClassBody(),r=this.startNode(),a=!1;for(r.body=[],this.expect(h.braceL);this.type!==h.braceR;){var c=this.parseClassElement(t.superClass!==null);c&&(r.body.push(c),c.type==="MethodDefinition"&&c.kind==="constructor"?(a&&this.raiseRecoverable(c.start,"Duplicate constructor in the same class"),a=!0):c.key&&c.key.type==="PrivateIdentifier"&&Vk(n,c)&&this.raiseRecoverable(c.key.start,"Identifier '#"+c.key.name+"' has already been declared"))}return this.strict=i,this.next(),t.body=this.finishNode(r,"ClassBody"),this.exitClassBody(),this.finishNode(t,e?"ClassDeclaration":"ClassExpression")};O.parseClassElement=function(t){if(this.eat(h.semi))return null;var e=this.options.ecmaVersion,i=this.startNode(),n="",r=!1,a=!1,c="method",p=!1;if(this.eatContextual("static")){if(e>=13&&this.eat(h.braceL))return this.parseClassStaticBlock(i),i;this.isClassElementNameStart()||this.type===h.star?p=!0:n="static"}if(i.static=p,!n&&e>=8&&this.eatContextual("async")&&((this.isClassElementNameStart()||this.type===h.star)&&!this.canInsertSemicolon()?a=!0:n="async"),!n&&(e>=9||!a)&&this.eat(h.star)&&(r=!0),!n&&!a&&!r){var d=this.value;(this.eatContextual("get")||this.eatContextual("set"))&&(this.isClassElementNameStart()?c=d:n=d)}if(n?(i.computed=!1,i.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),i.key.name=n,this.finishNode(i.key,"Identifier")):this.parseClassElementName(i),e<13||this.type===h.parenL||c!=="method"||r||a){var _=!i.static&&zg(i,"constructor"),f=_&&t;_&&c!=="method"&&this.raise(i.key.start,"Constructor can't have get/set modifier"),i.kind=_?"constructor":c,this.parseClassMethod(i,r,a,f)}else this.parseClassField(i);return i};O.isClassElementNameStart=function(){return this.type===h.name||this.type===h.privateId||this.type===h.num||this.type===h.string||this.type===h.bracketL||this.type.keyword};O.parseClassElementName=function(t){this.type===h.privateId?(this.value==="constructor"&&this.raise(this.start,"Classes can't have an element named '#constructor'"),t.computed=!1,t.key=this.parsePrivateIdent()):this.parsePropertyName(t)};O.parseClassMethod=function(t,e,i,n){var r=t.key;t.kind==="constructor"?(e&&this.raise(r.start,"Constructor can't be a generator"),i&&this.raise(r.start,"Constructor can't be an async method")):t.static&&zg(t,"prototype")&&this.raise(r.start,"Classes may not have a static property named prototype");var a=t.value=this.parseMethod(e,i,n);return t.kind==="get"&&a.params.length!==0&&this.raiseRecoverable(a.start,"getter should have no params"),t.kind==="set"&&a.params.length!==1&&this.raiseRecoverable(a.start,"setter should have exactly one param"),t.kind==="set"&&a.params[0].type==="RestElement"&&this.raiseRecoverable(a.params[0].start,"Setter cannot use rest params"),this.finishNode(t,"MethodDefinition")};O.parseClassField=function(t){if(zg(t,"constructor")?this.raise(t.key.start,"Classes can't have a field named 'constructor'"):t.static&&zg(t,"prototype")&&this.raise(t.key.start,"Classes can't have a static field named 'prototype'"),this.eat(h.eq)){var e=this.currentThisScope(),i=e.inClassFieldInit;e.inClassFieldInit=!0,t.value=this.parseMaybeAssign(),e.inClassFieldInit=i}else t.value=null;return this.semicolon(),this.finishNode(t,"PropertyDefinition")};O.parseClassStaticBlock=function(t){t.body=[];var e=this.labels;for(this.labels=[],this.enterScope(Mf|s0);this.type!==h.braceR;){var i=this.parseStatement(null);t.body.push(i)}return this.next(),this.exitScope(),this.labels=e,this.finishNode(t,"StaticBlock")};O.parseClassId=function(t,e){this.type===h.name?(t.id=this.parseIdent(),e&&this.checkLValSimple(t.id,Qt,!1)):(e===!0&&this.unexpected(),t.id=null)};O.parseClassSuper=function(t){t.superClass=this.eat(h._extends)?this.parseExprSubscripts(null,!1):null};O.enterClassBody=function(){var t={declared:Object.create(null),used:[]};return this.privateNameStack.push(t),t.declared};O.exitClassBody=function(){var t=this.privateNameStack.pop(),e=t.declared,i=t.used;if(!!this.options.checkPrivateFields)for(var n=this.privateNameStack.length,r=n===0?null:this.privateNameStack[n-1],a=0;a=11&&(this.eatContextual("as")?(t.exported=this.parseModuleExportName(),this.checkExport(e,t.exported,this.lastTokStart)):t.exported=null),this.expectContextual("from"),this.type!==h.string&&this.unexpected(),t.source=this.parseExprAtom(),this.semicolon(),this.finishNode(t,"ExportAllDeclaration")};O.parseExport=function(t,e){if(this.next(),this.eat(h.star))return this.parseExportAllDeclaration(t,e);if(this.eat(h._default))return this.checkExport(e,"default",this.lastTokStart),t.declaration=this.parseExportDefaultDeclaration(),this.finishNode(t,"ExportDefaultDeclaration");if(this.shouldParseExportStatement())t.declaration=this.parseExportDeclaration(t),t.declaration.type==="VariableDeclaration"?this.checkVariableExport(e,t.declaration.declarations):this.checkExport(e,t.declaration.id,t.declaration.id.start),t.specifiers=[],t.source=null;else{if(t.declaration=null,t.specifiers=this.parseExportSpecifiers(e),this.eatContextual("from"))this.type!==h.string&&this.unexpected(),t.source=this.parseExprAtom();else{for(var i=0,n=t.specifiers;i=13&&this.type===h.string){var t=this.parseLiteral(this.value);return Ck.test(t.value)&&this.raise(t.start,"An export name cannot include a lone surrogate."),t}return this.parseIdent(!0)};O.adaptDirectivePrologue=function(t){for(var e=0;e=5&&t.type==="ExpressionStatement"&&t.expression.type==="Literal"&&typeof t.expression.value=="string"&&(this.input[t.start]==='"'||this.input[t.start]==="'")};var ft=we.prototype;ft.toAssignable=function(t,e,i){if(this.options.ecmaVersion>=6&&t)switch(t.type){case"Identifier":this.inAsync&&t.name==="await"&&this.raise(t.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":t.type="ObjectPattern",i&&this.checkPatternErrors(i,!0);for(var n=0,r=t.properties;n=8&&!p&&d.name==="async"&&!this.canInsertSemicolon()&&this.eat(h._function))return this.overrideContext(fe.f_expr),this.parseFunction(this.startNodeAt(a,c),0,!1,!0,e);if(r&&!this.canInsertSemicolon()){if(this.eat(h.arrow))return this.parseArrowExpression(this.startNodeAt(a,c),[d],!1,e);if(this.options.ecmaVersion>=8&&d.name==="async"&&this.type===h.name&&!p&&(!this.potentialArrowInForAwait||this.value!=="of"||this.containsEsc))return d=this.parseIdent(!1),(this.canInsertSemicolon()||!this.eat(h.arrow))&&this.unexpected(),this.parseArrowExpression(this.startNodeAt(a,c),[d],!0,e)}return d;case h.regexp:var _=this.value;return n=this.parseLiteral(_.value),n.regex={pattern:_.pattern,flags:_.flags},n;case h.num:case h.string:return this.parseLiteral(this.value);case h._null:case h._true:case h._false:return n=this.startNode(),n.value=this.type===h._null?null:this.type===h._true,n.raw=this.type.keyword,this.next(),this.finishNode(n,"Literal");case h.parenL:var f=this.start,x=this.parseParenAndDistinguishExpression(r,e);return t&&(t.parenthesizedAssign<0&&!this.isSimpleAssignTarget(x)&&(t.parenthesizedAssign=f),t.parenthesizedBind<0&&(t.parenthesizedBind=f)),x;case h.bracketL:return n=this.startNode(),this.next(),n.elements=this.parseExprList(h.bracketR,!0,!0,t),this.finishNode(n,"ArrayExpression");case h.braceL:return this.overrideContext(fe.b_expr),this.parseObj(!1,t);case h._function:return n=this.startNode(),this.next(),this.parseFunction(n,0);case h._class:return this.parseClass(this.startNode(),!1);case h._new:return this.parseNew();case h.backQuote:return this.parseTemplate();case h._import:return this.options.ecmaVersion>=11?this.parseExprImport(i):this.unexpected();default:return this.parseExprAtomDefault()}};z.parseExprAtomDefault=function(){this.unexpected()};z.parseExprImport=function(t){var e=this.startNode();if(this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword import"),this.next(),this.type===h.parenL&&!t)return this.parseDynamicImport(e);if(this.type===h.dot){var i=this.startNodeAt(e.start,e.loc&&e.loc.start);return i.name="import",e.meta=this.finishNode(i,"Identifier"),this.parseImportMeta(e)}else this.unexpected()};z.parseDynamicImport=function(t){if(this.next(),t.source=this.parseMaybeAssign(),!this.eat(h.parenR)){var e=this.start;this.eat(h.comma)&&this.eat(h.parenR)?this.raiseRecoverable(e,"Trailing comma is not allowed in import()"):this.unexpected(e)}return this.finishNode(t,"ImportExpression")};z.parseImportMeta=function(t){this.next();var e=this.containsEsc;return t.property=this.parseIdent(!0),t.property.name!=="meta"&&this.raiseRecoverable(t.property.start,"The only valid meta property for import is 'import.meta'"),e&&this.raiseRecoverable(t.start,"'import.meta' must not contain escaped characters"),this.options.sourceType!=="module"&&!this.options.allowImportExportEverywhere&&this.raiseRecoverable(t.start,"Cannot use 'import.meta' outside a module"),this.finishNode(t,"MetaProperty")};z.parseLiteral=function(t){var e=this.startNode();return e.value=t,e.raw=this.input.slice(this.start,this.end),e.raw.charCodeAt(e.raw.length-1)===110&&(e.bigint=e.raw.slice(0,-1).replace(/_/g,"")),this.next(),this.finishNode(e,"Literal")};z.parseParenExpression=function(){this.expect(h.parenL);var t=this.parseExpression();return this.expect(h.parenR),t};z.shouldParseArrow=function(t){return!this.canInsertSemicolon()};z.parseParenAndDistinguishExpression=function(t,e){var i=this.start,n=this.startLoc,r,a=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var c=this.start,p=this.startLoc,d=[],_=!0,f=!1,x=new qg,v=this.yieldPos,w=this.awaitPos,k;for(this.yieldPos=0,this.awaitPos=0;this.type!==h.parenR;)if(_?_=!1:this.expect(h.comma),a&&this.afterTrailingComma(h.parenR,!0)){f=!0;break}else if(this.type===h.ellipsis){k=this.start,d.push(this.parseParenItem(this.parseRestBinding())),this.type===h.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");break}else d.push(this.parseMaybeAssign(!1,x,this.parseParenItem));var S=this.lastTokEnd,P=this.lastTokEndLoc;if(this.expect(h.parenR),t&&this.shouldParseArrow(d)&&this.eat(h.arrow))return this.checkPatternErrors(x,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=v,this.awaitPos=w,this.parseParenArrowList(i,n,d,e);(!d.length||f)&&this.unexpected(this.lastTokStart),k&&this.unexpected(k),this.checkExpressionErrors(x,!0),this.yieldPos=v||this.yieldPos,this.awaitPos=w||this.awaitPos,d.length>1?(r=this.startNodeAt(c,p),r.expressions=d,this.finishNodeAt(r,"SequenceExpression",S,P)):r=d[0]}else r=this.parseParenExpression();if(this.options.preserveParens){var A=this.startNodeAt(i,n);return A.expression=r,this.finishNode(A,"ParenthesizedExpression")}else return r};z.parseParenItem=function(t){return t};z.parseParenArrowList=function(t,e,i,n){return this.parseArrowExpression(this.startNodeAt(t,e),i,!1,n)};var Mk=[];z.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword new");var t=this.startNode();if(this.next(),this.options.ecmaVersion>=6&&this.type===h.dot){var e=this.startNodeAt(t.start,t.loc&&t.loc.start);e.name="new",t.meta=this.finishNode(e,"Identifier"),this.next();var i=this.containsEsc;return t.property=this.parseIdent(!0),t.property.name!=="target"&&this.raiseRecoverable(t.property.start,"The only valid meta property for new is 'new.target'"),i&&this.raiseRecoverable(t.start,"'new.target' must not contain escaped characters"),this.allowNewDotTarget||this.raiseRecoverable(t.start,"'new.target' can only be used in functions and class static block"),this.finishNode(t,"MetaProperty")}var n=this.start,r=this.startLoc;return t.callee=this.parseSubscripts(this.parseExprAtom(null,!1,!0),n,r,!0,!1),this.eat(h.parenL)?t.arguments=this.parseExprList(h.parenR,this.options.ecmaVersion>=8,!1):t.arguments=Mk,this.finishNode(t,"NewExpression")};z.parseTemplateElement=function(t){var e=t.isTagged,i=this.startNode();return this.type===h.invalidTemplate?(e||this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal"),i.value={raw:this.value.replace(/\r\n?/g,` +${eb(t,e.key_info)}`);break;default:O.warn(yr,"Unreachable code reached at ParserErrorHandler");break}},"ERROR_HANDLER");function I1(t){ii=t}r(I1,"setParserErrorHandler");function Bt(){br=null}r(Bt,"_clearMemo");function Yt(){br=new ui}r(Yt,"_createMemo");function S1(t,e){if(!br)return;let i=br.get(t);if(!i)return br.set(t,[e]);i.push(e)}r(S1,"_addToMemo");function Vt(){if(!br)throw new Error("Parser#getMemo() called before Parser#createMemo()");return br}r(Vt,"_getMemo");function Wg(t){return v1.has(t)}r(Wg,"shouldIgnore");function ys(t){return(t.charAt(0).toUpperCase()+t.slice(1)).replace(/Renderer|Model/g,"").replace(/Radio/g,"Mix").trim()}r(ys,"sanitizeClassName");function xs(t){let e=Fg.get(t);if(!e){let i=new Error(`Module not found: ${t}`);throw i.code="MODULE_NOT_FOUND",i}return e}r(xs,"getParserByName");function Dh(t){return Fg.has(t)}r(Dh,"hasParser");function Bg(t,e){Fg.set(t,e),QS.set(t,e)}r(Bg,"addRuntimeParser");function E1(){return Object.fromEntries(QS)}r(E1,"getDynamicParsers");function Yg(t){var xw,yw,bw,gw,ww,Tw,vw,Iw,Sw,Ew,kw,Cw,Pw,Nw,Aw,Rw;let e={};Yt();let i=De(t.contents),s=Vt();i&&(e.contents=i,e.contents_memo=s),Bt(),Yt();let o=t.onResponseReceivedActions?sb(t.onResponseReceivedActions):null,a=Vt();o&&(e.on_response_received_actions=o,e.on_response_received_actions_memo=a),Bt(),Yt();let l=t.onResponseReceivedEndpoints?sb(t.onResponseReceivedEndpoints):null,f=Vt();l&&(e.on_response_received_endpoints=l,e.on_response_received_endpoints_memo=f),Bt(),Yt();let m=t.onResponseReceivedCommands?sb(t.onResponseReceivedCommands):null,x=Vt();m&&(e.on_response_received_commands=m,e.on_response_received_commands_memo=x),Bt(),Yt();let _=t.continuationContents?Vg(t.continuationContents):null,b=Vt();_&&(e.continuation_contents=_,e.continuation_contents_memo=b),Bt(),Yt();let T=t.actions?eE(t.actions):null,w=Vt();T&&(e.actions=T,e.actions_memo=w),Bt(),Yt();let S=t.liveChatItemContextMenuSupportedRenderers?q(t.liveChatItemContextMenuSupportedRenderers):null,E=Vt();S&&(e.live_chat_item_context_menu_supported_renderers=S,e.live_chat_item_context_menu_supported_renderers_memo=E),Bt(),Yt();let C=t.header?De(t.header):null,k=Vt();C&&(e.header=C,e.header_memo=k),Bt(),Yt();let U=t.sidebar?q(t.sidebar):null,L=Vt();U&&(e.sidebar=U,e.sidebar_memo=L),Bt(),Yt();let K=De(t.items);K&&(e.items=K,e.items_memo=Vt()),Bt(),tE(s,(yw=(xw=t.frameworkUpdates)==null?void 0:xw.entityBatchUpdate)==null?void 0:yw.mutations),f&&iE(f,(gw=(bw=t.frameworkUpdates)==null?void 0:bw.entityBatchUpdate)==null?void 0:gw.mutations);let re=t.continuation?ZS(t.continuation):null;re&&(e.continuation=re);let he=t.continuationEndpoint?Vg(t.continuationEndpoint):null;he&&(e.continuation_endpoint=he);let Y=De(t.metadata);Y&&(e.metadata=Y);let te=q(t.microformat);te&&(e.microformat=te);let F=q(t.overlay);F&&(e.overlay=F);let B=Ce(t.alerts,[Br,Vd]);B.length&&(e.alerts=B);let X=t.refinements;X&&(e.refinements=X);let Z=t.estimatedResults?parseInt(t.estimatedResults):null;Z&&(e.estimated_results=Z);let Ue=De(t.playerOverlays);Ue&&(e.player_overlays=Ue);let ut=q(t.background,Ie);ut&&(e.background=ut);let ft=t.playbackTracking?{videostats_watchtime_url:t.playbackTracking.videostatsWatchtimeUrl.baseUrl,videostats_playback_url:t.playbackTracking.videostatsPlaybackUrl.baseUrl}:null;ft&&(e.playback_tracking=ft);let mt=t.playabilityStatus?{status:t.playabilityStatus.status,reason:t.playabilityStatus.reason||"",embeddable:!!t.playabilityStatus.playableInEmbed||!1,audio_only_playablility:q(t.playabilityStatus.audioOnlyPlayability,Fd),error_screen:q(t.playabilityStatus.errorScreen)}:null;if(mt&&(e.playability_status=mt),t.streamingData){let ad=new Map;e.streaming_data={expires:new Date(Date.now()+parseInt(t.streamingData.expiresInSeconds)*1e3),formats:Ug(t.streamingData.formats,ad),adaptive_formats:Ug(t.streamingData.adaptiveFormats,ad),dash_manifest_url:t.streamingData.dashManifestUrl,hls_manifest_url:t.streamingData.hlsManifestUrl,server_abr_streaming_url:t.streamingData.serverAbrStreamingUrl}}t.playerConfig&&(e.player_config={audio_config:{loudness_db:(ww=t.playerConfig.audioConfig)==null?void 0:ww.loudnessDb,perceptual_loudness_db:(Tw=t.playerConfig.audioConfig)==null?void 0:Tw.perceptualLoudnessDb,enable_per_format_loudness:(vw=t.playerConfig.audioConfig)==null?void 0:vw.enablePerFormatLoudness},stream_selection_config:{max_bitrate:((Iw=t.playerConfig.streamSelectionConfig)==null?void 0:Iw.maxBitrate)||"0"},media_common_config:{dynamic_readahead_config:{max_read_ahead_media_time_ms:((Ew=(Sw=t.playerConfig.mediaCommonConfig)==null?void 0:Sw.dynamicReadaheadConfig)==null?void 0:Ew.maxReadAheadMediaTimeMs)||0,min_read_ahead_media_time_ms:((Cw=(kw=t.playerConfig.mediaCommonConfig)==null?void 0:kw.dynamicReadaheadConfig)==null?void 0:Cw.minReadAheadMediaTimeMs)||0,read_ahead_growth_rate_ms:((Nw=(Pw=t.playerConfig.mediaCommonConfig)==null?void 0:Pw.dynamicReadaheadConfig)==null?void 0:Nw.readAheadGrowthRateMs)||0},media_ustreamer_request_config:{video_playback_ustreamer_config:(Rw=(Aw=t.playerConfig.mediaCommonConfig)==null?void 0:Aw.mediaUstreamerRequestConfig)==null?void 0:Rw.videoPlaybackUstreamerConfig}}});let Fe=t.currentVideoEndpoint?new d(t.currentVideoEndpoint):null;Fe&&(e.current_video_endpoint=Fe);let li=t.endpoint?new d(t.endpoint):null;li&&(e.endpoint=li);let jt=q(t.captions,xy);jt&&(e.captions=jt);let ae=t.videoDetails?new Li(t.videoDetails):null;ae&&(e.video_details=ae);let ze=Ce(t.annotations,_y);ze.length&&(e.annotations=ze);let pe=q(t.storyboards,[Qi,gy]);pe&&(e.storyboards=pe);let Ae=q(t.endscreen,cx);Ae&&(e.endscreen=Ae);let tt=q(t.cards,S_);tt&&(e.cards=tt);let oe=Ce(t.engagementPanels,Ii);return oe.length&&(e.engagement_panels=oe),t.playerResponse&&(e.player_response=Yg(t.playerResponse)),t.watchNextResponse&&(e.watch_next_response=Yg(t.watchNextResponse)),t.cpnInfo&&(e.cpn_info={cpn:t.cpnInfo.cpn,cpn_source:t.cpnInfo.cpnSource}),t.entries&&(e.entries=t.entries.map(ad=>new d(ad))),e}r(Yg,"parseResponse");function q(t,e){if(!t)return null;let i=Object.keys(t);if(!i.length)return null;let s=ys(i[0]);if(!Wg(s))try{let a=Dh(s)?xs(s):Oh(s,t[i[0]],ii);if(e){if(Array.isArray(e)){if(!e.some(f=>f.type===a.type))return ii({classdata:t[i[0]],classname:s,error_type:"typecheck",expected:e.map(f=>f.type)}),null}else if(a.type!==e.type)return ii({classdata:t[i[0]],classname:s,error_type:"typecheck",expected:e.type}),null}let l=new a(t[i[0]]);return S1(s,l),l}catch(o){return ii({classname:s,classdata:t[i[0]],error:o,error_type:"parse"}),null}return null}r(q,"parseItem");function Ce(t,e){if(Array.isArray(t)){let i=[];for(let s of t){let o=q(s,e);o&&i.push(o)}return G(i)}else if(!t)return G([]);throw new Qe("Expected array but got a single item")}r(Ce,"parseArray");function De(t,e,i){if(!t)return null;if(Array.isArray(t)){let s=[];for(let a of t){let l=q(a,i);l&&s.push(l)}let o=G(s);return e?o:new Nt(o)}else if(e)throw new Qe("Expected array but got a single item");return new Nt(q(t,i))}r(De,"parse");var k1=/Command$/,C1=/Endpoint$/,P1=/Action$/;function JS(t){let e=[];try{e=Object.keys(t)}catch{}for(let i of e){let s=t[i];if(k1.test(i)||C1.test(i)||P1.test(i)){let o=ys(i);if(Wg(o))return;try{if(Dh(o))return new(xs(o))(s)}catch(a){ii({error:a,classname:o,classdata:s,error_type:"parse"})}}}}r(JS,"parseCommand");function N1(t){if(Array.isArray(t)){let e=[];for(let i of t){let s=JS(i);s&&e.push(s)}return G(e)}else if(!t)return G([]);throw new Qe("Expected array but got a single item")}r(N1,"parseCommands");function ZS(t){return t.timedContinuationData?new xr({continuation:t.timedContinuationData,type:"timed"}):null}r(ZS,"parseC");function Vg(t){return t.itemSectionContinuation?new bs(t.itemSectionContinuation):t.sectionListContinuation?new ws(t.sectionListContinuation):t.liveChatContinuation?new Mi(t.liveChatContinuation):t.musicPlaylistShelfContinuation?new Ts(t.musicPlaylistShelfContinuation):t.musicShelfContinuation?new vs(t.musicShelfContinuation):t.gridContinuation?new Is(t.gridContinuation):t.playlistPanelContinuation?new Ss(t.playlistPanelContinuation):t.continuationCommand?new ti(t.continuationCommand):null}r(Vg,"parseLC");function sb(t){return G(t.map(e=>{if(e.navigateAction)return new Ai(e.navigateAction);if(e.showMiniplayerCommand)return new gs(e.showMiniplayerCommand);if(e.reloadContinuationItemsCommand)return new Ri(e.reloadContinuationItemsCommand);if(e.appendContinuationItemsAction)return new er(e.appendContinuationItemsAction)}).filter(e=>e))}r(sb,"parseRR");function eE(t){return Array.isArray(t)?De(t.map(e=>(delete e.clickTrackingParams,e))):new Nt(q(t))}r(eE,"parseActions");function Ug(t,e){return(t==null?void 0:t.map(i=>new rb(i,e)))||[]}r(Ug,"parseFormats");function tE(t,e){let i=t.getType(ss);if(i.length>0&&!e)ii({error_type:"mutation_data_missing",classname:"MusicMultiSelectMenuItem"});else{let s=[];for(let o of i){let a=e.find(f=>{var m,x;return((x=(m=f.payload)==null?void 0:m.musicFormBooleanChoice)==null?void 0:x.id)===o.form_item_entity_key}),l=a==null?void 0:a.payload.musicFormBooleanChoice;(l==null?void 0:l.selected)!==void 0&&(l==null?void 0:l.opaqueToken)?o.selected=l.selected:s.push(`'${o.title}'`)}s.length>0&&ii({error_type:"mutation_data_invalid",classname:"MusicMultiSelectMenuItem",total:i.length,failed:s.length,titles:s})}}r(tE,"applyMutations");function iE(t,e){var s,o,a,l,f,m;let i=t.getType(or);if(i.length>0){e||ii({error_type:"mutation_data_missing",classname:"CommentView"});for(let x of i){let _=(o=(s=e.find(w=>{var S,E;return((E=(S=w.payload)==null?void 0:S.commentEntityPayload)==null?void 0:E.key)===x.keys.comment}))==null?void 0:s.payload)==null?void 0:o.commentEntityPayload,b=(l=(a=e.find(w=>{var S,E;return((E=(S=w.payload)==null?void 0:S.engagementToolbarStateEntityPayload)==null?void 0:E.key)===x.keys.toolbar_state}))==null?void 0:a.payload)==null?void 0:l.engagementToolbarStateEntityPayload,T=(m=(f=e.find(w=>w.entityKey===x.keys.toolbar_surface))==null?void 0:f.payload)==null?void 0:m.engagementToolbarSurfaceEntityPayload;x.applyMutations(_,b,T)}}}r(iE,"applyCommentsMutations");var qg={};Xe(qg,{AccountInfo:()=>rE,Channel:()=>ge,ChannelListContinuation:()=>Ir,Comments:()=>oE,FilteredChannelList:()=>Yi,Guide:()=>nE,HashtagFeed:()=>Vi,History:()=>Ft,HomeFeed:()=>ri,ItemMenu:()=>hb,Library:()=>pE,LiveChat:()=>vb,NotificationsMenu:()=>lE,Playlist:()=>Os,Search:()=>ni,Settings:()=>uE,SmoothedQueue:()=>bb,TranscriptInfo:()=>cb,VideoInfo:()=>Kh});var Es,ob=class{constructor(e){if(Es.set(this,void 0),I(this,Es,c.parseResponse(e.data),"f"),!u(this,Es,"f").contents)throw new g("Page contents not found");let i=u(this,Es,"f").contents.array().as(Cd).first();if(!i)throw new g("Account section list not found");this.contents=i.contents.first()}get page(){return u(this,Es,"f")}};r(ob,"AccountInfo");Es=new WeakMap;var rE=ob;var Bh,Pe,Yh,He,gr,sE,Gg,Oi=class{constructor(e,i,s=!1){Bh.add(this),Pe.set(this,void 0),Yh.set(this,void 0),He.set(this,void 0),gr.set(this,void 0),u(this,Bh,"m",sE).call(this,i)||s?I(this,Pe,i,"f"):I(this,Pe,c.parseResponse(i.data),"f");let o=jg(u(this,Pe,"f").contents_memo,u(this,Pe,"f").continuation_contents_memo,u(this,Pe,"f").on_response_received_commands_memo,u(this,Pe,"f").on_response_received_endpoints_memo,u(this,Pe,"f").on_response_received_actions_memo,u(this,Pe,"f").sidebar_memo,u(this,Pe,"f").header_memo);if(!o)throw new g("No memo found in feed");I(this,He,o,"f"),I(this,Yh,e,"f")}static getVideosFromMemo(e){return e.getType(Wr,yx,ls,ds,Gr,ps,ei,zy)}static getPlaylistsFromMemo(e){let i=e.getType(Rt,dx),s=e.getType(Kx).filter(o=>["PLAYLIST","ALBUM","PODCAST"].includes(o.content_type));return s.length>0&&i.push(...s),i}get videos(){return Oi.getVideosFromMemo(u(this,He,"f"))}get posts(){return u(this,He,"f").getType(bi,cs,By)}get channels(){return u(this,He,"f").getType(k_,hx)}get playlists(){return Oi.getPlaylistsFromMemo(u(this,He,"f"))}get memo(){return u(this,He,"f")}get page_contents(){var o;let e=(o=u(this,He,"f").getType(Se))==null?void 0:o.first().content,i=u(this,He,"f").getType(Ri).first(),s=u(this,He,"f").getType(er).first();return e||i||s}get shelves(){return u(this,He,"f").getType(hs,Ay,Hr)}getShelf(e){return this.shelves.get({title:e})}get secondary_contents(){var i,s;if(!((i=u(this,Pe,"f").contents)!=null&&i.is_node))return;let e=(s=u(this,Pe,"f").contents)==null?void 0:s.item();if(!!e.is(Ot,Gy))return e.secondary_contents}get actions(){return u(this,Yh,"f")}get page(){return u(this,Pe,"f")}get has_continuation(){return u(this,Bh,"m",Gg).call(this).length>0}async getContinuationData(){if(u(this,gr,"f")){if(u(this,gr,"f").length===0)throw new g("There are no continuations.");return await u(this,gr,"f")[0].endpoint.call(u(this,Yh,"f"),{parse:!0})}if(I(this,gr,u(this,Bh,"m",Gg).call(this),"f"),u(this,gr,"f"))return this.getContinuationData()}async getContinuation(){let e=await this.getContinuationData();if(!e)throw new g("Could not get continuation data");return new Oi(this.actions,e,!0)}};r(Oi,"Feed");Pe=new WeakMap,Yh=new WeakMap,He=new WeakMap,gr=new WeakMap,Bh=new WeakSet,sE=r(function(e){return!("data"in e)},"_Feed_isParsed"),Gg=r(function(){if(u(this,Pe,"f").header_memo){let e=u(this,Pe,"f").header_memo.getType(J);return u(this,He,"f").getType(J).filter(i=>!e.includes(i))}return u(this,He,"f").getType(J)},"_Feed_getBodyContinuations");var be=Oi;var ks,nb=class extends be{constructor(e,i,s=!1){super(e,i,s),ks.set(this,void 0)}get filter_chips(){var e,i;if(u(this,ks,"f"))return u(this,ks,"f")||[];if(((e=this.memo.getType(vt))==null?void 0:e.length)>1)throw new g("There are too many feed filter chipbars, you'll need to find the correct one yourself in this.page");if(((i=this.memo.getType(vt))==null?void 0:i.length)===0)throw new g("There are no feed filter chipbars");return I(this,ks,this.memo.getType(je),"f"),u(this,ks,"f")||[]}get filters(){return this.filter_chips.map(e=>e.text.toString())||[]}async getFilteredFeed(e){var o;let i;if(typeof e=="string"){if(!this.filters.includes(e))throw new g("Filter not found",{available_filters:this.filters});i=this.filter_chips.find(a=>a.text.toString()===e)}else if(e.type==="ChipCloudChip")i=e;else throw new g("Invalid filter");if(!i)throw new g("Filter not found");if(i.is_selected)return this;let s=await((o=i.endpoint)==null?void 0:o.call(this.actions,{parse:!0}));if(!s)throw new g("Failed to get filtered feed");return new be(this.actions,s,!0)}};r(nb,"FilterableFeed");ks=new WeakMap;var Di=nb;var Hg={};Xe(Hg,{Feed:()=>be,FilterableFeed:()=>Di,MediaInfo:()=>Ps,TabbedFeed:()=>Vh});var Bi,St,Cs,ab,pb=class{constructor(e,i,s){var l,f,m,x,_,b,T,w,S,E,C,k,U,L,K,re,he,Y,te,F,B,X;Bi.set(this,void 0),St.set(this,void 0),Cs.set(this,void 0),ab.set(this,void 0),I(this,St,i,"f");let o=c.parseResponse(e[0].data.playerResponse?e[0].data.playerResponse:e[0].data),a=(l=e[1])!=null&&l.data?c.parseResponse(e[1].data):void 0;if(I(this,Bi,[o,a],"f"),I(this,Cs,s,"f"),((f=o.playability_status)==null?void 0:f.status)==="ERROR")throw new g("This video is unavailable",o.playability_status);if(o.microformat&&!((m=o.microformat)!=null&&m.is(et,Ci)))throw new g("Unsupported microformat",o.microformat);this.basic_info={...o.video_details,embed:(x=o.microformat)!=null&&x.is(et)?(_=o.microformat)==null?void 0:_.embed:null,channel:(b=o.microformat)!=null&&b.is(et)?(T=o.microformat)==null?void 0:T.channel:null,is_unlisted:(w=o.microformat)==null?void 0:w.is_unlisted,is_family_safe:(S=o.microformat)==null?void 0:S.is_family_safe,category:(E=o.microformat)!=null&&E.is(et)?(C=o.microformat)==null?void 0:C.category:null,has_ypc_metadata:(k=o.microformat)!=null&&k.is(et)?(U=o.microformat)==null?void 0:U.has_ypc_metadata:null,start_timestamp:(L=o.microformat)!=null&&L.is(et)?o.microformat.start_timestamp:null,end_timestamp:(K=o.microformat)!=null&&K.is(et)?o.microformat.end_timestamp:null,view_count:((re=o.microformat)==null?void 0:re.is(et))&&isNaN((he=o.video_details)==null?void 0:he.view_count)?o.microformat.view_count:(Y=o.video_details)==null?void 0:Y.view_count,url_canonical:(te=o.microformat)!=null&&te.is(Ci)?(F=o.microformat)==null?void 0:F.url_canonical:null,tags:(B=o.microformat)!=null&&B.is(Ci)?(X=o.microformat)==null?void 0:X.tags:null,like_count:void 0,is_liked:void 0,is_disliked:void 0},this.annotations=o.annotations,this.storyboards=o.storyboards,this.endscreen=o.endscreen,this.captions=o.captions,this.cards=o.cards,this.streaming_data=o.streaming_data,this.playability_status=o.playability_status,this.player_config=o.player_config,I(this,ab,o.playback_tracking,"f")}async toDash(e,i,s={include_thumbnails:!1}){var f,m;let o=u(this,Bi,"f")[0];if(o.video_details&&o.video_details.is_live)throw new g("Generating DASH manifests for live videos is not supported. Please use the DASH and HLS manifests provided by YouTube in `streaming_data.dash_manifest_url` and `streaming_data.hls_manifest_url` instead.");let a,l;return s.include_thumbnails&&o.storyboards&&(a=o.storyboards),typeof s.captions_format=="string"&&((f=o.captions)==null?void 0:f.caption_tracks)&&(l=o.captions.caption_tracks),Ji.toDash(this.streaming_data,(m=this.page[0].video_details)==null?void 0:m.is_post_live_dvr,e,i,u(this,Cs,"f"),u(this,St,"f").session.player,u(this,St,"f"),a,l,s)}getStreamingInfo(e,i){var s;return fd(this.streaming_data,(s=this.page[0].video_details)==null?void 0:s.is_post_live_dvr,e,i,this.cpn,u(this,St,"f").session.player,u(this,St,"f"),u(this,Bi,"f")[0].storyboards?u(this,Bi,"f")[0].storyboards:void 0)}chooseFormat(e){return Ji.chooseFormat(e,this.streaming_data)}async download(e={}){let i=u(this,Bi,"f")[0];if(i.video_details&&(i.video_details.is_live||i.video_details.is_post_live_dvr))throw new g("Downloading is not supported for live and Post-Live-DVR videos, as they are split up into 5 second segments that are individual files, which require using a tool such as ffmpeg to stitch them together, so they cannot be returned in a single stream.");return Ji.download(e,u(this,St,"f"),this.playability_status,this.streaming_data,u(this,St,"f").session.player,this.cpn)}async getTranscript(){var a;let e=this.page[1];if(!e)throw new g("Cannot get transcript from basic video info.");if(!e.engagement_panels)throw new g("Engagement panels not found. Video likely has no transcript.");let i=e.engagement_panels.get({panel_identifier:"engagement-panel-searchable-transcript"});if(!i)throw new g("Transcript panel not found. Video likely has no transcript.");let s=(a=i.content)==null?void 0:a.as(J);if(!s)throw new g("Transcript continuation not found.");let o=await s.endpoint.call(this.actions);return new cb(this.actions,o)}async addToWatchHistory(e={}){var m;let i=z.CLIENTS.WEB.NAME,s=z.CLIENTS.WEB.VERSION,o="https://www.",a=(e==null?void 0:e.url)||((m=u(this,ab,"f"))==null?void 0:m.videostats_playback_url);if(!a)throw new g("Playback tracking not available");let l={cpn:u(this,Cs,"f"),fmt:251,rtn:0,rt:0},f=a.replace("https://s.",o);return await u(this,St,"f").stats(f,{client_name:i,client_version:s,visitor_data:e==null?void 0:e.visitor_data},l)}get actions(){return u(this,St,"f")}get cpn(){return u(this,Cs,"f")}get page(){return u(this,Bi,"f")}};r(pb,"MediaInfo");Bi=new WeakMap,St=new WeakMap,Cs=new WeakMap,ab=new WeakMap;var Ps=pb;var wr,Tr,vr=class extends be{constructor(e,i,s=!1){var o;super(e,i,s),wr.set(this,void 0),Tr.set(this,void 0),I(this,wr,e,"f"),I(this,Tr,(o=this.page.contents_memo)==null?void 0:o.getType(Se),"f")}get tabs(){var e,i;return(i=(e=u(this,Tr,"f"))==null?void 0:e.map(s=>s.title.toString()))!=null?i:[]}async getTabByName(e){var o;let i=(o=u(this,Tr,"f"))==null?void 0:o.find(a=>a.title.toLowerCase()===e.toLowerCase());if(!i)throw new g(`Tab "${e}" not found`);if(i.selected)return this;let s=await i.endpoint.call(u(this,wr,"f"));return new vr(u(this,wr,"f"),s,!1)}async getTabByURL(e){var o;let i=(o=u(this,Tr,"f"))==null?void 0:o.find(a=>{var l;return((l=a.endpoint.metadata.url)==null?void 0:l.split("/").pop())===e});if(!i)throw new g(`Tab "${e}" not found`);if(i.selected)return this;let s=await i.endpoint.call(u(this,wr,"f"));return new vr(u(this,wr,"f"),s,!1)}hasTabWithURL(e){var i,s;return(s=(i=u(this,Tr,"f"))==null?void 0:i.some(o=>{var a;return((a=o.endpoint.metadata.url)==null?void 0:a.split("/").pop())===e}))!=null?s:!1}get title(){var e,i,s;return(s=(i=(e=this.page.contents_memo)==null?void 0:e.getType(Se))==null?void 0:i.find(o=>o.selected))==null?void 0:s.title.toString()}};r(vr,"TabbedFeed");wr=new WeakMap,Tr=new WeakMap;var Vh=vr;var ge=class extends Vh{constructor(e,i,s=!1){var l,f,m,x,_;super(e,i,s),this.header=(f=(l=this.page.header)==null?void 0:l.item())==null?void 0:f.as($r,E_,Ex,Lt);let o=(m=this.page.metadata)==null?void 0:m.item().as(C_),a=(x=this.page.microformat)==null?void 0:x.as(Ci);if(this.page.alerts){let b=this.page.alerts.first();if((b==null?void 0:b.alert_type)==="ERROR")throw new Ns(b.text.toString())}if(!o&&!this.page.contents)throw new g("Invalid channel",this);this.metadata={...o,...a||{}},this.subscribe_button=(_=this.page.header_memo)==null?void 0:_.getType(xe).first(),this.page.contents&&(this.current_tab=this.page.contents.item().as(Ot).tabs.array().filterType(Se,es).get({selected:!0}))}async applyFilter(e){let i,s=this.memo.getType(vt).first();if(typeof e=="string"){if(i=s==null?void 0:s.contents.get({text:e}),!i)throw new g(`Filter ${e} not found`,{available_filters:this.filters})}else i=e;if(!i.endpoint)throw new g("Invalid filter",e);let o=await i.endpoint.call(this.actions,{parse:!0});if(!o)throw new g("No page returned",{filter:i});return new Yi(this.actions,o,!0)}async applySort(e){let i=this.memo.getType(xt).first();if(!i||!i.sub_menu_items)throw new g("No sort filter sub menu found");let s=i.sub_menu_items.find(a=>a.title===e);if(!s)throw new g(`Sort filter ${e} not found`,{available_sort_filters:this.sort_filters});if(s.selected)return this;let o=await s.endpoint.call(this.actions,{parse:!0});return new ge(this.actions,o,!0)}async applyContentTypeFilter(e){var a,l,f;let i=(f=(l=(a=this.current_tab)==null?void 0:a.content)==null?void 0:l.as(de).sub_menu)==null?void 0:f.as(_a);if(!i)throw new g("Sub menu not found");let s=i.content_type_sub_menu_items.find(m=>m.title===e);if(!s)throw new g(`Sub menu item ${e} not found`,{available_filters:this.content_type_filters});if(s.selected)return this;let o=await s.endpoint.call(this.actions,{parse:!0});return new ge(this.actions,o,!0)}get filters(){var e,i;return((i=(e=this.memo.getType(vt))==null?void 0:e[0])==null?void 0:i.contents.filterType(je).map(s=>s.text))||[]}get sort_filters(){var i;let e=this.memo.getType(xt).first();return((i=e==null?void 0:e.sub_menu_items)==null?void 0:i.map(s=>s.title))||[]}get content_type_filters(){var i,s,o;let e=(o=(s=(i=this.current_tab)==null?void 0:i.content)==null?void 0:s.as(de).sub_menu)==null?void 0:o.as(_a);return(e==null?void 0:e.content_type_sub_menu_items.map(a=>a.title))||[]}async getHome(){let e=await this.getTabByURL("featured");return new ge(this.actions,e.page,!0)}async getVideos(){let e=await this.getTabByURL("videos");return new ge(this.actions,e.page,!0)}async getShorts(){let e=await this.getTabByURL("shorts");return new ge(this.actions,e.page,!0)}async getLiveStreams(){let e=await this.getTabByURL("streams");return new ge(this.actions,e.page,!0)}async getReleases(){let e=await this.getTabByURL("releases");return new ge(this.actions,e.page,!0)}async getPodcasts(){let e=await this.getTabByURL("podcasts");return new ge(this.actions,e.page,!0)}async getPlaylists(){let e=await this.getTabByURL("playlists");return new ge(this.actions,e.page,!0)}async getCommunity(){let e=await this.getTabByURL("community");return new ge(this.actions,e.page,!0)}async getAbout(){var i,s,o,a,l;if(this.hasTabWithURL("about"))return(await this.getTabByURL("about")).memo.getType(pa)[0];let e=((i=this.header)==null?void 0:i.is($r))&&this.header.tagline;if(e||((s=this.header)==null?void 0:s.is(Lt))&&((o=this.header.content)==null?void 0:o.description)){if(e&&e.more_endpoint instanceof d){let x=await e.more_endpoint.call(this.actions);return new Vh(this.actions,x,!1).memo.getType(pa)[0]}let f=(l=(a=this.page.header_memo)==null?void 0:a.getType(J)[0])==null?void 0:l.endpoint;if(!f)throw new g("Failed to extract continuation to get channel about");let m=await f.call(this.actions,{parse:!0});if(!m.on_response_received_endpoints_memo)throw new g("Unexpected response while fetching channel about",{response:m});return m.on_response_received_endpoints_memo.getType(vd)[0]}throw new g("About not found")}async search(e){var o;let i=(o=this.memo.getType(es))==null?void 0:o[0];if(!i)throw new g("Search tab not found",this);let s=await i.endpoint.call(this.actions,{query:e,parse:!0});return new ge(this.actions,s,!0)}get has_home(){return this.hasTabWithURL("featured")}get has_videos(){return this.hasTabWithURL("videos")}get has_shorts(){return this.hasTabWithURL("shorts")}get has_live_streams(){return this.hasTabWithURL("streams")}get has_releases(){return this.hasTabWithURL("releases")}get has_podcasts(){return this.hasTabWithURL("podcasts")}get has_playlists(){return this.hasTabWithURL("playlists")}get has_community(){return this.hasTabWithURL("community")}get has_about(){var e,i,s,o,a;return this.hasTabWithURL("about")||!!(((e=this.header)==null?void 0:e.is($r))&&((i=this.header.tagline)==null?void 0:i.more_endpoint))||!!(((s=this.header)==null?void 0:s.is(Lt))&&((a=(o=this.header.content)==null?void 0:o.description)==null?void 0:a.more_endpoint))}get has_search(){var e;return((e=this.memo.getType(es))==null?void 0:e.length)>0}async getContinuation(){let e=await super.getContinuationData();if(!e)throw new g("Could not get continuation data");return new Ir(this.actions,e,!0)}};r(ge,"Channel");var Ir=class extends be{constructor(e,i,s=!1){var o,a;super(e,i,s),this.contents=((o=this.page.on_response_received_actions)==null?void 0:o.first())||((a=this.page.on_response_received_endpoints)==null?void 0:a.first())}async getContinuation(){let e=await super.getContinuationData();if(!e)throw new g("Could not get continuation data");return new Ir(this.actions,e,!0)}};r(Ir,"ChannelListContinuation");var Yi=class extends Di{constructor(e,i,s=!1){var o;super(e,i,s),this.applied_filter=this.memo.getType(je).get({is_selected:!0}),this.page.on_response_received_actions&&this.page.on_response_received_actions.length>1&&this.page.on_response_received_actions.shift(),this.contents=(o=this.page.on_response_received_actions)==null?void 0:o.first()}async applyFilter(e){let i=await super.getFilteredFeed(e);return new Yi(this.actions,i.page,!0)}async getContinuation(){let e=await super.getContinuationData();if(!(e!=null&&e.on_response_received_actions_memo))throw new g("Unexpected continuation data",e);return e.on_response_received_actions_memo.set("FeedFilterChipBar",this.memo.getType(vt)),e.on_response_received_actions_memo.set("ChipCloudChip",this.memo.getType(je)),new Yi(this.actions,e,!0)}};r(Yi,"FilteredChannelList");var As,Ut,Rs,Sr=class{constructor(e,i,s=!1){var m,x,_;As.set(this,void 0),Ut.set(this,void 0),Rs.set(this,void 0),I(this,As,s?i:c.parseResponse(i),"f"),I(this,Ut,e,"f");let o=u(this,As,"f").on_response_received_endpoints;if(!o)throw new g("Comments page did not have any content.");let a=o.at(0),l=o.at(1);this.header=(m=a==null?void 0:a.contents)==null?void 0:m.firstOfType(Si);let f=((x=l==null?void 0:l.contents)==null?void 0:x.filterType($_))||[];this.contents=G(f.map(b=>(b.comment&&b.comment.setActions(u(this,Ut,"f")),b.setActions(u(this,Ut,"f")),b))),I(this,Rs,(_=l==null?void 0:l.contents)==null?void 0:_.firstOfType(J),"f")}async applySort(e){var o,a,l,f;if(!this.header)throw new g("Page header is missing. Cannot apply sort option.");let i;if(e==="TOP_COMMENTS"?i=(a=(o=this.header.sort_menu)==null?void 0:o.sub_menu_items)==null?void 0:a.at(0):e==="NEWEST_FIRST"&&(i=(f=(l=this.header.sort_menu)==null?void 0:l.sub_menu_items)==null?void 0:f.at(1)),!i)throw new g("Could not find target button.");if(i.selected)return this;let s=await i.endpoint.call(u(this,Ut,"f"),{parse:!0});return new Sr(u(this,Ut,"f"),s,!0)}async createComment(e){var s;if(!this.header)throw new g("Page header is missing. Cannot create comment.");let i=(s=this.header.create_renderer)==null?void 0:s.as(j_).submit_button;if(!i)throw new g("Could not find target button. You are probably not logged in.");if(!i.endpoint)throw new g("Button does not have an endpoint.");return await i.endpoint.call(u(this,Ut,"f"),{commentText:e})}async getContinuation(){if(!u(this,Rs,"f"))throw new g("Continuation not found");let e=await u(this,Rs,"f").endpoint.call(u(this,Ut,"f"),{parse:!0}),i=Object.assign({},u(this,As,"f"));if(!i.on_response_received_endpoints||!e.on_response_received_endpoints)throw new g("Invalid reponse format, missing on_response_received_endpoints.");return i.on_response_received_endpoints.pop(),i.on_response_received_endpoints.push(e.on_response_received_endpoints[0]),new Sr(u(this,Ut,"f"),i,!0)}get has_continuation(){return!!u(this,Rs,"f")}get page(){return u(this,As,"f")}};r(Sr,"Comments");As=new WeakMap,Ut=new WeakMap,Rs=new WeakMap;var oE=Sr;var Ms,lb=class{constructor(e){Ms.set(this,void 0),I(this,Ms,c.parseResponse(e),"f"),u(this,Ms,"f").items&&(this.contents=u(this,Ms,"f").items.array().as(ts,bx))}get page(){return u(this,Ms,"f")}};r(lb,"Guide");Ms=new WeakMap;var nE=lb;var Ft=class extends be{constructor(e,i,s=!1){super(e,i,s),this.sections=this.memo.getType(It),this.feed_actions=this.memo.getType(Qd).first()}async getContinuation(){let e=await this.getContinuationData();if(!e)throw new Error("No continuation data found");return new Ft(this.actions,e,!0)}async removeVideo(e){let i;for(let l of this.sections)for(let f of l.contents){let m=f;if(m.id===e&&m.menu){i=m.menu.top_level_buttons[0].as(v).endpoint.payload.feedbackToken;break}}if(!i)throw new Error("Failed to get feedback token");let s={feedbackTokens:[i]};if(!(await this.actions.execute("/feedback",s)).data.feedbackResponses[0].isProcessed)throw new Error("Failed to remove video from watch history");return!0}};r(Ft,"History");var ri=class extends Di{constructor(e,i,s=!1){var o;super(e,i,s),this.header=this.memo.getType(fx).first(),this.contents=this.memo.getType(Ni).first()||((o=this.page.on_response_received_actions)==null?void 0:o.first())}async applyFilter(e){let i=await super.getFilteredFeed(e);return new ri(this.actions,i.page,!0)}async getContinuation(){var i;let e=await super.getContinuation();return e.page.header=this.page.header,this.header&&((i=e.page.header_memo)==null||i.set(this.header.type,[this.header])),new ri(this.actions,e.page,!0)}};r(ri,"HomeFeed");var Vi=class extends Di{constructor(e,i){if(super(e,i),!this.page.contents_memo)throw new g("Unexpected response",this.page);let s=this.page.contents_memo.getType(Se).first();if(!s.content)throw new g("Content tab has no content",s);this.page.header&&(this.header=this.page.header.item().as(gx,Lt)),this.contents=s.content.as(Ni)}async applyFilter(e){let i=await super.getFilteredFeed(e);return new Vi(this.actions,i.page)}};r(Vi,"HashtagFeed");var ub,fb,Uh,mb=class{constructor(e,i){ub.set(this,void 0),fb.set(this,void 0),Uh.set(this,void 0),I(this,ub,e,"f"),I(this,fb,i,"f");let s=e==null?void 0:e.live_chat_item_context_menu_supported_renderers;if(!s||!s.is(R))throw new g('Response did not have a "live_chat_item_context_menu_supported_renderers" property. The call may have failed.');I(this,Uh,s.as(R).items,"f")}async selectItem(e){let i;if(e instanceof v){if(!e.endpoint)throw new g("Item does not have an endpoint.");i=e.endpoint}else{let s=u(this,Uh,"f").find(o=>o.is(At)?o.as(At).icon_type===e:!1);if(!s||!s.is(At))throw new g(`Button "${e}" not found.`);i=s.endpoint}if(!i)throw new g("Target button does not have an endpoint.");return await i.call(u(this,fb,"f"),{parse:!0})}items(){return u(this,Uh,"f")}page(){return u(this,ub,"f")}};r(mb,"ItemMenu");ub=new WeakMap,fb=new WeakMap,Uh=new WeakMap;var hb=mb;var Fh,db,Ls=class extends be{constructor(e,i,s=!1){var m,x,_,b,T;super(e,i,s),Fh.add(this);let o=this.memo.getType(Sy).first(),a=this.memo.getType(ky).first(),l=this.memo.getType(Cy).first(),f=(m=this.page.alerts)==null?void 0:m.firstOfType(Br);if(f&&f.alert_type==="ERROR")throw new g(f.text.toString(),f);if(!a&&!l&&Object.keys(this.page).length===0)throw new g("Got empty continuation response. This is likely the end of the playlist.");this.info={...(x=this.page.metadata)==null?void 0:x.item().as(Ey),subtitle:o?o.subtitle:null,author:(b=(_=l==null?void 0:l.owner)==null?void 0:_.as(_s).author)!=null?b:o==null?void 0:o.author,thumbnails:(T=a==null?void 0:a.thumbnail_renderer)==null?void 0:T.as(zr,qr).thumbnail,total_items:u(this,Fh,"m",db).call(this,0,a),views:u(this,Fh,"m",db).call(this,1,a),last_updated:u(this,Fh,"m",db).call(this,2,a),can_share:o==null?void 0:o.can_share,can_delete:o==null?void 0:o.can_delete,is_editable:o==null?void 0:o.is_editable,privacy:o==null?void 0:o.privacy},this.menu=a==null?void 0:a.menu,this.endpoint=a==null?void 0:a.endpoint,this.messages=this.memo.getType(ki)}get items(){return G(this.videos.as(ps,ls,ds).filter(e=>e.style!=="PLAYLIST_VIDEO_RENDERER_STYLE_RECOMMENDED_VIDEO"))}get has_continuation(){let e=this.memo.getType(de).first();return e?!!this.memo.getType(J).find(i=>!e.contents.includes(i)):super.has_continuation}async getContinuationData(){let e=this.memo.getType(de).first();if(!e)return await super.getContinuationData();let i=this.memo.getType(J).find(s=>!e.contents.includes(s));if(!i)throw new g("There are no continuations.");return await i.endpoint.call(this.actions,{parse:!0})}async getContinuation(){let e=await this.getContinuationData();if(!e)throw new g("Could not get continuation data");return new Ls(this.actions,e,!0)}};r(Ls,"Playlist");Fh=new WeakSet,db=r(function(e,i){var s;return!i||!i.stats?"N/A":((s=i.stats[e])==null?void 0:s.toString())||"N/A"},"_Playlist_getStat");var Os=Ls;var $g,aE,_b=class extends be{constructor(e,i){if(super(e,i),$g.add(this),!this.page.contents_memo)throw new g("Page contents not found");this.header=this.memo.getType(Lt).first();let s=this.page.contents_memo.getType(hs);this.sections=s.map(o=>{var a;return{type:o.icon_type,title:o.title,contents:((a=o.content)==null?void 0:a.key("items").array())||[],getAll:()=>u(this,$g,"m",aE).call(this,o)}})}get history(){return this.sections.find(e=>e.type==="WATCH_HISTORY")}get watch_later(){return this.sections.find(e=>e.type==="WATCH_LATER")}get liked_videos(){return this.sections.find(e=>e.type==="LIKE")}get playlists_section(){return this.sections.find(e=>e.type==="PLAYLISTS")}get clips(){return this.sections.find(e=>e.type==="CONTENT_CUT")}};r(_b,"Library");$g=new WeakSet,aE=r(async function(e){var o;if(!((o=e.menu)!=null&&o.as(R).top_level_buttons))throw new g(`The ${e.title.text} shelf doesn't have more items`);let i=e.menu.as(R).top_level_buttons.firstOfType(v);if(!i)throw new g("Did not find target button.");let s=await i.as(v).endpoint.call(this.actions,{parse:!0});switch(e.icon_type){case"LIKE":case"WATCH_LATER":return new Os(this.actions,s,!0);case"WATCH_HISTORY":return new Ft(this.actions,s,!0);case"CONTENT_CUT":return new be(this.actions,s,!0);default:throw new g("Target shelf not implemented.")}},"_Library_getAll");var pE=_b;var si,Ui,Er,it,Et,$e;function A1(t){let e=[];for(let i of t)if(Array.isArray(i))for(let s of i)e.push(s);else e.push(i);return e}r(A1,"flattenQueue");var xb=class{constructor(){this.front=[],this.back=[]}isEmpty(){return!this.front.length&&!this.back.length}clear(){this.front=[],this.back=[]}getValues(){return this.front.concat(this.back.reverse())}};r(xb,"DelayQueue");var yb=class{constructor(){si.set(this,void 0),Ui.set(this,void 0),Er.set(this,void 0),it.set(this,void 0),Et.set(this,void 0),$e.set(this,void 0),I(this,si,null,"f"),I(this,Ui,null,"f"),I(this,Er,null,"f"),I(this,it,[],"f"),I(this,Et,null,"f"),I(this,$e,new xb,"f")}enqueueActionGroup(e){if(u(this,si,"f")!==null){let i=Date.now()-u(this,si,"f");u(this,$e,"f").back.push(i),5{o.length?o.length<10?await u(this,we,"m",wb).call(this,o):this.is_replay?(u(this,we,"m",wb).call(this,o),await u(this,we,"m",kr).call(this,2e3)):u(this,we,"m",wb).call(this,o):await u(this,we,"m",kr).call(this,2e3),this.running&&u(this,we,"m",Kg).call(this)}}on(e,i){super.on(e,i)}once(e,i){super.once(e,i)}start(){this.running||(this.running=!0,u(this,we,"m",Kg).call(this),u(this,we,"m",cE).call(this))}stop(){this.smoothed_queue.clear(),this.running=!1}async sendMessage(e){let i=xT.encode({params:{ids:{videoId:u(this,jh,"f"),channelId:u(this,gb,"f")}},number0:1,number1:4}),s=btoa(encodeURIComponent(zt(i.finish()))),o=await u(this,oi,"f").execute("/live_chat/send_message",{richMessage:{textSegments:[{text:e}]},clientMessageId:M.shim.uuidv4(),client:"WEB",parse:!0,params:s});if(!o.actions)throw new g("Unexpected response from send_message",o);return o.actions.array().as(Rx)}applyFilter(e){var s,o,a,l,f,m,x;if(!this.initial_info)throw new g("Cannot apply filter before initial info is retrieved.");let i=(a=(o=(s=this.initial_info)==null?void 0:s.header)==null?void 0:o.view_selector)==null?void 0:a.sub_menu_items;if(e==="TOP_CHAT"){if((l=i==null?void 0:i.at(0))!=null&&l.selected)return;I(this,Cr,(f=i==null?void 0:i.at(0))==null?void 0:f.continuation,"f")}else{if((m=i==null?void 0:i.at(1))!=null&&m.selected)return;I(this,Cr,(x=i==null?void 0:i.at(1))==null?void 0:x.continuation,"f")}}async getItemMenu(e){if(!e.hasKey("menu_endpoint")||!e.key("menu_endpoint").isInstanceof(d))throw new g("This item does not have a menu.",e);let i=await e.key("menu_endpoint").instanceof(d).call(u(this,oi,"f"),{parse:!0});if(!i)throw new g("Could not retrieve item menu.",e);return new hb(i,u(this,oi,"f"))}async selectButton(e){return await e.endpoint.call(u(this,oi,"f"),{parse:!0})}};r(Tb,"LiveChat");oi=new WeakMap,jh=new WeakMap,gb=new WeakMap,Cr=new WeakMap,Wh=new WeakMap,Gh=new WeakMap,we=new WeakSet,Kg=r(function t(){(async()=>{var e,i;try{let s=await u(this,oi,"f").execute(this.is_replay?"live_chat/get_live_chat_replay":"live_chat/get_live_chat",{continuation:u(this,Cr,"f"),parse:!0}),o=s.continuation_contents;if(o||(this.emit("error",new g("Unexpected live chat incremental continuation response",s)),this.emit("end"),this.stop()),!(o instanceof Mi)){this.stop(),this.emit("end");return}I(this,Cr,o.continuation.token,"f"),o.header?(this.initial_info=o,this.emit("start",o),this.running&&u(this,we,"m",t).call(this)):this.smoothed_queue.enqueueActionGroup(o.actions),I(this,Gh,0,"f")}catch(s){this.emit("error",s),I(this,Gh,(i=u(this,Gh,"f"),e=i++,i),"f"),e<10?(await u(this,we,"m",kr).call(this,2e3),u(this,we,"m",t).call(this)):(this.emit("error",new g("Reached retry limit for incremental continuation requests",s)),this.emit("end"),this.stop())}})()},"_LiveChat_pollLivechat"),wb=r(async function(e){let s=e.length<125?1:Math.ceil(e.length/125),o=s==1?(s=1e4/e.length,s*=Math.random()+.5,s=Math.min(1e3,s),s=Math.max(80,s)):s=80;for(let a of e)await u(this,we,"m",kr).call(this,o),this.emit("chat-update",a)},"_LiveChat_emitSmoothedActions"),cE=r(function t(){(async()=>{var e,i,s,o,a,l,f,m,x,_,b;try{let T={videoId:u(this,jh,"f")};u(this,Wh,"f")&&(T.continuation=u(this,Wh,"f"));let w=await u(this,oi,"f").execute("/updated_metadata",T),S=c.parseResponse(w.data);I(this,Wh,(e=S.continuation)==null?void 0:e.token,"f"),this.metadata={title:((i=S.actions)==null?void 0:i.array().firstOfType(Vx))||((s=this.metadata)==null?void 0:s.title),description:((o=S.actions)==null?void 0:o.array().firstOfType(Yx))||((a=this.metadata)==null?void 0:a.description),views:((l=S.actions)==null?void 0:l.array().firstOfType(Fx))||((f=this.metadata)==null?void 0:f.views),likes:((m=S.actions)==null?void 0:m.array().firstOfType(Ux))||((x=this.metadata)==null?void 0:x.likes),date:((_=S.actions)==null?void 0:_.array().firstOfType(Bx))||((b=this.metadata)==null?void 0:b.date)},this.emit("metadata-update",this.metadata),await u(this,we,"m",kr).call(this,5e3),this.running&&u(this,we,"m",t).call(this)}catch{await u(this,we,"m",kr).call(this,2e3),this.running&&u(this,we,"m",t).call(this)}})()},"_LiveChat_pollMetadata"),kr=r(async function(e){return new Promise(i=>setTimeout(()=>i(),e))},"_LiveChat_wait");var vb=Tb;var Fi,Hh,Ds=class{constructor(e,i){if(Fi.set(this,void 0),Hh.set(this,void 0),I(this,Hh,e,"f"),I(this,Fi,c.parseResponse(i.data),"f"),!u(this,Fi,"f").actions_memo)throw new g("Page actions not found");this.header=u(this,Fi,"f").actions_memo.getType(Qx).first(),this.contents=u(this,Fi,"f").actions_memo.getType(fy)}async getContinuation(){var s;let e=(s=u(this,Fi,"f").actions_memo)==null?void 0:s.getType(J).first();if(!e)throw new g("Continuation not found");let i=await e.endpoint.call(u(this,Hh,"f"),{parse:!1});return new Ds(u(this,Hh,"f"),i)}get page(){return u(this,Fi,"f")}};r(Ds,"NotificationsMenu");Fi=new WeakMap,Hh=new WeakMap;var lE=Ds;var ni=class extends be{constructor(e,i,s=!1){var a,l,f;super(e,i,s);let o=((a=this.page.contents_memo)==null?void 0:a.getType(de).first().contents)||((l=this.page.on_response_received_commands)==null?void 0:l.first().contents);if(!o)throw new g("No contents found in search response");this.page.header&&(this.header=this.page.header.item().as(My)),this.results=G(o.filterType(It).flatMap(m=>m.contents)),this.refinements=this.page.refinements||[],this.estimated_results=this.page.estimated_results||0,this.page.contents_memo&&(this.sub_menu=this.page.contents_memo.getType(Ly).first(),this.watch_card=this.page.contents_memo.getType($y).first()),this.refinement_cards=(f=this.results)==null?void 0:f.firstOfType(wi)}async selectRefinementCard(e){var o,a;let i;if(typeof e=="string"){if(!this.refinement_cards)throw new g("No refinement cards found.");if(i=(a=(o=this.refinement_cards)==null?void 0:o.cards.get({query:e}))==null?void 0:a.as(tr),!i)throw new g(`Refinement card "${e}" not found`,{available_cards:this.refinement_card_queries})}else if(e.type==="SearchRefinementCard")i=e;else throw new g("Invalid refinement card!");let s=await i.endpoint.call(this.actions,{parse:!0});return new ni(this.actions,s,!0)}get refinement_card_queries(){var e;return((e=this.refinement_cards)==null?void 0:e.cards.as(tr).map(i=>i.query))||[]}async getContinuation(){let e=await this.getContinuationData();if(!e)throw new g("Could not get continuation data");return new ni(this.actions,e,!0)}};r(ni,"Search");var Pr,$h,Bs=class{constructor(e,i){var a,l,f,m;if(Pr.set(this,void 0),$h.set(this,void 0),I(this,$h,e,"f"),I(this,Pr,c.parseResponse(i.data),"f"),this.sidebar=(a=u(this,Pr,"f").sidebar)==null?void 0:a.as(Dy),!u(this,Pr,"f").contents)throw new g("Page contents not found");let s=u(this,Pr,"f").contents.item().as(Ot).tabs.array().as(Se).get({selected:!0});if(!s)throw new g("Target tab not found");let o=(l=s.content)==null?void 0:l.as(de).contents.as(It);this.introduction=(m=(f=o==null?void 0:o.shift())==null?void 0:f.contents)==null?void 0:m.firstOfType(hy),this.sections=o==null?void 0:o.map(x=>{var _;return{title:(_=x.header)!=null&&_.is(Si,is,rs)?x.header.title.toString():null,contents:x.contents}})}async selectSidebarItem(e){if(!this.sidebar)throw new g("Sidebar not available");let i;if(typeof e=="string"){if(i=this.sidebar.items.get({title:e}),!i)throw new g(`Item "${e}" not found`,{available_items:this.sidebar_items})}else if(e!=null&&e.is(yi))i=e;else throw new g("Invalid item",{target_item:e});let s=await i.endpoint.call(u(this,$h,"f"),{parse:!1});return new Bs(u(this,$h,"f"),s)}getSettingOption(e){var i;if(!this.sections)throw new g("Sections not available");for(let s of this.sections)if(!!s.contents)for(let o of s.contents){let a=o.as(ms).options;if(a){for(let l of a)if(l.is(fs)&&((i=l.title)==null?void 0:i.toString())===e)return l}}throw new g(`Option "${e}" not found`,{available_options:this.setting_options})}get setting_options(){if(!this.sections)throw new g("Sections not available");let e=[];for(let i of this.sections)if(!!i.contents)for(let s of i.contents)s.as(ms).options&&(e=e.concat(s.as(ms).options));return e.map(i=>{var s;return(s=i.title)==null?void 0:s.toString()}).filter(i=>i)}get sidebar_items(){if(!this.sidebar)throw new g("Sidebar not available");return this.sidebar.items.map(e=>e.title.toString())}get page(){return u(this,Pr,"f")}};r(Bs,"Settings");Pr=new WeakMap,$h=new WeakMap;var uE=Bs;var Wi,Ys=class extends Ps{constructor(e,i,s){var x,_,b,T,w,S,E,C,k,U,L,K,re,he,Y,te,F,B,X,Z,Ue,ut,ft,mt,Fe,li,jt,ae,ze;super(e,i,s),Wi.set(this,void 0);let[o,a]=this.page;if(this.streaming_data){let pe=this.streaming_data.adaptive_formats.find(Ae=>{var tt;return(tt=Ae.audio_track)==null?void 0:tt.audio_is_default});if(pe)this.streaming_data.formats.forEach(Ae=>Ae.language=pe.language);else if(((x=this.captions)==null?void 0:x.caption_tracks)&&((_=this.captions)==null?void 0:_.caption_tracks.length)>0){let Ae=this.captions.caption_tracks.find(oe=>oe.kind==="asr"),tt=Ae==null?void 0:Ae.language_code;this.streaming_data.adaptive_formats.forEach(oe=>{oe.has_audio&&(oe.language=tt)}),this.streaming_data.formats.forEach(oe=>oe.language=tt)}}let l=(b=a==null?void 0:a.contents)==null?void 0:b.item().as(Hy),f=l==null?void 0:l.results,m=l==null?void 0:l.secondary_results;if(f&&m){if(((T=o.microformat)==null?void 0:T.is(et))&&((w=o.microformat)==null?void 0:w.category)==="Gaming"){let oe=(C=(E=(S=f.firstOfType(wh))==null?void 0:S.metadata)==null?void 0:E.rows)==null?void 0:C.firstOfType(om);oe!=null&&oe.is(om)&&(this.game_info={title:(U=(k=oe==null?void 0:oe.contents)==null?void 0:k.firstOfType(rm))==null?void 0:U.title,release_year:(K=(L=oe==null?void 0:oe.contents)==null?void 0:L.firstOfType(rm))==null?void 0:K.subtitle})}this.primary_info=f.firstOfType(qy),this.secondary_info=f.firstOfType(wh),this.merchandise=f.firstOfType(Jx),this.related_chip_cloud=(re=m.firstOfType(Ny))==null?void 0:re.content.as(Kr),l!=null&&l.playlist&&(this.playlist=l.playlist),this.watch_next_feed=((he=m.firstOfType(It))==null?void 0:he.contents)||m,this.watch_next_feed&&Array.isArray(this.watch_next_feed)&&((Y=this.watch_next_feed.at(-1))==null?void 0:Y.is(J))&&I(this,Wi,(te=this.watch_next_feed.pop())==null?void 0:te.as(J),"f"),this.player_overlays=(F=a==null?void 0:a.player_overlays)==null?void 0:F.item().as(Iy),l!=null&&l.autoplay&&(this.autoplay=l.autoplay);let pe=(X=(B=this.primary_info)==null?void 0:B.menu)==null?void 0:X.top_level_buttons.firstOfType(dr);((Z=pe==null?void 0:pe.like_button)==null?void 0:Z.is(se))&&((Ue=pe==null?void 0:pe.dislike_button)==null?void 0:Ue.is(se))&&(this.basic_info.like_count=(ut=pe==null?void 0:pe.like_button)==null?void 0:ut.like_count,this.basic_info.is_liked=(ft=pe==null?void 0:pe.like_button)==null?void 0:ft.is_toggled,this.basic_info.is_disliked=(mt=pe==null?void 0:pe.dislike_button)==null?void 0:mt.is_toggled);let Ae=(li=(Fe=this.primary_info)==null?void 0:Fe.menu)==null?void 0:li.top_level_buttons.firstOfType(Xt);if(Ae&&(this.basic_info.like_count=Ae.like_count,Ae.like_button)){let oe=Ae.like_button.like_status_entity.like_status;this.basic_info.is_liked=oe==="LIKE",this.basic_info.is_disliked=oe==="DISLIKE"}let tt=(jt=f.get({target_id:"comments-entry-point"}))==null?void 0:jt.as(It);this.comments_entry_point_header=(ae=tt==null?void 0:tt.contents)==null?void 0:ae.firstOfType(G_),this.livechat=(ze=a==null?void 0:a.contents_memo)==null?void 0:ze.getType(Px).first()}}async selectFilter(e){var a,l,f,m;if(!this.related_chip_cloud)throw new g("Chip cloud not found, cannot apply filter");let i;if(typeof e=="string"){let x=(l=(a=this.related_chip_cloud)==null?void 0:a.chips)==null?void 0:l.get({text:e});if(!x)throw new g("Invalid filter",{available_filters:this.filters});i=x}else if(e!=null&&e.is(je))i=e;else throw new g("Invalid cloud chip",e);if(i.is_selected)return this;let s=await((f=i.endpoint)==null?void 0:f.call(this.actions,{parse:!0})),o=(m=s==null?void 0:s.on_response_received_endpoints)==null?void 0:m.get({target_id:"watch-next-feed"});return this.watch_next_feed=o==null?void 0:o.contents,this}async addToWatchHistory(e={}){return super.addToWatchHistory(e)}async getWatchNextContinuation(){var s,o,a,l,f;if(!u(this,Wi,"f"))throw new g("Watch next feed continuation not found");let e=await((s=u(this,Wi,"f"))==null?void 0:s.endpoint.call(this.actions,{parse:!0})),i=(o=e==null?void 0:e.on_response_received_endpoints)==null?void 0:o.get({type:"AppendContinuationItemsAction"});if(!i)throw new g("AppendContinuationItemsAction not found");return this.watch_next_feed=i==null?void 0:i.contents,(l=(a=this.watch_next_feed)==null?void 0:a.at(-1))!=null&&l.is(J)?I(this,Wi,(f=this.watch_next_feed.pop())==null?void 0:f.as(J),"f"):I(this,Wi,void 0,"f"),this}async like(){var o,a,l,f,m;let e=(a=(o=this.primary_info)==null?void 0:o.menu)==null?void 0:a.top_level_buttons.firstOfType(Xt);if(e){let x=(l=e==null?void 0:e.like_button)==null?void 0:l.toggle_button;if(!x||!x.default_button||!e.like_button)throw new g("Like button not found",{video_id:this.basic_info.id});if(e.like_button.like_status_entity.like_status==="LIKE")throw new g("This video is already liked",{video_id:this.basic_info.id});return await new d(x.default_button.on_tap.payload.commands.find(T=>T.innertubeCommand)).call(this.actions)}let i=(m=(f=this.primary_info)==null?void 0:f.menu)==null?void 0:m.top_level_buttons.firstOfType(dr),s=i==null?void 0:i.like_button;if(!s)throw new g("Like button not found",{video_id:this.basic_info.id});if(!s.is(se))throw new g("Like button is not a toggle button. This action is likely disabled for this video.",{video_id:this.basic_info.id});if(s.is_toggled)throw new g("This video is already liked",{video_id:this.basic_info.id});return await s.endpoint.call(this.actions)}async dislike(){var o,a,l,f,m;let e=(a=(o=this.primary_info)==null?void 0:o.menu)==null?void 0:a.top_level_buttons.firstOfType(Xt);if(e){let x=(l=e==null?void 0:e.dislike_button)==null?void 0:l.toggle_button;if(!x||!x.default_button||!e.dislike_button||!e.like_button)throw new g("Dislike button not found",{video_id:this.basic_info.id});if(e.like_button.like_status_entity.like_status==="DISLIKE")throw new g("This video is already disliked",{video_id:this.basic_info.id});return await new d(x.default_button.on_tap.payload.commands.find(T=>T.innertubeCommand)).call(this.actions)}let i=(m=(f=this.primary_info)==null?void 0:f.menu)==null?void 0:m.top_level_buttons.firstOfType(dr),s=i==null?void 0:i.dislike_button;if(!s)throw new g("Dislike button not found",{video_id:this.basic_info.id});if(!s.is(se))throw new g("Dislike button is not a toggle button. This action is likely disabled for this video.",{video_id:this.basic_info.id});if(s.is_toggled)throw new g("This video is already disliked",{video_id:this.basic_info.id});return await s.endpoint.call(this.actions)}async removeRating(){var l,f,m,x,_,b,T;let e,i=(f=(l=this.primary_info)==null?void 0:l.menu)==null?void 0:f.top_level_buttons.firstOfType(Xt);if(i){let w=(m=i==null?void 0:i.like_button)==null?void 0:m.toggle_button;if(!w||!w.default_button||!i.like_button)throw new g("Like button not found",{video_id:this.basic_info.id});let S=i.like_button.like_status_entity.like_status;if(S==="LIKE")e=(x=i==null?void 0:i.like_button)==null?void 0:x.toggle_button;else if(S==="DISLIKE")e=(_=i==null?void 0:i.dislike_button)==null?void 0:_.toggle_button;else throw new g("This video is not liked/disliked",{video_id:this.basic_info.id});if(!e||!e.toggled_button)throw new g("Like/Dislike button not found",{video_id:this.basic_info.id});return await new d(e.toggled_button.on_tap.payload.commands.find(C=>C.innertubeCommand)).call(this.actions)}let s=(T=(b=this.primary_info)==null?void 0:b.menu)==null?void 0:T.top_level_buttons.firstOfType(dr),o=s==null?void 0:s.like_button,a=s==null?void 0:s.dislike_button;if(!(o!=null&&o.is(se))||!(a!=null&&a.is(se)))throw new g("Like/Dislike button is not a toggle button. This action is likely disabled for this video.",{video_id:this.basic_info.id});if(o!=null&&o.is_toggled?e=o:a!=null&&a.is_toggled&&(e=a),!e)throw new g("This video is not liked/disliked",{video_id:this.basic_info.id});return await e.toggled_endpoint.call(this.actions)}getLiveChat(){if(!this.livechat)throw new g("Live Chat is not available",{video_id:this.basic_info.id});return new vb(this)}getTrailerInfo(){var e,i;if(this.has_trailer&&this.playability_status){let s=(i=(e=this.playability_status.error_screen)==null?void 0:e.as(Tf).trailer)==null?void 0:i.player_response;if(s)return new Ys([{data:s}],this.actions,this.cpn)}return null}get filters(){var e,i;return((i=(e=this.related_chip_cloud)==null?void 0:e.chips)==null?void 0:i.map(s=>{var o;return(o=s.text)==null?void 0:o.toString()}))||[]}get wn_has_continuation(){return!!u(this,Wi,"f")}get autoplay_video_endpoint(){var e,i,s;return((s=(i=(e=this.autoplay)==null?void 0:e.sets)==null?void 0:i[0])==null?void 0:s.autoplay_video)||null}get has_trailer(){var e,i;return!!((i=(e=this.playability_status)==null?void 0:e.error_screen)!=null&&i.is(Tf))}get music_tracks(){var i,s,o,a,l,f;let e=(s=(i=this.page[1])==null?void 0:i.engagement_panels)==null?void 0:s.filter(m=>{var x;return(x=m.content)==null?void 0:x.is(sr)});if(e!==void 0&&e.length>0){let m=(l=(a=(o=e[0].content)==null?void 0:o.as(sr))==null?void 0:a.items)==null?void 0:l.filterType(jr);if(m!==void 0&&m.length>0)return(f=m[0].carousel_lockups)==null?void 0:f.map(x=>{var C,k,U,L,K,re,he,Y,te,F,B,X,Z,Ue,ut,ft,mt,Fe,li;let _,b,T,w,S,E;_=(k=(C=x.video_lockup)==null?void 0:C.title)==null?void 0:k.toString(),S=(U=x.video_lockup)==null?void 0:U.endpoint.payload.videoId;for(let jt=0;jtm.title.toString()===e);if(!i)throw new Error(`Language not found: ${e}`);if(i.selected)return this;let s=await u(this,qh,"f").execute("/get_transcript",{params:i.continuation});return new Us(u(this,qh,"f"),s)}get languages(){var e,i,s,o;return((o=(s=(i=(e=this.transcript.content)==null?void 0:e.footer)==null?void 0:i.language_menu)==null?void 0:s.sub_menu_items)==null?void 0:o.map(a=>a.title.toString()))||[]}get selectedLanguage(){var e,i,s,o,a;return((a=(o=(s=(i=(e=this.transcript.content)==null?void 0:e.footer)==null?void 0:i.language_menu)==null?void 0:s.sub_menu_items)==null?void 0:o.find(l=>l.selected))==null?void 0:a.title.toString())||""}get page(){return u(this,Vs,"f")}};r(Us,"TranscriptInfo");Vs=new WeakMap,qh=new WeakMap;var cb=Us;var fE={};var P=class{constructor(e,i,s,o){var l,f,m,x,_,b,T,w,S,E,C,k,U,L,K,re,he,Y,te,F,B,X,Z,Ue,ut,ft,mt;let a=new p(e);this.id=o||((x=(m=(f=(l=a==null?void 0:a.runs)==null?void 0:l[0])==null?void 0:f.endpoint)==null?void 0:m.payload)==null?void 0:x.browseId)||((b=(_=a==null?void 0:a.endpoint)==null?void 0:_.payload)==null?void 0:b.browseId)||"N/A",this.name=(a==null?void 0:a.text)||"N/A",this.thumbnails=s?y.fromResponse(s):[],this.endpoint=((w=(T=a==null?void 0:a.runs)==null?void 0:T[0])==null?void 0:w.endpoint)||(a==null?void 0:a.endpoint),i?Array.isArray(i)?(this.badges=c.parseArray(i),this.is_moderator=(S=this.badges)==null?void 0:S.some(Fe=>Fe.icon_type=="MODERATOR"),this.is_verified=(E=this.badges)==null?void 0:E.some(Fe=>Fe.style=="BADGE_STYLE_TYPE_VERIFIED"),this.is_verified_artist=(C=this.badges)==null?void 0:C.some(Fe=>Fe.style=="BADGE_STYLE_TYPE_VERIFIED_ARTIST")):(this.badges=G([]),this.is_verified=!!i.isVerified,this.is_verified_artist=!!i.isArtist):this.badges=G([]),this.url=((K=(L=(U=(k=a==null?void 0:a.runs)==null?void 0:k[0])==null?void 0:U.endpoint)==null?void 0:L.metadata)==null?void 0:K.api_url)==="/browse"&&`${We.YT_BASE}${((te=(Y=(he=(re=a==null?void 0:a.runs)==null?void 0:re[0])==null?void 0:he.endpoint)==null?void 0:Y.payload)==null?void 0:te.canonicalBaseUrl)||`/u/${(Z=(X=(B=(F=a==null?void 0:a.runs)==null?void 0:F[0])==null?void 0:B.endpoint)==null?void 0:X.payload)==null?void 0:Z.browseId}`}`||`${We.YT_BASE}${((ut=(Ue=a==null?void 0:a.endpoint)==null?void 0:Ue.payload)==null?void 0:ut.canonicalBaseUrl)||`/u/${(mt=(ft=a==null?void 0:a.endpoint)==null?void 0:ft.payload)==null?void 0:mt.browseId}`}`}get best_thumbnail(){return this.thumbnails[0]}};r(P,"Author");var R1=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,370,1,81,2,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,10,1,2,0,49,6,4,4,14,9,5351,0,7,14,13835,9,87,9,39,4,60,6,26,9,1014,0,2,54,8,3,82,0,12,1,19628,1,4706,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,983,6,110,6,6,9,4759,9,787719,239],yE=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,68,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,349,41,7,1,79,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,4026,582,8634,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,43,8,8936,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,757,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4153,7,221,3,5761,15,7472,16,621,2467,541,1507,4938,6,4191],M1="\u200C\u200D\xB7\u0300-\u036F\u0387\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u0669\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07C0-\u07C9\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0966-\u096F\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09E6-\u09EF\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A66-\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AE6-\u0AEF\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B66-\u0B6F\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE6-\u0BEF\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CE6-\u0CEF\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D66-\u0D6F\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0E50-\u0E59\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0ED0-\u0ED9\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1040-\u1049\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109D\u135D-\u135F\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u17E0-\u17E9\u180B-\u180D\u180F-\u1819\u18A9\u1920-\u192B\u1930-\u193B\u1946-\u194F\u19D0-\u19DA\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AB0-\u1ABD\u1ABF-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BF3\u1C24-\u1C37\u1C40-\u1C49\u1C50-\u1C59\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u200C\u200D\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\u30FB\uA620-\uA629\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F1\uA8FF-\uA909\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9D0-\uA9D9\uA9E5\uA9F0-\uA9F9\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA50-\uAA59\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uABF0-\uABF9\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFF10-\uFF19\uFF3F\uFF65",bE="\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC",Xg={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},Qg="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",L1={5:Qg,"5module":Qg+" export import",6:Qg+" const class extends export import super"},O1=/^in(stanceof)?$/,D1=new RegExp("["+bE+"]"),B1=new RegExp("["+bE+M1+"]");function Zg(t,e){for(var i=65536,s=0;st)return!1;if(i+=e[s+1],i>=t)return!0}return!1}r(Zg,"isInAstralSet");function ai(t,e){return t<65?t===36:t<91?!0:t<97?t===95:t<123?!0:t<=65535?t>=170&&D1.test(String.fromCharCode(t)):e===!1?!1:Zg(t,yE)}r(ai,"isIdentifierStart");function Fs(t,e){return t<48?t===36:t<58?!0:t<65?!1:t<91?!0:t<97?t===95:t<123?!0:t<=65535?t>=170&&B1.test(String.fromCharCode(t)):e===!1?!1:Zg(t,yE)||Zg(t,R1)}r(Fs,"isIdentifierChar");var $=r(function(e,i){i===void 0&&(i={}),this.label=e,this.keyword=i.keyword,this.beforeExpr=!!i.beforeExpr,this.startsExpr=!!i.startsExpr,this.isLoop=!!i.isLoop,this.isAssign=!!i.isAssign,this.prefix=!!i.prefix,this.postfix=!!i.postfix,this.binop=i.binop||null,this.updateContext=null},"TokenType");function rt(t,e){return new $(t,{beforeExpr:!0,binop:e})}r(rt,"binop");var st={beforeExpr:!0},Ke={startsExpr:!0},rw={};function j(t,e){return e===void 0&&(e={}),e.keyword=t,rw[t]=new $(t,e)}r(j,"kw");var h={num:new $("num",Ke),regexp:new $("regexp",Ke),string:new $("string",Ke),name:new $("name",Ke),privateId:new $("privateId",Ke),eof:new $("eof"),bracketL:new $("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new $("]"),braceL:new $("{",{beforeExpr:!0,startsExpr:!0}),braceR:new $("}"),parenL:new $("(",{beforeExpr:!0,startsExpr:!0}),parenR:new $(")"),comma:new $(",",st),semi:new $(";",st),colon:new $(":",st),dot:new $("."),question:new $("?",st),questionDot:new $("?."),arrow:new $("=>",st),template:new $("template"),invalidTemplate:new $("invalidTemplate"),ellipsis:new $("...",st),backQuote:new $("`",Ke),dollarBraceL:new $("${",{beforeExpr:!0,startsExpr:!0}),eq:new $("=",{beforeExpr:!0,isAssign:!0}),assign:new $("_=",{beforeExpr:!0,isAssign:!0}),incDec:new $("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new $("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:rt("||",1),logicalAND:rt("&&",2),bitwiseOR:rt("|",3),bitwiseXOR:rt("^",4),bitwiseAND:rt("&",5),equality:rt("==/!=/===/!==",6),relational:rt("/<=/>=",7),bitShift:rt("<>/>>>",8),plusMin:new $("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:rt("%",10),star:rt("*",10),slash:rt("/",10),starstar:new $("**",{beforeExpr:!0}),coalesce:rt("??",1),_break:j("break"),_case:j("case",st),_catch:j("catch"),_continue:j("continue"),_debugger:j("debugger"),_default:j("default",st),_do:j("do",{isLoop:!0,beforeExpr:!0}),_else:j("else",st),_finally:j("finally"),_for:j("for",{isLoop:!0}),_function:j("function",Ke),_if:j("if"),_return:j("return",st),_switch:j("switch"),_throw:j("throw",st),_try:j("try"),_var:j("var"),_const:j("const"),_while:j("while",{isLoop:!0}),_with:j("with"),_new:j("new",{beforeExpr:!0,startsExpr:!0}),_this:j("this",Ke),_super:j("super",Ke),_class:j("class",Ke),_extends:j("extends",st),_export:j("export"),_import:j("import",Ke),_null:j("null",Ke),_true:j("true",Ke),_false:j("false",Ke),_in:j("in",{beforeExpr:!0,binop:7}),_instanceof:j("instanceof",{beforeExpr:!0,binop:7}),_typeof:j("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:j("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:j("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},at=/\r\n?|\n|\u2028|\u2029/,Y1=new RegExp(at.source,"g");function Ws(t){return t===10||t===13||t===8232||t===8233}r(Ws,"isNewLine");function gE(t,e,i){i===void 0&&(i=t.length);for(var s=e;s>10)+55296,(t&1023)+56320))}r(ji,"codePointToString");var F1=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,Xh=r(function(e,i){this.line=e,this.column=i},"Position");Xh.prototype.offset=r(function(e){return new Xh(this.line,this.column+e)},"offset");var Pb=r(function(e,i,s){this.start=i,this.end=s,e.sourceFile!==null&&(this.source=e.sourceFile)},"SourceLocation");function vE(t,e){for(var i=1,s=0;;){var o=gE(t,s,e);if(o<0)return new Xh(i,e-s);++i,s=o}}r(vE,"getLineInfo");var ew={ecmaVersion:null,sourceType:"script",onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,checkPrivateFields:!0,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},dE=!1;function W1(t){var e={};for(var i in ew)e[i]=t&&Jh(t,i)?t[i]:ew[i];if(e.ecmaVersion==="latest"?e.ecmaVersion=1e8:e.ecmaVersion==null?(!dE&&typeof console=="object"&&console.warn&&(dE=!0,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required. +Defaulting to 2020, but this will stop working in the future.`)),e.ecmaVersion=11):e.ecmaVersion>=2015&&(e.ecmaVersion-=2009),e.allowReserved==null&&(e.allowReserved=e.ecmaVersion<5),(!t||t.allowHashBang==null)&&(e.allowHashBang=e.ecmaVersion>=14),mE(e.onToken)){var s=e.onToken;e.onToken=function(o){return s.push(o)}}return mE(e.onComment)&&(e.onComment=G1(e,e.onComment)),e}r(W1,"getOptions");function G1(t,e){return function(i,s,o,a,l,f){var m={type:i?"Block":"Line",value:s,start:o,end:a};t.locations&&(m.loc=new Pb(this,l,f)),t.ranges&&(m.range=[o,a]),e.push(m)}}r(G1,"pushComment");var Qh=1,Gs=2,sw=4,IE=8,SE=16,EE=32,ow=64,kE=128,Zh=256,nw=Qh|Gs|Zh;function aw(t,e){return Gs|(t?sw:0)|(e?IE:0)}r(aw,"functionFlags");var Sb=0,pw=1,ci=2,CE=3,PE=4,NE=5,me=r(function(e,i,s){this.options=e=W1(e),this.sourceFile=e.sourceFile,this.keywords=Gi(L1[e.ecmaVersion>=6?6:e.sourceType==="module"?"5module":5]);var o="";e.allowReserved!==!0&&(o=Xg[e.ecmaVersion>=6?6:e.ecmaVersion===5?5:3],e.sourceType==="module"&&(o+=" await")),this.reservedWords=Gi(o);var a=(o?o+" ":"")+Xg.strict;this.reservedWordsStrict=Gi(a),this.reservedWordsStrictBind=Gi(a+" "+Xg.strictBind),this.input=String(i),this.containsEsc=!1,s?(this.pos=s,this.lineStart=this.input.lastIndexOf(` +`,s-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(at).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=h.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule=e.sourceType==="module",this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.potentialArrowInForAwait=!1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports=Object.create(null),this.pos===0&&e.allowHashBang&&this.input.slice(0,2)==="#!"&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(Qh),this.regexpState=null,this.privateNameStack=[]},"Parser"),Wt={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},canAwait:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0},allowNewDotTarget:{configurable:!0},inClassStaticBlock:{configurable:!0}};me.prototype.parse=r(function(){var e=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(e)},"parse");Wt.inFunction.get=function(){return(this.currentVarScope().flags&Gs)>0};Wt.inGenerator.get=function(){return(this.currentVarScope().flags&IE)>0&&!this.currentVarScope().inClassFieldInit};Wt.inAsync.get=function(){return(this.currentVarScope().flags&sw)>0&&!this.currentVarScope().inClassFieldInit};Wt.canAwait.get=function(){for(var t=this.scopeStack.length-1;t>=0;t--){var e=this.scopeStack[t];if(e.inClassFieldInit||e.flags&Zh)return!1;if(e.flags&Gs)return(e.flags&sw)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction};Wt.allowSuper.get=function(){var t=this.currentThisScope(),e=t.flags,i=t.inClassFieldInit;return(e&ow)>0||i||this.options.allowSuperOutsideMethod};Wt.allowDirectSuper.get=function(){return(this.currentThisScope().flags&kE)>0};Wt.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())};Wt.allowNewDotTarget.get=function(){var t=this.currentThisScope(),e=t.flags,i=t.inClassFieldInit;return(e&(Gs|Zh))>0||i};Wt.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&Zh)>0};me.extend=r(function(){for(var e=[],i=arguments.length;i--;)e[i]=arguments[i];for(var s=this,o=0;o=,?^&]/.test(o)||o==="!"&&this.input.charAt(s+1)==="=")}t+=e[0].length,ot.lastIndex=t,t+=ot.exec(this.input)[0].length,this.input[t]===";"&&t++}};Be.eat=function(t){return this.type===t?(this.next(),!0):!1};Be.isContextual=function(t){return this.type===h.name&&this.value===t&&!this.containsEsc};Be.eatContextual=function(t){return this.isContextual(t)?(this.next(),!0):!1};Be.expectContextual=function(t){this.eatContextual(t)||this.unexpected()};Be.canInsertSemicolon=function(){return this.type===h.eof||this.type===h.braceR||at.test(this.input.slice(this.lastTokEnd,this.start))};Be.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0};Be.semicolon=function(){!this.eat(h.semi)&&!this.insertSemicolon()&&this.unexpected()};Be.afterTrailingComma=function(t,e){if(this.type===t)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),e||this.next(),!0};Be.expect=function(t){this.eat(t)||this.unexpected()};Be.unexpected=function(t){this.raise(t!=null?t:this.start,"Unexpected token")};var Nb=r(function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1},"DestructuringErrors");Be.checkPatternErrors=function(t,e){if(!!t){t.trailingComma>-1&&this.raiseRecoverable(t.trailingComma,"Comma is not permitted after the rest element");var i=e?t.parenthesizedAssign:t.parenthesizedBind;i>-1&&this.raiseRecoverable(i,e?"Assigning to rvalue":"Parenthesized pattern")}};Be.checkExpressionErrors=function(t,e){if(!t)return!1;var i=t.shorthandAssign,s=t.doubleProto;if(!e)return i>=0||s>=0;i>=0&&this.raise(i,"Shorthand property assignments are valid only in destructuring patterns"),s>=0&&this.raiseRecoverable(s,"Redefinition of __proto__ property")};Be.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos55295&&s<56320)return!0;if(ai(s,!0)){for(var o=i+1;Fs(s=this.input.charCodeAt(o),!0);)++o;if(s===92||s>55295&&s<56320)return!0;var a=this.input.slice(i,o);if(!O1.test(a))return!0}return!1};A.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;ot.lastIndex=this.pos;var t=ot.exec(this.input),e=this.pos+t[0].length,i;return!at.test(this.input.slice(this.pos,e))&&this.input.slice(e,e+8)==="function"&&(e+8===this.input.length||!(Fs(i=this.input.charCodeAt(e+8))||i>55295&&i<56320))};A.parseStatement=function(t,e,i){var s=this.type,o=this.startNode(),a;switch(this.isLet(t)&&(s=h._var,a="let"),s){case h._break:case h._continue:return this.parseBreakContinueStatement(o,s.keyword);case h._debugger:return this.parseDebuggerStatement(o);case h._do:return this.parseDoStatement(o);case h._for:return this.parseForStatement(o);case h._function:return t&&(this.strict||t!=="if"&&t!=="label")&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(o,!1,!t);case h._class:return t&&this.unexpected(),this.parseClass(o,!0);case h._if:return this.parseIfStatement(o);case h._return:return this.parseReturnStatement(o);case h._switch:return this.parseSwitchStatement(o);case h._throw:return this.parseThrowStatement(o);case h._try:return this.parseTryStatement(o);case h._const:case h._var:return a=a||this.value,t&&a!=="var"&&this.unexpected(),this.parseVarStatement(o,a);case h._while:return this.parseWhileStatement(o);case h._with:return this.parseWithStatement(o);case h.braceL:return this.parseBlock(!0,o);case h.semi:return this.parseEmptyStatement(o);case h._export:case h._import:if(this.options.ecmaVersion>10&&s===h._import){ot.lastIndex=this.pos;var l=ot.exec(this.input),f=this.pos+l[0].length,m=this.input.charCodeAt(f);if(m===40||m===46)return this.parseExpressionStatement(o,this.parseExpression())}return this.options.allowImportExportEverywhere||(e||this.raise(this.start,"'import' and 'export' may only appear at the top level"),this.inModule||this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")),s===h._import?this.parseImport(o):this.parseExport(o,i);default:if(this.isAsyncFunction())return t&&this.unexpected(),this.next(),this.parseFunctionStatement(o,!0,!t);var x=this.value,_=this.parseExpression();return s===h.name&&_.type==="Identifier"&&this.eat(h.colon)?this.parseLabeledStatement(o,x,_,t):this.parseExpressionStatement(o,_)}};A.parseBreakContinueStatement=function(t,e){var i=e==="break";this.next(),this.eat(h.semi)||this.insertSemicolon()?t.label=null:this.type!==h.name?this.unexpected():(t.label=this.parseIdent(),this.semicolon());for(var s=0;s=6?this.eat(h.semi):this.semicolon(),this.finishNode(t,"DoWhileStatement")};A.parseForStatement=function(t){this.next();var e=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(cw),this.enterScope(0),this.expect(h.parenL),this.type===h.semi)return e>-1&&this.unexpected(e),this.parseFor(t,null);var i=this.isLet();if(this.type===h._var||this.type===h._const||i){var s=this.startNode(),o=i?"let":this.value;return this.next(),this.parseVar(s,!0,o),this.finishNode(s,"VariableDeclaration"),(this.type===h._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&s.declarations.length===1?(this.options.ecmaVersion>=9&&(this.type===h._in?e>-1&&this.unexpected(e):t.await=e>-1),this.parseForIn(t,s)):(e>-1&&this.unexpected(e),this.parseFor(t,s))}var a=this.isContextual("let"),l=!1,f=this.containsEsc,m=new Nb,x=this.start,_=e>-1?this.parseExprSubscripts(m,"await"):this.parseExpression(!0,m);return this.type===h._in||(l=this.options.ecmaVersion>=6&&this.isContextual("of"))?(e>-1?(this.type===h._in&&this.unexpected(e),t.await=!0):l&&this.options.ecmaVersion>=8&&(_.start===x&&!f&&_.type==="Identifier"&&_.name==="async"?this.unexpected():this.options.ecmaVersion>=9&&(t.await=!1)),a&&l&&this.raise(_.start,"The left-hand side of a for-of loop may not start with 'let'."),this.toAssignable(_,!1,m),this.checkLValPattern(_),this.parseForIn(t,_)):(this.checkExpressionErrors(m,!0),e>-1&&this.unexpected(e),this.parseFor(t,_))};A.parseFunctionStatement=function(t,e,i){return this.next(),this.parseFunction(t,zh|(i?0:tw),!1,e)};A.parseIfStatement=function(t){return this.next(),t.test=this.parseParenExpression(),t.consequent=this.parseStatement("if"),t.alternate=this.eat(h._else)?this.parseStatement("if"):null,this.finishNode(t,"IfStatement")};A.parseReturnStatement=function(t){return!this.inFunction&&!this.options.allowReturnOutsideFunction&&this.raise(this.start,"'return' outside of function"),this.next(),this.eat(h.semi)||this.insertSemicolon()?t.argument=null:(t.argument=this.parseExpression(),this.semicolon()),this.finishNode(t,"ReturnStatement")};A.parseSwitchStatement=function(t){this.next(),t.discriminant=this.parseParenExpression(),t.cases=[],this.expect(h.braceL),this.labels.push(H1),this.enterScope(0);for(var e,i=!1;this.type!==h.braceR;)if(this.type===h._case||this.type===h._default){var s=this.type===h._case;e&&this.finishNode(e,"SwitchCase"),t.cases.push(e=this.startNode()),e.consequent=[],this.next(),s?e.test=this.parseExpression():(i&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),i=!0,e.test=null),this.expect(h.colon)}else e||this.unexpected(),e.consequent.push(this.parseStatement(null));return this.exitScope(),e&&this.finishNode(e,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(t,"SwitchStatement")};A.parseThrowStatement=function(t){return this.next(),at.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw"),t.argument=this.parseExpression(),this.semicolon(),this.finishNode(t,"ThrowStatement")};var $1=[];A.parseCatchClauseParam=function(){var t=this.parseBindingAtom(),e=t.type==="Identifier";return this.enterScope(e?EE:0),this.checkLValPattern(t,e?PE:ci),this.expect(h.parenR),t};A.parseTryStatement=function(t){if(this.next(),t.block=this.parseBlock(),t.handler=null,this.type===h._catch){var e=this.startNode();this.next(),this.eat(h.parenL)?e.param=this.parseCatchClauseParam():(this.options.ecmaVersion<10&&this.unexpected(),e.param=null,this.enterScope(0)),e.body=this.parseBlock(!1),this.exitScope(),t.handler=this.finishNode(e,"CatchClause")}return t.finalizer=this.eat(h._finally)?this.parseBlock():null,!t.handler&&!t.finalizer&&this.raise(t.start,"Missing catch or finally clause"),this.finishNode(t,"TryStatement")};A.parseVarStatement=function(t,e,i){return this.next(),this.parseVar(t,!1,e,i),this.semicolon(),this.finishNode(t,"VariableDeclaration")};A.parseWhileStatement=function(t){return this.next(),t.test=this.parseParenExpression(),this.labels.push(cw),t.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(t,"WhileStatement")};A.parseWithStatement=function(t){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),t.object=this.parseParenExpression(),t.body=this.parseStatement("with"),this.finishNode(t,"WithStatement")};A.parseEmptyStatement=function(t){return this.next(),this.finishNode(t,"EmptyStatement")};A.parseLabeledStatement=function(t,e,i,s){for(var o=0,a=this.labels;o=0;m--){var x=this.labels[m];if(x.statementStart===t.start)x.statementStart=this.start,x.kind=f;else break}return this.labels.push({name:e,kind:f,statementStart:this.start}),t.body=this.parseStatement(s?s.indexOf("label")===-1?s+"label":s:"label"),this.labels.pop(),t.label=i,this.finishNode(t,"LabeledStatement")};A.parseExpressionStatement=function(t,e){return t.expression=e,this.semicolon(),this.finishNode(t,"ExpressionStatement")};A.parseBlock=function(t,e,i){for(t===void 0&&(t=!0),e===void 0&&(e=this.startNode()),e.body=[],this.expect(h.braceL),t&&this.enterScope(0);this.type!==h.braceR;){var s=this.parseStatement(null);e.body.push(s)}return i&&(this.strict=!1),this.next(),t&&this.exitScope(),this.finishNode(e,"BlockStatement")};A.parseFor=function(t,e){return t.init=e,this.expect(h.semi),t.test=this.type===h.semi?null:this.parseExpression(),this.expect(h.semi),t.update=this.type===h.parenR?null:this.parseExpression(),this.expect(h.parenR),t.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(t,"ForStatement")};A.parseForIn=function(t,e){var i=this.type===h._in;return this.next(),e.type==="VariableDeclaration"&&e.declarations[0].init!=null&&(!i||this.options.ecmaVersion<8||this.strict||e.kind!=="var"||e.declarations[0].id.type!=="Identifier")&&this.raise(e.start,(i?"for-in":"for-of")+" loop variable declaration may not have an initializer"),t.left=e,t.right=i?this.parseExpression():this.parseMaybeAssign(),this.expect(h.parenR),t.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(t,i?"ForInStatement":"ForOfStatement")};A.parseVar=function(t,e,i,s){for(t.declarations=[],t.kind=i;;){var o=this.startNode();if(this.parseVarId(o,i),this.eat(h.eq)?o.init=this.parseMaybeAssign(e):!s&&i==="const"&&!(this.type===h._in||this.options.ecmaVersion>=6&&this.isContextual("of"))?this.unexpected():!s&&o.id.type!=="Identifier"&&!(e&&(this.type===h._in||this.isContextual("of")))?this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):o.init=null,t.declarations.push(this.finishNode(o,"VariableDeclarator")),!this.eat(h.comma))break}return t};A.parseVarId=function(t,e){t.id=this.parseBindingAtom(),this.checkLValPattern(t.id,e==="var"?pw:ci,!1)};var zh=1,tw=2,AE=4;A.parseFunction=function(t,e,i,s,o){this.initFunction(t),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!s)&&(this.type===h.star&&e&tw&&this.unexpected(),t.generator=this.eat(h.star)),this.options.ecmaVersion>=8&&(t.async=!!s),e&zh&&(t.id=e&AE&&this.type!==h.name?null:this.parseIdent(),t.id&&!(e&tw)&&this.checkLValSimple(t.id,this.strict||t.generator||t.async?this.treatFunctionsAsVar?pw:ci:CE));var a=this.yieldPos,l=this.awaitPos,f=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(aw(t.async,t.generator)),e&zh||(t.id=this.type===h.name?this.parseIdent():null),this.parseFunctionParams(t),this.parseFunctionBody(t,i,!1,o),this.yieldPos=a,this.awaitPos=l,this.awaitIdentPos=f,this.finishNode(t,e&zh?"FunctionDeclaration":"FunctionExpression")};A.parseFunctionParams=function(t){this.expect(h.parenL),t.params=this.parseBindingList(h.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()};A.parseClass=function(t,e){this.next();var i=this.strict;this.strict=!0,this.parseClassId(t,e),this.parseClassSuper(t);var s=this.enterClassBody(),o=this.startNode(),a=!1;for(o.body=[],this.expect(h.braceL);this.type!==h.braceR;){var l=this.parseClassElement(t.superClass!==null);l&&(o.body.push(l),l.type==="MethodDefinition"&&l.kind==="constructor"?(a&&this.raiseRecoverable(l.start,"Duplicate constructor in the same class"),a=!0):l.key&&l.key.type==="PrivateIdentifier"&&K1(s,l)&&this.raiseRecoverable(l.key.start,"Identifier '#"+l.key.name+"' has already been declared"))}return this.strict=i,this.next(),t.body=this.finishNode(o,"ClassBody"),this.exitClassBody(),this.finishNode(t,e?"ClassDeclaration":"ClassExpression")};A.parseClassElement=function(t){if(this.eat(h.semi))return null;var e=this.options.ecmaVersion,i=this.startNode(),s="",o=!1,a=!1,l="method",f=!1;if(this.eatContextual("static")){if(e>=13&&this.eat(h.braceL))return this.parseClassStaticBlock(i),i;this.isClassElementNameStart()||this.type===h.star?f=!0:s="static"}if(i.static=f,!s&&e>=8&&this.eatContextual("async")&&((this.isClassElementNameStart()||this.type===h.star)&&!this.canInsertSemicolon()?a=!0:s="async"),!s&&(e>=9||!a)&&this.eat(h.star)&&(o=!0),!s&&!a&&!o){var m=this.value;(this.eatContextual("get")||this.eatContextual("set"))&&(this.isClassElementNameStart()?l=m:s=m)}if(s?(i.computed=!1,i.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),i.key.name=s,this.finishNode(i.key,"Identifier")):this.parseClassElementName(i),e<13||this.type===h.parenL||l!=="method"||o||a){var x=!i.static&&Eb(i,"constructor"),_=x&&t;x&&l!=="method"&&this.raise(i.key.start,"Constructor can't have get/set modifier"),i.kind=x?"constructor":l,this.parseClassMethod(i,o,a,_)}else this.parseClassField(i);return i};A.isClassElementNameStart=function(){return this.type===h.name||this.type===h.privateId||this.type===h.num||this.type===h.string||this.type===h.bracketL||this.type.keyword};A.parseClassElementName=function(t){this.type===h.privateId?(this.value==="constructor"&&this.raise(this.start,"Classes can't have an element named '#constructor'"),t.computed=!1,t.key=this.parsePrivateIdent()):this.parsePropertyName(t)};A.parseClassMethod=function(t,e,i,s){var o=t.key;t.kind==="constructor"?(e&&this.raise(o.start,"Constructor can't be a generator"),i&&this.raise(o.start,"Constructor can't be an async method")):t.static&&Eb(t,"prototype")&&this.raise(o.start,"Classes may not have a static property named prototype");var a=t.value=this.parseMethod(e,i,s);return t.kind==="get"&&a.params.length!==0&&this.raiseRecoverable(a.start,"getter should have no params"),t.kind==="set"&&a.params.length!==1&&this.raiseRecoverable(a.start,"setter should have exactly one param"),t.kind==="set"&&a.params[0].type==="RestElement"&&this.raiseRecoverable(a.params[0].start,"Setter cannot use rest params"),this.finishNode(t,"MethodDefinition")};A.parseClassField=function(t){if(Eb(t,"constructor")?this.raise(t.key.start,"Classes can't have a field named 'constructor'"):t.static&&Eb(t,"prototype")&&this.raise(t.key.start,"Classes can't have a static field named 'prototype'"),this.eat(h.eq)){var e=this.currentThisScope(),i=e.inClassFieldInit;e.inClassFieldInit=!0,t.value=this.parseMaybeAssign(),e.inClassFieldInit=i}else t.value=null;return this.semicolon(),this.finishNode(t,"PropertyDefinition")};A.parseClassStaticBlock=function(t){t.body=[];var e=this.labels;for(this.labels=[],this.enterScope(Zh|ow);this.type!==h.braceR;){var i=this.parseStatement(null);t.body.push(i)}return this.next(),this.exitScope(),this.labels=e,this.finishNode(t,"StaticBlock")};A.parseClassId=function(t,e){this.type===h.name?(t.id=this.parseIdent(),e&&this.checkLValSimple(t.id,ci,!1)):(e===!0&&this.unexpected(),t.id=null)};A.parseClassSuper=function(t){t.superClass=this.eat(h._extends)?this.parseExprSubscripts(null,!1):null};A.enterClassBody=function(){var t={declared:Object.create(null),used:[]};return this.privateNameStack.push(t),t.declared};A.exitClassBody=function(){var t=this.privateNameStack.pop(),e=t.declared,i=t.used;if(!!this.options.checkPrivateFields)for(var s=this.privateNameStack.length,o=s===0?null:this.privateNameStack[s-1],a=0;a=11&&(this.eatContextual("as")?(t.exported=this.parseModuleExportName(),this.checkExport(e,t.exported,this.lastTokStart)):t.exported=null),this.expectContextual("from"),this.type!==h.string&&this.unexpected(),t.source=this.parseExprAtom(),this.semicolon(),this.finishNode(t,"ExportAllDeclaration")};A.parseExport=function(t,e){if(this.next(),this.eat(h.star))return this.parseExportAllDeclaration(t,e);if(this.eat(h._default))return this.checkExport(e,"default",this.lastTokStart),t.declaration=this.parseExportDefaultDeclaration(),this.finishNode(t,"ExportDefaultDeclaration");if(this.shouldParseExportStatement())t.declaration=this.parseExportDeclaration(t),t.declaration.type==="VariableDeclaration"?this.checkVariableExport(e,t.declaration.declarations):this.checkExport(e,t.declaration.id,t.declaration.id.start),t.specifiers=[],t.source=null;else{if(t.declaration=null,t.specifiers=this.parseExportSpecifiers(e),this.eatContextual("from"))this.type!==h.string&&this.unexpected(),t.source=this.parseExprAtom();else{for(var i=0,s=t.specifiers;i=13&&this.type===h.string){var t=this.parseLiteral(this.value);return F1.test(t.value)&&this.raise(t.start,"An export name cannot include a lone surrogate."),t}return this.parseIdent(!0)};A.adaptDirectivePrologue=function(t){for(var e=0;e=5&&t.type==="ExpressionStatement"&&t.expression.type==="Literal"&&typeof t.expression.value=="string"&&(this.input[t.start]==='"'||this.input[t.start]==="'")};var pt=me.prototype;pt.toAssignable=function(t,e,i){if(this.options.ecmaVersion>=6&&t)switch(t.type){case"Identifier":this.inAsync&&t.name==="await"&&this.raise(t.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":t.type="ObjectPattern",i&&this.checkPatternErrors(i,!0);for(var s=0,o=t.properties;s=8&&!f&&m.name==="async"&&!this.canInsertSemicolon()&&this.eat(h._function))return this.overrideContext(ie.f_expr),this.parseFunction(this.startNodeAt(a,l),0,!1,!0,e);if(o&&!this.canInsertSemicolon()){if(this.eat(h.arrow))return this.parseArrowExpression(this.startNodeAt(a,l),[m],!1,e);if(this.options.ecmaVersion>=8&&m.name==="async"&&this.type===h.name&&!f&&(!this.potentialArrowInForAwait||this.value!=="of"||this.containsEsc))return m=this.parseIdent(!1),(this.canInsertSemicolon()||!this.eat(h.arrow))&&this.unexpected(),this.parseArrowExpression(this.startNodeAt(a,l),[m],!0,e)}return m;case h.regexp:var x=this.value;return s=this.parseLiteral(x.value),s.regex={pattern:x.pattern,flags:x.flags},s;case h.num:case h.string:return this.parseLiteral(this.value);case h._null:case h._true:case h._false:return s=this.startNode(),s.value=this.type===h._null?null:this.type===h._true,s.raw=this.type.keyword,this.next(),this.finishNode(s,"Literal");case h.parenL:var _=this.start,b=this.parseParenAndDistinguishExpression(o,e);return t&&(t.parenthesizedAssign<0&&!this.isSimpleAssignTarget(b)&&(t.parenthesizedAssign=_),t.parenthesizedBind<0&&(t.parenthesizedBind=_)),b;case h.bracketL:return s=this.startNode(),this.next(),s.elements=this.parseExprList(h.bracketR,!0,!0,t),this.finishNode(s,"ArrayExpression");case h.braceL:return this.overrideContext(ie.b_expr),this.parseObj(!1,t);case h._function:return s=this.startNode(),this.next(),this.parseFunction(s,0);case h._class:return this.parseClass(this.startNode(),!1);case h._new:return this.parseNew();case h.backQuote:return this.parseTemplate();case h._import:return this.options.ecmaVersion>=11?this.parseExprImport(i):this.unexpected();default:return this.parseExprAtomDefault()}};D.parseExprAtomDefault=function(){this.unexpected()};D.parseExprImport=function(t){var e=this.startNode();if(this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword import"),this.next(),this.type===h.parenL&&!t)return this.parseDynamicImport(e);if(this.type===h.dot){var i=this.startNodeAt(e.start,e.loc&&e.loc.start);return i.name="import",e.meta=this.finishNode(i,"Identifier"),this.parseImportMeta(e)}else this.unexpected()};D.parseDynamicImport=function(t){if(this.next(),t.source=this.parseMaybeAssign(),!this.eat(h.parenR)){var e=this.start;this.eat(h.comma)&&this.eat(h.parenR)?this.raiseRecoverable(e,"Trailing comma is not allowed in import()"):this.unexpected(e)}return this.finishNode(t,"ImportExpression")};D.parseImportMeta=function(t){this.next();var e=this.containsEsc;return t.property=this.parseIdent(!0),t.property.name!=="meta"&&this.raiseRecoverable(t.property.start,"The only valid meta property for import is 'import.meta'"),e&&this.raiseRecoverable(t.start,"'import.meta' must not contain escaped characters"),this.options.sourceType!=="module"&&!this.options.allowImportExportEverywhere&&this.raiseRecoverable(t.start,"Cannot use 'import.meta' outside a module"),this.finishNode(t,"MetaProperty")};D.parseLiteral=function(t){var e=this.startNode();return e.value=t,e.raw=this.input.slice(this.start,this.end),e.raw.charCodeAt(e.raw.length-1)===110&&(e.bigint=e.raw.slice(0,-1).replace(/_/g,"")),this.next(),this.finishNode(e,"Literal")};D.parseParenExpression=function(){this.expect(h.parenL);var t=this.parseExpression();return this.expect(h.parenR),t};D.shouldParseArrow=function(t){return!this.canInsertSemicolon()};D.parseParenAndDistinguishExpression=function(t,e){var i=this.start,s=this.startLoc,o,a=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var l=this.start,f=this.startLoc,m=[],x=!0,_=!1,b=new Nb,T=this.yieldPos,w=this.awaitPos,S;for(this.yieldPos=0,this.awaitPos=0;this.type!==h.parenR;)if(x?x=!1:this.expect(h.comma),a&&this.afterTrailingComma(h.parenR,!0)){_=!0;break}else if(this.type===h.ellipsis){S=this.start,m.push(this.parseParenItem(this.parseRestBinding())),this.type===h.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");break}else m.push(this.parseMaybeAssign(!1,b,this.parseParenItem));var E=this.lastTokEnd,C=this.lastTokEndLoc;if(this.expect(h.parenR),t&&this.shouldParseArrow(m)&&this.eat(h.arrow))return this.checkPatternErrors(b,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=T,this.awaitPos=w,this.parseParenArrowList(i,s,m,e);(!m.length||_)&&this.unexpected(this.lastTokStart),S&&this.unexpected(S),this.checkExpressionErrors(b,!0),this.yieldPos=T||this.yieldPos,this.awaitPos=w||this.awaitPos,m.length>1?(o=this.startNodeAt(l,f),o.expressions=m,this.finishNodeAt(o,"SequenceExpression",E,C)):o=m[0]}else o=this.parseParenExpression();if(this.options.preserveParens){var k=this.startNodeAt(i,s);return k.expression=o,this.finishNode(k,"ParenthesizedExpression")}else return o};D.parseParenItem=function(t){return t};D.parseParenArrowList=function(t,e,i,s){return this.parseArrowExpression(this.startNodeAt(t,e),i,!1,s)};var q1=[];D.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword new");var t=this.startNode();if(this.next(),this.options.ecmaVersion>=6&&this.type===h.dot){var e=this.startNodeAt(t.start,t.loc&&t.loc.start);e.name="new",t.meta=this.finishNode(e,"Identifier"),this.next();var i=this.containsEsc;return t.property=this.parseIdent(!0),t.property.name!=="target"&&this.raiseRecoverable(t.property.start,"The only valid meta property for new is 'new.target'"),i&&this.raiseRecoverable(t.start,"'new.target' must not contain escaped characters"),this.allowNewDotTarget||this.raiseRecoverable(t.start,"'new.target' can only be used in functions and class static block"),this.finishNode(t,"MetaProperty")}var s=this.start,o=this.startLoc;return t.callee=this.parseSubscripts(this.parseExprAtom(null,!1,!0),s,o,!0,!1),this.eat(h.parenL)?t.arguments=this.parseExprList(h.parenR,this.options.ecmaVersion>=8,!1):t.arguments=q1,this.finishNode(t,"NewExpression")};D.parseTemplateElement=function(t){var e=t.isTagged,i=this.startNode();return this.type===h.invalidTemplate?(e||this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal"),i.value={raw:this.value.replace(/\r\n?/g,` `),cooked:null}):i.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,` -`),cooked:this.value},this.next(),i.tail=this.type===h.backQuote,this.finishNode(i,"TemplateElement")};z.parseTemplate=function(t){t===void 0&&(t={});var e=t.isTagged;e===void 0&&(e=!1);var i=this.startNode();this.next(),i.expressions=[];var n=this.parseTemplateElement({isTagged:e});for(i.quasis=[n];!n.tail;)this.type===h.eof&&this.raise(this.pos,"Unterminated template literal"),this.expect(h.dollarBraceL),i.expressions.push(this.parseExpression()),this.expect(h.braceR),i.quasis.push(n=this.parseTemplateElement({isTagged:e}));return this.next(),this.finishNode(i,"TemplateLiteral")};z.isAsyncProp=function(t){return!t.computed&&t.key.type==="Identifier"&&t.key.name==="async"&&(this.type===h.name||this.type===h.num||this.type===h.string||this.type===h.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===h.star)&&!dt.test(this.input.slice(this.lastTokEnd,this.start))};z.parseObj=function(t,e){var i=this.startNode(),n=!0,r={};for(i.properties=[],this.next();!this.eat(h.braceR);){if(n)n=!1;else if(this.expect(h.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(h.braceR))break;var a=this.parseProperty(t,e);t||this.checkPropClash(a,r,e),i.properties.push(a)}return this.finishNode(i,t?"ObjectPattern":"ObjectExpression")};z.parseProperty=function(t,e){var i=this.startNode(),n,r,a,c;if(this.options.ecmaVersion>=9&&this.eat(h.ellipsis))return t?(i.argument=this.parseIdent(!1),this.type===h.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.finishNode(i,"RestElement")):(i.argument=this.parseMaybeAssign(!1,e),this.type===h.comma&&e&&e.trailingComma<0&&(e.trailingComma=this.start),this.finishNode(i,"SpreadElement"));this.options.ecmaVersion>=6&&(i.method=!1,i.shorthand=!1,(t||e)&&(a=this.start,c=this.startLoc),t||(n=this.eat(h.star)));var p=this.containsEsc;return this.parsePropertyName(i),!t&&!p&&this.options.ecmaVersion>=8&&!n&&this.isAsyncProp(i)?(r=!0,n=this.options.ecmaVersion>=9&&this.eat(h.star),this.parsePropertyName(i)):r=!1,this.parsePropertyValue(i,t,n,r,a,c,e,p),this.finishNode(i,"Property")};z.parseGetterSetter=function(t){t.kind=t.key.name,this.parsePropertyName(t),t.value=this.parseMethod(!1);var e=t.kind==="get"?0:1;if(t.value.params.length!==e){var i=t.value.start;t.kind==="get"?this.raiseRecoverable(i,"getter should have no params"):this.raiseRecoverable(i,"setter should have exactly one param")}else t.kind==="set"&&t.value.params[0].type==="RestElement"&&this.raiseRecoverable(t.value.params[0].start,"Setter cannot use rest params")};z.parsePropertyValue=function(t,e,i,n,r,a,c,p){(i||n)&&this.type===h.colon&&this.unexpected(),this.eat(h.colon)?(t.value=e?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,c),t.kind="init"):this.options.ecmaVersion>=6&&this.type===h.parenL?(e&&this.unexpected(),t.kind="init",t.method=!0,t.value=this.parseMethod(i,n)):!e&&!p&&this.options.ecmaVersion>=5&&!t.computed&&t.key.type==="Identifier"&&(t.key.name==="get"||t.key.name==="set")&&this.type!==h.comma&&this.type!==h.braceR&&this.type!==h.eq?((i||n)&&this.unexpected(),this.parseGetterSetter(t)):this.options.ecmaVersion>=6&&!t.computed&&t.key.type==="Identifier"?((i||n)&&this.unexpected(),this.checkUnreserved(t.key),t.key.name==="await"&&!this.awaitIdentPos&&(this.awaitIdentPos=r),t.kind="init",e?t.value=this.parseMaybeDefault(r,a,this.copyNode(t.key)):this.type===h.eq&&c?(c.shorthandAssign<0&&(c.shorthandAssign=this.start),t.value=this.parseMaybeDefault(r,a,this.copyNode(t.key))):t.value=this.copyNode(t.key),t.shorthand=!0):this.unexpected()};z.parsePropertyName=function(t){if(this.options.ecmaVersion>=6){if(this.eat(h.bracketL))return t.computed=!0,t.key=this.parseMaybeAssign(),this.expect(h.bracketR),t.key;t.computed=!1}return t.key=this.type===h.num||this.type===h.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never")};z.initFunction=function(t){t.id=null,this.options.ecmaVersion>=6&&(t.generator=t.expression=!1),this.options.ecmaVersion>=8&&(t.async=!1)};z.parseMethod=function(t,e,i){var n=this.startNode(),r=this.yieldPos,a=this.awaitPos,c=this.awaitIdentPos;return this.initFunction(n),this.options.ecmaVersion>=6&&(n.generator=t),this.options.ecmaVersion>=8&&(n.async=!!e),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(u0(e,n.generator)|s0|(i?c1:0)),this.expect(h.parenL),n.params=this.parseBindingList(h.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(n,!1,!0,!1),this.yieldPos=r,this.awaitPos=a,this.awaitIdentPos=c,this.finishNode(n,"FunctionExpression")};z.parseArrowExpression=function(t,e,i,n){var r=this.yieldPos,a=this.awaitPos,c=this.awaitIdentPos;return this.enterScope(u0(i,!1)|u1),this.initFunction(t),this.options.ecmaVersion>=8&&(t.async=!!i),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,t.params=this.toAssignableList(e,!0),this.parseFunctionBody(t,!0,!1,n),this.yieldPos=r,this.awaitPos=a,this.awaitIdentPos=c,this.finishNode(t,"ArrowFunctionExpression")};z.parseFunctionBody=function(t,e,i,n){var r=e&&this.type!==h.braceL,a=this.strict,c=!1;if(r)t.body=this.parseMaybeAssign(n),t.expression=!0,this.checkParams(t,!1);else{var p=this.options.ecmaVersion>=7&&!this.isSimpleParamList(t.params);(!a||p)&&(c=this.strictDirective(this.end),c&&p&&this.raiseRecoverable(t.start,"Illegal 'use strict' directive in function with non-simple parameter list"));var d=this.labels;this.labels=[],c&&(this.strict=!0),this.checkParams(t,!a&&!c&&!e&&!i&&this.isSimpleParamList(t.params)),this.strict&&t.id&&this.checkLValSimple(t.id,f1),t.body=this.parseBlock(!1,void 0,c&&!a),t.expression=!1,this.adaptDirectivePrologue(t.body.body),this.labels=d}this.exitScope()};z.isSimpleParamList=function(t){for(var e=0,i=t;e-1||r.functions.indexOf(t)>-1||r.var.indexOf(t)>-1,r.lexical.push(t),this.inModule&&r.flags&Af&&delete this.undefinedExports[t]}else if(e===d1){var a=this.currentScope();a.lexical.push(t)}else if(e===p1){var c=this.currentScope();this.treatFunctionsAsVar?n=c.lexical.indexOf(t)>-1:n=c.lexical.indexOf(t)>-1||c.var.indexOf(t)>-1,c.functions.push(t)}else for(var p=this.scopeStack.length-1;p>=0;--p){var d=this.scopeStack[p];if(d.lexical.indexOf(t)>-1&&!(d.flags&l1&&d.lexical[0]===t)||!this.treatFunctionsAsVarInScope(d)&&d.functions.indexOf(t)>-1){n=!0;break}if(d.var.push(t),this.inModule&&d.flags&Af&&delete this.undefinedExports[t],d.flags&a0)break}n&&this.raiseRecoverable(i,"Identifier '"+t+"' has already been declared")};Oi.checkLocalExport=function(t){this.scopeStack[0].lexical.indexOf(t.name)===-1&&this.scopeStack[0].var.indexOf(t.name)===-1&&(this.undefinedExports[t.name]=t)};Oi.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]};Oi.currentVarScope=function(){for(var t=this.scopeStack.length-1;;t--){var e=this.scopeStack[t];if(e.flags&a0)return e}};Oi.currentThisScope=function(){for(var t=this.scopeStack.length-1;;t--){var e=this.scopeStack[t];if(e.flags&a0&&!(e.flags&u1))return e}};var Xg=o(function(e,i,n){this.type="",this.start=i,this.end=0,e.options.locations&&(this.loc=new Kg(e,n)),e.options.directSourceFile&&(this.sourceFile=e.options.directSourceFile),e.options.ranges&&(this.range=[i,0])},"Node"),Df=we.prototype;Df.startNode=function(){return new Xg(this,this.start,this.startLoc)};Df.startNodeAt=function(t,e){return new Xg(this,t,e)};function _1(t,e,i,n){return t.type=e,t.end=i,this.options.locations&&(t.loc.end=n),this.options.ranges&&(t.range[1]=i),t}o(_1,"finishNodeAt");Df.finishNode=function(t,e){return _1.call(this,t,e,this.lastTokEnd,this.lastTokEndLoc)};Df.finishNodeAt=function(t,e,i,n){return _1.call(this,t,e,i,n)};Df.copyNode=function(t){var e=new Xg(this,t.start,this.startLoc);for(var i in t)e[i]=t[i];return e};var g1="ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS",x1=g1+" Extended_Pictographic",v1=x1,y1=v1+" EBase EComp EMod EPres ExtPict",b1=y1,Bk=b1,Lk={9:g1,10:x1,11:v1,12:y1,13:b1,14:Bk},Ok="Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji",Fk={9:"",10:"",11:"",12:"",13:"",14:Ok},ZT="Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu",w1="Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb",T1=w1+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",I1=T1+" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho",k1=I1+" Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi",S1=k1+" Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith",Yk=S1+" Hrkt Katakana_Or_Hiragana Kawi Nag_Mundari Nagm Unknown Zzzz",Uk={9:w1,10:T1,11:I1,12:k1,13:S1,14:Yk},C1={};function jk(t){var e=C1[t]={binary:Bi(Lk[t]+" "+ZT),binaryOfStrings:Bi(Fk[t]),nonBinary:{General_Category:Bi(ZT),Script:Bi(Uk[t])}};e.nonBinary.Script_Extensions=e.nonBinary.Script,e.nonBinary.gc=e.nonBinary.General_Category,e.nonBinary.sc=e.nonBinary.Script,e.nonBinary.scx=e.nonBinary.Script_Extensions}o(jk,"buildUnicodeData");for(Jg=0,Zx=[9,10,11,12,13,14];Jg=6?"uy":"")+(e.options.ecmaVersion>=9?"s":"")+(e.options.ecmaVersion>=13?"d":"")+(e.options.ecmaVersion>=15?"v":""),this.unicodeProperties=C1[e.options.ecmaVersion>=14?14:e.options.ecmaVersion],this.source="",this.flags="",this.start=0,this.switchU=!1,this.switchV=!1,this.switchN=!1,this.pos=0,this.lastIntValue=0,this.lastStringValue="",this.lastAssertionIsQuantifiable=!1,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=Object.create(null),this.backReferenceNames=[],this.branchID=null},"RegExpValidationState");Ft.prototype.reset=o(function(e,i,n){var r=n.indexOf("v")!==-1,a=n.indexOf("u")!==-1;this.start=e|0,this.source=i+"",this.flags=n,r&&this.parser.options.ecmaVersion>=15?(this.switchU=!0,this.switchV=!0,this.switchN=!0):(this.switchU=a&&this.parser.options.ecmaVersion>=6,this.switchV=!1,this.switchN=a&&this.parser.options.ecmaVersion>=9)},"reset");Ft.prototype.raise=o(function(e){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+e)},"raise");Ft.prototype.at=o(function(e,i){i===void 0&&(i=!1);var n=this.source,r=n.length;if(e>=r)return-1;var a=n.charCodeAt(e);if(!(i||this.switchU)||a<=55295||a>=57344||e+1>=r)return a;var c=n.charCodeAt(e+1);return c>=56320&&c<=57343?(a<<10)+c-56613888:a},"at");Ft.prototype.nextIndex=o(function(e,i){i===void 0&&(i=!1);var n=this.source,r=n.length;if(e>=r)return r;var a=n.charCodeAt(e),c;return!(i||this.switchU)||a<=55295||a>=57344||e+1>=r||(c=n.charCodeAt(e+1))<56320||c>57343?e+1:e+2},"nextIndex");Ft.prototype.current=o(function(e){return e===void 0&&(e=!1),this.at(this.pos,e)},"current");Ft.prototype.lookahead=o(function(e){return e===void 0&&(e=!1),this.at(this.nextIndex(this.pos,e),e)},"lookahead");Ft.prototype.advance=o(function(e){e===void 0&&(e=!1),this.pos=this.nextIndex(this.pos,e)},"advance");Ft.prototype.eat=o(function(e,i){return i===void 0&&(i=!1),this.current(i)===e?(this.advance(i),!0):!1},"eat");Ft.prototype.eatChars=o(function(e,i){i===void 0&&(i=!1);for(var n=this.pos,r=0,a=e;r-1&&this.raise(t.start,"Duplicate regular expression flag"),c==="u"&&(n=!0),c==="v"&&(r=!0)}this.options.ecmaVersion>=15&&n&&r&&this.raise(t.start,"Invalid regular expression flag")};function Wk(t){for(var e in t)return!0;return!1}o(Wk,"hasProp");L.validateRegExpPattern=function(t){this.regexp_pattern(t),!t.switchN&&this.options.ecmaVersion>=9&&Wk(t.groupNames)&&(t.switchN=!0,this.regexp_pattern(t))};L.regexp_pattern=function(t){t.pos=0,t.lastIntValue=0,t.lastStringValue="",t.lastAssertionIsQuantifiable=!1,t.numCapturingParens=0,t.maxBackReference=0,t.groupNames=Object.create(null),t.backReferenceNames.length=0,t.branchID=null,this.regexp_disjunction(t),t.pos!==t.source.length&&(t.eat(41)&&t.raise("Unmatched ')'"),(t.eat(93)||t.eat(125))&&t.raise("Lone quantifier brackets")),t.maxBackReference>t.numCapturingParens&&t.raise("Invalid escape");for(var e=0,i=t.backReferenceNames;e=16;for(e&&(t.branchID=new $g(t.branchID,null)),this.regexp_alternative(t);t.eat(124);)e&&(t.branchID=t.branchID.sibling()),this.regexp_alternative(t);e&&(t.branchID=t.branchID.parent),this.regexp_eatQuantifier(t,!0)&&t.raise("Nothing to repeat"),t.eat(123)&&t.raise("Lone quantifier brackets")};L.regexp_alternative=function(t){for(;t.pos=9&&(i=t.eat(60)),t.eat(61)||t.eat(33))return this.regexp_disjunction(t),t.eat(41)||t.raise("Unterminated group"),t.lastAssertionIsQuantifiable=!i,!0}return t.pos=e,!1};L.regexp_eatQuantifier=function(t,e){return e===void 0&&(e=!1),this.regexp_eatQuantifierPrefix(t,e)?(t.eat(63),!0):!1};L.regexp_eatQuantifierPrefix=function(t,e){return t.eat(42)||t.eat(43)||t.eat(63)||this.regexp_eatBracedQuantifier(t,e)};L.regexp_eatBracedQuantifier=function(t,e){var i=t.pos;if(t.eat(123)){var n=0,r=-1;if(this.regexp_eatDecimalDigits(t)&&(n=t.lastIntValue,t.eat(44)&&this.regexp_eatDecimalDigits(t)&&(r=t.lastIntValue),t.eat(125)))return r!==-1&&r=9?this.regexp_groupSpecifier(t):t.current()===63&&t.raise("Invalid group"),this.regexp_disjunction(t),t.eat(41))return t.numCapturingParens+=1,!0;t.raise("Unterminated group")}return!1};L.regexp_eatExtendedAtom=function(t){return t.eat(46)||this.regexp_eatReverseSolidusAtomEscape(t)||this.regexp_eatCharacterClass(t)||this.regexp_eatUncapturingGroup(t)||this.regexp_eatCapturingGroup(t)||this.regexp_eatInvalidBracedQuantifier(t)||this.regexp_eatExtendedPatternCharacter(t)};L.regexp_eatInvalidBracedQuantifier=function(t){return this.regexp_eatBracedQuantifier(t,!0)&&t.raise("Nothing to repeat"),!1};L.regexp_eatSyntaxCharacter=function(t){var e=t.current();return E1(e)?(t.lastIntValue=e,t.advance(),!0):!1};function E1(t){return t===36||t>=40&&t<=43||t===46||t===63||t>=91&&t<=94||t>=123&&t<=125}o(E1,"isSyntaxCharacter");L.regexp_eatPatternCharacters=function(t){for(var e=t.pos,i=0;(i=t.current())!==-1&&!E1(i);)t.advance();return t.pos!==e};L.regexp_eatExtendedPatternCharacter=function(t){var e=t.current();return e!==-1&&e!==36&&!(e>=40&&e<=43)&&e!==46&&e!==63&&e!==91&&e!==94&&e!==124?(t.advance(),!0):!1};L.regexp_groupSpecifier=function(t){if(t.eat(63)){this.regexp_eatGroupName(t)||t.raise("Invalid group");var e=this.options.ecmaVersion>=16,i=t.groupNames[t.lastStringValue];if(i)if(e)for(var n=0,r=i;n=11,n=t.current(i);return t.advance(i),n===92&&this.regexp_eatRegExpUnicodeEscapeSequence(t,i)&&(n=t.lastIntValue),Jk(n)?(t.lastIntValue=n,!0):(t.pos=e,!1)};function Jk(t){return qt(t,!0)||t===36||t===95}o(Jk,"isRegExpIdentifierStart");L.regexp_eatRegExpIdentifierPart=function(t){var e=t.pos,i=this.options.ecmaVersion>=11,n=t.current(i);return t.advance(i),n===92&&this.regexp_eatRegExpUnicodeEscapeSequence(t,i)&&(n=t.lastIntValue),Hk(n)?(t.lastIntValue=n,!0):(t.pos=e,!1)};function Hk(t){return Lo(t,!0)||t===36||t===95||t===8204||t===8205}o(Hk,"isRegExpIdentifierPart");L.regexp_eatAtomEscape=function(t){return this.regexp_eatBackReference(t)||this.regexp_eatCharacterClassEscape(t)||this.regexp_eatCharacterEscape(t)||t.switchN&&this.regexp_eatKGroupName(t)?!0:(t.switchU&&(t.current()===99&&t.raise("Invalid unicode escape"),t.raise("Invalid escape")),!1)};L.regexp_eatBackReference=function(t){var e=t.pos;if(this.regexp_eatDecimalEscape(t)){var i=t.lastIntValue;if(t.switchU)return i>t.maxBackReference&&(t.maxBackReference=i),!0;if(i<=t.numCapturingParens)return!0;t.pos=e}return!1};L.regexp_eatKGroupName=function(t){if(t.eat(107)){if(this.regexp_eatGroupName(t))return t.backReferenceNames.push(t.lastStringValue),!0;t.raise("Invalid named reference")}return!1};L.regexp_eatCharacterEscape=function(t){return this.regexp_eatControlEscape(t)||this.regexp_eatCControlLetter(t)||this.regexp_eatZero(t)||this.regexp_eatHexEscapeSequence(t)||this.regexp_eatRegExpUnicodeEscapeSequence(t,!1)||!t.switchU&&this.regexp_eatLegacyOctalEscapeSequence(t)||this.regexp_eatIdentityEscape(t)};L.regexp_eatCControlLetter=function(t){var e=t.pos;if(t.eat(99)){if(this.regexp_eatControlLetter(t))return!0;t.pos=e}return!1};L.regexp_eatZero=function(t){return t.current()===48&&!Qg(t.lookahead())?(t.lastIntValue=0,t.advance(),!0):!1};L.regexp_eatControlEscape=function(t){var e=t.current();return e===116?(t.lastIntValue=9,t.advance(),!0):e===110?(t.lastIntValue=10,t.advance(),!0):e===118?(t.lastIntValue=11,t.advance(),!0):e===102?(t.lastIntValue=12,t.advance(),!0):e===114?(t.lastIntValue=13,t.advance(),!0):!1};L.regexp_eatControlLetter=function(t){var e=t.current();return P1(e)?(t.lastIntValue=e%32,t.advance(),!0):!1};function P1(t){return t>=65&&t<=90||t>=97&&t<=122}o(P1,"isControlLetter");L.regexp_eatRegExpUnicodeEscapeSequence=function(t,e){e===void 0&&(e=!1);var i=t.pos,n=e||t.switchU;if(t.eat(117)){if(this.regexp_eatFixedHexDigits(t,4)){var r=t.lastIntValue;if(n&&r>=55296&&r<=56319){var a=t.pos;if(t.eat(92)&&t.eat(117)&&this.regexp_eatFixedHexDigits(t,4)){var c=t.lastIntValue;if(c>=56320&&c<=57343)return t.lastIntValue=(r-55296)*1024+(c-56320)+65536,!0}t.pos=a,t.lastIntValue=r}return!0}if(n&&t.eat(123)&&this.regexp_eatHexDigits(t)&&t.eat(125)&&zk(t.lastIntValue))return!0;n&&t.raise("Invalid unicode escape"),t.pos=i}return!1};function zk(t){return t>=0&&t<=1114111}o(zk,"isValidUnicode");L.regexp_eatIdentityEscape=function(t){if(t.switchU)return this.regexp_eatSyntaxCharacter(t)?!0:t.eat(47)?(t.lastIntValue=47,!0):!1;var e=t.current();return e!==99&&(!t.switchN||e!==107)?(t.lastIntValue=e,t.advance(),!0):!1};L.regexp_eatDecimalEscape=function(t){t.lastIntValue=0;var e=t.current();if(e>=49&&e<=57){do t.lastIntValue=10*t.lastIntValue+(e-48),t.advance();while((e=t.current())>=48&&e<=57);return!0}return!1};var N1=0,Xt=1,pt=2;L.regexp_eatCharacterClassEscape=function(t){var e=t.current();if(Gk(e))return t.lastIntValue=-1,t.advance(),Xt;var i=!1;if(t.switchU&&this.options.ecmaVersion>=9&&((i=e===80)||e===112)){t.lastIntValue=-1,t.advance();var n;if(t.eat(123)&&(n=this.regexp_eatUnicodePropertyValueExpression(t))&&t.eat(125))return i&&n===pt&&t.raise("Invalid property name"),n;t.raise("Invalid property name")}return N1};function Gk(t){return t===100||t===68||t===115||t===83||t===119||t===87}o(Gk,"isCharacterClassEscape");L.regexp_eatUnicodePropertyValueExpression=function(t){var e=t.pos;if(this.regexp_eatUnicodePropertyName(t)&&t.eat(61)){var i=t.lastStringValue;if(this.regexp_eatUnicodePropertyValue(t)){var n=t.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(t,i,n),Xt}}if(t.pos=e,this.regexp_eatLoneUnicodePropertyNameOrValue(t)){var r=t.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(t,r)}return N1};L.regexp_validateUnicodePropertyNameAndValue=function(t,e,i){Vf(t.unicodeProperties.nonBinary,e)||t.raise("Invalid property name"),t.unicodeProperties.nonBinary[e].test(i)||t.raise("Invalid property value")};L.regexp_validateUnicodePropertyNameOrValue=function(t,e){if(t.unicodeProperties.binary.test(e))return Xt;if(t.switchV&&t.unicodeProperties.binaryOfStrings.test(e))return pt;t.raise("Invalid property name")};L.regexp_eatUnicodePropertyName=function(t){var e=0;for(t.lastStringValue="";R1(e=t.current());)t.lastStringValue+=Li(e),t.advance();return t.lastStringValue!==""};function R1(t){return P1(t)||t===95}o(R1,"isUnicodePropertyNameCharacter");L.regexp_eatUnicodePropertyValue=function(t){var e=0;for(t.lastStringValue="";$k(e=t.current());)t.lastStringValue+=Li(e),t.advance();return t.lastStringValue!==""};function $k(t){return R1(t)||Qg(t)}o($k,"isUnicodePropertyValueCharacter");L.regexp_eatLoneUnicodePropertyNameOrValue=function(t){return this.regexp_eatUnicodePropertyValue(t)};L.regexp_eatCharacterClass=function(t){if(t.eat(91)){var e=t.eat(94),i=this.regexp_classContents(t);return t.eat(93)||t.raise("Unterminated character class"),e&&i===pt&&t.raise("Negated character class may contain strings"),!0}return!1};L.regexp_classContents=function(t){return t.current()===93?Xt:t.switchV?this.regexp_classSetExpression(t):(this.regexp_nonEmptyClassRanges(t),Xt)};L.regexp_nonEmptyClassRanges=function(t){for(;this.regexp_eatClassAtom(t);){var e=t.lastIntValue;if(t.eat(45)&&this.regexp_eatClassAtom(t)){var i=t.lastIntValue;t.switchU&&(e===-1||i===-1)&&t.raise("Invalid character class"),e!==-1&&i!==-1&&e>i&&t.raise("Range out of order in character class")}}};L.regexp_eatClassAtom=function(t){var e=t.pos;if(t.eat(92)){if(this.regexp_eatClassEscape(t))return!0;if(t.switchU){var i=t.current();(i===99||M1(i))&&t.raise("Invalid class escape"),t.raise("Invalid escape")}t.pos=e}var n=t.current();return n!==93?(t.lastIntValue=n,t.advance(),!0):!1};L.regexp_eatClassEscape=function(t){var e=t.pos;if(t.eat(98))return t.lastIntValue=8,!0;if(t.switchU&&t.eat(45))return t.lastIntValue=45,!0;if(!t.switchU&&t.eat(99)){if(this.regexp_eatClassControlLetter(t))return!0;t.pos=e}return this.regexp_eatCharacterClassEscape(t)||this.regexp_eatCharacterEscape(t)};L.regexp_classSetExpression=function(t){var e=Xt,i;if(!this.regexp_eatClassSetRange(t))if(i=this.regexp_eatClassSetOperand(t)){i===pt&&(e=pt);for(var n=t.pos;t.eatChars([38,38]);){if(t.current()!==38&&(i=this.regexp_eatClassSetOperand(t))){i!==pt&&(e=Xt);continue}t.raise("Invalid character in character class")}if(n!==t.pos)return e;for(;t.eatChars([45,45]);)this.regexp_eatClassSetOperand(t)||t.raise("Invalid character in character class");if(n!==t.pos)return e}else t.raise("Invalid character in character class");for(;;)if(!this.regexp_eatClassSetRange(t)){if(i=this.regexp_eatClassSetOperand(t),!i)return e;i===pt&&(e=pt)}};L.regexp_eatClassSetRange=function(t){var e=t.pos;if(this.regexp_eatClassSetCharacter(t)){var i=t.lastIntValue;if(t.eat(45)&&this.regexp_eatClassSetCharacter(t)){var n=t.lastIntValue;return i!==-1&&n!==-1&&i>n&&t.raise("Range out of order in character class"),!0}t.pos=e}return!1};L.regexp_eatClassSetOperand=function(t){return this.regexp_eatClassSetCharacter(t)?Xt:this.regexp_eatClassStringDisjunction(t)||this.regexp_eatNestedClass(t)};L.regexp_eatNestedClass=function(t){var e=t.pos;if(t.eat(91)){var i=t.eat(94),n=this.regexp_classContents(t);if(t.eat(93))return i&&n===pt&&t.raise("Negated character class may contain strings"),n;t.pos=e}if(t.eat(92)){var r=this.regexp_eatCharacterClassEscape(t);if(r)return r;t.pos=e}return null};L.regexp_eatClassStringDisjunction=function(t){var e=t.pos;if(t.eatChars([92,113])){if(t.eat(123)){var i=this.regexp_classStringDisjunctionContents(t);if(t.eat(125))return i}else t.raise("Invalid escape");t.pos=e}return null};L.regexp_classStringDisjunctionContents=function(t){for(var e=this.regexp_classString(t);t.eat(124);)this.regexp_classString(t)===pt&&(e=pt);return e};L.regexp_classString=function(t){for(var e=0;this.regexp_eatClassSetCharacter(t);)e++;return e===1?Xt:pt};L.regexp_eatClassSetCharacter=function(t){var e=t.pos;if(t.eat(92))return this.regexp_eatCharacterEscape(t)||this.regexp_eatClassSetReservedPunctuator(t)?!0:t.eat(98)?(t.lastIntValue=8,!0):(t.pos=e,!1);var i=t.current();return i<0||i===t.lookahead()&&Kk(i)||qk(i)?!1:(t.advance(),t.lastIntValue=i,!0)};function Kk(t){return t===33||t>=35&&t<=38||t>=42&&t<=44||t===46||t>=58&&t<=64||t===94||t===96||t===126}o(Kk,"isClassSetReservedDoublePunctuatorCharacter");function qk(t){return t===40||t===41||t===45||t===47||t>=91&&t<=93||t>=123&&t<=125}o(qk,"isClassSetSyntaxCharacter");L.regexp_eatClassSetReservedPunctuator=function(t){var e=t.current();return Xk(e)?(t.lastIntValue=e,t.advance(),!0):!1};function Xk(t){return t===33||t===35||t===37||t===38||t===44||t===45||t>=58&&t<=62||t===64||t===96||t===126}o(Xk,"isClassSetReservedPunctuator");L.regexp_eatClassControlLetter=function(t){var e=t.current();return Qg(e)||e===95?(t.lastIntValue=e%32,t.advance(),!0):!1};L.regexp_eatHexEscapeSequence=function(t){var e=t.pos;if(t.eat(120)){if(this.regexp_eatFixedHexDigits(t,2))return!0;t.switchU&&t.raise("Invalid escape"),t.pos=e}return!1};L.regexp_eatDecimalDigits=function(t){var e=t.pos,i=0;for(t.lastIntValue=0;Qg(i=t.current());)t.lastIntValue=10*t.lastIntValue+(i-48),t.advance();return t.pos!==e};function Qg(t){return t>=48&&t<=57}o(Qg,"isDecimalDigit");L.regexp_eatHexDigits=function(t){var e=t.pos,i=0;for(t.lastIntValue=0;A1(i=t.current());)t.lastIntValue=16*t.lastIntValue+V1(i),t.advance();return t.pos!==e};function A1(t){return t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102}o(A1,"isHexDigit");function V1(t){return t>=65&&t<=70?10+(t-65):t>=97&&t<=102?10+(t-97):t-48}o(V1,"hexToInt");L.regexp_eatLegacyOctalEscapeSequence=function(t){if(this.regexp_eatOctalDigit(t)){var e=t.lastIntValue;if(this.regexp_eatOctalDigit(t)){var i=t.lastIntValue;e<=3&&this.regexp_eatOctalDigit(t)?t.lastIntValue=e*64+i*8+t.lastIntValue:t.lastIntValue=e*8+i}else t.lastIntValue=e;return!0}return!1};L.regexp_eatOctalDigit=function(t){var e=t.current();return M1(e)?(t.lastIntValue=e-48,t.advance(),!0):(t.lastIntValue=0,!1)};function M1(t){return t>=48&&t<=55}o(M1,"isOctalDigit");L.regexp_eatFixedHexDigits=function(t,e){var i=t.pos;t.lastIntValue=0;for(var n=0;n=this.input.length)return this.finishToken(h.eof);if(t.override)return t.override(this);this.readToken(this.fullCharCodeAtPos())};ee.readToken=function(t){return qt(t,this.options.ecmaVersion>=6)||t===92?this.readWord():this.getTokenFromCode(t)};ee.fullCharCodeAtPos=function(){var t=this.input.charCodeAt(this.pos);if(t<=55295||t>=56320)return t;var e=this.input.charCodeAt(this.pos+1);return e<=56319||e>=57344?t:(t<<10)+e-56613888};ee.skipBlockComment=function(){var t=this.options.onComment&&this.curPosition(),e=this.pos,i=this.input.indexOf("*/",this.pos+=2);if(i===-1&&this.raise(this.pos-2,"Unterminated comment"),this.pos=i+2,this.options.locations)for(var n=void 0,r=e;(n=n1(this.input,r,this.pos))>-1;)++this.curLine,r=this.lineStart=n;this.options.onComment&&this.options.onComment(!0,this.input.slice(e+2,i),e,this.pos,t,this.curPosition())};ee.skipLineComment=function(t){for(var e=this.pos,i=this.options.onComment&&this.curPosition(),n=this.input.charCodeAt(this.pos+=t);this.pos8&&t<14||t>=5760&&o1.test(String.fromCharCode(t)))++this.pos;else break e}}};ee.finishToken=function(t,e){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var i=this.type;this.type=t,this.value=e,this.updateContext(i)};ee.readToken_dot=function(){var t=this.input.charCodeAt(this.pos+1);if(t>=48&&t<=57)return this.readNumber(!0);var e=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&t===46&&e===46?(this.pos+=3,this.finishToken(h.ellipsis)):(++this.pos,this.finishToken(h.dot))};ee.readToken_slash=function(){var t=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):t===61?this.finishOp(h.assign,2):this.finishOp(h.slash,1)};ee.readToken_mult_modulo_exp=function(t){var e=this.input.charCodeAt(this.pos+1),i=1,n=t===42?h.star:h.modulo;return this.options.ecmaVersion>=7&&t===42&&e===42&&(++i,n=h.starstar,e=this.input.charCodeAt(this.pos+2)),e===61?this.finishOp(h.assign,i+1):this.finishOp(n,i)};ee.readToken_pipe_amp=function(t){var e=this.input.charCodeAt(this.pos+1);if(e===t){if(this.options.ecmaVersion>=12){var i=this.input.charCodeAt(this.pos+2);if(i===61)return this.finishOp(h.assign,3)}return this.finishOp(t===124?h.logicalOR:h.logicalAND,2)}return e===61?this.finishOp(h.assign,2):this.finishOp(t===124?h.bitwiseOR:h.bitwiseAND,1)};ee.readToken_caret=function(){var t=this.input.charCodeAt(this.pos+1);return t===61?this.finishOp(h.assign,2):this.finishOp(h.bitwiseXOR,1)};ee.readToken_plus_min=function(t){var e=this.input.charCodeAt(this.pos+1);return e===t?e===45&&!this.inModule&&this.input.charCodeAt(this.pos+2)===62&&(this.lastTokEnd===0||dt.test(this.input.slice(this.lastTokEnd,this.pos)))?(this.skipLineComment(3),this.skipSpace(),this.nextToken()):this.finishOp(h.incDec,2):e===61?this.finishOp(h.assign,2):this.finishOp(h.plusMin,1)};ee.readToken_lt_gt=function(t){var e=this.input.charCodeAt(this.pos+1),i=1;return e===t?(i=t===62&&this.input.charCodeAt(this.pos+2)===62?3:2,this.input.charCodeAt(this.pos+i)===61?this.finishOp(h.assign,i+1):this.finishOp(h.bitShift,i)):e===33&&t===60&&!this.inModule&&this.input.charCodeAt(this.pos+2)===45&&this.input.charCodeAt(this.pos+3)===45?(this.skipLineComment(4),this.skipSpace(),this.nextToken()):(e===61&&(i=2),this.finishOp(h.relational,i))};ee.readToken_eq_excl=function(t){var e=this.input.charCodeAt(this.pos+1);return e===61?this.finishOp(h.equality,this.input.charCodeAt(this.pos+2)===61?3:2):t===61&&e===62&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(h.arrow)):this.finishOp(t===61?h.eq:h.prefix,1)};ee.readToken_question=function(){var t=this.options.ecmaVersion;if(t>=11){var e=this.input.charCodeAt(this.pos+1);if(e===46){var i=this.input.charCodeAt(this.pos+2);if(i<48||i>57)return this.finishOp(h.questionDot,2)}if(e===63){if(t>=12){var n=this.input.charCodeAt(this.pos+2);if(n===61)return this.finishOp(h.assign,3)}return this.finishOp(h.coalesce,2)}}return this.finishOp(h.question,1)};ee.readToken_numberSign=function(){var t=this.options.ecmaVersion,e=35;if(t>=13&&(++this.pos,e=this.fullCharCodeAtPos(),qt(e,!0)||e===92))return this.finishToken(h.privateId,this.readWord1());this.raise(this.pos,"Unexpected character '"+Li(e)+"'")};ee.getTokenFromCode=function(t){switch(t){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(h.parenL);case 41:return++this.pos,this.finishToken(h.parenR);case 59:return++this.pos,this.finishToken(h.semi);case 44:return++this.pos,this.finishToken(h.comma);case 91:return++this.pos,this.finishToken(h.bracketL);case 93:return++this.pos,this.finishToken(h.bracketR);case 123:return++this.pos,this.finishToken(h.braceL);case 125:return++this.pos,this.finishToken(h.braceR);case 58:return++this.pos,this.finishToken(h.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(h.backQuote);case 48:var e=this.input.charCodeAt(this.pos+1);if(e===120||e===88)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(e===111||e===79)return this.readRadixNumber(8);if(e===98||e===66)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(t);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(t);case 124:case 38:return this.readToken_pipe_amp(t);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(t);case 60:case 62:return this.readToken_lt_gt(t);case 61:case 33:return this.readToken_eq_excl(t);case 63:return this.readToken_question();case 126:return this.finishOp(h.prefix,1);case 35:return this.readToken_numberSign()}this.raise(this.pos,"Unexpected character '"+Li(t)+"'")};ee.finishOp=function(t,e){var i=this.input.slice(this.pos,this.pos+e);return this.pos+=e,this.finishToken(t,i)};ee.readRegexp=function(){for(var t,e,i=this.pos;;){this.pos>=this.input.length&&this.raise(i,"Unterminated regular expression");var n=this.input.charAt(this.pos);if(dt.test(n)&&this.raise(i,"Unterminated regular expression"),t)t=!1;else{if(n==="[")e=!0;else if(n==="]"&&e)e=!1;else if(n==="/"&&!e)break;t=n==="\\"}++this.pos}var r=this.input.slice(i,this.pos);++this.pos;var a=this.pos,c=this.readWord1();this.containsEsc&&this.unexpected(a);var p=this.regexpState||(this.regexpState=new Ft(this));p.reset(i,r,c),this.validateRegExpFlags(p),this.validateRegExpPattern(p);var d=null;try{d=new RegExp(r,c)}catch(_){}return this.finishToken(h.regexp,{pattern:r,flags:c,value:d})};ee.readInt=function(t,e,i){for(var n=this.options.ecmaVersion>=12&&e===void 0,r=i&&this.input.charCodeAt(this.pos)===48,a=this.pos,c=0,p=0,d=0,_=e==null?1/0:e;d<_;++d,++this.pos){var f=this.input.charCodeAt(this.pos),x=void 0;if(n&&f===95){r&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed in legacy octal numeric literals"),p===95&&this.raiseRecoverable(this.pos,"Numeric separator must be exactly one underscore"),d===0&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed at the first of digits"),p=f;continue}if(f>=97?x=f-97+10:f>=65?x=f-65+10:f>=48&&f<=57?x=f-48:x=1/0,x>=t)break;p=f,c=c*t+x}return n&&p===95&&this.raiseRecoverable(this.pos-1,"Numeric separator is not allowed at the last of digits"),this.pos===a||e!=null&&this.pos-a!==e?null:c};function Qk(t,e){return e?parseInt(t,8):parseFloat(t.replace(/_/g,""))}o(Qk,"stringToNumber");function D1(t){return typeof BigInt!="function"?null:BigInt(t.replace(/_/g,""))}o(D1,"stringToBigInt");ee.readRadixNumber=function(t){var e=this.pos;this.pos+=2;var i=this.readInt(t);return i==null&&this.raise(this.start+2,"Expected number in radix "+t),this.options.ecmaVersion>=11&&this.input.charCodeAt(this.pos)===110?(i=D1(this.input.slice(e,this.pos)),++this.pos):qt(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(h.num,i)};ee.readNumber=function(t){var e=this.pos;!t&&this.readInt(10,void 0,!0)===null&&this.raise(e,"Invalid number");var i=this.pos-e>=2&&this.input.charCodeAt(e)===48;i&&this.strict&&this.raise(e,"Invalid number");var n=this.input.charCodeAt(this.pos);if(!i&&!t&&this.options.ecmaVersion>=11&&n===110){var r=D1(this.input.slice(e,this.pos));return++this.pos,qt(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(h.num,r)}i&&/[89]/.test(this.input.slice(e,this.pos))&&(i=!1),n===46&&!i&&(++this.pos,this.readInt(10),n=this.input.charCodeAt(this.pos)),(n===69||n===101)&&!i&&(n=this.input.charCodeAt(++this.pos),(n===43||n===45)&&++this.pos,this.readInt(10)===null&&this.raise(e,"Invalid number")),qt(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");var a=Qk(this.input.slice(e,this.pos),i);return this.finishToken(h.num,a)};ee.readCodePoint=function(){var t=this.input.charCodeAt(this.pos),e;if(t===123){this.options.ecmaVersion<6&&this.unexpected();var i=++this.pos;e=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,e>1114111&&this.invalidStringToken(i,"Code point out of bounds")}else e=this.readHexChar(4);return e};ee.readString=function(t){for(var e="",i=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");var n=this.input.charCodeAt(this.pos);if(n===t)break;n===92?(e+=this.input.slice(i,this.pos),e+=this.readEscapedChar(!1),i=this.pos):n===8232||n===8233?(this.options.ecmaVersion<10&&this.raise(this.start,"Unterminated string constant"),++this.pos,this.options.locations&&(this.curLine++,this.lineStart=this.pos)):(Oo(n)&&this.raise(this.start,"Unterminated string constant"),++this.pos)}return e+=this.input.slice(i,this.pos++),this.finishToken(h.string,e)};var B1={};ee.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(t){if(t===B1)this.readInvalidTemplateToken();else throw t}this.inTemplateElement=!1};ee.invalidStringToken=function(t,e){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw B1;this.raise(t,e)};ee.readTmplToken=function(){for(var t="",e=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated template");var i=this.input.charCodeAt(this.pos);if(i===96||i===36&&this.input.charCodeAt(this.pos+1)===123)return this.pos===this.start&&(this.type===h.template||this.type===h.invalidTemplate)?i===36?(this.pos+=2,this.finishToken(h.dollarBraceL)):(++this.pos,this.finishToken(h.backQuote)):(t+=this.input.slice(e,this.pos),this.finishToken(h.template,t));if(i===92)t+=this.input.slice(e,this.pos),t+=this.readEscapedChar(!0),e=this.pos;else if(Oo(i)){switch(t+=this.input.slice(e,this.pos),++this.pos,i){case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:t+=` -`;break;default:t+=String.fromCharCode(i);break}this.options.locations&&(++this.curLine,this.lineStart=this.pos),e=this.pos}else++this.pos}};ee.readInvalidTemplateToken=function(){for(;this.pos=9&&this.type===h.star)&&!at.test(this.input.slice(this.lastTokEnd,this.start))};D.parseObj=function(t,e){var i=this.startNode(),s=!0,o={};for(i.properties=[],this.next();!this.eat(h.braceR);){if(s)s=!1;else if(this.expect(h.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(h.braceR))break;var a=this.parseProperty(t,e);t||this.checkPropClash(a,o,e),i.properties.push(a)}return this.finishNode(i,t?"ObjectPattern":"ObjectExpression")};D.parseProperty=function(t,e){var i=this.startNode(),s,o,a,l;if(this.options.ecmaVersion>=9&&this.eat(h.ellipsis))return t?(i.argument=this.parseIdent(!1),this.type===h.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.finishNode(i,"RestElement")):(i.argument=this.parseMaybeAssign(!1,e),this.type===h.comma&&e&&e.trailingComma<0&&(e.trailingComma=this.start),this.finishNode(i,"SpreadElement"));this.options.ecmaVersion>=6&&(i.method=!1,i.shorthand=!1,(t||e)&&(a=this.start,l=this.startLoc),t||(s=this.eat(h.star)));var f=this.containsEsc;return this.parsePropertyName(i),!t&&!f&&this.options.ecmaVersion>=8&&!s&&this.isAsyncProp(i)?(o=!0,s=this.options.ecmaVersion>=9&&this.eat(h.star),this.parsePropertyName(i)):o=!1,this.parsePropertyValue(i,t,s,o,a,l,e,f),this.finishNode(i,"Property")};D.parseGetterSetter=function(t){t.kind=t.key.name,this.parsePropertyName(t),t.value=this.parseMethod(!1);var e=t.kind==="get"?0:1;if(t.value.params.length!==e){var i=t.value.start;t.kind==="get"?this.raiseRecoverable(i,"getter should have no params"):this.raiseRecoverable(i,"setter should have exactly one param")}else t.kind==="set"&&t.value.params[0].type==="RestElement"&&this.raiseRecoverable(t.value.params[0].start,"Setter cannot use rest params")};D.parsePropertyValue=function(t,e,i,s,o,a,l,f){(i||s)&&this.type===h.colon&&this.unexpected(),this.eat(h.colon)?(t.value=e?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,l),t.kind="init"):this.options.ecmaVersion>=6&&this.type===h.parenL?(e&&this.unexpected(),t.kind="init",t.method=!0,t.value=this.parseMethod(i,s)):!e&&!f&&this.options.ecmaVersion>=5&&!t.computed&&t.key.type==="Identifier"&&(t.key.name==="get"||t.key.name==="set")&&this.type!==h.comma&&this.type!==h.braceR&&this.type!==h.eq?((i||s)&&this.unexpected(),this.parseGetterSetter(t)):this.options.ecmaVersion>=6&&!t.computed&&t.key.type==="Identifier"?((i||s)&&this.unexpected(),this.checkUnreserved(t.key),t.key.name==="await"&&!this.awaitIdentPos&&(this.awaitIdentPos=o),t.kind="init",e?t.value=this.parseMaybeDefault(o,a,this.copyNode(t.key)):this.type===h.eq&&l?(l.shorthandAssign<0&&(l.shorthandAssign=this.start),t.value=this.parseMaybeDefault(o,a,this.copyNode(t.key))):t.value=this.copyNode(t.key),t.shorthand=!0):this.unexpected()};D.parsePropertyName=function(t){if(this.options.ecmaVersion>=6){if(this.eat(h.bracketL))return t.computed=!0,t.key=this.parseMaybeAssign(),this.expect(h.bracketR),t.key;t.computed=!1}return t.key=this.type===h.num||this.type===h.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never")};D.initFunction=function(t){t.id=null,this.options.ecmaVersion>=6&&(t.generator=t.expression=!1),this.options.ecmaVersion>=8&&(t.async=!1)};D.parseMethod=function(t,e,i){var s=this.startNode(),o=this.yieldPos,a=this.awaitPos,l=this.awaitIdentPos;return this.initFunction(s),this.options.ecmaVersion>=6&&(s.generator=t),this.options.ecmaVersion>=8&&(s.async=!!e),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(aw(e,s.generator)|ow|(i?kE:0)),this.expect(h.parenL),s.params=this.parseBindingList(h.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(s,!1,!0,!1),this.yieldPos=o,this.awaitPos=a,this.awaitIdentPos=l,this.finishNode(s,"FunctionExpression")};D.parseArrowExpression=function(t,e,i,s){var o=this.yieldPos,a=this.awaitPos,l=this.awaitIdentPos;return this.enterScope(aw(i,!1)|SE),this.initFunction(t),this.options.ecmaVersion>=8&&(t.async=!!i),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,t.params=this.toAssignableList(e,!0),this.parseFunctionBody(t,!0,!1,s),this.yieldPos=o,this.awaitPos=a,this.awaitIdentPos=l,this.finishNode(t,"ArrowFunctionExpression")};D.parseFunctionBody=function(t,e,i,s){var o=e&&this.type!==h.braceL,a=this.strict,l=!1;if(o)t.body=this.parseMaybeAssign(s),t.expression=!0,this.checkParams(t,!1);else{var f=this.options.ecmaVersion>=7&&!this.isSimpleParamList(t.params);(!a||f)&&(l=this.strictDirective(this.end),l&&f&&this.raiseRecoverable(t.start,"Illegal 'use strict' directive in function with non-simple parameter list"));var m=this.labels;this.labels=[],l&&(this.strict=!0),this.checkParams(t,!a&&!l&&!e&&!i&&this.isSimpleParamList(t.params)),this.strict&&t.id&&this.checkLValSimple(t.id,NE),t.body=this.parseBlock(!1,void 0,l&&!a),t.expression=!1,this.adaptDirectivePrologue(t.body.body),this.labels=m}this.exitScope()};D.isSimpleParamList=function(t){for(var e=0,i=t;e-1||o.functions.indexOf(t)>-1||o.var.indexOf(t)>-1,o.lexical.push(t),this.inModule&&o.flags&Qh&&delete this.undefinedExports[t]}else if(e===PE){var a=this.currentScope();a.lexical.push(t)}else if(e===CE){var l=this.currentScope();this.treatFunctionsAsVar?s=l.lexical.indexOf(t)>-1:s=l.lexical.indexOf(t)>-1||l.var.indexOf(t)>-1,l.functions.push(t)}else for(var f=this.scopeStack.length-1;f>=0;--f){var m=this.scopeStack[f];if(m.lexical.indexOf(t)>-1&&!(m.flags&EE&&m.lexical[0]===t)||!this.treatFunctionsAsVarInScope(m)&&m.functions.indexOf(t)>-1){s=!0;break}if(m.var.push(t),this.inModule&&m.flags&Qh&&delete this.undefinedExports[t],m.flags&nw)break}s&&this.raiseRecoverable(i,"Identifier '"+t+"' has already been declared")};Hi.checkLocalExport=function(t){this.scopeStack[0].lexical.indexOf(t.name)===-1&&this.scopeStack[0].var.indexOf(t.name)===-1&&(this.undefinedExports[t.name]=t)};Hi.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]};Hi.currentVarScope=function(){for(var t=this.scopeStack.length-1;;t--){var e=this.scopeStack[t];if(e.flags&nw)return e}};Hi.currentThisScope=function(){for(var t=this.scopeStack.length-1;;t--){var e=this.scopeStack[t];if(e.flags&nw&&!(e.flags&SE))return e}};var Ab=r(function(e,i,s){this.type="",this.start=i,this.end=0,e.options.locations&&(this.loc=new Pb(e,s)),e.options.directSourceFile&&(this.sourceFile=e.options.directSourceFile),e.options.ranges&&(this.range=[i,0])},"Node"),ed=me.prototype;ed.startNode=function(){return new Ab(this,this.start,this.startLoc)};ed.startNodeAt=function(t,e){return new Ab(this,t,e)};function ME(t,e,i,s){return t.type=e,t.end=i,this.options.locations&&(t.loc.end=s),this.options.ranges&&(t.range[1]=i),t}r(ME,"finishNodeAt");ed.finishNode=function(t,e){return ME.call(this,t,e,this.lastTokEnd,this.lastTokEndLoc)};ed.finishNodeAt=function(t,e,i,s){return ME.call(this,t,e,i,s)};ed.copyNode=function(t){var e=new Ab(this,t.start,this.startLoc);for(var i in t)e[i]=t[i];return e};var LE="ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS",OE=LE+" Extended_Pictographic",DE=OE,BE=DE+" EBase EComp EMod EPres ExtPict",YE=BE,X1=YE,Q1={9:LE,10:OE,11:DE,12:BE,13:YE,14:X1},J1="Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji",Z1={9:"",10:"",11:"",12:"",13:"",14:J1},_E="Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu",VE="Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb",UE=VE+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",FE=UE+" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho",WE=FE+" Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi",GE=WE+" Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith",eC=GE+" Hrkt Katakana_Or_Hiragana Kawi Nag_Mundari Nagm Unknown Zzzz",tC={9:VE,10:UE,11:FE,12:WE,13:GE,14:eC},jE={};function iC(t){var e=jE[t]={binary:Gi(Q1[t]+" "+_E),binaryOfStrings:Gi(Z1[t]),nonBinary:{General_Category:Gi(_E),Script:Gi(tC[t])}};e.nonBinary.Script_Extensions=e.nonBinary.Script,e.nonBinary.gc=e.nonBinary.General_Category,e.nonBinary.sc=e.nonBinary.Script,e.nonBinary.scx=e.nonBinary.Script_Extensions}r(iC,"buildUnicodeData");for(Ib=0,Jg=[9,10,11,12,13,14];Ib=6?"uy":"")+(e.options.ecmaVersion>=9?"s":"")+(e.options.ecmaVersion>=13?"d":"")+(e.options.ecmaVersion>=15?"v":""),this.unicodeProperties=jE[e.options.ecmaVersion>=14?14:e.options.ecmaVersion],this.source="",this.flags="",this.start=0,this.switchU=!1,this.switchV=!1,this.switchN=!1,this.pos=0,this.lastIntValue=0,this.lastStringValue="",this.lastAssertionIsQuantifiable=!1,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=Object.create(null),this.backReferenceNames=[],this.branchID=null},"RegExpValidationState");Gt.prototype.reset=r(function(e,i,s){var o=s.indexOf("v")!==-1,a=s.indexOf("u")!==-1;this.start=e|0,this.source=i+"",this.flags=s,o&&this.parser.options.ecmaVersion>=15?(this.switchU=!0,this.switchV=!0,this.switchN=!0):(this.switchU=a&&this.parser.options.ecmaVersion>=6,this.switchV=!1,this.switchN=a&&this.parser.options.ecmaVersion>=9)},"reset");Gt.prototype.raise=r(function(e){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+e)},"raise");Gt.prototype.at=r(function(e,i){i===void 0&&(i=!1);var s=this.source,o=s.length;if(e>=o)return-1;var a=s.charCodeAt(e);if(!(i||this.switchU)||a<=55295||a>=57344||e+1>=o)return a;var l=s.charCodeAt(e+1);return l>=56320&&l<=57343?(a<<10)+l-56613888:a},"at");Gt.prototype.nextIndex=r(function(e,i){i===void 0&&(i=!1);var s=this.source,o=s.length;if(e>=o)return o;var a=s.charCodeAt(e),l;return!(i||this.switchU)||a<=55295||a>=57344||e+1>=o||(l=s.charCodeAt(e+1))<56320||l>57343?e+1:e+2},"nextIndex");Gt.prototype.current=r(function(e){return e===void 0&&(e=!1),this.at(this.pos,e)},"current");Gt.prototype.lookahead=r(function(e){return e===void 0&&(e=!1),this.at(this.nextIndex(this.pos,e),e)},"lookahead");Gt.prototype.advance=r(function(e){e===void 0&&(e=!1),this.pos=this.nextIndex(this.pos,e)},"advance");Gt.prototype.eat=r(function(e,i){return i===void 0&&(i=!1),this.current(i)===e?(this.advance(i),!0):!1},"eat");Gt.prototype.eatChars=r(function(e,i){i===void 0&&(i=!1);for(var s=this.pos,o=0,a=e;o-1&&this.raise(t.start,"Duplicate regular expression flag"),l==="u"&&(s=!0),l==="v"&&(o=!0)}this.options.ecmaVersion>=15&&s&&o&&this.raise(t.start,"Invalid regular expression flag")};function rC(t){for(var e in t)return!0;return!1}r(rC,"hasProp");N.validateRegExpPattern=function(t){this.regexp_pattern(t),!t.switchN&&this.options.ecmaVersion>=9&&rC(t.groupNames)&&(t.switchN=!0,this.regexp_pattern(t))};N.regexp_pattern=function(t){t.pos=0,t.lastIntValue=0,t.lastStringValue="",t.lastAssertionIsQuantifiable=!1,t.numCapturingParens=0,t.maxBackReference=0,t.groupNames=Object.create(null),t.backReferenceNames.length=0,t.branchID=null,this.regexp_disjunction(t),t.pos!==t.source.length&&(t.eat(41)&&t.raise("Unmatched ')'"),(t.eat(93)||t.eat(125))&&t.raise("Lone quantifier brackets")),t.maxBackReference>t.numCapturingParens&&t.raise("Invalid escape");for(var e=0,i=t.backReferenceNames;e=16;for(e&&(t.branchID=new Cb(t.branchID,null)),this.regexp_alternative(t);t.eat(124);)e&&(t.branchID=t.branchID.sibling()),this.regexp_alternative(t);e&&(t.branchID=t.branchID.parent),this.regexp_eatQuantifier(t,!0)&&t.raise("Nothing to repeat"),t.eat(123)&&t.raise("Lone quantifier brackets")};N.regexp_alternative=function(t){for(;t.pos=9&&(i=t.eat(60)),t.eat(61)||t.eat(33))return this.regexp_disjunction(t),t.eat(41)||t.raise("Unterminated group"),t.lastAssertionIsQuantifiable=!i,!0}return t.pos=e,!1};N.regexp_eatQuantifier=function(t,e){return e===void 0&&(e=!1),this.regexp_eatQuantifierPrefix(t,e)?(t.eat(63),!0):!1};N.regexp_eatQuantifierPrefix=function(t,e){return t.eat(42)||t.eat(43)||t.eat(63)||this.regexp_eatBracedQuantifier(t,e)};N.regexp_eatBracedQuantifier=function(t,e){var i=t.pos;if(t.eat(123)){var s=0,o=-1;if(this.regexp_eatDecimalDigits(t)&&(s=t.lastIntValue,t.eat(44)&&this.regexp_eatDecimalDigits(t)&&(o=t.lastIntValue),t.eat(125)))return o!==-1&&o=9?this.regexp_groupSpecifier(t):t.current()===63&&t.raise("Invalid group"),this.regexp_disjunction(t),t.eat(41))return t.numCapturingParens+=1,!0;t.raise("Unterminated group")}return!1};N.regexp_eatExtendedAtom=function(t){return t.eat(46)||this.regexp_eatReverseSolidusAtomEscape(t)||this.regexp_eatCharacterClass(t)||this.regexp_eatUncapturingGroup(t)||this.regexp_eatCapturingGroup(t)||this.regexp_eatInvalidBracedQuantifier(t)||this.regexp_eatExtendedPatternCharacter(t)};N.regexp_eatInvalidBracedQuantifier=function(t){return this.regexp_eatBracedQuantifier(t,!0)&&t.raise("Nothing to repeat"),!1};N.regexp_eatSyntaxCharacter=function(t){var e=t.current();return HE(e)?(t.lastIntValue=e,t.advance(),!0):!1};function HE(t){return t===36||t>=40&&t<=43||t===46||t===63||t>=91&&t<=94||t>=123&&t<=125}r(HE,"isSyntaxCharacter");N.regexp_eatPatternCharacters=function(t){for(var e=t.pos,i=0;(i=t.current())!==-1&&!HE(i);)t.advance();return t.pos!==e};N.regexp_eatExtendedPatternCharacter=function(t){var e=t.current();return e!==-1&&e!==36&&!(e>=40&&e<=43)&&e!==46&&e!==63&&e!==91&&e!==94&&e!==124?(t.advance(),!0):!1};N.regexp_groupSpecifier=function(t){if(t.eat(63)){this.regexp_eatGroupName(t)||t.raise("Invalid group");var e=this.options.ecmaVersion>=16,i=t.groupNames[t.lastStringValue];if(i)if(e)for(var s=0,o=i;s=11,s=t.current(i);return t.advance(i),s===92&&this.regexp_eatRegExpUnicodeEscapeSequence(t,i)&&(s=t.lastIntValue),sC(s)?(t.lastIntValue=s,!0):(t.pos=e,!1)};function sC(t){return ai(t,!0)||t===36||t===95}r(sC,"isRegExpIdentifierStart");N.regexp_eatRegExpIdentifierPart=function(t){var e=t.pos,i=this.options.ecmaVersion>=11,s=t.current(i);return t.advance(i),s===92&&this.regexp_eatRegExpUnicodeEscapeSequence(t,i)&&(s=t.lastIntValue),oC(s)?(t.lastIntValue=s,!0):(t.pos=e,!1)};function oC(t){return Fs(t,!0)||t===36||t===95||t===8204||t===8205}r(oC,"isRegExpIdentifierPart");N.regexp_eatAtomEscape=function(t){return this.regexp_eatBackReference(t)||this.regexp_eatCharacterClassEscape(t)||this.regexp_eatCharacterEscape(t)||t.switchN&&this.regexp_eatKGroupName(t)?!0:(t.switchU&&(t.current()===99&&t.raise("Invalid unicode escape"),t.raise("Invalid escape")),!1)};N.regexp_eatBackReference=function(t){var e=t.pos;if(this.regexp_eatDecimalEscape(t)){var i=t.lastIntValue;if(t.switchU)return i>t.maxBackReference&&(t.maxBackReference=i),!0;if(i<=t.numCapturingParens)return!0;t.pos=e}return!1};N.regexp_eatKGroupName=function(t){if(t.eat(107)){if(this.regexp_eatGroupName(t))return t.backReferenceNames.push(t.lastStringValue),!0;t.raise("Invalid named reference")}return!1};N.regexp_eatCharacterEscape=function(t){return this.regexp_eatControlEscape(t)||this.regexp_eatCControlLetter(t)||this.regexp_eatZero(t)||this.regexp_eatHexEscapeSequence(t)||this.regexp_eatRegExpUnicodeEscapeSequence(t,!1)||!t.switchU&&this.regexp_eatLegacyOctalEscapeSequence(t)||this.regexp_eatIdentityEscape(t)};N.regexp_eatCControlLetter=function(t){var e=t.pos;if(t.eat(99)){if(this.regexp_eatControlLetter(t))return!0;t.pos=e}return!1};N.regexp_eatZero=function(t){return t.current()===48&&!Rb(t.lookahead())?(t.lastIntValue=0,t.advance(),!0):!1};N.regexp_eatControlEscape=function(t){var e=t.current();return e===116?(t.lastIntValue=9,t.advance(),!0):e===110?(t.lastIntValue=10,t.advance(),!0):e===118?(t.lastIntValue=11,t.advance(),!0):e===102?(t.lastIntValue=12,t.advance(),!0):e===114?(t.lastIntValue=13,t.advance(),!0):!1};N.regexp_eatControlLetter=function(t){var e=t.current();return $E(e)?(t.lastIntValue=e%32,t.advance(),!0):!1};function $E(t){return t>=65&&t<=90||t>=97&&t<=122}r($E,"isControlLetter");N.regexp_eatRegExpUnicodeEscapeSequence=function(t,e){e===void 0&&(e=!1);var i=t.pos,s=e||t.switchU;if(t.eat(117)){if(this.regexp_eatFixedHexDigits(t,4)){var o=t.lastIntValue;if(s&&o>=55296&&o<=56319){var a=t.pos;if(t.eat(92)&&t.eat(117)&&this.regexp_eatFixedHexDigits(t,4)){var l=t.lastIntValue;if(l>=56320&&l<=57343)return t.lastIntValue=(o-55296)*1024+(l-56320)+65536,!0}t.pos=a,t.lastIntValue=o}return!0}if(s&&t.eat(123)&&this.regexp_eatHexDigits(t)&&t.eat(125)&&nC(t.lastIntValue))return!0;s&&t.raise("Invalid unicode escape"),t.pos=i}return!1};function nC(t){return t>=0&&t<=1114111}r(nC,"isValidUnicode");N.regexp_eatIdentityEscape=function(t){if(t.switchU)return this.regexp_eatSyntaxCharacter(t)?!0:t.eat(47)?(t.lastIntValue=47,!0):!1;var e=t.current();return e!==99&&(!t.switchN||e!==107)?(t.lastIntValue=e,t.advance(),!0):!1};N.regexp_eatDecimalEscape=function(t){t.lastIntValue=0;var e=t.current();if(e>=49&&e<=57){do t.lastIntValue=10*t.lastIntValue+(e-48),t.advance();while((e=t.current())>=48&&e<=57);return!0}return!1};var KE=0,pi=1,nt=2;N.regexp_eatCharacterClassEscape=function(t){var e=t.current();if(aC(e))return t.lastIntValue=-1,t.advance(),pi;var i=!1;if(t.switchU&&this.options.ecmaVersion>=9&&((i=e===80)||e===112)){t.lastIntValue=-1,t.advance();var s;if(t.eat(123)&&(s=this.regexp_eatUnicodePropertyValueExpression(t))&&t.eat(125))return i&&s===nt&&t.raise("Invalid property name"),s;t.raise("Invalid property name")}return KE};function aC(t){return t===100||t===68||t===115||t===83||t===119||t===87}r(aC,"isCharacterClassEscape");N.regexp_eatUnicodePropertyValueExpression=function(t){var e=t.pos;if(this.regexp_eatUnicodePropertyName(t)&&t.eat(61)){var i=t.lastStringValue;if(this.regexp_eatUnicodePropertyValue(t)){var s=t.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(t,i,s),pi}}if(t.pos=e,this.regexp_eatLoneUnicodePropertyNameOrValue(t)){var o=t.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(t,o)}return KE};N.regexp_validateUnicodePropertyNameAndValue=function(t,e,i){Jh(t.unicodeProperties.nonBinary,e)||t.raise("Invalid property name"),t.unicodeProperties.nonBinary[e].test(i)||t.raise("Invalid property value")};N.regexp_validateUnicodePropertyNameOrValue=function(t,e){if(t.unicodeProperties.binary.test(e))return pi;if(t.switchV&&t.unicodeProperties.binaryOfStrings.test(e))return nt;t.raise("Invalid property name")};N.regexp_eatUnicodePropertyName=function(t){var e=0;for(t.lastStringValue="";qE(e=t.current());)t.lastStringValue+=ji(e),t.advance();return t.lastStringValue!==""};function qE(t){return $E(t)||t===95}r(qE,"isUnicodePropertyNameCharacter");N.regexp_eatUnicodePropertyValue=function(t){var e=0;for(t.lastStringValue="";pC(e=t.current());)t.lastStringValue+=ji(e),t.advance();return t.lastStringValue!==""};function pC(t){return qE(t)||Rb(t)}r(pC,"isUnicodePropertyValueCharacter");N.regexp_eatLoneUnicodePropertyNameOrValue=function(t){return this.regexp_eatUnicodePropertyValue(t)};N.regexp_eatCharacterClass=function(t){if(t.eat(91)){var e=t.eat(94),i=this.regexp_classContents(t);return t.eat(93)||t.raise("Unterminated character class"),e&&i===nt&&t.raise("Negated character class may contain strings"),!0}return!1};N.regexp_classContents=function(t){return t.current()===93?pi:t.switchV?this.regexp_classSetExpression(t):(this.regexp_nonEmptyClassRanges(t),pi)};N.regexp_nonEmptyClassRanges=function(t){for(;this.regexp_eatClassAtom(t);){var e=t.lastIntValue;if(t.eat(45)&&this.regexp_eatClassAtom(t)){var i=t.lastIntValue;t.switchU&&(e===-1||i===-1)&&t.raise("Invalid character class"),e!==-1&&i!==-1&&e>i&&t.raise("Range out of order in character class")}}};N.regexp_eatClassAtom=function(t){var e=t.pos;if(t.eat(92)){if(this.regexp_eatClassEscape(t))return!0;if(t.switchU){var i=t.current();(i===99||QE(i))&&t.raise("Invalid class escape"),t.raise("Invalid escape")}t.pos=e}var s=t.current();return s!==93?(t.lastIntValue=s,t.advance(),!0):!1};N.regexp_eatClassEscape=function(t){var e=t.pos;if(t.eat(98))return t.lastIntValue=8,!0;if(t.switchU&&t.eat(45))return t.lastIntValue=45,!0;if(!t.switchU&&t.eat(99)){if(this.regexp_eatClassControlLetter(t))return!0;t.pos=e}return this.regexp_eatCharacterClassEscape(t)||this.regexp_eatCharacterEscape(t)};N.regexp_classSetExpression=function(t){var e=pi,i;if(!this.regexp_eatClassSetRange(t))if(i=this.regexp_eatClassSetOperand(t)){i===nt&&(e=nt);for(var s=t.pos;t.eatChars([38,38]);){if(t.current()!==38&&(i=this.regexp_eatClassSetOperand(t))){i!==nt&&(e=pi);continue}t.raise("Invalid character in character class")}if(s!==t.pos)return e;for(;t.eatChars([45,45]);)this.regexp_eatClassSetOperand(t)||t.raise("Invalid character in character class");if(s!==t.pos)return e}else t.raise("Invalid character in character class");for(;;)if(!this.regexp_eatClassSetRange(t)){if(i=this.regexp_eatClassSetOperand(t),!i)return e;i===nt&&(e=nt)}};N.regexp_eatClassSetRange=function(t){var e=t.pos;if(this.regexp_eatClassSetCharacter(t)){var i=t.lastIntValue;if(t.eat(45)&&this.regexp_eatClassSetCharacter(t)){var s=t.lastIntValue;return i!==-1&&s!==-1&&i>s&&t.raise("Range out of order in character class"),!0}t.pos=e}return!1};N.regexp_eatClassSetOperand=function(t){return this.regexp_eatClassSetCharacter(t)?pi:this.regexp_eatClassStringDisjunction(t)||this.regexp_eatNestedClass(t)};N.regexp_eatNestedClass=function(t){var e=t.pos;if(t.eat(91)){var i=t.eat(94),s=this.regexp_classContents(t);if(t.eat(93))return i&&s===nt&&t.raise("Negated character class may contain strings"),s;t.pos=e}if(t.eat(92)){var o=this.regexp_eatCharacterClassEscape(t);if(o)return o;t.pos=e}return null};N.regexp_eatClassStringDisjunction=function(t){var e=t.pos;if(t.eatChars([92,113])){if(t.eat(123)){var i=this.regexp_classStringDisjunctionContents(t);if(t.eat(125))return i}else t.raise("Invalid escape");t.pos=e}return null};N.regexp_classStringDisjunctionContents=function(t){for(var e=this.regexp_classString(t);t.eat(124);)this.regexp_classString(t)===nt&&(e=nt);return e};N.regexp_classString=function(t){for(var e=0;this.regexp_eatClassSetCharacter(t);)e++;return e===1?pi:nt};N.regexp_eatClassSetCharacter=function(t){var e=t.pos;if(t.eat(92))return this.regexp_eatCharacterEscape(t)||this.regexp_eatClassSetReservedPunctuator(t)?!0:t.eat(98)?(t.lastIntValue=8,!0):(t.pos=e,!1);var i=t.current();return i<0||i===t.lookahead()&&cC(i)||lC(i)?!1:(t.advance(),t.lastIntValue=i,!0)};function cC(t){return t===33||t>=35&&t<=38||t>=42&&t<=44||t===46||t>=58&&t<=64||t===94||t===96||t===126}r(cC,"isClassSetReservedDoublePunctuatorCharacter");function lC(t){return t===40||t===41||t===45||t===47||t>=91&&t<=93||t>=123&&t<=125}r(lC,"isClassSetSyntaxCharacter");N.regexp_eatClassSetReservedPunctuator=function(t){var e=t.current();return uC(e)?(t.lastIntValue=e,t.advance(),!0):!1};function uC(t){return t===33||t===35||t===37||t===38||t===44||t===45||t>=58&&t<=62||t===64||t===96||t===126}r(uC,"isClassSetReservedPunctuator");N.regexp_eatClassControlLetter=function(t){var e=t.current();return Rb(e)||e===95?(t.lastIntValue=e%32,t.advance(),!0):!1};N.regexp_eatHexEscapeSequence=function(t){var e=t.pos;if(t.eat(120)){if(this.regexp_eatFixedHexDigits(t,2))return!0;t.switchU&&t.raise("Invalid escape"),t.pos=e}return!1};N.regexp_eatDecimalDigits=function(t){var e=t.pos,i=0;for(t.lastIntValue=0;Rb(i=t.current());)t.lastIntValue=10*t.lastIntValue+(i-48),t.advance();return t.pos!==e};function Rb(t){return t>=48&&t<=57}r(Rb,"isDecimalDigit");N.regexp_eatHexDigits=function(t){var e=t.pos,i=0;for(t.lastIntValue=0;zE(i=t.current());)t.lastIntValue=16*t.lastIntValue+XE(i),t.advance();return t.pos!==e};function zE(t){return t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102}r(zE,"isHexDigit");function XE(t){return t>=65&&t<=70?10+(t-65):t>=97&&t<=102?10+(t-97):t-48}r(XE,"hexToInt");N.regexp_eatLegacyOctalEscapeSequence=function(t){if(this.regexp_eatOctalDigit(t)){var e=t.lastIntValue;if(this.regexp_eatOctalDigit(t)){var i=t.lastIntValue;e<=3&&this.regexp_eatOctalDigit(t)?t.lastIntValue=e*64+i*8+t.lastIntValue:t.lastIntValue=e*8+i}else t.lastIntValue=e;return!0}return!1};N.regexp_eatOctalDigit=function(t){var e=t.current();return QE(e)?(t.lastIntValue=e-48,t.advance(),!0):(t.lastIntValue=0,!1)};function QE(t){return t>=48&&t<=55}r(QE,"isOctalDigit");N.regexp_eatFixedHexDigits=function(t,e){var i=t.pos;t.lastIntValue=0;for(var s=0;s=this.input.length)return this.finishToken(h.eof);if(t.override)return t.override(this);this.readToken(this.fullCharCodeAtPos())};W.readToken=function(t){return ai(t,this.options.ecmaVersion>=6)||t===92?this.readWord():this.getTokenFromCode(t)};W.fullCharCodeAtPos=function(){var t=this.input.charCodeAt(this.pos);if(t<=55295||t>=56320)return t;var e=this.input.charCodeAt(this.pos+1);return e<=56319||e>=57344?t:(t<<10)+e-56613888};W.skipBlockComment=function(){var t=this.options.onComment&&this.curPosition(),e=this.pos,i=this.input.indexOf("*/",this.pos+=2);if(i===-1&&this.raise(this.pos-2,"Unterminated comment"),this.pos=i+2,this.options.locations)for(var s=void 0,o=e;(s=gE(this.input,o,this.pos))>-1;)++this.curLine,o=this.lineStart=s;this.options.onComment&&this.options.onComment(!0,this.input.slice(e+2,i),e,this.pos,t,this.curPosition())};W.skipLineComment=function(t){for(var e=this.pos,i=this.options.onComment&&this.curPosition(),s=this.input.charCodeAt(this.pos+=t);this.pos8&&t<14||t>=5760&&wE.test(String.fromCharCode(t)))++this.pos;else break e}}};W.finishToken=function(t,e){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var i=this.type;this.type=t,this.value=e,this.updateContext(i)};W.readToken_dot=function(){var t=this.input.charCodeAt(this.pos+1);if(t>=48&&t<=57)return this.readNumber(!0);var e=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&t===46&&e===46?(this.pos+=3,this.finishToken(h.ellipsis)):(++this.pos,this.finishToken(h.dot))};W.readToken_slash=function(){var t=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):t===61?this.finishOp(h.assign,2):this.finishOp(h.slash,1)};W.readToken_mult_modulo_exp=function(t){var e=this.input.charCodeAt(this.pos+1),i=1,s=t===42?h.star:h.modulo;return this.options.ecmaVersion>=7&&t===42&&e===42&&(++i,s=h.starstar,e=this.input.charCodeAt(this.pos+2)),e===61?this.finishOp(h.assign,i+1):this.finishOp(s,i)};W.readToken_pipe_amp=function(t){var e=this.input.charCodeAt(this.pos+1);if(e===t){if(this.options.ecmaVersion>=12){var i=this.input.charCodeAt(this.pos+2);if(i===61)return this.finishOp(h.assign,3)}return this.finishOp(t===124?h.logicalOR:h.logicalAND,2)}return e===61?this.finishOp(h.assign,2):this.finishOp(t===124?h.bitwiseOR:h.bitwiseAND,1)};W.readToken_caret=function(){var t=this.input.charCodeAt(this.pos+1);return t===61?this.finishOp(h.assign,2):this.finishOp(h.bitwiseXOR,1)};W.readToken_plus_min=function(t){var e=this.input.charCodeAt(this.pos+1);return e===t?e===45&&!this.inModule&&this.input.charCodeAt(this.pos+2)===62&&(this.lastTokEnd===0||at.test(this.input.slice(this.lastTokEnd,this.pos)))?(this.skipLineComment(3),this.skipSpace(),this.nextToken()):this.finishOp(h.incDec,2):e===61?this.finishOp(h.assign,2):this.finishOp(h.plusMin,1)};W.readToken_lt_gt=function(t){var e=this.input.charCodeAt(this.pos+1),i=1;return e===t?(i=t===62&&this.input.charCodeAt(this.pos+2)===62?3:2,this.input.charCodeAt(this.pos+i)===61?this.finishOp(h.assign,i+1):this.finishOp(h.bitShift,i)):e===33&&t===60&&!this.inModule&&this.input.charCodeAt(this.pos+2)===45&&this.input.charCodeAt(this.pos+3)===45?(this.skipLineComment(4),this.skipSpace(),this.nextToken()):(e===61&&(i=2),this.finishOp(h.relational,i))};W.readToken_eq_excl=function(t){var e=this.input.charCodeAt(this.pos+1);return e===61?this.finishOp(h.equality,this.input.charCodeAt(this.pos+2)===61?3:2):t===61&&e===62&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(h.arrow)):this.finishOp(t===61?h.eq:h.prefix,1)};W.readToken_question=function(){var t=this.options.ecmaVersion;if(t>=11){var e=this.input.charCodeAt(this.pos+1);if(e===46){var i=this.input.charCodeAt(this.pos+2);if(i<48||i>57)return this.finishOp(h.questionDot,2)}if(e===63){if(t>=12){var s=this.input.charCodeAt(this.pos+2);if(s===61)return this.finishOp(h.assign,3)}return this.finishOp(h.coalesce,2)}}return this.finishOp(h.question,1)};W.readToken_numberSign=function(){var t=this.options.ecmaVersion,e=35;if(t>=13&&(++this.pos,e=this.fullCharCodeAtPos(),ai(e,!0)||e===92))return this.finishToken(h.privateId,this.readWord1());this.raise(this.pos,"Unexpected character '"+ji(e)+"'")};W.getTokenFromCode=function(t){switch(t){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(h.parenL);case 41:return++this.pos,this.finishToken(h.parenR);case 59:return++this.pos,this.finishToken(h.semi);case 44:return++this.pos,this.finishToken(h.comma);case 91:return++this.pos,this.finishToken(h.bracketL);case 93:return++this.pos,this.finishToken(h.bracketR);case 123:return++this.pos,this.finishToken(h.braceL);case 125:return++this.pos,this.finishToken(h.braceR);case 58:return++this.pos,this.finishToken(h.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(h.backQuote);case 48:var e=this.input.charCodeAt(this.pos+1);if(e===120||e===88)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(e===111||e===79)return this.readRadixNumber(8);if(e===98||e===66)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(t);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(t);case 124:case 38:return this.readToken_pipe_amp(t);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(t);case 60:case 62:return this.readToken_lt_gt(t);case 61:case 33:return this.readToken_eq_excl(t);case 63:return this.readToken_question();case 126:return this.finishOp(h.prefix,1);case 35:return this.readToken_numberSign()}this.raise(this.pos,"Unexpected character '"+ji(t)+"'")};W.finishOp=function(t,e){var i=this.input.slice(this.pos,this.pos+e);return this.pos+=e,this.finishToken(t,i)};W.readRegexp=function(){for(var t,e,i=this.pos;;){this.pos>=this.input.length&&this.raise(i,"Unterminated regular expression");var s=this.input.charAt(this.pos);if(at.test(s)&&this.raise(i,"Unterminated regular expression"),t)t=!1;else{if(s==="[")e=!0;else if(s==="]"&&e)e=!1;else if(s==="/"&&!e)break;t=s==="\\"}++this.pos}var o=this.input.slice(i,this.pos);++this.pos;var a=this.pos,l=this.readWord1();this.containsEsc&&this.unexpected(a);var f=this.regexpState||(this.regexpState=new Gt(this));f.reset(i,o,l),this.validateRegExpFlags(f),this.validateRegExpPattern(f);var m=null;try{m=new RegExp(o,l)}catch{}return this.finishToken(h.regexp,{pattern:o,flags:l,value:m})};W.readInt=function(t,e,i){for(var s=this.options.ecmaVersion>=12&&e===void 0,o=i&&this.input.charCodeAt(this.pos)===48,a=this.pos,l=0,f=0,m=0,x=e==null?1/0:e;m=97?b=_-97+10:_>=65?b=_-65+10:_>=48&&_<=57?b=_-48:b=1/0,b>=t)break;f=_,l=l*t+b}return s&&f===95&&this.raiseRecoverable(this.pos-1,"Numeric separator is not allowed at the last of digits"),this.pos===a||e!=null&&this.pos-a!==e?null:l};function fC(t,e){return e?parseInt(t,8):parseFloat(t.replace(/_/g,""))}r(fC,"stringToNumber");function JE(t){return typeof BigInt!="function"?null:BigInt(t.replace(/_/g,""))}r(JE,"stringToBigInt");W.readRadixNumber=function(t){var e=this.pos;this.pos+=2;var i=this.readInt(t);return i==null&&this.raise(this.start+2,"Expected number in radix "+t),this.options.ecmaVersion>=11&&this.input.charCodeAt(this.pos)===110?(i=JE(this.input.slice(e,this.pos)),++this.pos):ai(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(h.num,i)};W.readNumber=function(t){var e=this.pos;!t&&this.readInt(10,void 0,!0)===null&&this.raise(e,"Invalid number");var i=this.pos-e>=2&&this.input.charCodeAt(e)===48;i&&this.strict&&this.raise(e,"Invalid number");var s=this.input.charCodeAt(this.pos);if(!i&&!t&&this.options.ecmaVersion>=11&&s===110){var o=JE(this.input.slice(e,this.pos));return++this.pos,ai(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(h.num,o)}i&&/[89]/.test(this.input.slice(e,this.pos))&&(i=!1),s===46&&!i&&(++this.pos,this.readInt(10),s=this.input.charCodeAt(this.pos)),(s===69||s===101)&&!i&&(s=this.input.charCodeAt(++this.pos),(s===43||s===45)&&++this.pos,this.readInt(10)===null&&this.raise(e,"Invalid number")),ai(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");var a=fC(this.input.slice(e,this.pos),i);return this.finishToken(h.num,a)};W.readCodePoint=function(){var t=this.input.charCodeAt(this.pos),e;if(t===123){this.options.ecmaVersion<6&&this.unexpected();var i=++this.pos;e=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,e>1114111&&this.invalidStringToken(i,"Code point out of bounds")}else e=this.readHexChar(4);return e};W.readString=function(t){for(var e="",i=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");var s=this.input.charCodeAt(this.pos);if(s===t)break;s===92?(e+=this.input.slice(i,this.pos),e+=this.readEscapedChar(!1),i=this.pos):s===8232||s===8233?(this.options.ecmaVersion<10&&this.raise(this.start,"Unterminated string constant"),++this.pos,this.options.locations&&(this.curLine++,this.lineStart=this.pos)):(Ws(s)&&this.raise(this.start,"Unterminated string constant"),++this.pos)}return e+=this.input.slice(i,this.pos++),this.finishToken(h.string,e)};var ZE={};W.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(t){if(t===ZE)this.readInvalidTemplateToken();else throw t}this.inTemplateElement=!1};W.invalidStringToken=function(t,e){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw ZE;this.raise(t,e)};W.readTmplToken=function(){for(var t="",e=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated template");var i=this.input.charCodeAt(this.pos);if(i===96||i===36&&this.input.charCodeAt(this.pos+1)===123)return this.pos===this.start&&(this.type===h.template||this.type===h.invalidTemplate)?i===36?(this.pos+=2,this.finishToken(h.dollarBraceL)):(++this.pos,this.finishToken(h.backQuote)):(t+=this.input.slice(e,this.pos),this.finishToken(h.template,t));if(i===92)t+=this.input.slice(e,this.pos),t+=this.readEscapedChar(!0),e=this.pos;else if(Ws(i)){switch(t+=this.input.slice(e,this.pos),++this.pos,i){case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:t+=` +`;break;default:t+=String.fromCharCode(i);break}this.options.locations&&(++this.curLine,this.lineStart=this.pos),e=this.pos}else++this.pos}};W.readInvalidTemplateToken=function(){for(;this.pos=48&&e<=55){var n=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],r=parseInt(n,8);return r>255&&(n=n.slice(0,-1),r=parseInt(n,8)),this.pos+=n.length-1,e=this.input.charCodeAt(this.pos),(n!=="0"||e===56||e===57)&&(this.strict||t)&&this.invalidStringToken(this.pos-1-n.length,t?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(r)}return Oo(e)?(this.options.locations&&(this.lineStart=this.pos,++this.curLine),""):String.fromCharCode(e)}};ee.readHexChar=function(t){var e=this.pos,i=this.readInt(16,t);return i===null&&this.invalidStringToken(e,"Bad character escape sequence"),i};ee.readWord1=function(){this.containsEsc=!1;for(var t="",e=!0,i=this.pos,n=this.options.ecmaVersion>=6;this.pos{let r=e[n]instanceof u;return!r&&typeof e[n]=="object"?JSON.stringify(t[n])===JSON.stringify(e[n]):t[n]===(r?e[n].toString():e[n])})}o(Yf,"deepCompare");function Fe(t,e,i){let n=new RegExp(`${d0(e)}(.*?)${d0(i)}`,"s"),r=t.match(n);return r?r[1]:void 0}o(Fe,"getStringBetweenStrings");function d0(t){return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}o(d0,"escapeStringRegexp");function Gi(t){let e=O1[t],i=Math.floor(Math.random()*e.length);return e[i]}o(Gi,"getRandomUserAgent");function tS(t){return T(this,void 0,void 0,function*(){let e="https://www.youtube.com",i=Math.floor(new Date().getTime()/1e3),n=[i,t,e].join(" "),r=yield W.shim.sha1Hash(n);return["SAPISIDHASH",[i,r].join("_")].join(" ")})}o(tS,"generateSidAuth");function Fi(t){let e=[],i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";for(let n=0;nparseInt(i.replace(/\D/g,"")));switch(e.length){case 1:return e[0];case 2:return e[0]*60+e[1];case 3:return e[0]*3600+e[1]*60+e[2];default:throw new Error("Invalid time string")}}o(ke,"timeToSeconds");function Hx(...t){let e=new ti;for(let i of t)if(!!i)for(let n of i){let r=e.get(n[0]);if(r){e.set(n[0],[...r,...n[1]]);continue}e.set(...n)}return e}o(Hx,"concatMemos");function Uo(t){for(let[e,i]of Object.entries(t))if(!i)throw new Bf(`${e} is missing`)}o(Uo,"throwIfMissing");function iS(t,...e){for(let i of e)if(!Reflect.has(t,i)||t[i]===void 0)return!1;return!0}o(iS,"hasKeys");function fx(t){return F0(this,arguments,o(function*(){let i=t.getReader();try{for(;;){let{done:n,value:r}=yield Ui(i.read());if(n)return yield Ui(void 0);yield yield Ui(r)}}finally{i.releaseLock()}},"streamToIterable_1"))}o(fx,"streamToIterable");var nS=o((t,e)=>{let i=typeof t=="string"?new URL(t):t instanceof URL?t:new URL(t.url),n=e!=null&&e.headers?new Headers(e.headers):t instanceof Request?t.headers:new Headers,r=[...n],a=e!=null&&e.body?typeof e.body=="string"?n.get("content-type")==="application/json"?JSON.stringify(JSON.parse(e.body),null,2):e.body:" ":" (none)",c=r.length>0?`${r.map(([p,d])=>` ${p}: ${d}`).join(` -`)}`:" (none)";return j.warn(eS,`Fetch: +`:case"\u2028":case"\u2029":++this.curLine,this.lineStart=this.pos+1;break}this.raise(this.start,"Unterminated template")};W.readEscapedChar=function(t){var e=this.input.charCodeAt(++this.pos);switch(++this.pos,e){case 110:return` +`;case 114:return"\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return ji(this.readCodePoint());case 116:return" ";case 98:return"\b";case 118:return"\v";case 102:return"\f";case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:return this.options.locations&&(this.lineStart=this.pos,++this.curLine),"";case 56:case 57:if(this.strict&&this.invalidStringToken(this.pos-1,"Invalid escape sequence"),t){var i=this.pos-1;this.invalidStringToken(i,"Invalid escape sequence in template string")}default:if(e>=48&&e<=55){var s=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],o=parseInt(s,8);return o>255&&(s=s.slice(0,-1),o=parseInt(s,8)),this.pos+=s.length-1,e=this.input.charCodeAt(this.pos),(s!=="0"||e===56||e===57)&&(this.strict||t)&&this.invalidStringToken(this.pos-1-s.length,t?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(o)}return Ws(e)?(this.options.locations&&(this.lineStart=this.pos,++this.curLine),""):String.fromCharCode(e)}};W.readHexChar=function(t){var e=this.pos,i=this.readInt(16,t);return i===null&&this.invalidStringToken(e,"Bad character escape sequence"),i};W.readWord1=function(){this.containsEsc=!1;for(var t="",e=!0,i=this.pos,s=this.options.ecmaVersion>=6;this.pos{let o=e[s]instanceof p;return!o&&typeof e[s]=="object"?JSON.stringify(t[s])===JSON.stringify(e[s]):t[s]===(o?e[s].toString():e[s])})}r(pd,"deepCompare");function Ee(t,e,i){let s=new RegExp(`${uw(e)}(.*?)${uw(i)}`,"s"),o=t.match(s);return o?o[1]:void 0}r(Ee,"getStringBetweenStrings");function uw(t){return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}r(uw,"escapeStringRegexp");function Zi(t){let e=tk[t],i=Math.floor(Math.random()*e.length);return e[i]}r(Zi,"getRandomUserAgent");async function dC(t){let e="https://www.youtube.com",i=Math.floor(new Date().getTime()/1e3),s=[i,t,e].join(" "),o=await M.shim.sha1Hash(s);return["SAPISIDHASH",[i,o].join("_")].join(" ")}r(dC,"generateSidAuth");function $i(t){let e=[],i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";for(let s=0;sparseInt(i.replace(/\D/g,"")));switch(e.length){case 1:return e[0];case 2:return e[0]*60+e[1];case 3:return e[0]*3600+e[1]*60+e[2];default:throw new Error("Invalid time string")}}r(_e,"timeToSeconds");function jg(...t){let e=new ui;for(let i of t)if(!!i)for(let s of i){let o=e.get(s[0]);if(o){e.set(s[0],[...o,...s[1]]);continue}e.set(...s)}return e}r(jg,"concatMemos");function Hs(t){for(let[e,i]of Object.entries(t))if(!i)throw new td(`${e} is missing`)}r(Hs,"throwIfMissing");function _C(t,...e){for(let i of e)if(!Reflect.has(t,i)||t[i]===void 0)return!1;return!0}r(_C,"hasKeys");async function*jb(t){let e=t.getReader();try{for(;;){let{done:i,value:s}=await e.read();if(i)return;yield s}}finally{e.releaseLock()}}r(jb,"streamToIterable");var xC=r((t,e)=>{let i=typeof t=="string"?new URL(t):t instanceof URL?t:new URL(t.url),s=e!=null&&e.headers?new Headers(e.headers):t instanceof Request?t.headers:new Headers,o=[...s],a=e!=null&&e.body?typeof e.body=="string"?s.get("content-type")==="application/json"?JSON.stringify(JSON.parse(e.body),null,2):e.body:" ":" (none)",l=o.length>0?`${o.map(([f,m])=>` ${f}: ${m}`).join(` +`)}`:" (none)";return Ht(hC,`Fetch: url: ${i.toString()} method: ${(e==null?void 0:e.method)||"GET"} headers: -${c} +${l} ' + ' body: -${a}`),W.shim.fetch(t,e)},"debugFetch");function Ge(t){return btoa(String.fromCharCode.apply(null,Array.from(t)))}o(Ge,"u8ToBase64");function Px(t){return new Uint8Array(atob(t).split("").map(e=>e.charCodeAt(0)))}o(Px,"base64ToU8");function je(t){return!("emoji"in t)}o(je,"isTextRun");function oS(t,e,i=!1){let n=i?`(^|\\s?)\\b${e}\\b=([^;]+)`:`(^|s?)${e}=([^;]+)`,r=t.match(new RegExp(n));return r?r[2]:void 0}o(oS,"getCookie");function f0(t,e){let{name:i,includes:n,regexp:r}=e,c=[L1(t,{ecmaVersion:2020})];for(let p=0;p-1||r&&r.test(_))return{start:d.start,end:d.end,name:d.expression.left.name,node:d,result:_}}for(let _ in d){let f=d[_];Array.isArray(f)?c.push(...f):typeof f=="object"&&f!==null&&c.push(f)}}}o(f0,"findFunction");function m0(t){return T(this,void 0,void 0,function*(){let e=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"];function i(n){let r=new Uint8Array(n),a=[];for(let c=0;c{this.runnerFrame.addEventListener("load",()=>{r(),this.emit("ready")})}),this.timeout=null}load(){return T(this,void 0,void 0,function*(){return this.readyPromise})}on(e,i){var n;this.listeners.has(e)||this.listeners.set(e,[]),(n=this.listeners.get(e))===null||n===void 0||n.push(i)}off(e,i){var n;if(!this.listeners.has(e))return;let r=this.listeners.get(e),a=(n=r==null?void 0:r.indexOf(i))!==null&&n!==void 0?n:-1;a!==-1&&(r==null||r.splice(a,1))}emit(e,...i){var n;if(!this.listeners.has(e))return;let r=(n=this.listeners.get(e))!==null&&n!==void 0?n:[];for(let a of r)a(...i)}setTimeout(e){this.timeout&&clearTimeout(this.timeout),e&&(this.timeout=window.setTimeout(()=>{this.close()},e))}listener(e){var i;e.source===((i=this.runnerFrame)===null||i===void 0?void 0:i.contentWindow)&&(e.data.type==="sandboxResult"?this.emit("result",e.data.result):e.data.type==="sandboxError"&&this.emit("error",e.data.error))}close(){!this.runnerFrame||(this.runnerFrame.remove(),window.removeEventListener("message",this.listenerBind),this.timeout&&clearTimeout(this.timeout),this.emit("close"))}evaluate(e){return T(this,arguments,void 0,function*(i,n=[],r=[]){var a;return yield this.readyPromise,(a=this.runnerFrame.contentWindow)===null||a===void 0||a.postMessage({type:"sandboxEvaluate",body:i,argNames:n,argValues:r},"*"),new Promise((c,p)=>{let d=null,_=null,f=null,x=o(()=>{d&&this.off("result",d),_&&this.off("error",_),f&&this.off("close",f)},"cleanup");d=o(v=>{x(),c(v)},"resultHandler"),_=o(v=>{x(),p(v)},"errorHandler"),f=o(()=>{x(),p(new Error("SandboxedEvaluator closed"))},"closeHandler"),this.on("result",d),this.on("error",_),this.on("close",f)})})}static evaluateOnce(e,i,n,r){return T(this,arguments,void 0,function*(a,c,p,d,_=5e3){let f=new mt(a);_&&f.setTimeout(_);try{let x=yield f.evaluate(c,p,d);return f.close(),x}catch(x){throw f.close(),x}})}static extractFnBodyAndArgs(e){let i=e.substring(e.indexOf("{")+1,e.lastIndexOf("}")),n=e.substring(e.indexOf("(")+1,e.indexOf(")")).split(",").map(r=>r.trim());return{body:i,argNames:n}}static matchArgValues(e,i){return e.map(n=>{if(!!Object.hasOwn(i,n))return i[n]})}};o(mt,"SandboxedEvaluator");var j1="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36(KHTML, like Gecko)",He=class{static base64ToU8(e){let i={"-":"+",_:"/",".":"="},n;return/[-_.]/g.test(e)?n=e.replace(/[-_.]/g,a=>i[a]):n=e,n=atob(n),new Uint8Array([...n].map(a=>a.charCodeAt(0)))}static u8ToBase64(e,i=!1){let n=btoa(String.fromCharCode(...e));return i?n.replace(/\+/g,"-").replace(/\//g,"_"):n}static createChallenge(e,i,n,r){return T(this,void 0,void 0,function*(){let a=[i];n&&a.push(n);let c=yield e(He.b64ToBuf("BxMTDxLZzs4JDQ3MDwDNBg4OBgsEAA8IEs0CDgzOwxEPAs4GDg4GCwTNCA0TBBENAAvNFgAAzRXQzfYAAM7iEQQAEwQ="),{method:"POST",headers:{"Content-Type":"application/json+protobuf","User-Agent":j1,"x-goog-api-key":r,"x-user-agent":"grpc-web-javascript/0.1"},body:JSON.stringify(a)});if(!c.ok)throw new Error(`Failed to fetch: ${c.status}`);let p=yield c.json();if(p.length>1&&p[1]){let d=He.parseChallenge(p[1]);if(d)return d}})}static b64ToBuf(e){let i=He.base64ToU8(e);return i.length?new TextDecoder().decode(i.map(n=>n+97)):""}static stringToB64(e){let i=new TextEncoder().encode(e);return i=i.map(n=>n-97),He.u8ToBase64(i)}static parseChallenge(e){let i=He.b64ToBuf(e);if(i.length){let[n,r,,a,c,p]=JSON.parse(i);return{script:r,interpreterHash:a,globalName:p,challenge:c,messageId:n}}}static getFn1(){let e='(n){return(async()=>{const r=window[n.globalName];if(!r)throw new Error("V not found");const o={fn1:null,fn2:null,fn3:null,fn4:null};if(!r.a)throw new Error("Init failed");try{await r.a(n.challenge,(function(n,r,t,f){o.fn1=n,o.fn2=r,o.fn3=t,o.fn4=f}),!0,void 0,((...n)=>{}))}catch(n){throw new Error("Failed to load")}if(!o.fn1)throw new Error("fn1 unavailable.");let t=null;const f=[];if(await o.fn1((n=>{t=n}),[,,f]),!t)throw new Error("[BG]: No response");if(!f.length)throw new Error("No ppf");return window.ppf=f,t})()}';return mt.extractFnBodyAndArgs(e)}static getFn2(){let e='(r,e){const t=window.ppf[0];if(!t)throw new Error("PP:Undefined");return(async()=>{const n=await t((r=>{const e={"-":"+",_:"/",".":"="};let t;return t=/[-_.]/g.test(r)?r.replace(/[-_.]/g,(r=>e[r])):r,t=atob(t),new Uint8Array([...t].map((r=>r.charCodeAt(0))))})(r));if("function"!=typeof n)throw new Error("PP:failed");const o=((r,e=!1)=>{const t=btoa(String.fromCharCode(...r));return e?t.replace(/\\+/g,"-").replace(/\\//g,"_"):t})(await n((new TextEncoder).encode(e)),!0);if(o.length>80)return o;throw new Error("PT too small")})()}';return mt.extractFnBodyAndArgs(e.toString())}static getPot(){return T(this,arguments,void 0,function*(e=W.shim.fetch,i,n,r,a,c=!1){r||(r=He.b64ToBuf("7tPSGc8DDwkHBvfRz/LiF9Pq4A4=")),a||(a=He.b64ToBuf("4OgZAPIY4xjz1PbP6QfT2OXSz+8QEBMYBQMF1g/j6+Xq6+kO4A0W")),n||(n=Ct.encodeVisitorData(Go.generateRandomString(11),Math.floor(Date.now()/1e3)));let p=new mt(i),d=null,_=null,f=null;try{c||p.setTimeout(5e3),yield p.load(),c||p.setTimeout(null);let x=yield He.createChallenge(e,r,null,a);if(!x)throw new Error("C is incorrect");if(!x.script)throw new Error("CS is bad");let v=x.script.find($=>$!==null);if(!v)throw new Error("CS is null");c||p.setTimeout(5e3),yield p.evaluate(v,[],[]),c||p.setTimeout(5e3);let w=this.getFn1(),k=yield p.evaluate(w.body,w.argNames,[x]);c||p.setTimeout(null);let S=[r,k],P=yield e(He.b64ToBuf("BxMTDxLZzs4JDQ3MDwDNBg4OBgsEAA8IEs0CDgzOwxEPAs4GDg4GCwTNCA0TBBENAAvNFgAAzRXQzfYAAM7mBA0EEQATBOjz"),{method:"POST",headers:{"Content-Type":"application/json+protobuf","x-goog-api-key":a,"x-user-agent":"grpc-web-javascript/0.1","User-Agent":j1,Accept:"*/*"},body:JSON.stringify(S)});if(!P.ok)throw new Error("It failed");let A=yield P.json();if(!A.length||!A[0])throw new Error("It none");let M=A[0];_=A[1],f=A[2],c||p.setTimeout(5e3);let B=this.getFn2();d=yield p.evaluate(B.body,B.argNames,[M,n]),c||p.close()}catch(x){throw c||p.close(),x}return{pot:d,vd:n,requestToken:r,ttl:_,refresh:f}})}};o(He,"BGUtils");var kn,J1,H1,z1,W1,ix;(function(t){t.WEB="WEB",t.KIDS="WEB_KIDS",t.MUSIC="WEB_REMIX",t.IOS="iOS",t.ANDROID="ANDROID",t.ANDROID_MUSIC="ANDROID_MUSIC",t.ANDROID_CREATOR="ANDROID_CREATOR",t.TV_EMBEDDED="TVHTML5_SIMPLY_EMBEDDED_PLAYER"})(ix||(ix={}));var In="Session",Of=class extends Wo{constructor(e,i,n,r,a,c,p,d,_){super(),this.http=new _x(this,c,p),this.actions=new h0(this),this.logged_in=!!c,this.cache=d,this.account_index=r,this.key=i,this.api_version=n,this.context=e,this.player=a,this.po_token=_}on(e,i){super.on(e,i)}once(e,i){super.once(e,i)}static create(e){return T(this,void 0,void 0,function*(){let i=e.runner_location;if(e.client_type===ix.WEB){let d=localStorage.getItem("yt_tkn"),_,f,x=0,v=0;if(d){let w=JSON.parse(d);w.length>0&&(_=w[0],f=w[1],x=w[2],v=w[3])}if(!_||!f||!x||!v||v+x*1e3T(this,void 0,void 0,function*(){let f=`${d}|${JSON.stringify(_)}`,x=n.get(f);if(x)return yield x;let v=mt.extractFnBodyAndArgs(d),w=mt.evaluateOnce(i,v.body,v.argNames,Object.values(_));n.set(f,w);try{return yield w}catch(k){console.error("Failed to fetch params"),console.error(k)}});let{context:r,api_key:a,api_version:c,account_index:p}=yield kn.getSessionData(e.lang,e.location,e.account_index,e.visitor_data,e.enable_safety_mode,e.generate_session_locally,e.device_category,e.client_type,e.timezone,e.fetch,e.on_behalf_of_user,e.cache,e.enable_session_cache,e.po_token);return new kn(r,a,c,p,e.retrieve_player===!1?void 0:yield Xe.create(e.cache,e.evaluator,e.fetch,e.po_token),e.cookie,e.fetch,e.cache,e.po_token)})}static fromCache(e,i){return T(this,void 0,void 0,function*(){let n=yield e.get("innertube_session_data");if(!n)return null;let r=new TextDecoder().decode(n.slice(4));try{let a=JSON.parse(_t.decompress(r));return i.visitor_data&&(a.context.client.visitorData=i.visitor_data),i.lang&&(a.context.client.hl=i.lang),i.location&&(a.context.client.gl=i.location),i.on_behalf_of_user&&(a.context.user.onBehalfOfUser=i.on_behalf_of_user),a.context.client.timeZone=i.time_zone,a.context.client.platform=i.device_category.toUpperCase(),a.context.client.clientName=i.client_name,a.context.user.enableSafetyMode=i.enable_safety_mode,a}catch(a){return j.error(In,"Failed to parse session data from cache.",a),null}})}static getSessionData(){return T(this,arguments,void 0,function*(e="",i="",n=0,r="",a=!1,c=!1,p="desktop",d=ix.WEB,_=Intl.DateTimeFormat().resolvedOptions().timeZone,f=W.shim.fetch,x,v,w=!0,k){let S={lang:e,location:i,time_zone:_,device_category:p,client_name:d,enable_safety_mode:a,visitor_data:r,on_behalf_of_user:x,po_token:k},P;if(v&&w){let A=yield this.fromCache(v,S);A&&(j.info(In,"Found session data in cache."),P=A)}if(!P){j.info(In,"Generating session data.");let A=re.WEB.API_KEY,M=re.WEB.API_VERSION,B={hl:e||"en",gl:i||"US",remote_host:"",visitor_data:r||kx(Fi(11),Math.floor(Date.now()/1e3)),client_name:d,client_version:re.WEB.VERSION,device_category:p.toUpperCase(),os_name:"Windows",os_version:"10.0",time_zone:_,browser_name:"Chrome",browser_version:"125.0.0.0",device_make:"",device_model:"",enable_safety_mode:a};if(!c)try{let $=yield m(this,kn,"m",H1).call(this,S,f);A=$.api_key,M=$.api_version,B=$.context_data}catch($){j.error(In,"Failed to retrieve session data from server. Session data generated locally will be used instead.",$)}P={api_key:A,api_version:M,context:m(this,kn,"m",z1).call(this,B)},w&&(yield m(this,kn,"m",J1).call(this,P,v))}return j.debug(In,"Session data:",P),Object.assign(Object.assign({},P),{account_index:n})})}get client_version(){return this.context.client.clientVersion}get client_name(){return this.context.client.clientName}get lang(){return this.context.client.hl}};o(Of,"Session");kn=Of,J1=o(function(e,i){return T(this,void 0,void 0,function*(){if(!i)return;j.info(In,"Compressing and caching session data.");let n=new TextEncoder().encode(_t.compress(JSON.stringify(e))),r=new ArrayBuffer(4+n.byteLength);new DataView(r).setUint32(0,n.byteLength,!0),new Uint8Array(r).set(n,4),yield i.set("innertube_session_data",new Uint8Array(r))})},"_Session_storeSession"),H1=o(function(e){return T(this,arguments,void 0,function*(i,n=W.shim.fetch){let r=Fi(11);i.visitor_data&&(r=m(this,kn,"m",W1).call(this,i.visitor_data));let a=new URL("/sw.js_data",et.YT_BASE),c=yield n(a,{headers:{"Accept-Language":i.lang||"en-US","User-Agent":Gi("desktop"),Accept:"*/*",Referer:`${et.YT_BASE}/sw.js`,Cookie:`PREF=tz=${i.time_zone.replace("/",".")};VISITOR_INFO1_LIVE=${r};`}});if(!c.ok)throw new Tn(`Failed to retrieve session data: ${c.status}`);let p=yield c.text();if(!p.startsWith(")]}'"))throw new Tn("Invalid JSPB response");let _=JSON.parse(p.replace(/^\)\]\}'/,""))[0][2],f=re.WEB.API_VERSION,[[x],v]=_,w=x[61],k=w[w.length-1];return{context_data:{hl:i.lang||x[0],gl:i.location||x[2],remote_host:x[3],visitor_data:i.visitor_data||x[13],client_name:i.client_name,client_version:x[16],os_name:x[17],os_version:x[18],time_zone:x[79]||i.time_zone,device_category:i.device_category,browser_name:x[86],browser_version:x[87],device_make:x[11],device_model:x[12],app_install_data:k,enable_safety_mode:i.enable_safety_mode},api_key:v,api_version:f}})},"_Session_getSessionData"),z1=o(function(e){let i={client:{hl:e.hl,gl:e.gl,remoteHost:e.remote_host,screenDensityFloat:1,screenHeightPoints:1440,screenPixelDensity:1,screenWidthPoints:2560,visitorData:e.visitor_data,clientName:e.client_name,clientVersion:e.client_version,osName:e.os_name,osVersion:e.os_version,platform:e.device_category.toUpperCase(),clientFormFactor:"UNKNOWN_FORM_FACTOR",userInterfaceTheme:"USER_INTERFACE_THEME_LIGHT",timeZone:e.time_zone,originalUrl:et.YT_BASE,deviceMake:e.device_make,deviceModel:e.device_model,browserName:e.browser_name,browserVersion:e.browser_version,utcOffsetMinutes:-Math.floor(new Date().getTimezoneOffset()),memoryTotalKbytes:"8000000",mainAppWebInfo:{graftUrl:et.YT_BASE,pwaInstallabilityStatus:"PWA_INSTALLABILITY_STATUS_UNKNOWN",webDisplayMode:"WEB_DISPLAY_MODE_BROWSER",isWebNativeShareAvailable:!0}},user:{enableSafetyMode:e.enable_safety_mode,lockedSafetyMode:!1},request:{useSsl:!0,internalExperimentFlags:[]}};return e.app_install_data&&(i.client.configInfo={appInstallData:e.app_install_data}),e.on_behalf_of_user&&(i.user.onBehalfOfUser=e.on_behalf_of_user),i},"_Session_buildContext"),W1=o(function(e){return Sx(e).id},"_Session_getVisitorID");var _0=Of;var g0={};ye(g0,{BrowseEndpoint:()=>Sn,NextEndpoint:()=>Yi,PlayerEndpoint:()=>ei,Reel:()=>ht});var Sn={};ye(Sn,{PATH:()=>rS,build:()=>sS});var rS="/browse";function sS(t){return Object.assign({browseId:t.browse_id,params:t.params,continuation:t.continuation,client:t.client})}o(sS,"build");var Yi={};ye(Yi,{PATH:()=>aS,build:()=>uS});var aS="/next";function uS(t){return Object.assign({videoId:t.video_id,playlistId:t.playlist_id,params:t.params,playlistIndex:t.playlist_index,client:t.client,continuation:t.continuation})}o(uS,"build");var ei={};ye(ei,{PATH:()=>lS,build:()=>cS});var lS="/player";function cS(t){let e={playbackContext:{contentPlaybackContext:Object.assign({vis:0,splay:!1,referer:t.playlist_id?`https://www.youtube.com/watch?v=${t.video_id}&list=${t.playlist_id}`:`https://www.youtube.com/watch?v=${t.video_id}`,currentUrl:t.playlist_id?`/watch?v=${t.video_id}&list=${t.playlist_id}`:`/watch?v=${t.video_id}`,autonavState:"STATE_ON",autoCaptionsDefaultOn:!1,html5Preference:"HTML5_PREF_WANTS",lactMilliseconds:"-1"},{signatureTimestamp:t.sts})},attestationRequest:{omitBotguardData:!0},racyCheckOk:!0,contentCheckOk:!0,videoId:t.video_id};return t.client&&(e.client=t.client),t.playlist_id&&(e.playlistId=t.playlist_id),t.params&&(e.params=t.params),t.po_token&&(e.serviceIntegrityDimensions={poToken:t.po_token}),e}o(cS,"build");var ht={};ye(ht,{ReelItemWatchEndpoint:()=>nx,ReelWatchSequenceEndpoint:()=>ox});var nx={};ye(nx,{PATH:()=>pS,build:()=>dS});var pS="/reel/reel_item_watch";function dS(t){var e,i;return{disablePlayerResponse:!1,playerRequest:{videoId:t.video_id,params:(e=t.params)!==null&&e!==void 0?e:"CAUwAg%3D%3D"},params:(i=t.params)!==null&&i!==void 0?i:"CAUwAg%3D%3D",client:t.client}}o(dS,"build");var ox={};ye(ox,{PATH:()=>fS,build:()=>mS});var fS="/reel/reel_watch_sequence";function mS(t){return{sequenceParams:t.sequence_params}}o(mS,"build");var Cn,rx=class extends Io{constructor(e,i,n,r){var a;if(super(e,i,n),Cn.set(this,void 0),r){let c=l.parseResponse(r.data);c.entries&&(this.watch_next_feed=c.entries),c.continuation_endpoint&&E(this,Cn,(a=c.continuation_endpoint)===null||a===void 0?void 0:a.as(Ht),"f")}}getWatchNextContinuation(){return T(this,void 0,void 0,function*(){var e;if(!m(this,Cn,"f"))throw new b("Continuation not found");let i=yield this.actions.execute(ht.ReelWatchSequenceEndpoint.PATH,Object.assign(Object.assign({},ht.ReelWatchSequenceEndpoint.build({sequence_params:m(this,Cn,"f").token})),{parse:!0}));return i.entries&&(this.watch_next_feed=i.entries),E(this,Cn,(e=i.continuation_endpoint)===null||e===void 0?void 0:e.as(Ht),"f"),this})}get wn_has_continuation(){return!!m(this,Cn,"f")}};o(rx,"ShortFormVideoInfo");Cn=new WeakMap;var x0=rx;var Yt,jo=class{constructor(e){Yt.set(this,void 0),E(this,Yt,e,"f")}static create(e){return T(this,void 0,void 0,function*(){return new jo(yield _0.create(e))})}getInfo(e,i){return T(this,void 0,void 0,function*(){var n,r,a,c,p;Uo({target:e});let d;if(e instanceof g)d=Yi.build({video_id:(n=e.payload)===null||n===void 0?void 0:n.videoId,playlist_id:(r=e.payload)===null||r===void 0?void 0:r.playlistId,params:(a=e.payload)===null||a===void 0?void 0:a.params,playlist_index:(c=e.payload)===null||c===void 0?void 0:c.index});else if(typeof e=="string")d=Yi.build({video_id:e});else throw new b("Invalid target. Expected a video id or NavigationEndpoint.",e);if(!d.videoId)throw new b("Video id cannot be empty",d);let _=ei.build({video_id:d.videoId,playlist_id:d==null?void 0:d.playlistId,client:i,sts:(p=m(this,Yt,"f").player)===null||p===void 0?void 0:p.sts,po_token:m(this,Yt,"f").po_token}),f=this.actions.execute(ei.PATH,_),x=this.actions.execute(Yi.PATH,d),v=yield Promise.all([f,x]),w=Fi(16);return new Ef(v,this.actions,w)})}getBasicInfo(e,i){return T(this,void 0,void 0,function*(){var n;Uo({video_id:e});let r=yield this.actions.execute(ei.PATH,ei.build({video_id:e,client:i,sts:(n=m(this,Yt,"f").player)===null||n===void 0?void 0:n.sts,po_token:m(this,Yt,"f").po_token})),a=Fi(16);return new Ef([r],this.actions,a)})}getShortsVideoInfo(e,i){return T(this,void 0,void 0,function*(){Uo({video_id:e});let n=this.actions.execute(ht.ReelItemWatchEndpoint.PATH,ht.ReelItemWatchEndpoint.build({video_id:e,client:i})),r=this.actions.execute(ht.ReelWatchSequenceEndpoint.PATH,ht.ReelWatchSequenceEndpoint.build({sequence_params:Ex(e)})),a=yield Promise.all([n,r]),c=Fi(16);return new x0([a[0]],this.actions,c,a[1])})}getPlaylist(e){return T(this,void 0,void 0,function*(){Uo({id:e}),e.startsWith("VL")||(e=`VL${e}`);let i=yield this.actions.execute(Sn.PATH,Sn.build({browse_id:e}));return new No(this.actions,i)})}getStreamingData(e){return T(this,arguments,void 0,function*(i,n={}){let a=(yield this.getBasicInfo(i)).chooseFormat(n);return a.url=yield a.decipher(m(this,Yt,"f").player),a})}download(e,i){return T(this,void 0,void 0,function*(){return(yield this.getBasicInfo(e,i==null?void 0:i.client)).download(i)})}call(e,i){return e.call(this.actions,i)}get actions(){return m(this,Yt,"f").actions}get session(){return m(this,Yt,"f")}};o(jo,"Innertube");Yt=new WeakMap;var v0=jo;var G1={};var $1=v0;var Ff,y0,sx,ax,ux,lx=class{constructor(e=!1,i){Ff.add(this),y0.set(this,"Cache"),sx.set(this,void 0),ax.set(this,void 0),E(this,sx,i||"","f"),E(this,ax,e,"f")}get cache_dir(){return m(this,ax,"f")?m(this,sx,"f"):""}get(e){return T(this,void 0,void 0,function*(){let i=yield m(this,Ff,"m",ux).call(this);if(!!i)return new Promise((n,r)=>{let a=i.transaction("kv-store","readonly").objectStore("kv-store").get(e);a.onerror=r,a.onsuccess=function(){var c;let p=(c=this.result)===null||c===void 0?void 0:c.v;p instanceof ArrayBuffer?n(p):ArrayBuffer.isView(p)?n(p.buffer):n(void 0)}})})}set(e,i){return T(this,void 0,void 0,function*(){let n=yield m(this,Ff,"m",ux).call(this);if(!!n)return new Promise((r,a)=>{let c=n.transaction("kv-store","readwrite").objectStore("kv-store").put({k:e,v:i});c.onerror=a,c.onsuccess=()=>r()})})}remove(e){return T(this,void 0,void 0,function*(){let i=yield m(this,Ff,"m",ux).call(this);if(!!i)return new Promise((n,r)=>{let a=i.transaction("kv-store","readwrite").objectStore("kv-store").delete(e);a.onerror=r,a.onsuccess=()=>n()})})}};o(lx,"Cache");y0=new WeakMap,sx=new WeakMap,ax=new WeakMap,Ff=new WeakSet,ux=o(function(){let e=Reflect.get(globalThis,"indexedDB")||Reflect.get(globalThis,"webkitIndexedDB")||Reflect.get(globalThis,"mozIndexedDB")||Reflect.get(globalThis,"msIndexedDB");return e?new Promise((i,n)=>{let r=e.open("youtubei.js",1);r.onsuccess=function(){i(this.result)},r.onerror=function(a){n("indexedDB request error"),console.error(a)},r.onupgradeneeded=function(){let a=this.result.createObjectStore("kv-store",{keyPath:"k"});a.transaction.oncomplete=function(){i(this.db)}}}):j.warn(m(this,y0,"f"),"IndexedDB is not supported. No cache will be used.")},"_Cache_getBrowserDB");W.load({runtime:"browser",server:!1,info:{version:"10.3.0",bugs_url:"https://github.com/LuanRT/YouTube.js/issues",repo_url:"https://github.com/LuanRT/YouTube.js"},Cache:lx,sha1Hash:m0,uuidv4(){var t;return!((t=globalThis.crypto)===null||t===void 0)&&t.randomUUID()?globalThis.crypto.randomUUID():"10000000-1000-4000-8000-100000000000".replace(/[018]/g,e=>{let i=parseInt(e);return(i^window.crypto.getRandomValues(new Uint8Array(1))[0]&15>>i/4).toString(16)})},fetch:globalThis.fetch,Request:globalThis.Request,Response:globalThis.Response,Headers:globalThis.Headers,FormData:globalThis.FormData,File:globalThis.File,ReadableStream:globalThis.ReadableStream,CustomEvent:globalThis.CustomEvent});var Ywe=$1;export{KT as APIResponseTypes,h0 as Actions,Ki as AppendContinuationItemsAction,ix as ClientType,ge as Constants,ln as Continuation,Ht as ContinuationCommand,g0 as Endpoints,Wo as EventEmitter,zi as FormatUtils,Ox as Generator,vo as GridContinuation,_x as HTTPClient,dx as Helpers,v0 as Innertube,mo as ItemSectionContinuation,_t as LZW,ki as LiveChatContinuation,j as Log,qx as Misc,zx as Mixins,go as MusicPlaylistShelfContinuation,xo as MusicShelfContinuation,Ti as NavigateAction,l as Parser,W as Platform,Xe as Player,yo as PlaylistPanelContinuation,Ct as Proto,Ii as ReloadContinuationItemsCommand,_o as SectionListContinuation,_0 as Session,ho as ShowMiniplayerCommand,G1 as Types,zo as UMP,Q1 as UniversalCache,Go as Utils,Kx as YT,on as YTNodes,Ywe as default}; \ No newline at end of file +${a}`),M.shim.fetch(t,e)},"debugFetch");function zt(t){return btoa(String.fromCharCode.apply(null,Array.from(t)))}r(zt,"u8ToBase64");function rg(t){let e=t.replace(/-/g,"+").replace(/_/g,"/"),i=e.padEnd(e.length+(4-e.length%4)%4,"=");return new Uint8Array(atob(i).split("").map(s=>s.charCodeAt(0)))}r(rg,"base64ToU8");function Oe(t){return!("emoji"in t)}r(Oe,"isTextRun");function yC(t,e,i=!1){let s=i?`(^|\\s?)\\b${e}\\b=([^;]+)`:`(^|s?)${e}=([^;]+)`,o=t.match(new RegExp(s));return o?o[2]:void 0}r(yC,"getCookie");function id(t,e){let{name:i,includes:s,regexp:o}=e,l=[ek(t,{ecmaVersion:2020})];for(let f=0;f-1||o&&o.test(x))return{start:m.start,end:m.end,name:m.expression.left.name,node:m,result:x}}for(let x in m){let _=m[x];Array.isArray(_)?l.push(..._):typeof _=="object"&&_!==null&&l.push(_)}}}r(id,"findFunction");async function fw(t){let e=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"];function i(s){let o=new Uint8Array(s),a=[];for(let l=0;l{this.runnerFrame.addEventListener("load",()=>{o(),this.emit("ready")})}),this.timeout=null}async load(){return this.readyPromise}on(e,i){var s;this.listeners.has(e)||this.listeners.set(e,[]),(s=this.listeners.get(e))==null||s.push(i)}off(e,i){var a;if(!this.listeners.has(e))return;let s=this.listeners.get(e),o=(a=s==null?void 0:s.indexOf(i))!=null?a:-1;o!==-1&&(s==null||s.splice(o,1))}emit(e,...i){var o;if(!this.listeners.has(e))return;let s=(o=this.listeners.get(e))!=null?o:[];for(let a of s)a(...i)}setTimeout(e){this.timeout&&clearTimeout(this.timeout),e&&(this.timeout=window.setTimeout(()=>{this.close()},e))}listener(e){var i;e.source===((i=this.runnerFrame)==null?void 0:i.contentWindow)&&(e.data.type==="sandboxResult"?this.emit("result",e.data.result):e.data.type==="sandboxError"&&this.emit("error",e.data.error))}close(){!this.runnerFrame||(this.runnerFrame.remove(),window.removeEventListener("message",this.listenerBind),this.timeout&&clearTimeout(this.timeout),this.emit("close"))}async evaluate(e,i=[],s=[]){var o;return await this.readyPromise,(o=this.runnerFrame.contentWindow)==null||o.postMessage({type:"sandboxEvaluate",body:e,argNames:i,argValues:s},"*"),new Promise((a,l)=>{let f=null,m=null,x=null,_=r(()=>{f&&this.off("result",f),m&&this.off("error",m),x&&this.off("close",x)},"cleanup");f=r(b=>{_(),a(b)},"resultHandler"),m=r(b=>{_(),l(b)},"errorHandler"),x=r(()=>{_(),l(new Error("SandboxedEvaluator closed"))},"closeHandler"),this.on("result",f),this.on("error",m),this.on("close",x)})}static async evaluateOnce(e,i,s,o,a=5e3){let l=new lt(e);a&&l.setTimeout(a);try{let f=await l.evaluate(i,s,o);return l.close(),f}catch(f){throw l.close(),f}}static extractFnBodyAndArgs(e){let i=e.substring(e.indexOf("{")+1,e.lastIndexOf("}")),s=e.substring(e.indexOf("(")+1,e.indexOf(")")).split(",").map(o=>o.trim());return{body:i,argNames:s}}static matchArgValues(e,i){return e.map(s=>{if(!!Object.hasOwn(i,s))return i[s]})}};r(lt,"SandboxedEvaluator");var ok="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36(KHTML, like Gecko)",Ye=class{static base64ToU8(e){let i={"-":"+",_:"/",".":"="},s;return/[-_.]/g.test(e)?s=e.replace(/[-_.]/g,a=>i[a]):s=e,s=atob(s),new Uint8Array([...s].map(a=>a.charCodeAt(0)))}static u8ToBase64(e,i=!1){let s=btoa(String.fromCharCode(...e));return i?s.replace(/\+/g,"-").replace(/\//g,"_"):s}static async createChallenge(e,i,s,o){let a=[i];s&&a.push(s);let l=await e(Ye.b64ToBuf("BxMTDxLZzs4JDQ3MDwDNBg4OBgsEAA8IEs0CDgzOwxEPAs4GDg4GCwTNCA0TBBENAAvNFgAAzRXQzfYAAM7iEQQAEwQ="),{method:"POST",headers:{"Content-Type":"application/json+protobuf","User-Agent":ok,"x-goog-api-key":o,"x-user-agent":"grpc-web-javascript/0.1"},body:JSON.stringify(a)});if(!l.ok)throw new Error(`Failed to fetch: ${l.status}`);let f=await l.json();if(f.length>1&&f[1]){let m=Ye.parseChallenge(f[1]);if(m)return m}}static b64ToBuf(e){let i=Ye.base64ToU8(e);return i.length?new TextDecoder().decode(i.map(s=>s+97)):""}static stringToB64(e){let i=new TextEncoder().encode(e);return i=i.map(s=>s-97),Ye.u8ToBase64(i)}static parseChallenge(e){let i=Ye.b64ToBuf(e);if(i.length){let[s,o,,a,l,f]=JSON.parse(i);return{script:o,interpreterHash:a,globalName:f,challenge:l,messageId:s}}}static getFn1(){let e='(n){return(async()=>{const r=window[n.globalName];if(!r)throw new Error("V not found");const o={fn1:null,fn2:null,fn3:null,fn4:null};if(!r.a)throw new Error("Init failed");try{await r.a(n.challenge,(function(n,r,t,f){o.fn1=n,o.fn2=r,o.fn3=t,o.fn4=f}),!0,void 0,((...n)=>{}))}catch(n){throw new Error("Failed to load")}if(!o.fn1)throw new Error("fn1 unavailable.");let t=null;const f=[];if(await o.fn1((n=>{t=n}),[,,f]),!t)throw new Error("[BG]: No response");if(!f.length)throw new Error("No ppf");return window.ppf=f,t})()}';return lt.extractFnBodyAndArgs(e)}static getFn2(){let e='(r,e){const t=window.ppf[0];if(!t)throw new Error("PP:Undefined");return(async()=>{const n=await t((r=>{const e={"-":"+",_:"/",".":"="};let t;return t=/[-_.]/g.test(r)?r.replace(/[-_.]/g,(r=>e[r])):r,t=atob(t),new Uint8Array([...t].map((r=>r.charCodeAt(0))))})(r));if("function"!=typeof n)throw new Error("PP:failed");const o=((r,e=!1)=>{const t=btoa(String.fromCharCode(...r));return e?t.replace(/\\+/g,"-").replace(/\\//g,"_"):t})(await n((new TextEncoder).encode(e)),!0);if(o.length>80)return o;throw new Error("PT too small")})()}';return lt.extractFnBodyAndArgs(e.toString())}static async getPot(e=M.shim.fetch,i,s,o,a,l=!1){o||(o=Ye.b64ToBuf("7tPSGc8DDwkHBvfRz/LiF9Pq4A4=")),a||(a=Ye.b64ToBuf("4OgZAPIY4xjz1PbP6QfT2OXSz+8QEBMYBQMF1g/j6+Xq6+kO4A0W")),s||(s=qt.encodeVisitorData(Js.generateRandomString(11),Math.floor(Date.now()/1e3)));let f=new lt(i),m=null,x=null,_=null;try{l||f.setTimeout(5e3),await f.load(),l||f.setTimeout(null);let b=await Ye.createChallenge(e,o,null,a);if(!b)throw new Error("C is incorrect");if(!b.script)throw new Error("CS is bad");let T=b.script.find(K=>K!==null);if(!T)throw new Error("CS is null");l||f.setTimeout(5e3),await f.evaluate(T,[],[]),l||f.setTimeout(5e3);let w=this.getFn1(),S=await f.evaluate(w.body,w.argNames,[b]);l||f.setTimeout(null);let E=[o,S],C=await e(Ye.b64ToBuf("BxMTDxLZzs4JDQ3MDwDNBg4OBgsEAA8IEs0CDgzOwxEPAs4GDg4GCwTNCA0TBBENAAvNFgAAzRXQzfYAAM7mBA0EEQATBOjz"),{method:"POST",headers:{"Content-Type":"application/json+protobuf","x-goog-api-key":a,"x-user-agent":"grpc-web-javascript/0.1","User-Agent":ok,Accept:"*/*"},body:JSON.stringify(E)});if(!C.ok)throw new Error("It failed");let k=await C.json();if(!k.length||!k[0])throw new Error("It none");let U=k[0];x=k[1],_=k[2],l||f.setTimeout(5e3);let L=this.getFn2();m=await f.evaluate(L.body,L.argNames,[U,s]),l||f.close()}catch(b){throw l||f.close(),b}return{pot:m,vd:s,requestToken:o,ttl:x,refresh:_}}};r(Ye,"BGUtils");var Mr,ak,pk,ck,nk,Ob;(function(t){t.WEB="WEB",t.MWEB="MWEB",t.KIDS="WEB_KIDS",t.MUSIC="WEB_REMIX",t.IOS="iOS",t.ANDROID="ANDROID",t.ANDROID_MUSIC="ANDROID_MUSIC",t.ANDROID_CREATOR="ANDROID_CREATOR",t.TV="TVHTML5",t.TV_EMBEDDED="TVHTML5_SIMPLY_EMBEDDED_PLAYER",t.WEB_EMBEDDED="WEB_EMBEDDED_PLAYER",t.WEB_CREATOR="WEB_CREATOR"})(Ob||(Ob={}));var Rr="Session",sd=class extends zs{constructor(e,i,s,o,a,l,f,m,x){super(),this.http=new Kb(this,l,f),this.actions=new mw(this),this.logged_in=!!l,this.cache=m,this.account_index=o,this.key=i,this.api_version=s,this.context=e,this.player=a,this.po_token=x}on(e,i){super.on(e,i)}once(e,i){super.once(e,i)}static async create(e){let i=e.runner_location;if(e.client_type===Ob.WEB){let m=localStorage.getItem("yt_tkn"),x,_,b=0,T=0;if(m){let w=JSON.parse(m);w.length>0&&(x=w[0],_=w[1],b=w[2],T=w[3])}if(!x||!_||!b||!T||T+b*1e3{let _=`${m}|${JSON.stringify(x)}`,b=s.get(_);if(b)return await b;let T=lt.extractFnBodyAndArgs(m),w=lt.evaluateOnce(i,T.body,T.argNames,Object.values(x));s.set(_,w);try{return await w}catch(S){console.error("Failed to fetch params"),console.error(S)}};let{context:o,api_key:a,api_version:l,account_index:f}=await Mr.getSessionData(e.lang,e.location,e.account_index,e.visitor_data,e.enable_safety_mode,e.generate_session_locally,e.device_category,e.client_type,e.timezone,e.fetch,e.on_behalf_of_user,e.cache,e.enable_session_cache,e.po_token);return new Mr(o,a,l,f,e.retrieve_player===!1?void 0:await qe.create(e.cache,e.evaluator,e.fetch,e.po_token),e.cookie,e.fetch,e.cache,e.po_token)}static async fromCache(e,i){let s=await e.get("innertube_session_data");if(!s)return null;let o=new TextDecoder().decode(s.slice(4));try{let a=JSON.parse(dt.decompress(o));return i.visitor_data&&(a.context.client.visitorData=i.visitor_data),i.lang&&(a.context.client.hl=i.lang),i.location&&(a.context.client.gl=i.location),i.on_behalf_of_user&&(a.context.user.onBehalfOfUser=i.on_behalf_of_user),a.context.client.timeZone=i.time_zone,a.context.client.platform=i.device_category.toUpperCase(),a.context.client.clientName=i.client_name,a.context.user.enableSafetyMode=i.enable_safety_mode,a}catch(a){return O.error(Rr,"Failed to parse session data from cache.",a),null}}static async getSessionData(e="",i="",s=0,o="",a=!1,l=!1,f="desktop",m=Ob.WEB,x=Intl.DateTimeFormat().resolvedOptions().timeZone,_=M.shim.fetch,b,T,w=!0,S){let E={lang:e,location:i,time_zone:x,device_category:f,client_name:m,enable_safety_mode:a,visitor_data:o,on_behalf_of_user:b,po_token:S},C;if(T&&w){let k=await this.fromCache(T,E);k&&(O.info(Rr,"Found session data in cache."),C=k)}if(!C){O.info(Rr,"Generating session data.");let k=V.WEB.API_KEY,U=V.WEB.API_VERSION,L={hl:e||"en",gl:i||"US",remote_host:"",visitor_data:o||qt.encodeVisitorData($i(11),Math.floor(Date.now()/1e3)),client_name:m,client_version:V.WEB.VERSION,device_category:f.toUpperCase(),os_name:"Windows",os_version:"10.0",time_zone:x,browser_name:"Chrome",browser_version:"125.0.0.0",device_make:"",device_model:"",enable_safety_mode:a};if(!l)try{let K=await u(this,Mr,"m",pk).call(this,E,_);k=K.api_key,U=K.api_version,L=K.context_data}catch(K){O.error(Rr,"Failed to retrieve session data from server. Session data generated locally will be used instead.",K)}b&&(L.on_behalf_of_user=b),C={api_key:k,api_version:U,context:u(this,Mr,"m",ck).call(this,L)},w&&await u(this,Mr,"m",ak).call(this,C,T)}return O.debug(Rr,"Session data:",C),{...C,account_index:s}}get client_version(){return this.context.client.clientVersion}get client_name(){return this.context.client.clientName}get lang(){return this.context.client.hl}};r(sd,"Session");Mr=sd,ak=r(async function(e,i){if(!i)return;O.info(Rr,"Compressing and caching session data.");let s=new TextEncoder().encode(dt.compress(JSON.stringify(e))),o=new ArrayBuffer(4+s.byteLength);new DataView(o).setUint32(0,s.byteLength,!0),new Uint8Array(o).set(s,4),await i.set("innertube_session_data",new Uint8Array(o))},"_Session_storeSession"),pk=r(async function(e,i=M.shim.fetch){let s=$i(11);e.visitor_data&&(s=u(this,Mr,"m",nk).call(this,e.visitor_data));let o=new URL("/sw.js_data",We.YT_BASE),a=await i(o,{headers:{"Accept-Language":e.lang||"en-US","User-Agent":Zi("desktop"),Accept:"*/*",Referer:`${We.YT_BASE}/sw.js`,Cookie:`PREF=tz=${e.time_zone.replace("/",".")};VISITOR_INFO1_LIVE=${s};`}});if(!a.ok)throw new Ar(`Failed to retrieve session data: ${a.status}`);let l=await a.text();if(!l.startsWith(")]}'"))throw new Ar("Invalid JSPB response");let m=JSON.parse(l.replace(/^\)\]\}'/,""))[0][2],x=V.WEB.API_VERSION,[[_],b]=m,T=_[61],w=T[T.length-1];return{context_data:{hl:e.lang||_[0],gl:e.location||_[2],remote_host:_[3],visitor_data:e.visitor_data||_[13],client_name:e.client_name,client_version:_[16],os_name:_[17],os_version:_[18],time_zone:_[79]||e.time_zone,device_category:e.device_category,browser_name:_[86],browser_version:_[87],device_make:_[11],device_model:_[12],app_install_data:w,enable_safety_mode:e.enable_safety_mode},api_key:b,api_version:x}},"_Session_getSessionData"),ck=r(function(e){let i={client:{hl:e.hl||"en",gl:e.gl||"US",remoteHost:e.remote_host,screenDensityFloat:1,screenHeightPoints:1440,screenPixelDensity:1,screenWidthPoints:2560,visitorData:e.visitor_data,clientName:e.client_name,clientVersion:e.client_version,osName:e.os_name,osVersion:e.os_version,platform:e.device_category.toUpperCase(),clientFormFactor:"UNKNOWN_FORM_FACTOR",userInterfaceTheme:"USER_INTERFACE_THEME_LIGHT",timeZone:e.time_zone,originalUrl:We.YT_BASE,deviceMake:e.device_make,deviceModel:e.device_model,browserName:e.browser_name,browserVersion:e.browser_version,utcOffsetMinutes:-Math.floor(new Date().getTimezoneOffset()),memoryTotalKbytes:"8000000",mainAppWebInfo:{graftUrl:We.YT_BASE,pwaInstallabilityStatus:"PWA_INSTALLABILITY_STATUS_UNKNOWN",webDisplayMode:"WEB_DISPLAY_MODE_BROWSER",isWebNativeShareAvailable:!0}},user:{enableSafetyMode:e.enable_safety_mode,lockedSafetyMode:!1},request:{useSsl:!0,internalExperimentFlags:[]}};return e.app_install_data&&(i.client.configInfo={appInstallData:e.app_install_data}),e.on_behalf_of_user&&(i.user.onBehalfOfUser=e.on_behalf_of_user),i},"_Session_buildContext"),nk=r(function(e){return qt.decodeVisitorData(e).id},"_Session_getVisitorID");var hw=sd;var Lr,Db=class extends Ps{constructor(e,i,s,o){var a;if(super(e,i,s),Lr.set(this,void 0),o){let l=c.parseResponse(o.data);l.entries&&(this.watch_next_feed=l.entries),l.continuation_endpoint&&I(this,Lr,(a=l.continuation_endpoint)==null?void 0:a.as(ti),"f")}}async getWatchNextContinuation(){var i;if(!u(this,Lr,"f"))throw new g("Continuation not found");let e=await this.actions.execute("/reel/reel_watch_sequence",{sequenceParams:u(this,Lr,"f").token,parse:!0});return e.entries&&(this.watch_next_feed=e.entries),I(this,Lr,(i=e.continuation_endpoint)==null?void 0:i.as(ti),"f"),this}get wn_has_continuation(){return!!u(this,Lr,"f")}};r(Db,"ShortFormVideoInfo");Lr=new WeakMap;var dw=Db;var Ve,$s=class{constructor(e){Ve.set(this,void 0),I(this,Ve,e,"f")}static async create(e){return new $s(await hw.create(e))}async getInfo(e,i){var _,b,T,w,S;Hs({target:e});let s={videoId:e instanceof d?(_=e.payload)==null?void 0:_.videoId:e,playlistId:e instanceof d?(b=e.payload)==null?void 0:b.playlistId:void 0,playlistIndex:e instanceof d?(T=e.payload)==null?void 0:T.playlistIndex:void 0,params:e instanceof d?(w=e.payload)==null?void 0:w.params:void 0,racyCheckOk:!0,contentCheckOk:!0},o=new d({watchEndpoint:s}),a=new d({watchNextEndpoint:s}),l=o.call(u(this,Ve,"f").actions,{playbackContext:{contentPlaybackContext:{vis:0,splay:!1,lactMilliseconds:"-1",signatureTimestamp:(S=u(this,Ve,"f").player)==null?void 0:S.sts}},serviceIntegrityDimensions:{poToken:u(this,Ve,"f").po_token},client:i}),f=a.call(u(this,Ve,"f").actions),m=await Promise.all([l,f]),x=$i(16);return new Kh(m,this.actions,x)}async getBasicInfo(e,i){var l;Hs({video_id:e});let o=await new d({watchEndpoint:{videoId:e}}).call(u(this,Ve,"f").actions,{playbackContext:{contentPlaybackContext:{vis:0,splay:!1,lactMilliseconds:"-1",signatureTimestamp:(l=u(this,Ve,"f").player)==null?void 0:l.sts}},serviceIntegrityDimensions:{poToken:u(this,Ve,"f").po_token},client:i}),a=$i(16);return new Kh([o],this.actions,a)}async getShortsVideoInfo(e,i){Hs({video_id:e});let o=new d({reelWatchEndpoint:{disablePlayerResponse:!1,params:"CAUwAg%3D%3D",videoId:e}}).call(u(this,Ve,"f").actions,{client:i}),a=bT.encode({shortId:e,params:{number:5},feature2:25,feature3:0}),l=encodeURIComponent(zt(a.finish())),f=this.actions.execute("/reel/reel_watch_sequence",{sequenceParams:l}),m=await Promise.all([o,f]),x=$i(16);return new dw([m[0]],this.actions,x,m[1])}async getPlaylist(e){Hs({id:e}),e.startsWith("VL")||(e=`VL${e}`);let s=await new d({browseEndpoint:{browseId:e}}).call(u(this,Ve,"f").actions);return new Os(this.actions,s)}async getStreamingData(e,i={}){let o=(await this.getBasicInfo(e)).chooseFormat(i);return o.url=await o.decipher(u(this,Ve,"f").player),o}async download(e,i){return(await this.getBasicInfo(e,i==null?void 0:i.client)).download(i)}async resolveURL(e){let i=await this.actions.execute("/navigation/resolve_url",{url:e,parse:!0});if(!i.endpoint)throw new g("Failed to resolve URL. Expected a NavigationEndpoint but got undefined",i);return i.endpoint}call(e,i){return e.call(this.actions,i)}get actions(){return u(this,Ve,"f").actions}get session(){return u(this,Ve,"f")}};r($s,"Innertube");Ve=new WeakMap;var _w=$s;var Ki,Ne,lk,Ks,od="OAuth2",Bb=class{constructor(e){Ki.add(this),Ne.set(this,void 0),I(this,Ne,e,"f"),this.YTTV_URL=new URL("/tv",z.URLS.YT_BASE),this.AUTH_SERVER_CODE_URL=new URL("/o/oauth2/device/code",z.URLS.YT_BASE),this.AUTH_SERVER_TOKEN_URL=new URL("/o/oauth2/token",z.URLS.YT_BASE),this.AUTH_SERVER_REVOKE_TOKEN_URL=new URL("/o/oauth2/revoke",z.URLS.YT_BASE)}async init(e){if(e){this.setTokens(e),this.shouldRefreshToken()&&await this.refreshAccessToken(),u(this,Ne,"f").emit("auth",{credentials:this.oauth2_tokens});return}if(await u(this,Ki,"m",lk).call(this)){O.info(od,"Loaded OAuth2 tokens from cache.",this.oauth2_tokens);return}this.client_id||(this.client_id=await this.getClientID());let s=await this.getDeviceAndUserCode();u(this,Ne,"f").emit("auth-pending",s),this.pollForAccessToken(s)}setTokens(e){let i=e;if(i.expires_in&&(i.expiry_date=new Date(Date.now()+i.expires_in*1e3).toISOString(),delete i.expires_in),!this.validateTokens(i))throw new le("Invalid tokens provided.");this.oauth2_tokens=i,i.client&&(O.info(od,"Using provided client id and secret."),this.client_id=i.client)}async cacheCredentials(){var s;let i=new TextEncoder().encode(JSON.stringify(this.oauth2_tokens));await((s=u(this,Ne,"f").cache)==null?void 0:s.set("youtubei_oauth_credentials",i.buffer))}async removeCache(){var e;await((e=u(this,Ne,"f").cache)==null?void 0:e.remove("youtubei_oauth_credentials"))}pollForAccessToken(e){if(!this.client_id)throw new le("Client ID is missing.");let{device_code:i,interval:s}=e,{client_id:o,client_secret:a}=this.client_id,l={client_id:o,client_secret:a,code:i,grant_type:"http://oauth.net/grant_type/device/1.0"},f=setInterval(async()=>{let x=await(await u(this,Ki,"a",Ks).fetch_function(this.AUTH_SERVER_TOKEN_URL,{body:JSON.stringify(l),method:"POST",headers:{"Content-Type":"application/json"}})).json();if(x.error){switch(x.error){case"access_denied":u(this,Ne,"f").emit("auth-error",new le("Access was denied.",x)),clearInterval(f);break;case"expired_token":u(this,Ne,"f").emit("auth-error",new le("The device code has expired.",x)),clearInterval(f);break;case"authorization_pending":case"slow_down":O.info(od,"Polling for access token...");break;default:u(this,Ne,"f").emit("auth-error",new le("Server returned an unexpected error.",x)),clearInterval(f);break}return}this.setTokens(x),u(this,Ne,"f").emit("auth",{credentials:this.oauth2_tokens}),clearInterval(f)},s*1e3)}async revokeCredentials(){if(!this.oauth2_tokens)throw new le("Access token not found");await this.removeCache();let e=this.AUTH_SERVER_REVOKE_TOKEN_URL;return e.searchParams.set("token",this.oauth2_tokens.access_token),u(this,Ne,"f").http.fetch_function(e,{method:"POST"})}async refreshAccessToken(){if(this.client_id||(this.client_id=await this.getClientID()),!this.oauth2_tokens)throw new le("No tokens available to refresh.");let{client_id:e,client_secret:i}=this.client_id,{refresh_token:s}=this.oauth2_tokens,o={client_id:e,client_secret:i,refresh_token:s,grant_type:"refresh_token"},a=await u(this,Ki,"a",Ks).fetch_function(this.AUTH_SERVER_TOKEN_URL,{body:JSON.stringify(o),method:"POST",headers:{"Content-Type":"application/json"}});if(!a.ok)throw new le(`Failed to refresh access token: ${a.status}`);let l=await a.json();if(l.error_code)throw new le("Authorization server returned an error",l);this.oauth2_tokens.access_token=l.access_token,this.oauth2_tokens.expiry_date=new Date(Date.now()+l.expires_in*1e3).toISOString(),u(this,Ne,"f").emit("update-credentials",{credentials:this.oauth2_tokens})}async getDeviceAndUserCode(){if(!this.client_id)throw new le("Client ID is missing.");let{client_id:e}=this.client_id,i={client_id:e,scope:"http://gdata.youtube.com https://www.googleapis.com/auth/youtube-paid-content",device_id:M.shim.uuidv4(),device_model:"ytlr::"},s=await u(this,Ki,"a",Ks).fetch_function(this.AUTH_SERVER_CODE_URL,{body:JSON.stringify(i),method:"POST",headers:{"Content-Type":"application/json"}});if(!s.ok)throw new le(`Failed to get device/user code: ${s.status}`);let o=await s.json();if(o.error_code)throw new le("Authorization server returned an error",o);return o}async getClientID(){let e=await u(this,Ki,"a",Ks).fetch_function(this.YTTV_URL,{headers:{"User-Agent":"Mozilla/5.0 (ChromiumStylePlatform) Cobalt/Version",Referer:"https://www.youtube.com/tv","Accept-Language":"en-US"}});if(!e.ok)throw new le(`Failed to get client ID: ${e.status}`);let i=await e.text(),s;if((s=z.OAUTH.REGEX.TV_SCRIPT.exec(i))!==null){O.info(od,`Got YouTubeTV script URL (${s[1]})`);let o=await u(this,Ki,"a",Ks).fetch(s[1],{baseURL:z.URLS.YT_BASE});if(!o.ok)throw new le(`TV script request failed with status code ${o.status}`);let l=(await o.text()).match(z.OAUTH.REGEX.CLIENT_IDENTITY);if(!l||!l.groups)throw new le("Could not obtain client ID.");let{client_id:f,client_secret:m}=l.groups;return O.info(od,`Client identity retrieved (clientId=${f}, clientSecret=${m}).`),{client_id:f,client_secret:m}}throw new le("Could not obtain script URL.")}shouldRefreshToken(){return this.oauth2_tokens?Date.now()>new Date(this.oauth2_tokens.expiry_date).getTime():!1}validateTokens(e){return!(!e.access_token||!e.refresh_token||!e.expiry_date)}};r(Bb,"OAuth2");Ne=new WeakMap,Ki=new WeakSet,lk=r(async function(){var o;let e=await((o=u(this,Ne,"f").cache)==null?void 0:o.get("youtubei_oauth_credentials"));if(!e)return!1;let i=new TextDecoder,s=JSON.parse(i.decode(e));return this.setTokens(s),u(this,Ne,"f").emit("auth",{credentials:s}),!0},"_OAuth2_loadFromCache"),Ks=r(function(){return u(this,Ne,"f").http},"_OAuth2_http_get");var bC=Bb;var uk={};var fk=_w;var nd,Yb,Vb,Ub,gC="Cache",Fb=class{constructor(e=!1,i){nd.add(this),Yb.set(this,void 0),Vb.set(this,void 0),I(this,Yb,i||"","f"),I(this,Vb,e,"f")}get cache_dir(){return u(this,Vb,"f")?u(this,Yb,"f"):""}async get(e){let i=await u(this,nd,"m",Ub).call(this);if(!!i)return new Promise((s,o)=>{let a=i.transaction("kv-store","readonly").objectStore("kv-store").get(e);a.onerror=o,a.onsuccess=function(){var f;let l=(f=this.result)==null?void 0:f.v;l instanceof ArrayBuffer?s(l):ArrayBuffer.isView(l)?s(l.buffer):s(void 0)}})}async set(e,i){let s=await u(this,nd,"m",Ub).call(this);if(!!s)return new Promise((o,a)=>{let l=s.transaction("kv-store","readwrite").objectStore("kv-store").put({k:e,v:i});l.onerror=a,l.onsuccess=()=>o()})}async remove(e){let i=await u(this,nd,"m",Ub).call(this);if(!!i)return new Promise((s,o)=>{let a=i.transaction("kv-store","readwrite").objectStore("kv-store").delete(e);a.onerror=o,a.onsuccess=()=>s()})}};r(Fb,"Cache");Yb=new WeakMap,Vb=new WeakMap,nd=new WeakSet,Ub=r(function(){let e=Reflect.get(globalThis,"indexedDB")||Reflect.get(globalThis,"webkitIndexedDB")||Reflect.get(globalThis,"mozIndexedDB")||Reflect.get(globalThis,"msIndexedDB");return e?new Promise((i,s)=>{let o=e.open("youtubei.js",1);o.onsuccess=function(){i(this.result)},o.onerror=function(a){s("indexedDB request error"),console.error(a)},o.onupgradeneeded=function(){let a=this.result.createObjectStore("kv-store",{keyPath:"k"});a.transaction.oncomplete=function(){i(this.db)}}}):Ht(gC,"IndexedDB is not supported. No cache will be used.")},"_Cache_getBrowserDB");M.load({runtime:"browser",server:!1,info:{version:"10.3.0",bugs_url:"https://github.com/LuanRT/YouTube.js/issues",repo_url:"https://github.com/LuanRT/YouTube.js"},Cache:Fb,sha1Hash:fw,uuidv4(){var t;return(t=globalThis.crypto)!=null&&t.randomUUID()?globalThis.crypto.randomUUID():"10000000-1000-4000-8000-100000000000".replace(/[018]/g,e=>{let i=parseInt(e);return(i^window.crypto.getRandomValues(new Uint8Array(1))[0]&15>>i/4).toString(16)})},fetch:globalThis.fetch,Request:globalThis.Request,Response:globalThis.Response,Headers:globalThis.Headers,FormData:globalThis.FormData,File:globalThis.File,ReadableStream:globalThis.ReadableStream,CustomEvent:globalThis.CustomEvent});var sve=fk;export{fE as APIResponseTypes,mw as Actions,er as AppendContinuationItemsAction,Ob as ClientType,z as Constants,xr as Continuation,ti as ContinuationCommand,zs as EventEmitter,Ji as FormatUtils,Dg as Generator,Is as GridContinuation,Kb as HTTPClient,Gb as Helpers,_w as Innertube,bs as ItemSectionContinuation,dt as LZW,Mi as LiveChatContinuation,O as Log,zg as Misc,Hg as Mixins,Ts as MusicPlaylistShelfContinuation,vs as MusicShelfContinuation,Ai as NavigateAction,bC as OAuth2,c as Parser,M as Platform,qe as Player,Ss as PlaylistPanelContinuation,qt as ProtoUtils,Ri as ReloadContinuationItemsCommand,ws as SectionListContinuation,hw as Session,gs as ShowMiniplayerCommand,uk as Types,Tk as UniversalCache,Js as Utils,qg as YT,mr as YTNodes,sve as default}; diff --git a/chrome/player/players/yt/YTPlayer.mjs b/chrome/player/players/yt/YTPlayer.mjs index edfdce25..7c7f1f95 100644 --- a/chrome/player/players/yt/YTPlayer.mjs +++ b/chrome/player/players/yt/YTPlayer.mjs @@ -13,6 +13,7 @@ import DashPlayer from '../dash/DashPlayer.mjs'; Log.setLevel( Log.Level.WARNING, Log.Level.ERROR, +// Log.Level.INFO, ); const CurrentUA = `com.google.ios.youtube/18.06.35 (iPhone; CPU iPhone OS 14_4 like Mac OS X; en_US)`;