Compare commits
11 Commits
dev-2025-0
...
main
Author | SHA1 | Date | |
---|---|---|---|
![]() |
fe4743c770 | ||
![]() |
dcdb24e7a2 | ||
![]() |
632788cf4b | ||
![]() |
022aab507a | ||
![]() |
0171d061af | ||
![]() |
0f829ca414 | ||
![]() |
0d089dffce | ||
![]() |
2035c249d1 | ||
![]() |
89e1708b15 | ||
![]() |
9fee83a20d | ||
![]() |
37d32f521e |
71
README.md
Normal file
71
README.md
Normal file
@ -0,0 +1,71 @@
|
||||
# luci-app-openlist
|
||||
|
||||
🗂️ A file list program that supports multiple storage, powered by Gin and Solidjs.
|
||||
|
||||
## How to build
|
||||
|
||||
- Install `libfuse` development package.
|
||||
|
||||
- ubuntu/debian:
|
||||
```shell
|
||||
sudo apt update
|
||||
sudo apt install libfuse-dev
|
||||
```
|
||||
|
||||
- redhat:
|
||||
```shell
|
||||
sudo yum install fuse-devel
|
||||
```
|
||||
|
||||
- arch:
|
||||
```shell
|
||||
sudo pacman -S fuse2
|
||||
```
|
||||
|
||||
- Enter in your openwrt dir
|
||||
|
||||
- Openwrt official SnapShots
|
||||
|
||||
*1. requires golang 1.24.x or latest version (Fix build for older branches of OpenWrt.)*
|
||||
```shell
|
||||
rm -rf feeds/packages/lang/golang
|
||||
git clone https://github.com/sbwml/packages_lang_golang -b 24.x feeds/packages/lang/golang
|
||||
```
|
||||
|
||||
*2. get luci-app-openlist code & building*
|
||||
```shell
|
||||
git clone https://github.com/sbwml/luci-app-openlist package/openlist
|
||||
make menuconfig # choose LUCI -> Applications -> luci-app-openlist
|
||||
make package/openlist/luci-app-openlist/compile V=s # build luci-app-openlist
|
||||
```
|
||||
|
||||
--------------
|
||||
|
||||
## How to install prebuilt packages
|
||||
|
||||
- Login OpenWrt terminal (SSH)
|
||||
|
||||
- Install `curl` package
|
||||
```shell
|
||||
# for opkg package manager (openwrt 21.02 ~ 24.10)
|
||||
opkg update
|
||||
opkg install curl
|
||||
|
||||
# for apk package manager
|
||||
apk update
|
||||
apk add curl
|
||||
```
|
||||
|
||||
- Execute install script (Multi-architecture support)
|
||||
```shell
|
||||
sh -c "$(curl -ksS https://raw.githubusercontent.com/sbwml/luci-app-openlist/main/install.sh)"
|
||||
```
|
||||
|
||||
install via ghproxy:
|
||||
```shell
|
||||
sh -c "$(curl -ksS https://raw.githubusercontent.com/sbwml/luci-app-openlist/main/install.sh)" _ gh_proxy="https://gh.cooluc.com"
|
||||
```
|
||||
|
||||
--------------
|
||||
|
||||

|
157
install.sh
Executable file
157
install.sh
Executable file
@ -0,0 +1,157 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
# Define color codes and output functions
|
||||
RED='\033[1;31m'
|
||||
GREEN='\033[1;32m'
|
||||
RESET='\033[0m'
|
||||
|
||||
msg_red() { printf "${RED}%s${RESET}\n" "$*"; }
|
||||
msg_green() { printf "${GREEN}%s${RESET}\n" "$*"; }
|
||||
|
||||
# Parse gh_proxy from $1 if provided, e.g. gh_proxy="https://gh-proxy.com/"
|
||||
gh_proxy=""
|
||||
if [ -n "$1" ]; then
|
||||
case "$1" in
|
||||
gh_proxy=*)
|
||||
gh_proxy="${1#gh_proxy=}"
|
||||
# ensure gh_proxy ends with /
|
||||
[ -n "$gh_proxy" ] && case "$gh_proxy" in
|
||||
*/) : ;;
|
||||
*) gh_proxy="$gh_proxy/" ;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
# Check if running on OpenWrt
|
||||
if [ ! -f /etc/openwrt_release ]; then
|
||||
msg_red "Unknown OpenWrt Version"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Read architecture information
|
||||
. /etc/openwrt_release
|
||||
DISTRIB_ARCH="${DISTRIB_ARCH:-unknown}"
|
||||
|
||||
# Detect package manager and set SDK version
|
||||
if [ -x "/usr/bin/apk" ]; then
|
||||
PKG_MANAGER="apk"
|
||||
PKG_OPT="add --allow-untrusted"
|
||||
SDK="SNAPSHOT"
|
||||
elif command -v opkg >/dev/null 2>&1; then
|
||||
PKG_MANAGER="opkg"
|
||||
PKG_OPT="install --force-downgrade"
|
||||
SDK="openwrt-24.10"
|
||||
else
|
||||
msg_red "No supported package manager found."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check LuCI version compatibility
|
||||
if [ ! -d "/usr/share/luci/menu.d" ]; then
|
||||
msg_red "OpenWrt LuCI version is not supported. The minimum required version is openwrt-21.02 or higher."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check available root partition space (at least 35MB required)
|
||||
ROOT_SPACE=$(df -m /usr | awk 'END{print $4}')
|
||||
if [ "$ROOT_SPACE" -lt 35 ]; then
|
||||
msg_red "Error: The system storage space is less than 35MB."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Create temporary directory and set up cleanup on exit
|
||||
TEMP_DIR="$(mktemp -d)"
|
||||
trap 'rm -rf "$TEMP_DIR"' EXIT
|
||||
|
||||
# Check if the current platform is supported
|
||||
msg_green "Checking platform..."
|
||||
|
||||
SUPPORTED_PLATFORMS="
|
||||
aarch64_cortex-a53
|
||||
aarch64_cortex-a72
|
||||
aarch64_cortex-a76
|
||||
aarch64_generic
|
||||
arm_arm1176jzf-s_vfp
|
||||
arm_arm926ej-s
|
||||
arm_cortex-a15_neon-vfpv4
|
||||
arm_cortex-a5_vfpv4
|
||||
arm_cortex-a7
|
||||
arm_cortex-a7_neon-vfpv4
|
||||
arm_cortex-a7_vfpv4
|
||||
arm_cortex-a8_vfpv3
|
||||
arm_cortex-a9
|
||||
arm_cortex-a9_neon
|
||||
arm_cortex-a9_vfpv3-d16
|
||||
arm_fa526
|
||||
arm_xscale
|
||||
i386_pentium-mmx
|
||||
i386_pentium4
|
||||
loongarch64_generic
|
||||
mips64_mips64r2
|
||||
mips64_octeonplus
|
||||
mips64el_mips64r2
|
||||
mips_24kc
|
||||
mips_4kec
|
||||
mips_mips32
|
||||
mipsel_24kc
|
||||
mipsel_24kc_24kf
|
||||
mipsel_74kc
|
||||
mipsel_mips32
|
||||
riscv64_riscv64
|
||||
x86_64
|
||||
"
|
||||
|
||||
FOUND=0
|
||||
for arch in $SUPPORTED_PLATFORMS; do
|
||||
if [ "$DISTRIB_ARCH" = "$arch" ]; then
|
||||
FOUND=1
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
if [ "$FOUND" -ne 1 ]; then
|
||||
msg_red "Error! The current \"$DISTRIB_ARCH\" platform is not supported."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Download the corresponding package archive
|
||||
PKG_FILE="$SDK-$DISTRIB_ARCH.tar.gz"
|
||||
BASE_URL="https://github.com/sbwml/luci-app-openlist/releases/latest/download/$PKG_FILE"
|
||||
if [ -n "$gh_proxy" ]; then
|
||||
PKG_URL="${gh_proxy}${BASE_URL}"
|
||||
else
|
||||
PKG_URL="$BASE_URL"
|
||||
fi
|
||||
|
||||
msg_green "Downloading $PKG_URL ..."
|
||||
if ! curl --connect-timeout 5 -m 300 -kLo "$TEMP_DIR/$PKG_FILE" "$PKG_URL"; then
|
||||
msg_red "Download $PKG_FILE failed."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Stop openlist service
|
||||
if [ -x "/etc/init.d/openlist" ]; then
|
||||
/etc/init.d/openlist stop || true
|
||||
fi
|
||||
|
||||
# Extract and install packages
|
||||
msg_green "Installing Packages ..."
|
||||
tar -zxf "$TEMP_DIR/$PKG_FILE" -C "$TEMP_DIR/"
|
||||
for pkg in "$TEMP_DIR"/packages_ci/openlist*.* \
|
||||
"$TEMP_DIR"/packages_ci/luci-app-openlist*.* \
|
||||
"$TEMP_DIR"/packages_ci/luci-i18n-openlist-zh-cn*.*; do
|
||||
[ -f "$pkg" ] && $PKG_MANAGER $PKG_OPT $pkg
|
||||
done
|
||||
|
||||
# Clean up temporary files and finish
|
||||
rm -rf /tmp/luci-*
|
||||
|
||||
# Start openlist service
|
||||
if [ -x "/etc/init.d/openlist" ]; then
|
||||
/etc/init.d/openlist start || true
|
||||
fi
|
||||
|
||||
msg_green "Done!"
|
@ -6,7 +6,7 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=luci-app-openlist
|
||||
PKG_VERSION:=1.0.0
|
||||
PKG_VERSION:=1.0.1
|
||||
PKG_RELEASE:=1
|
||||
|
||||
LUCI_TITLE:=LuCI support for openlist
|
||||
|
@ -23,12 +23,18 @@ function getServiceStatus() {
|
||||
});
|
||||
}
|
||||
|
||||
function renderStatus(isRunning, protocol, webport) {
|
||||
function renderStatus(isRunning, protocol, webport, site_url) {
|
||||
var spanTemp = '<em><span style="color:%s"><strong>%s %s</strong></span></em>';
|
||||
var renderHTML;
|
||||
if (isRunning) {
|
||||
var button = String.format('<input class="cbi-button-reload" type="button" style="margin-left: 50px" value="%s" onclick="window.open(\'%s//%s:%s/\')">',
|
||||
_('Open Web Interface'), protocol, window.location.hostname, webport);
|
||||
var buttonUrl = '';
|
||||
if (site_url && site_url.trim() !== '') {
|
||||
buttonUrl = site_url;
|
||||
} else {
|
||||
buttonUrl = String.format('%s//%s:%s/', protocol, window.location.hostname, webport);
|
||||
}
|
||||
var button = String.format('<input class="cbi-button-reload" type="button" style="margin-left: 50px" value="%s" onclick="window.open(\'%s\')">',
|
||||
_('Open Web Interface'), buttonUrl);
|
||||
renderHTML = spanTemp.format('green', 'OpenList', _('RUNNING')) + button;
|
||||
} else {
|
||||
renderHTML = spanTemp.format('red', 'OpenList', _('NOT RUNNING'));
|
||||
@ -71,6 +77,7 @@ return view.extend({
|
||||
} else if (ssl === '1') {
|
||||
protocol = 'https:';
|
||||
}
|
||||
var site_url = uci.get(data[0], '@openlist[0]', 'site_url') || '';
|
||||
|
||||
m = new form.Map('openlist', _('OpenList'),
|
||||
_('A file list program that supports multiple storage.'));
|
||||
@ -83,7 +90,7 @@ return view.extend({
|
||||
poll.add(function () {
|
||||
return L.resolveDefault(getServiceStatus()).then(function (res) {
|
||||
var view = document.getElementById('service_status');
|
||||
view.innerHTML = renderStatus(res, protocol, webport);
|
||||
view.innerHTML = renderStatus(res, protocol, webport, site_url);
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -7,14 +7,15 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=openlist
|
||||
PKG_WEB_VERSION:=4.0.0-rc.4
|
||||
PKG_VERSION:=4.0.2
|
||||
PKG_WEB_VERSION:=4.0.2
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://github.com/OpenListTeam/OpenList.git
|
||||
PKG_SOURCE_DATE:=2025-06-17
|
||||
PKG_SOURCE_VERSION:=87ca1b96aeefb2221a4f9ae401d6895bd48931b6
|
||||
PKG_MIRROR_HASH:=759742a4d5aad7053bf74fefaeb06317c70dbc4766bfd32492ff8406d05c7c84
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://codeload.github.com/OpenListTeam/OpenList/tar.gz/v$(PKG_VERSION)?
|
||||
PKG_HASH:=d6e7ca46748b1b1d21ff28850f5b25112930d3d2c211e8b9cec1041cbd3523d5
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/OpenList-$(PKG_VERSION)
|
||||
|
||||
PKG_LICENSE:=GPL-3.0
|
||||
PKG_LICENSE_FILE:=LICENSE
|
||||
@ -23,7 +24,7 @@ PKG_MAINTAINER:=sbwml <admin@cooluc.com>
|
||||
define Download/openlist-frontend
|
||||
FILE:=openlist-frontend-dist-v$(PKG_WEB_VERSION).tar.gz
|
||||
URL:=https://github.com/OpenListTeam/OpenList-Frontend/releases/download/v$(PKG_WEB_VERSION)/
|
||||
HASH:=cfed3dff5001df22f7a0ae679c48270fbaf8bf77694f33694a235276c265eacf
|
||||
HASH:=f28d15059918dbaf4a0da2f2d92b4a956b46019d321f567217ad4318076c2462
|
||||
endef
|
||||
|
||||
PKG_BUILD_DEPENDS:=golang/host
|
||||
@ -81,6 +82,7 @@ define Build/Prepare
|
||||
$(TAR) --strip-components=1 -C $(PKG_BUILD_DIR)/public/dist -xzf $(DL_DIR)/openlist-frontend-dist-v$(PKG_WEB_VERSION).tar.gz
|
||||
$(SED) 's_https://docs.oplist.org/logo.png_/assets/logo.png_g' $(PKG_BUILD_DIR)/public/dist/index.html
|
||||
$(SED) 's_https://docs.oplist.org/logo.svg_/assets/logo.svg_g' $(PKG_BUILD_DIR)/public/dist/index.html
|
||||
$(SED) 's_https://docs.oplist.org/logo.png_/assets/logo.png_g' $(PKG_BUILD_DIR)/public/dist/static/manifest.json
|
||||
endef
|
||||
|
||||
define Package/openlist/install
|
||||
|
Binary file not shown.
23
openlist/src/public/dist/assets/polyfill.min.js
vendored
Normal file
23
openlist/src/public/dist/assets/polyfill.min.js
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
/* Polyfill service v3.111.0
|
||||
* Disable minification (remove `.min` from URL path) for more info */
|
||||
|
||||
(function(self, undefined) {function ArrayCreate(r){if(1/r==-Infinity&&(r=0),r>Math.pow(2,32)-1)throw new RangeError("Invalid array length");var n=[];return n.length=r,n}function Call(t,l){var n=arguments.length>2?arguments[2]:[];if(!1===IsCallable(t))throw new TypeError(Object.prototype.toString.call(t)+"is not a function.");return t.apply(l,n)}function Get(n,t){return n[t]}function HasOwnProperty(r,t){return Object.prototype.hasOwnProperty.call(r,t)}function HasProperty(n,r){return r in n}function IsArray(r){return"[object Array]"===Object.prototype.toString.call(r)}function IsCallable(n){return"function"==typeof n}function RequireObjectCoercible(e){if(null===e||e===undefined)throw TypeError(Object.prototype.toString.call(e)+" is not coercible to Object.");return e}function SameValueNonNumber(e,n){return e===n}function ToBoolean(o){return Boolean(o)}function ToObject(e){if(null===e||e===undefined)throw TypeError();return Object(e)}function GetV(t,e){return ToObject(t)[e]}function GetMethod(e,n){var r=GetV(e,n);if(null===r||r===undefined)return undefined;if(!1===IsCallable(r))throw new TypeError("Method not callable: "+n);return r}function Type(e){switch(typeof e){case"undefined":return"undefined";case"boolean":return"boolean";case"number":return"number";case"string":return"string";case"symbol":return"symbol";default:return null===e?"null":"Symbol"in self&&(e instanceof self.Symbol||e.constructor===self.Symbol)?"symbol":"object"}}function GetPrototypeFromConstructor(t,o){var r=Get(t,"prototype");return"object"!==Type(r)&&(r=o),r}var GetSubstitution=function(){function e(e){return/^[0-9]$/.test(e)}return function t(n,r,l,i,a,f){for(var s=n.length,h=r.length,c=l+s,u=i.length,v="",g=0;g<f.length;g+=1){var o=f.charAt(g),$=g+1>=f.length,d=g+2>=f.length;if("$"!==o||$)v+=f.charAt(g);else{var p=f.charAt(g+1);if("$"===p)v+="$",g+=1;else if("&"===p)v+=n,g+=1;else if("`"===p)v+=0===l?"":r.slice(0,l-1),g+=1;else if("'"===p)v+=c>=h?"":r.slice(c),g+=1;else{var A=d?null:f.charAt(g+2);if(!e(p)||"0"===p||!d&&e(A))if(e(p)&&(d||e(A))){var y=p+A,I=parseInt(y,10)-1;v+=y<=u&&"Undefined"===Type(i[I])?"":i[I],g+=2}else v+="$";else{var T=parseInt(p,10);v+=T<=u&&"Undefined"===Type(i[T-1])?"":i[T-1],g+=1}}}}return v}}();function IsConstructor(t){return"object"===Type(t)&&("function"==typeof t&&!!t.prototype)}function IsRegExp(e){if("object"!==Type(e))return!1;var n="Symbol"in self&&"match"in self.Symbol?Get(e,self.Symbol.match):undefined;if(n!==undefined)return ToBoolean(n);try{var t=e.lastIndex;return e.lastIndex=0,RegExp.prototype.exec.call(e),!0}catch(l){}finally{e.lastIndex=t}return!1}function OrdinaryToPrimitive(r,t){if("string"===t)var e=["toString","valueOf"];else e=["valueOf","toString"];for(var i=0;i<e.length;++i){var n=e[i],a=Get(r,n);if(IsCallable(a)){var o=Call(a,r);if("object"!==Type(o))return o}}throw new TypeError("Cannot convert to primitive.")}function SameValueZero(n,e){return Type(n)===Type(e)&&("number"===Type(n)?!(!isNaN(n)||!isNaN(e))||(1/n===Infinity&&1/e==-Infinity||(1/n==-Infinity&&1/e===Infinity||n===e)):SameValueNonNumber(n,e))}function StringIndexOf(r,n,e){var f=r.length;if(""===n&&e<=f)return e;for(var t=n.length,a=e,i=-1;a+t<=f;){for(var g=!0,o=0;o<t;o+=1)if(r[a+o]!==n[o]){g=!1;break}if(g){i=a;break}a+=1}return i}function ToInteger(n){if("symbol"===Type(n))throw new TypeError("Cannot convert a Symbol value to a number");var t=Number(n);return isNaN(t)?0:1/t===Infinity||1/t==-Infinity||t===Infinity||t===-Infinity?t:(t<0?-1:1)*Math.floor(Math.abs(t))}function ToLength(n){var t=ToInteger(n);return t<=0?0:Math.min(t,Math.pow(2,53)-1)}function ToPrimitive(e){var t=arguments.length>1?arguments[1]:undefined;if("object"===Type(e)){if(arguments.length<2)var i="default";else t===String?i="string":t===Number&&(i="number");var r="function"==typeof self.Symbol&&"symbol"==typeof self.Symbol.toPrimitive?GetMethod(e,self.Symbol.toPrimitive):undefined;if(r!==undefined){var n=Call(r,e,[i]);if("object"!==Type(n))return n;throw new TypeError("Cannot convert exotic object to primitive.")}return"default"===i&&(i="number"),OrdinaryToPrimitive(e,i)}return e}function ToString(t){switch(Type(t)){case"symbol":throw new TypeError("Cannot convert a Symbol value to a string");case"object":return ToString(ToPrimitive(t,String));default:return String(t)}}function ToPropertyKey(r){var i=ToPrimitive(r,String);return"symbol"===Type(i)?i:ToString(i)}if (!("defineProperty"in Object&&function(){try{var e={}
|
||||
return Object.defineProperty(e,"test",{value:42}),!0}catch(t){return!1}}()
|
||||
)) {!function(e){var t=Object.prototype.hasOwnProperty.call(Object.prototype,"__defineGetter__"),r="A property cannot both have accessors and be writable or have a value";Object.defineProperty=function n(o,i,f){if(e&&(o===window||o===document||o===Element.prototype||o instanceof Element))return e(o,i,f);if(null===o||!(o instanceof Object||"object"==typeof o))throw new TypeError("Object.defineProperty called on non-object");if(!(f instanceof Object))throw new TypeError("Property description must be an object");var c=String(i),a="value"in f||"writable"in f,p="get"in f&&typeof f.get,s="set"in f&&typeof f.set;if(p){if(p===undefined)return o;if("function"!==p)throw new TypeError("Getter must be a function");if(!t)throw new TypeError("Getters & setters cannot be defined on this javascript engine");if(a)throw new TypeError(r);Object.__defineGetter__.call(o,c,f.get)}else o[c]=f.value;if(s){if(s===undefined)return o;if("function"!==s)throw new TypeError("Setter must be a function");if(!t)throw new TypeError("Getters & setters cannot be defined on this javascript engine");if(a)throw new TypeError(r);Object.__defineSetter__.call(o,c,f.set)}return"value"in f&&(o[c]=f.value),o}}(Object.defineProperty);}function CreateDataProperty(e,r,t){var a={value:t,writable:!0,enumerable:!0,configurable:!0};try{return Object.defineProperty(e,r,a),!0}catch(n){return!1}}function CreateDataPropertyOrThrow(t,r,o){var e=CreateDataProperty(t,r,o);if(!e)throw new TypeError("Cannot assign value `"+Object.prototype.toString.call(o)+"` to property `"+Object.prototype.toString.call(r)+"` on object `"+Object.prototype.toString.call(t)+"`");return e}function CreateMethodProperty(e,r,t){var a={value:t,writable:!0,enumerable:!1,configurable:!0};Object.defineProperty(e,r,a)}if (!("forEach"in Array.prototype
|
||||
)) {CreateMethodProperty(Array.prototype,"forEach",function r(t){var e=ToObject(this),n=e instanceof String?e.split(""):e,o=ToLength(Get(e,"length"));if(!1===IsCallable(t))throw new TypeError(t+" is not a function");for(var a=arguments.length>1?arguments[1]:undefined,i=0;i<o;){var f=ToString(i);if(HasProperty(n,f)){var l=Get(n,f);Call(t,a,[l,i,e])}i+=1}return undefined});}if (!("includes"in Array.prototype
|
||||
)) {CreateMethodProperty(Array.prototype,"includes",function e(r){"use strict";var t=ToObject(this),o=ToLength(Get(t,"length"));if(0===o)return!1;var n=ToInteger(arguments[1]);if(n>=0)var a=n;else(a=o+n)<0&&(a=0);for(;a<o;){var i=Get(t,ToString(a));if(SameValueZero(r,i))return!0;a+=1}return!1});}if (!("indexOf"in Array.prototype
|
||||
)) {CreateMethodProperty(Array.prototype,"indexOf",function r(t){var e=ToObject(this),n=ToLength(Get(e,"length"));if(0===n)return-1;var i=ToInteger(arguments[1]);if(i>=n)return-1;if(i>=0)var o=1/i==-Infinity?0:i;else(o=n+i)<0&&(o=0);for(;o<n;){if(HasProperty(e,ToString(o))){if(t===Get(e,ToString(o)))return o}o+=1}return-1});}if (!("bind"in Function.prototype
|
||||
)) {CreateMethodProperty(Function.prototype,"bind",function t(n){var r=Array,o=Object,e=r.prototype,l=function g(){},p=e.slice,a=e.concat,i=e.push,c=Math.max,u=this;if(!IsCallable(u))throw new TypeError("Function.prototype.bind called on incompatible "+u);for(var y,h=p.call(arguments,1),s=function(){if(this instanceof y){var t=u.apply(this,a.call(h,p.call(arguments)));return o(t)===t?t:this}return u.apply(n,a.call(h,p.call(arguments)))},f=c(0,u.length-h.length),b=[],d=0;d<f;d++)i.call(b,"$"+d);return y=Function("binder","return function ("+b.join(",")+"){ return binder.apply(this, arguments); }")(s),u.prototype&&(l.prototype=u.prototype,y.prototype=new l,l.prototype=null),y});}if (!("freeze"in Object
|
||||
)) {CreateMethodProperty(Object,"freeze",function e(r){return r});}if (!("getOwnPropertyDescriptor"in Object&&"function"==typeof Object.getOwnPropertyDescriptor&&function(){try{return"3"===Object.getOwnPropertyDescriptor("13.7",1).value}catch(t){return!1}}()
|
||||
)) {!function(){var e=Object.getOwnPropertyDescriptor,t=function(){try{return 1===Object.defineProperty(document.createElement("div"),"one",{get:function(){return 1}}).one}catch(e){return!1}},r={}.toString,n="".split;CreateMethodProperty(Object,"getOwnPropertyDescriptor",function c(o,i){var a=ToObject(o);a=("string"===Type(a)||a instanceof String)&&"[object String]"==r.call(o)?n.call(o,""):Object(o);var u=ToPropertyKey(i);if(t)try{return e(a,u)}catch(l){}if(HasOwnProperty(a,u))return{enumerable:!0,configurable:!0,writable:!0,value:a[u]}})}();}if (!("getPrototypeOf"in Object
|
||||
)) {CreateMethodProperty(Object,"getPrototypeOf",function t(o){if(o!==Object(o))throw new TypeError("Object.getPrototypeOf called on non-object");var e=o.__proto__;return e||null===e?e:"function"==typeof o.constructor&&o instanceof o.constructor?o.constructor.prototype:o instanceof Object?Object.prototype:null});}if (!("keys"in Object&&function(){return 2===Object.keys(arguments).length}(1,2)&&function(){try{return Object.keys(""),!0}catch(t){return!1}}()
|
||||
)) {CreateMethodProperty(Object,"keys",function(){"use strict";function t(){var t;try{t=Object.create({})}catch(r){return!0}return o.call(t,"__proto__")}function r(t){var r=n.call(t),e="[object Arguments]"===r;return e||(e="[object Array]"!==r&&null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Function]"===n.call(t.callee)),e}var e=Object.prototype.hasOwnProperty,n=Object.prototype.toString,o=Object.prototype.propertyIsEnumerable,c=!o.call({toString:null},"toString"),l=o.call(function(){},"prototype"),i=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],u=function(t){var r=t.constructor;return r&&r.prototype===t},a={$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},f=function(){if("undefined"==typeof window)return!1;for(var t in window)try{if(!a["$"+t]&&e.call(window,t)&&null!==window[t]&&"object"==typeof window[t])try{u(window[t])}catch(r){return!0}}catch(r){return!0}return!1}(),p=function(t){if("undefined"==typeof window||!f)return u(t);try{return u(t)}catch(r){return!1}};return function s(o){var u="[object Function]"===n.call(o),a=r(o),f="[object String]"===n.call(o),s=[];if(o===undefined||null===o)throw new TypeError("Cannot convert undefined or null to object");var y=l&&u;if(f&&o.length>0&&!e.call(o,0))for(var h=0;h<o.length;++h)s.push(String(h));if(a&&o.length>0)for(var g=0;g<o.length;++g)s.push(String(g));else for(var w in o)t()&&"__proto__"===w||y&&"prototype"===w||!e.call(o,w)||s.push(String(w));if(c)for(var d=p(o),$=0;$<i.length;++$)d&&"constructor"===i[$]||!e.call(o,i[$])||s.push(i[$]);return s}}());}if (!("defineProperties"in Object
|
||||
)) {CreateMethodProperty(Object,"defineProperties",function e(r,t){if("object"!==Type(r))throw new TypeError("Object.defineProperties called on non-object");for(var o=ToObject(t),n=Object.keys(o),c=[],i=0;i<n.length;i++){var b=n[i],f=Object.getOwnPropertyDescriptor(o,b);if(f!==undefined&&f.enumerable){var p=Get(o,b),a=p;c.push([b,a])}}for(var j=0;j<c.length;j++){var d=c[j][0];a=c[j][1],Object.defineProperty(r,d,a)}return r});}if (!("create"in Object
|
||||
)) {!function(){function e(){}if({__proto__:null}instanceof Object)t=function(){var e=document.createElement("iframe");e.style.display="none";var o=document.body||document.documentElement;o.appendChild(e),e.src="javascript:";var n=e.contentWindow.Object.prototype;o.removeChild(e),e=null,delete n.constructor,delete n.hasOwnProperty,delete n.propertyIsEnumerable,delete n.isPrototypeOf,delete n.toLocaleString,delete n.toString,delete n.valueOf;var r=function l(){};return r.prototype=n,t=function(){return new r},new r};else var t=function(){return{__proto__:null}};CreateMethodProperty(Object,"create",function o(n,r){if("object"!==Type(n)&&"null"!==Type(n))throw new TypeError("Object prototype may only be an Object or null");if("null"===Type(n))var l=t();else e.prototype=n,l=new e,l.__proto__=n,l.constructor.prototype=n,l.__proto__=n;return 1 in arguments?Object.defineProperties(l,r):l})}();}function OrdinaryCreateFromConstructor(r,e){var t=arguments[2]||{},o=GetPrototypeFromConstructor(r,e),a=Object.create(o);for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&Object.defineProperty(a,n,{configurable:!0,enumerable:!1,writable:!0,value:t[n]});return a}function Construct(r){var t=arguments.length>2?arguments[2]:r,o=arguments.length>1?arguments[1]:[];if(!IsConstructor(r))throw new TypeError("F must be a constructor.");if(!IsConstructor(t))throw new TypeError("newTarget must be a constructor.");if(t===r)return new(Function.prototype.bind.apply(r,[null].concat(o)));var n=OrdinaryCreateFromConstructor(t,Object.prototype);return Call(r,n,o)}function ArraySpeciesCreate(e,r){if(0===r&&1/r==-Infinity&&(r=0),!1===IsArray(e))return ArrayCreate(r);var n=Get(e,"constructor");if("object"===Type(n)&&null===(n="Symbol"in self&&"species"in self.Symbol?Get(n,self.Symbol.species):undefined)&&(n=undefined),n===undefined)return ArrayCreate(r);if(!IsConstructor(n))throw new TypeError("C must be a constructor");return Construct(n,[r])}if (!("filter"in Array.prototype
|
||||
)) {CreateMethodProperty(Array.prototype,"filter",function r(e){var t=ToObject(this),o=ToLength(Get(t,"length"));if(!1===IsCallable(e))throw new TypeError(e+" is not a function");for(var a=arguments.length>1?arguments[1]:undefined,n=ArraySpeciesCreate(t,0),i=0,l=0;i<o;){var f=ToString(i);if(HasProperty(t,f)){var h=Get(t,f);ToBoolean(Call(e,a,[h,i,t]))&&(CreateDataPropertyOrThrow(n,ToString(l),h),l+=1)}i+=1}return n});}if (!("map"in Array.prototype
|
||||
)) {CreateMethodProperty(Array.prototype,"map",function r(e){var t=ToObject(this),a=ToLength(Get(t,"length"));if(!1===IsCallable(e))throw new TypeError(e+" is not a function");for(var o=arguments.length>1?arguments[1]:undefined,n=ArraySpeciesCreate(t,a),i=0;i<a;){var p=ToString(i);if(HasProperty(t,p)){var h=Get(t,p),l=Call(e,o,[h,i,t]);CreateDataPropertyOrThrow(n,p,l)}i+=1}return n});}if (!("getOwnPropertyNames"in Object&&function(){try{return Object.getOwnPropertyNames(1),!0}catch(t){return!1}}()
|
||||
)) {!function(){var t={}.toString,e="".split,r=[].concat,o=Object.prototype.hasOwnProperty,c=Object.getOwnPropertyNames||Object.keys,n="object"==typeof self?c(self):[];CreateMethodProperty(Object,"getOwnPropertyNames",function l(a){var p=ToObject(a);if("[object Window]"===t.call(p))try{return c(p)}catch(j){return r.call([],n)}p="[object String]"==t.call(p)?e.call(p,""):Object(p);for(var i=c(p),s=["length","prototype"],O=0;O<s.length;O++){var b=s[O];o.call(p,b)&&!i.includes(b)&&i.push(b)}if(i.includes("__proto__")){var f=i.indexOf("__proto__");i.splice(f,1)}return i})}();}if (!("flags"in RegExp.prototype
|
||||
)) {Object.defineProperty(RegExp.prototype,"flags",{configurable:!0,enumerable:!1,get:function(){var e=this;if("object"!==Type(e))throw new TypeError("Method called on incompatible type: must be an object.");var o="";return ToBoolean(Get(e,"global"))&&(o+="g"),ToBoolean(Get(e,"ignoreCase"))&&(o+="i"),ToBoolean(Get(e,"multiline"))&&(o+="m"),ToBoolean(Get(e,"unicode"))&&(o+="u"),ToBoolean(Get(e,"sticky"))&&(o+="y"),o}});}if (!("Symbol"in self&&0===self.Symbol.length
|
||||
)) {!function(e,r,n){"use strict";function t(e){if("symbol"===Type(e))return e;throw TypeError(e+" is not a symbol")}var u,o=function(){try{var r={};return e.defineProperty(r,"t",{configurable:!0,enumerable:!1,get:function(){return!0},set:undefined}),!!r.t}catch(n){return!1}}(),i=0,a=""+Math.random(),c="__symbol:",l=c.length,f="__symbol@@"+a,s={},v="defineProperty",y="defineProperties",b="getOwnPropertyNames",p="getOwnPropertyDescriptor",h="propertyIsEnumerable",m=e.prototype,d=m.hasOwnProperty,g=m[h],w=m.toString,S=Array.prototype.concat,P=e.getOwnPropertyNames?e.getOwnPropertyNames(self):[],O=e[b],j=function $(e){if("[object Window]"===w.call(e))try{return O(e)}catch(r){return S.call([],P)}return O(e)},E=e[p],N=e.create,T=e.keys,_=e.freeze||e,k=e[v],F=e[y],I=E(e,b),x=function(e,r,n){if(!d.call(e,f))try{k(e,f,{enumerable:!1,configurable:!1,writable:!1,value:{}})}catch(t){e[f]={}}e[f]["@@"+r]=n},z=function(e,r){var n=N(e);return j(r).forEach(function(e){q.call(r,e)&&L(n,e,r[e])}),n},A=function(e){var r=N(e);return r.enumerable=!1,r},D=function ee(){},M=function(e){return e!=f&&!d.call(H,e)},W=function(e){return e!=f&&d.call(H,e)},q=function re(e){var r=""+e;return W(r)?d.call(this,r)&&this[f]&&this[f]["@@"+r]:g.call(this,e)},B=function(r){var n={enumerable:!1,configurable:!0,get:D,set:function(e){u(this,r,{enumerable:!1,configurable:!0,writable:!0,value:e}),x(this,r,!0)}};try{k(m,r,n)}catch(o){m[r]=n.value}H[r]=k(e(r),"constructor",J);var t=E(G.prototype,"description");return t&&k(H[r],"description",t),_(H[r])},C=function(e){var r=t(e);if(Y){var n=V(r);if(""!==n)return n.slice(1,-1)}if(s[r]!==undefined)return s[r];var u=r.toString(),o=u.lastIndexOf("0.");return u=u.slice(10,o),""===u?undefined:u},G=function ne(){var r=arguments[0];if(this instanceof ne)throw new TypeError("Symbol is not a constructor");var n=c.concat(r||"",a,++i);r===undefined||null!==r&&!isNaN(r)&&""!==String(r)||(s[n]=String(r));var t=B(n);return o||e.defineProperty(t,"description",{configurable:!0,enumerable:!1,value:C(t)}),t},H=N(null),J={value:G},K=function(e){return H[e]},L=function te(e,r,n){var t=""+r;return W(t)?(u(e,t,n.enumerable?A(n):n),x(e,t,!!n.enumerable)):k(e,r,n),e},Q=function(e){return function(r){return d.call(e,f)&&d.call(e[f],"@@"+r)}},R=function ue(e){return j(e).filter(e===m?Q(e):W).map(K)};I.value=L,k(e,v,I),I.value=R,k(e,"getOwnPropertySymbols",I),I.value=function oe(e){return j(e).filter(M)},k(e,b,I),I.value=function ie(e,r){var n=R(r);return n.length?T(r).concat(n).forEach(function(n){q.call(r,n)&&L(e,n,r[n])}):F(e,r),e},k(e,y,I),I.value=q,k(m,h,I),I.value=G,k(n,"Symbol",I),I.value=function(e){var r=c.concat(c,e,a);return r in m?H[r]:B(r)},k(G,"for",I),I.value=function(e){if(M(e))throw new TypeError(e+" is not a symbol");return d.call(H,e)?e.slice(2*l,-a.length):void 0},k(G,"keyFor",I),I.value=function ae(e,r){var n=E(e,r);return n&&W(r)&&(n.enumerable=q.call(e,r)),n},k(e,p,I),I.value=function ce(e,r){return 1===arguments.length||void 0===r?N(e):z(e,r)},k(e,"create",I);var U=null===function(){return this}.call(null);if(I.value=U?function(){var e=w.call(this);return"[object String]"===e&&W(this)?"[object Symbol]":e}:function(){if(this===window)return"[object Null]";var e=w.call(this);return"[object String]"===e&&W(this)?"[object Symbol]":e},k(m,"toString",I),u=function(e,r,n){var t=E(m,r);delete m[r],k(e,r,n),e!==m&&k(m,r,t)},function(){try{var r={};return e.defineProperty(r,"t",{configurable:!0,enumerable:!1,get:function(){return!0},set:undefined}),!!r.t}catch(n){return!1}}()){var V;try{V=Function("s","var v = s.valueOf(); return { [v]() {} }[v].name;")}catch(Z){}var X=function(){},Y=V&&"inferred"===X.name?V:null;e.defineProperty(n.Symbol.prototype,"description",{configurable:!0,enumerable:!1,get:function(){return C(this)}})}}(Object,0,self);}if (!("Symbol"in self&&"replace"in self.Symbol
|
||||
)) {Object.defineProperty(Symbol,"replace",{value:Symbol("replace")});}if (!("replaceAll"in String.prototype
|
||||
)) {CreateMethodProperty(String.prototype,"replaceAll",function e(r,t){"use strict";var n=RequireObjectCoercible(this);if(r!==undefined&&null!==r){if(IsRegExp(r)){var i=Get(r,"flags");if(!("flags"in RegExp.prototype||!0===r.global))throw TypeError("");if("flags"in RegExp.prototype&&(RequireObjectCoercible(i),-1===ToString(i).indexOf("g")))throw TypeError("")}var l="Symbol"in self&&"replace"in self.Symbol?GetMethod(r,self.Symbol.replace):undefined;if(l!==undefined)return Call(l,r,[n,t])}var o=ToString(n),a=ToString(r),f=IsCallable(t);!1===f&&(t=ToString(t));for(var g=a.length,s=Math.max(1,g),u=[],p=StringIndexOf(o,a,0);-1!==p;)u.push(p),p=StringIndexOf(o,a,p+s);for(var d=0,b="",S=0;S<u.length;S++){var h=o.substring(d,u[S]);if(f)var c=ToString(Call(t,undefined,[a,u[S],o]));else{var v=[];c=GetSubstitution(a,o,u[S],v,undefined,t)}b=b+h+c,d=u[S]+g}return d<o.length&&(b+=o.substring(d)),b});}})('object' === typeof window && window || 'object' === typeof self && self || 'object' === typeof global && global || {});
|
Loading…
x
Reference in New Issue
Block a user