7onic 0.1.15 → 0.1.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +791 -218
- package/llms.txt +1 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -6,6 +6,9 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
6
6
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
7
|
var __getProtoOf = Object.getPrototypeOf;
|
|
8
8
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __esm = (fn, res) => function __init() {
|
|
10
|
+
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
11
|
+
};
|
|
9
12
|
var __commonJS = (cb, mod) => function __require() {
|
|
10
13
|
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
11
14
|
};
|
|
@@ -26,10 +29,19 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
29
|
mod
|
|
27
30
|
));
|
|
28
31
|
|
|
32
|
+
// <define:__AI_KIT_FILES__>
|
|
33
|
+
var define_AI_KIT_FILES_default;
|
|
34
|
+
var init_define_AI_KIT_FILES = __esm({
|
|
35
|
+
"<define:__AI_KIT_FILES__>"() {
|
|
36
|
+
define_AI_KIT_FILES_default = { "skills/7onic-setup/SKILL.md": "---\nname: 7onic-setup\ndescription: Detect, configure, and verify a project for the 7onic Design System \u2014 framework/Tailwind detection, token CSS wiring, and an idempotent health check. Run after installing @7onic-ui packages, after `npx 7onic init`, or whenever styles look wrong.\n---\n\n# 7onic Setup \u2014 detect, configure, verify\n\nBring the current project to a working 7onic state. This skill is\n**idempotent**: when everything is already correct it changes nothing and\nreports a passing checklist. Never guess \u2014 every verdict below must come\nfrom reading the actual file.\n\n## Step 1 \u2014 Detect the project\n\nRead `package.json` and record:\n\n- **Install route**:\n - `@7onic-ui/react` in dependencies \u2192 **npm route**\n - a `7onic.json` file at the root and/or components under the project's\n `components/ui/` \u2192 **CLI route** (`npx 7onic add` source copies)\n - neither \u2192 go to Step 4 (fresh install)\n- **Tailwind major**: `tailwindcss` version \u2014 `^4` \u2192 v4, `^3` \u2192 v3.\n No Tailwind at all \u2192 tokens still work as plain CSS variables\n (`@7onic-ui/tokens/css/all.css`), but component classes need Tailwind:\n say so and stop after wiring the CSS.\n- **Framework**: `next` \u2192 Next.js (global CSS usually `app/globals.css`),\n `vite` \u2192 Vite (usually `src/index.css`).\n- `@7onic-ui/tokens` must be present on both routes \u2014 it ships the CSS\n variables everything depends on.\n\n## Step 2 \u2014 Verify (and fix) the CSS wiring\n\nOpen the project's global CSS file and check against the matrix. Add only\nwhat is missing; never duplicate an import that already exists.\n\n**Tailwind v4**:\n\n```css\n@import \"tailwindcss\";\n@import '@7onic-ui/tokens/tailwind/v4.css';\n\n@source \"../node_modules/@7onic-ui/react/dist\";\n```\n\n- The `@source` path is relative to the CSS file \u2014 recompute it for the\n actual file location (npm route only; CLI-copied sources are scanned as\n normal project files).\n\n**Tailwind v3** \u2014 CSS plus config:\n\n```css\n@import '@7onic-ui/tokens/css/all.css';\n\n@tailwind base;\n@tailwind components;\n@tailwind utilities;\n```\n\n`tailwind.config.js` must have the preset and, on the npm route, the dist\nglob in `content`:\n\n```js\npresets: [require('@7onic-ui/tokens/tailwind/v3-preset')],\ncontent: ['./node_modules/@7onic-ui/react/dist/**/*.{js,mjs}', /* app globs */],\n```\n\nNotes that prevent common misdiagnoses:\n\n- Body background/text/font come from the token CSS automatically\n (`html body` baseline inside `variables.css`) \u2014 do NOT add manual\n `body { ... }` rules or wrapper providers.\n- Dark mode is automatic via CSS variables \u2014 never add `dark:` prefixed\n classes to compensate.\n- `lucide-react` is NOT a 7onic dependency; 7onic components use inline\n SVG. Install it only if the user's own code imports it.\n\n## Step 3 \u2014 Health check (always run, report as a checklist)\n\n1. `@7onic-ui/tokens` resolvable and its CSS imported (Step 2 matrix).\n2. Tailwind version matches the wiring style actually found.\n3. npm route: `@source`/`content` covers `@7onic-ui/react/dist`.\n4. A trivial render compiles: import `{ Button }` from\n `@7onic-ui/react` (npm) or the local `components/ui` path (CLI) and\n type-check or build.\n5. If the 7onic MCP server is connected, finish with one\n `validate_code` call on an existing screen file to confirm the\n project's code follows the token rules.\n\nReport each line as pass/fixed/action-needed with the file you read as\nevidence. If all five pass untouched, say so explicitly \u2014 that is the\nexpected steady state.\n\n## Step 4 \u2014 Nothing installed yet\n\nRecommend exactly one of:\n\n- `npx 7onic init` \u2014 detects framework/TS/Tailwind, installs base deps,\n wires the CSS automatically (then re-run this skill to verify), or\n- manual npm route: `npm install @7onic-ui/react @7onic-ui/tokens` and\n apply Step 2.\n\nFull reference: `node_modules/@7onic-ui/react/llms.txt` (npm route) or\nhttps://7onic.design/components/installation\n", "skills/7onic-design/SKILL.md": '---\nname: 7onic-design\ndescription: Build UI with the 7onic Design System the right way \u2014 guided workflow that drives the 7onic MCP tools (component discovery, token resolution, layout recipes, validate_code loop) from a plain-language request like "SaaS dashboard" or "pricing page". Queries work in English, Japanese, and Korean.\n---\n\n# 7onic Design \u2014 guided, validated UI building\n\nTurn a request ("build a settings page", "SaaS\u30C0\u30C3\u30B7\u30E5\u30DC\u30FC\u30C9", "\uAC00\uACA9 \uD398\uC774\uC9C0")\ninto token-accurate 7onic code. This skill is an **orchestrator**: the\nknowledge lives in the 7onic MCP server tools \u2014 your job is to call them\nin the right order and refuse to hand over unvalidated code.\n\nIf the `7onic-design` MCP tools are not available, stop and have the user\ninstall the plugin (`claude plugin install 7onic-design@7onic`) or wire\nthe server manually \u2014 do not improvise from memory.\n\n## Step 0 \u2014 Scope the request\n\nBreak the request into screens/sections and list them back in the user\'s\nlanguage. For a multi-screen request, confirm the breakdown before\nwriting code (e.g. dashboard \u2192 layout shell / metric row / chart panel /\ntable). For a single component or section, skip the confirmation and go.\n\n## Step 1 \u2014 Components first\n\nFor every UI element, discover before you write:\n\n- `list_components` with a natural-language query (en/ja/ko all fine) \u2014\n prefer a 7onic component over any hand-rolled HTML.\n- `get_component` for props/variants/sizes of each component you will\n use \u2014 never guess a prop name or enum value.\n- `get_component_examples` and copy the import lines **exactly** \u2014\n named exports only, charts from `@7onic-ui/react/chart`.\n\n## Step 2 \u2014 Tokens for everything visual\n\n- `search_tokens` / `get_token` for colors, spacing, typography, shadows.\n Token NAMES are the API; values are user-configurable \u2014 never hardcode.\n- About to write any raw value (hex color, px size, ms duration)?\n Call `suggest_tokens` first. If it returns an exact token, use the\n token class. If not, it returns a user-confirmation prompt \u2014 **relay\n that prompt and wait**; never bypass tokens silently.\n- Semantic colors theme-switch automatically: no `dark:` prefixes.\n Typography tokens pair font-size with line-height: no `leading-*`.\n\n## Step 3 \u2014 Layout\n\n`get_layout_pattern` for the structural skeleton \u2014 symmetric grids,\nreading column, section rhythm, element rows, inline groups. Grid system\nis 4/8/12 columns (mobile/tablet/desktop); icon+text rows always use\n`items-center`.\n\n## Step 4 \u2014 Write, then validate (non-negotiable)\n\nWrite the code, then run `validate_code` on every file you produced:\n\n1. errors > 0 \u2192 fix using the per-violation `fix` guidance and re-run.\n Repeat until `valid: true`.\n2. Warnings: resolve them or tell the user which ones you kept and why.\n3. A `ds-ignore` comment is allowed only for a value the user explicitly\n approved through the Step 2 confirmation prompt.\n\nOnly validated code reaches the user. Include in your final summary:\ncomponents used, tokens of note, and the final validate_code verdict.\n\n## Quality bar\n\nResponsive mobile-first (`md:`/`lg:` variants), dark-mode safe by\nconstruction (semantic tokens only), accessible labels on icon-only\ncontrols, user-facing copy in the user\'s language.\n', "agents/design-agent.md": "---\nname: 7onic-design-agent\ndescription: Implements UI tasks with the 7onic Design System end to end \u2014 discovers components and tokens through the 7onic MCP tools, composes layout, and returns only validate_code-clean TSX. Use for delegated page/screen/component builds in projects using @7onic-ui packages.\n---\n\nYou are a 7onic Design System implementation agent. You receive a UI task\n(a page, screen, or component) and return working, **validated** code.\nYou are self-contained: everything you need comes from the 7onic MCP\ntools (`7onic-design` server) \u2014 if they are unavailable, return that as a\nblocker instead of improvising from memory.\n\n## Hard rules\n\n1. **Components over HTML.** Before writing any element, check\n `list_components` (queries accept English, Japanese, Korean). Native\n `<button>`, `<input>`, `<table>` are wrong wherever a 7onic component\n exists.\n2. **Never guess an API.** `get_component` for props/variants/sizes;\n `get_component_examples` for verified JSX \u2014 copy the import lines\n exactly. Named exports only; charts import from\n `@7onic-ui/react/chart` (requires the `recharts` optional peer).\n3. **Tokens only.** No raw palette colors, no arbitrary values except\n layout `h-[]`/`w-[]`, no `dark:` prefixes (semantic tokens\n theme-switch), no `leading-*` (typography tokens pair font-size with\n line-height), no inline styles. Before any raw value, call\n `suggest_tokens`; if there is no exact token, surface its\n confirmation prompt to your caller as an open question \u2014 do not\n decide alone.\n4. **Layout via `get_layout_pattern`** \u2014 4/8/12 column grid, token gaps,\n `items-center` for icon+text rows.\n5. **Validate before returning.** Run `validate_code` on every file you\n wrote; fix and re-run until `valid: true`. Code that fails validation\n must not appear in your final answer. Report remaining warnings with\n one-line justifications.\n\n## Working style\n\n- Match the surrounding codebase's conventions (file layout, naming,\n client/server component boundaries) \u2014 read neighboring files first.\n- Mobile-first responsive, accessible labels on icon-only controls,\n user-facing copy in the requester's language.\n- Final report: files written, components used, notable token choices,\n the validate_code verdict per file, and any open questions (e.g. a\n pending custom-value confirmation).\n" };
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
|
|
29
40
|
// node_modules/sisteransi/src/index.js
|
|
30
41
|
var require_src = __commonJS({
|
|
31
42
|
"node_modules/sisteransi/src/index.js"(exports2, module2) {
|
|
32
43
|
"use strict";
|
|
44
|
+
init_define_AI_KIT_FILES();
|
|
33
45
|
var ESC2 = "\x1B";
|
|
34
46
|
var CSI2 = `${ESC2}[`;
|
|
35
47
|
var beep = "\x07";
|
|
@@ -85,6 +97,7 @@ var require_src = __commonJS({
|
|
|
85
97
|
// node_modules/picocolors/picocolors.js
|
|
86
98
|
var require_picocolors = __commonJS({
|
|
87
99
|
"node_modules/picocolors/picocolors.js"(exports2, module2) {
|
|
100
|
+
init_define_AI_KIT_FILES();
|
|
88
101
|
var p2 = process || {};
|
|
89
102
|
var argv = p2.argv || [];
|
|
90
103
|
var env = p2.env || {};
|
|
@@ -158,6 +171,7 @@ var require_picocolors = __commonJS({
|
|
|
158
171
|
var require_tokenize = __commonJS({
|
|
159
172
|
"node_modules/postcss/lib/tokenize.js"(exports2, module2) {
|
|
160
173
|
"use strict";
|
|
174
|
+
init_define_AI_KIT_FILES();
|
|
161
175
|
var SINGLE_QUOTE = "'".charCodeAt(0);
|
|
162
176
|
var DOUBLE_QUOTE = '"'.charCodeAt(0);
|
|
163
177
|
var BACKSLASH = "\\".charCodeAt(0);
|
|
@@ -190,6 +204,7 @@ var require_tokenize = __commonJS({
|
|
|
190
204
|
let pos = 0;
|
|
191
205
|
let buffer = [];
|
|
192
206
|
let returned = [];
|
|
207
|
+
let lastBadParen = -1;
|
|
193
208
|
function position() {
|
|
194
209
|
return pos;
|
|
195
210
|
}
|
|
@@ -254,10 +269,13 @@ var require_tokenize = __commonJS({
|
|
|
254
269
|
} while (escaped);
|
|
255
270
|
currentToken = ["brackets", css.slice(pos, next + 1), pos, next];
|
|
256
271
|
pos = next;
|
|
272
|
+
} else if (pos <= lastBadParen) {
|
|
273
|
+
currentToken = ["(", "(", pos];
|
|
257
274
|
} else {
|
|
258
275
|
next = css.indexOf(")", pos + 1);
|
|
259
276
|
content = css.slice(pos, next + 1);
|
|
260
277
|
if (next === -1 || RE_BAD_BRACKET.test(content)) {
|
|
278
|
+
lastBadParen = next === -1 ? length : next;
|
|
261
279
|
currentToken = ["(", "(", pos];
|
|
262
280
|
} else {
|
|
263
281
|
currentToken = ["brackets", content, pos, next];
|
|
@@ -373,6 +391,7 @@ var require_tokenize = __commonJS({
|
|
|
373
391
|
var require_terminal_highlight = __commonJS({
|
|
374
392
|
"node_modules/postcss/lib/terminal-highlight.js"(exports2, module2) {
|
|
375
393
|
"use strict";
|
|
394
|
+
init_define_AI_KIT_FILES();
|
|
376
395
|
var pico = require_picocolors();
|
|
377
396
|
var tokenizer = require_tokenize();
|
|
378
397
|
var Input2;
|
|
@@ -435,6 +454,7 @@ var require_terminal_highlight = __commonJS({
|
|
|
435
454
|
var require_css_syntax_error = __commonJS({
|
|
436
455
|
"node_modules/postcss/lib/css-syntax-error.js"(exports2, module2) {
|
|
437
456
|
"use strict";
|
|
457
|
+
init_define_AI_KIT_FILES();
|
|
438
458
|
var pico = require_picocolors();
|
|
439
459
|
var terminalHighlight = require_terminal_highlight();
|
|
440
460
|
var CssSyntaxError2 = class _CssSyntaxError extends Error {
|
|
@@ -532,6 +552,8 @@ var require_css_syntax_error = __commonJS({
|
|
|
532
552
|
var require_stringifier = __commonJS({
|
|
533
553
|
"node_modules/postcss/lib/stringifier.js"(exports2, module2) {
|
|
534
554
|
"use strict";
|
|
555
|
+
init_define_AI_KIT_FILES();
|
|
556
|
+
var AT_NAME_END = /[\t\n\f\r "#'()/;[\\\]{}]/;
|
|
535
557
|
var DEFAULT_RAW = {
|
|
536
558
|
after: "\n",
|
|
537
559
|
beforeClose: "\n",
|
|
@@ -549,23 +571,74 @@ var require_stringifier = __commonJS({
|
|
|
549
571
|
function capitalize(str) {
|
|
550
572
|
return str[0].toUpperCase() + str.slice(1);
|
|
551
573
|
}
|
|
552
|
-
|
|
574
|
+
function atruleStart(str, node) {
|
|
575
|
+
let name = "@" + node.name;
|
|
576
|
+
let params = node.params ? str.rawValue(node, "params") : "";
|
|
577
|
+
let afterName = node.raws.afterName;
|
|
578
|
+
if (typeof afterName === "undefined") {
|
|
579
|
+
afterName = params ? " " : "";
|
|
580
|
+
} else if (afterName === "" && params && !AT_NAME_END.test(params[0])) {
|
|
581
|
+
afterName = " ";
|
|
582
|
+
}
|
|
583
|
+
return name + afterName + params;
|
|
584
|
+
}
|
|
585
|
+
function isCustomProperty(node) {
|
|
586
|
+
if (!node.prop.startsWith("--")) return false;
|
|
587
|
+
let before = node.raws.before;
|
|
588
|
+
return typeof before === "undefined" || !/[^\s;]$/.test(before);
|
|
589
|
+
}
|
|
590
|
+
function pushBody(str, stack, node) {
|
|
591
|
+
let nodes = node.nodes;
|
|
592
|
+
let last = nodes.length - 1;
|
|
593
|
+
while (last > 0) {
|
|
594
|
+
if (nodes[last].type !== "comment") break;
|
|
595
|
+
last -= 1;
|
|
596
|
+
}
|
|
597
|
+
let semicolon = str.raw(node, "semicolon");
|
|
598
|
+
let isDocument = node.type === "document";
|
|
599
|
+
for (let i = nodes.length - 1; i >= 0; i--) {
|
|
600
|
+
let child = nodes[i];
|
|
601
|
+
let childSemicolon = last !== i || semicolon;
|
|
602
|
+
if (!childSemicolon && i < nodes.length - 1 && (child.type === "atrule" && !child.nodes || child.type === "decl" && isCustomProperty(child))) {
|
|
603
|
+
childSemicolon = true;
|
|
604
|
+
}
|
|
605
|
+
stack.push({
|
|
606
|
+
document: isDocument,
|
|
607
|
+
node: child,
|
|
608
|
+
semicolon: childSemicolon
|
|
609
|
+
});
|
|
610
|
+
}
|
|
611
|
+
}
|
|
612
|
+
function pushBlock(str, stack, node, start) {
|
|
613
|
+
let between = str.raw(node, "between", "beforeOpen");
|
|
614
|
+
str.builder(start + between + "{", node, "start");
|
|
615
|
+
let hasNodes = node.nodes && node.nodes.length;
|
|
616
|
+
let close = () => {
|
|
617
|
+
let after = hasNodes ? str.raw(node, "after") : str.raw(node, "after", "emptyBody");
|
|
618
|
+
if (after) str.builder(after);
|
|
619
|
+
str.builder("}", node, "end");
|
|
620
|
+
if (node.type === "rule" && node.raws.ownSemicolon) {
|
|
621
|
+
str.builder(node.raws.ownSemicolon, node, "end");
|
|
622
|
+
}
|
|
623
|
+
};
|
|
624
|
+
if (hasNodes) {
|
|
625
|
+
stack.push(close);
|
|
626
|
+
pushBody(str, stack, node);
|
|
627
|
+
} else {
|
|
628
|
+
close();
|
|
629
|
+
}
|
|
630
|
+
}
|
|
631
|
+
var Stringifier = class _Stringifier {
|
|
553
632
|
constructor(builder) {
|
|
554
633
|
this.builder = builder;
|
|
555
634
|
}
|
|
556
635
|
atrule(node, semicolon) {
|
|
557
|
-
let
|
|
558
|
-
let params = node.params ? this.rawValue(node, "params") : "";
|
|
559
|
-
if (typeof node.raws.afterName !== "undefined") {
|
|
560
|
-
name += node.raws.afterName;
|
|
561
|
-
} else if (params) {
|
|
562
|
-
name += " ";
|
|
563
|
-
}
|
|
636
|
+
let start = atruleStart(this, node);
|
|
564
637
|
if (node.nodes) {
|
|
565
|
-
this.block(node,
|
|
638
|
+
this.block(node, start);
|
|
566
639
|
} else {
|
|
567
640
|
let end = (node.raws.between || "") + (semicolon ? ";" : "");
|
|
568
|
-
this.builder(
|
|
641
|
+
this.builder(start + end, node);
|
|
569
642
|
}
|
|
570
643
|
}
|
|
571
644
|
beforeAfter(node, detect) {
|
|
@@ -607,17 +680,30 @@ var require_stringifier = __commonJS({
|
|
|
607
680
|
this.builder("}", node, "end");
|
|
608
681
|
}
|
|
609
682
|
body(node) {
|
|
610
|
-
let
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
let
|
|
683
|
+
let proto = _Stringifier.prototype;
|
|
684
|
+
let expandable = ["atrule", "block", "body", "rule", "stringify"].every(
|
|
685
|
+
(method) => this[method] === proto[method]
|
|
686
|
+
);
|
|
687
|
+
let stack = [];
|
|
688
|
+
pushBody(this, stack, node);
|
|
689
|
+
while (stack.length > 0) {
|
|
690
|
+
let entry = stack.pop();
|
|
691
|
+
if (typeof entry === "function") {
|
|
692
|
+
entry();
|
|
693
|
+
continue;
|
|
694
|
+
}
|
|
695
|
+
let child = entry.node;
|
|
618
696
|
let before = this.raw(child, "before");
|
|
619
|
-
if (before)
|
|
620
|
-
|
|
697
|
+
if (before) {
|
|
698
|
+
this.builder(before);
|
|
699
|
+
}
|
|
700
|
+
if (expandable && child.type === "rule") {
|
|
701
|
+
pushBlock(this, stack, child, this.rawValue(child, "selector"));
|
|
702
|
+
} else if (expandable && child.type === "atrule" && child.nodes) {
|
|
703
|
+
pushBlock(this, stack, child, atruleStart(this, child));
|
|
704
|
+
} else {
|
|
705
|
+
this.stringify(child, entry.semicolon);
|
|
706
|
+
}
|
|
621
707
|
}
|
|
622
708
|
}
|
|
623
709
|
comment(node) {
|
|
@@ -626,10 +712,11 @@ var require_stringifier = __commonJS({
|
|
|
626
712
|
this.builder("/*" + left + node.text + right + "*/", node);
|
|
627
713
|
}
|
|
628
714
|
decl(node, semicolon) {
|
|
715
|
+
let raws = node.raws;
|
|
629
716
|
let between = this.raw(node, "between", "colon");
|
|
630
717
|
let string = node.prop + between + this.rawValue(node, "value");
|
|
631
718
|
if (node.important) {
|
|
632
|
-
string +=
|
|
719
|
+
string += raws.important || " !important";
|
|
633
720
|
}
|
|
634
721
|
if (semicolon) string += ";";
|
|
635
722
|
this.builder(string, node);
|
|
@@ -655,9 +742,9 @@ var require_stringifier = __commonJS({
|
|
|
655
742
|
}
|
|
656
743
|
if (!parent) return DEFAULT_RAW[detect];
|
|
657
744
|
let root2 = node.root();
|
|
658
|
-
|
|
659
|
-
if (typeof
|
|
660
|
-
return
|
|
745
|
+
let cache = root2.rawCache || (root2.rawCache = {});
|
|
746
|
+
if (typeof cache[detect] !== "undefined") {
|
|
747
|
+
return cache[detect];
|
|
661
748
|
}
|
|
662
749
|
if (detect === "before" || detect === "after") {
|
|
663
750
|
return this.beforeAfter(node, detect);
|
|
@@ -673,7 +760,7 @@ var require_stringifier = __commonJS({
|
|
|
673
760
|
}
|
|
674
761
|
}
|
|
675
762
|
if (typeof value === "undefined") value = DEFAULT_RAW[detect];
|
|
676
|
-
|
|
763
|
+
cache[detect] = value;
|
|
677
764
|
return value;
|
|
678
765
|
}
|
|
679
766
|
rawBeforeClose(root2) {
|
|
@@ -809,8 +896,14 @@ var require_stringifier = __commonJS({
|
|
|
809
896
|
return value;
|
|
810
897
|
}
|
|
811
898
|
root(node) {
|
|
899
|
+
let inDocument = node.parent && node.parent.type === "document";
|
|
900
|
+
if (!inDocument && node.source && node.source.input.hasBOM) {
|
|
901
|
+
this.builder("\uFEFF", node, "start");
|
|
902
|
+
}
|
|
812
903
|
this.body(node);
|
|
813
|
-
if (node.raws.after)
|
|
904
|
+
if (node.raws.after) {
|
|
905
|
+
this.builder(node.raws.after);
|
|
906
|
+
}
|
|
814
907
|
}
|
|
815
908
|
rule(node) {
|
|
816
909
|
this.block(node, this.rawValue(node, "selector"));
|
|
@@ -836,10 +929,80 @@ var require_stringifier = __commonJS({
|
|
|
836
929
|
var require_stringify = __commonJS({
|
|
837
930
|
"node_modules/postcss/lib/stringify.js"(exports2, module2) {
|
|
838
931
|
"use strict";
|
|
932
|
+
init_define_AI_KIT_FILES();
|
|
839
933
|
var Stringifier = require_stringifier();
|
|
934
|
+
var STYLE_TAG = /(<)(\/?style\b)/gi;
|
|
935
|
+
var COMMENT_OPEN = /(<)(!--)/g;
|
|
936
|
+
function escapeHTMLInCSS(str) {
|
|
937
|
+
if (!str.includes("<")) return str;
|
|
938
|
+
return str.replace(STYLE_TAG, "\\3c $2").replace(COMMENT_OPEN, "\\3c $2");
|
|
939
|
+
}
|
|
940
|
+
function cutEscaped(chunks, css, escaped) {
|
|
941
|
+
let parts = [];
|
|
942
|
+
let at2 = 0;
|
|
943
|
+
let into = 0;
|
|
944
|
+
for (let i = 0; i < chunks.length; i += 3) {
|
|
945
|
+
let from = into;
|
|
946
|
+
let end = at2 + chunks[i].length;
|
|
947
|
+
while (at2 < end) {
|
|
948
|
+
if (css[at2] === escaped[into]) {
|
|
949
|
+
at2 += 1;
|
|
950
|
+
into += 1;
|
|
951
|
+
} else {
|
|
952
|
+
at2 += 1;
|
|
953
|
+
into += 4;
|
|
954
|
+
}
|
|
955
|
+
}
|
|
956
|
+
parts.push(escaped.slice(from, into));
|
|
957
|
+
}
|
|
958
|
+
return parts;
|
|
959
|
+
}
|
|
960
|
+
var SafeStringifier = class extends Stringifier {
|
|
961
|
+
escapeHTML(print) {
|
|
962
|
+
let builder = this.builder;
|
|
963
|
+
let chunks, css;
|
|
964
|
+
this.builder = (str, child, type) => {
|
|
965
|
+
if (chunks) {
|
|
966
|
+
css += str;
|
|
967
|
+
chunks.push(str, child, type);
|
|
968
|
+
} else if (str.includes("<")) {
|
|
969
|
+
css = str;
|
|
970
|
+
chunks = [str, child, type];
|
|
971
|
+
} else {
|
|
972
|
+
builder(str, child, type);
|
|
973
|
+
}
|
|
974
|
+
};
|
|
975
|
+
print();
|
|
976
|
+
this.builder = builder;
|
|
977
|
+
if (!chunks) return;
|
|
978
|
+
let escaped = escapeHTMLInCSS(css);
|
|
979
|
+
if (escaped === css) {
|
|
980
|
+
for (let i = 0; i < chunks.length; i += 3) {
|
|
981
|
+
builder(chunks[i], chunks[i + 1], chunks[i + 2]);
|
|
982
|
+
}
|
|
983
|
+
} else {
|
|
984
|
+
let parts = cutEscaped(chunks, css, escaped);
|
|
985
|
+
for (let i = 0; i < chunks.length; i += 3) {
|
|
986
|
+
builder(parts[i / 3], chunks[i + 1], chunks[i + 2]);
|
|
987
|
+
}
|
|
988
|
+
}
|
|
989
|
+
}
|
|
990
|
+
root(node) {
|
|
991
|
+
if (node.parent && node.parent.type === "document") {
|
|
992
|
+
this.escapeHTML(() => this.body(node));
|
|
993
|
+
if (node.raws.after) this.builder(node.raws.after);
|
|
994
|
+
} else {
|
|
995
|
+
this.escapeHTML(() => super.root(node));
|
|
996
|
+
}
|
|
997
|
+
}
|
|
998
|
+
};
|
|
840
999
|
function stringify2(node, builder) {
|
|
841
|
-
let str = new
|
|
842
|
-
|
|
1000
|
+
let str = new SafeStringifier(builder);
|
|
1001
|
+
if (node.type === "root" || node.type === "document") {
|
|
1002
|
+
str.stringify(node);
|
|
1003
|
+
} else {
|
|
1004
|
+
str.escapeHTML(() => str.stringify(node));
|
|
1005
|
+
}
|
|
843
1006
|
}
|
|
844
1007
|
module2.exports = stringify2;
|
|
845
1008
|
stringify2.default = stringify2;
|
|
@@ -850,6 +1013,7 @@ var require_stringify = __commonJS({
|
|
|
850
1013
|
var require_symbols = __commonJS({
|
|
851
1014
|
"node_modules/postcss/lib/symbols.js"(exports2, module2) {
|
|
852
1015
|
"use strict";
|
|
1016
|
+
init_define_AI_KIT_FILES();
|
|
853
1017
|
module2.exports.isClean = /* @__PURE__ */ Symbol("isClean");
|
|
854
1018
|
module2.exports.my = /* @__PURE__ */ Symbol("my");
|
|
855
1019
|
}
|
|
@@ -859,28 +1023,43 @@ var require_symbols = __commonJS({
|
|
|
859
1023
|
var require_node = __commonJS({
|
|
860
1024
|
"node_modules/postcss/lib/node.js"(exports2, module2) {
|
|
861
1025
|
"use strict";
|
|
1026
|
+
init_define_AI_KIT_FILES();
|
|
862
1027
|
var CssSyntaxError2 = require_css_syntax_error();
|
|
863
1028
|
var Stringifier = require_stringifier();
|
|
864
1029
|
var stringify2 = require_stringify();
|
|
865
1030
|
var { isClean, my } = require_symbols();
|
|
866
1031
|
function cloneNode(obj, parent) {
|
|
867
1032
|
let cloned = new obj.constructor();
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
if (
|
|
883
|
-
|
|
1033
|
+
let stack = [[obj, cloned, parent]];
|
|
1034
|
+
while (stack.length > 0) {
|
|
1035
|
+
let [source, target, targetParent] = stack.pop();
|
|
1036
|
+
for (let i in source) {
|
|
1037
|
+
if (!Object.prototype.hasOwnProperty.call(source, i)) {
|
|
1038
|
+
continue;
|
|
1039
|
+
}
|
|
1040
|
+
if (i === "proxyCache") continue;
|
|
1041
|
+
let value = source[i];
|
|
1042
|
+
let type = typeof value;
|
|
1043
|
+
if (i === "parent" && type === "object") {
|
|
1044
|
+
if (targetParent) target[i] = targetParent;
|
|
1045
|
+
} else if (i === "source") {
|
|
1046
|
+
target[i] = value;
|
|
1047
|
+
} else if (Array.isArray(value)) {
|
|
1048
|
+
let children = [];
|
|
1049
|
+
target[i] = children;
|
|
1050
|
+
for (let j2 of value) {
|
|
1051
|
+
let childClone = new j2.constructor();
|
|
1052
|
+
children.push(childClone);
|
|
1053
|
+
stack.push([j2, childClone, target]);
|
|
1054
|
+
}
|
|
1055
|
+
} else {
|
|
1056
|
+
if (type === "object" && value !== null) {
|
|
1057
|
+
let valueClone = new value.constructor();
|
|
1058
|
+
stack.push([value, valueClone, void 0]);
|
|
1059
|
+
value = valueClone;
|
|
1060
|
+
}
|
|
1061
|
+
target[i] = value;
|
|
1062
|
+
}
|
|
884
1063
|
}
|
|
885
1064
|
}
|
|
886
1065
|
return cloned;
|
|
@@ -906,7 +1085,7 @@ var require_node = __commonJS({
|
|
|
906
1085
|
}
|
|
907
1086
|
return offset;
|
|
908
1087
|
}
|
|
909
|
-
var Node2 = class {
|
|
1088
|
+
var Node2 = class _Node {
|
|
910
1089
|
get proxyOf() {
|
|
911
1090
|
return this;
|
|
912
1091
|
}
|
|
@@ -914,11 +1093,12 @@ var require_node = __commonJS({
|
|
|
914
1093
|
this.raws = {};
|
|
915
1094
|
this[isClean] = false;
|
|
916
1095
|
this[my] = true;
|
|
917
|
-
for (let name
|
|
1096
|
+
for (let name of Object.keys(defaults)) {
|
|
1097
|
+
if (name === "__proto__") continue;
|
|
918
1098
|
if (name === "nodes") {
|
|
919
1099
|
this.nodes = [];
|
|
920
1100
|
for (let node of defaults[name]) {
|
|
921
|
-
if (typeof node.clone === "function") {
|
|
1101
|
+
if (typeof node.clone === "function" && node.parent) {
|
|
922
1102
|
this.append(node.clone());
|
|
923
1103
|
} else {
|
|
924
1104
|
this.append(node);
|
|
@@ -1029,11 +1209,15 @@ var require_node = __commonJS({
|
|
|
1029
1209
|
return this.parent.nodes[index + 1];
|
|
1030
1210
|
}
|
|
1031
1211
|
positionBy(opts = {}) {
|
|
1032
|
-
let
|
|
1212
|
+
let inputString = "document" in this.source.input ? this.source.input.document : this.source.input.css;
|
|
1213
|
+
let pos = {
|
|
1214
|
+
column: this.source.start.column,
|
|
1215
|
+
line: this.source.start.line,
|
|
1216
|
+
offset: sourceOffset(inputString, this.source.start)
|
|
1217
|
+
};
|
|
1033
1218
|
if (opts.index) {
|
|
1034
1219
|
pos = this.positionInside(opts.index);
|
|
1035
1220
|
} else if (opts.word) {
|
|
1036
|
-
let inputString = "document" in this.source.input ? this.source.input.document : this.source.input.css;
|
|
1037
1221
|
let stringRepresentation = inputString.slice(
|
|
1038
1222
|
sourceOffset(inputString, this.source.start),
|
|
1039
1223
|
sourceOffset(inputString, this.source.end)
|
|
@@ -1105,7 +1289,7 @@ var require_node = __commonJS({
|
|
|
1105
1289
|
line: opts.start.line,
|
|
1106
1290
|
offset: sourceOffset(inputString, opts.start)
|
|
1107
1291
|
};
|
|
1108
|
-
} else if (opts.index) {
|
|
1292
|
+
} else if (typeof opts.index === "number") {
|
|
1109
1293
|
start = this.positionInside(opts.index);
|
|
1110
1294
|
}
|
|
1111
1295
|
if (opts.end) {
|
|
@@ -1116,7 +1300,7 @@ var require_node = __commonJS({
|
|
|
1116
1300
|
};
|
|
1117
1301
|
} else if (typeof opts.endIndex === "number") {
|
|
1118
1302
|
end = this.positionInside(opts.endIndex);
|
|
1119
|
-
} else if (opts.index) {
|
|
1303
|
+
} else if (typeof opts.index === "number") {
|
|
1120
1304
|
end = this.positionInside(opts.index + 1);
|
|
1121
1305
|
}
|
|
1122
1306
|
}
|
|
@@ -1168,43 +1352,59 @@ var require_node = __commonJS({
|
|
|
1168
1352
|
return result;
|
|
1169
1353
|
}
|
|
1170
1354
|
toJSON(_2, inputs) {
|
|
1171
|
-
let fixed = {};
|
|
1172
1355
|
let emitInputs = inputs == null;
|
|
1173
1356
|
inputs = inputs || /* @__PURE__ */ new Map();
|
|
1174
|
-
let
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
}
|
|
1179
|
-
|
|
1180
|
-
let
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1357
|
+
let holderOfRoot = [];
|
|
1358
|
+
let queue = [[this, holderOfRoot, 0]];
|
|
1359
|
+
for (let step = 0; step < queue.length; step++) {
|
|
1360
|
+
let [node, holder, key] = queue[step];
|
|
1361
|
+
let fixed2 = {};
|
|
1362
|
+
holder[key] = fixed2;
|
|
1363
|
+
for (let name in node) {
|
|
1364
|
+
if (!Object.prototype.hasOwnProperty.call(node, name)) {
|
|
1365
|
+
continue;
|
|
1366
|
+
}
|
|
1367
|
+
if (name === "parent" || name === "proxyCache") continue;
|
|
1368
|
+
let value = node[name];
|
|
1369
|
+
if (Array.isArray(value)) {
|
|
1370
|
+
let fixedArray = [];
|
|
1371
|
+
fixed2[name] = fixedArray;
|
|
1372
|
+
for (let i = 0; i < value.length; i++) {
|
|
1373
|
+
let item = value[i];
|
|
1374
|
+
if (typeof item === "object" && item.toJSON) {
|
|
1375
|
+
if (item.toJSON === _Node.prototype.toJSON) {
|
|
1376
|
+
queue.push([item, fixedArray, i]);
|
|
1377
|
+
} else {
|
|
1378
|
+
fixedArray[i] = item.toJSON(null, inputs);
|
|
1379
|
+
}
|
|
1380
|
+
} else {
|
|
1381
|
+
fixedArray[i] = item;
|
|
1382
|
+
}
|
|
1383
|
+
}
|
|
1384
|
+
} else if (typeof value === "object" && value.toJSON) {
|
|
1385
|
+
if (value.toJSON === _Node.prototype.toJSON) {
|
|
1386
|
+
queue.push([value, fixed2, name]);
|
|
1185
1387
|
} else {
|
|
1186
|
-
|
|
1388
|
+
fixed2[name] = value.toJSON(null, inputs);
|
|
1187
1389
|
}
|
|
1188
|
-
})
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1390
|
+
} else if (name === "source") {
|
|
1391
|
+
if (value == null) continue;
|
|
1392
|
+
let inputId = inputs.get(value.input);
|
|
1393
|
+
if (inputId == null) {
|
|
1394
|
+
inputId = inputs.size;
|
|
1395
|
+
inputs.set(value.input, inputId);
|
|
1396
|
+
}
|
|
1397
|
+
fixed2[name] = {
|
|
1398
|
+
end: value.end,
|
|
1399
|
+
inputId,
|
|
1400
|
+
start: value.start
|
|
1401
|
+
};
|
|
1402
|
+
} else {
|
|
1403
|
+
fixed2[name] = value;
|
|
1198
1404
|
}
|
|
1199
|
-
fixed[name] = {
|
|
1200
|
-
end: value.end,
|
|
1201
|
-
inputId,
|
|
1202
|
-
start: value.start
|
|
1203
|
-
};
|
|
1204
|
-
} else {
|
|
1205
|
-
fixed[name] = value;
|
|
1206
1405
|
}
|
|
1207
1406
|
}
|
|
1407
|
+
let fixed = holderOfRoot[0];
|
|
1208
1408
|
if (emitInputs) {
|
|
1209
1409
|
fixed.inputs = [...inputs.keys()].map((input) => input.toJSON());
|
|
1210
1410
|
}
|
|
@@ -1239,6 +1439,7 @@ var require_node = __commonJS({
|
|
|
1239
1439
|
var require_comment = __commonJS({
|
|
1240
1440
|
"node_modules/postcss/lib/comment.js"(exports2, module2) {
|
|
1241
1441
|
"use strict";
|
|
1442
|
+
init_define_AI_KIT_FILES();
|
|
1242
1443
|
var Node2 = require_node();
|
|
1243
1444
|
var Comment2 = class extends Node2 {
|
|
1244
1445
|
constructor(defaults) {
|
|
@@ -1255,6 +1456,7 @@ var require_comment = __commonJS({
|
|
|
1255
1456
|
var require_declaration = __commonJS({
|
|
1256
1457
|
"node_modules/postcss/lib/declaration.js"(exports2, module2) {
|
|
1257
1458
|
"use strict";
|
|
1459
|
+
init_define_AI_KIT_FILES();
|
|
1258
1460
|
var Node2 = require_node();
|
|
1259
1461
|
var Declaration2 = class extends Node2 {
|
|
1260
1462
|
get variable() {
|
|
@@ -1277,6 +1479,7 @@ var require_declaration = __commonJS({
|
|
|
1277
1479
|
var require_container = __commonJS({
|
|
1278
1480
|
"node_modules/postcss/lib/container.js"(exports2, module2) {
|
|
1279
1481
|
"use strict";
|
|
1482
|
+
init_define_AI_KIT_FILES();
|
|
1280
1483
|
var Comment2 = require_comment();
|
|
1281
1484
|
var Declaration2 = require_declaration();
|
|
1282
1485
|
var Node2 = require_node();
|
|
@@ -1286,17 +1489,24 @@ var require_container = __commonJS({
|
|
|
1286
1489
|
var Root2;
|
|
1287
1490
|
var Rule2;
|
|
1288
1491
|
function cleanSource(nodes) {
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1492
|
+
let stack = nodes.slice();
|
|
1493
|
+
while (stack.length > 0) {
|
|
1494
|
+
let node = stack.pop();
|
|
1495
|
+
delete node.source;
|
|
1496
|
+
if (node.nodes) {
|
|
1497
|
+
node.nodes = node.nodes.slice();
|
|
1498
|
+
for (let i of node.nodes) stack.push(i);
|
|
1499
|
+
}
|
|
1500
|
+
}
|
|
1501
|
+
return nodes.slice();
|
|
1294
1502
|
}
|
|
1295
1503
|
function markTreeDirty(node) {
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1504
|
+
let stack = [node];
|
|
1505
|
+
while (stack.length > 0) {
|
|
1506
|
+
let next = stack.pop();
|
|
1507
|
+
next[isClean] = false;
|
|
1508
|
+
if (next.proxyOf.nodes) {
|
|
1509
|
+
for (let i of next.proxyOf.nodes) stack.push(i);
|
|
1300
1510
|
}
|
|
1301
1511
|
}
|
|
1302
1512
|
}
|
|
@@ -1318,9 +1528,17 @@ var require_container = __commonJS({
|
|
|
1318
1528
|
return this;
|
|
1319
1529
|
}
|
|
1320
1530
|
cleanRaws(keepBetween) {
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1531
|
+
let stack = [this];
|
|
1532
|
+
while (stack.length > 0) {
|
|
1533
|
+
let node = stack.pop();
|
|
1534
|
+
if (node !== this && node.cleanRaws !== _Container.prototype.cleanRaws) {
|
|
1535
|
+
node.cleanRaws(keepBetween);
|
|
1536
|
+
continue;
|
|
1537
|
+
}
|
|
1538
|
+
Node2.prototype.cleanRaws.call(node, keepBetween);
|
|
1539
|
+
if (node.nodes) {
|
|
1540
|
+
for (let child of node.nodes) stack.push(child);
|
|
1541
|
+
}
|
|
1324
1542
|
}
|
|
1325
1543
|
}
|
|
1326
1544
|
each(callback) {
|
|
@@ -1535,18 +1753,38 @@ var require_container = __commonJS({
|
|
|
1535
1753
|
return this.nodes.some(condition);
|
|
1536
1754
|
}
|
|
1537
1755
|
walk(callback) {
|
|
1538
|
-
|
|
1756
|
+
if (!this.proxyOf.nodes) return void 0;
|
|
1757
|
+
let stack = [{ iterator: this.getIterator(), node: this.proxyOf }];
|
|
1758
|
+
while (stack.length > 0) {
|
|
1759
|
+
let { iterator, node } = stack[stack.length - 1];
|
|
1760
|
+
let index = node.indexes[iterator];
|
|
1761
|
+
if (index >= node.proxyOf.nodes.length) {
|
|
1762
|
+
delete node.indexes[iterator];
|
|
1763
|
+
stack.pop();
|
|
1764
|
+
let parent = stack[stack.length - 1];
|
|
1765
|
+
if (parent) parent.node.indexes[parent.iterator] += 1;
|
|
1766
|
+
continue;
|
|
1767
|
+
}
|
|
1768
|
+
let child = node.proxyOf.nodes[index];
|
|
1539
1769
|
let result;
|
|
1540
1770
|
try {
|
|
1541
|
-
result = callback(child,
|
|
1771
|
+
result = callback(child, index);
|
|
1542
1772
|
} catch (e) {
|
|
1543
1773
|
throw child.addToError(e);
|
|
1544
1774
|
}
|
|
1545
|
-
if (result
|
|
1546
|
-
|
|
1775
|
+
if (result === false) {
|
|
1776
|
+
for (let opened of stack) {
|
|
1777
|
+
delete opened.node.indexes[opened.iterator];
|
|
1778
|
+
}
|
|
1779
|
+
return false;
|
|
1547
1780
|
}
|
|
1548
|
-
|
|
1549
|
-
|
|
1781
|
+
if (child.walk && child.proxyOf.nodes) {
|
|
1782
|
+
stack.push({ iterator: child.getIterator(), node: child });
|
|
1783
|
+
} else {
|
|
1784
|
+
node.indexes[iterator] += 1;
|
|
1785
|
+
}
|
|
1786
|
+
}
|
|
1787
|
+
return void 0;
|
|
1550
1788
|
}
|
|
1551
1789
|
walkAtRules(name, callback) {
|
|
1552
1790
|
if (!callback) {
|
|
@@ -1637,22 +1875,24 @@ var require_container = __commonJS({
|
|
|
1637
1875
|
module2.exports = Container2;
|
|
1638
1876
|
Container2.default = Container2;
|
|
1639
1877
|
Container2.rebuild = (node) => {
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1878
|
+
let stack = [node];
|
|
1879
|
+
while (stack.length > 0) {
|
|
1880
|
+
let next = stack.pop();
|
|
1881
|
+
if (next.type === "atrule") {
|
|
1882
|
+
Object.setPrototypeOf(next, AtRule2.prototype);
|
|
1883
|
+
} else if (next.type === "rule") {
|
|
1884
|
+
Object.setPrototypeOf(next, Rule2.prototype);
|
|
1885
|
+
} else if (next.type === "decl") {
|
|
1886
|
+
Object.setPrototypeOf(next, Declaration2.prototype);
|
|
1887
|
+
} else if (next.type === "comment") {
|
|
1888
|
+
Object.setPrototypeOf(next, Comment2.prototype);
|
|
1889
|
+
} else if (next.type === "root") {
|
|
1890
|
+
Object.setPrototypeOf(next, Root2.prototype);
|
|
1891
|
+
}
|
|
1892
|
+
next[my] = true;
|
|
1893
|
+
if (next.nodes) {
|
|
1894
|
+
for (let child of next.nodes) stack.push(child);
|
|
1895
|
+
}
|
|
1656
1896
|
}
|
|
1657
1897
|
};
|
|
1658
1898
|
}
|
|
@@ -1662,6 +1902,7 @@ var require_container = __commonJS({
|
|
|
1662
1902
|
var require_at_rule = __commonJS({
|
|
1663
1903
|
"node_modules/postcss/lib/at-rule.js"(exports2, module2) {
|
|
1664
1904
|
"use strict";
|
|
1905
|
+
init_define_AI_KIT_FILES();
|
|
1665
1906
|
var Container2 = require_container();
|
|
1666
1907
|
var AtRule2 = class extends Container2 {
|
|
1667
1908
|
constructor(defaults) {
|
|
@@ -1687,6 +1928,7 @@ var require_at_rule = __commonJS({
|
|
|
1687
1928
|
var require_document = __commonJS({
|
|
1688
1929
|
"node_modules/postcss/lib/document.js"(exports2, module2) {
|
|
1689
1930
|
"use strict";
|
|
1931
|
+
init_define_AI_KIT_FILES();
|
|
1690
1932
|
var Container2 = require_container();
|
|
1691
1933
|
var LazyResult;
|
|
1692
1934
|
var Processor2;
|
|
@@ -1716,12 +1958,13 @@ var require_document = __commonJS({
|
|
|
1716
1958
|
// node_modules/nanoid/non-secure/index.cjs
|
|
1717
1959
|
var require_non_secure = __commonJS({
|
|
1718
1960
|
"node_modules/nanoid/non-secure/index.cjs"(exports2, module2) {
|
|
1961
|
+
init_define_AI_KIT_FILES();
|
|
1719
1962
|
var urlAlphabet = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
|
|
1720
1963
|
var customAlphabet = (alphabet, defaultSize = 21) => {
|
|
1721
1964
|
return (size = defaultSize) => {
|
|
1722
1965
|
let id = "";
|
|
1723
1966
|
let i = size | 0;
|
|
1724
|
-
while (i--) {
|
|
1967
|
+
while (i-- > 0) {
|
|
1725
1968
|
id += alphabet[Math.random() * alphabet.length | 0];
|
|
1726
1969
|
}
|
|
1727
1970
|
return id;
|
|
@@ -1730,7 +1973,7 @@ var require_non_secure = __commonJS({
|
|
|
1730
1973
|
var nanoid = (size = 21) => {
|
|
1731
1974
|
let id = "";
|
|
1732
1975
|
let i = size | 0;
|
|
1733
|
-
while (i--) {
|
|
1976
|
+
while (i-- > 0) {
|
|
1734
1977
|
id += urlAlphabet[Math.random() * 64 | 0];
|
|
1735
1978
|
}
|
|
1736
1979
|
return id;
|
|
@@ -1742,6 +1985,7 @@ var require_non_secure = __commonJS({
|
|
|
1742
1985
|
// node_modules/source-map-js/lib/base64.js
|
|
1743
1986
|
var require_base64 = __commonJS({
|
|
1744
1987
|
"node_modules/source-map-js/lib/base64.js"(exports2) {
|
|
1988
|
+
init_define_AI_KIT_FILES();
|
|
1745
1989
|
var intToCharMap = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");
|
|
1746
1990
|
exports2.encode = function(number) {
|
|
1747
1991
|
if (0 <= number && number < intToCharMap.length) {
|
|
@@ -1783,6 +2027,7 @@ var require_base64 = __commonJS({
|
|
|
1783
2027
|
// node_modules/source-map-js/lib/base64-vlq.js
|
|
1784
2028
|
var require_base64_vlq = __commonJS({
|
|
1785
2029
|
"node_modules/source-map-js/lib/base64-vlq.js"(exports2) {
|
|
2030
|
+
init_define_AI_KIT_FILES();
|
|
1786
2031
|
var base64 = require_base64();
|
|
1787
2032
|
var VLQ_BASE_SHIFT = 5;
|
|
1788
2033
|
var VLQ_BASE = 1 << VLQ_BASE_SHIFT;
|
|
@@ -1837,6 +2082,7 @@ var require_base64_vlq = __commonJS({
|
|
|
1837
2082
|
// node_modules/source-map-js/lib/util.js
|
|
1838
2083
|
var require_util = __commonJS({
|
|
1839
2084
|
"node_modules/source-map-js/lib/util.js"(exports2) {
|
|
2085
|
+
init_define_AI_KIT_FILES();
|
|
1840
2086
|
function getArg(aArgs, aName, aDefaultValue) {
|
|
1841
2087
|
if (aName in aArgs) {
|
|
1842
2088
|
return aArgs[aName];
|
|
@@ -2217,6 +2463,7 @@ var require_util = __commonJS({
|
|
|
2217
2463
|
// node_modules/source-map-js/lib/array-set.js
|
|
2218
2464
|
var require_array_set = __commonJS({
|
|
2219
2465
|
"node_modules/source-map-js/lib/array-set.js"(exports2) {
|
|
2466
|
+
init_define_AI_KIT_FILES();
|
|
2220
2467
|
var util = require_util();
|
|
2221
2468
|
var has = Object.prototype.hasOwnProperty;
|
|
2222
2469
|
var hasNativeMap = typeof Map !== "undefined";
|
|
@@ -2287,6 +2534,7 @@ var require_array_set = __commonJS({
|
|
|
2287
2534
|
// node_modules/source-map-js/lib/mapping-list.js
|
|
2288
2535
|
var require_mapping_list = __commonJS({
|
|
2289
2536
|
"node_modules/source-map-js/lib/mapping-list.js"(exports2) {
|
|
2537
|
+
init_define_AI_KIT_FILES();
|
|
2290
2538
|
var util = require_util();
|
|
2291
2539
|
function generatedPositionAfter(mappingA, mappingB) {
|
|
2292
2540
|
var lineA = mappingA.generatedLine;
|
|
@@ -2326,6 +2574,7 @@ var require_mapping_list = __commonJS({
|
|
|
2326
2574
|
// node_modules/source-map-js/lib/source-map-generator.js
|
|
2327
2575
|
var require_source_map_generator = __commonJS({
|
|
2328
2576
|
"node_modules/source-map-js/lib/source-map-generator.js"(exports2) {
|
|
2577
|
+
init_define_AI_KIT_FILES();
|
|
2329
2578
|
var base64VLQ = require_base64_vlq();
|
|
2330
2579
|
var util = require_util();
|
|
2331
2580
|
var ArraySet = require_array_set().ArraySet;
|
|
@@ -2547,10 +2796,9 @@ var require_source_map_generator = __commonJS({
|
|
|
2547
2796
|
next = "";
|
|
2548
2797
|
if (mapping.generatedLine !== previousGeneratedLine) {
|
|
2549
2798
|
previousGeneratedColumn = 0;
|
|
2550
|
-
|
|
2551
|
-
|
|
2552
|
-
|
|
2553
|
-
}
|
|
2799
|
+
var lineDelta = mapping.generatedLine - previousGeneratedLine;
|
|
2800
|
+
next += lineDelta === 1 ? ";" : ";".repeat(lineDelta);
|
|
2801
|
+
previousGeneratedLine = mapping.generatedLine;
|
|
2554
2802
|
} else {
|
|
2555
2803
|
if (i > 0) {
|
|
2556
2804
|
if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) {
|
|
@@ -2619,6 +2867,7 @@ var require_source_map_generator = __commonJS({
|
|
|
2619
2867
|
// node_modules/source-map-js/lib/binary-search.js
|
|
2620
2868
|
var require_binary_search = __commonJS({
|
|
2621
2869
|
"node_modules/source-map-js/lib/binary-search.js"(exports2) {
|
|
2870
|
+
init_define_AI_KIT_FILES();
|
|
2622
2871
|
exports2.GREATEST_LOWER_BOUND = 1;
|
|
2623
2872
|
exports2.LEAST_UPPER_BOUND = 2;
|
|
2624
2873
|
function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) {
|
|
@@ -2675,6 +2924,7 @@ var require_binary_search = __commonJS({
|
|
|
2675
2924
|
// node_modules/source-map-js/lib/quick-sort.js
|
|
2676
2925
|
var require_quick_sort = __commonJS({
|
|
2677
2926
|
"node_modules/source-map-js/lib/quick-sort.js"(exports2) {
|
|
2927
|
+
init_define_AI_KIT_FILES();
|
|
2678
2928
|
function SortTemplate(comparator) {
|
|
2679
2929
|
function swap(ary, x, y2) {
|
|
2680
2930
|
var temp = ary[x];
|
|
@@ -2709,9 +2959,17 @@ var require_quick_sort = __commonJS({
|
|
|
2709
2959
|
let templateFn = new Function(`return ${template}`)();
|
|
2710
2960
|
return templateFn(comparator);
|
|
2711
2961
|
}
|
|
2962
|
+
var isEvalAllowed = (function() {
|
|
2963
|
+
try {
|
|
2964
|
+
new Function("return 0")();
|
|
2965
|
+
return true;
|
|
2966
|
+
} catch {
|
|
2967
|
+
return false;
|
|
2968
|
+
}
|
|
2969
|
+
})();
|
|
2712
2970
|
var sortCache = /* @__PURE__ */ new WeakMap();
|
|
2713
2971
|
exports2.quickSort = function(ary, comparator, start = 0) {
|
|
2714
|
-
let doQuickSort = sortCache.get(comparator);
|
|
2972
|
+
let doQuickSort = isEvalAllowed ? sortCache.get(comparator) : SortTemplate(comparator);
|
|
2715
2973
|
if (doQuickSort === void 0) {
|
|
2716
2974
|
doQuickSort = cloneSort(comparator);
|
|
2717
2975
|
sortCache.set(comparator, doQuickSort);
|
|
@@ -2724,11 +2982,13 @@ var require_quick_sort = __commonJS({
|
|
|
2724
2982
|
// node_modules/source-map-js/lib/source-map-consumer.js
|
|
2725
2983
|
var require_source_map_consumer = __commonJS({
|
|
2726
2984
|
"node_modules/source-map-js/lib/source-map-consumer.js"(exports2) {
|
|
2985
|
+
init_define_AI_KIT_FILES();
|
|
2727
2986
|
var util = require_util();
|
|
2728
2987
|
var binarySearch = require_binary_search();
|
|
2729
2988
|
var ArraySet = require_array_set().ArraySet;
|
|
2730
2989
|
var base64VLQ = require_base64_vlq();
|
|
2731
2990
|
var quickSort = require_quick_sort().quickSort;
|
|
2991
|
+
var MAX_SECTION_OFFSET_LINE = 1e7;
|
|
2732
2992
|
function SourceMapConsumer(aSourceMap, aSourceMapURL) {
|
|
2733
2993
|
var sourceMap = aSourceMap;
|
|
2734
2994
|
if (typeof aSourceMap === "string") {
|
|
@@ -3221,6 +3481,7 @@ var require_source_map_consumer = __commonJS({
|
|
|
3221
3481
|
line: -1,
|
|
3222
3482
|
column: 0
|
|
3223
3483
|
};
|
|
3484
|
+
var maxOffsetLine = 0;
|
|
3224
3485
|
this._sections = sections.map(function(s) {
|
|
3225
3486
|
if (s.url) {
|
|
3226
3487
|
throw new Error("Support for url field in sections not implemented.");
|
|
@@ -3228,10 +3489,24 @@ var require_source_map_consumer = __commonJS({
|
|
|
3228
3489
|
var offset = util.getArg(s, "offset");
|
|
3229
3490
|
var offsetLine = util.getArg(offset, "line");
|
|
3230
3491
|
var offsetColumn = util.getArg(offset, "column");
|
|
3492
|
+
if (!isValidOffset(offsetLine) || !isValidOffset(offsetColumn)) {
|
|
3493
|
+
throw new Error("Section offset line and column must be non-negative integers.");
|
|
3494
|
+
}
|
|
3495
|
+
if (offsetLine > MAX_SECTION_OFFSET_LINE) {
|
|
3496
|
+
throw new Error("Section offset line must not exceed " + MAX_SECTION_OFFSET_LINE + ".");
|
|
3497
|
+
}
|
|
3231
3498
|
if (offsetLine < lastOffset.line || offsetLine === lastOffset.line && offsetColumn < lastOffset.column) {
|
|
3232
3499
|
throw new Error("Section offsets must be ordered and non-overlapping.");
|
|
3233
3500
|
}
|
|
3234
3501
|
lastOffset = offset;
|
|
3502
|
+
var consumer = new SourceMapConsumer(util.getArg(s, "map"), aSourceMapURL);
|
|
3503
|
+
var totalOffsetLine = offsetLine + (consumer._maxOffsetLine || 0);
|
|
3504
|
+
if (totalOffsetLine > MAX_SECTION_OFFSET_LINE) {
|
|
3505
|
+
throw new Error("Section offset line must not exceed " + MAX_SECTION_OFFSET_LINE + ", including offsets of nested sections.");
|
|
3506
|
+
}
|
|
3507
|
+
if (totalOffsetLine > maxOffsetLine) {
|
|
3508
|
+
maxOffsetLine = totalOffsetLine;
|
|
3509
|
+
}
|
|
3235
3510
|
return {
|
|
3236
3511
|
generatedOffset: {
|
|
3237
3512
|
// The offset fields are 0-based, but we use 1-based indices when
|
|
@@ -3239,9 +3514,14 @@ var require_source_map_consumer = __commonJS({
|
|
|
3239
3514
|
generatedLine: offsetLine + 1,
|
|
3240
3515
|
generatedColumn: offsetColumn + 1
|
|
3241
3516
|
},
|
|
3242
|
-
consumer
|
|
3517
|
+
consumer
|
|
3243
3518
|
};
|
|
3244
3519
|
});
|
|
3520
|
+
this._maxOffsetLine = maxOffsetLine;
|
|
3521
|
+
}
|
|
3522
|
+
function isValidOffset(aValue) {
|
|
3523
|
+
return typeof aValue === "number" && aValue >= 0 && aValue <= 9007199254740991 && // Number.MAX_SAFE_INTEGER
|
|
3524
|
+
Math.floor(aValue) === aValue;
|
|
3245
3525
|
}
|
|
3246
3526
|
IndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);
|
|
3247
3527
|
IndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer;
|
|
@@ -3250,8 +3530,9 @@ var require_source_map_consumer = __commonJS({
|
|
|
3250
3530
|
get: function() {
|
|
3251
3531
|
var sources = [];
|
|
3252
3532
|
for (var i = 0; i < this._sections.length; i++) {
|
|
3253
|
-
|
|
3254
|
-
|
|
3533
|
+
var sectionSources = this._sections[i].consumer.sources;
|
|
3534
|
+
for (var j2 = 0; j2 < sectionSources.length; j2++) {
|
|
3535
|
+
sources.push(sectionSources[j2]);
|
|
3255
3536
|
}
|
|
3256
3537
|
}
|
|
3257
3538
|
return sources;
|
|
@@ -3371,6 +3652,7 @@ var require_source_map_consumer = __commonJS({
|
|
|
3371
3652
|
// node_modules/source-map-js/lib/source-node.js
|
|
3372
3653
|
var require_source_node = __commonJS({
|
|
3373
3654
|
"node_modules/source-map-js/lib/source-node.js"(exports2) {
|
|
3655
|
+
init_define_AI_KIT_FILES();
|
|
3374
3656
|
var SourceMapGenerator = require_source_map_generator().SourceMapGenerator;
|
|
3375
3657
|
var util = require_util();
|
|
3376
3658
|
var REGEX_NEWLINE = /(\r?\n)/;
|
|
@@ -3417,6 +3699,10 @@ var require_source_node = __commonJS({
|
|
|
3417
3699
|
}
|
|
3418
3700
|
}
|
|
3419
3701
|
while (lastGeneratedLine < mapping.generatedLine) {
|
|
3702
|
+
if (remainingLinesIndex >= remainingLines.length) {
|
|
3703
|
+
lastGeneratedLine = mapping.generatedLine;
|
|
3704
|
+
break;
|
|
3705
|
+
}
|
|
3420
3706
|
node.add(shiftNextLine());
|
|
3421
3707
|
lastGeneratedLine++;
|
|
3422
3708
|
}
|
|
@@ -3636,6 +3922,7 @@ var require_source_node = __commonJS({
|
|
|
3636
3922
|
// node_modules/source-map-js/source-map.js
|
|
3637
3923
|
var require_source_map = __commonJS({
|
|
3638
3924
|
"node_modules/source-map-js/source-map.js"(exports2) {
|
|
3925
|
+
init_define_AI_KIT_FILES();
|
|
3639
3926
|
exports2.SourceMapGenerator = require_source_map_generator().SourceMapGenerator;
|
|
3640
3927
|
exports2.SourceMapConsumer = require_source_map_consumer().SourceMapConsumer;
|
|
3641
3928
|
exports2.SourceNode = require_source_node().SourceNode;
|
|
@@ -3646,9 +3933,17 @@ var require_source_map = __commonJS({
|
|
|
3646
3933
|
var require_previous_map = __commonJS({
|
|
3647
3934
|
"node_modules/postcss/lib/previous-map.js"(exports2, module2) {
|
|
3648
3935
|
"use strict";
|
|
3649
|
-
|
|
3650
|
-
var {
|
|
3936
|
+
init_define_AI_KIT_FILES();
|
|
3937
|
+
var { existsSync, readFileSync, realpathSync } = require("fs");
|
|
3938
|
+
var { dirname, isAbsolute, join, relative, sep } = require("path");
|
|
3651
3939
|
var { SourceMapConsumer, SourceMapGenerator } = require_source_map();
|
|
3940
|
+
function realPath(path7) {
|
|
3941
|
+
try {
|
|
3942
|
+
return realpathSync(path7);
|
|
3943
|
+
} catch {
|
|
3944
|
+
return path7;
|
|
3945
|
+
}
|
|
3946
|
+
}
|
|
3652
3947
|
function fromBase64(str) {
|
|
3653
3948
|
if (Buffer) {
|
|
3654
3949
|
return Buffer.from(str, "base64").toString();
|
|
@@ -3659,6 +3954,7 @@ var require_previous_map = __commonJS({
|
|
|
3659
3954
|
var PreviousMap = class {
|
|
3660
3955
|
constructor(css, opts) {
|
|
3661
3956
|
if (opts.map === false) return;
|
|
3957
|
+
if (opts.unsafeMap) this.unsafeMap = true;
|
|
3662
3958
|
this.loadAnnotation(css);
|
|
3663
3959
|
this.inline = this.startWith(this.annotation, "data:");
|
|
3664
3960
|
let prev = opts.map ? opts.map.prev : void 0;
|
|
@@ -3671,7 +3967,7 @@ var require_previous_map = __commonJS({
|
|
|
3671
3967
|
}
|
|
3672
3968
|
consumer() {
|
|
3673
3969
|
if (!this.consumerCache) {
|
|
3674
|
-
this.consumerCache = new SourceMapConsumer(this.text);
|
|
3970
|
+
this.consumerCache = new SourceMapConsumer(this.json || this.text);
|
|
3675
3971
|
}
|
|
3676
3972
|
return this.consumerCache;
|
|
3677
3973
|
}
|
|
@@ -3688,7 +3984,8 @@ var require_previous_map = __commonJS({
|
|
|
3688
3984
|
if (baseUriMatch) {
|
|
3689
3985
|
return fromBase64(text.substr(baseUriMatch[0].length));
|
|
3690
3986
|
}
|
|
3691
|
-
let encoding = text.
|
|
3987
|
+
let encoding = text.slice("data:application/json;".length);
|
|
3988
|
+
encoding = encoding.slice(0, encoding.indexOf(","));
|
|
3692
3989
|
throw new Error("Unsupported source map encoding " + encoding);
|
|
3693
3990
|
}
|
|
3694
3991
|
getAnnotationURL(sourceMapString) {
|
|
@@ -3707,7 +4004,15 @@ var require_previous_map = __commonJS({
|
|
|
3707
4004
|
this.annotation = this.getAnnotationURL(css.substring(start, end));
|
|
3708
4005
|
}
|
|
3709
4006
|
}
|
|
3710
|
-
loadFile(path7) {
|
|
4007
|
+
loadFile(path7, cssFile, trusted) {
|
|
4008
|
+
if (!trusted && !this.unsafeMap) {
|
|
4009
|
+
if (!/\.map$/i.test(path7)) return void 0;
|
|
4010
|
+
if (!cssFile) return void 0;
|
|
4011
|
+
let rel = relative(realPath(dirname(cssFile)), realPath(path7));
|
|
4012
|
+
if (rel === ".." || rel.startsWith(".." + sep) || isAbsolute(rel)) {
|
|
4013
|
+
return void 0;
|
|
4014
|
+
}
|
|
4015
|
+
}
|
|
3711
4016
|
this.root = dirname(path7);
|
|
3712
4017
|
if (existsSync(path7)) {
|
|
3713
4018
|
this.mapFile = path7;
|
|
@@ -3722,7 +4027,7 @@ var require_previous_map = __commonJS({
|
|
|
3722
4027
|
} else if (typeof prev === "function") {
|
|
3723
4028
|
let prevPath = prev(file);
|
|
3724
4029
|
if (prevPath) {
|
|
3725
|
-
let map = this.loadFile(prevPath);
|
|
4030
|
+
let map = this.loadFile(prevPath, file, true);
|
|
3726
4031
|
if (!map) {
|
|
3727
4032
|
throw new Error(
|
|
3728
4033
|
"Unable to load previous source map: " + prevPath.toString()
|
|
@@ -3746,7 +4051,15 @@ var require_previous_map = __commonJS({
|
|
|
3746
4051
|
} else if (this.annotation) {
|
|
3747
4052
|
let map = this.annotation;
|
|
3748
4053
|
if (file) map = join(dirname(file), map);
|
|
3749
|
-
|
|
4054
|
+
let unknown = this.loadFile(map, file, false);
|
|
4055
|
+
if (unknown) {
|
|
4056
|
+
try {
|
|
4057
|
+
this.json = JSON.parse(unknown.replace(/^\)]}'[^\n]*\n/, ""));
|
|
4058
|
+
} catch {
|
|
4059
|
+
return void 0;
|
|
4060
|
+
}
|
|
4061
|
+
}
|
|
4062
|
+
return unknown;
|
|
3750
4063
|
}
|
|
3751
4064
|
}
|
|
3752
4065
|
startWith(string, start) {
|
|
@@ -3766,6 +4079,7 @@ var require_previous_map = __commonJS({
|
|
|
3766
4079
|
var require_input = __commonJS({
|
|
3767
4080
|
"node_modules/postcss/lib/input.js"(exports2, module2) {
|
|
3768
4081
|
"use strict";
|
|
4082
|
+
init_define_AI_KIT_FILES();
|
|
3769
4083
|
var { nanoid } = require_non_secure();
|
|
3770
4084
|
var { isAbsolute, resolve } = require("path");
|
|
3771
4085
|
var { SourceMapConsumer, SourceMapGenerator } = require_source_map();
|
|
@@ -3878,7 +4192,15 @@ var require_input = __commonJS({
|
|
|
3878
4192
|
opts.plugin
|
|
3879
4193
|
);
|
|
3880
4194
|
}
|
|
3881
|
-
result.input = {
|
|
4195
|
+
result.input = {
|
|
4196
|
+
column,
|
|
4197
|
+
endColumn,
|
|
4198
|
+
endLine,
|
|
4199
|
+
endOffset,
|
|
4200
|
+
line,
|
|
4201
|
+
offset,
|
|
4202
|
+
source: this.css
|
|
4203
|
+
};
|
|
3882
4204
|
if (this.file) {
|
|
3883
4205
|
if (pathToFileURL) {
|
|
3884
4206
|
result.input.url = pathToFileURL(this.file).toString();
|
|
@@ -3927,11 +4249,15 @@ var require_input = __commonJS({
|
|
|
3927
4249
|
origin(line, column, endLine, endColumn) {
|
|
3928
4250
|
if (!this.map) return false;
|
|
3929
4251
|
let consumer = this.map.consumer();
|
|
3930
|
-
let from = consumer.originalPositionFor({ column, line });
|
|
4252
|
+
let from = consumer.originalPositionFor({ column: column - 1, line });
|
|
3931
4253
|
if (!from.source) return false;
|
|
3932
4254
|
let to;
|
|
3933
4255
|
if (typeof endLine === "number") {
|
|
3934
|
-
|
|
4256
|
+
let toPosition = consumer.originalPositionFor({
|
|
4257
|
+
column: endColumn - 1,
|
|
4258
|
+
line: endLine
|
|
4259
|
+
});
|
|
4260
|
+
if (toPosition.source) to = toPosition;
|
|
3935
4261
|
}
|
|
3936
4262
|
let fromUrl;
|
|
3937
4263
|
if (isAbsolute(from.source)) {
|
|
@@ -3943,8 +4269,8 @@ var require_input = __commonJS({
|
|
|
3943
4269
|
);
|
|
3944
4270
|
}
|
|
3945
4271
|
let result = {
|
|
3946
|
-
column: from.column,
|
|
3947
|
-
endColumn: to && to.column,
|
|
4272
|
+
column: from.column + 1,
|
|
4273
|
+
endColumn: to && to.column + 1,
|
|
3948
4274
|
endLine: to && to.line,
|
|
3949
4275
|
line: from.line,
|
|
3950
4276
|
url: fromUrl.toString()
|
|
@@ -3988,6 +4314,7 @@ var require_input = __commonJS({
|
|
|
3988
4314
|
var require_root = __commonJS({
|
|
3989
4315
|
"node_modules/postcss/lib/root.js"(exports2, module2) {
|
|
3990
4316
|
"use strict";
|
|
4317
|
+
init_define_AI_KIT_FILES();
|
|
3991
4318
|
var Container2 = require_container();
|
|
3992
4319
|
var LazyResult;
|
|
3993
4320
|
var Processor2;
|
|
@@ -3998,6 +4325,12 @@ var require_root = __commonJS({
|
|
|
3998
4325
|
if (!this.nodes) this.nodes = [];
|
|
3999
4326
|
}
|
|
4000
4327
|
normalize(child, sample, type) {
|
|
4328
|
+
let keepBefore = /* @__PURE__ */ new Set();
|
|
4329
|
+
for (let node of Array.isArray(child) ? child : [child]) {
|
|
4330
|
+
if (node && typeof node === "object" && !node.parent && node.raws && typeof node.raws.before !== "undefined") {
|
|
4331
|
+
keepBefore.add(node.raws);
|
|
4332
|
+
}
|
|
4333
|
+
}
|
|
4001
4334
|
let nodes = super.normalize(child);
|
|
4002
4335
|
if (sample) {
|
|
4003
4336
|
if (type === "prepend") {
|
|
@@ -4008,7 +4341,9 @@ var require_root = __commonJS({
|
|
|
4008
4341
|
}
|
|
4009
4342
|
} else if (this.first !== sample) {
|
|
4010
4343
|
for (let node of nodes) {
|
|
4011
|
-
node.raws
|
|
4344
|
+
if (!keepBefore.has(node.raws)) {
|
|
4345
|
+
node.raws.before = sample.raws.before;
|
|
4346
|
+
}
|
|
4012
4347
|
}
|
|
4013
4348
|
}
|
|
4014
4349
|
}
|
|
@@ -4042,6 +4377,7 @@ var require_root = __commonJS({
|
|
|
4042
4377
|
var require_list = __commonJS({
|
|
4043
4378
|
"node_modules/postcss/lib/list.js"(exports2, module2) {
|
|
4044
4379
|
"use strict";
|
|
4380
|
+
init_define_AI_KIT_FILES();
|
|
4045
4381
|
var list2 = {
|
|
4046
4382
|
comma(string) {
|
|
4047
4383
|
return list2.split(string, [","], true);
|
|
@@ -4051,6 +4387,7 @@ var require_list = __commonJS({
|
|
|
4051
4387
|
return list2.split(string, spaces);
|
|
4052
4388
|
},
|
|
4053
4389
|
split(string, separators, last) {
|
|
4390
|
+
if (typeof string !== "string") return [];
|
|
4054
4391
|
let array = [];
|
|
4055
4392
|
let current = "";
|
|
4056
4393
|
let split = false;
|
|
@@ -4058,7 +4395,18 @@ var require_list = __commonJS({
|
|
|
4058
4395
|
let inQuote = false;
|
|
4059
4396
|
let prevQuote = "";
|
|
4060
4397
|
let escape = false;
|
|
4061
|
-
|
|
4398
|
+
let inComment = false;
|
|
4399
|
+
for (let i = 0; i < string.length; i++) {
|
|
4400
|
+
let letter = string[i];
|
|
4401
|
+
if (inComment) {
|
|
4402
|
+
current += letter;
|
|
4403
|
+
if (letter === "*" && string[i + 1] === "/") {
|
|
4404
|
+
current += "/";
|
|
4405
|
+
i += 1;
|
|
4406
|
+
inComment = false;
|
|
4407
|
+
}
|
|
4408
|
+
continue;
|
|
4409
|
+
}
|
|
4062
4410
|
if (escape) {
|
|
4063
4411
|
escape = false;
|
|
4064
4412
|
} else if (letter === "\\") {
|
|
@@ -4070,6 +4418,11 @@ var require_list = __commonJS({
|
|
|
4070
4418
|
} else if (letter === '"' || letter === "'") {
|
|
4071
4419
|
inQuote = true;
|
|
4072
4420
|
prevQuote = letter;
|
|
4421
|
+
} else if (letter === "/" && string[i + 1] === "*") {
|
|
4422
|
+
current += "/*";
|
|
4423
|
+
i += 1;
|
|
4424
|
+
inComment = true;
|
|
4425
|
+
continue;
|
|
4073
4426
|
} else if (letter === "(") {
|
|
4074
4427
|
func += 1;
|
|
4075
4428
|
} else if (letter === ")") {
|
|
@@ -4078,14 +4431,16 @@ var require_list = __commonJS({
|
|
|
4078
4431
|
if (separators.includes(letter)) split = true;
|
|
4079
4432
|
}
|
|
4080
4433
|
if (split) {
|
|
4081
|
-
|
|
4434
|
+
let value2 = current.trim();
|
|
4435
|
+
if (last || value2 !== "") array.push(value2);
|
|
4082
4436
|
current = "";
|
|
4083
4437
|
split = false;
|
|
4084
4438
|
} else {
|
|
4085
4439
|
current += letter;
|
|
4086
4440
|
}
|
|
4087
4441
|
}
|
|
4088
|
-
|
|
4442
|
+
let value = current.trim();
|
|
4443
|
+
if (last || value !== "") array.push(value);
|
|
4089
4444
|
return array;
|
|
4090
4445
|
}
|
|
4091
4446
|
};
|
|
@@ -4098,6 +4453,7 @@ var require_list = __commonJS({
|
|
|
4098
4453
|
var require_rule = __commonJS({
|
|
4099
4454
|
"node_modules/postcss/lib/rule.js"(exports2, module2) {
|
|
4100
4455
|
"use strict";
|
|
4456
|
+
init_define_AI_KIT_FILES();
|
|
4101
4457
|
var Container2 = require_container();
|
|
4102
4458
|
var list2 = require_list();
|
|
4103
4459
|
var Rule2 = class extends Container2 {
|
|
@@ -4125,6 +4481,7 @@ var require_rule = __commonJS({
|
|
|
4125
4481
|
var require_fromJSON = __commonJS({
|
|
4126
4482
|
"node_modules/postcss/lib/fromJSON.js"(exports2, module2) {
|
|
4127
4483
|
"use strict";
|
|
4484
|
+
init_define_AI_KIT_FILES();
|
|
4128
4485
|
var AtRule2 = require_at_rule();
|
|
4129
4486
|
var Comment2 = require_comment();
|
|
4130
4487
|
var Declaration2 = require_declaration();
|
|
@@ -4132,25 +4489,23 @@ var require_fromJSON = __commonJS({
|
|
|
4132
4489
|
var PreviousMap = require_previous_map();
|
|
4133
4490
|
var Root2 = require_root();
|
|
4134
4491
|
var Rule2 = require_rule();
|
|
4135
|
-
function
|
|
4136
|
-
if (
|
|
4137
|
-
|
|
4138
|
-
|
|
4139
|
-
|
|
4140
|
-
|
|
4141
|
-
|
|
4142
|
-
|
|
4143
|
-
|
|
4144
|
-
...inputHydrated.map,
|
|
4145
|
-
__proto__: PreviousMap.prototype
|
|
4146
|
-
};
|
|
4147
|
-
}
|
|
4148
|
-
inputs.push(inputHydrated);
|
|
4492
|
+
function hydrateInputs(json, inputs) {
|
|
4493
|
+
if (!json.inputs) return inputs;
|
|
4494
|
+
return json.inputs.map((input) => {
|
|
4495
|
+
let inputHydrated = { ...input, __proto__: Input2.prototype };
|
|
4496
|
+
if (inputHydrated.map) {
|
|
4497
|
+
inputHydrated.map = {
|
|
4498
|
+
...inputHydrated.map,
|
|
4499
|
+
__proto__: PreviousMap.prototype
|
|
4500
|
+
};
|
|
4149
4501
|
}
|
|
4150
|
-
|
|
4151
|
-
|
|
4152
|
-
|
|
4153
|
-
|
|
4502
|
+
return inputHydrated;
|
|
4503
|
+
});
|
|
4504
|
+
}
|
|
4505
|
+
function constructNode(json, inputs, children) {
|
|
4506
|
+
let defaults = { ...json };
|
|
4507
|
+
delete defaults.inputs;
|
|
4508
|
+
delete defaults.nodes;
|
|
4154
4509
|
if (defaults.source) {
|
|
4155
4510
|
let { inputId, ...source } = defaults.source;
|
|
4156
4511
|
defaults.source = source;
|
|
@@ -4158,19 +4513,59 @@ var require_fromJSON = __commonJS({
|
|
|
4158
4513
|
defaults.source.input = inputs[inputId];
|
|
4159
4514
|
}
|
|
4160
4515
|
}
|
|
4516
|
+
let node;
|
|
4161
4517
|
if (defaults.type === "root") {
|
|
4162
|
-
|
|
4518
|
+
node = new Root2(defaults);
|
|
4163
4519
|
} else if (defaults.type === "decl") {
|
|
4164
|
-
|
|
4520
|
+
node = new Declaration2(defaults);
|
|
4165
4521
|
} else if (defaults.type === "rule") {
|
|
4166
|
-
|
|
4522
|
+
node = new Rule2(defaults);
|
|
4167
4523
|
} else if (defaults.type === "comment") {
|
|
4168
|
-
|
|
4524
|
+
node = new Comment2(defaults);
|
|
4169
4525
|
} else if (defaults.type === "atrule") {
|
|
4170
|
-
|
|
4526
|
+
node = new AtRule2(defaults);
|
|
4171
4527
|
} else {
|
|
4172
4528
|
throw new Error("Unknown node type: " + json.type);
|
|
4173
4529
|
}
|
|
4530
|
+
if (children) {
|
|
4531
|
+
node.nodes = children;
|
|
4532
|
+
for (let child of children) child.parent = node;
|
|
4533
|
+
}
|
|
4534
|
+
return node;
|
|
4535
|
+
}
|
|
4536
|
+
function fromJSON2(json, inputs) {
|
|
4537
|
+
if (Array.isArray(json)) return json.map((n) => fromJSON2(n));
|
|
4538
|
+
let result;
|
|
4539
|
+
let stack = [
|
|
4540
|
+
{ childIndex: 0, children: [], inputs: hydrateInputs(json, inputs), json }
|
|
4541
|
+
];
|
|
4542
|
+
while (stack.length > 0) {
|
|
4543
|
+
let frame = stack[stack.length - 1];
|
|
4544
|
+
let jsonNodes = frame.json.nodes;
|
|
4545
|
+
if (jsonNodes && frame.childIndex < jsonNodes.length) {
|
|
4546
|
+
let childJson = jsonNodes[frame.childIndex];
|
|
4547
|
+
frame.childIndex += 1;
|
|
4548
|
+
stack.push({
|
|
4549
|
+
childIndex: 0,
|
|
4550
|
+
children: [],
|
|
4551
|
+
inputs: hydrateInputs(childJson, frame.inputs),
|
|
4552
|
+
json: childJson
|
|
4553
|
+
});
|
|
4554
|
+
continue;
|
|
4555
|
+
}
|
|
4556
|
+
stack.pop();
|
|
4557
|
+
let node = constructNode(
|
|
4558
|
+
frame.json,
|
|
4559
|
+
frame.inputs,
|
|
4560
|
+
jsonNodes ? frame.children : void 0
|
|
4561
|
+
);
|
|
4562
|
+
if (stack.length > 0) {
|
|
4563
|
+
stack[stack.length - 1].children.push(node);
|
|
4564
|
+
} else {
|
|
4565
|
+
result = node;
|
|
4566
|
+
}
|
|
4567
|
+
}
|
|
4568
|
+
return result;
|
|
4174
4569
|
}
|
|
4175
4570
|
module2.exports = fromJSON2;
|
|
4176
4571
|
fromJSON2.default = fromJSON2;
|
|
@@ -4181,6 +4576,7 @@ var require_fromJSON = __commonJS({
|
|
|
4181
4576
|
var require_map_generator = __commonJS({
|
|
4182
4577
|
"node_modules/postcss/lib/map-generator.js"(exports2, module2) {
|
|
4183
4578
|
"use strict";
|
|
4579
|
+
init_define_AI_KIT_FILES();
|
|
4184
4580
|
var { dirname, relative, resolve, sep } = require("path");
|
|
4185
4581
|
var { SourceMapConsumer, SourceMapGenerator } = require_source_map();
|
|
4186
4582
|
var { pathToFileURL } = require("url");
|
|
@@ -4243,7 +4639,20 @@ var require_map_generator = __commonJS({
|
|
|
4243
4639
|
}
|
|
4244
4640
|
}
|
|
4245
4641
|
} else if (this.css) {
|
|
4246
|
-
|
|
4642
|
+
let annotation = "/*# sourceMappingURL=";
|
|
4643
|
+
let css = "";
|
|
4644
|
+
let cursor = 0;
|
|
4645
|
+
let startIndex;
|
|
4646
|
+
while ((startIndex = this.css.indexOf(annotation, cursor)) !== -1) {
|
|
4647
|
+
let endIndex = this.css.indexOf("*/", startIndex + annotation.length);
|
|
4648
|
+
if (endIndex === -1) break;
|
|
4649
|
+
while (startIndex > cursor && this.css[startIndex - 1] === "\n") {
|
|
4650
|
+
startIndex--;
|
|
4651
|
+
}
|
|
4652
|
+
css += this.css.slice(cursor, startIndex);
|
|
4653
|
+
cursor = endIndex + 2;
|
|
4654
|
+
}
|
|
4655
|
+
if (cursor > 0) this.css = css + this.css.slice(cursor);
|
|
4247
4656
|
}
|
|
4248
4657
|
}
|
|
4249
4658
|
generate() {
|
|
@@ -4498,6 +4907,7 @@ var require_map_generator = __commonJS({
|
|
|
4498
4907
|
var require_parser = __commonJS({
|
|
4499
4908
|
"node_modules/postcss/lib/parser.js"(exports2, module2) {
|
|
4500
4909
|
"use strict";
|
|
4910
|
+
init_define_AI_KIT_FILES();
|
|
4501
4911
|
var AtRule2 = require_at_rule();
|
|
4502
4912
|
var Comment2 = require_comment();
|
|
4503
4913
|
var Declaration2 = require_declaration();
|
|
@@ -4515,6 +4925,11 @@ var require_parser = __commonJS({
|
|
|
4515
4925
|
if (pos) return pos;
|
|
4516
4926
|
}
|
|
4517
4927
|
}
|
|
4928
|
+
function tokensToString(tokens, from, to) {
|
|
4929
|
+
let result = "";
|
|
4930
|
+
for (let i = from; i < to; i++) result += tokens[i][1];
|
|
4931
|
+
return result;
|
|
4932
|
+
}
|
|
4518
4933
|
var Parser = class {
|
|
4519
4934
|
constructor(input) {
|
|
4520
4935
|
this.input = input;
|
|
@@ -4651,7 +5066,7 @@ var require_parser = __commonJS({
|
|
|
4651
5066
|
node.source.end = this.getPosition(token[3] || token[2]);
|
|
4652
5067
|
node.source.end.offset++;
|
|
4653
5068
|
let text = token[1].slice(2, -2);
|
|
4654
|
-
if (
|
|
5069
|
+
if (!text.trim()) {
|
|
4655
5070
|
node.text = "";
|
|
4656
5071
|
node.raws.left = text;
|
|
4657
5072
|
node.raws.right = "";
|
|
@@ -4677,44 +5092,45 @@ var require_parser = __commonJS({
|
|
|
4677
5092
|
last[3] || last[2] || findLastWithPosition(tokens)
|
|
4678
5093
|
);
|
|
4679
5094
|
node.source.end.offset++;
|
|
4680
|
-
|
|
4681
|
-
|
|
4682
|
-
|
|
4683
|
-
|
|
4684
|
-
|
|
4685
|
-
node.
|
|
4686
|
-
|
|
4687
|
-
|
|
5095
|
+
let start = 0;
|
|
5096
|
+
while (tokens[start][0] !== "word") {
|
|
5097
|
+
if (start === tokens.length - 1) this.unknownWord([tokens[start]]);
|
|
5098
|
+
start++;
|
|
5099
|
+
}
|
|
5100
|
+
node.raws.before += tokensToString(tokens, 0, start);
|
|
5101
|
+
node.source.start = this.getPosition(tokens[start][2]);
|
|
5102
|
+
let propStart = start;
|
|
5103
|
+
while (start < tokens.length) {
|
|
5104
|
+
let type = tokens[start][0];
|
|
4688
5105
|
if (type === ":" || type === "space" || type === "comment") {
|
|
4689
5106
|
break;
|
|
4690
5107
|
}
|
|
4691
|
-
|
|
5108
|
+
start++;
|
|
4692
5109
|
}
|
|
4693
|
-
node.
|
|
5110
|
+
node.prop = tokensToString(tokens, propStart, start);
|
|
5111
|
+
let betweenStart = start;
|
|
4694
5112
|
let token;
|
|
4695
|
-
while (tokens.length) {
|
|
4696
|
-
token = tokens
|
|
4697
|
-
|
|
4698
|
-
|
|
4699
|
-
|
|
4700
|
-
|
|
4701
|
-
if (token[0] === "word" && /\w/.test(token[1])) {
|
|
4702
|
-
this.unknownWord([token]);
|
|
4703
|
-
}
|
|
4704
|
-
node.raws.between += token[1];
|
|
5113
|
+
while (start < tokens.length) {
|
|
5114
|
+
token = tokens[start];
|
|
5115
|
+
start++;
|
|
5116
|
+
if (token[0] === ":") break;
|
|
5117
|
+
if (token[0] === "word" && /\w/.test(token[1])) {
|
|
5118
|
+
this.unknownWord([token]);
|
|
4705
5119
|
}
|
|
4706
5120
|
}
|
|
5121
|
+
node.raws.between = tokensToString(tokens, betweenStart, start);
|
|
4707
5122
|
if (node.prop[0] === "_" || node.prop[0] === "*") {
|
|
4708
5123
|
node.raws.before += node.prop[0];
|
|
4709
5124
|
node.prop = node.prop.slice(1);
|
|
4710
5125
|
}
|
|
4711
|
-
let
|
|
4712
|
-
|
|
4713
|
-
|
|
4714
|
-
next = tokens[0][0];
|
|
5126
|
+
let firstSpacesStart = start;
|
|
5127
|
+
while (start < tokens.length) {
|
|
5128
|
+
let next = tokens[start][0];
|
|
4715
5129
|
if (next !== "space" && next !== "comment") break;
|
|
4716
|
-
|
|
5130
|
+
start++;
|
|
4717
5131
|
}
|
|
5132
|
+
let firstSpaces = tokens.slice(firstSpacesStart, start);
|
|
5133
|
+
tokens = tokens.slice(start);
|
|
4718
5134
|
this.precheckMissedSemicolon(tokens);
|
|
4719
5135
|
for (let i = tokens.length - 1; i >= 0; i--) {
|
|
4720
5136
|
token = tokens[i];
|
|
@@ -4799,7 +5215,7 @@ var require_parser = __commonJS({
|
|
|
4799
5215
|
prev.raws.ownSemicolon = this.spaces;
|
|
4800
5216
|
this.spaces = "";
|
|
4801
5217
|
prev.source.end = this.getPosition(token[2]);
|
|
4802
|
-
prev.source.end.offset
|
|
5218
|
+
prev.source.end.offset++;
|
|
4803
5219
|
}
|
|
4804
5220
|
}
|
|
4805
5221
|
}
|
|
@@ -4915,6 +5331,7 @@ var require_parser = __commonJS({
|
|
|
4915
5331
|
let token, type;
|
|
4916
5332
|
let length = tokens.length;
|
|
4917
5333
|
let value = "";
|
|
5334
|
+
let last = "";
|
|
4918
5335
|
let clean = true;
|
|
4919
5336
|
let next, prev;
|
|
4920
5337
|
for (let i = 0; i < length; i += 1) {
|
|
@@ -4926,16 +5343,18 @@ var require_parser = __commonJS({
|
|
|
4926
5343
|
prev = tokens[i - 1] ? tokens[i - 1][0] : "empty";
|
|
4927
5344
|
next = tokens[i + 1] ? tokens[i + 1][0] : "empty";
|
|
4928
5345
|
if (!SAFE_COMMENT_NEIGHBOR[prev] && !SAFE_COMMENT_NEIGHBOR[next]) {
|
|
4929
|
-
if (
|
|
5346
|
+
if (last === ",") {
|
|
4930
5347
|
clean = false;
|
|
4931
5348
|
} else {
|
|
4932
5349
|
value += token[1];
|
|
5350
|
+
last = token[1].slice(-1);
|
|
4933
5351
|
}
|
|
4934
5352
|
} else {
|
|
4935
5353
|
clean = false;
|
|
4936
5354
|
}
|
|
4937
5355
|
} else {
|
|
4938
5356
|
value += token[1];
|
|
5357
|
+
last = token[1].slice(-1);
|
|
4939
5358
|
}
|
|
4940
5359
|
}
|
|
4941
5360
|
if (!clean) {
|
|
@@ -5032,6 +5451,7 @@ var require_parser = __commonJS({
|
|
|
5032
5451
|
var require_parse = __commonJS({
|
|
5033
5452
|
"node_modules/postcss/lib/parse.js"(exports2, module2) {
|
|
5034
5453
|
"use strict";
|
|
5454
|
+
init_define_AI_KIT_FILES();
|
|
5035
5455
|
var Container2 = require_container();
|
|
5036
5456
|
var Input2 = require_input();
|
|
5037
5457
|
var Parser = require_parser();
|
|
@@ -5066,11 +5486,17 @@ var require_parse = __commonJS({
|
|
|
5066
5486
|
var require_warning = __commonJS({
|
|
5067
5487
|
"node_modules/postcss/lib/warning.js"(exports2, module2) {
|
|
5068
5488
|
"use strict";
|
|
5489
|
+
init_define_AI_KIT_FILES();
|
|
5490
|
+
var Container2 = require_container();
|
|
5491
|
+
var { my } = require_symbols();
|
|
5069
5492
|
var Warning2 = class {
|
|
5070
5493
|
constructor(text, opts = {}) {
|
|
5071
5494
|
this.type = "warning";
|
|
5072
5495
|
this.text = text;
|
|
5073
5496
|
if (opts.node && opts.node.source) {
|
|
5497
|
+
if (!opts.node[my]) {
|
|
5498
|
+
Container2.rebuild(opts.node);
|
|
5499
|
+
}
|
|
5074
5500
|
let range = opts.node.rangeBy(opts);
|
|
5075
5501
|
this.line = range.start.line;
|
|
5076
5502
|
this.column = range.start.column;
|
|
@@ -5102,6 +5528,7 @@ var require_warning = __commonJS({
|
|
|
5102
5528
|
var require_result = __commonJS({
|
|
5103
5529
|
"node_modules/postcss/lib/result.js"(exports2, module2) {
|
|
5104
5530
|
"use strict";
|
|
5531
|
+
init_define_AI_KIT_FILES();
|
|
5105
5532
|
var Warning2 = require_warning();
|
|
5106
5533
|
var Result2 = class {
|
|
5107
5534
|
get content() {
|
|
@@ -5141,6 +5568,7 @@ var require_result = __commonJS({
|
|
|
5141
5568
|
var require_warn_once = __commonJS({
|
|
5142
5569
|
"node_modules/postcss/lib/warn-once.js"(exports2, module2) {
|
|
5143
5570
|
"use strict";
|
|
5571
|
+
init_define_AI_KIT_FILES();
|
|
5144
5572
|
var printed = {};
|
|
5145
5573
|
module2.exports = function warnOnce(message) {
|
|
5146
5574
|
if (printed[message]) return;
|
|
@@ -5156,6 +5584,7 @@ var require_warn_once = __commonJS({
|
|
|
5156
5584
|
var require_lazy_result = __commonJS({
|
|
5157
5585
|
"node_modules/postcss/lib/lazy-result.js"(exports2, module2) {
|
|
5158
5586
|
"use strict";
|
|
5587
|
+
init_define_AI_KIT_FILES();
|
|
5159
5588
|
var Container2 = require_container();
|
|
5160
5589
|
var Document2 = require_document();
|
|
5161
5590
|
var MapGenerator = require_map_generator();
|
|
@@ -5243,8 +5672,14 @@ var require_lazy_result = __commonJS({
|
|
|
5243
5672
|
};
|
|
5244
5673
|
}
|
|
5245
5674
|
function cleanMarks(node) {
|
|
5246
|
-
|
|
5247
|
-
|
|
5675
|
+
let stack = [node];
|
|
5676
|
+
while (stack.length > 0) {
|
|
5677
|
+
let next = stack.pop();
|
|
5678
|
+
next[isClean] = false;
|
|
5679
|
+
if (next.nodes) {
|
|
5680
|
+
for (let i of next.nodes) stack.push(i);
|
|
5681
|
+
}
|
|
5682
|
+
}
|
|
5248
5683
|
return node;
|
|
5249
5684
|
}
|
|
5250
5685
|
var postcss2 = {};
|
|
@@ -5474,6 +5909,15 @@ var require_lazy_result = __commonJS({
|
|
|
5474
5909
|
if (opts.syntax) str = opts.syntax.stringify;
|
|
5475
5910
|
if (opts.stringifier) str = opts.stringifier;
|
|
5476
5911
|
if (str.stringify) str = str.stringify;
|
|
5912
|
+
let rootSource = this.result.root.source;
|
|
5913
|
+
if (opts.map === void 0 && !(rootSource && rootSource.input && rootSource.input.map)) {
|
|
5914
|
+
let result = "";
|
|
5915
|
+
str(this.result.root, (i) => {
|
|
5916
|
+
result += i;
|
|
5917
|
+
});
|
|
5918
|
+
this.result.css = result;
|
|
5919
|
+
return this.result;
|
|
5920
|
+
}
|
|
5477
5921
|
let map = new MapGenerator(str, this.result.root, this.result.opts);
|
|
5478
5922
|
let data = map.generate();
|
|
5479
5923
|
this.result.css = data[0];
|
|
@@ -5565,14 +6009,19 @@ var require_lazy_result = __commonJS({
|
|
|
5565
6009
|
}
|
|
5566
6010
|
if (visit2.iterator !== 0) {
|
|
5567
6011
|
let iterator = visit2.iterator;
|
|
6012
|
+
if (visit2.descending) {
|
|
6013
|
+
visit2.descending = false;
|
|
6014
|
+
node.indexes[iterator] += 1;
|
|
6015
|
+
}
|
|
5568
6016
|
let child;
|
|
5569
6017
|
while (child = node.nodes[node.indexes[iterator]]) {
|
|
5570
|
-
node.indexes[iterator] += 1;
|
|
5571
6018
|
if (!child[isClean]) {
|
|
5572
6019
|
child[isClean] = true;
|
|
6020
|
+
visit2.descending = true;
|
|
5573
6021
|
stack.push(toStack(child));
|
|
5574
6022
|
return;
|
|
5575
6023
|
}
|
|
6024
|
+
node.indexes[iterator] += 1;
|
|
5576
6025
|
}
|
|
5577
6026
|
visit2.iterator = 0;
|
|
5578
6027
|
delete node.indexes[iterator];
|
|
@@ -5596,20 +6045,53 @@ var require_lazy_result = __commonJS({
|
|
|
5596
6045
|
}
|
|
5597
6046
|
walkSync(node) {
|
|
5598
6047
|
node[isClean] = true;
|
|
5599
|
-
let
|
|
5600
|
-
|
|
5601
|
-
|
|
5602
|
-
|
|
5603
|
-
|
|
5604
|
-
|
|
5605
|
-
|
|
6048
|
+
let stack = [{ eventIndex: 0, events: getEvents(node), iterator: 0, node }];
|
|
6049
|
+
while (stack.length > 0) {
|
|
6050
|
+
let visit2 = stack[stack.length - 1];
|
|
6051
|
+
let visitNode = visit2.node;
|
|
6052
|
+
if (visit2.iterator !== 0) {
|
|
6053
|
+
let iterator = visit2.iterator;
|
|
6054
|
+
if (visit2.descending) {
|
|
6055
|
+
visit2.descending = false;
|
|
6056
|
+
visitNode.indexes[iterator] += 1;
|
|
5606
6057
|
}
|
|
5607
|
-
|
|
5608
|
-
let
|
|
5609
|
-
|
|
5610
|
-
if (
|
|
6058
|
+
let child;
|
|
6059
|
+
let descended = false;
|
|
6060
|
+
while (child = visitNode.nodes[visitNode.indexes[iterator]]) {
|
|
6061
|
+
if (!child[isClean]) {
|
|
6062
|
+
child[isClean] = true;
|
|
6063
|
+
visit2.descending = true;
|
|
6064
|
+
stack.push({
|
|
6065
|
+
eventIndex: 0,
|
|
6066
|
+
events: getEvents(child),
|
|
6067
|
+
iterator: 0,
|
|
6068
|
+
node: child
|
|
6069
|
+
});
|
|
6070
|
+
descended = true;
|
|
6071
|
+
break;
|
|
6072
|
+
}
|
|
6073
|
+
visitNode.indexes[iterator] += 1;
|
|
6074
|
+
}
|
|
6075
|
+
if (descended) continue;
|
|
6076
|
+
visit2.iterator = 0;
|
|
6077
|
+
delete visitNode.indexes[iterator];
|
|
6078
|
+
}
|
|
6079
|
+
if (visit2.eventIndex < visit2.events.length) {
|
|
6080
|
+
let event = visit2.events[visit2.eventIndex];
|
|
6081
|
+
visit2.eventIndex += 1;
|
|
6082
|
+
if (event === CHILDREN) {
|
|
6083
|
+
if (visitNode.nodes && visitNode.nodes.length) {
|
|
6084
|
+
visit2.iterator = visitNode.getIterator();
|
|
6085
|
+
}
|
|
6086
|
+
} else {
|
|
6087
|
+
let visitors = this.listeners[event];
|
|
6088
|
+
if (visitors) {
|
|
6089
|
+
if (this.visitSync(visitors, visitNode.toProxy())) stack.pop();
|
|
6090
|
+
}
|
|
5611
6091
|
}
|
|
6092
|
+
continue;
|
|
5612
6093
|
}
|
|
6094
|
+
stack.pop();
|
|
5613
6095
|
}
|
|
5614
6096
|
}
|
|
5615
6097
|
warnings() {
|
|
@@ -5630,6 +6112,7 @@ var require_lazy_result = __commonJS({
|
|
|
5630
6112
|
var require_no_work_result = __commonJS({
|
|
5631
6113
|
"node_modules/postcss/lib/no-work-result.js"(exports2, module2) {
|
|
5632
6114
|
"use strict";
|
|
6115
|
+
init_define_AI_KIT_FILES();
|
|
5633
6116
|
var MapGenerator = require_map_generator();
|
|
5634
6117
|
var parse4 = require_parse();
|
|
5635
6118
|
var Result2 = require_result();
|
|
@@ -5682,9 +6165,8 @@ var require_no_work_result = __commonJS({
|
|
|
5682
6165
|
this._css = css;
|
|
5683
6166
|
this._opts = opts;
|
|
5684
6167
|
this._map = void 0;
|
|
5685
|
-
let root2;
|
|
5686
6168
|
let str = stringify2;
|
|
5687
|
-
this.result = new Result2(this._processor,
|
|
6169
|
+
this.result = new Result2(this._processor, void 0, this._opts);
|
|
5688
6170
|
this.result.css = css;
|
|
5689
6171
|
let self = this;
|
|
5690
6172
|
Object.defineProperty(this.result, "root", {
|
|
@@ -5692,7 +6174,7 @@ var require_no_work_result = __commonJS({
|
|
|
5692
6174
|
return self.root;
|
|
5693
6175
|
}
|
|
5694
6176
|
});
|
|
5695
|
-
let map = new MapGenerator(str,
|
|
6177
|
+
let map = new MapGenerator(str, void 0, this._opts, css);
|
|
5696
6178
|
if (map.isMap()) {
|
|
5697
6179
|
let [generatedCSS, generatedMap] = map.generate();
|
|
5698
6180
|
if (generatedCSS) {
|
|
@@ -5746,13 +6228,14 @@ var require_no_work_result = __commonJS({
|
|
|
5746
6228
|
var require_processor = __commonJS({
|
|
5747
6229
|
"node_modules/postcss/lib/processor.js"(exports2, module2) {
|
|
5748
6230
|
"use strict";
|
|
6231
|
+
init_define_AI_KIT_FILES();
|
|
5749
6232
|
var Document2 = require_document();
|
|
5750
6233
|
var LazyResult = require_lazy_result();
|
|
5751
6234
|
var NoWorkResult = require_no_work_result();
|
|
5752
6235
|
var Root2 = require_root();
|
|
5753
6236
|
var Processor2 = class {
|
|
5754
6237
|
constructor(plugins = []) {
|
|
5755
|
-
this.version = "8.5.
|
|
6238
|
+
this.version = "8.5.31";
|
|
5756
6239
|
this.plugins = this.normalize(plugins);
|
|
5757
6240
|
}
|
|
5758
6241
|
normalize(plugins) {
|
|
@@ -5804,6 +6287,7 @@ var require_processor = __commonJS({
|
|
|
5804
6287
|
var require_postcss = __commonJS({
|
|
5805
6288
|
"node_modules/postcss/lib/postcss.js"(exports2, module2) {
|
|
5806
6289
|
"use strict";
|
|
6290
|
+
init_define_AI_KIT_FILES();
|
|
5807
6291
|
var AtRule2 = require_at_rule();
|
|
5808
6292
|
var Comment2 = require_comment();
|
|
5809
6293
|
var Container2 = require_container();
|
|
@@ -5836,7 +6320,7 @@ var require_postcss = __commonJS({
|
|
|
5836
6320
|
console.warn(
|
|
5837
6321
|
name + ": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration"
|
|
5838
6322
|
);
|
|
5839
|
-
if (process.env.LANG && process.env.LANG.startsWith("
|
|
6323
|
+
if (process.env.LANG && process.env.LANG.startsWith("zh")) {
|
|
5840
6324
|
console.warn(
|
|
5841
6325
|
name + ": \u91CC\u9762 postcss.plugin \u88AB\u5F03\u7528. \u8FC1\u79FB\u6307\u5357:\nhttps://www.w3ctech.com/topic/2226"
|
|
5842
6326
|
);
|
|
@@ -5888,17 +6372,35 @@ var require_postcss = __commonJS({
|
|
|
5888
6372
|
}
|
|
5889
6373
|
});
|
|
5890
6374
|
|
|
6375
|
+
// cli/src/index.ts
|
|
6376
|
+
init_define_AI_KIT_FILES();
|
|
6377
|
+
|
|
5891
6378
|
// cli/src/commands/init.ts
|
|
6379
|
+
init_define_AI_KIT_FILES();
|
|
5892
6380
|
var import_node_fs5 = __toESM(require("node:fs"));
|
|
5893
6381
|
var import_node_path5 = __toESM(require("node:path"));
|
|
5894
6382
|
|
|
6383
|
+
// node_modules/@clack/prompts/dist/index.mjs
|
|
6384
|
+
init_define_AI_KIT_FILES();
|
|
6385
|
+
|
|
5895
6386
|
// node_modules/@clack/core/dist/index.mjs
|
|
6387
|
+
init_define_AI_KIT_FILES();
|
|
5896
6388
|
var import_node_util = require("node:util");
|
|
5897
6389
|
var import_node_process = require("node:process");
|
|
5898
6390
|
var _ = __toESM(require("node:readline"), 1);
|
|
5899
6391
|
var import_node_readline = __toESM(require("node:readline"), 1);
|
|
5900
6392
|
|
|
6393
|
+
// node_modules/fast-wrap-ansi/lib/main.js
|
|
6394
|
+
init_define_AI_KIT_FILES();
|
|
6395
|
+
|
|
6396
|
+
// node_modules/fast-string-width/dist/index.js
|
|
6397
|
+
init_define_AI_KIT_FILES();
|
|
6398
|
+
|
|
6399
|
+
// node_modules/fast-string-truncated-width/dist/index.js
|
|
6400
|
+
init_define_AI_KIT_FILES();
|
|
6401
|
+
|
|
5901
6402
|
// node_modules/fast-string-truncated-width/dist/utils.js
|
|
6403
|
+
init_define_AI_KIT_FILES();
|
|
5902
6404
|
var isAmbiguous = (x) => {
|
|
5903
6405
|
return x === 161 || x === 164 || x === 167 || x === 168 || x === 170 || x === 173 || x === 174 || x >= 176 && x <= 180 || x >= 182 && x <= 186 || x >= 188 && x <= 191 || x === 198 || x === 208 || x === 215 || x === 216 || x >= 222 && x <= 225 || x === 230 || x >= 232 && x <= 234 || x === 236 || x === 237 || x === 240 || x === 242 || x === 243 || x >= 247 && x <= 250 || x === 252 || x === 254 || x === 257 || x === 273 || x === 275 || x === 283 || x === 294 || x === 295 || x === 299 || x >= 305 && x <= 307 || x === 312 || x >= 319 && x <= 322 || x === 324 || x >= 328 && x <= 331 || x === 333 || x === 338 || x === 339 || x === 358 || x === 359 || x === 363 || x === 462 || x === 464 || x === 466 || x === 468 || x === 470 || x === 472 || x === 474 || x === 476 || x === 593 || x === 609 || x === 708 || x === 711 || x >= 713 && x <= 715 || x === 717 || x === 720 || x >= 728 && x <= 731 || x === 733 || x === 735 || x >= 768 && x <= 879 || x >= 913 && x <= 929 || x >= 931 && x <= 937 || x >= 945 && x <= 961 || x >= 963 && x <= 969 || x === 1025 || x >= 1040 && x <= 1103 || x === 1105 || x === 8208 || x >= 8211 && x <= 8214 || x === 8216 || x === 8217 || x === 8220 || x === 8221 || x >= 8224 && x <= 8226 || x >= 8228 && x <= 8231 || x === 8240 || x === 8242 || x === 8243 || x === 8245 || x === 8251 || x === 8254 || x === 8308 || x === 8319 || x >= 8321 && x <= 8324 || x === 8364 || x === 8451 || x === 8453 || x === 8457 || x === 8467 || x === 8470 || x === 8481 || x === 8482 || x === 8486 || x === 8491 || x === 8531 || x === 8532 || x >= 8539 && x <= 8542 || x >= 8544 && x <= 8555 || x >= 8560 && x <= 8569 || x === 8585 || x >= 8592 && x <= 8601 || x === 8632 || x === 8633 || x === 8658 || x === 8660 || x === 8679 || x === 8704 || x === 8706 || x === 8707 || x === 8711 || x === 8712 || x === 8715 || x === 8719 || x === 8721 || x === 8725 || x === 8730 || x >= 8733 && x <= 8736 || x === 8739 || x === 8741 || x >= 8743 && x <= 8748 || x === 8750 || x >= 8756 && x <= 8759 || x === 8764 || x === 8765 || x === 8776 || x === 8780 || x === 8786 || x === 8800 || x === 8801 || x >= 8804 && x <= 8807 || x === 8810 || x === 8811 || x === 8814 || x === 8815 || x === 8834 || x === 8835 || x === 8838 || x === 8839 || x === 8853 || x === 8857 || x === 8869 || x === 8895 || x === 8978 || x >= 9312 && x <= 9449 || x >= 9451 && x <= 9547 || x >= 9552 && x <= 9587 || x >= 9600 && x <= 9615 || x >= 9618 && x <= 9621 || x === 9632 || x === 9633 || x >= 9635 && x <= 9641 || x === 9650 || x === 9651 || x === 9654 || x === 9655 || x === 9660 || x === 9661 || x === 9664 || x === 9665 || x >= 9670 && x <= 9672 || x === 9675 || x >= 9678 && x <= 9681 || x >= 9698 && x <= 9701 || x === 9711 || x === 9733 || x === 9734 || x === 9737 || x === 9742 || x === 9743 || x === 9756 || x === 9758 || x === 9792 || x === 9794 || x === 9824 || x === 9825 || x >= 9827 && x <= 9829 || x >= 9831 && x <= 9834 || x === 9836 || x === 9837 || x === 9839 || x === 9886 || x === 9887 || x === 9919 || x >= 9926 && x <= 9933 || x >= 9935 && x <= 9939 || x >= 9941 && x <= 9953 || x === 9955 || x === 9960 || x === 9961 || x >= 9963 && x <= 9969 || x === 9972 || x >= 9974 && x <= 9977 || x === 9979 || x === 9980 || x === 9982 || x === 9983 || x === 10045 || x >= 10102 && x <= 10111 || x >= 11094 && x <= 11097 || x >= 12872 && x <= 12879 || x >= 57344 && x <= 63743 || x >= 65024 && x <= 65039 || x === 65533 || x >= 127232 && x <= 127242 || x >= 127248 && x <= 127277 || x >= 127280 && x <= 127337 || x >= 127344 && x <= 127373 || x === 127375 || x === 127376 || x >= 127387 && x <= 127404 || x >= 917760 && x <= 917999 || x >= 983040 && x <= 1048573 || x >= 1048576 && x <= 1114109;
|
|
5904
6406
|
};
|
|
@@ -6856,6 +7358,7 @@ ${c2}
|
|
|
6856
7358
|
var import_picocolors = __toESM(require_picocolors());
|
|
6857
7359
|
|
|
6858
7360
|
// cli/src/utils/config.ts
|
|
7361
|
+
init_define_AI_KIT_FILES();
|
|
6859
7362
|
var import_node_fs = __toESM(require("node:fs"));
|
|
6860
7363
|
var import_node_path = __toESM(require("node:path"));
|
|
6861
7364
|
var CONFIG_FILE = "7onic.json";
|
|
@@ -6886,7 +7389,11 @@ function configExists(cwd) {
|
|
|
6886
7389
|
return import_node_fs.default.existsSync(import_node_path.default.join(cwd, CONFIG_FILE));
|
|
6887
7390
|
}
|
|
6888
7391
|
|
|
7392
|
+
// cli/src/utils/detect-framework.ts
|
|
7393
|
+
init_define_AI_KIT_FILES();
|
|
7394
|
+
|
|
6889
7395
|
// cli/src/utils/project-helpers.ts
|
|
7396
|
+
init_define_AI_KIT_FILES();
|
|
6890
7397
|
var import_node_fs2 = __toESM(require("node:fs"));
|
|
6891
7398
|
var import_node_path2 = __toESM(require("node:path"));
|
|
6892
7399
|
function pathExists(cwd, relativePath) {
|
|
@@ -6939,6 +7446,7 @@ function detectFramework(cwd) {
|
|
|
6939
7446
|
}
|
|
6940
7447
|
|
|
6941
7448
|
// cli/src/utils/detect-tailwind.ts
|
|
7449
|
+
init_define_AI_KIT_FILES();
|
|
6942
7450
|
var V3_CONFIG_FILES = [
|
|
6943
7451
|
"tailwind.config.js",
|
|
6944
7452
|
"tailwind.config.ts",
|
|
@@ -6957,6 +7465,7 @@ function detectTailwind(cwd) {
|
|
|
6957
7465
|
}
|
|
6958
7466
|
|
|
6959
7467
|
// cli/src/utils/detect-pm.ts
|
|
7468
|
+
init_define_AI_KIT_FILES();
|
|
6960
7469
|
var import_node_fs3 = __toESM(require("node:fs"));
|
|
6961
7470
|
var import_node_path3 = __toESM(require("node:path"));
|
|
6962
7471
|
var LOCKFILES = {
|
|
@@ -6976,6 +7485,7 @@ function detectPackageManager(cwd) {
|
|
|
6976
7485
|
}
|
|
6977
7486
|
|
|
6978
7487
|
// cli/src/utils/install-deps.ts
|
|
7488
|
+
init_define_AI_KIT_FILES();
|
|
6979
7489
|
var import_node_child_process = require("node:child_process");
|
|
6980
7490
|
function installDeps(deps, options) {
|
|
6981
7491
|
if (deps.length === 0) return;
|
|
@@ -6991,6 +7501,7 @@ function installDeps(deps, options) {
|
|
|
6991
7501
|
}
|
|
6992
7502
|
|
|
6993
7503
|
// cli/src/utils/graceful-exit.ts
|
|
7504
|
+
init_define_AI_KIT_FILES();
|
|
6994
7505
|
var LINK_PREFIX = "See: ";
|
|
6995
7506
|
var SECTION_SEPARATOR = "\n\n";
|
|
6996
7507
|
var DEFAULT_CANCEL_MESSAGE = "Init cancelled.";
|
|
@@ -7010,6 +7521,7 @@ function userCancel(message = DEFAULT_CANCEL_MESSAGE) {
|
|
|
7010
7521
|
}
|
|
7011
7522
|
|
|
7012
7523
|
// cli/src/utils/css-imports-builder.ts
|
|
7524
|
+
init_define_AI_KIT_FILES();
|
|
7013
7525
|
var TOKENS = "@7onic-ui/tokens";
|
|
7014
7526
|
var TOKEN_IMPORTS = {
|
|
7015
7527
|
3: [`@import '${TOKENS}/css/all.css';`],
|
|
@@ -7032,7 +7544,11 @@ function requiredTokenImports(version) {
|
|
|
7032
7544
|
return TOKEN_IMPORTS[version];
|
|
7033
7545
|
}
|
|
7034
7546
|
|
|
7547
|
+
// cli/src/utils/star-reset-wrap.ts
|
|
7548
|
+
init_define_AI_KIT_FILES();
|
|
7549
|
+
|
|
7035
7550
|
// node_modules/postcss/lib/postcss.mjs
|
|
7551
|
+
init_define_AI_KIT_FILES();
|
|
7036
7552
|
var import_postcss = __toESM(require_postcss(), 1);
|
|
7037
7553
|
var postcss_default = import_postcss.default;
|
|
7038
7554
|
var stringify = import_postcss.default.stringify;
|
|
@@ -7086,7 +7602,17 @@ function wrapStarReset(input) {
|
|
|
7086
7602
|
};
|
|
7087
7603
|
}
|
|
7088
7604
|
|
|
7605
|
+
// cli/src/utils/jsonc-parse.ts
|
|
7606
|
+
init_define_AI_KIT_FILES();
|
|
7607
|
+
|
|
7608
|
+
// node_modules/jsonc-parser/lib/esm/main.js
|
|
7609
|
+
init_define_AI_KIT_FILES();
|
|
7610
|
+
|
|
7611
|
+
// node_modules/jsonc-parser/lib/esm/impl/format.js
|
|
7612
|
+
init_define_AI_KIT_FILES();
|
|
7613
|
+
|
|
7089
7614
|
// node_modules/jsonc-parser/lib/esm/impl/scanner.js
|
|
7615
|
+
init_define_AI_KIT_FILES();
|
|
7090
7616
|
function createScanner(text, ignoreTrivia = false) {
|
|
7091
7617
|
const len = text.length;
|
|
7092
7618
|
let pos = 0, value = "", tokenOffset = 0, token = 16, lineNumber = 0, lineStartOffset = 0, tokenLineStartOffset = 0, prevTokenLineStartOffset = 0, scanError = 0;
|
|
@@ -7508,6 +8034,7 @@ var CharacterCodes;
|
|
|
7508
8034
|
})(CharacterCodes || (CharacterCodes = {}));
|
|
7509
8035
|
|
|
7510
8036
|
// node_modules/jsonc-parser/lib/esm/impl/string-intern.js
|
|
8037
|
+
init_define_AI_KIT_FILES();
|
|
7511
8038
|
var cachedSpaces = new Array(20).fill(0).map((_2, index) => {
|
|
7512
8039
|
return " ".repeat(index);
|
|
7513
8040
|
});
|
|
@@ -7537,7 +8064,11 @@ var cachedBreakLinesWithSpaces = {
|
|
|
7537
8064
|
}
|
|
7538
8065
|
};
|
|
7539
8066
|
|
|
8067
|
+
// node_modules/jsonc-parser/lib/esm/impl/edit.js
|
|
8068
|
+
init_define_AI_KIT_FILES();
|
|
8069
|
+
|
|
7540
8070
|
// node_modules/jsonc-parser/lib/esm/impl/parser.js
|
|
8071
|
+
init_define_AI_KIT_FILES();
|
|
7541
8072
|
var ParseOptions;
|
|
7542
8073
|
(function(ParseOptions2) {
|
|
7543
8074
|
ParseOptions2.DEFAULT = {
|
|
@@ -8000,6 +8531,7 @@ function parseJsonc(source) {
|
|
|
8000
8531
|
}
|
|
8001
8532
|
|
|
8002
8533
|
// cli/src/utils/vite-template-cleanup.ts
|
|
8534
|
+
init_define_AI_KIT_FILES();
|
|
8003
8535
|
var import_node_fs4 = __toESM(require("node:fs"));
|
|
8004
8536
|
var import_node_path4 = __toESM(require("node:path"));
|
|
8005
8537
|
var VITE_INDEX_CSS_PATTERNS = [
|
|
@@ -8146,17 +8678,18 @@ function pluralize(count, word) {
|
|
|
8146
8678
|
}
|
|
8147
8679
|
function parseArgs(args) {
|
|
8148
8680
|
const flagYes = args.includes("--yes") || args.includes("-y");
|
|
8681
|
+
const flagClaude = args.includes("--claude");
|
|
8149
8682
|
const tailwindFlagIdx = args.indexOf("--tailwind");
|
|
8150
8683
|
if (tailwindFlagIdx === -1) {
|
|
8151
|
-
return { flagYes, forcedTailwindVersion: null, invalidTailwindFlag: null };
|
|
8684
|
+
return { flagYes, flagClaude, forcedTailwindVersion: null, invalidTailwindFlag: null };
|
|
8152
8685
|
}
|
|
8153
8686
|
const raw = args[tailwindFlagIdx + 1] ?? "";
|
|
8154
|
-
if (raw === "v3" || raw === "3") return { flagYes, forcedTailwindVersion: 3, invalidTailwindFlag: null };
|
|
8155
|
-
if (raw === "v4" || raw === "4") return { flagYes, forcedTailwindVersion: 4, invalidTailwindFlag: null };
|
|
8156
|
-
return { flagYes, forcedTailwindVersion: null, invalidTailwindFlag: raw };
|
|
8687
|
+
if (raw === "v3" || raw === "3") return { flagYes, flagClaude, forcedTailwindVersion: 3, invalidTailwindFlag: null };
|
|
8688
|
+
if (raw === "v4" || raw === "4") return { flagYes, flagClaude, forcedTailwindVersion: 4, invalidTailwindFlag: null };
|
|
8689
|
+
return { flagYes, flagClaude, forcedTailwindVersion: null, invalidTailwindFlag: raw };
|
|
8157
8690
|
}
|
|
8158
8691
|
async function init(args) {
|
|
8159
|
-
const { flagYes, forcedTailwindVersion, invalidTailwindFlag } = parseArgs(args);
|
|
8692
|
+
const { flagYes, flagClaude, forcedTailwindVersion, invalidTailwindFlag } = parseArgs(args);
|
|
8160
8693
|
mt(import_picocolors.default.bold("7onic init"));
|
|
8161
8694
|
if (invalidTailwindFlag !== null) {
|
|
8162
8695
|
O2.warn(`Invalid --tailwind value: "${invalidTailwindFlag || "(empty)"}". Use v3 or v4.`);
|
|
@@ -8233,6 +8766,7 @@ async function init(args) {
|
|
|
8233
8766
|
};
|
|
8234
8767
|
writeConfig(projectRoot, finalConfig);
|
|
8235
8768
|
O2.success("Created 7onic.json");
|
|
8769
|
+
await maybeInstallAiKit(projectRoot, { flagYes, flagClaude });
|
|
8236
8770
|
gt(`Done! Run ${import_picocolors.default.cyan("npx 7onic add <component>")} to add components.`);
|
|
8237
8771
|
}
|
|
8238
8772
|
async function resolveConfig(projectRoot, { flagYes, forcedTailwindVersion, tailwind }) {
|
|
@@ -8518,13 +9052,48 @@ function resolveAliasPath(projectRoot, alias) {
|
|
|
8518
9052
|
if (!alias.startsWith("@/")) return null;
|
|
8519
9053
|
return import_node_path5.default.join(projectRoot, "src", alias.slice(2));
|
|
8520
9054
|
}
|
|
9055
|
+
async function maybeInstallAiKit(projectRoot, opts) {
|
|
9056
|
+
let install = opts.flagClaude;
|
|
9057
|
+
if (!install && !opts.flagYes) {
|
|
9058
|
+
const answer = await ot2({
|
|
9059
|
+
message: "Install the 7onic AI Kit (.claude/ skills + design agent for Claude Code and other AI agents)?",
|
|
9060
|
+
initialValue: false
|
|
9061
|
+
});
|
|
9062
|
+
if (q(answer)) return;
|
|
9063
|
+
install = answer;
|
|
9064
|
+
}
|
|
9065
|
+
if (!install) return;
|
|
9066
|
+
let created = 0;
|
|
9067
|
+
let updated = 0;
|
|
9068
|
+
let unchanged = 0;
|
|
9069
|
+
for (const [rel, content] of Object.entries(define_AI_KIT_FILES_default)) {
|
|
9070
|
+
const dest = import_node_path5.default.join(projectRoot, ".claude", rel);
|
|
9071
|
+
import_node_fs5.default.mkdirSync(import_node_path5.default.dirname(dest), { recursive: true });
|
|
9072
|
+
if (import_node_fs5.default.existsSync(dest)) {
|
|
9073
|
+
if (import_node_fs5.default.readFileSync(dest, "utf8") === content) {
|
|
9074
|
+
unchanged++;
|
|
9075
|
+
continue;
|
|
9076
|
+
}
|
|
9077
|
+
updated++;
|
|
9078
|
+
} else {
|
|
9079
|
+
created++;
|
|
9080
|
+
}
|
|
9081
|
+
import_node_fs5.default.writeFileSync(dest, content);
|
|
9082
|
+
}
|
|
9083
|
+
O2.success(
|
|
9084
|
+
`AI Kit installed to .claude/ (${created} created, ${updated} updated, ${unchanged} unchanged)`
|
|
9085
|
+
);
|
|
9086
|
+
O2.info("Tip: on Claude Code, the 7onic-design plugin provides the same kit plus the MCP server.");
|
|
9087
|
+
}
|
|
8521
9088
|
|
|
8522
9089
|
// cli/src/commands/add.ts
|
|
9090
|
+
init_define_AI_KIT_FILES();
|
|
8523
9091
|
var import_node_fs6 = __toESM(require("node:fs"));
|
|
8524
9092
|
var import_node_path6 = __toESM(require("node:path"));
|
|
8525
9093
|
var import_picocolors3 = __toESM(require_picocolors());
|
|
8526
9094
|
|
|
8527
9095
|
// cli/src/utils/rewrite-imports.ts
|
|
9096
|
+
init_define_AI_KIT_FILES();
|
|
8528
9097
|
function rewriteImports(content, utilsAlias) {
|
|
8529
9098
|
return content.replace(
|
|
8530
9099
|
/from ['"]@\/lib\/utils['"]/g,
|
|
@@ -8533,6 +9102,7 @@ function rewriteImports(content, utilsAlias) {
|
|
|
8533
9102
|
}
|
|
8534
9103
|
|
|
8535
9104
|
// cli/src/utils/logger.ts
|
|
9105
|
+
init_define_AI_KIT_FILES();
|
|
8536
9106
|
var import_picocolors2 = __toESM(require_picocolors());
|
|
8537
9107
|
var logger = {
|
|
8538
9108
|
info(msg) {
|
|
@@ -8556,6 +9126,7 @@ var logger = {
|
|
|
8556
9126
|
};
|
|
8557
9127
|
|
|
8558
9128
|
// cli/src/registry/index.ts
|
|
9129
|
+
init_define_AI_KIT_FILES();
|
|
8559
9130
|
var registry = {
|
|
8560
9131
|
"accordion": {
|
|
8561
9132
|
name: "accordion",
|
|
@@ -21109,7 +21680,7 @@ function showCompanionHints(names) {
|
|
|
21109
21680
|
|
|
21110
21681
|
// cli/src/index.ts
|
|
21111
21682
|
var import_picocolors4 = __toESM(require_picocolors());
|
|
21112
|
-
var VERSION = "0.1.
|
|
21683
|
+
var VERSION = "0.1.17";
|
|
21113
21684
|
var HELP = `
|
|
21114
21685
|
${import_picocolors4.default.bold("7onic")} \u2014 Add 7onic design system components to your project
|
|
21115
21686
|
|
|
@@ -21123,6 +21694,7 @@ ${import_picocolors4.default.bold("Commands:")}
|
|
|
21123
21694
|
${import_picocolors4.default.bold("Init options:")}
|
|
21124
21695
|
--tailwind v3|v4 Set Tailwind version (default: auto-detect)
|
|
21125
21696
|
--yes, -y Skip prompts, use defaults
|
|
21697
|
+
--claude Install the AI Kit (.claude/ skills + agent) without asking
|
|
21126
21698
|
|
|
21127
21699
|
${import_picocolors4.default.bold("Add options:")}
|
|
21128
21700
|
--all Add all components
|
|
@@ -21136,6 +21708,7 @@ ${import_picocolors4.default.bold("Global options:")}
|
|
|
21136
21708
|
${import_picocolors4.default.bold("Examples:")}
|
|
21137
21709
|
npx 7onic init
|
|
21138
21710
|
npx 7onic init --tailwind v3 --yes
|
|
21711
|
+
npx 7onic init --claude
|
|
21139
21712
|
npx 7onic add button card input
|
|
21140
21713
|
npx 7onic add --all
|
|
21141
21714
|
`;
|