luckyphoenix 2024.4.18 → 2024.4.20
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +4 -4
- package/css/alist_skin_v3.css +1 -1
- package/css/{wallpaper.css → alist_wallpaper.css} +2 -2
- package/package.json +11 -3
- package/webfonts/lxgw-wenkai-webfont/package.json +33 -0
- package/ariang/LICENSE +0 -21
- package/ariang/css/aria-ng-c59c5f8a64.min.css +0 -4
- package/ariang/css/plugins-fb16b3b4db.min.css +0 -28
- package/ariang/favicon.ico +0 -0
- package/ariang/favicon.png +0 -0
- package/ariang/fonts/fontawesome-webfont.woff2 +0 -0
- package/ariang/index.html +0 -1
- package/ariang/js/angular-packages-1.6.10.min.js +0 -472
- package/ariang/js/aria-ng-9bc3ddfc9f.min.js +0 -5
- package/ariang/js/bootstrap-4.6.1.min.js +0 -6
- package/ariang/js/echarts-common-3.8.5.min.js +0 -1
- package/ariang/js/jquery-3.6.1.min.js +0 -2
- package/ariang/js/moment-with-locales-2.29.4.min.js +0 -1
- package/ariang/js/plugins-390b1f3333.min.js +0 -42
- package/ariang/langs/zh_Hans.txt +0 -736
- package/ariang/langs/zh_Hant.txt +0 -737
- package/ariang/logo512m.png +0 -0
- package/ariang/popup.html +0 -15
- package/ariang/robots.txt +0 -4
- package/ariang/tileicon.png +0 -0
- package/ariang/touchicon.png +0 -0
- package/ariang/webmanifest.json +0 -40
- package/bing/20240412@/344/270/200/345/272/247/345/244/251/347/204/266/346/213/261/351/227/250-/346/213/261/351/227/250/345/233/275/345/256/266/345/205/254/345/233/255/357/274/214/347/212/271/344/273/226/345/267/236/357/274/214/347/276/216/345/233/275 .jpg +0 -0
- package/bing/20240413@/350/212/261/345/274/200/346/255/243/346/273/241/346/236/235-/346/230/245/345/244/251/347/232/204/350/213/271/346/236/234/346/240/221/357/274/214/345/276/267/345/233/275 .jpg +0 -0
- package/bing/20240414@/345/262/251/347/237/263/344/277/235/351/276/204/347/220/203-/344/277/235/351/276/204/347/220/203/346/265/267/346/273/251/347/232/204/346/227/245/350/220/275/357/274/214/351/227/250/345/244/232/350/245/277/350/257/272/345/216/277/357/274/214/345/212/240/345/210/251/347/246/217/345/260/274/344/272/232/357/274/214/347/276/216/345/233/275 .jpg +0 -0
- package/bing/20240415@/344/273/213/344/272/216/346/226/207/350/211/272/345/244/215/345/205/264/344/270/216/347/213/254/345/210/233/346/200/247/344/271/213/351/227/264-/351/246/231/346/263/242/345/237/216/345/240/241/357/274/214/344/270/255/345/244/256-/345/215/242/347/223/246/345/260/224/346/262/263/350/260/267/345/244/247/345/214/272/357/274/214/346/263/225/345/233/275 .jpg +0 -0
- package/bing/20240416@/347/201/257/345/205/211/357/274/214/347/233/270/346/234/272/357/274/214/347/272/275/347/272/246/357/274/201-/346/232/256/350/211/262/344/270/255/347/232/204/346/233/274/345/223/210/351/241/277/344/270/213/345/237/216/350/201/224/345/220/210/345/271/277/345/234/272/357/274/214/347/272/275/347/272/246/357/274/214/347/276/216/345/233/275 .jpg +0 -0
- package/bing/20240417@/346/210/221/346/230/257/344/270/215/346/230/257/347/235/241/345/276/227/345/244/252/344/271/205/344/272/206/357/274/237-/346/230/245/345/244/251/347/232/204/347/276/216/346/264/262/351/273/221/347/206/212/345/271/274/345/264/275/357/274/214/344/273/231/347/272/263/345/272/246/345/233/275/345/256/266/345/205/254/345/233/255/357/274/214/345/274/227/345/220/211/345/260/274/344/272/232/345/267/236/357/274/214/347/276/216/345/233/275 .jpg +0 -0
- package/bing/20240418@/345/220/215/350/252/211/344/271/213/345/242/231-/344/270/255/344/270/226/347/272/252/345/237/216/345/242/231/357/274/214/351/230/277/347/273/264/346/213/211/357/274/214/350/245/277/347/217/255/347/211/231 .jpg +0 -0
- package/bing/FHD.jpg +0 -0
- package/bing/desktop.php +0 -28
- package/bing/mFHD.jpg +0 -0
- package/bing/mobile.php +0 -28
- package/phoenix.png +0 -0
- package/sub/chromego.json +0 -1075
- package/sub/chromego.txt +0 -1
- package/sub/chromego.yaml +0 -2120
- package/sub/neko-warp.nloli.xyz.yaml +0 -7039
- package/sub/sub.xf.free.hr.json +0 -11171
- package/sub/sub.xf.free.hr.txt +0 -41
- package/sub/sub.xf.free.hr.yaml +0 -9997
- package/sub/v2rayse.json +0 -552
- package/sub/v2rayse.txt +0 -1
- package/sub/v2rayse.yaml +0 -3991
- package/webfonts/lxgw-wenkai-webfont/.version +0 -1
@@ -1,5 +0,0 @@
|
|
1
|
-
/*!
|
2
|
-
* AriaNg
|
3
|
-
* https://github.com/mayswind/AriaNg
|
4
|
-
*/
|
5
|
-
!function(){"use strict";var e,t,a;if(e=navigator.appName,t=navigator.appVersion.split(";"),a=t&&t.length>1?t[1].replace(/[ ]/g,""):"","Microsoft Internet Explorer"===e&&("MSIE6.0"===a||"MSIE7.0"===a||"MSIE8.0"===a||"MSIE9.0"===a)){var n=document.createElement("div");n.className="alert alert-danger",n.innerHTML="Sorry, AriaNg cannot support this browser, please upgrade your browser!",document.getElementById("content-wrapper").appendChild(n)}}(),function(){"use strict";var e=function(){var e=$(window).height(),t=$(".main-header").outerHeight()+$(".main-footer").outerHeight();$(".content-body").css("height",e-t)};$(window,".wrapper").resize((function(){e()})),e()}(),function(){"use strict";angular.module("ariaNg",["ngRoute","ngSanitize","ngTouch","ngMessages","ngCookies","ngAnimate","pascalprecht.translate","angularMoment","ngWebSocket","utf8-base64","LocalStorageModule","ui-notification","angularBittorrentPeerid","cgBusy","angularPromiseButtons","oitozero.ngSweetAlert","angular-clipboard","inputDropdown",angularDragula(angular)])}(),function(){"use strict";angular.module("ariaNg").config(["$routeProvider",function(e){var t="/"+JSON.parse(localStorage["AriaNg.Options"]||'{"defaultTaskPage":"all"}').defaultTaskPage||"all";e.when("/all",{templateUrl:"views/list.html",controller:"DownloadListController"}).when("/downloading",{templateUrl:"views/list.html",controller:"DownloadListController"}).when("/waiting",{templateUrl:"views/list.html",controller:"DownloadListController"}).when("/stopped",{templateUrl:"views/list.html",controller:"DownloadListController"}).when("/new",{templateUrl:"views/new.html",controller:"NewTaskController"}).when("/new/:url",{template:"",controller:"CommandController"}).when("/task/detail/:gid",{templateUrl:"views/task-detail.html",controller:"TaskDetailController"}).when("/settings/ariang",{templateUrl:"views/settings-ariang.html",controller:"AriaNgSettingsController"}).when("/settings/ariang/:extendType",{templateUrl:"views/settings-ariang.html",controller:"AriaNgSettingsController"}).when("/settings/aria2/basic",{templateUrl:"views/settings-aria2.html",controller:"Aria2SettingsController"}).when("/settings/aria2/http-ftp-sftp",{templateUrl:"views/settings-aria2.html",controller:"Aria2SettingsController"}).when("/settings/aria2/http",{templateUrl:"views/settings-aria2.html",controller:"Aria2SettingsController"}).when("/settings/aria2/ftp-sftp",{templateUrl:"views/settings-aria2.html",controller:"Aria2SettingsController"}).when("/settings/aria2/bt",{templateUrl:"views/settings-aria2.html",controller:"Aria2SettingsController"}).when("/settings/aria2/metalink",{templateUrl:"views/settings-aria2.html",controller:"Aria2SettingsController"}).when("/settings/aria2/rpc",{templateUrl:"views/settings-aria2.html",controller:"Aria2SettingsController"}).when("/settings/aria2/advanced",{templateUrl:"views/settings-aria2.html",controller:"Aria2SettingsController"}).when("/settings/rpc/set",{template:"",controller:"CommandController"}).when("/settings/rpc/set/:protocol/:host/:port/:interface/:secret?",{template:"",controller:"CommandController"}).when("/debug",{templateUrl:"views/debug.html",controller:"AriaNgDebugController"}).when("/status",{templateUrl:"views/status.html",controller:"Aria2StatusController"}).when("/recommend",{templateUrl:"views/recommend.html"}).otherwise({redirectTo:t})}])}(),function(){"use strict";angular.module("ariaNg").run(["$window","$rootScope","$location","$document","$timeout","ariaNgCommonService","ariaNgKeyboardService","ariaNgNotificationService","ariaNgLogService","ariaNgSettingService","aria2TaskService","aria2SettingService","aria2AllOptions",function(e,t,a,n,i,s,o,r,l,c,d,u,p){var g=!1,f=function(e,t){return e===t||0===t.indexOf(e)&&0===t.substring(e.length).indexOf("/")},m=function(){t.currentTheme="light",angular.element("body").removeClass("theme-dark")},h=function(){t.currentTheme="dark",angular.element("body").addClass("theme-dark")},v=function(){if(c.isBrowserSupportDarkMode()){var t=e.matchMedia("(prefers-color-scheme: dark)");l.info("[root.setThemeBySystemSettings] system uses "+(t.matches?"dark":"light")+" theme"),t.matches?h():m()}else m()},b=function(){angular.element('[data-widget="pushmenu"]').PushMenu("collapse")},y=function(e){if(!e||parseInt(e).toString()!=e)return e;for(var t=["","k","m","g"],a=0,n=0;n<t.length&&!(e<1024||e%1024!=0);n++)e/=1024,a++;return e+t[a]};(t.currentTheme="light",t.searchContext={text:"",setSearchBoxFocused:function(){angular.element("#search-box").focus()}},t.taskContext={rpcStatus:"Connecting",list:[],selected:{},enableSelectAll:!1,getSelectedTaskIds:function(e){var t=[];if(!this.list||!this.selected||this.list.length<1)return t;for(var a=0;a<this.list.length;a++){var n=this.list[a];this.selected[n.gid]&&(!e||e&&e.includes(n.status))&&t.push(n.gid)}return t},getSelectedTasks:function(){var e=[];if(!this.list||!this.selected||this.list.length<1)return e;for(var t=0;t<this.list.length;t++){var a=this.list[t];this.selected[a.gid]&&e.push(a)}return e},isAllSelected:function(){for(var e=!0,a=0;a<this.list.length;a++){var n=this.list[a];if(t.filterTask(n)&&!this.selected[n.gid]){e=!1;break}}return e},hasRetryableTask:function(){for(var e=0;e<this.list.length;e++){var a=this.list[e];if(t.filterTask(a)&&t.isTaskRetryable(a))return!0}return!1},hasPausedTask:function(){for(var e=0;e<this.list.length;e++){var a=this.list[e];if(t.filterTask(a)&&"paused"===a.status)return!0}return!1},hasCompletedTask:function(){for(var e=0;e<this.list.length;e++){var a=this.list[e];if(t.filterTask(a)&&"complete"===a.status)return!0}return!1},selectAll:function(){if(this.list&&this.selected&&!(this.list.length<1)&&this.enableSelectAll)for(var e=this.isAllSelected(),a=0;a<this.list.length;a++){var n=this.list[a];t.filterTask(n)&&(this.selected[n.gid]=!e)}},selectAllFailed:function(){if(this.list&&this.selected&&!(this.list.length<1)&&this.enableSelectAll){for(var e=!0,a=0;a<this.list.length;a++){var n=this.list[a];t.filterTask(n)&&(t.isTaskRetryable(n)&&(this.selected[n.gid]||(e=!1)))}for(a=0;a<this.list.length;a++){n=this.list[a];t.filterTask(n)&&(t.isTaskRetryable(n)?this.selected[n.gid]=!e:this.selected[n.gid]=!1)}}},selectAllPaused:function(){if(this.list&&this.selected&&!(this.list.length<1)&&this.enableSelectAll){for(var e=!0,a=0;a<this.list.length;a++){var n=this.list[a];t.filterTask(n)&&("paused"===n.status&&(this.selected[n.gid]||(e=!1)))}for(a=0;a<this.list.length;a++){n=this.list[a];t.filterTask(n)&&("paused"===n.status?this.selected[n.gid]=!e:this.selected[n.gid]=!1)}}},selectAllCompleted:function(){if(this.list&&this.selected&&!(this.list.length<1)&&this.enableSelectAll){for(var e=!0,a=0;a<this.list.length;a++){var n=this.list[a];t.filterTask(n)&&("complete"===n.status&&(this.selected[n.gid]||(e=!1)))}for(a=0;a<this.list.length;a++){n=this.list[a];t.filterTask(n)&&("complete"===n.status?this.selected[n.gid]=!e:this.selected[n.gid]=!1)}}}},t.clearSearchBox=function(){t.searchContext&&(t.searchContext.text="")},t.filterTask=function(e){return!(!e||!angular.isString(e.taskName))&&(!t.searchContext||!t.searchContext.text||e.taskName.toLowerCase().indexOf(t.searchContext.text.toLowerCase())>=0)},t.isTaskRetryable=function(e){return e&&"error"===e.status&&e.errorDescription&&!e.bittorrent},t.keydownActions={find:function(e){return e.preventDefault&&e.preventDefault(),t.searchContext.setSearchBoxFocused(),!1}},t.swipeActions={leftSwipe:function(){c.getSwipeGesture()&&(angular.element("body").hasClass("sidebar-collapse")?(!this.extendLeftSwipe||angular.isFunction(this.extendLeftSwipe)&&!this.extendLeftSwipe())&&b():b())},rightSwipe:function(){c.getSwipeGesture()&&(!this.extendRightSwipe||angular.isFunction(this.extendRightSwipe)&&!this.extendRightSwipe())&&angular.element('[data-widget="pushmenu"]').PushMenu("expand")}},t.refreshPage=function(){e.location.reload()},t.setAutoRefreshAfterPageLoad=function(){g=!0},t.setTheme=function(e){"system"===e?v():"dark"===e?h():m()},e.addEventListener("keydown",(function(e){if(c.getKeyboardShortcuts()){var a=angular.element('input[type="text"],textarea').is(":focus");if(o.isCtrlAPressed(e)&&!a){if(angular.isFunction(t.keydownActions.selectAll))return t.keydownActions.selectAll(e)}else if(o.isCtrlFPressed(e)){if(angular.isFunction(t.keydownActions.find))return t.keydownActions.find(e)}else if(o.isDeletePressed(e)&&!a&&angular.isFunction(t.keydownActions.delete))return t.keydownActions.delete(e)}}),!0),c.onFirstAccess((function(){r.notifyInPage("","Tap to configure and get started with AriaNg.",{delay:!1,onClose:function(){a.path("/settings/ariang")}})})),d.onFirstSuccess((function(e){r.notifyInPage("","is connected",{type:"success",contentPrefix:e.rpcName+" "})})),d.onConnectionSuccess((function(){i((function(){"Connected"!==t.taskContext.rpcStatus&&(t.taskContext.rpcStatus="Connected"),t.taskContext.isRpcOptionsSet||(!function(){const e=c.getRpcOptions();if(0==Object.keys(e).length)return;const t=c.getCurrentRpcDisplayName();u.getGlobalOption((function(a){if(a.success)try{let n=a.data;for(const a of Object.keys(e)){let i=e[a]||"",s=n[a]||"";if("Bytes"===p[a].suffix&&(s=y(s)),s.toLowerCase()!==i.toLowerCase()){u.setGlobalOptions(e,(function(){r.notifyInPage("","settings have taken effect",{type:"success",contentPrefix:t+" "})}));break}}}catch(e){l.warn("[root.initAria2Options] ",e)}}))}(),t.taskContext.isRpcOptionsSet=!0)}))})),d.onConnectionFailed((function(){i((function(){"Disconnected"!==t.taskContext.rpcStatus&&(t.taskContext.rpcStatus="Disconnected"),t.taskContext.isRpcOptionsSet&&(t.taskContext.isRpcOptionsSet=!1)}))})),d.onConnectionReconnecting((function(){i((function(){"Reconnecting"!==t.taskContext.rpcStatus&&(t.taskContext.rpcStatus="Reconnecting"),t.taskContext.isRpcOptionsSet&&(t.taskContext.isRpcOptionsSet=!1)}))})),d.onConnectionWaitingToReconnect((function(){i((function(){"Waiting to reconnect"!==t.taskContext.rpcStatus&&(t.taskContext.rpcStatus="Waiting to reconnect"),t.taskContext.isRpcOptionsSet&&(t.taskContext.isRpcOptionsSet=!1)}))})),d.onTaskCompleted((function(e){r.notifyTaskComplete(e.task)})),d.onBtTaskCompleted((function(e){r.notifyBtTaskComplete(e.task)})),d.onTaskErrorOccur((function(e){r.notifyTaskError(e.task)})),t.$on("$locationChangeStart",(function(e){s.closeAllDialogs(),t.loadPromise=null,delete t.keydownActions.selectAll,delete t.keydownActions.delete,delete t.swipeActions.extendLeftSwipe,delete t.swipeActions.extendRightSwipe,angular.isArray(t.taskContext.list)&&t.taskContext.list.length>0&&(t.taskContext.list.length=0),angular.isObject(t.taskContext.selected)&&(t.taskContext.selected={}),t.taskContext.enableSelectAll=!1})),t.$on("$routeChangeStart",(function(e,t,i){!function(e){angular.element("section.sidebar > ul li a").removeClass("active"),angular.element("ul.nav-sidebar a").each((function(t,a){var n=angular.element(a).attr("href").substring(2);f(n,e)&&angular.element(a).addClass("active")})),angular.element("ul.nav-treeview a").each((function(t,a){var n=angular.element(a).attr("href").substring(2);f(n,e)&&angular.element(a).parentsUntil(".nav-sidebar > .nav-treeview").prev("a").addClass("active").parent().addClass("menu-open")}))}(a.path()),n.unbind("keypress")})),c.isBrowserSupportDarkMode())&&e.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",(function(e){l.info("[root] system switches to "+(e.matches?"dark":"light")+" theme"),"system"===c.getTheme()&&(e.matches?h():m())}));t.$on("$locationChangeSuccess",(function(t,a){g&&e.location.reload()})),"system"===c.getTheme()?v():"dark"===c.getTheme()?h():m(),function(){var e=c.getBrowserFeatures();if(e.localStorage||l.warn("[root.initCheck] LocalStorage is not supported!"),e.cookies||l.warn("[root.initCheck] Cookies is not supported!"),!c.isBrowserSupportStorage())throw angular.element("body").prepend('<div class="disable-overlay"></div>'),angular.element(".main-sidebar").addClass("blur"),angular.element(".navbar").addClass("blur"),angular.element(".content-body").addClass("blur"),r.notifyInPage("","You cannot use AriaNg because this browser does not meet the minimum requirements for data storage.",{type:"error",delay:!1}),new Error("You cannot use AriaNg because this browser does not meet the minimum requirements for data storage.")}(),angular.element("section.sidebar > ul > li[data-href-match] > a").on("click",(function(){angular.element("section.sidebar > ul li a").removeClass("active"),angular.element(this).addClass("active")})),angular.element("section.sidebar > ul > li > ul.nav-treeview > li[data-href-match] > a").on("click",(function(){angular.element("section.sidebar > ul li a").removeClass("active"),angular.element(this).addClass("active").parent().parent().siblings("a").addClass("active")}))}])}(),function(){"use strict";angular.module("ariaNg").constant("ariaNgConstants",{title:"AriaNg",appPrefix:"AriaNg",optionStorageKey:"Options",browserNotificationHistoryStorageKey:"Notifications",languageStorageKeyPrefix:"Language",settingHistoryKeyPrefix:"History",languagePath:"langs",languageFileExtension:".txt",defaultLanguage:"en",defaultHost:"localhost",defaultSecureProtocol:"https",defaultPathSeparator:"/",httpRequestTimeout:2e4,globalStatStorageCapacity:120,taskStatStorageCapacity:300,lazySaveTimeout:500,errorTooltipDelay:500,notificationInPageTimeout:2e3,historyMaxStoreCount:10,cachedDebugLogsLimit:100}).constant("ariaNgDefaultOptions",{language:"en",theme:"light",title:"${downspeed}, ${upspeed} - ${title}",titleRefreshInterval:5e3,browserNotification:!1,browserNotificationSound:!0,browserNotificationFrequency:"unlimited",rpcAlias:"",rpcHost:"",rpcPort:"6800",rpcInterface:"jsonrpc",protocol:"http",httpMethod:"POST",rpcRequestHeaders:"",rpcOptions:{},secret:"",extendRpcServers:[],webSocketReconnectInterval:5e3,globalStatRefreshInterval:1e3,downloadTaskRefreshInterval:1e3,keyboardShortcuts:!0,swipeGesture:!0,dragAndDropTasks:!0,rpcListDisplayOrder:"recentlyUsed",afterCreatingNewTask:"task-list",removeOldTaskAfterRetrying:!1,confirmTaskRemoval:!0,includePrefixWhenCopyingFromTaskDetails:!0,showPiecesInfoInTaskDetailPage:"le10240",afterRetryingTask:"task-list-default",taskListIndependentDisplayOrder:!0,displayOrder:"default:asc",downloadingTaskListPageDisplayOrder:"default:asc",waitingTaskListPageDisplayOrder:"default:asc",stoppedTaskListPageDisplayOrder:"default:asc",fileListDisplayOrder:"default:asc",peerListDisplayOrder:"default:asc",defaultTaskPage:"all",recCount:0,compactMode:!1}).constant("aria2eConstants",{recommendOrigin:"https://rec.aria2e.com",recManifestUrl:"https://rec.aria2e.com/manifest.json"})}(),function(){"use strict";angular.module("ariaNg").constant("ariaNgBuildConfiguration",{buildVersion:"v1.3.7e",buildCommit:"9b1e06f"})}(),function(){"use strict";angular.module("ariaNg").config(["$qProvider","$translateProvider","localStorageServiceProvider","NotificationProvider","ariaNgConstants","ariaNgLanguages",function(e,t,a,n,i,s){e.errorOnUnhandledRejections(!1),a.setPrefix(i.appPrefix).setStorageType("localStorage").setStorageCookie(365,"/");var o=[],r={};for(var l in s)if(s.hasOwnProperty(l)){var c=s[l].aliases;if(o.push(l),angular.isArray(c)&&!(c.length<1))for(var d=0;d<c.length;d++){r[c[d]]=l}}t.useLoader("ariaNgLanguageLoader").useLoaderCache(!0).registerAvailableLanguageKeys(o,r).fallbackLanguage(i.defaultLanguage).useSanitizeValueStrategy("escapeParameters"),n.setOptions({delay:i.notificationInPageTimeout})}])}(),function(){"use strict";angular.module("ariaNg").constant("ariaNgFileTypes",{video:{name:"Videos",extensions:[".3g2",".3gp",".3gp2",".3gpp",".asf",".asx",".avi",".dat",".divx",".flv",".m1v",".m2ts",".m2v",".m4v",".mkv",".mov",".mp4",".mpe",".mpeg",".mpg",".mts",".ogv",".qt",".ram",".rm",".rmvb",".ts",".vob",".wmv"]},audio:{name:"Audios",extensions:[".aac",".ac3",".adts",".amr",".ape",".eac3",".flac",".m1a",".m2a",".m4a",".mid",".mka",".mp2",".mp3",".mpa",".mpc",".ogg",".ra",".tak",".vqf",".wm",".wav",".wma",".wv"]},picture:{name:"Pictures",extensions:[".abr",".bmp",".emf",".gif",".j2c",".j2k",".jfif",".jif",".jp2",".jpc",".jpe",".jpeg",".jpf",".jpg",".jpk",".jpx",".pcx",".pct",".pic",".pict",".png",".pns",".psd",".psdx",".raw",".svg",".svgz",".tga",".tif",".tiff",".wbm",".wbmp",".webp",".wmf",".xif"]},document:{name:"Documents",extensions:[".csv",".doc",".docm",".docx",".dot",".dotm",".dotx",".key",".mpp",".numbers",".odp",".ods",".odt",".pages",".pdf",".pot",".potm",".potx",".pps",".ppsm",".ppsx",".ppt",".pptm",".pptx",".rtf",".txt",".vsd",".vsdx",".wk1",".wk2",".wk3",".wk4",".wks",".wpd",".wps",".xla",".xlam",".xll",".xlm",".xls",".xlsb",".xlsm",".xlsx",".xlt",".xltx",".xlw",".xps"]},application:{name:"Applications",extensions:[".apk",".bat",".com",".deb",".dll",".dmg",".exe",".ipa",".jar",".msi",".rpm",".sh"]},archive:{name:"Archives",extensions:[".001",".7z",".ace",".arj",".bz2",".cab",".cbr",".cbz",".gz",".img",".iso",".lzh",".qcow2",".r",".rar",".sef",".tar",".taz",".tbz",".tbz2",".uue",".vdi",".vhd",".vmdk",".wim",".xar",".xz",".z",".zip"]}})}(),function(){"use strict";angular.module("ariaNg").run(["moment","ariaNgLocalizationService","ariaNgSettingService",function(e,t,a){var n=a.getLanguage();e.updateLocale("zh-cn",{week:null}),t.applyLanguage(n)}])}(),function(){"use strict";angular.module("ariaNg").config(["$compileProvider",function(e){e.aHrefSanitizationWhitelist(/^\s*(https?|ftp|chrome-extension|file|aria2):/)}])}(),function(){"use strict";angular.module("ariaNg").constant("ariaNgLanguages",{en:{name:"English",displayName:"English"},zh_Hans:{name:"Simplified Chinese",displayName:"简体中文",aliases:["zh_CHS","zh_CN","zh_SG"]},zh_Hant:{name:"Traditional Chinese",displayName:"繁體中文",aliases:["zh_CHT","zh_TW","zh_HK","zh_MO"]}})}(),function(){"use strict";angular.module("ariaNg").config(["$translateProvider","ariaNgConstants",function(e,t){e.translations(t.defaultLanguage,{"AriaNg Version":"AriaNg Version","Operation Result":"Operation Result","Operation Succeeded":"Operation Succeeded","is connected":"is connected",Error:"Error",OK:"OK",Confirm:"Confirm",Cancel:"Cancel",Close:"Close",True:"True",False:"False",DEBUG:"Debug",INFO:"Info",WARN:"Warn",ERROR:"Error",Connecting:"Connecting",Connected:"Connected",Disconnected:"Disconnected",Reconnecting:"Reconnecting","Waiting to reconnect":"Waiting to reconnect",Global:"Global",New:"New",Start:"Start",Pause:"Pause",Retry:"Retry","Retry Selected Tasks":"Retry Selected Tasks",Delete:"Delete","Select All":"Select All","Select None":"Select None","Select Invert":"Select Invert","Select All Failed Tasks":"Select Failed Tasks","Select All Completed Tasks":"Select Completed Tasks","Select All Tasks":"Select All Tasks","Display Order":"Display Order","Copy Download Url":"Copy Download Url","Copy Magnet Link":"Copy Magnet Link",Help:"Help",Search:"Search",Default:"Default",Expand:"Expand",Collapse:"Collapse","Expand All":"Expand All","Collapse All":"Collapse All",Open:"Open",Save:"Save",Import:"Import","Remove Task":"Remove Task","Remove Selected Task":"Remove Selected Task","Clear Stopped Tasks":"Clear Stopped Tasks","Click to view task detail":"Click to view task detail","By File Name":"By File Name","By File Size":"By File Size","By Progress":"By Progress","By Selected Status":"By Selected Status","By Remaining":"By Remaining","By Download Speed":"By Download Speed","By Upload Speed":"By Upload Speed","By Peer Address":"By Peer Address","By Client Name":"By Client Name",Filters:"Filters",Download:"Download",Upload:"Upload",Downloading:"Downloading","Pending Verification":"Pending Verification",Verifying:"Verifying",Seeding:"Seeding",Waiting:"Waiting",Paused:"Paused",Completed:"Completed","Error Occurred":"Error Occurred",Removed:"Removed","Finished / Stopped":"Finished / Stopped",Uncompleted:"Uncompleted","Click to pin":"Click to pin",Settings:"Settings","General Settings":"General Settings","Aria2 Settings":"Aria2 Settings","Basic Settings":"Basic Settings","HTTP/FTP/SFTP Settings":"HTTP/FTP/SFTP Settings","HTTP Settings":"HTTP Settings","FTP/SFTP Settings":"FTP/SFTP Settings","BitTorrent Settings":"BitTorrent Settings","Metalink Settings":"Metalink Settings","RPC Settings":"RPC Settings","Advanced Settings":"Advanced Settings","AriaNg Debug Console":"AriaNg Debug Console","Aria2 Status":"Aria2 Status","File Name":"File Name","File Size":"File Size",Progress:"Progress","Share Ratio":"Share Ratio",Remaining:"Remaining","Download Speed":"Download Speed","Upload Speed":"Upload Speed",Links:"Links","Torrent File":"Torrent File","Metalink File":"Metalink File","File Name:":"File Name:",Options:"Options",Overview:"Overview",Pieces:"Pieces",Files:"Files",Peers:"Peers","Task Name":"Task Name","Task Size":"Task Size","Task Status":"Task Status","Error Description":"Error Description","Health Percentage":"Health Percentage","Info Hash":"Info Hash",Seeders:"Seeders",Connections:"Connections","Seed Creation Time":"Seed Creation Time","Download Url":"Download Url","Download Dir":"Download Dir","BT Tracker Servers":"BT Tracker Servers",Copy:"Copy","(Choose Files)":"(Choose Files)",Videos:"Videos",Audios:"Audios",Pictures:"Pictures",Documents:"Documents",Applications:"Applications",Archives:"Archives",Other:"Other",Custom:"Custom","Custom Choose File":"Custom Choose File",Address:"Address",Client:"Client",Status:"Status",Speed:"Speed","(local)":"(local)","No Data":"No Data","No connected peers":"No connected peers","Failed to change some tasks state.":"Failed to change some tasks state.","Confirm Retry":"Confirm Retry","Are you sure you want to retry the selected task? AriaNg will create same task after clicking OK.":"Are you sure you want to retry the selected task? AriaNg will create same task after clicking OK.","Failed to retry this task.":"Failed to retry this task.","{successCount} tasks have been retried and {failedCount} tasks are failed.":"{{successCount}} tasks have been retried and {{failedCount}} tasks are failed.","Confirm Remove":"Confirm Remove","Are you sure you want to remove the selected task?":"Are you sure you want to remove the selected task?","Failed to remove some task(s).":"Failed to remove some task(s).","Confirm Clear":"Confirm Clear","Are you sure you want to clear stopped tasks?":"Are you sure you want to clear stopped tasks?","Download Links:":"Download Links:","Open Torrent File":"Open Torrent File","Open Metalink File":"Open Metalink File","Download Now":"Download Now","Download Later":"Download Later","Support multiple URLs, one URL per line.":"Support multiple URLs, one URL per line.","Your browser does not support loading file!":"Your browser does not support loading file!","The selected file type is invalid!":"The selected file type is invalid!","Failed to load file!":"Failed to load file!","Download Completed":"Download Completed","BT Download Completed":"BT Download Completed","Download Error":"Download Error","AriaNg Url":"AriaNg Url","Command API Url":"Command API Url","Export Command API":"Export Command API",Export:"Export",Copied:"Copied","Pause After Task Created":"Pause After Task Created",Language:"Language",Theme:"Theme",Light:"Light",Dark:"Dark","Follow system settings":"Follow system settings","Debug Mode":"Debug Mode","Compact Mode":"Compact Mode","Page Title":"Page Title",Preview:"Preview",'Tips: You can use the "noprefix" tag to ignore the prefix, "nosuffix" tag to ignore the suffix, and "scale=n" tag to set the decimal precision.':'Tips: You can use the "noprefix" tag to ignore the prefix, "nosuffix" tag to ignore the suffix, and "scale=n" tag to set the decimal precision.',"Example: ${downspeed:noprefix:nosuffix:scale=1}":"Example: ${downspeed:noprefix:nosuffix:scale=1}","Updating Page Title Interval":"Updating Page Title Interval","Enable Browser Notification":"Enable Browser Notification","Browser Notification Sound":"Browser Notification Sound","Browser Notification Frequency":"Browser Notification Frequency",Unlimited:"Unlimited","High (Up to 10 Notifications / 1 Minute)":"High (Up to 10 Notifications / 1 Minute)","Middle (Up to 1 Notification / 1 Minute)":"Middle (Up to 1 Notification / 1 Minute)","Low (Up to 1 Notification / 5 Minutes)":"Low (Up to 1 Notification / 5 Minutes)","WebSocket Auto Reconnect Interval":"WebSocket Auto Reconnect Interval","Aria2 RPC Alias":"Aria2 RPC Alias","Aria2 RPC Address":"Aria2 RPC Address","Aria2 RPC Protocol":"Aria2 RPC Protocol","Aria2 RPC Http Request Method":"Aria2 RPC Http Request Method","POST method only supports aria2 v1.15.2 and above.":"POST method only supports aria2 v1.15.2 and above.","Aria2 RPC Request Headers":"Aria2 RPC Request Headers",'Support multiple request headers, one header per line, each line containing "header name: header value".':'Support multiple request headers, one header per line, each line containing "header name: header value".',"Aria2 RPC Secret Token":"Aria2 RPC Secret Token",Activate:"Activate","Reset Settings":"Reset Settings","Confirm Reset":"Confirm Reset","Are you sure you want to reset all settings?":"Are you sure you want to reset all settings?","Clear Settings History":"Clear Settings History","Are you sure you want to clear all settings history?":"Are you sure you want to clear all settings history?","Delete RPC Setting":"Delete RPC Setting","Add New RPC Setting":"Add New RPC Setting",'Are you sure you want to remove rpc setting "{rpcName}"?':'Are you sure you want to remove rpc setting "{{rpcName}}"?',"Updating Global Stat Interval":"Updating Global Stat Interval","Updating Task Information Interval":"Updating Task Information Interval","Keyboard Shortcuts":"Keyboard Shortcuts","Supported Keyboard Shortcuts":"Supported Keyboard Shortcuts","Set Focus On Search Box":"Set Focus On Search Box","Swipe Gesture":"Swipe Gesture","Change Tasks Order by Drag-and-drop":"Change Tasks Order by Drag-and-drop","Action After Creating New Tasks":"Action After Creating New Tasks","Navigate to Task List Page":"Navigate to Task List Page","Navigate to Task Detail Page":"Navigate to Task Detail Page","Action After Retrying Task":"Action After Retrying Task","Navigate to Downloading Tasks Page":"Navigate to Downloading Tasks Page","Stay on Current Page":"Stay on Current Page","Remove Old Tasks After Retrying":"Remove Old Tasks After Retrying","Confirm Task Removal":"Confirm Task Removal","Include Prefix When Copying From Task Details":"Include Prefix When Copying From Task Details","Show Pieces Info In Task Detail Page":"Show Pieces Info In Task Detail Page","Pieces Amount is Less than or Equal to {value}":"Pieces Amount is Less than or Equal to {{value}}","RPC List Display Order":"RPC List Display Order","Recently Used":"Recently Used","RPC Alias":"RPC Alias","Import / Export AriaNg Settings":"Import / Export AriaNg Settings","Import Settings":"Import Settings","Export Settings":"Export Settings","AriaNg settings data":"AriaNg settings data","Confirm Import":"Confirm Import","Are you sure you want to import all settings?":"Are you sure you want to import all settings?","Invalid settings data format!":"Invalid settings data format!","Data has been copied to clipboard.":"Data has been copied to clipboard.","Supported Placeholder":"Supported Placeholder","AriaNg Title":"AriaNg Title","Current RPC Alias":"Current RPC Alias","Downloading Count":"Downloading Count","Waiting Count":"Waiting Count","Stopped Count":"Stopped Count","You have disabled notification in your browser. You should change your browser's settings before you enable this function.":"You have disabled notification in your browser. You should change your browser's settings before you enable this function.","Language resource has been updated, please reload the page for the changes to take effect.":"Language resource has been updated, please reload the page for the changes to take effect.","Configuration has been modified, please reload the page for the changes to take effect.":"Configuration has been modified, please reload the page for the changes to take effect.","Reload AriaNg":"Reload AriaNg","Show Secret":"Show Secret","Hide Secret":"Hide Secret","Aria2 Version":"Aria2 Version","Enabled Features":"Enabled Features",Operations:"Operations",Reconnect:"Reconnect","Save Session":"Save Session","Shutdown Aria2":"Shutdown Aria2","Confirm Shutdown":"Confirm Shutdown","Are you sure you want to shutdown aria2?":"Are you sure you want to shutdown aria2?","Session has been saved successfully.":"Session has been saved successfully.","Aria2 has been shutdown successfully.":"Aria2 has been shutdown successfully.","Toggle Navigation":"Toggle Navigation",Shortcut:"Shortcut","Global Rate Limit":"Global Rate Limit",Loading:"Loading...","More Than One Day":"More than 1 day",Unknown:"Unknown",Bytes:"Bytes",Hours:"Hours",Minutes:"Minutes",Seconds:"Seconds",Milliseconds:"Milliseconds",Http:"Http","Http (Disabled)":"Http (Disabled)",Https:"Https",WebSocket:"WebSocket","WebSocket (Disabled)":"WebSocket (Disabled)","WebSocket (Security)":"WebSocket (Security)","Insecure Http and WebSocket would be disabled when accessing AriaNg via Https.":"Insecure Http and WebSocket would be disabled when accessing AriaNg via Https.",POST:"POST",GET:"GET",Enabled:"Enabled",Disabled:"Disabled",Always:"Always",Never:"Never",BitTorrent:"BitTorrent","Changes to the settings take effect after refreshing page.":"Changes to the settings take effect after refreshing page.","Logging Time":"Logging Time","Log Level":"Log Level","Auto Refresh":"Auto Refresh","Refresh Now":"Refresh Now","Clear Logs":"Clear Logs","Are you sure you want to clear debug logs?":"Are you sure you want to clear debug logs?","Show Detail":"Show Detail","Log Detail":"Log Detail","Aria2 RPC Debug":"Aria2 RPC Debug","Aria2 RPC Request Method":"Aria2 RPC Request Method","Aria2 RPC Request Parameters":"Aria2 RPC Request Parameters","Aria2 RPC Response":"Aria2 RPC Response",Execute:"Execute","RPC method is illegal!":"RPC method is illegal!","AriaNg does not support this RPC method!":"AriaNg does not support this RPC method!","RPC request parameters are invalid!":"RPC request parameters are invalid!","Type is illegal!":"Type is illegal!","Parameter is invalid!":"Parameter is invalid!","Option value cannot be empty!":"Option value cannot be empty!","Input number is invalid!":"Input number is invalid!","Input number is below min value!":"Input number is below min value {{value}}!","Input number is above max value!":"Input number is above max value {{value}}!","Input value is invalid!":"Input value is invalid!","Protocol is invalid!":"Protocol is invalid!","RPC host cannot be empty!":"RPC host cannot be empty!","RPC secret is not base64 encoded!":"RPC secret is not base64 encoded!","URL is not base64 encoded!":"URL is not base64 encoded!","Tap to configure and get started with AriaNg.":"Tap to configure and get started with AriaNg.","Cannot initialize WebSocket!":"Cannot initialize WebSocket!","Cannot connect to aria2!":"Cannot connect to aria2!","Access Denied!":"Access Denied!","You cannot use AriaNg because this browser does not meet the minimum requirements for data storage.":"You cannot use AriaNg because this browser does not meet the minimum requirements for data storage.",error:{unknown:"Unknown error occurred.","operation.timeout":"Operation timed out.","resource.notfound":"Resource was not found.","error.resource.notfound.max-file-not-found":"Resource was not found. See --max-file-not-found option.","error.download.aborted.lowest-speed-limit":"Download is aborted because download speed was too slow. See --lowest-speed-limit option.","network.problem":"Network problem occurred.","resume.notsupported":"Remote server does not support resume.","space.notenough":"There was not enough disk space available.","piece.length.different":"Piece length was different from one in .aria2 control file. See --allow-piece-length-change option.","download.sametime":"aria2 was downloading same file at that moment.","download.torrent.sametime":"aria2 was downloading same file at that moment.","file.exists":"File already existed. See --allow-overwrite option.","file.rename.failed":"Failed to rename file. See --auto-file-renaming option.","file.open.failed":"Failed to open existing file.","file.create.failed":"Failed to create new file or truncate existing file.","io.error":"Filesystem error occurred.","directory.create.failed":"Failed to create directory.","name.resolution.failed":"Failed to resolve domain name.","metalink.file.parse.failed":"Failed to parse Metalink document.","ftp.command.failed":"FTP command failed.","http.response.header.bad":"HTTP response header was bad or unexpected.","redirects.toomany":"Too many redirects occurred.","http.authorization.failed":"HTTP authorization failed.","bencoded.file.parse.failed":'Failed to parse bencoded file (usually ".torrent" file).',"torrent.file.corrupted":'The ".torrent" file was corrupted or missing information that aria2 needed.',"magnet.uri.bad":"Magnet URI was bad.","option.bad":"Bad/unrecognized option was given or unexpected option argument was given.","server.overload":"The remote server was unable to handle the request due to a temporary overloading or maintenance.","rpc.request.parse.failed":"Failed to parse JSON-RPC request.","checksum.failed":"Checksum validation failed."},languages:{English:"English","Simplified Chinese":"Simplified Chinese","Traditional Chinese":"Traditional Chinese"},format:{longdate:"MM/DD/YYYY HH:mm:ss","time.millisecond":"{{value}} Millisecond","time.milliseconds":"{{value}} Milliseconds","time.second":"{{value}} Second","time.seconds":"{{value}} Seconds","time.minute":"{{value}} Minute","time.minutes":"{{value}} Minutes","time.hour":"{{value}} Hour","time.hours":"{{value}} Hours","requires.aria2-version":"Requires aria2 v{{version}} or higher","task.new.download-links":"Download Links ({{count}} Links):","task.pieceinfo":"Completed: {{completed}}, Total: {{total}}","task.error-occurred":"Error Occurred ({{errorcode}})","task.verifying-percent":"Verifying ({{verifiedPercent}}%)","settings.file-count":"({{count}} Files)","settings.total-count":"(Total Count: {{count}})","debug.latest-logs":"Latest {{count}} Logs"},rpc:{error:{unauthorized:"Authorization Failed!"}},option:{true:"True",false:"False",default:"Default",none:"None",hide:"Hide",full:"Full",http:"Http",https:"Https",ftp:"Ftp",mem:"Memory Only",get:"GET",tunnel:"TUNNEL",plain:"Plain",arc4:"ARC4",binary:"Binary",ascii:"ASCII",debug:"Debug",info:"Info",notice:"Notice",warn:"Warn",error:"Error",adaptive:"adaptive",epoll:"epoll",falloc:"falloc",feedback:"feedback",geom:"geom",inorder:"inorder",kqueue:"kqueue",poll:"poll",port:"port",prealloc:"prealloc",random:"random",select:"select",trunc:"trunc",SSLv3:"SSLv3",TLSv1:"TLSv1","TLSv1.1":"TLSv1.1","TLSv1.2":"TLSv1.2"},options:{"dir.name":"Download Path","dir.description":"","log.name":"Log File","log.description":'The file name of the log file. If - is specified, log is written to stdout. If empty string("") is specified, or this option is omitted, no log is written to disk at all.',"max-concurrent-downloads.name":"Max Concurrent Downloads","max-concurrent-downloads.description":"","check-integrity.name":"Check Integrity","check-integrity.description":"Check file integrity by validating piece hashes or a hash of entire file. This option has effect only in BitTorrent, Metalink downloads with checksums or HTTP(S)/FTP downloads with --checksum option.","continue.name":"Resume Download","continue.description":"Continue downloading a partially downloaded file. Use this option to resume a download started by a web browser or another program which downloads files sequentially from the beginning. Currently this option is only applicable to HTTP(S)/FTP downloads.","all-proxy.name":"Proxy Server","all-proxy.description":"Use a proxy server for all protocols. You also can override this setting and specify a proxy server for a particular protocol using --http-proxy, --https-proxy and --ftp-proxy This affects all downloads. The format of PROXY is [http://][USER:PASSWORD@]HOST[:PORT].","all-proxy-user.name":"Proxy User Name","all-proxy-user.description":"","all-proxy-passwd.name":"Proxy Password","all-proxy-passwd.description":"","checksum.name":"Checksum","checksum.description":"Set checksum. The option value format is TYPE=DIGEST. TYPE is hash type. The supported hash type is listed in Hash Algorithms in aria2c -v. DIGEST is hex digest. For example, setting sha-1 digest looks like this: sha-1=0192ba11326fe2298c8cb4de616f4d4140213838 This option applies only to HTTP(S)/FTP downloads.","connect-timeout.name":"Connect Timeout","connect-timeout.description":"Set the connect timeout in seconds to establish connection to HTTP/FTP/proxy server. After the connection is established, this option makes no effect and --timeout option is used instead.","dry-run.name":"Dry Run","dry-run.description":"If true is given, aria2 just checks whether the remote file is available and doesn't download data. This option has effect on HTTP/FTP download. BitTorrent downloads are canceled if true is specified.","lowest-speed-limit.name":"Lowest Speed Limit","lowest-speed-limit.description":"Close connection if download speed is lower than or equal to this value(bytes per sec). 0 means aria2 does not have a lowest speed limit. You can append K or M (1K = 1024, 1M = 1024K). This option does not affect BitTorrent downloads.","max-connection-per-server.name":"Max Connection Per Server","max-connection-per-server.description":"Max Connection Per Server is hardcoded to 16, if you want more than this, you need to build your own version of aria2.","max-file-not-found.name":"Max File Not Found Try Times","max-file-not-found.description":'If aria2 receives "file not found" status from the remote HTTP/FTP servers NUM times without getting a single byte, then force the download to fail. Specify 0 to disable this option. This options is effective only when using HTTP/FTP servers. The number of retry attempt is counted toward --max-tries, so it should be configured too.',"max-tries.name":"Max Try Times","max-tries.description":"Set number of tries. 0 means unlimited.","min-split-size.name":"Min Split Size","min-split-size.description":"aria2 does not split less than 2*SIZE byte range. For example, let's consider downloading 20MiB file. If SIZE is 10M, aria2 can split file into 2 range [0-10MiB) and [10MiB-20MiB) and download it using 2 sources(if --split >= 2, of course). If SIZE is 15M, since 2*15M > 20MiB, aria2 does not split file and download it using 1 source. You can append K or M (1K = 1024, 1M = 1024K). Possible Values: 1M-1024M.","netrc-path.name":".netrc Path","netrc-path.description":"","no-netrc.name":"Disable netrc","no-netrc.description":"","no-proxy.name":"No Proxy List","no-proxy.description":"Specify a comma separated list of host names, domains and network addresses with or without a subnet mask where no proxy should be used.","out.name":"File Name","out.description":"The file name of the downloaded file. It is always relative to the directory given in --dir option. When the --force-sequential option is used, this option is ignored.","proxy-method.name":"Proxy Method","proxy-method.description":"Set the method to use in proxy request. METHOD is either GET or TUNNEL. HTTPS downloads always use TUNNEL regardless of this option.","remote-time.name":"Remote File Timestamp","remote-time.description":"Retrieve timestamp of the remote file from the remote HTTP/FTP server and if it is available, apply it to the local file.","reuse-uri.name":"Reuse Uri","reuse-uri.description":"Reuse already used URIs if no unused URIs are left.","retry-wait.name":"Retry Wait","retry-wait.description":"Set the seconds to wait between retries. When SEC > 0, aria2 will retry downloads when the HTTP server returns a 503 response.","server-stat-of.name":"Server Stat Output","server-stat-of.description":"Specify the file name to which performance profile of the servers is saved. You can load saved data using --server-stat-if option.","server-stat-timeout.name":"Server Stat Timeout","server-stat-timeout.description":"Specifies timeout in seconds to invalidate performance profile of the servers since the last contact to them.","split.name":"Split Count","split.description":"Download a file using N connections. If more than N URIs are given, first N URIs are used and remaining URIs are used for backup. If less than N URIs are given, those URIs are used more than once so that N connections total are made simultaneously. The number of connections to the same host is restricted by the --max-connection-per-server option.","stream-piece-selector.name":"Piece Selection Algorithm","stream-piece-selector.description":"Specify piece selection algorithm used in HTTP/FTP download. Piece means fixed length segment which is downloaded in parallel in segmented download. If default is given, aria2 selects piece so that it reduces the number of establishing connection. This is reasonable default behavior because establishing connection is an expensive operation. If inorder is given, aria2 selects piece which has minimum index. Index=0 means first of the file. This will be useful to view movie while downloading it. --enable-http-pipelining option may be useful to reduce re-connection overhead. Please note that aria2 honors --min-split-size option, so it will be necessary to specify a reasonable value to --min-split-size option. If random is given, aria2 selects piece randomly. Like inorder, --min-split-size option is honored. If geom is given, at the beginning aria2 selects piece which has minimum index like inorder, but it exponentially increasingly keeps space from previously selected piece. This will reduce the number of establishing connection and at the same time it will download the beginning part of the file first. This will be useful to view movie while downloading it.","timeout.name":"Timeout","timeout.description":"","uri-selector.name":"URI Selection Algorithm","uri-selector.description":"Specify URI selection algorithm. The possible values are inorder, feedback and adaptive. If inorder is given, URI is tried in the order appeared in the URI list. If feedback is given, aria2 uses download speed observed in the previous downloads and choose fastest server in the URI list. This also effectively skips dead mirrors. The observed download speed is a part of performance profile of servers mentioned in --server-stat-of and --server-stat-if If adaptive is given, selects one of the best mirrors for the first and reserved connections. For supplementary ones, it returns mirrors which has not been tested yet, and if each of them has already been tested, returns mirrors which has to be tested again. Otherwise, it doesn't select anymore mirrors. Like feedback, it uses a performance profile of servers.","check-certificate.name":"Check Certificate","check-certificate.description":"","http-accept-gzip.name":"Accept GZip","http-accept-gzip.description":"Send Accept: deflate, gzip request header and inflate response if remote server responds with Content-Encoding: gzip or Content-Encoding: deflate.","http-auth-challenge.name":"Auth Challenge","http-auth-challenge.description":"Send HTTP authorization header only when it is requested by the server. If false is set, then authorization header is always sent to the server. There is an exception: if user name and password are embedded in URI, authorization header is always sent to the server regardless of this option.","http-no-cache.name":"No Cache","http-no-cache.description":"Send Cache-Control: no-cache and Pragma: no-cache header to avoid cached content. If false is given, these headers are not sent and you can add Cache-Control header with a directive you like using --header option.","http-user.name":"HTTP Default User Name","http-user.description":"","http-passwd.name":"HTTP Default Password","http-passwd.description":"","http-proxy.name":"HTTP Proxy Server","http-proxy.description":"","http-proxy-user.name":"HTTP Proxy User Name","http-proxy-user.description":"","http-proxy-passwd.name":"HTTP Proxy Password","http-proxy-passwd.description":"","https-proxy.name":"HTTPS Proxy Server","https-proxy.description":"","https-proxy-user.name":"HTTPS Proxy User Name","https-proxy-user.description":"","https-proxy-passwd.name":"HTTPS Proxy Password","https-proxy-passwd.description":"","referer.name":"Referer","referer.description":"Set an http referrer (Referer). This affects all http/https downloads. If * is given, the download URI is also used as the referrer. This may be useful when used together with the --parameterized-uri option.","enable-http-keep-alive.name":"Enable Persistent Connection","enable-http-keep-alive.description":"Enable HTTP/1.1 persistent connection.","enable-http-pipelining.name":"Enable HTTP Pipelining","enable-http-pipelining.description":"Enable HTTP/1.1 pipelining.","header.name":"Custom Header","header.description":'Append HEADER to HTTP request header. Put one item per line, each item containing "header name: header value".',"save-cookies.name":"Cookies Path","save-cookies.description":"Save Cookies to FILE in Mozilla/Firefox(1.x/2.x)/ Netscape format. If FILE already exists, it is overwritten. Session Cookies are also saved and their expiry values are treated as 0.","use-head.name":"Use HEAD Method","use-head.description":"Use HEAD method for the first request to the HTTP server.","user-agent.name":"Custom User Agent","user-agent.description":"","ftp-user.name":"FTP Default User Name","ftp-user.description":"","ftp-passwd.name":"FTP Default Password","ftp-passwd.description":"If user name is embedded but password is missing in URI, aria2 tries to resolve password using .netrc. If password is found in .netrc, then use it as password. If not, use the password specified in this option.","ftp-pasv.name":"Passive Mode","ftp-pasv.description":"Use the passive mode in FTP. If false is given, the active mode will be used. This option is ignored for SFTP transfer.","ftp-proxy.name":"FTP Proxy Server","ftp-proxy.description":"","ftp-proxy-user.name":"FTP Proxy User Name","ftp-proxy-user.description":"","ftp-proxy-passwd.name":"FTP Proxy Password","ftp-proxy-passwd.description":"","ftp-type.name":"Transfer Type","ftp-type.description":"","ftp-reuse-connection.name":"Reuse Connection","ftp-reuse-connection.description":"","ssh-host-key-md.name":"SSH Public Key Checksum","ssh-host-key-md.description":"Set checksum for SSH host public key. The option value format is TYPE=DIGEST. TYPE is hash type. The supported hash type is sha-1 or md5. DIGEST is hex digest. For example: sha-1=b030503d4de4539dc7885e6f0f5e256704edf4c3. This option can be used to validate server's public key when SFTP is used. If this option is not set, which is default, no validation takes place.","bt-detach-seed-only.name":"Detach Seed Only","bt-detach-seed-only.description":"Exclude seed only downloads when counting concurrent active downloads (See -j option). This means that if -j3 is given and this option is turned on and 3 downloads are active and one of those enters seed mode, then it is excluded from active download count (thus it becomes 2), and the next download waiting in queue gets started. But be aware that seeding item is still recognized as active download in RPC method.","bt-enable-hook-after-hash-check.name":"Enable Hook After Hash Check","bt-enable-hook-after-hash-check.description":"Allow hook command invocation after hash check (see -V option) in BitTorrent download. By default, when hash check succeeds, the command given by --on-bt-download-complete is executed. To disable this action, give false to this option.","bt-enable-lpd.name":"Enable Local Peer Discovery (LPD)","bt-enable-lpd.description":"Enable Local Peer Discovery. If a private flag is set in a torrent, aria2 doesn't use this feature for that download even if true is given.","bt-exclude-tracker.name":"BitTorrent Exclude Trackers","bt-exclude-tracker.description":"Comma separated list of BitTorrent tracker's announce URI to remove. You can use special value * which matches all URIs, thus removes all announce URIs. When specifying * in shell command-line, don't forget to escape or quote it.","bt-external-ip.name":"External IP","bt-external-ip.description":"Specify the external IP address to use in BitTorrent download and DHT. It may be sent to BitTorrent tracker. For DHT, this option should be set to report that local node is downloading a particular torrent. This is critical to use DHT in a private network. Although this function is named external, it can accept any kind of IP addresses.","bt-force-encryption.name":"Force Encryption","bt-force-encryption.description":"Requires BitTorrent message payload encryption with arc4. This is a shorthand of --bt-require-crypto --bt-min-crypto-level=arc4. This option does not change the option value of those options. If true is given, deny legacy BitTorrent handshake and only use Obfuscation handshake and always encrypt message payload.","bt-hash-check-seed.name":"Hash Check Before Seeding","bt-hash-check-seed.description":"If true is given, after hash check using --check-integrity option and file is complete, continue to seed file. If you want to check file and download it only when it is damaged or incomplete, set this option to false. This option has effect only on BitTorrent download.","bt-load-saved-metadata.name":"Load Saved Metadata File","bt-load-saved-metadata.description":"Before getting torrent metadata from DHT when downloading with magnet link, first try to read file saved by --bt-save-metadata option. If it is successful, then skip downloading metadata from DHT.","bt-max-open-files.name":"Max Open Files","bt-max-open-files.description":"Specify maximum number of files to open in multi-file BitTorrent/Metalink download globally.","bt-max-peers.name":"Max Peers","bt-max-peers.description":"Specify the maximum number of peers per torrent. 0 means unlimited.","bt-metadata-only.name":"Download Metadata Only","bt-metadata-only.description":"Download meta data only. The file(s) described in meta data will not be downloaded. This option has effect only when BitTorrent Magnet URI is used.","bt-min-crypto-level.name":"Min Crypto Level","bt-min-crypto-level.description":"Set minimum level of encryption method. If several encryption methods are provided by a peer, aria2 chooses the lowest one which satisfies the given level.","bt-prioritize-piece.name":"Prioritize Piece","bt-prioritize-piece.description":"Try to download first and last pieces of each file first. This is useful for previewing files. The argument can contain 2 keywords: head and tail. To include both keywords, they must be separated by comma. These keywords can take one parameter, SIZE. For example, if head=SIZE is specified, pieces in the range of first SIZE bytes of each file get higher priority. tail=SIZE means the range of last SIZE bytes of each file. SIZE can include K or M (1K = 1024, 1M = 1024K).","bt-remove-unselected-file.name":"Remove Unselected File","bt-remove-unselected-file.description":"Removes the unselected files when download is completed in BitTorrent. To select files, use --select-file option. If it is not used, all files are assumed to be selected. Please use this option with care because it will actually remove files from your disk.","bt-require-crypto.name":"Require Crypto","bt-require-crypto.description":"If true is given, aria2 doesn't accept and establish connection with legacy BitTorrent handshake(\\19BitTorrent protocol). Thus aria2 always uses Obfuscation handshake.","bt-request-peer-speed-limit.name":"Preferred Download Speed","bt-request-peer-speed-limit.description":"If the whole download speed of every torrent is lower than SPEED, aria2 temporarily increases the number of peers to try for more download speed. Configuring this option with your preferred download speed can increase your download speed in some cases. You can append K or M (1K = 1024, 1M = 1024K).","bt-save-metadata.name":"Save Metadata","bt-save-metadata.description":'Save meta data as ".torrent" file. This option has effect only when BitTorrent Magnet URI is used. The file name is hex encoded info hash with suffix ".torrent". The directory to be saved is the same directory where download file is saved. If the same file already exists, meta data is not saved.',"bt-seed-unverified.name":"Not Verify Downloaded Fileds","bt-seed-unverified.description":"Seed previously downloaded files without verifying piece hashes.","bt-stop-timeout.name":"Stop Timeout","bt-stop-timeout.description":"Stop BitTorrent download if download speed is 0 in consecutive SEC seconds. If 0 is given, this feature is disabled.","bt-tracker.name":"BitTorrent Trackers","bt-tracker.description":"Comma separated list of additional BitTorrent tracker's announce URI. These URIs are not affected by --bt-exclude-tracker option because they are added after URIs in --bt-exclude-tracker option are removed.","bt-tracker-connect-timeout.name":"BitTorrent Tracker Connect Timeout","bt-tracker-connect-timeout.description":"Set the connect timeout in seconds to establish connection to tracker. After the connection is established, this option makes no effect and --bt-tracker-timeout option is used instead.","bt-tracker-interval.name":"BitTorrent Tracker Connect Interval","bt-tracker-interval.description":"Set the interval in seconds between tracker requests. This completely overrides interval value and aria2 just uses this value and ignores the min interval and interval value in the response of tracker. If 0 is set, aria2 determines interval based on the response of tracker and the download progress.","bt-tracker-timeout.name":"BitTorrent Tracker Timeout","bt-tracker-timeout.description":"","dht-file-path.name":"DHT (IPv4) File","dht-file-path.description":"Change the IPv4 DHT routing table file to PATH.","dht-file-path6.name":"DHT (IPv6) File","dht-file-path6.description":"Change the IPv6 DHT routing table file to PATH.","dht-listen-port.name":"DHT Listen Port","dht-listen-port.description":"Set UDP listening port used by DHT(IPv4, IPv6) and UDP tracker. Multiple ports can be specified by using ,, for example: 6881,6885. You can also use - to specify a range: 6881-6999. , and - can be used together.","dht-message-timeout.name":"DHT Message Timeout","dht-message-timeout.description":"","enable-dht.name":"Enable DHT (IPv4)","enable-dht.description":"Enable IPv4 DHT functionality. It also enables UDP tracker support. If a private flag is set in a torrent, aria2 doesn't use DHT for that download even if true is given.","enable-dht6.name":"Enable DHT (IPv6)","enable-dht6.description":"Enable IPv6 DHT functionality. If a private flag is set in a torrent, aria2 doesn't use DHT for that download even if true is given. Use --dht-listen-port option to specify port number to listen on.","enable-peer-exchange.name":"Enable Peer Exchange","enable-peer-exchange.description":"Enable Peer Exchange extension. If a private flag is set in a torrent, this feature is disabled for that download even if true is given.","follow-torrent.name":"Follow Torrent","follow-torrent.description":"If true or mem is specified, when a file whose suffix is .torrent or content type is application/x-bittorrent is downloaded, aria2 parses it as a torrent file and downloads files mentioned in it. If mem is specified, a torrent file is not written to the disk, but is just kept in memory. If false is specified, the .torrent file is downloaded to the disk, but is not parsed as a torrent and its contents are not downloaded.","listen-port.name":"Listen Port","listen-port.description":"Set TCP port number for BitTorrent downloads. Multiple ports can be specified by using ,, for example: 6881,6885. You can also use - to specify a range: 6881-6999. , and - can be used together: 6881-6889,6999.","max-overall-upload-limit.name":"Global Max Upload Limit","max-overall-upload-limit.description":"Set max overall upload speed in bytes/sec. 0 means unrestricted. You can append K or M (1K = 1024, 1M = 1024K).","max-upload-limit.name":"Max Upload Limit","max-upload-limit.description":"Set max upload speed per each torrent in bytes/sec. 0 means unrestricted. You can append K or M (1K = 1024, 1M = 1024K).","peer-id-prefix.name":"Peer ID Prefix","peer-id-prefix.description":"Specify the prefix of peer ID. The peer ID in BitTorrent is 20 byte length. If more than 20 bytes are specified, only first 20 bytes are used. If less than 20 bytes are specified, random byte data are added to make its length 20 bytes.","peer-agent.name":"Peer Agent","peer-agent.description":"Specify the string used during the bitorrent extended handshake for the peer’s client version.","seed-ratio.name":"Min Share Ratio","seed-ratio.description":"Specify share ratio. Seed completed torrents until share ratio reaches RATIO. You are strongly encouraged to specify equals or more than 1.0 here. Specify 0.0 if you intend to do seeding regardless of share ratio. If --seed-time option is specified along with this option, seeding ends when at least one of the conditions is satisfied.","seed-time.name":"Min Seed Time","seed-time.description":"Specify seeding time in (fractional) minutes. Specifying --seed-time=0 disables seeding after download completed.","follow-metalink.name":"Follow Metalink","follow-metalink.description":"If true or mem is specified, when a file whose suffix is .meta4 or .metalink or content type of application/metalink4+xml or application/metalink+xml is downloaded, aria2 parses it as a metalink file and downloads files mentioned in it. If mem is specified, a metalink file is not written to the disk, but is just kept in memory. If false is specified, the .metalink file is downloaded to the disk, but is not parsed as a metalink file and its contents are not downloaded.","metalink-base-uri.name":"Base URI","metalink-base-uri.description":"Specify base URI to resolve relative URI in metalink:url and metalink:metaurl element in a metalink file stored in local disk. If URI points to a directory, URI must end with /.","metalink-language.name":"Language","metalink-language.description":"","metalink-location.name":"Preferred Server Location","metalink-location.description":"The location of the preferred server. A comma-delimited list of locations is acceptable, for example, jp,us.","metalink-os.name":"Operation System","metalink-os.description":"The operating system of the file to download.","metalink-version.name":"Version","metalink-version.description":"The version of the file to download.","metalink-preferred-protocol.name":"Preferred Protocol","metalink-preferred-protocol.description":"Specify preferred protocol. The possible values are http, https, ftp and none. Specify none to disable this feature.","metalink-enable-unique-protocol.name":"Enable Unique Protocol","metalink-enable-unique-protocol.description":"If true is given and several protocols are available for a mirror in a metalink file, aria2 uses one of them. Use --metalink-preferred-protocol option to specify the preference of protocol.","enable-rpc.name":"Enable JSON-RPC/XML-RPC Server","enable-rpc.description":"","pause-metadata.name":"Pause After Metadata Downloaded","pause-metadata.description":"Pause downloads created as a result of metadata download. There are 3 types of metadata downloads in aria2: (1) downloading .torrent file. (2) downloading torrent metadata using magnet link. (3) downloading metalink file. These metadata downloads will generate downloads using their metadata. This option pauses these subsequent downloads. This option is effective only when --enable-rpc=true is given.","rpc-allow-origin-all.name":"Allow All Origin Request","rpc-allow-origin-all.description":"Add Access-Control-Allow-Origin header field with value * to the RPC response.","rpc-listen-all.name":"Listen on All Network Interfaces","rpc-listen-all.description":"Listen incoming JSON-RPC/XML-RPC requests on all network interfaces. If false is given, listen only on local loopback interface.","rpc-listen-port.name":"Listen Port","rpc-listen-port.description":"","rpc-max-request-size.name":"Max Request Size","rpc-max-request-size.description":"Set max size of JSON-RPC/XML-RPC request. If aria2 detects the request is more than SIZE bytes, it drops connection.","rpc-save-upload-metadata.name":"Save Upload Metadata","rpc-save-upload-metadata.description":"Save the uploaded torrent or metalink meta data in the directory specified by --dir option. The file name consists of SHA-1 hash hex string of meta data plus extension. For torrent, the extension is '.torrent'. For metalink, it is '.meta4'. If false is given to this option, the downloads added by aria2.addTorrent() or aria2.addMetalink() will not be saved by --save-session option.","rpc-secure.name":"Enable SSL/TLS","rpc-secure.description":"RPC transport will be encrypted by SSL/TLS. The RPC clients must use https scheme to access the server. For WebSocket client, use wss scheme. Use --rpc-certificate and --rpc-private-key options to specify the server certificate and private key.","allow-overwrite.name":"Allow Overwrite","allow-overwrite.description":"Restart download from scratch if the corresponding control file doesn't exist. See also --auto-file-renaming option.","allow-piece-length-change.name":"Allow Piece Length Change","allow-piece-length-change.description":"If false is given, aria2 aborts download when a piece length is different from one in a control file. If true is given, you can proceed but some download progress will be lost.","always-resume.name":"Always Resume Download","always-resume.description":"Always resume download. If true is given, aria2 always tries to resume download and if resume is not possible, aborts download. If false is given, when all given URIs do not support resume or aria2 encounters N URIs which does not support resume (N is the value specified using --max-resume-failure-tries option), aria2 downloads file from scratch. See --max-resume-failure-tries option.","async-dns.name":"Asynchronous DNS","async-dns.description":"","auto-file-renaming.name":"Auto File Renaming","auto-file-renaming.description":"Rename file name if the same file already exists. This option works only in HTTP(S)/FTP download. The new file name has a dot and a number(1..9999) appended after the name, but before the file extension, if any.","auto-save-interval.name":"Auto Save Interval","auto-save-interval.description":"Save a control file(*.aria2) every SEC seconds. If 0 is given, a control file is not saved during download. aria2 saves a control file when it stops regardless of the value. The possible values are between 0 to 600.","conditional-get.name":"Conditional Download","conditional-get.description":"Download file only when the local file is older than remote file. This function only works with HTTP(S) downloads only. It does not work if file size is specified in Metalink. It also ignores Content-Disposition header. If a control file exists, this option will be ignored. This function uses If-Modified-Since header to get only newer file conditionally. When getting modification time of local file, it uses user supplied file name (see --out option) or file name part in URI if --out is not specified. To overwrite existing file, --allow-overwrite is required.","conf-path.name":"Configuration File","conf-path.description":"","console-log-level.name":"Console Log Level","console-log-level.description":"","content-disposition-default-utf8.name":"Use UTF-8 to Handle Content-Disposition","content-disposition-default-utf8.description":"Handle quoted string in Content-Disposition header as UTF-8 instead of ISO-8859-1, for example, the filename parameter, but not the extended version filename.","daemon.name":"Enable Daemon","daemon.description":"","deferred-input.name":"Deferred Load","deferred-input.description":"If true is given, aria2 does not read all URIs and options from file specified by --input-file option at startup, but it reads one by one when it needs later. This may reduce memory usage if input file contains a lot of URIs to download. If false is given, aria2 reads all URIs and options at startup. --deferred-input option will be disabled when --save-session is used together.","disable-ipv6.name":"Disable IPv6","disable-ipv6.description":"","disk-cache.name":"Disk Cache","disk-cache.description":"Enable disk cache. If SIZE is 0, the disk cache is disabled. This feature caches the downloaded data in memory, which grows to at most SIZE bytes. The cache storage is created for aria2 instance and shared by all downloads. The one advantage of the disk cache is reduce the disk I/O because the data are written in larger unit and it is reordered by the offset of the file. If hash checking is involved and the data are cached in memory, we don't need to read them from the disk. SIZE can include K or M (1K = 1024, 1M = 1024K).","download-result.name":"Download Result","download-result.description":"This option changes the way Download Results is formatted. If OPT is default, print GID, status, average download speed and path/URI. If multiple files are involved, path/URI of first requested file is printed and remaining ones are omitted. If OPT is full, print GID, status, average download speed, percentage of progress and path/URI. The percentage of progress and path/URI are printed for each requested file in each row. If OPT is hide, Download Results is hidden.","dscp.name":"DSCP","dscp.description":"Set DSCP value in outgoing IP packets of BitTorrent traffic for QoS. This parameter sets only DSCP bits in TOS field of IP packets, not the whole field. If you take values from /usr/include/netinet/ip.h divide them by 4 (otherwise values would be incorrect, e.g. your CS1 class would turn into CS4). If you take commonly used values from RFC, network vendors' documentation, Wikipedia or any other source, use them as they are.","rlimit-nofile.name":"Soft Limit of Open File Descriptors","rlimit-nofile.description":"Set the soft limit of open file descriptors. This open will only have effect when: a. The system supports it (posix). b. The limit does not exceed the hard limit. c. The specified limit is larger than the current soft limit. This is equivalent to setting nofile via ulimit, except that it will never decrease the limit. This option is only available on systems supporting the rlimit API.","enable-color.name":"Enable Color in Terminal","enable-color.description":"","enable-mmap.name":"Enable MMap","enable-mmap.description":"Map files into memory. This option may not work if the file space is not pre-allocated. See --file-allocation.","event-poll.name":"Event Polling Method","event-poll.description":"Specify the method for polling events. The possible values are epoll, kqueue, port, poll and select. For each epoll, kqueue, port and poll, it is available if system supports it. epoll is available on recent Linux. kqueue is available on various *BSD systems including Mac OS X. port is available on Open Solaris. The default value may vary depending on the system you use.","file-allocation.name":"File Allocation Method","file-allocation.description":"Specify file allocation method. none doesn't pre-allocate file space. prealloc pre-allocates file space before download begins. This may take some time depending on the size of the file. If you are using newer file systems such as ext4 (with extents support), btrfs, xfs or NTFS(MinGW build only), falloc is your best choice. It allocates large(few GiB) files almost instantly. Don't use falloc with legacy file systems such as ext3 and FAT32 because it takes almost same time as prealloc and it blocks aria2 entirely until allocation finishes. falloc may not be available if your system doesn't have posix_fallocate(3) function. trunc uses ftruncate(2) system call or platform-specific counterpart to truncate a file to a specified length. In multi file torrent downloads, the files adjacent forward to the specified files are also allocated if they share the same piece.","force-save.name":"Force Save","force-save.description":"Save download with --save-session option even if the download is completed or removed. This option also saves control file in that situations. This may be useful to save BitTorrent seeding which is recognized as completed state.","save-not-found.name":"Save Not Found File","save-not-found.description":"Save download with --save-session option even if the file was not found on the server. This option also saves control file in that situations.","hash-check-only.name":"Hash Check Only","hash-check-only.description":"If true is given, after hash check using --check-integrity option, abort download whether or not download is complete.","human-readable.name":"Console Human Readable Output","human-readable.description":"Print sizes and speed in human readable format (e.g., 1.2Ki, 3.4Mi) in the console readout.","keep-unfinished-download-result.name":"Keep Unfinished Download Result","keep-unfinished-download-result.description":"Keep unfinished download results even if doing so exceeds --max-download-result. This is useful if all unfinished downloads must be saved in session file (see --save-session option). Please keep in mind that there is no upper bound to the number of unfinished download result to keep. If that is undesirable, turn this option off.","max-download-result.name":"Max Download Result","max-download-result.description":"Set maximum number of download result kept in memory. The download results are completed/error/removed downloads. The download results are stored in FIFO queue and it can store at most NUM download results. When queue is full and new download result is created, oldest download result is removed from the front of the queue and new one is pushed to the back. Setting big number in this option may result high memory consumption after thousands of downloads. Specifying 0 means no download result is kept. Note that unfinished downloads are kept in memory regardless of this option value. See --keep-unfinished-download-result option.","max-mmap-limit.name":"Max MMap Limit","max-mmap-limit.description":"Set the maximum file size to enable mmap (see --enable-mmap option). The file size is determined by the sum of all files contained in one download. For example, if a download contains 5 files, then file size is the total size of those files. If file size is strictly greater than the size specified in this option, mmap will be disabled.","max-resume-failure-tries.name":"Max Resume Failure Try Times","max-resume-failure-tries.description":"When used with --always-resume=false, aria2 downloads file from scratch when aria2 detects N number of URIs that does not support resume. If N is 0, aria2 downloads file from scratch when all given URIs do not support resume. See --always-resume option.","min-tls-version.name":"Min TLS Version","min-tls-version.description":"Specify minimum SSL/TLS version to enable.","log-level.name":"Log Level","log-level.description":"","optimize-concurrent-downloads.name":"Optimize Concurrent Downloads","optimize-concurrent-downloads.description":"Optimizes the number of concurrent downloads according to the bandwidth available. aria2 uses the download speed observed in the previous downloads to adapt the number of downloads launched in parallel according to the rule N = A + B Log10(speed in Mbps). The coefficients A and B can be customized in the option arguments with A and B separated by a colon. The default values (A=5, B=25) lead to using typically 5 parallel downloads on 1Mbps networks and above 50 on 100Mbps networks. The number of parallel downloads remains constrained under the maximum defined by the --max-concurrent-downloads parameter.","piece-length.name":"Piece Length","piece-length.description":"Set a piece length for HTTP/FTP downloads. This is the boundary when aria2 splits a file. All splits occur at multiple of this length. This option will be ignored in BitTorrent downloads. It will be also ignored if Metalink file contains piece hashes.","show-console-readout.name":"Show Console Output","show-console-readout.description":"","summary-interval.name":"Download Summary Output Interval","summary-interval.description":"Set interval in seconds to output download progress summary. Setting 0 suppresses the output.","max-overall-download-limit.name":"Global Max Download Limit","max-overall-download-limit.description":"Set max overall download speed in bytes/sec. 0 means unrestricted. You can append K or M (1K = 1024, 1M = 1024K).","max-download-limit.name":"Max Download Limit","max-download-limit.description":"Set max download speed per each download in bytes/sec. 0 means unrestricted. You can append K or M (1K = 1024, 1M = 1024K).","no-conf.name":"Disable Configuration File","no-conf.description":"","no-file-allocation-limit.name":"No File Allocation Limit","no-file-allocation-limit.description":"No file allocation is made for files whose size is smaller than SIZE. You can append K or M (1K = 1024, 1M = 1024K).","parameterized-uri.name":"Enable Parameterized URI","parameterized-uri.description":"Enable parameterized URI support. You can specify set of parts: http://{sv1,sv2,sv3}/foo.iso. Also you can specify numeric sequences with step counter: http://host/image[000-100:2].img. A step counter can be omitted. If all URIs do not point to the same file, such as the second example above, -Z option is required.","quiet.name":"Disable Console Output","quiet.description":"","realtime-chunk-checksum.name":"Realtime Data Chunk Validation","realtime-chunk-checksum.description":"Validate chunk of data by calculating checksum while downloading a file if chunk checksums are provided.","remove-control-file.name":"Remove Control File","remove-control-file.description":"Remove control file before download. Using with --allow-overwrite=true, download always starts from scratch. This will be useful for users behind proxy server which disables resume.","save-session.name":"Session Save File","save-session.description":"Save error/unfinished downloads to FILE on exit. You can pass this output file to aria2c with --input-file option on restart. If you like the output to be gzipped append a .gz extension to the file name. Please note that downloads added by aria2.addTorrent() and aria2.addMetalink() RPC method and whose meta data could not be saved as a file are not saved. Downloads removed using aria2.remove() and aria2.forceRemove() will not be saved.","save-session-interval.name":"Save Session Interval","save-session-interval.description":"Save error/unfinished downloads to a file specified by --save-session option every SEC seconds. If 0 is given, file will be saved only when aria2 exits.","socket-recv-buffer-size.name":"Socket Receive Buffer Size","socket-recv-buffer-size.description":"Set the maximum socket receive buffer in bytes. Specifing 0 will disable this option. This value will be set to socket file descriptor using SO_RCVBUF socket option with setsockopt() call.","stop.name":"Auto Shutdown Time","stop.description":"Stop application after SEC seconds has passed. If 0 is given, this feature is disabled.","truncate-console-readout.name":"Truncate Console Output","truncate-console-readout.description":"Truncate console readout to fit in a single line."}})}])}(),function(){"use strict";angular.module("ariaNg").constant("aria2AllOptions",{gid:{type:"string",readonly:!0,required:!0},dir:{type:"string",required:!0},log:{type:"string",required:!0},"max-concurrent-downloads":{type:"integer",defaultValue:"5",required:!0,min:1},"check-integrity":{type:"boolean",defaultValue:"false",required:!0},continue:{type:"boolean",required:!0},"all-proxy":{type:"string"},"all-proxy-user":{type:"string"},"all-proxy-passwd":{type:"string"},checksum:{type:"string",required:!0,pattern:"^(md5|sha-(1|224|256|384|512))=[a-zA-Z0-9]+$"},"connect-timeout":{type:"integer",suffix:"Seconds",defaultValue:"60",required:!0,min:1,max:600},"dry-run":{type:"boolean",defaultValue:"false",required:!0},"lowest-speed-limit":{type:"string",suffix:"Bytes",defaultValue:"0",required:!0,pattern:"^(0|[1-9]\\d*(K|k|M|m)?)$"},"max-connection-per-server":{type:"integer",defaultValue:"1",required:!0,min:1},"max-file-not-found":{type:"integer",defaultValue:"0",required:!0,min:0},"max-tries":{type:"integer",defaultValue:"5",required:!0,min:0},"min-split-size":{type:"string",suffix:"Bytes",defaultValue:"20M",required:!0,pattern:"^(0|[1-9]\\d*(K|k|M|m)?)$"},"netrc-path":{type:"string",readonly:!0,defaultValue:"$(HOME)/.netrc"},"no-netrc":{type:"boolean",required:!0},"no-proxy":{type:"text",separator:",",showCount:!0},out:{type:"string"},"proxy-method":{type:"option",options:["get","tunnel"],defaultValue:"get",required:!0},"remote-time":{type:"boolean",defaultValue:"false",required:!0},"reuse-uri":{type:"boolean",defaultValue:"true",required:!0},"retry-wait":{type:"integer",suffix:"Seconds",defaultValue:"0",required:!0,min:0,max:600},"server-stat-of":{type:"string"},"server-stat-timeout":{type:"integer",suffix:"Seconds",readonly:!0,defaultValue:"86400"},split:{type:"integer",defaultValue:"5",required:!0,min:1},"stream-piece-selector":{type:"option",options:["default","inorder","random","geom"],defaultValue:"default",required:!0},timeout:{type:"integer",suffix:"Seconds",defaultValue:"60",required:!0,min:1,max:600},"uri-selector":{type:"option",options:["inorder","feedback","adaptive"],defaultValue:"feedback",required:!0},"check-certificate":{type:"boolean",readonly:!0,defaultValue:"true"},"http-accept-gzip":{type:"boolean",defaultValue:"false",required:!0},"http-auth-challenge":{type:"boolean",defaultValue:"false",required:!0},"http-no-cache":{type:"boolean",defaultValue:"false",required:!0},"http-user":{type:"string"},"http-passwd":{type:"string"},"http-proxy":{type:"string"},"http-proxy-user":{type:"string"},"http-proxy-passwd":{type:"string"},"https-proxy":{type:"string"},"https-proxy-user":{type:"string"},"https-proxy-passwd":{type:"string"},referer:{type:"string"},"enable-http-keep-alive":{type:"boolean",defaultValue:"true",required:!0},"enable-http-pipelining":{type:"boolean",defaultValue:"false",required:!0},header:{type:"text",separator:"\n",overrideMode:"append",submitFormat:"array",showCount:!0,trimCount:!0},"save-cookies":{type:"string"},"use-head":{type:"boolean",defaultValue:"false",required:!0},"user-agent":{type:"string",defaultValue:"aria2/$VERSION"},"ftp-user":{type:"string",defaultValue:"anonymous"},"ftp-passwd":{type:"string",defaultValue:"ARIA2USER@"},"ftp-pasv":{type:"boolean",defaultValue:"true",required:!0},"ftp-proxy":{type:"string"},"ftp-proxy-user":{type:"string"},"ftp-proxy-passwd":{type:"string"},"ftp-type":{type:"option",options:["binary","ascii"],defaultValue:"binary",required:!0},"ftp-reuse-connection":{type:"boolean",defaultValue:"true",required:!0},"ssh-host-key-md":{type:"string"},"show-files":{type:"boolean",readonly:!0},"bt-detach-seed-only":{type:"boolean",readonly:!0,defaultValue:"false"},"bt-enable-hook-after-hash-check":{since:"1.19.3",type:"boolean",defaultValue:"true",required:!0},"bt-enable-lpd":{type:"boolean",defaultValue:"false",required:!0},"bt-exclude-tracker":{type:"text",separator:",",showCount:!0},"bt-external-ip":{type:"string"},"bt-force-encryption":{type:"boolean",defaultValue:"false",required:!0},"bt-hash-check-seed":{type:"boolean",defaultValue:"true",required:!0},"bt-load-saved-metadata":{since:"1.33.0",type:"boolean",defaultValue:"false",required:!0},"bt-max-open-files":{type:"integer",defaultValue:"100",required:!0,min:1},"bt-max-peers":{type:"integer",defaultValue:"55",required:!0,min:0},"bt-metadata-only":{type:"boolean",defaultValue:"false",required:!0},"bt-min-crypto-level":{type:"option",options:["plain","arc4"],defaultValue:"plain",required:!0},"bt-prioritize-piece":{type:"string"},"bt-remove-unselected-file":{type:"boolean",defaultValue:"false",required:!0},"bt-require-crypto":{type:"boolean",defaultValue:"false",required:!0},"bt-request-peer-speed-limit":{type:"string",suffix:"Bytes",defaultValue:"50K",required:!0,pattern:"^(0|[1-9]\\d*(K|k|M|m)?)$"},"bt-save-metadata":{type:"boolean",defaultValue:"false",required:!0},"bt-seed-unverified":{type:"boolean",defaultValue:"false",required:!0},"bt-stop-timeout":{type:"integer",suffix:"Seconds",defaultValue:"0",required:!0,min:0},"bt-tracker":{type:"text",separator:",",showCount:!0},"bt-tracker-connect-timeout":{type:"integer",suffix:"Seconds",defaultValue:"60",required:!0,min:1,max:600},"bt-tracker-interval":{type:"integer",suffix:"Seconds",defaultValue:"0",required:!0,min:0},"bt-tracker-timeout":{type:"integer",suffix:"Seconds",defaultValue:"60",required:!0,min:1,max:600},"dht-file-path":{type:"string",readonly:!0,defaultValue:"$HOME/.aria2/dht.dat"},"dht-file-path6":{type:"string",readonly:!0,defaultValue:"$HOME/.aria2/dht6.dat"},"dht-listen-port":{type:"string",readonly:!0,defaultValue:"6881-6999"},"dht-message-timeout":{type:"integer",suffix:"Seconds",readonly:!0,defaultValue:"10"},"enable-dht":{type:"boolean",readonly:!0,defaultValue:"true"},"enable-dht6":{type:"boolean",readonly:!0},"enable-peer-exchange":{type:"boolean",defaultValue:"true",required:!0},"follow-torrent":{type:"option",options:["true","false","mem"],defaultValue:"true",required:!0},"listen-port":{type:"integer",readonly:!0,defaultValue:"6881-6999"},"max-overall-upload-limit":{type:"string",suffix:"Bytes",defaultValue:"0",required:!0,pattern:"^(0|[1-9]\\d*(K|k|M|m)?)$"},"max-upload-limit":{type:"string",suffix:"Bytes",defaultValue:"0",required:!0,pattern:"^(0|[1-9]\\d*(K|k|M|m)?)$"},"peer-id-prefix":{type:"string",readonly:!0,defaultValue:"A2-$MAJOR-$MINOR-$PATCH-"},"peer-agent":{since:"1.33.0",type:"string",defaultValue:"aria2/$MAJOR.$MINOR.$PATCH",readonly:!0},"seed-ratio":{type:"float",defaultValue:"1.0",required:!0,min:0},"seed-time":{type:"float",suffix:"Minutes",required:!0,min:0},"follow-metalink":{type:"option",options:["true","false","mem"],defaultValue:"true",required:!0},"metalink-base-uri":{type:"string"},"metalink-language":{type:"string"},"metalink-location":{type:"string"},"metalink-os":{type:"string"},"metalink-version":{type:"string"},"metalink-preferred-protocol":{type:"option",options:["http","https","ftp","none"],defaultValue:"none",required:!0},"metalink-enable-unique-protocol":{type:"boolean",defaultValue:"true",required:!0},"enable-rpc":{type:"boolean",readonly:!0,defaultValue:"false"},"pause-metadata":{type:"boolean",defaultValue:"false",required:!0},"rpc-allow-origin-all":{type:"boolean",readonly:!0,defaultValue:"false"},"rpc-listen-all":{type:"boolean",readonly:!0,defaultValue:"false"},"rpc-listen-port":{type:"integer",readonly:!0,defaultValue:"6800"},"rpc-max-request-size":{type:"string",suffix:"Bytes",readonly:!0,defaultValue:"2M"},"rpc-save-upload-metadata":{type:"boolean",defaultValue:"true",required:!0},"rpc-secure":{type:"boolean",readonly:!0},"allow-overwrite":{type:"boolean",defaultValue:"false",required:!0},"allow-piece-length-change":{type:"boolean",defaultValue:"false",required:!0},"always-resume":{type:"boolean",defaultValue:"true",required:!0},"async-dns":{type:"boolean",defaultValue:"true",required:!0},"auto-file-renaming":{type:"boolean",defaultValue:"true",required:!0},"auto-save-interval":{type:"integer",suffix:"Seconds",readonly:!0,defaultValue:"60"},"conditional-get":{type:"boolean",defaultValue:"false",required:!0},"conf-path":{type:"string",readonly:!0,defaultValue:"$HOME/.aria2/aria2.conf"},"console-log-level":{type:"option",options:["debug","info","notice","warn","error"],readonly:!0,defaultValue:"notice"},"content-disposition-default-utf8":{since:"1.31.0",type:"boolean",defaultValue:"false"},daemon:{type:"boolean",readonly:!0,defaultValue:"false"},"deferred-input":{type:"boolean",readonly:!0,defaultValue:"false"},"disable-ipv6":{type:"boolean",readonly:!0,defaultValue:"false"},"disk-cache":{type:"string",suffix:"Bytes",readonly:!0,defaultValue:"16M"},"download-result":{type:"option",options:["default","full","hide"],defaultValue:"default",required:!0},dscp:{type:"string",readonly:!0},"rlimit-nofile":{type:"string",readonly:!0},"enable-color":{type:"boolean",readonly:!0,defaultValue:"true"},"enable-mmap":{type:"boolean",defaultValue:"false",required:!0},"event-poll":{type:"option",options:["epoll","kqueue","port","poll","select"],readonly:!0},"file-allocation":{type:"option",options:["none","prealloc","trunc","falloc"],defaultValue:"prealloc",required:!0},"force-save":{type:"boolean",defaultValue:"false",required:!0},"save-not-found":{since:"1.27.0",type:"boolean",defaultValue:"true",required:!0},"hash-check-only":{type:"boolean",defaultValue:"false",required:!0},"human-readable":{type:"boolean",readonly:!0,defaultValue:"true"},"keep-unfinished-download-result":{type:"boolean",defaultValue:"true",required:!0},"max-download-result":{type:"integer",defaultValue:"1000",required:!0,min:0},"max-mmap-limit":{since:"1.20.0",type:"string",suffix:"Bytes",defaultValue:"9223372036854775807",required:!0,pattern:"^(0|[1-9]\\d*(K|k|M|m)?)$"},"max-resume-failure-tries":{type:"integer",defaultValue:"0",required:!0,min:0},"min-tls-version":{type:"option",options:["SSLv3","TLSv1","TLSv1.1","TLSv1.2"],readonly:!0,defaultValue:"TLSv1"},"log-level":{type:"option",options:["debug","info","notice","warn","error"],defaultValue:"debug",required:!0},"optimize-concurrent-downloads":{since:"1.22.0",type:"string",defaultValue:"false"},"piece-length":{type:"string",suffix:"Bytes",defaultValue:"1M",required:!0,pattern:"^(0|[1-9]\\d*(M|m)?)$"},"show-console-readout":{type:"boolean",readonly:!0,defaultValue:"true"},"summary-interval":{type:"integer",suffix:"Seconds",readonly:!0,defaultValue:"60"},"max-overall-download-limit":{type:"string",suffix:"Bytes",defaultValue:"0",required:!0,pattern:"^(0|[1-9]\\d*(K|k|M|m)?)$"},"max-download-limit":{type:"string",suffix:"Bytes",defaultValue:"0",required:!0,pattern:"^(0|[1-9]\\d*(K|k|M|m)?)$"},"no-conf":{type:"boolean",readonly:!0},"no-file-allocation-limit":{type:"string",suffix:"Bytes",defaultValue:"5M",required:!0,pattern:"^(0|[1-9]\\d*(K|k|M|m)?)$"},"parameterized-uri":{type:"boolean",defaultValue:"false",required:!0},quiet:{type:"boolean",readonly:!0,defaultValue:"false"},"realtime-chunk-checksum":{type:"boolean",defaultValue:"true",required:!0},"remove-control-file":{type:"boolean",required:!0},"save-session":{type:"string"},"save-session-interval":{type:"integer",suffix:"Seconds",readonly:!0,defaultValue:"0"},"socket-recv-buffer-size":{since:"1.19.3",type:"string",suffix:"Bytes",readonly:!0,defaultValue:"0"},stop:{type:"integer",suffix:"Seconds",readonly:!0,defaultValue:"0"},"truncate-console-readout":{type:"boolean",readonly:!0,defaultValue:"true"}}).constant("aria2GlobalAvailableOptions",{basicOptions:["dir","log","max-concurrent-downloads","check-integrity","continue"],httpFtpSFtpOptions:["all-proxy","all-proxy-user","all-proxy-passwd","connect-timeout","dry-run","lowest-speed-limit","max-connection-per-server","max-file-not-found","max-tries","min-split-size","netrc-path","no-netrc","no-proxy","proxy-method","remote-time","reuse-uri","retry-wait","server-stat-of","server-stat-timeout","split","stream-piece-selector","timeout","uri-selector"],httpOptions:["check-certificate","http-accept-gzip","http-auth-challenge","http-no-cache","http-user","http-passwd","http-proxy","http-proxy-user","http-proxy-passwd","https-proxy","https-proxy-user","https-proxy-passwd","referer","enable-http-keep-alive","enable-http-pipelining","header","save-cookies","use-head","user-agent"],ftpSFtpOptions:["ftp-user","ftp-passwd","ftp-pasv","ftp-proxy","ftp-proxy-user","ftp-proxy-passwd","ftp-type","ftp-reuse-connection","ssh-host-key-md"],btOptions:["bt-detach-seed-only","bt-enable-hook-after-hash-check","bt-enable-lpd","bt-exclude-tracker","bt-external-ip","bt-force-encryption","bt-hash-check-seed","bt-load-saved-metadata","bt-max-open-files","bt-max-peers","bt-metadata-only","bt-min-crypto-level","bt-prioritize-piece","bt-remove-unselected-file","bt-require-crypto","bt-request-peer-speed-limit","bt-save-metadata","bt-seed-unverified","bt-stop-timeout","bt-tracker","bt-tracker-connect-timeout","bt-tracker-interval","bt-tracker-timeout","dht-file-path","dht-file-path6","dht-listen-port","dht-message-timeout","enable-dht","enable-dht6","enable-peer-exchange","follow-torrent","listen-port","max-overall-upload-limit","max-upload-limit","peer-id-prefix","peer-agent","seed-ratio","seed-time"],metalinkOptions:["follow-metalink","metalink-base-uri","metalink-language","metalink-location","metalink-os","metalink-version","metalink-preferred-protocol","metalink-enable-unique-protocol"],rpcOptions:["enable-rpc","pause-metadata","rpc-allow-origin-all","rpc-listen-all","rpc-listen-port","rpc-max-request-size","rpc-save-upload-metadata","rpc-secure"],advancedOptions:["allow-overwrite","allow-piece-length-change","always-resume","async-dns","auto-file-renaming","auto-save-interval","conditional-get","conf-path","console-log-level","content-disposition-default-utf8","daemon","deferred-input","disable-ipv6","disk-cache","download-result","dscp","rlimit-nofile","enable-color","enable-mmap","event-poll","file-allocation","force-save","save-not-found","hash-check-only","human-readable","keep-unfinished-download-result","max-download-result","max-mmap-limit","max-resume-failure-tries","min-tls-version","log-level","optimize-concurrent-downloads","piece-length","show-console-readout","summary-interval","max-overall-download-limit","max-download-limit","no-conf","no-file-allocation-limit","parameterized-uri","quiet","realtime-chunk-checksum","remove-control-file","save-session","save-session-interval","socket-recv-buffer-size","stop","truncate-console-readout"]}).constant("aria2QuickSettingsAvailableOptions",{globalSpeedLimitOptions:["max-overall-download-limit","max-overall-upload-limit"]}).constant("aria2TaskAvailableOptions",{taskOptions:[{key:"dir",category:"global",canUpdate:"new",showHistory:!0},{key:"out",category:"http",canUpdate:"new"},{key:"allow-overwrite",category:"global",canShow:"new"},{key:"max-download-limit",category:"global"},{key:"max-upload-limit",category:"bittorrent"},{key:"split",category:"http",canUpdate:"new|waiting|paused"},{key:"min-split-size",category:"http",canUpdate:"new|waiting|paused"},{key:"max-connection-per-server",category:"http",canUpdate:"new|waiting|paused"},{key:"lowest-speed-limit",category:"http",canUpdate:"new|waiting|paused"},{key:"stream-piece-selector",category:"http",canUpdate:"new|waiting|paused"},{key:"http-user",category:"http",canUpdate:"new|waiting|paused"},{key:"http-passwd",category:"http",canUpdate:"new|waiting|paused"},{key:"all-proxy",category:"http",canUpdate:"new|waiting|paused",showHistory:!0},{key:"all-proxy-user",category:"http",canUpdate:"new|waiting|paused",showHistory:!0},{key:"all-proxy-passwd",category:"http",canUpdate:"new|waiting|paused"},{key:"checksum",category:"http"},{key:"referer",category:"http",canUpdate:"new"},{key:"header",category:"http",canUpdate:"new"},{key:"bt-max-peers",category:"bittorrent"},{key:"bt-request-peer-speed-limit",category:"bittorrent"},{key:"bt-remove-unselected-file",category:"bittorrent"},{key:"bt-stop-timeout",category:"bittorrent",canUpdate:"new|waiting|paused"},{key:"bt-tracker",category:"bittorrent",canUpdate:"new|waiting|paused"},{key:"seed-ratio",category:"bittorrent",canUpdate:"new|waiting|paused"},{key:"seed-time",category:"bittorrent",canUpdate:"new|waiting|paused"},{key:"conditional-get",category:"global",canShow:"new"},{key:"check-integrity",category:"global"},{key:"file-allocation",category:"global",canShow:"new"},{key:"parameterized-uri",category:"global",canShow:"new"},{key:"force-save",category:"global"}]})}(),function(){"use strict";angular.module("ariaNg").constant("aria2Errors",{1:{descriptionKey:"error.unknown"},2:{descriptionKey:"error.operation.timeout"},3:{descriptionKey:"error.resource.notfound"},4:{descriptionKey:"error.resource.notfound.max-file-not-found"},5:{descriptionKey:"error.download.aborted.lowest-speed-limit"},6:{descriptionKey:"error.network.problem"},8:{descriptionKey:"error.resume.notsupported"},9:{descriptionKey:"error.space.notenough"},10:{descriptionKey:"error.piece.length.different"},11:{descriptionKey:"error.download.sametime"},12:{descriptionKey:"error.download.torrent.sametime"},13:{descriptionKey:"error.file.exists"},14:{descriptionKey:"error.file.rename.failed"},15:{descriptionKey:"error.file.open.failed"},16:{descriptionKey:"error.file.create.failed"},17:{descriptionKey:"error.io.error"},18:{descriptionKey:"error.directory.create.failed"},19:{descriptionKey:"error.name.resolution.failed"},20:{descriptionKey:"error.metalink.file.parse.failed"},21:{descriptionKey:"error.ftp.command.failed"},22:{descriptionKey:"error.http.response.header.bad"},23:{descriptionKey:"error.redirects.toomany"},24:{descriptionKey:"error.http.authorization.failed"},25:{descriptionKey:"error.bencoded.file.parse.failed"},26:{descriptionKey:"error.torrent.file.corrupted"},27:{descriptionKey:"error.magnet.uri.bad"},28:{descriptionKey:"error.option.bad"},29:{descriptionKey:"error.server.overload"},30:{descriptionKey:"error.rpc.request.parse.failed"},32:{descriptionKey:"error.checksum.failed"}})}(),function(){"use strict";angular.module("ariaNg").constant("aria2RpcConstants",{rpcServiceVersion:"2.0",rpcServiceName:"aria2",rpcSystemServiceName:"system",rpcTokenPrefix:"token:"}).constant("aria2RpcErrors",{Unauthorized:{message:"Unauthorized",tipTextKey:"rpc.error.unauthorized"}})}(),function(){"use strict";angular.module("ariaNg").controller("CommandController",["$rootScope","$window","$location","$routeParams","ariaNgDefaultOptions","ariaNgCommonService","ariaNgLogService","ariaNgSettingService","aria2TaskService","aria2SettingService",function(e,t,a,n,i,s,o,r,l,c){var d=a.path();(function(n,d){return 0===n.indexOf("/new")?function(t,n){try{t=s.base64UrlDecode(t)}catch(e){return s.showError("URL is not base64 encoded!"),!1}var i={},r=!1;if(n){for(var d in n)n.hasOwnProperty(d)&&c.isOptionKeyValid(d)&&(i[d]=n[d]);"true"===n.pause&&(r=!0)}return e.loadPromise=l.newUriTask({urls:[t],options:i},r,(function(e){if(!e.success)return!1;r?a.path("/waiting"):a.path("/downloading")})),o.info("[CommandController] new download: "+t),!0}(d.url,d):0===n.indexOf("/settings/rpc/set")?function(e,n,l,c,d){if(l=l||i.rpcPort,c=c||i.rpcInterface,d=d||i.secret,o.info("[CommandController] set rpc: "+e+"://"+n+":"+l+"/"+c+", secret: "+d),!e||"http"!==e&&"https"!==e&&"ws"!==e&&"wss"!==e)return s.showError("Protocol is invalid!"),!1;if(!n)return s.showError("RPC host cannot be empty!"),!1;if(d)try{d=s.base64UrlDecode(d)}catch(e){return s.showError("RPC secret is not base64 encoded!"),!1}var u={rpcAlias:"",rpcHost:n,rpcPort:l,rpcInterface:c,protocol:e,httpMethod:i.httpMethod,rpcRequestHeaders:"",secret:d};return r.isRpcSettingEqualsDefault(u)?a.path("/downloading"):(r.setDefaultRpcSetting(u,{keepCurrent:!1,forceSet:!0}),a.path("/downloading"),t.location.reload()),!0}(d.protocol,d.host,d.port,d.interface,d.secret):(s.showError("Parameter is invalid!"),!1)})(d,angular.extend({},n,a.search()))||a.path("/downloading")}])}(),function(){"use strict";angular.module("ariaNg").controller("AriaNgDebugController",["$rootScope","$scope","$location","$interval","$timeout","$filter","ariaNgConstants","ariaNgCommonService","ariaNgLocalizationService","ariaNgLogService","ariaNgKeyboardService","ariaNgSettingService","aria2RpcService",function(e,t,a,n,i,s,o,r,l,c,d,u,p){var g=[{name:"logs",show:!0},{name:"rpc",show:!0}],f=null,m=function(){for(var e=[],t=0;t<g.length;t++)g[t].show&&e.push(g[t].name);return e};t.context={currentTab:"logs",logMaxCount:o.cachedDebugLogsLimit,logAutoRefreshAvailableInterval:r.getTimeOptions([100,200,500,1e3,2e3],!0),logAutoRefreshInterval:1e3,logListDisplayOrder:"time:desc",logLevelFilter:"DEBUG",logs:[],currentLog:null,availableRpcMethods:[],rpcRequestMethod:"",rpcRequestParameters:"{}",rpcResponse:null},t.enableDebugMode=function(){return u.isEnableDebugMode()},t.changeTab=function(a){"rpc"===a&&(e.loadPromise=function(){if(!t.context.availableRpcMethods||!t.context.availableRpcMethods.length)return p.listMethods({silent:!1,callback:function(e){e.success&&(t.context.availableRpcMethods=e.data)}})}()),t.context.currentTab=a},t.changeLogListDisplayOrder=function(e){var a=r.parseOrderType(t.context.logListDisplayOrder),n=r.parseOrderType(e);n.type===a.type&&(n.reverse=!a.reverse),t.context.logListDisplayOrder=n.getValue()},t.isLogListSetDisplayOrder=function(e){var a=r.parseOrderType(t.context.logListDisplayOrder),n=r.parseOrderType(e);return a.equals(n)},t.getLogListOrderType=function(){return t.context.logListDisplayOrder},t.filterLog=function(e){return!(!e||!angular.isString(e.level))&&(!t.context.logLevelFilter||c.compareLogLevel(e.level,t.context.logLevelFilter)>=0)},t.setLogLevelFilter=function(e){t.context.logLevelFilter=e},t.isSetLogLevelFilter=function(e){return t.context.logLevelFilter===e},t.getLogLevelFilter=function(){return t.context.logLevelFilter},t.setAutoRefreshInterval=function(e){t.context.logAutoRefreshInterval=e,f&&n.cancel(f),e>0&&(t.reloadLogs(),f=n((function(){t.reloadLogs()}),t.context.logAutoRefreshInterval))},t.reloadLogs=function(){t.context.logs=c.getDebugLogs().slice()},t.clearDebugLogs=function(){r.confirm("Confirm Clear","Are you sure you want to clear debug logs?","warning",(function(){c.clearDebugLogs(),t.reloadLogs()}),!1)},t.showLogDetail=function(e){t.context.currentLog=e,angular.element("#log-detail-modal").modal()},$("#log-detail-modal").on("hide.bs.modal",(function(e){t.context.currentLog=null})),t.executeAria2Method=function(){if(!t.context.rpcRequestMethod||t.context.rpcRequestMethod.indexOf(".")<0)r.showError("RPC method is illegal!");else{var e=t.context.rpcRequestMethod.split(".");if(2===e.length){var a=e[1];if(angular.isFunction(p[a])){var n={silent:!1,callback:function(e){t.context.rpcResponse=e?s("json")(e.data):s("json")(e)}},i={};try{i=angular.fromJson(t.context.rpcRequestParameters)}catch(e){return c.error("[AriaNgDebugController.executeAria2Method] failed to parse request parameters: "+t.context.rpcRequestParameters,e),void r.showError("RPC request parameters are invalid!")}for(var o in i)i.hasOwnProperty(o)&&"silent"!==o&&"callback"!==o&&(n[o]=i[o]);return p[a](n)}r.showError("AriaNg does not support this RPC method!")}else r.showError("RPC method is illegal!")}},t.requestParametersTextboxKeyDown=function(e){if(u.getKeyboardShortcuts())return d.isCtrlEnterPressed(e)&&t.executeMethodForm.$valid?(e.preventDefault&&e.preventDefault(),t.executeAria2Method(),!1):void 0},t.$on("$destroy",(function(){f&&n.cancel(f)})),e.swipeActions.extendLeftSwipe=function(){var e=m(),a=e.indexOf(t.context.currentTab);return a<e.length-1&&(t.changeTab(e[a+1]),!0)},e.swipeActions.extendRightSwipe=function(){var e=m(),a=e.indexOf(t.context.currentTab);return a>0&&(t.changeTab(e[a-1]),!0)},e.loadPromise=i((function(){u.isEnableDebugMode()?t.setAutoRefreshInterval(t.context.logAutoRefreshInterval):r.showError("Access Denied!",(function(){u.isEnableDebugMode()||a.path("/settings/ariang")}))}),100)}])}(),function(){"use strict";angular.module("ariaNg").controller("MainController",["$rootScope","$scope","$route","$window","$location","$document","$interval","clipboard","aria2RpcErrors","ariaNgCommonService","ariaNgVersionService","ariaNgNotificationService","ariaNgSettingService","ariaNgMonitorService","ariaNgTitleService","aria2TaskService","aria2SettingService","aria2eRecService",function(e,t,a,n,i,s,o,r,l,c,d,u,p,g,f,m,h,v){var b=null,y=null;e.defaultTaskPage=p.getDefaultTaskPage();var k="/"+e.defaultTaskPage,w=function(){var e=i.path().substring(1);return"all"===e||"downloading"===e||"waiting"===e||"stopped"===e?e:""},S=function(){var e=f.getFinalTitleByGlobalStat({globalStat:t.globalStat,currentRpcProfile:T()});s[0].title=e},x=function(e,a){return h.getGlobalStat((function(e){if(e.success||e.data.message!==l.Unauthorized.message){if(e.success){let a=e.data;t.globalStat=a,t.globalStat.numTotal=Number(a.numActive)+Number(a.numWaiting)+Number(a.numStopped),g.recordGlobalStat(e.data)}a&&a(e)}else o.cancel(y)}),e)},T=function(){if(!t.rpcSettings||t.rpcSettings.length<1)return null;for(var e=0;e<t.rpcSettings.length;e++){var a=t.rpcSettings[e];if(a.isDefault)return a}return null};p.getBrowserNotification()&&u.requestBrowserPermission(),t.ariaNgVersion=d.getBuildVersion(),t.globalStatusContext={isEnabled:p.getGlobalStatRefreshInterval()>0,data:g.getGlobalStatsData()},t.enableDebugMode=function(){return p.isEnableDebugMode()},t.quickSettingContext=null,t.rpcSettings=p.getAllRpcSettings(),t.currentRpcProfile=T(),t.currentRpcAlias=p.getCurrentRpcDisplayName(),t.isCurrentRpcUseWebSocket=p.isCurrentRpcUseWebSocket(),t.isTaskSelected=function(){return e.taskContext.getSelectedTaskIds().length>0},t.isSelectedTasksAllHaveUrl=function(){var t=e.taskContext.getSelectedTasks();if(t.length<1)return!1;for(var a=0;a<t.length;a++)if(!t[a].singleUrl)return!1;return!0},t.isSelectedTasksAllHaveInfoHash=function(){var t=e.taskContext.getSelectedTasks();if(t.length<1)return!1;for(var a=0;a<t.length;a++)if(!t[a].bittorrent||!t[a].infoHash)return!1;return!0},t.isSpecifiedTaskSelected=function(){var t=e.taskContext.getSelectedTasks();if(t.length<1)return!1;for(var a=0;a<t.length;a++)for(var n=0;n<arguments.length;n++)if(t[a].status===arguments[n])return!0;return!1},t.isSpecifiedTaskShowing=function(){var t=e.taskContext.list;if(t.length<1)return!1;for(var a=0;a<t.length;a++)for(var n=0;n<arguments.length;n++)if(t[a].status===arguments[n])return!0;return!1},t.changeTasksState=function(n){var s="",o=null;if("start"===n)s="paused",o=m.startTasks;else{if("pause"!==n)return;s="active+waiting",o=m.pauseTasks}var r=e.taskContext.getSelectedTaskIds(s);e.taskContext.selected={},!r||r.length<1||(e.loadPromise=o(r,(function(e){if(e.hasError&&r.length>1&&c.showError("Failed to change some tasks state."),!e.hasSuccess)return;let s=t.globalStat;x(!0,(function(o){let r=t.globalStat;e.hasError||"start"!==n||("/waiting"===i.path()&&o.success&&r.numActive>s.numActive?i.path("/downloading"):a.reload())})),e.hasError||"pause"!==n||("/downloading"===i.path()?i.path("/waiting"):a.reload())}),r.length>1))},t.retryTask=function(t){c.confirm("Confirm Retry","Are you sure you want to retry the selected task? AriaNg will create same task after clicking OK.","info",(function(){e.loadPromise=m.retryTask(t.gid,(function(e){if(e.success){x(!0);var t=p.getAfterRetryingTask();e.success&&e.data&&("task-list-default"===t?i.path()!==k?i.path(k):a.reload():"task-list-downloading"===t?"/downloading"!==i.path()?i.path("/downloading"):a.reload():"task-detail"===t?i.path("/task/detail/"+e.data):a.reload())}else c.showError("Failed to retry this task.")}),!1)}))},t.hasPausedTask=function(){return e.taskContext.hasPausedTask()},t.hasRetryableTask=function(){return e.taskContext.hasRetryableTask()},t.hasCompletedTask=function(){return e.taskContext.hasCompletedTask()},t.isSelectedTaskRetryable=function(){var t=e.taskContext.getSelectedTasks();if(t.length<1)return!1;for(var a=0;a<t.length;a++)if(!e.isTaskRetryable(t[a]))return!1;return!0},t.retryTasks=function(){var n=e.taskContext.getSelectedTasks();if(e.taskContext.selected={},n&&!(n.length<1)){if(1===n.length)return t.retryTask(n[0]);for(var s=[],o=0,r=0;r<n.length;r++)e.isTaskRetryable(n[r])?s.push(n[r]):o++;c.confirm("Confirm Retry","Are you sure you want to retry the selected task? AriaNg will create same task after clicking OK.","info",(function(){e.loadPromise=m.retryTasks(s,(function(e){x(!0),c.showInfo("Operation Result","{successCount} tasks have been retried and {failedCount} tasks are failed.",(function(){var t=p.getAfterRetryingTask();e.hasSuccess&&("task-list-default"===t?i.path()!==k?i.path(k):a.reload():"task-list-downloading"===t&&"/downloading"!==i.path()?i.path("/downloading"):a.reload())}),{textParams:{successCount:e.successCount,failedCount:e.failedCount,skipCount:o}})}),!1)}),!0)}},t.removeTasks=function(){var t=e.taskContext.getSelectedTasks();if(e.taskContext.selected={},t&&!(t.length<1)){var n=function(){e.loadPromise=m.removeTasks(t,(function(e){e.hasError&&t.length>1&&c.showError("Failed to remove some task(s)."),e.hasSuccess&&(x(!0),e.hasError||("/downloading"==i.path()?i.path("/stopped"):a.reload()))}),t.length>1)};p.getConfirmTaskRemoval()?c.confirm("Confirm Remove","Are you sure you want to remove the selected task?","warning",n):n()}},t.clearStoppedTasks=function(){c.confirm("Confirm Clear","Are you sure you want to clear stopped tasks?","warning",(function(){e.loadPromise=m.clearStoppedTasks((function(e){e.success&&(x(!0),"/stopped"!==i.path()?i.path(k):a.reload())}))}))},t.isAllTasksSelected=function(){return e.taskContext.isAllSelected()},t.selectAllTasks=function(){e.taskContext.selectAll()},t.selectAllPausedTasks=function(){e.taskContext.selectAllPaused()},t.selectAllFailedTasks=function(){e.taskContext.selectAllFailed()},t.selectAllCompletedTasks=function(){e.taskContext.selectAllCompleted()},t.copySelectedTasksDownloadLink=function(){for(var t=e.taskContext.getSelectedTasks(),a="",n=0;n<t.length;n++)n>0&&(a+="\n"),a+=t[n].singleUrl;a.length>0&&r.copyText(a)},t.copySelectedTasksMagnetLink=function(){for(var t=e.taskContext.getSelectedTasks(),a="",n=0;n<t.length;n++)n>0&&(a+="\n"),a+="magnet:?xt=urn:btih:"+t[n].infoHash;a.length>0&&r.copyText(a)},t.changeDisplayOrder=function(e,t){var a=w(),n=c.parseOrderType(p.getDisplayOrder(a)),i=c.parseOrderType(e);t&&i.type===n.type&&(i.reverse=!n.reverse),p.setDisplayOrder(i.getValue(),a)},t.isSetDisplayOrder=function(e){var t=w(),a=c.parseOrderType(p.getDisplayOrder(t)),n=c.parseOrderType(e);return a.equals(n)},t.showQuickSettingDialog=function(e,a){t.quickSettingContext={type:e,title:a}},t.switchRpcSetting=function(t){t.isDefault||(p.setDefaultRpcSetting(t),0===i.path().indexOf("/task/detail/")||0===i.path().indexOf("/settings/aria2/")?(e.setAutoRefreshAfterPageLoad(),i.path(k)):n.location.reload())},p.getTitleRefreshInterval()>0&&(b=o((function(){S()}),p.getTitleRefreshInterval())),p.getGlobalStatRefreshInterval()>0&&(y=o((function(){x(!0)}),p.getGlobalStatRefreshInterval())),v.getRecManifestPromise().then((function(t){if(t){try{var a=n.navigator.language,s=p.getRecCount(),o=t.contents[0].regions||[],r=t.total>s,l=o.includes("all")||o.includes(a);e.hasNewRec=r&&l,e.recTotal=t.total}catch(t){e.hasNewRec=!1,e.recTotal=s}0===i.path().indexOf("/recommend")&&p.setRecCount(e.recTotal)}else e.hasNewRec=!1})).catch((function(t){e.hasNewRec=!1,e.recTotal=p.getRecCount()})),t.updateRecCount=function(){p.setRecCount(e.recCount),e.hasNewRec=!1},t.compactMode=p.getCompactMode(),t.$watch("compactMode",(function(e,t){p.setCompactMode(e)})),t.$on("$destroy",(function(){b&&o.cancel(b),y&&o.cancel(y)})),x(!0,(function(){S()}))}])}(),function(){"use strict";angular.module("ariaNg").controller("NewTaskController",["$rootScope","$scope","$location","$timeout","ariaNgCommonService","ariaNgLogService","ariaNgKeyboardService","ariaNgFileService","ariaNgFileTypes","ariaNgSettingService","aria2TaskService","aria2SettingService","ariaNgNotificationService",function(e,t,a,n,i,s,o,r,l,c,d,u,p){var g,f=[{name:"links",show:!0},{name:"options",show:!0}],m=a.search(),h=function(){for(var e=[],t=0;t<f.length;t++)f[t].show&&e.push(f[t].name);return e},v=function(e){e&&e.dir&&u.addSettingHistory("dir",e.dir)},b=function(e){var a=i.parseUrlsFromOriginInput(t.context.urls),n=[];e||(e=angular.copy(t.context.options));for(var s=0;s<a.length;s++)""!==a[s]&&""!==a[s].trim()&&n.push({urls:[a[s].trim()],selected:!1,options:e});return n},y=function(e,a){var n=angular.copy(t.context.options),i=b(n);return v(n),function(e){e&&e["all-proxy"]&&(u.addSettingHistory("all-proxy",e["all-proxy"]),e["all-proxy-user"]&&u.addSettingHistory("all-proxy-user",e["all-proxy-user"]))}(n),d.newUriTasks(i,e,a)};if(t.context={currentTab:"links",taskType:"urls",urls:"",uploadFile:null,showUrlFilter:!1,lastChecked:-1,availableOptions:(g=u.getNewTaskOptionKeys(),u.getSpecifiedOptions(g,{disableRequired:!0})),globalOptions:null,options:{},optionFilter:{global:!0,http:!1,bittorrent:!1},exportCommandApiOptions:null,hasDownloadsPermission:i.hasDownloadsPermission()},t.changeTab=function(e){"options"===e&&t.loadDefaultOption(),t.context.currentTab=e},e.swipeActions.extendLeftSwipe=function(){var e=h(),a=e.indexOf(t.context.currentTab);return a<e.length-1&&(t.changeTab(e[a+1]),!0)},e.swipeActions.extendRightSwipe=function(){var e=h(),a=e.indexOf(t.context.currentTab);return a>0&&(t.changeTab(e[a-1]),!0)},t.loadDefaultOption=function(){t.context.globalOptions||(e.loadPromise=u.getGlobalOption((function(e){e.success&&(t.context.globalOptions=e.data)})))},m.url){try{t.context.urls=decodeURI(i.base64UrlDecode(m.url))}catch(e){s.error("[NewTaskController] base64 decode error, url="+m.url,e)}t.context.urls?.startsWith("http")&&(t.context.optionFilter.http=!0,t.context.urls.includes("\n")||n((function(){"Connected"==e.taskContext.rpcStatus&&t.changeTab("options")}),1440,!1)),m.referer&&(t.context.options.referer=m.referer),m.header&&(t.context.options.header=m.header),m.filename&&(t.context.options.out=decodeURIComponent(m.filename))}t.openTorrent=function(){r.openFileContent({scope:t,fileFilter:".torrent",fileType:"binary"},(function(e){t.context.uploadFile=e,t.context.taskType="torrent",t.changeTab("options")}),(function(e){i.showError(e)}),angular.element("#file-holder"))},t.openMetalink=function(){r.openFileContent({scope:t,fileFilter:".meta4,.metalink",fileType:"binary"},(function(e){t.context.uploadFile=e,t.context.taskType="metalink",t.changeTab("options")}),(function(e){i.showError(e)}),angular.element("#file-holder"))},t.isNewTaskValid=function(){return!!t.context.uploadFile||t.newTaskForm.$valid},t.startDownload=function(n,i){var s=function(e){if(e.hasSuccess||e.success){var t=null;e.results&&e.results.length>0?t=e.results[0]:e&&(t=e),"task-detail"===c.getAfterCreatingNewTask()&&t&&t.data?a.path("/task/detail/"+t.data):"all"===c.getDefaultTaskPage()?a.path("/all"):n?a.path("/waiting"):a.path("/downloading")}};t.context.hasDownloadsPermission&&"Connected"!==e.taskContext.rpcStatus?(p.notifyInPage("","Aria2 is disconnected, All tasks will be downloaded via Browser. Invalid URL will be ignored.",{type:"info",delay:6e3}),e.loadPromise=t.invokeBrowserDownload(i)):"urls"===t.context.taskType?e.loadPromise=y(n,s):"torrent"===t.context.taskType?e.loadPromise=function(e,a){var n=angular.copy(t.context.options),i={content:t.context.uploadFile.base64Content,options:n};return v(i.options),d.newTorrentTask(i,e,a)}(n,s):"metalink"===t.context.taskType&&(e.loadPromise=function(e,a){var n={content:t.context.uploadFile.base64Content,options:angular.copy(t.context.options)};return v(n.options),d.newMetalinkTask(n,e,a)}(n,s))},t.invokeBrowserDownload=function(e){let n=function(){"all"===c.getDefaultTaskPage()?a.path("/all"):a.path("/downloading")};if(t.context.hasDownloadsPermission){let a=i.parseUrlsFromOriginInput(t.context.urls,"^(https?|ftp)://.+$");if(a.length>1)i.confirm("Download via Browser","Confirm to download multiple URLs from Browser simultaneously?","warning",(function(){let e={url:t.context.urls};chrome.runtime.sendMessage({type:"DOWNLOAD_VIA_BROWSER",data:e}).then(n)}),!1,null,(function(){e&&e.preventDefault()}));else if(1===a.length){let e={url:t.context.urls,filename:t.context.options.out};return chrome.runtime.sendMessage({type:"DOWNLOAD_VIA_BROWSER",data:e}).then(n)}}e&&e.preventDefault()},t.showExportCommandAPIModal=function(){t.context.exportCommandApiOptions={type:"new-task",data:b()}},t.setOption=function(e,a,n){""===a&&u.isOptionKeyRequired(e)?delete t.context.options[e]:t.context.options[e]=a,n.setReady()},t.urlTextboxKeyDown=function(e){if(c.getKeyboardShortcuts())return o.isCtrlEnterPressed(e)&&t.newTaskForm.$valid?(e.preventDefault&&e.preventDefault(),t.startDownload(),!1):void 0},t.getValidUrlsCount=function(){let e=0;if(t.context.showUrlFilter)for(const a of t.pendingTasks)t.filterTask(a)&&a.selected&&e++;else{var a=i.parseUrlsFromOriginInput(t.context.urls);e=a?a.length:0}return e},t.showUrlFilter=function(){t.context.showUrlFilter?t.cancelUrlFilter():(t.pendingTasks&&!t.newTaskForm.urls.$dirty||(t.pendingTasks=b()),t.context.showUrlFilter=!0)},t.cancelUrlFilter=function(){t.context.showUrlFilter&&(t.context.showUrlFilter=!1)},t.isAnyFileSelected=function(){if(!t.pendingTasks||!t.pendingTasks.length)return!1;for(var e=0;e<t.pendingTasks.length;e++){var a=t.pendingTasks[e];if(t.filterTask(a)&&a.selected)return!0}return!1},t.isAllFileSelected=function(){if(!t.pendingTasks||!t.pendingTasks.length)return!1;for(var e=0;e<t.pendingTasks.length;e++){var a=t.pendingTasks[e];if(t.filterTask(a)&&!a.selected)return!1}return!0},t.selectFiles=function(e){if(t.pendingTasks&&t.pendingTasks.length){"auto"===e&&(e=t.isAllFileSelected()?"none":"all");for(var a=0;a<t.pendingTasks.length;a++){var n=t.pendingTasks[a];t.filterTask(n)&&("all"===e?n.selected=!0:"none"===e?n.selected=!1:"reverse"===e&&(n.selected=!n.selected))}}},t.chooseSpecifiedFiles=function(e){if(t.pendingTasks&&t.pendingTasks.length&&l[e]){for(var a=t.pendingTasks,n=l[e].extensions,s=[],o=!0,r=0;r<a.length;r++){var c=a[r];if(t.filterTask(c)){var d=i.getFileExtensionFromUrl(c.urls[0]);d&&(d=d.toLowerCase()),n.indexOf(d)>=0&&(s.push(r),c.selected||(o=!1))}}for(r=0;r<s.length;r++){(c=a[s[r]])&&(c.selected=!o)}}},t.saveChosenFiles=function(){if(t.context.showUrlFilter){let e=[];for(const a of t.pendingTasks)t.filterTask(a)&&a.selected&&e.push(a.urls[0]);t.context.urls=e.join("\n"),t.context.showUrlFilter=!1}},t.showCustomChooseFileModal=function(){if(t.pendingTasks&&t.pendingTasks.length){for(var e=t.pendingTasks,a={},n=0;n<e.length;n++){var s=e[n];if((f=i.getFileExtensionFromUrl(s.urls[0]))&&(f=f.toLowerCase()),!(m=a[f])){var o=f;o.length>0&&"."===o.charAt(0)&&(o=o.substring(1)),m={extension:o,classified:!1,selected:!1,selectedCount:0,unSelectedCount:0},a[f]=m}s.selected?(m.selected=!0,m.selectedCount++):m.unSelectedCount++}var r={};for(var c in l)if(l.hasOwnProperty(c)){var d=l[c].name,u=l[c].extensions,p=[];for(n=0;n<u.length;n++){(m=a[f=u[n]])&&(m.classified=!0,p.push(m))}p.length>0&&(r[c]={name:d,extensions:p})}var g=[];for(var f in a){var m;if(a.hasOwnProperty(f))(m=a[f]).classified||g.push(m)}g.length>0&&(r.other={name:"Other",extensions:g}),t.context.fileExtensions=r,angular.element("#custom-choose-file-modal").modal()}},t.setSelectedExtension=function(e,a){if(t.pendingTasks&&t.pendingTasks.length)for(var n=t.pendingTasks,s=0;s<n.length;s++){var o=n[s],r=i.getFileExtensionFromUrl(o.urls[0]);r&&(r=r.toLowerCase()),r==="."+e&&(o.selected=a)}},t.onTaskClick=function(e,a){let n=t.context.lastChecked,i=t.pendingTasks;if(e<0||!Array.isArray(i)||i.length<1)return;let s=i[e].selected=!i[e].selected;if(a.shiftKey&&-1!==n){let t=n<e?1:-1;for(let a=n;a!=e;a+=t)i[a].selected=s}t.context.lastChecked=e},t.filterTask=function(t){return!(!t||!angular.isString(t.urls[0]))&&(!e.searchContext||!e.searchContext.text||t.urls[0].toLowerCase().indexOf(e.searchContext.text.toLowerCase())>=0)},e.keydownActions.selectAll=function(e){return e.preventDefault&&e.preventDefault(),t.$apply((function(){t.selectFiles("auto")})),!1},$("#custom-choose-file-modal").on("hide.bs.modal",(function(e){t.context.fileExtensions=null})),e.loadPromise=n((function(){}),100)}])}(),function(){"use strict";angular.module("ariaNg").controller("DownloadListController",["$rootScope","$scope","$window","$location","$route","$interval","dragulaService","aria2RpcErrors","ariaNgCommonService","ariaNgSettingService","aria2TaskService","ariaNgKeyboardService",function(e,t,a,n,i,s,o,r,l,c,d,u){var p=n.path().substring(1),g=null,f=!1,m=!0,h=-1,v=!1,b=function(t){if(!f)return d.getTaskList(p,m,(function(t){if(!f)if(t.success){var a=t.context.requestWholeInfo,n=t.data;if(a)e.taskContext.list=n,m=!1;else{if(e.taskContext.list&&e.taskContext.list.length>0)for(var i=0;i<e.taskContext.list.length;i++){delete(c=e.taskContext.list[i]).verifiedLength,delete c.verifyIntegrityPending}m=!l.extendArray(n,e.taskContext.list,"gid")}if(e.taskContext.list&&e.taskContext.list.length>0&&(d.processDownloadTasks(e.taskContext.list),!a)){var o=!1;for(i=0;i<e.taskContext.list.length;i++){var c;if((c=e.taskContext.list[i]).hasTaskName||c.files||c.bittorrent){o=!0;break}}if(!o)return m=!0,void(e.taskContext.list.length=0)}e.taskContext.enableSelectAll=e.taskContext.list&&e.taskContext.list.length>0}else t.data.message===r.Unauthorized.message&&s.cancel(g)}),t)};t.getOrderType=function(){return c.getDisplayOrder(p)},t.openDownloadFolder=function(e,t){e.stopPropagation(),0===e.button&&(a.location.href="aria2://browse/path="+t.dir+t.taskName,setTimeout((()=>{v||l.confirm("Install Aria2 Manager","Aria2 Manager is not installed, go to Alex Recommends channel for more information?","info",(function(){n.path("recommend").search("path","/posts/3").hash("usage")}))}),1200))},t.onTaskClick=function(t,a,n){if(t<0||!Array.isArray(n)||n.length<1)return;let i=n[t].gid,s=c.getKeyboardShortcuts(),o=a.originalEvent?.sourceCapabilities?.firesTouchEvents||!1;if(2==a.button&&e.taskContext.selected[i])return;if(!(o||0==a.button&&(!s&&!u.isModifierKeyPressed(a)||s&&u.isModifierKeyPressed(a)||a.shiftKey)))for(const t in e.taskContext.selected)t!==i&&(e.taskContext.selected[t]=!1);let r=e.taskContext.selected[i]=!e.taskContext.selected[i];if(a.shiftKey&&0==a.button&&-1!==h){let a=h<t?1:-1;for(let s=h;s!=t;s+=a)i=n[s].gid,e.taskContext.selected[i]=r}h=t},t.isSupportDragTask=function(){if(!c.getDragAndDropTasks())return!1;var e=l.parseOrderType(c.getDisplayOrder(p));return"waiting"===p&&"default"===e.type},c.getDownloadTaskRefreshInterval()>0&&(g=s((function(){b(!0)}),c.getDownloadTaskRefreshInterval())),o.options(t,"task-list",{revertOnSpill:!0,moves:function(){return t.isSupportDragTask()}}),t.$on("task-list.drop-model",(function(e,t,a){var n=angular.element(t),i=n.attr("data-gid"),s=n.index();f=!0,d.changeTaskPosition(i,s,(function(){f=!1}),!0)})),angular.element(a).on("blur",(function(){v=!0})),t.$on("$destroy",(function(){f=!0,g&&s.cancel(g)})),e.keydownActions.selectAll=function(e){return e.preventDefault&&e.preventDefault(),t.$apply((function(){t.selectAllTasks()})),!1},e.keydownActions.delete=function(e){return e.preventDefault&&e.preventDefault(),t.$apply((function(){t.removeTasks()})),!1},e.loadPromise=b(!1),t.isWindows="Windows"==navigator?.userAgentData?.platform||"Win32"==navigator?.platform,t.isRpcLocalhost=c.isCurrentRpcLocalhost(),t.location=p}])}(),function(){"use strict";angular.module("ariaNg").controller("TaskDetailController",["$rootScope","$scope","$routeParams","$interval","clipboard","aria2RpcErrors","ariaNgFileTypes","ariaNgCommonService","ariaNgSettingService","ariaNgMonitorService","aria2TaskService","aria2SettingService",function(e,t,a,n,i,s,o,r,l,c,d,u){var p=[{name:"overview",show:!0},{name:"pieces",show:!0},{name:"filelist",show:!0},{name:"btpeers",show:!0}],g=null,f=!1,m=null,h=function(){for(var e=[],t=0;t<p.length;t++)p[t].show&&e.push(p[t].name);return e},v=function(e,t){for(var a=0;a<p.length;a++)if(p[a].name===e){p[a].show=t;break}},b=function(a){var n,i,s;a&&(t.context.showPiecesInfo=function(e){var t=l.getShowPiecesInfoInTaskDetailPage();return!(!e||"never"===t)&&("le102400"===t?e.numPieces<=102400:"le10240"===t?e.numPieces<=10240:"le1024"!==t||e.numPieces<=1024)}(a),v("pieces",t.context.showPiecesInfo),v("btpeers","active"===a.status&&a.bittorrent),t.task&&t.task.status===a.status||(t.context.availableOptions=(n=a.status,i=!!a.bittorrent,s=u.getAvailableTaskOptionKeys(n,i),u.getSpecifiedOptions(s,{disableRequired:!0}))),t.task&&(delete t.task.verifiedLength,delete t.task.verifyIntegrityPending),t.task=r.copyObjectTo(a,t.task),t.task.dir=r.formatFilePath(a.dir),e.taskContext.list=[t.task],e.taskContext.selected={},e.taskContext.selected[t.task.gid]=!0,c.recordStat(a.gid,a))},y=function(e){e&&(r.extendArray(e,t.context.btPeers,"peerId")||(t.context.btPeers=e),t.context.healthPercent=d.estimateHealthPercentFromPeers(t.task,t.context.btPeers))},k=function(e){return e&&e.bittorrent&&"active"===e.status},w=function(e){if(!f){var i=function(e){n.cancel(g)};return t.task?d.getTaskStatusAndBtPeers(a.gid,(function(e){if(!e.success)return i(e.data.message);b(e.task),y(e.peers)}),e,k(t.task),true,true):d.getTaskStatus(a.gid,(function(t){if(!t.success)return i(t.data.message);var a=t.data;b(a),k(a)&&d.getBtTaskPeers(a,(function(e){e.success&&y(e.data)}),e,true)}),e,true)}},S=function(e){if(t.task&&t.task.files){for(var a=t.task.gid,n=[],i=0;i<t.task.files.length;i++){var s=t.task.files[i];s&&s.selected&&!s.isDir&&n.push(s.index)}return f=!0,d.selectTaskFile(a,n,(function(e){f=!1,e.success&&w(!1)}),e)}},x=function(e,t){if(e){if(e.files&&e.files.length)for(var a=0;a<e.files.length;a++){e.files[a].selected=t}if(e.subDirs&&e.subDirs.length)for(a=0;a<e.subDirs.length;a++){var n=e.subDirs[a];x(n,t)}e.selected=t,e.partialSelected=!1}},T=function(e){if(e){var t=0,a=0;if(e.files&&e.files.length)for(var n=0;n<e.files.length;n++){t+=e.files[n].selected?1:0}if(e.subDirs&&e.subDirs.length)for(n=0;n<e.subDirs.length;n++){var i=e.subDirs[n];T(i),t+=i.selected?1:0,a+=i.partialSelected?1:0}e.selected=t>0&&t===e.subDirs.length+e.files.length,e.partialSelected=t>0&&t<e.subDirs.length+e.files.length||a>0}},C=function(){if(t.task&&t.task.multiDir)for(var e=0;e<t.task.files.length;e++){var a=t.task.files[e];a.isDir&&T(a)}};t.context={currentTab:"overview",isEnableSpeedChart:l.getDownloadTaskRefreshInterval()>0,showPiecesInfo:"never"!==l.getShowPiecesInfoInTaskDetailPage(),showChooseFilesToolbar:!1,fileExtensions:[],collapsedDirs:{},btPeers:[],healthPercent:0,collapseTrackers:!0,statusData:c.getEmptyStatsData(a.gid),availableOptions:[],options:[]},t.changeTab=function(e){"settings"===e&&t.loadTaskOption(t.task),t.context.currentTab=e},e.swipeActions.extendLeftSwipe=function(){var e=h(),a=e.indexOf(t.context.currentTab);return a<e.length-1&&(t.changeTab(e[a+1]),!0)},e.swipeActions.extendRightSwipe=function(){var e=h(),a=e.indexOf(t.context.currentTab);return a>0&&(t.changeTab(e[a-1]),!0)},t.changeFileListDisplayOrder=function(e,a){if(!t.task||!t.task.multiDir){var n=r.parseOrderType(l.getFileListDisplayOrder()),i=r.parseOrderType(e);a&&i.type===n.type&&(i.reverse=!n.reverse),l.setFileListDisplayOrder(i.getValue())}},t.isSetFileListDisplayOrder=function(e){var t=r.parseOrderType(l.getFileListDisplayOrder()),a=r.parseOrderType(e);return t.equals(a)},t.getFileListOrderType=function(){return t.task&&t.task.multiDir?null:l.getFileListDisplayOrder()},t.showChooseFilesToolbar=function(){t.context.showChooseFilesToolbar?t.cancelChooseFiles():(f=!0,t.context.showChooseFilesToolbar=!0)},t.isAnyFileSelected=function(){if(!t.task||!t.task.files)return!1;for(var e=0;e<t.task.files.length;e++){var a=t.task.files[e];if(!a.isDir&&a.selected)return!0}return!1},t.isAllFileSelected=function(){if(!t.task||!t.task.files)return!1;for(var e=0;e<t.task.files.length;e++){var a=t.task.files[e];if(!a.isDir&&!a.selected)return!1}return!0},t.selectFiles=function(e){if(t.task&&t.task.files){"auto"===e&&(e=t.isAllFileSelected()?"none":"all");for(var a=0;a<t.task.files.length;a++){var n=t.task.files[a];n.isDir||("all"===e?n.selected=!0:"none"===e?n.selected=!1:"reverse"===e&&(n.selected=!n.selected))}C()}},t.chooseSpecifiedFiles=function(e){if(t.task&&t.task.files&&o[e]){for(var a=t.task.files,n=o[e].extensions,i=[],s=!0,l=0;l<a.length;l++){if(!(d=a[l]).isDir){var c=r.getFileExtension(d.fileName);c&&(c=c.toLowerCase()),n.indexOf(c)>=0&&(i.push(l),d.selected||(s=!1))}}for(l=0;l<i.length;l++){var d;(d=a[i[l]])&&!d.isDir&&(d.selected=!s)}C()}},t.saveChosenFiles=function(){t.context.showChooseFilesToolbar&&(e.loadPromise=S(!1),t.context.showChooseFilesToolbar=!1)},t.cancelChooseFiles=function(){t.context.showChooseFilesToolbar&&(f=!1,w(!0),t.context.showChooseFilesToolbar=!1)},t.showCustomChooseFileModal=function(){if(t.task&&t.task.files){for(var e=t.task.files,a={},n=0;n<e.length;n++){var i=e[n];if(!i.isDir){if((f=r.getFileExtension(i.fileName))&&(f=f.toLowerCase()),!(m=a[f])){var s=f;s.length>0&&"."===s.charAt(0)&&(s=s.substring(1)),m={extension:s,classified:!1,selected:!1,selectedCount:0,unSelectedCount:0},a[f]=m}i.selected?(m.selected=!0,m.selectedCount++):m.unSelectedCount++}}var l={};for(var c in o)if(o.hasOwnProperty(c)){var d=o[c].name,u=o[c].extensions,p=[];for(n=0;n<u.length;n++){(m=a[f=u[n]])&&(m.classified=!0,p.push(m))}p.length>0&&(l[c]={name:d,extensions:p})}var g=[];for(var f in a){var m;if(a.hasOwnProperty(f))(m=a[f]).classified||g.push(m)}g.length>0&&(l.other={name:"Other",extensions:g}),t.context.fileExtensions=l,angular.element("#custom-choose-file-modal").modal()}},t.setSelectedExtension=function(e,a){if(t.task&&t.task.files){for(var n=t.task.files,i=0;i<n.length;i++){var s=n[i];if(!s.isDir){var o=r.getFileExtension(s.fileName);o&&(o=o.toLowerCase()),o==="."+e&&(s.selected=a)}}C()}},$("#custom-choose-file-modal").on("hide.bs.modal",(function(e){t.context.fileExtensions=null})),t.setSelectedFile=function(e){e&&C(),t.context.showChooseFilesToolbar||S(!0)},t.collapseDir=function(e,a,n){var i=e.nodePath;if(angular.isUndefined(a)&&(a=!t.context.collapsedDirs[i]),a||n)for(var s=0;s<e.subDirs.length;s++)t.collapseDir(e.subDirs[s],a);i&&(t.context.collapsedDirs[i]=a)},t.collapseAllDirs=function(e){if(t.task&&t.task.files)for(var a=0;a<t.task.files.length;a++){var n=t.task.files[a];n.isDir&&t.collapseDir(n,e,!0)}},t.setSelectedNode=function(e){x(e,e.selected),C(),t.context.showChooseFilesToolbar||t.setSelectedFile(!1)},t.changePeerListDisplayOrder=function(e,t){var a=r.parseOrderType(l.getPeerListDisplayOrder()),n=r.parseOrderType(e);t&&n.type===a.type&&(n.reverse=!a.reverse),l.setPeerListDisplayOrder(n.getValue())},t.isSetPeerListDisplayOrder=function(e){var t=r.parseOrderType(l.getPeerListDisplayOrder()),a=r.parseOrderType(e);return t.equals(a)},t.getPeerListOrderType=function(){return l.getPeerListDisplayOrder()},t.loadTaskOption=function(a){e.loadPromise=d.getTaskOptions(a.gid,(function(e){e.success&&(t.context.options=e.data)}))},t.setOption=function(e,a,n){return d.setTaskOption(t.task.gid,e,a,(function(e){e.success&&"OK"===e.data?n.setSuccess():n.setFailed(e.data.message)}),!0)},t.copySelectedRowText=function(){if(m){var e=m.find(".setting-key > span").text().trim(),t="";if(m.find(".setting-value > span").each((function(e,a){e>0&&(t+="\n"),t+=angular.element(a).text().trim()})),l.getIncludePrefixWhenCopyingFromTaskDetails()){var a=e+": "+t;i.copyText(a)}else i.copyText(t)}},l.getDownloadTaskRefreshInterval()>0&&(g=n((function(){!t.task||"complete"!==t.task.status&&"error"!==t.task.status&&"removed"!==t.task.status?w(!0):n.cancel(g)}),l.getDownloadTaskRefreshInterval())),t.$on("$destroy",(function(){g&&n.cancel(g)})),t.onOverviewMouseDown=function(){angular.element('#overview-items .row[contextmenu-bind!="true"]').contextmenu({target:"#task-overview-contextmenu",before:function(e,t){m=t}}).attr("contextmenu-bind","true")},angular.element("#task-overview-contextmenu").on("hide.bs.context",(function(){m=null})),e.loadPromise=w(!1),t.isWindows="Windows"==navigator?.userAgentData?.platform||"Win32"==navigator?.platform,t.isRpcLocalhost=l.isCurrentRpcLocalhost(),t.backHome=function(){window.history.length>1?window.history.back():window.location.href=window.location.origin+window.location.pathname}}])}(),function(){"use strict";angular.module("ariaNg").controller("AriaNgSettingsController",["$rootScope","$scope","$routeParams","$window","$interval","$timeout","$filter","clipboard","ariaNgLanguages","ariaNgCommonService","ariaNgVersionService","ariaNgKeyboardService","ariaNgNotificationService","ariaNgLocalizationService","ariaNgLogService","ariaNgFileService","ariaNgSettingService","ariaNgMonitorService","ariaNgTitleService","aria2SettingService",function(e,t,a,n,i,s,o,r,l,c,d,u,p,g,f,m,h,v,b,y){var k=a.extendType,w=null,S=function(){return b.getFinalTitleByGlobalStat({globalStat:v.getCurrentGlobalStat(),currentRpcProfile:x()})},x=function(){if(!t.context||!t.context.rpcSettings||t.context.rpcSettings.length<1)return null;for(var e=0;e<t.context.rpcSettings.length;e++){var a=t.context.rpcSettings[e];if(a.isDefault)return a}return null},T=function(){w||(w=p.notifyInPage("","Configuration has been modified, please reload the page for the changes to take effect.",{delay:!1,type:"info",templateUrl:"views/notification-reloadable.html",onClose:function(){w=null}}))};t.context={currentTab:"global",ariaNgVersion:d.getBuildVersion(),buildCommit:d.getBuildCommit(),languages:l,titlePreview:S(),availableTime:c.getTimeOptions([1e3,2e3,3e3,5e3,1e4,3e4,6e4],!0),trueFalseOptions:[{name:"Enabled",value:!0},{name:"Disabled",value:!1}],showRpcSecret:!1,settings:h.getAllOptions(),sessionSettings:h.getAllSessionOptions(),rpcSettings:h.getAllRpcSettings(),isMacKeyboardLike:u.isMacKeyboardLike(),isSupportReconnect:y.canReconnect(),isSupportBlob:m.isSupportBlob(),isSupportDarkMode:h.isBrowserSupportDarkMode(),importSettings:null,exportSettings:null,exportSettingsCopied:!1,exportCommandApiOptions:null},t.context.titlePreview=S(),t.context.showDebugMode=t.context.sessionSettings.debugMode||"debug"===k,t.ifDisableInsecureProtocol=function(e){return h.isInsecureProtocolDisabled()&&!/^(localhost|127\.0\.0\.1|\[::1\])$/i.test(e)},t.changeGlobalTab=function(){t.context.currentTab="global"},t.isCurrentGlobalTab=function(){return"global"===t.context.currentTab},t.changeRpcTab=function(e){t.context.currentTab="rpc"+e},t.isCurrentRpcTab=function(e){return t.context.currentTab==="rpc"+e},t.getCurrentRpcTabIndex=function(){return t.isCurrentGlobalTab()?-1:parseInt(t.context.currentTab.substring(3))},t.updateTitlePreview=function(){t.context.titlePreview=S()},e.swipeActions.extendLeftSwipe=function(){var e=-1;return t.isCurrentGlobalTab()||(e=parseInt(t.getCurrentRpcTabIndex())),e<t.context.rpcSettings.length-1&&(t.changeRpcTab(e+1),!0)},e.swipeActions.extendRightSwipe=function(){var e=-1;return t.isCurrentGlobalTab()||(e=parseInt(t.getCurrentRpcTabIndex())),e>0?(t.changeRpcTab(e-1),!0):0===e&&(t.changeGlobalTab(),!0)},t.isSupportNotification=function(){return p.isSupportBrowserNotification()&&h.isCurrentRpcUseWebSocket(t.context.settings.protocol)},t.setLanguage=function(e){h.setLanguage(e)&&g.applyLanguage(e),t.updateTitlePreview()},t.setTheme=function(t){h.setTheme(t),e.setTheme(t)},t.setDebugMode=function(e){h.setDebugMode(e)},t.setTitle=function(e){h.setTitle(e)},t.setEnableBrowserNotification=function(e){h.setBrowserNotification(e),e&&!p.hasBrowserPermission()&&p.requestBrowserPermission((function(e){e.granted||(t.context.settings.browserNotification=!1,c.showError("You have disabled notification in your browser. You should change your browser's settings before you enable this function."))}))},t.setBrowserNotificationSound=function(e){h.setBrowserNotificationSound(e)},t.setBrowserNotificationFrequency=function(e){h.setBrowserNotificationFrequency(e)},t.setWebSocketReconnectInterval=function(e){T(),h.setWebSocketReconnectInterval(e)},t.setTitleRefreshInterval=function(e){T(),h.setTitleRefreshInterval(e)},t.setGlobalStatRefreshInterval=function(e){T(),h.setGlobalStatRefreshInterval(e)},t.setDownloadTaskRefreshInterval=function(e){T(),h.setDownloadTaskRefreshInterval(e)},t.setRPCListDisplayOrder=function(e){T(),h.setRPCListDisplayOrder(e)},t.setDefaultTaskPage=function(t){e.defaultTaskPage=t,h.setDefaultTaskPage(t)},t.setTaskListIndependentDisplayOrder=function(e){h.setTaskListIndependentDisplayOrder(e)},t.setKeyboardShortcuts=function(e){h.setKeyboardShortcuts(e)},t.setSwipeGesture=function(e){h.setSwipeGesture(e)},t.setDragAndDropTasks=function(e){h.setDragAndDropTasks(e)},t.setAfterCreatingNewTask=function(e){h.setAfterCreatingNewTask(e)},t.setRemoveOldTaskAfterRetrying=function(e){h.setRemoveOldTaskAfterRetrying(e)},t.setConfirmTaskRemoval=function(e){h.setConfirmTaskRemoval(e)},t.setIncludePrefixWhenCopyingFromTaskDetails=function(e){h.setIncludePrefixWhenCopyingFromTaskDetails(e)},t.setShowPiecesInfoInTaskDetailPage=function(e){h.setShowPiecesInfoInTaskDetailPage(e)},t.setAfterRetryingTask=function(e){h.setAfterRetryingTask(e)},t.showImportSettingsModal=function(){t.context.importSettings=null,angular.element("#import-settings-modal").modal()},$("#import-settings-modal").on("hide.bs.modal",(function(e){t.context.importSettings=null})),t.openAriaNgConfigFile=function(){m.openFileContent({scope:t,fileFilter:".json",fileType:"text"},(function(e){t.context.importSettings=e.content}),(function(e){c.showError(e)}),angular.element("#import-file-holder"))},t.importSettings=function(e){var t=null;try{t=JSON.parse(e)}catch(e){return f.error("[AriaNgSettingsController.importSettings] parse settings json error",e),void c.showError("Invalid settings data format!")}if(!angular.isObject(t)||angular.isArray(t))return f.error("[AriaNgSettingsController.importSettings] settings json is not object"),void c.showError("Invalid settings data format!");t&&c.confirm("Confirm Import","Are you sure you want to import all settings?","warning",(function(){h.importAllOptions(t),n.location.reload()}))},t.showExportSettingsModal=function(){t.context.exportSettings=o("json")(h.exportAllOptions()),t.context.exportSettingsCopied=!1,angular.element("#export-settings-modal").modal()},$("#export-settings-modal").on("hide.bs.modal",(function(e){t.context.exportSettings=null,t.context.exportSettingsCopied=!1})),t.copyExportSettings=function(){r.copyText(t.context.exportSettings,{container:angular.element("#export-settings-modal")[0]}),t.context.exportSettingsCopied=!0},t.addNewRpcSetting=function(){T();var e=h.addNewRpcSetting();t.context.rpcSettings.push(e),t.changeRpcTab(t.context.rpcSettings.length-1)},t.updateRpcSetting=function(e,t){T(),"protocol"!==t||e[t]||(e[t]="https"),h.updateRpcSetting(e,t)},t.removeRpcSetting=function(e){var a=e.rpcAlias?e.rpcAlias:e.rpcHost+":"+e.rpcPort;c.confirm("Confirm Remove",'Are you sure you want to remove rpc setting "{rpcName}"?',"warning",(function(){T();var a=t.getCurrentRpcTabIndex(),n=t.context.rpcSettings.indexOf(e);h.removeRpcSetting(e),t.context.rpcSettings.splice(n,1),a>=t.context.rpcSettings.length?t.changeRpcTab(t.context.rpcSettings.length-1):a<=0||a<=n||t.changeRpcTab(a-1)}),!1,{textParams:{rpcName:a}})},t.showExportCommandAPIModal=function(e){t.context.exportCommandApiOptions={type:"setting",data:e}},t.setDefaultRpcSetting=function(e){e.isDefault||(h.setDefaultRpcSetting(e),n.location.reload())},t.resetSettings=function(){c.confirm("Confirm Reset","Are you sure you want to reset all settings?","warning",(function(){h.resetSettings(),n.location.reload()}))},t.clearHistory=function(){c.confirm("Confirm Clear","Are you sure you want to clear all settings history?","warning",(function(){y.clearSettingsHistorys(),n.location.reload()}))},t.resetAria2Settings=function(){c.confirm("Confirm Reset","Reset the current Aria2 settings (Will take effect after Aria2 restarts)?","warning",(function(){const e=h.getRpcOptions(),t=y.getDefaultOptions(Object.keys(e));y.setGlobalOptions(t,(function(){const e=h.getCurrentRpcDisplayName();p.notifyInPage("","settings are reset",{type:"success",contentPrefix:e+" "})})),h.resetRpcOptions()}))},angular.element('[data-toggle="popover"]').popover(),e.loadPromise=s((function(){}),100)}])}(),function(){"use strict";angular.module("ariaNg").controller("Aria2SettingsController",["$rootScope","$scope","$location","ariaNgConstants","ariaNgCommonService","aria2SettingService","ariaNgSettingService",function(e,t,a,n,i,s,o){var r=a.path().substring(a.path().lastIndexOf("/")+1);t.context={availableOptions:function(e){var t=s.getAvailableGlobalOptionsKeys(e);if(t)return s.getSpecifiedOptions(t);i.showError("Type is illegal!")}(r),globalOptions:[]},t.setGlobalOption=function(e,t,a){return s.setGlobalOption(e,t,(function(n){n.success&&"OK"===n.data?(a.setSuccess(),o.setRpcOption(e,t)):a.setFailed(n.data.message)}),!0)},e.loadPromise=s.getGlobalOption((function(e){e.success&&(t.context.globalOptions=e.data)}))}])}(),function(){"use strict";angular.module("ariaNg").controller("Aria2StatusController",["$rootScope","$scope","$timeout","ariaNgCommonService","ariaNgSettingService","aria2SettingService",function(e,t,a,n,i,s){t.context={host:i.getCurrentRpcUrl(),serverStatus:null,isSupportReconnect:s.canReconnect()},t.reconnect=function(){!t.context.isSupportReconnect||"Disconnected"!==e.taskContext.rpcStatus&&"Waiting to reconnect"!==e.taskContext.rpcStatus||s.reconnect()},t.saveSession=function(){return s.saveSession((function(e){e.success&&"OK"===e.data&&n.showOperationSucceeded("Session has been saved successfully.")}))},t.shutdown=function(){n.confirm("Confirm Shutdown","Are you sure you want to shutdown aria2?","warning",(function(e){return s.shutdown((function(e){e.success&&"OK"===e.data&&n.showOperationSucceeded("Aria2 has been shutdown successfully.")}))}),!0)},e.$watch("taskContext.rpcStatus",(function(e){"Connected"===e?(s.getAria2Status((function(e){e.success&&(t.context.serverStatus=e.data)})),s.getSessionInfo((function(e){e.success&&(t.context.sessionInfo=e.data)}))):(t.context.serverStatus=null,t.context.sessionInfo=null)})),e.loadPromise=a((function(){}),100)}])}(),function(){"use strict";angular.module("ariaNg").controller("RecommendController",["$rootScope","$scope","$location","$sce","aria2eConstants","ariaNgSettingService",function(e,t,a,n,i,s){let o=a.search().path||"",r=a.hash()?"#"+a.hash():"",l=s.getLanguage()||"en";l="zh_Hans"==l?"":"zh_Hant"==l?"/zh-tw":"/en",t.recommendUrl=n.trustAsResourceUrl(i.recommendOrigin+l+o+r);var c=s.getRecCount();e.recTotal>c&&s.setRecCount(e.recTotal),e.hasNewRec=!1}])}(),function(){"use strict";angular.module("ariaNg").directive("ngAutoFocus",["$timeout",function(e){return{restrict:"A",link:function(t,a){e((function(){a[0].focus()}))}}}])}(),function(){"use strict";angular.module("ariaNg").directive("ngPieceBar",["aria2TaskService",function(e){return{restrict:"E",template:'<canvas class="piece-bar progress"></canvas>',replace:!0,scope:{bitField:"=",pieceCount:"=",color:"@"},link:function(t,a){var n=function(){var n=a[0],i=e.getCombinedPieces(t.bitField,t.pieceCount),s=n.getContext("2d");s.fillStyle=t.color||"#000",s.clearRect(0,0,n.width,n.height);for(var o=0,r=n.width,l=n.height,c=0;c<i.length;c++){var d=i[c],u=d.count/t.pieceCount*r;d.isCompleted&&s.fillRect(o,0,u,l),o+=u}};t.$watch("bitField",(function(){n()})),t.$watch("pieceNumber",(function(){n()}))}}}])}(),function(){"use strict";angular.module("ariaNg").directive("ngPieceMap",["aria2TaskService",function(e){return{restrict:"E",template:'<div class="piece-map"></div>',replace:!0,scope:{bitField:"=",pieceCount:"="},link:function(t,a){var n=[],i=[],s=function(){i=e.getPieceStatus(t.bitField,t.pieceCount),n.length=0,a.empty();for(var s=Math.max(1,i.length),o=0;o<s;o++){var r=angular.element('<div class="piece'+(i[o]?" piece-completed":"")+'"></div>');n.push(r),a.append(r)}};t.$watch("bitField",(function(){!function(){var a=e.getPieceStatus(t.bitField,t.pieceCount);if(i&&a&&i.length===a.length&&a.length===n.length){for(var o=0;o<n.length;o++)i[o]!==a[o]&&(a[o]?n[o].addClass("piece-completed"):n[o].removeClass("piece-completed"));i=a}else s()}()})),t.$watch("pieceCount",(function(){s()}))}}}])}(),function(){"use strict";angular.module("ariaNg").directive("ngChart",["$window","chartTheme",function(e,t){return{restrict:"E",template:"<div></div>",scope:{options:"=ngData",theme:"=ngTheme"},link:function(a,n,i){angular.extend({},i);var s=n.find("div"),o=n.parent().height(),r=parseInt(i.height)||o||200;s.css("height",r+"px");var l=echarts.init(s[0],t.get(a.theme)),c=function(){l.resize(),a.$apply()};angular.element(e).on("resize",c),a.$watch("options",(function(e){e&&function(e){l.setOption(e)}(e)}),!0),a.$on("$destroy",(function(){l&&!l.isDisposed()&&l.dispose(),angular.element(e).off("resize",c)}))}}}]).directive("ngPopChart",["$window","chartTheme",function(e,t){return{restrict:"A",scope:{options:"=ngData",theme:"=ngTheme"},link:function(e,a,n){var i={ngPopoverClass:"",ngContainer:"body",ngTrigger:"click",ngPlacement:"top"};angular.extend(i,n);var s=null,o='<div class="loading"><i class="fa fa-spinner fa-spin fa-2x"></i></div>';a.popover({container:i.ngContainer,content:'<div class="chart-pop-wrapper"><div class="chart-pop '+i.ngPopoverClass+'">'+o+"</div></div>",html:!0,placement:i.ngPlacement,template:'<div class="popover chart-popover" role="tooltip"><div class="arrow"></div><div class="popover-body"></div></div>',trigger:i.ngTrigger}).on("shown.bs.popover",(function(){var a=angular.element(".chart-pop"),i=a.parent().height();a.empty();var o=parseInt(n.height)||i||200;a.css("height",o+"px"),s=echarts.init(a[0],t.get(e.theme))})).on("hide.bs.popover",(function(){s&&!s.isDisposed()&&s.dispose()})).on("hidden.bs.popover",(function(){angular.element(".chart-pop").empty().append(o)}));e.$watch("options",(function(e){e&&function(e){s&&!s.isDisposed()&&s.setOption(e)}(e)}),!0)}}}]).factory("chartTheme",["chartDefaultTheme","chartDarkTheme",function(e,t){var a={defaultTheme:e,darkTheme:t};return{get:function(e){return"default"!==e&&a[e+"Theme"]?angular.extend({},a.defaultTheme,a[e+"Theme"]):a.defaultTheme}}}]).factory("chartDefaultTheme",(function(){return{color:["#74a329","#3a89e9"],legend:{top:"bottom"},toolbox:{show:!1},tooltip:{show:!0,trigger:"axis",backgroundColor:"rgba(0, 0, 0, 0.7)",axisPointer:{type:"line",lineStyle:{color:"#233333",type:"dashed",width:1},crossStyle:{color:"#008acd",width:1},shadowStyle:{color:"rgba(200,200,200,0.2)"}}},grid:{x:40,y:20,x2:30,y2:50},categoryAxis:{axisLine:{show:!1},axisTick:{show:!1},splitLine:{lineStyle:{color:"#f3f3f3"}}},valueAxis:{axisLine:{show:!1},axisTick:{show:!1},splitLine:{lineStyle:{color:"#f3f3f3"}},splitArea:{show:!1}},line:{itemStyle:{normal:{lineStyle:{width:2,type:"solid"}}},smooth:!0,symbolSize:6},textStyle:{fontFamily:"Hiragino Sans GB, Microsoft YaHei, STHeiti, Helvetica Neue, Helvetica, Arial, sans-serif"},animationDuration:500}})).factory("chartDarkTheme",(function(){return{tooltip:{show:!0,trigger:"axis",backgroundColor:"rgba(0, 0, 0, 0.7)",axisPointer:{type:"line",lineStyle:{color:"#ddd",type:"dashed",width:1},crossStyle:{color:"#ddd",width:1},shadowStyle:{color:"rgba(200,200,200,0.2)"}}},categoryAxis:{axisLine:{show:!1},axisTick:{show:!1},splitLine:{lineStyle:{color:"#333"}}},valueAxis:{axisLine:{show:!1},axisTick:{show:!1},axisLabel:{show:!0,textStyle:{color:"#eee"}},splitLine:{lineStyle:{color:"#333"}},splitArea:{show:!1}}}}))}(),function(){"use strict";angular.module("ariaNg").directive("ngExportCommandApiDialog",["clipboard","ariaNgCommonService",function(e,t){return{restrict:"E",templateUrl:"views/export-command-api-dialog.html",replace:!0,scope:{options:"="},link:function(a,n,i){a.context={trueFalseOptions:[{name:"Enabled",value:!0},{name:"Disabled",value:!1}],baseUrl:t.getFullPageUrl(),commandAPIUrl:null,pauseOnAdded:!0,isCopied:!1};var s=function(){var e=a.context.baseUrl;return e.indexOf("#")>=0&&(e=e.substring(0,e.indexOf("#"))),e},o=function(e){var n=s()+"#!/new/task?url="+t.base64UrlEncode(e.urls[0]);if(a.context.pauseOnAdded&&(n+="&pause=true"),e.options)for(var i in e.options)e.options.hasOwnProperty(i)&&(n+="&"+i+"="+e.options[i]);return n};a.generateCommandAPIUrl=function(){var e,n;a.options&&("new-task"===a.options.type?a.context.commandAPIUrl=function(e){for(var t="",a=0;a<e.length;a++)a>0&&(t+="\n"),t+=o(e[a]);return t}(a.options.data):"setting"===a.options.type&&(a.context.commandAPIUrl=(e=a.options.data,n=s()+"#!/settings/rpc/set?protocol="+e.protocol+"&host="+e.rpcHost+"&port="+e.rpcPort+"&interface="+e.rpcInterface,e.secret&&(n+="&secret="+t.base64UrlEncode(e.secret)),n)),a.context.isCopied=!1)},a.copyCommandAPI=function(){e.copyText(a.context.commandAPIUrl,{container:angular.element(n)[0]}),a.context.isCopied=!0},angular.element(n).on("hidden.bs.modal",(function(){a.$apply((function(){a.options=null,a.context.commandAPIUrl=null,a.context.isCopied=!1}))})),a.$watch("options",(function(e){e&&(a.generateCommandAPIUrl(),a.context.isCopied=!1,angular.element(n).modal("show"))}),!0)}}}])}(),function(){"use strict";angular.module("ariaNg").directive("ngIndeterminate",(function(){return{restrict:"A",scope:{indeterminate:"=ngIndeterminate"},link:function(e,t){e.$watch("indeterminate",(function(){t[0].indeterminate="true"===e.indeterminate||!0===e.indeterminate}))}}}))}(),function(){"use strict";angular.module("ariaNg").directive("ngPlaceholder",(function(){return{restrict:"A",scope:{placeholder:"=ngPlaceholder"},link:function(e,t){e.$watch("placeholder",(function(){t[0].placeholder=e.placeholder}))}}}))}(),function(){"use strict";angular.module("ariaNg").directive("ngSetting",["$timeout","$q","ariaNgConstants","ariaNgLocalizationService","ariaNgKeyboardService","aria2SettingService",function(e,t,a,n,i,s){return{restrict:"E",templateUrl:"views/setting.html",require:"?ngModel",replace:!0,scope:{option:"=",ngModel:"=",defaultValue:"=?",fixedValue:"=?",onChangeValue:"&"},link:function(o,r,l,c){var d=null,u={showPlaceholderCount:!1,deleteKeyAlwaysChangeValue:!1,lazySaveTimeout:a.lazySaveTimeout,errorTooltipPlacement:"top",errorTooltipDelay:a.errorTooltipDelay};angular.extend(u,l);var p,g=function(){o.option&&o.option.showHistory&&(o.history=s.getSettingHistory(o.option.key))},f=function(){angular.element(r).tooltip("dispose")},m=function(t,a,i){t&&e((function(){var e=o.optionStatus.getValue();"failed"!==e&&"error"!==e||angular.element(r).tooltip({animation:!1,title:n.getLocalizedText(t,i),trigger:"focus",placement:u.errorTooltipPlacement,container:r,template:'<div class="tooltip'+(a?" tooltip-"+a:"")+'" role="tooltip"><div class="arrow"></div><div class="tooltip-inner"></div></div>'}).tooltip("show")}),u.errorTooltipDelay)},h=function(e,t,a){if(!e||!t||!angular.isString(e))return 0;var n=e.split(t),i=n.length;if(a)for(var s=0;s<n.length;s++)n[s]&&""!==n[s]&&""!==n[s].trim()||i--;return i},v=function(e){return"Bytes"===o.option.suffix?function(e){if(!e||parseInt(e).toString()!=e)return e;for(var t=["","K","M","G"],a=0,n=0;n<t.length&&!(e<1024||e%1024!=0);n++)e/=1024,a++;return e+t[a]}(e):e};o.optionStatus=(p="ready",{getValue:function(){return p},setReady:function(){f(),p="ready"},setPending:function(){f(),p="pending"},setSaving:function(){f(),p="pending"},setSuccess:function(){f(),p="success"},setFailed:function(e){f(),p="failed",m(e,"warning")},setError:function(e,t){f(),p="error",m(e,"error",t)},getStatusFeedbackStyle:function(){return"success"===p?"has-success":"failed"===p?"has-warning":"error"===p?"has-error":""},getStatusIcon:function(){return"pending"===p?"fa-hourglass-start":"saving"===p?"fa-spin fa-pulse fa-spinner":"success"===p?"fa-check":"failed"===p?"fa-exclamation":"error"===p?"fa-times":""},isShowStatusIcon:function(){return""!==this.getStatusIcon()}}),o.getTotalCount=function(){var e=h(o.fixedValue,o.option.separator,o.option.trimCount),t=h(o.optionValue,o.option.separator,o.option.trimCount);return!o.optionValue&&o.showPlaceholderCount&&o.placeholderItemCount&&(t=o.placeholderItemCount),e+t},o.changeValue=function(t,a){if(d&&e.cancel(d),o.optionValue=t,o.optionStatus.setReady(),o.option&&o.option.key&&!o.option.readonly)if(o.option.required&&""===t)o.optionStatus.setError("Option value cannot be empty!");else if(""===t||"integer"!==o.option.type||/^-?\d+$/.test(t))if(""===t||"float"!==o.option.type||/^-?(\d*\.)?\d+$/.test(t)){if(""!==t&&("integer"===o.option.type||"float"===o.option.type)&&(angular.isDefined(o.option.min)||angular.isDefined(o.option.max))){var n=t;if("integer"===o.option.type?n=parseInt(t):"float"===o.option.type&&(n=parseFloat(t)),angular.isDefined(o.option.min)&&n<o.option.min)return void o.optionStatus.setError("Input number is below min value!",{value:o.option.min});if(angular.isDefined(o.option.max)&&n>o.option.max)return void o.optionStatus.setError("Input number is above max value!",{value:o.option.max})}if(""===t||!angular.isDefined(o.option.pattern)||new RegExp(o.option.pattern).test(t)){var i={key:o.option.key,value:t,optionStatus:o.optionStatus},s=function(){o.optionStatus.setSaving(),o.onChangeValue(i)};o.onChangeValue&&(a?(o.optionStatus.setPending(),d=e((function(){s()}),u.lazySaveTimeout)):s())}else o.optionStatus.setError("Input value is invalid!")}else o.optionStatus.setError("Input number is invalid!");else o.optionStatus.setError("Input number is invalid!")},o.inputKeyUp=function(e,t){if((!0===u.deleteKeyAlwaysChangeValue||"true"===u.deleteKeyAlwaysChangeValue)&&(i.isBackspacePressed(e)||i.isDeletePressed(e))){if(o.optionValue&&""!==o.optionValue)return;o.changeValue("",t)}},o.filterHistory=function(e){var a=[];if(o.history&&e)for(var n=0;n<o.history.length;n++)0===o.history[n].indexOf(e)&&a.push(o.history[n]);return t.resolve(a)},c&&o.$watch((function(){return c.$viewValue}),(function(e){o.optionValue=v(e)})),o.$watch("option",(function(){g(),r.find('[data-toggle="popover"]').popover()})),o.$watch("defaultValue",(function(e){var t=e;if(o.option&&o.option.options)for(var a=0;a<o.option.options.length;a++){var n=o.option.options[a];if(n.value===e){t=n.name;break}}o.placeholder=v(t),o.option?o.placeholderItemCount=h(o.placeholder,o.option.separator,o.option.trimCount):o.placeholderItemCount=0})),o.showPlaceholderCount=!0===u.showPlaceholderCount||"true"===u.showPlaceholderCount,g()}}}])}(),function(){"use strict";angular.module("ariaNg").directive("ngSettingDialog",["ariaNgCommonService","aria2SettingService","ariaNgSettingService",function(e,t,a){return{restrict:"E",templateUrl:"views/setting-dialog.html",replace:!0,scope:{setting:"="},link:function(n,i,s){n.context={isLoading:!1,availableOptions:[],globalOptions:[]},n.setGlobalOption=function(e,n,i){return t.setGlobalOption(e,n,(function(t){t.success&&"OK"===t.data?(i.setSuccess(),a.setRpcOption(e,n)):i.setFailed(t.data.message)}),!0)};angular.element(i).on("hidden.bs.modal",(function(){n.$apply((function(){n.setting=null,n.context.availableOptions=[],n.context.globalOptions=[]}))})),n.$watch("setting",(function(a){var s,o;a&&(s=a.type,(o=t.getAria2QuickSettingsAvailableOptions(s))?n.context.availableOptions=t.getSpecifiedOptions(o):e.showError("Type is illegal!"),n.context.isLoading=!0,t.getGlobalOption((function(e){n.context.isLoading=!1,e.success&&(n.context.globalOptions=e.data)})),angular.element(i).modal("show"))}),!0)}}}])}(),function(){"use strict";angular.module("ariaNg").directive("ngTooltip",(function(){return{restrict:"A",scope:{title:"@ngTooltip"},link:function(e,t,a){var n={ngTooltipIf:!0,ngTooltipPlacement:"top",ngTooltipContainer:null,ngTooltipTrigger:"hover"};angular.extend(n,a);var i=!0===n.ngTooltipIf||"true"===n.ngTooltipIf,s=function(){angular.element(t).tooltip({title:e.title,placement:n.ngTooltipPlacement,container:n.ngTooltipContainer,trigger:n.ngTooltipTrigger,delay:{show:100,hide:0}})};i&&s(),e.$watch("title",(function(){i&&angular.element(t).attr("title",e.title).tooltip("_fixTitle")})),e.$watch("ngTooltipIf",(function(e){angular.isUndefined(e)||i!==(e=!0===e||"true"===e)&&(e?s():angular.element(t).tooltip("dispose"),i=e)}))}}}))}(),function(){"use strict";angular.module("ariaNg").directive("ngValidUrls",["ariaNgCommonService",function(e){return{restrict:"A",require:"?ngModel",link:function(t,a,n,i){t.$watch((function(){return i.$viewValue}),(function(t){if(!angular.isUndefined(t)&&""!==t){var a=e.parseUrlsFromOriginInput(t,n.urlPattern),s=a&&a.length>0;i.$setValidity("invalidUrls",s)}}))}}}])}(),function(){"use strict";angular.module("ariaNg").directive("ngBlobDownload",["ariaNgFileService",function(e){return{restrict:"A",scope:{ngBlobDownload:"=ngBlobDownload",ngFileName:"@",ngContentType:"@"},link:function(t,a){t.$watch("ngBlobDownload",(function(n){n&&e.saveFileContent(n,a,{fileName:t.ngFileName,contentType:t.ngContentType})}))}}}])}(),function(){"use strict";angular.module("ariaNg").filter("dateDuration",["moment",function(e){return function(t,a,n){var i=e.duration(t,a);return e.utc(i.asMilliseconds()).format(n)}}])}(),function(){"use strict";angular.module("ariaNg").filter("fileOrderBy",["$filter","ariaNgCommonService",function(e,t){return function(a,n){if(!angular.isArray(a)||!n)return a;var i=t.parseOrderType(n);return null===i?a:"index"===i.type?e("orderBy")(a,["index"],i.reverse):"name"===i.type?e("orderBy")(a,["fileName"],i.reverse):"size"===i.type?e("orderBy")(a,["length"],i.reverse):"percent"===i.type?e("orderBy")(a,["completePercent"],i.reverse):"selected"===i.type?e("orderBy")(a,["selected"],i.reverse):a}}])}(),function(){"use strict";angular.module("ariaNg").filter("logOrderBy",["$filter","ariaNgCommonService",function(e,t){return function(a,n){if(!angular.isArray(a)||!n)return a;var i=t.parseOrderType(n);return null===i?a:"time"===i.type?e("orderBy")(a,["time"],i.reverse):a}}])}(),function(){"use strict";angular.module("ariaNg").filter("longDate",["ariaNgCommonService","ariaNgLocalizationService",function(e,t){return function(a){var n=t.getLongDateFormat();return e.formatDateTime(a,n)}}])}(),function(){"use strict";angular.module("ariaNg").filter("peerOrderBy",["$filter","ariaNgCommonService",function(e,t){return function(a,n){if(!angular.isArray(a))return a;var i=t.parseOrderType(n);return null===i?a:"address"===i.type?e("orderBy")(a,["ip","port"],i.reverse):"client"===i.type?e("orderBy")(a,["client.name","client.version"],i.reverse):"percent"===i.type?e("orderBy")(a,["completePercent"],i.reverse):"dspeed"===i.type?e("orderBy")(a,["downloadSpeed"],i.reverse):"uspeed"===i.type?e("orderBy")(a,["uploadSpeed"],i.reverse):a}}])}(),function(){"use strict";angular.module("ariaNg").filter("percent",["$filter",function(e){return function(t,a){var n=Math.pow(10,a),i=parseInt(t*n)/n;return e("number")(i,a)}}])}(),function(){"use strict";angular.module("ariaNg").filter("reverse",(function(){return function(e){return e?e.slice().reverse():e}}))}(),function(){"use strict";angular.module("ariaNg").filter("taskOrderBy",["$filter","ariaNgCommonService",function(e,t){return function(a,n){if(!angular.isArray(a))return a;var i=t.parseOrderType(n);return null===i?a:"name"===i.type?e("orderBy")(a,["taskName"],i.reverse):"size"===i.type?e("orderBy")(a,["totalLength"],i.reverse):"percent"===i.type?e("orderBy")(a,["completePercent"],i.reverse):"remain"===i.type?e("orderBy")(a,["idle","remainTime","remainLength"],i.reverse):"dspeed"===i.type?e("orderBy")(a,["downloadSpeed"],i.reverse):"uspeed"===i.type?e("orderBy")(a,["uploadSpeed"],i.reverse):"default"===i.type?e("orderBy")(a,["groupIndex"],i.reverse):a}}])}(),function(){"use strict";angular.module("ariaNg").filter("taskStatus",(function(){return function(e,t){return e?"active"===e.status?e.verifyIntegrityPending?"Pending Verification":e.verifiedLength?e.verifiedPercent?"format.task.verifying-percent":"Verifying":!0===e.seeder||"true"===e.seeder?"Seeding":"Downloading":t||"waiting"!==e.status?t||"paused"!==e.status?t||"complete"!==e.status?t||"error"!==e.status?t||"removed"!==e.status?"":"Removed":e.errorCode?"format.task.error-occurred":"Error Occurred":"Completed":"Paused":"Waiting":""}}))}(),function(){"use strict";angular.module("ariaNg").filter("groupTask",(function(){return function(e){if(!angular.isArray(e))return e;let t=-1;for(const a in e){switch(e[a].status){case"active":t=1;break;case"waiting":t=2;break;case"paused":t=3;break;case"error":t=4;break;case"complete":t=5;break;case"removed":t=6;break;default:t=10}e[a].groupIndex=t}return e}}))}(),function(){"use strict";angular.module("ariaNg").filter("timeDisplayName",["ariaNgCommonService","ariaNgLocalizationService",function(e,t){return function(a,n){if(!a)return t.getLocalizedText(n);var i=e.getTimeOption(a);return t.getLocalizedText(i.name,{value:i.value})}}])}(),function(){"use strict";angular.module("ariaNg").filter("readableVolume",["$filter",function(e){var t=["B","KB","MB","GB"];return function(a,n){var i=t[0],s=2,o=!1;angular.isNumber(n)?s=n:"auto"===n&&(o=!0),a||(a=0),angular.isNumber(a)||(a=parseInt(a));for(var r=1;r<t.length&&a>=1024;r++)a/=1024,i=t[r];return o&&(s=function(e){return e<1?2:e<10?1:0}(a)),(a=e("number")(a,s))+" "+i}}])}(),function(){"use strict";angular.module("ariaNg").provider("ariaNgAssetsCacheService",[function(){var e={},t="languages.";this.getLanguageAsset=function(a){return function(t){for(var a=t.split("."),n=e,i=0;i<a.length;i++){if(angular.isUndefined(n[a[i]]))return null;n=n[a[i]]}return n}(t+a)},this.setLanguageAsset=function(a,n){!function(t,a){for(var n=t.split("."),i=e,s=0;s<n.length-1;s++)angular.isUndefined(i[n[s]])&&(i[n[s]]={}),i=i[n[s]];i[n[n.length-1]]=a}(t+a,n)},this.$get=function(){var e=this;return{getLanguageAsset:function(t){return e.getLanguageAsset(t)}}}}])}(),function(){"use strict";angular.module("ariaNg").factory("ariaNgLanguageLoader",["$http","$q","ariaNgConstants","ariaNgLanguages","ariaNgAssetsCacheService","ariaNgNotificationService","ariaNgLogService","ariaNgStorageService",function(e,t,a,n,i,s,o,r){var l=function(e){for(var t=0;t<e.length;t++)if(t>0&&"\\"!==e.charAt(t-1)&&"="===e.charAt(t))return{key:e.substring(0,t).replace("\\=","="),value:e.substring(t+1,e.length).replace("\\=","=")};return{value:e}},c=function(e,t){var a=e;if(!t)return a;if("["===t[0]&&"]"===t[t.length-1]&&(t=t.substring(1,t.length-1)),"global"===t)return a;for(var n=t.split("."),i=0;i<n.length;i++){var s=n[i];a[s]||(a[s]={}),a=a[s]}return a},d=function(e){var t={};if(!e)return t;for(var a=e.split("\n"),n=t,i=0;i<a.length;i++){var s=a[i];if(s)if(s=s.replace("\r",""),/^\[.+\]$/.test(s))n=c(t,s);else{var o=l(s);o&&o.key&&(n[o.key]=o.value)}}return t},u=function(e,t){if(!angular.isObject(e)||!angular.isObject(t))return!1;for(var a in t)if(t.hasOwnProperty(a)){var n=t[a];if(angular.isObject(n)){if(!u(e[a],n))return!1}else if(n!==e[a])return!1}return!0};return function(l){var c=t.defer();if(!n[l.key])return c.reject(l.key),c.promise;var p=a.languageStorageKeyPrefix+"."+l.key,g=r.get(p);if(g&&c.resolve(g),i.getLanguageAsset(l.key)){var f=d(i.getLanguageAsset(l.key));return r.set(p,f),c.resolve(f),c.promise}var m=a.languagePath+"/"+l.key+a.languageFileExtension;return e({url:m,method:"GET"}).then((function(e){var t=d(e.data),a=!1;return g&&(a=!u(g,t)),r.set(p,t),a?(o.info("[ariaNgLanguageLoader] load language resource successfully, and resource is updated"),s.notifyInPage("","Language resource has been updated, please reload the page for the changes to take effect.",{delay:!1,type:"info",templateUrl:"views/notification-reloadable.html"})):o.info("[ariaNgLanguageLoader] load language resource successfully, but resource is not updated"),c.resolve(t)})).catch((function(e){return o.warn("[ariaNgLanguageLoader] cannot get language resource"),g||s.notifyInPage("","AriaNg cannot get language resources, and will display in default language.",{type:"error",delay:!1}),c.reject(l.key)})),c.promise}}])}(),function(){"use strict";angular.module("ariaNg").factory("ariaNgCommonService",["$window","$location","$timeout","base64","moment","SweetAlert","ariaNgConstants","ariaNgLocalizationService",function(e,t,a,n,i,s,o,r){var l=function(e){var t=e;return{name:e<1e3?1===(t=e)?"format.time.millisecond":"format.time.milliseconds":e<6e4?1===(t=e/1e3)?"format.time.second":"format.time.seconds":e<144e4?1===(t=e/1e3/60)?"format.time.minute":"format.time.minutes":1===(t=e/1e3/60/24)?"format.time.hour":"format.time.hours",value:t,optionValue:e}};return{getFullPageUrl:function(){return e.location.protocol+"//"+e.location.host+e.location.pathname+(e.location.search?e.location.search:"")},base64Encode:function(e){return n.encode(e)},base64Decode:function(e){return n.decode(e)},base64UrlEncode:function(e){return n.urlencode(e)},base64UrlDecode:function(e){return n.urldecode(e)},generateUniqueId:function(){var e=o.appPrefix+"_"+Math.round((new Date).getTime()/1e3)+"_"+Math.random();return this.base64Encode(e)},showDialog:function(e,t,n,i,o){o||(o={}),e&&(e=r.getLocalizedText(e)),t&&(t=r.getLocalizedText(t,o.textParams)),o.confirmButtonText=r.getLocalizedText("OK"),function(e,t,n,i,o){a((function(){s.swal({title:e,text:t,type:n,confirmButtonText:o&&o.confirmButtonText||null},(function(){i&&i()}))}),100)}(e,t,n,i,o)},showInfo:function(e,t,a,n){this.showDialog(e,t,"info",a,n)},showError:function(e,t,a){this.showDialog("Error",e,"error",t,a)},showOperationSucceeded:function(e,t){this.showDialog("Operation Succeeded",e,"success",t)},confirm:function(e,t,a,n,i,o,l){o||(o={}),e&&(e=r.getLocalizedText(e)),t&&(t=r.getLocalizedText(t,o.textParams)),o.confirmButtonText=r.getLocalizedText("OK"),o.cancelButtonText=r.getLocalizedText("Cancel"),function(e,t,a,n,i,o,r){var l={title:e,text:t,type:a,showCancelButton:!0,showLoaderOnConfirm:!!i,closeOnConfirm:!i,confirmButtonText:o&&o.confirmButtonText||null,cancelButtonText:o&&o.cancelButtonText||null};"warning"===a&&(l.confirmButtonColor="#F39C12"),s.swal(l,(function(e){e?n&&n():r&&r()}))}(e,t,a,n,i,o,l)},closeAllDialogs:function(){s.close()},getFileExtension:function(e){return!e||e.lastIndexOf(".")<0?e:e.substring(e.lastIndexOf("."))},getFileExtensionFromUrl:function(e){let t=".";try{let a=new URL(e).pathname.split("/").pop();t+=a.includes(".")?a.split(".").pop():""}catch(e){t="."}return t},parseUrlsFromOriginInput:function(e,t){if(!e)return[];for(var a=e.split("\n"),n=[],i=0;i<a.length;i++){var s=a[i];if(t)try{new RegExp(t,"i").test(s)&&n.push(s)}catch(e){console.warn("[ariaNgCommonService.parseUrlsFromOriginInput] "+e.message,e)}else(s.match(/^(http|https|ftp|sftp):\/\/.+$/i)||s.match(/^magnet:\?.+$/))&&n.push(s)}return n},decodePercentEncodedString:function(e){if(!e)return e;for(var t="",a=0;a<e.length;a++){var n=e.charAt(a);if("%"===n&&a<e.length-2){var i=e.substring(a+1,a+3);t+=String.fromCharCode(parseInt(i,16)),a+=2}else t+=n}return t},extendArray:function(e,t,a){if(!t||!e||e.length!==t.length)return!1;for(var n=0;n<t.length;n++){if(t[n][a]!==e[n][a])return!1;angular.extend(t[n],e[n])}return!0},copyObjectTo:function(e,t){if(!t)return e;for(var a in e)if(e.hasOwnProperty(a)){var n=e[a],i=t[a];angular.isObject(n)||angular.isArray(n)?t[a]=this.copyObjectTo(e[a],t[a]):n!==i&&(t[a]=n)}return t},pushArrayTo:function(e,t){if(angular.isArray(e)||(e=[]),!angular.isArray(t)||t.length<1)return e;for(var a=0;a<t.length;a++)e.push(t[a]);return e},combineArray:function(){for(var e=[],t=0;t<arguments.length;t++)angular.isArray(arguments[t])?this.pushArrayTo(e,arguments[t]):e.push(arguments[t]);return e},countArray:function(e,t){if(!angular.isArray(e)||e.length<1)return 0;for(var a=0,n=0;n<e.length;n++)a+=e[n]===t?1:0;return a},parseOrderType:function(e){var t=e.split(":"),a={type:t[0],order:t[1],equals:function(e){return angular.isUndefined(e.order)?this.type===e.type:this.type===e.type&&this.order===e.order},getValue:function(){return this.type+":"+this.order}};return Object.defineProperty(a,"reverse",{get:function(){return"desc"===this.order},set:function(e){this.order=e?"desc":"asc"}}),a},getCurrentUnixTime:function(){return i().format("X")},getLongTimeFromUnixTime:function(e){return i(e,"X").format("HH:mm:ss")},isUnixTimeAfter:function(e,t,a){return i(e,"X").isAfter(i().add(t,a))},formatDateTime:function(e,t){return i(e).format(t)},getTimeOption:function(e){return l(e)},getTimeOptions:function(e,t){var a=[];if(t&&a.push({name:"Disabled",value:0,optionValue:0}),!angular.isArray(e)||e.length<1)return a;for(var n=0;n<e.length;n++){var i=e[n],s=l(i);a.push(s)}return a},formatFilePath:function(e,t=!0){if(!e)return e;const a="/";let n="";return e.startsWith(a)?(n=a,e=e.replaceAll("\\",a).replaceAll("//","/")):(n="\\",e=(e=e.replaceAll(a,"\\").replaceAll("\\\\","\\"))[0].toUpperCase()+e.slice(1)),t&&!e.endsWith(n)&&(e+=n),e},hasDownloadsPermission:function(){return e.chrome&&e.chrome.downloads}}}])}(),function(){"use strict";angular.module("ariaNg").factory("ariaNgKeyboardService",["$window",function(e){var t="";e.navigator&&e.navigator.userAgentData&&e.navigator.userAgentData.platform?t=e.navigator.userAgentData.platform:e.navigator&&e.navigator.platform&&(t=e.navigator.platform);var a=/(Mac|iPhone|iPod|iPad)/i.test(t),n=function(e){return a?e.metaKey:e.ctrlKey},i=function(e){return e.keyCode||e.which||e.charCode};return{isMacKeyboardLike:function(){return a},isModifierKeyPressed:function(e){return n(e)},isCtrlAPressed:function(e){return n(e)&&("KeyA"===e.code||65===i(e))},isCtrlFPressed:function(e){return n(e)&&("KeyF"===e.code||70===i(e))},isCtrlEnterPressed:function(e){return n(e)&&("Enter"===e.code||13===i(e))},isBackspacePressed:function(e){return"Backspace"===e.code||8===i(e)},isDeletePressed:function(e){return"Delete"===e.code||46===i(e)}}}])}(),function(){"use strict";angular.module("ariaNg").factory("ariaNgNotificationService",["$window","Notification","ariaNgConstants","ariaNgCommonService","ariaNgStorageService","ariaNgLocalizationService","ariaNgLogService","ariaNgSettingService",function(e,t,a,n,i,s,o,r){var l=!!e.Notification,c=function(e){return"granted"===e},d=function(){return e.Notification?e.Notification.permission:null},u=function(){if(r.getBrowserNotificationFrequency()&&"unlimited"!==r.getBrowserNotificationFrequency()){var e=i.get(a.browserNotificationHistoryStorageKey)||[];angular.isArray(e)||(e=[]),e.push({time:n.getCurrentUnixTime()}),e.length>10&&e.splice(0,e.length-10),i.set(a.browserNotificationHistoryStorageKey,e)}},p=function(t,s){e.Notification&&c(d())&&(function(){if(!r.getBrowserNotificationFrequency()||"unlimited"===r.getBrowserNotificationFrequency())return!1;var e=i.get(a.browserNotificationHistoryStorageKey)||[];if(!angular.isArray(e))return!1;if(e.length<1)return!1;var t=null,s=!1;if("high"===r.getBrowserNotificationFrequency()){if(e.length<10)return!1;t=e[e.length-10].time,s=n.isUnixTimeAfter(t,"-1","minute")}else"middle"===r.getBrowserNotificationFrequency()?(t=e[e.length-1].time,s=n.isUnixTimeAfter(t,"-1","minute")):"low"===r.getBrowserNotificationFrequency()&&(t=e[e.length-1].time,s=n.isUnixTimeAfter(t,"-5","minute"));return s&&o.debug("[ariaNgNotificationService.isReachBrowserNotificationFrequencyLimit] reach frequency limit"+(t?", the oldest time is "+t:"")),s}()||(chrome?.runtime?.id?(s={type:"basic",iconUrl:"tileicon.png",title:t,silent:s.silent??!1,message:s.body},u(),chrome.notifications.create(s)):(s=angular.extend({icon:"tileicon.png"},s),u(),new e.Notification(t,s))))};return{isSupportBrowserNotification:function(){return l},hasBrowserPermission:function(){return!!l&&c(d())},requestBrowserPermission:function(t){l&&function(t){e.Notification&&e.Notification.requestPermission((function(e){t&&t({granted:c(e),permission:e})}))}((function(e){e.granted||r.setBrowserNotification(!1),t&&t(e)}))},notifyViaBrowser:function(e,t,a){return a||(a={}),e&&(e=s.getLocalizedText(e,a.titleParams)),t&&(t=s.getLocalizedText(t,a.contentParams)),function(e,t,a){a||(a={}),a.body=t,r.getBrowserNotificationSound()||(a.silent=!0),l&&r.getBrowserNotification()&&p(e,a)}(e,t,a)},notifyTaskComplete:function(e){this.notifyViaBrowser("Download Completed",e&&e.taskName?e.taskName:"")},notifyBtTaskComplete:function(e){this.notifyViaBrowser("BT Download Completed",e&&e.taskName?e.taskName:"")},notifyTaskError:function(e){this.notifyViaBrowser("Download Error",e&&e.taskName?e.taskName:"")},notifyInPage:function(e,a,n){return n||(n={}),e&&(e=s.getLocalizedText(e,n.titleParams)),a&&(a=s.getLocalizedText(a,n.contentParams),n.contentPrefix&&(a=n.contentPrefix+a)),function(e,a,n){return n||(n={}),a?(n.title=e,n.message=a):n.message=e,n.type&&t[n.type]||(n.type="primary"),n.positionY||(n.positionY="top"),t[n.type](n)}(e,a,n)},clearNotificationInPage:function(){t.clearAll()}}}])}(),function(){"use strict";angular.module("ariaNg").factory("ariaNgLocalizationService",["$translate","amMoment",function(e,t){return{applyLanguage:function(a){return e.use(a),t.changeLocale(a),!0},getLocalizedText:function(t,a){return e.instant(t,a)},getLongDateFormat:function(){return this.getLocalizedText("format.longdate")}}}])}(),function(){"use strict";angular.module("ariaNg").factory("ariaNgLogService",["$log","ariaNgConstants",function(e,t){var a={DEBUG:1,INFO:2,WARN:3,ERROR:4},n=0,i=!1,s=[],o=function(e,a,o){i&&(s.length>=t.cachedDebugLogsLimit&&s.shift(),s.push(function(e,t,a){return{id:++n,time:new Date,level:t,content:e,attachment:a}}(e,a,o)))};return{setEnableDebugLog:function(e){i=e},compareLogLevel:function(e,t){var n=a[e],i=a[t];return n||(n=0),i||(i=0),n>i?1:n<i?-1:0},debug:function(t,a){i&&(a?e.debug("[AriaNg Debug]"+t,a):e.debug("[AriaNg Debug]"+t),o(t,"DEBUG",a))},info:function(t,a){a?e.info("[AriaNg Info]"+t,a):e.info("[AriaNg Info]"+t),o(t,"INFO",a)},warn:function(t,a){a?e.warn("[AriaNg Warn]"+t,a):e.warn("[AriaNg Warn]"+t),o(t,"WARN",a)},error:function(t,a){a?e.error("[AriaNg Error]"+t,a):e.error("[AriaNg Error]"+t),o(t,"ERROR",a)},getDebugLogs:function(){return i?s:[]},clearDebugLogs:function(){n=0,s.length=0}}}])}(),function(){"use strict";angular.module("ariaNg").factory("ariaNgStorageService",["$window","localStorageService",function(e,t){return{isLocalStorageSupported:function(){return t.isSupported},isCookiesSupported:function(){return t.cookie.isSupported},get:function(e){return t.get(e)},set:function(e,a){return t.set(e,a)},remove:function(e){return t.remove(e)},clearAll:function(){return t.clearAll()},keys:function(e){var a=t.keys();if(!a||!a.length||!e)return a;for(var n=[],i=0;i<a.length;i++)a[i].indexOf(e)>=0&&n.push(a[i]);return n}}}])}(),function(){"use strict";angular.module("ariaNg").factory("ariaNgFileService",["$window",function(e){var t=!!e.FileReader,a=!!e.Blob;return{isSupportFileReader:function(){return t},isSupportBlob:function(){return a},openFileContent:function(e,a,n,i){t?(e=angular.extend({scope:null,fileFilter:null,fileType:"binary",successCallback:a,errorCallback:n},e),i&&i.change||(i=angular.element('<input type="file" style="display: none"/>')),i.data("options",e),e.fileFilter&&i.attr("accept",e.fileFilter),i.val(""),"true"!==i.attr("data-ariang-file-initialized")&&i.change((function(){if(this.files&&!(this.files.length<1)){var e=i.data("options"),t=function(e){var t=[];if(!e||e.length<1)return t.push(/.+$/),t;for(var a=e.split(","),n=0;n<a.length;n++){var i=a[n];"*.*"!==i?(i=i.replace(".","\\."),i+="$",t.push(new RegExp(i))):t.push(/.+$/)}return t}(e.fileFilter),a=this.files[0],n=a.name;if(function(e,t){if(!t||t.length<1)return!0;for(var a=0;a<t.length;a++)if(t[a].test(e))return!0;return!1}(n,t)){var s=new FileReader;if(s.onload=function(){var t={fileName:n};if("text"===e.fileType)t.content=this.result;else t.base64Content=this.result.replace(/.*?base64,/,"");e.successCallback&&(e.scope?e.scope.$apply((function(){e.successCallback(t)})):e.successCallback(t))},s.onerror=function(){e.errorCallback&&(e.scope?e.scope.$apply((function(){e.errorCallback("Failed to load file!")})):e.errorCallback("Failed to load file!"))},"text"===e.fileType)s.readAsText(a);else s.readAsDataURL(a)}else e.errorCallback&&(e.scope?e.scope.$apply((function(){e.errorCallback("The selected file type is invalid!")})):e.errorCallback("The selected file type is invalid!"))}})).attr("data-ariang-file-initialized","true"),i.trigger("click")):n&&n("Your browser does not support loading file!")},saveFileContent:function(e,t,n){if(a){n=angular.extend({fileName:null,contentType:"application/octet-stream",autoTrigger:!1,autoRevoke:!1},n);var i=new Blob([e],{type:n.contentType}),s=URL.createObjectURL(i);t||(t=angular.element('<a style="display: none"/>')),t.attr("href",s),n.fileName&&t.attr("download",n.fileName),n.autoTrigger&&t.trigger("click"),n.autoRevoke&&URL.revokeObjectURL(s)}}}}])}(),function(){"use strict";angular.module("ariaNg").factory("ariaNgSettingService",["$window","$location","$filter","ariaNgConstants","ariaNgDefaultOptions","ariaNgLanguages","ariaNgCommonService","ariaNgLogService","ariaNgStorageService",function(e,t,a,n,i,s,o,r,l){var c={localStorage:l.isLocalStorageSupported(),cookies:l.isCookiesSupported()},d=c.localStorage||c.cookies,u=!!e.matchMedia&&e.matchMedia("(prefers-color-scheme: dark)")&&"not all"!==e.matchMedia("(prefers-color-scheme: dark)").media&&angular.isFunction(e.matchMedia("(prefers-color-scheme: dark)").addEventListener),p=[],g=!1,f={debugMode:!1},m=function(){return"https"===t.protocol()},h=function(e){for(var t in s)if(s.hasOwnProperty(t)){if(t.toLowerCase()===e.toLowerCase())return t;var a=s[t].aliases;if(angular.isArray(a)&&!(a.length<1))for(var n=0;n<a.length;n++)if(a[n].toLowerCase()===e.toLowerCase())return t}return null},v=function(){var t=e.navigator.browserLanguage?e.navigator.browserLanguage:e.navigator.language;if(!t)return r.info("[ariaNgSettingService] cannot get browser language, use default language"),i.language;(t=t.replace(/\-/g,"_"),s[t])||(a=h(t))&&(t=a);if(!s[t]&&t.split("-").length>1){var a,n=t.split("-");if(t=n[0]+"-"+n[1],!s[t])(a=h(t))&&(t=a)}return s[t]?(r.info('[ariaNgSettingService] use browser language "'+t+'" as current language'),t):(r.info('[ariaNgSettingService] browser language "'+t+'" not support, use default language'),i.language)},b=function(e){return l.set(n.optionStorageKey,e)},y=function(){var e,t=l.get(n.optionStorageKey);if(t&&!s[t.language]&&(t.language=(e=t.language,h(e)||v())),!t){if((t=angular.extend({},i)).language=v(),t.rpcHost||S(t),angular.isArray(t.extendRpcServers))for(var a=0;a<t.extendRpcServers.length;a++){var o=t.extendRpcServers[a];o.rpcHost||S(o)}b(t),function(){if(d&&!(g||!angular.isArray(p)||p.length<1)){for(var e=0;e<p.length;e++)(0,p[e])();g=!0}}()}return t},k=function(e){var t=y();return angular.isUndefined(t[e])&&angular.isDefined(i[e])&&(t[e]=i[e],b(t)),t[e]},w=function(e,t){var a=y();a[e]=t,b(a)},S=function(e){e.rpcHost=n.defaultHost,m()&&(e.protocol=n.defaultSecureProtocol)},x=function(e){return{rpcAlias:e.rpcAlias,rpcHost:e.rpcHost,rpcPort:e.rpcPort,rpcInterface:e.rpcInterface,protocol:e.protocol,httpMethod:e.httpMethod,rpcRequestHeaders:e.rpcRequestHeaders,secret:e.secret,rpcOptions:e.rpcOptions}},T=function(){var e=x(i);return e.rpcId=o.generateUniqueId(),S(e),e};return{isBrowserSupportStorage:function(){return d},isBrowserSupportDarkMode:function(){return u},getBrowserFeatures:function(){return c},getAllOptions:function(){var e=angular.extend({},i,y());if(e.secret&&(e.secret=o.base64Decode(e.secret)),angular.isArray(e.extendRpcServers))for(var t=0;t<e.extendRpcServers.length;t++){var a=e.extendRpcServers[t];a.secret&&(a.secret=o.base64Decode(a.secret))}return e},getAllRpcSettings:function(){var e=[],t=this.getAllOptions(),a=x(t);if(a.isDefault=!0,e.push(a),angular.isArray(t.extendRpcServers))for(var n=0;n<t.extendRpcServers.length;n++){var i=x(t.extendRpcServers[n]);i.rpcId=t.extendRpcServers[n].rpcId,i.isDefault=!1,e.push(i)}var s=this.getRPCListDisplayOrder();return"recentlyUsed"===s||"rpcAlias"===s&&e.sort((function(e,t){return String.naturalCompare(e.rpcAlias,t.rpcAlias)})),e},importAllOptions:function(e){var t=angular.copy(i);for(var a in e)e.hasOwnProperty(a)&&t.hasOwnProperty(a)&&(angular.isArray(e[a])||(t[a]=e[a]));if(angular.isArray(e.extendRpcServers))for(var n=0;n<e.extendRpcServers.length;n++){var s=e.extendRpcServers[n],o=T();for(var a in s)s.hasOwnProperty(a)&&o.hasOwnProperty(a)&&(angular.isArray(s[a])||(o[a]=s[a]));t.extendRpcServers.push(o)}b(t)},exportAllOptions:function(){return angular.extend({},i,y())},getAllSessionOptions:function(){return angular.copy(f)},isInsecureProtocolDisabled:function(){return m()},getLanguage:function(){return k("language")},setLanguage:function(e){return!!s[e]&&(w("language",e),!0)},getTheme:function(){return k("theme")},setTheme:function(e){return w("theme",e),!0},isEnableDebugMode:function(){return f.debugMode},setDebugMode:function(e){f.debugMode=e,r.setEnableDebugLog(e)},getTitle:function(){return k("title")},setTitle:function(e){w("title",e)},getBrowserNotification:function(){return k("browserNotification")},setBrowserNotification:function(e){w("browserNotification",e)},getBrowserNotificationSound:function(){return k("browserNotificationSound")},setBrowserNotificationSound:function(e){w("browserNotificationSound",e)},getBrowserNotificationFrequency:function(){return k("browserNotificationFrequency")},setBrowserNotificationFrequency:function(e){w("browserNotificationFrequency",e)},getWebSocketReconnectInterval:function(){return k("webSocketReconnectInterval")},setWebSocketReconnectInterval:function(e){w("webSocketReconnectInterval",e)},getTitleRefreshInterval:function(){return k("titleRefreshInterval")},setTitleRefreshInterval:function(e){w("titleRefreshInterval",Math.max(parseInt(e),0))},getGlobalStatRefreshInterval:function(){return k("globalStatRefreshInterval")},setGlobalStatRefreshInterval:function(e){w("globalStatRefreshInterval",Math.max(parseInt(e),0))},getDownloadTaskRefreshInterval:function(){return k("downloadTaskRefreshInterval")},setDownloadTaskRefreshInterval:function(e){w("downloadTaskRefreshInterval",Math.max(parseInt(e),0))},getKeyboardShortcuts:function(){return k("keyboardShortcuts")},setKeyboardShortcuts:function(e){w("keyboardShortcuts",e)},getSwipeGesture:function(){return k("swipeGesture")},setSwipeGesture:function(e){w("swipeGesture",e)},getDragAndDropTasks:function(){return k("dragAndDropTasks")},setDragAndDropTasks:function(e){w("dragAndDropTasks",e)},getRPCListDisplayOrder:function(){return k("rpcListDisplayOrder")},setRPCListDisplayOrder:function(e){w("rpcListDisplayOrder",e)},getDefaultTaskPage:function(){return k("defaultTaskPage")},setDefaultTaskPage:function(e){w("defaultTaskPage",e)},getAfterCreatingNewTask:function(){return k("afterCreatingNewTask")},setAfterCreatingNewTask:function(e){w("afterCreatingNewTask",e)},getRemoveOldTaskAfterRetrying:function(){return k("removeOldTaskAfterRetrying")},setRemoveOldTaskAfterRetrying:function(e){w("removeOldTaskAfterRetrying",e)},getConfirmTaskRemoval:function(){return k("confirmTaskRemoval")},setConfirmTaskRemoval:function(e){w("confirmTaskRemoval",e)},getIncludePrefixWhenCopyingFromTaskDetails:function(){return k("includePrefixWhenCopyingFromTaskDetails")},setIncludePrefixWhenCopyingFromTaskDetails:function(e){w("includePrefixWhenCopyingFromTaskDetails",e)},getShowPiecesInfoInTaskDetailPage:function(){return k("showPiecesInfoInTaskDetailPage")},setShowPiecesInfoInTaskDetailPage:function(e){w("showPiecesInfoInTaskDetailPage",e)},getAfterRetryingTask:function(){return k("afterRetryingTask")},setAfterRetryingTask:function(e){w("afterRetryingTask",e)},getCurrentRpcDisplayName:function(){var e=y();return e.rpcAlias?e.rpcAlias:e.rpcHost+":"+e.rpcPort},getCurrentRpcUrl:function(){var e=y();return e.protocol+"://"+e.rpcHost+":"+e.rpcPort+"/"+e.rpcInterface},getCurrentRpcHttpMethod:function(){return k("httpMethod")},getCurrentRpcRequestHeaders:function(){return k("rpcRequestHeaders")},isCurrentRpcLocalhost:function(){var e=k("rpcHost");return/^(localhost|127\.0\.0\.1|\[::1\])$/i.test(e)},isCurrentRpcUseWebSocket:function(e){e||(e=y().protocol);return"ws"===e||"wss"===e},getCurrentRpcSecret:function(){var e=k("secret");return e?o.base64Decode(e):e},addNewRpcSetting:function(){var e=y();angular.isArray(e.extendRpcServers)||(e.extendRpcServers=[]);var t=T();return e.extendRpcServers.push(t),b(e),t},updateRpcSetting:function(e,t){if(!e)return e;var a=x(e);if(angular.isUndefined(a[t]))return e;var n=a[t];if("rpcPort"===t?n=Math.max(parseInt(n),0):"secret"===t&&n&&(n=o.base64Encode(n)),e.isDefault)return w(t,n),e;var i=y();if(!angular.isArray(i.extendRpcServers))return e;for(var s=0;s<i.extendRpcServers.length;s++)if(i.extendRpcServers[s].rpcId===e.rpcId){i.extendRpcServers[s][t]=n;break}return b(i),e},removeRpcSetting:function(e){var t=y();if(!angular.isArray(t.extendRpcServers))return e;for(var a=0;a<t.extendRpcServers.length;a++)if(t.extendRpcServers[a].rpcId===e.rpcId){t.extendRpcServers.splice(a,1);break}return b(t),e},setDefaultRpcSetting:function(e,t){t=angular.extend({keepCurrent:!0,forceSet:!1},t);var a=y(),n=x(a);n.rpcId=o.generateUniqueId(),angular.isArray(a.extendRpcServers)||(a.extendRpcServers=[]);for(var i=null,s=0;s<a.extendRpcServers.length;s++)if(a.extendRpcServers[s].rpcId===e.rpcId){i=x(a.extendRpcServers[s]),a.extendRpcServers.splice(s,1);break}return t.forceSet&&(i=x(e)).secret&&(i.secret=o.base64Encode(i.secret)),i&&(t.keepCurrent&&a.extendRpcServers.splice(0,0,n),a=angular.extend(a,i)),b(a),e},isRpcSettingEqualsDefault:function(e){if(!e)return!1;var t=this.getAllOptions();return t.rpcHost===e.rpcHost&&(t.rpcPort===e.rpcPort&&(t.rpcInterface===e.rpcInterface&&(t.protocol===e.protocol&&(t.httpMethod===e.httpMethod&&(t.rpcRequestHeaders===e.rpcRequestHeaders&&t.secret===e.secret)))))},getTaskListIndependentDisplayOrder:function(){return k("taskListIndependentDisplayOrder")},setTaskListIndependentDisplayOrder:function(e){w("taskListIndependentDisplayOrder",e)},getTaskListDisplayOrderKey:function(e){var t="displayOrder";return this.getTaskListIndependentDisplayOrder()&&("waiting"===e?t="waitingTaskListPageDisplayOrder":"stopped"===e?t="stoppedTaskListPageDisplayOrder":"downloading"===e&&(t="downloadingTaskListPageDisplayOrder")),t},getDisplayOrder:function(e){var t=this.getTaskListDisplayOrderKey(e),a=k(t);return a||(a="default:asc"),a},setDisplayOrder:function(e,t){var a=this.getTaskListDisplayOrderKey(t);w(a,e)},getFileListDisplayOrder:function(){var e=k("fileListDisplayOrder");return e||(e="default:asc"),e},setFileListDisplayOrder:function(e){w("fileListDisplayOrder",e)},getPeerListDisplayOrder:function(){var e=k("peerListDisplayOrder");return e||(e="default:asc"),e},setPeerListDisplayOrder:function(e){w("peerListDisplayOrder",e)},getRecCount:function(){return k("recCount")},setRecCount:function(e){w("recCount",e)},getRpcOptions:function(){return k("rpcOptions")},setRpcOption:function(e,t){const a=k("rpcOptions");t?a[e]=t:delete a[e],w("rpcOptions",a);const n=y();chrome.storage?.local.set({ariaNgOptions:n})},getCompactMode:function(){return k("compactMode")},setCompactMode:function(e){w("compactMode",e)},resetRpcOptions:function(){w("rpcOptions",{});const e=y();chrome.storage?.local.set({ariaNgOptions:e})},resetSettings:function(){l.clearAll()},onFirstAccess:function(e){e&&p.push(e)}}}])}(),function(){"use strict";angular.module("ariaNg").factory("ariaNgMonitorService",["$filter","ariaNgConstants","ariaNgCommonService","ariaNgLocalizationService",function(e,t,a,n){var i={},s={},o="global",r=function(e){return e===o?t.globalStatStorageCapacity:t.taskStatStorageCapacity},l=function(t){for(var i={legend:{show:!1},grid:{x:50,y:10,x2:10,y2:10},tooltip:{show:!0,formatter:function(t){if(""===t[0].name)return"<div>"+n.getLocalizedText("No Data")+"</div>";var i=a.getLongTimeFromUnixTime(t[0].name),s=e("readableVolume")(t[0].value)+"/s";return'<div><i class="fa fa-clock-o"></i> '+i+'</div><div><i class="icon-download fa fa-arrow-down"></i> '+(e("readableVolume")(t[1].value)+"/s")+'</div><div><i class="icon-upload fa fa-arrow-up"></i> '+s+"</div>"}},xAxis:{data:[],type:"category",boundaryGap:!1,axisLabel:{show:!1}},yAxis:{type:"value",axisLabel:{formatter:function(t){return e("readableVolume")(t,"auto")}}},series:[{type:"line",areaStyle:{normal:{opacity:.1}},smooth:!0,symbolSize:6,showAllSymbol:!1,data:[]},{type:"line",areaStyle:{normal:{opacity:.1}},smooth:!0,symbolSize:6,showAllSymbol:!1,data:[]}]},o=i.xAxis.data,l=i.series[0].data,c=i.series[1].data,d=0;d<r(t);d++)o.push(""),l.push(""),c.push("");return s[t]=i,i},c=function(e){return angular.isDefined(s[e])};return{recordStat:function(e,t){c(e)||l(e),t.time=a.getCurrentUnixTime(),function(e,t){var a=s[e],n=a.xAxis.data,i=a.series[0].data,o=a.series[1].data;n.length>=r(e)&&(n.shift(),i.shift(),o.shift()),n.push(t.time),i.push(t.uploadSpeed),o.push(t.downloadSpeed)}(e,t)},getStatsData:function(e){return c(e)||l(e),function(e){return s[e]}(e)},getEmptyStatsData:function(e){return c(e)&&function(e){delete s[e]}(e),this.getStatsData(e)},recordGlobalStat:function(e){this.recordStat(o,e),i=e},getGlobalStatsData:function(){return this.getStatsData(o)},getCurrentGlobalStat:function(){return i}}}])}(),function(){"use strict";angular.module("ariaNg").factory("ariaNgTitleService",["$filter","ariaNgConstants","ariaNgLocalizationService","ariaNgSettingService",function(e,t,a,n){var i=function(e){if(!e)return{};for(var t=e.substring(2,e.length-1).split(":"),a={oldValue:e},n=1;n<t.length;n++){var i=t[n].split("=");1===i.length?a[i[0]]=!0:2===i.length&&(a[i[0]]=i[1])}return a},s=function(t,a){var n=a.value;return"volume"===a.type&&(n=e("readableVolume")(n,a.scale)),a.prefix&&!a.noprefix&&(n=a.prefix+n),a.suffix&&!a.nosuffix&&(n+=a.suffix),t.replace(a.oldValue,n)},o=function(e,t,a){var n=new RegExp("\\$\\{"+t+"(:[a-zA-Z0-9]+(=[a-zA-Z0-9]+)?)*\\}","g"),o=e.match(n);if(o&&o.length>0)for(var r=0;r<o.length;r++){var l=i(o[r]);angular.extend(l,a),e=s(e,l)}return e};return{getFinalTitle:function(e){var i=n.getTitle();return i?i=function(e){return o(e,"title",{value:t.title})}(i=function(e,t){return o(e,"upspeed",{prefix:a.getLocalizedText("Upload")+": ",value:t,type:"volume",suffix:"/s"})}(i=function(e,t){return o(e,"downspeed",{prefix:a.getLocalizedText("Download")+": ",value:t,type:"volume",suffix:"/s"})}(i=function(e,t){return o(e,"stopped",{prefix:a.getLocalizedText("Finished / Stopped")+": ",value:t})}(i=function(e,t){return o(e,"waiting",{prefix:a.getLocalizedText("Waiting")+": ",value:t})}(i=function(e,t){return o(e,"downloading",{prefix:a.getLocalizedText("Downloading")+": ",value:t})}(i=function(e,t){return o(e,"rpcprofile",{value:t})}(i,(e=angular.extend({downloadingCount:0,waitingCount:0,stoppedCount:0,downloadSpeed:0,uploadSpeed:0},e)).currentRPCAlias),e.downloadingCount),e.waitingCount),e.stoppedCount),e.downloadSpeed),e.uploadSpeed)):t.title},getFinalTitleByGlobalStat:function(e){var t={currentRPCAlias:e&&e.currentRpcProfile?e.currentRpcProfile.rpcAlias||e.currentRpcProfile.rpcHost+":"+e.currentRpcProfile.rpcPort:"",downloadingCount:e&&e.globalStat?e.globalStat.numActive:0,waitingCount:e&&e.globalStat?e.globalStat.numWaiting:0,stoppedCount:e&&e.globalStat?e.globalStat.numStopped:0,downloadSpeed:e&&e.globalStat?e.globalStat.downloadSpeed:0,uploadSpeed:e&&e.globalStat?e.globalStat.uploadSpeed:0};return this.getFinalTitle(t)}}}])}(),function(){"use strict";angular.module("ariaNg").factory("ariaNgVersionService",["ariaNgBuildConfiguration",function(e){return{getBuildVersion:function(){return e.buildVersion},getBuildCommit:function(){return e.buildCommit}}}])}(),function(){"use strict";angular.module("ariaNg").factory("aria2HttpRpcService",["$http","ariaNgConstants","ariaNgCommonService","ariaNgSettingService","ariaNgLogService",function(e,t,a,n,i){var s=n.getCurrentRpcUrl(),o=n.getCurrentRpcHttpMethod(),r=n.getCurrentRpcRequestHeaders();return{request:function(n){if(n){var l={url:s,method:o,headers:{},timeout:t.httpRequestTimeout};if("POST"===l.method?(l.data=angular.toJson(n.requestBody),l.headers["Content-Type"]="application/json"):"GET"===l.method&&(l.url=function(e,t){if(!e||e.length<1)return e;var n="";for(var i in t)if(t.hasOwnProperty(i)){var s=t[i];null===s||angular.isUndefined(s)||(n.length>0&&(n+="&"),(angular.isObject(s)||angular.isArray(s))&&(s=angular.toJson(s),s=a.base64Encode(s),s=encodeURIComponent(s)),n+=i+"="+s)}return n.length<1?e:(n=e.indexOf("?")<0?"?"+n:"&"+n,e+n)}(l.url,n.requestBody)),r)for(var c=r.split("\n"),d=0;d<c.length;d++){var u=c[d].split(":");if(2===u.length){var p=u[0].trim(),g=u[1].trim();l.headers[p]=g}}return i.debug("[aria2HttpRpcService.request] "+(n&&n.requestBody&&n.requestBody.method?n.requestBody.method+" ":"")+"request start",l),e(l).then((function(e){var t=e.data;i.debug("[aria2HttpRpcService.request] "+(n&&n.requestBody&&n.requestBody.method?n.requestBody.method+" ":"")+"response success",e),t&&(n.connectionSuccessCallback&&n.connectionSuccessCallback({rpcUrl:s,method:o}),n.successCallback&&n.successCallback(t.id,t.result))})).catch((function(e){var t=e.data;i.debug("[aria2HttpRpcService.request] "+(n&&n.requestBody&&n.requestBody.method?n.requestBody.method+" ":"")+"response error",e),t||(t={id:"-1",error:{message:"Cannot connect to aria2!"}},n.connectionFailedCallback&&n.connectionFailedCallback({rpcUrl:s,method:o})),n.errorCallback&&n.errorCallback(t.id,t.error)}))}},reconnect:function(){},on:function(e,t){}}}])}(),function(){"use strict";angular.module("ariaNg").factory("aria2WebSocketRpcService",["$q","$websocket","$timeout","ariaNgConstants","ariaNgSettingService","ariaNgLogService",function(e,t,a,n,i,s){var o=i.getCurrentRpcUrl(),r=null,l=null,c={},d={},u=function(e){if(null===r)try{(r=t(o,{maxTimeout:1,reconnectInterval:i.getWebSocketReconnectInterval()})).onMessage((function(e){if(e&&e.data){var t=angular.fromJson(e.data);t&&(t.id?function(e){var t=e.id;if(t){var a=c[t];if(a){var n=a.context;a.deferred.resolve({success:!0,context:n}),e.result&&n.connectionSuccessCallback&&n.connectionSuccessCallback({rpcUrl:o}),e.result&&n.successCallback&&(s.debug("[aria2WebSocketRpcService.processMethodCallback] "+(n&&n.requestBody&&n.requestBody.method?n.requestBody.method+" ":"")+"response success",e),n.successCallback(n.id,e.result)),e.error&&n.errorCallback&&(s.debug("[aria2WebSocketRpcService.processMethodCallback] "+(n&&n.requestBody&&n.requestBody.method?n.requestBody.method+" ":"")+"response error",e),n.errorCallback(n.id,e.error)),delete c[t]}}}(t):t.method&&function(e){var t=e.method;if(t){var a=d[t];if(angular.isArray(a)&&!(a.length<1))for(var n=0;n<a.length;n++)(0,a[n])(angular.isArray(e.params)&&e.params.length>0?e.params[0]:null)}}(t))}else e.request&&function(e){var t=angular.fromJson(e);if(t){var a=t.id;if(a){var n=c[a];if(n){var i=n.context;n.deferred.reject({success:!1,context:i}),i.errorCallback&&(s.debug("[aria2WebSocketRpcService.processRequestFailed] "+(i&&i.requestBody&&i.requestBody.method?i.requestBody.method+" ":"")+"request failed"),i.errorCallback(i.id,{message:"Cannot connect to aria2!"})),delete c[a]}}}}(e.request)})),r.onOpen((function(t){s.debug("[aria2WebSocketRpcService.onOpen] websocket is opened",t),e&&e.connectionSuccessCallback&&e.connectionSuccessCallback({rpcUrl:o})})),r.onClose((function(t){for(var a in s.warn("[aria2WebSocketRpcService.onClose] websocket is closed",t),c)if(c.hasOwnProperty(a)){var n=c[a];n?(n.deferred.reject({success:!1,context:n.context}),s.debug("[aria2WebSocketRpcService.socketClient.onClose] reject old request",n.context),n.context.errorCallback(n.context.id,{message:"Cannot connect to aria2!"}),delete c[a]):delete c[a]}var r=i.getWebSocketReconnectInterval()>0;r&&g(e),r&&e&&e.connectionWaitingToReconnectCallback?e.connectionWaitingToReconnectCallback({rpcUrl:o}):e&&e.connectionFailedCallback&&e.connectionFailedCallback({rpcUrl:o})}))}catch(e){return{success:!1,error:"Cannot initialize WebSocket!",exception:e}}return{success:!0,instance:r}},p=function(e){e&&r&&(e.connectionReconnectingCallback&&e.connectionReconnectingCallback({rpcUrl:o}),r.reconnect())},g=function(e){l?s.warn("[aria2WebSocketRpcService.planToReconnect] another reconnection is pending"):(l=a((function(){return null==r?(s.warn("[aria2WebSocketRpcService.planToReconnect] websocket is null"),void(l=null)):0===r.readyState||1===r.readyState?(s.warn("[aria2WebSocketRpcService.planToReconnect] websocket current state is already "+r.readyState),void(l=null)):(p(e),void(l=null))}),i.getWebSocketReconnectInterval()),s.debug("[aria2WebSocketRpcService.planToReconnect] next reconnection is pending in "+i.getWebSocketReconnectInterval()+"ms"))};return{request:function(t){if(t){var a=u({connectionSuccessCallback:t.connectionSuccessCallback,connectionFailedCallback:t.connectionFailedCallback,connectionReconnectingCallback:t.connectionReconnectingCallback,connectionWaitingToReconnectCallback:t.connectionWaitingToReconnectCallback}),n=t.uniqueId,i=angular.toJson(t.requestBody);s.debug("[aria2WebSocketRpcService.request] "+(t&&t.requestBody&&t.requestBody.method?t.requestBody.method+" ":"")+"request start",t);var o=e.defer();return a.instance?(c[n]={context:t,deferred:o},a.instance.send(i)):(o.reject({success:!1,context:t}),s.debug("[aria2WebSocketRpcService.request] client error",a),t.errorCallback(t.id,{message:a.error})),o.promise}},reconnect:function(e){p(e)},on:function(e,t){var a=d[e];angular.isArray(a)||(a=d[e]=[]),a.push(t)}}}])}(),function(){"use strict";angular.module("ariaNg").factory("aria2RpcService",["$location","$q","aria2RpcConstants","aria2RpcErrors","aria2AllOptions","ariaNgCommonService","ariaNgLogService","ariaNgSettingService","ariaNgNotificationService","aria2HttpRpcService","aria2WebSocketRpcService",function(e,t,a,n,i,s,o,r,l,c,d){var u=r.isCurrentRpcUseWebSocket()?d:c,p=!1,g=r.getCurrentRpcSecret(),f=[],m=[],h=[],v=[],b=[],y=[],k=[],w=[],S=[],x=[],T=[],C=[],P=[],R=function(e){return 0===e.indexOf(a.rpcSystemServiceName+".")},D=function(e){return a.rpcServiceName+"."+e},A=function(e,t){if(t)return e;var n=s.generateUniqueId(),i={uniqueId:n,requestBody:{jsonrpc:a.rpcServiceVersion,method:e.methodName,id:n,params:e.params},connectionSuccessCallback:e.connectionSuccessCallback,connectionFailedCallback:e.connectionFailedCallback,connectionReconnectingCallback:e.connectionReconnectingCallback,connectionWaitingToReconnectCallback:e.connectionWaitingToReconnectCallback,successCallback:e.successCallback,errorCallback:e.errorCallback};return u.request(i)},O=function(e,t){var a=function(e){return D(e)}(e);u.on(a,(function(e){if(angular.isArray(t)&&!(t.length<1))for(var a=0;a<t.length;a++){(0,t[a])(e)}}))},N=function(e,t){if(angular.isArray(e)&&!(e.length<1))for(var a=0;a<e.length;a++){(0,e[a])(t)}},I=function(e,a,n){for(var i=[],s=!1,o=!1,r=[],l=0;l<a.length;l++)a[l].callback=function(e){r.push(e),s=s||e.success,o=o||!e.success},i.push(e(a[l]));return t.all(i).finally((function(){n&&n({hasSuccess:!!s,hasError:!!o,results:r})}))},L=function(e){if(!e||!e.message)return!1;o.warn("[aria2RpcService.processError] "+e.message,e);let t=null;return t=s.hasDownloadsPermission()?function(e){l.notifyInPage("",e,{type:"error",replaceMessage:!1,delay:3e3})}:s.showError.bind(s),n[e.message]&&n[e.message].tipTextKey?(t(n[e.message].tipTextKey),!0):(t(e.message),!0)},F=function(){var t=arguments[0],n=e.path(),i=R(t),s=[],o={methodName:i?t:D(t),connectionSuccessCallback:function(){N(v)},connectionFailedCallback:function(){N(b)},connectionReconnectingCallback:function(){N(y)},connectionWaitingToReconnectCallback:function(){N(k)}};if(g&&!i&&s.push(a.rpcTokenPrefix+g),arguments.length>1){var l=arguments[1];o.successCallback=function(e,t){if(l.callback&&l.callback({id:e,success:!0,data:t,context:l}),N(m),!p){p=!0;var a={rpcName:r.getCurrentRpcDisplayName()};N(f,a)}},o.errorCallback=function(t,a){var i=!1,s=e.path();l.silent||s!==n||(i=L(a)),l.callback&&l.callback({id:t,success:!1,data:a,errorProcessed:i,context:l}),N(h)}}if(arguments.length>2)for(var c=2;c<arguments.length;c++)null!==arguments[c]&&angular.isDefined(arguments[c])&&s.push(arguments[c]);return s.length>0&&(o.params=s),o},U=function(e,t){var a=angular.copy(e);for(var n in a)a.hasOwnProperty(n)&&M(a,n)&&(a[n]=q(a[n],i[n]));return t&&t.pauseOnAdded&&(a.pause="true"),a},M=function(e,t){return!(!e[t]||!angular.isString(e[t]))&&!(!i[t]||"array"!==i[t].submitFormat)},q=function(e,t){for(var a=e.split(t.separator),n=[],i=0;i<a.length;i++){var s=a[i];s&&(s=s.replace("\r",""),n.push(s))}return n};return O("onDownloadStart",w),O("onDownloadPause",S),O("onDownloadStop",x),O("onDownloadComplete",T),O("onDownloadError",C),O("onBtDownloadComplete",P),{getBasicTaskParams:function(){return["gid","dir","totalLength","completedLength","uploadSpeed","downloadSpeed","connections","numSeeders","seeder","status","errorCode","verifiedLength","verifyIntegrityPending"]},getFullTaskParams:function(){var e=this.getBasicTaskParams();return e.push("files"),e.push("bittorrent"),e.push("infoHash"),e},canReconnect:function(){return r.isCurrentRpcUseWebSocket()},reconnect:function(e){o.info("[aria2RpcService.reconnect] reconnect now"),u.reconnect(F("",e))},addUri:function(e,t){var a=e.task?e.task.urls:null,n=U(e.task?e.task.options:{},e);return A(F("addUri",e,a,n),!!t)},addUriMulti:function(e){for(var t=[],a=0;a<e.tasks.length;a++){var n=e.tasks[a];t.push({silent:!!e.silent,task:n,pauseOnAdded:e.pauseOnAdded})}return I(this.addUri,t,e.callback)},addTorrent:function(e,t){var a=e.task?e.task.content:null,n=U(e.task?e.task.options:{},e);return A(F("addTorrent",e,a,[],n),!!t)},addMetalink:function(e,t){var a=e.task?e.task.content:null,n=U(e.task?e.task.options:{},e);return A(F("addMetalink",e,a,n),!!t)},remove:function(e,t){return A(F("remove",e,e.gid),!!t)},forceRemove:function(e,t){return A(F("forceRemove",e,e.gid),!!t)},forceRemoveMulti:function(e){for(var t=[],a=0;a<e.gids.length;a++)t.push({silent:!!e.silent,gid:e.gids[a]});return I(this.forceRemove,t,e.callback)},pause:function(e,t){return A(F("pause",e,e.gid),!!t)},pauseAll:function(e,t){return A(F("pauseAll",e),!!t)},forcePause:function(e,t){return A(F("forcePause",e,e.gid),!!t)},forcePauseMulti:function(e){for(var t=[],a=0;a<e.gids.length;a++)t.push({silent:!!e.silent,gid:e.gids[a]});return I(this.forcePause,t,e.callback)},forcePauseAll:function(e,t){return A(F("forcePauseAll",e),!!t)},unpause:function(e,t){return A(F("unpause",e,e.gid),!!t)},unpauseMulti:function(e){for(var t=[],a=0;a<e.gids.length;a++)t.push({silent:!!e.silent,gid:e.gids[a]});return I(this.unpause,t,e.callback)},unpauseAll:function(e,t){return A(F("unpauseAll",e),!!t)},tellStatus:function(e,t){return A(F("tellStatus",e,e.gid),!!t)},getUris:function(e,t){return A(F("getUris",e,e.gid),!!t)},getFiles:function(e,t){return A(F("getFiles",e,e.gid),!!t)},getPeers:function(e,t){return A(F("getPeers",e,e.gid),!!t)},getServers:function(e,t){return A(F("getServers",e,e.gid),!!t)},tellActive:function(e,t){return A(F("tellActive",e,angular.isDefined(e.requestParams)?e.requestParams:null),!!t)},tellWaiting:function(e,t){return A(F("tellWaiting",e,angular.isDefined(e.offset)?e.offset:0,angular.isDefined(e.num)?e.num:1e3,angular.isDefined(e.requestParams)?e.requestParams:null),!!t)},tellStopped:function(e,t){return A(F("tellStopped",e,angular.isDefined(e.offset)?e.offset:-1,angular.isDefined(e.num)?e.num:1e3,angular.isDefined(e.requestParams)?e.requestParams:null),!!t)},tellAllTasks:function(e,a){if(a)return e;return function(e,a,n){if(e&&a&&e.length===a.length){for(var i=[],s=!1,o=!1,r=[],l=0;l<e.length;l++)a[l].callback=function(e){r.push(e.data),s=s||e.success,o=o||!e.success},i.push(e[l](a[l]));return t.all(i).finally((function(){n&&n({id:0,success:!o,data:[].concat(...r),context:a[0]})}))}console.warn("aria2RpcService.invokeMultiMethods: invalid params!")}([this.tellActive,this.tellWaiting,this.tellStopped],[e,e,e],e.callback)},changePosition:function(e,t){return A(F("changePosition",e,e.gid,e.pos,e.how),!!t)},changeUri:function(e,t){return A(F("changeUri",e,e.gid,e.fileIndex,e.delUris,e.addUris),!!t)},getOption:function(e,t){return A(F("getOption",e,e.gid),!!t)},changeOption:function(e,t){var a=U(e.options,e);return A(F("changeOption",e,e.gid,a),!!t)},getGlobalOption:function(e,t){return A(F("getGlobalOption",e),!!t)},changeGlobalOption:function(e,t){var a=U(e.options,e);return A(F("changeGlobalOption",e,a),!!t)},getGlobalStat:function(e,t){return A(F("getGlobalStat",e),!!t)},purgeDownloadResult:function(e,t){return A(F("purgeDownloadResult",e),!!t)},removeDownloadResult:function(e,t){return A(F("removeDownloadResult",e,e.gid),!!t)},removeDownloadResultMulti:function(e){for(var t=[],a=0;a<e.gids.length;a++)t.push({silent:!!e.silent,gid:e.gids[a]});return I(this.removeDownloadResult,t,e.callback)},getVersion:function(e,t){return A(F("getVersion",e),!!t)},getSessionInfo:function(e,t){return A(F("getSessionInfo",e),!!t)},shutdown:function(e,t){return A(F("shutdown",e),!!t)},forceShutdown:function(e,t){return A(F("forceShutdown",e),!!t)},saveSession:function(e,t){return A(F("saveSession",e),!!t)},multicall:function(e,t){return A(F("system.multicall",e,e.methods),!!t)},listMethods:function(e,t){return A(F("system.listMethods",e),!!t)},listNotifications:function(e,t){return A(F("system.listNotifications",e),!!t)},onFirstSuccess:function(e){f.push(e.callback)},onOperationSuccess:function(e){m.push(e.callback)},onOperationError:function(e){h.push(e.callback)},onConnectionSuccess:function(e){v.push(e.callback)},onConnectionFailed:function(e){b.push(e.callback)},onConnectionReconnecting:function(e){y.push(e.callback)},onConnectionWaitingToReconnect:function(e){k.push(e.callback)},onDownloadStart:function(e){w.push(e.callback)},onDownloadPause:function(e){S.push(e.callback)},onDownloadStop:function(e){x.push(e.callback)},onDownloadComplete:function(e){T.push(e.callback)},onDownloadError:function(e){C.push(e.callback)},onBtDownloadComplete:function(e){P.push(e.callback)}}}])}(),function(){"use strict";angular.module("ariaNg").factory("aria2TaskService",["$q","bittorrentPeeridService","ariaNgConstants","aria2Errors","aria2RpcService","ariaNgCommonService","ariaNgLocalizationService","ariaNgLogService","ariaNgSettingService",function(e,t,a,n,i,s,o,r,l){var c=function(e){if(!e)return r.warn("[aria2TaskService.getFileName] file is null"),"";var t=e.path,a=!1;!t&&e.uris&&e.uris.length>0&&(t=e.uris[0].uri,a=!0);var n=t.lastIndexOf("/");if(n<=0||n===t.length)return t;var i=t.substring(n+1),s=i.indexOf("?"),o=i;if(s>0&&(o=i.substring(0,s)),a)try{o=decodeURI(o)}catch(e){r.warn("[aria2TaskService.getFileName] failed to url decode file name, original file name: "+o,e)}return o},d=function(e,t){var n=e.dir,i=t.path;n&&(n=n.replace(/\\/g,a.defaultPathSeparator)),i&&(i=i.replace(/\\/g,a.defaultPathSeparator));var s=function(){i.length>1&&i.charAt(0)===a.defaultPathSeparator&&(i=i.substr(1))};if(n&&0===i.indexOf(n)&&(i=i.substr(n.length)),s(),e.bittorrent&&"multi"===e.bittorrent.mode&&e.bittorrent.info&&e.bittorrent.info.name){var o=e.bittorrent.info.name;0===i.indexOf(o)&&(i=i.substr(o.length))}return s(),t.fileName&&i.lastIndexOf(t.fileName)+t.fileName.length===i.length&&(i=i.substr(0,i.length-t.fileName.length)),i.length>1&&i.charAt(i.length-1)===a.defaultPathSeparator&&(i=i.substr(0,i.length-1)),i},u=function(e,t,n){var i=n[e];if(i)return i;var s=null,o=e;if(e.length){var r="",l=e.lastIndexOf(a.defaultPathSeparator);l>0&&(r=e.substring(0,l),o=e.substring(l+1)),s=u(r,t,n)}return i={isDir:!0,nodePath:e,nodeName:o,relativePath:s&&s.nodePath||"",level:s&&s.level+1||0,length:0,selected:!0,partialSelected:!1,files:[],subDirs:[]},t.push(i),n[e]=i,s&&s.subDirs.push(i),i},p=function(e,t,a){if(e&&t&&a){var n=e.relativePath||"",i=u(n,t,a);return i.files.push(e),i}},g=function(e,t,a){if(e){var n=0,i=0,s=0;if(e.subDirs&&e.subDirs.length)for(var o=0;o<e.subDirs.length;o++){var r=e.subDirs[o];a.push(r),g(r,t,a),n+=r.length,i+=r.selected?1:0,s+=r.partialSelected?1:0}if(e.files&&e.files.length)for(o=0;o<e.files.length;o++){var l=e.files[o];a.push(l),n+=l.length,i+=l.selected?1:0}e.length=n,e.selected=i>0&&i===e.subDirs.length+e.files.length,e.partialSelected=i>0&&i<e.subDirs.length+e.files.length||s>0}},f=function(e,t){for(var a=[],n=0;n<t;n++)a.push(!1);if(!e)return a;var i=0;for(n=0;n<e.length;n++)for(var s=parseInt(e[n],16),o=1;o<=4;o++){var r=1<<4-o,l=(s&r)===r;if(a[i++]=l,i>=t)return a}return a},m=function(e,t){if(!e)return r.warn("[aria2TaskService.processDownloadTask] task is null"),e;t=t&&e.bittorrent&&"multi"===e.bittorrent.mode;var a,i,l=f(e.bitfield,e.numPieces);if(e.totalLength=parseInt(e.totalLength),e.completedLength=parseInt(e.completedLength),e.completePercent=e.totalLength>0?e.completedLength/e.totalLength*100:0,e.remainLength=e.totalLength-e.completedLength,e.remainPercent=100-e.completePercent,e.uploadLength=e.uploadLength?parseInt(e.uploadLength):0,e.shareRatio=e.completedLength>0?e.uploadLength/e.completedLength:0,e.uploadSpeed=parseInt(e.uploadSpeed),e.downloadSpeed=parseInt(e.downloadSpeed),e.numPieces=parseInt(e.numPieces),e.completedPieces=s.countArray(l,!0),e.pieceLength=parseInt(e.pieceLength),e.idle=0===e.downloadSpeed,e.remainTime=(a=e.remainLength,0===(i=e.downloadSpeed)?0:a/i),e.seeder=!0===e.seeder||"true"===e.seeder,e.verifiedLength&&e.files){let t=0;e.files.forEach((e=>{t+=e.length})),e.verifiedPercent=t>0?parseInt(e.verifiedLength/t*100):void 0}else e.verifiedPercent=void 0;var u=function(e){var t="",a=!0;return e.bittorrent&&e.bittorrent.info&&(t=e.bittorrent.info.name),!t&&e.files&&e.files.length>0&&(t=c(e.files[0]),e.bittorrent&&t.includes("[METADATA]")&&(t=t.substring(10)+".torrent")),t||(t=o.getLocalizedText("Unknown"),a=!1),{name:t,success:a}}(e);if(e.taskName=u.name,e.hasTaskName=u.success,e.dir=s.formatFilePath(e.dir),e.errorDescription=function(e){return e.errorCode&&n[e.errorCode]&&n[e.errorCode].descriptionKey?n[e.errorCode].hide?"":n[e.errorCode].descriptionKey:""}(e),e.files){for(var m=0,h=[],v={},b=0;b<e.files.length;b++){var y=e.files[b];if(y.index=parseInt(y.index),y.fileName=c(y),y.length=parseInt(y.length),y.selected=!0===y.selected||"true"===y.selected,y.completedLength=parseInt(y.completedLength),y.completePercent=y.length>0?y.completedLength/y.length*100:0,t){y.relativePath=d(e,y);var k=p(y,h,v);y.level=k.level+1}m+=y.selected?1:0}if(t&&h.length>1){var w=[];g(v[""],v,w),e.files=w,e.multiDir=!0}e.selectedFileCount=m}if(e.files&&1===e.files.length&&e.files[0].uris&&e.files[0].uris[0]){var S=!0,x=e.files[0].uris[0].uri;for(b=0;b<e.files[0].uris.length;b++){if(e.files[0].uris[b].uri!==x){S=!1;break}}S&&(e.singleUrl=x)}return r.debug("[aria2TaskService.processDownloadTask] process success",e),e},h=function(e,a,n){if(!e)return r.warn("[aria2TaskService.processBtPeers] peers is null"),e;for(var i=f(a.bitfield,a.numPieces),o=s.countArray(i,!0),l=a.completePercent,c=0;c<e.length;c++){var d=e[c],u=parseInt(d.uploadSpeed),p=parseInt(d.downloadSpeed),g=f(d.bitfield,a.numPieces),m=s.countArray(g,!0);if(d.name=d.ip+":"+d.port,d.completePercent=m/a.numPieces*100,d.downloadSpeed=u,d.uploadSpeed=p,d.seeder=!0===d.seeder||"true"===d.seeder,m===o&&d.completePercent!==l&&(d.completePercent=l),d.peerId){var h=s.decodePercentEncodedString(d.peerId),v=h?t.parseClient(h):null;if(v&&"unknown"!==v.client){var y={name:v.client?v.client.trim():"",version:v.version?v.version.trim():""};y.info=y.name+(y.version?" "+y.version:""),d.client=y}}}return n&&e.push(b(a)),e},v=function(e,t,a){return function(n){var i={type:a,task:null};n&&n.gid?e(n.gid,(function(e){i.task=e.success?e.data:null,t(i)}),!0):t(i)}},b=function(e){return{local:!0,bitfield:e.bitfield,completePercent:e.completePercent,downloadSpeed:e.downloadSpeed,name:"(local)",seeder:e.seeder,uploadSpeed:e.uploadSpeed}};return{getTaskList:function(e,t,a,n){var s=null;if("downloading"===e)s=i.tellActive;else if("waiting"===e)s=i.tellWaiting;else if("stopped"===e)s=i.tellStopped;else{if("all"!==e)return;s=i.tellAllTasks.bind(i)}return s({requestWholeInfo:t,requestParams:t?i.getFullTaskParams():i.getBasicTaskParams(),silent:!!n,callback:function(e){a?a(e):r.warn("[aria2TaskService.getTaskList] callback is null")}})},getTaskStatus:function(e,t,a,n){return i.tellStatus({gid:e,silent:!!a,callback:function(e){t?(e.success&&m(e.data,n),t(e)):r.warn("[aria2TaskService.getTaskStatus] callback is null")}})},getTaskOptions:function(e,t,a){return i.getOption({gid:e,silent:!!a,callback:t})},setTaskOption:function(e,t,a,n,s){var o={};return o[t]=a,i.changeOption({gid:e,options:o,silent:!!s,callback:n})},selectTaskFile:function(e,t,a,n){for(var i="",s=0;s<t.length;s++)i.length>0&&(i+=","),i+=t[s];return this.setTaskOption(e,"select-file",i,a,n)},getBtTaskPeers:function(e,t,a,n){return i.getPeers({gid:e.gid,silent:!!a,callback:function(a){t?(a.success&&h(a.data,e,n),t(a)):r.warn("[aria2TaskService.getBtTaskPeers] callback is null")}})},getTaskStatusAndBtPeers:function(e,t,a,n,s,o){var l=[i.tellStatus({gid:e},!0)];return n&&l.push(i.getPeers({gid:e},!0)),i.multicall({methods:l,silent:!!a,callback:function(e){t?(e.task={},e.success&&e.data.length>0&&(e.task=e.data[0][0],m(e.task,o)),e.success&&e.task.bittorrent&&e.data.length>1&&(e.peers=e.data[1][0],h(e.peers,e.task,s)),t(e)):r.warn("[aria2TaskService.getTaskStatusAndBtPeers] callback is null")}})},newUriTask:function(e,t,a,n){return i.addUri({task:e,pauseOnAdded:!!t,silent:!!n,callback:a})},newUriTasks:function(e,t,a,n){return i.addUriMulti({tasks:e,pauseOnAdded:!!t,silent:!!n,callback:a})},newTorrentTask:function(e,t,a,n){return i.addTorrent({task:e,pauseOnAdded:!!t,silent:!!n,callback:a})},newMetalinkTask:function(e,t,a,n){return i.addMetalink({task:e,pauseOnAdded:!!t,silent:!!n,callback:a})},startTasks:function(e,t,a){return i.unpauseMulti({gids:e,silent:!!a,callback:t})},pauseTasks:function(e,t,a){return i.forcePauseMulti({gids:e,silent:!!a,callback:t})},retryTask:function(t,a,n){var s=e.defer(),o=[i.tellStatus({gid:t},!0),i.getOption({gid:t},!0)],c=null,d=null;return i.multicall({methods:o,silent:!!n,callback:function(e){if(a){if(!e.success)return r.warn("[aria2TaskService.retryTask] response is not success",e),s.reject(e),void a(e);if(e.data.length>0&&(c=e.data[0][0]),e.data.length>1&&(d=e.data[1][0]),!c||!d||!c.files||1!==c.files.length||c.bittorrent)return c||r.warn("[aria2TaskService.retryTask] task is null"),d||r.warn("[aria2TaskService.retryTask] options is null"),c.files||r.warn("[aria2TaskService.retryTask] task file is null"),1!==c.files.length&&r.warn("[aria2TaskService.retryTask] task file length is not equal 1"),c.bittorrent&&r.warn("[aria2TaskService.retryTask] task is bittorrent"),s.reject(t),void a({success:!1});for(var o=c.files[0],u=[],p=0;p<o.uris.length;p++){var g=o.uris[p];u.push(g.uri)}i.addUri({task:{urls:u,options:d},pauseOnAdded:!1,silent:!!n,callback:function(e){if(!e.success)return r.warn("[aria2TaskService.retryTask] addUri response is not success",e),s.reject(e),void a(e);l.getRemoveOldTaskAfterRetrying()&&i.removeDownloadResult({gid:t,silent:!0,callback:function(e){e.success||r.warn("[aria2TaskService.retryTask] removeDownloadResult response is not success",e)}}),s.resolve(e),a(e)}})}else r.warn("[aria2TaskService.retryTask] callback is null")}}),s.promise},retryTasks:function(t,a,n){if(a){for(var i=this.retryTask,s=e.defer(),o=null,l=0,c=0,d=function(e,o){return r.debug("[aria2TaskService.retryTasks] task#"+o+", gid="+e.gid+" start retrying",e),i(e.gid,(function(n){if(r.debug("[aria2TaskService.retryTasks] task#"+o+", gid="+e.gid+", result="+n.success,e),n.success?l++:c++,l+c===t.length){var i={successCount:l,failedCount:c,hasSuccess:l>0,hasError:c>0};s.resolve(i),a(i)}}),n)},u=0;u<t.length;u++){var p=t[u],g=null;g=o?function(e,t){return o.then((function(){return d(e,t)})).catch((function(){return d(e,t)}))}(p,u):d(p,u),o=g}return s.promise}r.warn("[aria2TaskService.retryTasks] callback is null")},removeTasks:function(t,a,n){for(var o=[],r=[],l=!1,c=0;c<t.length;c++)"complete"===t[c].status||"error"===t[c].status||"removed"===t[c].status?r.push(t[c].gid):(o.push(t[c].gid),"active"===t[c].status&&(l=!0));var d=[],u=!1,p=!1,g=[];return o.length>0&&d.push(i.forceRemoveMulti({gids:o,silent:!!n,callback:function(e){s.pushArrayTo(g,e.results),u=u||e.hasSuccess,p=p||e.hasError}})),r.length>0&&d.push(i.removeDownloadResultMulti({gids:r,silent:!!n,callback:function(e){s.pushArrayTo(g,e.results),u=u||e.hasSuccess,p=p||e.hasError}})),e.all(d).then((function(){a&&a({hasSuccess:!!u,hasError:!!p,remainsStoppedTask:!!l,results:g})}))},changeTaskPosition:function(e,t,a,n){return i.changePosition({gid:e,pos:t,how:"POS_SET",silent:!!n,callback:a})},clearStoppedTasks:function(e,t){return i.purgeDownloadResult({silent:!!t,callback:e})},onConnectionSuccess:function(e){e?i.onConnectionSuccess({callback:e}):r.warn("[aria2TaskService.onConnectionSuccess] callback is null")},onConnectionFailed:function(e){e?i.onConnectionFailed({callback:e}):r.warn("[aria2TaskService.onConnectionFailed] callback is null")},onConnectionReconnecting:function(e){e?i.onConnectionReconnecting({callback:e}):r.warn("[aria2TaskService.onConnectionReconnecting] callback is null")},onConnectionWaitingToReconnect:function(e){e?i.onConnectionWaitingToReconnect({callback:e}):r.warn("[aria2TaskService.onConnectionWaitingToReconnect] callback is null")},onFirstSuccess:function(e){e?i.onFirstSuccess({callback:e}):r.warn("[aria2TaskService.onFirstSuccess] callback is null")},onOperationSuccess:function(e){e?i.onOperationSuccess({callback:e}):r.warn("[aria2TaskService.onOperationSuccess] callback is null")},onOperationError:function(e){e?i.onOperationError({callback:e}):r.warn("[aria2TaskService.onOperationError] callback is null")},onTaskCompleted:function(e){e?i.onDownloadComplete({callback:v(this.getTaskStatus,e,"completed")}):r.warn("[aria2TaskService.onTaskCompleted] callback is null")},onBtTaskCompleted:function(e){e?i.onBtDownloadComplete({callback:v(this.getTaskStatus,e,"btcompleted")}):r.warn("[aria2TaskService.onBtTaskCompleted] callback is null")},onTaskErrorOccur:function(e){e?i.onDownloadError({callback:v(this.getTaskStatus,e,"error")}):r.warn("[aria2TaskService.onTaskErrorOccur] callback is null")},processDownloadTasks:function(e,t){if(angular.isArray(e))for(var a=0;a<e.length;a++)m(e[a],t);else r.warn("[aria2TaskService.processDownloadTasks] tasks is not array",e)},getPieceStatus:function(e,t){return f(e,t)},getCombinedPieces:function(e,t){return function(e,t){for(var a=f(e,t),n=[],i=0;i<a.length;i++){var s=a[i];n.length>0&&n[n.length-1].isCompleted===s?n[n.length-1].count++:n.push({isCompleted:s,count:1})}return n}(e,t)},estimateHealthPercentFromPeers:function(e,t){if(!e||e.numPieces<1||t.length<1)return r.warn("[aria2TaskService.estimateHealthPercentFromPeers] tasks is null or numPieces < 1 or peers < 1",e),e.completePercent;for(var a=[],n=0,i=e.completePercent,s=0;s<e.numPieces;s++)a.push(0);for(s=0;s<t.length;s++){for(var o=t[s],l=f(o.bitfield,e.numPieces),c=0,d=0;d<l.length;d++){var u=l[d]?1:0;a[d]+=u,c+=u}c>n?(n=c,i=o.completePercent):c===n&&o.completePercent>i&&(i=o.completePercent)}var p=0;if(a.length>0)for(;;){var g=!0;for(s=0;s<a.length;s++)a[s]>0?(p++,a[s]--):g=!1;if(!g)break}if(p<=n)return i;var m=p/e.numPieces*100;return m<=i?i:m}}}])}(),function(){"use strict";angular.module("ariaNg").factory("aria2SettingService",["ariaNgConstants","aria2AllOptions","aria2GlobalAvailableOptions","aria2QuickSettingsAvailableOptions","aria2TaskAvailableOptions","aria2RpcService","ariaNgLogService","ariaNgStorageService",function(e,t,a,n,i,s,o,r){var l=function(t){return e.settingHistoryKeyPrefix+"."+t};return{isOptionKeyValid:function(e){return!!t[e]},isOptionKeyRequired:function(e){var a=t[e];return a&&a.required},getAvailableGlobalOptionsKeys:function(e){return"basic"===e?a.basicOptions:"http-ftp-sftp"===e?a.httpFtpSFtpOptions:"http"===e?a.httpOptions:"ftp-sftp"===e?a.ftpSFtpOptions:"bt"===e?a.btOptions:"metalink"===e?a.metalinkOptions:"rpc"===e?a.rpcOptions:"advanced"===e&&a.advancedOptions},getAria2QuickSettingsAvailableOptions:function(e){return"globalSpeedLimit"===e&&n.globalSpeedLimitOptions},getAvailableTaskOptionKeys:function(e,t){for(var a=i.taskOptions,n=[],s=0;s<a.length;s++){var o=a[s],r={key:o.key,category:o.category};o.canShow&&o.canShow.indexOf(e)<0||("http"===o.category&&t||("bittorrent"!==o.category||t)&&(o.canUpdate&&o.canUpdate.indexOf(e)<0&&(r.readonly=!0),n.push(r)))}return n},getNewTaskOptionKeys:function(){for(var e=i.taskOptions,t=[],a=0;a<e.length;a++){var n=e[a],s={key:n.key,category:n.category,showHistory:n.showHistory};n.canShow&&n.canShow.indexOf("new")<0||(n.canUpdate&&n.canUpdate.indexOf("new")<0&&(s.readonly=!0),t.push(s))}return t},getDefaultOptions:function(e){let a={};if(!Array.isArray(e))return a;for(const n of e)t[n]?.hasOwnProperty("defaultValue")&&(a[n]=t[n].defaultValue);return a},getSpecifiedOptions:function(e,a){var n=[];if(!e)return n;for(var i=0;i<e.length;i++){var s=e[i],o=!1,r=null,l=!1;if(angular.isObject(s)){var c=s;s=c.key,o=!!c.readonly,r=c.category,l=!!c.showHistory}var d=t[s];if(d){if(d=angular.extend({key:s,nameKey:"options."+s+".name",descriptionKey:"options."+s+".description"},d),r&&(d.category=r),"boolean"===d.type&&(d.options=["true","false"]),o&&(d.readonly=!0),l&&(d.showHistory=!0),a&&a.disableRequired&&(d.required=!1),d.options){for(var u=[],p=0;p<d.options.length;p++)u.push({name:"option."+d.options[p],value:d.options[p]});d.options=u}n.push(d)}}return n},getSettingHistory:function(t){if(!this.isOptionKeyValid(t))return[];for(var a=l(t),n=r.get(a)||[],i=[],s=0;s<Math.min(n.length,e.historyMaxStoreCount);s++)i.push(n[s]);return i},addSettingHistory:function(t,a){if(!this.isOptionKeyValid(t))return[];var n=l(t),i=r.get(n)||[],s=[];s.push(a);for(var o=0;o<Math.min(i.length,e.historyMaxStoreCount-1);o++)i[o]!==a&&s.push(i[o]);return r.set(n,s),s},clearSettingsHistorys:function(){for(var t=r.keys(e.settingHistoryKeyPrefix+"."),a=0;a<t.length;a++)r.remove(t[a])},getGlobalOption:function(e,t){return s.getGlobalOption({silent:!!t,callback:e})},setGlobalOption:function(e,t,a,n){var i={};return i[e]=t,s.changeGlobalOption({options:i,silent:!!n,callback:a})},setGlobalOptions:function(e,t,a){return s.changeGlobalOption({options:e,silent:!!a,callback:t})},getAria2Status:function(e,t){return s.getVersion({silent:!!t,callback:e})},getSessionInfo:function(e,t){return s.getSessionInfo({silent:!!t,callback:e})},getGlobalStat:function(e,t){return s.getGlobalStat({silent:!!t,callback:function(t){if(e){var a=function(e){if(!e)return e;var t=parseInt(e.numActive)+parseInt(e.numWaiting);return e.totalRunningCount=t,e}(t);e(a)}else o.warn("[aria2SettingService.getGlobalStat] callback is null")}})},canReconnect:function(){return s.canReconnect()},reconnect:function(){return s.reconnect({})},saveSession:function(e,t){return s.saveSession({silent:!!t,callback:e})},shutdown:function(e,t){return s.shutdown({silent:!!t,callback:e})}}}])}(),function(){"use strict";angular.module("ariaNg").factory("aria2eRecService",["aria2eConstants",function(e){return{getRecManifestPromise:function(){return new Promise(((t,a)=>{let n=e.recManifestUrl;fetch(n).then((e=>{t(e.json())})).catch((e=>{a(e)}))}))}}}])}(),angular.module("ariaNg").run(["$templateCache",function(e){e.put("views/debug.html",'<section class="content no-padding ng-cloak" ng-show="enableDebugMode()"><div class="nav-tabs-custom"><ul class="nav nav-tabs"><li ng-class="{\'active\': context.currentTab === \'logs\'}"><a class="nav-link pointer-cursor" ng-click="changeTab(\'logs\')" ng-bind="(\'format.debug.latest-logs\' | translate: {count: context.logMaxCount})">Latest Logs</a></li><li ng-class="{\'active\': context.currentTab === \'rpc\'}"><a class="nav-link pointer-cursor" ng-click="changeTab(\'rpc\')" translate>Aria2 RPC Debug</a></li></ul><div class="tab-content no-padding"><div class="tab-pane" ng-class="{\'active\': context.currentTab === \'logs\'}"><div class="settings-table striped hoverable"><div class="settings-table-title"><div class="row"><div class="col-sm-12"><a ng-click="changeLogListDisplayOrder(\'time:asc\', true)"><span translate>Logging Time</span><i class="fa fa-display-order" ng-class="{\'fa-sort-asc fa-order-asc\': isLogListSetDisplayOrder(\'time:asc\'), \'fa-sort-desc fa-order-desc\': isLogListSetDisplayOrder(\'time:desc\')}"></i></a><div class="settings-table-title-toolbar"><div class="btn-group"><button type="button" class="btn btn-default btn-xs dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><span translate>Log Level</span>: <span ng-bind="context.logLevelFilter | translate"></span> <span class="caret"></span></button><ul class="dropdown-menu"><li><a class="dropdown-item" href="javascript:void(0);" ng-click="setLogLevelFilter(\'DEBUG\')"><span translate>DEBUG</span> <i class="fa" ng-class="{\'fa-check\': isSetLogLevelFilter(\'DEBUG\')}"></i></a></li><li><a class="dropdown-item" href="javascript:void(0);" ng-click="setLogLevelFilter(\'INFO\')"><span translate>INFO</span> <i class="fa" ng-class="{\'fa-check\': isSetLogLevelFilter(\'INFO\')}"></i></a></li><li><a class="dropdown-item" href="javascript:void(0);" ng-click="setLogLevelFilter(\'WARN\')"><span translate>WARN</span> <i class="fa" ng-class="{\'fa-check\': isSetLogLevelFilter(\'WARN\')}"></i></a></li><li><a class="dropdown-item" href="javascript:void(0);" ng-click="setLogLevelFilter(\'ERROR\')"><span translate>ERROR</span> <i class="fa" ng-class="{\'fa-check\': isSetLogLevelFilter(\'ERROR\')}"></i></a></li></ul></div> <div class="btn-group"><button type="button" class="btn btn-default btn-xs dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><span translate>Auto Refresh</span>: <span ng-bind="context.logAutoRefreshInterval | timeDisplayName: \'Disabled\'"></span> <span class="caret"></span></button><ul class="dropdown-menu"><li ng-repeat="interval in context.logAutoRefreshAvailableInterval"><a class="dropdown-item" href="javascript:void(0);" ng-click="setAutoRefreshInterval(interval.optionValue)"><span ng-bind="interval.name | translate: {value: interval.value}"></span> <i class="fa" ng-class="{\'fa-check\': context.logAutoRefreshInterval === interval.optionValue}"></i></a></li><li class="dropdown-divider"></li><li><a class="dropdown-item" href="javascript:void(0);" ng-click="reloadLogs()"><span translate>Refresh Now</span></a></li></ul></div><button class="btn btn-xs btn-default" ng-click="clearDebugLogs()"><span translate>Clear Logs</span></button></div></div></div></div><div class="row" ng-repeat="log in context.logs | filter: filterLog | logOrderBy: getLogListOrderType()"><div class="col-sm-12"><span class="label label-default" ng-bind="\'#\' + log.id"></span> <span ng-bind="log.time | longDate"></span> <span class="label" ng-class="{\'DEBUG\':\'label-default\', \'INFO\':\'label-primary\', \'WARN\':\'label-warning\', \'ERROR\':\'label-danger\'}[log.level]" ng-bind="log.level"></span> <span ng-bind="log.content"></span> <a class="pointer-cursor" ng-click="showLogDetail(log)" ng-if="log.attachment"><i class="fa fa-file-o"></i> <span translate>Show Detail</span></a></div></div></div></div><div class="tab-pane" ng-class="{\'active\': context.currentTab === \'rpc\'}"><form name="executeMethodForm" ng-submit="executeAria2Method()" novalidate><div class="settings-table striped hoverable"><div class="row"><div class="setting-key setting-key-without-desc col-sm-4"><span translate>Aria2 RPC Request Method</span></div><div class="setting-value col-sm-8"><select name="method" class="form-control" style="width: 100%;" ng-required="true" ng-model="context.rpcRequestMethod" ng-options="method as method for method in context.availableRpcMethods"></select></div></div><div class="row"><div class="setting-key setting-key-without-desc col-sm-4"><span translate>Aria2 RPC Request Parameters</span></div><div class="setting-value col-sm-8"><textarea name="parameters" class="form-control" rows="6" ng-required="true" ng-keydown="requestParametersTextboxKeyDown($event)" ng-model="context.rpcRequestParameters"></textarea></div></div><div class="row"><div class="setting-key setting-key-without-desc col-sm-4"><span translate>Aria2 RPC Response</span></div><div class="setting-value col-sm-8"><textarea class="form-control" rows="10" readonly="readonly" ng-model="context.rpcResponse"></textarea></div></div><div class="row"><div class="setting-key setting-key-without-desc col-sm-4"></div><div class="setting-value col-sm-8"><button class="btn btn-sm btn-primary" ng-disabled="!executeMethodForm.$valid" ng-click="executeAria2Method()" promise-btn><span translate>Execute</span></button></div></div></div></form></div></div></div><div id="log-detail-modal" class="modal fade" tabindex="-1" role="dialog"><div class="modal-dialog modal-lg" role="document"><div class="modal-content"><div class="modal-header"><h4 class="modal-title" translate>Log Detail</h4><button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button></div><div class="modal-body no-padding"><div class="settings-table striped"><div class="row"><div class="col-sm-12"><span ng-bind="context.currentLog.time | longDate"></span> <span class="label" ng-class="{\'DEBUG\':\'label-default\', \'INFO\':\'label-primary\', \'WARN\':\'label-warning\', \'ERROR\':\'label-danger\'}[context.currentLog.level]" ng-bind="context.currentLog.level"></span> <span ng-bind="context.currentLog.content"></span></div></div><div class="row" ng-if="context.currentLog.attachment"><div class="col-sm-12"><pre ng-bind="context.currentLog.attachment | json"></pre></div></div></div></div></div></div></div></section>'),e.put("views/export-command-api-dialog.html",'<div class="modal fade" tabindex="-1" role="dialog"><div class="modal-dialog modal-lg" role="document"><div class="modal-content"><div class="modal-header"><h4 class="modal-title"><span translate>Export Command API</span></h4><button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button></div><div class="modal-body no-padding"><div class="settings-table striped"><div class="row"><div class="setting-key setting-key-without-desc col-sm-2"><span translate>AriaNg Url</span></div><div class="setting-value col-sm-10"><input class="form-control" type="text" ng-model="context.baseUrl" ng-change="generateCommandAPIUrl()"></div></div><div class="row" ng-if="options.type === \'new-task\'"><div class="setting-key setting-key-without-desc col-sm-2"><span translate>Pause After Task Created</span></div><div class="setting-value col-sm-10"><select class="form-control" style="width: 100%;" ng-model="context.pauseOnAdded" ng-change="generateCommandAPIUrl()" ng-options="option.value as (option.name | translate) for option in context.trueFalseOptions"></select></div></div><div class="row"><div class="setting-key setting-key-without-desc col-sm-2"><span translate>Command API Url</span> <span class="description"><a class="pointer-cursor" title="{{\'Copy\' | translate}}" ng-click="copyCommandAPI()"><i class="icon-primary fa fa-copy"></i> </a><span class="label label-default fade-in" ng-if="context.isCopied" translate>Copied</span></span></div><div class="setting-value col-sm-10"><textarea class="form-control" ng-model="context.commandAPIUrl" rows="4" readonly="readonly"></textarea></div></div></div></div><div class="modal-footer"><button type="button" class="btn btn-default" data-dismiss="modal" translate>Cancel</button></div></div></div></div>'),e.put("views/list.html",'<section class="content no-padding"><div id="task-table" class="task-table"><div class="task-table-title"><div class="row"><div class="col-lg-8 col-sm-7"><div class="row"><div class="col-sm-9"><a ng-click="changeDisplayOrder(\'name:asc\', true)"><span translate>File Name</span><i class="fa fa-display-order" ng-class="{\'fa-sort-asc fa-order-asc\': isSetDisplayOrder(\'name:asc\'), \'fa-sort-desc fa-order-desc\': isSetDisplayOrder(\'name:desc\')}"></i></a></div><div class="col-sm-3"><a ng-click="changeDisplayOrder(\'size:asc\', true)"><span translate>File Size</span><i class="fa fa-display-order" ng-class="{\'fa-sort-asc fa-order-asc\': isSetDisplayOrder(\'size:asc\'), \'fa-sort-desc fa-order-desc\': isSetDisplayOrder(\'size:desc\')}"></i></a></div></div></div><div class="col-lg-2 col-sm-3"><div class="row"><div class="col-sm-6"><a ng-click="changeDisplayOrder(\'percent:desc\', true)"><span translate>Progress</span><i class="fa fa-display-order" ng-class="{\'fa-sort-asc fa-order-asc\': isSetDisplayOrder(\'percent:asc\'), \'fa-sort-desc fa-order-desc\': isSetDisplayOrder(\'percent:desc\')}"></i></a></div><div class="col-sm-6"><a ng-click="changeDisplayOrder(\'remain:asc\', true)"><span translate>Remaining</span><i class="fa fa-display-order" ng-class="{\'fa-sort-asc fa-order-asc\': isSetDisplayOrder(\'remain:asc\'), \'fa-sort-desc fa-order-desc\': isSetDisplayOrder(\'remain:desc\')}"></i></a></div></div></div><div class="col-lg-2 col-sm-2"><a ng-click="changeDisplayOrder(\'dspeed:desc\', true)"><span translate>Download Speed</span><i class="fa fa-display-order" ng-class="{\'fa-sort-asc fa-order-asc\': isSetDisplayOrder(\'dspeed:asc\'), \'fa-sort-desc fa-order-desc\': isSetDisplayOrder(\'dspeed:desc\')}"></i></a></div></div></div><div class="task-table-body" ng-class="{\'draggable\': isSupportDragTask()}" dragula="\'task-list\'" dragula-model="taskContext.list"><div class="row pointer-cursor task-item-animate" ng-repeat="task in taskContext.list | filter: filterTask | groupTask | taskOrderBy: getOrderType() as sortedTaskList track by task.gid" data-gid="{{task.gid}}" data-selected="{{!!taskContext.selected[task.gid]}}" data-toggle="context" data-target="#task-table-contextmenu" ng-mouseup="onTaskClick($index, $event, sortedTaskList)" ng-init="oldIndex = $index" ng-class="{\'animate-move-up\': $index < oldIndex, \'animate-move-down\': $index > oldIndex}"><div class="col-lg-8 col-sm-7 col-12" ng-class="{\'compact-list\': compactMode && task.status !== \'active\' && task.status !== \'waiting\'}"><div class="checkbox checkbox-primary" ng-class="{\'checkbox-hide\': !taskContext.selected[task.gid]}" ng-click="$event.preventDefault()"><input id="{{\'task_\' + task.gid}}" type="checkbox" ng-checked="taskContext.selected[task.gid]"> <label for="{{\'task_\' + task.gid}}"><span class="task-name auto-ellipsis" ng-bind="task.taskName" title="{{task.dir + task.taskName}}"></span></label></div><div class="task-files"><span ng-bind="task.totalLength | readableVolume"></span> <a ng-href="#!/task/detail/{{task.gid}}" title="{{\'Click to view task detail\' | translate}}"><span ng-if="task.files" ng-bind="(\'format.settings.file-count\' | translate: {count: task.selectedFileCount})"></span> </a><i class="icon-error fa fa-times" ng-if="task && task.status === \'error\' && task.errorDescription" title="{{task.errorDescription | translate}}"></i><i class="icon-seeder fa fa-arrow-up" ng-if="task && task.status === \'active\' && task.seeder" title="{{\'Seeding\' | translate}}"></i> <a ng-if="isTaskRetryable(task)" ng-click="retryTask(task)" title="{{\'Retry\' | translate}}" translate>Retry</a> <a ng-if="isWindows && isRpcLocalhost && (task.status == \'complete\' || task.completedLength > 0)" target="_blank" class="fa fa-lg fa-folder mx-2" title="{{ \'Open download folder\' | translate }}" ng-mouseup="openDownloadFolder($event, task)"></a></div></div><div class="col-lg-2 col-sm-3 col-12" ng-class="{\'draggable\': isSupportDragTask()}"><div class="progress" ng-class="{\'progress-bar-striped\': task.status === \'error\' || task.status === \'removed\', \'progress-bar-striped progress-bar-animated\': task.status === \'active\' && task.completePercent == 0}"><div class="progress-bar progress-bar-primary" role="progressbar" ng-class="{\'progress-bar-warning progress-bar-striped\': task.status === \'error\', \'progress-bar-success\': task.status === \'complete\', \'progress-bar-invalid\': task.status === \'removed\', \'progress-bar-striped progress-bar-animated\': task.status === \'active\'}" aria-valuenow="{{task.completePercent}}" aria-valuemin="1" aria-valuemax="100" ng-style="{ width: (task.status === \'error\' && task.completePercent < 5 ? 100 : task.completePercent) + \'%\' }"><span ng-class="{\'progress-lower\': task.completePercent < 50}" ng-bind="(task.completePercent | percent: 2) + \'%\'"></span></div></div><div><span class="task-last-time" ng-bind="task.status === \'waiting\' ? \'--:--:--\' : (task.status === \'paused\' ? \'\' : (task.status === \'active\' ? ((0 <= task.remainTime && task.remainTime < 86400) ? (task.remainTime | dateDuration: \'second\': \'HH:mm:ss\') : (\'More Than One Day\' | translate)) : \'\'))"></span> <span class="task-download-speed d-inline d-sm-none pull-right" ng-bind="(task.status === \'active\' && !task.verifyIntegrityPending && !task.verifiedLength ? (!task.seeder || task.downloadSpeed > 0 ? (task.downloadSpeed | readableVolume) + \'/s\' : \'-\') : (task | taskStatus: true | translate: {errorcode: task.errorCode, verifiedPercent: task.verifiedPercent}))"></span> <span class="task-seeders pull-right" ng-bind="task.status === \'active\' ? ((task.numSeeders ? (task.numSeeders + \'/\') : \'\') + task.connections) : \'\'"></span></div></div><div class="col-lg-2 col-sm-2 d-none d-sm-block" ng-class="{\'draggable\': isSupportDragTask()}"><span class="task-download-speed" title="{{task.status === \'active\' ? ((\'Download Speed\' | translate) + \': \' + (task.downloadSpeed | readableVolume) + \'/s\') + (task.bittorrent ? \', \' + (\'Upload Speed\' | translate) + \': \' + (task.uploadSpeed | readableVolume) + \'/s\' : \'\') : \'\'}}" ng-bind="(task.status === \'active\' && !task.verifyIntegrityPending && !task.verifiedLength ? (!task.seeder || task.downloadSpeed > 0 ? (task.downloadSpeed | readableVolume) + \'/s\' : \'-\') : (task | taskStatus: false | translate: {errorcode: task.errorCode, verifiedPercent: task.verifiedPercent}))"></span></div><div class="task-right-arrow d-none d-md-block"><a ng-href="#!/task/detail/{{task.gid}}" title="{{\'Click to view task detail\' | translate}}"><i class="fa fa-angle-right"></i></a></div></div></div><div id="task-table-contextmenu"><ul class="dropdown-menu" role="menu"><li ng-if="isSelectedTaskRetryable()"><a class="dropdown-item" tabindex="-1" class="pointer-cursor" title="{{\'Retry Selected Tasks\' | translate}}" ng-click="retryTasks()"><i class="fa fa-refresh fa-fw"></i> <span translate>Retry Selected Tasks</span></a></li><li class="dropdown-divider" ng-if="isSelectedTaskRetryable()"></li><li ng-if="isSpecifiedTaskSelected(\'paused\')"><a class="dropdown-item" tabindex="-1" class="pointer-cursor" title="{{\'Start\' | translate}}" ng-click="changeTasksState(\'start\')"><i class="fa fa-play fa-fw"></i> <span translate>Start</span></a></li><li ng-if="isSpecifiedTaskSelected(\'active\', \'waiting\')"><a class="dropdown-item" tabindex="-1" class="pointer-cursor" title="{{\'Pause\' | translate}}" ng-click="changeTasksState(\'pause\')"><i class="fa fa-pause fa-fw"></i> <span translate>Pause</span></a></li><li ng-if="isTaskSelected()"><a class="dropdown-item" tabindex="-1" class="pointer-cursor" title="{{\'Delete\' | translate}}" ng-click="removeTasks()"><i class="fa fa-trash-o fa-fw"></i> <span translate>Delete</span></a></li><li class="dropdown-divider" ng-if="isTaskSelected()"></li><li class="dropdown-submenu"><a class="dropdown-item" tabindex="-1" title="{{\'Display Order\' | translate}}" href="javascript:void(0);"><i class="fa fa-sort-alpha-asc fa-fw"></i> <span translate>Display Order</span></a><ul class="dropdown-menu"><li><a class="dropdown-item pointer-cursor" ng-click="changeDisplayOrder(\'default:asc\')"><span translate>Default</span> <i class="fa fa-fw" ng-class="{\'fa-check\': isSetDisplayOrder(\'default\')}"></i></a></li><li><a class="dropdown-item pointer-cursor" ng-click="changeDisplayOrder(\'name:asc\')"><span translate>By File Name</span> <i class="fa fa-fw" ng-class="{\'fa-check\': isSetDisplayOrder(\'name\')}"></i></a></li><li><a class="dropdown-item pointer-cursor" ng-click="changeDisplayOrder(\'size:asc\')"><span translate>By File Size</span> <i class="fa fa-fw" ng-class="{\'fa-check\': isSetDisplayOrder(\'size\')}"></i></a></li><li><a class="dropdown-item pointer-cursor" ng-click="changeDisplayOrder(\'percent:desc\')"><span translate>By Progress</span> <i class="fa fa-fw" ng-class="{\'fa-check\': isSetDisplayOrder(\'percent\')}"></i></a></li><li><a class="dropdown-item pointer-cursor" ng-click="changeDisplayOrder(\'remain:asc\')"><span translate>By Remaining</span> <i class="fa fa-fw" ng-class="{\'fa-check\': isSetDisplayOrder(\'remain\')}"></i></a></li><li><a class="dropdown-item pointer-cursor" ng-click="changeDisplayOrder(\'dspeed:desc\')"><span translate>By Download Speed</span> <i class="fa fa-fw" ng-class="{\'fa-check\': isSetDisplayOrder(\'dspeed\')}"></i></a></li><li><a class="dropdown-item pointer-cursor" ng-click="changeDisplayOrder(\'uspeed:desc\')"><span translate>By Upload Speed</span> <i class="fa fa-fw" ng-class="{\'fa-check\': isSetDisplayOrder(\'uspeed\')}"></i></a></li></ul></li><li class="dropdown-divider"></li><li ng-if="hasPausedTask() && location == \'all\'"><a tabindex="-1" class="dropdown-item pointer-cursor" title="{{\'Select All Paused Tasks\' | translate}}" ng-click="selectAllPausedTasks()"><i class="fa fa-tasks fa-fw"></i> <span translate>Select All Paused Tasks</span></a></li><li ng-if="hasRetryableTask()"><a tabindex="-1" class="dropdown-item pointer-cursor" title="{{\'Select All Failed Tasks\' | translate}}" ng-click="selectAllFailedTasks()"><i class="fa fa-times-rectangle-o fa-fw"></i> <span translate>Select All Failed Tasks</span></a></li><li ng-if="hasCompletedTask()"><a tabindex="-1" class="dropdown-item pointer-cursor" title="{{\'Select All Completed Tasks\' | translate}}" ng-click="selectAllCompletedTasks()"><i class="fa fa-check-square-o fa-fw"></i> <span translate>Select All Completed Tasks</span></a></li><li><a tabindex="-1" class="dropdown-item pointer-cursor" title="{{\'Select All\' | translate}}" ng-click="selectAllTasks()"><i class="fa fa-th-large fa-fw"></i> <span translate>Select All</span></a></li><li class="dropdown-divider" ng-if="isSelectedTasksAllHaveUrl() || isSelectedTasksAllHaveInfoHash()"></li><li ng-if="isSelectedTasksAllHaveUrl()"><a tabindex="-1" class="dropdown-item pointer-cursor" title="{{\'Copy Download Url\' | translate}}" ng-click="copySelectedTasksDownloadLink()"><i class="fa fa-copy fa-fw"></i> <span translate>Copy Download Url</span></a></li><li ng-if="isSelectedTasksAllHaveInfoHash()"><a tabindex="-1" class="dropdown-item pointer-cursor" title="{{\'Copy Magnet Link\' | translate}}" ng-click="copySelectedTasksMagnetLink()"><i class="fa fa-magnet fa-fw"></i> <span translate>Copy Magnet Link</span></a></li></ul></div></div></section>'),e.put("views/new.html",'<section class="content no-padding"><form name="newTaskForm" ng-submit="startDownload(false, $event)" novalidate><div class="nav-tabs-custom"><ul class="nav nav-tabs"><li class="nav-item" ng-class="{\'active\': context.currentTab === \'links\'}"><a class="nav-link pointer-cursor" ng-click="changeTab(\'links\')" ng-bind="(context.taskType === \'torrent\' ? \'Torrent File\' : (context.taskType === \'metalink\' ? \'Metalink File\' : \'Links\') | translate)">Links</a></li><li class="nav-item" ng-class="{\'active\': context.currentTab === \'options\'}"><a class="nav-link pointer-cursor" ng-click="changeTab(\'options\')" translate>Options</a></li><li class="divider"></li><li class="nav-toolbar"><div class="btn-group"><button type="button" class="btn btn-sm btn-default dropdown-toggle" data-toggle="dropdown"><i class="fa fa-folder-open-o fa-1_1x"></i></button><ul class="dropdown-menu"><li><a class="dropdown-item pointer-cursor" ng-click="openTorrent()" translate>Open Torrent File</a></li><li><a class="dropdown-item pointer-cursor" ng-click="openMetalink()" translate>Open Metalink File</a></li></ul></div><div class="btn-group"><button type="submit" class="btn btn-sm" ng-class="{\'btn-default\': !isNewTaskValid(), \'btn-success\': isNewTaskValid()}" ng-disabled="!isNewTaskValid()" translate>Download Now</button> <button type="button" class="btn btn-sm dropdown-toggle" ng-class="{\'btn-default\': !isNewTaskValid(), \'btn-success\': isNewTaskValid()}" ng-disabled="!isNewTaskValid()" data-toggle="dropdown"><span class="caret"></span></button><ul class="dropdown-menu"><li><a class="dropdown-item pointer-cursor" ng-click="startDownload(true, $event)" translate>Download Later</a></li><li ng-if="(context.taskType === \'urls\') && context.hasDownloadsPermission" class="dropdown-divider"></li><li ng-if="(context.taskType === \'urls\') && context.hasDownloadsPermission"><a class="dropdown-item pointer-cursor" ng-click="invokeBrowserDownload($event)" translate>Download via Browser</a></li><li ng-if="context.taskType === \'urls\'" class="dropdown-divider"></li><li ng-if="context.taskType === \'urls\'"><a class="dropdown-item pointer-cursor" ng-click="showExportCommandAPIModal()" translate>Export Command API</a></li></ul></div></li></ul><div class="tab-content no-padding"><div class="tab-pane" ng-class="{\'active\': context.currentTab === \'links\'}"><div class="new-task-table" ng-if="context.taskType === \'urls\'"><div class="row"><div class="col-sm-12"><p><span ng-bind="\'format.task.new.download-links\' | translate: {count: getValidUrlsCount()}">Download Links:</span> <button type="button" ng-if="getValidUrlsCount()>1 || pendingTasks&&pendingTasks.length>1" ng-click="showUrlFilter()" class="btn btn-xs btn-default align-text-top"><i class="fa fa-filter"></i> <span translate>Filters</span></button></p><div ng-if="context.showUrlFilter" class="url-filter fade-in"><div class="btn-group"><button type="button" class="btn btn-primary btn-sm" ng-click="selectFiles(\'auto\')" ng-bind="(isAllFileSelected() ? \'Select None\' : \'Select All\') | translate">Select All</button> <button type="button" class="btn btn-primary btn-sm dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><span class="caret"></span></button><ul class="dropdown-menu"><li><a class="dropdown-item" href="javascript:void(0);" ng-click="selectFiles(\'all\')" translate>Select All</a></li><li><a class="dropdown-item" href="javascript:void(0);" ng-click="selectFiles(\'none\')" translate>Select None</a></li><li><a class="dropdown-item" href="javascript:void(0);" ng-click="selectFiles(\'reverse\')" translate>Select Invert</a></li></ul></div><button type="button" class="btn btn-sm btn-default" ng-click="chooseSpecifiedFiles(\'video\')"><i class="fa fa-file-video-o"></i> <span class="d-none d-md-inline" translate>Videos</span></button> <button type="button" class="btn btn-sm btn-default" ng-click="chooseSpecifiedFiles(\'audio\')"><i class="fa fa-file-audio-o"></i> <span class="d-none d-md-inline" translate>Audios</span></button> <button type="button" class="btn btn-sm btn-default" ng-click="chooseSpecifiedFiles(\'picture\')"><i class="fa fa-file-picture-o"></i> <span class="d-none d-md-inline" translate>Pictures</span></button> <button type="button" class="btn btn-sm btn-default" ng-click="chooseSpecifiedFiles(\'document\')"><i class="fa fa-file-text-o"></i> <span class="d-none d-md-inline" translate>Documents</span></button> <button type="button" class="btn btn-sm btn-default" ng-click="chooseSpecifiedFiles(\'application\')"><i class="fa fa-file-o"></i> <span class="d-none d-md-inline" translate>Applications</span></button> <button type="button" class="btn btn-sm btn-default" ng-click="chooseSpecifiedFiles(\'archive\')"><i class="fa fa-file-archive-o"></i> <span class="d-none d-md-inline" translate>Archives</span></button> <button type="button" class="btn btn-sm btn-default" ng-click="showCustomChooseFileModal()"><i class="fa fa-filter"></i> <span translate>Custom</span></button> <button type="button" class="btn btn-sm btn-success" ng-click="saveChosenFiles()" ng-disabled="!isAnyFileSelected()" translate>Confirm</button> <button type="button" class="btn btn-sm btn-secondary" ng-click="cancelUrlFilter()" translate>Cancel</button></div><div ng-if="!context.showUrlFilter" class="form-group has-feedback no-margin fade-in" ng-class="{ \'has-error\' : newTaskForm.urls.$invalid && newTaskForm.urls.$dirty, \'has-success\' : newTaskForm.urls.$valid && newTaskForm.urls.$dirty }"><textarea name="urls" class="form-control" rows="{{getValidUrlsCount() > 10 ? 20 : 10}}" autofocus="autofocus" ng-auto-focus ng-valid-urls ng-model="context.urls" ng-required="true" ng-keydown="urlTextboxKeyDown($event)" ng-placeholder="\'Support multiple URLs, one URL per line.\' | translate"></textarea><div class="form-control-icon" ng-if="newTaskForm.urls.$dirty"><i class="fa form-control-feedback" ng-class="{\'fa-check\':newTaskForm.urls.$valid, \'fa-times\':newTaskForm.urls.$invalid}"></i></div></div><div class="settings-table striped"><div ng-if="context.showUrlFilter" class="checkbox checkbox-success row fade-in" ng-repeat="task in pendingTasks | filter: filterTask"><input type="checkbox" id="{{ \'task-\' + $index }}" ng-checked="task.selected" ng-click="onTaskClick($index, $event)"> <label for="{{ \'task-\' + $index }}">{{ task.urls[0] }}</label></div></div></div></div></div><div class="new-task-table" ng-if="context.taskType === \'torrent\' || context.taskType === \'metalink\'"><div class="row"><div class="col-sm-12"><p translate>File Name:</p><input class="form-control" ng-value="context.uploadFile ? context.uploadFile.fileName : \'\'" readonly="readonly"></div></div></div><input id="file-holder" type="file" style="display: none"></div><div class="tab-pane" ng-class="{\'active\': context.currentTab === \'options\'}"><div class="settings-table striped hoverable"><div class="settings-table-title new-task-filter-title"><div class="row"><div class="col-sm-12"><span translate>Filters</span><span>: </span><div class="checkbox checkbox-inline checkbox-primary checkbox-compact"><input id="optionFilterGlobal" type="checkbox" ng-model="context.optionFilter[\'global\']"> <label for="optionFilterGlobal" translate>Global</label></div><div class="checkbox checkbox-inline checkbox-primary checkbox-compact"><input id="optionFilterHttp" type="checkbox" ng-model="context.optionFilter[\'http\']"> <label for="optionFilterHttp" translate>Http</label></div><div class="checkbox checkbox-inline checkbox-primary checkbox-compact"><input id="optionFilterBittorrent" type="checkbox" ng-model="context.optionFilter[\'bittorrent\']"> <label for="optionFilterBittorrent" translate>BitTorrent</label></div></div></div></div><ng-setting ng-repeat="option in context.availableOptions" ng-if="context.optionFilter[option.category]" option="option" show-placeholder-count="true" ng-model="context.options[option.key]" lazy-save-timeout="0" delete-key-always-change-value="true" class="fade-in" default-value="(option.overrideMode !== \'append\' && !context.options[option.key] && context.options[option.key] !== \'\') ? context.globalOptions[option.key] : \'\'" fixed-value="option.overrideMode === \'append\' ? context.globalOptions[option.key] : \'\'" on-change-value="setOption(key, value, optionStatus)"></ng-setting></div></div></div></div><ng-export-command-api-dialog options="context.exportCommandApiOptions"></ng-export-command-api-dialog></form><div id="custom-choose-file-modal" class="modal fade" tabindex="-1" role="dialog"><div class="modal-dialog" role="document"><div class="modal-content"><div class="modal-header"><h4 class="modal-title" translate>Custom Choose File</h4><button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button></div><div class="modal-body no-padding"><div class="settings-table striped hoverable"><div class="row" ng-repeat="(extensionTypeName, extensionTypeInfo) in context.fileExtensions"><div class="setting-key col-sm-4" ng-bind="extensionTypeInfo.name | translate"></div><div class="setting-value col-sm-8"><div class="checkbox checkbox-primary checkbox-inline" ng-repeat="info in extensionTypeInfo.extensions"><input id="{{info.extension}}" type="checkbox" ng-model="info.selected" ng-indeterminate="info.selectedCount > 0 && info.unSelectedCount > 0" ng-change="setSelectedExtension(info.extension, info.selected)"> <label for="{{info.extension}}" ng-bind="info.extension || \' \'"></label></div></div></div></div></div><div class="modal-footer"><button type="button" class="btn btn-default" data-dismiss="modal" translate>Close</button></div></div></div></div></section>'),e.put("views/notification-reloadable.html",'<div class="ui-notification custom-template"><div class="message" ng-bind-html="message"></div><div class="message"><a class="btn btn-small btn-primary close-notification" ng-click="refreshPage()" translate>Reload AriaNg</a></div></div>'),e.put("views/recommend.html",'<iframe title="Alex Recommends" class="recommend" ng-controller="RecommendController" ng-src="{{recommendUrl}}"></iframe>'),e.put("views/setting-dialog.html",'<div class="modal fade" tabindex="-1" role="dialog"><div class="modal-dialog" role="document"><div class="modal-content"><div class="modal-header"><h4 class="modal-title" ng-bind="(setting ? (setting.title) : \'Shortcut\') | translate">Shortcut</h4><button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button></div><div class="modal-body overlay-wrapper no-padding"><div class="settings-table striped hoverable"><ng-setting ng-repeat="option in context.availableOptions" option="option" ng-model="context.globalOptions[option.key]" default-value="option.defaultValue" on-change-value="setGlobalOption(key, value, optionStatus)"></ng-setting></div><div class="overlay" ng-if="context.isLoading"><i class="fa fa-refresh fa-spin"></i></div></div><div class="modal-footer"><button type="button" class="btn btn-default" data-dismiss="modal" translate>Cancel</button></div></div>\x3c!-- /.modal-content --\x3e</div>\x3c!-- /.modal-dialog --\x3e</div>\x3c!-- /.modal --\x3e'),e.put("views/setting.html",'<div class="row" data-option-key="{{option.key}}"><div class="setting-key setting-key-without-desc col-sm-4"><span ng-bind="option.nameKey | translate"></span> <em ng-bind="\'(\' + option.key + \')\'"></em> <i class="icon-primary fa fa-question-circle" ng-if="(option.descriptionKey | translate) !== \'\'" data-toggle="popover" data-trigger="hover" data-placement="auto" data-container="body" data-content="{{option.descriptionKey | translate}}"></i> <span class="description" ng-if="option.showCount && option.separator && (optionValue || fixedValue || (placeholder && showPlaceholderCount))" ng-bind="\'format.settings.total-count\' | translate: {count: getTotalCount()}"></span> <i class="icon-primary fa fa-info-circle" ng-if="(option.since && option.since !== \'\')" ng-tooltip="{{(\'format.requires.aria2-version\' | translate: {version: option.since})}}" ng-tooltip-container="body" ng-tooltip-placement="right"></i></div><div class="setting-value col-sm-8"><div ng-class="{\'input-group\': !!option.suffix}"><div class="form-group has-feedback" ng-class="[optionStatus.getStatusFeedbackStyle()]"><pre ng-if="fixedValue && fixedValue.trim()" ng-bind="fixedValue"></pre><input class="form-control" type="text" placeholder="{{placeholder}}" ng-disabled="!!option.readonly" ng-if="(option.type === \'string\' && !option.showHistory) || option.type === \'integer\' || option.type === \'float\'" ng-model="optionValue" ng-change="changeValue(optionValue, true)" ng-keyup="inputKeyUp($event, true)"><input-dropdown input-class-name="form-control" style="width: 100%;" input-placeholder="{{placeholder}}" ng-if="option.type === \'string\' && option.showHistory" disabled="!!option.readonly" ng-model="optionValue" ng-keyup="inputKeyUp($event, from === \'input\')" selected-item="optionValue" allow-custom-input="true" only-show-non-empty-dropdown="true" default-dropdown-items="history" filter-list-method="filterHistory(userInput)" value-changed-method="changeValue(value, from === \'input\')"></input-dropdown><textarea class="form-control" rows="6" placeholder="{{placeholder}}" ng-disabled="!!option.readonly" ng-if="option.type === \'text\'" ng-model="optionValue" ng-change="changeValue(optionValue, true)" ng-keyup="inputKeyUp($event, true)"></textarea> <select class="form-control" style="width: 100%;" ng-disabled="!!option.readonly" ng-class="{\'placeholder\': !optionValue}" ng-if="option.type === \'boolean\' || option.type === \'option\'" ng-model="optionValue" ng-change="changeValue(optionValue, false)" ng-options="item.value as (item.name | translate) for item in option.options"><option value="" disabled="disabled" ng-bind="(placeholder | translate)" style="display: none;"></option></select><div class="form-control-icon" ng-if="optionStatus.isShowStatusIcon()"><i class="fa form-control-feedback" ng-class="[optionStatus.getStatusIcon()]"></i></div></div><span class="input-group-append input-group-text" ng-if="!!option.suffix" ng-bind="option.suffix | translate"></span></div></div></div>'),e.put("views/settings-aria2.html",'<section class="content no-padding"><div class="settings-table striped hoverable"><ng-setting ng-repeat="option in context.availableOptions" option="option" ng-model="context.globalOptions[option.key]" default-value="option.defaultValue" error-tooltip-placement="{{$index > 0 ? \'top\': \'bottom\'}}" on-change-value="setGlobalOption(key, value, optionStatus)"></ng-setting></div></section>'),e.put("views/settings-ariang.html",'<section class="content no-padding"><div class="nav-tabs-custom"><ul class="nav nav-tabs"><li class="nav-item" ng-class="{\'active\': isCurrentGlobalTab()}"><a class="nav-link pointer-cursor" ng-click="changeGlobalTab()" translate>Global</a></li><li class="nav-item nav-tab-title-rpcname" ng-repeat="setting in context.rpcSettings" ng-class="{\'active\': isCurrentRpcTab($index)}"><a class="nav-link pointer-cursor" ng-click="changeRpcTab($index)"><span class="nav-tab-rpcname" ng-bind="\'RPC\' + (setting.rpcAlias || setting.rpcHost ? \' (\' + (setting.rpcAlias ? setting.rpcAlias : setting.rpcHost + \':\' + setting.rpcPort) + \')\' : \'\')" title="{{(setting.rpcAlias ? setting.rpcAlias : setting.rpcHost + \':\' + setting.rpcPort)}}">RPC</span> </a><a class="nav-link pointer-cursor nav-tab-close" ng-if="!setting.isDefault" title="{{\'Delete RPC Setting\' | translate}}"><i class="nav-icon fa fa-times" ng-click="removeRpcSetting(setting)"></i></a></li><li class="nav-item slim"><a class="nav-link pointer-cursor" ng-click="addNewRpcSetting()" title="{{\'Add New RPC Setting\' | translate}}"><i class="nav-icon fa fa-plus"></i></a></li></ul><div class="tab-content no-padding"><div class="tab-pane" ng-class="{\'active\': isCurrentGlobalTab()}"><div class="settings-table striped hoverable"><div class="row" ng-if="context.ariaNgVersion"><div class="setting-key col-sm-4"><span translate>AriaNg Version</span></div><div class="setting-value col-sm-8" ng-bind="context.ariaNgVersion + (context.buildCommit ? \' (\' + context.buildCommit + \')\' : \'\')"></div></div><div class="row"><div class="setting-key setting-key-without-desc col-sm-4"><span translate>Language</span></div><div class="setting-value col-sm-8"><select class="form-control" style="width: 100%;" ng-model="context.settings.language" ng-options="type as ((((\'languages.\' + language.name) | translate) !== (\'languages.\' + language.name) ? ((\'languages.\' + language.name) | translate) : language.name) + \' (\' + language.displayName + \')\') for (type, language) in context.languages" ng-change="setLanguage(context.settings.language)"></select></div></div><div class="row"><div class="setting-key setting-key-without-desc col-sm-4"><span translate>Theme</span></div><div class="setting-value col-sm-8"><select class="form-control" style="width: 100%;" ng-model="context.settings.theme" ng-change="setTheme(context.settings.theme)"><option value="light" translate>Light</option><option value="dark" translate>Dark</option><option ng-if="context.isSupportDarkMode" value="system" translate>Follow system settings</option></select></div></div><div class="row" ng-if="context.showDebugMode"><div class="setting-key setting-key-without-desc col-sm-4"><span translate>Debug Mode</span></div><div class="setting-value col-sm-8"><select class="form-control" style="width: 100%;" ng-model="context.sessionSettings.debugMode" ng-options="option.value as (option.name | translate) for option in context.trueFalseOptions" ng-change="setDebugMode(context.sessionSettings.debugMode)"></select></div></div><div class="row"><div class="setting-key setting-key-without-desc col-sm-4"><span translate>Page Title</span> <i class="icon-primary fa fa-question-circle" data-toggle="popover" data-trigger="hover" data-placement="auto" data-container="body" data-html="true" data-content="{{(\'Supported Placeholder\' | translate) + \':<br/>\' +\r\n (\'AriaNg Title\' | translate) + \': ${title}<br/>\' +\r\n (\'Current RPC Alias\' | translate) + \': ${rpcprofile}<br/>\' +\r\n (\'Downloading Count\' | translate) + \': ${downloading}<br/>\' +\r\n (\'Waiting Count\' | translate) + \': ${waiting}<br/>\' +\r\n (\'Stopped Count\' | translate) + \': ${stopped}<br/>\' +\r\n (\'Download Speed\' | translate) + \': ${downspeed}<br/>\' +\r\n (\'Upload Speed\' | translate) + \': ${upspeed}<br/><br/>\' +\r\n (\'Tips: You can use the "noprefix" tag to ignore the prefix, "nosuffix" tag to ignore the suffix, and "scale=n" tag to set the decimal precision.\' | translate) + \'<br/>\' +\r\n (\'Example: ${downspeed:noprefix:nosuffix:scale=1}\' | translate)}}"></i></div><div class="setting-value col-sm-8"><input class="form-control" type="text" ng-model="context.settings.title" ng-change="setTitle(context.settings.title); updateTitlePreview()"> <em>[<span translate>Preview</span>] <span ng-bind="context.titlePreview"></span></em></div></div><div class="row" ng-if="isSupportNotification()"><div class="setting-key setting-key-without-desc col-sm-4"><span translate>Enable Browser Notification</span></div><div class="setting-value col-sm-8"><select class="form-control" style="width: 100%;" ng-model="context.settings.browserNotification" ng-change="setEnableBrowserNotification(context.settings.browserNotification)" ng-options="option.value as (option.name | translate) for option in context.trueFalseOptions"></select></div></div><div class="row" ng-if="isSupportNotification() && context.settings.browserNotification"><div class="setting-key setting-key-without-desc col-sm-4"><span translate>Browser Notification Sound</span></div><div class="setting-value col-sm-8"><select class="form-control" style="width: 100%;" ng-model="context.settings.browserNotificationSound" ng-change="setBrowserNotificationSound(context.settings.browserNotificationSound)" ng-options="option.value as (option.name | translate) for option in context.trueFalseOptions"></select></div></div><div class="row" ng-if="isSupportNotification() && context.settings.browserNotification"><div class="setting-key setting-key-without-desc col-sm-4"><span translate>Browser Notification Frequency</span></div><div class="setting-value col-sm-8"><select class="form-control" style="width: 100%;" ng-model="context.settings.browserNotificationFrequency" ng-change="setBrowserNotificationFrequency(context.settings.browserNotificationFrequency)"><option value="unlimited" translate>Unlimited</option><option value="high" translate>High (Up to 10 Notifications / 1 Minute)</option><option value="middle" translate>Middle (Up to 1 Notification / 1 Minute)</option><option value="low" translate>Low (Up to 1 Notification / 5 Minutes)</option></select></div></div><div class="row" ng-if="context.isSupportReconnect"><div class="setting-key setting-key-without-desc col-sm-4"><span translate>WebSocket Auto Reconnect Interval</span> <span class="asterisk">*</span></div><div class="setting-value col-sm-8"><select class="form-control" style="width: 100%;" ng-model="context.settings.webSocketReconnectInterval" ng-change="setWebSocketReconnectInterval(context.settings.webSocketReconnectInterval)" ng-options="time.optionValue as (time.name | translate: {value: time.value}) for time in context.availableTime"></select></div></div><div class="row"><div class="setting-key setting-key-without-desc col-sm-4"><span translate>Updating Page Title Interval</span> <span class="asterisk">*</span></div><div class="setting-value col-sm-8"><select class="form-control" style="width: 100%;" ng-model="context.settings.titleRefreshInterval" ng-change="setTitleRefreshInterval(context.settings.titleRefreshInterval)" ng-options="time.optionValue as (time.name | translate: {value: time.value}) for time in context.availableTime"></select></div></div><div class="row"><div class="setting-key setting-key-without-desc col-sm-4"><span translate>Updating Global Stat Interval</span> <span class="asterisk">*</span></div><div class="setting-value col-sm-8"><select class="form-control" style="width: 100%;" ng-model="context.settings.globalStatRefreshInterval" ng-change="setGlobalStatRefreshInterval(context.settings.globalStatRefreshInterval)" ng-options="time.optionValue as (time.name | translate: {value: time.value}) for time in context.availableTime"></select></div></div><div class="row"><div class="setting-key setting-key-without-desc col-sm-4"><span translate>Updating Task Information Interval</span> <span class="asterisk">*</span></div><div class="setting-value col-sm-8"><select class="form-control" style="width: 100%;" ng-model="context.settings.downloadTaskRefreshInterval" ng-change="setDownloadTaskRefreshInterval(context.settings.downloadTaskRefreshInterval)" ng-options="time.optionValue as (time.name | translate: {value: time.value}) for time in context.availableTime"></select></div></div><div class="row"><div class="setting-key setting-key-without-desc col-sm-4"><span translate>Keyboard Shortcuts</span> <i class="icon-primary fa fa-question-circle" data-toggle="popover" data-trigger="hover" data-placement="auto" data-container="body" data-html="true" data-content="{{\'<b>\' + (\'Task Select Mode\' | translate) + \':</b><br/>\' +\r\n (\'Select Single Task\' | translate) + \': \' + (context.settings.keyboardShortcuts ? \'\' : (!context.isMacKeyboardLike ? \'<span class=\\\'keyboard-key\\\'>Ctrl</span>+\' : \'<span class=\\\'keyboard-key\\\'>Command</span>+\')) + \'<span class=\\\'keyboard-key\\\'>👆</span>\' + \'<br/>\' +\r\n (\'Select Multiple Tasks\' | translate) + \': \' + (!context.settings.keyboardShortcuts ? \'\' : (!context.isMacKeyboardLike ? \'<span class=\\\'keyboard-key\\\'>Ctrl</span>+\' : \'<span class=\\\'keyboard-key\\\'>Command</span>+\')) + \'<span class=\\\'keyboard-key\\\'>👆</span>\' + \'<br/>\' +\r\n (\'Select Consecutive Tasks\' | translate) + \': <span class=\\\'keyboard-key\\\'>Shift</span>+<span class=\\\'keyboard-key\\\'>👆</span>\' + \'<br/>\' +\r\n \'<b>\' + (\'Supported Keyboard Shortcuts\' | translate) + \':</b><br/>\' +\r\n (\'Remove Selected Task\' | translate) + \': <span class=\\\'keyboard-key\\\'>Delete</span><br/>\' +\r\n (\'Select All Tasks\' | translate) + \': \' + (!context.isMacKeyboardLike ? \'<span class=\\\'keyboard-key\\\'>Ctrl</span>+<span class=\\\'keyboard-key\\\'>A</span>\' : \'<span class=\\\'keyboard-key\\\'>Command</span>+<span class=\\\'keyboard-key\\\'>A</span>\') + \'<br/>\' +\r\n (\'Set Focus On Search Box\' | translate) + \': \' + (!context.isMacKeyboardLike ? \'<span class=\\\'keyboard-key\\\'>Ctrl</span>+<span class=\\\'keyboard-key\\\'>F</span>\' : \'<span class=\\\'keyboard-key\\\'>Command</span>+<span class=\\\'keyboard-key\\\'>F</span>\') + \'<br/>\' +\r\n (\'Download Now\' | translate) + \': \' + (!context.isMacKeyboardLike ? \'<span class=\\\'keyboard-key\\\'>Ctrl</span>+<span class=\\\'keyboard-key\\\'>Enter</span>\' : \'<span class=\\\'keyboard-key\\\'>Command</span>+<span class=\\\'keyboard-key\\\'>Return</span>\')}}"></i></div><div class="setting-value col-sm-8"><select class="form-control" style="width: 100%;" ng-model="context.settings.keyboardShortcuts" ng-change="setKeyboardShortcuts(context.settings.keyboardShortcuts)" ng-options="option.value as (option.name | translate) for option in context.trueFalseOptions"></select></div></div><div class="row"><div class="setting-key setting-key-without-desc col-sm-4"><span translate>Swipe Gesture</span></div><div class="setting-value col-sm-8"><select class="form-control" style="width: 100%;" ng-model="context.settings.swipeGesture" ng-change="setSwipeGesture(context.settings.swipeGesture)" ng-options="option.value as (option.name | translate) for option in context.trueFalseOptions"></select></div></div><div class="row"><div class="setting-key setting-key-without-desc col-sm-4"><span translate>Change Tasks Order by Drag-and-drop</span></div><div class="setting-value col-sm-8"><select class="form-control" style="width: 100%;" ng-model="context.settings.dragAndDropTasks" ng-change="setDragAndDropTasks(context.settings.dragAndDropTasks)" ng-options="option.value as (option.name | translate) for option in context.trueFalseOptions"></select></div></div><div class="row"><div class="setting-key setting-key-without-desc col-sm-4"><span translate>RPC List Display Order</span> <span class="asterisk">*</span></div><div class="setting-value col-sm-8"><select class="form-control" style="width: 100%;" ng-model="context.settings.rpcListDisplayOrder" ng-change="setRPCListDisplayOrder(context.settings.rpcListDisplayOrder)"><option value="recentlyUsed" translate>Recently Used</option><option value="rpcAlias" translate>RPC Alias</option></select></div></div><div class="row"><div class="setting-key setting-key-without-desc col-sm-4"><span translate>Default Tasks Page</span></div><div class="setting-value col-sm-8"><select class="form-control" style="width: 100%;" ng-model="context.settings.defaultTaskPage" ng-change="setDefaultTaskPage(context.settings.defaultTaskPage)"><option value="all" translate>All Tasks</option><option value="downloading" translate>Downloading</option></select></div></div><div class="row"><div class="setting-key setting-key-without-desc col-sm-4"><span translate>Each Task List Page Uses Independent Display Order</span></div><div class="setting-value col-sm-8"><select class="form-control" style="width: 100%;" ng-model="context.settings.taskListIndependentDisplayOrder" ng-change="setTaskListIndependentDisplayOrder(context.settings.taskListIndependentDisplayOrder)" ng-options="option.value as (option.name | translate) for option in context.trueFalseOptions"></select></div></div><div class="row"><div class="setting-key setting-key-without-desc col-sm-4"><span translate>Action After Creating New Tasks</span></div><div class="setting-value col-sm-8"><select class="form-control" style="width: 100%;" ng-model="context.settings.afterCreatingNewTask" ng-change="setAfterCreatingNewTask(context.settings.afterCreatingNewTask)"><option value="task-list" translate>Navigate to Task List Page</option><option value="task-detail" translate>Navigate to Task Detail Page</option></select></div></div><div class="row"><div class="setting-key setting-key-without-desc col-sm-4"><span translate>Action After Retrying Task</span></div><div class="setting-value col-sm-8"><select class="form-control" style="width: 100%;" ng-model="context.settings.afterRetryingTask" ng-change="setAfterRetryingTask(context.settings.afterRetryingTask)"><option value="task-list-default" translate>Navigate to Default Tasks Page</option><option value="task-list-downloading" translate>Navigate to Downloading Tasks Page</option><option value="task-detail" translate>Navigate to Task Detail Page</option><option value="stay-on-current" translate>Stay on Current Page</option></select></div></div><div class="row"><div class="setting-key setting-key-without-desc col-sm-4"><span translate>Remove Old Tasks After Retrying</span></div><div class="setting-value col-sm-8"><select class="form-control" style="width: 100%;" ng-model="context.settings.removeOldTaskAfterRetrying" ng-change="setRemoveOldTaskAfterRetrying(context.settings.removeOldTaskAfterRetrying)" ng-options="option.value as (option.name | translate) for option in context.trueFalseOptions"></select></div></div><div class="row"><div class="setting-key setting-key-without-desc col-sm-4"><span translate>Confirm Task Removal</span></div><div class="setting-value col-sm-8"><select class="form-control" style="width: 100%;" ng-model="context.settings.confirmTaskRemoval" ng-change="setConfirmTaskRemoval(context.settings.confirmTaskRemoval)" ng-options="option.value as (option.name | translate) for option in context.trueFalseOptions"></select></div></div><div class="row"><div class="setting-key setting-key-without-desc col-sm-4"><span translate>Include Prefix When Copying From Task Details</span></div><div class="setting-value col-sm-8"><select class="form-control" style="width: 100%;" ng-model="context.settings.includePrefixWhenCopyingFromTaskDetails" ng-change="setIncludePrefixWhenCopyingFromTaskDetails(context.settings.includePrefixWhenCopyingFromTaskDetails)" ng-options="option.value as (option.name | translate) for option in context.trueFalseOptions"></select></div></div><div class="row"><div class="setting-key setting-key-without-desc col-sm-4"><span translate>Show Pieces Info In Task Detail Page</span></div><div class="setting-value col-sm-8"><select class="form-control" style="width: 100%;" ng-model="context.settings.showPiecesInfoInTaskDetailPage" ng-change="setShowPiecesInfoInTaskDetailPage(context.settings.showPiecesInfoInTaskDetailPage)"><option value="always" translate>Always</option><option value="le102400" translate translate-values="{value: \'102,400\'}">Pieces Amount is Less than or Equal to {value}</option><option value="le10240" translate translate-values="{value: \'10,240\'}">Pieces Amount is Less than or Equal to {value}</option><option value="le1024" translate translate-values="{value: \'1,024\'}">Pieces Amount is Less than or Equal to {value}</option><option value="never" translate>Never</option></select></div></div><div class="row"><div class="setting-key setting-key-without-desc col-sm-4"><span translate>Import / Export AriaNg Settings</span></div><div class="setting-value col-sm-8"><button class="btn btn-sm btn-default" ng-click="showImportSettingsModal()"><span translate>Import Settings</span></button> <button class="btn btn-sm btn-default" ng-click="showExportSettingsModal()"><span translate>Export Settings</span></button></div></div><div class="row tip no-background no-hover"><span class="asterisk">*</span> <span translate>Changes to the settings take effect after refreshing page.</span> <button class="btn btn-xs btn-default" ng-click="resetSettings()"><span translate>Reset Settings</span></button> <button class="btn btn-xs btn-default" ng-click="clearHistory()"><span translate>Clear Settings History</span></button> <button class="btn btn-xs btn-default" ng-click="resetAria2Settings()"><span translate>Reset Aria2 Settings</span></button></div></div></div><div class="tab-pane" ng-repeat="setting in context.rpcSettings" ng-class="{\'active\': isCurrentRpcTab($index)}"><div class="settings-table striped hoverable"><div class="row"><div class="setting-key setting-key-without-desc col-sm-4"><span translate>Aria2 RPC Alias</span> <span class="asterisk">*</span></div><div class="setting-value col-sm-8"><input class="form-control" type="text" ng-placeholder="(setting.rpcHost ? setting.rpcHost + \':\' + setting.rpcPort : \'\')" ng-model="setting.rpcAlias" ng-change="updateRpcSetting(setting, \'rpcAlias\')"></div></div><div class="row"><div class="setting-key setting-key-without-desc col-sm-4"><span translate>Aria2 RPC Address</span> <span class="asterisk">*</span></div><div class="setting-value col-sm-8"><div class="input-group input-group-multiple"><span class="input-group-append input-group-text" ng-bind="setting.protocol + \'://\'"></span> <input class="form-control" type="text" ng-model="setting.rpcHost" ng-change="updateRpcSetting(setting, \'rpcHost\')"> <span class="input-group-append input-group-text">:</span><div class="input-group-append-container"><input class="form-control form-control-rpcport" type="text" ng-model="setting.rpcPort" ng-change="updateRpcSetting(setting, \'rpcPort\')"></div><span class="input-group-append input-group-text">/</span><div class="input-group-append-container"><input class="form-control form-control-rpcinterface" type="text" ng-model="setting.rpcInterface" ng-change="updateRpcSetting(setting, \'rpcInterface\')"></div></div></div></div><div class="row"><div class="setting-key setting-key-without-desc col-sm-4"><span translate>Aria2 RPC Protocol</span> <span class="asterisk">*</span> <i class="icon-primary fa fa-question-circle" ng-tooltip-container="body" ng-tooltip-placement="top" ng-tooltip="{{\'Insecure Http and WebSocket would be disabled when accessing AriaNg via Https.\' | translate}}"></i></div><div class="setting-value col-sm-8"><select class="form-control" style="width: 100%;" ng-model="setting.protocol" ng-change="updateRpcSetting(setting, \'protocol\')"><option value="http" ng-disabled="ifDisableInsecureProtocol(setting.rpcHost)" ng-bind="(\'Http\' + (ifDisableInsecureProtocol(setting.rpcHost) ? \' (Disabled)\' : \'\')) | translate">Http</option><option value="https" translate>Https</option><option value="ws" ng-disabled="ifDisableInsecureProtocol(setting.rpcHost)" ng-bind="(\'WebSocket\' + (ifDisableInsecureProtocol(setting.rpcHost) ? \' (Disabled)\' : \'\')) | translate">WebSocket</option><option value="wss" translate>WebSocket (Security)</option></select></div></div><div class="row" ng-if="setting.protocol === \'http\' || setting.protocol === \'https\'"><div class="setting-key setting-key-without-desc col-sm-4"><span translate>Aria2 RPC Http Request Method</span> <span class="asterisk">*</span> <i class="icon-primary fa fa-question-circle" ng-tooltip-container="body" ng-tooltip-placement="top" ng-tooltip="{{\'POST method only supports aria2 v1.15.2 and above.\' | translate}}"></i></div><div class="setting-value col-sm-8"><select class="form-control" style="width: 100%;" ng-model="setting.httpMethod" ng-change="updateRpcSetting(setting, \'httpMethod\')"><option value="POST" translate>POST</option><option value="GET" translate>GET</option></select></div></div><div class="row" ng-if="setting.protocol === \'http\' || setting.protocol === \'https\'"><div class="setting-key setting-key-without-desc col-sm-4"><span translate>Aria2 RPC Request Headers</span> <span class="asterisk">*</span></div><div class="setting-value col-sm-8"><textarea class="form-control" style="width: 100%;" rows="4" ng-model="setting.rpcRequestHeaders" ng-change="updateRpcSetting(setting, \'rpcRequestHeaders\')" ng-placeholder="\'Support multiple request headers, one header per line, each line containing "header name: header value".\' | translate"></textarea></div></div><div class="row"><div class="setting-key setting-key-without-desc col-sm-4"><span translate>Aria2 RPC Secret Token</span> <span class="asterisk">*</span></div><div class="setting-value col-sm-8"><div class="input-group"><input class="form-control" type="{{context.showRpcSecret ? \'text\' : \'password\'}}" ng-model="setting.secret" ng-change="updateRpcSetting(setting, \'secret\')"> <span class="input-group-append input-group-append-compact no-vertical-padding"><button class="btn btn-xs btn-default" title="{{context.showRpcSecret ? \'Hide Secret\' : \'Show Secret\' | translate}}" ng-class="{\'active\': context.showRpcSecret}" ng-click="context.showRpcSecret = !context.showRpcSecret"><i class="fa fa-eye"></i></button></span></div></div></div><div class="row"><div class="setting-key setting-key-without-desc col-sm-4"><span translate>Export Command API</span></div><div class="setting-value col-sm-8"><button class="btn btn-sm btn-default" ng-click="showExportCommandAPIModal(setting)"><span translate>Export</span></button></div></div><div class="row tip no-background no-hover"><span class="asterisk">*</span> <span translate>Changes to the settings take effect after refreshing page.</span> <button class="btn btn-xs btn-default" ng-disabled="setting.isDefault" ng-click="setDefaultRpcSetting(setting)"><span translate>Activate</span></button></div></div></div></div></div><div id="import-settings-modal" class="modal fade" tabindex="-1" role="dialog"><div class="modal-dialog modal-lg" role="document"><div class="modal-content"><div class="modal-header"><h4 class="modal-title"><span translate>Import Settings</span> <small><a class="pointer-cursor" title="{{\'Open\' | translate}}" ng-click="openAriaNgConfigFile()"><i class="icon-primary fa fa-folder-open-o"></i></a></small></h4><button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button></div><div class="modal-body no-padding"><div class="settings-table striped"><input id="import-file-holder" type="file" style="display: none"> <textarea class="form-control" ng-model="context.importSettings" rows="20" ng-placeholder="\'AriaNg settings data\' | translate"></textarea></div></div><div class="modal-footer"><button type="button" class="btn btn-primary" ng-disabled="!context.importSettings || !context.importSettings.length" ng-click="importSettings(context.importSettings)" translate>Import</button> <button type="button" class="btn btn-default" data-dismiss="modal" translate>Cancel</button></div></div></div></div><div id="export-settings-modal" class="modal fade" tabindex="-1" role="dialog"><div class="modal-dialog modal-lg" role="document"><div class="modal-content"><div class="modal-header"><h4 class="modal-title"><span translate>Export Settings</span> <small><a class="pointer-cursor" title="{{\'Save\' | translate}}" ng-if="context.isSupportBlob" ng-blob-download="context.exportSettings" ng-file-name="AriaNgConfig.json" ng-content-type="application/json"><i class="icon-primary fa fa-save"></i> </a><a class="pointer-cursor" title="{{\'Copy\' | translate}}" ng-click="copyExportSettings()"><i class="icon-primary fa fa-copy"></i> </a><span class="label label-default fade-in" ng-if="context.exportSettingsCopied" translate>Data has been copied to clipboard.</span></small></h4><button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button></div><div class="modal-body no-padding"><div class="settings-table striped"><textarea class="form-control" ng-model="context.exportSettings" rows="20" readonly="readonly"></textarea></div></div><div class="modal-footer"><button type="button" class="btn btn-default" data-dismiss="modal" translate>Cancel</button></div></div></div></div><ng-export-command-api-dialog options="context.exportCommandApiOptions"></ng-export-command-api-dialog></section>'),e.put("views/status.html",'<section class="content no-padding"><div class="settings-table striped hoverable"><div class="row"><div class="setting-key col-sm-4"><span translate>Aria2 RPC Address</span></div><div class="setting-value col-sm-8"><span ng-bind="context.host"></span></div></div><div class="row"><div class="setting-key col-sm-4"><span translate>Aria2 Status</span></div><div class="setting-value col-sm-8"><span class="badge" ng-class="{\'badge-primary\': taskContext.rpcStatus === \'Connecting\' || taskContext.rpcStatus === \'Reconnecting\', \'badge-secondary\': taskContext.rpcStatus === \'Waiting to reconnect\', \'badge-success\': taskContext.rpcStatus === \'Connected\', \'badge-danger\': taskContext.rpcStatus === \'Disconnected\'}" ng-bind="taskContext.rpcStatus | translate"></span></div></div><div class="row ng-cloak"><div class="setting-key col-sm-4"><span>Session ID</span></div><div class="setting-value col-sm-8"><span ng-if="!context.serverStatus && (taskContext.rpcStatus === \'Connecting\' || taskContext.rpcStatus === \'Reconnecting\' || taskContext.rpcStatus === \'Connected\')"><i class="fa fa-spinner fa-spin"></i></span> <span ng-if="!context.sessionId && !(taskContext.rpcStatus === \'Connecting\' || taskContext.rpcStatus === \'Reconnecting\' || taskContext.rpcStatus === \'Connected\')">-</span> <span ng-if="context.sessionInfo" ng-bind="context.sessionInfo.sessionId"></span></div></div><div class="row ng-cloak"><div class="setting-key col-sm-4"><span translate>Aria2 Version</span></div><div class="setting-value col-sm-8"><span ng-if="!context.serverStatus && (taskContext.rpcStatus === \'Connecting\' || taskContext.rpcStatus === \'Reconnecting\' || taskContext.rpcStatus === \'Connected\')"><i class="fa fa-spinner fa-spin"></i></span> <span ng-if="!context.serverStatus && !(taskContext.rpcStatus === \'Connecting\' || taskContext.rpcStatus === \'Reconnecting\' || taskContext.rpcStatus === \'Connected\')">-</span> <span ng-if="context.serverStatus" ng-bind="context.serverStatus.version"></span></div></div><div class="row ng-cloak"><div class="setting-key col-sm-4"><span translate>Enabled Features</span></div><div class="setting-value col-sm-8"><span ng-if="!context.serverStatus && (taskContext.rpcStatus === \'Connecting\' || taskContext.rpcStatus === \'Reconnecting\' || taskContext.rpcStatus === \'Connected\')"><i class="fa fa-spinner fa-spin"></i></span> <span ng-if="!context.serverStatus && !(taskContext.rpcStatus === \'Connecting\' || taskContext.rpcStatus === \'Reconnecting\' || taskContext.rpcStatus === \'Connected\')">-</span><div class="checkbox checkbox-primary default-cursor" ng-if="context.serverStatus" ng-repeat="feature in context.serverStatus.enabledFeatures"><input id="{{\'feature_\' + $index}}" type="checkbox" checked="checked" disabled="disabled" class="default-cursor"> <label for="{{\'feature_\' + $index}}" class="text-cursor"><span ng-bind="feature"></span></label></div></div></div><div class="row ng-cloak" ng-if="context.serverStatus || context.isSupportReconnect"><div class="setting-key setting-key-without-desc col-sm-4"><span translate>Operations</span></div><div class="setting-value col-sm-8"><button class="btn btn-sm btn-primary" ng-if="context.isSupportReconnect" ng-disabled="taskContext.rpcStatus !== \'Disconnected\' && taskContext.rpcStatus !== \'Waiting to reconnect\'" ng-click="reconnect()" promise-btn><span translate>Reconnect</span></button> <button class="btn btn-sm btn-primary" ng-if="context.serverStatus" ng-click="saveSession()" promise-btn><span translate>Save Session</span></button> <button class="btn btn-sm btn-danger promise-btn-style" ng-if="context.serverStatus" ng-click="shutdown()"><span translate>Shutdown Aria2</span></button></div></div></div></section>'),e.put("views/task-detail.html",'<section class="content no-padding"><div class="nav-tabs-custom"><ul class="nav nav-tabs" ng-if="task"><li class="nav-item" ng-class="{\'active\': context.currentTab === \'overview\'}"><a class="nav-link pointer-cursor" ng-click="changeTab(\'overview\')" translate>Overview</a></li><li class="nav-item" ng-class="{\'active\': context.currentTab === \'pieces\'}" ng-if="context.showPiecesInfo"><a class="nav-link pointer-cursor" ng-click="changeTab(\'pieces\')" translate>Pieces</a></li><li class="nav-item" ng-class="{\'active\': context.currentTab === \'filelist\'}"><a class="nav-link pointer-cursor" ng-click="changeTab(\'filelist\')" translate>Files</a></li><li class="nav-item" ng-class="{\'active\': context.currentTab === \'btpeers\'}" ng-if="task && task.status === \'active\' && task.bittorrent"><a class="nav-link pointer-cursor" ng-click="changeTab(\'btpeers\')" translate>Peers</a></li><li class="nav-item" ng-class="{\'active\': context.currentTab === \'settings\'}" ng-if="task && (task.status === \'active\' || task.status === \'waiting\' || task.status === \'paused\')" class="slim"><a class="nav-link pointer-cursor" ng-click="changeTab(\'settings\')"><i class="nav-icon fa fa-gear"></i></a></li><li class="nav-item" class="slim"><a class="nav-link pointer-cursor" ng-click="backHome()" title="Back"><i class="nav-icon fa fa-reply"></i></a></li></ul><div class="tab-content no-padding"><div class="tab-pane" ng-class="{\'active\': context.currentTab === \'overview\'}"><div id="overview-items" class="settings-table striped hoverable" ng-mousedown="onOverviewMouseDown()" data-toggle="context" data-target="#task-overview-contextmenu"><div class="row" ng-if="task"><div class="setting-key col-sm-4"><span translate>Task Name</span></div><div class="setting-value col-sm-8"><span class="allow-word-break" ng-bind="task.taskName" ng-tooltip-container="body" ng-tooltip-placement="bottom" ng-tooltip="{{(task.bittorrent && task.bittorrent.comment) ? task.bittorrent.comment : task.taskName}}"></span></div></div><div class="row" ng-if="task"><div class="setting-key col-sm-4"><span translate>Task Size</span></div><div class="setting-value col-sm-8"><span ng-bind="task.totalLength | readableVolume"></span> <a class="pointer-cursor" ng-if="task.files" ng-click="changeTab(\'filelist\')"><span ng-bind="(\'format.settings.file-count\' | translate: {count: task.selectedFileCount})"></span></a></div></div><div class="row" ng-if="task"><div class="setting-key col-sm-4"><span translate>Task Status</span></div><div class="setting-value col-sm-8"><span ng-bind="task | taskStatus | translate: {errorcode: task.errorCode, verifiedPercent: task.verifiedPercent}"></span> <i class="icon-primary fa fa-question-circle" ng-if="task.errorCode && task.errorCode != \'0\' && task.errorMessage" ng-tooltip="{{task.errorMessage}}" ng-tooltip-container="body" ng-tooltip-placement="top"></i></div></div><div class="row" ng-if="task && task.status === \'error\' && task.errorDescription"><div class="setting-key col-sm-4"><span translate>Error Description</span></div><div class="setting-value col-sm-8"><span ng-bind="task.errorDescription | translate"></span></div></div><div class="row" ng-if="task"><div class="setting-key col-sm-4"><span ng-bind="(\'Progress\' | translate) + (task.status === \'active\' && task.bittorrent ? \' (\' + (\'Health Percentage\' | translate) + \')\' : \'\')"></span></div><div class="setting-value col-sm-8"><span ng-bind="(task.completePercent | percent: 2) + \'%\' + (task.status === \'active\' && task.bittorrent ? \' (\' + (context.healthPercent | percent: 2) + \'%\' + \')\' : \'\')"></span></div></div><div class="row" ng-if="task"><div class="setting-key col-sm-4"><span translate>Download</span></div><div class="setting-value col-sm-8"><span ng-bind="(task.completedLength | readableVolume) + (task.status === \'active\' ? \' @ \' + (task.downloadSpeed | readableVolume) + \'/s\' : \'\')"></span></div></div><div class="row" ng-if="task && task.bittorrent"><div class="setting-key col-sm-4"><span translate>Upload</span></div><div class="setting-value col-sm-8"><span ng-bind="(task.uploadLength | readableVolume) + (task.status === \'active\' ? \' @ \' + (task.uploadSpeed | readableVolume) + \'/s\' : \'\')"></span></div></div><div class="row" ng-if="task && task.bittorrent"><div class="setting-key col-sm-4"><span translate>Share Ratio</span></div><div class="setting-value col-sm-8"><span ng-bind="(task.shareRatio | number: 2)"></span></div></div><div class="row" ng-if="task && task.status === \'active\' && task.completedLength < task.totalLength"><div class="setting-key col-sm-4"><span translate>Remaining</span></div><div class="setting-value col-sm-8"><span ng-bind="0 <= task.remainTime && task.remainTime < 86400? (task.remainTime | dateDuration: \'second\': \'HH:mm:ss\') : (\'More Than One Day\' | translate)"></span></div></div><div class="row" ng-if="task && task.status === \'active\'"><div class="setting-key col-sm-4"><span ng-bind="(task.bittorrent ? (\'Seeders\' | translate) + \' / \' : \'\') + (\'Connections\' | translate)">Connections</span></div><div class="setting-value col-sm-8"><span ng-bind="(task.numSeeders ? (task.numSeeders + \' / \') : \'\') + task.connections"></span></div></div><div class="row" ng-if="task && task.bittorrent && task.bittorrent.creationDate"><div class="setting-key col-sm-4"><span translate>Seed Creation Time</span></div><div class="setting-value col-sm-8"><span ng-bind="task.bittorrent.creationDate | amFromUnix | longDate"></span></div></div><div class="row" ng-if="task && task.infoHash"><div class="setting-key col-sm-4"><span translate>Info Hash</span></div><div class="setting-value col-sm-8"><span class="allow-word-break" ng-bind="task.infoHash"></span></div></div><div class="row" ng-if="task && task.singleUrl"><div class="setting-key col-sm-4"><span translate>Download Url</span></div><div class="setting-value col-sm-8"><span class="allow-word-break" ng-bind="task.singleUrl"></span></div></div><div class="row" ng-if="task"><div class="setting-key col-sm-4"><span translate>Download Dir</span></div><div class="setting-value col-sm-8"><span class="allow-word-break"><a ng-if="isWindows && isRpcLocalhost" href="aria2://browse/path={{task.dir+task.taskName}}">{{task.dir}}</a> <a ng-if="!isWindows && isRpcLocalhost" href="file://{{task.dir}}">{{task.dir}}</a> <span ng-if="!isRpcLocalhost">{{task.dir}}</span></span></div></div><div class="row" ng-if="task && task.bittorrent && task.bittorrent.announceList && task.bittorrent.announceList.length > 0"><div class="setting-key col-sm-4"><span translate>BT Tracker Servers</span> <em class="description-inline" ng-bind="\'format.settings.total-count\' | translate: {count: task.bittorrent.announceList.length}"></em> <i class="icon-expand pointer-cursor fa align-middle" ng-if="task.bittorrent.announceList.length > 1" ng-class="{\'fa-plus\': context.collapseTrackers, \'fa-minus\': !context.collapseTrackers}" ng-click="context.collapseTrackers = !context.collapseTrackers" title="{{(context.collapseTrackers ? \'Expand\' : \'Collapse\') | translate}}"></i></div><div class="setting-value col-sm-8"><span class="multi-line auto-ellipsis" ng-bind="serverAddress.length ? serverAddress.join(\',\') : serverAddress" title="{{serverAddress.length ? serverAddress.join(\',\') : serverAddress}}" ng-repeat="serverAddress in task.bittorrent.announceList | limitTo: (context.collapseTrackers ? 1 : task.bittorrent.announceList.length)"></span></div></div></div><div class="settings-table"><div class="row no-hover no-background" ng-if="context.isEnableSpeedChart && task && task.status === \'active\'"><div class="col-sm-12"><div class="task-status-chart-wrapper"><ng-chart ng-data="context.statusData" ng-theme="currentTheme" height="200"></ng-chart></div></div></div></div></div><div class="tab-pane" ng-class="{\'active\': context.currentTab === \'pieces\'}" ng-if="context.showPiecesInfo"><div class="piece-legends"><div class="piece-legend" title="{{(\'format.task.pieceinfo\' | translate: {completed: task.completedPieces, total: task.numPieces})}}"><div class="piece piece-completed"></div><span translate>Completed</span></div><div class="piece-legend" title="{{(\'format.task.pieceinfo\' | translate: {completed: task.completedPieces, total: task.numPieces})}}"><div class="piece"></div><span translate>Uncompleted</span></div></div><ng-piece-map bit-field="task.bitfield" piece-count="task.numPieces"></ng-piece-map></div><div class="tab-pane" ng-class="{\'active\': context.currentTab === \'filelist\'}"><div class="task-table"><div class="task-table-title"><div class="row"><div class="col-sm-8"><a ng-click="changeFileListDisplayOrder(\'name:asc\', true)" ng-class="{true: \'default-cursor\'}[task.multiDir]"><span translate>File Name</span><i ng-if="!task.multiDir" class="fa fa-display-order" ng-class="{\'fa-sort-asc fa-order-asc\': isSetFileListDisplayOrder(\'name:asc\'), \'fa-sort-desc fa-order-desc\': isSetFileListDisplayOrder(\'name:desc\')}"></i> </a><button ng-click="showChooseFilesToolbar()" ng-if="task && task.files && task.files.length > 1 && (task.status === \'waiting\' || task.status === \'paused\')" class="btn btn-xs btn-default"><i class="fa fa-filter"></i> <span translate>Filters</span></button></div><div class="col-sm-2"><a ng-click="changeFileListDisplayOrder(\'percent:desc\', true)" ng-class="{true: \'default-cursor\'}[task.multiDir]"><span translate>Progress</span><i ng-if="!task.multiDir" class="fa fa-display-order" ng-class="{\'fa-sort-asc fa-order-asc\': isSetFileListDisplayOrder(\'percent:asc\'), \'fa-sort-desc fa-order-desc\': isSetFileListDisplayOrder(\'percent:desc\')}"></i></a></div><div class="col-sm-2"><a ng-click="changeFileListDisplayOrder(\'size:asc\', true)" ng-class="{true: \'default-cursor\'}[task.multiDir]"><span translate>File Size</span><i ng-if="!task.multiDir" class="fa fa-display-order" ng-class="{\'fa-sort-asc fa-order-asc\': isSetFileListDisplayOrder(\'size:asc\'), \'fa-sort-desc fa-order-desc\': isSetFileListDisplayOrder(\'size:desc\')}"></i></a></div></div></div><div class="task-table-title" ng-if="context.showChooseFilesToolbar"><div class="row"><div class="col-sm-12"><div class="btn-group"><button type="button" class="btn btn-primary btn-xs" ng-click="selectFiles(\'auto\')" ng-bind="(isAllFileSelected() ? \'Select None\' : \'Select All\') | translate">Select All</button> <button type="button" class="btn btn-primary btn-xs dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><span class="caret"></span></button><ul class="dropdown-menu"><li><a class="dropdown-item" href="javascript:void(0);" ng-click="selectFiles(\'all\')" translate>Select All</a></li><li><a class="dropdown-item" href="javascript:void(0);" ng-click="selectFiles(\'none\')" translate>Select None</a></li><li><a class="dropdown-item" href="javascript:void(0);" ng-click="selectFiles(\'reverse\')" translate>Select Invert</a></li></ul></div><button class="btn btn-xs btn-default" ng-click="chooseSpecifiedFiles(\'video\')"><i class="fa fa-file-video-o"></i> <span translate>Videos</span></button> <button class="btn btn-xs btn-default" ng-click="chooseSpecifiedFiles(\'audio\')"><i class="fa fa-file-audio-o"></i> <span translate>Audios</span></button> <button class="btn btn-xs btn-default" ng-click="chooseSpecifiedFiles(\'picture\')"><i class="fa fa-file-picture-o"></i> <span translate>Pictures</span></button> <button class="btn btn-xs btn-default" ng-click="chooseSpecifiedFiles(\'document\')"><i class="fa fa-file-text-o"></i> <span translate>Documents</span></button> <button class="btn btn-xs btn-default" ng-click="chooseSpecifiedFiles(\'application\')"><i class="fa fa-file-o"></i> <span translate>Applications</span></button> <button class="btn btn-xs btn-default" ng-click="chooseSpecifiedFiles(\'archive\')"><i class="fa fa-file-archive-o"></i> <span translate>Archives</span></button> <button class="btn btn-xs btn-default" ng-click="showCustomChooseFileModal()"><i class="fa fa-filter"></i> <span translate>Custom</span></button> <button class="btn btn-xs btn-success" ng-click="saveChosenFiles()" ng-disabled="!isAnyFileSelected()" translate>Confirm</button> <button class="btn btn-xs btn-secondary" ng-click="cancelChooseFiles()" translate>Cancel</button></div></div></div><div class="task-table-body"><div class="row align-items-center" ng-repeat="file in task.files | fileOrderBy: getFileListOrderType()" data-toggle="context" data-target="#task-filelist-contextmenu" ng-if="!context.collapsedDirs[file.relativePath]" data-file-index="{{file.index}}"><div class="col-sm-10" ng-if="file.isDir" style="{{(task.multiDir ? (\'padding-left: \' + file.level + \'rem\') : \'\')}}"><i class="icon-dir-expand fa" ng-click="collapseDir(file)" ng-class="{true: \'fa-plus\', false: \'fa-minus\'}[!!context.collapsedDirs[file.nodePath]]" title="{{(context.collapsedDirs[file.nodePath] ? \'Expand\' : \'Collapse\') | translate}}"></i><div class="checkbox checkbox-primary checkbox-inline"><input id="{{\'node_\' + file.nodePath}}" type="checkbox" ng-disabled="!task || !task.files || task.files.length <= 1 || (task.status !== \'waiting\' && task.status !== \'paused\')" ng-model="file.selected" ng-indeterminate="file.partialSelected" ng-change="setSelectedNode(file)"> <label for="{{\'node_\' + file.nodePath}}" class="allow-word-break" ng-bind="file.nodeName" title="{{file.nodeName}}"></label></div></div><div class="col-sm-8" ng-if="!file.isDir" style="{{(task.multiDir ? (\'padding-left: \' + (0.812 + 0.5 + file.level) + \'rem\') : \'\')}}"><div class="checkbox checkbox-primary"><input id="{{\'file_\' + file.index}}" type="checkbox" ng-disabled="!task || !task.files || task.files.length <= 1 || (task.status !== \'waiting\' && task.status !== \'paused\')" ng-model="file.selected" ng-change="setSelectedFile(true)"> <label for="{{\'file_\' + file.index}}" class="allow-word-break" ng-bind="file.fileName" title="{{file.fileName}}"></label></div></div><div class="col-sm-2" ng-if="!file.isDir"><div class="progress"><div class="progress-bar progress-bar-primary" role="progressbar" aria-valuenow="{{file.completePercent}}" aria-valuemin="1" aria-valuemax="100" ng-style="{ width: file.completePercent + \'%\' }"><span ng-class="{\'progress-lower\': file.completePercent < 50}" ng-bind="(file.completePercent | percent: 2) + \'%\'"></span></div></div></div><div class="col-sm-2"><span class="task-size" ng-bind="file.length | readableVolume"></span></div></div></div></div></div><div class="tab-pane" ng-class="{\'active\': context.currentTab === \'btpeers\'}" ng-if="task && task.status === \'active\' && task.bittorrent"><div class="task-table"><div class="task-table-title"><div class="row"><div class="col-md-4 col-sm-4"><a ng-click="changePeerListDisplayOrder(\'address:asc\', true)"><span translate>Address</span><i class="fa fa-display-order" ng-class="{\'fa-sort-asc fa-order-asc\': isSetPeerListDisplayOrder(\'address:asc\'), \'fa-sort-desc fa-order-desc\': isSetPeerListDisplayOrder(\'address:desc\')}"></i> </a><span>/</span> <a ng-click="changePeerListDisplayOrder(\'client:asc\', true)"><span translate>Client</span><i class="fa fa-display-order" ng-class="{\'fa-sort-asc fa-order-asc\': isSetPeerListDisplayOrder(\'client:asc\'), \'fa-sort-desc fa-order-desc\': isSetPeerListDisplayOrder(\'client:desc\')}"></i></a></div><div class="col-md-5 col-sm-4"><div class="row"><div class="col-sm-6"><span translate>Status</span></div><div class="col-sm-6 text-right"><a ng-click="changePeerListDisplayOrder(\'percent:desc\', true)"><span translate>Progress</span><i class="fa fa-display-order" ng-class="{\'fa-sort-asc fa-order-asc\': isSetPeerListDisplayOrder(\'percent:asc\'), \'fa-sort-desc fa-order-desc\': isSetPeerListDisplayOrder(\'percent:desc\')}"></i></a></div></div></div><div class="col-md-3 col-sm-4"><a ng-click="changePeerListDisplayOrder(\'dspeed:desc\', true)"><span translate>Download</span><i class="fa fa-display-order" ng-class="{\'fa-sort-asc fa-order-asc\': isSetPeerListDisplayOrder(\'dspeed:asc\'), \'fa-sort-desc fa-order-desc\': isSetPeerListDisplayOrder(\'dspeed:desc\')}"></i> </a><span>/</span> <a ng-click="changePeerListDisplayOrder(\'uspeed:desc\', true)"><span translate>Upload</span><i class="fa fa-display-order" ng-class="{\'fa-sort-asc fa-order-asc\': isSetPeerListDisplayOrder(\'uspeed:asc\'), \'fa-sort-desc fa-order-desc\': isSetPeerListDisplayOrder(\'uspeed:desc\')}"></i> </a><span translate>Speed</span></div></div></div><div class="task-table-body"><div class="row align-items-center" ng-repeat="peer in context.btPeers | peerOrderBy: getPeerListOrderType()" data-toggle="context" data-target="#task-peerlist-contextmenu"><div class="col-md-4 col-sm-4 col-12"><div class="peer-name-wrapper auto-ellipsis" title="{{(peer.client ? peer.client.info : \'\') + (peer.seeder ? (peer.client.info ? \', \' : \'\') + (\'Seeding\' | translate) : \'\')}}"><span ng-bind="peer.name | translate"></span><i class="icon-seeder fa fa-angle-double-up" ng-if="peer && peer.seeder"></i> <span class="peer-client" ng-if="!!peer.client" ng-bind="peer.client ? (\'(\' + peer.client.name + (peer.client.version ? \' \' + peer.client.version : \'\') + \')\') : \'\'"></span></div></div><div class="col-md-5 col-sm-4 col-12"><div class="row"><div class="col-md-9 col-sm-7 col-12"><div class="piece-bar-wrapper"><ng-piece-bar bit-field="peer.bitfield" piece-count="task.numPieces" color="#208fe5"></ng-piece-bar></div></div><div class="col-md-3 col-sm-5 d-none d-sm-block text-right"><span ng-bind="(peer.completePercent | percent: 2) + \'%\'"></span></div></div></div><div class="d-block d-sm-none col-4"><span ng-bind="(peer.completePercent | percent: 2) + \'%\'"></span></div><div class="col-md-3 col-sm-4 col-8"><div class="task-peer-download-speed"><i class="icon-download fa fa-arrow-down"></i> <span ng-bind="(peer.downloadSpeed | readableVolume) + \'/s\'"></span> <i class="icon-upload fa fa-arrow-up"></i> <span ng-bind="(peer.uploadSpeed | readableVolume) + \'/s\'"></span></div></div></div><div class="row" ng-if="!context.btPeers || context.btPeers.length < 1"><div class="col-sm-12 text-center"><span translate>No connected peers</span></div></div></div></div></div><div class="tab-pane" ng-class="{\'active\': context.currentTab === \'settings\'}" ng-if="task && (task.status === \'active\' || task.status === \'waiting\' || task.status === \'paused\')"><div class="settings-table striped hoverable"><ng-setting ng-repeat="option in context.availableOptions" option="option" ng-model="context.options[option.key]" default-value="option.defaultValue" on-change-value="setOption(key, value, optionStatus)"></ng-setting></div></div></div></div>\x3c!-- /.nav-tabs-custom --\x3e<div id="task-overview-contextmenu"><ul class="dropdown-menu" role="menu"><li><a id="mnu-overview-copy" tabindex="-1" class="dropdown-item mnu-copy pointer-cursor" title="{{\'Copy\' | translate}}" ng-click="copySelectedRowText()"><i class="fa fa-copy fa-fw"></i> <span translate>Copy</span></a></li></ul></div><div id="task-filelist-contextmenu"><ul class="dropdown-menu" role="menu"><li ng-if="task.multiDir"><a tabindex="-1" class="dropdown-item pointer-cursor" title="{{\'Expand All\' | translate}}" ng-click="collapseAllDirs(false)"><i class="fa fa-plus fa-fw"></i> <span translate>Expand All</span></a></li><li ng-if="task.multiDir"><a tabindex="-1" class="dropdown-item pointer-cursor" title="{{\'Collapse All\' | translate}}" ng-click="collapseAllDirs(true)"><i class="fa fa-minus fa-fw"></i> <span translate>Collapse All</span></a></li><li class="dropdown dropdown-submenu" ng-if="!task.multiDir"><a class="dropdown-item" tabindex="-1" title="{{\'Display Order\' | translate}}" href="javascript:void(0);"><i class="fa fa-sort-alpha-asc fa-fw"></i> <span translate>Display Order</span></a><ul class="dropdown-menu"><li><a class="dropdown-item pointer-cursor" ng-click="changeFileListDisplayOrder(\'default:asc\')"><span translate>Default</span> <i class="fa fa-fw" ng-class="{\'fa-check\': isSetFileListDisplayOrder(\'default\')}"></i></a></li><li><a class="dropdown-item pointer-cursor" ng-click="changeFileListDisplayOrder(\'name:asc\')"><span translate>By File Name</span> <i class="fa fa-fw" ng-class="{\'fa-check\': isSetFileListDisplayOrder(\'name\')}"></i></a></li><li><a class="dropdown-item pointer-cursor" ng-click="changeFileListDisplayOrder(\'percent:desc\')"><span translate>By Progress</span> <i class="fa fa-fw" ng-class="{\'fa-check\': isSetFileListDisplayOrder(\'percent\')}"></i></a></li><li><a class="dropdown-item pointer-cursor" ng-click="changeFileListDisplayOrder(\'size:asc\')"><span translate>By File Size</span> <i class="fa fa-fw" ng-class="{\'fa-check\': isSetFileListDisplayOrder(\'size\')}"></i></a></li><li><a class="dropdown-item pointer-cursor" ng-click="changeFileListDisplayOrder(\'selected:desc\')"><span translate>By Selected Status</span> <i class="fa fa-fw" ng-class="{\'fa-check\': isSetFileListDisplayOrder(\'selected\')}"></i></a></li></ul></li></ul></div><div id="task-peerlist-contextmenu"><ul class="dropdown-menu" role="menu"><li class="dropdown dropdown-submenu"><a class="dropdown-item" tabindex="-1" title="{{\'Display Order\' | translate}}" href="javascript:void(0);"><i class="fa fa-sort-alpha-asc fa-fw"></i> <span translate>Display Order</span></a><ul class="dropdown-menu"><li><a class="dropdown-item pointer-cursor" ng-click="changePeerListDisplayOrder(\'default:asc\')"><span translate>Default</span> <i class="fa fa-fw" ng-class="{\'fa-check\': isSetPeerListDisplayOrder(\'default\')}"></i></a></li><li><a class="dropdown-item pointer-cursor" ng-click="changePeerListDisplayOrder(\'address:asc\')"><span translate>By Peer Address</span> <i class="fa fa-fw" ng-class="{\'fa-check\': isSetPeerListDisplayOrder(\'address\')}"></i></a></li><li><a class="dropdown-item pointer-cursor" ng-click="changePeerListDisplayOrder(\'client:asc\')"><span translate>By Client Name</span> <i class="fa fa-fw" ng-class="{\'fa-check\': isSetPeerListDisplayOrder(\'client\')}"></i></a></li><li><a class="dropdown-item pointer-cursor" ng-click="changePeerListDisplayOrder(\'percent:desc\')"><span translate>By Progress</span> <i class="fa fa-fw" ng-class="{\'fa-check\': isSetPeerListDisplayOrder(\'percent\')}"></i></a></li><li><a class="dropdown-item pointer-cursor" ng-click="changePeerListDisplayOrder(\'dspeed:desc\')"><span translate>By Download Speed</span> <i class="fa fa-fw" ng-class="{\'fa-check\': isSetPeerListDisplayOrder(\'dspeed\')}"></i></a></li><li><a class="dropdown-item pointer-cursor" ng-click="changePeerListDisplayOrder(\'uspeed:desc\')"><span translate>By Upload Speed</span> <i class="fa fa-fw" ng-class="{\'fa-check\': isSetPeerListDisplayOrder(\'uspeed\')}"></i></a></li></ul></li></ul></div><div id="custom-choose-file-modal" class="modal fade" tabindex="-1" role="dialog"><div class="modal-dialog" role="document"><div class="modal-content"><div class="modal-header"><h4 class="modal-title" translate>Custom Choose File</h4><button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button></div><div class="modal-body no-padding"><div class="settings-table striped hoverable"><div class="row" ng-repeat="(extensionTypeName, extensionTypeInfo) in context.fileExtensions"><div class="setting-key setting-key-without-desc col-sm-4" ng-bind="extensionTypeInfo.name | translate"></div><div class="setting-value col-sm-8"><div class="checkbox checkbox-primary checkbox-inline" ng-repeat="info in extensionTypeInfo.extensions"><input id="{{info.extension}}" type="checkbox" ng-model="info.selected" ng-indeterminate="info.selectedCount > 0 && info.unSelectedCount > 0" ng-change="setSelectedExtension(info.extension, info.selected)"> <label for="{{info.extension}}" ng-bind="info.extension || \' \'"></label></div></div></div></div></div><div class="modal-footer"><button type="button" class="btn btn-default" data-dismiss="modal" translate>Close</button></div></div></div></div></section>')}]);
|