@rpgjs/client 5.0.0-alpha.10 → 5.0.0-alpha.11
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/Game/Map.d.ts +4 -0
- package/dist/Gui/Gui.d.ts +82 -5
- package/dist/RpgClient.d.ts +35 -5
- package/dist/RpgClientEngine.d.ts +3 -0
- package/dist/components/gui/index.d.ts +3 -3
- package/dist/index.d.ts +1 -0
- package/dist/index.js +6 -5
- package/dist/index.js.map +1 -1
- package/dist/index10.js +105 -4
- package/dist/index10.js.map +1 -1
- package/dist/index11.js +20 -7
- package/dist/index11.js.map +1 -1
- package/dist/index12.js +6 -8
- package/dist/index12.js.map +1 -1
- package/dist/index13.js +9 -14
- package/dist/index13.js.map +1 -1
- package/dist/index14.js +8 -100
- package/dist/index14.js.map +1 -1
- package/dist/index15.js +141 -35
- package/dist/index15.js.map +1 -1
- package/dist/index16.js +45 -186
- package/dist/index16.js.map +1 -1
- package/dist/index17.js +229 -5
- package/dist/index17.js.map +1 -1
- package/dist/index18.js +5 -383
- package/dist/index18.js.map +1 -1
- package/dist/index19.js +384 -28
- package/dist/index19.js.map +1 -1
- package/dist/index2.js +15 -8
- package/dist/index2.js.map +1 -1
- package/dist/index20.js +31 -17
- package/dist/index20.js.map +1 -1
- package/dist/index21.js +17 -2413
- package/dist/index21.js.map +1 -1
- package/dist/index22.js +2587 -88
- package/dist/index22.js.map +1 -1
- package/dist/index23.js +108 -103
- package/dist/index23.js.map +1 -1
- package/dist/index29.js.map +1 -1
- package/dist/index3.js +2 -2
- package/dist/index30.js +14 -1
- package/dist/index30.js.map +1 -1
- package/dist/index37.js +56 -169
- package/dist/index37.js.map +1 -1
- package/dist/index38.js +162 -489
- package/dist/index38.js.map +1 -1
- package/dist/index39.js +496 -56
- package/dist/index39.js.map +1 -1
- package/dist/index4.js +2 -2
- package/dist/index41.js +21 -7
- package/dist/index41.js.map +1 -1
- package/dist/index5.js +1 -1
- package/dist/index6.js +1 -1
- package/dist/index7.js +1 -1
- package/dist/index8.js +1 -1
- package/dist/index9.js +105 -14
- package/dist/index9.js.map +1 -1
- package/dist/services/mmorpg.d.ts +1 -1
- package/dist/services/standalone.d.ts +1 -1
- package/package.json +7 -5
- package/src/Game/AnimationManager.ts +1 -0
- package/src/Game/Map.ts +9 -1
- package/src/Game/Object.ts +28 -6
- package/src/Gui/Gui.ts +141 -16
- package/src/RpgClient.ts +36 -5
- package/src/RpgClientEngine.ts +11 -1
- package/src/components/character.ce +11 -9
- package/src/components/gui/box.ce +17 -0
- package/src/components/gui/dialogbox/index.ce +1 -0
- package/src/components/gui/index.ts +3 -4
- package/src/components/scenes/event-layer.ce +6 -0
- package/src/index.ts +2 -1
package/dist/index37.js
CHANGED
|
@@ -1,174 +1,61 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useProps, useDefineProps, mount, signal, h, Container, loop, computed } from 'canvasengine';
|
|
2
|
+
import component$1 from './index40.js';
|
|
3
|
+
import { RpgClientEngine } from './index2.js';
|
|
4
|
+
import { inject } from './index6.js';
|
|
2
5
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
(typeof performance !== "undefined" &&
|
|
13
|
-
performance.now &&
|
|
14
|
-
performance.now() * 1e3) ||
|
|
15
|
-
0;
|
|
16
|
-
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function (c) {
|
|
17
|
-
let r = Math.random() * 16;
|
|
18
|
-
if (d > 0) {
|
|
19
|
-
r = (d + r) % 16 | 0;
|
|
20
|
-
d = Math.floor(d / 16);
|
|
21
|
-
} else {
|
|
22
|
-
r = (d2 + r) % 16 | 0;
|
|
23
|
-
d2 = Math.floor(d2 / 16);
|
|
24
|
-
}
|
|
25
|
-
return (c === "x" ? r : (r & 3) | 8).toString(16);
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
function getPartyInfo(partySocketOptions, defaultProtocol, defaultParams = {}) {
|
|
29
|
-
const {
|
|
30
|
-
host: rawHost,
|
|
31
|
-
path: rawPath,
|
|
32
|
-
protocol: rawProtocol,
|
|
33
|
-
room,
|
|
34
|
-
party,
|
|
35
|
-
basePath,
|
|
36
|
-
prefix,
|
|
37
|
-
query
|
|
38
|
-
} = partySocketOptions;
|
|
39
|
-
let host = rawHost.replace(/^(http|https|ws|wss):\/\//, "");
|
|
40
|
-
if (host.endsWith("/")) {
|
|
41
|
-
host = host.slice(0, -1);
|
|
42
|
-
}
|
|
43
|
-
if (rawPath == null ? void 0 : rawPath.startsWith("/")) {
|
|
44
|
-
throw new Error("path must not start with a slash");
|
|
45
|
-
}
|
|
46
|
-
const name = party ?? "main";
|
|
47
|
-
const path = rawPath ? `/${rawPath}` : "";
|
|
48
|
-
const protocol =
|
|
49
|
-
rawProtocol ||
|
|
50
|
-
(host.startsWith("localhost:") ||
|
|
51
|
-
host.startsWith("127.0.0.1:") ||
|
|
52
|
-
host.startsWith("192.168.") ||
|
|
53
|
-
host.startsWith("10.") ||
|
|
54
|
-
(host.startsWith("172.") &&
|
|
55
|
-
host.split(".")[1] >= "16" &&
|
|
56
|
-
host.split(".")[1] <= "31") ||
|
|
57
|
-
host.startsWith("[::ffff:7f00:1]:")
|
|
58
|
-
? // http / ws
|
|
59
|
-
defaultProtocol
|
|
60
|
-
: // https / wss
|
|
61
|
-
`${defaultProtocol}s`);
|
|
62
|
-
const baseUrl = `${protocol}://${host}/${basePath || `${prefix || "parties"}/${name}/${room}`}${path}`;
|
|
63
|
-
const makeUrl = (query2 = {}) =>
|
|
64
|
-
`${baseUrl}?${new URLSearchParams([
|
|
65
|
-
...Object.entries(defaultParams),
|
|
66
|
-
...Object.entries(query2).filter(valueIsNotNil)
|
|
67
|
-
])}`;
|
|
68
|
-
const urlProvider =
|
|
69
|
-
typeof query === "function"
|
|
70
|
-
? async () => makeUrl(await query())
|
|
71
|
-
: makeUrl(query);
|
|
72
|
-
return {
|
|
73
|
-
host,
|
|
74
|
-
path,
|
|
75
|
-
room,
|
|
76
|
-
name,
|
|
77
|
-
protocol,
|
|
78
|
-
partyUrl: baseUrl,
|
|
79
|
-
urlProvider
|
|
80
|
-
};
|
|
81
|
-
}
|
|
82
|
-
var PartySocket = class extends ReconnectingWebSocket {
|
|
83
|
-
constructor(partySocketOptions) {
|
|
84
|
-
const wsOptions = getWSOptions(partySocketOptions);
|
|
85
|
-
super(wsOptions.urlProvider, wsOptions.protocols, wsOptions.socketOptions);
|
|
86
|
-
this.partySocketOptions = partySocketOptions;
|
|
87
|
-
this.setWSProperties(wsOptions);
|
|
88
|
-
}
|
|
89
|
-
_pk;
|
|
90
|
-
_pkurl;
|
|
91
|
-
name;
|
|
92
|
-
room;
|
|
93
|
-
host;
|
|
94
|
-
path;
|
|
95
|
-
updateProperties(partySocketOptions) {
|
|
96
|
-
const wsOptions = getWSOptions({
|
|
97
|
-
...this.partySocketOptions,
|
|
98
|
-
...partySocketOptions,
|
|
99
|
-
host: partySocketOptions.host ?? this.host,
|
|
100
|
-
room: partySocketOptions.room ?? this.room,
|
|
101
|
-
path: partySocketOptions.path ?? this.path
|
|
6
|
+
function component($$props) {
|
|
7
|
+
useProps($$props);
|
|
8
|
+
const defineProps = useDefineProps($$props);
|
|
9
|
+
var _a = defineProps(), items = _a.items, wrapAround = _a.wrapAround, onSelect = _a.onSelect, selectedIndex = _a.selectedIndex;
|
|
10
|
+
var client = inject(RpgClientEngine);
|
|
11
|
+
var keyboardControls = client.globalConfig.keyboardControls;
|
|
12
|
+
var selected = function (index) {
|
|
13
|
+
return computed(function () {
|
|
14
|
+
return index === selectedIndex();
|
|
102
15
|
});
|
|
103
|
-
this._url = wsOptions.urlProvider;
|
|
104
|
-
this._protocols = wsOptions.protocols;
|
|
105
|
-
this._options = wsOptions.socketOptions;
|
|
106
|
-
this.setWSProperties(wsOptions);
|
|
107
|
-
}
|
|
108
|
-
setWSProperties(wsOptions) {
|
|
109
|
-
const { _pk, _pkurl, name, room, host, path } = wsOptions;
|
|
110
|
-
this._pk = _pk;
|
|
111
|
-
this._pkurl = _pkurl;
|
|
112
|
-
this.name = name;
|
|
113
|
-
this.room = room;
|
|
114
|
-
this.host = host;
|
|
115
|
-
this.path = path;
|
|
116
|
-
}
|
|
117
|
-
reconnect(code, reason) {
|
|
118
|
-
if (!this.room || !this.host) {
|
|
119
|
-
throw new Error(
|
|
120
|
-
"The room and host must be set before connecting, use `updateProperties` method to set them or pass them to the constructor."
|
|
121
|
-
);
|
|
122
|
-
}
|
|
123
|
-
super.reconnect(code, reason);
|
|
124
|
-
}
|
|
125
|
-
get id() {
|
|
126
|
-
return this._pk;
|
|
127
|
-
}
|
|
128
|
-
/**
|
|
129
|
-
* Exposes the static PartyKit room URL without applying query parameters.
|
|
130
|
-
* To access the currently connected WebSocket url, use PartySocket#url.
|
|
131
|
-
*/
|
|
132
|
-
get roomUrl() {
|
|
133
|
-
return this._pkurl;
|
|
134
|
-
}
|
|
135
|
-
// a `fetch` method that uses (almost) the same options as `PartySocket`
|
|
136
|
-
static async fetch(options, init) {
|
|
137
|
-
const party = getPartyInfo(options, "http");
|
|
138
|
-
const url =
|
|
139
|
-
typeof party.urlProvider === "string"
|
|
140
|
-
? party.urlProvider
|
|
141
|
-
: await party.urlProvider();
|
|
142
|
-
const doFetch = options.fetch ?? fetch;
|
|
143
|
-
return doFetch(url, init);
|
|
144
|
-
}
|
|
145
16
|
};
|
|
146
|
-
function
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
}
|
|
17
|
+
mount(function (element) {
|
|
18
|
+
return function () {
|
|
19
|
+
element.directives.controls.onDestroy();
|
|
20
|
+
};
|
|
21
|
+
});
|
|
22
|
+
var controls = signal({
|
|
23
|
+
down: {
|
|
24
|
+
bind: keyboardControls.down,
|
|
25
|
+
keyDown: function () {
|
|
26
|
+
selectedIndex.update(function (currentIndex) {
|
|
27
|
+
if (wrapAround) {
|
|
28
|
+
return (currentIndex + 1) % items().length;
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
return Math.min(currentIndex + 1, items().length - 1);
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
up: {
|
|
37
|
+
bind: keyboardControls.up,
|
|
38
|
+
keyDown: function () {
|
|
39
|
+
selectedIndex.update(function (currentIndex) {
|
|
40
|
+
if (wrapAround) {
|
|
41
|
+
return (currentIndex - 1 + items().length) % items().length;
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
return Math.max(currentIndex - 1, 0);
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
enter: {
|
|
50
|
+
bind: keyboardControls.action,
|
|
51
|
+
keyDown: function () {
|
|
52
|
+
onSelect === null || onSelect === void 0 ? void 0 : onSelect(selectedIndex());
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
});
|
|
56
|
+
let $this = h(Container, { controls, flexDirection: 'column', margin: [0, 0, 0, 50] }, loop(items, (item, index) => h(component$1, { text: item.text, isSelected: selected(index) })));
|
|
57
|
+
return $this
|
|
58
|
+
}
|
|
172
59
|
|
|
173
|
-
export {
|
|
60
|
+
export { component as default };
|
|
174
61
|
//# sourceMappingURL=index37.js.map
|
package/dist/index37.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index37.js","sources":["../../../node_modules/.pnpm/partysocket@1.1.3/node_modules/partysocket/dist/chunk-HAC622V3.mjs"],"sourcesContent":["import { ReconnectingWebSocket } from \"./chunk-S74YV6PU.mjs\";\n\n// src/index.ts\nvar valueIsNotNil = (keyValuePair) =>\n keyValuePair[1] !== null && keyValuePair[1] !== void 0;\nfunction generateUUID() {\n if (typeof crypto !== \"undefined\" && crypto.randomUUID) {\n return crypto.randomUUID();\n }\n let d = /* @__PURE__ */ new Date().getTime();\n let d2 =\n (typeof performance !== \"undefined\" &&\n performance.now &&\n performance.now() * 1e3) ||\n 0;\n return \"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx\".replace(/[xy]/g, function (c) {\n let r = Math.random() * 16;\n if (d > 0) {\n r = (d + r) % 16 | 0;\n d = Math.floor(d / 16);\n } else {\n r = (d2 + r) % 16 | 0;\n d2 = Math.floor(d2 / 16);\n }\n return (c === \"x\" ? r : (r & 3) | 8).toString(16);\n });\n}\nfunction getPartyInfo(partySocketOptions, defaultProtocol, defaultParams = {}) {\n const {\n host: rawHost,\n path: rawPath,\n protocol: rawProtocol,\n room,\n party,\n basePath,\n prefix,\n query\n } = partySocketOptions;\n let host = rawHost.replace(/^(http|https|ws|wss):\\/\\//, \"\");\n if (host.endsWith(\"/\")) {\n host = host.slice(0, -1);\n }\n if (rawPath == null ? void 0 : rawPath.startsWith(\"/\")) {\n throw new Error(\"path must not start with a slash\");\n }\n const name = party ?? \"main\";\n const path = rawPath ? `/${rawPath}` : \"\";\n const protocol =\n rawProtocol ||\n (host.startsWith(\"localhost:\") ||\n host.startsWith(\"127.0.0.1:\") ||\n host.startsWith(\"192.168.\") ||\n host.startsWith(\"10.\") ||\n (host.startsWith(\"172.\") &&\n host.split(\".\")[1] >= \"16\" &&\n host.split(\".\")[1] <= \"31\") ||\n host.startsWith(\"[::ffff:7f00:1]:\")\n ? // http / ws\n defaultProtocol\n : // https / wss\n `${defaultProtocol}s`);\n const baseUrl = `${protocol}://${host}/${basePath || `${prefix || \"parties\"}/${name}/${room}`}${path}`;\n const makeUrl = (query2 = {}) =>\n `${baseUrl}?${new URLSearchParams([\n ...Object.entries(defaultParams),\n ...Object.entries(query2).filter(valueIsNotNil)\n ])}`;\n const urlProvider =\n typeof query === \"function\"\n ? async () => makeUrl(await query())\n : makeUrl(query);\n return {\n host,\n path,\n room,\n name,\n protocol,\n partyUrl: baseUrl,\n urlProvider\n };\n}\nvar PartySocket = class extends ReconnectingWebSocket {\n constructor(partySocketOptions) {\n const wsOptions = getWSOptions(partySocketOptions);\n super(wsOptions.urlProvider, wsOptions.protocols, wsOptions.socketOptions);\n this.partySocketOptions = partySocketOptions;\n this.setWSProperties(wsOptions);\n }\n _pk;\n _pkurl;\n name;\n room;\n host;\n path;\n updateProperties(partySocketOptions) {\n const wsOptions = getWSOptions({\n ...this.partySocketOptions,\n ...partySocketOptions,\n host: partySocketOptions.host ?? this.host,\n room: partySocketOptions.room ?? this.room,\n path: partySocketOptions.path ?? this.path\n });\n this._url = wsOptions.urlProvider;\n this._protocols = wsOptions.protocols;\n this._options = wsOptions.socketOptions;\n this.setWSProperties(wsOptions);\n }\n setWSProperties(wsOptions) {\n const { _pk, _pkurl, name, room, host, path } = wsOptions;\n this._pk = _pk;\n this._pkurl = _pkurl;\n this.name = name;\n this.room = room;\n this.host = host;\n this.path = path;\n }\n reconnect(code, reason) {\n if (!this.room || !this.host) {\n throw new Error(\n \"The room and host must be set before connecting, use `updateProperties` method to set them or pass them to the constructor.\"\n );\n }\n super.reconnect(code, reason);\n }\n get id() {\n return this._pk;\n }\n /**\n * Exposes the static PartyKit room URL without applying query parameters.\n * To access the currently connected WebSocket url, use PartySocket#url.\n */\n get roomUrl() {\n return this._pkurl;\n }\n // a `fetch` method that uses (almost) the same options as `PartySocket`\n static async fetch(options, init) {\n const party = getPartyInfo(options, \"http\");\n const url =\n typeof party.urlProvider === \"string\"\n ? party.urlProvider\n : await party.urlProvider();\n const doFetch = options.fetch ?? fetch;\n return doFetch(url, init);\n }\n};\nfunction getWSOptions(partySocketOptions) {\n const {\n id,\n host: _host,\n path: _path,\n party: _party,\n room: _room,\n protocol: _protocol,\n query: _query,\n protocols,\n ...socketOptions\n } = partySocketOptions;\n const _pk = id || generateUUID();\n const party = getPartyInfo(partySocketOptions, \"ws\", { _pk });\n return {\n _pk,\n _pkurl: party.partyUrl,\n name: party.name,\n room: party.room,\n host: party.host,\n path: party.path,\n protocols,\n socketOptions,\n urlProvider: party.urlProvider\n };\n}\n\nexport { PartySocket };\n//# sourceMappingURL=chunk-HAC622V3.mjs.map\n"],"names":[],"mappings":";;AAEA;AACA,IAAI,aAAa,GAAG,CAAC,YAAY;AACjC,EAAE,YAAY,CAAC,CAAC,CAAC,KAAK,IAAI,IAAI,YAAY,CAAC,CAAC,CAAC,KAAK,MAAM;AACxD,SAAS,YAAY,GAAG;AACxB,EAAE,IAAI,OAAO,MAAM,KAAK,WAAW,IAAI,MAAM,CAAC,UAAU,EAAE;AAC1D,IAAI,OAAO,MAAM,CAAC,UAAU,EAAE;AAC9B;AACA,EAAE,IAAI,CAAC,mBAAmB,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE;AAC9C,EAAE,IAAI,EAAE;AACR,IAAI,CAAC,OAAO,WAAW,KAAK,WAAW;AACvC,MAAM,WAAW,CAAC,GAAG;AACrB,MAAM,WAAW,CAAC,GAAG,EAAE,GAAG,GAAG;AAC7B,IAAI,CAAC;AACL,EAAE,OAAO,sCAAsC,CAAC,OAAO,CAAC,OAAO,EAAE,UAAU,CAAC,EAAE;AAC9E,IAAI,IAAI,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,EAAE;AAC9B,IAAI,IAAI,CAAC,GAAG,CAAC,EAAE;AACf,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC;AAC1B,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,CAAC;AAC5B,KAAK,MAAM;AACX,MAAM,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,IAAI,EAAE,GAA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I,GAAG;AACP,GAAG,GAAG,kBAAkB;AACxB,EAAE,MAAM,GAAG,GAAG,EAAE,IAAI,YAAY,EAAE;AAClC,EAAE,MAAM,KAAK,GAAG,YAAY,CAAC,kBAAkB,EAAE,IAAI,EAAE,EAAE,GAAG,EAAE,CAAC;AAC/D,EAAE,OAAO;AACT,IAAI,GAAG;AACP,IAAI,MAAM,EAAE,KAAK,CAAC,QAAQ;AAC1B,IAAI,IAAI,EAAE,KAAK,CAAC,IAAI;AACpB,IAAI,IAAI,EAAE,KAAK,CAAC,IAAI;AACpB,IAAI,IAAI,EAAE,KAAK,CAAC,IAAI;AACpB,IAAI,IAAI,EAAE,KAAK,CAAC,IAAI;AACpB,IAAI,SAAS;AACb,IAAI,aAAa;AACjB,IAAI,WAAW,EAAE,KAAK,CAAC;AACvB,GAAG;AACH;;;;","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"index37.js","sources":["../src/components/gui/dialogbox/selection.ce"],"sourcesContent":["<Container controls flexDirection=\"column\" margin={[0, 0, 0, 50]}>\n @for ((item,index) of items) { \n <ItemMenu text={@item.@text} isSelected={@selected(@index)} /> \n }\n</Container>\n\n<script>\n import { signal, computed, mount } from \"canvasengine\";\n import ItemMenu from \"./itemMenu.ce\";\n import { RpgClientEngine } from \"../../../RpgClientEngine\";\n import { inject } from \"../../../core/inject\";\n\n const {\n items,\n wrapAround,\n onSelect,\n selectedIndex,\n } = defineProps();\n\n const client = inject(RpgClientEngine);\n const keyboardControls = client.globalConfig.keyboardControls;\n\n const selected = (index) => {\n return computed(() => {\n return index === selectedIndex();\n })\n }\n\n mount((element) => {\n return () => {\n element.directives.controls.onDestroy()\n }\n })\n\n const controls = signal({\n down: {\n bind: keyboardControls.down,\n keyDown() {\n selectedIndex.update((currentIndex) => {\n if (wrapAround) {\n return (currentIndex + 1) % items().length;\n } else {\n return Math.min(currentIndex + 1, items().length - 1);\n }\n });\n },\n },\n up: {\n bind: keyboardControls.up,\n keyDown() {\n selectedIndex.update((currentIndex) => {\n if (wrapAround) {\n return (currentIndex - 1 + items().length) % items().length;\n } else {\n return Math.max(currentIndex - 1, 0);\n }\n });\n },\n },\n enter: {\n bind: keyboardControls.action,\n keyDown() {\n onSelect?.(selectedIndex());\n },\n },\n });\n</script>\n"],"names":["ItemMenu"],"mappings":";;;;;AASqB,SAAS,SAAS,CAAC,OAAO,EAAE;AACjD,QAAuB,QAAQ,CAAC,OAAO;AACvC,QAAQ,MAAM,WAAW,GAAG,cAAc,CAAC,OAAO;AAClD,QAAQ,IAAI,EAAE,GAAG,WAAW,EAAE,EAAE,KAAK,GAAG,EAAE,CAAC,KAAK,EAAE,UAAU,GAAG,EAAE,CAAC,UAAU,EAAE,QAAQ,GAAG,EAAE,CAAC,QAAQ,EAAE,aAAa,GAAG,EAAE,CAAC,aAAa;AACtI,IAAI,MAAM,GAAG,MAAM,CAAC,eAAe,CAAC;AACpC,IAAI,gBAAgB,GAAG,MAAM,CAAC,YAAY,CAAC,gBAAgB;AAC3D,IAAI,QAAQ,GAAG,UAAU,KAAK,EAAE;AAChC,IAAI,OAAO,QAAQ,CAAC,YAAY;AAChC,QAAQ,OAAO,KAAK,KAAK,aAAa,EAAE;AACxC,KAAK,CAAC;AACN,CAAC;AACD,KAAK,CAAC,UAAU,OAAO,EAAE;AACzB,IAAI,OAAO,YAAY;AACvB,QAAQ,OAAO,CAAC,UAAU,CAAC,QAAQ,CAAC,SAAS,EAAE;AAC/C,KAAK;AACL,CAAC,CAAC;AACF,IAAI,QAAQ,GAAG,MAAM,CAAC;AACtB,IAAI,IAAI,EAAE;AACV,QAAQ,IAAI,EAAE,gBAAgB,CAAC,IAAI;AACnC,QAAQ,OAAO,EAAE,YAAY;AAC7B,YAAY,aAAa,CAAC,MAAM,CAAC,UAAU,YAAY,EAAE;AACzD,gBAAgB,IAAI,UAAU,EAAE;AAChC,oBAAoB,OAAO,CAAC,YAAY,GAAG,CAAC,IAAI,KAAK,EAAE,CAAC,MAAM;AAC9D;AACA,q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