narraleaf-react 0.0.1-beta.5 → 0.0.1-beta.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/main.js ADDED
@@ -0,0 +1,31 @@
1
+ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react")):"function"==typeof define&&define.amd?define(["react"],e):"object"==typeof exports?exports.NarraleafReact=e(require("react")):t.NarraleafReact=e(t.React)}(this,(t=>(()=>{var e={587:(t,e,n)=>{"use strict";n.d(e,{A:()=>s});var r=n(601),o=n.n(r),i=n(314),a=n.n(i)()(o());a.push([t.id,"/*\n! tailwindcss v3.4.11 | MIT License | https://tailwindcss.com\n*//*\n1. Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4)\n2. Allow adding a border to an element by just adding a border-width. (https://github.com/tailwindcss/tailwindcss/pull/116)\n*/\n\n*,\n::before,\n::after {\n box-sizing: border-box; /* 1 */\n border-width: 0; /* 2 */\n border-style: solid; /* 2 */\n border-color: #e5e7eb; /* 2 */\n}\n\n::before,\n::after {\n --tw-content: '';\n}\n\n/*\n1. Use a consistent sensible line-height in all browsers.\n2. Prevent adjustments of font size after orientation changes in iOS.\n3. Use a more readable tab size.\n4. Use the user's configured `sans` font-family by default.\n5. Use the user's configured `sans` font-feature-settings by default.\n6. Use the user's configured `sans` font-variation-settings by default.\n7. Disable tap highlights on iOS\n*/\n\nhtml,\n:host {\n line-height: 1.5; /* 1 */\n -webkit-text-size-adjust: 100%; /* 2 */\n -moz-tab-size: 4; /* 3 */\n -o-tab-size: 4;\n tab-size: 4; /* 3 */\n font-family: ui-sans-serif, system-ui, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Noto Color Emoji\"; /* 4 */\n font-feature-settings: normal; /* 5 */\n font-variation-settings: normal; /* 6 */\n -webkit-tap-highlight-color: transparent; /* 7 */\n}\n\n/*\n1. Remove the margin in all browsers.\n2. Inherit line-height from `html` so users can set them as a class directly on the `html` element.\n*/\n\nbody {\n margin: 0; /* 1 */\n line-height: inherit; /* 2 */\n}\n\n/*\n1. Add the correct height in Firefox.\n2. Correct the inheritance of border color in Firefox. (https://bugzilla.mozilla.org/show_bug.cgi?id=190655)\n3. Ensure horizontal rules are visible by default.\n*/\n\nhr {\n height: 0; /* 1 */\n color: inherit; /* 2 */\n border-top-width: 1px; /* 3 */\n}\n\n/*\nAdd the correct text decoration in Chrome, Edge, and Safari.\n*/\n\nabbr:where([title]) {\n -webkit-text-decoration: underline dotted;\n text-decoration: underline dotted;\n}\n\n/*\nRemove the default font size and weight for headings.\n*/\n\nh1,\nh2,\nh3,\nh4,\nh5,\nh6 {\n font-size: inherit;\n font-weight: inherit;\n}\n\n/*\nReset links to optimize for opt-in styling instead of opt-out.\n*/\n\na {\n color: inherit;\n text-decoration: inherit;\n}\n\n/*\nAdd the correct font weight in Edge and Safari.\n*/\n\nb,\nstrong {\n font-weight: bolder;\n}\n\n/*\n1. Use the user's configured `mono` font-family by default.\n2. Use the user's configured `mono` font-feature-settings by default.\n3. Use the user's configured `mono` font-variation-settings by default.\n4. Correct the odd `em` font sizing in all browsers.\n*/\n\ncode,\nkbd,\nsamp,\npre {\n font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, \"Liberation Mono\", \"Courier New\", monospace; /* 1 */\n font-feature-settings: normal; /* 2 */\n font-variation-settings: normal; /* 3 */\n font-size: 1em; /* 4 */\n}\n\n/*\nAdd the correct font size in all browsers.\n*/\n\nsmall {\n font-size: 80%;\n}\n\n/*\nPrevent `sub` and `sup` elements from affecting the line height in all browsers.\n*/\n\nsub,\nsup {\n font-size: 75%;\n line-height: 0;\n position: relative;\n vertical-align: baseline;\n}\n\nsub {\n bottom: -0.25em;\n}\n\nsup {\n top: -0.5em;\n}\n\n/*\n1. Remove text indentation from table contents in Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=999088, https://bugs.webkit.org/show_bug.cgi?id=201297)\n2. Correct table border color inheritance in all Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=935729, https://bugs.webkit.org/show_bug.cgi?id=195016)\n3. Remove gaps between table borders by default.\n*/\n\ntable {\n text-indent: 0; /* 1 */\n border-color: inherit; /* 2 */\n border-collapse: collapse; /* 3 */\n}\n\n/*\n1. Change the font styles in all browsers.\n2. Remove the margin in Firefox and Safari.\n3. Remove default padding in all browsers.\n*/\n\nbutton,\ninput,\noptgroup,\nselect,\ntextarea {\n font-family: inherit; /* 1 */\n font-feature-settings: inherit; /* 1 */\n font-variation-settings: inherit; /* 1 */\n font-size: 100%; /* 1 */\n font-weight: inherit; /* 1 */\n line-height: inherit; /* 1 */\n letter-spacing: inherit; /* 1 */\n color: inherit; /* 1 */\n margin: 0; /* 2 */\n padding: 0; /* 3 */\n}\n\n/*\nRemove the inheritance of text transform in Edge and Firefox.\n*/\n\nbutton,\nselect {\n text-transform: none;\n}\n\n/*\n1. Correct the inability to style clickable types in iOS and Safari.\n2. Remove default button styles.\n*/\n\nbutton,\ninput:where([type='button']),\ninput:where([type='reset']),\ninput:where([type='submit']) {\n -webkit-appearance: button; /* 1 */\n background-color: transparent; /* 2 */\n background-image: none; /* 2 */\n}\n\n/*\nUse the modern Firefox focus style for all focusable elements.\n*/\n\n:-moz-focusring {\n outline: auto;\n}\n\n/*\nRemove the additional `:invalid` styles in Firefox. (https://github.com/mozilla/gecko-dev/blob/2f9eacd9d3d995c937b4251a5557d95d494c9be1/layout/style/res/forms.css#L728-L737)\n*/\n\n:-moz-ui-invalid {\n box-shadow: none;\n}\n\n/*\nAdd the correct vertical alignment in Chrome and Firefox.\n*/\n\nprogress {\n vertical-align: baseline;\n}\n\n/*\nCorrect the cursor style of increment and decrement buttons in Safari.\n*/\n\n::-webkit-inner-spin-button,\n::-webkit-outer-spin-button {\n height: auto;\n}\n\n/*\n1. Correct the odd appearance in Chrome and Safari.\n2. Correct the outline style in Safari.\n*/\n\n[type='search'] {\n -webkit-appearance: textfield; /* 1 */\n outline-offset: -2px; /* 2 */\n}\n\n/*\nRemove the inner padding in Chrome and Safari on macOS.\n*/\n\n::-webkit-search-decoration {\n -webkit-appearance: none;\n}\n\n/*\n1. Correct the inability to style clickable types in iOS and Safari.\n2. Change font properties to `inherit` in Safari.\n*/\n\n::-webkit-file-upload-button {\n -webkit-appearance: button; /* 1 */\n font: inherit; /* 2 */\n}\n\n/*\nAdd the correct display in Chrome and Safari.\n*/\n\nsummary {\n display: list-item;\n}\n\n/*\nRemoves the default spacing and border for appropriate elements.\n*/\n\nblockquote,\ndl,\ndd,\nh1,\nh2,\nh3,\nh4,\nh5,\nh6,\nhr,\nfigure,\np,\npre {\n margin: 0;\n}\n\nfieldset {\n margin: 0;\n padding: 0;\n}\n\nlegend {\n padding: 0;\n}\n\nol,\nul,\nmenu {\n list-style: none;\n margin: 0;\n padding: 0;\n}\n\n/*\nReset default styling for dialogs.\n*/\ndialog {\n padding: 0;\n}\n\n/*\nPrevent resizing textareas horizontally by default.\n*/\n\ntextarea {\n resize: vertical;\n}\n\n/*\n1. Reset the default placeholder opacity in Firefox. (https://github.com/tailwindlabs/tailwindcss/issues/3300)\n2. Set the default placeholder color to the user's configured gray 400 color.\n*/\n\ninput::-moz-placeholder, textarea::-moz-placeholder {\n opacity: 1; /* 1 */\n color: #9ca3af; /* 2 */\n}\n\ninput::placeholder,\ntextarea::placeholder {\n opacity: 1; /* 1 */\n color: #9ca3af; /* 2 */\n}\n\n/*\nSet the default cursor for buttons.\n*/\n\nbutton,\n[role=\"button\"] {\n cursor: pointer;\n}\n\n/*\nMake sure disabled buttons don't get the pointer cursor.\n*/\n:disabled {\n cursor: default;\n}\n\n/*\n1. Make replaced elements `display: block` by default. (https://github.com/mozdevs/cssremedy/issues/14)\n2. Add `vertical-align: middle` to align replaced elements more sensibly by default. (https://github.com/jensimmons/cssremedy/issues/14#issuecomment-634934210)\n This can trigger a poorly considered lint error in some tools but is included by design.\n*/\n\nimg,\nsvg,\nvideo,\ncanvas,\naudio,\niframe,\nembed,\nobject {\n display: block; /* 1 */\n vertical-align: middle; /* 2 */\n}\n\n/*\nConstrain images and videos to the parent width and preserve their intrinsic aspect ratio. (https://github.com/mozdevs/cssremedy/issues/14)\n*/\n\nimg,\nvideo {\n max-width: 100%;\n height: auto;\n}\n\n/* Make elements with the HTML hidden attribute stay hidden by default */\n[hidden] {\n display: none;\n}\n\n*, ::before, ::after {\n --tw-border-spacing-x: 0;\n --tw-border-spacing-y: 0;\n --tw-translate-x: 0;\n --tw-translate-y: 0;\n --tw-rotate: 0;\n --tw-skew-x: 0;\n --tw-skew-y: 0;\n --tw-scale-x: 1;\n --tw-scale-y: 1;\n --tw-pan-x: ;\n --tw-pan-y: ;\n --tw-pinch-zoom: ;\n --tw-scroll-snap-strictness: proximity;\n --tw-gradient-from-position: ;\n --tw-gradient-via-position: ;\n --tw-gradient-to-position: ;\n --tw-ordinal: ;\n --tw-slashed-zero: ;\n --tw-numeric-figure: ;\n --tw-numeric-spacing: ;\n --tw-numeric-fraction: ;\n --tw-ring-inset: ;\n --tw-ring-offset-width: 0px;\n --tw-ring-offset-color: #fff;\n --tw-ring-color: rgb(59 130 246 / 0.5);\n --tw-ring-offset-shadow: 0 0 #0000;\n --tw-ring-shadow: 0 0 #0000;\n --tw-shadow: 0 0 #0000;\n --tw-shadow-colored: 0 0 #0000;\n --tw-blur: ;\n --tw-brightness: ;\n --tw-contrast: ;\n --tw-grayscale: ;\n --tw-hue-rotate: ;\n --tw-invert: ;\n --tw-saturate: ;\n --tw-sepia: ;\n --tw-drop-shadow: ;\n --tw-backdrop-blur: ;\n --tw-backdrop-brightness: ;\n --tw-backdrop-contrast: ;\n --tw-backdrop-grayscale: ;\n --tw-backdrop-hue-rotate: ;\n --tw-backdrop-invert: ;\n --tw-backdrop-opacity: ;\n --tw-backdrop-saturate: ;\n --tw-backdrop-sepia: ;\n --tw-contain-size: ;\n --tw-contain-layout: ;\n --tw-contain-paint: ;\n --tw-contain-style: ;\n}\n\n::backdrop {\n --tw-border-spacing-x: 0;\n --tw-border-spacing-y: 0;\n --tw-translate-x: 0;\n --tw-translate-y: 0;\n --tw-rotate: 0;\n --tw-skew-x: 0;\n --tw-skew-y: 0;\n --tw-scale-x: 1;\n --tw-scale-y: 1;\n --tw-pan-x: ;\n --tw-pan-y: ;\n --tw-pinch-zoom: ;\n --tw-scroll-snap-strictness: proximity;\n --tw-gradient-from-position: ;\n --tw-gradient-via-position: ;\n --tw-gradient-to-position: ;\n --tw-ordinal: ;\n --tw-slashed-zero: ;\n --tw-numeric-figure: ;\n --tw-numeric-spacing: ;\n --tw-numeric-fraction: ;\n --tw-ring-inset: ;\n --tw-ring-offset-width: 0px;\n --tw-ring-offset-color: #fff;\n --tw-ring-color: rgb(59 130 246 / 0.5);\n --tw-ring-offset-shadow: 0 0 #0000;\n --tw-ring-shadow: 0 0 #0000;\n --tw-shadow: 0 0 #0000;\n --tw-shadow-colored: 0 0 #0000;\n --tw-blur: ;\n --tw-brightness: ;\n --tw-contrast: ;\n --tw-grayscale: ;\n --tw-hue-rotate: ;\n --tw-invert: ;\n --tw-saturate: ;\n --tw-sepia: ;\n --tw-drop-shadow: ;\n --tw-backdrop-blur: ;\n --tw-backdrop-brightness: ;\n --tw-backdrop-contrast: ;\n --tw-backdrop-grayscale: ;\n --tw-backdrop-hue-rotate: ;\n --tw-backdrop-invert: ;\n --tw-backdrop-opacity: ;\n --tw-backdrop-saturate: ;\n --tw-backdrop-sepia: ;\n --tw-contain-size: ;\n --tw-contain-layout: ;\n --tw-contain-paint: ;\n --tw-contain-style: ;\n}\n.container {\n width: 100%;\n}\n@media (min-width: 640px) {\n\n .container {\n max-width: 640px;\n }\n}\n@media (min-width: 768px) {\n\n .container {\n max-width: 768px;\n }\n}\n@media (min-width: 1024px) {\n\n .container {\n max-width: 1024px;\n }\n}\n@media (min-width: 1280px) {\n\n .container {\n max-width: 1280px;\n }\n}\n@media (min-width: 1536px) {\n\n .container {\n max-width: 1536px;\n }\n}\n.static {\n position: static;\n}\n.absolute {\n position: absolute;\n}\n.relative {\n position: relative;\n}\n.inset-0 {\n inset: 0px;\n}\n.bottom-0 {\n bottom: 0px;\n}\n.left-0 {\n left: 0px;\n}\n.top-0 {\n top: 0px;\n}\n.z-10 {\n z-index: 10;\n}\n.z-20 {\n z-index: 20;\n}\n.m-4 {\n margin: 1rem;\n}\n.mx-auto {\n margin-left: auto;\n margin-right: auto;\n}\n.mt-2 {\n margin-top: 0.5rem;\n}\n.mt-4 {\n margin-top: 1rem;\n}\n.flex {\n display: flex;\n}\n.table {\n display: table;\n}\n.hidden {\n display: none;\n}\n.h-\\[calc\\(33\\%-40px\\)\\] {\n height: calc(33% - 40px);\n}\n.h-full {\n height: 100%;\n}\n.w-1\\/2 {\n width: 50%;\n}\n.w-\\[calc\\(100\\%-40px\\)\\] {\n width: calc(100% - 40px);\n}\n.w-full {\n width: 100%;\n}\n.min-w-full {\n min-width: 100%;\n}\n.max-w-\\[80\\%\\] {\n max-width: 80%;\n}\n.flex-grow {\n flex-grow: 1;\n}\n.transform {\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n.resize {\n resize: both;\n}\n.flex-col {\n flex-direction: column;\n}\n.items-center {\n align-items: center;\n}\n.justify-center {\n justify-content: center;\n}\n.overflow-auto {\n overflow: auto;\n}\n.overflow-hidden {\n overflow: hidden;\n}\n.rounded {\n border-radius: 0.25rem;\n}\n.rounded-lg {\n border-radius: 0.5rem;\n}\n.rounded-md {\n border-radius: 0.375rem;\n}\n.rounded-br-md {\n border-bottom-right-radius: 0.375rem;\n}\n.bg-white {\n --tw-bg-opacity: 1;\n background-color: rgb(255 255 255 / var(--tw-bg-opacity));\n}\n.bg-cover {\n background-size: cover;\n}\n.bg-center {\n background-position: center;\n}\n.p-2 {\n padding: 0.5rem;\n}\n.p-4 {\n padding: 1rem;\n}\n.text-center {\n text-align: center;\n}\n.text-black {\n --tw-text-opacity: 1;\n color: rgb(0 0 0 / var(--tw-text-opacity));\n}\n.shadow-md {\n --tw-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);\n --tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);\n}\n.filter {\n filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);\n}\n.transition {\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, -webkit-backdrop-filter;\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter, -webkit-backdrop-filter;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n}\n.transition-colors {\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n}\n.hover\\:bg-gray-100:hover {\n --tw-bg-opacity: 1;\n background-color: rgb(243 244 246 / var(--tw-bg-opacity));\n}\n.active\\:bg-gray-200:active {\n --tw-bg-opacity: 1;\n background-color: rgb(229 231 235 / var(--tw-bg-opacity));\n}",""]);const s=a},314:t=>{"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n="",r=void 0!==e[5];return e[4]&&(n+="@supports (".concat(e[4],") {")),e[2]&&(n+="@media ".concat(e[2]," {")),r&&(n+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),n+=t(e),r&&(n+="}"),e[2]&&(n+="}"),e[4]&&(n+="}"),n})).join("")},e.i=function(t,n,r,o,i){"string"==typeof t&&(t=[[null,t,void 0]]);var a={};if(r)for(var s=0;s<this.length;s++){var u=this[s][0];null!=u&&(a[u]=!0)}for(var c=0;c<t.length;c++){var l=[].concat(t[c]);r&&a[l[0]]||(void 0!==i&&(void 0===l[5]||(l[1]="@layer".concat(l[5].length>0?" ".concat(l[5]):""," {").concat(l[1],"}")),l[5]=i),n&&(l[2]?(l[1]="@media ".concat(l[2]," {").concat(l[1],"}"),l[2]=n):l[2]=n),o&&(l[4]?(l[1]="@supports (".concat(l[4],") {").concat(l[1],"}"),l[4]=o):l[4]="".concat(o)),e.push(l))}},e}},601:t=>{"use strict";t.exports=function(t){return t[1]}},196:(t,e,n)=>{var r;
2
+ /*!
3
+ * howler.js v2.2.4
4
+ * howlerjs.com
5
+ *
6
+ * (c) 2013-2020, James Simpson of GoldFire Studios
7
+ * goldfirestudios.com
8
+ *
9
+ * MIT License
10
+ */!function(){"use strict";var o=function(){this.init()};o.prototype={init:function(){var t=this||i;return t._counter=1e3,t._html5AudioPool=[],t.html5PoolSize=10,t._codecs={},t._howls=[],t._muted=!1,t._volume=1,t._canPlayEvent="canplaythrough",t._navigator="undefined"!=typeof window&&window.navigator?window.navigator:null,t.masterGain=null,t.noAudio=!1,t.usingWebAudio=!0,t.autoSuspend=!0,t.ctx=null,t.autoUnlock=!0,t._setup(),t},volume:function(t){var e=this||i;if(t=parseFloat(t),e.ctx||p(),void 0!==t&&t>=0&&t<=1){if(e._volume=t,e._muted)return e;e.usingWebAudio&&e.masterGain.gain.setValueAtTime(t,i.ctx.currentTime);for(var n=0;n<e._howls.length;n++)if(!e._howls[n]._webAudio)for(var r=e._howls[n]._getSoundIds(),o=0;o<r.length;o++){var a=e._howls[n]._soundById(r[o]);a&&a._node&&(a._node.volume=a._volume*t)}return e}return e._volume},mute:function(t){var e=this||i;e.ctx||p(),e._muted=t,e.usingWebAudio&&e.masterGain.gain.setValueAtTime(t?0:e._volume,i.ctx.currentTime);for(var n=0;n<e._howls.length;n++)if(!e._howls[n]._webAudio)for(var r=e._howls[n]._getSoundIds(),o=0;o<r.length;o++){var a=e._howls[n]._soundById(r[o]);a&&a._node&&(a._node.muted=!!t||a._muted)}return e},stop:function(){for(var t=this||i,e=0;e<t._howls.length;e++)t._howls[e].stop();return t},unload:function(){for(var t=this||i,e=t._howls.length-1;e>=0;e--)t._howls[e].unload();return t.usingWebAudio&&t.ctx&&void 0!==t.ctx.close&&(t.ctx.close(),t.ctx=null,p()),t},codecs:function(t){return(this||i)._codecs[t.replace(/^x-/,"")]},_setup:function(){var t=this||i;if(t.state=t.ctx&&t.ctx.state||"suspended",t._autoSuspend(),!t.usingWebAudio)if("undefined"!=typeof Audio)try{void 0===(new Audio).oncanplaythrough&&(t._canPlayEvent="canplay")}catch(e){t.noAudio=!0}else t.noAudio=!0;try{(new Audio).muted&&(t.noAudio=!0)}catch(t){}return t.noAudio||t._setupCodecs(),t},_setupCodecs:function(){var t=this||i,e=null;try{e="undefined"!=typeof Audio?new Audio:null}catch(e){return t}if(!e||"function"!=typeof e.canPlayType)return t;var n=e.canPlayType("audio/mpeg;").replace(/^no$/,""),r=t._navigator?t._navigator.userAgent:"",o=r.match(/OPR\/(\d+)/g),a=o&&parseInt(o[0].split("/")[1],10)<33,s=-1!==r.indexOf("Safari")&&-1===r.indexOf("Chrome"),u=r.match(/Version\/(.*?) /),c=s&&u&&parseInt(u[1],10)<15;return t._codecs={mp3:!(a||!n&&!e.canPlayType("audio/mp3;").replace(/^no$/,"")),mpeg:!!n,opus:!!e.canPlayType('audio/ogg; codecs="opus"').replace(/^no$/,""),ogg:!!e.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),oga:!!e.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),wav:!!(e.canPlayType('audio/wav; codecs="1"')||e.canPlayType("audio/wav")).replace(/^no$/,""),aac:!!e.canPlayType("audio/aac;").replace(/^no$/,""),caf:!!e.canPlayType("audio/x-caf;").replace(/^no$/,""),m4a:!!(e.canPlayType("audio/x-m4a;")||e.canPlayType("audio/m4a;")||e.canPlayType("audio/aac;")).replace(/^no$/,""),m4b:!!(e.canPlayType("audio/x-m4b;")||e.canPlayType("audio/m4b;")||e.canPlayType("audio/aac;")).replace(/^no$/,""),mp4:!!(e.canPlayType("audio/x-mp4;")||e.canPlayType("audio/mp4;")||e.canPlayType("audio/aac;")).replace(/^no$/,""),weba:!(c||!e.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),webm:!(c||!e.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),dolby:!!e.canPlayType('audio/mp4; codecs="ec-3"').replace(/^no$/,""),flac:!!(e.canPlayType("audio/x-flac;")||e.canPlayType("audio/flac;")).replace(/^no$/,"")},t},_unlockAudio:function(){var t=this||i;if(!t._audioUnlocked&&t.ctx){t._audioUnlocked=!1,t.autoUnlock=!1,t._mobileUnloaded||44100===t.ctx.sampleRate||(t._mobileUnloaded=!0,t.unload()),t._scratchBuffer=t.ctx.createBuffer(1,1,22050);var e=function(n){for(;t._html5AudioPool.length<t.html5PoolSize;)try{var r=new Audio;r._unlocked=!0,t._releaseHtml5Audio(r)}catch(n){t.noAudio=!0;break}for(var o=0;o<t._howls.length;o++)if(!t._howls[o]._webAudio)for(var i=t._howls[o]._getSoundIds(),a=0;a<i.length;a++){var s=t._howls[o]._soundById(i[a]);s&&s._node&&!s._node._unlocked&&(s._node._unlocked=!0,s._node.load())}t._autoResume();var u=t.ctx.createBufferSource();u.buffer=t._scratchBuffer,u.connect(t.ctx.destination),void 0===u.start?u.noteOn(0):u.start(0),"function"==typeof t.ctx.resume&&t.ctx.resume(),u.onended=function(){u.disconnect(0),t._audioUnlocked=!0,document.removeEventListener("touchstart",e,!0),document.removeEventListener("touchend",e,!0),document.removeEventListener("click",e,!0),document.removeEventListener("keydown",e,!0);for(var n=0;n<t._howls.length;n++)t._howls[n]._emit("unlock")}};return document.addEventListener("touchstart",e,!0),document.addEventListener("touchend",e,!0),document.addEventListener("click",e,!0),document.addEventListener("keydown",e,!0),t}},_obtainHtml5Audio:function(){var t=this||i;if(t._html5AudioPool.length)return t._html5AudioPool.pop();var e=(new Audio).play();return e&&"undefined"!=typeof Promise&&(e instanceof Promise||"function"==typeof e.then)&&e.catch((function(){console.warn("HTML5 Audio pool exhausted, returning potentially locked audio object.")})),new Audio},_releaseHtml5Audio:function(t){var e=this||i;return t._unlocked&&e._html5AudioPool.push(t),e},_autoSuspend:function(){var t=this;if(t.autoSuspend&&t.ctx&&void 0!==t.ctx.suspend&&i.usingWebAudio){for(var e=0;e<t._howls.length;e++)if(t._howls[e]._webAudio)for(var n=0;n<t._howls[e]._sounds.length;n++)if(!t._howls[e]._sounds[n]._paused)return t;return t._suspendTimer&&clearTimeout(t._suspendTimer),t._suspendTimer=setTimeout((function(){if(t.autoSuspend){t._suspendTimer=null,t.state="suspending";var e=function(){t.state="suspended",t._resumeAfterSuspend&&(delete t._resumeAfterSuspend,t._autoResume())};t.ctx.suspend().then(e,e)}}),3e4),t}},_autoResume:function(){var t=this;if(t.ctx&&void 0!==t.ctx.resume&&i.usingWebAudio)return"running"===t.state&&"interrupted"!==t.ctx.state&&t._suspendTimer?(clearTimeout(t._suspendTimer),t._suspendTimer=null):"suspended"===t.state||"running"===t.state&&"interrupted"===t.ctx.state?(t.ctx.resume().then((function(){t.state="running";for(var e=0;e<t._howls.length;e++)t._howls[e]._emit("resume")})),t._suspendTimer&&(clearTimeout(t._suspendTimer),t._suspendTimer=null)):"suspending"===t.state&&(t._resumeAfterSuspend=!0),t}};var i=new o,a=function(t){t.src&&0!==t.src.length?this.init(t):console.error("An array of source files must be passed with any new Howl.")};a.prototype={init:function(t){var e=this;return i.ctx||p(),e._autoplay=t.autoplay||!1,e._format="string"!=typeof t.format?t.format:[t.format],e._html5=t.html5||!1,e._muted=t.mute||!1,e._loop=t.loop||!1,e._pool=t.pool||5,e._preload="boolean"!=typeof t.preload&&"metadata"!==t.preload||t.preload,e._rate=t.rate||1,e._sprite=t.sprite||{},e._src="string"!=typeof t.src?t.src:[t.src],e._volume=void 0!==t.volume?t.volume:1,e._xhr={method:t.xhr&&t.xhr.method?t.xhr.method:"GET",headers:t.xhr&&t.xhr.headers?t.xhr.headers:null,withCredentials:!(!t.xhr||!t.xhr.withCredentials)&&t.xhr.withCredentials},e._duration=0,e._state="unloaded",e._sounds=[],e._endTimers={},e._queue=[],e._playLock=!1,e._onend=t.onend?[{fn:t.onend}]:[],e._onfade=t.onfade?[{fn:t.onfade}]:[],e._onload=t.onload?[{fn:t.onload}]:[],e._onloaderror=t.onloaderror?[{fn:t.onloaderror}]:[],e._onplayerror=t.onplayerror?[{fn:t.onplayerror}]:[],e._onpause=t.onpause?[{fn:t.onpause}]:[],e._onplay=t.onplay?[{fn:t.onplay}]:[],e._onstop=t.onstop?[{fn:t.onstop}]:[],e._onmute=t.onmute?[{fn:t.onmute}]:[],e._onvolume=t.onvolume?[{fn:t.onvolume}]:[],e._onrate=t.onrate?[{fn:t.onrate}]:[],e._onseek=t.onseek?[{fn:t.onseek}]:[],e._onunlock=t.onunlock?[{fn:t.onunlock}]:[],e._onresume=[],e._webAudio=i.usingWebAudio&&!e._html5,void 0!==i.ctx&&i.ctx&&i.autoUnlock&&i._unlockAudio(),i._howls.push(e),e._autoplay&&e._queue.push({event:"play",action:function(){e.play()}}),e._preload&&"none"!==e._preload&&e.load(),e},load:function(){var t=this,e=null;if(i.noAudio)t._emit("loaderror",null,"No audio support.");else{"string"==typeof t._src&&(t._src=[t._src]);for(var n=0;n<t._src.length;n++){var r,o;if(t._format&&t._format[n])r=t._format[n];else{if("string"!=typeof(o=t._src[n])){t._emit("loaderror",null,"Non-string found in selected audio sources - ignoring.");continue}(r=/^data:audio\/([^;,]+);/i.exec(o))||(r=/\.([^.]+)$/.exec(o.split("?",1)[0])),r&&(r=r[1].toLowerCase())}if(r||console.warn('No file extension was found. Consider using the "format" property or specify an extension.'),r&&i.codecs(r)){e=t._src[n];break}}if(e)return t._src=e,t._state="loading","https:"===window.location.protocol&&"http:"===e.slice(0,5)&&(t._html5=!0,t._webAudio=!1),new s(t),t._webAudio&&c(t),t;t._emit("loaderror",null,"No codec support for selected audio sources.")}},play:function(t,e){var n=this,r=null;if("number"==typeof t)r=t,t=null;else{if("string"==typeof t&&"loaded"===n._state&&!n._sprite[t])return null;if(void 0===t&&(t="__default",!n._playLock)){for(var o=0,a=0;a<n._sounds.length;a++)n._sounds[a]._paused&&!n._sounds[a]._ended&&(o++,r=n._sounds[a]._id);1===o?t=null:r=null}}var s=r?n._soundById(r):n._inactiveSound();if(!s)return null;if(r&&!t&&(t=s._sprite||"__default"),"loaded"!==n._state){s._sprite=t,s._ended=!1;var u=s._id;return n._queue.push({event:"play",action:function(){n.play(u)}}),u}if(r&&!s._paused)return e||n._loadQueue("play"),s._id;n._webAudio&&i._autoResume();var c=Math.max(0,s._seek>0?s._seek:n._sprite[t][0]/1e3),l=Math.max(0,(n._sprite[t][0]+n._sprite[t][1])/1e3-c),f=1e3*l/Math.abs(s._rate),d=n._sprite[t][0]/1e3,p=(n._sprite[t][0]+n._sprite[t][1])/1e3;s._sprite=t,s._ended=!1;var h=function(){s._paused=!1,s._seek=c,s._start=d,s._stop=p,s._loop=!(!s._loop&&!n._sprite[t][2])};if(!(c>=p)){var y=s._node;if(n._webAudio){var v=function(){n._playLock=!1,h(),n._refreshBuffer(s);var t=s._muted||n._muted?0:s._volume;y.gain.setValueAtTime(t,i.ctx.currentTime),s._playStart=i.ctx.currentTime,void 0===y.bufferSource.start?s._loop?y.bufferSource.noteGrainOn(0,c,86400):y.bufferSource.noteGrainOn(0,c,l):s._loop?y.bufferSource.start(0,c,86400):y.bufferSource.start(0,c,l),f!==1/0&&(n._endTimers[s._id]=setTimeout(n._ended.bind(n,s),f)),e||setTimeout((function(){n._emit("play",s._id),n._loadQueue()}),0)};"running"===i.state&&"interrupted"!==i.ctx.state?v():(n._playLock=!0,n.once("resume",v),n._clearTimer(s._id))}else{var m=function(){y.currentTime=c,y.muted=s._muted||n._muted||i._muted||y.muted,y.volume=s._volume*i.volume(),y.playbackRate=s._rate;try{var r=y.play();if(r&&"undefined"!=typeof Promise&&(r instanceof Promise||"function"==typeof r.then)?(n._playLock=!0,h(),r.then((function(){n._playLock=!1,y._unlocked=!0,e?n._loadQueue():n._emit("play",s._id)})).catch((function(){n._playLock=!1,n._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}))):e||(n._playLock=!1,h(),n._emit("play",s._id)),y.playbackRate=s._rate,y.paused)return void n._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"!==t||s._loop?n._endTimers[s._id]=setTimeout(n._ended.bind(n,s),f):(n._endTimers[s._id]=function(){n._ended(s),y.removeEventListener("ended",n._endTimers[s._id],!1)},y.addEventListener("ended",n._endTimers[s._id],!1))}catch(t){n._emit("playerror",s._id,t)}};"data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA"===y.src&&(y.src=n._src,y.load());var g=window&&window.ejecta||!y.readyState&&i._navigator.isCocoonJS;if(y.readyState>=3||g)m();else{n._playLock=!0,n._state="loading";var b=function(){n._state="loaded",m(),y.removeEventListener(i._canPlayEvent,b,!1)};y.addEventListener(i._canPlayEvent,b,!1),n._clearTimer(s._id)}}return s._id}n._ended(s)},pause:function(t){var e=this;if("loaded"!==e._state||e._playLock)return e._queue.push({event:"pause",action:function(){e.pause(t)}}),e;for(var n=e._getSoundIds(t),r=0;r<n.length;r++){e._clearTimer(n[r]);var o=e._soundById(n[r]);if(o&&!o._paused&&(o._seek=e.seek(n[r]),o._rateSeek=0,o._paused=!0,e._stopFade(n[r]),o._node))if(e._webAudio){if(!o._node.bufferSource)continue;void 0===o._node.bufferSource.stop?o._node.bufferSource.noteOff(0):o._node.bufferSource.stop(0),e._cleanBuffer(o._node)}else isNaN(o._node.duration)&&o._node.duration!==1/0||o._node.pause();arguments[1]||e._emit("pause",o?o._id:null)}return e},stop:function(t,e){var n=this;if("loaded"!==n._state||n._playLock)return n._queue.push({event:"stop",action:function(){n.stop(t)}}),n;for(var r=n._getSoundIds(t),o=0;o<r.length;o++){n._clearTimer(r[o]);var i=n._soundById(r[o]);i&&(i._seek=i._start||0,i._rateSeek=0,i._paused=!0,i._ended=!0,n._stopFade(r[o]),i._node&&(n._webAudio?i._node.bufferSource&&(void 0===i._node.bufferSource.stop?i._node.bufferSource.noteOff(0):i._node.bufferSource.stop(0),n._cleanBuffer(i._node)):isNaN(i._node.duration)&&i._node.duration!==1/0||(i._node.currentTime=i._start||0,i._node.pause(),i._node.duration===1/0&&n._clearSound(i._node))),e||n._emit("stop",i._id))}return n},mute:function(t,e){var n=this;if("loaded"!==n._state||n._playLock)return n._queue.push({event:"mute",action:function(){n.mute(t,e)}}),n;if(void 0===e){if("boolean"!=typeof t)return n._muted;n._muted=t}for(var r=n._getSoundIds(e),o=0;o<r.length;o++){var a=n._soundById(r[o]);a&&(a._muted=t,a._interval&&n._stopFade(a._id),n._webAudio&&a._node?a._node.gain.setValueAtTime(t?0:a._volume,i.ctx.currentTime):a._node&&(a._node.muted=!!i._muted||t),n._emit("mute",a._id))}return n},volume:function(){var t,e,n,r=this,o=arguments;if(0===o.length)return r._volume;if(1===o.length||2===o.length&&void 0===o[1]?r._getSoundIds().indexOf(o[0])>=0?e=parseInt(o[0],10):t=parseFloat(o[0]):o.length>=2&&(t=parseFloat(o[0]),e=parseInt(o[1],10)),!(void 0!==t&&t>=0&&t<=1))return(n=e?r._soundById(e):r._sounds[0])?n._volume:0;if("loaded"!==r._state||r._playLock)return r._queue.push({event:"volume",action:function(){r.volume.apply(r,o)}}),r;void 0===e&&(r._volume=t),e=r._getSoundIds(e);for(var a=0;a<e.length;a++)(n=r._soundById(e[a]))&&(n._volume=t,o[2]||r._stopFade(e[a]),r._webAudio&&n._node&&!n._muted?n._node.gain.setValueAtTime(t,i.ctx.currentTime):n._node&&!n._muted&&(n._node.volume=t*i.volume()),r._emit("volume",n._id));return r},fade:function(t,e,n,r){var o=this;if("loaded"!==o._state||o._playLock)return o._queue.push({event:"fade",action:function(){o.fade(t,e,n,r)}}),o;t=Math.min(Math.max(0,parseFloat(t)),1),e=Math.min(Math.max(0,parseFloat(e)),1),n=parseFloat(n),o.volume(t,r);for(var a=o._getSoundIds(r),s=0;s<a.length;s++){var u=o._soundById(a[s]);if(u){if(r||o._stopFade(a[s]),o._webAudio&&!u._muted){var c=i.ctx.currentTime,l=c+n/1e3;u._volume=t,u._node.gain.setValueAtTime(t,c),u._node.gain.linearRampToValueAtTime(e,l)}o._startFadeInterval(u,t,e,n,a[s],void 0===r)}}return o},_startFadeInterval:function(t,e,n,r,o,i){var a=this,s=e,u=n-e,c=Math.abs(u/.01),l=Math.max(4,c>0?r/c:r),f=Date.now();t._fadeTo=n,t._interval=setInterval((function(){var o=(Date.now()-f)/r;f=Date.now(),s+=u*o,s=Math.round(100*s)/100,s=u<0?Math.max(n,s):Math.min(n,s),a._webAudio?t._volume=s:a.volume(s,t._id,!0),i&&(a._volume=s),(n<e&&s<=n||n>e&&s>=n)&&(clearInterval(t._interval),t._interval=null,t._fadeTo=null,a.volume(n,t._id),a._emit("fade",t._id))}),l)},_stopFade:function(t){var e=this,n=e._soundById(t);return n&&n._interval&&(e._webAudio&&n._node.gain.cancelScheduledValues(i.ctx.currentTime),clearInterval(n._interval),n._interval=null,e.volume(n._fadeTo,t),n._fadeTo=null,e._emit("fade",t)),e},loop:function(){var t,e,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;t=o[0],r._loop=t}else 2===o.length&&(t=o[0],e=parseInt(o[1],10));for(var i=r._getSoundIds(e),a=0;a<i.length;a++)(n=r._soundById(i[a]))&&(n._loop=t,r._webAudio&&n._node&&n._node.bufferSource&&(n._node.bufferSource.loop=t,t&&(n._node.bufferSource.loopStart=n._start||0,n._node.bufferSource.loopEnd=n._stop,r.playing(i[a])&&(r.pause(i[a],!0),r.play(i[a],!0)))));return r},rate:function(){var t,e,n,r=this,o=arguments;if(0===o.length)e=r._sounds[0]._id;else if(1===o.length){r._getSoundIds().indexOf(o[0])>=0?e=parseInt(o[0],10):t=parseFloat(o[0])}else 2===o.length&&(t=parseFloat(o[0]),e=parseInt(o[1],10));if("number"!=typeof t)return(n=r._soundById(e))?n._rate:r._rate;if("loaded"!==r._state||r._playLock)return r._queue.push({event:"rate",action:function(){r.rate.apply(r,o)}}),r;void 0===e&&(r._rate=t),e=r._getSoundIds(e);for(var a=0;a<e.length;a++)if(n=r._soundById(e[a])){r.playing(e[a])&&(n._rateSeek=r.seek(e[a]),n._playStart=r._webAudio?i.ctx.currentTime:n._playStart),n._rate=t,r._webAudio&&n._node&&n._node.bufferSource?n._node.bufferSource.playbackRate.setValueAtTime(t,i.ctx.currentTime):n._node&&(n._node.playbackRate=t);var s=r.seek(e[a]),u=1e3*((r._sprite[n._sprite][0]+r._sprite[n._sprite][1])/1e3-s)/Math.abs(n._rate);!r._endTimers[e[a]]&&n._paused||(r._clearTimer(e[a]),r._endTimers[e[a]]=setTimeout(r._ended.bind(r,n),u)),r._emit("rate",n._id)}return r},seek:function(){var t,e,n=this,r=arguments;if(0===r.length)n._sounds.length&&(e=n._sounds[0]._id);else if(1===r.length){n._getSoundIds().indexOf(r[0])>=0?e=parseInt(r[0],10):n._sounds.length&&(e=n._sounds[0]._id,t=parseFloat(r[0]))}else 2===r.length&&(t=parseFloat(r[0]),e=parseInt(r[1],10));if(void 0===e)return 0;if("number"==typeof t&&("loaded"!==n._state||n._playLock))return n._queue.push({event:"seek",action:function(){n.seek.apply(n,r)}}),n;var o=n._soundById(e);if(o){if(!("number"==typeof t&&t>=0)){if(n._webAudio){var a=n.playing(e)?i.ctx.currentTime-o._playStart:0,s=o._rateSeek?o._rateSeek-o._seek:0;return o._seek+(s+a*Math.abs(o._rate))}return o._node.currentTime}var u=n.playing(e);u&&n.pause(e,!0),o._seek=t,o._ended=!1,n._clearTimer(e),n._webAudio||!o._node||isNaN(o._node.duration)||(o._node.currentTime=t);var c=function(){u&&n.play(e,!0),n._emit("seek",e)};if(u&&!n._webAudio){var l=function(){n._playLock?setTimeout(l,0):c()};setTimeout(l,0)}else c()}return n},playing:function(t){var e=this;if("number"==typeof t){var n=e._soundById(t);return!!n&&!n._paused}for(var r=0;r<e._sounds.length;r++)if(!e._sounds[r]._paused)return!0;return!1},duration:function(t){var e=this,n=e._duration,r=e._soundById(t);return r&&(n=e._sprite[r._sprite][1]/1e3),n},state:function(){return this._state},unload:function(){for(var t=this,e=t._sounds,n=0;n<e.length;n++)e[n]._paused||t.stop(e[n]._id),t._webAudio||(t._clearSound(e[n]._node),e[n]._node.removeEventListener("error",e[n]._errorFn,!1),e[n]._node.removeEventListener(i._canPlayEvent,e[n]._loadFn,!1),e[n]._node.removeEventListener("ended",e[n]._endFn,!1),i._releaseHtml5Audio(e[n]._node)),delete e[n]._node,t._clearTimer(e[n]._id);var r=i._howls.indexOf(t);r>=0&&i._howls.splice(r,1);var o=!0;for(n=0;n<i._howls.length;n++)if(i._howls[n]._src===t._src||t._src.indexOf(i._howls[n]._src)>=0){o=!1;break}return u&&o&&delete u[t._src],i.noAudio=!1,t._state="unloaded",t._sounds=[],t=null,null},on:function(t,e,n,r){var o=this["_on"+t];return"function"==typeof e&&o.push(r?{id:n,fn:e,once:r}:{id:n,fn:e}),this},off:function(t,e,n){var r=this,o=r["_on"+t],i=0;if("number"==typeof e&&(n=e,e=null),e||n)for(i=0;i<o.length;i++){var a=n===o[i].id;if(e===o[i].fn&&a||!e&&a){o.splice(i,1);break}}else if(t)r["_on"+t]=[];else{var s=Object.keys(r);for(i=0;i<s.length;i++)0===s[i].indexOf("_on")&&Array.isArray(r[s[i]])&&(r[s[i]]=[])}return r},once:function(t,e,n){return this.on(t,e,n,1),this},_emit:function(t,e,n){for(var r=this,o=r["_on"+t],i=o.length-1;i>=0;i--)o[i].id&&o[i].id!==e&&"load"!==t||(setTimeout(function(t){t.call(this,e,n)}.bind(r,o[i].fn),0),o[i].once&&r.off(t,o[i].fn,o[i].id));return r._loadQueue(t),r},_loadQueue:function(t){var e=this;if(e._queue.length>0){var n=e._queue[0];n.event===t&&(e._queue.shift(),e._loadQueue()),t||n.action()}return e},_ended:function(t){var e=this,n=t._sprite;if(!e._webAudio&&t._node&&!t._node.paused&&!t._node.ended&&t._node.currentTime<t._stop)return setTimeout(e._ended.bind(e,t),100),e;var r=!(!t._loop&&!e._sprite[n][2]);if(e._emit("end",t._id),!e._webAudio&&r&&e.stop(t._id,!0).play(t._id),e._webAudio&&r){e._emit("play",t._id),t._seek=t._start||0,t._rateSeek=0,t._playStart=i.ctx.currentTime;var o=1e3*(t._stop-t._start)/Math.abs(t._rate);e._endTimers[t._id]=setTimeout(e._ended.bind(e,t),o)}return e._webAudio&&!r&&(t._paused=!0,t._ended=!0,t._seek=t._start||0,t._rateSeek=0,e._clearTimer(t._id),e._cleanBuffer(t._node),i._autoSuspend()),e._webAudio||r||e.stop(t._id,!0),e},_clearTimer:function(t){var e=this;if(e._endTimers[t]){if("function"!=typeof e._endTimers[t])clearTimeout(e._endTimers[t]);else{var n=e._soundById(t);n&&n._node&&n._node.removeEventListener("ended",e._endTimers[t],!1)}delete e._endTimers[t]}return e},_soundById:function(t){for(var e=this,n=0;n<e._sounds.length;n++)if(t===e._sounds[n]._id)return e._sounds[n];return null},_inactiveSound:function(){var t=this;t._drain();for(var e=0;e<t._sounds.length;e++)if(t._sounds[e]._ended)return t._sounds[e].reset();return new s(t)},_drain:function(){var t=this,e=t._pool,n=0,r=0;if(!(t._sounds.length<e)){for(r=0;r<t._sounds.length;r++)t._sounds[r]._ended&&n++;for(r=t._sounds.length-1;r>=0;r--){if(n<=e)return;t._sounds[r]._ended&&(t._webAudio&&t._sounds[r]._node&&t._sounds[r]._node.disconnect(0),t._sounds.splice(r,1),n--)}}},_getSoundIds:function(t){if(void 0===t){for(var e=[],n=0;n<this._sounds.length;n++)e.push(this._sounds[n]._id);return e}return[t]},_refreshBuffer:function(t){return t._node.bufferSource=i.ctx.createBufferSource(),t._node.bufferSource.buffer=u[this._src],t._panner?t._node.bufferSource.connect(t._panner):t._node.bufferSource.connect(t._node),t._node.bufferSource.loop=t._loop,t._loop&&(t._node.bufferSource.loopStart=t._start||0,t._node.bufferSource.loopEnd=t._stop||0),t._node.bufferSource.playbackRate.setValueAtTime(t._rate,i.ctx.currentTime),this},_cleanBuffer:function(t){var e=i._navigator&&i._navigator.vendor.indexOf("Apple")>=0;if(!t.bufferSource)return this;if(i._scratchBuffer&&t.bufferSource&&(t.bufferSource.onended=null,t.bufferSource.disconnect(0),e))try{t.bufferSource.buffer=i._scratchBuffer}catch(t){}return t.bufferSource=null,this},_clearSound:function(t){/MSIE |Trident\//.test(i._navigator&&i._navigator.userAgent)||(t.src="data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA")}};var s=function(t){this._parent=t,this.init()};s.prototype={init:function(){var t=this,e=t._parent;return t._muted=e._muted,t._loop=e._loop,t._volume=e._volume,t._rate=e._rate,t._seek=0,t._paused=!0,t._ended=!0,t._sprite="__default",t._id=++i._counter,e._sounds.push(t),t.create(),t},create:function(){var t=this,e=t._parent,n=i._muted||t._muted||t._parent._muted?0:t._volume;return e._webAudio?(t._node=void 0===i.ctx.createGain?i.ctx.createGainNode():i.ctx.createGain(),t._node.gain.setValueAtTime(n,i.ctx.currentTime),t._node.paused=!0,t._node.connect(i.masterGain)):i.noAudio||(t._node=i._obtainHtml5Audio(),t._errorFn=t._errorListener.bind(t),t._node.addEventListener("error",t._errorFn,!1),t._loadFn=t._loadListener.bind(t),t._node.addEventListener(i._canPlayEvent,t._loadFn,!1),t._endFn=t._endListener.bind(t),t._node.addEventListener("ended",t._endFn,!1),t._node.src=e._src,t._node.preload=!0===e._preload?"auto":e._preload,t._node.volume=n*i.volume(),t._node.load()),t},reset:function(){var t=this,e=t._parent;return t._muted=e._muted,t._loop=e._loop,t._volume=e._volume,t._rate=e._rate,t._seek=0,t._rateSeek=0,t._paused=!0,t._ended=!0,t._sprite="__default",t._id=++i._counter,t},_errorListener:function(){var t=this;t._parent._emit("loaderror",t._id,t._node.error?t._node.error.code:0),t._node.removeEventListener("error",t._errorFn,!1)},_loadListener:function(){var t=this,e=t._parent;e._duration=Math.ceil(10*t._node.duration)/10,0===Object.keys(e._sprite).length&&(e._sprite={__default:[0,1e3*e._duration]}),"loaded"!==e._state&&(e._state="loaded",e._emit("load"),e._loadQueue()),t._node.removeEventListener(i._canPlayEvent,t._loadFn,!1)},_endListener:function(){var t=this,e=t._parent;e._duration===1/0&&(e._duration=Math.ceil(10*t._node.duration)/10,e._sprite.__default[1]===1/0&&(e._sprite.__default[1]=1e3*e._duration),e._ended(t)),t._node.removeEventListener("ended",t._endFn,!1)}};var u={},c=function(t){var e=t._src;if(u[e])return t._duration=u[e].duration,void d(t);if(/^data:[^;]+;base64,/.test(e)){for(var n=atob(e.split(",")[1]),r=new Uint8Array(n.length),o=0;o<n.length;++o)r[o]=n.charCodeAt(o);f(r.buffer,t)}else{var i=new XMLHttpRequest;i.open(t._xhr.method,e,!0),i.withCredentials=t._xhr.withCredentials,i.responseType="arraybuffer",t._xhr.headers&&Object.keys(t._xhr.headers).forEach((function(e){i.setRequestHeader(e,t._xhr.headers[e])})),i.onload=function(){var e=(i.status+"")[0];"0"===e||"2"===e||"3"===e?f(i.response,t):t._emit("loaderror",null,"Failed loading audio file with status: "+i.status+".")},i.onerror=function(){t._webAudio&&(t._html5=!0,t._webAudio=!1,t._sounds=[],delete u[e],t.load())},l(i)}},l=function(t){try{t.send()}catch(e){t.onerror()}},f=function(t,e){var n=function(){e._emit("loaderror",null,"Decoding audio data failed.")},r=function(t){t&&e._sounds.length>0?(u[e._src]=t,d(e,t)):n()};"undefined"!=typeof Promise&&1===i.ctx.decodeAudioData.length?i.ctx.decodeAudioData(t).then(r).catch(n):i.ctx.decodeAudioData(t,r,n)},d=function(t,e){e&&!t._duration&&(t._duration=e.duration),0===Object.keys(t._sprite).length&&(t._sprite={__default:[0,1e3*t._duration]}),"loaded"!==t._state&&(t._state="loaded",t._emit("load"),t._loadQueue())},p=function(){if(i.usingWebAudio){try{"undefined"!=typeof AudioContext?i.ctx=new AudioContext:"undefined"!=typeof webkitAudioContext?i.ctx=new webkitAudioContext:i.usingWebAudio=!1}catch(t){i.usingWebAudio=!1}i.ctx||(i.usingWebAudio=!1);var t=/iP(hone|od|ad)/.test(i._navigator&&i._navigator.platform),e=i._navigator&&i._navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/),n=e?parseInt(e[1],10):null;if(t&&n&&n<9){var r=/safari/.test(i._navigator&&i._navigator.userAgent.toLowerCase());i._navigator&&!r&&(i.usingWebAudio=!1)}i.usingWebAudio&&(i.masterGain=void 0===i.ctx.createGain?i.ctx.createGainNode():i.ctx.createGain(),i.masterGain.gain.setValueAtTime(i._muted?0:i._volume,i.ctx.currentTime),i.masterGain.connect(i.ctx.destination)),i._setup()}};void 0===(r=function(){return{Howler:i,Howl:a}}.apply(e,[]))||(t.exports=r),e.Howler=i,e.Howl=a,void 0!==n.g?(n.g.HowlerGlobal=o,n.g.Howler=i,n.g.Howl=a,n.g.Sound=s):"undefined"!=typeof window&&(window.HowlerGlobal=o,window.Howler=i,window.Howl=a,window.Sound=s)}(),
11
+ /*!
12
+ * Spatial Plugin - Adds support for stereo and 3D audio where Web Audio is supported.
13
+ *
14
+ * howler.js v2.2.4
15
+ * howlerjs.com
16
+ *
17
+ * (c) 2013-2020, James Simpson of GoldFire Studios
18
+ * goldfirestudios.com
19
+ *
20
+ * MIT License
21
+ */
22
+ function(){"use strict";var t;HowlerGlobal.prototype._pos=[0,0,0],HowlerGlobal.prototype._orientation=[0,0,-1,0,1,0],HowlerGlobal.prototype.stereo=function(t){var e=this;if(!e.ctx||!e.ctx.listener)return e;for(var n=e._howls.length-1;n>=0;n--)e._howls[n].stereo(t);return e},HowlerGlobal.prototype.pos=function(t,e,n){var r=this;return r.ctx&&r.ctx.listener?(e="number"!=typeof e?r._pos[1]:e,n="number"!=typeof n?r._pos[2]:n,"number"!=typeof t?r._pos:(r._pos=[t,e,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(t,e,n,r,o,i){var a=this;if(!a.ctx||!a.ctx.listener)return a;var s=a._orientation;return e="number"!=typeof e?s[1]:e,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 t?s:(a._orientation=[t,e,n,r,o,i],void 0!==a.ctx.listener.forwardX?(a.ctx.listener.forwardX.setTargetAtTime(t,Howler.ctx.currentTime,.1),a.ctx.listener.forwardY.setTargetAtTime(e,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(t,e,n,r,o,i),a)},Howl.prototype.init=(t=Howl.prototype.init,function(e){var n=this;return n._orientation=e.orientation||[1,0,0],n._stereo=e.stereo||null,n._pos=e.pos||null,n._pannerAttr={coneInnerAngle:void 0!==e.coneInnerAngle?e.coneInnerAngle:360,coneOuterAngle:void 0!==e.coneOuterAngle?e.coneOuterAngle:360,coneOuterGain:void 0!==e.coneOuterGain?e.coneOuterGain:0,distanceModel:void 0!==e.distanceModel?e.distanceModel:"inverse",maxDistance:void 0!==e.maxDistance?e.maxDistance:1e4,panningModel:void 0!==e.panningModel?e.panningModel:"HRTF",refDistance:void 0!==e.refDistance?e.refDistance:1,rolloffFactor:void 0!==e.rolloffFactor?e.rolloffFactor:1},n._onstereo=e.onstereo?[{fn:e.onstereo}]:[],n._onpos=e.onpos?[{fn:e.onpos}]:[],n._onorientation=e.onorientation?[{fn:e.onorientation}]:[],t.call(this,e)}),Howl.prototype.stereo=function(t,n){var r=this;if(!r._webAudio)return r;if("loaded"!==r._state)return r._queue.push({event:"stereo",action:function(){r.stereo(t,n)}}),r;var o=void 0===Howler.ctx.createStereoPanner?"spatial":"stereo";if(void 0===n){if("number"!=typeof t)return r._stereo;r._stereo=t,r._pos=[t,0,0]}for(var i=r._getSoundIds(n),a=0;a<i.length;a++){var s=r._soundById(i[a]);if(s){if("number"!=typeof t)return s._stereo;s._stereo=t,s._pos=[t,0,0],s._node&&(s._pannerAttr.panningModel="equalpower",s._panner&&s._panner.pan||e(s,o),"spatial"===o?void 0!==s._panner.positionX?(s._panner.positionX.setValueAtTime(t,Howler.ctx.currentTime),s._panner.positionY.setValueAtTime(0,Howler.ctx.currentTime),s._panner.positionZ.setValueAtTime(0,Howler.ctx.currentTime)):s._panner.setPosition(t,0,0):s._panner.pan.setValueAtTime(t,Howler.ctx.currentTime)),r._emit("stereo",s._id)}}return r},Howl.prototype.pos=function(t,n,r,o){var i=this;if(!i._webAudio)return i;if("loaded"!==i._state)return i._queue.push({event:"pos",action:function(){i.pos(t,n,r,o)}}),i;if(n="number"!=typeof n?0:n,r="number"!=typeof r?-.5:r,void 0===o){if("number"!=typeof t)return i._pos;i._pos=[t,n,r]}for(var a=i._getSoundIds(o),s=0;s<a.length;s++){var u=i._soundById(a[s]);if(u){if("number"!=typeof t)return u._pos;u._pos=[t,n,r],u._node&&(u._panner&&!u._panner.pan||e(u,"spatial"),void 0!==u._panner.positionX?(u._panner.positionX.setValueAtTime(t,Howler.ctx.currentTime),u._panner.positionY.setValueAtTime(n,Howler.ctx.currentTime),u._panner.positionZ.setValueAtTime(r,Howler.ctx.currentTime)):u._panner.setPosition(t,n,r)),i._emit("pos",u._id)}}return i},Howl.prototype.orientation=function(t,n,r,o){var i=this;if(!i._webAudio)return i;if("loaded"!==i._state)return i._queue.push({event:"orientation",action:function(){i.orientation(t,n,r,o)}}),i;if(n="number"!=typeof n?i._orientation[1]:n,r="number"!=typeof r?i._orientation[2]:r,void 0===o){if("number"!=typeof t)return i._orientation;i._orientation=[t,n,r]}for(var a=i._getSoundIds(o),s=0;s<a.length;s++){var u=i._soundById(a[s]);if(u){if("number"!=typeof t)return u._orientation;u._orientation=[t,n,r],u._node&&(u._panner||(u._pos||(u._pos=i._pos||[0,0,-.5]),e(u,"spatial")),void 0!==u._panner.orientationX?(u._panner.orientationX.setValueAtTime(t,Howler.ctx.currentTime),u._panner.orientationY.setValueAtTime(n,Howler.ctx.currentTime),u._panner.orientationZ.setValueAtTime(r,Howler.ctx.currentTime)):u._panner.setOrientation(t,n,r)),i._emit("orientation",u._id)}}return i},Howl.prototype.pannerAttr=function(){var t,n,r,o=this,i=arguments;if(!o._webAudio)return o;if(0===i.length)return o._pannerAttr;if(1===i.length){if("object"!=typeof i[0])return(r=o._soundById(parseInt(i[0],10)))?r._pannerAttr:o._pannerAttr;t=i[0],void 0===n&&(t.pannerAttr||(t.pannerAttr={coneInnerAngle:t.coneInnerAngle,coneOuterAngle:t.coneOuterAngle,coneOuterGain:t.coneOuterGain,distanceModel:t.distanceModel,maxDistance:t.maxDistance,refDistance:t.refDistance,rolloffFactor:t.rolloffFactor,panningModel:t.panningModel}),o._pannerAttr={coneInnerAngle:void 0!==t.pannerAttr.coneInnerAngle?t.pannerAttr.coneInnerAngle:o._coneInnerAngle,coneOuterAngle:void 0!==t.pannerAttr.coneOuterAngle?t.pannerAttr.coneOuterAngle:o._coneOuterAngle,coneOuterGain:void 0!==t.pannerAttr.coneOuterGain?t.pannerAttr.coneOuterGain:o._coneOuterGain,distanceModel:void 0!==t.pannerAttr.distanceModel?t.pannerAttr.distanceModel:o._distanceModel,maxDistance:void 0!==t.pannerAttr.maxDistance?t.pannerAttr.maxDistance:o._maxDistance,refDistance:void 0!==t.pannerAttr.refDistance?t.pannerAttr.refDistance:o._refDistance,rolloffFactor:void 0!==t.pannerAttr.rolloffFactor?t.pannerAttr.rolloffFactor:o._rolloffFactor,panningModel:void 0!==t.pannerAttr.panningModel?t.pannerAttr.panningModel:o._panningModel})}else 2===i.length&&(t=i[0],n=parseInt(i[1],10));for(var a=o._getSoundIds(n),s=0;s<a.length;s++)if(r=o._soundById(a[s])){var u=r._pannerAttr;u={coneInnerAngle:void 0!==t.coneInnerAngle?t.coneInnerAngle:u.coneInnerAngle,coneOuterAngle:void 0!==t.coneOuterAngle?t.coneOuterAngle:u.coneOuterAngle,coneOuterGain:void 0!==t.coneOuterGain?t.coneOuterGain:u.coneOuterGain,distanceModel:void 0!==t.distanceModel?t.distanceModel:u.distanceModel,maxDistance:void 0!==t.maxDistance?t.maxDistance:u.maxDistance,refDistance:void 0!==t.refDistance?t.refDistance:u.refDistance,rolloffFactor:void 0!==t.rolloffFactor?t.rolloffFactor:u.rolloffFactor,panningModel:void 0!==t.panningModel?t.panningModel:u.panningModel};var c=r._panner;c||(r._pos||(r._pos=o._pos||[0,0,-.5]),e(r,"spatial"),c=r._panner),c.coneInnerAngle=u.coneInnerAngle,c.coneOuterAngle=u.coneOuterAngle,c.coneOuterGain=u.coneOuterGain,c.distanceModel=u.distanceModel,c.maxDistance=u.maxDistance,c.refDistance=u.refDistance,c.rolloffFactor=u.rolloffFactor,c.panningModel=u.panningModel}return o},Sound.prototype.init=function(t){return function(){var e=this,n=e._parent;e._orientation=n._orientation,e._stereo=n._stereo,e._pos=n._pos,e._pannerAttr=n._pannerAttr,t.call(this),e._stereo?n.stereo(e._stereo):e._pos&&n.pos(e._pos[0],e._pos[1],e._pos[2],e._id)}}(Sound.prototype.init),Sound.prototype.reset=function(t){return function(){var e=this,n=e._parent;return e._orientation=n._orientation,e._stereo=n._stereo,e._pos=n._pos,e._pannerAttr=n._pannerAttr,e._stereo?n.stereo(e._stereo):e._pos?n.pos(e._pos[0],e._pos[1],e._pos[2],e._id):e._panner&&(e._panner.disconnect(0),e._panner=void 0,n._refreshBuffer(e)),t.call(this)}}(Sound.prototype.reset);var e=function(t,e){"spatial"===(e=e||"spatial")?(t._panner=Howler.ctx.createPanner(),t._panner.coneInnerAngle=t._pannerAttr.coneInnerAngle,t._panner.coneOuterAngle=t._pannerAttr.coneOuterAngle,t._panner.coneOuterGain=t._pannerAttr.coneOuterGain,t._panner.distanceModel=t._pannerAttr.distanceModel,t._panner.maxDistance=t._pannerAttr.maxDistance,t._panner.refDistance=t._pannerAttr.refDistance,t._panner.rolloffFactor=t._pannerAttr.rolloffFactor,t._panner.panningModel=t._pannerAttr.panningModel,void 0!==t._panner.positionX?(t._panner.positionX.setValueAtTime(t._pos[0],Howler.ctx.currentTime),t._panner.positionY.setValueAtTime(t._pos[1],Howler.ctx.currentTime),t._panner.positionZ.setValueAtTime(t._pos[2],Howler.ctx.currentTime)):t._panner.setPosition(t._pos[0],t._pos[1],t._pos[2]),void 0!==t._panner.orientationX?(t._panner.orientationX.setValueAtTime(t._orientation[0],Howler.ctx.currentTime),t._panner.orientationY.setValueAtTime(t._orientation[1],Howler.ctx.currentTime),t._panner.orientationZ.setValueAtTime(t._orientation[2],Howler.ctx.currentTime)):t._panner.setOrientation(t._orientation[0],t._orientation[1],t._orientation[2])):(t._panner=Howler.ctx.createStereoPanner(),t._panner.pan.setValueAtTime(t._stereo,Howler.ctx.currentTime)),t._panner.connect(t._node),t._paused||t._parent.pause(t._id,!0).play(t._id,!0)}}()},20:(t,e,n)=>{"use strict";var r=n(12),o=Symbol.for("react.element"),i=Symbol.for("react.fragment"),a=Object.prototype.hasOwnProperty,s=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,u={key:!0,ref:!0,__self:!0,__source:!0};
23
+ /**
24
+ * @license React
25
+ * react-jsx-runtime.production.min.js
26
+ *
27
+ * Copyright (c) Facebook, Inc. and its affiliates.
28
+ *
29
+ * This source code is licensed under the MIT license found in the
30
+ * LICENSE file in the root directory of this source tree.
31
+ */function c(t,e,n){var r,i={},c=null,l=null;for(r in void 0!==n&&(c=""+n),void 0!==e.key&&(c=""+e.key),void 0!==e.ref&&(l=e.ref),e)a.call(e,r)&&!u.hasOwnProperty(r)&&(i[r]=e[r]);if(t&&t.defaultProps)for(r in e=t.defaultProps)void 0===i[r]&&(i[r]=e[r]);return{$$typeof:o,type:t,key:c,ref:l,props:i,_owner:s.current}}e.jsx=c,e.jsxs=c},848:(t,e,n)=>{"use strict";t.exports=n(20)},72:t=>{"use strict";var e=[];function n(t){for(var n=-1,r=0;r<e.length;r++)if(e[r].identifier===t){n=r;break}return n}function r(t,r){for(var i={},a=[],s=0;s<t.length;s++){var u=t[s],c=r.base?u[0]+r.base:u[0],l=i[c]||0,f="".concat(c," ").concat(l);i[c]=l+1;var d=n(f),p={css:u[1],media:u[2],sourceMap:u[3],supports:u[4],layer:u[5]};if(-1!==d)e[d].references++,e[d].updater(p);else{var h=o(p,r);r.byIndex=s,e.splice(s,0,{identifier:f,updater:h,references:1})}a.push(f)}return a}function o(t,e){var n=e.domAPI(e);n.update(t);return function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap&&e.supports===t.supports&&e.layer===t.layer)return;n.update(t=e)}else n.remove()}}t.exports=function(t,o){var i=r(t=t||[],o=o||{});return function(t){t=t||[];for(var a=0;a<i.length;a++){var s=n(i[a]);e[s].references--}for(var u=r(t,o),c=0;c<i.length;c++){var l=n(i[c]);0===e[l].references&&(e[l].updater(),e.splice(l,1))}i=u}}},659:t=>{"use strict";var e={};t.exports=function(t,n){var r=function(t){if(void 0===e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(t){n=null}e[t]=n}return e[t]}(t);if(!r)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");r.appendChild(n)}},540:t=>{"use strict";t.exports=function(t){var e=document.createElement("style");return t.setAttributes(e,t.attributes),t.insert(e,t.options),e}},56:(t,e,n)=>{"use strict";t.exports=function(t){var e=n.nc;e&&t.setAttribute("nonce",e)}},825:t=>{"use strict";t.exports=function(t){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var e=t.insertStyleElement(t);return{update:function(n){!function(t,e,n){var r="";n.supports&&(r+="@supports (".concat(n.supports,") {")),n.media&&(r+="@media ".concat(n.media," {"));var o=void 0!==n.layer;o&&(r+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),r+=n.css,o&&(r+="}"),n.media&&(r+="}"),n.supports&&(r+="}");var i=n.sourceMap;i&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(i))))," */")),e.styleTagTransform(r,t,e.options)}(e,t,n)},remove:function(){!function(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t)}(e)}}}},113:t=>{"use strict";t.exports=function(t,e){if(e.styleSheet)e.styleSheet.cssText=t;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(t))}}},12:e=>{"use strict";e.exports=t}},n={};function r(t){var o=n[t];if(void 0!==o)return o.exports;var i=n[t]={id:t,exports:{}};return e[t](i,i.exports,r),i.exports}r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.nc=void 0;var o={};return(()=>{"use strict";function t(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */t=function(){return n};var e,n={},r=Object.prototype,o=r.hasOwnProperty,i=Object.defineProperty||function(t,e,n){t[e]=n.value},a="function"==typeof Symbol?Symbol:{},s=a.iterator||"@@iterator",u=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(e){l=function(t,e,n){return t[e]=n}}function d(t,e,n,r){var o=e&&e.prototype instanceof b?e:b,a=Object.create(o.prototype),s=new I(r||[]);return i(a,"_invoke",{value:O(t,n,s)}),a}function p(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}n.wrap=d;var h="suspendedStart",y="suspendedYield",v="executing",m="completed",g={};function b(){}function w(){}function _(){}var S={};l(S,s,(function(){return this}));var k=Object.getPrototypeOf,x=k&&k(k(M([])));x&&x!==r&&o.call(x,s)&&(S=x);var A=_.prototype=b.prototype=Object.create(S);function T(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function E(t,e){function n(r,i,a,s){var u=p(t[r],t,i);if("throw"!==u.type){var c=u.arg,l=c.value;return l&&"object"==f(l)&&o.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,s)}),(function(t){n("throw",t,a,s)})):e.resolve(l).then((function(t){c.value=t,a(c)}),(function(t){return n("throw",t,a,s)}))}s(u.arg)}var r;i(this,"_invoke",{value:function(t,o){function i(){return new e((function(e,r){n(t,o,e,r)}))}return r=r?r.then(i,i):i()}})}function O(t,n,r){var o=h;return function(i,a){if(o===v)throw Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:e,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var u=P(s,r);if(u){if(u===g)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===h)throw o=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=v;var c=p(t,n,r);if("normal"===c.type){if(o=r.done?m:y,c.arg===g)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(o=m,r.method="throw",r.arg=c.arg)}}}function P(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,P(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var i=p(o,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,g;var a=i.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,g):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function j(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function C(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function I(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(j,this),this.reset(!0)}function M(t){if(t||""===t){var n=t[s];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,i=function n(){for(;++r<t.length;)if(o.call(t,r))return n.value=t[r],n.done=!1,n;return n.value=e,n.done=!0,n};return i.next=i}}throw new TypeError(f(t)+" is not iterable")}return w.prototype=_,i(A,"constructor",{value:_,configurable:!0}),i(_,"constructor",{value:w,configurable:!0}),w.displayName=l(_,c,"GeneratorFunction"),n.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===w||"GeneratorFunction"===(e.displayName||e.name))},n.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,_):(t.__proto__=_,l(t,c,"GeneratorFunction")),t.prototype=Object.create(A),t},n.awrap=function(t){return{__await:t}},T(E.prototype),l(E.prototype,u,(function(){return this})),n.AsyncIterator=E,n.async=function(t,e,r,o,i){void 0===i&&(i=Promise);var a=new E(d(t,e,r,o),i);return n.isGeneratorFunction(e)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},T(A),l(A,c,"Generator"),l(A,s,(function(){return this})),l(A,"toString",(function(){return"[object Generator]"})),n.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},n.values=M,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(C),!t)for(var n in this)"t"===n.charAt(0)&&o.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function r(r,o){return s.type="throw",s.arg=t,n.next=r,o&&(n.method="next",n.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var u=o.call(a,"catchLoc"),c=o.call(a,"finallyLoc");if(u&&c){if(this.prev<a.catchLoc)return r(a.catchLoc,!0);if(this.prev<a.finallyLoc)return r(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return r(a.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return r(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,g):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),g},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),C(n),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;C(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:M(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),g}},n}function e(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=c(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,s(r.key),r)}}function a(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function s(t){var e=function(t,e){if("object"!=f(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=f(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==f(e)?e:e+""}function u(t){return function(t){if(Array.isArray(t))return l(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||c(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(t,e){if(t){if("string"==typeof t)return l(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?l(t,e):void 0}}function l(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function f(t){return f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},f(t)}r.r(o),r.d(o,{Align:()=>_e,Character:()=>jt,ColoredSentence:()=>Lt,CommonPosition:()=>be,CommonPositionType:()=>se,Condition:()=>Ls,Control:()=>Us,Coord2D:()=>we,Dissolve:()=>Yf,Fade:()=>If,FadeIn:()=>Bf,Game:()=>Yt,GameProviders:()=>wf,GameState:()=>H,Image:()=>ka,Isolated:()=>it,Lambda:()=>Ms,LiveGame:()=>Xt,Menu:()=>Ks,Player:()=>gf,Say:()=>Mt,Scene:()=>Au,Script:()=>Mu,Sentence:()=>Et,Sound:()=>fu,SoundType:()=>nu,Story:()=>$u,Transform:()=>ya,Utils:()=>gs,Word:()=>Pt,useGame:()=>pt});var d=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{u(r.next(t))}catch(t){i(t)}}function s(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))};function p(t,e){var n=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r={},o=function(t,e,n){return"object"!==f(e)||null===e||Array.isArray(e)||"object"!==f(n)||null===n||Array.isArray(n)?Array.isArray(e)&&Array.isArray(n)?e.map((function(t,e){return"object"===f(t)&&null!==t&&!Array.isArray(t)&&n[e]?p(t,n[e]):t})):void 0!==n?n:e:e.constructor!==Object||n.constructor!==Object?n||e:p(e,n)};for(var i in t)n(t,i)&&(r[i]=o(0,t[i],e[i]));for(var a in e)n(e,a)&&!n(r,a)&&("object"===f(e[a])&&null!==e[a]?e[a].constructor!==Object?r[a]=e[a]:r[a]=p({},e[a]):r[a]=e[a]);for(var s=arguments.length,c=new Array(s>2?s-2:0),l=2;l<s;l++)c[l-2]=arguments[l];if(c.length){var d=c[0],h=c.slice(1);return p.apply(void 0,[r,d].concat(u(h)))}return r}var h=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(t){return t};n(this,t),this.solved=!1,this.listeners=[],this.receiver=e}return a(t,[{key:"resolve",value:function(t){if(!this.solved){this.result=this.receiver(t),this.solved=!0;var n,r=e(this.listeners);try{for(r.s();!(n=r.n()).done;){(0,n.value)(this.result)}}catch(t){r.e(t)}finally{r.f()}}}},{key:"then",value:function(t){this.result?t(this.result):this.listeners.push(t)}}],[{key:"isAwaitable",value:function(e){return e instanceof t}}])}();function y(t){var n=new WeakSet;return function t(r){if(null===r||"object"!==f(r))return r;if(!n.has(r)){if(n.add(r),Array.isArray(r)){var o,i=[],a=e(r);try{for(a.s();!(o=a.n()).done;){var s=o.value;i.push(t(s))}}catch(t){a.e(t)}finally{a.f()}return i}var u={};for(var c in r)Object.prototype.hasOwnProperty.call(r,c)&&(u[c]=t(r[c]));return u}}(t)}function v(t){return"string"==typeof t?t:"#".concat((t.r||0).toString(16).padStart(2,"0")).concat((t.g||0).toString(16).padStart(2,"0")).concat((t.b||0).toString(16).padStart(2,"0")).concat(void 0!==t.a?t.a.toString(16).padStart(2,"0"):"")}var m=function(){return a((function t(){n(this,t),this.events={}}),[{key:"on",value:function(t,e){return this.events[t]||(this.events[t]=[]),this.events[t].push(e),this.emit("event:EventDispatcher.register",t,e),e}},{key:"onEvents",value:function(t){var e=this,n=t.map((function(t){var n=t.type,r=t.listener;return{type:n,listener:r,cancel:function(){e.off(n,r)}}}));return{tokens:n,cancel:function(){n.forEach((function(t){return t.cancel()}))}}}},{key:"off",value:function(t,e){this.events[t]&&(this.events[t]=this.events[t].filter((function(t){return t!==e})))}},{key:"emit",value:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];this.events[t]&&this.events[t].forEach((function(t){t.apply(void 0,n)}))}},{key:"once",value:function(t,e){var n=this,r=function(){e.apply(void 0,arguments),n.off(t,r)};return this.on(t,r)}},{key:"any",value:function(n){for(var r=arguments.length,o=new Array(r>1?r-1:0),i=1;i<r;i++)o[i-1]=arguments[i];return d(this,void 0,void 0,t().mark((function r(){var i,a,s,u,c,l=this;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:this.events[n]||(this.events[n]=[]),i=[],a=e(this.events[n]);try{for(a.s();!(s=a.n()).done;)u=s.value,(c=u.apply(void 0,o))&&"object"===f(c)&&"function"==typeof c.then&&i.push(c)}catch(t){a.e(t)}finally{a.f()}if(this.events[n]=this.events[n].filter((function(t){return!i.includes(t)})),0!==i.length){t.next=7;break}return t.abrupt("return",new Promise((function(t){var e=l.on("event:EventDispatcher.register",(function(r,i){if(r===n){l.off(r,e);var a=null==i?void 0:i.apply(void 0,o);a&&a.then?a.then(t):t(a)}}))})));case 7:return t.next=9,Promise.all(i);case 9:return t.abrupt("return",void 0);case 10:case"end":return t.stop()}}),r,this)})))}}])}();function g(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(new Error).stack;return n?n.split("\n").slice(t+1,-e).join("\n").trim():""}function b(t){return new Promise((function(e){return setTimeout(e,t)}))}function w(t,e){if(t===e)return!0;if("object"!==f(t)||"object"!==f(e)||null===t||null===e)return!1;var n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(var o=0,i=n;o<i.length;o++){var a=i[o];if(!r.includes(a)||!w(t[a],e[a]))return!1}return!0}var _=function(){return a((function t(){n(this,t)}),[{key:"_log",value:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return 0===n.length?t:["[".concat(t,"]")].concat(n)}},{key:"log",value:function(t){for(var e,n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];(e=console).log.apply(e,u(this._log.apply(this,[t].concat(r))))}},{key:"info",value:function(t){for(var e,n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];(e=console).info.apply(e,u(this._log.apply(this,[t].concat(r))))}},{key:"warn",value:function(t){for(var e,n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];(e=console).warn.apply(e,u(this._log.apply(this,[t].concat(r))))}},{key:"error",value:function(t){for(var e,n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];(e=console).error.apply(e,u(this._log.apply(this,[t].concat(r))))}},{key:"debug",value:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];console.debug(this._log.apply(this,[t].concat(n)))}},{key:"trace",value:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];console.trace(this._log.apply(this,[t].concat(n)))}}])}();function S(t){return S="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},S(t)}function k(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,s=[],u=!0,c=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(s.push(r.value),s.length!==e);u=!0);}catch(t){c=!0,o=t}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(t,e)||function(t,e){if(t){if("string"==typeof t)return x(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?x(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function x(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function A(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function T(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,O(r.key),r)}}function E(t,e,n){return e&&T(t.prototype,e),n&&T(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function O(t){var e=function(t,e){if("object"!=S(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=S(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==S(e)?e:e+""}var P=function(){function t(e,n,r){A(this,t),this.name=e,this.key=r||e,this.content=n}return E(t,[{key:"set",value:function(e,n){return t.isSerializable(n)?(this.content[e]=n,this):(console.warn('Value "'.concat(n,'" in key "').concat(String(e),'" is not serializable, and will not be set\nat namespace "').concat(this.name,'"')),this.content[e]=n,this)}},{key:"get",value:function(t){return this.content[t]}},{key:"toData",value:function(){return this.serialize()}},{key:"load",value:function(t){t?this.content=t:console.warn("No data to load")}},{key:"serialize",value:function(){var t=this,e={};return Object.entries(this.content).forEach((function(n){var r=k(n,2),o=r[0],i=r[1];e[o]=t.wrap(i)})),e}},{key:"deserialize",value:function(t){var e=this;t?Object.entries(t).forEach((function(t){var n=k(t,2),r=n[0],o=n[1];e.content[r]=e.unwrap(o)})):console.warn("No data to load")}},{key:"toTypeName",value:function(t){return t instanceof Date?"date":"any"}},{key:"wrap",value:function(t){return{any:function(t){return{type:"any",data:t}},date:function(t){return{type:"date",data:t.toString()}}}[this.toTypeName(t)](t)}},{key:"unwrap",value:function(t){var e={any:function(t){return t.data},date:function(t){return new Date(t.data)}};return e[t.type](t)}}],[{key:"isSerializable",value:function(e){return!!["number","string","boolean"].includes(S(e))||(e instanceof Date||(null==e||(Array.isArray(e)?e.every(t.isSerializable):"object"===S(e)&&(Object.getPrototypeOf(e)===Object.prototype&&Object.values(e).every(t.isSerializable)))))}}])}(),j=function(){return E((function t(){A(this,t),this.namespaces={}}),[{key:"addNamespace",value:function(t){return this.namespaces[t.key]=t,this}},{key:"getNamespace",value:function(t){return this.namespaces[t]}},{key:"setNamespace",value:function(t,e){return this.namespaces[t]=e,this}},{key:"getNamespaces",value:function(){return this.namespaces}},{key:"keys",value:function(){return Object.keys(this.namespaces)}},{key:"values",value:function(){return Object.values(this.namespaces)}},{key:"entries",value:function(){return Object.entries(this.namespaces)}},{key:"toData",value:function(){return this.entries().reduce((function(t,e){var n=k(e,2),r=n[0],o=n[1];return t[r]=o.toData(),t}),{})}},{key:"load",value:function(t){var e=this;t?Object.entries(t).forEach((function(t){var n=k(t,2),r=n[0],o=n[1];e.namespaces[r]?e.namespaces[r].load(o):console.warn("Namespace ".concat(r," not found in ").concat(e.constructor.name))})):console.warn("No data to load")}}])}();function C(t){return C="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},C(t)}function I(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,M(r.key),r)}}function M(t){var e=function(t,e){if("object"!=C(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=C(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==C(e)?e:e+""}var L=r(196);function N(t){return N="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},N(t)}function F(t){return function(t){if(Array.isArray(t))return t}(t)||D(t)||V(t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function R(t){return function(t){if(Array.isArray(t))return B(t)}(t)||D(t)||V(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function V(t,e){if(t){if("string"==typeof t)return B(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?B(t,e):void 0}}function D(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function B(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function $(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,U(r.key),r)}}function U(t){var e=function(t,e){if("object"!=N(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=N(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==N(e)?e:e+""}var H=function(){return function(t,e,n){return e&&$(t.prototype,e),n&&$(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}((function t(e,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.state={sounds:[],srcManagers:[],elements:[]},this.currentHandling=null,this.logger=new _,this.stage=n,this.game=e,this.events=new m}),[{key:"findElementByScene",value:function(t){return this.state.elements.find((function(e){return e.scene===t}))||null}},{key:"findElementByImage",value:function(t){return this.state.elements.find((function(e){return e.ele.images.includes(t)}))||null}},{key:"addScene",value:function(t){return this.sceneExists(t)||this.state.elements.push({scene:t,ele:this.getElementMap()}),this}},{key:"popScene",value:function(){var t=this.state.elements.pop();return t?(this.removeElements(t.scene),this):this}},{key:"removeScene",value:function(t){return this.removeElements(t),this}},{key:"getSceneElements",value:function(){return this.state.elements}},{key:"getLastScene",value:function(){var t;return(null===(t=this.state.elements[this.state.elements.length-1])||void 0===t?void 0:t.scene)||null}},{key:"sceneExists",value:function(t){return t?this.state.elements.some((function(e){return e.scene===t})):!!this.getLastScene()}},{key:"handle",value:function(t){return this.currentHandling===t||(this.currentHandling=t,t.type),this}},{key:"createText",value:function(t,e,n,r){var o,i=null===(o=this.findElementByScene(this._getLastSceneIfNot(r)))||void 0===o?void 0:o.ele.texts;if(!i)throw new Error("Scene not found");var a=this.createWaitableAction({character:e.character,sentence:e,id:t},(function(){i.splice(i.indexOf(a),1),n&&n()}));i.push(a)}},{key:"createMenu",value:function(t,e,n){var r;if(!t.choices.length)throw new Error("Menu must have at least one choice");var o=null===(r=this.findElementByScene(this._getLastSceneIfNot(n)))||void 0===r?void 0:r.ele.menus;if(!o)throw new Error("Scene not found");var i=this.createWaitableAction(t,(function(t){o.splice(o.indexOf(i),1),e&&e(t)}));o.push(i)}},{key:"createImage",value:function(t,e){var n=this._getLastSceneIfNot(e),r=this.findElementByScene(n);return r?(r.ele.images.push(t),this):this}},{key:"disposeImage",value:function(t,e){var n,r=this._getLastSceneIfNot(e),o=null===(n=this.findElementByScene(r))||void 0===n?void 0:n.ele.images;if(!o)throw new Error("Scene not found");var i=o.indexOf(t);if(-1===i)throw new Error("Image not found");return o.splice(i,1),this}},{key:"playSound",value:function(t,e){var n=t.play(),r=[t.once("end",o.bind(this)),t.once("stop",o.bind(this))];function o(){e&&e(),r.forEach((function(t){return t.off()})),this.stage.next()}return n}},{key:"getHowl",value:function(){return L.Howl}},{key:"animateImage",value:function(t,e,n,r){return this.anyEvent.apply(this,[t,e,r].concat(R(n)))}},{key:"registerSrcManager",value:function(t){return this.state.srcManagers.push(t),this}},{key:"offSrcManager",value:function(t){return this.state.srcManagers=this.state.srcManagers.filter((function(e){return e!==t})),this}},{key:"getStorable",value:function(){return this.game.getLiveGame().getStorable()}},{key:"toData",value:function(){return{elements:this.state.elements.map((function(t){return{scene:t.scene.id,ele:{images:t.ele.images.map((function(t){return t.id}))}}}))}}},{key:"loadData",value:function(t,e){var n=this;this.state.elements=[];var r=this.game.getLiveGame().story;if(!r)throw new Error("No story loaded");var o=r.getAllElements(e);t.elements.forEach((function(t){var e=F(r.findElementsByIds([t.scene].concat(R(t.ele.images)),o)),i={scene:e[0],ele:{images:e.slice(1),menus:[],texts:[]}};n.state.elements.push(i),n.state.srcManagers.push(i.scene.srcManager)}))}},{key:"getElementMap",value:function(){return{texts:[],menus:[],images:[]}}},{key:"removeElements",value:function(t){var e=this.state.elements.findIndex((function(e){return e.scene===t}));return-1===e||this.state.elements.splice(e,1),this}},{key:"_getLastSceneIfNot",value:function(t){var e=t||this.getLastScene();if(!e||!this.sceneExists(e))throw new Error('Scene not found, please call "scene.activate()" first.');return e}},{key:"anyEvent",value:function(t,e,n){for(var r,o=this,i=arguments.length,a=new Array(i>3?i-3:0),s=3;s<i;s++)a[s-3]=arguments[s];(r=e.events).any.apply(r,[t].concat(a)).then(n).then((function(){o.stage.next()}))}},{key:"createWaitableAction",value:function(t,e){return{action:t,onClick:function(t){e&&e(t)}}}}])}();function G(t){var e,n,r="";if("string"==typeof t||"number"==typeof t)r+=t;else if("object"==typeof t)if(Array.isArray(t)){var o=t.length;for(e=0;e<o;e++)t[e]&&(n=G(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}H.EventTypes={"event:state.ready":"event:state.ready","event:state.end":"event:state.end"};const z=function(){for(var t,e,n=0,r="",o=arguments.length;n<o;n++)(t=arguments[n])&&(e=G(t))&&(r&&(r+=" "),r+=e);return r};var W=r(12),q=r.n(W);function Y(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,s=[],u=!0,c=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(s.push(r.value),s.length!==e);u=!0);}catch(t){c=!0,o=t}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(t,e)||function(t,e){if(t){if("string"==typeof t)return X(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?X(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function X(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function K(t){return K="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},K(t)}function Z(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Q(r.key),r)}}function Q(t){var e=function(t,e){if("object"!=K(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=K(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==K(e)?e:e+""}var J=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.state={width:0,height:0,minWidth:800,minHeight:450,paused:!1},this.events=new m,this.lockers=[],this.updater=null}return function(t,e,n){return e&&Z(t.prototype,e),n&&Z(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}(t,[{key:"update",value:function(e,n){this.state.width=e,this.state.height=n,this.events.emit(t.EventTypes["event:aspectRatio.update"],e,n)}},{key:"updateMin",value:function(t,e){this.state.minWidth=t,this.state.minHeight=e}},{key:"lock",value:function(){var t=Symbol();return this.lockers.push(t),t}},{key:"unlock",value:function(t){if(t&&!this.lockers.includes(t))throw new Error("Locker not found");return this.lockers=this.lockers.filter((function(e){return e!==t})),this.triggerUpdate(),null}},{key:"isLocked",value:function(){return!!this.lockers.length}},{key:"getStyle",value:function(){return{width:"".concat(this.state.width,"px"),height:"".concat(this.state.height,"px")}}},{key:"setUpdate",value:function(t){this.updater=t}},{key:"pause",value:function(){this.state.paused=!0,this.events.emit(t.EventTypes["event:aspectRatio.pause"])}},{key:"resume",value:function(){this.state.paused=!1,this.events.emit(t.EventTypes["event:aspectRatio.resume"])}},{key:"onUpdate",value:function(e){var n=this;return this.events.on(t.EventTypes["event:aspectRatio.update"],e),function(){n.events.off(t.EventTypes["event:aspectRatio.update"],e)}}},{key:"triggerUpdate",value:function(){this.updater&&this.updater()}}])}();J.EventTypes={"event:aspectRatio.update":"event:aspectRatio.update","event:aspectRatio.pause":"event:aspectRatio.pause","event:aspectRatio.resume":"event:aspectRatio.resume"};var tt=(0,W.createContext)(null);function et(t){var e=t.children,n=Y((0,W.useState)(new J),1)[0];return q().createElement(tt.Provider,{value:{ratio:n}},e)}function nt(){if(!tt)throw new Error("useRatio must be used within a RatioProvider");return(0,W.useContext)(tt)}function rt(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,s=[],u=!0,c=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(s.push(r.value),s.length!==e);u=!0);}catch(t){c=!0,o=t}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(t,e)||function(t,e){if(t){if("string"==typeof t)return ot(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ot(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ot(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function it(t){var e=t.children,n=t.className,r=nt().ratio,o=rt(q().useReducer((function(t){return t+1}),0),2)[1];(0,W.useEffect)((function(){return r.onUpdate((function(){o()}))}));var i=r.getStyle();return q().createElement("div",{className:z("inset-0 flex items-center justify-center",n),style:{width:"100%",height:"100%",minWidth:"".concat(r.state.minWidth,"px"),minHeight:"".concat(r.state.minHeight,"px")}},q().createElement("div",{style:Object.assign(Object.assign({},i),{position:"relative"})},e))}function at(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,s=[],u=!0,c=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(s.push(r.value),s.length!==e);u=!0);}catch(t){c=!0,o=t}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(t,e)||function(t,e){if(t){if("string"==typeof t)return st(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?st(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function st(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}const ut=function(t){var e=t.text,n=t.speed,r=t.onComplete,o=t.className,i=at((0,W.useState)(""),2),a=i[0],s=i[1],u=at((0,W.useState)(0),2),c=u[0],l=u[1];return(0,W.useEffect)((function(){if(c<e.length){if(" "!==e[c]){var t=setTimeout((function(){s((function(t){return t+e[c]})),l((function(t){return t+1}))}),n);return function(){return clearTimeout(t)}}s((function(t){return t+" "})),l((function(t){return t+1}))}else r&&r()}),[c,e,n,r]),q().createElement("span",{className:o},a)};function ct(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,s=[],u=!0,c=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(s.push(r.value),s.length!==e);u=!0);}catch(t){c=!0,o=t}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(t,e)||function(t,e){if(t){if("string"==typeof t)return lt(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?lt(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function lt(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}var ft=q().createContext(null);function dt(t){var e=t.children,n=t.game,r=new Yt({}),o=ct((0,W.useState)(n||r),2),i=o[0],a=o[1];return q().createElement(ft.Provider,{value:{game:i,setGame:a}},e)}function pt(){var t=(0,W.useContext)(ft);if(!t)throw new Error("useGame must be used within a GameProvider");return t}function ht(t){return ht="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ht(t)}function yt(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,vt(r.key),r)}}function vt(t){var e=function(t,e){if("object"!=ht(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=ht(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==ht(e)?e:e+""}var mt=function(){return function(t,e,n){return e&&yt(t.prototype,e),n&&yt(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}((function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t.IdPrefixes.Actionable;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.actions=[],this.id=Yt.getIdManager().prefix(e,Yt.getIdManager().getStringId(),"-")}),[{key:"toActions",value:function(){var t=this.actions;return this.actions=[],t}},{key:"toData",value:function(){return null}},{key:"fromData",value:function(t){return this}}])}();function gt(t){return gt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},gt(t)}function bt(t,e,n){return e=_t(e),function(t,e){if(e&&("object"==gt(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,wt()?Reflect.construct(e,n||[],_t(t).constructor):e.apply(t,n))}function wt(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(wt=function(){return!!t})()}function _t(t){return _t=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},_t(t)}function St(t,e){return St=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},St(t,e)}function kt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function xt(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Tt(r.key),r)}}function At(t,e,n){return e&&xt(t.prototype,e),n&&xt(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function Tt(t){var e=function(t,e){if("object"!=gt(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=gt(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==gt(e)?e:e+""}mt.IdPrefixes={Actionable:"actionable",Condition:"$0",Control:"$1",Image:"$2",Script:"$3",Sound:"$4",Text:"$5",Menu:"$6"};var Et=function(){function t(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};kt(this,t),this.character=e,this.text=this.format(n),this.config=p(t.defaultConfig,r),this.id=Yt.getIdManager().getStringId(),this.state=y(t.defaultState)}return At(t,[{key:"format",value:function(t){var e=[];if(Array.isArray(t))for(var n=0;n<t.length;n++)Pt.isWord(t[n])?e.push(t[n]):e.push(new Pt(t[n]));else e.push(Pt.isWord(t)?t:new Pt(t));return e}},{key:"toData",value:function(){return w(this.state,t.defaultState)?null:{state:y(this.state)}}},{key:"fromData",value:function(t){return this.state=p(this.state,t),this}},{key:"toString",value:function(){return this.text.map((function(t){return t.text})).join("")}}],[{key:"isSentence",value:function(e){return e instanceof t}},{key:"toSentence",value:function(e){return t.isSentence(e)?e:new t(null,e)}}])}();Et.defaultConfig={color:"#fff",pause:!0},Et.defaultState={display:!0};var Ot,Pt=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};kt(this,t),this.text=e,this.config=p(t.defaultConfig,n)}return At(t,null,[{key:"isWord",value:function(e){return e instanceof t}}])}();Pt.defaultConfig={color:"#000"},function(t){t.adv="adv",t.nvl="nvl"}(Ot||(Ot={}));var jt=function(t){function e(t){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return kt(this,e),(n=bt(this,e,[mt.IdPrefixes.Text])).name=t,n.config=p({},e.defaultConfig,r),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&St(t,e)}(e,t),At(e,[{key:"say",value:function(t){var e=Array.isArray(t)?new Et(this,t,{}):Et.isSentence(t)?t:new Et(this,t,{}),n=new Qa(this,Qa.ActionTypes.say,new ce(Yt.getIdManager().getStringId()).setContent(e));return this.actions.push(n),this}}])}(mt);function Ct(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,s=[],u=!0,c=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(s.push(r.value),s.length!==e);u=!0);}catch(t){c=!0,o=t}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(t,e)||function(t,e){if(t){if("string"==typeof t)return It(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?It(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function It(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Mt(t){var e,n=t.action,r=t.onClick,o=t.useTypeEffect,i=void 0===o||o,a=t.className,s=n.sentence,u=n.character,c=Ct((0,W.useState)(0),2),l=c[0],f=c[1],d=Ct((0,W.useState)(!1),2),p=d[0],h=d[1],y=pt().game,m=function(){f((function(t){return t+1})),l===s.text.length-1&&h(!0)};return(0,W.useEffect)((function(){if(window){var t=function(t){y.config.elements.say.skipKeys.includes(t.key)&&(p?r&&r():h(!0))};return window.addEventListener("keyup",t),function(){window.removeEventListener("keyup",t)}}console.warn("Failed to add event listener, window is not available\nat Say.tsx: onElementClick")}),[p]),q().createElement(it,{className:"absolute"},s.state.display&&(u&&u.config.mode!==jt.Modes.adv?q().createElement(q().Fragment,null," "):q().createElement("div",{className:z("absolute flex items-center justify-center bottom-0 w-[calc(100%-40px)] h-[calc(33%-40px)] m-4 bg-white",y.config.elementStyles.say.container,a),onClick:function(){p?r&&r():h(!0)}},q().createElement("div",{className:z("absolute top-0 left-0 p-1.25 rounded-br-md m-4",y.config.elementStyles.say.nameText)},(null===(e=s.character)||void 0===e?void 0:e.name)||""),q().createElement("div",{className:z("text-center max-w-[80%] mx-auto",y.config.elementStyles.say.textContainer)},s.text.map((function(t,e){return p?q().createElement("span",{key:e,style:{color:"string"==typeof t.config.color?t.config.color:v(t.config.color)},className:z(y.config.elementStyles.say.textSpan)},t.text):e>l?null:q().createElement("span",{key:e,style:{color:v(t.config.color)}},i?q().createElement(ut,{text:t.text,onComplete:e===l?m:void 0,speed:y.config.elements.say.textSpeed,className:z(y.config.elementStyles.say.textSpan)}):t.text)}))))))}function Lt(t){var e=t.sentence,n=t.className;return q().createElement(q().Fragment,null,e.text.map((function(t,e){return q().createElement("span",{key:e,style:{color:v(t.config.color)},className:n},t.text)})))}jt.Modes=Ot,jt.defaultConfig={mode:Ot.adv};var Nt={say:Mt,menu:function(t){var e=t.prompt,n=t.choices,r=t.afterChoose,o=pt().game;return q().createElement(q().Fragment,null,q().createElement(it,{className:"absolute"},q().createElement("div",{className:"absolute flex flex-col items-center justify-center min-w-full w-full h-full"},e&&q().createElement(Mt,{action:{sentence:e,character:null},useTypeEffect:!1,className:"z-10"}))),q().createElement(it,{className:"absolute"},q().createElement("div",{className:z("absolute flex flex-col items-center justify-center min-w-full w-full h-full",o.config.elementStyles.menu.container)},q().createElement("div",{className:"p-4 rounded-lg w-full z-20"},q().createElement("div",{className:"flex flex-col items-center mt-4 w-full"},n.map((function(t,e){return q().createElement("button",{key:e,className:z("bg-white text-black p-2 rounded-lg mt-2 shadow-md w-1/2 hover:bg-gray-100 active:bg-gray-200 transition-colors",o.config.elementStyles.menu.choiceButton),onClick:function(){return function(t){r(t)}(t)}},q().createElement(Lt,{key:e,sentence:t.prompt,className:z(o.config.elementStyles.menu.choiceButtonText)}))})))))))}};function Ft(t){return Ft="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ft(t)}function Rt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Vt(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Bt(r.key),r)}}function Dt(t,e,n){return e&&Vt(t.prototype,e),n&&Vt(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function Bt(t){var e=function(t,e){if("object"!=Ft(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=Ft(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Ft(e)?e:e+""}function $t(t,e,n){return e=Ht(e),function(t,e){if(e&&("object"==Ft(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Ut()?Reflect.construct(e,n||[],Ht(t).constructor):e.apply(t,n))}function Ut(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Ut=function(){return!!t})()}function Ht(t){return Ht=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ht(t)}function Gt(t,e){return Gt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Gt(t,e)}var zt,Wt=function(t){function e(){var t;return Rt(this,e),(t=$t(this,e,arguments)).id=0,t}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Gt(t,e)}(e,t),Dt(e,[{key:"getId",value:function(){return this.id++}},{key:"getStringId",value:function(){return(this.id++).toString()}},{key:"prefix",value:function(t,e){return t+(arguments.length>2&&void 0!==arguments[2]?arguments[2]:":")+e}}])}(function(){var t=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}return function(t,e,n){return e&&I(t.prototype,e),n&&I(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}(t,null,[{key:"getInstance",value:function(){return t._instance||(t._instance=new this),t._instance}}])}();return t._instance=null,t}()),qt=function(){return Dt((function t(){Rt(this,t),this.id=0}),[{key:"getId",value:function(){return this.id++}},{key:"getStringId",value:function(){return(this.id++).toString()}},{key:"prefix",value:function(t,e){return t+(arguments.length>2&&void 0!==arguments[2]?arguments[2]:":")+e}}])}();!function(t){t.game="game"}(zt||(zt={}));var Yt=function(){return Dt((function t(e){Rt(this,t),this.liveGame=null,this.config=p(t.DefaultConfig,e)}),[{key:"useComponent",value:function(t,e){if(!Object.keys(Nt).includes(t))throw new Error("Invalid key ".concat(t));if("function"!=typeof e)throw new Error("Invalid component for key ".concat(t));return this.config.elements[t].use=e,this}},{key:"getLiveGame",value:function(){if(!this.liveGame){var t=this.createLiveGame();return this.liveGame=t,t}return this.liveGame}},{key:"createLiveGame",value:function(){return new Xt(this)}}],[{key:"getIdManager",value:function(){return Wt.getInstance()}}])}();Yt.defaultSettings={volume:1},Yt.ComponentTypes={say:"say",menu:"menu"},Yt.DefaultConfig={version:"v0.0.0",player:{contentContainerId:"__narraleaf_content",aspectRatio:16/9,minWidth:800,minHeight:450},elements:{say:{skipKeys:[" "],textSpeed:50,use:Nt.say},img:{slowLoadWarning:!0,slowLoadThreshold:2e3},menu:{use:Nt.menu}},elementStyles:{say:{container:"",nameText:"",textContainer:"",textSpan:""},menu:{container:"",choiceButton:"",choiceButtonText:""}}},Yt.GameSettingsNamespace=zt;var Xt=function(){function t(e){Rt(this,t),this.currentSceneNumber=null,this.currentSavedGame=null,this.story=null,this.lockedAwaiting=null,this._lockedCount=0,this.currentAction=null,this.game=e,this.storable=new j,this.initNamespaces(),this.idManager=new qt}return Dt(t,[{key:"getDefaultSavedGame",value:function(){return{name:"_",version:this.game.config.version,meta:{created:Date.now(),updated:Date.now()},game:{store:{},elementState:[],nodeChildIdMap:{},stage:{elements:[]},currentScene:0,currentAction:null}}}},{key:"initNamespaces",value:function(){return this.storable.addNamespace(new P(t.GameSpacesKey.game,t.DefaultNamespaces.game)),this}},{key:"getStorable",value:function(){return this.storable}},{key:"loadStory",value:function(t){return this.story=t,this}},{key:"newGame",value:function(){var t;this.initNamespaces(),this.currentSceneNumber=0,this.currentAction=(null===(t=this.story)||void 0===t?void 0:t.getActions()[this.currentSceneNumber])||null;var e=this.getDefaultSavedGame();return e.name="NewGame-"+Date.now(),this.currentSavedGame=e,this}},{key:"deserialize",value:function(t,e){var n=e.gameState,r=this.story;if(!r)throw new Error("No story loaded");if(t.version!==this.game.config.version)throw new Error("Saved game version mismatch");var o=r.getAllActions(),i=t.game,a=i.store,s=i.elementState,u=i.nodeChildIdMap,c=i.currentScene,l=i.currentAction,f=i.stage;this.storable.load(a),r._setAllElementState(s,o),r._setNodeChildByMap(u,o),l?this.setCurrentAction(r.findActionById(l,o)||null):this.setCurrentAction(null),this.currentSceneNumber=c,this.currentSavedGame=t,n.loadData(f,o)}},{key:"serialize",value:function(t){var e,n,r,o=t.gameState,i=this.story;if(!i)throw new Error("No story loaded");var a=i.getAllActions(),s=i._getAllElementState(a),u=Object.fromEntries(i._getNodeChildIdMap(a)),c=o.toData();return{name:(null===(e=this.currentSavedGame)||void 0===e?void 0:e.name)||"_",version:this.game.config.version,meta:{created:(null===(n=this.currentSavedGame)||void 0===n?void 0:n.meta.created)||Date.now(),updated:Date.now()},game:{store:this.storable.toData(),elementState:s,stage:c,nodeChildIdMap:u,currentScene:this.currentSceneNumber||0,currentAction:(null===(r=this.getCurrentAction())||void 0===r?void 0:r.getId())||null}}}},{key:"getCurrentAction",value:function(){return this.currentAction}},{key:"setCurrentAction",value:function(t){return this.currentAction=t,this}},{key:"next",value:function(t){var e,n,r;if(!this.story)throw new Error("No story loaded");if(this.currentSceneNumber||(this.currentSceneNumber=0),this.lockedAwaiting){if(!this.lockedAwaiting.solved){if(this._lockedCount++,this._lockedCount>1e3)throw new Error("Locked awaiting");return this.lockedAwaiting}var o=this.lockedAwaiting.result;return this.currentAction=(null===(e=null==o?void 0:o.node)||void 0===e?void 0:e.action)||null,this.lockedAwaiting=null,o||null}if(this.currentAction=this.currentAction||this.story.getActions()[++this.currentSceneNumber],!this.currentAction)return t.events.emit(H.EventTypes["event:state.end"]),console.warn("No current action"),null;var i=this.currentAction.executeAction(t);return h.isAwaitable(i)?(this.lockedAwaiting=i,i):(this._lockedCount=0,this.currentAction=(null===(r=null===(n=i.node)||void 0===n?void 0:n.child)||void 0===r?void 0:r.action)||null,i)}},{key:"executeAction",value:function(t,e){var n,r,o=e.executeAction(t);return h.isAwaitable(o)?o:(null===(r=null===(n=null==o?void 0:o.node)||void 0===n?void 0:n.child)||void 0===r?void 0:r.action)||null}}])}();Xt.DefaultNamespaces={game:{}},Xt.GameSpacesKey={game:"game"};function Kt(t){return Kt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Kt(t)}function Zt(t,e,n){return e=Jt(e),function(t,e){if(e&&("object"==Kt(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Qt()?Reflect.construct(e,n||[],Jt(t).constructor):e.apply(t,n))}function Qt(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Qt=function(){return!!t})()}function Jt(t){return Jt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Jt(t)}function te(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ee(t,e)}function ee(t,e){return ee=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ee(t,e)}function ne(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function re(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,ie(r.key),r)}}function oe(t,e,n){return e&&re(t.prototype,e),n&&re(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function ie(t){var e=function(t,e){if("object"!=Kt(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=Kt(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Kt(e)?e:e+""}var ae;!function(t){t.TreeNode="TreeNode",t.ContentNode="ContentNode"}(ae||(ae={}));var se,ue=function(){return oe((function t(e,n){ne(this,t),this.id=e,this.type=n,this.content=void 0}),[{key:"setContent",value:function(t){return this.content=t,this}},{key:"getContent",value:function(){return this.content}}])}(),ce=function(t){function e(t,n,r,o){var i;return ne(this,e),(i=Zt(this,e,[Yt.getIdManager().prefix("node",t,"-"),ae.ContentNode])).child=o||null,i.parent=r||null,i.action=n||null,i}return te(e,t),oe(e,[{key:"setParent",value:function(t){if(t===this)throw new Error("Cannot set parent to itself");return this.parent=t,this}},{key:"setChild",value:function(t){if(t===this)throw new Error("Cannot set child to itself");return this.child=t,t&&t.parent!==this&&t.remove().setParent(this),this}},{key:"getChild",value:function(){return this.child||null}},{key:"getParent",value:function(){return this.parent||null}},{key:"setInitChild",value:function(t){return this.initChild=t,this.setChild(t)}},{key:"addChild",value:function(t){return this.setChild(t),this}},{key:"removeChild",value:function(t){return t&&this.child===t?(this.child=null,t.setParent(null)):t||(this.child=null),this}},{key:"remove",value:function(){var t;return null===(t=this.parent)||void 0===t||t.removeChild(this),this}},{key:"hasChild",value:function(){return!!this.child}}],[{key:"forEachParent",value:function(t,e){for(var n=new Set,r=t;r&&!n.has(r);)n.add(r),e(r),r=r.getParent()}},{key:"forEachChild",value:function(t,e){for(var n=new Set,r=t;r&&!n.has(r);)n.add(r),e(r),r=r.getChild()}}])}(ue),le={center:"center",left:"left",right:"right"};function fe(t){return fe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},fe(t)}function de(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function pe(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,ve(r.key),r)}}function he(t,e,n){return e&&pe(t.prototype,e),n&&pe(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function ye(t,e,n){return(e=ve(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ve(t){var e=function(t,e){if("object"!=fe(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=fe(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==fe(e)?e:e+""}!function(t){t.Left="left",t.Center="center",t.Right="right"}(se||(se={}));var me=ye(ye(ye({},se.Left,"33.33%"),se.Center,"50%"),se.Right,"66.66%"),ge=function(){function t(){de(this,t)}return he(t,null,[{key:"isUnknown",value:function(e){return e===t.Unknown}},{key:"wrap",value:function(t){return Object.assign({left:"auto",top:"auto",right:"auto",bottom:"auto"},t)}},{key:"D2PositionToCSS",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=this.calc(t.y,t.yoffset),o=this.calc(t.x,t.xoffset),i=n?{bottom:r}:{top:r},a=e?{right:o}:{left:o};return this.wrap(Object.assign(Object.assign({},i),a))}},{key:"calc",value:function(e,n){if(!e||t.isUnknown(e))return"auto";if(void 0===n||t.isUnknown(n))return"".concat(e);var r="number"==typeof e?"".concat(e,"px"):e;return"calc(".concat(r," + ").concat(n,"px)")}},{key:"toCoord2D",value:function(t){if(be.isCommonPositionType(t))return we.fromCommonPosition(t);if(we.isCoord2DPosition(t))return t;if(_e.isAlignPosition(t))return we.fromAlignPosition(t);if("object"===fe(t)&&["x","y","xoffset","yoffset"].some((function(e){return e in t})))return new we(t);throw new Error("Invalid position type")}},{key:"mergePosition",value:function(t,e){var n=this.toCoord2D(t),r=this.toCoord2D(e);return we.merge(n,r)}},{key:"serializePosition",value:function(e){var n=this.toCoord2D(e);return{x:t.isUnknown(n.x)?0:n.x,y:t.isUnknown(n.y)?0:n.y,xoffset:t.isUnknown(n.xoffset)?0:n.xoffset,yoffset:t.isUnknown(n.yoffset)?0:n.yoffset}}},{key:"isRawCommonPositionType",value:function(t){return Object.values(se).includes(t)}},{key:"isRawCoord2DPosition",value:function(t){return"object"===fe(t)&&("x"in t||"y"in t||"xoffset"in t||"yoffset"in t)}},{key:"isRawAlignPosition",value:function(t){return"object"===fe(t)&&("xalign"in t||"yalign"in t||"xoffset"in t||"yoffset"in t)}},{key:"isRawPosition",value:function(t){return this.isRawCommonPositionType(t)||this.isRawCoord2DPosition(t)||this.isRawAlignPosition(t)}},{key:"isPosition",value:function(t){return t instanceof be||t instanceof we||t instanceof _e}},{key:"rawPositionToCoord2D",value:function(t){if(this.isRawCommonPositionType(t))return we.fromCommonPosition(new be(t));if(this.isRawCoord2DPosition(t))return new we(t);if(this.isRawAlignPosition(t))return we.fromAlignPosition(t);throw new Error("Invalid position type")}},{key:"tryParsePosition",value:function(t){if(this.isPosition(t))return t;if(this.isRawPosition(t))return this.rawPositionToCoord2D(t);throw new Error("Invalid position type")}}])}();ge.Unknown=Symbol("Unknown");var be=function(){function t(e){de(this,t),this.position=e}return he(t,[{key:"toCSS",value:function(){return{x:me[this.position],y:"50%",xoffset:0,yoffset:0}}}],[{key:"isCommonPositionType",value:function(e){return e instanceof t}}])}();be.Positions=se;var we=function(){function t(e,n){de(this,t),"object"===fe(e)?(this.x=e.x||ge.Unknown,this.y=e.y||ge.Unknown,this.xoffset=e.xoffset||ge.Unknown,this.yoffset=e.yoffset||ge.Unknown):(this.x=e||ge.Unknown,this.y=n||ge.Unknown,this.xoffset=ge.Unknown,this.yoffset=ge.Unknown)}return he(t,[{key:"toCSS",value:function(){return{x:this.x,y:this.y,xoffset:this.xoffset,yoffset:this.yoffset}}}],[{key:"isCoord2DPosition",value:function(e){return e instanceof t}},{key:"fromCommonPosition",value:function(e){return new t({x:me[e.position],y:"50%"})}},{key:"fromAlignPosition",value:function(e){return new t({x:ge.isUnknown(e.xalign)?ge.Unknown:"".concat(100*e.xalign,"%"),y:ge.isUnknown(e.yalign)?ge.Unknown:"".concat(100*e.yalign,"%"),xoffset:e.xoffset,yoffset:e.yoffset})}},{key:"merge",value:function(e,n){return new t({x:ge.isUnknown(n.x)?e.x:n.x,y:ge.isUnknown(n.y)?e.y:n.y,xoffset:ge.isUnknown(n.xoffset)?e.xoffset:n.xoffset,yoffset:ge.isUnknown(n.yoffset)?e.yoffset:n.yoffset})}}])}(),_e=function(){function t(e,n){de(this,t),"object"===fe(e)?(this.xalign=e.xalign||ge.Unknown,this.yalign=e.yalign||ge.Unknown,this.xoffset=e.xoffset||ge.Unknown,this.yoffset=e.yoffset||ge.Unknown):(this.xalign=e||ge.Unknown,this.yalign=n||ge.Unknown,this.xoffset=ge.Unknown,this.yoffset=ge.Unknown)}return he(t,[{key:"toCSS",value:function(){return{x:ge.isUnknown(this.xalign)?this.xalign:"".concat(100*this.xalign,"%"),y:ge.isUnknown(this.yalign)?this.yalign:"".concat(100*this.yalign,"%"),xoffset:this.xoffset,yoffset:this.yoffset}}}],[{key:"isAlignPosition",value:function(e){return e instanceof t}}])}();const Se=t=>t;let ke=Se,xe=Se;function Ae(t,e,n){var r;if("string"==typeof t){let o=document;e&&(xe(Boolean(e.current),"Scope provided, but no element detected."),o=e.current),n?(null!==(r=n[t])&&void 0!==r||(n[t]=o.querySelectorAll(t)),t=n[t]):t=o.querySelectorAll(t)}else t instanceof Element&&(t=[t]);return Array.from(t||[])}const Te=new WeakMap,Ee=!1,Oe=!1;const Pe=["read","resolveKeyframes","update","preRender","render","postRender"];function je(t,e){let n=!1,r=!0;const o={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,a=Pe.reduce(((t,e)=>(t[e]=function(t){let e=new Set,n=new Set,r=!1,o=!1;const i=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function s(e){i.has(e)&&(u.schedule(e),t()),e(a)}const u={schedule:(t,o=!1,a=!1)=>{const s=a&&r?e:n;return o&&i.add(t),s.has(t)||s.add(t),t},cancel:t=>{n.delete(t),i.delete(t)},process:t=>{a=t,r?o=!0:(r=!0,[e,n]=[n,e],n.clear(),e.forEach(s),r=!1,o&&(o=!1,u.process(t)))}};return u}(i),t)),{}),{read:s,resolveKeyframes:u,update:c,preRender:l,render:f,postRender:d}=a,p=()=>{const i=Oe?o.timestamp:performance.now();n=!1,o.delta=r?1e3/60:Math.max(Math.min(i-o.timestamp,40),1),o.timestamp=i,o.isProcessing=!0,s.process(o),u.process(o),c.process(o),l.process(o),f.process(o),d.process(o),o.isProcessing=!1,n&&e&&(r=!1,t(p))};return{schedule:Pe.reduce(((e,i)=>{const s=a[i];return e[i]=(e,i=!1,a=!1)=>(n||(n=!0,r=!0,o.isProcessing||t(p)),s.schedule(e,i,a)),e}),{}),cancel:t=>{for(let e=0;e<Pe.length;e++)a[Pe[e]].cancel(t)},state:o,steps:a}}const{schedule:Ce,cancel:Ie,state:Me,steps:Le}=je("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:Se,!0);function Ne(t){let e;return()=>(void 0===e&&(e=t()),e)}const Fe=Ne((()=>void 0!==window.ScrollTimeline));class Re{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}then(t,e){return Promise.all(this.animations).then(t).catch(e)}getAll(t){return this.animations[0][t]}setAll(t,e){for(let n=0;n<this.animations.length;n++)this.animations[n][t]=e}attachTimeline(t){const e=this.animations.map((e=>{if(!Fe()||!e.attachTimeline)return e.pause(),function(t,e){let n;const r=()=>{const{currentTime:r}=e,o=(null===r?0:r.value)/100;n!==o&&t(o),n=o};return Ce.update(r,!0),()=>Ie(r)}((t=>{e.time=e.duration*t}),t);e.attachTimeline(t)}));return()=>{e.forEach(((t,e)=>{t&&t(),this.animations[e].stop()}))}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let e=0;e<this.animations.length;e++)t=Math.max(t,this.animations[e].duration);return t}runAll(t){this.animations.forEach((e=>e[t]()))}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}const Ve=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],De=new Set(Ve),Be=t=>1e3*t,$e=t=>t/1e3,Ue={type:"spring",stiffness:500,damping:25,restSpeed:10},He={type:"keyframes",duration:.8},Ge={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},ze=(t,{keyframes:e})=>e.length>2?He:De.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:Ue:Ge;function We(t,e){return t[e]||t.default||t}const qe=!1,Ye=t=>null!==t;function Xe(t,{repeat:e,repeatType:n="loop"},r){const o=t.filter(Ye),i=e&&"loop"!==n&&e%2==1?0:o.length-1;return i&&void 0!==r?r:o[i]}const Ke=t=>/^0[^.\s]+$/u.test(t);const Ze=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),Qe=t=>e=>"string"==typeof e&&e.startsWith(t),Je=Qe("--"),tn=Qe("var(--"),en=t=>!!tn(t)&&nn.test(t.split("/*")[0].trim()),nn=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,rn=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function on(t,e,n=1){xe(n<=4,`Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`);const[r,o]=function(t){const e=rn.exec(t);if(!e)return[,];const[,n,r,o]=e;return[`--${null!=n?n:r}`,o]}(t);if(!r)return;const i=window.getComputedStyle(e).getPropertyValue(r);if(i){const t=i.trim();return Ze(t)?parseFloat(t):t}return en(o)?on(o,e,n+1):o}const an=(t,e,n)=>n>e?e:n<t?t:n,sn={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},un={...sn,transform:t=>an(0,1,t)},cn={...sn,default:1},ln=t=>Math.round(1e5*t)/1e5,fn=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu,dn=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,pn=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu;function hn(t){return"string"==typeof t}const yn=t=>({test:e=>hn(e)&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),vn=yn("deg"),mn=yn("%"),gn=yn("px"),bn=yn("vh"),wn=yn("vw"),_n={...mn,parse:t=>mn.parse(t)/100,transform:t=>mn.transform(100*t)},Sn=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),kn=t=>t===sn||t===gn,xn=(t,e)=>parseFloat(t.split(", ")[e]),An=(t,e)=>(n,{transform:r})=>{if("none"===r||!r)return 0;const o=r.match(/^matrix3d\((.+)\)$/u);if(o)return xn(o[1],e);{const e=r.match(/^matrix\((.+)\)$/u);return e?xn(e[1],t):0}},Tn=new Set(["x","y","z"]),En=Ve.filter((t=>!Tn.has(t)));const On={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:An(4,13),y:An(5,14)};On.translateX=On.x,On.translateY=On.y;const Pn=t=>e=>e.test(t),jn=[sn,gn,mn,vn,wn,bn,{test:t=>"auto"===t,parse:t=>t}],Cn=t=>jn.find(Pn(t)),In=new Set;let Mn=!1,Ln=!1;function Nn(){if(Ln){const t=Array.from(In).filter((t=>t.needsMeasurement)),e=new Set(t.map((t=>t.element))),n=new Map;e.forEach((t=>{const e=function(t){const e=[];return En.forEach((n=>{const r=t.getValue(n);void 0!==r&&(e.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))})),e}(t);e.length&&(n.set(t,e),t.render())})),t.forEach((t=>t.measureInitialState())),e.forEach((t=>{t.render();const e=n.get(t);e&&e.forEach((([e,n])=>{var r;null===(r=t.getValue(e))||void 0===r||r.set(n)}))})),t.forEach((t=>t.measureEndState())),t.forEach((t=>{void 0!==t.suspendedScrollY&&window.scrollTo(0,t.suspendedScrollY)}))}Ln=!1,Mn=!1,In.forEach((t=>t.complete())),In.clear()}function Fn(){In.forEach((t=>{t.readKeyframes(),t.needsMeasurement&&(Ln=!0)}))}class Rn{constructor(t,e,n,r,o,i=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=n,this.motionValue=r,this.element=o,this.isAsync=i}scheduleResolve(){this.isScheduled=!0,this.isAsync?(In.add(this),Mn||(Mn=!0,Ce.read(Fn),Ce.resolveKeyframes(Nn))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:n,motionValue:r}=this;for(let o=0;o<t.length;o++)if(null===t[o])if(0===o){const o=null==r?void 0:r.get(),i=t[t.length-1];if(void 0!==o)t[0]=o;else if(n&&e){const r=n.readValue(e,i);null!=r&&(t[0]=r)}void 0===t[0]&&(t[0]=i),r&&void 0===o&&r.set(t[0])}else t[o]=t[o-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),In.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,In.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const Vn=(t,e)=>n=>Boolean(hn(n)&&pn.test(n)&&n.startsWith(t)||e&&!function(t){return null==t}(n)&&Object.prototype.hasOwnProperty.call(n,e)),Dn=(t,e,n)=>r=>{if(!hn(r))return r;const[o,i,a,s]=r.match(fn);return{[t]:parseFloat(o),[e]:parseFloat(i),[n]:parseFloat(a),alpha:void 0!==s?parseFloat(s):1}},Bn={...sn,transform:t=>Math.round((t=>an(0,255,t))(t))},$n={test:Vn("rgb","red"),parse:Dn("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:r=1})=>"rgba("+Bn.transform(t)+", "+Bn.transform(e)+", "+Bn.transform(n)+", "+ln(un.transform(r))+")"};const Un={test:Vn("#"),parse:function(t){let e="",n="",r="",o="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),r=t.substring(5,7),o=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),r=t.substring(3,4),o=t.substring(4,5),e+=e,n+=n,r+=r,o+=o),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:o?parseInt(o,16)/255:1}},transform:$n.transform},Hn={test:Vn("hsl","hue"),parse:Dn("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:r=1})=>"hsla("+Math.round(t)+", "+mn.transform(ln(e))+", "+mn.transform(ln(n))+", "+ln(un.transform(r))+")"},Gn={test:t=>$n.test(t)||Un.test(t)||Hn.test(t),parse:t=>$n.test(t)?$n.parse(t):Hn.test(t)?Hn.parse(t):Un.parse(t),transform:t=>hn(t)?t:t.hasOwnProperty("red")?$n.transform(t):Hn.transform(t)};const zn="number",Wn="color",qn="var",Yn="var(",Xn="${}",Kn=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Zn(t){const e=t.toString(),n=[],r={color:[],number:[],var:[]},o=[];let i=0;const a=e.replace(Kn,(t=>(Gn.test(t)?(r.color.push(i),o.push(Wn),n.push(Gn.parse(t))):t.startsWith(Yn)?(r.var.push(i),o.push(qn),n.push(t)):(r.number.push(i),o.push(zn),n.push(parseFloat(t))),++i,Xn))).split(Xn);return{values:n,split:a,indexes:r,types:o}}function Qn(t){return Zn(t).values}function Jn(t){const{split:e,types:n}=Zn(t),r=e.length;return t=>{let o="";for(let i=0;i<r;i++)if(o+=e[i],void 0!==t[i]){const e=n[i];o+=e===zn?ln(t[i]):e===Wn?Gn.transform(t[i]):t[i]}return o}}const tr=t=>"number"==typeof t?0:t;const er={test:function(t){var e,n;return isNaN(t)&&hn(t)&&((null===(e=t.match(fn))||void 0===e?void 0:e.length)||0)+((null===(n=t.match(dn))||void 0===n?void 0:n.length)||0)>0},parse:Qn,createTransformer:Jn,getAnimatableNone:function(t){const e=Qn(t);return Jn(t)(e.map(tr))}},nr=new Set(["brightness","contrast","saturate","opacity"]);function rr(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[r]=n.match(fn)||[];if(!r)return t;const o=n.replace(r,"");let i=nr.has(e)?1:0;return r!==n&&(i*=100),e+"("+i+o+")"}const or=/\b([a-z-]*)\(.*?\)/gu,ir={...er,getAnimatableNone:t=>{const e=t.match(or);return e?e.map(rr).join(" "):t}},ar={...sn,transform:Math.round},sr={borderWidth:gn,borderTopWidth:gn,borderRightWidth:gn,borderBottomWidth:gn,borderLeftWidth:gn,borderRadius:gn,radius:gn,borderTopLeftRadius:gn,borderTopRightRadius:gn,borderBottomRightRadius:gn,borderBottomLeftRadius:gn,width:gn,maxWidth:gn,height:gn,maxHeight:gn,size:gn,top:gn,right:gn,bottom:gn,left:gn,padding:gn,paddingTop:gn,paddingRight:gn,paddingBottom:gn,paddingLeft:gn,margin:gn,marginTop:gn,marginRight:gn,marginBottom:gn,marginLeft:gn,rotate:vn,rotateX:vn,rotateY:vn,rotateZ:vn,scale:cn,scaleX:cn,scaleY:cn,scaleZ:cn,skew:vn,skewX:vn,skewY:vn,distance:gn,translateX:gn,translateY:gn,translateZ:gn,x:gn,y:gn,z:gn,perspective:gn,transformPerspective:gn,opacity:un,originX:_n,originY:_n,originZ:gn,zIndex:ar,backgroundPositionX:gn,backgroundPositionY:gn,fillOpacity:un,strokeOpacity:un,numOctaves:ar},ur={...sr,color:Gn,backgroundColor:Gn,outlineColor:Gn,fill:Gn,stroke:Gn,borderColor:Gn,borderTopColor:Gn,borderRightColor:Gn,borderBottomColor:Gn,borderLeftColor:Gn,filter:ir,WebkitFilter:ir},cr=t=>ur[t];function lr(t,e){let n=cr(t);return n!==ir&&(n=er),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const fr=new Set(["auto","none","0"]);class dr extends Rn{constructor(t,e,n,r,o){super(t,e,n,r,o,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:e,name:n}=this;if(!e||!e.current)return;super.readKeyframes();for(let n=0;n<t.length;n++){let r=t[n];if("string"==typeof r&&(r=r.trim(),en(r))){const o=on(r,e.current);void 0!==o&&(t[n]=o),n===t.length-1&&(this.finalKeyframe=r)}}if(this.resolveNoneKeyframes(),!Sn.has(n)||2!==t.length)return;const[r,o]=t,i=Cn(r),a=Cn(o);if(i!==a)if(kn(i)&&kn(a))for(let e=0;e<t.length;e++){const n=t[e];"string"==typeof n&&(t[e]=parseFloat(n))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:e}=this,n=[];for(let e=0;e<t.length;e++)("number"==typeof(r=t[e])?0===r:null===r||"none"===r||"0"===r||Ke(r))&&n.push(e);var r;n.length&&function(t,e,n){let r,o=0;for(;o<t.length&&!r;){const e=t[o];"string"==typeof e&&!fr.has(e)&&Zn(e).values.length&&(r=t[o]),o++}if(r&&n)for(const o of e)t[o]=lr(n,r)}(t,n,e)}measureInitialState(){const{element:t,unresolvedKeyframes:e,name:n}=this;if(!t||!t.current)return;"height"===n&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=On[n](t.measureViewportBox(),window.getComputedStyle(t.current)),e[0]=this.measuredOrigin;const r=e[e.length-1];void 0!==r&&t.getValue(n,r).jump(r,!1)}measureEndState(){var t;const{element:e,name:n,unresolvedKeyframes:r}=this;if(!e||!e.current)return;const o=e.getValue(n);o&&o.jump(this.measuredOrigin,!1);const i=r.length-1,a=r[i];r[i]=On[n](e.measureViewportBox(),window.getComputedStyle(e.current)),null!==a&&void 0===this.finalKeyframe&&(this.finalKeyframe=a),(null===(t=this.removedTransforms)||void 0===t?void 0:t.length)&&this.removedTransforms.forEach((([t,n])=>{e.getValue(t).set(n)})),this.resolveNoneKeyframes()}}let pr;function hr(){pr=void 0}const yr={now:()=>(void 0===pr&&yr.set(Me.isProcessing||Oe?Me.timestamp:performance.now()),pr),set:t=>{pr=t,queueMicrotask(hr)}},vr=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!er.test(t)&&"0"!==t||t.startsWith("url(")));class mr{constructor({autoplay:t=!0,delay:e=0,type:n="keyframes",repeat:r=0,repeatDelay:o=0,repeatType:i="loop",...a}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=yr.now(),this.options={autoplay:t,delay:e,type:n,repeat:r,repeatDelay:o,repeatType:i,...a},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt}get resolved(){return this._resolved||this.hasAttemptedResolve||(Fn(),Nn()),this._resolved}onKeyframesResolved(t,e){this.resolvedAt=yr.now(),this.hasAttemptedResolve=!0;const{name:n,type:r,velocity:o,delay:i,onComplete:a,onUpdate:s,isGenerator:u}=this.options;if(!u&&!function(t,e,n,r){const o=t[0];if(null===o)return!1;if("display"===e||"visibility"===e)return!0;const i=t[t.length-1],a=vr(o,e),s=vr(i,e);return ke(a===s,`You are trying to animate ${e} from "${o}" to "${i}". ${o} is not an animatable value - to enable this animation set ${o} to a value animatable to ${i} via the \`style\` property.`),!(!a||!s)&&(function(t){const e=t[0];if(1===t.length)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}(t)||"spring"===n&&r)}(t,n,r,o)){if(qe||!i)return null==s||s(Xe(t,this.options,e)),null==a||a(),void this.resolveFinishedPromise();this.options.duration=0}const c=this.initPlayback(t,e);!1!==c&&(this._resolved={keyframes:t,finalKeyframe:e,...c},this.onPostResolved())}onPostResolved(){}then(t,e){return this.currentFinishedPromise.then(t,e)}updateFinishedPromise(){this.currentFinishedPromise=new Promise((t=>{this.resolveFinishedPromise=t}))}}function gr(t,e){return e?t*(1e3/e):0}const br=5;function wr(t,e,n){const r=Math.max(e-br,0);return gr(n-t(r),e-r)}const _r=.001,Sr=.01,kr=10,xr=.05,Ar=1;function Tr({duration:t=800,bounce:e=.25,velocity:n=0,mass:r=1}){let o,i;ke(t<=Be(kr),"Spring duration must be 10 seconds or less");let a=1-e;a=an(xr,Ar,a),t=an(Sr,kr,$e(t)),a<1?(o=e=>{const r=e*a,o=r*t,i=r-n,s=Or(e,a),u=Math.exp(-o);return _r-i/s*u},i=e=>{const r=e*a*t,i=r*n+n,s=Math.pow(a,2)*Math.pow(e,2)*t,u=Math.exp(-r),c=Or(Math.pow(e,2),a);return(-o(e)+_r>0?-1:1)*((i-s)*u)/c}):(o=e=>Math.exp(-e*t)*((e-n)*t+1)-_r,i=e=>Math.exp(-e*t)*(t*t*(n-e)));const s=function(t,e,n){let r=n;for(let n=1;n<Er;n++)r-=t(r)/e(r);return r}(o,i,5/t);if(t=Be(t),isNaN(s))return{stiffness:100,damping:10,duration:t};{const e=Math.pow(s,2)*r;return{stiffness:e,damping:2*a*Math.sqrt(r*e),duration:t}}}const Er=12;function Or(t,e){return t*Math.sqrt(1-e*e)}const Pr=["duration","bounce"],jr=["stiffness","damping","mass"];function Cr(t,e){return e.some((e=>void 0!==t[e]))}function Ir({keyframes:t,restDelta:e,restSpeed:n,...r}){const o=t[0],i=t[t.length-1],a={done:!1,value:o},{stiffness:s,damping:u,mass:c,duration:l,velocity:f,isResolvedFromDuration:d}=function(t){let e={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...t};if(!Cr(t,jr)&&Cr(t,Pr)){const n=Tr(t);e={...e,...n,mass:1},e.isResolvedFromDuration=!0}return e}({...r,velocity:-$e(r.velocity||0)}),p=f||0,h=u/(2*Math.sqrt(s*c)),y=i-o,v=$e(Math.sqrt(s/c)),m=Math.abs(y)<5;let g;if(n||(n=m?.01:2),e||(e=m?.005:.5),h<1){const t=Or(v,h);g=e=>{const n=Math.exp(-h*v*e);return i-n*((p+h*v*y)/t*Math.sin(t*e)+y*Math.cos(t*e))}}else if(1===h)g=t=>i-Math.exp(-v*t)*(y+(p+v*y)*t);else{const t=v*Math.sqrt(h*h-1);g=e=>{const n=Math.exp(-h*v*e),r=Math.min(t*e,300);return i-n*((p+h*v*y)*Math.sinh(r)+t*y*Math.cosh(r))/t}}return{calculatedDuration:d&&l||null,next:t=>{const r=g(t);if(d)a.done=t>=l;else{let o=0;h<1&&(o=0===t?Be(p):wr(g,t,r));const s=Math.abs(o)<=n,u=Math.abs(i-r)<=e;a.done=s&&u}return a.value=a.done?i:r,a}}}function Mr({keyframes:t,velocity:e=0,power:n=.8,timeConstant:r=325,bounceDamping:o=10,bounceStiffness:i=500,modifyTarget:a,min:s,max:u,restDelta:c=.5,restSpeed:l}){const f=t[0],d={done:!1,value:f},p=t=>void 0===s?u:void 0===u||Math.abs(s-t)<Math.abs(u-t)?s:u;let h=n*e;const y=f+h,v=void 0===a?y:a(y);v!==y&&(h=v-f);const m=t=>-h*Math.exp(-t/r),g=t=>v+m(t),b=t=>{const e=m(t),n=g(t);d.done=Math.abs(e)<=c,d.value=d.done?v:n};let w,_;const S=t=>{var e;(e=d.value,void 0!==s&&e<s||void 0!==u&&e>u)&&(w=t,_=Ir({keyframes:[d.value,p(d.value)],velocity:wr(g,t,d.value),damping:o,stiffness:i,restDelta:c,restSpeed:l}))};return S(0),{calculatedDuration:null,next:t=>{let e=!1;return _||void 0!==w||(e=!0,b(t),S(t)),void 0!==w&&t>=w?_.next(t-w):(!e&&b(t),d)}}}const Lr=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,Nr=1e-7,Fr=12;function Rr(t,e,n,r){if(t===e&&n===r)return Se;const o=e=>function(t,e,n,r,o){let i,a,s=0;do{a=e+(n-e)/2,i=Lr(a,r,o)-t,i>0?n=a:e=a}while(Math.abs(i)>Nr&&++s<Fr);return a}(e,0,1,t,n);return t=>0===t||1===t?t:Lr(o(t),e,r)}const Vr=Rr(.42,0,1,1),Dr=Rr(0,0,.58,1),Br=Rr(.42,0,.58,1),$r=t=>Array.isArray(t)&&"number"!=typeof t[0],Ur=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Hr=t=>e=>1-t(1-e),Gr=t=>1-Math.sin(Math.acos(t)),zr=Hr(Gr),Wr=Ur(Gr),qr=Rr(.33,1.53,.69,.99),Yr=Hr(qr),Xr={linear:Se,easeIn:Vr,easeInOut:Br,easeOut:Dr,circIn:Gr,circInOut:Wr,circOut:zr,backIn:Yr,backInOut:Ur(Yr),backOut:qr,anticipate:t=>(t*=2)<1?.5*Yr(t):.5*(2-Math.pow(2,-10*(t-1)))},Kr=t=>{if(Array.isArray(t)){xe(4===t.length,"Cubic bezier arrays must contain four numerical values.");const[e,n,r,o]=t;return Rr(e,n,r,o)}return"string"==typeof t?(xe(void 0!==Xr[t],`Invalid easing type '${t}'`),Xr[t]):t},Zr=(t,e)=>n=>e(t(n)),Qr=(...t)=>t.reduce(Zr),Jr=(t,e,n)=>{const r=e-t;return 0===r?1:(n-t)/r},to=(t,e,n)=>t+(e-t)*n;function eo(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function no(t,e){return n=>n>0?e:t}const ro=(t,e,n)=>{const r=t*t,o=n*(e*e-r)+r;return o<0?0:Math.sqrt(o)},oo=[Un,$n,Hn];function io(t){const e=(n=t,oo.find((t=>t.test(n))));var n;if(ke(Boolean(e),`'${t}' is not an animatable color. Use the equivalent color code instead.`),!Boolean(e))return!1;let r=e.parse(t);return e===Hn&&(r=function({hue:t,saturation:e,lightness:n,alpha:r}){t/=360,n/=100;let o=0,i=0,a=0;if(e/=100){const r=n<.5?n*(1+e):n+e-n*e,s=2*n-r;o=eo(s,r,t+1/3),i=eo(s,r,t),a=eo(s,r,t-1/3)}else o=i=a=n;return{red:Math.round(255*o),green:Math.round(255*i),blue:Math.round(255*a),alpha:r}}(r)),r}const ao=(t,e)=>{const n=io(t),r=io(e);if(!n||!r)return no(t,e);const o={...n};return t=>(o.red=ro(n.red,r.red,t),o.green=ro(n.green,r.green,t),o.blue=ro(n.blue,r.blue,t),o.alpha=to(n.alpha,r.alpha,t),$n.transform(o))},so=new Set(["none","hidden"]);function uo(t,e){return n=>to(t,e,n)}function co(t){return"number"==typeof t?uo:"string"==typeof t?en(t)?no:Gn.test(t)?ao:po:Array.isArray(t)?lo:"object"==typeof t?Gn.test(t)?ao:fo:no}function lo(t,e){const n=[...t],r=n.length,o=t.map(((t,n)=>co(t)(t,e[n])));return t=>{for(let e=0;e<r;e++)n[e]=o[e](t);return n}}function fo(t,e){const n={...t,...e},r={};for(const o in n)void 0!==t[o]&&void 0!==e[o]&&(r[o]=co(t[o])(t[o],e[o]));return t=>{for(const e in r)n[e]=r[e](t);return n}}const po=(t,e)=>{const n=er.createTransformer(e),r=Zn(t),o=Zn(e);return r.indexes.var.length===o.indexes.var.length&&r.indexes.color.length===o.indexes.color.length&&r.indexes.number.length>=o.indexes.number.length?so.has(t)&&!o.values.length||so.has(e)&&!r.values.length?function(t,e){return so.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}(t,e):Qr(lo(function(t,e){var n;const r=[],o={color:0,var:0,number:0};for(let i=0;i<e.values.length;i++){const a=e.types[i],s=t.indexes[a][o[a]],u=null!==(n=t.values[s])&&void 0!==n?n:0;r[i]=u,o[a]++}return r}(r,o),o.values),n):(ke(!0,`Complex values '${t}' and '${e}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`),no(t,e))};function ho(t,e,n){if("number"==typeof t&&"number"==typeof e&&"number"==typeof n)return to(t,e,n);return co(t)(t,e)}function yo(t,e,{clamp:n=!0,ease:r,mixer:o}={}){const i=t.length;if(xe(i===e.length,"Both input and output ranges must be the same length"),1===i)return()=>e[0];if(2===i&&t[0]===t[1])return()=>e[1];t[0]>t[i-1]&&(t=[...t].reverse(),e=[...e].reverse());const a=function(t,e,n){const r=[],o=n||ho,i=t.length-1;for(let n=0;n<i;n++){let i=o(t[n],t[n+1]);if(e){const t=Array.isArray(e)?e[n]||Se:e;i=Qr(t,i)}r.push(i)}return r}(e,r,o),s=a.length,u=e=>{let n=0;if(s>1)for(;n<t.length-2&&!(e<t[n+1]);n++);const r=Jr(t[n],t[n+1],e);return a[n](r)};return n?e=>u(an(t[0],t[i-1],e)):u}function vo(t,e){const n=t[t.length-1];for(let r=1;r<=e;r++){const o=Jr(0,e,r);t.push(to(n,1,o))}}function mo(t){const e=[0];return vo(e,t.length-1),e}function go({duration:t=300,keyframes:e,times:n,ease:r="easeInOut"}){const o=$r(r)?r.map(Kr):Kr(r),i={done:!1,value:e[0]},a=function(t,e){return t.map((t=>t*e))}(n&&n.length===e.length?n:mo(e),t),s=yo(a,e,{ease:Array.isArray(o)?o:(u=e,c=o,u.map((()=>c||Br)).splice(0,u.length-1))});var u,c;return{calculatedDuration:t,next:e=>(i.value=s(e),i.done=e>=t,i)}}const bo=2e4;function wo(t){let e=0;let n=t.next(e);for(;!n.done&&e<bo;)e+=50,n=t.next(e);return e>=bo?1/0:e}const _o=t=>{const e=({timestamp:e})=>t(e);return{start:()=>Ce.update(e,!0),stop:()=>Ie(e),now:()=>Me.isProcessing?Me.timestamp:yr.now()}},So={decay:Mr,inertia:Mr,tween:go,keyframes:go,spring:Ir},ko=t=>t/100;class xo extends mr{constructor(t){super(t),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,"idle"===this.state)return;this.teardown();const{onStop:t}=this.options;t&&t()};const{name:e,motionValue:n,element:r,keyframes:o}=this.options,i=(null==r?void 0:r.KeyframeResolver)||Rn;this.resolver=new i(o,((t,e)=>this.onKeyframesResolved(t,e)),e,n,r),this.resolver.scheduleResolve()}initPlayback(t){const{type:e="keyframes",repeat:n=0,repeatDelay:r=0,repeatType:o,velocity:i=0}=this.options,a=So[e]||go;let s,u;a!==go&&"number"!=typeof t[0]&&(s=Qr(ko,ho(t[0],t[1])),t=[0,100]);const c=a({...this.options,keyframes:t});"mirror"===o&&(u=a({...this.options,keyframes:[...t].reverse(),velocity:-i})),null===c.calculatedDuration&&(c.calculatedDuration=wo(c));const{calculatedDuration:l}=c,f=l+r;return{generator:c,mirroredGenerator:u,mapPercentToKeyframes:s,calculatedDuration:l,resolvedDuration:f,totalDuration:f*(n+1)-r}}onPostResolved(){const{autoplay:t=!0}=this.options;this.play(),"paused"!==this.pendingPlayState&&t?this.state=this.pendingPlayState:this.pause()}tick(t,e=!1){const{resolved:n}=this;if(!n){const{keyframes:t}=this.options;return{done:!0,value:t[t.length-1]}}const{finalKeyframe:r,generator:o,mirroredGenerator:i,mapPercentToKeyframes:a,keyframes:s,calculatedDuration:u,totalDuration:c,resolvedDuration:l}=n;if(null===this.startTime)return o.next(0);const{delay:f,repeat:d,repeatType:p,repeatDelay:h,onUpdate:y}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-c/this.speed,this.startTime)),e?this.currentTime=t:null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const v=this.currentTime-f*(this.speed>=0?1:-1),m=this.speed>=0?v<0:v>c;this.currentTime=Math.max(v,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=c);let g=this.currentTime,b=o;if(d){const t=Math.min(this.currentTime,c)/l;let e=Math.floor(t),n=t%1;!n&&t>=1&&(n=1),1===n&&e--,e=Math.min(e,d+1);Boolean(e%2)&&("reverse"===p?(n=1-n,h&&(n-=h/l)):"mirror"===p&&(b=i)),g=an(0,1,n)*l}const w=m?{done:!1,value:s[0]}:b.next(g);a&&(w.value=a(w.value));let{done:_}=w;m||null===u||(_=this.speed>=0?this.currentTime>=c:this.currentTime<=0);const S=null===this.holdTime&&("finished"===this.state||"running"===this.state&&_);return S&&void 0!==r&&(w.value=Xe(s,this.options,r)),y&&y(w.value),S&&this.finish(),w}get duration(){const{resolved:t}=this;return t?$e(t.calculatedDuration):0}get time(){return $e(this.currentTime)}set time(t){t=Be(t),this.currentTime=t,null!==this.holdTime||0===this.speed?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.speed)}get speed(){return this.playbackSpeed}set speed(t){const e=this.playbackSpeed!==t;this.playbackSpeed=t,e&&(this.time=$e(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved)return void(this.pendingPlayState="running");if(this.isStopped)return;const{driver:t=_o,onPlay:e,startTime:n}=this.options;this.driver||(this.driver=t((t=>this.tick(t)))),e&&e();const r=this.driver.now();null!==this.holdTime?this.startTime=r-this.holdTime:this.startTime?"finished"===this.state&&(this.startTime=r):this.startTime=null!=n?n:this.calcStartTime(),"finished"===this.state&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var t;this._resolved?(this.state="paused",this.holdTime=null!==(t=this.currentTime)&&void 0!==t?t:0):this.pendingPlayState="paused"}complete(){"running"!==this.state&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:t}=this.options;t&&t()}cancel(){null!==this.cancelTime&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}}const Ao=new Set(["opacity","clipPath","filter","transform"]),To=t=>Array.isArray(t)&&"number"==typeof t[0];function Eo(t){return Boolean(!t||"string"==typeof t&&t in Po||To(t)||Array.isArray(t)&&t.every(Eo))}const Oo=([t,e,n,r])=>`cubic-bezier(${t}, ${e}, ${n}, ${r})`,Po={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Oo([0,.65,.55,1]),circOut:Oo([.55,0,1,.45]),backIn:Oo([.31,.01,.66,-.59]),backOut:Oo([.33,1.53,.69,.99])};function jo(t){return Co(t)||Po.easeOut}function Co(t){return t?To(t)?Oo(t):Array.isArray(t)?t.map(jo):Po[t]:void 0}const Io=Ne((()=>Object.hasOwnProperty.call(Element.prototype,"animate")));class Mo extends mr{constructor(t){super(t);const{name:e,motionValue:n,element:r,keyframes:o}=this.options;this.resolver=new dr(o,((t,e)=>this.onKeyframesResolved(t,e)),e,n,r),this.resolver.scheduleResolve()}initPlayback(t,e){var n;let{duration:r=300,times:o,ease:i,type:a,motionValue:s,name:u,startTime:c}=this.options;if(!(null===(n=s.owner)||void 0===n?void 0:n.current))return!1;if(function(t){return"spring"===t.type||!Eo(t.ease)}(this.options)){const{onComplete:e,onUpdate:n,motionValue:s,element:u,...c}=this.options,l=function(t,e){const n=new xo({...e,keyframes:t,repeat:0,delay:0,isGenerator:!0});let r={done:!1,value:t[0]};const o=[];let i=0;for(;!r.done&&i<2e4;)r=n.sample(i),o.push(r.value),i+=10;return{times:void 0,keyframes:o,duration:i-10,ease:"linear"}}(t,c);1===(t=l.keyframes).length&&(t[1]=t[0]),r=l.duration,o=l.times,i=l.ease,a="keyframes"}const l=function(t,e,n,{delay:r=0,duration:o=300,repeat:i=0,repeatType:a="loop",ease:s,times:u}={}){const c={[e]:n};u&&(c.offset=u);const l=Co(s);return Array.isArray(l)&&(c.easing=l),t.animate(c,{delay:r,duration:o,easing:Array.isArray(l)?"linear":l,fill:"both",iterations:i+1,direction:"reverse"===a?"alternate":"normal"})}(s.owner.current,u,t,{...this.options,duration:r,times:o,ease:i});return l.startTime=null!=c?c:this.calcStartTime(),this.pendingTimeline?(l.timeline=this.pendingTimeline,this.pendingTimeline=void 0):l.onfinish=()=>{const{onComplete:n}=this.options;s.set(Xe(t,this.options,e)),n&&n(),this.cancel(),this.resolveFinishedPromise()},{animation:l,duration:r,times:o,type:a,ease:i,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:e}=t;return $e(e)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:e}=t;return $e(e.currentTime||0)}set time(t){const{resolved:e}=this;if(!e)return;const{animation:n}=e;n.currentTime=Be(t)}get speed(){const{resolved:t}=this;if(!t)return 1;const{animation:e}=t;return e.playbackRate}set speed(t){const{resolved:e}=this;if(!e)return;const{animation:n}=e;n.playbackRate=t}get state(){const{resolved:t}=this;if(!t)return"idle";const{animation:e}=t;return e.playState}get startTime(){const{resolved:t}=this;if(!t)return null;const{animation:e}=t;return e.startTime}attachTimeline(t){if(this._resolved){const{resolved:e}=this;if(!e)return Se;const{animation:n}=e;n.timeline=t,n.onfinish=null}else this.pendingTimeline=t;return Se}play(){if(this.isStopped)return;const{resolved:t}=this;if(!t)return;const{animation:e}=t;"finished"===e.playState&&this.updateFinishedPromise(),e.play()}pause(){const{resolved:t}=this;if(!t)return;const{animation:e}=t;e.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,"idle"===this.state)return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:t}=this;if(!t)return;const{animation:e,keyframes:n,duration:r,type:o,ease:i,times:a}=t;if("idle"===e.playState||"finished"===e.playState)return;if(this.time){const{motionValue:t,onUpdate:e,onComplete:s,element:u,...c}=this.options,l=new xo({...c,keyframes:n,duration:r,type:o,ease:i,times:a,isGenerator:!0}),f=Be(this.time);t.setWithVelocity(l.sample(f-10).value,l.sample(f).value,10)}const{onStop:s}=this.options;s&&s(),this.cancel()}complete(){const{resolved:t}=this;t&&t.animation.finish()}cancel(){const{resolved:t}=this;t&&t.animation.cancel()}static supports(t){const{motionValue:e,name:n,repeatDelay:r,repeatType:o,damping:i,type:a}=t;return Io()&&n&&Ao.has(n)&&e&&e.owner&&e.owner.current instanceof HTMLElement&&!e.owner.getProps().onUpdate&&!r&&"mirror"!==o&&0!==i&&"inertia"!==a}}const Lo=(t,e,n,r={},o,i,a)=>s=>{const u=We(r,t)||{},c=u.delay||r.delay||0;let{elapsed:l=0}=r;l-=Be(c);let f={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...u,delay:-l,onUpdate:t=>{e.set(t),u.onUpdate&&u.onUpdate(t)},onComplete:()=>{s(),u.onComplete&&u.onComplete(),a&&a()},onStop:a,name:t,motionValue:e,element:i?void 0:o};(function({when:t,delay:e,delayChildren:n,staggerChildren:r,staggerDirection:o,repeat:i,repeatType:a,repeatDelay:s,from:u,elapsed:c,...l}){return!!Object.keys(l).length})(u)||(f={...f,...ze(t,f)}),f.duration&&(f.duration=Be(f.duration)),f.repeatDelay&&(f.repeatDelay=Be(f.repeatDelay)),void 0!==f.from&&(f.keyframes[0]=f.from);let d=!1;if((!1===f.type||0===f.duration&&!f.repeatDelay)&&(f.duration=0,0===f.delay&&(d=!0)),(qe||Ee)&&(d=!0,f.duration=0,f.delay=0),d&&!i&&void 0!==e.get()){const t=Xe(f.keyframes,u);if(void 0!==t)return Ce.update((()=>{f.onUpdate(t),f.onComplete()})),new Re([])}return!i&&Mo.supports(f)?new Mo(f):new xo(f)},No=t=>Array.isArray(t),Fo=t=>Boolean(t&&"object"==typeof t&&t.mix&&t.toValue),Ro=t=>No(t)?t[t.length-1]||0:t;function Vo(t,e){-1===t.indexOf(e)&&t.push(e)}function Do(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}class Bo{constructor(){this.subscriptions=[]}add(t){return Vo(this.subscriptions,t),()=>Do(this.subscriptions,t)}notify(t,e,n){const r=this.subscriptions.length;if(r)if(1===r)this.subscriptions[0](t,e,n);else for(let o=0;o<r;o++){const r=this.subscriptions[o];r&&r(t,e,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const $o={current:void 0};class Uo{constructor(t,e={}){this.version="11.5.4",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(t,e=!0)=>{const n=yr.now();this.updatedAt!==n&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),e&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){var e;this.current=t,this.updatedAt=yr.now(),null===this.canTrackVelocity&&void 0!==t&&(this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e))))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new Bo);const n=this.events[t].add(e);return"change"===t?()=>{n(),Ce.read((()=>{this.events.change.getSize()||this.stop()}))}:n}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t,e=!0){e&&this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t,e)}setWithVelocity(t,e,n){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-n}jump(t,e=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return $o.current&&$o.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const t=yr.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return gr(parseFloat(this.current)-parseFloat(this.prevFrameValue),e)}start(t){return this.stop(),new Promise((e=>{this.hasAnimated=!0,this.animation=t(e),this.events.animationStart&&this.events.animationStart.notify()})).then((()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()}))}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Ho(t,e){return new Uo(t,e)}function Go(t){const e=[{},{}];return null==t||t.values.forEach(((t,n)=>{e[0][n]=t.get(),e[1][n]=t.getVelocity()})),e}function zo(t,e,n,r){if("function"==typeof e){const[o,i]=Go(r);e=e(void 0!==n?n:t.custom,o,i)}if("string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e){const[o,i]=Go(r);e=e(void 0!==n?n:t.custom,o,i)}return e}function Wo(t,e,n){const r=t.getProps();return zo(r,e,void 0!==n?n:r.custom,t)}function qo(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Ho(n))}const Yo=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),Xo="data-"+Yo("framerAppearId");function Ko(t){return t.props[Xo]}function Zo(t){return De.has(t)?"transform":Ao.has(t)?Yo(t):void 0}class Qo extends Uo{constructor(){super(...arguments),this.output=[],this.counts=new Map}add(t){const e=Zo(t);if(!e)return;const n=this.counts.get(e)||0;this.counts.set(e,n+1),0===n&&(this.output.push(e),this.update());let r=!1;return()=>{if(r)return;r=!0;const t=this.counts.get(e)-1;this.counts.set(e,t),0===t&&(Do(this.output,e),this.update())}}update(){this.set(this.output.length?this.output.join(", "):"auto")}}const Jo=t=>Boolean(t&&t.getVelocity);function ti(t,e){var n;if(!t.applyWillChange)return;let r=t.getValue("willChange");return r||(null===(n=t.props.style)||void 0===n?void 0:n.willChange)||(r=new Qo("auto"),t.addValue("willChange",r)),o=r,Boolean(Jo(o)&&o.add)?r.add(e):void 0;var o}function ei({protectedKeys:t,needsAnimating:e},n){const r=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,r}function ni(t,e,{delay:n=0,transitionOverride:r,type:o}={}){var i;let{transition:a=t.getDefaultTransition(),transitionEnd:s,...u}=e;r&&(a=r);const c=[],l=o&&t.animationState&&t.animationState.getState()[o];for(const e in u){const r=t.getValue(e,null!==(i=t.latestValues[e])&&void 0!==i?i:null),o=u[e];if(void 0===o||l&&ei(l,e))continue;const s={delay:n,...We(a||{},e)};let f=!1;if(window.MotionHandoffAnimation){const n=Ko(t);if(n){const t=window.MotionHandoffAnimation(n,e,Ce);null!==t&&(s.startTime=t,f=!0)}}r.start(Lo(e,r,o,t.shouldReduceMotion&&De.has(e)?{type:!1}:s,t,f,ti(t,e)));const d=r.animation;d&&c.push(d)}return s&&Promise.all(c).then((()=>{Ce.update((()=>{s&&function(t,e){const n=Wo(t,e);let{transitionEnd:r={},transition:o={},...i}=n||{};i={...i,...r};for(const e in i)qo(t,e,Ro(i[e]))}(t,s)}))})),c}const ri={};function oi(t,{layout:e,layoutId:n}){return De.has(t)||t.startsWith("origin")||(e||void 0!==n)&&(!!ri[t]||"opacity"===t)}function ii(t,e,n){var r;const{style:o}=t,i={};for(const a in o)(Jo(o[a])||e.style&&Jo(e.style[a])||oi(a,t)||void 0!==(null===(r=null==n?void 0:n.getValue(a))||void 0===r?void 0:r.liveStyle))&&(i[a]=o[a]);return n&&o&&"string"==typeof o.willChange&&(n.applyWillChange=!1),i}function ai(t,e,n){const r=ii(t,e,n);for(const n in t)if(Jo(t[n])||Jo(e[n])){r[-1!==Ve.indexOf(n)?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n]=t[n]}return r}const si="undefined"!=typeof window,ui={current:null},ci={current:!1};function li(t){return null!==t&&"object"==typeof t&&"function"==typeof t.start}function fi(t){return"string"==typeof t||Array.isArray(t)}const di=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],pi=["initial",...di];function hi(t){return li(t.animate)||pi.some((e=>fi(t[e])))}function yi(t){return Boolean(hi(t)||t.variants)}const vi={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},mi={};for(const t in vi)mi[t]={isEnabled:e=>vi[t].some((t=>!!e[t]))};const gi=[...jn,Gn,er],bi=()=>({x:{min:0,max:0},y:{min:0,max:0}}),wi=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],_i=pi.length;class Si{scrapeMotionValuesFromProps(t,e,n){return{}}constructor({parent:t,props:e,presenceContext:n,reducedMotionConfig:r,blockInitialAnimation:o,visualState:i},a={}){this.applyWillChange=!1,this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Rn,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.isRenderScheduled=!1,this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.isRenderScheduled=!1,this.scheduleRender=()=>{this.isRenderScheduled||(this.isRenderScheduled=!0,Ce.render(this.render,!1,!0))};const{latestValues:s,renderState:u}=i;this.latestValues=s,this.baseTarget={...s},this.initialValues=e.initial?{...s}:{},this.renderState=u,this.parent=t,this.props=e,this.presenceContext=n,this.depth=t?t.depth+1:0,this.reducedMotionConfig=r,this.options=a,this.blockInitialAnimation=Boolean(o),this.isControllingVariants=hi(e),this.isVariantNode=yi(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:c,...l}=this.scrapeMotionValuesFromProps(e,{},this);for(const t in l){const e=l[t];void 0!==s[t]&&Jo(e)&&e.set(s[t],!1)}}mount(t){this.current=t,Te.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach(((t,e)=>this.bindToMotionValue(e,t))),ci.current||function(){if(ci.current=!0,si)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>ui.current=t.matches;t.addListener(e),e()}else ui.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||ui.current),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){Te.delete(this.current),this.projection&&this.projection.unmount(),Ie(this.notifyUpdate),Ie(this.render),this.valueSubscriptions.forEach((t=>t())),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const e=this.features[t];e&&(e.unmount(),e.isMounted=!1)}this.current=null}bindToMotionValue(t,e){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const n=De.has(t),r=e.on("change",(e=>{this.latestValues[t]=e,this.props.onUpdate&&Ce.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0)})),o=e.on("renderRequest",this.scheduleRender);let i;window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,t,e)),this.valueSubscriptions.set(t,(()=>{r(),o(),i&&i(),e.owner&&e.stop()}))}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}updateFeatures(){let t="animation";for(t in mi){const e=mi[t];if(!e)continue;const{isEnabled:n,Feature:r}=e;if(!this.features[t]&&r&&n(this.props)&&(this.features[t]=new r(this)),this.features[t]){const e=this.features[t];e.isMounted?e.update():(e.mount(),e.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,e){this.latestValues[t]=e}update(t,e){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let e=0;e<wi.length;e++){const n=wi[e];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);const r=t["on"+n];r&&(this.propEventSubscriptions[n]=this.on(n,r))}this.prevMotionValues=function(t,e,n){for(const r in e){const o=e[r],i=n[r];if(Jo(o))t.addValue(r,o);else if(Jo(i))t.addValue(r,Ho(o,{owner:t}));else if(i!==o)if(t.hasValue(r)){const e=t.getValue(r);!0===e.liveStyle?e.jump(o):e.hasAnimated||e.set(o)}else{const e=t.getStaticValue(r);t.addValue(r,Ho(void 0!==e?e:o,{owner:t}))}}for(const r in n)void 0===e[r]&&t.removeValue(r);return e}(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}getVariantContext(t=!1){if(t)return this.parent?this.parent.getVariantContext():void 0;if(!this.isControllingVariants){const t=this.parent&&this.parent.getVariantContext()||{};return void 0!==this.props.initial&&(t.initial=this.props.initial),t}const e={};for(let t=0;t<_i;t++){const n=pi[t],r=this.props[n];(fi(r)||!1===r)&&(e[n]=r)}return e}addVariantChild(t){const e=this.getClosestVariantNode();if(e)return e.variantChildren&&e.variantChildren.add(t),()=>e.variantChildren.delete(t)}addValue(t,e){const n=this.values.get(t);e!==n&&(n&&this.removeValue(t),this.bindToMotionValue(t,e),this.values.set(t,e),this.latestValues[t]=e.get())}removeValue(t){this.values.delete(t);const e=this.valueSubscriptions.get(t);e&&(e(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let n=this.values.get(t);return void 0===n&&void 0!==e&&(n=Ho(null===e?void 0:e,{owner:this}),this.addValue(t,n)),n}readValue(t,e){var n;let r=void 0===this.latestValues[t]&&this.current?null!==(n=this.getBaseTargetFromProps(this.props,t))&&void 0!==n?n:this.readValueFromInstance(this.current,t,this.options):this.latestValues[t];var o;return null!=r&&("string"==typeof r&&(Ze(r)||Ke(r))?r=parseFloat(r):(o=r,!gi.find(Pn(o))&&er.test(e)&&(r=lr(t,e))),this.setBaseTarget(t,Jo(r)?r.get():r)),Jo(r)?r.get():r}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){var e;const{initial:n}=this.props;let r;if("string"==typeof n||"object"==typeof n){const o=zo(this.props,n,null===(e=this.presenceContext)||void 0===e?void 0:e.custom);o&&(r=o[t])}if(n&&void 0!==r)return r;const o=this.getBaseTargetFromProps(this.props,t);return void 0===o||Jo(o)?void 0!==this.initialValues[t]&&void 0===r?void 0:this.baseTarget[t]:o}on(t,e){return this.events[t]||(this.events[t]=new Bo),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}}class ki extends Si{constructor(){super(...arguments),this.KeyframeResolver=dr}sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){return t.style?t.style[e]:void 0}removeValueFromRenderState(t,{vars:e,style:n}){delete e[t],delete n[t]}}const xi=(t,e)=>e&&"number"==typeof t?e.transform(t):t,Ai={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Ti=Ve.length;function Ei(t,e,n){const{style:r,vars:o,transformOrigin:i}=t;let a=!1,s=!1;for(const t in e){const n=e[t];if(De.has(t))a=!0;else if(Je(t))o[t]=n;else{const e=xi(n,sr[t]);t.startsWith("origin")?(s=!0,i[t]=e):r[t]=e}}if(e.transform||(a||n?r.transform=function(t,e,n){let r="",o=!0;for(let i=0;i<Ti;i++){const a=Ve[i],s=t[a];if(void 0===s)continue;let u=!0;if(u="number"==typeof s?s===(a.startsWith("scale")?1:0):0===parseFloat(s),!u||n){const t=xi(s,sr[a]);u||(o=!1,r+=`${Ai[a]||a}(${t}) `),n&&(e[a]=t)}}return r=r.trim(),n?r=n(e,o?"":r):o&&(r="none"),r}(e,t.transform,n):r.transform&&(r.transform="none")),s){const{originX:t="50%",originY:e="50%",originZ:n=0}=i;r.transformOrigin=`${t} ${e} ${n}`}}function Oi(t,e,n){return"string"==typeof t?t:gn.transform(e+n*t)}const Pi={offset:"stroke-dashoffset",array:"stroke-dasharray"},ji={offset:"strokeDashoffset",array:"strokeDasharray"};function Ci(t,{attrX:e,attrY:n,attrScale:r,originX:o,originY:i,pathLength:a,pathSpacing:s=1,pathOffset:u=0,...c},l,f){if(Ei(t,c,f),l)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:d,style:p,dimensions:h}=t;d.transform&&(h&&(p.transform=d.transform),delete d.transform),h&&(void 0!==o||void 0!==i||p.transform)&&(p.transformOrigin=function(t,e,n){return`${Oi(e,t.x,t.width)} ${Oi(n,t.y,t.height)}`}(h,void 0!==o?o:.5,void 0!==i?i:.5)),void 0!==e&&(d.x=e),void 0!==n&&(d.y=n),void 0!==r&&(d.scale=r),void 0!==a&&function(t,e,n=1,r=0,o=!0){t.pathLength=1;const i=o?Pi:ji;t[i.offset]=gn.transform(-r);const a=gn.transform(e),s=gn.transform(n);t[i.array]=`${a} ${s}`}(d,a,s,u,!1)}const Ii=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function Mi(t,{style:e,vars:n},r,o){Object.assign(t.style,e,o&&o.getProjectionStyles(r));for(const e in n)t.style.setProperty(e,n[e])}function Li(t,e,n,r){Mi(t,e,void 0,r);for(const n in e.attrs)t.setAttribute(Ii.has(n)?n:Yo(n),e.attrs[n])}const Ni=t=>"string"==typeof t&&"svg"===t.toLowerCase();class Fi extends ki{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=bi}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(De.has(e)){const t=cr(e);return t&&t.default||0}return e=Ii.has(e)?e:Yo(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,n){return ai(t,e,n)}build(t,e,n){Ci(t,e,this.isSVGTag,n.transformTemplate)}renderInstance(t,e,n,r){Li(t,e,0,r)}mount(t){this.isSVGTag=Ni(t.tagName),super.mount(t)}}function Ri(t,e){return function({top:t,left:e,right:n,bottom:r}){return{x:{min:e,max:n},y:{min:t,max:r}}}(function(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),r=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}(t.getBoundingClientRect(),e))}class Vi extends ki{constructor(){super(...arguments),this.type="html",this.applyWillChange=!0,this.renderInstance=Mi}readValueFromInstance(t,e){if(De.has(e)){const t=cr(e);return t&&t.default||0}{const r=(n=t,window.getComputedStyle(n)),o=(Je(e)?r.getPropertyValue(e):r[e])||0;return"string"==typeof o?o.trim():o}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return Ri(t,e)}build(t,e,n){Ei(t,e,n.transformTemplate)}scrapeMotionValuesFromProps(t,e,n){return ii(t,e,n)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Jo(t)&&(this.childSubscription=t.on("change",(t=>{this.current&&(this.current.textContent=`${t}`)})))}}function Di(t){const e={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},n=function(t){return t instanceof SVGElement&&"svg"!==t.tagName}(t)?new Fi(e):new Vi(e);n.mount(t),Te.set(t,n)}function Bi(t,e,n){const r=Jo(t)?t:Ho(t);return r.start(Lo("",r,e,n)),r.animation}function $i(t,e=100){const n=Ir({keyframes:[0,e],...t}),r=Math.min(wo(n),bo);return{type:"keyframes",ease:t=>n.next(r*t).value/e,duration:$e(r)}}function Ui(t,e,n,r){var o;return"number"==typeof e?e:e.startsWith("-")||e.startsWith("+")?Math.max(0,t+parseFloat(e)):"<"===e?n:null!==(o=r.get(e))&&void 0!==o?o:t}const Hi=(t,e,n)=>{const r=e-t;return((n-t)%r+r)%r+t};function Gi(t,e){return $r(t)?t[Hi(0,t.length,e)]:t}function zi(t,e,n,r,o,i){!function(t,e,n){for(let r=0;r<t.length;r++){const o=t[r];o.at>e&&o.at<n&&(Do(t,o),r--)}}(t,o,i);for(let a=0;a<e.length;a++)t.push({value:e[a],at:to(o,i,r[a]),easing:Gi(n,a)})}function Wi(t,e){return t.at===e.at?null===t.value?1:null===e.value?-1:0:t.at-e.at}const qi="easeInOut";function Yi(t,e){return!e.has(t)&&e.set(t,{}),e.get(t)}function Xi(t,e){return e[t]||(e[t]=[]),e[t]}function Ki(t){return Array.isArray(t)?t:[t]}function Zi(t,e){return t[e]?{...t,...t[e]}:{...t}}const Qi=t=>"number"==typeof t,Ji=t=>t.every(Qi);function ta(t,e,n,r){const o=Ae(t,r),i=o.length;xe(Boolean(i),"No valid element provided.");const a=[];for(let t=0;t<i;t++){const r=o[t];Te.has(r)||Di(r);const s=Te.get(r),u={...n};"function"==typeof u.delay&&(u.delay=u.delay(t,i)),a.push(...ni(s,{...e,transition:u},{}))}return new Re(a)}function ea(t,e,n){const r=[],o=function(t,{defaultTransition:e={},...n}={},r){const o=e.duration||.3,i=new Map,a=new Map,s={},u=new Map;let c=0,l=0,f=0;for(let n=0;n<t.length;n++){const i=t[n];if("string"==typeof i){u.set(i,l);continue}if(!Array.isArray(i)){u.set(i.name,Ui(l,i.at,c,u));continue}let[d,p,h={}]=i;void 0!==h.at&&(l=Ui(l,h.at,c,u));let y=0;const v=(t,n,r,i=0,a=0)=>{const s=Ki(t),{delay:u=0,times:c=mo(s),type:d="keyframes",...p}=n;let{ease:h=e.ease||"easeOut",duration:v}=n;const m="function"==typeof u?u(i,a):u,g=s.length;if(g<=2&&"spring"===d){let t=100;if(2===g&&Ji(s)){const e=s[1]-s[0];t=Math.abs(e)}const e={...p};void 0!==v&&(e.duration=Be(v));const n=$i(e,t);h=n.ease,v=n.duration}null!=v||(v=o);const b=l+m,w=b+v;1===c.length&&0===c[0]&&(c[1]=1);const _=c.length-s.length;_>0&&vo(c,_),1===s.length&&s.unshift(null),zi(r,s,h,c,b,w),y=Math.max(m+v,y),f=Math.max(w,f)};if(Jo(d))v(p,h,Xi("default",Yi(d,a)));else{const t=Ae(d,r,s),e=t.length;for(let n=0;n<e;n++){const r=Yi(t[n],a);for(const t in p)v(p[t],Zi(h,t),Xi(t,r),n,e)}}c=l,l+=y}return a.forEach(((t,r)=>{for(const o in t){const a=t[o];a.sort(Wi);const s=[],u=[],c=[];for(let t=0;t<a.length;t++){const{at:e,value:n,easing:r}=a[t];s.push(n),u.push(Jr(0,f,e)),c.push(r||"easeOut")}0!==u[0]&&(u.unshift(0),s.unshift(s[0]),c.unshift(qi)),1!==u[u.length-1]&&(u.push(1),s.push(null)),i.has(r)||i.set(r,{keyframes:{},transition:{}});const l=i.get(r);l.keyframes[o]=s,l.transition[o]={...e,duration:f,ease:c,times:u,...n}}})),i}(t,e,n);return o.forEach((({keyframes:t,transition:e},n)=>{let o;o=Jo(n)?Bi(n,t.default,e.default):ta(n,t,e),r.push(o)})),new Re(r)}const na=function(t,e,n){let r;var o;return o=t,r=Array.isArray(o)&&Array.isArray(o[0])?ea(t,e,ra):function(t){return"object"==typeof t&&!Array.isArray(t)}(e)?ta(t,e,n,ra):Bi(t,e,n),ra&&ra.animations.push(r),r};var ra;function oa(t){return oa="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},oa(t)}function ia(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ia=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function c(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,n){return t[e]=n}}function l(t,e,n,r){var i=e&&e.prototype instanceof m?e:m,a=Object.create(i.prototype),s=new j(r||[]);return o(a,"_invoke",{value:T(t,n,s)}),a}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var d="suspendedStart",p="suspendedYield",h="executing",y="completed",v={};function m(){}function g(){}function b(){}var w={};c(w,a,(function(){return this}));var _=Object.getPrototypeOf,S=_&&_(_(C([])));S&&S!==n&&r.call(S,a)&&(w=S);var k=b.prototype=m.prototype=Object.create(w);function x(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function A(t,e){function n(o,i,a,s){var u=f(t[o],t,i);if("throw"!==u.type){var c=u.arg,l=c.value;return l&&"object"==oa(l)&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,s)}),(function(t){n("throw",t,a,s)})):e.resolve(l).then((function(t){c.value=t,a(c)}),(function(t){return n("throw",t,a,s)}))}s(u.arg)}var i;o(this,"_invoke",{value:function(t,r){function o(){return new e((function(e,o){n(t,r,e,o)}))}return i=i?i.then(o,o):o()}})}function T(e,n,r){var o=d;return function(i,a){if(o===h)throw Error("Generator is already running");if(o===y){if("throw"===i)throw a;return{value:t,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var u=E(s,r);if(u){if(u===v)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===d)throw o=y,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=h;var c=f(e,n,r);if("normal"===c.type){if(o=r.done?y:p,c.arg===v)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(o=y,r.method="throw",r.arg=c.arg)}}}function E(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,E(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var i=f(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function C(e){if(e||""===e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function n(){for(;++o<e.length;)if(r.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return i.next=i}}throw new TypeError(oa(e)+" is not iterable")}return g.prototype=b,o(k,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:g,configurable:!0}),g.displayName=c(b,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,c(t,u,"GeneratorFunction")),t.prototype=Object.create(k),t},e.awrap=function(t){return{__await:t}},x(A.prototype),c(A.prototype,s,(function(){return this})),e.AsyncIterator=A,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new A(l(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},x(k),c(k,u,"Generator"),c(k,a,(function(){return this})),c(k,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=C,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(P),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function o(r,o){return s.type="throw",s.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(u&&c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),P(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;P(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:C(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}function aa(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=ua(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function sa(t){return function(t){if(Array.isArray(t))return ca(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||ua(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ua(t,e){if(t){if("string"==typeof t)return ca(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ca(t,e):void 0}}function ca(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function la(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,da(r.key),r)}}function fa(t,e,n){return(e=da(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function da(t){var e=function(t,e){if("object"!=oa(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=oa(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==oa(e)?e:e+""}var pa=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{u(r.next(t))}catch(t){i(t)}}function s(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},ha=fa(fa(fa({},le.left,"25.33%"),le.center,"50%"),le.right,"75.66%"),ya=function(){function t(e,n){if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.sequences=[],this.control=null,this.transformers={},Array.isArray(e)){var r;(r=this.sequences).push.apply(r,sa(e)),this.sequenceOptions=Object.assign({},t.defaultSequenceOptions,n||{})}else{var o=e,i=n||t.defaultOptions;this.sequences.push({props:o,options:i||{}}),this.sequenceOptions=Object.assign({},t.defaultSequenceOptions)}}return function(t,e,n){return e&&la(t.prototype,e),n&&la(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}(t,[{key:"animate",value:function(e,n,r,o){var i=e.scope,a=e.overwrites;return pa(this,void 0,void 0,ia().mark((function e(){var s=this;return ia().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=p(r,{}),e.abrupt("return",new Promise((function(e){pa(s,void 0,void 0,ia().mark((function s(){var u,c,l,f,d=this;return ia().wrap((function(s){for(;;)switch(s.prev=s.next){case 0:this.sequenceOptions.sync||(e(),o&&o(r)),u=0;case 2:if(!(u<this.sequenceOptions.repeat)){s.next=22;break}c=aa(this.sequences),s.prev=4,f=ia().mark((function e(){var o,s,u,c,f,h;return ia().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=l.value,s=o.props,u=o.options,c=p({},d.propToCSS(n,r)),i.current){e.next=4;break}throw new Error("No scope found when animating.");case 4:if(f=i.current,Object.assign(f.style,c),r=t.mergeState(r,s),h=na(f,d.propToCSS(n,r,a),d.optionsToFramerMotionOptions(u)||{}),d.setControl(h),!1===(null==u?void 0:u.sync)){e.next=16;break}return e.next=12,new Promise((function(t){return h.then((function(){return t()}))}));case 12:Object.assign(f.style,d.propToCSS(n,r,a)),d.setControl(null),e.next=17;break;case 16:h.then((function(){Object.assign(f.style,d.propToCSS(n,r,a)),d.setControl(null)}));case 17:case"end":return e.stop()}}),e)})),c.s();case 7:if((l=c.n()).done){s.next=11;break}return s.delegateYield(f(),"t0",9);case 9:s.next=7;break;case 11:s.next=16;break;case 13:s.prev=13,s.t1=s.catch(4),c.e(s.t1);case 16:return s.prev=16,c.f(),s.finish(16);case 19:u++,s.next=2;break;case 22:return s.next=24,b(2);case 24:this.setControl(null),this.sequenceOptions.sync&&(e(),o&&o(r));case 26:case"end":return s.stop()}}),s,this,[[4,13,16,19]])})))})));case 2:case"end":return e.stop()}}),e)})))}},{key:"repeat",value:function(t){return this.sequenceOptions.repeat*=t,this}},{key:"overwrite",value:function(t,e){return this.transformers[t]=e,this}},{key:"propToCSS",value:function(e,n,r){var o,i=(null===(o=e.getLastScene())||void 0===o?void 0:o.config)||{},a=i.invertY,s=i.invertX,u={position:function(e){return t.positionToCSS(e,a,s)},backgroundColor:function(e){return t.backgroundToCSS(e)},backgroundOpacity:function(t){return{opacity:t}},opacity:function(t){return{opacity:t}},scale:function(){return"scale"in n?{width:"".concat(100*n.scale,"%")}:{}},rotation:function(){return{}},display:function(){return{}},src:function(){return{}}},c={};for(var l in c.transform=this.propToCSSTransform(e,n),this.transformers.transform&&Object.assign(c,this.transformers.transform(n)),r&&r.transform&&Object.assign(c,r.transform(n)),n)Object.prototype.hasOwnProperty.call(n,l)&&(r&&r[l]?Object.assign(c,r[l](n[l])):this.transformers[l]?Object.assign(c,this.transformers[l](n[l])):u[l]&&Object.assign(c,u[l](n[l])));return c}},{key:"optionsToFramerMotionOptions",value:function(t){if(!t)return t;var e=t.duration;return{duration:e?e/1e3:0,ease:t.ease}}},{key:"propToCSSTransform",value:function(t,e){var n;if(!t.getLastScene())throw new Error('No scene found in state, make sure you called "scene.activate()" before this method.');var r=(null===(n=t.getLastScene())||void 0===n?void 0:n.config)||{},o=r.invertY,i=r.invertX;return["translate(".concat(i?"":"-","50%, ").concat(o?"":"-","50%)"),void 0!==e.rotation&&"rotate(".concat(e.rotation,"deg)")].filter(Boolean).join(" ")}},{key:"setControl",value:function(t){return this.control=t,this}},{key:"getControl",value:function(){return this.control}},{key:"copy",value:function(){return new t(this.sequences,this.sequenceOptions)}}],[{key:"isPosition",value:function(t){return be.isCommonPositionType(t)||we.isCoord2DPosition(t)||_e.isAlignPosition(t)}},{key:"positionToCSS",value:function(t,e,n){return ge.D2PositionToCSS(t.toCSS(),n,e)}},{key:"backgroundToCSS",value:function(t){return null==t?{}:gs.isStaticImageData(t)?{backgroundImage:"url(".concat(t.src,")")}:"string"==typeof t?{backgroundColor:t}:["r","g","b"].every((function(e){return e in t}))?{backgroundColor:v(t)}:{backgroundImage:"url("+t.url+")"}}},{key:"mergePosition",value:function(t,e){if(!t&&!e)throw new Error("No position found.");return t&&e?ge.mergePosition(ge.tryParsePosition(t),ge.tryParsePosition(e)):ge.toCoord2D(ge.tryParsePosition(t||e))}},{key:"mergeState",value:function(t,e){var n=this.mergePosition(t.position,e.position);return Object.assign(Object.assign({},p(t,e)),{position:n})}}])}();function va(t){return va="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},va(t)}function ma(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,ga(r.key),r)}}function ga(t){var e=function(t,e){if("object"!=va(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=va(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==va(e)?e:e+""}function ba(t,e,n){return e=_a(e),function(t,e){if(e&&("object"==va(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,wa()?Reflect.construct(e,n||[],_a(t).constructor):e.apply(t,n))}function wa(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(wa=function(){return!!t})()}function _a(t){return _a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},_a(t)}function Sa(t,e){return Sa=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Sa(t,e)}ya.defaultSequenceOptions={sync:!0,repeat:1},ya.defaultOptions={duration:0,ease:"linear"},ya.CommonImagePositionMap=ha;var ka=function(t){function e(t,n){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=ba(this,e,[mt.IdPrefixes.Image])).events=new m,r.ref=void 0,"string"==typeof t?(r.name=t,r.config=p(e.defaultConfig,n||{}),r.config.position&&(r.config.position=ge.tryParsePosition(r.config.position))):(r.name="",r.config=p(e.defaultConfig,t),r.config.position&&(r.config.position=ge.tryParsePosition(r.config.position))),r.state=p({},r.config),r.actions=[],r.checkConfig(),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Sa(t,e)}(e,t),function(t,e,n){return e&&ma(t.prototype,e),n&&ma(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}(e,[{key:"dispose",value:function(){return this._dispose()}},{key:"init",value:function(){return this._init()}},{key:"checkConfig",value:function(){if(!this.config.src)throw new Error("Image src is required");if(!ya.isPosition(this.config.position))throw new Error("Invalid position\nPosition must be one of CommonImagePosition, Align, Coord2D");return this}},{key:"setSrc",value:function(t,e){if(e){var n=e.copy();n.setSrc(gs.srcToString(t)),this._transitionSrc(n)}var r=new es(this,es.ActionTypes.setSrc,new ce(Yt.getIdManager().getStringId()).setContent(["string"==typeof t?t:gs.staticImageDataToSrc(t)]));return this.actions.push(r),this}},{key:"applyTransform",value:function(t){var e=new es(this,es.ActionTypes.applyTransform,new ce(Yt.getIdManager().getStringId()).setContent([void 0,t,g()]));return this.actions.push(e),this}},{key:"show",value:function(t){var e=t instanceof ya?t:new ya([{props:{opacity:1},options:t||{}}]),n=new es(this,es.ActionTypes.show,new ce(Yt.getIdManager().getStringId()).setContent([void 0,e]));return this.actions.push(n),this}},{key:"hide",value:function(t){var e=new es(this,es.ActionTypes.hide,new ce(Yt.getIdManager().getStringId()).setContent([void 0,t instanceof ya?t:new ya([{props:{opacity:0},options:t||{}}])]));return this.actions.push(e),this}},{key:"toTransform",value:function(){return new ya(this.state,{duration:0})}},{key:"setScope",value:function(t){return this.ref=t,this}},{key:"getScope",value:function(){return this.ref}},{key:"copy",value:function(){return new e(this.name,this.config)}},{key:"toData",value:function(){return this.state.disposed||w(this.state,this.config)?null:{state:p({},e.serializeImageState(this.state))}}},{key:"fromData",value:function(t){return this.state=p(this.state,e.deserializeImageState(t.state)),this}},{key:"_$setDispose",value:function(){return this.state.disposed=!0,this}},{key:"_setTransition",value:function(t){return this.actions.push(new es(this,es.ActionTypes.setTransition,new ce(Yt.getIdManager().getStringId()).setContent([t]))),this}},{key:"_applyTransition",value:function(t){return this.actions.push(new es(this,"image:applyTransition",new ce(Yt.getIdManager().getStringId()).setContent([t]))),this}},{key:"_transitionSrc",value:function(t){return this._setTransition(t)._applyTransition(t),this}},{key:"_dispose",value:function(){return this.actions.push(new es(this,es.ActionTypes.dispose,new ce(Yt.getIdManager().getStringId()))),this}},{key:"_init",value:function(t){return this.actions.push(new es(this,es.ActionTypes.init,new ce(Yt.getIdManager().getStringId()).setContent([t]))),this}}],[{key:"serializeImageState",value:function(t){var e={position:function(t){return ge.serializePosition(t)}},n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=e[r]?e[r](t[r]):t[r]);return n}},{key:"deserializeImageState",value:function(t){var e={position:function(t){return ge.toCoord2D(t)}},n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=e[r]?e[r](t[r]):t[r]);return n}}])}(mt);function xa(t){return xa="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xa(t)}function Aa(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Ta(r.key),r)}}function Ta(t){var e=function(t,e){if("object"!=xa(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=xa(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==xa(e)?e:e+""}ka.EventTypes={"event:image.show":"event:image.show","event:image.hide":"event:image.hide","event:image.init":"event:image.init","event:image.applyTransform":"event:image.applyTransform","event:image.mount":"event:image.mount","event:image.unmount":"event:image.unmount","event:image.ready":"event:image.ready","event:image.elementLoaded":"event:image.elementLoaded","event:image.setTransition":"event:image.setTransition"},ka.defaultConfig={src:"",display:!1,position:new be(se.Center),scale:1,rotation:0,opacity:0},ka.ImagePosition=le;var Ea=function(){return function(t,e,n){return e&&Aa(t.prototype,e),n&&Aa(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}((function t(e,n,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.callee=e,this.type=n,this.contentNode=r,this.__stack=g(4,4),this._id=Yt.getIdManager().prefix("action",Yt.getIdManager().getStringId(),"-")}),[{key:"executeAction",value:function(t){return{type:this.type,node:this.contentNode}}},{key:"getId",value:function(){return this._id}},{key:"getFutureActions",value:function(){var t=this.contentNode.child;return t&&t.action?[t.action]:[]}}])}();Ea.ActionTypes={action:"action"};var Oa={say:"character:say",action:"character:action"},Pa={action:"scene:action",setBackground:"scene:setBackground",sleep:"scene:sleep",setTransition:"scene:setTransition",applyTransition:"scene:applyTransition",init:"scene:init",exit:"scene:exit",jumpTo:"scene:jumpTo",setBackgroundMusic:"scene:setBackgroundMusic",preUnmount:"scene:preUnmount",applyTransform:"scene:applyTransform"},ja={action:"image:action",setSrc:"image:setSrc",setPosition:"image:setPosition",show:"image:show",hide:"image:hide",applyTransform:"image:applyTransform",init:"image:init",dispose:"image:dispose",setTransition:"image:setTransition",applyTransition:"image:applyTransition"},Ca={action:"sound:action",play:"sound:play",stop:"sound:stop",fade:"sound:fade",setVolume:"sound:setVolume",setRate:"sound:setRate",pause:"sound:pause",resume:"sound:resume"},Ia={action:"control:action",do:"control:do",doAsync:"control:doAsync",any:"control:any",all:"control:all",allAsync:"control:allAsync",repeat:"control:repeat"};function Ma(t){return Ma="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ma(t)}function La(t){return function(t){if(Array.isArray(t))return Va(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||Ra(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Na(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */Na=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function c(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,n){return t[e]=n}}function l(t,e,n,r){var i=e&&e.prototype instanceof m?e:m,a=Object.create(i.prototype),s=new j(r||[]);return o(a,"_invoke",{value:T(t,n,s)}),a}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var d="suspendedStart",p="suspendedYield",h="executing",y="completed",v={};function m(){}function g(){}function b(){}var w={};c(w,a,(function(){return this}));var _=Object.getPrototypeOf,S=_&&_(_(C([])));S&&S!==n&&r.call(S,a)&&(w=S);var k=b.prototype=m.prototype=Object.create(w);function x(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function A(t,e){function n(o,i,a,s){var u=f(t[o],t,i);if("throw"!==u.type){var c=u.arg,l=c.value;return l&&"object"==Ma(l)&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,s)}),(function(t){n("throw",t,a,s)})):e.resolve(l).then((function(t){c.value=t,a(c)}),(function(t){return n("throw",t,a,s)}))}s(u.arg)}var i;o(this,"_invoke",{value:function(t,r){function o(){return new e((function(e,o){n(t,r,e,o)}))}return i=i?i.then(o,o):o()}})}function T(e,n,r){var o=d;return function(i,a){if(o===h)throw Error("Generator is already running");if(o===y){if("throw"===i)throw a;return{value:t,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var u=E(s,r);if(u){if(u===v)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===d)throw o=y,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=h;var c=f(e,n,r);if("normal"===c.type){if(o=r.done?y:p,c.arg===v)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(o=y,r.method="throw",r.arg=c.arg)}}}function E(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,E(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var i=f(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function C(e){if(e||""===e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function n(){for(;++o<e.length;)if(r.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return i.next=i}}throw new TypeError(Ma(e)+" is not iterable")}return g.prototype=b,o(k,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:g,configurable:!0}),g.displayName=c(b,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,c(t,u,"GeneratorFunction")),t.prototype=Object.create(k),t},e.awrap=function(t){return{__await:t}},x(A.prototype),c(A.prototype,s,(function(){return this})),e.AsyncIterator=A,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new A(l(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},x(k),c(k,u,"Generator"),c(k,a,(function(){return this})),c(k,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=C,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(P),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function o(r,o){return s.type="throw",s.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(u&&c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),P(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;P(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:C(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}function Fa(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,s=[],u=!0,c=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(s.push(r.value),s.length!==e);u=!0);}catch(t){c=!0,o=t}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(t,e)||Ra(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ra(t,e){if(t){if("string"==typeof t)return Va(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Va(t,e):void 0}}function Va(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Da(t,e,n,r){var o=Ba(qa(1&r?t.prototype:t),e,n);return 2&r&&"function"==typeof o?function(t){return o.apply(n,t)}:o}function Ba(){return Ba="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=qa(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},Ba.apply(null,arguments)}function $a(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ua(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Ga(r.key),r)}}function Ha(t,e,n){return e&&Ua(t.prototype,e),n&&Ua(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function Ga(t){var e=function(t,e){if("object"!=Ma(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=Ma(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Ma(e)?e:e+""}function za(t,e,n){return e=qa(e),function(t,e){if(e&&("object"==Ma(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Wa()?Reflect.construct(e,n||[],qa(t).constructor):e.apply(t,n))}function Wa(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Wa=function(){return!!t})()}function qa(t){return qa=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},qa(t)}function Ya(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Xa(t,e)}function Xa(t,e){return Xa=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Xa(t,e)}var Ka=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{u(r.next(t))}catch(t){i(t)}}function s(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},Za=function(t){function e(t,n,r){var o;return $a(this,e),(o=za(this,e,[t,n,r])).callee=t,o.contentNode.action=o,o}return Ya(e,t),Ha(e,[{key:"unknownType",value:function(){throw new Error("Unknown action type: "+this.type)}}])}(Ea),Qa=function(t){function e(){return $a(this,e),za(this,e,arguments)}return Ya(e,t),Ha(e,[{key:"executeAction",value:function(t){var n=this;if(this.type===Oa.say){var r=new h((function(t){return t})),o=this.contentNode.getContent();return t.createText(this.contentNode.id,o,(function(){r.resolve({type:n.type,node:n.contentNode.child})})),r}return Da(e,"executeAction",this,3)([t])}}])}(Za);Qa.ActionTypes=Oa;var Ja=function(t){function e(){return $a(this,e),za(this,e,arguments)}return Ya(e,t),Ha(e,[{key:"executeAction",value:function(t){var n,r,o=this;if(this.type===Pa.action)return Da(e,"executeAction",this,3)([t]);if(this.type===Pa.setBackground)return this.callee.state.background=this.contentNode.getContent()[0],Da(e,"executeAction",this,3)([t]);if(this.type===Pa.sleep){var i=new h((function(t){return t})),a=this.contentNode.getContent();return new Promise((function(t){"number"==typeof a?setTimeout((function(){t()}),a):h.isAwaitable(a)?a.then(t):null==a||a.then(t)})).then((function(){i.resolve({type:o.type,node:o.contentNode.child}),t.stage.next()})),i}if(this.type===Pa.setTransition)return this.callee.events.emit("event:scene.setTransition",this.contentNode.getContent()[0]),Da(e,"executeAction",this,3)([t]);if(this.type===Pa.applyTransition){var s=new h((function(t){return t}));return this.contentNode.getContent()[0].start((function(){s.resolve({type:o.type,node:o.contentNode.child}),t.stage.next()})),s}if(this.type===Pa.init){if(this.callee._liveState.active)return Da(e,"executeAction",this,3)([t]);this.callee._liveState.active=!0;var u=new h((function(t){return t}));return t.registerSrcManager(this.callee.srcManager).addScene(this.callee),this.callee.events.once("event:scene.unmount",(function(){t.offSrcManager(o.callee.srcManager)})),this.callee.events.once("event:scene.mount",(function(){o.callee.state.backgroundMusic&&(is.initSound(t,o.callee.state.backgroundMusic),o.callee.events.emit("event:scene.setBackgroundMusic",o.callee.state.backgroundMusic,o.callee.config.backgroundMusicFade))})),this.callee.events.once("event:scene.imageLoaded",(function(){var e=o.callee._toTransform();o.callee.events.any("event:scene.initTransform",e).then((function(){u.resolve({type:o.type,node:o.contentNode.child}),t.stage.next()}))})),u}if(this.type===Pa.exit){this.callee._liveState.active=!1,t.offSrcManager(this.callee.srcManager).removeScene(this.callee);var c=new h((function(t){return t}));return this.callee.events.once("event:scene.unmount",(function(){c.resolve({type:o.type,node:o.contentNode.child}),t.stage.next()})),c}if(this.type===Pa.jumpTo){var l=this.contentNode.getContent()[0],f=this.contentNode,d=null===(r=null===(n=l.getActions())||void 0===n?void 0:n[0])||void 0===r?void 0:r.contentNode;return d&&f.addChild(d),Da(e,"executeAction",this,3)([t])}if(this.type===Pa.setBackgroundMusic){var p=Fa(this.contentNode.getContent(),2),y=p[0],v=p[1];return this.callee.events.emit("event:scene.setBackgroundMusic",y,v||0),Da(e,"executeAction",this,3)([t])}if(this.type===Pa.preUnmount)return this.callee.events.emit("event:scene.preUnmount"),Da(e,"executeAction",this,3)([t]);if(this.type===Pa.applyTransform){var m=Fa(this.contentNode.getContent(),1)[0],g=new h((function(t){return t}));return this.callee.events.any("event:scene.applyTransform",m).then((function(){g.resolve({type:o.type,node:o.contentNode.child}),t.stage.next()})),g}throw new Error("Unknown scene action type: "+this.type)}},{key:"getFutureActions",value:function(){var t,e;if(this.type===Pa.jumpTo)return null===(t=this.contentNode.getContent()[0])||void 0===t?void 0:t.getActions();var n=null===(e=this.contentNode.child)||void 0===e?void 0:e.action;return n?[n]:[]}}])}(Za);Ja.ActionTypes=Pa;var ts=function(t){function e(){return $a(this,e),za(this,e,arguments)}return Ya(e,t),Ha(e)}(Za);ts.ActionTypes={action:"story:action"};var es=function(t){function e(){return $a(this,e),za(this,e,arguments)}return Ya(e,t),Ha(e,[{key:"executeAction",value:function(t){var n=this;if(this.type===ja.init){var r=t.findElementByImage(this.callee);r&&t.disposeImage(this.callee,r.scene);var o=this.contentNode.getContent()[0];t.createImage(this.callee,o);var i=new h((function(t){return t}));return this.callee.events.once("event:image.mount",(function(){return Ka(n,void 0,void 0,Na().mark((function e(){var n;return Na().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null===(n=this.callee.getScope())||void 0===n?void 0:n.current){e.next=3;break}return e.next=3,this.callee.events.any(ka.EventTypes["event:image.elementLoaded"]);case 3:return e.next=5,this.callee.events.any("event:image.init");case 5:i.resolve({type:this.type,node:this.contentNode.child}),t.stage.next();case 7:case"end":return e.stop()}}),e,this)})))})),i}if(this.type===ja.setSrc)return this.callee.state.src=this.contentNode.getContent()[0],t.stage.forceUpdate(),Da(e,"executeAction",this,3)([t]);if([ja.show,ja.hide,ja.applyTransform].includes(this.type)){var a=new h((function(t){return t})),s=this.contentNode.getContent()[1];return this.type===ja.show&&(this.callee.state.display=!0,t.stage.forceUpdate()),t.animateImage(ka.EventTypes["event:image.applyTransform"],this.callee,[s],(function(){var t;n.type===ja.hide&&(n.callee.state.display=!1),a.resolve({type:n.type,node:(null===(t=n.contentNode)||void 0===t?void 0:t.child)||null})})),a}if(this.type===ja.dispose)return t.disposeImage(this.callee),this.callee._$setDispose(),Da(e,"executeAction",this,3)([t]);if(this.type===ja.setTransition)return this.callee.events.emit("event:image.setTransition",this.contentNode.getContent()[0]),Da(e,"executeAction",this,3)([t]);if(this.type===ja.applyTransition){var u=new h((function(t){return t}));return this.contentNode.getContent()[0].start((function(){u.resolve({type:n.type,node:n.contentNode.child}),t.stage.next()})),u}throw Da(e,"unknownType",this,3)([])}}])}(Za);es.ActionTypes=ja;var ns=function(t){function e(){return $a(this,e),za(this,e,arguments)}return Ya(e,t),Ha(e,[{key:"executeAction",value:function(t){var e,n,r=this.callee.evaluate(this.contentNode.getContent(),{gameState:t});return null===(e=null==r?void 0:r[r.length-1])||void 0===e||e.contentNode.addChild(this.contentNode.getChild()),this.contentNode.addChild((null===(n=null==r?void 0:r[0])||void 0===n?void 0:n.contentNode)||null),{type:this.type,node:this.contentNode}}},{key:"getFutureActions",value:function(){return[].concat(La(this.callee._getFutureActions()),La(Da(e,"getFutureActions",this,3)([])))}}])}(Za);ns.ActionTypes={action:"condition:action"};var rs=function(t){function e(){return $a(this,e),za(this,e,arguments)}return Ya(e,t),Ha(e,[{key:"executeAction",value:function(t){return this.contentNode.getContent().execute({gameState:t}),{type:this.type,node:this.contentNode}}}])}(Za);rs.ActionTypes={action:"script:action"};var os=function(t){function e(){return $a(this,e),za(this,e,arguments)}return Ya(e,t),Ha(e,[{key:"executeAction",value:function(t){var e=this,n=new h((function(t){return t})),r=this.contentNode.getContent();return t.createMenu(r,(function(r){var o,i,a=(null===(o=t.game.getLiveGame().getCurrentAction())||void 0===o?void 0:o.contentNode.getChild())||null;a&&(null===(i=r.action[r.action.length-1])||void 0===i||i.contentNode.addChild(a)),n.resolve({type:e.type,node:r.action[0].contentNode})})),n}},{key:"getFutureActions",value:function(){var t=this.contentNode.getContent();return[].concat(La(this.callee._getFutureActions(t.choices)),La(Da(e,"getFutureActions",this,3)([])))}}])}(Za);os.ActionTypes={action:"menu:action"};var is=function(t){function e(){return $a(this,e),za(this,e,arguments)}return Ya(e,t),Ha(e,[{key:"executeAction",value:function(t){var n=this;if(this.type===Ca.play){if(e.initSound(t,this.callee),!this.callee.$getHowl())throw new Error("Howl is not initialized");if(this.callee.config.sync&&!this.callee.config.loop){var r=new h((function(t){return t})),o=t.playSound(this.callee.$getHowl(),(function(){var t;n.callee.$stop(),r.resolve({type:n.type,node:(null===(t=n.contentNode)||void 0===t?void 0:t.child)||null})}));return this.callee.$setToken(o),r}var i=t.playSound(this.callee.$getHowl(),(function(){n.callee.$stop()}));return this.callee.$setToken(i),Da(e,"executeAction",this,3)([t])}if(this.type===Ca.stop)return this.callee.$getHowl()&&(this.callee.$getHowl().stop(),this.callee.$stop()),Da(e,"executeAction",this,3)([t]);if(this.type===Ca.fade){var a=Fa(this.contentNode.getContent(),1)[0],s=a.start,u=a.end,c=a.duration;if(this.callee.$getHowl()){var l=void 0===s?this.callee.$getHowl().volume():s;this.callee.$getHowl().fade(l,u,c,this.callee.$getToken())}return Da(e,"executeAction",this,3)([t])}if(this.type===Ca.setVolume){var f=Fa(this.contentNode.getContent(),1)[0];return this.callee.$getHowl()&&this.callee.$getHowl().volume(f,this.callee.$getToken()),Da(e,"executeAction",this,3)([t])}if(this.type===Ca.setRate){var d=Fa(this.contentNode.getContent(),1)[0];return this.callee.$getHowl()&&this.callee.$getHowl().rate(d,this.callee.$getToken()),Da(e,"executeAction",this,3)([t])}if(this.type===Ca.pause)return this.callee.$getHowl()&&this.callee.$getHowl().pause(this.callee.$getToken()),Da(e,"executeAction",this,3)([t]);if(this.type===Ca.resume)return this.callee.$getHowl()&&this.callee.$getHowl().play(this.callee.$getToken()),Da(e,"executeAction",this,3)([t]);throw Da(e,"unknownType",this,3)([])}}],[{key:"initSound",value:function(t,e){e.$getHowl()||e.$setHowl(new(t.getHowl())(e.getHowlOptions()))}}])}(Za);is.ActionTypes=Ca;var as=function(t){function e(){return $a(this,e),za(this,e,arguments)}return Ya(e,t),Ha(e,[{key:"executeAllActions",value:function(t,e){return Ka(this,void 0,void 0,Na().mark((function n(){var r,o,i;return Na().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:r=!1,o=e,i=Na().mark((function e(){var n,r,i;return Na().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.game.getLiveGame().executeAction(t,o)){e.next=3;break}return e.abrupt("return",0);case 3:if(!h.isAwaitable(n)){e.next=15;break}return e.next=6,new Promise((function(t){n.then((function(e){return t(n.result)}))}));case 6:if(r=e.sent,i=r.node){e.next=12;break}return e.abrupt("return",0);case 12:o=i.action;case 13:e.next=16;break;case 15:o=n;case 16:case"end":return e.stop()}}),e)}));case 3:if(r||!o){n.next=10;break}return n.delegateYield(i(),"t0",5);case 5:if(0!==n.t0){n.next=8;break}return n.abrupt("break",10);case 8:n.next=3;break;case 10:case"end":return n.stop()}}),n)})))}},{key:"executeSingleAction",value:function(t,e){return Ka(this,void 0,void 0,Na().mark((function n(){var r,o,i;return Na().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(r=t.game.getLiveGame().executeAction(t,e),!h.isAwaitable(r)){n.next=9;break}return n.next=4,new Promise((function(t){r.then((function(e){return t(r.result)}))}));case 4:return o=n.sent,i=o.node,n.abrupt("return",i);case 9:return n.abrupt("return",r);case 10:case"end":return n.stop()}}),n)})))}},{key:"execute",value:function(t,n,r){var o=this;return r.length>0?(this.executeAllActions(t,r[0]).then((function(){n.resolve({type:o.type,node:o.contentNode.child})})),n):Da(e,"executeAction",this,3)([t])}},{key:"executeAction",value:function(t){var n,r,o=this,i=Fa(this.contentNode.getContent(),1)[0];if(this.type===Ia.do){var a=null===(n=i[0])||void 0===n?void 0:n.contentNode,s=null===(r=i[i.length-1])||void 0===r?void 0:r.contentNode,u=this.contentNode.getChild();return null==s||s.addChild(u),this.contentNode.addChild(a||null),Da(e,"executeAction",this,3)([t])}if(this.type===Ia.doAsync)return Ka(o,void 0,void 0,Na().mark((function e(){return Na().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(i.length>0)){e.next=3;break}return e.next=3,this.executeAllActions(t,i[0]);case 3:case"end":return e.stop()}}),e,this)}))),Da(e,"executeAction",this,3)([t]);if(this.type===Ia.any){var c=new h((function(t){return t})),l=i.map((function(e){return o.executeSingleAction(t,e)}));return Promise.any(l).then((function(){c.resolve({type:o.type,node:o.contentNode.getChild()})})),c}if(this.type===Ia.all){var f=new h((function(t){return t}));return this.execute(t,f,i)}if(this.type===Ia.allAsync)return Ka(o,void 0,void 0,Na().mark((function e(){return Na().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(i.length>0)){e.next=3;break}return e.next=3,this.executeAllActions(t,i[0]);case 3:case"end":return e.stop()}}),e,this)}))),Da(e,"executeAction",this,3)([t]);if(this.type===Ia.repeat){var d=Fa(this.contentNode.getContent(),2),p=d[0],y=d[1];return Ka(o,void 0,void 0,Na().mark((function e(){var n;return Na().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=0;case 1:if(!(n<y)){e.next=8;break}if(!(p.length>0)){e.next=5;break}return e.next=5,this.executeAllActions(t,p[0]);case 5:n++,e.next=1;break;case 8:case"end":return e.stop()}}),e,this)}))),Da(e,"executeAction",this,3)([t])}throw new Error("Unknown control action type: "+this.type)}},{key:"getFutureActions",value:function(){var t=this.contentNode.getContent()[0],n=Da(e,"getFutureActions",this,3)([]);return[].concat(La(t),La(n))}}])}(Za);function ss(t){return ss="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ss(t)}function us(t,e,n){return e=ps(e),function(t,e){if(e&&("object"==ss(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,fs()?Reflect.construct(e,n||[],ps(t).constructor):e.apply(t,n))}function cs(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ds(t,e)}function ls(t){var e="function"==typeof Map?new Map:void 0;return ls=function(t){if(null===t||!function(t){try{return-1!==Function.toString.call(t).indexOf("[native code]")}catch(e){return"function"==typeof t}}(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return function(t,e,n){if(fs())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,e);var o=new(t.bind.apply(t,r));return n&&ds(o,n.prototype),o}(t,arguments,ps(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),ds(n,t)},ls(t)}function fs(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(fs=function(){return!!t})()}function ds(t,e){return ds=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ds(t,e)}function ps(t){return ps=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ps(t)}function hs(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ys(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,ms(r.key),r)}}function vs(t,e,n){return e&&ys(t.prototype,e),n&&ys(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function ms(t){var e=function(t,e){if("object"!=ss(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=ss(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==ss(e)?e:e+""}as.ActionTypes=Ia;var gs=function(){function t(){hs(this,t)}return vs(t,null,[{key:"srcToString",value:function(t){return"string"==typeof t?t:t.src}},{key:"staticImageDataToSrc",value:function(t){return"string"==typeof t?t:t.src}},{key:"isStaticImageData",value:function(t){return void 0!==(null==t?void 0:t.src)}},{key:"backgroundToSrc",value:function(e){return t.isStaticImageData(e)?e.src:(null==e?void 0:e.url)||null}},{key:"isExternalSrc",value:function(t){return t.startsWith("http://")||t.startsWith("https://")}}])}(),bs=function(t){function e(t){return hs(this,e),us(this,e,[t,{},"StaticScriptWarning"])}return cs(e,t),vs(e,null,[{key:"isWarning",value:function(t){return t instanceof e}}])}(function(t){function e(t,n){var r,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"UseError";return hs(this,e),(r=us(this,e,[t])).props=n,r.name=o,r}return cs(e,t),vs(e,null,[{key:"isUseError",value:function(t){return t instanceof e}}])}(ls(Error))),ws=function(){return vs((function t(e){hs(this,t),this.scene=e}),[{key:"start",value:function(){var t=new Map,e=[],n=new Set;if(!this.scene.getAllActions().length)return null;for(e.push(this.scene.getAllActions()[0]);e.length;){var r=e.shift();this.checkAction(r,t,n);var o=r.contentNode.child;o&&o.action&&e.push(o.action)}return t}},{key:"checkAction",value:function(t,e,n){if(t instanceof es)e.has(t.callee)||e.set(t.callee,{isDisposed:!1,usedExternalSrc:!1}),this.checkImage(e.get(t.callee),t);else if(t instanceof Ja&&t.type===Pa.jumpTo){var r=t.contentNode.getContent()[0];if(n.has(r))return;n.add(r)}}},{key:"checkImage",value:function(t,e){if(e.type===ja.dispose){if(t.isDisposed){var n="Image is disposed multiple times before action: ".concat(e.type,"\nImage: ").concat(e.callee.name,"\nAction: ").concat(e.type,"\n\nAt: ").concat(e.__stack);throw new bs(n)}t.isDisposed=!0}else if([ja.init,ja.show,ja.hide,ja.applyTransform,ja.applyTransition].includes(e.type)){if(t.isDisposed){var r="Image is disposed before action: ".concat(e.type,"\nImage: ").concat(e.callee.name,"\nAction: ").concat(e.type,"\n\nAt: ").concat(e.__stack);throw new bs(r)}}else if(e.type===ja.setSrc){var o=e.contentNode.getContent()[0];gs.isExternalSrc(o)&&(t.usedExternalSrc=!0)}}}])}();function _s(t){return _s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_s(t)}function Ss(t){return function(t){if(Array.isArray(t))return xs(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||ks(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ks(t,e){if(t){if("string"==typeof t)return xs(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?xs(t,e):void 0}}function xs(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function As(t,e,n){return e=Es(e),function(t,e){if(e&&("object"==_s(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Ts()?Reflect.construct(e,n||[],Es(t).constructor):e.apply(t,n))}function Ts(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Ts=function(){return!!t})()}function Es(t){return Es=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Es(t)}function Os(t,e){return Os=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Os(t,e)}function Ps(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function js(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Is(r.key),r)}}function Cs(t,e,n){return e&&js(t.prototype,e),n&&js(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function Is(t){var e=function(t,e){if("object"!=_s(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=_s(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==_s(e)?e:e+""}var Ms=function(){return Cs((function t(e){Ps(this,t),this.handler=e}),[{key:"evaluate",value:function(t){var e=t.gameState;return{value:this.handler(this.getCtx({gameState:e}))}}},{key:"getCtx",value:function(t){return{gameState:t.gameState}}}])}(),Ls=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Ps(this,e),(t=As(this,e,[mt.IdPrefixes.Condition])).conditions={If:{condition:null,action:null},ElseIf:[],Else:{action:null}},t.config=p(e.defaultConfig,n),t}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Os(t,e)}(e,t),Cs(e,[{key:"If",value:function(t,e){return this.conditions.If.condition=t instanceof Ms?t:new Ms(t),this.conditions.If.action=this.construct(Array.isArray(e)?e:[e]),this}},{key:"ElseIf",value:function(t,e){return this.conditions.ElseIf.push({condition:t instanceof Ms?t:new Ms(t),action:this.construct(Array.isArray(e)?e:[e])}),this}},{key:"Else",value:function(t){return this.conditions.Else.action=this.construct(Array.isArray(t)?t:[t]),this}},{key:"evaluate",value:function(t,e){var n,r,o={gameState:e.gameState},i=null===(n=t.If.condition)||void 0===n?void 0:n.evaluate(o);if(null==i?void 0:i.value)return t.If.action||null;var a,s=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=ks(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}(t.ElseIf);try{for(s.s();!(a=s.n()).done;){var u=a.value,c=null===(r=u.condition)||void 0===r?void 0:r.evaluate(o);if(null==c?void 0:c.value)return u.action||null}}catch(t){s.e(t)}finally{s.f()}return t.Else.action||null}},{key:"toActions",value:function(){var t=[Reflect.construct(ns,[this,ns.ActionTypes.action,new ce(Yt.getIdManager().getStringId()).setContent(this.conditions)])];return this.conditions=e.getInitialState(),t}},{key:"construct",value:function(t,e,n){for(var r,o=0;o<t.length;o++){var i=t[o].contentNode,a=null===(r=t[o+1])||void 0===r?void 0:r.contentNode;a&&i.setInitChild(a),o===t.length-1&&e&&i.setInitChild(e),0===o&&n&&n.setInitChild(i)}return t}},{key:"_getFutureActions",value:function(){return[].concat(Ss(this.conditions.If.action||[]),Ss(this.conditions.ElseIf.flatMap((function(t){return t.action||[]}))),Ss(this.conditions.Else.action||[]))}}],[{key:"getInitialState",value:function(){return{If:{condition:null,action:null},ElseIf:[],Else:{action:null}}}}])}(mt);function Ns(t){return Ns="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ns(t)}function Fs(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Rs(r.key),r)}}function Rs(t){var e=function(t,e){if("object"!=Ns(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=Ns(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Ns(e)?e:e+""}function Vs(t,e,n){return e=Bs(e),function(t,e){if(e&&("object"==Ns(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Ds()?Reflect.construct(e,n||[],Bs(t).constructor):e.apply(t,n))}function Ds(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Ds=function(){return!!t})()}function Bs(t){return Bs=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Bs(t)}function $s(t,e){return $s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},$s(t,e)}Ls.defaultConfig={};var Us=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),Vs(this,e,[mt.IdPrefixes.Control])}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&$s(t,e)}(e,t),function(t,e,n){return e&&Fs(t.prototype,e),n&&Fs(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}(e,[{key:"do",value:function(t){return this.push(as.ActionTypes.do,t)}},{key:"doAsync",value:function(t){return this.push(as.ActionTypes.doAsync,t)}},{key:"any",value:function(t){return this.push(as.ActionTypes.any,t)}},{key:"all",value:function(t){return this.push(as.ActionTypes.all,t)}},{key:"allAsync",value:function(t){return this.push(as.ActionTypes.allAsync,t)}},{key:"repeat",value:function(t,e){return this.push(as.ActionTypes.repeat,e,t)}},{key:"construct",value:function(t){for(var e,n=0;n<t.length;n++){var r=t[n];0!==n&&(null===(e=t[n-1])||void 0===e||e.contentNode.setInitChild(r.contentNode))}return t}},{key:"push",value:function(t,e){for(var n=e.flat(2),r=arguments.length,o=new Array(r>2?r-2:0),i=2;i<r;i++)o[i-2]=arguments[i];var a=new as(this,t,new ce(Yt.getIdManager().getStringId()).setContent([this.construct(n)].concat(o)));return this.actions.push(a),this}}],[{key:"do",value:function(t){return(new e).do(t)}},{key:"doAsync",value:function(t){return(new e).doAsync(t)}},{key:"any",value:function(t){return(new e).any(t)}},{key:"all",value:function(t){return(new e).all(t)}},{key:"allAsync",value:function(t){return(new e).allAsync(t)}},{key:"repeat",value:function(t,n){return(new e).repeat(t,n)}}])}(mt);function Hs(t){return Hs="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Hs(t)}function Gs(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,zs(r.key),r)}}function zs(t){var e=function(t,e){if("object"!=Hs(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=Hs(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Hs(e)?e:e+""}function Ws(t,e,n){return e=Ys(e),function(t,e){if(e&&("object"==Hs(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,qs()?Reflect.construct(e,n||[],Ys(t).constructor):e.apply(t,n))}function qs(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(qs=function(){return!!t})()}function Ys(t){return Ys=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ys(t)}function Xs(t,e){return Xs=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Xs(t,e)}var Ks=function(t){function e(t){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(n=Ws(this,e,[mt.IdPrefixes.Menu])).choices=[],n.prompt=Et.isSentence(t)?t:new Et(null,t),n.config=p(e.defaultConfig,r),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Xs(t,e)}(e,t),function(t,e,n){return e&&Gs(t.prototype,e),n&&Gs(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}(e,[{key:"choose",value:function(t,e){return Et.isSentence(t)&&e||(Pt.isWord(t)||Array.isArray(t)||"string"==typeof t)&&e?this.choices.push({prompt:Et.toSentence(t),action:e.flat(2)}):"object"===Hs(t)&&"prompt"in t&&"action"in t?this.choices.push({prompt:Et.toSentence(t.prompt),action:t.action.flat(2)}):console.warn("No valid choice added to menu, ",{arg0:t,arg1:e}),this}},{key:"construct",value:function(t,e,n){for(var r,o=0;o<t.length;o++){var i=t[o].contentNode,a=null===(r=t[o+1])||void 0===r?void 0:r.contentNode;a&&i.setInitChild(a),o===this.choices.length-1&&e&&i.setInitChild(e),0===o&&n&&n.setInitChild(i)}return t}},{key:"toActions",value:function(){var t=[new os(this,os.ActionTypes.action,new ce(Yt.getIdManager().getStringId()).setContent({prompt:this.prompt,choices:this.constructChoices()}))];return this.choices=[],t}},{key:"_getFutureActions",value:function(t){return t.map((function(t){return t.action})).flat(2)}},{key:"constructChoices",value:function(){var t=this;return this.choices.map((function(e){return{action:t.construct(e.action),prompt:e.prompt}}))}}])}(mt);function Zs(t){return Zs="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Zs(t)}function Qs(t){return function(t){if(Array.isArray(t))return Js(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return Js(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Js(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Js(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function tu(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,eu(r.key),r)}}function eu(t){var e=function(t,e){if("object"!=Zs(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=Zs(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Zs(e)?e:e+""}Ks.defaultConfig={},Ks.targetAction=os;var nu,ru=function(){return function(t,e,n){return e&&tu(t.prototype,e),n&&tu(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}((function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.actions=[]}),[{key:"setRoot",value:function(t){var e,n;return null===(e=this.actions[0])||void 0===e||e.contentNode.setParent(t),t.setChild(null===(n=this.actions[0])||void 0===n?void 0:n.contentNode),this.actions[0]}},{key:"getActions",value:function(){return this.actions}},{key:"setActions",value:function(t){var e;this.actions.length=0,(e=this.actions).push.apply(e,Qs(t))}},{key:"getAllActions",value:function(t,e){var n=new Set;return this.forEachAction((function(t){return n.add(t)}),t,e),Array.from(n)}},{key:"forEachAction",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=[];((arguments.length>2?arguments[2]:void 0)||this.getActions()).forEach((function(r){var o=[];for(o.push(r);o.length>0;){var i=o.shift();if(i.type===Pa.jumpTo){if(!e||n.includes(i.getId()))continue;n.push(i.getId())}t(i);var a=i.getFutureActions();o.push.apply(o,Qs(a))}}))}},{key:"findActionById",value:function(t,e){if(e)return e.find((function(e){return e.getId()===t}))||null;var n=this.getActions(),r=[],o=[];for(r.push.apply(r,Qs(n));r.length>0;){var i=r.shift();if(i.getId()===t)return i;if(i.type===Pa.jumpTo){if(o.includes(i.getId()))continue;o.push(i.getId())}r.push.apply(r,Qs(i.getFutureActions()))}return null}},{key:"getAllElements",value:function(t){var e=t||this.getAllActions(),n=new Set(e.map((function(t){return t.callee})));return Array.from(n)}},{key:"getActionsByType",value:function(t,e){return(e||this.getAllActions()).filter((function(e){return e.type===t}))}},{key:"getAllNodes",value:function(t){var e=t||this.getAllActions(),n=new Set(e.map((function(t){return t.contentNode})));return Array.from(n)}},{key:"findNodeById",value:function(t,e){var n;return(null===(n=(e||this.getAllActions()).find((function(e){return e.contentNode.id===t})))||void 0===n?void 0:n.contentNode)||null}},{key:"findElementById",value:function(t,e){return e.find((function(e){return e.id===t}))||null}},{key:"findElementsByIds",value:function(t,e){var n=new Map;return e.forEach((function(t){return n.set(t.id,t)})),t.map((function(t){return n.get(t)})).filter(Boolean)}},{key:"_action",value:function(t){var e;"function"==typeof t&&(t=t(this));var n=t.flat(2);(e=this.actions).push.apply(e,Qs(n));var r=this.construct(),o=new ce(Yt.getIdManager().getStringId(),void 0,void 0,r||void 0).setContent(this);null==r||r.setParent(o);var i=this.constructor;return Reflect.construct(i.targetAction,[this,i.targetAction.ActionTypes.action,o])}},{key:"construct",value:function(t){for(var e,n=0;n<this.actions.length;n++){var r=this.actions[n];0===n&&t?t.setInitChild(r.contentNode):n>0&&(null===(e=this.actions[n-1].contentNode)||void 0===e||e.setInitChild(r.contentNode))}return this.actions.length?this.actions[0].contentNode:null}}])}();function ou(t){return ou="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ou(t)}function iu(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,au(r.key),r)}}function au(t){var e=function(t,e){if("object"!=ou(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=ou(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==ou(e)?e:e+""}function su(t,e,n){return e=cu(e),function(t,e){if(e&&("object"==ou(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,uu()?Reflect.construct(e,n||[],cu(t).constructor):e.apply(t,n))}function uu(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(uu=function(){return!!t})()}function cu(t){return cu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},cu(t)}function lu(t,e){return lu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},lu(t,e)}ru.targetAction=Ea,function(t){t.soundEffect="soundEffect",t.music="music",t.voice="voice",t.backgroundMusic="backgroundMusic"}(nu||(nu={}));var fu=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=su(this,e,[mt.IdPrefixes.Sound])).state={playing:null,token:null},t.config=p(e.defaultConfig,n),t}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&lu(t,e)}(e,t),function(t,e,n){return e&&iu(t.prototype,e),n&&iu(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}(e,[{key:"play",value:function(){if(this.config.type===nu.backgroundMusic)throw new Error("Background music cannot be played directly");return this.pushAction(is.ActionTypes.play,[void 0])}},{key:"stop",value:function(){if(this.config.type===nu.backgroundMusic)throw new Error("Background music cannot be stopped directly");return this.pushAction(is.ActionTypes.stop,[void 0])}},{key:"fade",value:function(t,e,n){if(this.config.type===nu.backgroundMusic)throw new Error("Background music cannot be faded directly");return this.pushAction(is.ActionTypes.fade,[{start:t,end:e,duration:n}])}},{key:"setVolume",value:function(t){return this.pushAction(is.ActionTypes.setVolume,[t])}},{key:"setRate",value:function(t){return this.pushAction(is.ActionTypes.setRate,[t])}},{key:"pause",value:function(t){return void 0!==t?this.fade(void 0,0,t):this.pushAction(is.ActionTypes.pause,[void 0])}},{key:"resume",value:function(t){return void 0!==t?this.fade(0,this.config.volume,t):this.pushAction(is.ActionTypes.resume,[void 0])}},{key:"getHowlOptions",value:function(){return{src:this.config.src,loop:this.config.loop,volume:this.config.volume,html5:this.config.streaming,autoplay:!1}}},{key:"getSrc",value:function(){return this.config.src}},{key:"$setToken",value:function(t){this.state.token=t}},{key:"$getToken",value:function(){return this.state.token}},{key:"$setHowl",value:function(t){this.state.playing=t}},{key:"$getHowl",value:function(){return this.state.playing}},{key:"$stop",value:function(){this.$setToken(null),this.$setHowl(null)}},{key:"toData",value:function(){return w(this.config,e.defaultConfig)?null:{config:y(this.config)}}},{key:"fromData",value:function(t){return this.config=p(this.config,t.config),this}},{key:"pushAction",value:function(t,e){var n=new is(this,t,new ce(Yt.getIdManager().getStringId()).setContent(e));return this.actions.push(n),this}}])}(mt);function du(t){return du="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},du(t)}function pu(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,hu(r.key),r)}}function hu(t){var e=function(t,e){if("object"!=du(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=du(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==du(e)?e:e+""}fu.defaultConfig={src:"",sync:!1,loop:!1,volume:1};var yu=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.src=[],this.future=[]}return function(t,e,n){return e&&pu(t.prototype,e),n&&pu(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}(t,[{key:"register",value:function(t,e){var n=this;if(Array.isArray(t))t.forEach((function(t){return n.register(t)}));else if(t instanceof fu){if(this.isSrcRegistered(t.getSrc()))return this;this.src.push({type:"audio",src:t})}else if(t instanceof ka||gs.isStaticImageData(t)){if(t instanceof ka){if(this.isSrcRegistered(gs.srcToString(t.state.src)))return this}else if(this.isSrcRegistered(gs.srcToString(t.src)))return this;this.src.push({type:"image",src:t instanceof ka?t:new ka("",{src:gs.staticImageDataToSrc(t)})})}else if("object"===du(t)){if(this.isSrcRegistered(t.src||""))return this;this.src.push(t)}else if("audio"===t){if(this.isSrcRegistered(e||""))return this;this.src.push({type:t,src:e instanceof fu?e:new fu({src:e})})}else{if(this.isSrcRegistered(e||""))return this;this.src.push({type:t,src:e})}return this}},{key:"isSrcRegistered",value:function(e){var n=e instanceof fu?e.getSrc():e;return this.src.some((function(e){return e.type===t.SrcTypes.audio?n===e.src.getSrc():e.type===t.SrcTypes.image?n===gs.srcToString(e.src.state.src):n===e.src}))}},{key:"getSrc",value:function(){return this.src}},{key:"getSrcByType",value:function(t){return this.src.filter((function(e){return e.type===t}))}},{key:"registerFuture",value:function(t){return this.future.includes(t)||this.hasFuture(t)||this.future.push(t),this}},{key:"hasFuture",value:function(t){return this.future.includes(t)}}])}();function vu(t){return vu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},vu(t)}function mu(t){return function(t){if(Array.isArray(t))return gu(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return gu(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?gu(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function gu(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function bu(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,wu(r.key),r)}}function wu(t){var e=function(t,e){if("object"!=vu(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=vu(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==vu(e)?e:e+""}function _u(t,e,n){return e=ku(e),function(t,e){if(e&&("object"==vu(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Su()?Reflect.construct(e,n||[],ku(t).constructor):e.apply(t,n))}function Su(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Su=function(){return!!t})()}function ku(t){return ku=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ku(t)}function xu(t,e){return xu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},xu(t,e)}yu.SrcTypes={image:"image",video:"video",audio:"audio"};var Au=function(t){function e(t){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.defaultConfig;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(n=_u(this,e)).srcManager=new yu,n.events=new m,n._liveState={active:!1},n._actions=[],n.id=Yt.getIdManager().getStringId(),n.name=t,n.config=p(e.defaultConfig,r),n.state=p(e.defaultState,n.config),n.backgroundImageState={position:new be(se.Center)},n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&xu(t,e)}(e,t),function(t,e,n){return e&&bu(t.prototype,e),n&&bu(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}(e,[{key:"activate",value:function(){return this._init()}},{key:"deactivate",value:function(){return this._exit()}},{key:"setBackground",value:function(t,e){if(e){var n=e.copy();n.setSrc(gs.backgroundToSrc(t)),this.transitionSceneBackground(void 0,n)}return this._actions.push(new Ja(this,"scene:setBackground",new ce(Yt.getIdManager().getStringId()).setContent([t]))),this}},{key:"applyTransform",value:function(t){return this._actions.push(new Ja(this,"scene:applyTransform",new ce(Yt.getIdManager().getStringId()).setContent([t]))),this}},{key:"jumpTo",value:function(t,e){this._actions.push(new Ja(this,"scene:preUnmount",new ce(Yt.getIdManager().getStringId()).setContent([])));var n=e||{};return this._transitionToScene(t,n.transition)._exit(),this._jumpTo(t)}},{key:"transitionSceneBackground",value:function(t,e){return this._transitionToScene(t,e),this}},{key:"sleep",value:function(t){return this._actions.push(new Ja(this,"scene:sleep",new ce(Yt.getIdManager().getStringId()).setContent(t))),this}},{key:"setBackgroundMusic",value:function(t,e){return this._actions.push(new Ja(this,Pa.setBackgroundMusic,new ce(Yt.getIdManager().getStringId()).setContent([t,e]))),this}},{key:"toActions",value:function(){var t=this._actions;return this._actions=[],t}},{key:"_$getBackgroundMusic",value:function(){return this.state.backgroundMusic}},{key:"toData",value:function(){var t;return w(this.state,this.config)?null:{state:Object.assign(Object.assign({},y(this.state)),{backgroundMusic:null===(t=this.state.backgroundMusic)||void 0===t?void 0:t.toData(),background:this.state.background,backgroundImageState:ka.serializeImageState(this.backgroundImageState)})}}},{key:"fromData",value:function(t){return this.state=p(this.state,t.state),t.state.backgroundMusic&&(this.state.backgroundMusic=(new fu).fromData(t.state.backgroundMusic),this.state.background=t.state.background),t.state.backgroundImageState&&(this.backgroundImageState=ka.deserializeImageState(t.state.backgroundImageState)),this}},{key:"_setTransition",value:function(t){return this._actions.push(new Ja(this,"scene:setTransition",new ce(Yt.getIdManager().getStringId()).setContent([t]))),this}},{key:"_applyTransition",value:function(t){return this._actions.push(new Ja(this,"scene:applyTransition",new ce(Yt.getIdManager().getStringId()).setContent([t]))),this}},{key:"_toTransform",value:function(){return new ya([{props:this.backgroundImageState,options:{duration:0}}])}},{key:"registerSrc",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Set;if(this.getActions().length){var n=new Set,r=[this.getActions()[0]],o=new Set;for(gs.backgroundToSrc(this.config.background)&&this.srcManager.register(new ka({src:gs.backgroundToSrc(this.config.background)}));r.length;){var i=r.shift();if(i instanceof Ja){if(i.type===Pa.jumpTo){var a=i,s=a.contentNode.getContent()[0];if(n.has(a)||e.has(s))continue;n.add(a),o.add(s),e.add(s)}else if(i.type===Pa.setBackground){var u=i.contentNode.getContent()[0];this.srcManager.register(new ka({src:gs.backgroundToSrc(u)}))}}else if(i instanceof es){var c=i;if(this.srcManager.register(c.callee),i.type===ja.setSrc){var l=i.contentNode.getContent()[0];this.srcManager.register(new ka({src:l}))}}else if(i instanceof is)this.srcManager.register(i.callee);else if(i instanceof as){var f=i.getFutureActions();r.push.apply(r,mu(f))}r.push.apply(r,mu(i.getFutureActions()))}o.forEach((function(n){n.registerSrc(e),t.srcManager.registerFuture(n.srcManager)}))}}},{key:"action",value:function(t){var e=Array.isArray(t)?t.flat(2):t(this).flat(2),n=this.getAllElements(this.getAllActions(!1,e)).filter((function(t){return t instanceof ka})),r=[].concat(mu(this.activate().toActions()),mu(n.map((function(t){return t.init().toActions()})).flat(2)),mu(e));return this._sceneRoot=this._action(r),this}},{key:"getSceneActions",value:function(){return this.toActions()}},{key:"_jumpTo",value:function(t){return this._actions.push(new Ja(this,"scene:jumpTo",new ce(Yt.getIdManager().getStringId()).setContent([t]))),this}},{key:"_exit",value:function(){return this._actions.push(new Ja(this,"scene:exit",new ce(Yt.getIdManager().getStringId()).setContent([]))),this}},{key:"_transitionToScene",value:function(t,e){if(e){var n=e.copy();t&&n.setSrc(gs.backgroundToSrc(t.config.background)),this._setTransition(n)._applyTransition(n)}var r;t&&(r=this._actions).push.apply(r,mu(t.activate().toActions()));return this}},{key:"_init",value:function(){return this._actions.push(new Ja(this,"scene:init",new ce(Yt.getIdManager().getStringId()).setContent([]))),this}}])}(ru);function Tu(t){return Tu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Tu(t)}function Eu(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Ou(r.key),r)}}function Ou(t){var e=function(t,e){if("object"!=Tu(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=Tu(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Tu(e)?e:e+""}function Pu(t,e,n){return e=Cu(e),function(t,e){if(e&&("object"==Tu(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,ju()?Reflect.construct(e,n||[],Cu(t).constructor):e.apply(t,n))}function ju(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(ju=function(){return!!t})()}function Cu(t){return Cu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Cu(t)}function Iu(t,e){return Iu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Iu(t,e)}Au.EventTypes={"event:scene.setTransition":"event:scene.setTransition","event:scene.remove":"event:scene.remove","event:scene.load":"event:scene.load","event:scene.unload":"event:scene.unload","event:scene.mount":"event:scene.mount","event:scene.unmount":"event:scene.unmount","event:scene.preUnmount":"event:scene.preUnmount","event:scene.imageLoaded":"event:scene.imageLoaded","event:scene.initTransform":"event:scene.initTransform","event:scene.setBackgroundMusic":"event:scene.setBackgroundMusic","event:scene.applyTransform":"event:scene.applyTransform"},Au.defaultConfig={background:null,invertY:!1,invertX:!1,backgroundMusic:null,backgroundMusicFade:0},Au.defaultState={},Au.targetAction=Ja;var Mu=function(t){function e(t){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(n=Pu(this,e,[mt.IdPrefixes.Script])).cleaner=null,n.handler=t,n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Iu(t,e)}(e,t),function(t,e,n){return e&&Eu(t.prototype,e),n&&Eu(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}(e,[{key:"execute",value:function(t){var e=t.gameState;this.cleaner=this.handler(this.getCtx({gameState:e}))||null}},{key:"getCtx",value:function(t){return{script:this,gameState:t.gameState}}},{key:"toActions",value:function(){return[new rs(this,rs.ActionTypes.action,new ce(Yt.getIdManager().getStringId()).setContent(this))]}}])}(mt);function Lu(t){return Lu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Lu(t)}function Nu(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Fu(r.key),r)}}function Fu(t){var e=function(t,e){if("object"!=Lu(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=Lu(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Lu(e)?e:e+""}function Ru(t,e,n){return e=Du(e),function(t,e){if(e&&("object"==Lu(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Vu()?Reflect.construct(e,n||[],Du(t).constructor):e.apply(t,n))}function Vu(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Vu=function(){return!!t})()}function Du(t){return Du=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Du(t)}function Bu(t,e){return Bu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Bu(t,e)}var $u=function(t){function e(t){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(n=Ru(this,e)).id=Yt.getIdManager().getStringId(),n.name=t,n.config=p(e.defaultConfig,r),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Bu(t,e)}(e,t),function(t,e,n){return e&&Nu(t.prototype,e),n&&Nu(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}(e,[{key:"_setAllElementState",value:function(t,e){var n=e||this.getAllActions(),r=new Map;t.forEach((function(t){return r.set(t.id,t.data)})),this.getAllElements(n).forEach((function(t){var e=r.get(t.id);e&&t.fromData(e)}))}},{key:"_getAllElementState",value:function(t){var e=t||this.getAllActions();return this.getAllElements(e).map((function(t){return{id:t.id,data:t.toData()}})).filter((function(t){return null!==t.data}))}},{key:"_getNodeChildIdMap",value:function(t){var e=t||this.getAllActions(),n=new Map;return e.forEach((function(t){var e,r=t.contentNode;(null===(e=r.child)||void 0===e?void 0:e.id)&&r.initChild!==r.child&&n.set(r.id,r.child.id)})),n}},{key:"_setNodeChildByMap",value:function(t,e){if(t){var n=t instanceof Map?t:new Map(Object.entries(t)),r=e||this.getAllActions(),o=this._getMappedNodes(this.getAllNodes(r));r.forEach((function(t){var e=t.contentNode,r=n.get(e.id),i=r&&o.get(r);i&&e.setChild(i)}))}}},{key:"_getMappedNodes",value:function(t){var e=new Map;return t.forEach((function(t){return e.set(t.id,t)})),e}},{key:"toData",value:function(){return null}},{key:"fromData",value:function(t){return this}},{key:"entry",value:function(t){var e=t._sceneRoot;if(!e)throw new Error("No actions in scene, please add actions to scene first");return this.setActions([e]),t.registerSrc(),new ws(t).start(),this}}])}(ru);$u.defaultConfig={},$u.targetAction=ts;var Uu=r(72),Hu=r.n(Uu),Gu=r(825),zu=r.n(Gu),Wu=r(659),qu=r.n(Wu),Yu=r(56),Xu=r.n(Yu),Ku=r(540),Zu=r.n(Ku),Qu=r(113),Ju=r.n(Qu),tc=r(587),ec={};ec.styleTagTransform=Ju(),ec.setAttributes=Xu(),ec.insert=qu().bind(null,"head"),ec.domAPI=zu(),ec.insertStyleElement=Zu();Hu()(tc.A,ec);tc.A&&tc.A.locals&&tc.A.locals;var nc=r(848);const rc=(0,W.createContext)({strict:!1});function oc(t){for(const e in t)mi[e]={...mi[e],...t[e]}}function ic({children:t,features:e,strict:n=!1}){const[,r]=(0,W.useState)(!ac(e)),o=(0,W.useRef)(void 0);if(!ac(e)){const{renderer:t,...n}=e;o.current=t,oc(n)}return(0,W.useEffect)((()=>{ac(e)&&e().then((({renderer:t,...e})=>{oc(e),o.current=t,r(!0)}))}),[]),(0,nc.jsx)(rc.Provider,{value:{renderer:o.current,strict:n},children:t})}function ac(t){return"function"==typeof t}function sc(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let r=0;r<n;r++)if(e[r]!==t[r])return!1;return!0}function uc(t,e,n={}){var r;const o=Wo(t,e,"exit"===n.type?null===(r=t.presenceContext)||void 0===r?void 0:r.custom:void 0);let{transition:i=t.getDefaultTransition()||{}}=o||{};n.transitionOverride&&(i=n.transitionOverride);const a=o?()=>Promise.all(ni(t,o,n)):()=>Promise.resolve(),s=t.variantChildren&&t.variantChildren.size?(r=0)=>{const{delayChildren:o=0,staggerChildren:a,staggerDirection:s}=i;return function(t,e,n=0,r=0,o=1,i){const a=[],s=(t.variantChildren.size-1)*r,u=1===o?(t=0)=>t*r:(t=0)=>s-t*r;return Array.from(t.variantChildren).sort(cc).forEach(((t,r)=>{t.notify("AnimationStart",e),a.push(uc(t,e,{...i,delay:n+u(r)}).then((()=>t.notify("AnimationComplete",e))))})),Promise.all(a)}(t,e,o+r,a,s,n)}:()=>Promise.resolve(),{when:u}=i;if(u){const[t,e]="beforeChildren"===u?[a,s]:[s,a];return t().then((()=>e()))}return Promise.all([a(),s(n.delay)])}function cc(t,e){return t.sortNodePosition(e)}const lc=[...di].reverse(),fc=di.length;function dc(t){return e=>Promise.all(e.map((({animation:e,options:n})=>function(t,e,n={}){let r;if(t.notify("AnimationStart",e),Array.isArray(e)){const o=e.map((e=>uc(t,e,n)));r=Promise.all(o)}else if("string"==typeof e)r=uc(t,e,n);else{const o="function"==typeof e?Wo(t,e,n.custom):e;r=Promise.all(ni(t,o,n))}return r.then((()=>{t.notify("AnimationComplete",e)}))}(t,e,n))))}function pc(t,e){return"string"==typeof e?e!==t:!!Array.isArray(e)&&!sc(e,t)}function hc(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function yc(){return{animate:hc(!0),whileInView:hc(),whileHover:hc(),whileTap:hc(),whileDrag:hc(),whileFocus:hc(),exit:hc()}}class vc{constructor(t){this.isMounted=!1,this.node=t}update(){}}let mc=0;const gc={animation:{Feature:class extends vc{constructor(t){super(t),t.animationState||(t.animationState=function(t){let e=dc(t),n=yc(),r=!0;const o=e=>(n,r)=>{var o;const i=Wo(t,r,"exit"===e?null===(o=t.presenceContext)||void 0===o?void 0:o.custom:void 0);if(i){const{transition:t,transitionEnd:e,...r}=i;n={...n,...r,...e}}return n};function i(i){const a=t.getProps(),s=t.getVariantContext(!0)||{},u=[],c=new Set;let l={},f=1/0;for(let e=0;e<fc;e++){const d=lc[e],p=n[d],h=void 0!==a[d]?a[d]:s[d],y=fi(h),v=d===i?p.isActive:null;!1===v&&(f=e);let m=h===s[d]&&h!==a[d]&&y;if(m&&r&&t.manuallyAnimateOnMount&&(m=!1),p.protectedKeys={...l},!p.isActive&&null===v||!h&&!p.prevProp||li(h)||"boolean"==typeof h)continue;let g=pc(p.prevProp,h)||d===i&&p.isActive&&!m&&y||e>f&&y,b=!1;const w=Array.isArray(h)?h:[h];let _=w.reduce(o(d),{});!1===v&&(_={});const{prevResolvedValues:S={}}=p,k={...S,..._},x=e=>{g=!0,c.has(e)&&(b=!0,c.delete(e)),p.needsAnimating[e]=!0;const n=t.getValue(e);n&&(n.liveStyle=!1)};for(const t in k){const e=_[t],n=S[t];if(l.hasOwnProperty(t))continue;let r=!1;r=No(e)&&No(n)?!sc(e,n):e!==n,r?null!=e?x(t):c.add(t):void 0!==e&&c.has(t)?x(t):p.protectedKeys[t]=!0}p.prevProp=h,p.prevResolvedValues=_,p.isActive&&(l={...l,..._}),r&&t.blockInitialAnimation&&(g=!1),!g||m&&!b||u.push(...w.map((t=>({animation:t,options:{type:d}}))))}if(c.size){const e={};c.forEach((n=>{const r=t.getBaseTarget(n),o=t.getValue(n);o&&(o.liveStyle=!0),e[n]=null!=r?r:null})),u.push({animation:e})}let d=Boolean(u.length);return!r||!1!==a.initial&&a.initial!==a.animate||t.manuallyAnimateOnMount||(d=!1),r=!1,d?e(u):Promise.resolve()}return{animateChanges:i,setActive:function(e,r){var o;if(n[e].isActive===r)return Promise.resolve();null===(o=t.variantChildren)||void 0===o||o.forEach((t=>{var n;return null===(n=t.animationState)||void 0===n?void 0:n.setActive(e,r)})),n[e].isActive=r;const a=i(e);for(const t in n)n[t].protectedKeys={};return a},setAnimateFunction:function(n){e=n(t)},getState:()=>n,reset:()=>{n=yc(),r=!0}}}(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();li(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:e}=this.node.prevProps||{};t!==e&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),null===(t=this.unmountControls)||void 0===t||t.call(this)}}},exit:{Feature:class extends vc{constructor(){super(...arguments),this.id=mc++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:e}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===n)return;const r=this.node.animationState.setActive("exit",!t);e&&!t&&r.then((()=>e(this.id)))}mount(){const{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}}}};function bc(t,e,n,r={passive:!0}){return t.addEventListener(e,n,r),()=>t.removeEventListener(e,n)}function wc(t,e="page"){return{point:{x:t[`${e}X`],y:t[`${e}Y`]}}}const _c=t=>e=>(t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary)(e)&&t(e,wc(e));function Sc(t,e,n,r){return bc(t,e,_c(n),r)}function kc(t){let e=null;return()=>{const n=()=>{e=null};return null===e&&(e=t,n)}}const xc=kc("dragHorizontal"),Ac=kc("dragVertical");function Tc(){const t=function(t){let e=!1;if("y"===t)e=Ac();else if("x"===t)e=xc();else{const t=xc(),n=Ac();t&&n?e=()=>{t(),n()}:(t&&t(),n&&n())}return e}(!0);return!t||(t(),!1)}function Ec(t,e){const n=e?"pointerenter":"pointerleave",r=e?"onHoverStart":"onHoverEnd";return Sc(t.current,n,((n,o)=>{if("touch"===n.pointerType||Tc())return;const i=t.getProps();t.animationState&&i.whileHover&&t.animationState.setActive("whileHover",e);const a=i[r];a&&Ce.postRender((()=>a(n,o)))}),{passive:!t.getProps()[r]})}const Oc=(t,e)=>!!e&&(t===e||Oc(t,e.parentElement));function Pc(t,e){if(!e)return;const n=new PointerEvent("pointer"+t);e(n,wc(n))}const jc=new WeakMap,Cc=new WeakMap,Ic=t=>{const e=jc.get(t.target);e&&e(t)},Mc=t=>{t.forEach(Ic)};function Lc(t,e,n){const r=function({root:t,...e}){const n=t||document;Cc.has(n)||Cc.set(n,{});const r=Cc.get(n),o=JSON.stringify(e);return r[o]||(r[o]=new IntersectionObserver(Mc,{root:t,...e})),r[o]}(e);return jc.set(t,n),r.observe(t),()=>{jc.delete(t),r.unobserve(t)}}const Nc={some:0,all:1};const Fc={inView:{Feature:class extends vc{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:e,margin:n,amount:r="some",once:o}=t,i={root:e?e.current:void 0,rootMargin:n,threshold:"number"==typeof r?r:Nc[r]};return Lc(this.node.current,i,(t=>{const{isIntersecting:e}=t;if(this.isInView===e)return;if(this.isInView=e,o&&!e&&this.hasEnteredView)return;e&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",e);const{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),i=e?n:r;i&&i(t)}))}mount(){this.startObserver()}update(){if("undefined"==typeof IntersectionObserver)return;const{props:t,prevProps:e}=this.node;["amount","margin","root"].some(function({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}(t,e))&&this.startObserver()}unmount(){}}},tap:{Feature:class extends vc{constructor(){super(...arguments),this.removeStartListeners=Se,this.removeEndListeners=Se,this.removeAccessibleListeners=Se,this.startPointerPress=(t,e)=>{if(this.isPressing)return;this.removeEndListeners();const n=this.node.getProps(),r=Sc(window,"pointerup",((t,e)=>{if(!this.checkPressEnd())return;const{onTap:n,onTapCancel:r,globalTapTarget:o}=this.node.getProps(),i=o||Oc(this.node.current,t.target)?n:r;i&&Ce.update((()=>i(t,e)))}),{passive:!(n.onTap||n.onPointerUp)}),o=Sc(window,"pointercancel",((t,e)=>this.cancelPress(t,e)),{passive:!(n.onTapCancel||n.onPointerCancel)});this.removeEndListeners=Qr(r,o),this.startPress(t,e)},this.startAccessiblePress=()=>{const t=bc(this.node.current,"keydown",(t=>{if("Enter"!==t.key||this.isPressing)return;this.removeEndListeners(),this.removeEndListeners=bc(this.node.current,"keyup",(t=>{"Enter"===t.key&&this.checkPressEnd()&&Pc("up",((t,e)=>{const{onTap:n}=this.node.getProps();n&&Ce.postRender((()=>n(t,e)))}))})),Pc("down",((t,e)=>{this.startPress(t,e)}))})),e=bc(this.node.current,"blur",(()=>{this.isPressing&&Pc("cancel",((t,e)=>this.cancelPress(t,e)))}));this.removeAccessibleListeners=Qr(t,e)}}startPress(t,e){this.isPressing=!0;const{onTapStart:n,whileTap:r}=this.node.getProps();r&&this.node.animationState&&this.node.animationState.setActive("whileTap",!0),n&&Ce.postRender((()=>n(t,e)))}checkPressEnd(){this.removeEndListeners(),this.isPressing=!1;return this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!Tc()}cancelPress(t,e){if(!this.checkPressEnd())return;const{onTapCancel:n}=this.node.getProps();n&&Ce.postRender((()=>n(t,e)))}mount(){const t=this.node.getProps(),e=Sc(t.globalTapTarget?window:this.node.current,"pointerdown",this.startPointerPress,{passive:!(t.onTapStart||t.onPointerStart)}),n=bc(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=Qr(e,n)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}},focus:{Feature:class extends vc{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch(e){t=!0}t&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Qr(bc(this.node.current,"focus",(()=>this.onFocus())),bc(this.node.current,"blur",(()=>this.onBlur())))}unmount(){}}},hover:{Feature:class extends vc{mount(){this.unmount=Qr(Ec(this.node,!0),Ec(this.node,!1))}unmount(){}}}},Rc=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Vc(t){return"string"==typeof t&&!t.includes("-")&&!!(Rc.indexOf(t)>-1||/[A-Z]/u.test(t))}const Dc={renderer:(t,e)=>Vc(t)?new Fi(e):new Vi(e,{allowProjection:t!==W.Fragment}),...gc,...Fc};function Bc(t){var e=t.children;return q().createElement(ic,{features:Dc,strict:!0},e)}function $c(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,s=[],u=!0,c=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(s.push(r.value),s.length!==e);u=!0);}catch(t){c=!0,o=t}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(t,e)||function(t,e){if(t){if("string"==typeof t)return Uc(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Uc(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Uc(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Hc(t){var e=t.children,n=t.className,r=$c((0,W.useState)({}),2),o=r[0],i=r[1],a=nt().ratio,s=pt().game,u=$c((0,W.useReducer)((function(t){return t+1}),0),2)[1];return(0,W.useEffect)((function(){var t,e=function(){if(a.isLocked())console.warn("Ratio is locked, skipping update");else{var t=document.getElementById(s.config.player.contentContainerId);if(t){var e,n,r=t.clientWidth,o=t.clientHeight,c=16/9;r/o>c?(e=o*c,n=o):(e=r,n=r/c),e<800&&(e=800),n<450&&(n=450),i({width:"".concat(e,"px"),height:"".concat(n,"px"),margin:"auto",position:"absolute",top:"0",bottom:"0",left:"0",right:"0",display:"flex",alignItems:"center",justifyContent:"center"}),a.update(e,n),a.updateMin(800,450),u()}}};a.setUpdate(e);var n=function(){e(),clearTimeout(t),a.pause(),t=setTimeout((function(){a.resume()}),100)};return e(),window.addEventListener("resize",n),function(){window.removeEventListener("resize",n),clearTimeout(t)}}),[a]),q().createElement("div",{id:s.config.player.contentContainerId,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden"}},q().createElement("div",{className:z(n),style:o},e))}var Gc={start:"start",update:"update",end:"end"};function zc(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,s=[],u=!0,c=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(s.push(r.value),s.length!==e);u=!0);}catch(t){c=!0,o=t}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(t,e)||function(t,e){if(t){if("string"==typeof t)return Wc(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Wc(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Wc(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function qc(t){var e=t.children,n=nt().ratio,r=pt().game,o=(0,W.useRef)(null),i=zc(q().useReducer((function(t){return t+1}),0),2)[1];return(0,W.useEffect)((function(){return n.onUpdate((function(){i()}))})),(0,W.useEffect)((function(){if(!o.current)throw new Error("Content container not found")}),[r.config.player.contentContainerId]),q().createElement(q().Fragment,null,q().createElement("div",{ref:o,className:z("absolute inset-0 flex items-center justify-center bg-cover bg-center overflow-hidden"),style:Object.assign({},n.getStyle())},e))}function Yc(t){return Yc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Yc(t)}function Xc(){return Xc=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)({}).hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Xc.apply(null,arguments)}function Kc(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */Kc=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function c(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,n){return t[e]=n}}function l(t,e,n,r){var i=e&&e.prototype instanceof m?e:m,a=Object.create(i.prototype),s=new j(r||[]);return o(a,"_invoke",{value:T(t,n,s)}),a}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var d="suspendedStart",p="suspendedYield",h="executing",y="completed",v={};function m(){}function g(){}function b(){}var w={};c(w,a,(function(){return this}));var _=Object.getPrototypeOf,S=_&&_(_(C([])));S&&S!==n&&r.call(S,a)&&(w=S);var k=b.prototype=m.prototype=Object.create(w);function x(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function A(t,e){function n(o,i,a,s){var u=f(t[o],t,i);if("throw"!==u.type){var c=u.arg,l=c.value;return l&&"object"==Yc(l)&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,s)}),(function(t){n("throw",t,a,s)})):e.resolve(l).then((function(t){c.value=t,a(c)}),(function(t){return n("throw",t,a,s)}))}s(u.arg)}var i;o(this,"_invoke",{value:function(t,r){function o(){return new e((function(e,o){n(t,r,e,o)}))}return i=i?i.then(o,o):o()}})}function T(e,n,r){var o=d;return function(i,a){if(o===h)throw Error("Generator is already running");if(o===y){if("throw"===i)throw a;return{value:t,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var u=E(s,r);if(u){if(u===v)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===d)throw o=y,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=h;var c=f(e,n,r);if("normal"===c.type){if(o=r.done?y:p,c.arg===v)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(o=y,r.method="throw",r.arg=c.arg)}}}function E(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,E(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var i=f(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function C(e){if(e||""===e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function n(){for(;++o<e.length;)if(r.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return i.next=i}}throw new TypeError(Yc(e)+" is not iterable")}return g.prototype=b,o(k,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:g,configurable:!0}),g.displayName=c(b,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,c(t,u,"GeneratorFunction")),t.prototype=Object.create(k),t},e.awrap=function(t){return{__await:t}},x(A.prototype),c(A.prototype,s,(function(){return this})),e.AsyncIterator=A,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new A(l(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},x(k),c(k,u,"Generator"),c(k,a,(function(){return this})),c(k,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=C,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(P),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function o(r,o){return s.type="throw",s.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(u&&c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),P(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;P(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:C(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}function Zc(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,s=[],u=!0,c=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(s.push(r.value),s.length!==e);u=!0);}catch(t){c=!0,o=t}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(t,e)||function(t,e){if(t){if("string"==typeof t)return Qc(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Qc(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Qc(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}var Jc=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{u(r.next(t))}catch(t){i(t)}}function s(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))};function tl(t){var e=this,n=t.scene,r=t.props,o=t.state,i=(0,W.useRef)(null),a=Zc((0,W.useState)(null),2),s=a[0],u=a[1],c=Zc((0,W.useState)([]),2)[1],l=Zc((0,W.useState)(null),2),f=l[0],d=l[1],h=Zc((0,W.useState)({}),2),y=h[0],v=h[1];function m(){n.events.emit(Au.EventTypes["event:scene.imageLoaded"])}function g(t){if(f&&f.getControl()&&(console.warn("processing transform not completed"),f.getControl().complete(),f.setControl(null)),!i.current)throw new Error("scope not ready");t instanceof ya?Object.assign(i.current.style,t.propToCSS(o,n.backgroundImageState)):Object.assign(i.current.style,t)}(0,W.useEffect)((function(){var t=n.events.onEvents([{type:Au.EventTypes["event:scene.setTransition"],listener:n.events.on(Au.EventTypes["event:scene.setTransition"],(function(t){u(t),o.logger.log("transition",t)}))},{type:Au.EventTypes["event:scene.applyTransform"],listener:n.events.on(Au.EventTypes["event:scene.applyTransform"],(function(t){return Jc(e,void 0,void 0,Kc().mark((function e(){return Kc().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return g(t.propToCSS(o,n.backgroundImageState)),d(t),e.next=4,t.animate({scope:i},o,n.backgroundImageState,(function(e){n.backgroundImageState=p(n.backgroundImageState,e),v({style:t.propToCSS(o,n.backgroundImageState)}),d(null)}));case 4:case"end":return e.stop()}}),e)})))}))},{type:Au.EventTypes["event:scene.initTransform"],listener:n.events.on(Au.EventTypes["event:scene.initTransform"],(function(t){return Jc(e,void 0,void 0,Kc().mark((function e(){return Kc().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.animate({scope:i},o,n.backgroundImageState,(function(t){n.backgroundImageState=p(n.backgroundImageState,t)}));case 2:case"end":return e.stop()}}),e)})))}))}]),r=s?s.events.onEvents([{type:Gc.update,listener:s.events.on(Gc.update,(function(t){c(t)}))},{type:Gc.end,listener:s.events.on(Gc.end,(function(){u(null)}))}]):null;return g(n.backgroundImageState),function(){var e;t.cancel(),null===(e=null==r?void 0:r.cancel)||void 0===e||e.call(r)}}),[s,n]);var b,w="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==",_={src:w};return q().createElement("div",null,s?s.toElementProps().map((function(t,e,n){var o=p(_,r,t,y);return q().createElement(qc,{key:e},q().createElement("img",Xc({alt:o.alt},o,{onLoad:m,src:o.src||w,ref:e===n.length-1?i:void 0,className:"absolute"})))})):(b=p(_,r,y),q().createElement(qc,null,q().createElement("img",Xc({alt:b.alt},b,{onLoad:m,ref:i,src:b.src||w,className:"absolute"})))))}function el(t){return el="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},el(t)}function nl(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */nl=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function c(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,n){return t[e]=n}}function l(t,e,n,r){var i=e&&e.prototype instanceof m?e:m,a=Object.create(i.prototype),s=new j(r||[]);return o(a,"_invoke",{value:T(t,n,s)}),a}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var d="suspendedStart",p="suspendedYield",h="executing",y="completed",v={};function m(){}function g(){}function b(){}var w={};c(w,a,(function(){return this}));var _=Object.getPrototypeOf,S=_&&_(_(C([])));S&&S!==n&&r.call(S,a)&&(w=S);var k=b.prototype=m.prototype=Object.create(w);function x(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function A(t,e){function n(o,i,a,s){var u=f(t[o],t,i);if("throw"!==u.type){var c=u.arg,l=c.value;return l&&"object"==el(l)&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,s)}),(function(t){n("throw",t,a,s)})):e.resolve(l).then((function(t){c.value=t,a(c)}),(function(t){return n("throw",t,a,s)}))}s(u.arg)}var i;o(this,"_invoke",{value:function(t,r){function o(){return new e((function(e,o){n(t,r,e,o)}))}return i=i?i.then(o,o):o()}})}function T(e,n,r){var o=d;return function(i,a){if(o===h)throw Error("Generator is already running");if(o===y){if("throw"===i)throw a;return{value:t,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var u=E(s,r);if(u){if(u===v)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===d)throw o=y,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=h;var c=f(e,n,r);if("normal"===c.type){if(o=r.done?y:p,c.arg===v)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(o=y,r.method="throw",r.arg=c.arg)}}}function E(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,E(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var i=f(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function C(e){if(e||""===e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function n(){for(;++o<e.length;)if(r.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return i.next=i}}throw new TypeError(el(e)+" is not iterable")}return g.prototype=b,o(k,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:g,configurable:!0}),g.displayName=c(b,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,c(t,u,"GeneratorFunction")),t.prototype=Object.create(k),t},e.awrap=function(t){return{__await:t}},x(A.prototype),c(A.prototype,s,(function(){return this})),e.AsyncIterator=A,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new A(l(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},x(k),c(k,u,"Generator"),c(k,a,(function(){return this})),c(k,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=C,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(P),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function o(r,o){return s.type="throw",s.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(u&&c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),P(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;P(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:C(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}function rl(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,s=[],u=!0,c=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(s.push(r.value),s.length!==e);u=!0);}catch(t){c=!0,o=t}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(t,e)||function(t,e){if(t){if("string"==typeof t)return ol(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ol(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ol(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}var il=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{u(r.next(t))}catch(t){i(t)}}function s(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))};function al(t){var e=t.scene,n=t.state,r=t.children,o=t.className,i=nt().ratio,a=rl((0,W.useState)((function(){return e._$getBackgroundMusic()})),2),s=a[0],u=a[1],c=rl((0,W.useState)(null),2),l=c[0],f=c[1],d=rl((0,W.useState)(null),2),p=d[0],h=d[1],y=rl(q().useReducer((function(t){return t+1}),0),2)[1];function v(t,e){return il(this,void 0,void 0,nl().mark((function n(){var r;return nl().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(t.$getHowl()&&t.$getHowl().playing(t.$getToken())){n.next=2;break}return n.abrupt("return",Promise.resolve());case 2:return r=t.$getHowl().volume(t.$getToken()),n.next=5,new Promise((function(n){t.$getHowl().fade(r,0,e,t.$getToken()),h((function(){return n})),f(setTimeout((function(){t.$getHowl().stop(),t.$getHowl().volume(r),t.$setToken(null),n(),h(null)}),e))}));case 5:return n.abrupt("return",n.sent);case 6:case"end":return n.stop()}}),n)})))}return(0,W.useEffect)((function(){return i.onUpdate((function(){y()}))})),(0,W.useEffect)((function(){var t=[{type:"event:scene.setBackgroundMusic",listener:e.events.on(Au.EventTypes["event:scene.setBackgroundMusic"],(function(t,e){(function(t,e){var n,r,o,i,a,c;return il(this,void 0,void 0,nl().mark((function d(){var y,m;return nl().wrap((function(d){for(;;)switch(d.prev=d.next){case 0:if(l&&(clearTimeout(l),f(null),p&&(p(),h(null))),m=t,!(y=s)){d.next=12;break}if(!e){d.next=9;break}return d.next=7,v(y,e);case 7:d.next=12;break;case 9:null===(n=y.$getHowl())||void 0===n||n.stop(),null===(r=y.$getHowl())||void 0===r||r.volume(0),y.$setToken(null);case 12:if(m){d.next=14;break}return d.abrupt("return");case 14:null===(o=m.$getHowl())||void 0===o||o.volume(0),m.$setToken(null===(i=m.$getHowl())||void 0===i?void 0:i.play(m.$getToken()||void 0)),e?null===(a=m.$getHowl())||void 0===a||a.fade(0,m.config.volume,e,m.$getToken()):null===(c=m.$getHowl())||void 0===c||c.volume(m.config.volume,m.$getToken()),u(m);case 18:case"end":return d.stop()}}),d)})))})(t,e).then()}))},{type:"event:scene.preUnmount",listener:e.events.on(Au.EventTypes["event:scene.preUnmount"],(function(){l&&(clearTimeout(l),p&&p()),s&&v(s,e.state.backgroundMusicFade).then()}))}];return function(){t.forEach((function(t){var n=t.type,r=t.listener;e.events.off(n,r)}))}}),[]),(0,W.useEffect)((function(){return e.events.emit(Au.EventTypes["event:scene.mount"]),function(){e.events.emit(Au.EventTypes["event:scene.unmount"])}}),[]),q().createElement("div",{className:o},q().createElement(tl,{scene:e,props:{width:i.state.width,height:i.state.height,src:gs.backgroundToSrc(e.state.background)},state:n}),r)}function sl(t){if("undefined"==typeof Proxy)return t;const e=new Map;return new Proxy(((...e)=>t(...e)),{get:(n,r)=>"create"===r?t:(e.has(r)||e.set(r,t(r)),e.get(r))})}const ul=(0,W.createContext)({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"}),cl=(0,W.createContext)({}),ll=(0,W.createContext)(null),fl=si?W.useLayoutEffect:W.useEffect,{schedule:dl,cancel:pl}=je(queueMicrotask,!1);function hl(t){return t&&"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"current")}const yl=(0,W.createContext)({});let vl=!1;function ml(t,e,n,r,o){var i;const{visualElement:a}=(0,W.useContext)(cl),s=(0,W.useContext)(rc),u=(0,W.useContext)(ll),c=(0,W.useContext)(ul).reducedMotion,l=(0,W.useRef)();r=r||s.renderer,!l.current&&r&&(l.current=r(t,{visualState:e,parent:a,props:n,presenceContext:u,blockInitialAnimation:!!u&&!1===u.initial,reducedMotionConfig:c}));const f=l.current,d=(0,W.useContext)(yl);!f||f.projection||!o||"html"!==f.type&&"svg"!==f.type||function(t,e,n,r){const{layoutId:o,layout:i,drag:a,dragConstraints:s,layoutScroll:u,layoutRoot:c}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:bl(t.parent)),t.projection.setOptions({layoutId:o,layout:i,alwaysMeasureLayout:Boolean(a)||s&&hl(s),visualElement:t,animationType:"string"==typeof i?i:"both",initialPromotionConfig:r,layoutScroll:u,layoutRoot:c})}(l.current,n,o,d),(0,W.useInsertionEffect)((()=>{f&&f.update(n,u)}));const p=n[Xo],h=(0,W.useRef)(Boolean(p)&&!window.MotionHandoffIsComplete&&(null===(i=window.MotionHasOptimisedAnimation)||void 0===i?void 0:i.call(window,p)));return fl((()=>{f&&(f.updateFeatures(),dl.render(f.render),h.current&&f.animationState&&f.animationState.animateChanges())})),(0,W.useEffect)((()=>{f&&(!h.current&&f.animationState&&f.animationState.animateChanges(),h.current=!1,vl||(vl=!0,queueMicrotask(gl)))})),f}function gl(){window.MotionHandoffIsComplete=!0}function bl(t){if(t)return!1!==t.options.allowProjection?t.projection:bl(t.parent)}function wl(t,e,n){return(0,W.useCallback)((r=>{r&&t.mount&&t.mount(r),e&&(r?e.mount(r):e.unmount()),n&&("function"==typeof n?n(r):hl(n)&&(n.current=r))}),[e])}function _l(t){const{initial:e,animate:n}=function(t,e){if(hi(t)){const{initial:e,animate:n}=t;return{initial:!1===e||fi(e)?e:void 0,animate:fi(n)?n:void 0}}return!1!==t.inherit?e:{}}(t,(0,W.useContext)(cl));return(0,W.useMemo)((()=>({initial:e,animate:n})),[Sl(e),Sl(n)])}function Sl(t){return Array.isArray(t)?t.join(" "):t}const kl=(0,W.createContext)({}),xl=Symbol.for("motionComponentSymbol");function Al({preloadedFeatures:t,createVisualElement:e,useRender:n,useVisualState:r,Component:o}){t&&oc(t);const i=(0,W.forwardRef)((function(t,i){let a;const s={...(0,W.useContext)(ul),...t,layoutId:Tl(t)},{isStatic:u}=s,c=_l(t),l=r(t,u);if(!u&&si){!function(){(0,W.useContext)(rc).strict;0}();const t=function(t){const{drag:e,layout:n}=mi;if(!e&&!n)return{};const r={...e,...n};return{MeasureLayout:(null==e?void 0:e.isEnabled(t))||(null==n?void 0:n.isEnabled(t))?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}(s);a=t.MeasureLayout,c.visualElement=ml(o,l,s,e,t.ProjectionNode)}return(0,nc.jsxs)(cl.Provider,{value:c,children:[a&&c.visualElement?(0,nc.jsx)(a,{visualElement:c.visualElement,...s}):null,n(o,t,wl(l,c.visualElement,i),l,u,c.visualElement)]})}));return i[xl]=o,i}function Tl({layoutId:t}){const e=(0,W.useContext)(kl).id;return e&&void 0!==t?e+"-"+t:t}function El(t){const e=Jo(t)?t.get():t;return Fo(e)?e.toValue():e}const Ol=t=>(e,n)=>{const r=(0,W.useContext)(cl),o=(0,W.useContext)(ll),i=()=>function({applyWillChange:t=!1,scrapeMotionValuesFromProps:e,createRenderState:n,onMount:r},o,i,a,s){const u={latestValues:Cl(o,i,a,!s&&t,e),renderState:n()};return r&&(u.mount=t=>r(o,t,u)),u}(t,e,r,o,n);return n?i():function(t){const e=(0,W.useRef)(null);return null===e.current&&(e.current=t()),e.current}(i)};function Pl(t,e){const n=Zo(e);n&&Vo(t,n)}function jl(t,e,n){const r=Array.isArray(e)?e:[e];for(let e=0;e<r.length;e++){const o=zo(t,r[e]);if(o){const{transitionEnd:t,transition:e,...r}=o;n(r,t)}}}function Cl(t,e,n,r,o){var i;const a={},s=[],u=r&&void 0===(null===(i=t.style)||void 0===i?void 0:i.willChange),c=o(t,{});for(const t in c)a[t]=El(c[t]);let{initial:l,animate:f}=t;const d=hi(t),p=yi(t);e&&p&&!d&&!1!==t.inherit&&(void 0===l&&(l=e.initial),void 0===f&&(f=e.animate));let h=!!n&&!1===n.initial;h=h||!1===l;const y=h?f:l;return y&&"boolean"!=typeof y&&!li(y)&&jl(t,y,((t,e)=>{for(const e in t){let n=t[e];if(Array.isArray(n)){n=n[h?n.length-1:0]}null!==n&&(a[e]=n)}for(const t in e)a[t]=e[t]})),u&&(f&&!1!==l&&!li(f)&&jl(t,f,(t=>{for(const e in t)Pl(s,e)})),s.length&&(a.willChange=s.join(","))),a}const Il=()=>({style:{},transform:{},transformOrigin:{},vars:{}}),Ml=()=>({...Il(),attrs:{}}),Ll={useVisualState:Ol({scrapeMotionValuesFromProps:ai,createRenderState:Ml,onMount:(t,e,{renderState:n,latestValues:r})=>{Ce.read((()=>{try{n.dimensions="function"==typeof e.getBBox?e.getBBox():e.getBoundingClientRect()}catch(t){n.dimensions={x:0,y:0,width:0,height:0}}})),Ce.render((()=>{Ci(n,r,Ni(e.tagName),t.transformTemplate),Li(e,n)}))}})},Nl={useVisualState:Ol({applyWillChange:!0,scrapeMotionValuesFromProps:ii,createRenderState:Il})};function Fl(t,e,n){for(const r in e)Jo(e[r])||oi(r,n)||(t[r]=e[r])}function Rl(t,e){const n={};return Fl(n,t.style||{},t),Object.assign(n,function({transformTemplate:t},e){return(0,W.useMemo)((()=>{const n=Il();return Ei(n,e,t),Object.assign({},n.vars,n.style)}),[e])}(t,e)),n}function Vl(t,e){const n={},r=Rl(t,e);return t.drag&&!1!==t.dragListener&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=!0===t.drag?"none":"pan-"+("x"===t.drag?"y":"x")),void 0===t.tabIndex&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=r,n}const Dl=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function Bl(t){return t.startsWith("while")||t.startsWith("drag")&&"draggable"!==t||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||Dl.has(t)}let $l=t=>!Bl(t);try{(Ul=require("@emotion/is-prop-valid").default)&&($l=t=>t.startsWith("on")?!Bl(t):Ul(t))}catch(t){}var Ul;function Hl(t,e,n,r){const o=(0,W.useMemo)((()=>{const n=Ml();return Ci(n,e,Ni(r),t.transformTemplate),{...n.attrs,style:{...n.style}}}),[e]);if(t.style){const e={};Fl(e,t.style,t),o.style={...e,...o.style}}return o}function Gl(t=!1){return(e,n,r,{latestValues:o},i)=>{const a=(Vc(e)?Hl:Vl)(n,o,i,e),s=function(t,e,n){const r={};for(const o in t)"values"===o&&"object"==typeof t.values||($l(o)||!0===n&&Bl(o)||!e&&!Bl(o)||t.draggable&&o.startsWith("onDrag"))&&(r[o]=t[o]);return r}(n,"string"==typeof e,t),u=e!==W.Fragment?{...s,...a,ref:r}:{},{children:c}=n,l=(0,W.useMemo)((()=>Jo(c)?c.get():c),[c]);return(0,W.createElement)(e,{...u,children:l})}}function zl(t,e){return function(n,{forwardMotionProps:r}={forwardMotionProps:!1}){return Al({...Vc(n)?Ll:Nl,preloadedFeatures:t,useRender:Gl(r),createVisualElement:e,Component:n})}}const Wl=sl(zl());function ql(t){return ql="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ql(t)}function Yl(){return Yl=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)({}).hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Yl.apply(null,arguments)}function Xl(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */Xl=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function c(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,n){return t[e]=n}}function l(t,e,n,r){var i=e&&e.prototype instanceof m?e:m,a=Object.create(i.prototype),s=new j(r||[]);return o(a,"_invoke",{value:T(t,n,s)}),a}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var d="suspendedStart",p="suspendedYield",h="executing",y="completed",v={};function m(){}function g(){}function b(){}var w={};c(w,a,(function(){return this}));var _=Object.getPrototypeOf,S=_&&_(_(C([])));S&&S!==n&&r.call(S,a)&&(w=S);var k=b.prototype=m.prototype=Object.create(w);function x(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function A(t,e){function n(o,i,a,s){var u=f(t[o],t,i);if("throw"!==u.type){var c=u.arg,l=c.value;return l&&"object"==ql(l)&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,s)}),(function(t){n("throw",t,a,s)})):e.resolve(l).then((function(t){c.value=t,a(c)}),(function(t){return n("throw",t,a,s)}))}s(u.arg)}var i;o(this,"_invoke",{value:function(t,r){function o(){return new e((function(e,o){n(t,r,e,o)}))}return i=i?i.then(o,o):o()}})}function T(e,n,r){var o=d;return function(i,a){if(o===h)throw Error("Generator is already running");if(o===y){if("throw"===i)throw a;return{value:t,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var u=E(s,r);if(u){if(u===v)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===d)throw o=y,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=h;var c=f(e,n,r);if("normal"===c.type){if(o=r.done?y:p,c.arg===v)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(o=y,r.method="throw",r.arg=c.arg)}}}function E(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,E(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var i=f(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function C(e){if(e||""===e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function n(){for(;++o<e.length;)if(r.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return i.next=i}}throw new TypeError(ql(e)+" is not iterable")}return g.prototype=b,o(k,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:g,configurable:!0}),g.displayName=c(b,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,c(t,u,"GeneratorFunction")),t.prototype=Object.create(k),t},e.awrap=function(t){return{__await:t}},x(A.prototype),c(A.prototype,s,(function(){return this})),e.AsyncIterator=A,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new A(l(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},x(k),c(k,u,"Generator"),c(k,a,(function(){return this})),c(k,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=C,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(P),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function o(r,o){return s.type="throw",s.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(u&&c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),P(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;P(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:C(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}function Kl(t){return function(t){if(Array.isArray(t))return Jl(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||Ql(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Zl(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,s=[],u=!0,c=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(s.push(r.value),s.length!==e);u=!0);}catch(t){c=!0,o=t}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(t,e)||Ql(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ql(t,e){if(t){if("string"==typeof t)return Jl(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Jl(t,e):void 0}}function Jl(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}var tf=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{u(r.next(t))}catch(t){i(t)}}function s(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))};function ef(t){var e=this,n=t.image,r=t.state,o=t.onAnimationEnd,i=(0,W.useRef)(null),a=Zl((0,W.useState)(null),2),s=a[0],u=a[1],c=Zl((0,W.useState)({style:{}}),2),l=c[0],f=c[1],d=Zl((0,W.useState)(null),2),h=d[0],y=d[1],v=Zl((0,W.useState)([]),2)[1],m=(0,W.useRef)(0),g=nt().ratio,b=pt().game,w=Zl(q().useReducer((function(t){return t+1}),0),2)[1];(0,W.useEffect)((function(){return g.onUpdate((function(){w()}))})),(0,W.useEffect)((function(){n.setScope(i),n.events.emit(ka.EventTypes["event:image.mount"]);var t=n.events.onEvents([].concat(Kl([ka.EventTypes["event:image.show"],ka.EventTypes["event:image.hide"],ka.EventTypes["event:image.applyTransform"]].map((function(t){return{type:t,listener:n.events.on(t,(function(t){return tf(e,void 0,void 0,Xl().mark((function e(){return Xl().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return S(t.propToCSS(r,n.state)),u(t),r.logger.debug("transform",t,t.propToCSS(r,n.state)),e.next=5,t.animate({scope:i},r,n.state,(function(e){n.state=p(n.state,e),f({style:t.propToCSS(r,n.state)}),o&&o(),u(null)}));case 5:return e.abrupt("return",!0);case 6:case"end":return e.stop()}}),e)})))}))}}))),[{type:ka.EventTypes["event:image.init"],listener:n.events.on(ka.EventTypes["event:image.init"],(function(){return tf(e,void 0,void 0,Xl().mark((function t(){return Xl().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n.toTransform().animate({scope:i},r,n.state,(function(t){n.state=p(n.state,t),f({style:n.toTransform().propToCSS(r,n.state)})}));case 2:case"end":return t.stop()}}),t)})))}))}]));return S(n.toTransform().propToCSS(r,n.state)),n.events.emit(ka.EventTypes["event:image.ready"],i),function(){t.cancel(),n.events.emit(ka.EventTypes["event:image.unmount"])}}),[]),(0,W.useEffect)((function(){var t=n.events.onEvents([{type:ka.EventTypes["event:image.setTransition"],listener:n.events.on(ka.EventTypes["event:image.setTransition"],(function(t){y(t)}))}]),e=h?h.events.onEvents([{type:Gc.update,listener:h.events.on(Gc.update,(function(t){v(t)}))},{type:Gc.end,listener:h.events.on(Gc.end,(function(){y(null)}))}]):null;return function(){var n;t.cancel(),null===(n=null==e?void 0:e.cancel)||void 0===n||n.call(e)}}),[h,n]),(0,W.useEffect)((function(){m.current=performance.now()}),[]);var _=function(){var t=performance.now()-m.current,e=b.config.elements.img.slowLoadThreshold;t>e&&b.config.elements.img.slowLoadWarning&&console.warn("Image took ".concat(t,"ms to load, which exceeds the threshold of ").concat(e,"ms. ")+"Consider enable cache for the image, so Preloader can preload it before it's used. To disable this warning, set `elements.img.slowLoadWarning` to false in the game config.")};function S(t){if(s&&s.getControl()&&(console.warn("processing transform not completed"),s.getControl().complete(),s.setControl(null)),!i.current)throw new Error("scope not ready");t instanceof ya?Object.assign(i.current.style,t.propToCSS(r,n.state)):Object.assign(i.current.style,t)}var k={className:"absolute",src:gs.staticImageDataToSrc(n.state.src)};return q().createElement(it,{className:"absolute overflow-hidden"},h?h.toElementProps().map((function(t,e,n){var r=p(k,l,t);return q().createElement(Wl.img,Yl({key:e,alt:r.alt},r,{ref:e===n.length-1?i:void 0,onLoad:_,layout:!0}))})):q().createElement(Wl.img,Yl({ref:i,alt:"image"},p(k,l),{onLoad:_})))}function nf(t){return nf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},nf(t)}function rf(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,of(r.key),r)}}function of(t){var e=function(t,e){if("object"!=nf(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=nf(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==nf(e)?e:e+""}var af=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.preloaded=[],this.events=new m}return function(t,e,n){return e&&rf(t.prototype,e),n&&rf(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}(t,[{key:"add",value:function(e){return this.has(this.getSrc(e))||(this.preloaded.push(e),this.events.emit(t.EventTypes["event:preloaded.add"],e),this.events.emit(t.EventTypes["event:preloaded.change"])),this}},{key:"get",value:function(t){var e=this;return this.preloaded.find((function(n){return e.getSrc(n)===t}))}},{key:"has",value:function(t){var e=this;return Array.isArray(t)?t.every((function(t){return e.has(t)})):this.preloaded.some((function(n){return e.getSrc(n)===t}))}},{key:"remove",value:function(e){var n=this;if(Array.isArray(e)){var r=e.map((function(t){return n.getSrc(t)}));return this.preloaded=this.preloaded.filter((function(t){return!r.includes(n.getSrc(t))})),this}var o=this.getSrc(e);return this.preloaded=this.preloaded.filter((function(t){return n.getSrc(t)!==o})),this.events.emit(t.EventTypes["event:preloaded.remove"],e),this.events.emit(t.EventTypes["event:preloaded.change"]),this}},{key:"clear",value:function(){return this.preloaded=[],this}},{key:"getSrc",value:function(t){return"string"==typeof t?t:"image"===t.type?gs.srcToString(t.src.state.src):"video"===t.type?t.src:"audio"===t.type?t.src.getSrc():""}}])}();function sf(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,s=[],u=!0,c=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(s.push(r.value),s.length!==e);u=!0);}catch(t){c=!0,o=t}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(t,e)||function(t,e){if(t){if("string"==typeof t)return uf(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?uf(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function uf(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}af.EventTypes={"event:preloaded.add":"event:preloaded.add","event:preloaded.remove":"event:preloaded.remove","event:preloaded.change":"event:preloaded.change","event:preloaded.mount":"event:preloaded.mount","event:preloaded.ready":"event:preloaded.ready"};var cf=(0,W.createContext)(null);function lf(t){var e=t.children,n=sf((0,W.useState)(new af),1)[0];return q().createElement(q().Fragment,null,q().createElement(cf.Provider,{value:{preloaded:n}},e))}function ff(){if(!cf)throw new Error("usePreloaded must be used within a PreloadedProvider");return(0,W.useContext)(cf)}function df(t){return function(t){if(Array.isArray(t))return pf(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return pf(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?pf(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function pf(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function hf(t){var e=t.state,n=t.srcManager,r=ff().preloaded;return(0,W.useEffect)((function(){var t,o;if("undefined"!=typeof window){var i=null===(t=e.getLastScene())||void 0===t?void 0:t.srcManager,a=(null===(o=e.getLastScene())||void 0===o?void 0:o.srcManager.future)||[],s=[].concat(df(n.src),df(i?i.src:[]),df(a.map((function(t){return t.src})).flat(2))),u={image:new Set,audio:new Set,video:new Set};s.forEach((function(t){t.type===yu.SrcTypes.image?u.image.add(t.src):t.type===yu.SrcTypes.audio?u.audio.add(t.src):t.type===yu.SrcTypes.video&&u.video.add(t.src)})),e.logger.debug("Preloading",u,a),r.preloaded=r.preloaded.filter((function(t){if(t.type===yu.SrcTypes.audio){var e=u[t.type].has(t.src);return e||(e=Array.from(u[t.type]).some((function(e){return r.getSrc(t)===r.getSrc(e.config.src)}))),e}if(t.type===yu.SrcTypes.image)return u[t.type].has(t.src);var n=r.getSrc(t);return u[t.type].has(n)}));var c=[];return u.image.forEach((function(t){var n=new Image;n.src=gs.srcToString(t.state.src),n.onload=function(){e.logger.debug("Image loaded",t.state.src)},c.push(n),r.add({type:"image",src:t})})),Promise.all([]).then((function(){r.events.emit(af.EventTypes["event:preloaded.ready"])})),u.audio.forEach((function(t){t.$getHowl()||t.$setHowl(new(e.getHowl())({src:t.config.src,loop:t.config.loop,volume:t.config.volume,autoplay:!1,preload:!0}))})),r.events.emit(af.EventTypes["event:preloaded.mount"]),function(){c.forEach((function(t){t.onload=null}))}}console.warn("Window is not supported in this environment")}),[e]),null}function yf(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,s=[],u=!0,c=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(s.push(r.value),s.length!==e);u=!0);}catch(t){c=!0,o=t}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(t,e)||function(t,e){if(t){if("string"==typeof t)return vf(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?vf(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function vf(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function mf(t,e){return t.handle(e)}function gf(t){var e=t.story,n=t.width,r=t.height,o=t.className,i=t.onReady,a=t.onEnd,s=yf((0,W.useReducer)((function(t){return t+1}),0),2)[1],u=pt().game,c=yf((0,W.useReducer)(mf,new H(u,{forceUpdate:function(){s()},next:y,dispatch:function(t){return f(t)}})),2),l=c[0],f=c[1],d=u.config.elements.say.use,p=u.config.elements.menu.use;function y(){for(var t=!1;!t;){var e=u.getLiveGame().next(l);if(!e)break;if(h.isAwaitable(e)){t=!0;break}f(e)}l.stage.forceUpdate()}return(0,W.useEffect)((function(){e&&u.getLiveGame().loadStory(e)}),[e,u]),(0,W.useEffect)((function(){i&&i(u);var t=l.getLastScene(),e=[];t?e.push({type:"event:scene.mount",listener:t.events.once("event:scene.mount",(function(){l.stage.next()}))}):l.stage.next();var n=l.events.onEvents([{type:H.EventTypes["event:state.end"],listener:function(){a&&a(u)}}]);return l.stage.forceUpdate(),function(){t&&e.forEach((function(e){t.events.off(e.type,e.listener)})),n.cancel()}}),[]),q().createElement(Bc,null,q().createElement("div",{style:{width:"number"==typeof n?"".concat(n,"px"):n,height:"number"==typeof r?"".concat(r,"px"):r},className:z(o)},q().createElement(Hc,{className:z("flex-grow overflow-auto")},q().createElement(it,{className:"relative"},l.state.srcManagers.map((function(t,e){return q().createElement(hf,{key:e,state:l,srcManager:t})})),q().createElement(bf,{onLoaded:function(){l.stage.forceUpdate(),e&&y()}},l.getSceneElements().map((function(t){var e=t.scene,n=t.ele;return q().createElement(al,{key:"scene-"+e.id,state:l,scene:e},n.images.map((function(t){return q().createElement(ef,{key:"image-"+t.id,image:t,state:l})})),n.texts.map((function(t){var e=t.action,n=t.onClick;return q().createElement(d,{key:"say-"+e.id,action:e,onClick:function(){n(),y()}})})),n.menus.map((function(t,e){return q().createElement("div",{key:"menu-"+e},q().createElement(p,{prompt:t.action.prompt,choices:t.action.choices,afterChoose:function(e){t.onClick(e),y()}}))})))})))))))}function bf(t){var e=t.children,n=t.onLoaded,r=ff().preloaded,o=yf((0,W.useState)(!1),2),i=o[0],a=o[1];return(0,W.useEffect)((function(){var t=r.events.on(af.EventTypes["event:preloaded.ready"],(function(){a(!0),n()}));return function(){r.events.off(af.EventTypes["event:preloaded.ready"],t)}}),[i]),q().createElement(q().Fragment,null,i?e:null)}function wf(t){var e=t.children,n=t.game;return q().createElement(q().Fragment,null,q().createElement(et,null,q().createElement(dt,{game:n},q().createElement(lf,null,e))))}function _f(t){return _f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_f(t)}function Sf(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,kf(r.key),r)}}function kf(t){var e=function(t,e){if("object"!=_f(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=_f(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==_f(e)?e:e+""}var xf=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.events=new m}return function(t,e,n){return e&&Sf(t.prototype,e),n&&Sf(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}(t,[{key:"start",value:function(t){}},{key:"toElementProps",value:function(){return[]}},{key:"setSrc",value:function(t){}},{key:"requestAnimation",value:function(t,e,n){var r=this,o=t.start,i=t.end,a=t.duration,s=e.onComplete,u=e.onUpdate;return this.events.emit(Gc.start,null),na(o,i,Object.assign({duration:a/1e3,onUpdate:function(t){u&&u(t),r.events.emit(Gc.update,r.toElementProps())},onComplete:function(){r.events.emit(Gc.end,null),s&&s()}},n))}},{key:"copy",value:function(){return new t}}])}();function Af(t){return Af="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Af(t)}function Tf(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Ef(r.key),r)}}function Ef(t){var e=function(t,e){if("object"!=Af(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=Af(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Af(e)?e:e+""}function Of(t,e,n){return e=jf(e),function(t,e){if(e&&("object"==Af(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Pf()?Reflect.construct(e,n||[],jf(t).constructor):e.apply(t,n))}function Pf(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Pf=function(){return!!t})()}function jf(t){return jf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},jf(t)}function Cf(t,e){return Cf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Cf(t,e)}var If=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1e3,r=arguments.length>1?arguments[1]:void 0;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=Of(this,e)).state={opacity:1},t.duration=n,r&&(t.src="string"==typeof r?r:r instanceof Au?gs.backgroundToSrc(r.config.background):gs.staticImageDataToSrc(r)),t}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Cf(t,e)}(e,t),function(t,e,n){return e&&Tf(t.prototype,e),n&&Tf(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}(e,[{key:"setSrc",value:function(t){this.src=t}},{key:"start",value:function(t){var n=this;this.state.opacity=e.Frames[0],this.events.emit(Gc.start,null),na(e.Frames[0],e.Frames[1],{duration:this.duration/1e3,onUpdate:function(t){n.state.opacity=t,n.events.emit(Gc.update,n.toElementProps())},onComplete:function(){n.events.emit(Gc.end,null),t&&t()}})}},{key:"toElementProps",value:function(){return[{},{style:{opacity:this.state.opacity},src:this.src}]}},{key:"copy",value:function(){return new e(this.duration,this.src)}}])}(xf);function Mf(t){return Mf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Mf(t)}function Lf(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Nf(r.key),r)}}function Nf(t){var e=function(t,e){if("object"!=Mf(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=Mf(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Mf(e)?e:e+""}function Ff(t,e,n){return e=Vf(e),function(t,e){if(e&&("object"==Mf(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Rf()?Reflect.construct(e,n||[],Vf(t).constructor):e.apply(t,n))}function Rf(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Rf=function(){return!!t})()}function Vf(t){return Vf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Vf(t)}function Df(t,e){return Df=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Df(t,e)}If.Frames=[0,1];var Bf=function(t){function e(t,n){var r,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1e3,i=arguments.length>3?arguments[3]:void 0;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=Ff(this,e)).state={opacity:0,transform:""},r.duration=o,r.direction=t,r.offset=n,i&&(r.src="string"==typeof i?i:i instanceof Au?gs.backgroundToSrc(i.config.background):gs.staticImageDataToSrc(i)),r.__stack=g(),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Df(t,e)}(e,t),function(t,e,n){return e&&Lf(t.prototype,e),n&&Lf(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}(e,[{key:"setSrc",value:function(t){this.src=t}},{key:"start",value:function(t){var e=this;if(!this.src)throw new Error("src is required, but not provided\nat:\n"+this.__stack);this.state.opacity=0,this.state.transform=this.getInitialTransform(),this.events.emit(Gc.start,null),na(0,1,{duration:this.duration/1e3,onUpdate:function(t){e.state.opacity=t,e.state.transform=e.getTransform(t),e.events.emit(Gc.update,e.toElementProps())},onComplete:function(){e.events.emit(Gc.end,null),t&&t()}})}},{key:"toElementProps",value:function(){return[{},{style:{opacity:this.state.opacity,transform:this.state.transform},src:this.src}]}},{key:"copy",value:function(){return new e(this.direction,this.offset,this.duration,this.src)}},{key:"getInitialTransform",value:function(){switch(this.direction){case"left":return"translateX(-".concat(this.offset,"px)");case"right":return"translateX(".concat(this.offset,"px)");case"top":return"translateY(-".concat(this.offset,"px)");case"bottom":return"translateY(".concat(this.offset,"px)");default:return""}}},{key:"getTransform",value:function(t){switch(this.direction){case"left":return"translateX(".concat((1-t)*-this.offset,"px)");case"right":return"translateX(".concat((1-t)*this.offset,"px)");case"top":return"translateY(".concat((1-t)*-this.offset,"px)");case"bottom":return"translateY(".concat((1-t)*this.offset,"px)");default:return""}}}])}(xf);function $f(t){return $f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$f(t)}function Uf(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Hf(r.key),r)}}function Hf(t){var e=function(t,e){if("object"!=$f(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=$f(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==$f(e)?e:e+""}function Gf(t,e,n){return e=Wf(e),function(t,e){if(e&&("object"==$f(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,zf()?Reflect.construct(e,n||[],Wf(t).constructor):e.apply(t,n))}function zf(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(zf=function(){return!!t})()}function Wf(t){return Wf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Wf(t)}function qf(t,e){return qf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},qf(t,e)}var Yf=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1e3,r=arguments.length>1?arguments[1]:void 0;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=Gf(this,e)).state={opacity:0},t.duration=n,r&&(t.src="string"==typeof r?r:r instanceof Au?gs.backgroundToSrc(r.config.background):gs.staticImageDataToSrc(r)),t}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&qf(t,e)}(e,t),function(t,e,n){return e&&Uf(t.prototype,e),n&&Uf(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}(e,[{key:"setSrc",value:function(t){this.src=t}},{key:"start",value:function(t){var n=this;this.state.opacity=e.Frames[0],this.requestAnimation({start:e.Frames[0],end:e.Frames[1],duration:this.duration},{onComplete:t,onUpdate:function(t){n.state.opacity=t}})}},{key:"toElementProps",value:function(){return[{style:{opacity:this.state.opacity}},{style:{opacity:1-this.state.opacity},src:this.src}]}},{key:"copy",value:function(){return new e(this.duration,this.src)}}])}(xf);Yf.Frames=[1,0]})(),o})()));