@tarve/core 0.4.0 → 0.6.0
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/CHANGELOG.md +126 -1
- package/README.md +121 -12
- package/dist/npm/build.js +1401 -85
- package/dist/npm/cli.js +1940 -117
- package/dist/npm/embedded-assets.js +22 -3
- package/dist/npm/index.js +5274 -975
- package/dist/npm/jsx-dev-runtime.js +1268 -0
- package/dist/npm/jsx-runtime.js +1268 -0
- package/dist/npm/native-runtime.json +3 -3
- package/dist/npm/node-build.js +1159 -0
- package/dist/npm/protocol.js +1 -1
- package/dist/npm/runtime.js +5 -5
- package/dist/npm/txiki/fetch.ts +228 -0
- package/dist/npm/txiki/intl-data.ts +7 -0
- package/dist/npm/txiki/intl.test.ts +53 -0
- package/dist/npm/txiki/intl.ts +249 -0
- package/dist/npm/txiki/prelude.ts +132 -0
- package/dist/npm/txiki/runtime.ts +6 -0
- package/dist/npm/txiki/shims/buffer.ts +112 -0
- package/dist/npm/txiki/shims/child-process.ts +151 -0
- package/dist/npm/txiki/shims/crypto.ts +30 -0
- package/dist/npm/txiki/shims/events.ts +75 -0
- package/dist/npm/txiki/shims/fs-promises.ts +77 -0
- package/dist/npm/txiki/shims/fs.ts +231 -0
- package/dist/npm/txiki/shims/module.ts +8 -0
- package/dist/npm/txiki/shims/net.ts +69 -0
- package/dist/npm/txiki/shims/os.ts +72 -0
- package/dist/npm/txiki/shims/path.ts +4 -0
- package/dist/npm/txiki/shims/timers-promises.ts +9 -0
- package/dist/npm/txiki/shims/zlib.ts +9 -0
- package/dist/npm/txiki/tjs.d.ts +58 -0
- package/dist/npm/txiki/unavailable.ts +10 -0
- package/dist/types/core/build.d.ts +24 -0
- package/dist/types/core/cli.d.ts +1 -1
- package/dist/types/core/esbuild-file-imports.d.ts +8 -0
- package/dist/types/core/jsx-compile.d.ts +7 -0
- package/dist/types/core/node-build.d.ts +7 -0
- package/dist/types/core/node-dev.d.ts +4 -0
- package/dist/types/core/node-target.d.ts +10 -0
- package/dist/types/core/package-metadata.d.ts +49 -0
- package/dist/types/core/runtime-select.d.ts +8 -0
- package/dist/types/core/src/advanced-controls.d.ts +1 -1
- package/dist/types/core/src/app/element-events.d.ts +18 -0
- package/dist/types/core/src/app/media.d.ts +15 -0
- package/dist/types/core/src/app/requests.d.ts +25 -0
- package/dist/types/core/src/app/shadow.d.ts +7 -0
- package/dist/types/core/src/app/stats.d.ts +12 -0
- package/dist/types/core/src/app/tray.d.ts +40 -0
- package/dist/types/core/src/app-metadata.d.ts +18 -0
- package/dist/types/core/src/app.d.ts +89 -2
- package/dist/types/core/src/assets.d.ts +4 -0
- package/dist/types/core/src/bridge/binding.d.ts +10 -34
- package/dist/types/core/src/bridge/index.d.ts +1 -1
- package/dist/types/core/src/canvas.d.ts +161 -0
- package/dist/types/core/src/chat-controls.d.ts +2 -1
- package/dist/types/core/src/components/button.d.ts +1 -1
- package/dist/types/core/src/components/glass.d.ts +52 -0
- package/dist/types/core/src/components/icon.d.ts +1 -1
- package/dist/types/core/src/components/image.d.ts +8 -4
- package/dist/types/core/src/components/layout.d.ts +5 -4
- package/dist/types/core/src/components/pressable.d.ts +3 -3
- package/dist/types/core/src/components/rich-content.d.ts +1 -1
- package/dist/types/core/src/components/scroll.d.ts +2 -2
- package/dist/types/core/src/components/svg.d.ts +1 -1
- package/dist/types/core/src/components/titlebar.d.ts +15 -1
- package/dist/types/core/src/components/window.d.ts +21 -1
- package/dist/types/core/src/components.d.ts +2 -0
- package/dist/types/core/src/css-shadow.d.ts +1 -1
- package/dist/types/core/src/desktop-controls.d.ts +2 -2
- package/dist/types/core/src/embedded-assets.d.ts +3 -2
- package/dist/types/core/src/extra-controls.d.ts +2 -2
- package/dist/types/core/src/form-controls.d.ts +1 -1
- package/dist/types/core/src/html-elements.d.ts +26 -0
- package/dist/types/core/src/index.d.ts +23 -11
- package/dist/types/core/src/inline-text.d.ts +25 -0
- package/dist/types/core/src/intrinsic-style.d.ts +1 -1
- package/dist/types/core/src/jsx-runtime.d.ts +182 -5
- package/dist/types/core/src/media-element.d.ts +70 -0
- package/dist/types/core/src/memo.d.ts +28 -0
- package/dist/types/core/src/motion.d.ts +1 -1
- package/dist/types/core/src/png.d.ts +29 -0
- package/dist/types/core/src/popups.d.ts +4 -3
- package/dist/types/core/src/protocol.d.ts +6 -0
- package/dist/types/core/src/reconciler/diff.d.ts +11 -0
- package/dist/types/core/src/reconciler/intrinsics.d.ts +24 -0
- package/dist/types/core/src/reconciler.d.ts +33 -10
- package/dist/types/core/src/render-scope.d.ts +8 -0
- package/dist/types/core/src/style.d.ts +1 -1
- package/dist/types/core/src/tailwind-palette.d.ts +1 -0
- package/dist/types/core/src/tailwind.d.ts +8 -0
- package/dist/types/core/src/test-renderer.d.ts +3 -1
- package/dist/types/core/src/text-search.d.ts +1 -1
- package/dist/types/core/src/theme.d.ts +10 -2
- package/dist/types/core/src/updates.d.ts +87 -0
- package/dist/types/core/src/virtual-list.d.ts +8 -2
- package/dist/types/core/txiki/fetch.d.ts +1 -0
- package/dist/types/core/txiki/intl-data.d.ts +6 -0
- package/dist/types/core/txiki/intl.d.ts +92 -0
- package/dist/types/core/txiki/prelude.d.ts +1 -0
- package/dist/types/core/txiki/runtime.d.ts +2 -0
- package/dist/types/core/txiki/shims/buffer.d.ts +37 -0
- package/dist/types/core/txiki/shims/child-process.d.ts +46 -0
- package/dist/types/core/txiki/shims/crypto.d.ts +16 -0
- package/dist/types/core/txiki/shims/events.d.ts +21 -0
- package/dist/types/core/txiki/shims/fs-promises.d.ts +41 -0
- package/dist/types/core/txiki/shims/fs.d.ts +44 -0
- package/dist/types/core/txiki/shims/module.d.ts +5 -0
- package/dist/types/core/txiki/shims/net.d.ts +22 -0
- package/dist/types/core/txiki/shims/os.d.ts +52 -0
- package/dist/types/core/txiki/shims/path.d.ts +3 -0
- package/dist/types/core/txiki/shims/timers-promises.d.ts +7 -0
- package/dist/types/core/txiki/shims/zlib.d.ts +11 -0
- package/dist/types/core/txiki/unavailable.d.ts +5 -0
- package/dist/types/core/txiki-build.d.ts +23 -0
- package/dist/types/core/updates-build.d.ts +35 -0
- package/dist/types/core/windows-executable.d.ts +16 -0
- package/dist/types/protocol/src/index.d.ts +344 -11
- package/native/linux-x64/libtarve_native.so +0 -0
- package/native/linux-x64/runtime.json +4 -4
- package/native/win32-x64/runtime.json +4 -4
- package/native/win32-x64/tarve_native.dll +0 -0
- package/package.json +13 -3
package/dist/npm/protocol.js
CHANGED
package/dist/npm/runtime.js
CHANGED
|
@@ -70,17 +70,17 @@ function nativePath() {
|
|
|
70
70
|
if (process.env.TARVE_NATIVE)
|
|
71
71
|
return process.env.TARVE_NATIVE;
|
|
72
72
|
for (const directory of [
|
|
73
|
-
resolve(import.meta.
|
|
74
|
-
resolve(import.meta.
|
|
73
|
+
resolve(import.meta.dirname, "../../../../native/bin"),
|
|
74
|
+
resolve(import.meta.dirname, "../../native/bin")
|
|
75
75
|
]) {
|
|
76
76
|
const path = developmentLibrary(directory, target);
|
|
77
77
|
if (path && existsSync(path))
|
|
78
78
|
return path;
|
|
79
79
|
}
|
|
80
80
|
const installed = [
|
|
81
|
-
join(import.meta.
|
|
82
|
-
resolve(import.meta.
|
|
83
|
-
resolve(import.meta.
|
|
81
|
+
join(import.meta.dirname, name),
|
|
82
|
+
resolve(import.meta.dirname, "../../native", config.nativeDirectory, name),
|
|
83
|
+
resolve(import.meta.dirname, "../../../../native", config.nativeDirectory, name)
|
|
84
84
|
];
|
|
85
85
|
const found = installed.find((path) => !!path && existsSync(path));
|
|
86
86
|
if (found)
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* fetch for txiki.js with Node and Bun semantics. txiki.js's own fetch is a browser
|
|
3
|
+
* XMLHttpRequest over libwebsockets: it always adds its own Origin, Pragma and
|
|
4
|
+
* Cache-Control headers (servers like Google's reject a request whose Origin the app
|
|
5
|
+
* set too) and offers no streaming. This client speaks HTTP/1.1 over tjs.connect
|
|
6
|
+
* ("tcp" / "tls"): exactly the headers the app sets, redirects, gzip/deflate, chunked
|
|
7
|
+
* bodies streamed as they arrive, and AbortSignal. Other schemes use txiki's fetch.
|
|
8
|
+
*/
|
|
9
|
+
const encoder = new TextEncoder();
|
|
10
|
+
const decoder = new TextDecoder();
|
|
11
|
+
const MAX_REDIRECTS = 20;
|
|
12
|
+
|
|
13
|
+
interface Connection {
|
|
14
|
+
readable: ReadableStream<Uint8Array>;
|
|
15
|
+
writable: WritableStream<Uint8Array>;
|
|
16
|
+
close(): void;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
async function open(url: URL): Promise<Connection> {
|
|
20
|
+
const secure = url.protocol === "https:";
|
|
21
|
+
const port = Number(url.port || (secure ? 443 : 80));
|
|
22
|
+
const host = url.hostname.replace(/^\[|\]$/g, "");
|
|
23
|
+
const socket = await (tjs as unknown as { connect(transport: string, host: string, port: number): Promise<{ opened: Promise<{ readable: ReadableStream<Uint8Array>; writable: WritableStream<Uint8Array> }>; close(): void }> })
|
|
24
|
+
.connect(secure ? "tls" : "tcp", host, port);
|
|
25
|
+
const { readable, writable } = await socket.opened;
|
|
26
|
+
return { readable, writable, close: () => { try { socket.close(); } catch { /* closed */ } } };
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
async function bodyBytes(body: unknown): Promise<Uint8Array | undefined> {
|
|
30
|
+
if (body == null) return undefined;
|
|
31
|
+
if (typeof body === "string") return encoder.encode(body);
|
|
32
|
+
if (body instanceof Uint8Array) return body;
|
|
33
|
+
if (body instanceof ArrayBuffer) return new Uint8Array(body);
|
|
34
|
+
if (ArrayBuffer.isView(body)) return new Uint8Array(body.buffer, body.byteOffset, body.byteLength);
|
|
35
|
+
if (body instanceof URLSearchParams) return encoder.encode(body.toString());
|
|
36
|
+
// Blob, FormData, ReadableStream: let Response serialize it (FormData gets its boundary type).
|
|
37
|
+
return new Uint8Array(await new Response(body as BodyInit).arrayBuffer());
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function defaultContentType(body: unknown): string | undefined {
|
|
41
|
+
if (typeof body === "string") return "text/plain;charset=UTF-8";
|
|
42
|
+
if (body instanceof URLSearchParams) return "application/x-www-form-urlencoded;charset=UTF-8";
|
|
43
|
+
if (typeof FormData !== "undefined" && body instanceof FormData) return new Response(body).headers.get("content-type") ?? undefined;
|
|
44
|
+
if (typeof Blob !== "undefined" && body instanceof Blob && body.type) return body.type;
|
|
45
|
+
return undefined;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/** Buffered reads over the socket: the head line by line, the body by length. */
|
|
49
|
+
class Reader {
|
|
50
|
+
private buffer = new Uint8Array(0);
|
|
51
|
+
private done = false;
|
|
52
|
+
constructor(private readonly reader: ReadableStreamDefaultReader<Uint8Array>) {}
|
|
53
|
+
|
|
54
|
+
private async fill(): Promise<boolean> {
|
|
55
|
+
if (this.done) return false;
|
|
56
|
+
const { done, value } = await this.reader.read();
|
|
57
|
+
if (done || !value) { this.done = true; return false; }
|
|
58
|
+
const next = new Uint8Array(this.buffer.length + value.length);
|
|
59
|
+
next.set(this.buffer);
|
|
60
|
+
next.set(value, this.buffer.length);
|
|
61
|
+
this.buffer = next;
|
|
62
|
+
return true;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
async line(): Promise<string | undefined> {
|
|
66
|
+
for (;;) {
|
|
67
|
+
const at = this.buffer.indexOf(10);
|
|
68
|
+
if (at >= 0) {
|
|
69
|
+
const line = decoder.decode(this.buffer.subarray(0, at)).replace(/\r$/, "");
|
|
70
|
+
this.buffer = this.buffer.subarray(at + 1);
|
|
71
|
+
return line;
|
|
72
|
+
}
|
|
73
|
+
if (!await this.fill()) return undefined;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/** Up to `max` bytes; undefined at end of stream. */
|
|
78
|
+
async chunk(max = Infinity): Promise<Uint8Array | undefined> {
|
|
79
|
+
if (!this.buffer.length && !await this.fill()) return undefined;
|
|
80
|
+
const size = Math.min(max, this.buffer.length);
|
|
81
|
+
const out = this.buffer.subarray(0, size);
|
|
82
|
+
this.buffer = this.buffer.subarray(size);
|
|
83
|
+
return out;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
cancel(): void {
|
|
87
|
+
this.reader.cancel().catch(() => {});
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
function abortError(signal: AbortSignal | null | undefined): unknown {
|
|
92
|
+
return signal?.reason ?? new DOMException("The operation was aborted.", "AbortError");
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
async function request(url: URL, method: string, headers: Headers, body: Uint8Array | undefined, signal: AbortSignal | null | undefined): Promise<Response> {
|
|
96
|
+
if (signal?.aborted) throw abortError(signal);
|
|
97
|
+
// Closing the socket does not settle a pending read: race every wait against the abort.
|
|
98
|
+
let connection: Connection | undefined;
|
|
99
|
+
const onAbort = () => connection?.close();
|
|
100
|
+
let rejectAbort = () => {};
|
|
101
|
+
const abortion = signal ? new Promise<never>((_, reject) => { rejectAbort = () => reject(abortError(signal)); signal.addEventListener("abort", rejectAbort, { once: true }); }) : undefined;
|
|
102
|
+
abortion?.catch(() => {});
|
|
103
|
+
const race = <T>(promise: Promise<T>): Promise<T> => abortion ? Promise.race([promise, abortion]) : promise;
|
|
104
|
+
signal?.addEventListener("abort", onAbort, { once: true });
|
|
105
|
+
try {
|
|
106
|
+
const socket = connection = await race(open(url));
|
|
107
|
+
const lines = [`${method} ${url.pathname || "/"}${url.search} HTTP/1.1`];
|
|
108
|
+
if (!headers.has("host")) lines.push(`host: ${url.host}`);
|
|
109
|
+
if (!headers.has("accept")) lines.push("accept: */*");
|
|
110
|
+
if (!headers.has("accept-encoding")) lines.push("accept-encoding: gzip, deflate");
|
|
111
|
+
if (!headers.has("user-agent")) lines.push(`user-agent: tarve (txiki.js ${tjs.version})`);
|
|
112
|
+
lines.push("connection: close");
|
|
113
|
+
headers.forEach((value, name) => { if (name !== "connection" && name !== "content-length") lines.push(`${name}: ${value}`); });
|
|
114
|
+
if (body || method === "POST" || method === "PUT" || method === "PATCH") lines.push(`content-length: ${body?.length ?? 0}`);
|
|
115
|
+
const writer = socket.writable.getWriter();
|
|
116
|
+
await race(writer.write(encoder.encode(lines.join("\r\n") + "\r\n\r\n")));
|
|
117
|
+
if (body?.length) await race(writer.write(body));
|
|
118
|
+
writer.releaseLock();
|
|
119
|
+
|
|
120
|
+
const reader = new Reader(socket.readable.getReader());
|
|
121
|
+
let status = 0, statusText = "";
|
|
122
|
+
const responseHeaders = new Headers();
|
|
123
|
+
// Skip interim 1xx responses (100 Continue).
|
|
124
|
+
do {
|
|
125
|
+
const statusLine = await race(reader.line());
|
|
126
|
+
if (statusLine === undefined) throw new TypeError(`fetch failed: ${url.host} closed the connection`);
|
|
127
|
+
const match = /^HTTP\/\d(?:\.\d)? (\d{3}) ?(.*)$/.exec(statusLine);
|
|
128
|
+
if (!match) throw new TypeError(`fetch failed: malformed response from ${url.host}`);
|
|
129
|
+
status = Number(match[1]);
|
|
130
|
+
statusText = match[2]!;
|
|
131
|
+
for (;;) {
|
|
132
|
+
const line = await race(reader.line());
|
|
133
|
+
if (line === undefined || line === "") break;
|
|
134
|
+
const colon = line.indexOf(":");
|
|
135
|
+
if (colon > 0 && status >= 200) responseHeaders.append(line.slice(0, colon).trim(), line.slice(colon + 1).trim());
|
|
136
|
+
}
|
|
137
|
+
} while (status < 200);
|
|
138
|
+
|
|
139
|
+
const empty = method === "HEAD" || status === 204 || status === 304;
|
|
140
|
+
const chunked = /\bchunked\b/i.test(responseHeaders.get("transfer-encoding") ?? "");
|
|
141
|
+
// A missing or malformed Content-Length reads to the end of the connection.
|
|
142
|
+
const declared = Number(responseHeaders.get("content-length") ?? NaN);
|
|
143
|
+
let remaining = empty ? 0 : !chunked && Number.isSafeInteger(declared) && declared >= 0 ? declared : Infinity;
|
|
144
|
+
let chunkLeft = 0, finished = empty;
|
|
145
|
+
const finish = () => { finished = true; signal?.removeEventListener("abort", onAbort); signal?.removeEventListener("abort", rejectAbort); reader.cancel(); socket.close(); };
|
|
146
|
+
let stream: ReadableStream<Uint8Array> = new ReadableStream<Uint8Array>({
|
|
147
|
+
async pull(controller) {
|
|
148
|
+
try {
|
|
149
|
+
if (finished) { controller.close(); return; }
|
|
150
|
+
if (chunked) {
|
|
151
|
+
if (chunkLeft === 0) {
|
|
152
|
+
const size = parseInt((await race(reader.line())) ?? "0", 16);
|
|
153
|
+
if (!size) { finish(); controller.close(); return; }
|
|
154
|
+
chunkLeft = size;
|
|
155
|
+
}
|
|
156
|
+
const data = await race(reader.chunk(chunkLeft));
|
|
157
|
+
if (!data) throw new TypeError("fetch failed: connection closed inside a chunk");
|
|
158
|
+
chunkLeft -= data.length;
|
|
159
|
+
if (chunkLeft === 0) await race(reader.line());
|
|
160
|
+
controller.enqueue(data.slice());
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
163
|
+
if (remaining <= 0) { finish(); controller.close(); return; }
|
|
164
|
+
const data = await race(reader.chunk(remaining));
|
|
165
|
+
if (!data) {
|
|
166
|
+
if (remaining !== Infinity) throw new TypeError("fetch failed: connection closed before the body ended");
|
|
167
|
+
finish(); controller.close(); return;
|
|
168
|
+
}
|
|
169
|
+
remaining -= data.length;
|
|
170
|
+
controller.enqueue(data.slice());
|
|
171
|
+
} catch (error) {
|
|
172
|
+
finish();
|
|
173
|
+
controller.error(signal?.aborted ? abortError(signal) : error);
|
|
174
|
+
}
|
|
175
|
+
},
|
|
176
|
+
cancel() { finish(); },
|
|
177
|
+
});
|
|
178
|
+
if (empty) finish();
|
|
179
|
+
const encoding = (responseHeaders.get("content-encoding") ?? "").toLowerCase();
|
|
180
|
+
if (!empty && (encoding === "gzip" || encoding === "deflate" || encoding === "x-gzip")) {
|
|
181
|
+
stream = stream.pipeThrough(new DecompressionStream(encoding === "deflate" ? "deflate" : "gzip") as unknown as ReadableWritablePair<Uint8Array, Uint8Array>);
|
|
182
|
+
}
|
|
183
|
+
const response = new Response(empty || status === 101 ? null : stream, { status: status === 101 ? 200 : status, statusText, headers: responseHeaders });
|
|
184
|
+
Object.defineProperty(response, "url", { value: url.href });
|
|
185
|
+
return response;
|
|
186
|
+
} catch (error) {
|
|
187
|
+
signal?.removeEventListener("abort", onAbort);
|
|
188
|
+
signal?.removeEventListener("abort", rejectAbort);
|
|
189
|
+
connection?.close();
|
|
190
|
+
throw signal?.aborted ? abortError(signal) : error;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
export function createFetch(fallback: typeof fetch): typeof fetch {
|
|
195
|
+
return (async (input: RequestInfo | URL, init: RequestInit = {}) => {
|
|
196
|
+
const source = typeof input === "object" && !(input instanceof URL) ? input as Request : undefined;
|
|
197
|
+
let url = new URL(source ? source.url : String(input));
|
|
198
|
+
if (url.protocol !== "http:" && url.protocol !== "https:") return fallback(input, init);
|
|
199
|
+
let method = (init.method ?? source?.method ?? "GET").toUpperCase();
|
|
200
|
+
const headers = new Headers(init.headers ?? source?.headers);
|
|
201
|
+
const rawBody = init.body !== undefined ? init.body : source && method !== "GET" && method !== "HEAD" ? await source.arrayBuffer() : undefined;
|
|
202
|
+
const type = defaultContentType(rawBody);
|
|
203
|
+
if (type && !headers.has("content-type")) headers.set("content-type", type);
|
|
204
|
+
let body = await bodyBytes(rawBody);
|
|
205
|
+
const signal = init.signal ?? source?.signal;
|
|
206
|
+
const redirect = init.redirect ?? source?.redirect ?? "follow";
|
|
207
|
+
for (let redirects = 0; ; redirects++) {
|
|
208
|
+
const response = await request(url, method, headers, body, signal);
|
|
209
|
+
const location = response.headers.get("location");
|
|
210
|
+
if (redirect === "manual" || response.status < 300 || response.status > 399 || response.status === 304 || !location) {
|
|
211
|
+
if (redirects) Object.defineProperty(response, "redirected", { value: true });
|
|
212
|
+
return response;
|
|
213
|
+
}
|
|
214
|
+
if (redirect === "error") throw new TypeError(`fetch failed: redirect to ${location}`);
|
|
215
|
+
if (redirects >= MAX_REDIRECTS) throw new TypeError("fetch failed: too many redirects");
|
|
216
|
+
await response.body?.cancel();
|
|
217
|
+
const next = new URL(location, url);
|
|
218
|
+
if (response.status === 303 || ((response.status === 301 || response.status === 302) && method === "POST")) {
|
|
219
|
+
method = "GET";
|
|
220
|
+
body = undefined;
|
|
221
|
+
headers.delete("content-type");
|
|
222
|
+
}
|
|
223
|
+
// Credentials stay with their origin, as in browsers and Node.
|
|
224
|
+
if (next.origin !== url.origin) { headers.delete("authorization"); headers.delete("cookie"); }
|
|
225
|
+
url = next;
|
|
226
|
+
}
|
|
227
|
+
}) as typeof fetch;
|
|
228
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// Generated by scripts/generate-txiki-intl.ts from ICU 78.3 (Bun 1.4.3). Do not edit.
|
|
2
|
+
/** [group, decimal, minimum grouping digits, secondary group size, percent pattern, minus sign, date formats per DATE_OPTIONS]. */
|
|
3
|
+
export type LocaleData = [string, string, number, number, string, string, number[][]];
|
|
4
|
+
export const DATE_KEYS: string[] = ["","hour=2-digit,minute=2-digit","hour=numeric,minute=2-digit","hour=numeric,minute=2-digit,second=2-digit","hour=2-digit,minute=2-digit,second=2-digit","hour=2-digit,hour12=false,minute=2-digit","hour=2-digit,hour12=true,minute=2-digit","hour=numeric,hour12=false,minute=2-digit","hour=numeric,hour12=true,minute=2-digit","hour=numeric,hour12=false,minute=2-digit,second=2-digit","hour=numeric,hour12=true,minute=2-digit,second=2-digit","day=numeric,month=short,weekday=short","day=numeric,month=long,weekday=long","day=numeric,month=short","day=numeric,month=long","day=numeric,month=short,year=numeric","day=numeric,month=long,year=numeric","day=numeric,month=long,weekday=long,year=numeric","day=numeric,month=short,weekday=short,year=numeric","day=numeric,month=numeric,year=numeric","day=2-digit,month=2-digit,year=numeric","month=long,year=numeric","month=short,year=numeric","weekday=short","weekday=long","month=short","month=long","day=numeric,hour=numeric,minute=2-digit,month=numeric,second=2-digit,year=numeric","day=numeric,hour=numeric,minute=2-digit,month=short,year=numeric","dateStyle=full","dateStyle=long","dateStyle=medium","dateStyle=short","timeStyle=short","timeStyle=medium","dateStyle=medium,timeStyle=short","dateStyle=short,timeStyle=short"];
|
|
5
|
+
export const TEMPLATES: string[] = ["{M0}/{d0}/{y0}","{h1}:{m1} {a0}{c12}","{h0}:{m1} {a0}{c12}","{h0}:{m1}:{s1} {a0}{c12}","{h1}:{m1}:{s1} {a0}{c12}","{h1}:{m1}{c23}","{h1}:{m1}:{s1}{c23}","{w0}, {M0} {d0}","{M0} {d0}","{M0} {d0}, {y0}","{w0}, {M0} {d0}, {y0}","{M1}/{d1}/{y0}","{M0} {y0}","{w0}","{M0}","{M0}/{d0}/{y0}, {h0}:{m1}:{s1} {a0}{c12}","{M0} {d0}, {y0}, {h0}:{m1} {a0}{c12}","{M0}/{d0}/{y1}","{M0}/{d0}/{y1}, {h0}:{m1} {a0}{c12}","{d1}/{M1}/{y0}","{h0}:{m1}{c23}","{h0}:{m1}:{s1}{c23}","{w0} {d0} {M0}","{d0} {M0}","{d0} {M0} {y0}","{w0}, {d0} {M0} {y0}","{d1}/{M1}/{y0}, {h0}:{m1}:{s1}{c23}","{d0} {M0} {y0}, {h0}:{m1}{c23}","{d0} {M0} {y0}, {h1}:{m1}{c23}","{d1}/{M1}/{y0}, {h1}:{m1}{c23}","{d0}/{M0}/{y0}","{w0}, {d0} {M0}","{w0}, {d0} {M0}, {y0}","{d0}/{M0}/{y0}, {h0}:{m1}:{s1} {a0}{c12}","{d0} {M0} {y0}, {h0}:{m1} {a0}{c12}","{d1}/{M1}/{y1}","{d1}/{M1}/{y1}, {h0}:{m1} {a0}{c12}","{y0}-{M1}-{d1}","{y0}-{M1}-{d1}, {h0}:{m1}:{s1} {a0}{c12}","{y0}-{M1}-{d1}, {h0}:{m1} {a0}{c12}","{w0} {d0} {M0} {y0}","{d1}/{M1}/{y0}, {h0}:{m1}:{s1} {a0}{c12}","{d0}/{M0}/{y1}","{d0}/{M0}/{y1}, {h0}:{m1} {a0}{c12}","{w0}, {d0} de {M0}","{d0} de {M0}","{d0} de {M0} de {y0}","{w0}, {d0} de {M0} de {y0}","{M0} de {y0}","{d0} de {M0} de {y0}, {h0}:{m1}{c23}","{d0} de {M0} de {y0}, {h1}:{m1}{c23}","{w0}, {d0}/{M1}","{d0}/{M1}","{d0}/{M1}/{y0}","{w0}, {d0}/{M1}/{y0}","{M1}/{y0}","{d0}/{M1}/{y0}, {h0}:{m1}{c23}","{d1}/{M1}/{y1}, {h1}:{m1}{c23}","{d0}/{M0}/{y0}, {h0}:{m1}:{s1}{c23}","{d0}/{M0}/{y1}, {h0}:{m1}{c23}","{w0} {d0} de {M0}","{d0} de {M0} de {y0}, {h0}:{m1} {a0}{c12}","{d1}/{M1}/{y0} {h0}:{m1}:{s1}{c23}","{d1}/{M1}/{y0} {h1}:{m1}{c23}","{h1} h {m1}{c23}","{h0} h {m1}{c23}","{h0} h {m1} min {s1} s{c23}","{h1} h {m1} min {s1} s{c23}","{h1} h {m1} {a0}{c12}","{h0} h {m1} {a0}{c12}","{h0} h {m1} min {s1} s {a0}{c12}","{y0}-{M1}-{d1} {h0} h {m1} min {s1} s{c23}","{d0} {M0} {y0}, {h0} h {m1}{c23}","{d0} {M0} {y0}, {h1} h {m1}{c23}","{y0}-{M1}-{d1} {h1} h {m1}{c23}","{d0}.{M0}.{y0}","{w0}, {d0}. {M0}","{d0}. {M0}","{d0}. {M0} {y0}","{w0}, {d0}. {M0} {y0}","{d1}.{M1}.{y0}","{d0}.{M0}.{y0}, {h0}:{m1}:{s1}{c23}","{d0}. {M0} {y0}, {h0}:{m1}{c23}","{d1}.{M1}.{y1}","{d1}.{M1}.{y0}, {h1}:{m1}{c23}","{d1}.{M1}.{y1}, {h1}:{m1}{c23}","{d0}-{M0}-{y0}","{d1}-{M1}-{y0}","{d0}-{M0}-{y0}, {h0}:{m1}:{s1}{c23}","{d1}-{M1}-{y0}, {h1}:{m1}{c23}","{y0}-{M1}-{d1} {h0}:{m1}:{s1}{c23}","{d0} {M0} {y0} {h0}:{m1}{c23}","{d0} {M0} {y0} {h1}:{m1}{c23}","{y0}-{M1}-{d1} {h1}:{m1}{c23}","{w0} {d0}. {M0}","{w0} {d0}. {M0} {y0}","{d0}. {M0} {y0}, {h1}:{m1}{c23}","{h1}.{m1}{c23}","{h0}.{m1}{c23}","{h0}.{m1}.{s1}{c23}","{h1}.{m1}.{s1}{c23}","{h1}.{m1} {a0}{c12}","{h0}.{m1} {a0}{c12}","{h0}.{m1}.{s1} {a0}{c12}","{w0} den {d0}. {M0} {y0}","{d0}.{M0}.{y0}, {h0}.{m1}.{s1}{c23}","{d0}. {M0} {y0}, {h0}.{m1}{c23}","{d0}. {M0} {y0}, {h1}.{m1}{c23}","{d1}.{M1}.{y0}, {h1}.{m1}{c23}","{w0} {d0}.{M0}.","{d0}.{M0}.","{w0} {d0}.{M0}.{y0}","{d0}.{M0}.{y0} klo {h0}.{m1}.{s1}{c23}","{d0}.{M0}.{y0} klo {h0}.{m1}{c23}","{d0}.{M1}.{y0}","{d0}.{M1}.{y0}, {h0}:{m1}:{s1}{c23}","{d0}.{M1}.{y0}, {h1}:{m1}{c23}","{d0}. {M0}. {y0}","{w0} {d0}. {M0}.","{d0}. {M0}.","{w0} {d0}. {M0}. {y0}","{d1}. {M1}. {y0}","{d0}. {M0}. {y0} {h0}:{m1}:{s1}{c23}","{d0}. {M0}. {y0} {h0}:{m1}{c23}","{d1}.{M1}.{y1} {h0}:{m1}{c23}","{d0} {M0} {y0} г.","{w0}, {d0} {M0} {y0} г.","{M0} {y0} г.","{d1}.{M1}.{y0}, {h0}:{m1}:{s1}{c23}","{d0} {M0} {y0} г., {h0}:{m1}{c23}","{d0} {M0} {y0} г., {h1}:{m1}{c23}","{d0} {M0} {y0} р.","{w0}, {d0} {M0} {y0} р.","{M0} {y0} р.","{d0} {M0} {y0} р., {h0}:{m1}{c23}","{d0} {M0} {y0} р., {h1}:{m1}{c23}","{a0} {h1}:{m1}{c12}","{a0} {h0}:{m1}{c12}","{a0} {h0}:{m1}:{s1}{c12}","{d0} {M0} {w0}","{d0} {M0} {y0} {w0}","{d1}.{M1}.{y0} {h0}:{m1}:{s1}{c23}","{d0}.{M1}.{y0} {h1}:{m1}{c23}","{y0}/{M0}/{d0}","{a0}{h1}:{m1}{c11}","{a0}{h0}:{m1}{c11}","{a0}{h0}:{m1}:{s1}{c11}","{M0}月{d0}日({w0})","{M0}月{d0}日{w0}","{M0}月{d0}日","{y0}年{M0}月{d0}日","{y0}年{M0}月{d0}日{w0}","{y0}年{M0}月{d0}日({w0})","{y0}/{M1}/{d1}","{y0}年{M0}月","{M0}月","{y0}/{M0}/{d0} {h0}:{m1}:{s1}{c23}","{y0}年{M0}月{d0}日 {h0}:{m1}{c23}","{y0}/{M1}/{d1} {h0}:{m1}{c23}","{a0}{h1}:{m1}{c12}","{a0}{h0}:{m1}{c12}","{a0}{h0}:{m1}:{s1}{c12}","{y0}年{M0}月{d0}日 {h1}:{m1}{c23}","{y0}/{M0}/{d0} {h1}:{m1}{c23}","{a0}{h1}:{m1}:{s1}{c12}","{y0}/{M0}/{d0} {a0}{h0}:{m1}:{s1}{c12}","{y0}年{M0}月{d0}日 {a0}{h0}:{m1}{c12}","{y0}年{M0}月{d0}日 {w0}","{y0}/{M0}/{d0} {a0}{h0}:{m1}{c12}","{y0}. {M0}. {d0}.","{a0} {h1}:{m1}:{s1}{c12}","{M0} {d0}일 ({w0})","{M0} {d0}일 {w0}","{M0} {d0}일","{y0}년 {M0} {d0}일","{y0}년 {M0} {d0}일 {w0}","{y0}년 {M0} {d0}일 ({w0})","{y0}. {M1}. {d1}.","{y0}년 {M0}","{y0}. {M0}. {d0}. {a0} {h0}:{m1}:{s1}{c12}","{y0}년 {M0} {d0}일 {a0} {h0}:{m1}{c12}","{y1}. {M0}. {d0}.","{y0}. {M0}. {d0}. {a0} {h0}:{m1}{c12}","{y1}. {M0}. {d0}. {a0} {h0}:{m1}{c12}","{d0}/{M0}/{y0}, {h0}.{m1}.{s1}{c23}","{d0} {M0} {y0}, {h0}.{m1}{c23}","{w0}, {d1} {M0} {y0}","{d0} {M0} {y0}, {h1}.{m1}{c23}","{d1}/{M1}/{y1}, {h1}.{m1}{c23}","{d0} {M0}, {y0}","{M0} năm {y0}","{h0}:{m1}:{s1} {d0}/{M0}/{y0}{c23}","{h0}:{m1} {d0} {M0}, {y0}{c23}","{h1}:{m1} {d0} {M0}, {y0}{c23}","{h1}:{m1} {d0}/{M0}/{y1}{c23}","{w0}, {d0} ב{M0}","{d0} ב{M0}","{d0} ב{M0} {y0}","{w0}, {d0} ב{M0} {y0}","{d0} ב{M0} {y0}, {h0}:{m1}{c23}","{d0}.{M0}.{y0}, {h0}:{m1}{c23}"];
|
|
6
|
+
export const NAMES: string[][] = [["AM","AM","AM","AM","AM","AM","AM","AM","AM","AM","AM","AM","PM","PM","PM","PM","PM","PM","PM","PM","PM","PM","PM","PM"],["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],["January","February","March","April","May","June","July","August","September","October","November","December"],["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],["am","am","am","am","am","am","am","am","am","am","am","am","pm","pm","pm","pm","pm","pm","pm","pm","pm","pm","pm","pm"],["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sept","Oct","Nov","Dec"],["a.m.","a.m.","a.m.","a.m.","a.m.","a.m.","a.m.","a.m.","a.m.","a.m.","a.m.","a.m.","p.m.","p.m.","p.m.","p.m.","p.m.","p.m.","p.m.","p.m.","p.m.","p.m.","p.m.","p.m."],["Jan","Feb","Mar","Apr","May","June","July","Aug","Sept","Oct","Nov","Dec"],["jan.","fev.","mar.","abr.","mai.","jun.","jul.","ago.","set.","out.","nov.","dez."],["dom.","seg.","ter.","qua.","qui.","sex.","sáb."],["janeiro","fevereiro","março","abril","maio","junho","julho","agosto","setembro","outubro","novembro","dezembro"],["domingo","segunda-feira","terça-feira","quarta-feira","quinta-feira","sexta-feira","sábado"],["domingo","segunda","terça","quarta","quinta","sexta","sábado"],["a. m.","a. m.","a. m.","a. m.","a. m.","a. m.","a. m.","a. m.","a. m.","a. m.","a. m.","a. m.","p. m.","p. m.","p. m.","p. m.","p. m.","p. m.","p. m.","p. m.","p. m.","p. m.","p. m.","p. m."],["ene","feb","mar","abr","may","jun","jul","ago","sept","oct","nov","dic"],["dom","lun","mar","mié","jue","vie","sáb"],["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre"],["domingo","lunes","martes","miércoles","jueves","viernes","sábado"],["ene","feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic"],["janv.","févr.","mars","avr.","mai","juin","juil.","août","sept.","oct.","nov.","déc."],["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre"],["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],["janv.","févr.","mars","avr.","mai","juin","juill.","août","sept.","oct.","nov.","déc."],["Jan.","Feb.","März","Apr.","Mai","Juni","Juli","Aug.","Sept.","Okt.","Nov.","Dez."],["So.","Mo.","Di.","Mi.","Do.","Fr.","Sa."],["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"],["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],["So","Mo","Di","Mi","Do","Fr","Sa"],["Jan","Feb","Mär","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],["Jän.","Feb.","März","Apr.","Mai","Juni","Juli","Aug.","Sep.","Okt.","Nov.","Dez."],["Jänner","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"],["Jän","Feb","Mär","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],["gen","feb","mar","apr","mag","giu","lug","ago","set","ott","nov","dic"],["dom","lun","mar","mer","gio","ven","sab"],["gennaio","febbraio","marzo","aprile","maggio","giugno","luglio","agosto","settembre","ottobre","novembre","dicembre"],["domenica","lunedì","martedì","mercoledì","giovedì","venerdì","sabato"],["jan","feb","mrt","apr","mei","jun","jul","aug","sep","okt","nov","dec"],["zo","ma","di","wo","do","vr","za"],["januari","februari","maart","april","mei","juni","juli","augustus","september","oktober","november","december"],["zondag","maandag","dinsdag","woensdag","donderdag","vrijdag","zaterdag"],["fm","fm","fm","fm","fm","fm","fm","fm","fm","fm","fm","fm","em","em","em","em","em","em","em","em","em","em","em","em"],["jan.","feb.","mars","apr.","maj","juni","juli","aug.","sep.","okt.","nov.","dec."],["sön","mån","tis","ons","tors","fre","lör"],["januari","februari","mars","april","maj","juni","juli","augusti","september","oktober","november","december"],["söndag","måndag","tisdag","onsdag","torsdag","fredag","lördag"],["jan.","feb.","mars","apr.","mai","juni","juli","aug.","sep.","okt.","nov.","des."],["søn.","man.","tir.","ons.","tor.","fre.","lør."],["januar","februar","mars","april","mai","juni","juli","august","september","oktober","november","desember"],["søndag","mandag","tirsdag","onsdag","torsdag","fredag","lørdag"],["jan","feb","mar","apr","mai","jun","jul","aug","sep","okt","nov","des"],["jan.","feb.","mar.","apr.","maj","jun.","jul.","aug.","sep.","okt.","nov.","dec."],["søn.","man.","tirs.","ons.","tors.","fre.","lør."],["januar","februar","marts","april","maj","juni","juli","august","september","oktober","november","december"],["ap.","ap.","ap.","ap.","ap.","ap.","ap.","ap.","ap.","ap.","ap.","ap.","ip.","ip.","ip.","ip.","ip.","ip.","ip.","ip.","ip.","ip.","ip.","ip."],["su","ma","ti","ke","to","pe","la"],["tammikuuta","helmikuuta","maaliskuuta","huhtikuuta","toukokuuta","kesäkuuta","heinäkuuta","elokuuta","syyskuuta","lokakuuta","marraskuuta","joulukuuta"],["sunnuntai","maanantai","tiistai","keskiviikko","torstai","perjantai","lauantai"],["sunnuntaina","maanantaina","tiistaina","keskiviikkona","torstaina","perjantaina","lauantaina"],["tammikuu","helmikuu","maaliskuu","huhtikuu","toukokuu","kesäkuu","heinäkuu","elokuu","syyskuu","lokakuu","marraskuu","joulukuu"],["tammi","helmi","maalis","huhti","touko","kesä","heinä","elo","syys","loka","marras","joulu"],["sty","lut","mar","kwi","maj","cze","lip","sie","wrz","paź","lis","gru"],["niedz.","pon.","wt.","śr.","czw.","pt.","sob."],["stycznia","lutego","marca","kwietnia","maja","czerwca","lipca","sierpnia","września","października","listopada","grudnia"],["niedziela","poniedziałek","wtorek","środa","czwartek","piątek","sobota"],["styczeń","luty","marzec","kwiecień","maj","czerwiec","lipiec","sierpień","wrzesień","październik","listopad","grudzień"],["dop.","dop.","dop.","dop.","dop.","dop.","dop.","dop.","dop.","dop.","dop.","dop.","odp.","odp.","odp.","odp.","odp.","odp.","odp.","odp.","odp.","odp.","odp.","odp."],["ne","po","út","st","čt","pá","so"],["ledna","února","března","dubna","května","června","července","srpna","září","října","listopadu","prosince"],["neděle","pondělí","úterý","středa","čtvrtek","pátek","sobota"],["leden","únor","březen","duben","květen","červen","červenec","srpen","září","říjen","listopad","prosinec"],["led","úno","bře","dub","kvě","čvn","čvc","srp","zář","říj","lis","pro"],["янв.","февр.","мар.","апр.","мая","июн.","июл.","авг.","сент.","окт.","нояб.","дек."],["вс","пн","вт","ср","чт","пт","сб"],["января","февраля","марта","апреля","мая","июня","июля","августа","сентября","октября","ноября","декабря"],["воскресенье","понедельник","вторник","среда","четверг","пятница","суббота"],["январь","февраль","март","апрель","май","июнь","июль","август","сентябрь","октябрь","ноябрь","декабрь"],["янв.","февр.","март","апр.","май","июнь","июль","авг.","сент.","окт.","нояб.","дек."],["дп","дп","дп","дп","дп","дп","дп","дп","дп","дп","дп","дп","пп","пп","пп","пп","пп","пп","пп","пп","пп","пп","пп","пп"],["січ.","лют.","бер.","квіт.","трав.","черв.","лип.","серп.","вер.","жовт.","лист.","груд."],["нд","пн","вт","ср","чт","пт","сб"],["січня","лютого","березня","квітня","травня","червня","липня","серпня","вересня","жовтня","листопада","грудня"],["неділя","понеділок","вівторок","середа","четвер","пʼятниця","субота"],["січень","лютий","березень","квітень","травень","червень","липень","серпень","вересень","жовтень","листопад","грудень"],["ÖÖ","ÖÖ","ÖÖ","ÖÖ","ÖÖ","ÖÖ","ÖÖ","ÖÖ","ÖÖ","ÖÖ","ÖÖ","ÖÖ","ÖS","ÖS","ÖS","ÖS","ÖS","ÖS","ÖS","ÖS","ÖS","ÖS","ÖS","ÖS"],["Oca","Şub","Mar","Nis","May","Haz","Tem","Ağu","Eyl","Eki","Kas","Ara"],["Paz","Pzt","Sal","Çar","Per","Cum","Cmt"],["Ocak","Şubat","Mart","Nisan","Mayıs","Haziran","Temmuz","Ağustos","Eylül","Ekim","Kasım","Aralık"],["Pazar","Pazartesi","Salı","Çarşamba","Perşembe","Cuma","Cumartesi"],["午前","午前","午前","午前","午前","午前","午前","午前","午前","午前","午前","午前","午後","午後","午後","午後","午後","午後","午後","午後","午後","午後","午後","午後"],["日","月","火","水","木","金","土"],["日曜日","月曜日","火曜日","水曜日","木曜日","金曜日","土曜日"],["上午","上午","上午","上午","上午","上午","上午","上午","上午","上午","上午","上午","下午","下午","下午","下午","下午","下午","下午","下午","下午","下午","下午","下午"],["周日","周一","周二","周三","周四","周五","周六"],["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],["週日","週一","週二","週三","週四","週五","週六"],["凌晨","凌晨","凌晨","凌晨","凌晨","清晨","清晨","清晨","上午","上午","上午","上午","中午","下午","下午","下午","下午","下午","下午","晚上","晚上","晚上","晚上","晚上"],["오전","오전","오전","오전","오전","오전","오전","오전","오전","오전","오전","오전","오후","오후","오후","오후","오후","오후","오후","오후","오후","오후","오후","오후"],["1월","2월","3월","4월","5월","6월","7월","8월","9월","10월","11월","12월"],["일","월","화","수","목","금","토"],["일요일","월요일","화요일","수요일","목요일","금요일","토요일"],["Jan","Feb","Mar","Apr","Mei","Jun","Jul","Agu","Sep","Okt","Nov","Des"],["Min","Sen","Sel","Rab","Kam","Jum","Sab"],["Januari","Februari","Maret","April","Mei","Juni","Juli","Agustus","September","Oktober","November","Desember"],["Minggu","Senin","Selasa","Rabu","Kamis","Jumat","Sabtu"],["SA","SA","SA","SA","SA","SA","SA","SA","SA","SA","SA","SA","CH","CH","CH","CH","CH","CH","CH","CH","CH","CH","CH","CH"],["thg 1","thg 2","thg 3","thg 4","thg 5","thg 6","thg 7","thg 8","thg 9","thg 10","thg 11","thg 12"],["CN","Thứ 2","Thứ 3","Thứ 4","Thứ 5","Thứ 6","Thứ 7"],["tháng 1","tháng 2","tháng 3","tháng 4","tháng 5","tháng 6","tháng 7","tháng 8","tháng 9","tháng 10","tháng 11","tháng 12"],["Chủ Nhật","Thứ Hai","Thứ Ba","Thứ Tư","Thứ Năm","Thứ Sáu","Thứ Bảy"],["Tháng 1","Tháng 2","Tháng 3","Tháng 4","Tháng 5","Tháng 6","Tháng 7","Tháng 8","Tháng 9","Tháng 10","Tháng 11","Tháng 12"],["ינו׳","פבר׳","מרץ","אפר׳","מאי","יוני","יולי","אוג׳","ספט׳","אוק׳","נוב׳","דצמ׳"],["יום א׳","יום ב׳","יום ג׳","יום ד׳","יום ה׳","יום ו׳","שבת"],["ינואר","פברואר","מרץ","אפריל","מאי","יוני","יולי","אוגוסט","ספטמבר","אוקטובר","נובמבר","דצמבר"],["יום ראשון","יום שני","יום שלישי","יום רביעי","יום חמישי","יום שישי","יום שבת"]];
|
|
7
|
+
export const LOCALES: Record<string, LocaleData> = {"en-US":[",",".",1,3,"{n}%","-",[[0,-1,-1,-1],[1,-1,-1,0],[2,-1,-1,0],[3,-1,-1,0],[4,-1,-1,0],[5,-1,-1,-1],[1,-1,-1,0],[5,-1,-1,-1],[2,-1,-1,0],[6,-1,-1,-1],[3,-1,-1,0],[7,1,2,-1],[7,3,4,-1],[8,1,-1,-1],[8,3,-1,-1],[9,1,-1,-1],[9,3,-1,-1],[10,3,4,-1],[10,1,2,-1],[0,-1,-1,-1],[11,-1,-1,-1],[12,3,-1,-1],[12,1,-1,-1],[13,-1,2,-1],[13,-1,4,-1],[14,1,-1,-1],[14,3,-1,-1],[15,-1,-1,0],[16,1,-1,0],[10,3,4,-1],[9,3,-1,-1],[9,1,-1,-1],[17,-1,-1,-1],[2,-1,-1,0],[3,-1,-1,0],[16,1,-1,0],[18,-1,-1,0]]],"en-GB":[",",".",1,3,"{n}%","-",[[19,-1,-1,-1],[5,-1,-1,-1],[20,-1,-1,-1],[21,-1,-1,-1],[6,-1,-1,-1],[5,-1,-1,-1],[1,-1,-1,5],[20,-1,-1,-1],[2,-1,-1,5],[21,-1,-1,-1],[3,-1,-1,5],[22,6,2,-1],[22,3,4,-1],[23,6,-1,-1],[23,3,-1,-1],[24,6,-1,-1],[24,3,-1,-1],[25,3,4,-1],[25,6,2,-1],[19,-1,-1,-1],[19,-1,-1,-1],[12,3,-1,-1],[12,6,-1,-1],[13,-1,2,-1],[13,-1,4,-1],[14,6,-1,-1],[14,3,-1,-1],[26,-1,-1,-1],[27,6,-1,-1],[25,3,4,-1],[24,3,-1,-1],[24,6,-1,-1],[19,-1,-1,-1],[5,-1,-1,-1],[6,-1,-1,-1],[28,6,-1,-1],[29,-1,-1,-1]]],"en-IN":[",",".",1,2,"{n}%","-",[[30,-1,-1,-1],[1,-1,-1,5],[2,-1,-1,5],[3,-1,-1,5],[4,-1,-1,5],[5,-1,-1,-1],[1,-1,-1,5],[5,-1,-1,-1],[2,-1,-1,5],[6,-1,-1,-1],[3,-1,-1,5],[31,6,2,-1],[31,3,4,-1],[23,6,-1,-1],[23,3,-1,-1],[24,6,-1,-1],[24,3,-1,-1],[25,3,4,-1],[32,6,2,-1],[30,-1,-1,-1],[19,-1,-1,-1],[12,3,-1,-1],[12,6,-1,-1],[13,-1,2,-1],[13,-1,4,-1],[14,6,-1,-1],[14,3,-1,-1],[33,-1,-1,5],[34,6,-1,5],[25,3,4,-1],[24,3,-1,-1],[24,6,-1,-1],[35,-1,-1,-1],[2,-1,-1,5],[3,-1,-1,5],[34,6,-1,5],[36,-1,-1,5]]],"en-CA":[",",".",1,3,"{n}%","-",[[37,-1,-1,-1],[1,-1,-1,7],[2,-1,-1,7],[3,-1,-1,7],[4,-1,-1,7],[5,-1,-1,-1],[1,-1,-1,7],[5,-1,-1,-1],[2,-1,-1,7],[6,-1,-1,-1],[3,-1,-1,7],[7,1,2,-1],[7,3,4,-1],[8,1,-1,-1],[8,3,-1,-1],[9,1,-1,-1],[9,3,-1,-1],[10,3,4,-1],[10,1,2,-1],[37,-1,-1,-1],[37,-1,-1,-1],[12,3,-1,-1],[12,1,-1,-1],[13,-1,2,-1],[13,-1,4,-1],[14,1,-1,-1],[14,3,-1,-1],[38,-1,-1,7],[16,1,-1,7],[10,3,4,-1],[9,3,-1,-1],[9,1,-1,-1],[37,-1,-1,-1],[2,-1,-1,7],[3,-1,-1,7],[16,1,-1,7],[39,-1,-1,7]]],"en-AU":[",",".",1,3,"{n}%","-",[[19,-1,-1,-1],[1,-1,-1,5],[2,-1,-1,5],[3,-1,-1,5],[4,-1,-1,5],[5,-1,-1,-1],[1,-1,-1,5],[5,-1,-1,-1],[2,-1,-1,5],[6,-1,-1,-1],[3,-1,-1,5],[31,8,2,-1],[22,3,4,-1],[23,8,-1,-1],[23,3,-1,-1],[24,8,-1,-1],[24,3,-1,-1],[40,3,4,-1],[25,8,2,-1],[19,-1,-1,-1],[19,-1,-1,-1],[12,3,-1,-1],[12,8,-1,-1],[13,-1,2,-1],[13,-1,4,-1],[14,6,-1,-1],[14,3,-1,-1],[41,-1,-1,5],[34,8,-1,5],[25,3,4,-1],[24,3,-1,-1],[24,8,-1,-1],[42,-1,-1,-1],[2,-1,-1,5],[3,-1,-1,5],[34,8,-1,5],[43,-1,-1,5]]],"pt-BR":[".",",",1,3,"{n}%","-",[[19,-1,-1,-1],[5,-1,-1,-1],[20,-1,-1,-1],[21,-1,-1,-1],[6,-1,-1,-1],[5,-1,-1,-1],[1,-1,-1,0],[20,-1,-1,-1],[2,-1,-1,0],[21,-1,-1,-1],[3,-1,-1,0],[44,9,10,-1],[44,11,12,-1],[45,9,-1,-1],[45,11,-1,-1],[46,9,-1,-1],[46,11,-1,-1],[47,11,12,-1],[47,9,10,-1],[19,-1,-1,-1],[19,-1,-1,-1],[48,11,-1,-1],[48,9,-1,-1],[13,-1,10,-1],[13,-1,12,-1],[14,9,-1,-1],[14,11,-1,-1],[26,-1,-1,-1],[49,9,-1,-1],[47,11,12,-1],[46,11,-1,-1],[46,9,-1,-1],[19,-1,-1,-1],[5,-1,-1,-1],[6,-1,-1,-1],[50,9,-1,-1],[29,-1,-1,-1]]],"pt-PT":[" ",",",2,3,"{n}%","-",[[19,-1,-1,-1],[5,-1,-1,-1],[20,-1,-1,-1],[21,-1,-1,-1],[6,-1,-1,-1],[5,-1,-1,-1],[1,-1,-1,7],[20,-1,-1,-1],[2,-1,-1,7],[21,-1,-1,-1],[3,-1,-1,7],[51,-1,13,-1],[44,11,12,-1],[52,-1,-1,-1],[45,11,-1,-1],[53,-1,-1,-1],[46,11,-1,-1],[47,11,12,-1],[54,-1,13,-1],[19,-1,-1,-1],[19,-1,-1,-1],[48,11,-1,-1],[55,-1,-1,-1],[13,-1,13,-1],[13,-1,12,-1],[14,9,-1,-1],[14,11,-1,-1],[26,-1,-1,-1],[56,-1,-1,-1],[47,11,12,-1],[46,11,-1,-1],[19,-1,-1,-1],[35,-1,-1,-1],[5,-1,-1,-1],[6,-1,-1,-1],[29,-1,-1,-1],[57,-1,-1,-1]]],"es-ES":[".",",",2,3,"{n} %","-",[[30,-1,-1,-1],[5,-1,-1,-1],[20,-1,-1,-1],[21,-1,-1,-1],[6,-1,-1,-1],[5,-1,-1,-1],[1,-1,-1,14],[20,-1,-1,-1],[2,-1,-1,14],[21,-1,-1,-1],[3,-1,-1,14],[31,15,16,-1],[44,17,18,-1],[23,15,-1,-1],[45,17,-1,-1],[24,15,-1,-1],[46,17,-1,-1],[47,17,18,-1],[25,15,16,-1],[30,-1,-1,-1],[19,-1,-1,-1],[48,17,-1,-1],[12,15,-1,-1],[13,-1,16,-1],[13,-1,18,-1],[14,15,-1,-1],[14,17,-1,-1],[58,-1,-1,-1],[27,15,-1,-1],[47,17,18,-1],[46,17,-1,-1],[24,15,-1,-1],[42,-1,-1,-1],[20,-1,-1,-1],[21,-1,-1,-1],[27,15,-1,-1],[59,-1,-1,-1]]],"es-MX":[",",".",1,3,"{n}%","-",[[30,-1,-1,-1],[1,-1,-1,7],[2,-1,-1,7],[3,-1,-1,7],[4,-1,-1,7],[5,-1,-1,-1],[1,-1,-1,7],[5,-1,-1,-1],[2,-1,-1,7],[6,-1,-1,-1],[3,-1,-1,7],[60,19,16,-1],[44,17,18,-1],[23,19,-1,-1],[45,17,-1,-1],[24,19,-1,-1],[46,17,-1,-1],[47,17,18,-1],[47,19,16,-1],[30,-1,-1,-1],[19,-1,-1,-1],[48,17,-1,-1],[12,19,-1,-1],[13,-1,16,-1],[13,-1,18,-1],[14,19,-1,-1],[14,17,-1,-1],[33,-1,-1,7],[34,19,-1,7],[47,17,18,-1],[46,17,-1,-1],[24,19,-1,-1],[35,-1,-1,-1],[2,-1,-1,7],[3,-1,-1,7],[34,19,-1,7],[36,-1,-1,7]]],"es-AR":[".",",",1,3,"{n}%","-",[[30,-1,-1,-1],[1,-1,-1,14],[2,-1,-1,14],[3,-1,-1,14],[4,-1,-1,14],[5,-1,-1,-1],[1,-1,-1,14],[5,-1,-1,-1],[2,-1,-1,14],[6,-1,-1,-1],[3,-1,-1,14],[31,15,16,-1],[44,17,18,-1],[23,15,-1,-1],[45,17,-1,-1],[46,15,-1,-1],[46,17,-1,-1],[47,17,18,-1],[25,15,16,-1],[30,-1,-1,-1],[19,-1,-1,-1],[48,17,-1,-1],[12,15,-1,-1],[13,-1,16,-1],[13,-1,18,-1],[14,15,-1,-1],[14,17,-1,-1],[33,-1,-1,14],[61,15,-1,14],[47,17,18,-1],[46,17,-1,-1],[24,15,-1,-1],[42,-1,-1,-1],[2,-1,-1,14],[3,-1,-1,14],[34,15,-1,14],[43,-1,-1,14]]],"fr-FR":[" ",",",1,3,"{n} %","-",[[19,-1,-1,-1],[5,-1,-1,-1],[20,-1,-1,-1],[21,-1,-1,-1],[6,-1,-1,-1],[5,-1,-1,-1],[1,-1,-1,0],[20,-1,-1,-1],[2,-1,-1,0],[21,-1,-1,-1],[3,-1,-1,0],[22,20,21,-1],[22,22,23,-1],[23,20,-1,-1],[23,22,-1,-1],[24,20,-1,-1],[24,22,-1,-1],[40,22,23,-1],[40,20,21,-1],[19,-1,-1,-1],[19,-1,-1,-1],[12,22,-1,-1],[12,20,-1,-1],[13,-1,21,-1],[13,-1,23,-1],[14,20,-1,-1],[14,22,-1,-1],[62,-1,-1,-1],[27,20,-1,-1],[40,22,23,-1],[24,22,-1,-1],[24,20,-1,-1],[19,-1,-1,-1],[5,-1,-1,-1],[6,-1,-1,-1],[28,20,-1,-1],[63,-1,-1,-1]]],"fr-CA":[" ",",",1,3,"{n} %","-",[[37,-1,-1,-1],[64,-1,-1,-1],[65,-1,-1,-1],[66,-1,-1,-1],[67,-1,-1,-1],[64,-1,-1,-1],[68,-1,-1,7],[65,-1,-1,-1],[69,-1,-1,7],[66,-1,-1,-1],[70,-1,-1,7],[22,24,21,-1],[22,22,23,-1],[23,24,-1,-1],[23,22,-1,-1],[24,24,-1,-1],[24,22,-1,-1],[40,22,23,-1],[40,24,21,-1],[37,-1,-1,-1],[37,-1,-1,-1],[12,22,-1,-1],[12,24,-1,-1],[13,-1,21,-1],[13,-1,23,-1],[14,24,-1,-1],[14,22,-1,-1],[71,-1,-1,-1],[72,24,-1,-1],[40,22,23,-1],[24,22,-1,-1],[24,24,-1,-1],[37,-1,-1,-1],[64,-1,-1,-1],[67,-1,-1,-1],[73,24,-1,-1],[74,-1,-1,-1]]],"de-DE":[".",",",1,3,"{n} %","-",[[75,-1,-1,-1],[5,-1,-1,-1],[20,-1,-1,-1],[21,-1,-1,-1],[6,-1,-1,-1],[5,-1,-1,-1],[1,-1,-1,0],[20,-1,-1,-1],[2,-1,-1,0],[21,-1,-1,-1],[3,-1,-1,0],[76,25,26,-1],[76,27,28,-1],[77,25,-1,-1],[77,27,-1,-1],[78,25,-1,-1],[78,27,-1,-1],[79,27,28,-1],[79,25,26,-1],[75,-1,-1,-1],[80,-1,-1,-1],[12,27,-1,-1],[12,25,-1,-1],[13,-1,29,-1],[13,-1,28,-1],[14,30,-1,-1],[14,27,-1,-1],[81,-1,-1,-1],[82,25,-1,-1],[79,27,28,-1],[78,27,-1,-1],[80,-1,-1,-1],[83,-1,-1,-1],[5,-1,-1,-1],[6,-1,-1,-1],[84,-1,-1,-1],[85,-1,-1,-1]]],"de-CH":["'",".",1,3,"{n}%","-",[[75,-1,-1,-1],[5,-1,-1,-1],[20,-1,-1,-1],[21,-1,-1,-1],[6,-1,-1,-1],[5,-1,-1,-1],[1,-1,-1,0],[20,-1,-1,-1],[2,-1,-1,0],[21,-1,-1,-1],[3,-1,-1,0],[76,25,26,-1],[76,27,28,-1],[77,25,-1,-1],[77,27,-1,-1],[78,25,-1,-1],[78,27,-1,-1],[79,27,28,-1],[79,25,26,-1],[75,-1,-1,-1],[80,-1,-1,-1],[12,27,-1,-1],[12,25,-1,-1],[13,-1,29,-1],[13,-1,28,-1],[14,30,-1,-1],[14,27,-1,-1],[81,-1,-1,-1],[82,25,-1,-1],[79,27,28,-1],[78,27,-1,-1],[80,-1,-1,-1],[83,-1,-1,-1],[5,-1,-1,-1],[6,-1,-1,-1],[84,-1,-1,-1],[85,-1,-1,-1]]],"de-AT":[" ",",",1,3,"{n} %","-",[[75,-1,-1,-1],[5,-1,-1,-1],[20,-1,-1,-1],[21,-1,-1,-1],[6,-1,-1,-1],[5,-1,-1,-1],[1,-1,-1,0],[20,-1,-1,-1],[2,-1,-1,0],[21,-1,-1,-1],[3,-1,-1,0],[76,31,26,-1],[76,32,28,-1],[77,31,-1,-1],[77,32,-1,-1],[78,31,-1,-1],[78,32,-1,-1],[79,32,28,-1],[79,31,26,-1],[75,-1,-1,-1],[80,-1,-1,-1],[12,32,-1,-1],[12,31,-1,-1],[13,-1,29,-1],[13,-1,28,-1],[14,33,-1,-1],[14,32,-1,-1],[81,-1,-1,-1],[82,31,-1,-1],[79,32,28,-1],[78,32,-1,-1],[80,-1,-1,-1],[83,-1,-1,-1],[5,-1,-1,-1],[6,-1,-1,-1],[84,-1,-1,-1],[85,-1,-1,-1]]],"it-IT":[".",",",2,3,"{n}%","-",[[19,-1,-1,-1],[5,-1,-1,-1],[20,-1,-1,-1],[21,-1,-1,-1],[6,-1,-1,-1],[5,-1,-1,-1],[1,-1,-1,0],[20,-1,-1,-1],[2,-1,-1,0],[21,-1,-1,-1],[3,-1,-1,0],[22,34,35,-1],[22,36,37,-1],[23,34,-1,-1],[23,36,-1,-1],[24,34,-1,-1],[24,36,-1,-1],[40,36,37,-1],[40,34,35,-1],[19,-1,-1,-1],[19,-1,-1,-1],[12,36,-1,-1],[12,34,-1,-1],[13,-1,35,-1],[13,-1,37,-1],[14,34,-1,-1],[14,36,-1,-1],[26,-1,-1,-1],[27,34,-1,-1],[40,36,37,-1],[24,36,-1,-1],[24,34,-1,-1],[35,-1,-1,-1],[5,-1,-1,-1],[6,-1,-1,-1],[28,34,-1,-1],[57,-1,-1,-1]]],"nl-NL":[".",",",1,3,"{n}%","-",[[86,-1,-1,-1],[5,-1,-1,-1],[20,-1,-1,-1],[21,-1,-1,-1],[6,-1,-1,-1],[5,-1,-1,-1],[1,-1,-1,7],[20,-1,-1,-1],[2,-1,-1,7],[21,-1,-1,-1],[3,-1,-1,7],[22,38,39,-1],[22,40,41,-1],[23,38,-1,-1],[23,40,-1,-1],[24,38,-1,-1],[24,40,-1,-1],[40,40,41,-1],[40,38,39,-1],[86,-1,-1,-1],[87,-1,-1,-1],[12,40,-1,-1],[12,38,-1,-1],[13,-1,39,-1],[13,-1,41,-1],[14,38,-1,-1],[14,40,-1,-1],[88,-1,-1,-1],[27,38,-1,-1],[40,40,41,-1],[24,40,-1,-1],[24,38,-1,-1],[87,-1,-1,-1],[5,-1,-1,-1],[6,-1,-1,-1],[28,38,-1,-1],[89,-1,-1,-1]]],"sv-SE":[" ",",",1,3,"{n} %","−",[[37,-1,-1,-1],[5,-1,-1,-1],[20,-1,-1,-1],[21,-1,-1,-1],[6,-1,-1,-1],[5,-1,-1,-1],[1,-1,-1,42],[20,-1,-1,-1],[2,-1,-1,42],[21,-1,-1,-1],[3,-1,-1,42],[22,43,44,-1],[22,45,46,-1],[23,43,-1,-1],[23,45,-1,-1],[24,43,-1,-1],[24,45,-1,-1],[40,45,46,-1],[40,43,44,-1],[37,-1,-1,-1],[37,-1,-1,-1],[12,45,-1,-1],[12,43,-1,-1],[13,-1,44,-1],[13,-1,46,-1],[14,43,-1,-1],[14,45,-1,-1],[90,-1,-1,-1],[91,43,-1,-1],[40,45,46,-1],[24,45,-1,-1],[24,43,-1,-1],[37,-1,-1,-1],[5,-1,-1,-1],[6,-1,-1,-1],[92,43,-1,-1],[93,-1,-1,-1]]],"nb-NO":[" ",",",1,3,"{n} %","−",[[75,-1,-1,-1],[5,-1,-1,-1],[20,-1,-1,-1],[21,-1,-1,-1],[6,-1,-1,-1],[5,-1,-1,-1],[1,-1,-1,7],[20,-1,-1,-1],[2,-1,-1,7],[21,-1,-1,-1],[3,-1,-1,7],[94,47,48,-1],[94,49,50,-1],[77,47,-1,-1],[77,49,-1,-1],[78,47,-1,-1],[78,49,-1,-1],[95,49,50,-1],[95,47,48,-1],[75,-1,-1,-1],[80,-1,-1,-1],[12,49,-1,-1],[12,47,-1,-1],[13,-1,48,-1],[13,-1,50,-1],[14,51,-1,-1],[14,49,-1,-1],[81,-1,-1,-1],[82,47,-1,-1],[95,49,50,-1],[78,49,-1,-1],[78,47,-1,-1],[80,-1,-1,-1],[5,-1,-1,-1],[6,-1,-1,-1],[96,47,-1,-1],[84,-1,-1,-1]]],"da-DK":[".",",",1,3,"{n} %","-",[[75,-1,-1,-1],[97,-1,-1,-1],[98,-1,-1,-1],[99,-1,-1,-1],[100,-1,-1,-1],[97,-1,-1,-1],[101,-1,-1,0],[98,-1,-1,-1],[102,-1,-1,0],[99,-1,-1,-1],[103,-1,-1,0],[94,52,53,-1],[94,54,50,-1],[77,52,-1,-1],[77,54,-1,-1],[78,52,-1,-1],[78,54,-1,-1],[104,54,50,-1],[95,52,53,-1],[75,-1,-1,-1],[80,-1,-1,-1],[12,54,-1,-1],[12,52,-1,-1],[13,-1,53,-1],[13,-1,50,-1],[14,52,-1,-1],[14,54,-1,-1],[105,-1,-1,-1],[106,52,-1,-1],[104,54,50,-1],[78,54,-1,-1],[78,52,-1,-1],[80,-1,-1,-1],[97,-1,-1,-1],[100,-1,-1,-1],[107,52,-1,-1],[108,-1,-1,-1]]],"fi-FI":[" ",",",1,3,"{n} %","−",[[75,-1,-1,-1],[97,-1,-1,-1],[98,-1,-1,-1],[99,-1,-1,-1],[100,-1,-1,-1],[97,-1,-1,-1],[101,-1,-1,55],[98,-1,-1,-1],[102,-1,-1,55],[99,-1,-1,-1],[103,-1,-1,55],[109,-1,56,-1],[94,57,58,-1],[110,-1,-1,-1],[77,57,-1,-1],[75,-1,-1,-1],[78,57,-1,-1],[95,57,59,-1],[111,-1,56,-1],[75,-1,-1,-1],[80,-1,-1,-1],[12,60,-1,-1],[12,61,-1,-1],[13,-1,56,-1],[13,-1,58,-1],[14,61,-1,-1],[14,60,-1,-1],[112,-1,-1,-1],[113,-1,-1,-1],[95,57,58,-1],[78,57,-1,-1],[75,-1,-1,-1],[75,-1,-1,-1],[98,-1,-1,-1],[99,-1,-1,-1],[113,-1,-1,-1],[113,-1,-1,-1]]],"pl-PL":[" ",",",2,3,"{n}%","-",[[114,-1,-1,-1],[5,-1,-1,-1],[20,-1,-1,-1],[21,-1,-1,-1],[6,-1,-1,-1],[5,-1,-1,-1],[1,-1,-1,0],[20,-1,-1,-1],[2,-1,-1,0],[21,-1,-1,-1],[3,-1,-1,0],[31,62,63,-1],[31,64,65,-1],[23,62,-1,-1],[23,64,-1,-1],[24,62,-1,-1],[24,64,-1,-1],[25,64,65,-1],[25,62,63,-1],[114,-1,-1,-1],[80,-1,-1,-1],[12,66,-1,-1],[12,62,-1,-1],[13,-1,63,-1],[13,-1,65,-1],[14,62,-1,-1],[14,66,-1,-1],[115,-1,-1,-1],[27,62,-1,-1],[25,64,65,-1],[24,64,-1,-1],[24,62,-1,-1],[114,-1,-1,-1],[5,-1,-1,-1],[6,-1,-1,-1],[28,62,-1,-1],[116,-1,-1,-1]]],"cs-CZ":[" ",",",1,3,"{n} %","-",[[117,-1,-1,-1],[5,-1,-1,-1],[20,-1,-1,-1],[21,-1,-1,-1],[6,-1,-1,-1],[5,-1,-1,-1],[1,-1,-1,67],[20,-1,-1,-1],[2,-1,-1,67],[21,-1,-1,-1],[3,-1,-1,67],[118,-1,68,-1],[94,69,70,-1],[119,-1,-1,-1],[77,69,-1,-1],[117,-1,-1,-1],[78,69,-1,-1],[95,69,70,-1],[120,-1,68,-1],[117,-1,-1,-1],[121,-1,-1,-1],[12,71,-1,-1],[12,71,-1,-1],[13,-1,68,-1],[13,-1,70,-1],[14,72,-1,-1],[14,71,-1,-1],[122,-1,-1,-1],[123,-1,-1,-1],[95,69,70,-1],[78,69,-1,-1],[117,-1,-1,-1],[83,-1,-1,-1],[20,-1,-1,-1],[21,-1,-1,-1],[123,-1,-1,-1],[124,-1,-1,-1]]],"ru-RU":[" ",",",1,3,"{n} %","-",[[80,-1,-1,-1],[5,-1,-1,-1],[20,-1,-1,-1],[21,-1,-1,-1],[6,-1,-1,-1],[5,-1,-1,-1],[1,-1,-1,0],[20,-1,-1,-1],[2,-1,-1,0],[21,-1,-1,-1],[3,-1,-1,0],[31,73,74,-1],[31,75,76,-1],[23,73,-1,-1],[23,75,-1,-1],[125,73,-1,-1],[125,75,-1,-1],[126,75,76,-1],[126,73,74,-1],[80,-1,-1,-1],[80,-1,-1,-1],[127,77,-1,-1],[127,78,-1,-1],[13,-1,74,-1],[13,-1,76,-1],[14,78,-1,-1],[14,77,-1,-1],[128,-1,-1,-1],[129,73,-1,-1],[126,75,76,-1],[125,75,-1,-1],[125,73,-1,-1],[80,-1,-1,-1],[5,-1,-1,-1],[6,-1,-1,-1],[130,73,-1,-1],[84,-1,-1,-1]]],"uk-UA":[" ",",",1,3,"{n}%","-",[[80,-1,-1,-1],[5,-1,-1,-1],[20,-1,-1,-1],[21,-1,-1,-1],[6,-1,-1,-1],[5,-1,-1,-1],[1,-1,-1,79],[20,-1,-1,-1],[2,-1,-1,79],[21,-1,-1,-1],[3,-1,-1,79],[31,80,81,-1],[31,82,83,-1],[23,80,-1,-1],[23,82,-1,-1],[131,80,-1,-1],[131,82,-1,-1],[132,82,83,-1],[132,80,81,-1],[80,-1,-1,-1],[80,-1,-1,-1],[133,84,-1,-1],[133,80,-1,-1],[13,-1,81,-1],[13,-1,83,-1],[14,80,-1,-1],[14,84,-1,-1],[128,-1,-1,-1],[134,80,-1,-1],[132,82,83,-1],[131,82,-1,-1],[131,80,-1,-1],[83,-1,-1,-1],[5,-1,-1,-1],[6,-1,-1,-1],[135,80,-1,-1],[85,-1,-1,-1]]],"tr-TR":[".",",",1,3,"%{n}","-",[[80,-1,-1,-1],[5,-1,-1,-1],[20,-1,-1,-1],[21,-1,-1,-1],[6,-1,-1,-1],[5,-1,-1,-1],[136,-1,-1,85],[20,-1,-1,-1],[137,-1,-1,85],[21,-1,-1,-1],[138,-1,-1,85],[139,86,87,-1],[139,88,89,-1],[23,86,-1,-1],[23,88,-1,-1],[24,86,-1,-1],[24,88,-1,-1],[140,88,89,-1],[140,86,87,-1],[80,-1,-1,-1],[80,-1,-1,-1],[12,88,-1,-1],[12,86,-1,-1],[13,-1,87,-1],[13,-1,89,-1],[14,86,-1,-1],[14,88,-1,-1],[141,-1,-1,-1],[91,86,-1,-1],[140,88,89,-1],[24,88,-1,-1],[24,86,-1,-1],[114,-1,-1,-1],[5,-1,-1,-1],[6,-1,-1,-1],[92,86,-1,-1],[142,-1,-1,-1]]],"ja-JP":[",",".",1,3,"{n}%","-",[[143,-1,-1,-1],[5,-1,-1,-1],[20,-1,-1,-1],[21,-1,-1,-1],[6,-1,-1,-1],[5,-1,-1,-1],[144,-1,-1,90],[20,-1,-1,-1],[145,-1,-1,90],[21,-1,-1,-1],[146,-1,-1,90],[147,-1,91,-1],[148,-1,92,-1],[149,-1,-1,-1],[149,-1,-1,-1],[150,-1,-1,-1],[150,-1,-1,-1],[151,-1,92,-1],[152,-1,91,-1],[143,-1,-1,-1],[153,-1,-1,-1],[154,-1,-1,-1],[154,-1,-1,-1],[13,-1,91,-1],[13,-1,92,-1],[155,-1,-1,-1],[155,-1,-1,-1],[156,-1,-1,-1],[157,-1,-1,-1],[151,-1,92,-1],[150,-1,-1,-1],[153,-1,-1,-1],[153,-1,-1,-1],[20,-1,-1,-1],[21,-1,-1,-1],[158,-1,-1,-1],[158,-1,-1,-1]]],"zh-CN":[",",".",1,3,"{n}%","-",[[143,-1,-1,-1],[5,-1,-1,-1],[20,-1,-1,-1],[21,-1,-1,-1],[6,-1,-1,-1],[5,-1,-1,-1],[159,-1,-1,93],[20,-1,-1,-1],[160,-1,-1,93],[21,-1,-1,-1],[161,-1,-1,93],[148,-1,94,-1],[148,-1,95,-1],[149,-1,-1,-1],[149,-1,-1,-1],[150,-1,-1,-1],[150,-1,-1,-1],[151,-1,95,-1],[151,-1,94,-1],[143,-1,-1,-1],[153,-1,-1,-1],[154,-1,-1,-1],[154,-1,-1,-1],[13,-1,94,-1],[13,-1,95,-1],[14,96,-1,-1],[14,97,-1,-1],[156,-1,-1,-1],[157,-1,-1,-1],[151,-1,95,-1],[150,-1,-1,-1],[150,-1,-1,-1],[143,-1,-1,-1],[5,-1,-1,-1],[6,-1,-1,-1],[162,-1,-1,-1],[163,-1,-1,-1]]],"zh-TW":[",",".",1,3,"{n}%","-",[[143,-1,-1,-1],[159,-1,-1,93],[160,-1,-1,93],[161,-1,-1,93],[164,-1,-1,93],[5,-1,-1,-1],[159,-1,-1,93],[5,-1,-1,-1],[160,-1,-1,93],[6,-1,-1,-1],[161,-1,-1,93],[148,-1,98,-1],[148,-1,95,-1],[149,-1,-1,-1],[149,-1,-1,-1],[150,-1,-1,-1],[150,-1,-1,-1],[151,-1,95,-1],[151,-1,98,-1],[143,-1,-1,-1],[153,-1,-1,-1],[154,-1,-1,-1],[154,-1,-1,-1],[13,-1,98,-1],[13,-1,95,-1],[14,96,-1,-1],[14,96,-1,-1],[165,-1,-1,93],[166,-1,-1,93],[167,-1,95,-1],[150,-1,-1,-1],[150,-1,-1,-1],[143,-1,-1,-1],[160,-1,-1,99],[161,-1,-1,99],[166,-1,-1,99],[168,-1,-1,99]]],"ko-KR":[",",".",1,3,"{n}%","-",[[169,-1,-1,-1],[136,-1,-1,100],[137,-1,-1,100],[138,-1,-1,100],[170,-1,-1,100],[5,-1,-1,-1],[136,-1,-1,100],[5,-1,-1,-1],[137,-1,-1,100],[21,-1,-1,-1],[138,-1,-1,100],[171,101,102,-1],[172,101,103,-1],[173,101,-1,-1],[173,101,-1,-1],[174,101,-1,-1],[174,101,-1,-1],[175,101,103,-1],[176,101,102,-1],[169,-1,-1,-1],[177,-1,-1,-1],[178,101,-1,-1],[178,101,-1,-1],[13,-1,102,-1],[13,-1,103,-1],[14,101,-1,-1],[14,101,-1,-1],[179,-1,-1,100],[180,101,-1,100],[175,101,103,-1],[174,101,-1,-1],[169,-1,-1,-1],[181,-1,-1,-1],[137,-1,-1,100],[138,-1,-1,100],[182,-1,-1,100],[183,-1,-1,100]]],"id-ID":[".",",",1,3,"{n}%","-",[[30,-1,-1,-1],[97,-1,-1,-1],[98,-1,-1,-1],[99,-1,-1,-1],[100,-1,-1,-1],[97,-1,-1,-1],[101,-1,-1,0],[98,-1,-1,-1],[102,-1,-1,0],[99,-1,-1,-1],[103,-1,-1,0],[31,104,105,-1],[31,106,107,-1],[23,104,-1,-1],[23,106,-1,-1],[24,104,-1,-1],[24,106,-1,-1],[25,106,107,-1],[25,104,105,-1],[30,-1,-1,-1],[19,-1,-1,-1],[12,106,-1,-1],[12,104,-1,-1],[13,-1,105,-1],[13,-1,107,-1],[14,104,-1,-1],[14,106,-1,-1],[184,-1,-1,-1],[185,104,-1,-1],[186,106,107,-1],[24,106,-1,-1],[24,104,-1,-1],[35,-1,-1,-1],[97,-1,-1,-1],[100,-1,-1,-1],[187,104,-1,-1],[188,-1,-1,-1]]],"vi-VN":[".",",",1,3,"{n}%","-",[[30,-1,-1,-1],[5,-1,-1,-1],[20,-1,-1,-1],[21,-1,-1,-1],[6,-1,-1,-1],[5,-1,-1,-1],[1,-1,-1,108],[20,-1,-1,-1],[2,-1,-1,108],[21,-1,-1,-1],[3,-1,-1,108],[31,109,110,-1],[31,111,112,-1],[23,109,-1,-1],[23,111,-1,-1],[189,109,-1,-1],[189,111,-1,-1],[32,111,112,-1],[32,109,110,-1],[30,-1,-1,-1],[19,-1,-1,-1],[190,111,-1,-1],[12,109,-1,-1],[13,-1,110,-1],[13,-1,112,-1],[14,113,-1,-1],[14,113,-1,-1],[191,-1,-1,-1],[192,109,-1,-1],[32,111,112,-1],[189,111,-1,-1],[189,109,-1,-1],[42,-1,-1,-1],[5,-1,-1,-1],[6,-1,-1,-1],[193,109,-1,-1],[194,-1,-1,-1]]],"he-IL":[",",".",1,3,"{n}%","-",[[75,-1,-1,-1],[5,-1,-1,-1],[20,-1,-1,-1],[21,-1,-1,-1],[6,-1,-1,-1],[5,-1,-1,-1],[1,-1,-1,0],[20,-1,-1,-1],[2,-1,-1,0],[21,-1,-1,-1],[3,-1,-1,0],[195,114,115,-1],[195,116,117,-1],[196,114,-1,-1],[196,116,-1,-1],[197,114,-1,-1],[197,116,-1,-1],[198,116,117,-1],[198,114,115,-1],[75,-1,-1,-1],[80,-1,-1,-1],[12,116,-1,-1],[12,114,-1,-1],[13,-1,115,-1],[13,-1,117,-1],[14,114,-1,-1],[14,116,-1,-1],[81,-1,-1,-1],[199,114,-1,-1],[198,116,117,-1],[197,116,-1,-1],[197,114,-1,-1],[75,-1,-1,-1],[20,-1,-1,-1],[21,-1,-1,-1],[199,114,-1,-1],[200,-1,-1,-1]]]};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { expect, mock, test } from "bun:test";
|
|
2
|
+
import { DATE_OPTIONS, LOCALES, data } from "../../../scripts/generate-txiki-intl";
|
|
3
|
+
import * as committed from "./intl-data";
|
|
4
|
+
|
|
5
|
+
// intl.ts runs inside txiki.js: stand in for its globals.
|
|
6
|
+
mock.module("tjs:ffi", () => ({ dlopen: () => { throw new Error("no ffi in tests"); } }));
|
|
7
|
+
Object.assign(globalThis, { TARVE_TXIKI_PLATFORM: "linux", tjs: { env: { LANG: "pt_BR.UTF-8" } } });
|
|
8
|
+
const { txikiIntl } = await import("./intl");
|
|
9
|
+
|
|
10
|
+
// The shim formats with the committed data; comparing it with this host's Intl only
|
|
11
|
+
// means something where the host's ICU produces that data (not, for one, a Windows
|
|
12
|
+
// machine whose regional settings change ICU's output). The Linux gate always does.
|
|
13
|
+
const hostMatches = JSON.stringify(data.locales) === JSON.stringify(committed.LOCALES)
|
|
14
|
+
&& JSON.stringify(data.templatePool) === JSON.stringify(committed.TEMPLATES)
|
|
15
|
+
&& JSON.stringify(data.pool) === JSON.stringify(committed.NAMES);
|
|
16
|
+
if (!hostMatches) console.log("txiki Intl: this host's ICU differs from intl-data.ts; ICU comparisons skipped");
|
|
17
|
+
|
|
18
|
+
const dates = [Date.UTC(2026, 9, 15, 8, 5, 9), Date.UTC(2024, 0, 1, 0, 0, 0), Date.UTC(2025, 11, 31, 23, 59, 59), Date.UTC(2026, 5, 7, 12, 30, 0), Date.UTC(2026, 1, 28, 13, 7, 3)];
|
|
19
|
+
const numbers = [0, 7, 1234, 1234.5, -9876.54321, 12345678.9, 0.256, 1e9, -0.004, 999.9999];
|
|
20
|
+
|
|
21
|
+
test.skipIf(!hostMatches)("txiki.js Intl numbers match ICU for every bundled locale", () => {
|
|
22
|
+
const mismatches: string[] = [];
|
|
23
|
+
for (const locale of LOCALES) {
|
|
24
|
+
for (const value of numbers) {
|
|
25
|
+
for (const options of [{}, { style: "percent" }, { maximumFractionDigits: 1 }, { minimumFractionDigits: 2 }, { useGrouping: false }] as Intl.NumberFormatOptions[]) {
|
|
26
|
+
const expected = new Intl.NumberFormat(locale, options).format(value);
|
|
27
|
+
const actual = new txikiIntl.NumberFormat(locale, options as never).format(value);
|
|
28
|
+
if (actual !== expected) mismatches.push(`${locale} ${value} ${JSON.stringify(options)}: ${JSON.stringify(actual)} != ${JSON.stringify(expected)}`);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
expect(mismatches.slice(0, 10)).toEqual([]);
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
test.skipIf(!hostMatches)("txiki.js Intl dates match ICU for every bundled locale and option set", () => {
|
|
36
|
+
const mismatches: string[] = [];
|
|
37
|
+
for (const locale of LOCALES) {
|
|
38
|
+
for (const options of DATE_OPTIONS) {
|
|
39
|
+
for (const date of dates) {
|
|
40
|
+
const expected = new Intl.DateTimeFormat(locale, { ...options, timeZone: "UTC" }).format(date);
|
|
41
|
+
const actual = new txikiIntl.DateTimeFormat(locale, { ...options, timeZone: "UTC" } as never).format(date);
|
|
42
|
+
if (actual !== expected) mismatches.push(`${locale} ${JSON.stringify(options)}: ${JSON.stringify(actual)} != ${JSON.stringify(expected)}`);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
expect(mismatches.slice(0, 10)).toEqual([]);
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
test("the default locale comes from the system and unknown locales fall back by language", () => {
|
|
50
|
+
expect(new txikiIntl.NumberFormat().format(50000)).toBe("50.000");
|
|
51
|
+
expect(new txikiIntl.NumberFormat("pt-AO").resolvedOptions().locale).toBe("pt-BR");
|
|
52
|
+
expect(new txikiIntl.NumberFormat("xx").format(1234.5)).toBe("1,234.5");
|
|
53
|
+
});
|