@internetarchive/bookreader 5.0.0-64 → 5.0.0-65
Sign up to get free protection for your applications and to get access to all the features.
- package/BookReader/BookReader.css +2 -1
- package/BookReader/BookReader.js +1 -1
- package/BookReader/BookReader.js.map +1 -1
- package/BookReader/ia-bookreader-bundle.js +2 -2
- package/BookReader/ia-bookreader-bundle.js.map +1 -1
- package/BookReader/plugins/plugin.search.js +1 -1
- package/BookReader/plugins/plugin.search.js.map +1 -1
- package/BookReader/plugins/plugin.tts.js +1 -1
- package/BookReader/plugins/plugin.tts.js.map +1 -1
- package/BookReader/plugins/plugin.url.js +1 -1
- package/BookReader/plugins/plugin.url.js.map +1 -1
- package/CHANGELOG.md +5 -0
- package/package.json +13 -13
- package/src/BookReader.js +0 -5
- package/src/BookReader/DebugConsole.js +0 -54
- package/tests/jest/BookReader/DebugConsole.test.js +0 -25
@@ -1,3 +1,3 @@
|
|
1
1
|
/*! For license information please see plugin.tts.js.LICENSE.txt */
|
2
|
-
(self.webpackChunk_internetarchive_bookreader=self.webpackChunk_internetarchive_bookreader||[]).push([[34],{4025:function(t,e,n){"use strict";n(4916),n(1539),n(9714),n(4723),n(9826),n(2222),n(9600),n(1249),n(8309),n(2707),n(7327),n(6755),n(4678),n(9720),n(4747),n(8674),n(2526),n(1817),n(2165),n(6992),n(8783),n(3948),n(2443),n(3680),n(3706),n(2703),n(489),n(5069),n(7042),n(1038),n(6649),n(6078),n(9653),n(2419),n(4819),n(5003),n(5306),n(9601);var r=n(5311);function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}function i(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,s=[],u=!0,l=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(s.push(r.value),s.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(t,e)||function(t,e){if(t){if("string"==typeof t)return a(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?a(t,e):void 0}}(t,e)||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 a(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function s(){s=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",l=i.toStringTag||"@@toStringTag";function c(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,n){return t[e]=n}}function h(t,e,n,o){var i=e&&e.prototype instanceof p?e:p,a=Object.create(i.prototype),s=new x(o||[]);return r(a,"_invoke",{value:k(t,n,s)}),a}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=h;var d={};function p(){}function y(){}function v(){}var m={};c(m,a,(function(){return this}));var g=Object.getPrototypeOf,A=g&&g(g(L([])));A&&A!==e&&n.call(A,a)&&(m=A);var b=v.prototype=p.prototype=Object.create(m);function w(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function _(t,e){function i(r,a,s,u){var l=f(t[r],t,a);if("throw"!==l.type){var c=l.arg,h=c.value;return h&&"object"==o(h)&&n.call(h,"__await")?e.resolve(h.__await).then((function(t){i("next",t,s,u)}),(function(t){i("throw",t,s,u)})):e.resolve(h).then((function(t){c.value=t,s(c)}),(function(t){return i("throw",t,s,u)}))}u(l.arg)}var a;r(this,"_invoke",{value:function(t,n){function r(){return new e((function(e,r){i(t,n,e,r)}))}return a=a?a.then(r,r):r()}})}function k(t,e,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return{value:void 0,done:!0}}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var s=V(a,n);if(s){if(s===d)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var u=f(t,e,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===d)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}function V(t,e){var n=e.method,r=t.iterator[n];if(void 0===r)return e.delegate=null,"throw"===n&&t.iterator.return&&(e.method="return",e.arg=void 0,V(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),d;var o=f(r,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,d;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,d):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,d)}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function S(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function x(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function L(t){if(t){var e=t[a];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:M}}function M(){return{value:void 0,done:!0}}return y.prototype=v,r(b,"constructor",{value:v,configurable:!0}),r(v,"constructor",{value:y,configurable:!0}),y.displayName=c(v,l,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===y||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,c(t,l,"GeneratorFunction")),t.prototype=Object.create(b),t},t.awrap=function(t){return{__await:t}},w(_.prototype),c(_.prototype,u,(function(){return this})),t.AsyncIterator=_,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new _(h(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},w(b),c(b,l,"Generator"),c(b,a,(function(){return this})),c(b,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},t.values=L,x.prototype={constructor:x,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(S),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(n,r){return a.type="throw",a.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var s=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,d):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),d},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),S(n),d}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;S(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:L(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),d}},t}function u(t,e,n,r,o,i,a){try{var s=t[i](a),u=s.value}catch(t){return void n(t)}s.done?e(u):Promise.resolve(u).then(r,o)}function l(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,i=function(t,e){if("object"!==o(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==o(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===o(i)?i:String(i)),r)}var i}var c=function(){function t(e,n,r,o){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.leafIndex=e,this.chunkIndex=n,this.text=r,this.lineRects=o}var e,n,o,a;return e=t,null,n=[{key:"fetch",value:(o=s().mark((function e(n,o,i){var a;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r.ajax({type:"GET",url:"https://".concat(n,"/BookReader/BookReaderGetTextWrapper.php"),dataType:"jsonp",cache:!0,data:{path:"".concat(o,"_djvu.xml"),page:i}});case 2:return a=e.sent,e.abrupt("return",t._fromTextWrapperResponse(i,a));case 4:case"end":return e.stop()}}),e)})),a=function(){var t=this,e=arguments;return new Promise((function(n,r){var i=o.apply(t,e);function a(t){u(i,n,r,a,s,"next",t)}function s(t){u(i,n,r,a,s,"throw",t)}a(void 0)}))},function(t,e,n){return a.apply(this,arguments)})},{key:"_fromTextWrapperResponse",value:function(e,n){return n.map((function(n,r){var o=t._fixChunkRects(n.slice(1)),i=t._removeDanglingHyphens(n[0]);return new t(e,r,i,o)}))}},{key:"_fixChunkRects",value:function(t){if(t.length<2)return t;var e=i(t,2),n=e[0],r=e[1],o=i(n,3),a=o[0],s=o[1],u=o[2]-a,l=r[1]-r[3],c=r[2]-r[0],h=r[2];return u>30*c&&(n[2]=h,n[3]=s-l),t}},{key:"_removeDanglingHyphens",value:function(t){return t.replace(/[-¬]\s+/g,"")}}],n&&l(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function h(t){return h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},h(t)}function f(){f=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,n){return t[e]=n}}function l(t,e,n,o){var i=e&&e.prototype instanceof p?e:p,a=Object.create(i.prototype),s=new x(o||[]);return r(a,"_invoke",{value:k(t,n,s)}),a}function c(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=l;var d={};function p(){}function y(){}function v(){}var m={};u(m,i,(function(){return this}));var g=Object.getPrototypeOf,A=g&&g(g(L([])));A&&A!==e&&n.call(A,i)&&(m=A);var b=v.prototype=p.prototype=Object.create(m);function w(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function _(t,e){function o(r,i,a,s){var u=c(t[r],t,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==h(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,a,s)}),(function(t){o("throw",t,a,s)})):e.resolve(f).then((function(t){l.value=t,a(l)}),(function(t){return o("throw",t,a,s)}))}s(u.arg)}var i;r(this,"_invoke",{value:function(t,n){function r(){return new e((function(e,r){o(t,n,e,r)}))}return i=i?i.then(r,r):r()}})}function k(t,e,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return{value:void 0,done:!0}}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var s=V(a,n);if(s){if(s===d)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var u=c(t,e,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===d)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}function V(t,e){var n=e.method,r=t.iterator[n];if(void 0===r)return e.delegate=null,"throw"===n&&t.iterator.return&&(e.method="return",e.arg=void 0,V(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),d;var o=c(r,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,d;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,d):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,d)}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function S(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function x(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function L(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:M}}function M(){return{value:void 0,done:!0}}return y.prototype=v,r(b,"constructor",{value:v,configurable:!0}),r(v,"constructor",{value:y,configurable:!0}),y.displayName=u(v,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===y||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,u(t,s,"GeneratorFunction")),t.prototype=Object.create(b),t},t.awrap=function(t){return{__await:t}},w(_.prototype),u(_.prototype,a,(function(){return this})),t.AsyncIterator=_,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new _(l(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},w(b),u(b,s,"Generator"),u(b,i,(function(){return this})),u(b,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},t.values=L,x.prototype={constructor:x,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(S),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(n,r){return a.type="throw",a.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var s=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,d):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),d},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),S(n),d}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;S(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:L(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),d}},t}function d(t,e,n,r,o,i,a){try{var s=t[i](a),u=s.value}catch(t){return void n(t)}s.done?e(u):Promise.resolve(u).then(r,o)}function p(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==h(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==h(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===h(o)?o:String(o)),r)}var o}var y=function(){function t(e,n,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.pageCount=e,this.opts=Object.assign({},v,r),this._cursor={page:n,chunk:0},this._bufferedPages={},this._bufferingPages={},this._cursorLock=Promise.resolve()}var e,n,r,o;return e=t,n=[{key:"next",value:function(){var t=this;return this._cursorLock=this._cursorLock.then((function(){return t._nextUncontrolled()}))}},{key:"decrement",value:function(){var t=this;return this._cursorLock=this._cursorLock.then((function(){return t._decrementUncontrolled()}))}},{key:"_nextUncontrolled",value:(r=f().mark((function e(){var n;return f().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._cursor.page!=this.pageCount){e.next=2;break}return e.abrupt("return",Promise.resolve(t.AT_END));case 2:return this._recenterBuffer(this._cursor.page),e.next=5,this._fetchPageChunks(this._cursor.page);case 5:if(n=e.sent,this._cursor.chunk!=n.length){e.next=10;break}return this._cursor.page++,this._cursor.chunk=0,e.abrupt("return",this._nextUncontrolled());case 10:return e.abrupt("return",n[this._cursor.chunk++]);case 11:case"end":return e.stop()}}),e,this)})),o=function(){var t=this,e=arguments;return new Promise((function(n,o){var i=r.apply(t,e);function a(t){d(i,n,o,a,s,"next",t)}function s(t){d(i,n,o,a,s,"throw",t)}a(void 0)}))},function(){return o.apply(this,arguments)})},{key:"_decrementUncontrolled",value:function(){var t=this,e=Promise.resolve();return this._cursor.chunk>0?this._cursor.chunk--:this._cursor.page>0&&(this._cursor.page--,e=this._fetchPageChunks(this._cursor.page).then((function(e){if(0==e.length)return t._decrementUncontrolled();t._cursor.chunk=e.length-1}))),e.then((function(){return t._fetchPageChunks(t._cursor.page)}))}},{key:"_recenterBuffer",value:function(t){for(var e=Math.max(0,t-this.opts.pageBufferSize),n=Math.min(this.pageCount,t+this.opts.pageBufferSize+1),r=e;r<n;r++)this._fetchPageChunks(r);this._removePageFromBuffer(e-1),this._removePageFromBuffer(n+1)}},{key:"_removePageFromBuffer",value:function(t){delete this._bufferingPages[t],delete this._bufferedPages[t]}},{key:"_fetchPageChunks",value:function(t){var e=this;return t in this._bufferingPages?this._bufferingPages[t]:t in this._bufferedPages?Promise.resolve(this._bufferedPages[t]):(this._bufferingPages[t]=this._fetchPageChunksDirect(t).then((function(n){return delete e._bufferingPages[t],e._bufferedPages[t]=n,n})),this._bufferingPages[t])}},{key:"_fetchPageChunksDirect",value:function(t){return c.fetch(this.opts.server,this.opts.bookPath,t)}}],n&&p(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();y.AT_END="__PageChunkIterator.AT_END__";var v={server:null,bookPath:null,pageBufferSize:2},m=n(5311);function g(t){return g="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},g(t)}function A(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function b(){b=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,n){return t[e]=n}}function l(t,e,n,o){var i=e&&e.prototype instanceof f?e:f,a=Object.create(i.prototype),s=new x(o||[]);return r(a,"_invoke",{value:k(t,n,s)}),a}function c(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=l;var h={};function f(){}function d(){}function p(){}var y={};u(y,i,(function(){return this}));var v=Object.getPrototypeOf,m=v&&v(v(L([])));m&&m!==e&&n.call(m,i)&&(y=m);var A=p.prototype=f.prototype=Object.create(y);function w(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function _(t,e){function o(r,i,a,s){var u=c(t[r],t,i);if("throw"!==u.type){var l=u.arg,h=l.value;return h&&"object"==g(h)&&n.call(h,"__await")?e.resolve(h.__await).then((function(t){o("next",t,a,s)}),(function(t){o("throw",t,a,s)})):e.resolve(h).then((function(t){l.value=t,a(l)}),(function(t){return o("throw",t,a,s)}))}s(u.arg)}var i;r(this,"_invoke",{value:function(t,n){function r(){return new e((function(e,r){o(t,n,e,r)}))}return i=i?i.then(r,r):r()}})}function k(t,e,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return{value:void 0,done:!0}}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var s=V(a,n);if(s){if(s===h)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var u=c(t,e,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===h)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}function V(t,e){var n=e.method,r=t.iterator[n];if(void 0===r)return e.delegate=null,"throw"===n&&t.iterator.return&&(e.method="return",e.arg=void 0,V(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),h;var o=c(r,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,h;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,h):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,h)}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function S(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function x(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function L(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:M}}function M(){return{value:void 0,done:!0}}return d.prototype=p,r(A,"constructor",{value:p,configurable:!0}),r(p,"constructor",{value:d,configurable:!0}),d.displayName=u(p,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===d||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,u(t,s,"GeneratorFunction")),t.prototype=Object.create(A),t},t.awrap=function(t){return{__await:t}},w(_.prototype),u(_.prototype,a,(function(){return this})),t.AsyncIterator=_,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new _(l(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},w(A),u(A,s,"Generator"),u(A,i,(function(){return this})),u(A,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},t.values=L,x.prototype={constructor:x,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(S),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(n,r){return a.type="throw",a.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var s=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,h):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),h},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),S(n),h}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;S(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:L(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),h}},t}function w(t,e,n,r,o,i,a){try{var s=t[i](a),u=s.value}catch(t){return void n(t)}s.done?e(u):Promise.resolve(u).then(r,o)}function _(t){return function(){var e=this,n=arguments;return new Promise((function(r,o){var i=t.apply(e,n);function a(t){w(i,r,o,a,s,"next",t)}function s(t){w(i,r,o,a,s,"throw",t)}a(void 0)}))}}function k(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,V(r.key),r)}}function V(t){var e=function(t,e){if("object"!==g(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==g(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"===g(e)?e:String(e)}var O=function(){function t(e){var n,r,o,i=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),n=this,o=function(){i.voice=t.getBestBookVoice(i.getVoices(),i.opts.bookLanguage)},(r=V(r="updateBestVoice"))in n?Object.defineProperty(n,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[r]=o,this.playing=!1,this.paused=!1,this.opts=e,this._chunkIterator=null,this.activeSound=null,this.playbackRate=1,this.events=m({}),this.voice=null,this.events.on("voiceschanged",this.updateBestVoice),this.events.trigger("voiceschanged")}var e,n,r,o,i;return e=t,n=[{key:"getVoices",value:function(){throw new Error("Unimplemented abstract class")}},{key:"init",value:function(){return null}},{key:"start",value:function(t,e){this.playing=!0,this.opts.onLoadingStart(),this._chunkIterator=new y(e,t,{server:this.opts.server,bookPath:this.opts.bookPath,pageBufferSize:5}),this.step(),this.events.trigger("start")}},{key:"stop",value:function(){this.activeSound&&this.activeSound.stop(),this.playing=!1,this._chunkIterator=null,this.activeSound=null,this.events.trigger("stop")}},{key:"pause",value:function(){var t=!this.paused&&this.activeSound;this.paused=!0,this.activeSound&&this.activeSound.pause(),t&&this.events.trigger("pause")}},{key:"resume",value:function(){var t=this.paused&&this.activeSound;this.paused=!1,this.activeSound&&this.activeSound.resume(),t&&this.events.trigger("resume")}},{key:"togglePlayPause",value:function(){this.paused?this.resume():this.pause()}},{key:"jumpForward",value:function(){this.activeSound&&this.activeSound.finish()}},{key:"jumpBackward",value:(i=_(b().mark((function t(){var e=this;return b().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Promise.all([this.activeSound.stop(),this._chunkIterator.decrement().then((function(){return e._chunkIterator.decrement()}))]);case 2:this.step();case 3:case"end":return t.stop()}}),t,this)}))),function(){return i.apply(this,arguments)})},{key:"setVoice",value:function(t){this.events.off("voiceschanged",this.updateBestVoice),this.voice=this.getVoices().find((function(e){return e.voiceURI===t})),this.activeSound&&this.activeSound.setVoice(this.voice)}},{key:"setPlaybackRate",value:function(t){this.playbackRate=t,this.activeSound&&this.activeSound.setPlaybackRate(t)}},{key:"step",value:(o=_(b().mark((function t(){var e,n,r,o=this;return b().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this._chunkIterator.next();case 2:if((e=t.sent)!=y.AT_END){t.next=7;break}return this.stop(),this.opts.onDone(),t.abrupt("return");case 7:return this.opts.onLoadingStart(),(n=this.createSound(e)).chunk=e,n.rate=this.playbackRate,n.voice=this.voice,n.load((function(){return o.opts.onLoadingComplete()})),this.opts.onLoadingComplete(),t.next=16,this.opts.beforeChunkPlay(e);case 16:if(this.playing){t.next=18;break}return t.abrupt("return");case 18:return t.next=20,this.playSound(n).then((function(){return o.opts.afterChunkPlay(n.chunk)}));case 20:return r=t.sent,this.paused&&this.pause(),t.next=24,r;case 24:if(!this.playing){t.next=26;break}return t.abrupt("return",this.step());case 26:case"end":return t.stop()}}),t,this)}))),function(){return o.apply(this,arguments)})},{key:"createSound",value:function(t){throw new Error("Unimplemented abstract class")}},{key:"playSound",value:function(t){return this.activeSound=t,this.activeSound.loaded||this.opts.onLoadingStart(),this.activeSound.play()}},{key:"getBestVoice",value:function(){return t.getBestBookVoice(this.getVoices(),this.opts.bookLanguage)}}],r=[{key:"isSupported",value:function(){throw new Error("Unimplemented abstract class")}},{key:"getBestBookVoice",value:function(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:navigator.languages,o=e.filter((function(t){return t.lang.startsWith(n)})),i=(r=r||(navigator.language?[navigator.language]:[])).filter((function(t){return t.startsWith(n)}));return t.getMatchingVoice(i,o)||o.find((function(t){return t.default}))||o[0]||t.getMatchingVoice(r,e)||e.find((function(t){return t.default}))||e[0]}},{key:"getMatchingVoice",value:function(t,e){var n,r=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return A(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?A(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}(t);try{var o=function(){var t=n.value,r=e.filter((function(e){return e.lang.replace("_","-").startsWith(t)}));if(r.length)return{v:r.find((function(t){return t.default}))||r[0]}};for(r.s();!(n=r.n()).done;){var i=o();if("object"===g(i))return i.v}}catch(t){r.e(t)}finally{r.f()}}}],n&&k(e.prototype,n),r&&k(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}(),S=n(5685),x=(n(5529),n(4371),n(5311));function L(t){return L="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},L(t)}function M(){M=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,n){return t[e]=n}}function l(t,e,n,o){var i=e&&e.prototype instanceof f?e:f,a=Object.create(i.prototype),s=new O(o||[]);return r(a,"_invoke",{value:w(t,n,s)}),a}function c(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=l;var h={};function f(){}function d(){}function p(){}var y={};u(y,i,(function(){return this}));var v=Object.getPrototypeOf,m=v&&v(v(S([])));m&&m!==e&&n.call(m,i)&&(y=m);var g=p.prototype=f.prototype=Object.create(y);function A(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function b(t,e){function o(r,i,a,s){var u=c(t[r],t,i);if("throw"!==u.type){var l=u.arg,h=l.value;return h&&"object"==L(h)&&n.call(h,"__await")?e.resolve(h.__await).then((function(t){o("next",t,a,s)}),(function(t){o("throw",t,a,s)})):e.resolve(h).then((function(t){l.value=t,a(l)}),(function(t){return o("throw",t,a,s)}))}s(u.arg)}var i;r(this,"_invoke",{value:function(t,n){function r(){return new e((function(e,r){o(t,n,e,r)}))}return i=i?i.then(r,r):r()}})}function w(t,e,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return{value:void 0,done:!0}}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var s=_(a,n);if(s){if(s===h)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var u=c(t,e,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===h)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}function _(t,e){var n=e.method,r=t.iterator[n];if(void 0===r)return e.delegate=null,"throw"===n&&t.iterator.return&&(e.method="return",e.arg=void 0,_(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),h;var o=c(r,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,h;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,h):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,h)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function V(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function O(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function S(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:x}}function x(){return{value:void 0,done:!0}}return d.prototype=p,r(g,"constructor",{value:p,configurable:!0}),r(p,"constructor",{value:d,configurable:!0}),d.displayName=u(p,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===d||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,u(t,s,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},A(b.prototype),u(b.prototype,a,(function(){return this})),t.AsyncIterator=b,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new b(l(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},A(g),u(g,s,"Generator"),u(g,i,(function(){return this})),u(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},t.values=S,O.prototype={constructor:O,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(V),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(n,r){return a.type="throw",a.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var s=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,h):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),h},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),V(n),h}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;V(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:S(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),h}},t}function P(t,e,n,r,o,i,a){try{var s=t[i](a),u=s.value}catch(t){return void n(t)}s.done?e(u):Promise.resolve(u).then(r,o)}function E(t){return function(){var e=this,n=arguments;return new Promise((function(r,o){var i=t.apply(e,n);function a(t){P(i,r,o,a,s,"next",t)}function s(t){P(i,r,o,a,s,"throw",t)}a(void 0)}))}}function I(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function T(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==L(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==L(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===L(o)?o:String(o)),r)}var o}function q(t,e,n){return e&&T(t.prototype,e),n&&T(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function R(){return R="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=F(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},R.apply(this,arguments)}function D(t,e){return D=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},D(t,e)}function F(t){return F=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},F(t)}var C=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&D(t,e)}(i,t);var e,n,r,o=(n=i,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=F(n);if(r){var o=F(this).constructor;t=Reflect.construct(e,arguments,o)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===L(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function i(t){var e,n;return I(this,i),(n=o.call(this,t)).audioFormat=null!==(e=x.browser)&&void 0!==e&&e.mozilla?"ogg":"mp3",n}return q(i,[{key:"getVoices",value:function(){return[{default:!0,lang:"en-US",localService:!1,name:"Festival - English (US)",voiceURI:null}]}},{key:"init",value:function(){soundManager.setup({debugMode:!1,preferFlash:!0,url:"/bookreader/BookReader/soundmanager/swf",useHTML5Audio:!0,flashVersion:9})}},{key:"start",value:function(t,e){var n=this,r=null;navigator.userAgent.match(/mobile/i)&&(r=this.iOSCaptureUserIntentHack()),(r=r||Promise.resolve()).then((function(){return R(F(i.prototype),"start",n).call(n,t,e)}))}},{key:"createSound",value:function(t){return new j(this.getSoundUrl(t.text))}},{key:"getSoundUrl",value:function(t){return"https://"+this.opts.server+"/BookReader/BookReaderGetTTS.php?string="+encodeURIComponent(t)+"&format=."+this.audioFormat}},{key:"iOSCaptureUserIntentHack",value:(e=E(M().mark((function t(){var e;return M().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=soundManager.createSound({url:B[this.audioFormat]}),t.next=3,new Promise((function(t){return e.play({onfinish:t})}));case 3:e.destruct();case 4:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})}],[{key:"isSupported",value:function(){return"undefined"!=typeof soundManager&&soundManager.supported()}}]),i}(O),j=function(){function t(e){I(this,t),this.soundUrl=e,this.sound=null,this.rate=1,this._finishResolver=null}var e;return q(t,[{key:"loaded",get:function(){return this.sound&&this.sound.loaded}},{key:"load",value:function(t){var e,n=this;return this.sound=soundManager.createSound({url:this.soundUrl,onload:function(){1!=n.rate&&n.sound.setPlaybackRate(n.rate),t()},onresume:(e=E(M().mark((function t(){return M().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,(0,S.sleep)(25);case 2:1!=n.rate&&n.sound.setPlaybackRate(n.rate);case 3:case"end":return t.stop()}}),t)}))),function(){return e.apply(this,arguments)})}),this.sound.load()}},{key:"play",value:(e=E(M().mark((function t(){var e=this;return M().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,new Promise((function(t){e._finishResolver=t,e.sound.play({onfinish:t})}));case 2:this.sound.destruct();case 3:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"stop",value:function(){return this.sound.stop(),Promise.resolve()}},{key:"pause",value:function(){this.sound.pause()}},{key:"resume",value:function(){this.sound.resume()}},{key:"setPlaybackRate",value:function(t){this.rate=t,this.sound.setPlaybackRate(t)}},{key:"finish",value:function(){this.sound.stop(),this._finishResolver()}}]),t}(),B={mp3:"data:audio/mp3;base64,//uQxAAAAAAAAAAAAAAAAAAAAAAAWGluZwAAAA8AAAACAAACcQCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA//////////////////////////////////////////////////////////////////8AAAAeTEFNRTMuOTlyBJwAAAAAAAAAADUgJAaUQQABrgAAAnHIf8sZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//sQxAADwlwBKGAAACAAAD/AAAAEAAAAH///////////////+UBAMExBTUUzLjk5LjOqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqr/+xDEIAPAAAGkAAAAIAAANIAAAASqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqg==",ogg:"data:audio/ogg;base64,T2dnUwACAAAAAAAAAAAVEgAAAAAAAADSDf4BHgF2b3JiaXMAAAAAAUSsAAAAAAAAAHcBAAAAAA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WWUuogpNRaSi211loHJaXWUmqttdY6CKW01FprrbXYQUgppdZaiy3GUEpKrbXYYow1hlJSaq3F2GKsMaTSUmwtxhhjrKGU1lprMcYYay0ptdZijLXGWmtJqbXWYos11loLAOBucACASLBxhpWks8LR4EJDVgIAIQEABEKMOeeccxBCCCFSijHnoIMQQgghREox5hx0EEIIIYSMMeeggxBCCCGEkDHmHHQQQgghhBA65xyEEEIIoYRSSuccdBBCCCGUUELpIIQQQgihhFJKKR2EEEIooYRSSiklhBBCCaWUUkoppYQQQgihhBJKKaWUEEIIpZRSSimllBJCCCGUUkoppZRSQgihlFBKKaWUUkoIIYRSSimllFJKCSGEUEoppZRSSikhhBJKKaWUUkoppQAAgAMHAIAAI+gko8oibDThwgNQaMhKAIAMAABx2GrrKdbIIMWchJZLhJByEGIuEVKKOUexZUgZxRjVlDGlFFNSa+icYoxRT51jSjHDrJRWSiiRgtJyrLV2zAEAACAIADAQITOBQAEUGMgAgAOEBCkAoLDA0DFcBATkEjIKDArHhHPSaQMAEITIDJGIWAwSE6qBomI6AFhcYMgHgAyNjbSLC+gywAVd3HUghCAEIYjFARSQgIMTbnjiDU+4wQk6RaUOAgAAAAAAAQAeAACSDSAiIpo5jg6PD5AQkRGSEpMTlAAAAAAA4AGADwCAJAWIiIhmjqPD4wMkRGSEpMTkBCUAAAAAAAAAAAAICAgAAAAAAAQAAAAICE9nZ1MABCwAAAAAAAAAFRIAAAIAAAAPBTD1AgEBAAo="};function N(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:navigator.userAgent,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:navigator.vendor;return/chrome/i.test(t)&&/google inc/i.test(e)}function U(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:navigator.userAgent;return/firefox/i.test(t)}var H=n(1030);function Y(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:navigator.userAgent;return/android/i.test(t)}var Q={Name:0,Endonym:1,"ISO 639-1":2,"ISO 639-2/T":3,"ISO 639-2/B":4};function G(t,e){for(var n=0;n<H.Z.length;n++)for(var r=0;r<e.length;r++){var o=e[r];if(-1!=H.Z[n][Q[o]].split(", ").map((function(t){return t.toLowerCase()})).indexOf(t))return H.Z[n][Q["ISO 639-1"]]}return null}function z(t){return z="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},z(t)}function K(){K=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,n){return t[e]=n}}function l(t,e,n,o){var i=e&&e.prototype instanceof f?e:f,a=Object.create(i.prototype),s=new O(o||[]);return r(a,"_invoke",{value:w(t,n,s)}),a}function c(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=l;var h={};function f(){}function d(){}function p(){}var y={};u(y,i,(function(){return this}));var v=Object.getPrototypeOf,m=v&&v(v(S([])));m&&m!==e&&n.call(m,i)&&(y=m);var g=p.prototype=f.prototype=Object.create(y);function A(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function b(t,e){function o(r,i,a,s){var u=c(t[r],t,i);if("throw"!==u.type){var l=u.arg,h=l.value;return h&&"object"==z(h)&&n.call(h,"__await")?e.resolve(h.__await).then((function(t){o("next",t,a,s)}),(function(t){o("throw",t,a,s)})):e.resolve(h).then((function(t){l.value=t,a(l)}),(function(t){return o("throw",t,a,s)}))}s(u.arg)}var i;r(this,"_invoke",{value:function(t,n){function r(){return new e((function(e,r){o(t,n,e,r)}))}return i=i?i.then(r,r):r()}})}function w(t,e,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return{value:void 0,done:!0}}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var s=_(a,n);if(s){if(s===h)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var u=c(t,e,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===h)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}function _(t,e){var n=e.method,r=t.iterator[n];if(void 0===r)return e.delegate=null,"throw"===n&&t.iterator.return&&(e.method="return",e.arg=void 0,_(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),h;var o=c(r,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,h;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,h):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,h)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function V(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function O(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function S(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:x}}function x(){return{value:void 0,done:!0}}return d.prototype=p,r(g,"constructor",{value:p,configurable:!0}),r(p,"constructor",{value:d,configurable:!0}),d.displayName=u(p,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===d||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,u(t,s,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},A(b.prototype),u(b.prototype,a,(function(){return this})),t.AsyncIterator=b,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new b(l(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},A(g),u(g,s,"Generator"),u(g,i,(function(){return this})),u(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},t.values=S,O.prototype={constructor:O,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(V),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(n,r){return a.type="throw",a.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var s=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,h):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),h},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),V(n),h}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;V(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:S(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),h}},t}function Z(t,e,n,r,o,i,a){try{var s=t[i](a),u=s.value}catch(t){return void n(t)}s.done?e(u):Promise.resolve(u).then(r,o)}function W(t){return function(){var e=this,n=arguments;return new Promise((function(r,o){var i=t.apply(e,n);function a(t){Z(i,r,o,a,s,"next",t)}function s(t){Z(i,r,o,a,s,"throw",t)}a(void 0)}))}}function X(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function J(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==z(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==z(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===z(o)?o:String(o)),r)}var o}function $(t,e,n){return e&&J(t.prototype,e),n&&J(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function tt(){return tt="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=nt(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},tt.apply(this,arguments)}function et(t,e){return et=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},et(t,e)}function nt(t){return nt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},nt(t)}var rt,ot=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&et(t,e)}(o,t);var e,n,r=(e=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=nt(e);if(n){var o=nt(this).constructor;t=Reflect.construct(r,arguments,o)}else t=r.apply(this,arguments);return function(t,e){if(e&&("object"===z(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function o(t){var e;return X(this,o),e=r.call(this,t),speechSynthesis.addEventListener&&speechSynthesis.addEventListener("voiceschanged",(function(){return e.events.trigger("voiceschanged")})),e}return $(o,[{key:"start",value:function(t,e){var n=this;if("mediaSession"in navigator){var r=new Audio(at);r.loop=!0,this.events.on("pause",(function(){return r.pause()})),this.events.on("resume",(function(){return r.play()})),this.events.on("stop",(function(){return r.src=""})),r.play().then((function(){navigator.mediaSession.metadata=new MediaMetadata({title:br.bookTitle,artist:br.options.metadata.filter((function(t){return"Author"==t.label})).map((function(t){return t.value}))[0],artwork:[{src:br.options.thumbnail,type:"image/jpg"}]}),navigator.mediaSession.setActionHandler("play",(function(){r.play(),n.resume()})),navigator.mediaSession.setActionHandler("pause",(function(){r.pause(),n.pause()})),navigator.mediaSession.setActionHandler("previoustrack",(function(){return n.jumpBackward()})),navigator.mediaSession.setActionHandler("nexttrack",(function(){return n.jumpForward()}))}))}return tt(nt(o.prototype),"start",this).call(this,t,e)}},{key:"getVoices",value:function(){var t=speechSynthesis.getVoices();return 1!=t.filter((function(t){return t.default})).length&&t.unshift({voiceURI:"bookreader.SystemDefault",name:"System Default",lang:navigator.language,default:!0,localService:!0}),t}},{key:"createSound",value:function(t){return new it(t.text)}}],[{key:"isSupported",value:function(){return void 0!==window.speechSynthesis&&!/samsungbrowser/i.test(navigator.userAgent)}}]),o}(O),it=function(){function t(e){X(this,t),this.text=e,this.loaded=!1,this.paused=!1,this.started=!1,this.stopped=!1,this.rate=1,this.utterance=null,this.voice=null,this._lastEvents={pause:null,boundary:null,start:null},this._charIndex=0,this._finishResolver=null,this._finishPromise=null}var e,n,r,o,i;return $(t,[{key:"load",value:function(t){var e,n=this;this.loaded=!1,this.started=!1,this.utterance=new SpeechSynthesisUtterance(this.text.slice(this._charIndex)),"bookreader.SystemDefault"!==(null===(e=this.voice)||void 0===e?void 0:e.voiceURI)&&(this.utterance.voice=this.voice),this.voice&&(this.utterance.lang=this.voice.lang),this.utterance.rate=this.rate,-1!=location.toString().indexOf("_debugReadAloud=true")&&(this.utterance.addEventListener("pause",(function(){return console.log("pause")})),this.utterance.addEventListener("resume",(function(){return console.log("resume")})),this.utterance.addEventListener("start",(function(){return console.log("start")})),this.utterance.addEventListener("end",(function(){return console.log("end")})),this.utterance.addEventListener("error",(function(){return console.log("error")})),this.utterance.addEventListener("boundary",(function(){return console.log("boundary")})),this.utterance.addEventListener("mark",(function(){return console.log("mark")})),this.utterance.addEventListener("finish",(function(){return console.log("finish")}))),this.utterance.addEventListener("start",(function(t){return n._lastEvents.start=t})),this.utterance.addEventListener("boundary",(function(t){return n._lastEvents.boundary=t})),this.utterance.addEventListener("pause",(function(t){return n._lastEvents.pause=t})),this.utterance.addEventListener("start",(function(){n.started=!0,n.stopped=!1,n.paused=!1})),this.utterance.addEventListener("pause",(function(){return n.paused=!0})),this.utterance.addEventListener("resume",(function(){return n.paused=!1})),this.utterance.addEventListener("end",(function(t){n.paused||n.stopped||n.utterance.dispatchEvent(new CustomEvent("finish",t))})),this.loaded=!0,t&&t()}},{key:"reload",value:(i=W(K().mark((function t(){var e,n;return K().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=this.paused,(n=this._lastEvents.boundary||this._lastEvents.pause)&&(this._charIndex=this.text.indexOf(n.target.text)+n.charIndex),t.next=5,this.stop();case 5:this.load(),e||this.play();case 7:case"end":return t.stop()}}),t,this)}))),function(){return i.apply(this,arguments)})},{key:"play",value:function(){var t=this;this._finishPromise=this._finishPromise||new Promise((function(e){return t._finishResolver=e})),this.utterance.addEventListener("finish",this._finishResolver),speechSynthesis.cancel(),speechSynthesis.resume(),speechSynthesis.speak(this.utterance);var e=this.utterance.voice&&this.utterance.voice.localService;return N()&&!e&&this._chromePausingBugFix(),this._finishPromise}},{key:"stop",value:function(){var t=Promise.resolve();return this.stopped||(t=Promise.race([(0,S.promisifyEvent)(this.utterance,"end"),(0,S.promisifyEvent)(this.utterance,"error")])),this.stopped=!0,speechSynthesis.cancel(),t}},{key:"finish",value:(o=W(K().mark((function t(){return K().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.stop();case 2:this.utterance.dispatchEvent(new Event("finish"));case 3:case"end":return t.stop()}}),t,this)}))),function(){return o.apply(this,arguments)})},{key:"pause",value:(r=W(K().mark((function t(){var e,n,r;return K().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this.paused){t.next=2;break}return t.abrupt("return");case 2:if(e=(0,S.promisifyEvent)(this.utterance,"pause"),speechSynthesis.pause(),n=U()&&Y(),!N()&&!n){t.next=15;break}return r=(0,S.sleep)(100).then((function(){return"timeout"})),t.next=10,Promise.race([e,r]);case 10:if("timeout"==t.sent){t.next=13;break}return t.abrupt("return");case 13:this.utterance.dispatchEvent(new CustomEvent("pause",this._lastEvents.start)),n&&this.stop();case 15:case"end":return t.stop()}}),t,this)}))),function(){return r.apply(this,arguments)})},{key:"resume",value:(n=W(K().mark((function t(){var e,n,r;return K().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.started){t.next=3;break}return this.play(),t.abrupt("return");case 3:if(this.paused){t.next=5;break}return t.abrupt("return");case 5:if(e=N()&&Y()||U()&&Y(),n=N()||e,r=(0,S.promisifyEvent)(this.utterance,"resume"),speechSynthesis.resume(),!n){t.next=20;break}return t.next=12,Promise.race([r,(0,S.sleep)(100).then((function(){return"timeout"}))]);case 12:if("timeout"==t.sent){t.next=15;break}return t.abrupt("return");case 15:if(this.utterance.dispatchEvent(new CustomEvent("resume",{})),!e){t.next=20;break}return t.next=19,this.reload();case 19:this.play();case 20:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"setPlaybackRate",value:function(t){this.rate=t,this.reload()}},{key:"setVoice",value:function(t){this.voice=t,this.reload()}},{key:"_chromePausingBugFix",value:(e=W(K().mark((function t(){var e,n,r,o;return K().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=(0,S.sleep)(14e3).then((function(){return"timeout"})),n=(0,S.promisifyEvent)(this.utterance,"pause").then((function(){return"paused"})),r=(0,S.promisifyEvent)(this.utterance,"end").then((function(){return"ended"})),t.next=5,Promise.race([e,n,r]);case 5:o=t.sent,-1!=location.toString().indexOf("_debugReadAloud=true")&&console.log("CHROME-PAUSE-HACK: ".concat(o)),t.t0=o,t.next="ended"===t.t0?10:"paused"===t.t0?11:"timeout"===t.t0?15:21;break;case 10:return t.abrupt("break",21);case 11:return t.next=13,Promise.race([(0,S.promisifyEvent)(this.utterance,"resume"),(0,S.sleep)(14e3).then((function(){return"timeout"}))]);case 13:return"timeout"==o?this.reload():this._chromePausingBugFix(),t.abrupt("break",21);case 15:return speechSynthesis.pause(),t.next=18,(0,S.sleep)(25);case 18:return speechSynthesis.resume(),this._chromePausingBugFix(),t.abrupt("break",21);case 21:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})}]),t}(),at="data:audio/mp3;base64,/+MYxAAMEAISSAhElhIpJYzz1vz9mUdlHvJwTP/n3FJesPxB9/8mp0oGaz9+7+T//8oCDhJqOMqLh4o4uhUAUUDaf//3r+///+MYxAoKy2ImKAgEqbfr/t///27/+n3s32/////+b5qMsq7vnXCKh2By3ZcIqyrUYbbRH0fp+ljtf+n2Uo72PHX/03f0df///+MYxBkKUAYmQAhEAL+2l44oKFjZMwJAOJnhguMqokFAqBKl/5f1/+f+3/v////9GT//r+//v+//////b1VvucaRChqnMqsY/+MYxCoLo2IiSAgEpRrgIRVq//p////25nlpVFbQ9kuXtrpt+n//3ZUZNKHVTHdJk3Q6h961DAU8loFlsfTnTZYLLQ1xiIYC/+MYxDYLa2YYAACNFAKKv5swEnqSccBoi//xVP9R/q/370r02////7VpaiWWLrDaF//X8+Rf/6ys2irmURCrI/Lr7///+m1t/+MYxEMKqAI2SAhElh7vNPmHrKdmMPFMimBI5xYQEiIRxh1gk0pKvfo7nezMyH6P67uKW+z/7NusoS/4//STUtCUiwASccAQ/+MYxFMKs2IcIABFEFRhEOUCgACs//l3/6df///+qZf6V9X2t69f/p////+v97UOY7UyyIxZWPa1inCgyCDq//pXpSia2v23/+MYxGMK6AYqSABEAl70RfX2+nu6///v+rfdWCLKMhUBmZhIDqt23LQGBjyNGEjBCnI5JGjRWkU2a8b29z/+n6/9SnN7LUfo/+MYxHILg2IiQAgEUPpX9//96jShqxUCtNiIeCAcmxc3/tn18pTBRmaNzgUvIqropQvPf/Fy99+z9/8/bx43Xn95kr6QHFQp/+MYxH8L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GgSbCS9H7lzLlV58mRTv//3+W8WT//f/7zz5//l/9ki/6////WXFkRjlygC4US7JYQwCIg1/+MYxPMPk1YaQAjNof+3GgQj8XKu+pz/PNeX2//81+BMxLX//nz8/5vXovznf9GZ8kZy//J/t1dPqqsZWQIqK2lF4LBUIAJn/+MYxO8Pq2YdoAlNopA5QImv5P/i4cqmi/y///9DP/mplLdWL/8rZS/qX////m+pfVpWM5jBgJysYxQpTGMYUcygIwYU6qqq/+MYxOsPE14aQAiNoYAwNmLCuoX4szULsxZmoXZiwr/FhX//gIWFSJmtiVCwr3f7P/ioqLCwsLC4qK1MQU1FMy45OS4zVVVV/+MYxOkN614mSAhE31VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV/+MYxOwOwz4hqAiHo1VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV/+MYxOwOG1oOIAgEqFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV/+MYxO4L6AVtkAhEAFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV",st="Read this book aloud",ut=n(9860),lt=n(5311),ct=n(5311);function ht(t){return ht="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ht(t)}function ft(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,s=[],u=!0,l=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(s.push(r.value),s.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(t,e)||function(t,e){if(t){if("string"==typeof t)return dt(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?dt(t,e):void 0}}(t,e)||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 dt(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function pt(){pt=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,n){return t[e]=n}}function l(t,e,n,o){var i=e&&e.prototype instanceof f?e:f,a=Object.create(i.prototype),s=new O(o||[]);return r(a,"_invoke",{value:w(t,n,s)}),a}function c(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=l;var h={};function f(){}function d(){}function p(){}var y={};u(y,i,(function(){return this}));var v=Object.getPrototypeOf,m=v&&v(v(S([])));m&&m!==e&&n.call(m,i)&&(y=m);var g=p.prototype=f.prototype=Object.create(y);function A(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function b(t,e){function o(r,i,a,s){var u=c(t[r],t,i);if("throw"!==u.type){var l=u.arg,h=l.value;return h&&"object"==ht(h)&&n.call(h,"__await")?e.resolve(h.__await).then((function(t){o("next",t,a,s)}),(function(t){o("throw",t,a,s)})):e.resolve(h).then((function(t){l.value=t,a(l)}),(function(t){return o("throw",t,a,s)}))}s(u.arg)}var i;r(this,"_invoke",{value:function(t,n){function r(){return new e((function(e,r){o(t,n,e,r)}))}return i=i?i.then(r,r):r()}})}function w(t,e,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return{value:void 0,done:!0}}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var s=_(a,n);if(s){if(s===h)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var u=c(t,e,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===h)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}function _(t,e){var n=e.method,r=t.iterator[n];if(void 0===r)return e.delegate=null,"throw"===n&&t.iterator.return&&(e.method="return",e.arg=void 0,_(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),h;var o=c(r,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,h;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,h):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,h)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function V(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function O(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function S(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:x}}function x(){return{value:void 0,done:!0}}return d.prototype=p,r(g,"constructor",{value:p,configurable:!0}),r(p,"constructor",{value:d,configurable:!0}),d.displayName=u(p,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===d||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,u(t,s,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},A(b.prototype),u(b.prototype,a,(function(){return this})),t.AsyncIterator=b,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new b(l(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},A(g),u(g,s,"Generator"),u(g,i,(function(){return this})),u(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},t.values=S,O.prototype={constructor:O,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(V),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(n,r){return a.type="throw",a.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var s=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,h):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),h},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),V(n),h}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;V(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:S(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),h}},t}function yt(t,e,n,r,o,i,a){try{var s=t[i](a),u=s.value}catch(t){return void n(t)}s.done?e(u):Promise.resolve(u).then(r,o)}function vt(t){return function(){var e=this,n=arguments;return new Promise((function(r,o){var i=t.apply(e,n);function a(t){yt(i,r,o,a,s,"next",t)}function s(t){yt(i,r,o,a,s,"throw",t)}a(void 0)}))}}lt.extend(BookReader.defaultOptions,{server:"ia600609.us.archive.org",bookPath:"",enableTtsPlugin:!0}),BookReader.prototype.setup=(rt=BookReader.prototype.setup,function(t){if(rt.call(this,t),this.options.enableTtsPlugin){this._ttsBoxesByIndex={};var e=ot.isSupported()?ot:C.isSupported()?C:null;if(/_forceTTSEngine=(festival|web)/.test(location.toString())){var n=location.toString().match(/_forceTTSEngine=(festival|web)/)[1];e={festival:C,web:ot}[n]}e&&(this.ttsEngine=new e({server:t.server,bookPath:t.bookPath,bookLanguage:(r=t.bookLanguage,r?G(r=r.toLowerCase(),["ISO 639-1"])||G(r,["ISO 639-2/B"])||G(r,["ISO 639-2/T","Endonym","Name"]):null),onLoadingStart:this.showProgressPopup.bind(this,"Loading audio..."),onLoadingComplete:this.removeProgressPopup.bind(this),onDone:this.ttsStop.bind(this),beforeChunkPlay:this.ttsBeforeChunkPlay.bind(this),afterChunkPlay:this.ttsSendChunkFinishedAnalyticsEvent.bind(this)}))}var r}),BookReader.prototype.init=function(t){return function(){var e=this;this.options.enableTtsPlugin&&this.bind(BookReader.eventNames.PostInit,(function(){e.$(".BRicon.read").click((function(){return e.ttsToggle(),!1})),e.ttsEngine&&(e.ttsEngine.init(),/[?&]_autoReadAloud=show/.test(location.toString())&&e.ttsStart(!1))})),t.call(this)}}(BookReader.prototype.init),BookReader.prototype._createPageContainer=function(t){return function(e){var n=t.call(this,e);if(this.options.enableTtsPlugin&&n.page&&e in this._ttsBoxesByIndex){var r=n.page.index;(0,ut.Tm)("ttsHiliteLayer",this._ttsBoxesByIndex[r],n.page,n.$container[0])}return n}}(BookReader.prototype._createPageContainer),BookReader.prototype.buildMobileDrawerElement=function(t){return function(){var e=t.call(this);return this.options.enableTtsPlugin&&this.ttsEngine&&e.find(".BRmobileMenu__moreInfoRow").after(ct('\n <li>\n <span>\n <span class="DrawerIconWrapper"><img class="DrawerIcon" src="'.concat(this.imagesBaseURL,'icon_speaker_open.svg" alt="info-speaker"/></span>\n Read Aloud\n </span>\n <div>\n <span class="larger">Press to toggle read aloud</span>\n <br/>\n <button class="BRicon read"></button>\n </div>\n </li>'))),e}}(BookReader.prototype.buildMobileDrawerElement),BookReader.prototype.initNavbar=function(t){return function(){var e=this,n=t.call(this);if(this.options.enableTtsPlugin&&this.ttsEngine){this.refs.$BRReadAloudToolbar=ct('\n <ul class="read-aloud">\n <li>\n <select class="playback-speed" name="playback-speed" title="'.concat("Playback speed",'">\n <option value="0.25">0.25x</option>\n <option value="0.5">0.5x</option>\n <option value="0.75">0.75x</option>\n <option value="1.0" selected>1.0x</option>\n <option value="1.25">1.25x</option>\n <option value="1.5">1.5x</option>\n <option value="1.75">1.75x</option>\n <option value="2">2x</option>\n </select>\n </li>\n <li>\n <button type="button" name="review" title="').concat("Review 10 seconds",'">\n <div class="icon icon-review"></div>\n </button>\n </li>\n <li>\n <button type="button" name="play" title="').concat("Play",'">\n <div class="icon icon-play"></div>\n <div class="icon icon-pause"></div>\n </button>\n </li>\n <li>\n <button type="button" name="advance" title="').concat("Advance 10 seconds",'">\n <div class="icon icon-advance"></div>\n </button>\n </li>\n <li>\n <select class="playback-voices" name="playback-voice" style="display: none" title="Change read aloud voices">\n </select>\n </li>\n </ul>\n ')),n.find(".BRcontrols").prepend(this.refs.$BRReadAloudToolbar);var r=function(t){return t.map((function(t){return'<option value="'.concat(t.voiceURI,'">').concat(t.lang," - ").concat(t.name,"</option>")})).join("")},o=function(t,e){return"".concat(t.lang," - ").concat(t.name).localeCompare("".concat(e.lang," - ").concat(e.name))},i=function(t){t.empty();var n=e.ttsEngine.opts.bookLanguage,i=e.ttsEngine.getVoices().filter((function(t){return t.lang.startsWith(n)})).sort(o),a=e.ttsEngine.getVoices().filter((function(t){return!t.lang.startsWith(n)})).sort(o);e.ttsEngine.getVoices().length>1?(t.append(ct('<optgroup label="Book Language ('.concat(n,')"> ').concat(r(i)," </optgroup>"))),t.append(ct('<optgroup label="Other Languages"> '.concat(r(a)," </optgroup>"))),t.val(e.ttsEngine.voice.voiceURI),t.show()):t.hide()},a=this.refs.$BRReadAloudToolbar.find("[name=playback-voice]");i(a),a.on("change",(function(t){return e.ttsEngine.setVoice(a.val())})),this.ttsEngine.events.on("pause resume start",(function(){return e.ttsUpdateState()})),this.ttsEngine.events.on("voiceschanged",(function(){return i(a)})),this.refs.$BRReadAloudToolbar.find("[name=play]").on("click",this.ttsPlayPause.bind(this)),this.refs.$BRReadAloudToolbar.find("[name=advance]").on("click",this.ttsJumpForward.bind(this)),this.refs.$BRReadAloudToolbar.find("[name=review]").on("click",this.ttsJumpBackward.bind(this));var s=this.refs.$BRReadAloudToolbar.find('select[name="playback-speed"]');s.on("change",(function(t){return e.ttsEngine.setPlaybackRate(parseFloat(s.val()))})),ct('<li>\n <button class="BRicon read js-tooltip" title="'.concat(st,'">\n <div class="icon icon-read-aloud"></div>\n <span class="tooltip">').concat(st,"</span>\n </button>\n </li>")).insertBefore(n.find(".BRcontrols .BRicon.zoom_out").closest("li"))}return n}}(BookReader.prototype.initNavbar),BookReader.prototype.ttsToggle=function(){this.autoStop&&this.autoStop(),this.ttsEngine.playing?this.ttsStop():this.ttsStart()},BookReader.prototype.ttsStart=function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.constModeThumb==this.mode&&this.switchMode(this.constMode1up),this.refs.$BRReadAloudToolbar.addClass("visible"),this.$(".BRicon.read").addClass("unread active"),this.ttsSendAnalyticsEvent("Start"),t&&this.ttsEngine.start(this.currentIndex(),this.book.getNumLeafs())},BookReader.prototype.ttsJumpForward=function(){this.ttsEngine.paused&&this.ttsEngine.resume(),this.ttsEngine.jumpForward()},BookReader.prototype.ttsJumpBackward=function(){this.ttsEngine.paused&&this.ttsEngine.resume(),this.ttsEngine.jumpBackward()},BookReader.prototype.ttsUpdateState=function(){var t=!(this.ttsEngine.paused||!this.ttsEngine.playing);this.$(".read-aloud [name=play]").toggleClass("playing",t)},BookReader.prototype.ttsPlayPause=function(){this.ttsEngine.playing?(this.ttsEngine.togglePlayPause(),this.ttsUpdateState(this.ttsEngine.paused)):this.ttsToggle()},BookReader.prototype.ttsStop=function(){this.refs.$BRReadAloudToolbar.removeClass("visible"),this.$(".BRicon.read").removeClass("unread active"),this.ttsSendAnalyticsEvent("Stop"),this.ttsEngine.stop(),this.ttsRemoveHilites(),this.removeProgressPopup()},BookReader.prototype.ttsBeforeChunkPlay=function(){var t=vt(pt().mark((function t(e){return pt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.ttsMaybeFlipToIndex(e.leafIndex);case 2:this.ttsHighlightChunk(e),this.ttsScrollToChunk(e);case 4:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),BookReader.prototype.ttsSendChunkFinishedAnalyticsEvent=function(t){var e;this.ttsSendAnalyticsEvent("ChunkFinished-Words",(e=t.text.match(/\S+/g))?e.length:0)},BookReader.prototype.ttsMaybeFlipToIndex=function(){var t=vt(pt().mark((function t(e){return pt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.constMode2up==this.mode){t.next=4;break}this.jumpToIndex(e),t.next=6;break;case 4:return t.next=6,this._modes.mode2Up.mode2UpLit.jumpToIndex(e);case 6:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),BookReader.prototype.ttsHighlightChunk=function(t){var e,n,r,o=this,i=t.leafIndex;this.ttsRemoveHilites(),this._ttsBoxesByIndex=(e={},n=i,r=t.lineRects.map((function(t){var e=ft(t,4),n=e[0],r=e[1];return{l:n,r:e[2],b:r,t:e[3]}})),(n=function(t){var e=function(t,e){if("object"!==ht(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==ht(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"===ht(e)?e:String(e)}(n))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e);for(var a=function(){var t=ft(u[s],2),e=t[0],n=t[1],r=parseFloat(e),i=o.book.getPage(r);o.getActivePageContainerElementsForIndex(r).forEach((function(t){return(0,ut.Tm)("ttsHiliteLayer",n,i,t)}))},s=0,u=Object.entries(this._ttsBoxesByIndex);s<u.length;s++)a()},BookReader.prototype.ttsScrollToChunk=function(t){var e,n;this.constModeThumb!=this.mode&&(null===(e=ct(".pagediv".concat(t.leafIndex," .ttsHiliteLayer rect")).last())||void 0===e||null===(n=e[0])||void 0===n||n.scrollIntoView({block:this.constMode1up==this.mode||this.isFullscreenActive?"center":"nearest",inline:"center",behavior:"smooth"}))},BookReader.prototype.ttsRemoveHilites=function(){ct(this.getActivePageContainerElements()).find(".ttsHiliteLayer").remove(),this._ttsBoxesByIndex={}},BookReader.prototype.ttsSendAnalyticsEvent=function(t,e){if(this.archiveAnalyticsSendEvent){var n={},r=this.ttsEngine.opts.bookLanguage;r&&(n.mediaLanguage=r),this.archiveAnalyticsSendEvent("BRReadAloud",t,e,n)}}},2814:function(t,e,n){var r=n(7854),o=n(7293),i=n(1702),a=n(1340),s=n(3111).trim,u=n(1361),l=i("".charAt),c=r.parseFloat,h=r.Symbol,f=h&&h.iterator,d=1/c(u+"-0")!=-1/0||f&&!o((function(){c(Object(f))}));t.exports=d?function(t){var e=s(a(t)),n=c(e);return 0===n&&"-"==l(e,0)?-0:n}:c},9720:function(t,e,n){var r=n(2109),o=n(4699).entries;r({target:"Object",stat:!0},{entries:function(t){return o(t)}})},4678:function(t,e,n){var r=n(2109),o=n(2814);r({global:!0,forced:parseFloat!=o},{parseFloat:o})},1030:function(t,e){"use strict";e.Z=void 0,e.Z=[["Serbian","српски језик","sr","srp","srp"],["Romanian, Moldavian, Moldovan","Română","ro","ron","rum"],["Sichuan Yi, Nuosu","ꆈꌠ꒿ Nuosuhxop","ii","iii","iii"],["Tahitian","Reo Tahiti","ty","tah","tah"],["Tagalog","Wikang Tagalog","tl","tgl","tgl"],["Yiddish","ייִדיש","yi","yid","yid"],["Akan","Akan","ak","aka","aka"],["Malay","Bahasa Melayu, بهاس ملايو","ms","msa","may"],["Arabic","العربية","ar","ara","ara"],["Norwegian","Norsk","no","nor","nor"],["Ojibwa","ᐊᓂᔑᓈᐯᒧᐎᓐ","oj","oji","oji"],["Fulah","Fulfulde, Pulaar, Pular","ff","ful","ful"],["Persian","فارسی","fa","fas","per"],["Albanian","Shqip","sq","sqi","alb"],["Aymara","aymar aru","ay","aym","aym"],["Azerbaijani","azərbaycan dili","az","aze","aze"],["Chinese","中文 (Zhōngwén), 汉语, 漢語","zh","zho","chi"],["Cree","ᓀᐦᐃᔭᐍᐏᐣ","cr","cre","cre"],["Estonian","eesti, eesti keel","et","est","est"],["Guaraní","Avañe'ẽ","gn","grn","grn"],["Inupiaq","Iñupiaq, Iñupiatun","ik","ipk","ipk"],["Inuktitut","ᐃᓄᒃᑎᑐᑦ","iu","iku","iku"],["Kanuri","Kanuri","kr","kau","kau"],["Komi","коми кыв","kv","kom","kom"],["Kongo","Kikongo","kg","kon","kon"],["Kurdish","Kurdî, کوردی","ku","kur","kur"],["Latvian","latviešu valoda","lv","lav","lav"],["Malagasy","fiteny malagasy","mg","mlg","mlg"],["Mongolian","Монгол хэл","mn","mon","mon"],["Oromo","Afaan Oromoo","om","orm","orm"],["Pashto, Pushto","پښتو","ps","pus","pus"],["Quechua","Runa Simi, Kichwa","qu","que","que"],["Sardinian","sardu","sc","srd","srd"],["Swahili","Kiswahili","sw","swa","swa"],["Uzbek","Oʻzbek, Ўзбек, أۇزبېك","uz","uzb","uzb"],["Zhuang, Chuang","Saɯ cueŋƅ, Saw cuengh","za","zha","zha"],["Bislama","Bislama","bi","bis","bis"],["Norwegian Bokmål","Norsk Bokmål","nb","nob","nob"],["Norwegian Nynorsk","Norsk Nynorsk","nn","nno","nno"],["Indonesian","Bahasa Indonesia","id","ind","ind"],["Twi","Twi","tw","twi","twi"],["Esperanto","Esperanto","eo","epo","epo"],["Interlingua","Interlingua","ia","ina","ina"],["Interlingue","Originally called Occidental; then Interlingue after WWII","ie","ile","ile"],["Ido","Ido","io","ido","ido"],["Volapük","Volapük","vo","vol","vol"],["Bihari languages","भोजपुरी","bh","bih","bih"],["Hebrew (modern)","עברית","he","heb","heb"],["Sanskrit","संस्कृतम्","sa","san","san"],["Church Slavic, Church Slavonic, Old Church Slavonic, Old Slavonic, Old Bulgarian","ѩзыкъ словѣньскъ","cu","chu","chu"],["Pali","पाऴि","pi","pli","pli"],["Avestan","avesta","ae","ave","ave"],["Latin","latine, lingua latina","la","lat","lat"],["Armenian","Հայերեն","hy","hye","arm"],["Swati","SiSwati","ss","ssw","ssw"],["Tibetan","བོད་ཡིག","bo","bod","tib"],["South Ndebele","isiNdebele","nr","nbl","nbl"],["Slovene","Slovenski Jezik, Slovenščina","sl","slv","slv"],["Oriya","ଓଡ଼ିଆ","or","ori","ori"],["North Ndebele","isiNdebele","nd","nde","nde"],["Nauru","Dorerin Naoero","na","nau","nau"],["Maori","te reo Māori","mi","mri","mao"],["Marathi","मराठी","mr","mar","mar"],["Luba-Katanga","Kiluba","lu","lub","lub"],["Rundi","Ikirundi","rn","run","run"],["Central Khmer","ខ្មែរ, ខេមរភាសា, ភាសាខ្មែរ","km","khm","khm"],["Western Frisian","Frysk","fy","fry","fry"],["Bengali","বাংলা","bn","ben","ben"],["Avaric","авар мацӀ, магӀарул мацӀ","av","ava","ava"],["Abkhazian","аҧсуа бызшәа, аҧсшәа","ab","abk","abk"],["Afar","Afaraf","aa","aar","aar"],["Afrikaans","Afrikaans","af","afr","afr"],["Amharic","አማርኛ","am","amh","amh"],["Aragonese","aragonés","an","arg","arg"],["Assamese","অসমীয়া","as","asm","asm"],["Bambara","bamanankan","bm","bam","bam"],["Bashkir","башҡорт теле","ba","bak","bak"],["Basque","euskara, euskera","eu","eus","baq"],["Belarusian","беларуская мова","be","bel","bel"],["Bosnian","bosanski jezik","bs","bos","bos"],["Breton","brezhoneg","br","bre","bre"],["Bulgarian","български език","bg","bul","bul"],["Burmese","ဗမာစာ","my","mya","bur"],["Catalan, Valencian","català, valencià","ca","cat","cat"],["Chamorro","Chamoru","ch","cha","cha"],["Chechen","нохчийн мотт","ce","che","che"],["Chichewa, Chewa, Nyanja","chiCheŵa, chinyanja","ny","nya","nya"],["Chuvash","чӑваш чӗлхи","cv","chv","chv"],["Cornish","Kernewek","kw","cor","cor"],["Corsican","corsu, lingua corsa","co","cos","cos"],["Croatian","hrvatski jezik","hr","hrv","hrv"],["Czech","čeština, český jazyk","cs","ces","cze"],["Danish","dansk","da","dan","dan"],["Divehi, Dhivehi, Maldivian","ދިވެހި","dv","div","div"],["Dutch, Flemish","Nederlands, Vlaams","nl","nld","dut"],["Dzongkha","རྫོང་ཁ","dz","dzo","dzo"],["English","English","en","eng","eng"],["Ewe","Eʋegbe","ee","ewe","ewe"],["Faroese","føroyskt","fo","fao","fao"],["Fijian","vosa Vakaviti","fj","fij","fij"],["Finnish","suomi, suomen kieli","fi","fin","fin"],["French","français, langue française","fr","fra","fre"],["Galician","Galego","gl","glg","glg"],["Georgian","ქართული","ka","kat","geo"],["German","Deutsch","de","deu","ger"],["Greek (modern)","ελληνικά","el","ell","gre"],["Gujarati","ગુજરાતી","gu","guj","guj"],["Haitian, Haitian Creole","Kreyòl ayisyen","ht","hat","hat"],["Hausa","(Hausa) هَوُسَ","ha","hau","hau"],["Herero","Otjiherero","hz","her","her"],["Hindi","हिन्दी, हिंदी","hi","hin","hin"],["Hiri Motu","Hiri Motu","ho","hmo","hmo"],["Hungarian","magyar","hu","hun","hun"],["Irish","Gaeilge","ga","gle","gle"],["Igbo","Asụsụ Igbo","ig","ibo","ibo"],["Icelandic","Íslenska","is","isl","ice"],["Italian","Italiano","it","ita","ita"],["Japanese","日本語 (にほんご)","ja","jpn","jpn"],["Javanese","ꦧꦱꦗꦮ, Basa Jawa","jv","jav","jav"],["Kalaallisut, Greenlandic","kalaallisut, kalaallit oqaasii","kl","kal","kal"],["Kannada","ಕನ್ನಡ","kn","kan","kan"],["Kashmiri","कश्मीरी, كشميري","ks","kas","kas"],["Kazakh","қазақ тілі","kk","kaz","kaz"],["Kikuyu, Gikuyu","Gĩkũyũ","ki","kik","kik"],["Kinyarwanda","Ikinyarwanda","rw","kin","kin"],["Kirghiz, Kyrgyz","Кыргызча, Кыргыз тили","ky","kir","kir"],["Korean","한국어","ko","kor","kor"],["Kuanyama, Kwanyama","Kuanyama","kj","kua","kua"],["Luxembourgish, Letzeburgesch","Lëtzebuergesch","lb","ltz","ltz"],["Ganda","Luganda","lg","lug","lug"],["Limburgan, Limburger, Limburgish","Limburgs","li","lim","lim"],["Lingala","Lingála","ln","lin","lin"],["Lao","ພາສາລາວ","lo","lao","lao"],["Lithuanian","lietuvių kalba","lt","lit","lit"],["Manx","Gaelg, Gailck","gv","glv","glv"],["Macedonian","македонски јазик","mk","mkd","mac"],["Malayalam","മലയാളം","ml","mal","mal"],["Maltese","Malti","mt","mlt","mlt"],["Marshallese","Kajin M̧ajeļ","mh","mah","mah"],["Navajo, Navaho","Diné bizaad","nv","nav","nav"],["Nepali","नेपाली","ne","nep","nep"],["Ndonga","Owambo","ng","ndo","ndo"],["Occitan","occitan, lenga d'òc","oc","oci","oci"],["Ossetian, Ossetic","ирон æвзаг","os","oss","oss"],["Panjabi, Punjabi","ਪੰਜਾਬੀ","pa","pan","pan"],["Polish","język polski, polszczyzna","pl","pol","pol"],["Portuguese","Português","pt","por","por"],["Romansh","Rumantsch Grischun","rm","roh","roh"],["Russian","русский","ru","rus","rus"],["Sindhi","सिन्धी, سنڌي، سندھی","sd","snd","snd"],["Northern Sami","Davvisámegiella","se","sme","sme"],["Samoan","gagana fa'a Samoa","sm","smo","smo"],["Sango","yângâ tî sängö","sg","sag","sag"],["Gaelic, Scottish Gaelic","Gàidhlig","gd","gla","gla"],["Shona","chiShona","sn","sna","sna"],["Sinhala, Sinhalese","සිංහල","si","sin","sin"],["Slovak","Slovenčina, Slovenský Jazyk","sk","slk","slo"],["Somali","Soomaaliga, af Soomaali","so","som","som"],["Southern Sotho","Sesotho","st","sot","sot"],["Spanish, Castilian","Español","es","spa","spa"],["Sundanese","Basa Sunda","su","sun","sun"],["Swedish","Svenska","sv","swe","swe"],["Tamil","தமிழ்","ta","tam","tam"],["Telugu","తెలుగు","te","tel","tel"],["Tajik","тоҷикӣ, toçikī, تاجیکی","tg","tgk","tgk"],["Thai","ไทย","th","tha","tha"],["Tigrinya","ትግርኛ","ti","tir","tir"],["Turkmen","Türkmen, Түркмен","tk","tuk","tuk"],["Tswana","Setswana","tn","tsn","tsn"],["Tongan (Tonga Islands)","Faka Tonga","to","ton","ton"],["Turkish","Türkçe","tr","tur","tur"],["Tsonga","Xitsonga","ts","tso","tso"],["Tatar","татар теле, tatar tele","tt","tat","tat"],["Uighur, Uyghur","ئۇيغۇرچە, Uyghurche","ug","uig","uig"],["Ukrainian","Українська","uk","ukr","ukr"],["Urdu","اردو","ur","urd","urd"],["Venda","Tshivenḓa","ve","ven","ven"],["Vietnamese","Tiếng Việt","vi","vie","vie"],["Walloon","Walon","wa","wln","wln"],["Welsh","Cymraeg","cy","cym","wel"],["Wolof","Wollof","wo","wol","wol"],["Xhosa","isiXhosa","xh","xho","xho"],["Yoruba","Yorùbá","yo","yor","yor"],["Zulu","isiZulu","zu","zul","zul"]]},4371:function(t,e,n){var r,o;r=[n(5311)],void 0===(o=function(t){return function(t){"use strict";function e(t){void 0===t&&(t=window.navigator.userAgent),t=t.toLowerCase();var e=/(edge)\/([\w.]+)/.exec(t)||/(opr)[\/]([\w.]+)/.exec(t)||/(chrome)[ \/]([\w.]+)/.exec(t)||/(iemobile)[\/]([\w.]+)/.exec(t)||/(version)(applewebkit)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(t)||/(webkit)[ \/]([\w.]+).*(version)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(t)||/(webkit)[ \/]([\w.]+)/.exec(t)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(t)||/(msie) ([\w.]+)/.exec(t)||t.indexOf("trident")>=0&&/(rv)(?::| )([\w.]+)/.exec(t)||t.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(t)||[],n=/(ipad)/.exec(t)||/(ipod)/.exec(t)||/(windows phone)/.exec(t)||/(iphone)/.exec(t)||/(kindle)/.exec(t)||/(silk)/.exec(t)||/(android)/.exec(t)||/(win)/.exec(t)||/(mac)/.exec(t)||/(linux)/.exec(t)||/(cros)/.exec(t)||/(playbook)/.exec(t)||/(bb)/.exec(t)||/(blackberry)/.exec(t)||[],r={},o={browser:e[5]||e[3]||e[1]||"",version:e[2]||e[4]||"0",versionNumber:e[4]||e[2]||"0",platform:n[0]||""};if(o.browser&&(r[o.browser]=!0,r.version=o.version,r.versionNumber=parseInt(o.versionNumber,10)),o.platform&&(r[o.platform]=!0),(r.android||r.bb||r.blackberry||r.ipad||r.iphone||r.ipod||r.kindle||r.playbook||r.silk||r["windows phone"])&&(r.mobile=!0),(r.cros||r.mac||r.linux||r.win)&&(r.desktop=!0),(r.chrome||r.opr||r.safari)&&(r.webkit=!0),r.rv||r.iemobile){var i="msie";o.browser=i,r[i]=!0}if(r.edge){delete r.edge;var a="msedge";o.browser=a,r[a]=!0}if(r.safari&&r.blackberry){var s="blackberry";o.browser=s,r[s]=!0}if(r.safari&&r.playbook){var u="playbook";o.browser=u,r[u]=!0}if(r.bb){var l="blackberry";o.browser=l,r[l]=!0}if(r.opr){var c="opera";o.browser=c,r[c]=!0}if(r.safari&&r.android){var h="android";o.browser=h,r[h]=!0}if(r.safari&&r.kindle){var f="kindle";o.browser=f,r[f]=!0}if(r.safari&&r.silk){var d="silk";o.browser=d,r[d]=!0}return r.name=o.browser,r.platform=o.platform,r}return window.jQBrowser=e(window.navigator.userAgent),window.jQBrowser.uaMatch=e,t&&(t.browser=window.jQBrowser),window.jQBrowser}(t)}.apply(e,r))||(t.exports=o)},5529:function(t,e,n){var r;t=n.nmd(t),function(o,i){"use strict";if(!o||!o.document)throw new Error("SoundManager requires a browser with window and document objects.");var a=null;function s(t,e){this.setupOptions={url:t||null,flashVersion:8,debugMode:!0,debugFlash:!1,useConsole:!0,consoleOnly:!0,waitForWindowLoad:!1,bgColor:"#ffffff",useHighPerformance:!1,flashPollingInterval:null,html5PollingInterval:null,flashLoadTimeout:1e3,wmode:null,allowScriptAccess:"always",useFlashBlock:!1,useHTML5Audio:!0,forceUseGlobalHTML5Audio:!1,ignoreMobileRestrictions:!1,html5Test:/^(probably|maybe)$/i,preferFlash:!1,noSWFCache:!1,idPrefix:"sound"},this.defaultOptions={autoLoad:!1,autoPlay:!1,from:null,loops:1,onid3:null,onerror:null,onload:null,whileloading:null,onplay:null,onpause:null,onresume:null,whileplaying:null,onposition:null,onstop:null,onfinish:null,multiShot:!0,multiShotEvents:!1,position:null,pan:0,playbackRate:1,stream:!0,to:null,type:null,usePolicyFile:!1,volume:100},this.flash9Options={onfailure:null,isMovieStar:null,usePeakData:!1,useWaveformData:!1,useEQData:!1,onbufferchange:null,ondataerror:null},this.movieStarOptions={bufferTime:3,serverURL:null,onconnect:null,duration:null},this.audioFormats={mp3:{type:['audio/mpeg; codecs="mp3"',"audio/mpeg","audio/mp3","audio/MPA","audio/mpa-robust"],required:!0},mp4:{related:["aac","m4a","m4b"],type:['audio/mp4; codecs="mp4a.40.2"',"audio/aac","audio/x-m4a","audio/MP4A-LATM","audio/mpeg4-generic"],required:!1},ogg:{type:["audio/ogg; codecs=vorbis"],required:!1},opus:{type:["audio/ogg; codecs=opus","audio/opus"],required:!1},wav:{type:['audio/wav; codecs="1"',"audio/wav","audio/wave","audio/x-wav"],required:!1},flac:{type:["audio/flac"],required:!1}},this.movieID="sm2-container",this.id=e||"sm2movie",this.debugID="soundmanager-debug",this.debugURLParam=/([#?&])debug=1/i,this.versionNumber="V2.97a.20170601",this.version=null,this.movieURL=null,this.altURL=null,this.swfLoaded=!1,this.enabled=!1,this.oMC=null,this.sounds={},this.soundIDs=[],this.muted=!1,this.didFlashBlock=!1,this.filePattern=null,this.filePatterns={flash8:/\.mp3(\?.*)?$/i,flash9:/\.mp3(\?.*)?$/i},this.features={buffering:!1,peakData:!1,waveformData:!1,eqData:!1,movieStar:!1},this.sandbox={type:null,types:{remote:"remote (domain-based) rules",localWithFile:"local with file access (no internet access)",localWithNetwork:"local with network (internet access only, no local access)",localTrusted:"local, trusted (local+internet access)"},description:null,noRemote:null,noLocal:null},this.html5={usingFlash:null},this.flash={},this.html5Only=!1,this.ignoreFlash=!1;var n,r,a,s,u,l,c,h,f,d,p,y,v,m,g,A,b,w,_,k,V,O,S,x,L,M,P,E,I,T,q,R,D,F,C,j,B,N,U,H,Y,Q,G,z,K,Z,W,X,J,$,tt,et,nt,rt,ot,it,at,st,ut,lt,ct,ht,ft,dt,pt,yt=this,vt=null,mt=null,gt="soundManager",At=gt+": ",bt=navigator.userAgent,wt=o.location.href.toString(),_t=document,kt=[],Vt=!0,Ot=!1,St=!1,xt=!1,Lt=!1,Mt=!1,Pt=0,Et=["log","info","warn","error"],It=null,Tt=null,qt=!1,Rt=!1,Dt=0,Ft=null,Ct=[],jt=null,Bt=Array.prototype.slice,Nt=!1,Ut=0,Ht=1e3,Yt=bt.match(/(ipad|iphone|ipod)/i),Qt=bt.match(/android/i),Gt=bt.match(/msie|trident/i),zt=bt.match(/webkit/i),Kt=bt.match(/safari/i)&&!bt.match(/chrome/i),Zt=bt.match(/opera/i),Wt=bt.match(/(mobile|pre\/|xoom)/i)||Yt||Qt,Xt=!wt.match(/usehtml5audio/i)&&!wt.match(/sm2-ignorebadua/i)&&Kt&&!bt.match(/silk/i)&&bt.match(/OS\sX\s10_6_([3-7])/i),Jt=o.console!==i&&console.log!==i,$t=_t.hasFocus!==i?_t.hasFocus():null,te=Kt&&(_t.hasFocus===i||!_t.hasFocus()),ee=!te,ne=/(mp3|mp4|mpa|m4a|m4b)/i,re="about:blank",oe=_t.location?_t.location.protocol.match(/http/i):null,ie=oe?"":"//",ae=/^\s*audio\/(?:x-)?(?:mpeg4|aac|flv|mov|mp4|m4v|m4a|m4b|mp4v|3gp|3g2)\s*(?:$|;)/i,se=["mpeg4","aac","flv","mov","mp4","m4v","f4v","m4a","m4b","mp4v","3gp","3g2"],ue=new RegExp("\\.("+se.join("|")+")(\\?.*)?$","i");function le(t){return yt.preferFlash&&st&&!yt.ignoreFlash&&yt.flash[t]!==i&&yt.flash[t]}function ce(t){return function(e){var n,r=this._s;return r&&r._a?n=t.call(this,e):(r&&r.id?yt._wD(r.id+": Ignoring "+e.type):yt._wD("HTML5::Ignoring "+e.type),n=null),n}}this.mimePattern=/^\s*audio\/(?:x-)?(?:mp(?:eg|3))\s*(?:$|;)/i,this.useAltURL=!oe,B={swfBox:"sm2-object-box",swfDefault:"movieContainer",swfError:"swf_error",swfTimedout:"swf_timedout",swfLoaded:"swf_loaded",swfUnblocked:"swf_unblocked",sm2Debug:"sm2_debug",highPerf:"high_performance",flashDebug:"flash_debug"},tt=[null,"MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED"],this.hasHTML5=function(){try{return Audio!==i&&(Zt&&opera!==i&&opera.version()<10?new Audio(null):new Audio).canPlayType!==i}catch(t){return!1}}(),this.setup=function(t){var e=!yt.url;return t!==i&&xt&&jt&&yt.ok()&&(t.flashVersion!==i||t.url!==i||t.html5Test!==i)&&Y(F("setupLate")),p(t),Nt||(Wt?yt.setupOptions.ignoreMobileRestrictions&&!yt.setupOptions.forceUseGlobalHTML5Audio||(Ct.push(V.globalHTML5),Nt=!0):yt.setupOptions.forceUseGlobalHTML5Audio&&(Ct.push(V.globalHTML5),Nt=!0)),!pt&&Wt&&(yt.setupOptions.ignoreMobileRestrictions?Ct.push(V.ignoreMobile):(yt.setupOptions.useHTML5Audio&&!yt.setupOptions.preferFlash||yt._wD(V.mobileUA),yt.setupOptions.useHTML5Audio=!0,yt.setupOptions.preferFlash=!1,Yt?yt.ignoreFlash=!0:(Qt&&!bt.match(/android\s2\.3/i)||!Qt)&&(yt._wD(V.globalHTML5),Nt=!0))),t&&(e&&L&&t.url!==i&&yt.beginDelayedInit(),L||t.url===i||"complete"!==_t.readyState||setTimeout(S,1)),pt=!0,yt},this.ok=function(){return jt?xt&&!Lt:yt.useHTML5Audio&&yt.hasHTML5},this.supported=this.ok,this.getMovie=function(t){return r(t)||_t[t]||o[t]},this.createSound=function(t,e){var r,o,a,s=null;if(o=(r=gt+".createSound(): ")+F(xt?"notOK":"notReady"),!xt||!yt.ok())return Y(o),!1;if(e!==i&&(t={id:t,url:e}),(a=d(t)).url=Z(a.url),a.id===i&&(a.id=yt.setupOptions.idPrefix+Ut++),a.id.toString().charAt(0).match(/^[0-9]$/)&&yt._wD(r+F("badID",a.id),2),yt._wD(r+a.id+(a.url?" ("+a.url+")":""),1),Q(a.id,!0))return yt._wD(r+a.id+" exists",1),yt.sounds[a.id];function u(){return a=U(a),yt.sounds[a.id]=new n(a),yt.soundIDs.push(a.id),yt.sounds[a.id]}if(J(a))s=u(),yt.html5Only||yt._wD(a.id+": Using HTML5"),s._setup_html5(a);else{if(yt.html5Only)return yt._wD(a.id+": No HTML5 support for this sound, and no Flash. Exiting."),u();if(yt.html5.usingFlash&&a.url&&a.url.match(/data:/i))return yt._wD(a.id+": data: URIs not supported via Flash. Exiting."),u();l>8&&(null===a.isMovieStar&&(a.isMovieStar=!!(a.serverURL||a.type&&a.type.match(ae)||a.url&&a.url.match(ue))),a.isMovieStar&&(yt._wD(r+"using MovieStar handling"),a.loops>1&&h("noNSLoop"))),a=H(a,r),s=u(),8===l?mt._createSound(a.id,a.loops||1,a.usePolicyFile):(mt._createSound(a.id,a.url,a.usePeakData,a.useWaveformData,a.useEQData,a.isMovieStar,!!a.isMovieStar&&a.bufferTime,a.loops||1,a.serverURL,a.duration||null,a.autoPlay,!0,a.autoLoad,a.usePolicyFile),a.serverURL||(s.connected=!0,a.onconnect&&a.onconnect.apply(s))),a.serverURL||!a.autoLoad&&!a.autoPlay||s.load(a)}return!a.serverURL&&a.autoPlay&&s.play(),s},this.destroySound=function(t,e){if(!Q(t))return!1;var n,r=yt.sounds[t];for(r.stop(),r._iO={},r.unload(),n=0;n<yt.soundIDs.length;n++)if(yt.soundIDs[n]===t){yt.soundIDs.splice(n,1);break}return e||r.destruct(!0),r=null,delete yt.sounds[t],!0},this.load=function(t,e){return!!Q(t)&&yt.sounds[t].load(e)},this.unload=function(t){return!!Q(t)&&yt.sounds[t].unload()},this.onPosition=function(t,e,n,r){return!!Q(t)&&yt.sounds[t].onposition(e,n,r)},this.onposition=this.onPosition,this.clearOnPosition=function(t,e,n){return!!Q(t)&&yt.sounds[t].clearOnPosition(e,n)},this.play=function(t,e){var n=null,r=e&&!(e instanceof Object);if(!xt||!yt.ok())return Y(gt+".play(): "+F(xt?"notOK":"notReady")),!1;if(Q(t,r))r&&(e={url:e});else{if(!r)return!1;r&&(e={url:e}),e&&e.url&&(yt._wD(gt+'.play(): Attempting to create "'+t+'"',1),e.id=t,n=yt.createSound(e).play())}return null===n&&(n=yt.sounds[t].play(e)),n},this.start=this.play,this.setPlaybackRate=function(t,e,n){return!!Q(t)&&yt.sounds[t].setPlaybackRate(e,n)},this.setPosition=function(t,e){return!!Q(t)&&yt.sounds[t].setPosition(e)},this.stop=function(t){return!!Q(t)&&(yt._wD(gt+".stop("+t+")",1),yt.sounds[t].stop())},this.stopAll=function(){var t;for(t in yt._wD(gt+".stopAll()",1),yt.sounds)yt.sounds.hasOwnProperty(t)&&yt.sounds[t].stop()},this.pause=function(t){return!!Q(t)&&yt.sounds[t].pause()},this.pauseAll=function(){var t;for(t=yt.soundIDs.length-1;t>=0;t--)yt.sounds[yt.soundIDs[t]].pause()},this.resume=function(t){return!!Q(t)&&yt.sounds[t].resume()},this.resumeAll=function(){var t;for(t=yt.soundIDs.length-1;t>=0;t--)yt.sounds[yt.soundIDs[t]].resume()},this.togglePause=function(t){return!!Q(t)&&yt.sounds[t].togglePause()},this.setPan=function(t,e){return!!Q(t)&&yt.sounds[t].setPan(e)},this.setVolume=function(t,e){var n,r;if(t!==i&&!isNaN(t)&&e===i){for(n=0,r=yt.soundIDs.length;n<r;n++)yt.sounds[yt.soundIDs[n]].setVolume(t);return!1}return!!Q(t)&&yt.sounds[t].setVolume(e)},this.mute=function(t){var e=0;if(t instanceof String&&(t=null),t)return!!Q(t)&&(yt._wD(gt+'.mute(): Muting "'+t+'"'),yt.sounds[t].mute());for(yt._wD(gt+".mute(): Muting all sounds"),e=yt.soundIDs.length-1;e>=0;e--)yt.sounds[yt.soundIDs[e]].mute();return yt.muted=!0,!0},this.muteAll=function(){yt.mute()},this.unmute=function(t){var e;if(t instanceof String&&(t=null),t)return!!Q(t)&&(yt._wD(gt+'.unmute(): Unmuting "'+t+'"'),yt.sounds[t].unmute());for(yt._wD(gt+".unmute(): Unmuting all sounds"),e=yt.soundIDs.length-1;e>=0;e--)yt.sounds[yt.soundIDs[e]].unmute();return yt.muted=!1,!0},this.unmuteAll=function(){yt.unmute()},this.toggleMute=function(t){return!!Q(t)&&yt.sounds[t].toggleMute()},this.getMemoryUse=function(){var t=0;return mt&&8!==l&&(t=parseInt(mt._getMemoryUse(),10)),t},this.disable=function(t){var e;if(t===i&&(t=!1),Lt)return!1;for(Lt=!0,h("shutdown",1),e=yt.soundIDs.length-1;e>=0;e--)q(yt.sounds[yt.soundIDs[e]]);return q(yt),f(t),it.remove(o,"load",g),!0},this.canPlayMIME=function(t){var e;return yt.hasHTML5&&(e=$({type:t})),!e&&jt&&(e=t&&yt.ok()?!!(l>8&&t.match(ae)||t.match(yt.mimePattern)):null),e},this.canPlayURL=function(t){var e;return yt.hasHTML5&&(e=$({url:t})),!e&&jt&&(e=t&&yt.ok()?!!t.match(yt.filePattern):null),e},this.canPlayLink=function(t){return!(t.type===i||!t.type||!yt.canPlayMIME(t.type))||yt.canPlayURL(t.href)},this.getSoundById=function(t,e){if(!t)return null;var n=yt.sounds[t];return n||e||yt._wD(gt+'.getSoundById(): Sound "'+t+'" not found.',2),n},this.onready=function(t,e){var n="onready";if("function"!=typeof t)throw F("needFunction",n);return xt&&yt._wD(F("queue",n)),e||(e=o),v(n,t,e),m(),!0},this.ontimeout=function(t,e){var n="ontimeout";if("function"!=typeof t)throw F("needFunction",n);return xt&&yt._wD(F("queue",n)),e||(e=o),v(n,t,e),m({type:n}),!0},this._writeDebug=function(t,e){var n,o;return!(!yt.setupOptions.debugMode||!(Jt&&yt.useConsole&&(e&&"object"==typeof e?console.log(t,e):Et[e]!==i?console[Et[e]](t):console.log(t),yt.consoleOnly))&&(!(n=r("soundmanager-debug"))||(o=_t.createElement("div"),++Pt%2==0&&(o.className="sm2-alt"),e=e===i?0:parseInt(e,10),o.appendChild(_t.createTextNode(t)),e&&(e>=2&&(o.style.fontWeight="bold"),3===e&&(o.style.color="#ff3333")),n.insertBefore(o,n.firstChild),n=null,0)))},-1!==wt.indexOf("sm2-debug=alert")&&(this._writeDebug=function(t){o.alert(t)}),this._wD=this._writeDebug,this._debug=function(){var t,e;for(h("currentObj",1),t=0,e=yt.soundIDs.length;t<e;t++)yt.sounds[yt.soundIDs[t]]._debug()},this.reboot=function(t,e){var n,r,i;for(yt.soundIDs.length&&yt._wD("Destroying "+yt.soundIDs.length+" SMSound object"+(1!==yt.soundIDs.length?"s":"")+"..."),n=yt.soundIDs.length-1;n>=0;n--)yt.sounds[yt.soundIDs[n]].destruct();if(mt)try{Gt&&(Tt=mt.innerHTML),It=mt.parentNode.removeChild(mt)}catch(t){h("badRemove",2)}if(Tt=It=jt=mt=null,yt.enabled=L=xt=qt=Rt=Ot=St=Lt=Nt=yt.swfLoaded=!1,yt.soundIDs=[],yt.sounds={},Ut=0,pt=!1,t)kt=[];else for(n in kt)if(kt.hasOwnProperty(n))for(r=0,i=kt[n].length;r<i;r++)kt[n][r].fired=!1;return e||yt._wD(gt+": Rebooting..."),yt.html5={usingFlash:null},yt.flash={},yt.html5Only=!1,yt.ignoreFlash=!1,o.setTimeout((function(){e||yt.beginDelayedInit()}),20),yt},this.reset=function(){return h("reset"),yt.reboot(!0,!0)},this.getMoviePercent=function(){return mt&&"PercentLoaded"in mt?mt.PercentLoaded():null},this.beginDelayedInit=function(){Mt=!0,S(),setTimeout((function(){return!Rt&&(P(),O(),Rt=!0,!0)}),20),A()},this.destruct=function(){yt._wD(gt+".destruct()"),yt.disable(!0)},n=function(t){var e,n,r,o,a,s,u,f,p,y,v=this,m=!1,g=[],A=0,b=null;p={duration:null,time:null},this.id=t.id,this.sID=this.id,this.url=t.url,this.options=d(t),this.instanceOptions=this.options,this._iO=this.instanceOptions,this.pan=this.options.pan,this.volume=this.options.volume,this.isHTML5=!1,this._a=null,y=!this.url,this.id3={},this._debug=function(){yt._wD(v.id+": Merged options:",v.options)},this.load=function(t){var e;if(t!==i?v._iO=d(t,v.options):(t=v.options,v._iO=t,b&&b!==v.url&&(h("manURL"),v._iO.url=v.url,v.url=null)),v._iO.url||(v._iO.url=v.url),v._iO.url=Z(v._iO.url),v.instanceOptions=v._iO,e=v._iO,yt._wD(v.id+": load ("+e.url+")"),!e.url&&!v.url)return yt._wD(v.id+": load(): url is unassigned. Exiting.",2),v;if(v.isHTML5||8!==l||v.url||e.autoPlay||yt._wD(v.id+": Flash 8 load() limitation: Wait for onload() before calling play().",1),e.url===v.url&&0!==v.readyState&&2!==v.readyState)return h("onURL",1),3===v.readyState&&e.onload&&dt(v,(function(){e.onload.apply(v,[!!v.duration])})),v;if(v.loaded=!1,v.readyState=1,v.playState=0,v.id3={},J(e))v._setup_html5(e)._called_load?yt._wD(v.id+": Ignoring request to load again"):(v._html5_canplay=!1,v.url!==e.url&&(yt._wD(h("manURL")+": "+e.url),v._a.src=e.url,v.setPosition(0)),v._a.autobuffer="auto",v._a.preload="auto",v._a._called_load=!0);else{if(yt.html5Only)return yt._wD(v.id+": No flash support. Exiting."),v;if(v._iO.url&&v._iO.url.match(/data:/i))return yt._wD(v.id+": data: URIs not supported via Flash. Exiting."),v;try{v.isHTML5=!1,v._iO=H(U(e)),v._iO.autoPlay&&(v._iO.position||v._iO.from)&&(yt._wD(v.id+": Disabling autoPlay because of non-zero offset case"),v._iO.autoPlay=!1),e=v._iO,8===l?mt._load(v.id,e.url,e.stream,e.autoPlay,e.usePolicyFile):mt._load(v.id,e.url,!!e.stream,!!e.autoPlay,e.loops||1,!!e.autoLoad,e.usePolicyFile)}catch(t){h("smError",2),c("onload",!1),E({type:"SMSOUND_LOAD_JS_EXCEPTION",fatal:!0})}}return v.url=e.url,v},this.unload=function(){return 0!==v.readyState&&(yt._wD(v.id+": unload()"),v.isHTML5?(o(),v._a&&(v._a.pause(),b=nt(v._a))):8===l?mt._unload(v.id,re):mt._unload(v.id),e()),v},this.destruct=function(t){yt._wD(v.id+": Destruct"),v.isHTML5?(o(),v._a&&(v._a.pause(),nt(v._a),Nt||r(),v._a._s=null,v._a=null)):(v._iO.onfailure=null,mt._destroySound(v.id)),t||yt.destroySound(v.id,!0)},this.play=function(t,e){var n,r,o,u,c,h,p=!0;if(n=v.id+": play(): ",e=e===i||e,t||(t={}),v.url&&(v._iO.url=v.url),v._iO=d(v._iO,v.options),v._iO=d(t,v._iO),v._iO.url=Z(v._iO.url),v.instanceOptions=v._iO,!v.isHTML5&&v._iO.serverURL&&!v.connected)return v.getAutoPlay()||(yt._wD(n+" Netstream not connected yet - setting autoPlay"),v.setAutoPlay(!0)),v;if(J(v._iO)&&(v._setup_html5(v._iO),a()),1===v.playState&&!v.paused){if(!v._iO.multiShot)return yt._wD(n+"Already playing (one-shot)",1),v.isHTML5&&v.setPosition(v._iO.position),v;yt._wD(n+"Already playing (multi-shot)",1)}if(t.url&&t.url!==v.url&&(v.readyState||v.isHTML5||8!==l||!y?v.load(v._iO):y=!1),v.loaded)yt._wD(n.substr(0,n.lastIndexOf(":")));else if(0===v.readyState){if(yt._wD(n+"Attempting to load"),v.isHTML5||yt.html5Only){if(!v.isHTML5)return yt._wD(n+"Unsupported type. Exiting."),v;v.load(v._iO)}else v._iO.autoPlay=!0,v.load(v._iO);v.instanceOptions=v._iO}else{if(2===v.readyState)return yt._wD(n+"Could not load - exiting",2),v;yt._wD(n+"Loading - attempting to play...")}return!v.isHTML5&&9===l&&v.position>0&&v.position===v.duration&&(yt._wD(n+"Sound at end, resetting to position: 0"),t.position=0),v.paused&&v.position>=0&&(!v._iO.serverURL||v.position>0)?(yt._wD(n+"Resuming from paused state",1),v.resume()):(v._iO=d(t,v._iO),(!v.isHTML5&&null!==v._iO.position&&v._iO.position>0||null!==v._iO.from&&v._iO.from>0||null!==v._iO.to)&&0===v.instanceCount&&0===v.playState&&!v._iO.serverURL&&(o=function(){v._iO=d(t,v._iO),v.play(v._iO)},v.isHTML5&&!v._html5_canplay?(yt._wD(n+"Beginning load for non-zero offset case"),v.load({_oncanplay:o})):v.isHTML5||v.loaded||v.readyState&&2===v.readyState||(yt._wD(n+"Preloading for non-zero offset case"),v.load({onload:o})),v._iO=f()),(!v.instanceCount||v._iO.multiShotEvents||v.isHTML5&&v._iO.multiShot&&!Nt||!v.isHTML5&&l>8&&!v.getAutoPlay())&&v.instanceCount++,v._iO.onposition&&0===v.playState&&s(v),v.playState=1,v.paused=!1,v.position=v._iO.position===i||isNaN(v._iO.position)?0:v._iO.position,v.isHTML5||(v._iO=H(U(v._iO))),v._iO.onplay&&e&&(v._iO.onplay.apply(v),m=!0),v.setVolume(v._iO.volume,!0),v.setPan(v._iO.pan,!0),1!==v._iO.playbackRate&&v.setPlaybackRate(v._iO.playbackRate),v.isHTML5?v.instanceCount<2?(a(),r=v._setup_html5(),v.setPosition(v._iO.position),r.play()):(yt._wD(v.id+": Cloning Audio() for instance #"+v.instanceCount+"..."),u=new Audio(v._iO.url),c=function(){it.remove(u,"ended",c),v._onfinish(v),nt(u),u=null},h=function(){it.remove(u,"canplay",h);try{u.currentTime=v._iO.position/Ht}catch(t){Y(v.id+": multiShot play() failed to apply position of "+v._iO.position/Ht)}u.play()},it.add(u,"ended",c),v._iO.volume!==i&&(u.volume=Math.max(0,Math.min(1,v._iO.volume/100))),v.muted&&(u.muted=!0),v._iO.position?it.add(u,"canplay",h):u.play()):(p=mt._start(v.id,v._iO.loops||1,9===l?v.position:v.position/Ht,v._iO.multiShot||!1),9!==l||p||(yt._wD(n+"No sound hardware, or 32-sound ceiling hit",2),v._iO.onplayerror&&v._iO.onplayerror.apply(v)))),v},this.start=this.play,this.stop=function(t){var e,n=v._iO;return 1===v.playState&&(yt._wD(v.id+": stop()"),v._onbufferchange(0),v._resetOnPosition(0),v.paused=!1,v.isHTML5||(v.playState=0),u(),n.to&&v.clearOnPosition(n.to),v.isHTML5?v._a&&(e=v.position,v.setPosition(0),v.position=e,v._a.pause(),v.playState=0,v._onTimer(),o()):(mt._stop(v.id,t),n.serverURL&&v.unload()),v.instanceCount=0,v._iO={},n.onstop&&n.onstop.apply(v)),v},this.setAutoPlay=function(t){yt._wD(v.id+": Autoplay turned "+(t?"on":"off")),v._iO.autoPlay=t,v.isHTML5||(mt._setAutoPlay(v.id,t),t&&(v.instanceCount||1!==v.readyState||(v.instanceCount++,yt._wD(v.id+": Incremented instance count to "+v.instanceCount))))},this.getAutoPlay=function(){return v._iO.autoPlay},this.setPlaybackRate=function(t){var e=Math.max(.5,Math.min(4,t));if(e!==t&&yt._wD(v.id+": setPlaybackRate("+t+"): limiting rate to "+e,2),v.isHTML5)try{v._iO.playbackRate=e,v._a.playbackRate=e}catch(t){yt._wD(v.id+": setPlaybackRate("+e+") failed: "+t.message,2)}return v},this.setPosition=function(t){t===i&&(t=0);var e,n,r=v.isHTML5?Math.max(t,0):Math.min(v.duration||v._iO.duration,Math.max(t,0));if(v.position=r,n=v.position/Ht,v._resetOnPosition(v.position),v._iO.position=r,v.isHTML5){if(v._a){if(v._html5_canplay){if(v._a.currentTime.toFixed(3)!==n.toFixed(3)){yt._wD(v.id+": setPosition("+n+")");try{v._a.currentTime=n,(0===v.playState||v.paused)&&v._a.pause()}catch(t){yt._wD(v.id+": setPosition("+n+") failed: "+t.message,2)}}}else if(n)return yt._wD(v.id+": setPosition("+n+"): Cannot seek yet, sound not ready",2),v;v.paused&&v._onTimer(!0)}}else e=9===l?v.position:n,v.readyState&&2!==v.readyState&&mt._setPosition(v.id,e,v.paused||!v.playState,v._iO.multiShot);return v},this.pause=function(t){return v.paused||0===v.playState&&1!==v.readyState||(yt._wD(v.id+": pause()"),v.paused=!0,v.isHTML5?(v._setup_html5().pause(),o()):(t||t===i)&&mt._pause(v.id,v._iO.multiShot),v._iO.onpause&&v._iO.onpause.apply(v)),v},this.resume=function(){var t=v._iO;return v.paused?(yt._wD(v.id+": resume()"),v.paused=!1,v.playState=1,v.isHTML5?(v._setup_html5().play(),a()):(t.isMovieStar&&!t.serverURL&&v.setPosition(v.position),mt._pause(v.id,t.multiShot)),!m&&t.onplay?(t.onplay.apply(v),m=!0):t.onresume&&t.onresume.apply(v),v):v},this.togglePause=function(){return yt._wD(v.id+": togglePause()"),0===v.playState?(v.play({position:9!==l||v.isHTML5?v.position/Ht:v.position}),v):(v.paused?v.resume():v.pause(),v)},this.setPan=function(t,e){return t===i&&(t=0),e===i&&(e=!1),v.isHTML5||mt._setPan(v.id,t),v._iO.pan=t,e||(v.pan=t,v.options.pan=t),v},this.setVolume=function(t,e){return t===i&&(t=100),e===i&&(e=!1),v.isHTML5?v._a&&(yt.muted&&!v.muted&&(v.muted=!0,v._a.muted=!0),v._a.volume=Math.max(0,Math.min(1,t/100))):mt._setVolume(v.id,yt.muted&&!v.muted||v.muted?0:t),v._iO.volume=t,e||(v.volume=t,v.options.volume=t),v},this.mute=function(){return v.muted=!0,v.isHTML5?v._a&&(v._a.muted=!0):mt._setVolume(v.id,0),v},this.unmute=function(){v.muted=!1;var t=v._iO.volume!==i;return v.isHTML5?v._a&&(v._a.muted=!1):mt._setVolume(v.id,t?v._iO.volume:v.options.volume),v},this.toggleMute=function(){return v.muted?v.unmute():v.mute()},this.onPosition=function(t,e,n){return g.push({position:parseInt(t,10),method:e,scope:n!==i?n:v,fired:!1}),v},this.onposition=this.onPosition,this.clearOnPosition=function(t,e){var n;if(t=parseInt(t,10),!isNaN(t))for(n=0;n<g.length;n++)t===g[n].position&&(e&&e!==g[n].method||(g[n].fired&&A--,g.splice(n,1)))},this._processOnPosition=function(){var t,e,n=g.length;if(!n||!v.playState||A>=n)return!1;for(t=n-1;t>=0;t--)!(e=g[t]).fired&&v.position>=e.position&&(e.fired=!0,A++,e.method.apply(e.scope,[e.position]),n=g.length);return!0},this._resetOnPosition=function(t){var e,n,r=g.length;if(!r)return!1;for(e=r-1;e>=0;e--)(n=g[e]).fired&&t<=n.position&&(n.fired=!1,A--);return!0},f=function(){var t,e,n=v._iO,r=n.from,o=n.to;return e=function(){yt._wD(v.id+': "To" time of '+o+" reached."),v.clearOnPosition(o,e),v.stop()},t=function(){yt._wD(v.id+': Playing "from" '+r),null===o||isNaN(o)||v.onPosition(o,e)},null===r||isNaN(r)||(n.position=r,n.multiShot=!1,t()),n},s=function(){var t,e=v._iO.onposition;if(e)for(t in e)e.hasOwnProperty(t)&&v.onPosition(parseInt(t,10),e[t])},u=function(){var t,e=v._iO.onposition;if(e)for(t in e)e.hasOwnProperty(t)&&v.clearOnPosition(parseInt(t,10))},a=function(){v.isHTML5&&G(v)},o=function(){v.isHTML5&&z(v)},(e=function(t){t||(g=[],A=0),m=!1,v._hasTimer=null,v._a=null,v._html5_canplay=!1,v.bytesLoaded=null,v.bytesTotal=null,v.duration=v._iO&&v._iO.duration?v._iO.duration:null,v.durationEstimate=null,v.buffered=[],v.eqData=[],v.eqData.left=[],v.eqData.right=[],v.failures=0,v.isBuffering=!1,v.instanceOptions={},v.instanceCount=0,v.loaded=!1,v.metadata={},v.readyState=0,v.muted=!1,v.paused=!1,v.peakData={left:0,right:0},v.waveformData={left:[],right:[]},v.playState=0,v.position=null,v.id3={}})(),this._onTimer=function(t){var e,n,r=!1,o={};return(v._hasTimer||t)&&v._a&&(t||(v.playState>0||1===v.readyState)&&!v.paused)&&((e=v._get_html5_duration())!==p.duration&&(p.duration=e,v.duration=e,r=!0),v.durationEstimate=v.duration,(n=v._a.currentTime*Ht||0)!==p.time&&(p.time=n,r=!0),(r||t)&&v._whileplaying(n,o,o,o,o)),r},this._get_html5_duration=function(){var t=v._iO,e=v._a&&v._a.duration?v._a.duration*Ht:t&&t.duration?t.duration:null;return e&&!isNaN(e)&&e!==1/0?e:null},this._apply_loop=function(t,e){!t.loop&&e>1&&yt._wD("Note: Native HTML5 looping is infinite.",1),t.loop=e>1?"loop":""},this._setup_html5=function(t){var r,o=d(v._iO,t),i=Nt?vt:v._a,a=decodeURI(o.url);if(Nt?a===decodeURI(at)&&(r=!0):a===decodeURI(b)&&(r=!0),i){if(i._s)if(Nt)i._s&&i._s.playState&&!r&&i._s.stop();else if(!Nt&&a===decodeURI(b))return v._apply_loop(i,o.loops),i;r||(b&&e(!1),i.src=o.url,v.url=o.url,b=o.url,at=o.url,i._called_load=!1)}else o.autoLoad||o.autoPlay?(v._a=new Audio(o.url),v._a.load()):v._a=Zt&&opera.version()<10?new Audio(null):new Audio,(i=v._a)._called_load=!1,Nt&&(vt=i);return v.isHTML5=!0,v._a=i,i._s=v,n(),v._apply_loop(i,o.loops),o.autoLoad||o.autoPlay?v.load():(i.autobuffer=!1,i.preload="auto"),i},n=function(){if(v._a._added_events)return!1;var t,e,n;for(t in v._a._added_events=!0,ct)ct.hasOwnProperty(t)&&(e=t,n=ct[t],void 0,v._a&&v._a.addEventListener(e,n,!1));return!0},r=function(){var t,e,n;for(t in yt._wD(v.id+": Removing event listeners"),v._a._added_events=!1,ct)ct.hasOwnProperty(t)&&(e=t,n=ct[t],void 0,v._a&&v._a.removeEventListener(e,n,!1))},this._onload=function(t){var e,n=!!t||!v.isHTML5&&8===l&&v.duration;return e=v.id+": ",yt._wD(e+(n?"onload()":"Failed to load / invalid sound?"+(v.duration?" -":" Zero-length duration reported.")+" ("+v.url+")"),n?1:2),n||v.isHTML5||(!0===yt.sandbox.noRemote&&yt._wD(e+F("noNet"),1),!0===yt.sandbox.noLocal&&yt._wD(e+F("noLocal"),1)),v.loaded=n,v.readyState=n?3:2,v._onbufferchange(0),n||v.isHTML5||v._onerror(),v._iO.onload&&dt(v,(function(){v._iO.onload.apply(v,[n])})),!0},this._onerror=function(t,e){v._iO.onerror&&dt(v,(function(){v._iO.onerror.apply(v,[t,e])}))},this._onbufferchange=function(t){return!(0===v.playState||t&&v.isBuffering||!t&&!v.isBuffering||(v.isBuffering=1===t,v._iO.onbufferchange&&(yt._wD(v.id+": Buffer state change: "+t),v._iO.onbufferchange.apply(v,[t])),0))},this._onsuspend=function(){return v._iO.onsuspend&&(yt._wD(v.id+": Playback suspended"),v._iO.onsuspend.apply(v)),!0},this._onfailure=function(t,e,n){v.failures++,yt._wD(v.id+": Failure ("+v.failures+"): "+t),v._iO.onfailure&&1===v.failures?v._iO.onfailure(t,e,n):yt._wD(v.id+": Ignoring failure")},this._onwarning=function(t,e,n){v._iO.onwarning&&v._iO.onwarning(t,e,n)},this._onfinish=function(){var t=v._iO.onfinish;v._onbufferchange(0),v._resetOnPosition(0),v.instanceCount&&(v.instanceCount--,v.instanceCount||(u(),v.playState=0,v.paused=!1,v.instanceCount=0,v.instanceOptions={},v._iO={},o(),v.isHTML5&&(v.position=0)),v.instanceCount&&!v._iO.multiShotEvents||t&&(yt._wD(v.id+": onfinish()"),dt(v,(function(){t.apply(v)}))))},this._whileloading=function(t,e,n,r){var o=v._iO;v.bytesLoaded=t,v.bytesTotal=e,v.duration=Math.floor(n),v.bufferLength=r,v.isHTML5||o.isMovieStar?v.durationEstimate=v.duration:o.duration?v.durationEstimate=v.duration>o.duration?v.duration:o.duration:v.durationEstimate=parseInt(v.bytesTotal/v.bytesLoaded*v.duration,10),v.isHTML5||(v.buffered=[{start:0,end:v.duration}]),(3!==v.readyState||v.isHTML5)&&o.whileloading&&o.whileloading.apply(v)},this._whileplaying=function(t,e,n,r,o){var a,s=v._iO;return!isNaN(t)&&null!==t&&(v.position=Math.max(0,t),v._processOnPosition(),!v.isHTML5&&l>8&&(s.usePeakData&&e!==i&&e&&(v.peakData={left:e.leftPeak,right:e.rightPeak}),s.useWaveformData&&n!==i&&n&&(v.waveformData={left:n.split(","),right:r.split(",")}),s.useEQData&&o!==i&&o&&o.leftEQ&&(a=o.leftEQ.split(","),v.eqData=a,v.eqData.left=a,o.rightEQ!==i&&o.rightEQ&&(v.eqData.right=o.rightEQ.split(",")))),1===v.playState&&(v.isHTML5||8!==l||v.position||!v.isBuffering||v._onbufferchange(0),s.whileplaying&&s.whileplaying.apply(v)),!0)},this._oncaptiondata=function(t){yt._wD(v.id+": Caption data received."),v.captiondata=t,v._iO.oncaptiondata&&v._iO.oncaptiondata.apply(v,[t])},this._onmetadata=function(t,e){yt._wD(v.id+": Metadata received.");var n,r,o={};for(n=0,r=t.length;n<r;n++)o[t[n]]=e[n];v.metadata=o,v._iO.onmetadata&&v._iO.onmetadata.call(v,v.metadata)},this._onid3=function(t,e){yt._wD(v.id+": ID3 data received.");var n,r,o=[];for(n=0,r=t.length;n<r;n++)o[t[n]]=e[n];v.id3=d(v.id3,o),v._iO.onid3&&v._iO.onid3.apply(v)},this._onconnect=function(t){t=1===t,yt._wD(v.id+": "+(t?"Connected.":"Failed to connect? - "+v.url),t?1:2),v.connected=t,t&&(v.failures=0,Q(v.id)&&(v.getAutoPlay()?v.play(i,v.getAutoPlay()):v._iO.autoLoad&&v.load()),v._iO.onconnect&&v._iO.onconnect.apply(v,[t]))},this._ondataerror=function(t){v.playState>0&&(yt._wD(v.id+": Data error: "+t),v._iO.ondataerror&&v._iO.ondataerror.apply(v))},this._debug()},M=function(){return _t.body||_t.getElementsByTagName("div")[0]},r=function(t){return _t.getElementById(t)},d=function(t,e){var n,r,o=t||{};for(r in n=e===i?yt.defaultOptions:e)n.hasOwnProperty(r)&&o[r]===i&&("object"!=typeof n[r]||null===n[r]?o[r]=n[r]:o[r]=d(o[r],n[r]));return o},dt=function(t,e){t.isHTML5||8!==l?e():o.setTimeout(e,0)},y={onready:1,ontimeout:1,defaultOptions:1,flash9Options:1,movieStarOptions:1},p=function(t,e){var n,r=!0,o=e!==i,a=yt.setupOptions,s=y;if(t===i){for(n in r=[],a)a.hasOwnProperty(n)&&r.push(n);for(n in s)s.hasOwnProperty(n)&&("object"==typeof yt[n]?r.push(n+": {...}"):yt[n]instanceof Function?r.push(n+": function() {...}"):r.push(n));return yt._wD(F("setup",r.join(", "))),!1}for(n in t)if(t.hasOwnProperty(n))if("object"!=typeof t[n]||null===t[n]||t[n]instanceof Array||t[n]instanceof RegExp)o&&s[e]!==i?yt[e][n]=t[n]:a[n]!==i?(yt.setupOptions[n]=t[n],yt[n]=t[n]):s[n]===i?(Y(F(yt[n]===i?"setupUndef":"setupError",n),2),r=!1):yt[n]instanceof Function?yt[n].apply(yt,t[n]instanceof Array?t[n]:[t[n]]):yt[n]=t[n];else{if(s[n]!==i)return p(t[n],n);Y(F(yt[n]===i?"setupUndef":"setupError",n),2),r=!1}return r},it=function(){var t=o.attachEvent,e={add:t?"attachEvent":"addEventListener",remove:t?"detachEvent":"removeEventListener"};function n(e){var n=Bt.call(e),r=n.length;return t?(n[1]="on"+n[1],r>3&&n.pop()):3===r&&n.push(!1),n}function r(n,r){var o=n.shift(),i=[e[r]];t?o[i](n[0],n[1]):o[i].apply(o,n)}return{add:function(){r(n(arguments),"add")},remove:function(){r(n(arguments),"remove")}}}(),ct={abort:ce((function(){yt._wD(this._s.id+": abort")})),canplay:ce((function(){var t,e=this._s;if(!e._html5_canplay){if(e._html5_canplay=!0,yt._wD(e.id+": canplay"),e._onbufferchange(0),t=e._iO.position===i||isNaN(e._iO.position)?null:e._iO.position/Ht,this.currentTime!==t){yt._wD(e.id+": canplay: Setting position to "+t);try{this.currentTime=t}catch(n){yt._wD(e.id+": canplay: Setting position of "+t+" failed: "+n.message,2)}}e._iO._oncanplay&&e._iO._oncanplay()}})),canplaythrough:ce((function(){var t=this._s;t.loaded||(t._onbufferchange(0),t._whileloading(t.bytesLoaded,t.bytesTotal,t._get_html5_duration()),t._onload(!0))})),durationchange:ce((function(){var t,e=this._s;t=e._get_html5_duration(),isNaN(t)||t===e.duration||(yt._wD(this._s.id+": durationchange ("+t+")"+(e.duration?", previously "+e.duration:"")),e.durationEstimate=e.duration=t)})),ended:ce((function(){var t=this._s;yt._wD(t.id+": ended"),t._onfinish()})),error:ce((function(){var t=tt[this.error.code]||null;yt._wD(this._s.id+": HTML5 error, code "+this.error.code+(t?" ("+t+")":"")),this._s._onload(!1),this._s._onerror(this.error.code,t)})),loadeddata:ce((function(){var t=this._s;yt._wD(t.id+": loadeddata"),t._loaded||Kt||(t.duration=t._get_html5_duration())})),loadedmetadata:ce((function(){yt._wD(this._s.id+": loadedmetadata")})),loadstart:ce((function(){yt._wD(this._s.id+": loadstart"),this._s._onbufferchange(1)})),play:ce((function(){this._s._onbufferchange(0)})),playing:ce((function(){yt._wD(this._s.id+": playing "+String.fromCharCode(9835)),this._s._onbufferchange(0)})),progress:ce((function(t){var e,n,r,o=this._s,i=0,a="progress"===t.type,s=t.target.buffered,u=t.loaded||0,l=t.total||1;if(o.buffered=[],s&&s.length){for(e=0,n=s.length;e<n;e++)o.buffered.push({start:s.start(e)*Ht,end:s.end(e)*Ht});if(i=(s.end(0)-s.start(0))*Ht,u=Math.min(1,i/(t.target.duration*Ht)),a&&s.length>1){for(r=[],n=s.length,e=0;e<n;e++)r.push(t.target.buffered.start(e)*Ht+"-"+t.target.buffered.end(e)*Ht);yt._wD(this._s.id+": progress, timeRanges: "+r.join(", "))}a&&!isNaN(u)&&yt._wD(this._s.id+": progress, "+Math.floor(100*u)+"% loaded")}isNaN(u)||(o._whileloading(u,l,o._get_html5_duration()),u&&l&&u===l&&ct.canplaythrough.call(this,t))})),ratechange:ce((function(){yt._wD(this._s.id+": ratechange")})),suspend:ce((function(t){var e=this._s;yt._wD(this._s.id+": suspend"),ct.progress.call(this,t),e._onsuspend()})),stalled:ce((function(){yt._wD(this._s.id+": stalled")})),timeupdate:ce((function(){this._s._onTimer()})),waiting:ce((function(){var t=this._s;yt._wD(this._s.id+": waiting"),t._onbufferchange(1)}))},J=function(t){return!(!t||!(t.type||t.url||t.serverURL))&&!(t.serverURL||t.type&&le(t.type))&&(t.type?$({type:t.type}):$({url:t.url})||yt.html5Only||t.url.match(/data:/i))},nt=function(t){var e;return t&&(e=Kt?re:yt.html5.canPlayType("audio/wav")?"data:audio/wave;base64,/UklGRiYAAABXQVZFZm10IBAAAAABAAEARKwAAIhYAQACABAAZGF0YQIAAAD//w==":re,t.src=e,t._called_unload!==i&&(t._called_load=!1)),Nt&&(at=null),e},$=function(t){if(!yt.useHTML5Audio||!yt.hasHTML5)return!1;var e,n,r,o,a=t.url||null,s=t.type||null,u=yt.audioFormats;if(s&&yt.html5[s]!==i)return yt.html5[s]&&!le(s);if(!et){for(o in et=[],u)u.hasOwnProperty(o)&&(et.push(o),u[o].related&&(et=et.concat(u[o].related)));et=new RegExp("\\.("+et.join("|")+")(\\?.*)?$","i")}return(r=a?a.toLowerCase().match(et):null)&&r.length?r=r[1]:s?r=(-1!==(n=s.indexOf(";"))?s.substr(0,n):s).substr(6):e=!1,r&&yt.html5[r]!==i?e=yt.html5[r]&&!le(r):(s="audio/"+r,e=yt.html5.canPlayType({type:s}),yt.html5[r]=e,e=e&&yt.html5[s]&&!le(s)),e},ot=function(){if(!yt.useHTML5Audio||!yt.hasHTML5)return yt.html5.usingFlash=!0,jt=!0,!1;var t,e,n,r,o=Audio!==i?Zt&&opera.version()<10?new Audio(null):new Audio:null,a={};function s(t){var e,n,i=!1,a=!1;if(!o||"function"!=typeof o.canPlayType)return i;if(t instanceof Array){for(r=0,n=t.length;r<n;r++)(yt.html5[t[r]]||o.canPlayType(t[r]).match(yt.html5Test))&&(a=!0,yt.html5[t[r]]=!0,yt.flash[t[r]]=!!t[r].match(ne));i=a}else i=!(!(e=!(!o||"function"!=typeof o.canPlayType)&&o.canPlayType(t))||!e.match(yt.html5Test));return i}for(t in n=yt.audioFormats)if(n.hasOwnProperty(t)&&(e="audio/"+t,a[t]=s(n[t].type),a[e]=a[t],t.match(ne)?(yt.flash[t]=!0,yt.flash[e]=!0):(yt.flash[t]=!1,yt.flash[e]=!1),n[t]&&n[t].related))for(r=n[t].related.length-1;r>=0;r--)a["audio/"+n[t].related[r]]=a[t],yt.html5[n[t].related[r]]=a[t],yt.flash[n[t].related[r]]=a[t];return a.canPlayType=o?s:null,yt.html5=d(yt.html5,a),yt.html5.usingFlash=X(),jt=yt.html5.usingFlash,!0},V={notReady:"Unavailable - wait until onready() has fired.",notOK:"Audio support is not available.",domError:gt+"exception caught while appending SWF to DOM.",spcWmode:"Removing wmode, preventing known SWF loading issue(s)",swf404:At+"Verify that %s is a valid path.",tryDebug:"Try "+gt+".debugFlash = true for more security details (output goes to SWF.)",checkSWF:"See SWF output for more debug info.",localFail:At+"Non-HTTP page ("+_t.location.protocol+" URL?) Review Flash player security settings for this special case:\nhttp://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html\nMay need to add/allow path, eg. c:/sm2/ or /users/me/sm2/",waitFocus:At+"Special case: Waiting for SWF to load with window focus...",waitForever:At+"Waiting indefinitely for Flash (will recover if unblocked)...",waitSWF:At+"Waiting for 100% SWF load...",needFunction:At+"Function object expected for %s",badID:'Sound ID "%s" should be a string, starting with a non-numeric character',currentObj:At+"_debug(): Current sound objects",waitOnload:At+"Waiting for window.onload()",docLoaded:At+"Document already loaded",onload:At+"initComplete(): calling soundManager.onload()",onloadOK:gt+".onload() complete",didInit:At+"init(): Already called?",secNote:"Flash security note: Network/internet URLs will not load due to security restrictions. Access can be configured via Flash Player Global Security Settings Page: http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html",badRemove:At+"Failed to remove Flash node.",shutdown:gt+".disable(): Shutting down",queue:At+"Queueing %s handler",smError:"SMSound.load(): Exception: JS-Flash communication failed, or JS error.",fbTimeout:"No flash response, applying ."+B.swfTimedout+" CSS...",fbLoaded:"Flash loaded",fbHandler:At+"flashBlockHandler()",manURL:"SMSound.load(): Using manually-assigned URL",onURL:gt+".load(): current URL already assigned.",badFV:gt+'.flashVersion must be 8 or 9. "%s" is invalid. Reverting to %s.',as2loop:"Note: Setting stream:false so looping can work (flash 8 limitation)",noNSLoop:"Note: Looping not implemented for MovieStar formats",needfl9:"Note: Switching to flash 9, required for MP4 formats.",mfTimeout:"Setting flashLoadTimeout = 0 (infinite) for off-screen, mobile flash case",needFlash:At+"Fatal error: Flash is needed to play some required formats, but is not available.",gotFocus:At+"Got window focus.",policy:"Enabling usePolicyFile for data access",setup:gt+".setup(): allowed parameters: %s",setupError:gt+'.setup(): "%s" cannot be assigned with this method.',setupUndef:gt+'.setup(): Could not find option "%s"',setupLate:gt+".setup(): url, flashVersion and html5Test property changes will not take effect until reboot().",noURL:At+"Flash URL required. Call soundManager.setup({url:...}) to get started.",sm2Loaded:"SoundManager 2: Ready. "+String.fromCharCode(10003),reset:gt+".reset(): Removing event callbacks",mobileUA:"Mobile UA detected, preferring HTML5 by default.",globalHTML5:"Using singleton HTML5 Audio() pattern for this device.",ignoreMobile:"Ignoring mobile restrictions for this device."},F=function(){var t,e,n,r,o;if(r=(t=Bt.call(arguments)).shift(),(o=V&&V[r]?V[r]:"")&&t&&t.length)for(e=0,n=t.length;e<n;e++)o=o.replace("%s",t[e]);return o},U=function(t){return 8===l&&t.loops>1&&t.stream&&(h("as2loop"),t.stream=!1),t},H=function(t,e){return t&&!t.usePolicyFile&&(t.onid3||t.usePeakData||t.useWaveformData||t.useEQData)&&(yt._wD((e||"")+F("policy")),t.usePolicyFile=!0),t},Y=function(t){Jt&&console.warn!==i?console.warn(t):yt._wD(t)},a=function(){return!1},q=function(t){var e;for(e in t)t.hasOwnProperty(e)&&"function"==typeof t[e]&&(t[e]=a);e=null},R=function(t){t===i&&(t=!1),(Lt||t)&&yt.disable(t)},D=function(t){var e;if(t)if(t.match(/\.swf(\?.*)?$/i)){if(t.substr(t.toLowerCase().lastIndexOf(".swf?")+4))return t}else t.lastIndexOf("/")!==t.length-1&&(t+="/");return e=(t&&-1!==t.lastIndexOf("/")?t.substr(0,t.lastIndexOf("/")+1):"./")+yt.movieURL,yt.noSWFCache&&(e+="?ts="+(new Date).getTime()),e},_=function(){8!==(l=parseInt(yt.flashVersion,10))&&9!==l&&(yt._wD(F("badFV",l,8)),yt.flashVersion=l=8);var t=yt.debugMode||yt.debugFlash?"_debug.swf":".swf";yt.useHTML5Audio&&!yt.html5Only&&yt.audioFormats.mp4.required&&l<9&&(yt._wD(F("needfl9")),yt.flashVersion=l=9),yt.version=yt.versionNumber+(yt.html5Only?" (HTML5-only mode)":9===l?" (AS3/Flash 9)":" (AS2/Flash 8)"),l>8?(yt.defaultOptions=d(yt.defaultOptions,yt.flash9Options),yt.features.buffering=!0,yt.defaultOptions=d(yt.defaultOptions,yt.movieStarOptions),yt.filePatterns.flash9=new RegExp("\\.(mp3|"+se.join("|")+")(\\?.*)?$","i"),yt.features.movieStar=!0):yt.features.movieStar=!1,yt.filePattern=yt.filePatterns[8!==l?"flash9":"flash8"],yt.movieURL=(8===l?"soundmanager2.swf":"soundmanager2_flash9.swf").replace(".swf",t),yt.features.peakData=yt.features.waveformData=yt.features.eqData=l>8},I=function(t,e){mt&&mt._setPolling(t,e)},T=function(){if(yt.debugURLParam.test(wt)&&(yt.setupOptions.debugMode=yt.debugMode=!0),!r(yt.debugID)){var t,e,n,o,i;if(yt.debugMode&&!r(yt.debugID)&&(!Jt||!yt.useConsole||!yt.consoleOnly)){for(i in(t=_t.createElement("div")).id=yt.debugID+"-toggle",o={position:"fixed",bottom:"0px",right:"0px",width:"1.2em",height:"1.2em",lineHeight:"1.2em",margin:"2px",textAlign:"center",border:"1px solid #999",cursor:"pointer",background:"#fff",color:"#333",zIndex:10001},t.appendChild(_t.createTextNode("-")),t.onclick=N,t.title="Toggle SM2 debug console",bt.match(/msie 6/i)&&(t.style.position="absolute",t.style.cursor="hand"),o)o.hasOwnProperty(i)&&(t.style[i]=o[i]);if((e=_t.createElement("div")).id=yt.debugID,e.style.display=yt.debugMode?"block":"none",yt.debugMode&&!r(t.id)){try{(n=M()).appendChild(t)}catch(t){throw new Error(F("domError")+" \n"+t.toString())}n.appendChild(e)}}n=null}},Q=this.getSoundById,h=function(t,e){return t?yt._wD(F(t),e):""},N=function(){var t=r(yt.debugID),e=r(yt.debugID+"-toggle");t&&(Vt?(e.innerHTML="+",t.style.display="none"):(e.innerHTML="-",t.style.display="block"),Vt=!Vt)},c=function(t,e,n){if(o.sm2Debugger!==i)try{sm2Debugger.handleEvent(t,e,n)}catch(t){return!1}return!0},j=function(){var t=[];return yt.debugMode&&t.push(B.sm2Debug),yt.debugFlash&&t.push(B.flashDebug),yt.useHighPerformance&&t.push(B.highPerf),t.join(" ")},C=function(){var t=F("fbHandler"),e=yt.getMoviePercent(),n=B,r={type:"FLASHBLOCK"};yt.html5Only||(yt.ok()?(yt.didFlashBlock&&yt._wD(t+": Unblocked"),yt.oMC&&(yt.oMC.className=[j(),n.swfDefault,n.swfLoaded+(yt.didFlashBlock?" "+n.swfUnblocked:"")].join(" "))):(jt&&(yt.oMC.className=j()+" "+n.swfDefault+" "+(null===e?n.swfTimedout:n.swfError),yt._wD(t+": "+F("fbTimeout")+(e?" ("+F("fbLoaded")+")":""))),yt.didFlashBlock=!0,m({type:"ontimeout",ignoreInit:!0,error:r}),E(r)))},v=function(t,e,n){kt[t]===i&&(kt[t]=[]),kt[t].push({method:e,scope:n||null,fired:!1})},m=function(t){if(t||(t={type:yt.ok()?"onready":"ontimeout"}),!xt&&t&&!t.ignoreInit)return!1;if("ontimeout"===t.type&&(yt.ok()||Lt&&!t.ignoreInit))return!1;var e,n,r={success:t&&t.ignoreInit?yt.ok():!Lt},o=t&&t.type&&kt[t.type]||[],i=[],a=[r],s=jt&&!yt.ok();for(t.error&&(a[0].error=t.error),e=0,n=o.length;e<n;e++)!0!==o[e].fired&&i.push(o[e]);if(i.length)for(e=0,n=i.length;e<n;e++)i[e].scope?i[e].method.apply(i[e].scope,a):i[e].method.apply(this,a),s||(i[e].fired=!0);return!0},g=function(){o.setTimeout((function(){yt.useFlashBlock&&C(),m(),"function"==typeof yt.onload&&(h("onload",1),yt.onload.apply(o),h("onloadOK",1)),yt.waitForWindowLoad&&it.add(o,"load",g)}),1)},ut=function(){if(st!==i)return st;var t,e,n,r,a=!1,s=navigator,u=o.ActiveXObject;try{r=s.plugins}catch(t){r=void 0}if(r&&r.length)e="application/x-shockwave-flash",(n=s.mimeTypes)&&n[e]&&n[e].enabledPlugin&&n[e].enabledPlugin.description&&(a=!0);else if(u!==i&&!bt.match(/MSAppHost/i)){try{t=new u("ShockwaveFlash.ShockwaveFlash")}catch(e){t=null}a=!!t,t=null}return st=a,a},X=function(){var t,e,n=yt.audioFormats;if(Yt&&bt.match(/os (1|2|3_0|3_1)\s/i)?(yt.hasHTML5=!1,yt.html5Only=!0,yt.oMC&&(yt.oMC.style.display="none")):yt.useHTML5Audio&&(yt.html5&&yt.html5.canPlayType||(yt._wD("SoundManager: No HTML5 Audio() support detected."),yt.hasHTML5=!1),Xt&&yt._wD(At+"Note: Buggy HTML5 Audio in Safari on this OS X release, see https://bugs.webkit.org/show_bug.cgi?id=32159 - "+(st?"will use flash fallback for MP3/MP4, if available":" would use flash fallback for MP3/MP4, but none detected."),1)),yt.useHTML5Audio&&yt.hasHTML5)for(e in W=!0,n)n.hasOwnProperty(e)&&n[e].required&&(yt.html5.canPlayType(n[e].type)?yt.preferFlash&&(yt.flash[e]||yt.flash[n[e].type])&&(t=!0):(W=!1,t=!0));return yt.ignoreFlash&&(t=!1,W=!0),yt.html5Only=yt.hasHTML5&&yt.useHTML5Audio&&!t,!yt.html5Only},Z=function(t){var e,n,r,o=0;if(t instanceof Array){for(e=0,n=t.length;e<n;e++)if(t[e]instanceof Object){if(yt.canPlayMIME(t[e].type)){o=e;break}}else if(yt.canPlayURL(t[e])){o=e;break}t[o].url&&(t[o]=t[o].url),r=t[o]}else r=t;return r},G=function(t){t._hasTimer||(t._hasTimer=!0,!Wt&&yt.html5PollingInterval&&(null===Ft&&0===Dt&&(Ft=setInterval(K,yt.html5PollingInterval)),Dt++))},z=function(t){t._hasTimer&&(t._hasTimer=!1,!Wt&&yt.html5PollingInterval&&Dt--)},K=function(){var t;if(null!==Ft&&!Dt)return clearInterval(Ft),void(Ft=null);for(t=yt.soundIDs.length-1;t>=0;t--)yt.sounds[yt.soundIDs[t]].isHTML5&&yt.sounds[yt.soundIDs[t]]._hasTimer&&yt.sounds[yt.soundIDs[t]]._onTimer()},E=function(t){t=t!==i?t:{},"function"==typeof yt.onerror&&yt.onerror.apply(o,[{type:t.type!==i?t.type:null}]),t.fatal!==i&&t.fatal&&yt.disable()},lt=function(){if(Xt&&ut()){var t,e,n=yt.audioFormats;for(e in n)if(n.hasOwnProperty(e)&&("mp3"===e||"mp4"===e)&&(yt._wD(gt+": Using flash fallback for "+e+" format"),yt.html5[e]=!1,n[e]&&n[e].related))for(t=n[e].related.length-1;t>=0;t--)yt.html5[n[e].related[t]]=!1}},this._setSandboxType=function(t){var e=yt.sandbox;e.type=t,e.description=e.types[e.types[t]!==i?t:"unknown"],"localWithFile"===e.type?(e.noRemote=!0,e.noLocal=!1,h("secNote",2)):"localWithNetwork"===e.type?(e.noRemote=!1,e.noLocal=!0):"localTrusted"===e.type&&(e.noRemote=!1,e.noLocal=!1)},this._externalInterfaceOK=function(t){if(!yt.swfLoaded){var e;if(c("swf",!0),c("flashtojs",!0),yt.swfLoaded=!0,te=!1,Xt&<(),!t||t.replace(/\+dev/i,"")!==yt.versionNumber.replace(/\+dev/i,""))return e=gt+': Fatal: JavaScript file build "'+yt.versionNumber+'" does not match Flash SWF build "'+t+'" at '+yt.url+". Ensure both are up-to-date.",void setTimeout((function(){throw new Error(e)}),0);setTimeout(u,Gt?100:1)}},P=function(t,e){if(Ot&&St)return!1;function n(){var t,e=[],n=[];t="SoundManager "+yt.version+(!yt.html5Only&&yt.useHTML5Audio?yt.hasHTML5?" + HTML5 audio":", no HTML5 audio support":""),yt.html5Only?yt.html5PollingInterval&&e.push("html5PollingInterval ("+yt.html5PollingInterval+"ms)"):(yt.preferFlash&&e.push("preferFlash"),yt.useHighPerformance&&e.push("useHighPerformance"),yt.flashPollingInterval&&e.push("flashPollingInterval ("+yt.flashPollingInterval+"ms)"),yt.html5PollingInterval&&e.push("html5PollingInterval ("+yt.html5PollingInterval+"ms)"),yt.wmode&&e.push("wmode ("+yt.wmode+")"),yt.debugFlash&&e.push("debugFlash"),yt.useFlashBlock&&e.push("flashBlock")),e.length&&(n=n.concat([e.join(" + ")])),yt._wD(t+(n.length?" + "+n.join(", "):""),1),ht()}if(yt.html5Only)return _(),n(),yt.oMC=r(yt.movieID),u(),Ot=!0,St=!0,!1;var o,a,s,l,c,h,f,d,p,y=e||yt.url,v=yt.altURL||y,m=M(),g=j(),A=_t.getElementsByTagName("html")[0];function b(t,e){return'<param name="'+t+'" value="'+e+'" />'}if(o=A&&A.dir&&A.dir.match(/rtl/i),t=t===i?yt.id:t,_(),yt.url=D(oe?y:v),e=yt.url,yt.wmode=!yt.wmode&&yt.useHighPerformance?"transparent":yt.wmode,null!==yt.wmode&&(bt.match(/msie 8/i)||!Gt&&!yt.useHighPerformance)&&navigator.platform.match(/win32|win64/i)&&(Ct.push(V.spcWmode),yt.wmode=null),a={name:t,id:t,src:e,quality:"high",allowScriptAccess:yt.allowScriptAccess,bgcolor:yt.bgColor,pluginspage:ie+"www.macromedia.com/go/getflashplayer",title:"JS/Flash audio component (SoundManager 2)",type:"application/x-shockwave-flash",wmode:yt.wmode,hasPriority:"true"},yt.debugFlash&&(a.FlashVars="debug=1"),yt.wmode||delete a.wmode,Gt)s=_t.createElement("div"),c=['<object id="'+t+'" data="'+e+'" type="'+a.type+'" title="'+a.title+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0">',b("movie",e),b("AllowScriptAccess",yt.allowScriptAccess),b("quality",a.quality),yt.wmode?b("wmode",yt.wmode):"",b("bgcolor",yt.bgColor),b("hasPriority","true"),yt.debugFlash?b("FlashVars",a.FlashVars):"","</object>"].join("");else for(l in s=_t.createElement("embed"),a)a.hasOwnProperty(l)&&s.setAttribute(l,a[l]);if(T(),g=j(),m=M())if(yt.oMC=r(yt.movieID)||_t.createElement("div"),yt.oMC.id)p=yt.oMC.className,yt.oMC.className=(p?p+" ":B.swfDefault)+(g?" "+g:""),yt.oMC.appendChild(s),Gt&&((h=yt.oMC.appendChild(_t.createElement("div"))).className=B.swfBox,h.innerHTML=c),St=!0;else{if(yt.oMC.id=yt.movieID,yt.oMC.className=B.swfDefault+" "+g,f=null,h=null,yt.useFlashBlock||(yt.useHighPerformance?f={position:"fixed",width:"8px",height:"8px",bottom:"0px",left:"0px",overflow:"hidden"}:(f={position:"absolute",width:"6px",height:"6px",top:"-9999px",left:"-9999px"},o&&(f.left=Math.abs(parseInt(f.left,10))+"px"))),zt&&(yt.oMC.style.zIndex=1e4),!yt.debugFlash)for(d in f)f.hasOwnProperty(d)&&(yt.oMC.style[d]=f[d]);try{Gt||yt.oMC.appendChild(s),m.appendChild(yt.oMC),Gt&&((h=yt.oMC.appendChild(_t.createElement("div"))).className=B.swfBox,h.innerHTML=c),St=!0}catch(t){throw new Error(F("domError")+" \n"+t.toString())}}return Ot=!0,n(),!0},O=function(){return yt.html5Only?(P(),!1):!mt&&(yt.url?((mt=yt.getMovie(yt.id))||(It?(Gt?yt.oMC.innerHTML=Tt:yt.oMC.appendChild(It),It=null,Ot=!0):P(yt.id,yt.url),mt=yt.getMovie(yt.id)),"function"==typeof yt.oninitmovie&&setTimeout(yt.oninitmovie,1),ft(),!0):(h("noURL"),!1))},A=function(){setTimeout(b,1e3)},w=function(){o.setTimeout((function(){Y(At+"useFlashBlock is false, 100% HTML5 mode is possible. Rebooting with preferFlash: false..."),yt.setup({preferFlash:!1}).reboot(),yt.didFlashBlock=!0,yt.beginDelayedInit()}),1)},b=function(){var t,e=!1;yt.url&&(qt||(qt=!0,it.remove(o,"load",A),st&&te&&!$t?h("waitFocus"):(xt||(t=yt.getMoviePercent())>0&&t<100&&(e=!0),setTimeout((function(){if(t=yt.getMoviePercent(),e)return qt=!1,yt._wD(F("waitSWF")),void o.setTimeout(A,1);xt||(yt._wD(gt+": No Flash response within expected time. Likely causes: "+(0===t?"SWF load failed, ":"")+"Flash blocked or JS-Flash security error."+(yt.debugFlash?" "+F("checkSWF"):""),2),!oe&&t&&(h("localFail",2),yt.debugFlash||h("tryDebug",2)),0===t&&yt._wD(F("swf404",yt.url),1),c("flashtojs",!1,": Timed out"+(oe?" (Check flash security or flash blockers)":" (No plugin/missing SWF?)"))),!xt&&ee&&(null===t?yt.useFlashBlock||0===yt.flashLoadTimeout?(yt.useFlashBlock&&C(),h("waitForever")):!yt.useFlashBlock&&W?w():(h("waitForever"),m({type:"ontimeout",ignoreInit:!0,error:{type:"INIT_FLASHBLOCK"}})):0===yt.flashLoadTimeout?h("waitForever"):!yt.useFlashBlock&&W?w():R(!0))}),yt.flashLoadTimeout))))},k=function(){function t(){it.remove(o,"focus",k)}return $t||!te?(t(),!0):(ee=!0,$t=!0,h("gotFocus"),qt=!1,A(),t(),!0)},ft=function(){Ct.length&&(yt._wD("SoundManager 2: "+Ct.join(" "),1),Ct=[])},ht=function(){ft();var t,e=[];if(yt.useHTML5Audio&&yt.hasHTML5){for(t in yt.audioFormats)yt.audioFormats.hasOwnProperty(t)&&e.push(t+" = "+yt.html5[t]+(!yt.html5[t]&&jt&&yt.flash[t]?" (using flash)":yt.preferFlash&&yt.flash[t]&&jt?" (preferring flash)":yt.html5[t]?"":" ("+(yt.audioFormats[t].required?"required, ":"")+"and no flash support)"));yt._wD("SoundManager 2 HTML5 support: "+e.join(", "),1)}},f=function(t){if(xt)return!1;if(yt.html5Only)return h("sm2Loaded",1),xt=!0,g(),c("onload",!0),!0;var e,n=!0;return yt.useFlashBlock&&yt.flashLoadTimeout&&!yt.getMoviePercent()||(xt=!0),e={type:!st&&jt?"NO_FLASH":"INIT_TIMEOUT"},yt._wD("SoundManager 2 "+(Lt?"failed to load":"loaded")+" ("+(Lt?"Flash security/load error":"OK")+") "+String.fromCharCode(Lt?10006:10003),Lt?2:1),Lt||t?(yt.useFlashBlock&&yt.oMC&&(yt.oMC.className=j()+" "+(null===yt.getMoviePercent()?B.swfTimedout:B.swfError)),m({type:"ontimeout",error:e,ignoreInit:!0}),c("onload",!1),E(e),n=!1):c("onload",!0),Lt||(yt.waitForWindowLoad&&!Mt?(h("waitOnload"),it.add(o,"load",g)):(yt.waitForWindowLoad&&Mt&&h("docLoaded"),g())),n},s=function(){var t,e=yt.setupOptions;for(t in e)e.hasOwnProperty(t)&&(yt[t]===i?yt[t]=e[t]:yt[t]!==e[t]&&(yt.setupOptions[t]=yt[t]))},u=function(){if(xt)return h("didInit"),!1;function t(){it.remove(o,"load",yt.beginDelayedInit)}if(yt.html5Only)return xt||(t(),yt.enabled=!0,f()),!0;O();try{mt._externalInterfaceTest(!1),I(!0,yt.flashPollingInterval||(yt.useHighPerformance?10:50)),yt.debugMode||mt._disableDebug(),yt.enabled=!0,c("jstoflash",!0),yt.html5Only||it.add(o,"unload",a)}catch(t){return yt._wD("js/flash exception: "+t.toString()),c("jstoflash",!1),E({type:"JS_TO_FLASH_EXCEPTION",fatal:!0}),R(!0),f(),!1}return f(),t(),!0},S=function(){return!L&&(L=!0,s(),T(),!st&&yt.hasHTML5&&(yt._wD("SoundManager 2: No Flash detected"+(yt.useHTML5Audio?". Trying HTML5-only mode.":", enabling HTML5."),1),yt.setup({useHTML5Audio:!0,preferFlash:!1})),ot(),!st&&jt&&(Ct.push(V.needFlash),yt.setup({flashLoadTimeout:1})),_t.removeEventListener&&_t.removeEventListener("DOMContentLoaded",S,!1),O(),!0)},rt=function(){return"complete"===_t.readyState&&(S(),_t.detachEvent("onreadystatechange",rt)),!0},x=function(){Mt=!0,S(),it.remove(o,"load",x)},ut(),it.add(o,"focus",k),it.add(o,"load",A),it.add(o,"load",x),_t.addEventListener?_t.addEventListener("DOMContentLoaded",S,!1):_t.attachEvent?_t.attachEvent("onreadystatechange",rt):(c("onload",!1),E({type:"NO_DOM2_EVENTS",fatal:!0}))}o.SM2_DEFER!==i&&SM2_DEFER||(a=new s),t&&"object"==typeof t.exports?(t.exports.SoundManager=s,t.exports.soundManager=a):void 0===(r=function(){return{constructor:s,getInstance:function(t){if(!o.soundManager&&t instanceof Function){var e=t(s);e instanceof s&&(o.soundManager=e)}return o.soundManager}}}.call(e,n,e,t))||(t.exports=r),o.SoundManager=s,o.soundManager=a}(window)}},function(t){t(t.s=4025)}]);
|
2
|
+
(self.webpackChunk_internetarchive_bookreader=self.webpackChunk_internetarchive_bookreader||[]).push([[34],{4025:function(t,e,n){"use strict";n(4916),n(1539),n(9714),n(4723),n(9826),n(2222),n(9600),n(1249),n(8309),n(2707),n(7327),n(6755),n(4678),n(9720),n(4747),n(8674),n(2526),n(1817),n(2165),n(6992),n(8783),n(3948),n(2443),n(3680),n(3706),n(2703),n(489),n(5069),n(7042),n(1038),n(6649),n(6078),n(9653),n(2419),n(4819),n(5003),n(5306),n(9601);var r=n(5311);function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}function i(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,s=[],u=!0,l=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(s.push(r.value),s.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(t,e)||function(t,e){if(t){if("string"==typeof t)return a(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?a(t,e):void 0}}(t,e)||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 a(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function s(){s=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",l=i.toStringTag||"@@toStringTag";function c(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,n){return t[e]=n}}function h(t,e,n,o){var i=e&&e.prototype instanceof p?e:p,a=Object.create(i.prototype),s=new x(o||[]);return r(a,"_invoke",{value:k(t,n,s)}),a}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=h;var d={};function p(){}function y(){}function v(){}var m={};c(m,a,(function(){return this}));var g=Object.getPrototypeOf,A=g&&g(g(L([])));A&&A!==e&&n.call(A,a)&&(m=A);var b=v.prototype=p.prototype=Object.create(m);function w(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function _(t,e){function i(r,a,s,u){var l=f(t[r],t,a);if("throw"!==l.type){var c=l.arg,h=c.value;return h&&"object"==o(h)&&n.call(h,"__await")?e.resolve(h.__await).then((function(t){i("next",t,s,u)}),(function(t){i("throw",t,s,u)})):e.resolve(h).then((function(t){c.value=t,s(c)}),(function(t){return i("throw",t,s,u)}))}u(l.arg)}var a;r(this,"_invoke",{value:function(t,n){function r(){return new e((function(e,r){i(t,n,e,r)}))}return a=a?a.then(r,r):r()}})}function k(t,e,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return{value:void 0,done:!0}}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var s=V(a,n);if(s){if(s===d)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var u=f(t,e,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===d)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}function V(t,e){var n=e.method,r=t.iterator[n];if(void 0===r)return e.delegate=null,"throw"===n&&t.iterator.return&&(e.method="return",e.arg=void 0,V(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),d;var o=f(r,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,d;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,d):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,d)}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function S(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function x(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function L(t){if(t){var e=t[a];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:M}}function M(){return{value:void 0,done:!0}}return y.prototype=v,r(b,"constructor",{value:v,configurable:!0}),r(v,"constructor",{value:y,configurable:!0}),y.displayName=c(v,l,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===y||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,c(t,l,"GeneratorFunction")),t.prototype=Object.create(b),t},t.awrap=function(t){return{__await:t}},w(_.prototype),c(_.prototype,u,(function(){return this})),t.AsyncIterator=_,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new _(h(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},w(b),c(b,l,"Generator"),c(b,a,(function(){return this})),c(b,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},t.values=L,x.prototype={constructor:x,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(S),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(n,r){return a.type="throw",a.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var s=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,d):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),d},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),S(n),d}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;S(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:L(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),d}},t}function u(t,e,n,r,o,i,a){try{var s=t[i](a),u=s.value}catch(t){return void n(t)}s.done?e(u):Promise.resolve(u).then(r,o)}function l(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,i=function(t,e){if("object"!==o(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==o(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===o(i)?i:String(i)),r)}var i}var c=function(){function t(e,n,r,o){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.leafIndex=e,this.chunkIndex=n,this.text=r,this.lineRects=o}var e,n,o,a;return e=t,null,n=[{key:"fetch",value:(o=s().mark((function e(n,o,i){var a;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r.ajax({type:"GET",url:"https://".concat(n,"/BookReader/BookReaderGetTextWrapper.php"),dataType:"jsonp",cache:!0,data:{path:"".concat(o,"_djvu.xml"),page:i}});case 2:return a=e.sent,e.abrupt("return",t._fromTextWrapperResponse(i,a));case 4:case"end":return e.stop()}}),e)})),a=function(){var t=this,e=arguments;return new Promise((function(n,r){var i=o.apply(t,e);function a(t){u(i,n,r,a,s,"next",t)}function s(t){u(i,n,r,a,s,"throw",t)}a(void 0)}))},function(t,e,n){return a.apply(this,arguments)})},{key:"_fromTextWrapperResponse",value:function(e,n){return n.map((function(n,r){var o=t._fixChunkRects(n.slice(1)),i=t._removeDanglingHyphens(n[0]);return new t(e,r,i,o)}))}},{key:"_fixChunkRects",value:function(t){if(t.length<2)return t;var e=i(t,2),n=e[0],r=e[1],o=i(n,3),a=o[0],s=o[1],u=o[2]-a,l=r[1]-r[3],c=r[2]-r[0],h=r[2];return u>30*c&&(n[2]=h,n[3]=s-l),t}},{key:"_removeDanglingHyphens",value:function(t){return t.replace(/[-¬]\s+/g,"")}}],n&&l(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function h(t){return h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},h(t)}function f(){f=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,n){return t[e]=n}}function l(t,e,n,o){var i=e&&e.prototype instanceof p?e:p,a=Object.create(i.prototype),s=new x(o||[]);return r(a,"_invoke",{value:k(t,n,s)}),a}function c(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=l;var d={};function p(){}function y(){}function v(){}var m={};u(m,i,(function(){return this}));var g=Object.getPrototypeOf,A=g&&g(g(L([])));A&&A!==e&&n.call(A,i)&&(m=A);var b=v.prototype=p.prototype=Object.create(m);function w(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function _(t,e){function o(r,i,a,s){var u=c(t[r],t,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==h(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,a,s)}),(function(t){o("throw",t,a,s)})):e.resolve(f).then((function(t){l.value=t,a(l)}),(function(t){return o("throw",t,a,s)}))}s(u.arg)}var i;r(this,"_invoke",{value:function(t,n){function r(){return new e((function(e,r){o(t,n,e,r)}))}return i=i?i.then(r,r):r()}})}function k(t,e,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return{value:void 0,done:!0}}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var s=V(a,n);if(s){if(s===d)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var u=c(t,e,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===d)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}function V(t,e){var n=e.method,r=t.iterator[n];if(void 0===r)return e.delegate=null,"throw"===n&&t.iterator.return&&(e.method="return",e.arg=void 0,V(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),d;var o=c(r,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,d;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,d):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,d)}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function S(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function x(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function L(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:M}}function M(){return{value:void 0,done:!0}}return y.prototype=v,r(b,"constructor",{value:v,configurable:!0}),r(v,"constructor",{value:y,configurable:!0}),y.displayName=u(v,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===y||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,u(t,s,"GeneratorFunction")),t.prototype=Object.create(b),t},t.awrap=function(t){return{__await:t}},w(_.prototype),u(_.prototype,a,(function(){return this})),t.AsyncIterator=_,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new _(l(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},w(b),u(b,s,"Generator"),u(b,i,(function(){return this})),u(b,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},t.values=L,x.prototype={constructor:x,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(S),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(n,r){return a.type="throw",a.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var s=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,d):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),d},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),S(n),d}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;S(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:L(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),d}},t}function d(t,e,n,r,o,i,a){try{var s=t[i](a),u=s.value}catch(t){return void n(t)}s.done?e(u):Promise.resolve(u).then(r,o)}function p(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==h(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==h(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===h(o)?o:String(o)),r)}var o}var y=function(){function t(e,n,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.pageCount=e,this.opts=Object.assign({},v,r),this._cursor={page:n,chunk:0},this._bufferedPages={},this._bufferingPages={},this._cursorLock=Promise.resolve()}var e,n,r,o;return e=t,n=[{key:"next",value:function(){var t=this;return this._cursorLock=this._cursorLock.then((function(){return t._nextUncontrolled()}))}},{key:"decrement",value:function(){var t=this;return this._cursorLock=this._cursorLock.then((function(){return t._decrementUncontrolled()}))}},{key:"_nextUncontrolled",value:(r=f().mark((function e(){var n;return f().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._cursor.page!=this.pageCount){e.next=2;break}return e.abrupt("return",Promise.resolve(t.AT_END));case 2:return this._recenterBuffer(this._cursor.page),e.next=5,this._fetchPageChunks(this._cursor.page);case 5:if(n=e.sent,this._cursor.chunk!=n.length){e.next=10;break}return this._cursor.page++,this._cursor.chunk=0,e.abrupt("return",this._nextUncontrolled());case 10:return e.abrupt("return",n[this._cursor.chunk++]);case 11:case"end":return e.stop()}}),e,this)})),o=function(){var t=this,e=arguments;return new Promise((function(n,o){var i=r.apply(t,e);function a(t){d(i,n,o,a,s,"next",t)}function s(t){d(i,n,o,a,s,"throw",t)}a(void 0)}))},function(){return o.apply(this,arguments)})},{key:"_decrementUncontrolled",value:function(){var t=this,e=Promise.resolve();return this._cursor.chunk>0?this._cursor.chunk--:this._cursor.page>0&&(this._cursor.page--,e=this._fetchPageChunks(this._cursor.page).then((function(e){if(0==e.length)return t._decrementUncontrolled();t._cursor.chunk=e.length-1}))),e.then((function(){return t._fetchPageChunks(t._cursor.page)}))}},{key:"_recenterBuffer",value:function(t){for(var e=Math.max(0,t-this.opts.pageBufferSize),n=Math.min(this.pageCount,t+this.opts.pageBufferSize+1),r=e;r<n;r++)this._fetchPageChunks(r);this._removePageFromBuffer(e-1),this._removePageFromBuffer(n+1)}},{key:"_removePageFromBuffer",value:function(t){delete this._bufferingPages[t],delete this._bufferedPages[t]}},{key:"_fetchPageChunks",value:function(t){var e=this;return t in this._bufferingPages?this._bufferingPages[t]:t in this._bufferedPages?Promise.resolve(this._bufferedPages[t]):(this._bufferingPages[t]=this._fetchPageChunksDirect(t).then((function(n){return delete e._bufferingPages[t],e._bufferedPages[t]=n,n})),this._bufferingPages[t])}},{key:"_fetchPageChunksDirect",value:function(t){return c.fetch(this.opts.server,this.opts.bookPath,t)}}],n&&p(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();y.AT_END="__PageChunkIterator.AT_END__";var v={server:null,bookPath:null,pageBufferSize:2},m=n(5311);function g(t){return g="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},g(t)}function A(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function b(){b=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,n){return t[e]=n}}function l(t,e,n,o){var i=e&&e.prototype instanceof f?e:f,a=Object.create(i.prototype),s=new x(o||[]);return r(a,"_invoke",{value:k(t,n,s)}),a}function c(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=l;var h={};function f(){}function d(){}function p(){}var y={};u(y,i,(function(){return this}));var v=Object.getPrototypeOf,m=v&&v(v(L([])));m&&m!==e&&n.call(m,i)&&(y=m);var A=p.prototype=f.prototype=Object.create(y);function w(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function _(t,e){function o(r,i,a,s){var u=c(t[r],t,i);if("throw"!==u.type){var l=u.arg,h=l.value;return h&&"object"==g(h)&&n.call(h,"__await")?e.resolve(h.__await).then((function(t){o("next",t,a,s)}),(function(t){o("throw",t,a,s)})):e.resolve(h).then((function(t){l.value=t,a(l)}),(function(t){return o("throw",t,a,s)}))}s(u.arg)}var i;r(this,"_invoke",{value:function(t,n){function r(){return new e((function(e,r){o(t,n,e,r)}))}return i=i?i.then(r,r):r()}})}function k(t,e,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return{value:void 0,done:!0}}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var s=V(a,n);if(s){if(s===h)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var u=c(t,e,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===h)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}function V(t,e){var n=e.method,r=t.iterator[n];if(void 0===r)return e.delegate=null,"throw"===n&&t.iterator.return&&(e.method="return",e.arg=void 0,V(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),h;var o=c(r,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,h;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,h):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,h)}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function S(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function x(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function L(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:M}}function M(){return{value:void 0,done:!0}}return d.prototype=p,r(A,"constructor",{value:p,configurable:!0}),r(p,"constructor",{value:d,configurable:!0}),d.displayName=u(p,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===d||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,u(t,s,"GeneratorFunction")),t.prototype=Object.create(A),t},t.awrap=function(t){return{__await:t}},w(_.prototype),u(_.prototype,a,(function(){return this})),t.AsyncIterator=_,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new _(l(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},w(A),u(A,s,"Generator"),u(A,i,(function(){return this})),u(A,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},t.values=L,x.prototype={constructor:x,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(S),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(n,r){return a.type="throw",a.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var s=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,h):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),h},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),S(n),h}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;S(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:L(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),h}},t}function w(t,e,n,r,o,i,a){try{var s=t[i](a),u=s.value}catch(t){return void n(t)}s.done?e(u):Promise.resolve(u).then(r,o)}function _(t){return function(){var e=this,n=arguments;return new Promise((function(r,o){var i=t.apply(e,n);function a(t){w(i,r,o,a,s,"next",t)}function s(t){w(i,r,o,a,s,"throw",t)}a(void 0)}))}}function k(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,V(r.key),r)}}function V(t){var e=function(t,e){if("object"!==g(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==g(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"===g(e)?e:String(e)}var O=function(){function t(e){var n,r,o,i=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),n=this,o=function(){i.voice=t.getBestBookVoice(i.getVoices(),i.opts.bookLanguage)},(r=V(r="updateBestVoice"))in n?Object.defineProperty(n,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[r]=o,this.playing=!1,this.paused=!1,this.opts=e,this._chunkIterator=null,this.activeSound=null,this.playbackRate=1,this.events=m({}),this.voice=null,this.events.on("voiceschanged",this.updateBestVoice),this.events.trigger("voiceschanged")}var e,n,r,o,i;return e=t,n=[{key:"getVoices",value:function(){throw new Error("Unimplemented abstract class")}},{key:"init",value:function(){return null}},{key:"start",value:function(t,e){this.playing=!0,this.opts.onLoadingStart(),this._chunkIterator=new y(e,t,{server:this.opts.server,bookPath:this.opts.bookPath,pageBufferSize:5}),this.step(),this.events.trigger("start")}},{key:"stop",value:function(){this.activeSound&&this.activeSound.stop(),this.playing=!1,this._chunkIterator=null,this.activeSound=null,this.events.trigger("stop")}},{key:"pause",value:function(){var t=!this.paused&&this.activeSound;this.paused=!0,this.activeSound&&this.activeSound.pause(),t&&this.events.trigger("pause")}},{key:"resume",value:function(){var t=this.paused&&this.activeSound;this.paused=!1,this.activeSound&&this.activeSound.resume(),t&&this.events.trigger("resume")}},{key:"togglePlayPause",value:function(){this.paused?this.resume():this.pause()}},{key:"jumpForward",value:function(){this.activeSound&&this.activeSound.finish()}},{key:"jumpBackward",value:(i=_(b().mark((function t(){var e=this;return b().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Promise.all([this.activeSound.stop(),this._chunkIterator.decrement().then((function(){return e._chunkIterator.decrement()}))]);case 2:this.step();case 3:case"end":return t.stop()}}),t,this)}))),function(){return i.apply(this,arguments)})},{key:"setVoice",value:function(t){this.events.off("voiceschanged",this.updateBestVoice),this.voice=this.getVoices().find((function(e){return e.voiceURI===t})),this.activeSound&&this.activeSound.setVoice(this.voice)}},{key:"setPlaybackRate",value:function(t){this.playbackRate=t,this.activeSound&&this.activeSound.setPlaybackRate(t)}},{key:"step",value:(o=_(b().mark((function t(){var e,n,r,o=this;return b().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this._chunkIterator.next();case 2:if((e=t.sent)!=y.AT_END){t.next=7;break}return this.stop(),this.opts.onDone(),t.abrupt("return");case 7:return this.opts.onLoadingStart(),(n=this.createSound(e)).chunk=e,n.rate=this.playbackRate,n.voice=this.voice,n.load((function(){return o.opts.onLoadingComplete()})),this.opts.onLoadingComplete(),t.next=16,this.opts.beforeChunkPlay(e);case 16:if(this.playing){t.next=18;break}return t.abrupt("return");case 18:return t.next=20,this.playSound(n).then((function(){return o.opts.afterChunkPlay(n.chunk)}));case 20:return r=t.sent,this.paused&&this.pause(),t.next=24,r;case 24:if(!this.playing){t.next=26;break}return t.abrupt("return",this.step());case 26:case"end":return t.stop()}}),t,this)}))),function(){return o.apply(this,arguments)})},{key:"createSound",value:function(t){throw new Error("Unimplemented abstract class")}},{key:"playSound",value:function(t){return this.activeSound=t,this.activeSound.loaded||this.opts.onLoadingStart(),this.activeSound.play()}},{key:"getBestVoice",value:function(){return t.getBestBookVoice(this.getVoices(),this.opts.bookLanguage)}}],r=[{key:"isSupported",value:function(){throw new Error("Unimplemented abstract class")}},{key:"getBestBookVoice",value:function(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:navigator.languages,o=e.filter((function(t){return t.lang.startsWith(n)})),i=(r=r||(navigator.language?[navigator.language]:[])).filter((function(t){return t.startsWith(n)}));return t.getMatchingVoice(i,o)||o.find((function(t){return t.default}))||o[0]||t.getMatchingVoice(r,e)||e.find((function(t){return t.default}))||e[0]}},{key:"getMatchingVoice",value:function(t,e){var n,r=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return A(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?A(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}(t);try{var o=function(){var t=n.value,r=e.filter((function(e){return e.lang.replace("_","-").startsWith(t)}));if(r.length)return{v:r.find((function(t){return t.default}))||r[0]}};for(r.s();!(n=r.n()).done;){var i=o();if("object"===g(i))return i.v}}catch(t){r.e(t)}finally{r.f()}}}],n&&k(e.prototype,n),r&&k(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}(),S=n(5685),x=(n(5529),n(4371),n(5311));function L(t){return L="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},L(t)}function M(){M=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,n){return t[e]=n}}function l(t,e,n,o){var i=e&&e.prototype instanceof f?e:f,a=Object.create(i.prototype),s=new O(o||[]);return r(a,"_invoke",{value:w(t,n,s)}),a}function c(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=l;var h={};function f(){}function d(){}function p(){}var y={};u(y,i,(function(){return this}));var v=Object.getPrototypeOf,m=v&&v(v(S([])));m&&m!==e&&n.call(m,i)&&(y=m);var g=p.prototype=f.prototype=Object.create(y);function A(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function b(t,e){function o(r,i,a,s){var u=c(t[r],t,i);if("throw"!==u.type){var l=u.arg,h=l.value;return h&&"object"==L(h)&&n.call(h,"__await")?e.resolve(h.__await).then((function(t){o("next",t,a,s)}),(function(t){o("throw",t,a,s)})):e.resolve(h).then((function(t){l.value=t,a(l)}),(function(t){return o("throw",t,a,s)}))}s(u.arg)}var i;r(this,"_invoke",{value:function(t,n){function r(){return new e((function(e,r){o(t,n,e,r)}))}return i=i?i.then(r,r):r()}})}function w(t,e,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return{value:void 0,done:!0}}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var s=_(a,n);if(s){if(s===h)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var u=c(t,e,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===h)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}function _(t,e){var n=e.method,r=t.iterator[n];if(void 0===r)return e.delegate=null,"throw"===n&&t.iterator.return&&(e.method="return",e.arg=void 0,_(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),h;var o=c(r,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,h;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,h):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,h)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function V(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function O(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function S(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:x}}function x(){return{value:void 0,done:!0}}return d.prototype=p,r(g,"constructor",{value:p,configurable:!0}),r(p,"constructor",{value:d,configurable:!0}),d.displayName=u(p,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===d||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,u(t,s,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},A(b.prototype),u(b.prototype,a,(function(){return this})),t.AsyncIterator=b,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new b(l(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},A(g),u(g,s,"Generator"),u(g,i,(function(){return this})),u(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},t.values=S,O.prototype={constructor:O,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(V),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(n,r){return a.type="throw",a.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var s=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,h):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),h},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),V(n),h}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;V(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:S(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),h}},t}function P(t,e,n,r,o,i,a){try{var s=t[i](a),u=s.value}catch(t){return void n(t)}s.done?e(u):Promise.resolve(u).then(r,o)}function E(t){return function(){var e=this,n=arguments;return new Promise((function(r,o){var i=t.apply(e,n);function a(t){P(i,r,o,a,s,"next",t)}function s(t){P(i,r,o,a,s,"throw",t)}a(void 0)}))}}function I(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function T(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==L(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==L(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===L(o)?o:String(o)),r)}var o}function q(t,e,n){return e&&T(t.prototype,e),n&&T(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function R(){return R="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=F(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},R.apply(this,arguments)}function D(t,e){return D=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},D(t,e)}function F(t){return F=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},F(t)}var C=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&D(t,e)}(i,t);var e,n,r,o=(n=i,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=F(n);if(r){var o=F(this).constructor;t=Reflect.construct(e,arguments,o)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===L(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function i(t){var e,n;return I(this,i),(n=o.call(this,t)).audioFormat=null!==(e=x.browser)&&void 0!==e&&e.mozilla?"ogg":"mp3",n}return q(i,[{key:"getVoices",value:function(){return[{default:!0,lang:"en-US",localService:!1,name:"Festival - English (US)",voiceURI:null}]}},{key:"init",value:function(){soundManager.setup({debugMode:!1,preferFlash:!0,url:"/bookreader/BookReader/soundmanager/swf",useHTML5Audio:!0,flashVersion:9})}},{key:"start",value:function(t,e){var n=this,r=null;navigator.userAgent.match(/mobile/i)&&(r=this.iOSCaptureUserIntentHack()),(r=r||Promise.resolve()).then((function(){return R(F(i.prototype),"start",n).call(n,t,e)}))}},{key:"createSound",value:function(t){return new j(this.getSoundUrl(t.text))}},{key:"getSoundUrl",value:function(t){return"https://"+this.opts.server+"/BookReader/BookReaderGetTTS.php?string="+encodeURIComponent(t)+"&format=."+this.audioFormat}},{key:"iOSCaptureUserIntentHack",value:(e=E(M().mark((function t(){var e;return M().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=soundManager.createSound({url:B[this.audioFormat]}),t.next=3,new Promise((function(t){return e.play({onfinish:t})}));case 3:e.destruct();case 4:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})}],[{key:"isSupported",value:function(){return"undefined"!=typeof soundManager&&soundManager.supported()}}]),i}(O),j=function(){function t(e){I(this,t),this.soundUrl=e,this.sound=null,this.rate=1,this._finishResolver=null}var e;return q(t,[{key:"loaded",get:function(){return this.sound&&this.sound.loaded}},{key:"load",value:function(t){var e,n=this;return this.sound=soundManager.createSound({url:this.soundUrl,onload:function(){1!=n.rate&&n.sound.setPlaybackRate(n.rate),t()},onresume:(e=E(M().mark((function t(){return M().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,(0,S.sleep)(25);case 2:1!=n.rate&&n.sound.setPlaybackRate(n.rate);case 3:case"end":return t.stop()}}),t)}))),function(){return e.apply(this,arguments)})}),this.sound.load()}},{key:"play",value:(e=E(M().mark((function t(){var e=this;return M().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,new Promise((function(t){e._finishResolver=t,e.sound.play({onfinish:t})}));case 2:this.sound.destruct();case 3:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"stop",value:function(){return this.sound.stop(),Promise.resolve()}},{key:"pause",value:function(){this.sound.pause()}},{key:"resume",value:function(){this.sound.resume()}},{key:"setPlaybackRate",value:function(t){this.rate=t,this.sound.setPlaybackRate(t)}},{key:"finish",value:function(){this.sound.stop(),this._finishResolver()}}]),t}(),B={mp3:"data:audio/mp3;base64,//uQxAAAAAAAAAAAAAAAAAAAAAAAWGluZwAAAA8AAAACAAACcQCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA//////////////////////////////////////////////////////////////////8AAAAeTEFNRTMuOTlyBJwAAAAAAAAAADUgJA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GEUEoppZRSSikhhBJKKaWUUkoppQAAgAMHAIAAI+gko8oibDThwgNQaMhKAIAMAABx2GrrKdbIIMWchJZLhJByEGIuEVKKOUexZUgZxRjVlDGlFFNSa+icYoxRT51jSjHDrJRWSiiRgtJyrLV2zAEAACAIADAQITOBQAEUGMgAgAOEBCkAoLDA0DFcBATkEjIKDArHhHPSaQMAEITIDJGIWAwSE6qBomI6AFhcYMgHgAyNjbSLC+gywAVd3HUghCAEIYjFARSQgIMTbnjiDU+4wQk6RaUOAgAAAAAAAQAeAACSDSAiIpo5jg6PD5AQkRGSEpMTlAAAAAAA4AGADwCAJAWIiIhmjqPD4wMkRGSEpMTkBCUAAAAAAAAAAAAICAgAAAAAAAQAAAAICE9nZ1MABCwAAAAAAAAAFRIAAAIAAAAPBTD1AgEBAAo="};function N(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:navigator.userAgent,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:navigator.vendor;return/chrome/i.test(t)&&/google inc/i.test(e)}function U(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:navigator.userAgent;return/firefox/i.test(t)}var H=n(1030);function Y(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:navigator.userAgent;return/android/i.test(t)}var Q={Name:0,Endonym:1,"ISO 639-1":2,"ISO 639-2/T":3,"ISO 639-2/B":4};function G(t,e){for(var n=0;n<H.Z.length;n++)for(var r=0;r<e.length;r++){var o=e[r];if(-1!=H.Z[n][Q[o]].split(", ").map((function(t){return t.toLowerCase()})).indexOf(t))return H.Z[n][Q["ISO 639-1"]]}return null}function z(t){return z="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},z(t)}function K(){K=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,n){return t[e]=n}}function l(t,e,n,o){var i=e&&e.prototype instanceof f?e:f,a=Object.create(i.prototype),s=new O(o||[]);return r(a,"_invoke",{value:w(t,n,s)}),a}function c(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=l;var h={};function f(){}function d(){}function p(){}var y={};u(y,i,(function(){return this}));var v=Object.getPrototypeOf,m=v&&v(v(S([])));m&&m!==e&&n.call(m,i)&&(y=m);var g=p.prototype=f.prototype=Object.create(y);function A(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function b(t,e){function o(r,i,a,s){var u=c(t[r],t,i);if("throw"!==u.type){var l=u.arg,h=l.value;return h&&"object"==z(h)&&n.call(h,"__await")?e.resolve(h.__await).then((function(t){o("next",t,a,s)}),(function(t){o("throw",t,a,s)})):e.resolve(h).then((function(t){l.value=t,a(l)}),(function(t){return o("throw",t,a,s)}))}s(u.arg)}var i;r(this,"_invoke",{value:function(t,n){function r(){return new e((function(e,r){o(t,n,e,r)}))}return i=i?i.then(r,r):r()}})}function w(t,e,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return{value:void 0,done:!0}}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var s=_(a,n);if(s){if(s===h)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var u=c(t,e,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===h)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}function _(t,e){var n=e.method,r=t.iterator[n];if(void 0===r)return e.delegate=null,"throw"===n&&t.iterator.return&&(e.method="return",e.arg=void 0,_(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),h;var o=c(r,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,h;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,h):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,h)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function V(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function O(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function S(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:x}}function x(){return{value:void 0,done:!0}}return d.prototype=p,r(g,"constructor",{value:p,configurable:!0}),r(p,"constructor",{value:d,configurable:!0}),d.displayName=u(p,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===d||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,u(t,s,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},A(b.prototype),u(b.prototype,a,(function(){return this})),t.AsyncIterator=b,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new b(l(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},A(g),u(g,s,"Generator"),u(g,i,(function(){return this})),u(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},t.values=S,O.prototype={constructor:O,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(V),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(n,r){return a.type="throw",a.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var s=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,h):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),h},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),V(n),h}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;V(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:S(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),h}},t}function Z(t,e,n,r,o,i,a){try{var s=t[i](a),u=s.value}catch(t){return void n(t)}s.done?e(u):Promise.resolve(u).then(r,o)}function W(t){return function(){var e=this,n=arguments;return new Promise((function(r,o){var i=t.apply(e,n);function a(t){Z(i,r,o,a,s,"next",t)}function s(t){Z(i,r,o,a,s,"throw",t)}a(void 0)}))}}function X(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function J(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==z(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==z(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===z(o)?o:String(o)),r)}var o}function $(t,e,n){return e&&J(t.prototype,e),n&&J(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function tt(){return tt="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=nt(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},tt.apply(this,arguments)}function et(t,e){return et=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},et(t,e)}function nt(t){return nt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},nt(t)}var rt,ot=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&et(t,e)}(o,t);var e,n,r=(e=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=nt(e);if(n){var o=nt(this).constructor;t=Reflect.construct(r,arguments,o)}else t=r.apply(this,arguments);return function(t,e){if(e&&("object"===z(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function o(t){var e;return X(this,o),e=r.call(this,t),speechSynthesis.addEventListener&&speechSynthesis.addEventListener("voiceschanged",(function(){return e.events.trigger("voiceschanged")})),e}return $(o,[{key:"start",value:function(t,e){var n=this;if("mediaSession"in navigator){var r=new Audio(at);r.loop=!0,this.events.on("pause",(function(){return r.pause()})),this.events.on("resume",(function(){return r.play()})),this.events.on("stop",(function(){return r.src=""})),r.play().then((function(){navigator.mediaSession.metadata=new MediaMetadata({title:br.bookTitle,artist:br.options.metadata.filter((function(t){return"Author"==t.label})).map((function(t){return t.value}))[0],artwork:[{src:br.options.thumbnail,type:"image/jpg"}]}),navigator.mediaSession.setActionHandler("play",(function(){r.play(),n.resume()})),navigator.mediaSession.setActionHandler("pause",(function(){r.pause(),n.pause()})),navigator.mediaSession.setActionHandler("previoustrack",(function(){return n.jumpBackward()})),navigator.mediaSession.setActionHandler("nexttrack",(function(){return n.jumpForward()}))}))}return tt(nt(o.prototype),"start",this).call(this,t,e)}},{key:"getVoices",value:function(){var t=speechSynthesis.getVoices();return 1!=t.filter((function(t){return t.default})).length&&t.unshift({voiceURI:"bookreader.SystemDefault",name:"System Default",lang:navigator.language,default:!0,localService:!0}),t}},{key:"createSound",value:function(t){return new it(t.text)}}],[{key:"isSupported",value:function(){return void 0!==window.speechSynthesis&&!/samsungbrowser/i.test(navigator.userAgent)}}]),o}(O),it=function(){function t(e){X(this,t),this.text=e,this.loaded=!1,this.paused=!1,this.started=!1,this.stopped=!1,this.rate=1,this.utterance=null,this.voice=null,this._lastEvents={pause:null,boundary:null,start:null},this._charIndex=0,this._finishResolver=null,this._finishPromise=null}var e,n,r,o,i;return $(t,[{key:"load",value:function(t){var e,n=this;this.loaded=!1,this.started=!1,this.utterance=new SpeechSynthesisUtterance(this.text.slice(this._charIndex)),"bookreader.SystemDefault"!==(null===(e=this.voice)||void 0===e?void 0:e.voiceURI)&&(this.utterance.voice=this.voice),this.voice&&(this.utterance.lang=this.voice.lang),this.utterance.rate=this.rate,-1!=location.toString().indexOf("_debugReadAloud=true")&&(this.utterance.addEventListener("pause",(function(){return console.log("pause")})),this.utterance.addEventListener("resume",(function(){return console.log("resume")})),this.utterance.addEventListener("start",(function(){return console.log("start")})),this.utterance.addEventListener("end",(function(){return console.log("end")})),this.utterance.addEventListener("error",(function(){return console.log("error")})),this.utterance.addEventListener("boundary",(function(){return console.log("boundary")})),this.utterance.addEventListener("mark",(function(){return console.log("mark")})),this.utterance.addEventListener("finish",(function(){return console.log("finish")}))),this.utterance.addEventListener("start",(function(t){return n._lastEvents.start=t})),this.utterance.addEventListener("boundary",(function(t){return n._lastEvents.boundary=t})),this.utterance.addEventListener("pause",(function(t){return n._lastEvents.pause=t})),this.utterance.addEventListener("start",(function(){n.started=!0,n.stopped=!1,n.paused=!1})),this.utterance.addEventListener("pause",(function(){return n.paused=!0})),this.utterance.addEventListener("resume",(function(){return n.paused=!1})),this.utterance.addEventListener("end",(function(t){n.paused||n.stopped||n.utterance.dispatchEvent(new CustomEvent("finish",t))})),this.loaded=!0,t&&t()}},{key:"reload",value:(i=W(K().mark((function t(){var e,n;return K().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=this.paused,(n=this._lastEvents.boundary||this._lastEvents.pause)&&(this._charIndex=this.text.indexOf(n.target.text)+n.charIndex),t.next=5,this.stop();case 5:this.load(),e||this.play();case 7:case"end":return t.stop()}}),t,this)}))),function(){return i.apply(this,arguments)})},{key:"play",value:function(){var t=this;this._finishPromise=this._finishPromise||new Promise((function(e){return t._finishResolver=e})),this.utterance.addEventListener("finish",this._finishResolver),speechSynthesis.cancel(),speechSynthesis.resume(),speechSynthesis.speak(this.utterance);var e=this.utterance.voice&&this.utterance.voice.localService;return N()&&!e&&this._chromePausingBugFix(),this._finishPromise}},{key:"stop",value:function(){var t=Promise.resolve();return this.stopped||(t=Promise.race([(0,S.promisifyEvent)(this.utterance,"end"),(0,S.promisifyEvent)(this.utterance,"error")])),this.stopped=!0,speechSynthesis.cancel(),t}},{key:"finish",value:(o=W(K().mark((function t(){return K().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.stop();case 2:this.utterance.dispatchEvent(new Event("finish"));case 3:case"end":return t.stop()}}),t,this)}))),function(){return o.apply(this,arguments)})},{key:"pause",value:(r=W(K().mark((function t(){var e,n,r;return K().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this.paused){t.next=2;break}return t.abrupt("return");case 2:if(e=(0,S.promisifyEvent)(this.utterance,"pause"),speechSynthesis.pause(),n=U()&&Y(),!N()&&!n){t.next=15;break}return r=(0,S.sleep)(100).then((function(){return"timeout"})),t.next=10,Promise.race([e,r]);case 10:if("timeout"==t.sent){t.next=13;break}return t.abrupt("return");case 13:this.utterance.dispatchEvent(new CustomEvent("pause",this._lastEvents.start)),n&&this.stop();case 15:case"end":return t.stop()}}),t,this)}))),function(){return r.apply(this,arguments)})},{key:"resume",value:(n=W(K().mark((function t(){var e,n,r;return K().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.started){t.next=3;break}return this.play(),t.abrupt("return");case 3:if(this.paused){t.next=5;break}return t.abrupt("return");case 5:if(e=N()&&Y()||U()&&Y(),n=N()||e,r=(0,S.promisifyEvent)(this.utterance,"resume"),speechSynthesis.resume(),!n){t.next=20;break}return t.next=12,Promise.race([r,(0,S.sleep)(100).then((function(){return"timeout"}))]);case 12:if("timeout"==t.sent){t.next=15;break}return t.abrupt("return");case 15:if(this.utterance.dispatchEvent(new CustomEvent("resume",{})),!e){t.next=20;break}return t.next=19,this.reload();case 19:this.play();case 20:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"setPlaybackRate",value:function(t){this.rate=t,this.reload()}},{key:"setVoice",value:function(t){this.voice=t,this.reload()}},{key:"_chromePausingBugFix",value:(e=W(K().mark((function t(){var e,n,r,o;return K().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=(0,S.sleep)(14e3).then((function(){return"timeout"})),n=(0,S.promisifyEvent)(this.utterance,"pause").then((function(){return"paused"})),r=(0,S.promisifyEvent)(this.utterance,"end").then((function(){return"ended"})),t.next=5,Promise.race([e,n,r]);case 5:o=t.sent,-1!=location.toString().indexOf("_debugReadAloud=true")&&console.log("CHROME-PAUSE-HACK: ".concat(o)),t.t0=o,t.next="ended"===t.t0?10:"paused"===t.t0?11:"timeout"===t.t0?15:21;break;case 10:return t.abrupt("break",21);case 11:return t.next=13,Promise.race([(0,S.promisifyEvent)(this.utterance,"resume"),(0,S.sleep)(14e3).then((function(){return"timeout"}))]);case 13:return"timeout"==o?this.reload():this._chromePausingBugFix(),t.abrupt("break",21);case 15:return speechSynthesis.pause(),t.next=18,(0,S.sleep)(25);case 18:return speechSynthesis.resume(),this._chromePausingBugFix(),t.abrupt("break",21);case 21:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})}]),t}(),at="data:audio/mp3;base64,/+MYxAAMEAISSAhElhIpJYzz1vz9mUdlHvJwTP/n3FJesPxB9/8mp0oGaz9+7+T//8oCDhJqOMqLh4o4uhUAUUDaf//3r+///+MYxAo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OkN614mSAhE31VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV/+MYxOwOwz4hqAiHo1VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV/+MYxOwOG1oOIAgEqFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV/+MYxO4L6AVtkAhEAFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV",st="Read this book aloud",ut=n(9860),lt=n(5311),ct=n(5311);function ht(t){return ht="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ht(t)}function ft(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,s=[],u=!0,l=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(s.push(r.value),s.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(t,e)||function(t,e){if(t){if("string"==typeof t)return dt(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?dt(t,e):void 0}}(t,e)||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 dt(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function pt(){pt=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,n){return t[e]=n}}function l(t,e,n,o){var i=e&&e.prototype instanceof f?e:f,a=Object.create(i.prototype),s=new O(o||[]);return r(a,"_invoke",{value:w(t,n,s)}),a}function c(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=l;var h={};function f(){}function d(){}function p(){}var y={};u(y,i,(function(){return this}));var v=Object.getPrototypeOf,m=v&&v(v(S([])));m&&m!==e&&n.call(m,i)&&(y=m);var g=p.prototype=f.prototype=Object.create(y);function A(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function b(t,e){function o(r,i,a,s){var u=c(t[r],t,i);if("throw"!==u.type){var l=u.arg,h=l.value;return h&&"object"==ht(h)&&n.call(h,"__await")?e.resolve(h.__await).then((function(t){o("next",t,a,s)}),(function(t){o("throw",t,a,s)})):e.resolve(h).then((function(t){l.value=t,a(l)}),(function(t){return o("throw",t,a,s)}))}s(u.arg)}var i;r(this,"_invoke",{value:function(t,n){function r(){return new e((function(e,r){o(t,n,e,r)}))}return i=i?i.then(r,r):r()}})}function w(t,e,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return{value:void 0,done:!0}}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var s=_(a,n);if(s){if(s===h)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var u=c(t,e,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===h)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}function _(t,e){var n=e.method,r=t.iterator[n];if(void 0===r)return e.delegate=null,"throw"===n&&t.iterator.return&&(e.method="return",e.arg=void 0,_(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),h;var o=c(r,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,h;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,h):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,h)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function V(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function O(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function S(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:x}}function x(){return{value:void 0,done:!0}}return d.prototype=p,r(g,"constructor",{value:p,configurable:!0}),r(p,"constructor",{value:d,configurable:!0}),d.displayName=u(p,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===d||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,u(t,s,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},A(b.prototype),u(b.prototype,a,(function(){return this})),t.AsyncIterator=b,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new b(l(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},A(g),u(g,s,"Generator"),u(g,i,(function(){return this})),u(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},t.values=S,O.prototype={constructor:O,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(V),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(n,r){return a.type="throw",a.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var s=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,h):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),h},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),V(n),h}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;V(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:S(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),h}},t}function yt(t,e,n,r,o,i,a){try{var s=t[i](a),u=s.value}catch(t){return void n(t)}s.done?e(u):Promise.resolve(u).then(r,o)}function vt(t){return function(){var e=this,n=arguments;return new Promise((function(r,o){var i=t.apply(e,n);function a(t){yt(i,r,o,a,s,"next",t)}function s(t){yt(i,r,o,a,s,"throw",t)}a(void 0)}))}}lt.extend(BookReader.defaultOptions,{server:"ia600609.us.archive.org",bookPath:"",enableTtsPlugin:!0}),BookReader.prototype.setup=(rt=BookReader.prototype.setup,function(t){if(rt.call(this,t),this.options.enableTtsPlugin){this._ttsBoxesByIndex={};var e=ot.isSupported()?ot:C.isSupported()?C:null;if(/_forceTTSEngine=(festival|web)/.test(location.toString())){var n=location.toString().match(/_forceTTSEngine=(festival|web)/)[1];e={festival:C,web:ot}[n]}e&&(this.ttsEngine=new e({server:t.server,bookPath:t.bookPath,bookLanguage:(r=t.bookLanguage,r?G(r=r.toLowerCase(),["ISO 639-1"])||G(r,["ISO 639-2/B"])||G(r,["ISO 639-2/T","Endonym","Name"]):null),onLoadingStart:this.showProgressPopup.bind(this,"Loading audio..."),onLoadingComplete:this.removeProgressPopup.bind(this),onDone:this.ttsStop.bind(this),beforeChunkPlay:this.ttsBeforeChunkPlay.bind(this),afterChunkPlay:this.ttsSendChunkFinishedAnalyticsEvent.bind(this)}))}var r}),BookReader.prototype.init=function(t){return function(){var e=this;this.options.enableTtsPlugin&&this.bind(BookReader.eventNames.PostInit,(function(){e.$(".BRicon.read").click((function(){return e.ttsToggle(),!1})),e.ttsEngine&&(e.ttsEngine.init(),/[?&]_autoReadAloud=show/.test(location.toString())&&e.ttsStart(!1))})),t.call(this)}}(BookReader.prototype.init),BookReader.prototype._createPageContainer=function(t){return function(e){var n=t.call(this,e);if(this.options.enableTtsPlugin&&n.page&&e in this._ttsBoxesByIndex){var r=n.page.index;(0,ut.Tm)("ttsHiliteLayer",this._ttsBoxesByIndex[r],n.page,n.$container[0])}return n}}(BookReader.prototype._createPageContainer),BookReader.prototype.buildMobileDrawerElement=function(t){return function(){var e=t.call(this);return this.options.enableTtsPlugin&&this.ttsEngine&&e.find(".BRmobileMenu__moreInfoRow").after(ct('\n <li>\n <span>\n <span class="DrawerIconWrapper"><img class="DrawerIcon" src="'.concat(this.imagesBaseURL,'icon_speaker_open.svg" alt="info-speaker"/></span>\n Read Aloud\n </span>\n <div>\n <span class="larger">Press to toggle read aloud</span>\n <br/>\n <button class="BRicon read"></button>\n </div>\n </li>'))),e}}(BookReader.prototype.buildMobileDrawerElement),BookReader.prototype.initNavbar=function(t){return function(){var e=this,n=t.call(this);if(this.options.enableTtsPlugin&&this.ttsEngine){this.refs.$BRReadAloudToolbar=ct('\n <ul class="read-aloud">\n <li>\n <select class="playback-speed" name="playback-speed" title="'.concat("Playback speed",'">\n <option value="0.25">0.25x</option>\n <option value="0.5">0.5x</option>\n <option value="0.75">0.75x</option>\n <option value="1.0" selected>1.0x</option>\n <option value="1.25">1.25x</option>\n <option value="1.5">1.5x</option>\n <option value="1.75">1.75x</option>\n <option value="2">2x</option>\n </select>\n </li>\n <li>\n <button type="button" name="review" title="').concat("Review 10 seconds",'">\n <div class="icon icon-review"></div>\n </button>\n </li>\n <li>\n <button type="button" name="play" title="').concat("Play",'">\n <div class="icon icon-play"></div>\n <div class="icon icon-pause"></div>\n </button>\n </li>\n <li>\n <button type="button" name="advance" title="').concat("Advance 10 seconds",'">\n <div class="icon icon-advance"></div>\n </button>\n </li>\n <li>\n <select class="playback-voices" name="playback-voice" style="display: none" title="Change read aloud voices">\n </select>\n </li>\n </ul>\n ')),n.find(".BRcontrols").prepend(this.refs.$BRReadAloudToolbar);var r=function(t){return t.map((function(t){return'<option value="'.concat(t.voiceURI,'">').concat(t.lang," - ").concat(t.name,"</option>")})).join("")},o=function(t,e){return"".concat(t.lang," - ").concat(t.name).localeCompare("".concat(e.lang," - ").concat(e.name))},i=function(t){t.empty();var n=e.ttsEngine.opts.bookLanguage,i=e.ttsEngine.getVoices().filter((function(t){return t.lang.startsWith(n)})).sort(o),a=e.ttsEngine.getVoices().filter((function(t){return!t.lang.startsWith(n)})).sort(o);e.ttsEngine.getVoices().length>1?(t.append(ct('<optgroup label="Book Language ('.concat(n,')"> ').concat(r(i)," </optgroup>"))),t.append(ct('<optgroup label="Other Languages"> '.concat(r(a)," </optgroup>"))),t.val(e.ttsEngine.voice.voiceURI),t.show()):t.hide()},a=this.refs.$BRReadAloudToolbar.find("[name=playback-voice]");i(a),a.on("change",(function(t){return e.ttsEngine.setVoice(a.val())})),this.ttsEngine.events.on("pause resume start",(function(){return e.ttsUpdateState()})),this.ttsEngine.events.on("voiceschanged",(function(){return i(a)})),this.refs.$BRReadAloudToolbar.find("[name=play]").on("click",this.ttsPlayPause.bind(this)),this.refs.$BRReadAloudToolbar.find("[name=advance]").on("click",this.ttsJumpForward.bind(this)),this.refs.$BRReadAloudToolbar.find("[name=review]").on("click",this.ttsJumpBackward.bind(this));var s=this.refs.$BRReadAloudToolbar.find('select[name="playback-speed"]');s.on("change",(function(t){return e.ttsEngine.setPlaybackRate(parseFloat(s.val()))})),ct('<li>\n <button class="BRicon read js-tooltip" title="'.concat(st,'">\n <div class="icon icon-read-aloud"></div>\n <span class="tooltip">').concat(st,"</span>\n </button>\n </li>")).insertBefore(n.find(".BRcontrols .BRicon.zoom_out").closest("li"))}return n}}(BookReader.prototype.initNavbar),BookReader.prototype.ttsToggle=function(){this.autoStop&&this.autoStop(),this.ttsEngine.playing?this.ttsStop():this.ttsStart()},BookReader.prototype.ttsStart=function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.constModeThumb==this.mode&&this.switchMode(this.constMode1up),this.refs.$BRReadAloudToolbar.addClass("visible"),this.$(".BRicon.read").addClass("unread active"),this.ttsSendAnalyticsEvent("Start"),t&&this.ttsEngine.start(this.currentIndex(),this.book.getNumLeafs())},BookReader.prototype.ttsJumpForward=function(){this.ttsEngine.paused&&this.ttsEngine.resume(),this.ttsEngine.jumpForward()},BookReader.prototype.ttsJumpBackward=function(){this.ttsEngine.paused&&this.ttsEngine.resume(),this.ttsEngine.jumpBackward()},BookReader.prototype.ttsUpdateState=function(){var t=!(this.ttsEngine.paused||!this.ttsEngine.playing);this.$(".read-aloud [name=play]").toggleClass("playing",t)},BookReader.prototype.ttsPlayPause=function(){this.ttsEngine.playing?(this.ttsEngine.togglePlayPause(),this.ttsUpdateState(this.ttsEngine.paused)):this.ttsToggle()},BookReader.prototype.ttsStop=function(){this.refs.$BRReadAloudToolbar.removeClass("visible"),this.$(".BRicon.read").removeClass("unread active"),this.ttsSendAnalyticsEvent("Stop"),this.ttsEngine.stop(),this.ttsRemoveHilites(),this.removeProgressPopup()},BookReader.prototype.ttsBeforeChunkPlay=function(){var t=vt(pt().mark((function t(e){return pt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.ttsMaybeFlipToIndex(e.leafIndex);case 2:this.ttsHighlightChunk(e),this.ttsScrollToChunk(e);case 4:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),BookReader.prototype.ttsSendChunkFinishedAnalyticsEvent=function(t){var e;this.ttsSendAnalyticsEvent("ChunkFinished-Words",(e=t.text.match(/\S+/g))?e.length:0)},BookReader.prototype.ttsMaybeFlipToIndex=function(){var t=vt(pt().mark((function t(e){return pt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.constMode2up==this.mode){t.next=4;break}this.jumpToIndex(e),t.next=6;break;case 4:return t.next=6,this._modes.mode2Up.mode2UpLit.jumpToIndex(e);case 6:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),BookReader.prototype.ttsHighlightChunk=function(t){var e,n,r,o=this,i=t.leafIndex;this.ttsRemoveHilites(),this._ttsBoxesByIndex=(e={},n=i,r=t.lineRects.map((function(t){var e=ft(t,4),n=e[0],r=e[1];return{l:n,r:e[2],b:r,t:e[3]}})),(n=function(t){var e=function(t,e){if("object"!==ht(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==ht(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"===ht(e)?e:String(e)}(n))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e);for(var a=function(){var t=ft(u[s],2),e=t[0],n=t[1],r=parseFloat(e),i=o.book.getPage(r);o.getActivePageContainerElementsForIndex(r).forEach((function(t){return(0,ut.Tm)("ttsHiliteLayer",n,i,t)}))},s=0,u=Object.entries(this._ttsBoxesByIndex);s<u.length;s++)a()},BookReader.prototype.ttsScrollToChunk=function(t){var e;this.constModeThumb!=this.mode&&(null===(e=ct(".pagediv".concat(t.leafIndex," .ttsHiliteLayer rect")).last())||void 0===e||null===(e=e[0])||void 0===e||e.scrollIntoView({block:this.constMode1up==this.mode||this.isFullscreenActive?"center":"nearest",inline:"center",behavior:"smooth"}))},BookReader.prototype.ttsRemoveHilites=function(){ct(this.getActivePageContainerElements()).find(".ttsHiliteLayer").remove(),this._ttsBoxesByIndex={}},BookReader.prototype.ttsSendAnalyticsEvent=function(t,e){if(this.archiveAnalyticsSendEvent){var n={},r=this.ttsEngine.opts.bookLanguage;r&&(n.mediaLanguage=r),this.archiveAnalyticsSendEvent("BRReadAloud",t,e,n)}}},2814:function(t,e,n){var r=n(7854),o=n(7293),i=n(1702),a=n(1340),s=n(3111).trim,u=n(1361),l=i("".charAt),c=r.parseFloat,h=r.Symbol,f=h&&h.iterator,d=1/c(u+"-0")!=-1/0||f&&!o((function(){c(Object(f))}));t.exports=d?function(t){var e=s(a(t)),n=c(e);return 0===n&&"-"==l(e,0)?-0:n}:c},9720:function(t,e,n){var r=n(2109),o=n(4699).entries;r({target:"Object",stat:!0},{entries:function(t){return o(t)}})},4678:function(t,e,n){var r=n(2109),o=n(2814);r({global:!0,forced:parseFloat!=o},{parseFloat:o})},1030:function(t,e){"use strict";e.Z=void 0,e.Z=[["Serbian","српски језик","sr","srp","srp"],["Romanian, Moldavian, Moldovan","Română","ro","ron","rum"],["Sichuan Yi, Nuosu","ꆈꌠ꒿ Nuosuhxop","ii","iii","iii"],["Tahitian","Reo Tahiti","ty","tah","tah"],["Tagalog","Wikang Tagalog","tl","tgl","tgl"],["Yiddish","ייִדיש","yi","yid","yid"],["Akan","Akan","ak","aka","aka"],["Malay","Bahasa Melayu, بهاس ملايو","ms","msa","may"],["Arabic","العربية","ar","ara","ara"],["Norwegian","Norsk","no","nor","nor"],["Ojibwa","ᐊᓂᔑᓈᐯᒧᐎᓐ","oj","oji","oji"],["Fulah","Fulfulde, Pulaar, Pular","ff","ful","ful"],["Persian","فارسی","fa","fas","per"],["Albanian","Shqip","sq","sqi","alb"],["Aymara","aymar aru","ay","aym","aym"],["Azerbaijani","azərbaycan dili","az","aze","aze"],["Chinese","中文 (Zhōngwén), 汉语, 漢語","zh","zho","chi"],["Cree","ᓀᐦᐃᔭᐍᐏᐣ","cr","cre","cre"],["Estonian","eesti, eesti keel","et","est","est"],["Guaraní","Avañe'ẽ","gn","grn","grn"],["Inupiaq","Iñupiaq, Iñupiatun","ik","ipk","ipk"],["Inuktitut","ᐃᓄᒃᑎᑐᑦ","iu","iku","iku"],["Kanuri","Kanuri","kr","kau","kau"],["Komi","коми кыв","kv","kom","kom"],["Kongo","Kikongo","kg","kon","kon"],["Kurdish","Kurdî, کوردی","ku","kur","kur"],["Latvian","latviešu valoda","lv","lav","lav"],["Malagasy","fiteny malagasy","mg","mlg","mlg"],["Mongolian","Монгол хэл","mn","mon","mon"],["Oromo","Afaan Oromoo","om","orm","orm"],["Pashto, Pushto","پښتو","ps","pus","pus"],["Quechua","Runa Simi, Kichwa","qu","que","que"],["Sardinian","sardu","sc","srd","srd"],["Swahili","Kiswahili","sw","swa","swa"],["Uzbek","Oʻzbek, Ўзбек, أۇزبېك","uz","uzb","uzb"],["Zhuang, Chuang","Saɯ cueŋƅ, Saw cuengh","za","zha","zha"],["Bislama","Bislama","bi","bis","bis"],["Norwegian Bokmål","Norsk Bokmål","nb","nob","nob"],["Norwegian Nynorsk","Norsk Nynorsk","nn","nno","nno"],["Indonesian","Bahasa Indonesia","id","ind","ind"],["Twi","Twi","tw","twi","twi"],["Esperanto","Esperanto","eo","epo","epo"],["Interlingua","Interlingua","ia","ina","ina"],["Interlingue","Originally called Occidental; then Interlingue after WWII","ie","ile","ile"],["Ido","Ido","io","ido","ido"],["Volapük","Volapük","vo","vol","vol"],["Bihari languages","भोजपुरी","bh","bih","bih"],["Hebrew (modern)","עברית","he","heb","heb"],["Sanskrit","संस्कृतम्","sa","san","san"],["Church Slavic, Church Slavonic, Old Church Slavonic, Old Slavonic, Old Bulgarian","ѩзыкъ словѣньскъ","cu","chu","chu"],["Pali","पाऴि","pi","pli","pli"],["Avestan","avesta","ae","ave","ave"],["Latin","latine, lingua latina","la","lat","lat"],["Armenian","Հայերեն","hy","hye","arm"],["Swati","SiSwati","ss","ssw","ssw"],["Tibetan","བོད་ཡིག","bo","bod","tib"],["South Ndebele","isiNdebele","nr","nbl","nbl"],["Slovene","Slovenski Jezik, Slovenščina","sl","slv","slv"],["Oriya","ଓଡ଼ିଆ","or","ori","ori"],["North Ndebele","isiNdebele","nd","nde","nde"],["Nauru","Dorerin Naoero","na","nau","nau"],["Maori","te reo Māori","mi","mri","mao"],["Marathi","मराठी","mr","mar","mar"],["Luba-Katanga","Kiluba","lu","lub","lub"],["Rundi","Ikirundi","rn","run","run"],["Central Khmer","ខ្មែរ, ខេមរភាសា, ភាសាខ្មែរ","km","khm","khm"],["Western Frisian","Frysk","fy","fry","fry"],["Bengali","বাংলা","bn","ben","ben"],["Avaric","авар мацӀ, магӀарул мацӀ","av","ava","ava"],["Abkhazian","аҧсуа бызшәа, аҧсшәа","ab","abk","abk"],["Afar","Afaraf","aa","aar","aar"],["Afrikaans","Afrikaans","af","afr","afr"],["Amharic","አማርኛ","am","amh","amh"],["Aragonese","aragonés","an","arg","arg"],["Assamese","অসমীয়া","as","asm","asm"],["Bambara","bamanankan","bm","bam","bam"],["Bashkir","башҡорт теле","ba","bak","bak"],["Basque","euskara, euskera","eu","eus","baq"],["Belarusian","беларуская мова","be","bel","bel"],["Bosnian","bosanski jezik","bs","bos","bos"],["Breton","brezhoneg","br","bre","bre"],["Bulgarian","български език","bg","bul","bul"],["Burmese","ဗမာစာ","my","mya","bur"],["Catalan, Valencian","català, valencià","ca","cat","cat"],["Chamorro","Chamoru","ch","cha","cha"],["Chechen","нохчийн мотт","ce","che","che"],["Chichewa, Chewa, Nyanja","chiCheŵa, chinyanja","ny","nya","nya"],["Chuvash","чӑваш чӗлхи","cv","chv","chv"],["Cornish","Kernewek","kw","cor","cor"],["Corsican","corsu, lingua corsa","co","cos","cos"],["Croatian","hrvatski jezik","hr","hrv","hrv"],["Czech","čeština, český jazyk","cs","ces","cze"],["Danish","dansk","da","dan","dan"],["Divehi, Dhivehi, Maldivian","ދިވެހި","dv","div","div"],["Dutch, Flemish","Nederlands, Vlaams","nl","nld","dut"],["Dzongkha","རྫོང་ཁ","dz","dzo","dzo"],["English","English","en","eng","eng"],["Ewe","Eʋegbe","ee","ewe","ewe"],["Faroese","føroyskt","fo","fao","fao"],["Fijian","vosa Vakaviti","fj","fij","fij"],["Finnish","suomi, suomen kieli","fi","fin","fin"],["French","français, langue française","fr","fra","fre"],["Galician","Galego","gl","glg","glg"],["Georgian","ქართული","ka","kat","geo"],["German","Deutsch","de","deu","ger"],["Greek (modern)","ελληνικά","el","ell","gre"],["Gujarati","ગુજરાતી","gu","guj","guj"],["Haitian, Haitian Creole","Kreyòl ayisyen","ht","hat","hat"],["Hausa","(Hausa) هَوُسَ","ha","hau","hau"],["Herero","Otjiherero","hz","her","her"],["Hindi","हिन्दी, हिंदी","hi","hin","hin"],["Hiri Motu","Hiri Motu","ho","hmo","hmo"],["Hungarian","magyar","hu","hun","hun"],["Irish","Gaeilge","ga","gle","gle"],["Igbo","Asụsụ Igbo","ig","ibo","ibo"],["Icelandic","Íslenska","is","isl","ice"],["Italian","Italiano","it","ita","ita"],["Japanese","日本語 (にほんご)","ja","jpn","jpn"],["Javanese","ꦧꦱꦗꦮ, Basa Jawa","jv","jav","jav"],["Kalaallisut, Greenlandic","kalaallisut, kalaallit oqaasii","kl","kal","kal"],["Kannada","ಕನ್ನಡ","kn","kan","kan"],["Kashmiri","कश्मीरी, كشميري","ks","kas","kas"],["Kazakh","қазақ тілі","kk","kaz","kaz"],["Kikuyu, Gikuyu","Gĩkũyũ","ki","kik","kik"],["Kinyarwanda","Ikinyarwanda","rw","kin","kin"],["Kirghiz, Kyrgyz","Кыргызча, Кыргыз тили","ky","kir","kir"],["Korean","한국어","ko","kor","kor"],["Kuanyama, Kwanyama","Kuanyama","kj","kua","kua"],["Luxembourgish, Letzeburgesch","Lëtzebuergesch","lb","ltz","ltz"],["Ganda","Luganda","lg","lug","lug"],["Limburgan, Limburger, Limburgish","Limburgs","li","lim","lim"],["Lingala","Lingála","ln","lin","lin"],["Lao","ພາສາລາວ","lo","lao","lao"],["Lithuanian","lietuvių kalba","lt","lit","lit"],["Manx","Gaelg, Gailck","gv","glv","glv"],["Macedonian","македонски јазик","mk","mkd","mac"],["Malayalam","മലയാളം","ml","mal","mal"],["Maltese","Malti","mt","mlt","mlt"],["Marshallese","Kajin M̧ajeļ","mh","mah","mah"],["Navajo, Navaho","Diné bizaad","nv","nav","nav"],["Nepali","नेपाली","ne","nep","nep"],["Ndonga","Owambo","ng","ndo","ndo"],["Occitan","occitan, lenga d'òc","oc","oci","oci"],["Ossetian, Ossetic","ирон æвзаг","os","oss","oss"],["Panjabi, Punjabi","ਪੰਜਾਬੀ","pa","pan","pan"],["Polish","język polski, polszczyzna","pl","pol","pol"],["Portuguese","Português","pt","por","por"],["Romansh","Rumantsch Grischun","rm","roh","roh"],["Russian","русский","ru","rus","rus"],["Sindhi","सिन्धी, سنڌي، سندھی","sd","snd","snd"],["Northern Sami","Davvisámegiella","se","sme","sme"],["Samoan","gagana fa'a Samoa","sm","smo","smo"],["Sango","yângâ tî sängö","sg","sag","sag"],["Gaelic, Scottish Gaelic","Gàidhlig","gd","gla","gla"],["Shona","chiShona","sn","sna","sna"],["Sinhala, Sinhalese","සිංහල","si","sin","sin"],["Slovak","Slovenčina, Slovenský Jazyk","sk","slk","slo"],["Somali","Soomaaliga, af Soomaali","so","som","som"],["Southern Sotho","Sesotho","st","sot","sot"],["Spanish, Castilian","Español","es","spa","spa"],["Sundanese","Basa Sunda","su","sun","sun"],["Swedish","Svenska","sv","swe","swe"],["Tamil","தமிழ்","ta","tam","tam"],["Telugu","తెలుగు","te","tel","tel"],["Tajik","тоҷикӣ, toçikī, تاجیکی","tg","tgk","tgk"],["Thai","ไทย","th","tha","tha"],["Tigrinya","ትግርኛ","ti","tir","tir"],["Turkmen","Türkmen, Түркмен","tk","tuk","tuk"],["Tswana","Setswana","tn","tsn","tsn"],["Tongan (Tonga Islands)","Faka Tonga","to","ton","ton"],["Turkish","Türkçe","tr","tur","tur"],["Tsonga","Xitsonga","ts","tso","tso"],["Tatar","татар теле, tatar tele","tt","tat","tat"],["Uighur, Uyghur","ئۇيغۇرچە, Uyghurche","ug","uig","uig"],["Ukrainian","Українська","uk","ukr","ukr"],["Urdu","اردو","ur","urd","urd"],["Venda","Tshivenḓa","ve","ven","ven"],["Vietnamese","Tiếng Việt","vi","vie","vie"],["Walloon","Walon","wa","wln","wln"],["Welsh","Cymraeg","cy","cym","wel"],["Wolof","Wollof","wo","wol","wol"],["Xhosa","isiXhosa","xh","xho","xho"],["Yoruba","Yorùbá","yo","yor","yor"],["Zulu","isiZulu","zu","zul","zul"]]},4371:function(t,e,n){var r,o;r=[n(5311)],void 0===(o=function(t){return function(t){"use strict";function e(t){void 0===t&&(t=window.navigator.userAgent),t=t.toLowerCase();var e=/(edge)\/([\w.]+)/.exec(t)||/(opr)[\/]([\w.]+)/.exec(t)||/(chrome)[ \/]([\w.]+)/.exec(t)||/(iemobile)[\/]([\w.]+)/.exec(t)||/(version)(applewebkit)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(t)||/(webkit)[ \/]([\w.]+).*(version)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(t)||/(webkit)[ \/]([\w.]+)/.exec(t)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(t)||/(msie) ([\w.]+)/.exec(t)||t.indexOf("trident")>=0&&/(rv)(?::| )([\w.]+)/.exec(t)||t.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(t)||[],n=/(ipad)/.exec(t)||/(ipod)/.exec(t)||/(windows phone)/.exec(t)||/(iphone)/.exec(t)||/(kindle)/.exec(t)||/(silk)/.exec(t)||/(android)/.exec(t)||/(win)/.exec(t)||/(mac)/.exec(t)||/(linux)/.exec(t)||/(cros)/.exec(t)||/(playbook)/.exec(t)||/(bb)/.exec(t)||/(blackberry)/.exec(t)||[],r={},o={browser:e[5]||e[3]||e[1]||"",version:e[2]||e[4]||"0",versionNumber:e[4]||e[2]||"0",platform:n[0]||""};if(o.browser&&(r[o.browser]=!0,r.version=o.version,r.versionNumber=parseInt(o.versionNumber,10)),o.platform&&(r[o.platform]=!0),(r.android||r.bb||r.blackberry||r.ipad||r.iphone||r.ipod||r.kindle||r.playbook||r.silk||r["windows phone"])&&(r.mobile=!0),(r.cros||r.mac||r.linux||r.win)&&(r.desktop=!0),(r.chrome||r.opr||r.safari)&&(r.webkit=!0),r.rv||r.iemobile){var i="msie";o.browser=i,r[i]=!0}if(r.edge){delete r.edge;var a="msedge";o.browser=a,r[a]=!0}if(r.safari&&r.blackberry){var s="blackberry";o.browser=s,r[s]=!0}if(r.safari&&r.playbook){var u="playbook";o.browser=u,r[u]=!0}if(r.bb){var l="blackberry";o.browser=l,r[l]=!0}if(r.opr){var c="opera";o.browser=c,r[c]=!0}if(r.safari&&r.android){var h="android";o.browser=h,r[h]=!0}if(r.safari&&r.kindle){var f="kindle";o.browser=f,r[f]=!0}if(r.safari&&r.silk){var d="silk";o.browser=d,r[d]=!0}return r.name=o.browser,r.platform=o.platform,r}return window.jQBrowser=e(window.navigator.userAgent),window.jQBrowser.uaMatch=e,t&&(t.browser=window.jQBrowser),window.jQBrowser}(t)}.apply(e,r))||(t.exports=o)},5529:function(t,e,n){var r;t=n.nmd(t),function(o,i){"use strict";if(!o||!o.document)throw new Error("SoundManager requires a browser with window and document objects.");var a=null;function s(t,e){this.setupOptions={url:t||null,flashVersion:8,debugMode:!0,debugFlash:!1,useConsole:!0,consoleOnly:!0,waitForWindowLoad:!1,bgColor:"#ffffff",useHighPerformance:!1,flashPollingInterval:null,html5PollingInterval:null,flashLoadTimeout:1e3,wmode:null,allowScriptAccess:"always",useFlashBlock:!1,useHTML5Audio:!0,forceUseGlobalHTML5Audio:!1,ignoreMobileRestrictions:!1,html5Test:/^(probably|maybe)$/i,preferFlash:!1,noSWFCache:!1,idPrefix:"sound"},this.defaultOptions={autoLoad:!1,autoPlay:!1,from:null,loops:1,onid3:null,onerror:null,onload:null,whileloading:null,onplay:null,onpause:null,onresume:null,whileplaying:null,onposition:null,onstop:null,onfinish:null,multiShot:!0,multiShotEvents:!1,position:null,pan:0,playbackRate:1,stream:!0,to:null,type:null,usePolicyFile:!1,volume:100},this.flash9Options={onfailure:null,isMovieStar:null,usePeakData:!1,useWaveformData:!1,useEQData:!1,onbufferchange:null,ondataerror:null},this.movieStarOptions={bufferTime:3,serverURL:null,onconnect:null,duration:null},this.audioFormats={mp3:{type:['audio/mpeg; codecs="mp3"',"audio/mpeg","audio/mp3","audio/MPA","audio/mpa-robust"],required:!0},mp4:{related:["aac","m4a","m4b"],type:['audio/mp4; codecs="mp4a.40.2"',"audio/aac","audio/x-m4a","audio/MP4A-LATM","audio/mpeg4-generic"],required:!1},ogg:{type:["audio/ogg; codecs=vorbis"],required:!1},opus:{type:["audio/ogg; codecs=opus","audio/opus"],required:!1},wav:{type:['audio/wav; codecs="1"',"audio/wav","audio/wave","audio/x-wav"],required:!1},flac:{type:["audio/flac"],required:!1}},this.movieID="sm2-container",this.id=e||"sm2movie",this.debugID="soundmanager-debug",this.debugURLParam=/([#?&])debug=1/i,this.versionNumber="V2.97a.20170601",this.version=null,this.movieURL=null,this.altURL=null,this.swfLoaded=!1,this.enabled=!1,this.oMC=null,this.sounds={},this.soundIDs=[],this.muted=!1,this.didFlashBlock=!1,this.filePattern=null,this.filePatterns={flash8:/\.mp3(\?.*)?$/i,flash9:/\.mp3(\?.*)?$/i},this.features={buffering:!1,peakData:!1,waveformData:!1,eqData:!1,movieStar:!1},this.sandbox={type:null,types:{remote:"remote (domain-based) rules",localWithFile:"local with file access (no internet access)",localWithNetwork:"local with network (internet access only, no local access)",localTrusted:"local, trusted (local+internet access)"},description:null,noRemote:null,noLocal:null},this.html5={usingFlash:null},this.flash={},this.html5Only=!1,this.ignoreFlash=!1;var n,r,a,s,u,l,c,h,f,d,p,y,v,m,g,A,b,w,_,k,V,O,S,x,L,M,P,E,I,T,q,R,D,F,C,j,B,N,U,H,Y,Q,G,z,K,Z,W,X,J,$,tt,et,nt,rt,ot,it,at,st,ut,lt,ct,ht,ft,dt,pt,yt=this,vt=null,mt=null,gt="soundManager",At=gt+": ",bt=navigator.userAgent,wt=o.location.href.toString(),_t=document,kt=[],Vt=!0,Ot=!1,St=!1,xt=!1,Lt=!1,Mt=!1,Pt=0,Et=["log","info","warn","error"],It=null,Tt=null,qt=!1,Rt=!1,Dt=0,Ft=null,Ct=[],jt=null,Bt=Array.prototype.slice,Nt=!1,Ut=0,Ht=1e3,Yt=bt.match(/(ipad|iphone|ipod)/i),Qt=bt.match(/android/i),Gt=bt.match(/msie|trident/i),zt=bt.match(/webkit/i),Kt=bt.match(/safari/i)&&!bt.match(/chrome/i),Zt=bt.match(/opera/i),Wt=bt.match(/(mobile|pre\/|xoom)/i)||Yt||Qt,Xt=!wt.match(/usehtml5audio/i)&&!wt.match(/sm2-ignorebadua/i)&&Kt&&!bt.match(/silk/i)&&bt.match(/OS\sX\s10_6_([3-7])/i),Jt=o.console!==i&&console.log!==i,$t=_t.hasFocus!==i?_t.hasFocus():null,te=Kt&&(_t.hasFocus===i||!_t.hasFocus()),ee=!te,ne=/(mp3|mp4|mpa|m4a|m4b)/i,re="about:blank",oe=_t.location?_t.location.protocol.match(/http/i):null,ie=oe?"":"//",ae=/^\s*audio\/(?:x-)?(?:mpeg4|aac|flv|mov|mp4|m4v|m4a|m4b|mp4v|3gp|3g2)\s*(?:$|;)/i,se=["mpeg4","aac","flv","mov","mp4","m4v","f4v","m4a","m4b","mp4v","3gp","3g2"],ue=new RegExp("\\.("+se.join("|")+")(\\?.*)?$","i");function le(t){return yt.preferFlash&&st&&!yt.ignoreFlash&&yt.flash[t]!==i&&yt.flash[t]}function ce(t){return function(e){var n,r=this._s;return r&&r._a?n=t.call(this,e):(r&&r.id?yt._wD(r.id+": Ignoring "+e.type):yt._wD("HTML5::Ignoring "+e.type),n=null),n}}this.mimePattern=/^\s*audio\/(?:x-)?(?:mp(?:eg|3))\s*(?:$|;)/i,this.useAltURL=!oe,B={swfBox:"sm2-object-box",swfDefault:"movieContainer",swfError:"swf_error",swfTimedout:"swf_timedout",swfLoaded:"swf_loaded",swfUnblocked:"swf_unblocked",sm2Debug:"sm2_debug",highPerf:"high_performance",flashDebug:"flash_debug"},tt=[null,"MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED"],this.hasHTML5=function(){try{return Audio!==i&&(Zt&&opera!==i&&opera.version()<10?new Audio(null):new Audio).canPlayType!==i}catch(t){return!1}}(),this.setup=function(t){var e=!yt.url;return t!==i&&xt&&jt&&yt.ok()&&(t.flashVersion!==i||t.url!==i||t.html5Test!==i)&&Y(F("setupLate")),p(t),Nt||(Wt?yt.setupOptions.ignoreMobileRestrictions&&!yt.setupOptions.forceUseGlobalHTML5Audio||(Ct.push(V.globalHTML5),Nt=!0):yt.setupOptions.forceUseGlobalHTML5Audio&&(Ct.push(V.globalHTML5),Nt=!0)),!pt&&Wt&&(yt.setupOptions.ignoreMobileRestrictions?Ct.push(V.ignoreMobile):(yt.setupOptions.useHTML5Audio&&!yt.setupOptions.preferFlash||yt._wD(V.mobileUA),yt.setupOptions.useHTML5Audio=!0,yt.setupOptions.preferFlash=!1,Yt?yt.ignoreFlash=!0:(Qt&&!bt.match(/android\s2\.3/i)||!Qt)&&(yt._wD(V.globalHTML5),Nt=!0))),t&&(e&&L&&t.url!==i&&yt.beginDelayedInit(),L||t.url===i||"complete"!==_t.readyState||setTimeout(S,1)),pt=!0,yt},this.ok=function(){return jt?xt&&!Lt:yt.useHTML5Audio&&yt.hasHTML5},this.supported=this.ok,this.getMovie=function(t){return r(t)||_t[t]||o[t]},this.createSound=function(t,e){var r,o,a,s=null;if(o=(r=gt+".createSound(): ")+F(xt?"notOK":"notReady"),!xt||!yt.ok())return Y(o),!1;if(e!==i&&(t={id:t,url:e}),(a=d(t)).url=Z(a.url),a.id===i&&(a.id=yt.setupOptions.idPrefix+Ut++),a.id.toString().charAt(0).match(/^[0-9]$/)&&yt._wD(r+F("badID",a.id),2),yt._wD(r+a.id+(a.url?" ("+a.url+")":""),1),Q(a.id,!0))return yt._wD(r+a.id+" exists",1),yt.sounds[a.id];function u(){return a=U(a),yt.sounds[a.id]=new n(a),yt.soundIDs.push(a.id),yt.sounds[a.id]}if(J(a))s=u(),yt.html5Only||yt._wD(a.id+": Using HTML5"),s._setup_html5(a);else{if(yt.html5Only)return yt._wD(a.id+": No HTML5 support for this sound, and no Flash. Exiting."),u();if(yt.html5.usingFlash&&a.url&&a.url.match(/data:/i))return yt._wD(a.id+": data: URIs not supported via Flash. Exiting."),u();l>8&&(null===a.isMovieStar&&(a.isMovieStar=!!(a.serverURL||a.type&&a.type.match(ae)||a.url&&a.url.match(ue))),a.isMovieStar&&(yt._wD(r+"using MovieStar handling"),a.loops>1&&h("noNSLoop"))),a=H(a,r),s=u(),8===l?mt._createSound(a.id,a.loops||1,a.usePolicyFile):(mt._createSound(a.id,a.url,a.usePeakData,a.useWaveformData,a.useEQData,a.isMovieStar,!!a.isMovieStar&&a.bufferTime,a.loops||1,a.serverURL,a.duration||null,a.autoPlay,!0,a.autoLoad,a.usePolicyFile),a.serverURL||(s.connected=!0,a.onconnect&&a.onconnect.apply(s))),a.serverURL||!a.autoLoad&&!a.autoPlay||s.load(a)}return!a.serverURL&&a.autoPlay&&s.play(),s},this.destroySound=function(t,e){if(!Q(t))return!1;var n,r=yt.sounds[t];for(r.stop(),r._iO={},r.unload(),n=0;n<yt.soundIDs.length;n++)if(yt.soundIDs[n]===t){yt.soundIDs.splice(n,1);break}return e||r.destruct(!0),r=null,delete yt.sounds[t],!0},this.load=function(t,e){return!!Q(t)&&yt.sounds[t].load(e)},this.unload=function(t){return!!Q(t)&&yt.sounds[t].unload()},this.onPosition=function(t,e,n,r){return!!Q(t)&&yt.sounds[t].onposition(e,n,r)},this.onposition=this.onPosition,this.clearOnPosition=function(t,e,n){return!!Q(t)&&yt.sounds[t].clearOnPosition(e,n)},this.play=function(t,e){var n=null,r=e&&!(e instanceof Object);if(!xt||!yt.ok())return Y(gt+".play(): "+F(xt?"notOK":"notReady")),!1;if(Q(t,r))r&&(e={url:e});else{if(!r)return!1;r&&(e={url:e}),e&&e.url&&(yt._wD(gt+'.play(): Attempting to create "'+t+'"',1),e.id=t,n=yt.createSound(e).play())}return null===n&&(n=yt.sounds[t].play(e)),n},this.start=this.play,this.setPlaybackRate=function(t,e,n){return!!Q(t)&&yt.sounds[t].setPlaybackRate(e,n)},this.setPosition=function(t,e){return!!Q(t)&&yt.sounds[t].setPosition(e)},this.stop=function(t){return!!Q(t)&&(yt._wD(gt+".stop("+t+")",1),yt.sounds[t].stop())},this.stopAll=function(){var t;for(t in yt._wD(gt+".stopAll()",1),yt.sounds)yt.sounds.hasOwnProperty(t)&&yt.sounds[t].stop()},this.pause=function(t){return!!Q(t)&&yt.sounds[t].pause()},this.pauseAll=function(){var t;for(t=yt.soundIDs.length-1;t>=0;t--)yt.sounds[yt.soundIDs[t]].pause()},this.resume=function(t){return!!Q(t)&&yt.sounds[t].resume()},this.resumeAll=function(){var t;for(t=yt.soundIDs.length-1;t>=0;t--)yt.sounds[yt.soundIDs[t]].resume()},this.togglePause=function(t){return!!Q(t)&&yt.sounds[t].togglePause()},this.setPan=function(t,e){return!!Q(t)&&yt.sounds[t].setPan(e)},this.setVolume=function(t,e){var n,r;if(t!==i&&!isNaN(t)&&e===i){for(n=0,r=yt.soundIDs.length;n<r;n++)yt.sounds[yt.soundIDs[n]].setVolume(t);return!1}return!!Q(t)&&yt.sounds[t].setVolume(e)},this.mute=function(t){var e=0;if(t instanceof String&&(t=null),t)return!!Q(t)&&(yt._wD(gt+'.mute(): Muting "'+t+'"'),yt.sounds[t].mute());for(yt._wD(gt+".mute(): Muting all sounds"),e=yt.soundIDs.length-1;e>=0;e--)yt.sounds[yt.soundIDs[e]].mute();return yt.muted=!0,!0},this.muteAll=function(){yt.mute()},this.unmute=function(t){var e;if(t instanceof String&&(t=null),t)return!!Q(t)&&(yt._wD(gt+'.unmute(): Unmuting "'+t+'"'),yt.sounds[t].unmute());for(yt._wD(gt+".unmute(): Unmuting all sounds"),e=yt.soundIDs.length-1;e>=0;e--)yt.sounds[yt.soundIDs[e]].unmute();return yt.muted=!1,!0},this.unmuteAll=function(){yt.unmute()},this.toggleMute=function(t){return!!Q(t)&&yt.sounds[t].toggleMute()},this.getMemoryUse=function(){var t=0;return mt&&8!==l&&(t=parseInt(mt._getMemoryUse(),10)),t},this.disable=function(t){var e;if(t===i&&(t=!1),Lt)return!1;for(Lt=!0,h("shutdown",1),e=yt.soundIDs.length-1;e>=0;e--)q(yt.sounds[yt.soundIDs[e]]);return q(yt),f(t),it.remove(o,"load",g),!0},this.canPlayMIME=function(t){var e;return yt.hasHTML5&&(e=$({type:t})),!e&&jt&&(e=t&&yt.ok()?!!(l>8&&t.match(ae)||t.match(yt.mimePattern)):null),e},this.canPlayURL=function(t){var e;return yt.hasHTML5&&(e=$({url:t})),!e&&jt&&(e=t&&yt.ok()?!!t.match(yt.filePattern):null),e},this.canPlayLink=function(t){return!(t.type===i||!t.type||!yt.canPlayMIME(t.type))||yt.canPlayURL(t.href)},this.getSoundById=function(t,e){if(!t)return null;var n=yt.sounds[t];return n||e||yt._wD(gt+'.getSoundById(): Sound "'+t+'" not found.',2),n},this.onready=function(t,e){var n="onready";if("function"!=typeof t)throw F("needFunction",n);return xt&&yt._wD(F("queue",n)),e||(e=o),v(n,t,e),m(),!0},this.ontimeout=function(t,e){var n="ontimeout";if("function"!=typeof t)throw F("needFunction",n);return xt&&yt._wD(F("queue",n)),e||(e=o),v(n,t,e),m({type:n}),!0},this._writeDebug=function(t,e){var n,o;return!(!yt.setupOptions.debugMode||!(Jt&&yt.useConsole&&(e&&"object"==typeof e?console.log(t,e):Et[e]!==i?console[Et[e]](t):console.log(t),yt.consoleOnly))&&(!(n=r("soundmanager-debug"))||(o=_t.createElement("div"),++Pt%2==0&&(o.className="sm2-alt"),e=e===i?0:parseInt(e,10),o.appendChild(_t.createTextNode(t)),e&&(e>=2&&(o.style.fontWeight="bold"),3===e&&(o.style.color="#ff3333")),n.insertBefore(o,n.firstChild),n=null,0)))},-1!==wt.indexOf("sm2-debug=alert")&&(this._writeDebug=function(t){o.alert(t)}),this._wD=this._writeDebug,this._debug=function(){var t,e;for(h("currentObj",1),t=0,e=yt.soundIDs.length;t<e;t++)yt.sounds[yt.soundIDs[t]]._debug()},this.reboot=function(t,e){var n,r,i;for(yt.soundIDs.length&&yt._wD("Destroying "+yt.soundIDs.length+" SMSound object"+(1!==yt.soundIDs.length?"s":"")+"..."),n=yt.soundIDs.length-1;n>=0;n--)yt.sounds[yt.soundIDs[n]].destruct();if(mt)try{Gt&&(Tt=mt.innerHTML),It=mt.parentNode.removeChild(mt)}catch(t){h("badRemove",2)}if(Tt=It=jt=mt=null,yt.enabled=L=xt=qt=Rt=Ot=St=Lt=Nt=yt.swfLoaded=!1,yt.soundIDs=[],yt.sounds={},Ut=0,pt=!1,t)kt=[];else for(n in kt)if(kt.hasOwnProperty(n))for(r=0,i=kt[n].length;r<i;r++)kt[n][r].fired=!1;return e||yt._wD(gt+": Rebooting..."),yt.html5={usingFlash:null},yt.flash={},yt.html5Only=!1,yt.ignoreFlash=!1,o.setTimeout((function(){e||yt.beginDelayedInit()}),20),yt},this.reset=function(){return h("reset"),yt.reboot(!0,!0)},this.getMoviePercent=function(){return mt&&"PercentLoaded"in mt?mt.PercentLoaded():null},this.beginDelayedInit=function(){Mt=!0,S(),setTimeout((function(){return!Rt&&(P(),O(),Rt=!0,!0)}),20),A()},this.destruct=function(){yt._wD(gt+".destruct()"),yt.disable(!0)},n=function(t){var e,n,r,o,a,s,u,f,p,y,v=this,m=!1,g=[],A=0,b=null;p={duration:null,time:null},this.id=t.id,this.sID=this.id,this.url=t.url,this.options=d(t),this.instanceOptions=this.options,this._iO=this.instanceOptions,this.pan=this.options.pan,this.volume=this.options.volume,this.isHTML5=!1,this._a=null,y=!this.url,this.id3={},this._debug=function(){yt._wD(v.id+": Merged options:",v.options)},this.load=function(t){var e;if(t!==i?v._iO=d(t,v.options):(t=v.options,v._iO=t,b&&b!==v.url&&(h("manURL"),v._iO.url=v.url,v.url=null)),v._iO.url||(v._iO.url=v.url),v._iO.url=Z(v._iO.url),v.instanceOptions=v._iO,e=v._iO,yt._wD(v.id+": load ("+e.url+")"),!e.url&&!v.url)return yt._wD(v.id+": load(): url is unassigned. Exiting.",2),v;if(v.isHTML5||8!==l||v.url||e.autoPlay||yt._wD(v.id+": Flash 8 load() limitation: Wait for onload() before calling play().",1),e.url===v.url&&0!==v.readyState&&2!==v.readyState)return h("onURL",1),3===v.readyState&&e.onload&&dt(v,(function(){e.onload.apply(v,[!!v.duration])})),v;if(v.loaded=!1,v.readyState=1,v.playState=0,v.id3={},J(e))v._setup_html5(e)._called_load?yt._wD(v.id+": Ignoring request to load again"):(v._html5_canplay=!1,v.url!==e.url&&(yt._wD(h("manURL")+": "+e.url),v._a.src=e.url,v.setPosition(0)),v._a.autobuffer="auto",v._a.preload="auto",v._a._called_load=!0);else{if(yt.html5Only)return yt._wD(v.id+": No flash support. Exiting."),v;if(v._iO.url&&v._iO.url.match(/data:/i))return yt._wD(v.id+": data: URIs not supported via Flash. Exiting."),v;try{v.isHTML5=!1,v._iO=H(U(e)),v._iO.autoPlay&&(v._iO.position||v._iO.from)&&(yt._wD(v.id+": Disabling autoPlay because of non-zero offset case"),v._iO.autoPlay=!1),e=v._iO,8===l?mt._load(v.id,e.url,e.stream,e.autoPlay,e.usePolicyFile):mt._load(v.id,e.url,!!e.stream,!!e.autoPlay,e.loops||1,!!e.autoLoad,e.usePolicyFile)}catch(t){h("smError",2),c("onload",!1),E({type:"SMSOUND_LOAD_JS_EXCEPTION",fatal:!0})}}return v.url=e.url,v},this.unload=function(){return 0!==v.readyState&&(yt._wD(v.id+": unload()"),v.isHTML5?(o(),v._a&&(v._a.pause(),b=nt(v._a))):8===l?mt._unload(v.id,re):mt._unload(v.id),e()),v},this.destruct=function(t){yt._wD(v.id+": Destruct"),v.isHTML5?(o(),v._a&&(v._a.pause(),nt(v._a),Nt||r(),v._a._s=null,v._a=null)):(v._iO.onfailure=null,mt._destroySound(v.id)),t||yt.destroySound(v.id,!0)},this.play=function(t,e){var n,r,o,u,c,h,p=!0;if(n=v.id+": play(): ",e=e===i||e,t||(t={}),v.url&&(v._iO.url=v.url),v._iO=d(v._iO,v.options),v._iO=d(t,v._iO),v._iO.url=Z(v._iO.url),v.instanceOptions=v._iO,!v.isHTML5&&v._iO.serverURL&&!v.connected)return v.getAutoPlay()||(yt._wD(n+" Netstream not connected yet - setting autoPlay"),v.setAutoPlay(!0)),v;if(J(v._iO)&&(v._setup_html5(v._iO),a()),1===v.playState&&!v.paused){if(!v._iO.multiShot)return yt._wD(n+"Already playing (one-shot)",1),v.isHTML5&&v.setPosition(v._iO.position),v;yt._wD(n+"Already playing (multi-shot)",1)}if(t.url&&t.url!==v.url&&(v.readyState||v.isHTML5||8!==l||!y?v.load(v._iO):y=!1),v.loaded)yt._wD(n.substr(0,n.lastIndexOf(":")));else if(0===v.readyState){if(yt._wD(n+"Attempting to load"),v.isHTML5||yt.html5Only){if(!v.isHTML5)return yt._wD(n+"Unsupported type. Exiting."),v;v.load(v._iO)}else v._iO.autoPlay=!0,v.load(v._iO);v.instanceOptions=v._iO}else{if(2===v.readyState)return yt._wD(n+"Could not load - exiting",2),v;yt._wD(n+"Loading - attempting to play...")}return!v.isHTML5&&9===l&&v.position>0&&v.position===v.duration&&(yt._wD(n+"Sound at end, resetting to position: 0"),t.position=0),v.paused&&v.position>=0&&(!v._iO.serverURL||v.position>0)?(yt._wD(n+"Resuming from paused state",1),v.resume()):(v._iO=d(t,v._iO),(!v.isHTML5&&null!==v._iO.position&&v._iO.position>0||null!==v._iO.from&&v._iO.from>0||null!==v._iO.to)&&0===v.instanceCount&&0===v.playState&&!v._iO.serverURL&&(o=function(){v._iO=d(t,v._iO),v.play(v._iO)},v.isHTML5&&!v._html5_canplay?(yt._wD(n+"Beginning load for non-zero offset case"),v.load({_oncanplay:o})):v.isHTML5||v.loaded||v.readyState&&2===v.readyState||(yt._wD(n+"Preloading for non-zero offset case"),v.load({onload:o})),v._iO=f()),(!v.instanceCount||v._iO.multiShotEvents||v.isHTML5&&v._iO.multiShot&&!Nt||!v.isHTML5&&l>8&&!v.getAutoPlay())&&v.instanceCount++,v._iO.onposition&&0===v.playState&&s(v),v.playState=1,v.paused=!1,v.position=v._iO.position===i||isNaN(v._iO.position)?0:v._iO.position,v.isHTML5||(v._iO=H(U(v._iO))),v._iO.onplay&&e&&(v._iO.onplay.apply(v),m=!0),v.setVolume(v._iO.volume,!0),v.setPan(v._iO.pan,!0),1!==v._iO.playbackRate&&v.setPlaybackRate(v._iO.playbackRate),v.isHTML5?v.instanceCount<2?(a(),r=v._setup_html5(),v.setPosition(v._iO.position),r.play()):(yt._wD(v.id+": Cloning Audio() for instance #"+v.instanceCount+"..."),u=new Audio(v._iO.url),c=function(){it.remove(u,"ended",c),v._onfinish(v),nt(u),u=null},h=function(){it.remove(u,"canplay",h);try{u.currentTime=v._iO.position/Ht}catch(t){Y(v.id+": multiShot play() failed to apply position of "+v._iO.position/Ht)}u.play()},it.add(u,"ended",c),v._iO.volume!==i&&(u.volume=Math.max(0,Math.min(1,v._iO.volume/100))),v.muted&&(u.muted=!0),v._iO.position?it.add(u,"canplay",h):u.play()):(p=mt._start(v.id,v._iO.loops||1,9===l?v.position:v.position/Ht,v._iO.multiShot||!1),9!==l||p||(yt._wD(n+"No sound hardware, or 32-sound ceiling hit",2),v._iO.onplayerror&&v._iO.onplayerror.apply(v)))),v},this.start=this.play,this.stop=function(t){var e,n=v._iO;return 1===v.playState&&(yt._wD(v.id+": stop()"),v._onbufferchange(0),v._resetOnPosition(0),v.paused=!1,v.isHTML5||(v.playState=0),u(),n.to&&v.clearOnPosition(n.to),v.isHTML5?v._a&&(e=v.position,v.setPosition(0),v.position=e,v._a.pause(),v.playState=0,v._onTimer(),o()):(mt._stop(v.id,t),n.serverURL&&v.unload()),v.instanceCount=0,v._iO={},n.onstop&&n.onstop.apply(v)),v},this.setAutoPlay=function(t){yt._wD(v.id+": Autoplay turned "+(t?"on":"off")),v._iO.autoPlay=t,v.isHTML5||(mt._setAutoPlay(v.id,t),t&&(v.instanceCount||1!==v.readyState||(v.instanceCount++,yt._wD(v.id+": Incremented instance count to "+v.instanceCount))))},this.getAutoPlay=function(){return v._iO.autoPlay},this.setPlaybackRate=function(t){var e=Math.max(.5,Math.min(4,t));if(e!==t&&yt._wD(v.id+": setPlaybackRate("+t+"): limiting rate to "+e,2),v.isHTML5)try{v._iO.playbackRate=e,v._a.playbackRate=e}catch(t){yt._wD(v.id+": setPlaybackRate("+e+") failed: "+t.message,2)}return v},this.setPosition=function(t){t===i&&(t=0);var e,n,r=v.isHTML5?Math.max(t,0):Math.min(v.duration||v._iO.duration,Math.max(t,0));if(v.position=r,n=v.position/Ht,v._resetOnPosition(v.position),v._iO.position=r,v.isHTML5){if(v._a){if(v._html5_canplay){if(v._a.currentTime.toFixed(3)!==n.toFixed(3)){yt._wD(v.id+": setPosition("+n+")");try{v._a.currentTime=n,(0===v.playState||v.paused)&&v._a.pause()}catch(t){yt._wD(v.id+": setPosition("+n+") failed: "+t.message,2)}}}else if(n)return yt._wD(v.id+": setPosition("+n+"): Cannot seek yet, sound not ready",2),v;v.paused&&v._onTimer(!0)}}else e=9===l?v.position:n,v.readyState&&2!==v.readyState&&mt._setPosition(v.id,e,v.paused||!v.playState,v._iO.multiShot);return v},this.pause=function(t){return v.paused||0===v.playState&&1!==v.readyState||(yt._wD(v.id+": pause()"),v.paused=!0,v.isHTML5?(v._setup_html5().pause(),o()):(t||t===i)&&mt._pause(v.id,v._iO.multiShot),v._iO.onpause&&v._iO.onpause.apply(v)),v},this.resume=function(){var t=v._iO;return v.paused?(yt._wD(v.id+": resume()"),v.paused=!1,v.playState=1,v.isHTML5?(v._setup_html5().play(),a()):(t.isMovieStar&&!t.serverURL&&v.setPosition(v.position),mt._pause(v.id,t.multiShot)),!m&&t.onplay?(t.onplay.apply(v),m=!0):t.onresume&&t.onresume.apply(v),v):v},this.togglePause=function(){return yt._wD(v.id+": togglePause()"),0===v.playState?(v.play({position:9!==l||v.isHTML5?v.position/Ht:v.position}),v):(v.paused?v.resume():v.pause(),v)},this.setPan=function(t,e){return t===i&&(t=0),e===i&&(e=!1),v.isHTML5||mt._setPan(v.id,t),v._iO.pan=t,e||(v.pan=t,v.options.pan=t),v},this.setVolume=function(t,e){return t===i&&(t=100),e===i&&(e=!1),v.isHTML5?v._a&&(yt.muted&&!v.muted&&(v.muted=!0,v._a.muted=!0),v._a.volume=Math.max(0,Math.min(1,t/100))):mt._setVolume(v.id,yt.muted&&!v.muted||v.muted?0:t),v._iO.volume=t,e||(v.volume=t,v.options.volume=t),v},this.mute=function(){return v.muted=!0,v.isHTML5?v._a&&(v._a.muted=!0):mt._setVolume(v.id,0),v},this.unmute=function(){v.muted=!1;var t=v._iO.volume!==i;return v.isHTML5?v._a&&(v._a.muted=!1):mt._setVolume(v.id,t?v._iO.volume:v.options.volume),v},this.toggleMute=function(){return v.muted?v.unmute():v.mute()},this.onPosition=function(t,e,n){return g.push({position:parseInt(t,10),method:e,scope:n!==i?n:v,fired:!1}),v},this.onposition=this.onPosition,this.clearOnPosition=function(t,e){var n;if(t=parseInt(t,10),!isNaN(t))for(n=0;n<g.length;n++)t===g[n].position&&(e&&e!==g[n].method||(g[n].fired&&A--,g.splice(n,1)))},this._processOnPosition=function(){var t,e,n=g.length;if(!n||!v.playState||A>=n)return!1;for(t=n-1;t>=0;t--)!(e=g[t]).fired&&v.position>=e.position&&(e.fired=!0,A++,e.method.apply(e.scope,[e.position]),n=g.length);return!0},this._resetOnPosition=function(t){var e,n,r=g.length;if(!r)return!1;for(e=r-1;e>=0;e--)(n=g[e]).fired&&t<=n.position&&(n.fired=!1,A--);return!0},f=function(){var t,e,n=v._iO,r=n.from,o=n.to;return e=function(){yt._wD(v.id+': "To" time of '+o+" reached."),v.clearOnPosition(o,e),v.stop()},t=function(){yt._wD(v.id+': Playing "from" '+r),null===o||isNaN(o)||v.onPosition(o,e)},null===r||isNaN(r)||(n.position=r,n.multiShot=!1,t()),n},s=function(){var t,e=v._iO.onposition;if(e)for(t in e)e.hasOwnProperty(t)&&v.onPosition(parseInt(t,10),e[t])},u=function(){var t,e=v._iO.onposition;if(e)for(t in e)e.hasOwnProperty(t)&&v.clearOnPosition(parseInt(t,10))},a=function(){v.isHTML5&&G(v)},o=function(){v.isHTML5&&z(v)},(e=function(t){t||(g=[],A=0),m=!1,v._hasTimer=null,v._a=null,v._html5_canplay=!1,v.bytesLoaded=null,v.bytesTotal=null,v.duration=v._iO&&v._iO.duration?v._iO.duration:null,v.durationEstimate=null,v.buffered=[],v.eqData=[],v.eqData.left=[],v.eqData.right=[],v.failures=0,v.isBuffering=!1,v.instanceOptions={},v.instanceCount=0,v.loaded=!1,v.metadata={},v.readyState=0,v.muted=!1,v.paused=!1,v.peakData={left:0,right:0},v.waveformData={left:[],right:[]},v.playState=0,v.position=null,v.id3={}})(),this._onTimer=function(t){var e,n,r=!1,o={};return(v._hasTimer||t)&&v._a&&(t||(v.playState>0||1===v.readyState)&&!v.paused)&&((e=v._get_html5_duration())!==p.duration&&(p.duration=e,v.duration=e,r=!0),v.durationEstimate=v.duration,(n=v._a.currentTime*Ht||0)!==p.time&&(p.time=n,r=!0),(r||t)&&v._whileplaying(n,o,o,o,o)),r},this._get_html5_duration=function(){var t=v._iO,e=v._a&&v._a.duration?v._a.duration*Ht:t&&t.duration?t.duration:null;return e&&!isNaN(e)&&e!==1/0?e:null},this._apply_loop=function(t,e){!t.loop&&e>1&&yt._wD("Note: Native HTML5 looping is infinite.",1),t.loop=e>1?"loop":""},this._setup_html5=function(t){var r,o=d(v._iO,t),i=Nt?vt:v._a,a=decodeURI(o.url);if(Nt?a===decodeURI(at)&&(r=!0):a===decodeURI(b)&&(r=!0),i){if(i._s)if(Nt)i._s&&i._s.playState&&!r&&i._s.stop();else if(!Nt&&a===decodeURI(b))return v._apply_loop(i,o.loops),i;r||(b&&e(!1),i.src=o.url,v.url=o.url,b=o.url,at=o.url,i._called_load=!1)}else o.autoLoad||o.autoPlay?(v._a=new Audio(o.url),v._a.load()):v._a=Zt&&opera.version()<10?new Audio(null):new Audio,(i=v._a)._called_load=!1,Nt&&(vt=i);return v.isHTML5=!0,v._a=i,i._s=v,n(),v._apply_loop(i,o.loops),o.autoLoad||o.autoPlay?v.load():(i.autobuffer=!1,i.preload="auto"),i},n=function(){if(v._a._added_events)return!1;var t,e,n;for(t in v._a._added_events=!0,ct)ct.hasOwnProperty(t)&&(e=t,n=ct[t],void 0,v._a&&v._a.addEventListener(e,n,!1));return!0},r=function(){var t,e,n;for(t in yt._wD(v.id+": Removing event listeners"),v._a._added_events=!1,ct)ct.hasOwnProperty(t)&&(e=t,n=ct[t],void 0,v._a&&v._a.removeEventListener(e,n,!1))},this._onload=function(t){var e,n=!!t||!v.isHTML5&&8===l&&v.duration;return e=v.id+": ",yt._wD(e+(n?"onload()":"Failed to load / invalid sound?"+(v.duration?" -":" Zero-length duration reported.")+" ("+v.url+")"),n?1:2),n||v.isHTML5||(!0===yt.sandbox.noRemote&&yt._wD(e+F("noNet"),1),!0===yt.sandbox.noLocal&&yt._wD(e+F("noLocal"),1)),v.loaded=n,v.readyState=n?3:2,v._onbufferchange(0),n||v.isHTML5||v._onerror(),v._iO.onload&&dt(v,(function(){v._iO.onload.apply(v,[n])})),!0},this._onerror=function(t,e){v._iO.onerror&&dt(v,(function(){v._iO.onerror.apply(v,[t,e])}))},this._onbufferchange=function(t){return!(0===v.playState||t&&v.isBuffering||!t&&!v.isBuffering||(v.isBuffering=1===t,v._iO.onbufferchange&&(yt._wD(v.id+": Buffer state change: "+t),v._iO.onbufferchange.apply(v,[t])),0))},this._onsuspend=function(){return v._iO.onsuspend&&(yt._wD(v.id+": Playback suspended"),v._iO.onsuspend.apply(v)),!0},this._onfailure=function(t,e,n){v.failures++,yt._wD(v.id+": Failure ("+v.failures+"): "+t),v._iO.onfailure&&1===v.failures?v._iO.onfailure(t,e,n):yt._wD(v.id+": Ignoring failure")},this._onwarning=function(t,e,n){v._iO.onwarning&&v._iO.onwarning(t,e,n)},this._onfinish=function(){var t=v._iO.onfinish;v._onbufferchange(0),v._resetOnPosition(0),v.instanceCount&&(v.instanceCount--,v.instanceCount||(u(),v.playState=0,v.paused=!1,v.instanceCount=0,v.instanceOptions={},v._iO={},o(),v.isHTML5&&(v.position=0)),v.instanceCount&&!v._iO.multiShotEvents||t&&(yt._wD(v.id+": onfinish()"),dt(v,(function(){t.apply(v)}))))},this._whileloading=function(t,e,n,r){var o=v._iO;v.bytesLoaded=t,v.bytesTotal=e,v.duration=Math.floor(n),v.bufferLength=r,v.isHTML5||o.isMovieStar?v.durationEstimate=v.duration:o.duration?v.durationEstimate=v.duration>o.duration?v.duration:o.duration:v.durationEstimate=parseInt(v.bytesTotal/v.bytesLoaded*v.duration,10),v.isHTML5||(v.buffered=[{start:0,end:v.duration}]),(3!==v.readyState||v.isHTML5)&&o.whileloading&&o.whileloading.apply(v)},this._whileplaying=function(t,e,n,r,o){var a,s=v._iO;return!isNaN(t)&&null!==t&&(v.position=Math.max(0,t),v._processOnPosition(),!v.isHTML5&&l>8&&(s.usePeakData&&e!==i&&e&&(v.peakData={left:e.leftPeak,right:e.rightPeak}),s.useWaveformData&&n!==i&&n&&(v.waveformData={left:n.split(","),right:r.split(",")}),s.useEQData&&o!==i&&o&&o.leftEQ&&(a=o.leftEQ.split(","),v.eqData=a,v.eqData.left=a,o.rightEQ!==i&&o.rightEQ&&(v.eqData.right=o.rightEQ.split(",")))),1===v.playState&&(v.isHTML5||8!==l||v.position||!v.isBuffering||v._onbufferchange(0),s.whileplaying&&s.whileplaying.apply(v)),!0)},this._oncaptiondata=function(t){yt._wD(v.id+": Caption data received."),v.captiondata=t,v._iO.oncaptiondata&&v._iO.oncaptiondata.apply(v,[t])},this._onmetadata=function(t,e){yt._wD(v.id+": Metadata received.");var n,r,o={};for(n=0,r=t.length;n<r;n++)o[t[n]]=e[n];v.metadata=o,v._iO.onmetadata&&v._iO.onmetadata.call(v,v.metadata)},this._onid3=function(t,e){yt._wD(v.id+": ID3 data received.");var n,r,o=[];for(n=0,r=t.length;n<r;n++)o[t[n]]=e[n];v.id3=d(v.id3,o),v._iO.onid3&&v._iO.onid3.apply(v)},this._onconnect=function(t){t=1===t,yt._wD(v.id+": "+(t?"Connected.":"Failed to connect? - "+v.url),t?1:2),v.connected=t,t&&(v.failures=0,Q(v.id)&&(v.getAutoPlay()?v.play(i,v.getAutoPlay()):v._iO.autoLoad&&v.load()),v._iO.onconnect&&v._iO.onconnect.apply(v,[t]))},this._ondataerror=function(t){v.playState>0&&(yt._wD(v.id+": Data error: "+t),v._iO.ondataerror&&v._iO.ondataerror.apply(v))},this._debug()},M=function(){return _t.body||_t.getElementsByTagName("div")[0]},r=function(t){return _t.getElementById(t)},d=function(t,e){var n,r,o=t||{};for(r in n=e===i?yt.defaultOptions:e)n.hasOwnProperty(r)&&o[r]===i&&("object"!=typeof n[r]||null===n[r]?o[r]=n[r]:o[r]=d(o[r],n[r]));return o},dt=function(t,e){t.isHTML5||8!==l?e():o.setTimeout(e,0)},y={onready:1,ontimeout:1,defaultOptions:1,flash9Options:1,movieStarOptions:1},p=function(t,e){var n,r=!0,o=e!==i,a=yt.setupOptions,s=y;if(t===i){for(n in r=[],a)a.hasOwnProperty(n)&&r.push(n);for(n in s)s.hasOwnProperty(n)&&("object"==typeof yt[n]?r.push(n+": {...}"):yt[n]instanceof Function?r.push(n+": function() {...}"):r.push(n));return yt._wD(F("setup",r.join(", "))),!1}for(n in t)if(t.hasOwnProperty(n))if("object"!=typeof t[n]||null===t[n]||t[n]instanceof Array||t[n]instanceof RegExp)o&&s[e]!==i?yt[e][n]=t[n]:a[n]!==i?(yt.setupOptions[n]=t[n],yt[n]=t[n]):s[n]===i?(Y(F(yt[n]===i?"setupUndef":"setupError",n),2),r=!1):yt[n]instanceof Function?yt[n].apply(yt,t[n]instanceof Array?t[n]:[t[n]]):yt[n]=t[n];else{if(s[n]!==i)return p(t[n],n);Y(F(yt[n]===i?"setupUndef":"setupError",n),2),r=!1}return r},it=function(){var t=o.attachEvent,e={add:t?"attachEvent":"addEventListener",remove:t?"detachEvent":"removeEventListener"};function n(e){var n=Bt.call(e),r=n.length;return t?(n[1]="on"+n[1],r>3&&n.pop()):3===r&&n.push(!1),n}function r(n,r){var o=n.shift(),i=[e[r]];t?o[i](n[0],n[1]):o[i].apply(o,n)}return{add:function(){r(n(arguments),"add")},remove:function(){r(n(arguments),"remove")}}}(),ct={abort:ce((function(){yt._wD(this._s.id+": abort")})),canplay:ce((function(){var t,e=this._s;if(!e._html5_canplay){if(e._html5_canplay=!0,yt._wD(e.id+": canplay"),e._onbufferchange(0),t=e._iO.position===i||isNaN(e._iO.position)?null:e._iO.position/Ht,this.currentTime!==t){yt._wD(e.id+": canplay: Setting position to "+t);try{this.currentTime=t}catch(n){yt._wD(e.id+": canplay: Setting position of "+t+" failed: "+n.message,2)}}e._iO._oncanplay&&e._iO._oncanplay()}})),canplaythrough:ce((function(){var t=this._s;t.loaded||(t._onbufferchange(0),t._whileloading(t.bytesLoaded,t.bytesTotal,t._get_html5_duration()),t._onload(!0))})),durationchange:ce((function(){var t,e=this._s;t=e._get_html5_duration(),isNaN(t)||t===e.duration||(yt._wD(this._s.id+": durationchange ("+t+")"+(e.duration?", previously "+e.duration:"")),e.durationEstimate=e.duration=t)})),ended:ce((function(){var t=this._s;yt._wD(t.id+": ended"),t._onfinish()})),error:ce((function(){var t=tt[this.error.code]||null;yt._wD(this._s.id+": HTML5 error, code "+this.error.code+(t?" ("+t+")":"")),this._s._onload(!1),this._s._onerror(this.error.code,t)})),loadeddata:ce((function(){var t=this._s;yt._wD(t.id+": loadeddata"),t._loaded||Kt||(t.duration=t._get_html5_duration())})),loadedmetadata:ce((function(){yt._wD(this._s.id+": loadedmetadata")})),loadstart:ce((function(){yt._wD(this._s.id+": loadstart"),this._s._onbufferchange(1)})),play:ce((function(){this._s._onbufferchange(0)})),playing:ce((function(){yt._wD(this._s.id+": playing "+String.fromCharCode(9835)),this._s._onbufferchange(0)})),progress:ce((function(t){var e,n,r,o=this._s,i=0,a="progress"===t.type,s=t.target.buffered,u=t.loaded||0,l=t.total||1;if(o.buffered=[],s&&s.length){for(e=0,n=s.length;e<n;e++)o.buffered.push({start:s.start(e)*Ht,end:s.end(e)*Ht});if(i=(s.end(0)-s.start(0))*Ht,u=Math.min(1,i/(t.target.duration*Ht)),a&&s.length>1){for(r=[],n=s.length,e=0;e<n;e++)r.push(t.target.buffered.start(e)*Ht+"-"+t.target.buffered.end(e)*Ht);yt._wD(this._s.id+": progress, timeRanges: "+r.join(", "))}a&&!isNaN(u)&&yt._wD(this._s.id+": progress, "+Math.floor(100*u)+"% loaded")}isNaN(u)||(o._whileloading(u,l,o._get_html5_duration()),u&&l&&u===l&&ct.canplaythrough.call(this,t))})),ratechange:ce((function(){yt._wD(this._s.id+": ratechange")})),suspend:ce((function(t){var e=this._s;yt._wD(this._s.id+": suspend"),ct.progress.call(this,t),e._onsuspend()})),stalled:ce((function(){yt._wD(this._s.id+": stalled")})),timeupdate:ce((function(){this._s._onTimer()})),waiting:ce((function(){var t=this._s;yt._wD(this._s.id+": waiting"),t._onbufferchange(1)}))},J=function(t){return!(!t||!(t.type||t.url||t.serverURL))&&!(t.serverURL||t.type&&le(t.type))&&(t.type?$({type:t.type}):$({url:t.url})||yt.html5Only||t.url.match(/data:/i))},nt=function(t){var e;return t&&(e=Kt?re:yt.html5.canPlayType("audio/wav")?"data:audio/wave;base64,/UklGRiYAAABXQVZFZm10IBAAAAABAAEARKwAAIhYAQACABAAZGF0YQIAAAD//w==":re,t.src=e,t._called_unload!==i&&(t._called_load=!1)),Nt&&(at=null),e},$=function(t){if(!yt.useHTML5Audio||!yt.hasHTML5)return!1;var e,n,r,o,a=t.url||null,s=t.type||null,u=yt.audioFormats;if(s&&yt.html5[s]!==i)return yt.html5[s]&&!le(s);if(!et){for(o in et=[],u)u.hasOwnProperty(o)&&(et.push(o),u[o].related&&(et=et.concat(u[o].related)));et=new RegExp("\\.("+et.join("|")+")(\\?.*)?$","i")}return(r=a?a.toLowerCase().match(et):null)&&r.length?r=r[1]:s?r=(-1!==(n=s.indexOf(";"))?s.substr(0,n):s).substr(6):e=!1,r&&yt.html5[r]!==i?e=yt.html5[r]&&!le(r):(s="audio/"+r,e=yt.html5.canPlayType({type:s}),yt.html5[r]=e,e=e&&yt.html5[s]&&!le(s)),e},ot=function(){if(!yt.useHTML5Audio||!yt.hasHTML5)return yt.html5.usingFlash=!0,jt=!0,!1;var t,e,n,r,o=Audio!==i?Zt&&opera.version()<10?new Audio(null):new Audio:null,a={};function s(t){var e,n,i=!1,a=!1;if(!o||"function"!=typeof o.canPlayType)return i;if(t instanceof Array){for(r=0,n=t.length;r<n;r++)(yt.html5[t[r]]||o.canPlayType(t[r]).match(yt.html5Test))&&(a=!0,yt.html5[t[r]]=!0,yt.flash[t[r]]=!!t[r].match(ne));i=a}else i=!(!(e=!(!o||"function"!=typeof o.canPlayType)&&o.canPlayType(t))||!e.match(yt.html5Test));return i}for(t in n=yt.audioFormats)if(n.hasOwnProperty(t)&&(e="audio/"+t,a[t]=s(n[t].type),a[e]=a[t],t.match(ne)?(yt.flash[t]=!0,yt.flash[e]=!0):(yt.flash[t]=!1,yt.flash[e]=!1),n[t]&&n[t].related))for(r=n[t].related.length-1;r>=0;r--)a["audio/"+n[t].related[r]]=a[t],yt.html5[n[t].related[r]]=a[t],yt.flash[n[t].related[r]]=a[t];return a.canPlayType=o?s:null,yt.html5=d(yt.html5,a),yt.html5.usingFlash=X(),jt=yt.html5.usingFlash,!0},V={notReady:"Unavailable - wait until onready() has fired.",notOK:"Audio support is not available.",domError:gt+"exception caught while appending SWF to DOM.",spcWmode:"Removing wmode, preventing known SWF loading issue(s)",swf404:At+"Verify that %s is a valid path.",tryDebug:"Try "+gt+".debugFlash = true for more security details (output goes to SWF.)",checkSWF:"See SWF output for more debug info.",localFail:At+"Non-HTTP page ("+_t.location.protocol+" URL?) Review Flash player security settings for this special case:\nhttp://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html\nMay need to add/allow path, eg. c:/sm2/ or /users/me/sm2/",waitFocus:At+"Special case: Waiting for SWF to load with window focus...",waitForever:At+"Waiting indefinitely for Flash (will recover if unblocked)...",waitSWF:At+"Waiting for 100% SWF load...",needFunction:At+"Function object expected for %s",badID:'Sound ID "%s" should be a string, starting with a non-numeric character',currentObj:At+"_debug(): Current sound objects",waitOnload:At+"Waiting for window.onload()",docLoaded:At+"Document already loaded",onload:At+"initComplete(): calling soundManager.onload()",onloadOK:gt+".onload() complete",didInit:At+"init(): Already called?",secNote:"Flash security note: Network/internet URLs will not load due to security restrictions. Access can be configured via Flash Player Global Security Settings Page: http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html",badRemove:At+"Failed to remove Flash node.",shutdown:gt+".disable(): Shutting down",queue:At+"Queueing %s handler",smError:"SMSound.load(): Exception: JS-Flash communication failed, or JS error.",fbTimeout:"No flash response, applying ."+B.swfTimedout+" CSS...",fbLoaded:"Flash loaded",fbHandler:At+"flashBlockHandler()",manURL:"SMSound.load(): Using manually-assigned URL",onURL:gt+".load(): current URL already assigned.",badFV:gt+'.flashVersion must be 8 or 9. "%s" is invalid. Reverting to %s.',as2loop:"Note: Setting stream:false so looping can work (flash 8 limitation)",noNSLoop:"Note: Looping not implemented for MovieStar formats",needfl9:"Note: Switching to flash 9, required for MP4 formats.",mfTimeout:"Setting flashLoadTimeout = 0 (infinite) for off-screen, mobile flash case",needFlash:At+"Fatal error: Flash is needed to play some required formats, but is not available.",gotFocus:At+"Got window focus.",policy:"Enabling usePolicyFile for data access",setup:gt+".setup(): allowed parameters: %s",setupError:gt+'.setup(): "%s" cannot be assigned with this method.',setupUndef:gt+'.setup(): Could not find option "%s"',setupLate:gt+".setup(): url, flashVersion and html5Test property changes will not take effect until reboot().",noURL:At+"Flash URL required. Call soundManager.setup({url:...}) to get started.",sm2Loaded:"SoundManager 2: Ready. "+String.fromCharCode(10003),reset:gt+".reset(): Removing event callbacks",mobileUA:"Mobile UA detected, preferring HTML5 by default.",globalHTML5:"Using singleton HTML5 Audio() pattern for this device.",ignoreMobile:"Ignoring mobile restrictions for this device."},F=function(){var t,e,n,r,o;if(r=(t=Bt.call(arguments)).shift(),(o=V&&V[r]?V[r]:"")&&t&&t.length)for(e=0,n=t.length;e<n;e++)o=o.replace("%s",t[e]);return o},U=function(t){return 8===l&&t.loops>1&&t.stream&&(h("as2loop"),t.stream=!1),t},H=function(t,e){return t&&!t.usePolicyFile&&(t.onid3||t.usePeakData||t.useWaveformData||t.useEQData)&&(yt._wD((e||"")+F("policy")),t.usePolicyFile=!0),t},Y=function(t){Jt&&console.warn!==i?console.warn(t):yt._wD(t)},a=function(){return!1},q=function(t){var e;for(e in t)t.hasOwnProperty(e)&&"function"==typeof t[e]&&(t[e]=a);e=null},R=function(t){t===i&&(t=!1),(Lt||t)&&yt.disable(t)},D=function(t){var e;if(t)if(t.match(/\.swf(\?.*)?$/i)){if(t.substr(t.toLowerCase().lastIndexOf(".swf?")+4))return t}else t.lastIndexOf("/")!==t.length-1&&(t+="/");return e=(t&&-1!==t.lastIndexOf("/")?t.substr(0,t.lastIndexOf("/")+1):"./")+yt.movieURL,yt.noSWFCache&&(e+="?ts="+(new Date).getTime()),e},_=function(){8!==(l=parseInt(yt.flashVersion,10))&&9!==l&&(yt._wD(F("badFV",l,8)),yt.flashVersion=l=8);var t=yt.debugMode||yt.debugFlash?"_debug.swf":".swf";yt.useHTML5Audio&&!yt.html5Only&&yt.audioFormats.mp4.required&&l<9&&(yt._wD(F("needfl9")),yt.flashVersion=l=9),yt.version=yt.versionNumber+(yt.html5Only?" (HTML5-only mode)":9===l?" (AS3/Flash 9)":" (AS2/Flash 8)"),l>8?(yt.defaultOptions=d(yt.defaultOptions,yt.flash9Options),yt.features.buffering=!0,yt.defaultOptions=d(yt.defaultOptions,yt.movieStarOptions),yt.filePatterns.flash9=new RegExp("\\.(mp3|"+se.join("|")+")(\\?.*)?$","i"),yt.features.movieStar=!0):yt.features.movieStar=!1,yt.filePattern=yt.filePatterns[8!==l?"flash9":"flash8"],yt.movieURL=(8===l?"soundmanager2.swf":"soundmanager2_flash9.swf").replace(".swf",t),yt.features.peakData=yt.features.waveformData=yt.features.eqData=l>8},I=function(t,e){mt&&mt._setPolling(t,e)},T=function(){if(yt.debugURLParam.test(wt)&&(yt.setupOptions.debugMode=yt.debugMode=!0),!r(yt.debugID)){var t,e,n,o,i;if(yt.debugMode&&!r(yt.debugID)&&(!Jt||!yt.useConsole||!yt.consoleOnly)){for(i in(t=_t.createElement("div")).id=yt.debugID+"-toggle",o={position:"fixed",bottom:"0px",right:"0px",width:"1.2em",height:"1.2em",lineHeight:"1.2em",margin:"2px",textAlign:"center",border:"1px solid #999",cursor:"pointer",background:"#fff",color:"#333",zIndex:10001},t.appendChild(_t.createTextNode("-")),t.onclick=N,t.title="Toggle SM2 debug console",bt.match(/msie 6/i)&&(t.style.position="absolute",t.style.cursor="hand"),o)o.hasOwnProperty(i)&&(t.style[i]=o[i]);if((e=_t.createElement("div")).id=yt.debugID,e.style.display=yt.debugMode?"block":"none",yt.debugMode&&!r(t.id)){try{(n=M()).appendChild(t)}catch(t){throw new Error(F("domError")+" \n"+t.toString())}n.appendChild(e)}}n=null}},Q=this.getSoundById,h=function(t,e){return t?yt._wD(F(t),e):""},N=function(){var t=r(yt.debugID),e=r(yt.debugID+"-toggle");t&&(Vt?(e.innerHTML="+",t.style.display="none"):(e.innerHTML="-",t.style.display="block"),Vt=!Vt)},c=function(t,e,n){if(o.sm2Debugger!==i)try{sm2Debugger.handleEvent(t,e,n)}catch(t){return!1}return!0},j=function(){var t=[];return yt.debugMode&&t.push(B.sm2Debug),yt.debugFlash&&t.push(B.flashDebug),yt.useHighPerformance&&t.push(B.highPerf),t.join(" ")},C=function(){var t=F("fbHandler"),e=yt.getMoviePercent(),n=B,r={type:"FLASHBLOCK"};yt.html5Only||(yt.ok()?(yt.didFlashBlock&&yt._wD(t+": Unblocked"),yt.oMC&&(yt.oMC.className=[j(),n.swfDefault,n.swfLoaded+(yt.didFlashBlock?" "+n.swfUnblocked:"")].join(" "))):(jt&&(yt.oMC.className=j()+" "+n.swfDefault+" "+(null===e?n.swfTimedout:n.swfError),yt._wD(t+": "+F("fbTimeout")+(e?" ("+F("fbLoaded")+")":""))),yt.didFlashBlock=!0,m({type:"ontimeout",ignoreInit:!0,error:r}),E(r)))},v=function(t,e,n){kt[t]===i&&(kt[t]=[]),kt[t].push({method:e,scope:n||null,fired:!1})},m=function(t){if(t||(t={type:yt.ok()?"onready":"ontimeout"}),!xt&&t&&!t.ignoreInit)return!1;if("ontimeout"===t.type&&(yt.ok()||Lt&&!t.ignoreInit))return!1;var e,n,r={success:t&&t.ignoreInit?yt.ok():!Lt},o=t&&t.type&&kt[t.type]||[],i=[],a=[r],s=jt&&!yt.ok();for(t.error&&(a[0].error=t.error),e=0,n=o.length;e<n;e++)!0!==o[e].fired&&i.push(o[e]);if(i.length)for(e=0,n=i.length;e<n;e++)i[e].scope?i[e].method.apply(i[e].scope,a):i[e].method.apply(this,a),s||(i[e].fired=!0);return!0},g=function(){o.setTimeout((function(){yt.useFlashBlock&&C(),m(),"function"==typeof yt.onload&&(h("onload",1),yt.onload.apply(o),h("onloadOK",1)),yt.waitForWindowLoad&&it.add(o,"load",g)}),1)},ut=function(){if(st!==i)return st;var t,e,n,r,a=!1,s=navigator,u=o.ActiveXObject;try{r=s.plugins}catch(t){r=void 0}if(r&&r.length)e="application/x-shockwave-flash",(n=s.mimeTypes)&&n[e]&&n[e].enabledPlugin&&n[e].enabledPlugin.description&&(a=!0);else if(u!==i&&!bt.match(/MSAppHost/i)){try{t=new u("ShockwaveFlash.ShockwaveFlash")}catch(e){t=null}a=!!t,t=null}return st=a,a},X=function(){var t,e,n=yt.audioFormats;if(Yt&&bt.match(/os (1|2|3_0|3_1)\s/i)?(yt.hasHTML5=!1,yt.html5Only=!0,yt.oMC&&(yt.oMC.style.display="none")):yt.useHTML5Audio&&(yt.html5&&yt.html5.canPlayType||(yt._wD("SoundManager: No HTML5 Audio() support detected."),yt.hasHTML5=!1),Xt&&yt._wD(At+"Note: Buggy HTML5 Audio in Safari on this OS X release, see https://bugs.webkit.org/show_bug.cgi?id=32159 - "+(st?"will use flash fallback for MP3/MP4, if available":" would use flash fallback for MP3/MP4, but none detected."),1)),yt.useHTML5Audio&&yt.hasHTML5)for(e in W=!0,n)n.hasOwnProperty(e)&&n[e].required&&(yt.html5.canPlayType(n[e].type)?yt.preferFlash&&(yt.flash[e]||yt.flash[n[e].type])&&(t=!0):(W=!1,t=!0));return yt.ignoreFlash&&(t=!1,W=!0),yt.html5Only=yt.hasHTML5&&yt.useHTML5Audio&&!t,!yt.html5Only},Z=function(t){var e,n,r,o=0;if(t instanceof Array){for(e=0,n=t.length;e<n;e++)if(t[e]instanceof Object){if(yt.canPlayMIME(t[e].type)){o=e;break}}else if(yt.canPlayURL(t[e])){o=e;break}t[o].url&&(t[o]=t[o].url),r=t[o]}else r=t;return r},G=function(t){t._hasTimer||(t._hasTimer=!0,!Wt&&yt.html5PollingInterval&&(null===Ft&&0===Dt&&(Ft=setInterval(K,yt.html5PollingInterval)),Dt++))},z=function(t){t._hasTimer&&(t._hasTimer=!1,!Wt&&yt.html5PollingInterval&&Dt--)},K=function(){var t;if(null!==Ft&&!Dt)return clearInterval(Ft),void(Ft=null);for(t=yt.soundIDs.length-1;t>=0;t--)yt.sounds[yt.soundIDs[t]].isHTML5&&yt.sounds[yt.soundIDs[t]]._hasTimer&&yt.sounds[yt.soundIDs[t]]._onTimer()},E=function(t){t=t!==i?t:{},"function"==typeof yt.onerror&&yt.onerror.apply(o,[{type:t.type!==i?t.type:null}]),t.fatal!==i&&t.fatal&&yt.disable()},lt=function(){if(Xt&&ut()){var t,e,n=yt.audioFormats;for(e in n)if(n.hasOwnProperty(e)&&("mp3"===e||"mp4"===e)&&(yt._wD(gt+": Using flash fallback for "+e+" format"),yt.html5[e]=!1,n[e]&&n[e].related))for(t=n[e].related.length-1;t>=0;t--)yt.html5[n[e].related[t]]=!1}},this._setSandboxType=function(t){var e=yt.sandbox;e.type=t,e.description=e.types[e.types[t]!==i?t:"unknown"],"localWithFile"===e.type?(e.noRemote=!0,e.noLocal=!1,h("secNote",2)):"localWithNetwork"===e.type?(e.noRemote=!1,e.noLocal=!0):"localTrusted"===e.type&&(e.noRemote=!1,e.noLocal=!1)},this._externalInterfaceOK=function(t){if(!yt.swfLoaded){var e;if(c("swf",!0),c("flashtojs",!0),yt.swfLoaded=!0,te=!1,Xt&<(),!t||t.replace(/\+dev/i,"")!==yt.versionNumber.replace(/\+dev/i,""))return e=gt+': Fatal: JavaScript file build "'+yt.versionNumber+'" does not match Flash SWF build "'+t+'" at '+yt.url+". Ensure both are up-to-date.",void setTimeout((function(){throw new Error(e)}),0);setTimeout(u,Gt?100:1)}},P=function(t,e){if(Ot&&St)return!1;function n(){var t,e=[],n=[];t="SoundManager "+yt.version+(!yt.html5Only&&yt.useHTML5Audio?yt.hasHTML5?" + HTML5 audio":", no HTML5 audio support":""),yt.html5Only?yt.html5PollingInterval&&e.push("html5PollingInterval ("+yt.html5PollingInterval+"ms)"):(yt.preferFlash&&e.push("preferFlash"),yt.useHighPerformance&&e.push("useHighPerformance"),yt.flashPollingInterval&&e.push("flashPollingInterval ("+yt.flashPollingInterval+"ms)"),yt.html5PollingInterval&&e.push("html5PollingInterval ("+yt.html5PollingInterval+"ms)"),yt.wmode&&e.push("wmode ("+yt.wmode+")"),yt.debugFlash&&e.push("debugFlash"),yt.useFlashBlock&&e.push("flashBlock")),e.length&&(n=n.concat([e.join(" + ")])),yt._wD(t+(n.length?" + "+n.join(", "):""),1),ht()}if(yt.html5Only)return _(),n(),yt.oMC=r(yt.movieID),u(),Ot=!0,St=!0,!1;var o,a,s,l,c,h,f,d,p,y=e||yt.url,v=yt.altURL||y,m=M(),g=j(),A=_t.getElementsByTagName("html")[0];function b(t,e){return'<param name="'+t+'" value="'+e+'" />'}if(o=A&&A.dir&&A.dir.match(/rtl/i),t=t===i?yt.id:t,_(),yt.url=D(oe?y:v),e=yt.url,yt.wmode=!yt.wmode&&yt.useHighPerformance?"transparent":yt.wmode,null!==yt.wmode&&(bt.match(/msie 8/i)||!Gt&&!yt.useHighPerformance)&&navigator.platform.match(/win32|win64/i)&&(Ct.push(V.spcWmode),yt.wmode=null),a={name:t,id:t,src:e,quality:"high",allowScriptAccess:yt.allowScriptAccess,bgcolor:yt.bgColor,pluginspage:ie+"www.macromedia.com/go/getflashplayer",title:"JS/Flash audio component (SoundManager 2)",type:"application/x-shockwave-flash",wmode:yt.wmode,hasPriority:"true"},yt.debugFlash&&(a.FlashVars="debug=1"),yt.wmode||delete a.wmode,Gt)s=_t.createElement("div"),c=['<object id="'+t+'" data="'+e+'" type="'+a.type+'" title="'+a.title+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0">',b("movie",e),b("AllowScriptAccess",yt.allowScriptAccess),b("quality",a.quality),yt.wmode?b("wmode",yt.wmode):"",b("bgcolor",yt.bgColor),b("hasPriority","true"),yt.debugFlash?b("FlashVars",a.FlashVars):"","</object>"].join("");else for(l in s=_t.createElement("embed"),a)a.hasOwnProperty(l)&&s.setAttribute(l,a[l]);if(T(),g=j(),m=M())if(yt.oMC=r(yt.movieID)||_t.createElement("div"),yt.oMC.id)p=yt.oMC.className,yt.oMC.className=(p?p+" ":B.swfDefault)+(g?" "+g:""),yt.oMC.appendChild(s),Gt&&((h=yt.oMC.appendChild(_t.createElement("div"))).className=B.swfBox,h.innerHTML=c),St=!0;else{if(yt.oMC.id=yt.movieID,yt.oMC.className=B.swfDefault+" "+g,f=null,h=null,yt.useFlashBlock||(yt.useHighPerformance?f={position:"fixed",width:"8px",height:"8px",bottom:"0px",left:"0px",overflow:"hidden"}:(f={position:"absolute",width:"6px",height:"6px",top:"-9999px",left:"-9999px"},o&&(f.left=Math.abs(parseInt(f.left,10))+"px"))),zt&&(yt.oMC.style.zIndex=1e4),!yt.debugFlash)for(d in f)f.hasOwnProperty(d)&&(yt.oMC.style[d]=f[d]);try{Gt||yt.oMC.appendChild(s),m.appendChild(yt.oMC),Gt&&((h=yt.oMC.appendChild(_t.createElement("div"))).className=B.swfBox,h.innerHTML=c),St=!0}catch(t){throw new Error(F("domError")+" \n"+t.toString())}}return Ot=!0,n(),!0},O=function(){return yt.html5Only?(P(),!1):!mt&&(yt.url?((mt=yt.getMovie(yt.id))||(It?(Gt?yt.oMC.innerHTML=Tt:yt.oMC.appendChild(It),It=null,Ot=!0):P(yt.id,yt.url),mt=yt.getMovie(yt.id)),"function"==typeof yt.oninitmovie&&setTimeout(yt.oninitmovie,1),ft(),!0):(h("noURL"),!1))},A=function(){setTimeout(b,1e3)},w=function(){o.setTimeout((function(){Y(At+"useFlashBlock is false, 100% HTML5 mode is possible. Rebooting with preferFlash: false..."),yt.setup({preferFlash:!1}).reboot(),yt.didFlashBlock=!0,yt.beginDelayedInit()}),1)},b=function(){var t,e=!1;yt.url&&(qt||(qt=!0,it.remove(o,"load",A),st&&te&&!$t?h("waitFocus"):(xt||(t=yt.getMoviePercent())>0&&t<100&&(e=!0),setTimeout((function(){if(t=yt.getMoviePercent(),e)return qt=!1,yt._wD(F("waitSWF")),void o.setTimeout(A,1);xt||(yt._wD(gt+": No Flash response within expected time. Likely causes: "+(0===t?"SWF load failed, ":"")+"Flash blocked or JS-Flash security error."+(yt.debugFlash?" "+F("checkSWF"):""),2),!oe&&t&&(h("localFail",2),yt.debugFlash||h("tryDebug",2)),0===t&&yt._wD(F("swf404",yt.url),1),c("flashtojs",!1,": Timed out"+(oe?" (Check flash security or flash blockers)":" (No plugin/missing SWF?)"))),!xt&&ee&&(null===t?yt.useFlashBlock||0===yt.flashLoadTimeout?(yt.useFlashBlock&&C(),h("waitForever")):!yt.useFlashBlock&&W?w():(h("waitForever"),m({type:"ontimeout",ignoreInit:!0,error:{type:"INIT_FLASHBLOCK"}})):0===yt.flashLoadTimeout?h("waitForever"):!yt.useFlashBlock&&W?w():R(!0))}),yt.flashLoadTimeout))))},k=function(){function t(){it.remove(o,"focus",k)}return $t||!te?(t(),!0):(ee=!0,$t=!0,h("gotFocus"),qt=!1,A(),t(),!0)},ft=function(){Ct.length&&(yt._wD("SoundManager 2: "+Ct.join(" "),1),Ct=[])},ht=function(){ft();var t,e=[];if(yt.useHTML5Audio&&yt.hasHTML5){for(t in yt.audioFormats)yt.audioFormats.hasOwnProperty(t)&&e.push(t+" = "+yt.html5[t]+(!yt.html5[t]&&jt&&yt.flash[t]?" (using flash)":yt.preferFlash&&yt.flash[t]&&jt?" (preferring flash)":yt.html5[t]?"":" ("+(yt.audioFormats[t].required?"required, ":"")+"and no flash support)"));yt._wD("SoundManager 2 HTML5 support: "+e.join(", "),1)}},f=function(t){if(xt)return!1;if(yt.html5Only)return h("sm2Loaded",1),xt=!0,g(),c("onload",!0),!0;var e,n=!0;return yt.useFlashBlock&&yt.flashLoadTimeout&&!yt.getMoviePercent()||(xt=!0),e={type:!st&&jt?"NO_FLASH":"INIT_TIMEOUT"},yt._wD("SoundManager 2 "+(Lt?"failed to load":"loaded")+" ("+(Lt?"Flash security/load error":"OK")+") "+String.fromCharCode(Lt?10006:10003),Lt?2:1),Lt||t?(yt.useFlashBlock&&yt.oMC&&(yt.oMC.className=j()+" "+(null===yt.getMoviePercent()?B.swfTimedout:B.swfError)),m({type:"ontimeout",error:e,ignoreInit:!0}),c("onload",!1),E(e),n=!1):c("onload",!0),Lt||(yt.waitForWindowLoad&&!Mt?(h("waitOnload"),it.add(o,"load",g)):(yt.waitForWindowLoad&&Mt&&h("docLoaded"),g())),n},s=function(){var t,e=yt.setupOptions;for(t in e)e.hasOwnProperty(t)&&(yt[t]===i?yt[t]=e[t]:yt[t]!==e[t]&&(yt.setupOptions[t]=yt[t]))},u=function(){if(xt)return h("didInit"),!1;function t(){it.remove(o,"load",yt.beginDelayedInit)}if(yt.html5Only)return xt||(t(),yt.enabled=!0,f()),!0;O();try{mt._externalInterfaceTest(!1),I(!0,yt.flashPollingInterval||(yt.useHighPerformance?10:50)),yt.debugMode||mt._disableDebug(),yt.enabled=!0,c("jstoflash",!0),yt.html5Only||it.add(o,"unload",a)}catch(t){return yt._wD("js/flash exception: "+t.toString()),c("jstoflash",!1),E({type:"JS_TO_FLASH_EXCEPTION",fatal:!0}),R(!0),f(),!1}return f(),t(),!0},S=function(){return!L&&(L=!0,s(),T(),!st&&yt.hasHTML5&&(yt._wD("SoundManager 2: No Flash detected"+(yt.useHTML5Audio?". Trying HTML5-only mode.":", enabling HTML5."),1),yt.setup({useHTML5Audio:!0,preferFlash:!1})),ot(),!st&&jt&&(Ct.push(V.needFlash),yt.setup({flashLoadTimeout:1})),_t.removeEventListener&&_t.removeEventListener("DOMContentLoaded",S,!1),O(),!0)},rt=function(){return"complete"===_t.readyState&&(S(),_t.detachEvent("onreadystatechange",rt)),!0},x=function(){Mt=!0,S(),it.remove(o,"load",x)},ut(),it.add(o,"focus",k),it.add(o,"load",A),it.add(o,"load",x),_t.addEventListener?_t.addEventListener("DOMContentLoaded",S,!1):_t.attachEvent?_t.attachEvent("onreadystatechange",rt):(c("onload",!1),E({type:"NO_DOM2_EVENTS",fatal:!0}))}o.SM2_DEFER!==i&&SM2_DEFER||(a=new s),t&&"object"==typeof t.exports?(t.exports.SoundManager=s,t.exports.soundManager=a):void 0===(r=function(){return{constructor:s,getInstance:function(t){if(!o.soundManager&&t instanceof Function){var e=t(s);e instanceof s&&(o.soundManager=e)}return o.soundManager}}}.call(e,n,e,t))||(t.exports=r),o.SoundManager=s,o.soundManager=a}(window)}},function(t){t(t.s=4025)}]);
|
3
3
|
//# sourceMappingURL=plugin.tts.js.map
|