@revues/web-sdk-core 1.2.2-alpha.4 → 1.2.3
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/web-sdk-core.js +5 -5
- package/package.json +3 -4
package/dist/web-sdk-core.js
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
* (c) 2024-2024 Alex
|
4
4
|
* Released under the MIT License.
|
5
5
|
*/
|
6
|
-
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(require("events")):"function"==typeof define&&define.amd?define(["events"],n):n((e="undefined"!=typeof globalThis?globalThis:e||self).events)}(this,(function(e){"use strict";function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var t=n(e);document.head.innerHTML+="<style>.mask.svelte-1ekfzc9{position:fixed;left:0;right:0;bottom:0;top:0;z-index:3}\n.action-sheet.svelte-1t2ya5t{display:flex;flex-direction:column;position:absolute;width:100%;left:0;bottom:0;z-index:5;background-color:#f7f7f7;border-top-right-radius:6px;border-top-left-radius:6px;overflow:hidden}.header.svelte-1t2ya5t{display:flex;width:100%;height:45px;align-items:center;justify-content:center;background-color:#fff}.body.svelte-1t2ya5t{display:flex;flex-direction:column;flex:1;background-color:#fff}.footer.svelte-1t2ya5t{margin-top:10px}.title.svelte-1t2ya5t{font-weight:bold;font-size:16px}.button.svelte-1t2ya5t{display:flex;width:100%;height:50px;align-items:center;justify-content:center;background-color:#fff;font-size:16px;color:#000}.item.svelte-1t2ya5t{border-top:1px solid #ddd}.button-text.svelte-1t2ya5t{max-width:220px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}\n.launch-mask.svelte-1lcx350{position:absolute;left:50%;top:50%;transform:translate(-50%, -50%);-webkit-transform:translate(-50%, -50%);z-index:6;display:flex;flex-direction:column;align-items:center;justify-content:center}@keyframes svelte-1lcx350-rotate{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}#logo-canvas.svelte-1lcx350{animation:svelte-1lcx350-rotate 1s linear infinite;position:absolute;left:0;top:0}.logo.svelte-1lcx350{display:block;width:80px;height:80px;border-radius:100%;border:1px solid #eee}.logo-wrapper.svelte-1lcx350{width:100px;height:100px;position:relative;display:flex;align-items:center;justify-content:center}.title.svelte-1lcx350{display:flex;flex-direction:row;align-items:center;color:#333;font-size:14px;margin-top:10px;font-weight:bold;word-break:keep-all}.extName.svelte-1lcx350{margin-right:2px;max-width:200px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}\n.spinner.svelte-cis7d5{position:relative;width:30px;max-width:100%;height:30px;max-height:100%;vertical-align:middle;animation:infinite svelte-cis7d5-circle 800ms linear;animation-timing-function:steps(12)}.leaf.svelte-cis7d5{position:absolute;top:0;left:0;width:100%;height:100%;color:#fff}.leaf.svelte-cis7d5::after{display:block;width:2px;height:25%;margin:0 auto;background-color:currentColor;border-radius:40%;content:' '}@keyframes svelte-cis7d5-circle{from{transform:rotate(0)}to{transform:rotate(360deg)}}\n.toast.svelte-adfvqi{position:absolute;left:50%;top:50%;transform:translate(-50%, -50%);-webkit-transform:translate(-50%, -50%);z-index:5;display:flex;flex-direction:column;padding:10px 10px;background-color:rgba(0, 0, 0, 0.65);border-radius:6px;min-width:100px;overflow:hidden;align-items:center;justify-items:center}.icon.svelte-adfvqi{width:50px;height:50px;margin-bottom:6px}.title.svelte-adfvqi{color:#fff;font-size:14px}.hasIcon.svelte-adfvqi{max-width:80px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.spinner-wrapper.svelte-adfvqi{padding:10px 0;padding-bottom:4px;margin-bottom:6px}\n.input.svelte-1fikcsw{display:flex;flex:1;background-color:#fff;outline:none;border:none;font-size:16px;color:#000}\n.modal.svelte-lduamy{position:absolute;left:50%;top:50%;transform:translate(-50%, -50%);-webkit-transform:translate(-50%, -50%);z-index:5;display:flex;flex-direction:column;background-color:#fff;border-radius:6px;overflow:hidden;width:300px;min-height:180px;border:1px solid #eee;color:#000}.header.svelte-lduamy{display:flex;flex-direction:column;align-items:center;padding-top:25px}.title.svelte-lduamy{font-weight:bold;font-size:16px}.body.svelte-lduamy{display:flex;flex-direction:row;padding:10px 24px 24px 24px;flex:1}.input-wrapper.svelte-lduamy{display:flex;flex:1;border:1px solid #ccc;padding:5px 10px;height:100px;border-radius:4px}.body-text.svelte-lduamy{display:flex;flex:1;flex-wrap:wrap;align-items:center;justify-content:center;word-break:break-all;font-size:16px;line-height:20px}.footer.svelte-lduamy{display:flex;flex-direction:row;align-items:center;border-top:1px solid #eee}.button.svelte-lduamy{display:flex;flex:1;align-items:center;justify-content:center;height:46px;position:relative;font-size:16px}.cancel.svelte-lduamy::after{display:block;height:46px;width:1px;background-color:#eee;position:absolute;top:0;right:0;content:' '}\n.btn-back.svelte-o95f8l{cursor:pointer;width:24px;height:24px;display:flex;justify-content:center;align-items:center;border-radius:50%;pointer-events:auto}\n.nav.svelte-1ouzypl{position:relative;width:100%;height:42px;display:flex;align-items:center;justify-content:center;padding:4px;box-sizing:border-box;z-index:5;pointer-events:none;transition:all}.nav-title.svelte-1ouzypl{font-weight:700;text-align:center;font-size:14px;color:#030d1e;width:60%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.nav-action-btns.svelte-1ouzypl{position:absolute;display:flex;left:8px;justify-content:flex-start;align-items:center}\n.nav-bar-tools.svelte-10fi14j{box-sizing:border-box;pointer-events:auto;position:absolute;z-index:10;right:10px;top:6px;background-color:rgba(255, 255, 255, 0.6);border:1px solid rgba(0, 0, 0, 0.15);border-radius:3px;display:flex;flex-direction:row;width:85px;height:30px;border-radius:30px;overflow:hidden;user-select:none}.line.svelte-10fi14j{display:block;width:1px;height:18px;position:absolute;right:0px;top:5px}.tools-item.svelte-10fi14j{display:flex;flex:1;align-items:center;justify-content:center;position:relative}\n.status-bar-holder.svelte-1tsnloh{width:100%}\n.badge.svelte-18y9mkk{position:absolute;left:18px;top:-3px;display:flex;align-items:center;justify-content:center;box-sizing:content-box;border-radius:12px;background-color:red;padding:2px 2px;min-width:14px;height:14px}.badge-text.svelte-18y9mkk{color:#fff;font-size:12px;max-width:28px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.red-dot.svelte-18y9mkk{height:8px;width:8px;border-radius:100%;background-color:red;position:absolute;left:22px;top:1px}.tab-item.svelte-18y9mkk{padding-top:4px;display:flex;flex-direction:column;align-items:center;justify-items:center;flex:1;cursor:pointer;position:relative}.icon.svelte-18y9mkk{width:28px;height:28px;position:relative}.img.svelte-18y9mkk{width:100%;height:100%;display:block;background-size:100%;background-repeat:no-repeat}.tab-text.svelte-18y9mkk{font-size:10px;text-align:center}\n.tab-list.svelte-h0c4dd{width:100%;height:49px;display:flex;flex-flow:row nowrap;justify-content:space-around;border-top:1px solid transparent;z-index:5;user-select:none}\n.keyboard.svelte-1tawb6{position:absolute;left:0;bottom:0;z-index:5;width:100%;height:300px;background-color:#ccc}.keyboard-header.svelte-1tawb6{background-color:#eee;display:flex;width:100%;height:50px;flex-direction:row;padding:6px 30px;padding-right:10px}.button-confirm.svelte-1tawb6{margin-left:10px;margin-top:4px;display:flex;justify-content:center;align-items:center;border-radius:6px;background-color:#ff9600;height:30px;padding:4px 6px}.button-confirm-text.svelte-1tawb6{color:#fff;font-size:12px}\n</style>",function(){function e(e,t,o){return t=d(t),function(e,n){if(n&&("object"==typeof n||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");return p(e)}(e,n()?Reflect.construct(t,o||[],d(e).constructor):t.apply(e,o))}function n(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(n=function(){return!!e})()}function t(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function o(e){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?t(Object(o),!0).forEach((function(n){s(e,n,o[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):t(Object(o)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(o,n))}))}return e}function r(e){var n=function(e,n){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var o=t.call(e,"string");if("object"!=typeof o)return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof n?n:String(n)}function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function a(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function c(e,n){for(var t=0;t<n.length;t++){var o=n[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,r(o.key),o)}}function u(e,n,t){return n&&c(e.prototype,n),t&&c(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function s(e,n,t){return(n=r(n))in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function l(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(n&&n.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),n&&f(e,n)}function d(e){return d=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},d(e)}function f(e,n){return f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,n){return e.__proto__=n,e},f(e,n)}function p(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function v(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var o,r,i,a,c=[],u=!0,s=!1;try{if(i=(t=t.call(e)).next,0===n){if(Object(t)!==t)return;u=!1}else for(;!(u=(o=i.call(t)).done)&&(c.push(o.value),c.length!==n);u=!0);}catch(e){s=!0,r=e}finally{try{if(!u&&null!=t.return&&(a=t.return(),Object(a)!==a))return}finally{if(s)throw r}}return c}}(e,n)||h(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function h(e,n){if(e){if("string"==typeof e)return g(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?g(e,n):void 0}}function g(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,o=new Array(n);t<n;t++)o[t]=e[t];return o}function m(){}var w,y=function(e){return e};function b(e){return e()}function _(){return Object.create(null)}function x(e){e.forEach(b)}function A(e){return"function"==typeof e}function k(e,n){return e!=e?n==n:e!==n||e&&"object"===i(e)||"function"==typeof e}function S(e,n){return w||(w=document.createElement("a")),w.href=n,e===w.href}function I(e){return null==e?"":e}var C="undefined"!=typeof window,T=C?function(){return window.performance.now()}:function(){return Date.now()},M=C?function(e){return requestAnimationFrame(e)}:m,P=new Set;function E(e){P.forEach((function(n){n.c(e)||(P.delete(n),n.f())})),0!==P.size&&M(E)}function B(e,n){e.appendChild(n)}function O(e){if(!e)return document;var n=e.getRootNode?e.getRootNode():e.ownerDocument;return n&&n.host?n:e.ownerDocument}function L(e){var n=D("style");return function(e,n){B(e.head||e,n),n.sheet}(O(e),n),n.sheet}function F(e,n,t){e.insertBefore(n,t||null)}function R(e){e.parentNode&&e.parentNode.removeChild(e)}function H(e,n){for(var t=0;t<e.length;t+=1)e[t]&&e[t].d(n)}function D(e){return document.createElement(e)}function j(e){return document.createElementNS("http://www.w3.org/2000/svg",e)}function N(e){return document.createTextNode(e)}function G(){return N(" ")}function W(){return N("")}function $(e,n,t,o){return e.addEventListener(n,t,o),function(){return e.removeEventListener(n,t,o)}}function V(e,n,t){null==t?e.removeAttribute(n):e.getAttribute(n)!==t&&e.setAttribute(n,t)}function z(e,n){n=""+n,e.wholeText!==n&&(e.data=n)}function q(e,n){e.value=null==n?"":n}function K(e,n,t,o){null===t?e.style.removeProperty(n):e.style.setProperty(n,t,o?"important":"")}var U,Q=new Map,J=0;function Z(e,n,t,o,r,i,a){for(var c=arguments.length>7&&void 0!==arguments[7]?arguments[7]:0,u=16.666/o,s="{\n",l=0;l<=1;l+=u){var d=n+(t-n)*i(l);s+=100*l+"%{".concat(a(d,1-d),"}\n")}var f=s+"100% {".concat(a(t,1-t),"}\n}"),p="__svelte_".concat(function(e){for(var n=5381,t=e.length;t--;)n=(n<<5)-n^e.charCodeAt(t);return n>>>0}(f),"_").concat(c),v=O(e),h=Q.get(v)||function(e,n){var t={stylesheet:L(n),rules:{}};return Q.set(e,t),t}(v,e),g=h.stylesheet,m=h.rules;m[p]||(m[p]=!0,g.insertRule("@keyframes ".concat(p," ").concat(f),g.cssRules.length));var w=e.style.animation||"";return e.style.animation="".concat(w?"".concat(w,", "):"").concat(p," ").concat(o,"ms linear ").concat(r,"ms 1 both"),J+=1,p}function X(e){U=e}var Y=[],ee=[],ne=[],te=[],oe=Promise.resolve(),re=!1;function ie(e){ne.push(e)}var ae,ce=new Set,ue=0;function se(){var e=U;do{for(;ue<Y.length;){var n=Y[ue];ue++,X(n),le(n.$$)}for(X(null),Y.length=0,ue=0;ee.length;)ee.pop()();for(var t=0;t<ne.length;t+=1){var o=ne[t];ce.has(o)||(ce.add(o),o())}ne.length=0}while(Y.length);for(;te.length;)te.pop()();re=!1,ce.clear(),X(e)}function le(e){if(null!==e.fragment){e.update(),x(e.before_update);var n=e.dirty;e.dirty=[-1],e.fragment&&e.fragment.p(e.ctx,n),e.after_update.forEach(ie)}}function de(e,n,t){e.dispatchEvent(function(e,n){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=t.bubbles,r=void 0!==o&&o,i=t.cancelable,a=void 0!==i&&i,c=document.createEvent("CustomEvent");return c.initCustomEvent(e,r,a,n),c}("".concat(n?"intro":"outro").concat(t)))}var fe,pe=new Set;function ve(){fe={r:0,c:[],p:fe}}function he(){fe.r||x(fe.c),fe=fe.p}function ge(e,n){e&&e.i&&(pe.delete(e),e.i(n))}function me(e,n,t,o){if(e&&e.o){if(pe.has(e))return;pe.add(e),fe.c.push((function(){pe.delete(e),o&&(t&&e.d(1),o())})),e.o(n)}else o&&o()}var we={duration:0};function ye(e,n,t,o){var r={direction:"both"},i=n(e,t,r),a=o?0:1,c=null,u=null,s=null;function l(){s&&function(e,n){var t=(e.style.animation||"").split(", "),o=t.filter(n?function(e){return e.indexOf(n)<0}:function(e){return-1===e.indexOf("__svelte")}),r=t.length-o.length;r&&(e.style.animation=o.join(", "),(J-=r)||M((function(){J||(Q.forEach((function(e){var n=e.stylesheet.ownerNode;n&&R(n)})),Q.clear())})))}(e,s)}function d(e,n){var t=e.b-a;return n*=Math.abs(t),{a:a,b:e.b,d:t,duration:n,start:e.start,end:e.start+n,group:e.group}}function f(n){var t,o=i||we,r=o.delay,f=void 0===r?0:r,p=o.duration,v=void 0===p?300:p,h=o.easing,g=void 0===h?y:h,w=o.tick,b=void 0===w?m:w,_=o.css,A={start:T()+f,b:n};n||(A.group=fe,fe.r+=1),c||u?u=A:(_&&(l(),s=Z(e,a,n,v,f,g,_)),n&&b(0,1),c=d(A,v),ie((function(){return de(e,n,"start")})),t=function(n){if(u&&n>u.start&&(c=d(u,v),u=null,de(e,c.b,"start"),_&&(l(),s=Z(e,a,c.b,c.duration,0,g,i.css))),c)if(n>=c.end)b(a=c.b,1-a),de(e,c.b,"end"),u||(c.b?l():--c.group.r||x(c.group.c)),c=null;else if(n>=c.start){var t=n-c.start;a=c.a+c.d*g(t/c.duration),b(a,1-a)}return!(!c&&!u)},0===P.size&&M(E),new Promise((function(e){P.add({c:t,f:e})})))}return{run:function(e){A(i)?(ae||(ae=Promise.resolve()).then((function(){ae=null})),ae).then((function(){i=i(r),f(e)})):f(e)},end:function(){l(),c=u=null}}}function be(e){e&&e.c()}function _e(e,n,t,o){var r=e.$$,i=r.fragment,a=r.after_update;i&&i.m(n,t),o||ie((function(){var n,t=e.$$.on_mount.map(b).filter(A);e.$$.on_destroy?(n=e.$$.on_destroy).push.apply(n,function(e){return function(e){if(Array.isArray(e))return g(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||h(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(t)):x(t),e.$$.on_mount=[]})),a.forEach(ie)}function xe(e,n){var t=e.$$;null!==t.fragment&&(x(t.on_destroy),t.fragment&&t.fragment.d(n),t.on_destroy=t.fragment=null,t.ctx=[])}function Ae(e,n,t,o,r,i,a){var c=arguments.length>7&&void 0!==arguments[7]?arguments[7]:[-1],u=U;X(e);var s=e.$$={fragment:null,ctx:[],props:i,update:m,not_equal:r,bound:_(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(n.context||(u?u.$$.context:[])),callbacks:_(),dirty:c,skip_bound:!1,root:n.target||u.$$.root};a&&a(s.root);var l=!1;if(s.ctx=t?t(e,n.props||{},(function(n,t){var o=!(arguments.length<=2)&&arguments.length-2?arguments.length<=2?void 0:arguments[2]:t;return s.ctx&&r(s.ctx[n],s.ctx[n]=o)&&(!s.skip_bound&&s.bound[n]&&s.bound[n](o),l&&function(e,n){-1===e.$$.dirty[0]&&(Y.push(e),re||(re=!0,oe.then(se)),e.$$.dirty.fill(0)),e.$$.dirty[n/31|0]|=1<<n%31}(e,n)),t})):[],s.update(),l=!0,x(s.before_update),s.fragment=!!o&&o(s.ctx),n.target){if(n.hydrate){var d=function(e){return Array.from(e.childNodes)}(n.target);s.fragment&&s.fragment.l(d),d.forEach(R)}else s.fragment&&s.fragment.c();n.intro&&ge(e.$$.fragment),_e(e,n.target,n.anchor,n.customElement),se()}X(u)}var ke=function(){function e(){a(this,e)}return u(e,[{key:"$destroy",value:function(){xe(this,1),this.$destroy=m}},{key:"$on",value:function(e,n){if(!A(n))return m;var t=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return t.push(n),function(){var e=t.indexOf(n);-1!==e&&t.splice(e,1)}}},{key:"$set",value:function(e){var n;this.$$set&&(n=e,0!==Object.keys(n).length)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}]),e}();function Se(e){var n=e-1;return n*n*n+1}function Ie(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=n.delay,o=void 0===t?0:t,r=n.duration,i=void 0===r?400:r,a=n.easing,c=void 0===a?y:a,u=+getComputedStyle(e).opacity;return{delay:o,duration:i,easing:c,css:function(e){return"opacity: ".concat(e*u)}}}function Ce(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=n.delay,o=void 0===t?0:t,r=n.duration,i=void 0===r?400:r,a=n.easing,c=void 0===a?Se:a,u=getComputedStyle(e),s=+u.opacity,l=parseFloat(u.height),d=parseFloat(u.paddingTop),f=parseFloat(u.paddingBottom),p=parseFloat(u.marginTop),v=parseFloat(u.marginBottom),h=parseFloat(u.borderTopWidth),g=parseFloat(u.borderBottomWidth);return{delay:o,duration:i,easing:c,css:function(e){return"overflow: hidden;"+"opacity: ".concat(Math.min(20*e,1)*s,";")+"height: ".concat(e*l,"px;")+"padding-top: ".concat(e*d,"px;")+"padding-bottom: ".concat(e*f,"px;")+"margin-top: ".concat(e*p,"px;")+"margin-bottom: ".concat(e*v,"px;")+"border-top-width: ".concat(e*h,"px;")+"border-bottom-width: ".concat(e*g,"px;")}}}function Te(e){var n,t,o;return{c:function(){V(n=D("div"),"class","mask svelte-1ekfzc9"),K(n,"background-color",e[0]),K(n,"z-index",e[1])},m:function(r,i){F(r,n,i),t||(o=$(n,"click",e[3]),t=!0)},p:function(e,t){var o=v(t,1)[0];1&o&&K(n,"background-color",e[0]),2&o&&K(n,"z-index",e[1])},i:m,o:m,d:function(e){e&&R(n),t=!1,o()}}}function Me(e,n,t){var o=n.bgColor,r=void 0===o?"transparent":o,i=n.zIndex,a=void 0===i?3:i,c=n.onClick;return e.$$set=function(e){"bgColor"in e&&t(0,r=e.bgColor),"zIndex"in e&&t(1,a=e.zIndex),"onClick"in e&&t(2,c=e.onClick)},[r,a,c,function(){c&&c()}]}var Pe=function(n){function t(n){var o;return a(this,t),Ae(p(o=e(this,t)),n,Me,Te,k,{bgColor:0,zIndex:1,onClick:2}),o}return l(t,n),u(t)}(ke);function Ee(e,n,t){var o=e.slice();return o[8]=n[t],o[10]=t,o}function Be(e){var n,t,o,r,i,a,c,u,s,l,d,f;n=new Pe({props:{bgColor:"rgba(0, 0, 0, .1)"}});for(var p=""!=e[0]&&Oe(e),v=e[1],h=[],g=0;g<v.length;g+=1)h[g]=Le(Ee(e,v,g));return{c:function(){be(n.$$.fragment),t=G(),o=D("div"),p&&p.c(),r=G(),i=D("div");for(var e=0;e<h.length;e+=1)h[e].c();a=G(),c=D("div"),(u=D("div")).textContent="取消",V(i,"class","body svelte-1t2ya5t"),V(u,"class","button svelte-1t2ya5t"),V(c,"class","footer svelte-1t2ya5t"),V(o,"class","action-sheet svelte-1t2ya5t")},m:function(s,v){_e(n,s,v),F(s,t,v),F(s,o,v),p&&p.m(o,null),B(o,r),B(o,i);for(var g=0;g<h.length;g+=1)h[g].m(i,null);B(o,a),B(o,c),B(c,u),l=!0,d||(f=$(u,"click",e[7]),d=!0)},p:function(e,n){if(""!=e[0]?p?p.p(e,n):((p=Oe(e)).c(),p.m(o,r)):p&&(p.d(1),p=null),22&n){var t;for(v=e[1],t=0;t<v.length;t+=1){var a=Ee(e,v,t);h[t]?h[t].p(a,n):(h[t]=Le(a),h[t].c(),h[t].m(i,null))}for(;t<h.length;t+=1)h[t].d(1);h.length=v.length}},i:function(e){l||(ge(n.$$.fragment,e),ie((function(){s||(s=ye(o,Ce,{duration:300},!0)),s.run(1)})),l=!0)},o:function(e){me(n.$$.fragment,e),s||(s=ye(o,Ce,{duration:300},!1)),s.run(0),l=!1},d:function(e){xe(n,e),e&&R(t),e&&R(o),p&&p.d(),H(h,e),e&&s&&s.end(),d=!1,f()}}}function Oe(e){var n,t,o;return{c:function(){n=D("div"),t=D("span"),o=N(e[0]),V(t,"class","title svelte-1t2ya5t"),V(n,"class","header svelte-1t2ya5t")},m:function(e,r){F(e,n,r),B(n,t),B(t,o)},p:function(e,n){1&n&&z(o,e[0])},d:function(e){e&&R(n)}}}function Le(e){var n,t,o,r,i,a,c=e[8]+"";function u(){return e[6](e[10])}return{c:function(){n=D("div"),t=D("span"),o=N(c),r=G(),V(t,"class","button-text svelte-1t2ya5t"),V(n,"class","button item svelte-1t2ya5t"),K(n,"color",e[2])},m:function(e,c){F(e,n,c),B(n,t),B(t,o),B(n,r),i||(a=$(n,"click",u),i=!0)},p:function(t,r){e=t,2&r&&c!==(c=e[8]+"")&&z(o,c),4&r&&K(n,"color",e[2])},d:function(e){e&&R(n),i=!1,a()}}}function Fe(e){var n,t,o=e[3]&&Be(e);return{c:function(){o&&o.c(),n=W()},m:function(e,r){o&&o.m(e,r),F(e,n,r),t=!0},p:function(e,t){var r=v(t,1)[0];e[3]?o?(o.p(e,r),8&r&&ge(o,1)):((o=Be(e)).c(),ge(o,1),o.m(n.parentNode,n)):o&&(ve(),me(o,1,1,(function(){o=null})),he())},i:function(e){t||(ge(o),t=!0)},o:function(e){me(o),t=!1},d:function(e){o&&o.d(e),e&&R(n)}}}function Re(e,n,t){var o=n.alertText,r=void 0===o?"":o,i=n.itemList,a=void 0===i?[]:i,c=n.itemColor,u=void 0===c?"#000":c,s=n.show,l=void 0!==s&&s,d=n.onSelect,f=n.onCancel;return e.$$set=function(e){"alertText"in e&&t(0,r=e.alertText),"itemList"in e&&t(1,a=e.itemList),"itemColor"in e&&t(2,u=e.itemColor),"show"in e&&t(3,l=e.show),"onSelect"in e&&t(4,d=e.onSelect),"onCancel"in e&&t(5,f=e.onCancel)},[r,a,u,l,d,f,function(e){d&&d(e)},function(){f&&f()}]}var He=function(n){function t(n){var o;return a(this,t),Ae(p(o=e(this,t)),n,Re,Fe,k,{alertText:0,itemList:1,itemColor:2,show:3,onSelect:4,onCancel:5}),o}return l(t,n),u(t)}(ke);function De(e){var n,t,o,r,i,a,c,u,s,l,d,f,p,v,h=(e[1].extName||Ge)+"";return n=new Pe({props:{bgColor:"#fff",zIndex:6}}),{c:function(){be(n.$$.fragment),t=G(),o=D("div"),r=D("div"),i=D("canvas"),a=G(),c=D("img"),s=G(),l=D("div"),d=D("span"),f=N(h),(p=D("span")).textContent="启动中",V(i,"id","logo-canvas"),V(i,"width","100px"),V(i,"height","100px"),V(i,"class","svelte-1lcx350"),V(c,"class","logo svelte-1lcx350"),S(c.src,u=e[1].extLogo||Ne)||V(c,"src",u),V(c,"alt","logo"),V(r,"class","logo-wrapper svelte-1lcx350"),V(d,"class","extName svelte-1lcx350"),V(l,"class","title svelte-1lcx350"),V(o,"class","launch-mask svelte-1lcx350")},m:function(e,u){_e(n,e,u),F(e,t,u),F(e,o,u),B(o,r),B(r,i),B(r,a),B(r,c),B(o,s),B(o,l),B(l,d),B(d,f),B(l,p),v=!0},p:function(e,n){(!v||2&n&&!S(c.src,u=e[1].extLogo||Ne))&&V(c,"src",u),(!v||2&n)&&h!==(h=(e[1].extName||Ge)+"")&&z(f,h)},i:function(e){v||(ge(n.$$.fragment,e),v=!0)},o:function(e){me(n.$$.fragment,e),v=!1},d:function(e){xe(n,e),e&&R(t),e&&R(o)}}}function je(e){var n,t,o=e[0]&&De(e);return{c:function(){o&&o.c(),n=W()},m:function(e,r){o&&o.m(e,r),F(e,n,r),t=!0},p:function(e,t){var r=v(t,1)[0];e[0]?o?(o.p(e,r),1&r&&ge(o,1)):((o=De(e)).c(),ge(o,1),o.m(n.parentNode,n)):o&&(ve(),me(o,1,1,(function(){o=null})),he())},i:function(e){t||(ge(o),t=!0)},o:function(e){me(o),t=!1},d:function(e){o&&o.d(e),e&&R(n)}}}var Ne="https://ext.huya.com/img/ext_default-3251aafa.png",Ge="小程序";function We(e,n,t){var o=n.show,r=void 0===o||o,i=n.extInfo,a=void 0===i?{extName:Ge,extLogo:Ne}:i;return function(e){(function(){if(!U)throw new Error("Function called outside component initialization");return U})().$$.on_mount.push(e)}((function(){var e=document.getElementById("logo-canvas").getContext("2d");e.beginPath(),e.arc(50,50,45,0,1.25*Math.PI),e.strokeStyle="#00FF00",e.stroke()})),e.$$set=function(e){"show"in e&&t(0,r=e.show),"extInfo"in e&&t(1,a=e.extInfo)},[r,a]}var $e=function(n){function t(n){var o;return a(this,t),Ae(p(o=e(this,t)),n,We,je,k,{show:0,extInfo:1}),o}return l(t,n),u(t)}(ke);function Ve(e,n,t){var o=e.slice();return o[3]=n[t],o}function ze(e){var n;return{c:function(){V(n=D("div"),"class","leaf svelte-cis7d5"),K(n,"color",e[0]),K(n,"opacity",1-e[3]/16),K(n,"transform","rotate(".concat(30*(e[3]+1),"deg)"))},m:function(e,t){F(e,n,t)},p:function(e,t){1&t&&K(n,"color",e[0])},d:function(e){e&&R(n)}}}function qe(e){for(var n,t=e[2],o=[],r=0;r<t.length;r+=1)o[r]=ze(Ve(e,t,r));return{c:function(){n=D("div");for(var t=0;t<o.length;t+=1)o[t].c();V(n,"class","spinner svelte-cis7d5"),K(n,"width",e[1]+"px"),K(n,"height",e[1]+"px")},m:function(e,t){F(e,n,t);for(var r=0;r<o.length;r+=1)o[r].m(n,null)},p:function(e,r){var i=v(r,1)[0];if(5&i){var a;for(t=e[2],a=0;a<t.length;a+=1){var c=Ve(e,t,a);o[a]?o[a].p(c,i):(o[a]=ze(c),o[a].c(),o[a].m(n,null))}for(;a<o.length;a+=1)o[a].d(1);o.length=t.length}2&i&&K(n,"width",e[1]+"px"),2&i&&K(n,"height",e[1]+"px")},i:m,o:m,d:function(e){e&&R(n),H(o,e)}}}function Ke(e,n,t){var o=new Array(12).fill(Math.random()).map((function(e,n){return n})),r=n.color,i=void 0===r?"#fff":r,a=n.size,c=void 0===a?30:a;return e.$$set=function(e){"color"in e&&t(0,i=e.color),"size"in e&&t(1,c=e.size)},[i,c,o]}var Ue=function(n){function t(n){var o;return a(this,t),Ae(p(o=e(this,t)),n,Ke,qe,k,{color:0,size:1}),o}return l(t,n),u(t)}(ke),Qe={success:"data:image/png;base64,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",loading:"",error:"data:image/png;base64,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"};function Je(e){var n,t,o,r,i,a,c,u=e[2]&&Ze(),s=[en,Ye,Xe],l=[];function d(e,n){return null!=e[1]?0:"loading"===e[0]?1:null!=Qe[e[0]]?2:-1}~(o=d(e))&&(r=l[o]=s[o](e));var f=""!=e[3]&&nn(e);return{c:function(){u&&u.c(),n=G(),t=D("div"),r&&r.c(),i=G(),f&&f.c(),V(t,"class","toast svelte-adfvqi")},m:function(e,r){u&&u.m(e,r),F(e,n,r),F(e,t,r),~o&&l[o].m(t,null),B(t,i),f&&f.m(t,null),c=!0},p:function(e,a){e[2]?u?4&a&&ge(u,1):((u=Ze()).c(),ge(u,1),u.m(n.parentNode,n)):u&&(ve(),me(u,1,1,(function(){u=null})),he());var c=o;(o=d(e))===c?~o&&l[o].p(e,a):(r&&(ve(),me(l[c],1,1,(function(){l[c]=null})),he()),~o?((r=l[o])?r.p(e,a):(r=l[o]=s[o](e)).c(),ge(r,1),r.m(t,i)):r=null),""!=e[3]?f?f.p(e,a):((f=nn(e)).c(),f.m(t,null)):f&&(f.d(1),f=null)},i:function(e){c||(ge(u),ge(r),ie((function(){a||(a=ye(t,Ie,{duration:100},!0)),a.run(1)})),c=!0)},o:function(e){me(u),me(r),a||(a=ye(t,Ie,{duration:100},!1)),a.run(0),c=!1},d:function(e){u&&u.d(e),e&&R(n),e&&R(t),~o&&l[o].d(),f&&f.d(),e&&a&&a.end()}}}function Ze(e){var n,t;return n=new Pe({props:{bgColor:"rgba(0, 0, 0, .1)"}}),{c:function(){be(n.$$.fragment)},m:function(e,o){_e(n,e,o),t=!0},i:function(e){t||(ge(n.$$.fragment,e),t=!0)},o:function(e){me(n.$$.fragment,e),t=!1},d:function(e){xe(n,e)}}}function Xe(e){var n,t;return{c:function(){V(n=D("img"),"class","icon svelte-adfvqi"),V(n,"alt","img"),S(n.src,t=Qe[e[0]])||V(n,"src",t)},m:function(e,t){F(e,n,t)},p:function(e,o){1&o&&!S(n.src,t=Qe[e[0]])&&V(n,"src",t)},i:m,o:m,d:function(e){e&&R(n)}}}function Ye(e){var n,t,o;return t=new Ue({}),{c:function(){n=D("div"),be(t.$$.fragment),V(n,"class","spinner-wrapper svelte-adfvqi")},m:function(e,r){F(e,n,r),_e(t,n,null),o=!0},p:m,i:function(e){o||(ge(t.$$.fragment,e),o=!0)},o:function(e){me(t.$$.fragment,e),o=!1},d:function(e){e&&R(n),xe(t)}}}function en(e){var n,t;return{c:function(){V(n=D("img"),"class","icon svelte-adfvqi"),V(n,"alt","img"),S(n.src,t=e[1])||V(n,"src",t)},m:function(e,t){F(e,n,t)},p:function(e,o){2&o&&!S(n.src,t=e[1])&&V(n,"src",t)},i:m,o:m,d:function(e){e&&R(n)}}}function nn(e){var n,t,o;return{c:function(){n=D("span"),t=N(e[3]),V(n,"class",o=I("title ".concat(e[1]||Qe[e[0]]?"hasIcon":""))+" svelte-adfvqi")},m:function(e,o){F(e,n,o),B(n,t)},p:function(e,r){8&r&&z(t,e[3]),3&r&&o!==(o=I("title ".concat(e[1]||Qe[e[0]]?"hasIcon":""))+" svelte-adfvqi")&&V(n,"class",o)},d:function(e){e&&R(n)}}}function tn(e){var n,t,o=e[4]&&Je(e);return{c:function(){o&&o.c(),n=W()},m:function(e,r){o&&o.m(e,r),F(e,n,r),t=!0},p:function(e,t){var r=v(t,1)[0];e[4]?o?(o.p(e,r),16&r&&ge(o,1)):((o=Je(e)).c(),ge(o,1),o.m(n.parentNode,n)):o&&(ve(),me(o,1,1,(function(){o=null})),he())},i:function(e){t||(ge(o),t=!0)},o:function(e){me(o),t=!1},d:function(e){o&&o.d(e),e&&R(n)}}}function on(e,n,t){var o=n.icon,r=void 0===o?"none":o,i=n.image,a=n.mask,c=void 0!==a&&a,u=n.title,s=void 0===u?"":u,l=n.show,d=void 0!==l&&l;return e.$$set=function(e){"icon"in e&&t(0,r=e.icon),"image"in e&&t(1,i=e.image),"mask"in e&&t(2,c=e.mask),"title"in e&&t(3,s=e.title),"show"in e&&t(4,d=e.show)},[r,i,c,s,d]}var rn=function(n){function t(n){var o;return a(this,t),Ae(p(o=e(this,t)),n,on,tn,k,{icon:0,image:1,mask:2,title:3,show:4}),o}return l(t,n),u(t)}(ke);function an(e){var n,t;return n=new rn({props:{show:e[2],mask:e[1],title:e[0],icon:"loading"}}),{c:function(){be(n.$$.fragment)},m:function(e,o){_e(n,e,o),t=!0},p:function(e,t){var o=v(t,1)[0],r={};4&o&&(r.show=e[2]),2&o&&(r.mask=e[1]),1&o&&(r.title=e[0]),n.$set(r)},i:function(e){t||(ge(n.$$.fragment,e),t=!0)},o:function(e){me(n.$$.fragment,e),t=!1},d:function(e){xe(n,e)}}}function cn(e,n,t){var o=n.title,r=void 0===o?"":o,i=n.mask,a=void 0!==i&&i,c=n.show,u=void 0!==c&&c;return e.$$set=function(e){"title"in e&&t(0,r=e.title),"mask"in e&&t(1,a=e.mask),"show"in e&&t(2,u=e.show)},[r,a,u]}var un=function(n){function t(n){var o;return a(this,t),Ae(p(o=e(this,t)),n,cn,an,k,{title:0,mask:1,show:2}),o}return l(t,n),u(t)}(ke);function sn(e){var n,t,o;return{c:function(){V(n=D("input"),"class","input svelte-1fikcsw"),V(n,"maxlength",e[3]),V(n,"placeholder",e[1])},m:function(r,i){F(r,n,i),q(n,e[0]),t||(o=[$(n,"input",e[7]),$(n,"input",e[8])],t=!0)},p:function(e,t){8&t&&V(n,"maxlength",e[3]),2&t&&V(n,"placeholder",e[1]),1&t&&n.value!==e[0]&&q(n,e[0])},d:function(e){e&&R(n),t=!1,x(o)}}}function ln(e){var n,t,o;return{c:function(){V(n=D("textarea"),"class","input svelte-1fikcsw"),V(n,"maxlength",e[3]),V(n,"placeholder",e[1])},m:function(r,i){F(r,n,i),q(n,e[0]),t||(o=[$(n,"input",e[5]),$(n,"input",e[6])],t=!0)},p:function(e,t){8&t&&V(n,"maxlength",e[3]),2&t&&V(n,"placeholder",e[1]),1&t&&q(n,e[0])},d:function(e){e&&R(n),t=!1,x(o)}}}function dn(e){var n;function t(e,n){return e[2]?ln:sn}var o=t(e),r=o(e);return{c:function(){r.c(),n=W()},m:function(e,t){r.m(e,t),F(e,n,t)},p:function(e,i){var a=v(i,1)[0];o===(o=t(e))&&r?r.p(e,a):(r.d(1),(r=o(e))&&(r.c(),r.m(n.parentNode,n)))},i:m,o:m,d:function(e){r.d(e),e&&R(n)}}}function fn(e,n,t){var o=n.value,r=void 0===o?"":o,i=n.placeholderText,a=void 0===i?"":i,c=n.muti,u=void 0!==c&&c,s=n.maxLength,l=n.onInput;return e.$$set=function(e){"value"in e&&t(0,r=e.value),"placeholderText"in e&&t(1,a=e.placeholderText),"muti"in e&&t(2,u=e.muti),"maxLength"in e&&t(3,s=e.maxLength),"onInput"in e&&t(4,l=e.onInput)},[r,a,u,s,l,function(){r=this.value,t(0,r)},function(){l&&l(r)},function(){r=this.value,t(0,r)},function(){l&&l(r)}]}var pn=function(n){function t(n){var o;return a(this,t),Ae(p(o=e(this,t)),n,fn,dn,k,{value:0,placeholderText:1,muti:2,maxLength:3,onInput:4}),o}return l(t,n),u(t)}(ke);function vn(e){var n,t,o,r,i,a,c,u,s,l,d,f,p,v,h,g,m,w,y;n=new Pe({props:{bgColor:"rgba(0, 0, 0, .1)"}});var b=[gn,hn],_=[];function x(e,n){return e[7]?0:1}s=x(e),l=_[s]=b[s](e);var A=e[2]&&mn(e);return{c:function(){be(n.$$.fragment),t=G(),o=D("div"),r=D("div"),i=D("span"),a=N(e[1]),c=G(),u=D("div"),l.c(),d=G(),f=D("div"),A&&A.c(),p=G(),v=D("div"),h=N(e[5]),V(i,"class","title svelte-lduamy"),V(r,"class","header svelte-lduamy"),V(u,"class","body svelte-lduamy"),V(v,"class","button svelte-lduamy"),K(v,"color",e[6]),V(f,"class","footer svelte-lduamy"),V(o,"class","modal svelte-lduamy")},m:function(l,g){_e(n,l,g),F(l,t,g),F(l,o,g),B(o,r),B(r,i),B(i,a),B(o,c),B(o,u),_[s].m(u,null),B(o,d),B(o,f),A&&A.m(f,null),B(f,p),B(f,v),B(v,h),m=!0,w||(y=$(v,"click",e[14]),w=!0)},p:function(e,n){(!m||2&n)&&z(a,e[1]);var t=s;(s=x(e))===t?_[s].p(e,n):(ve(),me(_[t],1,1,(function(){_[t]=null})),he(),(l=_[s])?l.p(e,n):(l=_[s]=b[s](e)).c(),ge(l,1),l.m(u,null)),e[2]?A?A.p(e,n):((A=mn(e)).c(),A.m(f,p)):A&&(A.d(1),A=null),(!m||32&n)&&z(h,e[5]),64&n&&K(v,"color",e[6])},i:function(e){m||(ge(n.$$.fragment,e),ge(l),ie((function(){g||(g=ye(o,Ie,{duration:100},!0)),g.run(1)})),m=!0)},o:function(e){me(n.$$.fragment,e),me(l),g||(g=ye(o,Ie,{duration:100},!1)),g.run(0),m=!1},d:function(e){xe(n,e),e&&R(t),e&&R(o),_[s].d(),A&&A.d(),e&&g&&g.end(),w=!1,y()}}}function hn(e){var n,t;return{c:function(){n=D("div"),t=N(e[0]),V(n,"class","body-text svelte-lduamy")},m:function(e,o){F(e,n,o),B(n,t)},p:function(e,n){1&n&&z(t,e[0])},i:m,o:m,d:function(e){e&&R(n)}}}function gn(e){var n,t,o;return t=new pn({props:{muti:!0,value:e[0],onInput:e[12],placeholderText:e[8]}}),{c:function(){n=D("div"),be(t.$$.fragment),V(n,"class","input-wrapper svelte-lduamy")},m:function(e,r){F(e,n,r),_e(t,n,null),o=!0},p:function(e,n){var o={};1&n&&(o.value=e[0]),1&n&&(o.onInput=e[12]),256&n&&(o.placeholderText=e[8]),t.$set(o)},i:function(e){o||(ge(t.$$.fragment,e),o=!0)},o:function(e){me(t.$$.fragment,e),o=!1},d:function(e){e&&R(n),xe(t)}}}function mn(e){var n,t,o,r;return{c:function(){n=D("div"),t=N(e[3]),V(n,"class","button cancel svelte-lduamy"),K(n,"color",e[4])},m:function(i,a){F(i,n,a),B(n,t),o||(r=$(n,"click",e[13]),o=!0)},p:function(e,o){8&o&&z(t,e[3]),16&o&&K(n,"color",e[4])},d:function(e){e&&R(n),o=!1,r()}}}function wn(e){var n,t,o=e[9]&&vn(e);return{c:function(){o&&o.c(),n=W()},m:function(e,r){o&&o.m(e,r),F(e,n,r),t=!0},p:function(e,t){var r=v(t,1)[0];e[9]?o?(o.p(e,r),512&r&&ge(o,1)):((o=vn(e)).c(),ge(o,1),o.m(n.parentNode,n)):o&&(ve(),me(o,1,1,(function(){o=null})),he())},i:function(e){t||(ge(o),t=!0)},o:function(e){me(o),t=!1},d:function(e){o&&o.d(e),e&&R(n)}}}function yn(e,n,t){var o=n.title,r=void 0===o?"标题":o,i=n.content,a=void 0===i?"":i,c=n.showCancel,u=void 0===c||c,s=n.cancelText,l=void 0===s?"取消":s,d=n.cancelColor,f=void 0===d?"#000":d,p=n.confirmText,v=void 0===p?"确定":p,h=n.confirmColor,g=void 0===h?"#576B95":h,m=n.editable,w=void 0===m||m,y=n.placeholderText,b=void 0===y?"":y,_=n.show,x=void 0!==_&&_,A=n.onConfirm,k=n.onCancel;return e.$$set=function(e){"title"in e&&t(1,r=e.title),"content"in e&&t(0,a=e.content),"showCancel"in e&&t(2,u=e.showCancel),"cancelText"in e&&t(3,l=e.cancelText),"cancelColor"in e&&t(4,f=e.cancelColor),"confirmText"in e&&t(5,v=e.confirmText),"confirmColor"in e&&t(6,g=e.confirmColor),"editable"in e&&t(7,w=e.editable),"placeholderText"in e&&t(8,b=e.placeholderText),"show"in e&&t(9,x=e.show),"onConfirm"in e&&t(10,A=e.onConfirm),"onCancel"in e&&t(11,k=e.onCancel)},[a,r,u,l,f,v,g,w,b,x,A,k,function(e){t(0,a=e)},function(){k&&k(a)},function(){A&&A(a)}]}var bn=function(n){function t(n){var o;return a(this,t),Ae(p(o=e(this,t)),n,yn,wn,k,{title:1,content:0,showCancel:2,cancelText:3,cancelColor:4,confirmText:5,confirmColor:6,editable:7,placeholderText:8,show:9,onConfirm:10,onCancel:11}),o}return l(t,n),u(t)}(ke);function _n(e){var n,t,o,r,i;return{c:function(){n=D("div"),t=j("svg"),V(o=j("polyline"),"points","15 18 9 12 15 6"),V(t,"xmlns","http://www.w3.org/2000/svg"),V(t,"width","18px"),V(t,"height","18px"),V(t,"fill","none"),V(t,"viewBox","0 0 24 24"),V(t,"stroke","currentColor"),V(t,"stroke-width","2"),V(t,"stroke-linecap","round"),V(t,"stroke-linejoin","round"),K(t,"color",e[1]),V(n,"role","button"),V(n,"class","btn-back svelte-o95f8l")},m:function(a,c){F(a,n,c),B(n,t),B(t,o),r||(i=$(n,"click",e[2]),r=!0)},p:function(e,n){2&v(n,1)[0]&&K(t,"color",e[1])},i:m,o:m,d:function(e){e&&R(n),r=!1,i()}}}function xn(e,n,t){var o=n.onClick,r=n.color,i=void 0===r?"#000":r;return e.$$set=function(e){"onClick"in e&&t(0,o=e.onClick),"color"in e&&t(1,i=e.color)},[o,i,function(){o&&o()}]}var An=function(n){function t(n){var o;return a(this,t),Ae(p(o=e(this,t)),n,xn,_n,k,{onClick:0,color:1}),o}return l(t,n),u(t)}(ke);function kn(e){var n,t,o,r,i,a,c,u=e[4]&&Sn(e),s=e[0]&&In();return{c:function(){n=D("div"),t=D("div"),u&&u.c(),o=G(),s&&s.c(),r=G(),i=D("div"),a=N(e[1]),V(t,"class","nav-action-btns svelte-1ouzypl"),V(i,"class","nav-title svelte-1ouzypl"),K(i,"color",e[2]),V(n,"class","nav svelte-1ouzypl"),K(n,"background-color",e[3]),K(n,"transition-duration","".concat(e[6].duration,"ms")),K(n,"transition-timing-function",e[6].timingFunc)},m:function(e,l){F(e,n,l),B(n,t),u&&u.m(t,null),B(t,o),s&&s.m(t,null),B(n,r),B(n,i),B(i,a),c=!0},p:function(e,r){e[4]?u?(u.p(e,r),16&r&&ge(u,1)):((u=Sn(e)).c(),ge(u,1),u.m(t,o)):u&&(ve(),me(u,1,1,(function(){u=null})),he()),e[0]?s?1&r&&ge(s,1):((s=In()).c(),ge(s,1),s.m(t,null)):s&&(ve(),me(s,1,1,(function(){s=null})),he()),(!c||2&r)&&z(a,e[1]),4&r&&K(i,"color",e[2]),8&r&&K(n,"background-color",e[3]),64&r&&K(n,"transition-duration","".concat(e[6].duration,"ms")),64&r&&K(n,"transition-timing-function",e[6].timingFunc)},i:function(e){c||(ge(u),ge(s),c=!0)},o:function(e){me(u),me(s),c=!1},d:function(e){e&&R(n),u&&u.d(),s&&s.d()}}}function Sn(e){var n,t;return n=new An({props:{color:e[2],onClick:e[8]}}),{c:function(){be(n.$$.fragment)},m:function(e,o){_e(n,e,o),t=!0},p:function(e,t){var o={};4&t&&(o.color=e[2]),32&t&&(o.onClick=e[8]),n.$set(o)},i:function(e){t||(ge(n.$$.fragment,e),t=!0)},o:function(e){me(n.$$.fragment,e),t=!1},d:function(e){xe(n,e)}}}function In(e){var n,t;return n=new Ue({props:{color:"#000",size:16}}),{c:function(){be(n.$$.fragment)},m:function(e,o){_e(n,e,o),t=!0},i:function(e){t||(ge(n.$$.fragment,e),t=!0)},o:function(e){me(n.$$.fragment,e),t=!1},d:function(e){xe(n,e)}}}function Cn(e){var n,t,o=e[7]&&kn(e);return{c:function(){o&&o.c(),n=W()},m:function(e,r){o&&o.m(e,r),F(e,n,r),t=!0},p:function(e,t){var r=v(t,1)[0];e[7]?o?(o.p(e,r),128&r&&ge(o,1)):((o=kn(e)).c(),ge(o,1),o.m(n.parentNode,n)):o&&(ve(),me(o,1,1,(function(){o=null})),he())},i:function(e){t||(ge(o),t=!0)},o:function(e){me(o),t=!1},d:function(e){o&&o.d(e),e&&R(n)}}}function Tn(e,n,t){var o=n.loading,r=void 0!==o&&o,i=n.title,a=n.textColor,c=void 0===a?"#000":a,u=n.bgColor,s=void 0===u?"#fff":u,l=n.showBtns,d=void 0!==l&&l,f=n.onBack,p=n.animation,v=void 0===p?{duration:0,timingFunc:"linear"}:p,h=n.show,g=void 0===h||h;return e.$$set=function(e){"loading"in e&&t(0,r=e.loading),"title"in e&&t(1,i=e.title),"textColor"in e&&t(2,c=e.textColor),"bgColor"in e&&t(3,s=e.bgColor),"showBtns"in e&&t(4,d=e.showBtns),"onBack"in e&&t(5,f=e.onBack),"animation"in e&&t(6,v=e.animation),"show"in e&&t(7,g=e.show)},[r,i,c,s,d,f,v,g,function(){f&&f()}]}var Mn=function(n){function t(n){var o;return a(this,t),Ae(p(o=e(this,t)),n,Tn,Cn,k,{loading:0,title:1,textColor:2,bgColor:3,showBtns:4,onBack:5,animation:6,show:7}),o}return l(t,n),u(t)}(ke);function Pn(e){var n,t,o,r,i,a,c,u,s,l,d,f,p,h,g;return{c:function(){n=D("div"),t=D("div"),o=j("svg"),r=j("path"),i=j("path"),a=j("path"),c=G(),u=D("span"),s=G(),l=D("div"),d=j("svg"),f=j("path"),p=j("path"),V(r,"d","M512 512m-119.466667 0a119.466667 119.466667 0 1 0 238.933334 0 119.466667 119.466667 0 1 0-238.933334 0Z"),V(r,"fill",e[6]),V(r,"p-id","10643"),V(i,"d","M785.066667 529.066667m-68.266667 0a68.266667 68.266667 0 1 0 136.533333 0 68.266667 68.266667 0 1 0-136.533333 0Z"),V(i,"fill",e[6]),V(i,"p-id","10644"),V(a,"d","M238.933333 529.066667m-68.266666 0a68.266667 68.266667 0 1 0 136.533333 0 68.266667 68.266667 0 1 0-136.533333 0Z"),V(a,"fill",e[6]),V(a,"p-id","10645"),V(o,"t","1713151535527"),V(o,"class","icon"),V(o,"viewBox","0 0 1024 1024"),V(o,"version","1.1"),V(o,"xmlns","http://www.w3.org/2000/svg"),V(o,"p-id","10642"),V(o,"width","26"),V(o,"height","26"),V(u,"class","line svelte-10fi14j"),K(u,"background-color",e[4]),V(t,"role","button"),V(t,"class","tools-item svelte-10fi14j"),V(f,"d","M512 353.5872c87.4496 0 158.4128 70.9632 158.4128 158.4128S599.4496 670.4128 512 670.4128c-87.4496 0-158.4128-70.9632-158.4128-158.4128S424.5504 353.5872 512 353.5872z"),V(f,"fill",e[6]),V(f,"p-id","10253"),V(p,"d","M1018.88 512c0 279.9616-226.9184 506.88-506.88 506.88S5.12 791.9616 5.12 512 232.0384 5.12 512 5.12s506.88 226.9184 506.88 506.88zM512 132.096c-209.8176 0-379.904 170.0864-379.904 379.904s170.0864 379.904 379.904 379.904 379.904-170.0864 379.904-379.904-170.0864-379.904-379.904-379.904z"),V(p,"fill",e[6]),V(p,"p-id","10254"),V(d,"t","1713152201831"),V(d,"class","icon"),V(d,"viewBox","0 0 1024 1024"),V(d,"version","1.1"),V(d,"xmlns","http://www.w3.org/2000/svg"),V(d,"p-id","10252"),V(d,"width","20"),V(d,"height","20"),V(l,"role","button"),V(l,"class","tools-item svelte-10fi14j"),V(n,"class","nav-bar-tools portrait svelte-10fi14j"),K(n,"border-color",e[5]),K(n,"background-color",e[3]),K(n,"top",e[7]+"px"),K(n,"right",e[8]+"px")},m:function(v,m){F(v,n,m),B(n,t),B(t,o),B(o,r),B(o,i),B(o,a),B(t,c),B(t,u),B(n,s),B(n,l),B(l,d),B(d,f),B(d,p),e[11](n),h||(g=[$(t,"click",e[9]),$(l,"click",e[10])],h=!0)},p:function(e,t){var o=v(t,1)[0];64&o&&V(r,"fill",e[6]),64&o&&V(i,"fill",e[6]),64&o&&V(a,"fill",e[6]),16&o&&K(u,"background-color",e[4]),64&o&&V(f,"fill",e[6]),64&o&&V(p,"fill",e[6]),32&o&&K(n,"border-color",e[5]),8&o&&K(n,"background-color",e[3]),128&o&&K(n,"top",e[7]+"px"),256&o&&K(n,"right",e[8]+"px")},i:m,o:m,d:function(t){t&&R(n),e[11](null),h=!1,x(g)}}}function En(e,n,t){var o=n.onMore,r=n.onClose,i=n.el,a=n.bgColor,c=void 0===a?"rgba(255, 255, 255, .6)":a,u=n.lineColor,s=void 0===u?"rgba(255, 255, 255, .3)":u,l=n.borderColor,d=void 0===l?"rgba(0, 0, 0, .1)":l,f=n.iconColor,p=void 0===f?"#333":f,v=n.top,h=void 0===v?6:v,g=n.right,m=void 0===g?10:g;return e.$$set=function(e){"onMore"in e&&t(1,o=e.onMore),"onClose"in e&&t(2,r=e.onClose),"el"in e&&t(0,i=e.el),"bgColor"in e&&t(3,c=e.bgColor),"lineColor"in e&&t(4,s=e.lineColor),"borderColor"in e&&t(5,d=e.borderColor),"iconColor"in e&&t(6,p=e.iconColor),"top"in e&&t(7,h=e.top),"right"in e&&t(8,m=e.right)},[i,o,r,c,s,d,p,h,m,function(){o&&o()},function(){r&&r()},function(e){ee[e?"unshift":"push"]((function(){t(0,i=e)}))}]}var Bn=function(n){function t(n){var o;return a(this,t),Ae(p(o=e(this,t)),n,En,Pn,k,{onMore:1,onClose:2,el:0,bgColor:3,lineColor:4,borderColor:5,iconColor:6,top:7,right:8}),o}return l(t,n),u(t,[{key:"onMore",get:function(){return this.$$.ctx[1]},set:function(e){this.$$set({onMore:e}),se()}},{key:"onClose",get:function(){return this.$$.ctx[2]},set:function(e){this.$$set({onClose:e}),se()}},{key:"el",get:function(){return this.$$.ctx[0]},set:function(e){this.$$set({el:e}),se()}},{key:"bgColor",get:function(){return this.$$.ctx[3]},set:function(e){this.$$set({bgColor:e}),se()}},{key:"lineColor",get:function(){return this.$$.ctx[4]},set:function(e){this.$$set({lineColor:e}),se()}},{key:"borderColor",get:function(){return this.$$.ctx[5]},set:function(e){this.$$set({borderColor:e}),se()}},{key:"iconColor",get:function(){return this.$$.ctx[6]},set:function(e){this.$$set({iconColor:e}),se()}},{key:"top",get:function(){return this.$$.ctx[7]},set:function(e){this.$$set({top:e}),se()}},{key:"right",get:function(){return this.$$.ctx[8]},set:function(e){this.$$set({right:e}),se()}}]),t}(ke);function On(e){var n;return{c:function(){V(n=D("div"),"class","status-bar-holder svelte-1tsnloh"),K(n,"height",e[0]+"px")},m:function(e,t){F(e,n,t)},p:function(e,t){1&v(t,1)[0]&&K(n,"height",e[0]+"px")},i:m,o:m,d:function(e){e&&R(n)}}}function Ln(e,n,t){var o=n.height,r=void 0===o?0:o;return e.$$set=function(e){"height"in e&&t(0,r=e.height)},[r]}var Fn=function(n){function t(n){var o;return a(this,t),Ae(p(o=e(this,t)),n,Ln,On,k,{height:0}),o}return l(t,n),u(t)}(ke);function Rn(e){var n,t,o,r=e[0].badge+"";return{c:function(){n=D("div"),t=D("span"),o=N(r),V(t,"class","badge-text svelte-18y9mkk"),V(n,"class","badge svelte-18y9mkk")},m:function(e,r){F(e,n,r),B(n,t),B(t,o)},p:function(e,n){1&n&&r!==(r=e[0].badge+"")&&z(o,r)},d:function(e){e&&R(n)}}}function Hn(e){var n;return{c:function(){V(n=D("div"),"class","red-dot svelte-18y9mkk")},m:function(e,t){F(e,n,t)},d:function(e){e&&R(n)}}}function Dn(e){var n,t,o,r,i,a,c,u,s,l,d,f=e[0].text+"",p=e[0].badge&&Rn(e),h=e[0].redDot&&Hn();return{c:function(){n=D("div"),t=D("div"),p&&p.c(),o=G(),h&&h.c(),r=G(),i=D("img"),c=G(),u=D("div"),s=N(f),V(i,"class","img svelte-18y9mkk"),S(i.src,a=e[3]?e[0].selectedIconPath:e[0].iconPath)||V(i,"src",a),V(i,"alt","img"),V(t,"class","icon svelte-18y9mkk"),V(u,"class","tab-text svelte-18y9mkk"),K(u,"color",e[3]?e[2]:e[1]),V(n,"role","button"),V(n,"class","tab-item svelte-18y9mkk")},m:function(a,f){F(a,n,f),B(n,t),p&&p.m(t,null),B(t,o),h&&h.m(t,null),B(t,r),B(t,i),B(n,c),B(n,u),B(u,s),l||(d=$(n,"click",e[5]),l=!0)},p:function(e,n){var c=v(n,1)[0];e[0].badge?p?p.p(e,c):((p=Rn(e)).c(),p.m(t,o)):p&&(p.d(1),p=null),e[0].redDot?h||((h=Hn()).c(),h.m(t,r)):h&&(h.d(1),h=null),9&c&&!S(i.src,a=e[3]?e[0].selectedIconPath:e[0].iconPath)&&V(i,"src",a),1&c&&f!==(f=e[0].text+"")&&z(s,f),14&c&&K(u,"color",e[3]?e[2]:e[1])},i:m,o:m,d:function(e){e&&R(n),p&&p.d(),h&&h.d(),l=!1,d()}}}function jn(e,n,t){var o=n.data,r=n.color,i=n.selectedColor,a=n.active,c=void 0!==a&&a,u=n.onClick;return e.$$set=function(e){"data"in e&&t(0,o=e.data),"color"in e&&t(1,r=e.color),"selectedColor"in e&&t(2,i=e.selectedColor),"active"in e&&t(3,c=e.active),"onClick"in e&&t(4,u=e.onClick)},[o,r,i,c,u,function(e){c||u&&u(o)}]}var Nn=function(n){function t(n){var o;return a(this,t),Ae(p(o=e(this,t)),n,jn,Dn,k,{data:0,color:1,selectedColor:2,active:3,onClick:4}),o}return l(t,n),u(t)}(ke);function Gn(e,n,t){var o=e.slice();return o[10]=n[t],o[12]=t,o}function Wn(e){for(var n,t,o,r=e[2],i=[],a=0;a<r.length;a+=1)i[a]=$n(Gn(e,r,a));var c=function(e){return me(i[e],1,1,(function(){i[e]=null}))};return{c:function(){n=D("div");for(var o=0;o<i.length;o+=1)i[o].c();V(n,"class","tab-list svelte-h0c4dd"),V(n,"style",t="border-color: ".concat(e[5],";background-color: ").concat(e[6],";margin-bottom:").concat(e[8],"px"))},m:function(e,t){F(e,n,t);for(var r=0;r<i.length;r+=1)i[r].m(n,null);o=!0},p:function(e,a){if(31&a){var u;for(r=e[2],u=0;u<r.length;u+=1){var s=Gn(e,r,u);i[u]?(i[u].p(s,a),ge(i[u],1)):(i[u]=$n(s),i[u].c(),ge(i[u],1),i[u].m(n,null))}for(ve(),u=r.length;u<i.length;u+=1)c(u);he()}(!o||352&a&&t!==(t="border-color: ".concat(e[5],";background-color: ").concat(e[6],";margin-bottom:").concat(e[8],"px")))&&V(n,"style",t)},i:function(e){if(!o){for(var n=0;n<r.length;n+=1)ge(i[n]);o=!0}},o:function(e){i=i.filter(Boolean);for(var n=0;n<i.length;n+=1)me(i[n]);o=!1},d:function(e){e&&R(n),H(i,e)}}}function $n(e){var n,t;function o(){for(var n,t=arguments.length,o=new Array(t),r=0;r<t;r++)o[r]=arguments[r];return(n=e)[9].apply(n,[e[12]].concat(o))}return n=new Nn({props:{data:e[10],active:e[3]===e[10].pagePath,selectedColor:e[1],color:e[0],onClick:o}}),{c:function(){be(n.$$.fragment)},m:function(e,o){_e(n,e,o),t=!0},p:function(t,r){e=t;var i={};4&r&&(i.data=e[10]),12&r&&(i.active=e[3]===e[10].pagePath),2&r&&(i.selectedColor=e[1]),1&r&&(i.color=e[0]),16&r&&(i.onClick=o),n.$set(i)},i:function(e){t||(ge(n.$$.fragment,e),t=!0)},o:function(e){me(n.$$.fragment,e),t=!1},d:function(e){xe(n,e)}}}function Vn(e){var n,t,o=e[7]&&Wn(e);return{c:function(){o&&o.c(),n=W()},m:function(e,r){o&&o.m(e,r),F(e,n,r),t=!0},p:function(e,t){var r=v(t,1)[0];e[7]?o?(o.p(e,r),128&r&&ge(o,1)):((o=Wn(e)).c(),ge(o,1),o.m(n.parentNode,n)):o&&(ve(),me(o,1,1,(function(){o=null})),he())},i:function(e){t||(ge(o),t=!0)},o:function(e){me(o),t=!1},d:function(e){o&&o.d(e),e&&R(n)}}}function zn(e,n,t){var o=n.color,r=void 0===o?"#000":o,i=n.selectedColor,a=void 0===i?"#4285f4":i,c=n.configList,u=void 0===c?[]:c,s=n.value,l=n.onChange,d=n.borderColor,f=void 0===d?"#eee":d,p=n.backgroundColor,v=void 0===p?"#fff":p,h=n.show,g=void 0!==h&&h,m=n.bottomSpace,w=void 0===m?0:m;return e.$$set=function(e){"color"in e&&t(0,r=e.color),"selectedColor"in e&&t(1,a=e.selectedColor),"configList"in e&&t(2,u=e.configList),"value"in e&&t(3,s=e.value),"onChange"in e&&t(4,l=e.onChange),"borderColor"in e&&t(5,f=e.borderColor),"backgroundColor"in e&&t(6,v=e.backgroundColor),"show"in e&&t(7,g=e.show),"bottomSpace"in e&&t(8,w=e.bottomSpace)},[r,a,u,s,l,f,v,g,w,function(e,n){l&&l(n,e)}]}var qn=function(n){function t(n){var o;return a(this,t),Ae(p(o=e(this,t)),n,zn,Vn,k,{color:0,selectedColor:1,configList:2,value:3,onChange:4,borderColor:5,backgroundColor:6,show:7,bottomSpace:8}),o}return l(t,n),u(t,[{key:"color",get:function(){return this.$$.ctx[0]},set:function(e){this.$$set({color:e}),se()}},{key:"selectedColor",get:function(){return this.$$.ctx[1]},set:function(e){this.$$set({selectedColor:e}),se()}},{key:"configList",get:function(){return this.$$.ctx[2]},set:function(e){this.$$set({configList:e}),se()}},{key:"value",get:function(){return this.$$.ctx[3]},set:function(e){this.$$set({value:e}),se()}},{key:"onChange",get:function(){return this.$$.ctx[4]},set:function(e){this.$$set({onChange:e}),se()}},{key:"borderColor",get:function(){return this.$$.ctx[5]},set:function(e){this.$$set({borderColor:e}),se()}},{key:"backgroundColor",get:function(){return this.$$.ctx[6]},set:function(e){this.$$set({backgroundColor:e}),se()}},{key:"show",get:function(){return this.$$.ctx[7]},set:function(e){this.$$set({show:e}),se()}},{key:"bottomSpace",get:function(){return this.$$.ctx[8]},set:function(e){this.$$set({bottomSpace:e}),se()}}]),t}(ke);function Kn(e){var n,t,o,r,i,a,c,u,s,l,d,f,p,v=(e[9][e[5]]||"确定")+"";return(n=new Pe({props:{bgColor:"rgba(0, 0, 0, .1)"}})).$on("click",e[10]),i=new pn({props:{maxLength:e[6],muti:!!e[7],value:e[0],onInput:e[11]}}),{c:function(){be(n.$$.fragment),t=G(),o=D("div"),r=D("div"),be(i.$$.fragment),a=G(),c=D("div"),u=D("span"),s=N(v),V(u,"class","button-confirm-text svelte-1tawb6"),V(c,"class","button-confirm svelte-1tawb6"),V(r,"class","keyboard-header svelte-1tawb6"),V(o,"class","keyboard svelte-1tawb6")},m:function(l,v){_e(n,l,v),F(l,t,v),F(l,o,v),B(o,r),_e(i,r,null),B(r,a),B(r,c),B(c,u),B(u,s),d=!0,f||(p=$(c,"click",e[12]),f=!0)},p:function(e,n){var t={};64&n&&(t.maxLength=e[6]),128&n&&(t.muti=!!e[7]),1&n&&(t.value=e[0]),5&n&&(t.onInput=e[11]),i.$set(t),(!d||32&n)&&v!==(v=(e[9][e[5]]||"确定")+"")&&z(s,v)},i:function(e){d||(ge(n.$$.fragment,e),ge(i.$$.fragment,e),ie((function(){l||(l=ye(o,Ce,{duration:300},!0)),l.run(1)})),d=!0)},o:function(e){me(n.$$.fragment,e),me(i.$$.fragment,e),l||(l=ye(o,Ce,{duration:300},!1)),l.run(0),d=!1},d:function(e){xe(n,e),e&&R(t),e&&R(o),xe(i),e&&l&&l.end(),f=!1,p()}}}function Un(e){var n,t,o=e[1]&&Kn(e);return{c:function(){o&&o.c(),n=W()},m:function(e,r){o&&o.m(e,r),F(e,n,r),t=!0},p:function(e,t){var r=v(t,1)[0];e[1]?o?(o.p(e,r),2&r&&ge(o,1)):((o=Kn(e)).c(),ge(o,1),o.m(n.parentNode,n)):o&&(ve(),me(o,1,1,(function(){o=null})),he())},i:function(e){t||(ge(o),t=!0)},o:function(e){me(o),t=!1},d:function(e){o&&o.d(e),e&&R(n)}}}function Qn(e,n,t){var o=n.show,r=void 0!==o&&o,i=n.onChange,a=n.onMaskClick,c=n.onConfirm,u=n.confirmType,s=void 0===u?"done":u,l=n.value,d=void 0===l?"":l,f=n.maxLength,p=n.multiple,v=n.confirmHold;return e.$$set=function(e){"show"in e&&t(1,r=e.show),"onChange"in e&&t(2,i=e.onChange),"onMaskClick"in e&&t(3,a=e.onMaskClick),"onConfirm"in e&&t(4,c=e.onConfirm),"confirmType"in e&&t(5,s=e.confirmType),"value"in e&&t(0,d=e.value),"maxLength"in e&&t(6,f=e.maxLength),"multiple"in e&&t(7,p=e.multiple),"confirmHold"in e&&t(8,v=e.confirmHold)},[d,r,i,a,c,s,f,p,v,{done:"完成",next:"下一个",search:"搜索",go:"前往",send:"发送"},function(){a&&a(d)},function(e){t(0,d=e),i&&i(e)},function(){c&&c(d,v)}]}var Jn=function(n){function t(n){var o;return a(this,t),Ae(p(o=e(this,t)),n,Qn,Un,k,{show:1,onChange:2,onMaskClick:3,onConfirm:4,confirmType:5,value:0,maxLength:6,multiple:7,confirmHold:8}),o}return l(t,n),u(t)}(ke),Zn="serviceStart",Xn="appDataChange",Yn="updateAppData",et="tabItemChanged",nt="showLoading",tt="hideLoading",ot="showToast",rt="hideToast",it="showModal",at="showNavigationBarLoading",ct="hideNavigationBarLoading",ut="setNavigationBarTitle",st="setNavigationBarColor",lt="showActionSheet",dt="showTabBar",ft="hideTabBar",pt="setTabBarStyle",vt="setTabBarItem",ht="setTabBarBadge",gt="removeTabBarBadge",mt="hideTabBarRedDot",wt="showTabBarRedDot",yt="getMenuButtonBoundingClientRect",bt="closeLaunchMask",_t="onDeviceOrientationChange",xt="showKeyboard",At="hideKeyboard",kt="updateKeyboard",St="invokeCallbackHandler",It="dispatchServiceEvent";function Ct(){return document.getElementById("webview-container")}var Tt=window.navigator.userAgent.toLowerCase();function Mt(){var e=(window.__extInfo||{}).extType;return/\_inner\_/gi.test(e)}function Pt(e){var n=e.safeArea,t=e.windowHeight;return Math.max(t-n.bottom,0)}function Et(e){return"white"===e?{bgColor:"rgba(255, 255, 255, .6)",lineColor:"rgba(255, 255, 255, .3)",borderColor:"rgba(0, 0, 0, .1)",iconColor:"#333"}:{bgColor:"rgba(0, 0, 0, .15)",lineColor:"rgba(255, 255, 255, .7)",borderColor:"rgba(255, 255, 255, .25)",iconColor:"#fff"}}function Bt(e,n){null!=n.navigationBarTextStyle&&e.$set(Et(n.navigationBarTextStyle))}/android/.test(Tt),/(iphone|ipad)/.test(Tt);function Ot(e,n){null!=n&&(null!=n.navigationBarTitleText&&(e.title=n.navigationBarTitleText),null!=n.navigationBarTextStyle&&(e.textColor=n.navigationBarTextStyle),null!=n.navigationBarBackgroundColor&&(e.bgColor=n.navigationBarBackgroundColor),null!=n.navigationStyle?e.show="custom"!==n.navigationStyle:e.show=!0)}window.__initWebFrame=function(e,n){var t=e.wxConfig,o=e.windowInfo,r=t.window,i=t.tabBar;Mt()&&null!=r&&function(e,n){var t;new Fn({target:document.body,anchor:Ct(),props:{height:(null===(t=e.safeArea)||void 0===t?void 0:t.top)||0}})}(o),null!=r&&function(e,n){var t=new Mn({target:document.body,anchor:Ct(),props:{title:e.navigationBarTitleText,textColor:e.navigationBarTextStyle,bgColor:e.navigationBarBackgroundColor,showBtns:!1,show:"custom"!==e.navigationStyle,onBack:function(){n.emit("NavigatorBar:onBack")}}});n.on(ct,(function(){t.$set({loading:!1})})),n.on(at,(function(){t.$set({loading:!0})})),n.on(ut,(function(e){t.$set({title:e.title})})),n.on(st,(function(e){t.$set({bgColor:e.backgroundColor,textColor:e.frontColor,animation:e.animation})})),n.on(Xn,(function(e){e.ext,e.options;var n=e.windowConfig,o=e.pages,r={};Ot(r,n),r.showBtns=1!==o.length,t.$set(r)})),n.on(Yn,(function(e){var n=e.pages,o={};Ot(o,e.windowConfig),o.showBtns=1!==n.length,t.$set(o)})),n.on(et,(function(e){var n={};Ot(n,e.windowConfig),t.$set(n)}))}(r,n),null!=i&&function(e,n,t){var o,r=new qn({target:document.body,props:{onChange:function(e,n){r.$set({value:e.pagePath}),t.emit("TabBar:change",{item:e,index:n})},color:e.color,selectedColor:e.selectedColor,configList:e.list,value:null===(o=e.list[0])||void 0===o?void 0:o.pagePath,bottomSpace:Pt(n)}});t.on(wt,(function(e){var n=e.index,t=r.configList;if(null!=t){var o=t.slice(),i=o[n];null!=i&&(i.redDot=!0,i.badge=void 0),r.configList=o}})),t.on(mt,(function(e){var n=e.index,t=r.configList;if(null!=t){var o=t.slice(),i=o[n];null!=i&&(i.redDot=void 0),r.configList=o}})),t.on(ht,(function(e){var n=e.index,t=e.text,o=r.configList;if(null!=o){var i=o.slice(),a=i[n];null!=a&&""!=t&&(a.badge=t,a.redDot=void 0),r.configList=i}})),t.on(gt,(function(e){var n=e.index,t=r.configList;if(null!=t){var o=t.slice(),i=o[n];null!=i&&(i.badge=void 0),r.configList=o}})),t.on(pt,(function(e){var n=e.color,t=e.selectedColor,o=e.backgroundColor,i=e.borderStyle;r.$set({color:n,selectedColor:t,backgroundColor:o,borderColor:i})})),t.on(vt,(function(e){var n=e.index,t=e.text,o=e.iconPath,i=e.selectedIconPath,a=r.configList;if(null!=a){var c=a.slice(),u=c[n];null!=u&&(u.text=t||u.text,u.iconPath=o||u.iconPath,u.selectedIconPath=i||u.selectedIconPath),r.configList=c}})),t.on(ft,(function(){r.$set({show:!1})})),t.on(dt,(function(){r.$set({show:!0})})),t.on(Xn,(function(n){n.ext;var t=n.options;n.windowConfig;var o=t.path,i={show:!1};null!=e.list.find((function(e){return e.pagePath===o}))?(i.show=!0,i.value=o):i.show=!1,r.$set(i)})),t.on(Yn,(function(n){var t=n.currPage,o={show:!1};null!=e.list.find((function(e){return e.pagePath===t}))?(o.show=!0,o.value=t):o.show=!1,r.$set(o)}))}(i,o,n)},window.__initWebFrameOnContentLoad=function(e,n){var t=e.windowInfo,r=e.extInfo;Mt()&&!0!==(window.__extInfo||{}).hideNavigationBarTools&&function(e,n){var t,r=new Bn({target:document.body,anchor:Ct(),props:o(o({onMore:function(){e.emit("NavigatorBarTools:onMore")},onClose:function(){e.emit("NavigatorBarTools:onClose")}},Et("white")),{},{top:((null===(t=n.safeArea)||void 0===t?void 0:t.top)||0)+6})});e.on(Zn,(function(e){var n=e.window;Bt(r,n)})),e.on(_t,(function(e){var t,o=6,i=10;"landscape"===e.value?(o=6,i=Pt(n)+10):(o=((null===(t=n.safeArea)||void 0===t?void 0:t.top)||0)+6,i=10),r.$set({top:o,right:i})})),e.on(st,(function(e){var n=Et(e.frontColor);r.$set(n)})),e.on(Xn,(function(e){var n=e.windowConfig;Bt(r,n)})),e.on(Yn,(function(e){var n=e.windowConfig;Bt(r,n)})),e.on(yt,(function(n,t){var o=r.el;if(null!=o){var i=o.getBoundingClientRect();e.emit(St,{callbackId:t,data:{width:i.width,height:i.height,top:i.top,right:i.right,bottom:i.bottom,left:i.left}})}else e.emit(St,{callbackId:t,data:{errMsg:"getMenuButtonBoundingClientRect:fail The MenuButton dom node is not found."}})}))}(n,t),function(e){var n,t=new rn({target:document.body,props:{}});e.on(nt,(function(e){n&&clearTimeout(n),t.$set({show:!1})})),e.on(ot,(function(e){var o=e.title,r=void 0===o?"":o,i=e.icon,a=e.image,c=e.duration,u=void 0===c?1500:c,s=e.mask,l=void 0!==s&&s;n&&clearTimeout(n),t.$set({show:!0,title:r,icon:i,image:a,mask:l}),n=setTimeout((function(){t.$set({show:!1})}),u)})),e.on(rt,(function(e){n&&clearTimeout(n),t.$set({show:!1})}))}(n),function(e){var n=new un({target:document.body,props:{}});e.on(nt,(function(e){n.$set({show:!0,title:e.title||"",mask:!!e.mask})})),e.on(tt,(function(e){n.$set({show:!1})})),e.on(ot,(function(e){n.$set({show:!1})}))}(n),function(e){var n={callbackId:0},t=new bn({target:document.body,props:{onConfirm:function(o){t.$set({show:!1}),e.emit(St,{callbackId:n.callbackId,data:{confirm:!0,cancel:!1,content:o}})},onCancel:function(o){t.$set({show:!1}),e.emit(St,{callbackId:n.callbackId,data:{confirm:!1,cancel:!0,content:o}})}}});e.on(it,(function(e,r){n.callbackId=r,setTimeout((function(){t.$set(o({show:!0},e))}),100)}))}(n),function(e){var n={callbackId:0},t=new He({target:document.body,props:{onSelect:function(o){t.$set({show:!1}),e.emit(St,{callbackId:n.callbackId,data:{tapIndex:o}})},onCancel:function(){t.$set({show:!1}),e.emit(St,{callbackId:n.callbackId,data:{errMsg:"showActionSheet:fail user cancel"}})}}});e.on(lt,(function(e,r){n.callbackId=r,setTimeout((function(){t.$set(o({show:!0},e))}),100)}))}(n),function(e,n){var t=new $e({target:document.body,props:{extInfo:n}});e.on(bt,(function(){t.$set({show:!1})}))}(n,r),function(e){var n=new Jn({target:document.body,props:{onChange:function(n){e.emit(It,{event:"onKeyboardInput",payload:{value:n}})},onMaskClick:function(n){e.emit(It,{event:"onKeyboardComplete",payload:{value:n}})},onConfirm:function(t,o){o||n.$set({show:!1}),e.emit(It,{event:"onKeyboardConfirm",payload:{value:t}})}}});e.on(xt,(function(e){var t=e.defaultValue,o=e.maxLength,r=e.multiple,i=e.confirmHold,a=e.confirmType;n.$set({value:t,maxLength:o,multiple:r,confirmHold:i,confirmType:a,show:!0})})),e.on(kt,(function(e){var t=e.value;n.$set({value:t})})),e.on(At,(function(e){n.$set({show:!1})}))}(n)}}();var o="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function r(e,n,t){return e(t={path:n,exports:{},require:function(e,n){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==n&&t.path)}},t.exports),t.exports}var i=r((function(e){var n=Object.prototype.hasOwnProperty,t="~";function o(){}function r(e,n,t){this.fn=e,this.context=n,this.once=t||!1}function i(e,n,o,i,a){if("function"!=typeof o)throw new TypeError("The listener must be a function");var c=new r(o,i||e,a),u=t?t+n:n;return e._events[u]?e._events[u].fn?e._events[u]=[e._events[u],c]:e._events[u].push(c):(e._events[u]=c,e._eventsCount++),e}function a(e,n){0==--e._eventsCount?e._events=new o:delete e._events[n]}function c(){this._events=new o,this._eventsCount=0}Object.create&&(o.prototype=Object.create(null),(new o).__proto__||(t=!1)),c.prototype.eventNames=function(){var e,o,r=[];if(0===this._eventsCount)return r;for(o in e=this._events)n.call(e,o)&&r.push(t?o.slice(1):o);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(e)):r},c.prototype.listeners=function(e){var n=t?t+e:e,o=this._events[n];if(!o)return[];if(o.fn)return[o.fn];for(var r=0,i=o.length,a=new Array(i);r<i;r++)a[r]=o[r].fn;return a},c.prototype.listenerCount=function(e){var n=t?t+e:e,o=this._events[n];return o?o.fn?1:o.length:0},c.prototype.emit=function(e,n,o,r,i,a){var c=t?t+e:e;if(!this._events[c])return!1;var u,s,l=this._events[c],d=arguments.length;if(l.fn){switch(l.once&&this.removeListener(e,l.fn,void 0,!0),d){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,n),!0;case 3:return l.fn.call(l.context,n,o),!0;case 4:return l.fn.call(l.context,n,o,r),!0;case 5:return l.fn.call(l.context,n,o,r,i),!0;case 6:return l.fn.call(l.context,n,o,r,i,a),!0}for(s=1,u=new Array(d-1);s<d;s++)u[s-1]=arguments[s];l.fn.apply(l.context,u)}else{var f,p=l.length;for(s=0;s<p;s++)switch(l[s].once&&this.removeListener(e,l[s].fn,void 0,!0),d){case 1:l[s].fn.call(l[s].context);break;case 2:l[s].fn.call(l[s].context,n);break;case 3:l[s].fn.call(l[s].context,n,o);break;case 4:l[s].fn.call(l[s].context,n,o,r);break;default:if(!u)for(f=1,u=new Array(d-1);f<d;f++)u[f-1]=arguments[f];l[s].fn.apply(l[s].context,u)}}return!0},c.prototype.on=function(e,n,t){return i(this,e,n,t,!1)},c.prototype.once=function(e,n,t){return i(this,e,n,t,!0)},c.prototype.removeListener=function(e,n,o,r){var i=t?t+e:e;if(!this._events[i])return this;if(!n)return a(this,i),this;var c=this._events[i];if(c.fn)c.fn!==n||r&&!c.once||o&&c.context!==o||a(this,i);else{for(var u=0,s=[],l=c.length;u<l;u++)(c[u].fn!==n||r&&!c[u].once||o&&c[u].context!==o)&&s.push(c[u]);s.length?this._events[i]=1===s.length?s[0]:s:a(this,i)}return this},c.prototype.removeAllListeners=function(e){var n;return e?(n=t?t+e:e,this._events[n]&&a(this,n)):(this._events=new o,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=t,c.EventEmitter=c,e.exports=c})),a=function(e,n){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&(e[t]=n[t])},a(e,n)};
|
6
|
+
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(require("events")):"function"==typeof define&&define.amd?define(["events"],n):n((e="undefined"!=typeof globalThis?globalThis:e||self).events)}(this,(function(e){"use strict";function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var t=n(e),r="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function o(e,n,t){return e(t={path:n,exports:{},require:function(e,n){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==n&&t.path)}},t.exports),t.exports}var i=o((function(e){var n=Object.prototype.hasOwnProperty,t="~";function r(){}function o(e,n,t){this.fn=e,this.context=n,this.once=t||!1}function i(e,n,r,i,a){if("function"!=typeof r)throw new TypeError("The listener must be a function");var s=new o(r,i||e,a),u=t?t+n:n;return e._events[u]?e._events[u].fn?e._events[u]=[e._events[u],s]:e._events[u].push(s):(e._events[u]=s,e._eventsCount++),e}function a(e,n){0==--e._eventsCount?e._events=new r:delete e._events[n]}function s(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(t=!1)),s.prototype.eventNames=function(){var e,r,o=[];if(0===this._eventsCount)return o;for(r in e=this._events)n.call(e,r)&&o.push(t?r.slice(1):r);return Object.getOwnPropertySymbols?o.concat(Object.getOwnPropertySymbols(e)):o},s.prototype.listeners=function(e){var n=t?t+e:e,r=this._events[n];if(!r)return[];if(r.fn)return[r.fn];for(var o=0,i=r.length,a=new Array(i);o<i;o++)a[o]=r[o].fn;return a},s.prototype.listenerCount=function(e){var n=t?t+e:e,r=this._events[n];return r?r.fn?1:r.length:0},s.prototype.emit=function(e,n,r,o,i,a){var s=t?t+e:e;if(!this._events[s])return!1;var u,c,d=this._events[s],l=arguments.length;if(d.fn){switch(d.once&&this.removeListener(e,d.fn,void 0,!0),l){case 1:return d.fn.call(d.context),!0;case 2:return d.fn.call(d.context,n),!0;case 3:return d.fn.call(d.context,n,r),!0;case 4:return d.fn.call(d.context,n,r,o),!0;case 5:return d.fn.call(d.context,n,r,o,i),!0;case 6:return d.fn.call(d.context,n,r,o,i,a),!0}for(c=1,u=new Array(l-1);c<l;c++)u[c-1]=arguments[c];d.fn.apply(d.context,u)}else{var f,p=d.length;for(c=0;c<p;c++)switch(d[c].once&&this.removeListener(e,d[c].fn,void 0,!0),l){case 1:d[c].fn.call(d[c].context);break;case 2:d[c].fn.call(d[c].context,n);break;case 3:d[c].fn.call(d[c].context,n,r);break;case 4:d[c].fn.call(d[c].context,n,r,o);break;default:if(!u)for(f=1,u=new Array(l-1);f<l;f++)u[f-1]=arguments[f];d[c].fn.apply(d[c].context,u)}}return!0},s.prototype.on=function(e,n,t){return i(this,e,n,t,!1)},s.prototype.once=function(e,n,t){return i(this,e,n,t,!0)},s.prototype.removeListener=function(e,n,r,o){var i=t?t+e:e;if(!this._events[i])return this;if(!n)return a(this,i),this;var s=this._events[i];if(s.fn)s.fn!==n||o&&!s.once||r&&s.context!==r||a(this,i);else{for(var u=0,c=[],d=s.length;u<d;u++)(s[u].fn!==n||o&&!s[u].once||r&&s[u].context!==r)&&c.push(s[u]);c.length?this._events[i]=1===c.length?c[0]:c:a(this,i)}return this},s.prototype.removeAllListeners=function(e){var n;return e?(n=t?t+e:e,this._events[n]&&a(this,n)):(this._events=new r,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=t,s.EventEmitter=s,e.exports=s})),a=function(e,n){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&(e[t]=n[t])},a(e,n)};
|
7
7
|
/*! *****************************************************************************
|
8
8
|
Copyright (c) Microsoft Corporation.
|
9
9
|
|
@@ -17,7 +17,7 @@
|
|
17
17
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
18
18
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
19
19
|
PERFORMANCE OF THIS SOFTWARE.
|
20
|
-
***************************************************************************** */function
|
20
|
+
***************************************************************************** */function s(e,n){function t(){this.constructor=e}a(e,n),e.prototype=null===n?Object.create(n):(t.prototype=n.prototype,new t)}var u=function(){return u=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},u.apply(this,arguments)};function c(e,n,t,r){return new(t||(t=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var n;e.done?o(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(a,s)}u((r=r.apply(e,n||[])).next())}))}function d(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:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(t)throw new TypeError("Generator is already executing.");for(;a;)try{if(t=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=n.call(e,a)}catch(e){i=[6,e],r=0}finally{t=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}}function l(){for(var e=0,n=0,t=arguments.length;n<t;n++)e+=arguments[n].length;var r=Array(e),o=0;for(n=0;n<t;n++)for(var i=arguments[n],a=0,s=i.length;a<s;a++,o++)r[o]=i[a];return r}function f(){var e=window.navigator.userAgent.toLowerCase();return/(iphone|ipad)/.test(e)?"IOS":/android/.test(e)?"Android":"Windows For HUYA"}function p(){var e=f();return"IOS"===e||"Android"===e}function v(e){var n=e.split("?"),t=n[0],r=n[1],o={};return null!=r&&""!==r&&r.split("&").reduce((function(e,n){var t=n.split("=");return e[t[0]]=decodeURIComponent(t[1]),e}),o),{path:t,query:o}}function h(e){for(var n="",t=new Uint8Array(e),r=t.byteLength,o=0;o<r;o++)n+=String.fromCharCode(t[o]);return window.btoa(n)}var _=function(e,n,t){var r,o=new Promise((function(n,o){r=setTimeout((function(){t&&t(e),o(new Error("Timed out in "+e+"ms."))}),e)}));return new Promise((function(e,t){Promise.race([n,o]).then((function(n){clearTimeout(r),e(n)})).catch(t)}))};var m,g=function(e){return 1===String(e).length?"0"+e:e};function w(){return window.__extInfo||{}}function y(){return w().extUuid}function b(){var e=w().extType||"";return/\_inner\_/gi.test(e)}!function(e){e[e.debug=0]="debug",e[e.log=1]="log",e[e.info=2]="info",e[e.warn=3]="warn",e[e.error=4]="error"}(m||(m={}));var S=Date.now();var A=function(){var e=localStorage.getItem("wsc_loglevel");if("string"==typeof e&&""!==e){var n=Number(e);if(!isNaN(n))return n}return null}(),I=function(e){var n=e.onBefore,t=e.onAfter,r=e.prefix,o=e.logColor,i=e.level,a=e.enableLog,s=Object.assign({info:"blue",warn:"orange",error:"red",log:"green",debug:"green"},o);function u(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var o=e[0],s=e[1],u=e[2],d=e[3],l=c(),f={prefix:l,msg:s,data:u,desc:l+s};n&&n(f);var p=m[d]>=i;a(p)&&console.log("%c "+f.desc,"color: "+o+";",f.data),t&&t(f,p)}function c(){return"function"==typeof r?r():r||""}return{log:function(e,n){u(s.log,e,n,"log")},info:function(e,n){u(s.info,e,n,"info")},warn:function(e,n){u(s.warn,e,n,"warn")},error:function(e,n){u(s.error,e,n,"error")},debug:function(e,n){u(s.error,e,n,"debug")}}}({level:null!==A?A:m.info,onAfter:function(e,n){n&&null!=window.hyExt&&window.hyExt.logger.info(e.desc+" "+function(e){try{return JSON.stringify(e)}catch(e){return"stringify error"}}(e.data))},prefix:function(){return"web-sdk-core * date:"+(void 0===e&&(e=new Date),g(e.getHours())+":"+g(e.getMinutes())+":"+g(e.getSeconds())+" extName:")+w().extName+" extUuid:"+y()+" sessionId:"+S+" - ";var e},enableLog:function(e){return e}});var k,T,x=location.pathname.split("/"),P=x.slice(1,x.length-1),M=location.protocol+"//"+location.host+"/"+P.join("/")+"/",C=M+"view.html",E=window.__debug,F="service",O="view",L=window.__packageExtConfig,B={path:L?L.entryPagePath:"index",query:{},referrerInfo:{},scene:1001},H="onTaskProgressUpdate",D="onTaskHeadersReceived",W="miniGame",N="hyfile://",V="hyfile://",R=(k=v(location.href).query,T=w(),I.info("forceUsePatchApi",{fromQuery:k.forceUsePatchApi,fromLocal:T.forceUsePatchApi}),null!=k.forceUsePatchApi?"1"===k.forceUsePatchApi:null!=T.forceUsePatchApi&&T.forceUsePatchApi),j=function(){function e(e){this.sync=!1,this.events=new i,this.el=e,this.isReady=!1}return e.prototype.getWindow=function(){return this.el.contentWindow},e.prototype.getBridge=function(){},e.prototype.emitSync=function(e){for(var n,t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];this.sync=!0,(n=this.events).emit.apply(n,l([e],t)),this.sync=!1},e}(),G={onViewDOMContentLoaded:"onViewDOMContentLoaded",onInjectHTMLCallback:"onInjectHTMLCallback"},U={};var q=function(e){function n(n){return e.call(this,n)||this}return s(n,e),n.prototype.updateSrc=function(e){this.el.src=e},n.prototype.sendToSerivce=function(e,n,t){I.debug("%c "+e,{data:n,webviewId:t}),this.getBridge().subscribeHandler(e,n,t)},n.prototype.loadSubBundle=function(e,n){return c(this,void 0,void 0,(function(){var t=this;return d(this,(function(r){return[2,new Promise((function(r){if(!0!==U[e]){var o=t.getWindow();null!=o&&(t.events.once(G.onInjectHTMLCallback,(function(){r()})),o.injectHtml(o.document.body,{content:'<script charset="utf-8" src="'+n+'"><\/script>'}),U[e]=!0)}}))]}))}))},n.prototype.invokeCallbackHandler=function(e,n,t){I.debug("%c "+(t||"API")+" call callback",{cbId:e,data:n}),this.getBridge().invokeCallbackHandler(e,n)},n.prototype.getBridge=function(){return this.getWindow().ServiceJSBridge},n}(j),K="webview-service",$=new Map;function z(e){var n=$.get(e);if(n)return n;var t=document.getElementById(e);if(null!=t){var r=new(e===K?q:xn)(t);return $.set(e,r),r}throw new Error("获取IframeManager失败, id: "+e)}function X(){return z("webview-first-view")}function Q(){return z(K)}function Y(e,n,t){Cn.stack.forEach((function(r){null!=r.webviewId&&function(e,n){return 1===e.length&&e[0]===n.webviewId||e.indexOf(n.webviewId)>-1}(t,r)&&(r.isReady?r.sendToView(e,n):console.error("shouldn't exctute"))}))}function Z(e,n,t){z(K).sendToSerivce(e,n,t)}function J(e,n){var t,r=null===(t=Cn.currPage)||void 0===t?void 0:t.children;if(Array.isArray(r)&&r.length>0){var o=r[0];o&&o.isWebView&&o.postMessageToWebView({eventName:e,type:"subscribeHandler",params:n})}}var ee=null;function ne(){if(null==ee)throw new Error("AdapterTarget is not set yet.");return ee}var te="custom_event_";var re=o((function(e,n){
|
21
21
|
/*!
|
22
22
|
* howler.js v2.2.4
|
23
23
|
* howlerjs.com
|
@@ -27,7 +27,7 @@
|
|
27
27
|
*
|
28
28
|
* MIT License
|
29
29
|
*/
|
30
|
-
!function(){var e=function(){this.init()};e.prototype={init:function(){var e=this||t;return e._counter=1e3,e._html5AudioPool=[],e.html5PoolSize=10,e._codecs={},e._howls=[],e._muted=!1,e._volume=1,e._canPlayEvent="canplaythrough",e._navigator="undefined"!=typeof window&&window.navigator?window.navigator:null,e.masterGain=null,e.noAudio=!1,e.usingWebAudio=!0,e.autoSuspend=!0,e.ctx=null,e.autoUnlock=!0,e._setup(),e},volume:function(e){var n=this||t;if(e=parseFloat(e),n.ctx||d(),void 0!==e&&e>=0&&e<=1){if(n._volume=e,n._muted)return n;n.usingWebAudio&&n.masterGain.gain.setValueAtTime(e,t.ctx.currentTime);for(var o=0;o<n._howls.length;o++)if(!n._howls[o]._webAudio)for(var r=n._howls[o]._getSoundIds(),i=0;i<r.length;i++){var a=n._howls[o]._soundById(r[i]);a&&a._node&&(a._node.volume=a._volume*e)}return n}return n._volume},mute:function(e){var n=this||t;n.ctx||d(),n._muted=e,n.usingWebAudio&&n.masterGain.gain.setValueAtTime(e?0:n._volume,t.ctx.currentTime);for(var o=0;o<n._howls.length;o++)if(!n._howls[o]._webAudio)for(var r=n._howls[o]._getSoundIds(),i=0;i<r.length;i++){var a=n._howls[o]._soundById(r[i]);a&&a._node&&(a._node.muted=!!e||a._muted)}return n},stop:function(){for(var e=this||t,n=0;n<e._howls.length;n++)e._howls[n].stop();return e},unload:function(){for(var e=this||t,n=e._howls.length-1;n>=0;n--)e._howls[n].unload();return e.usingWebAudio&&e.ctx&&void 0!==e.ctx.close&&(e.ctx.close(),e.ctx=null,d()),e},codecs:function(e){return(this||t)._codecs[e.replace(/^x-/,"")]},_setup:function(){var e=this||t;if(e.state=e.ctx&&e.ctx.state||"suspended",e._autoSuspend(),!e.usingWebAudio)if("undefined"!=typeof Audio)try{void 0===(new Audio).oncanplaythrough&&(e._canPlayEvent="canplay")}catch(n){e.noAudio=!0}else e.noAudio=!0;try{(new Audio).muted&&(e.noAudio=!0)}catch(e){}return e.noAudio||e._setupCodecs(),e},_setupCodecs:function(){var e=this||t,n=null;try{n="undefined"!=typeof Audio?new Audio:null}catch(n){return e}if(!n||"function"!=typeof n.canPlayType)return e;var o=n.canPlayType("audio/mpeg;").replace(/^no$/,""),r=e._navigator?e._navigator.userAgent:"",i=r.match(/OPR\/(\d+)/g),a=i&&parseInt(i[0].split("/")[1],10)<33,c=-1!==r.indexOf("Safari")&&-1===r.indexOf("Chrome"),u=r.match(/Version\/(.*?) /),s=c&&u&&parseInt(u[1],10)<15;return e._codecs={mp3:!(a||!o&&!n.canPlayType("audio/mp3;").replace(/^no$/,"")),mpeg:!!o,opus:!!n.canPlayType('audio/ogg; codecs="opus"').replace(/^no$/,""),ogg:!!n.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),oga:!!n.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),wav:!!(n.canPlayType('audio/wav; codecs="1"')||n.canPlayType("audio/wav")).replace(/^no$/,""),aac:!!n.canPlayType("audio/aac;").replace(/^no$/,""),caf:!!n.canPlayType("audio/x-caf;").replace(/^no$/,""),m4a:!!(n.canPlayType("audio/x-m4a;")||n.canPlayType("audio/m4a;")||n.canPlayType("audio/aac;")).replace(/^no$/,""),m4b:!!(n.canPlayType("audio/x-m4b;")||n.canPlayType("audio/m4b;")||n.canPlayType("audio/aac;")).replace(/^no$/,""),mp4:!!(n.canPlayType("audio/x-mp4;")||n.canPlayType("audio/mp4;")||n.canPlayType("audio/aac;")).replace(/^no$/,""),weba:!(s||!n.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),webm:!(s||!n.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),dolby:!!n.canPlayType('audio/mp4; codecs="ec-3"').replace(/^no$/,""),flac:!!(n.canPlayType("audio/x-flac;")||n.canPlayType("audio/flac;")).replace(/^no$/,"")},e},_unlockAudio:function(){var e=this||t;if(!e._audioUnlocked&&e.ctx){e._audioUnlocked=!1,e.autoUnlock=!1,e._mobileUnloaded||44100===e.ctx.sampleRate||(e._mobileUnloaded=!0,e.unload()),e._scratchBuffer=e.ctx.createBuffer(1,1,22050);var n=function(t){for(;e._html5AudioPool.length<e.html5PoolSize;)try{var o=new Audio;o._unlocked=!0,e._releaseHtml5Audio(o)}catch(t){e.noAudio=!0;break}for(var r=0;r<e._howls.length;r++)if(!e._howls[r]._webAudio)for(var i=e._howls[r]._getSoundIds(),a=0;a<i.length;a++){var c=e._howls[r]._soundById(i[a]);c&&c._node&&!c._node._unlocked&&(c._node._unlocked=!0,c._node.load())}e._autoResume();var u=e.ctx.createBufferSource();u.buffer=e._scratchBuffer,u.connect(e.ctx.destination),void 0===u.start?u.noteOn(0):u.start(0),"function"==typeof e.ctx.resume&&e.ctx.resume(),u.onended=function(){u.disconnect(0),e._audioUnlocked=!0,document.removeEventListener("touchstart",n,!0),document.removeEventListener("touchend",n,!0),document.removeEventListener("click",n,!0),document.removeEventListener("keydown",n,!0);for(var t=0;t<e._howls.length;t++)e._howls[t]._emit("unlock")}};return document.addEventListener("touchstart",n,!0),document.addEventListener("touchend",n,!0),document.addEventListener("click",n,!0),document.addEventListener("keydown",n,!0),e}},_obtainHtml5Audio:function(){var e=this||t;if(e._html5AudioPool.length)return e._html5AudioPool.pop();var n=(new Audio).play();return n&&"undefined"!=typeof Promise&&(n instanceof Promise||"function"==typeof n.then)&&n.catch((function(){console.warn("HTML5 Audio pool exhausted, returning potentially locked audio object.")})),new Audio},_releaseHtml5Audio:function(e){var n=this||t;return e._unlocked&&n._html5AudioPool.push(e),n},_autoSuspend:function(){var e=this;if(e.autoSuspend&&e.ctx&&void 0!==e.ctx.suspend&&t.usingWebAudio){for(var n=0;n<e._howls.length;n++)if(e._howls[n]._webAudio)for(var o=0;o<e._howls[n]._sounds.length;o++)if(!e._howls[n]._sounds[o]._paused)return e;return e._suspendTimer&&clearTimeout(e._suspendTimer),e._suspendTimer=setTimeout((function(){if(e.autoSuspend){e._suspendTimer=null,e.state="suspending";var n=function(){e.state="suspended",e._resumeAfterSuspend&&(delete e._resumeAfterSuspend,e._autoResume())};e.ctx.suspend().then(n,n)}}),3e4),e}},_autoResume:function(){var e=this;if(e.ctx&&void 0!==e.ctx.resume&&t.usingWebAudio)return"running"===e.state&&"interrupted"!==e.ctx.state&&e._suspendTimer?(clearTimeout(e._suspendTimer),e._suspendTimer=null):"suspended"===e.state||"running"===e.state&&"interrupted"===e.ctx.state?(e.ctx.resume().then((function(){e.state="running";for(var n=0;n<e._howls.length;n++)e._howls[n]._emit("resume")})),e._suspendTimer&&(clearTimeout(e._suspendTimer),e._suspendTimer=null)):"suspending"===e.state&&(e._resumeAfterSuspend=!0),e}};var t=new e,r=function(e){e.src&&0!==e.src.length?this.init(e):console.error("An array of source files must be passed with any new Howl.")};r.prototype={init:function(e){var n=this;return t.ctx||d(),n._autoplay=e.autoplay||!1,n._format="string"!=typeof e.format?e.format:[e.format],n._html5=e.html5||!1,n._muted=e.mute||!1,n._loop=e.loop||!1,n._pool=e.pool||5,n._preload="boolean"!=typeof e.preload&&"metadata"!==e.preload||e.preload,n._rate=e.rate||1,n._sprite=e.sprite||{},n._src="string"!=typeof e.src?e.src:[e.src],n._volume=void 0!==e.volume?e.volume:1,n._xhr={method:e.xhr&&e.xhr.method?e.xhr.method:"GET",headers:e.xhr&&e.xhr.headers?e.xhr.headers:null,withCredentials:!(!e.xhr||!e.xhr.withCredentials)&&e.xhr.withCredentials},n._duration=0,n._state="unloaded",n._sounds=[],n._endTimers={},n._queue=[],n._playLock=!1,n._onend=e.onend?[{fn:e.onend}]:[],n._onfade=e.onfade?[{fn:e.onfade}]:[],n._onload=e.onload?[{fn:e.onload}]:[],n._onloaderror=e.onloaderror?[{fn:e.onloaderror}]:[],n._onplayerror=e.onplayerror?[{fn:e.onplayerror}]:[],n._onpause=e.onpause?[{fn:e.onpause}]:[],n._onplay=e.onplay?[{fn:e.onplay}]:[],n._onstop=e.onstop?[{fn:e.onstop}]:[],n._onmute=e.onmute?[{fn:e.onmute}]:[],n._onvolume=e.onvolume?[{fn:e.onvolume}]:[],n._onrate=e.onrate?[{fn:e.onrate}]:[],n._onseek=e.onseek?[{fn:e.onseek}]:[],n._onunlock=e.onunlock?[{fn:e.onunlock}]:[],n._onresume=[],n._webAudio=t.usingWebAudio&&!n._html5,void 0!==t.ctx&&t.ctx&&t.autoUnlock&&t._unlockAudio(),t._howls.push(n),n._autoplay&&n._queue.push({event:"play",action:function(){n.play()}}),n._preload&&"none"!==n._preload&&n.load(),n},load:function(){var e=this,n=null;if(t.noAudio)e._emit("loaderror",null,"No audio support.");else{"string"==typeof e._src&&(e._src=[e._src]);for(var o=0;o<e._src.length;o++){var r,a;if(e._format&&e._format[o])r=e._format[o];else{if("string"!=typeof(a=e._src[o])){e._emit("loaderror",null,"Non-string found in selected audio sources - ignoring.");continue}(r=/^data:audio\/([^;,]+);/i.exec(a))||(r=/\.([^.]+)$/.exec(a.split("?",1)[0])),r&&(r=r[1].toLowerCase())}if(r||console.warn('No file extension was found. Consider using the "format" property or specify an extension.'),r&&t.codecs(r)){n=e._src[o];break}}if(n)return e._src=n,e._state="loading","https:"===window.location.protocol&&"http:"===n.slice(0,5)&&(e._html5=!0,e._webAudio=!1),new i(e),e._webAudio&&c(e),e;e._emit("loaderror",null,"No codec support for selected audio sources.")}},play:function(e,n){var o=this,r=null;if("number"==typeof e)r=e,e=null;else{if("string"==typeof e&&"loaded"===o._state&&!o._sprite[e])return null;if(void 0===e&&(e="__default",!o._playLock)){for(var i=0,a=0;a<o._sounds.length;a++)o._sounds[a]._paused&&!o._sounds[a]._ended&&(i++,r=o._sounds[a]._id);1===i?e=null:r=null}}var c=r?o._soundById(r):o._inactiveSound();if(!c)return null;if(r&&!e&&(e=c._sprite||"__default"),"loaded"!==o._state){c._sprite=e,c._ended=!1;var u=c._id;return o._queue.push({event:"play",action:function(){o.play(u)}}),u}if(r&&!c._paused)return n||o._loadQueue("play"),c._id;o._webAudio&&t._autoResume();var s=Math.max(0,c._seek>0?c._seek:o._sprite[e][0]/1e3),l=Math.max(0,(o._sprite[e][0]+o._sprite[e][1])/1e3-s),d=1e3*l/Math.abs(c._rate),f=o._sprite[e][0]/1e3,p=(o._sprite[e][0]+o._sprite[e][1])/1e3;c._sprite=e,c._ended=!1;var v=function(){c._paused=!1,c._seek=s,c._start=f,c._stop=p,c._loop=!(!c._loop&&!o._sprite[e][2])};if(!(s>=p)){var h=c._node;if(o._webAudio){var g=function(){o._playLock=!1,v(),o._refreshBuffer(c);var e=c._muted||o._muted?0:c._volume;h.gain.setValueAtTime(e,t.ctx.currentTime),c._playStart=t.ctx.currentTime,void 0===h.bufferSource.start?c._loop?h.bufferSource.noteGrainOn(0,s,86400):h.bufferSource.noteGrainOn(0,s,l):c._loop?h.bufferSource.start(0,s,86400):h.bufferSource.start(0,s,l),d!==1/0&&(o._endTimers[c._id]=setTimeout(o._ended.bind(o,c),d)),n||setTimeout((function(){o._emit("play",c._id),o._loadQueue()}),0)};"running"===t.state&&"interrupted"!==t.ctx.state?g():(o._playLock=!0,o.once("resume",g),o._clearTimer(c._id))}else{var m=function(){h.currentTime=s,h.muted=c._muted||o._muted||t._muted||h.muted,h.volume=c._volume*t.volume(),h.playbackRate=c._rate;try{var r=h.play();if(r&&"undefined"!=typeof Promise&&(r instanceof Promise||"function"==typeof r.then)?(o._playLock=!0,v(),r.then((function(){o._playLock=!1,h._unlocked=!0,n?o._loadQueue():o._emit("play",c._id)})).catch((function(){o._playLock=!1,o._emit("playerror",c._id,"Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction."),c._ended=!0,c._paused=!0}))):n||(o._playLock=!1,v(),o._emit("play",c._id)),h.playbackRate=c._rate,h.paused)return void o._emit("playerror",c._id,"Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction.");"__default"!==e||c._loop?o._endTimers[c._id]=setTimeout(o._ended.bind(o,c),d):(o._endTimers[c._id]=function(){o._ended(c),h.removeEventListener("ended",o._endTimers[c._id],!1)},h.addEventListener("ended",o._endTimers[c._id],!1))}catch(e){o._emit("playerror",c._id,e)}};"data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA"===h.src&&(h.src=o._src,h.load());var w=window&&window.ejecta||!h.readyState&&t._navigator.isCocoonJS;if(h.readyState>=3||w)m();else{o._playLock=!0,o._state="loading";var y=function(){o._state="loaded",m(),h.removeEventListener(t._canPlayEvent,y,!1)};h.addEventListener(t._canPlayEvent,y,!1),o._clearTimer(c._id)}}return c._id}o._ended(c)},pause:function(e){var n=this;if("loaded"!==n._state||n._playLock)return n._queue.push({event:"pause",action:function(){n.pause(e)}}),n;for(var t=n._getSoundIds(e),o=0;o<t.length;o++){n._clearTimer(t[o]);var r=n._soundById(t[o]);if(r&&!r._paused&&(r._seek=n.seek(t[o]),r._rateSeek=0,r._paused=!0,n._stopFade(t[o]),r._node))if(n._webAudio){if(!r._node.bufferSource)continue;void 0===r._node.bufferSource.stop?r._node.bufferSource.noteOff(0):r._node.bufferSource.stop(0),n._cleanBuffer(r._node)}else isNaN(r._node.duration)&&r._node.duration!==1/0||r._node.pause();arguments[1]||n._emit("pause",r?r._id:null)}return n},stop:function(e,n){var t=this;if("loaded"!==t._state||t._playLock)return t._queue.push({event:"stop",action:function(){t.stop(e)}}),t;for(var o=t._getSoundIds(e),r=0;r<o.length;r++){t._clearTimer(o[r]);var i=t._soundById(o[r]);i&&(i._seek=i._start||0,i._rateSeek=0,i._paused=!0,i._ended=!0,t._stopFade(o[r]),i._node&&(t._webAudio?i._node.bufferSource&&(void 0===i._node.bufferSource.stop?i._node.bufferSource.noteOff(0):i._node.bufferSource.stop(0),t._cleanBuffer(i._node)):isNaN(i._node.duration)&&i._node.duration!==1/0||(i._node.currentTime=i._start||0,i._node.pause(),i._node.duration===1/0&&t._clearSound(i._node))),n||t._emit("stop",i._id))}return t},mute:function(e,n){var o=this;if("loaded"!==o._state||o._playLock)return o._queue.push({event:"mute",action:function(){o.mute(e,n)}}),o;if(void 0===n){if("boolean"!=typeof e)return o._muted;o._muted=e}for(var r=o._getSoundIds(n),i=0;i<r.length;i++){var a=o._soundById(r[i]);a&&(a._muted=e,a._interval&&o._stopFade(a._id),o._webAudio&&a._node?a._node.gain.setValueAtTime(e?0:a._volume,t.ctx.currentTime):a._node&&(a._node.muted=!!t._muted||e),o._emit("mute",a._id))}return o},volume:function(){var e,n,o,r=this,i=arguments;if(0===i.length)return r._volume;if(1===i.length||2===i.length&&void 0===i[1]?r._getSoundIds().indexOf(i[0])>=0?n=parseInt(i[0],10):e=parseFloat(i[0]):i.length>=2&&(e=parseFloat(i[0]),n=parseInt(i[1],10)),!(void 0!==e&&e>=0&&e<=1))return(o=n?r._soundById(n):r._sounds[0])?o._volume:0;if("loaded"!==r._state||r._playLock)return r._queue.push({event:"volume",action:function(){r.volume.apply(r,i)}}),r;void 0===n&&(r._volume=e),n=r._getSoundIds(n);for(var a=0;a<n.length;a++)(o=r._soundById(n[a]))&&(o._volume=e,i[2]||r._stopFade(n[a]),r._webAudio&&o._node&&!o._muted?o._node.gain.setValueAtTime(e,t.ctx.currentTime):o._node&&!o._muted&&(o._node.volume=e*t.volume()),r._emit("volume",o._id));return r},fade:function(e,n,o,r){var i=this;if("loaded"!==i._state||i._playLock)return i._queue.push({event:"fade",action:function(){i.fade(e,n,o,r)}}),i;e=Math.min(Math.max(0,parseFloat(e)),1),n=Math.min(Math.max(0,parseFloat(n)),1),o=parseFloat(o),i.volume(e,r);for(var a=i._getSoundIds(r),c=0;c<a.length;c++){var u=i._soundById(a[c]);if(u){if(r||i._stopFade(a[c]),i._webAudio&&!u._muted){var s=t.ctx.currentTime,l=s+o/1e3;u._volume=e,u._node.gain.setValueAtTime(e,s),u._node.gain.linearRampToValueAtTime(n,l)}i._startFadeInterval(u,e,n,o,a[c],void 0===r)}}return i},_startFadeInterval:function(e,n,t,o,r,i){var a=this,c=n,u=t-n,s=Math.abs(u/.01),l=Math.max(4,s>0?o/s:o),d=Date.now();e._fadeTo=t,e._interval=setInterval((function(){var r=(Date.now()-d)/o;d=Date.now(),c+=u*r,c=Math.round(100*c)/100,c=u<0?Math.max(t,c):Math.min(t,c),a._webAudio?e._volume=c:a.volume(c,e._id,!0),i&&(a._volume=c),(t<n&&c<=t||t>n&&c>=t)&&(clearInterval(e._interval),e._interval=null,e._fadeTo=null,a.volume(t,e._id),a._emit("fade",e._id))}),l)},_stopFade:function(e){var n=this,o=n._soundById(e);return o&&o._interval&&(n._webAudio&&o._node.gain.cancelScheduledValues(t.ctx.currentTime),clearInterval(o._interval),o._interval=null,n.volume(o._fadeTo,e),o._fadeTo=null,n._emit("fade",e)),n},loop:function(){var e,n,t,o=this,r=arguments;if(0===r.length)return o._loop;if(1===r.length){if("boolean"!=typeof r[0])return!!(t=o._soundById(parseInt(r[0],10)))&&t._loop;e=r[0],o._loop=e}else 2===r.length&&(e=r[0],n=parseInt(r[1],10));for(var i=o._getSoundIds(n),a=0;a<i.length;a++)(t=o._soundById(i[a]))&&(t._loop=e,o._webAudio&&t._node&&t._node.bufferSource&&(t._node.bufferSource.loop=e,e&&(t._node.bufferSource.loopStart=t._start||0,t._node.bufferSource.loopEnd=t._stop,o.playing(i[a])&&(o.pause(i[a],!0),o.play(i[a],!0)))));return o},rate:function(){var e,n,o,r=this,i=arguments;if(0===i.length)n=r._sounds[0]._id;else if(1===i.length){r._getSoundIds().indexOf(i[0])>=0?n=parseInt(i[0],10):e=parseFloat(i[0])}else 2===i.length&&(e=parseFloat(i[0]),n=parseInt(i[1],10));if("number"!=typeof e)return(o=r._soundById(n))?o._rate:r._rate;if("loaded"!==r._state||r._playLock)return r._queue.push({event:"rate",action:function(){r.rate.apply(r,i)}}),r;void 0===n&&(r._rate=e),n=r._getSoundIds(n);for(var a=0;a<n.length;a++)if(o=r._soundById(n[a])){r.playing(n[a])&&(o._rateSeek=r.seek(n[a]),o._playStart=r._webAudio?t.ctx.currentTime:o._playStart),o._rate=e,r._webAudio&&o._node&&o._node.bufferSource?o._node.bufferSource.playbackRate.setValueAtTime(e,t.ctx.currentTime):o._node&&(o._node.playbackRate=e);var c=r.seek(n[a]),u=1e3*((r._sprite[o._sprite][0]+r._sprite[o._sprite][1])/1e3-c)/Math.abs(o._rate);!r._endTimers[n[a]]&&o._paused||(r._clearTimer(n[a]),r._endTimers[n[a]]=setTimeout(r._ended.bind(r,o),u)),r._emit("rate",o._id)}return r},seek:function(){var e,n,o=this,r=arguments;if(0===r.length)o._sounds.length&&(n=o._sounds[0]._id);else if(1===r.length){o._getSoundIds().indexOf(r[0])>=0?n=parseInt(r[0],10):o._sounds.length&&(n=o._sounds[0]._id,e=parseFloat(r[0]))}else 2===r.length&&(e=parseFloat(r[0]),n=parseInt(r[1],10));if(void 0===n)return 0;if("number"==typeof e&&("loaded"!==o._state||o._playLock))return o._queue.push({event:"seek",action:function(){o.seek.apply(o,r)}}),o;var i=o._soundById(n);if(i){if(!("number"==typeof e&&e>=0)){if(o._webAudio){var a=o.playing(n)?t.ctx.currentTime-i._playStart:0,c=i._rateSeek?i._rateSeek-i._seek:0;return i._seek+(c+a*Math.abs(i._rate))}return i._node.currentTime}var u=o.playing(n);u&&o.pause(n,!0),i._seek=e,i._ended=!1,o._clearTimer(n),o._webAudio||!i._node||isNaN(i._node.duration)||(i._node.currentTime=e);var s=function(){u&&o.play(n,!0),o._emit("seek",n)};if(u&&!o._webAudio){var l=function(){o._playLock?setTimeout(l,0):s()};setTimeout(l,0)}else s()}return o},playing:function(e){var n=this;if("number"==typeof e){var t=n._soundById(e);return!!t&&!t._paused}for(var o=0;o<n._sounds.length;o++)if(!n._sounds[o]._paused)return!0;return!1},duration:function(e){var n=this,t=n._duration,o=n._soundById(e);return o&&(t=n._sprite[o._sprite][1]/1e3),t},state:function(){return this._state},unload:function(){for(var e=this,n=e._sounds,o=0;o<n.length;o++)n[o]._paused||e.stop(n[o]._id),e._webAudio||(e._clearSound(n[o]._node),n[o]._node.removeEventListener("error",n[o]._errorFn,!1),n[o]._node.removeEventListener(t._canPlayEvent,n[o]._loadFn,!1),n[o]._node.removeEventListener("ended",n[o]._endFn,!1),t._releaseHtml5Audio(n[o]._node)),delete n[o]._node,e._clearTimer(n[o]._id);var r=t._howls.indexOf(e);r>=0&&t._howls.splice(r,1);var i=!0;for(o=0;o<t._howls.length;o++)if(t._howls[o]._src===e._src||e._src.indexOf(t._howls[o]._src)>=0){i=!1;break}return a&&i&&delete a[e._src],t.noAudio=!1,e._state="unloaded",e._sounds=[],e=null,null},on:function(e,n,t,o){var r=this["_on"+e];return"function"==typeof n&&r.push(o?{id:t,fn:n,once:o}:{id:t,fn:n}),this},off:function(e,n,t){var o=this,r=o["_on"+e],i=0;if("number"==typeof n&&(t=n,n=null),n||t)for(i=0;i<r.length;i++){var a=t===r[i].id;if(n===r[i].fn&&a||!n&&a){r.splice(i,1);break}}else if(e)o["_on"+e]=[];else{var c=Object.keys(o);for(i=0;i<c.length;i++)0===c[i].indexOf("_on")&&Array.isArray(o[c[i]])&&(o[c[i]]=[])}return o},once:function(e,n,t){return this.on(e,n,t,1),this},_emit:function(e,n,t){for(var o=this,r=o["_on"+e],i=r.length-1;i>=0;i--)r[i].id&&r[i].id!==n&&"load"!==e||(setTimeout(function(e){e.call(this,n,t)}.bind(o,r[i].fn),0),r[i].once&&o.off(e,r[i].fn,r[i].id));return o._loadQueue(e),o},_loadQueue:function(e){var n=this;if(n._queue.length>0){var t=n._queue[0];t.event===e&&(n._queue.shift(),n._loadQueue()),e||t.action()}return n},_ended:function(e){var n=this,o=e._sprite;if(!n._webAudio&&e._node&&!e._node.paused&&!e._node.ended&&e._node.currentTime<e._stop)return setTimeout(n._ended.bind(n,e),100),n;var r=!(!e._loop&&!n._sprite[o][2]);if(n._emit("end",e._id),!n._webAudio&&r&&n.stop(e._id,!0).play(e._id),n._webAudio&&r){n._emit("play",e._id),e._seek=e._start||0,e._rateSeek=0,e._playStart=t.ctx.currentTime;var i=1e3*(e._stop-e._start)/Math.abs(e._rate);n._endTimers[e._id]=setTimeout(n._ended.bind(n,e),i)}return n._webAudio&&!r&&(e._paused=!0,e._ended=!0,e._seek=e._start||0,e._rateSeek=0,n._clearTimer(e._id),n._cleanBuffer(e._node),t._autoSuspend()),n._webAudio||r||n.stop(e._id,!0),n},_clearTimer:function(e){var n=this;if(n._endTimers[e]){if("function"!=typeof n._endTimers[e])clearTimeout(n._endTimers[e]);else{var t=n._soundById(e);t&&t._node&&t._node.removeEventListener("ended",n._endTimers[e],!1)}delete n._endTimers[e]}return n},_soundById:function(e){for(var n=this,t=0;t<n._sounds.length;t++)if(e===n._sounds[t]._id)return n._sounds[t];return null},_inactiveSound:function(){var e=this;e._drain();for(var n=0;n<e._sounds.length;n++)if(e._sounds[n]._ended)return e._sounds[n].reset();return new i(e)},_drain:function(){var e=this,n=e._pool,t=0,o=0;if(!(e._sounds.length<n)){for(o=0;o<e._sounds.length;o++)e._sounds[o]._ended&&t++;for(o=e._sounds.length-1;o>=0;o--){if(t<=n)return;e._sounds[o]._ended&&(e._webAudio&&e._sounds[o]._node&&e._sounds[o]._node.disconnect(0),e._sounds.splice(o,1),t--)}}},_getSoundIds:function(e){if(void 0===e){for(var n=[],t=0;t<this._sounds.length;t++)n.push(this._sounds[t]._id);return n}return[e]},_refreshBuffer:function(e){return e._node.bufferSource=t.ctx.createBufferSource(),e._node.bufferSource.buffer=a[this._src],e._panner?e._node.bufferSource.connect(e._panner):e._node.bufferSource.connect(e._node),e._node.bufferSource.loop=e._loop,e._loop&&(e._node.bufferSource.loopStart=e._start||0,e._node.bufferSource.loopEnd=e._stop||0),e._node.bufferSource.playbackRate.setValueAtTime(e._rate,t.ctx.currentTime),this},_cleanBuffer:function(e){var n=t._navigator&&t._navigator.vendor.indexOf("Apple")>=0;if(!e.bufferSource)return this;if(t._scratchBuffer&&e.bufferSource&&(e.bufferSource.onended=null,e.bufferSource.disconnect(0),n))try{e.bufferSource.buffer=t._scratchBuffer}catch(e){}return e.bufferSource=null,this},_clearSound:function(e){/MSIE |Trident\//.test(t._navigator&&t._navigator.userAgent)||(e.src="data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA")}};var i=function(e){this._parent=e,this.init()};i.prototype={init:function(){var e=this,n=e._parent;return e._muted=n._muted,e._loop=n._loop,e._volume=n._volume,e._rate=n._rate,e._seek=0,e._paused=!0,e._ended=!0,e._sprite="__default",e._id=++t._counter,n._sounds.push(e),e.create(),e},create:function(){var e=this,n=e._parent,o=t._muted||e._muted||e._parent._muted?0:e._volume;return n._webAudio?(e._node=void 0===t.ctx.createGain?t.ctx.createGainNode():t.ctx.createGain(),e._node.gain.setValueAtTime(o,t.ctx.currentTime),e._node.paused=!0,e._node.connect(t.masterGain)):t.noAudio||(e._node=t._obtainHtml5Audio(),e._errorFn=e._errorListener.bind(e),e._node.addEventListener("error",e._errorFn,!1),e._loadFn=e._loadListener.bind(e),e._node.addEventListener(t._canPlayEvent,e._loadFn,!1),e._endFn=e._endListener.bind(e),e._node.addEventListener("ended",e._endFn,!1),e._node.src=n._src,e._node.preload=!0===n._preload?"auto":n._preload,e._node.volume=o*t.volume(),e._node.load()),e},reset:function(){var e=this,n=e._parent;return e._muted=n._muted,e._loop=n._loop,e._volume=n._volume,e._rate=n._rate,e._seek=0,e._rateSeek=0,e._paused=!0,e._ended=!0,e._sprite="__default",e._id=++t._counter,e},_errorListener:function(){var e=this;e._parent._emit("loaderror",e._id,e._node.error?e._node.error.code:0),e._node.removeEventListener("error",e._errorFn,!1)},_loadListener:function(){var e=this,n=e._parent;n._duration=Math.ceil(10*e._node.duration)/10,0===Object.keys(n._sprite).length&&(n._sprite={__default:[0,1e3*n._duration]}),"loaded"!==n._state&&(n._state="loaded",n._emit("load"),n._loadQueue()),e._node.removeEventListener(t._canPlayEvent,e._loadFn,!1)},_endListener:function(){var e=this,n=e._parent;n._duration===1/0&&(n._duration=Math.ceil(10*e._node.duration)/10,n._sprite.__default[1]===1/0&&(n._sprite.__default[1]=1e3*n._duration),n._ended(e)),e._node.removeEventListener("ended",e._endFn,!1)}};var a={},c=function(e){var n=e._src;if(a[n])return e._duration=a[n].duration,void l(e);if(/^data:[^;]+;base64,/.test(n)){for(var t=atob(n.split(",")[1]),o=new Uint8Array(t.length),r=0;r<t.length;++r)o[r]=t.charCodeAt(r);s(o.buffer,e)}else{var i=new XMLHttpRequest;i.open(e._xhr.method,n,!0),i.withCredentials=e._xhr.withCredentials,i.responseType="arraybuffer",e._xhr.headers&&Object.keys(e._xhr.headers).forEach((function(n){i.setRequestHeader(n,e._xhr.headers[n])})),i.onload=function(){var n=(i.status+"")[0];"0"===n||"2"===n||"3"===n?s(i.response,e):e._emit("loaderror",null,"Failed loading audio file with status: "+i.status+".")},i.onerror=function(){e._webAudio&&(e._html5=!0,e._webAudio=!1,e._sounds=[],delete a[n],e.load())},u(i)}},u=function(e){try{e.send()}catch(n){e.onerror()}},s=function(e,n){var o=function(){n._emit("loaderror",null,"Decoding audio data failed.")},r=function(e){e&&n._sounds.length>0?(a[n._src]=e,l(n,e)):o()};"undefined"!=typeof Promise&&1===t.ctx.decodeAudioData.length?t.ctx.decodeAudioData(e).then(r).catch(o):t.ctx.decodeAudioData(e,r,o)},l=function(e,n){n&&!e._duration&&(e._duration=n.duration),0===Object.keys(e._sprite).length&&(e._sprite={__default:[0,1e3*e._duration]}),"loaded"!==e._state&&(e._state="loaded",e._emit("load"),e._loadQueue())},d=function(){if(t.usingWebAudio){try{"undefined"!=typeof AudioContext?t.ctx=new AudioContext:"undefined"!=typeof webkitAudioContext?t.ctx=new webkitAudioContext:t.usingWebAudio=!1}catch(e){t.usingWebAudio=!1}t.ctx||(t.usingWebAudio=!1);var e=/iP(hone|od|ad)/.test(t._navigator&&t._navigator.platform),n=t._navigator&&t._navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/),o=n?parseInt(n[1],10):null;if(e&&o&&o<9){var r=/safari/.test(t._navigator&&t._navigator.userAgent.toLowerCase());t._navigator&&!r&&(t.usingWebAudio=!1)}t.usingWebAudio&&(t.masterGain=void 0===t.ctx.createGain?t.ctx.createGainNode():t.ctx.createGain(),t.masterGain.gain.setValueAtTime(t._muted?0:t._volume,t.ctx.currentTime),t.masterGain.connect(t.ctx.destination)),t._setup()}};n.Howler=t,n.Howl=r,void 0!==o?(o.HowlerGlobal=e,o.Howler=t,o.Howl=r,o.Sound=i):"undefined"!=typeof window&&(window.HowlerGlobal=e,window.Howler=t,window.Howl=r,window.Sound=i)}(),
|
30
|
+
!function(){var e=function(){this.init()};e.prototype={init:function(){var e=this||t;return e._counter=1e3,e._html5AudioPool=[],e.html5PoolSize=10,e._codecs={},e._howls=[],e._muted=!1,e._volume=1,e._canPlayEvent="canplaythrough",e._navigator="undefined"!=typeof window&&window.navigator?window.navigator:null,e.masterGain=null,e.noAudio=!1,e.usingWebAudio=!0,e.autoSuspend=!0,e.ctx=null,e.autoUnlock=!0,e._setup(),e},volume:function(e){var n=this||t;if(e=parseFloat(e),n.ctx||l(),void 0!==e&&e>=0&&e<=1){if(n._volume=e,n._muted)return n;n.usingWebAudio&&n.masterGain.gain.setValueAtTime(e,t.ctx.currentTime);for(var r=0;r<n._howls.length;r++)if(!n._howls[r]._webAudio)for(var o=n._howls[r]._getSoundIds(),i=0;i<o.length;i++){var a=n._howls[r]._soundById(o[i]);a&&a._node&&(a._node.volume=a._volume*e)}return n}return n._volume},mute:function(e){var n=this||t;n.ctx||l(),n._muted=e,n.usingWebAudio&&n.masterGain.gain.setValueAtTime(e?0:n._volume,t.ctx.currentTime);for(var r=0;r<n._howls.length;r++)if(!n._howls[r]._webAudio)for(var o=n._howls[r]._getSoundIds(),i=0;i<o.length;i++){var a=n._howls[r]._soundById(o[i]);a&&a._node&&(a._node.muted=!!e||a._muted)}return n},stop:function(){for(var e=this||t,n=0;n<e._howls.length;n++)e._howls[n].stop();return e},unload:function(){for(var e=this||t,n=e._howls.length-1;n>=0;n--)e._howls[n].unload();return e.usingWebAudio&&e.ctx&&void 0!==e.ctx.close&&(e.ctx.close(),e.ctx=null,l()),e},codecs:function(e){return(this||t)._codecs[e.replace(/^x-/,"")]},_setup:function(){var e=this||t;if(e.state=e.ctx&&e.ctx.state||"suspended",e._autoSuspend(),!e.usingWebAudio)if("undefined"!=typeof Audio)try{void 0===(new Audio).oncanplaythrough&&(e._canPlayEvent="canplay")}catch(n){e.noAudio=!0}else e.noAudio=!0;try{(new Audio).muted&&(e.noAudio=!0)}catch(e){}return e.noAudio||e._setupCodecs(),e},_setupCodecs:function(){var e=this||t,n=null;try{n="undefined"!=typeof Audio?new Audio:null}catch(n){return e}if(!n||"function"!=typeof n.canPlayType)return e;var r=n.canPlayType("audio/mpeg;").replace(/^no$/,""),o=e._navigator?e._navigator.userAgent:"",i=o.match(/OPR\/(\d+)/g),a=i&&parseInt(i[0].split("/")[1],10)<33,s=-1!==o.indexOf("Safari")&&-1===o.indexOf("Chrome"),u=o.match(/Version\/(.*?) /),c=s&&u&&parseInt(u[1],10)<15;return e._codecs={mp3:!(a||!r&&!n.canPlayType("audio/mp3;").replace(/^no$/,"")),mpeg:!!r,opus:!!n.canPlayType('audio/ogg; codecs="opus"').replace(/^no$/,""),ogg:!!n.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),oga:!!n.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),wav:!!(n.canPlayType('audio/wav; codecs="1"')||n.canPlayType("audio/wav")).replace(/^no$/,""),aac:!!n.canPlayType("audio/aac;").replace(/^no$/,""),caf:!!n.canPlayType("audio/x-caf;").replace(/^no$/,""),m4a:!!(n.canPlayType("audio/x-m4a;")||n.canPlayType("audio/m4a;")||n.canPlayType("audio/aac;")).replace(/^no$/,""),m4b:!!(n.canPlayType("audio/x-m4b;")||n.canPlayType("audio/m4b;")||n.canPlayType("audio/aac;")).replace(/^no$/,""),mp4:!!(n.canPlayType("audio/x-mp4;")||n.canPlayType("audio/mp4;")||n.canPlayType("audio/aac;")).replace(/^no$/,""),weba:!(c||!n.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),webm:!(c||!n.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),dolby:!!n.canPlayType('audio/mp4; codecs="ec-3"').replace(/^no$/,""),flac:!!(n.canPlayType("audio/x-flac;")||n.canPlayType("audio/flac;")).replace(/^no$/,"")},e},_unlockAudio:function(){var e=this||t;if(!e._audioUnlocked&&e.ctx){e._audioUnlocked=!1,e.autoUnlock=!1,e._mobileUnloaded||44100===e.ctx.sampleRate||(e._mobileUnloaded=!0,e.unload()),e._scratchBuffer=e.ctx.createBuffer(1,1,22050);var n=function(t){for(;e._html5AudioPool.length<e.html5PoolSize;)try{var r=new Audio;r._unlocked=!0,e._releaseHtml5Audio(r)}catch(t){e.noAudio=!0;break}for(var o=0;o<e._howls.length;o++)if(!e._howls[o]._webAudio)for(var i=e._howls[o]._getSoundIds(),a=0;a<i.length;a++){var s=e._howls[o]._soundById(i[a]);s&&s._node&&!s._node._unlocked&&(s._node._unlocked=!0,s._node.load())}e._autoResume();var u=e.ctx.createBufferSource();u.buffer=e._scratchBuffer,u.connect(e.ctx.destination),void 0===u.start?u.noteOn(0):u.start(0),"function"==typeof e.ctx.resume&&e.ctx.resume(),u.onended=function(){u.disconnect(0),e._audioUnlocked=!0,document.removeEventListener("touchstart",n,!0),document.removeEventListener("touchend",n,!0),document.removeEventListener("click",n,!0),document.removeEventListener("keydown",n,!0);for(var t=0;t<e._howls.length;t++)e._howls[t]._emit("unlock")}};return document.addEventListener("touchstart",n,!0),document.addEventListener("touchend",n,!0),document.addEventListener("click",n,!0),document.addEventListener("keydown",n,!0),e}},_obtainHtml5Audio:function(){var e=this||t;if(e._html5AudioPool.length)return e._html5AudioPool.pop();var n=(new Audio).play();return n&&"undefined"!=typeof Promise&&(n instanceof Promise||"function"==typeof n.then)&&n.catch((function(){console.warn("HTML5 Audio pool exhausted, returning potentially locked audio object.")})),new Audio},_releaseHtml5Audio:function(e){var n=this||t;return e._unlocked&&n._html5AudioPool.push(e),n},_autoSuspend:function(){var e=this;if(e.autoSuspend&&e.ctx&&void 0!==e.ctx.suspend&&t.usingWebAudio){for(var n=0;n<e._howls.length;n++)if(e._howls[n]._webAudio)for(var r=0;r<e._howls[n]._sounds.length;r++)if(!e._howls[n]._sounds[r]._paused)return e;return e._suspendTimer&&clearTimeout(e._suspendTimer),e._suspendTimer=setTimeout((function(){if(e.autoSuspend){e._suspendTimer=null,e.state="suspending";var n=function(){e.state="suspended",e._resumeAfterSuspend&&(delete e._resumeAfterSuspend,e._autoResume())};e.ctx.suspend().then(n,n)}}),3e4),e}},_autoResume:function(){var e=this;if(e.ctx&&void 0!==e.ctx.resume&&t.usingWebAudio)return"running"===e.state&&"interrupted"!==e.ctx.state&&e._suspendTimer?(clearTimeout(e._suspendTimer),e._suspendTimer=null):"suspended"===e.state||"running"===e.state&&"interrupted"===e.ctx.state?(e.ctx.resume().then((function(){e.state="running";for(var n=0;n<e._howls.length;n++)e._howls[n]._emit("resume")})),e._suspendTimer&&(clearTimeout(e._suspendTimer),e._suspendTimer=null)):"suspending"===e.state&&(e._resumeAfterSuspend=!0),e}};var t=new e,o=function(e){e.src&&0!==e.src.length?this.init(e):console.error("An array of source files must be passed with any new Howl.")};o.prototype={init:function(e){var n=this;return t.ctx||l(),n._autoplay=e.autoplay||!1,n._format="string"!=typeof e.format?e.format:[e.format],n._html5=e.html5||!1,n._muted=e.mute||!1,n._loop=e.loop||!1,n._pool=e.pool||5,n._preload="boolean"!=typeof e.preload&&"metadata"!==e.preload||e.preload,n._rate=e.rate||1,n._sprite=e.sprite||{},n._src="string"!=typeof e.src?e.src:[e.src],n._volume=void 0!==e.volume?e.volume:1,n._xhr={method:e.xhr&&e.xhr.method?e.xhr.method:"GET",headers:e.xhr&&e.xhr.headers?e.xhr.headers:null,withCredentials:!(!e.xhr||!e.xhr.withCredentials)&&e.xhr.withCredentials},n._duration=0,n._state="unloaded",n._sounds=[],n._endTimers={},n._queue=[],n._playLock=!1,n._onend=e.onend?[{fn:e.onend}]:[],n._onfade=e.onfade?[{fn:e.onfade}]:[],n._onload=e.onload?[{fn:e.onload}]:[],n._onloaderror=e.onloaderror?[{fn:e.onloaderror}]:[],n._onplayerror=e.onplayerror?[{fn:e.onplayerror}]:[],n._onpause=e.onpause?[{fn:e.onpause}]:[],n._onplay=e.onplay?[{fn:e.onplay}]:[],n._onstop=e.onstop?[{fn:e.onstop}]:[],n._onmute=e.onmute?[{fn:e.onmute}]:[],n._onvolume=e.onvolume?[{fn:e.onvolume}]:[],n._onrate=e.onrate?[{fn:e.onrate}]:[],n._onseek=e.onseek?[{fn:e.onseek}]:[],n._onunlock=e.onunlock?[{fn:e.onunlock}]:[],n._onresume=[],n._webAudio=t.usingWebAudio&&!n._html5,void 0!==t.ctx&&t.ctx&&t.autoUnlock&&t._unlockAudio(),t._howls.push(n),n._autoplay&&n._queue.push({event:"play",action:function(){n.play()}}),n._preload&&"none"!==n._preload&&n.load(),n},load:function(){var e=this,n=null;if(t.noAudio)e._emit("loaderror",null,"No audio support.");else{"string"==typeof e._src&&(e._src=[e._src]);for(var r=0;r<e._src.length;r++){var o,a;if(e._format&&e._format[r])o=e._format[r];else{if("string"!=typeof(a=e._src[r])){e._emit("loaderror",null,"Non-string found in selected audio sources - ignoring.");continue}(o=/^data:audio\/([^;,]+);/i.exec(a))||(o=/\.([^.]+)$/.exec(a.split("?",1)[0])),o&&(o=o[1].toLowerCase())}if(o||console.warn('No file extension was found. Consider using the "format" property or specify an extension.'),o&&t.codecs(o)){n=e._src[r];break}}if(n)return e._src=n,e._state="loading","https:"===window.location.protocol&&"http:"===n.slice(0,5)&&(e._html5=!0,e._webAudio=!1),new i(e),e._webAudio&&s(e),e;e._emit("loaderror",null,"No codec support for selected audio sources.")}},play:function(e,n){var r=this,o=null;if("number"==typeof e)o=e,e=null;else{if("string"==typeof e&&"loaded"===r._state&&!r._sprite[e])return null;if(void 0===e&&(e="__default",!r._playLock)){for(var i=0,a=0;a<r._sounds.length;a++)r._sounds[a]._paused&&!r._sounds[a]._ended&&(i++,o=r._sounds[a]._id);1===i?e=null:o=null}}var s=o?r._soundById(o):r._inactiveSound();if(!s)return null;if(o&&!e&&(e=s._sprite||"__default"),"loaded"!==r._state){s._sprite=e,s._ended=!1;var u=s._id;return r._queue.push({event:"play",action:function(){r.play(u)}}),u}if(o&&!s._paused)return n||r._loadQueue("play"),s._id;r._webAudio&&t._autoResume();var c=Math.max(0,s._seek>0?s._seek:r._sprite[e][0]/1e3),d=Math.max(0,(r._sprite[e][0]+r._sprite[e][1])/1e3-c),l=1e3*d/Math.abs(s._rate),f=r._sprite[e][0]/1e3,p=(r._sprite[e][0]+r._sprite[e][1])/1e3;s._sprite=e,s._ended=!1;var v=function(){s._paused=!1,s._seek=c,s._start=f,s._stop=p,s._loop=!(!s._loop&&!r._sprite[e][2])};if(!(c>=p)){var h=s._node;if(r._webAudio){var _=function(){r._playLock=!1,v(),r._refreshBuffer(s);var e=s._muted||r._muted?0:s._volume;h.gain.setValueAtTime(e,t.ctx.currentTime),s._playStart=t.ctx.currentTime,void 0===h.bufferSource.start?s._loop?h.bufferSource.noteGrainOn(0,c,86400):h.bufferSource.noteGrainOn(0,c,d):s._loop?h.bufferSource.start(0,c,86400):h.bufferSource.start(0,c,d),l!==1/0&&(r._endTimers[s._id]=setTimeout(r._ended.bind(r,s),l)),n||setTimeout((function(){r._emit("play",s._id),r._loadQueue()}),0)};"running"===t.state&&"interrupted"!==t.ctx.state?_():(r._playLock=!0,r.once("resume",_),r._clearTimer(s._id))}else{var m=function(){h.currentTime=c,h.muted=s._muted||r._muted||t._muted||h.muted,h.volume=s._volume*t.volume(),h.playbackRate=s._rate;try{var o=h.play();if(o&&"undefined"!=typeof Promise&&(o instanceof Promise||"function"==typeof o.then)?(r._playLock=!0,v(),o.then((function(){r._playLock=!1,h._unlocked=!0,n?r._loadQueue():r._emit("play",s._id)})).catch((function(){r._playLock=!1,r._emit("playerror",s._id,"Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction."),s._ended=!0,s._paused=!0}))):n||(r._playLock=!1,v(),r._emit("play",s._id)),h.playbackRate=s._rate,h.paused)return void r._emit("playerror",s._id,"Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction.");"__default"!==e||s._loop?r._endTimers[s._id]=setTimeout(r._ended.bind(r,s),l):(r._endTimers[s._id]=function(){r._ended(s),h.removeEventListener("ended",r._endTimers[s._id],!1)},h.addEventListener("ended",r._endTimers[s._id],!1))}catch(e){r._emit("playerror",s._id,e)}};"data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA"===h.src&&(h.src=r._src,h.load());var g=window&&window.ejecta||!h.readyState&&t._navigator.isCocoonJS;if(h.readyState>=3||g)m();else{r._playLock=!0,r._state="loading";var w=function(){r._state="loaded",m(),h.removeEventListener(t._canPlayEvent,w,!1)};h.addEventListener(t._canPlayEvent,w,!1),r._clearTimer(s._id)}}return s._id}r._ended(s)},pause:function(e){var n=this;if("loaded"!==n._state||n._playLock)return n._queue.push({event:"pause",action:function(){n.pause(e)}}),n;for(var t=n._getSoundIds(e),r=0;r<t.length;r++){n._clearTimer(t[r]);var o=n._soundById(t[r]);if(o&&!o._paused&&(o._seek=n.seek(t[r]),o._rateSeek=0,o._paused=!0,n._stopFade(t[r]),o._node))if(n._webAudio){if(!o._node.bufferSource)continue;void 0===o._node.bufferSource.stop?o._node.bufferSource.noteOff(0):o._node.bufferSource.stop(0),n._cleanBuffer(o._node)}else isNaN(o._node.duration)&&o._node.duration!==1/0||o._node.pause();arguments[1]||n._emit("pause",o?o._id:null)}return n},stop:function(e,n){var t=this;if("loaded"!==t._state||t._playLock)return t._queue.push({event:"stop",action:function(){t.stop(e)}}),t;for(var r=t._getSoundIds(e),o=0;o<r.length;o++){t._clearTimer(r[o]);var i=t._soundById(r[o]);i&&(i._seek=i._start||0,i._rateSeek=0,i._paused=!0,i._ended=!0,t._stopFade(r[o]),i._node&&(t._webAudio?i._node.bufferSource&&(void 0===i._node.bufferSource.stop?i._node.bufferSource.noteOff(0):i._node.bufferSource.stop(0),t._cleanBuffer(i._node)):isNaN(i._node.duration)&&i._node.duration!==1/0||(i._node.currentTime=i._start||0,i._node.pause(),i._node.duration===1/0&&t._clearSound(i._node))),n||t._emit("stop",i._id))}return t},mute:function(e,n){var r=this;if("loaded"!==r._state||r._playLock)return r._queue.push({event:"mute",action:function(){r.mute(e,n)}}),r;if(void 0===n){if("boolean"!=typeof e)return r._muted;r._muted=e}for(var o=r._getSoundIds(n),i=0;i<o.length;i++){var a=r._soundById(o[i]);a&&(a._muted=e,a._interval&&r._stopFade(a._id),r._webAudio&&a._node?a._node.gain.setValueAtTime(e?0:a._volume,t.ctx.currentTime):a._node&&(a._node.muted=!!t._muted||e),r._emit("mute",a._id))}return r},volume:function(){var e,n,r,o=this,i=arguments;if(0===i.length)return o._volume;if(1===i.length||2===i.length&&void 0===i[1]?o._getSoundIds().indexOf(i[0])>=0?n=parseInt(i[0],10):e=parseFloat(i[0]):i.length>=2&&(e=parseFloat(i[0]),n=parseInt(i[1],10)),!(void 0!==e&&e>=0&&e<=1))return(r=n?o._soundById(n):o._sounds[0])?r._volume:0;if("loaded"!==o._state||o._playLock)return o._queue.push({event:"volume",action:function(){o.volume.apply(o,i)}}),o;void 0===n&&(o._volume=e),n=o._getSoundIds(n);for(var a=0;a<n.length;a++)(r=o._soundById(n[a]))&&(r._volume=e,i[2]||o._stopFade(n[a]),o._webAudio&&r._node&&!r._muted?r._node.gain.setValueAtTime(e,t.ctx.currentTime):r._node&&!r._muted&&(r._node.volume=e*t.volume()),o._emit("volume",r._id));return o},fade:function(e,n,r,o){var i=this;if("loaded"!==i._state||i._playLock)return i._queue.push({event:"fade",action:function(){i.fade(e,n,r,o)}}),i;e=Math.min(Math.max(0,parseFloat(e)),1),n=Math.min(Math.max(0,parseFloat(n)),1),r=parseFloat(r),i.volume(e,o);for(var a=i._getSoundIds(o),s=0;s<a.length;s++){var u=i._soundById(a[s]);if(u){if(o||i._stopFade(a[s]),i._webAudio&&!u._muted){var c=t.ctx.currentTime,d=c+r/1e3;u._volume=e,u._node.gain.setValueAtTime(e,c),u._node.gain.linearRampToValueAtTime(n,d)}i._startFadeInterval(u,e,n,r,a[s],void 0===o)}}return i},_startFadeInterval:function(e,n,t,r,o,i){var a=this,s=n,u=t-n,c=Math.abs(u/.01),d=Math.max(4,c>0?r/c:r),l=Date.now();e._fadeTo=t,e._interval=setInterval((function(){var o=(Date.now()-l)/r;l=Date.now(),s+=u*o,s=Math.round(100*s)/100,s=u<0?Math.max(t,s):Math.min(t,s),a._webAudio?e._volume=s:a.volume(s,e._id,!0),i&&(a._volume=s),(t<n&&s<=t||t>n&&s>=t)&&(clearInterval(e._interval),e._interval=null,e._fadeTo=null,a.volume(t,e._id),a._emit("fade",e._id))}),d)},_stopFade:function(e){var n=this,r=n._soundById(e);return r&&r._interval&&(n._webAudio&&r._node.gain.cancelScheduledValues(t.ctx.currentTime),clearInterval(r._interval),r._interval=null,n.volume(r._fadeTo,e),r._fadeTo=null,n._emit("fade",e)),n},loop:function(){var e,n,t,r=this,o=arguments;if(0===o.length)return r._loop;if(1===o.length){if("boolean"!=typeof o[0])return!!(t=r._soundById(parseInt(o[0],10)))&&t._loop;e=o[0],r._loop=e}else 2===o.length&&(e=o[0],n=parseInt(o[1],10));for(var i=r._getSoundIds(n),a=0;a<i.length;a++)(t=r._soundById(i[a]))&&(t._loop=e,r._webAudio&&t._node&&t._node.bufferSource&&(t._node.bufferSource.loop=e,e&&(t._node.bufferSource.loopStart=t._start||0,t._node.bufferSource.loopEnd=t._stop,r.playing(i[a])&&(r.pause(i[a],!0),r.play(i[a],!0)))));return r},rate:function(){var e,n,r,o=this,i=arguments;if(0===i.length)n=o._sounds[0]._id;else if(1===i.length){o._getSoundIds().indexOf(i[0])>=0?n=parseInt(i[0],10):e=parseFloat(i[0])}else 2===i.length&&(e=parseFloat(i[0]),n=parseInt(i[1],10));if("number"!=typeof e)return(r=o._soundById(n))?r._rate:o._rate;if("loaded"!==o._state||o._playLock)return o._queue.push({event:"rate",action:function(){o.rate.apply(o,i)}}),o;void 0===n&&(o._rate=e),n=o._getSoundIds(n);for(var a=0;a<n.length;a++)if(r=o._soundById(n[a])){o.playing(n[a])&&(r._rateSeek=o.seek(n[a]),r._playStart=o._webAudio?t.ctx.currentTime:r._playStart),r._rate=e,o._webAudio&&r._node&&r._node.bufferSource?r._node.bufferSource.playbackRate.setValueAtTime(e,t.ctx.currentTime):r._node&&(r._node.playbackRate=e);var s=o.seek(n[a]),u=1e3*((o._sprite[r._sprite][0]+o._sprite[r._sprite][1])/1e3-s)/Math.abs(r._rate);!o._endTimers[n[a]]&&r._paused||(o._clearTimer(n[a]),o._endTimers[n[a]]=setTimeout(o._ended.bind(o,r),u)),o._emit("rate",r._id)}return o},seek:function(){var e,n,r=this,o=arguments;if(0===o.length)r._sounds.length&&(n=r._sounds[0]._id);else if(1===o.length){r._getSoundIds().indexOf(o[0])>=0?n=parseInt(o[0],10):r._sounds.length&&(n=r._sounds[0]._id,e=parseFloat(o[0]))}else 2===o.length&&(e=parseFloat(o[0]),n=parseInt(o[1],10));if(void 0===n)return 0;if("number"==typeof e&&("loaded"!==r._state||r._playLock))return r._queue.push({event:"seek",action:function(){r.seek.apply(r,o)}}),r;var i=r._soundById(n);if(i){if(!("number"==typeof e&&e>=0)){if(r._webAudio){var a=r.playing(n)?t.ctx.currentTime-i._playStart:0,s=i._rateSeek?i._rateSeek-i._seek:0;return i._seek+(s+a*Math.abs(i._rate))}return i._node.currentTime}var u=r.playing(n);u&&r.pause(n,!0),i._seek=e,i._ended=!1,r._clearTimer(n),r._webAudio||!i._node||isNaN(i._node.duration)||(i._node.currentTime=e);var c=function(){u&&r.play(n,!0),r._emit("seek",n)};if(u&&!r._webAudio){var d=function(){r._playLock?setTimeout(d,0):c()};setTimeout(d,0)}else c()}return r},playing:function(e){var n=this;if("number"==typeof e){var t=n._soundById(e);return!!t&&!t._paused}for(var r=0;r<n._sounds.length;r++)if(!n._sounds[r]._paused)return!0;return!1},duration:function(e){var n=this,t=n._duration,r=n._soundById(e);return r&&(t=n._sprite[r._sprite][1]/1e3),t},state:function(){return this._state},unload:function(){for(var e=this,n=e._sounds,r=0;r<n.length;r++)n[r]._paused||e.stop(n[r]._id),e._webAudio||(e._clearSound(n[r]._node),n[r]._node.removeEventListener("error",n[r]._errorFn,!1),n[r]._node.removeEventListener(t._canPlayEvent,n[r]._loadFn,!1),n[r]._node.removeEventListener("ended",n[r]._endFn,!1),t._releaseHtml5Audio(n[r]._node)),delete n[r]._node,e._clearTimer(n[r]._id);var o=t._howls.indexOf(e);o>=0&&t._howls.splice(o,1);var i=!0;for(r=0;r<t._howls.length;r++)if(t._howls[r]._src===e._src||e._src.indexOf(t._howls[r]._src)>=0){i=!1;break}return a&&i&&delete a[e._src],t.noAudio=!1,e._state="unloaded",e._sounds=[],e=null,null},on:function(e,n,t,r){var o=this["_on"+e];return"function"==typeof n&&o.push(r?{id:t,fn:n,once:r}:{id:t,fn:n}),this},off:function(e,n,t){var r=this,o=r["_on"+e],i=0;if("number"==typeof n&&(t=n,n=null),n||t)for(i=0;i<o.length;i++){var a=t===o[i].id;if(n===o[i].fn&&a||!n&&a){o.splice(i,1);break}}else if(e)r["_on"+e]=[];else{var s=Object.keys(r);for(i=0;i<s.length;i++)0===s[i].indexOf("_on")&&Array.isArray(r[s[i]])&&(r[s[i]]=[])}return r},once:function(e,n,t){return this.on(e,n,t,1),this},_emit:function(e,n,t){for(var r=this,o=r["_on"+e],i=o.length-1;i>=0;i--)o[i].id&&o[i].id!==n&&"load"!==e||(setTimeout(function(e){e.call(this,n,t)}.bind(r,o[i].fn),0),o[i].once&&r.off(e,o[i].fn,o[i].id));return r._loadQueue(e),r},_loadQueue:function(e){var n=this;if(n._queue.length>0){var t=n._queue[0];t.event===e&&(n._queue.shift(),n._loadQueue()),e||t.action()}return n},_ended:function(e){var n=this,r=e._sprite;if(!n._webAudio&&e._node&&!e._node.paused&&!e._node.ended&&e._node.currentTime<e._stop)return setTimeout(n._ended.bind(n,e),100),n;var o=!(!e._loop&&!n._sprite[r][2]);if(n._emit("end",e._id),!n._webAudio&&o&&n.stop(e._id,!0).play(e._id),n._webAudio&&o){n._emit("play",e._id),e._seek=e._start||0,e._rateSeek=0,e._playStart=t.ctx.currentTime;var i=1e3*(e._stop-e._start)/Math.abs(e._rate);n._endTimers[e._id]=setTimeout(n._ended.bind(n,e),i)}return n._webAudio&&!o&&(e._paused=!0,e._ended=!0,e._seek=e._start||0,e._rateSeek=0,n._clearTimer(e._id),n._cleanBuffer(e._node),t._autoSuspend()),n._webAudio||o||n.stop(e._id,!0),n},_clearTimer:function(e){var n=this;if(n._endTimers[e]){if("function"!=typeof n._endTimers[e])clearTimeout(n._endTimers[e]);else{var t=n._soundById(e);t&&t._node&&t._node.removeEventListener("ended",n._endTimers[e],!1)}delete n._endTimers[e]}return n},_soundById:function(e){for(var n=this,t=0;t<n._sounds.length;t++)if(e===n._sounds[t]._id)return n._sounds[t];return null},_inactiveSound:function(){var e=this;e._drain();for(var n=0;n<e._sounds.length;n++)if(e._sounds[n]._ended)return e._sounds[n].reset();return new i(e)},_drain:function(){var e=this,n=e._pool,t=0,r=0;if(!(e._sounds.length<n)){for(r=0;r<e._sounds.length;r++)e._sounds[r]._ended&&t++;for(r=e._sounds.length-1;r>=0;r--){if(t<=n)return;e._sounds[r]._ended&&(e._webAudio&&e._sounds[r]._node&&e._sounds[r]._node.disconnect(0),e._sounds.splice(r,1),t--)}}},_getSoundIds:function(e){if(void 0===e){for(var n=[],t=0;t<this._sounds.length;t++)n.push(this._sounds[t]._id);return n}return[e]},_refreshBuffer:function(e){return e._node.bufferSource=t.ctx.createBufferSource(),e._node.bufferSource.buffer=a[this._src],e._panner?e._node.bufferSource.connect(e._panner):e._node.bufferSource.connect(e._node),e._node.bufferSource.loop=e._loop,e._loop&&(e._node.bufferSource.loopStart=e._start||0,e._node.bufferSource.loopEnd=e._stop||0),e._node.bufferSource.playbackRate.setValueAtTime(e._rate,t.ctx.currentTime),this},_cleanBuffer:function(e){var n=t._navigator&&t._navigator.vendor.indexOf("Apple")>=0;if(!e.bufferSource)return this;if(t._scratchBuffer&&e.bufferSource&&(e.bufferSource.onended=null,e.bufferSource.disconnect(0),n))try{e.bufferSource.buffer=t._scratchBuffer}catch(e){}return e.bufferSource=null,this},_clearSound:function(e){/MSIE |Trident\//.test(t._navigator&&t._navigator.userAgent)||(e.src="data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA")}};var i=function(e){this._parent=e,this.init()};i.prototype={init:function(){var e=this,n=e._parent;return e._muted=n._muted,e._loop=n._loop,e._volume=n._volume,e._rate=n._rate,e._seek=0,e._paused=!0,e._ended=!0,e._sprite="__default",e._id=++t._counter,n._sounds.push(e),e.create(),e},create:function(){var e=this,n=e._parent,r=t._muted||e._muted||e._parent._muted?0:e._volume;return n._webAudio?(e._node=void 0===t.ctx.createGain?t.ctx.createGainNode():t.ctx.createGain(),e._node.gain.setValueAtTime(r,t.ctx.currentTime),e._node.paused=!0,e._node.connect(t.masterGain)):t.noAudio||(e._node=t._obtainHtml5Audio(),e._errorFn=e._errorListener.bind(e),e._node.addEventListener("error",e._errorFn,!1),e._loadFn=e._loadListener.bind(e),e._node.addEventListener(t._canPlayEvent,e._loadFn,!1),e._endFn=e._endListener.bind(e),e._node.addEventListener("ended",e._endFn,!1),e._node.src=n._src,e._node.preload=!0===n._preload?"auto":n._preload,e._node.volume=r*t.volume(),e._node.load()),e},reset:function(){var e=this,n=e._parent;return e._muted=n._muted,e._loop=n._loop,e._volume=n._volume,e._rate=n._rate,e._seek=0,e._rateSeek=0,e._paused=!0,e._ended=!0,e._sprite="__default",e._id=++t._counter,e},_errorListener:function(){var e=this;e._parent._emit("loaderror",e._id,e._node.error?e._node.error.code:0),e._node.removeEventListener("error",e._errorFn,!1)},_loadListener:function(){var e=this,n=e._parent;n._duration=Math.ceil(10*e._node.duration)/10,0===Object.keys(n._sprite).length&&(n._sprite={__default:[0,1e3*n._duration]}),"loaded"!==n._state&&(n._state="loaded",n._emit("load"),n._loadQueue()),e._node.removeEventListener(t._canPlayEvent,e._loadFn,!1)},_endListener:function(){var e=this,n=e._parent;n._duration===1/0&&(n._duration=Math.ceil(10*e._node.duration)/10,n._sprite.__default[1]===1/0&&(n._sprite.__default[1]=1e3*n._duration),n._ended(e)),e._node.removeEventListener("ended",e._endFn,!1)}};var a={},s=function(e){var n=e._src;if(a[n])return e._duration=a[n].duration,void d(e);if(/^data:[^;]+;base64,/.test(n)){for(var t=atob(n.split(",")[1]),r=new Uint8Array(t.length),o=0;o<t.length;++o)r[o]=t.charCodeAt(o);c(r.buffer,e)}else{var i=new XMLHttpRequest;i.open(e._xhr.method,n,!0),i.withCredentials=e._xhr.withCredentials,i.responseType="arraybuffer",e._xhr.headers&&Object.keys(e._xhr.headers).forEach((function(n){i.setRequestHeader(n,e._xhr.headers[n])})),i.onload=function(){var n=(i.status+"")[0];"0"===n||"2"===n||"3"===n?c(i.response,e):e._emit("loaderror",null,"Failed loading audio file with status: "+i.status+".")},i.onerror=function(){e._webAudio&&(e._html5=!0,e._webAudio=!1,e._sounds=[],delete a[n],e.load())},u(i)}},u=function(e){try{e.send()}catch(n){e.onerror()}},c=function(e,n){var r=function(){n._emit("loaderror",null,"Decoding audio data failed.")},o=function(e){e&&n._sounds.length>0?(a[n._src]=e,d(n,e)):r()};"undefined"!=typeof Promise&&1===t.ctx.decodeAudioData.length?t.ctx.decodeAudioData(e).then(o).catch(r):t.ctx.decodeAudioData(e,o,r)},d=function(e,n){n&&!e._duration&&(e._duration=n.duration),0===Object.keys(e._sprite).length&&(e._sprite={__default:[0,1e3*e._duration]}),"loaded"!==e._state&&(e._state="loaded",e._emit("load"),e._loadQueue())},l=function(){if(t.usingWebAudio){try{"undefined"!=typeof AudioContext?t.ctx=new AudioContext:"undefined"!=typeof webkitAudioContext?t.ctx=new webkitAudioContext:t.usingWebAudio=!1}catch(e){t.usingWebAudio=!1}t.ctx||(t.usingWebAudio=!1);var e=/iP(hone|od|ad)/.test(t._navigator&&t._navigator.platform),n=t._navigator&&t._navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/),r=n?parseInt(n[1],10):null;if(e&&r&&r<9){var o=/safari/.test(t._navigator&&t._navigator.userAgent.toLowerCase());t._navigator&&!o&&(t.usingWebAudio=!1)}t.usingWebAudio&&(t.masterGain=void 0===t.ctx.createGain?t.ctx.createGainNode():t.ctx.createGain(),t.masterGain.gain.setValueAtTime(t._muted?0:t._volume,t.ctx.currentTime),t.masterGain.connect(t.ctx.destination)),t._setup()}};n.Howler=t,n.Howl=o,void 0!==r?(r.HowlerGlobal=e,r.Howler=t,r.Howl=o,r.Sound=i):"undefined"!=typeof window&&(window.HowlerGlobal=e,window.Howler=t,window.Howl=o,window.Sound=i)}(),
|
31
31
|
/*!
|
32
32
|
* Spatial Plugin - Adds support for stereo and 3D audio where Web Audio is supported.
|
33
33
|
*
|
@@ -39,7 +39,7 @@
|
|
39
39
|
*
|
40
40
|
* MIT License
|
41
41
|
*/
|
42
|
-
function(){var e;HowlerGlobal.prototype._pos=[0,0,0],HowlerGlobal.prototype._orientation=[0,0,-1,0,1,0],HowlerGlobal.prototype.stereo=function(e){var n=this;if(!n.ctx||!n.ctx.listener)return n;for(var t=n._howls.length-1;t>=0;t--)n._howls[t].stereo(e);return n},HowlerGlobal.prototype.pos=function(e,n,t){var o=this;return o.ctx&&o.ctx.listener?(n="number"!=typeof n?o._pos[1]:n,t="number"!=typeof t?o._pos[2]:t,"number"!=typeof e?o._pos:(o._pos=[e,n,t],void 0!==o.ctx.listener.positionX?(o.ctx.listener.positionX.setTargetAtTime(o._pos[0],Howler.ctx.currentTime,.1),o.ctx.listener.positionY.setTargetAtTime(o._pos[1],Howler.ctx.currentTime,.1),o.ctx.listener.positionZ.setTargetAtTime(o._pos[2],Howler.ctx.currentTime,.1)):o.ctx.listener.setPosition(o._pos[0],o._pos[1],o._pos[2]),o)):o},HowlerGlobal.prototype.orientation=function(e,n,t,o,r,i){var a=this;if(!a.ctx||!a.ctx.listener)return a;var c=a._orientation;return n="number"!=typeof n?c[1]:n,t="number"!=typeof t?c[2]:t,o="number"!=typeof o?c[3]:o,r="number"!=typeof r?c[4]:r,i="number"!=typeof i?c[5]:i,"number"!=typeof e?c:(a._orientation=[e,n,t,o,r,i],void 0!==a.ctx.listener.forwardX?(a.ctx.listener.forwardX.setTargetAtTime(e,Howler.ctx.currentTime,.1),a.ctx.listener.forwardY.setTargetAtTime(n,Howler.ctx.currentTime,.1),a.ctx.listener.forwardZ.setTargetAtTime(t,Howler.ctx.currentTime,.1),a.ctx.listener.upX.setTargetAtTime(o,Howler.ctx.currentTime,.1),a.ctx.listener.upY.setTargetAtTime(r,Howler.ctx.currentTime,.1),a.ctx.listener.upZ.setTargetAtTime(i,Howler.ctx.currentTime,.1)):a.ctx.listener.setOrientation(e,n,t,o,r,i),a)},Howl.prototype.init=(e=Howl.prototype.init,function(n){var t=this;return t._orientation=n.orientation||[1,0,0],t._stereo=n.stereo||null,t._pos=n.pos||null,t._pannerAttr={coneInnerAngle:void 0!==n.coneInnerAngle?n.coneInnerAngle:360,coneOuterAngle:void 0!==n.coneOuterAngle?n.coneOuterAngle:360,coneOuterGain:void 0!==n.coneOuterGain?n.coneOuterGain:0,distanceModel:void 0!==n.distanceModel?n.distanceModel:"inverse",maxDistance:void 0!==n.maxDistance?n.maxDistance:1e4,panningModel:void 0!==n.panningModel?n.panningModel:"HRTF",refDistance:void 0!==n.refDistance?n.refDistance:1,rolloffFactor:void 0!==n.rolloffFactor?n.rolloffFactor:1},t._onstereo=n.onstereo?[{fn:n.onstereo}]:[],t._onpos=n.onpos?[{fn:n.onpos}]:[],t._onorientation=n.onorientation?[{fn:n.onorientation}]:[],e.call(this,n)}),Howl.prototype.stereo=function(e,t){var o=this;if(!o._webAudio)return o;if("loaded"!==o._state)return o._queue.push({event:"stereo",action:function(){o.stereo(e,t)}}),o;var r=void 0===Howler.ctx.createStereoPanner?"spatial":"stereo";if(void 0===t){if("number"!=typeof e)return o._stereo;o._stereo=e,o._pos=[e,0,0]}for(var i=o._getSoundIds(t),a=0;a<i.length;a++){var c=o._soundById(i[a]);if(c){if("number"!=typeof e)return c._stereo;c._stereo=e,c._pos=[e,0,0],c._node&&(c._pannerAttr.panningModel="equalpower",c._panner&&c._panner.pan||n(c,r),"spatial"===r?void 0!==c._panner.positionX?(c._panner.positionX.setValueAtTime(e,Howler.ctx.currentTime),c._panner.positionY.setValueAtTime(0,Howler.ctx.currentTime),c._panner.positionZ.setValueAtTime(0,Howler.ctx.currentTime)):c._panner.setPosition(e,0,0):c._panner.pan.setValueAtTime(e,Howler.ctx.currentTime)),o._emit("stereo",c._id)}}return o},Howl.prototype.pos=function(e,t,o,r){var i=this;if(!i._webAudio)return i;if("loaded"!==i._state)return i._queue.push({event:"pos",action:function(){i.pos(e,t,o,r)}}),i;if(t="number"!=typeof t?0:t,o="number"!=typeof o?-.5:o,void 0===r){if("number"!=typeof e)return i._pos;i._pos=[e,t,o]}for(var a=i._getSoundIds(r),c=0;c<a.length;c++){var u=i._soundById(a[c]);if(u){if("number"!=typeof e)return u._pos;u._pos=[e,t,o],u._node&&(u._panner&&!u._panner.pan||n(u,"spatial"),void 0!==u._panner.positionX?(u._panner.positionX.setValueAtTime(e,Howler.ctx.currentTime),u._panner.positionY.setValueAtTime(t,Howler.ctx.currentTime),u._panner.positionZ.setValueAtTime(o,Howler.ctx.currentTime)):u._panner.setPosition(e,t,o)),i._emit("pos",u._id)}}return i},Howl.prototype.orientation=function(e,t,o,r){var i=this;if(!i._webAudio)return i;if("loaded"!==i._state)return i._queue.push({event:"orientation",action:function(){i.orientation(e,t,o,r)}}),i;if(t="number"!=typeof t?i._orientation[1]:t,o="number"!=typeof o?i._orientation[2]:o,void 0===r){if("number"!=typeof e)return i._orientation;i._orientation=[e,t,o]}for(var a=i._getSoundIds(r),c=0;c<a.length;c++){var u=i._soundById(a[c]);if(u){if("number"!=typeof e)return u._orientation;u._orientation=[e,t,o],u._node&&(u._panner||(u._pos||(u._pos=i._pos||[0,0,-.5]),n(u,"spatial")),void 0!==u._panner.orientationX?(u._panner.orientationX.setValueAtTime(e,Howler.ctx.currentTime),u._panner.orientationY.setValueAtTime(t,Howler.ctx.currentTime),u._panner.orientationZ.setValueAtTime(o,Howler.ctx.currentTime)):u._panner.setOrientation(e,t,o)),i._emit("orientation",u._id)}}return i},Howl.prototype.pannerAttr=function(){var e,t,o,r=this,i=arguments;if(!r._webAudio)return r;if(0===i.length)return r._pannerAttr;if(1===i.length){if("object"!=typeof i[0])return(o=r._soundById(parseInt(i[0],10)))?o._pannerAttr:r._pannerAttr;e=i[0],void 0===t&&(e.pannerAttr||(e.pannerAttr={coneInnerAngle:e.coneInnerAngle,coneOuterAngle:e.coneOuterAngle,coneOuterGain:e.coneOuterGain,distanceModel:e.distanceModel,maxDistance:e.maxDistance,refDistance:e.refDistance,rolloffFactor:e.rolloffFactor,panningModel:e.panningModel}),r._pannerAttr={coneInnerAngle:void 0!==e.pannerAttr.coneInnerAngle?e.pannerAttr.coneInnerAngle:r._coneInnerAngle,coneOuterAngle:void 0!==e.pannerAttr.coneOuterAngle?e.pannerAttr.coneOuterAngle:r._coneOuterAngle,coneOuterGain:void 0!==e.pannerAttr.coneOuterGain?e.pannerAttr.coneOuterGain:r._coneOuterGain,distanceModel:void 0!==e.pannerAttr.distanceModel?e.pannerAttr.distanceModel:r._distanceModel,maxDistance:void 0!==e.pannerAttr.maxDistance?e.pannerAttr.maxDistance:r._maxDistance,refDistance:void 0!==e.pannerAttr.refDistance?e.pannerAttr.refDistance:r._refDistance,rolloffFactor:void 0!==e.pannerAttr.rolloffFactor?e.pannerAttr.rolloffFactor:r._rolloffFactor,panningModel:void 0!==e.pannerAttr.panningModel?e.pannerAttr.panningModel:r._panningModel})}else 2===i.length&&(e=i[0],t=parseInt(i[1],10));for(var a=r._getSoundIds(t),c=0;c<a.length;c++)if(o=r._soundById(a[c])){var u=o._pannerAttr;u={coneInnerAngle:void 0!==e.coneInnerAngle?e.coneInnerAngle:u.coneInnerAngle,coneOuterAngle:void 0!==e.coneOuterAngle?e.coneOuterAngle:u.coneOuterAngle,coneOuterGain:void 0!==e.coneOuterGain?e.coneOuterGain:u.coneOuterGain,distanceModel:void 0!==e.distanceModel?e.distanceModel:u.distanceModel,maxDistance:void 0!==e.maxDistance?e.maxDistance:u.maxDistance,refDistance:void 0!==e.refDistance?e.refDistance:u.refDistance,rolloffFactor:void 0!==e.rolloffFactor?e.rolloffFactor:u.rolloffFactor,panningModel:void 0!==e.panningModel?e.panningModel:u.panningModel};var s=o._panner;s||(o._pos||(o._pos=r._pos||[0,0,-.5]),n(o,"spatial"),s=o._panner),s.coneInnerAngle=u.coneInnerAngle,s.coneOuterAngle=u.coneOuterAngle,s.coneOuterGain=u.coneOuterGain,s.distanceModel=u.distanceModel,s.maxDistance=u.maxDistance,s.refDistance=u.refDistance,s.rolloffFactor=u.rolloffFactor,s.panningModel=u.panningModel}return r},Sound.prototype.init=function(e){return function(){var n=this,t=n._parent;n._orientation=t._orientation,n._stereo=t._stereo,n._pos=t._pos,n._pannerAttr=t._pannerAttr,e.call(this),n._stereo?t.stereo(n._stereo):n._pos&&t.pos(n._pos[0],n._pos[1],n._pos[2],n._id)}}(Sound.prototype.init),Sound.prototype.reset=function(e){return function(){var n=this,t=n._parent;return n._orientation=t._orientation,n._stereo=t._stereo,n._pos=t._pos,n._pannerAttr=t._pannerAttr,n._stereo?t.stereo(n._stereo):n._pos?t.pos(n._pos[0],n._pos[1],n._pos[2],n._id):n._panner&&(n._panner.disconnect(0),n._panner=void 0,t._refreshBuffer(n)),e.call(this)}}(Sound.prototype.reset);var n=function(e,n){"spatial"===(n=n||"spatial")?(e._panner=Howler.ctx.createPanner(),e._panner.coneInnerAngle=e._pannerAttr.coneInnerAngle,e._panner.coneOuterAngle=e._pannerAttr.coneOuterAngle,e._panner.coneOuterGain=e._pannerAttr.coneOuterGain,e._panner.distanceModel=e._pannerAttr.distanceModel,e._panner.maxDistance=e._pannerAttr.maxDistance,e._panner.refDistance=e._pannerAttr.refDistance,e._panner.rolloffFactor=e._pannerAttr.rolloffFactor,e._panner.panningModel=e._pannerAttr.panningModel,void 0!==e._panner.positionX?(e._panner.positionX.setValueAtTime(e._pos[0],Howler.ctx.currentTime),e._panner.positionY.setValueAtTime(e._pos[1],Howler.ctx.currentTime),e._panner.positionZ.setValueAtTime(e._pos[2],Howler.ctx.currentTime)):e._panner.setPosition(e._pos[0],e._pos[1],e._pos[2]),void 0!==e._panner.orientationX?(e._panner.orientationX.setValueAtTime(e._orientation[0],Howler.ctx.currentTime),e._panner.orientationY.setValueAtTime(e._orientation[1],Howler.ctx.currentTime),e._panner.orientationZ.setValueAtTime(e._orientation[2],Howler.ctx.currentTime)):e._panner.setOrientation(e._orientation[0],e._orientation[1],e._orientation[2])):(e._panner=Howler.ctx.createStereoPanner(),e._panner.pan.setValueAtTime(e._stereo,Howler.ctx.currentTime)),e._panner.connect(e._node),e._paused||e._parent.pause(e._id,!0).play(e._id,!0)}}()}));function re(e,n,t){U(q).invokeCallbackHandler(e,n,t)}function ie(e,n,t){var o,r=null===(o=Pn.currPage)||void 0===o?void 0:o.children;if(Array.isArray(r)&&r.length>0){var i=r[0];i&&i.isWebView&&i.postMessageToWebView({callbackId:e,type:"webInvokeCallbackHandler",params:n})}}var ae={},ce={};function ue(e,n){var t=ae[e],o=ce[e];return null!=t?""!=n.src&&o!=n.src?(t.unload(),delete ae[e],delete ce[e],ue(e,n)):t:(ce[e]=n.src,ae[e]=function(e,n){var t=new oe.Howl({autoplay:e.autoplay,loop:e.loop,src:e.src,rate:e.playbackRate,onend:function(){X(de,{innerAudioContextId:n,method:le.onEnded,data:{}})},onplay:function(){X(de,{innerAudioContextId:n,method:le.onPlay,data:{buffered:0,currentTime:0,duration:0}})},onpause:function(e){X(de,{innerAudioContextId:e,method:le.onPause,data:{}})},onstop:function(){X(de,{innerAudioContextId:n,method:le.onStop,data:{}})},onseek:function(){X(de,{innerAudioContextId:n,method:le.onSeeked,data:{}})},onplayerror:function(e,n){X(de,{innerAudioContextId:e,method:le.onError,data:{errMsg:"播放失败 :"+n,errCode:-1}})},onloaderror:function(e,n){X(de,{innerAudioContextId:e,method:le.onError,data:{errMsg:"播放失败 :"+n,errCode:10002}})},onrate:function(e){console.log("audio进度改变")},onload:function(){X(de,{innerAudioContextId:n,method:le.onCanplay,data:{}})}});return t}(n,e))}function se(e,n,t){var o=ae[n];if(null==o){var r=e+":fail 无法找到innerAudioContextId:"+n+"对应的audio实例";throw re(t,{errMsg:r}),new Error(r)}return o}oe.Howler.autoSuspend=!1;var le={onCanplay:"onCanplay",onEnded:"onEnded",onError:"onError",onPause:"onPause",onPlay:"onPlay",onSeeked:"onSeeked",onSeeking:"onSeeking",onStop:"onStop",onTimeUpdate:"onTimeUpdate",onWaiting:"onWaiting"},de="onInnerAudio";var fe={innerAudio:function(e,n){var t,o=e.method,r=e.data,i=e.innerAudioContextId;switch(o){case"create":break;case"play":(t=ue(i,r)).loop(r.loop),t.volume(r.volume),r.isPlayMethod&&t.play();break;case"stop":se(o,i,n).stop();break;case"seek":(t=se(o,i,n)).seek(r.position);break;case"pause":se(o,i,n).pause();break;case"destroy":se(o,i,n).unload();break;default:throw new Error("无法处理音频method:"+o)}return{errMsg:"innerAudio:ok"}}};function pe(e){return/^http(s?)\:\/\//.test(e)}function ve(e,n,t){var o=new XMLHttpRequest,r=!0;if(null!=n.sync&&(r=!n.sync),null!=n.responseType&&(o.responseType=n.responseType),o.open("GET",e,r),null!=n.header)for(var i in n.header)o.setRequestHeader(i,n.header[i]);o.onload=function(e){t(null,o.response,{e:e,xhr:o})},o.onerror=function(e){t(new Error("request settings failed!"),null,{e:e,xhr:o})},o.send(null)}var he={readFileSync:function(e){var n,t=e.filePath;if(t.startsWith(j))return{data:null,errMsg:"readFileSync:fail not support local file."};t=pe(t=(n=t).endsWith(".wasm")?n+".txt":n)?t:M+t;var o=null,r=null;return ve(t,{sync:!0},(function(e,n){o=n,r=e})),null!=o?{data:o,errMsg:"readFileSync:ok"}:null!=r?{data:null,errMsg:"readFileSync:fail "+r.message}:{data:null,errMsg:"readFileSync:fail"}},readFile:function(e,n){var t=e.filePath,o="base64"===e.encoding,r=pe(t)?t:M+t;t.startsWith(j)?re(n,{errMsg:"readFile:fail not support local file: "+t}):ve(r,{responseType:o?"arraybuffer":""},(function(e,t){re(n,null==e?{data:o?h(t):t,errMsg:"readFile:ok"}:{errMsg:"readFile:fail "+e.message})}))},access:function(){return{errMsg:"access:ok"}},rename:function(){return{errMsg:"rename:ok"}},mkdirSync:function(){return{errMsg:"mkdirSync:ok"}},writeFile:function(){return{errMsg:"writeFile:ok"}},writeFileSync:function(e){return e.filePath,e.data,{errMsg:"writeFileSync:ok"}},unlink:function(e,n){return e.filePath,{errMsg:"unlink:ok"}},downloadFile:function(e,n){var t=e.url,o=e.timeout,r=void 0===o?6e3:o;e.taskId,e.header,e.filePath,g(r,function(e){var n=e.url,t=e.callbackId;return e.filePath,e.header,s(this,void 0,void 0,(function(){return l(this,(function(e){return X(R,{cookies:[],progress:100,totalBytesExpectedToWrite:100,totalBytesWritten:100}),X(H,{cookies:[],header:{}}),re(t,{filePath:n,tempFilePath:n,profile:[],statusCode:200,errMsg:"downloadFile:ok"}),[2]}))}))}({url:t,callbackId:n}),(function(e){re(n,{errMsg:"downloadFile:fail timeout in "+e+"ms."})}))},copyFile:function(e,n){return e.srcPath,e.destPath,re(n,{errMsg:"copyFile:ok fake subpport."},"copyFile")}};function ge(e){return ne().invokeHandler({callbackId:e.callbackId||-1,apiName:e.apiName,params:e.params,from:"service"})}var me,we,ye,be=G?he:(me=he,we={readFileSync:{onMobile:_e},readFile:{onMobile:_e},access:{onMobile:_e},rename:{onCallBefore:function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var t=e.shift();return t&&t.fatNewPath&&(t.newPath=t.fatNewPath,delete t.fatNewPath),t&&e.unshift(t),e}},downloadFile:{onCallBefore:function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var t=e[0];if(null!=t){var o=t.header;if(o&&o.Referer)throw new Error("header不能设置Referer字段");t.source="miniGame"}return e}}},ye=we||{},Object.keys(me).reduce((function(e,n){var t=me[n];return e[n]=function(){for(var e,o,r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];var a=p(),c=ye[n],u={callNativeApi:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return ge({apiName:n,params:e[0],callbackId:e[1]})},callPatchApi:function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return t.apply(void 0,e)}};try{return c&&"function"==typeof c.onCallBefore&&(r=(e=c.onCallBefore).call.apply(e,d([u],r))),a?c&&"function"==typeof c.onMobile?(o=c.onMobile).call.apply(o,d([u],r)):u.callNativeApi.apply(u,r):u.callPatchApi.apply(u,r)}catch(e){return{errMsg:n+":fail error occured in polyfill api, "+e.message}}},e}),{}));function _e(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var t=e[0],o=t.filePath||t.path,r=this;return o.startsWith(N)?r.callNativeApi.apply(r,e):r.callPatchApi.apply(r,e)}var xe=new(function(){function e(){this.reportedEventType=new Set(["ErrorType"])}return Object.defineProperty(e.prototype,"sentry",{get:function(){return window.Sentry},enumerable:!1,configurable:!0}),e.prototype.captureException=function(e,n){var t=this.sentry;if(null!=t){var o=n.event_desc;delete n.event_desc,t.captureException(function(e,n){var t=new Error,o=e.charAt(0).toUpperCase()+e.slice(1),r=function(e){try{return JSON.parse(e)}catch(n){return e}}(n);"string"==typeof r?(t.stack=r,t.message=r):(t.message=o+": "+r.msg,t.stack=r.stack);return t}(e,o))}else console.log("Sentry is not ready yet.")},e.prototype.captureLoadGameEntryError=function(e){xe.captureException("LoadGameEntryError",{event_desc:"load game entry bundle fail: \n"+e.message+"\n"+e.stack})},e}()),Ae=null;function ke(){if(null==Ae)throw new Error("WxConfig is not ready.");return Ae}function Se(e){var n=ke(),t=n.windows.pages;return null!=t&&t[e]?Object.assign({},n.window,t[e]):null}var Ie=new i;function Ce(){Ie.on("NavigatorBarTools:onMore",(function(){bn.showToast({title:"暂未实现该功能"})})),Ie.on("NavigatorBarTools:onClose",(function(){var e=ne();null!=e&&e.invokeHandler({callbackId:-1,apiName:"exitMiniProgram",params:{},from:"service"})})),Ie.on("NavigatorBar:onBack",(function(){je.navigateBack({delta:1}),console.log("onBack")})),Ie.on("TabBar:change",(function(e){var n,t,o;X("onTabItemTap",{index:e.index,pagePath:e.item.pagePath,text:e.item.text}),je.switchTab({url:e.item.pagePath},-1),n=e.item.pagePath,t={},null!=(o=Se(n))&&(t.windowConfig=o),Ie.emit("tabItemChanged",t)})),Ie.on("invokeCallbackHandler",(function(e){re(e.callbackId,e.data)})),Ie.on("dispatchServiceEvent",(function(e){X(e.event,e.payload)}))}function Te(e){void 0!==window.__initWebFrame&&window.__initWebFrame(e,Ie)}var Me={getGlobalVariables:function(e){return"_launchOption"===e.variable?{_launchOption:F}:null},onWindowResize:function(){},offWindowResize:function(){},reportApmMonitor:function(e){var n=e.eventName,t=e.payload,o=e.eventType;e.timestamp,xe.reportedEventType.has(o)?xe.captureException(n,t):"LogReport"===o&&t.event},addPerformance:function(e){},initReady:function(){},updateAppData:function(){},injectHtmlCallback:function(e,n,t){"service"===t&&J().events.emit($.onInjectHTMLCallback)},pageScrollTo:function(e,n){var t=e.scrollTop;e.duration;var o=Pn.currPage.getWindow();return null==o||o.scrollTo({top:t,behavior:"smooth"}),{errMsg:"pageScrollTo:ok"}},getMenuButtonBoundingClientRect:function(e,n){Ie.emit("getMenuButtonBoundingClientRect",e,n)},getAccountInfoSync:function(){var e=window.__extInfo;return{data:{miniProgram:u(u({},e),{appId:null==e?void 0:e.extUuid,envVersion:null==e?void 0:e.envVersion,version:"",forceUsePatchApi:G}),plugin:{appId:"",version:""}}}},jssdkConfig:function(e,n){var t=e.jsApiList,o=[];if((void 0===t?[]:t).forEach((function(e){null==bn[e]&&o.push(e)})),!(o.length>0))return ie(n,{errMsg:"jssdkConfig:ok"});ie(n,{errMsg:"jssdkConfig:fail "+o.join(",")+" 未实现."})}},Pe={hideToast:function(e){return Ie.emit("hideToast",e),{errMsg:"hideToast:ok"}},showToast:function(e){return Ie.emit("showToast",e),{errMsg:"showToast:ok"}},showLoading:function(e){return Ie.emit("showLoading",e),{errMsg:"showLoading:ok"}},hideLoading:function(e){return Ie.emit("hideLoading",e),{errMsg:"hideLoading:ok"}},showModal:function(e,n){Ie.emit("showModal",e,n)},showActionSheet:function(e,n){Ie.emit("showActionSheet",e,n)}},Ee={showGameKeyboard:function(e){return p()?ge({apiName:"showGameKeyboard",params:e}):Ie.emit("showKeyboard",e),{}},hideGameKeyboard:function(e){return p()||Ie.emit("hideKeyboard",e),{}},updateGameKeyboard:function(e){return p()||Ie.emit("updateKeyboard",e),{}},showKeyboard:function(e){return p()?ge({apiName:"showGameKeyboard",params:e}):Ie.emit("showKeyboard",e),{}},hideKeyboard:function(e){return Ie.emit("hideKeyboard",e),{}},updateKeyboard:function(e){return Ie.emit("updateKeyboard",e),{}}};function Be(e,n){if(e===D)return'<script charset="utf-8" src="'+n.moduleName+'game.js"><\/script>';if("miniProgram"===e)return n.content;throw Error("unsupported projectType: "+e)}var Oe=function(e){function n(n){return e.call(this,u(u({},n),{projectType:D}))||this}return c(n,e),n.prototype.injectScript=function(){var e=U(q).getWindow();e.injectHtml(e.document.body,{content:Be(this.projectType,{moduleName:this.moduleName})})},n.prototype.getEntry=function(){return e=this.projectType,n={moduleName:this.moduleName},e===D?n.moduleName+"game.js":"";var e,n},n}(function(){function e(e){this.taskId=e.taskId,this.moduleName=e.moduleName,this.projectType=e.projectType,this.status="none"}return e.prototype.notifyProgressUpdate=function(e,n){X("onLoadSubPackageTaskStateChange",u({moduleName:this.moduleName,state:e,taskId:this.taskId},n))},e.prototype.injectScript=function(){},e.prototype.getEntry=function(){},e.prototype.load=function(e,n){return s(this,void 0,void 0,(function(){return l(this,(function(e){return this.notifyProgressUpdate("progressUpdate",{progress:0}),this.notifyProgressUpdate("progressUpdate",{progress:50}),this.injectScript(),this.notifyProgressUpdate("progressUpdate",{progress:100}),[2]}))}))},e}()),Le=0,Fe={},Re={createLoadSubPackageTask:function(e,n){var t=e.moduleName,o=Fe[t];if(o&&"success"===o.status)return{errMsg:"createLoadSubPackageTask:fail sub package already loaded."};++Le;var r=String(Le);return o=new Oe({taskId:r,moduleName:t}),J().events.once($.onInjectHTMLCallback,(function(){o.status="success",o.notifyProgressUpdate("success",{entryPath:o.getEntry()})})),Fe[t]=o,o.load(r,n),{errMsg:"createLoadSubPackageTask:ok",loadTaskId:Le}}},He={showNavigationBarLoading:function(){return Ie.emit("showNavigationBarLoading"),{errMsg:"showNavigationBarLoading:ok"}},setNavigationBarTitle:function(e){return Ie.emit("setNavigationBarTitle",e),{errMsg:"setNavigationBarTitle:ok"}},setNavigationBarColor:function(e){return Ie.emit("setNavigationBarColor",e),{errMsg:"setNavigationBarColor:ok"}},hideNavigationBarLoading:function(){return Ie.emit("hideNavigationBarLoading"),{errMsg:"hideNavigationBarLoading:ok"}},hideHomeButton:function(){}};function De(e,n){var t,o=function(e){e=e.replace(/\.html$/,"");var n=ke(),t=n.subpackages;if(Array.isArray(t)&&t.length>0)return t.find((function(n){return n.pageFullPath.includes(e)}));return null}(e);null==o||(t=o.root,V[t])?n():function(e,n){var t=U(q);t.events.once($.onInjectHTMLCallback,n),t.loadSubBundle(e.root,e.packageName+".js")}(o,n)}var je={navigateTo:function(e,n){var t=e.url;if(Pn.stack.length>10)return{errMsg:"navigateTo:fail 已到达页面栈上限:10。"};var o=v(t),r=o.path,i=o.query;return De(r,(function(){var e=Pn.go(r);J().events.once($.onViewDOMContentLoaded,(function(){X("onAppRoute",{path:r,openType:"navigateTo",options:void 0,pipMode:"",query:i,webviewId:e.webviewId},e.webviewId)}))})),{errMsg:"navigateTo:ok"}},navigateBack:function(e){var n=e.delta;try{Pn.back(n)}catch(e){return{errMsg:"navigateBack:fail "+e.message}}var t=Pn.currPage;return X("onAppRoute",{path:t.pagePath,openType:"navigateBack",options:{delta:n},pipMode:"",query:void 0,webviewId:t.webviewId},t.webviewId),{errMsg:"navigateBack:ok"}},reLaunch:function(e,n){var t=e.url,o=v(t),r=o.path,i=o.query;De(r,(function(){Pn.reLaunch(t);var e=Pn.currPage;J().events.once($.onViewDOMContentLoaded,(function(){X("onAppRoute",{path:r,openType:"reLaunch",options:void 0,pipMode:"",query:i,webviewId:e.webviewId},e.webviewId),re(n,{errMsg:"reLaunch:ok"})}))}))},redirectTo:function(e,n){var t=v(e.url),o=t.path,r=t.query;De(o,(function(){try{Pn.redirectTo(o)}catch(e){return void re(n,{errMsg:"redirectTo:fail "+e.message})}var e=Pn.currPage;J().events.once($.onViewDOMContentLoaded,(function(){X("onAppRoute",{path:o,openType:"redirectTo",options:void 0,pipMode:"",query:r,webviewId:e.webviewId},e.webviewId),re(n,{errMsg:"redirectTo:ok"})}))}))},switchTab:function(e,n){var t=v(e.url),o=t.path,r=t.query;De(o,(function(){try{Pn.switch(o)}catch(e){return void re(n,{errMsg:"switchTab:fail "+e.message})}var e=Pn.currPage;e.isReady?(X("onAppRoute",{path:o,openType:"switchTab",options:void 0,pipMode:"",query:r,webviewId:e.webviewId},e.webviewId),re(n,{errMsg:"switchTab:ok"})):J().events.once($.onViewDOMContentLoaded,(function(){X("onAppRoute",{path:o,openType:"switchTab",options:void 0,pipMode:"",query:r,webviewId:e.webviewId},e.webviewId),re(n,{errMsg:"switchTab:ok"})}))}))}};function Ne(e){setTimeout(e,16)}function Ge(e){var n=b();if(null==n)throw new Error("获取 extUuid 失败 by storage api");return n+"-"+e}function We(e){var n=b();if(null==n)throw new Error("获取 extUuid 失败 by storage api");return e.replace(new RegExp("^"+n+"-"),"")}function $e(e){return Number((e/1024).toFixed(2))}var Ve={getStorageSync:function(e){return{data:localStorage.getItem(Ge(e.key))||null}},getStorage:function(e,n){Ne((function(){re(n,{data:Ve.getStorageSync(e)})}))},setStorageSync:function(e){return localStorage.setItem(Ge(e.key),e.data),{errMsg:"setStorageSync:ok"}},setStorage:function(e,n){Ne((function(){localStorage.setItem(e.key,e.data),re(n,{errMsg:"setStorage:ok"})}))},removeStorageSync:function(e){return localStorage.removeItem(Ge(e.key)),{errMsg:"removeStorageSync:ok"}},removeStorage:function(e,n){Ne((function(){localStorage.removeItem(Ge(e.key)),re(n,{errMsg:"removeStorage:ok"})}))},clearStorageSync:function(){return localStorage.clear(),{errMsg:"clearStorageSync:ok"}},clearStorage:function(e,n){Ne((function(){localStorage.clear(),re(n,{errMsg:"clearStorage:ok"})}))},getStorageInfoSync:function(){var e=function(){var e=0,n=[];for(var t in localStorage)Object.prototype.hasOwnProperty.call(localStorage,t)&&(e+=localStorage[t].length,n.push(We(t)));return{size:e,keys:n}}(),n=e.size;return{keys:e.keys,currentSize:$e(n),limitSize:$e(10485760)}},getStorageInfo:function(e,n){Ne((function(){re(n,u(u({},Ve.getStorageInfoSync()),{errMsg:"getStorageInfo:ok"}))}))}};function ze(){var e=f();return("Android"===e||"IOS"===e)&&window.matchMedia("(orientation: portrait)").matches?"portrait":"landscape"}function qe(){var e,n,t,o=null===(e=Pn.currPage)||void 0===e?void 0:e.getWindow();if(null!=o){var r=o.document;return(null===(n=r.documentElement)||void 0===n?void 0:n.scrollTop)||(null===(t=r.body)||void 0===t?void 0:t.scrollTop)||0}return 0}function Ke(){return u(u({patch:!0},(e=window.innerWidth||375,n=window.innerHeight||375,t=f().toLocaleLowerCase().includes("window")?0:50,o=window.devicePixelRatio||2,{screenWidth:e,screenHeight:n,statusBarHeight:t,devicePixelRatio:o,pixelRatio:o,windowHeight:n,windowWidth:e,safeArea:{height:n-t,widows:e,top:t,left:0,right:0}})),{scrollY:qe()});var e,n,t,o}var Ue={onMemoryWarning:function(){console.warn("The onMemoryWarning api is not implement.")},showShareMenu:function(){console.warn("The showShareMenu api is not implement.")},getSystemInfoSync:function(){var e,n=Qe(),t=ze(),o=f(),r=(e=y().extType||"").startsWith("app_")?f().toLowerCase():e.startsWith("pc_")?"pc":"web";return k.info("getSystemInfoSync",{windowInfo:n,deviceOrientation:t,system:o,platform:r}),u({deviceOrientation:t,SDKVersion:"1.0.0",appVersion:"12.1.0",batteryLevel:98,benchmarkLevel:1,bluetoothEnabled:!1,brand:"huya",cameraAuthorized:!1,deviceId:"none",enableDebug:!1,fontSizeSetting:15,frameworkVersion:"1.0.0",inHUYA:!0,language:"zh_CN",locationAuthorized:!1,locationEnabled:!1,microphoneAuthorized:!0,mode:"default",model:"none",notificationAuthorized:!0,platform:r,system:o,theme:void 0,version:"8.0.28 "},n)},getWindowInfo:function(){return Qe()},getSetting:function(){return{authSetting:{"scope.userInfo":!0},subscriptionsSetting:{},miniprogramAuthSetting:{"scope.userInfo":!0}}},getNetworkType:function(){return{networkType:"wifi",signalStrength:100,hasSystemProxy:!1}}};function Qe(){return p()&&"web_hd_inner"!==(y().extType||"")?function(e){_()?(e.screenWidth=e.windowWidth||window.innerWidth||e.screenWidth,e.screenHeight=e.windowHeight||window.innerHeight||e.screenHeight):(e.screenWidth=e.windowWidth||window.innerWidth,e.screenHeight=e.windowHeight||window.innerHeight);return e}(ge({apiName:"getWindowInfo",params:{}})):Ke()}var Je={showTabBar:function(e){return Ie.emit("showTabBar",e),{errMsg:"showTabBar:ok"}},hideTabBar:function(e){return Ie.emit("hideTabBar",e),{errMsg:"hideTabBar:ok"}},setTabBarStyle:function(e){return Ie.emit("setTabBarStyle",e),{errMsg:"setTabBarStyle:ok"}},setTabBarItem:function(e){return Ie.emit("setTabBarItem",e),{errMsg:"setTabBarItem:ok"}},setTabBarBadge:function(e){return Ie.emit("setTabBarBadge",e),{errMsg:"setTabBarBadge:ok"}},removeTabBarBadge:function(e){return Ie.emit("removeTabBarBadge",e),{errMsg:"removeTabBarBadge:ok"}},hideTabBarRedDot:function(e){return Ie.emit("hideTabBarRedDot",e),{errMsg:"hideTabBarRedDot:ok"}},showTabBarRedDot:function(e){return Ie.emit("showTabBarRedDot",e),{errMsg:"showTabBarRedDot:ok"}}},Ze="insertHTMLWebView",Xe="onWebviewLoad",Ye={insertHTMLWebView:function(e,n,t,o){Pn.initNextWebView(Pn.currPage,e.src,e.src).el.addEventListener("load",(function(){X(Xe,{webviewId:o},o),Y(te+"pageonshow",{})})),X(Ze,e,o)},invokeMiniProgramAPI:function(e,n){console.log(e,n);var t=e.name,o=e.arg,r=bn[t];null!=r&&r(o,n)},postMessage:function(e,n){X("onBindMessage",e,Pn.currPage.webviewId),ie(n,{errMsg:"postMessage:ok"})},canGoBack:function(e,n){ie(n,{errMsg:"canGoBack:fail default to fail"})},canNavigateBack:function(e,n){var t=!1;Pn.allPages.length>1&&(t=!0),ie(n,{errMsg:"canNavigateBack:"+(t?"ok":"fail")})}},en={},nn="onAd";function tn(e){var n=e.type,t=e.adUnitId,o=en[t];if(null!=o)return o;if("rewardedVideo"===n)o=function(e){var n=e.adUnitId,t=ge({apiName:"createRewardedVideoAd",params:{adUnitId:n}});return t.onLoad((function(e){X(nn,{method:"onLoad",adUnitId:n,data:e})})),t.onClose((function(e){X(nn,{method:"onClose",adUnitId:n,data:e})})),t.onError((function(e){X(nn,{method:"onError",adUnitId:n,data:e})})),t}(e);return null!=o&&(en[t]=o),o}var on={ad:function(e,n){return s(void 0,void 0,void 0,(function(){var t,o,r,i;return l(this,(function(a){switch(a.label){case 0:if(t=e.method,e.adUnitId,o=e.type,null==(r=tn(e)))return re(n,{errMsg:"ad:fail 获取"+o+"广告实例失败"}),[2];a.label=1;case 1:switch(a.trys.push([1,12,,13]),t){case"load":return[3,2];case"destroy":return[3,4];case"show":return[3,6];case"hide":return[3,8]}return[3,10];case 2:return[4,r.load()];case 3:return a.sent(),[3,11];case 4:return[4,r.destroy()];case 5:return a.sent(),[3,11];case 6:return[4,r.show()];case 7:return a.sent(),[3,11];case 8:return[4,r.hide()];case 9:return a.sent(),[3,11];case 10:throw new Error("unsupported method: "+t);case 11:return re(n,{errMsg:"ad:ok"}),[3,13];case 12:return i=a.sent(),re(n,{errMsg:"ad:fail adInstance."+t+" call fail, "+(i.mssage||"unknown")}),[3,13];case 13:return[2]}}))}))}},rn={appDataChange:function(e){var n=e.params,t=e.from,o=e.webviewIds,r=e.event;e.webviewId,t===O?console.error("not implement for "+t):(!function(e){var n=u({},e.data),t=Se(n.options.path);t&&(n.windowConfig=t),n.pages=Pn.allPages,Ie.emit("appDataChange",n)}(n),Z(r,n,o))},__updateAppData:function(e){var n,t,o;n={},t=Pn.currPage.pagePath.replace(/\.html$/,""),null!=(o=Se(t))&&(n.windowConfig=o),n.pages=Pn.allPages,n.currPage=t,Ie.emit("updateAppData",n)}};var an={canvasInsert:function(e){var n=e.params,t=e.from;e.webviewIds;var o=e.event,r=e.webviewId;t===O?X(o,n,r):console.error("not implement for "+t)},canvasRemove:function(e){var n=e.params,t=e.from;e.webviewIds;var o=e.event,r=e.webviewId;t===O?X(o,n,r):console.error("not implement for "+t)},CANVAS_EVENT_V2:function(e){var n=e.params,t=e.from;e.webviewIds;var o=e.event,r=e.webviewId;t===O?X(o,n,r):console.error("not implement for "+t)},onCanvasPreloadImage:function(e){var n=e.params,t=e.from;e.webviewIds;var o=e.event,r=e.webviewId;t===O?X(o,n,r):console.error("not implement for "+t)},onCanvasGetImageData:function(e){var n=e.params,t=e.from;e.webviewIds;var o=e.event,r=e.webviewId;t===O?X(o,n,r):console.error("not implement for "+t)},onCanvasPutImageData:function(e){var n=e.params,t=e.from;e.webviewIds;var o=e.event,r=e.webviewId;t===O?X(o,n,r):console.error("not implement for "+t)},canvasActionsChanged:function(e){var n=e.params,t=e.from,o=e.webviewIds,r=e.event;e.webviewId,t===O?console.error("not implement for "+t):Z(r,n,o)},invokeCanvasToDataUrl:function(e){var n=e.params,t=e.from,o=e.webviewIds,r=e.event;e.webviewId,t===O?console.error("not implement for "+t):Z(r,n,o)},invokeCanvasPutImageData:function(e){var n=e.params,t=e.from,o=e.webviewIds,r=e.event;e.webviewId,t===O?console.error("not implement for "+t):Z(r,n,o)},invokeCanvasGetImageData:function(e){var n=e.params,t=e.from,o=e.webviewIds,r=e.event;e.webviewId,t===O?console.error("not implement for "+t):Z(r,n,o)},getImageBase64:function(e){var n=e.params;e.from,e.webviewIds;var t,o=e.event,r=e.webviewId,i=n.src;ve(/^https?:\/\//.test(t=i)||/^hyfile:\/\//.test(t)?t:M+t,{responseType:"arraybuffer"},(function(e,n){if(null!=e)return"";var t=h(n),a=function(e){var n,t=e.split("/"),o=null===(n=t[t.length-1])||void 0===n?void 0:n.split("."),r=o[0],i=o[1];if(null==i||""==i)throw new Error("url:"+e+"格式错误,无法获取文件信息");return{filename:r,ext:i}}(i);Z(o,{src:i,data:"data:image/"+a.ext+";base64,"+t},[r])}))}};function cn(e,n){e.message=n+" stack: "+(null==e?void 0:e.message),Ie.emit("closeLaunchMask"),bn.showToast({title:"加载游戏脚本超时"}),k.error("load game.js error",e.message),xe.captureLoadGameEntryError(e)}var un={gameServiceReady:function(){!function(e){s(this,void 0,void 0,(function(){var n,t,o,r;return l(this,(function(i){switch(i.label){case 0:if(n=window.__deviceOrientation,t=ze(),o="string"==typeof n&&n.includes("landscape"),!("landscape"!==t&&o&&p()&&_()))return[3,5];i.label=1;case 1:return i.trys.push([1,3,,4]),[4,g(5e3,new Promise((function(e){var n=ne();ge({apiName:"setDeviceOrientation",params:{value:"landscape"}}),n.$events.once("onDeviceOrientationChange",(function(n){"landscape"===n.value&&e(!0)}))})))];case 2:return i.sent(),e(),[3,4];case 3:return r=i.sent(),e(r),[3,4];case 4:return[3,6];case 5:e(),i.label=6;case 6:return[2]}}))}))}((function(e){null==e?Ne((function(){k.log("load game.js"),function(){s(this,void 0,void 0,(function(){function e(){return s(this,void 0,void 0,(function(){return l(this,(function(e){switch(e.label){case 0:return[4,J().loadSubBundle("","game.js")];case 1:return e.sent(),Ie.emit("closeLaunchMask"),[2]}}))}))}return l(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,g(18e3,e())];case 1:return n.sent(),[3,3];case 2:return cn(n.sent(),"entry"),[3,3];case 3:return[2]}}))}))}()})):cn(e,"deviceOrientation")}))},gameConfigUpdate:function(e){var n=e.params;Te({windowInfo:bn.getWindowInfo(),wxConfig:n})}},sn=new(function(){function e(){this.reportedFirstScreenTime=!1}return e.prototype.reportFirstScreenTime=function(e){if(!this.reportedFirstScreenTime){var n=window.performanceInfo;null!=n&&(n.firstScreenTime=e),this.reportedFirstScreenTime=!0}},e}()),ln=new(function(){function e(){this.inited=!1,this.__startTime=Date.now(),this.isServiceReady=!1,this.isViewReady=!1,this.showedFirstPage=!1}return Object.defineProperty(e.prototype,"allReady",{get:function(){return this.isViewReady&&this.isServiceReady},enumerable:!1,configurable:!0}),e.prototype.init=function(e){this.inited||(this.inited=!0,this.initIframes(),k.info("initLauncher "+e+" consume: "+(Date.now()-this.__startTime)+"ms"))},e.prototype.initIframes=function(){var e=J(),n=Q();e.updateSrc("./service.html"),n.updateSrc("first")},e.prototype.handleServiceStart=function(e){var n=e.params;Ae=n,Te({wxConfig:n,windowInfo:bn.getWindowInfo()}),Ie.emit("serviceStart",n)},e.prototype.handleServiceReady=function(e){var n=this,t=J();if(!t.isReady){this.root=e.params.root,this.firstWebviewId=e.webviewIds[0],this.isServiceReady=!0;var o=this.firstWebviewId;t.events.once($.onViewDOMContentLoaded,(function(){X("onAppRoute",{path:n.root,openType:"appLaunch",options:void 0,pipMode:"",query:void 0,webviewId:n.firstWebviewId},n.firstWebviewId)})),X("onServiceReadyDone",u(u({},F),{webviewId:o}),o),t.isReady=!0,this.launchPageShow()}},e.prototype.showPage=function(){var e=Pn.currPage;null!=e&&(e.isReady=!0,e.injectScript(),e.show(),this.showedFirstPage||(this.showedFirstPage=!0))},e.prototype.handleViewReady=function(){this.isViewReady=!0,this.showedFirstPage?this.showPage():this.launchPageShow()},e.prototype.handleViewDOMContentLoaded=function(e){var n=e.from,t=J();n===O&&(X("DOMContentLoaded",{},Pn.currPage.webviewId),t.events.emit($.onViewDOMContentLoaded)),Ie.emit("closeLaunchMask")},e.prototype.launchPageShow=function(){if(this.allReady){!function(e,n){var t=function(e){var n=e.tabBar;return null==n||0===(n.list||[]).length?[e.root]:n.list.map((function(e){return e.pagePath}))}(e);Pn.initFirstPage(t,e.root,n)}(ke(),Q()),Pn.initSlotWebviewId(this.firstWebviewId),this.showPage();var e=Date.now(),n=e-this.__startTime;sn.reportFirstScreenTime(e),k.info("init page consume time: "+n+"ms")}},e}()),dn={serviceStart:function(e){ln.handleServiceStart(e)},onLaunchCalled:function(e){},serviceReady:function(e){ln.handleServiceReady(e)},DOMContentLoaded:function(e){ln.handleViewDOMContentLoaded(e)},viewReady:function(){ln.handleViewReady()},DOMReady:function(){}},fn={info:function(e){var n=e.params,t=e.from,o=e.webviewIds,r=e.event;e.webviewId,t===O?console.error("not implement for "+t):Z(r,n,o)},log:function(e){var n=e.params,t=e.from,o=e.webviewIds,r=e.event;e.webviewId,t===O?console.error("not implement for "+t):Z(r,n,o)},warn:function(e){var n=e.params,t=e.from,o=e.webviewIds,r=e.event;e.webviewId,t===O?console.error("not implement for "+t):Z(r,n,o)},error:function(e){var n=e.params,t=e.from,o=e.webviewIds,r=e.event;e.webviewId,t===O?console.error("not implement for "+t):Z(r,n,o)},initLogs:function(e){var n=e.params,t=e.from,o=e.webviewIds,r=e.event;e.webviewId,t===O?console.error("not implement for "+t):Z(r,n,o)},clearLogs:function(e){var n=e.params,t=e.from,o=e.webviewIds,r=e.event;e.webviewId,t===O?console.error("not implement for "+t):Z(r,n,o)},onViewLogEvent:function(e){var n=e.params,t=e.from;e.webviewIds;var o=e.event,r=e.webviewId;t===O?X(o,n,r):console.error("not implement for "+t)}},pn={INVOKE_METHOD:function(e){var n=e.params,t=e.from,o=e.event,r=e.webviewId;t===O?X(o,n,r):console.error("not implement for "+t)},pageonshow:function(e){var n=e.params,t=e.from,o=e.webviewIds,r=e.event;t===O?console.error("not implement for "+t):Z(r,n,o)},pageonhide:function(e){var n=e.params,t=e.from,o=e.webviewIds,r=e.event;t===O?console.error("not implement for "+t):(Z(r,n,o),Y(r,n))},requestLoadFontFace:function(e){var n=e.params,t=e.from,o=e.webviewIds,r=e.event;t===O?console.error("not implement for "+t):Z(r,n,o)},requestLoadGlobalFontFaces:function(e){var n=e.params,t=e.from,o=e.event,r=e.webviewId;t===O?X(o,n,r):console.error("not implement for "+t)},responseLoadGlobalFontFaces:function(e){var n=e.params,t=e.from,o=e.webviewIds,r=e.event;t===O?console.error("not implement for "+t):Z(r,n,o)}};function vn(e){return"string"==typeof e?JSON.parse(e):e}function hn(e){return JSON.parse(JSON.stringify(e))}var gn={SPECIAL_PAGE_EVENT:function(e){var n=e.params,t=e.from;e.webviewIds;var o=e.event,r=e.webviewId;t===O?X(o,n,r):console.error("not implement for "+t)},setKeyboardValue:function(e){var n=e.params,t=e.from,o=e.webviewIds,r=e.event;e.webviewId,t===O?console.error("not implement for "+t):Z(r,n,o)},PAGE_EVENT:function(e){var n=e.params,t=e.from;e.webviewIds;var o=e.event,r=e.webviewId;t===O?X(o,n,r):console.error("not implement for "+t)},vdSync:function(e){var n=e.params,t=e.from,o=e.webviewIds,r=e.event,i=e.webviewId;t===O?X(r,hn(n),i):Z(r,hn(n),o)},vdSyncBatch:function(e){var n=e.params,t=e.from,o=e.webviewIds,r=e.event,i=e.webviewId;t===O?X(r,hn(n),i):Z(r,hn(n),o)}},mn={videoPlayerInsertFinish:function(e){var n=e.params,t=e.from;e.webviewIds;var o=e.event,r=e.webviewId;t===O?X(o,n,r):console.error("not implement for "+t)},videoActionChanged:function(e){var n=e.params,t=e.from,o=e.webviewIds,r=e.event;e.webviewId,t===O?console.error("not implement for "+t):Z(r,n,o)}},wn={openTypeEvent:function(e){var n=e.event,t=e.params,o=e.from,r=e.webviewId;"view"===o&&X(n,t,r)},openTypeEventCallback:function(e){var n=e.event,t=e.params,o=e.from,r=e.webviewIds;"service"===o&&Z(n,t,r)}},yn=u(u(u(u(u(u(u(u(u({},un),dn),an),rn),fn),pn),gn),mn),wn),bn=u(u(u(u(u(u(u(u(u(u(u(u(u({},Me),be),Re),je),Pe),Ve),Ue),He),Je),Ye),fe),Ee),on);function _n(e){var n,t=e.replace(te,""),o=yn[t];if(null==o){var r=/^video_(.*)_actionChanged$/.test(n=t)?"videoActionChanged":/^canvas(.*)actionsChanged$/.test(n)?"canvasActionsChanged":/^invokeCanvasToDataUrl_(.*)$/.test(n)?"invokeCanvasToDataUrl":/^onCanvasToDataUrl_(.*)$/.test(n)?"onCanvasToDataUrl":/^invokeCanvasPutImageData_(.*)$/.test(n)?"invokeCanvasPutImageData":/^onCanvasPutImageData_(.*)$/.test(n)?"onCanvasPutImageData":/^invokeCanvasGetImageData_(.*)$/.test(n)?"invokeCanvasGetImageData":/^onCanvasGetImageData_(.*)$/.test(n)?"onCanvasGetImageData":n;return{handler:yn[r]||null,formatedEvent:r}}return{handler:o,formatedEvent:t}}var xn={invokeHandler:function(e){k.debug("invokeHander",e);var n=e.C,t=e.from,o=e.paramsString,r=e.webviewId,i=e.callbackId,a=vn(o),c=bn[n];if(null!=c){var u=c(a,i,t,r);return u&&u instanceof Promise?void 0:u}var s=ne();if(null!=s)return s.invokeHandler({apiName:n,params:a,callbackId:i,from:t})},publishHandler:function(e){k.debug("publishHandler",e);var n=e.event,t=e.from,o=e.paramsString,r=e.webviewId,i=e.webviewIds,a=_n(n),c=a.handler,u=a.formatedEvent,s=vn(o);if(null!=c)c({event:n,params:s,from:t,webviewId:r,webviewIds:B===t&&i?vn(i):void 0});else{var l=ne();null!=l&&l.publishHandler({formatedEvent:u,event:n,params:s,from:t})}},webInvokeHandler:function(e){E&&console.log("webInvokeHander",e),ie(e.callbackId,vn(e.paramsString))},webPublishHandler:function(e){E&&console.log("webPublishHandler",e),Y(e.event,vn(e.paramsString))}};var An=[],kn=function(e){An.push(e.el.src)},Sn=function(e){An.pop()},In=function(){function e(){this.block=!1,this.queue=[]}return e.prototype.collect=function(e){var n=this;this.block?this.queue.push(e):(this.block=!0,this.queue.push(e),this.timer=setTimeout((function(){n.block=!1,clearTimeout(n.timer),n.comsume()})))},e.prototype.comsume=function(){var e=this.queue;if(this.queue=[],1===e.length)e[0]();else for(var n=0;n<e.length;n++)e[n]()},e}();var Cn=function(e){function n(n){var t=e.call(this,n)||this;return t.webviewId=null,t.pagePath="",t.wrapper=null,t.isDestoryed=!1,t.active=!1,t.__isWebView=!1,t.tickQueue=new In,t}return c(n,e),Object.defineProperty(n.prototype,"isWebView",{get:function(){return this.__isWebView},set:function(e){this.__isWebView=e,e?kn(this):Sn(this)},enumerable:!1,configurable:!0}),n.prototype.appendContainer=function(){var e=this.el;e.className="webview",e.setAttribute("frameborder","0"),this.hide();var n=document.getElementById("webview-container");this.wrapper=n,null!=n&&n.appendChild(e)},n.prototype.show=function(){var e=this.el;e.style.zIndex="2",e.style.opacity="1",this.active=!0,Tn(this,"show")},n.prototype.hide=function(){var e=this.el;e.style.zIndex="1",e.style.opacity="0",this.active=!1,Tn(this,"hide")},n.prototype.updateWebviewId=function(e){this.webviewId=e,this.updateId()},n.prototype.updateId=function(){this.el.id="webview-"+this.webviewId},n.prototype.updateSrc=function(e,n){void 0===n&&(n=P),this.el.src=n,this.pagePath=e},n.prototype.updatePagePath=function(e){this.pagePath=e},n.prototype.injectScript=function(){var e=this.getWindow();if(null!=e&&""!=this.pagePath){var n=this.pagePath.replace(/\.html$/g,""),t=function(e){var n=e.pagePath;return"\n <script>\n var __path__ = '"+e.path+"';\n document.title = __path__;\n document.dispatchEvent(new CustomEvent(\"generateFuncReady\", {\n detail: {\n generateFunc: $gfc('"+n+".wxml') || $gfc('"+n+".hyml')\n }\n }))\n <\/script> \n "}({pagePath:"./"+n,path:n});e.injectHtml(e.document.body,{content:t})}},n.prototype.getBridge=function(){return this.getWindow().FinChatJSBridge},n.prototype.sendToView=function(e,n){var t=this;this.sync?(k.debug("%c "+e,{data:n,webviewId:this.webviewId}),this.getBridge().subscribeHandler(e,n,this.webviewId)):this.tickQueue.collect((function(){k.debug("%c "+e,{data:n,webviewId:t.webviewId}),t.getBridge().subscribeHandler(e,n,t.webviewId)}))},n.prototype.postMessageToWebView=function(e){var n;k.debug("%c postMessageToWebView",e),null===(n=this.el.contentWindow)||void 0===n||n.postMessage(e,"*")},n.prototype.destory=function(){null!==this.wrapper&&this.wrapper.removeChild(this.el),this.el=null,this.wrapper=null,this.isDestoryed=!0,this.active=!1,this.isWebView=!1,Tn(this,"destory")},n}(W);function Tn(e,n){e.isVHost&&e.children&&e.children.length>0&&e.children.forEach((function(e){e[n]()}))}function Mn(e,n){return e._slots.findIndex((function(e){return e===n.replace(/\.html$/,"")}))}var Pn=new(function(){function e(){this._slotStack=[],this._extraStack=[],this._slots=[],this._webviewId=0,this.rootIndex=0}return Object.defineProperty(e.prototype,"pagePath",{get:function(){var e;return(null===(e=this.currPage)||void 0===e?void 0:e.pagePath)||null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currPage",{get:function(){return this.stack[this.stack.length-2]||null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"top",{get:function(){return this.stack[this.stack.length-1]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"stack",{get:function(){var e=this._slotStack[this.rootIndex];return null==e?[]:d([e],this._extraStack)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"allPages",{get:function(){var e=this._slotStack[this.rootIndex];return null==e?[]:d([e],this._extraStack.slice(0,this._extraStack.length-1))},enumerable:!1,configurable:!0}),e.prototype.popExtraStack=function(){var e=this._extraStack,n=e.pop(),t=e.pop();return n&&e.push(n),t},e.prototype.resetExtraStack=function(){if(0!==this._extraStack.length){var e=this.top;this._extraStack.slice(0,this._extraStack.length-1).forEach((function(e){e.destory()})),this._extraStack=[e]}},e.prototype.initFirstPage=function(e,n,t){if(!Array.isArray(e)||0===e.length)throw new Error("slots must exist.");var o=Mn(this,n);o>-1&&(this.rootIndex=o),this._slots=e;for(var r=0;r<e.length;r++){var i=void 0;if(t&&r===this.rootIndex)i=t;else{var a=document.createElement("iframe");(i=new Cn(a)).appendContainer()}i&&this._slotStack.push(i)}var c=this._slotStack[this.rootIndex];t?c.updatePagePath(n):c.updateSrc(n),this.initEmptyPage()},e.prototype.initEmptyPage=function(){var e=document.createElement("iframe"),n=new Cn(e);n.appendContainer(),this._extraStack.push(n)},e.prototype.initNextPage=function(e,n){var t=this.currPage,o=this.top;return t.hide(),o.updateSrc(e,n),o.updateWebviewId(this._webviewId++),this.initEmptyPage(),o},e.prototype.initNextWebView=function(e,n,t){var o=this.initNextPage(n,t),r=this._extraStack.findIndex((function(e){return e.pagePath===n}));return r>-1&&this._extraStack.splice(r,1),e.children=[o],e.isVHost=!0,o.el.setAttribute("sandbox","allow-same-origin allow-scripts"),o.isWebView=!0,o.show(),o},e.prototype.initSlotWebviewId=function(e){this._webviewId=e,this._slotStack[this.rootIndex].updateWebviewId(this._webviewId++)},e.prototype.reinitPages=function(e){var n=this._slotStack,t=this._extraStack;n.forEach((function(e){e.destory()})),t.forEach((function(e){e.destory()})),this._slotStack=[],this._extraStack=[],this.initFirstPage(this._slots,e),this.currPage.updateWebviewId(this._webviewId++)},e.prototype.reLaunch=function(e){this.reinitPages(e)},e.prototype.redirectTo=function(e){if(Mn(this,e)>-1)throw new Error("不允许跳转到 tabbar 页面:"+e);var n=this._extraStack;if(n.length>1){var t=n.pop();n.pop().destory(),t.updateSrc(e),t.updateWebviewId(this._webviewId++),n.push(t),this.initEmptyPage()}else{null==(t=n.pop())||t.destory(),this._slotStack.forEach((function(e){e.destory()})),this.reinitPages(e)}},e.prototype.switch=function(e,n){n=null!=n?n:Mn(this,e);var t=this._slotStack,o=t[n];if(null==o)throw new Error("switchTab url is invalid: "+e);return this.resetExtraStack(),t.forEach((function(e){e.isReady&&e.hide()})),this.rootIndex=n,o.isReady?o.show():(o.updateWebviewId(this._webviewId++),o.updateSrc(e)),o},e.prototype.go=function(e){var n=Mn(this,e);return n>-1?this.switch(e,n):this.initNextPage(e)},e.prototype.back=function(e){var n,t=this._extraStack.slice(),o=t.pop(),r=t.length;if(e<=0)throw new Error("delta 不能 <= 0");if(r<e)throw new Error("delta 不能超过总栈长度:"+(r+1));var i=r-e,a=t.slice(0,i);(t.slice(i,r).forEach((function(e){e.destory()})),a.length>0)?a[a.length-1].show():null===(n=this._slotStack[this.rootIndex])||void 0===n||n.show();o&&a.push(o),this._extraStack=a},e}()),En=function(){function e(){this._invokeServiceCallbackHandler=re,this._dispatchViewEvent=Z,this._dispatchServiceEvent=X,this.$events=new i,this._getCurrentPage=function(){return Pn.currPage},this._getAllPages=function(){return Pn.allPages}}return e.prototype.init=function(){ee=this},e}(),Bn=r((function(e,n){
|
42
|
+
function(){var e;HowlerGlobal.prototype._pos=[0,0,0],HowlerGlobal.prototype._orientation=[0,0,-1,0,1,0],HowlerGlobal.prototype.stereo=function(e){var n=this;if(!n.ctx||!n.ctx.listener)return n;for(var t=n._howls.length-1;t>=0;t--)n._howls[t].stereo(e);return n},HowlerGlobal.prototype.pos=function(e,n,t){var r=this;return r.ctx&&r.ctx.listener?(n="number"!=typeof n?r._pos[1]:n,t="number"!=typeof t?r._pos[2]:t,"number"!=typeof e?r._pos:(r._pos=[e,n,t],void 0!==r.ctx.listener.positionX?(r.ctx.listener.positionX.setTargetAtTime(r._pos[0],Howler.ctx.currentTime,.1),r.ctx.listener.positionY.setTargetAtTime(r._pos[1],Howler.ctx.currentTime,.1),r.ctx.listener.positionZ.setTargetAtTime(r._pos[2],Howler.ctx.currentTime,.1)):r.ctx.listener.setPosition(r._pos[0],r._pos[1],r._pos[2]),r)):r},HowlerGlobal.prototype.orientation=function(e,n,t,r,o,i){var a=this;if(!a.ctx||!a.ctx.listener)return a;var s=a._orientation;return n="number"!=typeof n?s[1]:n,t="number"!=typeof t?s[2]:t,r="number"!=typeof r?s[3]:r,o="number"!=typeof o?s[4]:o,i="number"!=typeof i?s[5]:i,"number"!=typeof e?s:(a._orientation=[e,n,t,r,o,i],void 0!==a.ctx.listener.forwardX?(a.ctx.listener.forwardX.setTargetAtTime(e,Howler.ctx.currentTime,.1),a.ctx.listener.forwardY.setTargetAtTime(n,Howler.ctx.currentTime,.1),a.ctx.listener.forwardZ.setTargetAtTime(t,Howler.ctx.currentTime,.1),a.ctx.listener.upX.setTargetAtTime(r,Howler.ctx.currentTime,.1),a.ctx.listener.upY.setTargetAtTime(o,Howler.ctx.currentTime,.1),a.ctx.listener.upZ.setTargetAtTime(i,Howler.ctx.currentTime,.1)):a.ctx.listener.setOrientation(e,n,t,r,o,i),a)},Howl.prototype.init=(e=Howl.prototype.init,function(n){var t=this;return t._orientation=n.orientation||[1,0,0],t._stereo=n.stereo||null,t._pos=n.pos||null,t._pannerAttr={coneInnerAngle:void 0!==n.coneInnerAngle?n.coneInnerAngle:360,coneOuterAngle:void 0!==n.coneOuterAngle?n.coneOuterAngle:360,coneOuterGain:void 0!==n.coneOuterGain?n.coneOuterGain:0,distanceModel:void 0!==n.distanceModel?n.distanceModel:"inverse",maxDistance:void 0!==n.maxDistance?n.maxDistance:1e4,panningModel:void 0!==n.panningModel?n.panningModel:"HRTF",refDistance:void 0!==n.refDistance?n.refDistance:1,rolloffFactor:void 0!==n.rolloffFactor?n.rolloffFactor:1},t._onstereo=n.onstereo?[{fn:n.onstereo}]:[],t._onpos=n.onpos?[{fn:n.onpos}]:[],t._onorientation=n.onorientation?[{fn:n.onorientation}]:[],e.call(this,n)}),Howl.prototype.stereo=function(e,t){var r=this;if(!r._webAudio)return r;if("loaded"!==r._state)return r._queue.push({event:"stereo",action:function(){r.stereo(e,t)}}),r;var o=void 0===Howler.ctx.createStereoPanner?"spatial":"stereo";if(void 0===t){if("number"!=typeof e)return r._stereo;r._stereo=e,r._pos=[e,0,0]}for(var i=r._getSoundIds(t),a=0;a<i.length;a++){var s=r._soundById(i[a]);if(s){if("number"!=typeof e)return s._stereo;s._stereo=e,s._pos=[e,0,0],s._node&&(s._pannerAttr.panningModel="equalpower",s._panner&&s._panner.pan||n(s,o),"spatial"===o?void 0!==s._panner.positionX?(s._panner.positionX.setValueAtTime(e,Howler.ctx.currentTime),s._panner.positionY.setValueAtTime(0,Howler.ctx.currentTime),s._panner.positionZ.setValueAtTime(0,Howler.ctx.currentTime)):s._panner.setPosition(e,0,0):s._panner.pan.setValueAtTime(e,Howler.ctx.currentTime)),r._emit("stereo",s._id)}}return r},Howl.prototype.pos=function(e,t,r,o){var i=this;if(!i._webAudio)return i;if("loaded"!==i._state)return i._queue.push({event:"pos",action:function(){i.pos(e,t,r,o)}}),i;if(t="number"!=typeof t?0:t,r="number"!=typeof r?-.5:r,void 0===o){if("number"!=typeof e)return i._pos;i._pos=[e,t,r]}for(var a=i._getSoundIds(o),s=0;s<a.length;s++){var u=i._soundById(a[s]);if(u){if("number"!=typeof e)return u._pos;u._pos=[e,t,r],u._node&&(u._panner&&!u._panner.pan||n(u,"spatial"),void 0!==u._panner.positionX?(u._panner.positionX.setValueAtTime(e,Howler.ctx.currentTime),u._panner.positionY.setValueAtTime(t,Howler.ctx.currentTime),u._panner.positionZ.setValueAtTime(r,Howler.ctx.currentTime)):u._panner.setPosition(e,t,r)),i._emit("pos",u._id)}}return i},Howl.prototype.orientation=function(e,t,r,o){var i=this;if(!i._webAudio)return i;if("loaded"!==i._state)return i._queue.push({event:"orientation",action:function(){i.orientation(e,t,r,o)}}),i;if(t="number"!=typeof t?i._orientation[1]:t,r="number"!=typeof r?i._orientation[2]:r,void 0===o){if("number"!=typeof e)return i._orientation;i._orientation=[e,t,r]}for(var a=i._getSoundIds(o),s=0;s<a.length;s++){var u=i._soundById(a[s]);if(u){if("number"!=typeof e)return u._orientation;u._orientation=[e,t,r],u._node&&(u._panner||(u._pos||(u._pos=i._pos||[0,0,-.5]),n(u,"spatial")),void 0!==u._panner.orientationX?(u._panner.orientationX.setValueAtTime(e,Howler.ctx.currentTime),u._panner.orientationY.setValueAtTime(t,Howler.ctx.currentTime),u._panner.orientationZ.setValueAtTime(r,Howler.ctx.currentTime)):u._panner.setOrientation(e,t,r)),i._emit("orientation",u._id)}}return i},Howl.prototype.pannerAttr=function(){var e,t,r,o=this,i=arguments;if(!o._webAudio)return o;if(0===i.length)return o._pannerAttr;if(1===i.length){if("object"!=typeof i[0])return(r=o._soundById(parseInt(i[0],10)))?r._pannerAttr:o._pannerAttr;e=i[0],void 0===t&&(e.pannerAttr||(e.pannerAttr={coneInnerAngle:e.coneInnerAngle,coneOuterAngle:e.coneOuterAngle,coneOuterGain:e.coneOuterGain,distanceModel:e.distanceModel,maxDistance:e.maxDistance,refDistance:e.refDistance,rolloffFactor:e.rolloffFactor,panningModel:e.panningModel}),o._pannerAttr={coneInnerAngle:void 0!==e.pannerAttr.coneInnerAngle?e.pannerAttr.coneInnerAngle:o._coneInnerAngle,coneOuterAngle:void 0!==e.pannerAttr.coneOuterAngle?e.pannerAttr.coneOuterAngle:o._coneOuterAngle,coneOuterGain:void 0!==e.pannerAttr.coneOuterGain?e.pannerAttr.coneOuterGain:o._coneOuterGain,distanceModel:void 0!==e.pannerAttr.distanceModel?e.pannerAttr.distanceModel:o._distanceModel,maxDistance:void 0!==e.pannerAttr.maxDistance?e.pannerAttr.maxDistance:o._maxDistance,refDistance:void 0!==e.pannerAttr.refDistance?e.pannerAttr.refDistance:o._refDistance,rolloffFactor:void 0!==e.pannerAttr.rolloffFactor?e.pannerAttr.rolloffFactor:o._rolloffFactor,panningModel:void 0!==e.pannerAttr.panningModel?e.pannerAttr.panningModel:o._panningModel})}else 2===i.length&&(e=i[0],t=parseInt(i[1],10));for(var a=o._getSoundIds(t),s=0;s<a.length;s++)if(r=o._soundById(a[s])){var u=r._pannerAttr;u={coneInnerAngle:void 0!==e.coneInnerAngle?e.coneInnerAngle:u.coneInnerAngle,coneOuterAngle:void 0!==e.coneOuterAngle?e.coneOuterAngle:u.coneOuterAngle,coneOuterGain:void 0!==e.coneOuterGain?e.coneOuterGain:u.coneOuterGain,distanceModel:void 0!==e.distanceModel?e.distanceModel:u.distanceModel,maxDistance:void 0!==e.maxDistance?e.maxDistance:u.maxDistance,refDistance:void 0!==e.refDistance?e.refDistance:u.refDistance,rolloffFactor:void 0!==e.rolloffFactor?e.rolloffFactor:u.rolloffFactor,panningModel:void 0!==e.panningModel?e.panningModel:u.panningModel};var c=r._panner;c||(r._pos||(r._pos=o._pos||[0,0,-.5]),n(r,"spatial"),c=r._panner),c.coneInnerAngle=u.coneInnerAngle,c.coneOuterAngle=u.coneOuterAngle,c.coneOuterGain=u.coneOuterGain,c.distanceModel=u.distanceModel,c.maxDistance=u.maxDistance,c.refDistance=u.refDistance,c.rolloffFactor=u.rolloffFactor,c.panningModel=u.panningModel}return o},Sound.prototype.init=function(e){return function(){var n=this,t=n._parent;n._orientation=t._orientation,n._stereo=t._stereo,n._pos=t._pos,n._pannerAttr=t._pannerAttr,e.call(this),n._stereo?t.stereo(n._stereo):n._pos&&t.pos(n._pos[0],n._pos[1],n._pos[2],n._id)}}(Sound.prototype.init),Sound.prototype.reset=function(e){return function(){var n=this,t=n._parent;return n._orientation=t._orientation,n._stereo=t._stereo,n._pos=t._pos,n._pannerAttr=t._pannerAttr,n._stereo?t.stereo(n._stereo):n._pos?t.pos(n._pos[0],n._pos[1],n._pos[2],n._id):n._panner&&(n._panner.disconnect(0),n._panner=void 0,t._refreshBuffer(n)),e.call(this)}}(Sound.prototype.reset);var n=function(e,n){"spatial"===(n=n||"spatial")?(e._panner=Howler.ctx.createPanner(),e._panner.coneInnerAngle=e._pannerAttr.coneInnerAngle,e._panner.coneOuterAngle=e._pannerAttr.coneOuterAngle,e._panner.coneOuterGain=e._pannerAttr.coneOuterGain,e._panner.distanceModel=e._pannerAttr.distanceModel,e._panner.maxDistance=e._pannerAttr.maxDistance,e._panner.refDistance=e._pannerAttr.refDistance,e._panner.rolloffFactor=e._pannerAttr.rolloffFactor,e._panner.panningModel=e._pannerAttr.panningModel,void 0!==e._panner.positionX?(e._panner.positionX.setValueAtTime(e._pos[0],Howler.ctx.currentTime),e._panner.positionY.setValueAtTime(e._pos[1],Howler.ctx.currentTime),e._panner.positionZ.setValueAtTime(e._pos[2],Howler.ctx.currentTime)):e._panner.setPosition(e._pos[0],e._pos[1],e._pos[2]),void 0!==e._panner.orientationX?(e._panner.orientationX.setValueAtTime(e._orientation[0],Howler.ctx.currentTime),e._panner.orientationY.setValueAtTime(e._orientation[1],Howler.ctx.currentTime),e._panner.orientationZ.setValueAtTime(e._orientation[2],Howler.ctx.currentTime)):e._panner.setOrientation(e._orientation[0],e._orientation[1],e._orientation[2])):(e._panner=Howler.ctx.createStereoPanner(),e._panner.pan.setValueAtTime(e._stereo,Howler.ctx.currentTime)),e._panner.connect(e._node),e._paused||e._parent.pause(e._id,!0).play(e._id,!0)}}()}));function oe(e,n,t){z(K).invokeCallbackHandler(e,n,t)}function ie(e,n,t){var r,o=null===(r=Cn.currPage)||void 0===r?void 0:r.children;if(Array.isArray(o)&&o.length>0){var i=o[0];i&&i.isWebView&&i.postMessageToWebView({callbackId:e,type:"webInvokeCallbackHandler",params:n})}}var ae={},se={};function ue(e,n){var t=ae[e],r=se[e];return null!=t?""!=n.src&&r!=n.src?(t.unload(),delete ae[e],delete se[e],ue(e,n)):t:(se[e]=n.src,ae[e]=function(e,n){var t=new re.Howl({autoplay:e.autoplay,loop:e.loop,src:e.src,rate:e.playbackRate,onend:function(){Z(le,{innerAudioContextId:n,method:de.onEnded,data:{}})},onplay:function(){Z(le,{innerAudioContextId:n,method:de.onPlay,data:{buffered:0,currentTime:0,duration:0}})},onpause:function(e){Z(le,{innerAudioContextId:e,method:de.onPause,data:{}})},onstop:function(){Z(le,{innerAudioContextId:n,method:de.onStop,data:{}})},onseek:function(){Z(le,{innerAudioContextId:n,method:de.onSeeked,data:{}})},onplayerror:function(e,n){Z(le,{innerAudioContextId:e,method:de.onError,data:{errMsg:"播放失败 :"+n,errCode:-1}})},onloaderror:function(e,n){Z(le,{innerAudioContextId:e,method:de.onError,data:{errMsg:"播放失败 :"+n,errCode:10002}})},onrate:function(e){console.log("audio进度改变")},onload:function(){Z(le,{innerAudioContextId:n,method:de.onCanplay,data:{}})}});return t}(n,e))}function ce(e,n,t){var r=ae[n];if(null==r){var o=e+":fail 无法找到innerAudioContextId:"+n+"对应的audio实例";throw oe(t,{errMsg:o}),new Error(o)}return r}re.Howler.autoSuspend=!1;var de={onCanplay:"onCanplay",onEnded:"onEnded",onError:"onError",onPause:"onPause",onPlay:"onPlay",onSeeked:"onSeeked",onSeeking:"onSeeking",onStop:"onStop",onTimeUpdate:"onTimeUpdate",onWaiting:"onWaiting"},le="onInnerAudio";var fe={innerAudio:function(e,n){var t,r=e.method,o=e.data,i=e.innerAudioContextId;switch(r){case"create":break;case"play":(t=ue(i,o)).loop(o.loop),t.volume(o.volume),o.isPlayMethod&&t.play();break;case"stop":ce(r,i,n).stop();break;case"seek":(t=ce(r,i,n)).seek(o.position);break;case"pause":ce(r,i,n).pause();break;case"destroy":ce(r,i,n).unload();break;default:throw new Error("无法处理音频method:"+r)}return{errMsg:"innerAudio:ok"}}};function pe(e){return/^http(s?)\:\/\//.test(e)}function ve(e,n,t){var r=new XMLHttpRequest,o=!0;if(null!=n.sync&&(o=!n.sync),null!=n.responseType&&(r.responseType=n.responseType),r.open("GET",e,o),null!=n.header)for(var i in n.header)r.setRequestHeader(i,n.header[i]);r.onload=function(e){t(null,r.response,{e:e,xhr:r})},r.onerror=function(e){t(new Error("request settings failed!"),null,{e:e,xhr:r})},r.send(null)}var he={readFileSync:function(e){var n,t=e.filePath;if(t.startsWith(N))return{data:null,errMsg:"readFileSync:fail not support local file."};t=pe(t=(n=t).endsWith(".wasm")?n+".txt":n)?t:M+t;var r=null,o=null;return ve(t,{sync:!0},(function(e,n){r=n,o=e})),null!=r?{data:r,errMsg:"readFileSync:ok"}:null!=o?{data:null,errMsg:"readFileSync:fail "+o.message}:{data:null,errMsg:"readFileSync:fail"}},readFile:function(e,n){var t=e.filePath,r="base64"===e.encoding,o=pe(t)?t:M+t;t.startsWith(N)?oe(n,{errMsg:"readFile:fail not support local file: "+t}):ve(o,{responseType:r?"arraybuffer":""},(function(e,t){oe(n,null==e?{data:r?h(t):t,errMsg:"readFile:ok"}:{errMsg:"readFile:fail "+e.message})}))},access:function(){return{errMsg:"access:ok"}},rename:function(){return{errMsg:"rename:ok"}},mkdirSync:function(){return{errMsg:"mkdirSync:ok"}},writeFile:function(){return{errMsg:"writeFile:ok"}},writeFileSync:function(e){return e.filePath,e.data,{errMsg:"writeFileSync:ok"}},unlink:function(e,n){return e.filePath,{errMsg:"unlink:ok"}},downloadFile:function(e,n){var t=e.url,r=e.timeout,o=void 0===r?6e3:r;e.taskId,e.header,e.filePath,_(o,function(e){var n=e.url,t=e.callbackId;return e.filePath,e.header,c(this,void 0,void 0,(function(){return d(this,(function(e){return Z(H,{cookies:[],progress:100,totalBytesExpectedToWrite:100,totalBytesWritten:100}),Z(D,{cookies:[],header:{}}),oe(t,{filePath:n,tempFilePath:n,profile:[],statusCode:200,errMsg:"downloadFile:ok"}),[2]}))}))}({url:t,callbackId:n}),(function(e){oe(n,{errMsg:"downloadFile:fail timeout in "+e+"ms."})}))},copyFile:function(e,n){return e.srcPath,e.destPath,oe(n,{errMsg:"copyFile:ok fake subpport."},"copyFile")}};function _e(e){return ne().invokeHandler({callbackId:e.callbackId||-1,apiName:e.apiName,params:e.params,from:"service"})}var me,ge,we,ye=R?he:(me=he,ge={readFileSync:{onMobile:be},readFile:{onMobile:be},access:{onMobile:be},rename:{onCallBefore:function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var t=e.shift();return t&&t.fatNewPath&&(t.newPath=t.fatNewPath,delete t.fatNewPath),t&&e.unshift(t),e}},downloadFile:{onCallBefore:function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var t=e[0];if(null!=t){var r=t.header;if(r&&r.Referer)throw new Error("header不能设置Referer字段");t.source="miniGame"}return e}}},we=ge||{},Object.keys(me).reduce((function(e,n){var t=me[n];return e[n]=function(){for(var e,r,o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];var a=p(),s=we[n],u={callNativeApi:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return _e({apiName:n,params:e[0],callbackId:e[1]})},callPatchApi:function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return t.apply(void 0,e)}};try{return s&&"function"==typeof s.onCallBefore&&(o=(e=s.onCallBefore).call.apply(e,l([u],o))),a?s&&"function"==typeof s.onMobile?(r=s.onMobile).call.apply(r,l([u],o)):u.callNativeApi.apply(u,o):u.callPatchApi.apply(u,o)}catch(e){return{errMsg:n+":fail error occured in polyfill api, "+e.message}}},e}),{}));function be(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var t=e[0],r=t.filePath||t.path,o=this;return r.startsWith(V)?o.callNativeApi.apply(o,e):o.callPatchApi.apply(o,e)}var Se=new(function(){function e(){this.reportedEventType=new Set(["ErrorType"])}return Object.defineProperty(e.prototype,"sentry",{get:function(){return window.Sentry},enumerable:!1,configurable:!0}),e.prototype.captureException=function(e,n){var t=this.sentry;if(null!=t){var r=n.event_desc;delete n.event_desc,t.captureException(function(e,n){var t=new Error,r=e.charAt(0).toUpperCase()+e.slice(1),o=function(e){try{return JSON.parse(e)}catch(n){return e}}(n);"string"==typeof o?(t.stack=o,t.message=o):(t.message=r+": "+o.msg,t.stack=o.stack);return t}(e,r))}else console.log("Sentry is not ready yet.")},e.prototype.captureLoadGameEntryError=function(e){Se.captureException("LoadGameEntryError",{event_desc:"load game entry bundle fail: \n"+e.message+"\n"+e.stack})},e}()),Ae=null;function Ie(){if(null==Ae)throw new Error("WxConfig is not ready.");return Ae}function ke(e){var n=Ie(),t=n.windows.pages;return null!=t&&t[e]?Object.assign({},n.window,t[e]):null}var Te=new i;function xe(){Te.on("NavigatorBarTools:onMore",(function(){yn.showToast({title:"暂未实现该功能"})})),Te.on("NavigatorBarTools:onClose",(function(){var e=ne();null!=e&&e.invokeHandler({callbackId:-1,apiName:"exitMiniProgram",params:{},from:"service"})})),Te.on("NavigatorBar:onBack",(function(){Ne.navigateBack({delta:1}),console.log("onBack")})),Te.on("TabBar:change",(function(e){var n,t,r;Z("onTabItemTap",{index:e.index,pagePath:e.item.pagePath,text:e.item.text}),Ne.switchTab({url:e.item.pagePath},-1),n=e.item.pagePath,t={},null!=(r=ke(n))&&(t.windowConfig=r),Te.emit("tabItemChanged",t)})),Te.on("invokeCallbackHandler",(function(e){oe(e.callbackId,e.data)})),Te.on("dispatchServiceEvent",(function(e){Z(e.event,e.payload)}))}function Pe(e){void 0!==window.__initWebFrame&&window.__initWebFrame(e,Te)}var Me={getGlobalVariables:function(e){return"_launchOption"===e.variable?{_launchOption:B}:null},onWindowResize:function(){},offWindowResize:function(){},reportApmMonitor:function(e){var n=e.eventName,t=e.payload,r=e.eventType;e.timestamp,Se.reportedEventType.has(r)?Se.captureException(n,t):"LogReport"===r&&t.event},addPerformance:function(e){},initReady:function(){},updateAppData:function(){},injectHtmlCallback:function(e,n,t){"service"===t&&Q().events.emit(G.onInjectHTMLCallback)},pageScrollTo:function(e,n){var t=e.scrollTop;e.duration;var r=Cn.currPage.getWindow();return null==r||r.scrollTo({top:t,behavior:"smooth"}),{errMsg:"pageScrollTo:ok"}},getMenuButtonBoundingClientRect:function(e,n){Te.emit("getMenuButtonBoundingClientRect",e,n)},getAccountInfoSync:function(){var e=window.__extInfo;return{data:{miniProgram:u(u({},e),{appId:null==e?void 0:e.extUuid,envVersion:null==e?void 0:e.envVersion,version:"",forceUsePatchApi:R}),plugin:{appId:"",version:""}}}},jssdkConfig:function(e,n){var t=e.jsApiList,r=[];if((void 0===t?[]:t).forEach((function(e){null==yn[e]&&r.push(e)})),!(r.length>0))return ie(n,{errMsg:"jssdkConfig:ok"});ie(n,{errMsg:"jssdkConfig:fail "+r.join(",")+" 未实现."})}},Ce={hideToast:function(e){return Te.emit("hideToast",e),{errMsg:"hideToast:ok"}},showToast:function(e){return Te.emit("showToast",e),{errMsg:"showToast:ok"}},showLoading:function(e){return Te.emit("showLoading",e),{errMsg:"showLoading:ok"}},hideLoading:function(e){return Te.emit("hideLoading",e),{errMsg:"hideLoading:ok"}},showModal:function(e,n){Te.emit("showModal",e,n)},showActionSheet:function(e,n){Te.emit("showActionSheet",e,n)}},Ee={showGameKeyboard:function(e){return p()?_e({apiName:"showGameKeyboard",params:e}):Te.emit("showKeyboard",e),{}},hideGameKeyboard:function(e){return p()||Te.emit("hideKeyboard",e),{}},updateGameKeyboard:function(e){return p()||Te.emit("updateKeyboard",e),{}},showKeyboard:function(e){return p()?_e({apiName:"showGameKeyboard",params:e}):Te.emit("showKeyboard",e),{}},hideKeyboard:function(e){return Te.emit("hideKeyboard",e),{}},updateKeyboard:function(e){return Te.emit("updateKeyboard",e),{}}};function Fe(e,n){if(e===W)return'<script charset="utf-8" src="'+n.moduleName+'game.js"><\/script>';if("miniProgram"===e)return n.content;throw Error("unsupported projectType: "+e)}var Oe=function(e){function n(n){return e.call(this,u(u({},n),{projectType:W}))||this}return s(n,e),n.prototype.injectScript=function(){var e=z(K).getWindow();e.injectHtml(e.document.body,{content:Fe(this.projectType,{moduleName:this.moduleName})})},n.prototype.getEntry=function(){return e=this.projectType,n={moduleName:this.moduleName},e===W?n.moduleName+"game.js":"";var e,n},n}(function(){function e(e){this.taskId=e.taskId,this.moduleName=e.moduleName,this.projectType=e.projectType,this.status="none"}return e.prototype.notifyProgressUpdate=function(e,n){Z("onLoadSubPackageTaskStateChange",u({moduleName:this.moduleName,state:e,taskId:this.taskId},n))},e.prototype.injectScript=function(){},e.prototype.getEntry=function(){},e.prototype.load=function(e,n){return c(this,void 0,void 0,(function(){return d(this,(function(e){return this.notifyProgressUpdate("progressUpdate",{progress:0}),this.notifyProgressUpdate("progressUpdate",{progress:50}),this.injectScript(),this.notifyProgressUpdate("progressUpdate",{progress:100}),[2]}))}))},e}()),Le=0,Be={},He={createLoadSubPackageTask:function(e,n){var t=e.moduleName,r=Be[t];if(r&&"success"===r.status)return{errMsg:"createLoadSubPackageTask:fail sub package already loaded."};++Le;var o=String(Le);return r=new Oe({taskId:o,moduleName:t}),Q().events.once(G.onInjectHTMLCallback,(function(){r.status="success",r.notifyProgressUpdate("success",{entryPath:r.getEntry()})})),Be[t]=r,r.load(o,n),{errMsg:"createLoadSubPackageTask:ok",loadTaskId:Le}}},De={showNavigationBarLoading:function(){return Te.emit("showNavigationBarLoading"),{errMsg:"showNavigationBarLoading:ok"}},setNavigationBarTitle:function(e){return Te.emit("setNavigationBarTitle",e),{errMsg:"setNavigationBarTitle:ok"}},setNavigationBarColor:function(e){return Te.emit("setNavigationBarColor",e),{errMsg:"setNavigationBarColor:ok"}},hideNavigationBarLoading:function(){return Te.emit("hideNavigationBarLoading"),{errMsg:"hideNavigationBarLoading:ok"}},hideHomeButton:function(){}};function We(e,n){var t,r=function(e){e=e.replace(/\.html$/,"");var n=Ie(),t=n.subpackages;if(Array.isArray(t)&&t.length>0)return t.find((function(n){return n.pageFullPath.includes(e)}));return null}(e);null==r||(t=r.root,U[t])?n():function(e,n){var t=z(K);t.events.once(G.onInjectHTMLCallback,n),t.loadSubBundle(e.root,e.packageName+".js")}(r,n)}var Ne={navigateTo:function(e,n){var t=e.url;if(Cn.stack.length>10)return{errMsg:"navigateTo:fail 已到达页面栈上限:10。"};var r=v(t),o=r.path,i=r.query;return We(o,(function(){var e=Cn.go(o);Q().events.once(G.onViewDOMContentLoaded,(function(){Z("onAppRoute",{path:o,openType:"navigateTo",options:void 0,pipMode:"",query:i,webviewId:e.webviewId},e.webviewId)}))})),{errMsg:"navigateTo:ok"}},navigateBack:function(e){var n=e.delta;try{Cn.back(n)}catch(e){return{errMsg:"navigateBack:fail "+e.message}}var t=Cn.currPage;return Z("onAppRoute",{path:t.pagePath,openType:"navigateBack",options:{delta:n},pipMode:"",query:void 0,webviewId:t.webviewId},t.webviewId),{errMsg:"navigateBack:ok"}},reLaunch:function(e,n){var t=e.url,r=v(t),o=r.path,i=r.query;We(o,(function(){Cn.reLaunch(t);var e=Cn.currPage;Q().events.once(G.onViewDOMContentLoaded,(function(){Z("onAppRoute",{path:o,openType:"reLaunch",options:void 0,pipMode:"",query:i,webviewId:e.webviewId},e.webviewId),oe(n,{errMsg:"reLaunch:ok"})}))}))},redirectTo:function(e,n){var t=v(e.url),r=t.path,o=t.query;We(r,(function(){try{Cn.redirectTo(r)}catch(e){return void oe(n,{errMsg:"redirectTo:fail "+e.message})}var e=Cn.currPage;Q().events.once(G.onViewDOMContentLoaded,(function(){Z("onAppRoute",{path:r,openType:"redirectTo",options:void 0,pipMode:"",query:o,webviewId:e.webviewId},e.webviewId),oe(n,{errMsg:"redirectTo:ok"})}))}))},switchTab:function(e,n){var t=v(e.url),r=t.path,o=t.query;We(r,(function(){try{Cn.switch(r)}catch(e){return void oe(n,{errMsg:"switchTab:fail "+e.message})}var e=Cn.currPage;e.isReady?(Z("onAppRoute",{path:r,openType:"switchTab",options:void 0,pipMode:"",query:o,webviewId:e.webviewId},e.webviewId),oe(n,{errMsg:"switchTab:ok"})):Q().events.once(G.onViewDOMContentLoaded,(function(){Z("onAppRoute",{path:r,openType:"switchTab",options:void 0,pipMode:"",query:o,webviewId:e.webviewId},e.webviewId),oe(n,{errMsg:"switchTab:ok"})}))}))}};function Ve(e){setTimeout(e,16)}function Re(e){var n=y();if(null==n)throw new Error("获取 extUuid 失败 by storage api");return n+"-"+e}function je(e){var n=y();if(null==n)throw new Error("获取 extUuid 失败 by storage api");return e.replace(new RegExp("^"+n+"-"),"")}function Ge(e){return Number((e/1024).toFixed(2))}var Ue={getStorageSync:function(e){return{data:localStorage.getItem(Re(e.key))||null}},getStorage:function(e,n){Ve((function(){oe(n,{data:Ue.getStorageSync(e)})}))},setStorageSync:function(e){return localStorage.setItem(Re(e.key),e.data),{errMsg:"setStorageSync:ok"}},setStorage:function(e,n){Ve((function(){localStorage.setItem(e.key,e.data),oe(n,{errMsg:"setStorage:ok"})}))},removeStorageSync:function(e){return localStorage.removeItem(Re(e.key)),{errMsg:"removeStorageSync:ok"}},removeStorage:function(e,n){Ve((function(){localStorage.removeItem(Re(e.key)),oe(n,{errMsg:"removeStorage:ok"})}))},clearStorageSync:function(){return localStorage.clear(),{errMsg:"clearStorageSync:ok"}},clearStorage:function(e,n){Ve((function(){localStorage.clear(),oe(n,{errMsg:"clearStorage:ok"})}))},getStorageInfoSync:function(){var e=function(){var e=0,n=[];for(var t in localStorage)Object.prototype.hasOwnProperty.call(localStorage,t)&&(e+=localStorage[t].length,n.push(je(t)));return{size:e,keys:n}}(),n=e.size;return{keys:e.keys,currentSize:Ge(n),limitSize:Ge(10485760)}},getStorageInfo:function(e,n){Ve((function(){oe(n,u(u({},Ue.getStorageInfoSync()),{errMsg:"getStorageInfo:ok"}))}))}};function qe(){var e=f();return("Android"===e||"IOS"===e)&&window.matchMedia("(orientation: portrait)").matches?"portrait":"landscape"}function Ke(){var e,n,t,r=null===(e=Cn.currPage)||void 0===e?void 0:e.getWindow();if(null!=r){var o=r.document;return(null===(n=o.documentElement)||void 0===n?void 0:n.scrollTop)||(null===(t=o.body)||void 0===t?void 0:t.scrollTop)||0}return 0}function $e(){return u(u({patch:!0},(e=window.innerWidth||375,n=window.innerHeight||375,t=f().toLocaleLowerCase().includes("window")?0:50,r=window.devicePixelRatio||2,{screenWidth:e,screenHeight:n,statusBarHeight:t,devicePixelRatio:r,pixelRatio:r,windowHeight:n,windowWidth:e,safeArea:{height:n-t,widows:e,top:t,left:0,right:0}})),{scrollY:Ke()});var e,n,t,r}var ze={onMemoryWarning:function(){console.warn("The onMemoryWarning api is not implement.")},showShareMenu:function(){console.warn("The showShareMenu api is not implement.")},getSystemInfoSync:function(){var e,n=Xe(),t=qe(),r=f(),o=(e=w().extType||"").startsWith("app_")?f().toLowerCase():e.startsWith("pc_")?"pc":"web";return I.info("getSystemInfoSync",{windowInfo:n,deviceOrientation:t,system:r,platform:o}),u({deviceOrientation:t,SDKVersion:"1.0.0",appVersion:"12.1.0",batteryLevel:98,benchmarkLevel:1,bluetoothEnabled:!1,brand:"huya",cameraAuthorized:!1,deviceId:"none",enableDebug:!1,fontSizeSetting:15,frameworkVersion:"1.0.0",inHUYA:!0,language:"zh_CN",locationAuthorized:!1,locationEnabled:!1,microphoneAuthorized:!0,mode:"default",model:"none",notificationAuthorized:!0,platform:o,system:r,theme:void 0,version:"8.0.28 "},n)},getWindowInfo:function(){return Xe()},getSetting:function(){return{authSetting:{"scope.userInfo":!0},subscriptionsSetting:{},miniprogramAuthSetting:{"scope.userInfo":!0}}},getNetworkType:function(){return{networkType:"wifi",signalStrength:100,hasSystemProxy:!1}}};function Xe(){return p()&&"web_hd_inner"!==(w().extType||"")?function(e){b()?(e.screenWidth=e.windowWidth||window.innerWidth||e.screenWidth,e.screenHeight=e.windowHeight||window.innerHeight||e.screenHeight):(e.screenWidth=e.windowWidth||window.innerWidth,e.screenHeight=e.windowHeight||window.innerHeight);return e}(_e({apiName:"getWindowInfo",params:{}})):$e()}var Qe={showTabBar:function(e){return Te.emit("showTabBar",e),{errMsg:"showTabBar:ok"}},hideTabBar:function(e){return Te.emit("hideTabBar",e),{errMsg:"hideTabBar:ok"}},setTabBarStyle:function(e){return Te.emit("setTabBarStyle",e),{errMsg:"setTabBarStyle:ok"}},setTabBarItem:function(e){return Te.emit("setTabBarItem",e),{errMsg:"setTabBarItem:ok"}},setTabBarBadge:function(e){return Te.emit("setTabBarBadge",e),{errMsg:"setTabBarBadge:ok"}},removeTabBarBadge:function(e){return Te.emit("removeTabBarBadge",e),{errMsg:"removeTabBarBadge:ok"}},hideTabBarRedDot:function(e){return Te.emit("hideTabBarRedDot",e),{errMsg:"hideTabBarRedDot:ok"}},showTabBarRedDot:function(e){return Te.emit("showTabBarRedDot",e),{errMsg:"showTabBarRedDot:ok"}}},Ye="insertHTMLWebView",Ze="onWebviewLoad",Je={insertHTMLWebView:function(e,n,t,r){Cn.initNextWebView(Cn.currPage,e.src,e.src).el.addEventListener("load",(function(){Z(Ze,{webviewId:r},r),J(te+"pageonshow",{})})),Z(Ye,e,r)},invokeMiniProgramAPI:function(e,n){console.log(e,n);var t=e.name,r=e.arg,o=yn[t];null!=o&&o(r,n)},postMessage:function(e,n){Z("onBindMessage",e,Cn.currPage.webviewId),ie(n,{errMsg:"postMessage:ok"})},canGoBack:function(e,n){ie(n,{errMsg:"canGoBack:fail default to fail"})},canNavigateBack:function(e,n){var t=!1;Cn.allPages.length>1&&(t=!0),ie(n,{errMsg:"canNavigateBack:"+(t?"ok":"fail")})}},en={},nn="onAd";function tn(e){var n=e.type,t=e.adUnitId,r=en[t];if(null!=r)return r;if("rewardedVideo"===n)r=function(e){var n=e.adUnitId,t=_e({apiName:"createRewardedVideoAd",params:{adUnitId:n}});return t.onLoad((function(e){Z(nn,{method:"onLoad",adUnitId:n,data:e})})),t.onClose((function(e){Z(nn,{method:"onClose",adUnitId:n,data:e})})),t.onError((function(e){Z(nn,{method:"onError",adUnitId:n,data:e})})),t}(e);return null!=r&&(en[t]=r),r}var rn={ad:function(e,n){return c(void 0,void 0,void 0,(function(){var t,r,o,i;return d(this,(function(a){switch(a.label){case 0:if(t=e.method,e.adUnitId,r=e.type,null==(o=tn(e)))return oe(n,{errMsg:"ad:fail 获取"+r+"广告实例失败"}),[2];a.label=1;case 1:switch(a.trys.push([1,12,,13]),t){case"load":return[3,2];case"destroy":return[3,4];case"show":return[3,6];case"hide":return[3,8]}return[3,10];case 2:return[4,o.load()];case 3:return a.sent(),[3,11];case 4:return[4,o.destroy()];case 5:return a.sent(),[3,11];case 6:return[4,o.show()];case 7:return a.sent(),[3,11];case 8:return[4,o.hide()];case 9:return a.sent(),[3,11];case 10:throw new Error("unsupported method: "+t);case 11:return oe(n,{errMsg:"ad:ok"}),[3,13];case 12:return i=a.sent(),oe(n,{errMsg:"ad:fail adInstance."+t+" call fail, "+(i.mssage||"unknown")}),[3,13];case 13:return[2]}}))}))}},on={appDataChange:function(e){var n=e.params,t=e.from,r=e.webviewIds,o=e.event;e.webviewId,t===O?console.error("not implement for "+t):(!function(e){var n=u({},e.data),t=ke(n.options.path);t&&(n.windowConfig=t),n.pages=Cn.allPages,Te.emit("appDataChange",n)}(n),Y(o,n,r))},__updateAppData:function(e){var n,t,r;n={},t=Cn.currPage.pagePath.replace(/\.html$/,""),null!=(r=ke(t))&&(n.windowConfig=r),n.pages=Cn.allPages,n.currPage=t,Te.emit("updateAppData",n)}};var an={canvasInsert:function(e){var n=e.params,t=e.from;e.webviewIds;var r=e.event,o=e.webviewId;t===O?Z(r,n,o):console.error("not implement for "+t)},canvasRemove:function(e){var n=e.params,t=e.from;e.webviewIds;var r=e.event,o=e.webviewId;t===O?Z(r,n,o):console.error("not implement for "+t)},CANVAS_EVENT_V2:function(e){var n=e.params,t=e.from;e.webviewIds;var r=e.event,o=e.webviewId;t===O?Z(r,n,o):console.error("not implement for "+t)},onCanvasPreloadImage:function(e){var n=e.params,t=e.from;e.webviewIds;var r=e.event,o=e.webviewId;t===O?Z(r,n,o):console.error("not implement for "+t)},onCanvasGetImageData:function(e){var n=e.params,t=e.from;e.webviewIds;var r=e.event,o=e.webviewId;t===O?Z(r,n,o):console.error("not implement for "+t)},onCanvasPutImageData:function(e){var n=e.params,t=e.from;e.webviewIds;var r=e.event,o=e.webviewId;t===O?Z(r,n,o):console.error("not implement for "+t)},canvasActionsChanged:function(e){var n=e.params,t=e.from,r=e.webviewIds,o=e.event;e.webviewId,t===O?console.error("not implement for "+t):Y(o,n,r)},invokeCanvasToDataUrl:function(e){var n=e.params,t=e.from,r=e.webviewIds,o=e.event;e.webviewId,t===O?console.error("not implement for "+t):Y(o,n,r)},invokeCanvasPutImageData:function(e){var n=e.params,t=e.from,r=e.webviewIds,o=e.event;e.webviewId,t===O?console.error("not implement for "+t):Y(o,n,r)},invokeCanvasGetImageData:function(e){var n=e.params,t=e.from,r=e.webviewIds,o=e.event;e.webviewId,t===O?console.error("not implement for "+t):Y(o,n,r)},getImageBase64:function(e){var n=e.params;e.from,e.webviewIds;var t,r=e.event,o=e.webviewId,i=n.src;ve(/^https?:\/\//.test(t=i)||/^hyfile:\/\//.test(t)?t:M+t,{responseType:"arraybuffer"},(function(e,n){if(null!=e)return"";var t=h(n),a=function(e){var n,t=e.split("/"),r=null===(n=t[t.length-1])||void 0===n?void 0:n.split("."),o=r[0],i=r[1];if(null==i||""==i)throw new Error("url:"+e+"格式错误,无法获取文件信息");return{filename:o,ext:i}}(i);Y(r,{src:i,data:"data:image/"+a.ext+";base64,"+t},[o])}))}};function sn(e,n){e.message=n+" stack: "+(null==e?void 0:e.message),Te.emit("closeLaunchMask"),yn.showToast({title:"加载游戏脚本超时"}),I.error("load game.js error",e.message),Se.captureLoadGameEntryError(e)}var un={gameServiceReady:function(){!function(e){c(this,void 0,void 0,(function(){var n,t,r,o;return d(this,(function(i){switch(i.label){case 0:if(n=window.__deviceOrientation,t=qe(),r="string"==typeof n&&n.includes("landscape"),!("landscape"!==t&&r&&p()&&b()))return[3,5];i.label=1;case 1:return i.trys.push([1,3,,4]),[4,_(5e3,new Promise((function(e){var n=ne();_e({apiName:"setDeviceOrientation",params:{value:"landscape"}}),n.$events.once("onDeviceOrientationChange",(function(n){"landscape"===n.value&&e(!0)}))})))];case 2:return i.sent(),e(),[3,4];case 3:return o=i.sent(),e(o),[3,4];case 4:return[3,6];case 5:e(),i.label=6;case 6:return[2]}}))}))}((function(e){null==e?Ve((function(){I.log("load game.js"),function(){c(this,void 0,void 0,(function(){function e(){return c(this,void 0,void 0,(function(){return d(this,(function(e){switch(e.label){case 0:return[4,Q().loadSubBundle("","game.js")];case 1:return e.sent(),Te.emit("closeLaunchMask"),[2]}}))}))}return d(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,_(18e3,e())];case 1:return n.sent(),[3,3];case 2:return sn(n.sent(),"entry"),[3,3];case 3:return[2]}}))}))}()})):sn(e,"deviceOrientation")}))},gameConfigUpdate:function(e){var n=e.params;Pe({windowInfo:yn.getWindowInfo(),wxConfig:n})}},cn=new(function(){function e(){this.reportedFirstScreenTime=!1}return e.prototype.reportFirstScreenTime=function(e){if(!this.reportedFirstScreenTime){var n=window.performanceInfo;null!=n&&(n.firstScreenTime=e),this.reportedFirstScreenTime=!0}},e}()),dn=new(function(){function e(){this.inited=!1,this.__startTime=Date.now(),this.isServiceReady=!1,this.isViewReady=!1,this.showedFirstPage=!1}return Object.defineProperty(e.prototype,"allReady",{get:function(){return this.isViewReady&&this.isServiceReady},enumerable:!1,configurable:!0}),e.prototype.init=function(e){this.inited||(this.inited=!0,this.initIframes(),I.info("initLauncher "+e+" consume: "+(Date.now()-this.__startTime)+"ms"))},e.prototype.initIframes=function(){var e=Q(),n=X();e.updateSrc("./service.html"),n.updateSrc("first")},e.prototype.handleServiceStart=function(e){var n=e.params;Ae=n,Pe({wxConfig:n,windowInfo:yn.getWindowInfo()}),Te.emit("serviceStart",n)},e.prototype.handleServiceReady=function(e){var n=this,t=Q();if(!t.isReady){this.root=e.params.root,this.firstWebviewId=e.webviewIds[0],this.isServiceReady=!0;var r=this.firstWebviewId;t.events.once(G.onViewDOMContentLoaded,(function(){Z("onAppRoute",{path:n.root,openType:"appLaunch",options:void 0,pipMode:"",query:void 0,webviewId:n.firstWebviewId},n.firstWebviewId)})),Z("onServiceReadyDone",u(u({},B),{webviewId:r}),r),t.isReady=!0,this.launchPageShow()}},e.prototype.showPage=function(){var e=Cn.currPage;null!=e&&(e.isReady=!0,e.injectScript(),e.show(),this.showedFirstPage||(this.showedFirstPage=!0))},e.prototype.handleViewReady=function(){this.isViewReady=!0,this.showedFirstPage?this.showPage():this.launchPageShow()},e.prototype.handleViewDOMContentLoaded=function(e){var n=e.from,t=Q();n===O&&(Z("DOMContentLoaded",{},Cn.currPage.webviewId),t.events.emit(G.onViewDOMContentLoaded)),Te.emit("closeLaunchMask")},e.prototype.launchPageShow=function(){if(this.allReady){!function(e,n){var t=function(e){var n=e.tabBar;return null==n||0===(n.list||[]).length?[e.root]:n.list.map((function(e){return e.pagePath}))}(e);Cn.initFirstPage(t,e.root,n)}(Ie(),X()),Cn.initSlotWebviewId(this.firstWebviewId),this.showPage();var e=Date.now(),n=e-this.__startTime;cn.reportFirstScreenTime(e),I.info("init page consume time: "+n+"ms")}},e}()),ln={serviceStart:function(e){dn.handleServiceStart(e)},onLaunchCalled:function(e){},serviceReady:function(e){dn.handleServiceReady(e)},DOMContentLoaded:function(e){dn.handleViewDOMContentLoaded(e)},viewReady:function(){dn.handleViewReady()},DOMReady:function(){}},fn={info:function(e){var n=e.params,t=e.from,r=e.webviewIds,o=e.event;e.webviewId,t===O?console.error("not implement for "+t):Y(o,n,r)},log:function(e){var n=e.params,t=e.from,r=e.webviewIds,o=e.event;e.webviewId,t===O?console.error("not implement for "+t):Y(o,n,r)},warn:function(e){var n=e.params,t=e.from,r=e.webviewIds,o=e.event;e.webviewId,t===O?console.error("not implement for "+t):Y(o,n,r)},error:function(e){var n=e.params,t=e.from,r=e.webviewIds,o=e.event;e.webviewId,t===O?console.error("not implement for "+t):Y(o,n,r)},initLogs:function(e){var n=e.params,t=e.from,r=e.webviewIds,o=e.event;e.webviewId,t===O?console.error("not implement for "+t):Y(o,n,r)},clearLogs:function(e){var n=e.params,t=e.from,r=e.webviewIds,o=e.event;e.webviewId,t===O?console.error("not implement for "+t):Y(o,n,r)},onViewLogEvent:function(e){var n=e.params,t=e.from;e.webviewIds;var r=e.event,o=e.webviewId;t===O?Z(r,n,o):console.error("not implement for "+t)}},pn={INVOKE_METHOD:function(e){var n=e.params,t=e.from,r=e.event,o=e.webviewId;t===O?Z(r,n,o):console.error("not implement for "+t)},pageonshow:function(e){var n=e.params,t=e.from,r=e.webviewIds,o=e.event;t===O?console.error("not implement for "+t):Y(o,n,r)},pageonhide:function(e){var n=e.params,t=e.from,r=e.webviewIds,o=e.event;t===O?console.error("not implement for "+t):(Y(o,n,r),J(o,n))},requestLoadFontFace:function(e){var n=e.params,t=e.from,r=e.webviewIds,o=e.event;t===O?console.error("not implement for "+t):Y(o,n,r)},requestLoadGlobalFontFaces:function(e){var n=e.params,t=e.from,r=e.event,o=e.webviewId;t===O?Z(r,n,o):console.error("not implement for "+t)},responseLoadGlobalFontFaces:function(e){var n=e.params,t=e.from,r=e.webviewIds,o=e.event;t===O?console.error("not implement for "+t):Y(o,n,r)}};function vn(e){return"string"==typeof e?JSON.parse(e):e}function hn(e){return JSON.parse(JSON.stringify(e))}var _n={SPECIAL_PAGE_EVENT:function(e){var n=e.params,t=e.from;e.webviewIds;var r=e.event,o=e.webviewId;t===O?Z(r,n,o):console.error("not implement for "+t)},setKeyboardValue:function(e){var n=e.params,t=e.from,r=e.webviewIds,o=e.event;e.webviewId,t===O?console.error("not implement for "+t):Y(o,n,r)},PAGE_EVENT:function(e){var n=e.params,t=e.from;e.webviewIds;var r=e.event,o=e.webviewId;t===O?Z(r,n,o):console.error("not implement for "+t)},vdSync:function(e){var n=e.params,t=e.from,r=e.webviewIds,o=e.event,i=e.webviewId;t===O?Z(o,hn(n),i):Y(o,hn(n),r)},vdSyncBatch:function(e){var n=e.params,t=e.from,r=e.webviewIds,o=e.event,i=e.webviewId;t===O?Z(o,hn(n),i):Y(o,hn(n),r)}},mn={videoPlayerInsertFinish:function(e){var n=e.params,t=e.from;e.webviewIds;var r=e.event,o=e.webviewId;t===O?Z(r,n,o):console.error("not implement for "+t)},videoActionChanged:function(e){var n=e.params,t=e.from,r=e.webviewIds,o=e.event;e.webviewId,t===O?console.error("not implement for "+t):Y(o,n,r)}},gn={openTypeEvent:function(e){var n=e.event,t=e.params,r=e.from,o=e.webviewId;"view"===r&&Z(n,t,o)},openTypeEventCallback:function(e){var n=e.event,t=e.params,r=e.from,o=e.webviewIds;"service"===r&&Y(n,t,o)}},wn=u(u(u(u(u(u(u(u(u({},un),ln),an),on),fn),pn),_n),mn),gn),yn=u(u(u(u(u(u(u(u(u(u(u(u(u({},Me),ye),He),Ne),Ce),Ue),ze),De),Qe),Je),fe),Ee),rn);function bn(e){var n,t=e.replace(te,""),r=wn[t];if(null==r){var o=/^video_(.*)_actionChanged$/.test(n=t)?"videoActionChanged":/^canvas(.*)actionsChanged$/.test(n)?"canvasActionsChanged":/^invokeCanvasToDataUrl_(.*)$/.test(n)?"invokeCanvasToDataUrl":/^onCanvasToDataUrl_(.*)$/.test(n)?"onCanvasToDataUrl":/^invokeCanvasPutImageData_(.*)$/.test(n)?"invokeCanvasPutImageData":/^onCanvasPutImageData_(.*)$/.test(n)?"onCanvasPutImageData":/^invokeCanvasGetImageData_(.*)$/.test(n)?"invokeCanvasGetImageData":/^onCanvasGetImageData_(.*)$/.test(n)?"onCanvasGetImageData":n;return{handler:wn[o]||null,formatedEvent:o}}return{handler:r,formatedEvent:t}}var Sn={invokeHandler:function(e){I.debug("invokeHander",e);var n=e.C,t=e.from,r=e.paramsString,o=e.webviewId,i=e.callbackId,a=vn(r),s=yn[n];if(null!=s){var u=s(a,i,t,o);return u&&u instanceof Promise?void 0:u}var c=ne();if(null!=c)return c.invokeHandler({apiName:n,params:a,callbackId:i,from:t})},publishHandler:function(e){I.debug("publishHandler",e);var n=e.event,t=e.from,r=e.paramsString,o=e.webviewId,i=e.webviewIds,a=bn(n),s=a.handler,u=a.formatedEvent,c=vn(r);if(null!=s)s({event:n,params:c,from:t,webviewId:o,webviewIds:F===t&&i?vn(i):void 0});else{var d=ne();null!=d&&d.publishHandler({formatedEvent:u,event:n,params:c,from:t})}},webInvokeHandler:function(e){E&&console.log("webInvokeHander",e),ie(e.callbackId,vn(e.paramsString))},webPublishHandler:function(e){E&&console.log("webPublishHandler",e),J(e.event,vn(e.paramsString))}};var An=[],In=function(e){An.push(e.el.src)},kn=function(e){An.pop()},Tn=function(){function e(){this.block=!1,this.queue=[]}return e.prototype.collect=function(e){var n=this;this.block?this.queue.push(e):(this.block=!0,this.queue.push(e),this.timer=setTimeout((function(){n.block=!1,clearTimeout(n.timer),n.comsume()})))},e.prototype.comsume=function(){var e=this.queue;if(this.queue=[],1===e.length)e[0]();else for(var n=0;n<e.length;n++)e[n]()},e}();var xn=function(e){function n(n){var t=e.call(this,n)||this;return t.webviewId=null,t.pagePath="",t.wrapper=null,t.isDestoryed=!1,t.active=!1,t.__isWebView=!1,t.tickQueue=new Tn,t}return s(n,e),Object.defineProperty(n.prototype,"isWebView",{get:function(){return this.__isWebView},set:function(e){this.__isWebView=e,e?In(this):kn(this)},enumerable:!1,configurable:!0}),n.prototype.appendContainer=function(){var e=this.el;e.className="webview",e.setAttribute("frameborder","0"),this.hide();var n=document.getElementById("webview-container");this.wrapper=n,null!=n&&n.appendChild(e)},n.prototype.show=function(){var e=this.el;e.style.zIndex="2",e.style.opacity="1",this.active=!0,Pn(this,"show")},n.prototype.hide=function(){var e=this.el;e.style.zIndex="1",e.style.opacity="0",this.active=!1,Pn(this,"hide")},n.prototype.updateWebviewId=function(e){this.webviewId=e,this.updateId()},n.prototype.updateId=function(){this.el.id="webview-"+this.webviewId},n.prototype.updateSrc=function(e,n){void 0===n&&(n=C),this.el.src=n,this.pagePath=e},n.prototype.updatePagePath=function(e){this.pagePath=e},n.prototype.injectScript=function(){var e=this.getWindow();if(null!=e&&""!=this.pagePath){var n=this.pagePath.replace(/\.html$/g,""),t=function(e){var n=e.pagePath;return"\n <script>\n var __path__ = '"+e.path+"';\n document.title = __path__;\n document.dispatchEvent(new CustomEvent(\"generateFuncReady\", {\n detail: {\n generateFunc: $gfc('"+n+".wxml') || $gfc('"+n+".hyml')\n }\n }))\n <\/script> \n "}({pagePath:"./"+n,path:n});e.injectHtml(e.document.body,{content:t})}},n.prototype.getBridge=function(){return this.getWindow().FinChatJSBridge},n.prototype.sendToView=function(e,n){var t=this;this.sync?(I.debug("%c "+e,{data:n,webviewId:this.webviewId}),this.getBridge().subscribeHandler(e,n,this.webviewId)):this.tickQueue.collect((function(){I.debug("%c "+e,{data:n,webviewId:t.webviewId}),t.getBridge().subscribeHandler(e,n,t.webviewId)}))},n.prototype.postMessageToWebView=function(e){var n;I.debug("%c postMessageToWebView",e),null===(n=this.el.contentWindow)||void 0===n||n.postMessage(e,"*")},n.prototype.destory=function(){null!==this.wrapper&&this.wrapper.removeChild(this.el),this.el=null,this.wrapper=null,this.isDestoryed=!0,this.active=!1,this.isWebView=!1,Pn(this,"destory")},n}(j);function Pn(e,n){e.isVHost&&e.children&&e.children.length>0&&e.children.forEach((function(e){e[n]()}))}function Mn(e,n){return e._slots.findIndex((function(e){return e===n.replace(/\.html$/,"")}))}var Cn=new(function(){function e(){this._slotStack=[],this._extraStack=[],this._slots=[],this._webviewId=0,this.rootIndex=0}return Object.defineProperty(e.prototype,"pagePath",{get:function(){var e;return(null===(e=this.currPage)||void 0===e?void 0:e.pagePath)||null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currPage",{get:function(){return this.stack[this.stack.length-2]||null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"top",{get:function(){return this.stack[this.stack.length-1]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"stack",{get:function(){var e=this._slotStack[this.rootIndex];return null==e?[]:l([e],this._extraStack)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"allPages",{get:function(){var e=this._slotStack[this.rootIndex];return null==e?[]:l([e],this._extraStack.slice(0,this._extraStack.length-1))},enumerable:!1,configurable:!0}),e.prototype.popExtraStack=function(){var e=this._extraStack,n=e.pop(),t=e.pop();return n&&e.push(n),t},e.prototype.resetExtraStack=function(){if(0!==this._extraStack.length){var e=this.top;this._extraStack.slice(0,this._extraStack.length-1).forEach((function(e){e.destory()})),this._extraStack=[e]}},e.prototype.initFirstPage=function(e,n,t){if(!Array.isArray(e)||0===e.length)throw new Error("slots must exist.");var r=Mn(this,n);r>-1&&(this.rootIndex=r),this._slots=e;for(var o=0;o<e.length;o++){var i=void 0;if(t&&o===this.rootIndex)i=t;else{var a=document.createElement("iframe");(i=new xn(a)).appendContainer()}i&&this._slotStack.push(i)}var s=this._slotStack[this.rootIndex];t?s.updatePagePath(n):s.updateSrc(n),this.initEmptyPage()},e.prototype.initEmptyPage=function(){var e=document.createElement("iframe"),n=new xn(e);n.appendContainer(),this._extraStack.push(n)},e.prototype.initNextPage=function(e,n){var t=this.currPage,r=this.top;return t.hide(),r.updateSrc(e,n),r.updateWebviewId(this._webviewId++),this.initEmptyPage(),r},e.prototype.initNextWebView=function(e,n,t){var r=this.initNextPage(n,t),o=this._extraStack.findIndex((function(e){return e.pagePath===n}));return o>-1&&this._extraStack.splice(o,1),e.children=[r],e.isVHost=!0,r.el.setAttribute("sandbox","allow-same-origin allow-scripts"),r.isWebView=!0,r.show(),r},e.prototype.initSlotWebviewId=function(e){this._webviewId=e,this._slotStack[this.rootIndex].updateWebviewId(this._webviewId++)},e.prototype.reinitPages=function(e){var n=this._slotStack,t=this._extraStack;n.forEach((function(e){e.destory()})),t.forEach((function(e){e.destory()})),this._slotStack=[],this._extraStack=[],this.initFirstPage(this._slots,e),this.currPage.updateWebviewId(this._webviewId++)},e.prototype.reLaunch=function(e){this.reinitPages(e)},e.prototype.redirectTo=function(e){if(Mn(this,e)>-1)throw new Error("不允许跳转到 tabbar 页面:"+e);var n=this._extraStack;if(n.length>1){var t=n.pop();n.pop().destory(),t.updateSrc(e),t.updateWebviewId(this._webviewId++),n.push(t),this.initEmptyPage()}else{null==(t=n.pop())||t.destory(),this._slotStack.forEach((function(e){e.destory()})),this.reinitPages(e)}},e.prototype.switch=function(e,n){n=null!=n?n:Mn(this,e);var t=this._slotStack,r=t[n];if(null==r)throw new Error("switchTab url is invalid: "+e);return this.resetExtraStack(),t.forEach((function(e){e.isReady&&e.hide()})),this.rootIndex=n,r.isReady?r.show():(r.updateWebviewId(this._webviewId++),r.updateSrc(e)),r},e.prototype.go=function(e){var n=Mn(this,e);return n>-1?this.switch(e,n):this.initNextPage(e)},e.prototype.back=function(e){var n,t=this._extraStack.slice(),r=t.pop(),o=t.length;if(e<=0)throw new Error("delta 不能 <= 0");if(o<e)throw new Error("delta 不能超过总栈长度:"+(o+1));var i=o-e,a=t.slice(0,i);(t.slice(i,o).forEach((function(e){e.destory()})),a.length>0)?a[a.length-1].show():null===(n=this._slotStack[this.rootIndex])||void 0===n||n.show();r&&a.push(r),this._extraStack=a},e}()),En=function(){function e(){this._invokeServiceCallbackHandler=oe,this._dispatchViewEvent=Y,this._dispatchServiceEvent=Z,this.$events=new i,this._getCurrentPage=function(){return Cn.currPage},this._getAllPages=function(){return Cn.allPages}}return e.prototype.init=function(){ee=this},e}(),Fn=o((function(e,n){
|
43
43
|
/*!
|
44
44
|
* @revues/hyext-adapter
|
45
45
|
* (c) 2024-2024 Alex
|
@@ -60,4 +60,4 @@ function(){var e;HowlerGlobal.prototype._pos=[0,0,0],HowlerGlobal.prototype._ori
|
|
60
60
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
61
61
|
PERFORMANCE OF THIS SOFTWARE.
|
62
62
|
***************************************************************************** */
|
63
|
-
var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&(e[t]=n[t])},t(e,n)},o=function(){return o=Object.assign||function(e){for(var n,t=1,o=arguments.length;t<o;t++)for(var r in n=arguments[t])Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r]);return e},o.apply(this,arguments)};function r(e,n,t,o){return new(t||(t=Promise))((function(r,i){function a(e){try{u(o.next(e))}catch(e){i(e)}}function c(e){try{u(o.throw(e))}catch(e){i(e)}}function u(e){var n;e.done?r(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(a,c)}u((o=o.apply(e,n||[])).next())}))}function i(e,n){var t,o,r,i,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(t)throw new TypeError("Generator is already executing.");for(;a;)try{if(t=1,o&&(r=2&i[0]?o.return:i[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,i[1])).done)return r;switch(o=0,r&&(i=[2&i[0],r.value]),i[0]){case 0:case 1:r=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,o=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!r||i[1]>r[0]&&i[1]<r[3])){a.label=i[1];break}if(6===i[0]&&a.label<r[1]){a.label=r[1],r=i;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(i);break}r[2]&&a.ops.pop(),a.trys.pop();continue}i=n.call(e,a)}catch(e){i=[6,e],o=0}finally{t=r=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,c])}}}var a=function(){function e(){this._queue=[],this._queue=[]}return e.prototype.regist=function(e){this._queue.push(e)},e.prototype.start=function(e){this._queue.forEach((function(n){try{n.call(null,e)}catch(e){}}))},e}(),c=new a,u=[];function s(e){u.length>0&&(u.forEach((function(n){var t=e[n.method];t&&t.apply(e,n.args)})),u=[])}var l=function(){function e(){}return e.init=function(e){this.logger=e},e.log=function(){for(var e,n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];this.logger?(s(this.logger),(e=this.logger).log.apply(e,n)):u.push({method:"log",args:n})},e.info=function(){for(var e,n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];this.logger?(s(this.logger),(e=this.logger).info.apply(e,n)):u.push({method:"info",args:n})},e.warn=function(){for(var e,n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];this.logger?(s(this.logger),(e=this.logger).warn.apply(e,n)):u.push({method:"warn",args:n})},e.error=function(){for(var e,n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];this.logger?(s(this.logger),(e=this.logger).error.apply(e,n)):u.push({method:"error",args:n})},e}();function d(e,n){return function(e,n){var t=e,o=0;if(t){for(;o<n.length;){if(!(t=t[n[o]]))return;o++}return t}}(e,n.split("."))}function f(e){return e&&"function"==typeof e.then}function p(e){var n=e.SDK,t=e.path;return function(e){var n=e.fun,t=e.genFun,o=e.sync,r=e.onCall,i=e.onSucc,a=e.onFail,c=e.onComplete;return function(){for(var e=[],u=0;u<arguments.length;u++)e[u]=arguments[u];var s=("object"==typeof e[0]?e[0]:{})||{},l=s.success,d=s.fail,p=s.complete,v=function(){c&&c(),p&&p()},h=function(e){return i&&i(e),l&&l(e),e},g=function(e){var n=a&&a(e)||e;return d&&d(n),n},m=function(){r&&r(e);var o=t&&t()||n;if(!o)throw new Error("polyfill caller is undefined");return o.apply(null,e)};if(o)try{var w=h(m());return v(),w}catch(e){var y=g(e);throw v(),y}return new Promise((function(e,n){try{var t=m();f(t)?t.then((function(n){return e(h(n))})).catch((function(e){return n(g(e))})).finally(v):(e(h(t)),v())}catch(e){n(g(e)),v()}}))}}({genFun:function(){var e=d(n,t);if(!e)throw new Error("SDK."+t+" is undefined");return e},sync:e.sync,onCall:e.onCall,onSucc:e.onSucc,onFail:e.onFail,onComplete:e.onComplete})}function v(e,n,t){return Object.defineProperty(e,n,{enumerable:!0,configurable:!1,writable:!0,value:t})}var h,g=function(e){var n=e.SDK,t=e.onFail,o=e.onCall,r=e.onSucc,i={},a=function(e,a){e&&e.length&&e.forEach((function(e){var c=e.split(".").pop();if(c)switch(a){case"consts":var u=d(n,e);u&&v(i,c,u);break;case"async":case"sync":var s=p({SDK:n,sync:"sync"===a,path:e,onCall:function(n){return o&&o(n,c,e)},onSucc:function(n){return r&&r(n,c,e)},onFail:function(n){return t&&t(n,c,e)}});v(i,c,s)}}))};return a(e.constants,"consts"),a(e.methods,"async"),a(e.syncMethods,"sync"),l.log("[hyext adapter] polyfillSDK",i),i}({SDK:hyExt,constants:["consts"],methods:["request","panel.disposal","context.login","context.checkSession","device.setOrientation","device.onOrientationChange","device.offOrientationChange","ad.createAd","ad.loadAd","ad.showAd","ad.destroyAd","ad.onAdMessage","ad.offAdMessage","context.requestPayment","fs.downloadFile","fs.access","fs.appendFile","fs.close","fs.copyFile","fs.getFileInfo","fs.getSavedFileList","fs.mkdir","fs.open","fs.read","fs.readCompressedFile","fs.readdir","fs.readFile","fs.readZipEntry","fs.unzip","fs.removeSavedFile","fs.rename","fs.rmdir","fs.saveFile","fs.stat","fs.truncate","fs.unlink","fs.write","fs.writeFile","fs.fstat","fs.ftruncate","ui.showNativeInputBar","advance.getCurrentUserInfo","onEnterForeground","onLeaveForeground","onAppear","onDisappear","device.lockOrientation","ui.showKeyboard","ui.hideKeyboard","ui.updateKeyboard","ui.onKeyboardInput","ui.onKeyboardConfirm","ui.onKeyboardComplete","ui.onKeyboardHeightChange"],syncMethods:["device.getWindowInfo","fs.accessSync","fs.appendFileSync","fs.closeSync","fs.copyFileSync","fs.mkdirSync","fs.openSync","fs.readSync","fs.readCompressedFileSync","fs.readdirSync","fs.readFileSync","fs.renameSync","fs.rmdirSync","fs.saveFileSync","fs.statSync","fs.truncateSync","fs.unlinkSync","fs.writeSync","fs.writeFileSync","fs.fstatSync","fs.ftruncateSync"],onCall:function(e,n,t){l.log("[Polyfill] call "+t+" start:",e)},onSucc:function(e,n,t){l.log("[Polyfill] call "+t+" succ:",e)},onFail:function(e,n,t){l.info("[Polyfill] call "+t+" fail:",e)}});!function(e){e.onLoad="onLoad",e.onClose="onClose",e.onError="onError"}(h||(h={}));var m=new(function(){function e(){this.events={},this.invoked=!1}return e.prototype.invoke=function(){var e=this;this.invoked||(g.onAdMessage({callback:function(n){var t=n.instanceId,o=n.eventName,r=n.res;e.emit(t,o,r)}}),this.invoked=!0)},e.prototype.clear=function(){g.offAdMessage(),Object.values(this.events).forEach((function(e){return e.removeAllListeners()})),this.events={},this.invoked=!1},e.prototype.create=function(e){return r(this,void 0,void 0,(function(){return i(this,(function(n){switch(n.label){case 0:return[4,g.createAd(e)];case 1:return[2,n.sent()]}}))}))},e.prototype.show=function(e){return r(this,void 0,void 0,(function(){return i(this,(function(n){switch(n.label){case 0:return[4,g.showAd(e)];case 1:return[2,n.sent()]}}))}))},e.prototype.load=function(e){return r(this,void 0,void 0,(function(){return i(this,(function(n){switch(n.label){case 0:return[4,g.loadAd(e)];case 1:return[2,n.sent()]}}))}))},e.prototype.destroy=function(e){return r(this,void 0,void 0,(function(){return i(this,(function(n){switch(n.label){case 0:return[4,g.destroyAd(e)];case 1:return[2,n.sent()]}}))}))},e.prototype.emit=function(e,n,t){this.events[e]&&n&&this.events[e].emit(n,t)},e.prototype.on=function(e,t,o){this.events[e]||(this.events[e]=new n.EventEmitter),this.events[e].on(t,o)},e.prototype.off=function(e,n,t){this.events[e]&&(n?t?this.events[e].off(n,t):this.events[e].removeAllListeners(n):this.events[e].removeAllListeners())},e}()),w=function(){function e(e){var n,t,o;m.invoke(),this._getInstance=(n=function(){return m.create(e)},o=!1,function(){for(var e=this,a=[],c=0;c<arguments.length;c++)a[c]=arguments[c];return o?t:(o=!0,t=r(e,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,n.apply(void 0,a)];case 1:return[2,e.sent()];case 2:throw e.sent();case 3:return[2]}}))})))})}return e.prototype.show=function(){return r(this,void 0,void 0,(function(){var e;return i(this,(function(n){switch(n.label){case 0:return[4,this._getInstance()];case 1:return e=n.sent().instanceId,[2,m.show({instanceId:e})]}}))}))},e.prototype.load=function(){return r(this,void 0,void 0,(function(){var e;return i(this,(function(n){switch(n.label){case 0:return[4,this._getInstance()];case 1:return e=n.sent().instanceId,[2,m.load({instanceId:e})]}}))}))},e.prototype.destroy=function(){return r(this,void 0,void 0,(function(){var e;return i(this,(function(n){switch(n.label){case 0:return[4,this._getInstance()];case 1:return e=n.sent().instanceId,m.off(e),[2,m.destroy({instanceId:e})]}}))}))},e.prototype.onLoad=function(e){this._getInstance().then((function(n){var t=n.instanceId;m.on(t,h.onLoad,e)})).catch((function(e){}))},e.prototype.onClose=function(e){this._getInstance().then((function(n){var t=n.instanceId;m.on(t,h.onClose,e)})).catch((function(e){}))},e.prototype.onError=function(e){this._getInstance().then((function(n){var t=n.instanceId;m.on(t,h.onError,e)})).catch((function(e){}))},e.prototype.offLoad=function(e){this._getInstance().then((function(n){var t=n.instanceId;m.off(t,h.onLoad,e)})).catch((function(e){}))},e.prototype.offClose=function(e){this._getInstance().then((function(n){var t=n.instanceId;m.off(t,h.onClose,e)})).catch((function(e){}))},e.prototype.offError=function(e){this._getInstance().then((function(n){var t=n.instanceId;m.off(t,h.onError,e)})).catch((function(e){}))},e}(),y=new(function(){function e(){this.isLandscape=!1}return e.prototype.changeOrientation=function(e){this.isLandscape=e},e.prototype.getWindowInfo=function(){try{var e=g.getWindowInfo();return l.info("getWindowInfo sync",e),e}catch(e){var n=Object.assign({safeArea:{left:0,right:0,top:0,bottom:0,width:0,height:0}},g.consts||{});return this.isLandscape?o(o({},n),{screenWidth:n.screenHeight,screenHeight:n.screenWidth,windowWidth:n.windowHeight,windowHeight:n.windowWidth,isLandscape:!0}):(n.isLandscape=!1,l.info("getWindowInfo consts",n),n)}},e}());c.regist((function(e){var n,t=e.emitter;n=window.navigator.userAgent.toLowerCase(),(/(iphone|ipad)/.test(n)||/android/.test(n))&&(l.log("[hyext adapter] device init"),g.onOrientationChange({callback:function(e){t({event:"onDeviceOrientationChange",data:e}),y.changeOrientation("landscape"===e.value)}}))}));var b={fn:function(e){return r(void 0,void 0,void 0,(function(){var n;return i(this,(function(t){switch(t.label){case 0:return n=e.defaultValue,e.maxLength,e.multiple,e.confirmHold,e.confirmType,[4,g.showNativeInputBar({text:n,btnText:"确认"})];case 1:return[2,t.sent()]}}))}))},onAfterSuccess:function(e,n){e._dispatchServiceEvent("onKeyboardInput",{value:n.text}),"mask"===n.from?e._dispatchServiceEvent("onKeyboardComplete",{value:n.text}):e._dispatchServiceEvent("onKeyboardConfirm",{value:n.text})}},_=function(){return r(void 0,void 0,void 0,(function(){var e;return i(this,(function(n){switch(n.label){case 0:return[4,g.getCurrentUserInfo()];case 1:return[2,{userInfo:{nickName:(e=n.sent()).name,avatarUrl:e.avatarUrl},rawData:"",signature:"",encryptedData:"",iv:"",cloudID:""}]}}))}))},x={webapi_getuserinfo:function(e){return _()}};c.regist((function(e){var n=e.emitter;l.log("[hyext adapter] app event init"),g.onEnterForeground((function(){n({event:"onAppEnterForeground",data:{}})})),g.onAppear((function(){n({event:"onAppShow",data:{}})})),g.onDisappear((function(){n({event:"onAppHide",data:{}})}))}));var A,k=Object.freeze({__proto__:null,createRewardedVideoAd:function(e){return new w(e)},createInterstitialAd:function(e){return new w(e)},setDeviceOrientation:function(e){var n=e||{},t=n.value,o=function(e,n){var t={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&n.indexOf(o)<0&&(t[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)n.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(t[o[r]]=e[o[r]])}return t}(n,["value"]);return o.orientation=t,g.setOrientation(o)},onDeviceOrientationChange:function(e){return g.onOrientationChange({callback:e})},offDeviceOrientationChange:function(e){return g.offOrientationChange()},getWindowInfo:function(){return y.getWindowInfo()},downloadFile:function(e){return r(this,void 0,void 0,(function(){var n,t,o,r,a;return i(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),console.time("downloadFile url:"+e.url+",耗时:"),[4,g.downloadFile(e)];case 1:return n=i.sent(),console.timeEnd("downloadFile url:"+e.url+",耗时:"),o=(t=n||{}).tempFilePath,(r=t.filePath)||o?[2,{profile:{},statusCode:200,tempFilePath:o,filePath:r}]:[2,n];case 2:throw a=i.sent(),console.timeEnd("downloadFile url:"+e.url+"error:"+a.message),a;case 3:return[2]}}))}))},access:function(e){return g.access(e)},accessSync:function(e){return g.accessSync(e)},appendFile:function(e){return g.appendFile(e)},appendFileSync:function(e){return g.appendFileSync(e)},close:function(e){return g.close(e)},closeSync:function(e){return g.closeSync(e)},copyFile:function(e){return g.copyFile(e)},copyFileSync:function(e){return g.copyFileSync(e)},getFileInfo:function(e){return g.getFileInfo(e)},getSavedFileList:function(){return g.getSavedFileList()},mkdir:function(e){return g.mkdir(e)},mkdirSync:function(e){return g.mkdirSync(e)},open:function(e){return g.open(e)},openSync:function(e){return{data:g.openSync(e).fd}},read:function(e){return r(this,void 0,void 0,(function(){var n;return i(this,(function(t){switch(t.label){case 0:return[4,g.read(e)];case 1:return(n=t.sent()).arrayBuffer=n.originData,[2,n]}}))}))},readSync:function(e){var n=g.readSync(e);return n.arrayBuffer=n.originData,{data:n}},readCompressedFile:function(e){return r(this,void 0,void 0,(function(){var n;return i(this,(function(t){switch(t.label){case 0:return[4,g.readCompressedFile(e)];case 1:return[2,{data:(n=t.sent()).originData||n.data}]}}))}))},readCompressedFileSync:function(e){var n=g.readCompressedFileSync(e);return{data:n.originData||n.data}},readdir:function(e){return g.readdir(e)},readdirSync:function(e){return{data:g.readdirSync(e).files}},readFile:function(e){return r(this,void 0,void 0,(function(){var n;return i(this,(function(t){switch(t.label){case 0:return[4,g.readFile(e)];case 1:return(n=t.sent()).data=n.originData||n.data,[2,n]}}))}))},readFileSync:function(e){var n=g.readFileSync(e);return{data:n.originData||n.data}},readZipEntry:function(e){return r(this,void 0,void 0,(function(){return i(this,(function(n){switch(n.label){case 0:return[4,g.readZipEntry(e)];case 1:return[2,n.sent()]}}))}))},unzip:function(e){return g.unzip(e)},removeSavedFile:function(e){return g.removeSavedFile(e)},rename:function(e){return g.rename(e)},renameSync:function(e){return g.renameSync(e)},rmdir:function(e){return g.rmdir(e)},rmdirSync:function(e){return g.rmdirSync(e)},saveFile:function(e){return g.saveFile(e)},saveFileSync:function(e){return{data:g.saveFileSync(e).savedFilePath}},stat:function(e){return g.stat(e)},statSync:function(e){return{data:g.statSync(e).stats}},truncate:function(e){return g.truncate(e)},truncateSync:function(e){return g.truncateSync(e)},unlink:function(e){return g.unlink(e)},unlinkSync:function(e){return g.unlinkSync(e)},write:function(e){return g.write(e)},writeSync:function(e){return{data:g.writeSync(e).bytesWritten}},writeFile:function(e){return g.writeFile(e)},writeFileSync:function(e){return g.writeFileSync(e)},fstat:function(e){return g.fstat(e)},fstatSync:function(e){return{data:g.fstatSync(e).stats}},ftruncate:function(e){return g.ftruncate(e)},ftruncateSync:function(e){return g.ftruncateSync(e)},exitMiniProgram:function(e){return g.disposal(e)},showGameKeyboard:b,hideGameKeyboard:function(){},updateGameKeyboard:function(e){},login:function(e){return g.login(e)},checkSession:function(e){return g.checkSession(e)},request:function(e){var n=e.data,t=e.dataType,o=e.header,r=e.method,i=e.url;return g.request({url:i,method:r,data:n,dataType:t,header:o})},getUserProfile:_,operateWXData:function(e){return r(this,void 0,void 0,(function(){var n,t,o,r;return i(this,(function(i){switch(i.label){case 0:return n=e.data,t=n.api_name,o=n.data,null==(r=x[t])?[3,2]:[4,r(o)];case 1:return[2,i.sent()];case 2:throw new Error("operateWXData:fail sdk not support "+t+" api.")}}))}))}}),S=(A={},function(e){var n=A[e];return null!=n?n:(n=function(e){var n=d(k,e);return n||g[e]||void 0}(e),A[e]=n)}),I=["enablePullDownRefresh","disablePullDownRefresh"];function C(e){var n=e.CoreAdapter,r=e.logger,i=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}(n,e),n.prototype.init=function(){var n=this;e.prototype.init.call(this),function(e,n){c.start(e),l.init(n)}({emitter:function(e){var t=e.event,o=e.data;r.debug("[hyext adapter] emit "+t,o),n._dispatchServiceEvent(t,o),n.$events.emit(t,o)}},r)},n.prototype.invokeHandler=function(e){var n=this,t=e.apiName,i=e.params,a=e.callbackId;if(!(I.indexOf(t)>-1)){r.debug("[hyext adapter] hyext call "+t,i);var c=function(e,n,t,r){try{var i=S(n);if(!i)throw new Error("The SDK API of "+n+" is not support yet.");var a=("function"==typeof i?i:i.fn).apply(null,t);if(!f(a))return a;a.then((function(t){r(o(o({},t||{}),{errMsg:n+":ok"})),i.onAfterSuccess&&i.onAfterSuccess(e,t)})).catch((function(t){t&&t.isCancel?(r({errMsg:n+":cancel"}),i.onAfterCancel&&i.onAfterCancel(e,t)):(r({errMsg:n+":fail "+t.message}),i.onAfterFail&&i.onAfterFail(e,t))}))}catch(e){return{errMsg:n+":fail "+e.message}}}(this,t,[i],(function(e){return r.debug("[hyext adapter] hyext callback "+t,e),n._invokeServiceCallbackHandler(a,e,t)}));return null!=c&&r.debug("[hyext adapter] hyext sync response "+t,c),c}},n.prototype.publishHandler=function(e){e.event,e.params,e.from,e.formatedEvent},n}(n);(new i).init()}window.__initAdapter=C,e.init=C,Object.defineProperty(e,"__esModule",{value:!0})}(n,t.default)}));function On(e){"miniProgram"===y().projectType&&ln.init(e)}var Ln=!1,Fn=!1;window.addEventListener("message",(function(e){var n=e.data;if("object"==typeof n&&null!==n)switch(n.type){case"publish":X(n.event,JSON.parse(n.paramsString));break;case"invoke":return xn.invokeHandler(n)}})),window.addEventListener("resize",(function(){X("onWindowResize",{size:{windowWidth:window.innerWidth,windowHeight:window.innerHeight}})})),window.FinChatJSCore=xn,Bn.init({CoreAdapter:En,logger:k}),window.addEventListener("DOMContentLoaded",(function(){var e;e={windowInfo:bn.getWindowInfo(),extInfo:y()},void 0!==window.__initWebFrameOnContentLoad&&(Ce(),window.__initWebFrameOnContentLoad(e,Ie),_()&&ne().$events.on("onDeviceOrientationChange",(function(e){Ie.emit("onDeviceOrientationChange",e)})))})),window.__handlePreloadLinkAllLoaded=function(){Fn=!0,Ln&&On("preloadReady")},window.addEventListener("DOMContentLoaded",(function(){Ln=!0,(Fn||window.__preloadSuccess)&&On("DOMContentLoaded")})),window.addEventListener("load",(function(){On("windowLoadReady")}))}));
|
63
|
+
var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&(e[t]=n[t])},t(e,n)},r=function(){return r=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},r.apply(this,arguments)};function o(e,n,t,r){return new(t||(t=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var n;e.done?o(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(a,s)}u((r=r.apply(e,n||[])).next())}))}function i(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:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(t)throw new TypeError("Generator is already executing.");for(;a;)try{if(t=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=n.call(e,a)}catch(e){i=[6,e],r=0}finally{t=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}}var a=function(){function e(){this._queue=[],this._queue=[]}return e.prototype.regist=function(e){this._queue.push(e)},e.prototype.start=function(e){this._queue.forEach((function(n){try{n.call(null,e)}catch(e){}}))},e}(),s=new a,u=[];function c(e){u.length>0&&(u.forEach((function(n){var t=e[n.method];t&&t.apply(e,n.args)})),u=[])}var d=function(){function e(){}return e.init=function(e){this.logger=e},e.log=function(){for(var e,n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];this.logger?(c(this.logger),(e=this.logger).log.apply(e,n)):u.push({method:"log",args:n})},e.info=function(){for(var e,n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];this.logger?(c(this.logger),(e=this.logger).info.apply(e,n)):u.push({method:"info",args:n})},e.warn=function(){for(var e,n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];this.logger?(c(this.logger),(e=this.logger).warn.apply(e,n)):u.push({method:"warn",args:n})},e.error=function(){for(var e,n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];this.logger?(c(this.logger),(e=this.logger).error.apply(e,n)):u.push({method:"error",args:n})},e}();function l(e,n){return function(e,n){var t=e,r=0;if(t){for(;r<n.length;){if(!(t=t[n[r]]))return;r++}return t}}(e,n.split("."))}function f(e){return e&&"function"==typeof e.then}function p(e){var n=e.SDK,t=e.path;return function(e){var n=e.fun,t=e.genFun,r=e.sync,o=e.onCall,i=e.onSucc,a=e.onFail,s=e.onComplete;return function(){for(var e=[],u=0;u<arguments.length;u++)e[u]=arguments[u];var c=("object"==typeof e[0]?e[0]:{})||{},d=c.success,l=c.fail,p=c.complete,v=function(){s&&s(),p&&p()},h=function(e){return i&&i(e),d&&d(e),e},_=function(e){var n=a&&a(e)||e;return l&&l(n),n},m=function(){o&&o(e);var r=t&&t()||n;if(!r)throw new Error("polyfill caller is undefined");return r.apply(null,e)};if(r)try{var g=h(m());return v(),g}catch(e){var w=_(e);throw v(),w}return new Promise((function(e,n){try{var t=m();f(t)?t.then((function(n){return e(h(n))})).catch((function(e){return n(_(e))})).finally(v):(e(h(t)),v())}catch(e){n(_(e)),v()}}))}}({genFun:function(){var e=l(n,t);if(!e)throw new Error("SDK."+t+" is undefined");return e},sync:e.sync,onCall:e.onCall,onSucc:e.onSucc,onFail:e.onFail,onComplete:e.onComplete})}function v(e,n,t){return Object.defineProperty(e,n,{enumerable:!0,configurable:!1,writable:!0,value:t})}var h,_=function(e){var n=e.SDK,t=e.onFail,r=e.onCall,o=e.onSucc,i={},a=function(e,a){e&&e.length&&e.forEach((function(e){var s=e.split(".").pop();if(s)switch(a){case"consts":var u=l(n,e);u&&v(i,s,u);break;case"async":case"sync":var c=p({SDK:n,sync:"sync"===a,path:e,onCall:function(n){return r&&r(n,s,e)},onSucc:function(n){return o&&o(n,s,e)},onFail:function(n){return t&&t(n,s,e)}});v(i,s,c)}}))};return a(e.constants,"consts"),a(e.methods,"async"),a(e.syncMethods,"sync"),d.log("[hyext adapter] polyfillSDK",i),i}({SDK:hyExt,constants:["consts"],methods:["request","panel.disposal","context.login","context.checkSession","device.setOrientation","device.onOrientationChange","device.offOrientationChange","ad.createAd","ad.loadAd","ad.showAd","ad.destroyAd","ad.onAdMessage","ad.offAdMessage","context.requestPayment","fs.downloadFile","fs.access","fs.appendFile","fs.close","fs.copyFile","fs.getFileInfo","fs.getSavedFileList","fs.mkdir","fs.open","fs.read","fs.readCompressedFile","fs.readdir","fs.readFile","fs.readZipEntry","fs.unzip","fs.removeSavedFile","fs.rename","fs.rmdir","fs.saveFile","fs.stat","fs.truncate","fs.unlink","fs.write","fs.writeFile","fs.fstat","fs.ftruncate","ui.showNativeInputBar","advance.getCurrentUserInfo","onEnterForeground","onLeaveForeground","onAppear","onDisappear","device.lockOrientation","ui.showKeyboard","ui.hideKeyboard","ui.updateKeyboard","ui.onKeyboardInput","ui.onKeyboardConfirm","ui.onKeyboardComplete","ui.onKeyboardHeightChange"],syncMethods:["device.getWindowInfo","fs.accessSync","fs.appendFileSync","fs.closeSync","fs.copyFileSync","fs.mkdirSync","fs.openSync","fs.readSync","fs.readCompressedFileSync","fs.readdirSync","fs.readFileSync","fs.renameSync","fs.rmdirSync","fs.saveFileSync","fs.statSync","fs.truncateSync","fs.unlinkSync","fs.writeSync","fs.writeFileSync","fs.fstatSync","fs.ftruncateSync"],onCall:function(e,n,t){d.log("[Polyfill] call "+t+" start:",e)},onSucc:function(e,n,t){d.log("[Polyfill] call "+t+" succ:",e)},onFail:function(e,n,t){d.info("[Polyfill] call "+t+" fail:",e)}});!function(e){e.onLoad="onLoad",e.onClose="onClose",e.onError="onError"}(h||(h={}));var m=new(function(){function e(){this.events={},this.invoked=!1}return e.prototype.invoke=function(){var e=this;this.invoked||(_.onAdMessage({callback:function(n){var t=n.instanceId,r=n.eventName,o=n.res;e.emit(t,r,o)}}),this.invoked=!0)},e.prototype.clear=function(){_.offAdMessage(),Object.values(this.events).forEach((function(e){return e.removeAllListeners()})),this.events={},this.invoked=!1},e.prototype.create=function(e){return o(this,void 0,void 0,(function(){return i(this,(function(n){switch(n.label){case 0:return[4,_.createAd(e)];case 1:return[2,n.sent()]}}))}))},e.prototype.show=function(e){return o(this,void 0,void 0,(function(){return i(this,(function(n){switch(n.label){case 0:return[4,_.showAd(e)];case 1:return[2,n.sent()]}}))}))},e.prototype.load=function(e){return o(this,void 0,void 0,(function(){return i(this,(function(n){switch(n.label){case 0:return[4,_.loadAd(e)];case 1:return[2,n.sent()]}}))}))},e.prototype.destroy=function(e){return o(this,void 0,void 0,(function(){return i(this,(function(n){switch(n.label){case 0:return[4,_.destroyAd(e)];case 1:return[2,n.sent()]}}))}))},e.prototype.emit=function(e,n,t){this.events[e]&&n&&this.events[e].emit(n,t)},e.prototype.on=function(e,t,r){this.events[e]||(this.events[e]=new n.EventEmitter),this.events[e].on(t,r)},e.prototype.off=function(e,n,t){this.events[e]&&(n?t?this.events[e].off(n,t):this.events[e].removeAllListeners(n):this.events[e].removeAllListeners())},e}()),g=function(){function e(e){var n,t,r;m.invoke(),this._getInstance=(n=function(){return m.create(e)},r=!1,function(){for(var e=this,a=[],s=0;s<arguments.length;s++)a[s]=arguments[s];return r?t:(r=!0,t=o(e,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,n.apply(void 0,a)];case 1:return[2,e.sent()];case 2:throw e.sent();case 3:return[2]}}))})))})}return e.prototype.show=function(){return o(this,void 0,void 0,(function(){var e;return i(this,(function(n){switch(n.label){case 0:return[4,this._getInstance()];case 1:return e=n.sent().instanceId,[2,m.show({instanceId:e})]}}))}))},e.prototype.load=function(){return o(this,void 0,void 0,(function(){var e;return i(this,(function(n){switch(n.label){case 0:return[4,this._getInstance()];case 1:return e=n.sent().instanceId,[2,m.load({instanceId:e})]}}))}))},e.prototype.destroy=function(){return o(this,void 0,void 0,(function(){var e;return i(this,(function(n){switch(n.label){case 0:return[4,this._getInstance()];case 1:return e=n.sent().instanceId,m.off(e),[2,m.destroy({instanceId:e})]}}))}))},e.prototype.onLoad=function(e){this._getInstance().then((function(n){var t=n.instanceId;m.on(t,h.onLoad,e)})).catch((function(e){}))},e.prototype.onClose=function(e){this._getInstance().then((function(n){var t=n.instanceId;m.on(t,h.onClose,e)})).catch((function(e){}))},e.prototype.onError=function(e){this._getInstance().then((function(n){var t=n.instanceId;m.on(t,h.onError,e)})).catch((function(e){}))},e.prototype.offLoad=function(e){this._getInstance().then((function(n){var t=n.instanceId;m.off(t,h.onLoad,e)})).catch((function(e){}))},e.prototype.offClose=function(e){this._getInstance().then((function(n){var t=n.instanceId;m.off(t,h.onClose,e)})).catch((function(e){}))},e.prototype.offError=function(e){this._getInstance().then((function(n){var t=n.instanceId;m.off(t,h.onError,e)})).catch((function(e){}))},e}(),w=new(function(){function e(){this.isLandscape=!1}return e.prototype.changeOrientation=function(e){this.isLandscape=e},e.prototype.getWindowInfo=function(){try{var e=_.getWindowInfo();return d.info("getWindowInfo sync",e),e}catch(e){var n=Object.assign({safeArea:{left:0,right:0,top:0,bottom:0,width:0,height:0}},_.consts||{});return this.isLandscape?r(r({},n),{screenWidth:n.screenHeight,screenHeight:n.screenWidth,windowWidth:n.windowHeight,windowHeight:n.windowWidth,isLandscape:!0}):(n.isLandscape=!1,d.info("getWindowInfo consts",n),n)}},e}());s.regist((function(e){var n,t=e.emitter;n=window.navigator.userAgent.toLowerCase(),(/(iphone|ipad)/.test(n)||/android/.test(n))&&(d.log("[hyext adapter] device init"),_.onOrientationChange({callback:function(e){t({event:"onDeviceOrientationChange",data:e}),w.changeOrientation("landscape"===e.value)}}))}));var y={fn:function(e){return o(void 0,void 0,void 0,(function(){var n;return i(this,(function(t){switch(t.label){case 0:return n=e.defaultValue,e.maxLength,e.multiple,e.confirmHold,e.confirmType,[4,_.showNativeInputBar({text:n,btnText:"确认"})];case 1:return[2,t.sent()]}}))}))},onAfterSuccess:function(e,n){e._dispatchServiceEvent("onKeyboardInput",{value:n.text}),"mask"===n.from?e._dispatchServiceEvent("onKeyboardComplete",{value:n.text}):e._dispatchServiceEvent("onKeyboardConfirm",{value:n.text})}},b=function(){return o(void 0,void 0,void 0,(function(){var e;return i(this,(function(n){switch(n.label){case 0:return[4,_.getCurrentUserInfo()];case 1:return[2,{userInfo:{nickName:(e=n.sent()).name,avatarUrl:e.avatarUrl},rawData:"",signature:"",encryptedData:"",iv:"",cloudID:""}]}}))}))},S={webapi_getuserinfo:function(e){return b()}};s.regist((function(e){var n=e.emitter;d.log("[hyext adapter] app event init"),_.onEnterForeground((function(){n({event:"onAppEnterForeground",data:{}})})),_.onAppear((function(){n({event:"onAppShow",data:{}})})),_.onDisappear((function(){n({event:"onAppHide",data:{}})}))}));var A,I=Object.freeze({__proto__:null,createRewardedVideoAd:function(e){return new g(e)},createInterstitialAd:function(e){return new g(e)},setDeviceOrientation:function(e){var n=e||{},t=n.value,r=function(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&n.indexOf(r)<0&&(t[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)n.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(t[r[o]]=e[r[o]])}return t}(n,["value"]);return r.orientation=t,_.setOrientation(r)},onDeviceOrientationChange:function(e){return _.onOrientationChange({callback:e})},offDeviceOrientationChange:function(e){return _.offOrientationChange()},getWindowInfo:function(){return w.getWindowInfo()},downloadFile:function(e){return o(this,void 0,void 0,(function(){var n,t,r,o,a;return i(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),console.time("downloadFile url:"+e.url+",耗时:"),[4,_.downloadFile(e)];case 1:return n=i.sent(),console.timeEnd("downloadFile url:"+e.url+",耗时:"),r=(t=n||{}).tempFilePath,(o=t.filePath)||r?[2,{profile:{},statusCode:200,tempFilePath:r,filePath:o}]:[2,n];case 2:throw a=i.sent(),console.timeEnd("downloadFile url:"+e.url+"error:"+a.message),a;case 3:return[2]}}))}))},access:function(e){return _.access(e)},accessSync:function(e){return _.accessSync(e)},appendFile:function(e){return _.appendFile(e)},appendFileSync:function(e){return _.appendFileSync(e)},close:function(e){return _.close(e)},closeSync:function(e){return _.closeSync(e)},copyFile:function(e){return _.copyFile(e)},copyFileSync:function(e){return _.copyFileSync(e)},getFileInfo:function(e){return _.getFileInfo(e)},getSavedFileList:function(){return _.getSavedFileList()},mkdir:function(e){return _.mkdir(e)},mkdirSync:function(e){return _.mkdirSync(e)},open:function(e){return _.open(e)},openSync:function(e){return{data:_.openSync(e).fd}},read:function(e){return o(this,void 0,void 0,(function(){var n;return i(this,(function(t){switch(t.label){case 0:return[4,_.read(e)];case 1:return(n=t.sent()).arrayBuffer=n.originData,[2,n]}}))}))},readSync:function(e){var n=_.readSync(e);return n.arrayBuffer=n.originData,{data:n}},readCompressedFile:function(e){return o(this,void 0,void 0,(function(){var n;return i(this,(function(t){switch(t.label){case 0:return[4,_.readCompressedFile(e)];case 1:return[2,{data:(n=t.sent()).originData||n.data}]}}))}))},readCompressedFileSync:function(e){var n=_.readCompressedFileSync(e);return{data:n.originData||n.data}},readdir:function(e){return _.readdir(e)},readdirSync:function(e){return{data:_.readdirSync(e).files}},readFile:function(e){return o(this,void 0,void 0,(function(){var n;return i(this,(function(t){switch(t.label){case 0:return[4,_.readFile(e)];case 1:return(n=t.sent()).data=n.originData||n.data,[2,n]}}))}))},readFileSync:function(e){var n=_.readFileSync(e);return{data:n.originData||n.data}},readZipEntry:function(e){return o(this,void 0,void 0,(function(){return i(this,(function(n){switch(n.label){case 0:return[4,_.readZipEntry(e)];case 1:return[2,n.sent()]}}))}))},unzip:function(e){return _.unzip(e)},removeSavedFile:function(e){return _.removeSavedFile(e)},rename:function(e){return _.rename(e)},renameSync:function(e){return _.renameSync(e)},rmdir:function(e){return _.rmdir(e)},rmdirSync:function(e){return _.rmdirSync(e)},saveFile:function(e){return _.saveFile(e)},saveFileSync:function(e){return{data:_.saveFileSync(e).savedFilePath}},stat:function(e){return _.stat(e)},statSync:function(e){return{data:_.statSync(e).stats}},truncate:function(e){return _.truncate(e)},truncateSync:function(e){return _.truncateSync(e)},unlink:function(e){return _.unlink(e)},unlinkSync:function(e){return _.unlinkSync(e)},write:function(e){return _.write(e)},writeSync:function(e){return{data:_.writeSync(e).bytesWritten}},writeFile:function(e){return _.writeFile(e)},writeFileSync:function(e){return _.writeFileSync(e)},fstat:function(e){return _.fstat(e)},fstatSync:function(e){return{data:_.fstatSync(e).stats}},ftruncate:function(e){return _.ftruncate(e)},ftruncateSync:function(e){return _.ftruncateSync(e)},exitMiniProgram:function(e){return _.disposal(e)},showGameKeyboard:y,hideGameKeyboard:function(){},updateGameKeyboard:function(e){},login:function(e){return _.login(e)},checkSession:function(e){return _.checkSession(e)},request:function(e){var n=e.data,t=e.dataType,r=e.header,o=e.method,i=e.url;return _.request({url:i,method:o,data:n,dataType:t,header:r})},getUserProfile:b,operateWXData:function(e){return o(this,void 0,void 0,(function(){var n,t,r,o;return i(this,(function(i){switch(i.label){case 0:return n=e.data,t=n.api_name,r=n.data,null==(o=S[t])?[3,2]:[4,o(r)];case 1:return[2,i.sent()];case 2:throw new Error("operateWXData:fail sdk not support "+t+" api.")}}))}))}}),k=(A={},function(e){var n=A[e];return null!=n?n:(n=function(e){var n=l(I,e);return n||_[e]||void 0}(e),A[e]=n)}),T=["enablePullDownRefresh","disablePullDownRefresh"];function x(e){var n=e.CoreAdapter,o=e.logger,i=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}(n,e),n.prototype.init=function(){var n=this;e.prototype.init.call(this),function(e,n){s.start(e),d.init(n)}({emitter:function(e){var t=e.event,r=e.data;o.debug("[hyext adapter] emit "+t,r),n._dispatchServiceEvent(t,r),n.$events.emit(t,r)}},o)},n.prototype.invokeHandler=function(e){var n=this,t=e.apiName,i=e.params,a=e.callbackId;if(!(T.indexOf(t)>-1)){o.debug("[hyext adapter] hyext call "+t,i);var s=function(e,n,t,o){try{var i=k(n);if(!i)throw new Error("The SDK API of "+n+" is not support yet.");var a=("function"==typeof i?i:i.fn).apply(null,t);if(!f(a))return a;a.then((function(t){o(r(r({},t||{}),{errMsg:n+":ok"})),i.onAfterSuccess&&i.onAfterSuccess(e,t)})).catch((function(t){t&&t.isCancel?(o({errMsg:n+":cancel"}),i.onAfterCancel&&i.onAfterCancel(e,t)):(o({errMsg:n+":fail "+t.message}),i.onAfterFail&&i.onAfterFail(e,t))}))}catch(e){return{errMsg:n+":fail "+e.message}}}(this,t,[i],(function(e){return o.debug("[hyext adapter] hyext callback "+t,e),n._invokeServiceCallbackHandler(a,e,t)}));return null!=s&&o.debug("[hyext adapter] hyext sync response "+t,s),s}},n.prototype.publishHandler=function(e){e.event,e.params,e.from,e.formatedEvent},n}(n);(new i).init()}window.__initAdapter=x,e.init=x,Object.defineProperty(e,"__esModule",{value:!0})}(n,t.default)}));function On(e){"miniProgram"===w().projectType&&dn.init(e)}window.addEventListener("message",(function(e){var n=e.data;if("object"==typeof n&&null!==n)switch(n.type){case"publish":Z(n.event,JSON.parse(n.paramsString));break;case"invoke":return Sn.invokeHandler(n)}})),window.addEventListener("resize",(function(){Z("onWindowResize",{size:{windowWidth:window.innerWidth,windowHeight:window.innerHeight}})})),window.FinChatJSCore=Sn,Fn.init({CoreAdapter:En,logger:I}),window.addEventListener("DOMContentLoaded",(function(){var e;e={windowInfo:yn.getWindowInfo(),extInfo:w()},void 0!==window.__initWebFrameOnContentLoad&&(xe(),window.__initWebFrameOnContentLoad(e,Te),b()&&ne().$events.on("onDeviceOrientationChange",(function(e){Te.emit("onDeviceOrientationChange",e)})))})),window.__preloadSuccess&&On("__preloadSuccess"),window.__handlePreloadLinkAllLoaded=function(){On("preloadReady")},window.addEventListener("load",(function(){On("windowLoadReady")}))}));
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@revues/web-sdk-core",
|
3
|
-
"version": "1.2.
|
3
|
+
"version": "1.2.3",
|
4
4
|
"description": "> TODO: description",
|
5
5
|
"author": "loler",
|
6
6
|
"homepage": "",
|
@@ -23,13 +23,12 @@
|
|
23
23
|
"test": "echo \"Error: run tests from root\" && exit 1"
|
24
24
|
},
|
25
25
|
"dependencies": {
|
26
|
-
"@revues/hyext-adapter": "1.2.
|
27
|
-
"@revues/web-frame": "1.2.2-alpha.4",
|
26
|
+
"@revues/hyext-adapter": "1.2.3",
|
28
27
|
"eventemitter3": "^5.0.1",
|
29
28
|
"howler": "^2.2.4"
|
30
29
|
},
|
31
30
|
"devDependencies": {
|
32
31
|
"@types/howler": "^2.2.11"
|
33
32
|
},
|
34
|
-
"gitHead": "
|
33
|
+
"gitHead": "f79bebcec72da249d96ebd1bcbb001f6182e59ec"
|
35
34
|
}
|