@famibee/skynovel 2.0.2 → 2.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (121) hide show
  1. package/dist/Button.js +36 -34
  2. package/dist/Button.js.map +1 -1
  3. package/dist/CallStack.js +11 -6
  4. package/dist/CallStack.js.map +1 -1
  5. package/dist/CmnInterface.js +13 -11
  6. package/dist/CmnInterface.js.map +1 -1
  7. package/dist/CmnLib.js +58 -56
  8. package/dist/CmnLib.js.map +1 -1
  9. package/dist/Config.js +9 -7
  10. package/dist/Config.js.map +1 -1
  11. package/dist/ConfigBase.js +52 -49
  12. package/dist/ConfigBase.js.map +1 -1
  13. package/dist/DebugMng.js +9 -6
  14. package/dist/DebugMng.js.map +1 -1
  15. package/dist/EventListenerCtn.js +6 -4
  16. package/dist/EventListenerCtn.js.map +1 -1
  17. package/dist/EventMng.js +522 -417
  18. package/dist/EventMng.js.map +1 -1
  19. package/dist/Grammar.js +22 -20
  20. package/dist/Grammar.js.map +1 -1
  21. package/dist/GrpLayer.js +58 -57
  22. package/dist/GrpLayer.js.map +1 -1
  23. package/dist/Layer.js +66 -64
  24. package/dist/Layer.js.map +1 -1
  25. package/dist/LayerMng.js +461 -441
  26. package/dist/LayerMng.js.map +1 -1
  27. package/dist/Main.js +69 -67
  28. package/dist/Main.js.map +1 -1
  29. package/dist/PropParser.js +23 -19
  30. package/dist/PropParser.js.map +1 -1
  31. package/dist/Reading.js +422 -418
  32. package/dist/Reading.js.map +1 -1
  33. package/dist/RubySpliter.js +4 -2
  34. package/dist/RubySpliter.js.map +1 -1
  35. package/dist/ScriptIterator.js +374 -370
  36. package/dist/ScriptIterator.js.map +1 -1
  37. package/dist/SndBuf.js +643 -622
  38. package/dist/SndBuf.js.map +1 -1
  39. package/dist/SoundMng.js +59 -60
  40. package/dist/SoundMng.js.map +1 -1
  41. package/dist/SpritesMng.js +135 -129
  42. package/dist/SpritesMng.js.map +1 -1
  43. package/dist/SysBase.js +1019 -955
  44. package/dist/SysBase.js.map +1 -1
  45. package/dist/TxtLayer.js +558 -551
  46. package/dist/TxtLayer.js.map +1 -1
  47. package/dist/Variable.js +47 -45
  48. package/dist/Variable.js.map +1 -1
  49. package/dist/chunk.js +11 -9
  50. package/dist/gamepad.js +396 -660
  51. package/dist/gamepad.js.map +1 -1
  52. package/dist/pixi.js +3044 -3648
  53. package/dist/pixi.js.map +1 -1
  54. package/dist/platform.js +6 -4
  55. package/dist/platform.js.map +1 -1
  56. package/dist/rolldown-runtime.js +20 -0
  57. package/dist/web.js +106 -590
  58. package/dist/web.js.map +1 -1
  59. package/dist_app/Button.js +36 -34
  60. package/dist_app/Button.js.map +1 -1
  61. package/dist_app/CallStack.js +11 -6
  62. package/dist_app/CallStack.js.map +1 -1
  63. package/dist_app/CmnInterface.js +13 -11
  64. package/dist_app/CmnInterface.js.map +1 -1
  65. package/dist_app/CmnLib.js +58 -56
  66. package/dist_app/CmnLib.js.map +1 -1
  67. package/dist_app/Config.js +9 -7
  68. package/dist_app/Config.js.map +1 -1
  69. package/dist_app/ConfigBase.js +52 -49
  70. package/dist_app/ConfigBase.js.map +1 -1
  71. package/dist_app/DebugMng.js +9 -6
  72. package/dist_app/DebugMng.js.map +1 -1
  73. package/dist_app/EventListenerCtn.js +6 -4
  74. package/dist_app/EventListenerCtn.js.map +1 -1
  75. package/dist_app/EventMng.js +522 -417
  76. package/dist_app/EventMng.js.map +1 -1
  77. package/dist_app/Grammar.js +22 -20
  78. package/dist_app/Grammar.js.map +1 -1
  79. package/dist_app/GrpLayer.js +58 -57
  80. package/dist_app/GrpLayer.js.map +1 -1
  81. package/dist_app/Layer.js +66 -64
  82. package/dist_app/Layer.js.map +1 -1
  83. package/dist_app/LayerMng.js +461 -441
  84. package/dist_app/LayerMng.js.map +1 -1
  85. package/dist_app/Main.js +69 -67
  86. package/dist_app/Main.js.map +1 -1
  87. package/dist_app/PropParser.js +23 -19
  88. package/dist_app/PropParser.js.map +1 -1
  89. package/dist_app/Reading.js +422 -418
  90. package/dist_app/Reading.js.map +1 -1
  91. package/dist_app/RubySpliter.js +4 -2
  92. package/dist_app/RubySpliter.js.map +1 -1
  93. package/dist_app/ScriptIterator.js +374 -370
  94. package/dist_app/ScriptIterator.js.map +1 -1
  95. package/dist_app/SndBuf.js +643 -622
  96. package/dist_app/SndBuf.js.map +1 -1
  97. package/dist_app/SoundMng.js +59 -60
  98. package/dist_app/SoundMng.js.map +1 -1
  99. package/dist_app/SpritesMng.js +135 -129
  100. package/dist_app/SpritesMng.js.map +1 -1
  101. package/dist_app/SysBase.js +1019 -955
  102. package/dist_app/SysBase.js.map +1 -1
  103. package/dist_app/TxtLayer.js +558 -551
  104. package/dist_app/TxtLayer.js.map +1 -1
  105. package/dist_app/Variable.js +47 -45
  106. package/dist_app/Variable.js.map +1 -1
  107. package/dist_app/app.js +62 -63
  108. package/dist_app/app.js.map +1 -1
  109. package/dist_app/appMain.js +1 -21
  110. package/dist_app/appMain.js.map +1 -1
  111. package/dist_app/chunk.js +11 -9
  112. package/dist_app/gamepad.js +396 -660
  113. package/dist_app/gamepad.js.map +1 -1
  114. package/dist_app/pixi.js +2028 -1990
  115. package/dist_app/pixi.js.map +1 -1
  116. package/dist_app/platform.js +6 -4
  117. package/dist_app/platform.js.map +1 -1
  118. package/dist_app/preload.js +1 -1
  119. package/dist_app/preload.js.map +1 -1
  120. package/dist_app/rolldown-runtime.js +20 -0
  121. package/package.json +20 -47
package/dist/web.js CHANGED
@@ -1,593 +1,108 @@
1
- import { i as __toESM, t as __commonJSMin } from "./chunk.js";
2
- import { l as argChk_Num, s as argChk_Boolean, t as CmnLib, u as getDateStr } from "./CmnLib.js";
3
- import "./CmnInterface.js";
4
- import "./pixi.js";
5
- import "./EventListenerCtn.js";
6
- import "./ConfigBase.js";
7
- import { t as SysBase } from "./SysBase.js";
8
- import { t as Layer } from "./Layer.js";
9
- var require_util = /* @__PURE__ */ __commonJSMin(((exports, module) => {
10
- var assign = make_assign();
11
- module.exports = {
12
- assign,
13
- create: make_create(),
14
- trim: make_trim(),
15
- bind,
16
- slice,
17
- each,
18
- map,
19
- pluck,
20
- isList,
21
- isFunction,
22
- isObject,
23
- Global: typeof window < "u" ? window : global
24
- };
25
- function make_assign() {
26
- return Object.assign ? Object.assign : function(obj, props1, props2, etc) {
27
- for (var i = 1; i < arguments.length; i++) each(Object(arguments[i]), function(val, key) {
28
- obj[key] = val;
29
- });
30
- return obj;
31
- };
32
- }
33
- function make_create() {
34
- if (Object.create) return function(obj, assignProps1, assignProps2, etc) {
35
- var assignArgsList = slice(arguments, 1);
36
- return assign.apply(this, [Object.create(obj)].concat(assignArgsList));
37
- };
38
- {
39
- function F() {}
40
- return function(obj, assignProps1, assignProps2, etc) {
41
- var assignArgsList = slice(arguments, 1);
42
- return F.prototype = obj, assign.apply(this, [new F()].concat(assignArgsList));
43
- };
44
- }
45
- }
46
- function make_trim() {
47
- return String.prototype.trim ? function(str) {
48
- return String.prototype.trim.call(str);
49
- } : function(str) {
50
- return str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
51
- };
52
- }
53
- function bind(obj, fn) {
54
- return function() {
55
- return fn.apply(obj, Array.prototype.slice.call(arguments, 0));
56
- };
57
- }
58
- function slice(arr, index) {
59
- return Array.prototype.slice.call(arr, index || 0);
60
- }
61
- function each(obj, fn) {
62
- pluck(obj, function(val, key) {
63
- return fn(val, key), !1;
64
- });
65
- }
66
- function map(obj, fn) {
67
- var res = isList(obj) ? [] : {};
68
- return pluck(obj, function(v, k) {
69
- return res[k] = fn(v, k), !1;
70
- }), res;
71
- }
72
- function pluck(obj, fn) {
73
- if (isList(obj)) {
74
- for (var i = 0; i < obj.length; i++) if (fn(obj[i], i)) return obj[i];
75
- } else for (var key in obj) if (obj.hasOwnProperty(key) && fn(obj[key], key)) return obj[key];
76
- }
77
- function isList(val) {
78
- return val != null && typeof val != "function" && typeof val.length == "number";
79
- }
80
- function isFunction(val) {
81
- return val && {}.toString.call(val) === "[object Function]";
82
- }
83
- function isObject(val) {
84
- return val && {}.toString.call(val) === "[object Object]";
85
- }
86
- })), require_store_engine = /* @__PURE__ */ __commonJSMin(((exports, module) => {
87
- var util = require_util(), slice = util.slice, pluck = util.pluck, each = util.each, bind = util.bind, create = util.create, isList = util.isList, isFunction = util.isFunction, isObject = util.isObject;
88
- module.exports = { createStore };
89
- var storeAPI = {
90
- version: "2.0.12",
91
- enabled: !1,
92
- get: function(key, optionalDefaultValue) {
93
- var data = this.storage.read(this._namespacePrefix + key);
94
- return this._deserialize(data, optionalDefaultValue);
95
- },
96
- set: function(key, value) {
97
- return value === void 0 ? this.remove(key) : (this.storage.write(this._namespacePrefix + key, this._serialize(value)), value);
98
- },
99
- remove: function(key) {
100
- this.storage.remove(this._namespacePrefix + key);
101
- },
102
- each: function(callback) {
103
- var self = this;
104
- this.storage.each(function(val, namespacedKey) {
105
- callback.call(self, self._deserialize(val), (namespacedKey || "").replace(self._namespaceRegexp, ""));
106
- });
107
- },
108
- clearAll: function() {
109
- this.storage.clearAll();
110
- },
111
- hasNamespace: function(namespace) {
112
- return this._namespacePrefix == "__storejs_" + namespace + "_";
113
- },
114
- createStore: function() {
115
- return createStore.apply(this, arguments);
116
- },
117
- addPlugin: function(plugin) {
118
- this._addPlugin(plugin);
119
- },
120
- namespace: function(namespace) {
121
- return createStore(this.storage, this.plugins, namespace);
122
- }
123
- };
124
- function _warn() {
125
- var _console = typeof console > "u" ? null : console;
126
- _console && (_console.warn ? _console.warn : _console.log).apply(_console, arguments);
127
- }
128
- function createStore(storages, plugins, namespace) {
129
- namespace ||= "", storages && !isList(storages) && (storages = [storages]), plugins && !isList(plugins) && (plugins = [plugins]);
130
- var namespacePrefix = namespace ? "__storejs_" + namespace + "_" : "", namespaceRegexp = namespace ? /* @__PURE__ */ RegExp("^" + namespacePrefix) : null;
131
- if (!/^[a-zA-Z0-9_\-]*$/.test(namespace)) throw Error("store.js namespaces can only have alphanumerics + underscores and dashes");
132
- var store$1 = create({
133
- _namespacePrefix: namespacePrefix,
134
- _namespaceRegexp: namespaceRegexp,
135
- _testStorage: function(storage) {
136
- try {
137
- var testStr = "__storejs__test__";
138
- storage.write(testStr, testStr);
139
- var ok = storage.read(testStr) === testStr;
140
- return storage.remove(testStr), ok;
141
- } catch {
142
- return !1;
143
- }
144
- },
145
- _assignPluginFnProp: function(pluginFnProp, propName) {
146
- var oldFn = this[propName];
147
- this[propName] = function() {
148
- var args = slice(arguments, 0), self = this;
149
- function super_fn() {
150
- if (oldFn) return each(arguments, function(arg, i) {
151
- args[i] = arg;
152
- }), oldFn.apply(self, args);
153
- }
154
- var newFnArgs = [super_fn].concat(args);
155
- return pluginFnProp.apply(self, newFnArgs);
156
- };
157
- },
158
- _serialize: function(obj) {
159
- return JSON.stringify(obj);
160
- },
161
- _deserialize: function(strVal, defaultVal) {
162
- if (!strVal) return defaultVal;
163
- var val = "";
164
- try {
165
- val = JSON.parse(strVal);
166
- } catch {
167
- val = strVal;
168
- }
169
- return val === void 0 ? defaultVal : val;
170
- },
171
- _addStorage: function(storage) {
172
- this.enabled || this._testStorage(storage) && (this.storage = storage, this.enabled = !0);
173
- },
174
- _addPlugin: function(plugin) {
175
- var self = this;
176
- if (isList(plugin)) {
177
- each(plugin, function(plugin$1) {
178
- self._addPlugin(plugin$1);
179
- });
180
- return;
181
- }
182
- if (!pluck(this.plugins, function(seenPlugin) {
183
- return plugin === seenPlugin;
184
- })) {
185
- if (this.plugins.push(plugin), !isFunction(plugin)) throw Error("Plugins must be function values that return objects");
186
- var pluginProperties = plugin.call(this);
187
- if (!isObject(pluginProperties)) throw Error("Plugins must return an object of function properties");
188
- each(pluginProperties, function(pluginFnProp, propName) {
189
- if (!isFunction(pluginFnProp)) throw Error("Bad plugin property: " + propName + " from plugin " + plugin.name + ". Plugins should only return functions.");
190
- self._assignPluginFnProp(pluginFnProp, propName);
191
- });
192
- }
193
- },
194
- addStorage: function(storage) {
195
- _warn("store.addStorage(storage) is deprecated. Use createStore([storages])"), this._addStorage(storage);
196
- }
197
- }, storeAPI, { plugins: [] });
198
- return store$1.raw = {}, each(store$1, function(prop, propName) {
199
- isFunction(prop) && (store$1.raw[propName] = bind(store$1, prop));
200
- }), each(storages, function(storage) {
201
- store$1._addStorage(storage);
202
- }), each(plugins, function(plugin) {
203
- store$1._addPlugin(plugin);
204
- }), store$1;
205
- }
206
- })), require_localStorage = /* @__PURE__ */ __commonJSMin(((exports, module) => {
207
- var Global = require_util().Global;
208
- module.exports = {
209
- name: "localStorage",
210
- read,
211
- write,
212
- each,
213
- remove,
214
- clearAll
215
- };
216
- function localStorage() {
217
- return Global.localStorage;
218
- }
219
- function read(key) {
220
- return localStorage().getItem(key);
221
- }
222
- function write(key, data) {
223
- return localStorage().setItem(key, data);
224
- }
225
- function each(fn) {
226
- for (var i = localStorage().length - 1; i >= 0; i--) {
227
- var key = localStorage().key(i);
228
- fn(read(key), key);
229
- }
230
- }
231
- function remove(key) {
232
- return localStorage().removeItem(key);
233
- }
234
- function clearAll() {
235
- return localStorage().clear();
236
- }
237
- })), require_oldFF_globalStorage = /* @__PURE__ */ __commonJSMin(((exports, module) => {
238
- var Global = require_util().Global;
239
- module.exports = {
240
- name: "oldFF-globalStorage",
241
- read,
242
- write,
243
- each,
244
- remove,
245
- clearAll
246
- };
247
- var globalStorage = Global.globalStorage;
248
- function read(key) {
249
- return globalStorage[key];
250
- }
251
- function write(key, data) {
252
- globalStorage[key] = data;
253
- }
254
- function each(fn) {
255
- for (var i = globalStorage.length - 1; i >= 0; i--) {
256
- var key = globalStorage.key(i);
257
- fn(globalStorage[key], key);
258
- }
259
- }
260
- function remove(key) {
261
- return globalStorage.removeItem(key);
262
- }
263
- function clearAll() {
264
- each(function(key, _) {
265
- delete globalStorage[key];
266
- });
267
- }
268
- })), require_oldIE_userDataStorage = /* @__PURE__ */ __commonJSMin(((exports, module) => {
269
- var Global = require_util().Global;
270
- module.exports = {
271
- name: "oldIE-userDataStorage",
272
- write,
273
- read,
274
- each,
275
- remove,
276
- clearAll
277
- };
278
- var storageName = "storejs", doc = Global.document, _withStorageEl = _makeIEStorageElFunction(), disable = (Global.navigator ? Global.navigator.userAgent : "").match(/ (MSIE 8|MSIE 9|MSIE 10)\./);
279
- function write(unfixedKey, data) {
280
- if (!disable) {
281
- var fixedKey = fixKey(unfixedKey);
282
- _withStorageEl(function(storageEl) {
283
- storageEl.setAttribute(fixedKey, data), storageEl.save(storageName);
284
- });
285
- }
286
- }
287
- function read(unfixedKey) {
288
- if (!disable) {
289
- var fixedKey = fixKey(unfixedKey), res = null;
290
- return _withStorageEl(function(storageEl) {
291
- res = storageEl.getAttribute(fixedKey);
292
- }), res;
293
- }
294
- }
295
- function each(callback) {
296
- _withStorageEl(function(storageEl) {
297
- for (var attributes = storageEl.XMLDocument.documentElement.attributes, i = attributes.length - 1; i >= 0; i--) {
298
- var attr = attributes[i];
299
- callback(storageEl.getAttribute(attr.name), attr.name);
300
- }
301
- });
302
- }
303
- function remove(unfixedKey) {
304
- var fixedKey = fixKey(unfixedKey);
305
- _withStorageEl(function(storageEl) {
306
- storageEl.removeAttribute(fixedKey), storageEl.save(storageName);
307
- });
308
- }
309
- function clearAll() {
310
- _withStorageEl(function(storageEl) {
311
- var attributes = storageEl.XMLDocument.documentElement.attributes;
312
- storageEl.load(storageName);
313
- for (var i = attributes.length - 1; i >= 0; i--) storageEl.removeAttribute(attributes[i].name);
314
- storageEl.save(storageName);
315
- });
316
- }
317
- var forbiddenCharsRegex = RegExp("[!\"#$%&'()*+,/\\\\:;<=>?@[\\]^`{|}~]", "g");
318
- function fixKey(key) {
319
- return key.replace(/^\d/, "___$&").replace(forbiddenCharsRegex, "___");
320
- }
321
- function _makeIEStorageElFunction() {
322
- if (!doc || !doc.documentElement || !doc.documentElement.addBehavior) return null;
323
- var scriptTag = "script", storageOwner, storageContainer, storageEl;
324
- try {
325
- storageContainer = new ActiveXObject("htmlfile"), storageContainer.open(), storageContainer.write("<" + scriptTag + ">document.w=window</" + scriptTag + "><iframe src=\"/favicon.ico\"></iframe>"), storageContainer.close(), storageOwner = storageContainer.w.frames[0].document, storageEl = storageOwner.createElement("div");
1
+ import { l as e, s as t, t as n, u as r } from "./CmnLib.js";
2
+ import { t as i } from "./SysBase.js";
3
+ import { t as a } from "./Layer.js";
4
+ //#region src/sn/localStore.ts
5
+ var o = {
6
+ get(e) {
7
+ let t = localStorage.getItem(e);
8
+ if (t != null) try {
9
+ return JSON.parse(t);
326
10
  } catch {
327
- storageEl = doc.createElement("div"), storageOwner = doc.body;
328
- }
329
- return function(storeFunction) {
330
- var args = [].slice.call(arguments, 0);
331
- args.unshift(storageEl), storageOwner.appendChild(storageEl), storageEl.addBehavior("#default#userData"), storageEl.load(storageName), storeFunction.apply(this, args), storageOwner.removeChild(storageEl);
332
- };
333
- }
334
- })), require_cookieStorage = /* @__PURE__ */ __commonJSMin(((exports, module) => {
335
- var util = require_util(), Global = util.Global, trim = util.trim;
336
- module.exports = {
337
- name: "cookieStorage",
338
- read,
339
- write,
340
- each,
341
- remove,
342
- clearAll
343
- };
344
- var doc = Global.document;
345
- function read(key) {
346
- if (!key || !_has(key)) return null;
347
- var regexpStr = "(?:^|.*;\\s*)" + escape(key).replace(/[\-\.\+\*]/g, "\\$&") + "\\s*\\=\\s*((?:[^;](?!;))*[^;]?).*";
348
- return unescape(doc.cookie.replace(new RegExp(regexpStr), "$1"));
349
- }
350
- function each(callback) {
351
- for (var cookies = doc.cookie.split(/; ?/g), i = cookies.length - 1; i >= 0; i--) if (trim(cookies[i])) {
352
- var kvp = cookies[i].split("="), key = unescape(kvp[0]);
353
- callback(unescape(kvp[1]), key);
354
- }
355
- }
356
- function write(key, data) {
357
- key && (doc.cookie = escape(key) + "=" + escape(data) + "; expires=Tue, 19 Jan 2038 03:14:07 GMT; path=/");
358
- }
359
- function remove(key) {
360
- !key || !_has(key) || (doc.cookie = escape(key) + "=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/");
361
- }
362
- function clearAll() {
363
- each(function(_, key) {
364
- remove(key);
365
- });
366
- }
367
- function _has(key) {
368
- return (/* @__PURE__ */ RegExp("(?:^|;\\s*)" + escape(key).replace(/[\-\.\+\*]/g, "\\$&") + "\\s*\\=")).test(doc.cookie);
369
- }
370
- })), require_sessionStorage = /* @__PURE__ */ __commonJSMin(((exports, module) => {
371
- var Global = require_util().Global;
372
- module.exports = {
373
- name: "sessionStorage",
374
- read,
375
- write,
376
- each,
377
- remove,
378
- clearAll
379
- };
380
- function sessionStorage() {
381
- return Global.sessionStorage;
382
- }
383
- function read(key) {
384
- return sessionStorage().getItem(key);
385
- }
386
- function write(key, data) {
387
- return sessionStorage().setItem(key, data);
388
- }
389
- function each(fn) {
390
- for (var i = sessionStorage().length - 1; i >= 0; i--) {
391
- var key = sessionStorage().key(i);
392
- fn(read(key), key);
393
- }
394
- }
395
- function remove(key) {
396
- return sessionStorage().removeItem(key);
397
- }
398
- function clearAll() {
399
- return sessionStorage().clear();
400
- }
401
- })), require_memoryStorage = /* @__PURE__ */ __commonJSMin(((exports, module) => {
402
- module.exports = {
403
- name: "memoryStorage",
404
- read,
405
- write,
406
- each,
407
- remove,
408
- clearAll
409
- };
410
- var memoryStorage = {};
411
- function read(key) {
412
- return memoryStorage[key];
413
- }
414
- function write(key, data) {
415
- memoryStorage[key] = data;
416
- }
417
- function each(callback) {
418
- for (var key in memoryStorage) memoryStorage.hasOwnProperty(key) && callback(memoryStorage[key], key);
419
- }
420
- function remove(key) {
421
- delete memoryStorage[key];
422
- }
423
- function clearAll(key) {
424
- memoryStorage = {};
425
- }
426
- })), require_all = /* @__PURE__ */ __commonJSMin(((exports, module) => {
427
- module.exports = [
428
- require_localStorage(),
429
- require_oldFF_globalStorage(),
430
- require_oldIE_userDataStorage(),
431
- require_cookieStorage(),
432
- require_sessionStorage(),
433
- require_memoryStorage()
434
- ];
435
- })), require_json2$1 = /* @__PURE__ */ __commonJSMin((() => {
436
- typeof JSON != "object" && (JSON = {}), (function() {
437
- var rx_one = /^[\],:{}\s]*$/, rx_two = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, rx_three = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, rx_four = /(?:^|:|,)(?:\s*\[)+/g, rx_escapable = /[\\"\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, rx_dangerous = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;
438
- function f(n) {
439
- return n < 10 ? "0" + n : n;
440
- }
441
- function this_value() {
442
- return this.valueOf();
443
- }
444
- typeof Date.prototype.toJSON != "function" && (Date.prototype.toJSON = function() {
445
- return isFinite(this.valueOf()) ? this.getUTCFullYear() + "-" + f(this.getUTCMonth() + 1) + "-" + f(this.getUTCDate()) + "T" + f(this.getUTCHours()) + ":" + f(this.getUTCMinutes()) + ":" + f(this.getUTCSeconds()) + "Z" : null;
446
- }, Boolean.prototype.toJSON = this_value, Number.prototype.toJSON = this_value, String.prototype.toJSON = this_value);
447
- var gap, indent, meta, rep;
448
- function quote(string) {
449
- return rx_escapable.lastIndex = 0, rx_escapable.test(string) ? "\"" + string.replace(rx_escapable, function(a) {
450
- var c = meta[a];
451
- return typeof c == "string" ? c : "\\u" + ("0000" + a.charCodeAt(0).toString(16)).slice(-4);
452
- }) + "\"" : "\"" + string + "\"";
453
- }
454
- function str(key, holder) {
455
- var i, k, v, length, mind = gap, partial, value = holder[key];
456
- switch (value && typeof value == "object" && typeof value.toJSON == "function" && (value = value.toJSON(key)), typeof rep == "function" && (value = rep.call(holder, key, value)), typeof value) {
457
- case "string": return quote(value);
458
- case "number": return isFinite(value) ? String(value) : "null";
459
- case "boolean":
460
- case "null": return String(value);
461
- case "object":
462
- if (!value) return "null";
463
- if (gap += indent, partial = [], Object.prototype.toString.apply(value) === "[object Array]") {
464
- for (length = value.length, i = 0; i < length; i += 1) partial[i] = str(i, value) || "null";
465
- return v = partial.length === 0 ? "[]" : gap ? "[\n" + gap + partial.join(",\n" + gap) + "\n" + mind + "]" : "[" + partial.join(",") + "]", gap = mind, v;
466
- }
467
- if (rep && typeof rep == "object") for (length = rep.length, i = 0; i < length; i += 1) typeof rep[i] == "string" && (k = rep[i], v = str(k, value), v && partial.push(quote(k) + (gap ? ": " : ":") + v));
468
- else for (k in value) Object.prototype.hasOwnProperty.call(value, k) && (v = str(k, value), v && partial.push(quote(k) + (gap ? ": " : ":") + v));
469
- return v = partial.length === 0 ? "{}" : gap ? "{\n" + gap + partial.join(",\n" + gap) + "\n" + mind + "}" : "{" + partial.join(",") + "}", gap = mind, v;
470
- }
11
+ return;
471
12
  }
472
- typeof JSON.stringify != "function" && (meta = {
473
- "\b": "\\b",
474
- " ": "\\t",
475
- "\n": "\\n",
476
- "\f": "\\f",
477
- "\r": "\\r",
478
- "\"": "\\\"",
479
- "\\": "\\\\"
480
- }, JSON.stringify = function(value, replacer, space) {
481
- var i;
482
- if (gap = "", indent = "", typeof space == "number") for (i = 0; i < space; i += 1) indent += " ";
483
- else typeof space == "string" && (indent = space);
484
- if (rep = replacer, replacer && typeof replacer != "function" && (typeof replacer != "object" || typeof replacer.length != "number")) throw Error("JSON.stringify");
485
- return str("", { "": value });
486
- }), typeof JSON.parse != "function" && (JSON.parse = function(text, reviver) {
487
- var j;
488
- function walk(holder, key) {
489
- var k, v, value = holder[key];
490
- if (value && typeof value == "object") for (k in value) Object.prototype.hasOwnProperty.call(value, k) && (v = walk(value, k), v === void 0 ? delete value[k] : value[k] = v);
491
- return reviver.call(holder, key, value);
492
- }
493
- if (text = String(text), rx_dangerous.lastIndex = 0, rx_dangerous.test(text) && (text = text.replace(rx_dangerous, function(a) {
494
- return "\\u" + ("0000" + a.charCodeAt(0).toString(16)).slice(-4);
495
- })), rx_one.test(text.replace(rx_two, "@").replace(rx_three, "]").replace(rx_four, ""))) return j = eval("(" + text + ")"), typeof reviver == "function" ? walk({ "": j }, "") : j;
496
- throw SyntaxError("JSON.parse");
497
- });
498
- })();
499
- })), require_json2 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
500
- module.exports = json2Plugin;
501
- function json2Plugin() {
502
- return require_json2$1(), {};
13
+ },
14
+ set(e, t) {
15
+ localStorage.setItem(e, JSON.stringify(t));
16
+ },
17
+ remove(e) {
18
+ localStorage.removeItem(e);
503
19
  }
504
- })), require_store_legacy = /* @__PURE__ */ __commonJSMin(((exports, module) => {
505
- var engine = require_store_engine(), storages = require_all(), plugins = [require_json2()];
506
- module.exports = engine.createStore(storages, plugins);
507
- })), import_store_legacy = /* @__PURE__ */ __toESM(require_store_legacy()), devtools = {
20
+ }, s = {
508
21
  isOpen: !1,
509
22
  orientation: void 0
510
- }, threshold = 170, emitEvent = (isOpen, orientation) => {
23
+ }, c = 170, l = (e, t) => {
511
24
  globalThis.dispatchEvent(new globalThis.CustomEvent("devtoolschange", { detail: {
512
- isOpen,
513
- orientation
25
+ isOpen: e,
26
+ orientation: t
514
27
  } }));
515
- }, main = ({ emitEvents = !0 } = {}) => {
516
- let widthThreshold = globalThis.outerWidth - globalThis.innerWidth > threshold, heightThreshold = globalThis.outerHeight - globalThis.innerHeight > threshold, orientation = widthThreshold ? "vertical" : "horizontal";
517
- !(heightThreshold && widthThreshold) && (globalThis.Firebug && globalThis.Firebug.chrome && globalThis.Firebug.chrome.isInitialized || widthThreshold || heightThreshold) ? ((!devtools.isOpen || devtools.orientation !== orientation) && emitEvents && emitEvent(!0, orientation), devtools.isOpen = !0, devtools.orientation = orientation) : (devtools.isOpen && emitEvents && emitEvent(!1, void 0), devtools.isOpen = !1, devtools.orientation = void 0);
28
+ }, u = ({ emitEvents: e = !0 } = {}) => {
29
+ let t = globalThis.outerWidth - globalThis.innerWidth > c, n = globalThis.outerHeight - globalThis.innerHeight > c, r = t ? "vertical" : "horizontal";
30
+ !(n && t) && (globalThis.Firebug && globalThis.Firebug.chrome && globalThis.Firebug.chrome.isInitialized || t || n) ? ((!s.isOpen || s.orientation !== r) && e && l(!0, r), s.isOpen = !0, s.orientation = r) : (s.isOpen && e && l(!1, void 0), s.isOpen = !1, s.orientation = void 0);
518
31
  };
519
- main({ emitEvents: !1 }), setInterval(main, 500);
520
- var SysWeb = class extends SysBase {
32
+ u({ emitEvents: !1 }), setInterval(u, 500);
33
+ //#endregion
34
+ //#region src/sn/SysWeb.ts
35
+ var d = class extends i {
521
36
  #e;
522
- constructor(...[hPlg = {}, arg = {
37
+ constructor(...[e = {}, t = {
523
38
  cur: "prj/",
524
39
  crypto: !1,
525
40
  dip: ""
526
41
  }]) {
527
- super(hPlg, arg);
528
- let a = arg.cur.split("/");
529
- this.#e = a.length > 2 ? a.slice(0, -2).join("/") + "/" : "", this.loaded(hPlg, arg);
530
- }
531
- async loaded(...[hPlg, arg]) {
532
- await super.loaded(hPlg, arg), document.querySelectorAll("[data-prj]").forEach((v) => {
533
- let elm = v.attributes.getNamedItem("data-prj");
534
- elm && v.addEventListener("click", () => {
535
- this.runSN(elm.value);
42
+ super(e, t);
43
+ let n = t.cur.split("/");
44
+ this.#e = n.length > 2 ? n.slice(0, -2).join("/") + "/" : "", this.loaded(e, t);
45
+ }
46
+ async loaded(...[r, i]) {
47
+ await super.loaded(r, i), document.querySelectorAll("[data-prj]").forEach((e) => {
48
+ let t = e.attributes.getNamedItem("data-prj");
49
+ t && e.addEventListener("click", () => {
50
+ this.runSN(t.value);
536
51
  }, { passive: !0 });
537
- }), document.querySelectorAll("[data-reload]").forEach((v) => v.addEventListener("click", () => {
52
+ }), document.querySelectorAll("[data-reload]").forEach((e) => e.addEventListener("click", () => {
538
53
  this.run();
539
- }, { passive: !0 })), arg.dip && (CmnLib.hDip = JSON.parse(arg.dip));
540
- let sp = new URLSearchParams(location.search), dip = sp.get("dip");
541
- if (dip && (CmnLib.hDip = {
542
- ...CmnLib.hDip,
543
- ...JSON.parse(dip.replaceAll("%2C", ","))
544
- }), !argChk_Boolean(CmnLib.hDip, "oninit_run", !0)) return;
545
- argChk_Boolean(CmnLib.hDip, "dbg", !1) && (CmnLib.isDbg = !0, this.fetch = (url, init) => fetch(url, {
546
- ...init,
54
+ }, { passive: !0 })), i.dip && (n.hDip = JSON.parse(i.dip));
55
+ let a = new URLSearchParams(location.search), o = a.get("dip");
56
+ if (o && (n.hDip = {
57
+ ...n.hDip,
58
+ ...JSON.parse(o.replaceAll("%2C", ","))
59
+ }), !t(n.hDip, "oninit_run", !0)) return;
60
+ t(n.hDip, "dbg", !1) && (n.isDbg = !0, this.fetch = (e, t) => fetch(e, {
61
+ ...t,
547
62
  mode: "cors"
548
- })), this.extPort = argChk_Num(CmnLib.hDip, "port", this.extPort);
549
- let cur = sp.get("cur");
550
- cur && (arg.cur = this.#e + cur + "/"), await this.run();
63
+ })), this.extPort = e(n.hDip, "port", this.extPort);
64
+ let s = a.get("cur");
65
+ s && (i.cur = this.#e + s + "/"), await this.run();
551
66
  }
552
67
  #t = ":";
553
- async runSN(prj) {
554
- this.arg.cur = this.#e + prj + "/", this.#t !== this.arg.cur && (this.#t = this.arg.cur, await this.run());
68
+ async runSN(e) {
69
+ this.arg.cur = this.#e + e + "/", this.#t !== this.arg.cur && (this.#t = this.arg.cur, await this.run());
555
70
  }
556
- async initVal(hTmp, comp) {
557
- let hn = encodeURIComponent(document.location.hostname);
558
- hTmp["const.sn.isDebugger"] = hn === "localhost" || hn === "127.0.0.1";
559
- let ns = this.cfg.headNs;
71
+ async initVal(e, t) {
72
+ let n = encodeURIComponent(document.location.hostname);
73
+ e["const.sn.isDebugger"] = n === "localhost" || n === "127.0.0.1";
74
+ let r = this.cfg.headNs;
560
75
  this.flushSub = this.arg.crypto ? async () => {
561
- import_store_legacy.default.set(ns + "sys_", await this.enc(JSON.stringify(this.data.sys))), import_store_legacy.default.set(ns + "mark_", await this.enc(JSON.stringify(this.data.mark))), import_store_legacy.default.set(ns + "kidoku_", await this.enc(JSON.stringify(this.data.kidoku)));
76
+ o.set(r + "sys_", await this.enc(JSON.stringify(this.data.sys))), o.set(r + "mark_", await this.enc(JSON.stringify(this.data.mark))), o.set(r + "kidoku_", await this.enc(JSON.stringify(this.data.kidoku)));
562
77
  } : () => {
563
- import_store_legacy.default.set(ns + "sys", this.data.sys), import_store_legacy.default.set(ns + "mark", this.data.mark), import_store_legacy.default.set(ns + "kidoku", this.data.kidoku);
78
+ o.set(r + "sys", this.data.sys), o.set(r + "mark", this.data.mark), o.set(r + "kidoku", this.data.kidoku);
564
79
  };
565
- let nm = ns + (this.arg.crypto ? "sys_" : "sys");
566
- if (hTmp["const.sn.isFirstBoot"] = import_store_legacy.default.get(nm) === void 0) {
567
- this.data.sys = {}, this.data.mark = {}, this.data.kidoku = {}, comp(this.data);
80
+ let i = r + (this.arg.crypto ? "sys_" : "sys");
81
+ if (e["const.sn.isFirstBoot"] = o.get(i) === void 0) {
82
+ this.data.sys = {}, this.data.mark = {}, this.data.kidoku = {}, t(this.data);
568
83
  return;
569
84
  }
570
85
  if (!this.arg.crypto) {
571
- this.data.sys = import_store_legacy.default.get(ns + "sys"), this.data.mark = import_store_legacy.default.get(ns + "mark"), this.data.kidoku = import_store_legacy.default.get(ns + "kidoku"), comp(this.data);
86
+ this.data.sys = o.get(r + "sys"), this.data.mark = o.get(r + "mark"), this.data.kidoku = o.get(r + "kidoku"), t(this.data);
572
87
  return;
573
88
  }
574
- let mes = "";
89
+ let a = "";
575
90
  try {
576
- mes = "sys", this.data.sys = JSON.parse(await this.dec("json", import_store_legacy.default.get(ns + "sys_"))), mes += String(this.val.getVal("sys:TextLayer.Back.Alpha", 1)), mes = "mark", this.data.mark = JSON.parse(await this.dec("json", import_store_legacy.default.get(ns + "mark_"))), mes = "kidoku", this.data.kidoku = JSON.parse(await this.dec("json", import_store_legacy.default.get(ns + "kidoku_")));
91
+ a = "sys", this.data.sys = JSON.parse(await this.dec("json", o.get(r + "sys_"))), a += String(this.val.getVal("sys:TextLayer.Back.Alpha", 1)), a = "mark", this.data.mark = JSON.parse(await this.dec("json", o.get(r + "mark_"))), a = "kidoku", this.data.kidoku = JSON.parse(await this.dec("json", o.get(r + "kidoku_")));
577
92
  } catch (e) {
578
- console.error(`セーブデータ(${mes})が壊れています。一度クリアする必要があります(a) %o`, e);
93
+ console.error(`セーブデータ(${a})が壊れています。一度クリアする必要があります(a) %o`, e);
579
94
  }
580
- comp(this.data);
95
+ t(this.data);
581
96
  }
582
- init(hTag, appPixi, val) {
583
- let aP = super.init(hTag, appPixi, val), pCvs = appPixi.view.parentElement;
584
- if ("requestFullscreen" in document.body) this.tglFlscr_sub = this.isFullScr ? () => document.exitFullscreen() : () => pCvs.requestFullscreen(), this.elc.add(document, "fullscreenchange", () => {
97
+ init(e, t, n) {
98
+ let r = super.init(e, t, n), i = t.view.parentElement;
99
+ if ("requestFullscreen" in document.body) this.tglFlscr_sub = this.isFullScr ? () => document.exitFullscreen() : () => i.requestFullscreen(), this.elc.add(document, "fullscreenchange", () => {
585
100
  this.isFullScr = !!document.fullscreenElement;
586
101
  });
587
102
  else {
588
- let doc = document;
589
- this.tglFlscr_sub = this.isFullScr ? () => doc.webkitCancelFullScreen() : () => pCvs.webkitRequestFullscreen(), this.elc.add(document, "fullscreenchange", () => {
590
- this.isFullScr = !!doc.webkitFullscreenElement;
103
+ let e = document;
104
+ this.tglFlscr_sub = this.isFullScr ? () => e.webkitCancelFullScreen() : () => i.webkitRequestFullscreen(), this.elc.add(document, "fullscreenchange", () => {
105
+ this.isFullScr = !!e.webkitFullscreenElement;
591
106
  });
592
107
  }
593
108
  return this.cfg.oCfg.debug.devtool || this.elc.add(globalThis, "devtoolschange", (e) => {
@@ -595,60 +110,61 @@ var SysWeb = class extends SysBase {
595
110
  }, {
596
111
  once: !0,
597
112
  passive: !0
598
- }), aP;
113
+ }), r;
599
114
  }
600
115
  cvsResize() {
601
116
  if (super.cvsResize(), !this.isFullScr || !this.main) return;
602
- let s = this.main.cvs.style;
603
- s.width = s.height = "";
117
+ let e = this.main.cvs.style;
118
+ e.width = e.height = "";
604
119
  }
605
120
  pathBaseCnvSnPath4Dbg = "${pathbase}/";
606
121
  _export = () => ((async () => {
607
- let s = JSON.stringify({
122
+ let e = JSON.stringify({
608
123
  sys: this.data.sys,
609
124
  mark: this.data.mark,
610
125
  kidoku: this.data.kidoku
611
- }), s2 = this.arg.crypto ? await this.enc(s) : s, blob = new Blob([s2], { type: "text/json" }), a = document.createElement("a");
612
- a.href = URL.createObjectURL(blob), a.download = (this.arg.crypto ? "" : "no_crypto_") + this.cfg.headNs + getDateStr("-", "_", "") + ".swpd", a.click(), CmnLib.debugLog && console.log("プレイデータをエクスポートしました"), setTimeout(() => this.fire("sn:exported", new MouseEvent("click")), 10);
126
+ }), t = this.arg.crypto ? await this.enc(e) : e, i = new Blob([t], { type: "text/json" }), a = document.createElement("a");
127
+ a.href = URL.createObjectURL(i), a.download = (this.arg.crypto ? "" : "no_crypto_") + this.cfg.headNs + r("-", "_", "") + ".swpd", a.click(), n.debugLog && console.log("プレイデータをエクスポートしました"), setTimeout(() => this.fire("sn:exported", new MouseEvent("click")), 10);
613
128
  })(), !1);
614
- _import = () => (new Promise((rs, rj) => {
615
- let inp = document.createElement("input");
616
- inp.type = "file", inp.accept = ".swpd, text/plain", inp.onchange = () => {
617
- let f = inp.files?.[0];
618
- f ? rs(f) : rj(/* @__PURE__ */ Error("ファイル選択に失敗しました"));
619
- }, inp.click();
620
- }).then(async (blob) => {
621
- let s = await blob.text(), o = JSON.parse(this.arg.crypto ? await this.dec("json", s) : s);
622
- if (o.sys["const.sn.cfg.ns"] !== this.cfg.oCfg.save_ns) {
623
- console.error(`別のゲーム【プロジェクト名=${o.sys["const.sn.cfg.ns"]}】のプレイデータです`);
129
+ _import = () => (new Promise((e, t) => {
130
+ let n = document.createElement("input");
131
+ n.type = "file", n.accept = ".swpd, text/plain", n.onchange = () => {
132
+ let r = n.files?.[0];
133
+ r ? e(r) : t(/* @__PURE__ */ Error("ファイル選択に失敗しました"));
134
+ }, n.click();
135
+ }).then(async (e) => {
136
+ let t = await e.text(), r = JSON.parse(this.arg.crypto ? await this.dec("json", t) : t);
137
+ if (r.sys["const.sn.cfg.ns"] !== this.cfg.oCfg.save_ns) {
138
+ console.error(`別のゲーム【プロジェクト名=${r.sys["const.sn.cfg.ns"]}】のプレイデータです`);
624
139
  return;
625
140
  }
626
- this.data.sys = o.sys, this.data.mark = o.mark, this.data.kidoku = o.kidoku, this.flush(), this.val.updateData(o), CmnLib.debugLog && console.log("プレイデータをインポートしました"), this.fire("sn:imported", new MouseEvent("click"));
141
+ this.data.sys = r.sys, this.data.mark = r.mark, this.data.kidoku = r.kidoku, this.flush(), this.val.updateData(r), n.debugLog && console.log("プレイデータをインポートしました"), this.fire("sn:imported", new MouseEvent("click"));
627
142
  }).catch((e) => console.error(`異常なプレイデータです ${String(e)}`)), !1);
628
- navigate_to = (hArg) => {
629
- let { url } = hArg;
630
- if (!url) throw "[navigate_to] urlは必須です";
631
- return globalThis.open(url, "_blank"), !1;
143
+ navigate_to = (e) => {
144
+ let { url: t } = e;
145
+ if (!t) throw "[navigate_to] urlは必須です";
146
+ return globalThis.open(t, "_blank"), !1;
632
147
  };
633
- titleSub(txt) {
634
- document.title = txt, document.querySelectorAll("[data-title]").forEach((v) => {
635
- v.textContent = txt;
148
+ titleSub(e) {
149
+ document.title = e, document.querySelectorAll("[data-title]").forEach((t) => {
150
+ t.textContent = e;
636
151
  });
637
152
  }
638
- async savePic(path, data_url) {
639
- let a = document.createElement("a");
640
- a.href = data_url, a.download = path, a.click(), CmnLib.debugLog && console.log("画像ファイルをダウンロードします");
153
+ async savePic(e, t) {
154
+ let r = document.createElement("a");
155
+ r.href = t, r.download = e, r.click(), n.debugLog && console.log("画像ファイルをダウンロードします");
641
156
  }
642
157
  #n = {};
643
- async appendFile(path, data) {
644
- let txt = (this.#n[path] ?? "") + data;
645
- this.#n[path] = txt, await this.outputFile(path, txt);
158
+ async appendFile(e, t) {
159
+ let n = (this.#n[e] ?? "") + t;
160
+ this.#n[e] = n, await this.outputFile(e, n);
646
161
  }
647
- async outputFile(path, data) {
648
- let blob = new Blob([data], { type: "text/json" }), a = document.createElement("a");
649
- a.href = URL.createObjectURL(blob), a.download = path, a.click();
162
+ async outputFile(e, t) {
163
+ let n = new Blob([t], { type: "text/json" }), r = document.createElement("a");
164
+ r.href = URL.createObjectURL(n), r.download = e, r.click();
650
165
  }
651
166
  };
652
- export { CmnLib, Layer, SysWeb, argChk_Boolean, argChk_Num };
167
+ //#endregion
168
+ export { n as CmnLib, a as Layer, d as SysWeb, t as argChk_Boolean, e as argChk_Num };
653
169
 
654
170
  //# sourceMappingURL=web.js.map