@drincs/pixi-vn-json 1.0.1 → 1.0.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/{PixiVNJsonConditionalStatements-BBopD3ft.d.cts → PixiVNJsonConditionalStatements-CVkQSKpq.d.cts} +15 -4
- package/dist/{PixiVNJsonConditionalStatements-CSzbVYiW.d.ts → PixiVNJsonConditionalStatements-CVkQSKpq.d.ts} +15 -4
- package/dist/classes/LabelJson.cjs +3 -10
- package/dist/classes/LabelJson.d.cts +15 -10
- package/dist/classes/LabelJson.d.ts +15 -10
- package/dist/classes/LabelJson.js +5 -6
- package/dist/classes/index.cjs +3 -10
- package/dist/classes/index.d.cts +1 -6
- package/dist/classes/index.d.ts +1 -6
- package/dist/classes/index.js +5 -6
- package/dist/functions/importer.cjs +3 -11
- package/dist/functions/importer.d.cts +6 -9
- package/dist/functions/importer.d.ts +6 -9
- package/dist/functions/importer.js +5 -7
- package/dist/functions/index.cjs +5 -15
- package/dist/functions/index.d.cts +6 -9
- package/dist/functions/index.d.ts +6 -9
- package/dist/functions/index.js +5 -7
- package/dist/functions/operationUtility.cjs +9 -0
- package/dist/functions/operationUtility.d.cts +11 -0
- package/dist/functions/operationUtility.d.ts +11 -0
- package/dist/functions/operationUtility.js +7 -0
- package/dist/functions/utility.cjs +5 -11
- package/dist/functions/utility.d.cts +11 -17
- package/dist/functions/utility.d.ts +11 -17
- package/dist/functions/utility.js +5 -5
- package/dist/index.cjs +7 -17
- package/dist/index.d.cts +2 -7
- package/dist/index.d.ts +2 -7
- package/dist/index.js +5 -7
- package/dist/interface/PixiVNJson.d.cts +1 -5
- package/dist/interface/PixiVNJson.d.ts +1 -5
- package/dist/interface/PixiVNJsonArithmeticOperations.d.cts +1 -2
- package/dist/interface/PixiVNJsonArithmeticOperations.d.ts +1 -2
- package/dist/interface/PixiVNJsonConditionalResultToCombine.d.cts +1 -2
- package/dist/interface/PixiVNJsonConditionalResultToCombine.d.ts +1 -2
- package/dist/interface/PixiVNJsonConditionalStatements.d.cts +1 -2
- package/dist/interface/PixiVNJsonConditionalStatements.d.ts +1 -2
- package/dist/interface/PixiVNJsonConditions.d.cts +1 -2
- package/dist/interface/PixiVNJsonConditions.d.ts +1 -2
- package/dist/interface/PixiVNJsonIfElse.d.cts +1 -2
- package/dist/interface/PixiVNJsonIfElse.d.ts +1 -2
- package/dist/interface/PixiVNJsonLabelStep.d.cts +13 -9
- package/dist/interface/PixiVNJsonLabelStep.d.ts +13 -9
- package/dist/interface/PixiVNJsonLabels.d.cts +1 -5
- package/dist/interface/PixiVNJsonLabels.d.ts +1 -5
- package/dist/interface/PixiVNJsonMedia.d.cts +1 -3
- package/dist/interface/PixiVNJsonMedia.d.ts +1 -3
- package/dist/interface/PixiVNJsonMediaTransiotions.d.cts +1 -1
- package/dist/interface/PixiVNJsonMediaTransiotions.d.ts +1 -1
- package/dist/interface/PixiVNJsonOperations.d.cts +1 -4
- package/dist/interface/PixiVNJsonOperations.d.ts +1 -4
- package/dist/interface/PixiVNJsonStepSwitch.d.cts +1 -2
- package/dist/interface/PixiVNJsonStepSwitch.d.ts +1 -2
- package/dist/interface/PixiVNJsonUnionCondition.d.cts +1 -2
- package/dist/interface/PixiVNJsonUnionCondition.d.ts +1 -2
- package/dist/interface/PixiVNJsonValue.d.cts +1 -2
- package/dist/interface/PixiVNJsonValue.d.ts +1 -2
- package/dist/interface/index.d.cts +1 -5
- package/dist/interface/index.d.ts +1 -5
- package/package.json +2 -2
- package/dist/interface/PixiVNJsonLabelCondition.cjs +0 -2
- package/dist/interface/PixiVNJsonLabelCondition.d.cts +0 -16
- package/dist/interface/PixiVNJsonLabelCondition.d.ts +0 -16
- package/dist/interface/PixiVNJsonLabelCondition.js +0 -1
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { StorageElementType } from '@drincs/pixi-vn';
|
|
2
|
-
import PixiVNJsonLabelCondition from './interface/PixiVNJsonLabelCondition.cjs';
|
|
3
2
|
|
|
4
3
|
type PixiVNJsonStepSwitchElementType<Then> = Then | PixiVNJsonConditionalStatements<Then> | PixiVNJsonConditionalResultToCombine<Then>;
|
|
5
4
|
type PixiVNJsonStepSwitchElementsType<Then> = (PixiVNJsonStepSwitchElementType<Then>)[] | PixiVNJsonConditionalStatements<Then[]>;
|
|
@@ -92,13 +91,25 @@ type PixiVNJsonLabelGet = {
|
|
|
92
91
|
*/
|
|
93
92
|
storageType: "label";
|
|
94
93
|
};
|
|
94
|
+
type PixiVNJsonChoiceGet = {
|
|
95
|
+
type: "value";
|
|
96
|
+
storageOperationType: "get";
|
|
97
|
+
/**
|
|
98
|
+
* index of the choice
|
|
99
|
+
*/
|
|
100
|
+
index: number;
|
|
101
|
+
/**
|
|
102
|
+
* If it is a choice, the value will be get with the function {@link narration.getTimesChoiceOpened}
|
|
103
|
+
*/
|
|
104
|
+
storageType: "choice";
|
|
105
|
+
};
|
|
95
106
|
type PixiVNJsonLogicGet = {
|
|
96
107
|
type: "value";
|
|
97
108
|
storageOperationType: "get";
|
|
98
109
|
operation: PixiVNJsonArithmeticOperations | PixiVNJsonConditions;
|
|
99
110
|
storageType: "logic";
|
|
100
111
|
};
|
|
101
|
-
type PixiVNJsonValueGet = PixiVNJsonStorageGet | PixiVNJsonParamGet | PixiVNJsonLabelGet | PixiVNJsonLogicGet;
|
|
112
|
+
type PixiVNJsonValueGet = PixiVNJsonStorageGet | PixiVNJsonParamGet | PixiVNJsonLabelGet | PixiVNJsonChoiceGet | PixiVNJsonLogicGet;
|
|
102
113
|
type PixiVNJsonOnlyStorageSet = {
|
|
103
114
|
type: "value";
|
|
104
115
|
storageOperationType: "set";
|
|
@@ -210,7 +221,7 @@ type PixiVNJsonValueCondition = StorageElementType | PixiVNJsonValueGet;
|
|
|
210
221
|
/**
|
|
211
222
|
* Conditions for PixiVNJson
|
|
212
223
|
*/
|
|
213
|
-
type PixiVNJsonConditions = PixiVNJsonComparation | PixiVNJsonValueCondition | PixiVNJsonUnionCondition |
|
|
224
|
+
type PixiVNJsonConditions = PixiVNJsonComparation | PixiVNJsonValueCondition | PixiVNJsonUnionCondition | PixiVNJsonArithmeticOperations;
|
|
214
225
|
|
|
215
226
|
/**
|
|
216
227
|
* If-Else condition for PixiVNJson
|
|
@@ -233,4 +244,4 @@ interface PixiVNJsonIfElse<Then> {
|
|
|
233
244
|
|
|
234
245
|
type PixiVNJsonConditionalStatements<Then> = PixiVNJsonStepSwitch<Then> | PixiVNJsonIfElse<Then | PixiVNJsonConditionalStatements<Then> | PixiVNJsonConditionalResultToCombine<Then>>;
|
|
235
246
|
|
|
236
|
-
export type { PixiVNJsonArithmeticOperations as P, PixiVNJsonConditionalResultToCombine as a, PixiVNJsonConditionalStatements as b, PixiVNJsonComparation as c, PixiVNJsonConditions as d, PixiVNJsonIfElse as e, PixiVNJsonStepSwitch as f, PixiVNJsonStepSwitchElementType as g, PixiVNJsonStepSwitchElementsType as h, PixiVNJsonUnionCondition as i,
|
|
247
|
+
export type { PixiVNJsonArithmeticOperations as P, PixiVNJsonConditionalResultToCombine as a, PixiVNJsonConditionalStatements as b, PixiVNJsonComparation as c, PixiVNJsonConditions as d, PixiVNJsonIfElse as e, PixiVNJsonStepSwitch as f, PixiVNJsonStepSwitchElementType as g, PixiVNJsonStepSwitchElementsType as h, PixiVNJsonUnionCondition as i, PixiVNJsonChoiceGet as j, PixiVNJsonLabelGet as k, PixiVNJsonLogicGet as l, PixiVNJsonParamGet as m, PixiVNJsonStorageGet as n, PixiVNJsonValueGet as o, PixiVNJsonValueSet as p };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { StorageElementType } from '@drincs/pixi-vn';
|
|
2
|
-
import PixiVNJsonLabelCondition from './interface/PixiVNJsonLabelCondition.js';
|
|
3
2
|
|
|
4
3
|
type PixiVNJsonStepSwitchElementType<Then> = Then | PixiVNJsonConditionalStatements<Then> | PixiVNJsonConditionalResultToCombine<Then>;
|
|
5
4
|
type PixiVNJsonStepSwitchElementsType<Then> = (PixiVNJsonStepSwitchElementType<Then>)[] | PixiVNJsonConditionalStatements<Then[]>;
|
|
@@ -92,13 +91,25 @@ type PixiVNJsonLabelGet = {
|
|
|
92
91
|
*/
|
|
93
92
|
storageType: "label";
|
|
94
93
|
};
|
|
94
|
+
type PixiVNJsonChoiceGet = {
|
|
95
|
+
type: "value";
|
|
96
|
+
storageOperationType: "get";
|
|
97
|
+
/**
|
|
98
|
+
* index of the choice
|
|
99
|
+
*/
|
|
100
|
+
index: number;
|
|
101
|
+
/**
|
|
102
|
+
* If it is a choice, the value will be get with the function {@link narration.getTimesChoiceOpened}
|
|
103
|
+
*/
|
|
104
|
+
storageType: "choice";
|
|
105
|
+
};
|
|
95
106
|
type PixiVNJsonLogicGet = {
|
|
96
107
|
type: "value";
|
|
97
108
|
storageOperationType: "get";
|
|
98
109
|
operation: PixiVNJsonArithmeticOperations | PixiVNJsonConditions;
|
|
99
110
|
storageType: "logic";
|
|
100
111
|
};
|
|
101
|
-
type PixiVNJsonValueGet = PixiVNJsonStorageGet | PixiVNJsonParamGet | PixiVNJsonLabelGet | PixiVNJsonLogicGet;
|
|
112
|
+
type PixiVNJsonValueGet = PixiVNJsonStorageGet | PixiVNJsonParamGet | PixiVNJsonLabelGet | PixiVNJsonChoiceGet | PixiVNJsonLogicGet;
|
|
102
113
|
type PixiVNJsonOnlyStorageSet = {
|
|
103
114
|
type: "value";
|
|
104
115
|
storageOperationType: "set";
|
|
@@ -210,7 +221,7 @@ type PixiVNJsonValueCondition = StorageElementType | PixiVNJsonValueGet;
|
|
|
210
221
|
/**
|
|
211
222
|
* Conditions for PixiVNJson
|
|
212
223
|
*/
|
|
213
|
-
type PixiVNJsonConditions = PixiVNJsonComparation | PixiVNJsonValueCondition | PixiVNJsonUnionCondition |
|
|
224
|
+
type PixiVNJsonConditions = PixiVNJsonComparation | PixiVNJsonValueCondition | PixiVNJsonUnionCondition | PixiVNJsonArithmeticOperations;
|
|
214
225
|
|
|
215
226
|
/**
|
|
216
227
|
* If-Else condition for PixiVNJson
|
|
@@ -233,4 +244,4 @@ interface PixiVNJsonIfElse<Then> {
|
|
|
233
244
|
|
|
234
245
|
type PixiVNJsonConditionalStatements<Then> = PixiVNJsonStepSwitch<Then> | PixiVNJsonIfElse<Then | PixiVNJsonConditionalStatements<Then> | PixiVNJsonConditionalResultToCombine<Then>>;
|
|
235
246
|
|
|
236
|
-
export type { PixiVNJsonArithmeticOperations as P, PixiVNJsonConditionalResultToCombine as a, PixiVNJsonConditionalStatements as b, PixiVNJsonComparation as c, PixiVNJsonConditions as d, PixiVNJsonIfElse as e, PixiVNJsonStepSwitch as f, PixiVNJsonStepSwitchElementType as g, PixiVNJsonStepSwitchElementsType as h, PixiVNJsonUnionCondition as i,
|
|
247
|
+
export type { PixiVNJsonArithmeticOperations as P, PixiVNJsonConditionalResultToCombine as a, PixiVNJsonConditionalStatements as b, PixiVNJsonComparation as c, PixiVNJsonConditions as d, PixiVNJsonIfElse as e, PixiVNJsonStepSwitch as f, PixiVNJsonStepSwitchElementType as g, PixiVNJsonStepSwitchElementsType as h, PixiVNJsonUnionCondition as i, PixiVNJsonChoiceGet as j, PixiVNJsonLabelGet as k, PixiVNJsonLogicGet as l, PixiVNJsonParamGet as m, PixiVNJsonStorageGet as n, PixiVNJsonValueGet as o, PixiVNJsonValueSet as p };
|
|
@@ -1,16 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var pixiVn = require('@drincs/pixi-vn');
|
|
4
|
-
var Ve = require('@drincs/pixi-vn/dist/classes/LabelAbstract');
|
|
5
|
-
var I = require('@drincs/pixi-vn/dist/managers/NarrationManagerStatic');
|
|
6
|
-
var q = require('@drincs/pixi-vn/dist/managers/StorageManagerStatic');
|
|
7
4
|
|
|
8
|
-
function
|
|
5
|
+
var ae=Object.create;var W=Object.defineProperty;var re=Object.getOwnPropertyDescriptor;var oe=Object.getOwnPropertyNames;var se=Object.getPrototypeOf,le=Object.prototype.hasOwnProperty;var G=(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 z=(i,t)=>()=>(t||i((t={exports:{}}).exports,t),t.exports);var ue=(i,t,e,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of oe(t))!le.call(i,o)&&o!==e&&W(i,o,{get:()=>t[o],enumerable:!(a=re(t,o))||a.enumerable});return i};var fe=(i,t,e)=>(e=i!=null?ae(se(i)):{},ue(W(e,"default",{value:i,enumerable:!0}),i));var U=z((A,M)=>{(function(i,t){typeof A=="object"?M.exports=A=t():typeof define=="function"&&define.amd?define([],t):i.CryptoJS=t();})(A,function(){var i=i||function(t,e){var a;if(typeof window<"u"&&window.crypto&&(a=window.crypto),typeof self<"u"&&self.crypto&&(a=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(a=globalThis.crypto),!a&&typeof window<"u"&&window.msCrypto&&(a=window.msCrypto),!a&&typeof global<"u"&&global.crypto&&(a=global.crypto),!a&&typeof G=="function")try{a=G("crypto");}catch{}var o=function(){if(a){if(typeof a.getRandomValues=="function")try{return a.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof a.randomBytes=="function")try{return a.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},f=Object.create||function(){function n(){}return function(r){var u;return n.prototype=r,u=new n,n.prototype=null,u}}(),c={},b=c.lib={},g=b.Base=function(){return {extend:function(n){var r=f(this);return n&&r.mixIn(n),(!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 n=this.extend();return n.init.apply(n,arguments),n},init:function(){},mixIn:function(n){for(var r in n)n.hasOwnProperty(r)&&(this[r]=n[r]);n.hasOwnProperty("toString")&&(this.toString=n.toString);},clone:function(){return this.init.prototype.extend(this)}}}(),d=b.WordArray=g.extend({init:function(n,r){n=this.words=n||[],r!=e?this.sigBytes=r:this.sigBytes=n.length*4;},toString:function(n){return (n||m).stringify(this)},concat:function(n){var r=this.words,u=n.words,p=this.sigBytes,V=n.sigBytes;if(this.clamp(),p%4)for(var N=0;N<V;N++){var R=u[N>>>2]>>>24-N%4*8&255;r[p+N>>>2]|=R<<24-(p+N)%4*8;}else for(var v=0;v<V;v+=4)r[p+v>>>2]=u[v>>>2];return this.sigBytes+=V,this},clamp:function(){var n=this.words,r=this.sigBytes;n[r>>>2]&=4294967295<<32-r%4*8,n.length=t.ceil(r/4);},clone:function(){var n=g.clone.call(this);return n.words=this.words.slice(0),n},random:function(n){for(var r=[],u=0;u<n;u+=4)r.push(o());return new d.init(r,n)}}),l=c.enc={},m=l.Hex={stringify:function(n){for(var r=n.words,u=n.sigBytes,p=[],V=0;V<u;V++){var N=r[V>>>2]>>>24-V%4*8&255;p.push((N>>>4).toString(16)),p.push((N&15).toString(16));}return p.join("")},parse:function(n){for(var r=n.length,u=[],p=0;p<r;p+=2)u[p>>>3]|=parseInt(n.substr(p,2),16)<<24-p%8*4;return new d.init(u,r/2)}},h=l.Latin1={stringify:function(n){for(var r=n.words,u=n.sigBytes,p=[],V=0;V<u;V++){var N=r[V>>>2]>>>24-V%4*8&255;p.push(String.fromCharCode(N));}return p.join("")},parse:function(n){for(var r=n.length,u=[],p=0;p<r;p++)u[p>>>2]|=(n.charCodeAt(p)&255)<<24-p%4*8;return new d.init(u,r)}},x=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)))}},y=b.BufferedBlockAlgorithm=g.extend({reset:function(){this._data=new d.init,this._nDataBytes=0;},_append:function(n){typeof n=="string"&&(n=x.parse(n)),this._data.concat(n),this._nDataBytes+=n.sigBytes;},_process:function(n){var r,u=this._data,p=u.words,V=u.sigBytes,N=this.blockSize,R=N*4,v=V/R;n?v=t.ceil(v):v=t.max((v|0)-this._minBufferSize,0);var k=v*N,F=t.min(k*4,V);if(k){for(var B=0;B<k;B+=N)this._doProcessBlock(p,B);r=p.splice(0,k),u.sigBytes-=F;}return new d.init(r,F)},clone:function(){var n=g.clone.call(this);return n._data=this._data.clone(),n},_minBufferSize:0});b.Hasher=y.extend({cfg:g.extend(),init:function(n){this.cfg=this.cfg.extend(n),this.reset();},reset:function(){y.reset.call(this),this._doReset();},update:function(n){return this._append(n),this._process(),this},finalize:function(n){n&&this._append(n);var r=this._doFinalize();return r},blockSize:512/32,_createHelper:function(n){return function(r,u){return new n.init(u).finalize(r)}},_createHmacHelper:function(n){return function(r,u){return new T.HMAC.init(n,u).finalize(r)}}});var T=c.algo={};return c}(Math);return i});});var q=z((E,X)=>{(function(i,t){typeof E=="object"?X.exports=E=t(U()):typeof define=="function"&&define.amd?define(["./core"],t):t(i.CryptoJS);})(E,function(i){return function(){var t=i,e=t.lib,a=e.WordArray,o=e.Hasher,f=t.algo,c=[],b=f.SHA1=o.extend({_doReset:function(){this._hash=new a.init([1732584193,4023233417,2562383102,271733878,3285377520]);},_doProcessBlock:function(g,d){for(var l=this._hash.words,m=l[0],h=l[1],x=l[2],y=l[3],S=l[4],T=0;T<80;T++){if(T<16)c[T]=g[d+T]|0;else {var n=c[T-3]^c[T-8]^c[T-14]^c[T-16];c[T]=n<<1|n>>>31;}var r=(m<<5|m>>>27)+S+c[T];T<20?r+=(h&x|~h&y)+1518500249:T<40?r+=(h^x^y)+1859775393:T<60?r+=(h&x|h&y|x&y)-1894007588:r+=(h^x^y)-899497514,S=y,y=x,x=h<<30|h>>>2,h=m,m=r;}l[0]=l[0]+m|0,l[1]=l[1]+h|0,l[2]=l[2]+x|0,l[3]=l[3]+y|0,l[4]=l[4]+S|0;},_doFinalize:function(){var g=this._data,d=g.words,l=this._nDataBytes*8,m=g.sigBytes*8;return d[m>>>5]|=128<<24-m%32,d[(m+64>>>9<<4)+14]=Math.floor(l/4294967296),d[(m+64>>>9<<4)+15]=l,g.sigBytes=d.length*4,this._process(),this._hash},clone:function(){var g=o.clone.call(this);return g._hash=this._hash.clone(),g}});t.SHA1=o._createHelper(b),t.HmacSHA1=o._createHmacHelper(b);}(),i.SHA1});});var ne=fe(q());var _="___param___";function de(i,t){return Math.floor(Math.random()*(t-i+1)+i)}function pe(i){if(Array.isArray(i)||!i)return i;if(i&&typeof i=="object"&&"type"in i)switch(i.type){case"resulttocombine":return ge(i);case"ifelse":return s(i.condition)?s(i.then):s(i.else);case"stepswitch":let e=s(i.elements)||[];if(e.length===0){console.error("[Pixi\u2019VN Json] getValueFromConditionalStatements elements.length === 0");return}switch(i.choiceType){case"random":let a=de(0,e.length-1);return s(e[a]);case"loop":let o=pixiVn.NarrationManagerStatic.getCurrentStepTimesCounter(i.nestedId)-1;return o>e.length-1&&(o=o%e.length),s(e[o]);case"sequential":let f,c=pixiVn.NarrationManagerStatic.getCurrentStepTimesCounter(i.nestedId)-1;return i.end=="lastItem"&&(f=s(e[e.length-1])),c>e.length-1?f:s(e[c]);case"sequentialrandom":let b=pixiVn.NarrationManagerStatic.getRandomNumber(0,e.length-1,{nestedId:i.nestedId,onceOnly:!0});if(b==null&&i.end=="lastItem"){let g=pixiVn.NarrationManagerStatic.getCurrentStepTimesCounterData(i.nestedId);if(!g||!g?.usedRandomNumbers){console.warn("[Pixi\u2019VN Json] getValueFromConditionalStatements randomIndexWhitExclude == undefined");return}let d=g.usedRandomNumbers[`0-${e.length-1}`];return s(e[d[d.length-1]])}if(b==null){console.warn("[Pixi\u2019VN Json] getValueFromConditionalStatements randomIndexWhitExclude == undefined");return}return s(e[b])}}return i}function D(i){if(i.conditionalStep){let t=pixiVn.createExportableElement(s(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?.operation===void 0&&delete t?.operation,t){let e={...i,conditionalStep:void 0,...t};return D(e)}else pixiVn.getFlag(pixiVn.storage.keysSystem.ADD_NEXT_DIALOG_TEXT_INTO_THE_CURRENT_DIALOG_FLAG_KEY)&&pixiVn.setFlag(pixiVn.storage.keysSystem.ADD_NEXT_DIALOG_TEXT_INTO_THE_CURRENT_DIALOG_FLAG_KEY,!1);}return i}function ge(i){let t=i.firstItem,e=[];i.secondConditionalItem?.forEach(o=>{if(Array.isArray(o))o.forEach(f=>{let c=s(f);e.push(c);});else {let f=s(o);e.push(f);}});let a=t?[t,...e]:e;if(a.length===0){console.warn("[Pixi\u2019VN Json] combinateResult toCheck.length === 0");return}if(typeof a[0]=="string")return a.join("");if(typeof a[0]=="object"){let o=a,f,c=o.map((n,r)=>{n=D(n);let u=s(n.dialogue)||"";return r===0?(f=s(n.glueEnabled)||!1,u):(typeof u=="object"&&"text"in u&&(u=u.character+": "+u.text),f===!1&&(u=`
|
|
9
6
|
|
|
10
|
-
var
|
|
11
|
-
var I__default = /*#__PURE__*/_interopDefault(I);
|
|
12
|
-
var q__default = /*#__PURE__*/_interopDefault(q);
|
|
7
|
+
`+u),f=s(n.glueEnabled)||!1,u)}),b=s(c[0]),g=typeof b=="object"&&"character"in b?b.character:void 0,d=c.map(n=>{let r;n&&typeof n=="object"&&"text"in n?r=n.text:r=n;let u;return Array.isArray(r)?u=r.map(p=>`${s(p)}`).join(""):u=s(r)||"",u}).join(""),l=o.find(n=>n.end),m=o.find(n=>n.choices),h=!1,x=!1;o.length>0&&(o[0].glueEnabled&&o[0].goNextStep&&o[0].dialogue===void 0&&pixiVn.setFlag(pixiVn.storage.keysSystem.ADD_NEXT_DIALOG_TEXT_INTO_THE_CURRENT_DIALOG_FLAG_KEY,!0),h=o[o.length-1].glueEnabled,x=o.reverse().find(n=>!(n.operation&&(!n.dialogue||!n.choices)))?.goNextStep);let y=o.find(n=>n.labelToOpen),S=[];return o.forEach(n=>{n.operation&&S.forEach(r=>{S.push(r);});}),{dialogue:g?{character:g,text:d}:d,end:l?.end,choices:m?.choices,glueEnabled:h,goNextStep:x,labelToOpen:y?.labelToOpen,operation:S}}}function he(i){if(!i)return !1;if(typeof i!="object"||!("type"in i))return !!i;switch(i.type){case"compare":let t=s(i.leftValue),e=s(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 !!s(i.value);case"union":return me(i)}return !!i}function ye(i){if(i&&typeof i=="object"&&"type"in i&&i.type==="value"&&i.storageOperationType==="get")switch(i.storageType){case"storage":case"tempstorage":return pixiVn.storage.getVariable(i.key);case"flagStorage":return pixiVn.getFlag(i.key);case"label":return pixiVn.narration.getTimesLabelOpened(i.label);case"choice":return pixiVn.narration.getTimesChoiceMade(i.index);case"logic":return s(i.operation);case"params":let t=pixiVn.storage.getVariable(`${_}${pixiVn.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 me(i){if(i.unionType==="not")return !s(i.condition);let t=i.unionType==="and";for(let e=0;e<i.conditions.length;e++)if(t=s(i.conditions[e])||!1,i.unionType==="and"){if(!t)return !1}else if(t)return !0;return t}function Y(i){let t=s(i.value),e;switch(t&&typeof t=="object"&&"type"in t?e=s(t):e=t,i.storageType){case"flagStorage":pixiVn.setFlag(i.key,i.value);break;case"storage":pixiVn.storage.setVariable(i.key,e);break;case"tempstorage":pixiVn.storage.setTempVariable(i.key,e);break;case"params":let a=pixiVn.storage.getVariable(`${_}${pixiVn.narration.openedLabels.length-1}`)||[];a&&a.length-1>=i.key&&(a[i.key]=e),pixiVn.storage.setTempVariable(`${_}${pixiVn.narration.openedLabels.length-1}`,a);break}}function s(i){let t=pe(i);if(t&&typeof t=="object"&&"type"in t)switch(t.type){case"value":return ye(t);case"arithmetic":case"arithmeticsingle":return xe(t);case"compare":case"valueCondition":case"union":return he(t)}return t}function xe(i){let t=s(i.leftValue);switch(i.type){case"arithmetic":let e=s(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 pixiVn.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 j(i,t){let e=s(i);if(e)switch(e.type){case"sound":switch(e.operationType){case"add":pixiVn.sound.add(e.alias,{...e.props,url:e.url});break;case"play":pixiVn.sound.play(e.alias,e.props);break;case"remove":pixiVn.sound.remove(e.alias);break;case"pause":pixiVn.sound.pause(e.alias);break;case"resume":pixiVn.sound.resume(e.alias);break;case"volume":pixiVn.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 pixiVn.showWithFadeTransition(e.alias,e.url,e.transition.props,e.transition.priority);break;case"dissolve":await pixiVn.showWithDissolveTransition(e.alias,e.url,e.transition.props,e.transition.priority);break;case"movein":case"moveout":await pixiVn.moveIn(e.alias,e.url,e.transition.props,e.transition.priority);break;case"zoomin":case"zoomout":await pixiVn.zoomIn(e.alias,e.url,e.transition.props,e.transition.priority);break}else await pixiVn.showImage(e.alias,e.url);break;case"edit":let a=pixiVn.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":pixiVn.canvas.remove(e.alias);break}break;case"video":switch(e.operationType){case"show":if(e.transition){let c=new pixiVn.CanvasVideo;switch(c.videoLink=e.url,e.transition.type){case"fade":await pixiVn.showWithFadeTransition(e.alias,c,e.transition.props,e.transition.priority);break;case"dissolve":await pixiVn.showWithDissolveTransition(e.alias,c,e.transition.props,e.transition.priority);break;case"movein":case"moveout":await pixiVn.moveIn(e.alias,c,e.transition.props,e.transition.priority);break;case"zoomin":case"zoomout":await pixiVn.zoomIn(e.alias,c,e.transition.props,e.transition.priority);break}}else await pixiVn.showVideo(e.alias,e.url);break;case"edit":let a=pixiVn.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":pixiVn.canvas.remove(e.alias);break;case"pause":let o=pixiVn.canvas.find(e.alias);o?o.paused=!0:console.error(`[Pixi\u2019VN Json] Video with alias ${e.alias} not found.`);break;case"resume":let f=pixiVn.canvas.find(e.alias);f?f.paused=!1:console.error(`[Pixi\u2019VN Json] Video with alias ${e.alias} not found.`);break}break;case"value":Y(e);break;case"oprationtoconvert":if(t){let a="";e.values.forEach(f=>{if(typeof f=="string")a+=f;else {let c=s(f);a+=`${c}`;}});let o=t(a);o&&await j(o);}break;case"input":switch(e.operationType){case"request":pixiVn.narration.requestInput({type:e.valueType});break}break}}var $=class extends pixiVn.LabelAbstract{constructor(t,e,a,o={}){super(t,a),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, ne.default)(e.toString().toLocaleLowerCase()).toString()}getDialogueText(t){let e="";if(Array.isArray(t)){let a=[];t.forEach(o=>{if(typeof o=="string")a.push(o);else if(o&&typeof o=="object"){let f=s(o);f?(f&&!Array.isArray(f)&&typeof f=="object"&&(f=s(f)||""),Array.isArray(f)?a=a.concat(f):a.push(`${f}`)):a.push(`${o}`);}}),e=a;}else {let a=s(t)||"";a&&!Array.isArray(a)&&typeof a=="object"&&(a=s(a)||""),e=a;}return `${e}`}getDialogue(t){let e=s(t);if(e)return typeof e=="object"&&"character"in e&&"text"in e?{character:e.character,text:this.getDialogueText(e.text)}:this.getDialogueText(e);if(e!=null)return `${e}`}getChoices(t){return s(t)?.map(o=>s(o)).filter(o=>o!==void 0)}stepConverter(t){return async e=>{if(typeof t=="function"&&(t=t()),t=D(t),t.operation)for(let d of t.operation)await j(d,this.operationStringConvert);let a=this.getChoices(t.choices),o=s(t.glueEnabled),f=this.getDialogue(t.dialogue),c=[];t.labelToOpen&&(Array.isArray(t.labelToOpen)||(t.labelToOpen=[t.labelToOpen]),t.labelToOpen.forEach(d=>{let l=s(d);l&&c.push(l);}));let b=s(t.goNextStep),g=s(t.end);if(a){let d=a.map(l=>{let m="";if(Array.isArray(l.text)){let h=[];l.text.forEach(x=>{if(typeof x=="string")h.push(x);else if(x&&typeof x=="object"){let y=s(x);y&&!Array.isArray(y)&&typeof y=="object"&&(y=s(y)||""),y&&(Array.isArray(y)?h=h.concat(y):h.push(y));}}),m=h.join();}else typeof l.text=="string"&&(m=l.text);return new pixiVn.ChoiceMenuOption(m,l.label,l.props,{type:l.type,oneTime:l.oneTime,onlyHaveNoChoice:l.onlyHaveNoChoice,autoSelect:l.autoSelect})});pixiVn.narration.choiceMenuOptions=d;}else pixiVn.narration.choiceMenuOptions=void 0;f!==void 0&&(pixiVn.narration.dialogue=f,this.skipEmptyDialogs&&typeof f=="string"&&(f===""||RegExp(/^\s+$/).test(f))&&(b=!0)),o?pixiVn.setFlag(pixiVn.storage.keysSystem.ADD_NEXT_DIALOG_TEXT_INTO_THE_CURRENT_DIALOG_FLAG_KEY,!0):o===!1&&pixiVn.setFlag(pixiVn.storage.keysSystem.ADD_NEXT_DIALOG_TEXT_INTO_THE_CURRENT_DIALOG_FLAG_KEY,!1),c.forEach(d=>{let l=d.label;typeof l=="object"&&(l=s(l)||"");let m=d.params?.map(h=>s(h));e={...e,...d.props},d.type==="jump"?(pixiVn.narration.closeCurrentLabel(),pixiVn.storage.setTempVariable(`${_}${pixiVn.narration.openedLabels.length}`,m),pixiVn.narration.callLabel(l,e)):(pixiVn.storage.setTempVariable(`${_}${pixiVn.narration.openedLabels.length}`,m),pixiVn.narration.callLabel(l,e));}),g==="game_end"?(pixiVn.narration.closeAllLabels(),await pixiVn.narration.goNext(e)):g==="label_end"&&pixiVn.narration.closeCurrentLabel(),b&&await pixiVn.narration.goNext(e);}}};
|
|
13
8
|
|
|
14
|
-
var ne=Object.create;var G=Object.defineProperty;var re=Object.getOwnPropertyDescriptor;var ae=Object.getOwnPropertyNames;var oe=Object.getPrototypeOf,se=Object.prototype.hasOwnProperty;var D=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(i,n)=>(typeof require<"u"?require:i)[n]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var F=(t,i)=>()=>(i||t((i={exports:{}}).exports,i),i.exports);var le=(t,i,n,e)=>{if(i&&typeof i=="object"||typeof i=="function")for(let a of ae(i))!se.call(t,a)&&a!==n&&G(t,a,{get:()=>i[a],enumerable:!(e=re(i,a))||e.enumerable});return t};var ue=(t,i,n)=>(n=t!=null?ne(oe(t)):{},le(G(n,"default",{value:t,enumerable:!0}),t));var M=F((O,z)=>{(function(t,i){typeof O=="object"?z.exports=O=i():typeof define=="function"&&define.amd?define([],i):t.CryptoJS=i();})(O,function(){var t=t||function(i,n){var e;if(typeof window<"u"&&window.crypto&&(e=window.crypto),typeof self<"u"&&self.crypto&&(e=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(e=globalThis.crypto),!e&&typeof window<"u"&&window.msCrypto&&(e=window.msCrypto),!e&&typeof global<"u"&&global.crypto&&(e=global.crypto),!e&&typeof D=="function")try{e=D("crypto");}catch{}var a=function(){if(e){if(typeof e.getRandomValues=="function")try{return e.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof e.randomBytes=="function")try{return e.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},l=Object.create||function(){function r(){}return function(o){var p;return r.prototype=o,p=new r,r.prototype=null,p}}(),s={},d=s.lib={},x=d.Base=function(){return {extend:function(r){var o=l(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)}}}(),m=d.WordArray=x.extend({init:function(r,o){r=this.words=r||[],o!=n?this.sigBytes=o:this.sigBytes=r.length*4;},toString:function(r){return (r||f).stringify(this)},concat:function(r){var o=this.words,p=r.words,h=this.sigBytes,V=r.sigBytes;if(this.clamp(),h%4)for(var v=0;v<V;v++){var B=p[v>>>2]>>>24-v%4*8&255;o[h+v>>>2]|=B<<24-(h+v)%4*8;}else for(var w=0;w<V;w+=4)o[h+w>>>2]=p[w>>>2];return this.sigBytes+=V,this},clamp:function(){var r=this.words,o=this.sigBytes;r[o>>>2]&=4294967295<<32-o%4*8,r.length=i.ceil(o/4);},clone:function(){var r=x.clone.call(this);return r.words=this.words.slice(0),r},random:function(r){for(var o=[],p=0;p<r;p+=4)o.push(a());return new m.init(o,r)}}),u=s.enc={},f=u.Hex={stringify:function(r){for(var o=r.words,p=r.sigBytes,h=[],V=0;V<p;V++){var v=o[V>>>2]>>>24-V%4*8&255;h.push((v>>>4).toString(16)),h.push((v&15).toString(16));}return h.join("")},parse:function(r){for(var o=r.length,p=[],h=0;h<o;h+=2)p[h>>>3]|=parseInt(r.substr(h,2),16)<<24-h%8*4;return new m.init(p,o/2)}},y=u.Latin1={stringify:function(r){for(var o=r.words,p=r.sigBytes,h=[],V=0;V<p;V++){var v=o[V>>>2]>>>24-V%4*8&255;h.push(String.fromCharCode(v));}return h.join("")},parse:function(r){for(var o=r.length,p=[],h=0;h<o;h++)p[h>>>2]|=(r.charCodeAt(h)&255)<<24-h%4*8;return new m.init(p,o)}},b=u.Utf8={stringify:function(r){try{return decodeURIComponent(escape(y.stringify(r)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(r){return y.parse(unescape(encodeURIComponent(r)))}},c=d.BufferedBlockAlgorithm=x.extend({reset:function(){this._data=new m.init,this._nDataBytes=0;},_append:function(r){typeof r=="string"&&(r=b.parse(r)),this._data.concat(r),this._nDataBytes+=r.sigBytes;},_process:function(r){var o,p=this._data,h=p.words,V=p.sigBytes,v=this.blockSize,B=v*4,w=V/B;r?w=i.ceil(w):w=i.max((w|0)-this._minBufferSize,0);var A=w*v,H=i.min(A*4,V);if(A){for(var E=0;E<A;E+=v)this._doProcessBlock(h,E);o=h.splice(0,A),p.sigBytes-=H;}return new m.init(o,H)},clone:function(){var r=x.clone.call(this);return r._data=this._data.clone(),r},_minBufferSize:0});d.Hasher=c.extend({cfg:x.extend(),init:function(r){this.cfg=this.cfg.extend(r),this.reset();},reset:function(){c.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,p){return new r.init(p).finalize(o)}},_createHmacHelper:function(r){return function(o,p){return new T.HMAC.init(r,p).finalize(o)}}});var T=s.algo={};return s}(Math);return t});});var U=F((L,W)=>{(function(t,i){typeof L=="object"?W.exports=L=i(M()):typeof define=="function"&&define.amd?define(["./core"],i):i(t.CryptoJS);})(L,function(t){return function(){var i=t,n=i.lib,e=n.WordArray,a=n.Hasher,l=i.algo,s=[],d=l.SHA1=a.extend({_doReset:function(){this._hash=new e.init([1732584193,4023233417,2562383102,271733878,3285377520]);},_doProcessBlock:function(x,m){for(var u=this._hash.words,f=u[0],y=u[1],b=u[2],c=u[3],N=u[4],T=0;T<80;T++){if(T<16)s[T]=x[m+T]|0;else {var r=s[T-3]^s[T-8]^s[T-14]^s[T-16];s[T]=r<<1|r>>>31;}var o=(f<<5|f>>>27)+N+s[T];T<20?o+=(y&b|~y&c)+1518500249:T<40?o+=(y^b^c)+1859775393:T<60?o+=(y&b|y&c|b&c)-1894007588:o+=(y^b^c)-899497514,N=c,c=b,b=y<<30|y>>>2,y=f,f=o;}u[0]=u[0]+f|0,u[1]=u[1]+y|0,u[2]=u[2]+b|0,u[3]=u[3]+c|0,u[4]=u[4]+N|0;},_doFinalize:function(){var x=this._data,m=x.words,u=this._nDataBytes*8,f=x.sigBytes*8;return m[f>>>5]|=128<<24-f%32,m[(f+64>>>9<<4)+14]=Math.floor(u/4294967296),m[(f+64>>>9<<4)+15]=u,x.sigBytes=m.length*4,this._process(),this._hash},clone:function(){var x=a.clone.call(this);return x._hash=this._hash.clone(),x}});i.SHA1=a._createHelper(d),i.HmacSHA1=a._createHmacHelper(d);}(),t.SHA1});});var ie=ue(U());var R="___param___";function de(t,i){return Math.floor(Math.random()*(i-t+1)+t)}function g(t,i){if(!(Array.isArray(t)||!t)){if(t&&typeof t=="object"&&"type"in t)switch(t.type){case"resulttocombine":return pe(t,i);case"ifelse":return S(t.condition,i)?g(t.then,i):g(t.else,i);case"stepswitch":let e=g(t.elements,i)||[];if(e.length===0){console.error("[Pixi'VN] getValueFromConditionalStatements elements.length === 0");return}switch(t.choiceType){case"random":let a=de(0,e.length);return g(e[a],i);case"loop":return pixiVn.narration.currentStepTimesCounter>e.length-1?(pixiVn.narration.currentStepTimesCounter=0,g(e[0],i)):g(e[I__default.default.getCurrentStepTimesCounter(t.nestedId)],i);case"sequential":let l;return t.end=="lastItem"&&(l=g(e[e.length-1],i)),pixiVn.narration.currentStepTimesCounter>e.length-1?l:g(e[I__default.default.getCurrentStepTimesCounter(t.nestedId)],i);case"sequentialrandom":let s=I__default.default.getRandomNumber(0,e.length-1,{nestedId:t.nestedId,onceOnly:!0});if(s==null&&t.end=="lastItem"){let d=I__default.default.getCurrentStepTimesCounterData(t.nestedId);if(!d||!d?.usedRandomNumbers)return;let x=d.usedRandomNumbers[`0-${e.length-1}`];return g(e[x[x.length-1]],i)}return s==null?void 0:g(e[s],i)}}return t}}function pe(t,i){let n=t.firstItem,e=[];t.secondConditionalItem?.forEach(l=>{if(Array.isArray(l))l.forEach(s=>{let d=g(s,i);d&&e.push(d);});else {let s=g(l,i);s&&e.push(s);}});let a=n?[n,...e]:e;if(a.length!==0){if(typeof a[0]=="string")return a.join("");if(typeof a[0]=="object"){let l=a,s=l.map(c=>c.dialogue).join(""),d=l.find(c=>c.end),x=l.find(c=>c.choices),m=l.find(c=>c.glueEnabled),u=l.find(c=>c.goNextStep),f=l.find(c=>c.labelToOpen),y=l.find(c=>c.operation);return {dialogue:s,end:d?.end,choices:x?.choices,glueEnabled:m?.glueEnabled,goNextStep:u?.goNextStep,labelToOpen:f?.labelToOpen,operation:y?.operation}}}}function he(t,i){if(!t)return !1;if(typeof t!="object"||!("type"in t))return !!t;switch(t.type){case"compare":let n=C(t.leftValue,i),e=C(t.rightValue,i);switch(t.operator){case"==":return n===e;case"!=":return n!==e;case"<":return n<e;case"<=":return n<=e;case">":return n>e;case">=":return n>=e;case"CONTAINS":return n.toString().includes(e.toString())}break;case"valueCondition":return !!C(t.value,i);case"union":return ge(t,i);case"labelcondition":if("operator"in t&&"label"in t)switch(t.operator){case"started":return pixiVn.narration.getTimesLabelOpened(t.label)>0;case"completed":return pixiVn.narration.isLabelAlreadyCompleted(t.label)}break}return !!t}function C(t,i){if(t&&typeof t=="object"&&"type"in t)if(t.type==="value"&&t.storageOperationType==="get")switch(t.storageType){case"storage":return pixiVn.storage.getVariable(t.key);case"tempstorage":return q__default.default.getTempVariable(t.key);case"flagStorage":return pixiVn.getFlag(t.key);case"label":return pixiVn.narration.getTimesLabelOpened(t.label);case"logic":return S(t.operation,i);case"params":return i&&i.length-1>=t.key?i[t.key]:void 0}else return S(t,i);return t}function ge(t,i){if(t.unionType==="not")return !S(t.condition,i);let n=t.unionType==="and";for(let e=0;e<t.conditions.length;e++)if(n=S(t.conditions[e],i)||!1,t.unionType==="and"){if(!n)return !1}else if(n)return !0;return n}function X(t,i){let n=g(t.value,i),e;switch(n&&typeof n=="object"&&"type"in n?e=S(n,i):e=n,t.storageType){case"flagStorage":pixiVn.setFlag(t.key,t.value);break;case"storage":pixiVn.storage.setVariable(t.key,e);break;case"tempstorage":q__default.default.setTempVariable(t.key,e);break;case"params":i&&i.length-1>=t.key&&(i[t.key]=e);break}}function S(t,i){let n=g(t,i);if(n&&typeof n=="object"&&"type"in n)switch(n.type){case"value":return C(n,i);case"arithmetic":case"arithmeticsingle":return ye(n,i);case"compare":case"valueCondition":case"union":case"labelcondition":return he(n,i)}return n}function ye(t,i){let n=S(t.leftValue,i);switch(t.type){case"arithmetic":let e=S(t.rightValue,i);switch(t.operator){case"*":return n*e;case"/":return n/e;case"+":return n+e;case"-":return n-e;case"%":return n%e;case"POW":return Math.pow(n,e);case"RANDOM":return Math.floor(Math.random()*(e-n+1))+n}case"arithmeticsingle":switch(t.operator){case"INT":return parseInt(n);case"FLOOR":return Math.floor(n);case"FLOAT":return parseFloat(n)}break}}var j=class extends Ve__default.default{constructor(i,n,e,a){super(i,e),this._steps=n,this.operationStringConvert=a;}_steps;get steps(){return this._steps.map(this.stepConverter)}operationStringConvert;getStepSha1(i){if(i<0||i>=this.steps.length)return;let n=this._steps[i];return (0, ie.default)(n.toString().toLocaleLowerCase()).toString()}getDialogueText(i,n){let e="";if(Array.isArray(i)){let a=[];i.forEach(l=>{if(typeof l=="string")a.push(l);else if(l&&typeof l=="object"){let s=g(l,n);s&&(s&&!Array.isArray(s)&&typeof s=="object"&&(s=C(s,n)||""),Array.isArray(s)?a=a.concat(s):a.push(s));}}),e=a;}else {let a=g(i,n)||"";a&&!Array.isArray(a)&&typeof a=="object"&&(a=C(a,n)||""),e=a;}return e}getDialogue(i,n){let e=g(i,n),a;return e&&(typeof e=="object"&&"character"in e&&"text"in e?a={character:e.character,text:this.getDialogueText(e.text,n)}:a=this.getDialogueText(e,n)),a}getChoices(i,n){let e=g(i,n);if(e)return e.map(l=>g(l,n)).filter(l=>l!==void 0)}stepConverter(i){return async n=>{let e=n[R];if(typeof i=="function"&&(i=i()),i.operation)for(let u of i.operation)await this.runOperation(u,e);let a=this.getChoices(i.choices,e),l=g(i.glueEnabled,e),s=this.getDialogue(i.dialogue,e),d=[];i.labelToOpen&&(Array.isArray(i.labelToOpen)||(i.labelToOpen=[i.labelToOpen]),i.labelToOpen.forEach(u=>{let f=g(u,e);f&&d.push(f);}));let x=g(i.goNextStep,e),m=g(i.end,e);if(a){let u=a.map(f=>{let y="";if(Array.isArray(f.text)){let b=[];f.text.forEach(c=>{if(typeof c=="string")b.push(c);else if(c&&typeof c=="object"){let N=g(c,e);N&&!Array.isArray(N)&&typeof N=="object"&&(N=C(N,e)||""),N&&(Array.isArray(N)?b=b.concat(N):b.push(N));}}),y=b.join();}else typeof f.text=="string"&&(y=f.text);return new pixiVn.ChoiceMenuOption(y,f.label,f.props,{type:f.type,oneTime:f.oneTime})});u=u.filter((f,y)=>{if(f.oneTime){let b=pixiVn.narration.alreadyCurrentStepMadeChoices;if(b&&b.includes(y))return !1}return !0}),pixiVn.narration.choiceMenuOptions=u;}else pixiVn.narration.choiceMenuOptions=void 0;l?pixiVn.setFlag(pixiVn.storage.keysSystem.ADD_NEXT_DIALOG_TEXT_INTO_THE_CURRENT_DIALOG_FLAG_KEY,!0):l===!1&&pixiVn.setFlag(pixiVn.storage.keysSystem.ADD_NEXT_DIALOG_TEXT_INTO_THE_CURRENT_DIALOG_FLAG_KEY,!1),s&&(pixiVn.narration.dialogue=s),d.forEach(u=>{let f=u.label;typeof f=="object"&&(f=C(f,e)||"");let y=u.params?.map(b=>S(b,e));n={...n,...u.props,[R]:y},u.type==="jump"?pixiVn.narration.jumpLabel(f,n):pixiVn.narration.callLabel(f,n);}),x&&await pixiVn.narration.goNext(n),m==="game_end"?(pixiVn.narration.closeAllLabels(),await pixiVn.narration.goNext(n)):m==="label_end"&&pixiVn.narration.closeCurrentLabel();}}async runOperation(i,n){let e=g(i,n);if(e)switch(e.type){case"sound":switch(e.operationType){case"add":pixiVn.sound.add(e.alias,{...e.props,url:e.url});break;case"play":pixiVn.sound.play(e.alias,e.props);break;case"remove":pixiVn.sound.remove(e.alias);break;case"pause":pixiVn.sound.pause(e.alias);break;case"resume":pixiVn.sound.resume(e.alias);break;case"volume":pixiVn.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 pixiVn.showWithFadeTransition(e.alias,e.url,e.transition.props,e.transition.priority);break;case"dissolve":await pixiVn.showWithDissolveTransition(e.alias,e.url,e.transition.props,e.transition.priority);break;case"movein":case"moveout":await pixiVn.moveIn(e.alias,e.url,e.transition.props,e.transition.priority);break;case"zoomin":case"zoomout":await pixiVn.zoomIn(e.alias,e.url,e.transition.props,e.transition.priority);break}else await pixiVn.showImage(e.alias,e.url);break;case"edit":let a=pixiVn.canvas.find(e.alias);a?e.props&&(a.memory={...a.memory,...e.props}):console.error(`[Pixi'VN] Image with alias ${e.alias} not found.`);break;case"remove":pixiVn.canvas.remove(e.alias);break}break;case"video":switch(e.operationType){case"show":if(e.transition){let d=new pixiVn.CanvasVideo;switch(d.videoLink=e.url,e.transition.type){case"fade":await pixiVn.showWithFadeTransition(e.alias,d,e.transition.props,e.transition.priority);break;case"dissolve":await pixiVn.showWithDissolveTransition(e.alias,d,e.transition.props,e.transition.priority);break;case"movein":case"moveout":await pixiVn.moveIn(e.alias,d,e.transition.props,e.transition.priority);break;case"zoomin":case"zoomout":await pixiVn.zoomIn(e.alias,d,e.transition.props,e.transition.priority);break}}else await pixiVn.showVideo(e.alias,e.url);break;case"edit":let a=pixiVn.canvas.find(e.alias);a?e.props&&(a.memory={...a.memory,...e.props}):console.error(`[Pixi'VN] Video with alias ${e.alias} not found.`);break;case"remove":pixiVn.canvas.remove(e.alias);break;case"pause":let l=pixiVn.canvas.find(e.alias);l?l.paused=!0:console.error(`[Pixi'VN] Video with alias ${e.alias} not found.`);break;case"resume":let s=pixiVn.canvas.find(e.alias);s?s.paused=!1:console.error(`[Pixi'VN] Video with alias ${e.alias} not found.`);break}break;case"value":X(e,n);break;case"oprationtoconvert":if(this.operationStringConvert){let a="";e.values.forEach(s=>{if(typeof s=="string")a+=s;else {let d=S(s,n);d&&(a+=`${d}`);}});let l=this.operationStringConvert(a);l&&await this.runOperation(l,n);}break;case"input":switch(e.operationType){case"request":pixiVn.narration.requestInput({type:e.valueType});break}break}}};
|
|
15
|
-
|
|
16
|
-
module.exports = j;
|
|
9
|
+
module.exports = $;
|
|
@@ -1,36 +1,41 @@
|
|
|
1
|
-
import { LabelProps, StepLabelType } from '@drincs/pixi-vn';
|
|
2
|
-
import LabelAbstract from '@drincs/pixi-vn/dist/classes/LabelAbstract';
|
|
3
|
-
import { LabelIdType } from '@drincs/pixi-vn/dist/types/LabelIdType';
|
|
1
|
+
import { LabelAbstract, LabelProps, StepLabelType } from '@drincs/pixi-vn';
|
|
4
2
|
import PixiVNJsonLabelStep from '../interface/PixiVNJsonLabelStep.cjs';
|
|
5
3
|
import { PixiVNJsonOperation } from '../interface/PixiVNJsonOperations.cjs';
|
|
6
|
-
import '../PixiVNJsonConditionalStatements-
|
|
7
|
-
import '../interface/PixiVNJsonLabelCondition.cjs';
|
|
4
|
+
import '../PixiVNJsonConditionalStatements-CVkQSKpq.cjs';
|
|
8
5
|
import '../interface/PixiVNJsonInput.cjs';
|
|
9
6
|
import '../interface/PixiVNJsonMedia.cjs';
|
|
10
|
-
import '@drincs/pixi-vn/dist/interface/canvas/ICanvasVideoMemory';
|
|
11
7
|
import '../interface/PixiVNJsonMediaTransiotions.cjs';
|
|
12
|
-
import '@drincs/pixi-vn/dist/functions/canvas/CanvasTransition';
|
|
13
8
|
import 'pixi.js';
|
|
14
9
|
|
|
10
|
+
type LabelJsonOptions = {
|
|
11
|
+
/**
|
|
12
|
+
* Function that converts a string to a {@link PixiVNJsonOperation}.
|
|
13
|
+
*/
|
|
14
|
+
operationStringConvert?: (value: string) => PixiVNJsonOperation | undefined;
|
|
15
|
+
/**
|
|
16
|
+
* If true and a dialog is empty or has only spaces, {@link PixiVNJsonLabelStep.goNextStep} will be set to true.
|
|
17
|
+
*/
|
|
18
|
+
skipEmptyDialogs?: boolean;
|
|
19
|
+
};
|
|
15
20
|
declare class LabelJson<T extends {} = {}> extends LabelAbstract<LabelJson<T>, T> {
|
|
16
21
|
/**
|
|
17
22
|
* @param id is the id of the label
|
|
18
23
|
* @param steps is the list of steps that the label will perform
|
|
19
24
|
* @param props is the properties of the label
|
|
20
25
|
*/
|
|
21
|
-
constructor(id:
|
|
26
|
+
constructor(id: string, steps: (PixiVNJsonLabelStep | (() => PixiVNJsonLabelStep))[], props?: LabelProps<LabelJson<T>>, options?: LabelJsonOptions);
|
|
22
27
|
private _steps;
|
|
23
28
|
/**
|
|
24
29
|
* Get the steps of the label.
|
|
25
30
|
*/
|
|
26
31
|
get steps(): StepLabelType<T>[];
|
|
27
32
|
private operationStringConvert?;
|
|
33
|
+
private skipEmptyDialogs;
|
|
28
34
|
getStepSha1(index: number): string | undefined;
|
|
29
35
|
private getDialogueText;
|
|
30
36
|
private getDialogue;
|
|
31
37
|
private getChoices;
|
|
32
38
|
private stepConverter;
|
|
33
|
-
private runOperation;
|
|
34
39
|
}
|
|
35
40
|
|
|
36
|
-
export { LabelJson as default };
|
|
41
|
+
export { type LabelJsonOptions, LabelJson as default };
|
|
@@ -1,36 +1,41 @@
|
|
|
1
|
-
import { LabelProps, StepLabelType } from '@drincs/pixi-vn';
|
|
2
|
-
import LabelAbstract from '@drincs/pixi-vn/dist/classes/LabelAbstract';
|
|
3
|
-
import { LabelIdType } from '@drincs/pixi-vn/dist/types/LabelIdType';
|
|
1
|
+
import { LabelAbstract, LabelProps, StepLabelType } from '@drincs/pixi-vn';
|
|
4
2
|
import PixiVNJsonLabelStep from '../interface/PixiVNJsonLabelStep.js';
|
|
5
3
|
import { PixiVNJsonOperation } from '../interface/PixiVNJsonOperations.js';
|
|
6
|
-
import '../PixiVNJsonConditionalStatements-
|
|
7
|
-
import '../interface/PixiVNJsonLabelCondition.js';
|
|
4
|
+
import '../PixiVNJsonConditionalStatements-CVkQSKpq.js';
|
|
8
5
|
import '../interface/PixiVNJsonInput.js';
|
|
9
6
|
import '../interface/PixiVNJsonMedia.js';
|
|
10
|
-
import '@drincs/pixi-vn/dist/interface/canvas/ICanvasVideoMemory';
|
|
11
7
|
import '../interface/PixiVNJsonMediaTransiotions.js';
|
|
12
|
-
import '@drincs/pixi-vn/dist/functions/canvas/CanvasTransition';
|
|
13
8
|
import 'pixi.js';
|
|
14
9
|
|
|
10
|
+
type LabelJsonOptions = {
|
|
11
|
+
/**
|
|
12
|
+
* Function that converts a string to a {@link PixiVNJsonOperation}.
|
|
13
|
+
*/
|
|
14
|
+
operationStringConvert?: (value: string) => PixiVNJsonOperation | undefined;
|
|
15
|
+
/**
|
|
16
|
+
* If true and a dialog is empty or has only spaces, {@link PixiVNJsonLabelStep.goNextStep} will be set to true.
|
|
17
|
+
*/
|
|
18
|
+
skipEmptyDialogs?: boolean;
|
|
19
|
+
};
|
|
15
20
|
declare class LabelJson<T extends {} = {}> extends LabelAbstract<LabelJson<T>, T> {
|
|
16
21
|
/**
|
|
17
22
|
* @param id is the id of the label
|
|
18
23
|
* @param steps is the list of steps that the label will perform
|
|
19
24
|
* @param props is the properties of the label
|
|
20
25
|
*/
|
|
21
|
-
constructor(id:
|
|
26
|
+
constructor(id: string, steps: (PixiVNJsonLabelStep | (() => PixiVNJsonLabelStep))[], props?: LabelProps<LabelJson<T>>, options?: LabelJsonOptions);
|
|
22
27
|
private _steps;
|
|
23
28
|
/**
|
|
24
29
|
* Get the steps of the label.
|
|
25
30
|
*/
|
|
26
31
|
get steps(): StepLabelType<T>[];
|
|
27
32
|
private operationStringConvert?;
|
|
33
|
+
private skipEmptyDialogs;
|
|
28
34
|
getStepSha1(index: number): string | undefined;
|
|
29
35
|
private getDialogueText;
|
|
30
36
|
private getDialogue;
|
|
31
37
|
private getChoices;
|
|
32
38
|
private stepConverter;
|
|
33
|
-
private runOperation;
|
|
34
39
|
}
|
|
35
40
|
|
|
36
|
-
export { LabelJson as default };
|
|
41
|
+
export { type LabelJsonOptions, LabelJson as default };
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { ChoiceMenuOption, narration, setFlag, storage, canvas, CanvasVideo, zoomIn, moveIn, showWithDissolveTransition, showWithFadeTransition, showVideo, showImage, sound,
|
|
2
|
-
import Ve from '@drincs/pixi-vn/dist/classes/LabelAbstract';
|
|
3
|
-
import I from '@drincs/pixi-vn/dist/managers/NarrationManagerStatic';
|
|
4
|
-
import q from '@drincs/pixi-vn/dist/managers/StorageManagerStatic';
|
|
1
|
+
import { LabelAbstract, ChoiceMenuOption, narration, setFlag, storage, createExportableElement, getFlag, canvas, CanvasVideo, zoomIn, moveIn, showWithDissolveTransition, showWithFadeTransition, showVideo, showImage, sound, NarrationManagerStatic } from '@drincs/pixi-vn';
|
|
5
2
|
|
|
6
|
-
var ne=Object.create;var G=Object.defineProperty;var re=Object.getOwnPropertyDescriptor;var ae=Object.getOwnPropertyNames;var oe=Object.getPrototypeOf,se=Object.prototype.hasOwnProperty;var D=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(i,n)=>(typeof require<"u"?require:i)[n]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var F=(t,i)=>()=>(i||t((i={exports:{}}).exports,i),i.exports);var le=(t,i,n,e)=>{if(i&&typeof i=="object"||typeof i=="function")for(let a of ae(i))!se.call(t,a)&&a!==n&&G(t,a,{get:()=>i[a],enumerable:!(e=re(i,a))||e.enumerable});return t};var ue=(t,i,n)=>(n=t!=null?ne(oe(t)):{},le(G(n,"default",{value:t,enumerable:!0}),t));var M=F((O,z)=>{(function(t,i){typeof O=="object"?z.exports=O=i():typeof define=="function"&&define.amd?define([],i):t.CryptoJS=i();})(O,function(){var t=t||function(i,n){var e;if(typeof window<"u"&&window.crypto&&(e=window.crypto),typeof self<"u"&&self.crypto&&(e=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(e=globalThis.crypto),!e&&typeof window<"u"&&window.msCrypto&&(e=window.msCrypto),!e&&typeof global<"u"&&global.crypto&&(e=global.crypto),!e&&typeof D=="function")try{e=D("crypto");}catch{}var a=function(){if(e){if(typeof e.getRandomValues=="function")try{return e.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof e.randomBytes=="function")try{return e.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},l=Object.create||function(){function r(){}return function(o){var p;return r.prototype=o,p=new r,r.prototype=null,p}}(),s={},d=s.lib={},x=d.Base=function(){return {extend:function(r){var o=l(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)}}}(),m=d.WordArray=x.extend({init:function(r,o){r=this.words=r||[],o!=n?this.sigBytes=o:this.sigBytes=r.length*4;},toString:function(r){return (r||f).stringify(this)},concat:function(r){var o=this.words,p=r.words,h=this.sigBytes,V=r.sigBytes;if(this.clamp(),h%4)for(var v=0;v<V;v++){var B=p[v>>>2]>>>24-v%4*8&255;o[h+v>>>2]|=B<<24-(h+v)%4*8;}else for(var w=0;w<V;w+=4)o[h+w>>>2]=p[w>>>2];return this.sigBytes+=V,this},clamp:function(){var r=this.words,o=this.sigBytes;r[o>>>2]&=4294967295<<32-o%4*8,r.length=i.ceil(o/4);},clone:function(){var r=x.clone.call(this);return r.words=this.words.slice(0),r},random:function(r){for(var o=[],p=0;p<r;p+=4)o.push(a());return new m.init(o,r)}}),u=s.enc={},f=u.Hex={stringify:function(r){for(var o=r.words,p=r.sigBytes,h=[],V=0;V<p;V++){var v=o[V>>>2]>>>24-V%4*8&255;h.push((v>>>4).toString(16)),h.push((v&15).toString(16));}return h.join("")},parse:function(r){for(var o=r.length,p=[],h=0;h<o;h+=2)p[h>>>3]|=parseInt(r.substr(h,2),16)<<24-h%8*4;return new m.init(p,o/2)}},y=u.Latin1={stringify:function(r){for(var o=r.words,p=r.sigBytes,h=[],V=0;V<p;V++){var v=o[V>>>2]>>>24-V%4*8&255;h.push(String.fromCharCode(v));}return h.join("")},parse:function(r){for(var o=r.length,p=[],h=0;h<o;h++)p[h>>>2]|=(r.charCodeAt(h)&255)<<24-h%4*8;return new m.init(p,o)}},b=u.Utf8={stringify:function(r){try{return decodeURIComponent(escape(y.stringify(r)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(r){return y.parse(unescape(encodeURIComponent(r)))}},c=d.BufferedBlockAlgorithm=x.extend({reset:function(){this._data=new m.init,this._nDataBytes=0;},_append:function(r){typeof r=="string"&&(r=b.parse(r)),this._data.concat(r),this._nDataBytes+=r.sigBytes;},_process:function(r){var o,p=this._data,h=p.words,V=p.sigBytes,v=this.blockSize,B=v*4,w=V/B;r?w=i.ceil(w):w=i.max((w|0)-this._minBufferSize,0);var A=w*v,H=i.min(A*4,V);if(A){for(var E=0;E<A;E+=v)this._doProcessBlock(h,E);o=h.splice(0,A),p.sigBytes-=H;}return new m.init(o,H)},clone:function(){var r=x.clone.call(this);return r._data=this._data.clone(),r},_minBufferSize:0});d.Hasher=c.extend({cfg:x.extend(),init:function(r){this.cfg=this.cfg.extend(r),this.reset();},reset:function(){c.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,p){return new r.init(p).finalize(o)}},_createHmacHelper:function(r){return function(o,p){return new T.HMAC.init(r,p).finalize(o)}}});var T=s.algo={};return s}(Math);return t});});var U=F((L,W)=>{(function(t,i){typeof L=="object"?W.exports=L=i(M()):typeof define=="function"&&define.amd?define(["./core"],i):i(t.CryptoJS);})(L,function(t){return function(){var i=t,n=i.lib,e=n.WordArray,a=n.Hasher,l=i.algo,s=[],d=l.SHA1=a.extend({_doReset:function(){this._hash=new e.init([1732584193,4023233417,2562383102,271733878,3285377520]);},_doProcessBlock:function(x,m){for(var u=this._hash.words,f=u[0],y=u[1],b=u[2],c=u[3],N=u[4],T=0;T<80;T++){if(T<16)s[T]=x[m+T]|0;else {var r=s[T-3]^s[T-8]^s[T-14]^s[T-16];s[T]=r<<1|r>>>31;}var o=(f<<5|f>>>27)+N+s[T];T<20?o+=(y&b|~y&c)+1518500249:T<40?o+=(y^b^c)+1859775393:T<60?o+=(y&b|y&c|b&c)-1894007588:o+=(y^b^c)-899497514,N=c,c=b,b=y<<30|y>>>2,y=f,f=o;}u[0]=u[0]+f|0,u[1]=u[1]+y|0,u[2]=u[2]+b|0,u[3]=u[3]+c|0,u[4]=u[4]+N|0;},_doFinalize:function(){var x=this._data,m=x.words,u=this._nDataBytes*8,f=x.sigBytes*8;return m[f>>>5]|=128<<24-f%32,m[(f+64>>>9<<4)+14]=Math.floor(u/4294967296),m[(f+64>>>9<<4)+15]=u,x.sigBytes=m.length*4,this._process(),this._hash},clone:function(){var x=a.clone.call(this);return x._hash=this._hash.clone(),x}});i.SHA1=a._createHelper(d),i.HmacSHA1=a._createHmacHelper(d);}(),t.SHA1});});var ie=ue(U());var R="___param___";function de(t,i){return Math.floor(Math.random()*(i-t+1)+t)}function g(t,i){if(!(Array.isArray(t)||!t)){if(t&&typeof t=="object"&&"type"in t)switch(t.type){case"resulttocombine":return pe(t,i);case"ifelse":return S(t.condition,i)?g(t.then,i):g(t.else,i);case"stepswitch":let e=g(t.elements,i)||[];if(e.length===0){console.error("[Pixi'VN] getValueFromConditionalStatements elements.length === 0");return}switch(t.choiceType){case"random":let a=de(0,e.length);return g(e[a],i);case"loop":return narration.currentStepTimesCounter>e.length-1?(narration.currentStepTimesCounter=0,g(e[0],i)):g(e[I.getCurrentStepTimesCounter(t.nestedId)],i);case"sequential":let l;return t.end=="lastItem"&&(l=g(e[e.length-1],i)),narration.currentStepTimesCounter>e.length-1?l:g(e[I.getCurrentStepTimesCounter(t.nestedId)],i);case"sequentialrandom":let s=I.getRandomNumber(0,e.length-1,{nestedId:t.nestedId,onceOnly:!0});if(s==null&&t.end=="lastItem"){let d=I.getCurrentStepTimesCounterData(t.nestedId);if(!d||!d?.usedRandomNumbers)return;let x=d.usedRandomNumbers[`0-${e.length-1}`];return g(e[x[x.length-1]],i)}return s==null?void 0:g(e[s],i)}}return t}}function pe(t,i){let n=t.firstItem,e=[];t.secondConditionalItem?.forEach(l=>{if(Array.isArray(l))l.forEach(s=>{let d=g(s,i);d&&e.push(d);});else {let s=g(l,i);s&&e.push(s);}});let a=n?[n,...e]:e;if(a.length!==0){if(typeof a[0]=="string")return a.join("");if(typeof a[0]=="object"){let l=a,s=l.map(c=>c.dialogue).join(""),d=l.find(c=>c.end),x=l.find(c=>c.choices),m=l.find(c=>c.glueEnabled),u=l.find(c=>c.goNextStep),f=l.find(c=>c.labelToOpen),y=l.find(c=>c.operation);return {dialogue:s,end:d?.end,choices:x?.choices,glueEnabled:m?.glueEnabled,goNextStep:u?.goNextStep,labelToOpen:f?.labelToOpen,operation:y?.operation}}}}function he(t,i){if(!t)return !1;if(typeof t!="object"||!("type"in t))return !!t;switch(t.type){case"compare":let n=C(t.leftValue,i),e=C(t.rightValue,i);switch(t.operator){case"==":return n===e;case"!=":return n!==e;case"<":return n<e;case"<=":return n<=e;case">":return n>e;case">=":return n>=e;case"CONTAINS":return n.toString().includes(e.toString())}break;case"valueCondition":return !!C(t.value,i);case"union":return ge(t,i);case"labelcondition":if("operator"in t&&"label"in t)switch(t.operator){case"started":return narration.getTimesLabelOpened(t.label)>0;case"completed":return narration.isLabelAlreadyCompleted(t.label)}break}return !!t}function C(t,i){if(t&&typeof t=="object"&&"type"in t)if(t.type==="value"&&t.storageOperationType==="get")switch(t.storageType){case"storage":return storage.getVariable(t.key);case"tempstorage":return q.getTempVariable(t.key);case"flagStorage":return getFlag(t.key);case"label":return narration.getTimesLabelOpened(t.label);case"logic":return S(t.operation,i);case"params":return i&&i.length-1>=t.key?i[t.key]:void 0}else return S(t,i);return t}function ge(t,i){if(t.unionType==="not")return !S(t.condition,i);let n=t.unionType==="and";for(let e=0;e<t.conditions.length;e++)if(n=S(t.conditions[e],i)||!1,t.unionType==="and"){if(!n)return !1}else if(n)return !0;return n}function X(t,i){let n=g(t.value,i),e;switch(n&&typeof n=="object"&&"type"in n?e=S(n,i):e=n,t.storageType){case"flagStorage":setFlag(t.key,t.value);break;case"storage":storage.setVariable(t.key,e);break;case"tempstorage":q.setTempVariable(t.key,e);break;case"params":i&&i.length-1>=t.key&&(i[t.key]=e);break}}function S(t,i){let n=g(t,i);if(n&&typeof n=="object"&&"type"in n)switch(n.type){case"value":return C(n,i);case"arithmetic":case"arithmeticsingle":return ye(n,i);case"compare":case"valueCondition":case"union":case"labelcondition":return he(n,i)}return n}function ye(t,i){let n=S(t.leftValue,i);switch(t.type){case"arithmetic":let e=S(t.rightValue,i);switch(t.operator){case"*":return n*e;case"/":return n/e;case"+":return n+e;case"-":return n-e;case"%":return n%e;case"POW":return Math.pow(n,e);case"RANDOM":return Math.floor(Math.random()*(e-n+1))+n}case"arithmeticsingle":switch(t.operator){case"INT":return parseInt(n);case"FLOOR":return Math.floor(n);case"FLOAT":return parseFloat(n)}break}}var j=class extends Ve{constructor(i,n,e,a){super(i,e),this._steps=n,this.operationStringConvert=a;}_steps;get steps(){return this._steps.map(this.stepConverter)}operationStringConvert;getStepSha1(i){if(i<0||i>=this.steps.length)return;let n=this._steps[i];return (0, ie.default)(n.toString().toLocaleLowerCase()).toString()}getDialogueText(i,n){let e="";if(Array.isArray(i)){let a=[];i.forEach(l=>{if(typeof l=="string")a.push(l);else if(l&&typeof l=="object"){let s=g(l,n);s&&(s&&!Array.isArray(s)&&typeof s=="object"&&(s=C(s,n)||""),Array.isArray(s)?a=a.concat(s):a.push(s));}}),e=a;}else {let a=g(i,n)||"";a&&!Array.isArray(a)&&typeof a=="object"&&(a=C(a,n)||""),e=a;}return e}getDialogue(i,n){let e=g(i,n),a;return e&&(typeof e=="object"&&"character"in e&&"text"in e?a={character:e.character,text:this.getDialogueText(e.text,n)}:a=this.getDialogueText(e,n)),a}getChoices(i,n){let e=g(i,n);if(e)return e.map(l=>g(l,n)).filter(l=>l!==void 0)}stepConverter(i){return async n=>{let e=n[R];if(typeof i=="function"&&(i=i()),i.operation)for(let u of i.operation)await this.runOperation(u,e);let a=this.getChoices(i.choices,e),l=g(i.glueEnabled,e),s=this.getDialogue(i.dialogue,e),d=[];i.labelToOpen&&(Array.isArray(i.labelToOpen)||(i.labelToOpen=[i.labelToOpen]),i.labelToOpen.forEach(u=>{let f=g(u,e);f&&d.push(f);}));let x=g(i.goNextStep,e),m=g(i.end,e);if(a){let u=a.map(f=>{let y="";if(Array.isArray(f.text)){let b=[];f.text.forEach(c=>{if(typeof c=="string")b.push(c);else if(c&&typeof c=="object"){let N=g(c,e);N&&!Array.isArray(N)&&typeof N=="object"&&(N=C(N,e)||""),N&&(Array.isArray(N)?b=b.concat(N):b.push(N));}}),y=b.join();}else typeof f.text=="string"&&(y=f.text);return new ChoiceMenuOption(y,f.label,f.props,{type:f.type,oneTime:f.oneTime})});u=u.filter((f,y)=>{if(f.oneTime){let b=narration.alreadyCurrentStepMadeChoices;if(b&&b.includes(y))return !1}return !0}),narration.choiceMenuOptions=u;}else narration.choiceMenuOptions=void 0;l?setFlag(storage.keysSystem.ADD_NEXT_DIALOG_TEXT_INTO_THE_CURRENT_DIALOG_FLAG_KEY,!0):l===!1&&setFlag(storage.keysSystem.ADD_NEXT_DIALOG_TEXT_INTO_THE_CURRENT_DIALOG_FLAG_KEY,!1),s&&(narration.dialogue=s),d.forEach(u=>{let f=u.label;typeof f=="object"&&(f=C(f,e)||"");let y=u.params?.map(b=>S(b,e));n={...n,...u.props,[R]:y},u.type==="jump"?narration.jumpLabel(f,n):narration.callLabel(f,n);}),x&&await narration.goNext(n),m==="game_end"?(narration.closeAllLabels(),await narration.goNext(n)):m==="label_end"&&narration.closeCurrentLabel();}}async runOperation(i,n){let e=g(i,n);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 a=canvas.find(e.alias);a?e.props&&(a.memory={...a.memory,...e.props}):console.error(`[Pixi'VN] 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 d=new CanvasVideo;switch(d.videoLink=e.url,e.transition.type){case"fade":await showWithFadeTransition(e.alias,d,e.transition.props,e.transition.priority);break;case"dissolve":await showWithDissolveTransition(e.alias,d,e.transition.props,e.transition.priority);break;case"movein":case"moveout":await moveIn(e.alias,d,e.transition.props,e.transition.priority);break;case"zoomin":case"zoomout":await zoomIn(e.alias,d,e.transition.props,e.transition.priority);break}}else await showVideo(e.alias,e.url);break;case"edit":let a=canvas.find(e.alias);a?e.props&&(a.memory={...a.memory,...e.props}):console.error(`[Pixi'VN] Video with alias ${e.alias} not found.`);break;case"remove":canvas.remove(e.alias);break;case"pause":let l=canvas.find(e.alias);l?l.paused=!0:console.error(`[Pixi'VN] Video with alias ${e.alias} not found.`);break;case"resume":let s=canvas.find(e.alias);s?s.paused=!1:console.error(`[Pixi'VN] Video with alias ${e.alias} not found.`);break}break;case"value":X(e,n);break;case"oprationtoconvert":if(this.operationStringConvert){let a="";e.values.forEach(s=>{if(typeof s=="string")a+=s;else {let d=S(s,n);d&&(a+=`${d}`);}});let l=this.operationStringConvert(a);l&&await this.runOperation(l,n);}break;case"input":switch(e.operationType){case"request":narration.requestInput({type:e.valueType});break}break}}};
|
|
3
|
+
var ae=Object.create;var W=Object.defineProperty;var re=Object.getOwnPropertyDescriptor;var oe=Object.getOwnPropertyNames;var se=Object.getPrototypeOf,le=Object.prototype.hasOwnProperty;var G=(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 z=(i,t)=>()=>(t||i((t={exports:{}}).exports,t),t.exports);var ue=(i,t,e,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of oe(t))!le.call(i,o)&&o!==e&&W(i,o,{get:()=>t[o],enumerable:!(a=re(t,o))||a.enumerable});return i};var fe=(i,t,e)=>(e=i!=null?ae(se(i)):{},ue(W(e,"default",{value:i,enumerable:!0}),i));var U=z((A,M)=>{(function(i,t){typeof A=="object"?M.exports=A=t():typeof define=="function"&&define.amd?define([],t):i.CryptoJS=t();})(A,function(){var i=i||function(t,e){var a;if(typeof window<"u"&&window.crypto&&(a=window.crypto),typeof self<"u"&&self.crypto&&(a=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(a=globalThis.crypto),!a&&typeof window<"u"&&window.msCrypto&&(a=window.msCrypto),!a&&typeof global<"u"&&global.crypto&&(a=global.crypto),!a&&typeof G=="function")try{a=G("crypto");}catch{}var o=function(){if(a){if(typeof a.getRandomValues=="function")try{return a.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof a.randomBytes=="function")try{return a.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},f=Object.create||function(){function n(){}return function(r){var u;return n.prototype=r,u=new n,n.prototype=null,u}}(),c={},b=c.lib={},g=b.Base=function(){return {extend:function(n){var r=f(this);return n&&r.mixIn(n),(!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 n=this.extend();return n.init.apply(n,arguments),n},init:function(){},mixIn:function(n){for(var r in n)n.hasOwnProperty(r)&&(this[r]=n[r]);n.hasOwnProperty("toString")&&(this.toString=n.toString);},clone:function(){return this.init.prototype.extend(this)}}}(),d=b.WordArray=g.extend({init:function(n,r){n=this.words=n||[],r!=e?this.sigBytes=r:this.sigBytes=n.length*4;},toString:function(n){return (n||m).stringify(this)},concat:function(n){var r=this.words,u=n.words,p=this.sigBytes,V=n.sigBytes;if(this.clamp(),p%4)for(var N=0;N<V;N++){var R=u[N>>>2]>>>24-N%4*8&255;r[p+N>>>2]|=R<<24-(p+N)%4*8;}else for(var v=0;v<V;v+=4)r[p+v>>>2]=u[v>>>2];return this.sigBytes+=V,this},clamp:function(){var n=this.words,r=this.sigBytes;n[r>>>2]&=4294967295<<32-r%4*8,n.length=t.ceil(r/4);},clone:function(){var n=g.clone.call(this);return n.words=this.words.slice(0),n},random:function(n){for(var r=[],u=0;u<n;u+=4)r.push(o());return new d.init(r,n)}}),l=c.enc={},m=l.Hex={stringify:function(n){for(var r=n.words,u=n.sigBytes,p=[],V=0;V<u;V++){var N=r[V>>>2]>>>24-V%4*8&255;p.push((N>>>4).toString(16)),p.push((N&15).toString(16));}return p.join("")},parse:function(n){for(var r=n.length,u=[],p=0;p<r;p+=2)u[p>>>3]|=parseInt(n.substr(p,2),16)<<24-p%8*4;return new d.init(u,r/2)}},h=l.Latin1={stringify:function(n){for(var r=n.words,u=n.sigBytes,p=[],V=0;V<u;V++){var N=r[V>>>2]>>>24-V%4*8&255;p.push(String.fromCharCode(N));}return p.join("")},parse:function(n){for(var r=n.length,u=[],p=0;p<r;p++)u[p>>>2]|=(n.charCodeAt(p)&255)<<24-p%4*8;return new d.init(u,r)}},x=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)))}},y=b.BufferedBlockAlgorithm=g.extend({reset:function(){this._data=new d.init,this._nDataBytes=0;},_append:function(n){typeof n=="string"&&(n=x.parse(n)),this._data.concat(n),this._nDataBytes+=n.sigBytes;},_process:function(n){var r,u=this._data,p=u.words,V=u.sigBytes,N=this.blockSize,R=N*4,v=V/R;n?v=t.ceil(v):v=t.max((v|0)-this._minBufferSize,0);var k=v*N,F=t.min(k*4,V);if(k){for(var B=0;B<k;B+=N)this._doProcessBlock(p,B);r=p.splice(0,k),u.sigBytes-=F;}return new d.init(r,F)},clone:function(){var n=g.clone.call(this);return n._data=this._data.clone(),n},_minBufferSize:0});b.Hasher=y.extend({cfg:g.extend(),init:function(n){this.cfg=this.cfg.extend(n),this.reset();},reset:function(){y.reset.call(this),this._doReset();},update:function(n){return this._append(n),this._process(),this},finalize:function(n){n&&this._append(n);var r=this._doFinalize();return r},blockSize:512/32,_createHelper:function(n){return function(r,u){return new n.init(u).finalize(r)}},_createHmacHelper:function(n){return function(r,u){return new T.HMAC.init(n,u).finalize(r)}}});var T=c.algo={};return c}(Math);return i});});var q=z((E,X)=>{(function(i,t){typeof E=="object"?X.exports=E=t(U()):typeof define=="function"&&define.amd?define(["./core"],t):t(i.CryptoJS);})(E,function(i){return function(){var t=i,e=t.lib,a=e.WordArray,o=e.Hasher,f=t.algo,c=[],b=f.SHA1=o.extend({_doReset:function(){this._hash=new a.init([1732584193,4023233417,2562383102,271733878,3285377520]);},_doProcessBlock:function(g,d){for(var l=this._hash.words,m=l[0],h=l[1],x=l[2],y=l[3],S=l[4],T=0;T<80;T++){if(T<16)c[T]=g[d+T]|0;else {var n=c[T-3]^c[T-8]^c[T-14]^c[T-16];c[T]=n<<1|n>>>31;}var r=(m<<5|m>>>27)+S+c[T];T<20?r+=(h&x|~h&y)+1518500249:T<40?r+=(h^x^y)+1859775393:T<60?r+=(h&x|h&y|x&y)-1894007588:r+=(h^x^y)-899497514,S=y,y=x,x=h<<30|h>>>2,h=m,m=r;}l[0]=l[0]+m|0,l[1]=l[1]+h|0,l[2]=l[2]+x|0,l[3]=l[3]+y|0,l[4]=l[4]+S|0;},_doFinalize:function(){var g=this._data,d=g.words,l=this._nDataBytes*8,m=g.sigBytes*8;return d[m>>>5]|=128<<24-m%32,d[(m+64>>>9<<4)+14]=Math.floor(l/4294967296),d[(m+64>>>9<<4)+15]=l,g.sigBytes=d.length*4,this._process(),this._hash},clone:function(){var g=o.clone.call(this);return g._hash=this._hash.clone(),g}});t.SHA1=o._createHelper(b),t.HmacSHA1=o._createHmacHelper(b);}(),i.SHA1});});var ne=fe(q());var _="___param___";function de(i,t){return Math.floor(Math.random()*(t-i+1)+i)}function pe(i){if(Array.isArray(i)||!i)return i;if(i&&typeof i=="object"&&"type"in i)switch(i.type){case"resulttocombine":return ge(i);case"ifelse":return s(i.condition)?s(i.then):s(i.else);case"stepswitch":let e=s(i.elements)||[];if(e.length===0){console.error("[Pixi\u2019VN Json] getValueFromConditionalStatements elements.length === 0");return}switch(i.choiceType){case"random":let a=de(0,e.length-1);return s(e[a]);case"loop":let o=NarrationManagerStatic.getCurrentStepTimesCounter(i.nestedId)-1;return o>e.length-1&&(o=o%e.length),s(e[o]);case"sequential":let f,c=NarrationManagerStatic.getCurrentStepTimesCounter(i.nestedId)-1;return i.end=="lastItem"&&(f=s(e[e.length-1])),c>e.length-1?f:s(e[c]);case"sequentialrandom":let b=NarrationManagerStatic.getRandomNumber(0,e.length-1,{nestedId:i.nestedId,onceOnly:!0});if(b==null&&i.end=="lastItem"){let g=NarrationManagerStatic.getCurrentStepTimesCounterData(i.nestedId);if(!g||!g?.usedRandomNumbers){console.warn("[Pixi\u2019VN Json] getValueFromConditionalStatements randomIndexWhitExclude == undefined");return}let d=g.usedRandomNumbers[`0-${e.length-1}`];return s(e[d[d.length-1]])}if(b==null){console.warn("[Pixi\u2019VN Json] getValueFromConditionalStatements randomIndexWhitExclude == undefined");return}return s(e[b])}}return i}function D(i){if(i.conditionalStep){let t=createExportableElement(s(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?.operation===void 0&&delete t?.operation,t){let e={...i,conditionalStep:void 0,...t};return D(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 ge(i){let t=i.firstItem,e=[];i.secondConditionalItem?.forEach(o=>{if(Array.isArray(o))o.forEach(f=>{let c=s(f);e.push(c);});else {let f=s(o);e.push(f);}});let a=t?[t,...e]:e;if(a.length===0){console.warn("[Pixi\u2019VN Json] combinateResult toCheck.length === 0");return}if(typeof a[0]=="string")return a.join("");if(typeof a[0]=="object"){let o=a,f,c=o.map((n,r)=>{n=D(n);let u=s(n.dialogue)||"";return r===0?(f=s(n.glueEnabled)||!1,u):(typeof u=="object"&&"text"in u&&(u=u.character+": "+u.text),f===!1&&(u=`
|
|
7
4
|
|
|
8
|
-
|
|
5
|
+
`+u),f=s(n.glueEnabled)||!1,u)}),b=s(c[0]),g=typeof b=="object"&&"character"in b?b.character:void 0,d=c.map(n=>{let r;n&&typeof n=="object"&&"text"in n?r=n.text:r=n;let u;return Array.isArray(r)?u=r.map(p=>`${s(p)}`).join(""):u=s(r)||"",u}).join(""),l=o.find(n=>n.end),m=o.find(n=>n.choices),h=!1,x=!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,x=o.reverse().find(n=>!(n.operation&&(!n.dialogue||!n.choices)))?.goNextStep);let y=o.find(n=>n.labelToOpen),S=[];return o.forEach(n=>{n.operation&&S.forEach(r=>{S.push(r);});}),{dialogue:g?{character:g,text:d}:d,end:l?.end,choices:m?.choices,glueEnabled:h,goNextStep:x,labelToOpen:y?.labelToOpen,operation:S}}}function he(i){if(!i)return !1;if(typeof i!="object"||!("type"in i))return !!i;switch(i.type){case"compare":let t=s(i.leftValue),e=s(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 !!s(i.value);case"union":return me(i)}return !!i}function ye(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 s(i.operation);case"params":let t=storage.getVariable(`${_}${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 me(i){if(i.unionType==="not")return !s(i.condition);let t=i.unionType==="and";for(let e=0;e<i.conditions.length;e++)if(t=s(i.conditions[e])||!1,i.unionType==="and"){if(!t)return !1}else if(t)return !0;return t}function Y(i){let t=s(i.value),e;switch(t&&typeof t=="object"&&"type"in t?e=s(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 a=storage.getVariable(`${_}${narration.openedLabels.length-1}`)||[];a&&a.length-1>=i.key&&(a[i.key]=e),storage.setTempVariable(`${_}${narration.openedLabels.length-1}`,a);break}}function s(i){let t=pe(i);if(t&&typeof t=="object"&&"type"in t)switch(t.type){case"value":return ye(t);case"arithmetic":case"arithmeticsingle":return xe(t);case"compare":case"valueCondition":case"union":return he(t)}return t}function xe(i){let t=s(i.leftValue);switch(i.type){case"arithmetic":let e=s(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 j(i,t){let e=s(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 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":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 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 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 f=canvas.find(e.alias);f?f.paused=!1:console.error(`[Pixi\u2019VN Json] Video with alias ${e.alias} not found.`);break}break;case"value":Y(e);break;case"oprationtoconvert":if(t){let a="";e.values.forEach(f=>{if(typeof f=="string")a+=f;else {let c=s(f);a+=`${c}`;}});let o=t(a);o&&await j(o);}break;case"input":switch(e.operationType){case"request":narration.requestInput({type:e.valueType});break}break}}var $=class extends LabelAbstract{constructor(t,e,a,o={}){super(t,a),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, ne.default)(e.toString().toLocaleLowerCase()).toString()}getDialogueText(t){let e="";if(Array.isArray(t)){let a=[];t.forEach(o=>{if(typeof o=="string")a.push(o);else if(o&&typeof o=="object"){let f=s(o);f?(f&&!Array.isArray(f)&&typeof f=="object"&&(f=s(f)||""),Array.isArray(f)?a=a.concat(f):a.push(`${f}`)):a.push(`${o}`);}}),e=a;}else {let a=s(t)||"";a&&!Array.isArray(a)&&typeof a=="object"&&(a=s(a)||""),e=a;}return `${e}`}getDialogue(t){let e=s(t);if(e)return typeof e=="object"&&"character"in e&&"text"in e?{character:e.character,text:this.getDialogueText(e.text)}:this.getDialogueText(e);if(e!=null)return `${e}`}getChoices(t){return s(t)?.map(o=>s(o)).filter(o=>o!==void 0)}stepConverter(t){return async e=>{if(typeof t=="function"&&(t=t()),t=D(t),t.operation)for(let d of t.operation)await j(d,this.operationStringConvert);let a=this.getChoices(t.choices),o=s(t.glueEnabled),f=this.getDialogue(t.dialogue),c=[];t.labelToOpen&&(Array.isArray(t.labelToOpen)||(t.labelToOpen=[t.labelToOpen]),t.labelToOpen.forEach(d=>{let l=s(d);l&&c.push(l);}));let b=s(t.goNextStep),g=s(t.end);if(a){let d=a.map(l=>{let m="";if(Array.isArray(l.text)){let h=[];l.text.forEach(x=>{if(typeof x=="string")h.push(x);else if(x&&typeof x=="object"){let y=s(x);y&&!Array.isArray(y)&&typeof y=="object"&&(y=s(y)||""),y&&(Array.isArray(y)?h=h.concat(y):h.push(y));}}),m=h.join();}else typeof l.text=="string"&&(m=l.text);return new ChoiceMenuOption(m,l.label,l.props,{type:l.type,oneTime:l.oneTime,onlyHaveNoChoice:l.onlyHaveNoChoice,autoSelect:l.autoSelect})});narration.choiceMenuOptions=d;}else narration.choiceMenuOptions=void 0;f!==void 0&&(narration.dialogue=f,this.skipEmptyDialogs&&typeof f=="string"&&(f===""||RegExp(/^\s+$/).test(f))&&(b=!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),c.forEach(d=>{let l=d.label;typeof l=="object"&&(l=s(l)||"");let m=d.params?.map(h=>s(h));e={...e,...d.props},d.type==="jump"?(narration.closeCurrentLabel(),storage.setTempVariable(`${_}${narration.openedLabels.length}`,m),narration.callLabel(l,e)):(storage.setTempVariable(`${_}${narration.openedLabels.length}`,m),narration.callLabel(l,e));}),g==="game_end"?(narration.closeAllLabels(),await narration.goNext(e)):g==="label_end"&&narration.closeCurrentLabel(),b&&await narration.goNext(e);}}};
|
|
6
|
+
|
|
7
|
+
export { $ as default };
|
package/dist/classes/index.cjs
CHANGED
|
@@ -1,16 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var pixiVn = require('@drincs/pixi-vn');
|
|
4
|
-
var Ve = require('@drincs/pixi-vn/dist/classes/LabelAbstract');
|
|
5
|
-
var I = require('@drincs/pixi-vn/dist/managers/NarrationManagerStatic');
|
|
6
|
-
var q = require('@drincs/pixi-vn/dist/managers/StorageManagerStatic');
|
|
7
4
|
|
|
8
|
-
function
|
|
5
|
+
var ae=Object.create;var W=Object.defineProperty;var re=Object.getOwnPropertyDescriptor;var oe=Object.getOwnPropertyNames;var se=Object.getPrototypeOf,le=Object.prototype.hasOwnProperty;var H=(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 z=(i,t)=>()=>(t||i((t={exports:{}}).exports,t),t.exports);var ue=(i,t,e,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of oe(t))!le.call(i,o)&&o!==e&&W(i,o,{get:()=>t[o],enumerable:!(a=re(t,o))||a.enumerable});return i};var fe=(i,t,e)=>(e=i!=null?ae(se(i)):{},ue(W(e,"default",{value:i,enumerable:!0}),i));var U=z((A,M)=>{(function(i,t){typeof A=="object"?M.exports=A=t():typeof define=="function"&&define.amd?define([],t):i.CryptoJS=t();})(A,function(){var i=i||function(t,e){var a;if(typeof window<"u"&&window.crypto&&(a=window.crypto),typeof self<"u"&&self.crypto&&(a=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(a=globalThis.crypto),!a&&typeof window<"u"&&window.msCrypto&&(a=window.msCrypto),!a&&typeof global<"u"&&global.crypto&&(a=global.crypto),!a&&typeof H=="function")try{a=H("crypto");}catch{}var o=function(){if(a){if(typeof a.getRandomValues=="function")try{return a.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof a.randomBytes=="function")try{return a.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},f=Object.create||function(){function n(){}return function(r){var u;return n.prototype=r,u=new n,n.prototype=null,u}}(),c={},b=c.lib={},g=b.Base=function(){return {extend:function(n){var r=f(this);return n&&r.mixIn(n),(!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 n=this.extend();return n.init.apply(n,arguments),n},init:function(){},mixIn:function(n){for(var r in n)n.hasOwnProperty(r)&&(this[r]=n[r]);n.hasOwnProperty("toString")&&(this.toString=n.toString);},clone:function(){return this.init.prototype.extend(this)}}}(),d=b.WordArray=g.extend({init:function(n,r){n=this.words=n||[],r!=e?this.sigBytes=r:this.sigBytes=n.length*4;},toString:function(n){return (n||m).stringify(this)},concat:function(n){var r=this.words,u=n.words,p=this.sigBytes,V=n.sigBytes;if(this.clamp(),p%4)for(var N=0;N<V;N++){var B=u[N>>>2]>>>24-N%4*8&255;r[p+N>>>2]|=B<<24-(p+N)%4*8;}else for(var v=0;v<V;v+=4)r[p+v>>>2]=u[v>>>2];return this.sigBytes+=V,this},clamp:function(){var n=this.words,r=this.sigBytes;n[r>>>2]&=4294967295<<32-r%4*8,n.length=t.ceil(r/4);},clone:function(){var n=g.clone.call(this);return n.words=this.words.slice(0),n},random:function(n){for(var r=[],u=0;u<n;u+=4)r.push(o());return new d.init(r,n)}}),l=c.enc={},m=l.Hex={stringify:function(n){for(var r=n.words,u=n.sigBytes,p=[],V=0;V<u;V++){var N=r[V>>>2]>>>24-V%4*8&255;p.push((N>>>4).toString(16)),p.push((N&15).toString(16));}return p.join("")},parse:function(n){for(var r=n.length,u=[],p=0;p<r;p+=2)u[p>>>3]|=parseInt(n.substr(p,2),16)<<24-p%8*4;return new d.init(u,r/2)}},h=l.Latin1={stringify:function(n){for(var r=n.words,u=n.sigBytes,p=[],V=0;V<u;V++){var N=r[V>>>2]>>>24-V%4*8&255;p.push(String.fromCharCode(N));}return p.join("")},parse:function(n){for(var r=n.length,u=[],p=0;p<r;p++)u[p>>>2]|=(n.charCodeAt(p)&255)<<24-p%4*8;return new d.init(u,r)}},x=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)))}},y=b.BufferedBlockAlgorithm=g.extend({reset:function(){this._data=new d.init,this._nDataBytes=0;},_append:function(n){typeof n=="string"&&(n=x.parse(n)),this._data.concat(n),this._nDataBytes+=n.sigBytes;},_process:function(n){var r,u=this._data,p=u.words,V=u.sigBytes,N=this.blockSize,B=N*4,v=V/B;n?v=t.ceil(v):v=t.max((v|0)-this._minBufferSize,0);var k=v*N,F=t.min(k*4,V);if(k){for(var G=0;G<k;G+=N)this._doProcessBlock(p,G);r=p.splice(0,k),u.sigBytes-=F;}return new d.init(r,F)},clone:function(){var n=g.clone.call(this);return n._data=this._data.clone(),n},_minBufferSize:0});b.Hasher=y.extend({cfg:g.extend(),init:function(n){this.cfg=this.cfg.extend(n),this.reset();},reset:function(){y.reset.call(this),this._doReset();},update:function(n){return this._append(n),this._process(),this},finalize:function(n){n&&this._append(n);var r=this._doFinalize();return r},blockSize:512/32,_createHelper:function(n){return function(r,u){return new n.init(u).finalize(r)}},_createHmacHelper:function(n){return function(r,u){return new T.HMAC.init(n,u).finalize(r)}}});var T=c.algo={};return c}(Math);return i});});var q=z((E,X)=>{(function(i,t){typeof E=="object"?X.exports=E=t(U()):typeof define=="function"&&define.amd?define(["./core"],t):t(i.CryptoJS);})(E,function(i){return function(){var t=i,e=t.lib,a=e.WordArray,o=e.Hasher,f=t.algo,c=[],b=f.SHA1=o.extend({_doReset:function(){this._hash=new a.init([1732584193,4023233417,2562383102,271733878,3285377520]);},_doProcessBlock:function(g,d){for(var l=this._hash.words,m=l[0],h=l[1],x=l[2],y=l[3],S=l[4],T=0;T<80;T++){if(T<16)c[T]=g[d+T]|0;else {var n=c[T-3]^c[T-8]^c[T-14]^c[T-16];c[T]=n<<1|n>>>31;}var r=(m<<5|m>>>27)+S+c[T];T<20?r+=(h&x|~h&y)+1518500249:T<40?r+=(h^x^y)+1859775393:T<60?r+=(h&x|h&y|x&y)-1894007588:r+=(h^x^y)-899497514,S=y,y=x,x=h<<30|h>>>2,h=m,m=r;}l[0]=l[0]+m|0,l[1]=l[1]+h|0,l[2]=l[2]+x|0,l[3]=l[3]+y|0,l[4]=l[4]+S|0;},_doFinalize:function(){var g=this._data,d=g.words,l=this._nDataBytes*8,m=g.sigBytes*8;return d[m>>>5]|=128<<24-m%32,d[(m+64>>>9<<4)+14]=Math.floor(l/4294967296),d[(m+64>>>9<<4)+15]=l,g.sigBytes=d.length*4,this._process(),this._hash},clone:function(){var g=o.clone.call(this);return g._hash=this._hash.clone(),g}});t.SHA1=o._createHelper(b),t.HmacSHA1=o._createHmacHelper(b);}(),i.SHA1});});var ne=fe(q());var _="___param___";function de(i,t){return Math.floor(Math.random()*(t-i+1)+i)}function pe(i){if(Array.isArray(i)||!i)return i;if(i&&typeof i=="object"&&"type"in i)switch(i.type){case"resulttocombine":return ge(i);case"ifelse":return s(i.condition)?s(i.then):s(i.else);case"stepswitch":let e=s(i.elements)||[];if(e.length===0){console.error("[Pixi\u2019VN Json] getValueFromConditionalStatements elements.length === 0");return}switch(i.choiceType){case"random":let a=de(0,e.length-1);return s(e[a]);case"loop":let o=pixiVn.NarrationManagerStatic.getCurrentStepTimesCounter(i.nestedId)-1;return o>e.length-1&&(o=o%e.length),s(e[o]);case"sequential":let f,c=pixiVn.NarrationManagerStatic.getCurrentStepTimesCounter(i.nestedId)-1;return i.end=="lastItem"&&(f=s(e[e.length-1])),c>e.length-1?f:s(e[c]);case"sequentialrandom":let b=pixiVn.NarrationManagerStatic.getRandomNumber(0,e.length-1,{nestedId:i.nestedId,onceOnly:!0});if(b==null&&i.end=="lastItem"){let g=pixiVn.NarrationManagerStatic.getCurrentStepTimesCounterData(i.nestedId);if(!g||!g?.usedRandomNumbers){console.warn("[Pixi\u2019VN Json] getValueFromConditionalStatements randomIndexWhitExclude == undefined");return}let d=g.usedRandomNumbers[`0-${e.length-1}`];return s(e[d[d.length-1]])}if(b==null){console.warn("[Pixi\u2019VN Json] getValueFromConditionalStatements randomIndexWhitExclude == undefined");return}return s(e[b])}}return i}function D(i){if(i.conditionalStep){let t=pixiVn.createExportableElement(s(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?.operation===void 0&&delete t?.operation,t){let e={...i,conditionalStep:void 0,...t};return D(e)}else pixiVn.getFlag(pixiVn.storage.keysSystem.ADD_NEXT_DIALOG_TEXT_INTO_THE_CURRENT_DIALOG_FLAG_KEY)&&pixiVn.setFlag(pixiVn.storage.keysSystem.ADD_NEXT_DIALOG_TEXT_INTO_THE_CURRENT_DIALOG_FLAG_KEY,!1);}return i}function ge(i){let t=i.firstItem,e=[];i.secondConditionalItem?.forEach(o=>{if(Array.isArray(o))o.forEach(f=>{let c=s(f);e.push(c);});else {let f=s(o);e.push(f);}});let a=t?[t,...e]:e;if(a.length===0){console.warn("[Pixi\u2019VN Json] combinateResult toCheck.length === 0");return}if(typeof a[0]=="string")return a.join("");if(typeof a[0]=="object"){let o=a,f,c=o.map((n,r)=>{n=D(n);let u=s(n.dialogue)||"";return r===0?(f=s(n.glueEnabled)||!1,u):(typeof u=="object"&&"text"in u&&(u=u.character+": "+u.text),f===!1&&(u=`
|
|
9
6
|
|
|
10
|
-
var
|
|
11
|
-
var I__default = /*#__PURE__*/_interopDefault(I);
|
|
12
|
-
var q__default = /*#__PURE__*/_interopDefault(q);
|
|
7
|
+
`+u),f=s(n.glueEnabled)||!1,u)}),b=s(c[0]),g=typeof b=="object"&&"character"in b?b.character:void 0,d=c.map(n=>{let r;n&&typeof n=="object"&&"text"in n?r=n.text:r=n;let u;return Array.isArray(r)?u=r.map(p=>`${s(p)}`).join(""):u=s(r)||"",u}).join(""),l=o.find(n=>n.end),m=o.find(n=>n.choices),h=!1,x=!1;o.length>0&&(o[0].glueEnabled&&o[0].goNextStep&&o[0].dialogue===void 0&&pixiVn.setFlag(pixiVn.storage.keysSystem.ADD_NEXT_DIALOG_TEXT_INTO_THE_CURRENT_DIALOG_FLAG_KEY,!0),h=o[o.length-1].glueEnabled,x=o.reverse().find(n=>!(n.operation&&(!n.dialogue||!n.choices)))?.goNextStep);let y=o.find(n=>n.labelToOpen),S=[];return o.forEach(n=>{n.operation&&S.forEach(r=>{S.push(r);});}),{dialogue:g?{character:g,text:d}:d,end:l?.end,choices:m?.choices,glueEnabled:h,goNextStep:x,labelToOpen:y?.labelToOpen,operation:S}}}function he(i){if(!i)return !1;if(typeof i!="object"||!("type"in i))return !!i;switch(i.type){case"compare":let t=s(i.leftValue),e=s(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 !!s(i.value);case"union":return me(i)}return !!i}function ye(i){if(i&&typeof i=="object"&&"type"in i&&i.type==="value"&&i.storageOperationType==="get")switch(i.storageType){case"storage":case"tempstorage":return pixiVn.storage.getVariable(i.key);case"flagStorage":return pixiVn.getFlag(i.key);case"label":return pixiVn.narration.getTimesLabelOpened(i.label);case"choice":return pixiVn.narration.getTimesChoiceMade(i.index);case"logic":return s(i.operation);case"params":let t=pixiVn.storage.getVariable(`${_}${pixiVn.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 me(i){if(i.unionType==="not")return !s(i.condition);let t=i.unionType==="and";for(let e=0;e<i.conditions.length;e++)if(t=s(i.conditions[e])||!1,i.unionType==="and"){if(!t)return !1}else if(t)return !0;return t}function Y(i){let t=s(i.value),e;switch(t&&typeof t=="object"&&"type"in t?e=s(t):e=t,i.storageType){case"flagStorage":pixiVn.setFlag(i.key,i.value);break;case"storage":pixiVn.storage.setVariable(i.key,e);break;case"tempstorage":pixiVn.storage.setTempVariable(i.key,e);break;case"params":let a=pixiVn.storage.getVariable(`${_}${pixiVn.narration.openedLabels.length-1}`)||[];a&&a.length-1>=i.key&&(a[i.key]=e),pixiVn.storage.setTempVariable(`${_}${pixiVn.narration.openedLabels.length-1}`,a);break}}function s(i){let t=pe(i);if(t&&typeof t=="object"&&"type"in t)switch(t.type){case"value":return ye(t);case"arithmetic":case"arithmeticsingle":return xe(t);case"compare":case"valueCondition":case"union":return he(t)}return t}function xe(i){let t=s(i.leftValue);switch(i.type){case"arithmetic":let e=s(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 pixiVn.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 $(i,t){let e=s(i);if(e)switch(e.type){case"sound":switch(e.operationType){case"add":pixiVn.sound.add(e.alias,{...e.props,url:e.url});break;case"play":pixiVn.sound.play(e.alias,e.props);break;case"remove":pixiVn.sound.remove(e.alias);break;case"pause":pixiVn.sound.pause(e.alias);break;case"resume":pixiVn.sound.resume(e.alias);break;case"volume":pixiVn.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 pixiVn.showWithFadeTransition(e.alias,e.url,e.transition.props,e.transition.priority);break;case"dissolve":await pixiVn.showWithDissolveTransition(e.alias,e.url,e.transition.props,e.transition.priority);break;case"movein":case"moveout":await pixiVn.moveIn(e.alias,e.url,e.transition.props,e.transition.priority);break;case"zoomin":case"zoomout":await pixiVn.zoomIn(e.alias,e.url,e.transition.props,e.transition.priority);break}else await pixiVn.showImage(e.alias,e.url);break;case"edit":let a=pixiVn.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":pixiVn.canvas.remove(e.alias);break}break;case"video":switch(e.operationType){case"show":if(e.transition){let c=new pixiVn.CanvasVideo;switch(c.videoLink=e.url,e.transition.type){case"fade":await pixiVn.showWithFadeTransition(e.alias,c,e.transition.props,e.transition.priority);break;case"dissolve":await pixiVn.showWithDissolveTransition(e.alias,c,e.transition.props,e.transition.priority);break;case"movein":case"moveout":await pixiVn.moveIn(e.alias,c,e.transition.props,e.transition.priority);break;case"zoomin":case"zoomout":await pixiVn.zoomIn(e.alias,c,e.transition.props,e.transition.priority);break}}else await pixiVn.showVideo(e.alias,e.url);break;case"edit":let a=pixiVn.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":pixiVn.canvas.remove(e.alias);break;case"pause":let o=pixiVn.canvas.find(e.alias);o?o.paused=!0:console.error(`[Pixi\u2019VN Json] Video with alias ${e.alias} not found.`);break;case"resume":let f=pixiVn.canvas.find(e.alias);f?f.paused=!1:console.error(`[Pixi\u2019VN Json] Video with alias ${e.alias} not found.`);break}break;case"value":Y(e);break;case"oprationtoconvert":if(t){let a="";e.values.forEach(f=>{if(typeof f=="string")a+=f;else {let c=s(f);a+=`${c}`;}});let o=t(a);o&&await $(o);}break;case"input":switch(e.operationType){case"request":pixiVn.narration.requestInput({type:e.valueType});break}break}}var R=class extends pixiVn.LabelAbstract{constructor(t,e,a,o={}){super(t,a),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, ne.default)(e.toString().toLocaleLowerCase()).toString()}getDialogueText(t){let e="";if(Array.isArray(t)){let a=[];t.forEach(o=>{if(typeof o=="string")a.push(o);else if(o&&typeof o=="object"){let f=s(o);f?(f&&!Array.isArray(f)&&typeof f=="object"&&(f=s(f)||""),Array.isArray(f)?a=a.concat(f):a.push(`${f}`)):a.push(`${o}`);}}),e=a;}else {let a=s(t)||"";a&&!Array.isArray(a)&&typeof a=="object"&&(a=s(a)||""),e=a;}return `${e}`}getDialogue(t){let e=s(t);if(e)return typeof e=="object"&&"character"in e&&"text"in e?{character:e.character,text:this.getDialogueText(e.text)}:this.getDialogueText(e);if(e!=null)return `${e}`}getChoices(t){return s(t)?.map(o=>s(o)).filter(o=>o!==void 0)}stepConverter(t){return async e=>{if(typeof t=="function"&&(t=t()),t=D(t),t.operation)for(let d of t.operation)await $(d,this.operationStringConvert);let a=this.getChoices(t.choices),o=s(t.glueEnabled),f=this.getDialogue(t.dialogue),c=[];t.labelToOpen&&(Array.isArray(t.labelToOpen)||(t.labelToOpen=[t.labelToOpen]),t.labelToOpen.forEach(d=>{let l=s(d);l&&c.push(l);}));let b=s(t.goNextStep),g=s(t.end);if(a){let d=a.map(l=>{let m="";if(Array.isArray(l.text)){let h=[];l.text.forEach(x=>{if(typeof x=="string")h.push(x);else if(x&&typeof x=="object"){let y=s(x);y&&!Array.isArray(y)&&typeof y=="object"&&(y=s(y)||""),y&&(Array.isArray(y)?h=h.concat(y):h.push(y));}}),m=h.join();}else typeof l.text=="string"&&(m=l.text);return new pixiVn.ChoiceMenuOption(m,l.label,l.props,{type:l.type,oneTime:l.oneTime,onlyHaveNoChoice:l.onlyHaveNoChoice,autoSelect:l.autoSelect})});pixiVn.narration.choiceMenuOptions=d;}else pixiVn.narration.choiceMenuOptions=void 0;f!==void 0&&(pixiVn.narration.dialogue=f,this.skipEmptyDialogs&&typeof f=="string"&&(f===""||RegExp(/^\s+$/).test(f))&&(b=!0)),o?pixiVn.setFlag(pixiVn.storage.keysSystem.ADD_NEXT_DIALOG_TEXT_INTO_THE_CURRENT_DIALOG_FLAG_KEY,!0):o===!1&&pixiVn.setFlag(pixiVn.storage.keysSystem.ADD_NEXT_DIALOG_TEXT_INTO_THE_CURRENT_DIALOG_FLAG_KEY,!1),c.forEach(d=>{let l=d.label;typeof l=="object"&&(l=s(l)||"");let m=d.params?.map(h=>s(h));e={...e,...d.props},d.type==="jump"?(pixiVn.narration.closeCurrentLabel(),pixiVn.storage.setTempVariable(`${_}${pixiVn.narration.openedLabels.length}`,m),pixiVn.narration.callLabel(l,e)):(pixiVn.storage.setTempVariable(`${_}${pixiVn.narration.openedLabels.length}`,m),pixiVn.narration.callLabel(l,e));}),g==="game_end"?(pixiVn.narration.closeAllLabels(),await pixiVn.narration.goNext(e)):g==="label_end"&&pixiVn.narration.closeCurrentLabel(),b&&await pixiVn.narration.goNext(e);}}};
|
|
13
8
|
|
|
14
|
-
var ne=Object.create;var G=Object.defineProperty;var re=Object.getOwnPropertyDescriptor;var ae=Object.getOwnPropertyNames;var oe=Object.getPrototypeOf,se=Object.prototype.hasOwnProperty;var R=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(i,n)=>(typeof require<"u"?require:i)[n]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var F=(t,i)=>()=>(i||t((i={exports:{}}).exports,i),i.exports);var le=(t,i,n,e)=>{if(i&&typeof i=="object"||typeof i=="function")for(let a of ae(i))!se.call(t,a)&&a!==n&&G(t,a,{get:()=>i[a],enumerable:!(e=re(i,a))||e.enumerable});return t};var ue=(t,i,n)=>(n=t!=null?ne(oe(t)):{},le(G(n,"default",{value:t,enumerable:!0}),t));var M=F((O,z)=>{(function(t,i){typeof O=="object"?z.exports=O=i():typeof define=="function"&&define.amd?define([],i):t.CryptoJS=i();})(O,function(){var t=t||function(i,n){var e;if(typeof window<"u"&&window.crypto&&(e=window.crypto),typeof self<"u"&&self.crypto&&(e=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(e=globalThis.crypto),!e&&typeof window<"u"&&window.msCrypto&&(e=window.msCrypto),!e&&typeof global<"u"&&global.crypto&&(e=global.crypto),!e&&typeof R=="function")try{e=R("crypto");}catch{}var a=function(){if(e){if(typeof e.getRandomValues=="function")try{return e.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof e.randomBytes=="function")try{return e.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},l=Object.create||function(){function r(){}return function(o){var p;return r.prototype=o,p=new r,r.prototype=null,p}}(),s={},d=s.lib={},x=d.Base=function(){return {extend:function(r){var o=l(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)}}}(),m=d.WordArray=x.extend({init:function(r,o){r=this.words=r||[],o!=n?this.sigBytes=o:this.sigBytes=r.length*4;},toString:function(r){return (r||f).stringify(this)},concat:function(r){var o=this.words,p=r.words,h=this.sigBytes,V=r.sigBytes;if(this.clamp(),h%4)for(var v=0;v<V;v++){var E=p[v>>>2]>>>24-v%4*8&255;o[h+v>>>2]|=E<<24-(h+v)%4*8;}else for(var w=0;w<V;w+=4)o[h+w>>>2]=p[w>>>2];return this.sigBytes+=V,this},clamp:function(){var r=this.words,o=this.sigBytes;r[o>>>2]&=4294967295<<32-o%4*8,r.length=i.ceil(o/4);},clone:function(){var r=x.clone.call(this);return r.words=this.words.slice(0),r},random:function(r){for(var o=[],p=0;p<r;p+=4)o.push(a());return new m.init(o,r)}}),u=s.enc={},f=u.Hex={stringify:function(r){for(var o=r.words,p=r.sigBytes,h=[],V=0;V<p;V++){var v=o[V>>>2]>>>24-V%4*8&255;h.push((v>>>4).toString(16)),h.push((v&15).toString(16));}return h.join("")},parse:function(r){for(var o=r.length,p=[],h=0;h<o;h+=2)p[h>>>3]|=parseInt(r.substr(h,2),16)<<24-h%8*4;return new m.init(p,o/2)}},y=u.Latin1={stringify:function(r){for(var o=r.words,p=r.sigBytes,h=[],V=0;V<p;V++){var v=o[V>>>2]>>>24-V%4*8&255;h.push(String.fromCharCode(v));}return h.join("")},parse:function(r){for(var o=r.length,p=[],h=0;h<o;h++)p[h>>>2]|=(r.charCodeAt(h)&255)<<24-h%4*8;return new m.init(p,o)}},b=u.Utf8={stringify:function(r){try{return decodeURIComponent(escape(y.stringify(r)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(r){return y.parse(unescape(encodeURIComponent(r)))}},c=d.BufferedBlockAlgorithm=x.extend({reset:function(){this._data=new m.init,this._nDataBytes=0;},_append:function(r){typeof r=="string"&&(r=b.parse(r)),this._data.concat(r),this._nDataBytes+=r.sigBytes;},_process:function(r){var o,p=this._data,h=p.words,V=p.sigBytes,v=this.blockSize,E=v*4,w=V/E;r?w=i.ceil(w):w=i.max((w|0)-this._minBufferSize,0);var A=w*v,H=i.min(A*4,V);if(A){for(var D=0;D<A;D+=v)this._doProcessBlock(h,D);o=h.splice(0,A),p.sigBytes-=H;}return new m.init(o,H)},clone:function(){var r=x.clone.call(this);return r._data=this._data.clone(),r},_minBufferSize:0});d.Hasher=c.extend({cfg:x.extend(),init:function(r){this.cfg=this.cfg.extend(r),this.reset();},reset:function(){c.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,p){return new r.init(p).finalize(o)}},_createHmacHelper:function(r){return function(o,p){return new T.HMAC.init(r,p).finalize(o)}}});var T=s.algo={};return s}(Math);return t});});var U=F((L,W)=>{(function(t,i){typeof L=="object"?W.exports=L=i(M()):typeof define=="function"&&define.amd?define(["./core"],i):i(t.CryptoJS);})(L,function(t){return function(){var i=t,n=i.lib,e=n.WordArray,a=n.Hasher,l=i.algo,s=[],d=l.SHA1=a.extend({_doReset:function(){this._hash=new e.init([1732584193,4023233417,2562383102,271733878,3285377520]);},_doProcessBlock:function(x,m){for(var u=this._hash.words,f=u[0],y=u[1],b=u[2],c=u[3],N=u[4],T=0;T<80;T++){if(T<16)s[T]=x[m+T]|0;else {var r=s[T-3]^s[T-8]^s[T-14]^s[T-16];s[T]=r<<1|r>>>31;}var o=(f<<5|f>>>27)+N+s[T];T<20?o+=(y&b|~y&c)+1518500249:T<40?o+=(y^b^c)+1859775393:T<60?o+=(y&b|y&c|b&c)-1894007588:o+=(y^b^c)-899497514,N=c,c=b,b=y<<30|y>>>2,y=f,f=o;}u[0]=u[0]+f|0,u[1]=u[1]+y|0,u[2]=u[2]+b|0,u[3]=u[3]+c|0,u[4]=u[4]+N|0;},_doFinalize:function(){var x=this._data,m=x.words,u=this._nDataBytes*8,f=x.sigBytes*8;return m[f>>>5]|=128<<24-f%32,m[(f+64>>>9<<4)+14]=Math.floor(u/4294967296),m[(f+64>>>9<<4)+15]=u,x.sigBytes=m.length*4,this._process(),this._hash},clone:function(){var x=a.clone.call(this);return x._hash=this._hash.clone(),x}});i.SHA1=a._createHelper(d),i.HmacSHA1=a._createHmacHelper(d);}(),t.SHA1});});var ie=ue(U());var j="___param___";function de(t,i){return Math.floor(Math.random()*(i-t+1)+t)}function g(t,i){if(!(Array.isArray(t)||!t)){if(t&&typeof t=="object"&&"type"in t)switch(t.type){case"resulttocombine":return pe(t,i);case"ifelse":return S(t.condition,i)?g(t.then,i):g(t.else,i);case"stepswitch":let e=g(t.elements,i)||[];if(e.length===0){console.error("[Pixi'VN] getValueFromConditionalStatements elements.length === 0");return}switch(t.choiceType){case"random":let a=de(0,e.length);return g(e[a],i);case"loop":return pixiVn.narration.currentStepTimesCounter>e.length-1?(pixiVn.narration.currentStepTimesCounter=0,g(e[0],i)):g(e[I__default.default.getCurrentStepTimesCounter(t.nestedId)],i);case"sequential":let l;return t.end=="lastItem"&&(l=g(e[e.length-1],i)),pixiVn.narration.currentStepTimesCounter>e.length-1?l:g(e[I__default.default.getCurrentStepTimesCounter(t.nestedId)],i);case"sequentialrandom":let s=I__default.default.getRandomNumber(0,e.length-1,{nestedId:t.nestedId,onceOnly:!0});if(s==null&&t.end=="lastItem"){let d=I__default.default.getCurrentStepTimesCounterData(t.nestedId);if(!d||!d?.usedRandomNumbers)return;let x=d.usedRandomNumbers[`0-${e.length-1}`];return g(e[x[x.length-1]],i)}return s==null?void 0:g(e[s],i)}}return t}}function pe(t,i){let n=t.firstItem,e=[];t.secondConditionalItem?.forEach(l=>{if(Array.isArray(l))l.forEach(s=>{let d=g(s,i);d&&e.push(d);});else {let s=g(l,i);s&&e.push(s);}});let a=n?[n,...e]:e;if(a.length!==0){if(typeof a[0]=="string")return a.join("");if(typeof a[0]=="object"){let l=a,s=l.map(c=>c.dialogue).join(""),d=l.find(c=>c.end),x=l.find(c=>c.choices),m=l.find(c=>c.glueEnabled),u=l.find(c=>c.goNextStep),f=l.find(c=>c.labelToOpen),y=l.find(c=>c.operation);return {dialogue:s,end:d?.end,choices:x?.choices,glueEnabled:m?.glueEnabled,goNextStep:u?.goNextStep,labelToOpen:f?.labelToOpen,operation:y?.operation}}}}function he(t,i){if(!t)return !1;if(typeof t!="object"||!("type"in t))return !!t;switch(t.type){case"compare":let n=C(t.leftValue,i),e=C(t.rightValue,i);switch(t.operator){case"==":return n===e;case"!=":return n!==e;case"<":return n<e;case"<=":return n<=e;case">":return n>e;case">=":return n>=e;case"CONTAINS":return n.toString().includes(e.toString())}break;case"valueCondition":return !!C(t.value,i);case"union":return ge(t,i);case"labelcondition":if("operator"in t&&"label"in t)switch(t.operator){case"started":return pixiVn.narration.getTimesLabelOpened(t.label)>0;case"completed":return pixiVn.narration.isLabelAlreadyCompleted(t.label)}break}return !!t}function C(t,i){if(t&&typeof t=="object"&&"type"in t)if(t.type==="value"&&t.storageOperationType==="get")switch(t.storageType){case"storage":return pixiVn.storage.getVariable(t.key);case"tempstorage":return q__default.default.getTempVariable(t.key);case"flagStorage":return pixiVn.getFlag(t.key);case"label":return pixiVn.narration.getTimesLabelOpened(t.label);case"logic":return S(t.operation,i);case"params":return i&&i.length-1>=t.key?i[t.key]:void 0}else return S(t,i);return t}function ge(t,i){if(t.unionType==="not")return !S(t.condition,i);let n=t.unionType==="and";for(let e=0;e<t.conditions.length;e++)if(n=S(t.conditions[e],i)||!1,t.unionType==="and"){if(!n)return !1}else if(n)return !0;return n}function X(t,i){let n=g(t.value,i),e;switch(n&&typeof n=="object"&&"type"in n?e=S(n,i):e=n,t.storageType){case"flagStorage":pixiVn.setFlag(t.key,t.value);break;case"storage":pixiVn.storage.setVariable(t.key,e);break;case"tempstorage":q__default.default.setTempVariable(t.key,e);break;case"params":i&&i.length-1>=t.key&&(i[t.key]=e);break}}function S(t,i){let n=g(t,i);if(n&&typeof n=="object"&&"type"in n)switch(n.type){case"value":return C(n,i);case"arithmetic":case"arithmeticsingle":return ye(n,i);case"compare":case"valueCondition":case"union":case"labelcondition":return he(n,i)}return n}function ye(t,i){let n=S(t.leftValue,i);switch(t.type){case"arithmetic":let e=S(t.rightValue,i);switch(t.operator){case"*":return n*e;case"/":return n/e;case"+":return n+e;case"-":return n-e;case"%":return n%e;case"POW":return Math.pow(n,e);case"RANDOM":return Math.floor(Math.random()*(e-n+1))+n}case"arithmeticsingle":switch(t.operator){case"INT":return parseInt(n);case"FLOOR":return Math.floor(n);case"FLOAT":return parseFloat(n)}break}}var B=class extends Ve__default.default{constructor(i,n,e,a){super(i,e),this._steps=n,this.operationStringConvert=a;}_steps;get steps(){return this._steps.map(this.stepConverter)}operationStringConvert;getStepSha1(i){if(i<0||i>=this.steps.length)return;let n=this._steps[i];return (0, ie.default)(n.toString().toLocaleLowerCase()).toString()}getDialogueText(i,n){let e="";if(Array.isArray(i)){let a=[];i.forEach(l=>{if(typeof l=="string")a.push(l);else if(l&&typeof l=="object"){let s=g(l,n);s&&(s&&!Array.isArray(s)&&typeof s=="object"&&(s=C(s,n)||""),Array.isArray(s)?a=a.concat(s):a.push(s));}}),e=a;}else {let a=g(i,n)||"";a&&!Array.isArray(a)&&typeof a=="object"&&(a=C(a,n)||""),e=a;}return e}getDialogue(i,n){let e=g(i,n),a;return e&&(typeof e=="object"&&"character"in e&&"text"in e?a={character:e.character,text:this.getDialogueText(e.text,n)}:a=this.getDialogueText(e,n)),a}getChoices(i,n){let e=g(i,n);if(e)return e.map(l=>g(l,n)).filter(l=>l!==void 0)}stepConverter(i){return async n=>{let e=n[j];if(typeof i=="function"&&(i=i()),i.operation)for(let u of i.operation)await this.runOperation(u,e);let a=this.getChoices(i.choices,e),l=g(i.glueEnabled,e),s=this.getDialogue(i.dialogue,e),d=[];i.labelToOpen&&(Array.isArray(i.labelToOpen)||(i.labelToOpen=[i.labelToOpen]),i.labelToOpen.forEach(u=>{let f=g(u,e);f&&d.push(f);}));let x=g(i.goNextStep,e),m=g(i.end,e);if(a){let u=a.map(f=>{let y="";if(Array.isArray(f.text)){let b=[];f.text.forEach(c=>{if(typeof c=="string")b.push(c);else if(c&&typeof c=="object"){let N=g(c,e);N&&!Array.isArray(N)&&typeof N=="object"&&(N=C(N,e)||""),N&&(Array.isArray(N)?b=b.concat(N):b.push(N));}}),y=b.join();}else typeof f.text=="string"&&(y=f.text);return new pixiVn.ChoiceMenuOption(y,f.label,f.props,{type:f.type,oneTime:f.oneTime})});u=u.filter((f,y)=>{if(f.oneTime){let b=pixiVn.narration.alreadyCurrentStepMadeChoices;if(b&&b.includes(y))return !1}return !0}),pixiVn.narration.choiceMenuOptions=u;}else pixiVn.narration.choiceMenuOptions=void 0;l?pixiVn.setFlag(pixiVn.storage.keysSystem.ADD_NEXT_DIALOG_TEXT_INTO_THE_CURRENT_DIALOG_FLAG_KEY,!0):l===!1&&pixiVn.setFlag(pixiVn.storage.keysSystem.ADD_NEXT_DIALOG_TEXT_INTO_THE_CURRENT_DIALOG_FLAG_KEY,!1),s&&(pixiVn.narration.dialogue=s),d.forEach(u=>{let f=u.label;typeof f=="object"&&(f=C(f,e)||"");let y=u.params?.map(b=>S(b,e));n={...n,...u.props,[j]:y},u.type==="jump"?pixiVn.narration.jumpLabel(f,n):pixiVn.narration.callLabel(f,n);}),x&&await pixiVn.narration.goNext(n),m==="game_end"?(pixiVn.narration.closeAllLabels(),await pixiVn.narration.goNext(n)):m==="label_end"&&pixiVn.narration.closeCurrentLabel();}}async runOperation(i,n){let e=g(i,n);if(e)switch(e.type){case"sound":switch(e.operationType){case"add":pixiVn.sound.add(e.alias,{...e.props,url:e.url});break;case"play":pixiVn.sound.play(e.alias,e.props);break;case"remove":pixiVn.sound.remove(e.alias);break;case"pause":pixiVn.sound.pause(e.alias);break;case"resume":pixiVn.sound.resume(e.alias);break;case"volume":pixiVn.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 pixiVn.showWithFadeTransition(e.alias,e.url,e.transition.props,e.transition.priority);break;case"dissolve":await pixiVn.showWithDissolveTransition(e.alias,e.url,e.transition.props,e.transition.priority);break;case"movein":case"moveout":await pixiVn.moveIn(e.alias,e.url,e.transition.props,e.transition.priority);break;case"zoomin":case"zoomout":await pixiVn.zoomIn(e.alias,e.url,e.transition.props,e.transition.priority);break}else await pixiVn.showImage(e.alias,e.url);break;case"edit":let a=pixiVn.canvas.find(e.alias);a?e.props&&(a.memory={...a.memory,...e.props}):console.error(`[Pixi'VN] Image with alias ${e.alias} not found.`);break;case"remove":pixiVn.canvas.remove(e.alias);break}break;case"video":switch(e.operationType){case"show":if(e.transition){let d=new pixiVn.CanvasVideo;switch(d.videoLink=e.url,e.transition.type){case"fade":await pixiVn.showWithFadeTransition(e.alias,d,e.transition.props,e.transition.priority);break;case"dissolve":await pixiVn.showWithDissolveTransition(e.alias,d,e.transition.props,e.transition.priority);break;case"movein":case"moveout":await pixiVn.moveIn(e.alias,d,e.transition.props,e.transition.priority);break;case"zoomin":case"zoomout":await pixiVn.zoomIn(e.alias,d,e.transition.props,e.transition.priority);break}}else await pixiVn.showVideo(e.alias,e.url);break;case"edit":let a=pixiVn.canvas.find(e.alias);a?e.props&&(a.memory={...a.memory,...e.props}):console.error(`[Pixi'VN] Video with alias ${e.alias} not found.`);break;case"remove":pixiVn.canvas.remove(e.alias);break;case"pause":let l=pixiVn.canvas.find(e.alias);l?l.paused=!0:console.error(`[Pixi'VN] Video with alias ${e.alias} not found.`);break;case"resume":let s=pixiVn.canvas.find(e.alias);s?s.paused=!1:console.error(`[Pixi'VN] Video with alias ${e.alias} not found.`);break}break;case"value":X(e,n);break;case"oprationtoconvert":if(this.operationStringConvert){let a="";e.values.forEach(s=>{if(typeof s=="string")a+=s;else {let d=S(s,n);d&&(a+=`${d}`);}});let l=this.operationStringConvert(a);l&&await this.runOperation(l,n);}break;case"input":switch(e.operationType){case"request":pixiVn.narration.requestInput({type:e.valueType});break}break}}};
|
|
15
|
-
|
|
16
|
-
exports.LabelJson = B;
|
|
9
|
+
exports.LabelJson = R;
|
package/dist/classes/index.d.cts
CHANGED
|
@@ -1,14 +1,9 @@
|
|
|
1
1
|
export { default as LabelJson } from './LabelJson.cjs';
|
|
2
2
|
import '@drincs/pixi-vn';
|
|
3
|
-
import '@drincs/pixi-vn/dist/classes/LabelAbstract';
|
|
4
|
-
import '@drincs/pixi-vn/dist/types/LabelIdType';
|
|
5
3
|
import '../interface/PixiVNJsonLabelStep.cjs';
|
|
6
|
-
import '../PixiVNJsonConditionalStatements-
|
|
7
|
-
import '../interface/PixiVNJsonLabelCondition.cjs';
|
|
4
|
+
import '../PixiVNJsonConditionalStatements-CVkQSKpq.cjs';
|
|
8
5
|
import '../interface/PixiVNJsonOperations.cjs';
|
|
9
6
|
import '../interface/PixiVNJsonInput.cjs';
|
|
10
7
|
import '../interface/PixiVNJsonMedia.cjs';
|
|
11
|
-
import '@drincs/pixi-vn/dist/interface/canvas/ICanvasVideoMemory';
|
|
12
8
|
import '../interface/PixiVNJsonMediaTransiotions.cjs';
|
|
13
|
-
import '@drincs/pixi-vn/dist/functions/canvas/CanvasTransition';
|
|
14
9
|
import 'pixi.js';
|
package/dist/classes/index.d.ts
CHANGED
|
@@ -1,14 +1,9 @@
|
|
|
1
1
|
export { default as LabelJson } from './LabelJson.js';
|
|
2
2
|
import '@drincs/pixi-vn';
|
|
3
|
-
import '@drincs/pixi-vn/dist/classes/LabelAbstract';
|
|
4
|
-
import '@drincs/pixi-vn/dist/types/LabelIdType';
|
|
5
3
|
import '../interface/PixiVNJsonLabelStep.js';
|
|
6
|
-
import '../PixiVNJsonConditionalStatements-
|
|
7
|
-
import '../interface/PixiVNJsonLabelCondition.js';
|
|
4
|
+
import '../PixiVNJsonConditionalStatements-CVkQSKpq.js';
|
|
8
5
|
import '../interface/PixiVNJsonOperations.js';
|
|
9
6
|
import '../interface/PixiVNJsonInput.js';
|
|
10
7
|
import '../interface/PixiVNJsonMedia.js';
|
|
11
|
-
import '@drincs/pixi-vn/dist/interface/canvas/ICanvasVideoMemory';
|
|
12
8
|
import '../interface/PixiVNJsonMediaTransiotions.js';
|
|
13
|
-
import '@drincs/pixi-vn/dist/functions/canvas/CanvasTransition';
|
|
14
9
|
import 'pixi.js';
|