create-flow-os 0.0.1 → 0.0.2

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 (187) hide show
  1. package/package.json +8 -21
  2. package/src/create/index.ts +31 -0
  3. package/src/index.ts +14 -0
  4. package/src/init/index.ts +66 -0
  5. package/src/init/lib.ts +36 -0
  6. package/src/init/scaffold.ts +43 -0
  7. package/LICENSE +0 -97
  8. package/README.md +0 -7
  9. package/bin/index.js +0 -1139
  10. package/config.json +0 -86
  11. package/flow.config.client.ts +0 -3
  12. package/packages/client/client/root.css +0 -9
  13. package/packages/client/client/root.tsx +0 -13
  14. package/packages/client/client/routes/404.tsx +0 -24
  15. package/packages/client/client/routes/index.tsx +0 -47
  16. package/packages/server/server/routes/hello.get.ts +0 -3
  17. package/profiles/client/.dockerignore +0 -12
  18. package/profiles/client/.oxfmtrc.json +0 -7
  19. package/profiles/client/.oxlintrc.json +0 -13
  20. package/profiles/client/.vscode/settings.json +0 -12
  21. package/profiles/client/Dockerfile +0 -26
  22. package/profiles/client/LICENSE +0 -97
  23. package/profiles/client/bun.lock +0 -335
  24. package/profiles/client/client/root.css +0 -10
  25. package/profiles/client/client/root.tsx +0 -14
  26. package/profiles/client/client/routes/404.tsx +0 -25
  27. package/profiles/client/client/routes/index.tsx +0 -48
  28. package/profiles/client/flow.config.ts +0 -3
  29. package/profiles/client/index.html +0 -5
  30. package/profiles/client/package.json +0 -29
  31. package/profiles/client/packages/client/LICENSE +0 -97
  32. package/profiles/client/packages/client/build.ts +0 -14
  33. package/profiles/client/packages/client/config.ts +0 -141
  34. package/profiles/client/packages/client/dom.ts +0 -5
  35. package/profiles/client/packages/client/features/attrs.ts +0 -32
  36. package/profiles/client/packages/client/features/class-flow.ts +0 -116
  37. package/profiles/client/packages/client/features/index.ts +0 -8
  38. package/profiles/client/packages/client/features/pseudo-injector.ts +0 -40
  39. package/profiles/client/packages/client/features/style-flow.ts +0 -106
  40. package/profiles/client/packages/client/features/style.ts +0 -27
  41. package/profiles/client/packages/client/features/utils.ts +0 -4
  42. package/profiles/client/packages/client/features/viewport.ts +0 -20
  43. package/profiles/client/packages/client/index.ts +0 -4
  44. package/profiles/client/packages/client/jsx-dev-runtime.ts +0 -1
  45. package/profiles/client/packages/client/jsx-runtime.ts +0 -1
  46. package/profiles/client/packages/client/jsx-types.d.ts +0 -64
  47. package/profiles/client/packages/client/jsx.ts +0 -99
  48. package/profiles/client/packages/client/package.json +0 -42
  49. package/profiles/client/packages/client/preview.ts +0 -14
  50. package/profiles/client/packages/client/start-dev.ts +0 -23
  51. package/profiles/client/packages/client/vite.ts +0 -54
  52. package/profiles/client/packages/core/LICENSE +0 -97
  53. package/profiles/client/packages/core/dom.ts +0 -43
  54. package/profiles/client/packages/core/for.ts +0 -42
  55. package/profiles/client/packages/core/index.ts +0 -5
  56. package/profiles/client/packages/core/lifecycle.ts +0 -6
  57. package/profiles/client/packages/core/package.json +0 -15
  58. package/profiles/client/packages/core/show-switch.ts +0 -56
  59. package/profiles/client/packages/core/state.ts +0 -56
  60. package/profiles/client/packages/router/LICENSE +0 -97
  61. package/profiles/client/packages/router/index.ts +0 -174
  62. package/profiles/client/packages/router/package.json +0 -10
  63. package/profiles/client/packages/style/LICENSE +0 -97
  64. package/profiles/client/packages/style/breakpoints.ts +0 -20
  65. package/profiles/client/packages/style/extension/.vscodeignore +0 -5
  66. package/profiles/client/packages/style/extension/README.md +0 -7
  67. package/profiles/client/packages/style/extension/flow-style-colors-0.0.1.vsix +0 -0
  68. package/profiles/client/packages/style/extension/out/extension.js +0 -130
  69. package/profiles/client/packages/style/extension/package.json +0 -24
  70. package/profiles/client/packages/style/extension/src/extension.ts +0 -146
  71. package/profiles/client/packages/style/extension/tsconfig.json +0 -12
  72. package/profiles/client/packages/style/index.ts +0 -16
  73. package/profiles/client/packages/style/package.json +0 -14
  74. package/profiles/client/packages/style/resolve.ts +0 -84
  75. package/profiles/client/packages/style/shorthand.ts +0 -62
  76. package/profiles/client/tsconfig.json +0 -30
  77. package/profiles/full/.dockerignore +0 -12
  78. package/profiles/full/.oxfmtrc.json +0 -7
  79. package/profiles/full/.oxlintrc.json +0 -13
  80. package/profiles/full/.vscode/settings.json +0 -12
  81. package/profiles/full/Dockerfile +0 -26
  82. package/profiles/full/LICENSE +0 -97
  83. package/profiles/full/bun.lock +0 -335
  84. package/profiles/full/client/root.css +0 -10
  85. package/profiles/full/client/root.tsx +0 -14
  86. package/profiles/full/client/routes/404.tsx +0 -25
  87. package/profiles/full/client/routes/index.tsx +0 -48
  88. package/profiles/full/flow.config.ts +0 -8
  89. package/profiles/full/index.html +0 -5
  90. package/profiles/full/package.json +0 -29
  91. package/profiles/full/packages/client/LICENSE +0 -97
  92. package/profiles/full/packages/client/build.ts +0 -14
  93. package/profiles/full/packages/client/config.ts +0 -141
  94. package/profiles/full/packages/client/dom.ts +0 -5
  95. package/profiles/full/packages/client/features/attrs.ts +0 -32
  96. package/profiles/full/packages/client/features/class-flow.ts +0 -116
  97. package/profiles/full/packages/client/features/index.ts +0 -8
  98. package/profiles/full/packages/client/features/pseudo-injector.ts +0 -40
  99. package/profiles/full/packages/client/features/style-flow.ts +0 -106
  100. package/profiles/full/packages/client/features/style.ts +0 -27
  101. package/profiles/full/packages/client/features/utils.ts +0 -4
  102. package/profiles/full/packages/client/features/viewport.ts +0 -20
  103. package/profiles/full/packages/client/index.ts +0 -4
  104. package/profiles/full/packages/client/jsx-dev-runtime.ts +0 -1
  105. package/profiles/full/packages/client/jsx-runtime.ts +0 -1
  106. package/profiles/full/packages/client/jsx-types.d.ts +0 -64
  107. package/profiles/full/packages/client/jsx.ts +0 -99
  108. package/profiles/full/packages/client/package.json +0 -42
  109. package/profiles/full/packages/client/preview.ts +0 -14
  110. package/profiles/full/packages/client/start-dev.ts +0 -23
  111. package/profiles/full/packages/client/vite.ts +0 -54
  112. package/profiles/full/packages/core/LICENSE +0 -97
  113. package/profiles/full/packages/core/dom.ts +0 -43
  114. package/profiles/full/packages/core/for.ts +0 -42
  115. package/profiles/full/packages/core/index.ts +0 -5
  116. package/profiles/full/packages/core/lifecycle.ts +0 -6
  117. package/profiles/full/packages/core/package.json +0 -15
  118. package/profiles/full/packages/core/show-switch.ts +0 -56
  119. package/profiles/full/packages/core/state.ts +0 -56
  120. package/profiles/full/packages/router/LICENSE +0 -97
  121. package/profiles/full/packages/router/index.ts +0 -174
  122. package/profiles/full/packages/router/package.json +0 -10
  123. package/profiles/full/packages/server/LICENSE +0 -97
  124. package/profiles/full/packages/server/core.ts +0 -140
  125. package/profiles/full/packages/server/index.ts +0 -24
  126. package/profiles/full/packages/server/package.json +0 -29
  127. package/profiles/full/packages/server/plugin.ts +0 -79
  128. package/profiles/full/packages/server/production.ts +0 -75
  129. package/profiles/full/packages/server/start.ts +0 -15
  130. package/profiles/full/packages/style/LICENSE +0 -97
  131. package/profiles/full/packages/style/breakpoints.ts +0 -20
  132. package/profiles/full/packages/style/extension/.vscodeignore +0 -5
  133. package/profiles/full/packages/style/extension/README.md +0 -7
  134. package/profiles/full/packages/style/extension/flow-style-colors-0.0.1.vsix +0 -0
  135. package/profiles/full/packages/style/extension/out/extension.js +0 -130
  136. package/profiles/full/packages/style/extension/package.json +0 -24
  137. package/profiles/full/packages/style/extension/src/extension.ts +0 -146
  138. package/profiles/full/packages/style/extension/tsconfig.json +0 -12
  139. package/profiles/full/packages/style/index.ts +0 -16
  140. package/profiles/full/packages/style/package.json +0 -14
  141. package/profiles/full/packages/style/resolve.ts +0 -84
  142. package/profiles/full/packages/style/shorthand.ts +0 -62
  143. package/profiles/full/server/routes/hello.get.ts +0 -4
  144. package/profiles/full/tsconfig.json +0 -30
  145. package/profiles/server/.dockerignore +0 -12
  146. package/profiles/server/.oxfmtrc.json +0 -7
  147. package/profiles/server/.oxlintrc.json +0 -13
  148. package/profiles/server/.vscode/settings.json +0 -12
  149. package/profiles/server/Dockerfile +0 -26
  150. package/profiles/server/LICENSE +0 -97
  151. package/profiles/server/bun.lock +0 -335
  152. package/profiles/server/flow.config.ts +0 -8
  153. package/profiles/server/index.html +0 -5
  154. package/profiles/server/package.json +0 -29
  155. package/profiles/server/packages/core/LICENSE +0 -97
  156. package/profiles/server/packages/core/dom.ts +0 -43
  157. package/profiles/server/packages/core/for.ts +0 -42
  158. package/profiles/server/packages/core/index.ts +0 -5
  159. package/profiles/server/packages/core/lifecycle.ts +0 -6
  160. package/profiles/server/packages/core/package.json +0 -15
  161. package/profiles/server/packages/core/show-switch.ts +0 -56
  162. package/profiles/server/packages/core/state.ts +0 -56
  163. package/profiles/server/packages/router/LICENSE +0 -97
  164. package/profiles/server/packages/router/index.ts +0 -174
  165. package/profiles/server/packages/router/package.json +0 -10
  166. package/profiles/server/packages/server/LICENSE +0 -97
  167. package/profiles/server/packages/server/core.ts +0 -140
  168. package/profiles/server/packages/server/index.ts +0 -24
  169. package/profiles/server/packages/server/package.json +0 -29
  170. package/profiles/server/packages/server/plugin.ts +0 -79
  171. package/profiles/server/packages/server/production.ts +0 -75
  172. package/profiles/server/packages/server/start.ts +0 -15
  173. package/profiles/server/packages/style/LICENSE +0 -97
  174. package/profiles/server/packages/style/breakpoints.ts +0 -20
  175. package/profiles/server/packages/style/extension/.vscodeignore +0 -5
  176. package/profiles/server/packages/style/extension/README.md +0 -7
  177. package/profiles/server/packages/style/extension/flow-style-colors-0.0.1.vsix +0 -0
  178. package/profiles/server/packages/style/extension/out/extension.js +0 -130
  179. package/profiles/server/packages/style/extension/package.json +0 -24
  180. package/profiles/server/packages/style/extension/src/extension.ts +0 -146
  181. package/profiles/server/packages/style/extension/tsconfig.json +0 -12
  182. package/profiles/server/packages/style/index.ts +0 -16
  183. package/profiles/server/packages/style/package.json +0 -14
  184. package/profiles/server/packages/style/resolve.ts +0 -84
  185. package/profiles/server/packages/style/shorthand.ts +0 -62
  186. package/profiles/server/server/routes/hello.get.ts +0 -4
  187. package/profiles/server/tsconfig.json +0 -30
package/bin/index.js DELETED
@@ -1,1139 +0,0 @@
1
- #!/usr/bin/env bun
2
- // @bun
3
- var __create = Object.create;
4
- var __getProtoOf = Object.getPrototypeOf;
5
- var __defProp = Object.defineProperty;
6
- var __getOwnPropNames = Object.getOwnPropertyNames;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __toESM = (mod, isNodeMode, target) => {
9
- target = mod != null ? __create(__getProtoOf(mod)) : {};
10
- const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
11
- for (let key of __getOwnPropNames(mod))
12
- if (!__hasOwnProp.call(to, key))
13
- __defProp(to, key, {
14
- get: () => mod[key],
15
- enumerable: true
16
- });
17
- return to;
18
- };
19
- var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
20
-
21
- // ../../node_modules/sisteransi/src/index.js
22
- var require_src = __commonJS((exports, module) => {
23
- var ESC = "\x1B";
24
- var CSI = `${ESC}[`;
25
- var beep = "\x07";
26
- var cursor = {
27
- to(x, y) {
28
- if (!y)
29
- return `${CSI}${x + 1}G`;
30
- return `${CSI}${y + 1};${x + 1}H`;
31
- },
32
- move(x, y) {
33
- let ret = "";
34
- if (x < 0)
35
- ret += `${CSI}${-x}D`;
36
- else if (x > 0)
37
- ret += `${CSI}${x}C`;
38
- if (y < 0)
39
- ret += `${CSI}${-y}A`;
40
- else if (y > 0)
41
- ret += `${CSI}${y}B`;
42
- return ret;
43
- },
44
- up: (count = 1) => `${CSI}${count}A`,
45
- down: (count = 1) => `${CSI}${count}B`,
46
- forward: (count = 1) => `${CSI}${count}C`,
47
- backward: (count = 1) => `${CSI}${count}D`,
48
- nextLine: (count = 1) => `${CSI}E`.repeat(count),
49
- prevLine: (count = 1) => `${CSI}F`.repeat(count),
50
- left: `${CSI}G`,
51
- hide: `${CSI}?25l`,
52
- show: `${CSI}?25h`,
53
- save: `${ESC}7`,
54
- restore: `${ESC}8`
55
- };
56
- var scroll = {
57
- up: (count = 1) => `${CSI}S`.repeat(count),
58
- down: (count = 1) => `${CSI}T`.repeat(count)
59
- };
60
- var erase = {
61
- screen: `${CSI}2J`,
62
- up: (count = 1) => `${CSI}1J`.repeat(count),
63
- down: (count = 1) => `${CSI}J`.repeat(count),
64
- line: `${CSI}2K`,
65
- lineEnd: `${CSI}K`,
66
- lineStart: `${CSI}1K`,
67
- lines(count) {
68
- let clear = "";
69
- for (let i = 0;i < count; i++)
70
- clear += this.line + (i < count - 1 ? cursor.up() : "");
71
- if (count)
72
- clear += cursor.left;
73
- return clear;
74
- }
75
- };
76
- module.exports = { cursor, scroll, erase, beep };
77
- });
78
-
79
- // ../../node_modules/picocolors/picocolors.js
80
- var require_picocolors = __commonJS((exports, module) => {
81
- var p = process || {};
82
- var argv = p.argv || [];
83
- var env = p.env || {};
84
- var isColorSupported = !(!!env.NO_COLOR || argv.includes("--no-color")) && (!!env.FORCE_COLOR || argv.includes("--color") || p.platform === "win32" || (p.stdout || {}).isTTY && env.TERM !== "dumb" || !!env.CI);
85
- var formatter = (open, close, replace = open) => (input) => {
86
- let string = "" + input, index = string.indexOf(close, open.length);
87
- return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;
88
- };
89
- var replaceClose = (string, close, replace, index) => {
90
- let result = "", cursor = 0;
91
- do {
92
- result += string.substring(cursor, index) + replace;
93
- cursor = index + close.length;
94
- index = string.indexOf(close, cursor);
95
- } while (~index);
96
- return result + string.substring(cursor);
97
- };
98
- var createColors = (enabled = isColorSupported) => {
99
- let f = enabled ? formatter : () => String;
100
- return {
101
- isColorSupported: enabled,
102
- reset: f("\x1B[0m", "\x1B[0m"),
103
- bold: f("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m"),
104
- dim: f("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m"),
105
- italic: f("\x1B[3m", "\x1B[23m"),
106
- underline: f("\x1B[4m", "\x1B[24m"),
107
- inverse: f("\x1B[7m", "\x1B[27m"),
108
- hidden: f("\x1B[8m", "\x1B[28m"),
109
- strikethrough: f("\x1B[9m", "\x1B[29m"),
110
- black: f("\x1B[30m", "\x1B[39m"),
111
- red: f("\x1B[31m", "\x1B[39m"),
112
- green: f("\x1B[32m", "\x1B[39m"),
113
- yellow: f("\x1B[33m", "\x1B[39m"),
114
- blue: f("\x1B[34m", "\x1B[39m"),
115
- magenta: f("\x1B[35m", "\x1B[39m"),
116
- cyan: f("\x1B[36m", "\x1B[39m"),
117
- white: f("\x1B[37m", "\x1B[39m"),
118
- gray: f("\x1B[90m", "\x1B[39m"),
119
- bgBlack: f("\x1B[40m", "\x1B[49m"),
120
- bgRed: f("\x1B[41m", "\x1B[49m"),
121
- bgGreen: f("\x1B[42m", "\x1B[49m"),
122
- bgYellow: f("\x1B[43m", "\x1B[49m"),
123
- bgBlue: f("\x1B[44m", "\x1B[49m"),
124
- bgMagenta: f("\x1B[45m", "\x1B[49m"),
125
- bgCyan: f("\x1B[46m", "\x1B[49m"),
126
- bgWhite: f("\x1B[47m", "\x1B[49m"),
127
- blackBright: f("\x1B[90m", "\x1B[39m"),
128
- redBright: f("\x1B[91m", "\x1B[39m"),
129
- greenBright: f("\x1B[92m", "\x1B[39m"),
130
- yellowBright: f("\x1B[93m", "\x1B[39m"),
131
- blueBright: f("\x1B[94m", "\x1B[39m"),
132
- magentaBright: f("\x1B[95m", "\x1B[39m"),
133
- cyanBright: f("\x1B[96m", "\x1B[39m"),
134
- whiteBright: f("\x1B[97m", "\x1B[39m"),
135
- bgBlackBright: f("\x1B[100m", "\x1B[49m"),
136
- bgRedBright: f("\x1B[101m", "\x1B[49m"),
137
- bgGreenBright: f("\x1B[102m", "\x1B[49m"),
138
- bgYellowBright: f("\x1B[103m", "\x1B[49m"),
139
- bgBlueBright: f("\x1B[104m", "\x1B[49m"),
140
- bgMagentaBright: f("\x1B[105m", "\x1B[49m"),
141
- bgCyanBright: f("\x1B[106m", "\x1B[49m"),
142
- bgWhiteBright: f("\x1B[107m", "\x1B[49m")
143
- };
144
- };
145
- module.exports = createColors();
146
- module.exports.createColors = createColors;
147
- });
148
-
149
- // index.ts
150
- import { rm, rename, stat } from "fs/promises";
151
- import { join as join2, relative, basename } from "path";
152
-
153
- // ../../node_modules/@clack/core/dist/index.mjs
154
- var import_sisteransi = __toESM(require_src(), 1);
155
- var import_picocolors = __toESM(require_picocolors(), 1);
156
- import { stdin as $, stdout as k } from "process";
157
- import * as f from "readline";
158
- import _ from "readline";
159
- import { WriteStream as U } from "tty";
160
- function q({ onlyFirst: e = false } = {}) {
161
- const F = ["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))", "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");
162
- return new RegExp(F, e ? undefined : "g");
163
- }
164
- var J = q();
165
- function S(e) {
166
- if (typeof e != "string")
167
- throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);
168
- return e.replace(J, "");
169
- }
170
- function T(e) {
171
- return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
172
- }
173
- var j = { exports: {} };
174
- (function(e) {
175
- var u = {};
176
- e.exports = u, u.eastAsianWidth = function(t) {
177
- var s = t.charCodeAt(0), C = t.length == 2 ? t.charCodeAt(1) : 0, D = s;
178
- return 55296 <= s && s <= 56319 && 56320 <= C && C <= 57343 && (s &= 1023, C &= 1023, D = s << 10 | C, D += 65536), D == 12288 || 65281 <= D && D <= 65376 || 65504 <= D && D <= 65510 ? "F" : D == 8361 || 65377 <= D && D <= 65470 || 65474 <= D && D <= 65479 || 65482 <= D && D <= 65487 || 65490 <= D && D <= 65495 || 65498 <= D && D <= 65500 || 65512 <= D && D <= 65518 ? "H" : 4352 <= D && D <= 4447 || 4515 <= D && D <= 4519 || 4602 <= D && D <= 4607 || 9001 <= D && D <= 9002 || 11904 <= D && D <= 11929 || 11931 <= D && D <= 12019 || 12032 <= D && D <= 12245 || 12272 <= D && D <= 12283 || 12289 <= D && D <= 12350 || 12353 <= D && D <= 12438 || 12441 <= D && D <= 12543 || 12549 <= D && D <= 12589 || 12593 <= D && D <= 12686 || 12688 <= D && D <= 12730 || 12736 <= D && D <= 12771 || 12784 <= D && D <= 12830 || 12832 <= D && D <= 12871 || 12880 <= D && D <= 13054 || 13056 <= D && D <= 19903 || 19968 <= D && D <= 42124 || 42128 <= D && D <= 42182 || 43360 <= D && D <= 43388 || 44032 <= D && D <= 55203 || 55216 <= D && D <= 55238 || 55243 <= D && D <= 55291 || 63744 <= D && D <= 64255 || 65040 <= D && D <= 65049 || 65072 <= D && D <= 65106 || 65108 <= D && D <= 65126 || 65128 <= D && D <= 65131 || 110592 <= D && D <= 110593 || 127488 <= D && D <= 127490 || 127504 <= D && D <= 127546 || 127552 <= D && D <= 127560 || 127568 <= D && D <= 127569 || 131072 <= D && D <= 194367 || 177984 <= D && D <= 196605 || 196608 <= D && D <= 262141 ? "W" : 32 <= D && D <= 126 || 162 <= D && D <= 163 || 165 <= D && D <= 166 || D == 172 || D == 175 || 10214 <= D && D <= 10221 || 10629 <= D && D <= 10630 ? "Na" : D == 161 || D == 164 || 167 <= D && D <= 168 || D == 170 || 173 <= D && D <= 174 || 176 <= D && D <= 180 || 182 <= D && D <= 186 || 188 <= D && D <= 191 || D == 198 || D == 208 || 215 <= D && D <= 216 || 222 <= D && D <= 225 || D == 230 || 232 <= D && D <= 234 || 236 <= D && D <= 237 || D == 240 || 242 <= D && D <= 243 || 247 <= D && D <= 250 || D == 252 || D == 254 || D == 257 || D == 273 || D == 275 || D == 283 || 294 <= D && D <= 295 || D == 299 || 305 <= D && D <= 307 || D == 312 || 319 <= D && D <= 322 || D == 324 || 328 <= D && D <= 331 || D == 333 || 338 <= D && D <= 339 || 358 <= D && D <= 359 || D == 363 || D == 462 || D == 464 || D == 466 || D == 468 || D == 470 || D == 472 || D == 474 || D == 476 || D == 593 || D == 609 || D == 708 || D == 711 || 713 <= D && D <= 715 || D == 717 || D == 720 || 728 <= D && D <= 731 || D == 733 || D == 735 || 768 <= D && D <= 879 || 913 <= D && D <= 929 || 931 <= D && D <= 937 || 945 <= D && D <= 961 || 963 <= D && D <= 969 || D == 1025 || 1040 <= D && D <= 1103 || D == 1105 || D == 8208 || 8211 <= D && D <= 8214 || 8216 <= D && D <= 8217 || 8220 <= D && D <= 8221 || 8224 <= D && D <= 8226 || 8228 <= D && D <= 8231 || D == 8240 || 8242 <= D && D <= 8243 || D == 8245 || D == 8251 || D == 8254 || D == 8308 || D == 8319 || 8321 <= D && D <= 8324 || D == 8364 || D == 8451 || D == 8453 || D == 8457 || D == 8467 || D == 8470 || 8481 <= D && D <= 8482 || D == 8486 || D == 8491 || 8531 <= D && D <= 8532 || 8539 <= D && D <= 8542 || 8544 <= D && D <= 8555 || 8560 <= D && D <= 8569 || D == 8585 || 8592 <= D && D <= 8601 || 8632 <= D && D <= 8633 || D == 8658 || D == 8660 || D == 8679 || D == 8704 || 8706 <= D && D <= 8707 || 8711 <= D && D <= 8712 || D == 8715 || D == 8719 || D == 8721 || D == 8725 || D == 8730 || 8733 <= D && D <= 8736 || D == 8739 || D == 8741 || 8743 <= D && D <= 8748 || D == 8750 || 8756 <= D && D <= 8759 || 8764 <= D && D <= 8765 || D == 8776 || D == 8780 || D == 8786 || 8800 <= D && D <= 8801 || 8804 <= D && D <= 8807 || 8810 <= D && D <= 8811 || 8814 <= D && D <= 8815 || 8834 <= D && D <= 8835 || 8838 <= D && D <= 8839 || D == 8853 || D == 8857 || D == 8869 || D == 8895 || D == 8978 || 9312 <= D && D <= 9449 || 9451 <= D && D <= 9547 || 9552 <= D && D <= 9587 || 9600 <= D && D <= 9615 || 9618 <= D && D <= 9621 || 9632 <= D && D <= 9633 || 9635 <= D && D <= 9641 || 9650 <= D && D <= 9651 || 9654 <= D && D <= 9655 || 9660 <= D && D <= 9661 || 9664 <= D && D <= 9665 || 9670 <= D && D <= 9672 || D == 9675 || 9678 <= D && D <= 9681 || 9698 <= D && D <= 9701 || D == 9711 || 9733 <= D && D <= 9734 || D == 9737 || 9742 <= D && D <= 9743 || 9748 <= D && D <= 9749 || D == 9756 || D == 9758 || D == 9792 || D == 9794 || 9824 <= D && D <= 9825 || 9827 <= D && D <= 9829 || 9831 <= D && D <= 9834 || 9836 <= D && D <= 9837 || D == 9839 || 9886 <= D && D <= 9887 || 9918 <= D && D <= 9919 || 9924 <= D && D <= 9933 || 9935 <= D && D <= 9953 || D == 9955 || 9960 <= D && D <= 9983 || D == 10045 || D == 10071 || 10102 <= D && D <= 10111 || 11093 <= D && D <= 11097 || 12872 <= D && D <= 12879 || 57344 <= D && D <= 63743 || 65024 <= D && D <= 65039 || D == 65533 || 127232 <= D && D <= 127242 || 127248 <= D && D <= 127277 || 127280 <= D && D <= 127337 || 127344 <= D && D <= 127386 || 917760 <= D && D <= 917999 || 983040 <= D && D <= 1048573 || 1048576 <= D && D <= 1114109 ? "A" : "N";
179
- }, u.characterLength = function(t) {
180
- var s = this.eastAsianWidth(t);
181
- return s == "F" || s == "W" || s == "A" ? 2 : 1;
182
- };
183
- function F(t) {
184
- return t.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g) || [];
185
- }
186
- u.length = function(t) {
187
- for (var s = F(t), C = 0, D = 0;D < s.length; D++)
188
- C = C + this.characterLength(s[D]);
189
- return C;
190
- }, u.slice = function(t, s, C) {
191
- textLen = u.length(t), s = s || 0, C = C || 1, s < 0 && (s = textLen + s), C < 0 && (C = textLen + C);
192
- for (var D = "", i = 0, n = F(t), E = 0;E < n.length; E++) {
193
- var h = n[E], o = u.length(h);
194
- if (i >= s - (o == 2 ? 1 : 0))
195
- if (i + o <= C)
196
- D += h;
197
- else
198
- break;
199
- i += o;
200
- }
201
- return D;
202
- };
203
- })(j);
204
- var Q = j.exports;
205
- var X = T(Q);
206
- var DD = function() {
207
- return /\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g;
208
- };
209
- var uD = T(DD);
210
- function A(e, u = {}) {
211
- if (typeof e != "string" || e.length === 0 || (u = { ambiguousIsNarrow: true, ...u }, e = S(e), e.length === 0))
212
- return 0;
213
- e = e.replace(uD(), " ");
214
- const F = u.ambiguousIsNarrow ? 1 : 2;
215
- let t = 0;
216
- for (const s of e) {
217
- const C = s.codePointAt(0);
218
- if (C <= 31 || C >= 127 && C <= 159 || C >= 768 && C <= 879)
219
- continue;
220
- switch (X.eastAsianWidth(s)) {
221
- case "F":
222
- case "W":
223
- t += 2;
224
- break;
225
- case "A":
226
- t += F;
227
- break;
228
- default:
229
- t += 1;
230
- }
231
- }
232
- return t;
233
- }
234
- var d = 10;
235
- var M = (e = 0) => (u) => `\x1B[${u + e}m`;
236
- var P = (e = 0) => (u) => `\x1B[${38 + e};5;${u}m`;
237
- var W = (e = 0) => (u, F, t) => `\x1B[${38 + e};2;${u};${F};${t}m`;
238
- var r = { modifier: { reset: [0, 0], bold: [1, 22], dim: [2, 22], italic: [3, 23], underline: [4, 24], overline: [53, 55], inverse: [7, 27], hidden: [8, 28], strikethrough: [9, 29] }, color: { black: [30, 39], red: [31, 39], green: [32, 39], yellow: [33, 39], blue: [34, 39], magenta: [35, 39], cyan: [36, 39], white: [37, 39], blackBright: [90, 39], gray: [90, 39], grey: [90, 39], redBright: [91, 39], greenBright: [92, 39], yellowBright: [93, 39], blueBright: [94, 39], magentaBright: [95, 39], cyanBright: [96, 39], whiteBright: [97, 39] }, bgColor: { bgBlack: [40, 49], bgRed: [41, 49], bgGreen: [42, 49], bgYellow: [43, 49], bgBlue: [44, 49], bgMagenta: [45, 49], bgCyan: [46, 49], bgWhite: [47, 49], bgBlackBright: [100, 49], bgGray: [100, 49], bgGrey: [100, 49], bgRedBright: [101, 49], bgGreenBright: [102, 49], bgYellowBright: [103, 49], bgBlueBright: [104, 49], bgMagentaBright: [105, 49], bgCyanBright: [106, 49], bgWhiteBright: [107, 49] } };
239
- Object.keys(r.modifier);
240
- var FD = Object.keys(r.color);
241
- var eD = Object.keys(r.bgColor);
242
- [...FD, ...eD];
243
- function tD() {
244
- const e = new Map;
245
- for (const [u, F] of Object.entries(r)) {
246
- for (const [t, s] of Object.entries(F))
247
- r[t] = { open: `\x1B[${s[0]}m`, close: `\x1B[${s[1]}m` }, F[t] = r[t], e.set(s[0], s[1]);
248
- Object.defineProperty(r, u, { value: F, enumerable: false });
249
- }
250
- return Object.defineProperty(r, "codes", { value: e, enumerable: false }), r.color.close = "\x1B[39m", r.bgColor.close = "\x1B[49m", r.color.ansi = M(), r.color.ansi256 = P(), r.color.ansi16m = W(), r.bgColor.ansi = M(d), r.bgColor.ansi256 = P(d), r.bgColor.ansi16m = W(d), Object.defineProperties(r, { rgbToAnsi256: { value: (u, F, t) => u === F && F === t ? u < 8 ? 16 : u > 248 ? 231 : Math.round((u - 8) / 247 * 24) + 232 : 16 + 36 * Math.round(u / 255 * 5) + 6 * Math.round(F / 255 * 5) + Math.round(t / 255 * 5), enumerable: false }, hexToRgb: { value: (u) => {
251
- const F = /[a-f\d]{6}|[a-f\d]{3}/i.exec(u.toString(16));
252
- if (!F)
253
- return [0, 0, 0];
254
- let [t] = F;
255
- t.length === 3 && (t = [...t].map((C) => C + C).join(""));
256
- const s = Number.parseInt(t, 16);
257
- return [s >> 16 & 255, s >> 8 & 255, s & 255];
258
- }, enumerable: false }, hexToAnsi256: { value: (u) => r.rgbToAnsi256(...r.hexToRgb(u)), enumerable: false }, ansi256ToAnsi: { value: (u) => {
259
- if (u < 8)
260
- return 30 + u;
261
- if (u < 16)
262
- return 90 + (u - 8);
263
- let F, t, s;
264
- if (u >= 232)
265
- F = ((u - 232) * 10 + 8) / 255, t = F, s = F;
266
- else {
267
- u -= 16;
268
- const i = u % 36;
269
- F = Math.floor(u / 36) / 5, t = Math.floor(i / 6) / 5, s = i % 6 / 5;
270
- }
271
- const C = Math.max(F, t, s) * 2;
272
- if (C === 0)
273
- return 30;
274
- let D = 30 + (Math.round(s) << 2 | Math.round(t) << 1 | Math.round(F));
275
- return C === 2 && (D += 60), D;
276
- }, enumerable: false }, rgbToAnsi: { value: (u, F, t) => r.ansi256ToAnsi(r.rgbToAnsi256(u, F, t)), enumerable: false }, hexToAnsi: { value: (u) => r.ansi256ToAnsi(r.hexToAnsi256(u)), enumerable: false } }), r;
277
- }
278
- var sD = tD();
279
- var g = new Set(["\x1B", "\x9B"]);
280
- var CD = 39;
281
- var b = "\x07";
282
- var O = "[";
283
- var iD = "]";
284
- var I = "m";
285
- var w = `${iD}8;;`;
286
- var N = (e) => `${g.values().next().value}${O}${e}${I}`;
287
- var L = (e) => `${g.values().next().value}${w}${e}${b}`;
288
- var rD = (e) => e.split(" ").map((u) => A(u));
289
- var y = (e, u, F) => {
290
- const t = [...u];
291
- let s = false, C = false, D = A(S(e[e.length - 1]));
292
- for (const [i, n] of t.entries()) {
293
- const E = A(n);
294
- if (D + E <= F ? e[e.length - 1] += n : (e.push(n), D = 0), g.has(n) && (s = true, C = t.slice(i + 1).join("").startsWith(w)), s) {
295
- C ? n === b && (s = false, C = false) : n === I && (s = false);
296
- continue;
297
- }
298
- D += E, D === F && i < t.length - 1 && (e.push(""), D = 0);
299
- }
300
- !D && e[e.length - 1].length > 0 && e.length > 1 && (e[e.length - 2] += e.pop());
301
- };
302
- var ED = (e) => {
303
- const u = e.split(" ");
304
- let F = u.length;
305
- for (;F > 0 && !(A(u[F - 1]) > 0); )
306
- F--;
307
- return F === u.length ? e : u.slice(0, F).join(" ") + u.slice(F).join("");
308
- };
309
- var oD = (e, u, F = {}) => {
310
- if (F.trim !== false && e.trim() === "")
311
- return "";
312
- let t = "", s, C;
313
- const D = rD(e);
314
- let i = [""];
315
- for (const [E, h] of e.split(" ").entries()) {
316
- F.trim !== false && (i[i.length - 1] = i[i.length - 1].trimStart());
317
- let o = A(i[i.length - 1]);
318
- if (E !== 0 && (o >= u && (F.wordWrap === false || F.trim === false) && (i.push(""), o = 0), (o > 0 || F.trim === false) && (i[i.length - 1] += " ", o++)), F.hard && D[E] > u) {
319
- const B = u - o, p = 1 + Math.floor((D[E] - B - 1) / u);
320
- Math.floor((D[E] - 1) / u) < p && i.push(""), y(i, h, u);
321
- continue;
322
- }
323
- if (o + D[E] > u && o > 0 && D[E] > 0) {
324
- if (F.wordWrap === false && o < u) {
325
- y(i, h, u);
326
- continue;
327
- }
328
- i.push("");
329
- }
330
- if (o + D[E] > u && F.wordWrap === false) {
331
- y(i, h, u);
332
- continue;
333
- }
334
- i[i.length - 1] += h;
335
- }
336
- F.trim !== false && (i = i.map((E) => ED(E)));
337
- const n = [...i.join(`
338
- `)];
339
- for (const [E, h] of n.entries()) {
340
- if (t += h, g.has(h)) {
341
- const { groups: B } = new RegExp(`(?:\\${O}(?<code>\\d+)m|\\${w}(?<uri>.*)${b})`).exec(n.slice(E).join("")) || { groups: {} };
342
- if (B.code !== undefined) {
343
- const p = Number.parseFloat(B.code);
344
- s = p === CD ? undefined : p;
345
- } else
346
- B.uri !== undefined && (C = B.uri.length === 0 ? undefined : B.uri);
347
- }
348
- const o = sD.codes.get(Number(s));
349
- n[E + 1] === `
350
- ` ? (C && (t += L("")), s && o && (t += N(o))) : h === `
351
- ` && (s && o && (t += N(s)), C && (t += L(C)));
352
- }
353
- return t;
354
- };
355
- function R(e, u, F) {
356
- return String(e).normalize().replace(/\r\n/g, `
357
- `).split(`
358
- `).map((t) => oD(t, u, F)).join(`
359
- `);
360
- }
361
- var nD = Object.defineProperty;
362
- var aD = (e, u, F) => (u in e) ? nD(e, u, { enumerable: true, configurable: true, writable: true, value: F }) : e[u] = F;
363
- var a = (e, u, F) => (aD(e, typeof u != "symbol" ? u + "" : u, F), F);
364
- function hD(e, u) {
365
- if (e === u)
366
- return;
367
- const F = e.split(`
368
- `), t = u.split(`
369
- `), s = [];
370
- for (let C = 0;C < Math.max(F.length, t.length); C++)
371
- F[C] !== t[C] && s.push(C);
372
- return s;
373
- }
374
- var V = Symbol("clack:cancel");
375
- function lD(e) {
376
- return e === V;
377
- }
378
- function v(e, u) {
379
- e.isTTY && e.setRawMode(u);
380
- }
381
- var z = new Map([["k", "up"], ["j", "down"], ["h", "left"], ["l", "right"]]);
382
- var xD = new Set(["up", "down", "left", "right", "space", "enter"]);
383
-
384
- class x {
385
- constructor({ render: u, input: F = $, output: t = k, ...s }, C = true) {
386
- a(this, "input"), a(this, "output"), a(this, "rl"), a(this, "opts"), a(this, "_track", false), a(this, "_render"), a(this, "_cursor", 0), a(this, "state", "initial"), a(this, "value"), a(this, "error", ""), a(this, "subscribers", new Map), a(this, "_prevFrame", ""), this.opts = s, this.onKeypress = this.onKeypress.bind(this), this.close = this.close.bind(this), this.render = this.render.bind(this), this._render = u.bind(this), this._track = C, this.input = F, this.output = t;
387
- }
388
- prompt() {
389
- const u = new U(0);
390
- return u._write = (F, t, s) => {
391
- this._track && (this.value = this.rl.line.replace(/\t/g, ""), this._cursor = this.rl.cursor, this.emit("value", this.value)), s();
392
- }, this.input.pipe(u), this.rl = _.createInterface({ input: this.input, output: u, tabSize: 2, prompt: "", escapeCodeTimeout: 50 }), _.emitKeypressEvents(this.input, this.rl), this.rl.prompt(), this.opts.initialValue !== undefined && this._track && this.rl.write(this.opts.initialValue), this.input.on("keypress", this.onKeypress), v(this.input, true), this.output.on("resize", this.render), this.render(), new Promise((F, t) => {
393
- this.once("submit", () => {
394
- this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), v(this.input, false), F(this.value);
395
- }), this.once("cancel", () => {
396
- this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), v(this.input, false), F(V);
397
- });
398
- });
399
- }
400
- on(u, F) {
401
- const t = this.subscribers.get(u) ?? [];
402
- t.push({ cb: F }), this.subscribers.set(u, t);
403
- }
404
- once(u, F) {
405
- const t = this.subscribers.get(u) ?? [];
406
- t.push({ cb: F, once: true }), this.subscribers.set(u, t);
407
- }
408
- emit(u, ...F) {
409
- const t = this.subscribers.get(u) ?? [], s = [];
410
- for (const C of t)
411
- C.cb(...F), C.once && s.push(() => t.splice(t.indexOf(C), 1));
412
- for (const C of s)
413
- C();
414
- }
415
- unsubscribe() {
416
- this.subscribers.clear();
417
- }
418
- onKeypress(u, F) {
419
- if (this.state === "error" && (this.state = "active"), F?.name && !this._track && z.has(F.name) && this.emit("cursor", z.get(F.name)), F?.name && xD.has(F.name) && this.emit("cursor", F.name), u && (u.toLowerCase() === "y" || u.toLowerCase() === "n") && this.emit("confirm", u.toLowerCase() === "y"), u === "\t" && this.opts.placeholder && (this.value || (this.rl.write(this.opts.placeholder), this.emit("value", this.opts.placeholder))), u && this.emit("key", u.toLowerCase()), F?.name === "return") {
420
- if (this.opts.validate) {
421
- const t = this.opts.validate(this.value);
422
- t && (this.error = t, this.state = "error", this.rl.write(this.value));
423
- }
424
- this.state !== "error" && (this.state = "submit");
425
- }
426
- u === "\x03" && (this.state = "cancel"), (this.state === "submit" || this.state === "cancel") && this.emit("finalize"), this.render(), (this.state === "submit" || this.state === "cancel") && this.close();
427
- }
428
- close() {
429
- this.input.unpipe(), this.input.removeListener("keypress", this.onKeypress), this.output.write(`
430
- `), v(this.input, false), this.rl.close(), this.emit(`${this.state}`, this.value), this.unsubscribe();
431
- }
432
- restoreCursor() {
433
- const u = R(this._prevFrame, process.stdout.columns, { hard: true }).split(`
434
- `).length - 1;
435
- this.output.write(import_sisteransi.cursor.move(-999, u * -1));
436
- }
437
- render() {
438
- const u = R(this._render(this) ?? "", process.stdout.columns, { hard: true });
439
- if (u !== this._prevFrame) {
440
- if (this.state === "initial")
441
- this.output.write(import_sisteransi.cursor.hide);
442
- else {
443
- const F = hD(this._prevFrame, u);
444
- if (this.restoreCursor(), F && F?.length === 1) {
445
- const t = F[0];
446
- this.output.write(import_sisteransi.cursor.move(0, t)), this.output.write(import_sisteransi.erase.lines(1));
447
- const s = u.split(`
448
- `);
449
- this.output.write(s[t]), this._prevFrame = u, this.output.write(import_sisteransi.cursor.move(0, s.length - t - 1));
450
- return;
451
- } else if (F && F?.length > 1) {
452
- const t = F[0];
453
- this.output.write(import_sisteransi.cursor.move(0, t)), this.output.write(import_sisteransi.erase.down());
454
- const s = u.split(`
455
- `).slice(t);
456
- this.output.write(s.join(`
457
- `)), this._prevFrame = u;
458
- return;
459
- }
460
- this.output.write(import_sisteransi.erase.down());
461
- }
462
- this.output.write(u), this.state === "initial" && (this.state = "active"), this._prevFrame = u;
463
- }
464
- }
465
- }
466
- var fD = Object.defineProperty;
467
- var gD = (e, u, F) => (u in e) ? fD(e, u, { enumerable: true, configurable: true, writable: true, value: F }) : e[u] = F;
468
- var K = (e, u, F) => (gD(e, typeof u != "symbol" ? u + "" : u, F), F);
469
- var vD = class extends x {
470
- constructor(u) {
471
- super(u, false), K(this, "options"), K(this, "cursor", 0), this.options = u.options, this.value = [...u.initialValues ?? []], this.cursor = Math.max(this.options.findIndex(({ value: F }) => F === u.cursorAt), 0), this.on("key", (F) => {
472
- F === "a" && this.toggleAll();
473
- }), this.on("cursor", (F) => {
474
- switch (F) {
475
- case "left":
476
- case "up":
477
- this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1;
478
- break;
479
- case "down":
480
- case "right":
481
- this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;
482
- break;
483
- case "space":
484
- this.toggleValue();
485
- break;
486
- }
487
- });
488
- }
489
- get _value() {
490
- return this.options[this.cursor].value;
491
- }
492
- toggleAll() {
493
- const u = this.value.length === this.options.length;
494
- this.value = u ? [] : this.options.map((F) => F.value);
495
- }
496
- toggleValue() {
497
- const u = this.value.includes(this._value);
498
- this.value = u ? this.value.filter((F) => F !== this._value) : [...this.value, this._value];
499
- }
500
- };
501
- var wD = Object.defineProperty;
502
- var yD = (e, u, F) => (u in e) ? wD(e, u, { enumerable: true, configurable: true, writable: true, value: F }) : e[u] = F;
503
- var Z = (e, u, F) => (yD(e, typeof u != "symbol" ? u + "" : u, F), F);
504
- var $D = class extends x {
505
- constructor(u) {
506
- super(u, false), Z(this, "options"), Z(this, "cursor", 0), this.options = u.options, this.cursor = this.options.findIndex(({ value: F }) => F === u.initialValue), this.cursor === -1 && (this.cursor = 0), this.changeValue(), this.on("cursor", (F) => {
507
- switch (F) {
508
- case "left":
509
- case "up":
510
- this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1;
511
- break;
512
- case "down":
513
- case "right":
514
- this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;
515
- break;
516
- }
517
- this.changeValue();
518
- });
519
- }
520
- get _value() {
521
- return this.options[this.cursor];
522
- }
523
- changeValue() {
524
- this.value = this._value.value;
525
- }
526
- };
527
- var TD = Object.defineProperty;
528
- var jD = (e, u, F) => (u in e) ? TD(e, u, { enumerable: true, configurable: true, writable: true, value: F }) : e[u] = F;
529
- var MD = (e, u, F) => (jD(e, typeof u != "symbol" ? u + "" : u, F), F);
530
-
531
- class PD extends x {
532
- constructor(u) {
533
- super(u), MD(this, "valueWithCursor", ""), this.on("finalize", () => {
534
- this.value || (this.value = u.defaultValue), this.valueWithCursor = this.value;
535
- }), this.on("value", () => {
536
- if (this.cursor >= this.value.length)
537
- this.valueWithCursor = `${this.value}${import_picocolors.default.inverse(import_picocolors.default.hidden("_"))}`;
538
- else {
539
- const F = this.value.slice(0, this.cursor), t = this.value.slice(this.cursor);
540
- this.valueWithCursor = `${F}${import_picocolors.default.inverse(t[0])}${t.slice(1)}`;
541
- }
542
- });
543
- }
544
- get cursor() {
545
- return this._cursor;
546
- }
547
- }
548
- var WD = globalThis.process.platform.startsWith("win");
549
- function OD({ input: e = $, output: u = k, overwrite: F = true, hideCursor: t = true } = {}) {
550
- const s = f.createInterface({ input: e, output: u, prompt: "", tabSize: 1 });
551
- f.emitKeypressEvents(e, s), e.isTTY && e.setRawMode(true);
552
- const C = (D, { name: i }) => {
553
- if (String(D) === "\x03") {
554
- t && u.write(import_sisteransi.cursor.show), process.exit(0);
555
- return;
556
- }
557
- if (!F)
558
- return;
559
- let n = i === "return" ? 0 : -1, E = i === "return" ? -1 : 0;
560
- f.moveCursor(u, n, E, () => {
561
- f.clearLine(u, 1, () => {
562
- e.once("keypress", C);
563
- });
564
- });
565
- };
566
- return t && u.write(import_sisteransi.cursor.hide), e.once("keypress", C), () => {
567
- e.off("keypress", C), t && u.write(import_sisteransi.cursor.show), e.isTTY && !WD && e.setRawMode(false), s.terminal = false, s.close();
568
- };
569
- }
570
-
571
- // ../../node_modules/@clack/prompts/dist/index.mjs
572
- var import_picocolors2 = __toESM(require_picocolors(), 1);
573
- var import_sisteransi2 = __toESM(require_src(), 1);
574
- import h from "process";
575
- function K2() {
576
- return h.platform !== "win32" ? h.env.TERM !== "linux" : !!h.env.CI || !!h.env.WT_SESSION || !!h.env.TERMINUS_SUBLIME || h.env.ConEmuTask === "{cmd::Cmder}" || h.env.TERM_PROGRAM === "Terminus-Sublime" || h.env.TERM_PROGRAM === "vscode" || h.env.TERM === "xterm-256color" || h.env.TERM === "alacritty" || h.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
577
- }
578
- var C = K2();
579
- var u = (s, n) => C ? s : n;
580
- var Y = u("\u25C6", "*");
581
- var P2 = u("\u25A0", "x");
582
- var V2 = u("\u25B2", "x");
583
- var M2 = u("\u25C7", "o");
584
- var Q2 = u("\u250C", "T");
585
- var a2 = u("\u2502", "|");
586
- var $2 = u("\u2514", "\u2014");
587
- var I2 = u("\u25CF", ">");
588
- var T2 = u("\u25CB", " ");
589
- var j2 = u("\u25FB", "[\u2022]");
590
- var b2 = u("\u25FC", "[+]");
591
- var B = u("\u25FB", "[ ]");
592
- var X2 = u("\u25AA", "\u2022");
593
- var G = u("\u2500", "-");
594
- var H = u("\u256E", "+");
595
- var ee = u("\u251C", "+");
596
- var te = u("\u256F", "+");
597
- var se = u("\u25CF", "\u2022");
598
- var re = u("\u25C6", "*");
599
- var ie = u("\u25B2", "!");
600
- var ne = u("\u25A0", "x");
601
- var y2 = (s) => {
602
- switch (s) {
603
- case "initial":
604
- case "active":
605
- return import_picocolors2.default.cyan(Y);
606
- case "cancel":
607
- return import_picocolors2.default.red(P2);
608
- case "error":
609
- return import_picocolors2.default.yellow(V2);
610
- case "submit":
611
- return import_picocolors2.default.green(M2);
612
- }
613
- };
614
- var E = (s) => {
615
- const { cursor: n, options: t, style: i } = s, r2 = s.maxItems ?? 1 / 0, o = Math.max(process.stdout.rows - 4, 0), c2 = Math.min(o, Math.max(r2, 5));
616
- let l2 = 0;
617
- n >= l2 + c2 - 3 ? l2 = Math.max(Math.min(n - c2 + 3, t.length - c2), 0) : n < l2 + 2 && (l2 = Math.max(n - 2, 0));
618
- const d2 = c2 < t.length && l2 > 0, p = c2 < t.length && l2 + c2 < t.length;
619
- return t.slice(l2, l2 + c2).map((S2, f2, x2) => {
620
- const g2 = f2 === 0 && d2, m2 = f2 === x2.length - 1 && p;
621
- return g2 || m2 ? import_picocolors2.default.dim("...") : i(S2, f2 + l2 === n);
622
- });
623
- };
624
- var ae = (s) => new PD({ validate: s.validate, placeholder: s.placeholder, defaultValue: s.defaultValue, initialValue: s.initialValue, render() {
625
- const n = `${import_picocolors2.default.gray(a2)}
626
- ${y2(this.state)} ${s.message}
627
- `, t = s.placeholder ? import_picocolors2.default.inverse(s.placeholder[0]) + import_picocolors2.default.dim(s.placeholder.slice(1)) : import_picocolors2.default.inverse(import_picocolors2.default.hidden("_")), i = this.value ? this.valueWithCursor : t;
628
- switch (this.state) {
629
- case "error":
630
- return `${n.trim()}
631
- ${import_picocolors2.default.yellow(a2)} ${i}
632
- ${import_picocolors2.default.yellow($2)} ${import_picocolors2.default.yellow(this.error)}
633
- `;
634
- case "submit":
635
- return `${n}${import_picocolors2.default.gray(a2)} ${import_picocolors2.default.dim(this.value || s.placeholder)}`;
636
- case "cancel":
637
- return `${n}${import_picocolors2.default.gray(a2)} ${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(this.value ?? ""))}${this.value?.trim() ? `
638
- ` + import_picocolors2.default.gray(a2) : ""}`;
639
- default:
640
- return `${n}${import_picocolors2.default.cyan(a2)} ${i}
641
- ${import_picocolors2.default.cyan($2)}
642
- `;
643
- }
644
- } }).prompt();
645
- var le = (s) => {
646
- const n = (t, i) => {
647
- const r2 = t.label ?? String(t.value);
648
- switch (i) {
649
- case "selected":
650
- return `${import_picocolors2.default.dim(r2)}`;
651
- case "active":
652
- return `${import_picocolors2.default.green(I2)} ${r2} ${t.hint ? import_picocolors2.default.dim(`(${t.hint})`) : ""}`;
653
- case "cancelled":
654
- return `${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(r2))}`;
655
- default:
656
- return `${import_picocolors2.default.dim(T2)} ${import_picocolors2.default.dim(r2)}`;
657
- }
658
- };
659
- return new $D({ options: s.options, initialValue: s.initialValue, render() {
660
- const t = `${import_picocolors2.default.gray(a2)}
661
- ${y2(this.state)} ${s.message}
662
- `;
663
- switch (this.state) {
664
- case "submit":
665
- return `${t}${import_picocolors2.default.gray(a2)} ${n(this.options[this.cursor], "selected")}`;
666
- case "cancel":
667
- return `${t}${import_picocolors2.default.gray(a2)} ${n(this.options[this.cursor], "cancelled")}
668
- ${import_picocolors2.default.gray(a2)}`;
669
- default:
670
- return `${t}${import_picocolors2.default.cyan(a2)} ${E({ cursor: this.cursor, options: this.options, maxItems: s.maxItems, style: (i, r2) => n(i, r2 ? "active" : "inactive") }).join(`
671
- ${import_picocolors2.default.cyan(a2)} `)}
672
- ${import_picocolors2.default.cyan($2)}
673
- `;
674
- }
675
- } }).prompt();
676
- };
677
- var $e = (s) => {
678
- const n = (t, i) => {
679
- const r2 = t.label ?? String(t.value);
680
- return i === "active" ? `${import_picocolors2.default.cyan(j2)} ${r2} ${t.hint ? import_picocolors2.default.dim(`(${t.hint})`) : ""}` : i === "selected" ? `${import_picocolors2.default.green(b2)} ${import_picocolors2.default.dim(r2)}` : i === "cancelled" ? `${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(r2))}` : i === "active-selected" ? `${import_picocolors2.default.green(b2)} ${r2} ${t.hint ? import_picocolors2.default.dim(`(${t.hint})`) : ""}` : i === "submitted" ? `${import_picocolors2.default.dim(r2)}` : `${import_picocolors2.default.dim(B)} ${import_picocolors2.default.dim(r2)}`;
681
- };
682
- return new vD({ options: s.options, initialValues: s.initialValues, required: s.required ?? true, cursorAt: s.cursorAt, validate(t) {
683
- if (this.required && t.length === 0)
684
- return `Please select at least one option.
685
- ${import_picocolors2.default.reset(import_picocolors2.default.dim(`Press ${import_picocolors2.default.gray(import_picocolors2.default.bgWhite(import_picocolors2.default.inverse(" space ")))} to select, ${import_picocolors2.default.gray(import_picocolors2.default.bgWhite(import_picocolors2.default.inverse(" enter ")))} to submit`))}`;
686
- }, render() {
687
- let t = `${import_picocolors2.default.gray(a2)}
688
- ${y2(this.state)} ${s.message}
689
- `;
690
- const i = (r2, o) => {
691
- const c2 = this.value.includes(r2.value);
692
- return o && c2 ? n(r2, "active-selected") : c2 ? n(r2, "selected") : n(r2, o ? "active" : "inactive");
693
- };
694
- switch (this.state) {
695
- case "submit":
696
- return `${t}${import_picocolors2.default.gray(a2)} ${this.options.filter(({ value: r2 }) => this.value.includes(r2)).map((r2) => n(r2, "submitted")).join(import_picocolors2.default.dim(", ")) || import_picocolors2.default.dim("none")}`;
697
- case "cancel": {
698
- const r2 = this.options.filter(({ value: o }) => this.value.includes(o)).map((o) => n(o, "cancelled")).join(import_picocolors2.default.dim(", "));
699
- return `${t}${import_picocolors2.default.gray(a2)} ${r2.trim() ? `${r2}
700
- ${import_picocolors2.default.gray(a2)}` : ""}`;
701
- }
702
- case "error": {
703
- const r2 = this.error.split(`
704
- `).map((o, c2) => c2 === 0 ? `${import_picocolors2.default.yellow($2)} ${import_picocolors2.default.yellow(o)}` : ` ${o}`).join(`
705
- `);
706
- return t + import_picocolors2.default.yellow(a2) + " " + E({ options: this.options, cursor: this.cursor, maxItems: s.maxItems, style: i }).join(`
707
- ${import_picocolors2.default.yellow(a2)} `) + `
708
- ` + r2 + `
709
- `;
710
- }
711
- default:
712
- return `${t}${import_picocolors2.default.cyan(a2)} ${E({ options: this.options, cursor: this.cursor, maxItems: s.maxItems, style: i }).join(`
713
- ${import_picocolors2.default.cyan(a2)} `)}
714
- ${import_picocolors2.default.cyan($2)}
715
- `;
716
- }
717
- } }).prompt();
718
- };
719
- var he = (s = "") => {
720
- process.stdout.write(`${import_picocolors2.default.gray($2)} ${import_picocolors2.default.red(s)}
721
-
722
- `);
723
- };
724
- var ge = (s = "") => {
725
- process.stdout.write(`${import_picocolors2.default.gray(a2)}
726
- ${import_picocolors2.default.gray($2)} ${s}
727
-
728
- `);
729
- };
730
- var v2 = { message: (s = "", { symbol: n = import_picocolors2.default.gray(a2) } = {}) => {
731
- const t = [`${import_picocolors2.default.gray(a2)}`];
732
- if (s) {
733
- const [i, ...r2] = s.split(`
734
- `);
735
- t.push(`${n} ${i}`, ...r2.map((o) => `${import_picocolors2.default.gray(a2)} ${o}`));
736
- }
737
- process.stdout.write(`${t.join(`
738
- `)}
739
- `);
740
- }, info: (s) => {
741
- v2.message(s, { symbol: import_picocolors2.default.blue(se) });
742
- }, success: (s) => {
743
- v2.message(s, { symbol: import_picocolors2.default.green(re) });
744
- }, step: (s) => {
745
- v2.message(s, { symbol: import_picocolors2.default.green(M2) });
746
- }, warn: (s) => {
747
- v2.message(s, { symbol: import_picocolors2.default.yellow(ie) });
748
- }, warning: (s) => {
749
- v2.warn(s);
750
- }, error: (s) => {
751
- v2.message(s, { symbol: import_picocolors2.default.red(ne) });
752
- } };
753
- var _2 = () => {
754
- const s = C ? ["\u25D2", "\u25D0", "\u25D3", "\u25D1"] : ["\u2022", "o", "O", "0"], n = C ? 80 : 120;
755
- let t, i, r2 = false, o = "";
756
- const c2 = (g2) => {
757
- const m2 = g2 > 1 ? "Something went wrong" : "Canceled";
758
- r2 && x2(m2, g2);
759
- }, l2 = () => c2(2), d2 = () => c2(1), p = () => {
760
- process.on("uncaughtExceptionMonitor", l2), process.on("unhandledRejection", l2), process.on("SIGINT", d2), process.on("SIGTERM", d2), process.on("exit", c2);
761
- }, S2 = () => {
762
- process.removeListener("uncaughtExceptionMonitor", l2), process.removeListener("unhandledRejection", l2), process.removeListener("SIGINT", d2), process.removeListener("SIGTERM", d2), process.removeListener("exit", c2);
763
- }, f2 = (g2 = "") => {
764
- r2 = true, t = OD(), o = g2.replace(/\.+$/, ""), process.stdout.write(`${import_picocolors2.default.gray(a2)}
765
- `);
766
- let m2 = 0, w2 = 0;
767
- p(), i = setInterval(() => {
768
- const L2 = import_picocolors2.default.magenta(s[m2]), O2 = ".".repeat(Math.floor(w2)).slice(0, 3);
769
- process.stdout.write(import_sisteransi2.cursor.move(-999, 0)), process.stdout.write(import_sisteransi2.erase.down(1)), process.stdout.write(`${L2} ${o}${O2}`), m2 = m2 + 1 < s.length ? m2 + 1 : 0, w2 = w2 < s.length ? w2 + 0.125 : 0;
770
- }, n);
771
- }, x2 = (g2 = "", m2 = 0) => {
772
- o = g2 ?? o, r2 = false, clearInterval(i);
773
- const w2 = m2 === 0 ? import_picocolors2.default.green(M2) : m2 === 1 ? import_picocolors2.default.red(P2) : import_picocolors2.default.red(V2);
774
- process.stdout.write(import_sisteransi2.cursor.move(-999, 0)), process.stdout.write(import_sisteransi2.erase.down(1)), process.stdout.write(`${w2} ${o}
775
- `), S2(), t();
776
- };
777
- return { start: f2, stop: x2, message: (g2 = "") => {
778
- o = g2 ?? o;
779
- } };
780
- };
781
-
782
- // index.ts
783
- var import_picocolors3 = __toESM(require_picocolors(), 1);
784
-
785
- // utils.ts
786
- import { mkdir, readdir } from "fs/promises";
787
- import { join } from "path";
788
- function transformPackageJson(pkg, projectName, extraPackages = {}, useWorkspace = false) {
789
- const out = { ...pkg };
790
- out.name = projectName;
791
- out.private = true;
792
- delete out.workspaces;
793
- const deps = out.dependencies || {};
794
- const next = {};
795
- for (const [k3, v3] of Object.entries(deps)) {
796
- const isFlow = k3.startsWith("@flow.os/") || k3 === "@flow.os";
797
- if (v3 === "workspace:*" || isFlow && typeof v3 === "string" && (v3.startsWith("file:./packages/") || v3.startsWith("file:../"))) {
798
- next[k3] = useWorkspace && isFlow ? "workspace:*" : "^0.0.1";
799
- } else {
800
- next[k3] = v3;
801
- }
802
- }
803
- for (const [k3, v3] of Object.entries(extraPackages)) {
804
- if (!(k3 in next))
805
- next[k3] = v3;
806
- }
807
- out.dependencies = next;
808
- const devDeps = out.devDependencies;
809
- if (devDeps) {
810
- const nextDev = {};
811
- for (const [k3, v3] of Object.entries(devDeps)) {
812
- if (k3 === "vite-plugin-oxlint" || k3 === "oxlint" || k3 === "oxfmt")
813
- continue;
814
- nextDev[k3] = v3;
815
- }
816
- out.devDependencies = nextDev;
817
- }
818
- return out;
819
- }
820
- async function copyWithExclude(srcDir, destDir, exclude) {
821
- const set = new Set(exclude.map((e2) => e2.toLowerCase()));
822
- async function w2(dir, rel) {
823
- const entries = await readdir(dir, { withFileTypes: true });
824
- for (const ent of entries) {
825
- const name = ent.name;
826
- if (set.has(name.toLowerCase()))
827
- continue;
828
- const relPath = rel ? join(rel, name) : name;
829
- const srcPath = join(dir, name);
830
- const destPath = join(destDir, relPath);
831
- if (ent.isDirectory()) {
832
- await mkdir(destPath, { recursive: true });
833
- await w2(srcPath, relPath);
834
- } else {
835
- await mkdir(join(destDir, rel), { recursive: true });
836
- await Bun.write(destPath, Bun.file(srcPath));
837
- }
838
- }
839
- }
840
- await mkdir(destDir, { recursive: true });
841
- await w2(srcDir, "");
842
- }
843
- async function findPackageDir(repoRoot, packageName) {
844
- const packagesDir = join(repoRoot, "packages");
845
- try {
846
- const entries = await readdir(packagesDir, { withFileTypes: true });
847
- for (const ent of entries) {
848
- if (!ent.isDirectory())
849
- continue;
850
- const pkgPath = join(packagesDir, ent.name, "package.json");
851
- try {
852
- const pkg = await Bun.file(pkgPath).json();
853
- if (pkg.name === packageName)
854
- return join(packagesDir, ent.name);
855
- } catch {}
856
- }
857
- } catch {}
858
- return null;
859
- }
860
-
861
- // index.ts
862
- var argv = process.argv.slice(2);
863
- var noInstall = argv.includes("--no-install");
864
- var noGit = argv.includes("--no-git");
865
- var noStart = argv.includes("--no-start");
866
- var force = argv.includes("--force");
867
- var yes = argv.includes("--yes") || argv.includes("-y");
868
- var useDevTag = argv.includes("--dev");
869
- var nameArg = argv.find((a3) => !a3.startsWith("--"));
870
- var DIR = basename(import.meta.dir) === "dist" || basename(import.meta.dir) === "bin" ? join2(import.meta.dir, "..") : import.meta.dir;
871
- var REPO_ROOT = (process.env.FLOW_FRAMEWORK_ROOT ?? join2(DIR, "..", "..")).replace(/\\/g, "/");
872
- var c2 = {
873
- brand: (s) => import_picocolors3.default.bold(import_picocolors3.default.cyan(s)),
874
- cyan: (s) => import_picocolors3.default.cyan(s),
875
- dim: (s) => import_picocolors3.default.dim(s),
876
- bold: (s) => import_picocolors3.default.bold(s),
877
- muted: (s) => import_picocolors3.default.cyan(s),
878
- bright: (s) => import_picocolors3.default.white(s)
879
- };
880
- var W2 = 50;
881
- var ICON = {
882
- full: "\u25C9",
883
- client: "\u25C6",
884
- server: "\u25CF",
885
- deps: "\uD83D\uDCE6",
886
- rocket: "\u25B6"
887
- };
888
- function stripAnsi(s) {
889
- return s.replace(/\x1b\[[0-9;]*m/g, "");
890
- }
891
- function box(lines) {
892
- const top = c2.dim("\u256D" + "\u2500".repeat(W2 - 2) + "\u256E");
893
- const bottom = c2.dim("\u2570" + "\u2500".repeat(W2 - 2) + "\u256F");
894
- const body = lines.map((l2) => {
895
- const plain = stripAnsi(l2);
896
- const pad = Math.max(0, W2 - 4 - plain.length);
897
- return c2.dim("\u2502 ") + l2 + " ".repeat(pad) + c2.dim(" \u2502");
898
- }).join(`
899
- `);
900
- return `
901
- ` + top + `
902
- ` + body + `
903
- ` + bottom + `
904
- `;
905
- }
906
- async function runDev(cwd) {
907
- const devProc = Bun.spawn(["bun", "run", "dev"], {
908
- cwd,
909
- stdio: ["inherit", "inherit", "inherit"]
910
- });
911
- await devProc.exited;
912
- }
913
- var PROFILE_FLAGS = ["client", "full", "server"];
914
- function optsForProfile(config, profileId) {
915
- return Object.entries(config.packages).filter(([, e2]) => {
916
- const inc = e2.includeIn ?? [];
917
- if (inc.includes(profileId))
918
- return true;
919
- if (profileId === "full" && (inc.includes("client") || inc.includes("server")))
920
- return true;
921
- return false;
922
- });
923
- }
924
- function optionalPackageIdsForProfile(config, profileId) {
925
- const opts = optsForProfile(config, profileId);
926
- const optIds = opts.map(([id]) => id);
927
- const defaultIds = config.profiles[profileId]?.defaultPackages ?? [];
928
- return optIds.filter((id) => !defaultIds.includes(id));
929
- }
930
- function profileFromArgv(argv2) {
931
- for (const arg of argv2) {
932
- if (!arg.startsWith("--"))
933
- continue;
934
- const key = arg.slice(2);
935
- if (PROFILE_FLAGS.includes(key))
936
- return key;
937
- }
938
- return null;
939
- }
940
- function addOnsFromArgv(argv2, optionalIds) {
941
- return optionalIds.filter((id) => argv2.includes("--" + id));
942
- }
943
- async function main() {
944
- const devBadge = useDevTag ? c2.dim(" \xB7 dev") : "";
945
- const CONTENT_W = 46;
946
- const BORDER_W = 50;
947
- const introLine = (content) => {
948
- const plain = stripAnsi(content);
949
- const len = plain.length;
950
- const pad = Math.max(0, CONTENT_W - len);
951
- const left = Math.floor(pad / 2);
952
- const right = pad - left;
953
- return c2.dim(" \u2502 ") + " ".repeat(left) + content + " ".repeat(right) + c2.dim(" \u2502");
954
- };
955
- const introBorder = (ch) => c2.dim(" " + (ch === "t" ? "\u256D" : "\u2570") + "\u2500".repeat(BORDER_W) + (ch === "t" ? "\u256E" : "\u256F"));
956
- const singleLine = "Create " + c2.bold(c2.cyan("Flow OS")) + devBadge + " application";
957
- console.log(`
958
- ` + introBorder("t") + `
959
- ` + introLine(singleLine) + `
960
- ` + introBorder("b") + `
961
- `);
962
- const config = await Bun.file(join2(DIR, "config.json")).json();
963
- const hasDeps = Object.values(config.packages).every((e2) => Array.isArray(e2.deps));
964
- if (!hasDeps) {
965
- he(c2.dim("Run ") + c2.brand("bun run gen") + c2.dim(" from create-flow first."));
966
- process.exit(1);
967
- }
968
- const projectName = nameArg?.trim() || (yes ? "my-flow-app" : null);
969
- let name = projectName;
970
- if (!name && !yes) {
971
- const r2 = await ae({
972
- message: c2.muted("Project name"),
973
- initialValue: "my-flow-app",
974
- validate: (v3) => !v3?.trim() ? "Required" : undefined
975
- });
976
- if (lD(r2))
977
- process.exit(0);
978
- name = r2.trim() || "my-flow-app";
979
- }
980
- if (!name)
981
- name = "my-flow-app";
982
- const profileFlag = profileFromArgv(argv);
983
- const optsFull = optsForProfile(config, "full");
984
- let profileId;
985
- let selected = [];
986
- if (profileFlag) {
987
- profileId = profileFlag;
988
- const defaultIds = config.profiles[profileId]?.defaultPackages ?? [];
989
- const optionalIds = optionalPackageIdsForProfile(config, profileId);
990
- const addOns = addOnsFromArgv(argv, optionalIds);
991
- selected = [...defaultIds, ...addOns];
992
- } else if (yes) {
993
- profileId = "full";
994
- selected = optsFull.map(([id]) => id);
995
- } else {
996
- const choice = await le({
997
- message: c2.muted("Template"),
998
- options: [
999
- { value: "full", label: `${ICON.full} Full stack ${c2.dim("(client + server)")}` },
1000
- { value: "client", label: `${ICON.client} Client only` },
1001
- { value: "server", label: `${ICON.server} Server only` }
1002
- ]
1003
- });
1004
- if (lD(choice))
1005
- process.exit(0);
1006
- profileId = choice;
1007
- const opts = optsForProfile(config, profileId);
1008
- const optIds = opts.map(([id]) => id);
1009
- const defaultIds = config.profiles[profileId]?.defaultPackages ?? [];
1010
- selected = optIds.filter((id) => defaultIds.includes(id));
1011
- if (profileId === "full") {
1012
- selected = optIds;
1013
- } else if (opts.length > 0) {
1014
- const optionalIds = optIds.filter((id) => !defaultIds.includes(id));
1015
- if (optionalIds.length > 0) {
1016
- const r2 = await $e({
1017
- message: c2.muted("Add-ons"),
1018
- options: optionalIds.map((id) => ({ value: id, label: id })),
1019
- required: false
1020
- });
1021
- if (!lD(r2))
1022
- selected = [...selected, ...r2 ?? []];
1023
- }
1024
- }
1025
- }
1026
- const cwd = process.cwd();
1027
- const projectPath = join2(cwd, name);
1028
- const projectPathNew = join2(cwd, name + ".new");
1029
- const profileDir = join2(DIR, "profiles", profileId);
1030
- const [profileExists, pathExists] = await Promise.all([
1031
- stat(profileDir).then(() => true).catch(() => false),
1032
- stat(projectPath).then(() => true).catch(() => false)
1033
- ]);
1034
- if (!profileExists) {
1035
- he(c2.dim("Profile not found. Run ") + c2.brand("bun run gen") + c2.dim("."));
1036
- process.exit(1);
1037
- }
1038
- if (pathExists && !force) {
1039
- he(c2.dim("Folder ") + name + c2.dim(" exists. Use ") + c2.brand("--force") + c2.dim("."));
1040
- process.exit(1);
1041
- }
1042
- const isDevFromRepoPromise = useDevTag ? findPackageDir(REPO_ROOT, "@flow.os/client").then((d2) => !!d2) : Promise.resolve(false);
1043
- await rm(projectPathNew, { recursive: true, force: true });
1044
- const createSpinner = _2();
1045
- createSpinner.start(c2.cyan(ICON.rocket + " Creating project\u2026"));
1046
- await copyWithExclude(profileDir, projectPathNew, ["node_modules", ".git"]);
1047
- for (const id of selected) {
1048
- const pkgDir = join2(DIR, "packages", id);
1049
- try {
1050
- await copyWithExclude(pkgDir, projectPathNew, []);
1051
- } catch {}
1052
- }
1053
- createSpinner.stop(c2.cyan(ICON.rocket + " Project created"));
1054
- const extraDeps = {};
1055
- for (const id of selected) {
1056
- const deps = config.packages[id]?.deps;
1057
- if (deps)
1058
- for (const d2 of deps)
1059
- extraDeps[d2] = "^0.0.1";
1060
- }
1061
- const pkgPath = join2(projectPathNew, "package.json");
1062
- const pkg = await Bun.file(pkgPath).json();
1063
- await Bun.write(pkgPath, JSON.stringify(transformPackageJson(pkg, name, extraDeps, false), null, 2));
1064
- if (!noGit) {
1065
- try {
1066
- await Bun.$`git init ${projectPathNew}`.quiet();
1067
- await Bun.$`git -C ${projectPathNew} add -A`.quiet();
1068
- await Bun.$`git -C ${projectPathNew} commit -m "Initial commit (Flow)"`.quiet();
1069
- } catch {}
1070
- }
1071
- const finalPkg = await Bun.file(pkgPath).json();
1072
- delete finalPkg.workspaces;
1073
- if (finalPkg.dependencies) {
1074
- const isDevFromRepo = await isDevFromRepoPromise;
1075
- const flowKeys = Object.keys(finalPkg.dependencies).filter((k3) => k3 === "@flow.os" || k3.startsWith("@flow.os/"));
1076
- if (useDevTag && isDevFromRepo && flowKeys.length > 0) {
1077
- const dirs = await Promise.all(flowKeys.map((k3) => findPackageDir(REPO_ROOT, k3)));
1078
- for (let i = 0;i < flowKeys.length; i++) {
1079
- const k3 = flowKeys[i];
1080
- const pkgDir = dirs[i];
1081
- if (pkgDir) {
1082
- const rel = relative(projectPathNew, pkgDir).replace(/\\/g, "/");
1083
- finalPkg.dependencies[k3] = "file:" + (rel.startsWith("..") ? rel : "./" + rel);
1084
- } else {
1085
- finalPkg.dependencies[k3] = "dev";
1086
- }
1087
- }
1088
- } else if (useDevTag) {
1089
- for (const k3 of flowKeys)
1090
- finalPkg.dependencies[k3] = "dev";
1091
- }
1092
- for (const k3 of Object.keys(finalPkg.dependencies)) {
1093
- if (finalPkg.dependencies[k3] === "workspace:*")
1094
- finalPkg.dependencies[k3] = "^0.0.1";
1095
- }
1096
- delete finalPkg.dependencies["@flow.os"];
1097
- finalPkg.dependencies = Object.fromEntries(Object.entries(finalPkg.dependencies).filter(([key]) => key !== "@flow.os"));
1098
- }
1099
- await Bun.write(pkgPath, JSON.stringify(finalPkg, null, 2));
1100
- if (useDevTag) {
1101
- try {
1102
- await rm(join2(projectPathNew, "packages"), { recursive: true, force: true });
1103
- } catch {}
1104
- }
1105
- if (!noInstall) {
1106
- const s = _2();
1107
- s.start(c2.cyan(ICON.deps + " Installing dependencies\u2026"));
1108
- const proc = Bun.spawn(["bun", "install"], { cwd: projectPathNew, stdout: "pipe", stderr: "pipe" });
1109
- const code = await proc.exited;
1110
- s.stop(code === 0 ? c2.cyan(ICON.deps + " Dependencies installed") : "Failed");
1111
- if (code !== 0) {
1112
- const err = await new Response(proc.stderr).text();
1113
- v2.error(err || "bun install exit " + code);
1114
- await rm(projectPathNew, { recursive: true, force: true });
1115
- process.exit(1);
1116
- }
1117
- }
1118
- if (pathExists)
1119
- await rm(projectPath, { recursive: true, force: true });
1120
- await rename(projectPathNew, projectPath);
1121
- const startDev = !noStart && !noInstall;
1122
- if (startDev) {
1123
- ge(c2.cyan(ICON.rocket + " Starting dev server\u2026"));
1124
- await runDev(projectPath);
1125
- } else {
1126
- const outroLines = [
1127
- c2.bold("Done"),
1128
- "",
1129
- c2.dim("Next steps:"),
1130
- " " + c2.brand("cd " + name),
1131
- " " + c2.brand("bun run dev")
1132
- ];
1133
- ge(box(outroLines));
1134
- }
1135
- }
1136
- main().catch((e2) => {
1137
- v2.error(String(e2));
1138
- process.exit(1);
1139
- });