@drincs/pixi-vn-json 1.0.11 → 1.0.13

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.
Files changed (57) hide show
  1. package/dist/classes/LabelJson.cjs +2 -2
  2. package/dist/classes/LabelJson.d.cts +4 -3
  3. package/dist/classes/LabelJson.d.ts +4 -3
  4. package/dist/classes/LabelJson.js +2 -2
  5. package/dist/classes/index.cjs +2 -2
  6. package/dist/classes/index.d.cts +3 -2
  7. package/dist/classes/index.d.ts +3 -2
  8. package/dist/classes/index.js +2 -2
  9. package/dist/functions/importer.cjs +2 -2
  10. package/dist/functions/importer.d.cts +3 -2
  11. package/dist/functions/importer.d.ts +3 -2
  12. package/dist/functions/importer.js +2 -2
  13. package/dist/functions/index.cjs +2 -2
  14. package/dist/functions/index.d.cts +3 -2
  15. package/dist/functions/index.d.ts +3 -2
  16. package/dist/functions/index.js +2 -2
  17. package/dist/functions/operation-utility.cjs +2 -2
  18. package/dist/functions/operation-utility.d.cts +3 -2
  19. package/dist/functions/operation-utility.d.ts +3 -2
  20. package/dist/functions/operation-utility.js +2 -2
  21. package/dist/functions/utility.cjs +1 -1
  22. package/dist/functions/utility.d.cts +4 -3
  23. package/dist/functions/utility.d.ts +4 -3
  24. package/dist/functions/utility.js +1 -1
  25. package/dist/index.cjs +2 -2
  26. package/dist/index.d.cts +2 -1
  27. package/dist/index.d.ts +2 -1
  28. package/dist/index.js +2 -2
  29. package/dist/interface/PixiVNJson.d.cts +2 -1
  30. package/dist/interface/PixiVNJson.d.ts +2 -1
  31. package/dist/interface/PixiVNJsonCanvas.d.cts +43 -0
  32. package/dist/interface/PixiVNJsonCanvas.d.ts +43 -0
  33. package/dist/interface/PixiVNJsonLabelStep.d.cts +4 -3
  34. package/dist/interface/PixiVNJsonLabelStep.d.ts +4 -3
  35. package/dist/interface/PixiVNJsonLabels.d.cts +3 -2
  36. package/dist/interface/PixiVNJsonLabels.d.ts +3 -2
  37. package/dist/interface/PixiVNJsonOperations.d.cts +3 -2
  38. package/dist/interface/PixiVNJsonOperations.d.ts +3 -2
  39. package/dist/interface/PixiVNJsonSound.cjs +1 -0
  40. package/dist/interface/PixiVNJsonSound.d.cts +34 -0
  41. package/dist/interface/PixiVNJsonSound.d.ts +34 -0
  42. package/dist/interface/PixiVNJsonSound.js +0 -0
  43. package/dist/interface/index.d.cts +2 -1
  44. package/dist/interface/index.d.ts +2 -1
  45. package/dist/managers/TranslateManager.cjs +1 -1
  46. package/dist/managers/TranslateManager.d.cts +3 -2
  47. package/dist/managers/TranslateManager.d.ts +3 -2
  48. package/dist/managers/TranslateManager.js +1 -1
  49. package/dist/managers/index.cjs +1 -1
  50. package/dist/managers/index.d.cts +3 -2
  51. package/dist/managers/index.d.ts +3 -2
  52. package/dist/managers/index.js +1 -1
  53. package/package.json +2 -2
  54. package/dist/interface/PixiVNJsonMedia.d.cts +0 -67
  55. package/dist/interface/PixiVNJsonMedia.d.ts +0 -67
  56. /package/dist/interface/{PixiVNJsonMedia.cjs → PixiVNJsonCanvas.cjs} +0 -0
  57. /package/dist/interface/{PixiVNJsonMedia.js → PixiVNJsonCanvas.js} +0 -0
package/dist/index.js CHANGED
@@ -1,3 +1,3 @@
1
- import {LabelAbstract,NarrationManagerStatic,createExportableElement,getFlag,storage,setFlag,narration,canvas,CanvasVideo,zoomIn,moveIn,showWithDissolveTransition,showWithFadeTransition,showVideo,showImage,sound,ChoiceMenuOption,StorageManagerStatic,saveLabel}from'@drincs/pixi-vn';var ae=Object.create;var K=Object.defineProperty;var se=Object.getOwnPropertyDescriptor;var le=Object.getOwnPropertyNames;var fe=Object.getPrototypeOf,ce=Object.prototype.hasOwnProperty;var M=(i=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(i,{get:(t,e)=>(typeof require<"u"?require:t)[e]}):i)(function(i){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+i+'" is not supported')});var U=(i,t)=>()=>(t||i((t={exports:{}}).exports,t),t.exports);var ue=(i,t,e,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of le(t))!ce.call(i,o)&&o!==e&&K(i,o,{get:()=>t[o],enumerable:!(r=se(t,o))||r.enumerable});return i};var pe=(i,t,e)=>(e=i!=null?ae(fe(i)):{},ue(K(e,"default",{value:i,enumerable:!0}),i));var q=U((I,X)=>{(function(i,t){typeof I=="object"?X.exports=I=t():typeof define=="function"&&define.amd?define([],t):i.CryptoJS=t();})(I,function(){var i=i||function(t,e){var r;if(typeof window<"u"&&window.crypto&&(r=window.crypto),typeof self<"u"&&self.crypto&&(r=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(r=globalThis.crypto),!r&&typeof window<"u"&&window.msCrypto&&(r=window.msCrypto),!r&&typeof global<"u"&&global.crypto&&(r=global.crypto),!r&&typeof M=="function")try{r=M("crypto");}catch{}var o=function(){if(r){if(typeof r.getRandomValues=="function")try{return r.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof r.randomBytes=="function")try{return r.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},s=Object.create||function(){function n(){}return function(a){var u;return n.prototype=a,u=new n,n.prototype=null,u}}(),c={},y=c.lib={},d=y.Base=function(){return {extend:function(n){var a=s(this);return n&&a.mixIn(n),(!a.hasOwnProperty("init")||this.init===a.init)&&(a.init=function(){a.$super.init.apply(this,arguments);}),a.init.prototype=a,a.$super=this,a},create:function(){var n=this.extend();return n.init.apply(n,arguments),n},init:function(){},mixIn:function(n){for(var a in n)n.hasOwnProperty(a)&&(this[a]=n[a]);n.hasOwnProperty("toString")&&(this.toString=n.toString);},clone:function(){return this.init.prototype.extend(this)}}}(),p=y.WordArray=d.extend({init:function(n,a){n=this.words=n||[],a!=e?this.sigBytes=a:this.sigBytes=n.length*4;},toString:function(n){return (n||g).stringify(this)},concat:function(n){var a=this.words,u=n.words,m=this.sigBytes,b=n.sigBytes;if(this.clamp(),m%4)for(var N=0;N<b;N++){var H=u[N>>>2]>>>24-N%4*8&255;a[m+N>>>2]|=H<<24-(m+N)%4*8;}else for(var S=0;S<b;S+=4)a[m+S>>>2]=u[S>>>2];return this.sigBytes+=b,this},clamp:function(){var n=this.words,a=this.sigBytes;n[a>>>2]&=4294967295<<32-a%4*8,n.length=t.ceil(a/4);},clone:function(){var n=d.clone.call(this);return n.words=this.words.slice(0),n},random:function(n){for(var a=[],u=0;u<n;u+=4)a.push(o());return new p.init(a,n)}}),l=c.enc={},g=l.Hex={stringify:function(n){for(var a=n.words,u=n.sigBytes,m=[],b=0;b<u;b++){var N=a[b>>>2]>>>24-b%4*8&255;m.push((N>>>4).toString(16)),m.push((N&15).toString(16));}return m.join("")},parse:function(n){for(var a=n.length,u=[],m=0;m<a;m+=2)u[m>>>3]|=parseInt(n.substr(m,2),16)<<24-m%8*4;return new p.init(u,a/2)}},h=l.Latin1={stringify:function(n){for(var a=n.words,u=n.sigBytes,m=[],b=0;b<u;b++){var N=a[b>>>2]>>>24-b%4*8&255;m.push(String.fromCharCode(N));}return m.join("")},parse:function(n){for(var a=n.length,u=[],m=0;m<a;m++)u[m>>>2]|=(n.charCodeAt(m)&255)<<24-m%4*8;return new p.init(u,a)}},T=l.Utf8={stringify:function(n){try{return decodeURIComponent(escape(h.stringify(n)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(n){return h.parse(unescape(encodeURIComponent(n)))}},x=y.BufferedBlockAlgorithm=d.extend({reset:function(){this._data=new p.init,this._nDataBytes=0;},_append:function(n){typeof n=="string"&&(n=T.parse(n)),this._data.concat(n),this._nDataBytes+=n.sigBytes;},_process:function(n){var a,u=this._data,m=u.words,b=u.sigBytes,N=this.blockSize,H=N*4,S=b/H;n?S=t.ceil(S):S=t.max((S|0)-this._minBufferSize,0);var k=S*N,z=t.min(k*4,b);if(k){for(var F=0;F<k;F+=N)this._doProcessBlock(m,F);a=m.splice(0,k),u.sigBytes-=z;}return new p.init(a,z)},clone:function(){var n=d.clone.call(this);return n._data=this._data.clone(),n},_minBufferSize:0});y.Hasher=x.extend({cfg:d.extend(),init:function(n){this.cfg=this.cfg.extend(n),this.reset();},reset:function(){x.reset.call(this),this._doReset();},update:function(n){return this._append(n),this._process(),this},finalize:function(n){n&&this._append(n);var a=this._doFinalize();return a},blockSize:512/32,_createHelper:function(n){return function(a,u){return new n.init(u).finalize(a)}},_createHmacHelper:function(n){return function(a,u){return new V.HMAC.init(n,u).finalize(a)}}});var V=c.algo={};return c}(Math);return i});});var Q=U((D,Y)=>{(function(i,t){typeof D=="object"?Y.exports=D=t(q()):typeof define=="function"&&define.amd?define(["./core"],t):t(i.CryptoJS);})(D,function(i){return function(){var t=i,e=t.lib,r=e.WordArray,o=e.Hasher,s=t.algo,c=[],y=s.SHA1=o.extend({_doReset:function(){this._hash=new r.init([1732584193,4023233417,2562383102,271733878,3285377520]);},_doProcessBlock:function(d,p){for(var l=this._hash.words,g=l[0],h=l[1],T=l[2],x=l[3],C=l[4],V=0;V<80;V++){if(V<16)c[V]=d[p+V]|0;else {var n=c[V-3]^c[V-8]^c[V-14]^c[V-16];c[V]=n<<1|n>>>31;}var a=(g<<5|g>>>27)+C+c[V];V<20?a+=(h&T|~h&x)+1518500249:V<40?a+=(h^T^x)+1859775393:V<60?a+=(h&T|h&x|T&x)-1894007588:a+=(h^T^x)-899497514,C=x,x=T,T=h<<30|h>>>2,h=g,g=a;}l[0]=l[0]+g|0,l[1]=l[1]+h|0,l[2]=l[2]+T|0,l[3]=l[3]+x|0,l[4]=l[4]+C|0;},_doFinalize:function(){var d=this._data,p=d.words,l=this._nDataBytes*8,g=d.sigBytes*8;return p[g>>>5]|=128<<24-g%32,p[(g+64>>>9<<4)+14]=Math.floor(l/4294967296),p[(g+64>>>9<<4)+15]=l,d.sigBytes=p.length*4,this._process(),this._hash},clone:function(){var d=o.clone.call(this);return d._hash=this._hash.clone(),d}});t.SHA1=o._createHelper(y),t.HmacSHA1=o._createHmacHelper(y);}(),i.SHA1});});var oe=pe(Q());var E="___param___";var P=class i{static _beforeToTranslate=void 0;static _translate=t=>t;static _afterToTranslate=void 0;static t(t){return Array.isArray(t)?t.map(e=>i.translate(`${e}`)):i.translate(`${t}`)}static set beforeToTranslate(t){i._beforeToTranslate=t;}static set translate(t){i._translate=t;}static get translate(){return t=>{let e="";return i._beforeToTranslate&&(e=i._beforeToTranslate(t)),e=i._translate(e),i._afterToTranslate&&(e=i._afterToTranslate(e)),e}}static set afterToTranslate(t){i._afterToTranslate=t;}static addKey(t,e,r){let o=r.defaultValue||"empty_string";typeof e=="string"&&(e=[e]),Array.isArray(e)&&e.forEach(s=>{t[s]===void 0&&(o==="empty_string"?t[s]="":o==="copy_key"&&(i._beforeToTranslate?t[s]=i._beforeToTranslate(s):t[s]=s));});}static getConditionalsThenElse(t,e=[]){if(typeof t=="object"&&t&&"type"in t)if(t.type==="ifelse")t.then&&i.getConditionalsThenElse(t.then,e),t.else&&i.getConditionalsThenElse(t.else,e);else if(t.type==="stepswitch"){if(t.elements)if(Array.isArray(t.elements))t.elements.forEach(r=>{i.getConditionalsThenElse(r,e);});else if(t.elements.type==="ifelse"){let r=[];i.getConditionalsThenElse(t.elements,r),r.forEach(o=>{e.push(...o);});}else if(t.elements.type==="stepswitch"){let r=[];i.getConditionalsThenElse(t.elements,r),r.forEach(o=>{e.push(...o);});}else i.getConditionalsThenElse(t.elements,e);}else t.type==="resulttocombine"?(t.firstItem&&i.getConditionalsThenElse(t.firstItem,e),t.secondConditionalItem&&t.secondConditionalItem.forEach(r=>{i.getConditionalsThenElse(r,e);})):e.push(t);else t&&e.push(t);return e}static generateJsonTranslation(t,e={},r={}){return t.forEach(o=>{if(o.choices){let s=[];Array.isArray(o.choices)?s=[o.choices]:s=i.getConditionalsThenElse(o.choices),s.forEach(c=>c.forEach(y=>{if("type"in y){let d=[];y.type==="ifelse"||y.type==="stepswitch"?i.getConditionalsThenElse(y,d):d=[y],d.map(l=>i.getConditionalsThenElse(l.text)).forEach(l=>{Array.isArray(l)&&l.forEach(g=>{Array.isArray(g)?g.forEach(h=>{typeof h=="string"?i.addKey(e,h,r):i.getConditionalsThenElse(h).forEach(T=>{Array.isArray(T)?T.forEach(x=>{typeof x=="string"&&i.addKey(e,x,r);}):typeof T=="string"&&i.addKey(e,T,r);});}):typeof g=="string"&&i.addKey(e,g,r);});});}}));}if(o.dialogue){let s=[];Array.isArray(o.dialogue)?s=[o.dialogue]:s=i.getConditionalsThenElse(o.dialogue),s.forEach(c=>{typeof c=="string"?i.addKey(e,c,r):"text"in c&&Array.isArray(c.text)&&c.text.forEach(y=>{typeof y=="string"?i.addKey(e,y,r):i.getConditionalsThenElse(y).forEach(p=>{typeof p=="string"?i.addKey(e,p,r):Array.isArray(p)&&p.forEach(l=>{typeof l=="string"?i.addKey(e,l,r):i.getConditionalsThenElse(l).forEach(g=>{typeof g=="string"&&i.addKey(e,g,r);});});});});});}o.conditionalStep&&i.getConditionalsThenElse(o.conditionalStep).forEach(c=>{Array.isArray(c)?i.generateJsonTranslation(c,e,r):i.generateJsonTranslation([c],e,r);});}),e}};var R=P;function ge(i,t){return Math.floor(Math.random()*(t-i+1)+i)}function ye(i){if(Array.isArray(i)||!i)return i;if(i&&typeof i=="object"&&"type"in i)switch(i.type){case"resulttocombine":return he(i);case"ifelse":return f(i.condition)?f(i.then):f(i.else);case"stepswitch":let e=f(i.elements)||[];if(e.length===0){console.error("[Pixi\u2019VN Json] getValueFromConditionalStatements elements.length === 0");return}switch(i.choiceType){case"random":let r=ge(0,e.length-1);return f(e[r]);case"loop":let o=NarrationManagerStatic.getCurrentStepTimesCounter(i.nestedId)-1;return o>e.length-1&&(o=o%e.length),f(e[o]);case"sequential":let s,c=NarrationManagerStatic.getCurrentStepTimesCounter(i.nestedId)-1;return i.end=="lastItem"&&(s=f(e[e.length-1])),c>e.length-1?s:f(e[c]);case"sequentialrandom":let y=NarrationManagerStatic.getRandomNumber(0,e.length-1,{nestedId:i.nestedId,onceOnly:!0});if(y==null&&i.end=="lastItem"){let d=NarrationManagerStatic.getCurrentStepTimesCounterData(i.nestedId);if(!d||!d?.usedRandomNumbers){console.warn("[Pixi\u2019VN Json] getValueFromConditionalStatements randomIndexWhitExclude == undefined");return}let p=d.usedRandomNumbers[`0-${e.length-1}`];return f(e[p[p.length-1]])}if(y==null){console.warn("[Pixi\u2019VN Json] getValueFromConditionalStatements randomIndexWhitExclude == undefined");return}return f(e[y])}}return i}function G(i){if(i.conditionalStep){let t=createExportableElement(f(i.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 e={...i,conditionalStep:void 0,...t};return G(e)}else getFlag(storage.keysSystem.ADD_NEXT_DIALOG_TEXT_INTO_THE_CURRENT_DIALOG_FLAG_KEY)&&setFlag(storage.keysSystem.ADD_NEXT_DIALOG_TEXT_INTO_THE_CURRENT_DIALOG_FLAG_KEY,!1);}return i}function he(i){let t=i.firstItem,e=[];i.secondConditionalItem?.forEach(o=>{if(Array.isArray(o))o.forEach(s=>{let c=f(s);e.push(c);});else {let s=f(o);e.push(s);}});let r=t?[t,...e]:e;if(r.length===0){console.warn("[Pixi\u2019VN Json] combinateResult toCheck.length === 0");return}if(typeof r[0]=="string")return R.t(r).join("");if(typeof r[0]=="object"){let o=r,s,c=o.map((n,a)=>{n=G(n);let u=f(n.dialogue)||"";return a===0?(s=f(n.glueEnabled)||!1,u):(typeof u=="object"&&"text"in u&&(u=u.character+": "+u.text),s===!1&&(u=`
1
+ import {storage,narration,setFlag,LabelAbstract,ChoiceMenuOption,StorageManagerStatic,saveLabel,NarrationManagerStatic,createExportableElement,getFlag,canvas,CanvasVideo,zoomIn,moveIn,showWithDissolveTransition,showWithFadeTransition,CanvasImage,Assets,sound}from'@drincs/pixi-vn';var oe=Object.create;var K=Object.defineProperty;var se=Object.getOwnPropertyDescriptor;var le=Object.getOwnPropertyNames;var fe=Object.getPrototypeOf,ce=Object.prototype.hasOwnProperty;var M=(i=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(i,{get:(t,e)=>(typeof require<"u"?require:t)[e]}):i)(function(i){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+i+'" is not supported')});var U=(i,t)=>()=>(t||i((t={exports:{}}).exports,t),t.exports);var ue=(i,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of le(t))!ce.call(i,a)&&a!==e&&K(i,a,{get:()=>t[a],enumerable:!(n=se(t,a))||n.enumerable});return i};var pe=(i,t,e)=>(e=i!=null?oe(fe(i)):{},ue(K(e,"default",{value:i,enumerable:!0}),i));var q=U((I,X)=>{(function(i,t){typeof I=="object"?X.exports=I=t():typeof define=="function"&&define.amd?define([],t):i.CryptoJS=t();})(I,function(){var i=i||function(t,e){var n;if(typeof window<"u"&&window.crypto&&(n=window.crypto),typeof self<"u"&&self.crypto&&(n=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(n=globalThis.crypto),!n&&typeof window<"u"&&window.msCrypto&&(n=window.msCrypto),!n&&typeof global<"u"&&global.crypto&&(n=global.crypto),!n&&typeof M=="function")try{n=M("crypto");}catch{}var a=function(){if(n){if(typeof n.getRandomValues=="function")try{return n.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof n.randomBytes=="function")try{return n.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},s=Object.create||function(){function r(){}return function(o){var u;return r.prototype=o,u=new r,r.prototype=null,u}}(),c={},y=c.lib={},d=y.Base=function(){return {extend:function(r){var o=s(this);return r&&o.mixIn(r),(!o.hasOwnProperty("init")||this.init===o.init)&&(o.init=function(){o.$super.init.apply(this,arguments);}),o.init.prototype=o,o.$super=this,o},create:function(){var r=this.extend();return r.init.apply(r,arguments),r},init:function(){},mixIn:function(r){for(var o in r)r.hasOwnProperty(o)&&(this[o]=r[o]);r.hasOwnProperty("toString")&&(this.toString=r.toString);},clone:function(){return this.init.prototype.extend(this)}}}(),p=y.WordArray=d.extend({init:function(r,o){r=this.words=r||[],o!=e?this.sigBytes=o:this.sigBytes=r.length*4;},toString:function(r){return (r||g).stringify(this)},concat:function(r){var o=this.words,u=r.words,m=this.sigBytes,b=r.sigBytes;if(this.clamp(),m%4)for(var N=0;N<b;N++){var H=u[N>>>2]>>>24-N%4*8&255;o[m+N>>>2]|=H<<24-(m+N)%4*8;}else for(var S=0;S<b;S+=4)o[m+S>>>2]=u[S>>>2];return this.sigBytes+=b,this},clamp:function(){var r=this.words,o=this.sigBytes;r[o>>>2]&=4294967295<<32-o%4*8,r.length=t.ceil(o/4);},clone:function(){var r=d.clone.call(this);return r.words=this.words.slice(0),r},random:function(r){for(var o=[],u=0;u<r;u+=4)o.push(a());return new p.init(o,r)}}),l=c.enc={},g=l.Hex={stringify:function(r){for(var o=r.words,u=r.sigBytes,m=[],b=0;b<u;b++){var N=o[b>>>2]>>>24-b%4*8&255;m.push((N>>>4).toString(16)),m.push((N&15).toString(16));}return m.join("")},parse:function(r){for(var o=r.length,u=[],m=0;m<o;m+=2)u[m>>>3]|=parseInt(r.substr(m,2),16)<<24-m%8*4;return new p.init(u,o/2)}},h=l.Latin1={stringify:function(r){for(var o=r.words,u=r.sigBytes,m=[],b=0;b<u;b++){var N=o[b>>>2]>>>24-b%4*8&255;m.push(String.fromCharCode(N));}return m.join("")},parse:function(r){for(var o=r.length,u=[],m=0;m<o;m++)u[m>>>2]|=(r.charCodeAt(m)&255)<<24-m%4*8;return new p.init(u,o)}},T=l.Utf8={stringify:function(r){try{return decodeURIComponent(escape(h.stringify(r)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(r){return h.parse(unescape(encodeURIComponent(r)))}},x=y.BufferedBlockAlgorithm=d.extend({reset:function(){this._data=new p.init,this._nDataBytes=0;},_append:function(r){typeof r=="string"&&(r=T.parse(r)),this._data.concat(r),this._nDataBytes+=r.sigBytes;},_process:function(r){var o,u=this._data,m=u.words,b=u.sigBytes,N=this.blockSize,H=N*4,S=b/H;r?S=t.ceil(S):S=t.max((S|0)-this._minBufferSize,0);var k=S*N,z=t.min(k*4,b);if(k){for(var F=0;F<k;F+=N)this._doProcessBlock(m,F);o=m.splice(0,k),u.sigBytes-=z;}return new p.init(o,z)},clone:function(){var r=d.clone.call(this);return r._data=this._data.clone(),r},_minBufferSize:0});y.Hasher=x.extend({cfg:d.extend(),init:function(r){this.cfg=this.cfg.extend(r),this.reset();},reset:function(){x.reset.call(this),this._doReset();},update:function(r){return this._append(r),this._process(),this},finalize:function(r){r&&this._append(r);var o=this._doFinalize();return o},blockSize:512/32,_createHelper:function(r){return function(o,u){return new r.init(u).finalize(o)}},_createHmacHelper:function(r){return function(o,u){return new V.HMAC.init(r,u).finalize(o)}}});var V=c.algo={};return c}(Math);return i});});var Q=U((D,Y)=>{(function(i,t){typeof D=="object"?Y.exports=D=t(q()):typeof define=="function"&&define.amd?define(["./core"],t):t(i.CryptoJS);})(D,function(i){return function(){var t=i,e=t.lib,n=e.WordArray,a=e.Hasher,s=t.algo,c=[],y=s.SHA1=a.extend({_doReset:function(){this._hash=new n.init([1732584193,4023233417,2562383102,271733878,3285377520]);},_doProcessBlock:function(d,p){for(var l=this._hash.words,g=l[0],h=l[1],T=l[2],x=l[3],C=l[4],V=0;V<80;V++){if(V<16)c[V]=d[p+V]|0;else {var r=c[V-3]^c[V-8]^c[V-14]^c[V-16];c[V]=r<<1|r>>>31;}var o=(g<<5|g>>>27)+C+c[V];V<20?o+=(h&T|~h&x)+1518500249:V<40?o+=(h^T^x)+1859775393:V<60?o+=(h&T|h&x|T&x)-1894007588:o+=(h^T^x)-899497514,C=x,x=T,T=h<<30|h>>>2,h=g,g=o;}l[0]=l[0]+g|0,l[1]=l[1]+h|0,l[2]=l[2]+T|0,l[3]=l[3]+x|0,l[4]=l[4]+C|0;},_doFinalize:function(){var d=this._data,p=d.words,l=this._nDataBytes*8,g=d.sigBytes*8;return p[g>>>5]|=128<<24-g%32,p[(g+64>>>9<<4)+14]=Math.floor(l/4294967296),p[(g+64>>>9<<4)+15]=l,d.sigBytes=p.length*4,this._process(),this._hash},clone:function(){var d=a.clone.call(this);return d._hash=this._hash.clone(),d}});t.SHA1=a._createHelper(y),t.HmacSHA1=a._createHmacHelper(y);}(),i.SHA1});});var ae=pe(Q());var w="___param___";var P=class i{static _beforeToTranslate=void 0;static _translate=t=>t;static _afterToTranslate=void 0;static t(t){return Array.isArray(t)?t.map(e=>i.translate(`${e}`)):i.translate(`${t}`)}static set beforeToTranslate(t){i._beforeToTranslate=t;}static set translate(t){i._translate=t;}static get translate(){return t=>{let e=t;return i._beforeToTranslate&&(e=i._beforeToTranslate(e)),e=i._translate(e),i._afterToTranslate&&(e=i._afterToTranslate(e)),e}}static set afterToTranslate(t){i._afterToTranslate=t;}static addKey(t,e,n){let a=n.defaultValue||"empty_string";typeof e=="string"&&(e=[e]),Array.isArray(e)&&e.forEach(s=>{t[s]===void 0&&(a==="empty_string"?t[s]="":a==="copy_key"&&(i._beforeToTranslate?t[s]=i._beforeToTranslate(s):t[s]=s));});}static getConditionalsThenElse(t,e=[]){if(typeof t=="object"&&t&&"type"in t)if(t.type==="ifelse")t.then&&i.getConditionalsThenElse(t.then,e),t.else&&i.getConditionalsThenElse(t.else,e);else if(t.type==="stepswitch"){if(t.elements)if(Array.isArray(t.elements))t.elements.forEach(n=>{i.getConditionalsThenElse(n,e);});else if(t.elements.type==="ifelse"){let n=[];i.getConditionalsThenElse(t.elements,n),n.forEach(a=>{e.push(...a);});}else if(t.elements.type==="stepswitch"){let n=[];i.getConditionalsThenElse(t.elements,n),n.forEach(a=>{e.push(...a);});}else i.getConditionalsThenElse(t.elements,e);}else t.type==="resulttocombine"?(t.firstItem&&i.getConditionalsThenElse(t.firstItem,e),t.secondConditionalItem&&t.secondConditionalItem.forEach(n=>{i.getConditionalsThenElse(n,e);})):e.push(t);else t&&e.push(t);return e}static generateJsonTranslation(t,e={},n={}){return t.forEach(a=>{if(a.choices){let s=[];Array.isArray(a.choices)?s=[a.choices]:s=i.getConditionalsThenElse(a.choices),s.forEach(c=>c.forEach(y=>{if("type"in y){let d=[];y.type==="ifelse"||y.type==="stepswitch"?i.getConditionalsThenElse(y,d):d=[y],d.map(l=>i.getConditionalsThenElse(l.text)).forEach(l=>{Array.isArray(l)&&l.forEach(g=>{Array.isArray(g)?g.forEach(h=>{typeof h=="string"?i.addKey(e,h,n):i.getConditionalsThenElse(h).forEach(T=>{Array.isArray(T)?T.forEach(x=>{typeof x=="string"&&i.addKey(e,x,n);}):typeof T=="string"&&i.addKey(e,T,n);});}):typeof g=="string"&&i.addKey(e,g,n);});});}}));}if(a.dialogue){let s=[];Array.isArray(a.dialogue)?s=[a.dialogue]:s=i.getConditionalsThenElse(a.dialogue),s.forEach(c=>{typeof c=="string"?i.addKey(e,c,n):"text"in c&&Array.isArray(c.text)&&c.text.forEach(y=>{typeof y=="string"?i.addKey(e,y,n):i.getConditionalsThenElse(y).forEach(p=>{typeof p=="string"?i.addKey(e,p,n):Array.isArray(p)&&p.forEach(l=>{typeof l=="string"?i.addKey(e,l,n):i.getConditionalsThenElse(l).forEach(g=>{typeof g=="string"&&i.addKey(e,g,n);});});});});});}a.conditionalStep&&i.getConditionalsThenElse(a.conditionalStep).forEach(c=>{Array.isArray(c)?i.generateJsonTranslation(c,e,n):i.generateJsonTranslation([c],e,n);});}),e}};var R=P;function ge(i,t){return Math.floor(Math.random()*(t-i+1)+i)}function ye(i){if(Array.isArray(i)||!i)return i;if(i&&typeof i=="object"&&"type"in i)switch(i.type){case"resulttocombine":return he(i);case"ifelse":return f(i.condition)?f(i.then):f(i.else);case"stepswitch":let e=f(i.elements)||[];if(e.length===0){console.error("[Pixi\u2019VN Json] getValueFromConditionalStatements elements.length === 0");return}switch(i.choiceType){case"random":let n=ge(0,e.length-1);return f(e[n]);case"loop":let a=NarrationManagerStatic.getCurrentStepTimesCounter(i.nestedId)-1;return a>e.length-1&&(a=a%e.length),f(e[a]);case"sequential":let s,c=NarrationManagerStatic.getCurrentStepTimesCounter(i.nestedId)-1;return i.end=="lastItem"&&(s=f(e[e.length-1])),c>e.length-1?s:f(e[c]);case"sequentialrandom":let y=NarrationManagerStatic.getRandomNumber(0,e.length-1,{nestedId:i.nestedId,onceOnly:!0});if(y==null&&i.end=="lastItem"){let d=NarrationManagerStatic.getCurrentStepTimesCounterData(i.nestedId);if(!d||!d?.usedRandomNumbers){console.warn("[Pixi\u2019VN Json] getValueFromConditionalStatements randomIndexWhitExclude == undefined");return}let p=d.usedRandomNumbers[`0-${e.length-1}`];return f(e[p[p.length-1]])}if(y==null){console.warn("[Pixi\u2019VN Json] getValueFromConditionalStatements randomIndexWhitExclude == undefined");return}return f(e[y])}}return i}function G(i){if(i.conditionalStep){let t=createExportableElement(f(i.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 e={...i,conditionalStep:void 0,...t};return G(e)}else getFlag(storage.keysSystem.ADD_NEXT_DIALOG_TEXT_INTO_THE_CURRENT_DIALOG_FLAG_KEY)&&setFlag(storage.keysSystem.ADD_NEXT_DIALOG_TEXT_INTO_THE_CURRENT_DIALOG_FLAG_KEY,!1);}return i}function he(i){let t=i.firstItem,e=[];i.secondConditionalItem?.forEach(a=>{if(Array.isArray(a))a.forEach(s=>{let c=f(s);e.push(c);});else {let s=f(a);e.push(s);}});let n=t?[t,...e]:e;if(n.length===0){console.warn("[Pixi\u2019VN Json] combinateResult toCheck.length === 0");return}if(typeof n[0]=="string")return R.t(n).join("");if(typeof n[0]=="object"){let a=n,s,c=a.map((r,o)=>{r=G(r);let u=f(r.dialogue)||"";return o===0?(s=f(r.glueEnabled)||!1,u):(typeof u=="object"&&"text"in u&&(u=u.character+": "+u.text),s===!1&&(u=`
2
2
 
3
- `+u),s=f(n.glueEnabled)||!1,u)}),y=f(c[0]),d=typeof y=="object"&&"character"in y?y.character:void 0,p=c.map(n=>{let a;n&&typeof n=="object"&&"text"in n?a=n.text:a=n;let u;return Array.isArray(a)?u=a.map(m=>{let b=f(m);return R.t(`${b}`)}).join(""):u=f(a)||"",R.t(u)}).join(""),l=o.find(n=>n.end),g=o.find(n=>n.choices),h=!1,T=!1;o.length>0&&(o[0].glueEnabled&&o[0].goNextStep&&o[0].dialogue===void 0&&setFlag(storage.keysSystem.ADD_NEXT_DIALOG_TEXT_INTO_THE_CURRENT_DIALOG_FLAG_KEY,!0),h=o[o.length-1].glueEnabled,T=o.reverse().find(n=>!(n.operations&&(!n.dialogue||!n.choices)))?.goNextStep);let x=o.find(n=>n.labelToOpen),C=[];return o.forEach(n=>{n.operations&&C.forEach(a=>{C.push(a);});}),{dialogue:d?{character:d,text:p}:p,end:l?.end,choices:g?.choices,glueEnabled:h,goNextStep:T,labelToOpen:x?.labelToOpen,operations:C}}}function me(i){if(!i)return !1;if(typeof i!="object"||!("type"in i))return !!i;switch(i.type){case"compare":let t=f(i.leftValue),e=f(i.rightValue);switch(i.operator){case"==":return t===e;case"!=":return t!==e;case"<":return t<e;case"<=":return t<=e;case">":return t>e;case">=":return t>=e;case"CONTAINS":return t.toString().includes(e.toString())}break;case"valueCondition":return !!f(i.value);case"union":return Te(i)}return !!i}function xe(i){if(i&&typeof i=="object"&&"type"in i&&i.type==="value"&&i.storageOperationType==="get")switch(i.storageType){case"storage":case"tempstorage":return storage.getVariable(i.key);case"flagStorage":return getFlag(i.key);case"label":return narration.getTimesLabelOpened(i.label);case"choice":return narration.getTimesChoiceMade(i.index);case"logic":return f(i.operation);case"params":let t=storage.getVariable(`${E}${narration.openedLabels.length-1}`)||[];if(t&&t.length>i.key)return t[i.key];console.warn("[Pixi\u2019VN Json] getValue params not found");return}return i}function Te(i){if(i.unionType==="not")return !f(i.condition);let t=i.unionType==="and";for(let e=0;e<i.conditions.length;e++)if(t=f(i.conditions[e])||!1,i.unionType==="and"){if(!t)return !1}else if(t)return !0;return t}function j(i){let t=f(i.value),e;switch(t&&typeof t=="object"&&"type"in t?e=f(t):e=t,i.storageType){case"flagStorage":setFlag(i.key,i.value);break;case"storage":storage.setVariable(i.key,e);break;case"tempstorage":storage.setTempVariable(i.key,e);break;case"params":let r=storage.getVariable(`${E}${narration.openedLabels.length-1}`)||[];r&&r.length-1>=i.key&&(r[i.key]=e),storage.setTempVariable(`${E}${narration.openedLabels.length-1}`,r);break}}function f(i){let t=ye(i);if(t&&typeof t=="object"&&"type"in t)switch(t.type){case"value":return xe(t);case"arithmetic":case"arithmeticsingle":return be(t);case"compare":case"valueCondition":case"union":return me(t)}return t}function be(i){let t=f(i.leftValue);switch(i.type){case"arithmetic":let e=f(i.rightValue);switch(i.operator){case"*":return t*e;case"/":return t/e;case"+":return t+e;case"-":return t-e;case"%":return t%e;case"POW":return Math.pow(t,e);case"RANDOM":return narration.getRandomNumber(t,e)}case"arithmeticsingle":switch(i.operator){case"INT":return parseInt(t);case"FLOOR":return Math.floor(t);case"FLOAT":return parseFloat(t)}break}}async function L(i,t){let e=f(i);if(e)switch(e.type){case"sound":switch(e.operationType){case"add":sound.add(e.alias,{...e.props,url:e.url});break;case"play":sound.play(e.alias,e.props);break;case"remove":sound.remove(e.alias);break;case"pause":sound.pause(e.alias);break;case"resume":sound.resume(e.alias);break;case"volume":sound.volume(e.alias,e.value);break}break;case"image":switch(e.operationType){case"show":if(e.transition)switch(e.transition.type){case"fade":await showWithFadeTransition(e.alias,e.url,e.transition.props,e.transition.priority);break;case"dissolve":await showWithDissolveTransition(e.alias,e.url,e.transition.props,e.transition.priority);break;case"movein":case"moveout":await moveIn(e.alias,e.url,e.transition.props,e.transition.priority);break;case"zoomin":case"zoomout":await zoomIn(e.alias,e.url,e.transition.props,e.transition.priority);break}else await showImage(e.alias,e.url);break;case"edit":let r=canvas.find(e.alias);r?e.props&&(r.memory={...r.memory,...e.props}):console.error(`[Pixi\u2019VN Json] Image with alias ${e.alias} not found.`);break;case"remove":canvas.remove(e.alias);break}break;case"video":switch(e.operationType){case"show":if(e.transition){let c=new CanvasVideo;switch(c.videoLink=e.url,e.transition.type){case"fade":await showWithFadeTransition(e.alias,c,e.transition.props,e.transition.priority);break;case"dissolve":await showWithDissolveTransition(e.alias,c,e.transition.props,e.transition.priority);break;case"movein":case"moveout":await moveIn(e.alias,c,e.transition.props,e.transition.priority);break;case"zoomin":case"zoomout":await zoomIn(e.alias,c,e.transition.props,e.transition.priority);break}}else await showVideo(e.alias,e.url);break;case"edit":let r=canvas.find(e.alias);r?e.props&&(r.memory={...r.memory,...e.props}):console.error(`[Pixi\u2019VN Json] Video with alias ${e.alias} not found.`);break;case"remove":canvas.remove(e.alias);break;case"pause":let o=canvas.find(e.alias);o?o.paused=!0:console.error(`[Pixi\u2019VN Json] Video with alias ${e.alias} not found.`);break;case"resume":let s=canvas.find(e.alias);s?s.paused=!1:console.error(`[Pixi\u2019VN Json] Video with alias ${e.alias} not found.`);break}break;case"value":j(e);break;case"oprationtoconvert":if(t){let r="";e.values.forEach(s=>{if(typeof s=="string")r+=s;else {let c=f(s);r+=`${c}`;}});let o=await t(r);o&&await L(o,t);}break;case"input":switch(e.operationType){case"request":narration.requestInput({type:e.valueType});break}break}}var O=class extends LabelAbstract{constructor(t,e,r,o={}){super(t,r),this._steps=e,this.operationStringConvert=o.operationStringConvert,this.skipEmptyDialogs=o.skipEmptyDialogs||!1;}_steps;get steps(){return this._steps.map(t=>this.stepConverter(t))}operationStringConvert;skipEmptyDialogs=!1;getStepSha1(t){if(t<0||t>=this.steps.length)return;let e=this._steps[t];return (0, oe.default)(e.toString().toLocaleLowerCase()).toString()}getDialogueText(t){let e="";if(Array.isArray(t)){let r=[];t.forEach(o=>{if(typeof o=="string")r.push(o);else if(o&&typeof o=="object"){let s=f(o);s?(s&&!Array.isArray(s)&&typeof s=="object"&&(s=f(s)||""),Array.isArray(s)?r=r.concat(s):r.push(`${s}`)):r.push(`${o}`);}}),e=r;}else {let r=f(t)||"";r&&!Array.isArray(r)&&typeof r=="object"&&(r=f(r)||""),e=r;}return `${e}`}getDialogue(t){let e=f(t);if(e)return typeof e=="object"&&"character"in e&&"text"in e?{character:e.character,text:P.t(this.getDialogueText(e.text))}:P.t(this.getDialogueText(e));if(e!=null)return `${e}`}getChoices(t){return f(t)?.map(o=>f(o)).filter(o=>o!==void 0)}stepConverter(t){return async e=>{if(typeof t=="function"&&(t=t()),t=G(t),t.operations)for(let p of t.operations)await L(p,this.operationStringConvert?l=>this.operationStringConvert(l,e):void 0);let r=this.getChoices(t.choices),o=f(t.glueEnabled),s=this.getDialogue(t.dialogue),c=[];t.labelToOpen&&(Array.isArray(t.labelToOpen)||(t.labelToOpen=[t.labelToOpen]),t.labelToOpen.forEach(p=>{let l=f(p);l&&c.push(l);}));let y=f(t.goNextStep),d=f(t.end);if(r){let p=r.map(l=>{let g="";if(Array.isArray(l.text)){let h=[];l.text.forEach(T=>{if(typeof T=="string")h.push(P.t(T));else if(T&&typeof T=="object"){let x=f(T);x&&!Array.isArray(x)&&typeof x=="object"&&(x=f(x)||""),x&&(Array.isArray(x)?h=h.concat(P.t(x)):h.push(P.t(x)));}}),g=h.join();}else typeof l.text=="string"&&(g=P.t(l.text));return new ChoiceMenuOption(g,l.label,l.props,{type:l.type,oneTime:l.oneTime,onlyHaveNoChoice:l.onlyHaveNoChoice,autoSelect:l.autoSelect})});narration.choiceMenuOptions=p;}else narration.choiceMenuOptions=void 0;s!==void 0&&(narration.dialogue=s,this.skipEmptyDialogs&&typeof s=="string"&&(s===""||RegExp(/^\s+$/).test(s))&&(y=!0)),o?setFlag(storage.keysSystem.ADD_NEXT_DIALOG_TEXT_INTO_THE_CURRENT_DIALOG_FLAG_KEY,!0):o===!1&&setFlag(storage.keysSystem.ADD_NEXT_DIALOG_TEXT_INTO_THE_CURRENT_DIALOG_FLAG_KEY,!1);for(let p of c){let l=p.label;typeof l=="object"&&(l=f(l)||"");let g=p.params?.map(h=>f(h));e={...e,...p.props},p.type==="jump"?(narration.closeCurrentLabel(),storage.setTempVariable(`${E}${narration.openedLabels.length}`,g),await narration.callLabel(l,e)):(storage.setTempVariable(`${E}${narration.openedLabels.length}`,g),await narration.callLabel(l,e));}d==="game_end"?(narration.closeAllLabels(),await narration.goNext(e)):d==="label_end"&&narration.closeCurrentLabel(),y&&await narration.goNext(e);}}};function we(i,t={}){let e=t?.operationStringConvert;try{typeof i=="string"&&(i=JSON.parse(i));}catch(r){console.error("[Pixi\u2019VN Json] Error parsing imported Pixi'VN JSON",r);return}if(typeof i!="object"){console.error("[Pixi\u2019VN Json] Error parsing imported Pixi'VN JSON: data is not an object");return}if(i.initialOperations){for(let r of i.initialOperations)L(r,e?o=>e(o,{}):void 0);StorageManagerStatic.saveStorageAsBasicStorage();}if(i.labels){let r=i.labels;for(let o in r)try{let s=r[o],c=new O(o,s,void 0,t);saveLabel(c);}catch(s){console.error(`[Pixi\u2019VN Json] Error creating JSON label ${o}`,s);}}}export{O as LabelJson,E as PIXIVNJSON_PARAM_ID,f as geLogichValue,we as importPixiVNJson,j as setStorageJson,R as translator};
3
+ `+u),s=f(r.glueEnabled)||!1,u)}),y=f(c[0]),d=typeof y=="object"&&"character"in y?y.character:void 0,p=c.map(r=>{let o;r&&typeof r=="object"&&"text"in r?o=r.text:o=r;let u;return Array.isArray(o)?u=o.map(m=>{let b=f(m);return R.t(`${b}`)}).join(""):u=f(o)||"",R.t(u)}).join(""),l=a.find(r=>r.end),g=a.find(r=>r.choices),h=!1,T=!1;a.length>0&&(a[0].glueEnabled&&a[0].goNextStep&&a[0].dialogue===void 0&&setFlag(storage.keysSystem.ADD_NEXT_DIALOG_TEXT_INTO_THE_CURRENT_DIALOG_FLAG_KEY,!0),h=a[a.length-1].glueEnabled,T=a.reverse().find(r=>!(r.operations&&(!r.dialogue||!r.choices)))?.goNextStep);let x=a.find(r=>r.labelToOpen),C=[];return a.forEach(r=>{r.operations&&C.forEach(o=>{C.push(o);});}),{dialogue:d?{character:d,text:p}:p,end:l?.end,choices:g?.choices,glueEnabled:h,goNextStep:T,labelToOpen:x?.labelToOpen,operations:C}}}function me(i){if(!i)return !1;if(typeof i!="object"||!("type"in i))return !!i;switch(i.type){case"compare":let t=f(i.leftValue),e=f(i.rightValue);switch(i.operator){case"==":return t===e;case"!=":return t!==e;case"<":return t<e;case"<=":return t<=e;case">":return t>e;case">=":return t>=e;case"CONTAINS":return t.toString().includes(e.toString())}break;case"valueCondition":return !!f(i.value);case"union":return Te(i)}return !!i}function xe(i){if(i&&typeof i=="object"&&"type"in i&&i.type==="value"&&i.storageOperationType==="get")switch(i.storageType){case"storage":case"tempstorage":return storage.getVariable(i.key);case"flagStorage":return getFlag(i.key);case"label":return narration.getTimesLabelOpened(i.label);case"choice":return narration.getTimesChoiceMade(i.index);case"logic":return f(i.operation);case"params":let t=storage.getVariable(`${w}${narration.openedLabels.length-1}`)||[];if(t&&t.length>i.key)return t[i.key];console.warn("[Pixi\u2019VN Json] getValue params not found");return}return i}function Te(i){if(i.unionType==="not")return !f(i.condition);let t=i.unionType==="and";for(let e=0;e<i.conditions.length;e++)if(t=f(i.conditions[e])||!1,i.unionType==="and"){if(!t)return !1}else if(t)return !0;return t}function j(i){let t=f(i.value),e;switch(t&&typeof t=="object"&&"type"in t?e=f(t):e=t,i.storageType){case"flagStorage":setFlag(i.key,i.value);break;case"storage":storage.setVariable(i.key,e);break;case"tempstorage":storage.setTempVariable(i.key,e);break;case"params":let n=storage.getVariable(`${w}${narration.openedLabels.length-1}`)||[];n&&n.length-1>=i.key&&(n[i.key]=e),storage.setTempVariable(`${w}${narration.openedLabels.length-1}`,n);break}}function f(i){let t=ye(i);if(t&&typeof t=="object"&&"type"in t)switch(t.type){case"value":return xe(t);case"arithmetic":case"arithmeticsingle":return be(t);case"compare":case"valueCondition":case"union":return me(t)}return t}function be(i){let t=f(i.leftValue);switch(i.type){case"arithmetic":let e=f(i.rightValue);switch(i.operator){case"*":return t*e;case"/":return t/e;case"+":return t+e;case"-":return t-e;case"%":return t%e;case"POW":return Math.pow(t,e);case"RANDOM":return narration.getRandomNumber(t,e)}case"arithmeticsingle":switch(i.operator){case"INT":return parseInt(t);case"FLOOR":return Math.floor(t);case"FLOAT":return parseFloat(t)}break}}async function L(i,t){let e=f(i);if(e)switch(e.type){case"sound":switch(e.operationType){case"add":sound.add(e.alias,{...e.props,url:e.url});break;case"play":sound.play(e.alias,e.props);break;case"remove":sound.remove(e.alias);break;case"pause":sound.pause(e.alias);break;case"resume":sound.resume(e.alias);break;case"volume":sound.volume(e.alias,e.value);break}break;case"assets":switch(e.operationType){case"load":await Assets.load(e.assets);break}case"image":switch(e.operationType){case"show":let n=new CanvasImage(e.props,e.url);if(e.transition)switch(e.transition.type){case"fade":await showWithFadeTransition(e.alias,n,e.transition.props,e.transition.priority);break;case"dissolve":await showWithDissolveTransition(e.alias,n,e.transition.props,e.transition.priority);break;case"movein":case"moveout":await moveIn(e.alias,n,e.transition.props,e.transition.priority);break;case"zoomin":case"zoomout":await zoomIn(e.alias,n,e.transition.props,e.transition.priority);break}else canvas.add(e.alias,n),await n.load();break;case"edit":let a=canvas.find(e.alias);a?e.props&&(a.memory={...a.memory,...e.props}):console.error(`[Pixi\u2019VN Json] Image with alias ${e.alias} not found.`);break;case"remove":canvas.remove(e.alias);break}break;case"video":switch(e.operationType){case"show":let n=new CanvasVideo(e.props,e.url);if(e.transition)switch(e.transition.type){case"fade":await showWithFadeTransition(e.alias,n,e.transition.props,e.transition.priority);break;case"dissolve":await showWithDissolveTransition(e.alias,n,e.transition.props,e.transition.priority);break;case"movein":case"moveout":await moveIn(e.alias,n,e.transition.props,e.transition.priority);break;case"zoomin":case"zoomout":await zoomIn(e.alias,n,e.transition.props,e.transition.priority);break}else canvas.add(e.alias,n),await n.load();break;case"edit":let a=canvas.find(e.alias);a?e.props&&(a.memory={...a.memory,...e.props}):console.error(`[Pixi\u2019VN Json] Video with alias ${e.alias} not found.`);break;case"remove":canvas.remove(e.alias);break;case"pause":let s=canvas.find(e.alias);s?s.paused=!0:console.error(`[Pixi\u2019VN Json] Video with alias ${e.alias} not found.`);break;case"resume":let c=canvas.find(e.alias);c?c.paused=!1:console.error(`[Pixi\u2019VN Json] Video with alias ${e.alias} not found.`);break}break;case"value":j(e);break;case"oprationtoconvert":if(t){let n="";e.values.forEach(s=>{if(typeof s=="string")n+=s;else {let c=f(s);n+=`${c}`;}});let a=await t(n);a&&await L(a,t);}break;case"input":switch(e.operationType){case"request":narration.requestInput({type:e.valueType});break}break}}var O=class extends LabelAbstract{constructor(t,e,n,a={}){super(t,n),this._steps=e,this.operationStringConvert=a.operationStringConvert,this.skipEmptyDialogs=a.skipEmptyDialogs||!1;}_steps;get steps(){return this._steps.map(t=>this.stepConverter(t))}operationStringConvert;skipEmptyDialogs=!1;getStepSha1(t){if(t<0||t>=this.steps.length)return;let e=this._steps[t];return (0, ae.default)(e.toString().toLocaleLowerCase()).toString()}getDialogueText(t){let e="";if(Array.isArray(t)){let n=[];t.forEach(a=>{if(typeof a=="string")n.push(a);else if(a&&typeof a=="object"){let s=f(a);s?(s&&!Array.isArray(s)&&typeof s=="object"&&(s=f(s)||""),Array.isArray(s)?n=n.concat(s):n.push(`${s}`)):n.push(`${a}`);}}),e=n;}else {let n=f(t)||"";n&&!Array.isArray(n)&&typeof n=="object"&&(n=f(n)||""),e=n;}return `${e}`}getDialogue(t){let e=f(t);if(e)return typeof e=="object"&&"character"in e&&"text"in e?{character:e.character,text:P.t(this.getDialogueText(e.text))}:P.t(this.getDialogueText(e));if(e!=null)return `${e}`}getChoices(t){return f(t)?.map(a=>f(a)).filter(a=>a!==void 0)}stepConverter(t){return async e=>{if(typeof t=="function"&&(t=t()),t=G(t),t.operations)for(let p of t.operations)await L(p,this.operationStringConvert?l=>this.operationStringConvert(l,e):void 0);let n=this.getChoices(t.choices),a=f(t.glueEnabled),s=this.getDialogue(t.dialogue),c=[];t.labelToOpen&&(Array.isArray(t.labelToOpen)||(t.labelToOpen=[t.labelToOpen]),t.labelToOpen.forEach(p=>{let l=f(p);l&&c.push(l);}));let y=f(t.goNextStep),d=f(t.end);if(n){let p=n.map(l=>{let g="";if(Array.isArray(l.text)){let h=[];l.text.forEach(T=>{if(typeof T=="string")h.push(P.t(T));else if(T&&typeof T=="object"){let x=f(T);x&&!Array.isArray(x)&&typeof x=="object"&&(x=f(x)||""),x&&(Array.isArray(x)?h=h.concat(P.t(x)):h.push(P.t(x)));}}),g=h.join();}else typeof l.text=="string"&&(g=P.t(l.text));return new ChoiceMenuOption(g,l.label,l.props,{type:l.type,oneTime:l.oneTime,onlyHaveNoChoice:l.onlyHaveNoChoice,autoSelect:l.autoSelect})});narration.choiceMenuOptions=p;}else narration.choiceMenuOptions=void 0;s!==void 0&&(narration.dialogue=s,this.skipEmptyDialogs&&typeof s=="string"&&(s===""||RegExp(/^\s+$/).test(s))&&(y=!0)),a?setFlag(storage.keysSystem.ADD_NEXT_DIALOG_TEXT_INTO_THE_CURRENT_DIALOG_FLAG_KEY,!0):a===!1&&setFlag(storage.keysSystem.ADD_NEXT_DIALOG_TEXT_INTO_THE_CURRENT_DIALOG_FLAG_KEY,!1);for(let p of c){let l=p.label;typeof l=="object"&&(l=f(l)||"");let g=p.params?.map(h=>f(h));e={...e,...p.props},p.type==="jump"?(narration.closeCurrentLabel(),storage.setTempVariable(`${w}${narration.openedLabels.length}`,g),await narration.callLabel(l,e)):(storage.setTempVariable(`${w}${narration.openedLabels.length}`,g),await narration.callLabel(l,e));}d==="game_end"?(narration.closeAllLabels(),await narration.goNext(e)):d==="label_end"&&narration.closeCurrentLabel(),y&&await narration.goNext(e);}}};function Ee(i,t={}){let e=t?.operationStringConvert;try{typeof i=="string"&&(i=JSON.parse(i));}catch(n){console.error("[Pixi\u2019VN Json] Error parsing imported Pixi'VN JSON",n);return}if(typeof i!="object"){console.error("[Pixi\u2019VN Json] Error parsing imported Pixi'VN JSON: data is not an object");return}if(i.initialOperations){for(let n of i.initialOperations)L(n,e?a=>e(a,{}):void 0);StorageManagerStatic.saveStorageAsBasicStorage();}if(i.labels){let n=i.labels;for(let a in n)try{let s=n[a],c=new O(a,s,void 0,t);saveLabel(c);}catch(s){console.error(`[Pixi\u2019VN Json] Error creating JSON label ${a}`,s);}}}export{O as LabelJson,w as PIXIVNJSON_PARAM_ID,f as geLogichValue,Ee as importPixiVNJson,j as setStorageJson,R as translator};
@@ -1,10 +1,11 @@
1
1
  import PixiVNJsonLabels from './PixiVNJsonLabels.cjs';
2
2
  import PixiVNJsonOperations from './PixiVNJsonOperations.cjs';
3
3
  import '../PixiVNJsonConditionalStatements-CVkQSKpq.cjs';
4
+ import './PixiVNJsonCanvas.cjs';
4
5
  import './PixiVNJsonInput.cjs';
5
6
  import './PixiVNJsonLabelStep.cjs';
6
- import './PixiVNJsonMedia.cjs';
7
7
  import './PixiVNJsonMediaTransiotions.cjs';
8
+ import './PixiVNJsonSound.cjs';
8
9
  import '@drincs/pixi-vn';
9
10
  import 'pixi.js';
10
11
 
@@ -1,10 +1,11 @@
1
1
  import PixiVNJsonLabels from './PixiVNJsonLabels.js';
2
2
  import PixiVNJsonOperations from './PixiVNJsonOperations.js';
3
3
  import '../PixiVNJsonConditionalStatements-CVkQSKpq.js';
4
+ import './PixiVNJsonCanvas.js';
4
5
  import './PixiVNJsonInput.js';
5
6
  import './PixiVNJsonLabelStep.js';
6
- import './PixiVNJsonMedia.js';
7
7
  import './PixiVNJsonMediaTransiotions.js';
8
+ import './PixiVNJsonSound.js';
8
9
  import '@drincs/pixi-vn';
9
10
  import 'pixi.js';
10
11
 
@@ -0,0 +1,43 @@
1
+ import { CanvasImageMemory, CanvasVideoMemory } from '@drincs/pixi-vn';
2
+ import PixiVNJsonMediaTransiotions from './PixiVNJsonMediaTransiotions.cjs';
3
+ import 'pixi.js';
4
+
5
+ type PixiVNJsonCanvasShow = {
6
+ type: "image" | "video";
7
+ operationType: "show";
8
+ alias: string;
9
+ url: string;
10
+ props?: Partial<CanvasImageMemory>;
11
+ transition?: PixiVNJsonMediaTransiotions;
12
+ };
13
+ type PixiVNJsonImageEdit = {
14
+ type: "image";
15
+ operationType: "edit";
16
+ alias: string;
17
+ props?: Partial<CanvasImageMemory>;
18
+ };
19
+ type PixiVNJsonVideoEdit = {
20
+ type: "video";
21
+ operationType: "edit";
22
+ alias: string;
23
+ props?: Partial<CanvasVideoMemory>;
24
+ };
25
+ type PixiVNJsonCanvasRemove = {
26
+ type: "image" | "video";
27
+ operationType: "remove";
28
+ alias: string;
29
+ transition?: PixiVNJsonMediaTransiotions;
30
+ };
31
+ type PixiVNJsonVideoPauseResume = {
32
+ type: "video";
33
+ operationType: "pause" | "resume";
34
+ alias: string;
35
+ };
36
+ type PixiVNJsonAssetsLoad = {
37
+ type: "assets";
38
+ operationType: "load";
39
+ assets: string[];
40
+ };
41
+ type PixiVNJsonCanvas = (PixiVNJsonCanvasShow | PixiVNJsonImageEdit | PixiVNJsonVideoEdit | PixiVNJsonCanvasRemove | PixiVNJsonVideoPauseResume | PixiVNJsonAssetsLoad);
42
+
43
+ export type { PixiVNJsonCanvas as default };
@@ -0,0 +1,43 @@
1
+ import { CanvasImageMemory, CanvasVideoMemory } from '@drincs/pixi-vn';
2
+ import PixiVNJsonMediaTransiotions from './PixiVNJsonMediaTransiotions.js';
3
+ import 'pixi.js';
4
+
5
+ type PixiVNJsonCanvasShow = {
6
+ type: "image" | "video";
7
+ operationType: "show";
8
+ alias: string;
9
+ url: string;
10
+ props?: Partial<CanvasImageMemory>;
11
+ transition?: PixiVNJsonMediaTransiotions;
12
+ };
13
+ type PixiVNJsonImageEdit = {
14
+ type: "image";
15
+ operationType: "edit";
16
+ alias: string;
17
+ props?: Partial<CanvasImageMemory>;
18
+ };
19
+ type PixiVNJsonVideoEdit = {
20
+ type: "video";
21
+ operationType: "edit";
22
+ alias: string;
23
+ props?: Partial<CanvasVideoMemory>;
24
+ };
25
+ type PixiVNJsonCanvasRemove = {
26
+ type: "image" | "video";
27
+ operationType: "remove";
28
+ alias: string;
29
+ transition?: PixiVNJsonMediaTransiotions;
30
+ };
31
+ type PixiVNJsonVideoPauseResume = {
32
+ type: "video";
33
+ operationType: "pause" | "resume";
34
+ alias: string;
35
+ };
36
+ type PixiVNJsonAssetsLoad = {
37
+ type: "assets";
38
+ operationType: "load";
39
+ assets: string[];
40
+ };
41
+ type PixiVNJsonCanvas = (PixiVNJsonCanvasShow | PixiVNJsonImageEdit | PixiVNJsonVideoEdit | PixiVNJsonCanvasRemove | PixiVNJsonVideoPauseResume | PixiVNJsonAssetsLoad);
42
+
43
+ export type { PixiVNJsonCanvas as default };
@@ -1,10 +1,11 @@
1
1
  import { LabelRunModeType, StorageObjectType, StepLabelPropsType } from '@drincs/pixi-vn';
2
- import { o as PixiVNJsonValueGet, b as PixiVNJsonConditionalStatements } from '../PixiVNJsonConditionalStatements-CVkQSKpq.cjs';
2
+ import { b as PixiVNJsonConditionalStatements, o as PixiVNJsonValueGet } from '../PixiVNJsonConditionalStatements-CVkQSKpq.cjs';
3
3
  import PixiVNJsonOperations from './PixiVNJsonOperations.cjs';
4
- import './PixiVNJsonInput.cjs';
5
- import './PixiVNJsonMedia.cjs';
4
+ import './PixiVNJsonCanvas.cjs';
6
5
  import './PixiVNJsonMediaTransiotions.cjs';
7
6
  import 'pixi.js';
7
+ import './PixiVNJsonInput.cjs';
8
+ import './PixiVNJsonSound.cjs';
8
9
 
9
10
  type PixiVNJsonChoice = {
10
11
  /**
@@ -1,10 +1,11 @@
1
1
  import { LabelRunModeType, StorageObjectType, StepLabelPropsType } from '@drincs/pixi-vn';
2
- import { o as PixiVNJsonValueGet, b as PixiVNJsonConditionalStatements } from '../PixiVNJsonConditionalStatements-CVkQSKpq.js';
2
+ import { b as PixiVNJsonConditionalStatements, o as PixiVNJsonValueGet } from '../PixiVNJsonConditionalStatements-CVkQSKpq.js';
3
3
  import PixiVNJsonOperations from './PixiVNJsonOperations.js';
4
- import './PixiVNJsonInput.js';
5
- import './PixiVNJsonMedia.js';
4
+ import './PixiVNJsonCanvas.js';
6
5
  import './PixiVNJsonMediaTransiotions.js';
7
6
  import 'pixi.js';
7
+ import './PixiVNJsonInput.js';
8
+ import './PixiVNJsonSound.js';
8
9
 
9
10
  type PixiVNJsonChoice = {
10
11
  /**
@@ -2,10 +2,11 @@ import PixiVNJsonLabelStep from './PixiVNJsonLabelStep.cjs';
2
2
  import '@drincs/pixi-vn';
3
3
  import '../PixiVNJsonConditionalStatements-CVkQSKpq.cjs';
4
4
  import './PixiVNJsonOperations.cjs';
5
- import './PixiVNJsonInput.cjs';
6
- import './PixiVNJsonMedia.cjs';
5
+ import './PixiVNJsonCanvas.cjs';
7
6
  import './PixiVNJsonMediaTransiotions.cjs';
8
7
  import 'pixi.js';
8
+ import './PixiVNJsonInput.cjs';
9
+ import './PixiVNJsonSound.cjs';
9
10
 
10
11
  /**
11
12
  * Label of the narrative.
@@ -2,10 +2,11 @@ import PixiVNJsonLabelStep from './PixiVNJsonLabelStep.js';
2
2
  import '@drincs/pixi-vn';
3
3
  import '../PixiVNJsonConditionalStatements-CVkQSKpq.js';
4
4
  import './PixiVNJsonOperations.js';
5
- import './PixiVNJsonInput.js';
6
- import './PixiVNJsonMedia.js';
5
+ import './PixiVNJsonCanvas.js';
7
6
  import './PixiVNJsonMediaTransiotions.js';
8
7
  import 'pixi.js';
8
+ import './PixiVNJsonInput.js';
9
+ import './PixiVNJsonSound.js';
9
10
 
10
11
  /**
11
12
  * Label of the narrative.
@@ -1,6 +1,7 @@
1
- import { p as PixiVNJsonValueSet, e as PixiVNJsonIfElse, o as PixiVNJsonValueGet, b as PixiVNJsonConditionalStatements } from '../PixiVNJsonConditionalStatements-CVkQSKpq.cjs';
1
+ import PixiVNJsonCanvas from './PixiVNJsonCanvas.cjs';
2
+ import { o as PixiVNJsonValueGet, b as PixiVNJsonConditionalStatements, p as PixiVNJsonValueSet, e as PixiVNJsonIfElse } from '../PixiVNJsonConditionalStatements-CVkQSKpq.cjs';
2
3
  import PixiVNJsonInput from './PixiVNJsonInput.cjs';
3
- import { PixiVNJsonCanvas, PixiVNJsonSound } from './PixiVNJsonMedia.cjs';
4
+ import PixiVNJsonSound from './PixiVNJsonSound.cjs';
4
5
  import '@drincs/pixi-vn';
5
6
  import './PixiVNJsonMediaTransiotions.cjs';
6
7
  import 'pixi.js';
@@ -1,6 +1,7 @@
1
- import { p as PixiVNJsonValueSet, e as PixiVNJsonIfElse, o as PixiVNJsonValueGet, b as PixiVNJsonConditionalStatements } from '../PixiVNJsonConditionalStatements-CVkQSKpq.js';
1
+ import PixiVNJsonCanvas from './PixiVNJsonCanvas.js';
2
+ import { o as PixiVNJsonValueGet, b as PixiVNJsonConditionalStatements, p as PixiVNJsonValueSet, e as PixiVNJsonIfElse } from '../PixiVNJsonConditionalStatements-CVkQSKpq.js';
2
3
  import PixiVNJsonInput from './PixiVNJsonInput.js';
3
- import { PixiVNJsonCanvas, PixiVNJsonSound } from './PixiVNJsonMedia.js';
4
+ import PixiVNJsonSound from './PixiVNJsonSound.js';
4
5
  import '@drincs/pixi-vn';
5
6
  import './PixiVNJsonMediaTransiotions.js';
6
7
  import 'pixi.js';
@@ -0,0 +1 @@
1
+ 'use strict';
@@ -0,0 +1,34 @@
1
+ import { SoundOptions, SoundPlayOptions } from '@drincs/pixi-vn';
2
+
3
+ type PixiVNJsonSoundAdd = {
4
+ type: "sound";
5
+ operationType: "add";
6
+ alias: string;
7
+ url: string;
8
+ props?: SoundOptions;
9
+ };
10
+ type PixiVNJsonSoundPlay = {
11
+ type: "sound";
12
+ operationType: "play";
13
+ alias: string;
14
+ props?: SoundPlayOptions;
15
+ };
16
+ type PixiVNJsonSoundRemove = {
17
+ type: "sound";
18
+ operationType: "remove";
19
+ alias: string;
20
+ };
21
+ type PixiVNJsonSoundPauseResume = {
22
+ type: "sound";
23
+ operationType: "pause" | "resume";
24
+ alias: string;
25
+ };
26
+ type PixiVNJsonSoundVolume = {
27
+ type: "sound";
28
+ operationType: "volume";
29
+ alias: string;
30
+ value: number;
31
+ };
32
+ type PixiVNJsonSound = (PixiVNJsonSoundAdd | PixiVNJsonSoundPlay | PixiVNJsonSoundRemove | PixiVNJsonSoundPauseResume | PixiVNJsonSoundVolume);
33
+
34
+ export type { PixiVNJsonSound as default };
@@ -0,0 +1,34 @@
1
+ import { SoundOptions, SoundPlayOptions } from '@drincs/pixi-vn';
2
+
3
+ type PixiVNJsonSoundAdd = {
4
+ type: "sound";
5
+ operationType: "add";
6
+ alias: string;
7
+ url: string;
8
+ props?: SoundOptions;
9
+ };
10
+ type PixiVNJsonSoundPlay = {
11
+ type: "sound";
12
+ operationType: "play";
13
+ alias: string;
14
+ props?: SoundPlayOptions;
15
+ };
16
+ type PixiVNJsonSoundRemove = {
17
+ type: "sound";
18
+ operationType: "remove";
19
+ alias: string;
20
+ };
21
+ type PixiVNJsonSoundPauseResume = {
22
+ type: "sound";
23
+ operationType: "pause" | "resume";
24
+ alias: string;
25
+ };
26
+ type PixiVNJsonSoundVolume = {
27
+ type: "sound";
28
+ operationType: "volume";
29
+ alias: string;
30
+ value: number;
31
+ };
32
+ type PixiVNJsonSound = (PixiVNJsonSoundAdd | PixiVNJsonSoundPlay | PixiVNJsonSoundRemove | PixiVNJsonSoundPauseResume | PixiVNJsonSoundVolume);
33
+
34
+ export type { PixiVNJsonSound as default };
File without changes
@@ -1,10 +1,11 @@
1
1
  export { default as PixiVNJson } from './PixiVNJson.cjs';
2
2
  export { P as PixiVNJsonArithmeticOperations, j as PixiVNJsonChoiceGet, c as PixiVNJsonComparation, a as PixiVNJsonConditionalResultToCombine, b as PixiVNJsonConditionalStatements, d as PixiVNJsonConditions, e as PixiVNJsonIfElse, k as PixiVNJsonLabelGet, l as PixiVNJsonLogicGet, m as PixiVNJsonParamGet, f as PixiVNJsonStepSwitch, g as PixiVNJsonStepSwitchElementType, h as PixiVNJsonStepSwitchElementsType, n as PixiVNJsonStorageGet, i as PixiVNJsonUnionCondition, o as PixiVNJsonValueGet, p as PixiVNJsonValueSet } from '../PixiVNJsonConditionalStatements-CVkQSKpq.cjs';
3
+ export { default as PixiVNJsonCanvas } from './PixiVNJsonCanvas.cjs';
3
4
  export { default as PixiVNJsonInput } from './PixiVNJsonInput.cjs';
4
5
  export { PixiVNJsonLabel, default as PixiVNJsonLabels } from './PixiVNJsonLabels.cjs';
5
6
  export { PixiVNJsonChoice, PixiVNJsonChoices, PixiVNJsonDialog, PixiVNJsonDialogText, default as PixiVNJsonLabelStep, PixiVNJsonLabelToOpen } from './PixiVNJsonLabelStep.cjs';
6
- export { PixiVNJsonCanvas, PixiVNJsonSound } from './PixiVNJsonMedia.cjs';
7
7
  export { default as PixiVNJsonMediaTransiotions } from './PixiVNJsonMediaTransiotions.cjs';
8
8
  export { PixiVNJsonOperation, PixiVNJsonOperationString, default as PixiVNJsonOperations } from './PixiVNJsonOperations.cjs';
9
+ export { default as PixiVNJsonSound } from './PixiVNJsonSound.cjs';
9
10
  import '@drincs/pixi-vn';
10
11
  import 'pixi.js';
@@ -1,10 +1,11 @@
1
1
  export { default as PixiVNJson } from './PixiVNJson.js';
2
2
  export { P as PixiVNJsonArithmeticOperations, j as PixiVNJsonChoiceGet, c as PixiVNJsonComparation, a as PixiVNJsonConditionalResultToCombine, b as PixiVNJsonConditionalStatements, d as PixiVNJsonConditions, e as PixiVNJsonIfElse, k as PixiVNJsonLabelGet, l as PixiVNJsonLogicGet, m as PixiVNJsonParamGet, f as PixiVNJsonStepSwitch, g as PixiVNJsonStepSwitchElementType, h as PixiVNJsonStepSwitchElementsType, n as PixiVNJsonStorageGet, i as PixiVNJsonUnionCondition, o as PixiVNJsonValueGet, p as PixiVNJsonValueSet } from '../PixiVNJsonConditionalStatements-CVkQSKpq.js';
3
+ export { default as PixiVNJsonCanvas } from './PixiVNJsonCanvas.js';
3
4
  export { default as PixiVNJsonInput } from './PixiVNJsonInput.js';
4
5
  export { PixiVNJsonLabel, default as PixiVNJsonLabels } from './PixiVNJsonLabels.js';
5
6
  export { PixiVNJsonChoice, PixiVNJsonChoices, PixiVNJsonDialog, PixiVNJsonDialogText, default as PixiVNJsonLabelStep, PixiVNJsonLabelToOpen } from './PixiVNJsonLabelStep.js';
6
- export { PixiVNJsonCanvas, PixiVNJsonSound } from './PixiVNJsonMedia.js';
7
7
  export { default as PixiVNJsonMediaTransiotions } from './PixiVNJsonMediaTransiotions.js';
8
8
  export { PixiVNJsonOperation, PixiVNJsonOperationString, default as PixiVNJsonOperations } from './PixiVNJsonOperations.js';
9
+ export { default as PixiVNJsonSound } from './PixiVNJsonSound.js';
9
10
  import '@drincs/pixi-vn';
10
11
  import 'pixi.js';
@@ -1 +1 @@
1
- 'use strict';var h=class i{static _beforeToTranslate=void 0;static _translate=e=>e;static _afterToTranslate=void 0;static t(e){return Array.isArray(e)?e.map(t=>i.translate(`${t}`)):i.translate(`${e}`)}static set beforeToTranslate(e){i._beforeToTranslate=e;}static set translate(e){i._translate=e;}static get translate(){return e=>{let t="";return i._beforeToTranslate&&(t=i._beforeToTranslate(e)),t=i._translate(t),i._afterToTranslate&&(t=i._afterToTranslate(t)),t}}static set afterToTranslate(e){i._afterToTranslate=e;}static addKey(e,t,s){let n=s.defaultValue||"empty_string";typeof t=="string"&&(t=[t]),Array.isArray(t)&&t.forEach(r=>{e[r]===void 0&&(n==="empty_string"?e[r]="":n==="copy_key"&&(i._beforeToTranslate?e[r]=i._beforeToTranslate(r):e[r]=r));});}static getConditionalsThenElse(e,t=[]){if(typeof e=="object"&&e&&"type"in e)if(e.type==="ifelse")e.then&&i.getConditionalsThenElse(e.then,t),e.else&&i.getConditionalsThenElse(e.else,t);else if(e.type==="stepswitch"){if(e.elements)if(Array.isArray(e.elements))e.elements.forEach(s=>{i.getConditionalsThenElse(s,t);});else if(e.elements.type==="ifelse"){let s=[];i.getConditionalsThenElse(e.elements,s),s.forEach(n=>{t.push(...n);});}else if(e.elements.type==="stepswitch"){let s=[];i.getConditionalsThenElse(e.elements,s),s.forEach(n=>{t.push(...n);});}else i.getConditionalsThenElse(e.elements,t);}else e.type==="resulttocombine"?(e.firstItem&&i.getConditionalsThenElse(e.firstItem,t),e.secondConditionalItem&&e.secondConditionalItem.forEach(s=>{i.getConditionalsThenElse(s,t);})):t.push(e);else e&&t.push(e);return t}static generateJsonTranslation(e,t={},s={}){return e.forEach(n=>{if(n.choices){let r=[];Array.isArray(n.choices)?r=[n.choices]:r=i.getConditionalsThenElse(n.choices),r.forEach(l=>l.forEach(o=>{if("type"in o){let g=[];o.type==="ifelse"||o.type==="stepswitch"?i.getConditionalsThenElse(o,g):g=[o],g.map(a=>i.getConditionalsThenElse(a.text)).forEach(a=>{Array.isArray(a)&&a.forEach(f=>{Array.isArray(f)?f.forEach(c=>{typeof c=="string"?i.addKey(t,c,s):i.getConditionalsThenElse(c).forEach(T=>{Array.isArray(T)?T.forEach(d=>{typeof d=="string"&&i.addKey(t,d,s);}):typeof T=="string"&&i.addKey(t,T,s);});}):typeof f=="string"&&i.addKey(t,f,s);});});}}));}if(n.dialogue){let r=[];Array.isArray(n.dialogue)?r=[n.dialogue]:r=i.getConditionalsThenElse(n.dialogue),r.forEach(l=>{typeof l=="string"?i.addKey(t,l,s):"text"in l&&Array.isArray(l.text)&&l.text.forEach(o=>{typeof o=="string"?i.addKey(t,o,s):i.getConditionalsThenElse(o).forEach(y=>{typeof y=="string"?i.addKey(t,y,s):Array.isArray(y)&&y.forEach(a=>{typeof a=="string"?i.addKey(t,a,s):i.getConditionalsThenElse(a).forEach(f=>{typeof f=="string"&&i.addKey(t,f,s);});});});});});}n.conditionalStep&&i.getConditionalsThenElse(n.conditionalStep).forEach(l=>{Array.isArray(l)?i.generateJsonTranslation(l,t,s):i.generateJsonTranslation([l],t,s);});}),t}};module.exports=h;
1
+ 'use strict';var h=class t{static _beforeToTranslate=void 0;static _translate=e=>e;static _afterToTranslate=void 0;static t(e){return Array.isArray(e)?e.map(i=>t.translate(`${i}`)):t.translate(`${e}`)}static set beforeToTranslate(e){t._beforeToTranslate=e;}static set translate(e){t._translate=e;}static get translate(){return e=>{let i=e;return t._beforeToTranslate&&(i=t._beforeToTranslate(i)),i=t._translate(i),t._afterToTranslate&&(i=t._afterToTranslate(i)),i}}static set afterToTranslate(e){t._afterToTranslate=e;}static addKey(e,i,s){let n=s.defaultValue||"empty_string";typeof i=="string"&&(i=[i]),Array.isArray(i)&&i.forEach(r=>{e[r]===void 0&&(n==="empty_string"?e[r]="":n==="copy_key"&&(t._beforeToTranslate?e[r]=t._beforeToTranslate(r):e[r]=r));});}static getConditionalsThenElse(e,i=[]){if(typeof e=="object"&&e&&"type"in e)if(e.type==="ifelse")e.then&&t.getConditionalsThenElse(e.then,i),e.else&&t.getConditionalsThenElse(e.else,i);else if(e.type==="stepswitch"){if(e.elements)if(Array.isArray(e.elements))e.elements.forEach(s=>{t.getConditionalsThenElse(s,i);});else if(e.elements.type==="ifelse"){let s=[];t.getConditionalsThenElse(e.elements,s),s.forEach(n=>{i.push(...n);});}else if(e.elements.type==="stepswitch"){let s=[];t.getConditionalsThenElse(e.elements,s),s.forEach(n=>{i.push(...n);});}else t.getConditionalsThenElse(e.elements,i);}else e.type==="resulttocombine"?(e.firstItem&&t.getConditionalsThenElse(e.firstItem,i),e.secondConditionalItem&&e.secondConditionalItem.forEach(s=>{t.getConditionalsThenElse(s,i);})):i.push(e);else e&&i.push(e);return i}static generateJsonTranslation(e,i={},s={}){return e.forEach(n=>{if(n.choices){let r=[];Array.isArray(n.choices)?r=[n.choices]:r=t.getConditionalsThenElse(n.choices),r.forEach(l=>l.forEach(o=>{if("type"in o){let g=[];o.type==="ifelse"||o.type==="stepswitch"?t.getConditionalsThenElse(o,g):g=[o],g.map(a=>t.getConditionalsThenElse(a.text)).forEach(a=>{Array.isArray(a)&&a.forEach(f=>{Array.isArray(f)?f.forEach(c=>{typeof c=="string"?t.addKey(i,c,s):t.getConditionalsThenElse(c).forEach(T=>{Array.isArray(T)?T.forEach(d=>{typeof d=="string"&&t.addKey(i,d,s);}):typeof T=="string"&&t.addKey(i,T,s);});}):typeof f=="string"&&t.addKey(i,f,s);});});}}));}if(n.dialogue){let r=[];Array.isArray(n.dialogue)?r=[n.dialogue]:r=t.getConditionalsThenElse(n.dialogue),r.forEach(l=>{typeof l=="string"?t.addKey(i,l,s):"text"in l&&Array.isArray(l.text)&&l.text.forEach(o=>{typeof o=="string"?t.addKey(i,o,s):t.getConditionalsThenElse(o).forEach(y=>{typeof y=="string"?t.addKey(i,y,s):Array.isArray(y)&&y.forEach(a=>{typeof a=="string"?t.addKey(i,a,s):t.getConditionalsThenElse(a).forEach(f=>{typeof f=="string"&&t.addKey(i,f,s);});});});});});}n.conditionalStep&&t.getConditionalsThenElse(n.conditionalStep).forEach(l=>{Array.isArray(l)?t.generateJsonTranslation(l,i,s):t.generateJsonTranslation([l],i,s);});}),i}};module.exports=h;
@@ -2,10 +2,11 @@ import PixiVNJsonLabelStep from '../interface/PixiVNJsonLabelStep.cjs';
2
2
  import '@drincs/pixi-vn';
3
3
  import '../PixiVNJsonConditionalStatements-CVkQSKpq.cjs';
4
4
  import '../interface/PixiVNJsonOperations.cjs';
5
- import '../interface/PixiVNJsonInput.cjs';
6
- import '../interface/PixiVNJsonMedia.cjs';
5
+ import '../interface/PixiVNJsonCanvas.cjs';
7
6
  import '../interface/PixiVNJsonMediaTransiotions.cjs';
8
7
  import 'pixi.js';
8
+ import '../interface/PixiVNJsonInput.cjs';
9
+ import '../interface/PixiVNJsonSound.cjs';
9
10
 
10
11
  declare class TranslatorManager {
11
12
  private static _beforeToTranslate;
@@ -2,10 +2,11 @@ import PixiVNJsonLabelStep from '../interface/PixiVNJsonLabelStep.js';
2
2
  import '@drincs/pixi-vn';
3
3
  import '../PixiVNJsonConditionalStatements-CVkQSKpq.js';
4
4
  import '../interface/PixiVNJsonOperations.js';
5
- import '../interface/PixiVNJsonInput.js';
6
- import '../interface/PixiVNJsonMedia.js';
5
+ import '../interface/PixiVNJsonCanvas.js';
7
6
  import '../interface/PixiVNJsonMediaTransiotions.js';
8
7
  import 'pixi.js';
8
+ import '../interface/PixiVNJsonInput.js';
9
+ import '../interface/PixiVNJsonSound.js';
9
10
 
10
11
  declare class TranslatorManager {
11
12
  private static _beforeToTranslate;
@@ -1 +1 @@
1
- var h=class i{static _beforeToTranslate=void 0;static _translate=e=>e;static _afterToTranslate=void 0;static t(e){return Array.isArray(e)?e.map(t=>i.translate(`${t}`)):i.translate(`${e}`)}static set beforeToTranslate(e){i._beforeToTranslate=e;}static set translate(e){i._translate=e;}static get translate(){return e=>{let t="";return i._beforeToTranslate&&(t=i._beforeToTranslate(e)),t=i._translate(t),i._afterToTranslate&&(t=i._afterToTranslate(t)),t}}static set afterToTranslate(e){i._afterToTranslate=e;}static addKey(e,t,s){let n=s.defaultValue||"empty_string";typeof t=="string"&&(t=[t]),Array.isArray(t)&&t.forEach(r=>{e[r]===void 0&&(n==="empty_string"?e[r]="":n==="copy_key"&&(i._beforeToTranslate?e[r]=i._beforeToTranslate(r):e[r]=r));});}static getConditionalsThenElse(e,t=[]){if(typeof e=="object"&&e&&"type"in e)if(e.type==="ifelse")e.then&&i.getConditionalsThenElse(e.then,t),e.else&&i.getConditionalsThenElse(e.else,t);else if(e.type==="stepswitch"){if(e.elements)if(Array.isArray(e.elements))e.elements.forEach(s=>{i.getConditionalsThenElse(s,t);});else if(e.elements.type==="ifelse"){let s=[];i.getConditionalsThenElse(e.elements,s),s.forEach(n=>{t.push(...n);});}else if(e.elements.type==="stepswitch"){let s=[];i.getConditionalsThenElse(e.elements,s),s.forEach(n=>{t.push(...n);});}else i.getConditionalsThenElse(e.elements,t);}else e.type==="resulttocombine"?(e.firstItem&&i.getConditionalsThenElse(e.firstItem,t),e.secondConditionalItem&&e.secondConditionalItem.forEach(s=>{i.getConditionalsThenElse(s,t);})):t.push(e);else e&&t.push(e);return t}static generateJsonTranslation(e,t={},s={}){return e.forEach(n=>{if(n.choices){let r=[];Array.isArray(n.choices)?r=[n.choices]:r=i.getConditionalsThenElse(n.choices),r.forEach(l=>l.forEach(o=>{if("type"in o){let g=[];o.type==="ifelse"||o.type==="stepswitch"?i.getConditionalsThenElse(o,g):g=[o],g.map(a=>i.getConditionalsThenElse(a.text)).forEach(a=>{Array.isArray(a)&&a.forEach(f=>{Array.isArray(f)?f.forEach(c=>{typeof c=="string"?i.addKey(t,c,s):i.getConditionalsThenElse(c).forEach(T=>{Array.isArray(T)?T.forEach(d=>{typeof d=="string"&&i.addKey(t,d,s);}):typeof T=="string"&&i.addKey(t,T,s);});}):typeof f=="string"&&i.addKey(t,f,s);});});}}));}if(n.dialogue){let r=[];Array.isArray(n.dialogue)?r=[n.dialogue]:r=i.getConditionalsThenElse(n.dialogue),r.forEach(l=>{typeof l=="string"?i.addKey(t,l,s):"text"in l&&Array.isArray(l.text)&&l.text.forEach(o=>{typeof o=="string"?i.addKey(t,o,s):i.getConditionalsThenElse(o).forEach(y=>{typeof y=="string"?i.addKey(t,y,s):Array.isArray(y)&&y.forEach(a=>{typeof a=="string"?i.addKey(t,a,s):i.getConditionalsThenElse(a).forEach(f=>{typeof f=="string"&&i.addKey(t,f,s);});});});});});}n.conditionalStep&&i.getConditionalsThenElse(n.conditionalStep).forEach(l=>{Array.isArray(l)?i.generateJsonTranslation(l,t,s):i.generateJsonTranslation([l],t,s);});}),t}};export{h as default};
1
+ var h=class t{static _beforeToTranslate=void 0;static _translate=e=>e;static _afterToTranslate=void 0;static t(e){return Array.isArray(e)?e.map(i=>t.translate(`${i}`)):t.translate(`${e}`)}static set beforeToTranslate(e){t._beforeToTranslate=e;}static set translate(e){t._translate=e;}static get translate(){return e=>{let i=e;return t._beforeToTranslate&&(i=t._beforeToTranslate(i)),i=t._translate(i),t._afterToTranslate&&(i=t._afterToTranslate(i)),i}}static set afterToTranslate(e){t._afterToTranslate=e;}static addKey(e,i,s){let n=s.defaultValue||"empty_string";typeof i=="string"&&(i=[i]),Array.isArray(i)&&i.forEach(r=>{e[r]===void 0&&(n==="empty_string"?e[r]="":n==="copy_key"&&(t._beforeToTranslate?e[r]=t._beforeToTranslate(r):e[r]=r));});}static getConditionalsThenElse(e,i=[]){if(typeof e=="object"&&e&&"type"in e)if(e.type==="ifelse")e.then&&t.getConditionalsThenElse(e.then,i),e.else&&t.getConditionalsThenElse(e.else,i);else if(e.type==="stepswitch"){if(e.elements)if(Array.isArray(e.elements))e.elements.forEach(s=>{t.getConditionalsThenElse(s,i);});else if(e.elements.type==="ifelse"){let s=[];t.getConditionalsThenElse(e.elements,s),s.forEach(n=>{i.push(...n);});}else if(e.elements.type==="stepswitch"){let s=[];t.getConditionalsThenElse(e.elements,s),s.forEach(n=>{i.push(...n);});}else t.getConditionalsThenElse(e.elements,i);}else e.type==="resulttocombine"?(e.firstItem&&t.getConditionalsThenElse(e.firstItem,i),e.secondConditionalItem&&e.secondConditionalItem.forEach(s=>{t.getConditionalsThenElse(s,i);})):i.push(e);else e&&i.push(e);return i}static generateJsonTranslation(e,i={},s={}){return e.forEach(n=>{if(n.choices){let r=[];Array.isArray(n.choices)?r=[n.choices]:r=t.getConditionalsThenElse(n.choices),r.forEach(l=>l.forEach(o=>{if("type"in o){let g=[];o.type==="ifelse"||o.type==="stepswitch"?t.getConditionalsThenElse(o,g):g=[o],g.map(a=>t.getConditionalsThenElse(a.text)).forEach(a=>{Array.isArray(a)&&a.forEach(f=>{Array.isArray(f)?f.forEach(c=>{typeof c=="string"?t.addKey(i,c,s):t.getConditionalsThenElse(c).forEach(T=>{Array.isArray(T)?T.forEach(d=>{typeof d=="string"&&t.addKey(i,d,s);}):typeof T=="string"&&t.addKey(i,T,s);});}):typeof f=="string"&&t.addKey(i,f,s);});});}}));}if(n.dialogue){let r=[];Array.isArray(n.dialogue)?r=[n.dialogue]:r=t.getConditionalsThenElse(n.dialogue),r.forEach(l=>{typeof l=="string"?t.addKey(i,l,s):"text"in l&&Array.isArray(l.text)&&l.text.forEach(o=>{typeof o=="string"?t.addKey(i,o,s):t.getConditionalsThenElse(o).forEach(y=>{typeof y=="string"?t.addKey(i,y,s):Array.isArray(y)&&y.forEach(a=>{typeof a=="string"?t.addKey(i,a,s):t.getConditionalsThenElse(a).forEach(f=>{typeof f=="string"&&t.addKey(i,f,s);});});});});});}n.conditionalStep&&t.getConditionalsThenElse(n.conditionalStep).forEach(l=>{Array.isArray(l)?t.generateJsonTranslation(l,i,s):t.generateJsonTranslation([l],i,s);});}),i}};export{h as default};
@@ -1 +1 @@
1
- 'use strict';var g=class i{static _beforeToTranslate=void 0;static _translate=e=>e;static _afterToTranslate=void 0;static t(e){return Array.isArray(e)?e.map(t=>i.translate(`${t}`)):i.translate(`${e}`)}static set beforeToTranslate(e){i._beforeToTranslate=e;}static set translate(e){i._translate=e;}static get translate(){return e=>{let t="";return i._beforeToTranslate&&(t=i._beforeToTranslate(e)),t=i._translate(t),i._afterToTranslate&&(t=i._afterToTranslate(t)),t}}static set afterToTranslate(e){i._afterToTranslate=e;}static addKey(e,t,s){let n=s.defaultValue||"empty_string";typeof t=="string"&&(t=[t]),Array.isArray(t)&&t.forEach(r=>{e[r]===void 0&&(n==="empty_string"?e[r]="":n==="copy_key"&&(i._beforeToTranslate?e[r]=i._beforeToTranslate(r):e[r]=r));});}static getConditionalsThenElse(e,t=[]){if(typeof e=="object"&&e&&"type"in e)if(e.type==="ifelse")e.then&&i.getConditionalsThenElse(e.then,t),e.else&&i.getConditionalsThenElse(e.else,t);else if(e.type==="stepswitch"){if(e.elements)if(Array.isArray(e.elements))e.elements.forEach(s=>{i.getConditionalsThenElse(s,t);});else if(e.elements.type==="ifelse"){let s=[];i.getConditionalsThenElse(e.elements,s),s.forEach(n=>{t.push(...n);});}else if(e.elements.type==="stepswitch"){let s=[];i.getConditionalsThenElse(e.elements,s),s.forEach(n=>{t.push(...n);});}else i.getConditionalsThenElse(e.elements,t);}else e.type==="resulttocombine"?(e.firstItem&&i.getConditionalsThenElse(e.firstItem,t),e.secondConditionalItem&&e.secondConditionalItem.forEach(s=>{i.getConditionalsThenElse(s,t);})):t.push(e);else e&&t.push(e);return t}static generateJsonTranslation(e,t={},s={}){return e.forEach(n=>{if(n.choices){let r=[];Array.isArray(n.choices)?r=[n.choices]:r=i.getConditionalsThenElse(n.choices),r.forEach(o=>o.forEach(a=>{if("type"in a){let T=[];a.type==="ifelse"||a.type==="stepswitch"?i.getConditionalsThenElse(a,T):T=[a],T.map(l=>i.getConditionalsThenElse(l.text)).forEach(l=>{Array.isArray(l)&&l.forEach(f=>{Array.isArray(f)?f.forEach(h=>{typeof h=="string"?i.addKey(t,h,s):i.getConditionalsThenElse(h).forEach(c=>{Array.isArray(c)?c.forEach(p=>{typeof p=="string"&&i.addKey(t,p,s);}):typeof c=="string"&&i.addKey(t,c,s);});}):typeof f=="string"&&i.addKey(t,f,s);});});}}));}if(n.dialogue){let r=[];Array.isArray(n.dialogue)?r=[n.dialogue]:r=i.getConditionalsThenElse(n.dialogue),r.forEach(o=>{typeof o=="string"?i.addKey(t,o,s):"text"in o&&Array.isArray(o.text)&&o.text.forEach(a=>{typeof a=="string"?i.addKey(t,a,s):i.getConditionalsThenElse(a).forEach(y=>{typeof y=="string"?i.addKey(t,y,s):Array.isArray(y)&&y.forEach(l=>{typeof l=="string"?i.addKey(t,l,s):i.getConditionalsThenElse(l).forEach(f=>{typeof f=="string"&&i.addKey(t,f,s);});});});});});}n.conditionalStep&&i.getConditionalsThenElse(n.conditionalStep).forEach(o=>{Array.isArray(o)?i.generateJsonTranslation(o,t,s):i.generateJsonTranslation([o],t,s);});}),t}};var u=g;exports.translator=u;
1
+ 'use strict';var g=class t{static _beforeToTranslate=void 0;static _translate=e=>e;static _afterToTranslate=void 0;static t(e){return Array.isArray(e)?e.map(i=>t.translate(`${i}`)):t.translate(`${e}`)}static set beforeToTranslate(e){t._beforeToTranslate=e;}static set translate(e){t._translate=e;}static get translate(){return e=>{let i=e;return t._beforeToTranslate&&(i=t._beforeToTranslate(i)),i=t._translate(i),t._afterToTranslate&&(i=t._afterToTranslate(i)),i}}static set afterToTranslate(e){t._afterToTranslate=e;}static addKey(e,i,s){let n=s.defaultValue||"empty_string";typeof i=="string"&&(i=[i]),Array.isArray(i)&&i.forEach(r=>{e[r]===void 0&&(n==="empty_string"?e[r]="":n==="copy_key"&&(t._beforeToTranslate?e[r]=t._beforeToTranslate(r):e[r]=r));});}static getConditionalsThenElse(e,i=[]){if(typeof e=="object"&&e&&"type"in e)if(e.type==="ifelse")e.then&&t.getConditionalsThenElse(e.then,i),e.else&&t.getConditionalsThenElse(e.else,i);else if(e.type==="stepswitch"){if(e.elements)if(Array.isArray(e.elements))e.elements.forEach(s=>{t.getConditionalsThenElse(s,i);});else if(e.elements.type==="ifelse"){let s=[];t.getConditionalsThenElse(e.elements,s),s.forEach(n=>{i.push(...n);});}else if(e.elements.type==="stepswitch"){let s=[];t.getConditionalsThenElse(e.elements,s),s.forEach(n=>{i.push(...n);});}else t.getConditionalsThenElse(e.elements,i);}else e.type==="resulttocombine"?(e.firstItem&&t.getConditionalsThenElse(e.firstItem,i),e.secondConditionalItem&&e.secondConditionalItem.forEach(s=>{t.getConditionalsThenElse(s,i);})):i.push(e);else e&&i.push(e);return i}static generateJsonTranslation(e,i={},s={}){return e.forEach(n=>{if(n.choices){let r=[];Array.isArray(n.choices)?r=[n.choices]:r=t.getConditionalsThenElse(n.choices),r.forEach(o=>o.forEach(a=>{if("type"in a){let T=[];a.type==="ifelse"||a.type==="stepswitch"?t.getConditionalsThenElse(a,T):T=[a],T.map(l=>t.getConditionalsThenElse(l.text)).forEach(l=>{Array.isArray(l)&&l.forEach(f=>{Array.isArray(f)?f.forEach(h=>{typeof h=="string"?t.addKey(i,h,s):t.getConditionalsThenElse(h).forEach(c=>{Array.isArray(c)?c.forEach(p=>{typeof p=="string"&&t.addKey(i,p,s);}):typeof c=="string"&&t.addKey(i,c,s);});}):typeof f=="string"&&t.addKey(i,f,s);});});}}));}if(n.dialogue){let r=[];Array.isArray(n.dialogue)?r=[n.dialogue]:r=t.getConditionalsThenElse(n.dialogue),r.forEach(o=>{typeof o=="string"?t.addKey(i,o,s):"text"in o&&Array.isArray(o.text)&&o.text.forEach(a=>{typeof a=="string"?t.addKey(i,a,s):t.getConditionalsThenElse(a).forEach(y=>{typeof y=="string"?t.addKey(i,y,s):Array.isArray(y)&&y.forEach(l=>{typeof l=="string"?t.addKey(i,l,s):t.getConditionalsThenElse(l).forEach(f=>{typeof f=="string"&&t.addKey(i,f,s);});});});});});}n.conditionalStep&&t.getConditionalsThenElse(n.conditionalStep).forEach(o=>{Array.isArray(o)?t.generateJsonTranslation(o,i,s):t.generateJsonTranslation([o],i,s);});}),i}};var u=g;exports.translator=u;
@@ -3,10 +3,11 @@ import '../interface/PixiVNJsonLabelStep.cjs';
3
3
  import '@drincs/pixi-vn';
4
4
  import '../PixiVNJsonConditionalStatements-CVkQSKpq.cjs';
5
5
  import '../interface/PixiVNJsonOperations.cjs';
6
- import '../interface/PixiVNJsonInput.cjs';
7
- import '../interface/PixiVNJsonMedia.cjs';
6
+ import '../interface/PixiVNJsonCanvas.cjs';
8
7
  import '../interface/PixiVNJsonMediaTransiotions.cjs';
9
8
  import 'pixi.js';
9
+ import '../interface/PixiVNJsonInput.cjs';
10
+ import '../interface/PixiVNJsonSound.cjs';
10
11
 
11
12
  declare const translator: typeof TranslatorManager;
12
13
 
@@ -3,10 +3,11 @@ import '../interface/PixiVNJsonLabelStep.js';
3
3
  import '@drincs/pixi-vn';
4
4
  import '../PixiVNJsonConditionalStatements-CVkQSKpq.js';
5
5
  import '../interface/PixiVNJsonOperations.js';
6
- import '../interface/PixiVNJsonInput.js';
7
- import '../interface/PixiVNJsonMedia.js';
6
+ import '../interface/PixiVNJsonCanvas.js';
8
7
  import '../interface/PixiVNJsonMediaTransiotions.js';
9
8
  import 'pixi.js';
9
+ import '../interface/PixiVNJsonInput.js';
10
+ import '../interface/PixiVNJsonSound.js';
10
11
 
11
12
  declare const translator: typeof TranslatorManager;
12
13
 
@@ -1 +1 @@
1
- var g=class i{static _beforeToTranslate=void 0;static _translate=e=>e;static _afterToTranslate=void 0;static t(e){return Array.isArray(e)?e.map(t=>i.translate(`${t}`)):i.translate(`${e}`)}static set beforeToTranslate(e){i._beforeToTranslate=e;}static set translate(e){i._translate=e;}static get translate(){return e=>{let t="";return i._beforeToTranslate&&(t=i._beforeToTranslate(e)),t=i._translate(t),i._afterToTranslate&&(t=i._afterToTranslate(t)),t}}static set afterToTranslate(e){i._afterToTranslate=e;}static addKey(e,t,s){let n=s.defaultValue||"empty_string";typeof t=="string"&&(t=[t]),Array.isArray(t)&&t.forEach(r=>{e[r]===void 0&&(n==="empty_string"?e[r]="":n==="copy_key"&&(i._beforeToTranslate?e[r]=i._beforeToTranslate(r):e[r]=r));});}static getConditionalsThenElse(e,t=[]){if(typeof e=="object"&&e&&"type"in e)if(e.type==="ifelse")e.then&&i.getConditionalsThenElse(e.then,t),e.else&&i.getConditionalsThenElse(e.else,t);else if(e.type==="stepswitch"){if(e.elements)if(Array.isArray(e.elements))e.elements.forEach(s=>{i.getConditionalsThenElse(s,t);});else if(e.elements.type==="ifelse"){let s=[];i.getConditionalsThenElse(e.elements,s),s.forEach(n=>{t.push(...n);});}else if(e.elements.type==="stepswitch"){let s=[];i.getConditionalsThenElse(e.elements,s),s.forEach(n=>{t.push(...n);});}else i.getConditionalsThenElse(e.elements,t);}else e.type==="resulttocombine"?(e.firstItem&&i.getConditionalsThenElse(e.firstItem,t),e.secondConditionalItem&&e.secondConditionalItem.forEach(s=>{i.getConditionalsThenElse(s,t);})):t.push(e);else e&&t.push(e);return t}static generateJsonTranslation(e,t={},s={}){return e.forEach(n=>{if(n.choices){let r=[];Array.isArray(n.choices)?r=[n.choices]:r=i.getConditionalsThenElse(n.choices),r.forEach(o=>o.forEach(a=>{if("type"in a){let T=[];a.type==="ifelse"||a.type==="stepswitch"?i.getConditionalsThenElse(a,T):T=[a],T.map(l=>i.getConditionalsThenElse(l.text)).forEach(l=>{Array.isArray(l)&&l.forEach(f=>{Array.isArray(f)?f.forEach(h=>{typeof h=="string"?i.addKey(t,h,s):i.getConditionalsThenElse(h).forEach(c=>{Array.isArray(c)?c.forEach(p=>{typeof p=="string"&&i.addKey(t,p,s);}):typeof c=="string"&&i.addKey(t,c,s);});}):typeof f=="string"&&i.addKey(t,f,s);});});}}));}if(n.dialogue){let r=[];Array.isArray(n.dialogue)?r=[n.dialogue]:r=i.getConditionalsThenElse(n.dialogue),r.forEach(o=>{typeof o=="string"?i.addKey(t,o,s):"text"in o&&Array.isArray(o.text)&&o.text.forEach(a=>{typeof a=="string"?i.addKey(t,a,s):i.getConditionalsThenElse(a).forEach(y=>{typeof y=="string"?i.addKey(t,y,s):Array.isArray(y)&&y.forEach(l=>{typeof l=="string"?i.addKey(t,l,s):i.getConditionalsThenElse(l).forEach(f=>{typeof f=="string"&&i.addKey(t,f,s);});});});});});}n.conditionalStep&&i.getConditionalsThenElse(n.conditionalStep).forEach(o=>{Array.isArray(o)?i.generateJsonTranslation(o,t,s):i.generateJsonTranslation([o],t,s);});}),t}};var u=g;export{u as translator};
1
+ var g=class t{static _beforeToTranslate=void 0;static _translate=e=>e;static _afterToTranslate=void 0;static t(e){return Array.isArray(e)?e.map(i=>t.translate(`${i}`)):t.translate(`${e}`)}static set beforeToTranslate(e){t._beforeToTranslate=e;}static set translate(e){t._translate=e;}static get translate(){return e=>{let i=e;return t._beforeToTranslate&&(i=t._beforeToTranslate(i)),i=t._translate(i),t._afterToTranslate&&(i=t._afterToTranslate(i)),i}}static set afterToTranslate(e){t._afterToTranslate=e;}static addKey(e,i,s){let n=s.defaultValue||"empty_string";typeof i=="string"&&(i=[i]),Array.isArray(i)&&i.forEach(r=>{e[r]===void 0&&(n==="empty_string"?e[r]="":n==="copy_key"&&(t._beforeToTranslate?e[r]=t._beforeToTranslate(r):e[r]=r));});}static getConditionalsThenElse(e,i=[]){if(typeof e=="object"&&e&&"type"in e)if(e.type==="ifelse")e.then&&t.getConditionalsThenElse(e.then,i),e.else&&t.getConditionalsThenElse(e.else,i);else if(e.type==="stepswitch"){if(e.elements)if(Array.isArray(e.elements))e.elements.forEach(s=>{t.getConditionalsThenElse(s,i);});else if(e.elements.type==="ifelse"){let s=[];t.getConditionalsThenElse(e.elements,s),s.forEach(n=>{i.push(...n);});}else if(e.elements.type==="stepswitch"){let s=[];t.getConditionalsThenElse(e.elements,s),s.forEach(n=>{i.push(...n);});}else t.getConditionalsThenElse(e.elements,i);}else e.type==="resulttocombine"?(e.firstItem&&t.getConditionalsThenElse(e.firstItem,i),e.secondConditionalItem&&e.secondConditionalItem.forEach(s=>{t.getConditionalsThenElse(s,i);})):i.push(e);else e&&i.push(e);return i}static generateJsonTranslation(e,i={},s={}){return e.forEach(n=>{if(n.choices){let r=[];Array.isArray(n.choices)?r=[n.choices]:r=t.getConditionalsThenElse(n.choices),r.forEach(o=>o.forEach(a=>{if("type"in a){let T=[];a.type==="ifelse"||a.type==="stepswitch"?t.getConditionalsThenElse(a,T):T=[a],T.map(l=>t.getConditionalsThenElse(l.text)).forEach(l=>{Array.isArray(l)&&l.forEach(f=>{Array.isArray(f)?f.forEach(h=>{typeof h=="string"?t.addKey(i,h,s):t.getConditionalsThenElse(h).forEach(c=>{Array.isArray(c)?c.forEach(p=>{typeof p=="string"&&t.addKey(i,p,s);}):typeof c=="string"&&t.addKey(i,c,s);});}):typeof f=="string"&&t.addKey(i,f,s);});});}}));}if(n.dialogue){let r=[];Array.isArray(n.dialogue)?r=[n.dialogue]:r=t.getConditionalsThenElse(n.dialogue),r.forEach(o=>{typeof o=="string"?t.addKey(i,o,s):"text"in o&&Array.isArray(o.text)&&o.text.forEach(a=>{typeof a=="string"?t.addKey(i,a,s):t.getConditionalsThenElse(a).forEach(y=>{typeof y=="string"?t.addKey(i,y,s):Array.isArray(y)&&y.forEach(l=>{typeof l=="string"?t.addKey(i,l,s):t.getConditionalsThenElse(l).forEach(f=>{typeof f=="string"&&t.addKey(i,f,s);});});});});});}n.conditionalStep&&t.getConditionalsThenElse(n.conditionalStep).forEach(o=>{Array.isArray(o)?t.generateJsonTranslation(o,i,s):t.generateJsonTranslation([o],i,s);});}),i}};var u=g;export{u as translator};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@drincs/pixi-vn-json",
3
- "version": "1.0.11",
3
+ "version": "1.0.13",
4
4
  "type": "module",
5
5
  "description": "Pixi'VN can be integrated with JSON files to create a visual novel.",
6
6
  "main": "./dist/index.cjs",
@@ -32,7 +32,7 @@
32
32
  "typescript": "^5.6.3"
33
33
  },
34
34
  "peerDependencies": {
35
- "@drincs/pixi-vn": ">=0.8.2"
35
+ "@drincs/pixi-vn": ">=0.8.5"
36
36
  },
37
37
  "keywords": [
38
38
  "game",