From ca1ad51b7be7e73b7321865681bc890fb1621a89 Mon Sep 17 00:00:00 2001 From: roedoejet Date: Tue, 28 Feb 2023 15:19:38 -0800 Subject: [PATCH 01/64] chore: bump version because ci failed --- packages/ngx-web-component/package.json | 2 +- packages/studio-web/package.json | 4 ++-- packages/web-component/package.json | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/ngx-web-component/package.json b/packages/ngx-web-component/package.json index 94db7ce2..2ff6b0d0 100644 --- a/packages/ngx-web-component/package.json +++ b/packages/ngx-web-component/package.json @@ -1,7 +1,7 @@ { "name": "@readalongs/ngx-web-component", "type": "module", - "version": "1.0.1", + "version": "1.0.2", "peerDependencies": { "@angular/animations": "~15.1.0", "@angular/common": "~15.1.0", diff --git a/packages/studio-web/package.json b/packages/studio-web/package.json index 13a2a068..de7de3aa 100644 --- a/packages/studio-web/package.json +++ b/packages/studio-web/package.json @@ -62,6 +62,6 @@ "tslib": "^2.3.0", "zone.js": "~0.11.4" }, - "singleFileBundleVersion": "1.0.0", - "singleFileBundleTimestamp": "2023-02-28+12-46-32" + "singleFileBundleVersion": "1.0.2", + "singleFileBundleTimestamp": "2023-02-28+15-19-14" } diff --git a/packages/web-component/package.json b/packages/web-component/package.json index 789739fa..047628e8 100644 --- a/packages/web-component/package.json +++ b/packages/web-component/package.json @@ -1,6 +1,6 @@ { "name": "@readalongs/web-component", - "version": "1.0.1", + "version": "1.0.2", "description": "ReadAlong Web Component", "main": "dist/index.cjs.js", "module": "dist/index.js", From 0b09294c8074c2b17d6a525fecd6bf70ce4dd97b Mon Sep 17 00:00:00 2001 From: roedoejet Date: Wed, 1 Mar 2023 16:23:34 -0800 Subject: [PATCH 02/64] =?UTF-8?q?feat(es):=20add=20spanish=20thanks=20to?= =?UTF-8?q?=20Jorge=20Ros=C3=A9s=20Labrada?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/publish.yml | 1 + README.md | 7 +- packages/studio-web/angular.json | 10 +- packages/studio-web/package.json | 8 +- packages/studio-web/project.json | 12 +- .../studio-web/src/app/demo/demo.component.ts | 4 +- packages/studio-web/src/assets/bundle.js | 6 +- packages/studio-web/src/i18n/messages.es.json | 143 ++++++++++++++++++ .../read-along-component/read-along.tsx | 37 ++++- .../components/read-along-component/readme.md | 2 +- .../web-component/src/i18n/messages.eng.json | 18 +++ .../web-component/src/i18n/messages.spa.json | 18 +++ packages/web-component/src/i18n/readme.md | 1 + packages/web-component/src/index.d.ts | 2 +- 14 files changed, 253 insertions(+), 16 deletions(-) create mode 100644 packages/studio-web/src/i18n/messages.es.json create mode 100644 packages/web-component/src/i18n/messages.eng.json create mode 100644 packages/web-component/src/i18n/messages.spa.json create mode 100644 packages/web-component/src/i18n/readme.md diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 837d835f..ac807983 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -31,6 +31,7 @@ jobs: run: | npx nx build studio-web --configuration=production npx nx build studio-web --configuration=production --localize=fr --deleteOutputPath=false + npx nx build studio-web --configuration=production --localize=es --deleteOutputPath=false - name: Deploy 🚀 uses: JamesIves/github-pages-deploy-action@v4.2.3 with: diff --git a/README.md b/README.md index 8e90d355..5c863b27 100644 --- a/README.md +++ b/README.md @@ -84,7 +84,7 @@ Ou en français: There are separate production and development serving configurations for each interface language, so you may for instance also use -`development-en`, `production-en`, `production-fr` for +`development-en`, `production-en`,`development-es`, `production-es`, `production-fr`, etc for `--configuration` above. Note that these configurations are _only_ for the `serve` command. To build for deployment, see [below](#studio-web-2). @@ -187,14 +187,15 @@ Then, go to the directory and publish: #### Studio-Web To build the web application in the currently deployed configuration -(English interface in the root and French under `/fr`), run: +(English interface in the root and French under `/fr`, and Spanish under `/es`), run: nx build studio-web --configuration=production nx build studio-web --configuration=production --localize=fr --deleteOutputPath=false + nx build studio-web --configuration=production --localize=es --deleteOutputPath=false To build with each interface language in its own directory, run: - nx build studio-web --configuration=production --localize=en --localize=fr + nx build studio-web --configuration=production --localize=en --localize=fr --localize=es This will create a complete website under `dist/packages/studio-web/` which you can deploy in whatever fashion you like to your server diff --git a/packages/studio-web/angular.json b/packages/studio-web/angular.json index d0a0327c..52291c77 100644 --- a/packages/studio-web/angular.json +++ b/packages/studio-web/angular.json @@ -16,7 +16,8 @@ "i18n": { "sourceLocale": "en", "locales": { - "fr": "src/i18n/messages.fr.json" + "fr": "src/i18n/messages.fr.json", + "es": "src/i18n/messages.es.json" } }, "architect": { @@ -79,6 +80,10 @@ "fr": { "localize": ["fr"], "deleteOutputPath": false + }, + "es": { + "localize": ["es"], + "deleteOutputPath": false } }, "defaultConfiguration": "production" @@ -94,6 +99,9 @@ }, "fr": { "browserTarget": "readalong-studio:build:development,fr" + }, + "es": { + "browserTarget": "readalong-studio:build:development,es" } }, "defaultConfiguration": "development" diff --git a/packages/studio-web/package.json b/packages/studio-web/package.json index de7de3aa..e185c486 100644 --- a/packages/studio-web/package.json +++ b/packages/studio-web/package.json @@ -9,15 +9,17 @@ "ng": "ng", "start": "ng serve", "start-fr": "ng serve --configuration=fr --port=5200", + "start-es": "ng serve --configuration=es --port=5200", "serve-web-api": "cd ../../../Studio/readalongs && PRODUCTION= DEVELOPMENT=1 uvicorn readalongs.web_api:web_api_app --reload", "build": "ng build --configuration development --localize", "build:prod": "ng build --configuration production --localize", - "build:prod:ghpages": "ng build --configuration production && ng build --configuration production,fr", + "build:prod:ghpages": "ng build --configuration production && ng build --configuration production,fr && ng build --configuration production,es", "watch": "ng build --watch --configuration development --localize", "test": "ng test", "test:once": "ng test --watch=false --browsers ChromeHeadlessCI", "extract-i18n": "ng extract-i18n --format json --output-path src/i18n; echo '' >> src/i18n/messages.json", - "check-fr-l10n": "bash -c \"diff -w <(cat src/i18n/messages.json | sed 's/:.*//' | sort) <(cat src/i18n/messages.fr.json | sed 's/:.*//' | sort)\"" + "check-fr-l10n": "bash -c \"diff -w <(cat src/i18n/messages.json | sed 's/:.*//' | sort) <(cat src/i18n/messages.fr.json | sed 's/:.*//' | sort)\"", + "check-es-l10n": "bash -c \"diff -w <(cat src/i18n/messages.json | sed 's/:.*//' | sort) <(cat src/i18n/messages.es.json | sed 's/:.*//' | sort)\"" }, "private": true, "devDependencies": { @@ -63,5 +65,5 @@ "zone.js": "~0.11.4" }, "singleFileBundleVersion": "1.0.2", - "singleFileBundleTimestamp": "2023-02-28+15-19-14" + "singleFileBundleTimestamp": "2023-03-01+16-23-59" } diff --git a/packages/studio-web/project.json b/packages/studio-web/project.json index 7cfcbdc2..ca020ce3 100644 --- a/packages/studio-web/project.json +++ b/packages/studio-web/project.json @@ -7,7 +7,8 @@ "i18n": { "sourceLocale": "en", "locales": { - "fr": "packages/studio-web/src/i18n/messages.fr.json" + "fr": "packages/studio-web/src/i18n/messages.fr.json", + "es": "packages/studio-web/src/i18n/messages.es.json" } }, "targets": { @@ -68,7 +69,8 @@ "namedChunks": true }, "en": { "localize": ["en"] }, - "fr": { "localize": ["fr"] } + "fr": { "localize": ["fr"] }, + "es": { "localize": ["es"] } }, "defaultConfiguration": "production" }, @@ -86,6 +88,12 @@ }, "development-fr": { "browserTarget": "studio-web:build:development,fr" + }, + "production-es": { + "browserTarget": "studio-web:build:production,es" + }, + "development-es": { + "browserTarget": "studio-web:build:development,es" } }, "defaultConfiguration": "development-en" diff --git a/packages/studio-web/src/app/demo/demo.component.ts b/packages/studio-web/src/app/demo/demo.component.ts index 708c4637..56766b86 100644 --- a/packages/studio-web/src/app/demo/demo.component.ts +++ b/packages/studio-web/src/app/demo/demo.component.ts @@ -33,7 +33,7 @@ export class DemoComponent implements OnDestroy, OnInit { { value: "vtt", display: $localize`WebVTT Subtitles` }, ]; selectedOutputFormat: SupportedOutputs | string = "html"; - language: "eng" | "fra" = "eng"; + language: "eng" | "fra" | "spa" = "eng"; unsubscribe$ = new Subject(); constructor( public b64Service: B64Service, @@ -43,6 +43,8 @@ export class DemoComponent implements OnDestroy, OnInit { // If we do more languages, this should be a lookup table if ($localize.locale == "fr") { this.language = "fra"; + } else if ($localize.locale == "es") { + this.language = "spa"; } } diff --git a/packages/studio-web/src/assets/bundle.js b/packages/studio-web/src/assets/bundle.js index 60744f5d..e7b76243 100644 --- a/packages/studio-web/src/assets/bundle.js +++ b/packages/studio-web/src/assets/bundle.js @@ -1,4 +1,4 @@ -(()=>{var e={678:(e,t,n)=>{"use strict";n.d(t,{b:()=>N,g:()=>f,h:()=>u,p:()=>ae,r:()=>Z});let r,o,i=!1;const s="http://www.w3.org/1999/xlink",a={},l=e=>"object"===(e=typeof e)||"function"===e;function c(e){var t,n,r;return null!==(r=null===(n=null===(t=e.head)||void 0===t?void 0:t.querySelector('meta[name="csp-nonce"]'))||void 0===n?void 0:n.getAttribute("content"))&&void 0!==r?r:void 0}const u=(e,t,...n)=>{let r=null,o=null,i=!1,s=!1;const a=[],c=t=>{for(let n=0;ne[t])).join(" "))}}if("function"==typeof e)return e(null===t?{}:t,a,p);const u=d(e,null);return u.$attrs$=t,a.length>0&&(u.$children$=a),u.$key$=o,u},d=(e,t)=>{const n={$flags$:0,$tag$:e,$text$:t,$elm$:null,$children$:null,$attrs$:null,$key$:null};return n},h={},p={forEach:(e,t)=>e.map(_).forEach(t),map:(e,t)=>e.map(_).map(t).map(g)},_=e=>({vattrs:e.$attrs$,vchildren:e.$children$,vkey:e.$key$,vname:e.$name$,vtag:e.$tag$,vtext:e.$text$}),g=e=>{if("function"==typeof e.vtag){const t=Object.assign({},e.vattrs);return e.vkey&&(t.key=e.vkey),e.vname&&(t.name=e.vname),u(e.vtag,t,...e.vchildren||[])}const t=d(e.vtag,e.vtext);return t.$attrs$=e.vattrs,t.$children$=e.vchildren,t.$key$=e.vkey,t.$name$=e.vname,t},f=e=>Y(e).$hostElement$,m=new WeakMap,b=e=>{const t=e.$cmpMeta$,n=e.$hostElement$,r=t.$flags$,o=(t.$tagName$,()=>{}),i=((e,t,n,r)=>{var o;let i=y(t);const s=re.get(i);if(e=11===e.nodeType?e:ie,s)if("string"==typeof s){e=e.head||e;let t,n=m.get(e);if(n||m.set(e,n=new Set),!n.has(i)){{t=ie.createElement("style"),t.innerHTML=s;const n=null!==(o=se.$nonce$)&&void 0!==o?o:c(ie);null!=n&&t.setAttribute("nonce",n),e.insertBefore(t,e.querySelector("link"))}n&&n.add(i)}}else e.adoptedStyleSheets.includes(s)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,s]);return i})(n.shadowRoot?n.shadowRoot:n.getRootNode(),t);10&r&&(n["s-sc"]=i,n.classList.add(i+"-h")),o()},y=(e,t)=>"sc-"+e.$tagName$,v=(e,t,n,r,o,i)=>{if(n!==r){let a=J(e,t),c=t.toLowerCase();if("class"===t){const t=e.classList,o=x(n),i=x(r);t.remove(...o.filter((e=>e&&!i.includes(e)))),t.add(...i.filter((e=>e&&!o.includes(e))))}else if("style"===t){for(const t in n)r&&null!=r[t]||(t.includes("-")?e.style.removeProperty(t):e.style[t]="");for(const t in r)n&&r[t]===n[t]||(t.includes("-")?e.style.setProperty(t,r[t]):e.style[t]=r[t])}else if("key"===t);else if("ref"===t)r&&r(e);else if(a||"o"!==t[0]||"n"!==t[1]){const u=l(r);if((a||u&&null!==r)&&!o)try{if(e.tagName.includes("-"))e[t]=r;else{const o=null==r?"":r;"list"===t?a=!1:null!=n&&e[t]==o||(e[t]=o)}}catch(e){}let d=!1;c!==(c=c.replace(/^xlink\:?/,""))&&(t=c,d=!0),null==r||!1===r?!1===r&&""!==e.getAttribute(t)||(d?e.removeAttributeNS(s,t):e.removeAttribute(t)):(!a||4&i||o)&&!u&&(r=!0===r?"":r,d?e.setAttributeNS(s,t,r):e.setAttribute(t,r))}else t="-"===t[2]?t.slice(3):J(oe,c)?c.slice(2):c[2]+t.slice(3),n&&se.rel(e,t,n,!1),r&&se.ael(e,t,r,!1)}},w=/\s/,x=e=>e?e.split(w):[],$=(e,t,n,r)=>{const o=11===t.$elm$.nodeType&&t.$elm$.host?t.$elm$.host:t.$elm$,i=e&&e.$attrs$||a,s=t.$attrs$||a;for(r in i)r in s||v(o,r,i[r],void 0,n,t.$flags$);for(r in s)v(o,r,i[r],s[r],n,t.$flags$)},A=(e,t,n,o)=>{const i=t.$children$[n];let s,a,l=0;if(null!==i.$text$)s=i.$elm$=ie.createTextNode(i.$text$);else if(s=i.$elm$=ie.createElement(i.$tag$),$(null,i,false),null!=r&&s["s-si"]!==r&&s.classList.add(s["s-si"]=r),i.$children$)for(l=0;l{let a,l=e;for(l.shadowRoot&&l.tagName===o&&(l=l.shadowRoot);i<=s;++i)r[i]&&(a=A(null,n,i),a&&(r[i].$elm$=a,l.insertBefore(a,t)))},S=(e,t,n,r,o)=>{for(;t<=n;++t)(r=e[t])&&(o=r.$elm$,I(r),o.remove())},k=(e,t)=>e.$tag$===t.$tag$&&e.$key$===t.$key$,E=(e,t)=>{const n=t.$elm$=e.$elm$,r=e.$children$,o=t.$children$,i=t.$tag$,s=t.$text$;null===s?("slot"===i||$(e,t,false),null!==r&&null!==o?((e,t,n,r)=>{let o,i,s=0,a=0,l=0,c=0,u=t.length-1,d=t[0],h=t[u],p=r.length-1,_=r[0],g=r[p];for(;s<=u&&a<=p;)if(null==d)d=t[++s];else if(null==h)h=t[--u];else if(null==_)_=r[++a];else if(null==g)g=r[--p];else if(k(d,_))E(d,_),d=t[++s],_=r[++a];else if(k(h,g))E(h,g),h=t[--u],g=r[--p];else if(k(d,g))E(d,g),e.insertBefore(d.$elm$,h.$elm$.nextSibling),d=t[++s],g=r[--p];else if(k(h,_))E(h,_),e.insertBefore(h.$elm$,d.$elm$),h=t[--u],_=r[++a];else{for(l=-1,c=s;c<=u;++c)if(t[c]&&null!==t[c].$key$&&t[c].$key$===_.$key$){l=c;break}l>=0?(i=t[l],i.$tag$!==_.$tag$?o=A(t&&t[a],n,l):(E(i,_),t[l]=void 0,o=i.$elm$),_=r[++a]):(o=A(t&&t[a],n,a),_=r[++a]),o&&d.$elm$.parentNode.insertBefore(o,d.$elm$)}s>u?T(e,null==r[p+1]?null:r[p+1].$elm$,n,r,a,p):a>p&&S(t,s,u)})(n,r,t,o):null!==o?(null!==e.$text$&&(n.textContent=""),T(n,null,t,o,0,o.length-1)):null!==r&&S(r,0,r.length-1)):e.$text$!==s&&(n.data=s)},I=e=>{e.$attrs$&&e.$attrs$.ref&&e.$attrs$.ref(null),e.$children$&&e.$children$.map(I)},O=(e,t)=>{const n=e.$hostElement$,i=e.$cmpMeta$,s=e.$vnode$||d(null,null),a=(l=t)&&l.$tag$===h?t:u(null,null,t);var l;o=n.tagName,i.$attrsToReflect$&&(a.$attrs$=a.$attrs$||{},i.$attrsToReflect$.map((([e,t])=>a.$attrs$[t]=n[e]))),a.$tag$=null,a.$flags$|=4,e.$vnode$=a,a.$elm$=s.$elm$=n.shadowRoot||n,r=n["s-sc"],E(s,a)},R=(e,t)=>{t&&!e.$onRenderResolve$&&t["s-p"]&&t["s-p"].push(new Promise((t=>e.$onRenderResolve$=t)))},P=(e,t)=>{if(e.$flags$|=16,4&e.$flags$)return void(e.$flags$|=512);R(e,e.$ancestorComponent$);return ge((()=>L(e,t)))},L=(e,t)=>{const n=(e.$cmpMeta$.$tagName$,()=>{}),r=e.$lazyInstance$;let o;return t&&(e.$flags$|=256,e.$queuedListeners$&&(e.$queuedListeners$.map((([e,t])=>B(r,e,t))),e.$queuedListeners$=null),o=B(r,"componentWillLoad")),n(),M(o,(()=>C(e,r,t)))},C=async(e,t,n)=>{const r=e.$hostElement$,o=(e.$cmpMeta$.$tagName$,()=>{}),i=r["s-rc"];n&&b(e);const s=(e.$cmpMeta$.$tagName$,()=>{});D(e,t),i&&(i.map((e=>e())),r["s-rc"]=void 0),s(),o();{const t=r["s-p"],n=()=>F(e);0===t.length?n():(Promise.all(t).then(n),e.$flags$|=4,t.length=0)}},D=(e,t,n)=>{try{t=t.render(),e.$flags$&=-17,e.$flags$|=2,O(e,t)}catch(t){ee(t,e.$hostElement$)}return null},F=e=>{e.$cmpMeta$.$tagName$;const t=e.$hostElement$,n=()=>{},r=e.$lazyInstance$,o=e.$ancestorComponent$;B(r,"componentDidRender"),64&e.$flags$?(B(r,"componentDidUpdate"),n()):(e.$flags$|=64,H(t),B(r,"componentDidLoad"),n(),e.$onReadyResolve$(t),o||U()),e.$onInstanceResolve$(t),e.$onRenderResolve$&&(e.$onRenderResolve$(),e.$onRenderResolve$=void 0),512&e.$flags$&&_e((()=>P(e,!1))),e.$flags$&=-517},U=e=>{H(ie.documentElement),_e((()=>((e,t,n)=>{const r=se.ce(t,n);return e.dispatchEvent(r),r})(oe,"appload",{detail:{namespace:"web-component"}})))},B=(e,t,n)=>{if(e&&e[t])try{return e[t](n)}catch(e){ee(e)}},M=(e,t)=>e&&e.then?e.then(t):t(),H=e=>e.classList.add("hydrated"),j=(e,t,n,r)=>{const o=Y(e),i=o.$instanceValues$.get(t),s=o.$flags$,a=o.$lazyInstance$;var c,u;c=n,u=r.$members$[t][0],n=null==c||l(c)?c:4&u?"false"!==c&&(""===c||!!c):2&u?parseFloat(c):1&u?String(c):c;const d=Number.isNaN(i)&&Number.isNaN(n);8&s&&void 0!==i||!(n!==i&&!d)||(o.$instanceValues$.set(t,n),a&&2==(18&s)&&P(o,!1))},q=(e,t,n)=>{if(t.$members$){const r=Object.entries(t.$members$),o=e.prototype;if(r.map((([e,[r]])=>{31&r||2&n&&32&r?Object.defineProperty(o,e,{get(){return t=e,Y(this).$instanceValues$.get(t);var t},set(n){j(this,e,n,t)},configurable:!0,enumerable:!0}):1&n&&64&r&&Object.defineProperty(o,e,{value(...t){const n=Y(this);return n.$onInstancePromise$.then((()=>n.$lazyInstance$[e](...t)))}})})),1&n){const n=new Map;o.attributeChangedCallback=function(e,t,r){se.jmp((()=>{const t=n.get(e);if(this.hasOwnProperty(t))r=this[t],delete this[t];else if(o.hasOwnProperty(t)&&"number"==typeof this[t]&&this[t]==r)return;this[t]=(null!==r||"boolean"!=typeof this[t])&&r}))},e.observedAttributes=r.filter((([e,t])=>15&t[0])).map((([e,r])=>{const o=r[1]||e;return n.set(o,e),512&r[0]&&t.$attrsToReflect$.push([e,o]),o}))}}return e},G=async(e,t,n,r,o)=>{if(0==(32&t.$flags$)){{if(t.$flags$|=32,(o=ne(n)).then){const e=()=>{};o=await o,e()}o.isProxied||(q(o,n,2),o.isProxied=!0);const e=(n.$tagName$,()=>{});t.$flags$|=8;try{new o(t)}catch(e){ee(e)}t.$flags$&=-9,e()}if(o.style){let e=o.style;const t=y(n);if(!re.has(t)){const r=(n.$tagName$,()=>{});((e,t,n)=>{let r=re.get(e);le&&n?(r=r||new CSSStyleSheet,"string"==typeof r?r=t:r.replaceSync(t)):r=t,re.set(e,r)})(t,e,!!(1&n.$flags$)),r()}}}const i=t.$ancestorComponent$,s=()=>P(t,!0);i&&i["s-rc"]?i["s-rc"].push(s):s()},N=(e,t={})=>{var n;const r=()=>{},o=[],i=t.exclude||[],s=oe.customElements,a=ie.head,l=a.querySelector("meta[charset]"),u=ie.createElement("style"),d=[];let h,p=!0;Object.assign(se,t),se.$resourcesUrl$=new URL(t.resourcesUrl||"./",ie.baseURI).href,e.map((e=>{e[1].map((t=>{const n={$flags$:t[0],$tagName$:t[1],$members$:t[2],$listeners$:t[3]};n.$members$=t[2],n.$listeners$=t[3],n.$attrsToReflect$=[];const r=n.$tagName$,a=class extends HTMLElement{constructor(e){super(e),K(e=this,n),1&n.$flags$&&e.attachShadow({mode:"open"})}connectedCallback(){h&&(clearTimeout(h),h=null),p?d.push(this):se.jmp((()=>(e=>{if(0==(1&se.$flags$)){const t=Y(e),n=t.$cmpMeta$,r=(n.$tagName$,()=>{});if(1&t.$flags$)V(e,t,n.$listeners$);else{t.$flags$|=1;{let n=e;for(;n=n.parentNode||n.host;)if(n["s-p"]){R(t,t.$ancestorComponent$=n);break}}n.$members$&&Object.entries(n.$members$).map((([t,[n]])=>{if(31&n&&e.hasOwnProperty(t)){const n=e[t];delete e[t],e[t]=n}})),G(0,t,n)}r()}})(this)))}disconnectedCallback(){se.jmp((()=>(e=>{if(0==(1&se.$flags$)){const t=Y(e),n=t.$lazyInstance$;t.$rmListeners$&&(t.$rmListeners$.map((e=>e())),t.$rmListeners$=void 0),B(n,"disconnectedCallback")}})(this)))}componentOnReady(){return Y(this).$onReadyPromise$}};n.$lazyBundleId$=e[0],i.includes(r)||s.get(r)||(o.push(r),s.define(r,q(a,n,1)))}))}));{u.innerHTML=o+"{visibility:hidden}.hydrated{visibility:inherit}",u.setAttribute("data-styles","");const e=null!==(n=se.$nonce$)&&void 0!==n?n:c(ie);null!=e&&u.setAttribute("nonce",e),a.insertBefore(u,l?l.nextSibling:a.firstChild)}p=!1,d.length?d.map((e=>e.connectedCallback())):se.jmp((()=>h=setTimeout(U,30))),r()},V=(e,t,n,r)=>{n&&n.map((([n,r,o])=>{const i=W(e,n),s=z(t,o),a=X(n);se.ael(i,r,s,a),(t.$rmListeners$=t.$rmListeners$||[]).push((()=>se.rel(i,r,s,a)))}))},z=(e,t)=>n=>{try{256&e.$flags$?e.$lazyInstance$[t](n):(e.$queuedListeners$=e.$queuedListeners$||[]).push([t,n])}catch(e){ee(e)}},W=(e,t)=>8&t?oe:e,X=e=>0!=(2&e),Q=new WeakMap,Y=e=>Q.get(e),Z=(e,t)=>Q.set(t.$lazyInstance$=e,t),K=(e,t)=>{const n={$flags$:0,$hostElement$:e,$cmpMeta$:t,$instanceValues$:new Map};return n.$onInstancePromise$=new Promise((e=>n.$onInstanceResolve$=e)),n.$onReadyPromise$=new Promise((e=>n.$onReadyResolve$=e)),e["s-p"]=[],e["s-rc"]=[],V(e,n,t.$listeners$),Q.set(e,n)},J=(e,t)=>t in e,ee=(e,t)=>(0,console.error)(e,t),te=new Map,ne=(e,t,r)=>{const o=e.$tagName$.replace(/-/g,"_"),i=e.$lazyBundleId$,s=te.get(i);if(s)return s[o];if(!r||!BUILD.hotModuleReplacement){const e=e=>(te.set(i,e),e[o]);if("read-along"===i)return Promise.resolve().then(n.bind(n,704)).then(e,ee)}return n(131)(`./${i}.entry.js`).then((e=>(te.set(i,e),e[o])),ee)},re=new Map,oe="undefined"!=typeof window?window:{},ie=oe.document||{head:{}},se={$flags$:0,$resourcesUrl$:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,t,n,r)=>e.addEventListener(t,n,r),rel:(e,t,n,r)=>e.removeEventListener(t,n,r),ce:(e,t)=>new CustomEvent(e,t)},ae=e=>Promise.resolve(e),le=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync}catch(e){}return!1})(),ce=[],ue=[],de=(e,t)=>n=>{e.push(n),i||(i=!0,t&&4&se.$flags$?_e(pe):se.raf(pe))},he=e=>{for(let t=0;t{he(ce),he(ue),(i=ce.length>0)&&se.raf(pe)},_e=e=>ae().then(e),ge=de(ue,!0)},704:(e,t,n)=>{"use strict";n.r(t),n.d(t,{read_along:()=>C});var r=n(678),o="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self?self:{};var i,s,a=(function(e,t){ +(()=>{var e={678:(e,t,n)=>{"use strict";n.d(t,{b:()=>G,g:()=>f,h:()=>u,p:()=>se,r:()=>Z});let r,o,i=!1;const a="http://www.w3.org/1999/xlink",s={},l=e=>"object"===(e=typeof e)||"function"===e;function c(e){var t,n,r;return null!==(r=null===(n=null===(t=e.head)||void 0===t?void 0:t.querySelector('meta[name="csp-nonce"]'))||void 0===n?void 0:n.getAttribute("content"))&&void 0!==r?r:void 0}const u=(e,t,...n)=>{let r=null,o=null,i=!1,a=!1;const s=[],c=t=>{for(let n=0;ne[t])).join(" "))}}if("function"==typeof e)return e(null===t?{}:t,s,p);const u=d(e,null);return u.$attrs$=t,s.length>0&&(u.$children$=s),u.$key$=o,u},d=(e,t)=>{const n={$flags$:0,$tag$:e,$text$:t,$elm$:null,$children$:null,$attrs$:null,$key$:null};return n},h={},p={forEach:(e,t)=>e.map(_).forEach(t),map:(e,t)=>e.map(_).map(t).map(g)},_=e=>({vattrs:e.$attrs$,vchildren:e.$children$,vkey:e.$key$,vname:e.$name$,vtag:e.$tag$,vtext:e.$text$}),g=e=>{if("function"==typeof e.vtag){const t=Object.assign({},e.vattrs);return e.vkey&&(t.key=e.vkey),e.vname&&(t.name=e.vname),u(e.vtag,t,...e.vchildren||[])}const t=d(e.vtag,e.vtext);return t.$attrs$=e.vattrs,t.$children$=e.vchildren,t.$key$=e.vkey,t.$name$=e.vname,t},f=e=>Y(e).$hostElement$,m=new WeakMap,b=e=>{const t=e.$cmpMeta$,n=e.$hostElement$,r=t.$flags$,o=(t.$tagName$,()=>{}),i=((e,t,n,r)=>{var o;let i=y(t);const a=re.get(i);if(e=11===e.nodeType?e:ie,a)if("string"==typeof a){e=e.head||e;let t,n=m.get(e);if(n||m.set(e,n=new Set),!n.has(i)){{t=ie.createElement("style"),t.innerHTML=a;const n=null!==(o=ae.$nonce$)&&void 0!==o?o:c(ie);null!=n&&t.setAttribute("nonce",n),e.insertBefore(t,e.querySelector("link"))}n&&n.add(i)}}else e.adoptedStyleSheets.includes(a)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,a]);return i})(n.shadowRoot?n.shadowRoot:n.getRootNode(),t);10&r&&(n["s-sc"]=i,n.classList.add(i+"-h")),o()},y=(e,t)=>"sc-"+e.$tagName$,v=(e,t,n,r,o,i)=>{if(n!==r){let s=J(e,t),c=t.toLowerCase();if("class"===t){const t=e.classList,o=x(n),i=x(r);t.remove(...o.filter((e=>e&&!i.includes(e)))),t.add(...i.filter((e=>e&&!o.includes(e))))}else if("style"===t){for(const t in n)r&&null!=r[t]||(t.includes("-")?e.style.removeProperty(t):e.style[t]="");for(const t in r)n&&r[t]===n[t]||(t.includes("-")?e.style.setProperty(t,r[t]):e.style[t]=r[t])}else if("key"===t);else if("ref"===t)r&&r(e);else if(s||"o"!==t[0]||"n"!==t[1]){const u=l(r);if((s||u&&null!==r)&&!o)try{if(e.tagName.includes("-"))e[t]=r;else{const o=null==r?"":r;"list"===t?s=!1:null!=n&&e[t]==o||(e[t]=o)}}catch(e){}let d=!1;c!==(c=c.replace(/^xlink\:?/,""))&&(t=c,d=!0),null==r||!1===r?!1===r&&""!==e.getAttribute(t)||(d?e.removeAttributeNS(a,t):e.removeAttribute(t)):(!s||4&i||o)&&!u&&(r=!0===r?"":r,d?e.setAttributeNS(a,t,r):e.setAttribute(t,r))}else t="-"===t[2]?t.slice(3):J(oe,c)?c.slice(2):c[2]+t.slice(3),n&&ae.rel(e,t,n,!1),r&&ae.ael(e,t,r,!1)}},w=/\s/,x=e=>e?e.split(w):[],$=(e,t,n,r)=>{const o=11===t.$elm$.nodeType&&t.$elm$.host?t.$elm$.host:t.$elm$,i=e&&e.$attrs$||s,a=t.$attrs$||s;for(r in i)r in a||v(o,r,i[r],void 0,n,t.$flags$);for(r in a)v(o,r,i[r],a[r],n,t.$flags$)},A=(e,t,n,o)=>{const i=t.$children$[n];let a,s,l=0;if(null!==i.$text$)a=i.$elm$=ie.createTextNode(i.$text$);else if(a=i.$elm$=ie.createElement(i.$tag$),$(null,i,false),null!=r&&a["s-si"]!==r&&a.classList.add(a["s-si"]=r),i.$children$)for(l=0;l{let s,l=e;for(l.shadowRoot&&l.tagName===o&&(l=l.shadowRoot);i<=a;++i)r[i]&&(s=A(null,n,i),s&&(r[i].$elm$=s,l.insertBefore(s,t)))},S=(e,t,n,r,o)=>{for(;t<=n;++t)(r=e[t])&&(o=r.$elm$,I(r),o.remove())},k=(e,t)=>e.$tag$===t.$tag$&&e.$key$===t.$key$,E=(e,t)=>{const n=t.$elm$=e.$elm$,r=e.$children$,o=t.$children$,i=t.$tag$,a=t.$text$;null===a?("slot"===i||$(e,t,false),null!==r&&null!==o?((e,t,n,r)=>{let o,i,a=0,s=0,l=0,c=0,u=t.length-1,d=t[0],h=t[u],p=r.length-1,_=r[0],g=r[p];for(;a<=u&&s<=p;)if(null==d)d=t[++a];else if(null==h)h=t[--u];else if(null==_)_=r[++s];else if(null==g)g=r[--p];else if(k(d,_))E(d,_),d=t[++a],_=r[++s];else if(k(h,g))E(h,g),h=t[--u],g=r[--p];else if(k(d,g))E(d,g),e.insertBefore(d.$elm$,h.$elm$.nextSibling),d=t[++a],g=r[--p];else if(k(h,_))E(h,_),e.insertBefore(h.$elm$,d.$elm$),h=t[--u],_=r[++s];else{for(l=-1,c=a;c<=u;++c)if(t[c]&&null!==t[c].$key$&&t[c].$key$===_.$key$){l=c;break}l>=0?(i=t[l],i.$tag$!==_.$tag$?o=A(t&&t[s],n,l):(E(i,_),t[l]=void 0,o=i.$elm$),_=r[++s]):(o=A(t&&t[s],n,s),_=r[++s]),o&&d.$elm$.parentNode.insertBefore(o,d.$elm$)}a>u?T(e,null==r[p+1]?null:r[p+1].$elm$,n,r,s,p):s>p&&S(t,a,u)})(n,r,t,o):null!==o?(null!==e.$text$&&(n.textContent=""),T(n,null,t,o,0,o.length-1)):null!==r&&S(r,0,r.length-1)):e.$text$!==a&&(n.data=a)},I=e=>{e.$attrs$&&e.$attrs$.ref&&e.$attrs$.ref(null),e.$children$&&e.$children$.map(I)},R=(e,t)=>{const n=e.$hostElement$,i=e.$cmpMeta$,a=e.$vnode$||d(null,null),s=(l=t)&&l.$tag$===h?t:u(null,null,t);var l;o=n.tagName,i.$attrsToReflect$&&(s.$attrs$=s.$attrs$||{},i.$attrsToReflect$.map((([e,t])=>s.$attrs$[t]=n[e]))),s.$tag$=null,s.$flags$|=4,e.$vnode$=s,s.$elm$=a.$elm$=n.shadowRoot||n,r=n["s-sc"],E(a,s)},O=(e,t)=>{t&&!e.$onRenderResolve$&&t["s-p"]&&t["s-p"].push(new Promise((t=>e.$onRenderResolve$=t)))},P=(e,t)=>{if(e.$flags$|=16,4&e.$flags$)return void(e.$flags$|=512);O(e,e.$ancestorComponent$);return ge((()=>L(e,t)))},L=(e,t)=>{const n=(e.$cmpMeta$.$tagName$,()=>{}),r=e.$lazyInstance$;let o;return t&&(e.$flags$|=256,e.$queuedListeners$&&(e.$queuedListeners$.map((([e,t])=>B(r,e,t))),e.$queuedListeners$=null),o=B(r,"componentWillLoad")),n(),M(o,(()=>C(e,r,t)))},C=async(e,t,n)=>{const r=e.$hostElement$,o=(e.$cmpMeta$.$tagName$,()=>{}),i=r["s-rc"];n&&b(e);const a=(e.$cmpMeta$.$tagName$,()=>{});D(e,t),i&&(i.map((e=>e())),r["s-rc"]=void 0),a(),o();{const t=r["s-p"],n=()=>F(e);0===t.length?n():(Promise.all(t).then(n),e.$flags$|=4,t.length=0)}},D=(e,t,n)=>{try{t=t.render(),e.$flags$&=-17,e.$flags$|=2,R(e,t)}catch(t){ee(t,e.$hostElement$)}return null},F=e=>{e.$cmpMeta$.$tagName$;const t=e.$hostElement$,n=()=>{},r=e.$lazyInstance$,o=e.$ancestorComponent$;B(r,"componentDidRender"),64&e.$flags$?(B(r,"componentDidUpdate"),n()):(e.$flags$|=64,H(t),B(r,"componentDidLoad"),n(),e.$onReadyResolve$(t),o||U()),e.$onInstanceResolve$(t),e.$onRenderResolve$&&(e.$onRenderResolve$(),e.$onRenderResolve$=void 0),512&e.$flags$&&_e((()=>P(e,!1))),e.$flags$&=-517},U=e=>{H(ie.documentElement),_e((()=>((e,t,n)=>{const r=ae.ce(t,n);return e.dispatchEvent(r),r})(oe,"appload",{detail:{namespace:"web-component"}})))},B=(e,t,n)=>{if(e&&e[t])try{return e[t](n)}catch(e){ee(e)}},M=(e,t)=>e&&e.then?e.then(t):t(),H=e=>e.classList.add("hydrated"),j=(e,t,n,r)=>{const o=Y(e),i=o.$instanceValues$.get(t),a=o.$flags$,s=o.$lazyInstance$;var c,u;c=n,u=r.$members$[t][0],n=null==c||l(c)?c:4&u?"false"!==c&&(""===c||!!c):2&u?parseFloat(c):1&u?String(c):c;const d=Number.isNaN(i)&&Number.isNaN(n);8&a&&void 0!==i||!(n!==i&&!d)||(o.$instanceValues$.set(t,n),s&&2==(18&a)&&P(o,!1))},q=(e,t,n)=>{if(t.$members$){const r=Object.entries(t.$members$),o=e.prototype;if(r.map((([e,[r]])=>{31&r||2&n&&32&r?Object.defineProperty(o,e,{get(){return t=e,Y(this).$instanceValues$.get(t);var t},set(n){j(this,e,n,t)},configurable:!0,enumerable:!0}):1&n&&64&r&&Object.defineProperty(o,e,{value(...t){const n=Y(this);return n.$onInstancePromise$.then((()=>n.$lazyInstance$[e](...t)))}})})),1&n){const n=new Map;o.attributeChangedCallback=function(e,t,r){ae.jmp((()=>{const t=n.get(e);if(this.hasOwnProperty(t))r=this[t],delete this[t];else if(o.hasOwnProperty(t)&&"number"==typeof this[t]&&this[t]==r)return;this[t]=(null!==r||"boolean"!=typeof this[t])&&r}))},e.observedAttributes=r.filter((([e,t])=>15&t[0])).map((([e,r])=>{const o=r[1]||e;return n.set(o,e),512&r[0]&&t.$attrsToReflect$.push([e,o]),o}))}}return e},N=async(e,t,n,r,o)=>{if(0==(32&t.$flags$)){{if(t.$flags$|=32,(o=ne(n)).then){const e=()=>{};o=await o,e()}o.isProxied||(q(o,n,2),o.isProxied=!0);const e=(n.$tagName$,()=>{});t.$flags$|=8;try{new o(t)}catch(e){ee(e)}t.$flags$&=-9,e()}if(o.style){let e=o.style;const t=y(n);if(!re.has(t)){const r=(n.$tagName$,()=>{});((e,t,n)=>{let r=re.get(e);le&&n?(r=r||new CSSStyleSheet,"string"==typeof r?r=t:r.replaceSync(t)):r=t,re.set(e,r)})(t,e,!!(1&n.$flags$)),r()}}}const i=t.$ancestorComponent$,a=()=>P(t,!0);i&&i["s-rc"]?i["s-rc"].push(a):a()},G=(e,t={})=>{var n;const r=()=>{},o=[],i=t.exclude||[],a=oe.customElements,s=ie.head,l=s.querySelector("meta[charset]"),u=ie.createElement("style"),d=[];let h,p=!0;Object.assign(ae,t),ae.$resourcesUrl$=new URL(t.resourcesUrl||"./",ie.baseURI).href,e.map((e=>{e[1].map((t=>{const n={$flags$:t[0],$tagName$:t[1],$members$:t[2],$listeners$:t[3]};n.$members$=t[2],n.$listeners$=t[3],n.$attrsToReflect$=[];const r=n.$tagName$,s=class extends HTMLElement{constructor(e){super(e),K(e=this,n),1&n.$flags$&&e.attachShadow({mode:"open"})}connectedCallback(){h&&(clearTimeout(h),h=null),p?d.push(this):ae.jmp((()=>(e=>{if(0==(1&ae.$flags$)){const t=Y(e),n=t.$cmpMeta$,r=(n.$tagName$,()=>{});if(1&t.$flags$)V(e,t,n.$listeners$);else{t.$flags$|=1;{let n=e;for(;n=n.parentNode||n.host;)if(n["s-p"]){O(t,t.$ancestorComponent$=n);break}}n.$members$&&Object.entries(n.$members$).map((([t,[n]])=>{if(31&n&&e.hasOwnProperty(t)){const n=e[t];delete e[t],e[t]=n}})),N(0,t,n)}r()}})(this)))}disconnectedCallback(){ae.jmp((()=>(e=>{if(0==(1&ae.$flags$)){const t=Y(e),n=t.$lazyInstance$;t.$rmListeners$&&(t.$rmListeners$.map((e=>e())),t.$rmListeners$=void 0),B(n,"disconnectedCallback")}})(this)))}componentOnReady(){return Y(this).$onReadyPromise$}};n.$lazyBundleId$=e[0],i.includes(r)||a.get(r)||(o.push(r),a.define(r,q(s,n,1)))}))}));{u.innerHTML=o+"{visibility:hidden}.hydrated{visibility:inherit}",u.setAttribute("data-styles","");const e=null!==(n=ae.$nonce$)&&void 0!==n?n:c(ie);null!=e&&u.setAttribute("nonce",e),s.insertBefore(u,l?l.nextSibling:s.firstChild)}p=!1,d.length?d.map((e=>e.connectedCallback())):ae.jmp((()=>h=setTimeout(U,30))),r()},V=(e,t,n,r)=>{n&&n.map((([n,r,o])=>{const i=W(e,n),a=z(t,o),s=X(n);ae.ael(i,r,a,s),(t.$rmListeners$=t.$rmListeners$||[]).push((()=>ae.rel(i,r,a,s)))}))},z=(e,t)=>n=>{try{256&e.$flags$?e.$lazyInstance$[t](n):(e.$queuedListeners$=e.$queuedListeners$||[]).push([t,n])}catch(e){ee(e)}},W=(e,t)=>8&t?oe:e,X=e=>0!=(2&e),Q=new WeakMap,Y=e=>Q.get(e),Z=(e,t)=>Q.set(t.$lazyInstance$=e,t),K=(e,t)=>{const n={$flags$:0,$hostElement$:e,$cmpMeta$:t,$instanceValues$:new Map};return n.$onInstancePromise$=new Promise((e=>n.$onInstanceResolve$=e)),n.$onReadyPromise$=new Promise((e=>n.$onReadyResolve$=e)),e["s-p"]=[],e["s-rc"]=[],V(e,n,t.$listeners$),Q.set(e,n)},J=(e,t)=>t in e,ee=(e,t)=>(0,console.error)(e,t),te=new Map,ne=(e,t,r)=>{const o=e.$tagName$.replace(/-/g,"_"),i=e.$lazyBundleId$,a=te.get(i);if(a)return a[o];if(!r||!BUILD.hotModuleReplacement){const e=e=>(te.set(i,e),e[o]);if("read-along"===i)return Promise.resolve().then(n.bind(n,704)).then(e,ee)}return n(131)(`./${i}.entry.js`).then((e=>(te.set(i,e),e[o])),ee)},re=new Map,oe="undefined"!=typeof window?window:{},ie=oe.document||{head:{}},ae={$flags$:0,$resourcesUrl$:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,t,n,r)=>e.addEventListener(t,n,r),rel:(e,t,n,r)=>e.removeEventListener(t,n,r),ce:(e,t)=>new CustomEvent(e,t)},se=e=>Promise.resolve(e),le=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync}catch(e){}return!1})(),ce=[],ue=[],de=(e,t)=>n=>{e.push(n),i||(i=!0,t&&4&ae.$flags$?_e(pe):ae.raf(pe))},he=e=>{for(let t=0;t{he(ce),he(ue),(i=ce.length>0)&&ae.raf(pe)},_e=e=>se().then(e),ge=de(ue,!0)},704:(e,t,n)=>{"use strict";n.r(t),n.d(t,{read_along:()=>C});var r=n(678),o="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self?self:{};var i,a,s=(function(e,t){ /*! * howler.js v2.2.3 * howlerjs.com @@ -8,7 +8,7 @@ * * MIT License */ -!function(){var e=function(){this.init()};e.prototype={init:function(){var e=this||n;return e._counter=1e3,e._html5AudioPool=[],e.html5PoolSize=10,e._codecs={},e._howls=[],e._muted=!1,e._volume=1,e._canPlayEvent="canplaythrough",e._navigator="undefined"!=typeof window&&window.navigator?window.navigator:null,e.masterGain=null,e.noAudio=!1,e.usingWebAudio=!0,e.autoSuspend=!0,e.ctx=null,e.autoUnlock=!0,e._setup(),e},volume:function(e){var t=this||n;if(e=parseFloat(e),t.ctx||d(),void 0!==e&&e>=0&&e<=1){if(t._volume=e,t._muted)return t;t.usingWebAudio&&t.masterGain.gain.setValueAtTime(e,n.ctx.currentTime);for(var r=0;r=0;t--)e._howls[t].unload();return e.usingWebAudio&&e.ctx&&void 0!==e.ctx.close&&(e.ctx.close(),e.ctx=null,d()),e},codecs:function(e){return(this||n)._codecs[e.replace(/^x-/,"")]},_setup:function(){var e=this||n;if(e.state=e.ctx&&e.ctx.state||"suspended",e._autoSuspend(),!e.usingWebAudio)if("undefined"!=typeof Audio)try{void 0===(new Audio).oncanplaythrough&&(e._canPlayEvent="canplay")}catch(t){e.noAudio=!0}else e.noAudio=!0;try{(new Audio).muted&&(e.noAudio=!0)}catch(e){}return e.noAudio||e._setupCodecs(),e},_setupCodecs:function(){var e=this||n,t=null;try{t="undefined"!=typeof Audio?new Audio:null}catch(t){return e}if(!t||"function"!=typeof t.canPlayType)return e;var r=t.canPlayType("audio/mpeg;").replace(/^no$/,""),o=e._navigator?e._navigator.userAgent:"",i=o.match(/OPR\/([0-6].)/g),s=i&&parseInt(i[0].split("/")[1],10)<33,a=-1!==o.indexOf("Safari")&&-1===o.indexOf("Chrome"),l=o.match(/Version\/(.*?) /),c=a&&l&&parseInt(l[1],10)<15;return e._codecs={mp3:!(s||!r&&!t.canPlayType("audio/mp3;").replace(/^no$/,"")),mpeg:!!r,opus:!!t.canPlayType('audio/ogg; codecs="opus"').replace(/^no$/,""),ogg:!!t.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),oga:!!t.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),wav:!!(t.canPlayType('audio/wav; codecs="1"')||t.canPlayType("audio/wav")).replace(/^no$/,""),aac:!!t.canPlayType("audio/aac;").replace(/^no$/,""),caf:!!t.canPlayType("audio/x-caf;").replace(/^no$/,""),m4a:!!(t.canPlayType("audio/x-m4a;")||t.canPlayType("audio/m4a;")||t.canPlayType("audio/aac;")).replace(/^no$/,""),m4b:!!(t.canPlayType("audio/x-m4b;")||t.canPlayType("audio/m4b;")||t.canPlayType("audio/aac;")).replace(/^no$/,""),mp4:!!(t.canPlayType("audio/x-mp4;")||t.canPlayType("audio/mp4;")||t.canPlayType("audio/aac;")).replace(/^no$/,""),weba:!(c||!t.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),webm:!(c||!t.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),dolby:!!t.canPlayType('audio/mp4; codecs="ec-3"').replace(/^no$/,""),flac:!!(t.canPlayType("audio/x-flac;")||t.canPlayType("audio/flac;")).replace(/^no$/,"")},e},_unlockAudio:function(){var e=this||n;if(!e._audioUnlocked&&e.ctx){e._audioUnlocked=!1,e.autoUnlock=!1,e._mobileUnloaded||44100===e.ctx.sampleRate||(e._mobileUnloaded=!0,e.unload()),e._scratchBuffer=e.ctx.createBuffer(1,1,22050);var t=function(n){for(;e._html5AudioPool.length0?a._seek:r._sprite[e][0]/1e3),u=Math.max(0,(r._sprite[e][0]+r._sprite[e][1])/1e3-c),d=1e3*u/Math.abs(a._rate),h=r._sprite[e][0]/1e3,p=(r._sprite[e][0]+r._sprite[e][1])/1e3;a._sprite=e,a._ended=!1;var _=function(){a._paused=!1,a._seek=c,a._start=h,a._stop=p,a._loop=!(!a._loop&&!r._sprite[e][2])};if(!(c>=p)){var g=a._node;if(r._webAudio){var f=function(){r._playLock=!1,_(),r._refreshBuffer(a);var e=a._muted||r._muted?0:a._volume;g.gain.setValueAtTime(e,n.ctx.currentTime),a._playStart=n.ctx.currentTime,void 0===g.bufferSource.start?a._loop?g.bufferSource.noteGrainOn(0,c,86400):g.bufferSource.noteGrainOn(0,c,u):a._loop?g.bufferSource.start(0,c,86400):g.bufferSource.start(0,c,u),d!==1/0&&(r._endTimers[a._id]=setTimeout(r._ended.bind(r,a),d)),t||setTimeout((function(){r._emit("play",a._id),r._loadQueue()}),0)};"running"===n.state&&"interrupted"!==n.ctx.state?f():(r._playLock=!0,r.once("resume",f),r._clearTimer(a._id))}else{var m=function(){g.currentTime=c,g.muted=a._muted||r._muted||n._muted||g.muted,g.volume=a._volume*n.volume(),g.playbackRate=a._rate;try{var o=g.play();if(o&&"undefined"!=typeof Promise&&(o instanceof Promise||"function"==typeof o.then)?(r._playLock=!0,_(),o.then((function(){r._playLock=!1,g._unlocked=!0,t?r._loadQueue():r._emit("play",a._id)})).catch((function(){r._playLock=!1,r._emit("playerror",a._id,"Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction."),a._ended=!0,a._paused=!0}))):t||(r._playLock=!1,_(),r._emit("play",a._id)),g.playbackRate=a._rate,g.paused)return void r._emit("playerror",a._id,"Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction.");"__default"!==e||a._loop?r._endTimers[a._id]=setTimeout(r._ended.bind(r,a),d):(r._endTimers[a._id]=function(){r._ended(a),g.removeEventListener("ended",r._endTimers[a._id],!1)},g.addEventListener("ended",r._endTimers[a._id],!1))}catch(e){r._emit("playerror",a._id,e)}};"data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA"===g.src&&(g.src=r._src,g.load());var b=window&&window.ejecta||!g.readyState&&n._navigator.isCocoonJS;if(g.readyState>=3||b)m();else{r._playLock=!0,r._state="loading";var y=function(){r._state="loaded",m(),g.removeEventListener(n._canPlayEvent,y,!1)};g.addEventListener(n._canPlayEvent,y,!1),r._clearTimer(a._id)}}return a._id}r._ended(a)},pause:function(e){var t=this;if("loaded"!==t._state||t._playLock)return t._queue.push({event:"pause",action:function(){t.pause(e)}}),t;for(var n=t._getSoundIds(e),r=0;r=0?t=parseInt(i[0],10):e=parseFloat(i[0])}else i.length>=2&&(e=parseFloat(i[0]),t=parseInt(i[1],10));if(!(void 0!==e&&e>=0&&e<=1))return(r=t?o._soundById(t):o._sounds[0])?r._volume:0;if("loaded"!==o._state||o._playLock)return o._queue.push({event:"volume",action:function(){o.volume.apply(o,i)}}),o;void 0===t&&(o._volume=e),t=o._getSoundIds(t);for(var l=0;l0?r/c:r),d=Date.now();e._fadeTo=n,e._interval=setInterval((function(){var o=(Date.now()-d)/r;d=Date.now(),a+=l*o,a=Math.round(100*a)/100,a=l<0?Math.max(n,a):Math.min(n,a),s._webAudio?e._volume=a:s.volume(a,e._id,!0),i&&(s._volume=a),(nt&&a>=n)&&(clearInterval(e._interval),e._interval=null,e._fadeTo=null,s.volume(n,e._id),s._emit("fade",e._id))}),u)},_stopFade:function(e){var t=this,r=t._soundById(e);return r&&r._interval&&(t._webAudio&&r._node.gain.cancelScheduledValues(n.ctx.currentTime),clearInterval(r._interval),r._interval=null,t.volume(r._fadeTo,e),r._fadeTo=null,t._emit("fade",e)),t},loop:function(){var e,t,n,r=this,o=arguments;if(0===o.length)return r._loop;if(1===o.length){if("boolean"!=typeof o[0])return!!(n=r._soundById(parseInt(o[0],10)))&&n._loop;e=o[0],r._loop=e}else 2===o.length&&(e=o[0],t=parseInt(o[1],10));for(var i=r._getSoundIds(t),s=0;s=0?t=parseInt(i[0],10):e=parseFloat(i[0])}else 2===i.length&&(e=parseFloat(i[0]),t=parseInt(i[1],10));if("number"!=typeof e)return(r=o._soundById(t))?r._rate:o._rate;if("loaded"!==o._state||o._playLock)return o._queue.push({event:"rate",action:function(){o.rate.apply(o,i)}}),o;void 0===t&&(o._rate=e),t=o._getSoundIds(t);for(var l=0;l=0?t=parseInt(o[0],10):r._sounds.length&&(t=r._sounds[0]._id,e=parseFloat(o[0]))}else 2===o.length&&(e=parseFloat(o[0]),t=parseInt(o[1],10));if(void 0===t)return 0;if("number"==typeof e&&("loaded"!==r._state||r._playLock))return r._queue.push({event:"seek",action:function(){r.seek.apply(r,o)}}),r;var a=r._soundById(t);if(a){if(!("number"==typeof e&&e>=0)){if(r._webAudio){var l=r.playing(t)?n.ctx.currentTime-a._playStart:0,c=a._rateSeek?a._rateSeek-a._seek:0;return a._seek+(c+l*Math.abs(a._rate))}return a._node.currentTime}var u=r.playing(t);u&&r.pause(t,!0),a._seek=e,a._ended=!1,r._clearTimer(t),r._webAudio||!a._node||isNaN(a._node.duration)||(a._node.currentTime=e);var d=function(){u&&r.play(t,!0),r._emit("seek",t)};if(u&&!r._webAudio){var h=function(){r._playLock?setTimeout(h,0):d()};setTimeout(h,0)}else d()}return r},playing:function(e){var t=this;if("number"==typeof e){var n=t._soundById(e);return!!n&&!n._paused}for(var r=0;r=0&&n._howls.splice(o,1);var i=!0;for(r=0;r=0){i=!1;break}return s&&i&&delete s[e._src],n.noAudio=!1,e._state="unloaded",e._sounds=[],e=null,null},on:function(e,t,n,r){var o=this["_on"+e];return"function"==typeof t&&o.push(r?{id:n,fn:t,once:r}:{id:n,fn:t}),this},off:function(e,t,n){var r=this,o=r["_on"+e],i=0;if("number"==typeof t&&(n=t,t=null),t||n)for(i=0;i=0;i--)o[i].id&&o[i].id!==t&&"load"!==e||(setTimeout(function(e){e.call(this,t,n)}.bind(r,o[i].fn),0),o[i].once&&r.off(e,o[i].fn,o[i].id));return r._loadQueue(e),r},_loadQueue:function(e){var t=this;if(t._queue.length>0){var n=t._queue[0];n.event===e&&(t._queue.shift(),t._loadQueue()),e||n.action()}return t},_ended:function(e){var t=this,r=e._sprite;if(!t._webAudio&&e._node&&!e._node.paused&&!e._node.ended&&e._node.currentTime=0;r--){if(n<=t)return;e._sounds[r]._ended&&(e._webAudio&&e._sounds[r]._node&&e._sounds[r]._node.disconnect(0),e._sounds.splice(r,1),n--)}}},_getSoundIds:function(e){if(void 0===e){for(var t=[],n=0;n=0;if(n._scratchBuffer&&e.bufferSource&&(e.bufferSource.onended=null,e.bufferSource.disconnect(0),t))try{e.bufferSource.buffer=n._scratchBuffer}catch(e){}return e.bufferSource=null,this},_clearSound:function(e){/MSIE |Trident\//.test(n._navigator&&n._navigator.userAgent)||(e.src="data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA")}};var i=function(e){this._parent=e,this.init()};i.prototype={init:function(){var e=this,t=e._parent;return e._muted=t._muted,e._loop=t._loop,e._volume=t._volume,e._rate=t._rate,e._seek=0,e._paused=!0,e._ended=!0,e._sprite="__default",e._id=++n._counter,t._sounds.push(e),e.create(),e},create:function(){var e=this,t=e._parent,r=n._muted||e._muted||e._parent._muted?0:e._volume;return t._webAudio?(e._node=void 0===n.ctx.createGain?n.ctx.createGainNode():n.ctx.createGain(),e._node.gain.setValueAtTime(r,n.ctx.currentTime),e._node.paused=!0,e._node.connect(n.masterGain)):n.noAudio||(e._node=n._obtainHtml5Audio(),e._errorFn=e._errorListener.bind(e),e._node.addEventListener("error",e._errorFn,!1),e._loadFn=e._loadListener.bind(e),e._node.addEventListener(n._canPlayEvent,e._loadFn,!1),e._endFn=e._endListener.bind(e),e._node.addEventListener("ended",e._endFn,!1),e._node.src=t._src,e._node.preload=!0===t._preload?"auto":t._preload,e._node.volume=r*n.volume(),e._node.load()),e},reset:function(){var e=this,t=e._parent;return e._muted=t._muted,e._loop=t._loop,e._volume=t._volume,e._rate=t._rate,e._seek=0,e._rateSeek=0,e._paused=!0,e._ended=!0,e._sprite="__default",e._id=++n._counter,e},_errorListener:function(){var e=this;e._parent._emit("loaderror",e._id,e._node.error?e._node.error.code:0),e._node.removeEventListener("error",e._errorFn,!1)},_loadListener:function(){var e=this,t=e._parent;t._duration=Math.ceil(10*e._node.duration)/10,0===Object.keys(t._sprite).length&&(t._sprite={__default:[0,1e3*t._duration]}),"loaded"!==t._state&&(t._state="loaded",t._emit("load"),t._loadQueue()),e._node.removeEventListener(n._canPlayEvent,e._loadFn,!1)},_endListener:function(){var e=this,t=e._parent;t._duration===1/0&&(t._duration=Math.ceil(10*e._node.duration)/10,t._sprite.__default[1]===1/0&&(t._sprite.__default[1]=1e3*t._duration),t._ended(e)),e._node.removeEventListener("ended",e._endFn,!1)}};var s={},a=function(e){var t=e._src;if(s[t])return e._duration=s[t].duration,void u(e);if(/^data:[^;]+;base64,/.test(t)){for(var n=atob(t.split(",")[1]),r=new Uint8Array(n.length),o=0;o0?(s[t._src]=e,u(t,e)):r()};"undefined"!=typeof Promise&&1===n.ctx.decodeAudioData.length?n.ctx.decodeAudioData(e).then(o).catch(r):n.ctx.decodeAudioData(e,o,r)},u=function(e,t){t&&!e._duration&&(e._duration=t.duration),0===Object.keys(e._sprite).length&&(e._sprite={__default:[0,1e3*e._duration]}),"loaded"!==e._state&&(e._state="loaded",e._emit("load"),e._loadQueue())},d=function(){if(n.usingWebAudio){try{"undefined"!=typeof AudioContext?n.ctx=new AudioContext:"undefined"!=typeof webkitAudioContext?n.ctx=new webkitAudioContext:n.usingWebAudio=!1}catch(e){n.usingWebAudio=!1}n.ctx||(n.usingWebAudio=!1);var e=/iP(hone|od|ad)/.test(n._navigator&&n._navigator.platform),t=n._navigator&&n._navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/),r=t?parseInt(t[1],10):null;if(e&&r&&r<9){var o=/safari/.test(n._navigator&&n._navigator.userAgent.toLowerCase());n._navigator&&!o&&(n.usingWebAudio=!1)}n.usingWebAudio&&(n.masterGain=void 0===n.ctx.createGain?n.ctx.createGainNode():n.ctx.createGain(),n.masterGain.gain.setValueAtTime(n._muted?0:n._volume,n.ctx.currentTime),n.masterGain.connect(n.ctx.destination)),n._setup()}};t.Howler=n,t.Howl=r,void 0!==o?(o.HowlerGlobal=e,o.Howler=n,o.Howl=r,o.Sound=i):"undefined"!=typeof window&&(window.HowlerGlobal=e,window.Howler=n,window.Howl=r,window.Sound=i)}(), +!function(){var e=function(){this.init()};e.prototype={init:function(){var e=this||n;return e._counter=1e3,e._html5AudioPool=[],e.html5PoolSize=10,e._codecs={},e._howls=[],e._muted=!1,e._volume=1,e._canPlayEvent="canplaythrough",e._navigator="undefined"!=typeof window&&window.navigator?window.navigator:null,e.masterGain=null,e.noAudio=!1,e.usingWebAudio=!0,e.autoSuspend=!0,e.ctx=null,e.autoUnlock=!0,e._setup(),e},volume:function(e){var t=this||n;if(e=parseFloat(e),t.ctx||d(),void 0!==e&&e>=0&&e<=1){if(t._volume=e,t._muted)return t;t.usingWebAudio&&t.masterGain.gain.setValueAtTime(e,n.ctx.currentTime);for(var r=0;r=0;t--)e._howls[t].unload();return e.usingWebAudio&&e.ctx&&void 0!==e.ctx.close&&(e.ctx.close(),e.ctx=null,d()),e},codecs:function(e){return(this||n)._codecs[e.replace(/^x-/,"")]},_setup:function(){var e=this||n;if(e.state=e.ctx&&e.ctx.state||"suspended",e._autoSuspend(),!e.usingWebAudio)if("undefined"!=typeof Audio)try{void 0===(new Audio).oncanplaythrough&&(e._canPlayEvent="canplay")}catch(t){e.noAudio=!0}else e.noAudio=!0;try{(new Audio).muted&&(e.noAudio=!0)}catch(e){}return e.noAudio||e._setupCodecs(),e},_setupCodecs:function(){var e=this||n,t=null;try{t="undefined"!=typeof Audio?new Audio:null}catch(t){return e}if(!t||"function"!=typeof t.canPlayType)return e;var r=t.canPlayType("audio/mpeg;").replace(/^no$/,""),o=e._navigator?e._navigator.userAgent:"",i=o.match(/OPR\/([0-6].)/g),a=i&&parseInt(i[0].split("/")[1],10)<33,s=-1!==o.indexOf("Safari")&&-1===o.indexOf("Chrome"),l=o.match(/Version\/(.*?) /),c=s&&l&&parseInt(l[1],10)<15;return e._codecs={mp3:!(a||!r&&!t.canPlayType("audio/mp3;").replace(/^no$/,"")),mpeg:!!r,opus:!!t.canPlayType('audio/ogg; codecs="opus"').replace(/^no$/,""),ogg:!!t.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),oga:!!t.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),wav:!!(t.canPlayType('audio/wav; codecs="1"')||t.canPlayType("audio/wav")).replace(/^no$/,""),aac:!!t.canPlayType("audio/aac;").replace(/^no$/,""),caf:!!t.canPlayType("audio/x-caf;").replace(/^no$/,""),m4a:!!(t.canPlayType("audio/x-m4a;")||t.canPlayType("audio/m4a;")||t.canPlayType("audio/aac;")).replace(/^no$/,""),m4b:!!(t.canPlayType("audio/x-m4b;")||t.canPlayType("audio/m4b;")||t.canPlayType("audio/aac;")).replace(/^no$/,""),mp4:!!(t.canPlayType("audio/x-mp4;")||t.canPlayType("audio/mp4;")||t.canPlayType("audio/aac;")).replace(/^no$/,""),weba:!(c||!t.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),webm:!(c||!t.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),dolby:!!t.canPlayType('audio/mp4; codecs="ec-3"').replace(/^no$/,""),flac:!!(t.canPlayType("audio/x-flac;")||t.canPlayType("audio/flac;")).replace(/^no$/,"")},e},_unlockAudio:function(){var e=this||n;if(!e._audioUnlocked&&e.ctx){e._audioUnlocked=!1,e.autoUnlock=!1,e._mobileUnloaded||44100===e.ctx.sampleRate||(e._mobileUnloaded=!0,e.unload()),e._scratchBuffer=e.ctx.createBuffer(1,1,22050);var t=function(n){for(;e._html5AudioPool.length0?s._seek:r._sprite[e][0]/1e3),u=Math.max(0,(r._sprite[e][0]+r._sprite[e][1])/1e3-c),d=1e3*u/Math.abs(s._rate),h=r._sprite[e][0]/1e3,p=(r._sprite[e][0]+r._sprite[e][1])/1e3;s._sprite=e,s._ended=!1;var _=function(){s._paused=!1,s._seek=c,s._start=h,s._stop=p,s._loop=!(!s._loop&&!r._sprite[e][2])};if(!(c>=p)){var g=s._node;if(r._webAudio){var f=function(){r._playLock=!1,_(),r._refreshBuffer(s);var e=s._muted||r._muted?0:s._volume;g.gain.setValueAtTime(e,n.ctx.currentTime),s._playStart=n.ctx.currentTime,void 0===g.bufferSource.start?s._loop?g.bufferSource.noteGrainOn(0,c,86400):g.bufferSource.noteGrainOn(0,c,u):s._loop?g.bufferSource.start(0,c,86400):g.bufferSource.start(0,c,u),d!==1/0&&(r._endTimers[s._id]=setTimeout(r._ended.bind(r,s),d)),t||setTimeout((function(){r._emit("play",s._id),r._loadQueue()}),0)};"running"===n.state&&"interrupted"!==n.ctx.state?f():(r._playLock=!0,r.once("resume",f),r._clearTimer(s._id))}else{var m=function(){g.currentTime=c,g.muted=s._muted||r._muted||n._muted||g.muted,g.volume=s._volume*n.volume(),g.playbackRate=s._rate;try{var o=g.play();if(o&&"undefined"!=typeof Promise&&(o instanceof Promise||"function"==typeof o.then)?(r._playLock=!0,_(),o.then((function(){r._playLock=!1,g._unlocked=!0,t?r._loadQueue():r._emit("play",s._id)})).catch((function(){r._playLock=!1,r._emit("playerror",s._id,"Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction."),s._ended=!0,s._paused=!0}))):t||(r._playLock=!1,_(),r._emit("play",s._id)),g.playbackRate=s._rate,g.paused)return void r._emit("playerror",s._id,"Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction.");"__default"!==e||s._loop?r._endTimers[s._id]=setTimeout(r._ended.bind(r,s),d):(r._endTimers[s._id]=function(){r._ended(s),g.removeEventListener("ended",r._endTimers[s._id],!1)},g.addEventListener("ended",r._endTimers[s._id],!1))}catch(e){r._emit("playerror",s._id,e)}};"data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA"===g.src&&(g.src=r._src,g.load());var b=window&&window.ejecta||!g.readyState&&n._navigator.isCocoonJS;if(g.readyState>=3||b)m();else{r._playLock=!0,r._state="loading";var y=function(){r._state="loaded",m(),g.removeEventListener(n._canPlayEvent,y,!1)};g.addEventListener(n._canPlayEvent,y,!1),r._clearTimer(s._id)}}return s._id}r._ended(s)},pause:function(e){var t=this;if("loaded"!==t._state||t._playLock)return t._queue.push({event:"pause",action:function(){t.pause(e)}}),t;for(var n=t._getSoundIds(e),r=0;r=0?t=parseInt(i[0],10):e=parseFloat(i[0])}else i.length>=2&&(e=parseFloat(i[0]),t=parseInt(i[1],10));if(!(void 0!==e&&e>=0&&e<=1))return(r=t?o._soundById(t):o._sounds[0])?r._volume:0;if("loaded"!==o._state||o._playLock)return o._queue.push({event:"volume",action:function(){o.volume.apply(o,i)}}),o;void 0===t&&(o._volume=e),t=o._getSoundIds(t);for(var l=0;l0?r/c:r),d=Date.now();e._fadeTo=n,e._interval=setInterval((function(){var o=(Date.now()-d)/r;d=Date.now(),s+=l*o,s=Math.round(100*s)/100,s=l<0?Math.max(n,s):Math.min(n,s),a._webAudio?e._volume=s:a.volume(s,e._id,!0),i&&(a._volume=s),(nt&&s>=n)&&(clearInterval(e._interval),e._interval=null,e._fadeTo=null,a.volume(n,e._id),a._emit("fade",e._id))}),u)},_stopFade:function(e){var t=this,r=t._soundById(e);return r&&r._interval&&(t._webAudio&&r._node.gain.cancelScheduledValues(n.ctx.currentTime),clearInterval(r._interval),r._interval=null,t.volume(r._fadeTo,e),r._fadeTo=null,t._emit("fade",e)),t},loop:function(){var e,t,n,r=this,o=arguments;if(0===o.length)return r._loop;if(1===o.length){if("boolean"!=typeof o[0])return!!(n=r._soundById(parseInt(o[0],10)))&&n._loop;e=o[0],r._loop=e}else 2===o.length&&(e=o[0],t=parseInt(o[1],10));for(var i=r._getSoundIds(t),a=0;a=0?t=parseInt(i[0],10):e=parseFloat(i[0])}else 2===i.length&&(e=parseFloat(i[0]),t=parseInt(i[1],10));if("number"!=typeof e)return(r=o._soundById(t))?r._rate:o._rate;if("loaded"!==o._state||o._playLock)return o._queue.push({event:"rate",action:function(){o.rate.apply(o,i)}}),o;void 0===t&&(o._rate=e),t=o._getSoundIds(t);for(var l=0;l=0?t=parseInt(o[0],10):r._sounds.length&&(t=r._sounds[0]._id,e=parseFloat(o[0]))}else 2===o.length&&(e=parseFloat(o[0]),t=parseInt(o[1],10));if(void 0===t)return 0;if("number"==typeof e&&("loaded"!==r._state||r._playLock))return r._queue.push({event:"seek",action:function(){r.seek.apply(r,o)}}),r;var s=r._soundById(t);if(s){if(!("number"==typeof e&&e>=0)){if(r._webAudio){var l=r.playing(t)?n.ctx.currentTime-s._playStart:0,c=s._rateSeek?s._rateSeek-s._seek:0;return s._seek+(c+l*Math.abs(s._rate))}return s._node.currentTime}var u=r.playing(t);u&&r.pause(t,!0),s._seek=e,s._ended=!1,r._clearTimer(t),r._webAudio||!s._node||isNaN(s._node.duration)||(s._node.currentTime=e);var d=function(){u&&r.play(t,!0),r._emit("seek",t)};if(u&&!r._webAudio){var h=function(){r._playLock?setTimeout(h,0):d()};setTimeout(h,0)}else d()}return r},playing:function(e){var t=this;if("number"==typeof e){var n=t._soundById(e);return!!n&&!n._paused}for(var r=0;r=0&&n._howls.splice(o,1);var i=!0;for(r=0;r=0){i=!1;break}return a&&i&&delete a[e._src],n.noAudio=!1,e._state="unloaded",e._sounds=[],e=null,null},on:function(e,t,n,r){var o=this["_on"+e];return"function"==typeof t&&o.push(r?{id:n,fn:t,once:r}:{id:n,fn:t}),this},off:function(e,t,n){var r=this,o=r["_on"+e],i=0;if("number"==typeof t&&(n=t,t=null),t||n)for(i=0;i=0;i--)o[i].id&&o[i].id!==t&&"load"!==e||(setTimeout(function(e){e.call(this,t,n)}.bind(r,o[i].fn),0),o[i].once&&r.off(e,o[i].fn,o[i].id));return r._loadQueue(e),r},_loadQueue:function(e){var t=this;if(t._queue.length>0){var n=t._queue[0];n.event===e&&(t._queue.shift(),t._loadQueue()),e||n.action()}return t},_ended:function(e){var t=this,r=e._sprite;if(!t._webAudio&&e._node&&!e._node.paused&&!e._node.ended&&e._node.currentTime=0;r--){if(n<=t)return;e._sounds[r]._ended&&(e._webAudio&&e._sounds[r]._node&&e._sounds[r]._node.disconnect(0),e._sounds.splice(r,1),n--)}}},_getSoundIds:function(e){if(void 0===e){for(var t=[],n=0;n=0;if(n._scratchBuffer&&e.bufferSource&&(e.bufferSource.onended=null,e.bufferSource.disconnect(0),t))try{e.bufferSource.buffer=n._scratchBuffer}catch(e){}return e.bufferSource=null,this},_clearSound:function(e){/MSIE |Trident\//.test(n._navigator&&n._navigator.userAgent)||(e.src="data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA")}};var i=function(e){this._parent=e,this.init()};i.prototype={init:function(){var e=this,t=e._parent;return e._muted=t._muted,e._loop=t._loop,e._volume=t._volume,e._rate=t._rate,e._seek=0,e._paused=!0,e._ended=!0,e._sprite="__default",e._id=++n._counter,t._sounds.push(e),e.create(),e},create:function(){var e=this,t=e._parent,r=n._muted||e._muted||e._parent._muted?0:e._volume;return t._webAudio?(e._node=void 0===n.ctx.createGain?n.ctx.createGainNode():n.ctx.createGain(),e._node.gain.setValueAtTime(r,n.ctx.currentTime),e._node.paused=!0,e._node.connect(n.masterGain)):n.noAudio||(e._node=n._obtainHtml5Audio(),e._errorFn=e._errorListener.bind(e),e._node.addEventListener("error",e._errorFn,!1),e._loadFn=e._loadListener.bind(e),e._node.addEventListener(n._canPlayEvent,e._loadFn,!1),e._endFn=e._endListener.bind(e),e._node.addEventListener("ended",e._endFn,!1),e._node.src=t._src,e._node.preload=!0===t._preload?"auto":t._preload,e._node.volume=r*n.volume(),e._node.load()),e},reset:function(){var e=this,t=e._parent;return e._muted=t._muted,e._loop=t._loop,e._volume=t._volume,e._rate=t._rate,e._seek=0,e._rateSeek=0,e._paused=!0,e._ended=!0,e._sprite="__default",e._id=++n._counter,e},_errorListener:function(){var e=this;e._parent._emit("loaderror",e._id,e._node.error?e._node.error.code:0),e._node.removeEventListener("error",e._errorFn,!1)},_loadListener:function(){var e=this,t=e._parent;t._duration=Math.ceil(10*e._node.duration)/10,0===Object.keys(t._sprite).length&&(t._sprite={__default:[0,1e3*t._duration]}),"loaded"!==t._state&&(t._state="loaded",t._emit("load"),t._loadQueue()),e._node.removeEventListener(n._canPlayEvent,e._loadFn,!1)},_endListener:function(){var e=this,t=e._parent;t._duration===1/0&&(t._duration=Math.ceil(10*e._node.duration)/10,t._sprite.__default[1]===1/0&&(t._sprite.__default[1]=1e3*t._duration),t._ended(e)),e._node.removeEventListener("ended",e._endFn,!1)}};var a={},s=function(e){var t=e._src;if(a[t])return e._duration=a[t].duration,void u(e);if(/^data:[^;]+;base64,/.test(t)){for(var n=atob(t.split(",")[1]),r=new Uint8Array(n.length),o=0;o0?(a[t._src]=e,u(t,e)):r()};"undefined"!=typeof Promise&&1===n.ctx.decodeAudioData.length?n.ctx.decodeAudioData(e).then(o).catch(r):n.ctx.decodeAudioData(e,o,r)},u=function(e,t){t&&!e._duration&&(e._duration=t.duration),0===Object.keys(e._sprite).length&&(e._sprite={__default:[0,1e3*e._duration]}),"loaded"!==e._state&&(e._state="loaded",e._emit("load"),e._loadQueue())},d=function(){if(n.usingWebAudio){try{"undefined"!=typeof AudioContext?n.ctx=new AudioContext:"undefined"!=typeof webkitAudioContext?n.ctx=new webkitAudioContext:n.usingWebAudio=!1}catch(e){n.usingWebAudio=!1}n.ctx||(n.usingWebAudio=!1);var e=/iP(hone|od|ad)/.test(n._navigator&&n._navigator.platform),t=n._navigator&&n._navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/),r=t?parseInt(t[1],10):null;if(e&&r&&r<9){var o=/safari/.test(n._navigator&&n._navigator.userAgent.toLowerCase());n._navigator&&!o&&(n.usingWebAudio=!1)}n.usingWebAudio&&(n.masterGain=void 0===n.ctx.createGain?n.ctx.createGainNode():n.ctx.createGain(),n.masterGain.gain.setValueAtTime(n._muted?0:n._volume,n.ctx.currentTime),n.masterGain.connect(n.ctx.destination)),n._setup()}};t.Howler=n,t.Howl=r,void 0!==o?(o.HowlerGlobal=e,o.Howler=n,o.Howl=r,o.Sound=i):"undefined"!=typeof window&&(window.HowlerGlobal=e,window.Howler=n,window.Howl=r,window.Sound=i)}(), /*! * Spatial Plugin - Adds support for stereo and 3D audio where Web Audio is supported. * @@ -20,4 +20,4 @@ * * MIT License */ -function(){var e;HowlerGlobal.prototype._pos=[0,0,0],HowlerGlobal.prototype._orientation=[0,0,-1,0,1,0],HowlerGlobal.prototype.stereo=function(e){var t=this;if(!t.ctx||!t.ctx.listener)return t;for(var n=t._howls.length-1;n>=0;n--)t._howls[n].stereo(e);return t},HowlerGlobal.prototype.pos=function(e,t,n){var r=this;return r.ctx&&r.ctx.listener?(t="number"!=typeof t?r._pos[1]:t,n="number"!=typeof n?r._pos[2]:n,"number"!=typeof e?r._pos:(r._pos=[e,t,n],void 0!==r.ctx.listener.positionX?(r.ctx.listener.positionX.setTargetAtTime(r._pos[0],Howler.ctx.currentTime,.1),r.ctx.listener.positionY.setTargetAtTime(r._pos[1],Howler.ctx.currentTime,.1),r.ctx.listener.positionZ.setTargetAtTime(r._pos[2],Howler.ctx.currentTime,.1)):r.ctx.listener.setPosition(r._pos[0],r._pos[1],r._pos[2]),r)):r},HowlerGlobal.prototype.orientation=function(e,t,n,r,o,i){var s=this;if(!s.ctx||!s.ctx.listener)return s;var a=s._orientation;return t="number"!=typeof t?a[1]:t,n="number"!=typeof n?a[2]:n,r="number"!=typeof r?a[3]:r,o="number"!=typeof o?a[4]:o,i="number"!=typeof i?a[5]:i,"number"!=typeof e?a:(s._orientation=[e,t,n,r,o,i],void 0!==s.ctx.listener.forwardX?(s.ctx.listener.forwardX.setTargetAtTime(e,Howler.ctx.currentTime,.1),s.ctx.listener.forwardY.setTargetAtTime(t,Howler.ctx.currentTime,.1),s.ctx.listener.forwardZ.setTargetAtTime(n,Howler.ctx.currentTime,.1),s.ctx.listener.upX.setTargetAtTime(r,Howler.ctx.currentTime,.1),s.ctx.listener.upY.setTargetAtTime(o,Howler.ctx.currentTime,.1),s.ctx.listener.upZ.setTargetAtTime(i,Howler.ctx.currentTime,.1)):s.ctx.listener.setOrientation(e,t,n,r,o,i),s)},Howl.prototype.init=(e=Howl.prototype.init,function(t){var n=this;return n._orientation=t.orientation||[1,0,0],n._stereo=t.stereo||null,n._pos=t.pos||null,n._pannerAttr={coneInnerAngle:void 0!==t.coneInnerAngle?t.coneInnerAngle:360,coneOuterAngle:void 0!==t.coneOuterAngle?t.coneOuterAngle:360,coneOuterGain:void 0!==t.coneOuterGain?t.coneOuterGain:0,distanceModel:void 0!==t.distanceModel?t.distanceModel:"inverse",maxDistance:void 0!==t.maxDistance?t.maxDistance:1e4,panningModel:void 0!==t.panningModel?t.panningModel:"HRTF",refDistance:void 0!==t.refDistance?t.refDistance:1,rolloffFactor:void 0!==t.rolloffFactor?t.rolloffFactor:1},n._onstereo=t.onstereo?[{fn:t.onstereo}]:[],n._onpos=t.onpos?[{fn:t.onpos}]:[],n._onorientation=t.onorientation?[{fn:t.onorientation}]:[],e.call(this,t)}),Howl.prototype.stereo=function(e,n){var r=this;if(!r._webAudio)return r;if("loaded"!==r._state)return r._queue.push({event:"stereo",action:function(){r.stereo(e,n)}}),r;var o=void 0===Howler.ctx.createStereoPanner?"spatial":"stereo";if(void 0===n){if("number"!=typeof e)return r._stereo;r._stereo=e,r._pos=[e,0,0]}for(var i=r._getSoundIds(n),s=0;s{throw e}),0)}const h={closed:!0,next(e){},error(e){if(u.useDeprecatedSynchronousErrorHandling)throw e;d(e)},complete(){}},p=Array.isArray||(e=>e&&"number"==typeof e.length);const _=(()=>{function e(e){return Error.call(this),this.message=e?`${e.length} errors occurred during unsubscription:\n${e.map(((e,t)=>`${t+1}) ${e.toString()}`)).join("\n ")}`:"",this.name="UnsubscriptionError",this.errors=e,this}return e.prototype=Object.create(Error.prototype),e})();class g{constructor(e){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,e&&(this._ctorUnsubscribe=!0,this._unsubscribe=e)}unsubscribe(){let e;if(this.closed)return;let{_parentOrParents:t,_ctorUnsubscribe:n,_unsubscribe:r,_subscriptions:o}=this;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,t instanceof g)t.remove(this);else if(null!==t)for(let e=0;ee.concat(t instanceof _?t.errors:t)),[])}g.EMPTY=function(e){return e.closed=!0,e}(new g);const m="function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random();class b extends g{constructor(e,t,n){switch(super(),this.syncErrorValue=null,this.syncErrorThrown=!1,this.syncErrorThrowable=!1,this.isStopped=!1,arguments.length){case 0:this.destination=h;break;case 1:if(!e){this.destination=h;break}if("object"==typeof e){e instanceof b?(this.syncErrorThrowable=e.syncErrorThrowable,this.destination=e,e.add(this)):(this.syncErrorThrowable=!0,this.destination=new y(this,e));break}default:this.syncErrorThrowable=!0,this.destination=new y(this,e,t,n)}}[m](){return this}static create(e,t,n){const r=new b(e,t,n);return r.syncErrorThrowable=!1,r}next(e){this.isStopped||this._next(e)}error(e){this.isStopped||(this.isStopped=!0,this._error(e))}complete(){this.isStopped||(this.isStopped=!0,this._complete())}unsubscribe(){this.closed||(this.isStopped=!0,super.unsubscribe())}_next(e){this.destination.next(e)}_error(e){this.destination.error(e),this.unsubscribe()}_complete(){this.destination.complete(),this.unsubscribe()}_unsubscribeAndRecycle(){const{_parentOrParents:e}=this;return this._parentOrParents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parentOrParents=e,this}}class y extends b{constructor(e,t,n,r){let o;super(),this._parentSubscriber=e;let i=this;l(t)?o=t:t&&(o=t.next,n=t.error,r=t.complete,t!==h&&(i=Object.create(t),l(i.unsubscribe)&&this.add(i.unsubscribe.bind(i)),i.unsubscribe=this.unsubscribe.bind(this))),this._context=i,this._next=o,this._error=n,this._complete=r}next(e){if(!this.isStopped&&this._next){const{_parentSubscriber:t}=this;u.useDeprecatedSynchronousErrorHandling&&t.syncErrorThrowable?this.__tryOrSetError(t,this._next,e)&&this.unsubscribe():this.__tryOrUnsub(this._next,e)}}error(e){if(!this.isStopped){const{_parentSubscriber:t}=this,{useDeprecatedSynchronousErrorHandling:n}=u;if(this._error)n&&t.syncErrorThrowable?(this.__tryOrSetError(t,this._error,e),this.unsubscribe()):(this.__tryOrUnsub(this._error,e),this.unsubscribe());else if(t.syncErrorThrowable)n?(t.syncErrorValue=e,t.syncErrorThrown=!0):d(e),this.unsubscribe();else{if(this.unsubscribe(),n)throw e;d(e)}}}complete(){if(!this.isStopped){const{_parentSubscriber:e}=this;if(this._complete){const t=()=>this._complete.call(this._context);u.useDeprecatedSynchronousErrorHandling&&e.syncErrorThrowable?(this.__tryOrSetError(e,t),this.unsubscribe()):(this.__tryOrUnsub(t),this.unsubscribe())}else this.unsubscribe()}}__tryOrUnsub(e,t){try{e.call(this._context,t)}catch(e){if(this.unsubscribe(),u.useDeprecatedSynchronousErrorHandling)throw e;d(e)}}__tryOrSetError(e,t,n){if(!u.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{t.call(this._context,n)}catch(t){return u.useDeprecatedSynchronousErrorHandling?(e.syncErrorValue=t,e.syncErrorThrown=!0,!0):(d(t),!0)}return!1}_unsubscribe(){const{_parentSubscriber:e}=this;this._context=null,this._parentSubscriber=null,e.unsubscribe()}}const v="function"==typeof Symbol&&Symbol.observable||"@@observable";function w(e){return e}class x{constructor(e){this._isScalar=!1,e&&(this._subscribe=e)}lift(e){const t=new x;return t.source=this,t.operator=e,t}subscribe(e,t,n){const{operator:r}=this,o=function(e,t,n){if(e){if(e instanceof b)return e;if(e[m])return e[m]()}return e||t||n?new b(e,t,n):new b(h)}(e,t,n);if(r?o.add(r.call(o,this.source)):o.add(this.source||u.useDeprecatedSynchronousErrorHandling&&!o.syncErrorThrowable?this._subscribe(o):this._trySubscribe(o)),u.useDeprecatedSynchronousErrorHandling&&o.syncErrorThrowable&&(o.syncErrorThrowable=!1,o.syncErrorThrown))throw o.syncErrorValue;return o}_trySubscribe(e){try{return this._subscribe(e)}catch(t){u.useDeprecatedSynchronousErrorHandling&&(e.syncErrorThrown=!0,e.syncErrorValue=t),!function(e){for(;e;){const{closed:t,destination:n,isStopped:r}=e;if(t||r)return!1;e=n&&n instanceof b?n:null}return!0}(e)?console.warn(t):e.error(t)}}forEach(e,t){return new(t=$(t))(((t,n)=>{let r;r=this.subscribe((t=>{try{e(t)}catch(e){n(e),r&&r.unsubscribe()}}),n,t)}))}_subscribe(e){const{source:t}=this;return t&&t.subscribe(e)}[v](){return this}pipe(...e){return 0===e.length?this:(0===(t=e).length?w:1===t.length?t[0]:function(e){return t.reduce(((e,t)=>t(e)),e)})(this);var t}toPromise(e){return new(e=$(e))(((e,t)=>{let n;this.subscribe((e=>n=e),(e=>t(e)),(()=>e(n)))}))}}function $(e){if(e||(e=Promise),!e)throw new Error("no Promise impl found");return e}x.create=e=>new x(e);class A{constructor(e,t){this.compare=e,this.keySelector=t}call(e,t){return t.subscribe(new T(e,this.compare,this.keySelector))}}class T extends b{constructor(e,t,n){super(e),this.keySelector=n,this.hasKey=!1,"function"==typeof t&&(this.compare=t)}compare(e,t){return e===t}_next(e){let t;try{const{keySelector:n}=this;t=n?n(e):e}catch(e){return this.destination.error(e)}let n=!1;if(this.hasKey)try{const{compare:e}=this;n=e(this.key,t)}catch(e){return this.destination.error(e)}else this.hasKey=!0;n||(this.key=t,this.destination.next(e))}}const S=(()=>{function e(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}return e.prototype=Object.create(Error.prototype),e})();class k extends g{constructor(e,t){super(),this.subject=e,this.subscriber=t,this.closed=!1}unsubscribe(){if(this.closed)return;this.closed=!0;const e=this.subject,t=e.observers;if(this.subject=null,!t||0===t.length||e.isStopped||e.closed)return;const n=t.indexOf(this.subscriber);-1!==n&&t.splice(n,1)}}class E extends b{constructor(e){super(e),this.destination=e}}class I extends x{constructor(){super(),this.observers=[],this.closed=!1,this.isStopped=!1,this.hasError=!1,this.thrownError=null}[m](){return new E(this)}lift(e){const t=new O(this,this);return t.operator=e,t}next(e){if(this.closed)throw new S;if(!this.isStopped){const{observers:t}=this,n=t.length,r=t.slice();for(let t=0;tnew O(e,t);class O extends I{constructor(e,t){super(),this.destination=e,this.source=t}next(e){const{destination:t}=this;t&&t.next&&t.next(e)}error(e){const{destination:t}=this;t&&t.error&&this.destination.error(e)}complete(){const{destination:e}=this;e&&e.complete&&this.destination.complete()}_subscribe(e){const{source:t}=this;return t?this.source.subscribe(e):g.EMPTY}}class R extends I{constructor(e){super(),this._value=e}get value(){return this.getValue()}_subscribe(e){const t=super._subscribe(e);return t&&!t.closed&&e.next(this._value),t}getValue(){if(this.hasError)throw this.thrownError;if(this.closed)throw new S;return this._value}next(e){super.next(this._value=e)}}var P=function(e){var t=this;t.sounds=[],t._sprite=e.sprite,t._reading$=new I,t._tinySprite=Object.keys(e.sprite).map((e=>[t._sprite[e][0],e])),t._tinySprite.pop(),t._percentPlayed=new R("0%"),t.sound=new a.Howl({src:e.src,sprite:e.sprite,rate:e.rate}),requestAnimationFrame(t.step.bind(t))};async function L(e){return new Promise((function(t,n){let r=new XMLHttpRequest;r.open("HEAD",e),r.onload=function(){this.status>=200&&this.status<300?t(!0):t(!1)},r.onerror=function(){t(!1)},r.send()}))}P.prototype={play:function(e){var t=this;t._spriteLeft=t._tinySprite;var n=e;return t.sound.play(n)},pause:function(){return this.sound.pause(),this.sound.id},goBack:function(e,t){var n=this;if(n._spriteLeft=n._tinySprite,n.sound.seek(e)-t>0){e=n.sound.seek(n.sound.seek(e)-t,e);for(var r=n.sound.seek(e),o=0;o=n._spriteLeft[o][0]&&(n._reading$.next(n._spriteLeft[o][1]),n._spriteLeft=n._spriteLeft.slice(o,n._spriteLeft.length))}else{e=n.sound.seek(0,e);n._reading$.next(n._spriteLeft[0][1])}return e},goTo:function(e,t){var n=this;n._spriteLeft=n._tinySprite;e=n.sound.seek(t,e);for(var r=n.sound.seek(e),o=0;o=n._spriteLeft[o][0]&&(n._reading$.next(n._spriteLeft[o][1]),n._spriteLeft=n._spriteLeft.slice(o,n._spriteLeft.length));return e},stop:function(){return this._reading$.next(""),this.sound.stop()},step:function(){for(var e=this,t=0;t0&&1e3*n>=e._spriteLeft[r][0]&&(e._reading$.next(e._spriteLeft[r][1]),e._spriteLeft=e._spriteLeft.slice(r,e._spriteLeft.length));let o=(n/e.sound.duration()*100||0)+"%";e.sounds[t].style.width=o,e.sounds[t].setAttribute("offset",o)}requestAnimationFrame(e.step.bind(e))}};const C=class{constructor(e){(0,r.r)(this,e),this.playback_rate=1,this.showGuide=!1,this.hasTextTranslations=!1,this.assetsStatus={AUDIO:0,RAS:0},this.alignment_failed=!1,this.isScrolling=!1,this.scrollTimer=null,this.Guide=()=>(0,r.h)("button",{class:"scroll-guide__container ripple ui-button theme--"+this.theme,onClick:()=>this.hideGuideAndScroll()},(0,r.h)("span",{class:"scroll-guide__text theme--"+this.theme},this.returnTranslation("re-align",this.language))),this.Overlay=()=>(0,r.h)("object",{onClick:e=>this.goToSeekFromProgress(e),id:"overlay__object",type:"image/svg+xml",data:this.svgOverlay}),this.RemoveImg=e=>(0,r.h)("button",{"data-cy":"delete-button","aria-label":"Delete",title:"Delete image",onClick:()=>this.deleteImage(e.pageIndex),id:"img-remover",class:"ripple theme--"+this.theme+" background--"+this.theme},(0,r.h)("i",{class:"material-icons"},"delete")),this.Img=e=>(0,r.h)("div",{class:"image__container page__col__image theme--"+this.theme},(0,r.h)("img",{alt:"image",class:"image",src:e.imgURL})),this.ImgPlaceHolder=e=>(0,r.h)("div",{class:"image__container page__col__image theme--"+this.theme},(0,r.h)("div",{class:"drop-area"},(0,r.h)("form",{class:"my-form"},(0,r.h)("p",{class:"theme--"+this.theme},this.returnTranslation("upload-image",this.language)),(0,r.h)("input",{type:"file",class:"fileElem",id:"fileElem--"+e.pageID,accept:"image/*",onChange:t=>this.handleFiles(t.target.files[0],e.pageIndex)}),(0,r.h)("label",{class:"button",htmlFor:"fileElem--"+e.pageID},this.returnTranslation("choose-file",this.language))))),this.PageCount=e=>(0,r.h)("div",{class:"page__counter color--"+this.theme},"Page ",(0,r.h)("span",{"data-cy":"page-count__current"},e.currentPage)," / ",(0,r.h)("span",{"data-cy":"page-count__total"},e.pgCount)),this.ImgContainer=e=>(0,r.h)("div",{class:"image__container"},(0,r.h)("span",{id:"image-container"},"EDIT"===this.mode&&e.pageIndex in this.images&&null!==this.images[e.pageIndex]?(0,r.h)(this.RemoveImg,{pageIndex:e.pageIndex}):null,e.pageIndex in this.images&&null!==this.images[e.pageIndex]?(0,r.h)(this.Img,{imgURL:this.images[e.pageIndex]}):null),"EDIT"!==this.mode||e.pageIndex in this.images&&null!==this.images[e.pageIndex]?null:(0,r.h)(this.ImgPlaceHolder,{pageID:e.pageID,pageIndex:e.pageIndex})),this.Page=e=>(0,r.h)("div",{class:"page page__container page--multi animate-transition theme--"+this.theme+" "+(e.pageData.attributes.class?e.pageData.attributes.class.value:""),id:e.pageData.id},this.parsed_text.length>1?(0,r.h)(this.PageCount,{pgCount:this.parsed_text.length,currentPage:this.parsed_text.indexOf(e.pageData)+1}):null,(0,r.h)(this.ImgContainer,{pageID:e.pageData.id,pageIndex:this.parsed_text.indexOf(e.pageData)}),(0,r.h)("div",{class:"page__col__text paragraph__container theme--"+this.theme},e.pageData.paragraphs.map((e=>(0,r.h)(this.Paragraph,{sentences:Array.from(e.childNodes),attributes:e.attributes}))))),this.Paragraph=e=>(0,r.h)("div",{class:"paragraph sentence__container theme--"+this.theme+" "+(e.attributes.class?e.attributes.class.value:"")},e.sentences.map((e=>e.childNodes.length>0&&(0,r.h)(this.Sentence,{sentenceData:e})))),this.Sentence=e=>{let t=Array.from(e.sentenceData.childNodes),n=e.sentenceData.id;!this.hasTextTranslations&&e.sentenceData.hasAttribute("class")&&(this.hasTextTranslations=/translation/.test(e.sentenceData.getAttribute("class")));let o={};return e.sentenceData.hasAttribute("xml:lang")&&(o.lang=e.sentenceData.getAttribute("xml:lang")),e.sentenceData.hasAttribute("lang")&&(o.lang=e.sentenceData.getAttribute("lang")),(0,r.h)("div",Object.assign({},o,{class:"sentence "+(e.sentenceData.hasAttribute("class")?e.sentenceData.getAttribute("class"):"")}),t.map(((t,n)=>{if("#text"===t.nodeName)return(0,r.h)(this.NonWordText,{text:t.textContent,attributes:t.attributes,id:(e.sentenceData.hasAttribute("id")?e.sentenceData.getAttribute("id"):"P")+"text"+n});if("w"===t.nodeName)return(0,r.h)(this.Word,{text:t.textContent,id:t.id,attributes:t.attributes});if(t){let o={};return t.hasAttribute("xml:lang")&&(o.lang=e.sentenceData.getAttribute("xml:lang")),t.hasAttribute("lang")&&(o.lang=e.sentenceData.getAttribute("lang")),(0,r.h)("span",Object.assign({},o,{class:"sentence__text theme--"+this.theme+" "+t.className,id:t.id?t.id:"text_"+n}),t.textContent)}})),(()=>"EDIT"!==this.mode||/translation/.test(e.sentenceData.getAttribute("class"))?null:n in this.translations&&n in this.translations&&null!==this.translations[n]?(0,r.h)("span",{class:"sentence__translation"},(0,r.h)("button",{title:"Remove translation","aria-label":"Remove translation","data-cy":"remove-translation-button",onClick:()=>this.removeLine(e.sentenceData),class:"sentence__translation__button remove"},(0,r.h)("i",{class:"material-icons"},"remove")),(0,r.h)("p",{id:n+"translation","data-cy":"translation-line",class:"sentence__text editable__translation",onInput:e=>{this.updateTranslation(n,e.currentTarget.innerText)},contentEditable:!0,onKeyDown:e=>{"Enter"==e.key&&e.preventDefault()},"data-placeholder":this.returnTranslation("line-placeholder",this.language)})):(0,r.h)("button",{title:"Add a translation, transliteration or gloss","aria-label":"Add translation","data-cy":"add-translation-button",class:"sentence__translation sentence__translation__button",onClick:()=>this.addLine(e.sentenceData)},(0,r.h)("i",{class:"material-icons"},"add")))())},this.NonWordText=e=>{let t={};return e.attributes&&e.attributes["xml:lang"]&&(t.lang=e.attributes["xml:lang"].value),e.attributes&&e.attributes.lang&&(t.lang=e.attributes.lang.value),(0,r.h)("span",Object.assign({},t,{class:"sentence__text theme--"+this.theme,id:e.id}),e.text)},this.Word=e=>{let t={};return e.attributes&&e.attributes["xml:lang"]&&(t.lang=e.attributes["xml:lang"].value),e.attributes&&e.attributes.lang&&(t.lang=e.attributes.lang.value),(0,r.h)("span",Object.assign({},t,{class:"sentence__word theme--"+this.theme+" "+(e&&e.attributes.class?e.attributes.class.value:""),id:e.id,onClick:e=>this.playSprite(e)}),e.text)},this.PlayControl=()=>(0,r.h)("button",{"data-cy":"play-button",disabled:this.hasLoaded<2,"aria-label":"Play",title:this.returnTranslation("play-tooltip",this.language),onClick:()=>{this.playing?this.pause():this.play()},class:"control-panel__control ripple theme--"+this.theme+" background--"+this.theme},(0,r.h)("i",{class:"material-icons"},this.playing?"pause":"play_arrow")),this.ReplayControl=()=>(0,r.h)("button",{"data-cy":"replay-button",disabled:this.hasLoaded<2,"aria-label":"Rewind",title:this.returnTranslation("rewind-tooltip",this.language),onClick:()=>this.goBack(5),class:"control-panel__control ripple theme--"+this.theme+" background--"+this.theme},(0,r.h)("i",{class:"material-icons"},"replay_5")),this.StopControl=()=>(0,r.h)("button",{"data-cy":"stop-button",disabled:this.hasLoaded<2,"aria-label":"Stop",title:this.returnTranslation("stop-tooltip",this.language),onClick:()=>this.stop(),class:"control-panel__control ripple theme--"+this.theme+" background--"+this.theme},(0,r.h)("i",{class:"material-icons"},"stop")),this.PlaybackSpeedControl=()=>(0,r.h)("div",null,(0,r.h)("h5",{class:"control-panel__buttons__header color--"+this.theme},this.returnTranslation("speed",this.language)),(0,r.h)("input",{type:"range",min:100-this.playbackRateRange,max:100+this.playbackRateRange,value:100*this.playback_rate,class:"slider control-panel__control",id:"myRange",onInput:e=>{console.log("v",e),this.changePlayback(e)}})),this.StyleControl=()=>(0,r.h)("button",{"aria-label":"Change theme",onClick:()=>this.changeTheme(),title:this.returnTranslation("theme-tooltip",this.language),class:"control-panel__control ripple theme--"+this.theme+" background--"+this.theme},(0,r.h)("i",{class:"material-icons-outlined"},"style")),this.FullScreenControl=()=>(0,r.h)("button",{"aria-label":"Full screen mode",onClick:()=>this.toggleFullscreen(),title:this.returnTranslation("full-screen-tooltip",this.language),class:"control-panel__control ripple theme--"+this.theme+" background--"+this.theme},(0,r.h)("i",{class:"material-icons","aria-label":"Full screen mode"},this.fullscreen?"fullscreen_exit":"fullscreen")),this.TextTranslationDisplayControl=()=>(0,r.h)("button",{"data-cy":"translation-toggle","aria-label":"Toggle Translation",title:this.returnTranslation("translation-tooltip",this.language),onClick:()=>this.toggleTextTranslation(),class:"control-panel__control ripple theme--"+this.theme+" background--"+this.theme},(0,r.h)("i",{class:"material-icons-outlined"},"subtitles")),this.ErrorMessage=e=>(0,r.h)("p",{"data-cy":e.data_cy,class:"alert status-error"},(0,r.h)("span",{class:"material-icons"},"error_outline_outlined")," ",e.msg),this.ControlPanel=()=>(0,r.h)("div",{"data-cy":"control-panel",class:"control-panel theme--"+this.theme+" background--"+this.theme},(0,r.h)("div",{class:"control-panel__buttons--left"},(0,r.h)(this.PlayControl,null),(0,r.h)(this.ReplayControl,null),(0,r.h)(this.StopControl,null)),(0,r.h)("div",{class:"control-panel__buttons--center"},(0,r.h)(this.PlaybackSpeedControl,null)),(0,r.h)("div",{class:"control-panel__buttons--right"},this.hasTextTranslations&&(0,r.h)(this.TextTranslationDisplayControl,null),(0,r.h)(this.StyleControl,null),(0,r.h)(this.FullScreenControl,null))),this.href=void 0,this.audio=void 0,this.svgOverlay=void 0,this.theme="light",this.language="eng",this.cssUrl=void 0,this.useAssetsFolder=!0,this.pageScrolling="horizontal",this.mode="VIEW",this.scrollBehaviour="smooth",this.displayTranslation=!0,this.playbackRateRange=15,this.playing=!1,this.fullscreen=!1,this.autoScroll=!0,this.hasLoaded=0,this.images=void 0,this.translations=void 0}handleScrollEvent(){this.isScrolling=!0,this.scrollTimer&&clearTimeout(this.scrollTimer),this.scrollTimer=setTimeout((()=>{this.isScrolling=!1}),125)}wheelHandler(e){if(this.el.shadowRoot.querySelector(".reading")&&(e.path[0].classList.contains("sentence__word")||e.path[0].classList.contains("sentence__container")||e.path[0].classList.contains("sentence"))&&this.autoScroll){let e=this.el.shadowRoot.querySelector(".reading");e&&(this.autoScroll=!this.inPageContentOverflow(e),this.showGuide=!this.autoScroll)}}urlTransform(e){return this.useAssetsFolder&&function(e){return!/^(https?:[/][/]|assets[/]|data:)/.test(e)}(e)&&!e.startsWith("blob")?"assets/"+e:e}buildSprite(e,t){return new P({src:[e],sprite:t,rate:this.playback_rate})}tagToQuery(e){return"#"+(e=(e=e.replace(".","\\.")).replace("#","\\#"))}returnWordClosestTo(e){let t=Object.keys(this.processed_alignment);t.pop();for(let n=1;nthis.processed_alignment[t[n]][0]&&this.processed_alignment[t[n+1]]&&1e3*ethis.autoScroll=!0),100)}goTo(e){void 0===this.play_id&&(this.play(),this.pause()),this.autoScroll=!1,e/=1e3,this.audio_howl_sprites.goTo(this.play_id,e),setTimeout((()=>this.autoScroll=!0),100)}goToSeekAtEl(e){let t=e.currentTarget.id,n=this.processed_alignment[t][0];return this.goTo(n),t}goToSeekFromProgress(e){let t=e.currentTarget.getBoundingClientRect(),n=t.left,r=t.width,o=(e.pageX-n)/r*this.duration*1e3;this.goTo(o)}pause(){this.playing=!1,this.audio_howl_sprites.pause()}play(){this.playing=!0,void 0!==this.play_id?this.play_id=this.audio_howl_sprites.play(this.play_id):this.play_id=this.audio_howl_sprites.play("all"),this.animateProgress()}playSprite(e){let t=this.goToSeekAtEl(e);this.playing||this.audio_howl_sprites.play(t)}stop(){this.playing=!1,this.audio_howl_sprites.stop(),this.el.shadowRoot.querySelectorAll(".reading").forEach((e=>e.classList.remove("reading"))),this.autoScroll||(this.autoScroll=!0,this.showGuide=!1)}toggleTextTranslation(){this.el.shadowRoot.querySelectorAll(".translation").forEach((e=>e.classList.toggle("invisible"))),this.el.shadowRoot.querySelectorAll(".sentence__translation").forEach((e=>e.classList.toggle("invisible")))}addHighlightingTo(e){this.el.shadowRoot.querySelectorAll(".reading").forEach((e=>e.classList.remove("reading"))),e.classList.add("reading")}animateProgressWithOverlay(){let e=this.el.shadowRoot.querySelector("#overlay__object"),t=e.contentDocument.querySelector("#progress-fill"),n=e.contentDocument.querySelector("#progress-trail"),r=e.contentDocument.querySelector("#progress-base");t.classList.add("stop-color--"+this.theme),r.classList.add("stop-color--"+this.theme),this.audio_howl_sprites.sounds.push(t),this.audio_howl_sprites.sounds.push(n),this.audio_howl_sprites.sound.once("end",(()=>{this.audio_howl_sprites.sounds.forEach((e=>{e.setAttribute("offset","0%")})),this.el.shadowRoot.querySelectorAll(".reading").forEach((e=>e.classList.remove("reading"))),this.playing=!1}),this.play_id)}animateProgressDefault(e,t){let n=document.createElement("div");n.className="progress theme--"+this.theme,n.id=e.toString(),n.dataset.sprite=t;let r=this.tagToQuery(t);this.el.shadowRoot.querySelector(r).appendChild(n),this.audio_howl_sprites.sounds.push(n),this.audio_howl_sprites.sound.once("end",(()=>{this.el.shadowRoot.querySelectorAll(".reading").forEach((e=>e.classList.remove("reading"))),this.playing=!1}),this.play_id)}animateProgress(e=this.play_id){this.svgOverlay?this.animateProgressWithOverlay():this.animateProgressDefault(e,"all")}changeFill(){let e=this.el.shadowRoot.querySelector(".sentence__word"),t=window.getComputedStyle(e).color,n=this.el.shadowRoot.querySelector("#overlay__object"),r=n.contentDocument.querySelector("#progress-fill"),o=n.contentDocument.querySelector("#progress-base");n.contentDocument.querySelector("#polygon").setAttribute("stroke",t),o.setAttribute("stop-color",t),r.setAttribute("stop-color",t)}async getImages(){return this.images}async getTranslations(){return this.translations}async changeTheme(){"light"===this.theme?this.theme="dark":this.theme="light"}static _getSentenceContainerOfWord(e){return e.parentElement.parentElement.parentElement}toggleFullscreen(){if(this.fullscreen){let e=this.el.ownerDocument;e.exitFullscreen?e.exitFullscreen():e.mozCancelFullScreen?e.mozCancelFullScreen():e.webkitExitFullscreen?e.webkitExitFullscreen():e.msExitFullscreen&&e.msExitFullscreen(),this.el.shadowRoot.getElementById("read-along-container").classList.remove("read-along-container--fullscreen")}else{let e=this.el.shadowRoot.getElementById("read-along-container");e.requestFullscreen?e.requestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.webkitRequestFullscreen?e.webkitRequestFullscreen():e.msRequestFullscreen&&e.msRequestFullscreen(),this.el.shadowRoot.getElementById("read-along-container").classList.add("read-along-container--fullscreen")}this.fullscreen=!this.fullscreen}hideGuideAndScroll(){let e=this.el.shadowRoot.querySelector(".reading"),t=new IntersectionObserver((n=>{let[r]=n;r.isIntersecting&&(setTimeout((()=>{this.showGuide=!1,this.autoScroll=!0}),100),t.unobserve(e))}));t.observe(e),this.scrollTo(e)}inParagraphContentOverflow(e){let t=C._getSentenceContainerOfWord(e).getBoundingClientRect(),n=e.getBoundingClientRect(),r=n.rightt.right,i=new IntersectionObserver((t=>{let[n]=t;n.isIntersecting&&(setTimeout((()=>{this.showGuide=!1,this.autoScroll=!0}),100),i.unobserve(e))}));return i.observe(e),r||o}inPageContentOverflow(e){let t=this.el.shadowRoot.querySelector("#"+this.current_page).getBoundingClientRect(),n=e.getBoundingClientRect(),r=n.top+n.height>t.top+t.height,o=n.top+n.height<0,i=new IntersectionObserver((t=>{let[n]=t;n.isIntersecting&&(setTimeout((()=>{this.showGuide=!1,this.autoScroll=!0}),100),i.unobserve(e))}));return i.observe(e),o||r}inPage(e){let t=C._getSentenceContainerOfWord(e).getBoundingClientRect(),n=e.getBoundingClientRect(),r=n.top+n.height>t.top+t.height,o=n.top+n.height<0,i=new IntersectionObserver((t=>{let[n]=t;n.isIntersecting&&(setTimeout((()=>{this.showGuide=!1,this.autoScroll=!0}),100),i.unobserve(e))}));return i.observe(e),o||r}scrollToPage(e){let t=this.el.shadowRoot.querySelector(".pages__container"),n=this.el.shadowRoot.querySelector("#"+e);t.scrollBy({top:null!=this.pageScrolling.match("vertical")?n.offsetTop-t.scrollTop:0,left:null!=this.pageScrolling.match("vertical")?0:n.offsetLeft-t.scrollLeft,behavior:this.scrollBehaviour}),n.scrollTo(0,0)}scrollByHeight(e){let t=C._getSentenceContainerOfWord(e),n=e.parentElement.getBoundingClientRect(),r=new IntersectionObserver((o=>{let[i]=o;i.isIntersecting?r.unobserve(e):t.scrollTo({top:t.getBoundingClientRect().height-n.height,left:0,behavior:this.scrollBehaviour})}),{root:t,threshold:[0,.25,.5,.75,1]});r.observe(e)}scrollByWidth(e){let t=C._getSentenceContainerOfWord(e),n=e.getBoundingClientRect();t.scrollTo({left:n.left-10,top:0,behavior:this.scrollBehaviour})}scrollTo(e){e.scrollIntoView({behavior:this.scrollBehaviour})}disconnectedCallback(){this.stop()}componentDidUpdate(){this.svgOverlay&&this.changeFill()}async componentWillLoad(){if(this.language.length<3&&(null!=this.language.match("fr")?this.language="fra":this.language="eng"),"smooth"!==this.scrollBehaviour&&"auto"!==this.scrollBehaviour&&(console.log("Invalid scroll-behaviour value, using default (smooth)"),this.scrollBehaviour="smooth"),(isNaN(this.playbackRateRange)||this.playbackRateRange<0||this.playbackRateRange>99)&&(console.log("Invalid playback-rate-range value, using default (15)."),this.playbackRateRange=15),this.parsed_text=await async function(e){let t=await fetch(e);if(!t.ok)return console.log(`fetch(${e}) failed with status ${t.status}`),null;let n=await t.text(),r=(new DOMParser).parseFromString(n,"text/xml");return Array.from(r.querySelectorAll("div[type=page]")).map((e=>{let t=e.querySelector("graphic[url]"),n=e.querySelectorAll("p"),r={id:e.getAttribute("id"),paragraphs:Array.from(n)};return null!==t&&(r.img=t.getAttribute("url")),e.attributes&&(r.attributes=e.attributes),r}))}(this.href),null===this.parsed_text)this.parsed_text=[],this.assetsStatus.RAS=3;else if(0===this.parsed_text.length)this.assetsStatus.RAS=2;else{this.images={},this.translations={};for(const[t,n]of this.parsed_text.entries())if("img"in n){var e=this.urlTransform(n.img);if(this.images[t]=this.urlTransform(n.img),/^(https?:[/]|assets)[/]\b/.test(e)){await L(e)||(this.images[t]=null)}}else this.images[t]=null;this.assetsStatus.RAS=1}this.hasLoaded+=1}componentDidLoad(){this.processed_alignment=function(e){let t={};for(const n of e)for(const e of n.paragraphs)for(const n of Array.from(e.querySelectorAll("w[time][dur]"))){const e=n.getAttribute("time"),r=n.getAttribute("dur");null!==e&&null!==r&&(t[n.getAttribute("id")]=[Math.round(1e3*parseFloat(e)),Math.round(1e3*parseFloat(r))])}return t}(this.parsed_text),this.alignment_failed=0==Object.keys(this.processed_alignment).length,this.audio_howl_sprites=new a.Howl({src:[this.audio],preload:!1}),this.audio_howl_sprites.once("load",(()=>{var e,t;this.processed_alignment.all=[0,1e3*this.audio_howl_sprites.duration()],this.duration=this.audio_howl_sprites.duration(),this.audio_howl_sprites=this.buildSprite(this.audio,this.processed_alignment),this.reading$=this.audio_howl_sprites._reading$.pipe((n=>n.lift(new A(e,t)))).subscribe((e=>{if(this.playing){let t=this.tagToQuery(e),n=this.el.shadowRoot.querySelector(t);this.el.shadowRoot.querySelectorAll(".reading").forEach((e=>e.classList.remove("reading"))),n.classList.add("reading");let r=C._getSentenceContainerOfWord(n).parentElement.id;r!==this.current_page&&(void 0===this.current_page||this.isScrolling||this.scrollToPage(r),this.current_page=r);const o=Math.ceil(this.el.shadowRoot.querySelector(".pages__container").getBoundingClientRect().left)+1,i=Math.ceil(this.el.shadowRoot.querySelector("#"+this.current_page).getBoundingClientRect().left);(n.getBoundingClientRect().left<0||i!==o)&&(this.isScrolling||this.scrollToPage(r)),this.inPageContentOverflow(n)&&this.autoScroll&&(n.scrollIntoView(!1),this.isScrolling||this.scrollByHeight(n)),this.inParagraphContentOverflow(n)&&this.autoScroll&&(n.scrollIntoView(!1),this.isScrolling||this.scrollByWidth(n))}})),this.hasLoaded+=1,this.assetsStatus.AUDIO=1})),this.audio_howl_sprites.once("loaderror",(()=>{this.hasLoaded+=1,this.assetsStatus.AUDIO=3})),this.audio_howl_sprites.load()}componentDidRender(){if(!this.displayTranslation&&this.parsed_text&&this.parsed_text.length>0&&(this.toggleTextTranslation(),this.displayTranslation=!0),this.latestTranslation){this.el.shadowRoot.querySelector(this.latestTranslation).focus(),this.latestTranslation=""}}returnTranslation(e,t,n,r){void 0===t&&(t=this.language);let o={speed:{eng:"Playback Speed",fra:"Vitesse de Lecture"},"re-align":{eng:"Re-align with audio",fra:"Réaligner avec l'audio"},"loading-error":{eng:"Error: the "+r+" file '"+n+"' could not be loaded.",fra:"Erreur: le fichier "+r+" '"+n+"' n'a pas pu être chargé."},"parse-error":{eng:"Error: the "+r+" file '"+n+"' could not be parsed.",fra:"Erreur: le fichier "+r+" '"+n+"' n'a pas pu être analysé."},"alignment-error":{eng:"Error: No alignments were found.",fra:"Erreur: aucun alignement n'a été trouvé."},loading:{eng:"Loading...",fra:"Chargement en cours"},"line-placeholder":{eng:"Type your text here",fra:"Écrivez votre texte ici"},"upload-image":{eng:"Upload an image for this page",fra:"Télécharger une image pour cette page"},"choose-file":{eng:"Choose a file",fra:"Choisir un fichier"},"play-tooltip":{eng:"Play audio recording",fra:"Écouter l'enregistrement"},"rewind-tooltip":{eng:"Rewind audio recording",fra:"Relire dès le début"},"stop-tooltip":{eng:"Stop audio recording",fra:"Arrêter la lecture"},"theme-tooltip":{eng:"Change theme",fra:"Changer de thême visuel"},"full-screen-tooltip":{eng:"Full screen mode",fra:"Mode plein écran"},"translation-tooltip":{eng:"Toggle translations",fra:"Afficher ou cacher les traductions"}};return o[e]&&o[e][t]?o[e][t]:e}addLine(e){this.hasTextTranslations||(this.hasTextTranslations=!0);let t={};t[e.id]="",this.translations=Object.assign(Object.assign({},this.translations),t),this.latestTranslation="#"+e.id+"translation"}removeLine(e){let t={};t[e.id]=null,this.translations=Object.assign(Object.assign({},this.translations),t)}updateTranslation(e,t){this.translations[e]=t}async handleFiles(e,t){let n=URL.createObjectURL(e),r={};r[t]=n,this.images=Object.assign(Object.assign({},this.images),r)}deleteImage(e){let t={};t[e]=null,this.images=Object.assign(Object.assign({},this.images),t)}render(){return(0,r.h)("div",{id:"read-along-container",class:"read-along-container"},(0,r.h)("h1",{class:"slot__header"},(0,r.h)("slot",{name:"read-along-header"})),(0,r.h)("h3",{class:"slot__subheader"},(0,r.h)("slot",{name:"read-along-subheader"})),Object.entries(this.assetsStatus).map((e=>{let t=e[0],n=e[1];if(2===n){let e=this.getPathFromAssetType(t);return(0,r.h)(this.ErrorMessage,{msg:this.returnTranslation("parse-error",this.language,e,t),data_cy:t+"-error"})}if(3===n){let e=this.getPathFromAssetType(t);return(0,r.h)(this.ErrorMessage,{msg:this.returnTranslation("loading-error",this.language,e,t),data_cy:t+"-error"})}})),this.alignment_failed&&1===this.assetsStatus.RAS&&(0,r.h)(this.ErrorMessage,{msg:this.returnTranslation("alignment-error",this.language),data_cy:"alignment-error"}),(0,r.h)("div",{onScroll:()=>{this.handleScrollEvent()},"data-cy":"text-container",class:"pages__container theme--"+this.theme+" "+this.pageScrolling},this.showGuide?(0,r.h)(this.Guide,null):null,1==this.assetsStatus.RAS&&this.parsed_text.map((e=>(0,r.h)(this.Page,{pageData:e}))),this.hasLoaded<2&&(0,r.h)("div",{class:"loader"})),this.alignment_failed||(0,r.h)("div",{onClick:e=>this.goToSeekFromProgress(e),id:"all","data-cy":"progress-bar",class:"overlay__container theme--"+this.theme+" background--"+this.theme},this.svgOverlay?(0,r.h)(this.Overlay,null):null),1==this.assetsStatus.AUDIO&&(0,r.h)(this.ControlPanel,null),this.cssUrl&&null!=this.cssUrl.match(".css")&&(0,r.h)("link",{href:this.cssUrl,rel:"stylesheet"}))}get el(){return(0,r.g)(this)}};C.style='@font-face{font-family:"Karla";font-style:normal;font-weight:400;src:local("Karla"), local("Karla-Regular"),\n url("assets/fonts/qkBbXvYC6trAT7RbLtyU5rZPoAU.woff2") format("woff2");unicode-range:U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB,\n U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF}@font-face{font-family:"Karla";font-style:normal;font-weight:400;src:local("Karla"), local("Karla-Regular"),\n url("assets/fonts/qkBbXvYC6trAT7RVLtyU5rZP.woff2") format("woff2");unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,\n U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215,\n U+FEFF, U+FFFD}@font-face{font-family:"Lato";font-style:normal;font-weight:400;src:local("Lato Regular"), local("Lato-Regular"),\n url("assets/fonts/S6uyw4BMUTPHjxAwXiWtFCfQ7A.woff2") format("woff2");unicode-range:U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB,\n U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF}@font-face{font-family:"Lato";font-style:normal;font-weight:400;src:local("Lato Regular"), local("Lato-Regular"),\n url("assets/fonts/S6uyw4BMUTPHjx4wXiWtFCc.woff2") format("woff2");unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,\n U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215,\n U+FEFF, U+FFFD}@font-face{font-family:"Material Icons";font-style:normal;font-weight:400;src:url("assets/fonts/flUhRq6tzZclQEJ-Vdg-IuiaDsNcIhQ8tQ.woff2")\n format("woff2")}@font-face{font-family:"Material Icons Outlined";font-style:normal;font-weight:400;src:url("assets/fonts/gok-H7zzDkdnRel8-DQ6KAXJ69wP1tGnf4ZGhUcel5euIg.woff2")\n format("woff2")}.material-icons{font-family:"Material Icons";font-weight:normal;font-style:normal;font-size:24px;line-height:1;letter-spacing:normal;text-transform:none;display:inline-block;white-space:nowrap;word-wrap:normal;direction:ltr;-webkit-font-feature-settings:"liga";-webkit-font-smoothing:antialiased}.material-icons-outlined{font-family:"Material Icons Outlined";font-weight:normal;font-style:normal;font-size:24px;line-height:1;letter-spacing:normal;text-transform:none;display:inline-block;white-space:nowrap;word-wrap:normal;direction:ltr;-webkit-font-feature-settings:"liga";-webkit-font-smoothing:antialiased}.font-weight--100{font-weight:100}.font-weight--200{font-weight:200}.font-weight--300{font-weight:300}.font-weight--400{font-weight:400}.font-weight--500{font-weight:500}.font-weight--600{font-weight:600}.font-weight--700{font-weight:700}.font-weight--800{font-weight:800}.font-weight--900{font-weight:900}.shadowed{text-shadow:0.3px 0.2px black}.theme--light.sentence,.theme--light.page__col__image,.theme--light.page__container,.theme--light.scroll-guide__container{background-color:#fff}.theme--dark.sentence,.theme--dark.page__col__image,.theme--dark.page__container,.theme--dark.scroll-guide__container{background-color:#3c4369}.sentence__word,.sentence__text,.scroll-guide__text{line-height:1.5;border-radius:0.3125em;position:relative;padding:0.0625em;font-size:1em}.theme--light.ripple,.theme--light.reading,.theme--light.sentence__word,.theme--light.sentence__text,.theme--light.scroll-guide__text{color:#040508}.theme--dark.ripple,.theme--dark.reading,.theme--dark.sentence__word,.theme--dark.sentence__text,.theme--dark.scroll-guide__text{color:#fff}.theme--light.ripple:active,.theme--light.reading:active,.theme--light.sentence__word:hover{color:#fff;background:gray radial-gradient(circle, transparent 1%, gray 1%) center/15000%}.theme--dark.ripple:active,.theme--dark.reading:active,.theme--dark.sentence__word:hover{color:#fff;background:#a6a6a6 radial-gradient(circle, transparent 1%, #a6a6a6 1%) center/15000%}.theme--light.sentence__word.reading{color:#fff;background:#666666 radial-gradient(circle, transparent 1%, #666666 1%) center/15000%}.theme--dark.sentence__word.reading{color:#040508;background:#fff radial-gradient(circle, transparent 1%, #fff 1%) center/15000%}.theme--light.page__col__img-placeholder{border:0.046875em dotted gray}.theme--dark.page__col__img-placeholder{border:0.046875em dotted #a6a6a6}.theme--light.scroll-guide__container,.theme--light.overlay__container{border:0.046875em solid gray}.theme--dark.scroll-guide__container,.theme--dark.overlay__container{border:0.046875em solid #a6a6a6}.theme--light.page--multi,.theme--light.pages__container,.theme--light.control-panel{border-left:0.046875em solid gray}.theme--dark.page--multi,.theme--dark.pages__container,.theme--dark.control-panel{border-left:0.046875em solid #a6a6a6}.theme--light.page--multi,.theme--light.pages__container,.theme--light.control-panel{border-right:0.046875em solid gray}.theme--dark.page--multi,.theme--dark.pages__container,.theme--dark.control-panel{border-right:0.046875em solid #a6a6a6}.theme--light.pages__container{border-top:0.046875em solid gray}.theme--dark.pages__container{border-top:0.046875em solid #a6a6a6}.theme--light.control-panel{border-bottom:0.046875em solid gray}.theme--dark.control-panel{border-bottom:0.046875em solid #a6a6a6}.ripple:hover,.reading:hover,.sentence__word:hover{cursor:pointer}@viewport{width:device-width}button{border:0;cursor:pointer}html{background-color:#fff;box-sizing:border-box;height:100%}*:before,*:after{box-sizing:inherit}body{-webkit-font-smoothing:antialiased;color:#040508;font-family:"Lato", sans-serif;min-height:100%;overflow-x:hidden;overflow-y:hidden;text-rendering:optimizeLegibility}a{background:transparent;color:#c69;text-decoration:none;transition:color 0.2s;outline:none}a:active,a:focus{outline:none}img{height:90%;max-width:90%;object-fit:cover}h1,h2,h3,h4,h5,h6{font-family:"Karla", sans-serif;font-weight:normal}p,mat-chip,mat-tab-label,span,button,a{font-family:"Lato", sans-serif}.theme--light::-webkit-scrollbar{width:0.5em;height:0.5em}.theme--light::-webkit-scrollbar-track{background:#fff}.theme--light::-webkit-scrollbar-thumb{background:#040508;border-radius:0.3125em;height:0.625em;width:0.625em}.theme--dark::-webkit-scrollbar{width:0.5em;height:0.5em}.theme--dark::-webkit-scrollbar-track{background:#3c4369}.theme--dark::-webkit-scrollbar-thumb{background:#fff;border-radius:0.3125em;height:0.625em;width:0.625em}.bg-img{background-image:url("../assets/img/bg.jpg");height:100vh;overflow:overlay;overflow-x:hidden;background-position:center;background-repeat:no-repeat;background-size:cover;min-height:100%}.shadow-box{box-shadow:0 0.3125rem 1rem 0 rgba(0, 0, 0, 0.24);padding:25px;background:rgba(255, 255, 255, 0.94);border-radius:5px}.font-xs{font-size:0.5em}.font-sm{font-size:0.75em}.font-md{font-size:1em}.font-lg{font-size:1.25em}.font-xl{font-size:1.5em}.font-xxl{font-size:2em}.faded{opacity:0.2;color:black}table{table-layout:fixed}.center{margin-left:auto;margin-right:auto;text-align:center}.container{max-width:80em}.background--light{background:#fff}.stop-color--light{fill:#fff}.color--light{color:#040508}.background--dark{background:#3c4369}.stop-color--dark{fill:#3c4369}.color--dark{color:#fff}.abs{position:absolute}.top-0{top:0}.left-0{left:0}.right-0{right:0}.top-5{top:0.3125em}.left-5{left:0.3125em}.right-5{right:0.3125em}.top-10{top:0.625em}.left-10{left:0.625em}.right-10{right:0.625em}.top-15{top:0.9375em}.left-15{left:0.9375em}.right-15{right:0.9375em}.top-20{top:1.25em}.left-20{left:1.25em}.right-20{right:1.25em}.top-25{top:1.5625em}.left-25{left:1.5625em}.right-25{right:1.5625em}.top-30{top:1.875em}.left-30{left:1.875em}.right-30{right:1.875em}.top-35{top:2.1875em}.left-35{left:2.1875em}.right-35{right:2.1875em}.top-40{top:2.5em}.left-40{left:2.5em}.right-40{right:2.5em}.top-45{top:2.8125em}.left-45{left:2.8125em}.right-45{right:2.8125em}.top-50{top:3.125em}.left-50{left:3.125em}.right-50{right:3.125em}.invisible{visibility:hidden !important}.control-panel{border-radius:0 0 0.3125em 0.3125em;position:relative;min-width:100%;display:inline-flex}.control-panel__buttons--left{width:25%;float:left;margin-top:0.3125em;padding:0.3125em}.control-panel__buttons--center{width:25%;text-align:center;margin:0 auto}.control-panel__buttons--right{width:25%;text-align:right;float:right;margin-top:0.3125em;margin-right:0.3125em}.control-panel__buttons__header{margin:0.3125em}.control-panel__control{border-radius:0.3125em;margin:0.5em auto}.control-panel__control:focus{outline:none}.settings{margin-left:0;margin-right:0;text-align:center}.settings__option__header{margin-bottom:0.5em}#waveform{background-size:contain;background-repeat:no-repeat;background-position:center center;width:100%;height:100%;position:absolute;top:0;left:0}.low{z-index:700}.overlay__container{width:100%;max-width:100%;height:3.125em;position:relative;z-index:8000}#overlay__object{z-index:700;max-height:100%;min-width:100%;fill:"transparent"}#overlay__object.theme--light{stroke:gray}#overlay__object.theme--dark{stroke:#a6a6a6}.scroll-guide__container{text-align:center;z-index:700;width:20%;position:fixed;left:50%;transform:translate(-50%, 0)}.scroll-guide__text{font-size:1.25em}.pages__container{overflow:auto;max-height:55vh;height:100%;max-width:100%;width:100%;position:relative;display:-webkit-inline-flex;flex-direction:row;flex-wrap:nowrap;justify-content:space-between;border-radius:0.3125em 0.3125em 0 0}.page{overflow-y:hidden;overflow-x:auto;flex-grow:1;min-width:99.6%;width:100%;max-width:55em}.page__container{display:grid;grid-template-columns:[col-start] [col-end];grid-template-rows:[row-start] 5% [row-end] 95%;grid-template-areas:"image page-no" "image text";justify-items:stretch}.page__counter{grid-area:page-no;margin:0.625em 0 0 0.9375em;text-align:right;padding-right:0.9375em;max-height:5rem}.page__col__image{grid-area:image;float:left;max-height:100%;text-align:center;margin:5%;padding:0;border-radius:0 0 0 0;position:relative}.page__col__image img{height:100%;max-width:95%;object-fit:contain}.page__col__img-placeholder{cursor:pointer}.page__col__text{grid-area:text}.page.two-column-layout-page{grid-template-columns:40% auto}.page.one-column-layout-page{display:grid;grid-template-columns:auto;grid-template-rows:[row-start] 5% [row-end] 95%;grid-template-areas:"page-no" "text";justify-items:stretch}.page.one-column-layout-page .page__col__image{grid-area:text}.hide-page-counter .page__counter{display:none}.pages__container.vertical{flex-direction:column !important}.pages__container.vertical>.page{min-height:100%}.paragraph__container{overflow-y:auto;min-width:40%;padding-bottom:0.75em}.sentence{margin:0 1.5em;text-align:left;max-width:90%}.sentence__container{margin:3.75em 0.625em 3.75em 0.625em;scroll-behavior:smooth;max-width:100%;position:relative;overflow-y:auto;overflow-x:hidden}.sentence__container__buttons{position:absolute;top:0;right:0}.sentence__text{font-size:1.5em;padding:0}.sentence__word{font-size:1.5em}.sentence__translation .sentence__text,.sentence__translation .sentence__word{color:#777;font-style:italic;font-size:95%}.sentence__translation__button{margin-left:10px}.sentence__translation__button i{font-size:medium}.paragraph.visually_aligned .sentence .sentence__text,.paragraph.visually_aligned .sentence .sentence__word{display:table-cell}.paragraph.visually_aligned .sentence .sentence__text:empty{display:none}.paragraph.visually_aligned{display:table}.paragraph.visually_aligned .sentence{display:table-row}.read-along-container{max-width:75em;margin:0 auto;overflow-y:hidden;overflow-x:hidden;padding:0.3125em;position:relative}.read-along-container--fullscreen{max-width:80%;min-width:80%}.slot__header{margin-bottom:0.3125em}.slot__subheader{margin-top:0;margin-left:1em}.loader{border:16px solid #eee;border-radius:50%;border-right-color:#aa0;border-bottom-color:#a33;border-left-color:#111;width:10rem;height:10rem;-webkit-animation:spin 3s linear infinite;animation:spin 3s linear infinite;position:fixed;top:calc(50vh - 10rem);left:calc(50vw - 10rem);z-index:1000;box-shadow:0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19)}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg)}100%{-webkit-transform:rotate(360deg)}}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}.alert{position:relative;padding:1rem 1rem;margin-bottom:1rem;border:1px solid transparent;border-radius:0.25rem;transition-delay:2s;transition:visibility 5s height 5s}.alert.status-success{color:#0f5132;background-color:#d1e7dd;border-color:#badbcc}.alert.status-error{color:#842029;background-color:#f8d7da;border-color:#f5c2c7}.alert.fade{visibility:collapse;height:0 !important;overflow:hidden !important;line-height:0 !important;padding:0 !important;margin:0 !important;border:0 !important}.animate-transition,.ripple,.reading{transition:background 0.4s}.animate-transition:active,.ripple:active,.reading:active{transition:background 0s}.ripple,.reading{background-position:center;padding:0.0625em}.ripple:active,.reading:active{background-size:100%}.progress{position:absolute;top:0;left:0;height:100%;width:0}.progress.theme--light{background-color:rgba(128, 128, 128, 0.2)}.progress.theme--dark{background-color:rgba(166, 166, 166, 0.2)}[contenteditable][data-placeholder]:empty:before{content:attr(data-placeholder);position:absolute;color:gray;cursor:text;background-color:transparent}.drop-area{border:2px dashed #ccc;border-radius:20px;width:50%;font-family:sans-serif;margin:50px auto;padding:20px}.drop-area.highlight{border-color:purple}p{margin-top:0}.my-form{margin-bottom:10px}#gallery{margin-top:10px}#gallery img{width:150px;margin-bottom:10px;margin-right:10px;vertical-align:middle}.button{display:inline-block;padding:10px;background:#ccc;cursor:pointer;border-radius:5px;border:1px solid #ccc}.button:hover{background:#ddd}.fileElem{display:none}#img-remover{margin:60px;position:absolute;z-index:9999;border-radius:50px;color:red}#image-container{display:contents}'},131:(e,t,n)=>{var r={"./read-along.entry.js":[704,179]};function o(e){if(!n.o(r,e))return Promise.resolve().then((()=>{var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}));var t=r[e],o=t[0];return n.e(t[1]).then((()=>n(o)))}o.keys=()=>Object.keys(r),o.id=131,e.exports=o}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,n),i.exports}n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.e=()=>Promise.resolve(),n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{"use strict";var e=n(678);(()=>{const t="file:///Users/pinea/Web-Component/dist/packages/web-component/dist/esm/web-component.js",n={};return n.resourcesUrl=new URL(".",t).href,(0,e.p)(n)})().then((t=>(0,e.b)([["read-along",[[1,"read-along",{href:[1],audio:[1],svgOverlay:[1,"svg-overlay"],theme:[1537],language:[1537],cssUrl:[1,"css-url"],useAssetsFolder:[4,"use-assets-folder"],pageScrolling:[1,"page-scrolling"],mode:[1],scrollBehaviour:[1,"scroll-behaviour"],displayTranslation:[4,"display-translation"],playbackRateRange:[2,"playback-rate-range"],playing:[32],fullscreen:[32],autoScroll:[32],hasLoaded:[32],images:[32],translations:[32],getImages:[64],getTranslations:[64],changeTheme:[64]},[[9,"wheel","wheelHandler"]]]]]],t)))})()})(); \ No newline at end of file +function(){var e;HowlerGlobal.prototype._pos=[0,0,0],HowlerGlobal.prototype._orientation=[0,0,-1,0,1,0],HowlerGlobal.prototype.stereo=function(e){var t=this;if(!t.ctx||!t.ctx.listener)return t;for(var n=t._howls.length-1;n>=0;n--)t._howls[n].stereo(e);return t},HowlerGlobal.prototype.pos=function(e,t,n){var r=this;return r.ctx&&r.ctx.listener?(t="number"!=typeof t?r._pos[1]:t,n="number"!=typeof n?r._pos[2]:n,"number"!=typeof e?r._pos:(r._pos=[e,t,n],void 0!==r.ctx.listener.positionX?(r.ctx.listener.positionX.setTargetAtTime(r._pos[0],Howler.ctx.currentTime,.1),r.ctx.listener.positionY.setTargetAtTime(r._pos[1],Howler.ctx.currentTime,.1),r.ctx.listener.positionZ.setTargetAtTime(r._pos[2],Howler.ctx.currentTime,.1)):r.ctx.listener.setPosition(r._pos[0],r._pos[1],r._pos[2]),r)):r},HowlerGlobal.prototype.orientation=function(e,t,n,r,o,i){var a=this;if(!a.ctx||!a.ctx.listener)return a;var s=a._orientation;return t="number"!=typeof t?s[1]:t,n="number"!=typeof n?s[2]:n,r="number"!=typeof r?s[3]:r,o="number"!=typeof o?s[4]:o,i="number"!=typeof i?s[5]:i,"number"!=typeof e?s:(a._orientation=[e,t,n,r,o,i],void 0!==a.ctx.listener.forwardX?(a.ctx.listener.forwardX.setTargetAtTime(e,Howler.ctx.currentTime,.1),a.ctx.listener.forwardY.setTargetAtTime(t,Howler.ctx.currentTime,.1),a.ctx.listener.forwardZ.setTargetAtTime(n,Howler.ctx.currentTime,.1),a.ctx.listener.upX.setTargetAtTime(r,Howler.ctx.currentTime,.1),a.ctx.listener.upY.setTargetAtTime(o,Howler.ctx.currentTime,.1),a.ctx.listener.upZ.setTargetAtTime(i,Howler.ctx.currentTime,.1)):a.ctx.listener.setOrientation(e,t,n,r,o,i),a)},Howl.prototype.init=(e=Howl.prototype.init,function(t){var n=this;return n._orientation=t.orientation||[1,0,0],n._stereo=t.stereo||null,n._pos=t.pos||null,n._pannerAttr={coneInnerAngle:void 0!==t.coneInnerAngle?t.coneInnerAngle:360,coneOuterAngle:void 0!==t.coneOuterAngle?t.coneOuterAngle:360,coneOuterGain:void 0!==t.coneOuterGain?t.coneOuterGain:0,distanceModel:void 0!==t.distanceModel?t.distanceModel:"inverse",maxDistance:void 0!==t.maxDistance?t.maxDistance:1e4,panningModel:void 0!==t.panningModel?t.panningModel:"HRTF",refDistance:void 0!==t.refDistance?t.refDistance:1,rolloffFactor:void 0!==t.rolloffFactor?t.rolloffFactor:1},n._onstereo=t.onstereo?[{fn:t.onstereo}]:[],n._onpos=t.onpos?[{fn:t.onpos}]:[],n._onorientation=t.onorientation?[{fn:t.onorientation}]:[],e.call(this,t)}),Howl.prototype.stereo=function(e,n){var r=this;if(!r._webAudio)return r;if("loaded"!==r._state)return r._queue.push({event:"stereo",action:function(){r.stereo(e,n)}}),r;var o=void 0===Howler.ctx.createStereoPanner?"spatial":"stereo";if(void 0===n){if("number"!=typeof e)return r._stereo;r._stereo=e,r._pos=[e,0,0]}for(var i=r._getSoundIds(n),a=0;a{throw e}),0)}const h={closed:!0,next(e){},error(e){if(u.useDeprecatedSynchronousErrorHandling)throw e;d(e)},complete(){}},p=Array.isArray||(e=>e&&"number"==typeof e.length);const _=(()=>{function e(e){return Error.call(this),this.message=e?`${e.length} errors occurred during unsubscription:\n${e.map(((e,t)=>`${t+1}) ${e.toString()}`)).join("\n ")}`:"",this.name="UnsubscriptionError",this.errors=e,this}return e.prototype=Object.create(Error.prototype),e})();class g{constructor(e){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,e&&(this._ctorUnsubscribe=!0,this._unsubscribe=e)}unsubscribe(){let e;if(this.closed)return;let{_parentOrParents:t,_ctorUnsubscribe:n,_unsubscribe:r,_subscriptions:o}=this;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,t instanceof g)t.remove(this);else if(null!==t)for(let e=0;ee.concat(t instanceof _?t.errors:t)),[])}g.EMPTY=function(e){return e.closed=!0,e}(new g);const m="function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random();class b extends g{constructor(e,t,n){switch(super(),this.syncErrorValue=null,this.syncErrorThrown=!1,this.syncErrorThrowable=!1,this.isStopped=!1,arguments.length){case 0:this.destination=h;break;case 1:if(!e){this.destination=h;break}if("object"==typeof e){e instanceof b?(this.syncErrorThrowable=e.syncErrorThrowable,this.destination=e,e.add(this)):(this.syncErrorThrowable=!0,this.destination=new y(this,e));break}default:this.syncErrorThrowable=!0,this.destination=new y(this,e,t,n)}}[m](){return this}static create(e,t,n){const r=new b(e,t,n);return r.syncErrorThrowable=!1,r}next(e){this.isStopped||this._next(e)}error(e){this.isStopped||(this.isStopped=!0,this._error(e))}complete(){this.isStopped||(this.isStopped=!0,this._complete())}unsubscribe(){this.closed||(this.isStopped=!0,super.unsubscribe())}_next(e){this.destination.next(e)}_error(e){this.destination.error(e),this.unsubscribe()}_complete(){this.destination.complete(),this.unsubscribe()}_unsubscribeAndRecycle(){const{_parentOrParents:e}=this;return this._parentOrParents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parentOrParents=e,this}}class y extends b{constructor(e,t,n,r){let o;super(),this._parentSubscriber=e;let i=this;l(t)?o=t:t&&(o=t.next,n=t.error,r=t.complete,t!==h&&(i=Object.create(t),l(i.unsubscribe)&&this.add(i.unsubscribe.bind(i)),i.unsubscribe=this.unsubscribe.bind(this))),this._context=i,this._next=o,this._error=n,this._complete=r}next(e){if(!this.isStopped&&this._next){const{_parentSubscriber:t}=this;u.useDeprecatedSynchronousErrorHandling&&t.syncErrorThrowable?this.__tryOrSetError(t,this._next,e)&&this.unsubscribe():this.__tryOrUnsub(this._next,e)}}error(e){if(!this.isStopped){const{_parentSubscriber:t}=this,{useDeprecatedSynchronousErrorHandling:n}=u;if(this._error)n&&t.syncErrorThrowable?(this.__tryOrSetError(t,this._error,e),this.unsubscribe()):(this.__tryOrUnsub(this._error,e),this.unsubscribe());else if(t.syncErrorThrowable)n?(t.syncErrorValue=e,t.syncErrorThrown=!0):d(e),this.unsubscribe();else{if(this.unsubscribe(),n)throw e;d(e)}}}complete(){if(!this.isStopped){const{_parentSubscriber:e}=this;if(this._complete){const t=()=>this._complete.call(this._context);u.useDeprecatedSynchronousErrorHandling&&e.syncErrorThrowable?(this.__tryOrSetError(e,t),this.unsubscribe()):(this.__tryOrUnsub(t),this.unsubscribe())}else this.unsubscribe()}}__tryOrUnsub(e,t){try{e.call(this._context,t)}catch(e){if(this.unsubscribe(),u.useDeprecatedSynchronousErrorHandling)throw e;d(e)}}__tryOrSetError(e,t,n){if(!u.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{t.call(this._context,n)}catch(t){return u.useDeprecatedSynchronousErrorHandling?(e.syncErrorValue=t,e.syncErrorThrown=!0,!0):(d(t),!0)}return!1}_unsubscribe(){const{_parentSubscriber:e}=this;this._context=null,this._parentSubscriber=null,e.unsubscribe()}}const v="function"==typeof Symbol&&Symbol.observable||"@@observable";function w(e){return e}class x{constructor(e){this._isScalar=!1,e&&(this._subscribe=e)}lift(e){const t=new x;return t.source=this,t.operator=e,t}subscribe(e,t,n){const{operator:r}=this,o=function(e,t,n){if(e){if(e instanceof b)return e;if(e[m])return e[m]()}return e||t||n?new b(e,t,n):new b(h)}(e,t,n);if(r?o.add(r.call(o,this.source)):o.add(this.source||u.useDeprecatedSynchronousErrorHandling&&!o.syncErrorThrowable?this._subscribe(o):this._trySubscribe(o)),u.useDeprecatedSynchronousErrorHandling&&o.syncErrorThrowable&&(o.syncErrorThrowable=!1,o.syncErrorThrown))throw o.syncErrorValue;return o}_trySubscribe(e){try{return this._subscribe(e)}catch(t){u.useDeprecatedSynchronousErrorHandling&&(e.syncErrorThrown=!0,e.syncErrorValue=t),!function(e){for(;e;){const{closed:t,destination:n,isStopped:r}=e;if(t||r)return!1;e=n&&n instanceof b?n:null}return!0}(e)?console.warn(t):e.error(t)}}forEach(e,t){return new(t=$(t))(((t,n)=>{let r;r=this.subscribe((t=>{try{e(t)}catch(e){n(e),r&&r.unsubscribe()}}),n,t)}))}_subscribe(e){const{source:t}=this;return t&&t.subscribe(e)}[v](){return this}pipe(...e){return 0===e.length?this:(0===(t=e).length?w:1===t.length?t[0]:function(e){return t.reduce(((e,t)=>t(e)),e)})(this);var t}toPromise(e){return new(e=$(e))(((e,t)=>{let n;this.subscribe((e=>n=e),(e=>t(e)),(()=>e(n)))}))}}function $(e){if(e||(e=Promise),!e)throw new Error("no Promise impl found");return e}x.create=e=>new x(e);class A{constructor(e,t){this.compare=e,this.keySelector=t}call(e,t){return t.subscribe(new T(e,this.compare,this.keySelector))}}class T extends b{constructor(e,t,n){super(e),this.keySelector=n,this.hasKey=!1,"function"==typeof t&&(this.compare=t)}compare(e,t){return e===t}_next(e){let t;try{const{keySelector:n}=this;t=n?n(e):e}catch(e){return this.destination.error(e)}let n=!1;if(this.hasKey)try{const{compare:e}=this;n=e(this.key,t)}catch(e){return this.destination.error(e)}else this.hasKey=!0;n||(this.key=t,this.destination.next(e))}}const S=(()=>{function e(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}return e.prototype=Object.create(Error.prototype),e})();class k extends g{constructor(e,t){super(),this.subject=e,this.subscriber=t,this.closed=!1}unsubscribe(){if(this.closed)return;this.closed=!0;const e=this.subject,t=e.observers;if(this.subject=null,!t||0===t.length||e.isStopped||e.closed)return;const n=t.indexOf(this.subscriber);-1!==n&&t.splice(n,1)}}class E extends b{constructor(e){super(e),this.destination=e}}class I extends x{constructor(){super(),this.observers=[],this.closed=!1,this.isStopped=!1,this.hasError=!1,this.thrownError=null}[m](){return new E(this)}lift(e){const t=new R(this,this);return t.operator=e,t}next(e){if(this.closed)throw new S;if(!this.isStopped){const{observers:t}=this,n=t.length,r=t.slice();for(let t=0;tnew R(e,t);class R extends I{constructor(e,t){super(),this.destination=e,this.source=t}next(e){const{destination:t}=this;t&&t.next&&t.next(e)}error(e){const{destination:t}=this;t&&t.error&&this.destination.error(e)}complete(){const{destination:e}=this;e&&e.complete&&this.destination.complete()}_subscribe(e){const{source:t}=this;return t?this.source.subscribe(e):g.EMPTY}}class O extends I{constructor(e){super(),this._value=e}get value(){return this.getValue()}_subscribe(e){const t=super._subscribe(e);return t&&!t.closed&&e.next(this._value),t}getValue(){if(this.hasError)throw this.thrownError;if(this.closed)throw new S;return this._value}next(e){super.next(this._value=e)}}var P=function(e){var t=this;t.sounds=[],t._sprite=e.sprite,t._reading$=new I,t._tinySprite=Object.keys(e.sprite).map((e=>[t._sprite[e][0],e])),t._tinySprite.pop(),t._percentPlayed=new O("0%"),t.sound=new s.Howl({src:e.src,sprite:e.sprite,rate:e.rate}),requestAnimationFrame(t.step.bind(t))};async function L(e){return new Promise((function(t,n){let r=new XMLHttpRequest;r.open("HEAD",e),r.onload=function(){this.status>=200&&this.status<300?t(!0):t(!1)},r.onerror=function(){t(!1)},r.send()}))}P.prototype={play:function(e){var t=this;t._spriteLeft=t._tinySprite;var n=e;return t.sound.play(n)},pause:function(){return this.sound.pause(),this.sound.id},goBack:function(e,t){var n=this;if(n._spriteLeft=n._tinySprite,n.sound.seek(e)-t>0){e=n.sound.seek(n.sound.seek(e)-t,e);for(var r=n.sound.seek(e),o=0;o=n._spriteLeft[o][0]&&(n._reading$.next(n._spriteLeft[o][1]),n._spriteLeft=n._spriteLeft.slice(o,n._spriteLeft.length))}else{e=n.sound.seek(0,e);n._reading$.next(n._spriteLeft[0][1])}return e},goTo:function(e,t){var n=this;n._spriteLeft=n._tinySprite;e=n.sound.seek(t,e);for(var r=n.sound.seek(e),o=0;o=n._spriteLeft[o][0]&&(n._reading$.next(n._spriteLeft[o][1]),n._spriteLeft=n._spriteLeft.slice(o,n._spriteLeft.length));return e},stop:function(){return this._reading$.next(""),this.sound.stop()},step:function(){for(var e=this,t=0;t0&&1e3*n>=e._spriteLeft[r][0]&&(e._reading$.next(e._spriteLeft[r][1]),e._spriteLeft=e._spriteLeft.slice(r,e._spriteLeft.length));let o=(n/e.sound.duration()*100||0)+"%";e.sounds[t].style.width=o,e.sounds[t].setAttribute("offset",o)}requestAnimationFrame(e.step.bind(e))}};const C=class{constructor(e){(0,r.r)(this,e),this.playback_rate=1,this.showGuide=!1,this.hasTextTranslations=!1,this.assetsStatus={AUDIO:0,RAS:0},this.alignment_failed=!1,this.isScrolling=!1,this.scrollTimer=null,this.Guide=()=>(0,r.h)("button",{class:"scroll-guide__container ripple ui-button theme--"+this.theme,onClick:()=>this.hideGuideAndScroll()},(0,r.h)("span",{class:"scroll-guide__text theme--"+this.theme},this.returnTranslation("re-align",this.language))),this.Overlay=()=>(0,r.h)("object",{onClick:e=>this.goToSeekFromProgress(e),id:"overlay__object",type:"image/svg+xml",data:this.svgOverlay}),this.RemoveImg=e=>(0,r.h)("button",{"data-cy":"delete-button","aria-label":"Delete",title:"Delete image",onClick:()=>this.deleteImage(e.pageIndex),id:"img-remover",class:"ripple theme--"+this.theme+" background--"+this.theme},(0,r.h)("i",{class:"material-icons"},"delete")),this.Img=e=>(0,r.h)("div",{class:"image__container page__col__image theme--"+this.theme},(0,r.h)("img",{alt:"image",class:"image",src:e.imgURL})),this.ImgPlaceHolder=e=>(0,r.h)("div",{class:"image__container page__col__image theme--"+this.theme},(0,r.h)("div",{class:"drop-area"},(0,r.h)("form",{class:"my-form"},(0,r.h)("p",{class:"theme--"+this.theme},this.returnTranslation("upload-image",this.language)),(0,r.h)("input",{type:"file",class:"fileElem",id:"fileElem--"+e.pageID,accept:"image/*",onChange:t=>this.handleFiles(t.target.files[0],e.pageIndex)}),(0,r.h)("label",{class:"button",htmlFor:"fileElem--"+e.pageID},this.returnTranslation("choose-file",this.language))))),this.PageCount=e=>(0,r.h)("div",{class:"page__counter color--"+this.theme},"Page ",(0,r.h)("span",{"data-cy":"page-count__current"},e.currentPage)," / ",(0,r.h)("span",{"data-cy":"page-count__total"},e.pgCount)),this.ImgContainer=e=>(0,r.h)("div",{class:"image__container"},(0,r.h)("span",{id:"image-container"},"EDIT"===this.mode&&e.pageIndex in this.images&&null!==this.images[e.pageIndex]?(0,r.h)(this.RemoveImg,{pageIndex:e.pageIndex}):null,e.pageIndex in this.images&&null!==this.images[e.pageIndex]?(0,r.h)(this.Img,{imgURL:this.images[e.pageIndex]}):null),"EDIT"!==this.mode||e.pageIndex in this.images&&null!==this.images[e.pageIndex]?null:(0,r.h)(this.ImgPlaceHolder,{pageID:e.pageID,pageIndex:e.pageIndex})),this.Page=e=>(0,r.h)("div",{class:"page page__container page--multi animate-transition theme--"+this.theme+" "+(e.pageData.attributes.class?e.pageData.attributes.class.value:""),id:e.pageData.id},this.parsed_text.length>1?(0,r.h)(this.PageCount,{pgCount:this.parsed_text.length,currentPage:this.parsed_text.indexOf(e.pageData)+1}):null,(0,r.h)(this.ImgContainer,{pageID:e.pageData.id,pageIndex:this.parsed_text.indexOf(e.pageData)}),(0,r.h)("div",{class:"page__col__text paragraph__container theme--"+this.theme},e.pageData.paragraphs.map((e=>(0,r.h)(this.Paragraph,{sentences:Array.from(e.childNodes),attributes:e.attributes}))))),this.Paragraph=e=>(0,r.h)("div",{class:"paragraph sentence__container theme--"+this.theme+" "+(e.attributes.class?e.attributes.class.value:"")},e.sentences.map((e=>e.childNodes.length>0&&(0,r.h)(this.Sentence,{sentenceData:e})))),this.Sentence=e=>{let t=Array.from(e.sentenceData.childNodes),n=e.sentenceData.id;!this.hasTextTranslations&&e.sentenceData.hasAttribute("class")&&(this.hasTextTranslations=/translation/.test(e.sentenceData.getAttribute("class")));let o={};return e.sentenceData.hasAttribute("xml:lang")&&(o.lang=e.sentenceData.getAttribute("xml:lang")),e.sentenceData.hasAttribute("lang")&&(o.lang=e.sentenceData.getAttribute("lang")),(0,r.h)("div",Object.assign({},o,{class:"sentence "+(e.sentenceData.hasAttribute("class")?e.sentenceData.getAttribute("class"):"")}),t.map(((t,n)=>{if("#text"===t.nodeName)return(0,r.h)(this.NonWordText,{text:t.textContent,attributes:t.attributes,id:(e.sentenceData.hasAttribute("id")?e.sentenceData.getAttribute("id"):"P")+"text"+n});if("w"===t.nodeName)return(0,r.h)(this.Word,{text:t.textContent,id:t.id,attributes:t.attributes});if(t){let o={};return t.hasAttribute("xml:lang")&&(o.lang=e.sentenceData.getAttribute("xml:lang")),t.hasAttribute("lang")&&(o.lang=e.sentenceData.getAttribute("lang")),(0,r.h)("span",Object.assign({},o,{class:"sentence__text theme--"+this.theme+" "+t.className,id:t.id?t.id:"text_"+n}),t.textContent)}})),(()=>"EDIT"!==this.mode||/translation/.test(e.sentenceData.getAttribute("class"))?null:n in this.translations&&n in this.translations&&null!==this.translations[n]?(0,r.h)("span",{class:"sentence__translation"},(0,r.h)("button",{title:"Remove translation","aria-label":"Remove translation","data-cy":"remove-translation-button",onClick:()=>this.removeLine(e.sentenceData),class:"sentence__translation__button remove"},(0,r.h)("i",{class:"material-icons"},"remove")),(0,r.h)("p",{id:n+"translation","data-cy":"translation-line",class:"sentence__text editable__translation",onInput:e=>{this.updateTranslation(n,e.currentTarget.innerText)},contentEditable:!0,onKeyDown:e=>{"Enter"==e.key&&e.preventDefault()},"data-placeholder":this.returnTranslation("line-placeholder",this.language)})):(0,r.h)("button",{title:this.returnTranslation("add-translation",this.language),"aria-label":"Add translation","data-cy":"add-translation-button",class:"sentence__translation sentence__translation__button",onClick:()=>this.addLine(e.sentenceData)},(0,r.h)("i",{class:"material-icons"},"add")))())},this.NonWordText=e=>{let t={};return e.attributes&&e.attributes["xml:lang"]&&(t.lang=e.attributes["xml:lang"].value),e.attributes&&e.attributes.lang&&(t.lang=e.attributes.lang.value),(0,r.h)("span",Object.assign({},t,{class:"sentence__text theme--"+this.theme,id:e.id}),e.text)},this.Word=e=>{let t={};return e.attributes&&e.attributes["xml:lang"]&&(t.lang=e.attributes["xml:lang"].value),e.attributes&&e.attributes.lang&&(t.lang=e.attributes.lang.value),(0,r.h)("span",Object.assign({},t,{class:"sentence__word theme--"+this.theme+" "+(e&&e.attributes.class?e.attributes.class.value:""),id:e.id,onClick:e=>this.playSprite(e)}),e.text)},this.PlayControl=()=>(0,r.h)("button",{"data-cy":"play-button",disabled:this.hasLoaded<2,"aria-label":"Play",title:this.returnTranslation("play-tooltip",this.language),onClick:()=>{this.playing?this.pause():this.play()},class:"control-panel__control ripple theme--"+this.theme+" background--"+this.theme},(0,r.h)("i",{class:"material-icons"},this.playing?"pause":"play_arrow")),this.ReplayControl=()=>(0,r.h)("button",{"data-cy":"replay-button",disabled:this.hasLoaded<2,"aria-label":"Rewind",title:this.returnTranslation("rewind-tooltip",this.language),onClick:()=>this.goBack(5),class:"control-panel__control ripple theme--"+this.theme+" background--"+this.theme},(0,r.h)("i",{class:"material-icons"},"replay_5")),this.StopControl=()=>(0,r.h)("button",{"data-cy":"stop-button",disabled:this.hasLoaded<2,"aria-label":"Stop",title:this.returnTranslation("stop-tooltip",this.language),onClick:()=>this.stop(),class:"control-panel__control ripple theme--"+this.theme+" background--"+this.theme},(0,r.h)("i",{class:"material-icons"},"stop")),this.PlaybackSpeedControl=()=>(0,r.h)("div",null,(0,r.h)("h5",{class:"control-panel__buttons__header color--"+this.theme},this.returnTranslation("speed",this.language)),(0,r.h)("input",{type:"range",min:100-this.playbackRateRange,max:100+this.playbackRateRange,value:100*this.playback_rate,class:"slider control-panel__control",id:"myRange",onInput:e=>{console.log("v",e),this.changePlayback(e)}})),this.StyleControl=()=>(0,r.h)("button",{"aria-label":"Change theme",onClick:()=>this.changeTheme(),title:this.returnTranslation("theme-tooltip",this.language),class:"control-panel__control ripple theme--"+this.theme+" background--"+this.theme},(0,r.h)("i",{class:"material-icons-outlined"},"style")),this.FullScreenControl=()=>(0,r.h)("button",{"aria-label":"Full screen mode",onClick:()=>this.toggleFullscreen(),title:this.returnTranslation("full-screen-tooltip",this.language),class:"control-panel__control ripple theme--"+this.theme+" background--"+this.theme},(0,r.h)("i",{class:"material-icons","aria-label":"Full screen mode"},this.fullscreen?"fullscreen_exit":"fullscreen")),this.TextTranslationDisplayControl=()=>(0,r.h)("button",{"data-cy":"translation-toggle","aria-label":"Toggle Translation",title:this.returnTranslation("translation-tooltip",this.language),onClick:()=>this.toggleTextTranslation(),class:"control-panel__control ripple theme--"+this.theme+" background--"+this.theme},(0,r.h)("i",{class:"material-icons-outlined"},"subtitles")),this.ErrorMessage=e=>(0,r.h)("p",{"data-cy":e.data_cy,class:"alert status-error"},(0,r.h)("span",{class:"material-icons"},"error_outline_outlined")," ",e.msg),this.ControlPanel=()=>(0,r.h)("div",{"data-cy":"control-panel",class:"control-panel theme--"+this.theme+" background--"+this.theme},(0,r.h)("div",{class:"control-panel__buttons--left"},(0,r.h)(this.PlayControl,null),(0,r.h)(this.ReplayControl,null),(0,r.h)(this.StopControl,null)),(0,r.h)("div",{class:"control-panel__buttons--center"},(0,r.h)(this.PlaybackSpeedControl,null)),(0,r.h)("div",{class:"control-panel__buttons--right"},this.hasTextTranslations&&(0,r.h)(this.TextTranslationDisplayControl,null),(0,r.h)(this.StyleControl,null),(0,r.h)(this.FullScreenControl,null))),this.href=void 0,this.audio=void 0,this.svgOverlay=void 0,this.theme="light",this.language="eng",this.cssUrl=void 0,this.useAssetsFolder=!0,this.pageScrolling="horizontal",this.mode="VIEW",this.scrollBehaviour="smooth",this.displayTranslation=!0,this.playbackRateRange=15,this.playing=!1,this.fullscreen=!1,this.autoScroll=!0,this.hasLoaded=0,this.images=void 0,this.translations=void 0}handleScrollEvent(){this.isScrolling=!0,this.scrollTimer&&clearTimeout(this.scrollTimer),this.scrollTimer=setTimeout((()=>{this.isScrolling=!1}),125)}wheelHandler(e){if(this.el.shadowRoot.querySelector(".reading")&&(e.path[0].classList.contains("sentence__word")||e.path[0].classList.contains("sentence__container")||e.path[0].classList.contains("sentence"))&&this.autoScroll){let e=this.el.shadowRoot.querySelector(".reading");e&&(this.autoScroll=!this.inPageContentOverflow(e),this.showGuide=!this.autoScroll)}}urlTransform(e){return this.useAssetsFolder&&function(e){return!/^(https?:[/][/]|assets[/]|data:)/.test(e)}(e)&&!e.startsWith("blob")?"assets/"+e:e}buildSprite(e,t){return new P({src:[e],sprite:t,rate:this.playback_rate})}tagToQuery(e){return"#"+(e=(e=e.replace(".","\\.")).replace("#","\\#"))}returnWordClosestTo(e){let t=Object.keys(this.processed_alignment);t.pop();for(let n=1;nthis.processed_alignment[t[n]][0]&&this.processed_alignment[t[n+1]]&&1e3*ethis.autoScroll=!0),100)}goTo(e){void 0===this.play_id&&(this.play(),this.pause()),this.autoScroll=!1,e/=1e3,this.audio_howl_sprites.goTo(this.play_id,e),setTimeout((()=>this.autoScroll=!0),100)}goToSeekAtEl(e){let t=e.currentTarget.id,n=this.processed_alignment[t][0];return this.goTo(n),t}goToSeekFromProgress(e){let t=e.currentTarget.getBoundingClientRect(),n=t.left,r=t.width,o=(e.pageX-n)/r*this.duration*1e3;this.goTo(o)}pause(){this.playing=!1,this.audio_howl_sprites.pause()}play(){this.playing=!0,void 0!==this.play_id?this.play_id=this.audio_howl_sprites.play(this.play_id):this.play_id=this.audio_howl_sprites.play("all"),this.animateProgress()}playSprite(e){let t=this.goToSeekAtEl(e);this.playing||this.audio_howl_sprites.play(t)}stop(){this.playing=!1,this.audio_howl_sprites.stop(),this.el.shadowRoot.querySelectorAll(".reading").forEach((e=>e.classList.remove("reading"))),this.autoScroll||(this.autoScroll=!0,this.showGuide=!1)}toggleTextTranslation(){this.el.shadowRoot.querySelectorAll(".translation").forEach((e=>e.classList.toggle("invisible"))),this.el.shadowRoot.querySelectorAll(".sentence__translation").forEach((e=>e.classList.toggle("invisible")))}addHighlightingTo(e){this.el.shadowRoot.querySelectorAll(".reading").forEach((e=>e.classList.remove("reading"))),e.classList.add("reading")}animateProgressWithOverlay(){let e=this.el.shadowRoot.querySelector("#overlay__object"),t=e.contentDocument.querySelector("#progress-fill"),n=e.contentDocument.querySelector("#progress-trail"),r=e.contentDocument.querySelector("#progress-base");t.classList.add("stop-color--"+this.theme),r.classList.add("stop-color--"+this.theme),this.audio_howl_sprites.sounds.push(t),this.audio_howl_sprites.sounds.push(n),this.audio_howl_sprites.sound.once("end",(()=>{this.audio_howl_sprites.sounds.forEach((e=>{e.setAttribute("offset","0%")})),this.el.shadowRoot.querySelectorAll(".reading").forEach((e=>e.classList.remove("reading"))),this.playing=!1}),this.play_id)}animateProgressDefault(e,t){let n=document.createElement("div");n.className="progress theme--"+this.theme,n.id=e.toString(),n.dataset.sprite=t;let r=this.tagToQuery(t);this.el.shadowRoot.querySelector(r).appendChild(n),this.audio_howl_sprites.sounds.push(n),this.audio_howl_sprites.sound.once("end",(()=>{this.el.shadowRoot.querySelectorAll(".reading").forEach((e=>e.classList.remove("reading"))),this.playing=!1}),this.play_id)}animateProgress(e=this.play_id){this.svgOverlay?this.animateProgressWithOverlay():this.animateProgressDefault(e,"all")}changeFill(){let e=this.el.shadowRoot.querySelector(".sentence__word"),t=window.getComputedStyle(e).color,n=this.el.shadowRoot.querySelector("#overlay__object"),r=n.contentDocument.querySelector("#progress-fill"),o=n.contentDocument.querySelector("#progress-base");n.contentDocument.querySelector("#polygon").setAttribute("stroke",t),o.setAttribute("stop-color",t),r.setAttribute("stop-color",t)}async getImages(){return this.images}async getTranslations(){return this.translations}async changeTheme(){"light"===this.theme?this.theme="dark":this.theme="light"}static _getSentenceContainerOfWord(e){return e.parentElement.parentElement.parentElement}toggleFullscreen(){if(this.fullscreen){let e=this.el.ownerDocument;e.exitFullscreen?e.exitFullscreen():e.mozCancelFullScreen?e.mozCancelFullScreen():e.webkitExitFullscreen?e.webkitExitFullscreen():e.msExitFullscreen&&e.msExitFullscreen(),this.el.shadowRoot.getElementById("read-along-container").classList.remove("read-along-container--fullscreen")}else{let e=this.el.shadowRoot.getElementById("read-along-container");e.requestFullscreen?e.requestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.webkitRequestFullscreen?e.webkitRequestFullscreen():e.msRequestFullscreen&&e.msRequestFullscreen(),this.el.shadowRoot.getElementById("read-along-container").classList.add("read-along-container--fullscreen")}this.fullscreen=!this.fullscreen}hideGuideAndScroll(){let e=this.el.shadowRoot.querySelector(".reading"),t=new IntersectionObserver((n=>{let[r]=n;r.isIntersecting&&(setTimeout((()=>{this.showGuide=!1,this.autoScroll=!0}),100),t.unobserve(e))}));t.observe(e),this.scrollTo(e)}inParagraphContentOverflow(e){let t=C._getSentenceContainerOfWord(e).getBoundingClientRect(),n=e.getBoundingClientRect(),r=n.rightt.right,i=new IntersectionObserver((t=>{let[n]=t;n.isIntersecting&&(setTimeout((()=>{this.showGuide=!1,this.autoScroll=!0}),100),i.unobserve(e))}));return i.observe(e),r||o}inPageContentOverflow(e){let t=this.el.shadowRoot.querySelector("#"+this.current_page).getBoundingClientRect(),n=e.getBoundingClientRect(),r=n.top+n.height>t.top+t.height,o=n.top+n.height<0,i=new IntersectionObserver((t=>{let[n]=t;n.isIntersecting&&(setTimeout((()=>{this.showGuide=!1,this.autoScroll=!0}),100),i.unobserve(e))}));return i.observe(e),o||r}inPage(e){let t=C._getSentenceContainerOfWord(e).getBoundingClientRect(),n=e.getBoundingClientRect(),r=n.top+n.height>t.top+t.height,o=n.top+n.height<0,i=new IntersectionObserver((t=>{let[n]=t;n.isIntersecting&&(setTimeout((()=>{this.showGuide=!1,this.autoScroll=!0}),100),i.unobserve(e))}));return i.observe(e),o||r}scrollToPage(e){let t=this.el.shadowRoot.querySelector(".pages__container"),n=this.el.shadowRoot.querySelector("#"+e);t.scrollBy({top:null!=this.pageScrolling.match("vertical")?n.offsetTop-t.scrollTop:0,left:null!=this.pageScrolling.match("vertical")?0:n.offsetLeft-t.scrollLeft,behavior:this.scrollBehaviour}),n.scrollTo(0,0)}scrollByHeight(e){let t=C._getSentenceContainerOfWord(e),n=e.parentElement.getBoundingClientRect(),r=new IntersectionObserver((o=>{let[i]=o;i.isIntersecting?r.unobserve(e):t.scrollTo({top:t.getBoundingClientRect().height-n.height,left:0,behavior:this.scrollBehaviour})}),{root:t,threshold:[0,.25,.5,.75,1]});r.observe(e)}scrollByWidth(e){let t=C._getSentenceContainerOfWord(e),n=e.getBoundingClientRect();t.scrollTo({left:n.left-10,top:0,behavior:this.scrollBehaviour})}scrollTo(e){e.scrollIntoView({behavior:this.scrollBehaviour})}disconnectedCallback(){this.stop()}componentDidUpdate(){this.svgOverlay&&this.changeFill()}async componentWillLoad(){if(this.language.length<3&&(null!=this.language.match("fr")?this.language="fra":null!==this.language.match("es")?this.language="spa":this.language="eng"),"smooth"!==this.scrollBehaviour&&"auto"!==this.scrollBehaviour&&(console.log("Invalid scroll-behaviour value, using default (smooth)"),this.scrollBehaviour="smooth"),(isNaN(this.playbackRateRange)||this.playbackRateRange<0||this.playbackRateRange>99)&&(console.log("Invalid playback-rate-range value, using default (15)."),this.playbackRateRange=15),this.parsed_text=await async function(e){let t=await fetch(e);if(!t.ok)return console.log(`fetch(${e}) failed with status ${t.status}`),null;let n=await t.text(),r=(new DOMParser).parseFromString(n,"text/xml");return Array.from(r.querySelectorAll("div[type=page]")).map((e=>{let t=e.querySelector("graphic[url]"),n=e.querySelectorAll("p"),r={id:e.getAttribute("id"),paragraphs:Array.from(n)};return null!==t&&(r.img=t.getAttribute("url")),e.attributes&&(r.attributes=e.attributes),r}))}(this.href),null===this.parsed_text)this.parsed_text=[],this.assetsStatus.RAS=3;else if(0===this.parsed_text.length)this.assetsStatus.RAS=2;else{this.images={},this.translations={};for(const[t,n]of this.parsed_text.entries())if("img"in n){var e=this.urlTransform(n.img);if(this.images[t]=this.urlTransform(n.img),/^(https?:[/]|assets)[/]\b/.test(e)){await L(e)||(this.images[t]=null)}}else this.images[t]=null;this.assetsStatus.RAS=1}this.hasLoaded+=1}componentDidLoad(){this.processed_alignment=function(e){let t={};for(const n of e)for(const e of n.paragraphs)for(const n of Array.from(e.querySelectorAll("w[time][dur]"))){const e=n.getAttribute("time"),r=n.getAttribute("dur");null!==e&&null!==r&&(t[n.getAttribute("id")]=[Math.round(1e3*parseFloat(e)),Math.round(1e3*parseFloat(r))])}return t}(this.parsed_text),this.alignment_failed=0==Object.keys(this.processed_alignment).length,this.audio_howl_sprites=new s.Howl({src:[this.audio],preload:!1}),this.audio_howl_sprites.once("load",(()=>{var e,t;this.processed_alignment.all=[0,1e3*this.audio_howl_sprites.duration()],this.duration=this.audio_howl_sprites.duration(),this.audio_howl_sprites=this.buildSprite(this.audio,this.processed_alignment),this.reading$=this.audio_howl_sprites._reading$.pipe((n=>n.lift(new A(e,t)))).subscribe((e=>{if(this.playing){let t=this.tagToQuery(e),n=this.el.shadowRoot.querySelector(t);this.el.shadowRoot.querySelectorAll(".reading").forEach((e=>e.classList.remove("reading"))),n.classList.add("reading");let r=C._getSentenceContainerOfWord(n).parentElement.id;r!==this.current_page&&(void 0===this.current_page||this.isScrolling||this.scrollToPage(r),this.current_page=r);const o=Math.ceil(this.el.shadowRoot.querySelector(".pages__container").getBoundingClientRect().left)+1,i=Math.ceil(this.el.shadowRoot.querySelector("#"+this.current_page).getBoundingClientRect().left);(n.getBoundingClientRect().left<0||i!==o)&&(this.isScrolling||this.scrollToPage(r)),this.inPageContentOverflow(n)&&this.autoScroll&&(n.scrollIntoView(!1),this.isScrolling||this.scrollByHeight(n)),this.inParagraphContentOverflow(n)&&this.autoScroll&&(n.scrollIntoView(!1),this.isScrolling||this.scrollByWidth(n))}})),this.hasLoaded+=1,this.assetsStatus.AUDIO=1})),this.audio_howl_sprites.once("loaderror",(()=>{this.hasLoaded+=1,this.assetsStatus.AUDIO=3})),this.audio_howl_sprites.load()}componentDidRender(){if(!this.displayTranslation&&this.parsed_text&&this.parsed_text.length>0&&(this.toggleTextTranslation(),this.displayTranslation=!0),this.latestTranslation){this.el.shadowRoot.querySelector(this.latestTranslation).focus(),this.latestTranslation=""}}returnTranslation(e,t,n,r){void 0===t&&(t=this.language);let o={speed:{eng:"Playback Speed",fra:"Vitesse de Lecture",spa:"Velocidad de reproducción"},"re-align":{eng:"Re-align with audio",fra:"Réaligner avec l'audio",spa:"Re-alinear con audio"},"loading-error":{eng:"Error: the "+r+" file '"+n+"' could not be loaded.",fra:"Erreur: le fichier "+r+" '"+n+"' n'a pas pu être chargé.",spa:"Error: el fichero "+r+" '"+n+"' no se pudo cargar."},"parse-error":{eng:"Error: the "+r+" file '"+n+"' could not be parsed.",fra:"Erreur: le fichier "+r+" '"+n+"' n'a pas pu être analysé.",spa:"Error: el fichero "+r+" '"+n+"' no se pudo analizar."},"alignment-error":{eng:"Error: No alignments were found.",fra:"Erreur: aucun alignement n'a été trouvé.",spa:"Error: No se encontró ningún alineamiento."},loading:{eng:"Loading...",fra:"Chargement en cours",spa:"Cargando..."},"line-placeholder":{eng:"Type your text here",fra:"Écrivez votre texte ici",spa:"Escriba su texto aquí"},"upload-image":{eng:"Upload an image for this page",fra:"Télécharger une image pour cette page",spa:"Cargue una imagen para esta página"},"choose-file":{eng:"Choose a file",fra:"Choisir un fichier",spa:"Seleccione un fichero"},"play-tooltip":{eng:"Play audio recording",fra:"Écouter l'enregistrement",spa:"Déle play a su grabación de audio"},"rewind-tooltip":{eng:"Rewind audio recording",fra:"Relire dès le début",spa:"Rebobine (rewind) su grabación de audio"},"stop-tooltip":{eng:"Stop audio recording",fra:"Arrêter la lecture",spa:"Pare la grabación"},"theme-tooltip":{eng:"Change theme",fra:"Changer de thême visuel",spa:"Cambie la paleta de colores"},"full-screen-tooltip":{eng:"Full screen mode",fra:"Mode plein écran",spa:"Modo pantalla completa"},"translation-tooltip":{eng:"Toggle translations",fra:"Afficher ou cacher les traductions",spa:"Active o desactive las traducciones"},"add-translation":{eng:"Add a translation, transliteration or gloss",fra:"Ajouter une traduction",spa:"Agregue una traducción"}};return o[e]&&o[e][t]?o[e][t]:e}addLine(e){this.hasTextTranslations||(this.hasTextTranslations=!0);let t={};t[e.id]="",this.translations=Object.assign(Object.assign({},this.translations),t),this.latestTranslation="#"+e.id+"translation"}removeLine(e){let t={};t[e.id]=null,this.translations=Object.assign(Object.assign({},this.translations),t)}updateTranslation(e,t){this.translations[e]=t}async handleFiles(e,t){let n=URL.createObjectURL(e),r={};r[t]=n,this.images=Object.assign(Object.assign({},this.images),r)}deleteImage(e){let t={};t[e]=null,this.images=Object.assign(Object.assign({},this.images),t)}render(){return(0,r.h)("div",{id:"read-along-container",class:"read-along-container"},(0,r.h)("h1",{class:"slot__header"},(0,r.h)("slot",{name:"read-along-header"})),(0,r.h)("h3",{class:"slot__subheader"},(0,r.h)("slot",{name:"read-along-subheader"})),Object.entries(this.assetsStatus).map((e=>{let t=e[0],n=e[1];if(2===n){let e=this.getPathFromAssetType(t);return(0,r.h)(this.ErrorMessage,{msg:this.returnTranslation("parse-error",this.language,e,t),data_cy:t+"-error"})}if(3===n){let e=this.getPathFromAssetType(t);return(0,r.h)(this.ErrorMessage,{msg:this.returnTranslation("loading-error",this.language,e,t),data_cy:t+"-error"})}})),this.alignment_failed&&1===this.assetsStatus.RAS&&(0,r.h)(this.ErrorMessage,{msg:this.returnTranslation("alignment-error",this.language),data_cy:"alignment-error"}),(0,r.h)("div",{onScroll:()=>{this.handleScrollEvent()},"data-cy":"text-container",class:"pages__container theme--"+this.theme+" "+this.pageScrolling},this.showGuide?(0,r.h)(this.Guide,null):null,1==this.assetsStatus.RAS&&this.parsed_text.map((e=>(0,r.h)(this.Page,{pageData:e}))),this.hasLoaded<2&&(0,r.h)("div",{class:"loader"})),this.alignment_failed||(0,r.h)("div",{onClick:e=>this.goToSeekFromProgress(e),id:"all","data-cy":"progress-bar",class:"overlay__container theme--"+this.theme+" background--"+this.theme},this.svgOverlay?(0,r.h)(this.Overlay,null):null),1==this.assetsStatus.AUDIO&&(0,r.h)(this.ControlPanel,null),this.cssUrl&&null!=this.cssUrl.match(".css")&&(0,r.h)("link",{href:this.cssUrl,rel:"stylesheet"}))}get el(){return(0,r.g)(this)}};C.style='@font-face{font-family:"Karla";font-style:normal;font-weight:400;src:local("Karla"), local("Karla-Regular"),\n url("assets/fonts/qkBbXvYC6trAT7RbLtyU5rZPoAU.woff2") format("woff2");unicode-range:U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB,\n U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF}@font-face{font-family:"Karla";font-style:normal;font-weight:400;src:local("Karla"), local("Karla-Regular"),\n url("assets/fonts/qkBbXvYC6trAT7RVLtyU5rZP.woff2") format("woff2");unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,\n U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215,\n U+FEFF, U+FFFD}@font-face{font-family:"Lato";font-style:normal;font-weight:400;src:local("Lato Regular"), local("Lato-Regular"),\n url("assets/fonts/S6uyw4BMUTPHjxAwXiWtFCfQ7A.woff2") format("woff2");unicode-range:U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB,\n U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF}@font-face{font-family:"Lato";font-style:normal;font-weight:400;src:local("Lato Regular"), local("Lato-Regular"),\n url("assets/fonts/S6uyw4BMUTPHjx4wXiWtFCc.woff2") format("woff2");unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,\n U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215,\n U+FEFF, U+FFFD}@font-face{font-family:"Material Icons";font-style:normal;font-weight:400;src:url("assets/fonts/flUhRq6tzZclQEJ-Vdg-IuiaDsNcIhQ8tQ.woff2")\n format("woff2")}@font-face{font-family:"Material Icons Outlined";font-style:normal;font-weight:400;src:url("assets/fonts/gok-H7zzDkdnRel8-DQ6KAXJ69wP1tGnf4ZGhUcel5euIg.woff2")\n format("woff2")}.material-icons{font-family:"Material Icons";font-weight:normal;font-style:normal;font-size:24px;line-height:1;letter-spacing:normal;text-transform:none;display:inline-block;white-space:nowrap;word-wrap:normal;direction:ltr;-webkit-font-feature-settings:"liga";-webkit-font-smoothing:antialiased}.material-icons-outlined{font-family:"Material Icons Outlined";font-weight:normal;font-style:normal;font-size:24px;line-height:1;letter-spacing:normal;text-transform:none;display:inline-block;white-space:nowrap;word-wrap:normal;direction:ltr;-webkit-font-feature-settings:"liga";-webkit-font-smoothing:antialiased}.font-weight--100{font-weight:100}.font-weight--200{font-weight:200}.font-weight--300{font-weight:300}.font-weight--400{font-weight:400}.font-weight--500{font-weight:500}.font-weight--600{font-weight:600}.font-weight--700{font-weight:700}.font-weight--800{font-weight:800}.font-weight--900{font-weight:900}.shadowed{text-shadow:0.3px 0.2px black}.theme--light.sentence,.theme--light.page__col__image,.theme--light.page__container,.theme--light.scroll-guide__container{background-color:#fff}.theme--dark.sentence,.theme--dark.page__col__image,.theme--dark.page__container,.theme--dark.scroll-guide__container{background-color:#3c4369}.sentence__word,.sentence__text,.scroll-guide__text{line-height:1.5;border-radius:0.3125em;position:relative;padding:0.0625em;font-size:1em}.theme--light.ripple,.theme--light.reading,.theme--light.sentence__word,.theme--light.sentence__text,.theme--light.scroll-guide__text{color:#040508}.theme--dark.ripple,.theme--dark.reading,.theme--dark.sentence__word,.theme--dark.sentence__text,.theme--dark.scroll-guide__text{color:#fff}.theme--light.ripple:active,.theme--light.reading:active,.theme--light.sentence__word:hover{color:#fff;background:gray radial-gradient(circle, transparent 1%, gray 1%) center/15000%}.theme--dark.ripple:active,.theme--dark.reading:active,.theme--dark.sentence__word:hover{color:#fff;background:#a6a6a6 radial-gradient(circle, transparent 1%, #a6a6a6 1%) center/15000%}.theme--light.sentence__word.reading{color:#fff;background:#666666 radial-gradient(circle, transparent 1%, #666666 1%) center/15000%}.theme--dark.sentence__word.reading{color:#040508;background:#fff radial-gradient(circle, transparent 1%, #fff 1%) center/15000%}.theme--light.page__col__img-placeholder{border:0.046875em dotted gray}.theme--dark.page__col__img-placeholder{border:0.046875em dotted #a6a6a6}.theme--light.scroll-guide__container,.theme--light.overlay__container{border:0.046875em solid gray}.theme--dark.scroll-guide__container,.theme--dark.overlay__container{border:0.046875em solid #a6a6a6}.theme--light.page--multi,.theme--light.pages__container,.theme--light.control-panel{border-left:0.046875em solid gray}.theme--dark.page--multi,.theme--dark.pages__container,.theme--dark.control-panel{border-left:0.046875em solid #a6a6a6}.theme--light.page--multi,.theme--light.pages__container,.theme--light.control-panel{border-right:0.046875em solid gray}.theme--dark.page--multi,.theme--dark.pages__container,.theme--dark.control-panel{border-right:0.046875em solid #a6a6a6}.theme--light.pages__container{border-top:0.046875em solid gray}.theme--dark.pages__container{border-top:0.046875em solid #a6a6a6}.theme--light.control-panel{border-bottom:0.046875em solid gray}.theme--dark.control-panel{border-bottom:0.046875em solid #a6a6a6}.ripple:hover,.reading:hover,.sentence__word:hover{cursor:pointer}@viewport{width:device-width}button{border:0;cursor:pointer}html{background-color:#fff;box-sizing:border-box;height:100%}*:before,*:after{box-sizing:inherit}body{-webkit-font-smoothing:antialiased;color:#040508;font-family:"Lato", sans-serif;min-height:100%;overflow-x:hidden;overflow-y:hidden;text-rendering:optimizeLegibility}a{background:transparent;color:#c69;text-decoration:none;transition:color 0.2s;outline:none}a:active,a:focus{outline:none}img{height:90%;max-width:90%;object-fit:cover}h1,h2,h3,h4,h5,h6{font-family:"Karla", sans-serif;font-weight:normal}p,mat-chip,mat-tab-label,span,button,a{font-family:"Lato", sans-serif}.theme--light::-webkit-scrollbar{width:0.5em;height:0.5em}.theme--light::-webkit-scrollbar-track{background:#fff}.theme--light::-webkit-scrollbar-thumb{background:#040508;border-radius:0.3125em;height:0.625em;width:0.625em}.theme--dark::-webkit-scrollbar{width:0.5em;height:0.5em}.theme--dark::-webkit-scrollbar-track{background:#3c4369}.theme--dark::-webkit-scrollbar-thumb{background:#fff;border-radius:0.3125em;height:0.625em;width:0.625em}.bg-img{background-image:url("../assets/img/bg.jpg");height:100vh;overflow:overlay;overflow-x:hidden;background-position:center;background-repeat:no-repeat;background-size:cover;min-height:100%}.shadow-box{box-shadow:0 0.3125rem 1rem 0 rgba(0, 0, 0, 0.24);padding:25px;background:rgba(255, 255, 255, 0.94);border-radius:5px}.font-xs{font-size:0.5em}.font-sm{font-size:0.75em}.font-md{font-size:1em}.font-lg{font-size:1.25em}.font-xl{font-size:1.5em}.font-xxl{font-size:2em}.faded{opacity:0.2;color:black}table{table-layout:fixed}.center{margin-left:auto;margin-right:auto;text-align:center}.container{max-width:80em}.background--light{background:#fff}.stop-color--light{fill:#fff}.color--light{color:#040508}.background--dark{background:#3c4369}.stop-color--dark{fill:#3c4369}.color--dark{color:#fff}.abs{position:absolute}.top-0{top:0}.left-0{left:0}.right-0{right:0}.top-5{top:0.3125em}.left-5{left:0.3125em}.right-5{right:0.3125em}.top-10{top:0.625em}.left-10{left:0.625em}.right-10{right:0.625em}.top-15{top:0.9375em}.left-15{left:0.9375em}.right-15{right:0.9375em}.top-20{top:1.25em}.left-20{left:1.25em}.right-20{right:1.25em}.top-25{top:1.5625em}.left-25{left:1.5625em}.right-25{right:1.5625em}.top-30{top:1.875em}.left-30{left:1.875em}.right-30{right:1.875em}.top-35{top:2.1875em}.left-35{left:2.1875em}.right-35{right:2.1875em}.top-40{top:2.5em}.left-40{left:2.5em}.right-40{right:2.5em}.top-45{top:2.8125em}.left-45{left:2.8125em}.right-45{right:2.8125em}.top-50{top:3.125em}.left-50{left:3.125em}.right-50{right:3.125em}.invisible{visibility:hidden !important}.control-panel{border-radius:0 0 0.3125em 0.3125em;position:relative;min-width:100%;display:inline-flex}.control-panel__buttons--left{width:25%;float:left;margin-top:0.3125em;padding:0.3125em}.control-panel__buttons--center{width:25%;text-align:center;margin:0 auto}.control-panel__buttons--right{width:25%;text-align:right;float:right;margin-top:0.3125em;margin-right:0.3125em}.control-panel__buttons__header{margin:0.3125em}.control-panel__control{border-radius:0.3125em;margin:0.5em auto}.control-panel__control:focus{outline:none}.settings{margin-left:0;margin-right:0;text-align:center}.settings__option__header{margin-bottom:0.5em}#waveform{background-size:contain;background-repeat:no-repeat;background-position:center center;width:100%;height:100%;position:absolute;top:0;left:0}.low{z-index:700}.overlay__container{width:100%;max-width:100%;height:3.125em;position:relative;z-index:8000}#overlay__object{z-index:700;max-height:100%;min-width:100%;fill:"transparent"}#overlay__object.theme--light{stroke:gray}#overlay__object.theme--dark{stroke:#a6a6a6}.scroll-guide__container{text-align:center;z-index:700;width:20%;position:fixed;left:50%;transform:translate(-50%, 0)}.scroll-guide__text{font-size:1.25em}.pages__container{overflow:auto;max-height:55vh;height:100%;max-width:100%;width:100%;position:relative;display:-webkit-inline-flex;flex-direction:row;flex-wrap:nowrap;justify-content:space-between;border-radius:0.3125em 0.3125em 0 0}.page{overflow-y:hidden;overflow-x:auto;flex-grow:1;min-width:99.6%;width:100%;max-width:55em}.page__container{display:grid;grid-template-columns:[col-start] [col-end];grid-template-rows:[row-start] 5% [row-end] 95%;grid-template-areas:"image page-no" "image text";justify-items:stretch}.page__counter{grid-area:page-no;margin:0.625em 0 0 0.9375em;text-align:right;padding-right:0.9375em;max-height:5rem}.page__col__image{grid-area:image;float:left;max-height:100%;text-align:center;margin:5%;padding:0;border-radius:0 0 0 0;position:relative}.page__col__image img{height:100%;max-width:95%;object-fit:contain}.page__col__img-placeholder{cursor:pointer}.page__col__text{grid-area:text}.page.two-column-layout-page{grid-template-columns:40% auto}.page.one-column-layout-page{display:grid;grid-template-columns:auto;grid-template-rows:[row-start] 5% [row-end] 95%;grid-template-areas:"page-no" "text";justify-items:stretch}.page.one-column-layout-page .page__col__image{grid-area:text}.hide-page-counter .page__counter{display:none}.pages__container.vertical{flex-direction:column !important}.pages__container.vertical>.page{min-height:100%}.paragraph__container{overflow-y:auto;min-width:40%;padding-bottom:0.75em}.sentence{margin:0 1.5em;text-align:left;max-width:90%}.sentence__container{margin:3.75em 0.625em 3.75em 0.625em;scroll-behavior:smooth;max-width:100%;position:relative;overflow-y:auto;overflow-x:hidden}.sentence__container__buttons{position:absolute;top:0;right:0}.sentence__text{font-size:1.5em;padding:0}.sentence__word{font-size:1.5em}.sentence__translation .sentence__text,.sentence__translation .sentence__word{color:#777;font-style:italic;font-size:95%}.sentence__translation__button{margin-left:10px}.sentence__translation__button i{font-size:medium}.paragraph.visually_aligned .sentence .sentence__text,.paragraph.visually_aligned .sentence .sentence__word{display:table-cell}.paragraph.visually_aligned .sentence .sentence__text:empty{display:none}.paragraph.visually_aligned{display:table}.paragraph.visually_aligned .sentence{display:table-row}.read-along-container{max-width:75em;margin:0 auto;overflow-y:hidden;overflow-x:hidden;padding:0.3125em;position:relative}.read-along-container--fullscreen{max-width:80%;min-width:80%}.slot__header{margin-bottom:0.3125em}.slot__subheader{margin-top:0;margin-left:1em}.loader{border:16px solid #eee;border-radius:50%;border-right-color:#aa0;border-bottom-color:#a33;border-left-color:#111;width:10rem;height:10rem;-webkit-animation:spin 3s linear infinite;animation:spin 3s linear infinite;position:fixed;top:calc(50vh - 10rem);left:calc(50vw - 10rem);z-index:1000;box-shadow:0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19)}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg)}100%{-webkit-transform:rotate(360deg)}}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}.alert{position:relative;padding:1rem 1rem;margin-bottom:1rem;border:1px solid transparent;border-radius:0.25rem;transition-delay:2s;transition:visibility 5s height 5s}.alert.status-success{color:#0f5132;background-color:#d1e7dd;border-color:#badbcc}.alert.status-error{color:#842029;background-color:#f8d7da;border-color:#f5c2c7}.alert.fade{visibility:collapse;height:0 !important;overflow:hidden !important;line-height:0 !important;padding:0 !important;margin:0 !important;border:0 !important}.animate-transition,.ripple,.reading{transition:background 0.4s}.animate-transition:active,.ripple:active,.reading:active{transition:background 0s}.ripple,.reading{background-position:center;padding:0.0625em}.ripple:active,.reading:active{background-size:100%}.progress{position:absolute;top:0;left:0;height:100%;width:0}.progress.theme--light{background-color:rgba(128, 128, 128, 0.2)}.progress.theme--dark{background-color:rgba(166, 166, 166, 0.2)}[contenteditable][data-placeholder]:empty:before{content:attr(data-placeholder);position:absolute;color:gray;cursor:text;background-color:transparent}.drop-area{border:2px dashed #ccc;border-radius:20px;width:50%;font-family:sans-serif;margin:50px auto;padding:20px}.drop-area.highlight{border-color:purple}p{margin-top:0}.my-form{margin-bottom:10px}#gallery{margin-top:10px}#gallery img{width:150px;margin-bottom:10px;margin-right:10px;vertical-align:middle}.button{display:inline-block;padding:10px;background:#ccc;cursor:pointer;border-radius:5px;border:1px solid #ccc}.button:hover{background:#ddd}.fileElem{display:none}#img-remover{margin:60px;position:absolute;z-index:9999;border-radius:50px;color:red}#image-container{display:contents}'},131:(e,t,n)=>{var r={"./read-along.entry.js":[704,179]};function o(e){if(!n.o(r,e))return Promise.resolve().then((()=>{var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}));var t=r[e],o=t[0];return n.e(t[1]).then((()=>n(o)))}o.keys=()=>Object.keys(r),o.id=131,e.exports=o}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,n),i.exports}n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.e=()=>Promise.resolve(),n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{"use strict";var e=n(678);(()=>{const t="file:///Users/pinea/Web-Component/dist/packages/web-component/dist/esm/web-component.js",n={};return n.resourcesUrl=new URL(".",t).href,(0,e.p)(n)})().then((t=>(0,e.b)([["read-along",[[1,"read-along",{href:[1],audio:[1],svgOverlay:[1,"svg-overlay"],theme:[1537],language:[1537],cssUrl:[1,"css-url"],useAssetsFolder:[4,"use-assets-folder"],pageScrolling:[1,"page-scrolling"],mode:[1],scrollBehaviour:[1,"scroll-behaviour"],displayTranslation:[4,"display-translation"],playbackRateRange:[2,"playback-rate-range"],playing:[32],fullscreen:[32],autoScroll:[32],hasLoaded:[32],images:[32],translations:[32],getImages:[64],getTranslations:[64],changeTheme:[64]},[[9,"wheel","wheelHandler"]]]]]],t)))})()})(); \ No newline at end of file diff --git a/packages/studio-web/src/i18n/messages.es.json b/packages/studio-web/src/i18n/messages.es.json new file mode 100644 index 00000000..7cc83f46 --- /dev/null +++ b/packages/studio-web/src/i18n/messages.es.json @@ -0,0 +1,143 @@ +{ + "locale": "es", + "translations": { + "2148054857885504777": " ¡Felicidades! ¡Aquí está su ReadAlong! ", + "8259766897258591399": "Formato de salida", + "5701618810648052610": "Título", + "1137319519199859335": "Subtítulo", + "5625881490589550893": "HTML offline", + "6780789831209474999": "Fichero Elan", + "7162646471173438471": "Textgrid de Praat", + "5409086795075780408": "Subtítulos (formato SRT)", + "6874638171510323302": "Subtítulos (formato WebVTT)", + "8762728484338173358": "La conversión del formato ReadAlong falló.", + "6017683769837067192": "Ah, no logramos conectarnos en este momentos a la API de ReadAlong. Inténtelo otra vez más tarde.", + "6766123079913371250": "Error de alineamiento", + "1614347125196988603": " No se pudo iniciar el alineador. Esto puede por incompatibilidad con su buscador de Internet. Por favor {$START_LINK}{$START_TAG_MAT_ICON}mail{$CLOSE_TAG_MAT_ICON} contacte a los programadores{$CLOSE_LINK} y envíe una copia completa del mensaje de error aquí debajo: ", + "8263673404941155539": "Error de servidor", + "4441973805993808330": " No se pudo acceder a la lista de idiomas en el servidor. Por favor {$START_LINK}{$START_TAG_MAT_ICON}mail{$CLOSE_TAG_MAT_ICON} contacte a los programadores{$CLOSE_LINK} y refresque la página una vez que se corrija el error. ", + "7504412437394032605": " ¡Uy! ¡Parece que está extraviado! No se supone que usted vea esta página. Por favor regrese a la página de inicio haciendo click aquí debajo. ", + "8793650218766282421": " ¡Lléveme al Inicio!", + "6818717224121299397": "Ah, el fichero no se puede acceder. Intente otra vez más tarde.", + "6731392928829867425": "Bienvenidos al Studio de ReadAlong", + "1309246714146466494": "¡Crear un ReadAlong es fácil! Esta guía le mostrará todas las funcionalidades del Studio.", + "3885497195825665706": "Próximo", + "1242877753139152692": "Añadir sus datos", + "2521339316382884905": "Para crear su ReadAlong, necesitará añadir su texto y su audio.", + "8890553633144307762": "Atrás", + "3439208209256809340": "Escriba su texto", + "6934589696014916904": "Puede escribir su texto directamente en el Studio de ReadAlong si selecciona la opción \"escribir\".", + "2135357114421532777": "Use un fichero de texto", + "8203636039276427127": "Puede usar también un fichero de texto (.txt) o un fichero en el formato RAS (.readalong).", + "8270964800848142984": "Grabe su propio audio", + "4200696836052759670": "Puede grabar su propio audio para que sea preprocesado si utiliza el micrófono en su buscador.", + "8619732226743260161": "Usar un fichero de audio", + "8374880530284796780": "También puede seleccionar un fichero .wav o .mp3 para su ReadAlong.", + "5481197392701906162": "Seleccione su idioma", + "1653005571499433141": "Para seguir, seleccione el idioma de su ReadAlong. El Studio ya está localizado para 30 idiomas diferentes pero si su idioma no está incluido aquí, trate de utilizar la opción No-determinado (und). Si eso no funcionara, existe la posibilidad de añadir su idioma a la lista de idiomas existente. Esto necesita que usted entienda bien el sistema de escritura u ortografía utilizada para su idioma. Nos puede escribir o visitar los posts en nuestro blog para mayor información.", + "6462395282000827572": "¡Eso es todo!", + "6491013634569415627": "Una vez que haya hecho esto, puede hacer click en el botón \"próximo paso\" aquí para que el Studio cree su ReadAlong. (Esto puede llevar varios segundos.)", + "8307846086620775727": "¡Listo!", + "5383048139152066599": "Su ReadAlong has sido creado.", + "481803948251279240": "Vea su ReadAlong", + "8760815604043544159": "Hacer click en \"play\" hace pasar el audio y resalta el texto al mismo tiempo. ¡Inténtelo!", + "6136458453037527406": "Darle click a una palabra también pasará el audio correspondiente.", + "268120138992910140": "Edite su ReadAlong", + "2372754282380446808": "Puede editar el texto aquí para añadir un Título o un Subtítulo a su ReadAlong.", + "463112944111781294": "Puede añadir una imagen a cada página de su ReadAlong aquí.", + "8141623860318291592": "Usted puede añadir una traducción o alguna información adicional para cada oración en su ReadAlong si le da click al ícono + aquí. Si más tarde quiere borrar la traducción, utilice el ícono - una vez que haya añadido la traducción.", + "6557490460418686205": "Exporte su ReadAlong", + "9028584152057075057": "Cuando esté satisfecho con su ReadAlong, puede exportarlo si selecciona un formato de descarga y le da click al botón de descarga (con la flecha apuntando hacia abajo). Puede seleccionar uno de los siguientes formatos: ", + "2010852928670878114": "HTML offline: su ReadAlong en un documento HTML único que no necesita acceso a la web para funcionar", + "1034483059001175624": "Ficheros de Elan y Praat: formatos de exportado utilizados por lingüistas documentales", + "4531999879654619327": "Subtítulos SRT y WebVTT: formatos de exportado utilizados para añadir subtítulos a un video", + "8906261852850345843": "Edite los inputs de su ReadAlong", + "121261747461955932": "Si quiere cambiar su audio o su texto puede regresar al Paso 1 y hacer cambios ahí o crear un nuevo ReadAlong. ", + "668489750030842261": "Pero tenga cuidado, regresar al paso anterior quiere decir que perderá sus traducciones y sus imágenes.", + "3430021493872613524": "Advertencia: Utilizar la fecha de atrás del buscador hace que usted salga de la app y puede que también borre todo su texto y su audio así que se debe evitar usar este botón. ", + "5849788734463744687": "En su lugar, use el botón \"Paso 1\" para regresar y cambiar su texto o audio.", + "65984904390749158": "Terminar", + "8439955599488894226": "Política de privacidad", + "9145384756401372637": " Hemos creado esta herramienta con el objetivo fundamental de respetar su privacidad y la soberanía de sus datos. El audio que usted usar en este sitio {$START_BOLD_TEXT}no es cargado a ninguna otra parte{$CLOSE_BOLD_TEXT}. Se queda en su computadora. El texto que usted use para este ReadAlong se cargará a un servidor mediante una conexión encriptada para pre-procesarlo. Su texto no se guarda en el servidor ni se usará para otros propósitos. Hacer uso de este sitio significa que usted está de acuerdo con que sus datos (audio + texto) se utilicen de la manera aquí indicada.", + "3354727320770003649": " Casi todos los sitios web que usted visita recogen información y datos sobre usted utilizando herramientas de Web Analytics (análisis web) lo que conlleva a ciertas preocupaciones sobre privacidad. Nosotros hemos optado por utilizar {$START_LINK}Plausible Analytics{$CLOSE_LINK}, lo que acarrea un costo para nosotros pero al mismo tiempo garantiza que la información recopilada en su visita al sitio no sea vendida y respeta su privacidad. Nuestro equipo utiliza esta información para determinar cuántas personas acceden al sitio, qué tipo de equipo utilizan para acceder y otros indicadores que utilizamos para mejorar el sitio. Para ver una lista completa de la información que recogemos, por favor ver {$START_LINK_1}Plausible's data policy{$CLOSE_LINK}. Para un ejemplo de los datos que vemos en un lenguaje menos técnico, puede visitar este {$START_LINK_2}sitio de prueba{$CLOSE_LINK}. En cualquier caso, usted puede optar por no brindar ninguna información al sitio si hace click en el botón \"No aceptar\" aquí debajo (siempre tiene la posibilidad de cambiar esta opción luego si usted lo desea).", + "8754999798797911202": " Aceptar Analytics ", + "5348316094035024059": " No aceptar Analytics ", + "479660647798030606": " Estoy de acuerdo ", + "8428348909593474745": "Paso 1", + "7458890725604973091": "Bienvenido al Studio de ReadAlong", + "3614618598824071164": " Esta es una herramienta diseñada para ayudarlo a crear su propio 'readalong' que resalta las palabras a medida que se pronuncian. Puede ver {$START_LINK}{$START_TAG_MAT_ICON}launch{$CLOSE_TAG_MAT_ICON} este ejemplo en el idioma cree oriental{$CLOSE_LINK} para tener una mejor idea de qué es un 'readalong'. ", + "11480612528390167": "Para empezar a crear su propio 'readalong', lea nuestra {$START_LINK}política de privacidad y soberanía de los datos{$CLOSE_LINK} y luego siga el tour del sitio haciendo click en el botón \"Siga el tour\" y siguiendo los pasos descritos aquí debajo. ", + "8366946611697584032": " ¡Siga el tour! ", + "3943314737845757694": "Paso 2", + "1021386634200142621": "Studio de ReadAlong para Narraciones Interactivas", + "5448899278320615037": "Cree sus propias historias interactivas que resaltan las palabras a medida que se pronuncian y que se pueden ver offline.", + "4019963252146086342": "ReadAlong interactivo que resalta el texto a medida que se pronuncia", + "4939253261247981581": " Usted ya empezó su ReadAlong así que si hace click en siguiente borra ese trabajo y continúa el tour con los datos de prueba. Cancele el tour si no quiere seguir.", + "7286649672478429351": "(borra sus datos)", + "2050258905855699260": " He aquí como formatear su texto sin formato (plain text). ", + "7402655112347006322": " Cada línea debe incluir una sola oración, aunque esto no es una regla estricta. ", + "1565438668041183426": " Los saltos de párrafo se indican insertando con una línea en blanco. ", + "6597490123856497618": " Los saltos de página se indican insertando dos líneas en blanco consecutivas. ", + "4832056586737439470": "Ejemplo: ", + "6487299681734040440": "Esta es la oración 1 en el párrafo 1 en la página 1.\nEsta es la oración 2 en el párrafo 1 en la página 1.\n\nEsta es la oración 1 en el párrafo 2 en la página 1.\nEsta es la oración 2 en el párrafo 2 en la página 1.\n\n\nEsta es la oración 1 en el párrafo 1 en la página 2.", + "5547981558491672240": " Cerrar ", + "8835207011849408799": " Seleccione los datos para empezar a crear su ReadAlong ", + "5649094541771811015": "Para crear un ReadAlong, se necesitan 3 cosas diferentes. Necesitamos saber {$START_BOLD_TEXT}en qué idioma{$CLOSE_BOLD_TEXT} está su \n'readalong' y necesitamos un {$START_BOLD_TEXT}texto{$CLOSE_BOLD_TEXT} y el {$START_BOLD_TEXT}audio correspondiente{$CLOSE_BOLD_TEXT}. ", + "6162693758764653365": "Texto", + "2603482535677312633": "Escriba", + "8455204924704616723": "Fichero", + "323794992596449638": "Seleccione un fichero de texto sin formato (.txt) o un fichero temporal del Studio de ReadAlong (.readalong)", + "6329500169661407619": " Escriba o pegue su texto aquí ", + "887019029800317757": "{$START_TAG_MAT_ICON}help_outline{$CLOSE_TAG_MAT_ICON} Formato ", + "4289685560479120097": "{$START_TAG_MAT_ICON}save{$CLOSE_TAG_MAT_ICON} Guarde una copia ", + "7534891070879763001": "Ej. Hola, me llamo...", + "347407180135731058": "Audio", + "6150173052210897773": "Grabe", + "5893500762826563625": " Seleccione un fichero de audio ", + "7124627482150867570": "Use el audio pre-grabado de un fichero MP3 o WAV", + "5613657256708794361": " Grabe su voz aquí ", + "1040741403296498484": "Borre y grabe otra vez", + "6543643564103016190": "Grabando", + "8066570559817495723": "{$START_TAG_MAT_ICON}stop_circle{$CLOSE_TAG_MAT_ICON} Pare ", + "6710230498600005462": "{$START_TAG_MAT_ICON}play_circle{$CLOSE_TAG_MAT_ICON} Play ", + "5050307465636924350": "{$START_TAG_MAT_ICON}delete{$CLOSE_TAG_MAT_ICON} Borrar ", + "3662704049012244015": " Seleccione el idioma de su texto y su audio ", + "4946040406121957395": " Si su idioma no está incluido en la lista aquí debajo, puede intentar con la opción \"No determinado\" (und). Si eso no funcionara bien, vea esta {$START_LINK}{$START_TAG_MAT_ICON}launch{$CLOSE_TAG_MAT_ICON} serie de posts en nuestro blog{$CLOSE_LINK} para entender cómo puede obtener ayuda para su idioma o {$START_LINK_1}{$START_TAG_MAT_ICON}mail{$CLOSE_TAG_MAT_ICON} contáctenos{$CLOSE_LINK} para mayor información. ", + "7797047079884673368": "Usted puede utilizar el menú desplegable aquí debajo para seleccionar un mapeamiento pre-configurado para su idioma.", + "487077452159084336": "Seleccione el Idioma", + "5423524275918558339": "No determinado - (und)", + "939318510937943024": " ¡Ir al paso siguiente!", + "9193890791359394027": "El procesamiento del texto falló.", + "8804844169128591194": "Por favor escuche su audio para asegurarse de que sea claro y que se corresponda al texto.", + "544933231530929418": "El alineamiento falló.", + "4812680719296626428": "Puede ser que su texto contenga caracteres impronunciables o números. Por favor verifique que todas las palabras están escritas en letras, por ejemplo escriba \"cuarenta y dos\" en vez de \"42\".", + "6071928720301938306": "El procesamiento del audio falló.", + "3763839702998678686": "No hay audio para descargar.", + "3790351978262872462": "¡Perdón!", + "6558433540988178003": "No hay texto para descargar.", + "4183225119057268962": "¡No se pudo empezar la grabación!", + "2596823344081631983": "El audio se grabó con éxito. Por favor escuche su grabación para asegurarse de que está correcta y si lo está, guárdela para reusarla luego.", + "1317075918959775059": "¡Hurra!", + "3585637900550692820": "No pudimos grabar nada, ¿su micrófono está bloqueado o desconectado? Si el problema persiste, por favor inténtelo con un auricular u otro micrófono.", + "779265781994803872": "¡El audio no se grabó!", + "1983793909601149790": "Por favor inténtelo de nuevo o seleccione un fichero pre-grabado.", + "3533349926767927338": "Por favor entre el texto que quiere alinear.", + "7881212750036563398": "Sin texto", + "3578398528078428417": "Por favor seleccione un fichero de texto.", + "4603453641249002294": "Perdón, el modelo de alineamiento no ha sido cargado. Por favor espere un rato e inténtelo de nuevo si está usando una conexión lenta. Si el problema persiste, contáctenos.", + "3861272198542491849": "No se ha cargado el modelo", + "7614709406289221963": "Posible problema con el procesamiento del texto.", + "7051563249389544165": "Por favor seleccione un idioma.", + "5845021075215482602": "Ningún idioma seleccionado", + "7528020111424948593": "Por favor grabe (o vuelva a grabar) el audio o seleccione un fichero de audio.", + "7997459583873215257": "No hay audio", + "5640828320811588897": "Por favor seleccione o escriba el texto, seleccione o grabe el audio y seleccione el idioma.", + "7065107025201081158": "Plantilla incompleta", + "7719309746449095739": "Fichero ", + "1326685349515945581": " procesado pero no cargado. Su audio se mantendrá en su computadora.", + "6899344040225872362": "¡Genial!", + "7895338145504956239": "Fichero demasiado grande. Tamaño máximo: ", + "5997429059663319535": " KB", + "2722548994886578004": " procesado. El texto se cargará mediante una conexión encriptada cuando pase al próximo paso." + } +} diff --git a/packages/web-component/src/components/read-along-component/read-along.tsx b/packages/web-component/src/components/read-along-component/read-along.tsx index 40304d20..a0b3905b 100644 --- a/packages/web-component/src/components/read-along-component/read-along.tsx +++ b/packages/web-component/src/components/read-along-component/read-along.tsx @@ -821,6 +821,8 @@ export class ReadAlongComponent { if (this.language.length < 3) { if (this.language.match("fr") != null) { this.language = "fra"; + } else if (this.language.match("es") !== null) { + this.language = "spa"; } else { this.language = "eng"; } @@ -1019,10 +1021,12 @@ export class ReadAlongComponent { speed: { eng: "Playback Speed", fra: "Vitesse de Lecture", + spa: "Velocidad de reproducción", }, "re-align": { eng: "Re-align with audio", fra: "Réaligner avec l'audio", + spa: "Re-alinear con audio", }, "loading-error": { eng: @@ -1037,6 +1041,12 @@ export class ReadAlongComponent { " '" + path + "' n'a pas pu être chargé.", + spa: + "Error: el fichero " + + assetType + + " '" + + path + + "' no se pudo cargar.", }, "parse-error": { eng: @@ -1051,50 +1061,72 @@ export class ReadAlongComponent { " '" + path + "' n'a pas pu être analysé.", + spa: + "Error: el fichero " + + assetType + + " '" + + path + + "' no se pudo analizar.", }, "alignment-error": { eng: "Error: No alignments were found.", fra: "Erreur: aucun alignement n'a été trouvé.", + spa: "Error: No se encontró ningún alineamiento.", }, loading: { eng: "Loading...", fra: "Chargement en cours", + spa: "Cargando...", }, "line-placeholder": { eng: "Type your text here", fra: "Écrivez votre texte ici", + spa: "Escriba su texto aquí", }, "upload-image": { eng: "Upload an image for this page", fra: "Télécharger une image pour cette page", + spa: "Cargue una imagen para esta página", }, "choose-file": { eng: "Choose a file", fra: "Choisir un fichier", + spa: "Seleccione un fichero", }, "play-tooltip": { eng: "Play audio recording", fra: "Écouter l'enregistrement", + spa: "Déle play a su grabación de audio", }, "rewind-tooltip": { eng: "Rewind audio recording", fra: "Relire dès le début", + spa: "Rebobine (rewind) su grabación de audio", }, "stop-tooltip": { eng: "Stop audio recording", fra: "Arrêter la lecture", + spa: "Pare la grabación", }, "theme-tooltip": { eng: "Change theme", fra: "Changer de thême visuel", + spa: "Cambie la paleta de colores", }, "full-screen-tooltip": { eng: "Full screen mode", fra: "Mode plein écran", + spa: "Modo pantalla completa", }, "translation-tooltip": { eng: "Toggle translations", fra: "Afficher ou cacher les traductions", + spa: "Active o desactive las traducciones", + }, + "add-translation": { + eng: "Add a translation, transliteration or gloss", + fra: "Ajouter une traduction", + spa: "Agregue una traducción", }, }; if (translations[word] && translations[word][lang]) @@ -1480,7 +1512,10 @@ export class ReadAlongComponent { } else { return ( ); @@ -1247,7 +1133,7 @@ export class ReadAlongComponent {

- {this.returnTranslation("upload-image", this.language)} + {this.getI18nString("upload-image")}

@@ -1276,7 +1162,8 @@ export class ReadAlongComponent { */ PageCount = (props: { pgCount: number; currentPage: number }): Element => (
- Page {props.currentPage} + {this.getI18nString("page")}{" "} + {props.currentPage} {" / "} {props.pgCount}
@@ -1507,20 +1394,14 @@ export class ReadAlongComponent { onKeyDown={(event) => { if (event.key == "Enter") event.preventDefault(); }} - data-placeholder={this.returnTranslation( - "line-placeholder", - this.language - )} + data-placeholder={this.getI18nString("line-placeholder")} >

); } else { return (