mazey 4.0.7 → 4.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -21
- package/README.md +990 -990
- package/lib/browser.d.ts +90 -0
- package/lib/browser.d.ts.map +1 -0
- package/lib/calc.d.ts +106 -0
- package/lib/calc.d.ts.map +1 -0
- package/lib/debug.d.ts +40 -0
- package/lib/debug.d.ts.map +1 -0
- package/lib/dom.d.ts +164 -0
- package/lib/dom.d.ts.map +1 -0
- package/lib/event.d.ts +76 -0
- package/lib/event.d.ts.map +1 -0
- package/lib/global.d.ts +87 -0
- package/lib/index.cjs.js +2 -2
- package/lib/index.d.ts +10 -2040
- package/lib/index.d.ts.map +1 -1
- package/lib/index.esm.js +2 -2
- package/lib/load.d.ts +169 -0
- package/lib/load.d.ts.map +1 -0
- package/lib/mazey.min.js +2 -2
- package/lib/perf.d.ts +199 -0
- package/lib/perf.d.ts.map +1 -0
- package/lib/store.d.ts +216 -0
- package/lib/store.d.ts.map +1 -0
- package/lib/typing.d.ts +88 -74
- package/lib/url.d.ts +246 -0
- package/lib/url.d.ts.map +1 -0
- package/lib/util.d.ts +841 -0
- package/lib/util.d.ts.map +1 -0
- package/package.json +124 -122
- package/scripts/README.md +38 -38
- package/scripts/build-helper.js +76 -76
- package/scripts/dev.js +23 -23
- package/scripts/git-helper.js +163 -163
- package/scripts/release.js +9 -9
- package/scripts/rollup.config.mjs +121 -152
- package/scripts/env-win.sh +0 -2
- package/scripts/mac-build.sh +0 -8
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;;AAIH,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;;AAIH,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,OAAO,CAAC;AACtB,cAAc,OAAO,CAAC;AACtB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC"}
|
package/lib/index.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Mazey v4.
|
|
2
|
+
* Mazey v4.1.1 https://github.com/mazeyqian/mazey
|
|
3
3
|
* (c) 2018-2024 Cheng
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
var e=function(){return e=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},e.apply(this,arguments)};function n(e,n,t,r){return new(t||(t=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function u(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var n;e.done?o(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(a,u)}c((r=r.apply(e,n||[])).next())}))}function t(e,n){var t,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(u){return function(c){return function(u){if(t)throw new TypeError("Generator is already executing.");for(;i&&(i=0,u[0]&&(a=0)),a;)try{if(t=1,r&&(o=2&u[0]?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return a.label++,{value:u[1],done:!1};case 5:a.label++,r=u[1],u=[0];continue;case 7:u=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==u[0]&&2!==u[0])){a=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){a.label=u[1];break}if(6===u[0]&&a.label<o[1]){a.label=o[1],o=u;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(u);break}o[2]&&a.ops.pop(),a.trys.pop();continue}u=n.call(e,a)}catch(e){u=[6,e],r=0}finally{t=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,c])}}}function r(e,n){for(var t=e.length,r=n.length,o=w(new Array(t).fill(new Array(r).fill(0))),i=0;i<t;++i)for(var a=0;a<r;++a)if(e[i]===n[a]){var u=0;i>0&&a>0&&(u=o[i-1][a-1]),o[i][a]=u+1}var c=Array.prototype.concat.apply([],o);return Math.max.apply(Math,c)}function o(e,n){return r(e,n)}function i(e,n){for(var t=e.length,r=n.length,o=w(new Array(t).fill(new Array(r).fill(0))),i=0;i<t;++i)for(var a=0;a<r;++a)if(e[i]===n[a]){var u=0;i>0&&a>0&&(u=o[i-1][a-1]),o[i][a]=u+1}else{var c=[0,0],s=c[0],d=c[1];a>0&&(s=o[i][a-1]),i>0&&(d=o[i-1][a]),o[i][a]=Math.max(s,d)}var f=Array.prototype.concat.apply([],o);return Math.max.apply(Math,f)}function a(e,n){return i(e,n)}function u(e){var n=new RegExp("(^|&)"+e+"=([^&]*)(&|$)"),t=location.search.substring(1).match(n);return null!==t?decodeURIComponent(t[2]):""}function c(e,n,t){void 0===t&&(t={});var r=null;if(e.includes("#")){r=new URL(e).searchParams.getAll(n)}else{var o={};e.replace(/\??(\w+)=([^&]*)&?/g,(function(e,n,t){return void 0!==o[n]?o[n].push(t):o[n]=[t],""})),r=o[n]||[]}return t.returnArray?r:r.length?r[0]:null}function s(e,n,t){if(e.includes("#")){var r=new URL(e);return r.searchParams.set(n,t),r.toString()}var o=new RegExp("([?&])"+n+"=.*?(&|$)","i"),i=-1!==e.indexOf("?")?"&":"?";return e.match(o)?e.replace(o,"$1"+n+"="+t+"$2"):e+i+n+"="+t}function d(e){var n=location.hash.split("?");if(1===n.length)return"";var t=new RegExp("(^|&)".concat(e,"=([^&]*)(&|$)")),r=n[1].match(t);return r?r[2]:""}function f(e,n){void 0===n&&(n=["hostname"]);var t=document.createElement("a");return t.href=e,n.reduce((function(e,n){return e+=t[n]}),"")}function l(e){var n=e.replace(/([A-Z])/g,"-$1").toLowerCase();return"-"===n[0]?n.substring(1):n}function p(e){return l(e)}function g(e){var n=e.replace(/([A-Z])/g,"_$1").toLowerCase();return"_"===n[0]?n.substring(1):n}function v(e){return g(e)}function h(e){for(var n=(e=e.replace(/^\s+/,"")).length-1,t=/\s/;t.test(e.charAt(n));)n--;return e.slice(0,n+1)}function m(e){if(!e)return"";var n=new RegExp("\\n","g");return e.replace(n,"<br />")}function w(n){if("object"!=typeof n)return n;var t=["string","number","boolean","undefined"];return Object.values(n).every((function(e){return t.includes(typeof e)}))?e({},n):JSON.parse(JSON.stringify(n))}function y(e){return w(e)}function b(e){try{if("object"==typeof JSON.parse(e))return!0}catch(e){}return!1}function E(e){return b(e)}function A(e){void 0===e&&(e=5);for(var n="";e--;)n+=Math.floor(10*Math.random());return n}function S(e){return void 0===e&&(e=5),A(e)}function T(e){void 0===e&&(e=3);var n=[$(),S(e||3)];return n[0]+n[1]}function x(e){return void 0===e&&(e=3),T(e)}function M(e,n){void 0===n&&(n=0);var t="";return t=n?(100*e).toFixed(n):String(Math.floor(100*e)),"".concat(t,"%")}function O(e,n){return void 0===n&&(n=0),parseFloat(e).toFixed(n)}function _(e){var n=e||window.event;n.stopPropagation?n.stopPropagation():n.cancelBubble=!0}function k(e,n){for(var t=e.className.split(/\s+/),r=0;r<t.length;r++)if(t[r]===n)return!0;return!1}function P(e,n){var t,r=e.className,o="";""!==r&&(o=" "),t=r+o+n,e.className=t}function N(e,n){var t;t=(t=(t=(t=" "+e.className+" ").replace(/(\s+)/gi," ")).replace(" "+n+" "," ")).replace(/(^\s+)|(\s+$)/g,""),e.className=t}function R(e,n,t){void 0===t&&(t={}),t=Object.assign({},t);var r=null,o=null,i=null,a=[null,0],u=a[0],c=a[1],s=function(){c=!1===t.leading?0:$(),i=null,u=e.apply(this,o),i||(r=o=null)};return function(){for(var a=[],d=0;d<arguments.length;d++)a[d]=arguments[d];var f=$();c||!1!==t.leading||(c=f);var l=n-(f-c);return r=this,o=a,l<=0||l>n?(i&&(clearTimeout(i),i=null),c=f,u=e.apply(r,o),i||(r=o=null)):i||!1===t.trailing||(i=setTimeout(s.bind(r),l)),u}}function C(e,n,t){var r=null,o=null,i=null,a=null,u=null,c=function c(){var s=$()-i;s<n&&s>=0?o=setTimeout(c,n-s):(o=null,t||(u=e.apply(r,a),o||(r=a=null)))};return function(){for(var s=[],d=0;d<arguments.length;d++)s[d]=arguments[d];r=this,a=s,i=$();var f=t&&!o;return o||(o=setTimeout(c,n)),f&&(u=e.apply(r,a),r=a=null),u}}"function"==typeof SuppressedError&&SuppressedError;var j={type:"d"};function B(e,n,t){void 0===e&&(e=0),void 0===n&&(n=0),void 0===t&&(t=j);var r=(t=Object.assign(j,t)).type;D(e)||(e=new Date(e).getTime()),D(n)||(n=new Date(n).getTime());var o=Number(n)-Number(e),i="",a=new Array(4).fill(0),u=a[0],c=(a[1],a[2],a[3]),s=decodeURIComponent("%20%E5%A4%A9%20"),d=decodeURIComponent("%20%E6%97%B6%20"),f=decodeURIComponent("%20%E5%88%86%20"),l=decodeURIComponent("%20%E7%A7%92");if(o>=0)switch(u=Math.floor(o/1e3/60/60/24),Math.floor(o/1e3/60/60),Math.floor(o/1e3/60),c=Math.floor(o/1e3),r){case"d":i=u;break;case"text":i=(u=Math.floor(o/1e3/60/60/24))+s+Math.floor(o/1e3/60/60%24)+d+Math.floor(o/1e3/60%60)+f+(c=Math.floor(o/1e3%60))+l;break;default:i=c}return i}function D(e,n){void 0===n&&(n={});var t=n.isNaNAsNumber,r=void 0!==t&&t,o=n.isInfinityAsNumber,i=void 0!==o&&o,a=n.isUnFiniteAsNumber;return"number"==typeof e&&(!(!0!==i&&!0!==(void 0!==a&&a)&&!isFinite(e))&&!(!r&&isNaN(e)))}function F(e){for(var n=[],t=1;t<arguments.length;t++)n[t-1]=arguments[t];var r=null;return e&&"function"==typeof e&&(r=e.apply(void 0,n)),r}function I(e,n){void 0===n&&(n=null),e&&sessionStorage.setItem(e,JSON.stringify(n))}function L(e){var n=null;if(e){var t=sessionStorage.getItem(e);t&&(n=JSON.parse(t))}return n}function q(e,n){void 0===n&&(n=null),e&&localStorage.setItem(e,JSON.stringify(n))}function z(e){var n=null;if(e){var t=localStorage.getItem(e);t&&(n=JSON.parse(t))}return n}function Z(e,n){void 0===n&&(n={id:""});var t,r=n.id,o=function(){},i=new Promise((function(e,n){var r;t=(r=[e,n])[0],o=r[1]})),a=function(){t("loaded")},u=document.createElement("link");u||o(new Error("Not support create link element"));var c="onload"in u,s=+navigator.userAgent.replace(/.*(?:AppleWebKit|AndroidWebKit)\/?(\d+).*/i,"$1")<536;if(u.rel="stylesheet",u.type="text/css",u.href=e,void 0!==r&&(u.id=r),document.getElementsByTagName("head")[0].appendChild(u),s||!c)return setTimeout((function(){f(u,a,0)}),1),i;function d(){u&&(u.onload=u.onerror=u.onreadystatechange=null),u=null,a()}function f(e,n,t){if(e){var r,o=e.sheet;if((t+=1)>3e5)return r=!0,e&&(e=null),void n();if(s)o&&(r=!0);else if(o)try{o.cssRules&&(r=!0)}catch(e){var i=e;if(!i.name)return;"NS_ERROR_DOM_SECURITY_ERR"===i.name&&(r=!0)}setTimeout((function(){r?n():f(e,n,t)}),20)}}return c?(u.onload=d,u.onerror=function(){d()}):u.onreadystatechange=function(){u&&/loaded|complete/.test(u.readyState)&&d()},i}function U(e,n){void 0===n&&(n={id:"",callback:function(){},timeout:5e3,isDefer:!1});var t,r,o=Object.assign({id:"",callback:function(){},timeout:5e3,isDefer:!1},n),i=o.id,a=o.callback,u=o.timeout,c=o.isDefer,s=document.createElement("script");s||Promise.reject("Not support create script element");var d=document.getElementsByTagName("script")[0];return s.type="text/javascript",c&&(s.defer=!0),i&&(s.id=i),s.readyState?s.onreadystatechange=function(){"loaded"!==s.readyState&&"complete"!==s.readyState||(s.onreadystatechange=null,F(a),F(t,"loaded"))}:s.onload=function(){F(a),F(t,"loaded")},s.src=e,d&&d.parentNode.insertBefore(s,d),new Promise((function(e,n){var o;t=(o=[e,n])[0],r=o[1],u&&setTimeout(r.bind(null,"timeout"),u)}))}function $(){return Date.now?Date.now():(new Date).getTime()}function W(e,n,t,r){var o,i;if(t){var a=new Date;a.setTime(a.getTime()+24*t*60*60*1e3),i="; expires="+a.toUTCString()}else i="";var u=location.host;1===u.split(".").length?document.cookie=e+"="+n+i+"; path=/":((o=u.split(".")).shift(),r=r||"."+o.join("."),document.cookie=e+"="+n+i+"; path=/; domain="+r,null!==V(e)&&V(e)===n||(r=r||"."+u,document.cookie=e+"="+n+i+"; path=/; domain="+r))}function V(e){for(var n=e+"=",t=document.cookie.split(";"),r=0;r<t.length;r++){for(var o=t[r];" "==o.charAt(0);)o=o.substring(1,o.length);if(0==o.indexOf(n))return o.substring(n.length,o.length)}return""}function J(e){for(var n=document.cookie.split(";"),t=0;t<n.length;t++){var r=n[t].trim();if(r.startsWith("".concat(e,"="))){var o=r.split("=")[0],i=new Date;return i.setTime(i.getTime()-1),document.cookie="".concat(o,"=;expires=").concat(i.toUTCString()),!0}}return!1}function Y(e){var n=[],t=window.PerformanceObserver;return!!t&&(ge(t.supportedEntryTypes)&&(n=t.supportedEntryTypes),n.includes(e))}function H(){return n(this,void 0,void 0,(function(){return t(this,(function(e){return Y("paint")?[2,new Promise((function(e){var n=new PerformanceObserver((function(t){var r=t.getEntries().find((function(e){return"first-contentful-paint"===e.name}));r&&(n.disconnect(),e(Math.round(r.startTime)))}));n.observe({type:"paint",buffered:!0})}))]:[2,0]}))}))}function G(){return n(this,void 0,void 0,(function(){return t(this,(function(e){return Y("paint")?[2,new Promise((function(e){var n=new PerformanceObserver((function(t){var r=t.getEntries().find((function(e){return"first-paint"===e.name}));r&&(n.disconnect(),e(Math.round(r.startTime)))}));n.observe({type:"paint",buffered:!0})}))]:[2,0]}))}))}function K(){return n(this,void 0,void 0,(function(){return t(this,(function(e){return Y("largest-contentful-paint")?[2,new Promise((function(e){var n=new PerformanceObserver((function(t){var r=t.getEntries().find((function(e){return"largest-contentful-paint"===e.entryType}));r&&(n.disconnect(),e(Math.round(r.startTime)))}));n.observe({type:"largest-contentful-paint",buffered:!0})}))]:[2,0]}))}))}function Q(){return n(this,void 0,void 0,(function(){return t(this,(function(e){return Y("first-input")?[2,new Promise((function(e){var n=new PerformanceObserver((function(t){var r=t.getEntries().find((function(e){return"first-input"===e.entryType}));if(r){n.disconnect();var o=r.processingStart;e(o?Math.round(r.processingStart-r.startTime):0)}}));n.observe({type:"first-input",buffered:!0})}))]:[2,0]}))}))}function X(){return n(this,void 0,void 0,(function(){return t(this,(function(e){return Y("layout-shift")?[2,new Promise((function(e){var n=new PerformanceObserver((function(t){var r=t.getEntries().reduce((function(e,n){var t=0;return D(n.value)&&(t=n.value),e+t}),0);n.disconnect(),e(r)}));n.observe({type:"layout-shift",buffered:!0})}))]:[2,0]}))}))}function ee(){return n(this,void 0,void 0,(function(){var e,n;return t(this,(function(t){return Y("navigation")&&window.performance&&window.performance.getEntriesByType?(e=performance.getEntriesByType("navigation")[0],0,e?(n=e.responseStart-e.requestStart,[2,Math.round(n)]):[2,0]):[2,0]}))}))}function ne(e){return void 0===e&&(e=!1),n(this,void 0,void 0,(function(){function n(){var n={source:F,os:r(),osVersion:o(),deviceType:i(),network:a(),screenDirection:u(),unloadTime:h-m,redirectTime:w-y,dnsTime:b-E,tcpTime:A-S,sslTime:c(A,T),responseTime:x-M,downloadTime:O-x,firstPaintTime:q,firstContentfulPaintTime:z,domReadyTime:_-I,onloadTime:k-I,whiteTime:x-I,renderTime:P-I,decodedBodySize:C,encodedBodySize:j};Object.keys(n).forEach((function(e){D(n[e])&&(n[e]<0?n[e]=0:n[e]=Math.round(n[e]))})),D(n.whiteTime)&&n.whiteTime>n.onloadTime&&(n.whiteTime=0);var t={};e||Object.keys(n).forEach((function(e){t[v(e)]=n[e]})),Object.keys(t).length?d(t):d(n)}function r(){return navigator.userAgent.indexOf("Android")>-1||navigator.userAgent.indexOf("Linux")>-1?"android":navigator.userAgent.indexOf("iPhone")>-1?"ios":navigator.userAgent.indexOf("Windows Phone")>-1?"wp":"others"}function o(){var e="",n=navigator.userAgent,t=n.indexOf("Android")>-1||n.indexOf("Linux")>-1,r=!!n.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),o=navigator.userAgent.split(";");if(o.length<2)return e;var i=o[1];return i?(t&&(e=(i.match(/\d+\.\d+/g)||[])[0]),r&&(e=(i.match(/(\d+)_(\d+)_?(\d+)?/)||[])[0]),e||(e=""),e):e}function i(){var e,n=navigator.userAgent.toLowerCase(),t=n.match(/(ipad)/i)&&"ipad",r=n.match(/iphone os/i)&&"iphone os",o=n.match(/midp/i)&&"midp",i=n.match(/rv:1.2.3.4/i)&&"rv:1.2.3.4",a=n.match(/ucweb/i)&&"ucweb",u=n.match(/android/i)&&"android",c=n.match(/windows ce/i)&&"windows ce",s=n.match(/windows mobile/i)&&"windows mobile";return(e=t||r||o||i||a||u||c||s?r||o||i||a||u||c||s?"phone":t?"ipad":void 0:"pc")||(e=""),e}function a(){var e="",n=window.navigator;if(n.connection&&n.connection.effectiveType)switch(n.connection.effectiveType){case"wifi":e="wifi";break;case"4g":e="4g";break;case"2g":e="2g";break;case"3g":e="3g";break;case"ethernet":e="ethernet";break;case"default":e=void 0}return e||(e=""),e}function u(){var e="";return window.screen&&window.screen.orientation&&window.screen.orientation.angle&&(180!==window.screen.orientation.angle&&0!==window.screen.orientation.angle||(e="|"),90!==window.screen.orientation.angle&&-90!==window.screen.orientation.angle||(e="-")),e}function c(e,n){var t=0;return n&&(t=e-n),t}var s,d,f,l,p,g,h,m,w,y,b,E,A,S,T,x,M,O,_,k,P,N,R,C,j,B,F,I,L,q,z;return t(this,(function(e){switch(e.label){case 0:if(!Y("navigation"))return[2,Promise.reject(new Error("navigation is not supported"))];if(!(s=window.performance)||"function"!=typeof s.getEntries||"function"!=typeof s.getEntriesByType)return[2,Promise.reject(new Error("performance is not supported"))];if(f=new Promise((function(e){d=[e][0]})),l=null,ge(p=s.getEntriesByType("navigation"))&&(l=p[0]),g=new Array(19).fill(0),h=g[0],m=g[1],w=g[2],y=g[3],b=g[4],E=g[5],A=g[6],S=g[7],T=g[8],x=g[9],M=g[10],O=g[11],_=g[12],k=g[13],P=g[14],N=g[15],R=g[16],C=g[17],j=g[18],B=s.timing,F="",l)F="PerformanceNavigationTiming",C=l.decodedBodySize,j=l.encodedBodySize,h=l.unloadEventEnd,m=l.unloadEventStart,w=l.redirectEnd,y=l.redirectStart,b=l.domainLookupEnd,E=l.domainLookupStart,A=l.connectEnd,S=l.connectStart,T=l.secureConnectionStart,x=l.responseStart,M=l.requestStart,O=l.responseEnd,_=l.domContentLoadedEventStart,k=l.loadEventStart,P=l.loadEventEnd,N=l.startTime,R=l.fetchStart;else{if(!B)return[2,Promise.reject(new Error("NavigationTiming and Timing are not supported"))];F="PerformanceTiming",h=B.unloadEventEnd,m=B.unloadEventStart,w=B.redirectEnd,y=B.redirectStart,b=B.domainLookupEnd,E=B.domainLookupStart,A=B.connectEnd,S=B.connectStart,T=B.secureConnectionStart,x=B.responseStart,M=B.requestStart,O=B.responseEnd,_=B.domContentLoadedEventStart,k=B.loadEventStart,P=B.loadEventEnd,N=B.navigationStart,R=B.fetchStart}if(I=0,D(N))I=N;else{if(!D(R))return[2,Promise.reject(new Error("startTime, navigationStart or fetchStart are required"))];I=R}return[4,Promise.all([G(),H()])];case 1:return L=e.sent(),q=L[0],z=L[1],D(P)&&P>0?n():window.addEventListener("load",(function(){window.setTimeout((function(){n()}),0)})),[2,f]}}))}))}function te(e){return Math.random()<e}function re(){var e=oe();return!(!("serviceWorker"in navigator&&function(){var e;try{return e=new Function("return async function(){};")(),null!=Object.getPrototypeOf(e).constructor}catch(e){return!1}}()&&"undefined"!=typeof Promise&&-1!==Promise.toString().indexOf("[native code]")&&Boolean(window.fetch)&&Boolean(window.indexedDB)&&Boolean(window.caches))||e.shell)}function oe(){if(window.MAZEY_BROWSER_INFO&&"object"==typeof window.MAZEY_BROWSER_INFO)return window.MAZEY_BROWSER_INFO;var n={engine:"",engineVs:"",platform:"",supporter:"",supporterVs:"",system:"",systemVs:""};try{var t=navigator.userAgent.toLowerCase();if(!t)return n;var r=function(e){return e.test(t)},o=function(e){var n="",r=t.match(e);return r&&ge(r)&&(n=(n=(n=r.toString()).replace(/[^0-9|_.]/g,"")).replace(/_/g,".")),n},i="",a="";r(/windows|win32|win64|wow32|wow64/g)?i="windows":r(/macintosh|macintel/g)?i="macos":r(/x11/g)?i="linux":r(/android|adr/g)?i="android":r(/ios|iphone|ipad|ipod|iwatch/g)&&(i="ios",r(/ipad/g)?a="ipad":r(/iphone/g)?a="iphone":r(/iwatch/g)?a="iwatch":r(/ipod/g)&&(a="ipod")),n=e(e({},n),{system:i,appleType:a});var u="";"windows"===i?r(/windows nt 5.0|windows 2000/g)?u="2000":r(/windows nt 5.1|windows xp/g)?u="xp":r(/windows nt 5.2|windows 2003/g)?u="2003":r(/windows nt 6.0|windows vista/g)?u="vista":r(/windows nt 6.1|windows 7/g)?u="7":r(/windows nt 6.2|windows 8/g)?u="8":r(/windows nt 6.3|windows 8.1/g)?u="8.1":r(/windows nt 10.0|windows 10/g)&&(u="10"):"macos"===i?u=o(/os x [\d._]+/g):"android"===i?u=o(/android [\d._]+/g):"ios"===i&&(u=o(/os [\d._]+/g)),n=e(e({},n),{systemVs:u});var c="";"windows"===i||"macos"===i||"linux"===i?c="desktop":("android"===i||"ios"===i||r(/mobile/g))&&(c="mobile"),n=e(e({},n),{platform:c});var s="",d="";r(/applewebkit/g)?(s="webkit",r(/edge/g)?d="edge":r(/opr/g)?d="opera":r(/chrome/g)?d="chrome":r(/safari/g)&&(d="safari")):r(/gecko/g)&&r(/firefox/g)?(s="gecko",d="firefox"):r(/presto/g)?(s="presto",d="opera"):r(/trident|compatible|msie/g)&&(s="trident",d="iexplore"),n=e(e({},n),{engine:s,supporter:d});var f="";"webkit"===s?f=o(/applewebkit\/[\d._]+/g):"gecko"===s?f=o(/gecko\/[\d._]+/g):"presto"===s?f=o(/presto\/[\d._]+/g):"trident"===s&&(f=o(/trident\/[\d._]+/g)),n=e(e({},n),{engineVs:f});var l="";"chrome"===d?l=o(/chrome\/[\d._]+/g):"safari"===d?l=o(/version\/[\d._]+/g):"firefox"===d?l=o(/firefox\/[\d._]+/g):"opera"===d?l=o(/opr\/[\d._]+/g):"iexplore"===d?l=o(/(msie [\d._]+)|(rv:[\d._]+)/g):"edge"===d&&(l=o(/edge\/[\d._]+/g)),n=e(e({},n),{supporterVs:l});var p="",g="";return r(/micromessenger/g)?(p="wechat",g=o(/micromessenger\/[\d._]+/g)):r(/qqbrowser/g)?(p="qq_browser",g=o(/qqbrowser\/[\d._]+/g)):r(/\sqq/g)?p="qq_app":r(/ucbrowser/g)?(p="uc",g=o(/ucbrowser\/[\d._]+/g)):r(/qihu 360se/g)?p="360":r(/2345explorer/g)?(p="2345",g=o(/2345explorer\/[\d._]+/g)):r(/metasr/g)?p="sougou":r(/lbbrowser/g)?p="liebao":r(/maxthon/g)?(p="maxthon",g=o(/maxthon\/[\d._]+/g)):r(/biliapp/g)&&(p="bilibili"),n=e(e({},n),{shell:p,shellVs:g}),window.MAZEY_BROWSER_INFO=n,n}catch(e){return console.warn("MazeyCon:",e),n}}function ie(e,n){void 0===n&&(n={});var t=n.removeNewLine,r=void 0!==t&&t,o="";return e&&(o=e.replace(/<\/?.+?>/g,""),r&&(o=o.replace(/[\r\n]/g,""))),o}function ae(e){var n={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};if("string"!=typeof e)throw new Error("Input must be a string");return e.replace(/[&<>"'/]/g,(function(e){return n[e]}))}function ue(e){var n={"&":"&","<":"<",">":">",""":'"',"'":"'","/":"/"};if("string"!=typeof e)throw new Error("Input must be a string");return e.replace(/(&|<|>|"|'|/)/g,(function(e){return n[e]}))}function ce(e,n,t){if(void 0===t&&(t=!1),""!=e&&e){for(var r=0,o="",i=/[^\x00-\xff]/g,a="",u=e.replace(i,"**").length,c=0;c<u&&(null!=(a=e.charAt(c).toString()).match(i)?r+=2:r++,!(r>n));c++)o+=a;return t&&u>n&&(o+="..."),o}return""}function se(e,n,t){return void 0===t&&(t=!1),ce(e,n,t)}function de(e){void 0===e&&(e=90);var n,t=function(){},r=new Promise((function(e,r){t=e,n=r}));return"complete"===document.readyState?t("complete"):window.addEventListener("load",(function(){return t("load")})),setTimeout((function(){return n(Error("timeout"))}),1e3*e),r}function fe(e,n){if(void 0===n&&(n={id:""}),!e)return!1;var t=document.createDocumentFragment(),r=null,o="",i=document.createElement("style");return n.id?(o="".concat(n.id),(r=document.getElementById(o))?r.innerHTML=e:(i.setAttribute("id",n.id),i.innerHTML=e,t.appendChild(i),document.head.appendChild(t))):(i.innerHTML=e,t.appendChild(i),document.head.appendChild(t)),!0}function le(e,n){void 0===e&&(e=""),void 0===n&&(n={isClosed:!1,showWrap:!1,showDate:!1,locales:"en-US",logFn:function(){},errorFn:function(){}});var t=Object.assign({isClosed:!1,showWrap:!1,showDate:!1,locales:"en-US",logFn:function(){},errorFn:function(){}},n),r=t.isClosed,o=t.showWrap,i=t.showDate,a=t.locales,u=t.logFn,c=t.errorFn,s=Object.create(null),d=function(){return(new Date).toLocaleDateString(a,{weekday:"short",year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"})};return["log","info","warn","error"].forEach((function(n){s[n]=function(){for(var t=[],a=0;a<arguments.length;a++)t[a]=arguments[a];if(r)return!1;var s=e,f=e;if("string"==typeof e&&e.length>=2){var l=e.length;s=":"===e[l-1]?e.substring(0,l-1):e}o&&console.log("--- ".concat(s," - begin ---")),i&&(f=e?"".concat(d()," ").concat(e):"".concat(d())),e||i?console[n].apply(console,function(e,n,t){if(t||2===arguments.length)for(var r,o=0,i=n.length;o<i;o++)!r&&o in n||(r||(r=Array.prototype.slice.call(n,0,o)),r[o]=n[o]);return e.concat(r||Array.prototype.slice.call(n))}([f],t,!1)):console[n].apply(console,t),"log"===n&&u(),"error"===n&&c(),o&&console.log("--- ".concat(s," - end ---"))}})),s}function pe(e,n){void 0===n&&(n={validStatusRange:[200,300],validCode:[0]});var t=Object.assign({validStatusRange:[200,300],validCode:[0]},n),r=t.validStatusRange,o=t.validCode;2!==r.length&&console.error("valid validStatusRange is required");var i=!1;if(e&&e.status&&2===r.length&&e.status>=r[0]&&e.status<r[1]){var a=e.data;a&&o.includes(a.code)&&(i=!0)}return i}function ge(e){var n=!1;return Array.isArray(e)&&e.length&&(n=!0),n}function ve(e,n,t){var r=!1;return"object"!=typeof e||n.reduce((function(e,n){return void 0===e[n]?Object.create(null):e=e[n]}),e)===t&&(r=!0),r}function he(e){var n=function(e){return String(Math.ceil(e))};if(!e)return"";var t=1024;return e<t?e+" B":e<Math.pow(t,2)?n(e/t)+" KB":e<Math.pow(t,3)?n(e/Math.pow(t,2))+" MB":e<Math.pow(t,4)?n(e/Math.pow(t,3))+" G":n(e/Math.pow(t,4))+" T"}function me(){return new Promise((function(e){var n=new Image;n.onload=function(){e(n.width>0&&n.height>0)},n.onerror=function(){e(!1)},n.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAAAAAAfQ//73v/+BiOh/AAA="}))}function we(e){var n,t=0;for(n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return t}function ye(e,n){void 0===n&&(n="yyyy-MM-dd"),e||(e=new Date);var t=new Date(e),r={yyyy:t.getFullYear(),MM:t.getMonth()+1,dd:t.getDate()<10?"0"+t.getDate():t.getDate(),hh:t.getHours()<10?"0"+t.getHours():t.getHours(),mm:t.getMinutes()<10?"0"+t.getMinutes():t.getMinutes(),ss:t.getSeconds()<10?"0"+t.getSeconds():t.getSeconds()},o=n||"yyyy-MM-dd";return Object.keys(r).forEach((function(e){var n=r[e];"MM"===e&&Number(n)<=9&&(n="0".concat(n)),o=o.replace(e,String(n))})),o}function be(){var e=window.MAZEY_DEFINE_LISTENERS;return"object"!=typeof e&&(e={},window.MAZEY_DEFINE_LISTENERS=e),e}function Ee(e,n){var t=be();void 0===t[e]&&(t[e]=[]),"function"==typeof n&&t[e].push(n)}function Ae(e){var n=be()[e];if(n instanceof Array)for(var t=0,r=n.length;t<r;t++)"function"==typeof n[t]&&n[t]({type:e})}function Se(e,n){var t=be(),r=t[e];if("string"==typeof e&&r instanceof Array)if("function"==typeof n){for(var o=0,i=r.length;o<i;o++)if(r[o]===n){t[e].splice(o,1);break}}else delete t[e]}function Te(e){return/^[a-zA-Z0-9]+:\/\/[-a-zA-Z0-9@:%._+~#=]{1,256}\b([-a-zA-Z0-9\u4E00-\u9FA5()!@:%_+.~#?&//=]*)$/.test(e)}function xe(e,n){void 0===n&&(n={strict:!0});var t=/^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9\u4E00-\u9FA5()!@:%_+.~#?&//=]*)/;return n.strict||(t=/^(https?:)?\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9\u4E00-\u9FA5()!@:%_+.~#?&//=]*)/),t.test(e)}function Me(e){return/^1\d{10}$/.test(e)}function Oe(e){return/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(e)}function _e(e){for(var n="";e>0;){var t=e%26;0===t&&(t=26),n=String.fromCharCode(t+96)+n,e=(e-t)/26}return n}function ke(e){var n="";if("string"!=typeof e||""==e)return n;var t=/\.[^/?#]+$/.exec(e);return t?(t[0].length>1&&(n=t[0].substring(1)),n):n}function Pe(){var e,n=window.jQuery||window.$;return n?!(!(e=n("img"))||!e.length)&&(e.each((function(){var e=n(this);if(e){var t=e.attr("src");if(t&&"string"==typeof t&&t.length){var r=t.match(/width=([0-9]+[a-z%]*)/),o=t.match(/height=([0-9]+[a-z%]*)/);r&&ge(r)&&r[1]&&e.width(r[1]),o&&ge(o)&&o[1]&&e.height(o[1])}}})),!0):(e=document.getElementsByTagName("img")).length>0&&(Array.from(e).forEach((function(e){var n=e;if(n){var t=n.getAttribute("src");if(t&&"string"==typeof t&&t.length){var r=t.match(/width=([0-9]+[a-z%]*)/),o=t.match(/height=([0-9]+[a-z%]*)/);r&&ge(r)&&r[1]&&(n.style.width=r[1]),o&&ge(o)&&o[1]&&(n.style.height=o[1])}}})),!0)}function Ne(e,n){var t="";return n&&n.length>0&&(t=n.join(";")+";"),"".concat(e,"{").concat(t,"}")}function Re(e){return new Promise((function(n,t){var r=new Image;r.onload=function(){n(r)},r.onerror=function(e){t(e)},r.src=e}))}function Ce(){return"v3"}function je(e,r,o){var i=this;void 0===r&&(r={}),void 0===o&&(o=function(e){return!0===e});var a=r.interval,u=void 0===a?1e3:a,c=r.times,s=void 0===c?10:c,d=r.context,f=r.args,l=0;"function"!=typeof e&&console.error("Expected a function."),("number"!=typeof u||u<0)&&console.error("Expected a non-negative number for interval."),("number"!=typeof s||s<0)&&console.error("Expected a non-negative number for times."),function r(){setTimeout((function(){return n(i,void 0,void 0,(function(){var n;return t(this,(function(t){switch(t.label){case 0:return[4,e.apply(d,f)];case 1:return n=t.sent(),o(n)||++l>=s?[2]:(r(),[2])}}))}))}),u)}()}function Be(e,n){return window[e]?Promise.resolve("defined"):U(n)}function De(e,n){void 0===n&&(n=""),n||(n=".js");for(var t=new RegExp("[?&]".concat(e,"=([^&]*)")),r=document.querySelectorAll('script[src*="'.concat(n,'"]')),o=0;o<r.length;o++){var i=r[o].getAttribute("src");if(i&&-1!==i.indexOf(n)){var a=i.match(t);if(a)return decodeURIComponent(a[1])}}return""}function Fe(e){return n(this,void 0,void 0,(function(){return t(this,(function(n){return[2,new Promise((function(n){setTimeout((function(){n(e)}),e)}))]}))}))}function Ie(e){return n(this,void 0,void 0,(function(){return t(this,(function(n){return[2,Fe(e)]}))}))}export{P as addClass,Ee as addEvent,fe as addStyle,a as calLongestCommonSubsequence,o as calLongestCommonSubstring,v as camelCase2Underscore,p as camelCaseToKebabCase,_ as cancelBubble,ie as clearHtml,_e as convert10To26,l as convertCamelToKebab,g as convertCamelToUnder,se as cutCHSString,C as debounce,w as deepCopy,y as deepCopyObject,J as delCookie,F as doFn,O as floatFixed,M as floatToPercent,ye as formatDate,le as genCustomConsole,we as genHashCode,A as genRndNumString,Ne as genStyleString,T as genUniqueNumString,S as generateRndNum,x as generateUniqueNum,oe as getBrowserInfo,X as getCLS,V as getCookie,Ce as getCurrentVersion,be as getDefineListeners,f as getDomain,H as getFCP,Q as getFID,G as getFP,he as getFileSize,B as getFriendlyInterval,d as getHashQueryParam,K as getLCP,z as getLocalStorage,ne as getPerformance,u as getQueryParam,De as getScriptQueryParam,L as getSessionStorage,ee as getTTFB,ke as getUrlFileType,c as getUrlParam,k as hasClass,te as inRate,Ae as invokeEvent,b as isJSONString,E as isJsonString,ge as isNonEmptyArray,D as isNumber,re as isSafePWAEnv,me as isSupportWebp,ve as isValidData,Oe as isValidEmail,xe as isValidHttpUrl,Me as isValidPhoneNumber,Te as isValidUrl,Z as loadCSS,Re as loadImage,U as loadScript,Be as loadScriptIfUndefined,i as longestComSubsequence,r as longestComSubstring,$ as mNow,h as mTrim,m as newLine,N as removeClass,Se as removeEvent,je as repeatUntilConditionMet,ae as sanitizeInput,W as setCookie,Pe as setImgWidHeiBySrc,q as setLocalStorage,I as setSessionStorage,Ie as sleep,R as throttle,ce as truncateZHString,ue as unsanitize,s as updateQueryParam,Fe as waitTime,de as windowLoaded,pe as zAxiosIsValidRes};
|
|
6
|
+
var e=function(){return e=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},e.apply(this,arguments)};function n(e,n,t,r){return new(t||(t=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function u(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var n;e.done?o(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(a,u)}c((r=r.apply(e,n||[])).next())}))}function t(e,n){var t,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(u){return function(c){return function(u){if(t)throw new TypeError("Generator is already executing.");for(;i&&(i=0,u[0]&&(a=0)),a;)try{if(t=1,r&&(o=2&u[0]?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return a.label++,{value:u[1],done:!1};case 5:a.label++,r=u[1],u=[0];continue;case 7:u=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==u[0]&&2!==u[0])){a=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){a.label=u[1];break}if(6===u[0]&&a.label<o[1]){a.label=o[1],o=u;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(u);break}o[2]&&a.ops.pop(),a.trys.pop();continue}u=n.call(e,a)}catch(e){u=[6,e],r=0}finally{t=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,c])}}}function r(e,n,t){if(t||2===arguments.length)for(var r,o=0,i=n.length;o<i;o++)!r&&o in n||(r||(r=Array.prototype.slice.call(n,0,o)),r[o]=n[o]);return e.concat(r||Array.prototype.slice.call(n))}function o(n){if("object"!=typeof n)return n;var t=["string","number","boolean","undefined"];return Object.values(n).every((function(e){return t.includes(typeof e)}))?e({},n):JSON.parse(JSON.stringify(n))}function i(e){return o(e)}function a(e){var n=e.replace(/([A-Z])/g,"-$1").toLowerCase();return"-"===n[0]?n.substring(1):n}function u(e){var n=e.replace(/-([a-z])/g,(function(e,n){return n.toUpperCase()}));return n.endsWith("-")?n.slice(0,-1):n}function c(e){return a(e)}function s(e){var n=e.replace(/([A-Z])/g,"_$1").toLowerCase();return"_"===n[0]?n.substring(1):n}function f(e){return s(e)}function d(e){for(var n=(e=e.replace(/^\s+/,"")).length-1,t=/\s/;t.test(e.charAt(n));)n--;return e.slice(0,n+1)}function l(e){try{if("object"==typeof JSON.parse(e))return!0}catch(e){}return!1}function p(e){return l(e)}function g(e){void 0===e&&(e=5);for(var n="";e--;)n+=Math.floor(10*Math.random());return n}function v(e){return void 0===e&&(e=5),g(e)}function h(e){void 0===e&&(e=3);var n=[w(),v(e||3)];return n[0]+n[1]}function m(e){return void 0===e&&(e=3),h(e)}function w(){return Date.now?Date.now():(new Date).getTime()}function y(e,n){void 0===n&&(n=0);var t="";return t=n?(100*e).toFixed(n):String(Math.floor(100*e)),"".concat(t,"%")}function b(e,n){return void 0===n&&(n=0),parseFloat(e).toFixed(n)}function E(e,n,t){void 0===t&&(t={}),t=Object.assign({},t);var r=null,o=null,i=null,a=[null,0],u=a[0],c=a[1],s=function(){c=!1===t.leading?0:w(),i=null,u=e.apply(this,o),i||(r=o=null)};return function(){for(var a=[],f=0;f<arguments.length;f++)a[f]=arguments[f];var d=w();c||!1!==t.leading||(c=d);var l=n-(d-c);return r=this,o=a,l<=0||l>n?(i&&(clearTimeout(i),i=null),c=d,u=e.apply(r,o),i||(r=o=null)):i||!1===t.trailing||(i=setTimeout(s.bind(r),l)),u}}function A(e,n,t){var r=null,o=null,i=null,a=null,u=null,c=function c(){var s=w()-i;s<n&&s>=0?o=setTimeout(c,n-s):(o=null,t||(u=e.apply(r,a),o||(r=a=null)))};return function(){for(var s=[],f=0;f<arguments.length;f++)s[f]=arguments[f];r=this,a=s,i=w();var d=t&&!o;return o||(o=setTimeout(c,n)),d&&(u=e.apply(r,a),r=a=null),u}}"function"==typeof SuppressedError&&SuppressedError;var S={type:"d"};function T(e,n,t){void 0===e&&(e=0),void 0===n&&(n=0),void 0===t&&(t=S);var r=(t=Object.assign(S,t)).type;x(e)||(e=new Date(e).getTime()),x(n)||(n=new Date(n).getTime());var o=Number(n)-Number(e),i="",a=new Array(4).fill(0),u=a[0],c=(a[1],a[2],a[3]),s=decodeURIComponent("%20%E5%A4%A9%20"),f=decodeURIComponent("%20%E6%97%B6%20"),d=decodeURIComponent("%20%E5%88%86%20"),l=decodeURIComponent("%20%E7%A7%92");if(o>=0)switch(u=Math.floor(o/1e3/60/60/24),Math.floor(o/1e3/60/60),Math.floor(o/1e3/60),c=Math.floor(o/1e3),r){case"d":i=u;break;case"text":i=(u=Math.floor(o/1e3/60/60/24))+s+Math.floor(o/1e3/60/60%24)+f+Math.floor(o/1e3/60%60)+d+(c=Math.floor(o/1e3%60))+l;break;default:i=c}return i}function x(e,n){void 0===n&&(n={});var t=n.isNaNAsNumber,r=void 0!==t&&t,o=n.isInfinityAsNumber,i=void 0!==o&&o,a=n.isUnFiniteAsNumber;return"number"==typeof e&&(!(!0!==i&&!0!==(void 0!==a&&a)&&!isFinite(e))&&!(!r&&isNaN(e)))}function M(e){for(var n=[],t=1;t<arguments.length;t++)n[t-1]=arguments[t];var r=null;return e&&"function"==typeof e&&(r=e.apply(void 0,n)),r}function O(e){for(var n=[],t=1;t<arguments.length;t++)n[t-1]=arguments[t];return M.apply(void 0,r([e],n,!1))}function _(e){var n=!1;return Array.isArray(e)&&e.length&&(n=!0),n}function k(e){if(!e)return"";var n=new RegExp("\\n","g");return e.replace(n,"<br />")}function P(e){return k(e)}function N(e,n){void 0===n&&(n={});var t=n.removeNewLine,r=void 0!==t&&t,o="";return e&&(o=e.replace(/<\/?.+?>/g,""),r&&(o=o.replace(/[\r\n]/g,""))),o}function R(e,n){return void 0===n&&(n={}),N(e,n)}function C(e){var n={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};if("string"!=typeof e)throw new Error("Input must be a string");return e.replace(/[&<>"'/]/g,(function(e){return n[e]}))}function j(e){var n={"&":"&","<":"<",">":">",""":'"',"'":"'","/":"/"};if("string"!=typeof e)throw new Error("Input must be a string");return e.replace(/(&|<|>|"|'|/)/g,(function(e){return n[e]}))}function D(e){return j(e)}function B(e,n,t){if(void 0===t&&(t={hasDot:!1,dotText:"..."}),t=Object.assign({hasDot:!1,dotText:"..."},t),""!=e&&e){for(var r=0,o="",i=/[^\x00-\xff]/g,a="",u=e.replace(i,"**").length,c=0;c<u&&(null!=(a=e.charAt(c).toString()).match(i)?r+=2:r++,!(r>n));c++)o+=a;return t.hasDot&&u>n&&(o+=t.dotText),o}return""}function F(e,n,t){return void 0===t&&(t=!1),B(e,n,{hasDot:t})}function I(e,n,t){return void 0===t&&(t=!1),F(e,n,t)}function L(e,n){void 0===n&&(n={validStatusRange:[200,300],validCode:[0]});var t=Object.assign({validStatusRange:[200,300],validCode:[0]},n),r=t.validStatusRange,o=t.validCode;2!==r.length&&console.error("valid validStatusRange is required");var i=!1;if(e&&e.status&&2===r.length&&e.status>=r[0]&&e.status<r[1]){var a=e.data;a&&o.includes(a.code)&&(i=!0)}return i}function z(e,n,t){var r=!1;return"object"!=typeof e||n.reduce((function(e,n){return void 0===e[n]?Object.create(null):e=e[n]}),e)===t&&(r=!0),r}function q(e){var n=function(e){return String(Math.ceil(e))};if(!e||e<0)return"";var t=1024;return e<t?e+" B":e<Math.pow(t,2)?n(e/t)+" KB":e<Math.pow(t,3)?n(e/Math.pow(t,2))+" MB":e<Math.pow(t,4)?n(e/Math.pow(t,3))+" G":n(e/Math.pow(t,4))+" T"}function U(e){var n,t=0;for(n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return t}function Z(e,n){void 0===n&&(n="yyyy-MM-dd"),e||(e=new Date);var t=new Date(e),r={yyyy:t.getFullYear(),MM:t.getMonth()+1,dd:t.getDate()<10?"0"+t.getDate():t.getDate(),hh:t.getHours()<10?"0"+t.getHours():t.getHours(),mm:t.getMinutes()<10?"0"+t.getMinutes():t.getMinutes(),ss:t.getSeconds()<10?"0"+t.getSeconds():t.getSeconds()},o=n||"yyyy-MM-dd";return Object.keys(r).forEach((function(e){var n=r[e];"MM"===e&&Number(n)<=9&&(n="0".concat(n)),o=o.replace(e,String(n))})),o}function $(e){return/^1\d{10}$/.test(e)}function W(e){return/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(e)}function V(e){for(var n="";e>0;){var t=e%26;0===t&&(t=26),n=String.fromCharCode(t+96)+n,e=(e-t)/26}return n}function J(){return"v4"}function Y(e,r,o){var i=this;void 0===r&&(r={}),void 0===o&&(o=function(e){return!0===e});var a=r.interval,u=void 0===a?1e3:a,c=r.times,s=void 0===c?10:c,f=r.context,d=r.args,l=0;"function"!=typeof e&&console.error("Expected a function."),("number"!=typeof u||u<0)&&console.error("Expected a non-negative number for interval."),("number"!=typeof s||s<0)&&console.error("Expected a non-negative number for times."),function r(){setTimeout((function(){return n(i,void 0,void 0,(function(){var n;return t(this,(function(t){switch(t.label){case 0:return[4,e.apply(f,d)];case 1:return n=t.sent(),o(n)||++l>=s?[2]:(r(),[2])}}))}))}),u)}()}function H(e){return n(this,void 0,void 0,(function(){return t(this,(function(n){return[2,new Promise((function(n){setTimeout((function(){n(e)}),e)}))]}))}))}function G(e){return n(this,void 0,void 0,(function(){return t(this,(function(n){return[2,H(e)]}))}))}function K(e,n){for(var t=e.length,r=n.length,i=o(new Array(t).fill(new Array(r).fill(0))),a=0;a<t;++a)for(var u=0;u<r;++u)if(e[a]===n[u]){var c=0;a>0&&u>0&&(c=i[a-1][u-1]),i[a][u]=c+1}var s=Array.prototype.concat.apply([],i);return Math.max.apply(Math,s)}function Q(e,n){return K(e,n)}function X(e,n){for(var t=e.length,r=n.length,i=o(new Array(t).fill(new Array(r).fill(0))),a=0;a<t;++a)for(var u=0;u<r;++u)if(e[a]===n[u]){var c=0;a>0&&u>0&&(c=i[a-1][u-1]),i[a][u]=c+1}else{var s=[0,0],f=s[0],d=s[1];u>0&&(f=i[a][u-1]),a>0&&(d=i[a-1][u]),i[a][u]=Math.max(f,d)}var l=Array.prototype.concat.apply([],i);return Math.max.apply(Math,l)}function ee(e,n){return X(e,n)}function ne(e){return Math.random()<e}function te(e){return ne(e)}function re(e){var n=new RegExp("(^|&)"+e+"=([^&]*)(&|$)"),t=location.search.substring(1).match(n);return null!==t?decodeURIComponent(t[2]):""}function oe(e,n,t){void 0===t&&(t={});var r=null;if(e.includes("#")){r=new URL(e).searchParams.getAll(n)}else{var o={};e.replace(/\??(\w+)=([^&]*)&?/g,(function(e,n,t){return void 0!==o[n]?o[n].push(t):o[n]=[t],""})),r=o[n]||[]}return t.returnArray?r:r.length?r[0]:null}function ie(e,n,t){if(e.includes("#")){var r=new URL(e);return r.searchParams.set(n,t),r.toString()}var o=new RegExp("([?&])"+n+"=.*?(&|$)","i"),i=-1!==e.indexOf("?")?"&":"?";return e.match(o)?e.replace(o,"$1"+n+"="+t+"$2"):e+i+n+"="+t}function ae(e){var n=location.hash.split("?");if(1===n.length)return"";var t=new RegExp("(^|&)".concat(e,"=([^&]*)(&|$)")),r=n[1].match(t);return r?r[2]:""}function ue(e,n){void 0===n&&(n=["hostname"]);var t=document.createElement("a");return t.href=e,n.reduce((function(e,n){return e+=t[n]}),"")}function ce(e){return/^[a-zA-Z0-9]+:\/\/[-a-zA-Z0-9@:%._+~#=]{1,256}\b([-a-zA-Z0-9\u4E00-\u9FA5()!@:%_+.~#?&//=]*)$/.test(e)}function se(e,n){void 0===n&&(n={strict:!0});var t=/^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9\u4E00-\u9FA5()!@:%_+.~#?&//=]*)/;return n.strict||(t=/^(https?:)?\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9\u4E00-\u9FA5()!@:%_+.~#?&//=]*)/),t.test(e)}function fe(e){var n="";if("string"!=typeof e||""==e)return n;var t=/\.[^/?#]+$/.exec(e);return t?(t[0].length>1&&(n=t[0].substring(1)),n):n}function de(e,n){void 0===n&&(n=""),n||(n=".js");for(var t=new RegExp("[?&]".concat(e,"=([^&]*)")),r=document.querySelectorAll('script[src*="'.concat(n,'"]')),o=0;o<r.length;o++){var i=r[o].getAttribute("src");if(i&&-1!==i.indexOf(n)){var a=i.match(t);if(a)return decodeURIComponent(a[1])}}return""}function le(e,n){for(var t=e.className.split(/\s+/),r=0;r<t.length;r++)if(t[r]===n)return!0;return!1}function pe(e,n){for(var t=e.className,r=t.split(/\s+/),o=0;o<r.length;o++)if(r[o]===n)return;var i,a="";""!==t&&(a=" "),i=t+a+n,e.className=i}function ge(e,n){pe(e,n)}function ve(e,n){var t;t=(t=(t=(t=" "+e.className+" ").replace(/(\s+)/gi," ")).replace(" "+n+" "," ")).replace(/(^\s+)|(\s+$)/g,""),e.className=t}function he(e,n){if(void 0===n&&(n={id:""}),!e)return!1;var t=document.createDocumentFragment(),r=null,o="",i=document.createElement("style");return n.id?(o="".concat(n.id),(r=document.getElementById(o))?r.innerHTML=e:(i.setAttribute("id",n.id),i.innerHTML=e,t.appendChild(i),document.head.appendChild(t))):(i.innerHTML=e,t.appendChild(i),document.head.appendChild(t)),!0}function me(){var e,n=window.jQuery||window.$;return n?!(!(e=n("img"))||!e.length)&&(e.each((function(){var e=n(this);if(e){var t=e.attr("src");if(t&&"string"==typeof t&&t.length){var r=t.match(/width=([0-9]+[a-z%]*)/),o=t.match(/height=([0-9]+[a-z%]*)/);r&&_(r)&&r[1]&&e.width(r[1]),o&&_(o)&&o[1]&&e.height(o[1])}}})),!0):(e=document.getElementsByTagName("img")).length>0&&(Array.from(e).forEach((function(e){var n=e;if(n){var t=n.getAttribute("src");if(t&&"string"==typeof t&&t.length){var r=t.match(/width=([0-9]+[a-z%]*)/),o=t.match(/height=([0-9]+[a-z%]*)/);r&&_(r)&&r[1]&&(n.style.width=r[1]),o&&_(o)&&o[1]&&(n.style.height=o[1])}}})),!0)}function we(){return me()}function ye(e,n){var t="";return n&&n.length>0&&(t=n.join(";")+";"),"".concat(e,"{").concat(t,"}")}function be(e){var n=e||window.event;n.stopPropagation?n.stopPropagation():n.cancelBubble=!0}function Ee(){var e=window.MAZEY_DEFINE_LISTENERS;return"object"!=typeof e&&(e={},window.MAZEY_DEFINE_LISTENERS=e),e}function Ae(e,n){var t=Ee();void 0===t[e]&&(t[e]=[]),"function"==typeof n&&t[e].push(n)}function Se(e){var n=Ee()[e];if(n instanceof Array)for(var t=0,r=n.length;t<r;t++)"function"==typeof n[t]&&n[t]({type:e})}function Te(e){Se(e)}function xe(e,n){var t=Ee(),r=t[e];if("string"==typeof e&&r instanceof Array)if("function"==typeof n){for(var o=0,i=r.length;o<i;o++)if(r[o]===n){t[e].splice(o,1);break}}else delete t[e]}function Me(e,n){void 0===n&&(n=null),e&&sessionStorage.setItem(e,JSON.stringify(n))}function Oe(e){var n=null;if(e){var t=sessionStorage.getItem(e);t&&(n=JSON.parse(t))}return n}function _e(e,n){void 0===n&&(n=null),e&&localStorage.setItem(e,JSON.stringify(n))}function ke(e){var n=null;if(e){var t=localStorage.getItem(e);t&&(n=JSON.parse(t))}return n}function Pe(e){for(var n=e+"=",t=document.cookie.split(";"),r=0;r<t.length;r++){for(var o=t[r];" "==o.charAt(0);)o=o.substring(1,o.length);if(0==o.indexOf(n))return o.substring(n.length,o.length)}return""}function Ne(e,n,t,r){var o,i;if(t){var a=new Date;a.setTime(a.getTime()+24*t*60*60*1e3),i="; expires="+a.toUTCString()}else i="";var u=location.host;1===u.split(".").length?document.cookie=e+"="+n+i+"; path=/":((o=u.split(".")).shift(),r=r||"."+o.join("."),document.cookie=e+"="+n+i+"; path=/; domain="+r,null!==Pe(e)&&Pe(e)===n||(r=r||"."+u,document.cookie=e+"="+n+i+"; path=/; domain="+r))}function Re(e){for(var n=document.cookie.split(";"),t=0;t<n.length;t++){var r=n[t].trim();if(r.startsWith("".concat(e,"="))){var o=r.split("=")[0],i=new Date;return i.setTime(i.getTime()-1),document.cookie="".concat(o,"=;expires=").concat(i.toUTCString()),!0}}return!1}function Ce(e){Re(e)}function je(e,n){void 0===n&&(n={id:""});var t,r=n.id,o=function(){},i=new Promise((function(e,n){var r;t=(r=[e,n])[0],o=r[1]})),a=function(){t("loaded")},u=document.createElement("link");u||o(new Error("Not support create link element"));var c="onload"in u,s=+navigator.userAgent.replace(/.*(?:AppleWebKit|AndroidWebKit)\/?(\d+).*/i,"$1")<536;if(u.rel="stylesheet",u.type="text/css",u.href=e,void 0!==r&&(u.id=r),document.getElementsByTagName("head")[0].appendChild(u),s||!c)return setTimeout((function(){d(u,a,0)}),1),i;function f(){u&&(u.onload=u.onerror=u.onreadystatechange=null),u=null,a()}function d(e,n,t){if(e){var r,o=e.sheet;if((t+=1)>3e5)return r=!0,e&&(e=null),void n();if(s)o&&(r=!0);else if(o)try{o.cssRules&&(r=!0)}catch(e){var i=e;if(!i.name)return;"NS_ERROR_DOM_SECURITY_ERR"===i.name&&(r=!0)}setTimeout((function(){r?n():d(e,n,t)}),20)}}return c?(u.onload=f,u.onerror=function(){f()}):u.onreadystatechange=function(){u&&/loaded|complete/.test(u.readyState)&&f()},i}function De(e,n){void 0===n&&(n={id:"",callback:function(){},timeout:5e3,isDefer:!1});var t,r,o=Object.assign({id:"",callback:function(){},timeout:5e3,isDefer:!1},n),i=o.id,a=o.callback,u=o.timeout,c=o.isDefer,s=document.createElement("script");s||Promise.reject("Not support create script element");var f=document.getElementsByTagName("script")[0];return s.type="text/javascript",c&&(s.defer=!0),i&&(s.id=i),s.readyState?s.onreadystatechange=function(){"loaded"!==s.readyState&&"complete"!==s.readyState||(s.onreadystatechange=null,O(a),O(t,"loaded"))}:s.onload=function(){O(a),O(t,"loaded")},s.src=e,f&&f.parentNode.insertBefore(s,f),new Promise((function(e,n){var o;t=(o=[e,n])[0],r=o[1],u&&setTimeout(r.bind(null,"timeout"),u)}))}function Be(e){void 0===e&&(e=90);var n,t=function(){},r=new Promise((function(e,r){t=e,n=r}));return"complete"===document.readyState?t("complete"):window.addEventListener("load",(function(){return t("load")})),setTimeout((function(){return n(Error("timeout"))}),1e3*e),r}function Fe(e){return new Promise((function(n,t){var r=new Image;r.onload=function(){n(r)},r.onerror=function(e){t(e)},r.src=e}))}function Ie(e,n){return window[e]?Promise.resolve("defined"):De(n)}function Le(e){var n=[],t=window.PerformanceObserver;return!!t&&(_(t.supportedEntryTypes)&&(n=t.supportedEntryTypes),n.includes(e))}function ze(){return n(this,void 0,void 0,(function(){return t(this,(function(e){return Le("paint")?[2,new Promise((function(e){var n=new PerformanceObserver((function(t){var r=t.getEntries().find((function(e){return"first-contentful-paint"===e.name}));r&&(n.disconnect(),e(Math.round(r.startTime)))}));n.observe({type:"paint",buffered:!0})}))]:[2,0]}))}))}function qe(){return n(this,void 0,void 0,(function(){return t(this,(function(e){return Le("paint")?[2,new Promise((function(e){var n=new PerformanceObserver((function(t){var r=t.getEntries().find((function(e){return"first-paint"===e.name}));r&&(n.disconnect(),e(Math.round(r.startTime)))}));n.observe({type:"paint",buffered:!0})}))]:[2,0]}))}))}function Ue(){return n(this,void 0,void 0,(function(){return t(this,(function(e){return Le("largest-contentful-paint")?[2,new Promise((function(e){var n=new PerformanceObserver((function(t){var r=t.getEntries().find((function(e){return"largest-contentful-paint"===e.entryType}));r&&(n.disconnect(),e(Math.round(r.startTime)))}));n.observe({type:"largest-contentful-paint",buffered:!0})}))]:[2,0]}))}))}function Ze(){return n(this,void 0,void 0,(function(){return t(this,(function(e){return Le("first-input")?[2,new Promise((function(e){var n=new PerformanceObserver((function(t){var r=t.getEntries().find((function(e){return"first-input"===e.entryType}));if(r){n.disconnect();var o=r.processingStart;e(o?Math.round(r.processingStart-r.startTime):0)}}));n.observe({type:"first-input",buffered:!0})}))]:[2,0]}))}))}function $e(){return n(this,void 0,void 0,(function(){return t(this,(function(e){return Le("layout-shift")?[2,new Promise((function(e){var n=new PerformanceObserver((function(t){var r=t.getEntries().reduce((function(e,n){var t=0;return x(n.value)&&(t=n.value),e+t}),0);n.disconnect(),e(r)}));n.observe({type:"layout-shift",buffered:!0})}))]:[2,0]}))}))}function We(){return n(this,void 0,void 0,(function(){var e,n;return t(this,(function(t){return Le("navigation")&&window.performance&&window.performance.getEntriesByType?(e=performance.getEntriesByType("navigation")[0],0,e?(n=e.responseStart-e.requestStart,[2,Math.round(n)]):[2,0]):[2,0]}))}))}function Ve(e){return void 0===e&&(e=!1),n(this,void 0,void 0,(function(){function n(){var n={source:I,os:r(),osVersion:o(),deviceType:i(),network:a(),screenDirection:u(),unloadTime:h-m,redirectTime:w-y,dnsTime:b-E,tcpTime:A-S,sslTime:c(A,T),responseTime:M-O,downloadTime:k-M,firstPaintTime:q,firstContentfulPaintTime:U,domReadyTime:P-L,onloadTime:N-L,whiteTime:M-L,renderTime:R-L,decodedBodySize:D,encodedBodySize:B};Object.keys(n).forEach((function(e){x(n[e])&&(n[e]<0?n[e]=0:n[e]=Math.round(n[e]))})),x(n.whiteTime)&&n.whiteTime>n.onloadTime&&(n.whiteTime=0);var t={};e||Object.keys(n).forEach((function(e){t[f(e)]=n[e]})),Object.keys(t).length?d(t):d(n)}function r(){return navigator.userAgent.indexOf("Android")>-1||navigator.userAgent.indexOf("Linux")>-1?"android":navigator.userAgent.indexOf("iPhone")>-1?"ios":navigator.userAgent.indexOf("Windows Phone")>-1?"wp":"others"}function o(){var e="",n=navigator.userAgent,t=n.indexOf("Android")>-1||n.indexOf("Linux")>-1,r=!!n.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),o=navigator.userAgent.split(";");if(o.length<2)return e;var i=o[1];return i?(t&&(e=(i.match(/\d+\.\d+/g)||[])[0]),r&&(e=(i.match(/(\d+)_(\d+)_?(\d+)?/)||[])[0]),e||(e=""),e):e}function i(){var e,n=navigator.userAgent.toLowerCase(),t=n.match(/(ipad)/i)&&"ipad",r=n.match(/iphone os/i)&&"iphone os",o=n.match(/midp/i)&&"midp",i=n.match(/rv:1.2.3.4/i)&&"rv:1.2.3.4",a=n.match(/ucweb/i)&&"ucweb",u=n.match(/android/i)&&"android",c=n.match(/windows ce/i)&&"windows ce",s=n.match(/windows mobile/i)&&"windows mobile";return(e=t||r||o||i||a||u||c||s?r||o||i||a||u||c||s?"phone":t?"ipad":void 0:"pc")||(e=""),e}function a(){var e="",n=window.navigator;if(n.connection&&n.connection.effectiveType)switch(n.connection.effectiveType){case"wifi":e="wifi";break;case"4g":e="4g";break;case"2g":e="2g";break;case"3g":e="3g";break;case"ethernet":e="ethernet";break;case"default":e=void 0}return e||(e=""),e}function u(){var e="";return window.screen&&window.screen.orientation&&window.screen.orientation.angle&&(180!==window.screen.orientation.angle&&0!==window.screen.orientation.angle||(e="|"),90!==window.screen.orientation.angle&&-90!==window.screen.orientation.angle||(e="-")),e}function c(e,n){var t=0;return n&&(t=e-n),t}var s,d,l,p,g,v,h,m,w,y,b,E,A,S,T,M,O,k,P,N,R,C,j,D,B,F,I,L,z,q,U;return t(this,(function(e){switch(e.label){case 0:if(!Le("navigation"))return[2,Promise.reject(new Error("navigation is not supported"))];if(!(s=window.performance)||"function"!=typeof s.getEntries||"function"!=typeof s.getEntriesByType)return[2,Promise.reject(new Error("performance is not supported"))];if(l=new Promise((function(e){d=[e][0]})),p=null,_(g=s.getEntriesByType("navigation"))&&(p=g[0]),v=new Array(19).fill(0),h=v[0],m=v[1],w=v[2],y=v[3],b=v[4],E=v[5],A=v[6],S=v[7],T=v[8],M=v[9],O=v[10],k=v[11],P=v[12],N=v[13],R=v[14],C=v[15],j=v[16],D=v[17],B=v[18],F=s.timing,I="",p)I="PerformanceNavigationTiming",D=p.decodedBodySize,B=p.encodedBodySize,h=p.unloadEventEnd,m=p.unloadEventStart,w=p.redirectEnd,y=p.redirectStart,b=p.domainLookupEnd,E=p.domainLookupStart,A=p.connectEnd,S=p.connectStart,T=p.secureConnectionStart,M=p.responseStart,O=p.requestStart,k=p.responseEnd,P=p.domContentLoadedEventStart,N=p.loadEventStart,R=p.loadEventEnd,C=p.startTime,j=p.fetchStart;else{if(!F)return[2,Promise.reject(new Error("NavigationTiming and Timing are not supported"))];I="PerformanceTiming",h=F.unloadEventEnd,m=F.unloadEventStart,w=F.redirectEnd,y=F.redirectStart,b=F.domainLookupEnd,E=F.domainLookupStart,A=F.connectEnd,S=F.connectStart,T=F.secureConnectionStart,M=F.responseStart,O=F.requestStart,k=F.responseEnd,P=F.domContentLoadedEventStart,N=F.loadEventStart,R=F.loadEventEnd,C=F.navigationStart,j=F.fetchStart}if(L=0,x(C))L=C;else{if(!x(j))return[2,Promise.reject(new Error("startTime, navigationStart or fetchStart are required"))];L=j}return[4,Promise.all([qe(),ze()])];case 1:return z=e.sent(),q=z[0],U=z[1],x(R)&&R>0?n():window.addEventListener("load",(function(){window.setTimeout((function(){n()}),0)})),[2,l]}}))}))}function Je(){var e=Ye();return!(!("serviceWorker"in navigator&&function(){var e;try{return e=new Function("return async function(){};")(),null!=Object.getPrototypeOf(e).constructor}catch(e){return!1}}()&&"undefined"!=typeof Promise&&-1!==Promise.toString().indexOf("[native code]")&&Boolean(window.fetch)&&Boolean(window.indexedDB)&&Boolean(window.caches))||e.shell)}function Ye(){if(window.MAZEY_BROWSER_INFO&&"object"==typeof window.MAZEY_BROWSER_INFO)return window.MAZEY_BROWSER_INFO;var n={engine:"",engineVs:"",platform:"",supporter:"",supporterVs:"",system:"",systemVs:""};try{var t=navigator.userAgent.toLowerCase();if(!t)return n;var r=function(e){return e.test(t)},o=function(e){var n="",r=t.match(e);return r&&_(r)&&(n=(n=(n=r.toString()).replace(/[^0-9|_.]/g,"")).replace(/_/g,".")),n},i="",a="";r(/windows|win32|win64|wow32|wow64/g)?i="windows":r(/macintosh|macintel/g)?i="macos":r(/x11/g)?i="linux":r(/android|adr/g)?i="android":r(/ios|iphone|ipad|ipod|iwatch/g)&&(i="ios",r(/ipad/g)?a="ipad":r(/iphone/g)?a="iphone":r(/iwatch/g)?a="iwatch":r(/ipod/g)&&(a="ipod")),n=e(e({},n),{system:i,appleType:a});var u="";"windows"===i?r(/windows nt 5.0|windows 2000/g)?u="2000":r(/windows nt 5.1|windows xp/g)?u="xp":r(/windows nt 5.2|windows 2003/g)?u="2003":r(/windows nt 6.0|windows vista/g)?u="vista":r(/windows nt 6.1|windows 7/g)?u="7":r(/windows nt 6.2|windows 8/g)?u="8":r(/windows nt 6.3|windows 8.1/g)?u="8.1":r(/windows nt 10.0|windows 10/g)&&(u="10"):"macos"===i?u=o(/os x [\d._]+/g):"android"===i?u=o(/android [\d._]+/g):"ios"===i&&(u=o(/os [\d._]+/g)),n=e(e({},n),{systemVs:u});var c="";"windows"===i||"macos"===i||"linux"===i?c="desktop":("android"===i||"ios"===i||r(/mobile/g))&&(c="mobile"),n=e(e({},n),{platform:c});var s="",f="";r(/applewebkit/g)?(s="webkit",r(/edge/g)?f="edge":r(/opr/g)?f="opera":r(/chrome/g)?f="chrome":r(/safari/g)&&(f="safari")):r(/gecko/g)&&r(/firefox/g)?(s="gecko",f="firefox"):r(/presto/g)?(s="presto",f="opera"):r(/trident|compatible|msie/g)&&(s="trident",f="iexplore"),n=e(e({},n),{engine:s,supporter:f});var d="";"webkit"===s?d=o(/applewebkit\/[\d._]+/g):"gecko"===s?d=o(/gecko\/[\d._]+/g):"presto"===s?d=o(/presto\/[\d._]+/g):"trident"===s&&(d=o(/trident\/[\d._]+/g)),n=e(e({},n),{engineVs:d});var l="";"chrome"===f?l=o(/chrome\/[\d._]+/g):"safari"===f?l=o(/version\/[\d._]+/g):"firefox"===f?l=o(/firefox\/[\d._]+/g):"opera"===f?l=o(/opr\/[\d._]+/g):"iexplore"===f?l=o(/(msie [\d._]+)|(rv:[\d._]+)/g):"edge"===f&&(l=o(/edge\/[\d._]+/g)),n=e(e({},n),{supporterVs:l});var p="",g="";return r(/micromessenger/g)?(p="wechat",g=o(/micromessenger\/[\d._]+/g)):r(/qqbrowser/g)?(p="qq_browser",g=o(/qqbrowser\/[\d._]+/g)):r(/\sqq/g)?p="qq_app":r(/ucbrowser/g)?(p="uc",g=o(/ucbrowser\/[\d._]+/g)):r(/qihu 360se/g)?p="360":r(/2345explorer/g)?(p="2345",g=o(/2345explorer\/[\d._]+/g)):r(/metasr/g)?p="sougou":r(/lbbrowser/g)?p="liebao":r(/maxthon/g)?(p="maxthon",g=o(/maxthon\/[\d._]+/g)):r(/biliapp/g)&&(p="bilibili"),n=e(e({},n),{shell:p,shellVs:g}),window.MAZEY_BROWSER_INFO=n,n}catch(e){return console.warn("MazeyCon:",e),n}}function He(){return new Promise((function(e){var n=new Image;n.onload=function(){e(n.width>0&&n.height>0)},n.onerror=function(){e(!1)},n.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAAAAAAfQ//73v/+BiOh/AAA="}))}function Ge(e,n){void 0===e&&(e=""),void 0===n&&(n={isClosed:!1,showWrap:!1,showDate:!1,locales:"en-US",logFn:function(){},errorFn:function(){}});var t=Object.assign({isClosed:!1,showWrap:!1,showDate:!1,locales:"en-US",logFn:function(){},errorFn:function(){}},n),o=t.isClosed,i=t.showWrap,a=t.showDate,u=t.locales,c=t.logFn,s=t.errorFn,f=Object.create(null),d=function(){return(new Date).toLocaleDateString(u,{weekday:"short",year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"})};return["log","info","warn","error"].forEach((function(n){f[n]=function(){for(var t=[],u=0;u<arguments.length;u++)t[u]=arguments[u];if(o)return!1;var f=e,l=e;if("string"==typeof e&&e.length>=2){var p=e.length;f=":"===e[p-1]?e.substring(0,p-1):e}i&&console.log("--- ".concat(f," - begin ---")),a&&(l=e?"".concat(d()," ").concat(e):"".concat(d())),e||a?console[n].apply(console,r([l],t,!1)):console[n].apply(console,t),"log"===n&&c(),"error"===n&&s(),i&&console.log("--- ".concat(f," - end ---"))}})),f}export{pe as addClass,Ae as addEvent,he as addStyle,ee as calLongestCommonSubsequence,Q as calLongestCommonSubstring,f as camelCase2Underscore,c as camelCaseToKebabCase,be as cancelBubble,R as clearHtml,V as convert10To26,a as convertCamelToKebab,s as convertCamelToUnder,u as convertKebabToCamel,k as convertToHtmlBreaks,I as cutCHSString,B as cutZHString,A as debounce,o as deepCopy,i as deepCopyObject,Ce as delCookie,O as doFn,Se as fireEvent,b as floatFixed,y as floatToPercent,Z as formatDate,Ge as genCustomConsole,U as genHashCode,g as genRndNumString,ye as genStyleString,h as genUniqueNumString,v as generateRndNum,m as generateUniqueNum,Ye as getBrowserInfo,$e as getCLS,Pe as getCookie,J as getCurrentVersion,Ee as getDefineListeners,ue as getDomain,ze as getFCP,Ze as getFID,qe as getFP,q as getFileSize,T as getFriendlyInterval,ae as getHashQueryParam,Ue as getLCP,ke as getLocalStorage,Ve as getPerformance,re as getQueryParam,de as getScriptQueryParam,Oe as getSessionStorage,We as getTTFB,fe as getUrlFileType,oe as getUrlParam,le as hasClass,te as inRate,Te as invokeEvent,M as invokeFn,ne as isHit,l as isJSONString,p as isJsonString,_ as isNonEmptyArray,x as isNumber,Je as isSafePWAEnv,He as isSupportWebp,Le as isSupportedEntryType,z as isValidData,W as isValidEmail,se as isValidHttpUrl,$ as isValidPhoneNumber,ce as isValidUrl,je as loadCSS,Fe as loadImage,De as loadScript,Ie as loadScriptIfUndefined,X as longestComSubsequence,K as longestComSubstring,w as mNow,d as mTrim,P as newLine,ve as removeClass,Re as removeCookie,xe as removeEvent,N as removeHtml,Y as repeatUntilConditionMet,C as sanitizeInput,ge as setClass,Ne as setCookie,me as setImgSizeBySrc,we as setImgWidHeiBySrc,_e as setLocalStorage,Me as setSessionStorage,G as sleep,E as throttle,F as truncateZHString,D as unsanitize,j as unsanitizeInput,ie as updateQueryParam,H as waitTime,Be as windowLoaded,L as zAxiosIsValidRes};
|
package/lib/load.d.ts
ADDED
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import type { MazeyFnParams, MazeyFnReturn, LoadScriptReturns } from "./typing";
|
|
2
|
+
/**
|
|
3
|
+
* EN: Load a CSS file from the server.
|
|
4
|
+
*
|
|
5
|
+
* ZH: 动态加载 CSS 文件
|
|
6
|
+
*
|
|
7
|
+
* Usage:
|
|
8
|
+
*
|
|
9
|
+
* ```javascript
|
|
10
|
+
* loadCSS(
|
|
11
|
+
* 'http://example.com/path/example.css',
|
|
12
|
+
* {
|
|
13
|
+
* id: 'iamid', // Optional, link ID, default none
|
|
14
|
+
* }
|
|
15
|
+
* )
|
|
16
|
+
* .then(
|
|
17
|
+
* res => {
|
|
18
|
+
* console.log(`Load CSS Success: ${res}`);
|
|
19
|
+
* }
|
|
20
|
+
* )
|
|
21
|
+
* .catch(
|
|
22
|
+
* err => {
|
|
23
|
+
* console.error(`Load CSS Fail: ${err.message}`)
|
|
24
|
+
* }
|
|
25
|
+
* );
|
|
26
|
+
* ```
|
|
27
|
+
*
|
|
28
|
+
* Output:
|
|
29
|
+
*
|
|
30
|
+
* ```text
|
|
31
|
+
* Load CSS Success: loaded
|
|
32
|
+
* ```
|
|
33
|
+
*
|
|
34
|
+
* @param {string} url -- css资源路径
|
|
35
|
+
* @param {string} options.id -- link标签id
|
|
36
|
+
* @returns {Promise<string>} true -- 加载成功
|
|
37
|
+
* @category Load
|
|
38
|
+
*/
|
|
39
|
+
export declare function loadCSS(url: string, options?: {
|
|
40
|
+
id?: string;
|
|
41
|
+
}): Promise<unknown>;
|
|
42
|
+
/**
|
|
43
|
+
* EN: Load a JavaScript file from the server and execute it.
|
|
44
|
+
*
|
|
45
|
+
* ZH: 动态加载 JavaScript 文件
|
|
46
|
+
*
|
|
47
|
+
* Usage:
|
|
48
|
+
*
|
|
49
|
+
* ```javascript
|
|
50
|
+
* loadScript(
|
|
51
|
+
* 'http://example.com/static/js/plugin-2.1.1.min.js',
|
|
52
|
+
* {
|
|
53
|
+
* id: 'iamid', // (Optional) script ID, default none
|
|
54
|
+
* timeout: 5000, // (Optional) timeout, default `5000`
|
|
55
|
+
* isDefer: false, // (Optional) defer, default `false`
|
|
56
|
+
* }
|
|
57
|
+
* )
|
|
58
|
+
* .then(
|
|
59
|
+
* res => {
|
|
60
|
+
* console.log(`Load JavaScript script: ${res}`);
|
|
61
|
+
* }
|
|
62
|
+
* )
|
|
63
|
+
* .catch(
|
|
64
|
+
* err => {
|
|
65
|
+
* console.error(`Load JavaScript script: ${err.message}`)
|
|
66
|
+
* }
|
|
67
|
+
* );
|
|
68
|
+
* ```
|
|
69
|
+
*
|
|
70
|
+
* Output:
|
|
71
|
+
*
|
|
72
|
+
* ```text
|
|
73
|
+
* Load JavaScript script: loaded
|
|
74
|
+
* ```
|
|
75
|
+
*
|
|
76
|
+
* @param {string} url -- JavaScript 资源路径
|
|
77
|
+
* @param {string} options.id -- DOM ID
|
|
78
|
+
* @param {function} options.callback -- 加载后回调函数
|
|
79
|
+
* @param {number} options.timeout -- 超时时长
|
|
80
|
+
* @param {boolean} options.isDefer -- 是否添加 defer 标签
|
|
81
|
+
* @returns {Promise<string>} -- true 成功
|
|
82
|
+
* @category Load
|
|
83
|
+
*/
|
|
84
|
+
export declare function loadScript(url: string, options?: {
|
|
85
|
+
id?: string;
|
|
86
|
+
callback?: (...params: MazeyFnParams) => MazeyFnReturn;
|
|
87
|
+
timeout?: number;
|
|
88
|
+
isDefer?: boolean;
|
|
89
|
+
}): LoadScriptReturns;
|
|
90
|
+
/**
|
|
91
|
+
* EN: Check whether the page is loaded successfully (Keep the compatibility if the browser's `load` event has been triggered).
|
|
92
|
+
*
|
|
93
|
+
* ZH: 页面加载完成
|
|
94
|
+
*
|
|
95
|
+
* Usage:
|
|
96
|
+
*
|
|
97
|
+
* ```javascript
|
|
98
|
+
* windowLoaded()
|
|
99
|
+
* .then(res => {
|
|
100
|
+
* console.log(`Load Success: ${res}`);
|
|
101
|
+
* })
|
|
102
|
+
* .catch(err => {
|
|
103
|
+
* console.log(`Load Timeout or Fail: ${err.message}`);
|
|
104
|
+
* });
|
|
105
|
+
* ```
|
|
106
|
+
*
|
|
107
|
+
* Output:
|
|
108
|
+
*
|
|
109
|
+
* ```text
|
|
110
|
+
* Load Success: load
|
|
111
|
+
* ```
|
|
112
|
+
*
|
|
113
|
+
* @param {number} timeout 超时时间 / 单位:秒
|
|
114
|
+
* @returns {Promise<string>} document is loaded? 'complete' 'load' / 'timeout'
|
|
115
|
+
* @category Load
|
|
116
|
+
*/
|
|
117
|
+
export declare function windowLoaded(timeout?: number): Promise<string | Error>;
|
|
118
|
+
/**
|
|
119
|
+
* Load an image from the given URL.
|
|
120
|
+
*
|
|
121
|
+
* The target image will be loaded in the background, and the Promise status will change after the image is loaded. If the image fails to load, the Promise status will change to `reject` with the error object. If the image is loaded successfully, the Promise status will change to `resolve` with the image object. This method can be used to preload images and cache them in the browser. It can also be used to implement lazy loading of images.
|
|
122
|
+
*
|
|
123
|
+
* Note that this method will not add the image to the DOM.
|
|
124
|
+
*
|
|
125
|
+
* Usage:
|
|
126
|
+
*
|
|
127
|
+
* ```javascript
|
|
128
|
+
* loadImage('https://example.com/example.png')
|
|
129
|
+
* .then((img) => {
|
|
130
|
+
* console.log(img);
|
|
131
|
+
* })
|
|
132
|
+
* .catch((err) => {
|
|
133
|
+
* console.log(err);
|
|
134
|
+
* });
|
|
135
|
+
* ```
|
|
136
|
+
*
|
|
137
|
+
* @param {string} url - The URL of the image to load.
|
|
138
|
+
* @returns {Promise} A Promise that resolves with the loaded image or rejects with an error.
|
|
139
|
+
* @category Load
|
|
140
|
+
*/
|
|
141
|
+
export declare function loadImage(url: string): Promise<HTMLImageElement>;
|
|
142
|
+
/**
|
|
143
|
+
* Load a script from the given URL if it (`window['attribute']`) has not already been loaded.
|
|
144
|
+
*
|
|
145
|
+
* Usage:
|
|
146
|
+
*
|
|
147
|
+
* ```javascript
|
|
148
|
+
* loadScriptIfUndefined('xyz', 'https://example.com/lib/jquery.min.js')
|
|
149
|
+
* .then(() => {
|
|
150
|
+
* console.log('xyz is loaded.');
|
|
151
|
+
* })
|
|
152
|
+
* .catch(err => {
|
|
153
|
+
* console.log('Failed to load xyz.', err);
|
|
154
|
+
* });
|
|
155
|
+
* ```
|
|
156
|
+
*
|
|
157
|
+
* Output:
|
|
158
|
+
*
|
|
159
|
+
* ```text
|
|
160
|
+
* xyz is loaded.
|
|
161
|
+
* ```
|
|
162
|
+
*
|
|
163
|
+
* @param {string} windowAttribute - The name of the window attribute to check (e.g. `jQuery`, `axios`, etc.).
|
|
164
|
+
* @param {string} url - The URL of the script to load.
|
|
165
|
+
* @returns {Promise} A Promise that resolves when the script has been loaded.
|
|
166
|
+
* @category Load
|
|
167
|
+
*/
|
|
168
|
+
export declare function loadScriptIfUndefined(windowAttribute: string, url: string): LoadScriptReturns;
|
|
169
|
+
//# sourceMappingURL=load.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"load.d.ts","sourceRoot":"","sources":["../src/load.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EAAE,aAAa,EAAE,iBAAiB,EAChD,MAAM,UAAU,CAAC;AAGlB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,wBAAgB,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,GAAE;IAAE,EAAE,CAAC,EAAE,MAAM,CAAA;CAAe,GAAG,OAAO,CAAC,OAAO,CAAC,CA2G5F;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,wBAAgB,UAAU,CACxB,GAAG,EAAE,MAAM,EACX,OAAO,GAAE;IACP,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,aAAa,KAAK,aAAa,CAAC;IACvD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;CAQnB,GACA,iBAAiB,CAmDnB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,YAAY,CAAC,OAAO,SAAK,GAAG,OAAO,CAAC,MAAM,GAAG,KAAK,CAAC,CAelE;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAWhE;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,qBAAqB,CAAC,eAAe,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,iBAAiB,CAK7F"}
|
package/lib/mazey.min.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Mazey v4.
|
|
2
|
+
* Mazey v4.1.1 https://github.com/mazeyqian/mazey
|
|
3
3
|
* (c) 2018-2024 Cheng
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
var mazey=function(e){"use strict";var n=function(){return n=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},n.apply(this,arguments)};function t(e,n,t,r){return new(t||(t=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function u(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var n;e.done?o(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(a,u)}c((r=r.apply(e,n||[])).next())}))}function r(e,n){var t,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(u){return function(c){return function(u){if(t)throw new TypeError("Generator is already executing.");for(;i&&(i=0,u[0]&&(a=0)),a;)try{if(t=1,r&&(o=2&u[0]?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return a.label++,{value:u[1],done:!1};case 5:a.label++,r=u[1],u=[0];continue;case 7:u=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==u[0]&&2!==u[0])){a=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){a.label=u[1];break}if(6===u[0]&&a.label<o[1]){a.label=o[1],o=u;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(u);break}o[2]&&a.ops.pop(),a.trys.pop();continue}u=n.call(e,a)}catch(e){u=[6,e],r=0}finally{t=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,c])}}}function o(e,n){for(var t=e.length,r=n.length,o=s(new Array(t).fill(new Array(r).fill(0))),i=0;i<t;++i)for(var a=0;a<r;++a)if(e[i]===n[a]){var u=0;i>0&&a>0&&(u=o[i-1][a-1]),o[i][a]=u+1}var c=Array.prototype.concat.apply([],o);return Math.max.apply(Math,c)}function i(e,n){for(var t=e.length,r=n.length,o=s(new Array(t).fill(new Array(r).fill(0))),i=0;i<t;++i)for(var a=0;a<r;++a)if(e[i]===n[a]){var u=0;i>0&&a>0&&(u=o[i-1][a-1]),o[i][a]=u+1}else{var c=[0,0],d=c[0],l=c[1];a>0&&(d=o[i][a-1]),i>0&&(l=o[i-1][a]),o[i][a]=Math.max(d,l)}var f=Array.prototype.concat.apply([],o);return Math.max.apply(Math,f)}function a(e){var n=e.replace(/([A-Z])/g,"-$1").toLowerCase();return"-"===n[0]?n.substring(1):n}function u(e){var n=e.replace(/([A-Z])/g,"_$1").toLowerCase();return"_"===n[0]?n.substring(1):n}function c(e){return u(e)}function s(e){if("object"!=typeof e)return e;var t=["string","number","boolean","undefined"];return Object.values(e).every((function(e){return t.includes(typeof e)}))?n({},e):JSON.parse(JSON.stringify(e))}function d(e){try{if("object"==typeof JSON.parse(e))return!0}catch(e){}return!1}function l(e){void 0===e&&(e=5);for(var n="";e--;)n+=Math.floor(10*Math.random());return n}function f(e){return void 0===e&&(e=5),l(e)}function g(e){void 0===e&&(e=3);var n=[w(),f(e||3)];return n[0]+n[1]}"function"==typeof SuppressedError&&SuppressedError;var p={type:"d"};function v(e,n){void 0===n&&(n={});var t=n.isNaNAsNumber,r=void 0!==t&&t,o=n.isInfinityAsNumber,i=void 0!==o&&o,a=n.isUnFiniteAsNumber;return"number"==typeof e&&(!(!0!==i&&!0!==(void 0!==a&&a)&&!isFinite(e))&&!(!r&&isNaN(e)))}function m(e){for(var n=[],t=1;t<arguments.length;t++)n[t-1]=arguments[t];var r=null;return e&&"function"==typeof e&&(r=e.apply(void 0,n)),r}function h(e,n){void 0===n&&(n={id:"",callback:function(){},timeout:5e3,isDefer:!1});var t,r,o=Object.assign({id:"",callback:function(){},timeout:5e3,isDefer:!1},n),i=o.id,a=o.callback,u=o.timeout,c=o.isDefer,s=document.createElement("script");s||Promise.reject("Not support create script element");var d=document.getElementsByTagName("script")[0];return s.type="text/javascript",c&&(s.defer=!0),i&&(s.id=i),s.readyState?s.onreadystatechange=function(){"loaded"!==s.readyState&&"complete"!==s.readyState||(s.onreadystatechange=null,m(a),m(t,"loaded"))}:s.onload=function(){m(a),m(t,"loaded")},s.src=e,d&&d.parentNode.insertBefore(s,d),new Promise((function(e,n){var o;t=(o=[e,n])[0],r=o[1],u&&setTimeout(r.bind(null,"timeout"),u)}))}function w(){return Date.now?Date.now():(new Date).getTime()}function y(e){for(var n=e+"=",t=document.cookie.split(";"),r=0;r<t.length;r++){for(var o=t[r];" "==o.charAt(0);)o=o.substring(1,o.length);if(0==o.indexOf(n))return o.substring(n.length,o.length)}return""}function b(e){var n=[],t=window.PerformanceObserver;return!!t&&(x(t.supportedEntryTypes)&&(n=t.supportedEntryTypes),n.includes(e))}function S(){return t(this,void 0,void 0,(function(){return r(this,(function(e){return b("paint")?[2,new Promise((function(e){var n=new PerformanceObserver((function(t){var r=t.getEntries().find((function(e){return"first-contentful-paint"===e.name}));r&&(n.disconnect(),e(Math.round(r.startTime)))}));n.observe({type:"paint",buffered:!0})}))]:[2,0]}))}))}function E(){return t(this,void 0,void 0,(function(){return r(this,(function(e){return b("paint")?[2,new Promise((function(e){var n=new PerformanceObserver((function(t){var r=t.getEntries().find((function(e){return"first-paint"===e.name}));r&&(n.disconnect(),e(Math.round(r.startTime)))}));n.observe({type:"paint",buffered:!0})}))]:[2,0]}))}))}function A(){if(window.MAZEY_BROWSER_INFO&&"object"==typeof window.MAZEY_BROWSER_INFO)return window.MAZEY_BROWSER_INFO;var e={engine:"",engineVs:"",platform:"",supporter:"",supporterVs:"",system:"",systemVs:""};try{var t=navigator.userAgent.toLowerCase();if(!t)return e;var r=function(e){return e.test(t)},o=function(e){var n="",r=t.match(e);return r&&x(r)&&(n=(n=(n=r.toString()).replace(/[^0-9|_.]/g,"")).replace(/_/g,".")),n},i="",a="";r(/windows|win32|win64|wow32|wow64/g)?i="windows":r(/macintosh|macintel/g)?i="macos":r(/x11/g)?i="linux":r(/android|adr/g)?i="android":r(/ios|iphone|ipad|ipod|iwatch/g)&&(i="ios",r(/ipad/g)?a="ipad":r(/iphone/g)?a="iphone":r(/iwatch/g)?a="iwatch":r(/ipod/g)&&(a="ipod")),e=n(n({},e),{system:i,appleType:a});var u="";"windows"===i?r(/windows nt 5.0|windows 2000/g)?u="2000":r(/windows nt 5.1|windows xp/g)?u="xp":r(/windows nt 5.2|windows 2003/g)?u="2003":r(/windows nt 6.0|windows vista/g)?u="vista":r(/windows nt 6.1|windows 7/g)?u="7":r(/windows nt 6.2|windows 8/g)?u="8":r(/windows nt 6.3|windows 8.1/g)?u="8.1":r(/windows nt 10.0|windows 10/g)&&(u="10"):"macos"===i?u=o(/os x [\d._]+/g):"android"===i?u=o(/android [\d._]+/g):"ios"===i&&(u=o(/os [\d._]+/g)),e=n(n({},e),{systemVs:u});var c="";"windows"===i||"macos"===i||"linux"===i?c="desktop":("android"===i||"ios"===i||r(/mobile/g))&&(c="mobile"),e=n(n({},e),{platform:c});var s="",d="";r(/applewebkit/g)?(s="webkit",r(/edge/g)?d="edge":r(/opr/g)?d="opera":r(/chrome/g)?d="chrome":r(/safari/g)&&(d="safari")):r(/gecko/g)&&r(/firefox/g)?(s="gecko",d="firefox"):r(/presto/g)?(s="presto",d="opera"):r(/trident|compatible|msie/g)&&(s="trident",d="iexplore"),e=n(n({},e),{engine:s,supporter:d});var l="";"webkit"===s?l=o(/applewebkit\/[\d._]+/g):"gecko"===s?l=o(/gecko\/[\d._]+/g):"presto"===s?l=o(/presto\/[\d._]+/g):"trident"===s&&(l=o(/trident\/[\d._]+/g)),e=n(n({},e),{engineVs:l});var f="";"chrome"===d?f=o(/chrome\/[\d._]+/g):"safari"===d?f=o(/version\/[\d._]+/g):"firefox"===d?f=o(/firefox\/[\d._]+/g):"opera"===d?f=o(/opr\/[\d._]+/g):"iexplore"===d?f=o(/(msie [\d._]+)|(rv:[\d._]+)/g):"edge"===d&&(f=o(/edge\/[\d._]+/g)),e=n(n({},e),{supporterVs:f});var g="",p="";return r(/micromessenger/g)?(g="wechat",p=o(/micromessenger\/[\d._]+/g)):r(/qqbrowser/g)?(g="qq_browser",p=o(/qqbrowser\/[\d._]+/g)):r(/\sqq/g)?g="qq_app":r(/ucbrowser/g)?(g="uc",p=o(/ucbrowser\/[\d._]+/g)):r(/qihu 360se/g)?g="360":r(/2345explorer/g)?(g="2345",p=o(/2345explorer\/[\d._]+/g)):r(/metasr/g)?g="sougou":r(/lbbrowser/g)?g="liebao":r(/maxthon/g)?(g="maxthon",p=o(/maxthon\/[\d._]+/g)):r(/biliapp/g)&&(g="bilibili"),e=n(n({},e),{shell:g,shellVs:p}),window.MAZEY_BROWSER_INFO=e,e}catch(n){return console.warn("MazeyCon:",n),e}}function T(e,n,t){if(void 0===t&&(t=!1),""!=e&&e){for(var r=0,o="",i=/[^\x00-\xff]/g,a="",u=e.replace(i,"**").length,c=0;c<u&&(null!=(a=e.charAt(c).toString()).match(i)?r+=2:r++,!(r>n));c++)o+=a;return t&&u>n&&(o+="..."),o}return""}function x(e){var n=!1;return Array.isArray(e)&&e.length&&(n=!0),n}function C(){var e=window.MAZEY_DEFINE_LISTENERS;return"object"!=typeof e&&(e={},window.MAZEY_DEFINE_LISTENERS=e),e}function M(e){return t(this,void 0,void 0,(function(){return r(this,(function(n){return[2,new Promise((function(n){setTimeout((function(){n(e)}),e)}))]}))}))}return e.addClass=function(e,n){var t,r=e.className,o="";""!==r&&(o=" "),t=r+o+n,e.className=t},e.addEvent=function(e,n){var t=C();void 0===t[e]&&(t[e]=[]),"function"==typeof n&&t[e].push(n)},e.addStyle=function(e,n){if(void 0===n&&(n={id:""}),!e)return!1;var t=document.createDocumentFragment(),r=null,o="",i=document.createElement("style");return n.id?(o="".concat(n.id),(r=document.getElementById(o))?r.innerHTML=e:(i.setAttribute("id",n.id),i.innerHTML=e,t.appendChild(i),document.head.appendChild(t))):(i.innerHTML=e,t.appendChild(i),document.head.appendChild(t)),!0},e.calLongestCommonSubsequence=function(e,n){return i(e,n)},e.calLongestCommonSubstring=function(e,n){return o(e,n)},e.camelCase2Underscore=c,e.camelCaseToKebabCase=function(e){return a(e)},e.cancelBubble=function(e){var n=e||window.event;n.stopPropagation?n.stopPropagation():n.cancelBubble=!0},e.clearHtml=function(e,n){void 0===n&&(n={});var t=n.removeNewLine,r=void 0!==t&&t,o="";return e&&(o=e.replace(/<\/?.+?>/g,""),r&&(o=o.replace(/[\r\n]/g,""))),o},e.convert10To26=function(e){for(var n="";e>0;){var t=e%26;0===t&&(t=26),n=String.fromCharCode(t+96)+n,e=(e-t)/26}return n},e.convertCamelToKebab=a,e.convertCamelToUnder=u,e.cutCHSString=function(e,n,t){return void 0===t&&(t=!1),T(e,n,t)},e.debounce=function(e,n,t){var r=null,o=null,i=null,a=null,u=null,c=function c(){var s=w()-i;s<n&&s>=0?o=setTimeout(c,n-s):(o=null,t||(u=e.apply(r,a),o||(r=a=null)))};return function(){for(var s=[],d=0;d<arguments.length;d++)s[d]=arguments[d];r=this,a=s,i=w();var l=t&&!o;return o||(o=setTimeout(c,n)),l&&(u=e.apply(r,a),r=a=null),u}},e.deepCopy=s,e.deepCopyObject=function(e){return s(e)},e.delCookie=function(e){for(var n=document.cookie.split(";"),t=0;t<n.length;t++){var r=n[t].trim();if(r.startsWith("".concat(e,"="))){var o=r.split("=")[0],i=new Date;return i.setTime(i.getTime()-1),document.cookie="".concat(o,"=;expires=").concat(i.toUTCString()),!0}}return!1},e.doFn=m,e.floatFixed=function(e,n){return void 0===n&&(n=0),parseFloat(e).toFixed(n)},e.floatToPercent=function(e,n){void 0===n&&(n=0);var t="";return t=n?(100*e).toFixed(n):String(Math.floor(100*e)),"".concat(t,"%")},e.formatDate=function(e,n){void 0===n&&(n="yyyy-MM-dd"),e||(e=new Date);var t=new Date(e),r={yyyy:t.getFullYear(),MM:t.getMonth()+1,dd:t.getDate()<10?"0"+t.getDate():t.getDate(),hh:t.getHours()<10?"0"+t.getHours():t.getHours(),mm:t.getMinutes()<10?"0"+t.getMinutes():t.getMinutes(),ss:t.getSeconds()<10?"0"+t.getSeconds():t.getSeconds()},o=n||"yyyy-MM-dd";return Object.keys(r).forEach((function(e){var n=r[e];"MM"===e&&Number(n)<=9&&(n="0".concat(n)),o=o.replace(e,String(n))})),o},e.genCustomConsole=function(e,n){void 0===e&&(e=""),void 0===n&&(n={isClosed:!1,showWrap:!1,showDate:!1,locales:"en-US",logFn:function(){},errorFn:function(){}});var t=Object.assign({isClosed:!1,showWrap:!1,showDate:!1,locales:"en-US",logFn:function(){},errorFn:function(){}},n),r=t.isClosed,o=t.showWrap,i=t.showDate,a=t.locales,u=t.logFn,c=t.errorFn,s=Object.create(null),d=function(){return(new Date).toLocaleDateString(a,{weekday:"short",year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"})};return["log","info","warn","error"].forEach((function(n){s[n]=function(){for(var t=[],a=0;a<arguments.length;a++)t[a]=arguments[a];if(r)return!1;var s=e,l=e;if("string"==typeof e&&e.length>=2){var f=e.length;s=":"===e[f-1]?e.substring(0,f-1):e}o&&console.log("--- ".concat(s," - begin ---")),i&&(l=e?"".concat(d()," ").concat(e):"".concat(d())),e||i?console[n].apply(console,function(e,n,t){if(t||2===arguments.length)for(var r,o=0,i=n.length;o<i;o++)!r&&o in n||(r||(r=Array.prototype.slice.call(n,0,o)),r[o]=n[o]);return e.concat(r||Array.prototype.slice.call(n))}([l],t,!1)):console[n].apply(console,t),"log"===n&&u(),"error"===n&&c(),o&&console.log("--- ".concat(s," - end ---"))}})),s},e.genHashCode=function(e){var n,t=0;for(n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return t},e.genRndNumString=l,e.genStyleString=function(e,n){var t="";return n&&n.length>0&&(t=n.join(";")+";"),"".concat(e,"{").concat(t,"}")},e.genUniqueNumString=g,e.generateRndNum=f,e.generateUniqueNum=function(e){return void 0===e&&(e=3),g(e)},e.getBrowserInfo=A,e.getCLS=function(){return t(this,void 0,void 0,(function(){return r(this,(function(e){return b("layout-shift")?[2,new Promise((function(e){var n=new PerformanceObserver((function(t){var r=t.getEntries().reduce((function(e,n){var t=0;return v(n.value)&&(t=n.value),e+t}),0);n.disconnect(),e(r)}));n.observe({type:"layout-shift",buffered:!0})}))]:[2,0]}))}))},e.getCookie=y,e.getCurrentVersion=function(){return"v3"},e.getDefineListeners=C,e.getDomain=function(e,n){void 0===n&&(n=["hostname"]);var t=document.createElement("a");return t.href=e,n.reduce((function(e,n){return e+=t[n]}),"")},e.getFCP=S,e.getFID=function(){return t(this,void 0,void 0,(function(){return r(this,(function(e){return b("first-input")?[2,new Promise((function(e){var n=new PerformanceObserver((function(t){var r=t.getEntries().find((function(e){return"first-input"===e.entryType}));if(r){n.disconnect();var o=r.processingStart;e(o?Math.round(r.processingStart-r.startTime):0)}}));n.observe({type:"first-input",buffered:!0})}))]:[2,0]}))}))},e.getFP=E,e.getFileSize=function(e){var n=function(e){return String(Math.ceil(e))};if(!e)return"";var t=1024;return e<t?e+" B":e<Math.pow(t,2)?n(e/t)+" KB":e<Math.pow(t,3)?n(e/Math.pow(t,2))+" MB":e<Math.pow(t,4)?n(e/Math.pow(t,3))+" G":n(e/Math.pow(t,4))+" T"},e.getFriendlyInterval=function(e,n,t){void 0===e&&(e=0),void 0===n&&(n=0),void 0===t&&(t=p);var r=(t=Object.assign(p,t)).type;v(e)||(e=new Date(e).getTime()),v(n)||(n=new Date(n).getTime());var o=Number(n)-Number(e),i="",a=new Array(4).fill(0),u=a[0],c=(a[1],a[2],a[3]),s=decodeURIComponent("%20%E5%A4%A9%20"),d=decodeURIComponent("%20%E6%97%B6%20"),l=decodeURIComponent("%20%E5%88%86%20"),f=decodeURIComponent("%20%E7%A7%92");if(o>=0)switch(u=Math.floor(o/1e3/60/60/24),Math.floor(o/1e3/60/60),Math.floor(o/1e3/60),c=Math.floor(o/1e3),r){case"d":i=u;break;case"text":i=(u=Math.floor(o/1e3/60/60/24))+s+Math.floor(o/1e3/60/60%24)+d+Math.floor(o/1e3/60%60)+l+(c=Math.floor(o/1e3%60))+f;break;default:i=c}return i},e.getHashQueryParam=function(e){var n=location.hash.split("?");if(1===n.length)return"";var t=new RegExp("(^|&)".concat(e,"=([^&]*)(&|$)")),r=n[1].match(t);return r?r[2]:""},e.getLCP=function(){return t(this,void 0,void 0,(function(){return r(this,(function(e){return b("largest-contentful-paint")?[2,new Promise((function(e){var n=new PerformanceObserver((function(t){var r=t.getEntries().find((function(e){return"largest-contentful-paint"===e.entryType}));r&&(n.disconnect(),e(Math.round(r.startTime)))}));n.observe({type:"largest-contentful-paint",buffered:!0})}))]:[2,0]}))}))},e.getLocalStorage=function(e){var n=null;if(e){var t=localStorage.getItem(e);t&&(n=JSON.parse(t))}return n},e.getPerformance=function(e){return void 0===e&&(e=!1),t(this,void 0,void 0,(function(){function n(){var n={source:z,os:t(),osVersion:o(),deviceType:i(),network:a(),screenDirection:u(),unloadTime:h-w,redirectTime:y-A,dnsTime:T-C,tcpTime:M-O,sslTime:s(M,P),responseTime:N-_,downloadTime:k-N,firstPaintTime:V,firstContentfulPaintTime:W,domReadyTime:R-q,onloadTime:F-q,whiteTime:N-q,renderTime:B-q,decodedBodySize:j,encodedBodySize:D};Object.keys(n).forEach((function(e){v(n[e])&&(n[e]<0?n[e]=0:n[e]=Math.round(n[e]))})),v(n.whiteTime)&&n.whiteTime>n.onloadTime&&(n.whiteTime=0);var r={};e||Object.keys(n).forEach((function(e){r[c(e)]=n[e]})),Object.keys(r).length?l(r):l(n)}function t(){return navigator.userAgent.indexOf("Android")>-1||navigator.userAgent.indexOf("Linux")>-1?"android":navigator.userAgent.indexOf("iPhone")>-1?"ios":navigator.userAgent.indexOf("Windows Phone")>-1?"wp":"others"}function o(){var e="",n=navigator.userAgent,t=n.indexOf("Android")>-1||n.indexOf("Linux")>-1,r=!!n.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),o=navigator.userAgent.split(";");if(o.length<2)return e;var i=o[1];return i?(t&&(e=(i.match(/\d+\.\d+/g)||[])[0]),r&&(e=(i.match(/(\d+)_(\d+)_?(\d+)?/)||[])[0]),e||(e=""),e):e}function i(){var e,n=navigator.userAgent.toLowerCase(),t=n.match(/(ipad)/i)&&"ipad",r=n.match(/iphone os/i)&&"iphone os",o=n.match(/midp/i)&&"midp",i=n.match(/rv:1.2.3.4/i)&&"rv:1.2.3.4",a=n.match(/ucweb/i)&&"ucweb",u=n.match(/android/i)&&"android",c=n.match(/windows ce/i)&&"windows ce",s=n.match(/windows mobile/i)&&"windows mobile";return(e=t||r||o||i||a||u||c||s?r||o||i||a||u||c||s?"phone":t?"ipad":void 0:"pc")||(e=""),e}function a(){var e="",n=window.navigator;if(n.connection&&n.connection.effectiveType)switch(n.connection.effectiveType){case"wifi":e="wifi";break;case"4g":e="4g";break;case"2g":e="2g";break;case"3g":e="3g";break;case"ethernet":e="ethernet";break;case"default":e=void 0}return e||(e=""),e}function u(){var e="";return window.screen&&window.screen.orientation&&window.screen.orientation.angle&&(180!==window.screen.orientation.angle&&0!==window.screen.orientation.angle||(e="|"),90!==window.screen.orientation.angle&&-90!==window.screen.orientation.angle||(e="-")),e}function s(e,n){var t=0;return n&&(t=e-n),t}var d,l,f,g,p,m,h,w,y,A,T,C,M,O,P,N,_,k,R,F,B,I,L,j,D,U,z,q,Z,V,W;return r(this,(function(e){switch(e.label){case 0:if(!b("navigation"))return[2,Promise.reject(new Error("navigation is not supported"))];if(!(d=window.performance)||"function"!=typeof d.getEntries||"function"!=typeof d.getEntriesByType)return[2,Promise.reject(new Error("performance is not supported"))];if(f=new Promise((function(e){l=[e][0]})),g=null,x(p=d.getEntriesByType("navigation"))&&(g=p[0]),m=new Array(19).fill(0),h=m[0],w=m[1],y=m[2],A=m[3],T=m[4],C=m[5],M=m[6],O=m[7],P=m[8],N=m[9],_=m[10],k=m[11],R=m[12],F=m[13],B=m[14],I=m[15],L=m[16],j=m[17],D=m[18],U=d.timing,z="",g)z="PerformanceNavigationTiming",j=g.decodedBodySize,D=g.encodedBodySize,h=g.unloadEventEnd,w=g.unloadEventStart,y=g.redirectEnd,A=g.redirectStart,T=g.domainLookupEnd,C=g.domainLookupStart,M=g.connectEnd,O=g.connectStart,P=g.secureConnectionStart,N=g.responseStart,_=g.requestStart,k=g.responseEnd,R=g.domContentLoadedEventStart,F=g.loadEventStart,B=g.loadEventEnd,I=g.startTime,L=g.fetchStart;else{if(!U)return[2,Promise.reject(new Error("NavigationTiming and Timing are not supported"))];z="PerformanceTiming",h=U.unloadEventEnd,w=U.unloadEventStart,y=U.redirectEnd,A=U.redirectStart,T=U.domainLookupEnd,C=U.domainLookupStart,M=U.connectEnd,O=U.connectStart,P=U.secureConnectionStart,N=U.responseStart,_=U.requestStart,k=U.responseEnd,R=U.domContentLoadedEventStart,F=U.loadEventStart,B=U.loadEventEnd,I=U.navigationStart,L=U.fetchStart}if(q=0,v(I))q=I;else{if(!v(L))return[2,Promise.reject(new Error("startTime, navigationStart or fetchStart are required"))];q=L}return[4,Promise.all([E(),S()])];case 1:return Z=e.sent(),V=Z[0],W=Z[1],v(B)&&B>0?n():window.addEventListener("load",(function(){window.setTimeout((function(){n()}),0)})),[2,f]}}))}))},e.getQueryParam=function(e){var n=new RegExp("(^|&)"+e+"=([^&]*)(&|$)"),t=location.search.substring(1).match(n);return null!==t?decodeURIComponent(t[2]):""},e.getScriptQueryParam=function(e,n){void 0===n&&(n=""),n||(n=".js");for(var t=new RegExp("[?&]".concat(e,"=([^&]*)")),r=document.querySelectorAll('script[src*="'.concat(n,'"]')),o=0;o<r.length;o++){var i=r[o].getAttribute("src");if(i&&-1!==i.indexOf(n)){var a=i.match(t);if(a)return decodeURIComponent(a[1])}}return""},e.getSessionStorage=function(e){var n=null;if(e){var t=sessionStorage.getItem(e);t&&(n=JSON.parse(t))}return n},e.getTTFB=function(){return t(this,void 0,void 0,(function(){var e,n;return r(this,(function(t){return b("navigation")&&window.performance&&window.performance.getEntriesByType?(e=performance.getEntriesByType("navigation")[0],0,e?(n=e.responseStart-e.requestStart,[2,Math.round(n)]):[2,0]):[2,0]}))}))},e.getUrlFileType=function(e){var n="";if("string"!=typeof e||""==e)return n;var t=/\.[^/?#]+$/.exec(e);return t?(t[0].length>1&&(n=t[0].substring(1)),n):n},e.getUrlParam=function(e,n,t){void 0===t&&(t={});var r=null;if(e.includes("#")){r=new URL(e).searchParams.getAll(n)}else{var o={};e.replace(/\??(\w+)=([^&]*)&?/g,(function(e,n,t){return void 0!==o[n]?o[n].push(t):o[n]=[t],""})),r=o[n]||[]}return t.returnArray?r:r.length?r[0]:null},e.hasClass=function(e,n){for(var t=e.className.split(/\s+/),r=0;r<t.length;r++)if(t[r]===n)return!0;return!1},e.inRate=function(e){return Math.random()<e},e.invokeEvent=function(e){var n=C()[e];if(n instanceof Array)for(var t=0,r=n.length;t<r;t++)"function"==typeof n[t]&&n[t]({type:e})},e.isJSONString=d,e.isJsonString=function(e){return d(e)},e.isNonEmptyArray=x,e.isNumber=v,e.isSafePWAEnv=function(){var e=A();return!(!("serviceWorker"in navigator&&function(){var e;try{return e=new Function("return async function(){};")(),null!=Object.getPrototypeOf(e).constructor}catch(e){return!1}}()&&"undefined"!=typeof Promise&&-1!==Promise.toString().indexOf("[native code]")&&Boolean(window.fetch)&&Boolean(window.indexedDB)&&Boolean(window.caches))||e.shell)},e.isSupportWebp=function(){return new Promise((function(e){var n=new Image;n.onload=function(){e(n.width>0&&n.height>0)},n.onerror=function(){e(!1)},n.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAAAAAAfQ//73v/+BiOh/AAA="}))},e.isValidData=function(e,n,t){var r=!1;return"object"!=typeof e||n.reduce((function(e,n){return void 0===e[n]?Object.create(null):e=e[n]}),e)===t&&(r=!0),r},e.isValidEmail=function(e){return/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(e)},e.isValidHttpUrl=function(e,n){void 0===n&&(n={strict:!0});var t=/^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9\u4E00-\u9FA5()!@:%_+.~#?&//=]*)/;return n.strict||(t=/^(https?:)?\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9\u4E00-\u9FA5()!@:%_+.~#?&//=]*)/),t.test(e)},e.isValidPhoneNumber=function(e){return/^1\d{10}$/.test(e)},e.isValidUrl=function(e){return/^[a-zA-Z0-9]+:\/\/[-a-zA-Z0-9@:%._+~#=]{1,256}\b([-a-zA-Z0-9\u4E00-\u9FA5()!@:%_+.~#?&//=]*)$/.test(e)},e.loadCSS=function(e,n){void 0===n&&(n={id:""});var t,r=n.id,o=function(){},i=new Promise((function(e,n){var r;t=(r=[e,n])[0],o=r[1]})),a=function(){t("loaded")},u=document.createElement("link");u||o(new Error("Not support create link element"));var c="onload"in u,s=+navigator.userAgent.replace(/.*(?:AppleWebKit|AndroidWebKit)\/?(\d+).*/i,"$1")<536;if(u.rel="stylesheet",u.type="text/css",u.href=e,void 0!==r&&(u.id=r),document.getElementsByTagName("head")[0].appendChild(u),s||!c)return setTimeout((function(){l(u,a,0)}),1),i;function d(){u&&(u.onload=u.onerror=u.onreadystatechange=null),u=null,a()}function l(e,n,t){if(e){var r,o=e.sheet;if((t+=1)>3e5)return r=!0,e&&(e=null),void n();if(s)o&&(r=!0);else if(o)try{o.cssRules&&(r=!0)}catch(e){var i=e;if(!i.name)return;"NS_ERROR_DOM_SECURITY_ERR"===i.name&&(r=!0)}setTimeout((function(){r?n():l(e,n,t)}),20)}}return c?(u.onload=d,u.onerror=function(){d()}):u.onreadystatechange=function(){u&&/loaded|complete/.test(u.readyState)&&d()},i},e.loadImage=function(e){return new Promise((function(n,t){var r=new Image;r.onload=function(){n(r)},r.onerror=function(e){t(e)},r.src=e}))},e.loadScript=h,e.loadScriptIfUndefined=function(e,n){return window[e]?Promise.resolve("defined"):h(n)},e.longestComSubsequence=i,e.longestComSubstring=o,e.mNow=w,e.mTrim=function(e){for(var n=(e=e.replace(/^\s+/,"")).length-1,t=/\s/;t.test(e.charAt(n));)n--;return e.slice(0,n+1)},e.newLine=function(e){if(!e)return"";var n=new RegExp("\\n","g");return e.replace(n,"<br />")},e.removeClass=function(e,n){var t;t=(t=(t=(t=" "+e.className+" ").replace(/(\s+)/gi," ")).replace(" "+n+" "," ")).replace(/(^\s+)|(\s+$)/g,""),e.className=t},e.removeEvent=function(e,n){var t=C(),r=t[e];if("string"==typeof e&&r instanceof Array)if("function"==typeof n){for(var o=0,i=r.length;o<i;o++)if(r[o]===n){t[e].splice(o,1);break}}else delete t[e]},e.repeatUntilConditionMet=function(e,n,o){var i=this;void 0===n&&(n={}),void 0===o&&(o=function(e){return!0===e});var a=n.interval,u=void 0===a?1e3:a,c=n.times,s=void 0===c?10:c,d=n.context,l=n.args,f=0;"function"!=typeof e&&console.error("Expected a function."),("number"!=typeof u||u<0)&&console.error("Expected a non-negative number for interval."),("number"!=typeof s||s<0)&&console.error("Expected a non-negative number for times."),function n(){setTimeout((function(){return t(i,void 0,void 0,(function(){var t;return r(this,(function(r){switch(r.label){case 0:return[4,e.apply(d,l)];case 1:return t=r.sent(),o(t)||++f>=s?[2]:(n(),[2])}}))}))}),u)}()},e.sanitizeInput=function(e){var n={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};if("string"!=typeof e)throw new Error("Input must be a string");return e.replace(/[&<>"'/]/g,(function(e){return n[e]}))},e.setCookie=function(e,n,t,r){var o,i;if(t){var a=new Date;a.setTime(a.getTime()+24*t*60*60*1e3),i="; expires="+a.toUTCString()}else i="";var u=location.host;1===u.split(".").length?document.cookie=e+"="+n+i+"; path=/":((o=u.split(".")).shift(),r=r||"."+o.join("."),document.cookie=e+"="+n+i+"; path=/; domain="+r,null!==y(e)&&y(e)===n||(r=r||"."+u,document.cookie=e+"="+n+i+"; path=/; domain="+r))},e.setImgWidHeiBySrc=function(){var e,n=window.jQuery||window.$;return n?!(!(e=n("img"))||!e.length)&&(e.each((function(){var e=n(this);if(e){var t=e.attr("src");if(t&&"string"==typeof t&&t.length){var r=t.match(/width=([0-9]+[a-z%]*)/),o=t.match(/height=([0-9]+[a-z%]*)/);r&&x(r)&&r[1]&&e.width(r[1]),o&&x(o)&&o[1]&&e.height(o[1])}}})),!0):(e=document.getElementsByTagName("img")).length>0&&(Array.from(e).forEach((function(e){var n=e;if(n){var t=n.getAttribute("src");if(t&&"string"==typeof t&&t.length){var r=t.match(/width=([0-9]+[a-z%]*)/),o=t.match(/height=([0-9]+[a-z%]*)/);r&&x(r)&&r[1]&&(n.style.width=r[1]),o&&x(o)&&o[1]&&(n.style.height=o[1])}}})),!0)},e.setLocalStorage=function(e,n){void 0===n&&(n=null),e&&localStorage.setItem(e,JSON.stringify(n))},e.setSessionStorage=function(e,n){void 0===n&&(n=null),e&&sessionStorage.setItem(e,JSON.stringify(n))},e.sleep=function(e){return t(this,void 0,void 0,(function(){return r(this,(function(n){return[2,M(e)]}))}))},e.throttle=function(e,n,t){void 0===t&&(t={}),t=Object.assign({},t);var r=null,o=null,i=null,a=[null,0],u=a[0],c=a[1],s=function(){c=!1===t.leading?0:w(),i=null,u=e.apply(this,o),i||(r=o=null)};return function(){for(var a=[],d=0;d<arguments.length;d++)a[d]=arguments[d];var l=w();c||!1!==t.leading||(c=l);var f=n-(l-c);return r=this,o=a,f<=0||f>n?(i&&(clearTimeout(i),i=null),c=l,u=e.apply(r,o),i||(r=o=null)):i||!1===t.trailing||(i=setTimeout(s.bind(r),f)),u}},e.truncateZHString=T,e.unsanitize=function(e){var n={"&":"&","<":"<",">":">",""":'"',"'":"'","/":"/"};if("string"!=typeof e)throw new Error("Input must be a string");return e.replace(/(&|<|>|"|'|/)/g,(function(e){return n[e]}))},e.updateQueryParam=function(e,n,t){if(e.includes("#")){var r=new URL(e);return r.searchParams.set(n,t),r.toString()}var o=new RegExp("([?&])"+n+"=.*?(&|$)","i"),i=-1!==e.indexOf("?")?"&":"?";return e.match(o)?e.replace(o,"$1"+n+"="+t+"$2"):e+i+n+"="+t},e.waitTime=M,e.windowLoaded=function(e){void 0===e&&(e=90);var n,t=function(){},r=new Promise((function(e,r){t=e,n=r}));return"complete"===document.readyState?t("complete"):window.addEventListener("load",(function(){return t("load")})),setTimeout((function(){return n(Error("timeout"))}),1e3*e),r},e.zAxiosIsValidRes=function(e,n){void 0===n&&(n={validStatusRange:[200,300],validCode:[0]});var t=Object.assign({validStatusRange:[200,300],validCode:[0]},n),r=t.validStatusRange,o=t.validCode;2!==r.length&&console.error("valid validStatusRange is required");var i=!1;if(e&&e.status&&2===r.length&&e.status>=r[0]&&e.status<r[1]){var a=e.data;a&&o.includes(a.code)&&(i=!0)}return i},e}({});
|
|
6
|
+
var mazey=function(e){"use strict";var n=function(){return n=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},n.apply(this,arguments)};function t(e,n,t,r){return new(t||(t=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function u(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var n;e.done?o(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(a,u)}c((r=r.apply(e,n||[])).next())}))}function r(e,n){var t,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(u){return function(c){return function(u){if(t)throw new TypeError("Generator is already executing.");for(;i&&(i=0,u[0]&&(a=0)),a;)try{if(t=1,r&&(o=2&u[0]?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return a.label++,{value:u[1],done:!1};case 5:a.label++,r=u[1],u=[0];continue;case 7:u=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==u[0]&&2!==u[0])){a=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){a.label=u[1];break}if(6===u[0]&&a.label<o[1]){a.label=o[1],o=u;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(u);break}o[2]&&a.ops.pop(),a.trys.pop();continue}u=n.call(e,a)}catch(e){u=[6,e],r=0}finally{t=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,c])}}}function o(e,n,t){if(t||2===arguments.length)for(var r,o=0,i=n.length;o<i;o++)!r&&o in n||(r||(r=Array.prototype.slice.call(n,0,o)),r[o]=n[o]);return e.concat(r||Array.prototype.slice.call(n))}function i(e){if("object"!=typeof e)return e;var t=["string","number","boolean","undefined"];return Object.values(e).every((function(e){return t.includes(typeof e)}))?n({},e):JSON.parse(JSON.stringify(e))}function a(e){var n=e.replace(/([A-Z])/g,"-$1").toLowerCase();return"-"===n[0]?n.substring(1):n}function u(e){var n=e.replace(/([A-Z])/g,"_$1").toLowerCase();return"_"===n[0]?n.substring(1):n}function c(e){return u(e)}function s(e){try{if("object"==typeof JSON.parse(e))return!0}catch(e){}return!1}function d(e){void 0===e&&(e=5);for(var n="";e--;)n+=Math.floor(10*Math.random());return n}function f(e){return void 0===e&&(e=5),d(e)}function l(e){void 0===e&&(e=3);var n=[g(),f(e||3)];return n[0]+n[1]}function g(){return Date.now?Date.now():(new Date).getTime()}"function"==typeof SuppressedError&&SuppressedError;var p={type:"d"};function v(e,n){void 0===n&&(n={});var t=n.isNaNAsNumber,r=void 0!==t&&t,o=n.isInfinityAsNumber,i=void 0!==o&&o,a=n.isUnFiniteAsNumber;return"number"==typeof e&&(!(!0!==i&&!0!==(void 0!==a&&a)&&!isFinite(e))&&!(!r&&isNaN(e)))}function m(e){for(var n=[],t=1;t<arguments.length;t++)n[t-1]=arguments[t];var r=null;return e&&"function"==typeof e&&(r=e.apply(void 0,n)),r}function h(e){for(var n=[],t=1;t<arguments.length;t++)n[t-1]=arguments[t];return m.apply(void 0,o([e],n,!1))}function w(e){var n=!1;return Array.isArray(e)&&e.length&&(n=!0),n}function y(e){if(!e)return"";var n=new RegExp("\\n","g");return e.replace(n,"<br />")}function b(e,n){void 0===n&&(n={});var t=n.removeNewLine,r=void 0!==t&&t,o="";return e&&(o=e.replace(/<\/?.+?>/g,""),r&&(o=o.replace(/[\r\n]/g,""))),o}function S(e){var n={"&":"&","<":"<",">":">",""":'"',"'":"'","/":"/"};if("string"!=typeof e)throw new Error("Input must be a string");return e.replace(/(&|<|>|"|'|/)/g,(function(e){return n[e]}))}function E(e,n,t){if(void 0===t&&(t={hasDot:!1,dotText:"..."}),t=Object.assign({hasDot:!1,dotText:"..."},t),""!=e&&e){for(var r=0,o="",i=/[^\x00-\xff]/g,a="",u=e.replace(i,"**").length,c=0;c<u&&(null!=(a=e.charAt(c).toString()).match(i)?r+=2:r++,!(r>n));c++)o+=a;return t.hasDot&&u>n&&(o+=t.dotText),o}return""}function T(e,n,t){return void 0===t&&(t=!1),E(e,n,{hasDot:t})}function A(e){return t(this,void 0,void 0,(function(){return r(this,(function(n){return[2,new Promise((function(n){setTimeout((function(){n(e)}),e)}))]}))}))}function x(e,n){for(var t=e.length,r=n.length,o=i(new Array(t).fill(new Array(r).fill(0))),a=0;a<t;++a)for(var u=0;u<r;++u)if(e[a]===n[u]){var c=0;a>0&&u>0&&(c=o[a-1][u-1]),o[a][u]=c+1}var s=Array.prototype.concat.apply([],o);return Math.max.apply(Math,s)}function C(e,n){for(var t=e.length,r=n.length,o=i(new Array(t).fill(new Array(r).fill(0))),a=0;a<t;++a)for(var u=0;u<r;++u)if(e[a]===n[u]){var c=0;a>0&&u>0&&(c=o[a-1][u-1]),o[a][u]=c+1}else{var s=[0,0],d=s[0],f=s[1];u>0&&(d=o[a][u-1]),a>0&&(f=o[a-1][u]),o[a][u]=Math.max(d,f)}var l=Array.prototype.concat.apply([],o);return Math.max.apply(Math,l)}function M(e){return Math.random()<e}function O(e,n){for(var t=e.className,r=t.split(/\s+/),o=0;o<r.length;o++)if(r[o]===n)return;var i,a="";""!==t&&(a=" "),i=t+a+n,e.className=i}function P(){var e,n=window.jQuery||window.$;return n?!(!(e=n("img"))||!e.length)&&(e.each((function(){var e=n(this);if(e){var t=e.attr("src");if(t&&"string"==typeof t&&t.length){var r=t.match(/width=([0-9]+[a-z%]*)/),o=t.match(/height=([0-9]+[a-z%]*)/);r&&w(r)&&r[1]&&e.width(r[1]),o&&w(o)&&o[1]&&e.height(o[1])}}})),!0):(e=document.getElementsByTagName("img")).length>0&&(Array.from(e).forEach((function(e){var n=e;if(n){var t=n.getAttribute("src");if(t&&"string"==typeof t&&t.length){var r=t.match(/width=([0-9]+[a-z%]*)/),o=t.match(/height=([0-9]+[a-z%]*)/);r&&w(r)&&r[1]&&(n.style.width=r[1]),o&&w(o)&&o[1]&&(n.style.height=o[1])}}})),!0)}function k(){var e=window.MAZEY_DEFINE_LISTENERS;return"object"!=typeof e&&(e={},window.MAZEY_DEFINE_LISTENERS=e),e}function N(e){var n=k()[e];if(n instanceof Array)for(var t=0,r=n.length;t<r;t++)"function"==typeof n[t]&&n[t]({type:e})}function _(e){for(var n=e+"=",t=document.cookie.split(";"),r=0;r<t.length;r++){for(var o=t[r];" "==o.charAt(0);)o=o.substring(1,o.length);if(0==o.indexOf(n))return o.substring(n.length,o.length)}return""}function R(e){for(var n=document.cookie.split(";"),t=0;t<n.length;t++){var r=n[t].trim();if(r.startsWith("".concat(e,"="))){var o=r.split("=")[0],i=new Date;return i.setTime(i.getTime()-1),document.cookie="".concat(o,"=;expires=").concat(i.toUTCString()),!0}}return!1}function F(e,n){void 0===n&&(n={id:"",callback:function(){},timeout:5e3,isDefer:!1});var t,r,o=Object.assign({id:"",callback:function(){},timeout:5e3,isDefer:!1},n),i=o.id,a=o.callback,u=o.timeout,c=o.isDefer,s=document.createElement("script");s||Promise.reject("Not support create script element");var d=document.getElementsByTagName("script")[0];return s.type="text/javascript",c&&(s.defer=!0),i&&(s.id=i),s.readyState?s.onreadystatechange=function(){"loaded"!==s.readyState&&"complete"!==s.readyState||(s.onreadystatechange=null,h(a),h(t,"loaded"))}:s.onload=function(){h(a),h(t,"loaded")},s.src=e,d&&d.parentNode.insertBefore(s,d),new Promise((function(e,n){var o;t=(o=[e,n])[0],r=o[1],u&&setTimeout(r.bind(null,"timeout"),u)}))}function B(e){var n=[],t=window.PerformanceObserver;return!!t&&(w(t.supportedEntryTypes)&&(n=t.supportedEntryTypes),n.includes(e))}function D(){return t(this,void 0,void 0,(function(){return r(this,(function(e){return B("paint")?[2,new Promise((function(e){var n=new PerformanceObserver((function(t){var r=t.getEntries().find((function(e){return"first-contentful-paint"===e.name}));r&&(n.disconnect(),e(Math.round(r.startTime)))}));n.observe({type:"paint",buffered:!0})}))]:[2,0]}))}))}function I(){return t(this,void 0,void 0,(function(){return r(this,(function(e){return B("paint")?[2,new Promise((function(e){var n=new PerformanceObserver((function(t){var r=t.getEntries().find((function(e){return"first-paint"===e.name}));r&&(n.disconnect(),e(Math.round(r.startTime)))}));n.observe({type:"paint",buffered:!0})}))]:[2,0]}))}))}function j(){if(window.MAZEY_BROWSER_INFO&&"object"==typeof window.MAZEY_BROWSER_INFO)return window.MAZEY_BROWSER_INFO;var e={engine:"",engineVs:"",platform:"",supporter:"",supporterVs:"",system:"",systemVs:""};try{var t=navigator.userAgent.toLowerCase();if(!t)return e;var r=function(e){return e.test(t)},o=function(e){var n="",r=t.match(e);return r&&w(r)&&(n=(n=(n=r.toString()).replace(/[^0-9|_.]/g,"")).replace(/_/g,".")),n},i="",a="";r(/windows|win32|win64|wow32|wow64/g)?i="windows":r(/macintosh|macintel/g)?i="macos":r(/x11/g)?i="linux":r(/android|adr/g)?i="android":r(/ios|iphone|ipad|ipod|iwatch/g)&&(i="ios",r(/ipad/g)?a="ipad":r(/iphone/g)?a="iphone":r(/iwatch/g)?a="iwatch":r(/ipod/g)&&(a="ipod")),e=n(n({},e),{system:i,appleType:a});var u="";"windows"===i?r(/windows nt 5.0|windows 2000/g)?u="2000":r(/windows nt 5.1|windows xp/g)?u="xp":r(/windows nt 5.2|windows 2003/g)?u="2003":r(/windows nt 6.0|windows vista/g)?u="vista":r(/windows nt 6.1|windows 7/g)?u="7":r(/windows nt 6.2|windows 8/g)?u="8":r(/windows nt 6.3|windows 8.1/g)?u="8.1":r(/windows nt 10.0|windows 10/g)&&(u="10"):"macos"===i?u=o(/os x [\d._]+/g):"android"===i?u=o(/android [\d._]+/g):"ios"===i&&(u=o(/os [\d._]+/g)),e=n(n({},e),{systemVs:u});var c="";"windows"===i||"macos"===i||"linux"===i?c="desktop":("android"===i||"ios"===i||r(/mobile/g))&&(c="mobile"),e=n(n({},e),{platform:c});var s="",d="";r(/applewebkit/g)?(s="webkit",r(/edge/g)?d="edge":r(/opr/g)?d="opera":r(/chrome/g)?d="chrome":r(/safari/g)&&(d="safari")):r(/gecko/g)&&r(/firefox/g)?(s="gecko",d="firefox"):r(/presto/g)?(s="presto",d="opera"):r(/trident|compatible|msie/g)&&(s="trident",d="iexplore"),e=n(n({},e),{engine:s,supporter:d});var f="";"webkit"===s?f=o(/applewebkit\/[\d._]+/g):"gecko"===s?f=o(/gecko\/[\d._]+/g):"presto"===s?f=o(/presto\/[\d._]+/g):"trident"===s&&(f=o(/trident\/[\d._]+/g)),e=n(n({},e),{engineVs:f});var l="";"chrome"===d?l=o(/chrome\/[\d._]+/g):"safari"===d?l=o(/version\/[\d._]+/g):"firefox"===d?l=o(/firefox\/[\d._]+/g):"opera"===d?l=o(/opr\/[\d._]+/g):"iexplore"===d?l=o(/(msie [\d._]+)|(rv:[\d._]+)/g):"edge"===d&&(l=o(/edge\/[\d._]+/g)),e=n(n({},e),{supporterVs:l});var g="",p="";return r(/micromessenger/g)?(g="wechat",p=o(/micromessenger\/[\d._]+/g)):r(/qqbrowser/g)?(g="qq_browser",p=o(/qqbrowser\/[\d._]+/g)):r(/\sqq/g)?g="qq_app":r(/ucbrowser/g)?(g="uc",p=o(/ucbrowser\/[\d._]+/g)):r(/qihu 360se/g)?g="360":r(/2345explorer/g)?(g="2345",p=o(/2345explorer\/[\d._]+/g)):r(/metasr/g)?g="sougou":r(/lbbrowser/g)?g="liebao":r(/maxthon/g)?(g="maxthon",p=o(/maxthon\/[\d._]+/g)):r(/biliapp/g)&&(g="bilibili"),e=n(n({},e),{shell:g,shellVs:p}),window.MAZEY_BROWSER_INFO=e,e}catch(n){return console.warn("MazeyCon:",n),e}}return e.addClass=O,e.addEvent=function(e,n){var t=k();void 0===t[e]&&(t[e]=[]),"function"==typeof n&&t[e].push(n)},e.addStyle=function(e,n){if(void 0===n&&(n={id:""}),!e)return!1;var t=document.createDocumentFragment(),r=null,o="",i=document.createElement("style");return n.id?(o="".concat(n.id),(r=document.getElementById(o))?r.innerHTML=e:(i.setAttribute("id",n.id),i.innerHTML=e,t.appendChild(i),document.head.appendChild(t))):(i.innerHTML=e,t.appendChild(i),document.head.appendChild(t)),!0},e.calLongestCommonSubsequence=function(e,n){return C(e,n)},e.calLongestCommonSubstring=function(e,n){return x(e,n)},e.camelCase2Underscore=c,e.camelCaseToKebabCase=function(e){return a(e)},e.cancelBubble=function(e){var n=e||window.event;n.stopPropagation?n.stopPropagation():n.cancelBubble=!0},e.clearHtml=function(e,n){return void 0===n&&(n={}),b(e,n)},e.convert10To26=function(e){for(var n="";e>0;){var t=e%26;0===t&&(t=26),n=String.fromCharCode(t+96)+n,e=(e-t)/26}return n},e.convertCamelToKebab=a,e.convertCamelToUnder=u,e.convertKebabToCamel=function(e){var n=e.replace(/-([a-z])/g,(function(e,n){return n.toUpperCase()}));return n.endsWith("-")?n.slice(0,-1):n},e.convertToHtmlBreaks=y,e.cutCHSString=function(e,n,t){return void 0===t&&(t=!1),T(e,n,t)},e.cutZHString=E,e.debounce=function(e,n,t){var r=null,o=null,i=null,a=null,u=null,c=function c(){var s=g()-i;s<n&&s>=0?o=setTimeout(c,n-s):(o=null,t||(u=e.apply(r,a),o||(r=a=null)))};return function(){for(var s=[],d=0;d<arguments.length;d++)s[d]=arguments[d];r=this,a=s,i=g();var f=t&&!o;return o||(o=setTimeout(c,n)),f&&(u=e.apply(r,a),r=a=null),u}},e.deepCopy=i,e.deepCopyObject=function(e){return i(e)},e.delCookie=function(e){R(e)},e.doFn=h,e.fireEvent=N,e.floatFixed=function(e,n){return void 0===n&&(n=0),parseFloat(e).toFixed(n)},e.floatToPercent=function(e,n){void 0===n&&(n=0);var t="";return t=n?(100*e).toFixed(n):String(Math.floor(100*e)),"".concat(t,"%")},e.formatDate=function(e,n){void 0===n&&(n="yyyy-MM-dd"),e||(e=new Date);var t=new Date(e),r={yyyy:t.getFullYear(),MM:t.getMonth()+1,dd:t.getDate()<10?"0"+t.getDate():t.getDate(),hh:t.getHours()<10?"0"+t.getHours():t.getHours(),mm:t.getMinutes()<10?"0"+t.getMinutes():t.getMinutes(),ss:t.getSeconds()<10?"0"+t.getSeconds():t.getSeconds()},o=n||"yyyy-MM-dd";return Object.keys(r).forEach((function(e){var n=r[e];"MM"===e&&Number(n)<=9&&(n="0".concat(n)),o=o.replace(e,String(n))})),o},e.genCustomConsole=function(e,n){void 0===e&&(e=""),void 0===n&&(n={isClosed:!1,showWrap:!1,showDate:!1,locales:"en-US",logFn:function(){},errorFn:function(){}});var t=Object.assign({isClosed:!1,showWrap:!1,showDate:!1,locales:"en-US",logFn:function(){},errorFn:function(){}},n),r=t.isClosed,i=t.showWrap,a=t.showDate,u=t.locales,c=t.logFn,s=t.errorFn,d=Object.create(null),f=function(){return(new Date).toLocaleDateString(u,{weekday:"short",year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"})};return["log","info","warn","error"].forEach((function(n){d[n]=function(){for(var t=[],u=0;u<arguments.length;u++)t[u]=arguments[u];if(r)return!1;var d=e,l=e;if("string"==typeof e&&e.length>=2){var g=e.length;d=":"===e[g-1]?e.substring(0,g-1):e}i&&console.log("--- ".concat(d," - begin ---")),a&&(l=e?"".concat(f()," ").concat(e):"".concat(f())),e||a?console[n].apply(console,o([l],t,!1)):console[n].apply(console,t),"log"===n&&c(),"error"===n&&s(),i&&console.log("--- ".concat(d," - end ---"))}})),d},e.genHashCode=function(e){var n,t=0;for(n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return t},e.genRndNumString=d,e.genStyleString=function(e,n){var t="";return n&&n.length>0&&(t=n.join(";")+";"),"".concat(e,"{").concat(t,"}")},e.genUniqueNumString=l,e.generateRndNum=f,e.generateUniqueNum=function(e){return void 0===e&&(e=3),l(e)},e.getBrowserInfo=j,e.getCLS=function(){return t(this,void 0,void 0,(function(){return r(this,(function(e){return B("layout-shift")?[2,new Promise((function(e){var n=new PerformanceObserver((function(t){var r=t.getEntries().reduce((function(e,n){var t=0;return v(n.value)&&(t=n.value),e+t}),0);n.disconnect(),e(r)}));n.observe({type:"layout-shift",buffered:!0})}))]:[2,0]}))}))},e.getCookie=_,e.getCurrentVersion=function(){return"v4"},e.getDefineListeners=k,e.getDomain=function(e,n){void 0===n&&(n=["hostname"]);var t=document.createElement("a");return t.href=e,n.reduce((function(e,n){return e+=t[n]}),"")},e.getFCP=D,e.getFID=function(){return t(this,void 0,void 0,(function(){return r(this,(function(e){return B("first-input")?[2,new Promise((function(e){var n=new PerformanceObserver((function(t){var r=t.getEntries().find((function(e){return"first-input"===e.entryType}));if(r){n.disconnect();var o=r.processingStart;e(o?Math.round(r.processingStart-r.startTime):0)}}));n.observe({type:"first-input",buffered:!0})}))]:[2,0]}))}))},e.getFP=I,e.getFileSize=function(e){var n=function(e){return String(Math.ceil(e))};if(!e||e<0)return"";var t=1024;return e<t?e+" B":e<Math.pow(t,2)?n(e/t)+" KB":e<Math.pow(t,3)?n(e/Math.pow(t,2))+" MB":e<Math.pow(t,4)?n(e/Math.pow(t,3))+" G":n(e/Math.pow(t,4))+" T"},e.getFriendlyInterval=function(e,n,t){void 0===e&&(e=0),void 0===n&&(n=0),void 0===t&&(t=p);var r=(t=Object.assign(p,t)).type;v(e)||(e=new Date(e).getTime()),v(n)||(n=new Date(n).getTime());var o=Number(n)-Number(e),i="",a=new Array(4).fill(0),u=a[0],c=(a[1],a[2],a[3]),s=decodeURIComponent("%20%E5%A4%A9%20"),d=decodeURIComponent("%20%E6%97%B6%20"),f=decodeURIComponent("%20%E5%88%86%20"),l=decodeURIComponent("%20%E7%A7%92");if(o>=0)switch(u=Math.floor(o/1e3/60/60/24),Math.floor(o/1e3/60/60),Math.floor(o/1e3/60),c=Math.floor(o/1e3),r){case"d":i=u;break;case"text":i=(u=Math.floor(o/1e3/60/60/24))+s+Math.floor(o/1e3/60/60%24)+d+Math.floor(o/1e3/60%60)+f+(c=Math.floor(o/1e3%60))+l;break;default:i=c}return i},e.getHashQueryParam=function(e){var n=location.hash.split("?");if(1===n.length)return"";var t=new RegExp("(^|&)".concat(e,"=([^&]*)(&|$)")),r=n[1].match(t);return r?r[2]:""},e.getLCP=function(){return t(this,void 0,void 0,(function(){return r(this,(function(e){return B("largest-contentful-paint")?[2,new Promise((function(e){var n=new PerformanceObserver((function(t){var r=t.getEntries().find((function(e){return"largest-contentful-paint"===e.entryType}));r&&(n.disconnect(),e(Math.round(r.startTime)))}));n.observe({type:"largest-contentful-paint",buffered:!0})}))]:[2,0]}))}))},e.getLocalStorage=function(e){var n=null;if(e){var t=localStorage.getItem(e);t&&(n=JSON.parse(t))}return n},e.getPerformance=function(e){return void 0===e&&(e=!1),t(this,void 0,void 0,(function(){function n(){var n={source:z,os:t(),osVersion:o(),deviceType:i(),network:a(),screenDirection:u(),unloadTime:h-y,redirectTime:b-S,dnsTime:E-T,tcpTime:A-x,sslTime:s(A,C),responseTime:M-O,downloadTime:P-M,firstPaintTime:H,firstContentfulPaintTime:V,domReadyTime:k-q,onloadTime:N-q,whiteTime:M-q,renderTime:_-q,decodedBodySize:j,encodedBodySize:L};Object.keys(n).forEach((function(e){v(n[e])&&(n[e]<0?n[e]=0:n[e]=Math.round(n[e]))})),v(n.whiteTime)&&n.whiteTime>n.onloadTime&&(n.whiteTime=0);var r={};e||Object.keys(n).forEach((function(e){r[c(e)]=n[e]})),Object.keys(r).length?f(r):f(n)}function t(){return navigator.userAgent.indexOf("Android")>-1||navigator.userAgent.indexOf("Linux")>-1?"android":navigator.userAgent.indexOf("iPhone")>-1?"ios":navigator.userAgent.indexOf("Windows Phone")>-1?"wp":"others"}function o(){var e="",n=navigator.userAgent,t=n.indexOf("Android")>-1||n.indexOf("Linux")>-1,r=!!n.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),o=navigator.userAgent.split(";");if(o.length<2)return e;var i=o[1];return i?(t&&(e=(i.match(/\d+\.\d+/g)||[])[0]),r&&(e=(i.match(/(\d+)_(\d+)_?(\d+)?/)||[])[0]),e||(e=""),e):e}function i(){var e,n=navigator.userAgent.toLowerCase(),t=n.match(/(ipad)/i)&&"ipad",r=n.match(/iphone os/i)&&"iphone os",o=n.match(/midp/i)&&"midp",i=n.match(/rv:1.2.3.4/i)&&"rv:1.2.3.4",a=n.match(/ucweb/i)&&"ucweb",u=n.match(/android/i)&&"android",c=n.match(/windows ce/i)&&"windows ce",s=n.match(/windows mobile/i)&&"windows mobile";return(e=t||r||o||i||a||u||c||s?r||o||i||a||u||c||s?"phone":t?"ipad":void 0:"pc")||(e=""),e}function a(){var e="",n=window.navigator;if(n.connection&&n.connection.effectiveType)switch(n.connection.effectiveType){case"wifi":e="wifi";break;case"4g":e="4g";break;case"2g":e="2g";break;case"3g":e="3g";break;case"ethernet":e="ethernet";break;case"default":e=void 0}return e||(e=""),e}function u(){var e="";return window.screen&&window.screen.orientation&&window.screen.orientation.angle&&(180!==window.screen.orientation.angle&&0!==window.screen.orientation.angle||(e="|"),90!==window.screen.orientation.angle&&-90!==window.screen.orientation.angle||(e="-")),e}function s(e,n){var t=0;return n&&(t=e-n),t}var d,f,l,g,p,m,h,y,b,S,E,T,A,x,C,M,O,P,k,N,_,R,F,j,L,U,z,q,Z,H,V;return r(this,(function(e){switch(e.label){case 0:if(!B("navigation"))return[2,Promise.reject(new Error("navigation is not supported"))];if(!(d=window.performance)||"function"!=typeof d.getEntries||"function"!=typeof d.getEntriesByType)return[2,Promise.reject(new Error("performance is not supported"))];if(l=new Promise((function(e){f=[e][0]})),g=null,w(p=d.getEntriesByType("navigation"))&&(g=p[0]),m=new Array(19).fill(0),h=m[0],y=m[1],b=m[2],S=m[3],E=m[4],T=m[5],A=m[6],x=m[7],C=m[8],M=m[9],O=m[10],P=m[11],k=m[12],N=m[13],_=m[14],R=m[15],F=m[16],j=m[17],L=m[18],U=d.timing,z="",g)z="PerformanceNavigationTiming",j=g.decodedBodySize,L=g.encodedBodySize,h=g.unloadEventEnd,y=g.unloadEventStart,b=g.redirectEnd,S=g.redirectStart,E=g.domainLookupEnd,T=g.domainLookupStart,A=g.connectEnd,x=g.connectStart,C=g.secureConnectionStart,M=g.responseStart,O=g.requestStart,P=g.responseEnd,k=g.domContentLoadedEventStart,N=g.loadEventStart,_=g.loadEventEnd,R=g.startTime,F=g.fetchStart;else{if(!U)return[2,Promise.reject(new Error("NavigationTiming and Timing are not supported"))];z="PerformanceTiming",h=U.unloadEventEnd,y=U.unloadEventStart,b=U.redirectEnd,S=U.redirectStart,E=U.domainLookupEnd,T=U.domainLookupStart,A=U.connectEnd,x=U.connectStart,C=U.secureConnectionStart,M=U.responseStart,O=U.requestStart,P=U.responseEnd,k=U.domContentLoadedEventStart,N=U.loadEventStart,_=U.loadEventEnd,R=U.navigationStart,F=U.fetchStart}if(q=0,v(R))q=R;else{if(!v(F))return[2,Promise.reject(new Error("startTime, navigationStart or fetchStart are required"))];q=F}return[4,Promise.all([I(),D()])];case 1:return Z=e.sent(),H=Z[0],V=Z[1],v(_)&&_>0?n():window.addEventListener("load",(function(){window.setTimeout((function(){n()}),0)})),[2,l]}}))}))},e.getQueryParam=function(e){var n=new RegExp("(^|&)"+e+"=([^&]*)(&|$)"),t=location.search.substring(1).match(n);return null!==t?decodeURIComponent(t[2]):""},e.getScriptQueryParam=function(e,n){void 0===n&&(n=""),n||(n=".js");for(var t=new RegExp("[?&]".concat(e,"=([^&]*)")),r=document.querySelectorAll('script[src*="'.concat(n,'"]')),o=0;o<r.length;o++){var i=r[o].getAttribute("src");if(i&&-1!==i.indexOf(n)){var a=i.match(t);if(a)return decodeURIComponent(a[1])}}return""},e.getSessionStorage=function(e){var n=null;if(e){var t=sessionStorage.getItem(e);t&&(n=JSON.parse(t))}return n},e.getTTFB=function(){return t(this,void 0,void 0,(function(){var e,n;return r(this,(function(t){return B("navigation")&&window.performance&&window.performance.getEntriesByType?(e=performance.getEntriesByType("navigation")[0],0,e?(n=e.responseStart-e.requestStart,[2,Math.round(n)]):[2,0]):[2,0]}))}))},e.getUrlFileType=function(e){var n="";if("string"!=typeof e||""==e)return n;var t=/\.[^/?#]+$/.exec(e);return t?(t[0].length>1&&(n=t[0].substring(1)),n):n},e.getUrlParam=function(e,n,t){void 0===t&&(t={});var r=null;if(e.includes("#")){r=new URL(e).searchParams.getAll(n)}else{var o={};e.replace(/\??(\w+)=([^&]*)&?/g,(function(e,n,t){return void 0!==o[n]?o[n].push(t):o[n]=[t],""})),r=o[n]||[]}return t.returnArray?r:r.length?r[0]:null},e.hasClass=function(e,n){for(var t=e.className.split(/\s+/),r=0;r<t.length;r++)if(t[r]===n)return!0;return!1},e.inRate=function(e){return M(e)},e.invokeEvent=function(e){N(e)},e.invokeFn=m,e.isHit=M,e.isJSONString=s,e.isJsonString=function(e){return s(e)},e.isNonEmptyArray=w,e.isNumber=v,e.isSafePWAEnv=function(){var e=j();return!(!("serviceWorker"in navigator&&function(){var e;try{return e=new Function("return async function(){};")(),null!=Object.getPrototypeOf(e).constructor}catch(e){return!1}}()&&"undefined"!=typeof Promise&&-1!==Promise.toString().indexOf("[native code]")&&Boolean(window.fetch)&&Boolean(window.indexedDB)&&Boolean(window.caches))||e.shell)},e.isSupportWebp=function(){return new Promise((function(e){var n=new Image;n.onload=function(){e(n.width>0&&n.height>0)},n.onerror=function(){e(!1)},n.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAAAAAAfQ//73v/+BiOh/AAA="}))},e.isSupportedEntryType=B,e.isValidData=function(e,n,t){var r=!1;return"object"!=typeof e||n.reduce((function(e,n){return void 0===e[n]?Object.create(null):e=e[n]}),e)===t&&(r=!0),r},e.isValidEmail=function(e){return/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(e)},e.isValidHttpUrl=function(e,n){void 0===n&&(n={strict:!0});var t=/^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9\u4E00-\u9FA5()!@:%_+.~#?&//=]*)/;return n.strict||(t=/^(https?:)?\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9\u4E00-\u9FA5()!@:%_+.~#?&//=]*)/),t.test(e)},e.isValidPhoneNumber=function(e){return/^1\d{10}$/.test(e)},e.isValidUrl=function(e){return/^[a-zA-Z0-9]+:\/\/[-a-zA-Z0-9@:%._+~#=]{1,256}\b([-a-zA-Z0-9\u4E00-\u9FA5()!@:%_+.~#?&//=]*)$/.test(e)},e.loadCSS=function(e,n){void 0===n&&(n={id:""});var t,r=n.id,o=function(){},i=new Promise((function(e,n){var r;t=(r=[e,n])[0],o=r[1]})),a=function(){t("loaded")},u=document.createElement("link");u||o(new Error("Not support create link element"));var c="onload"in u,s=+navigator.userAgent.replace(/.*(?:AppleWebKit|AndroidWebKit)\/?(\d+).*/i,"$1")<536;if(u.rel="stylesheet",u.type="text/css",u.href=e,void 0!==r&&(u.id=r),document.getElementsByTagName("head")[0].appendChild(u),s||!c)return setTimeout((function(){f(u,a,0)}),1),i;function d(){u&&(u.onload=u.onerror=u.onreadystatechange=null),u=null,a()}function f(e,n,t){if(e){var r,o=e.sheet;if((t+=1)>3e5)return r=!0,e&&(e=null),void n();if(s)o&&(r=!0);else if(o)try{o.cssRules&&(r=!0)}catch(e){var i=e;if(!i.name)return;"NS_ERROR_DOM_SECURITY_ERR"===i.name&&(r=!0)}setTimeout((function(){r?n():f(e,n,t)}),20)}}return c?(u.onload=d,u.onerror=function(){d()}):u.onreadystatechange=function(){u&&/loaded|complete/.test(u.readyState)&&d()},i},e.loadImage=function(e){return new Promise((function(n,t){var r=new Image;r.onload=function(){n(r)},r.onerror=function(e){t(e)},r.src=e}))},e.loadScript=F,e.loadScriptIfUndefined=function(e,n){return window[e]?Promise.resolve("defined"):F(n)},e.longestComSubsequence=C,e.longestComSubstring=x,e.mNow=g,e.mTrim=function(e){for(var n=(e=e.replace(/^\s+/,"")).length-1,t=/\s/;t.test(e.charAt(n));)n--;return e.slice(0,n+1)},e.newLine=function(e){return y(e)},e.removeClass=function(e,n){var t;t=(t=(t=(t=" "+e.className+" ").replace(/(\s+)/gi," ")).replace(" "+n+" "," ")).replace(/(^\s+)|(\s+$)/g,""),e.className=t},e.removeCookie=R,e.removeEvent=function(e,n){var t=k(),r=t[e];if("string"==typeof e&&r instanceof Array)if("function"==typeof n){for(var o=0,i=r.length;o<i;o++)if(r[o]===n){t[e].splice(o,1);break}}else delete t[e]},e.removeHtml=b,e.repeatUntilConditionMet=function(e,n,o){var i=this;void 0===n&&(n={}),void 0===o&&(o=function(e){return!0===e});var a=n.interval,u=void 0===a?1e3:a,c=n.times,s=void 0===c?10:c,d=n.context,f=n.args,l=0;"function"!=typeof e&&console.error("Expected a function."),("number"!=typeof u||u<0)&&console.error("Expected a non-negative number for interval."),("number"!=typeof s||s<0)&&console.error("Expected a non-negative number for times."),function n(){setTimeout((function(){return t(i,void 0,void 0,(function(){var t;return r(this,(function(r){switch(r.label){case 0:return[4,e.apply(d,f)];case 1:return t=r.sent(),o(t)||++l>=s?[2]:(n(),[2])}}))}))}),u)}()},e.sanitizeInput=function(e){var n={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};if("string"!=typeof e)throw new Error("Input must be a string");return e.replace(/[&<>"'/]/g,(function(e){return n[e]}))},e.setClass=function(e,n){O(e,n)},e.setCookie=function(e,n,t,r){var o,i;if(t){var a=new Date;a.setTime(a.getTime()+24*t*60*60*1e3),i="; expires="+a.toUTCString()}else i="";var u=location.host;1===u.split(".").length?document.cookie=e+"="+n+i+"; path=/":((o=u.split(".")).shift(),r=r||"."+o.join("."),document.cookie=e+"="+n+i+"; path=/; domain="+r,null!==_(e)&&_(e)===n||(r=r||"."+u,document.cookie=e+"="+n+i+"; path=/; domain="+r))},e.setImgSizeBySrc=P,e.setImgWidHeiBySrc=function(){return P()},e.setLocalStorage=function(e,n){void 0===n&&(n=null),e&&localStorage.setItem(e,JSON.stringify(n))},e.setSessionStorage=function(e,n){void 0===n&&(n=null),e&&sessionStorage.setItem(e,JSON.stringify(n))},e.sleep=function(e){return t(this,void 0,void 0,(function(){return r(this,(function(n){return[2,A(e)]}))}))},e.throttle=function(e,n,t){void 0===t&&(t={}),t=Object.assign({},t);var r=null,o=null,i=null,a=[null,0],u=a[0],c=a[1],s=function(){c=!1===t.leading?0:g(),i=null,u=e.apply(this,o),i||(r=o=null)};return function(){for(var a=[],d=0;d<arguments.length;d++)a[d]=arguments[d];var f=g();c||!1!==t.leading||(c=f);var l=n-(f-c);return r=this,o=a,l<=0||l>n?(i&&(clearTimeout(i),i=null),c=f,u=e.apply(r,o),i||(r=o=null)):i||!1===t.trailing||(i=setTimeout(s.bind(r),l)),u}},e.truncateZHString=T,e.unsanitize=function(e){return S(e)},e.unsanitizeInput=S,e.updateQueryParam=function(e,n,t){if(e.includes("#")){var r=new URL(e);return r.searchParams.set(n,t),r.toString()}var o=new RegExp("([?&])"+n+"=.*?(&|$)","i"),i=-1!==e.indexOf("?")?"&":"?";return e.match(o)?e.replace(o,"$1"+n+"="+t+"$2"):e+i+n+"="+t},e.waitTime=A,e.windowLoaded=function(e){void 0===e&&(e=90);var n,t=function(){},r=new Promise((function(e,r){t=e,n=r}));return"complete"===document.readyState?t("complete"):window.addEventListener("load",(function(){return t("load")})),setTimeout((function(){return n(Error("timeout"))}),1e3*e),r},e.zAxiosIsValidRes=function(e,n){void 0===n&&(n={validStatusRange:[200,300],validCode:[0]});var t=Object.assign({validStatusRange:[200,300],validCode:[0]},n),r=t.validStatusRange,o=t.validCode;2!==r.length&&console.error("valid validStatusRange is required");var i=!1;if(e&&e.status&&2===r.length&&e.status>=r[0]&&e.status<r[1]){var a=e.data;a&&o.includes(a.code)&&(i=!0)}return i},e}({});
|