text: /*!
   * AriaNg
   * https://github.com/mayswind/AriaNg
   */
  !function(){"use strict";if(function(){var e=navigator.appName,t=navigator.appVersion.split(";"),a=t&&t.length>1?t[1].replace(/[ ]/g,""):"";return"Microsoft Internet Explorer"===e&&("MSIE6.0"===a||"MSIE7.0"===a||"MSIE8.0"===a||"MSIE9.0"===a)}()){var e=document.createElement("div");e.className="alert alert-danger",e.innerHTML="Sorry, AriaNg cannot support this browser, please upgrade your browser!",document.getElementById("content-wrapper").appendChild(e)}}(),function(){"use strict";$.AdminLTE.options.animationSpeed=300}(),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","ab-base64","LocalStorageModule","notification","ui-notification","angularBittorrentPeerid","cgBusy","angularPromiseButtons","oitozero.ngSweetAlert",angularDragula(angular)])}(),function(){"use strict";angular.module("ariaNg").config(["$routeProvider",function(e){e.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/:protocol/:host/:port/:interface/:secret?",{template:"",controller:"CommandController"}).when("/status",{templateUrl:"views/status.html",controller:"Aria2StatusController"}).otherwise({redirectTo:"/downloading"})}])}(),function(){"use strict";angular.module("ariaNg").run(["$rootScope","$location","$document","SweetAlert","ariaNgNotificationService","ariaNgSettingService","aria2TaskService",function(e,t,a,n,i,s,o){var r=function(e,t){return e===t||0===t.indexOf(e)&&0===t.substring(e.length).indexOf("/")},l=function(e){angular.element("section.sidebar > ul li").removeClass("active"),angular.element("section.sidebar > ul > li[data-href-match]").each(function(t,a){var n=angular.element(a).attr("data-href-match");r(n,e)&&angular.element(a).addClass("active")}),angular.element("section.sidebar > ul > li.treeview > ul.treeview-menu > li[data-href-match]").each(function(t,a){var n=angular.element(a).attr("data-href-match");r(n,e)&&angular.element(a).addClass("active").parent().parent().addClass("active")})},c=function(){angular.element("body").removeClass("sidebar-collapse").addClass("sidebar-open")},d=function(){angular.element("body").addClass("sidebar-collapse").removeClass("sidebar-open")},u=function(){return angular.element("body").hasClass("sidebar-open")};e.searchContext={text:""},e.taskContext={rpcStatus:"Connecting",list:[],selected:{},enableSelectAll:!1,getSelectedTaskIds: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.gid)}return e},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},selectAll:function(){if(this.list&&this.selected&&!(this.list.length<1)&&this.enableSelectAll){for(var e=!0,t=0;t<this.list.length;t++){var a=this.list[t];if(!this.selected[a.gid]){e=!1;break}}for(var t=0;t<this.list.length;t++){var a=this.list[t];this.selected[a.gid]=!e}}}},e.swipeActions={leftSwipe:function(){if(u())return void d();(!this.extentLeftSwipe||angular.isFunction(this.extentLeftSwipe)&&!this.extentLeftSwipe())&&d()},rightSwipe:function(){(!this.extentRightSwipe||angular.isFunction(this.extentRightSwipe)&&!this.extentRightSwipe())&&c()}},s.onFirstAccess(function(){i.notifyInPage("","Tap to configure and get started with AriaNg.",{delay:!1,onClose:function(){t.path("/settings/ariang")}})}),o.onFirstSuccess(function(){i.notifyInPage("","Connection Succeeded",{type:"success"})}),o.onConnectSuccess(function(){e.taskContext.rpcStatus="Connected"}),o.onConnectError(function(){e.taskContext.rpcStatus="Not Connected"}),o.onTaskCompleted(function(e){i.notifyTaskComplete(e.task)}),o.onBtTaskCompleted(function(e){i.notifyBtTaskComplete(e.task)}),o.onTaskErrorOccur(function(e){i.notifyTaskError(e.task)}),e.$on("$locationChangeStart",function(t){n.close(),e.loadPromise=null,delete e.swipeActions.extentLeftSwipe,delete e.swipeActions.extentRightSwipe,angular.isArray(e.taskContext.list)&&e.taskContext.list.length>0&&(e.taskContext.list.length=0),angular.isObject(e.taskContext.selected)&&(e.taskContext.selected={}),e.taskContext.enableSelectAll=!1}),e.$on("$routeChangeStart",function(e,n,i){var s=t.path();l(s),a.unbind("keypress")}),function(){angular.element("section.sidebar > ul > li[data-href-match] > a").click(function(){angular.element("section.sidebar > ul li").removeClass("active"),angular.element(this).parent().addClass("active")}),angular.element("section.sidebar > ul > li.treeview > ul.treeview-menu > li[data-href-match] > a").click(function(){angular.element("section.sidebar > ul li").removeClass("active"),angular.element(this).parent().addClass("active").parent().parent().addClass("active")})}()}])}(),function(){"use strict";angular.module("ariaNg").constant("ariaNgConstants",{title:"AriaNg",appPrefix:"AriaNg",optionStorageKey:"Options",languageStorageKeyPrefix:"Language",languagePath:"langs",languageFileExtension:".txt",defaultLanguage:"en",defaultHost:"localhost",globalStatStorageCapacity:120,taskStatStorageCapacity:300,lazySaveTimeout:500,errorTooltipDelay:500,notificationInPageTimeout:2e3}).constant("ariaNgDefaultOptions",{language:"en",title:"${downspeed}, ${upspeed} - ${title}",titleRefreshInterval:5e3,browserNotification:!1,rpcAlias:"",rpcHost:"",rpcPort:"6800",rpcInterface:"jsonrpc",protocol:"http",httpMethod:"POST",secret:"",extendRpcServers:[],globalStatRefreshInterval:1e3,downloadTaskRefreshInterval:1e3,afterCreatingNewTask:"task-list"})}(),function(){"use strict";angular.module("ariaNg").config(["$translateProvider","localStorageServiceProvider","NotificationProvider","ariaNgConstants","ariaNgLanguages",function(e,t,a,n,i){t.setPrefix(n.appPrefix).setStorageType("localStorage").setStorageCookie(365,"/");var s=[],o={};for(var r in i)if(i.hasOwnProperty(r)){var l=i[r],c=l.aliases;if(s.push(r),angular.isArray(c)&&!(c.length<1))for(var d=0;d<c.length;d++){var u=c[d];o[u]=r}}e.useLoader("ariaNgLanguageLoader").useLoaderCache(!0).registerAvailableLanguageKeys(s,o).determinePreferredLanguage().fallbackLanguage(n.defaultLanguage).useSanitizeValueStrategy("escapeParameters"),a.setOptions({delay:n.notificationInPageTimeout})}])}(),function(){"use strict";angular.module("ariaNg").constant("ariaNgFileTypes",{video:[".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:[".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:[".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:[".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:[".apk",".bat",".com",".deb",".dll",".dmg",".exe",".ipa",".jar",".msi",".rpm",".sh"],archive:[".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(["amMoment","moment","ariaNgSettingService",function(e,t,a){var n=a.getLanguage();t.updateLocale("zh-cn",{week:null}),e.changeLocale(n),a.applyLanguage(n)}])}(),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){var a={"Operation Succeeded":"Operation Succeeded","Connection Succeeded":"Connection Succeeded",Error:"Error",OK:"OK",Confirm:"Confirm",Cancel:"Cancel",True:"True",False:"False",Connecting:"Connecting",Connected:"Connected","Not Connected":"Not Connected",Global:"Global",New:"New",Start:"Start",Pause:"Pause",Restart:"Restart",Delete:"Delete","Select All":"Select All","Select None":"Select None","Select Invert":"Select Invert","Display Order":"Display Order",Help:"Help",Search:"Search",Default:"Default",Expand:"Expand",Collapse:"Collapse","Remove Task":"Remove 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 Remain Time":"By Remain Time","By Download Speed":"By Download Speed","By Upload Speed":"By Upload Speed",Filters:"Filters",Download:"Download",Upload:"Upload",Downloading:"Downloading",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","AriaNg Settings":"AriaNg 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","Aria2 Status":"Aria2 Status","File Name":"File Name","File Size":"File Size",Progress:"Progress","Share Ratio":"Share Ratio","Remain Time":"Remain","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",Blocks:"Blocks",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 Dir":"Download Dir","BT Tracker Servers":"BT Tracker Servers","(Choose Files)":"(Choose Files)",Videos:"Videos",Audios:"Audios",Pictures:"Pictures",Documents:"Documents",Applications:"Applications",Archives:"Archives",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 Restart":"Confirm Restart","Are you sure you want to restart this task? AriaNg will create a same task after clicking OK.":"Are you sure you want to restart this task? AriaNg will create a same task after clicking OK.","Failed to restart this task.":"Failed to restart this task.","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","Start Download":"Start Download","Manual Download":"Manual Download","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",Language:"Language","Debug Mode":"Debug Mode","Page Title":"Page Title",Preview:"Preview",'Tips: You can use the "noprefix" tag to ignore the prefix, "nosuffix" tag 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 ignore the suffix, and "scale=n" tag to set the decimal precision.',"Example: ${downspeed:noprefix:nosuffix:scale=1}":"Example: ${downspeed:noprefix:nosuffix:scale=1}","Page Title Refresh Interval":"Page Title Refresh Interval","Enable Browser Notification":"Enable Browser Notification","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 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?","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}}"?',"Global Stat Refresh Interval":"Global Stat Refresh Interval","Download Task Refresh Interval":"Download Task Refresh Interval","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","Supported Placeholder":"Supported Placeholder","AriaNg Title":"AriaNg Title","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.","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 Page":"Reload Page","Show Secret":"Show Secret","Hide Secret":"Hide Secret","Aria2 Version":"Aria2 Version","Enabled Features":"Enabled Features",Functions:"Functions","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","Quick Setting":"Quick Setting","Global Speed Limit":"Global Speed 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",Https:"Https",WebSocket:"WebSocket","WebSocket (Security)":"WebSocket (Security)",POST:"POST",GET:"GET",Disabled:"Disabled",BitTorrent:"BitTorrent","Changes to the settings take effect after refreshing page.":"Changes to the settings take effect after refreshing page.","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.",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."},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.pieceinfo":"Completed: {{completed}}, Total: {{total}}","task.error-occurred":"Error Occurred ({{errorcode}})","settings.file-count":"({{count}} Files)","settings.total-count":"(Total Count: {{count}})"},rpc:{error:{unauthorized:"Authorization Failed!"}},options:{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","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. To override a previously defined proxy, use "". 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":"","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-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.","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. 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-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.","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":"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 Failture 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."}};e.translations(t.defaultLanguage,a)}])}(),function(){"use strict";var e=window.__CONFIG__||{};angular.module("ariaNg").constant("aria2AllOptions",{dir:{type:"string",defaultValue:e.dir,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",defaultValue:"true",required:!0},"all-proxy":{type:"string"},"all-proxy-user":{type:"string"},"all-proxy-passwd":{type:"string"},"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|M)?)$"},"max-connection-per-server":{type:"integer",defaultValue:"1",required:!0,min:1,max:16},"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|M)?)$"},"netrc-path":{type:"string",readonly:!0,defaultValue:"$(HOME)/.netrc"},"no-netrc":{type:"boolean",required:!0},"no-proxy":{type:"text",split:",",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:"string"},"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",split:",",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-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|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",split:",",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|M)?)$"},"max-upload-limit":{type:"string",suffix:"Bytes",defaultValue:"0",required:!0,pattern:"^(0|[1-9]\\d*(K|M)?)$"},"peer-id-prefix":{type:"string",readonly:!0,defaultValue:"A2-$MAJOR-$MINOR-$PATCH-"},"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:"true"},"rpc-listen-all":{type:"boolean",readonly:!0,defaultValue:"false"},"rpc-listen-port":{type:"integer",readonly:!0,defaultValue:e.rpcListenPort||"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|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?)$"},"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|M)?)$"},"max-download-limit":{type:"string",suffix:"Bytes",defaultValue:"0",required:!0,pattern:"^(0|[1-9]\\d*(K|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|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-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","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"},{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:"all-proxy",category:"http",canUpdate:"new|waiting|paused"},{key:"all-proxy-user",category:"http",canUpdate:"new|waiting|paused"},{key:"all-proxy-passwd",category:"http",canUpdate:"new|waiting|paused"},{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:"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","base64","ariaNgDefaultOptions","ariaNgCommonService","ariaNgSettingService","aria2TaskService","ariaNgLogService",function(e,t,a,n,i,s,o,r,l,c){var d=a.path(),u=function(t){try{t=i.urldecode(t)}catch(e){return o.showError("URL is not base64 encoded!"),!1}return e.loadPromise=l.newUriTask({urls:[t],options:{}},!1,function(e){if(!e.success)return!1;a.path("/downloading")}),c.info("[CommandController] new download: "+t),!0},p=function(e,n,l,d,u){if(l=l||s.rpcPort,d=d||s.rpcInterface,u=u||s.secret,c.info("[CommandController] set rpc: "+e+"://"+n+":"+l+"/"+d+", secret: "+u),!e||"http"!==e&&"https"!==e&&"ws"!==e&&"wss"!==e)return o.showError("Protocol is invalid!"),!1;if(!n)return o.showError("RPC host cannot be empty!"),!1;if(u)try{u=i.urldecode(u)}catch(e){return o.showError("RPC secret is not base64 encoded!"),!1}var p={rpcAlias:"",rpcHost:n,rpcPort:l,rpcInterface:d,protocol:e,httpMethod:s.httpMethod,secret:u};return r.isRpcSettingEqualsDefault(p)?a.path("/downloading"):(r.setDefaultRpcSetting(p,{keepCurrent:!1,forceSet:!0}),a.path("/downloading"),t.location.reload()),!0};(function(e,t){return 0===e.indexOf("/new/")?u(t.url):0===e.indexOf("/settings/rpc/set/")?p(t.protocol,t.host,t.port,t.interface,t.secret):(o.showError("Parameter is invalid!"),!1)})(d,n)||a.path("/downloading")}])}(),function(){"use strict";angular.module("ariaNg").controller("MainController",["$rootScope","$scope","$route","$window","$location","$document","$interval","aria2RpcErrors","ariaNgCommonService","ariaNgSettingService","ariaNgTitleService","ariaNgMonitorService","ariaNgNotificationService","aria2TaskService","aria2SettingService",function(e,t,a,n,i,s,o,r,l,c,d,u,p,f,g){var m=null,h=null,v=function(){s[0].title=d.getFinalTitleByGlobalStat(t.globalStat)},b=function(e,a){return g.getGlobalStat(function(e){if(!e.success&&e.data.message===r.Unauthorized.message)return void o.cancel(h);e.success&&(t.globalStat=e.data,u.recordGlobalStat(e.data)),a&&a(e)},e)};c.getBrowserNotification()&&p.requestBrowserPermission(),t.globalStatusContext={isEnabled:c.getGlobalStatRefreshInterval()>0,data:u.getGlobalStatsData()},t.quickSettingContext=null,t.rpcSettings=c.getAllRpcSettings(),t.isTaskSelected=function(){return e.taskContext.getSelectedTaskIds().length>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(t){var n=e.taskContext.getSelectedTaskIds();if(n&&!(n.length<1)){var s=null;if("start"===t)s=f.startTasks;else{if("pause"!==t)return;s=f.pauseTasks}e.loadPromise=s(n,function(e){e.hasError&&n.length>1&&l.showError("Failed to change some tasks state."),e.hasSuccess&&(b(!0),e.hasError||"start"!==t?e.hasError||"pause"!==t||("/downloading"===i.path()?i.path("/waiting"):a.reload()):"/waiting"===i.path()?i.path("/downloading"):a.reload())},n.length>1)}},t.restart=function(t){l.confirm("Confirm Restart","Are you sure you want to restart this task? AriaNg will create a same task after clicking OK.","info",function(){e.loadPromise=f.restartTask(t.gid,function(e){if(!e.success)return void l.showError("Failed to restart this task.");b(!0),e.success&&("/downloading"!==i.path()?i.path("/downloading"):a.reload())},!1)})},t.removeTasks=function(){var t=e.taskContext.getSelectedTasks();!t||t.length<1||l.confirm("Confirm Remove","Are you sure you want to remove the selected task?","warning",function(){e.loadPromise=f.removeTasks(t,function(e){e.hasError&&t.length>1&&l.showError("Failed to remove some task(s)."),e.hasSuccess&&(b(!0),e.hasError||("/stopped"!==i.path()?i.path("/stopped"):a.reload()))},t.length>1)})},t.clearStoppedTasks=function(){l.confirm("Confirm Clear","Are you sure you want to clear stopped tasks?","warning",function(){e.loadPromise=f.clearStoppedTasks(function(e){e.success&&(b(!0),"/stopped"!==i.path()?i.path("/stopped"):a.reload())})})},t.selectAllTasks=function(){e.taskContext.selectAll()},t.changeDisplayOrder=function(e,t){var a=l.parseOrderType(c.getDisplayOrder()),n=l.parseOrderType(e);t&&n.type===a.type&&(n.reverse=!a.reverse),c.setDisplayOrder(n.getValue())},t.isSetDisplayOrder=function(e){var t=l.parseOrderType(c.getDisplayOrder()),a=l.parseOrderType(e);return t.equals(a)},t.showQuickSettingDialog=function(e,a){t.quickSettingContext={type:e,title:a}},t.switchRpcSetting=function(e){e.isDefault||(c.setDefaultRpcSetting(e),n.location.reload())},c.getTitleRefreshInterval()>0&&(m=o(function(){v()},c.getTitleRefreshInterval())),c.getGlobalStatRefreshInterval()>0&&(h=o(function(){b(!0)},c.getGlobalStatRefreshInterval())),t.$on("$destroy",function(){m&&o.cancel(m),h&&o.cancel(h)}),b(!0,function(){v()})}])}(),function(){"use strict";angular.module("ariaNg").controller("NewTaskController",["$rootScope","$scope","$location","$timeout","ariaNgCommonService","ariaNgSettingService","ariaNgFileService","aria2SettingService","aria2TaskService",function(e,t,a,n,i,s,o,r,l){var c=["links","options"],d=function(e,a){for(var n=t.context.urls.split("\n"),i=angular.copy(t.context.options),s=[],o=0;o<n.length;o++)""!==n[o]&&""!==n[o].trim()&&s.push({urls:[n[o].trim()],options:i});return l.newUriTasks(s,e,a)},u=function(e,a){var n={content:t.context.uploadFile.base64Content,options:angular.copy(t.context.options)};return l.newTorrentTask(n,e,a)},p=function(e,a){var n={content:t.context.uploadFile.base64Content,options:angular.copy(t.context.options)};return l.newMetalinkTask(n,e,a)};t.context={currentTab:"links",taskType:"urls",urls:"",uploadFile:null,availableOptions:function(){var e=r.getNewTaskOptionKeys();return r.getSpecifiedOptions(e,{disableRequired:!0})}(),globalOptions:null,options:{},optionFilter:{global:!0,http:!1,bittorrent:!1}},t.changeTab=function(e){"options"===e&&t.loadDefaultOption(),t.context.currentTab=e},e.swipeActions.extentLeftSwipe=function(){var e=c.indexOf(t.context.currentTab);return e<c.length-1&&(t.changeTab(c[e+1]),!0)},e.swipeActions.extentRightSwipe=function(){var e=c.indexOf(t.context.currentTab);return e>0&&(t.changeTab(c[e-1]),!0)},t.loadDefaultOption=function(){t.context.globalOptions||(e.loadPromise=r.getGlobalOption(function(e){e.success&&(t.context.globalOptions=e.data)}))},t.openTorrent=function(){o.openFileContent(".torrent",function(e){t.context.uploadFile=e,t.context.taskType="torrent",t.changeTab("options")},function(e){i.showError(e)})},t.openMetalink=function(){o.openFileContent(".meta4,.metalink",function(e){t.context.uploadFile=e,t.context.taskType="metalink",t.changeTab("options")},function(e){i.showError(e)})},t.startDownload=function(n){var i=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"===s.getAfterCreatingNewTask()&&t&&t.data?a.path("/task/detail/"+t.data):n?a.path("/waiting"):a.path("/downloading")}};"urls"===t.context.taskType?e.loadPromise=d(n,i):"torrent"===t.context.taskType?e.loadPromise=u(n,i):"metalink"===t.context.taskType&&(e.loadPromise=p(n,i))},t.setOption=function(e,a,n){""!==a?t.context.options[e]=a:delete t.context.options[e],n.setReady()},t.urlTextboxKeyDown=function(e){13===e.keyCode&&e.ctrlKey&&t.newTaskForm.$valid&&t.startDownload()},e.loadPromise=n(function(){},100)}])}(),function(){"use strict";angular.module("ariaNg").controller("DownloadListController",["$rootScope","$scope","$window","$location","$route","$interval","dragulaService","aria2RpcErrors","ariaNgCommonService","ariaNgSettingService","aria2TaskService",function(e,t,a,n,i,s,o,r,l,c,d){var u=n.path().substring(1),p=null,f=!1,g=!0,m=function(t){if(!f)return d.getTaskList(u,g,function(t){if(!f){if(!t.success)return void(t.data.message===r.Unauthorized.message&&s.cancel(p));var a=t.context.requestWholeInfo,n=t.data;if(a?(e.taskContext.list=n,g=!1):g=!l.extendArray(n,e.taskContext.list,"gid"),e.taskContext.list&&e.taskContext.list.length>0&&(d.processDownloadTasks(e.taskContext.list),!a)){for(var i=!1,o=0;o<e.taskContext.list.length;o++){var c=e.taskContext.list[o];if(c.hasTaskName||c.files||c.bittorrent){i=!0;break}}if(!i)return g=!0,void(e.taskContext.list.length=0)}e.taskContext.enableSelectAll=e.taskContext.list&&e.taskContext.list.length>0}},t)};t.filterByTaskName=function(t){return!(!t||!angular.isString(t.taskName))&&(!e.searchContext||!e.searchContext.text||t.taskName.toLowerCase().indexOf(e.searchContext.text.toLowerCase())>=0)},t.getOrderType=function(){return c.getDisplayOrder()},t.isSupportDragTask=function(){var e=l.parseOrderType(c.getDisplayOrder());return"waiting"===u&&"default"===e.type},c.getDownloadTaskRefreshInterval()>0&&(p=s(function(){m(!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)}),t.$on("$destroy",function(){f=!0,p&&s.cancel(p)}),e.loadPromise=m(!1)}])}(),function(){"use strict";angular.module("ariaNg").controller("TaskDetailController",["$rootScope","$scope","$routeParams","$interval","aria2RpcErrors","ariaNgFileTypes","ariaNgCommonService","ariaNgSettingService","ariaNgMonitorService","aria2TaskService","aria2SettingService",function(e,t,a,n,i,s,o,r,l,c,d){var u=["overview","blocks","filelist","btpeers"],p=null,f=!1,g=function(e,t){var a=d.getAvailableTaskOptionKeys(e,t);return d.getSpecifiedOptions(a,{disableRequired:!0})},m=function(a){a&&("active"===a.status&&a.bittorrent||u.indexOf("btpeers")>=0&&u.splice(u.indexOf("btpeers"),1),t.task&&t.task.status===a.status||(t.context.availableOptions=g(a.status,!!a.bittorrent)),t.task=o.copyObjectTo(a,t.task),e.taskContext.list=[t.task],e.taskContext.selected={},e.taskContext.selected[t.task.gid]=!0,l.recordStat(a.gid,a))},h=function(e){e&&(o.extendArray(e,t.context.btPeers,"peerId")||(t.context.btPeers=e),t.context.healthPercent=c.estimateHealthPercentFromPeers(t.task,t.context.btPeers))},v=function(e){return e&&e.bittorrent&&"active"===e.status},b=function(e){if(!f){var i=function(e){n.cancel(p)};return t.task?c.getTaskStatusAndBtPeers(a.gid,function(e){if(!e.success)return i(e.data.message);m(e.task),h(e.peers)},e,v(t.task),!0):c.getTaskStatus(a.gid,function(t){if(!t.success)return i(t.data.message);var a=t.data;m(a),v(a)&&c.getBtTaskPeers(a,function(e){e.success&&h(e.data)},e,!0)},e)}},y=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&&n.push(s.index)}return f=!0,c.selectTaskFile(a,n,function(e){f=!1,e.success&&b(!1)},e)}};t.context={currentTab:"overview",isEnableSpeedChart:r.getDownloadTaskRefreshInterval()>0,showChooseFilesToolbar:!1,btPeers:[],healthPercent:0,collapseTrackers:!0,statusData:l.getEmptyStatsData(a.gid),availableOptions:[],options:[]},t.changeTab=function(e){"settings"===e&&t.loadTaskOption(t.task),t.context.currentTab=e},e.swipeActions.extentLeftSwipe=function(){var e=u.indexOf(t.context.currentTab);return e<u.length-1&&(t.changeTab(u[e+1]),!0)},e.swipeActions.extentRightSwipe=function(){var e=u.indexOf(t.context.currentTab);return e>0&&(t.changeTab(u[e-1]),!0)},t.changeFileListDisplayOrder=function(e,t){var a=o.parseOrderType(r.getFileListDisplayOrder()),n=o.parseOrderType(e);t&&n.type===a.type&&(n.reverse=!a.reverse),r.setFileListDisplayOrder(n.getValue())},t.isSetFileListDisplayOrder=function(e){var t=o.parseOrderType(r.getFileListDisplayOrder()),a=o.parseOrderType(e);return t.equals(a)},t.getFileListOrderType=function(){return r.getFileListDisplayOrder()},t.showChooseFilesToolbar=function(){f=!0,t.context.showChooseFilesToolbar=!0},t.getSelectedFileCount=function(){for(var e=0,a=0;a<t.task.files.length;a++)e+=t.task.files[a].selected?1:0;return e},t.selectFiles=function(e){if(t.task&&t.task.files)for(var a=0;a<t.task.files.length;a++)"all"===e?t.task.files[a].selected=!0:"none"===e?t.task.files[a].selected=!1:"reverse"===e&&(t.task.files[a].selected=!t.task.files[a].selected)},t.chooseSpecifiedFiles=function(e){if(t.task&&t.task.files&&s[e]){for(var a=s[e],n=[],i=!0,r=0;r<t.task.files.length;r++){var l=o.getFileExtension(t.task.files[r].fileName);l&&(l=l.toLowerCase()),a.indexOf(l)>=0&&(n.push(r),t.task.files[r].selected||(i=!1))}for(var r=0;r<n.length;r++){var c=n[r];t.task.files[c].selected=!i}}},t.saveChoosedFiles=function(){t.context.showChooseFilesToolbar&&(e.loadPromise=y(!1),t.context.showChooseFilesToolbar=!1)},t.cancelChooseFiles=function(){t.context.showChooseFilesToolbar&&(f=!1,b(!0),t.context.showChooseFilesToolbar=!1)},t.setSelectedFile=function(){t.context.showChooseFilesToolbar||y(!0)},t.changePeerListDisplayOrder=function(e,t){var a=o.parseOrderType(r.getPeerListDisplayOrder()),n=o.parseOrderType(e);t&&n.type===a.type&&(n.reverse=!a.reverse),r.setPeerListDisplayOrder(n.getValue())},t.isSetPeerListDisplayOrder=function(e){var t=o.parseOrderType(r.getPeerListDisplayOrder()),a=o.parseOrderType(e);return t.equals(a)},t.getPeerListOrderType=function(){return r.getPeerListDisplayOrder()},t.loadTaskOption=function(a){e.loadPromise=c.getTaskOptions(a.gid,function(e){e.success&&(t.context.options=e.data)})},t.setOption=function(e,a,n){return c.setTaskOption(t.task.gid,e,a,function(e){e.success&&"OK"===e.data?n.setSuccess():n.setFailed(e.data.message)},!0)},r.getDownloadTaskRefreshInterval()>0&&(p=n(function(){if(t.task&&("complete"===t.task.status||"error"===t.task.status||"removed"===t.task.status))return void n.cancel(p);b(!0)},r.getDownloadTaskRefreshInterval())),t.$on("$destroy",function(){p&&n.cancel(p)}),e.loadPromise=b(!1)}])}(),function(){"use strict";angular.module("ariaNg").controller("AriaNgSettingsController",["$rootScope","$scope","$routeParams","$window","$interval","$timeout","ariaNgLanguages","ariaNgCommonService","ariaNgSettingService","ariaNgMonitorService","ariaNgNotificationService","ariaNgTitleService",function(e,t,a,n,i,s,o,r,l,c,d,u){var p=a.extendType,f=null,g=function(){return u.getFinalTitleByGlobalStat(c.getCurrentGlobalStat())},m=function(){if(!f){var t=e.$new();t.refreshPage=function(){n.location.reload()},f=d.notifyInPage("","Configuration has been modified, please reload the page for the changes to take effect.",{delay:!1,type:"info",templateUrl:"setting-changed-notification.html",scope:t,onClose:function(){f=null}})}};t.context={currentTab:"global",languages:o,titlePreview:g(),availableTime:r.getTimeOptions([1e3,2e3,3e3,5e3,1e4,3e4,6e4],!0),trueFalseOptions:[{name:"True",value:!0},{name:"False",value:!1}],showRpcSecret:!1,settings:l.getAllOptions(),sessionSettings:l.getAllSessionOptions(),rpcSettings:l.getAllRpcSettings()},t.context.showDebugMode=t.context.sessionSettings.debugMode||"debug"===p,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.updateTitlePreview=function(){t.context.titlePreview=g()},e.swipeActions.extentLeftSwipe=function(){var e=-1;return t.isCurrentGlobalTab()||(e=parseInt(t.context.currentTab.substring(3))),e<t.context.rpcSettings.length-1&&(t.changeRpcTab(e+1),!0)},e.swipeActions.extentRightSwipe=function(){var e=-1;return t.isCurrentGlobalTab()||(e=parseInt(t.context.currentTab.substring(3))),e>0?(t.changeRpcTab(e-1),!0):0===e&&(t.changeGlobalTab(),!0)},t.setLanguage=function(e){l.setLanguage(e),t.updateTitlePreview()},t.setAfterCreatingNewTask=function(e){l.setAfterCreatingNewTask(e)},t.setDebugMode=function(e){l.setDebugMode(e)},t.setTitle=function(e){l.setTitle(e)},t.setTitleRefreshInterval=function(e){m(),l.setTitleRefreshInterval(e)},t.isSupportNotification=function(){return d.isSupportBrowserNotification()&&l.isCurrentRpcUseWebSocket(t.context.settings.protocol)},t.setEnableBrowserNotification=function(e){l.setBrowserNotification(e),e&&!d.hasBrowserPermission()&&d.requestBrowserPermission(function(e){d.isPermissionGranted(e)||(t.context.settings.browserNotification=!1,r.showError("You have disabled notification in your browser. You should change your browser's settings before you enable this function."))})},t.setGlobalStatRefreshInterval=function(e){m(),l.setGlobalStatRefreshInterval(e)},t.setDownloadTaskRefreshInterval=function(e){m(),l.setDownloadTaskRefreshInterval(e)},t.addNewRpcSetting=function(){m();var e=l.addNewRpcSetting();t.context.rpcSettings.push(e),t.changeRpcTab(t.context.rpcSettings.length-1)},t.updateRpcSetting=function(e,t){m(),l.updateRpcSetting(e,t)},t.removeRpcSetting=function(e){var a=e.rpcAlias?e.rpcAlias:e.rpcHost+":"+e.rpcPort;r.confirm("Confirm Remove",'Are you sure you want to remove rpc setting "{{rpcName}}"?',"warning",function(){m();var a=t.context.rpcSettings.indexOf(e);l.removeRpcSetting(e),t.context.rpcSettings.splice(a,1),a>=t.context.rpcSettings.length&&t.changeRpcTab(t.context.rpcSettings.length-1)},!1,{textParams:{rpcName:a}})},t.setDefaultRpcSetting=function(e){e.isDefault||(l.setDefaultRpcSetting(e),
  n.location.reload())},t.resetSettings=function(){r.confirm("Confirm Reset","Are you sure you want to reset all settings?","warning",function(){l.resetSettings(),n.location.reload()})},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",function(e,t,a,n,i,s){var o=a.path().substring(a.path().lastIndexOf("/")+1);t.context={availableOptions:function(e){var t=s.getAvailableGlobalOptionsKeys(e);return t?s.getSpecifiedOptions(t):void i.showError("Type is illegal!")}(o),globalOptions:[]},t.setGlobalOption=function(e,t,a){return s.setGlobalOption(e,t,function(e){e.success&&"OK"===e.data?a.setSuccess():a.setFailed(e.data.message)},!0)},e.loadPromise=function(){return s.getGlobalOption(function(e){e.success&&(t.context.globalOptions=e.data)})}()}])}(),function(){"use strict";angular.module("ariaNg").controller("Aria2StatusController",["$rootScope","$scope","ariaNgCommonService","ariaNgSettingService","aria2SettingService",function(e,t,a,n,i){t.context={host:n.getCurrentRpcUrl(),status:"Connecting",serverStatus:null},t.saveSession=function(){return i.saveSession(function(e){e.success&&"OK"===e.data&&a.showOperationSucceeded("Session has been saved successfully.")})},t.shutdown=function(){a.confirm("Confirm Shutdown","Are you sure you want to shutdown aria2?","warning",function(e){return i.shutdown(function(e){e.success&&"OK"===e.data&&a.showOperationSucceeded("Aria2 has been shutdown successfully.")})},!0)},e.loadPromise=function(){return i.getAria2Status(function(e){e.success?(t.context.status="Connected",t.context.serverStatus=e.data):t.context.status="Not Connected"})}()}])}(),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)}},o=function(){var a=e.getPieceStatus(t.bitField,t.pieceCount);if(!i||!a||i.length!==a.length||a.length!==n.length)return void s();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};t.$watch("bitField",function(){o()}),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"},link:function(a,n,i){var s={ngTheme:"default"};angular.extend(s,i);var o=n.find("div"),r=n.parent(),l=r.height(),c=parseInt(i.height)||l||200;o.css("height",c+"px");var d=echarts.init(o[0],t.get(s.ngTheme)),u=function(e){d.setOption(e)};angular.element(e).on("resize",function(){d.resize(),a.$apply()}),a.$watch("options",function(e){e&&u(e)},!0)}}}]).directive("ngPopChart",["$window","chartTheme",function(e,t){return{restrict:"A",scope:{options:"=ngData"},link:function(e,a,n){var i={ngTheme:"default",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-content"></div></div>',trigger:i.ngTrigger}).on("shown.bs.popover",function(){var e=angular.element(".chart-pop"),a=e.parent(),o=a.height();e.empty();var r=parseInt(n.height)||o||200;e.css("height",r+"px"),s=echarts.init(e[0],t.get(i.ngTheme))}).on("hide.bs.popover",function(){s&&s.isDisposed()&&s.dispose()}).on("hidden.bs.popover",function(){angular.element(".chart-pop").empty().append(o)});var r=function(e){s&&!s.isDisposed()&&s.setOption(e)};e.$watch("options",function(e){e&&r(e)},!0)}}}]).factory("chartTheme",["chartDefaultTheme",function(e){var t={defaultTheme:e};return{get:function(e){return t[e+"Theme"]?t[e+"Theme"]:{}}}}]).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}})}(),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","$translate","ariaNgConstants",function(e,t,a){return{restrict:"E",templateUrl:"views/setting.html",require:"?ngModel",replace:!0,scope:{option:"=",ngModel:"=",defaultValue:"=?",onChangeValue:"&"},link:function(n,i,s,o){var r=null,l={lazySaveTimeout:a.lazySaveTimeout,errorTooltipDelay:a.errorTooltipDelay};angular.extend(l,s);var c=function(){angular.element(i).tooltip("destroy")},d=function(a,s,o){a&&e(function(){var e=n.optionStatus.getValue();"failed"!==e&&"error"!==e||angular.element(i).tooltip({title:t.instant(a,o),trigger:"focus",placement:"auto top",container:i,template:'<div class="tooltip'+(s?" tooltip-"+s:"")+'" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>'}).tooltip("show")},l.errorTooltipDelay)},u=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]},p=function(e){return"Bytes"===n.option.suffix?u(e):e};n.optionStatus=function(){var e="ready";return{getValue:function(){return e},setReady:function(){c(),e="ready"},setPending:function(){c(),e="pending"},setSaving:function(){c(),e="pending"},setSuccess:function(){c(),e="success"},setFailed:function(t){c(),e="failed",d(t,"warning")},setError:function(t,a){c(),e="error",d(t,"error",a)},getStatusFeedbackStyle:function(){return"success"===e?"has-success":"failed"===e?"has-warning":"error"===e?"has-error":""},getStatusIcon:function(){return"pending"===e?"fa-hourglass-start":"saving"===e?"fa-spin fa-pulse fa-spinner":"success"===e?"fa-check":"failed"===e?"fa-exclamation":"error"===e?"fa-times":""},isShowStatusIcon:function(){return""!==this.getStatusIcon()}}}(),n.getTotalCount=function(){return n.optionValue||angular.isString(n.optionValue)?n.optionValue.split(n.option.split).length:0},n.changeValue=function(t,a){if(r&&e.cancel(r),n.optionValue=t,n.optionStatus.setReady(),n.option&&n.option.key&&!n.option.readonly){if(n.option.required&&""===t)return void n.optionStatus.setError("Option value cannot be empty!");if(""!==t&&"integer"===n.option.type&&!/^-?\d+$/.test(t))return void n.optionStatus.setError("Input number is invalid!");if(""!==t&&"float"===n.option.type&&!/^-?(\d*\.)?\d+$/.test(t))return void n.optionStatus.setError("Input number is invalid!");if(""!==t&&("integer"===n.option.type||"float"===n.option.type)&&(angular.isDefined(n.option.min)||angular.isDefined(n.option.max))){var i=t;if("integer"===n.option.type?i=parseInt(t):"float"===n.option.type&&(i=parseFloat(t)),angular.isDefined(n.option.min)&&i<n.option.min)return void n.optionStatus.setError("Input number is below min value!",{value:n.option.min});if(angular.isDefined(n.option.max)&&i>n.option.max)return void n.optionStatus.setError("Input number is above max value!",{value:n.option.max})}if(""!==t&&angular.isDefined(n.option.pattern)&&!new RegExp(n.option.pattern).test(t))return void n.optionStatus.setError("Input value is invalid!");var s={key:n.option.key,value:t,optionStatus:n.optionStatus},o=function(){n.optionStatus.setSaving(),n.onChangeValue(s)};n.onChangeValue&&(a?(n.optionStatus.setPending(),r=e(function(){o()},l.lazySaveTimeout)):o())}},o&&n.$watch(function(){return o.$viewValue},function(e){n.optionValue=p(e)}),n.$watch("option",function(){i.find('[data-toggle="popover"]').popover()}),n.$watch("defaultValue",function(e){var t=e;if(n.option&&n.option.options)for(var a=0;a<n.option.options.length;a++){var i=n.option.options[a];if(i.value===e){t=i.name;break}}n.placeholder=p(t)})}}}])}(),function(){"use strict";angular.module("ariaNg").directive("ngSettingDialog",["ariaNgCommonService","aria2SettingService",function(e,t){return{restrict:"E",templateUrl:"views/setting-dialog.html",replace:!0,scope:{setting:"="},link:function(a,n,i){a.context={isLoading:!1,availableOptions:[],globalOptions:[]},a.setGlobalOption=function(e,a,n){return t.setGlobalOption(e,a,function(e){e.success&&"OK"===e.data?n.setSuccess():n.setFailed(e.data.message)},!0)};var s=function(n){var i=t.getaria2QuickSettingsAvailableOptions(n);if(!i)return void e.showError("Type is illegal!");a.context.availableOptions=t.getSpecifiedOptions(i)},o=function(){return a.context.isLoading=!0,t.getGlobalOption(function(e){a.context.isLoading=!1,e.success&&(a.context.globalOptions=e.data)})};angular.element("#quickSettingModal").on("hidden.bs.modal",function(){a.setting=null,a.context.availableOptions=[],a.context.globalOptions=[]}),a.$watch("setting",function(e){e&&(s(e.type),o(),angular.element("#quickSettingModal").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}})},o=function(){angular.element(t).attr("title",e.title).tooltip("fixTitle")},r=function(){angular.element(t).tooltip("destroy")};i&&s(),e.$watch("title",function(){i&&o()}),e.$watch("ngTooltipIf",function(e){angular.isUndefined(e)||(e=!0===e||"true"===e,i!==e&&(e?s():r(),i=e))})}}})}(),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))return a;var i=t.parseOrderType(n);return null===i?a:"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):a}}])}(),function(){"use strict";angular.module("ariaNg").filter("longDate",["$translate","moment",function(e,t){return function(a){var n=e.instant("format.longdate");return t(a).format(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("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):a}}])}(),function(){"use strict";angular.module("ariaNg").filter("taskStatus",function(){return function(e){return e?"active"===e.status?!0===e.seeder||"true"===e.seeder?"Seeding":"Downloading":"waiting"===e.status?"Waiting":"paused"===e.status?"Paused":"complete"===e.status?"Completed":"error"===e.status?e.errorCode?"format.task.error-occurred":"Error Occurred":"removed"===e.status?"Removed":"":""}})}(),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];angular.isUndefined(n)&&(n=2),a||(a=0),angular.isNumber(a)||(a=parseInt(a));for(var s=1;s<t.length&&a>=1024;s++)a/=1024,i=t[s];return(a=e("number")(a,n))+" "+i}}])}(),function(){"use strict";angular.module("ariaNg").factory("ariaNgCommonService",["$location","$timeout","base64","SweetAlert","$translate","ariaNgConstants",function(e,t,a,n,i,s){return{generateUniqueId:function(){var e=s.appPrefix+"_"+Math.round((new Date).getTime()/1e3)+"_"+Math.random();return a.encode(e)},showDialog:function(e,a,s){t(function(){n.swal({title:i.instant(e),text:i.instant(a),type:s,confirmButtonText:i.instant("OK")})},100)},showError:function(e){this.showDialog("Error",e,"error")},showOperationSucceeded:function(e){this.showDialog("Operation Succeeded",e,"success")},confirm:function(e,t,a,s,o,r){var l={title:i.instant(e),text:i.instant(t,angular.isObject(r)?r.textParams:null),type:a,showCancelButton:!0,showLoaderOnConfirm:!!o,closeOnConfirm:!o,confirmButtonText:i.instant("OK"),cancelButtonText:i.instant("Cancel")};"warning"===a&&(l.confirmButtonColor="#F39C12"),n.swal(l,function(e){e&&s&&s()})},getFileExtension:function(e){return!e||e.lastIndexOf(".")<0?e:e.substring(e.lastIndexOf("."))},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},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="",o=i;i<1e3?(o=i,s=1===o?"format.time.millisecond":"format.time.milliseconds"):i<6e4?(o=i/1e3,s=1===o?"format.time.second":"format.time.seconds"):i<144e4?(o=i/1e3/60,s=1===o?"format.time.minute":"format.time.minutes"):(o=i/1e3/60/24,s=1===o?"format.time.hour":"format.time.hours"),a.push({name:s,value:o,optionValue:i})}return a}}}])}(),function(){"use strict";angular.module("ariaNg").factory("ariaNgFileService",["$window",function(e){var t=!!e.FileReader,a=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},n=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};return{openFileContent:function(e,i,s){if(!t)return void(s&&s("Your browser does not support loading file!"));var o=a(e);angular.element('<input type="file" style="display: none"/>').change(function(){if(this.files&&!(this.files.length<1)){var e=this.files[0],t=e.name;if(!n(t,o))return void(s&&s("The selected file type is invalid!"));var a=new FileReader;a.onload=function(){var e={fileName:t,base64Content:this.result.replace(/.*?base64,/,"")};i&&i(e)},a.onerror=function(){s&&s("Failed to load file!")},a.readAsDataURL(e)}}).trigger("click")}}}])}(),function(){"use strict";angular.module("ariaNg").factory("ariaNgLanguageLoader",["$http","$q","localStorageService","ariaNgConstants","ariaNgLanguages",function(e,t,a,n,i){var s=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}},o=function(e,t){var a=e;if(!t)return a;if("["===t[0]&&"]"===t[t.length-1]&&(t=t.substring(1,t.length-1)),"default"===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},r=function(e){var t={};if(!e)return t;for(var a=e.split("\n"),n=t,i=0;i<a.length;i++){var r=a[i];if(r)if(r=r.replace("\r",""),/^\[.+\]$/.test(r))n=o(t,r);else{var l=s(r);l&&l.key&&(n[l.key]=l.value)}}return t};return function(s){var o=t.defer();if(!i[s.key])return o.reject(s.key),o.promise;var l=n.languageStorageKeyPrefix+"."+s.key,c=a.get(l);c&&o.resolve(c);var d=n.languagePath+"/"+s.key+n.languageFileExtension;return e({url:d,method:"GET"}).then(function(e){var t=r(e.data);return a.set(l,t),o.resolve(t)}).catch(function(e){return o.reject(s.key)}),o.promise}}])}(),function(){"use strict";angular.module("ariaNg").factory("ariaNgMonitorService",["$filter","$translate","moment","ariaNgConstants",function(e,t,a,n){var i={},s={},o=function(e){return"global"===e?n.globalStatStorageCapacity:n.taskStatStorageCapacity},r=function(n){for(var i={legend:{show:!1},grid:{x:50,y:10,x2:10,y2:10},tooltip:{show:!0,formatter:function(n){if(""===n[0].name)return"<div>"+t.instant("No Data")+"</div>";var i=a(n[0].name,"X").format("HH:mm:ss"),s=e("readableVolume")(n[0].value)+"/s";return"<div>"+i+'</div><div><i class="icon-download fa fa-arrow-down"></i> '+e("readableVolume")(n[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,0)}}},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:[]}]},r=i.xAxis.data,l=i.series[0].data,c=i.series[1].data,d=0;d<o(n);d++)r.push(""),l.push(""),c.push("");return s[n]=i,i},l=function(e){return angular.isDefined(s[e])},c=function(e,t){var a=s[e],n=a.xAxis.data,i=a.series[0].data,r=a.series[1].data;n.length>=o(e)&&(n.shift(),i.shift(),r.shift()),n.push(t.time),i.push(t.uploadSpeed),r.push(t.downloadSpeed)},d=function(e){return s[e]},u=function(e){delete s[e]};return{recordStat:function(e,t){l(e)||r(e),t.time=a().format("X"),c(e,t)},getStatsData:function(e){return l(e)||r(e),d(e)},getEmptyStatsData:function(e){return l(e)&&u(e),this.getStatsData(e)},recordGlobalStat:function(e){this.recordStat("global",e),i=e},getGlobalStatsData:function(){return this.getStatsData("global")},getCurrentGlobalStat:function(){return i}}}])}(),function(){"use strict";angular.module("ariaNg").factory("ariaNgNotificationService",["$notification","$translate","Notification","ariaNgSettingService",function(e,t,a,n){var i=e.isSupported,s=function(e){return"granted"===e};return{isSupportBrowserNotification:function(){return i},isPermissionGranted:function(e){return s(e)},hasBrowserPermission:function(){return!!i&&s(e.getPermission())},requestBrowserPermission:function(t){i&&e.requestPermission().then(function(e){s(e)||n.setBrowserNotification(!1),t&&t(e)})},notifyViaBrowser:function(a,s){i&&n.getBrowserNotification()&&e(t.instant(a),{body:t.instant(s)})},notifyInPage:function(e,n,i){return i||(i={}),e&&(e=t.instant(e)),n&&(n=t.instant(n)),n?(i.title=e,i.message=n):i.message=e,i.type&&a[i.type]||(i.type="primary"),a[i.type](i)},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:"")},clearNotificationInPage:function(){a.clearAll()}}}])}(),function(){"use strict";angular.module("ariaNg").factory("ariaNgSettingService",["$window","$location","$filter","$translate","base64","amMoment","localStorageService","ariaNgConstants","ariaNgDefaultOptions","ariaNgLanguages","ariaNgCommonService",function(e,t,a,n,i,s,o,r,l,c,d){var u=[],p={debugMode:!1},f=function(){if(angular.isArray(u)&&!(u.length<1))for(var e=0;e<u.length;e++){var t=u[e];t()}},g=function(e){for(var t in c)if(c.hasOwnProperty(t)){var a=c[t],n=a.aliases;if(angular.isArray(n)&&!(n.length<1))for(var i=0;i<n.length;i++)if(n[i]===e)return t}return null},m=function(){var t=e.navigator.browserLanguage?e.navigator.browserLanguage:e.navigator.language;if(!t)return l.language;if(t=t.replace(/\-/g,"_"),!c[t]){var a=g(t);a&&(t=a)}return c[t]?t:l.language},h=function(e){var t=g(e);return t||m()},v=function(){var e=t.host();return e||r.defaultHost},b=function(e){return o.set(r.optionStorageKey,e)},y=function(){var e=o.get(r.optionStorageKey);return e&&!c[e.language]&&(e.language=h(e.language)),e||(e=angular.extend({},l),e.language=m(),b(e),f()),e},k=function(){return o.clearAll()},w=function(e){var t=y();return angular.isUndefined(t[e])&&angular.isDefined(l[e])&&(t[e]=l[e],b(t)),t[e]},S=function(e,t){var a=y();a[e]=t,b(a)},x=function(e){return{rpcAlias:e.rpcAlias,rpcHost:e.rpcHost,rpcPort:e.rpcPort,rpcInterface:e.rpcInterface,protocol:e.protocol,httpMethod:e.httpMethod,secret:e.secret}},T=function(){var e=x(l);return e.rpcId=d.generateUniqueId(),e.rpcHost=v(),e};return{getAllOptions:function(){var e=angular.extend({},l,y());if(e.rpcHost||(e.rpcHost=v()),e.secret&&(e.secret=i.decode(e.secret)),angular.isArray(e.extendRpcServers))for(var t=0;t<e.extendRpcServers.length;t++){var a=e.extendRpcServers[t];a.rpcHost||(a.rpcHost=v()),a.secret&&(a.secret=i.decode(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)}return e},getAllSessionOptions:function(){return angular.copy(p)},applyLanguage:function(e){return!!c[e]&&(n.use(e),s.changeLocale(e),!0)},getLanguage:function(){return w("language")},setLanguage:function(e){this.applyLanguage(e)&&S("language",e)},isEnableDebugMode:function(){return p.debugMode},setDebugMode:function(e){p.debugMode=e},getTitle:function(){return w("title")},setTitle:function(e){S("title",e)},getTitleRefreshInterval:function(){return w("titleRefreshInterval")},setTitleRefreshInterval:function(e){S("titleRefreshInterval",Math.max(parseInt(e),0))},getAfterCreatingNewTask:function(){return w("afterCreatingNewTask")},setAfterCreatingNewTask:function(e){S("afterCreatingNewTask",e)},getBrowserNotification:function(){return w("browserNotification")},setBrowserNotification:function(e){S("browserNotification",e)},getCurrentRpcUrl:function(){var e=w("protocol"),t=w("rpcHost"),a=w("rpcPort"),n=w("rpcInterface");return t||(t=v()),e+"://"+t+":"+a+"/"+n},getCurrentRpcProtocol:function(){return w("protocol")},getCurrentRpcHttpMethod:function(){return w("httpMethod")},isCurrentRpcUseWebSocket:function(e){return e||(e=this.getCurrentRpcProtocol()),"ws"===e||"wss"===e},getCurrentRpcSecret:function(){var e=w("secret");return e?i.decode(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=i.encode(n)),e.isDefault)return S(t,n),e;var s=y();if(!angular.isArray(s.extendRpcServers))return e;for(var o=0;o<s.extendRpcServers.length;o++)if(s.extendRpcServers[o].rpcId===e.rpcId){s.extendRpcServers[o][t]=n;break}return b(s),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=d.generateUniqueId(),angular.isArray(a.extendRpcServers)||(a.extendRpcServers=[]);for(var s=null,o=0;o<a.extendRpcServers.length;o++)if(a.extendRpcServers[o].rpcId===e.rpcId){s=x(a.extendRpcServers[o]),a.extendRpcServers.splice(o,1);break}return t.forceSet&&(s=x(e),s.secret&&(s.secret=i.encode(s.secret))),s&&(t.keepCurrent&&a.extendRpcServers.splice(0,0,n),a=angular.extend(a,s)),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.secret===e.secret))))},getGlobalStatRefreshInterval:function(){return w("globalStatRefreshInterval")},setGlobalStatRefreshInterval:function(e){S("globalStatRefreshInterval",Math.max(parseInt(e),0))},getDownloadTaskRefreshInterval:function(){return w("downloadTaskRefreshInterval")},setDownloadTaskRefreshInterval:function(e){S("downloadTaskRefreshInterval",Math.max(parseInt(e),0))},getDisplayOrder:function(){var e=w("displayOrder");return e||(e="default:asc"),e},setDisplayOrder:function(e){S("displayOrder",e)},getFileListDisplayOrder:function(){var e=w("fileListDisplayOrder");return e||(e="default:asc"),e},setFileListDisplayOrder:function(e){S("fileListDisplayOrder",e)},getPeerListDisplayOrder:function(){var e=w("peerListDisplayOrder");return e||(e="default:asc"),e},setPeerListDisplayOrder:function(e){S("peerListDisplayOrder",e)},resetSettings:function(){k()},onFirstAccess:function(e){e&&u.push(e)}}}])}(),function(){"use strict";angular.module("ariaNg").factory("ariaNgTitleService",["$filter","$translate","ariaNgConstants","ariaNgSettingService",function(e,t,a,n){var i=function(e){if(!e)return{};for(var t=e.substring(2,e.length-1),a=t.split(":"),n={oldValue:e},i=1;i<a.length;i++){var s=a[i].split("=");1===s.length?n[s[0]]=!0:2===s.length&&(n[s[0]]=s[1])}return n},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},r=function(e,a){return o(e,"downloading",{prefix:t.instant("Downloading")+": ",value:a})},l=function(e,a){return o(e,"waiting",{prefix:t.instant("Waiting")+": ",value:a})},c=function(e,a){return o(e,"stopped",{prefix:t.instant("Finished / Stopped"),value:a})},d=function(e,a){return o(e,"downspeed",{prefix:t.instant("Download")+": ",value:a,type:"volume",suffix:"/s"})},u=function(e,a){return o(e,"upspeed",{prefix:t.instant("Upload")+": ",value:a,type:"volume",suffix:"/s"})},p=function(e){return o(e,"title",{value:a.title})};return{getFinalTitle:function(e){var t=n.getTitle();return e=angular.extend({downloadingCount:0,waitingCount:0,stoppedCount:0,downloadSpeed:0,uploadSpeed:0},e),t=r(t,e.downloadingCount),t=l(t,e.waitingCount),t=c(t,e.stoppedCount),t=d(t,e.downloadSpeed),t=u(t,e.uploadSpeed),t=p(t)},getFinalTitleByGlobalStat:function(e){var t={downloadingCount:e?e.numActive:0,waitingCount:e?e.numWaiting:0,stoppedCount:e?e.numStopped:0,downloadSpeed:e?e.downloadSpeed:0,uploadSpeed:e?e.uploadSpeed:0};return this.getFinalTitle(t)}}}])}(),function(){"use strict";angular.module("ariaNg").factory("ariaNgLogService",["$log","ariaNgSettingService",function(e,t){return{debug:function(a,n){t.isEnableDebugMode()&&(n?e.debug("[AriaNg Debug]"+a,n):e.debug("[AriaNg Debug]"+a))},info:function(t,a){a?e.info("[AriaNg Info]"+t,a):e.info("[AriaNg Info]"+t)},warn:function(t,a){a?e.warn("[AriaNg Warn]"+t,a):e.warn("[AriaNg Warn]"+t)},error:function(t,a){a?e.error("[AriaNg Error]"+t,a):e.error("[AriaNg Error]"+t)}}}])}(),function(){"use strict";angular.module("ariaNg").factory("aria2HttpRpcService",["$http","base64","ariaNgSettingService","ariaNgLogService",function(e,t,a,n){var i=a.getCurrentRpcUrl(),s=a.getCurrentRpcHttpMethod(),o=function(e,a){if(!e||e.length<1)return e;var n="";for(var i in a)if(a.hasOwnProperty(i)){var s=a[i];null===s||angular.isUndefined(s)||(n.length>0&&(n+="&"),(angular.isObject(s)||angular.isArray(s))&&(s=angular.toJson(s),s=t.encode(s),s=encodeURIComponent(s)),n+=i+"="+s)}return n.length<1?e:(n=e.indexOf("?")<0?"?"+n:"&"+n,e+n)};return{request:function(t){if(t){var a={url:i,method:s};return"POST"===a.method?a.data=t.requestBody:"GET"===a.method&&(a.url=o(a.url,t.requestBody)),n.debug("[aria2HttpRpcService.request] request start",a),e(a).then(function(e){var a=e.data;n.debug("[aria2HttpRpcService.request] response success",a),a&&t.successCallback&&t.successCallback(a.id,a.result)}).catch(function(e){var a=e.data;n.debug("[aria2HttpRpcService.request] response error",a),a||(a={id:"-1",error:{innerError:!0}}),t.errorCallback&&t.errorCallback(a.id,a.error)})}},on:function(e,t){}}}])}(),function(){"use strict";angular.module("ariaNg").factory("aria2WebSocketRpcService",["$q","$websocket","ariaNgSettingService","ariaNgLogService",function(e,t,a,n){var i=a.getCurrentRpcUrl(),s=null,o={},r={},l=function(e){var t=e.id;if(t){var a=o[t];if(a){var i=a.context;a.deferred.resolve({success:!0,context:i}),
  e.result&&i.successCallback&&(n.debug("[aria2WebSocketRpcService.request] response uccess",e),i.successCallback(i.id,e.result)),e.error&&i.errorCallback&&(n.debug("[aria2WebSocketRpcService.request] response error",e),i.errorCallback(i.id,e.error)),delete o[t]}}},c=function(e){var t=e.method;if(t){var a=r[t];if(angular.isArray(a)&&!(a.length<1))for(var n=0;n<a.length;n++){var i=a[n],s=angular.isArray(e.params)&&e.params.length>0?e.params[0]:null;i(s)}}},d=function(){return null===s&&(s=t(i),s.onMessage(function(e){if(e&&e.data){var t=angular.fromJson(e.data);t&&(t.id?l(t):t.method&&c(t))}})),s};return{request:function(t){if(t){var a=d(),i=t.uniqueId,s=angular.toJson(t.requestBody);n.debug("[aria2WebSocketRpcService.request] request start",t);var r=e.defer();return o[i]={context:t,deferred:r},a.send(s),r.promise}},on:function(e,t){var a=r[e];angular.isArray(a)||(a=r[e]=[]),a.push(t)}}}])}(),function(){"use strict";angular.module("ariaNg").factory("aria2RpcService",["$q","aria2RpcConstants","aria2RpcErrors","ariaNgCommonService","ariaNgSettingService","ariaNgLogService","aria2HttpRpcService","aria2WebSocketRpcService",function(e,t,a,n,i,s,o,r){var l=i.isCurrentRpcUseWebSocket()?r:o,c=!1,d=i.getCurrentRpcSecret(),u=[],p=[],f=[],g=[],m=[],h=[],v=[],b=[],y=[],k=function(e){return 0===e.indexOf(t.rpcSystemServiceName+".")},w=function(e){return t.rpcServiceName+"."+e},S=function(e){return w(e)},x=function(e,a){if(a)return e;var i=n.generateUniqueId(),s={jsonrpc:t.rpcServiceVersion,method:e.methodName,id:i,params:e.params},o={uniqueId:i,requestBody:s,successCallback:e.successCallback,errorCallback:e.errorCallback};return l.request(o)},T=function(e,t){var a=S(e);l.on(a,function(e){if(angular.isArray(t)&&!(t.length<1))for(var a=0;a<t.length;a++){var n=t[a];n(e)}})},C=function(e){if(angular.isArray(e)&&!(e.length<1))for(var t=0;t<e.length;t++){var a=e[t];a()}},P=function(t,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|=e.success,o|=!e.success},i.push(t(a[l]));return e.all(i).finally(function(){n&&n({hasSuccess:!!s,hasError:!!o,results:r})})},R=function(e){return!(!e||!e.message)&&(s.error("[aria2RpcService.processError] "+e.message,e),a[e.message]&&a[e.message].tipTextKey?(n.showError(a[e.message].tipTextKey),!0):(n.showError(e.message),!0))},O=function(){var e=arguments[0],a=k(e),n=[],i={methodName:a?e:w(e)};if(d&&!a&&n.push(t.rpcTokenPrefix+d),arguments.length>1){var s=arguments[1];i.successCallback=function(e,t){s.callback&&s.callback({id:e,success:!0,data:t,context:s}),C(p),c||(c=!0,C(u))},i.errorCallback=function(e,t){var a=!1;s.silent||(a=R(t)),s.callback&&s.callback({id:e,success:!1,data:t,errorProcessed:a,context:s}),C(f)}}if(arguments.length>2)for(var o=2;o<arguments.length;o++)null!==arguments[o]&&angular.isDefined(arguments[o])&&n.push(arguments[o]);return n.length>0&&(i.params=n),i};return function(){T("onDownloadStart",g),T("onDownloadPause",m),T("onDownloadStop",h),T("onDownloadComplete",v),T("onDownloadError",b),T("onBtDownloadComplete",y)}(),{getBasicTaskParams:function(){return["gid","totalLength","completedLength","uploadSpeed","downloadSpeed","connections","numSeeders","seeder","status","errorCode"]},getFullTaskParams:function(){var e=this.getBasicTaskParams();return e.push("files"),e.push("bittorrent"),e},addUri:function(e,t){var a=e.task.urls,n=angular.copy(e.task.options);return e.pauseOnAdded&&(n.pause="true"),x(O("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 P(this.addUri,t,e.callback)},addTorrent:function(e,t){var a=e.task.content,n=angular.copy(e.task.options);return e.pauseOnAdded&&(n.pause="true"),x(O("addTorrent",e,a,[],n),!!t)},addMetalink:function(e,t){var a=e.task.content,n=angular.copy(e.task.options);return e.pauseOnAdded&&(n.pause="true"),x(O("addMetalink",e,a,[],n),!!t)},remove:function(e,t){return x(O("remove",e,e.gid),!!t)},forceRemove:function(e,t){return x(O("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 P(this.forceRemove,t,e.callback)},pause:function(e,t){return x(O("pause",e,e.gid),!!t)},pauseAll:function(e,t){return x(O("pauseAll",e),!!t)},forcePause:function(e,t){return x(O("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 P(this.forcePause,t,e.callback)},forcePauseAll:function(e,t){return x(O("forcePauseAll",e),!!t)},unpause:function(e,t){return x(O("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 P(this.unpause,t,e.callback)},unpauseAll:function(e,t){return x(O("unpauseAll",e),!!t)},tellStatus:function(e,t){return x(O("tellStatus",e,e.gid),!!t)},getUris:function(e,t){return x(O("getUris",e,e.gid),!!t)},getFiles:function(e,t){return x(O("getFiles",e,e.gid),!!t)},getPeers:function(e,t){return x(O("getPeers",e,e.gid),!!t)},getServers:function(e,t){return x(O("getServers",e,e.gid),!!t)},tellActive:function(e,t){return x(O("tellActive",e,angular.isDefined(e.requestParams)?e.requestParams:null),!!t)},tellWaiting:function(e,t){return x(O("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 x(O("tellStopped",e,angular.isDefined(e.offset)?e.offset:-1,angular.isDefined(e.num)?e.num:1e3,angular.isDefined(e.requestParams)?e.requestParams:null),!!t)},changePosition:function(e,t){return x(O("changePosition",e,e.gid,e.pos,e.how),!!t)},changeUri:function(e,t){return x(O("changeUri",e,e.gid,e.fileIndex,e.delUris,e.addUris),!!t)},getOption:function(e,t){return x(O("getOption",e,e.gid),!!t)},changeOption:function(e,t){return x(O("changeOption",e,e.gid,e.options),!!t)},getGlobalOption:function(e,t){return x(O("getGlobalOption",e),!!t)},changeGlobalOption:function(e,t){return x(O("changeGlobalOption",e,e.options),!!t)},getGlobalStat:function(e,t){return x(O("getGlobalStat",e),!!t)},purgeDownloadResult:function(e,t){return x(O("purgeDownloadResult",e),!!t)},removeDownloadResult:function(e,t){return x(O("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 P(this.removeDownloadResult,t,e.callback)},getVersion:function(e,t){return x(O("getVersion",e),!!t)},getSessionInfo:function(e,t){return x(O("getSessionInfo",e),!!t)},shutdown:function(e,t){return x(O("shutdown",e),!!t)},forceShutdown:function(e,t){return x(O("forceShutdown",e),!!t)},saveSession:function(e,t){return x(O("saveSession",e),!!t)},multicall:function(e){return x(O("system.multicall",e,e.methods))},listMethods:function(e){return x(O("system.listMethods",e))},onFirstSuccess:function(e){u.push(e.callback)},onConnectSuccess:function(e){p.push(e.callback)},onConnectError:function(e){f.push(e.callback)},onDownloadStart:function(e){g.push(e.callback)},onDownloadPause:function(e){m.push(e.callback)},onDownloadStop:function(e){h.push(e.callback)},onDownloadComplete:function(e){v.push(e.callback)},onDownloadError:function(e){b.push(e.callback)},onBtDownloadComplete:function(e){y.push(e.callback)}}}])}(),function(){"use strict";angular.module("ariaNg").factory("aria2TaskService",["$q","$translate","bittorrentPeeridService","aria2Errors","aria2RpcService","ariaNgCommonService","ariaNgLogService",function(e,t,a,n,i,s,o){var r=function(e){if(!e)return o.warn("[aria2TaskService.getFileName] file is null"),"";var t=e.path;!t&&e.uris&&e.uris.length>0&&(t=e.uris[0].uri);var a=t.lastIndexOf("/");return a<=0||a===t.length?t:t.substring(a+1)},l=function(e,t){return 0===t?0:e/t},c=function(e){var a="",n=!0;return e.bittorrent&&e.bittorrent.info&&(a=e.bittorrent.info.name),!a&&e.files&&e.files.length>0&&(a=r(e.files[0])),a||(a=t.instant("Unknown"),n=!1),{name:a,success:n}},d=function(e){return e.errorCode&&n[e.errorCode]&&n[e.errorCode].descriptionKey?n[e.errorCode].hide?"":n[e.errorCode].descriptionKey:""},u=function(e,t){for(var a=[],n=0;n<t;n++)a.push(!1);if(!e)return a;for(var i=0,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},p=function(e,t){for(var a=u(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},f=function(e){if(!e)return o.warn("[aria2TaskService.processDownloadTask] task is null"),e;var t=u(e.bitfield,e.numPieces);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(t,!0),e.pieceLength=parseInt(e.pieceLength),e.idle=0===e.downloadSpeed,e.remainTime=l(e.remainLength,e.downloadSpeed),e.seeder=!0===e.seeder||"true"===e.seeder;var a=c(e);if(e.taskName=a.name,e.hasTaskName=a.success,e.errorDescription=d(e),e.files){for(var n=0,i=0;i<e.files.length;i++){var p=e.files[i];p.fileName=r(p),p.length=parseInt(p.length),p.selected=!0===p.selected||"true"===p.selected,p.completedLength=parseInt(p.completedLength),p.completePercent=p.length>0?p.completedLength/p.length*100:0,n+=p.selected?1:0}e.selectedFileCount=n}return e},g=function(e,t,n){if(!e)return o.warn("[aria2TaskService.processBtPeers] peers is null"),e;for(var i=u(t.bitfield,t.numPieces),r=s.countArray(i,!0),l=t.completePercent,c=0;c<e.length;c++){var d=e[c],p=d.uploadSpeed,f=d.downloadSpeed,g=u(d.bitfield,t.numPieces),m=s.countArray(g,!0);if(d.name=d.ip+":"+d.port,d.completePercent=m/t.numPieces*100,d.downloadSpeed=p,d.uploadSpeed=f,d.seeder=!0===d.seeder||"true"===d.seeder,m===r&&d.completePercent!==l&&(d.completePercent=l),d.peerId){var v=s.decodePercentEncodedString(d.peerId),b=v?a.parseClient(v):null;if(b&&"unknown"!==b.client){var y={name:b.client?b.client.trim():"",version:b.version?b.version.trim():""};y.info=y.name+(y.version?" "+y.version:""),d.client=y}}}return n&&e.push(h(t)),e},m=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)}},h=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)return;s=i.tellStopped}return s({requestWholeInfo:t,requestParams:t?i.getFullTaskParams():i.getBasicTaskParams(),silent:!!n,callback:function(e){if(!a)return void o.warn("[aria2TaskService.getTaskList] callback is null");a(e)}})},getTaskStatus:function(e,t,a){return i.tellStatus({gid:e,silent:!!a,callback:function(e){if(!t)return void o.warn("[aria2TaskService.getTaskStatus] callback is null");e.success&&f(e.data),t(e)}})},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){if(!t)return void o.warn("[aria2TaskService.getBtTaskPeers] callback is null");a.success&&g(a.data,e,n),t(a)}})},getTaskStatusAndBtPeers:function(e,t,a,n,s){var r=[i.tellStatus({gid:e},!0)];return n&&r.push(i.getPeers({gid:e},!0)),i.multicall({methods:r,silent:!!a,callback:function(e){if(!t)return void o.warn("[aria2TaskService.getTaskStatusAndBtPeers] callback is null");e.task={},e.success&&e.data.length>0&&(e.task=e.data[0][0],f(e.task)),e.success&&e.task.bittorrent&&e.data.length>1&&(e.peers=e.data[1][0],g(e.peers,e.task,s)),t(e)}})},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})},restartTask:function(t,a,n){var s=e.defer(),r=[i.tellStatus({gid:t},!0),i.getOption({gid:t},!0)],l=null,c=null;return i.multicall({methods:r,silent:!!n,callback:function(e){if(!a)return void o.warn("[aria2TaskService.restartTask] callback is null");if(!e.success)return o.warn("[aria2TaskService.restartTask] response is not success"),s.reject(e),void a(e);if(e.data.length>0&&(l=e.data[0][0]),e.data.length>1&&(c=e.data[1][0]),!l||!c||!l.files||1!=l.files.length||l.bittorrent)return l||o.warn("[aria2TaskService.restartTask] task is null"),c||o.warn("[aria2TaskService.restartTask] options is null"),l.files||o.warn("[aria2TaskService.restartTask] task file is null"),1!=l.files.length&&o.warn("[aria2TaskService.restartTask] task file length is not equal 1"),l.bittorrent&&o.warn("[aria2TaskService.restartTask] task is bittorrent"),s.reject(t),void a({success:!1});for(var r=l.files[0],d=[],u=0;u<r.uris.length;u++){var p=r.uris[u];d.push(p.uri)}i.addUri({task:{urls:d,options:c},pauseOnAdded:!1,silent:!!n,callback:function(e){if(!e.success)return o.warn("[aria2TaskService.restartTask] addUri response is not success"),s.reject(e),void a(e);s.resolve(e),a(e)}})}}),s.promise},removeTasks:function(t,a,n){for(var o=[],r=[],l=0;l<t.length;l++)"complete"===t[l].status||"error"===t[l].status||"removed"===t[l].status?r.push(t[l].gid):o.push(t[l].gid);var c=[],d=!1,u=!1,p=[];return o.length>0&&c.push(i.forceRemoveMulti({gids:o,silent:!!n,callback:function(e){s.pushArrayTo(p,e.results),d|=e.hasSuccess,u|=e.hasError}})),r.length>0&&c.push(i.removeDownloadResultMulti({gids:r,silent:!!n,callback:function(e){s.pushArrayTo(p,e.results),d|=e.hasSuccess,u|=e.hasError}})),e.all(c).then(function(){a&&a({hasSuccess:!!d,hasError:!!u,results:p})})},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})},onFirstSuccess:function(e){if(!e)return void o.warn("[aria2TaskService.onFirstSuccess] callback is null");i.onFirstSuccess({callback:e})},onConnectSuccess:function(e){if(!e)return void o.warn("[aria2TaskService.onConnectSuccess] callback is null");i.onConnectSuccess({callback:e})},onConnectError:function(e){if(!e)return void o.warn("[aria2TaskService.onConnectError] callback is null");i.onConnectError({callback:e})},onTaskCompleted:function(e){if(!e)return void o.warn("[aria2TaskService.onTaskCompleted] callback is null");i.onDownloadComplete({callback:m(this.getTaskStatus,e,"completed")})},onBtTaskCompleted:function(e){if(!e)return void o.warn("[aria2TaskService.onBtTaskCompleted] callback is null");i.onBtDownloadComplete({callback:m(this.getTaskStatus,e,"btcompleted")})},onTaskErrorOccur:function(e){if(!e)return void o.warn("[aria2TaskService.onTaskErrorOccur] callback is null");i.onDownloadError({callback:m(this.getTaskStatus,e,"error")})},processDownloadTasks:function(e){if(!angular.isArray(e))return void o.warn("[aria2TaskService.processDownloadTasks] tasks is not array");for(var t=0;t<e.length;t++)f(e[t])},getPieceStatus:function(e,t){return u(e,t)},getCombinedPieces:function(e,t){return p(e,t)},estimateHealthPercentFromPeers:function(e,t){if(!e||e.numPieces<1||t.length<1)return o.warn("[aria2TaskService.estimateHealthPercentFromPeers] tasks is null or numPieces < 1 or peers < 1"),e.completePercent;for(var a=[],n=0,i=e.completePercent,s=0;s<e.numPieces;s++)a.push(0);for(var s=0;s<t.length;s++){for(var r=t[s],l=u(r.bitfield,e.numPieces),c=0,d=0;d<l.length;d++){var p=l[d]?1:0;a[d]+=p,c+=p}c>n?(n=c,i=r.completePercent):c===n&&r.completePercent>i&&(i=r.completePercent)}var f=0;if(a.length>0)for(;;){for(var g=!0,s=0;s<a.length;s++)a[s]>0?(f++,a[s]--):g=!1;if(!g)break}if(f<=n)return i;var m=f/e.numPieces*100;return m<=i?i:m}}}])}(),function(){"use strict";angular.module("ariaNg").factory("aria2SettingService",["aria2AllOptions","aria2GlobalAvailableOptions","aria2QuickSettingsAvailableOptions","aria2TaskAvailableOptions","aria2RpcService","ariaNgLogService",function(e,t,a,n,i,s){var o=function(e){if(!e)return e;var t=parseInt(e.numActive),a=parseInt(e.numWaiting),n=t+a;return e.totalRunningCount=n,e};return{getAvailableGlobalOptionsKeys:function(e){return"basic"===e?t.basicOptions:"http-ftp-sftp"===e?t.httpFtpSFtpOptions:"http"===e?t.httpOptions:"ftp-sftp"===e?t.ftpSFtpOptions:"bt"===e?t.btOptions:"metalink"===e?t.metalinkOptions:"rpc"===e?t.rpcOptions:"advanced"===e&&t.advancedOptions},getaria2QuickSettingsAvailableOptions:function(e){return"globalSpeedLimit"===e&&a.globalSpeedLimitOptions},getAvailableTaskOptionKeys:function(e,t){for(var a=n.taskOptions,i=[],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),i.push(r)))}return i},getNewTaskOptionKeys:function(){for(var e=n.taskOptions,t=[],a=0;a<e.length;a++){var i=e[a],s={key:i.key,category:i.category};i.canShow&&i.canShow.indexOf("new")<0||(i.canUpdate&&i.canUpdate.indexOf("new")<0&&(s.readonly=!0),t.push(s))}return t},getSpecifiedOptions:function(t,a){var n=[];if(!t)return n;for(var i=0;i<t.length;i++){var s=t[i],o=!1,r=null;if(angular.isObject(s)){var l=s;s=l.key,o=!!l.readonly,r=l.category}var c=e[s];if(c){if(c=angular.extend({key:s,nameKey:"options."+s+".name",descriptionKey:"options."+s+".description"},c),r&&(c.category=r),"boolean"===c.type&&(c.options=["true","false"]),o&&(c.readonly=!0),a&&a.disableRequired&&(c.required=!1),c.options){for(var d=[],u=0;u<c.options.length;u++)d.push({name:"options."+c.options[u],value:c.options[u]});c.options=d}n.push(c)}}return n},getGlobalOption:function(e,t){return i.getGlobalOption({silent:!!t,callback:e})},setGlobalOption:function(e,t,a,n){var s={};return s[e]=t,i.changeGlobalOption({options:s,silent:!!n,callback:a})},getAria2Status:function(e,t){return i.getVersion({silent:!!t,callback:e})},getGlobalStat:function(e,t){return i.getGlobalStat({silent:!!t,callback:function(t){if(!e)return void s.warn("[aria2SettingService.getGlobalStat] callback is null");var a=o(t);e(a)}})},saveSession:function(e,t){return i.saveSession({silent:!!t,callback:e})},shutdown:function(e,t){return i.shutdown({silent:!!t,callback:e})}}}])}(),angular.module("ariaNg").run(["$templateCache",function(e){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-md-8 col-sm-7"><div class="row"><div class="col-sm-8"><a ng-click="changeDisplayOrder(\'name:asc\', true)" translate>File Name</a> <i class="fa" ng-class="{\'fa-sort-asc fa-order-asc\': isSetDisplayOrder(\'name:asc\'), \'fa-sort-desc fa-order-desc\': isSetDisplayOrder(\'name:desc\')}"></i></div><div class="col-sm-4"><a ng-click="changeDisplayOrder(\'size:asc\', true)" translate>File Size</a> <i class="fa" ng-class="{\'fa-sort-asc fa-order-asc\': isSetDisplayOrder(\'size:asc\'), \'fa-sort-desc fa-order-desc\': isSetDisplayOrder(\'size:desc\')}"></i></div></div></div><div class="col-md-2 col-sm-3"><div class="row"><div class="col-sm-6"><a ng-click="changeDisplayOrder(\'percent:desc\', true)" translate>Progress</a> <i class="fa" ng-class="{\'fa-sort-asc fa-order-asc\': isSetDisplayOrder(\'percent:asc\'), \'fa-sort-desc fa-order-desc\': isSetDisplayOrder(\'percent:desc\')}"></i></div><div class="col-sm-6"><a ng-click="changeDisplayOrder(\'remain:asc\', true)" translate>Remain Time</a> <i class="fa" ng-class="{\'fa-sort-asc fa-order-asc\': isSetDisplayOrder(\'remain:asc\'), \'fa-sort-desc fa-order-desc\': isSetDisplayOrder(\'remain:desc\')}"></i></div></div></div><div class="col-md-2 col-sm-2"><a ng-click="changeDisplayOrder(\'dspeed:desc\', true)" translate>Download Speed</a> <i class="fa" ng-class="{\'fa-sort-asc fa-order-asc\': isSetDisplayOrder(\'dspeed:asc\'), \'fa-sort-desc fa-order-desc\': isSetDisplayOrder(\'dspeed:desc\')}"></i></div></div></div><div class="task-table-body" ng-class="{\'draggable\': isSupportDragTask()}" dragula="\'task-list\'" dragula-model="taskContext.list"><div class="row" ng-repeat="task in taskContext.list | filter: filterByTaskName | taskOrderBy: getOrderType()" data-gid="{{task.gid}}"><div class="col-md-8 col-sm-7 col-xs-12"><div class="checkbox checkbox-primary" ng-class="{\'checkbox-hide\': !taskContext.selected[task.gid]}"><input id="{{\'task_\' + task.gid}}" type="checkbox" ng-model="taskContext.selected[task.gid]"><label for="{{\'task_\' + task.gid}}"><span class="task-name auto-ellipsis" ng-bind="task.taskName" title="{{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 class="pointer-cursor" ng-if="task && task.status == \'error\' && task.errorDescription && !task.bittorrent" ng-click="restart(task)" title="{{\'Restart\' | translate}}" translate>Restart</a></div></div><div class="col-md-2 col-sm-3 col-xs-12"><div class="progress"><div class="progress-bar" role="progressbar" ng-class="{\'progress-bar-primary\': task.status != \'error\', \'progress-bar-warning\': task.status == \'error\'}" aria-valuenow="{{task.completePercent}}" aria-valuemin="1" aria-valuemax="100" ng-style="{ width: 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 visible-xs-inline pull-right" ng-bind="task.status === \'waiting\' ? (\'Waiting\' | translate) : (task.status === \'paused\' ? (\'Paused\' | translate) : (task.status === \'active\' ? (!task.seeder || task.downloadSpeed > 0 ? (task.downloadSpeed | readableVolume) + \'/s\' : \'-\') : \'\'))"></span> <span class="task-seeders pull-right" ng-bind="task.status === \'active\' ? ((task.numSeeders ? (task.numSeeders + \'/\') : \'\') + task.connections) : \'\'"></span></div></div><div class="col-md-2 col-sm-2 hidden-xs"><span class="task-download-speed" ng-bind="task.status === \'waiting\' ? (\'Waiting\' | translate) : (task.status === \'paused\' ? (\'Paused\' | translate) : (task.status === \'active\' ? (!task.seeder || task.downloadSpeed > 0 ? (task.downloadSpeed | readableVolume) + \'/s\' : \'-\') : \'\'))"></span></div></div></div></div></section>'),e.put("views/new.html",'<section class="content no-padding"><form name="newTaskForm" ng-submit="startDownload()" novalidate><div class="nav-tabs-custom"><ul class="nav nav-tabs"><li ng-class="{\'active\': context.currentTab == \'links\'}"><a class="pointer-cursor" ng-click="changeTab(\'links\')" ng-bind="(context.taskType === \'torrent\' ? \'Torrent File\' : (context.taskType === \'metalink\' ? \'Metalink File\' : \'Links\') | translate)">Links</a></li><li ng-class="{\'active\': context.currentTab == \'options\'}"><a class="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 right-align"><li><a class="pointer-cursor" ng-click="openTorrent()" translate>Open Torrent File</a></li><li><a class="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\': !context.uploadFile && newTaskForm.$invalid, \'btn-success\': context.uploadFile || !newTaskForm.$invalid}" ng-disabled="!context.uploadFile && newTaskForm.$invalid" translate>Start Download</button>&nbsp; <button type="button" class="btn btn-sm dropdown-toggle" ng-class="{\'btn-default\': !context.uploadFile && newTaskForm.$invalid, \'btn-success\': context.uploadFile || !newTaskForm.$invalid}" ng-disabled="!context.uploadFile && newTaskForm.$invalid" data-toggle="dropdown"><span class="caret"></span></button><ul class="dropdown-menu right-align"><li><a class="pointer-cursor" ng-click="startDownload(true)" translate>Manual Download</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 translate>Download Links:</p><div class="form-group has-feedback no-margin" 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="10" autofocus="autofocus" ng-auto-focus ng-model="context.urls" ng-required="true" ng-keydown="urlTextboxKeyDown($event)" ng-placeholder="\'Support multiple URLs, one URL per line.\' | translate" ng-pattern="/^(\\n?(((http|https|ftp|ssh):\\/\\/.+)|(magnet:\\?.+)))*$/i"></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></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></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>:&nbsp;</span><div class="checkbox checkbox-inline checkbox-primary"><input id="optionFilterGlobal" type="checkbox" ng-model="context.optionFilter[\'global\']"><label for="optionFilterGlobal" translate>Global</label></div><div class="checkbox checkbox-inline checkbox-primary"><input id="optionFilterHttp" type="checkbox" ng-model="context.optionFilter[\'http\']"><label for="optionFilterHttp" translate>Http</label></div><div class="checkbox checkbox-inline checkbox-primary"><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" lazy-save-timeout="0" default-value="context.globalOptions[option.key]" on-change-value="setOption(key, value, optionStatus)"></ng-setting></div></div></div></div></form></section>'),e.put("views/setting-dialog.html",'<div id="quickSettingModal" class="modal fade" tabindex="-1" role="dialog"><div class="modal-dialog" role="document"><div class="modal-content"><div class="modal-header"><button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button><h4 class="modal-title" ng-bind="(setting ? (setting.title) : \'Quick Settings\') | translate">Quick Setting</h4></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 top" data-container="body" data-content="{{option.descriptionKey | translate}}"></i> <span class="description" ng-if="option.showCount && option.split && optionValue" 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()]"><input class="form-control" type="text" placeholder="{{::placeholder}}" ng-disabled="!!option.readonly" ng-if="option.type == \'string\' || option.type == \'integer\' || option.type == \'float\'" ng-model="optionValue" ng-change="changeValue(optionValue, true)"><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)"></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-addon" 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" 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 ng-class="{\'active\': isCurrentGlobalTab()}"><a class="pointer-cursor" ng-click="changeGlobalTab()" translate>Global</a></li><li class="nav-tab-title-rpcname" ng-repeat="setting in context.rpcSettings" ng-class="{\'active\': isCurrentRpcTab($index)}"><a class="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="pointer-cursor nav-tab-close" ng-if="!setting.isDefault" title="{{\'Delete RPC Setting\' | translate}}"><i class="fa fa-times" ng-click="removeRpcSetting(setting)"></i></a></li><li class="slim"><a class="pointer-cursor" ng-click="addNewRpcSetting()" title="{{\'Add New RPC Setting\' | translate}}"><i class="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"><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 language.displayName for (type, language) in context.languages" ng-change="setLanguage(context.settings.language)"></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 right" data-container="body" data-html="true" data-content="{{(\'Supported Placeholder\' | translate) + \':<br/>\' +\n                               (\'AriaNg Title\' | translate) + \': ${title}<br/>\' +\n                               (\'Downloading Count\' | translate) + \': ${downloading}<br/>\' +\n                                (\'Waiting Count\' | translate) + \': ${waiting}<br/>\' +\n                                (\'Stopped Count\' | translate) + \': ${stopped}<br/>\' +\n                                (\'Download Speed\' | translate) + \': ${downspeed}<br/>\' +\n                                (\'Upload Speed\' | translate) + \': ${upspeed}<br/><br/>\' +\n                                (\'Tips: You can use the &quot;noprefix&quot; tag to ignore the prefix, &quot;nosuffix&quot; tag ignore the suffix, and &quot;scale=n&quot; tag to set the decimal precision.\' | translate) + \'<br/>\' +\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"><div class="setting-key setting-key-without-desc col-sm-4"><span translate>Page Title Refresh 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" 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"><div class="setting-key setting-key-without-desc col-sm-4"><span translate>Global Stat Refresh 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>Download Task Refresh 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>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 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></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-addon" ng-bind="setting.protocol + \'://\'"></span> <input class="form-control" type="text" ng-model="setting.rpcHost" ng-change="updateRpcSetting(setting, \'rpcHost\')"> <span class="input-group-addon">:</span><div class="input-grougp-addon-container"><input class="form-control form-control-rpcport" type="text" ng-model="setting.rpcPort" ng-change="updateRpcSetting(setting, \'rpcPort\')"></div><span class="input-group-addon">/</span><div class="input-grougp-addon-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></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" translate>Http</option><option value="https" translate>Https</option><option value="ws" 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"><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-addon input-group-addon-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 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></section><script id="setting-changed-notification.html" type="text/ng-template"><div class="ui-notification custom-template">\n        <div class="message" ng-bind-html="message"></div>\n        <div class="message">\n            <a class="btn btn-small btn-primary close-notification" ng-click="refreshPage()" translate>Reload Page</a>\n        </div>\n    </div><\/script>'),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="label" ng-class="{\'label-primary\': context.status === \'Connecting\', \'label-success\': context.status === \'Connected\', \'label-danger\': context.status === \'Not Connected\'}" ng-bind="context.status | translate"></span></div></div><div class="row ng-cloak" ng-if="context.serverStatus"><div class="setting-key col-sm-4"><span translate>Aria2 Version</span></div><div class="setting-value col-sm-8"><span ng-bind="context.serverStatus.version"></span></div></div><div class="row ng-cloak" ng-if="context.serverStatus"><div class="setting-key col-sm-4"><span translate>Enabled Features</span></div><div class="setting-value col-sm-8"><div class="checkbox checkbox-primary checkbox-compact default-cursor" 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"><div class="setting-key setting-key-without-desc col-sm-4"><span translate>Functions</span></div><div class="setting-value col-sm-8"><button class="btn btn-sm btn-primary" ng-click="saveSession()" promise-btn><span translate>Save Session</span></button> <button class="btn btn-sm btn-danger" ng-click="shutdown()"><span translate>Shutdown Aria2</span></button></div></div></div></section>'),e.put("views/task-detail.html",'<section class="content no-padding" ng-if="task"><div class="nav-tabs-custom"><ul class="nav nav-tabs"><li ng-class="{\'active\': context.currentTab == \'overview\'}"><a class="pointer-cursor" ng-click="changeTab(\'overview\')" translate>Overview</a></li><li ng-class="{\'active\': context.currentTab == \'blocks\'}"><a class="pointer-cursor" ng-click="changeTab(\'blocks\')" translate>Blocks</a></li><li ng-class="{\'active\': context.currentTab == \'filelist\'}"><a class="pointer-cursor" ng-click="changeTab(\'filelist\')" translate>Files</a></li><li ng-class="{\'active\': context.currentTab == \'btpeers\'}" ng-if="task && task.status == \'active\' && task.bittorrent"><a class="pointer-cursor" ng-click="changeTab(\'btpeers\')" translate>Peers</a></li><li ng-class="{\'active\': context.currentTab == \'settings\'}" ng-if="task && (task.status == \'active\' || task.status == \'waiting\' || task.status == \'paused\')" class="slim"><a class="pointer-cursor" ng-click="changeTab(\'settings\')"><i class="fa fa-gear"></i></a></li></ul><div class="tab-content no-padding"><div class="tab-pane" ng-class="{\'active\': context.currentTab == \'overview\'}"><div class="settings-table striped hoverable"><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}"></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>Remain Time</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"><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" ng-bind="task.dir"></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> <span class="description-inline" ng-bind="\'format.settings.total-count\' | translate: {count: task.bittorrent.announceList.length}"></span> <i class="icon-expand pointer-cursor fa" 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"><div class="auto-ellipsis" ng-bind="serverAddress" title="{{serverAddress}}" ng-repeat="serverAddress in task.bittorrent.announceList | limitTo: (context.collapseTrackers ? 1 : task.bittorrent.announceList.length)"></div></div></div><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" height="200"></ng-chart></div></div></div></div></div><div class="tab-pane" ng-class="{\'active\': context.currentTab == \'blocks\'}"><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)" translate>File Name</a> <i class="fa" ng-class="{\'fa-sort-asc fa-order-asc\': isSetFileListDisplayOrder(\'name:asc\'), \'fa-sort-desc fa-order-desc\': isSetFileListDisplayOrder(\'name:desc\')}"></i> <a ng-click="showChooseFilesToolbar()" ng-if="task && task.files && task.files.length > 1 && (task.status == \'waiting\' || task.status == \'paused\')" translate>(Choose Files)</a></div><div class="col-sm-2"><a ng-click="changeFileListDisplayOrder(\'percent:desc\', true)" translate>Progress</a> <i class="fa" ng-class="{\'fa-sort-asc fa-order-asc\': isSetFileListDisplayOrder(\'percent:asc\'), \'fa-sort-desc fa-order-desc\': isSetFileListDisplayOrder(\'percent:desc\')}"></i></div><div class="col-sm-2"><a ng-click="changeFileListDisplayOrder(\'size:asc\', true)" translate>File Size</a> <i class="fa" ng-class="{\'fa-sort-asc fa-order-asc\': isSetFileListDisplayOrder(\'size:asc\'), \'fa-sort-desc fa-order-desc\': isSetFileListDisplayOrder(\'size:desc\')}"></i></div></div></div><div class="task-table-title" ng-if="context.showChooseFilesToolbar"><div class="row"><div class="col-sm-12"><button class="btn btn-xs btn-primary" ng-click="selectFiles(\'all\')" translate>Select All</button> <button class="btn btn-xs btn-primary" ng-click="selectFiles(\'none\')" translate>Select None</button> <button class="btn btn-xs btn-primary" ng-click="selectFiles(\'reverse\')" translate>Select Invert</button> <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-success" ng-click="saveChoosedFiles()" ng-disabled="getSelectedFileCount() < 1" translate>Confirm</button> <button class="btn btn-xs btn-default" ng-click="cancelChooseFiles()" translate>Cancel</button></div></div></div><div class="task-table-body"><div class="row" ng-repeat="file in task.files | fileOrderBy: getFileListOrderType()" data-file-index="{{file.index}}"><div class="col-sm-8"><div class="checkbox checkbox-primary"><input id="{{\'file_\' + file.index}}" type="checkbox" ng-disabled="!task || !task.files || task.files.length < 2 || (task.status != \'waiting\' && task.status != \'paused\')" ng-model="file.selected" ng-change="setSelectedFile()"><label for="{{\'file_\' + file.index}}" class="allow-word-break" ng-bind="file.fileName" title="{{file.fileName}}"></label></div></div><div class="col-sm-2"><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)" translate>Address</a> <i class="fa" ng-class="{\'fa-sort-asc fa-order-asc\': isSetPeerListDisplayOrder(\'address:asc\'), \'fa-sort-desc fa-order-desc\': isSetPeerListDisplayOrder(\'address:desc\')}"></i> <span>/</span> <a ng-click="changePeerListDisplayOrder(\'client:asc\', true)" translate>Client</a> <i class="fa" ng-class="{\'fa-sort-asc fa-order-asc\': isSetPeerListDisplayOrder(\'client:asc\'), \'fa-sort-desc fa-order-desc\': isSetPeerListDisplayOrder(\'client:desc\')}"></i></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)" translate>Progress</a> <i class="fa" ng-class="{\'fa-sort-asc fa-order-asc\': isSetPeerListDisplayOrder(\'percent:asc\'), \'fa-sort-desc fa-order-desc\': isSetPeerListDisplayOrder(\'percent:desc\')}"></i></div></div></div><div class="col-md-3 col-sm-4"><a ng-click="changePeerListDisplayOrder(\'dspeed:desc\', true)" translate>Download</a> <i class="fa" ng-class="{\'fa-sort-asc fa-order-asc\': isSetPeerListDisplayOrder(\'dspeed:asc\'), \'fa-sort-desc fa-order-desc\': isSetPeerListDisplayOrder(\'dspeed:desc\')}"></i> <span>/</span> <a ng-click="changePeerListDisplayOrder(\'uspeed:desc\', true)" translate>Upload</a> <i class="fa" ng-class="{\'fa-sort-asc fa-order-asc\': isSetPeerListDisplayOrder(\'uspeed:asc\'), \'fa-sort-desc fa-order-desc\': isSetPeerListDisplayOrder(\'uspeed:desc\')}"></i> <span translate>Speed</span></div></div></div><div class="task-table-body"><div class="row" ng-repeat="peer in context.btPeers | peerOrderBy: getPeerListOrderType()"><div class="col-md-4 col-sm-4 col-xs-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-xs-12"><div class="row"><div class="col-md-9 col-sm-7 col-xs-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 hidden-xs text-right"><span ng-bind="(peer.completePercent | percent: 2) + \'%\'"></span></div></div></div><div class="visible-xs col-xs-4"><span ng-bind="(peer.completePercent | percent: 2) + \'%\'"></span></div><div class="col-md-3 col-sm-4 col-xs-8"><div class="task-peer-download-speed"><i class="icon-download fa fa-arrow-down"></i> <span ng-bind="(peer.downloadSpeed | readableVolume) + \'/s\'"></span>&nbsp; <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</section>')}]);