axotube 1.47.0 → 1.48.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/early.js +1 -1
- package/dist/service-core.js +2 -2
- package/dist/service-core.json +3 -3
- package/dist/userScript.js +1 -1
- package/package.json +1 -1
package/dist/early.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(){"use strict";function e(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var t;t||(t=1,function(){if("undefined"==typeof globalThis)try{Object.defineProperty(Object.prototype,"__globalThis__",{get:function(){return this},configurable:!0}),__globalThis__.globalThis=__globalThis__,delete Object.prototype.__globalThis__}catch(e){"undefined"!=typeof window?window.globalThis=window:"undefined"!=typeof self&&(self.globalThis=self)}}(),window.NodeList&&!NodeList.prototype.forEach&&(NodeList.prototype.forEach=Array.prototype.forEach),window.HTMLCollection&&!HTMLCollection.prototype.forEach&&(HTMLCollection.prototype.forEach=Array.prototype.forEach),function(){var e=window.EventTarget;if(void 0!==e)try{return void new e}catch(e){}window.EventTarget=function(){var e={};return{addEventListener:function(t,o){"function"==typeof o&&(e[t]||(e[t]=[]),-1===e[t].indexOf(o)&&e[t].push(o))},removeEventListener:function(t,o){var n=e[t];if(n){var r=n.indexOf(o);-1!==r&&n.splice(r,1)}},dispatchEvent:function(t){var o=e[t&&t.type];if(o)for(var n=o.slice(),r=0;r<n.length;r++)try{n[r].call(this,t)}catch(e){console.error(e)}return!(t&&t.defaultPrevented)}}},e&&(window.EventTarget.prototype=e.prototype)}(),function(){function e(){this.aborted=!1,this._cbs=[]}function t(){this.signal=new e}"undefined"==typeof AbortController&&(e.prototype.addEventListener=function(e,t){"abort"===e&&"function"==typeof t&&this._cbs.push(t)},e.prototype.removeEventListener=function(e,t){if("abort"===e){var o=this._cbs.indexOf(t);-1!==o&&this._cbs.splice(o,1)}},e.prototype.dispatchEvent=function(e){if(e&&"abort"===e.type)for(var t=this._cbs.slice(),o=0;o<t.length;o++)t[o](e)},t.prototype.abort=function(){this.signal.aborted||(this.signal.aborted=!0,this.signal.dispatchEvent({type:"abort",bubbles:!1,cancelable:!1}))},window.AbortSignal=e,window.AbortController=t)}(),function(){function e(e,t){var o,n=!!(t=t||{}).bubbles,r=!!t.cancelable,i=void 0!==t.detail?t.detail:null;try{(o=document.createEvent("CustomEvent")).initCustomEvent(e,n,r,i)}catch(t){(o=document.createEvent("Event")).initEvent(e,n,r),o.detail=i}return o}"function"!=typeof CustomEvent&&(window.Event&&window.Event.prototype&&(e.prototype=window.Event.prototype),window.CustomEvent=e)}(),"undefined"!=typeof Promise&&"function"!=typeof Promise.prototype.finally&&(Promise.prototype.finally=function(e){var t=this.constructor||Promise;return this.then(function(o){return t.resolve(e()).then(function(){return o})},function(o){return t.resolve(e()).then(function(){throw o})})}),"undefined"!=typeof Promise&&"function"!=typeof Promise.allSettled&&(Promise.allSettled=function(e){return Promise.all(Array.prototype.map.call(e,function(e){return Promise.resolve(e).then(function(e){return{status:"fulfilled",value:e}},function(e){return{status:"rejected",reason:e}})}))}),function(){function e(t,o,n){for(var r=0;r<t.length;r++)o>0&&Array.isArray(t[r])?e(t[r],o-1,n):n.push(t[r]);return n}"function"!=typeof Array.prototype.flat&&(Array.prototype.flat=function(t){return e(this,(t=void 0===t?1:Math.floor(t))<0?0:t,[])})}(),"function"!=typeof Array.prototype.flatMap&&(Array.prototype.flatMap=function(e,t){return Array.prototype.map.call(this,e,t).flat(1)}),"function"!=typeof String.prototype.replaceAll&&(String.prototype.replaceAll=function(e,t){return"string"!=typeof e?this.replace(e,t):this.split(e).join("function"==typeof t?t(e,0,String(this)):String(t))}),"function"==typeof Object.values&&"function"==typeof Object.entries||(Object.values=Object.values||function(e){for(var t=Object.keys(e),o=[],n=0;n<t.length;n++)o.push(e[t[n]]);return o},Object.entries=Object.entries||function(e){for(var t=Object.keys(e),o=[],n=0;n<t.length;n++)o.push([t[n],e[t[n]]]);return o}),"function"!=typeof Object.fromEntries&&(Object.fromEntries=function(e){var t=Object.create(null);if("function"==typeof e.forEach)e.forEach(function(e){t[e[0]]=e[1]});else for(var o=Array.isArray(e)?e:Array.prototype.slice.call(e),n=0;n<o.length;n++)t[o[n][0]]=o[n][1];return t}),"function"!=typeof queueMicrotask&&(window.queueMicrotask=function(e){Promise.resolve().then(e).catch(function(e){setTimeout(function(){throw e},0)})}),window.Element&&"function"!=typeof Element.prototype.closest&&(Element.prototype.closest=function(e){for(var t=this;t&&1===t.nodeType;){if(t.matches?t.matches(e):t.msMatchesSelector?t.msMatchesSelector(e):t.webkitMatchesSelector&&t.webkitMatchesSelector(e))return t;t=t.parentElement||t.parentNode}return null}),function(){if(window.Element){var e=Element.prototype;"function"!=typeof e.matches&&(e.matches=e.msMatchesSelector||e.webkitMatchesSelector||function(e){for(var t=(this.document||this.ownerDocument).querySelectorAll(e),o=t.length;--o>=0&&t.item(o)!==this;);return o>-1})}}(),function(){if("undefined"!=typeof Intl&&"function"!=typeof Intl.Locale){var e={US:"en",GB:"en",AU:"en",CA:"en",IN:"hi",IE:"en",NZ:"en",FR:"fr",DE:"de",ES:"es",IT:"it",PT:"pt",BR:"pt",MX:"es",AR:"es",CO:"es",CL:"es",RU:"ru",UA:"uk",PL:"pl",NL:"nl",BE:"nl",SE:"sv",NO:"no",DK:"da",FI:"fi",TR:"tr",GR:"el",CZ:"cs",SK:"sk",HU:"hu",RO:"ro",BG:"bg",HR:"hr",RS:"sr",JP:"ja",KR:"ko",VN:"vi",TH:"th",ID:"id",MY:"ms",PH:"tl",SA:"ar",AE:"ar",EG:"ar",IL:"he",IR:"fa",PK:"ur",BD:"bn",LK:"si"};t.prototype.maximize=function(){return this},Intl.Locale=t}function t(t,o){o=o||{},this.language=e[o.region]||"en"}}());var o;function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}o||(o=1,function(){var e=!1;try{var t=0,o=[];e="xbx"!=="aba".replaceAll("a",function(e,n){return t+=1,o.push(n),"x"})||2!==t||0!==o[0]||2!==o[1]}catch(t){e=!0}e&&(String.prototype.replaceAll=function(e,t){var o=String(this);if(e instanceof RegExp){if(!e.global)throw new TypeError("replaceAll requires a global RegExp");return o.replace(e,t)}var n=new RegExp(String(e).replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"g");return o.replace(n,t)})}(),function(){var e=!1;try{var t=Object.fromEntries([["a",1]]);e=Object.getPrototypeOf(t)!==Object.prototype}catch(t){e=!0}e&&(Object.fromEntries=function(e){var t={};function o(e){if(e)try{Object.defineProperty(t,e[0],{value:e[1],enumerable:!0,configurable:!0,writable:!0})}catch(o){t[e[0]]=e[1]}}if(e&&"function"==typeof e.forEach)e.forEach(o);else for(var n=Array.isArray(e)?e:Array.prototype.slice.call(e||[]),r=0;r<n.length;r++)o(n[r]);return t})}());var r,i,a={defaults:{enableAdBlock:!0,blockPlayerAdTracking:!0,blockAdTelemetry:!0,blockViewStatsTelemetry:!1,removeLiveVideos:!1,removeTopLiveGames:!1,removeMostRelevant:!1,enableSponsorBlock:!0,enableSponsorBlockToasts:!0,sponsorBlockManualSkips:["intro","outro","filler"],enableSponsorBlockSponsor:!0,enableSponsorBlockIntro:!0,enableSponsorBlockOutro:!0,enableSponsorBlockInteraction:!0,enableSponsorBlockSelfPromo:!0,enableSponsorBlockPreview:!0,enableSponsorBlockMusicOfftopic:!0,enableSponsorBlockFiller:!1,enableSponsorBlockHighlight:!0,videoSpeed:1,preferredVideoQuality:"auto",enableDeArrowTitles:!0,enableDeArrowThumbnails:!0,routeColor:"#0f0f0f",routeBackgroundUrl:"",themePreset:"default",textTheme:"default",userAgentProfile:"auto",enableFixedUI:!1,enableHqThumbnails:!0,enableLongPress:!0,enableShorts:!0,dontCheckUpdateUntil:0,enableWhoIsWatchingMenu:!1,permanentlyEnableWhoIsWatchingMenu:!1,enableWhosWatchingMenuOnAppExit:!1,enableShowUserLanguage:!0,enableShowOtherLanguages:!1,showWelcomeToast:!0,enablePreviousNextButtons:!0,enableSuperThanksButton:!1,enableSpeedControlsButton:!0,enablePatchingVideoPlayer:!0,enableMPButton:!0,enableSwapMPWithPIP:!1,enablePreviews:!0,previewLengthSeconds:40,enableRemainingTime:!1,enablePauseOnBlur:!1,enableLowMemoryMode:!1,enableHideWatchedVideos:!1,hideWatchedVideosThreshold:80,hideWatchedVideosPages:[],enableHideEndScreenCards:!1,enableYouThereRenderer:!0,enableScreenDimming:!1,dimmingTimeout:60,dimmingOpacity:.5,enablePaidPromotionOverlay:!0,speedSettingsIncrement:.25,videoPreferredCodec:"any",enableAutoSubtitles:!0,autoSubtitleLanguage:"en",autoSubtitleAllowAuto:!0,launchToOnStartup:null,reloadHomeOnStartup:!0,disabledSidebarContents:[],disableChannelsOnSidebar:!1,enableUpdater:!0,autoFrameRate:!1,autoFrameRatePauseVideoFor:0,enableSigninReminder:!1,sortSubscriptionsByAlphabet:!1,enableReducedMotion:!1,enablePerformanceMode:!1,enablePanelShrink:!0,enableDeArrowPeek:!0,panelShrinkPercent:"60",clockMode:"off",clockFormat:"24h",clockPosition:"topRight",clockShowSeconds:!1,enableOnePressMode:!1,enableExperimentalResolution:!1,experimentalMaxResolution:"1440p"},ranges:{videoSpeed:[.05,5],hideWatchedVideosThreshold:[0,100],dimmingTimeout:[1,3600],dimmingOpacity:[0,1],speedSettingsIncrement:[.01,1],autoFrameRatePauseVideoFor:[0,1e4],previewLengthSeconds:[5,120],dontCheckUpdateUntil:[0,9007199254740991]},enums:{preferredVideoQuality:["auto","2160p","1440p","1080p","720p","480p","360p","240p","144p"],videoPreferredCodec:["any","vp9","av01","avc1"],themePreset:["default","black","darkGray","charcoal","navy","darkRed","darkGreen","darkPurple"],textTheme:["default","white","gray","red","blue","green","purple","yellow"],userAgentProfile:["auto","samsung","android"],experimentalMaxResolution:["1440p","2160p"],autoSubtitleLanguage:["en","hi","es","fr","de","pt","ja","ko","ru"],panelShrinkPercent:["50","60","70"],clockMode:["off","always","notPlaying"],clockFormat:["24h","12h","12hNoAmPm"],clockPosition:["topLeft","topRight","bottomLeft","bottomRight"]},themePresetColors:{default:"#0f0f0f",black:"#000000",darkGray:"#1c1a1a",charcoal:"#121212",navy:"#0d1b2a",darkRed:"#3b0505",darkGreen:"#052e1b",darkPurple:"#1a1025"}};var c=function(){if(i)return r;i=1;var e=a;return r={validateConfigValue:function(t,o){var r=e.defaults;if(!Object.prototype.hasOwnProperty.call(r,t))return!1;var i=r[t];if(null===i)return null===o||"string"==typeof o;if(Array.isArray(i))return Array.isArray(o)&&o.every(function(e){return"string"==typeof e});if("number"==typeof i){if("number"!=typeof o||!isFinite(o))return!1;var a=e.ranges[t];return!a||o>=a[0]&&o<=a[1]}if(n(o)!==n(i))return!1;var c=e.enums[t];return(!c||-1!==c.indexOf(o))&&(!("routeColor"===t&&!/^#[0-9a-f]{6}$/i.test(o))&&!("routeBackgroundUrl"===t&&o&&!/^https?:\/\/\S+$/i.test(o)))}},r}(),l=e(c),u="ytaf-configuration",s=JSON.parse,f=JSON.stringify,p=function(e){return s(f(e))},d=p(a.defaults);d.enableFixedUI="undefined"==typeof window||!window.h5vcc||!window.h5vcc.tizentube||a.defaults.enableFixedUI;var h,y=l.validateConfigValue;function b(e){if(Object.prototype.hasOwnProperty.call(d,e))return void 0===h[e]&&(h[e]=p(d[e])),h[e];console.warn("[AxoTube:config] Unknown config key",e)}!function(){h=p(d);try{if(!window.localStorage||!window.localStorage[u])return;var e=s(window.localStorage[u]);if(!e||"object"!==n(e)||Array.isArray(e))return;Object.keys(e).forEach(function(t){y(t,e[t])&&(h[t]=p(e[t]))})}catch(e){console.warn("[AxoTube:config] Config read failed; using defaults:",e)}}();var v=new EventTarget,m={"1440p":"2560x1440","2160p":"3840x2160"},g={width:function(e){return Number(e)>0&&Number(e)<=7680},height:function(e){return Number(e)>0&&Number(e)<=4320},framerate:function(e){return Number(e)>0&&Number(e)<=60},bitrate:function(e){return Number(e)>0&&Number(e)<=2e8},eotf:function(e){return"bt709"===e||("smpte2084"===e||"arib-std-b67"===e)&&w()},channels:function(e){return Number(e)>0&&Number(e)<=8},cryptoblockformat:function(e){return"subsample"===e},"decode-to-texture":function(e){return"true"===e||"false"===e}};function w(){return!(!window.matchMedia||!window.matchMedia("(dynamic-range: high)").matches)}function S(e){var t=e.split("."),o="vp09"===t[0]?t[6]:"av01"===t[0]?t[7]:void 0;return"16"===o||"18"===o}var E="__axotubeResolutionOwner";if(!window[E]){if(window[E]=!0,b("enableExperimentalResolution"))try{window.h5vcc=window.h5vcc||{},window.h5vcc.system=window.h5vcc.system||{},window.h5vcc.system.getVideoContainerSizeOverride=function(){var e=b("experimentalMaxResolution");return m[e]||m["1440p"]},function(){if(window.MediaSource&&"function"==typeof MediaSource.isTypeSupported){var e=MediaSource.isTypeSupported.bind(MediaSource);MediaSource.isTypeSupported=function(t){for(var o=String(t).split(";"),n=[o[0].trim()],r=1;r<o.length;r++){var i=o[r].trim(),a=i.indexOf("="),c=(-1===a?i:i.slice(0,a)).trim().toLowerCase(),l=(-1===a?"":i.slice(a+1)).trim().replace(/^"|"$/g,"");if("codecs"===c){for(var u=l.split(","),s=0;s<u.length;s++)if(S(u[s].trim())&&!w())return!1;n.push(i)}else if(g[c]){if(!g[c](l))return!1}else n.push(i)}return e(n.join("; "))}}}()}catch(e){console.warn("[AxoTube:experimentalResolution] Could not install overrides:",e)}v.addEventListener("configChange",function(e){var t,o=(null===(t=e.detail)||void 0===t?void 0:t.key)||"";("enableExperimentalResolution"===o||"experimentalMaxResolution"===o&&b("enableExperimentalResolution"))&&setTimeout(function(){return location.reload()},300)})}var k={avc1:["avc1"],vp9:["vp09","vp9"],av01:["av01"]};var P="__axotubeCodecOwner";if(!window[P]){window[P]=!0;try{!function(e){if(window.MediaSource&&"function"==typeof MediaSource.isTypeSupported){var t=function(e){if(!k[e])return[];var t=[];return Object.keys(k).forEach(function(o){o!==e&&(t=t.concat(k[o]))}),t}(e);if(0!==t.length){var o=MediaSource.isTypeSupported.bind(MediaSource);MediaSource.isTypeSupported=function(e){var n=String(e).toLowerCase();if(-1!==n.indexOf("codecs"))for(var r=0;r<t.length;r++)if(-1!==n.indexOf(t[r]))return!1;return o(e)}}}}(b("videoPreferredCodec"))}catch(e){console.warn("[AxoTube:codecPreference] Could not install codec preference:",e)}v.addEventListener("configChange",function(e){var t;"videoPreferredCodec"===((null===(t=e.detail)||void 0===t?void 0:t.key)||"")&&setTimeout(function(){return location.reload()},300)})}var A={"www.gstatic.com":!0,"yt3.ggpht.com":!0,"clients1.google.com":!0,"s.youtube.com":!0,"jnn-pa.googleapis.com":!0,"yt3.googleusercontent.com":!0,"redirector.googlevideo.com":!0,"www.youtube.com":!0,"youtube.com":!0};function O(e,t){var o=e.location;if(!o||"localhost"!==o.hostname&&"127.0.0.1"!==o.hostname)return null;var n=e.document.createElement("a");n.href=String(t);var r,i,a=String(n.href||""),c=/^https?:\/\/([^\/?#:]+)/i.exec(a);return c&&(r=c[1],i=String(r||"").toLowerCase(),A[i]||"googlevideo.com"===i||".googlevideo.com"===i.slice(-16))?(/^http:\/\//i.test(a)&&(a="https://"+a.slice(7).replace(/^([^\/?#]*?):80(?=[\/?#]|$)/,"$1")),o.origin+"/cors-bypass/"+a):null}!function(e){if(e&&!e.__axotubeCorsShim){e.__axotubeCorsShim=!0;var t=e.Request;if("function"==typeof t){var o=function(o,n){var r=o;if("string"==typeof o)try{var i=O(e,o);i&&(r=i)}catch(e){}return new t(r,n)};o.prototype=t.prototype,e.Request=o}if("function"==typeof e.fetch){var r=e.fetch;e.fetch=function(t,o){try{var i=!!t&&"object"===n(t)&&"string"==typeof t.url,a=O(e,i?t.url:t);a&&(i?"GET"!==t.method&&"HEAD"!==t.method||(t=new e.Request(a,{method:t.method,headers:t.headers,credentials:"omit",mode:"cors"})):t=a)}catch(e){}return r.call(e,t,o)}}var i=e.XMLHttpRequest;if(i&&i.prototype&&"function"==typeof i.prototype.open){var a=i.prototype.open;i.prototype.open=function(t,o){var n=Array.prototype.slice.call(arguments);try{var r=O(e,o);r&&(n[1]=r)}catch(e){}return a.apply(this,n)}}}}(window)}();
|
|
1
|
+
!function(){"use strict";function e(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(e)}var r,n={};!function(){if(r)return n;function e(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,configurable:!0,enumerable:!1})}r=1,function(){if("undefined"==typeof globalThis)try{Object.defineProperty(Object.prototype,"__globalThis__",{get:function(){return this},configurable:!0}),__globalThis__.globalThis=__globalThis__,delete Object.prototype.__globalThis__}catch(e){window.globalThis=window}}(),window.NodeList&&!NodeList.prototype.forEach&&e(NodeList.prototype,"forEach",Array.prototype.forEach),window.HTMLCollection&&!HTMLCollection.prototype.forEach&&e(HTMLCollection.prototype,"forEach",Array.prototype.forEach),function(){var e=window.EventTarget;if(void 0!==e)try{return void new e}catch(e){}window.EventTarget=function(){var e={};return{addEventListener:function(t,r){"function"==typeof r&&(e[t]||(e[t]=[]),-1===e[t].indexOf(r)&&e[t].push(r))},removeEventListener:function(t,r){var n=e[t];if(n){var o=n.indexOf(r);-1!==o&&n.splice(o,1)}},dispatchEvent:function(t){var r=e[t&&t.type];if(r)for(var n=r.slice(),o=0;o<n.length;o++)try{n[o].call(this,t)}catch(e){console.error(e)}return!(t&&t.defaultPrevented)}}},e&&(window.EventTarget.prototype=e.prototype)}(),function(){function e(){this.aborted=!1,this._cbs=[]}function t(){this.signal=new e}"undefined"==typeof AbortController&&(e.prototype.addEventListener=function(e,t){"abort"===e&&"function"==typeof t&&this._cbs.push(t)},e.prototype.removeEventListener=function(e,t){if("abort"===e){var r=this._cbs.indexOf(t);-1!==r&&this._cbs.splice(r,1)}},e.prototype.dispatchEvent=function(e){if(e&&"abort"===e.type)for(var t=this._cbs.slice(),r=0;r<t.length;r++)t[r](e)},t.prototype.abort=function(){this.signal.aborted||(this.signal.aborted=!0,this.signal.dispatchEvent({type:"abort",bubbles:!1,cancelable:!1}))},window.AbortSignal=e,window.AbortController=t)}(),function(){function e(e,t){var r,n=!!(t=t||{}).bubbles,o=!!t.cancelable,i=void 0!==t.detail?t.detail:null;try{(r=document.createEvent("CustomEvent")).initCustomEvent(e,n,o,i)}catch(t){(r=document.createEvent("Event")).initEvent(e,n,o),r.detail=i}return r}"function"!=typeof CustomEvent&&(window.Event&&window.Event.prototype&&(e.prototype=window.Event.prototype),window.CustomEvent=e)}(),"function"!=typeof Promise.prototype.finally&&e(Promise.prototype,"finally",function(e){var t=this.constructor;return this.then(function(r){return t.resolve(e()).then(function(){return r})},function(r){return t.resolve(e()).then(function(){throw r})})}),"function"!=typeof Promise.allSettled&&e(Promise,"allSettled",function(e){return Promise.all(Array.prototype.map.call(e,function(e){return Promise.resolve(e).then(function(e){return{status:"fulfilled",value:e}},function(e){return{status:"rejected",reason:e}})}))}),function(){function t(e,r,n){for(var o=0;o<e.length;o++)r>0&&Array.isArray(e[o])?t(e[o],r-1,n):n.push(e[o]);return n}"function"!=typeof Array.prototype.flat&&e(Array.prototype,"flat",function(e){return t(this,(e=void 0===e?1:Math.floor(e))<0?0:e,[])})}(),"function"!=typeof Array.prototype.flatMap&&e(Array.prototype,"flatMap",function(e,t){return Array.prototype.map.call(this,e,t).flat(1)}),"function"!=typeof String.prototype.replaceAll&&e(String.prototype,"replaceAll",function(e,t){if("[object RegExp]"===Object.prototype.toString.call(e)){if(!e.global)throw new TypeError("replaceAll must be called with a global RegExp");return this.replace(e,t)}var r=String(e).replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return String(this).replace(new RegExp(r,"g"),t)}),"function"!=typeof Object.values&&e(Object,"values",function(e){for(var t=Object.keys(e),r=[],n=0;n<t.length;n++)r.push(e[t[n]]);return r}),"function"!=typeof Object.entries&&e(Object,"entries",function(e){for(var t=Object.keys(e),r=[],n=0;n<t.length;n++)r.push([t[n],e[t[n]]]);return r}),"function"!=typeof Object.fromEntries&&e(Object,"fromEntries",function(e){if(null==e)throw new TypeError("Object.fromEntries requires an iterable");for(var r={},n=e[Symbol.iterator](),o=n.next();!o.done;){var i=o.value;if(null===i||"object"!==t(i)&&"function"!=typeof i)throw new TypeError("Iterator value is not an entry object");r[i[0]]=i[1],o=n.next()}return r}),"function"!=typeof queueMicrotask&&(window.queueMicrotask=function(e){Promise.resolve().then(e).catch(function(e){setTimeout(function(){throw e},0)})}),window.Element&&"function"!=typeof Element.prototype.closest&&e(Element.prototype,"closest",function(e){for(var t=this;t&&1===t.nodeType;){if(t.matches?t.matches(e):t.msMatchesSelector?t.msMatchesSelector(e):t.webkitMatchesSelector&&t.webkitMatchesSelector(e))return t;t=t.parentElement||t.parentNode}return null}),function(){if(window.Element){var t=Element.prototype;"function"!=typeof t.matches&&e(t,"matches",t.msMatchesSelector||t.webkitMatchesSelector||function(e){for(var t=(this.document||this.ownerDocument).querySelectorAll(e),r=t.length;--r>=0&&t.item(r)!==this;);return r>-1})}}(),function(){if("undefined"!=typeof Intl&&"function"!=typeof Intl.Locale){var e={US:"en",GB:"en",AU:"en",CA:"en",IN:"hi",IE:"en",NZ:"en",FR:"fr",DE:"de",ES:"es",IT:"it",PT:"pt",BR:"pt",MX:"es",AR:"es",CO:"es",CL:"es",RU:"ru",UA:"uk",PL:"pl",NL:"nl",BE:"nl",SE:"sv",NO:"no",DK:"da",FI:"fi",TR:"tr",GR:"el",CZ:"cs",SK:"sk",HU:"hu",RO:"ro",BG:"bg",HR:"hr",RS:"sr",JP:"ja",KR:"ko",VN:"vi",TH:"th",ID:"id",MY:"ms",PH:"tl",SA:"ar",AE:"ar",EG:"ar",IL:"he",IR:"fa",PK:"ur",BD:"bn",LK:"si"};t.prototype.maximize=function(){return this},Intl.Locale=t}function t(t,r){r=r||{},this.language=e[r.region]||"en"}}(),function(){var t=9007199254740991;function r(t,r,n){void 0===t[r]&&e(t,r,n)}function n(e,t){return e===t||e!=e&&t!=t}function o(e,t){if("[object RegExp]"===Object.prototype.toString.call(e))throw new TypeError("First argument to String.prototype."+t+" must not be a regular expression")}function i(e,t){if(null==e)throw new TypeError("String.prototype."+t+" called on null or undefined")}r(Array.prototype,"includes",function(e,t){for(var r=Object(this),o=r.length>>>0,i=Number(t)||0,a=i>=0?Math.floor(i):Math.max(o+Math.ceil(i),0);a<o;a++)if(n(r[a],e))return!0;return!1}),r(Array.prototype,"findIndex",function(e,t){if("function"!=typeof e)throw new TypeError("predicate must be a function");for(var r=Object(this),n=r.length>>>0,o=0;o<n;o++)if(e.call(t,r[o],o,r))return o;return-1}),r(Array.prototype,"find",function(e,t){if("function"!=typeof e)throw new TypeError("predicate must be a function");for(var r=Object(this),n=r.length>>>0,o=0;o<n;o++)if(e.call(t,r[o],o,r))return r[o]}),r(Array,"from",function(e,t,r){if(null==e)throw new TypeError("Array.from requires an array-like or iterable object");if(void 0!==t&&"function"!=typeof t)throw new TypeError("Array.from: mapFn must be a function");var n=[],o=e[Symbol.iterator];if("function"==typeof o)for(var i=o.call(e),a=i.next();!a.done;)n.push(a.value),a=i.next();else for(var l=Object(e).length>>>0,c=0;c<l;c++)n.push(e[c]);if(t)for(var u=0;u<n.length;u++)n[u]=t.call(r,n[u],u);return n}),r(Object,"assign",function(e){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),r=1;r<arguments.length;r++){var n=arguments[r];if(null!=n)for(var o=Object(n),i=Object.keys(o),a=0;a<i.length;a++)t[i[a]]=o[i[a]]}return t}),r(String.prototype,"includes",function(e,t){i(this,"includes"),o(e,"includes");var r=String(this),n=Number(t)||0;return n<0&&(n=0),-1!==r.indexOf(String(e),n)}),r(String.prototype,"startsWith",function(e,t){i(this,"startsWith"),o(e,"startsWith");var r=String(this),n=String(e),a=Number(t)||0;return a<0&&(a=0),a>r.length&&(a=r.length),r.substring(a,a+n.length)===n}),r(Number,"isFinite",function(e){return"number"==typeof e&&isFinite(e)}),r(Number,"isSafeInteger",function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e&&Math.abs(e)<=t}),r(Number,"MAX_SAFE_INTEGER",t),r(Number,"MIN_SAFE_INTEGER",-t)}()}();var o;o||(o=1,function(){var e=!1;try{var t=0,r=[];e="xbx"!=="aba".replaceAll("a",function(e,n){return t+=1,r.push(n),"x"})||2!==t||0!==r[0]||2!==r[1]}catch(t){e=!0}e&&(String.prototype.replaceAll=function(e,t){var r=String(this);if(e instanceof RegExp){if(!e.global)throw new TypeError("replaceAll requires a global RegExp");return r.replace(e,t)}var n=new RegExp(String(e).replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"g");return r.replace(n,t)})}(),function(){var e=!1;try{var t=Object.fromEntries([["a",1]]);e=Object.getPrototypeOf(t)!==Object.prototype}catch(t){e=!0}e&&(Object.fromEntries=function(e){var t={};function r(e){if(e)try{Object.defineProperty(t,e[0],{value:e[1],enumerable:!0,configurable:!0,writable:!0})}catch(r){t[e[0]]=e[1]}}if(e&&"function"==typeof e.forEach)e.forEach(r);else for(var n=Array.isArray(e)?e:Array.prototype.slice.call(e||[]),o=0;o<n.length;o++)r(n[o]);return t})}());var i,a,l={defaults:{enableAdBlock:!0,blockPlayerAdTracking:!0,blockAdTelemetry:!0,blockViewStatsTelemetry:!1,removeLiveVideos:!1,removeTopLiveGames:!1,removeMostRelevant:!1,enableSponsorBlock:!0,enableSponsorBlockToasts:!0,sponsorBlockManualSkips:["intro","outro","filler"],enableSponsorBlockSponsor:!0,enableSponsorBlockIntro:!0,enableSponsorBlockOutro:!0,enableSponsorBlockInteraction:!0,enableSponsorBlockSelfPromo:!0,enableSponsorBlockPreview:!0,enableSponsorBlockMusicOfftopic:!0,enableSponsorBlockFiller:!1,enableSponsorBlockHighlight:!0,videoSpeed:1,preferredVideoQuality:"auto",enableDeArrowTitles:!0,enableDeArrowThumbnails:!0,routeColor:"#0f0f0f",routeBackgroundUrl:"",themePreset:"default",textTheme:"default",userAgentProfile:"auto",enableFixedUI:!1,enableHqThumbnails:!0,enableLongPress:!0,enableShorts:!0,dontCheckUpdateUntil:0,enableWhoIsWatchingMenu:!1,permanentlyEnableWhoIsWatchingMenu:!1,enableWhosWatchingMenuOnAppExit:!1,enableShowUserLanguage:!0,enableShowOtherLanguages:!1,showWelcomeToast:!0,enablePreviousNextButtons:!0,enableSuperThanksButton:!1,enableSpeedControlsButton:!0,enablePatchingVideoPlayer:!0,enableMPButton:!0,enableSwapMPWithPIP:!1,enablePreviews:!0,previewLengthSeconds:40,enableRemainingTime:!1,enablePauseOnBlur:!1,enableLowMemoryMode:!1,enableHideWatchedVideos:!1,hideWatchedVideosThreshold:80,hideWatchedVideosPages:[],enableHideEndScreenCards:!1,enableYouThereRenderer:!0,enableScreenDimming:!1,dimmingTimeout:60,dimmingOpacity:.5,enablePaidPromotionOverlay:!0,speedSettingsIncrement:.25,videoPreferredCodec:"any",enableAutoSubtitles:!0,autoSubtitleLanguage:"en",autoSubtitleAllowAuto:!0,launchToOnStartup:null,reloadHomeOnStartup:!0,disabledSidebarContents:[],disableChannelsOnSidebar:!1,enableUpdater:!0,autoFrameRate:!1,autoFrameRatePauseVideoFor:0,enableSigninReminder:!1,sortSubscriptionsByAlphabet:!1,enableReducedMotion:!1,enablePerformanceMode:!1,enablePanelShrink:!0,enableDeArrowPeek:!0,panelShrinkPercent:"60",clockMode:"off",clockFormat:"24h",clockPosition:"topRight",clockShowSeconds:!1,enableOnePressMode:!1,enableExperimentalResolution:!1,experimentalMaxResolution:"1440p"},ranges:{videoSpeed:[.05,5],hideWatchedVideosThreshold:[0,100],dimmingTimeout:[1,3600],dimmingOpacity:[0,1],speedSettingsIncrement:[.01,1],autoFrameRatePauseVideoFor:[0,1e4],previewLengthSeconds:[5,120],dontCheckUpdateUntil:[0,9007199254740991]},enums:{preferredVideoQuality:["auto","2160p","1440p","1080p","720p","480p","360p","240p","144p"],videoPreferredCodec:["any","vp9","av01","avc1"],themePreset:["default","black","darkGray","charcoal","navy","darkRed","darkGreen","darkPurple"],textTheme:["default","white","gray","red","blue","green","purple","yellow"],userAgentProfile:["auto","samsung","android"],experimentalMaxResolution:["1440p","2160p"],autoSubtitleLanguage:["en","hi","es","fr","de","pt","ja","ko","ru"],panelShrinkPercent:["50","60","70"],clockMode:["off","always","notPlaying"],clockFormat:["24h","12h","12hNoAmPm"],clockPosition:["topLeft","topRight","bottomLeft","bottomRight"]},themePresetColors:{default:"#0f0f0f",black:"#000000",darkGray:"#1c1a1a",charcoal:"#121212",navy:"#0d1b2a",darkRed:"#3b0505",darkGreen:"#052e1b",darkPurple:"#1a1025"}};var c=function(){if(a)return i;a=1;var e=l;return i={validateConfigValue:function(r,n){var o=e.defaults;if(!Object.prototype.hasOwnProperty.call(o,r))return!1;var i=o[r];if(null===i)return null===n||"string"==typeof n;if(Array.isArray(i))return Array.isArray(n)&&n.every(function(e){return"string"==typeof e});if("number"==typeof i){if("number"!=typeof n||!isFinite(n))return!1;var a=e.ranges[r];return!a||n>=a[0]&&n<=a[1]}if(t(n)!==t(i))return!1;var l=e.enums[r];return(!l||-1!==l.indexOf(n))&&(!("routeColor"===r&&!/^#[0-9a-f]{6}$/i.test(n))&&!("routeBackgroundUrl"===r&&n&&!/^https?:\/\/\S+$/i.test(n)))}},i}(),u=e(c),f="ytaf-configuration",s=JSON.parse,p=JSON.stringify,d=function(e){return s(p(e))},h=d(l.defaults);h.enableFixedUI="undefined"==typeof window||!window.h5vcc||!window.h5vcc.tizentube||l.defaults.enableFixedUI;var b,y=u.validateConfigValue;function m(e){if(Object.prototype.hasOwnProperty.call(h,e))return void 0===b[e]&&(b[e]=d(h[e])),b[e];console.warn("[AxoTube:config] Unknown config key",e)}!function(){b=d(h);try{if(!window.localStorage||!window.localStorage[f])return;var e=s(window.localStorage[f]);if(!e||"object"!==t(e)||Array.isArray(e))return;Object.keys(e).forEach(function(t){y(t,e[t])&&(b[t]=d(e[t]))})}catch(e){console.warn("[AxoTube:config] Config read failed; using defaults:",e)}}();var v=new EventTarget,g={"1440p":"2560x1440","2160p":"3840x2160"},w={width:function(e){return Number(e)>0&&Number(e)<=7680},height:function(e){return Number(e)>0&&Number(e)<=4320},framerate:function(e){return Number(e)>0&&Number(e)<=60},bitrate:function(e){return Number(e)>0&&Number(e)<=2e8},eotf:function(e){return"bt709"===e||("smpte2084"===e||"arib-std-b67"===e)&&S()},channels:function(e){return Number(e)>0&&Number(e)<=8},cryptoblockformat:function(e){return"subsample"===e},"decode-to-texture":function(e){return"true"===e||"false"===e}};function S(){return!(!window.matchMedia||!window.matchMedia("(dynamic-range: high)").matches)}function E(e){var t=e.split("."),r="vp09"===t[0]?t[6]:"av01"===t[0]?t[7]:void 0;return"16"===r||"18"===r}var O="__axotubeResolutionOwner";if(!window[O]){if(window[O]=!0,m("enableExperimentalResolution"))try{window.h5vcc=window.h5vcc||{},window.h5vcc.system=window.h5vcc.system||{},window.h5vcc.system.getVideoContainerSizeOverride=function(){var e=m("experimentalMaxResolution");return g[e]||g["1440p"]},function(){if(window.MediaSource&&"function"==typeof MediaSource.isTypeSupported){var e=MediaSource.isTypeSupported.bind(MediaSource);MediaSource.isTypeSupported=function(t){for(var r=String(t).split(";"),n=[r[0].trim()],o=1;o<r.length;o++){var i=r[o].trim(),a=i.indexOf("="),l=(-1===a?i:i.slice(0,a)).trim().toLowerCase(),c=(-1===a?"":i.slice(a+1)).trim().replace(/^"|"$/g,"");if("codecs"===l){for(var u=c.split(","),f=0;f<u.length;f++)if(E(u[f].trim())&&!S())return!1;n.push(i)}else if(w[l]){if(!w[l](c))return!1}else n.push(i)}return e(n.join("; "))}}}()}catch(e){console.warn("[AxoTube:experimentalResolution] Could not install overrides:",e)}v.addEventListener("configChange",function(e){var t,r=(null===(t=e.detail)||void 0===t?void 0:t.key)||"";("enableExperimentalResolution"===r||"experimentalMaxResolution"===r&&m("enableExperimentalResolution"))&&setTimeout(function(){return location.reload()},300)})}var T={avc1:["avc1"],vp9:["vp09","vp9"],av01:["av01"]};var k="__axotubeCodecOwner";if(!window[k]){window[k]=!0;try{!function(e){if(window.MediaSource&&"function"==typeof MediaSource.isTypeSupported){var t=function(e){if(!T[e])return[];var t=[];return Object.keys(T).forEach(function(r){r!==e&&(t=t.concat(T[r]))}),t}(e);if(0!==t.length){var r=MediaSource.isTypeSupported.bind(MediaSource);MediaSource.isTypeSupported=function(e){var n=String(e).toLowerCase();if(-1!==n.indexOf("codecs"))for(var o=0;o<t.length;o++)if(-1!==n.indexOf(t[o]))return!1;return r(e)}}}}(m("videoPreferredCodec"))}catch(e){console.warn("[AxoTube:codecPreference] Could not install codec preference:",e)}v.addEventListener("configChange",function(e){var t;"videoPreferredCodec"===((null===(t=e.detail)||void 0===t?void 0:t.key)||"")&&setTimeout(function(){return location.reload()},300)})}var A={"www.gstatic.com":!0,"yt3.ggpht.com":!0,"clients1.google.com":!0,"s.youtube.com":!0,"jnn-pa.googleapis.com":!0,"yt3.googleusercontent.com":!0,"redirector.googlevideo.com":!0,"www.youtube.com":!0,"youtube.com":!0};function P(e,t){var r=e.location;if(!r||"localhost"!==r.hostname&&"127.0.0.1"!==r.hostname)return null;var n=e.document.createElement("a");n.href=String(t);var o,i,a=String(n.href||""),l=/^https?:\/\/([^\/?#:]+)/i.exec(a);return l&&(o=l[1],i=String(o||"").toLowerCase(),A[i]||"googlevideo.com"===i||".googlevideo.com"===i.slice(-16))?(/^http:\/\//i.test(a)&&(a="https://"+a.slice(7).replace(/^([^\/?#]*?):80(?=[\/?#]|$)/,"$1")),r.origin+"/cors-bypass/"+a):null}!function(e){if(e&&!e.__axotubeCorsShim){e.__axotubeCorsShim=!0;var r=e.Request;if("function"==typeof r){var n=function(t,n){var o=t;if("string"==typeof t)try{var i=P(e,t);i&&(o=i)}catch(e){}return new r(o,n)};n.prototype=r.prototype,e.Request=n}if("function"==typeof e.fetch){var o=e.fetch;e.fetch=function(r,n){try{var i=!!r&&"object"===t(r)&&"string"==typeof r.url,a=P(e,i?r.url:r);a&&(i?"GET"!==r.method&&"HEAD"!==r.method||(r=new e.Request(a,{method:r.method,headers:r.headers,credentials:"omit",mode:"cors"})):r=a)}catch(e){}return o.call(e,r,n)}}var i=e.XMLHttpRequest;if(i&&i.prototype&&"function"==typeof i.prototype.open){var a=i.prototype.open;i.prototype.open=function(t,r){var n=Array.prototype.slice.call(arguments);try{var o=P(e,r);o&&(n[1]=o)}catch(e){}return a.apply(this,n)}}}}(window)}();
|
package/dist/service-core.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var e=require("url"),a=require("path"),t=require("tty"),i=require("util"),n=require("fs"),o=require("net"),r=require("events"),p=require("stream"),s=require("zlib"),d=require("buffer"),c=require("string_decoder"),l=require("querystring"),u=require("http"),m=require("crypto"),f=require("punycode"),h=require("https"),v=require("os"),g=require("dgram"),b=require("timers"),y=require("assert"),x="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function w(e){if(e.__esModule)return e;var a=e.default;if("function"==typeof a){var t=function e(){return this instanceof e?Reflect.construct(a,arguments,this.constructor):a.apply(this,arguments)};t.prototype=a.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(e).forEach(function(a){var i=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(t,a,i.get?i:{enumerable:!0,get:function(){return e[a]}})}),t}function T(e,a){(null==a||a>e.length)&&(a=e.length);for(var t=0,i=Array(a);t<a;t++)i[t]=e[t];return i}function _(e,a){if(!(e instanceof a))throw new TypeError("Cannot call a class as a function")}function S(e,a,t){return a&&function(e,a){for(var t=0;t<a.length;t++){var i=a[t];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,k(i.key),i)}}(e.prototype,a),Object.defineProperty(e,"prototype",{writable:!1}),e}function E(e,a){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=function(e,a){if(e){if("string"==typeof e)return T(e,a);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?T(e,a):void 0}}(e))||a){t&&(e=t);var i=0,n=function(){};return{s:n,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,r=!0,p=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return r=e.done,e},e:function(e){p=!0,o=e},f:function(){try{r||null==t.return||t.return()}finally{if(p)throw o}}}}function k(e){var a=function(e,a){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var i=t.call(e,a);if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof a?a:a+""}function N(e){return N="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},N(e)}function D(e,a,t){Object.defineProperty(e,a,{value:t,writable:!0,configurable:!0,enumerable:!1})}function A(e){try{return!0===e()}catch(e){return!1}}A(function(){return 1===Buffer.from("a").length&&Buffer.isBuffer(Buffer.from("a"))})||D(Buffer,"from",function(e,a,t){if("string"==typeof e)return new Buffer(e,a||"utf8");if(e&&"object"===N(e)&&"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer){var i=a||0,n=void 0===t?e.byteLength-i:t,o=new Buffer(n);return function(e,a){for(var t=0;t<e.length;t++)a[t]=e[t]}(new Uint8Array(e,i,n),o),o}return e&&"object"===N(e)&&e.buffer&&"number"==typeof e.byteLength&&ArrayBuffer.isView&&ArrayBuffer.isView(e)?Buffer.from(e.buffer,e.byteOffset,e.byteLength):new Buffer(e)}),A(function(){return 2===Buffer.alloc(2).length&&0===Buffer.alloc(2)[0]})||D(Buffer,"alloc",function(e,a,t){var i=new Buffer(e);return i.fill(void 0===a?0:a,t),i}),A(function(){return"function"==typeof Buffer.allocUnsafe&&2===Buffer.allocUnsafe(2).length})||D(Buffer,"allocUnsafe",function(e){return new Buffer(e)}),A(function(){return[NaN].includes(NaN)&&[1,2].includes(2)&&![1].includes(3)})||D(Array.prototype,"includes",function(e,a){for(var t=this.length>>>0,i=a>>>0;i<t;i++){var n=this[i];if(n===e||n!=n&&e!=e)return!0}return!1}),A(function(){return"function"==typeof Object.values&&1===Object.values({a:1})[0]})||D(Object,"values",function(e){for(var a=Object.keys(e),t=[],i=0;i<a.length;i++)t.push(e[a[i]]);return t}),A(function(){return"00a"==="a".padStart(3,"0")})||D(String.prototype,"padStart",function(e,a){var t=String(this),i=void 0===a?" ":String(a),n=e-t.length;if(n<=0||""===i)return t;for(var o="";o.length<n;)o+=i;return o.slice(0,n)+t}),A(function(){return"a00"==="a".padEnd(3,"0")})||D(String.prototype,"padEnd",function(e,a){var t=String(this),i=void 0===a?" ":String(a),n=e-t.length;if(n<=0||""===i)return t;for(var o="";o.length<n;)o+=i;return t+o.slice(0,n)}),A(function(){return 2===Array.from(new Set([1,2])).length})||D(Array,"from",function(e){var a=[];if(e&&"function"==typeof e.forEach&&!Array.isArray(e))return e.forEach(function(e){a.push(e)}),a;for(var t=e.length>>>0,i=0;i<t;i++)a.push(e[i]);return a});var O=e;"function"!=typeof O.URL&&(D(O,"URL",function e(a,t){if(!(this instanceof e))return new e(a,t);var i=String(a);void 0!==t&&(i=O.resolve(String(t),i));var n=O.parse(i);if(!n.protocol||!n.host)throw new TypeError("Invalid URL");this.href=n.href,this.protocol=n.protocol,this.host=n.host,this.hostname=n.hostname,this.port=n.port||"",this.pathname=n.pathname||"/",this.search=n.search||"",this.hash=n.hash||""}),D(O.URL.prototype,"toString",function(){return this.href}),D(O.URL.prototype,"toJSON",function(){return this.href}));var j={exports:{}},C={exports:{}},P=a.relative,I=function(e){if(!e)throw new TypeError("argument namespace is required");var a=R(H()[1])[0];function t(e){F.call(t,e)}return t._file=a,t._ignored=function(e){if(process.noDeprecation)return!0;return L(process.env.NO_DEPRECATION||"",e)}(e),t._namespace=e,t._traced=function(e){if(process.traceDeprecation)return!0;return L(process.env.TRACE_DEPRECATION||"",e)}(e),t._warned=Object.create(null),t.function=W,t.property=G,t},V=process.cwd();function L(e,a){for(var t=e.split(/[ ,]+/),i=String(a).toLowerCase(),n=0;n<t.length;n++){var o=t[n];if(o&&("*"===o||o.toLowerCase()===i))return!0}return!1}function B(e){var a=this.name+": "+this.namespace;this.message&&(a+=" deprecated "+this.message);for(var t=0;t<e.length;t++)a+="\n at "+e[t].toString();return a}function F(e,a){var t=function(e,a){return("function"!=typeof e.listenerCount?e.listeners(a).length:e.listenerCount(a))>0}(process,"deprecation");if(t||!this._ignored){var i,n,o,r,p=0,s=!1,d=H(),c=this._file;for(a?(r=a,(o=R(d[1])).name=r.name,c=o[0]):o=r=R(d[p=2]);p<d.length;p++)if((n=(i=R(d[p]))[0])===c)s=!0;else if(n===this._file)c=this._file;else if(s)break;var l=i?r.join(":")+"__"+i.join(":"):void 0;if(void 0===l||!(l in this._warned)){this._warned[l]=!0;var u=e;if(u||(u=o!==r&&o.name?q(o):q(r)),t){var m=Y(this._namespace,u,d.slice(p));process.emit("deprecation",m)}else{var f=(process.stderr.isTTY?M:U).call(this,u,i,d.slice(p));process.stderr.write(f+"\n","utf8")}}}}function R(e){var a=e.getFileName()||"<anonymous>",t=e.getLineNumber(),i=e.getColumnNumber();e.isEval()&&(a=e.getEvalOrigin()+", "+a);var n=[a,t,i];return n.callSite=e,n.name=e.getFunctionName(),n}function q(e){var a=e.callSite,t=e.name;t||(t="<anonymous@"+z(e)+">");var i=a.getThis(),n=i&&a.getTypeName();return"Object"===n&&(n=void 0),"Function"===n&&(n=i.name||n),n&&a.getMethodName()?n+"."+t:t}function U(e,a,t){var i=(new Date).toUTCString()+" "+this._namespace+" deprecated "+e;if(this._traced){for(var n=0;n<t.length;n++)i+="\n at "+t[n].toString();return i}return a&&(i+=" at "+z(a)),i}function M(e,a,t){var i="[36;1m"+this._namespace+"[22;39m [33;1mdeprecated[22;39m [0m"+e+"[39m";if(this._traced){for(var n=0;n<t.length;n++)i+="\n [36mat "+t[n].toString()+"[39m";return i}return a&&(i+=" [36m"+z(a)+"[39m"),i}function z(e){return P(V,e[0])+":"+e[1]+":"+e[2]}function H(){var e=Error.stackTraceLimit,a={},t=Error.prepareStackTrace;Error.prepareStackTrace=$,Error.stackTraceLimit=Math.max(10,e),Error.captureStackTrace(a);var i=a.stack.slice(1);return Error.prepareStackTrace=t,Error.stackTraceLimit=e,i}function $(e,a){return a}function W(e,a){if("function"!=typeof e)throw new TypeError("argument fn must be a function");var t=function(e){for(var a="",t=0;t<e;t++)a+=", arg"+t;return a.substr(2)}(e.length),i=R(H()[1]);return i.name=e.name,new Function("fn","log","deprecate","message","site",'"use strict"\nreturn function ('+t+") {log.call(deprecate, message, site)\nreturn fn.apply(this, arguments)\n}")(e,F,this,a,i)}function G(e,a,t){if(!e||"object"!==N(e)&&"function"!=typeof e)throw new TypeError("argument obj must be object");var i=Object.getOwnPropertyDescriptor(e,a);if(!i)throw new TypeError("must call property on owner object");if(!i.configurable)throw new TypeError("property must be configurable");var n=this,o=R(H()[1]);o.name=a,"value"in i&&(i=function(e,a){var t=Object.getOwnPropertyDescriptor(e,a),i=t.value;return t.get=function(){return i},t.writable&&(t.set=function(e){return i=e}),delete t.value,delete t.writable,Object.defineProperty(e,a,t),t}(e,a));var r=i.get,p=i.set;"function"==typeof r&&(i.get=function(){return F.call(n,t,o),r.apply(this,arguments)}),"function"==typeof p&&(i.set=function(){return F.call(n,t,o),p.apply(this,arguments)}),Object.defineProperty(e,a,i)}function Y(e,a,t){var i,n=new Error;return Object.defineProperty(n,"constructor",{value:Y}),Object.defineProperty(n,"message",{configurable:!0,enumerable:!1,value:a,writable:!0}),Object.defineProperty(n,"name",{enumerable:!1,configurable:!0,value:"DeprecationError",writable:!0}),Object.defineProperty(n,"namespace",{configurable:!0,enumerable:!1,value:e,writable:!0}),Object.defineProperty(n,"stack",{configurable:!0,enumerable:!1,get:function(){return void 0!==i?i:i=B.call(this,t)},set:function(e){i=e}}),n}var X,K={exports:{}};
|
|
1
|
+
"use strict";var e=require("url"),a=require("path"),t=require("tty"),i=require("util"),n=require("fs"),o=require("net"),r=require("events"),p=require("stream"),s=require("zlib"),d=require("buffer"),c=require("string_decoder"),l=require("querystring"),u=require("http"),m=require("crypto"),f=require("punycode"),h=require("https"),v=require("os"),g=require("dgram"),b=require("timers"),y=require("assert"),x="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function w(e){if(e.__esModule)return e;var a=e.default;if("function"==typeof a){var t=function e(){return this instanceof e?(typeof Reflect!=="undefined"&&Reflect.construct?Reflect.construct(a,arguments,this.constructor):function(){var r=a.apply(this,arguments);return r&&typeof r==="object"?(Object.setPrototypeOf(r,Object.getPrototypeOf(this)),r):this}.apply(this,arguments)):a.apply(this,arguments)};t.prototype=a.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(e).forEach(function(a){var i=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(t,a,i.get?i:{enumerable:!0,get:function(){return e[a]}})}),t}function T(e,a){(null==a||a>e.length)&&(a=e.length);for(var t=0,i=Array(a);t<a;t++)i[t]=e[t];return i}function _(e,a){if(!(e instanceof a))throw new TypeError("Cannot call a class as a function")}function S(e,a,t){return a&&function(e,a){for(var t=0;t<a.length;t++){var i=a[t];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,k(i.key),i)}}(e.prototype,a),Object.defineProperty(e,"prototype",{writable:!1}),e}function E(e,a){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=function(e,a){if(e){if("string"==typeof e)return T(e,a);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?T(e,a):void 0}}(e))||a){t&&(e=t);var i=0,n=function(){};return{s:n,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,r=!0,p=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return r=e.done,e},e:function(e){p=!0,o=e},f:function(){try{r||null==t.return||t.return()}finally{if(p)throw o}}}}function k(e){var a=function(e,a){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var i=t.call(e,a);if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof a?a:a+""}function N(e){return N="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},N(e)}function D(e,a,t){Object.defineProperty(e,a,{value:t,writable:!0,configurable:!0,enumerable:!1})}function A(e){try{return!0===e()}catch(e){return!1}}A(function(){return 1===Buffer.from("a").length&&Buffer.isBuffer(Buffer.from("a"))})||D(Buffer,"from",function(e,a,t){if("string"==typeof e)return new Buffer(e,a||"utf8");if(e&&"object"===N(e)&&"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer){var i=a||0,n=void 0===t?e.byteLength-i:t,o=new Buffer(n);return function(e,a){for(var t=0;t<e.length;t++)a[t]=e[t]}(new Uint8Array(e,i,n),o),o}return e&&"object"===N(e)&&e.buffer&&"number"==typeof e.byteLength&&ArrayBuffer.isView&&ArrayBuffer.isView(e)?Buffer.from(e.buffer,e.byteOffset,e.byteLength):new Buffer(e)}),A(function(){return 2===Buffer.alloc(2).length&&0===Buffer.alloc(2)[0]})||D(Buffer,"alloc",function(e,a,t){var i=new Buffer(e);return i.fill(void 0===a?0:a,t),i}),A(function(){return"function"==typeof Buffer.allocUnsafe&&2===Buffer.allocUnsafe(2).length})||D(Buffer,"allocUnsafe",function(e){return new Buffer(e)}),A(function(){return[NaN].includes(NaN)&&[1,2].includes(2)&&![1].includes(3)})||D(Array.prototype,"includes",function(e,a){for(var t=this.length>>>0,i=a>>>0;i<t;i++){var n=this[i];if(n===e||n!=n&&e!=e)return!0}return!1}),A(function(){return"function"==typeof Object.values&&1===Object.values({a:1})[0]})||D(Object,"values",function(e){for(var a=Object.keys(e),t=[],i=0;i<a.length;i++)t.push(e[a[i]]);return t}),A(function(){return"00a"==="a".padStart(3,"0")})||D(String.prototype,"padStart",function(e,a){var t=String(this),i=void 0===a?" ":String(a),n=e-t.length;if(n<=0||""===i)return t;for(var o="";o.length<n;)o+=i;return o.slice(0,n)+t}),A(function(){return"a00"==="a".padEnd(3,"0")})||D(String.prototype,"padEnd",function(e,a){var t=String(this),i=void 0===a?" ":String(a),n=e-t.length;if(n<=0||""===i)return t;for(var o="";o.length<n;)o+=i;return t+o.slice(0,n)}),A(function(){return 2===Array.from(new Set([1,2])).length})||D(Array,"from",function(e){var a=[];if(e&&"function"==typeof e.forEach&&!Array.isArray(e))return e.forEach(function(e){a.push(e)}),a;for(var t=e.length>>>0,i=0;i<t;i++)a.push(e[i]);return a});var O=e;"function"!=typeof O.URL&&(D(O,"URL",function e(a,t){if(!(this instanceof e))return new e(a,t);var i=String(a);void 0!==t&&(i=O.resolve(String(t),i));var n=O.parse(i);if(!n.protocol||!n.host)throw new TypeError("Invalid URL");this.href=n.href,this.protocol=n.protocol,this.host=n.host,this.hostname=n.hostname,this.port=n.port||"",this.pathname=n.pathname||"/",this.search=n.search||"",this.hash=n.hash||""}),D(O.URL.prototype,"toString",function(){return this.href}),D(O.URL.prototype,"toJSON",function(){return this.href}));var j={exports:{}},C={exports:{}},P=a.relative,I=function(e){if(!e)throw new TypeError("argument namespace is required");var a=R(H()[1])[0];function t(e){F.call(t,e)}return t._file=a,t._ignored=function(e){if(process.noDeprecation)return!0;return L(process.env.NO_DEPRECATION||"",e)}(e),t._namespace=e,t._traced=function(e){if(process.traceDeprecation)return!0;return L(process.env.TRACE_DEPRECATION||"",e)}(e),t._warned=Object.create(null),t.function=W,t.property=G,t},V=process.cwd();function L(e,a){for(var t=e.split(/[ ,]+/),i=String(a).toLowerCase(),n=0;n<t.length;n++){var o=t[n];if(o&&("*"===o||o.toLowerCase()===i))return!0}return!1}function B(e){var a=this.name+": "+this.namespace;this.message&&(a+=" deprecated "+this.message);for(var t=0;t<e.length;t++)a+="\n at "+e[t].toString();return a}function F(e,a){var t=function(e,a){return("function"!=typeof e.listenerCount?e.listeners(a).length:e.listenerCount(a))>0}(process,"deprecation");if(t||!this._ignored){var i,n,o,r,p=0,s=!1,d=H(),c=this._file;for(a?(r=a,(o=R(d[1])).name=r.name,c=o[0]):o=r=R(d[p=2]);p<d.length;p++)if((n=(i=R(d[p]))[0])===c)s=!0;else if(n===this._file)c=this._file;else if(s)break;var l=i?r.join(":")+"__"+i.join(":"):void 0;if(void 0===l||!(l in this._warned)){this._warned[l]=!0;var u=e;if(u||(u=o!==r&&o.name?q(o):q(r)),t){var m=Y(this._namespace,u,d.slice(p));process.emit("deprecation",m)}else{var f=(process.stderr.isTTY?M:U).call(this,u,i,d.slice(p));process.stderr.write(f+"\n","utf8")}}}}function R(e){var a=e.getFileName()||"<anonymous>",t=e.getLineNumber(),i=e.getColumnNumber();e.isEval()&&(a=e.getEvalOrigin()+", "+a);var n=[a,t,i];return n.callSite=e,n.name=e.getFunctionName(),n}function q(e){var a=e.callSite,t=e.name;t||(t="<anonymous@"+z(e)+">");var i=a.getThis(),n=i&&a.getTypeName();return"Object"===n&&(n=void 0),"Function"===n&&(n=i.name||n),n&&a.getMethodName()?n+"."+t:t}function U(e,a,t){var i=(new Date).toUTCString()+" "+this._namespace+" deprecated "+e;if(this._traced){for(var n=0;n<t.length;n++)i+="\n at "+t[n].toString();return i}return a&&(i+=" at "+z(a)),i}function M(e,a,t){var i="[36;1m"+this._namespace+"[22;39m [33;1mdeprecated[22;39m [0m"+e+"[39m";if(this._traced){for(var n=0;n<t.length;n++)i+="\n [36mat "+t[n].toString()+"[39m";return i}return a&&(i+=" [36m"+z(a)+"[39m"),i}function z(e){return P(V,e[0])+":"+e[1]+":"+e[2]}function H(){var e=Error.stackTraceLimit,a={},t=Error.prepareStackTrace;Error.prepareStackTrace=$,Error.stackTraceLimit=Math.max(10,e),Error.captureStackTrace(a);var i=a.stack.slice(1);return Error.prepareStackTrace=t,Error.stackTraceLimit=e,i}function $(e,a){return a}function W(e,a){if("function"!=typeof e)throw new TypeError("argument fn must be a function");var t=function(e){for(var a="",t=0;t<e;t++)a+=", arg"+t;return a.substr(2)}(e.length),i=R(H()[1]);return i.name=e.name,new Function("fn","log","deprecate","message","site",'"use strict"\nreturn function ('+t+") {log.call(deprecate, message, site)\nreturn fn.apply(this, arguments)\n}")(e,F,this,a,i)}function G(e,a,t){if(!e||"object"!==N(e)&&"function"!=typeof e)throw new TypeError("argument obj must be object");var i=Object.getOwnPropertyDescriptor(e,a);if(!i)throw new TypeError("must call property on owner object");if(!i.configurable)throw new TypeError("property must be configurable");var n=this,o=R(H()[1]);o.name=a,"value"in i&&(i=function(e,a){var t=Object.getOwnPropertyDescriptor(e,a),i=t.value;return t.get=function(){return i},t.writable&&(t.set=function(e){return i=e}),delete t.value,delete t.writable,Object.defineProperty(e,a,t),t}(e,a));var r=i.get,p=i.set;"function"==typeof r&&(i.get=function(){return F.call(n,t,o),r.apply(this,arguments)}),"function"==typeof p&&(i.set=function(){return F.call(n,t,o),p.apply(this,arguments)}),Object.defineProperty(e,a,i)}function Y(e,a,t){var i,n=new Error;return Object.defineProperty(n,"constructor",{value:Y}),Object.defineProperty(n,"message",{configurable:!0,enumerable:!1,value:a,writable:!0}),Object.defineProperty(n,"name",{enumerable:!1,configurable:!0,value:"DeprecationError",writable:!0}),Object.defineProperty(n,"namespace",{configurable:!0,enumerable:!1,value:e,writable:!0}),Object.defineProperty(n,"stack",{configurable:!0,enumerable:!1,get:function(){return void 0!==i?i:i=B.call(this,t)},set:function(e){i=e}}),n}var X,K={exports:{}};
|
|
2
2
|
/*!
|
|
3
3
|
* bytes
|
|
4
4
|
* Copyright(c) 2012-2014 TJ Holowaychuk
|
|
@@ -236,4 +236,4 @@ var t=n,i=a,o=Am,r=!1,p=Om,s="locals",d=["delimiter","scope","context","debug","
|
|
|
236
236
|
object-assign
|
|
237
237
|
(c) Sindre Sorhus
|
|
238
238
|
@license MIT
|
|
239
|
-
*/var $h=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var a={},t=0;t<10;t++)a["_"+String.fromCharCode(t)]=t;if("0123456789"!==Object.getOwnPropertyNames(a).map(function(e){return a[e]}).join(""))return!1;var i={};return"abcdefghijklmnopqrst".split("").forEach(function(e){i[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},i)).join("")}catch(e){return!1}}()?Object.assign:function(e,a){for(var t,i,n=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),o=1;o<arguments.length;o++){for(var r in t=Object(arguments[o]))zh.call(t,r)&&(n[r]=t[r]);if(Mh){i=Mh(t);for(var p=0;p<i.length;p++)Hh.call(t,i[p])&&(n[i[p]]=t[i[p]])}}return n};!function(){var e=$h,a=Id,t={origin:"*",methods:"GET,HEAD,PUT,PATCH,POST,DELETE",preflightContinue:!1,optionsSuccessStatus:204};function i(e){return"string"==typeof e||e instanceof String}function n(e,a){if(Array.isArray(a)){for(var t=0;t<a.length;++t)if(n(e,a[t]))return!0;return!1}return i(a)?e===a:a instanceof RegExp?a.test(e):!!a}function o(e,a){var t,o=a.headers.origin,r=[];return e.origin&&"*"!==e.origin?i(e.origin)?(r.push([{key:"Access-Control-Allow-Origin",value:e.origin}]),r.push([{key:"Vary",value:"Origin"}])):(t=n(o,e.origin),r.push([{key:"Access-Control-Allow-Origin",value:!!t&&o}]),r.push([{key:"Vary",value:"Origin"}])):r.push([{key:"Access-Control-Allow-Origin",value:"*"}]),r}function r(e){return!0===e.credentials?{key:"Access-Control-Allow-Credentials",value:"true"}:null}function p(e){var a=e.exposedHeaders;return a?(a.join&&(a=a.join(",")),a&&a.length?{key:"Access-Control-Expose-Headers",value:a}:null):null}function s(e,t){for(var i=0,n=e.length;i<n;i++){var o=e[i];o&&(Array.isArray(o)?s(o,t):"Vary"===o.key&&o.value?a(t,o.value):o.value&&t.setHeader(o.key,o.value))}}Uh.exports=function(a){var i=null;return i="function"==typeof a?a:function(e,t){t(null,a)},function(a,n,d){i(a,function(i,c){if(i)d(i);else{var l=e({},t,c),u=null;l.origin&&"function"==typeof l.origin?u=l.origin:l.origin&&(u=function(e,a){a(null,l.origin)}),u?u(a.headers.origin,function(e,t){e||!t?d(e):(l.origin=t,function(e,a,t,i){var n=[];"OPTIONS"===(a.method&&a.method.toUpperCase&&a.method.toUpperCase())?(n.push(o(e,a)),n.push(r(e)),n.push(function(e){var a=e.methods;return a.join&&(a=e.methods.join(",")),{key:"Access-Control-Allow-Methods",value:a}}(e)),n.push(function(e,a){var t=e.allowedHeaders||e.headers,i=[];return t?t.join&&(t=t.join(",")):(t=a.headers["access-control-request-headers"],i.push([{key:"Vary",value:"Access-Control-Request-Headers"}])),t&&t.length&&i.push([{key:"Access-Control-Allow-Headers",value:t}]),i}(e,a)),n.push(function(e){var a=("number"==typeof e.maxAge||e.maxAge)&&e.maxAge.toString();return a&&a.length?{key:"Access-Control-Max-Age",value:a}:null}(e)),n.push(p(e)),s(n,t),e.preflightContinue?i():(t.statusCode=e.optionsSuccessStatus,t.setHeader("Content-Length","0"),t.end())):(n.push(o(e,a)),n.push(r(e)),n.push(p(e)),s(n,t),i())}(l,a,n,d))}):d()}})}}}();var Wh=Uh.exports,Gh={create:function(e){return new Jh(e)}},Yh=i,Xh=y,Kh=function(){};function Jh(e){var a="number"==typeof(e=e||{}).count?e.count:-1,t=!1!==e.failFast;this._async=new Qh(a,t)}function Zh(e){this.value=e}function Qh(e,a){this.count=e,this.failFast=a,this.index=0,this.pending=0,this.canceled=!1,this.next=null,this.error=null,this.results={}}Object.defineProperty(Jh.prototype,"count",{get:function(){return this._async.count},enumerable:!0}),Jh.prototype.latch=function e(a,t){return"string"!=typeof a&&(t=a,a=null),this._async.makeCallback(e,a,t)},Jh.prototype.val=function(e){return new Zh(e)},Jh.prototype.await=function(e){this._async.await(e),this._async.await=Kh},Qh.prototype.await=function(e){function a(a,t){e(a,t,new Jh)}this.error?a(this.error,null):0===this.pending&&this.count<=0?a(null,this.results):this.next=a},Qh.prototype.makeCallback=function(e,a,t){var i=N(t);if(Xh("undefined"!==i||"number"!==i||"object"!==i,"An argument `mapping` must be a number or an object, if specified."),0===this.count)return Kh;this.count>0&&this.count--,this.pending++;var n=this.index++,o=function(e){var a=Error.prepareStackTrace,t=Error.stackTraceLimit;Error.prepareStackTrace=p,Error.stackTraceLimit=1;var i={};Error.captureStackTrace(i,e);var n=i.stack;return Error.prepareStackTrace=a,Error.stackTraceLimit=t,Yh.format("%s:%d:%d",n.getFileName(),n.getLineNumber(),n.getColumnNumber())}(e),r=this;return function(e){var i=r.next;if(r.pending--,!r.canceled){if(e instanceof Error&&("gate_location"in e||(e.gate_location=o),r.failFast))return r.canceled=!0,void(i?(r.next=Kh,i(e,null)):r.error=e);var p=function(e,a){return"number"==typeof e?a[e]:e?Object.keys(e).reduce(function(t,i){var n=e[i];return t[i]="number"==typeof n?a[n]:n instanceof Zh?n.value:n,t},{}):Array.prototype.slice.call(a)}(t,arguments);null===a?r.results[n]=p:r.results[a]=p,0===r.pending&&r.count<=0&&i&&(r.next=Kh,i(null,r.results))}};function p(){return arguments[1][0]}};var ev=cm,av=Nm,tv=Dm,iv=v,nv=i,ov=r,rv=u,pv=e,sv=Cm,dv=Wh,cv=Gh,lv=tv.compile('<?xml version="1.0"?>\n<root xmlns="urn:schemas-upnp-org:device-1-0">\n <specVersion>\n <major>1</major>\n <minor>0</minor>\n </specVersion>\n <URLBase><%=URLBase%></URLBase>\n <device>\n <deviceType>urn:dial-multiscreen-org:device:dial:1</deviceType>\n <friendlyName><%=friendlyName%></friendlyName>\n <manufacturer><%=manufacturer%></manufacturer>\n <modelName><%=modelName%></modelName>\n <UDN>uuid:<%=uuid%></UDN>\n <iconList>\n <icon>\n <mimetype>image/png</mimetype>\n <width>144</width>\n <height>144</height>\n <depth>32</depth>\n <url>/img/icon.png</url>\n </icon>\n </iconList>\n <serviceList>\n <service>\n <serviceType>urn:dial-multiscreen-org:service:dial:1</serviceType>\n <serviceId>urn:dial-multiscreen-org:serviceId:dial</serviceId>\n <controlURL>/ssdp/notfound</controlURL>\n <eventSubURL>/ssdp/notfound</eventSubURL>\n <SCPDURL>/ssdp/notfound</SCPDURL>\n </service>\n </serviceList>\n </device>\n</root>\n'),uv=tv.compile('<?xml version="1.0" encoding="UTF-8"?>\n<%\nvar ns = "";\nfor(var i in namespaces){\n ns = ns + \' xmlns:\'+i+\'="\'+namespaces[i]+\'"\';\n}\n%>\n<service xmlns="urn:dial-multiscreen-org:schemas:dial" <%-ns%> dialVer="1.7">\n <name><%=name%></name>\n <options allowStop="<%=allowStop%>"/>\n <state><%=state%></state>\n <% if(typeof rel != "undefined" && typeof href != "undefined" && href){ %>\n <link rel="<%=rel%>" href="<%=href%>" />\n <% } %>\n <% if(typeof additionalData != "undefined"){ %>\n <additionalData>\n <% for(var i in additionalData){ %>\n <<%=i%>><%=additionalData[i]%></<%=i%>>\n <% } %>\n </additionalData>\n <% } %>\n</service>\n'),mv=iv.type()+"/"+iv.release()+" UPnP/1.1 famium/0.0.1",fv=function(){var e=this,a=e.prefix,t=e.ssdpPeer,i=["urn:dial-multiscreen-org:service:dial:1","urn:dial-multiscreen-org:device:dial:1","upnp:rootdevice","ssdp:all","uuid:"+e.uuid],n=e.expressApp;n.use(a,function(e,a,t){e.is("text/plain")||e.is("text/xml")||e.is("text/json")||e.is("application/xml")||e.is("application/json")||e.is("application/x-www-form-urlencoded")?(e.text="",e.length=0,e.setEncoding("utf8"),e.on("data",function(a){e.text+=a,e.length+=a.length}),e.on("end",t)):t()}),n.use(a+"/apps",dv(e.corsOptionsAppsDelegate)),n.use(a+"/ssdp",dv(e.corsOptionsSsdp)),n.get(a+"/apps",function(e,a){a.sendStatus(204)}),n.get(a+"/apps/:appName",function(a,t){a.protocol,a.hostname||a.ip||e.host,e.port;var i=a.params.appName,n=e.delegate.getApp.call(a,i);if(n){var o=n.state||n.pid&&"running"||"stopped",r=uv({name:i,state:o,allowStop:1==n.allowStop,rel:"run",href:n.pid?n.pid:null,additionalData:n.additionalData,namespaces:n.namespaces||{}});t.type("application/xml"),t.send(r)}else t.sendStatus(404)}),n.post(a+"/apps/:appName",function(t,i){var n=t.protocol+"://"+(t.hostname||t.ip||e.host)+":"+e.port+a,o=t.params.appName,r=e.delegate.getApp.call(this,o);if(r)if(t.length&&t.length>e.maxContentLength)i.sendStatus(413);else{var p=r.state||r.pid&&"running"||"stopped";e.delegate.launchApp.call(t,o,t.text||null,function(e,a){a?i.sendStatus(503):e?(i.setHeader("LOCATION",n+"/apps/"+o+"/"+e),i.sendStatus("stopped"==p?201:200)):i.sendStatus("stopped"==p?201:200)})}else i.sendStatus(404)}),n.post(a+"/apps/:appName/dial_data",function(a,t){a.protocol,a.hostname||a.ip||e.host,e.port;var i=a.params.appName;e.delegate.getApp.call(a,i)?a.length&&a.length>e.maxContentLength?t.sendStatus(413):t.sendStatus(501):t.sendStatus(404)}),n.delete(a+"/apps/:appName/:pid",function(a,t){a.protocol,a.hostname||a.ip||e.host,e.port;var i=a.params.appName,n=a.params.pid,o=e.delegate.getApp.call(a,i);o?o.allowStop?n?e.delegate.stopApp.call(a,i,n,function(e){t.sendStatus(e?200:400)}):t.sendStatus(400):t.sendStatus(405):t.sendStatus(404)}),n.get(a+"/ssdp/device-desc.xml",function(t,i){var n=t.protocol+"://"+(t.hostname||t.ip||e.host)+":"+e.port+a,o=lv({URLBase:n,friendlyName:e.friendlyName,manufacturer:e.manufacturer,modelName:e.modelName,uuid:e.uuid});i.setHeader("Content-Type","application/xml"),i.setHeader("Application-URL",n+"/apps"),i.send(o)}),n.get(a+"/ssdp/notfound",function(e,a){a.sendStatus(404)});var o="http://{{networkInterfaceAddress}}:"+e.port+a+"/ssdp/device-desc.xml";t.on("ready",function(){for(var a=0;a<i.length;a++){var n=i[a];t.alive(hv({NT:n,USN:"uuid:"+e.uuid+"::"+n,SERVER:mv,LOCATION:o},e.extraHeaders))}e.emit("ready")}).on("search",function(a,n){-1!=i.indexOf(a.ST)&&t.reply(hv({LOCATION:o,ST:a.ST,"CONFIGID.UPNP.ORG":7337,"BOOTID.UPNP.ORG":7337,SERVER:mv,USN:"uuid:"+e.uuid+"::"+a.ST},e.extraHeaders),n)}).on("close",function(){e.emit("stop")})},hv=function(e,a){for(var t in a){var i=e[t];e[t]=i||a[t]}return e},vv=function(e){this.expressApp=e.expressApp||null,this.prefix=e.prefix||"",this.port=e.port||null,this.host=e.host||null,this.uuid=e.uuid||ev.v4(),this.friendlyName=e.friendlyName||iv.hostname()||"unknown",this.manufacturer=e.manufacturer||"unknown manufacturer",this.modelName=e.modelName||"unknown model",this.maxContentLength=Math.max(parseInt(e.maxContentLength)||4096,4096),this.extraHeaders=function(e){var a={};if("object"==N(e))for(var t in e){var i=e[t];"number"!=typeof i&&"string"!=typeof i&&"boolean"!=typeof i||(a[t]=i)}return a}(e.extraHeaders),this.delegate={},this.delegate.getApp=e.delegate&&"function"==typeof e.delegate.getApp?e.delegate.getApp:null,this.delegate.launchApp=e.delegate&&"function"==typeof e.delegate.launchApp?e.delegate.launchApp:null,this.delegate.stopApp=e.delegate&&"function"==typeof e.delegate.stopApp?e.delegate.stopApp:null;var a=e.corsAllowOrigins||!1;this.corsOptionsSsdp={origin:a,methods:["GET","POST","DELETE","OPTIONS"],exposedHeaders:["Location"]};var t={origin:a,methods:["GET","POST","DELETE","OPTIONS"]};this.corsOptionsAppsDelegate=function(e,a){var i=e.header("origin");i?/^(http|https|file):/i.test(i)?a(null,t):a(null,{origin:!0}):a(null,{origin:!1})},this.ssdpPeer=av.createPeer({bindToInterfaces:e.bindToInterfaces,bindToAddresses:e.bindToAddresses}),fv.call(this)};nv.inherits(vv,ov.EventEmitter),vv.prototype.start=function(){this.ssdpPeer.start()},vv.prototype.stop=function(){for(var e=this,a=e.prefix,t=["urn:dial-multiscreen-org:service:dial:1","urn:dial-multiscreen-org:device:dial:1","upnp:rootdevice","ssdp:all","uuid:"+e.uuid],i="http://{{networkInterfaceAddress}}:"+e.port+a+"/ssdp/device-desc.xml",n=e.ssdpPeer,o=cv.create(),r=0;r<t.length;r++){var p=t[r];n.byebye(hv({NT:p,USN:"uuid:"+e.uuid+"::"+p,SERVER:mv,LOCATION:i},e.extraHeaders),o.latch())}o.await(function(){e.ssdpPeer.close()})};var gv=function(e){var a=["urn:dial-multiscreen-org:service:dial:1","urn:dial-multiscreen-org:device:dial:1"],t=this,i={};this.ssdpPeer=new av.createPeer,this.ssdpPeer.on("ready",function(){t.ssdpPeer.search({ST:"urn:dial-multiscreen-org:device:dial:1"}),t.ssdpPeer.search({ST:"urn:dial-multiscreen-org:service:dial:1"}),t.emit("ready")}).on("found",function(e,a){var n=e.LOCATION;n&&!i[n]&&(i[n]=e,t.emit("found",n,e))}).on("notify",function(e,n){var o=e.LOCATION,r=e.NTS,p=e.NT;if(a.indexOf(p)>=0)if(o&&"ssdp:alive"==r&&!i[o])i[o]=e,t.emit("found",o,e);else if(o&&"ssdp:byebye"==r&&i[o]){var s=i[o];delete i[o],t.emit("disappear",o,s)}}).on("close",function(){t.emit("stop")});var n=function(){this.ssdpPeer.start()},o=function(){i={},this.ssdpPeer.search({ST:"urn:dial-multiscreen-org:device:dial:1"}),this.ssdpPeer.search({ST:"urn:dial-multiscreen-org:service:dial:1"})},r=function(){this.ssdpPeer.close()},p=function(e,a){rv.get(e,function(t){var i=t.headers["application-url"];if(200==t.statusCode&&i){i.lastIndexOf("/")==i.length-1&&(i=i.substr(0,i.length-1));var n="";t.setEncoding("utf8"),t.on("data",function(e){n+=e}),t.on("end",function(){sv.parseString(n,{trim:!0,explicitArray:!1},function(t,n){if(t)a(null,t);else try{var o=n.root.device;o.descriptionUrl=e,o.applicationUrl=i;var r=new bv(o);a(r)}catch(t){a(null,t)}})})}else{var o=new Error("Cannot get device description from "+e+" or Application-URL header is not set");a&&a(null,o)}}).on("error",function(e){a&&a(null,e)})};Object.defineProperty(this,"start",{get:function(){return n}}),Object.defineProperty(this,"refresh",{get:function(){return o}}),Object.defineProperty(this,"stop",{get:function(){return r}}),Object.defineProperty(this,"getDialDevice",{get:function(){return p}})};nv.inherits(gv,ov.EventEmitter);var bv=function(e){if(this.descriptionUrl=e.descriptionUrl,this.applicationUrl=e.applicationUrl,this.deviceType=e.deviceType,this.friendlyName=e.friendlyName,this.manufacturer=e.manufacturer,this.modelName=e.modelName,this.UDN=e.UDN,this.icons=[],e.iconList instanceof Array)for(var a=0;a<e.iconList.length;a++){var t=e.iconList[a];t&&t.icon&&this.icons.push(t.icon)}else e.iconList&&e.iconList.icon&&this.icons.push(e.iconList.icon)};bv.prototype.getAppInfoXml=function(e,a){var t=this.applicationUrl&&e&&this.applicationUrl+"/"+e||null;if(t)rv.get(t,function(e){if(200==e.statusCode){var i="";e.setEncoding("utf8"),e.on("data",function(e){i+=e}),e.on("end",function(){a(i)})}else{var n=new Error("Cannot get app info from "+t);n.code=e.statusCode,a&&a(null,n)}}).on("error",function(e){a&&a(null,e)});else{var i=new Error("DIAL appName and DIAL Application-URL cannot be empty for getAppInfo");a&&a(null,i)}},bv.prototype.getAppInfo=function(e,a){this.getAppInfoXml(e,function(e,t){!e||t?a(null,t):sv.parseString(e,{trim:!0,explicitArray:!1,mergeAttrs:!0,explicitRoot:!1,tagNameProcessors:[function(e){return e=e.substr(e.indexOf(":")+1)}],attrNameProcessors:[function(e){return e=e.substr(e.indexOf(":")+1)}]},function(e,t){e?a(null,e):a(t)})})},bv.prototype.launchApp=function(e,a,t,i){var n=this.applicationUrl&&e&&this.applicationUrl+"/"+e||null;if(n){n=pv.parse(n);var o=a&&Buffer.byteLength(a)||0,r={host:n.hostname,port:n.port,path:n.path,method:"POST",headers:{"CONTENT-TYPE":t||'text/plain; charset="utf-8"',"CONTENT-LENGTH":o}},p=rv.request(r,function(e){var a="";e.setEncoding("utf8"),e.on("data",function(e){a+=e}),e.on("end",function(){if(e.statusCode>=400){var t=new Error("Cannot get app info from "+n);t.code=e.statusCode,i&&i(null,t)}else i&&i(a)})}).on("error",function(e){i&&i(null,e)});a&&p.write(a),p.end()}else{var s=new Error("DIAL appName and DIAL Application-URL cannot be empty for launchApp");i&&i(null,s)}},bv.prototype.stopApp=function(e,a,t){var i=this.applicationUrl&&e&&a&&this.applicationUrl+"/"+e+"/"+a||null;if(i){var n={host:(i=pv.parse(i)).hostname,port:i.port,path:i.path,method:"DELETE"},o=rv.request(n,function(e){t&&t(e.statusCode)}).on("error",function(e){t&&t(null,e)});o.end()}else{var r=new Error("DIAL appName, pid and DIAL Application-URL cannot be empty for stopApp");t&&t(null,r)}},$u.Server=vv,$u.Client=gv;var yv=$u,xv={defaults:{enableAdBlock:!0,blockPlayerAdTracking:!0,blockAdTelemetry:!0,blockViewStatsTelemetry:!1,removeLiveVideos:!1,removeTopLiveGames:!1,removeMostRelevant:!1,enableSponsorBlock:!0,enableSponsorBlockToasts:!0,sponsorBlockManualSkips:["intro","outro","filler"],enableSponsorBlockSponsor:!0,enableSponsorBlockIntro:!0,enableSponsorBlockOutro:!0,enableSponsorBlockInteraction:!0,enableSponsorBlockSelfPromo:!0,enableSponsorBlockPreview:!0,enableSponsorBlockMusicOfftopic:!0,enableSponsorBlockFiller:!1,enableSponsorBlockHighlight:!0,videoSpeed:1,preferredVideoQuality:"auto",enableDeArrowTitles:!0,enableDeArrowThumbnails:!0,routeColor:"#0f0f0f",routeBackgroundUrl:"",themePreset:"default",textTheme:"default",userAgentProfile:"auto",enableFixedUI:!1,enableHqThumbnails:!0,enableLongPress:!0,enableShorts:!0,dontCheckUpdateUntil:0,enableWhoIsWatchingMenu:!1,permanentlyEnableWhoIsWatchingMenu:!1,enableWhosWatchingMenuOnAppExit:!1,enableShowUserLanguage:!0,enableShowOtherLanguages:!1,showWelcomeToast:!0,enablePreviousNextButtons:!0,enableSuperThanksButton:!1,enableSpeedControlsButton:!0,enablePatchingVideoPlayer:!0,enableMPButton:!0,enableSwapMPWithPIP:!1,enablePreviews:!0,previewLengthSeconds:40,enableRemainingTime:!1,enablePauseOnBlur:!1,enableLowMemoryMode:!1,enableHideWatchedVideos:!1,hideWatchedVideosThreshold:80,hideWatchedVideosPages:[],enableHideEndScreenCards:!1,enableYouThereRenderer:!0,enableScreenDimming:!1,dimmingTimeout:60,dimmingOpacity:.5,enablePaidPromotionOverlay:!0,speedSettingsIncrement:.25,videoPreferredCodec:"any",enableAutoSubtitles:!0,autoSubtitleLanguage:"en",autoSubtitleAllowAuto:!0,launchToOnStartup:null,reloadHomeOnStartup:!0,disabledSidebarContents:[],disableChannelsOnSidebar:!1,enableUpdater:!0,autoFrameRate:!1,autoFrameRatePauseVideoFor:0,enableSigninReminder:!1,sortSubscriptionsByAlphabet:!1,enableReducedMotion:!1,enablePerformanceMode:!1,enablePanelShrink:!0,enableDeArrowPeek:!0,panelShrinkPercent:"60",clockMode:"off",clockFormat:"24h",clockPosition:"topRight",clockShowSeconds:!1,enableOnePressMode:!1,enableExperimentalResolution:!1,experimentalMaxResolution:"1440p"},ranges:{videoSpeed:[.05,5],hideWatchedVideosThreshold:[0,100],dimmingTimeout:[1,3600],dimmingOpacity:[0,1],speedSettingsIncrement:[.01,1],autoFrameRatePauseVideoFor:[0,1e4],previewLengthSeconds:[5,120],dontCheckUpdateUntil:[0,9007199254740991]},enums:{preferredVideoQuality:["auto","2160p","1440p","1080p","720p","480p","360p","240p","144p"],videoPreferredCodec:["any","vp9","av01","avc1"],themePreset:["default","black","darkGray","charcoal","navy","darkRed","darkGreen","darkPurple"],textTheme:["default","white","gray","red","blue","green","purple","yellow"],userAgentProfile:["auto","samsung","android"],experimentalMaxResolution:["1440p","2160p"],autoSubtitleLanguage:["en","hi","es","fr","de","pt","ja","ko","ru"],panelShrinkPercent:["50","60","70"],clockMode:["off","always","notPlaying"],clockFormat:["24h","12h","12hNoAmPm"],clockPosition:["topLeft","topRight","bottomLeft","bottomRight"]}};var wv={validateConfigValue:function(e,a){var t=xv.defaults;if(!Object.prototype.hasOwnProperty.call(t,e))return!1;var i=t[e];if(null===i)return null===a||"string"==typeof a;if(Array.isArray(i))return Array.isArray(a)&&a.every(function(e){return"string"==typeof e});if("number"==typeof i){if("number"!=typeof a||!isFinite(a))return!1;var n=xv.ranges[e];return!n||a>=n[0]&&a<=n[1]}if(N(a)!==N(i))return!1;var o=xv.enums[e];return(!o||-1!==o.indexOf(a))&&(!("routeColor"===e&&!/^#[0-9a-f]{6}$/i.test(a))&&!("routeBackgroundUrl"===e&&a&&!/^https?:\/\/\S+$/i.test(a)))}},Tv={};function _v(e,a){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);a&&(i=i.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),t.push.apply(t,i)}return t}function Sv(e,a,t){return(a=function(e){var a=function(e,a){if("object"!=Av(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var i=t.call(e,a);if("object"!=Av(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===a?String:Number)(e)}(e,"string");return"symbol"==Av(a)?a:a+""}(a))in e?Object.defineProperty(e,a,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[a]=t,e}function Ev(e,a){return function(e){if(Array.isArray(e))return e}(e)||function(e,a){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var i,n,o,r,p=[],s=!0,d=!1;try{if(o=(t=t.call(e)).next,0===a);else for(;!(s=(i=o.call(t)).done)&&(p.push(i.value),p.length!==a);s=!0);}catch(e){d=!0,n=e}finally{try{if(!s&&null!=t.return&&(r=t.return(),Object(r)!==r))return}finally{if(d)throw n}}return p}}(e,a)||Nv(e,a)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function kv(e,a){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=Nv(e))||a){t&&(e=t);var i=0,n=function(){};return{s:n,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,r=!0,p=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return r=e.done,e},e:function(e){p=!0,o=e},f:function(){try{r||null==t.return||t.return()}finally{if(p)throw o}}}}function Nv(e,a){if(e){if("string"==typeof e)return Dv(e,a);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Dv(e,a):void 0}}function Dv(e,a){(null==a||a>e.length)&&(a=e.length);for(var t=0,i=Array(a);t<a;t++)i[t]=e[t];return i}function Av(e){return Av="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Av(e)}Tv.webConfigPage=["<!DOCTYPE html>",'<html lang="en">',"<head>",'<meta charset="utf-8" />','<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover" />','<meta name="color-scheme" content="dark" />','<meta name="referrer" content="no-referrer" />',"<title>axotube Config</title>",'<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/TizenDroid/axotube@v1.47.0/service/web/config.css" integrity="sha384-6pwfxSs/lAg00gjTIei+DgH+wJiZyczks3NNUcvu9jlFHIcKPwI2v15zM7LkIEYq" crossorigin="anonymous" />',"<script>"," // Data the application reads on start. The schema is injected at build time, so"," // defaults and valid values always match the service this page was served from."," window.AXOTUBE_WEB = {",' schema: {"defaults":{"enableAdBlock":true,"blockPlayerAdTracking":true,"blockAdTelemetry":true,"blockViewStatsTelemetry":false,"removeLiveVideos":false,"removeTopLiveGames":false,"removeMostRelevant":false,"enableSponsorBlock":true,"enableSponsorBlockToasts":true,"sponsorBlockManualSkips":["intro","outro","filler"],"enableSponsorBlockSponsor":true,"enableSponsorBlockIntro":true,"enableSponsorBlockOutro":true,"enableSponsorBlockInteraction":true,"enableSponsorBlockSelfPromo":true,"enableSponsorBlockPreview":true,"enableSponsorBlockMusicOfftopic":true,"enableSponsorBlockFiller":false,"enableSponsorBlockHighlight":true,"videoSpeed":1,"preferredVideoQuality":"auto","enableDeArrowTitles":true,"enableDeArrowThumbnails":true,"routeColor":"#0f0f0f","routeBackgroundUrl":"","themePreset":"default","textTheme":"default","userAgentProfile":"auto","enableFixedUI":false,"enableHqThumbnails":true,"enableLongPress":true,"enableShorts":true,"dontCheckUpdateUntil":0,"enableWhoIsWatchingMenu":false,"permanentlyEnableWhoIsWatchingMenu":false,"enableWhosWatchingMenuOnAppExit":false,"enableShowUserLanguage":true,"enableShowOtherLanguages":false,"showWelcomeToast":true,"enablePreviousNextButtons":true,"enableSuperThanksButton":false,"enableSpeedControlsButton":true,"enablePatchingVideoPlayer":true,"enableMPButton":true,"enableSwapMPWithPIP":false,"enablePreviews":true,"previewLengthSeconds":40,"enableRemainingTime":false,"enablePauseOnBlur":false,"enableLowMemoryMode":false,"enableHideWatchedVideos":false,"hideWatchedVideosThreshold":80,"hideWatchedVideosPages":[],"enableHideEndScreenCards":false,"enableYouThereRenderer":true,"enableScreenDimming":false,"dimmingTimeout":60,"dimmingOpacity":0.5,"enablePaidPromotionOverlay":true,"speedSettingsIncrement":0.25,"videoPreferredCodec":"any","enableAutoSubtitles":true,"autoSubtitleLanguage":"en","autoSubtitleAllowAuto":true,"launchToOnStartup":null,"reloadHomeOnStartup":true,"disabledSidebarContents":[],"disableChannelsOnSidebar":false,"enableUpdater":true,"autoFrameRate":false,"autoFrameRatePauseVideoFor":0,"enableSigninReminder":false,"sortSubscriptionsByAlphabet":false,"enableReducedMotion":false,"enablePerformanceMode":false,"enablePanelShrink":true,"enableDeArrowPeek":true,"panelShrinkPercent":"60","clockMode":"off","clockFormat":"24h","clockPosition":"topRight","clockShowSeconds":false,"enableOnePressMode":false,"enableExperimentalResolution":false,"experimentalMaxResolution":"1440p"},"ranges":{"videoSpeed":[0.05,5],"hideWatchedVideosThreshold":[0,100],"dimmingTimeout":[1,3600],"dimmingOpacity":[0,1],"speedSettingsIncrement":[0.01,1],"autoFrameRatePauseVideoFor":[0,10000],"previewLengthSeconds":[5,120],"dontCheckUpdateUntil":[0,9007199254740991]},"enums":{"preferredVideoQuality":["auto","2160p","1440p","1080p","720p","480p","360p","240p","144p"],"videoPreferredCodec":["any","vp9","av01","avc1"],"themePreset":["default","black","darkGray","charcoal","navy","darkRed","darkGreen","darkPurple"],"textTheme":["default","white","gray","red","blue","green","purple","yellow"],"userAgentProfile":["auto","samsung","android"],"experimentalMaxResolution":["1440p","2160p"],"autoSubtitleLanguage":["en","hi","es","fr","de","pt","ja","ko","ru"],"panelShrinkPercent":["50","60","70"],"clockMode":["off","always","notPlaying"],"clockFormat":["24h","12h","12hNoAmPm"],"clockPosition":["topLeft","topRight","bottomLeft","bottomRight"]},"themePresetColors":{"default":"#0f0f0f","black":"#000000","darkGray":"#1c1a1a","charcoal":"#121212","navy":"#0d1b2a","darkRed":"#3b0505","darkGreen":"#052e1b","darkPurple":"#1a1025"}},',' uiUrl: "https://cdn.jsdelivr.net/gh/TizenDroid/axotube@v1.47.0/service/web/config-ui.json",',' uiIntegrity: "sha384-iKIt3dtyYFiR05Avkd27csPnZrjRE8md1j00813plCJZQ+L8vX+MFFiU4e9O7B6M"'," };"," window.axotubeAssetError = function () {",' var box = document.getElementById("bootError");'," if (box) box.hidden = false;"," };","<\/script>","</head>","<body>",'<noscript><p class="boot-error">axotube Config needs JavaScript to run.</p></noscript>','<p id="bootError" class="boot-error" role="alert" hidden>AxoTube Config could not load its interface assets. Check your internet connection and reload this page.</p>',"",'<header class="topbar">',' <div class="brand"><span class="brand-name">axotube</span><span class="brand-sub">Config</span></div>',' <div class="topbar-tools">',' <span id="conn" class="conn" role="status">Pairing required</span>',' <label class="search">',' <span class="visually-hidden">Search settings</span>',' <input id="search" type="search" placeholder="Search settings" autocomplete="off" />',' <kbd class="kbd" aria-hidden="true">/</kbd>'," </label>"," </div>","</header>","",'<form id="pairing" class="pairing" hidden>'," <h2>Pair this browser</h2>"," <p>Enter the six-digit code shown on the TV screen. The code changes each time AxoTube starts.</p>",' <div class="pair-row">',' <div class="code-field">',' <label class="visually-hidden" for="pairCode">Pairing code</label>',' <input id="pairCode" inputmode="numeric" autocomplete="one-time-code" maxlength="6" placeholder="000000" aria-describedby="pairError" />',' <div class="code-slots" aria-hidden="true"><span></span><span></span><span></span><span></span><span></span><span></span></div>'," </div>",' <button id="pairBtn" class="btn primary" type="submit">Pair</button>'," </div>",' <p id="pairError" class="field-error" role="alert" hidden></p>',"</form>","",'<dialog id="forgetDialog" class="confirm" aria-labelledby="forgetTitle">',' <h2 id="forgetTitle">Forget this browser?</h2>'," <p>This browser will stop editing your TV's settings. Unsaved changes in this browser will be lost.</p>"," <p>Your TV's settings do not change. To pair again, you will need the code shown on the TV.</p>",' <div class="confirm-actions">',' <button id="forgetCancel" class="btn" type="button">Cancel</button>',' <button id="forgetConfirm" class="btn danger-solid" type="button">Forget browser</button>'," </div>","</dialog>","",'<div id="app" class="app" hidden>',' <nav id="nav" class="nav" aria-label="Settings sections"></nav>',' <main id="main" class="main" tabindex="-1"></main>',"</div>","",'<div id="restartBar" class="restart-bar" role="status" hidden>',' <span id="restartText"></span>',' <button id="restartBtn" class="btn" type="button">Restart YouTube</button>',' <button id="restartDismiss" class="btn quiet" type="button">Not now</button>',"</div>","",'<div id="savebar" class="savebar" role="region" aria-label="Unsaved changes" hidden>',' <div class="savebar-text">',' <strong id="saveCount">No unsaved changes</strong>',' <span id="saveHint" class="muted"></span>'," </div>",' <div class="savebar-actions">',' <button id="discardBtn" class="btn quiet" type="button" disabled>Discard</button>',' <button id="saveBtn" class="btn primary" type="button" disabled>Save changes</button>'," </div>","</div>","",'<div id="toast" class="toast" role="status" aria-live="polite"></div>','<script src="https://cdn.jsdelivr.net/gh/TizenDroid/axotube@v1.47.0/service/web/config.js" integrity="sha384-AzF0+oysSRu93C1Fn9POUct+umve7/xp5vYicM3Zf1SrQ6+USGtB7OnUgPBywQAa" crossorigin="anonymous" defer onerror="window.axotubeAssetError()"><\/script>',"</body>","</html>",""].join("\n");var Ov=yv,jv=lc,Cv=Wh,Pv=n,Iv=a,Vv=v,Lv=m,Bv=wv.validateConfigValue,Fv=Tv.webConfigPage,Rv=Ul,qv=cu,Uv=jv();function Mv(){return"undefined"!=typeof tizen}function zv(){if(!Mv())return null;try{return tizen.application.getAppInfo().packageId}catch(e){return console.warn("tizen.application.getAppInfo failed:",e.message),null}}Uv.use(Cv({origin:"*",methods:"GET,HEAD,PUT,PATCH,POST,DELETE",credentials:!1,optionsSuccessStatus:204})),Uv.use(jv.json({limit:"64kb"}));var Hv=8090,$v=function(){try{return Pv.accessSync(__dirname,Pv.W_OK),__dirname}catch(e){return Vv.tmpdir()}}(),Wv=Iv.join($v,"axotube-config-store.json"),Gv="".concat(Wv,".tmp");function Yv(){return Lv.randomBytes(32).toString("hex")}function Xv(e){if(!e||"object"!==Av(e)||Array.isArray(e))return null;for(var a={},t=0,i=Object.keys(e);t<i.length;t++){var n=i[t];if(!Bv(n,e[n]))return null;a[n]=e[n]}return a}function Kv(e){if(!e||"object"!==Av(e)||Array.isArray(e))return{};for(var a={},t=0,i=Object.keys(e);t<i.length;t++){var n=i[t],o=e[n];if("launchToOnStartup"===n&&o&&"object"===Av(o)&&!Array.isArray(o))try{o=JSON.stringify(o)}catch(e){continue}Bv(n,o)&&(a[n]=o)}return a}!function(){var e=Iv.join(Vv.tmpdir(),"axotube-config-store.json");if($v!==Vv.tmpdir()&&e!==Wv)try{if(Pv.existsSync(Wv)||!Pv.existsSync(e))return;var a=Pv.readFileSync(e,"utf8");JSON.parse(a),Pv.writeFileSync(Gv,a,{encoding:"utf8",mode:384}),Pv.renameSync(Gv,Wv)}catch(e){}}();var Jv=function(){try{var e=JSON.parse(Pv.readFileSync(Wv,"utf8"));if(e&&"object"===Av(e))return{config:Kv(e.config),revision:Number.isSafeInteger(e.revision)&&e.revision>=0?e.revision:0,authToken:"string"==typeof e.authToken&&e.authToken.length>=32?e.authToken:Yv()}}catch(e){}return{config:{},revision:0,authToken:Yv()}}(),Zv=Jv.config,Qv=Jv.revision,eg=Jv.authToken,ag=("000000"+Lv.randomBytes(4).readUInt32BE(0)%1e6).slice(-6);function tg(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Zv,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Qv;try{var t=JSON.stringify({config:e,revision:a,authToken:eg});return Pv.writeFileSync(Gv,t,{encoding:"utf8",mode:384}),Pv.renameSync(Gv,Wv),!0}catch(e){try{Pv.existsSync(Gv)&&Pv.unlinkSync(Gv)}catch(e){}return console.warn("Failed to persist config store:",e.message),!1}}var ig=tg();function ng(e){var a,t,i,n,o=(a=Zv,t=e,i=Object.keys(a).sort(),n=Object.keys(t).sort(),!(i.length===n.length&&i.every(function(e,i){return e===n[i]&&JSON.stringify(a[e])===JSON.stringify(t[e])})));if(!o&&ig)return{ok:!0,changed:!1};var r=o?Qv+1:Qv;return Number.isSafeInteger(r)&&tg(e,r)?(Zv=e,Qv=r,ig=!0,{ok:!0,changed:o}):{ok:!1}}function og(e){var a,t;return String((null===(a=e.socket)||void 0===a?void 0:a.remoteAddress)||(null===(t=e.connection)||void 0===t?void 0:t.remoteAddress)||"")}function rg(e){var a=og(e).toLowerCase();return"127.0.0.1"===a||"::1"===a||"::ffff:127.0.0.1"===a}function pg(){var e=[];try{for(var a=Vv.networkInterfaces(),t=0,i=Object.keys(a);t<i.length;t++){var n,o=kv(a[i[t]]||[]);try{for(o.s();!(n=o.n()).done;){var r=n.value,p=r&&r.family;if(r&&!r.internal&&("IPv4"===p||4===p)&&r.address){var s="http://".concat(r.address,":").concat(Hv);-1===e.indexOf(s)&&e.push(s)}}}catch(e){o.e(e)}finally{o.f()}}}catch(e){}return e}var sg=new Map;function dg(e){return og(e).toLowerCase()||"unknown"}Uv.get("/favicon.ico",function(e,a){a.status(204).end()}),Uv.get("/",function(e,a){a.type("html").send(Fv)}),Uv.get("/api/pairing-code",function(e,a){rg(e)?a.json({ok:!0,code:ag,urls:pg()}):a.status(403).json({ok:!1,error:"Loopback only"})}),Uv.post("/api/pair",function(e,a){if(function(e){var a=Date.now(),t=dg(e),i=sg.get(t);if((!i||a-i.startedAt>6e4)&&(i={startedAt:a,attempts:0}),i.attempts+=1,sg.set(t,i),sg.size>256){var n,o=kv(sg);try{for(o.s();!(n=o.n()).done;){var r=Ev(n.value,2),p=r[0];a-r[1].startedAt>6e4&&sg.delete(p)}}catch(e){o.e(e)}finally{o.f()}}return i.attempts<=10}(e)){var t=e.body&&String(e.body.code||"").trim();t&&t===ag?(!function(e){sg.delete(dg(e))}(e),a.json({ok:!0,token:eg})):a.status(403).json({ok:!1,error:"Invalid pairing code"})}else a.status(429).json({ok:!1,error:"Too many pairing attempts"})}),Uv.use("/api",function(e,a,t){if(rg(e)||function(e,a){if("string"!=typeof e||"string"!=typeof a||e.length!==a.length)return!1;for(var t=0,i=0;i<e.length;i++)t|=e.charCodeAt(i)^a.charCodeAt(i);return 0===t}(function(e){var a=String(e.get("authorization")||"");return 0===a.indexOf("Bearer ")?a.slice(7).trim():String(e.get("x-axotube-token")||"").trim()}(e),eg))return t();a.status(401).json({ok:!1,error:"Pairing required"})}),Uv.get("/api/launch",function(e,a){a.json({debugger:Rv.read().debugger})}),Uv.post("/api/launch",function(e,a){var t=e.body&&e.body.debugger;"boolean"==typeof t?Rv.setDebugger(t)?a.json({ok:!0,debugger:t}):a.status(500).json({ok:!1,error:"could not save the launch mode"}):a.status(400).json({ok:!1,error:"debugger must be true or false"})}),Uv.get("/api/diagnostics",function(e,a){a.json(qv.summary())}),Uv.get("/api/diagnostics/export",function(e,a){a.type("text/plain; charset=utf-8").send(qv.exportText(qv.lanAddress()))}),Uv.get("/api/diagnostics/qr",function(e,a){var t=qv.qrGif();if(!t)return a.status(503).type("text/plain").send("No LAN address: the TV is not on a network.");a.type("image/gif").send(t)}),Uv.get("/api/config",function(e,a){a.json({revision:Qv,config:Zv})}),Uv.post("/api/config",function(e,a){var t=e.body&&Object.prototype.hasOwnProperty.call(e.body,"config"),i=Xv(t?e.body.config:e.body);if(i)if(t&&(!Number.isSafeInteger(e.body.revision)||e.body.revision<0))a.status(400).json({ok:!1,error:"Invalid config revision"});else if(t&&e.body.revision!==Qv)a.status(409).json({ok:!1,error:"Settings changed on TV; reload before saving",revision:Qv});else{var n=ng(i);n.ok?a.json({ok:!0,applied:!0,changed:n.changed,revision:Qv}):a.status(503).json({ok:!1,error:"Unable to save settings"})}else a.status(400).json({ok:!1,error:"Invalid config payload"})}),Uv.post("/api/config/push",function(e,a){var t=e.body,i=t&&Number.isSafeInteger(t.revision)?t.revision:-1,n=t?Xv(t.config):null;if(n)if(i===Qv){var o=ng(n);o.ok?a.json({ok:!0,applied:!0,changed:o.changed,revision:Qv}):a.status(503).json({ok:!1,applied:!1,error:"Unable to save settings"})}else a.status(409).json({ok:!1,applied:!1,error:"Stale config revision",revision:Qv});else a.status(400).json({ok:!1,error:"Invalid config push"})});var cg=[],lg=1,ug=null;function mg(e){if(!(cg.length>=50)){var a=String(e).slice(0,200);cg.push({id:lg++,command:{action:"toast",text:a}})}}Uv.post("/api/command",function(e,a){var t=function(e){if(!e||"object"!==Av(e)||Array.isArray(e))return null;var a=e.action,t=e.videoId,i=e.playlistId,n=e.query,o=e.browseId;return"play"===a&&"string"==typeof t&&t.trim()?{action:"play",videoId:t.trim(),playlistId:"string"==typeof i&&i?i:void 0}:"search"===a&&"string"==typeof n&&n.trim()?{action:"search",query:n.trim()}:"browse"===a&&"string"==typeof o&&o.trim()?{action:"browse",browseId:o.trim()}:"reload"===a?{action:"reload"}:null}(e.body);if(t)if(cg.length>=50)a.status(429).json({ok:!1,error:"Command queue full"});else{var i={id:lg++,command:t};cg.push(i),a.json({ok:!0,id:i.id,command:i.command})}else a.status(400).json({ok:!1,error:"Unsupported command"})}),Uv.get("/api/command",function(e,a){var t=cg[0]||null;a.json(t||{id:null,command:null})}),Uv.post("/api/command/ack",function(e,a){var t=e.body&&Number(e.body.id);if(Number.isFinite(t))return cg.length&&cg[0].id===t?(cg.shift(),void a.json({ok:!0})):void a.status(409).json({ok:!1,error:"Command is no longer pending"});a.status(400).json({ok:!1,error:"Invalid command id"})}),Uv.post("/api/nowplaying",function(e,a){var t=e.body,i=t&&"object"===Av(t)&&!Array.isArray(t)&&Object.keys(t).length>0;ug=i?t:null,a.json({ok:!0})}),Uv.get("/api/nowplaying",function(e,a){a.json({nowPlaying:ug})}),Uv.use(function(e,a,t,i){t.status(e.status||400).json({ok:!1,error:e.message||"Bad request"})});var fg={YouTube:{name:"YouTube",state:"stopped",allowStop:!0,pid:null,additionalData:{},launch:function(e){if(!x.isAxoTubeStandalone){var a=zv();if(a){var t=function(e){if(!Mv())return null;try{return new tizen.ApplicationControl("http://tizen.org/appcontrol/operation/view",null,null,null,[new tizen.ApplicationControlData("module",[JSON.stringify({moduleName:"@foxreis/tizentube",moduleType:"npm",args:e})])])}catch(e){return console.warn("Could not build Tizen app control:",e.message),null}}(e);t&&function(e,a){if(!Mv())return!1;try{return tizen.application.launchAppControl(e,a),!0}catch(e){return console.warn("tizen.application.launchAppControl failed:",e.message),!1}}(t,"".concat(a,".").concat(x.isAxoTubeStandalone?"AxoTubeStandalone":"TizenBrewStandalone"))}}}}};var hg=function(){try{var e=tizen.systeminfo.getCapability("http://tizen.org/system/tizenid");if(e)return function(e,a){var t=new Buffer(a.replace(/-/g,""),"hex"),i=Lv.createHash("sha1").update(t).update(new Buffer(String(e),"utf8")).digest();i[6]=15&i[6]|80,i[8]=63&i[8]|128;var n=i.toString("hex",0,16);return"".concat(n.slice(0,8),"-").concat(n.slice(8,12),"-").concat(n.slice(12,16),"-").concat(n.slice(16,20),"-").concat(n.slice(20))}(e,"4bcbc514-bdd6-4163-8215-316526fd1d9b")}catch(e){console.warn("Could not read tizenid for stable uuid:",e.message)}return function(){var e=Lv.randomBytes(16);e[6]=15&e[6]|64,e[8]=63&e[8]|128;var a=e.toString("hex");return"".concat(a.slice(0,8),"-").concat(a.slice(8,12),"-").concat(a.slice(12,16),"-").concat(a.slice(16,20),"-").concat(a.slice(20))}()}(),vg=function(e){if(!Mv())return"";try{return tizen.systeminfo.getCapability(e)}catch(e){return console.warn("tizen.systeminfo.getCapability failed:",e.message),""}}("http://tizen.org/system/model_name");var gg=new Ov.Server({expressApp:Uv,port:Hv,prefix:"/dial",manufacturer:"Reis Can",modelName:"AxoTube",friendlyName:vg?"axotube (".concat(vg,")"):"axotube",uuid:hg,delegate:{getApp:function(e){return fg[e]},launchApp:function(e,a,t){console.log("Got request to launch ".concat(e," with launch data: ").concat(a));var i=fg[e];if(i){var n=function(e){var a={};return String(e||"").split("&").forEach(function(e){if(e){var t=e.indexOf("="),i=-1===t?e:e.slice(0,t),n=-1===t?"":e.slice(t+1);try{a[decodeURIComponent(i.replace(/\+/g," "))]=decodeURIComponent(n.replace(/\+/g," "))}catch(e){a[i]=n}}}),a}(a);if(void 0!==n.yumi)return i.additionalData=n,i.state="running",void t("");i.pid="run",i.state="starting",i.launch(a),i.state="running",t(i.pid)}else t(null)},stopApp:function(e,a,t){var i=fg[e];i&&i.pid===a?(i.pid=null,i.state="stopped",t(!0)):t(!1)}}});setInterval(function(){if("undefined"!=typeof tizen)try{tizen.application.getAppsContext(function(e){var a=zv();a&&(e.find(function(e){return e.appId==="".concat(a,".").concat(x.isAxoTubeStandalone?"AxoTubeStandalone":"TizenBrewStandalone")})||(fg.YouTube.state="stopped",fg.YouTube.pid=null,fg.YouTube.additionalData={}))})}catch(e){console.warn("App context check failed:",e.message)}},5e3);var bg=!1,yg=null,xg=0;function wg(e){if(!bg)return{restarted:!1,reason:"discovery-not-running"};if(yg)return{restarted:!1,reason:"in-progress"};if(Date.now()-xg<15e3)return{restarted:!1,reason:"too-soon"};xg=Date.now(),console.log("[AxoTube:service] restarting cast discovery (".concat(e,")"));try{gg.stop()}catch(e){console.warn("[AxoTube:service] cast discovery stop failed:",e.message)}return yg=setTimeout(function(){yg=null;try{gg.start()}catch(e){console.warn("[AxoTube:service] cast discovery start failed:",e.message)}},2e3),{restarted:!0,reason:"restarting"}}var Tg=["wake","focus","manual"];Uv.post("/api/cast/restart",function(e,a){if(rg(e)){var t=e.body&&String(e.body.reason||""),i=wg(-1!==Tg.indexOf(t)?t:"manual");a.json(function(e){for(var a=1;a<arguments.length;a++){var t=null!=arguments[a]?arguments[a]:{};a%2?_v(Object(t),!0).forEach(function(a){Sv(e,a,t[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):_v(Object(t)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(t,a))})}return e}({ok:!0},i))}else a.status(403).json({ok:!1,error:"Loopback only"})});var _g=Date.now();setInterval(function(){var e=Date.now(),a=e-_g;_g=e,a>3e4&&wg("wake")},1e4),Uv.listen(Hv,function(){bg=!0,gg.start()}).on("error",function(e){console.error("[AxoTube:service] could not listen on port ".concat(Hv,": ").concat(e.code)),qv.record("error","control port 8090 is not available ("+e.code+"); phone pairing and DIAL casting are off")}),x.isAxoTubeStandalone&&(x.axotubeNotify=mg,mg("AxoTube service is running"));var Sg=m,Eg=n,kg=a,Ng=Pl,Dg="meta.json",Ag=/^[0-9]+\.[0-9]+\.[0-9]+$/,Og=/^[0-9a-f]{64}$/,jg=/^core-.*\.js$/;function Cg(e){return Sg.createHash("sha256").update(e).digest("hex")}function Pg(e){if(!Eg.existsSync(e)){var a=kg.dirname(e);a!==e&&Pg(a),Eg.mkdirSync(e)}}var Ig={createServiceUpdater:function(e){var a=e.cacheDir||null,t=e.shippedVersion||"0.0.0",i=e.fetchText,n=e.fetchBytes,o=e.isRejected||function(){return!1},r=e.notify||function(){},p=e.log||function(){},s=e.cdn||"https://cdn.jsdelivr.net/npm/",d=e.packageName||"axotube",c=null,l=[],u=null,m={state:a?"idle":"disabled",latest:null,error:null,checkedAt:null};function f(){var e=function(e){try{return JSON.parse(Eg.readFileSync(e,"utf8"))}catch(e){return null}}(kg.join(a,Dg));return e&&Ag.test(String(e.version||""))?String(e.version):null}function h(e,t,i){Pg(a);var n="core-"+e+".js",o=kg.join(a,n);Eg.writeFileSync(o+".tmp",t),Eg.renameSync(o+".tmp",o);var r={version:e,sha256:i,file:n},p=kg.join(a,Dg);Eg.writeFileSync(p+".tmp",JSON.stringify(r),"utf8"),Eg.renameSync(p+".tmp",p),Eg.readdirSync(a).forEach(function(e){if(jg.test(e)&&e!==n)try{Eg.unlinkSync(kg.join(a,e))}catch(e){}})}function v(e){var a=s+d+"@"+e+"/dist/";return i(a+"service-core.json").then(function(t){var i=function(e,a){var t=JSON.parse(e);if(!t||t.version!==a)throw new Error("manifest version does not match "+a);if("string"!=typeof t.sha256||!Og.test(t.sha256))throw new Error("manifest has no usable checksum");return t}(t,e);return n(a+"service-core.js").then(function(a){if(!a||"number"!=typeof a.length)throw new Error("core download was empty");if(a.length<2e5||a.length>5242880)throw new Error("core download has a suspicious size ("+a.length+" bytes)");if("number"==typeof i.bytes&&i.bytes!==a.length)throw new Error("core download is truncated");var t=Cg(a);if(t!==i.sha256)throw new Error("core download failed its checksum");return h(e,a,t),e})})}function g(){return m.checkedAt=Date.now(),m.error=null,i(s+d+"@latest/package.json").then(function(e){var a=function(e){var a=JSON.parse(e);if(!a||!Ag.test(String(a.version||"")))throw new Error("remote package.json has no usable version");return String(a.version)}(e);if(m.latest=a,Ng.compareSemver(a,t)<=0)return m.state="current",m;if(o(a))return m.state="rejected",m;var i=f();return i&&Ng.compareSemver(a,i)<=0?(m.state="ready",m):v(a).then(function(e){return m.state="ready",p("service "+e+" downloaded; it starts on the next service start"),u!==e&&(u=e,r("AxoTube service "+e+" is ready. Restart AxoTube or the TV to finish the update.")),m})})}function b(){return a?c||(c=g().then(function(e){return c=null,e},function(e){return c=null,m.state="error",m.error=String(e&&e.message||e),p("update check failed: "+m.error),m})):Promise.resolve(m)}return{check:b,start:function(){a&&l.push(setTimeout(function(){b(),l.push(setInterval(b,216e5))},9e4))},stop:function(){l.forEach(function(e){clearTimeout(e),clearInterval(e)}),l=[]},status:function(){return m}}},sha256Hex:Cg};x.isAxoTubeStandalone=!0;var Vg=El;function Lg(e){return Vg(e,{timeout:15e3}).then(function(a){if(!a.ok)throw new Error("HTTP "+a.status+" for "+e);return a})}var Bg=Ig.createServiceUpdater({cacheDir:x.axotubeServiceCacheDir||null,shippedVersion:x.axotubeServiceShippedVersion,isRejected:function(e){return"function"==typeof x.axotubeServiceIsRejected&&x.axotubeServiceIsRejected(e)},fetchText:function(e){return Lg(e).then(function(e){return e.text()})},fetchBytes:function(e){return Lg(e).then(function(e){return e.buffer()})},notify:function(e){"function"==typeof x.axotubeNotify&&x.axotubeNotify(e)},log:function(e){console.log("[AxoTube:service-update] "+e)}});Bg.start(),x.axotubeServiceUpdater=Bg,module.exports={};
|
|
239
|
+
*/var $h=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var a={},t=0;t<10;t++)a["_"+String.fromCharCode(t)]=t;if("0123456789"!==Object.getOwnPropertyNames(a).map(function(e){return a[e]}).join(""))return!1;var i={};return"abcdefghijklmnopqrst".split("").forEach(function(e){i[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},i)).join("")}catch(e){return!1}}()?Object.assign:function(e,a){for(var t,i,n=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),o=1;o<arguments.length;o++){for(var r in t=Object(arguments[o]))zh.call(t,r)&&(n[r]=t[r]);if(Mh){i=Mh(t);for(var p=0;p<i.length;p++)Hh.call(t,i[p])&&(n[i[p]]=t[i[p]])}}return n};!function(){var e=$h,a=Id,t={origin:"*",methods:"GET,HEAD,PUT,PATCH,POST,DELETE",preflightContinue:!1,optionsSuccessStatus:204};function i(e){return"string"==typeof e||e instanceof String}function n(e,a){if(Array.isArray(a)){for(var t=0;t<a.length;++t)if(n(e,a[t]))return!0;return!1}return i(a)?e===a:a instanceof RegExp?a.test(e):!!a}function o(e,a){var t,o=a.headers.origin,r=[];return e.origin&&"*"!==e.origin?i(e.origin)?(r.push([{key:"Access-Control-Allow-Origin",value:e.origin}]),r.push([{key:"Vary",value:"Origin"}])):(t=n(o,e.origin),r.push([{key:"Access-Control-Allow-Origin",value:!!t&&o}]),r.push([{key:"Vary",value:"Origin"}])):r.push([{key:"Access-Control-Allow-Origin",value:"*"}]),r}function r(e){return!0===e.credentials?{key:"Access-Control-Allow-Credentials",value:"true"}:null}function p(e){var a=e.exposedHeaders;return a?(a.join&&(a=a.join(",")),a&&a.length?{key:"Access-Control-Expose-Headers",value:a}:null):null}function s(e,t){for(var i=0,n=e.length;i<n;i++){var o=e[i];o&&(Array.isArray(o)?s(o,t):"Vary"===o.key&&o.value?a(t,o.value):o.value&&t.setHeader(o.key,o.value))}}Uh.exports=function(a){var i=null;return i="function"==typeof a?a:function(e,t){t(null,a)},function(a,n,d){i(a,function(i,c){if(i)d(i);else{var l=e({},t,c),u=null;l.origin&&"function"==typeof l.origin?u=l.origin:l.origin&&(u=function(e,a){a(null,l.origin)}),u?u(a.headers.origin,function(e,t){e||!t?d(e):(l.origin=t,function(e,a,t,i){var n=[];"OPTIONS"===(a.method&&a.method.toUpperCase&&a.method.toUpperCase())?(n.push(o(e,a)),n.push(r(e)),n.push(function(e){var a=e.methods;return a.join&&(a=e.methods.join(",")),{key:"Access-Control-Allow-Methods",value:a}}(e)),n.push(function(e,a){var t=e.allowedHeaders||e.headers,i=[];return t?t.join&&(t=t.join(",")):(t=a.headers["access-control-request-headers"],i.push([{key:"Vary",value:"Access-Control-Request-Headers"}])),t&&t.length&&i.push([{key:"Access-Control-Allow-Headers",value:t}]),i}(e,a)),n.push(function(e){var a=("number"==typeof e.maxAge||e.maxAge)&&e.maxAge.toString();return a&&a.length?{key:"Access-Control-Max-Age",value:a}:null}(e)),n.push(p(e)),s(n,t),e.preflightContinue?i():(t.statusCode=e.optionsSuccessStatus,t.setHeader("Content-Length","0"),t.end())):(n.push(o(e,a)),n.push(r(e)),n.push(p(e)),s(n,t),i())}(l,a,n,d))}):d()}})}}}();var Wh=Uh.exports,Gh={create:function(e){return new Jh(e)}},Yh=i,Xh=y,Kh=function(){};function Jh(e){var a="number"==typeof(e=e||{}).count?e.count:-1,t=!1!==e.failFast;this._async=new Qh(a,t)}function Zh(e){this.value=e}function Qh(e,a){this.count=e,this.failFast=a,this.index=0,this.pending=0,this.canceled=!1,this.next=null,this.error=null,this.results={}}Object.defineProperty(Jh.prototype,"count",{get:function(){return this._async.count},enumerable:!0}),Jh.prototype.latch=function e(a,t){return"string"!=typeof a&&(t=a,a=null),this._async.makeCallback(e,a,t)},Jh.prototype.val=function(e){return new Zh(e)},Jh.prototype.await=function(e){this._async.await(e),this._async.await=Kh},Qh.prototype.await=function(e){function a(a,t){e(a,t,new Jh)}this.error?a(this.error,null):0===this.pending&&this.count<=0?a(null,this.results):this.next=a},Qh.prototype.makeCallback=function(e,a,t){var i=N(t);if(Xh("undefined"!==i||"number"!==i||"object"!==i,"An argument `mapping` must be a number or an object, if specified."),0===this.count)return Kh;this.count>0&&this.count--,this.pending++;var n=this.index++,o=function(e){var a=Error.prepareStackTrace,t=Error.stackTraceLimit;Error.prepareStackTrace=p,Error.stackTraceLimit=1;var i={};Error.captureStackTrace(i,e);var n=i.stack;return Error.prepareStackTrace=a,Error.stackTraceLimit=t,Yh.format("%s:%d:%d",n.getFileName(),n.getLineNumber(),n.getColumnNumber())}(e),r=this;return function(e){var i=r.next;if(r.pending--,!r.canceled){if(e instanceof Error&&("gate_location"in e||(e.gate_location=o),r.failFast))return r.canceled=!0,void(i?(r.next=Kh,i(e,null)):r.error=e);var p=function(e,a){return"number"==typeof e?a[e]:e?Object.keys(e).reduce(function(t,i){var n=e[i];return t[i]="number"==typeof n?a[n]:n instanceof Zh?n.value:n,t},{}):Array.prototype.slice.call(a)}(t,arguments);null===a?r.results[n]=p:r.results[a]=p,0===r.pending&&r.count<=0&&i&&(r.next=Kh,i(null,r.results))}};function p(){return arguments[1][0]}};var ev=cm,av=Nm,tv=Dm,iv=v,nv=i,ov=r,rv=u,pv=e,sv=Cm,dv=Wh,cv=Gh,lv=tv.compile('<?xml version="1.0"?>\n<root xmlns="urn:schemas-upnp-org:device-1-0">\n <specVersion>\n <major>1</major>\n <minor>0</minor>\n </specVersion>\n <URLBase><%=URLBase%></URLBase>\n <device>\n <deviceType>urn:dial-multiscreen-org:device:dial:1</deviceType>\n <friendlyName><%=friendlyName%></friendlyName>\n <manufacturer><%=manufacturer%></manufacturer>\n <modelName><%=modelName%></modelName>\n <UDN>uuid:<%=uuid%></UDN>\n <iconList>\n <icon>\n <mimetype>image/png</mimetype>\n <width>144</width>\n <height>144</height>\n <depth>32</depth>\n <url>/img/icon.png</url>\n </icon>\n </iconList>\n <serviceList>\n <service>\n <serviceType>urn:dial-multiscreen-org:service:dial:1</serviceType>\n <serviceId>urn:dial-multiscreen-org:serviceId:dial</serviceId>\n <controlURL>/ssdp/notfound</controlURL>\n <eventSubURL>/ssdp/notfound</eventSubURL>\n <SCPDURL>/ssdp/notfound</SCPDURL>\n </service>\n </serviceList>\n </device>\n</root>\n'),uv=tv.compile('<?xml version="1.0" encoding="UTF-8"?>\n<%\nvar ns = "";\nfor(var i in namespaces){\n ns = ns + \' xmlns:\'+i+\'="\'+namespaces[i]+\'"\';\n}\n%>\n<service xmlns="urn:dial-multiscreen-org:schemas:dial" <%-ns%> dialVer="1.7">\n <name><%=name%></name>\n <options allowStop="<%=allowStop%>"/>\n <state><%=state%></state>\n <% if(typeof rel != "undefined" && typeof href != "undefined" && href){ %>\n <link rel="<%=rel%>" href="<%=href%>" />\n <% } %>\n <% if(typeof additionalData != "undefined"){ %>\n <additionalData>\n <% for(var i in additionalData){ %>\n <<%=i%>><%=additionalData[i]%></<%=i%>>\n <% } %>\n </additionalData>\n <% } %>\n</service>\n'),mv=iv.type()+"/"+iv.release()+" UPnP/1.1 famium/0.0.1",fv=function(){var e=this,a=e.prefix,t=e.ssdpPeer,i=["urn:dial-multiscreen-org:service:dial:1","urn:dial-multiscreen-org:device:dial:1","upnp:rootdevice","ssdp:all","uuid:"+e.uuid],n=e.expressApp;n.use(a,function(e,a,t){e.is("text/plain")||e.is("text/xml")||e.is("text/json")||e.is("application/xml")||e.is("application/json")||e.is("application/x-www-form-urlencoded")?(e.text="",e.length=0,e.setEncoding("utf8"),e.on("data",function(a){e.text+=a,e.length+=a.length}),e.on("end",t)):t()}),n.use(a+"/apps",dv(e.corsOptionsAppsDelegate)),n.use(a+"/ssdp",dv(e.corsOptionsSsdp)),n.get(a+"/apps",function(e,a){a.sendStatus(204)}),n.get(a+"/apps/:appName",function(a,t){a.protocol,a.hostname||a.ip||e.host,e.port;var i=a.params.appName,n=e.delegate.getApp.call(a,i);if(n){var o=n.state||n.pid&&"running"||"stopped",r=uv({name:i,state:o,allowStop:1==n.allowStop,rel:"run",href:n.pid?n.pid:null,additionalData:n.additionalData,namespaces:n.namespaces||{}});t.type("application/xml"),t.send(r)}else t.sendStatus(404)}),n.post(a+"/apps/:appName",function(t,i){var n=t.protocol+"://"+(t.hostname||t.ip||e.host)+":"+e.port+a,o=t.params.appName,r=e.delegate.getApp.call(this,o);if(r)if(t.length&&t.length>e.maxContentLength)i.sendStatus(413);else{var p=r.state||r.pid&&"running"||"stopped";e.delegate.launchApp.call(t,o,t.text||null,function(e,a){a?i.sendStatus(503):e?(i.setHeader("LOCATION",n+"/apps/"+o+"/"+e),i.sendStatus("stopped"==p?201:200)):i.sendStatus("stopped"==p?201:200)})}else i.sendStatus(404)}),n.post(a+"/apps/:appName/dial_data",function(a,t){a.protocol,a.hostname||a.ip||e.host,e.port;var i=a.params.appName;e.delegate.getApp.call(a,i)?a.length&&a.length>e.maxContentLength?t.sendStatus(413):t.sendStatus(501):t.sendStatus(404)}),n.delete(a+"/apps/:appName/:pid",function(a,t){a.protocol,a.hostname||a.ip||e.host,e.port;var i=a.params.appName,n=a.params.pid,o=e.delegate.getApp.call(a,i);o?o.allowStop?n?e.delegate.stopApp.call(a,i,n,function(e){t.sendStatus(e?200:400)}):t.sendStatus(400):t.sendStatus(405):t.sendStatus(404)}),n.get(a+"/ssdp/device-desc.xml",function(t,i){var n=t.protocol+"://"+(t.hostname||t.ip||e.host)+":"+e.port+a,o=lv({URLBase:n,friendlyName:e.friendlyName,manufacturer:e.manufacturer,modelName:e.modelName,uuid:e.uuid});i.setHeader("Content-Type","application/xml"),i.setHeader("Application-URL",n+"/apps"),i.send(o)}),n.get(a+"/ssdp/notfound",function(e,a){a.sendStatus(404)});var o="http://{{networkInterfaceAddress}}:"+e.port+a+"/ssdp/device-desc.xml";t.on("ready",function(){for(var a=0;a<i.length;a++){var n=i[a];t.alive(hv({NT:n,USN:"uuid:"+e.uuid+"::"+n,SERVER:mv,LOCATION:o},e.extraHeaders))}e.emit("ready")}).on("search",function(a,n){-1!=i.indexOf(a.ST)&&t.reply(hv({LOCATION:o,ST:a.ST,"CONFIGID.UPNP.ORG":7337,"BOOTID.UPNP.ORG":7337,SERVER:mv,USN:"uuid:"+e.uuid+"::"+a.ST},e.extraHeaders),n)}).on("close",function(){e.emit("stop")})},hv=function(e,a){for(var t in a){var i=e[t];e[t]=i||a[t]}return e},vv=function(e){this.expressApp=e.expressApp||null,this.prefix=e.prefix||"",this.port=e.port||null,this.host=e.host||null,this.uuid=e.uuid||ev.v4(),this.friendlyName=e.friendlyName||iv.hostname()||"unknown",this.manufacturer=e.manufacturer||"unknown manufacturer",this.modelName=e.modelName||"unknown model",this.maxContentLength=Math.max(parseInt(e.maxContentLength)||4096,4096),this.extraHeaders=function(e){var a={};if("object"==N(e))for(var t in e){var i=e[t];"number"!=typeof i&&"string"!=typeof i&&"boolean"!=typeof i||(a[t]=i)}return a}(e.extraHeaders),this.delegate={},this.delegate.getApp=e.delegate&&"function"==typeof e.delegate.getApp?e.delegate.getApp:null,this.delegate.launchApp=e.delegate&&"function"==typeof e.delegate.launchApp?e.delegate.launchApp:null,this.delegate.stopApp=e.delegate&&"function"==typeof e.delegate.stopApp?e.delegate.stopApp:null;var a=e.corsAllowOrigins||!1;this.corsOptionsSsdp={origin:a,methods:["GET","POST","DELETE","OPTIONS"],exposedHeaders:["Location"]};var t={origin:a,methods:["GET","POST","DELETE","OPTIONS"]};this.corsOptionsAppsDelegate=function(e,a){var i=e.header("origin");i?/^(http|https|file):/i.test(i)?a(null,t):a(null,{origin:!0}):a(null,{origin:!1})},this.ssdpPeer=av.createPeer({bindToInterfaces:e.bindToInterfaces,bindToAddresses:e.bindToAddresses}),fv.call(this)};nv.inherits(vv,ov.EventEmitter),vv.prototype.start=function(){this.ssdpPeer.start()},vv.prototype.stop=function(){for(var e=this,a=e.prefix,t=["urn:dial-multiscreen-org:service:dial:1","urn:dial-multiscreen-org:device:dial:1","upnp:rootdevice","ssdp:all","uuid:"+e.uuid],i="http://{{networkInterfaceAddress}}:"+e.port+a+"/ssdp/device-desc.xml",n=e.ssdpPeer,o=cv.create(),r=0;r<t.length;r++){var p=t[r];n.byebye(hv({NT:p,USN:"uuid:"+e.uuid+"::"+p,SERVER:mv,LOCATION:i},e.extraHeaders),o.latch())}o.await(function(){e.ssdpPeer.close()})};var gv=function(e){var a=["urn:dial-multiscreen-org:service:dial:1","urn:dial-multiscreen-org:device:dial:1"],t=this,i={};this.ssdpPeer=new av.createPeer,this.ssdpPeer.on("ready",function(){t.ssdpPeer.search({ST:"urn:dial-multiscreen-org:device:dial:1"}),t.ssdpPeer.search({ST:"urn:dial-multiscreen-org:service:dial:1"}),t.emit("ready")}).on("found",function(e,a){var n=e.LOCATION;n&&!i[n]&&(i[n]=e,t.emit("found",n,e))}).on("notify",function(e,n){var o=e.LOCATION,r=e.NTS,p=e.NT;if(a.indexOf(p)>=0)if(o&&"ssdp:alive"==r&&!i[o])i[o]=e,t.emit("found",o,e);else if(o&&"ssdp:byebye"==r&&i[o]){var s=i[o];delete i[o],t.emit("disappear",o,s)}}).on("close",function(){t.emit("stop")});var n=function(){this.ssdpPeer.start()},o=function(){i={},this.ssdpPeer.search({ST:"urn:dial-multiscreen-org:device:dial:1"}),this.ssdpPeer.search({ST:"urn:dial-multiscreen-org:service:dial:1"})},r=function(){this.ssdpPeer.close()},p=function(e,a){rv.get(e,function(t){var i=t.headers["application-url"];if(200==t.statusCode&&i){i.lastIndexOf("/")==i.length-1&&(i=i.substr(0,i.length-1));var n="";t.setEncoding("utf8"),t.on("data",function(e){n+=e}),t.on("end",function(){sv.parseString(n,{trim:!0,explicitArray:!1},function(t,n){if(t)a(null,t);else try{var o=n.root.device;o.descriptionUrl=e,o.applicationUrl=i;var r=new bv(o);a(r)}catch(t){a(null,t)}})})}else{var o=new Error("Cannot get device description from "+e+" or Application-URL header is not set");a&&a(null,o)}}).on("error",function(e){a&&a(null,e)})};Object.defineProperty(this,"start",{get:function(){return n}}),Object.defineProperty(this,"refresh",{get:function(){return o}}),Object.defineProperty(this,"stop",{get:function(){return r}}),Object.defineProperty(this,"getDialDevice",{get:function(){return p}})};nv.inherits(gv,ov.EventEmitter);var bv=function(e){if(this.descriptionUrl=e.descriptionUrl,this.applicationUrl=e.applicationUrl,this.deviceType=e.deviceType,this.friendlyName=e.friendlyName,this.manufacturer=e.manufacturer,this.modelName=e.modelName,this.UDN=e.UDN,this.icons=[],e.iconList instanceof Array)for(var a=0;a<e.iconList.length;a++){var t=e.iconList[a];t&&t.icon&&this.icons.push(t.icon)}else e.iconList&&e.iconList.icon&&this.icons.push(e.iconList.icon)};bv.prototype.getAppInfoXml=function(e,a){var t=this.applicationUrl&&e&&this.applicationUrl+"/"+e||null;if(t)rv.get(t,function(e){if(200==e.statusCode){var i="";e.setEncoding("utf8"),e.on("data",function(e){i+=e}),e.on("end",function(){a(i)})}else{var n=new Error("Cannot get app info from "+t);n.code=e.statusCode,a&&a(null,n)}}).on("error",function(e){a&&a(null,e)});else{var i=new Error("DIAL appName and DIAL Application-URL cannot be empty for getAppInfo");a&&a(null,i)}},bv.prototype.getAppInfo=function(e,a){this.getAppInfoXml(e,function(e,t){!e||t?a(null,t):sv.parseString(e,{trim:!0,explicitArray:!1,mergeAttrs:!0,explicitRoot:!1,tagNameProcessors:[function(e){return e=e.substr(e.indexOf(":")+1)}],attrNameProcessors:[function(e){return e=e.substr(e.indexOf(":")+1)}]},function(e,t){e?a(null,e):a(t)})})},bv.prototype.launchApp=function(e,a,t,i){var n=this.applicationUrl&&e&&this.applicationUrl+"/"+e||null;if(n){n=pv.parse(n);var o=a&&Buffer.byteLength(a)||0,r={host:n.hostname,port:n.port,path:n.path,method:"POST",headers:{"CONTENT-TYPE":t||'text/plain; charset="utf-8"',"CONTENT-LENGTH":o}},p=rv.request(r,function(e){var a="";e.setEncoding("utf8"),e.on("data",function(e){a+=e}),e.on("end",function(){if(e.statusCode>=400){var t=new Error("Cannot get app info from "+n);t.code=e.statusCode,i&&i(null,t)}else i&&i(a)})}).on("error",function(e){i&&i(null,e)});a&&p.write(a),p.end()}else{var s=new Error("DIAL appName and DIAL Application-URL cannot be empty for launchApp");i&&i(null,s)}},bv.prototype.stopApp=function(e,a,t){var i=this.applicationUrl&&e&&a&&this.applicationUrl+"/"+e+"/"+a||null;if(i){var n={host:(i=pv.parse(i)).hostname,port:i.port,path:i.path,method:"DELETE"},o=rv.request(n,function(e){t&&t(e.statusCode)}).on("error",function(e){t&&t(null,e)});o.end()}else{var r=new Error("DIAL appName, pid and DIAL Application-URL cannot be empty for stopApp");t&&t(null,r)}},$u.Server=vv,$u.Client=gv;var yv=$u,xv={defaults:{enableAdBlock:!0,blockPlayerAdTracking:!0,blockAdTelemetry:!0,blockViewStatsTelemetry:!1,removeLiveVideos:!1,removeTopLiveGames:!1,removeMostRelevant:!1,enableSponsorBlock:!0,enableSponsorBlockToasts:!0,sponsorBlockManualSkips:["intro","outro","filler"],enableSponsorBlockSponsor:!0,enableSponsorBlockIntro:!0,enableSponsorBlockOutro:!0,enableSponsorBlockInteraction:!0,enableSponsorBlockSelfPromo:!0,enableSponsorBlockPreview:!0,enableSponsorBlockMusicOfftopic:!0,enableSponsorBlockFiller:!1,enableSponsorBlockHighlight:!0,videoSpeed:1,preferredVideoQuality:"auto",enableDeArrowTitles:!0,enableDeArrowThumbnails:!0,routeColor:"#0f0f0f",routeBackgroundUrl:"",themePreset:"default",textTheme:"default",userAgentProfile:"auto",enableFixedUI:!1,enableHqThumbnails:!0,enableLongPress:!0,enableShorts:!0,dontCheckUpdateUntil:0,enableWhoIsWatchingMenu:!1,permanentlyEnableWhoIsWatchingMenu:!1,enableWhosWatchingMenuOnAppExit:!1,enableShowUserLanguage:!0,enableShowOtherLanguages:!1,showWelcomeToast:!0,enablePreviousNextButtons:!0,enableSuperThanksButton:!1,enableSpeedControlsButton:!0,enablePatchingVideoPlayer:!0,enableMPButton:!0,enableSwapMPWithPIP:!1,enablePreviews:!0,previewLengthSeconds:40,enableRemainingTime:!1,enablePauseOnBlur:!1,enableLowMemoryMode:!1,enableHideWatchedVideos:!1,hideWatchedVideosThreshold:80,hideWatchedVideosPages:[],enableHideEndScreenCards:!1,enableYouThereRenderer:!0,enableScreenDimming:!1,dimmingTimeout:60,dimmingOpacity:.5,enablePaidPromotionOverlay:!0,speedSettingsIncrement:.25,videoPreferredCodec:"any",enableAutoSubtitles:!0,autoSubtitleLanguage:"en",autoSubtitleAllowAuto:!0,launchToOnStartup:null,reloadHomeOnStartup:!0,disabledSidebarContents:[],disableChannelsOnSidebar:!1,enableUpdater:!0,autoFrameRate:!1,autoFrameRatePauseVideoFor:0,enableSigninReminder:!1,sortSubscriptionsByAlphabet:!1,enableReducedMotion:!1,enablePerformanceMode:!1,enablePanelShrink:!0,enableDeArrowPeek:!0,panelShrinkPercent:"60",clockMode:"off",clockFormat:"24h",clockPosition:"topRight",clockShowSeconds:!1,enableOnePressMode:!1,enableExperimentalResolution:!1,experimentalMaxResolution:"1440p"},ranges:{videoSpeed:[.05,5],hideWatchedVideosThreshold:[0,100],dimmingTimeout:[1,3600],dimmingOpacity:[0,1],speedSettingsIncrement:[.01,1],autoFrameRatePauseVideoFor:[0,1e4],previewLengthSeconds:[5,120],dontCheckUpdateUntil:[0,9007199254740991]},enums:{preferredVideoQuality:["auto","2160p","1440p","1080p","720p","480p","360p","240p","144p"],videoPreferredCodec:["any","vp9","av01","avc1"],themePreset:["default","black","darkGray","charcoal","navy","darkRed","darkGreen","darkPurple"],textTheme:["default","white","gray","red","blue","green","purple","yellow"],userAgentProfile:["auto","samsung","android"],experimentalMaxResolution:["1440p","2160p"],autoSubtitleLanguage:["en","hi","es","fr","de","pt","ja","ko","ru"],panelShrinkPercent:["50","60","70"],clockMode:["off","always","notPlaying"],clockFormat:["24h","12h","12hNoAmPm"],clockPosition:["topLeft","topRight","bottomLeft","bottomRight"]}};var wv={validateConfigValue:function(e,a){var t=xv.defaults;if(!Object.prototype.hasOwnProperty.call(t,e))return!1;var i=t[e];if(null===i)return null===a||"string"==typeof a;if(Array.isArray(i))return Array.isArray(a)&&a.every(function(e){return"string"==typeof e});if("number"==typeof i){if("number"!=typeof a||!isFinite(a))return!1;var n=xv.ranges[e];return!n||a>=n[0]&&a<=n[1]}if(N(a)!==N(i))return!1;var o=xv.enums[e];return(!o||-1!==o.indexOf(a))&&(!("routeColor"===e&&!/^#[0-9a-f]{6}$/i.test(a))&&!("routeBackgroundUrl"===e&&a&&!/^https?:\/\/\S+$/i.test(a)))}},Tv={};function _v(e,a){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);a&&(i=i.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),t.push.apply(t,i)}return t}function Sv(e,a,t){return(a=function(e){var a=function(e,a){if("object"!=Av(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var i=t.call(e,a);if("object"!=Av(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===a?String:Number)(e)}(e,"string");return"symbol"==Av(a)?a:a+""}(a))in e?Object.defineProperty(e,a,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[a]=t,e}function Ev(e,a){return function(e){if(Array.isArray(e))return e}(e)||function(e,a){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var i,n,o,r,p=[],s=!0,d=!1;try{if(o=(t=t.call(e)).next,0===a);else for(;!(s=(i=o.call(t)).done)&&(p.push(i.value),p.length!==a);s=!0);}catch(e){d=!0,n=e}finally{try{if(!s&&null!=t.return&&(r=t.return(),Object(r)!==r))return}finally{if(d)throw n}}return p}}(e,a)||Nv(e,a)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function kv(e,a){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=Nv(e))||a){t&&(e=t);var i=0,n=function(){};return{s:n,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,r=!0,p=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return r=e.done,e},e:function(e){p=!0,o=e},f:function(){try{r||null==t.return||t.return()}finally{if(p)throw o}}}}function Nv(e,a){if(e){if("string"==typeof e)return Dv(e,a);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Dv(e,a):void 0}}function Dv(e,a){(null==a||a>e.length)&&(a=e.length);for(var t=0,i=Array(a);t<a;t++)i[t]=e[t];return i}function Av(e){return Av="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Av(e)}Tv.webConfigPage=["<!DOCTYPE html>",'<html lang="en">',"<head>",'<meta charset="utf-8" />','<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover" />','<meta name="color-scheme" content="dark" />','<meta name="referrer" content="no-referrer" />',"<title>axotube Config</title>",'<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/TizenDroid/axotube@v1.48.0/service/web/config.css" integrity="sha384-6pwfxSs/lAg00gjTIei+DgH+wJiZyczks3NNUcvu9jlFHIcKPwI2v15zM7LkIEYq" crossorigin="anonymous" />',"<script>"," // Data the application reads on start. The schema is injected at build time, so"," // defaults and valid values always match the service this page was served from."," window.AXOTUBE_WEB = {",' schema: {"defaults":{"enableAdBlock":true,"blockPlayerAdTracking":true,"blockAdTelemetry":true,"blockViewStatsTelemetry":false,"removeLiveVideos":false,"removeTopLiveGames":false,"removeMostRelevant":false,"enableSponsorBlock":true,"enableSponsorBlockToasts":true,"sponsorBlockManualSkips":["intro","outro","filler"],"enableSponsorBlockSponsor":true,"enableSponsorBlockIntro":true,"enableSponsorBlockOutro":true,"enableSponsorBlockInteraction":true,"enableSponsorBlockSelfPromo":true,"enableSponsorBlockPreview":true,"enableSponsorBlockMusicOfftopic":true,"enableSponsorBlockFiller":false,"enableSponsorBlockHighlight":true,"videoSpeed":1,"preferredVideoQuality":"auto","enableDeArrowTitles":true,"enableDeArrowThumbnails":true,"routeColor":"#0f0f0f","routeBackgroundUrl":"","themePreset":"default","textTheme":"default","userAgentProfile":"auto","enableFixedUI":false,"enableHqThumbnails":true,"enableLongPress":true,"enableShorts":true,"dontCheckUpdateUntil":0,"enableWhoIsWatchingMenu":false,"permanentlyEnableWhoIsWatchingMenu":false,"enableWhosWatchingMenuOnAppExit":false,"enableShowUserLanguage":true,"enableShowOtherLanguages":false,"showWelcomeToast":true,"enablePreviousNextButtons":true,"enableSuperThanksButton":false,"enableSpeedControlsButton":true,"enablePatchingVideoPlayer":true,"enableMPButton":true,"enableSwapMPWithPIP":false,"enablePreviews":true,"previewLengthSeconds":40,"enableRemainingTime":false,"enablePauseOnBlur":false,"enableLowMemoryMode":false,"enableHideWatchedVideos":false,"hideWatchedVideosThreshold":80,"hideWatchedVideosPages":[],"enableHideEndScreenCards":false,"enableYouThereRenderer":true,"enableScreenDimming":false,"dimmingTimeout":60,"dimmingOpacity":0.5,"enablePaidPromotionOverlay":true,"speedSettingsIncrement":0.25,"videoPreferredCodec":"any","enableAutoSubtitles":true,"autoSubtitleLanguage":"en","autoSubtitleAllowAuto":true,"launchToOnStartup":null,"reloadHomeOnStartup":true,"disabledSidebarContents":[],"disableChannelsOnSidebar":false,"enableUpdater":true,"autoFrameRate":false,"autoFrameRatePauseVideoFor":0,"enableSigninReminder":false,"sortSubscriptionsByAlphabet":false,"enableReducedMotion":false,"enablePerformanceMode":false,"enablePanelShrink":true,"enableDeArrowPeek":true,"panelShrinkPercent":"60","clockMode":"off","clockFormat":"24h","clockPosition":"topRight","clockShowSeconds":false,"enableOnePressMode":false,"enableExperimentalResolution":false,"experimentalMaxResolution":"1440p"},"ranges":{"videoSpeed":[0.05,5],"hideWatchedVideosThreshold":[0,100],"dimmingTimeout":[1,3600],"dimmingOpacity":[0,1],"speedSettingsIncrement":[0.01,1],"autoFrameRatePauseVideoFor":[0,10000],"previewLengthSeconds":[5,120],"dontCheckUpdateUntil":[0,9007199254740991]},"enums":{"preferredVideoQuality":["auto","2160p","1440p","1080p","720p","480p","360p","240p","144p"],"videoPreferredCodec":["any","vp9","av01","avc1"],"themePreset":["default","black","darkGray","charcoal","navy","darkRed","darkGreen","darkPurple"],"textTheme":["default","white","gray","red","blue","green","purple","yellow"],"userAgentProfile":["auto","samsung","android"],"experimentalMaxResolution":["1440p","2160p"],"autoSubtitleLanguage":["en","hi","es","fr","de","pt","ja","ko","ru"],"panelShrinkPercent":["50","60","70"],"clockMode":["off","always","notPlaying"],"clockFormat":["24h","12h","12hNoAmPm"],"clockPosition":["topLeft","topRight","bottomLeft","bottomRight"]},"themePresetColors":{"default":"#0f0f0f","black":"#000000","darkGray":"#1c1a1a","charcoal":"#121212","navy":"#0d1b2a","darkRed":"#3b0505","darkGreen":"#052e1b","darkPurple":"#1a1025"}},',' uiUrl: "https://cdn.jsdelivr.net/gh/TizenDroid/axotube@v1.48.0/service/web/config-ui.json",',' uiIntegrity: "sha384-iKIt3dtyYFiR05Avkd27csPnZrjRE8md1j00813plCJZQ+L8vX+MFFiU4e9O7B6M"'," };"," window.axotubeAssetError = function () {",' var box = document.getElementById("bootError");'," if (box) box.hidden = false;"," };","<\/script>","</head>","<body>",'<noscript><p class="boot-error">axotube Config needs JavaScript to run.</p></noscript>','<p id="bootError" class="boot-error" role="alert" hidden>AxoTube Config could not load its interface assets. Check your internet connection and reload this page.</p>',"",'<header class="topbar">',' <div class="brand"><span class="brand-name">axotube</span><span class="brand-sub">Config</span></div>',' <div class="topbar-tools">',' <span id="conn" class="conn" role="status">Pairing required</span>',' <label class="search">',' <span class="visually-hidden">Search settings</span>',' <input id="search" type="search" placeholder="Search settings" autocomplete="off" />',' <kbd class="kbd" aria-hidden="true">/</kbd>'," </label>"," </div>","</header>","",'<form id="pairing" class="pairing" hidden>'," <h2>Pair this browser</h2>"," <p>Enter the six-digit code shown on the TV screen. The code changes each time AxoTube starts.</p>",' <div class="pair-row">',' <div class="code-field">',' <label class="visually-hidden" for="pairCode">Pairing code</label>',' <input id="pairCode" inputmode="numeric" autocomplete="one-time-code" maxlength="6" placeholder="000000" aria-describedby="pairError" />',' <div class="code-slots" aria-hidden="true"><span></span><span></span><span></span><span></span><span></span><span></span></div>'," </div>",' <button id="pairBtn" class="btn primary" type="submit">Pair</button>'," </div>",' <p id="pairError" class="field-error" role="alert" hidden></p>',"</form>","",'<dialog id="forgetDialog" class="confirm" aria-labelledby="forgetTitle">',' <h2 id="forgetTitle">Forget this browser?</h2>'," <p>This browser will stop editing your TV's settings. Unsaved changes in this browser will be lost.</p>"," <p>Your TV's settings do not change. To pair again, you will need the code shown on the TV.</p>",' <div class="confirm-actions">',' <button id="forgetCancel" class="btn" type="button">Cancel</button>',' <button id="forgetConfirm" class="btn danger-solid" type="button">Forget browser</button>'," </div>","</dialog>","",'<div id="app" class="app" hidden>',' <nav id="nav" class="nav" aria-label="Settings sections"></nav>',' <main id="main" class="main" tabindex="-1"></main>',"</div>","",'<div id="restartBar" class="restart-bar" role="status" hidden>',' <span id="restartText"></span>',' <button id="restartBtn" class="btn" type="button">Restart YouTube</button>',' <button id="restartDismiss" class="btn quiet" type="button">Not now</button>',"</div>","",'<div id="savebar" class="savebar" role="region" aria-label="Unsaved changes" hidden>',' <div class="savebar-text">',' <strong id="saveCount">No unsaved changes</strong>',' <span id="saveHint" class="muted"></span>'," </div>",' <div class="savebar-actions">',' <button id="discardBtn" class="btn quiet" type="button" disabled>Discard</button>',' <button id="saveBtn" class="btn primary" type="button" disabled>Save changes</button>'," </div>","</div>","",'<div id="toast" class="toast" role="status" aria-live="polite"></div>','<script src="https://cdn.jsdelivr.net/gh/TizenDroid/axotube@v1.48.0/service/web/config.js" integrity="sha384-AzF0+oysSRu93C1Fn9POUct+umve7/xp5vYicM3Zf1SrQ6+USGtB7OnUgPBywQAa" crossorigin="anonymous" defer onerror="window.axotubeAssetError()"><\/script>',"</body>","</html>",""].join("\n");var Ov=yv,jv=lc,Cv=Wh,Pv=n,Iv=a,Vv=v,Lv=m,Bv=wv.validateConfigValue,Fv=Tv.webConfigPage,Rv=Ul,qv=cu,Uv=jv();function Mv(){return"undefined"!=typeof tizen}function zv(){if(!Mv())return null;try{return tizen.application.getAppInfo().packageId}catch(e){return console.warn("tizen.application.getAppInfo failed:",e.message),null}}Uv.use(Cv({origin:"*",methods:"GET,HEAD,PUT,PATCH,POST,DELETE",credentials:!1,optionsSuccessStatus:204})),Uv.use(jv.json({limit:"64kb"}));var Hv=8090,$v=function(){try{return Pv.accessSync(__dirname,Pv.W_OK),__dirname}catch(e){return Vv.tmpdir()}}(),Wv=Iv.join($v,"axotube-config-store.json"),Gv="".concat(Wv,".tmp");function Yv(){return Lv.randomBytes(32).toString("hex")}function Xv(e){if(!e||"object"!==Av(e)||Array.isArray(e))return null;for(var a={},t=0,i=Object.keys(e);t<i.length;t++){var n=i[t];if(!Bv(n,e[n]))return null;a[n]=e[n]}return a}function Kv(e){if(!e||"object"!==Av(e)||Array.isArray(e))return{};for(var a={},t=0,i=Object.keys(e);t<i.length;t++){var n=i[t],o=e[n];if("launchToOnStartup"===n&&o&&"object"===Av(o)&&!Array.isArray(o))try{o=JSON.stringify(o)}catch(e){continue}Bv(n,o)&&(a[n]=o)}return a}!function(){var e=Iv.join(Vv.tmpdir(),"axotube-config-store.json");if($v!==Vv.tmpdir()&&e!==Wv)try{if(Pv.existsSync(Wv)||!Pv.existsSync(e))return;var a=Pv.readFileSync(e,"utf8");JSON.parse(a),Pv.writeFileSync(Gv,a,{encoding:"utf8",mode:384}),Pv.renameSync(Gv,Wv)}catch(e){}}();var Jv=function(){try{var e=JSON.parse(Pv.readFileSync(Wv,"utf8"));if(e&&"object"===Av(e))return{config:Kv(e.config),revision:Number.isSafeInteger(e.revision)&&e.revision>=0?e.revision:0,authToken:"string"==typeof e.authToken&&e.authToken.length>=32?e.authToken:Yv()}}catch(e){}return{config:{},revision:0,authToken:Yv()}}(),Zv=Jv.config,Qv=Jv.revision,eg=Jv.authToken,ag=("000000"+Lv.randomBytes(4).readUInt32BE(0)%1e6).slice(-6);function tg(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Zv,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Qv;try{var t=JSON.stringify({config:e,revision:a,authToken:eg});return Pv.writeFileSync(Gv,t,{encoding:"utf8",mode:384}),Pv.renameSync(Gv,Wv),!0}catch(e){try{Pv.existsSync(Gv)&&Pv.unlinkSync(Gv)}catch(e){}return console.warn("Failed to persist config store:",e.message),!1}}var ig=tg();function ng(e){var a,t,i,n,o=(a=Zv,t=e,i=Object.keys(a).sort(),n=Object.keys(t).sort(),!(i.length===n.length&&i.every(function(e,i){return e===n[i]&&JSON.stringify(a[e])===JSON.stringify(t[e])})));if(!o&&ig)return{ok:!0,changed:!1};var r=o?Qv+1:Qv;return Number.isSafeInteger(r)&&tg(e,r)?(Zv=e,Qv=r,ig=!0,{ok:!0,changed:o}):{ok:!1}}function og(e){var a,t;return String((null===(a=e.socket)||void 0===a?void 0:a.remoteAddress)||(null===(t=e.connection)||void 0===t?void 0:t.remoteAddress)||"")}function rg(e){var a=og(e).toLowerCase();return"127.0.0.1"===a||"::1"===a||"::ffff:127.0.0.1"===a}function pg(){var e=[];try{for(var a=Vv.networkInterfaces(),t=0,i=Object.keys(a);t<i.length;t++){var n,o=kv(a[i[t]]||[]);try{for(o.s();!(n=o.n()).done;){var r=n.value,p=r&&r.family;if(r&&!r.internal&&("IPv4"===p||4===p)&&r.address){var s="http://".concat(r.address,":").concat(Hv);-1===e.indexOf(s)&&e.push(s)}}}catch(e){o.e(e)}finally{o.f()}}}catch(e){}return e}var sg=new Map;function dg(e){return og(e).toLowerCase()||"unknown"}Uv.get("/favicon.ico",function(e,a){a.status(204).end()}),Uv.get("/",function(e,a){a.type("html").send(Fv)}),Uv.get("/api/pairing-code",function(e,a){rg(e)?a.json({ok:!0,code:ag,urls:pg()}):a.status(403).json({ok:!1,error:"Loopback only"})}),Uv.post("/api/pair",function(e,a){if(function(e){var a=Date.now(),t=dg(e),i=sg.get(t);if((!i||a-i.startedAt>6e4)&&(i={startedAt:a,attempts:0}),i.attempts+=1,sg.set(t,i),sg.size>256){var n,o=kv(sg);try{for(o.s();!(n=o.n()).done;){var r=Ev(n.value,2),p=r[0];a-r[1].startedAt>6e4&&sg.delete(p)}}catch(e){o.e(e)}finally{o.f()}}return i.attempts<=10}(e)){var t=e.body&&String(e.body.code||"").trim();t&&t===ag?(!function(e){sg.delete(dg(e))}(e),a.json({ok:!0,token:eg})):a.status(403).json({ok:!1,error:"Invalid pairing code"})}else a.status(429).json({ok:!1,error:"Too many pairing attempts"})}),Uv.use("/api",function(e,a,t){if(rg(e)||function(e,a){if("string"!=typeof e||"string"!=typeof a||e.length!==a.length)return!1;for(var t=0,i=0;i<e.length;i++)t|=e.charCodeAt(i)^a.charCodeAt(i);return 0===t}(function(e){var a=String(e.get("authorization")||"");return 0===a.indexOf("Bearer ")?a.slice(7).trim():String(e.get("x-axotube-token")||"").trim()}(e),eg))return t();a.status(401).json({ok:!1,error:"Pairing required"})}),Uv.get("/api/launch",function(e,a){a.json({debugger:Rv.read().debugger})}),Uv.post("/api/launch",function(e,a){var t=e.body&&e.body.debugger;"boolean"==typeof t?Rv.setDebugger(t)?a.json({ok:!0,debugger:t}):a.status(500).json({ok:!1,error:"could not save the launch mode"}):a.status(400).json({ok:!1,error:"debugger must be true or false"})}),Uv.get("/api/diagnostics",function(e,a){a.json(qv.summary())}),Uv.get("/api/diagnostics/export",function(e,a){a.type("text/plain; charset=utf-8").send(qv.exportText(qv.lanAddress()))}),Uv.get("/api/diagnostics/qr",function(e,a){var t=qv.qrGif();if(!t)return a.status(503).type("text/plain").send("No LAN address: the TV is not on a network.");a.type("image/gif").send(t)}),Uv.get("/api/config",function(e,a){a.json({revision:Qv,config:Zv})}),Uv.post("/api/config",function(e,a){var t=e.body&&Object.prototype.hasOwnProperty.call(e.body,"config"),i=Xv(t?e.body.config:e.body);if(i)if(t&&(!Number.isSafeInteger(e.body.revision)||e.body.revision<0))a.status(400).json({ok:!1,error:"Invalid config revision"});else if(t&&e.body.revision!==Qv)a.status(409).json({ok:!1,error:"Settings changed on TV; reload before saving",revision:Qv});else{var n=ng(i);n.ok?a.json({ok:!0,applied:!0,changed:n.changed,revision:Qv}):a.status(503).json({ok:!1,error:"Unable to save settings"})}else a.status(400).json({ok:!1,error:"Invalid config payload"})}),Uv.post("/api/config/push",function(e,a){var t=e.body,i=t&&Number.isSafeInteger(t.revision)?t.revision:-1,n=t?Xv(t.config):null;if(n)if(i===Qv){var o=ng(n);o.ok?a.json({ok:!0,applied:!0,changed:o.changed,revision:Qv}):a.status(503).json({ok:!1,applied:!1,error:"Unable to save settings"})}else a.status(409).json({ok:!1,applied:!1,error:"Stale config revision",revision:Qv});else a.status(400).json({ok:!1,error:"Invalid config push"})});var cg=[],lg=1,ug=null;function mg(e){if(!(cg.length>=50)){var a=String(e).slice(0,200);cg.push({id:lg++,command:{action:"toast",text:a}})}}Uv.post("/api/command",function(e,a){var t=function(e){if(!e||"object"!==Av(e)||Array.isArray(e))return null;var a=e.action,t=e.videoId,i=e.playlistId,n=e.query,o=e.browseId;return"play"===a&&"string"==typeof t&&t.trim()?{action:"play",videoId:t.trim(),playlistId:"string"==typeof i&&i?i:void 0}:"search"===a&&"string"==typeof n&&n.trim()?{action:"search",query:n.trim()}:"browse"===a&&"string"==typeof o&&o.trim()?{action:"browse",browseId:o.trim()}:"reload"===a?{action:"reload"}:null}(e.body);if(t)if(cg.length>=50)a.status(429).json({ok:!1,error:"Command queue full"});else{var i={id:lg++,command:t};cg.push(i),a.json({ok:!0,id:i.id,command:i.command})}else a.status(400).json({ok:!1,error:"Unsupported command"})}),Uv.get("/api/command",function(e,a){var t=cg[0]||null;a.json(t||{id:null,command:null})}),Uv.post("/api/command/ack",function(e,a){var t=e.body&&Number(e.body.id);if(Number.isFinite(t))return cg.length&&cg[0].id===t?(cg.shift(),void a.json({ok:!0})):void a.status(409).json({ok:!1,error:"Command is no longer pending"});a.status(400).json({ok:!1,error:"Invalid command id"})}),Uv.post("/api/nowplaying",function(e,a){var t=e.body,i=t&&"object"===Av(t)&&!Array.isArray(t)&&Object.keys(t).length>0;ug=i?t:null,a.json({ok:!0})}),Uv.get("/api/nowplaying",function(e,a){a.json({nowPlaying:ug})}),Uv.use(function(e,a,t,i){t.status(e.status||400).json({ok:!1,error:e.message||"Bad request"})});var fg={YouTube:{name:"YouTube",state:"stopped",allowStop:!0,pid:null,additionalData:{},launch:function(e){if(!x.isAxoTubeStandalone){var a=zv();if(a){var t=function(e){if(!Mv())return null;try{return new tizen.ApplicationControl("http://tizen.org/appcontrol/operation/view",null,null,null,[new tizen.ApplicationControlData("module",[JSON.stringify({moduleName:"@foxreis/tizentube",moduleType:"npm",args:e})])])}catch(e){return console.warn("Could not build Tizen app control:",e.message),null}}(e);t&&function(e,a){if(!Mv())return!1;try{return tizen.application.launchAppControl(e,a),!0}catch(e){return console.warn("tizen.application.launchAppControl failed:",e.message),!1}}(t,"".concat(a,".").concat(x.isAxoTubeStandalone?"AxoTubeStandalone":"TizenBrewStandalone"))}}}}};var hg=function(){try{var e=tizen.systeminfo.getCapability("http://tizen.org/system/tizenid");if(e)return function(e,a){var t=new Buffer(a.replace(/-/g,""),"hex"),i=Lv.createHash("sha1").update(t).update(new Buffer(String(e),"utf8")).digest();i[6]=15&i[6]|80,i[8]=63&i[8]|128;var n=i.toString("hex",0,16);return"".concat(n.slice(0,8),"-").concat(n.slice(8,12),"-").concat(n.slice(12,16),"-").concat(n.slice(16,20),"-").concat(n.slice(20))}(e,"4bcbc514-bdd6-4163-8215-316526fd1d9b")}catch(e){console.warn("Could not read tizenid for stable uuid:",e.message)}return function(){var e=Lv.randomBytes(16);e[6]=15&e[6]|64,e[8]=63&e[8]|128;var a=e.toString("hex");return"".concat(a.slice(0,8),"-").concat(a.slice(8,12),"-").concat(a.slice(12,16),"-").concat(a.slice(16,20),"-").concat(a.slice(20))}()}(),vg=function(e){if(!Mv())return"";try{return tizen.systeminfo.getCapability(e)}catch(e){return console.warn("tizen.systeminfo.getCapability failed:",e.message),""}}("http://tizen.org/system/model_name");var gg=new Ov.Server({expressApp:Uv,port:Hv,prefix:"/dial",manufacturer:"Reis Can",modelName:"AxoTube",friendlyName:vg?"axotube (".concat(vg,")"):"axotube",uuid:hg,delegate:{getApp:function(e){return fg[e]},launchApp:function(e,a,t){console.log("Got request to launch ".concat(e," with launch data: ").concat(a));var i=fg[e];if(i){var n=function(e){var a={};return String(e||"").split("&").forEach(function(e){if(e){var t=e.indexOf("="),i=-1===t?e:e.slice(0,t),n=-1===t?"":e.slice(t+1);try{a[decodeURIComponent(i.replace(/\+/g," "))]=decodeURIComponent(n.replace(/\+/g," "))}catch(e){a[i]=n}}}),a}(a);if(void 0!==n.yumi)return i.additionalData=n,i.state="running",void t("");i.pid="run",i.state="starting",i.launch(a),i.state="running",t(i.pid)}else t(null)},stopApp:function(e,a,t){var i=fg[e];i&&i.pid===a?(i.pid=null,i.state="stopped",t(!0)):t(!1)}}});setInterval(function(){if("undefined"!=typeof tizen)try{tizen.application.getAppsContext(function(e){var a=zv();a&&(e.find(function(e){return e.appId==="".concat(a,".").concat(x.isAxoTubeStandalone?"AxoTubeStandalone":"TizenBrewStandalone")})||(fg.YouTube.state="stopped",fg.YouTube.pid=null,fg.YouTube.additionalData={}))})}catch(e){console.warn("App context check failed:",e.message)}},5e3);var bg=!1,yg=null,xg=0;function wg(e){if(!bg)return{restarted:!1,reason:"discovery-not-running"};if(yg)return{restarted:!1,reason:"in-progress"};if(Date.now()-xg<15e3)return{restarted:!1,reason:"too-soon"};xg=Date.now(),console.log("[AxoTube:service] restarting cast discovery (".concat(e,")"));try{gg.stop()}catch(e){console.warn("[AxoTube:service] cast discovery stop failed:",e.message)}return yg=setTimeout(function(){yg=null;try{gg.start()}catch(e){console.warn("[AxoTube:service] cast discovery start failed:",e.message)}},2e3),{restarted:!0,reason:"restarting"}}var Tg=["wake","focus","manual"];Uv.post("/api/cast/restart",function(e,a){if(rg(e)){var t=e.body&&String(e.body.reason||""),i=wg(-1!==Tg.indexOf(t)?t:"manual");a.json(function(e){for(var a=1;a<arguments.length;a++){var t=null!=arguments[a]?arguments[a]:{};a%2?_v(Object(t),!0).forEach(function(a){Sv(e,a,t[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):_v(Object(t)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(t,a))})}return e}({ok:!0},i))}else a.status(403).json({ok:!1,error:"Loopback only"})});var _g=Date.now();setInterval(function(){var e=Date.now(),a=e-_g;_g=e,a>3e4&&wg("wake")},1e4),Uv.listen(Hv,function(){bg=!0,gg.start()}).on("error",function(e){console.error("[AxoTube:service] could not listen on port ".concat(Hv,": ").concat(e.code)),qv.record("error","control port 8090 is not available ("+e.code+"); phone pairing and DIAL casting are off")}),x.isAxoTubeStandalone&&(x.axotubeNotify=mg,mg("AxoTube service is running"));var Sg=m,Eg=n,kg=a,Ng=Pl,Dg="meta.json",Ag=/^[0-9]+\.[0-9]+\.[0-9]+$/,Og=/^[0-9a-f]{64}$/,jg=/^core-.*\.js$/;function Cg(e){return Sg.createHash("sha256").update(e).digest("hex")}function Pg(e){if(!Eg.existsSync(e)){var a=kg.dirname(e);a!==e&&Pg(a),Eg.mkdirSync(e)}}var Ig={createServiceUpdater:function(e){var a=e.cacheDir||null,t=e.shippedVersion||"0.0.0",i=e.fetchText,n=e.fetchBytes,o=e.isRejected||function(){return!1},r=e.notify||function(){},p=e.log||function(){},s=e.cdn||"https://cdn.jsdelivr.net/npm/",d=e.packageName||"axotube",c=null,l=[],u=null,m={state:a?"idle":"disabled",latest:null,error:null,checkedAt:null};function f(){var e=function(e){try{return JSON.parse(Eg.readFileSync(e,"utf8"))}catch(e){return null}}(kg.join(a,Dg));return e&&Ag.test(String(e.version||""))?String(e.version):null}function h(e,t,i){Pg(a);var n="core-"+e+".js",o=kg.join(a,n);Eg.writeFileSync(o+".tmp",t),Eg.renameSync(o+".tmp",o);var r={version:e,sha256:i,file:n},p=kg.join(a,Dg);Eg.writeFileSync(p+".tmp",JSON.stringify(r),"utf8"),Eg.renameSync(p+".tmp",p),Eg.readdirSync(a).forEach(function(e){if(jg.test(e)&&e!==n)try{Eg.unlinkSync(kg.join(a,e))}catch(e){}})}function v(e){var a=s+d+"@"+e+"/dist/";return i(a+"service-core.json").then(function(t){var i=function(e,a){var t=JSON.parse(e);if(!t||t.version!==a)throw new Error("manifest version does not match "+a);if("string"!=typeof t.sha256||!Og.test(t.sha256))throw new Error("manifest has no usable checksum");return t}(t,e);return n(a+"service-core.js").then(function(a){if(!a||"number"!=typeof a.length)throw new Error("core download was empty");if(a.length<2e5||a.length>5242880)throw new Error("core download has a suspicious size ("+a.length+" bytes)");if("number"==typeof i.bytes&&i.bytes!==a.length)throw new Error("core download is truncated");var t=Cg(a);if(t!==i.sha256)throw new Error("core download failed its checksum");return h(e,a,t),e})})}function g(){return m.checkedAt=Date.now(),m.error=null,i(s+d+"@latest/package.json").then(function(e){var a=function(e){var a=JSON.parse(e);if(!a||!Ag.test(String(a.version||"")))throw new Error("remote package.json has no usable version");return String(a.version)}(e);if(m.latest=a,Ng.compareSemver(a,t)<=0)return m.state="current",m;if(o(a))return m.state="rejected",m;var i=f();return i&&Ng.compareSemver(a,i)<=0?(m.state="ready",m):v(a).then(function(e){return m.state="ready",p("service "+e+" downloaded; it starts on the next service start"),u!==e&&(u=e,r("AxoTube service "+e+" is ready. Restart AxoTube or the TV to finish the update.")),m})})}function b(){return a?c||(c=g().then(function(e){return c=null,e},function(e){return c=null,m.state="error",m.error=String(e&&e.message||e),p("update check failed: "+m.error),m})):Promise.resolve(m)}return{check:b,start:function(){a&&l.push(setTimeout(function(){b(),l.push(setInterval(b,216e5))},9e4))},stop:function(){l.forEach(function(e){clearTimeout(e),clearInterval(e)}),l=[]},status:function(){return m}}},sha256Hex:Cg};x.isAxoTubeStandalone=!0;var Vg=El;function Lg(e){return Vg(e,{timeout:15e3}).then(function(a){if(!a.ok)throw new Error("HTTP "+a.status+" for "+e);return a})}var Bg=Ig.createServiceUpdater({cacheDir:x.axotubeServiceCacheDir||null,shippedVersion:x.axotubeServiceShippedVersion,isRejected:function(e){return"function"==typeof x.axotubeServiceIsRejected&&x.axotubeServiceIsRejected(e)},fetchText:function(e){return Lg(e).then(function(e){return e.text()})},fetchBytes:function(e){return Lg(e).then(function(e){return e.buffer()})},notify:function(e){"function"==typeof x.axotubeNotify&&x.axotubeNotify(e)},log:function(e){console.log("[AxoTube:service-update] "+e)}});Bg.start(),x.axotubeServiceUpdater=Bg,module.exports={};
|
package/dist/service-core.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "1.
|
|
2
|
+
"version": "1.48.0",
|
|
3
3
|
"file": "service-core.js",
|
|
4
|
-
"bytes":
|
|
5
|
-
"sha256": "
|
|
4
|
+
"bytes": 1138190,
|
|
5
|
+
"sha256": "bbf2759a6330ba882e5e9e3e32e847e67a9fb20cef3cbff520652e62ec7e0401"
|
|
6
6
|
}
|