@drincs/pixi-vn-ink 0.13.2 → 0.13.3
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/{chunk-USLPPQUR.mjs → chunk-MYOMP4AP.mjs} +6 -6
- package/dist/index.cjs +10 -10
- package/dist/index.mjs +1 -1
- package/dist/vite-listener.cjs +10 -10
- package/dist/vite-listener.mjs +1 -1
- package/package.json +2 -2
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import {a,c,b as b$1,e,d,f as f$1}from'./chunk-M7O5Q75X.mjs';import {PixiError,createExportableElement}from'@drincs/pixi-vn';import {RegisteredLabels,narration,NarrationManagerStatic,LabelAbstract}from'@drincs/pixi-vn/narration';import {storage}from'@drincs/pixi-vn/storage';import {canvas,VideoSprite,showVideo,Assets,Text,showText,ImageSprite,showImage,ImageContainer,showImageContainer,shakeEffect,pushOut,zoomOut,moveOut,removeWithDissolve,removeWithFade,pushIn,zoomIn,moveIn,showWithDissolve,showWithFade}from'@drincs/pixi-vn/canvas';import {sound}from'@drincs/pixi-vn/sound';import {RegisteredCharacters}from'@drincs/pixi-vn/characters';var Gt=Object.defineProperty,qt=(e,t,u)=>t in e?Gt(e,t,{enumerable:true,configurable:true,writable:true,value:u}):e[t]=u,U=(e,t,u)=>qt(e,typeof t!="symbol"?t+"":t,u),z;(e=>(e.log=(t,...u)=>console.log(`[Pixi\u2019VN Json] ${t}`,...u),e.warn=(t,...u)=>console.warn(`[Pixi\u2019VN Json] ${t}`,...u),e.error=(t,...u)=>console.error(`[Pixi\u2019VN Json] ${t}`,...u),e.info=(t,...u)=>console.info(`[Pixi\u2019VN Json] ${t}`,...u)))(z||(z={}));var H=class O{static init(t){t.loadAssets&&(O._loadAssets=t.loadAssets),t.soundOperation&&(O._soundOperation=t.soundOperation),t.imageOperation&&(O._imageOperation=t.imageOperation),t.videoOperation&&(O._videoOperation=t.videoOperation),t.imageContainerOperation&&(O._imageContainerOperation=t.imageContainerOperation),t.textOperation&&(O._textOperation=t.textOperation),t.canvasElementOperation&&(O._canvasElementOperation=t.canvasElementOperation),t.setStorageValue&&(O._setStorageValue=t.setStorageValue),t.setInitialStorageValue&&(O._setInitialStorageValue=t.setInitialStorageValue),t.narrationOperation&&(O._narrationOperation=t.narrationOperation),t.effectOperation&&(O._effectOperation=t.effectOperation),t.animateOperation&&(O._animateOperation=t.animateOperation),t.getLogichValue&&(O._getLogichValue=t.getLogichValue),t.getConditionalStep&&(O._getConditionalStep=t.getConditionalStep);}static get loadAssets(){return O._loadAssets}static get soundOperation(){return O._soundOperation}static get imageOperation(){return O._imageOperation}static get videoOperation(){return O._videoOperation}static get textOperation(){return O._textOperation}static get imageContainerOperation(){return O._imageContainerOperation}static get canvasElementOperation(){return O._canvasElementOperation}static get setStorageValue(){return O._setStorageValue}static get setInitialStorageValue(){return O._setInitialStorageValue}static get narrationOperation(){return O._narrationOperation}static get effectOperation(){return O._effectOperation}static get animateOperation(){return O._animateOperation}static get getLogichValue(){return O._getLogichValue}static get getConditionalStep(){return O._getConditionalStep}};U(H,"_loadAssets",()=>{}),U(H,"_soundOperation",()=>{throw z.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")}),U(H,"_imageOperation",()=>{throw z.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")}),U(H,"_videoOperation",()=>{throw z.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")}),U(H,"_imageContainerOperation",()=>{throw z.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")}),U(H,"_textOperation",()=>{throw z.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")}),U(H,"_canvasElementOperation",()=>{throw z.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")}),U(H,"_setStorageValue",()=>{throw z.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")}),U(H,"_setInitialStorageValue",()=>{throw z.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")}),U(H,"_narrationOperation",()=>{throw z.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")}),U(H,"_effectOperation",()=>{throw z.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")}),U(H,"_animateOperation",()=>{throw z.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")}),U(H,"_getLogichValue",()=>{throw z.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")}),U(H,"_getConditionalStep",()=>{throw z.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")});var x=H;var Ut=Object.defineProperty,Yt=(e,t,u)=>t in e?Ut(e,t,{enumerable:true,configurable:true,writable:true,value:u}):e[t]=u,Me=(e,t,u)=>Yt(e,typeof t!="symbol"?t+"":t,u);function Qt(e){let t="";return e.values.forEach(u=>{if(typeof u=="string")t+=u;else {let n=x.getLogichValue(u);t+=`${n}`;}}),t}var Te=class V{static t(t){return Array.isArray(t)?t.map(u=>V.translate(`${u}`)):V.translate(`${t}`)}static set beforeToTranslate(t){V._beforeToTranslate=t;}static set translate(t){V._translate=t;}static get translate(){return t=>{let u=t;return V._beforeToTranslate&&(u=V._beforeToTranslate(u)),u=V._translate(u),V._afterToTranslate&&(u=V._afterToTranslate(u)),u}}static set afterToTranslate(t){V._afterToTranslate=t;}static addKey(t,u,n){let i=n.defaultValue||"empty_string";typeof u=="string"&&(u=[u]),Array.isArray(u)&&u.forEach(l=>{t[l]===void 0&&(i==="empty_string"?t[l]="":i==="copy_key"&&(V._beforeToTranslate?t[l]=V._beforeToTranslate(l):t[l]=l));});}static getConditionalsThenElse(t,u=[]){if(typeof t=="object"&&t&&"type"in t)if(t.type==="ifelse")t.then&&V.getConditionalsThenElse(t.then,u),t.else&&V.getConditionalsThenElse(t.else,u);else if(t.type==="stepswitch"){if(t.elements)if(Array.isArray(t.elements))t.elements.forEach(n=>{V.getConditionalsThenElse(n,u);});else if(t.elements.type==="ifelse"){let n=[];V.getConditionalsThenElse(t.elements,n),n.forEach(i=>{u.push(...i);});}else if(t.elements.type==="stepswitch"){let n=[];V.getConditionalsThenElse(t.elements,n),n.forEach(i=>{u.push(...i);});}else V.getConditionalsThenElse(t.elements,u);}else t.type==="resulttocombine"?(t.firstItem&&V.getConditionalsThenElse(t.firstItem,u),t.secondConditionalItem&&t.secondConditionalItem.forEach(n=>{V.getConditionalsThenElse(n,u);})):u.push(t);else t&&u.push(t);return u}static async generateJsonTranslation(t,u={},n={}){let{defaultValue:i="copy_key",operationStringConvert:l}=n,d=t.map(async C=>{if(C.choices){let c=[];Array.isArray(C.choices)?c=[C.choices]:c=V.getConditionalsThenElse(C.choices),c.forEach(g=>g.forEach(D=>{if("type"in D){let F=[];D.type==="ifelse"||D.type==="stepswitch"?V.getConditionalsThenElse(D,F):F=[D],F.map(h=>V.getConditionalsThenElse(h.text)).forEach(h=>{Array.isArray(h)&&h.forEach(m=>{Array.isArray(m)?m.forEach(y=>{typeof y=="string"?V.addKey(u,y,{defaultValue:i}):V.getConditionalsThenElse(y).forEach(A=>{Array.isArray(A)?A.forEach(B=>{typeof B=="string"&&V.addKey(u,B,{defaultValue:i});}):typeof A=="string"&&V.addKey(u,A,{defaultValue:i});});}):typeof m=="string"&&V.addKey(u,m,{defaultValue:i});});});}}));}if(C.dialogue){let c=[];Array.isArray(C.dialogue)?c=[C.dialogue]:c=V.getConditionalsThenElse(C.dialogue),c.forEach(g=>{if(typeof g=="string")V.addKey(u,g,{defaultValue:i});else if("text"in g){let D=V.getConditionalsThenElse(g.text);typeof D=="string"&&(D=[D]),D.forEach(F=>{typeof F=="string"?V.addKey(u,F,{defaultValue:i}):V.getConditionalsThenElse(F).forEach(h=>{typeof h=="string"?V.addKey(u,h,{defaultValue:i}):Array.isArray(h)&&h.forEach(m=>{typeof m=="string"?V.addKey(u,m,{defaultValue:i}):V.getConditionalsThenElse(m).forEach(y=>{typeof y=="string"&&V.addKey(u,y,{defaultValue:i});});});});});}});}if(C.operations)for(let c of C.operations){if(c.type==="operationtoconvert"&&l){let g=Qt(c),D=await l(g,C,{});if(!D)return;c=D;}c.type==="text"&&c.operationType==="show"&&V.addKey(u,c.text,{defaultValue:i});}C.conditionalStep&&V.getConditionalsThenElse(C.conditionalStep).forEach(c=>{Array.isArray(c)?V.generateJsonTranslation(c,u,n):V.generateJsonTranslation([c],u,n);});});return await Promise.all(d),u}};Me(Te,"_beforeToTranslate"),Me(Te,"_translate",e=>e),Me(Te,"_afterToTranslate");var Xt=Te,I=Xt;var tu=Object.create,Ge=Object.defineProperty,uu=Object.getOwnPropertyDescriptor,nu=Object.getOwnPropertyNames,ru=Object.getPrototypeOf,iu=Object.prototype.hasOwnProperty,ou=(e,t,u)=>t in e?Ge(e,t,{enumerable:true,configurable:true,writable:true,value:u}):e[t]=u,dt=(e=>typeof a<"u"?a:typeof Proxy<"u"?new Proxy(e,{get:(t,u)=>(typeof a<"u"?a:t)[u]}):e)(function(e){if(typeof a<"u")return a.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')}),At=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),au=(e,t,u,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of nu(t))!iu.call(e,i)&&i!==u&&Ge(e,i,{get:()=>t[i],enumerable:!(n=uu(t,i))||n.enumerable});return e},su=(e,t,u)=>(u=e!=null?tu(ru(e)):{},au(Ge(u,"default",{value:e,enumerable:true}),e)),We=(e,t,u)=>ou(e,typeof t!="symbol"?t+"":t,u),lu=At((e,t)=>{(function(u,n){typeof e=="object"?t.exports=e=n():typeof define=="function"&&define.amd?define([],n):u.CryptoJS=n();})(e,function(){var u=u||(function(n,i){var l;if(typeof window<"u"&&window.crypto&&(l=window.crypto),typeof self<"u"&&self.crypto&&(l=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(l=globalThis.crypto),!l&&typeof window<"u"&&window.msCrypto&&(l=window.msCrypto),!l&&typeof global<"u"&&global.crypto&&(l=global.crypto),!l&&typeof dt=="function")try{l=dt("crypto");}catch{}var d=function(){if(l){if(typeof l.getRandomValues=="function")try{return l.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof l.randomBytes=="function")try{return l.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},C=Object.create||(function(){function o(){}return function(r){var s;return o.prototype=r,s=new o,o.prototype=null,s}})(),c={},g=c.lib={},D=g.Base=(function(){return {extend:function(o){var r=C(this);return o&&r.mixIn(o),(!r.hasOwnProperty("init")||this.init===r.init)&&(r.init=function(){r.$super.init.apply(this,arguments);}),r.init.prototype=r,r.$super=this,r},create:function(){var o=this.extend();return o.init.apply(o,arguments),o},init:function(){},mixIn:function(o){for(var r in o)o.hasOwnProperty(r)&&(this[r]=o[r]);o.hasOwnProperty("toString")&&(this.toString=o.toString);},clone:function(){return this.init.prototype.extend(this)}}})(),F=g.WordArray=D.extend({init:function(o,r){o=this.words=o||[],r!=i?this.sigBytes=r:this.sigBytes=o.length*4;},toString:function(o){return (o||m).stringify(this)},concat:function(o){var r=this.words,s=o.words,p=this.sigBytes,E=o.sigBytes;if(this.clamp(),p%4)for(var T=0;T<E;T++){var _=s[T>>>2]>>>24-T%4*8&255;r[p+T>>>2]|=_<<24-(p+T)%4*8;}else for(var w=0;w<E;w+=4)r[p+w>>>2]=s[w>>>2];return this.sigBytes+=E,this},clamp:function(){var o=this.words,r=this.sigBytes;o[r>>>2]&=4294967295<<32-r%4*8,o.length=n.ceil(r/4);},clone:function(){var o=D.clone.call(this);return o.words=this.words.slice(0),o},random:function(o){for(var r=[],s=0;s<o;s+=4)r.push(d());return new F.init(r,o)}}),h=c.enc={},m=h.Hex={stringify:function(o){for(var r=o.words,s=o.sigBytes,p=[],E=0;E<s;E++){var T=r[E>>>2]>>>24-E%4*8&255;p.push((T>>>4).toString(16)),p.push((T&15).toString(16));}return p.join("")},parse:function(o){for(var r=o.length,s=[],p=0;p<r;p+=2)s[p>>>3]|=parseInt(o.substr(p,2),16)<<24-p%8*4;return new F.init(s,r/2)}},y=h.Latin1={stringify:function(o){for(var r=o.words,s=o.sigBytes,p=[],E=0;E<s;E++){var T=r[E>>>2]>>>24-E%4*8&255;p.push(String.fromCharCode(T));}return p.join("")},parse:function(o){for(var r=o.length,s=[],p=0;p<r;p++)s[p>>>2]|=(o.charCodeAt(p)&255)<<24-p%4*8;return new F.init(s,r)}},A=h.Utf8={stringify:function(o){try{return decodeURIComponent(escape(y.stringify(o)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(o){return y.parse(unescape(encodeURIComponent(o)))}},B=g.BufferedBlockAlgorithm=D.extend({reset:function(){this._data=new F.init,this._nDataBytes=0;},_append:function(o){typeof o=="string"&&(o=A.parse(o)),this._data.concat(o),this._nDataBytes+=o.sigBytes;},_process:function(o){var r,s=this._data,p=s.words,E=s.sigBytes,T=this.blockSize,_=T*4,w=E/_;o?w=n.ceil(w):w=n.max((w|0)-this._minBufferSize,0);var J=w*T,j=n.min(J*4,E);if(J){for(var q=0;q<J;q+=T)this._doProcessBlock(p,q);r=p.splice(0,J),s.sigBytes-=j;}return new F.init(r,j)},clone:function(){var o=D.clone.call(this);return o._data=this._data.clone(),o},_minBufferSize:0});g.Hasher=B.extend({cfg:D.extend(),init:function(o){this.cfg=this.cfg.extend(o),this.reset();},reset:function(){B.reset.call(this),this._doReset();},update:function(o){return this._append(o),this._process(),this},finalize:function(o){o&&this._append(o);var r=this._doFinalize();return r},blockSize:16,_createHelper:function(o){return function(r,s){return new o.init(s).finalize(r)}},_createHmacHelper:function(o){return function(r,s){return new a.HMAC.init(o,s).finalize(r)}}});var a=c.algo={};return c})(Math);return u});}),pu=At((e,t)=>{(function(u,n){typeof e=="object"?t.exports=e=n(lu()):typeof define=="function"&&define.amd?define(["./core"],n):n(u.CryptoJS);})(e,function(u){return (function(){var n=u,i=n.lib,l=i.WordArray,d=i.Hasher,C=n.algo,c=[],g=C.SHA1=d.extend({_doReset:function(){this._hash=new l.init([1732584193,4023233417,2562383102,271733878,3285377520]);},_doProcessBlock:function(D,F){for(var h=this._hash.words,m=h[0],y=h[1],A=h[2],B=h[3],a=h[4],o=0;o<80;o++){if(o<16)c[o]=D[F+o]|0;else {var r=c[o-3]^c[o-8]^c[o-14]^c[o-16];c[o]=r<<1|r>>>31;}var s=(m<<5|m>>>27)+a+c[o];o<20?s+=(y&A|~y&B)+1518500249:o<40?s+=(y^A^B)+1859775393:o<60?s+=(y&A|y&B|A&B)-1894007588:s+=(y^A^B)-899497514,a=B,B=A,A=y<<30|y>>>2,y=m,m=s;}h[0]=h[0]+m|0,h[1]=h[1]+y|0,h[2]=h[2]+A|0,h[3]=h[3]+B|0,h[4]=h[4]+a|0;},_doFinalize:function(){var D=this._data,F=D.words,h=this._nDataBytes*8,m=D.sigBytes*8;return F[m>>>5]|=128<<24-m%32,F[(m+64>>>9<<4)+14]=Math.floor(h/4294967296),F[(m+64>>>9<<4)+15]=h,D.sigBytes=F.length*4,this._process(),this._hash},clone:function(){var D=d.clone.call(this);return D._hash=this._hash.clone(),D}});n.SHA1=d._createHelper(g),n.HmacSHA1=d._createHmacHelper(g);})(),u.SHA1});}),fe;(e=>(e.log=(t,...u)=>console.log(`[Pixi\u2019VN Json] ${t}`,...u),e.warn=(t,...u)=>console.warn(`[Pixi\u2019VN Json] ${t}`,...u),e.error=(t,...u)=>console.error(`[Pixi\u2019VN Json] ${t}`,...u),e.info=(t,...u)=>console.info(`[Pixi\u2019VN Json] ${t}`,...u)))(fe||(fe={}));function cu(e){let t="";return e.values.forEach(u=>{if(typeof u=="string")t+=u;else {let n=x.getLogichValue(u);t+=`${n}`;}}),t}async function Et(e,t){let u=x.getLogichValue(e);if(u)switch(u.type){case "sound":x.soundOperation(u);break;case "assets":case "bundle":await x.loadAssets(u);break;case "image":await x.imageOperation(u);break;case "video":await x.videoOperation(u);break;case "imagecontainer":await x.imageContainerOperation(u);break;case "text":await x.textOperation(u);break;case "canvaselement":await x.canvasElementOperation(u);break;case "value":x.setStorageValue(u);break;case "operationtoconvert":if(t){let n=cu(u),i=await t(n);i&&await Et(i,t);}break;case "input":case "dialogue":x.narrationOperation(u);break;case "shake":await x.effectOperation(u);break;case "animate":case "animate-sequence":x.animateOperation(u);break}}function Du(e){let t=x.getLogichValue(e);t&&t.type==="value"&&t.storageOperationType==="set"&&(t.storageType==="storage"||t.storageType==="tempstorage")&&x.setInitialStorageValue(t);}async function qe(e,t={}){if(!Array.isArray(e))if(typeof e=="object"||typeof e=="string")e=[e];else {fe.error("Error parsing imported Pixi'VN JSON: data is not an object");return}let u=e.map(async i=>{if(typeof i=="string")try{i=JSON.parse(i);}catch(l){fe.error("Error parsing imported Pixi'VN JSON",l),i={};}return i}),n=(await Promise.all(u)).map(async i=>{let l=[];if(i.initialOperations)for(let d of i.initialOperations)Du(d);if(i.labels){let d=i.labels;for(let C in d)try{let c=d[C],g=new gu(C,c,void 0,t);RegisteredLabels.add(g);}catch(c){fe.error(`Error creating JSON label ${C}`,c);}}return Promise.all(l)});await Promise.all(n);}var fu=su(pu()),Ct="___param___",gu=class extends LabelAbstract{constructor(e,t,u,n={}){u||(u={}),u.onLoadingLabel=async()=>{for(let i of t){let l;if(typeof i=="function"?l=i():l=i,l=x.getConditionalStep(l),l.operations)try{let d=l.operations.map(C=>x.loadAssets(C));await Promise.all(d);}catch(d){fe.error("The operation in the onLoadingLabel function of the label has an error:",d);}}},super(e,u),We(this,"_steps"),We(this,"operationStringConvert"),We(this,"skipEmptyDialogs",false),this._steps=t,this.operationStringConvert=n.operationStringConvert,this.skipEmptyDialogs=n.skipEmptyDialogs||false;}get steps(){return this._steps.map(e=>this.stepConverter(e))}get stepCount(){return this._steps.length}getStepById(e){if(e<0||e>=this._steps.length)return;let t=this._steps[e];return this.stepConverter(t)}getStepSha(e){if(e<0||e>=this.steps.length)return;let t=this._steps[e];return (0, fu.default)(t.toString().toLocaleLowerCase()).toString()}getDialogueText(e){let t="";if(Array.isArray(e)){let u=[];e.forEach(n=>{if(typeof n=="string")u.push(n);else if(n&&typeof n=="object"){let i=x.getLogichValue(n);i?(i&&!Array.isArray(i)&&typeof i=="object"&&(i=x.getLogichValue(i)||""),Array.isArray(i)?u=u.map(l=>`${l}`).concat(i):u.push(`${i}`)):u.push(`${n}`);}else u.push(`${n}`);}),t=u;}else {let u=x.getLogichValue(e);u&&!Array.isArray(u)&&typeof u=="object"&&(u=x.getLogichValue(u)),u&&Array.isArray(u)?t=u.map(n=>`${n}`):t=`${u}`;}return t}getDialogue(e){if(e==null)return;let t=x.getLogichValue(e);return t==null?`${t}`:typeof t=="object"&&"character"in t&&"text"in t?{character:t.character,text:I.t(this.getDialogueText(t.text))}:I.t(this.getDialogueText(t))}getChoices(e){return x.getLogichValue(e)?.map(t=>x.getLogichValue(t)).filter(t=>t!==void 0)}stepConverter(e){return async t=>{let u=typeof e=="function"?e():e;u=createExportableElement(u),u=x.getConditionalStep(u);let n=this.operationStringConvert?h=>this.operationStringConvert(h,u,t):void 0,{operations:i=[]}=u;for(let h of i)await Et(h,n);let{labelToOpen:l=[]}=u,d=this.getChoices(u.choices),C=x.getLogichValue(u.glueEnabled),c=this.getDialogue(u.dialogue),g=[];Array.isArray(l)||(l=[l]),l.forEach(h=>{let m=x.getLogichValue(h);m&&g.push(m);});let D=x.getLogichValue(u.goNextStep),F=x.getLogichValue(u.end);if(d){let h=d.map(m=>{let y="";if(Array.isArray(m.text)){let A=[];m.text.forEach(B=>{if(typeof B=="string")A.push(I.t(B));else if(B&&typeof B=="object"){let a=x.getLogichValue(B);a&&!Array.isArray(a)&&typeof a=="object"&&(a=x.getLogichValue(a)||""),a&&(Array.isArray(a)?A=A.concat(I.t(a)):A.push(I.t(a)));}}),y=A;}else typeof m.text=="string"&&(y=I.t(m.text));return {label:m.label,text:y,props:m.props,type:m.type,oneTime:m.oneTime,onlyHaveNoChoice:m.onlyHaveNoChoice,autoSelect:m.autoSelect}});narration.choices=h;}else narration.choices=void 0;c!==void 0&&(narration.dialogue=c,this.skipEmptyDialogs&&typeof c=="string"&&(c===""||RegExp(/^\s+$/).test(c))&&(D=true)),C?narration.dialogGlue=true:C===false&&(narration.dialogGlue=false);for(let h of g){let m=h.label;typeof m=="object"&&(m=x.getLogichValue(m)||"");let y=h.params?.map(A=>x.getLogichValue(A));t={...t,...h.props},h.type==="jump"?(narration.openedLabels.length>0&&narration.closeCurrentLabel(),storage.setTempVariable(`${Ct}${narration.openedLabels.length}`,y),await narration.call(m,t)):(storage.setTempVariable(`${Ct}${narration.openedLabels.length}`,y),await narration.call(m,t));}F==="game_end"?(narration.closeAllLabels(),await narration.continue(t,{runNow:true})):F==="label_end"&&narration.closeCurrentLabel(),D&&await narration.continue(t,{runNow:true});}}};var Ue="___param___";async function ku(e){let t=x.getLogichValue(e);if(t)switch(t.type){case "assets":switch(t.operationType){case "load":await Assets.load(t.aliases);break;case "lazyload":Assets.backgroundLoad(t.aliases);break}break;case "bundle":switch(t.operationType){case "load":await Assets.loadBundle(t.aliases);break;case "lazyload":Assets.backgroundLoadBundle(t.aliases);break}break}}var W;(e=>(e.log=(t,...u)=>console.log(`[Pixi\u2019VN Json] ${t}`,...u),e.warn=(t,...u)=>console.warn(`[Pixi\u2019VN Json] ${t}`,...u),e.error=(t,...u)=>console.error(`[Pixi\u2019VN Json] ${t}`,...u),e.info=(t,...u)=>console.info(`[Pixi\u2019VN Json] ${t}`,...u)))(W||(W={}));async function we(e,t,u){switch(u.type){case "fade":await showWithFade(t.alias,e,u.props,u.priority);break;case "dissolve":await showWithDissolve(t.alias,e,u.props,u.priority);break;case "movein":case "moveout":await moveIn(t.alias,e,u.props,u.priority);break;case "zoomin":case "zoomout":await zoomIn(t.alias,e,u.props,u.priority);break;case "pushin":case "pushout":await pushIn(t.alias,e,u.props,u.priority);break}}function Fe(e){if(e.transition)switch(e.transition.type){case "fade":removeWithFade(e.alias,e.transition.props,e.transition.priority);break;case "dissolve":removeWithDissolve(e.alias,e.transition.props,e.transition.priority);break;case "movein":case "moveout":moveOut(e.alias,e.transition.props,e.transition.priority);break;case "zoomin":case "zoomout":zoomOut(e.alias,e.transition.props,e.transition.priority);break;case "pushin":case "pushout":pushOut(e.alias,e.transition.props,e.transition.priority);break}else canvas.remove(e.alias);}async function Lu(e){switch(e.operationType){case "show":if(e.transition){let u=new ImageSprite(e.props,e.url||e.alias);await we(u,e,e.transition);}else await showImage(e.alias,e.url,e.props);break;case "edit":let t=canvas.find(e.alias);t?e.props&&await t.setMemory({...t.memory,...e.props}):W.error(`Image with alias ${e.alias} not found.`);break;case "remove":Fe(e);break}}async function _u(e){switch(e.operationType){case "show":if(e.transition){let i=new VideoSprite(e.props,e.url||e.alias);await we(i,e,e.transition);}else await showVideo(e.alias,e.url,e.props);break;case "edit":let t=canvas.find(e.alias);t?e.props&&await t.setMemory({...t.memory,...e.props}):W.error(`Video with alias ${e.alias} not found.`);break;case "remove":Fe(e);break;case "pause":let u=canvas.find(e.alias);u?u.paused=true:W.error(`Video with alias ${e.alias} not found.`);break;case "resume":let n=canvas.find(e.alias);n?n.paused=false:W.error(`Video with alias ${e.alias} not found.`);break}}async function Ru(e){switch(e.operationType){case "show":if(e.transition){let u=new ImageContainer(e.props,e.urls);await we(u,e,e.transition);}else await showImageContainer(e.alias,e.urls,e.props);break;case "edit":let t=canvas.find(e.alias);t?e.props&&await t.setMemory({...t.memory,...e.props}):W.error(`ImageContainer with alias ${e.alias} not found.`);break;case "remove":Fe(e);break}}async function ju(e){switch(e.operationType){case "show":if(e.props=e.props||{},e.props.text=I.t(e.text),e.transition){let u=new Text(e.props);await we(u,e,e.transition);}else showText(e.alias,e.text,e.props);break;case "edit":let t=canvas.find(e.alias);t?e.props&&await t.setMemory({...t.memory,...e.props}):W.error(`Text with alias ${e.alias} not found.`);break;case "remove":Fe(e);break}}async function Iu(e){switch(e.operationType){case "edit":try{let t=canvas.find(e.alias);t?e.props&&(t.memory={...t.memory,...e.props}):W.error(`Canvas Element with alias ${e.alias} not found.`);}catch(t){W.error(`There was an error while trying to edit the canvas element with alias ${e.alias}.`,t);}break;case "remove":Fe(e);break}}async function $u(e){e.type==="shake"&&await shakeEffect(e.alias,e.props,e.priority);}function Hu(e){switch(e.type){case "animate":canvas.animate(e.alias,e.keyframes,e.options,e.priority);break;case "animate-sequence":canvas.animate(e.alias,e.sequence,e.options,e.priority);break}}function zu(e){switch(e.type){case "input":narration.requestInput({type:e.valueType},e.defaultValue);break;case "dialogue":narration.dialogue=void 0;break}}function Mu(e){switch(e.operationType){case "play":e.url?sound.play(e.alias,e.url,e.props):sound.play(e.alias,e.props);break;case "stop":sound.stop(e.alias);break;case "pause":switch(e.type){case "sound":sound.pause(e.alias);break;case "channel":sound.findChannel(e.alias).pauseAll();break;case "all":sound.pauseAll();break}break;case "resume":switch(e.type){case "sound":sound.resume(e.alias);break;case "channel":sound.findChannel(e.alias).resumeAll();break;case "all":sound.resumeAll();break}break;case "edit":Object.entries(e.props).forEach(([t,u])=>{let n=sound.find(e.alias);n&&n.set(t,u);});break}}function Wu(e){let t=x.getLogichValue(e.value),u;switch(t&&typeof t=="object"&&"type"in t?u=x.getLogichValue(t):u=t,e.storageType){case "flagStorage":storage.setFlag(e.key,e.value);break;case "storage":storage.set(e.key,u);break;case "tempstorage":storage.setTempVariable(e.key,u);break;case "params":let n=storage.get(`${Ue}${narration.openedLabels.length-1}`)||[];n&&n.length-1>=e.key&&(n[e.key]=u),storage.setTempVariable(`${Ue}${narration.openedLabels.length-1}`,n);break}}function Gu(e){let t=x.getLogichValue(e.value),u;switch(t&&typeof t=="object"&&"type"in t?u=x.getLogichValue(t):u=t,e.storageType){case "storage":case "tempstorage":storage.default={[e.key]:u};break}}function ve(e){let t=Ft(e);if(t&&typeof t=="object"&&"type"in t)switch(t.type){case "value":return Uu(t);case "arithmetic":case "arithmeticsingle":return qu(t);case "compare":case "valueCondition":case "union":return Yu(t)}return t}function qu(e){let t=x.getLogichValue(e.leftValue);switch(e.type){case "arithmetic":let u=x.getLogichValue(e.rightValue);switch(e.operator){case "*":return t*u;case "/":return t/u;case "+":return t+u;case "-":return t-u;case "%":return t%u;case "POW":return Math.pow(t,u);case "RANDOM":return narration.getRandomNumber(t,u)}case "arithmeticsingle":switch(e.operator){case "INT":return parseInt(t);case "FLOOR":return Math.floor(t);case "FLOAT":return parseFloat(t)}break}}function Uu(e){if(e&&typeof e=="object"&&"type"in e&&e.type==="value"&&e.storageOperationType==="get")switch(e.storageType){case "storage":case "tempstorage":return e.key==="_input_value_"?narration.inputValue:storage.get(e.key);case "flagStorage":return storage.getFlag(e.key);case "label":return narration.getTimesLabelOpened(e.label);case "choice":return narration.getTimesChoiceMade(e.index);case "logic":return x.getLogichValue(e.operation);case "params":let t=storage.get(`${Ue}${narration.openedLabels.length-1}`)||[];if(t&&t.length>e.key)return t[e.key];W.warn("getValue params not found");return}return e}function Yu(e){if(!e)return false;if(typeof e!="object"||!("type"in e))return !!e;switch(e.type){case "compare":let t=x.getLogichValue(e.leftValue),u=x.getLogichValue(e.rightValue);switch(e.operator){case "==":return t===u;case "!=":return t!==u;case "<":return t<u;case "<=":return t<=u;case ">":return t>u;case ">=":return t>=u;case "CONTAINS":return t.toString().includes(u.toString())}break;case "valueCondition":return !!x.getLogichValue(e.value);case "union":return Qu(e)}return !!e}function Qu(e){if(e.unionType==="not")return !ve(e.condition);let t=e.unionType==="and";for(let u=0;u<e.conditions.length;u++)if(t=x.getLogichValue(e.conditions[u])||false,e.unionType==="and"){if(!t)return false}else if(t)return true;return t}function Xu(e,t){return Math.floor(Math.random()*(t-e+1)+e)}function Ft(e){if(Array.isArray(e)||!e)return e;if(e&&typeof e=="object"&&"type"in e)switch(e.type){case "resulttocombine":return Zu(e);case "ifelse":return x.getLogichValue(e.condition)?x.getLogichValue(e.then):x.getLogichValue(e.else);case "stepswitch":let t=x.getLogichValue(e.elements)||[];if(t.length===0){W.error("getValueFromConditionalStatements elements.length === 0");return}switch(e.choiceType){case "random":let u=Xu(0,t.length-1);return x.getLogichValue(t[u]);case "loop":let n=NarrationManagerStatic.getCurrentStepTimesCounter(e.nestedId)-1;return n>t.length-1?(n=n%t.length,x.getLogichValue(t[n])):x.getLogichValue(t[n]);case "sequential":let i,l=NarrationManagerStatic.getCurrentStepTimesCounter(e.nestedId)-1;return e.end=="lastItem"&&(i=x.getLogichValue(t[t.length-1])),l>t.length-1?i:x.getLogichValue(t[l]);case "sequentialrandom":let d=NarrationManagerStatic.getRandomNumber(0,t.length-1,{nestedId:e.nestedId,onceOnly:true});if(d==null&&e.end=="lastItem"){let C=NarrationManagerStatic.getCurrentStepTimesCounterData(e.nestedId);if(!C||!C?.usedRandomNumbers){W.warn("getValueFromConditionalStatements randomIndexWhitExclude == undefined");return}let c=C.usedRandomNumbers[`0-${t.length-1}`];return x.getLogichValue(t[c[c.length-1]])}if(d==null){W.warn("getValueFromConditionalStatements randomIndexWhitExclude == undefined");return}return x.getLogichValue(t[d])}}return e}function Ye(e){if(e.conditionalStep){let t=createExportableElement(x.getLogichValue(e.conditionalStep));if(t?.glueEnabled===void 0&&delete t?.glueEnabled,t?.goNextStep===void 0&&delete t?.goNextStep,t?.end===void 0&&delete t?.end,t?.choices===void 0&&delete t?.choices,t?.dialogue===void 0&&delete t?.dialogue,t?.labelToOpen===void 0&&delete t?.labelToOpen,t?.operations===void 0&&delete t?.operations,t){let u={...e,conditionalStep:void 0,...t};return Ye(u)}else narration.dialogGlue&&(narration.dialogGlue=false);}return e}function Zu(e){let t=e.firstItem,u=[];e.secondConditionalItem?.forEach(i=>{if(Array.isArray(i))i.forEach(l=>{let d=x.getLogichValue(l);u.push(d);});else {let l=x.getLogichValue(i);u.push(l);}});let n=t?[t,...u]:u;if(n.length===0){W.warn("combinateResult toCheck.length === 0");return}if(typeof n[0]=="string")return I.t(n);if(typeof n[0]=="object"){let i=n,l,d=false,C=i.map((a,o)=>{a=Ye(a);let r=x.getLogichValue(a.dialogue)||"";return o===0?(l=x.getLogichValue(a.glueEnabled)||false,r):(typeof r=="object"&&"text"in r&&(r=r.character+": "+r.text),l===false&&d&&(r=`
|
|
1
|
+
import {a,c,b as b$1,e,d,f as f$1}from'./chunk-M7O5Q75X.mjs';import {PixiError,createExportableElement}from'@drincs/pixi-vn';import {RegisteredLabels,narration,NarrationManagerStatic,LabelAbstract}from'@drincs/pixi-vn/narration';import {storage}from'@drincs/pixi-vn/storage';import {canvas,VideoSprite,showVideo,Assets,Text,showText,ImageSprite,showImage,ImageContainer,showImageContainer,shakeEffect,pushOut,zoomOut,moveOut,removeWithDissolve,removeWithFade,pushIn,zoomIn,moveIn,showWithDissolve,showWithFade}from'@drincs/pixi-vn/canvas';import {sound}from'@drincs/pixi-vn/sound';import {RegisteredCharacters}from'@drincs/pixi-vn/characters';var Gt=Object.defineProperty,qt=(e,t,u)=>t in e?Gt(e,t,{enumerable:true,configurable:true,writable:true,value:u}):e[t]=u,U=(e,t,u)=>qt(e,typeof t!="symbol"?t+"":t,u),z;(e=>(e.log=(t,...u)=>console.log(`[Pixi\u2019VN Json] ${t}`,...u),e.warn=(t,...u)=>console.warn(`[Pixi\u2019VN Json] ${t}`,...u),e.error=(t,...u)=>console.error(`[Pixi\u2019VN Json] ${t}`,...u),e.info=(t,...u)=>console.info(`[Pixi\u2019VN Json] ${t}`,...u)))(z||(z={}));var H=class O{static init(t){t.loadAssets&&(O._loadAssets=t.loadAssets),t.soundOperation&&(O._soundOperation=t.soundOperation),t.imageOperation&&(O._imageOperation=t.imageOperation),t.videoOperation&&(O._videoOperation=t.videoOperation),t.imageContainerOperation&&(O._imageContainerOperation=t.imageContainerOperation),t.textOperation&&(O._textOperation=t.textOperation),t.canvasElementOperation&&(O._canvasElementOperation=t.canvasElementOperation),t.setStorageValue&&(O._setStorageValue=t.setStorageValue),t.setInitialStorageValue&&(O._setInitialStorageValue=t.setInitialStorageValue),t.narrationOperation&&(O._narrationOperation=t.narrationOperation),t.effectOperation&&(O._effectOperation=t.effectOperation),t.animateOperation&&(O._animateOperation=t.animateOperation),t.getLogichValue&&(O._getLogichValue=t.getLogichValue),t.getConditionalStep&&(O._getConditionalStep=t.getConditionalStep);}static get loadAssets(){return O._loadAssets}static get soundOperation(){return O._soundOperation}static get imageOperation(){return O._imageOperation}static get videoOperation(){return O._videoOperation}static get textOperation(){return O._textOperation}static get imageContainerOperation(){return O._imageContainerOperation}static get canvasElementOperation(){return O._canvasElementOperation}static get setStorageValue(){return O._setStorageValue}static get setInitialStorageValue(){return O._setInitialStorageValue}static get narrationOperation(){return O._narrationOperation}static get effectOperation(){return O._effectOperation}static get animateOperation(){return O._animateOperation}static get getLogichValue(){return O._getLogichValue}static get getConditionalStep(){return O._getConditionalStep}};U(H,"_loadAssets",()=>{}),U(H,"_soundOperation",()=>{throw z.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")}),U(H,"_imageOperation",()=>{throw z.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")}),U(H,"_videoOperation",()=>{throw z.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")}),U(H,"_imageContainerOperation",()=>{throw z.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")}),U(H,"_textOperation",()=>{throw z.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")}),U(H,"_canvasElementOperation",()=>{throw z.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")}),U(H,"_setStorageValue",()=>{throw z.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")}),U(H,"_setInitialStorageValue",()=>{throw z.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")}),U(H,"_narrationOperation",()=>{throw z.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")}),U(H,"_effectOperation",()=>{throw z.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")}),U(H,"_animateOperation",()=>{throw z.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")}),U(H,"_getLogichValue",()=>{throw z.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")}),U(H,"_getConditionalStep",()=>{throw z.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")});var x=H;var Ut=Object.defineProperty,Yt=(e,t,u)=>t in e?Ut(e,t,{enumerable:true,configurable:true,writable:true,value:u}):e[t]=u,Me=(e,t,u)=>Yt(e,typeof t!="symbol"?t+"":t,u);function Qt(e){let t="";return e.values.forEach(u=>{if(typeof u=="string")t+=u;else {let n=x.getLogichValue(u);t+=`${n}`;}}),t}var Te=class V{static t(t){return Array.isArray(t)?t.map(u=>V.translate(`${u}`)):V.translate(`${t}`)}static set beforeToTranslate(t){V._beforeToTranslate=t;}static set translate(t){V._translate=t;}static get translate(){return t=>{let u=t;return V._beforeToTranslate&&(u=V._beforeToTranslate(u)),u=V._translate(u),V._afterToTranslate&&(u=V._afterToTranslate(u)),u}}static set afterToTranslate(t){V._afterToTranslate=t;}static addKey(t,u,n){let i=n.defaultValue||"empty_string";typeof u=="string"&&(u=[u]),Array.isArray(u)&&u.forEach(l=>{t[l]===void 0&&(i==="empty_string"?t[l]="":i==="copy_key"&&(V._beforeToTranslate?t[l]=V._beforeToTranslate(l):t[l]=l));});}static getConditionalsThenElse(t,u=[]){if(typeof t=="object"&&t&&"type"in t)if(t.type==="ifelse")t.then&&V.getConditionalsThenElse(t.then,u),t.else&&V.getConditionalsThenElse(t.else,u);else if(t.type==="stepswitch"){if(t.elements)if(Array.isArray(t.elements))t.elements.forEach(n=>{V.getConditionalsThenElse(n,u);});else if(t.elements.type==="ifelse"){let n=[];V.getConditionalsThenElse(t.elements,n),n.forEach(i=>{u.push(...i);});}else if(t.elements.type==="stepswitch"){let n=[];V.getConditionalsThenElse(t.elements,n),n.forEach(i=>{u.push(...i);});}else V.getConditionalsThenElse(t.elements,u);}else t.type==="resulttocombine"?(t.firstItem&&V.getConditionalsThenElse(t.firstItem,u),t.secondConditionalItem&&t.secondConditionalItem.forEach(n=>{V.getConditionalsThenElse(n,u);})):u.push(t);else t&&u.push(t);return u}static async generateJsonTranslation(t,u={},n={}){let{defaultValue:i="copy_key",operationStringConvert:l}=n,d=t.map(async C=>{if(C.choices){let c=[];Array.isArray(C.choices)?c=[C.choices]:c=V.getConditionalsThenElse(C.choices),c.forEach(g=>g.forEach(D=>{if("type"in D){let F=[];D.type==="ifelse"||D.type==="stepswitch"?V.getConditionalsThenElse(D,F):F=[D],F.map(h=>V.getConditionalsThenElse(h.text)).forEach(h=>{Array.isArray(h)&&h.forEach(m=>{Array.isArray(m)?m.forEach(y=>{typeof y=="string"?V.addKey(u,y,{defaultValue:i}):V.getConditionalsThenElse(y).forEach(A=>{Array.isArray(A)?A.forEach(B=>{typeof B=="string"&&V.addKey(u,B,{defaultValue:i});}):typeof A=="string"&&V.addKey(u,A,{defaultValue:i});});}):typeof m=="string"&&V.addKey(u,m,{defaultValue:i});});});}}));}if(C.dialogue){let c=[];Array.isArray(C.dialogue)?c=[C.dialogue]:c=V.getConditionalsThenElse(C.dialogue),c.forEach(g=>{if(typeof g=="string")V.addKey(u,g,{defaultValue:i});else if("text"in g){let D=V.getConditionalsThenElse(g.text);typeof D=="string"&&(D=[D]),D.forEach(F=>{typeof F=="string"?V.addKey(u,F,{defaultValue:i}):V.getConditionalsThenElse(F).forEach(h=>{typeof h=="string"?V.addKey(u,h,{defaultValue:i}):Array.isArray(h)&&h.forEach(m=>{typeof m=="string"?V.addKey(u,m,{defaultValue:i}):V.getConditionalsThenElse(m).forEach(y=>{typeof y=="string"&&V.addKey(u,y,{defaultValue:i});});});});});}});}if(C.operations)for(let c of C.operations){if(c.type==="operationtoconvert"&&l){let g=Qt(c),D=await l(g,C,{});if(!D)return;c=D;}c.type==="text"&&c.operationType==="show"&&V.addKey(u,c.text,{defaultValue:i});}C.conditionalStep&&V.getConditionalsThenElse(C.conditionalStep).forEach(c=>{Array.isArray(c)?V.generateJsonTranslation(c,u,n):V.generateJsonTranslation([c],u,n);});});return await Promise.all(d),u}};Me(Te,"_beforeToTranslate"),Me(Te,"_translate",e=>e),Me(Te,"_afterToTranslate");var Xt=Te,I=Xt;var tu=Object.create,Ge=Object.defineProperty,uu=Object.getOwnPropertyDescriptor,nu=Object.getOwnPropertyNames,ru=Object.getPrototypeOf,iu=Object.prototype.hasOwnProperty,ou=(e,t,u)=>t in e?Ge(e,t,{enumerable:true,configurable:true,writable:true,value:u}):e[t]=u,dt=(e=>typeof a<"u"?a:typeof Proxy<"u"?new Proxy(e,{get:(t,u)=>(typeof a<"u"?a:t)[u]}):e)(function(e){if(typeof a<"u")return a.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')}),At=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),au=(e,t,u,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of nu(t))!iu.call(e,i)&&i!==u&&Ge(e,i,{get:()=>t[i],enumerable:!(n=uu(t,i))||n.enumerable});return e},su=(e,t,u)=>(u=e!=null?tu(ru(e)):{},au(Ge(u,"default",{value:e,enumerable:true}),e)),We=(e,t,u)=>ou(e,typeof t!="symbol"?t+"":t,u),lu=At((e,t)=>{(function(u,n){typeof e=="object"?t.exports=e=n():typeof define=="function"&&define.amd?define([],n):u.CryptoJS=n();})(e,function(){var u=u||(function(n,i){var l;if(typeof window<"u"&&window.crypto&&(l=window.crypto),typeof self<"u"&&self.crypto&&(l=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(l=globalThis.crypto),!l&&typeof window<"u"&&window.msCrypto&&(l=window.msCrypto),!l&&typeof global<"u"&&global.crypto&&(l=global.crypto),!l&&typeof dt=="function")try{l=dt("crypto");}catch{}var d=function(){if(l){if(typeof l.getRandomValues=="function")try{return l.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof l.randomBytes=="function")try{return l.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},C=Object.create||(function(){function o(){}return function(r){var s;return o.prototype=r,s=new o,o.prototype=null,s}})(),c={},g=c.lib={},D=g.Base=(function(){return {extend:function(o){var r=C(this);return o&&r.mixIn(o),(!r.hasOwnProperty("init")||this.init===r.init)&&(r.init=function(){r.$super.init.apply(this,arguments);}),r.init.prototype=r,r.$super=this,r},create:function(){var o=this.extend();return o.init.apply(o,arguments),o},init:function(){},mixIn:function(o){for(var r in o)o.hasOwnProperty(r)&&(this[r]=o[r]);o.hasOwnProperty("toString")&&(this.toString=o.toString);},clone:function(){return this.init.prototype.extend(this)}}})(),F=g.WordArray=D.extend({init:function(o,r){o=this.words=o||[],r!=i?this.sigBytes=r:this.sigBytes=o.length*4;},toString:function(o){return (o||m).stringify(this)},concat:function(o){var r=this.words,s=o.words,p=this.sigBytes,E=o.sigBytes;if(this.clamp(),p%4)for(var T=0;T<E;T++){var _=s[T>>>2]>>>24-T%4*8&255;r[p+T>>>2]|=_<<24-(p+T)%4*8;}else for(var w=0;w<E;w+=4)r[p+w>>>2]=s[w>>>2];return this.sigBytes+=E,this},clamp:function(){var o=this.words,r=this.sigBytes;o[r>>>2]&=4294967295<<32-r%4*8,o.length=n.ceil(r/4);},clone:function(){var o=D.clone.call(this);return o.words=this.words.slice(0),o},random:function(o){for(var r=[],s=0;s<o;s+=4)r.push(d());return new F.init(r,o)}}),h=c.enc={},m=h.Hex={stringify:function(o){for(var r=o.words,s=o.sigBytes,p=[],E=0;E<s;E++){var T=r[E>>>2]>>>24-E%4*8&255;p.push((T>>>4).toString(16)),p.push((T&15).toString(16));}return p.join("")},parse:function(o){for(var r=o.length,s=[],p=0;p<r;p+=2)s[p>>>3]|=parseInt(o.substr(p,2),16)<<24-p%8*4;return new F.init(s,r/2)}},y=h.Latin1={stringify:function(o){for(var r=o.words,s=o.sigBytes,p=[],E=0;E<s;E++){var T=r[E>>>2]>>>24-E%4*8&255;p.push(String.fromCharCode(T));}return p.join("")},parse:function(o){for(var r=o.length,s=[],p=0;p<r;p++)s[p>>>2]|=(o.charCodeAt(p)&255)<<24-p%4*8;return new F.init(s,r)}},A=h.Utf8={stringify:function(o){try{return decodeURIComponent(escape(y.stringify(o)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(o){return y.parse(unescape(encodeURIComponent(o)))}},B=g.BufferedBlockAlgorithm=D.extend({reset:function(){this._data=new F.init,this._nDataBytes=0;},_append:function(o){typeof o=="string"&&(o=A.parse(o)),this._data.concat(o),this._nDataBytes+=o.sigBytes;},_process:function(o){var r,s=this._data,p=s.words,E=s.sigBytes,T=this.blockSize,_=T*4,w=E/_;o?w=n.ceil(w):w=n.max((w|0)-this._minBufferSize,0);var J=w*T,j=n.min(J*4,E);if(J){for(var q=0;q<J;q+=T)this._doProcessBlock(p,q);r=p.splice(0,J),s.sigBytes-=j;}return new F.init(r,j)},clone:function(){var o=D.clone.call(this);return o._data=this._data.clone(),o},_minBufferSize:0});g.Hasher=B.extend({cfg:D.extend(),init:function(o){this.cfg=this.cfg.extend(o),this.reset();},reset:function(){B.reset.call(this),this._doReset();},update:function(o){return this._append(o),this._process(),this},finalize:function(o){o&&this._append(o);var r=this._doFinalize();return r},blockSize:16,_createHelper:function(o){return function(r,s){return new o.init(s).finalize(r)}},_createHmacHelper:function(o){return function(r,s){return new a.HMAC.init(o,s).finalize(r)}}});var a=c.algo={};return c})(Math);return u});}),pu=At((e,t)=>{(function(u,n){typeof e=="object"?t.exports=e=n(lu()):typeof define=="function"&&define.amd?define(["./core"],n):n(u.CryptoJS);})(e,function(u){return (function(){var n=u,i=n.lib,l=i.WordArray,d=i.Hasher,C=n.algo,c=[],g=C.SHA1=d.extend({_doReset:function(){this._hash=new l.init([1732584193,4023233417,2562383102,271733878,3285377520]);},_doProcessBlock:function(D,F){for(var h=this._hash.words,m=h[0],y=h[1],A=h[2],B=h[3],a=h[4],o=0;o<80;o++){if(o<16)c[o]=D[F+o]|0;else {var r=c[o-3]^c[o-8]^c[o-14]^c[o-16];c[o]=r<<1|r>>>31;}var s=(m<<5|m>>>27)+a+c[o];o<20?s+=(y&A|~y&B)+1518500249:o<40?s+=(y^A^B)+1859775393:o<60?s+=(y&A|y&B|A&B)-1894007588:s+=(y^A^B)-899497514,a=B,B=A,A=y<<30|y>>>2,y=m,m=s;}h[0]=h[0]+m|0,h[1]=h[1]+y|0,h[2]=h[2]+A|0,h[3]=h[3]+B|0,h[4]=h[4]+a|0;},_doFinalize:function(){var D=this._data,F=D.words,h=this._nDataBytes*8,m=D.sigBytes*8;return F[m>>>5]|=128<<24-m%32,F[(m+64>>>9<<4)+14]=Math.floor(h/4294967296),F[(m+64>>>9<<4)+15]=h,D.sigBytes=F.length*4,this._process(),this._hash},clone:function(){var D=d.clone.call(this);return D._hash=this._hash.clone(),D}});n.SHA1=d._createHelper(g),n.HmacSHA1=d._createHmacHelper(g);})(),u.SHA1});}),fe;(e=>(e.log=(t,...u)=>console.log(`[Pixi\u2019VN Json] ${t}`,...u),e.warn=(t,...u)=>console.warn(`[Pixi\u2019VN Json] ${t}`,...u),e.error=(t,...u)=>console.error(`[Pixi\u2019VN Json] ${t}`,...u),e.info=(t,...u)=>console.info(`[Pixi\u2019VN Json] ${t}`,...u)))(fe||(fe={}));function cu(e){let t="";return e.values.forEach(u=>{if(typeof u=="string")t+=u;else {let n=x.getLogichValue(u);t+=`${n}`;}}),t}async function Et(e,t){let u=x.getLogichValue(e);if(u)switch(u.type){case "sound":x.soundOperation(u);break;case "assets":case "bundle":await x.loadAssets(u);break;case "image":await x.imageOperation(u);break;case "video":await x.videoOperation(u);break;case "imagecontainer":await x.imageContainerOperation(u);break;case "text":await x.textOperation(u);break;case "canvaselement":await x.canvasElementOperation(u);break;case "value":x.setStorageValue(u);break;case "operationtoconvert":if(t){let n=cu(u),i=await t(n);i&&await Et(i,t);}break;case "input":case "dialogue":x.narrationOperation(u);break;case "shake":await x.effectOperation(u);break;case "animate":case "animate-sequence":x.animateOperation(u);break}}function Du(e){let t=x.getLogichValue(e);t&&t.type==="value"&&t.storageOperationType==="set"&&(t.storageType==="storage"||t.storageType==="tempstorage")&&x.setInitialStorageValue(t);}async function qe(e,t={}){if(!Array.isArray(e))if(typeof e=="object"||typeof e=="string")e=[e];else {fe.error("Error parsing imported Pixi'VN JSON: data is not an object");return}let u=e.map(async i=>{if(typeof i=="string")try{i=JSON.parse(i);}catch(l){fe.error("Error parsing imported Pixi'VN JSON",l),i={};}return i}),n=(await Promise.all(u)).map(async i=>{let l=[];if(i.initialOperations)for(let d of i.initialOperations)Du(d);if(i.labels){let d=i.labels;for(let C in d)try{let c=d[C],g=new gu(C,c,void 0,t);RegisteredLabels.add(g);}catch(c){fe.error(`Error creating JSON label ${C}`,c);}}return Promise.all(l)});await Promise.all(n);}var fu=su(pu()),Ct="___param___",gu=class extends LabelAbstract{constructor(e,t,u,n={}){u||(u={}),u.onLoadingLabel=async()=>{for(let i of t){let l;if(typeof i=="function"?l=i():l=i,l=x.getConditionalStep(l),l.operations)try{let d=l.operations.map(C=>x.loadAssets(C));await Promise.all(d);}catch(d){fe.error("The operation in the onLoadingLabel function of the label has an error:",d);}}},super(e,u),We(this,"_steps"),We(this,"operationStringConvert"),We(this,"skipEmptyDialogs",false),this._steps=t,this.operationStringConvert=n.operationStringConvert,this.skipEmptyDialogs=n.skipEmptyDialogs||false;}get steps(){return this._steps.map(e=>this.stepConverter(e))}get stepCount(){return this._steps.length}getStepById(e){if(e<0||e>=this._steps.length)return;let t=this._steps[e];return this.stepConverter(t)}getStepSha(e){if(e<0||e>=this.steps.length)return;let t=this._steps[e];return (0, fu.default)(t.toString().toLocaleLowerCase()).toString()}getDialogueText(e){let t="";if(Array.isArray(e)){let u=[];e.forEach(n=>{if(typeof n=="string")u.push(n);else if(n&&typeof n=="object"){let i=x.getLogichValue(n);i?(i&&!Array.isArray(i)&&typeof i=="object"&&(i=x.getLogichValue(i)||""),Array.isArray(i)?u=u.map(l=>`${l}`).concat(i):u.push(`${i}`)):u.push(`${n}`);}else u.push(`${n}`);}),t=u;}else {let u=x.getLogichValue(e);u&&!Array.isArray(u)&&typeof u=="object"&&(u=x.getLogichValue(u)),u&&Array.isArray(u)?t=u.map(n=>`${n}`):t=`${u}`;}return t}getDialogue(e){if(e==null)return;let t=x.getLogichValue(e);return t==null?`${t}`:typeof t=="object"&&"character"in t&&"text"in t?{character:t.character,text:I.t(this.getDialogueText(t.text))}:I.t(this.getDialogueText(t))}getChoices(e){return x.getLogichValue(e)?.map(t=>x.getLogichValue(t)).filter(t=>t!==void 0)}stepConverter(e){return async t=>{let u=typeof e=="function"?e():e;u=createExportableElement(u),u=x.getConditionalStep(u);let n=this.operationStringConvert?h=>this.operationStringConvert(h,u,t):void 0,{operations:i=[]}=u;for(let h of i)await Et(h,n);let{labelToOpen:l=[]}=u,d=this.getChoices(u.choices),C=x.getLogichValue(u.glueEnabled),c=this.getDialogue(u.dialogue),g=[];Array.isArray(l)||(l=[l]),l.forEach(h=>{let m=x.getLogichValue(h);m&&g.push(m);});let D=x.getLogichValue(u.goNextStep),F=x.getLogichValue(u.end);if(d){let h=d.map(m=>{let y="";if(Array.isArray(m.text)){let A=[];m.text.forEach(B=>{if(typeof B=="string")A.push(I.t(B));else if(B&&typeof B=="object"){let a=x.getLogichValue(B);a&&!Array.isArray(a)&&typeof a=="object"&&(a=x.getLogichValue(a)||""),a&&(Array.isArray(a)?A=A.concat(I.t(a)):A.push(I.t(a)));}}),y=A;}else typeof m.text=="string"&&(y=I.t(m.text));return {label:m.label,text:y,props:m.props,type:m.type,oneTime:m.oneTime,onlyHaveNoChoice:m.onlyHaveNoChoice,autoSelect:m.autoSelect}});narration.choices=h;}else narration.choices=void 0;c!==void 0&&(narration.dialogue=c,this.skipEmptyDialogs&&typeof c=="string"&&(c===""||RegExp(/^\s+$/).test(c))&&(D=true)),C?narration.dialogGlue=true:C===false&&(narration.dialogGlue=false);for(let h of g){let m=h.label;typeof m=="object"&&(m=x.getLogichValue(m)||"");let y=h.params?.map(A=>x.getLogichValue(A));t={...t,...h.props},h.type==="jump"?(narration.openedLabels.length>0&&narration.closeCurrentLabel(),storage.setTempVariable(`${Ct}${narration.openedLabels.length}`,y),await narration.call(m,t)):(storage.setTempVariable(`${Ct}${narration.openedLabels.length}`,y),await narration.call(m,t));}F==="game_end"?(narration.closeAllLabels(),await narration.continue(t,{runNow:true})):F==="label_end"&&narration.closeCurrentLabel(),D&&await narration.continue(t,{runNow:true});}}};var Ue="___param___";async function ku(e){let t=x.getLogichValue(e);if(t)switch(t.type){case "assets":switch(t.operationType){case "load":await Assets.load(t.aliases);break;case "lazyload":Assets.backgroundLoad(t.aliases);break}break;case "bundle":switch(t.operationType){case "load":await Assets.loadBundle(t.aliases);break;case "lazyload":Assets.backgroundLoadBundle(t.aliases);break}break}}var W;(e=>(e.log=(t,...u)=>console.log(`[Pixi\u2019VN Json] ${t}`,...u),e.warn=(t,...u)=>console.warn(`[Pixi\u2019VN Json] ${t}`,...u),e.error=(t,...u)=>console.error(`[Pixi\u2019VN Json] ${t}`,...u),e.info=(t,...u)=>console.info(`[Pixi\u2019VN Json] ${t}`,...u)))(W||(W={}));async function we(e,t,u){switch(u.type){case "fade":await showWithFade(t.alias,e,u.props,u.priority);break;case "dissolve":await showWithDissolve(t.alias,e,u.props,u.priority);break;case "movein":case "moveout":await moveIn(t.alias,e,u.props,u.priority);break;case "zoomin":case "zoomout":await zoomIn(t.alias,e,u.props,u.priority);break;case "pushin":case "pushout":await pushIn(t.alias,e,u.props,u.priority);break}}function Fe(e){if(e.transition)switch(e.transition.type){case "fade":removeWithFade(e.alias,e.transition.props,e.transition.priority);break;case "dissolve":removeWithDissolve(e.alias,e.transition.props,e.transition.priority);break;case "movein":case "moveout":moveOut(e.alias,e.transition.props,e.transition.priority);break;case "zoomin":case "zoomout":zoomOut(e.alias,e.transition.props,e.transition.priority);break;case "pushin":case "pushout":pushOut(e.alias,e.transition.props,e.transition.priority);break}else canvas.remove(e.alias);}async function Lu(e){switch(e.operationType){case "show":if(e.transition){let u=new ImageSprite(e.props,e.url||e.alias);await we(u,e,e.transition);}else await showImage(e.alias,e.url,e.props);break;case "edit":let t=canvas.find(e.alias);t?e.props&&await t.setMemory({...t.memory,...e.props}):W.error(`Image with alias ${e.alias} not found.`);break;case "remove":Fe(e);break}}async function _u(e){switch(e.operationType){case "show":if(e.transition){let i=new VideoSprite(e.props,e.url||e.alias);await we(i,e,e.transition);}else await showVideo(e.alias,e.url,e.props);break;case "edit":let t=canvas.find(e.alias);t?e.props&&await t.setMemory({...t.memory,...e.props}):W.error(`Video with alias ${e.alias} not found.`);break;case "remove":Fe(e);break;case "pause":let u=canvas.find(e.alias);u?u.paused=true:W.error(`Video with alias ${e.alias} not found.`);break;case "resume":let n=canvas.find(e.alias);n?n.paused=false:W.error(`Video with alias ${e.alias} not found.`);break}}async function Ru(e){switch(e.operationType){case "show":if(e.transition){let u=new ImageContainer(e.props,e.urls);await we(u,e,e.transition);}else await showImageContainer(e.alias,e.urls,e.props);break;case "edit":let t=canvas.find(e.alias);t?e.props&&await t.setMemory({...t.memory,...e.props}):W.error(`ImageContainer with alias ${e.alias} not found.`);break;case "remove":Fe(e);break}}async function ju(e){switch(e.operationType){case "show":if(e.props=e.props||{},e.props.text=I.t(e.text),e.transition){let u=new Text(e.props);await we(u,e,e.transition);}else showText(e.alias,e.text,e.props);break;case "edit":let t=canvas.find(e.alias);t?e.props&&await t.setMemory({...t.memory,...e.props}):W.error(`Text with alias ${e.alias} not found.`);break;case "remove":Fe(e);break}}async function Iu(e){switch(e.operationType){case "edit":try{let t=canvas.find(e.alias);t?e.props&&(t.memory={...t.memory,...e.props}):W.error(`Canvas Element with alias ${e.alias} not found.`);}catch(t){W.error(`There was an error while trying to edit the canvas element with alias ${e.alias}.`,t);}break;case "remove":Fe(e);break}}async function $u(e){e.type==="shake"&&await shakeEffect(e.alias,e.props,e.priority);}function Hu(e){switch(e.type){case "animate":canvas.animate(e.alias,e.keyframes,e.options,e.priority);break;case "animate-sequence":canvas.animate(e.alias,e.sequence,e.options,e.priority);break}}function zu(e){switch(e.type){case "input":narration.requestInput({type:e.valueType},e.defaultValue);break;case "dialogue":narration.dialogue=void 0;break}}function Mu(e){switch(e.operationType){case "play":e.url?sound.play(e.alias,e.url,e.props):sound.play(e.alias,e.props);break;case "stop":switch(e.type){case "sound":sound.stop(e.alias);break;case "all":sound.stopAll();break}break;case "pause":switch(e.type){case "sound":sound.pause(e.alias);break;case "channel":sound.findChannel(e.alias).pauseAll();break;case "all":sound.pauseAll();break}break;case "resume":switch(e.type){case "sound":sound.resume(e.alias);break;case "channel":sound.findChannel(e.alias).resumeAll();break;case "all":sound.resumeAll();break}break;case "edit":Object.entries(e.props).forEach(([t,u])=>{let n=sound.find(e.alias);n&&n.set(t,u);});break}}function Wu(e){let t=x.getLogichValue(e.value),u;switch(t&&typeof t=="object"&&"type"in t?u=x.getLogichValue(t):u=t,e.storageType){case "flagStorage":storage.setFlag(e.key,e.value);break;case "storage":storage.set(e.key,u);break;case "tempstorage":storage.setTempVariable(e.key,u);break;case "params":let n=storage.get(`${Ue}${narration.openedLabels.length-1}`)||[];n&&n.length-1>=e.key&&(n[e.key]=u),storage.setTempVariable(`${Ue}${narration.openedLabels.length-1}`,n);break}}function Gu(e){let t=x.getLogichValue(e.value),u;switch(t&&typeof t=="object"&&"type"in t?u=x.getLogichValue(t):u=t,e.storageType){case "storage":case "tempstorage":storage.default={[e.key]:u};break}}function ve(e){let t=Ft(e);if(t&&typeof t=="object"&&"type"in t)switch(t.type){case "value":return Uu(t);case "arithmetic":case "arithmeticsingle":return qu(t);case "compare":case "valueCondition":case "union":return Yu(t)}return t}function qu(e){let t=x.getLogichValue(e.leftValue);switch(e.type){case "arithmetic":let u=x.getLogichValue(e.rightValue);switch(e.operator){case "*":return t*u;case "/":return t/u;case "+":return t+u;case "-":return t-u;case "%":return t%u;case "POW":return Math.pow(t,u);case "RANDOM":return narration.getRandomNumber(t,u)}case "arithmeticsingle":switch(e.operator){case "INT":return parseInt(t);case "FLOOR":return Math.floor(t);case "FLOAT":return parseFloat(t)}break}}function Uu(e){if(e&&typeof e=="object"&&"type"in e&&e.type==="value"&&e.storageOperationType==="get")switch(e.storageType){case "storage":case "tempstorage":return e.key==="_input_value_"?narration.inputValue:storage.get(e.key);case "flagStorage":return storage.getFlag(e.key);case "label":return narration.getTimesLabelOpened(e.label);case "choice":return narration.getTimesChoiceMade(e.index);case "logic":return x.getLogichValue(e.operation);case "params":let t=storage.get(`${Ue}${narration.openedLabels.length-1}`)||[];if(t&&t.length>e.key)return t[e.key];W.warn("getValue params not found");return}return e}function Yu(e){if(!e)return false;if(typeof e!="object"||!("type"in e))return !!e;switch(e.type){case "compare":let t=x.getLogichValue(e.leftValue),u=x.getLogichValue(e.rightValue);switch(e.operator){case "==":return t===u;case "!=":return t!==u;case "<":return t<u;case "<=":return t<=u;case ">":return t>u;case ">=":return t>=u;case "CONTAINS":return t.toString().includes(u.toString())}break;case "valueCondition":return !!x.getLogichValue(e.value);case "union":return Qu(e)}return !!e}function Qu(e){if(e.unionType==="not")return !ve(e.condition);let t=e.unionType==="and";for(let u=0;u<e.conditions.length;u++)if(t=x.getLogichValue(e.conditions[u])||false,e.unionType==="and"){if(!t)return false}else if(t)return true;return t}function Xu(e,t){return Math.floor(Math.random()*(t-e+1)+e)}function Ft(e){if(Array.isArray(e)||!e)return e;if(e&&typeof e=="object"&&"type"in e)switch(e.type){case "resulttocombine":return Zu(e);case "ifelse":return x.getLogichValue(e.condition)?x.getLogichValue(e.then):x.getLogichValue(e.else);case "stepswitch":let t=x.getLogichValue(e.elements)||[];if(t.length===0){W.error("getValueFromConditionalStatements elements.length === 0");return}switch(e.choiceType){case "random":let u=Xu(0,t.length-1);return x.getLogichValue(t[u]);case "loop":let n=NarrationManagerStatic.getCurrentStepTimesCounter(e.nestedId)-1;return n>t.length-1?(n=n%t.length,x.getLogichValue(t[n])):x.getLogichValue(t[n]);case "sequential":let i,l=NarrationManagerStatic.getCurrentStepTimesCounter(e.nestedId)-1;return e.end=="lastItem"&&(i=x.getLogichValue(t[t.length-1])),l>t.length-1?i:x.getLogichValue(t[l]);case "sequentialrandom":let d=NarrationManagerStatic.getRandomNumber(0,t.length-1,{nestedId:e.nestedId,onceOnly:true});if(d==null&&e.end=="lastItem"){let C=NarrationManagerStatic.getCurrentStepTimesCounterData(e.nestedId);if(!C||!C?.usedRandomNumbers){W.warn("getValueFromConditionalStatements randomIndexWhitExclude == undefined");return}let c=C.usedRandomNumbers[`0-${t.length-1}`];return x.getLogichValue(t[c[c.length-1]])}if(d==null){W.warn("getValueFromConditionalStatements randomIndexWhitExclude == undefined");return}return x.getLogichValue(t[d])}}return e}function Ye(e){if(e.conditionalStep){let t=createExportableElement(x.getLogichValue(e.conditionalStep));if(t?.glueEnabled===void 0&&delete t?.glueEnabled,t?.goNextStep===void 0&&delete t?.goNextStep,t?.end===void 0&&delete t?.end,t?.choices===void 0&&delete t?.choices,t?.dialogue===void 0&&delete t?.dialogue,t?.labelToOpen===void 0&&delete t?.labelToOpen,t?.operations===void 0&&delete t?.operations,t){let u={...e,conditionalStep:void 0,...t};return Ye(u)}else narration.dialogGlue&&(narration.dialogGlue=false);}return e}function Zu(e){let t=e.firstItem,u=[];e.secondConditionalItem?.forEach(i=>{if(Array.isArray(i))i.forEach(l=>{let d=x.getLogichValue(l);u.push(d);});else {let l=x.getLogichValue(i);u.push(l);}});let n=t?[t,...u]:u;if(n.length===0){W.warn("combinateResult toCheck.length === 0");return}if(typeof n[0]=="string")return I.t(n);if(typeof n[0]=="object"){let i=n,l,d=false,C=i.map((a,o)=>{a=Ye(a);let r=x.getLogichValue(a.dialogue)||"";return o===0?(l=x.getLogichValue(a.glueEnabled)||false,r):(typeof r=="object"&&"text"in r&&(r=r.character+": "+r.text),l===false&&d&&(r=`
|
|
2
2
|
|
|
3
|
-
`+r),r&&(d=true),l=x.getLogichValue(a.glueEnabled)||false,r)}),c=x.getLogichValue(C[0]),g=typeof c=="object"&&"character"in c?c.character:void 0,D=C.flatMap(a=>{let o;a&&typeof a=="object"&&"text"in a?o=a.text:o=a;let r;return Array.isArray(o)?r=o.map(s=>{let p=x.getLogichValue(s);return I.t(`${p}`)}):r=x.getLogichValue(o)||"",I.t(r)}),F=i.find(a=>a.end),h=i.find(a=>a.choices),m=false,y=false;i.length>0&&(i[0].glueEnabled&&i[0].goNextStep&&i[0].dialogue===void 0&&(narration.dialogGlue=true),m=i[i.length-1].glueEnabled,y=i.reverse().find(a=>!(a.operations&&(!a.dialogue||!a.choices)))?.goNextStep);let A=i.find(a=>a.labelToOpen),B=[];return i.forEach(a=>{a.operations&&(B=[...B,...a.operations]);}),{dialogue:g?{character:g,text:D}:D,end:F?.end,choices:h?.choices,glueEnabled:m,goNextStep:y,labelToOpen:A?.labelToOpen,operations:B}}}function Qe({getLogichValue:e=ve}){x.init({animateOperation:Hu,canvasElementOperation:Iu,effectOperation:$u,imageContainerOperation:Ru,imageOperation:Lu,textOperation:ju,narrationOperation:zu,loadAssets:ku,soundOperation:Mu,videoOperation:_u,setStorageValue:Wu,setInitialStorageValue:Gu,getLogichValue:t=>e?e(Ft(t),ve):ve(t),getConditionalStep:Ye});}var Ku=/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,en=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\u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-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\u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]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/,tn=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0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EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD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[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\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uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/,Xe={Space_Separator:Ku,ID_Start:en,ID_Continue:tn},R={isSpaceSeparator(e){return typeof e=="string"&&Xe.Space_Separator.test(e)},isIdStartChar(e){return typeof e=="string"&&(e>="a"&&e<="z"||e>="A"&&e<="Z"||e==="$"||e==="_"||Xe.ID_Start.test(e))},isIdContinueChar(e){return typeof e=="string"&&(e>="a"&&e<="z"||e>="A"&&e<="Z"||e>="0"&&e<="9"||e==="$"||e==="_"||e==="\u200C"||e==="\u200D"||Xe.ID_Continue.test(e))},isDigit(e){return typeof e=="string"&&/[0-9]/.test(e)},isHexDigit(e){return typeof e=="string"&&/[0-9A-Fa-f]/.test(e)}},Ke,G,ne,Oe,ie,X,$,ut,me,un=function(t,u){Ke=String(t),G="start",ne=[],Oe=0,ie=1,X=0,$=void 0,ut=void 0,me=void 0;do $=nn(),an[G]();while($.type!=="eof");return typeof u=="function"?et({"":me},"",u):me};function et(e,t,u){let n=e[t];if(n!=null&&typeof n=="object")if(Array.isArray(n))for(let i=0;i<n.length;i++){let l=String(i),d=et(n,l,u);d===void 0?delete n[l]:Object.defineProperty(n,l,{value:d,writable:true,enumerable:true,configurable:true});}else for(let i in n){let l=et(n,i,u);l===void 0?delete n[i]:Object.defineProperty(n,i,{value:l,writable:true,enumerable:true,configurable:true});}return u.call(e,t,n)}var S,b,ye,ue,v;function nn(){for(S="default",b="",ye=false,ue=1;;){v=re();let e=mt[S]();if(e)return e}}function re(){if(Ke[Oe])return String.fromCodePoint(Ke.codePointAt(Oe))}function f(){let e=re();return e===`
|
|
4
|
-
`?(ie++,
|
|
3
|
+
`+r),r&&(d=true),l=x.getLogichValue(a.glueEnabled)||false,r)}),c=x.getLogichValue(C[0]),g=typeof c=="object"&&"character"in c?c.character:void 0,D=C.flatMap(a=>{let o;a&&typeof a=="object"&&"text"in a?o=a.text:o=a;let r;return Array.isArray(o)?r=o.map(s=>{let p=x.getLogichValue(s);return I.t(`${p}`)}):r=x.getLogichValue(o)||"",I.t(r)}),F=i.find(a=>a.end),h=i.find(a=>a.choices),m=false,y=false;i.length>0&&(i[0].glueEnabled&&i[0].goNextStep&&i[0].dialogue===void 0&&(narration.dialogGlue=true),m=i[i.length-1].glueEnabled,y=i.reverse().find(a=>!(a.operations&&(!a.dialogue||!a.choices)))?.goNextStep);let A=i.find(a=>a.labelToOpen),B=[];return i.forEach(a=>{a.operations&&(B=[...B,...a.operations]);}),{dialogue:g?{character:g,text:D}:D,end:F?.end,choices:h?.choices,glueEnabled:m,goNextStep:y,labelToOpen:A?.labelToOpen,operations:B}}}function Qe({getLogichValue:e=ve}){x.init({animateOperation:Hu,canvasElementOperation:Iu,effectOperation:$u,imageContainerOperation:Ru,imageOperation:Lu,textOperation:ju,narrationOperation:zu,loadAssets:ku,soundOperation:Mu,videoOperation:_u,setStorageValue:Wu,setInitialStorageValue:Gu,getLogichValue:t=>e?e(Ft(t),ve):ve(t),getConditionalStep:Ye});}var Ku=/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,en=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\u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DE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uD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u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\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F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB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DCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\u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E5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/,Xe={Space_Separator:Ku,ID_Start:en,ID_Continue:tn},R={isSpaceSeparator(e){return typeof e=="string"&&Xe.Space_Separator.test(e)},isIdStartChar(e){return typeof e=="string"&&(e>="a"&&e<="z"||e>="A"&&e<="Z"||e==="$"||e==="_"||Xe.ID_Start.test(e))},isIdContinueChar(e){return typeof e=="string"&&(e>="a"&&e<="z"||e>="A"&&e<="Z"||e>="0"&&e<="9"||e==="$"||e==="_"||e==="\u200C"||e==="\u200D"||Xe.ID_Continue.test(e))},isDigit(e){return typeof e=="string"&&/[0-9]/.test(e)},isHexDigit(e){return typeof e=="string"&&/[0-9A-Fa-f]/.test(e)}},Ke,G,ne,Oe,ie,Z,$,ut,me,un=function(t,u){Ke=String(t),G="start",ne=[],Oe=0,ie=1,Z=0,$=void 0,ut=void 0,me=void 0;do $=nn(),an[G]();while($.type!=="eof");return typeof u=="function"?et({"":me},"",u):me};function et(e,t,u){let n=e[t];if(n!=null&&typeof n=="object")if(Array.isArray(n))for(let i=0;i<n.length;i++){let l=String(i),d=et(n,l,u);d===void 0?delete n[l]:Object.defineProperty(n,l,{value:d,writable:true,enumerable:true,configurable:true});}else for(let i in n){let l=et(n,i,u);l===void 0?delete n[i]:Object.defineProperty(n,i,{value:l,writable:true,enumerable:true,configurable:true});}return u.call(e,t,n)}var S,b,ye,ue,v;function nn(){for(S="default",b="",ye=false,ue=1;;){v=re();let e=mt[S]();if(e)return e}}function re(){if(Ke[Oe])return String.fromCodePoint(Ke.codePointAt(Oe))}function f(){let e=re();return e===`
|
|
4
|
+
`?(ie++,Z=0):e?Z+=e.length:Z++,e&&(Oe+=e.length),e}var mt={default(){switch(v){case " ":case "\v":case "\f":case " ":case "\xA0":case "\uFEFF":case `
|
|
5
5
|
`:case "\r":case "\u2028":case "\u2029":f();return;case "/":f(),S="comment";return;case void 0:return f(),k("eof")}if(R.isSpaceSeparator(v)){f();return}return mt[G]()},comment(){switch(v){case "*":f(),S="multiLineComment";return;case "/":f(),S="singleLineComment";return}throw L(f())},multiLineComment(){switch(v){case "*":f(),S="multiLineCommentAsterisk";return;case void 0:throw L(f())}f();},multiLineCommentAsterisk(){switch(v){case "*":f();return;case "/":f(),S="default";return;case void 0:throw L(f())}f(),S="multiLineComment";},singleLineComment(){switch(v){case `
|
|
6
6
|
`:case "\r":case "\u2028":case "\u2029":f(),S="default";return;case void 0:return f(),k("eof")}f();},value(){switch(v){case "{":case "[":return k("punctuator",f());case "n":return f(),pe("ull"),k("null",null);case "t":return f(),pe("rue"),k("boolean",true);case "f":return f(),pe("alse"),k("boolean",false);case "-":case "+":f()==="-"&&(ue=-1),S="sign";return;case ".":b=f(),S="decimalPointLeading";return;case "0":b=f(),S="zero";return;case "1":case "2":case "3":case "4":case "5":case "6":case "7":case "8":case "9":b=f(),S="decimalInteger";return;case "I":return f(),pe("nfinity"),k("numeric",1/0);case "N":return f(),pe("aN"),k("numeric",NaN);case '"':case "'":ye=f()==='"',b="",S="string";return}throw L(f())},identifierNameStartEscape(){if(v!=="u")throw L(f());f();let e=tt();switch(e){case "$":case "_":break;default:if(!R.isIdStartChar(e))throw yt();break}b+=e,S="identifierName";},identifierName(){switch(v){case "$":case "_":case "\u200C":case "\u200D":b+=f();return;case "\\":f(),S="identifierNameEscape";return}if(R.isIdContinueChar(v)){b+=f();return}return k("identifier",b)},identifierNameEscape(){if(v!=="u")throw L(f());f();let e=tt();switch(e){case "$":case "_":case "\u200C":case "\u200D":break;default:if(!R.isIdContinueChar(e))throw yt();break}b+=e,S="identifierName";},sign(){switch(v){case ".":b=f(),S="decimalPointLeading";return;case "0":b=f(),S="zero";return;case "1":case "2":case "3":case "4":case "5":case "6":case "7":case "8":case "9":b=f(),S="decimalInteger";return;case "I":return f(),pe("nfinity"),k("numeric",ue*(1/0));case "N":return f(),pe("aN"),k("numeric",NaN)}throw L(f())},zero(){switch(v){case ".":b+=f(),S="decimalPoint";return;case "e":case "E":b+=f(),S="decimalExponent";return;case "x":case "X":b+=f(),S="hexadecimal";return}return k("numeric",ue*0)},decimalInteger(){switch(v){case ".":b+=f(),S="decimalPoint";return;case "e":case "E":b+=f(),S="decimalExponent";return}if(R.isDigit(v)){b+=f();return}return k("numeric",ue*Number(b))},decimalPointLeading(){if(R.isDigit(v)){b+=f(),S="decimalFraction";return}throw L(f())},decimalPoint(){switch(v){case "e":case "E":b+=f(),S="decimalExponent";return}if(R.isDigit(v)){b+=f(),S="decimalFraction";return}return k("numeric",ue*Number(b))},decimalFraction(){switch(v){case "e":case "E":b+=f(),S="decimalExponent";return}if(R.isDigit(v)){b+=f();return}return k("numeric",ue*Number(b))},decimalExponent(){switch(v){case "+":case "-":b+=f(),S="decimalExponentSign";return}if(R.isDigit(v)){b+=f(),S="decimalExponentInteger";return}throw L(f())},decimalExponentSign(){if(R.isDigit(v)){b+=f(),S="decimalExponentInteger";return}throw L(f())},decimalExponentInteger(){if(R.isDigit(v)){b+=f();return}return k("numeric",ue*Number(b))},hexadecimal(){if(R.isHexDigit(v)){b+=f(),S="hexadecimalInteger";return}throw L(f())},hexadecimalInteger(){if(R.isHexDigit(v)){b+=f();return}return k("numeric",ue*Number(b))},string(){switch(v){case "\\":f(),b+=rn();return;case '"':if(ye)return f(),k("string",b);b+=f();return;case "'":if(!ye)return f(),k("string",b);b+=f();return;case `
|
|
7
|
-
`:case "\r":throw L(f());case "\u2028":case "\u2029":sn(v);break;case void 0:throw L(f())}b+=f();},start(){switch(v){case "{":case "[":return k("punctuator",f())}S="value";},beforePropertyName(){switch(v){case "$":case "_":b=f(),S="identifierName";return;case "\\":f(),S="identifierNameStartEscape";return;case "}":return k("punctuator",f());case '"':case "'":ye=f()==='"',S="string";return}if(R.isIdStartChar(v)){b+=f(),S="identifierName";return}throw L(f())},afterPropertyName(){if(v===":")return k("punctuator",f());throw L(f())},beforePropertyValue(){S="value";},afterPropertyValue(){switch(v){case ",":case "}":return k("punctuator",f())}throw L(f())},beforeArrayValue(){if(v==="]")return k("punctuator",f());S="value";},afterArrayValue(){switch(v){case ",":case "]":return k("punctuator",f())}throw L(f())},end(){throw L(f())}};function k(e,t){return {type:e,value:t,line:ie,column:
|
|
7
|
+
`:case "\r":throw L(f());case "\u2028":case "\u2029":sn(v);break;case void 0:throw L(f())}b+=f();},start(){switch(v){case "{":case "[":return k("punctuator",f())}S="value";},beforePropertyName(){switch(v){case "$":case "_":b=f(),S="identifierName";return;case "\\":f(),S="identifierNameStartEscape";return;case "}":return k("punctuator",f());case '"':case "'":ye=f()==='"',S="string";return}if(R.isIdStartChar(v)){b+=f(),S="identifierName";return}throw L(f())},afterPropertyName(){if(v===":")return k("punctuator",f());throw L(f())},beforePropertyValue(){S="value";},afterPropertyValue(){switch(v){case ",":case "}":return k("punctuator",f())}throw L(f())},beforeArrayValue(){if(v==="]")return k("punctuator",f());S="value";},afterArrayValue(){switch(v){case ",":case "]":return k("punctuator",f())}throw L(f())},end(){throw L(f())}};function k(e,t){return {type:e,value:t,line:ie,column:Z}}function pe(e){for(let t of e){if(re()!==t)throw L(f());f();}}function rn(){switch(re()){case "b":return f(),"\b";case "f":return f(),"\f";case "n":return f(),`
|
|
8
8
|
`;case "r":return f(),"\r";case "t":return f()," ";case "v":return f(),"\v";case "0":if(f(),R.isDigit(re()))throw L(f());return "\0";case "x":return f(),on();case "u":return f(),tt();case `
|
|
9
9
|
`:case "\u2028":case "\u2029":return f(),"";case "\r":return f(),re()===`
|
|
10
|
-
`&&f(),"";case "1":case "2":case "3":case "4":case "5":case "6":case "7":case "8":case "9":throw L(f());case void 0:throw L(f())}return f()}function on(){let e="",t=re();if(!R.isHexDigit(t)||(e+=f(),t=re(),!R.isHexDigit(t)))throw L(f());return e+=f(),String.fromCodePoint(parseInt(e,16))}function tt(){let e="",t=4;for(;t-- >0;){let u=re();if(!R.isHexDigit(u))throw L(f());e+=f();}return String.fromCodePoint(parseInt(e,16))}var an={start(){if($.type==="eof")throw ce();Ze();},beforePropertyName(){switch($.type){case "identifier":case "string":ut=$.value,G="afterPropertyName";return;case "punctuator":Pe();return;case "eof":throw ce()}},afterPropertyName(){if($.type==="eof")throw ce();G="beforePropertyValue";},beforePropertyValue(){if($.type==="eof")throw ce();Ze();},beforeArrayValue(){if($.type==="eof")throw ce();if($.type==="punctuator"&&$.value==="]"){Pe();return}Ze();},afterPropertyValue(){if($.type==="eof")throw ce();switch($.value){case ",":G="beforePropertyName";return;case "}":Pe();}},afterArrayValue(){if($.type==="eof")throw ce();switch($.value){case ",":G="beforeArrayValue";return;case "]":Pe();}},end(){}};function Ze(){let e;switch($.type){case "punctuator":switch($.value){case "{":e={};break;case "[":e=[];break}break;case "null":case "boolean":case "numeric":case "string":e=$.value;break}if(me===void 0)me=e;else {let t=ne[ne.length-1];Array.isArray(t)?t.push(e):Object.defineProperty(t,ut,{value:e,writable:true,enumerable:true,configurable:true});}if(e!==null&&typeof e=="object")ne.push(e),Array.isArray(e)?G="beforeArrayValue":G="beforePropertyName";else {let t=ne[ne.length-1];t==null?G="end":Array.isArray(t)?G="afterArrayValue":G="afterPropertyValue";}}function Pe(){ne.pop();let e=ne[ne.length-1];e==null?G="end":Array.isArray(e)?G="afterArrayValue":G="afterPropertyValue";}function L(e){return Ne(e===void 0?`JSON5: invalid end of input at ${ie}:${
|
|
10
|
+
`&&f(),"";case "1":case "2":case "3":case "4":case "5":case "6":case "7":case "8":case "9":throw L(f());case void 0:throw L(f())}return f()}function on(){let e="",t=re();if(!R.isHexDigit(t)||(e+=f(),t=re(),!R.isHexDigit(t)))throw L(f());return e+=f(),String.fromCodePoint(parseInt(e,16))}function tt(){let e="",t=4;for(;t-- >0;){let u=re();if(!R.isHexDigit(u))throw L(f());e+=f();}return String.fromCodePoint(parseInt(e,16))}var an={start(){if($.type==="eof")throw ce();Ze();},beforePropertyName(){switch($.type){case "identifier":case "string":ut=$.value,G="afterPropertyName";return;case "punctuator":Pe();return;case "eof":throw ce()}},afterPropertyName(){if($.type==="eof")throw ce();G="beforePropertyValue";},beforePropertyValue(){if($.type==="eof")throw ce();Ze();},beforeArrayValue(){if($.type==="eof")throw ce();if($.type==="punctuator"&&$.value==="]"){Pe();return}Ze();},afterPropertyValue(){if($.type==="eof")throw ce();switch($.value){case ",":G="beforePropertyName";return;case "}":Pe();}},afterArrayValue(){if($.type==="eof")throw ce();switch($.value){case ",":G="beforeArrayValue";return;case "]":Pe();}},end(){}};function Ze(){let e;switch($.type){case "punctuator":switch($.value){case "{":e={};break;case "[":e=[];break}break;case "null":case "boolean":case "numeric":case "string":e=$.value;break}if(me===void 0)me=e;else {let t=ne[ne.length-1];Array.isArray(t)?t.push(e):Object.defineProperty(t,ut,{value:e,writable:true,enumerable:true,configurable:true});}if(e!==null&&typeof e=="object")ne.push(e),Array.isArray(e)?G="beforeArrayValue":G="beforePropertyName";else {let t=ne[ne.length-1];t==null?G="end":Array.isArray(t)?G="afterArrayValue":G="afterPropertyValue";}}function Pe(){ne.pop();let e=ne[ne.length-1];e==null?G="end":Array.isArray(e)?G="afterArrayValue":G="afterPropertyValue";}function L(e){return Ne(e===void 0?`JSON5: invalid end of input at ${ie}:${Z}`:`JSON5: invalid character '${xt(e)}' at ${ie}:${Z}`)}function ce(){return Ne(`JSON5: invalid end of input at ${ie}:${Z}`)}function yt(){return Z-=5,Ne(`JSON5: invalid identifier character at ${ie}:${Z}`)}function sn(e){console.warn(`JSON5: '${xt(e)}' in strings is not valid ECMAScript; consider escaping`);}function xt(e){let t={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};if(t[e])return t[e];if(e<" "){let u=e.charCodeAt(0).toString(16);return "\\x"+("00"+u).substring(u.length)}return e}function Ne(e){let t=new SyntaxError(e);return t.lineNumber=ie,t.columnNumber=Z,t}var ln=function(t,u,n){let i=[],l="",d,C,c="",g;if(u!=null&&typeof u=="object"&&!Array.isArray(u)&&(n=u.space,g=u.quote,u=u.replacer),typeof u=="function")C=u;else if(Array.isArray(u)){d=[];for(let A of u){let B;typeof A=="string"?B=A:(typeof A=="number"||A instanceof String||A instanceof Number)&&(B=String(A)),B!==void 0&&d.indexOf(B)<0&&d.push(B);}}return n instanceof Number?n=Number(n):n instanceof String&&(n=String(n)),typeof n=="number"?n>0&&(n=Math.min(10,Math.floor(n)),c=" ".substr(0,n)):typeof n=="string"&&(c=n.substr(0,10)),D("",{"":t});function D(A,B){let a=B[A];switch(a!=null&&(typeof a.toJSON5=="function"?a=a.toJSON5(A):typeof a.toJSON=="function"&&(a=a.toJSON(A))),C&&(a=C.call(B,A,a)),a instanceof Number?a=Number(a):a instanceof String?a=String(a):a instanceof Boolean&&(a=a.valueOf()),a){case null:return "null";case true:return "true";case false:return "false"}if(typeof a=="string")return F(a);if(typeof a=="number")return String(a);if(typeof a=="object")return Array.isArray(a)?y(a):h(a)}function F(A){let B={"'":.1,'"':.2},a={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"},o="";for(let s=0;s<A.length;s++){let p=A[s];switch(p){case "'":case '"':B[p]++,o+=p;continue;case "\0":if(R.isDigit(A[s+1])){o+="\\x00";continue}}if(a[p]){o+=a[p];continue}if(p<" "){let E=p.charCodeAt(0).toString(16);o+="\\x"+("00"+E).substring(E.length);continue}o+=p;}let r=g||Object.keys(B).reduce((s,p)=>B[s]<B[p]?s:p);return o=o.replace(new RegExp(r,"g"),a[r]),r+o+r}function h(A){if(i.indexOf(A)>=0)throw TypeError("Converting circular structure to JSON5");i.push(A);let B=l;l=l+c;let a=d||Object.keys(A),o=[];for(let s of a){let p=D(s,A);if(p!==void 0){let E=m(s)+":";c!==""&&(E+=" "),E+=p,o.push(E);}}let r;if(o.length===0)r="{}";else {let s;if(c==="")s=o.join(","),r="{"+s+"}";else {let p=`,
|
|
11
11
|
`+l;s=o.join(p),r=`{
|
|
12
12
|
`+l+s+`,
|
|
13
13
|
`+B+"}";}}return i.pop(),l=B,r}function m(A){if(A.length===0)return F(A);let B=String.fromCodePoint(A.codePointAt(0));if(!R.isIdStartChar(B))return F(A);for(let a=B.length;a<A.length;a++)if(!R.isIdContinueChar(String.fromCodePoint(A.codePointAt(a))))return F(A);return A}function y(A){if(i.indexOf(A)>=0)throw TypeError("Converting circular structure to JSON5");i.push(A);let B=l;l=l+c;let a=[];for(let r=0;r<A.length;r++){let s=D(String(r),A);a.push(s!==void 0?s:"null");}let o;if(a.length===0)o="[]";else if(c==="")o="["+a.join(",")+"]";else {let r=`,
|
|
14
14
|
`+l,s=a.join(r);o=`[
|
|
15
15
|
`+l+s+`,
|
|
16
|
-
`+B+"]";}return i.pop(),l=B,o}},pn={parse:un,stringify:ln},cn=pn,Je=cn;var Bt="\xA7SPACE\xA7",bt="\xA7DOUBLE_QUOTES\xA7",Tt="\xA7QUOTES\xA7",Vt="SPECIAL_\xA7QUOTES\xA7",St="\xA7CURLY_BRACKETS1\xA7",vt="\xA7CURLY_BRACKETS2\xA7",ge=class{};c(ge,"handlers",[t=>false]);var ke;(B=>{async function e(a,o){let r=ge.handlers;for(let s=0;s<r.length;s++)try{let p=await r[s](a,o,F);if(p===!0||typeof p=="string")return p}catch{}return false}function t(a){ge.handlers.push(a);}B.add=t;function u(){ge.handlers=[];}B.clear=u;async function n(a,o,r){try{a=a.replaceAll('\\"',bt),a=a.replaceAll("\\'",Tt),a=a.replaceAll("\\`",Vt),a=a.replaceAll("\\{",St),a=a.replaceAll("\\}",vt),a=a.replaceAll("{"," { "),a=a.replaceAll("}"," } "),a=a.replaceAll(St,"{"),a=a.replaceAll(vt,"}");let s=[],p,E="";for(let J=0;J<a.length;J++){let j=a[J];j==='"'||j==="'"||j==="`"?p===void 0?(s.push(E),E="",p=j,E+=j):p===j?(p=void 0,E+=j,s.push(E),E=""):E+=j:E+=j;}E!==""&&s.push(E),s.forEach((J,j)=>{j%2===1&&(s[j]=J.replaceAll(" ",Bt));}),a=s.join(""),s=a.split(" ").filter(J=>J!==""),s=s.map(J=>J.replaceAll(Bt," ").replaceAll(bt,'"').replaceAll(Tt,"'").replaceAll(Vt,"`"));let T=await e(s,r);if(T===!0)return;if(typeof T=="string")return T.startsWith("#")&&(T=T.substring(1)),B.run(T,o,r);let _=s.length>1?y(s[1]):"",w=s.length>0?y(s[0]):"";switch(_){case "image":case "imagecontainer":case "canvaselement":case "video":case "text":return _==="video"&&(w==="pause"||w==="resume")?{type:"video",operationType:w,alias:y(s[2])}:i(s,_);case "sound":case "channel":return c(s,_);case "input":if(w==="request"){let J={type:"input",operationType:"request"};if(s.length>2)try{let j=s.slice(2),q=F(j);"type"in q&&typeof q.type=="string"&&(J.valueType=q.type),"default"in q&&(J.defaultValue=q.default);}catch{}return J}break;case "assets":case "bundle":switch(w){case "load":case "lazyload":return {type:_,operationType:w,aliases:s.slice(2)}}break;case "all":if(s.length>2)switch(s[2]){case "sounds":case "sound":
|
|
16
|
+
`+B+"]";}return i.pop(),l=B,o}},pn={parse:un,stringify:ln},cn=pn,Je=cn;var Bt="\xA7SPACE\xA7",bt="\xA7DOUBLE_QUOTES\xA7",Tt="\xA7QUOTES\xA7",Vt="SPECIAL_\xA7QUOTES\xA7",St="\xA7CURLY_BRACKETS1\xA7",vt="\xA7CURLY_BRACKETS2\xA7",ge=class{};c(ge,"handlers",[t=>false]);var ke;(B=>{async function e(a,o){let r=ge.handlers;for(let s=0;s<r.length;s++)try{let p=await r[s](a,o,F);if(p===!0||typeof p=="string")return p}catch{}return false}function t(a){ge.handlers.push(a);}B.add=t;function u(){ge.handlers=[];}B.clear=u;async function n(a,o,r){try{a=a.replaceAll('\\"',bt),a=a.replaceAll("\\'",Tt),a=a.replaceAll("\\`",Vt),a=a.replaceAll("\\{",St),a=a.replaceAll("\\}",vt),a=a.replaceAll("{"," { "),a=a.replaceAll("}"," } "),a=a.replaceAll(St,"{"),a=a.replaceAll(vt,"}");let s=[],p,E="";for(let J=0;J<a.length;J++){let j=a[J];j==='"'||j==="'"||j==="`"?p===void 0?(s.push(E),E="",p=j,E+=j):p===j?(p=void 0,E+=j,s.push(E),E=""):E+=j:E+=j;}E!==""&&s.push(E),s.forEach((J,j)=>{j%2===1&&(s[j]=J.replaceAll(" ",Bt));}),a=s.join(""),s=a.split(" ").filter(J=>J!==""),s=s.map(J=>J.replaceAll(Bt," ").replaceAll(bt,'"').replaceAll(Tt,"'").replaceAll(Vt,"`"));let T=await e(s,r);if(T===!0)return;if(typeof T=="string")return T.startsWith("#")&&(T=T.substring(1)),B.run(T,o,r);let _=s.length>1?y(s[1]):"",w=s.length>0?y(s[0]):"";switch(_){case "image":case "imagecontainer":case "canvaselement":case "video":case "text":return _==="video"&&(w==="pause"||w==="resume")?{type:"video",operationType:w,alias:y(s[2])}:i(s,_);case "sound":case "channel":return c(s,_);case "input":if(w==="request"){let J={type:"input",operationType:"request"};if(s.length>2)try{let j=s.slice(2),q=F(j);"type"in q&&typeof q.type=="string"&&(J.valueType=q.type),"default"in q&&(J.defaultValue=q.default);}catch{}return J}break;case "assets":case "bundle":switch(w){case "load":case "lazyload":return {type:_,operationType:w,aliases:s.slice(2)}}break;case "all":if(s.length>2)switch(s[2]){case "sounds":case "sound":switch(w){case "pause":case "resume":case "stop":return {type:"all",operationType:w}}}default:if(_)switch(w){case "call":case "jump":o.labelToOpen={label:_,type:w},o.goNextStep=void 0;return;case "shake":let J={};if(s.length>2)try{J=F(s.slice(2));}catch{}return {alias:_,type:w,props:J};case "animate":let q={},$e={};if(s.length>2){let se=s.slice(2),ze=[];if(se.includes("options")){let Be=se.indexOf("options");ze=se.slice(Be+1),se=se.slice(0,Be);}try{q=F(se);}catch{}if(ze.length>0)try{$e=F(ze);}catch{}}return {alias:_,type:w,keyframes:q,options:$e}}else switch(w){case "pause":return "dialogue"in o&&delete o.dialogue,"goNextStep"in o&&delete o.goNextStep,{type:"dialogue",operationType:"clean"};case "continue":o.goNextStep=!0,o.glueEnabled=!1;return}}}catch(s){throw d.error("Error parsing ink hashtag-command",a),s}d.error("The operation is not valid",a);}B.run=n;function i(a,o){let r=y(a[0]),s=y(a[2]),p=h(a.slice(3));switch(r){case "show":switch(o){case "image":case "video":return l(o,s,p);case "imagecontainer":return C(o,s,p);case "text":return d$1(o,s,p);default:d.error("This show operation is not valid for this type of element",o);}case "edit":return {type:o,operationType:"edit",alias:s,props:m(p)};case "remove":let T={type:o,operationType:"remove",alias:s};if(p.length>1&&p[0]==="with"){let _=a[a.indexOf("with")+1],w=a.slice(a.indexOf("with")+2),J=D(_,w);J!==void 0&&(T.transition=J);}return T;default:d.error("The operation type is not valid",r);}}function l(a,o,r){let s,p;return r.length%2===0?(s=o,p=r):(s=y(r[0]),p=r.slice(1)),g({type:a,operationType:"show",alias:o,url:s},p)}function d$1(a,o,r){let s,p;return r.length%2===0?(s=o,p=r):(s=y(r[0]),p=r.slice(1)),g({type:a,operationType:"show",alias:o,text:s},p)}function C(a,o,r){let s=[],p=r.findIndex(w=>w.startsWith("[")),E=r.findIndex(w=>w.endsWith("]"));if(p===-1||E===-1){d.error("Show imagecontainer must have a list of image ulrs",r);return}if(s=r.slice(p,E+1),s.length<2){d.error("Show imagecontainer must have a list of image ulrs",r);return}s[0]==="["?s.shift():s[0]=s[0].substring(1),s[s.length-1]==="]"?s.pop():s[s.length-1]=s[s.length-1].substring(0,s[s.length-1].length-1);let T={type:a,operationType:"show",alias:o,urls:s.map(w=>y(w))},_=r.slice(E+1);return g(T,_)}function c(a,o){let r=y(a[0]),s=y(a[2]);switch(r){case "play":let p=h(a.slice(3)),E,T;p.length%2===0?(E=s,T=p):(E=y(p[0]),T=p.slice(1));let _={type:"sound",operationType:"play",alias:s};if(E&&(_.url=E),a.length>3){let He=F(T);He!==void 0&&(_.props=He);}return _;case "pause":case "resume":return {type:o,operationType:r,alias:s};case "stop":case "remove":return {type:"sound",operationType:"stop",alias:s};case "edit":return {type:"sound",operationType:"edit",alias:s,props:F(a.slice(3))};case "volume":let q=parseFloat(a[3]);return {type:"sound",operationType:"edit",alias:s,props:{volume:q}}}}function g(a,o){if(o.length>0){if(o.includes("with")&&o.length>o.indexOf("with")+1){let r=o[o.indexOf("with")+1],s=o.slice(o.indexOf("with")+2);o=o.slice(0,o.indexOf("with"));let p=D(r,s);p!==void 0&&(a.transition=p);}if(o.length>0){let r=m(o);a.props=r;}}return a}function D(a,o){switch(a){case "dissolve":case "fade":case "movein":case "moveout":case "zoomin":case "zoomout":case "pushin":case "pushout":break;default:return}let r={type:a};if(o.length>0)try{let s=m(o);r.props=s;}catch{}return r}function F(a){let o=h(a);return m(o)}function h(a){let o=[],r=0,s="";for(let p=0;p<a.length;p++){let E=a[p];E.startsWith("{")?(r++,s+=E):E.endsWith("}")&&r>0?(r--,s+=E,r===0&&(o.push(s),s="")):r>0?s+=E:o.push(E);}return o}function m(a){if(a.length===0)return {};if(a.length%2!==0)throw d.error("The props list must have a pair number of elements",a),new Error("The props list must have a pair number of elements");let o="{";a.forEach((r,s)=>{if(s%2===0)o+=`"${r}": `;else {switch(r){case "null":case "undefined":case "true":case "false":o+=`${r}`;break;default:A(r)?(r=y(r),o+=`"${r}"`):r.startsWith("{")&&r.endsWith("}")?o+=`${r}`:r.startsWith('"')&&r.endsWith('"')?o+=`${r}`:isNaN(parseFloat(r))?o+=`"${r}"`:o+=`${r}`;}s<a.length-1&&(o+=", ");}}),o+="}";try{return Je.parse(o)}catch(r){throw d.error("Error parsing ink json",o),r}}function y(a){return a.startsWith('"')&&a.endsWith('"')||a.startsWith("'")&&a.endsWith("'")||a.startsWith("`")&&a.endsWith("`")?a.substring(1,a.length-1):a}function A(a){return !!(a.startsWith('"')&&a.endsWith('"')||a.startsWith("'")&&a.endsWith("'")||a.startsWith("`")&&a.endsWith("`"))}})(ke||(ke={}));var he=ke;function Dn(e){ke.add(e);}var De=class{};c(De,"handlers",[]);var nt;(n=>{function e(i){De.handlers.push(i);}n.add=e;function t(){De.handlers=[];}n.clear=t;function u(i,l,d=0){if(d>=De.handlers.length)return l(i);let C=De.handlers[d];return C(i,c=>u(c,l,d+1))}n.getLogichValue=u;})(nt||(nt={}));var Le=nt;var Dt=b$1(e(),1);var _e="global decl",oe="___external_value___";function xe(e,t){if(e.endsWith(".s"))return;if(new RegExp(/.*\.[0-9]+\..*$/).test(e)&&(e=e.split(".").filter(i=>!i.match(/^[0-9]+$/)).join("."),!e.startsWith(".")))return e.replaceAll(".","_|_");if(!new RegExp(/^\.\^.*$/).test(e)&&e.includes("g-")){let n=e.split("g-");return rt(t)+"_|_"+"g-"+n[n.length-1]}let u=0;for(;new RegExp(/^\.\^.*$/).test(e);)u++,e=e.substring(2);if(u=u-1,new RegExp(/^\..*$/).test(e)&&t){let n=e.substring(1);return rt(t,u)+"_|_"+n.replaceAll(".","_|_")}return e.replaceAll(".","_|_")||rt(t,u).replaceAll(".","_|_")}function rt(e,t=0){let u=e.split("_|_");for(;u.length>1&&t>0;)u.pop()?.includes("g-")&&t--,t--;return u.join("_|_")}var wt="\xA7DOUBLE_SLASH_CONVERTOR\xA7";function ee(e){return e.startsWith("^")&&(e=e.substring(1)),e=e.replaceAll("\\\\",wt),e=e.replaceAll("\\n",`
|
|
17
17
|
`),e=e.replaceAll("\\t"," "),e=e.replaceAll(" "," "),e=e.replaceAll(wt,"\\\\"),e}var Pt=["+","-","/","*","%","_","==",">","<",">=","<=","!=","!","&&","||","MIN","MAX"],Ot=["+","-","/","*","%","POW","RANDOM"],Nt=["INT","FLOOR","FLOAT"],Jt=["==",">","<",">=","<=","!=","CONTAINS"];function de(e,t,u){e=e.map(i=>{if(typeof i=="string"){if(i==="rnd")return "RANDOM";if(i==="?")return "CONTAINS"}return i});let n=[];return e.forEach(i=>{if(typeof i=="object"&&"CNT?"in i)if(new RegExp(/.*\.[0-9]\..*/).test(i["CNT?"])){let l=i["CNT?"].split("."),d$1=l.pop(),C=l.pop();if(C===void 0||d$1===void 0){d.error("Error parsing ink file: Conditional statement is not valid",e);return}let c=parseInt(C),g=l.join(".");if(g.includes("^.")){let F=g.split("."),h=F[F.length-1].replaceAll(".","_|_");F.pop(),g=F.join(".")+"."+h,d$1.includes("c-")&&(g=g+"_|_"+d$1);}else g=g.replaceAll(".","_|_");let D=xe(g,t);if(!D)return;n.push({type:"compare",leftValue:kt(D),operator:">=",rightValue:{type:"value",value:c}});}else {let l=xe(i["CNT?"],t);if(!l)return;n.push(kt(l));}else if(typeof i=="object"&&"VAR?"in i)n.push(Ce(i["VAR?"],u));else if(i==="&&"||i==="||"){if(n.length>=2){let l={type:"union",unionType:i==="&&"?"and":"or",conditions:[n[n.length-2],n[n.length-1]]};n.pop(),n.pop(),n.push(l);}}else if(i==="!")if(n.length===0)d.error("Error parsing ink file: Conditional statement is not valid",e);else {let l={type:"union",unionType:"not",condition:n[n.length-1]};n[n.length-1]=l;}else if(i&&typeof i=="string"&&Jt.includes(i))if(n.length<2)d.error("Error parsing ink file: Conditional statement is not valid",e);else {let l={type:"compare",operator:i,rightValue:n[n.length-1],leftValue:n[n.length-2]};n.pop(),n.pop(),n.push(l);}else if(i&&typeof i=="string"&&Ot.includes(i))if(n.length<2)d.error("Error parsing ink file: Conditional statement is not valid",e);else {let l={type:"arithmetic",operator:i,rightValue:n[n.length-1],leftValue:n[n.length-2]};n.pop(),n.pop(),n.push(l);}else if(i&&typeof i=="string"&&Nt.includes(i)){let l={type:"arithmeticsingle",operator:i,leftValue:n[n.length-1]};n.pop(),n.push(l);}else i&&typeof i=="string"?i.startsWith("^")&&n.push(ee(i)):typeof i=="object"&&"^->"in i?i["^->"].includes("$r")||n.push(i["^->"]):n.push(i);}),n}function kt(e){return {type:"value",storageType:"label",storageOperationType:"get",label:e}}function Lt(e,t,u){return de(e,t,u)}function Ce(e,t,u="storage"){let n=t.indexOf(e);return n>=0?{type:"value",storageType:"params",storageOperationType:"get",key:n}:{type:"value",storageOperationType:"get",storageType:u,key:e}}function it(e,t,u,n="storage"){let i=t.indexOf(e);return i>=0?{type:"value",storageType:"params",storageOperationType:"set",key:i,value:u}:{type:"value",storageOperationType:"set",storageType:n,key:e,value:u}}function ot(e,t){return t||new RegExp(`${"_|_".replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}c-\\d+$`).test(e)?"call":"jump"}function Re(e,t){t&&(typeof t=="string"?t.startsWith("^")&&e.push(ee(t)):typeof t=="object"&&"type"in t&&t.type!=="value"&&e.push(t));}function at(e,t,u,n,i={}){let{isNewLine:l=true,isHashtagScript:d=false,isThreads:C=false}=i;return gn(e,t,u,n,{isNewLine:l,isHashtagScript:d,isThreads:C})}function gn(e,t,u,n,i){if(!t)return;let{isNewLine:l,isHashtagScript:d=false,isThreads:C}=i;if(d)Array.isArray(t)&&t.length>0&&e.push({operations:[{type:"operationtoconvert",values:t}],goNextStep:true});else if(typeof t=="string"&&t.startsWith("^")||t&&typeof t=="object"&&"type"in t&&t.type=="value"&&t.storageOperationType==="get"){if(!l&&e.length>0){let c=e[e.length-1];!c.glueEnabled&&!c.operations&&(c.glueEnabled=true,c.labelToOpen||(c.goNextStep=true)),e[e.length-1]=c;}typeof t=="string"?e.push(hn(ee(t))):e.push({dialogue:t});}else if(typeof t=="string"){if(t==="end")e.push({end:"game_end"});else if(t==="done")e.push({end:"label_end",goNextStep:true});else if(t=="<>")if(e.length>0){let c=e[e.length-1];c.glueEnabled=true,c.labelToOpen||(c.goNextStep=true),e[e.length-1]=c;}else e.push({glueEnabled:true,goNextStep:false});}else if(typeof t=="object"){if("type"in t&&t.type!=="value"){if(!l&&e.length>0){let c=e[e.length-1];!c.glueEnabled&&!c.operations&&(c.glueEnabled=true,c.labelToOpen||(c.goNextStep=true)),e[e.length-1]=c;}e.push({conditionalStep:t});}else if("->"in t){let c=l?void 0:true;if(c&&u.includes("c-")&&e.length>0&&e[e.length-1]?.dialogue===void 0&&(c=void 0),!l&&e.length>0){let g=e[e.length-1];g.labelToOpen||(g.goNextStep=true),e[e.length-1]=g;}if(t.params&&t.params.length===0&&delete t.params,t.var)e.push({labelToOpen:{label:Ce(t["->"],n),type:C?"call":"jump",params:t.params},glueEnabled:c});else {let g=xe(t["->"],u);if(!g)return;e.push({labelToOpen:{label:g,type:ot(g,C),params:t.params},glueEnabled:c});}}"type"in t&&t.type=="value"&&t.storageOperationType==="set"&&(typeof t.value=="string"&&t.value.startsWith("^")&&(t.value=ee(t.value)),e.push({goNextStep:true,operations:[t]}));}}function hn(e){let t;if(e.includes(": ")){let u=e.split(": "),n=u[0],i=u.slice(1).join(": ");RegisteredCharacters.get(n)&&(t=n,e=i);}return t?{dialogue:{character:t,text:e}}:{dialogue:e}}function st(e,t,u,n=true,i=false){return dn(e,t,u,n,i)}function dn(e,t,u,n,i=false){t&&(typeof t=="string"&&t.startsWith("^")||t&&typeof t=="object"&&"type"in t&&t.type=="value"&&t.storageOperationType==="get"?typeof t=="string"?e.push(ee(t)):e.push(t):typeof t=="object"&&"type"in t&&e.push(t));}function je(e,t,u){if(e.length===0){d.error("Error parsing ink file: Arithmetic statement is not valid",e);return}let n=de(e,t,u);if(n.length===1){let i=n[0];return i&&typeof i=="object"&&"type"in i?{type:"value",storageType:"logic",storageOperationType:"get",operation:i}:i}}function Ae(e,t,u,n="",i,l,d=void 0){let C=[],c="sequential",g=false,D=true;e.forEach(m=>{m==="%"&&(c="loop"),m==="seq"&&(c="random"),m==="MIN"&&(g=true);});let F=e[e.length-1];return Object.keys(F).forEach(m=>{let y=F[m];if(Array.isArray(y)&&y.length>3){y=y.slice(1,y.length-2);let A=[];ae(y,n,i,A,t,t,u,Ee,d,true,l),A.length===1?C.push(A[0]):C.push({type:"resulttocombine",combine:"cross",secondConditionalItem:A});}else Array.isArray(y)&&y.length===3&&(D=false);}),c==="sequential"?{type:"stepswitch",elements:C,choiceType:c,end:D?"lastItem":void 0,nestedId:d}:g&&c==="random"?{type:"stepswitch",elements:C,choiceType:"sequentialrandom",end:D?"lastItem":void 0,nestedId:d}:{type:"stepswitch",elements:C,choiceType:c}}function lt(e="",t=""){let u=Array.isArray(e)?e:[e],n=Array.isArray(t)?t:[t];return [...new Set([...u,...n])]}function Ee(e,t,u,n,i){if(e.length>0){let l={};_t(e,l,i);for(let[d$1,C]of Object.entries(l)){let c=u+"_|_"+d$1,g={text:C.text.length===1?C.text[0]:C.text,label:c,props:{},type:ot(c,false),oneTime:C.onetime};C.text.length===0&&(g.onlyHaveNoChoice=true,g.autoSelect=true),g.oneTime===false&&delete g.oneTime;let D=pt(g,C.conditions,i,u)||g,F=t[t.length-1];if(typeof F=="object"&&F&&"type"in F&&(F={conditionalStep:F}),t.length>0&&typeof F=="object"&&F&&"choices"in F&&F.choices){let h=F.choices;h&&Array.isArray(h)?h.push(D):d.error("Unhandled case: choices is PixiVNJsonConditionalStatements<PixiVNJsonChoices> | undefined",C,h),F.choices=h.sort((m,y)=>{try{let A=m.label.split("."),B=A[A.length-1].replaceAll(".","_|_"),a=y.label.split("."),o=a[a.length-1].replaceAll(".","_|_");if(B.includes("c-")&&o.includes("c-")){let r=B.split("c-")[1],s=parseInt(r),p=o.split("c-")[1],E=parseInt(p);return s-E}}catch{}return 0});}else t.push({choices:[D]});C.preDialog&&(n.preDialog[c]={...C.preDialog});}}}function _t(e,t,u,n){let i=[],l="",d="",C=false,c=[];for(let g=0;g<e.length;g++){let D=e[g];if(typeof D=="string")D.startsWith("^")?i.push(ee(D)):Pt.includes(D)&&c.push(D);else if(Array.isArray(D)&&D.includes("visit")){let F=Ae(D,Re,(h,m,y)=>{},n,{preDialog:{}},u);i.push(F);}else if(D&&typeof D=="object")if("*"in D&&typeof D["*"]&&typeof D["*"]=="string")D["*"].includes("c")&&(l="c"+D["*"].split("c")[1],D.flg&16&&(C=true));else if("s"in D&&D.s instanceof Array){let F=Rt(D.s),h=D.s.includes("<>");F&&(n&&t[n]?(t[n].preDialog={text:F,glue:h},t[n].text=lt(F,t[n].text)):(i.push(F),d=F));}else "CNT?"in D&&c.push(D);else c.push(D);if(l){t[l]?t[l].text=lt(i,t[l].text):t[l]={text:i,onetime:C,conditions:c},d&&(t[l].preDialog={text:d,glue:false});let F=e.slice(g+1);_t(F,t,u,l);return}}}function Rt(e){for(let t of e)if(typeof t=="string"){if(t.startsWith("^"))return ee(t)}else if(t instanceof Array){let u=Rt(t);if(u)return u}}function pt(e,t,u,n,i){if(t.length===0)return;let l=de(t,n,u);if(l.length===1){let d={type:"ifelse",condition:l[0],then:e,else:i};return d.else||delete d.else,d}else if(l.length>1){let d={type:"ifelse",condition:{type:"union",unionType:"and",conditions:l},then:e,else:i};return d.else||delete d.else,d}}function jt(e,t,u,n,i,l,d$1=void 0){if(e.length===0){d.error("Error parsing ink file: Conditional statement is not valid",e);return}let C=[],c=[];if(e.forEach(F=>{Array.isArray(F)?c.push(F):typeof F=="string"&&F==="du"?i.du?C.push(i.du):i.du=C[C.length-1]:(typeof F!="string"||F!=="/ev")&&C.push(F);}),c.length===0){d.error("Error parsing ink file: Conditional statement is not valid",c);return}let g=ct(c[0],t,u,n+"_|_"+"then",i,l,`${d$1||""}then`),D;return c.length===2?D=ct(c[1],t,u,n+"_|_"+"else",i,l,`${d$1||""}else`):c.length>2&&(c.shift(),c.push("nop"),c=[{b:c}],D=ct(c,t,u,n+"_|_"+"else",i,l,`${d$1||""}else`)),i.du=void 0,pt(g,C,l,n,D)}function ct(e,t,u,n,i,l,d=void 0){let C=[];for(let g of e)typeof g=="object"&&"b"in g&&(g.b=g.b.filter(D=>D!==null&&!(typeof D=="object"&&"->"in D&&new RegExp(/.*\.[0-9]/).test(D["->"]))),ae(g.b,n,i,C,t,t,u,Ee,d,true,l));return C.length===1?C[0]:{type:"resulttocombine",combine:"cross",secondConditionalItem:C}}function ae(e,t,u,n=[],i,l,d$1,C,c=void 0,g=true,D=[]){let F=false,h=[],m=false,y=false,A=false,B=[],a=[];if(u.preDialog[t]&&(g=false,i(n,"^"+u.preDialog[t].text,t,D,{isNewLine:g,isHashtagScript:y,isThreads:A}),u.preDialog[t].glue&&i(n,"<>",t,D,{isNewLine:g,isHashtagScript:y,isThreads:A}),delete u.preDialog[t]),e.includes("visit")){let r=Ae(e,l,d$1,t,u,D,c);r&&(!g&&n.length>0&&i(n,"<>",t,D,{isNewLine:g,isHashtagScript:y,isThreads:A}),i(n,r,t,D,{isNewLine:g,isHashtagScript:y,isThreads:A}));return}let o=e[0];if(o&&typeof o=="object"&&"temp="in o){for(;e[0]&&typeof e[0]=="object"&&"temp="in e[0];)D.push(e[0]["temp="]),e.shift();D=D.reverse();}if(e.forEach((r,s)=>{if(y){if(typeof r=="string"&&r=="/#"){let p=[];ae(a,t,u,p,st,st,d$1,C,c,g),i(n,p,t,D,{isNewLine:g,isHashtagScript:y,isThreads:A}),y=false,a=[];}else a.push(r);return}else if(F)if(Array.isArray(r))h.push(r);else if(r&&typeof r=="object")if("CNT?"in r)s>0&&e[s-1]=="ev"?(m=true,B.push(r)):m?B.push(r):(h.push(r),g=false);else if("VAR="in r||"temp="in r){let p=it("VAR="in r?r["VAR="]:r["temp="],D,e[s-1],"VAR="in r?"storage":"tempstorage");if(p.value&&typeof p.value=="string"&&p.value=="/str"&&(p.value=e[s-2]),p.value&&typeof p.value=="object"&&"^->"in p.value&&(p.value=p.value["^->"]),h.length>1){let E=je(h,t,D);h=[],E&&typeof E=="object"&&"type"in E&&E.type=="value"&&"storageType"in E&&E.storageType=="logic"&&(p.value=E.operation);}(typeof p.key!="string"||!p.key.includes("$r"))&&(i(n,p,t,D,{isNewLine:g,isHashtagScript:y,isThreads:A}),g=true);}else "VAR?"in r?h.push(r):"^->"in r&&(r["^->"].includes("$r")||h.push(r));else if(typeof r=="string"&&r=="/ev")m&&B.push(r),F=false,h.push(r);else if(typeof r=="string"&&r=="out"){if(h.length>0){let p=h[h.length-1];if(p&&typeof p=="object"&&"VAR?"in p){h.pop();let E=Ce(p["VAR?"],D,"storage");i(n,E,t,D,{isNewLine:g,isHashtagScript:y,isThreads:A});}else {let E=[];for(;h.length>0&&h[h.length-1]!="/ev";)E.push(h.pop());E=E.reverse();let T=je(E,t,D);h=[],T&&typeof T=="object"&&"type"in T&&T.type=="value"&&"storageType"in T&&T.storageType=="logic"?i(n,{storageOperationType:"get",storageType:"logic",operation:T.operation,type:"value"},t,D,{isNewLine:g,isHashtagScript:y,isThreads:A}):(i(n,"<>",t,D,{isNewLine:g,isHashtagScript:y,isThreads:A}),T=`^${T}`,i(n,T,t,D,{isNewLine:g,isHashtagScript:y,isThreads:A}));}g=false;}}else h.push(r);else if(typeof r=="string")if(r.startsWith("^"))i(n,r,t,D,{isNewLine:g,isHashtagScript:y,isThreads:A}),g=false;else if(r=="ev")F=true;else if(r==`
|
|
18
18
|
`)g=true;else if(r=="done"||r=="end")i(n,r,t,D,{isNewLine:g,isHashtagScript:y,isThreads:A}),g=false;else if(r=="<>")i(n,r,t,D,{isNewLine:g,isHashtagScript:y,isThreads:A}),g=false;else if(r=="nop"&&m){let p=jt(B,l,d$1,t,u,D,c);p&&i(n,p,t,D,{isNewLine:g,isHashtagScript:y,isThreads:A}),m=false,B=[];}else r=="#"?y=true:r=="thread"&&(A=true);else if(r instanceof Array)if(m)B.push(r);else if(r.length>1&&typeof r[r.length-2]=="object"&&r[r.length-2]&&"c"in r[r.length-2]&&typeof r[r.length-1]=="object"&&r[r.length-1]&&"b"in r[r.length-1]){h.pop();let p=[],E=[];for(;h.length>0&&h[h.length-1]!="/ev";)p.push(h.pop());B=[...B,...p.reverse()],m=true,E.push(r.pop()),E.push(r.pop()),B=[...B,...r],B.push(E);}else if(r.length>1&&typeof r[r.length-1]=="object"&&r[r.length-1]&&"#n"in r[r.length-1]){let p=r.pop();if(!p){d.error("Error parsing ink file: el is undefined");return}let E=p["#n"];delete p["#n"],r.push(p),i(n,{"->":t?t+"_|_"+E:E},t,D,{isNewLine:g,isHashtagScript:y,isThreads:A}),d$1({[E]:r},t,u);}else ae(r,t,u,n,i,l,d$1,C,c,g,D);else if(r&&typeof r=="object")if("->"in r&&typeof r["->"]=="string"&&!new RegExp(/^\.\^\.\^\.\d\.s$/).test(r["->"])){let p=[];h.length>0&&(p=Lt(["ev",...h],t,D)),r.params=p,i(n,r,t,D,{isNewLine:g,isHashtagScript:y,isThreads:A}),g=false;}else if("*"in r&&typeof r["*"]=="string")r["*"].includes("c")&&(h.push(r),g=false);else if("s"in r&&r.s instanceof Array)h.push(r),g=false;else if("CNT?"in r)h.push(r),g=false;else if("VAR="in r||"temp="in r){let p=[],E=it("VAR="in r?r["VAR="]:r["temp="],D,void 0,"VAR="in r?"storage":"tempstorage");if(E.key!=="$r"){for(h.pop(),h[h.length-1]=="/ev"&&h.pop();h.length>0&&h[h.length-1]!="/ev";)p.push(h.pop());p=p.reverse(),E.value=je(p,t,D),h=[],(E.value!==void 0||E.value!==null)&&i(n,E,t,D,{isNewLine:g,isHashtagScript:y,isThreads:A}),g=false;}}else d$1(r,t,u);}),C(h,n,t,u,D),t.includes("_|_")&&n.length==2){let r=n[0],s=n[1];r&&s&&typeof r=="object"&&"dialogue"in r&&typeof s=="object"&&"labelToOpen"in s&&r.dialogue==" "&&s.labelToOpen&&(n.shift(),delete s.glueEnabled,n[0]=s);}}function It(e){try{let t={};return $t(e,t),t}catch(t){d.error("Error parsing ink file",t);}}function $t(e,t,u={externalSwitch:void 0}){for(let n of e)if(n)if(n instanceof Array)if(n.includes("visit")){let i=Ae(n,Re,(l,d,C)=>{},"",{preDialog:{}},[]);i&&(u.externalSwitch=i);}else $t(n,t,u);else typeof n=="object"&&(n&&"VAR="in n&&u.externalSwitch&&(t[oe]||(t[oe]=[]),t[oe].push({operations:[{type:"value",value:u.externalSwitch,key:n["VAR="],storageType:"storage",storageOperationType:"set"}]})),Ht(n,t));}function Ht(e,t,u="",n={preDialog:{}}){if(e!==null){for(let[i,l]of Object.entries(e))if(l instanceof Array){let d=[],C={},c=(u?u+"_|_":"")+i;ae(l,c,n,d,at,at,(g,D,F)=>{Ht(g,C,D,F);},Ee);for(let[g,D]of Object.entries(C))t[g]=D;d.length>0&&(t[c]=d);}}}function Ie(e){let{json:t,labelToRemove:u,issues:n,initialVarsToRemove:i}=f$1(e);if(n.forEach(({message:d$1,type:C})=>{C===Dt.ErrorType.Error?d.error("Ink compilation error: "+d$1):C===Dt.ErrorType.Warning?d.warn("Ink compilation warning: "+d$1):d.info("Ink compilation info: "+d$1);}),!t){d.error("No JSON generated from ink file");return}let l;try{l=Je.parse(t);}catch{d.error("Error parsing ink file");return}return zt(l,{labelToRemove:u,initialVarsToRemove:i})}function zt(e,t={}){let{labelToRemove:u=[],initialVarsToRemove:n=[]}=t,i={};if(i.labels=It(e.root),i.labels&&_e in i.labels){let l=i.labels[_e];delete i.labels[_e],l.forEach(d=>{d.operations&&(i.initialOperations=i.initialOperations?[...i.initialOperations,...d.operations]:[...d.operations]);});}if(i.labels&&oe in i.labels){let l=i.labels[oe];delete i.labels[oe],l.forEach(d=>{d.operations&&(i.initialOperations=i.initialOperations?[...i.initialOperations,...d.operations]:[...d.operations]);});}return u.forEach(l=>{i.labels&&l in i.labels&&delete i.labels[l];}),n.forEach(l=>{i.initialOperations&&(i.initialOperations=i.initialOperations.filter(d=>!(d.type==="value"&&d.key===l)));}),i}async function Cn(e){Array.isArray(e)||(e=[e]),Qe({getLogichValue:(u,n)=>Le.getLogichValue(u,n)});let t=e.map(async u=>{let n=Ie(u);return n&&await qe(n,{operationStringConvert:he.run,skipEmptyDialogs:true}),u});return await Promise.all(t)}async function An(e){return Qe({getLogichValue:(t,u)=>Le.getLogichValue(t,u)}),await qe(e,{operationStringConvert:he.run,skipEmptyDialogs:true})}function En(e){I.afterToTranslate=t=>ft(t,e);}function Fn(e){I.beforeToTranslate=t=>ft(t,e);}function ft(e,t){let u=e.match(/\[([^\]]+)\]/);if(u){let n=u[1],i=t(n);return i&&(e=e.replaceAll(u[0],i)),ft(e,t)}return e}function yn(e){I.translate=e;}async function mn(e,t={},u={}){let n=[];return e.labels&&Object.values(e.labels).forEach(i=>{n=n.concat(i);}),await I.generateJsonTranslation(n,t,{...u,operationStringConvert:he.run})}export{he as a,Dn as b,Le as c,Ie as d,zt as e,Cn as f,An as g,En as h,Fn as i,yn as j,mn as k};
|