Files
YouTube.js/build/node.js
2022-07-12 23:25:27 -03:00

11 lines
222 KiB
JavaScript

"use strict";/* eslint-disable */
var nu=Object.defineProperty;var Lx=(c,e,t)=>e in c?nu(c,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):c[e]=t;var n=(c,e)=>nu(c,"name",{value:e,configurable:!0});var g=(c,e)=>()=>(e||c((e={exports:{}}).exports,e),e.exports);var f=(c,e,t)=>(Lx(c,typeof e!="symbol"?e+"":e,t),t),Ba=(c,e,t)=>{if(!e.has(c))throw TypeError("Cannot "+t)};var l=(c,e,t)=>(Ba(c,e,"read from private field"),t?t.call(c):e.get(c)),T=(c,e,t)=>{if(e.has(c))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(c):e.set(c,t)},I=(c,e,t,i)=>(Ba(c,e,"write to private field"),i?i.call(c,t):e.set(c,t),t);var N=(c,e,t)=>(Ba(c,e,"access private method"),t);var ae=g((HR,iu)=>{"use strict";iu.exports={URLS:{YT_BASE:"https://www.youtube.com",YT_MUSIC_BASE:"https://music.youtube.com",YT_SUGGESTIONS:"https://suggestqueries.google.com/complete/",API:{BASE:"https://youtubei.googleapis.com",PRODUCTION:"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/"}},OAUTH:{SCOPE:"http://gdata.youtube.com https://www.googleapis.com/auth/youtube-paid-content",GRANT_TYPE:"http://oauth.net/grant_type/device/1.0",MODEL_NAME:"ytlr::",HEADERS:{accept:"*/*",origin:"https://www.youtube.com","user-agent":"Mozilla/5.0 (ChromiumStylePlatform) Cobalt/Version","content-type":"application/json",referer:"https://www.youtube.com/tv","accept-language":"en-US"},REGEX:{AUTH_SCRIPT:/<script id="base-js" src="(.*?)" nonce=".*?"><\/script>/,CLIENT_IDENTITY:/.+?={};var .+?={clientId:"(?<client_id>.+?)",.+?:"(?<client_secret>.+?)"},/}},CLIENTS:{WEB:{NAME:"WEB"},YTMUSIC:{NAME:"WEB_REMIX",VERSION:"1.20211213.00.00"},ANDROID:{NAME:"ANDROID",VERSION:"17.17.32"}},STREAM_HEADERS:{accept:"*/*",connection:"keep-alive",origin:"https://www.youtube.com",referer:"https://www.youtube.com",DNT:"?1"},INNERTUBE_HEADERS_BASE:{accept:"*/*","accept-encoding":"gzip, deflate","content-type":"application/json"},METADATA_KEYS:["embed","view_count","average_rating","allow_ratings","length_seconds","channel_id","channel_url","external_channel_id","is_live_content","is_family_safe","is_unlisted","is_private","has_ypc_metadata","category","owner_channel_name","publish_date","upload_date","keywords","available_countries","owner_profile_url"],BLACKLISTED_KEYS:["is_owner_viewing","is_unplugged_corpus","is_crawlable","author"],ACCOUNT_SETTINGS:{SUBSCRIPTIONS:"NOTIFICATION_SUBSCRIPTION_NOTIFICATIONS",RECOMMENDED_VIDEOS:"NOTIFICATION_RECOMMENDATION_WEB_CONTROL",CHANNEL_ACTIVITY:"NOTIFICATION_COMMENT_WEB_CONTROL",COMMENT_REPLIES:"NOTIFICATION_COMMENT_REPLY_OTHER_WEB_CONTROL",USER_MENTION:"NOTIFICATION_USER_MENTION_WEB_CONTROL",SHARED_CONTENT:"NOTIFICATION_RETUBING_WEB_CONTROL",PLAYLISTS_PRIVACY:"PRIVACY_DISCOVERABLE_SAVED_PLAYLISTS",SUBSCRIPTIONS_PRIVACY:"PRIVACY_DISCOVERABLE_SUBSCRIPTIONS"},BASE64_DIALECT:{NORMAL:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),REVERSE:"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_".split("")},SIG_REGEX:{ACTIONS:/;.{2}\.(?<name>.{2})\(.*?,(?<param>.*?)\)/g,FUNCTIONS:/(?<name>.{2}):function\(.*?\){(.*?)}/g},NTOKEN_REGEX:{CALLS:/c\[(.*?)\]\((.+?)\)/g,PLACEHOLDERS:/c\[(.*?)\]=c/g,FUNCTIONS:/d\.push\(e\)|d\.reverse\(\)|d\[0\]\)\[0\]\)|f=d\[0];d\[0\]|d\.length;d\.splice\(e,1\)|function\(\){for\(var|function\(d,e,f\){var|function\(d\){for\(var|reverse\(\)\.forEach|unshift\(d\.pop\(\)\)|function\(d,e\){for\(var f/},FUNCS:{PUSH:"d.push(e)",REVERSE_1:"d.reverse()",REVERSE_2:"function(d){for(var",SPLICE:"d.length;d.splice(e,1)",SWAP0_1:"d[0])[0])",SWAP0_2:"f=d[0];d[0]",ROTATE_1:"reverse().forEach",ROTATE_2:"unshift(d.pop())",BASE64_DIA:"function(){for(var",TRANSLATE_1:"function(d,e){for(var f",TRANSLATE_2:"function(d,e,f){var"}}});var An=g((zR,Px)=>{Px.exports={name:"youtubei.js",version:"2.0.0",description:"A full-featured wrapper around YouTube's private API. Allows you to retrieve info about any video, subscribe, unsubscribe, like, dislike, comment, search, download videos/music and much more!",author:"LuanRT <luan.lrt4@gmail.com> (https://github.com/LuanRT)",contributors:["Wykerd (https://github.com/wykerd/)","MasterOfBob777 (https://github.com/MasterOfBob777)"],funding:"https://ko-fi.com/luanrt",license:"MIT",scripts:{test:"npx jest --verbose","test:node":"npm run build:node:prod && npx jest node","test:browser":"npm run build:browser:prod && npx jest browser",lint:"npx eslint ./lib","lint:fix":"npx eslint --fix ./lib","build:types":"npx tsc","build:parser-map":"node ./scripts/build-parser-json.js","build:general":'npm run build:parser-map && npx esbuild ./lib/Innertube.js --banner:js="/* eslint-disable */" --bundle --target=node12 --keep-names --format=cjs --sourcemap',"build:node":"npm run build:general -- --outfile=./build/node.js --platform=node --external:axios --external:buffer --external:events --external:flat --external:idb --external:node-forge --external:protocol-buffers-encodings --external:stream-browserify --external:user-agents --external:uuid --define:BROWSER=false","build:node:prod":"npm run build:node -- --minify","build:browser":"npm run build:general -- --outfile=./build/browser.js --platform=browser --define:BROWSER=true","build:browser:prod":"npm run build:browser -- --minify"},types:"./typings/lib/Innertube.d.ts",main:"./build/node.js",browser:"./build/browser.js",directories:{test:"./test",typings:"./typings",examples:"./examples",lib:"./lib"},dependencies:{axios:"^0.21.4",buffer:"^6.0.3",events:"^3.3.0",flat:"^5.0.2",idb:"^7.0.2","node-forge":"^1.3.1","protocol-buffers-encodings":"^1.1.1","stream-browserify":"^3.0.0","user-agents":"^1.0.778",uuid:"^8.3.2"},devDependencies:{"@types/node":"^17.0.31",esbuild:"^0.14.48",eslint:"^8.15.0","eslint-plugin-jsdoc":"^39.3.2","fake-dom":"^1.0.4","fake-indexeddb":"^4.0.0",jest:"^28.1.0",typescript:"^4.6.4",xhr2:"^0.2.1","xmlhttprequest-ssl":"^2.0.0"},repository:{type:"git",url:"git+https://github.com/LuanRT/YouTube.js.git"},bugs:{url:"https://github.com/LuanRT/YouTube.js/issues"},homepage:"https://github.com/LuanRT/YouTube.js#readme",keywords:["yt","dl","ytdl","youtube","youtubedl","youtube-dl","youtube-downloader","innertube","innertubeapi","unofficial","downloader","livechat","ytmusic","dislike","search","comment","music","like","api"]}});var F=g((KR,cu)=>{"use strict";var Ax=require("crypto"),su=require("user-agents"),Nx=require("flat"),ye=class extends Error{constructor(e,t){super(e),t&&(this.info=t),this.date=new Date,this.version=An().version}};n(ye,"InnertubeError");var Wt=class extends ye{};n(Wt,"ParsingError");var Nn=class extends ye{};n(Nn,"DownloadError");var Gt=class extends ye{};n(Gt,"MissingParamError");var On=class extends ye{};n(On,"UnavailableContentError");var Un=class extends ye{};n(Un,"NoStreamingDataError");var Dn=class extends ye{};n(Dn,"OAuthError");function Ox(c,e,t,i,a=!0){let s=Nx(c,{safe:a,maxDepth:i||2}),r=Object.keys(s).find(o=>o.includes(e)&&JSON.stringify(s[o]||"{}").includes(t));if(!r)throw new Wt(`Expected to find "${e}" with content "${t}" but got ${r}`,{key:e,target:t,data_snippet:`${JSON.stringify(s,null,4).slice(0,300)}..`});return s[r]}n(Ox,"findNode");function Ux(c){return new Proxy(c,{get(e,t){return t=="get"?(i,a)=>e.find((s,r)=>{let o=ru(i,s);return o&&a&&e.splice(r,1),o}):t=="findAll"?(i,a)=>e.filter((s,r)=>{let o=ru(i,s);return o&&a&&e.splice(r,1),o}):t=="remove"?i=>e.splice(i,1):Reflect.get(...arguments)}})}n(Ux,"observe");function ru(c,e){return Reflect.ownKeys(c).some(i=>{var s;let a=((s=e[i])==null?void 0:s.constructor.name)==="Text";return!a&&typeof e[i]=="object"?JSON.stringify(c[i])===JSON.stringify(e[i]):c[i]===(a?e[i].toString():e[i])})}n(ru,"deepCompare");function Dx(){let c=process.env,e=process.platform==="win32",t=e?/[^:]\\$/:/.\/$/,i;return e?i=c.TEMP||c.TMP||`${c.SystemRoot||c.windir}\\temp`:i=c.TMPDIR||c.TMP||c.TEMP||"/tmp",t.test(i)&&(i=i.slice(0,-1)),i}n(Dx,"getTmpdir");function Bx(c,e,t){let i=new RegExp(`${ou(e)}(.*?)${ou(t)}`,"s"),a=c.match(i);return a?a[1]:void 0}n(Bx,"getStringBetweenStrings");function ou(c){return c.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}n(ou,"escapeStringRegexp");function Mx(c){switch(c){case"mobile":return new su(/Android/).data;case"desktop":return new su({deviceCategory:"desktop"}).data;default:}}n(Mx,"getRandomUserAgent");function Vx(c){let e="https://www.youtube.com",t=Math.floor(new Date().getTime()/1e3),i=[t,c,e].join(" "),a;return a=Ax.createHash("sha1").update(i,"utf-8").digest("hex"),["SAPISIDHASH",[t,a].join("_")].join(" ")}n(Vx,"generateSidAuth");function Fx(c){let e=[],t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";for(let i=0;i<c;i++)e.push(t.charAt(Math.floor(Math.random()*t.length)));return e.join("")}n(Fx,"generateRandomString");function Yx(c){let e=c.split(":");switch(e.length){case 1:return parseInt(+e[0]);case 2:return parseInt(+e[0]*60+ +e[1]);case 3:return parseInt(+e[0]*3600+ +e[1]*60+ +e[2]);default:break}}n(Yx,"timeToSeconds");function $x(c){return c[0].toLowerCase()+c.slice(1,c.length).replace(/[A-Z]/g,e=>`_${e.toLowerCase()}`)}n($x,"camelToSnake");function Wx(c){return["YOUTUBE","YTMUSIC"].includes(c)}n(Wx,"isValidClient");function Gx(c){for(let[e,t]of Object.entries(c))if(!t)throw new Gt(`${e} is missing`)}n(Gx,"throwIfMissing");function Hx(c){return c.replace(/function\(d,e\)/g,'"function(d,e)').replace(/function\(d\)/g,'"function(d)').replace(/function\(\)/g,'"function()').replace(/function\(d,e,f\)/g,'"function(d,e,f)').replace(/\[function\(d,e,f\)/g,'["function(d,e,f)').replace(/,b,/g,',"b",').replace(/,b/g,',"b"').replace(/b,/g,'"b",').replace(/b]/g,'"b"]').replace(/\[b/g,'["b"').replace(/}]/g,'"]').replace(/},/g,'}",').replace(/""/g,"").replace(/length]\)}"/g,"length])}")}n(Hx,"refineNTokenData");var zx={InnertubeError:ye,UnavailableContentError:On,ParsingError:Wt,DownloadError:Nn,MissingParamError:Gt,NoStreamingDataError:Un,OAuthError:Dn},Kx={findNode:Ox,observe:Ux,getTmpdir:Dx,getRandomUserAgent:Mx,generateSidAuth:Vx,generateRandomString:Fx,getStringBetweenStrings:Bx,camelToSnake:$x,isValidClient:Wx,throwIfMissing:Gx,timeToSeconds:Yx,refineNTokenData:Hx};cu.exports={...Kx,...zx}});var hu=g((QR,uu)=>{"use strict";var Qx=require("uuid"),le=ae(),{OAuthError:Ht}=F(),we,Le,ee,zt,ue,Kt,Ma,Mn,au,Vn,lu,Qt,Va,Bn=class{constructor(e,t){T(this,Kt);T(this,Mn);T(this,Vn);T(this,Qt);T(this,we,void 0);T(this,Le,void 0);T(this,ee,{});T(this,zt,5);T(this,ue,null);I(this,ue,e),I(this,we,t)}init(e){I(this,ee,e),e.access_token||N(this,Kt,Ma).call(this)}async checkAccessTokenValidity(){let e=new Date(l(this,ee).expires).getTime();new Date().getTime()>e&&await N(this,Vn,lu).call(this)}revokeCredentials(){return l(this,we).call(this,{url:"/o/oauth2/revoke",baseURL:le.URLS.YT_BASE,params:{token:this.getAccessToken()},method:"post"})}get credentials(){return l(this,ee)}validateCredentials(){return l(this,ee).hasOwnProperty("access_token")&&l(this,ee).hasOwnProperty("refresh_token")&&l(this,ee).hasOwnProperty("expires")}};n(Bn,"OAuth"),we=new WeakMap,Le=new WeakMap,ee=new WeakMap,zt=new WeakMap,ue=new WeakMap,Kt=new WeakSet,Ma=n(async function(){I(this,Le,await N(this,Qt,Va).call(this));let e={client_id:l(this,Le).client_id,scope:le.OAUTH.SCOPE,device_id:Qx.v4(),model_name:le.OAUTH.MODEL_NAME},t=await l(this,we).call(this,{data:e,url:"/o/oauth2/device/code",baseURL:le.URLS.YT_BASE,method:"post"}).catch(i=>i);if(t instanceof Error)return l(this,ue).emit("auth",new Ht("Could not obtain user code.",t.message));l(this,ue).emit("auth",{...t.data,status:"AUTHORIZATION_PENDING"}),I(this,zt,t.data.interval),N(this,Mn,au).call(this,t.data.device_code)},"#getUserCode"),Mn=new WeakSet,au=n(function(e){let t=setInterval(async()=>{let i={...l(this,Le),code:e,grant_type:le.OAUTH.GRANT_TYPE},a=await l(this,we).call(this,{data:i,url:"/o/oauth2/token",baseURL:le.URLS.YT_BASE,method:"post"}).catch(r=>r);if(a instanceof Error)return l(this,ue).emit("auth",new Ht("Could not obtain user code.",{status:"FAILED",message:a.message}));if(a.data.error){switch(a.data.error){case"access_denied":l(this,ue).emit("auth",new Ht("Access was denied.",{status:"ACCESS_DENIED"}));break;case"expired_token":l(this,ue).emit("auth",new Ht("The device code has expired, restarting auth flow.",{status:"DEVICE_CODE_EXPIRED"})),clearInterval(t),N(this,Kt,Ma).call(this);break;default:break}return}let s=new Date(new Date().getTime()+a.data.expires_in*1e3);I(this,ee,{access_token:a.data.access_token,refresh_token:a.data.refresh_token,expires:s}),l(this,ue).emit("auth",{credentials:l(this,ee),status:"SUCCESS"}),clearInterval(t)},l(this,zt)*1e3)},"#startPolling"),Vn=new WeakSet,lu=n(async function(){I(this,Le,await N(this,Qt,Va).call(this));let e={...l(this,Le),refresh_token:l(this,ee).refresh_token,grant_type:"refresh_token"},t=await l(this,we).call(this,{data:e,url:"/o/oauth2/token",baseURL:le.URLS.YT_BASE,method:"post"}).catch(a=>a);if(t instanceof Error)return l(this,ue).emit("update-credentials",new Ht("Could not refresh access token.",{status:"FAILED"}));let i=new Date(new Date().getTime()+t.data.expires_in*1e3);I(this,ee,{access_token:t.data.access_token,refresh_token:t.data.refresh_token||this.credentials.refresh_token,expires:i}),l(this,ue).emit("update-credentials",{credentials:l(this,ee),status:"SUCCESS"})},"#refreshAccessToken"),Qt=new WeakSet,Va=n(async function(){let e=await l(this,we).call(this,{url:"/tv",baseURL:le.URLS.YT_BASE,headers:le.OAUTH.HEADERS}),t=le.OAUTH.REGEX.AUTH_SCRIPT.exec(e.data)[1];return(await l(this,we).call(this,{url:t,baseURL:le.URLS.YT_BASE})).data.replace(/\n/g,"").match(le.OAUTH.REGEX.CLIENT_IDENTITY).groups},"#getClientIdentity");uu.exports=Bn});var du=g(se=>{var d=require("protocol-buffers-encodings"),v=d.varint,M=d.skip,Fa=se.VisitorData={buffer:!0,encodingLength:null,encode:null,decode:null},Fn=se.ChannelAnalytics={buffer:!0,encodingLength:null,encode:null,decode:null},Yn=se.InnertubePayload={buffer:!0,encodingLength:null,encode:null,decode:null},$n=se.SoundInfoParams={buffer:!0,encodingLength:null,encode:null,decode:null},Wn=se.NotificationPreferences={buffer:!0,encodingLength:null,encode:null,decode:null},Gn=se.LiveMessageParams={buffer:!0,encodingLength:null,encode:null,decode:null},Jt=se.GetCommentsSectionParams={buffer:!0,encodingLength:null,encode:null,decode:null},Hn=se.CreateCommentParams={buffer:!0,encodingLength:null,encode:null,decode:null},zn=se.CreateCommentReplyParams={buffer:!0,encodingLength:null,encode:null,decode:null},Kn=se.PeformCommentActionParams={buffer:!0,encodingLength:null,encode:null,decode:null},Qn=se.MusicSearchFilter={buffer:!0,encodingLength:null,encode:null,decode:null},Jn=se.SearchFilter={buffer:!0,encodingLength:null,encode:null,decode:null};Jx();Xx();Zx();jx();fx();eT();tT();nT();iT();sT();rT();oT();function Jx(){Fa.encodingLength=c,Fa.encode=e,Fa.decode=t;function c(i){var a=0;if(x(i.id)){var s=d.string.encodingLength(i.id);a+=1+s}if(x(i.timestamp)){var s=d.int32.encodingLength(i.timestamp);a+=1+s}return a}n(c,"encodingLength");function e(i,a,s){s||(s=0),a||(a=Buffer.allocUnsafe(c(i)));var r=s;return x(i.id)&&(a[s++]=10,d.string.encode(i.id,a,s),s+=d.string.encode.bytes),x(i.timestamp)&&(a[s++]=40,d.int32.encode(i.timestamp,a,s),s+=d.int32.encode.bytes),e.bytes=s-r,a}n(e,"encode");function t(i,a,s){if(a||(a=0),s||(s=i.length),!(s<=i.length&&a<=i.length))throw new Error("Decoded message is not valid");for(var r=a,o={id:"",timestamp:0};;){if(s<=a)return t.bytes=a-r,o;var p=v.decode(i,a);a+=v.decode.bytes;var h=p>>3;switch(h){case 1:o.id=d.string.decode(i,a),a+=d.string.decode.bytes;break;case 5:o.timestamp=d.int32.decode(i,a),a+=d.int32.decode.bytes;break;default:a=M(p&7,i,a)}}}n(t,"decode")}n(Jx,"defineVisitorData");function Xx(){var c=Fn.Params={buffer:!0,encodingLength:null,encode:null,decode:null};e();function e(){c.encodingLength=s,c.encode=r,c.decode=o;function s(p){var h=0;if(x(p.channel_id)){var u=d.string.encodingLength(p.channel_id);h+=2+u}return h}n(s,"encodingLength");function r(p,h,u){u||(u=0),h||(h=Buffer.allocUnsafe(s(p)));var m=u;return x(p.channel_id)&&(h[u++]=202,h[u++]=62,d.string.encode(p.channel_id,h,u),u+=d.string.encode.bytes),r.bytes=u-m,h}n(r,"encode");function o(p,h,u){if(h||(h=0),u||(u=p.length),!(u<=p.length&&h<=p.length))throw new Error("Decoded message is not valid");for(var m=h,w={channel_id:""};;){if(u<=h)return o.bytes=h-m,w;var b=v.decode(p,h);h+=v.decode.bytes;var y=b>>3;switch(y){case 1001:w.channel_id=d.string.decode(p,h),h+=d.string.decode.bytes;break;default:h=M(b&7,p,h)}}}n(o,"decode")}n(e,"defineParams"),Fn.encodingLength=t,Fn.encode=i,Fn.decode=a;function t(s){var r=0;if(x(s.params)){var o=c.encodingLength(s.params);r+=v.encodingLength(o),r+=2+o}return r}n(t,"encodingLength");function i(s,r,o){o||(o=0),r||(r=Buffer.allocUnsafe(t(s)));var p=o;return x(s.params)&&(r[o++]=130,r[o++]=2,v.encode(c.encodingLength(s.params),r,o),o+=v.encode.bytes,c.encode(s.params,r,o),o+=c.encode.bytes),i.bytes=o-p,r}n(i,"encode");function a(s,r,o){if(r||(r=0),o||(o=s.length),!(o<=s.length&&r<=s.length))throw new Error("Decoded message is not valid");for(var p=r,h={params:null};;){if(o<=r)return a.bytes=r-p,h;var u=v.decode(s,r);r+=v.decode.bytes;var m=u>>3;switch(m){case 32:var w=v.decode(s,r);r+=v.decode.bytes,h.params=c.decode(s,r,r+w),r+=c.decode.bytes;break;default:r=M(u&7,s,r)}}}n(a,"decode")}n(Xx,"defineChannelAnalytics");function Zx(){var c=Yn.Context={buffer:!0,encodingLength:null,encode:null,decode:null};e();function e(){var s=c.Client={buffer:!0,encodingLength:null,encode:null,decode:null};r();function r(){s.encodingLength=u,s.encode=m,s.decode=w;function u(b){var y=0;if(x(b.unkparam)){var _=d.int32.encodingLength(b.unkparam);y+=2+_}if(x(b.client_version)){var _=d.string.encodingLength(b.client_version);y+=2+_}if(x(b.client_name)){var _=d.string.encodingLength(b.client_name);y+=2+_}return y}n(u,"encodingLength");function m(b,y,_){_||(_=0),y||(y=Buffer.allocUnsafe(u(b)));var q=_;return x(b.unkparam)&&(y[_++]=128,y[_++]=1,d.int32.encode(b.unkparam,y,_),_+=d.int32.encode.bytes),x(b.client_version)&&(y[_++]=138,y[_++]=1,d.string.encode(b.client_version,y,_),_+=d.string.encode.bytes),x(b.client_name)&&(y[_++]=146,y[_++]=1,d.string.encode(b.client_name,y,_),_+=d.string.encode.bytes),m.bytes=_-q,y}n(m,"encode");function w(b,y,_){if(y||(y=0),_||(_=b.length),!(_<=b.length&&y<=b.length))throw new Error("Decoded message is not valid");for(var q=y,R={unkparam:0,client_version:"",client_name:""};;){if(_<=y)return w.bytes=y-q,R;var L=v.decode(b,y);y+=v.decode.bytes;var S=L>>3;switch(S){case 16:R.unkparam=d.int32.decode(b,y),y+=d.int32.decode.bytes;break;case 17:R.client_version=d.string.decode(b,y),y+=d.string.decode.bytes;break;case 18:R.client_name=d.string.decode(b,y),y+=d.string.decode.bytes;break;default:y=M(L&7,b,y)}}}n(w,"decode")}n(r,"defineClient"),c.encodingLength=o,c.encode=p,c.decode=h;function o(u){var m=0;if(x(u.client)){var w=s.encodingLength(u.client);m+=v.encodingLength(w),m+=1+w}return m}n(o,"encodingLength");function p(u,m,w){w||(w=0),m||(m=Buffer.allocUnsafe(o(u)));var b=w;return x(u.client)&&(m[w++]=10,v.encode(s.encodingLength(u.client),m,w),w+=v.encode.bytes,s.encode(u.client,m,w),w+=s.encode.bytes),p.bytes=w-b,m}n(p,"encode");function h(u,m,w){if(m||(m=0),w||(w=u.length),!(w<=u.length&&m<=u.length))throw new Error("Decoded message is not valid");for(var b=m,y={client:null};;){if(w<=m)return h.bytes=m-b,y;var _=v.decode(u,m);m+=v.decode.bytes;var q=_>>3;switch(q){case 1:var R=v.decode(u,m);m+=v.decode.bytes,y.client=s.decode(u,m,m+R),m+=s.decode.bytes;break;default:m=M(_&7,u,m)}}}n(h,"decode")}n(e,"defineContext"),Yn.encodingLength=t,Yn.encode=i,Yn.decode=a;function t(s){var r=0;if(x(s.context)){var o=c.encodingLength(s.context);r+=v.encodingLength(o),r+=1+o}if(x(s.target)){var o=d.string.encodingLength(s.target);r+=1+o}return r}n(t,"encodingLength");function i(s,r,o){o||(o=0),r||(r=Buffer.allocUnsafe(t(s)));var p=o;return x(s.context)&&(r[o++]=10,v.encode(c.encodingLength(s.context),r,o),o+=v.encode.bytes,c.encode(s.context,r,o),o+=c.encode.bytes),x(s.target)&&(r[o++]=18,d.string.encode(s.target,r,o),o+=d.string.encode.bytes),i.bytes=o-p,r}n(i,"encode");function a(s,r,o){if(r||(r=0),o||(o=s.length),!(o<=s.length&&r<=s.length))throw new Error("Decoded message is not valid");for(var p=r,h={context:null,target:""};;){if(o<=r)return a.bytes=r-p,h;var u=v.decode(s,r);r+=v.decode.bytes;var m=u>>3;switch(m){case 1:var w=v.decode(s,r);r+=v.decode.bytes,h.context=c.decode(s,r,r+w),r+=c.decode.bytes;break;case 2:h.target=d.string.decode(s,r),r+=d.string.decode.bytes;break;default:r=M(u&7,s,r)}}}n(a,"decode")}n(Zx,"defineInnertubePayload");function jx(){var c=$n.Sound={buffer:!0,encodingLength:null,encode:null,decode:null};e();function e(){var s=c.Params={buffer:!0,encodingLength:null,encode:null,decode:null};r();function r(){var u=s.Ids={buffer:!0,encodingLength:null,encode:null,decode:null};m();function m(){u.encodingLength=_,u.encode=q,u.decode=R;function _(L){var S=0;if(x(L.id_1)){var k=d.string.encodingLength(L.id_1);S+=1+k}if(x(L.id_2)){var k=d.string.encodingLength(L.id_2);S+=1+k}if(x(L.id_3)){var k=d.string.encodingLength(L.id_3);S+=1+k}return S}n(_,"encodingLength");function q(L,S,k){k||(k=0),S||(S=Buffer.allocUnsafe(_(L)));var P=k;return x(L.id_1)&&(S[k++]=10,d.string.encode(L.id_1,S,k),k+=d.string.encode.bytes),x(L.id_2)&&(S[k++]=18,d.string.encode(L.id_2,S,k),k+=d.string.encode.bytes),x(L.id_3)&&(S[k++]=26,d.string.encode(L.id_3,S,k),k+=d.string.encode.bytes),q.bytes=k-P,S}n(q,"encode");function R(L,S,k){if(S||(S=0),k||(k=L.length),!(k<=L.length&&S<=L.length))throw new Error("Decoded message is not valid");for(var P=S,B={id_1:"",id_2:"",id_3:""};;){if(k<=S)return R.bytes=S-P,B;var U=v.decode(L,S);S+=v.decode.bytes;var $=U>>3;switch($){case 1:B.id_1=d.string.decode(L,S),S+=d.string.decode.bytes;break;case 2:B.id_2=d.string.decode(L,S),S+=d.string.decode.bytes;break;case 3:B.id_3=d.string.decode(L,S),S+=d.string.decode.bytes;break;default:S=M(U&7,L,S)}}}n(R,"decode")}n(m,"defineIds"),s.encodingLength=w,s.encode=b,s.decode=y;function w(_){var q=0;if(x(_.ids)){var R=u.encodingLength(_.ids);q+=v.encodingLength(R),q+=1+R}return q}n(w,"encodingLength");function b(_,q,R){R||(R=0),q||(q=Buffer.allocUnsafe(w(_)));var L=R;return x(_.ids)&&(q[R++]=18,v.encode(u.encodingLength(_.ids),q,R),R+=v.encode.bytes,u.encode(_.ids,q,R),R+=u.encode.bytes),b.bytes=R-L,q}n(b,"encode");function y(_,q,R){if(q||(q=0),R||(R=_.length),!(R<=_.length&&q<=_.length))throw new Error("Decoded message is not valid");for(var L=q,S={ids:null};;){if(R<=q)return y.bytes=q-L,S;var k=v.decode(_,q);q+=v.decode.bytes;var P=k>>3;switch(P){case 2:var B=v.decode(_,q);q+=v.decode.bytes,S.ids=u.decode(_,q,q+B),q+=u.decode.bytes;break;default:q=M(k&7,_,q)}}}n(y,"decode")}n(r,"defineParams"),c.encodingLength=o,c.encode=p,c.decode=h;function o(u){var m=0;if(x(u.params)){var w=s.encodingLength(u.params);m+=v.encodingLength(w),m+=1+w}return m}n(o,"encodingLength");function p(u,m,w){w||(w=0),m||(m=Buffer.allocUnsafe(o(u)));var b=w;return x(u.params)&&(m[w++]=10,v.encode(s.encodingLength(u.params),m,w),w+=v.encode.bytes,s.encode(u.params,m,w),w+=s.encode.bytes),p.bytes=w-b,m}n(p,"encode");function h(u,m,w){if(m||(m=0),w||(w=u.length),!(w<=u.length&&m<=u.length))throw new Error("Decoded message is not valid");for(var b=m,y={params:null};;){if(w<=m)return h.bytes=m-b,y;var _=v.decode(u,m);m+=v.decode.bytes;var q=_>>3;switch(q){case 1:var R=v.decode(u,m);m+=v.decode.bytes,y.params=s.decode(u,m,m+R),m+=s.decode.bytes;break;default:m=M(_&7,u,m)}}}n(h,"decode")}n(e,"defineSound"),$n.encodingLength=t,$n.encode=i,$n.decode=a;function t(s){var r=0;if(x(s.sound)){var o=c.encodingLength(s.sound);r+=v.encodingLength(o),r+=2+o}return r}n(t,"encodingLength");function i(s,r,o){o||(o=0),r||(r=Buffer.allocUnsafe(t(s)));var p=o;return x(s.sound)&&(r[o++]=242,r[o++]=5,v.encode(c.encodingLength(s.sound),r,o),o+=v.encode.bytes,c.encode(s.sound,r,o),o+=c.encode.bytes),i.bytes=o-p,r}n(i,"encode");function a(s,r,o){if(r||(r=0),o||(o=s.length),!(o<=s.length&&r<=s.length))throw new Error("Decoded message is not valid");for(var p=r,h={sound:null};;){if(o<=r)return a.bytes=r-p,h;var u=v.decode(s,r);r+=v.decode.bytes;var m=u>>3;switch(m){case 94:var w=v.decode(s,r);r+=v.decode.bytes,h.sound=c.decode(s,r,r+w),r+=c.decode.bytes;break;default:r=M(u&7,s,r)}}}n(a,"decode")}n(jx,"defineSoundInfoParams");function fx(){var c=Wn.Preference={buffer:!0,encodingLength:null,encode:null,decode:null};e();function e(){c.encodingLength=s,c.encode=r,c.decode=o;function s(p){var h=0;if(x(p.index)){var u=d.int32.encodingLength(p.index);h+=1+u}return h}n(s,"encodingLength");function r(p,h,u){u||(u=0),h||(h=Buffer.allocUnsafe(s(p)));var m=u;return x(p.index)&&(h[u++]=8,d.int32.encode(p.index,h,u),u+=d.int32.encode.bytes),r.bytes=u-m,h}n(r,"encode");function o(p,h,u){if(h||(h=0),u||(u=p.length),!(u<=p.length&&h<=p.length))throw new Error("Decoded message is not valid");for(var m=h,w={index:0};;){if(u<=h)return o.bytes=h-m,w;var b=v.decode(p,h);h+=v.decode.bytes;var y=b>>3;switch(y){case 1:w.index=d.int32.decode(p,h),h+=d.int32.decode.bytes;break;default:h=M(b&7,p,h)}}}n(o,"decode")}n(e,"definePreference"),Wn.encodingLength=t,Wn.encode=i,Wn.decode=a;function t(s){var r=0;if(x(s.channel_id)){var o=d.string.encodingLength(s.channel_id);r+=1+o}if(x(s.pref_id)){var o=c.encodingLength(s.pref_id);r+=v.encodingLength(o),r+=1+o}if(x(s.number_0)){var o=d.int32.encodingLength(s.number_0);r+=1+o}if(x(s.number_1)){var o=d.int32.encodingLength(s.number_1);r+=1+o}return r}n(t,"encodingLength");function i(s,r,o){o||(o=0),r||(r=Buffer.allocUnsafe(t(s)));var p=o;return x(s.channel_id)&&(r[o++]=10,d.string.encode(s.channel_id,r,o),o+=d.string.encode.bytes),x(s.pref_id)&&(r[o++]=18,v.encode(c.encodingLength(s.pref_id),r,o),o+=v.encode.bytes,c.encode(s.pref_id,r,o),o+=c.encode.bytes),x(s.number_0)&&(r[o++]=24,d.int32.encode(s.number_0,r,o),o+=d.int32.encode.bytes),x(s.number_1)&&(r[o++]=32,d.int32.encode(s.number_1,r,o),o+=d.int32.encode.bytes),i.bytes=o-p,r}n(i,"encode");function a(s,r,o){if(r||(r=0),o||(o=s.length),!(o<=s.length&&r<=s.length))throw new Error("Decoded message is not valid");for(var p=r,h={channel_id:"",pref_id:null,number_0:0,number_1:0};;){if(o<=r)return a.bytes=r-p,h;var u=v.decode(s,r);r+=v.decode.bytes;var m=u>>3;switch(m){case 1:h.channel_id=d.string.decode(s,r),r+=d.string.decode.bytes;break;case 2:var w=v.decode(s,r);r+=v.decode.bytes,h.pref_id=c.decode(s,r,r+w),r+=c.decode.bytes;break;case 3:h.number_0=d.int32.decode(s,r),r+=d.int32.decode.bytes;break;case 4:h.number_1=d.int32.decode(s,r),r+=d.int32.decode.bytes;break;default:r=M(u&7,s,r)}}}n(a,"decode")}n(fx,"defineNotificationPreferences");function eT(){var c=Gn.Params={buffer:!0,encodingLength:null,encode:null,decode:null};e();function e(){var s=c.Ids={buffer:!0,encodingLength:null,encode:null,decode:null};r();function r(){s.encodingLength=u,s.encode=m,s.decode=w;function u(b){var y=0;if(x(b.channel_id)){var _=d.string.encodingLength(b.channel_id);y+=1+_}if(x(b.video_id)){var _=d.string.encodingLength(b.video_id);y+=1+_}return y}n(u,"encodingLength");function m(b,y,_){_||(_=0),y||(y=Buffer.allocUnsafe(u(b)));var q=_;return x(b.channel_id)&&(y[_++]=10,d.string.encode(b.channel_id,y,_),_+=d.string.encode.bytes),x(b.video_id)&&(y[_++]=18,d.string.encode(b.video_id,y,_),_+=d.string.encode.bytes),m.bytes=_-q,y}n(m,"encode");function w(b,y,_){if(y||(y=0),_||(_=b.length),!(_<=b.length&&y<=b.length))throw new Error("Decoded message is not valid");for(var q=y,R={channel_id:"",video_id:""};;){if(_<=y)return w.bytes=y-q,R;var L=v.decode(b,y);y+=v.decode.bytes;var S=L>>3;switch(S){case 1:R.channel_id=d.string.decode(b,y),y+=d.string.decode.bytes;break;case 2:R.video_id=d.string.decode(b,y),y+=d.string.decode.bytes;break;default:y=M(L&7,b,y)}}}n(w,"decode")}n(r,"defineIds"),c.encodingLength=o,c.encode=p,c.decode=h;function o(u){var m=0;if(x(u.ids)){var w=s.encodingLength(u.ids);m+=v.encodingLength(w),m+=1+w}return m}n(o,"encodingLength");function p(u,m,w){w||(w=0),m||(m=Buffer.allocUnsafe(o(u)));var b=w;return x(u.ids)&&(m[w++]=42,v.encode(s.encodingLength(u.ids),m,w),w+=v.encode.bytes,s.encode(u.ids,m,w),w+=s.encode.bytes),p.bytes=w-b,m}n(p,"encode");function h(u,m,w){if(m||(m=0),w||(w=u.length),!(w<=u.length&&m<=u.length))throw new Error("Decoded message is not valid");for(var b=m,y={ids:null};;){if(w<=m)return h.bytes=m-b,y;var _=v.decode(u,m);m+=v.decode.bytes;var q=_>>3;switch(q){case 5:var R=v.decode(u,m);m+=v.decode.bytes,y.ids=s.decode(u,m,m+R),m+=s.decode.bytes;break;default:m=M(_&7,u,m)}}}n(h,"decode")}n(e,"defineParams"),Gn.encodingLength=t,Gn.encode=i,Gn.decode=a;function t(s){var r=0;if(x(s.params)){var o=c.encodingLength(s.params);r+=v.encodingLength(o),r+=1+o}if(x(s.number_0)){var o=d.int32.encodingLength(s.number_0);r+=1+o}if(x(s.number_1)){var o=d.int32.encodingLength(s.number_1);r+=1+o}return r}n(t,"encodingLength");function i(s,r,o){o||(o=0),r||(r=Buffer.allocUnsafe(t(s)));var p=o;return x(s.params)&&(r[o++]=10,v.encode(c.encodingLength(s.params),r,o),o+=v.encode.bytes,c.encode(s.params,r,o),o+=c.encode.bytes),x(s.number_0)&&(r[o++]=16,d.int32.encode(s.number_0,r,o),o+=d.int32.encode.bytes),x(s.number_1)&&(r[o++]=24,d.int32.encode(s.number_1,r,o),o+=d.int32.encode.bytes),i.bytes=o-p,r}n(i,"encode");function a(s,r,o){if(r||(r=0),o||(o=s.length),!(o<=s.length&&r<=s.length))throw new Error("Decoded message is not valid");for(var p=r,h={params:null,number_0:0,number_1:0};;){if(o<=r)return a.bytes=r-p,h;var u=v.decode(s,r);r+=v.decode.bytes;var m=u>>3;switch(m){case 1:var w=v.decode(s,r);r+=v.decode.bytes,h.params=c.decode(s,r,r+w),r+=c.decode.bytes;break;case 2:h.number_0=d.int32.decode(s,r),r+=d.int32.decode.bytes;break;case 3:h.number_1=d.int32.decode(s,r),r+=d.int32.decode.bytes;break;default:r=M(u&7,s,r)}}}n(a,"decode")}n(eT,"defineLiveMessageParams");function tT(){var c=Jt.Context={buffer:!0,encodingLength:null,encode:null,decode:null},e=Jt.Params={buffer:!0,encodingLength:null,encode:null,decode:null};t(),i();function t(){c.encodingLength=o,c.encode=p,c.decode=h;function o(u){var m=0;if(x(u.video_id)){var w=d.string.encodingLength(u.video_id);m+=1+w}return m}n(o,"encodingLength");function p(u,m,w){w||(w=0),m||(m=Buffer.allocUnsafe(o(u)));var b=w;return x(u.video_id)&&(m[w++]=18,d.string.encode(u.video_id,m,w),w+=d.string.encode.bytes),p.bytes=w-b,m}n(p,"encode");function h(u,m,w){if(m||(m=0),w||(w=u.length),!(w<=u.length&&m<=u.length))throw new Error("Decoded message is not valid");for(var b=m,y={video_id:""};;){if(w<=m)return h.bytes=m-b,y;var _=v.decode(u,m);m+=v.decode.bytes;var q=_>>3;switch(q){case 2:y.video_id=d.string.decode(u,m),m+=d.string.decode.bytes;break;default:m=M(_&7,u,m)}}}n(h,"decode")}n(t,"defineContext");function i(){var o=e.Options={buffer:!0,encodingLength:null,encode:null,decode:null},p=e.RepliesOptions={buffer:!0,encodingLength:null,encode:null,decode:null};h(),u();function h(){o.encodingLength=y,o.encode=_,o.decode=q;function y(R){var L=0;if(x(R.video_id)){var S=d.string.encodingLength(R.video_id);L+=1+S}if(x(R.sort_by)){var S=d.int32.encodingLength(R.sort_by);L+=1+S}if(x(R.type)){var S=d.int32.encodingLength(R.type);L+=1+S}return L}n(y,"encodingLength");function _(R,L,S){S||(S=0),L||(L=Buffer.allocUnsafe(y(R)));var k=S;return x(R.video_id)&&(L[S++]=34,d.string.encode(R.video_id,L,S),S+=d.string.encode.bytes),x(R.sort_by)&&(L[S++]=48,d.int32.encode(R.sort_by,L,S),S+=d.int32.encode.bytes),x(R.type)&&(L[S++]=120,d.int32.encode(R.type,L,S),S+=d.int32.encode.bytes),_.bytes=S-k,L}n(_,"encode");function q(R,L,S){if(L||(L=0),S||(S=R.length),!(S<=R.length&&L<=R.length))throw new Error("Decoded message is not valid");for(var k=L,P={video_id:"",sort_by:0,type:0};;){if(S<=L)return q.bytes=L-k,P;var B=v.decode(R,L);L+=v.decode.bytes;var U=B>>3;switch(U){case 4:P.video_id=d.string.decode(R,L),L+=d.string.decode.bytes;break;case 6:P.sort_by=d.int32.decode(R,L),L+=d.int32.decode.bytes;break;case 15:P.type=d.int32.decode(R,L),L+=d.int32.decode.bytes;break;default:L=M(B&7,R,L)}}}n(q,"decode")}n(h,"defineOptions");function u(){var y=p.UnkOpts={buffer:!0,encodingLength:null,encode:null,decode:null};_();function _(){y.encodingLength=S,y.encode=k,y.decode=P;function S(B){var U=0;if(x(B.unk_param)){var $=d.int32.encodingLength(B.unk_param);U+=1+$}return U}n(S,"encodingLength");function k(B,U,$){$||($=0),U||(U=Buffer.allocUnsafe(S(B)));var ke=$;return x(B.unk_param)&&(U[$++]=8,d.int32.encode(B.unk_param,U,$),$+=d.int32.encode.bytes),k.bytes=$-ke,U}n(k,"encode");function P(B,U,$){if(U||(U=0),$||($=B.length),!($<=B.length&&U<=B.length))throw new Error("Decoded message is not valid");for(var ke=U,Q={unk_param:0};;){if($<=U)return P.bytes=U-ke,Q;var tu=v.decode(B,U);U+=v.decode.bytes;var kx=tu>>3;switch(kx){case 1:Q.unk_param=d.int32.decode(B,U),U+=d.int32.decode.bytes;break;default:U=M(tu&7,B,U)}}}n(P,"decode")}n(_,"defineUnkOpts"),p.encodingLength=q,p.encode=R,p.decode=L;function q(S){var k=0;if(x(S.comment_id)){var P=d.string.encodingLength(S.comment_id);k+=1+P}if(x(S.unkopts)){var P=y.encodingLength(S.unkopts);k+=v.encodingLength(P),k+=1+P}if(x(S.channel_id)){var P=d.string.encodingLength(S.channel_id);k+=1+P}if(x(S.video_id)){var P=d.string.encodingLength(S.video_id);k+=1+P}if(x(S.unk_param_1)){var P=d.int32.encodingLength(S.unk_param_1);k+=1+P}if(x(S.unk_param_2)){var P=d.int32.encodingLength(S.unk_param_2);k+=1+P}return k}n(q,"encodingLength");function R(S,k,P){P||(P=0),k||(k=Buffer.allocUnsafe(q(S)));var B=P;return x(S.comment_id)&&(k[P++]=18,d.string.encode(S.comment_id,k,P),P+=d.string.encode.bytes),x(S.unkopts)&&(k[P++]=34,v.encode(y.encodingLength(S.unkopts),k,P),P+=v.encode.bytes,y.encode(S.unkopts,k,P),P+=y.encode.bytes),x(S.channel_id)&&(k[P++]=42,d.string.encode(S.channel_id,k,P),P+=d.string.encode.bytes),x(S.video_id)&&(k[P++]=50,d.string.encode(S.video_id,k,P),P+=d.string.encode.bytes),x(S.unk_param_1)&&(k[P++]=64,d.int32.encode(S.unk_param_1,k,P),P+=d.int32.encode.bytes),x(S.unk_param_2)&&(k[P++]=72,d.int32.encode(S.unk_param_2,k,P),P+=d.int32.encode.bytes),R.bytes=P-B,k}n(R,"encode");function L(S,k,P){if(k||(k=0),P||(P=S.length),!(P<=S.length&&k<=S.length))throw new Error("Decoded message is not valid");for(var B=k,U={comment_id:"",unkopts:null,channel_id:"",video_id:"",unk_param_1:0,unk_param_2:0};;){if(P<=k)return L.bytes=k-B,U;var $=v.decode(S,k);k+=v.decode.bytes;var ke=$>>3;switch(ke){case 2:U.comment_id=d.string.decode(S,k),k+=d.string.decode.bytes;break;case 4:var Q=v.decode(S,k);k+=v.decode.bytes,U.unkopts=y.decode(S,k,k+Q),k+=y.decode.bytes;break;case 5:U.channel_id=d.string.decode(S,k),k+=d.string.decode.bytes;break;case 6:U.video_id=d.string.decode(S,k),k+=d.string.decode.bytes;break;case 8:U.unk_param_1=d.int32.decode(S,k),k+=d.int32.decode.bytes;break;case 9:U.unk_param_2=d.int32.decode(S,k),k+=d.int32.decode.bytes;break;default:k=M($&7,S,k)}}}n(L,"decode")}n(u,"defineRepliesOptions"),e.encodingLength=m,e.encode=w,e.decode=b;function m(y){var _=0;if(x(y.unk_token)){var q=d.string.encodingLength(y.unk_token);_+=1+q}if(x(y.opts)){var q=o.encodingLength(y.opts);_+=v.encodingLength(q),_+=1+q}if(x(y.replies_opts)){var q=p.encodingLength(y.replies_opts);_+=v.encodingLength(q),_+=1+q}if(x(y.page)){var q=d.int32.encodingLength(y.page);_+=1+q}if(x(y.target)){var q=d.string.encodingLength(y.target);_+=1+q}return _}n(m,"encodingLength");function w(y,_,q){q||(q=0),_||(_=Buffer.allocUnsafe(m(y)));var R=q;return x(y.unk_token)&&(_[q++]=10,d.string.encode(y.unk_token,_,q),q+=d.string.encode.bytes),x(y.opts)&&(_[q++]=34,v.encode(o.encodingLength(y.opts),_,q),q+=v.encode.bytes,o.encode(y.opts,_,q),q+=o.encode.bytes),x(y.replies_opts)&&(_[q++]=26,v.encode(p.encodingLength(y.replies_opts),_,q),q+=v.encode.bytes,p.encode(y.replies_opts,_,q),q+=p.encode.bytes),x(y.page)&&(_[q++]=40,d.int32.encode(y.page,_,q),q+=d.int32.encode.bytes),x(y.target)&&(_[q++]=66,d.string.encode(y.target,_,q),q+=d.string.encode.bytes),w.bytes=q-R,_}n(w,"encode");function b(y,_,q){if(_||(_=0),q||(q=y.length),!(q<=y.length&&_<=y.length))throw new Error("Decoded message is not valid");for(var R=_,L={unk_token:"",opts:null,replies_opts:null,page:0,target:""};;){if(q<=_)return b.bytes=_-R,L;var S=v.decode(y,_);_+=v.decode.bytes;var k=S>>3;switch(k){case 1:L.unk_token=d.string.decode(y,_),_+=d.string.decode.bytes;break;case 4:var P=v.decode(y,_);_+=v.decode.bytes,L.opts=o.decode(y,_,_+P),_+=o.decode.bytes;break;case 3:var P=v.decode(y,_);_+=v.decode.bytes,L.replies_opts=p.decode(y,_,_+P),_+=p.decode.bytes;break;case 5:L.page=d.int32.decode(y,_),_+=d.int32.decode.bytes;break;case 8:L.target=d.string.decode(y,_),_+=d.string.decode.bytes;break;default:_=M(S&7,y,_)}}}n(b,"decode")}n(i,"defineParams"),Jt.encodingLength=a,Jt.encode=s,Jt.decode=r;function a(o){var p=0;if(x(o.ctx)){var h=c.encodingLength(o.ctx);p+=v.encodingLength(h),p+=1+h}if(x(o.unk_param)){var h=d.int32.encodingLength(o.unk_param);p+=1+h}if(x(o.params)){var h=e.encodingLength(o.params);p+=v.encodingLength(h),p+=1+h}return p}n(a,"encodingLength");function s(o,p,h){h||(h=0),p||(p=Buffer.allocUnsafe(a(o)));var u=h;return x(o.ctx)&&(p[h++]=18,v.encode(c.encodingLength(o.ctx),p,h),h+=v.encode.bytes,c.encode(o.ctx,p,h),h+=c.encode.bytes),x(o.unk_param)&&(p[h++]=24,d.int32.encode(o.unk_param,p,h),h+=d.int32.encode.bytes),x(o.params)&&(p[h++]=50,v.encode(e.encodingLength(o.params),p,h),h+=v.encode.bytes,e.encode(o.params,p,h),h+=e.encode.bytes),s.bytes=h-u,p}n(s,"encode");function r(o,p,h){if(p||(p=0),h||(h=o.length),!(h<=o.length&&p<=o.length))throw new Error("Decoded message is not valid");for(var u=p,m={ctx:null,unk_param:0,params:null};;){if(h<=p)return r.bytes=p-u,m;var w=v.decode(o,p);p+=v.decode.bytes;var b=w>>3;switch(b){case 2:var y=v.decode(o,p);p+=v.decode.bytes,m.ctx=c.decode(o,p,p+y),p+=c.decode.bytes;break;case 3:m.unk_param=d.int32.decode(o,p),p+=d.int32.decode.bytes;break;case 6:var y=v.decode(o,p);p+=v.decode.bytes,m.params=e.decode(o,p,p+y),p+=e.decode.bytes;break;default:p=M(w&7,o,p)}}}n(r,"decode")}n(tT,"defineGetCommentsSectionParams");function nT(){var c=Hn.Params={buffer:!0,encodingLength:null,encode:null,decode:null};e();function e(){c.encodingLength=s,c.encode=r,c.decode=o;function s(p){var h=0;if(x(p.index)){var u=d.int32.encodingLength(p.index);h+=1+u}return h}n(s,"encodingLength");function r(p,h,u){u||(u=0),h||(h=Buffer.allocUnsafe(s(p)));var m=u;return x(p.index)&&(h[u++]=8,d.int32.encode(p.index,h,u),u+=d.int32.encode.bytes),r.bytes=u-m,h}n(r,"encode");function o(p,h,u){if(h||(h=0),u||(u=p.length),!(u<=p.length&&h<=p.length))throw new Error("Decoded message is not valid");for(var m=h,w={index:0};;){if(u<=h)return o.bytes=h-m,w;var b=v.decode(p,h);h+=v.decode.bytes;var y=b>>3;switch(y){case 1:w.index=d.int32.decode(p,h),h+=d.int32.decode.bytes;break;default:h=M(b&7,p,h)}}}n(o,"decode")}n(e,"defineParams"),Hn.encodingLength=t,Hn.encode=i,Hn.decode=a;function t(s){var r=0;if(x(s.video_id)){var o=d.string.encodingLength(s.video_id);r+=1+o}if(x(s.params)){var o=c.encodingLength(s.params);r+=v.encodingLength(o),r+=1+o}if(x(s.number)){var o=d.int32.encodingLength(s.number);r+=1+o}return r}n(t,"encodingLength");function i(s,r,o){o||(o=0),r||(r=Buffer.allocUnsafe(t(s)));var p=o;return x(s.video_id)&&(r[o++]=18,d.string.encode(s.video_id,r,o),o+=d.string.encode.bytes),x(s.params)&&(r[o++]=42,v.encode(c.encodingLength(s.params),r,o),o+=v.encode.bytes,c.encode(s.params,r,o),o+=c.encode.bytes),x(s.number)&&(r[o++]=80,d.int32.encode(s.number,r,o),o+=d.int32.encode.bytes),i.bytes=o-p,r}n(i,"encode");function a(s,r,o){if(r||(r=0),o||(o=s.length),!(o<=s.length&&r<=s.length))throw new Error("Decoded message is not valid");for(var p=r,h={video_id:"",params:null,number:0};;){if(o<=r)return a.bytes=r-p,h;var u=v.decode(s,r);r+=v.decode.bytes;var m=u>>3;switch(m){case 2:h.video_id=d.string.decode(s,r),r+=d.string.decode.bytes;break;case 5:var w=v.decode(s,r);r+=v.decode.bytes,h.params=c.decode(s,r,r+w),r+=c.decode.bytes;break;case 10:h.number=d.int32.decode(s,r),r+=d.int32.decode.bytes;break;default:r=M(u&7,s,r)}}}n(a,"decode")}n(nT,"defineCreateCommentParams");function iT(){var c=zn.UnknownParams={buffer:!0,encodingLength:null,encode:null,decode:null};e();function e(){c.encodingLength=s,c.encode=r,c.decode=o;function s(p){var h=0;if(x(p.unk_num)){var u=d.int32.encodingLength(p.unk_num);h+=1+u}return h}n(s,"encodingLength");function r(p,h,u){u||(u=0),h||(h=Buffer.allocUnsafe(s(p)));var m=u;return x(p.unk_num)&&(h[u++]=8,d.int32.encode(p.unk_num,h,u),u+=d.int32.encode.bytes),r.bytes=u-m,h}n(r,"encode");function o(p,h,u){if(h||(h=0),u||(u=p.length),!(u<=p.length&&h<=p.length))throw new Error("Decoded message is not valid");for(var m=h,w={unk_num:0};;){if(u<=h)return o.bytes=h-m,w;var b=v.decode(p,h);h+=v.decode.bytes;var y=b>>3;switch(y){case 1:w.unk_num=d.int32.decode(p,h),h+=d.int32.decode.bytes;break;default:h=M(b&7,p,h)}}}n(o,"decode")}n(e,"defineUnknownParams"),zn.encodingLength=t,zn.encode=i,zn.decode=a;function t(s){var r=0;if(x(s.video_id)){var o=d.string.encodingLength(s.video_id);r+=1+o}if(x(s.comment_id)){var o=d.string.encodingLength(s.comment_id);r+=1+o}if(x(s.params)){var o=c.encodingLength(s.params);r+=v.encodingLength(o),r+=1+o}if(x(s.unk_num)){var o=d.int32.encodingLength(s.unk_num);r+=1+o}return r}n(t,"encodingLength");function i(s,r,o){o||(o=0),r||(r=Buffer.allocUnsafe(t(s)));var p=o;return x(s.video_id)&&(r[o++]=18,d.string.encode(s.video_id,r,o),o+=d.string.encode.bytes),x(s.comment_id)&&(r[o++]=34,d.string.encode(s.comment_id,r,o),o+=d.string.encode.bytes),x(s.params)&&(r[o++]=42,v.encode(c.encodingLength(s.params),r,o),o+=v.encode.bytes,c.encode(s.params,r,o),o+=c.encode.bytes),x(s.unk_num)&&(r[o++]=80,d.int32.encode(s.unk_num,r,o),o+=d.int32.encode.bytes),i.bytes=o-p,r}n(i,"encode");function a(s,r,o){if(r||(r=0),o||(o=s.length),!(o<=s.length&&r<=s.length))throw new Error("Decoded message is not valid");for(var p=r,h={video_id:"",comment_id:"",params:null,unk_num:0};;){if(o<=r)return a.bytes=r-p,h;var u=v.decode(s,r);r+=v.decode.bytes;var m=u>>3;switch(m){case 2:h.video_id=d.string.decode(s,r),r+=d.string.decode.bytes;break;case 4:h.comment_id=d.string.decode(s,r),r+=d.string.decode.bytes;break;case 5:var w=v.decode(s,r);r+=v.decode.bytes,h.params=c.decode(s,r,r+w),r+=c.decode.bytes;break;case 10:h.unk_num=d.int32.decode(s,r),r+=d.int32.decode.bytes;break;default:r=M(u&7,s,r)}}}n(a,"decode")}n(iT,"defineCreateCommentReplyParams");function sT(){var c=Kn.TranslateCommentParams={buffer:!0,encodingLength:null,encode:null,decode:null};e();function e(){var s=c.Params={buffer:!0,encodingLength:null,encode:null,decode:null};r();function r(){var u=s.Comment={buffer:!0,encodingLength:null,encode:null,decode:null};m();function m(){u.encodingLength=_,u.encode=q,u.decode=R;function _(L){var S=0;if(x(L.text)){var k=d.string.encodingLength(L.text);S+=1+k}return S}n(_,"encodingLength");function q(L,S,k){k||(k=0),S||(S=Buffer.allocUnsafe(_(L)));var P=k;return x(L.text)&&(S[k++]=10,d.string.encode(L.text,S,k),k+=d.string.encode.bytes),q.bytes=k-P,S}n(q,"encode");function R(L,S,k){if(S||(S=0),k||(k=L.length),!(k<=L.length&&S<=L.length))throw new Error("Decoded message is not valid");for(var P=S,B={text:""};;){if(k<=S)return R.bytes=S-P,B;var U=v.decode(L,S);S+=v.decode.bytes;var $=U>>3;switch($){case 1:B.text=d.string.decode(L,S),S+=d.string.decode.bytes;break;default:S=M(U&7,L,S)}}}n(R,"decode")}n(m,"defineComment"),s.encodingLength=w,s.encode=b,s.decode=y;function w(_){var q=0;if(x(_.comment)){var R=u.encodingLength(_.comment);q+=v.encodingLength(R),q+=1+R}return q}n(w,"encodingLength");function b(_,q,R){R||(R=0),q||(q=Buffer.allocUnsafe(w(_)));var L=R;return x(_.comment)&&(q[R++]=10,v.encode(u.encodingLength(_.comment),q,R),R+=v.encode.bytes,u.encode(_.comment,q,R),R+=u.encode.bytes),b.bytes=R-L,q}n(b,"encode");function y(_,q,R){if(q||(q=0),R||(R=_.length),!(R<=_.length&&q<=_.length))throw new Error("Decoded message is not valid");for(var L=q,S={comment:null};;){if(R<=q)return y.bytes=q-L,S;var k=v.decode(_,q);q+=v.decode.bytes;var P=k>>3;switch(P){case 1:var B=v.decode(_,q);q+=v.decode.bytes,S.comment=u.decode(_,q,q+B),q+=u.decode.bytes;break;default:q=M(k&7,_,q)}}}n(y,"decode")}n(r,"defineParams"),c.encodingLength=o,c.encode=p,c.decode=h;function o(u){var m=0;if(x(u.params)){var w=s.encodingLength(u.params);m+=v.encodingLength(w),m+=1+w}if(x(u.comment_id)){var w=d.string.encodingLength(u.comment_id);m+=1+w}if(x(u.target_language)){var w=d.string.encodingLength(u.target_language);m+=1+w}return m}n(o,"encodingLength");function p(u,m,w){w||(w=0),m||(m=Buffer.allocUnsafe(o(u)));var b=w;return x(u.params)&&(m[w++]=26,v.encode(s.encodingLength(u.params),m,w),w+=v.encode.bytes,s.encode(u.params,m,w),w+=s.encode.bytes),x(u.comment_id)&&(m[w++]=18,d.string.encode(u.comment_id,m,w),w+=d.string.encode.bytes),x(u.target_language)&&(m[w++]=34,d.string.encode(u.target_language,m,w),w+=d.string.encode.bytes),p.bytes=w-b,m}n(p,"encode");function h(u,m,w){if(m||(m=0),w||(w=u.length),!(w<=u.length&&m<=u.length))throw new Error("Decoded message is not valid");for(var b=m,y={params:null,comment_id:"",target_language:""};;){if(w<=m)return h.bytes=m-b,y;var _=v.decode(u,m);m+=v.decode.bytes;var q=_>>3;switch(q){case 3:var R=v.decode(u,m);m+=v.decode.bytes,y.params=s.decode(u,m,m+R),m+=s.decode.bytes;break;case 2:y.comment_id=d.string.decode(u,m),m+=d.string.decode.bytes;break;case 4:y.target_language=d.string.decode(u,m),m+=d.string.decode.bytes;break;default:m=M(_&7,u,m)}}}n(h,"decode")}n(e,"defineTranslateCommentParams"),Kn.encodingLength=t,Kn.encode=i,Kn.decode=a;function t(s){var r=0;if(x(s.type)){var o=d.int32.encodingLength(s.type);r+=1+o}if(x(s.comment_id)){var o=d.string.encodingLength(s.comment_id);r+=1+o}if(x(s.video_id)){var o=d.string.encodingLength(s.video_id);r+=1+o}if(x(s.unk_num)){var o=d.int32.encodingLength(s.unk_num);r+=1+o}if(x(s.channel_id)){var o=d.string.encodingLength(s.channel_id);r+=2+o}if(x(s.translate_comment_params)){var o=c.encodingLength(s.translate_comment_params);r+=v.encodingLength(o),r+=2+o}return r}n(t,"encodingLength");function i(s,r,o){o||(o=0),r||(r=Buffer.allocUnsafe(t(s)));var p=o;return x(s.type)&&(r[o++]=8,d.int32.encode(s.type,r,o),o+=d.int32.encode.bytes),x(s.comment_id)&&(r[o++]=26,d.string.encode(s.comment_id,r,o),o+=d.string.encode.bytes),x(s.video_id)&&(r[o++]=42,d.string.encode(s.video_id,r,o),o+=d.string.encode.bytes),x(s.unk_num)&&(r[o++]=16,d.int32.encode(s.unk_num,r,o),o+=d.int32.encode.bytes),x(s.channel_id)&&(r[o++]=186,r[o++]=1,d.string.encode(s.channel_id,r,o),o+=d.string.encode.bytes),x(s.translate_comment_params)&&(r[o++]=250,r[o++]=1,v.encode(c.encodingLength(s.translate_comment_params),r,o),o+=v.encode.bytes,c.encode(s.translate_comment_params,r,o),o+=c.encode.bytes),i.bytes=o-p,r}n(i,"encode");function a(s,r,o){if(r||(r=0),o||(o=s.length),!(o<=s.length&&r<=s.length))throw new Error("Decoded message is not valid");for(var p=r,h={type:0,comment_id:"",video_id:"",unk_num:0,channel_id:"",translate_comment_params:null};;){if(o<=r)return a.bytes=r-p,h;var u=v.decode(s,r);r+=v.decode.bytes;var m=u>>3;switch(m){case 1:h.type=d.int32.decode(s,r),r+=d.int32.decode.bytes;break;case 3:h.comment_id=d.string.decode(s,r),r+=d.string.decode.bytes;break;case 5:h.video_id=d.string.decode(s,r),r+=d.string.decode.bytes;break;case 2:h.unk_num=d.int32.decode(s,r),r+=d.int32.decode.bytes;break;case 23:h.channel_id=d.string.decode(s,r),r+=d.string.decode.bytes;break;case 31:var w=v.decode(s,r);r+=v.decode.bytes,h.translate_comment_params=c.decode(s,r,r+w),r+=c.decode.bytes;break;default:r=M(u&7,s,r)}}}n(a,"decode")}n(sT,"definePeformCommentActionParams");function rT(){var c=Qn.Filters={buffer:!0,encodingLength:null,encode:null,decode:null};e();function e(){var s=c.Type={buffer:!0,encodingLength:null,encode:null,decode:null};r();function r(){s.encodingLength=u,s.encode=m,s.decode=w;function u(b){var y=0;if(x(b.all)){var _=d.int32.encodingLength(b.all);y+=1+_}if(x(b.song)){var _=d.int32.encodingLength(b.song);y+=1+_}if(x(b.video)){var _=d.int32.encodingLength(b.video);y+=1+_}if(x(b.album)){var _=d.int32.encodingLength(b.album);y+=1+_}if(x(b.artist)){var _=d.int32.encodingLength(b.artist);y+=1+_}if(x(b.playlist)){var _=d.int32.encodingLength(b.playlist);y+=1+_}return y}n(u,"encodingLength");function m(b,y,_){_||(_=0),y||(y=Buffer.allocUnsafe(u(b)));var q=_;return x(b.all)&&(y[_++]=0,d.int32.encode(b.all,y,_),_+=d.int32.encode.bytes),x(b.song)&&(y[_++]=8,d.int32.encode(b.song,y,_),_+=d.int32.encode.bytes),x(b.video)&&(y[_++]=16,d.int32.encode(b.video,y,_),_+=d.int32.encode.bytes),x(b.album)&&(y[_++]=24,d.int32.encode(b.album,y,_),_+=d.int32.encode.bytes),x(b.artist)&&(y[_++]=32,d.int32.encode(b.artist,y,_),_+=d.int32.encode.bytes),x(b.playlist)&&(y[_++]=40,d.int32.encode(b.playlist,y,_),_+=d.int32.encode.bytes),m.bytes=_-q,y}n(m,"encode");function w(b,y,_){if(y||(y=0),_||(_=b.length),!(_<=b.length&&y<=b.length))throw new Error("Decoded message is not valid");for(var q=y,R={all:0,song:0,video:0,album:0,artist:0,playlist:0};;){if(_<=y)return w.bytes=y-q,R;var L=v.decode(b,y);y+=v.decode.bytes;var S=L>>3;switch(S){case 0:R.all=d.int32.decode(b,y),y+=d.int32.decode.bytes;break;case 1:R.song=d.int32.decode(b,y),y+=d.int32.decode.bytes;break;case 2:R.video=d.int32.decode(b,y),y+=d.int32.decode.bytes;break;case 3:R.album=d.int32.decode(b,y),y+=d.int32.decode.bytes;break;case 4:R.artist=d.int32.decode(b,y),y+=d.int32.decode.bytes;break;case 5:R.playlist=d.int32.decode(b,y),y+=d.int32.decode.bytes;break;default:y=M(L&7,b,y)}}}n(w,"decode")}n(r,"defineType"),c.encodingLength=o,c.encode=p,c.decode=h;function o(u){var m=0;if(x(u.type)){var w=s.encodingLength(u.type);m+=v.encodingLength(w),m+=2+w}return m}n(o,"encodingLength");function p(u,m,w){w||(w=0),m||(m=Buffer.allocUnsafe(o(u)));var b=w;return x(u.type)&&(m[w++]=138,m[w++]=1,v.encode(s.encodingLength(u.type),m,w),w+=v.encode.bytes,s.encode(u.type,m,w),w+=s.encode.bytes),p.bytes=w-b,m}n(p,"encode");function h(u,m,w){if(m||(m=0),w||(w=u.length),!(w<=u.length&&m<=u.length))throw new Error("Decoded message is not valid");for(var b=m,y={type:null};;){if(w<=m)return h.bytes=m-b,y;var _=v.decode(u,m);m+=v.decode.bytes;var q=_>>3;switch(q){case 17:var R=v.decode(u,m);m+=v.decode.bytes,y.type=s.decode(u,m,m+R),m+=s.decode.bytes;break;default:m=M(_&7,u,m)}}}n(h,"decode")}n(e,"defineFilters"),Qn.encodingLength=t,Qn.encode=i,Qn.decode=a;function t(s){var r=0;if(x(s.filters)){var o=c.encodingLength(s.filters);r+=v.encodingLength(o),r+=1+o}return r}n(t,"encodingLength");function i(s,r,o){o||(o=0),r||(r=Buffer.allocUnsafe(t(s)));var p=o;return x(s.filters)&&(r[o++]=18,v.encode(c.encodingLength(s.filters),r,o),o+=v.encode.bytes,c.encode(s.filters,r,o),o+=c.encode.bytes),i.bytes=o-p,r}n(i,"encode");function a(s,r,o){if(r||(r=0),o||(o=s.length),!(o<=s.length&&r<=s.length))throw new Error("Decoded message is not valid");for(var p=r,h={filters:null};;){if(o<=r)return a.bytes=r-p,h;var u=v.decode(s,r);r+=v.decode.bytes;var m=u>>3;switch(m){case 2:var w=v.decode(s,r);r+=v.decode.bytes,h.filters=c.decode(s,r,r+w),r+=c.decode.bytes;break;default:r=M(u&7,s,r)}}}n(a,"decode")}n(rT,"defineMusicSearchFilter");function oT(){var c=Jn.Filters={buffer:!0,encodingLength:null,encode:null,decode:null};e();function e(){c.encodingLength=s,c.encode=r,c.decode=o;function s(p){var h=0;if(x(p.upload_date)){var u=d.int32.encodingLength(p.upload_date);h+=1+u}if(x(p.type)){var u=d.int32.encodingLength(p.type);h+=1+u}if(x(p.duration)){var u=d.int32.encodingLength(p.duration);h+=1+u}return h}n(s,"encodingLength");function r(p,h,u){u||(u=0),h||(h=Buffer.allocUnsafe(s(p)));var m=u;return x(p.upload_date)&&(h[u++]=8,d.int32.encode(p.upload_date,h,u),u+=d.int32.encode.bytes),x(p.type)&&(h[u++]=16,d.int32.encode(p.type,h,u),u+=d.int32.encode.bytes),x(p.duration)&&(h[u++]=24,d.int32.encode(p.duration,h,u),u+=d.int32.encode.bytes),r.bytes=u-m,h}n(r,"encode");function o(p,h,u){if(h||(h=0),u||(u=p.length),!(u<=p.length&&h<=p.length))throw new Error("Decoded message is not valid");for(var m=h,w={upload_date:0,type:0,duration:0};;){if(u<=h)return o.bytes=h-m,w;var b=v.decode(p,h);h+=v.decode.bytes;var y=b>>3;switch(y){case 1:w.upload_date=d.int32.decode(p,h),h+=d.int32.decode.bytes;break;case 2:w.type=d.int32.decode(p,h),h+=d.int32.decode.bytes;break;case 3:w.duration=d.int32.decode(p,h),h+=d.int32.decode.bytes;break;default:h=M(b&7,p,h)}}}n(o,"decode")}n(e,"defineFilters"),Jn.encodingLength=t,Jn.encode=i,Jn.decode=a;function t(s){var r=0;if(x(s.sort_by)){var o=d.int32.encodingLength(s.sort_by);r+=1+o}if(x(s.no_filter)){var o=d.int32.encodingLength(s.no_filter);r+=2+o}if(x(s.filters)){var o=c.encodingLength(s.filters);r+=v.encodingLength(o),r+=1+o}return r}n(t,"encodingLength");function i(s,r,o){o||(o=0),r||(r=Buffer.allocUnsafe(t(s)));var p=o;return x(s.sort_by)&&(r[o++]=8,d.int32.encode(s.sort_by,r,o),o+=d.int32.encode.bytes),x(s.no_filter)&&(r[o++]=152,r[o++]=1,d.int32.encode(s.no_filter,r,o),o+=d.int32.encode.bytes),x(s.filters)&&(r[o++]=18,v.encode(c.encodingLength(s.filters),r,o),o+=v.encode.bytes,c.encode(s.filters,r,o),o+=c.encode.bytes),i.bytes=o-p,r}n(i,"encode");function a(s,r,o){if(r||(r=0),o||(o=s.length),!(o<=s.length&&r<=s.length))throw new Error("Decoded message is not valid");for(var p=r,h={sort_by:0,no_filter:0,filters:null};;){if(o<=r)return a.bytes=r-p,h;var u=v.decode(s,r);r+=v.decode.bytes;var m=u>>3;switch(m){case 1:h.sort_by=d.int32.decode(s,r),r+=d.int32.decode.bytes;break;case 19:h.no_filter=d.int32.decode(s,r),r+=d.int32.decode.bytes;break;case 2:var w=v.decode(s,r);r+=v.decode.bytes,h.filters=c.decode(s,r,r+w),r+=c.decode.bytes;break;default:r=M(u&7,s,r)}}}n(a,"decode")}n(oT,"defineSearchFilter");function x(c){return c!=null&&(typeof c!="number"||!isNaN(c))}n(x,"defined")});var ct=g((XR,pu)=>{"use strict";var he=du(),Xn=class{static encodeVisitorData(e,t){let i=he.VisitorData.encode({id:e,timestamp:t});return encodeURIComponent(Buffer.from(i).toString("base64").replace(/\/|\+/g,"_"))}static encodeChannelAnalyticsParams(e){let t=he.ChannelAnalytics.encode({params:{channel_id:e}});return encodeURIComponent(Buffer.from(t).toString("base64"))}static encodeSearchFilters(e){let t={all:null,hour:1,today:2,week:3,month:4,year:5},i={all:null,video:1,channel:2,playlist:3,movie:4},a={all:null,short:1,long:2,medium:3},s={relevance:null,rating:1,upload_date:2,view_count:3},r={};if(e?r.filters={}:r.no_filter=0,e){if(e.upload_date&&e.type!=="video")throw new Error(`Upload date filter cannot be used with type ${e.type}`);e.upload_date&&(r.filters.upload_date=t[e.upload_date]),e.type&&(r.filters.type=i[e.type]),e.duration&&(r.filters.duration=a[e.duration]),e.sort_by&&e.sort_by!=="relevance"&&(r.sort_by=s[e.sort_by])}let o=he.SearchFilter.encode(r);return encodeURIComponent(Buffer.from(o).toString("base64"))}static encodeMusicSearchFilters(e={}){let t={filters:{type:{}}};t.filters.type[e.type||"all"]=1;let i=he.MusicSearchFilter.encode(t);return encodeURIComponent(Buffer.from(i).toString("base64"))}static encodeMessageParams(e,t){let i=he.LiveMessageParams.encode({params:{ids:{channel_id:e,video_id:t}},number_0:1,number_1:4});return Buffer.from(encodeURIComponent(Buffer.from(i).toString("base64"))).toString("base64")}static encodeCommentsSectionParams(e,t={}){let i={TOP_COMMENTS:0,NEWEST_FIRST:1},a=he.GetCommentsSectionParams.encode({ctx:{video_id:e},unk_param:6,params:{opts:{video_id:e,sort_by:i[t.sort_by||"TOP_COMMENTS"],type:t.type||2},target:"comments-section"}});return encodeURIComponent(Buffer.from(a).toString("base64"))}static encodeCommentRepliesParams(e,t){let i=he.GetCommentsSectionParams.encode({ctx:{video_id:e},unk_param:6,params:{replies_opts:{video_id:e,comment_id:t,unkopts:{unk_param:0},unk_param_1:1,unk_param_2:10,channel_id:" "},target:`comment-replies-item-${t}`}});return encodeURIComponent(Buffer.from(i).toString("base64"))}static encodeCommentParams(e){let t=he.CreateCommentParams.encode({video_id:e,params:{index:0},number:7});return encodeURIComponent(Buffer.from(t).toString("base64"))}static encodeCommentReplyParams(e,t){let i=he.CreateCommentReplyParams.encode({video_id:t,comment_id:e,params:{unk_num:0},unk_num:7});return encodeURIComponent(Buffer.from(i).toString("base64"))}static encodeCommentActionParams(e,t={}){let i={};i.type=e,i.video_id=t.video_id||"",i.comment_id=t.comment_id||"",i.unk_num=2,t.hasOwnProperty("text")&&(t.comment_id&&delete i.unk_num,i.translate_comment_params={params:{comment:{text:t.text}},comment_id:t.comment_id||"",target_language:t.target_language});let a=he.PeformCommentActionParams.encode(i);return encodeURIComponent(Buffer.from(a).toString("base64"))}static encodeNotificationPref(e,t){let i=he.NotificationPreferences.encode({channel_id:e,pref_id:{index:t},number_0:0,number_1:4});return encodeURIComponent(Buffer.from(i).toString("base64"))}static encodeSoundInfoParams(e){let t={sound:{params:{ids:{id_1:e,id_2:e,id_3:e}}}},i=he.SoundInfoParams.encode(t);return encodeURIComponent(Buffer.from(i).toString("base64"))}};n(Xn,"Proto");pu.exports=Xn});var Ya=g((ZR,mu)=>{"use strict";var Zn=class{constructor(e){this.itag=e.itag,this.mime_type=e.mimeType,this.bitrate=e.bitrate,this.average_bitrate=e.averageBitrate,this.width=e.width||null,this.height=e.height||null,this.init_range=e.initRange&&{start:parseInt(e.initRange.start),end:parseInt(e.initRange.end)},this.index_range=e.indexRange&&{start:parseInt(e.indexRange.start),end:parseInt(e.indexRange.end)},this.last_modified=new Date(Math.floor(parseInt(e.lastModified)/1e3)),this.content_length=parseInt(e.contentLength),this.quality=e.quality,this.quality_label=e.qualityLabel||null,this.fps=e.fps||null,this.url=e.url||null,this.cipher=e.cipher||null,this.signature_cipher=e.signatureCipher||null,this.audio_quality=e.audioQuality,this.approx_duration_ms=parseInt(e.approxDurationMs),this.audio_sample_rate=parseInt(e.audioSampleRate),this.audio_channels=e.audioChannels,this.loudness_db=e.loudnessDb,this.has_audio=!!e.audioBitrate||!!e.audioQuality,this.has_video=!!e.qualityLabel}decipher(e){return e.decipher(this.url,this.signature_cipher,this.cipher)}};n(Zn,"Format");mu.exports=Zn});var O=g((jR,gu)=>{"use strict";var at=class{url;width;height;constructor({url:e,width:t,height:i}){this.url=e,this.width=t,this.height=i}static fromResponse(e){if(!(!e||!e.thumbnails))return e.thumbnails.map(t=>new at(t)).sort((t,i)=>i.width-t.width)}};n(at,"Thumbnail");gu.exports=at});var $a=g((fR,_u)=>{"use strict";var cT=O(),jn=class{id;channel_id;title;keywords;short_description;author;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=cT.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_content=!!e.isLiveContent,this.is_crawlable=!!e.isCrawlable}};n(jn,"VideoDetails");_u.exports=jn});var wu=g((e0,yu)=>{"use strict";var aT=E(),fn=class{type="AppendContinuationItemsAction";constructor(e){this.items=aT.parse(e.continuationItems),this.target=e.target}};n(fn,"AppendContinuationItemsAction");yu.exports=fn});var bu=g((t0,vu)=>{"use strict";var lT=E(),ei=class{type="OpenPopupAction";constructor(e){this.popup=lT.parse(e.popup),this.popup_type=e.popupType}};n(ei,"OpenPopupAction");vu.exports=ei});var Wa=g((n0,xu)=>{"use strict";var ti=class{type="DataModelSection";constructor(e){this.title=e.title,this.subtitle=e.subtitle,this.metric_value=e.metricValue,this.comparison_indicator=e.comparisonIndicator,this.series_configuration={line_series:{lines_data:e.seriesConfiguration.lineSeries.linesData,domain_axis:e.seriesConfiguration.lineSeries.domainAxis,measure_axis:e.seriesConfiguration.lineSeries.measureAxis}}}};n(ti,"DataModelSection");xu.exports=ti});var qu=g((i0,Tu)=>{"use strict";var uT=Wa(),ni=class{type="AnalyticsMainAppKeyMetrics";constructor(e){this.period=e.cardData.periodLabel;let t=e.cardData.sections[0].analyticsKeyMetricsData;this.sections=t.dataModel.sections.map(i=>new uT(i))}};n(ni,"AnalyticsMainAppKeyMetrics");Tu.exports=ni});var Ga=g((s0,Eu)=>{"use strict";var hT=O(),ii=class{type="AnalyticsVideo";constructor(e){this.title=e.videoTitle,this.metadata={views:e.videoDescription.split("\xB7")[0].trim(),published:e.videoDescription.split("\xB7")[1].trim(),thumbnails:hT.fromResponse(e.thumbnailDetails),duration:e.formattedLength,is_short:e.isShort}}};n(ii,"AnalyticsVideo");Eu.exports=ii});var Iu=g((r0,Su)=>{"use strict";var dT=Ga(),si=class{type="AnalyticsVodCarouselCard";constructor(e){this.title=e.title,this.videos=e.videoCarouselData.videos.map(t=>new dT(t))}};n(si,"AnalyticsVodCarouselCard");Su.exports=si});var A=g((o0,Cu)=>{"use strict";var Ge=E(),ri=class{type="NavigationEndpoint";constructor(e){var i,a,s,r,o,p,h,u,m,w,b,y,_,q,R,L,S,k,P,B,U,$,ke;let t=Object.keys(e||{}).find(Q=>Q.endsWith("Endpoint")||Q.endsWith("Command"));if(this.payload=(e==null?void 0:e[t])||{},Reflect.has(this.payload,"dialog")&&(this.dialog=Ge.parse(this.payload.dialog)),e!=null&&e.serviceEndpoint&&(e=e.serviceEndpoint),this.metadata={},(a=(i=e==null?void 0:e.commandMetadata)==null?void 0:i.webCommandMetadata)!=null&&a.url&&(this.metadata.url=e.commandMetadata.webCommandMetadata.url),(r=(s=e==null?void 0:e.commandMetadata)==null?void 0:s.webCommandMetadata)!=null&&r.webPageType&&(this.metadata.page_type=e.commandMetadata.webCommandMetadata.webPageType),(p=(o=e==null?void 0:e.commandMetadata)==null?void 0:o.webCommandMetadata)!=null&&p.apiUrl&&(this.metadata.api_url=e.commandMetadata.webCommandMetadata.apiUrl.replace("/youtubei/v1/","")),(u=(h=e==null?void 0:e.commandMetadata)==null?void 0:h.webCommandMetadata)!=null&&u.sendPost&&(this.metadata.send_post=e.commandMetadata.webCommandMetadata.sendPost),e!=null&&e.browseEndpoint){let Q=(w=(m=e==null?void 0:e.browseEndpoint)==null?void 0:m.browseEndpointContextSupportedConfigs)==null?void 0:w.browseEndpointContextMusicConfig;this.browse={id:((b=e==null?void 0:e.browseEndpoint)==null?void 0:b.browseId)||null,params:(e==null?void 0:e.browseEndpoint.params)||null,base_url:((y=e==null?void 0:e.browseEndpoint)==null?void 0:y.canonicalBaseUrl)||null,page_type:(Q==null?void 0:Q.pageType)||null}}if(e!=null&&e.watchEndpoint){let Q=(q=(_=e==null?void 0:e.watchEndpoint)==null?void 0:_.watchEndpointMusicSupportedConfigs)==null?void 0:q.watchEndpointMusicConfig;this.watch={video_id:(R=e==null?void 0:e.watchEndpoint)==null?void 0:R.videoId,playlist_id:(e==null?void 0:e.watchEndpoint.playlistId)||null,params:(e==null?void 0:e.watchEndpoint.params)||null,index:(e==null?void 0:e.watchEndpoint.index)||null,supported_onesie_config:(L=e==null?void 0:e.watchEndpoint)==null?void 0:L.watchEndpointSupportedOnesieConfig,music_video_type:(Q==null?void 0:Q.musicVideoType)||null}}e!=null&&e.searchEndpoint&&(this.search={query:e.searchEndpoint.query,params:e.searchEndpoint.params}),e!=null&&e.subscribeEndpoint&&(this.subscribe={channel_ids:e.subscribeEndpoint.channelIds,params:e.subscribeEndpoint.params}),e!=null&&e.unsubscribeEndpoint&&(this.unsubscribe={channel_ids:e.unsubscribeEndpoint.channelIds,params:e.unsubscribeEndpoint.params}),e!=null&&e.likeEndpoint&&(this.like={status:e.likeEndpoint.status,target:{video_id:e.likeEndpoint.target.videoId,playlist_id:e.likeEndpoint.target.playlistId},params:((S=e.likeEndpoint)==null?void 0:S.removeLikeParams)||((k=e.likeEndpoint)==null?void 0:k.likeParams)||((P=e.likeEndpoint)==null?void 0:P.dislikeParams)}),e!=null&&e.performCommentActionEndpoint&&(this.perform_comment_action={action:e==null?void 0:e.performCommentActionEndpoint.action}),e!=null&&e.offlineVideoEndpoint&&(this.offline_video={video_id:e.offlineVideoEndpoint.videoId,on_add_command:{get_download_action:{video_id:e.offlineVideoEndpoint.videoId,params:e.offlineVideoEndpoint.onAddCommand.getDownloadActionCommand.params}}}),e!=null&&e.continuationCommand&&(this.continuation={request:((B=e==null?void 0:e.continuationCommand)==null?void 0:B.request)||null,token:((U=e==null?void 0:e.continuationCommand)==null?void 0:U.token)||null}),e!=null&&e.feedbackEndpoint&&(this.feedback={token:e.feedbackEndpoint.feedbackToken}),e!=null&&e.watchPlaylistEndpoint&&(this.watch_playlist={playlist_id:($=e.watchPlaylistEndpoint)==null?void 0:$.playlistId}),e!=null&&e.playlistEditEndpoint&&(this.playlist_edit={playlist_id:e.playlistEditEndpoint.playlistId,actions:e.playlistEditEndpoint.actions.map(Q=>({action:Q.action,removed_video_id:Q.removedVideoId}))}),e!=null&&e.addToPlaylistEndpoint&&(this.add_to_playlist={video_id:e.addToPlaylistEndpoint.videoId}),e!=null&&e.addToPlaylistServiceEndpoint&&(this.add_to_playlist={video_id:e.addToPlaylistServiceEndpoint.videoId}),e!=null&&e.getReportFormEndpoint&&(this.get_report_form={params:e.getReportFormEndpoint.params}),e!=null&&e.liveChatItemContextMenuEndpoint&&(this.live_chat_item_context_menu={params:(ke=e==null?void 0:e.liveChatItemContextMenuEndpoint)==null?void 0:ke.params}),e!=null&&e.sendLiveChatVoteEndpoint&&(this.send_live_chat_vote={params:e.sendLiveChatVoteEndpoint.params}),e!=null&&e.liveChatItemContextMenuEndpoint&&(this.live_chat_item_context_menu={params:e.liveChatItemContextMenuEndpoint.params})}async callTest(e,t={parse:!0,params:{}}){if(!e)throw new Error("An active caller must be provided");let i=await e.execute(this.metadata.api_url,{...this.payload,...t.params});return t.parse?Ge.parseResponse(i.data):i}async call(e,t){if(!e)throw new Error("An active caller must be provided");if(this.continuation)switch(this.continuation.request){case"CONTINUATION_REQUEST_TYPE_BROWSE":{let i=await e.browse(this.continuation.token,{is_ctoken:!0});return Ge.parseResponse(i.data)}case"CONTINUATION_REQUEST_TYPE_SEARCH":{let i=await e.search({ctoken:this.continuation.token});return Ge.parseResponse(i.data)}case"CONTINUATION_REQUEST_TYPE_WATCH_NEXT":{let i=await e.next({ctoken:this.continuation.token});return Ge.parseResponse(i.data)}default:throw new Error(`${this.continuation.request} not implemented`)}if(this.search){let i=await e.search({query:this.search.query,params:this.search.params,client:t});return Ge.parseResponse(i.data)}if(this.browse){let i=await e.browse(this.browse.id,{...this.browse,client:t});return Ge.parseResponse(i.data)}if(this.like)return await e.engage(this.metadata.api_url,{video_id:this.like.target.video_id,params:this.like.params})}};n(ri,"NavigationEndpoint");Cu.exports=ri});var Ha=g((c0,Ru)=>{"use strict";var pT=A(),oi=class{constructor(e){this.text=e.text,this.endpoint=e.navigationEndpoint?new pT(e.navigationEndpoint):{}}};n(oi,"TextRun");Ru.exports=oi});var za=g((a0,ku)=>{"use strict";var mT=O(),ci=class{constructor(e){var t,i,a;this.text=((t=e.emoji)==null?void 0:t.emojiId)||((a=(i=e.emoji)==null?void 0:i.shortcuts)==null?void 0:a[0])||null,this.emoji={emoji_id:e.emoji.emojiId,shortcuts:e.emoji.shortcuts,search_terms:e.emoji.searchTerms,image:mT.fromResponse(e.emoji.image)}}};n(ci,"EmojiRun");ku.exports=ci});var C=g((l0,Lu)=>{"use strict";var gT=Ha(),_T=za(),ai=class{text;constructor(e){e!=null&&e.hasOwnProperty("runs")?(this.runs=e.runs.map(t=>t.emoji&&new _T(t)||new gT(t)),this.text=this.runs.map(t=>t.text).join("")):this.text=(e==null?void 0:e.simpleText)||"N/A"}toString(){return this.text}};n(ai,"Text");Lu.exports=ai});var ui=g((u0,Pu)=>{"use strict";var yT=C(),Ka=A(),li=class extends yT{type="NavigatableText";endpoint;constructor(e){var t,i;super(e),this.endpoint=(i=(t=e.runs)==null?void 0:t[0])!=null&&i.navigationEndpoint?new Ka(e.runs[0].navigationEndpoint):e.navigationEndpoint?new Ka(e.navigationEndpoint):e.titleNavigationEndpoint?new Ka(e.titleNavigationEndpoint):null}toJSON(){return this}};n(li,"NavigatableText");Pu.exports=li});var Z=g((h0,Nu)=>{"use strict";var wT=E(),vT=ui(),bT=O(),Au=ae(),te,hi=class{constructor(e,t,i){T(this,te,void 0);var a,s,r,o,p,h,u,m,w,b,y,_,q,R;I(this,te,new vT(e)),this.id=((s=(a=l(this,te).runs)==null?void 0:a[0].endpoint.browse)==null?void 0:s.id)||((o=(r=l(this,te).endpoint)==null?void 0:r.browse)==null?void 0:o.id)||"N/A",this.name=l(this,te).text||"N/A",this.thumbnails=i?bT.fromResponse(i):[],this.endpoint=((p=l(this,te).runs)==null?void 0:p[0].endpoint)||l(this,te).endpoint,this.badges=Array.isArray(t)?wT.parse(t):[],this.is_verified=((h=this.badges)==null?void 0:h.some(L=>L.style=="BADGE_STYLE_TYPE_VERIFIED"))||null,this.is_verified_artist=((u=this.badges)==null?void 0:u.some(L=>L.style=="BADGE_STYLE_TYPE_VERIFIED_ARTIST"))||null,this.url=((m=l(this,te).runs)==null?void 0:m[0].endpoint.browse)&&`${Au.URLS.YT_BASE}${((w=l(this,te).runs[0].endpoint.browse)==null?void 0:w.base_url)||`/u/${(b=l(this,te).runs[0].endpoint.browse)==null?void 0:b.id}`}`||`${Au.URLS.YT_BASE}${((_=(y=l(this,te).endpoint)==null?void 0:y.browse)==null?void 0:_.base_url)||`/u/${(R=(q=l(this,te).endpoint)==null?void 0:q.browse)==null?void 0:R.id}`}`||null}get best_thumbnail(){return this.thumbnails[0]}};n(hi,"Author"),te=new WeakMap;Nu.exports=hi});var Uu=g((d0,Ou)=>{"use strict";var xT=O(),di=class{type="BackstageImage";constructor(e){this.image=xT.fromResponse(e.image)}};n(di,"BackstageImage");Ou.exports=di});var Ja=g((p0,Du)=>{"use strict";var pi=E(),TT=Z(),Qa=C(),qT=A(),mi=class{type="BackstagePost";constructor(e){this.id=e.postId,this.author=new TT({...e.authorText,navigationEndpoint:e.authorEndpoint},null,e.authorThumbnail),this.content=new Qa(e.contentText,""),this.published=new Qa(e.publishedTimeText),this.poll_status=e.pollStatus,this.vote_status=e.voteStatus,this.likes=new Qa(e.voteCount),this.menu=pi.parse(e.actionMenu)||null,this.actions=pi.parse(e.actionButtons),this.vote_button=pi.parse(e.voteButton),this.surface=e.surface,this.endpoint=new qT(e.navigationEndpoint),this.attachment=pi.parse(e.backstageAttachment)||null}};n(mi,"BackstagePost");Du.exports=mi});var Mu=g((m0,Bu)=>{"use strict";var ET=E(),gi=class{type="BackstagePostThread";constructor(e){this.post=ET.parse(e.post)}};n(gi,"BackstagePostThread");Bu.exports=gi});var Fu=g((g0,Vu)=>{"use strict";var ST=E(),_i=class{type="BrowseFeedActions";constructor(e){this.contents=ST.parse(e.contents)}};n(_i,"BrowseFeedActions");Vu.exports=_i});var wi=g((_0,Yu)=>{"use strict";var IT=C(),CT=A(),yi=class{type="Button";constructor(e){var t,i,a,s;this.text=new IT(e.text).toString(),(t=e.accessibility)!=null&&t.label&&(this.label=(i=e.accessibility)==null?void 0:i.label),e.tooltip&&(this.tooltip=e.tooltip),(a=e.icon)!=null&&a.iconType&&(this.iconType=(s=e.icon)==null?void 0:s.iconType),this.endpoint=new CT(e.navigationEndpoint||e.serviceEndpoint||e.command)}};n(yi,"Button");Yu.exports=yi});var Wu=g((y0,$u)=>{"use strict";var Xa=E(),RT=Z(),Za=O(),kT=C(),vi=class{type="C4TabbedHeader";constructor(e){this.author=new RT({simpleText:e.title,navigationEndpoint:e.navigationEndpoint},e.badges,e.avatar),this.banner=e.banner?Za.fromResponse(e.banner):[],this.tv_banner=e.tvBanner?Za.fromResponse(e.tvBanner):[],this.mobile_banner=e.mobileBanner?Za.fromResponse(e.mobileBanner):[],this.subscribers=new kT(e.subscriberCountText),this.sponsor_button=e.sponsorButton&&Xa.parse(e.sponsorButton),this.subscribe_button=e.subscribeButton&&Xa.parse(e.subscribeButton),this.header_links=e.headerLinks&&Xa.parse(e.headerLinks)}};n(vi,"C4TabbedHeader");$u.exports=vi});var Hu=g((w0,Gu)=>{"use strict";var LT=C(),bi=class{type="CallToActionButton";constructor(e){this.label=new LT(e.label),this.icon_type=e.icon.iconType,this.style=e.style}};n(bi,"CallToActionButton");Gu.exports=bi});var Qu=g((v0,Ku)=>{"use strict";var zu=E(),xi=class{type="Card";constructor(e){this.teaser=zu.parse(e.teaser),this.content=zu.parse(e.content),this.card_id=e.cardId,this.feature=e.feature,this.cue_ranges=e.cueRanges.map(t=>({start_card_active_ms:t.startCardActiveMs,end_card_active_ms:t.endCardActiveMs,teaser_duration_ms:t.teaserDurationMs,icon_after_teaser_ms:t.iconAfterTeaserMs}))}};n(xi,"Card");Ku.exports=xi});var Xu=g((b0,Ju)=>{"use strict";var PT=E(),AT=C(),Ti=class{type="CardCollection";constructor(e){this.cards=PT.parse(e.cards),this.header=new AT(e.headerText),this.allow_teaser_dismiss=e.allowTeaserDismiss}};n(Ti,"CardCollection");Ju.exports=Ti});var ju=g((x0,Zu)=>{"use strict";var NT=Z(),OT=A(),ja=C(),qi=class{type="Channel";constructor(e){this.id=e.channelId,this.author=new NT({...e.title,navigationEndpoint:e.navigationEndpoint},e.ownerBadges,e.thumbnail),this.subscribers=new ja(e.subscriberCountText),this.videos=new ja(e.videoCountText),this.endpoint=new OT(e.navigationEndpoint),this.description_snippet=new ja(e.descriptionSnippet)}};n(qi,"Channel");Zu.exports=qi});var eh=g((T0,fu)=>{"use strict";var UT=O(),DT=A(),Xt=C(),BT=E(),Ei=class{type="ChannelAboutFullMetadata";constructor(e){this.id=e.channelId,this.name=new Xt(e.title),this.avatar=UT.fromResponse(e.avatar),this.canonical_channel_url=e.canonicalChannelUrl,this.views=new Xt(e.viewCountText),this.joined=new Xt(e.joinedDateText),this.description=new Xt(e.description),this.email_reveal=new DT(e.onBusinessEmailRevealClickCommand),this.can_reveal_email=!e.signInForBusinessEmail,this.country=new Xt(e.country),this.buttons=BT.parse(e.actionButtons)}};n(Ei,"ChannelAboutFullMetadata");fu.exports=Ei});var nh=g((q0,th)=>{"use strict";var MT=E(),VT=C(),Si=class{type="ChannelFeaturedContent";constructor(e){this.title=new VT(e.title),this.items=MT.parse(e.items)}};n(Si,"ChannelFeaturedContent");th.exports=Si});var sh=g((E0,ih)=>{"use strict";var FT=A(),YT=C(),$T=O(),Zt=class{constructor(e){this.endpoint=new FT(e.navigationEndpoint),this.icon=$T.fromResponse(e.icon),this.title=new YT(e.title)}};n(Zt,"HeaderLink");var Ii=class{type="ChannelHeaderLinks";constructor(e){var t,i;this.primary=((t=e.primaryLinks)==null?void 0:t.map(a=>new Zt(a)))||[],this.secondary=((i=e.secondaryLinks)==null?void 0:i.map(a=>new Zt(a)))||[]}};n(Ii,"ChannelHeaderLinks");ih.exports=Ii});var oh=g((S0,rh)=>{"use strict";var WT=O(),Ci=class{type="ChannelMetadata";constructor(e){this.title=e.title,this.description=e.description,this.url=e.channelUrl,this.rss_urls=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=WT.fromResponse(e.avatar),this.available_countries=e.availableCountryCodes,this.android_deep_link=e.androidDeepLink,this.android_appindexing_link=e.androidAppindexingLink,this.ios_appindexing_link=e.iosAppindexingLink}};n(Ci,"ChannelMetadata");rh.exports=Ci});var ah=g((I0,ch)=>{"use strict";var GT=C(),Ri=class{constructor(e){this.title=new GT(e.title)}};n(Ri,"ChannelMobileHeader");ch.exports=Ri});var uh=g((C0,lh)=>{"use strict";var HT=O(),zT=A(),ki=class{type="ChannelThumbnailWithLink";constructor(e){this.thumbnails=HT.fromResponse(e.thumbnail),this.endpoint=new zT(e.navigationEndpoint),this.label=e.accessibility.accessibilityData.label}};n(ki,"ChannelThumbnailWithLink");lh.exports=ki});var dh=g((R0,hh)=>{"use strict";var Li=C(),Pi=class{type="ChannelVideoPlayer";constructor(e){this.id=e.videoId,this.title=new Li(e.title,""),this.description=new Li(e.description,""),this.views=new Li(e.viewCountText,""),this.published_at=new Li(e.publishedTimeText,"")}};n(Pi,"ChannelVideoPlayer");hh.exports=Pi});var mh=g((k0,ph)=>{"use strict";var KT=A(),QT=F(),JT=C(),Ai=class{type="ChildVideo";constructor(e){this.id=e.videoId,this.title=new JT(e.title),this.duration={text:e.lengthText.simpleText,seconds:QT.timeToSeconds(e.lengthText.simpleText)},this.endpoint=new KT(e.navigationEndpoint)}};n(Ai,"ChildVideo");ph.exports=Ai});var _h=g((L0,gh)=>{"use strict";var fa=E(),Ni=class{type="ChipCloud";constructor(e){this.chips=fa.parse(e.chips),this.next_button=fa.parse(e.nextButton),this.previous_button=fa.parse(e.previousButton),this.horizontal_scrollable=e.horizontalScrollable}};n(Ni,"ChipCloud");gh.exports=Ni});var wh=g((P0,yh)=>{"use strict";var XT=C(),ZT=A(),Oi=class{type="ChipCloudChip";constructor(e){this.is_selected=e.isSelected,this.endpoint=e.navigationEndpoint&&new ZT(e.navigationEndpoint),this.text=new XT(e.text).toString()}};n(Oi,"ChipCloudChip");yh.exports=Oi});var bh=g((A0,vh)=>{"use strict";var jT=A(),el=O(),Ui=class{type="CollageHeroImage";constructor(e){this.left=el.fromResponse(e.leftThumbnail),this.top_right=el.fromResponse(e.topRightThumbnail),this.bottom_right=el.fromResponse(e.bottomRightThumbnail),this.endpoint=new jT(e.navigationEndpoint)}};n(Ui,"CollageHeroImage");vh.exports=Ui});var Th=g((N0,xh)=>{"use strict";var jt,Di=class{constructor(e){f(this,"type","AuthorCommentBadge");T(this,jt,void 0);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,jt,e)}get orig_badge(){return l(this,jt)}};n(Di,"AuthorCommentBadge"),jt=new WeakMap;xh.exports=Di});var Eh=g((O0,qh)=>{"use strict";var tl=E(),nl=C(),fT=O(),eq=Z(),tq=ct(),{InnertubeError:il}=F(),Pe,Bi=class{constructor(e){f(this,"type","Comment");T(this,Pe,void 0);var t,i;this.content=new nl(e.contentText),this.published=new nl(e.publishedTimeText),this.author_is_channel_owner=e.authorIsChannelOwner,this.current_user_reply_thumbnail=fT.fromResponse(e.currentUserReplyThumbnail),this.author_badge=tl.parse(e.authorCommentBadge,"comments"),this.author=new eq({...e.authorText,navigationEndpoint:e.authorEndpoint},this.author_badge?[{metadataBadgeRenderer:(t=this.author_badge)==null?void 0:t.orig_badge}]:null,e.authorThumbnail),this.action_menu=tl.parse(e.actionMenu),this.action_buttons=tl.parse(e.actionButtons,"comments"),this.comment_id=e.commentId,this.vote_status=e.voteStatus,this.vote_count={text:e.voteCount?(i=e.voteCount.accessibility.accessibilityData)==null?void 0:i.label.replace(/\D/g,""):"0",short_text:e.voteCount?new nl(e.voteCount).toString():"0"},this.reply_count=e.replyCount||0,this.is_liked=this.action_buttons.like_button.is_toggled,this.is_disliked=this.action_buttons.dislike_button.is_toggled,this.is_pinned=!!e.pinnedCommentBadge}async like(){let e=this.action_buttons.like_button;if(e.is_toggled)throw new il("This comment is already liked",{comment_id:this.comment_id});return await e.endpoint.callTest(l(this,Pe),{parse:!1})}async dislike(){let e=this.action_buttons.dislike_button;if(e.is_toggled)throw new il("This comment is already disliked",{comment_id:this.comment_id});return await e.endpoint.callTest(l(this,Pe),{parse:!1})}async reply(e){if(!this.action_buttons.reply_button)throw new il("Cannot reply to another reply. Try mentioning the user instead.",{comment_id:this.comment_id});let i=this.action_buttons.reply_button.endpoint.dialog.reply_button,a={params:{commentText:e}};return await i.endpoint.callTest(l(this,Pe),a)}async translate(e){let i={text:this.content.toString().replace(/[^\p{L}\p{N}\p{P}\p{Z}]/gu,""),target_language:e,comment_id:this.comment_id},a=tq.encodeCommentActionParams(22,i),s=await l(this,Pe).execute("comment/perform_comment_action",{action:a,client:"ANDROID"}),o=s.data.frameworkUpdates.entityBatchUpdate.mutations[0].payload.commentEntityPayload.translatedContent.content;return{...s,content:o}}setActions(e){I(this,Pe,e)}};n(Bi,"Comment"),Pe=new WeakMap;qh.exports=Bi});var Ih=g((U0,Sh)=>{"use strict";var sl=E(),Mi=class{type="CommentActionButtons";constructor(e){this.like_button=sl.parse(e.likeButton),this.dislike_button=sl.parse(e.dislikeButton),this.reply_button=sl.parse(e.replyButton)}};n(Mi,"CommentActionButtons");Sh.exports=Mi});var Rh=g((D0,Ch)=>{"use strict";var rl=E(),Vi=class{type="CommentReplies";constructor(e){this.contents=rl.parse(e.contents),this.view_replies=rl.parse(e.viewReplies),this.hide_replies=rl.parse(e.hideReplies)}};n(Vi,"CommentReplies");Ch.exports=Vi});var Ah=g((B0,Ph)=>{"use strict";var kh=E(),nq=O(),Lh=C(),Fi=class{type="CommentReplyDialog";constructor(e){this.reply_button=kh.parse(e.replyButton),this.cancel_button=kh.parse(e.cancelButton),this.author_thumbnail=nq.fromResponse(e.authorThumbnail),this.placeholder=new Lh(e.placeholderText),this.error_message=new Lh(e.errorMessage)}};n(Fi,"CommentReplyDialog");Ph.exports=Fi});var Oh=g((M0,Nh)=>{"use strict";var Yi=C(),iq=O(),$i=class{type="CommentsEntryPointHeader";constructor(e){this.header=new Yi(e.headerText),this.comment_count=new Yi(e.commentCount),this.teaser_avatar=iq.fromResponse(e.teaserAvatar||e.simpleboxAvatar),this.teaser_content=new Yi(e.teaserContent),this.simplebox_placeholder=new Yi(e.simpleboxPlaceholder)}};n($i,"CommentsEntryPointHeader");Nh.exports=$i});var Bh=g((V0,Dh)=>{"use strict";var Uh=E(),ol=C(),sq=O(),Wi=class{type="CommentsHeader";constructor(e){var t;this.title=new ol(e.titleText),this.count=new ol(e.countText),this.comments_count=new ol(e.commentsCount),this.create_renderer=Uh.parse(e.createRenderer,"comments"),this.sort_menu=Uh.parse(e.sortMenu),this.custom_emojis=((t=e.customEmojis)==null?void 0:t.map(i=>({emoji_id:i.emojiId,shortcuts:i.shortcuts,search_terms:i.searchTerms,image:sq.fromResponse(i.image),is_custom_emoji:i.isCustomEmoji})))||null}};n(Wi,"CommentsHeader");Dh.exports=Wi});var Fh=g((F0,Vh)=>{"use strict";var Mh=E(),rq=O(),oq=C(),Gi=class{type="CommentSimplebox";constructor(e){this.submit_button=Mh.parse(e.submitButton),this.cancel_button=Mh.parse(e.cancelButton),this.author_thumbnails=rq.fromResponse(e.authorThumbnail),this.placeholder=new oq(e.placeholderText),this.avatar_size=e.avatarSize}};n(Gi,"CommentSimplebox");Vh.exports=Gi});var Wh=g((Y0,$h)=>{"use strict";var Yh=E(),{InnertubeError:cl}=F(),lt,Ae,He,Hi=class{constructor(e){f(this,"type","CommentThread");T(this,lt,void 0);T(this,Ae,void 0);T(this,He,void 0);this.comment=Yh.parse(e.comment),I(this,lt,Yh.parse(e.replies)),this.is_moderated_elq_comment=e.isModeratedElqComment}async getReplies(){var i;if(!l(this,lt))throw new cl("This comment has no replies.",{comment_id:this.comment.comment_id});let t=await l(this,lt).contents.get({type:"ContinuationItem"}).endpoint.callTest(l(this,Ae));return this.replies=t.on_response_received_endpoints_memo.get("Comment").map(a=>(a.setActions(l(this,Ae)),a)),I(this,He,(i=t.on_response_received_endpoints_memo.get("ContinuationItem"))==null?void 0:i[0]),this}async getContinuation(){var t;if(!this.replies)throw new cl("Continuation not available.");if(!l(this,He))throw new cl("Continuation not found.");let e=await l(this,He).button.endpoint.callTest(l(this,Ae));return this.replies=e.on_response_received_endpoints_memo.get("Comment").map(i=>(i.setActions(l(this,Ae)),i)),I(this,He,(t=e.on_response_received_endpoints_memo.get("ContinuationItem"))==null?void 0:t[0]),this}setActions(e){I(this,Ae,e)}};n(Hi,"CommentThread"),lt=new WeakMap,Ae=new WeakMap,He=new WeakMap;$h.exports=Hi});var Hh=g(($0,Gh)=>{"use strict";var cq=C(),aq=A(),zi=class{type="CompactLink";constructor(e){this.title=new cq(e.title).toString(),this.endpoint=new aq(e.navigationEndpoint),this.style=e.style}};n(zi,"CompactLink");Gh.exports=zi});var ut=g((W0,zh)=>{"use strict";var lq=Z(),Ki=class extends lq{constructor(e){super(e),delete this.badges,delete this.is_verified,delete this.is_verified_artist}};n(Ki,"PlaylistAuthor");zh.exports=Ki});var ft=g((G0,Kh)=>{"use strict";var Qi=C(),Ji=E(),uq=O(),hq=A(),dq=ut(),Xi=class{type="Playlist";constructor(e){var t;this.id=e.playlistId,this.title=new Qi(e.title),this.author=(t=e.shortBylineText)!=null&&t.simpleText?new Qi(e.shortBylineText):new dq(e.longBylineText,e.ownerBadges,null),this.thumbnails=uq.fromResponse(e.thumbnail||{thumbnails:e.thumbnails.map(i=>i.thumbnails).flat(1)}),this.video_count=new Qi(e.thumbnailText),this.video_count_short=new Qi(e.videoCountShortText),this.first_videos=Ji.parse(e.videos)||[],this.share_url=e.shareUrl||null,this.menu=Ji.parse(e.menu),this.badges=Ji.parse(e.ownerBadges),this.endpoint=new hq(e.navigationEndpoint),this.thumbnail_overlays=Ji.parse(e.thumbnailOverlays)||[]}};n(Xi,"Playlist");Kh.exports=Xi});var Jh=g((H0,Qh)=>{"use strict";var pq=ft(),Zi=class extends pq{type="CompactMix";constructor(e){super(e)}};n(Zi,"CompactMix");Qh.exports=Zi});var Zh=g((z0,Xh)=>{"use strict";var mq=ft(),ji=class extends mq{type="CompactPlaylist";constructor(e){super(e)}};n(ji,"CompactPlaylist");Xh.exports=ji});var fh=g((K0,jh)=>{"use strict";var al=E(),ht=C(),gq=Z(),_q=F(),yq=O(),wq=A(),fi=class{type="CompactVideo";constructor(e){this.id=e.videoId,this.thumbnails=yq.fromResponse(e.thumbnail)||null,this.rich_thumbnail=e.richThumbnail&&al.parse(e.richThumbnail),this.title=new ht(e.title),this.author=new gq(e.longBylineText,e.ownerBadges,e.channelThumbnail),this.view_count=new ht(e.viewCountText),this.short_view_count=new ht(e.shortViewCountText),this.published=new ht(e.publishedTimeText),this.duration={text:new ht(e.lengthText).toString(),seconds:_q.timeToSeconds(new ht(e.lengthText).toString())},this.thumbnail_overlays=al.parse(e.thumbnailOverlays),this.endpoint=new wq(e.navigationEndpoint),this.menu=al.parse(e.menu)}get best_thumbnail(){return this.thumbnails[0]}};n(fi,"CompactVideo");jh.exports=fi});var td=g((Q0,ed)=>{"use strict";var vq=E(),bq=A(),es=class{type="ContinuationItem";constructor(e){this.trigger=e.trigger,e.button&&(this.button=vq.parse(e.button)),this.endpoint=new bq(e.continuationEndpoint)}};n(es,"ContinuationItem");ed.exports=es});var id=g((J0,nd)=>{"use strict";var ts=class{type="CtaGoToCreatorStudio";constructor(e){this.title=e.buttonLabel,this.use_new_specs=e.useNewSpecs}};n(ts,"CtaGoToCreatorStudio");nd.exports=ts});var rd=g((X0,sd)=>{"use strict";var xq=C(),Tq=A(),ns=class{type="DidYouMean";constructor(e){this.corrected_query=new xq(e.correctedQuery),this.endpoint=new Tq(e.navigationEndpoint)}};n(ns,"DidYouMean");sd.exports=ns});var cd=g((Z0,od)=>{"use strict";var qq=A(),is=class{type="DownloadButton";constructor(e){this.style=e.style,this.size=e.size,this.endpoint=new qq(e.command),this.target_id=e.targetId}};n(is,"DownloadButton");od.exports=is});var ld=g((j0,ad)=>{"use strict";var Eq=E(),ss=class{type="Element";constructor(e){let t=e.newElement.type.componentType;return Eq.parse(t.model)}};n(ss,"Element");ad.exports=ss});var dd=g((f0,hd)=>{"use strict";var Sq=C(),ud=E(),rs=class{type="EmergencyOnebox";constructor(e){this.title=new Sq(e.title),this.first_option=ud.parse(e.firstOption),this.menu=ud.parse(e.menu)}};n(rs,"EmergencyOnebox");hd.exports=rs});var md=g((ek,pd)=>{"use strict";var Iq=E(),os=class{type="Endscreen";constructor(e){this.elements=Iq.parse(e.elements),this.start_ms=e.startMs}};n(os,"Endscreen");pd.exports=os});var wd=g((tk,yd)=>{"use strict";var gd=E(),_d=O(),Cq=A(),ll=C(),cs=class{type="EndscreenElement";constructor(e){this.style=e.style,this.title=new ll(e.title),this.endpoint=new Cq(e.endpoint),e.image&&(this.image=_d.fromResponse(e.image)),e.icon&&(this.icon=_d.fromResponse(e.icon)),e.metadata&&(this.metadata=new ll(e.metadata)),e.callToAction&&(this.call_to_action=new ll(e.callToAction)),e.hovercardButton&&(this.hovercard_button=gd.parse(e.hovercardButton)),e.isSubscribe&&(this.is_subscribe=e.isSubscribe),this.thumbnail_overlays=gd.parse(e.thumbnailOverlays),this.left=e.left,this.width=e.width,this.top=e.top,this.aspect_ratio=e.aspectRatio,this.start_ms=e.startMs,this.end_ms=e.endMs,this.id=e.id}};n(cs,"EndscreenElement");yd.exports=cs});var bd=g((nk,vd)=>{"use strict";var ul=C(),Rq=O(),kq=A(),as=class{type="EndScreenPlaylist";constructor(e){this.id=e.playlistId,this.title=new ul(e.title),this.author=new ul(e.longBylineText),this.endpoint=new kq(e.navigationEndpoint),this.thumbnails=Rq.fromResponse(e.thumbnail),this.video_count=new ul(e.videoCountText)}};n(as,"EndScreenPlaylist");vd.exports=as});var qd=g((ik,Td)=>{"use strict";var xd=E(),hl=C(),Lq=Z(),Pq=O(),Aq=A(),ls=class{type="EndScreenVideo";constructor(e){this.id=e.videoId,this.title=new hl(e.title),this.thumbnails=Pq.fromResponse(e.thumbnail),this.thumbnail_overlays=xd.parse(e.thumbnailOverlays),this.author=new Lq(e.shortBylineText,e.ownerBadges),this.endpoint=new Aq(e.navigationEndpoint),this.short_view_count_text=new hl(e.shortViewCountText),this.badges=xd.parse(e.badges),this.duration={text:new hl(e.lengthText).toString(),seconds:e.lengthInSeconds}}};n(ls,"EndScreenVideo");Td.exports=ls});var Sd=g((sk,Ed)=>{"use strict";var Nq=E(),Oq=A(),us=class{type="ExpandableTab";constructor(e){this.title=e.title,this.endpoint=new Oq(e.endpoint),this.selected=e.selected,this.content=e.content?Nq.parse(e.content):null}};n(us,"ExpandableTab");Ed.exports=us});var Cd=g((rk,Id)=>{"use strict";var Uq=E(),hs=class{type="ExpandedShelfContents";constructor(e){this.items=Uq.parse(e.items)}get contents(){return this.items}};n(hs,"ExpandedShelfContents");Id.exports=hs});var kd=g((ok,Rd)=>{"use strict";var Dq=E(),ds=class{type="FeedFilterChipBar";constructor(e){this.contents=Dq.parse(e.contents)}};n(ds,"FeedFilterChipBar");Rd.exports=ds});var Pd=g((ck,Ld)=>{"use strict";var Bq=C(),ps=class{constructor(e){this.title=new Bq(e.title)}};n(ps,"FeedTabbedHeader");Ld.exports=ps});var Nd=g((ak,Ad)=>{"use strict";var Mq=E(),ms=class{type="Grid";constructor(e){this.items=Mq.parse(e.items),this.is_collapsible=e.isCollapsible,this.visible_row_count=e.visibleRowCount,this.target_id=e.targetId}get contents(){return this.items}};n(ms,"Grid");Ad.exports=ms});var Dd=g((lk,Ud)=>{"use strict";var Vq=Z(),Fq=E(),Yq=A(),Od=C(),gs=class{type="GridChannel";constructor(e){this.id=e.channelId,this.author=new Vq({...e.title,navigationEndpoint:e.navigationEndpoint},e.ownerBadges,e.thumbnail),this.subscribers=new Od(e.subscriberCountText),this.video_count=new Od(e.videoCountText),this.endpoint=new Yq(e.navigationEndpoint),this.subscribe_button=Fq.parse(e.subscribeButton)}};n(gs,"GridChannel");Ud.exports=gs});var Fd=g((uk,Vd)=>{"use strict";var dl=C(),Bd=E(),Md=O(),$q=ut(),Wq=A(),Gq=ui(),_s=class{type="GridPlaylist";constructor(e){var t;this.id=e.playlistId,this.title=new dl(e.title),e.shortBylineText&&(this.author=new $q(e.shortBylineText,e.ownerBadges)),this.badges=Bd.parse(e.ownerBadges),this.endpoint=new Wq(e.navigationEndpoint),this.view_playlist=new Gq(e.viewPlaylistText),this.thumbnails=Md.fromResponse(e.thumbnail),this.thumbnail_renderer=Bd.parse(e.thumbnailRenderer),this.sidebar_thumbnails=[].concat(...((t=e.sidebarThumbnails)==null?void 0:t.map(i=>Md.fromResponse(i)))||[])||null,this.video_count=new dl(e.thumbnailText),this.video_count_short_text=new dl(e.videoCountShortText)}};n(_s,"GridPlaylist");Vd.exports=_s});var $d=g((hk,Yd)=>{"use strict";var pl=E(),dt=C(),Hq=O(),zq=A(),Kq=Z(),ys=class{type="GridVideo";constructor(e){var i;let t=(i=e.thumbnailOverlays.find(a=>a.hasOwnProperty("thumbnailOverlayTimeStatusRenderer")))==null?void 0:i.thumbnailOverlayTimeStatusRenderer;this.id=e.videoId,this.title=new dt(e.title),this.thumbnails=Hq.fromResponse(e.thumbnail),this.thumbnail_overlays=pl.parse(e.thumbnailOverlays),this.rich_thumbnail=e.richThumbnail&&pl.parse(e.richThumbnail),this.published=new dt(e.publishedTimeText),this.duration=e.lengthText?new dt(e.lengthText):t!=null&&t.text?new dt(t.text):"",this.author=e.shortBylineText&&new Kq(e.shortBylineText,e.ownerBadges),this.views=new dt(e.viewCountText),this.short_view_count=new dt(e.shortViewCountText),this.endpoint=new zq(e.navigationEndpoint),this.menu=pl.parse(e.menu)}};n(ys,"GridVideo");Yd.exports=ys});var ml=g((dk,Gd)=>{"use strict";var Qq=C(),Wd=A(),ws=class{type="SearchSuggestion";constructor(e){this.suggestion=new Qq(e.suggestion),this.endpoint=new Wd(e.navigationEndpoint),this.icon_type=e.icon.iconType,e.serviceEndpoint&&(this.service_endpoint=new Wd(e.serviceEndpoint))}};n(ws,"SearchSuggestion");Gd.exports=ws});var zd=g((pk,Hd)=>{"use strict";var Jq=ml(),vs=class extends Jq{type="HistorySuggestion";constructor(e){super(e)}};n(vs,"HistorySuggestion");Hd.exports=vs});var Qd=g((mk,Kd)=>{"use strict";var bs=E(),xs=class{type="HorizontalCardList";constructor(e){this.cards=bs.parse(e.cards),this.header=bs.parse(e.header),this.previous_button=bs.parse(e.previousButton),this.next_button=bs.parse(e.nextButton)}};n(xs,"HorizontalCardList");Kd.exports=xs});var Xd=g((gk,Jd)=>{"use strict";var Xq=E(),Ts=class{type="HorizontalList";constructor(e){this.visible_item_count=e.visibleItemCount,this.items=Xq.parse(e.items)}get contents(){return this.items}};n(Ts,"HorizontalList");Jd.exports=Ts});var fd=g((_k,jd)=>{"use strict";var Zd=E(),qs=class{type="ItemSection";constructor(e){this.header=Zd.parse(e.header),this.contents=Zd.parse(e.contents),(e.targetId||e.sectionIdentifier)&&(this.target_id=(e==null?void 0:e.target_id)||(e==null?void 0:e.sectionIdentifier))}};n(qs,"ItemSection");jd.exports=qs});var tp=g((yk,ep)=>{"use strict";var Zq=C(),Es=class{constructor(e){this.title=new Zq(e.title)}};n(Es,"ItemSectionHeader");ep.exports=Es});var ip=g((wk,np)=>{"use strict";var jq=A(),Ss=class{type="LikeButton";constructor(e){var t;this.target={video_id:e.target.videoId},this.like_status=e.likeStatus,this.likes_allowed=e.likesAllowed,e.serviceEndpoints&&(this.endpoints=(t=e.serviceEndpoints)==null?void 0:t.map(i=>new jq(i)))}};n(Ss,"LikeButton");np.exports=Ss});var rp=g((vk,sp)=>{"use strict";var fq=E(),en=C(),Is=class{type="LiveChat";constructor(e){var t,i;this.header=fq.parse(e.header),this.initial_display_state=e.initialDisplayState,this.continuation=(i=(t=e.continuations[0])==null?void 0:t.reloadContinuationData)==null?void 0:i.continuation,this.client_messages={reconnect_message:new en(e.clientMessages.reconnectMessage),unable_to_reconnect_message:new en(e.clientMessages.unableToReconnectMessage),fatal_error:new en(e.clientMessages.fatalError),reconnected_message:new en(e.clientMessages.reconnectedMessage),generic_error:new en(e.clientMessages.genericError)},this.is_replay=e.isReplay||!1}};n(Is,"LiveChat");sp.exports=Is});var cp=g((bk,op)=>{"use strict";var eE=E(),Cs=class{constructor(e){return eE.parse(e.bannerRenderer)}};n(Cs,"AddBannerToLiveChatCommand");op.exports=Cs});var lp=g((xk,ap)=>{"use strict";var tE=E(),Rs=class{type="AddChatItemAction";constructor(e){this.item=tE.parse(e.item),this.client_id=e.clientId||null}};n(Rs,"AddChatItemAction");ap.exports=Rs});var hp=g((Tk,up)=>{"use strict";var nE=E(),ks=class{type="AddLiveChatTickerItemAction";constructor(e){this.item=nE.parse(e.item),this.duration_sec=e.durationSec}};n(ks,"AddLiveChatTickerItemAction");up.exports=ks});var mp=g((qk,pp)=>{"use strict";var dp=E(),Ls=class{type="LiveChatBanner";constructor(e){this.header=dp.parse(e.header,"livechat/items"),this.contents=dp.parse(e.contents,"livechat/items"),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}};n(Ls,"LiveChatBanner");pp.exports=Ls});var _p=g((Ek,gp)=>{"use strict";var iE=E(),sE=C(),Ps=class{type="LiveChatBannerHeader";constructor(e){this.text=new sE(e.text).toString(),this.icon_type=e.icon.iconType,this.context_menu_button=iE.parse(e.contextMenuButton)}};n(Ps,"LiveChatBannerHeader");gp.exports=Ps});var vp=g((Sk,wp)=>{"use strict";var rE=E(),yp=C(),oE=O(),As=class{type="LiveChatBannerPoll";constructor(e){this.poll_question=new yp(e.pollQuestion),this.author_photo=oE.fromResponse(e.authorPhoto),this.choices=e.pollChoices.map(t=>({option_id:t.pollOptionId,text:new yp(t.text).toString()})),this.collapsed_state_entity_key=e.collapsedStateEntityKey,this.live_chat_poll_state_entity_key=e.liveChatPollStateEntityKey,this.context_menu_button=rE.parse(e.contextMenuButton)}};n(As,"LiveChatBannerPoll");wp.exports=As});var Tp=g((Ik,xp)=>{"use strict";var cE=E(),bp=C(),aE=O(),lE=A(),Ns=class{type="LiveChatMembershipItem";constructor(e){this.id=e.id,this.timestamp=Math.floor(parseInt(e.timestampUsec)/1e3),this.header_subtext=new bp(e.headerSubtext),this.author={id:e.authorExternalChannelId,name:new bp(e==null?void 0:e.authorName),thumbnails:aE.fromResponse(e.authorPhoto),badges:cE.parse(e.authorBadges)},this.menu_endpoint=new lE(e.contextMenuEndpoint)}};n(Ns,"LiveChatMembershipItem");xp.exports=Ns});var Sp=g((Ck,Ep)=>{"use strict";var Os=C(),uE=O(),hE=A(),qp=E(),Us=class{type="LiveChatPaidMessage";constructor(e){this.message=new Os(e.message),this.author={id:e.authorExternalChannelId,name:new Os(e.authorName),thumbnails:uE.fromResponse(e.authorPhoto),badges:qp.parse(e.authorBadges)};let t=qp.parse(e.authorBadges);this.author.badges=t,this.author.is_moderator=(t==null?void 0:t.some(i=>i.icon_type=="MODERATOR"))||null,this.author.is_verified=(t==null?void 0:t.some(i=>i.style=="BADGE_STYLE_TYPE_VERIFIED"))||null,this.author.is_verified_artist=(t==null?void 0:t.some(i=>i.style=="BADGE_STYLE_TYPE_VERIFIED_ARTIST"))||null,this.purchase_amount=new Os(e.purchaseAmountText).toString(),this.menu_endpoint=new hE(e.contextMenuEndpoint),this.timestamp=Math.floor(parseInt(e.timestampUsec)/1e3),this.timestamp_text=new Os(e.timestampText).toString(),this.id=e.id}};n(Us,"LiveChatPaidMessage");Ep.exports=Us});var kp=g((Rk,Rp)=>{"use strict";var dE=E(),pE=A(),Ip=O(),Cp=C(),Ds=class{type="LiveChatPaidSticker";constructor(e){this.id=e.id,this.author={id:e.authorExternalChannelId,name:new Cp(e.authorName),thumbnails:Ip.fromResponse(e.authorPhoto),badges:dE.parse(e.authorBadges)},this.sticker=Ip.fromResponse(e.sticker),this.purchase_amount=new Cp(e.purchaseAmountText).toString(),this.context_menu=new pE(e.contextMenuEndpoint),this.timestamp=Math.floor(parseInt(e.timestampUsec)/1e3)}};n(Ds,"LiveChatPaidSticker");Rp.exports=Ds});var Pp=g((kk,Lp)=>{"use strict";var Bs=class{type="LiveChatPlaceholderItem";constructor(e){this.id=e.id,this.timestamp=Math.floor(parseInt(e.timestampUsec)/1e3)}};n(Bs,"LiveChatPlaceholderItem");Lp.exports=Bs});var gl=g((Lk,Np)=>{"use strict";var Ap=C(),mE=O(),gE=A(),_E=E(),Ms=class{type="LiveChatTextMessage";constructor(e){this.message=new Ap(e.message),this.author={id:e.authorExternalChannelId,name:new Ap(e.authorName),thumbnails:mE.fromResponse(e.authorPhoto)};let t=_E.parse(e.authorBadges);this.author.badges=t,this.author.is_moderator=(t==null?void 0:t.some(i=>i.icon_type=="MODERATOR"))||null,this.author.is_verified=(t==null?void 0:t.some(i=>i.style=="BADGE_STYLE_TYPE_VERIFIED"))||null,this.author.is_verified_artist=(t==null?void 0:t.some(i=>i.style=="BADGE_STYLE_TYPE_VERIFIED_ARTIST"))||null,this.menu_endpoint=new gE(e.contextMenuEndpoint),this.timestamp=Math.floor(parseInt(e.timestampUsec)/1e3),this.id=e.id}};n(Ms,"LiveChatTextMessage");Np.exports=Ms});var Up=g((Pk,Op)=>{"use strict";var yE=C(),wE=O(),vE=A(),_l=E(),Vs=class{type="LiveChatTickerPaidMessageItem";constructor(e){this.author={id:e.authorExternalChannelId,thumbnails:wE.fromResponse(e.authorPhoto),badges:_l.parse(e.authorBadges)};let t=_l.parse(e.authorBadges);this.author.badges=t,this.author.is_moderator=(t==null?void 0:t.some(i=>i.icon_type=="MODERATOR"))||null,this.author.is_verified=(t==null?void 0:t.some(i=>i.style=="BADGE_STYLE_TYPE_VERIFIED"))||null,this.author.is_verified_artist=(t==null?void 0:t.some(i=>i.style=="BADGE_STYLE_TYPE_VERIFIED_ARTIST"))||null,this.amount=new yE(e.amount),this.duration_sec=e.durationSec,this.full_duration_sec=e.fullDurationSec,this.show_item=_l.parse(e.showItemEndpoint.showLiveChatItemEndpoint.renderer,"livechat/items"),this.show_item_endpoint=new vE(e.showItemEndpoint),this.id=e.id}};n(Vs,"LiveChatTickerPaidMessageItem");Op.exports=Vs});var Mp=g((Ak,Bp)=>{"use strict";var Dp=C(),bE=O(),Fs=class{type="LiveChatTickerSponsorItem";constructor(e){this.id=e.id,this.detail_text=new Dp(e.detailText).toString(),this.author={id:e.authorExternalChannelId,name:new Dp(e==null?void 0:e.authorName),thumbnails:bE.fromResponse(e.sponsorPhoto)},this.duration_sec=e.durationSec}};n(Fs,"LiveChatTickerSponsorItem");Bp.exports=Fs});var Fp=g((Nk,Vp)=>{"use strict";var xE=gl(),TE=E(),Ys=class extends xE{type="LiveChatViewerEngagementMessage";constructor(e){super(e),delete this.author,delete this.menu_endpoint,this.icon_type=e.icon.iconType,this.action_button=TE.parse(e.actionButton)}};n(Ys,"LiveChatViewerEngagementMessage");Vp.exports=Ys});var Wp=g((Ok,$p)=>{"use strict";var Yp=C(),qE=O(),EE=E(),$s=class{type="PollHeader";constructor(e){this.poll_question=new Yp(e.pollQuestion),this.thumbnails=qE.fromResponse(e.thumbnail),this.metadata=new Yp(e.metadataText),this.live_chat_poll_type=e.liveChatPollType,this.context_menu_button=EE.parse(e.contextMenuButton)}};n($s,"PollHeader");$p.exports=$s});var Hp=g((Uk,Gp)=>{"use strict";var SE=E(),Ws=class{type="LiveChatActionPanel";constructor(e){this.id=e.id,this.contents=SE.parse(e.contents),this.target_id=e.targetId}};n(Ws,"LiveChatActionPanel");Gp.exports=Ws});var Kp=g((Dk,zp)=>{"use strict";var IE=C(),Gs=class{type="MarkChatItemAsDeletedAction";constructor(e){this.deleted_state_message=new IE(e.deletedStateMessage),this.target_item_id=e.targetItemId}};n(Gs,"MarkChatItemAsDeletedAction");zp.exports=Gs});var Jp=g((Bk,Qp)=>{"use strict";var CE=C(),Hs=class{type="MarkChatItemsByAuthorAsDeletedAction";constructor(e){this.deleted_state_message=new CE(e.deletedStateMessage),this.channel_id=e.externalChannelId}};n(Hs,"MarkChatItemsByAuthorAsDeletedAction");Qp.exports=Hs});var Zp=g((Mk,Xp)=>{"use strict";var zs=class{type="RemoveBannerForLiveChatCommand";constructor(e){this.target_action_id=e.targetActionId}};n(zs,"RemoveBannerForLiveChatCommand");Xp.exports=zs});var fp=g((Vk,jp)=>{"use strict";var RE=E(),Ks=class{constructor(e){this.target_item_id=e.targetItemId,this.replacement_item=RE.parse(e.replacementItem)}};n(Ks,"ReplaceChatItemAction");jp.exports=Ks});var tm=g((Fk,em)=>{"use strict";var kE=E(),Qs=class{type="ReplayChatItemAction";constructor(e){var t;this.actions=kE.parse((t=e.actions)==null?void 0:t.map(i=>(delete i.clickTrackingParams,i)))||[],this.video_offset_time_msec=e.videoOffsetTimeMsec}};n(Qs,"ReplayChatItemAction");em.exports=Qs});var im=g((Yk,nm)=>{"use strict";var LE=E(),Js=class{type="ShowLiveChatActionPanelAction";constructor(e){this.panel_to_show=LE.parse(e.panelToShow)}};n(Js,"ShowLiveChatActionPanelAction");nm.exports=Js});var rm=g(($k,sm)=>{"use strict";var PE=E(),Xs=class{type="ShowLiveChatTooltipCommand";constructor(e){this.tooltip=PE.parse(e.tooltip)}};n(Xs,"ShowLiveChatTooltipCommand");sm.exports=Xs});var cm=g((Wk,om)=>{"use strict";var AE=C(),Zs=class{type="UpdateDateTextAction";constructor(e){this.date_text=new AE(e.dateText).toString()}};n(Zs,"UpdateDateTextAction");om.exports=Zs});var lm=g((Gk,am)=>{"use strict";var NE=C(),js=class{type="UpdateDescriptionAction";constructor(e){this.description=new NE(e.description)}};n(js,"UpdateDescriptionAction");am.exports=js});var hm=g((Hk,um)=>{"use strict";var OE=E(),fs=class{type="UpdateLiveChatPollAction";constructor(e){this.poll_to_update=OE.parse(e.pollToUpdate)}};n(fs,"UpdateLiveChatPollAction");um.exports=fs});var pm=g((zk,dm)=>{"use strict";var UE=C(),er=class{type="UpdateTitleAction";constructor(e){this.title=new UE(e.title)}};n(er,"UpdateTitleAction");dm.exports=er});var _m=g((Kk,gm)=>{"use strict";var mm=C(),tr=class{type="UpdateToggleButtonTextAction";constructor(e){this.default_text=new mm(e.defaultText).toString(),this.toggled_text=new mm(e.toggledText).toString(),this.button_id=e.buttonId}};n(tr,"UpdateToggleButtonTextAction");gm.exports=tr});var vm=g((Qk,wm)=>{"use strict";var ym=C(),nr=class{type="UpdateViewershipAction";constructor(e){let t=e.viewCount.videoViewCountRenderer;this.view_count=new ym(t.viewCount),this.extra_short_view_count=new ym(t.extraShortViewCount),this.is_live=t.isLive}};n(nr,"UpdateViewershipAction");wm.exports=nr});var yl=g((Jk,bm)=>{"use strict";var ir=class{constructor(e){e.icon&&(this.icon_type=e.icon.iconType),e.style&&(this.style=e.style),this.tooltip=e.tooltip||e.iconTooltip||null}};n(ir,"MetadataBadge");bm.exports=ir});var Tm=g((Xk,xm)=>{"use strict";var DE=yl(),BE=O(),sr=class extends DE{constructor(e){super(e),this.custom_thumbnail=e.customThumbnail?BE.fromResponse(e.customThumbnail):null}};n(sr,"LiveChatAuthorBadge");xm.exports=sr});var Em=g((Zk,qm)=>{"use strict";var wl=E(),rr=class{type="LiveChatHeader";constructor(e){this.overflow_menu=wl.parse(e.overflowMenu),this.collapse_button=wl.parse(e.collapseButton),this.view_selector=wl.parse(e.viewSelector)}};n(rr,"LiveChatHeader");qm.exports=rr});var Im=g((jk,Sm)=>{"use strict";var ME=E(),or=class{type="LiveChatItemList";constructor(e){this.max_items_to_display=e.maxItemsToDisplay,this.more_comments_below_button=ME.parse(e.moreCommentsBelowButton)}};n(or,"LiveChatItemList");Sm.exports=or});var Rm=g((fk,Cm)=>{"use strict";var VE=C(),FE=E(),YE=O(),cr=class{constructor(e){this.author_name=new VE(e.authorName),this.author_photo=YE.fromResponse(e.authorPhoto),this.send_button=FE.parse(e.sendButton),this.target_id=e.targetId}};n(cr,"LiveChatMessageInput");Cm.exports=cr});var Lm=g((eL,km)=>{"use strict";var $E=E(),WE=C(),GE=O(),ar=class{type="LiveChatParticipant";constructor(e){this.name=new WE(e.authorName),this.photo=GE.fromResponse(e.authorPhoto),this.badges=$E.parse(e.authorBadges)}};n(ar,"LiveChatParticipant");km.exports=ar});var Am=g((tL,Pm)=>{"use strict";var HE=E(),zE=C(),lr=class{type="LiveChatParticipantsList";constructor(e){this.title=new zE(e.title),this.participants=HE.parse(e.participants)}};n(lr,"LiveChatParticipantsList");Pm.exports=lr});var Um=g((nL,Om)=>{"use strict";var Nm=E(),ur=class{type="Menu";constructor(e){var t,i;this.items=Nm.parse(e.items)||[],this.top_level_buttons=Nm.parse(e.topLevelButtons)||[],this.label=((i=(t=e.accessibility)==null?void 0:t.accessibilityData)==null?void 0:i.label)||null}get contents(){return this.items}};n(ur,"Menu");Om.exports=ur});var Bm=g((iL,Dm)=>{"use strict";var KE=wi(),hr=class extends KE{type="MenuNavigationItem";constructor(e){super(e)}};n(hr,"MenuNavigationItem");Dm.exports=hr});var Vm=g((sL,Mm)=>{"use strict";var QE=wi(),dr=class extends QE{type="MenuServiceItem";constructor(e){super(e)}};n(dr,"MenuServiceItem");Mm.exports=dr});var Ym=g((rL,Fm)=>{"use strict";var JE=A(),pr=class{type="MenuServiceItemDownload";constructor(e){this.has_separator=e.hasSeparator,this.endpoint=new JE(e.navigationEndpoint||e.serviceEndpoint)}};n(pr,"MenuServiceItemDownload");Fm.exports=pr});var Gm=g((oL,Wm)=>{"use strict";var $m=E(),mr=class{type="MultiPageMenu";constructor(e){this.header=$m.parse(e.header),this.sections=$m.parse(e.sections),this.style=e.style}};n(mr,"MultiPageMenu");Wm.exports=mr});var zm=g((cL,Hm)=>{"use strict";var XE=E(),gr=class{type="MultiPageMenuNotificationSection";constructor(e){this.items=XE.parse(e.items)}get contents(){return this.items}};n(gr,"MultiPageMenuNotificationSection");Hm.exports=gr});var Qm=g((aL,Km)=>{"use strict";var ZE=E(),jE=C(),_r=class{type="SimpleMenuHeader";constructor(e){this.title=new jE(e.title),this.buttons=ZE.parse(e.buttons)}};n(_r,"SimpleMenuHeader");Km.exports=_r});var Xm=g((lL,Jm)=>{"use strict";var fE=O(),eS=A(),yr=class{type="MerchandiseItem";constructor(e){this.title=e.title,this.description=e.description,this.thumbnails=fE.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 eS(e.buttonCommand)}};n(yr,"MerchandiseItem");Jm.exports=yr});var fm=g((uL,jm)=>{"use strict";var Zm=E(),wr=class{type="MerchandiseShelf";constructor(e){this.title=e.title,this.menu=Zm.parse(e.actionButton),this.items=Zm.parse(e.items)}get contents(){return this.items}};n(wr,"MerchandiseShelf");jm.exports=wr});var tg=g((hL,eg)=>{"use strict";var tS=C(),vr=class{type="Message";constructor(e){this.text=new tS(e.text).toString()}};n(vr,"Message");eg.exports=vr});var sg=g((dL,ig)=>{"use strict";var ng=C(),br=class{type="MetadataRow";constructor(e){this.title=new ng(e.title),this.contents=e.contents.map(t=>new ng(t))}};n(br,"MetadataRow");ig.exports=br});var og=g((pL,rg)=>{"use strict";var nS=E(),xr=class{type="MetadataRowContainer";constructor(e){this.rows=nS.parse(e.rows),this.collapsed_item_count=e.collapsedItemCount}};n(xr,"MetadataRowContainer");rg.exports=xr});var ag=g((mL,cg)=>{"use strict";var iS=C(),Tr=class{type="MetadataRowHeader";constructor(e){this.content=new iS(e.content),this.has_divider_line=e.hasDividerLine}};n(Tr,"MetadataRowHeader");cg.exports=Tr});var ug=g((gL,lg)=>{"use strict";var sS=O(),qr=class{type="MicroformatData";constructor(e){this.url_canonical=e.urlCanonical,this.title=e.title,this.description=e.description,this.thumbnail=e.thumbnail&&sS.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}};n(qr,"MicroformatData");lg.exports=qr});var dg=g((_L,hg)=>{"use strict";var rS=ft(),Er=class extends rS{type="Mix";constructor(e){super(e)}};n(Er,"Mix");hg.exports=Er});var mg=g((yL,pg)=>{"use strict";var vl=E(),oS=Z(),cS=O(),aS=A(),lS=F(),ze=C(),Sr=class{type="Movie";constructor(e){var i,a,s;let t=((i=e.thumbnailOverlays.find(r=>r.thumbnailOverlayTimeStatusRenderer))==null?void 0:i.thumbnailOverlayTimeStatusRenderer.text)||"N/A";this.id=e.videoId,this.title=new ze(e.title),this.description_snippet=e.descriptionSnippet?new ze(e.descriptionSnippet,""):null,this.top_metadata_items=new ze(e.topMetadataItems),this.thumbnails=cS.fromResponse(e.thumbnail),this.thumbnail_overlays=vl.parse(e.thumbnailOverlays),this.author=new oS(e.longBylineText,e.ownerBadges,(s=(a=e.channelThumbnailSupportedRenderers)==null?void 0:a.channelThumbnailWithLinkRenderer)==null?void 0:s.thumbnail),this.duration={text:e.lengthText?new ze(e.lengthText).text:new ze(t).text,seconds:lS.timeToSeconds(e.lengthText?new ze(e.lengthText).text:new ze(t).text)},this.endpoint=new aS(e.navigationEndpoint),this.badges=vl.parse(e.badges),this.use_vertical_poster=e.useVerticalPoster,this.show_action_menu=e.showActionMenu,this.menu=vl.parse(e.menu)}};n(Sr,"Movie");pg.exports=Sr});var _g=g((wL,gg)=>{"use strict";var uS=O(),Ir=class{type="MovingThumbnail";constructor(e){var t;return(t=e.movingThumbnailDetails)==null?void 0:t.thumbnails.map(i=>new uS(i)).sort((i,a)=>a.width-i.width)}};n(Ir,"MovingThumbnail");gg.exports=Ir});var vg=g((vL,wg)=>{"use strict";var yg=E(),Cr=class{type="MusicCarouselShelf";constructor(e){this.header=yg.parse(e.header),this.contents=yg.parse(e.contents),e.numItemsPerColumn&&(this.num_items_per_column=e.numItemsPerColumn)}};n(Cr,"MusicCarouselShelf");wg.exports=Cr});var Tg=g((bL,xg)=>{"use strict";var bg=C(),hS=O(),Rr=class{type="MusicCarouselShelfBasicHeader";constructor(e){e.strapline&&(this.strapline=new bg(e.strapline).toString()),this.title=new bg(e.title).toString(),e.thumbnail&&(this.thumbnail=hS.fromResponse(e.thumbnail.musicThumbnailRenderer.thumbnail))}};n(Rr,"MusicCarouselShelfBasicHeader");xg.exports=Rr});var Sg=g((xL,Eg)=>{"use strict";var qg=C(),kr=class{type="MusicDescriptionShelf";constructor(e){this.description=new qg(e.description),this.max_collapsed_lines&&(this.max_collapsed_lines=e.maxCollapsedLines),this.max_expanded_lines&&(this.max_expanded_lines=e.maxExpandedLines),this.footer=new qg(e.footer)}};n(kr,"MusicDescriptionShelf");Eg.exports=kr});var Rg=g((TL,Cg)=>{"use strict";var Lr=C(),dS=O(),Ig=E(),Pr=class{type="MusicDetailHeader";constructor(e){this.title=new Lr(e.title),this.description=new Lr(e.description),this.subtitle=new Lr(e.subtitle),this.second_subtitle=new Lr(e.secondSubtitle),this.year=this.subtitle.runs.find(i=>/^[12][0-9]{3}$/.test(i.text)).text,this.song_count=this.second_subtitle.runs[0].text,this.total_duration=this.second_subtitle.runs[2].text,this.thumbnails=dS.fromResponse(e.thumbnail.croppedSquareThumbnailRenderer.thumbnail),this.badges=Ig.parse(e.subtitleBadges);let t=this.subtitle.runs.find(i=>{var a;return(a=i.endpoint.browse)==null?void 0:a.id.startsWith("UC")});t&&(this.author={name:t.text,channel_id:t.endpoint.browse.id,endpoint:t.endpoint}),this.menu=Ig.parse(e.menu)}};n(Pr,"MusicDetailHeader");Cg.exports=Pr});var Lg=g((qL,kg)=>{"use strict";var pS=E(),Ar=class{type="MusicHeader";constructor(e){this.header=pS.parse(e.header)}};n(Ar,"MusicHeader");kg.exports=Ar});var Ng=g((EL,Ag)=>{"use strict";var Pg=C(),mS=E(),Nr=class{type="MusicImmersiveHeader";constructor(e){this.title=new Pg(e.title),this.description=new Pg(e.description),this.thumbnails=mS.parse(e.thumbnail)}};n(Nr,"MusicImmersiveHeader");Ag.exports=Nr});var Ug=g((SL,Og)=>{"use strict";var Or=class{type="MusicInlineBadge";constructor(e){this.icon_type=e.icon.iconType,this.label=e.accessibilityData.accessibilityData.label}};n(Or,"MusicInlineBadge");Og.exports=Or});var Bg=g((IL,Dg)=>{"use strict";var gS=E(),Ur=class{type="MusicItemThumbnailOverlay";constructor(e){this.content=gS.parse(e.content),this.content_position=e.contentPosition,this.display_style=e.displayStyle}};n(Ur,"MusicItemThumbnailOverlay");Dg.exports=Ur});var Vg=g((CL,Mg)=>{"use strict";var _S=C(),yS=A(),Dr=class{type="MusicNavigationButton";constructor(e){this.button_text=new _S(e.buttonText).toString(),this.endpoint=new yS(e.navigationEndpoint)}};n(Dr,"MusicNavigationButton");Mg.exports=Dr});var Yg=g((RL,Fg)=>{"use strict";var wS=A(),Br=class{type="MusicPlayButton";constructor(e){var t;this.endpoint=new wS(e.playNavigationEndpoint),this.play_icon_type=e.playIcon.iconType,this.pause_icon_type=e.pauseIcon.iconType,e.accessibilityPlayData&&(this.play_label=e.accessibilityPlayData.accessibilityData.label),e.accessibilityPlayData&&(this.pause_label=(t=e.accessibilityPauseData)==null?void 0:t.accessibilityData.label),this.icon_color=e.iconColor}};n(Br,"MusicPlayButton");Fg.exports=Br});var Wg=g((kL,$g)=>{"use strict";var vS=E(),tn,Mr=class{constructor(e){f(this,"type","MusicPlaylistShelf");T(this,tn,void 0);this.playlist_id=e.playlistId,this.contents=vS.parse(e.contents),this.collapsed_item_count=e.collapsedItemCount,I(this,tn,e.continuations)}get continuation(){var e,t;return(t=(e=l(this,tn))==null?void 0:e[0])==null?void 0:t.nextContinuationData}};n(Mr,"MusicPlaylistShelf"),tn=new WeakMap;$g.exports=Mr});var Hg=g((LL,Gg)=>{"use strict";var bS=E(),Vr=class{type="MusicQueue";constructor(e){this.content=bS.parse(e.content)}};n(Vr,"MusicQueue");Gg.exports=Vr});var e_=g((PL,fg)=>{"use strict";var nn=E(),xS=C(),zg=F(),TS=O(),qS=A(),z,sn,pt,Yr,Kg,$r,Qg,Wr,Jg,Gr,Xg,Hr,Zg,zr,jg,Fr=class{constructor(e){T(this,Yr);T(this,$r);T(this,Wr);T(this,Gr);T(this,Hr);T(this,zr);T(this,z,void 0);T(this,sn,void 0);T(this,pt,void 0);var t,i,a,s;switch(this.type=null,I(this,z,nn.parse(e.flexColumns)),I(this,sn,nn.parse(e.fixedColumns)),I(this,pt,{video_id:((t=e==null?void 0:e.playlistItemData)==null?void 0:t.videoId)||null,playlist_set_video_id:((i=e==null?void 0:e.playlistItemData)==null?void 0:i.playlistSetVideoId)||null}),this.endpoint=e.navigationEndpoint&&new qS(e.navigationEndpoint)||null,(s=(a=this.endpoint)==null?void 0:a.browse)==null?void 0:s.page_type){case"MUSIC_PAGE_TYPE_ALBUM":this.type="album",N(this,Hr,Zg).call(this);break;case"MUSIC_PAGE_TYPE_PLAYLIST":this.type="playlist",N(this,zr,jg).call(this);break;case"MUSIC_PAGE_TYPE_ARTIST":case"MUSIC_PAGE_TYPE_USER_CHANNEL":this.type="artist",N(this,Gr,Xg).call(this);break;default:N(this,Yr,Kg).call(this);break}e.index&&(this.index=new xS(e.index)),this.thumbnails=e.thumbnail?TS.fromResponse(e.thumbnail.musicThumbnailRenderer.thumbnail):[],this.badges=nn.parse(e.badges)||[],this.menu=nn.parse(e.menu),this.overlay=nn.parse(e.overlay)}};n(Fr,"MusicResponsiveListItem"),z=new WeakMap,sn=new WeakMap,pt=new WeakMap,Yr=new WeakSet,Kg=n(function(){var t;((t=l(this,z)[1].title.runs)==null?void 0:t.some(i=>i.text.match(/(.*?) views/)))?(this.type="video",N(this,Wr,Jg).call(this)):(this.type="song",N(this,$r,Qg).call(this))},"#parseVideoOrSong"),$r=new WeakSet,Qg=n(function(){var a,s,r,o,p,h,u,m;this.id=l(this,pt).video_id||((a=this.endpoint)==null?void 0:a.watch.video_id),this.title=l(this,z)[0].title.toString();let e=((r=(s=l(this,z)[1].title.runs)==null?void 0:s.find(w=>/^\d+$/.test(w.text.replace(/:/g,""))))==null?void 0:r.text)||((h=(p=(o=l(this,sn))==null?void 0:o[0])==null?void 0:p.title)==null?void 0:h.text);e&&(this.duration={text:e,seconds:zg.timeToSeconds(e)});let t=(u=l(this,z)[1].title.runs)==null?void 0:u.find(w=>{var b;return(b=w.endpoint.browse)==null?void 0:b.id.startsWith("MPR")});t&&(this.album={id:t.endpoint.browse.id,name:t.text,endpoint:t.endpoint});let i=(m=l(this,z)[1].title.runs)==null?void 0:m.filter(w=>{var b;return(b=w.endpoint.browse)==null?void 0:b.id.startsWith("UC")});i&&(this.artists=i.map(w=>({name:w.text,channel_id:w.endpoint.browse.id,endpoint:w.endpoint})))},"#parseSong"),Wr=new WeakSet,Jg=n(function(){var i,a;this.id=l(this,pt).video_id,this.title=l(this,z)[0].title.toString(),this.views=l(this,z)[1].title.runs.find(s=>s.text.match(/(.*?) views/)).text;let e=(i=l(this,z)[1].title.runs)==null?void 0:i.filter(s=>{var r;return(r=s.endpoint.browse)==null?void 0:r.id.startsWith("UC")});e&&(this.authors=e.map(s=>({name:s.text,channel_id:s.endpoint.browse.id,endpoint:s.endpoint})));let t=(a=l(this,z)[1].title.runs.find(s=>/^\d+$/.test(s.text.replace(/:/g,""))))==null?void 0:a.text;t&&(this.duration={text:t,seconds:zg.timeToSeconds(t)})},"#parseVideo"),Gr=new WeakSet,Xg=n(function(){var e;this.id=this.endpoint.browse.id,this.name=l(this,z)[0].title.toString(),this.subscribers=((e=l(this,z)[1].title.runs[2])==null?void 0:e.text)||""},"#parseArtist"),Hr=new WeakSet,Zg=n(function(){this.id=this.endpoint.browse.id,this.title=l(this,z)[0].title.toString();let e=l(this,z)[1].title.runs.find(t=>{var i;return(i=t.endpoint.browse)==null?void 0:i.id.startsWith("UC")});e&&(this.author={name:e.text,channel_id:e.endpoint.browse.id,endpoint:e.endpoint}),this.year=l(this,z)[1].title.runs.find(t=>/^[12][0-9]{3}$/.test(t.text)).text},"#parseAlbum"),zr=new WeakSet,jg=n(function(){this.id=this.endpoint.browse.id,this.title=l(this,z)[0].title.toString(),this.item_count=parseInt(l(this,z)[1].title.runs.find(t=>t.text.match(/\d+ (song|songs)/)).text.match(/\d+/g));let e=l(this,z)[1].title.runs.find(t=>{var i;return(i=t.endpoint.browse)==null?void 0:i.id.startsWith("UC")});e&&(this.author={name:e.text,channel_id:e.endpoint.browse.id,endpoint:e.endpoint})},"#parsePlaylist");fg.exports=Fr});var n_=g((AL,t_)=>{"use strict";var ES=C(),Kr=class{type="musicResponsiveListItemFlexColumnRenderer";constructor(e){this.title=new ES(e.text),this.display_priority=e.displayPriority}};n(Kr,"MusicResponsiveListItemFixedColumn");t_.exports=Kr});var s_=g((NL,i_)=>{"use strict";var SS=C(),Qr=class{type="musicResponsiveListItemFlexColumnRenderer";constructor(e){this.title=new SS(e.text),this.display_priority=e.displayPriority}};n(Qr,"MusicResponsiveListItemFlexColumn");i_.exports=Qr});var c_=g((OL,o_)=>{"use strict";var IS=E(),r_=C(),CS=A(),Jr=class{type="MusicShelf";constructor(e){var t;this.title=new r_(e.title).toString(),this.contents=IS.parse(e.contents),e.bottomEndpoint&&(this.endpoint=new CS(e.bottomEndpoint)),e.continuations&&(this.continuation=(t=e.continuations)==null?void 0:t[0].nextContinuationData.continuation),e.bottomText&&(this.bottom_text=new r_(e.bottomText))}};n(Jr,"MusicShelf");o_.exports=Jr});var l_=g((UL,a_)=>{"use strict";var RS=O(),Xr=class{type="MusicThumbnail";constructor(e){return RS.fromResponse(e.thumbnail)}};n(Xr,"MusicThumbnail");a_.exports=Xr});var d_=g((DL,h_)=>{"use strict";var bl=E(),u_=C(),kS=O(),LS=A(),Zr=class{type="MusicTwoRowItem";constructor(e){var t,i,a;switch(this.title=new u_(e.title),this.endpoint=new LS(e.navigationEndpoint),this.id=((t=this.endpoint.browse)==null?void 0:t.id)||this.endpoint.watch.video_id,this.subtitle=new u_(e.subtitle),this.badges=bl.parse(e.subtitleBadges),(i=this.endpoint.browse)==null?void 0:i.page_type){case"MUSIC_PAGE_TYPE_ARTIST":this.type="artist",this.subscribers=this.subtitle.toString();break;case"MUSIC_PAGE_TYPE_PLAYLIST":this.type="playlist",this.item_count=parseInt((a=this.subtitle.runs.find(r=>r.text.match(/\d+ (songs|song)/)))==null?void 0:a.text.match(/\d+/g))||null;break;case"MUSIC_PAGE_TYPE_ALBUM":this.type="album";let s=this.subtitle.runs.filter(r=>{var o;return(o=r.endpoint.browse)==null?void 0:o.id.startsWith("UC")});s&&(this.artists=s.map(r=>({name:r.text,channel_id:r.endpoint.browse.id,endpoint:r.endpoint}))),this.year=this.subtitle.runs.slice(-1)[0].text,isNaN(this.year)&&delete this.year;break;default:if(this.subtitle.runs[0].text!=="Song"?this.type="video":this.type="song",this.type=="video"){this.views=this.subtitle.runs.find(o=>o.text.match(/(.*?) views/)).text;let r=this.subtitle.runs.find(o=>{var p;return(p=o.endpoint.browse)==null?void 0:p.id.startsWith("UC")});r&&(this.author={name:r.text,channel_id:r.endpoint.browse.id,endpoint:r.endpoint})}else{let r=this.subtitle.runs.filter(o=>{var p;return(p=o.endpoint.browse)==null?void 0:p.id.startsWith("UC")});r&&(this.artists=r.map(o=>({name:o.text,channel_id:o.endpoint.browse.id,endpoint:o.endpoint})))}break}this.thumbnail=kS.fromResponse(e.thumbnailRenderer.musicThumbnailRenderer.thumbnail),this.thumbnail_overlay=bl.parse(e.thumbnailOverlay),this.menu=bl.parse(e.menu)}};n(Zr,"MusicTwoRowItem");h_.exports=Zr});var y_=g((BL,__)=>{"use strict";var PS=E(),p_=C(),m_=O(),g_=A(),jr=class{type="Notification";constructor(e){this.thumbnails=m_.fromResponse(e.thumbnail),this.video_thumbnails=m_.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 g_(e.navigationEndpoint),this.record_click_endpoint=new g_(e.recordClickEndpoint),this.menu=PS.parse(e.contextualMenu),this.read=e.read}};n(jr,"Notification");__.exports=jr});var v_=g((ML,w_)=>{"use strict";var AS=E(),NS=O(),OS=A(),fr=class{type="PlayerAnnotationsExpanded";constructor(e){this.featured_channel={start_time_ms:e.featuredChannel.startTimeMs,end_time_ms:e.featuredChannel.endTimeMs,watermark:NS.fromResponse(e.featuredChannel.watermark),channel_name:e.featuredChannel.channelName,endpoint:new OS(e.featuredChannel.navigationEndpoint),subscribe_button:AS.parse(e.featuredChannel.subscribeButton)},this.allow_swipe_dismiss=e.allowSwipeDismiss,this.annotation_id=e.annotationId}};n(fr,"PlayerAnnotationsExpanded");w_.exports=fr});var T_=g((VL,x_)=>{"use strict";var b_=C(),eo=class{type="PlayerCaptionsTracklist";constructor(e){this.caption_tracks=e.captionTracks.map(t=>({base_url:t.baseUrl,name:new b_(t.name),vss_id:t.vssId,language_code:t.languageCode,kind:t.kind,is_translatable:t.isTranslatable})),this.audio_tracks=e.audioTracks.map(t=>({caption_track_indices:t.captionTrackIndices})),this.translation_languages=e.translationLanguages.map(t=>({language_code:t.languageCode,language_name:new b_(t.languageName)}))}};n(eo,"PlayerCaptionsTracklist");x_.exports=eo});var S_=g((FL,E_)=>{"use strict";var US=E(),q_=C(),DS=O(),to=class{type="PlayerErrorMessage";constructor(e){this.subreason=new q_(e.subreason),this.reason=new q_(e.reason),this.proceed_button=US.parse(e.proceedButton),this.thumbnails=DS.fromResponse(e.thumbnail),this.icon_type=e.icon.iconType}};n(to,"PlayerErrorMessage");E_.exports=to});var C_=g((YL,I_)=>{"use strict";var no=class{type="PlayerLiveStoryboardSpec";constructor(){}};n(no,"PlayerLiveStoryboardSpec");I_.exports=no});var L_=g(($L,k_)=>{"use strict";var R_=C(),BS=O(),io=class{type="PlayerMicroformat";constructor(e){this.title=new R_(e.title),this.description=new R_(e.description),this.thumbnails=BS.fromResponse(e.thumbnail),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}};n(io,"PlayerMicroformat");k_.exports=io});var A_=g((WL,P_)=>{"use strict";var rn=E(),so=class{type="PlayerOverlay";constructor(e){this.end_screen=rn.parse(e.endScreen),this.autoplay=rn.parse(e.autoplay),this.share_button=rn.parse(e.shareButton),this.add_to_menu=rn.parse(e.addToMenu),this.fullscreen_engagement=rn.parse(e.fullscreenEngagement)}};n(so,"PlayerOverlay");P_.exports=so});var O_=g((GL,N_)=>{"use strict";var ro=E(),oo=C(),MS=Z(),VS=O(),co=class{type="PlayerOverlayAutoplay";constructor(e){this.title=new oo(e.title),this.video_id=e.videoId,this.video_title=new oo(e.videoTitle),this.short_view_count=new oo(e.shortViewCountText),this.prefer_immediate_redirect=e.preferImmediateRedirect,this.count_down_secs_for_fullscreen=e.countDownSecsForFullscreen,this.published=new oo(e.publishedTimeText),this.background=VS.fromResponse(e.background),this.thumbnail_overlays=ro.parse(e.thumbnailOverlays),this.author=new MS(e.byline),this.cancel_button=ro.parse(e.cancelButton),this.next_button=ro.parse(e.nextButton),this.close_button=ro.parse(e.closeButton)}};n(co,"PlayerOverlayAutoplay");N_.exports=co});var D_=g((HL,U_)=>{"use strict";var ao=class{type="PlayerStoryboardSpec";constructor(e){let t=e.spec.split("|"),i=new URL(t.shift());this.boards=t.map((a,s)=>{let[r,o,p,h,u,m,w,b]=a.split("#");i.searchParams.set("sigh",b),p=parseInt(p,10),h=parseInt(h,10),u=parseInt(u,10);let y=Math.ceil(p/(h*u));return{template_url:i.toString().replace("$L",s).replace("$N",w),thumbnail_width:parseInt(r,10),thumbnail_height:parseInt(o,10),thumbnail_count:p,interval:parseInt(m,10),columns:h,rows:u,storyboard_count:y}})}};n(ao,"PlayerStoryboardSpec");U_.exports=ao});var M_=g((zL,B_)=>{"use strict";var mt=C(),FS=ut(),xl=E(),lo=class{type="PlaylistHeader";constructor(e){this.id=e.playlistId,this.title=new mt(e.title),this.stats=e.stats.map(t=>new mt(t)),this.brief_stats=e.briefStats.map(t=>new mt(t)),this.author=new FS({...e.ownerText,navigationEndpoint:e.ownerEndpoint},e.ownerBadges,null),this.description=new mt(e.descriptionText),this.num_videos=new mt(e.numVideosText),this.view_count=new mt(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=xl.parse(e.saveButton),this.shuffle_play_button=xl.parse(e.shufflePlayButton),this.menu=xl.parse(e.moreActionsMenu)}};n(lo,"PlaylistHeader");B_.exports=lo});var F_=g((KL,V_)=>{"use strict";var Tl=C(),YS=O(),$S=A(),uo=class{type="PlaylistInfoCardContent";constructor(e){this.title=new Tl(e.playlistTitle),this.thumbnails=YS.fromResponse(e.thumbnail),this.video_count=new Tl(e.playlistVideoCount),this.channel_name=new Tl(e.channelName),this.endpoint=new $S(e.action)}};n(uo,"PlaylistInfoCardContent");V_.exports=uo});var $_=g((QL,Y_)=>{"use strict";var ho=class{type="PlaylistMetadata";constructor(e){this.title=e.title,this.description=e.description||null}};n(ho,"PlaylistMetadata");Y_.exports=ho});var G_=g((JL,W_)=>{"use strict";var WS=E(),GS=C(),po=class{type="PlaylistPanel";constructor(e){var t,i;this.title=e.title,this.title_text=new GS(e.titleText),this.contents=WS.parse(e.contents),this.playlist_id=e.playlistId,this.is_infinite=e.isInfinite,this.continuation=(i=(t=e.continuations[0])==null?void 0:t.nextRadioContinuationData)==null?void 0:i.continuation,this.is_editable=e.isEditable,this.preview_description=e.previewDescription,this.num_items_to_show=e.numItemsToShow}};n(po,"PlaylistPanel");W_.exports=po});var K_=g((XL,z_)=>{"use strict";var H_=E(),Ke=C(),HS=O(),zS=A(),KS=F(),mo=class{type="PlaylistPanelVideo";constructor(e){this.title=new Ke(e.title),this.thumbnail=HS.fromResponse(e.thumbnail),this.endpoint=new zS(e.navigationEndpoint),this.selected=e.selected,this.video_id=e.videoId,this.duration={text:new Ke(e.lengthText).toString(),seconds:KS.timeToSeconds(new Ke(e.lengthText).toString())};let t=new Ke(e.longBylineText).runs.find(a=>{var s;return(s=a.endpoint.browse)==null?void 0:s.id.startsWith("MPR")}),i=new Ke(e.longBylineText).runs.filter(a=>{var s;return(s=a.endpoint.browse)==null?void 0:s.id.startsWith("UC")});this.author=new Ke(e.shortBylineText).toString(),t&&(this.album={id:t.endpoint.browse.id,name:t.text,year:new Ke(e.longBylineText).runs.slice(-1)[0].text,endpoint:t.endpoint}),this.artists=i.map(a=>({name:a.text,channel_id:a.endpoint.browse.id,endpoint:a.endpoint})),this.badges=H_.parse(e.badges),this.menu=H_.parse(e.menu),this.set_video_id=e.playlistSetVideoId}};n(mo,"PlaylistPanelVideo");z_.exports=mo});var J_=g((ZL,Q_)=>{"use strict";var QS=E(),go=class{type="PlaylistSidebar";constructor(e){this.items=QS.parse(e.items)}get contents(){return this.items}};n(go,"PlaylistSidebar");Q_.exports=go});var j_=g((jL,Z_)=>{"use strict";var X_=E(),JS=A(),ql=C(),_o=class{type="PlaylistSidebarPrimaryInfo";constructor(e){this.stats=e.stats.map(t=>new ql(t)),this.thumbnail_renderer=X_.parse(e.thumbnailRenderer),this.title=new ql(e.title),this.menu=e.menu&&X_.parse(e.menu),this.endpoint=new JS(e.navigationEndpoint),this.description=new ql(e.description)}};n(_o,"PlaylistSidebarPrimaryInfo");Z_.exports=_o});var ty=g((fL,ey)=>{"use strict";var f_=E(),yo=class{type="PlaylistSidebarSecondaryInfo";constructor(e){this.owner=f_.parse(e.videoOwner)||null,this.button=f_.parse(e.button)||null}};n(yo,"PlaylistSidebarSecondaryInfo");ey.exports=yo});var sy=g((eP,iy)=>{"use strict";var El=C(),ny=E(),XS=O(),ZS=ut(),jS=A(),wo=class{type="PlaylistVideo";constructor(e){this.id=e.videoId,this.index=new El(e.index),this.title=new El(e.title),this.author=new ZS(e.shortBylineText),this.thumbnails=XS.fromResponse(e.thumbnail),this.thumbnail_overlays=ny.parse(e.thumbnailOverlays),this.set_video_id=e==null?void 0:e.setVideoId,this.endpoint=new jS(e.navigationEndpoint),this.is_playable=e.isPlayable,this.menu=ny.parse(e.menu),this.duration={text:new El(e.lengthText).text,seconds:parseInt(e.lengthSeconds)}}};n(wo,"PlaylistVideo");iy.exports=wo});var oy=g((tP,ry)=>{"use strict";var fS=E(),vo=class{type="PlaylistVideoList";constructor(e){this.id=e.playlistId,this.is_editable=e.isEditable,this.can_reorder=e.canReorder,this.videos=fS.parse(e.contents)}};n(vo,"PlaylistVideoList");ry.exports=vo});var ay=g((nP,cy)=>{"use strict";var eI=O(),bo=class{type="PlaylistVideoThumbnail";constructor(e){this.thumbnail=eI.fromResponse(e.thumbnail)}};n(bo,"PlaylistVideoThumbnail");cy.exports=bo});var hy=g((iP,uy)=>{"use strict";var xo=C(),tI=O(),ly=A(),To=class{type="Poll";constructor(e){this.choices=e.choices.map(t=>({text:new xo(t.text).toString(),select_endpoint:t.selectServiceEndpoint?new ly(t.selectServiceEndpoint):null,deselect_endpoint:t.deselectServiceEndpoint?new ly(t.deselectServiceEndpoint):null,vote_ratio_if_selected:(t==null?void 0:t.voteRatioIfSelected)||null,vote_percentage_if_selected:new xo(t.votePercentageIfSelected),vote_ratio_if_not_selected:(t==null?void 0:t.voteRatioIfSelected)||null,vote_percentage_if_not_selected:new xo(t.votePercentageIfSelected),image:t.image?tI.fromResponse(t.image):null})),e.type&&(this.poll_type=e.type),e.totalVotes&&(this.total_votes=new xo(e.totalVotes)),e.liveChatPollId&&(this.live_chat_poll_id=e.liveChatPollId)}};n(To,"Poll");uy.exports=To});var py=g((sP,dy)=>{"use strict";var nI=Ja(),qo=class extends nI{type="Post";constructor(e){super(e)}};n(qo,"Post");dy.exports=qo});var gy=g((rP,my)=>{"use strict";var iI=E(),Eo=class{type="ProfileColumn";constructor(e){this.items=iI.parse(e.items)}get contents(){return this.items}};n(Eo,"ProfileColumn");my.exports=Eo});var yy=g((oP,_y)=>{"use strict";var sI=E(),So=class{type="ProfileColumnStats";constructor(e){this.items=sI.parse(e.items)}get contents(){return this.items}};n(So,"ProfileColumnStats");_y.exports=So});var by=g((cP,vy)=>{"use strict";var wy=C(),Io=class{type="ProfileColumnStatsEntry";constructor(e){this.label=new wy(e.label),this.value=new wy(e.value)}};n(Io,"ProfileColumnStatsEntry");vy.exports=Io});var Ty=g((aP,xy)=>{"use strict";var rI=C(),oI=O(),Co=class{type="ProfileColumnUserInfo";constructor(e){this.title=new rI(e.title),this.thumbnails=oI.fromResponse(e.thumbnail)}};n(Co,"ProfileColumnUserInfo");xy.exports=Co});var Sy=g((lP,Ey)=>{"use strict";var cI=A(),qy=C(),aI=O(),Ro=class{type="ReelItem";constructor(e){this.id=e.videoId,this.title=new qy(e.headline,""),this.thumbnails=aI.fromResponse(e.thumbnail),this.views=new qy(e.viewCountText,""),this.endpoint=new cI(e.navigationEndpoint)}};n(Ro,"ReelItem");Ey.exports=Ro});var Cy=g((uP,Iy)=>{"use strict";var lI=E(),uI=A(),hI=C(),ko=class{type="ReelShelf";constructor(e){this.title=new hI(e.title),this.items=lI.parse(e.items),this.endpoint=e.endpoint?new uI(e.endpoint):null}get contents(){return this.items}};n(ko,"ReelShelf");Iy.exports=ko});var ky=g((hP,Ry)=>{"use strict";var dI=E(),Lo=class{type="RelatedChipCloud";constructor(e){this.content=dI.parse(e.content)}};n(Lo,"RelatedChipCloud");Ry.exports=Lo});var Ay=g((dP,Py)=>{"use strict";var Ly=E(),Po=class{type="RichGrid";constructor(e){this.header=Ly.parse(e.header),this.contents=Ly.parse(e.contents)}};n(Po,"RichGrid");Py.exports=Po});var Oy=g((pP,Ny)=>{"use strict";var pI=E(),Ao=class{type="RichItem";constructor(e){return pI.parse(e.content)}};n(Ao,"RichItem");Ny.exports=Ao});var Dy=g((mP,Uy)=>{"use strict";var mI=C(),No=class{constructor(e){this.title=new mI(e.title),this.icon_type=e.icon.iconType}};n(No,"RichListHeader");Uy.exports=No});var My=g((gP,By)=>{"use strict";var gI=E(),Oo=class{type="RichSection";constructor(e){this.contents=gI.parse(e.content)}};n(Oo,"RichSection");By.exports=Oo});var Fy=g((_P,Vy)=>{"use strict";var _I=E(),yI=A(),wI=C(),Uo=class{type="RichShelf";constructor(e){this.title=new wI(e.title),this.contents=_I.parse(e.contents),this.endpoint=e.endpoint?new yI(e.endpoint):null}};n(Uo,"RichShelf");Vy.exports=Uo});var Wy=g((yP,$y)=>{"use strict";var Yy=E(),vI=C(),bI=A(),Do=class{type="SearchBox";constructor(e){this.endpoint=new bI(e.endpoint),this.search_button=Yy.parse(e.searchButton),this.clear_button=Yy.parse(e.clearButton),this.placeholder_text=new vI(e.placeholderText)}};n(Do,"SearchBox");$y.exports=Do});var Hy=g((wP,Gy)=>{"use strict";var xI=A(),TI=O(),qI=C(),Bo=class{type="SearchRefinementCard";constructor(e){this.thumbnails=TI.fromResponse(e.thumbnail),this.endpoint=new xI(e.searchEndpoint),this.query=new qI(e.query).toString()}};n(Bo,"SearchRefinementCard");Gy.exports=Bo});var Ky=g((vP,zy)=>{"use strict";var EI=E(),Mo=class{type="SearchSuggestionsSection";constructor(e){this.contents=EI.parse(e.contents)}};n(Mo,"SearchSuggestionsSection");zy.exports=Mo});var Jy=g((bP,Qy)=>{"use strict";var SI=E(),Vo=class{type="SecondarySearchContainer";constructor(e){this.contents=SI.parse(e.contents)}};n(Vo,"SecondarySearchContainer");Qy.exports=Vo});var jy=g((xP,Zy)=>{"use strict";var Xy=E(),Fo=class{type="SectionList";constructor(e){e.targetId&&(this.target_id=e.targetId),this.contents=Xy.parse(e.contents),e.continuations&&(e.continuations[0].nextContinuationData?this.continuation=e.continuations[0].nextContinuationData.continuation:e.continuations[0].reloadContinuationData&&(this.continuation=e.continuations[0].reloadContinuationData.continuation)),e.header&&(this.header=Xy.parse(e.header))}};n(Fo,"SectionList");Zy.exports=Fo});var tw=g((TP,ew)=>{"use strict";var II=C(),fy=E(),CI=A(),Yo=class{type="Shelf";constructor(e){var t,i;this.title=new II(e.title),e.endpoint&&(this.endpoint=new CI(e.endpoint)),this.content=fy.parse(e.content)||[],(t=e.icon)!=null&&t.iconType&&(this.icon_type=(i=e.icon)==null?void 0:i.iconType),e.menu&&(this.menu=fy.parse(e.menu))}};n(Yo,"Shelf");ew.exports=Yo});var sw=g((qP,iw)=>{"use strict";var RI=C(),nw=A(),$o=class{type="ShowingResultsFor";constructor(e){this.corrected_query=new RI(e.correctedQuery),this.endpoint=new nw(e.correctedQueryEndpoint),this.original_query_endpoint=new nw(e.originalQueryEndpoint)}};n($o,"ShowingResultsFor");iw.exports=$o});var ow=g((EP,rw)=>{"use strict";var kI=C(),Wo=class{type="SimpleCardTeaser";constructor(e){this.message=new kI(e.message),this.prominent=e.prominent}};n(Wo,"SimpleCardTeaser");rw.exports=Wo});var aw=g((SP,cw)=>{"use strict";var Sl=C(),LI=A(),Go=class{type="SingleActionEmergencySupport";constructor(e){this.action_text=new Sl(e.actionText),this.nav_text=new Sl(e.navigationText),this.details=new Sl(e.detailsText),this.icon_type=e.icon.iconType,this.endpoint=new LI(e.navigationEndpoint)}};n(Go,"SingleActionEmergencySupport");cw.exports=Go});var uw=g((IP,lw)=>{"use strict";var PI=E(),Ho=class{type="SingleColumnBrowseResults";constructor(e){this.tabs=PI.parse(e.tabs)}};n(Ho,"SingleColumnBrowseResults");lw.exports=Ho});var dw=g((CP,hw)=>{"use strict";var AI=E(),zo=class{type="SingleColumnMusicWatchNextResults";constructor(e){return AI.parse(e)}};n(zo,"SingleColumnMusicWatchNextResults");hw.exports=zo});var mw=g((RP,pw)=>{"use strict";var NI=O(),Ko=class{type="SingleHeroImage";constructor(e){this.thumbnails=new NI(e.thumbnail).thumbnails,this.style=e.style}};n(Ko,"SingleHeroImage");pw.exports=Ko});var _w=g((kP,gw)=>{"use strict";var{observe:OI}=F(),Qo=class{type="SortFilterSubMenu";constructor(e){this.sub_menu_items=OI(e.subMenuItems.map(t=>{var i;return{title:t.title,selected:t.selected,continuation:(i=t.continuation)==null?void 0:i.reloadContinuationData.continuation,subtitle:t.subtitle}})),this.label=e.accessibility.accessibilityData.label}};n(Qo,"SortFilterSubMenu");gw.exports=Qo});var ww=g((LP,yw)=>{"use strict";var UI=C(),DI=A(),Jo=class{type="SubFeedOption";constructor(e){this.name=new UI(e.name),this.is_selected=e.isSelected,this.endpoint=new DI(e.navigationEndpoint)}};n(Jo,"SubFeedOption");yw.exports=Jo});var bw=g((PP,vw)=>{"use strict";var BI=E(),MI=C(),Xo=class{type="SubFeedSelector";constructor(e){this.title=new MI(e.title),this.options=BI.parse(e.options)}};n(Xo,"SubFeedSelector");vw.exports=Xo});var Tw=g((AP,xw)=>{"use strict";var VI=E(),Il=C(),FI=A(),Zo=class{type="SubscribeButton";constructor(e){var t,i;this.title=new Il(e.buttonText),this.subscribed=e.subscribed,this.enabled=e.enabled,this.type=e.type,this.channel_id=e.channelId,this.show_preferences=e.showPreferences,this.subscribed_text=new Il(e.subscribedButtonText),this.unsubscribed_text=new Il(e.unsubscribedButtonText),this.notification_preference_button=VI.parse(e.notificationPreferenceButton),this.endpoint=new FI(((t=e.serviceEndpoints)==null?void 0:t[0])||((i=e.onSubscribeEndpoints)==null?void 0:i[0]))}};n(Zo,"SubscribeButton");xw.exports=Zo});var Ew=g((NP,qw)=>{"use strict";var YI=E(),jo=class{type="SubscriptionNotificationToggleButton";constructor(e){this.states=e.states.map(t=>({id:t.stateId,next_id:t.nextStateId,state:YI.parse(t.state)})),this.current_state_id=e.currentStateId,this.target_id=e.targetId}};n(jo,"SubscriptionNotificationToggleButton");qw.exports=jo});var Iw=g((OP,Sw)=>{"use strict";var $I=E(),WI=A(),fo=class{type="Tab";constructor(e){this.title=e.title||"N/A",this.selected=e.selected||!1,this.endpoint=new WI(e.endpoint),this.content=$I.parse(e.content)}};n(fo,"Tab");Sw.exports=fo});var Rw=g((UP,Cw)=>{"use strict";var GI=E(),ec=class{type="Tabbed";constructor(e){return GI.parse(e)}};n(ec,"Tabbed");Cw.exports=ec});var Lw=g((DP,kw)=>{"use strict";var HI=E(),tc=class{type="TabbedSearchResults";constructor(e){this.tabs=HI.parse(e.tabs)}};n(tc,"TabbedSearchResults");kw.exports=tc});var Aw=g((BP,Pw)=>{"use strict";var zI=C(),nc=class{type="TextHeader";constructor(e){this.title=new zI(e.title),this.style=e.style}};n(nc,"TextHeader");Pw.exports=nc});var Ow=g((MP,Nw)=>{"use strict";var ic=class{type="ThumbnailOverlayBottomPanel";constructor(e){this.type=e.icon.iconType}};n(ic,"ThumbnailOverlayBottomPanel");Nw.exports=ic});var Dw=g((VP,Uw)=>{"use strict";var KI=C(),sc=class{type="ThumbnailOverlayEndorsement";constructor(e){this.text=new KI(e.text).toString()}};n(sc,"ThumbnailOverlayEndorsement");Uw.exports=sc});var Mw=g((FP,Bw)=>{"use strict";var QI=C(),rc=class{type="ThumbnailOverlayHoverText";constructor(e){this.text=new QI(e.text),this.type=e.icon.iconType}};n(rc,"ThumbnailOverlayHoverText");Bw.exports=rc});var Fw=g((YP,Vw)=>{"use strict";var JI=C(),oc=class{type="ThumbnailOverlayInlineUnplayable";constructor(e){this.text=new JI(e.text).toString(),this.icon_type=e.icon.iconType}};n(oc,"ThumbnailOverlayInlineUnplayable");Vw.exports=oc});var $w=g(($P,Yw)=>{"use strict";var XI=C(),cc=class{type="ThumbnailOverlayLoadingPreview";constructor(e){this.text=new XI(e.text)}};n(cc,"ThumbnailOverlayLoadingPreview");Yw.exports=cc});var Gw=g((WP,Ww)=>{"use strict";var ZI=C(),ac=class{type="ThumbnailOverlayNowPlaying";constructor(e){this.text=new ZI(e.text).text}};n(ac,"ThumbnailOverlayNowPlaying");Ww.exports=ac});var zw=g((GP,Hw)=>{"use strict";var lc=class{type="ThumbnailOverlayPinking";constructor(e){this.hack=e.hack}};n(lc,"ThumbnailOverlayPinking");Hw.exports=lc});var Qw=g((HP,Kw)=>{"use strict";var jI=C(),uc=class{type="ThumbnailOverlayPlaybackStatus";constructor(e){this.text=e.texts.map(t=>new jI(t))[0].toString()}};n(uc,"ThumbnailOverlayPlaybackStatus");Kw.exports=uc});var Xw=g((zP,Jw)=>{"use strict";var hc=class{type="ThumbnailOverlayResumePlayback";constructor(e){this.percent_duration_watched=e.percentDurationWatched}};n(hc,"ThumbnailOverlayResumePlayback");Jw.exports=hc});var jw=g((KP,Zw)=>{"use strict";var fI=C(),dc=class{type="ThumbnailOverlaySidePanel";constructor(e){this.text=new fI(e.text),this.type=e.icon.iconType}};n(dc,"ThumbnailOverlaySidePanel");Zw.exports=dc});var ev=g((QP,fw)=>{"use strict";var eC=C(),pc=class{type="ThumbnailOverlayTimeStatus";constructor(e){this.text=new eC(e.text).text}};n(pc,"ThumbnailOverlayTimeStatus");fw.exports=pc});var iv=g((JP,nv)=>{"use strict";var tv=A(),mc=class{type="ThumbnailOverlayToggleButton";constructor(e){this.is_toggled=e.isToggled||null,this.icon_type={toggled:e.toggledIcon.iconType,untoggled:e.untoggledIcon.iconType},this.tooltip={toggled:e.toggledTooltip,untoggled:e.untoggledTooltip},this.toggled_endpoint=new tv(e.toggledServiceEndpoint),this.untoggled_endpoint=new tv(e.untoggledServiceEndpoint)}};n(mc,"ThumbnailOverlayToggleButton");nv.exports=mc});var rv=g((XP,sv)=>{"use strict";var Cl=C(),Rl=A(),gc=class{type="ToggleButton";constructor(e){var i,a,s,r,o,p,h,u;this.text=new Cl(e.defaultText),this.toggled_text=new Cl(e.toggledText),this.tooltip=e.defaultTooltip,this.toggled_tooltip=e.toggledTooltip,this.is_toggled=e.isToggled,this.is_disabled=e.isDisabled,this.icon_type=e.defaultIcon.iconType;let t=((a=(i=e==null?void 0:e.defaultText)==null?void 0:i.accessibility)==null?void 0:a.accessibilityData.label)||((s=e==null?void 0:e.accessibilityData)==null?void 0:s.accessibilityData.label)||((r=e==null?void 0:e.accessibility)==null?void 0:r.label);this.icon_type=="LIKE"&&(this.like_count=parseInt(t.replace(/\D/g,"")),this.short_like_count=new Cl(e.defaultText).toString()),this.endpoint=((p=(o=e.defaultServiceEndpoint)==null?void 0:o.commandExecutorCommand)==null?void 0:p.commands)&&new Rl(e.defaultServiceEndpoint.commandExecutorCommand.commands.pop())||new Rl(e.defaultServiceEndpoint),this.toggled_endpoint=new Rl(e.toggledServiceEndpoint),this.button_id=((u=(h=e.toggleButtonSupportedData)==null?void 0:h.toggleButtonIdData)==null?void 0:u.id)||null,this.target_id=e.targetId||null}};n(gc,"ToggleButton");sv.exports=gc});var av=g((ZP,cv)=>{"use strict";var ov=C(),tC=A(),_c=class{type="ToggleMenuServiceItem";constructor(e){this.text=new ov(e.defaultText),this.toggled_text=new ov(e.toggledText),this.icon_type=e.defaultIcon.iconType,this.toggled_icon_type=e.toggledIcon.iconType,this.endpoint=new tC(e.toggledServiceEndpoint)}};n(_c,"ToggleMenuServiceItem");cv.exports=_c});var uv=g((jP,lv)=>{"use strict";var nC=C(),kl=A(),yc=class{type="Tooltip";constructor(e){this.promo_config={promo_id:e.promoConfig.promoId,impression_endpoints:e.promoConfig.impressionEndpoints.map(t=>new kl(t)),accept:new kl(e.promoConfig.acceptCommand),dismiss:new kl(e.promoConfig.dismissCommand)},this.target_id=e.targetId,this.details=new nC(e.detailsText),this.suggested_position=e.suggestedPosition.type,this.dismiss_stratedy=e.dismissStrategy.type,this.dwell_time_ms=parseInt(e.dwellTimeMs)}};n(yc,"Tooltip");lv.exports=yc});var Ll=g((fP,dv)=>{"use strict";var hv=E(),wc=class{type="TwoColumnBrowseResults";constructor(e){this.tabs=hv.parse(e.tabs),this.secondary_contents=hv.parse(e.secondaryContents)}};n(wc,"TwoColumnBrowseResults");dv.exports=wc});var gv=g((eA,mv)=>{"use strict";var pv=E(),vc=class{type="TwoColumnSearchResults";constructor(e){this.primary_contents=pv.parse(e.primaryContents),this.secondary_contents=pv.parse(e.secondaryContents)}};n(vc,"TwoColumnSearchResults");mv.exports=vc});var yv=g((tA,_v)=>{"use strict";var Pl=E(),bc=class{type="TwoColumnWatchNextResults";constructor(e){var t,i;this.results=Pl.parse((t=e.results)==null?void 0:t.results.contents),this.secondary_results=Pl.parse((i=e.secondaryResults)==null?void 0:i.secondaryResults.results),this.conversation_bar=Pl.parse(e==null?void 0:e.conversationBar)}};n(bc,"TwoColumnWatchNextResults");_v.exports=bc});var vv=g((nA,wv)=>{"use strict";var Al=E(),xc=class{type="UniversalWatchCard";constructor(e){this.header=Al.parse(e.header),this.call_to_action=Al.parse(e.callToAction),this.sections=Al.parse(e.sections)}};n(xc,"UniversalWatchCard");wv.exports=xc});var xv=g((iA,bv)=>{"use strict";var iC=E(),sC=C(),Tc=class{type="VerticalList";constructor(e){this.items=iC.parse(e.items),this.collapsed_item_count=e.collapsedItemCount,this.collapsed_state_button_text=new sC(e.collapsedStateButtonText)}get contents(){return this.items}};n(Tc,"VerticalList");bv.exports=Tc});var qv=g((sA,Tv)=>{"use strict";var rC=E(),oC=C(),cC=A(),qc=class{type="VerticalWatchCardList";constructor(e){this.items=rC.parse(e.items),this.contents=this.items,this.view_all_text=new oC(e.viewAllText),this.view_all_endpoint=new cC(e.viewAllEndpoint)}};n(qc,"VerticalWatchCardList");Tv.exports=qc});var Sv=g((rA,Ev)=>{"use strict";var Nl=E(),de=C(),aC=Z(),lC=O(),uC=A(),hC=F(),Ec=class{type="Video";constructor(e){var a,s,r,o;let t=((a=e.thumbnailOverlays.find(p=>p.thumbnailOverlayTimeStatusRenderer))==null?void 0:a.thumbnailOverlayTimeStatusRenderer.text)||"N/A";this.id=e.videoId,this.title=new de(e.title),this.description_snippet=e.descriptionSnippet?new de(e.descriptionSnippet,""):null,this.snippets=((s=e.detailedMetadataSnippets)==null?void 0:s.map(p=>({text:new de(p.snippetText),hover_text:new de(p.snippetHoverText)})))||[],this.thumbnails=lC.fromResponse(e.thumbnail),this.thumbnail_overlays=Nl.parse(e.thumbnailOverlays),this.rich_thumbnail=e.richThumbnail&&Nl.parse(e.richThumbnail),this.author=new aC(e.ownerText,e.ownerBadges,(o=(r=e.channelThumbnailSupportedRenderers)==null?void 0:r.channelThumbnailWithLinkRenderer)==null?void 0:o.thumbnail),this.endpoint=new uC(e.navigationEndpoint),this.published=new de(e.publishedTimeText),this.view_count_text=new de(e.viewCountText),this.short_view_count_text=new de(e.shortViewCountText);let i=e.upcomingEventData&&Number(`${e.upcomingEventData.startTime}000`);i&&(this.upcoming=new Date(i)),this.duration={text:e.lengthText?new de(e.lengthText).text:new de(t).text,seconds:hC.timeToSeconds(e.lengthText?new de(e.lengthText).text:new de(t).text)},this.show_action_menu=e.showActionMenu,this.is_watched=e.isWatched||!1,this.menu=Nl.parse(e.menu)}get description(){var e;return this.snippets.length>0?this.snippets.map(t=>t.text.toString()).join(""):((e=this.description_snippet)==null?void 0:e.toString())||""}get is_live(){return this.badges.some(e=>e.style==="BADGE_STYLE_TYPE_LIVE_NOW")}get is_upcoming(){return this.upcoming&&this.upcoming>new Date}get has_captions(){return this.badges.some(e=>e.label==="CC")}get best_thumbnail(){return this.thumbnails[0]}};n(Ec,"Video");Ev.exports=Ec});var Cv=g((oA,Iv)=>{"use strict";var Sc=C(),dC=O(),pC=A(),Ic=class{type="VideoInfoCardContent";constructor(e){this.title=new Sc(e.videoTitle),this.channel_name=new Sc(e.channelName),this.view_count=new Sc(e.viewCountText),this.video_thumbnails=dC.fromResponse(e.videoThumbnail),this.duration=new Sc(e.lengthString),this.endpoint=new pC(e.action)}};n(Ic,"VideoInfoCardContent");Iv.exports=Ic});var kv=g((cA,Rv)=>{"use strict";var mC=C(),gC=Z(),Cc=class{type="VideoOwner";constructor(e){this.subscription_button=e.subscriptionButton||null,this.subscriber_count=new mC(e.subscriberCountText),this.author=new gC({...e.title,navigationEndpoint:e.navigationEndpoint},e.badges,e.thumbnail)}};n(Cc,"VideoOwner");Rv.exports=Cc});var Pv=g((aA,Lv)=>{"use strict";var _C=E(),on=C(),Rc=class{type="VideoPrimaryInfo";constructor(e){this.title=new on(e.title),this.super_title_link=new on(e.superTitleLink),this.view_count=new on(e.viewCount.videoViewCountRenderer.viewCount),this.short_view_count=new on(e.viewCount.videoViewCountRenderer.shortViewCount),this.published=new on(e.dateText),this.menu=_C.parse(e.videoActions)}};n(Rc,"VideoPrimaryInfo");Lv.exports=Rc});var Nv=g((lA,Av)=>{"use strict";var Ol=E(),yC=C(),kc=class{type="VideoSecondaryInfo";constructor(e){this.owner=Ol.parse(e.owner),this.description=new yC(e.description),this.subscribe_button=Ol.parse(e.subscribeButton),this.metadata=Ol.parse(e.metadataRowContainer),this.show_more_text=e.showMoreText,this.show_less_text=e.showLessText,this.default_expanded=e.defaultExpanded,this.description_collapsed_lines=e.descriptionCollapsedLines}};n(kc,"VideoSecondaryInfo");Av.exports=kc});var Uv=g((uA,Ov)=>{"use strict";var Ul=C(),{timeToSeconds:wC}=F(),Lc=class{type="WatchCardCompactVideo";constructor(e){this.title=new Ul(e.title),this.subtitle=new Ul(e.subtitle),this.duration={text:new Ul(e.lengthText).toString(),seconds:wC(e.lengthText.simpleText)},this.style=e.style}};n(Lc,"WatchCardCompactVideo");Ov.exports=Lc});var Mv=g((hA,Bv)=>{"use strict";var Dv=E(),vC=A(),Pc=class{type="WatchCardHeroVideo";constructor(e){this.endpoint=new vC(e.navigationEndpoint),this.call_to_action_button=Dv.parse(e.callToActionButton),this.hero_image=Dv.parse(e.heroImage),this.label=e.accessibility.accessibilityData.label}};n(Pc,"WatchCardHeroVideo");Bv.exports=Pc});var Yv=g((dA,Fv)=>{"use strict";var bC=Z(),xC=A(),Vv=C(),Ac=class{type="WatchCardRichHeader";constructor(e){this.title=new Vv(e.title),this.title_endpoint=new xC(e.titleNavigationEndpoint),this.subtitle=new Vv(e.subtitle),this.author=new bC(e,e.titleBadge?[e.titleBadge]:null,e.avatar),this.author.name=this.title,this.style=e.style}};n(Ac,"WatchCardRichHeader");Fv.exports=Ac});var Wv=g((pA,$v)=>{"use strict";var TC=E(),Nc=class{type="WatchCardSectionSequence";constructor(e){this.lists=TC.parse(e.lists)}};n(Nc,"WatchCardSectionSequence");$v.exports=Nc});var Hv=g((mA,Gv)=>{"use strict";var qC=E(),EC=C(),Oc=class{constructor(e){this.results=qC.parse(e.results),this.title=new EC(e.title).toString()}};n(Oc,"WatchNextEndScreen");Gv.exports=Oc});var Kv=g((gA,zv)=>{"use strict";var SC=Ll(),Uc=class extends SC{type="WatchNextTabbedResults";constructor(e){super(e)}};n(Uc,"WatchNextTabbedResults");zv.exports=Uc});var Jv=g((_A,Qv)=>{var IC={AppendContinuationItemsAction:()=>wu(),OpenPopupAction:()=>bu(),AnalyticsMainAppKeyMetrics:()=>qu(),AnalyticsVideo:()=>Ga(),AnalyticsVodCarouselCard:()=>Iu(),Author:()=>Z(),BackstageImage:()=>Uu(),BackstagePost:()=>Ja(),BackstagePostThread:()=>Mu(),BrowseFeedActions:()=>Fu(),Button:()=>wi(),C4TabbedHeader:()=>Wu(),CallToActionButton:()=>Hu(),Card:()=>Qu(),CardCollection:()=>Xu(),Channel:()=>ju(),ChannelAboutFullMetadata:()=>eh(),ChannelFeaturedContent:()=>nh(),ChannelHeaderLinks:()=>sh(),ChannelMetadata:()=>oh(),ChannelMobileHeader:()=>ah(),ChannelThumbnailWithLink:()=>uh(),ChannelVideoPlayer:()=>dh(),ChildVideo:()=>mh(),ChipCloud:()=>_h(),ChipCloudChip:()=>wh(),CollageHeroImage:()=>bh(),AuthorCommentBadge:()=>Th(),Comment:()=>Eh(),CommentActionButtons:()=>Ih(),CommentReplies:()=>Rh(),CommentReplyDialog:()=>Ah(),CommentsEntryPointHeader:()=>Oh(),CommentsHeader:()=>Bh(),CommentSimplebox:()=>Fh(),CommentThread:()=>Wh(),CompactLink:()=>Hh(),CompactMix:()=>Jh(),CompactPlaylist:()=>Zh(),CompactVideo:()=>fh(),ContinuationItem:()=>td(),CtaGoToCreatorStudio:()=>id(),DataModelSection:()=>Wa(),DidYouMean:()=>rd(),DownloadButton:()=>cd(),Element:()=>ld(),EmergencyOnebox:()=>dd(),EmojiRun:()=>za(),Endscreen:()=>md(),EndscreenElement:()=>wd(),EndScreenPlaylist:()=>bd(),EndScreenVideo:()=>qd(),ExpandableTab:()=>Sd(),ExpandedShelfContents:()=>Cd(),FeedFilterChipBar:()=>kd(),FeedTabbedHeader:()=>Pd(),Format:()=>Ya(),Grid:()=>Nd(),GridChannel:()=>Dd(),GridPlaylist:()=>Fd(),GridVideo:()=>$d(),HistorySuggestion:()=>zd(),HorizontalCardList:()=>Qd(),HorizontalList:()=>Xd(),ItemSection:()=>fd(),ItemSectionHeader:()=>tp(),LikeButton:()=>ip(),LiveChat:()=>rp(),AddBannerToLiveChatCommand:()=>cp(),AddChatItemAction:()=>lp(),AddLiveChatTickerItemAction:()=>hp(),LiveChatBanner:()=>mp(),LiveChatBannerHeader:()=>_p(),LiveChatBannerPoll:()=>vp(),LiveChatMembershipItem:()=>Tp(),LiveChatPaidMessage:()=>Sp(),LiveChatPaidSticker:()=>kp(),LiveChatPlaceholderItem:()=>Pp(),LiveChatTextMessage:()=>gl(),LiveChatTickerPaidMessageItem:()=>Up(),LiveChatTickerSponsorItem:()=>Mp(),LiveChatViewerEngagementMessage:()=>Fp(),PollHeader:()=>Wp(),LiveChatActionPanel:()=>Hp(),MarkChatItemAsDeletedAction:()=>Kp(),MarkChatItemsByAuthorAsDeletedAction:()=>Jp(),RemoveBannerForLiveChatCommand:()=>Zp(),ReplaceChatItemAction:()=>fp(),ReplayChatItemAction:()=>tm(),ShowLiveChatActionPanelAction:()=>im(),ShowLiveChatTooltipCommand:()=>rm(),UpdateDateTextAction:()=>cm(),UpdateDescriptionAction:()=>lm(),UpdateLiveChatPollAction:()=>hm(),UpdateTitleAction:()=>pm(),UpdateToggleButtonTextAction:()=>_m(),UpdateViewershipAction:()=>vm(),LiveChatAuthorBadge:()=>Tm(),LiveChatHeader:()=>Em(),LiveChatItemList:()=>Im(),LiveChatMessageInput:()=>Rm(),LiveChatParticipant:()=>Lm(),LiveChatParticipantsList:()=>Am(),Menu:()=>Um(),MenuNavigationItem:()=>Bm(),MenuServiceItem:()=>Vm(),MenuServiceItemDownload:()=>Ym(),MultiPageMenu:()=>Gm(),MultiPageMenuNotificationSection:()=>zm(),SimpleMenuHeader:()=>Qm(),MerchandiseItem:()=>Xm(),MerchandiseShelf:()=>fm(),Message:()=>tg(),MetadataBadge:()=>yl(),MetadataRow:()=>sg(),MetadataRowContainer:()=>og(),MetadataRowHeader:()=>ag(),MicroformatData:()=>ug(),Mix:()=>dg(),Movie:()=>mg(),MovingThumbnail:()=>_g(),MusicCarouselShelf:()=>vg(),MusicCarouselShelfBasicHeader:()=>Tg(),MusicDescriptionShelf:()=>Sg(),MusicDetailHeader:()=>Rg(),MusicHeader:()=>Lg(),MusicImmersiveHeader:()=>Ng(),MusicInlineBadge:()=>Ug(),MusicItemThumbnailOverlay:()=>Bg(),MusicNavigationButton:()=>Vg(),MusicPlayButton:()=>Yg(),MusicPlaylistShelf:()=>Wg(),MusicQueue:()=>Hg(),MusicResponsiveListItem:()=>e_(),MusicResponsiveListItemFixedColumn:()=>n_(),MusicResponsiveListItemFlexColumn:()=>s_(),MusicShelf:()=>c_(),MusicThumbnail:()=>l_(),MusicTwoRowItem:()=>d_(),NavigatableText:()=>ui(),NavigationEndpoint:()=>A(),Notification:()=>y_(),PlayerAnnotationsExpanded:()=>v_(),PlayerCaptionsTracklist:()=>T_(),PlayerErrorMessage:()=>S_(),PlayerLiveStoryboardSpec:()=>C_(),PlayerMicroformat:()=>L_(),PlayerOverlay:()=>A_(),PlayerOverlayAutoplay:()=>O_(),PlayerStoryboardSpec:()=>D_(),Playlist:()=>ft(),PlaylistAuthor:()=>ut(),PlaylistHeader:()=>M_(),PlaylistInfoCardContent:()=>F_(),PlaylistMetadata:()=>$_(),PlaylistPanel:()=>G_(),PlaylistPanelVideo:()=>K_(),PlaylistSidebar:()=>J_(),PlaylistSidebarPrimaryInfo:()=>j_(),PlaylistSidebarSecondaryInfo:()=>ty(),PlaylistVideo:()=>sy(),PlaylistVideoList:()=>oy(),PlaylistVideoThumbnail:()=>ay(),Poll:()=>hy(),Post:()=>py(),ProfileColumn:()=>gy(),ProfileColumnStats:()=>yy(),ProfileColumnStatsEntry:()=>by(),ProfileColumnUserInfo:()=>Ty(),ReelItem:()=>Sy(),ReelShelf:()=>Cy(),RelatedChipCloud:()=>ky(),RichGrid:()=>Ay(),RichItem:()=>Oy(),RichListHeader:()=>Dy(),RichSection:()=>My(),RichShelf:()=>Fy(),SearchBox:()=>Wy(),SearchRefinementCard:()=>Hy(),SearchSuggestion:()=>ml(),SearchSuggestionsSection:()=>Ky(),SecondarySearchContainer:()=>Jy(),SectionList:()=>jy(),Shelf:()=>tw(),ShowingResultsFor:()=>sw(),SimpleCardTeaser:()=>ow(),SingleActionEmergencySupport:()=>aw(),SingleColumnBrowseResults:()=>uw(),SingleColumnMusicWatchNextResults:()=>dw(),SingleHeroImage:()=>mw(),SortFilterSubMenu:()=>_w(),SubFeedOption:()=>ww(),SubFeedSelector:()=>bw(),SubscribeButton:()=>Tw(),SubscriptionNotificationToggleButton:()=>Ew(),Tab:()=>Iw(),Tabbed:()=>Rw(),TabbedSearchResults:()=>Lw(),Text:()=>C(),TextHeader:()=>Aw(),TextRun:()=>Ha(),Thumbnail:()=>O(),ThumbnailOverlayBottomPanel:()=>Ow(),ThumbnailOverlayEndorsement:()=>Dw(),ThumbnailOverlayHoverText:()=>Mw(),ThumbnailOverlayInlineUnplayable:()=>Fw(),ThumbnailOverlayLoadingPreview:()=>$w(),ThumbnailOverlayNowPlaying:()=>Gw(),ThumbnailOverlayPinking:()=>zw(),ThumbnailOverlayPlaybackStatus:()=>Qw(),ThumbnailOverlayResumePlayback:()=>Xw(),ThumbnailOverlaySidePanel:()=>jw(),ThumbnailOverlayTimeStatus:()=>ev(),ThumbnailOverlayToggleButton:()=>iv(),ToggleButton:()=>rv(),ToggleMenuServiceItem:()=>av(),Tooltip:()=>uv(),TwoColumnBrowseResults:()=>Ll(),TwoColumnSearchResults:()=>gv(),TwoColumnWatchNextResults:()=>yv(),UniversalWatchCard:()=>vv(),VerticalList:()=>xv(),VerticalWatchCardList:()=>qv(),Video:()=>Sv(),VideoDetails:()=>$a(),VideoInfoCardContent:()=>Cv(),VideoOwner:()=>kv(),VideoPrimaryInfo:()=>Pv(),VideoSecondaryInfo:()=>Nv(),WatchCardCompactVideo:()=>Uv(),WatchCardHeroVideo:()=>Mv(),WatchCardRichHeader:()=>Yv(),WatchCardSectionSequence:()=>Wv(),WatchNextEndScreen:()=>Hv(),WatchNextTabbedResults:()=>Kv()};Qv.exports=n(function(e){let t=IC[e];if(!t){let i=new Error("Module not found: "+e);throw i.code="MODULE_NOT_FOUND",i}return t()},"req")});var E=g((yA,jv)=>{"use strict";var{InnertubeError:Xv,observe:Dl}=F(),CC=Ya(),RC=$a(),Zv=Jv(),Dc=class{type="appendContinuationItemsAction";constructor(e){this.contents=J.parse(e.continuationItems)}};n(Dc,"AppendContinuationItemsAction");var Bc=class{type="reloadContinuationItemsCommand";constructor(e){this.target_id=e.targetId,this.contents=J.parse(e.continuationItems)}};n(Bc,"ReloadContinuationItemsCommand");var Mc=class{type="sectionListContinuation";constructor(e){this.contents=J.parse(e.contents),this.continuation=e.continuations[0].nextContinuationData.continuation}};n(Mc,"SectionListContinuation");var cn=class{type="timedContinuationData";constructor(e){this.timeout_ms=e.timeoutMs||e.timeUntilLastMessageMsec,this.token=e.continuation}};n(cn,"TimedContinuation");var Vc=class{type="liveChatContinuation";constructor(e){var t,i,a,s,r;this.actions=J.parse((t=e.actions)==null?void 0:t.map(o=>(delete o.clickTrackingParams,o)))||[],this.action_panel=J.parse(e.actionPanel),this.item_list=J.parse(e.itemList),this.header=J.parse(e.header),this.participants_list=J.parse(e.participantsList),this.popout_message=J.parse(e.popoutMessage),this.emojis=((i=e.emojis)==null?void 0:i.map(o=>({emoji_id:o.emojiId,shortcuts:o.shortcuts,search_terms:o.searchTerms,image:o.image,is_custom_emoji:o.isCustomEmoji})))||null,this.continuation=new cn(((a=e.continuations)==null?void 0:a[0].timedContinuationData)||((s=e.continuations)==null?void 0:s[0].invalidationContinuationData)||((r=e.continuations)==null?void 0:r[0].liveChatReplayContinuationData)),this.viewer_name=e.viewerName}};n(Vc,"LiveChatContinuation");var ne,Ne,gt,Oe,_t,an,Bl,D=class{static parseResponse(e){var w,b;N(this,Oe,_t).call(this);let t=D.parse(e.contents),i=l(D,ne);N(this,Ne,gt).call(this),N(this,Oe,_t).call(this);let a=e.onResponseReceivedActions?D.parseRR(e.onResponseReceivedActions):null,s=l(D,ne);N(this,Ne,gt).call(this),N(this,Oe,_t).call(this);let r=e.onResponseReceivedEndpoints?D.parseRR(e.onResponseReceivedEndpoints):null,o=l(D,ne);N(this,Ne,gt).call(this),N(this,Oe,_t).call(this);let p=e.onResponseReceivedCommands?D.parseRR(e.onResponseReceivedCommands):null,h=l(D,ne);N(this,Ne,gt).call(this),N(this,Oe,_t).call(this);let u=e.actions?D.parseActions(e.actions):null,m=l(D,ne);return N(this,Ne,gt).call(this),{actions:u,actions_memo:m,contents:t,contents_memo:i,on_response_received_actions:a,on_response_received_actions_memo:s,on_response_received_endpoints:r,on_response_received_endpoints_memo:o,on_response_received_commands:p,on_response_received_commands_memo:h,continuation:e.continuation?D.parseC(e.continuation):null,continuation_contents:e.continuationContents?D.parseLC(e.continuationContents):null,metadata:D.parse(e.metadata),header:D.parse(e.header),microformat:e.microformat&&D.parse(e.microformat),sidebar:D.parse(e.sidebar),overlay:D.parse(e.overlay),refinements:e.refinements||null,estimated_results:e.estimatedResults||null,player_overlays:D.parse(e.playerOverlays),playability_status:e.playabilityStatus&&{status:e.playabilityStatus.status,error_screen:D.parse(e.playabilityStatus.errorScreen),embeddable:e.playabilityStatus.playableInEmbed||null,reason:e.reason||""},streaming_data:e.streamingData&&{expires:new Date(Date.now()+parseInt(e.streamingData.expiresInSeconds)*1e3),formats:D.parseFormats(e.streamingData.formats),adaptive_formats:D.parseFormats(e.streamingData.adaptiveFormats),dash_manifest_url:((w=e.streamingData)==null?void 0:w.dashManifestUrl)||null,dls_manifest_url:((b=e.streamingData)==null?void 0:b.dashManifestUrl)||null},captions:D.parse(e.captions),video_details:e.videoDetails&&new RC(e.videoDetails),annotations:D.parse(e.annotations),storyboards:D.parse(e.storyboards),endscreen:D.parse(e.endscreen),cards:D.parse(e.cards)}}static parseC(e){if(e.timedContinuationData)return new cn(e.timedContinuationData)}static parseLC(e){if(e.sectionListContinuation)return new Mc(e.sectionListContinuation);if(e.liveChatContinuation)return new Vc(e.liveChatContinuation)}static parseRR(e){return Dl(e.map(t=>{if(t.reloadContinuationItemsCommand)return new Bc(t.reloadContinuationItemsCommand);if(t.appendContinuationItemsAction)return new Dc(t.appendContinuationItemsAction)}).filter(t=>t))}static parseActions(e){return Array.isArray(e)?D.parse(e.map(t=>(delete t.clickTrackingParams,t))):D.parse(e)||null}static parseFormats(e){return Dl((e==null?void 0:e.map(t=>new CC(t)))||[])}static parse(e){if(!e)return null;if(Array.isArray(e)){let a=[];for(let s of e){let r=Object.keys(s),o=this.sanitizeClassName(r[0]);if(!this.shouldIgnore(o))try{let p=Zv(o),h=new p(s[r[0]]);a.push(h),N(this,an,Bl).call(this,o,h)}catch(p){this.formatError({classname:o,classdata:s[r[0]],err:p})}}return Dl(a)}let t=Object.keys(e),i=this.sanitizeClassName(t[0]);if(!this.shouldIgnore(i))try{let a=Zv(i),s=new a(e[t[0]]);return N(this,an,Bl).call(this,i,s),s}catch(a){return this.formatError({classname:i,classdata:e[t[0]],err:a}),null}}static formatError({classname:e,classdata:t,err:i}){if(i.code=="MODULE_NOT_FOUND")return console.warn(new Xv(`${e} not found!
This is a bug, please report it at ${An().bugs.url}`,t));console.warn(new Xv(`Something went wrong at ${e}!
This is a bug, please report it at ${An().bugs.url}`,{stack:i.stack}))}static sanitizeClassName(e){return(e.charAt(0).toUpperCase()+e.slice(1)).replace(/Renderer|Model/g,"").replace(/Radio/g,"Mix").trim()}static shouldIgnore(e){return["DisplayAd","SearchPyv","MealbarPromo","BackgroundPromo","PromotedSparklesWeb","RunAttestationCommand","StatementBanner"].includes(e)}},J=D;n(J,"Parser"),ne=new WeakMap,Ne=new WeakSet,gt=n(function(){I(D,ne,null)},"#clearMemo"),Oe=new WeakSet,_t=n(function(){I(D,ne,new Map)},"#createMemo"),an=new WeakSet,Bl=n(function(e,t){if(!!l(D,ne)){if(!l(D,ne).has(e))return l(D,ne).set(e,[t]);l(D,ne).get(e).push(t)}},"#addToMemo"),T(J,Ne),T(J,Oe),T(J,an),T(J,ne,new Map);jv.exports=J});var tb=g((wA,eb)=>{"use strict";var kC=require("uuid"),xe=ct(),X=F(),LC=ae(),PC=E(),j,W,Yc,fv,Fc=class{constructor(e){T(this,Yc);T(this,j,void 0);T(this,W,void 0);I(this,j,e),I(this,W,e.request)}async browse(e,t={}){if(N(this,Yc,fv).call(this,e)&&!l(this,j).logged_in)throw new X.InnertubeError("You are not signed in");let i={};return t.params&&(i.params=t.params),t.is_ctoken?i.continuation=e:i.browseId=e,t.client&&(i.client=t.client),await l(this,W).post("/browse",i)}async engage(e,t={}){if(!l(this,j).logged_in&&!t.hasOwnProperty("text"))throw new X.InnertubeError("You are not signed in");let i={};switch(e){case"like/like":case"like/dislike":case"like/removelike":i.target={},i.target.videoId=t.video_id,t.params&&(i.params=t.params);break;case"subscription/subscribe":case"subscription/unsubscribe":i.channelIds=[t.channel_id],i.params=e==="subscription/subscribe"?"EgIIAhgA":"CgIIAhgA";break;case"comment/create_comment":i.commentText=t.text,i.createCommentParams=xe.encodeCommentParams(t.video_id);break;case"comment/create_comment_reply":i.createReplyParams=xe.encodeCommentReplyParams(t.comment_id,t.video_id),i.commentText=t.text;break;case"comment/perform_comment_action":let s=(()=>{switch(t.comment_action){case"like":return xe.encodeCommentActionParams(5,t);case"dislike":return xe.encodeCommentActionParams(4,t);case"translate":return xe.encodeCommentActionParams(22,t);default:break}})();i.actions=[s];break;default:throw new X.InnertubeError("Action not implemented",e)}return await l(this,W).post(`/${e}`,i)}async account(e,t={}){if(!l(this,j).logged_in)throw new X.InnertubeError("You are not signed in");let i={client:t.client};switch(e){case"account/set_setting":i.newValue={boolValue:t.new_value},i.settingItemId=t.setting_item_id;break;case"account/accounts_list":break;default:throw new X.InnertubeError("Action not implemented",e)}return await l(this,W).post(`/${e}`,i)}async search(e={}){let t={client:e.client};return e.query&&(t.query=e.query),e.ctoken&&(t.continuation=e.ctoken),e.params&&(t.params=e.params),e.filters&&(e.client=="YTMUSIC"?t.params=xe.encodeMusicSearchFilters(e.filters):t.params=xe.encodeSearchFilters(e.filters)),await l(this,W).post("/search",t)}async searchSound(e={}){let t={query:e.query,client:"ANDROID"};return await l(this,W).post("/sfv/search",t)}async channel(e,t={}){if(!l(this,j).logged_in)throw new X.InnertubeError("You are not signed in");let i={client:t.client||"ANDROID"};switch(e){case"channel/edit_name":i.givenName=t.new_name;break;case"channel/edit_description":i.description=t.new_description;break;case"channel/get_profile_editor":break;default:throw new X.InnertubeError("Action not implemented",e)}return await l(this,W).post(`/${e}`,i)}async playlist(e,t={}){if(!l(this,j).logged_in)throw new X.InnertubeError("You are not signed in");let i={};switch(e){case"playlist/create":i.title=t.title,i.videoIds=t.ids;break;case"playlist/delete":i.playlistId=t.playlist_id;break;case"browse/edit_playlist":i.playlistId=t.playlist_id,i.actions=t.ids.map(s=>{switch(t.action){case"ACTION_ADD_VIDEO":return{action:t.action,addedVideoId:s};case"ACTION_REMOVE_VIDEO":return{action:t.action,setVideoId:s};default:break}});break;default:throw new X.InnertubeError("Action not implemented",e)}return await l(this,W).post(`/${e}`,i)}async notifications(e,t={}){if(!l(this,j).logged_in)throw new X.InnertubeError("You are not signed in");let i={};switch(e){case"modify_channel_preference":let s={PERSONALIZED:1,ALL:2,NONE:3};i.params=xe.encodeNotificationPref(t.channel_id,s[t.pref.toUpperCase()]);break;case"get_notification_menu":i.notificationsMenuRequestType="NOTIFICATIONS_MENU_REQUEST_TYPE_INBOX",t.ctoken&&(i.ctoken=t.ctoken);break;case"record_interactions":i.serializedRecordNotificationInteractionsRequest=t.params;break;case"get_unseen_count":break;default:throw new X.InnertubeError("Action not implemented",e)}return await l(this,W).post(`/notification/${e}`,i)}async livechat(e,t={}){let i={client:t.client};switch(e){case"live_chat/get_live_chat":case"live_chat/get_live_chat_replay":i.continuation=t.ctoken;break;case"live_chat/send_message":i.params=xe.encodeMessageParams(t.channel_id,t.video_id),i.clientMessageId=kC.v4(),i.richMessage={textSegments:[{text:t.text}]};break;case"live_chat/get_item_context_menu":break;case"live_chat/moderate":i.params=t.params;break;case"updated_metadata":i.videoId=t.video_id,t.ctoken&&(i.continuation=t.ctoken);break;default:throw new X.InnertubeError("Action not implemented",e)}return await l(this,W).post(`/${e}`,i)}async thumbnails(e={}){let t={client:"ANDROID",videoId:e.video_id};return await l(this,W).post("/thumbnails",t)}async geo(e,t={}){if(!l(this,j).logged_in)throw new X.InnertubeError("You are not signed in");let i={input:t.input,client:"ANDROID"};return await l(this,W).post(`/geo/${e}`,i)}async flag(e,t){if(!l(this,j).logged_in)throw new X.InnertubeError("You are not signed in");let i={};switch(e){case"flag/flag":i.action=t.action;break;case"flag/get_form":i.params=t.params;break;default:throw new X.InnertubeError("Action not implemented",e)}return await l(this,W).post(`/${e}`,i)}async music(e,t){let i={input:t.input||"",client:"YTMUSIC"};return await l(this,W).post(`/music/${e}`,i)}async next(e={}){let t={client:e.client};return e.ctoken&&(t.continuation=e.ctoken),e.video_id&&(t.videoId=e.video_id),await l(this,W).post("/next",t)}async getVideoInfo(e,t,i){let a={playbackContext:{contentPlaybackContext:{vis:0,splay:!1,referer:"https://www.youtube.com",currentUrl:`/watch?v=${e}`,autonavState:"STATE_OFF",signatureTimestamp:l(this,j).sts,autoCaptionsDefaultOn:!1,html5Preference:"HTML5_PREF_WANTS",lactMilliseconds:"-1"}},attestationRequest:{omitBotguardData:!0},videoId:e};return i&&(a.client=i),t&&(a.cpn=t),(await l(this,W).post("/player",a)).data}async getSearchSuggestions(e,t){if(!["YOUTUBE","YTMUSIC"].includes(e))throw new X.InnertubeError("Invalid client",e);return await{YOUTUBE:()=>l(this,W).call(this,{url:"search",baseURL:LC.URLS.YT_SUGGESTIONS,params:{q:t,ds:"yt",client:"youtube",xssi:"t",oe:"UTF",gl:l(this,j).context.client.gl,hl:l(this,j).context.client.hl}}),YTMUSIC:()=>this.music("get_search_suggestions",{input:t})}[e]()}async getUserMentionSuggestions(e={}){if(!l(this,j).logged_in)throw new X.InnertubeError("You are not signed in");let t={input:e.input,client:"ANDROID"};return await l(this,W).post("get_user_mention_suggestions",t)}async execute(e,t){let i={...t};Reflect.has(i,"parse")&&delete i.parse,Reflect.has(i,"request")&&delete i.request,Reflect.has(i,"clientActions")&&delete i.clientActions,Reflect.has(i,"action")&&(i.actions=[i.action],delete i.action),Reflect.has(i,"token")&&(i.continuation=i.token,delete i.token);let a=await l(this,W).post(e,i);return t.parse?PC.parseResponse(a.data):a}};n(Fc,"Actions"),j=new WeakMap,W=new WeakMap,Yc=new WeakSet,fv=n(function(e){return["FElibrary","FEhistory","FEsubscriptions","SPaccount_notifications","SPaccount_privacy","SPtime_watched"].includes(e)},"#needsLogin");eb.exports=Fc});var ib=g((vA,nb)=>{"use strict";var ln=require("fs"),$c=class{async read(e){return(await ln.promises.readFile(e)).buffer}async write(e,t){let i=e.split("/").slice(0,-1),a="";for(let s of i)a+=`${s}/`,await this.exists(a)||await ln.promises.mkdir(a);return await ln.promises.writeFile(e,t)}async exists(e){return await ln.promises.stat(e).then(()=>!0).catch(()=>!1)}async remove(e){return await ln.promises.rm(e)}};n($c,"NodeCache");nb.exports=new $c});var rb=g(Ml=>{"use strict";var{SIG_REGEX:sb}=ae(),yt=Ml.SignatureOperation={REVERSE:0,SPLICE:1,SWAP:2},ve=class{constructor(e){this.action_sequence=e}static fromSourceCode(e){let t,i=[],a=ve.getFunctions(e);for(;(t=sb.ACTIONS.exec(e))!==null;){let s=t.groups;if(!!s)switch(s.name){case a[0]:i.push([yt.REVERSE,0]);break;case a[1]:i.push([yt.SPLICE,parseInt(s.param)]);break;case a[2]:i.push([yt.SWAP,parseInt(s.param)]);break;default:}}return new ve(i)}decipher(e){var a;let i=(a=new URLSearchParams(e).get("s"))==null?void 0:a.split("");if(!i)throw new TypeError("Invalid signature");for(let s of this.action_sequence)switch(s[0]){case yt.REVERSE:i.reverse();break;case yt.SPLICE:i.splice(0,s[1]);break;case yt.SWAP:{let r=s[1],o=i[0];i[0]=i[r%i.length],i[r%i.length]=o}break;default:break}return i.join("")}toJSON(){return[...this.action_sequence]}toArrayBuffer(){let e=new ArrayBuffer(8+this.action_sequence.length*3),t=new DataView(e),i=0;t.setUint32(i,ve.LIBRARY_VERSION,!0),i+=4,t.setUint32(i,this.action_sequence.length,!0),i+=4;for(let a=0;a<this.action_sequence.length;a++)t.setUint8(i,this.action_sequence[a][0]),i+=1,t.setUint16(i,this.action_sequence[a][1],!0),i+=2;return e}static fromArrayBuffer(e){let t=new DataView(e),i=0,a=t.getUint32(i,!0);if(i+=4,a!==ve.LIBRARY_VERSION)throw new TypeError("Invalid library version");let s=t.getUint32(i,!0);i+=4;let r=new Array(s);for(let o=0;o<s;o++)r[o]=[t.getUint8(i),t.getUint16(i+1,!0)],i+=3;return new ve(r)}static getFunctions(e){let t,i=[];for(;(t=sb.FUNCTIONS.exec(e))!==null;)t[0].includes("reverse")?i[0]=t[1]:t[0].includes("splice")?i[1]=t[1]:i[2]=t[1];return i}static get LIBRARY_VERSION(){return 1}};n(ve,"Signature");Ml.default=ve});var ob=g(un=>{"use strict";var{NTOKEN_REGEX:Vl,BASE64_DIALECT:Wc}=ae(),V=un.NTokenTransformOperation={NO_OP:0,PUSH:1,REVERSE_1:2,REVERSE_2:3,SPLICE:4,SWAP0_1:5,SWAP0_2:6,ROTATE_1:7,ROTATE_2:8,BASE64_DIA:9,TRANSLATE_1:10,TRANSLATE_2:11},G=un.NTokenTransformOpType={FUNC:0,N_ARR:1,LITERAL:2,REF:3},AC={"d.push(e)":V.PUSH,"d.reverse()":V.REVERSE_1,"function(d){for(var":V.REVERSE_2,"d.length;d.splice(e,1)":V.SPLICE,"d[0])[0])":V.SWAP0_1,"f=d[0];d[0]":V.SWAP0_2,"reverse().forEach":V.ROTATE_1,"unshift(d.pop())":V.ROTATE_2,"function(){for(var":V.BASE64_DIA,"function(d,e){for(var f":V.TRANSLATE_1,"function(d,e,f){var":V.TRANSLATE_2},Y=class{static translate1(e,t,i){let a=i?Wc.REVERSE:Wc.NORMAL,s=t.split("");e.forEach((r,o,p)=>{s.push(p[o]=a[(a.indexOf(r)-a.indexOf(s[o])+64)%a.length])})}static translate2(e,t,i){let a=i.length,s=t.split("");e.forEach((r,o,p)=>{s.push(p[o]=i[(i.indexOf(r)-i.indexOf(s[o])+o+a--)%i.length])})}static getBase64Dia(e){return e?Wc.REVERSE:Wc.NORMAL}static swap0(e,t){let i=e[0];t=(t%e.length+e.length)%e.length,e[0]=e[t],e[t]=i}static rotate(e,t){t=(t%e.length+e.length)%e.length,e.splice(-t).reverse().forEach(i=>e.unshift(i))}static splice(e,t){t=(t%e.length+e.length)%e.length,e.splice(t,1)}static reverse(e){e.reverse()}static push(e,t){Array.isArray(e==null?void 0:e[0])?e.push([G.LITERAL,t]):e.push(t)}};n(Y,"NTokenTransforms");un.NTokenTransforms=Y;var NC=[{[V.PUSH]:Y.push,[V.SPLICE]:Y.splice,[V.SWAP0_1]:Y.swap0,[V.SWAP0_2]:Y.swap0,[V.ROTATE_1]:Y.rotate,[V.ROTATE_2]:Y.rotate,[V.REVERSE_1]:Y.reverse,[V.REVERSE_2]:Y.reverse,[V.BASE64_DIA]:()=>Y.getBase64Dia(!1),[V.TRANSLATE_1]:(...c)=>Y.translate1.apply(null,[...c,!1]),[V.TRANSLATE_2]:Y.translate2},{[V.PUSH]:Y.push,[V.SPLICE]:Y.splice,[V.SWAP0_1]:Y.swap0,[V.SWAP0_2]:Y.swap0,[V.ROTATE_1]:Y.rotate,[V.ROTATE_2]:Y.rotate,[V.REVERSE_1]:Y.reverse,[V.REVERSE_2]:Y.reverse,[V.BASE64_DIA]:()=>Y.getBase64Dia(!0),[V.TRANSLATE_1]:(...c)=>Y.translate1.apply(null,[...c,!0]),[V.TRANSLATE_2]:Y.translate2}],pe=class{constructor(e){this.transformer=e}static fromSourceCode(e){let i=pe.getTransformationData(e).map(r=>{var o;if(r!=null&&typeof r!="number"){let p=r.includes("case 65:"),h=AC[(o=pe.getFunc(r))==null?void 0:o[0]];h?r=[G.FUNC,h,0+p]:r=="b"?r=[G.N_ARR]:r=[G.LITERAL,r]}else r!=null&&(r=[G.LITERAL,r]);return r});[...e.matchAll(Vl.PLACEHOLDERS)].map(r=>parseInt(r[1])).forEach(r=>i[r]=[G.REF]);let s=[...e.replace(/\n/g,"").match(/try\{(.*?)\}catch/s)[1].matchAll(Vl.CALLS)].map(r=>[parseInt(r[1]),r[2].split(",").map(o=>{var p;return parseInt((p=o.match(/c\[(.*?)\]/))==null?void 0:p[1])})]);return new pe([i,s])}evaluate(e,t,i){switch(e[0]){case G.FUNC:return NC[e[2]][e[1]];case G.N_ARR:return t;case G.LITERAL:return e[1];case G.REF:return i[0]}}transform(e){let t=e.split(""),i=this.getTransformerClone();try{i[1].forEach(([a,s])=>{let r=s[2]&&this.evaluate(i[0][s[2]],t,i)();this.evaluate(i[0][a],t,i)(s[0]!==void 0&&this.evaluate(i[0][s[0]],t,i),s[1]!==void 0&&this.evaluate(i[0][s[1]],t,i),r)})}catch(a){return console.error(new Error(`Could not transform n-token, download may be throttled.
Original Token:${e}Error:
${a}`)),e}return t.join("")}getTransformerClone(){return[[...this.transformer[0]],[...this.transformer[1]]]}toJSON(){return this.getTransformerClone()}toArrayBuffer(){let e=12;for(let s of this.transformer[0])switch(s[0]){case G.FUNC:e+=2;break;case G.N_ARR:case G.REF:e+=1;break;case G.LITERAL:typeof s[1]=="string"&&(e+=1+4+new TextEncoder().encode(s[1]).byteLength),e+=4+1;break}for(let s of this.transformer[1])e+=2+s[1].length;let t=new ArrayBuffer(e),i=new DataView(t),a=0;i.setUint32(a,pe.LIBRARY_VERSION,!0),a+=4,i.setUint32(a,this.transformer[0].length,!0),a+=4,i.setUint32(a,this.transformer[1].length,!0),a+=4;for(let s of this.transformer[0])switch(s[0]){case G.FUNC:{let r=s[0]<<6|s[2];i.setUint8(a,r),a+=1,i.setUint8(a,s[1]),a+=1}break;case G.N_ARR:case G.REF:{let r=s[0]<<6;i.setUint8(a,r),a+=1}break;case G.LITERAL:{let r=typeof s[1]=="string"?1:0,o=s[0]<<6|r;if(i.setUint8(a,o),a+=1,r===0)i.setInt32(a,s[1],!0),a+=4;else{let p=new TextEncoder().encode(s[1]);i.setUint32(a,p.byteLength,!0),a+=4;for(let h=0;h<p.byteLength;h++)i.setUint8(a,p[h]),a+=1}}break}for(let s of this.transformer[1]){i.setUint8(a,s[0]),a+=1,i.setUint8(a,s[1].length),a+=1;for(let r of s[1])i.setUint8(a,r),a+=1}return t}static fromArrayBuffer(e){let t=new DataView(e),i=0,a=t.getUint32(i,!0);if(i+=4,a!==pe.LIBRARY_VERSION)throw new TypeError("Invalid library version");let s=t.getUint32(i,!0);i+=4;let r=t.getUint32(i,!0);i+=4;let o=new Array(s);for(let h=0;h<s;h++){let u=t.getUint8(i++),m=u>>6;switch(m){case G.FUNC:{let w=u&1,b=t.getUint8(i++);o[h]=[m,b,w]}break;case G.N_ARR:case G.REF:o[h]=[m];break;case G.LITERAL:if((u&1)===0){let b=t.getInt32(i,!0);i+=4,o[h]=[m,b]}else{let b=t.getUint32(i,!0);i+=4;let y=new Uint8Array(b);for(let _=0;_<b;_++)y[_]=t.getUint8(i++);o[h]=[m,new TextDecoder().decode(y)]}break;default:throw new Error("Invalid opcode")}}let p=new Array(r);for(let h=0;h<r;h++){let u=t.getUint8(i++),m=t.getUint8(i++),w=new Array(m);for(let b=0;b<m;b++)w[b]=t.getUint8(i++);p[h]=[u,w]}return new pe([o,p])}static get LIBRARY_VERSION(){return 1}static getFunc(e){return e.match(Vl.FUNCTIONS)}static getTransformationData(e){var i;let t=`[${(i=e.replace(/\n/g,"").match(/c=\[(.*?)\];c/s))==null?void 0:i[1]}]`;return JSON.parse(this.refineNTokenData(t))}static refineNTokenData(e){return e.replace(/function\(d,e\)/g,'"function(d,e)').replace(/function\(d\)/g,'"function(d)').replace(/function\(\)/g,'"function()').replace(/function\(d,e,f\)/g,'"function(d,e,f)').replace(/\[function\(d,e,f\)/g,'["function(d,e,f)').replace(/,b,/g,',"b",').replace(/,b/g,',"b"').replace(/b,/g,'"b",').replace(/b]/g,'"b"]').replace(/\[b/g,'["b"').replace(/}]/g,'"]').replace(/},/g,'}",').replace(/""/g,"").replace(/length]\)}"/g,"length])}")}};n(pe,"NToken");un.default=pe});var pb=g((TA,db)=>{"use strict";var hn=ib(),wt=F(),OC=ae(),{default:cb}=rb(),{default:ab}=ob(),dn,vt,bt,Qe,Je,Xe,Ze,je,Hc,lb,zc,ub,Kc,hb,Qc=class{constructor(e,t){T(this,Hc);T(this,zc);T(this,Kc);T(this,dn,void 0);T(this,vt,void 0);T(this,bt,void 0);T(this,Qe,void 0);T(this,Je,void 0);T(this,Xe,void 0);T(this,Ze,void 0);T(this,je,void 0);I(this,vt,e),I(this,dn,t),I(this,je,`${wt.getTmpdir()}/yt-cache`),I(this,bt,`${OC.URLS.YT_BASE}/s/player/${l(this,vt)}/player_ias.vflset/en_US/base.js`),I(this,Qe,`${l(this,je)}/${l(this,vt)}.bin`)}async init(){if(await this.isCached()){let a=await hn.read(l(this,Qe)),s=new DataView(a);if(s.getUint32(0,!0)==Qc.LIBRARY_VERSION){let o=s.getUint32(8,!0),p=a.slice(12,12+o),h=a.slice(12+o);return I(this,Je,ab.fromArrayBuffer(h)),I(this,Xe,cb.fromArrayBuffer(p)),I(this,Ze,s.getUint32(4,!0)),this}}let e=await l(this,dn).get(l(this,bt),{headers:{"content-type":"text/javascript"}});I(this,Ze,N(this,Hc,lb).call(this,e.data));let t=N(this,zc,ub).call(this,e.data),i=N(this,Kc,hb).call(this,e.data);I(this,Xe,cb.fromSourceCode(t)),I(this,Je,ab.fromSourceCode(i));try{await hn.exists(l(this,je))&&await hn.remove(l(this,je),{recursive:!0});let a=l(this,Je).toArrayBuffer(),s=l(this,Xe).toArrayBuffer(),r=new ArrayBuffer(12+s.byteLength+a.byteLength),o=new DataView(r);o.setUint32(0,Qc.LIBRARY_VERSION,!0),o.setUint32(4,l(this,Ze),!0),o.setUint32(8,s.byteLength,!0),new Uint8Array(r).set(new Uint8Array(s),12),new Uint8Array(r).set(new Uint8Array(a),12+s.byteLength),await hn.write(l(this,Qe),new Uint8Array(r))}finally{}return this}decipher(e,t,i){e=e||t||i,wt.throwIfMissing({url:e});let a=new URLSearchParams(e),s=new URL(a.get("url")||e);if(s.searchParams.set("ratebypass","yes"),t||i){let r=l(this,Xe).decipher(e);a.get("sp")?s.searchParams.set(a.get("sp"),r):s.searchParams.set("signature",r)}if(s.searchParams.get("n")){let r=l(this,Je).transform(s.searchParams.get("n"));s.searchParams.set("n",r)}return s.toString()}get url(){return l(this,bt)}get sts(){return l(this,Ze)}static get LIBRARY_VERSION(){return 1}async isCached(){return await hn.exists(l(this,Qe))}},Gc=Qc;n(Gc,"Player"),dn=new WeakMap,vt=new WeakMap,bt=new WeakMap,Qe=new WeakMap,Je=new WeakMap,Xe=new WeakMap,Ze=new WeakMap,je=new WeakMap,Hc=new WeakSet,lb=n(function(e){return parseInt(wt.getStringBetweenStrings(e,"signatureTimestamp:",","))},"#extractSigTimestamp"),zc=new WeakSet,ub=n(function(e){let t=wt.getStringBetweenStrings(e,"this.audioTracks};var","};"),i=wt.getStringBetweenStrings(e,'function(a){a=a.split("")','return a.join("")}');return t+i},"#extractSigDecipherSc"),Kc=new WeakSet,hb=n(function(e){return`var b=a.split("")${wt.getStringBetweenStrings(e,'b=a.split("")','}return b.join("")}')}} return b.join("");`},"#extractNTokenSc");db.exports=Gc});var vb=g((qA,wb)=>{"use strict";var UC=pb(),DC=ct(),mb=F(),Jc=ae(),BC=require("user-agents"),pn,fe,mn,xt,Tt,gn,_n,yn,wn,Zc,gb,jc,_b,fc,yb,Xc=class{constructor(e,t){T(this,Zc);T(this,jc);T(this,fc);T(this,pn,void 0);T(this,fe,void 0);T(this,mn,void 0);T(this,xt,void 0);T(this,Tt,void 0);T(this,gn,void 0);T(this,_n,void 0);T(this,yn,void 0);T(this,wn,void 0);I(this,pn,e),I(this,fe,t)}async build(){let e=await Promise.all([N(this,jc,_b).call(this),N(this,fc,yb).call(this)]),t=e[0][0][2];return I(this,mn,t[1]),I(this,gn,`v${t[0][0][6]}`),I(this,xt,Jc.CLIENTS.WEB.NAME),I(this,Tt,t[0][0][16]),I(this,_n,t[0][0][3]),I(this,wn,await new UC(e[1],l(this,fe)).init()),I(this,yn,N(this,Zc,gb).call(this)),this}get key(){return l(this,mn)}get context(){return l(this,yn)}get api_version(){return l(this,gn)}get client_version(){return l(this,Tt)}get client_name(){return l(this,xt)}get player(){return l(this,wn)}};n(Xc,"SessionBuilder"),pn=new WeakMap,fe=new WeakMap,mn=new WeakMap,xt=new WeakMap,Tt=new WeakMap,gn=new WeakMap,_n=new WeakMap,yn=new WeakMap,wn=new WeakMap,Zc=new WeakSet,gb=n(function(){let e=new BC({deviceCategory:"desktop"}),t=mb.generateRandomString(11),i=Math.floor(Date.now()/1e3),a=DC.encodeVisitorData(t,i);return{client:{hl:"en",gl:l(this,pn).gl||"US",remoteHost:l(this,_n),deviceMake:e.vendor,deviceModel:e.platform,visitorData:a,userAgent:e.toString(),clientName:l(this,xt),clientVersion:l(this,Tt),originalUrl:Jc.URLS.API.BASE},user:{lockedSafetyMode:!1},request:{useSsl:!0}}},"#buildContext"),jc=new WeakSet,_b=n(async function(){let e=await l(this,fe).get(`${Jc.URLS.YT_BASE}/sw.js_data`);return JSON.parse(e.data.replace(")]}'",""))},"#getYtConfig"),fc=new WeakSet,yb=n(async function(){let e=await l(this,fe).get(`${Jc.URLS.YT_BASE}/iframe_api`);return mb.getStringBetweenStrings(e.data,"player\\/","\\/")},"#getPlayerId");wb.exports=Xc});var xb=g((EA,bb)=>{"use strict";var MC=E(),qt,ea=class{constructor(e){T(this,qt,void 0);I(this,qt,MC.parseResponse(e)),this.sections=l(this,qt).contents_memo.get("Element")}get page(){return l(this,qt)}};n(ea,"Analytics"),qt=new WeakMap;bb.exports=ea});var qb=g((SA,Tb)=>{"use strict";var Et=F(),Ue=ae(),VC=xb(),FC=ct(),me,ge,Te,ta=class{constructor(e){T(this,ge);T(this,me,void 0);I(this,me,e),this.channel={editName:t=>l(this,me).channel("channel/edit_name",{new_name:t}),editDescription:t=>l(this,me).channel("channel/edit_description",{new_description:t}),getBasicAnalytics:()=>this.getAnalytics()},this.settings={notifications:{setSubscriptions:t=>N(this,ge,Te).call(this,Ue.ACCOUNT_SETTINGS.SUBSCRIPTIONS,"SPaccount_notifications",t),setRecommendedVideos:t=>N(this,ge,Te).call(this,Ue.ACCOUNT_SETTINGS.RECOMMENDED_VIDEOS,"SPaccount_notifications",t),setChannelActivity:t=>N(this,ge,Te).call(this,Ue.ACCOUNT_SETTINGS.CHANNEL_ACTIVITY,"SPaccount_notifications",t),setCommentReplies:t=>N(this,ge,Te).call(this,Ue.ACCOUNT_SETTINGS.COMMENT_REPLIES,"SPaccount_notifications",t),setMentions:t=>N(this,ge,Te).call(this,Ue.ACCOUNT_SETTINGS.USER_MENTION,"SPaccount_notifications",t),setSharedContent:t=>N(this,ge,Te).call(this,Ue.ACCOUNT_SETTINGS.SHARED_CONTENT,"SPaccount_notifications",t)},privacy:{setSubscriptionsPrivate:t=>N(this,ge,Te).call(this,Ue.ACCOUNT_SETTINGS.SUBSCRIPTIONS_PRIVACY,"SPaccount_privacy",t),setSavedPlaylistsPrivate:t=>N(this,ge,Te).call(this,Ue.ACCOUNT_SETTINGS.PLAYLISTS_PRIVACY,"SPaccount_privacy",t)}}}async getInfo(){let e=await l(this,me).account("account/accounts_list",{client:"ANDROID"}),t=Et.findNode(e.data,"contents","accountItem",8,!1),i=t.accountItem.serviceEndpoint.signInEndpoint.directSigninUserProfile,a=i.accountName,s=i.email,r=i.accountPhoto.thumbnails,o=t.accountItem.accountByline.runs.map(h=>h.text).join(""),p=e.data.contents[0].accountSectionListRenderer.footers[0].accountChannelRenderer.navigationEndpoint.browseEndpoint.browseId;return{name:a,email:s,channel_id:p,subscriber_count:o,photo:r}}async getTimeWatched(){let e=await l(this,me).browse("SPtime_watched",{client:"ANDROID"});return Et.findNode(e.data,"contents","statRowRenderer",11,!1).map(a=>{let s=a.statRowRenderer;if(s)return{title:s.title.runs.map(r=>r.text).join(""),time:s.contents.runs.map(r=>r.text).join("")}}).filter(a=>a)}async getAnalytics(){let e=await this.getInfo(),t=FC.encodeChannelAnalyticsParams(e.channel_id),i=await l(this,me).browse("FEanalytics_screen",{params:t,client:"ANDROID"});return new VC(i.data)}};n(ta,"AccountManager"),me=new WeakMap,ge=new WeakSet,Te=n(async function(e,t,i){Et.throwIfMissing({setting_id:e,type:t,new_value:i});let a={ON:!0,OFF:!1};if(!a.hasOwnProperty(i))throw new Et.InnertubeError("Invalid option",{option:i,available_options:Object.keys(a)});let s=await l(this,me).browse(t),p=(()=>{switch(t.trim()){case"SPaccount_notifications":return Et.findNode(s.data,"contents","Your preferences",13,!1).options;case"SPaccount_privacy":return Et.findNode(s.data,"contents","settingsSwitchRenderer",13,!1).options;default:throw new TypeError("undefined is not a function")}})().find(u=>u.settingsSwitchRenderer.enableServiceEndpoint.setSettingEndpoint.settingItemIdForClient==e).settingsSwitchRenderer.enableServiceEndpoint.setSettingEndpoint.settingItemId;return await l(this,me).account("account/set_setting",{new_value:t=="SPaccount_privacy"?!a[i]:a[i],setting_item_id:p})},"#setSetting");Tb.exports=ta});var De=g((IA,Sb)=>{"use strict";var YC=E(),{InnertubeError:Eb}=F(),ie,qe,St,K,vn=class{constructor(e,t,i=!1){T(this,ie,void 0);T(this,qe,void 0);T(this,St,void 0);T(this,K,void 0);t.on_response_received_actions||t.on_response_received_endpoints||i?I(this,ie,t):I(this,ie,YC.parseResponse(t)),I(this,K,l(this,ie).on_response_received_commands?l(this,ie).on_response_received_commands_memo:l(this,ie).on_response_received_endpoints?l(this,ie).on_response_received_endpoints_memo:l(this,ie).contents?l(this,ie).contents_memo:l(this,ie).on_response_received_actions?l(this,ie).on_response_received_actions_memo:[]),I(this,St,e)}static getVideosFromMemo(e){let t=e.get("Video")||[],i=e.get("GridVideo")||[],a=e.get("CompactVideo")||[],s=e.get("PlaylistVideo")||[],r=e.get("PlaylistPanelVideo")||[],o=e.get("WatchCardCompactVideo")||[];return[...t,...i,...a,...s,...r,...o]}static getPlaylistsFromMemo(e){let t=e.get("Playlist")||[],i=e.get("GridPlaylist")||[];return[...t,...i]}get videos(){return vn.getVideosFromMemo(l(this,K))}get posts(){return l(this,K).get("BackstagePost")||l(this,K).get("Post")||[]}get channels(){let e=l(this,K).get("Channel")||[],t=l(this,K).get("GridChannel")||[];return[...e,...t]}get playlists(){return vn.getPlaylistsFromMemo(l(this,K))}get memo(){return l(this,K)}get contents(){var a,s,r,o;let e=(s=(a=l(this,K).get("Tab"))==null?void 0:a[0])==null?void 0:s.content,t=(r=l(this,K).get("reloadContinuationItemsCommand"))==null?void 0:r[0],i=(o=l(this,K).get("appendContinuationItemsAction"))==null?void 0:o[0];return e||t||i}get shelves(){let e=l(this,K).get("Shelf")||[],t=l(this,K).get("RichShelf")||[],i=l(this,K).get("ReelShelf")||[];return[...e,...t,...i]}getShelf(e){return this.shelves.find(t=>t.title.toString()===e)}get secondary_contents(){var e;return(e=this.page.contents)==null?void 0:e.secondary_contents}get actions(){return l(this,St)}get page(){return l(this,ie)}get has_continuation(){return(l(this,K).get("ContinuationItem")||[]).length>0}async getContinuationData(){if(l(this,qe)){if(l(this,qe).length>1)throw new Eb("There are too many continuations, you'll need to find the correct one yourself in this.page");if(l(this,qe).length===0)throw new Eb("There are no continuations");return await l(this,qe)[0].endpoint.call(l(this,St))}return I(this,qe,l(this,K).get("ContinuationItem")),l(this,qe)?this.getContinuationData():null}async getContinuation(){let e=await this.getContinuationData();return new vn(this.actions,e,!0)}},na=vn;n(na,"Feed"),ie=new WeakMap,qe=new WeakMap,St=new WeakMap,K=new WeakMap;Sb.exports=na});var ra=g((CA,Ib)=>{"use strict";var $C=De(),It,sa,ia=class extends $C{constructor(t,i,a=!1){super(t,i,a);T(this,It);let s=this.page.sidebar.contents.get({type:"PlaylistSidebarPrimaryInfo"}),r=this.page.sidebar.contents.get({type:"PlaylistSidebarSecondaryInfo"});this.info={...this.page.metadata,author:r.owner.author,thumbnails:s.thumbnail_renderer.thumbnail,total_items:N(this,It,sa).call(this,0,s),views:N(this,It,sa).call(this,1,s),last_updated:N(this,It,sa).call(this,2,s),can_share:this.page.header.can_share,can_delete:this.page.header.can_delete,is_editable:this.page.header.is_editable,privacy:this.page.header.privacy},this.menu=s.menu,this.endpoint=s.endpoint}get items(){return this.videos}};n(ia,"Playlist"),It=new WeakSet,sa=n(function(t,i){var a;return!i||!i.stats?"N/A":((a=i.stats[t])==null?void 0:a.toString())||"N/A"},"#getStat");Ib.exports=ia});var kb=g((RA,Rb)=>{"use strict";var Cb=ra(),{InnertubeError:Fl,throwIfMissing:bn}=F(),re,oa=class{constructor(e){T(this,re,void 0);I(this,re,e)}async create(e,t){bn({title:e,video_ids:t});let i={title:e,videoIds:t},a=await l(this,re).execute("/playlist/create",{...i,parse:!1});return{playlist_id:a.data.playlistId,data:a.data}}async delete(e){bn({playlist_id:e});let t=await l(this,re).execute("playlist/delete",{playlistId:e});return{playlist_id:e,data:t.data}}async addVideos(e,t){bn({playlist_id:e,video_ids:t});let i={playlistId:e,actions:[]};i.actions=t.map(s=>({action:"ACTION_ADD_VIDEO",addedVideoId:s}));let a=await l(this,re).execute("/browse/edit_playlist",{...i,parse:!1});return{playlist_id:e,action_result:a.data.actions}}async removeVideos(e,t){bn({playlist_id:e,video_ids:t});let i=await l(this,re).execute("/browse",{browseId:`VL${e}`,parse:!0}),a=new Cb(l(this,re),i,!0);if(!a.info.is_editable)throw new Fl("This playlist cannot be edited.",e);let s={playlistId:e,actions:[]},r=n(async p=>{if(p.videos.filter(u=>t.includes(u.id)).forEach(u=>s.actions.push({action:"ACTION_REMOVE_VIDEO",setVideoId:u.set_video_id})),s.actions.length<t.length){let u=await p.getContinuation();return r(u)}},"getSetVideoIds");if(await r(a),!s.actions.length)throw new Fl("Given video ids were not found in this playlist.",t);let o=await l(this,re).execute("/browse/edit_playlist",{...s,parse:!1});return{playlist_id:e,action_result:o.data.actions}}async moveVideo(e,t,i){bn({playlist_id:e,moved_video_id:t,predecessor_video_id:i});let a=await l(this,re).execute("/browse",{browseId:`VL${e}`,parse:!0}),s=new Cb(l(this,re),a,!0);if(!s.info.is_editable)throw new Fl("This playlist cannot be edited.",e);let r={playlistId:e,actions:[]},o,p,h=n(async m=>{let w=m.videos.find(y=>t===y.id),b=m.videos.find(y=>i===y.id);if(o=o||(w==null?void 0:w.set_video_id),p=p||(b==null?void 0:b.set_video_id),!o||!p){let y=await m.getContinuation();return h(y)}},"getSetVideoIds");await h(s),r.actions.push({action:"ACTION_MOVE_VIDEO_AFTER",setVideoId:o,movedSetVideoIdPredecessor:p});let u=await l(this,re).execute("/browse/edit_playlist",{...r,parse:!1});return{playlist_id:e,action_result:u.data.actions}}};n(oa,"PlaylistManager"),re=new WeakMap;Rb.exports=oa});var Pb=g((kA,Lb)=>{"use strict";var Ee=F(),_e,ca=class{constructor(e){T(this,_e,void 0);I(this,_e,e)}async like(e){return Ee.throwIfMissing({video_id:e}),await l(this,_e).engage("like/like",{video_id:e})}async dislike(e){return Ee.throwIfMissing({video_id:e}),await l(this,_e).engage("like/dislike",{video_id:e})}async removeLike(e){return Ee.throwIfMissing({video_id:e}),await this.actions.engage("like/removelike",{video_id:e})}async subscribe(e){return Ee.throwIfMissing({channel_id:e}),await l(this,_e).engage("subscription/subscribe",{channel_id:e})}async unsubscribe(e){return Ee.throwIfMissing({channel_id:e}),await l(this,_e).engage("subscription/unsubscribe",{channel_id:e})}async comment(e,t){return Ee.throwIfMissing({video_id:e,text:t}),await l(this,_e).engage("comment/create_comment",{video_id:e,text:t})}async translate(e,t,i={}){Ee.throwIfMissing({text:e,target_language:t});let a=await await l(this,_e).engage("comment/perform_comment_action",{video_id:i.video_id,comment_id:i.comment_id,target_language:t,comment_action:"translate",text:e}),s=Ee.findNode(a.data,"frameworkUpdates","content",7,!1);return{success:a.success,status_code:a.status_code,translated_content:s.content,data:a.data}}async setNotificationPreferences(e,t){return Ee.throwIfMissing({channel_id:e,type:t}),await l(this,_e).notifications("modify_channel_preference",{channel_id:e,pref:t||"NONE"})}};n(ca,"InteractionManager"),_e=new WeakMap;Lb.exports=ca});var Ob=g((LA,Nb)=>{"use strict";var WC=De(),{InnertubeError:Ab}=F(),et=class extends WC{constructor(e,t,i=!1){var p,h,u;super(e,t,i);let a=((p=this.page.contents)==null?void 0:p.primary_contents.contents)||this.page.on_response_received_commands[0].contents,s=(u=(h=this.page.contents)==null?void 0:h.secondary_contents)==null?void 0:u.contents;this.results=a.get({type:"ItemSection"}).contents;let r=this.results.get({type:"HorizontalCardList"},!0),o=s==null?void 0:s.get({type:"UniversalWatchCard"});this.refinements=this.page.refinements||[],this.estimated_results=this.page.estimated_results,this.watch_card={header:(o==null?void 0:o.header)||null,call_to_action:(o==null?void 0:o.call_to_action)||null,sections:(o==null?void 0:o.sections)||[]},this.refinement_cards={header:(r==null?void 0:r.header)||null,cards:(r==null?void 0:r.cards)||[]}}async selectRefinementCard(e){let t;if(typeof e=="string"){if(t=this.refinement_cards.cards.get({query:e}),!t)throw new Ab("Refinement card not found!",{available_cards:this.refinement_card_queries})}else if(e.type==="SearchRefinementCard")t=e;else throw new Ab("Invalid refinement card!");let i=await t.endpoint.call(this.actions);return new et(this.actions,i,!0)}get refinement_card_queries(){return this.refinement_cards.cards.map(e=>e.query)}async getContinuation(){let e=await this.getContinuationData();return new et(this.actions,e,!0)}};n(et,"Search");Nb.exports=et});var Mb=g((PA,Bb)=>{"use strict";var Yl=E(),GC=require("events"),tt,Se,Ct,Rt,xn,Tn,qn,$l,la,Ub,En,Wl,ua,Db,aa=class{constructor(e){T(this,qn);T(this,la);T(this,En);T(this,ua);f(this,"ev");T(this,tt,void 0);T(this,Se,void 0);T(this,Ct,void 0);T(this,Rt,void 0);T(this,xn,1e3);T(this,Tn,5e3);f(this,"initial_info");f(this,"live_metadata");f(this,"running",!1);f(this,"is_replay",!1);I(this,Se,e),I(this,tt,e.actions),I(this,Ct,l(this,Se).livechat.continuation),this.is_replay=l(this,Se).livechat.is_replay,this.live_metadata={title:null,description:null,views:null,likes:null,date:null},this.ev=new GC}start(){this.running||(this.running=!0,N(this,qn,$l).call(this),N(this,En,Wl).call(this))}stop(){this.running=!1}async sendMessage(e){let t=await l(this,tt).livechat("live_chat/send_message",{text:e,video_id:l(this,Se).basic_info.id,channel_id:l(this,Se).basic_info.channel_id});return Yl.parseResponse(t.data).actions}};n(aa,"LiveChat"),tt=new WeakMap,Se=new WeakMap,Ct=new WeakMap,Rt=new WeakMap,xn=new WeakMap,Tn=new WeakMap,qn=new WeakSet,$l=n(function(){let e=setTimeout(()=>{(async()=>{let t=this.is_replay?"live_chat/get_live_chat_replay":"live_chat/get_live_chat",i=await l(this,tt).livechat(t,{ctoken:l(this,Ct)}),s=Yl.parseResponse(i.data).continuation_contents;I(this,Ct,s.continuation.token),I(this,xn,s.continuation.timeout_ms),s.header?(this.initial_info=s,this.ev.emit("start",s)):await N(this,la,Ub).call(this,s.actions),clearTimeout(e),this.running&&N(this,qn,$l).call(this)})().catch(t=>Promise.reject(t))},l(this,xn))},"#pollLivechat"),la=new WeakSet,Ub=n(async function(e){let i=e.length<125?1:0,a=i==1?(i=1e4/e.length,i*=Math.random()+.5,i=Math.min(1e3,i),i=Math.max(80,i)):i=80;for(let s of e)await N(this,ua,Db).call(this,a),this.ev.emit("chat-update",s)},"#emitSmoothedActions"),En=new WeakSet,Wl=n(function(){let e=setTimeout(()=>{(async()=>{var s,r,o,p,h;let t={video_id:l(this,Se).basic_info.id};l(this,Rt)&&(t.ctoken=l(this,Rt));let i=await l(this,tt).livechat("updated_metadata",t),a=Yl.parseResponse(i.data);I(this,Rt,a.continuation.token),I(this,Tn,a.continuation.timeout_ms),this.metadata={title:a.actions.get({type:"UpdateTitleAction"})||((s=this.metadata)==null?void 0:s.title),description:a.actions.get({type:"UpdateDescriptionAction"})||((r=this.metadata)==null?void 0:r.description),views:a.actions.get({type:"UpdateViewershipAction"})||((o=this.metadata)==null?void 0:o.views),likes:a.actions.get({type:"UpdateToggleButtonTextAction"})||((p=this.metadata)==null?void 0:p.likes),date:a.actions.get({type:"UpdateDateTextAction"})||((h=this.metadata)==null?void 0:h.date)},this.ev.emit("metadata-update",this.metadata),clearTimeout(e),this.running&&N(this,En,Wl).call(this)})().catch(t=>Promise.reject(t))},l(this,Tn))},"#pollMetadata"),ua=new WeakSet,Db=n(async function(e){return new Promise(t=>setTimeout(()=>t(),e))},"#wait");Bb.exports=aa});var Gb=g((AA,Wb)=>{"use strict";var{InnertubeError:oe}=F(),{PassThrough:HC,Readable:Vb}=require("stream"),Gl=require("axios"),Fb=E(),zC=Mb(),Yb=ae(),$b=Gl.CancelToken,Sn,be,In,kt,Lt,ha=class{constructor(e,t,i,a){T(this,Sn,void 0);T(this,be,void 0);T(this,In,void 0);T(this,kt,void 0);T(this,Lt,void 0);var h,u,m,w,b,y;I(this,be,t),I(this,In,i),I(this,kt,a);let s=Fb.parseResponse(e[0]),r=Fb.parseResponse(e[1].data||{});if(I(this,Sn,[s,r]),s.playability_status.status==="ERROR")throw new oe("This video is unavailable",s.playability_status);this.basic_info={...s.video_details,embed:s.microformat.embed,channel:s.microformat.channel,is_unlisted:s.microformat.is_unlisted,is_family_safe:s.microformat.is_family_safe,has_ypc_metadata:s.microformat.has_ypc_metadata},this.streaming_data=s.streaming_data||null,this.playability_status=s.playability_status,this.annotations=s.annotations,this.storyboards=s.storyboards,this.endscreen=s.endscreen,this.captions=s.captions,this.cards=s.cards;let o=(h=r.contents)==null?void 0:h.results,p=(u=r.contents)==null?void 0:u.secondary_results;if(o&&p){this.primary_info=o.get({type:"VideoPrimaryInfo"}),this.secondary_info=o.get({type:"VideoSecondaryInfo"}),this.merchandise=(o==null?void 0:o.get({type:"MerchandiseShelf"}))||null,this.related_chip_cloud=(m=p==null?void 0:p.get({type:"RelatedChipCloud"}))==null?void 0:m.content,this.watch_next_feed=(w=p==null?void 0:p.get({type:"ItemSection"}))==null?void 0:w.contents,I(this,Lt,(b=this.watch_next_feed)==null?void 0:b.pop()),this.player_overlays=r.player_overlays,this.basic_info.like_count=this.primary_info.menu.top_level_buttons.get({icon_type:"LIKE"}).like_count,this.basic_info.is_liked=this.primary_info.menu.top_level_buttons.get({icon_type:"LIKE"}).is_toggled,this.basic_info.is_disliked=this.primary_info.menu.top_level_buttons.get({icon_type:"DISLIKE"}).is_toggled;let _=o.get({target_id:"comments-entry-point"});this.comments_entry_point_header=(_==null?void 0:_.contents.get({type:"CommentsEntryPointHeader"}))||null,this.livechat=((y=r.contents_memo.get("LiveChat"))==null?void 0:y[0])||null}}async selectFilter(e){if(!this.filters.includes(e))throw new oe("Invalid filter",{available_filters:this.filters});let t=this.related_chip_cloud.chips.get({text:e});if(t.is_selected)return this;let a=(await t.endpoint.call(l(this,be))).on_response_received_endpoints.get({target_id:"watch-next-feed"});return this.watch_next_feed=a.contents,this}async getWatchNextContinuation(){let t=(await l(this,Lt).endpoint.call(l(this,be))).on_response_received_endpoints.get({type:"appendContinuationItemsAction"});return this.watch_next_feed=t.contents,I(this,Lt,this.watch_next_feed.pop()),this.watch_next_feed}async like(){let e=this.primary_info.menu.top_level_buttons.get({button_id:"TOGGLE_BUTTON_ID_TYPE_LIKE"});if(e.is_toggled)throw new oe("This video is already liked",{video_id:this.basic_info.id});return await e.endpoint.call(l(this,be))}async dislike(){let e=this.primary_info.menu.top_level_buttons.get({button_id:"TOGGLE_BUTTON_ID_TYPE_DISLIKE"});if(e.is_toggled)throw new oe("This video is already disliked",{video_id:this.basic_info.id});return await e.endpoint.call(l(this,be))}async removeLike(){let e=this.primary_info.menu.top_level_buttons.get({is_toggled:!0});if(!e)throw new oe("This video is not liked/disliked",{video_id:this.basic_info.id});return await e.toggled_endpoint.call(l(this,be))}async getLiveChat(e){if(!this.livechat)throw new oe("Live Chat is not available",{video_id:this.id});return new zC(this,e)}get filters(){var e;return((e=this.related_chip_cloud)==null?void 0:e.chips.map(t=>t.text.toString()))||[]}get actions(){return l(this,be)}get page(){return l(this,Sn)}get music_tracks(){let e=this.secondary_info.metadata;if(!e)return[];let t=[],i={},a=!1;for(let s=0;s<e.rows.length;s++){let r=e.rows[s];if(r.type==="MetadataRowHeader"){r.content.toString().toLowerCase().startsWith("music")&&(a=!0,s++);continue}!a||(i[r.title.toString().toLowerCase().replace(/ /g,"_")]=r.contents,r.has_divider_line&&(t.push(i),i={}))}return a&&t.push(i),t}chooseFormat(e){let t=[...this.streaming_data.formats||[],...this.streaming_data.adaptive_formats||[]],i=e.type.includes("audio"),a=e.type.includes("video"),s=-1,r=["best","bestefficiency"].includes(e.quality),o=e.quality!=="best",p=t.filter(h=>i&&!h.has_audio||a&&!h.has_video||e.format!=="any"&&!h.mime_type.includes(e.format)||!r&&h.quality_label!==e.quality?!1:(s<h.width&&(s=h.width),!0));if(p.length===0)throw new oe("No matching formats found",{options:e});if(r&&a&&(p=p.filter(h=>h.width===s)),i&&!a){let h=p.filter(u=>!u.has_video);h.length>0&&(p=h)}return o?p.sort((h,u)=>h.bitrate-u.bitrate):p.sort((h,u)=>u.bitrate-h.bitrate),p[0]}download(e={},t){let i=t||new HC,a,s=!1;return(async()=>{if(this.playability_status==="UNPLAYABLE")return i.emit("error",new oe("Video is unplayable",{video:this,error_type:"UNPLAYABLE"}));if(this.playability_status==="LOGIN_REQUIRED")return i.emit("error",new oe("Video is login required",{video:this,error_type:"LOGIN_REQUIRED"}));if(!this.streaming_data)return i.emit("error",new oe("Streaming data not available.",{video:this,error_type:"NO_STREAMING_DATA"}));let r={quality:"360p",type:"videoandaudio",format:"mp4",range:void 0,...e},o=this.chooseFormat(r),p=o.decipher(l(this,In));if(r.type==="videoandaudio"&&!e.range){let h=await Gl.get(`${p}&cpn=${l(this,kt)}`,{responseType:"stream",cancelToken:new $b(n(function(w){a=w},"executor")),headers:Yb.STREAM_HEADERS}).catch(m=>m);if(h instanceof Error)return i.emit("error",new oe(h.message,{type:"REQUEST_FAILED"})),i;i.emit("start");let u=0;if(typeof h.data=="object")h.data.on("data",m=>{u+=m.length;let w=(h.headers["content-length"]/1024/1024).toFixed(2),b=Math.floor(u/h.headers["content-length"]*100);i.emit("progress",{size:w,percentage:b,chunk_size:m.length,downloaded_size:(u/1024/1024).toFixed(2),raw_data:{chunk_size:m.length,downloaded:u,size:h.headers["content-length"]}})}),h.data.on("error",m=>{s&&i.emit("error",new oe("The download was cancelled.",{type:"DOWNLOAD_CANCELLED"}))||i.emit("error",new oe(m.message,{type:"DOWNLOAD_ABORTED"}))}),h.data.pipe(i,{end:!0});else{let m=new Vb;m.push(h.data),m.pipe(i,{end:!0})}}else{let u=e.range?e.range.start:0,m=e.range?e.range.end:10485760,w=0,b=!1;i.emit("start");let y=n(async()=>{(m>=o.content_length||e.range)&&(b=!0),e.range&&(o.content_length=e.range.end);let _=await Gl.get(`${p}&cpn=${l(this,kt)}&range=${u}-${m||""}`,{responseType:"stream",cancelToken:new $b(n(function(R){a=R},"executor")),headers:Yb.STREAM_HEADERS}).catch(q=>q);if(_ instanceof Error)return i.emit("error",{message:_.message,type:"REQUEST_FAILED"}),i;if(typeof _.data=="object")_.data.on("data",q=>{w+=q.length;let R=(_.headers["content-length"]/1024/1024).toFixed(2),L=Math.floor(w/_.headers["content-length"]*100);i.emit("progress",{size:R,percentage:L,chunk_size:q.length,downloaded_size:(w/1024/1024).toFixed(2),raw_data:{chunk_size:q.length,downloaded:w,size:_.headers["content-length"]}})}),_.data.on("error",q=>{s&&i.emit("error",{message:"The download was cancelled.",type:"DOWNLOAD_CANCELLED"})||i.emit("error",{message:q.message,type:"DOWNLOAD_ABORTED"})}),_.data.on("end",()=>{!b&&!e.range&&(u=m+1,m+=10485760,y())}),_.data.pipe(i,{end:b});else{let q=new Vb;q.push(_.data),q.pipe(i,{end:b})}},"downloadChunk");y()}})().catch(r=>{i.emit("error",r)}),i.cancel=()=>{s=!0,a&&a()},i}};n(ha,"VideoInfo"),Sn=new WeakMap,be=new WeakMap,In=new WeakMap,kt=new WeakMap,Lt=new WeakMap;Wb.exports=ha});var zl=g((NA,Hb)=>{"use strict";var{InnertubeError:KC}=F(),QC=De(),Pt,At,Hl=class extends QC{constructor(t,i,a=!1){super(t,i,a);T(this,Pt,void 0);T(this,At,void 0);I(this,At,t),I(this,Pt,this.page.contents_memo.get("Tab"))}get tabs(){return l(this,Pt).map(t=>t.title.toString())}async getTab(t){let i=l(this,Pt).find(s=>s.title.toLowerCase()===t.toLowerCase());if(!i)throw new KC(`Tab "${t}" not found`);if(i.selected)return this;let a=await i.endpoint.call(l(this,At));return new Hl(l(this,At),a,!0)}get title(){var t,i;return(i=(t=this.page.contents_memo("Tab"))==null?void 0:t.find(a=>a.selected))==null?void 0:i.title.toString()}},da=Hl;n(da,"TabbedFeed"),Pt=new WeakMap,At=new WeakMap;Hb.exports=da});var Kb=g((OA,zb)=>{"use strict";var JC=zl(),Kl,nt=class extends JC{constructor(t,i,a=!1){super(t,i,a);T(this,Kl,void 0);this.header={author:this.page.header.author,subscribers:this.page.header.subscribers.toString(),banner:this.page.header.banner,tv_banner:this.page.header.tv_banner,mobile_banner:this.page.header.mobile_banner,header_links:this.page.header.header_links},this.metadata={...this.page.metadata,...this.page.microformat},this.sponsor_button=this.page.header.sponsor_button||null,this.subscribe_button=this.page.header.subscribe_button||null;let s=this.page.contents.tabs.get({selected:!0});this.current_tab=s}async getVideos(){let t=await this.getTab("Videos");return new nt(this.actions,t.page,!0)}async getPlaylists(){let t=await this.getTab("Playlists");return new nt(this.actions,t.page,!0)}async getHome(){let t=await this.getTab("Home");return new nt(this.actions,t.page,!0)}async getCommunity(){let t=await this.getTab("Community");return new nt(this.actions,t.page,!0)}async getChannels(){let t=await this.getTab("Channels");return new nt(this.actions,t.page,!0)}async getAbout(){var i;return(i=(await this.getTab("About")).memo.get("ChannelAboutFullMetadata"))==null?void 0:i[0]}},pa=nt;n(pa,"Channel"),Kl=new WeakMap;zb.exports=pa});var Ql=g((UA,Qb)=>{"use strict";var XC=De(),Nt=class extends XC{constructor(e,t,i=!1){var a;super(e,t,i),this.sections=this.memo.get("ItemSection"),this.feed_actions=((a=this.memo.get("BrowseFeedActions"))==null?void 0:a[0])||[]}async getContinuation(){let e=await this.getContinuationData();return new Nt(this.actions,e,!0)}};n(Nt,"History");Qb.exports=Nt});var Zb=g((DA,Xb)=>{"use strict";var ZC=E(),jC=Ql(),fC=ra(),eR=De(),{observe:tR}=F(),Be,Me,ga,Jb,ma=class{constructor(e,t){T(this,ga);T(this,Be,void 0);T(this,Me,void 0);I(this,Be,t),I(this,Me,ZC.parseResponse(e));let a=l(this,Me).contents.tabs.get({selected:!0}).content.contents.map(o=>o.contents[0]),s=l(this,Me).contents.secondary_contents.items.get({type:"ProfileColumnStats"}).items,r=l(this,Me).contents.secondary_contents.items.get({type:"ProfileColumnUserInfo"});this.profile={stats:s,user_info:r},this.sections=tR(a.map(o=>({type:o.icon_type,title:o.title,contents:o.content.items,getAll:()=>N(this,ga,Jb).call(this,o)})))}get history(){return this.sections.get({type:"WATCH_HISTORY"})}get watch_later(){return this.sections.get({type:"WATCH_LATER"})}get liked_videos(){return this.sections.get({type:"LIKE"})}get playlists(){return this.sections.get({type:"PLAYLISTS"})}get clips(){return this.sections.get({type:"CONTENT_CUT"})}get page(){return l(this,Me)}};n(ma,"Library"),Be=new WeakMap,Me=new WeakMap,ga=new WeakSet,Jb=n(async function(e){var a;if(!((a=e.menu)!=null&&a.top_level_buttons))throw new Error(`The ${e.title.text} section doesn't have more items`);let i=await(await e.menu.top_level_buttons.get({text:"See all"})).endpoint.call(l(this,Be));switch(e.icon_type){case"LIKE":case"WATCH_LATER":return new fC(l(this,Be),i,!0);case"WATCH_HISTORY":return new jC(l(this,Be),i,!0);case"CONTENT_CUT":return new eR(l(this,Be),i,!0);default:}},"#getAll");Xb.exports=ma});var fb=g((BA,jb)=>{"use strict";var nR=E(),{InnertubeError:iR}=F(),it,Ie,Ot,Jl=class{constructor(e,t,i=!1){T(this,it,void 0);T(this,Ie,void 0);T(this,Ot,void 0);var r,o;I(this,it,i?t:nR.parseResponse(t)),I(this,Ie,e);let a=l(this,it).on_response_received_endpoints;this.header=a[0].contents.get({type:"CommentsHeader"});let s=((r=a[1].contents)==null?void 0:r.findAll({type:"CommentThread"}))||[];this.contents=s.map(p=>(p.comment.setActions(l(this,Ie)),p.setActions(l(this,Ie)),p)),I(this,Ot,((o=a[1].contents)==null?void 0:o.get({type:"ContinuationItem"}))||null)}async comment(e){let t=this.header.create_renderer.submit_button,i={params:{commentText:e},parse:!1};return await t.endpoint.callTest(l(this,Ie),i)}async getContinuation(){if(!l(this,Ot))throw new iR("Continuation not found");let e=await l(this,Ot).endpoint.callTest(l(this,Ie)),t=Object.assign({},l(this,it));return t.on_response_received_endpoints.pop(),t.on_response_received_endpoints.push(e.on_response_received_endpoints[0]),new Jl(l(this,Ie),t,!0)}get page(){return l(this,it)}},_a=Jl;n(_a,"Comments"),it=new WeakMap,Ie=new WeakMap,Ot=new WeakMap;jb.exports=_a});var tx=g((MA,ex)=>{"use strict";var sR=E(),{InnertubeError:rR}=F(),Ve,Ut,Xl,Zl=class{constructor(e,t){T(this,Ve,void 0);T(this,Ut,void 0);T(this,Xl,void 0);var i;I(this,Ut,e),I(this,Ve,sR.parseResponse(t)),this.header=((i=l(this,Ve).actions_memo.get("SimpleMenuHeader"))==null?void 0:i[0])||null,this.contents=l(this,Ve).actions_memo.get("Notification")}async getContinuation(){var i;let e=(i=l(this,Ve).actions_memo.get("ContinuationItem"))==null?void 0:i[0];if(!e)throw new rR("Continuation not found");let t=await e.endpoint.callTest(l(this,Ut),{parse:!1});return new Zl(l(this,Ut),t.data)}get page(){return l(this,Ve)}},ya=Zl;n(ya,"NotificationsMenu"),Ve=new WeakMap,Ut=new WeakMap,Xl=new WeakMap;ex.exports=ya});var rx=g((VA,sx)=>{"use strict";var nx=E(),{observe:oR,InnertubeError:jl}=F(),Dt,Ce,Fe,Bt,va,ix,ba=class{constructor(e,t,i={}){T(this,va);T(this,Dt,void 0);T(this,Ce,void 0);T(this,Fe,void 0);T(this,Bt,void 0);I(this,Ce,t),I(this,Dt,i.is_continuation&&e||nx.parseResponse(e.data));let a=l(this,Dt).contents.tabs.get({selected:!0}),s=a.content.contents,r=s.get({type:"ItemSection"});if(I(this,Bt,a.content.header),this.did_you_mean=(r==null?void 0:r.contents.get({type:"DidYouMean"}))||null,this.showing_results_for=(r==null?void 0:r.contents.get({type:"ShowingResultsFor"}))||null,(!!this.did_you_mean||!!this.showing_results_for)&&s.shift(),i.is_continuation||i.is_filtered){let o=s.get({type:"MusicShelf"});this.results=o.contents,I(this,Fe,o.continuation);return}this.sections=oR(s.map(o=>({title:o.title,contents:o.contents,getMore:()=>N(this,va,ix).call(this,o)})))}async getContinuation(){var i,a,s;if(!l(this,Fe))throw new jl("Looks like you've reached the end");let t=(await l(this,Ce).search({ctoken:l(this,Fe),client:"YTMUSIC"})).data.continuationContents.musicShelfContinuation;return this.results=nx.parse(t.contents),I(this,Fe,(s=(a=(i=t==null?void 0:t.continuations)==null?void 0:i[0])==null?void 0:a.nextContinuationData)==null?void 0:s.continuation),this}async selectFilter(e){if(!this.filters.includes(e))throw new jl("Invalid filter",{available_filters:this.filters});let t=l(this,Bt).chips.get({text:e});if(t.is_selected)return this;let i=await t.endpoint.call(l(this,Ce),"YTMUSIC");return new ba(i,l(this,Ce),{is_continuation:!0})}get has_continuation(){return!!l(this,Fe)}get filters(){return l(this,Bt).chips.map(e=>e.text)}get songs(){return this.sections.get({title:"Songs"})}get videos(){return this.sections.get({title:"Videos"})}get albums(){return this.sections.get({title:"Albums"})}get artists(){return this.sections.get({title:"Artists"})}get playlists(){return this.sections.get({title:"Community playlists"})}get page(){return l(this,Dt)}},wa=ba;n(wa,"Search"),Dt=new WeakMap,Ce=new WeakMap,Fe=new WeakMap,Bt=new WeakMap,va=new WeakSet,ix=n(async function(e){if(!e.endpoint)throw new jl(`${e.title} doesn't have more items`);let t=await e.endpoint.call(l(this,Ce),"YTMUSIC");return new ba(t,l(this,Ce),{is_continuation:!0})},"#getMore");sx.exports=wa});var cx=g((FA,ox)=>{"use strict";var cR=E(),Ye,Mt,Cn,fl=class{constructor(e,t){T(this,Ye,void 0);T(this,Mt,void 0);T(this,Cn,void 0);var a,s;I(this,Mt,t),I(this,Ye,cR.parseResponse(e.data));let i=l(this,Ye).contents.tabs.get({title:"Home"});I(this,Cn,((a=i.content)==null?void 0:a.continuation)||l(this,Ye).continuation_contents.continuation),this.sections=((s=i.content)==null?void 0:s.contents)||l(this,Ye).continuation_contents.contents}async getContinuation(){let e=await l(this,Mt).browse(l(this,Cn),{is_ctoken:!0,client:"YTMUSIC"});return new fl(e,l(this,Mt))}get page(){return l(this,Ye)}},xa=fl;n(xa,"HomeFeed"),Ye=new WeakMap,Mt=new WeakMap,Cn=new WeakMap;ox.exports=xa});var lx=g((YA,ax)=>{"use strict";var aR=E(),Rn,Ta=class{constructor(e){T(this,Rn,void 0);I(this,Rn,aR.parseResponse(e.data));let t=this.page.contents.tabs.get({selected:!0});this.top_buttons=t.content.contents.get({type:"Grid"}).items,this.sections=t.content.contents.findAll({type:"MusicCarouselShelf"})}get page(){return l(this,Rn)}};n(Ta,"Explore"),Rn=new WeakMap;ax.exports=Ta});var hx=g(($A,ux)=>{"use strict";var lR=E(),kn,qa=class{constructor(e){T(this,kn,void 0);I(this,kn,lR.parseResponse(e.data))}get page(){return l(this,kn)}};n(qa,"Library"),kn=new WeakMap;ux.exports=qa});var px=g((WA,dx)=>{"use strict";var uR=E(),{observe:hR}=F(),st,Ln,Ea=class{constructor(e,t){T(this,st,void 0);T(this,Ln,void 0);I(this,st,uR.parseResponse(e.data)),I(this,Ln,t),this.header=this.page.header;let i=l(this,st).contents_memo.get("MusicShelf"),a=l(this,st).contents_memo.get("MusicCarouselShelf");this.sections=hR([...i,...a])}async getAllSongs(){var i;return((i=(await this.sections.get({type:"MusicShelf"}).endpoint.call(l(this,Ln),"YTMUSIC")).contents_memo.get("MusicPlaylistShelf"))==null?void 0:i[0])||[]}get page(){return l(this,st)}};n(Ea,"Artist"),st=new WeakMap,Ln=new WeakMap;dx.exports=Ea});var gx=g((GA,mx)=>{"use strict";var dR=E(),Re,Ia,Sa=class{constructor(e,t){T(this,Re,void 0);T(this,Ia,void 0);var i;I(this,Re,dR.parseResponse(e.data)),I(this,Ia,t),this.header=l(this,Re).header,this.url=l(this,Re).microformat.url_canonical,this.contents=(i=l(this,Re).contents_memo.get("MusicShelf"))==null?void 0:i[0].contents,this.sections=l(this,Re).contents_memo.get("MusicCarouselShelf")||[]}get page(){return l(this,Re)}};n(Sa,"Album"),Re=new WeakMap,Ia=new WeakMap;mx.exports=Sa});var yx=g((HA,_x)=>{"use strict";var eu=E(),pR=rx(),mR=cx(),gR=lx(),_R=hx(),yR=px(),wR=gx(),{InnertubeError:Vt,throwIfMissing:Ft,observe:vR}=F(),Ra,H,Ca=class{constructor(e){T(this,Ra,void 0);T(this,H,void 0);I(this,Ra,e),I(this,H,e.actions)}async search(e,t){Ft({query:e});let i=await l(this,H).search({query:e,filters:t,client:"YTMUSIC"});return new pR(i,l(this,H),{is_filtered:(t==null?void 0:t.hasOwnProperty("type"))&&t.type!=="all"})}async getHomeFeed(){let e=await l(this,H).browse("FEmusic_home",{client:"YTMUSIC"});return new mR(e,l(this,H))}async getExplore(){let e=await l(this,H).browse("FEmusic_explore",{client:"YTMUSIC"});return new gR(e,l(this,H))}async getLibrary(){let e=await l(this,H).browse("FEmusic_liked_albums",{client:"YTMUSIC"});return new _R(e,l(this,H))}async getArtist(e){if(Ft({artist_id:e}),!e.startsWith("UC"))throw new Vt("Invalid artist id",e);let t=await l(this,H).browse(e,{client:"YTMUSIC"});return new yR(t,l(this,H))}async getAlbum(e){if(Ft({album_id:e}),!e.startsWith("MPR"))throw new Vt("Invalid album id",e);let t=await l(this,H).browse(e,{client:"YTMUSIC"});return new wR(t,l(this,H))}async getLyrics(e){Ft({video_id:e});let t=await l(this,H).next({video_id:e,client:"YTMUSIC"}),s=await eu.parseResponse(t.data).contents.tabs.get({title:"Lyrics"}).endpoint.call(l(this,H),"YTMUSIC");if(!s)throw new Vt("Invalid video id");if(s.contents.constructor.name==="Message")throw new Vt(s.contents.text,e);let r=s.contents.contents.get({type:"MusicDescriptionShelf"});return{text:r.description.toString(),footer:r.footer}}async getUpNext(e){Ft({video_id:e});let t=await l(this,H).next({video_id:e,client:"YTMUSIC"}),s=eu.parseResponse(t.data).contents.tabs.get({title:"Up next"}).content.content;if(!s)throw new Vt("Invalid id",e);return{id:s.playlist_id,title:s.title,is_editable:s.is_editable,contents:vR(s.contents)}}async getRelated(e){Ft({video_id:e});let t=await l(this,H).next({video_id:e,client:"YTMUSIC"}),s=await eu.parseResponse(t.data).contents.tabs.get({title:"Related"}).endpoint.call(l(this,H),"YTMUSIC");if(!s)throw new Vt("Invalid video id");let r=s.contents.contents.findAll({type:"MusicCarouselShelf"}),o=s.contents.contents.get({type:"MusicDescriptionShelf"});return{sections:r,info:(o==null?void 0:o.description.toString())||""}}async getSearchSuggestions(e){var s;let t={parse:!0,input:e,client:"YTMUSIC"},a=(s=(await l(this,H).execute("/music/get_search_suggestions",t)).contents_memo.get("SearchSuggestionsSection"))==null?void 0:s[0];return(a==null?void 0:a.contents)||[]}};n(Ca,"Music"),Ra=new WeakMap,H=new WeakMap;_x.exports=Ca});var bx=g((zA,vx)=>{"use strict";var{InnertubeError:ka}=F(),wx=De(),rt,La=class extends wx{constructor(t,i,a=!1){super(t,i,a);T(this,rt,void 0)}get filter_chips(){var t,i;if(l(this,rt))return l(this,rt)||[];if(((t=this.memo.get("FeedFilterChipBar"))==null?void 0:t.length)>1)throw new ka("There are too many feed filter chipbars, you'll need to find the correct one yourself in this.page");if(((i=this.memo.get("FeedFilterChipBar"))==null?void 0:i.length)===0)throw new ka("There are no feed filter chipbars");return I(this,rt,this.memo.get("ChipCloudChip")||[]),l(this,rt)||[]}get filters(){return this.filter_chips.map(t=>t.text.toString())||[]}async getFilteredFeed(t){let i;if(typeof t=="string"){if(!this.filters.includes(t))throw new ka("Filter not found",{available_filters:this.filters});i=this.filter_chips.find(s=>s.text.toString()===t)}else if(t.type==="ChipCloudChip")i=t;else throw new ka("Invalid filter");if(i.is_selected)return this;let a=await i.endpoint.call(this.actions);return new wx(this.actions,a,!0)}};n(La,"FilterableFeed"),rt=new WeakMap;vx.exports=La});var Sx=g((KA,Ex)=>{"use strict";var bR=require("axios"),Pn=ae(),Yt=F(),$e,ce,Aa,xx,Na,Tx,Oa,qx,Pa=class{constructor(e){T(this,Aa);T(this,Na);T(this,Oa);T(this,$e,void 0);T(this,ce,void 0);this.config=e,I(this,$e,bR.create({proxy:e.proxy,httpAgent:e.http_agent,httpsAgent:e.https_agent,params:{prettyPrint:!1},headers:{accept:"*/*","accept-encoding":"gzip, deflate","content-type":"application/json","user-agent":Yt.getRandomUserAgent("desktop").userAgent},validateStatus:()=>!0,timeout:15e3})),N(this,Aa,xx).call(this),N(this,Na,Tx).call(this)}setSession(e){I(this,ce,e)}get instance(){return l(this,$e)}};n(Pa,"Request"),$e=new WeakMap,ce=new WeakMap,Aa=new WeakSet,xx=n(function(){l(this,$e).interceptors.request.use(async e=>{if(l(this,ce)){let t=`${Pn.URLS.API.PRODUCTION}${l(this,ce).version}`;e.baseURL=e.baseURL||t,e.headers["accept-language"]=`en-${l(this,ce).config.gl||"US"}`,e.headers["x-goog-visitor-id"]=l(this,ce).context.client.visitorData||"",e.headers["x-youtube-client-version"]=l(this,ce).context.client.clientVersion,e.headers["x-origin"]=new URL(e.baseURL).origin,e.headers.origin=new URL(e.baseURL).origin,e.params.key=l(this,ce).key;let i=e.baseURL==t;if(i&&typeof e.data=="object"&&(e.data={context:JSON.parse(JSON.stringify(l(this,ce).context)),...e.data},N(this,Oa,qx).call(this,e.data.context,e.data.client),e.headers["x-youtube-client-version"]=e.data.context.client.clientVersion,delete e.data.client),l(this,ce).logged_in&&i){let a=l(this,ce).oauth;if(a.validateCredentials()&&(await a.checkAccessTokenValidity(),e.headers.authorization=`Bearer ${a.credentials.access_token}`,delete e.params.key),this.config.cookie){let s=Yt.getStringBetweenStrings(this.config.cookie,"PAPISID=",";");e.headers.authorization=Yt.generateSidAuth(s),e.headers.cookie=this.config.cookie}}}if(this.config.debug){let t=`${e.baseURL?`${e.baseURL}`:""}${e.url}`;console.info(`
`,`[${e.method.toUpperCase()}] > ${t}`,`
`,(e==null?void 0:e.data)||"N/A",`
`)}return e},e=>{throw new Yt.InnertubeError(e.message,e)})},"#setupRequestInterceptor"),Na=new WeakSet,Tx=n(function(){l(this,$e).interceptors.response.use(e=>{let t={success:e.status===200,status_code:e.status,data:e.data};if(e.status!==200)throw new Yt.InnertubeError(`Request to ${e.config.url} failed with status code ${e.status}`,t);return t}),l(this,$e).interceptors.response.use(void 0,e=>{if(e.info)return Promise.reject(e);throw new Yt.InnertubeError("Could not complete this operation",e.message)})},"#setupResponseInterceptor"),Oa=new WeakSet,qx=n(function(e,t){switch(t){case"YTMUSIC":e.client.clientVersion=Pn.CLIENTS.YTMUSIC.VERSION,e.client.clientName=Pn.CLIENTS.YTMUSIC.NAME;break;case"ANDROID":e.client.clientVersion=Pn.CLIENTS.ANDROID.VERSION,e.client.clientFormFactor="SMALL_FORM_FACTOR",e.client.clientName=Pn.CLIENTS.ANDROID.NAME;break;default:break}},"#adjustContext");Ex.exports=Pa});var xR=hu(),TR=tb(),qR=vb(),ER=qb(),SR=kb(),IR=Pb(),CR=Ob(),Ix=Gb(),RR=Kb(),kR=ra(),LR=Zb(),PR=Ql(),AR=fb(),NR=tx(),OR=yx(),UR=bx(),DR=zl(),BR=De(),MR=require("events"),{PassThrough:VR}=require("stream"),FR=Sx(),YR=ae(),{InnertubeError:$R,throwIfMissing:We,generateRandomString:Cx}=F(),WR=ct(),ot,$t,Da,Rx,Ua=class{constructor(e){T(this,Da);T(this,ot,void 0);T(this,$t,void 0);return this.config=e||{},N(this,Da,Rx).call(this)}signIn(e={}){return new Promise(async t=>{this.oauth.init(e),this.oauth.validateCredentials()&&(await this.oauth.checkAccessTokenValidity(),this.logged_in=!0,t()),this.ev.on("auth",i=>{this.logged_in=!0,i.status==="SUCCESS"&&t()})})}async signOut(){if(!this.logged_in)throw new $R("You are not signed in");let e=await this.oauth.revokeAccessToken();return this.logged_in=!1,e}async getInfo(e){We({video_id:e});let t=Cx(16),i=this.actions.getVideoInfo(e,t),a=this.actions.next({video_id:e}),s=await Promise.all([i,a]);return new Ix(s,this.actions,l(this,ot),t)}async getBasicInfo(e){We({video_id:e});let t=Cx(16),i=await this.actions.getVideoInfo(e,t);return new Ix([i,{}],this.actions,l(this,ot),t)}async search(e,t={}){We({query:e});let i=await this.actions.search({query:e,filters:t});return new CR(this.actions,i.data)}async getSearchSuggestions(e){We({query:e});let t=await l(this,$t).call(this,{url:"search",baseURL:YR.URLS.YT_SUGGESTIONS,params:{q:e,ds:"yt",client:"youtube",xssi:"t",oe:"UTF",gl:this.context.client.gl,hl:this.context.client.hl}});return JSON.parse(t.data.replace(")]}'",""))[1].map(s=>s[0])}async getComments(e,t){We({video_id:e});let i=WR.encodeCommentsSectionParams(e,{sort_by:t||"TOP_COMMENTS"}),a=await this.actions.next({ctoken:i});return new AR(this.actions,a.data)}async getHomeFeed(){let e=await this.actions.browse("FEwhat_to_watch");return new UR(this.actions,e.data)}async getLibrary(){let e=await this.actions.browse("FElibrary");return new LR(e.data,this.actions)}async getHistory(){let e=await this.actions.browse("FEhistory");return new PR(this.actions,e.data)}async getTrending(){let e=await this.actions.browse("FEtrending");return new DR(this.actions,e.data)}async getSubscriptionsFeed(){let e=await this.actions.browse("FEsubscriptions");return new BR(this.actions,e.data)}async getChannel(e){We({id:e});let t=await this.actions.browse(e);return new RR(this.actions,t.data)}async getNotifications(){let e=await this.actions.notifications("get_notification_menu");return new NR(this.actions,e.data)}async getUnseenNotificationsCount(){return(await this.actions.notifications("get_unseen_count")).data.unseenCount}async getPlaylist(e){We({playlist_id:e});let t=await this.actions.browse(`VL${e.replace(/VL/g,"")}`);return new kR(this.actions,t.data)}async getStreamingData(e,t={}){return(await this.getBasicInfo(e)).chooseFormat(t)}download(e,t={}){We({video_id:e});let i=new VR;return(async()=>{let a=await this.getBasicInfo(e);i.emit("info",a),a.download(t,i)})(),i}getPlayer(){return l(this,ot)}get request(){return l(this,$t)}};n(Ua,"Innertube"),ot=new WeakMap,$t=new WeakMap,Da=new WeakSet,Rx=n(async function(){let e=new FR(this.config),t=await new qR(this.config,e.instance).build();return this.key=t.key,this.version=t.api_version,this.context=t.context,this.logged_in=!!this.config.cookie,this.sts=t.player.sts,this.player_url=t.player.url,I(this,ot,t.player),e.setSession(this),I(this,$t,e.instance),this.ev=new MR,this.oauth=new xR(this.ev,e.instance),this.actions=new TR(this),this.account=new ER(this.actions),this.playlist=new SR(this.actions),this.interact=new IR(this.actions),this.music=new OR(this),this},"#init");module.exports=Ua;
//# sourceMappingURL=node.js.map