better-supabase 0.3.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -6
- package/bin/better-supabase.js +4 -0
- package/dist/{base64-CQeB1eSf.js → base64-D2gsioCY.js} +2 -2
- package/dist/channel-FQW-CnGR.d.ts +70 -0
- package/dist/claims-BAf6c7is.js +48 -0
- package/dist/cli/_format-Cax5EsM9.js +101 -0
- package/dist/cli/bin.d.ts +1 -0
- package/dist/cli/bin.js +48 -0
- package/dist/cli/codemod-DqV7612m.js +388 -0
- package/dist/cli/command-CK14fP91.js +502 -0
- package/dist/cli/compare-BmIWVEui.js +9 -0
- package/dist/cli/config-CPVpXP5I.js +1965 -0
- package/dist/cli/config-dtoekM0v.js +2 -0
- package/dist/cli/db-DOBPt660.js +52 -0
- package/dist/cli/diff-SjkO5rNr.js +752 -0
- package/dist/cli/dist-DBPdlPYK.js +1112 -0
- package/dist/cli/dist-DreZ24Sz.js +129 -0
- package/dist/cli/dist-xn4wlboc.js +732 -0
- package/dist/cli/doctor-L7Z8mYTx.js +2863 -0
- package/dist/cli/env-DmKv_G4A.js +108 -0
- package/dist/cli/env-jIFUADLY.js +511 -0
- package/dist/cli/errors-4v4DTtda.js +56 -0
- package/dist/cli/fastest-levenshtein-CFN-lNDv.js +120 -0
- package/dist/cli/gen-BJc9vdyu.js +2 -0
- package/dist/cli/gen-C2osRcr5.js +2204 -0
- package/dist/cli/index.d.ts +493 -0
- package/dist/cli/index.js +184 -0
- package/dist/cli/init-Saf5-R9T.js +550 -0
- package/dist/cli/introspect--H7oGmcd.js +81 -0
- package/dist/cli/io-k41_z-jT.js +24 -0
- package/dist/cli/json5-ChRycquj.js +787 -0
- package/dist/cli/jsonc-BUniUpOk.js +2 -0
- package/dist/cli/jsonc-D5Fu67jw.js +45 -0
- package/dist/cli/keys-ByKHnvP9.js +83 -0
- package/dist/cli/ohash-D7bG_EOb.js +277 -0
- package/dist/cli/openapi-Cp5Fyta-.js +66 -0
- package/dist/cli/project-B_GeXyHh.js +70 -0
- package/dist/cli/prompts-BNcNfAve.js +1142 -0
- package/dist/cli/prompts-BTYQGunc.js +2 -0
- package/dist/cli/read-sets-BfMQcKy8.js +289 -0
- package/dist/cli/rolldown-runtime-BPOCksWG.js +24 -0
- package/dist/cli/run-BKR2W_79.js +351 -0
- package/dist/cli/seed-CUlqWh-8.js +98 -0
- package/dist/cli/skills-LJJIhLFR.js +137 -0
- package/dist/cli/sql-DzPbfngx.js +348 -0
- package/dist/cli/style-C0NFdJRL.js +29 -0
- package/dist/cli/toml-DB-MNnFs.js +424 -0
- package/dist/cli/version-BDJuO0UR.js +4 -0
- package/dist/cli/yaml-CYCbJ6et.js +2252 -0
- package/dist/client/index.d.ts +2 -2
- package/dist/client/index.js +15 -22
- package/dist/clone-BfgmLU90.js +21 -0
- package/dist/{compiler-2zqGzxVZ.d.ts → compiler-BXH_aZ7N.d.ts} +2 -2
- package/dist/config/index.d.ts +4 -4
- package/dist/config/index.js +5 -5
- package/dist/{config-DOsGYSiT.js → config-DreERlKo.js} +1 -1
- package/dist/{config-C1CYcm6o.d.ts → config-T_ejwyd3.d.ts} +176 -11
- package/dist/{define-DUbydmJa.d.ts → define-Bp_BZa5h.d.ts} +37 -29
- package/dist/{define-DF341GDj.js → define-cNKzqwL_.js} +356 -89
- package/dist/edge/index.d.ts +20 -13
- package/dist/edge/index.js +55 -26
- package/dist/{entitlements-DvJXoI02.d.ts → entitlements-DUxU4oHe.d.ts} +2 -2
- package/dist/env/index.d.ts +2 -2
- package/dist/env/index.js +34 -1
- package/dist/{errors-Bl3rkOzo.js → errors-DtwXa6b8.js} +2 -1
- package/dist/events/index.d.ts +3 -2
- package/dist/events/index.js +69 -16
- package/dist/events-aIO7vsIk.d.ts +230 -0
- package/dist/executor-BunPOO-k.d.ts +402 -0
- package/dist/{executor-B26lgbHD.d.ts → executor-Cghdstwu.d.ts} +1 -2
- package/dist/{executor-C57jx2pn.js → executor-XycESQPH.js} +3 -3
- package/dist/hono/index.d.ts +27 -23
- package/dist/hono/index.js +46 -11
- package/dist/impersonation-VfaGc4Q_.js +41 -0
- package/dist/{index-BNsABq7P.d.ts → index-BGdgBPdf.d.ts} +66 -25
- package/dist/{index-qriRM9cZ.d.ts → index-C7f8cOBM.d.ts} +4 -4
- package/dist/{index-Dy6kuF0P.d.ts → index-CLg87OBW.d.ts} +6 -1
- package/dist/{index-GV77NpRP.d.ts → index-DOESKG27.d.ts} +34 -9
- package/dist/{index-CriFFJ_p.d.ts → index-DgILJRXj.d.ts} +43 -17
- package/dist/{index-UJ-LUxtI.d.ts → index-DmXSxbLi.d.ts} +14 -14
- package/dist/{index-Cf-D2jk1.d.ts → index-Dxn2a5cw.d.ts} +2 -2
- package/dist/{index-CTTMS6_1.d.ts → index-SaTsEfGP.d.ts} +86 -9
- package/dist/{index-CADlNHK-.d.ts → index-fag8VJZ2.d.ts} +5 -6
- package/dist/index.d.ts +34 -17
- package/dist/index.js +15 -14
- package/dist/jobs/index.d.ts +147 -95
- package/dist/jobs/index.js +773 -250
- package/dist/{json-schema--aOXAGfU.js → json-schema-m1fiwKgN.js} +23 -2
- package/dist/kit-events-CTFDfSwb.js +60 -0
- package/dist/kit-transport-B82k1djG.d.ts +33 -0
- package/dist/kit-transport-DJlHQUBU.js +55 -0
- package/dist/{config-Be4GwsqI.js → kits-CGLLrNPd.js} +38 -10
- package/dist/list/index.d.ts +1 -1
- package/dist/list/index.js +3 -3
- package/dist/{live-D8rV1Ldw.js → live-CdJBOc4f.js} +13 -9
- package/dist/{live-QE3UPbGm.d.ts → live-D9W2M5aO.d.ts} +16 -15
- package/dist/lookup-BaP5bI27.js +18 -0
- package/dist/mcp/index.d.ts +39 -22
- package/dist/mcp/index.js +39 -25
- package/dist/{mfa-x3V3vGh-.d.ts → mfa-CusDgPaD.d.ts} +5 -1
- package/dist/next/image/index.js +6 -3
- package/dist/next/index.d.ts +60 -36
- package/dist/next/index.js +167 -50
- package/dist/notifications/index.d.ts +162 -0
- package/dist/notifications/index.js +264 -0
- package/dist/openapi/index.d.ts +1 -1
- package/dist/openapi/index.js +6 -6
- package/dist/orgs/index.d.ts +132 -0
- package/dist/orgs/index.js +245 -0
- package/dist/orpc/index.d.ts +37 -20
- package/dist/orpc/index.js +24 -11
- package/dist/otel/index.d.ts +24 -5
- package/dist/otel/index.js +124 -64
- package/dist/permdock-sql-C2Inc6Xc.d.ts +29 -0
- package/dist/permdock-sql-DgOfeixi.js +51 -0
- package/dist/plugin-DwARMuQp.js +59 -0
- package/dist/{plugin-DVRB8qNE.d.ts → plugin-o144f322.d.ts} +17 -5
- package/dist/plugins/actor/index.d.ts +5 -2
- package/dist/plugins/actor/index.js +22 -8
- package/dist/plugins/rules/index.d.ts +2 -2
- package/dist/plugins/rules/index.js +52 -17
- package/dist/plugins/soft-delete/index.d.ts +3 -3
- package/dist/plugins/soft-delete/index.js +14 -5
- package/dist/plugins/tenant/index.d.ts +3 -3
- package/dist/plugins/tenant/index.js +45 -21
- package/dist/plugins/timestamps/index.d.ts +1 -1
- package/dist/plugins/timestamps/index.js +4 -3
- package/dist/plugins/validation/index.d.ts +2 -2
- package/dist/plugins/validation/index.js +26 -6
- package/dist/{pool-B9qsLyFR.d.ts → pool-C9voM4Kw.d.ts} +24 -6
- package/dist/postgres/index.d.ts +5 -5
- package/dist/postgres/index.js +20 -10
- package/dist/{postgrest-DmBlevh-.d.ts → postgrest-CruYKAvV.d.ts} +1 -1
- package/dist/{problem-CGt1ADix.js → problem-BW1KhzSG.js} +2 -1
- package/dist/{problem-Z2RTQjZD.d.ts → problem-Blxe8S31.d.ts} +1 -1
- package/dist/query/index.d.ts +2 -2
- package/dist/query/index.js +3 -3
- package/dist/{query-BdKLTPlj.js → query-CCbo44lG.js} +18 -18
- package/dist/queue-BYUCjr59.d.ts +252 -0
- package/dist/react/index.d.ts +8 -7
- package/dist/react/index.js +4 -3
- package/dist/react/server.d.ts +16 -5
- package/dist/react/server.js +12 -4
- package/dist/react/session.d.ts +10 -4
- package/dist/react/session.js +11 -3
- package/dist/{react-DNBYNazu.js → react-C_s7kiNz.js} +138 -46
- package/dist/{read-set-D0qBcboM.js → read-set-DQFt1N_Y.js} +71 -15
- package/dist/realtime/index.d.ts +3 -3
- package/dist/realtime/index.js +14 -12
- package/dist/{index-kpgopLNv.d.ts → refresh-BTrQ_ZTp.d.ts} +6 -3
- package/dist/{resolve-BRciX2jK.d.ts → resolve-C15TJq77.d.ts} +22 -11
- package/dist/{resource-D30rp0GN.js → resource-CRxxwkQq.js} +24 -9
- package/dist/{resource-CwVgiI5q.d.ts → resource-D8iqWMr-.d.ts} +6 -6
- package/dist/respond-D2OQl62-.d.ts +371 -0
- package/dist/{result-DWXatkd6.js → result-BKiliPY7.js} +2 -2
- package/dist/server/index.d.ts +17 -15
- package/dist/server/index.js +16 -22
- package/dist/server-Csx2sRjg.js +655 -0
- package/dist/{shared-_6-uPL7E.js → shared-D1dRUrAg.js} +19 -4
- package/dist/signers-Cc6r98SW.d.ts +162 -0
- package/dist/{simplify-LakqK1vH.js → simplify-_0oUKqCd.js} +27 -95
- package/dist/sql/index.d.ts +247 -10
- package/dist/sql/index.js +8591 -780
- package/dist/{sql-BIgk12ew.js → sql-Coh6n4cC.js} +11 -3
- package/dist/ssr/index.d.ts +4 -4
- package/dist/ssr/index.js +1 -2
- package/dist/{standard-FUi3Z3-7.js → standard-D7r6dMUu.js} +6 -3
- package/dist/{standard-eudBiRk1.d.ts → standard-J4YgMOLm.d.ts} +1 -1
- package/dist/{stats-D78UQ8Yu.js → stats-Bqob3WqT.js} +34 -9
- package/dist/storage/index.d.ts +4 -4
- package/dist/storage/index.js +174 -27
- package/dist/support-DT-OhSxD.d.ts +88 -0
- package/dist/support-Dk6vdmEw.js +291 -0
- package/dist/support-view-Da5peKFg.d.ts +17 -0
- package/dist/support-view-g4YLBeqX.js +18 -0
- package/dist/{tables-Dhha3BXM.js → tables-Cb-3_VWc.js} +14 -0
- package/dist/{permdock-sql-Bta_G0v-.js → template-TxrGI5jR.js} +2 -31
- package/dist/{temporal-BwshQk0W.js → temporal-CVlIV2DZ.js} +17 -4
- package/dist/{temporal-required-CMxeSVPo.js → temporal-required-CAt4Dc9Z.js} +2 -2
- package/dist/testing/index.d.ts +113 -24
- package/dist/testing/index.js +375 -47
- package/dist/{types-DONv9SHN.d.ts → types-Dnf_wRDz.d.ts} +26 -3
- package/dist/user-change-CHFEUro1.js +49 -0
- package/dist/{webhooks-CAIFQSTM.js → verify-Ce49ETPz.js} +38 -19
- package/dist/{version-BfpG2gks.js → version-DM_Roffb.js} +1 -1
- package/dist/{view-3Po_PVlr.d.ts → view-BEf0diC5.d.ts} +10 -5
- package/dist/{mfa-BxoR1RkN.js → view-Bq64ki8-.js} +210 -64
- package/dist/webhooks/index.d.ts +136 -5
- package/dist/webhooks/index.js +588 -2
- package/dist/wire-D2dT86vi.js +35 -0
- package/package.json +50 -10
- package/schemas/config-v1.json +131 -1
- package/schemas/doctor-report-v1.json +10 -0
- package/skills/better-supabase/SKILL.md +60 -10
- package/skills/better-supabase/references/plugins.md +13 -14
- package/skills/better-supabase/references/troubleshooting.md +25 -4
- package/skills/better-supabase-api/SKILL.md +74 -19
- package/skills/better-supabase-api/references/adapters.md +48 -27
- package/skills/better-supabase-auth/SKILL.md +149 -0
- package/skills/better-supabase-auth/references/permdock.md +100 -0
- package/skills/better-supabase-testing/SKILL.md +58 -4
- package/dist/claims-CoTobNC-.js +0 -25
- package/dist/events-Do8jXh4D.d.ts +0 -84
- package/dist/executor-DynmIWhq.d.ts +0 -195
- package/dist/invalidate-DbxuL2jL.js +0 -18
- package/dist/permdock-sql-DImJULY-.d.ts +0 -17
- package/dist/plugin-BqR6wKMB.js +0 -23
- package/dist/respond-C44EZAJo.js +0 -399
- package/dist/respond-DAkPIdTH.d.ts +0 -175
- package/dist/result-c2OYgCV2.d.ts +0 -203
- package/dist/view-wZ-9qIUz.js +0 -45
|
@@ -0,0 +1,2252 @@
|
|
|
1
|
+
import { n as o$2, r as s$2, t as i$1 } from "./_format-Cax5EsM9.js";
|
|
2
|
+
//#region ../../node_modules/.pnpm/confbox@0.3.1/node_modules/confbox/dist/_chunks/libs/js-yaml.mjs
|
|
3
|
+
var e = Symbol(`NOT_RESOLVED`);
|
|
4
|
+
function t(e, t) {
|
|
5
|
+
return {
|
|
6
|
+
tagName: e,
|
|
7
|
+
nodeKind: `scalar`,
|
|
8
|
+
implicit: t.implicit ?? !1,
|
|
9
|
+
matchByTagPrefix: t.matchByTagPrefix ?? !1,
|
|
10
|
+
implicitFirstChars: t.implicitFirstChars ?? null,
|
|
11
|
+
resolve: t.resolve,
|
|
12
|
+
identify: t.identify,
|
|
13
|
+
represent: t.represent ?? ((e) => String(e)),
|
|
14
|
+
representTagName: t.representTagName ?? (() => e)
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
function n(e, t) {
|
|
18
|
+
let n = t.finalize === void 0;
|
|
19
|
+
return {
|
|
20
|
+
tagName: e,
|
|
21
|
+
nodeKind: `sequence`,
|
|
22
|
+
implicit: !1,
|
|
23
|
+
matchByTagPrefix: t.matchByTagPrefix ?? !1,
|
|
24
|
+
create: t.create,
|
|
25
|
+
addItem: t.addItem,
|
|
26
|
+
finalize: t.finalize ?? ((e) => e),
|
|
27
|
+
carrierIsResult: n,
|
|
28
|
+
identify: t.identify,
|
|
29
|
+
represent: t.represent ?? ((e) => e),
|
|
30
|
+
representTagName: t.representTagName ?? (() => e)
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
function r(e, t) {
|
|
34
|
+
let n = t.finalize === void 0;
|
|
35
|
+
return {
|
|
36
|
+
tagName: e,
|
|
37
|
+
nodeKind: `mapping`,
|
|
38
|
+
implicit: !1,
|
|
39
|
+
matchByTagPrefix: t.matchByTagPrefix ?? !1,
|
|
40
|
+
create: t.create,
|
|
41
|
+
addPair: t.addPair,
|
|
42
|
+
has: t.has,
|
|
43
|
+
keys: t.keys,
|
|
44
|
+
get: t.get,
|
|
45
|
+
finalize: t.finalize ?? ((e) => e),
|
|
46
|
+
carrierIsResult: n,
|
|
47
|
+
identify: t.identify,
|
|
48
|
+
represent: t.represent ?? ((e) => e),
|
|
49
|
+
representTagName: t.representTagName ?? (() => e)
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
var i = t(`tag:yaml.org,2002:str`, {
|
|
53
|
+
resolve: (e) => e,
|
|
54
|
+
identify: (e) => typeof e == `string`
|
|
55
|
+
});
|
|
56
|
+
var a = [
|
|
57
|
+
``,
|
|
58
|
+
`~`,
|
|
59
|
+
`null`,
|
|
60
|
+
`Null`,
|
|
61
|
+
`NULL`
|
|
62
|
+
];
|
|
63
|
+
var o$1 = t(`tag:yaml.org,2002:null`, {
|
|
64
|
+
implicit: !0,
|
|
65
|
+
implicitFirstChars: [
|
|
66
|
+
``,
|
|
67
|
+
`~`,
|
|
68
|
+
`n`,
|
|
69
|
+
`N`
|
|
70
|
+
],
|
|
71
|
+
resolve: (t) => a.indexOf(t) === -1 ? e : null,
|
|
72
|
+
identify: (e) => e === null,
|
|
73
|
+
represent: () => `null`
|
|
74
|
+
});
|
|
75
|
+
var s$1 = t(`tag:yaml.org,2002:null`, {
|
|
76
|
+
implicit: !0,
|
|
77
|
+
implicitFirstChars: [`n`],
|
|
78
|
+
resolve: (t, n) => t === `null` || n && t === `` ? null : e,
|
|
79
|
+
identify: (e) => e === null,
|
|
80
|
+
represent: () => `null`
|
|
81
|
+
});
|
|
82
|
+
var c = [
|
|
83
|
+
``,
|
|
84
|
+
`~`,
|
|
85
|
+
`null`,
|
|
86
|
+
`Null`,
|
|
87
|
+
`NULL`
|
|
88
|
+
];
|
|
89
|
+
var l = t(`tag:yaml.org,2002:null`, {
|
|
90
|
+
implicit: !0,
|
|
91
|
+
implicitFirstChars: [
|
|
92
|
+
``,
|
|
93
|
+
`~`,
|
|
94
|
+
`n`,
|
|
95
|
+
`N`
|
|
96
|
+
],
|
|
97
|
+
resolve: (t) => c.indexOf(t) === -1 ? e : null,
|
|
98
|
+
identify: (e) => e === null,
|
|
99
|
+
represent: () => `null`
|
|
100
|
+
});
|
|
101
|
+
var u = [
|
|
102
|
+
`true`,
|
|
103
|
+
`True`,
|
|
104
|
+
`TRUE`
|
|
105
|
+
];
|
|
106
|
+
var d = [
|
|
107
|
+
`false`,
|
|
108
|
+
`False`,
|
|
109
|
+
`FALSE`
|
|
110
|
+
];
|
|
111
|
+
var f = t(`tag:yaml.org,2002:bool`, {
|
|
112
|
+
implicit: !0,
|
|
113
|
+
implicitFirstChars: [
|
|
114
|
+
`t`,
|
|
115
|
+
`T`,
|
|
116
|
+
`f`,
|
|
117
|
+
`F`
|
|
118
|
+
],
|
|
119
|
+
resolve: (t) => u.indexOf(t) !== -1 || d.indexOf(t) === -1 && e,
|
|
120
|
+
identify: (e) => Object.prototype.toString.call(e) === `[object Boolean]`,
|
|
121
|
+
represent: (e) => e ? `true` : `false`
|
|
122
|
+
});
|
|
123
|
+
var p = [`true`];
|
|
124
|
+
var m = [`false`];
|
|
125
|
+
var h = t(`tag:yaml.org,2002:bool`, {
|
|
126
|
+
implicit: !0,
|
|
127
|
+
implicitFirstChars: [`t`, `f`],
|
|
128
|
+
resolve: (t) => p.indexOf(t) !== -1 || m.indexOf(t) === -1 && e,
|
|
129
|
+
identify: (e) => Object.prototype.toString.call(e) === `[object Boolean]`,
|
|
130
|
+
represent: (e) => e ? `true` : `false`
|
|
131
|
+
});
|
|
132
|
+
var ee = [
|
|
133
|
+
`true`,
|
|
134
|
+
`True`,
|
|
135
|
+
`TRUE`,
|
|
136
|
+
`y`,
|
|
137
|
+
`Y`,
|
|
138
|
+
`yes`,
|
|
139
|
+
`Yes`,
|
|
140
|
+
`YES`,
|
|
141
|
+
`on`,
|
|
142
|
+
`On`,
|
|
143
|
+
`ON`
|
|
144
|
+
];
|
|
145
|
+
var te = [
|
|
146
|
+
`false`,
|
|
147
|
+
`False`,
|
|
148
|
+
`FALSE`,
|
|
149
|
+
`n`,
|
|
150
|
+
`N`,
|
|
151
|
+
`no`,
|
|
152
|
+
`No`,
|
|
153
|
+
`NO`,
|
|
154
|
+
`off`,
|
|
155
|
+
`Off`,
|
|
156
|
+
`OFF`
|
|
157
|
+
];
|
|
158
|
+
var ne = t(`tag:yaml.org,2002:bool`, {
|
|
159
|
+
implicit: !0,
|
|
160
|
+
implicitFirstChars: [
|
|
161
|
+
`y`,
|
|
162
|
+
`Y`,
|
|
163
|
+
`n`,
|
|
164
|
+
`N`,
|
|
165
|
+
`t`,
|
|
166
|
+
`T`,
|
|
167
|
+
`f`,
|
|
168
|
+
`F`,
|
|
169
|
+
`o`,
|
|
170
|
+
`O`
|
|
171
|
+
],
|
|
172
|
+
resolve: (t) => ee.indexOf(t) !== -1 || te.indexOf(t) === -1 && e,
|
|
173
|
+
identify: (e) => Object.prototype.toString.call(e) === `[object Boolean]`,
|
|
174
|
+
represent: (e) => e ? `true` : `false`
|
|
175
|
+
});
|
|
176
|
+
var re = RegExp(`^(?:0o[0-7]+|0x[0-9a-fA-F]+|[-+]?[0-9]+)$`);
|
|
177
|
+
var ie = RegExp(`^(?:[-+]?0b[0-1]+|[-+]?0o[0-7]+|[-+]?0x[0-9a-fA-F]+|[-+]?[0-9]+)$`);
|
|
178
|
+
function ae(e) {
|
|
179
|
+
let t = e, n = 1;
|
|
180
|
+
return (t[0] === `-` || t[0] === `+`) && (t[0] === `-` && (n = -1), t = t.slice(1)), t.startsWith(`0b`) ? n * parseInt(t.slice(2), 2) : t.startsWith(`0o`) ? n * parseInt(t.slice(2), 8) : t.startsWith(`0x`) ? n * parseInt(t.slice(2), 16) : n * parseInt(t, 10);
|
|
181
|
+
}
|
|
182
|
+
function oe(t, n) {
|
|
183
|
+
if (n) {
|
|
184
|
+
if (!ie.test(t)) return e;
|
|
185
|
+
} else if (!re.test(t)) return e;
|
|
186
|
+
let r = ae(t);
|
|
187
|
+
return Number.isFinite(r) ? r : e;
|
|
188
|
+
}
|
|
189
|
+
var se = t(`tag:yaml.org,2002:int`, {
|
|
190
|
+
implicit: !0,
|
|
191
|
+
implicitFirstChars: [
|
|
192
|
+
`-`,
|
|
193
|
+
`+`,
|
|
194
|
+
...`0123456789`
|
|
195
|
+
],
|
|
196
|
+
resolve: oe,
|
|
197
|
+
identify: (e) => Number.isInteger(e) && !Object.is(e, -0) && e.toString(10).indexOf(`e`) < 0,
|
|
198
|
+
represent: (e) => e.toString(10)
|
|
199
|
+
});
|
|
200
|
+
var ce = RegExp(`^-?(?:0|[1-9][0-9]*)$`);
|
|
201
|
+
var le = RegExp(`^(?:[-+]?0b[0-1]+|[-+]?0o[0-7]+|[-+]?0x[0-9a-fA-F]+|[-+]?[0-9]+)$`);
|
|
202
|
+
function ue(e) {
|
|
203
|
+
let t = e, n = 1;
|
|
204
|
+
return (t[0] === `-` || t[0] === `+`) && (t[0] === `-` && (n = -1), t = t.slice(1)), t.startsWith(`0b`) ? n * parseInt(t.slice(2), 2) : t.startsWith(`0o`) ? n * parseInt(t.slice(2), 8) : t.startsWith(`0x`) ? n * parseInt(t.slice(2), 16) : n * parseInt(t, 10);
|
|
205
|
+
}
|
|
206
|
+
function de(t, n) {
|
|
207
|
+
if (n) {
|
|
208
|
+
if (!le.test(t)) return e;
|
|
209
|
+
} else if (!ce.test(t)) return e;
|
|
210
|
+
let r = ue(t);
|
|
211
|
+
return Number.isFinite(r) ? r : e;
|
|
212
|
+
}
|
|
213
|
+
var fe = t(`tag:yaml.org,2002:int`, {
|
|
214
|
+
implicit: !0,
|
|
215
|
+
implicitFirstChars: [`-`, ...`0123456789`],
|
|
216
|
+
resolve: de,
|
|
217
|
+
identify: (e) => Number.isInteger(e) && !Object.is(e, -0) && e.toString(10).indexOf(`e`) < 0,
|
|
218
|
+
represent: (e) => e.toString(10)
|
|
219
|
+
});
|
|
220
|
+
var pe = RegExp(`^(?:[-+]?0b[0-1_]+|[-+]?0[0-7_]+|[-+]?0x[0-9a-fA-F_]+|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+|[-+]?(?:0|[1-9][0-9_]*))$`);
|
|
221
|
+
function me(e) {
|
|
222
|
+
let t = e.replace(/_/g, ``), n = 1;
|
|
223
|
+
if ((t[0] === `-` || t[0] === `+`) && (t[0] === `-` && (n = -1), t = t.slice(1)), t.startsWith(`0b`)) return n * parseInt(t.slice(2), 2);
|
|
224
|
+
if (t.startsWith(`0x`)) return n * parseInt(t.slice(2), 16);
|
|
225
|
+
if (t.includes(`:`)) {
|
|
226
|
+
let e = 0;
|
|
227
|
+
for (let n of t.split(`:`)) e = e * 60 + Number(n);
|
|
228
|
+
return n * e;
|
|
229
|
+
}
|
|
230
|
+
return t !== `0` && t[0] === `0` ? n * parseInt(t, 8) : n * parseInt(t, 10);
|
|
231
|
+
}
|
|
232
|
+
function he(t) {
|
|
233
|
+
if (!pe.test(t)) return e;
|
|
234
|
+
let n = me(t);
|
|
235
|
+
return Number.isFinite(n) ? n : e;
|
|
236
|
+
}
|
|
237
|
+
var ge = t(`tag:yaml.org,2002:int`, {
|
|
238
|
+
implicit: !0,
|
|
239
|
+
implicitFirstChars: [
|
|
240
|
+
`-`,
|
|
241
|
+
`+`,
|
|
242
|
+
...`0123456789`
|
|
243
|
+
],
|
|
244
|
+
resolve: he,
|
|
245
|
+
identify: (e) => Number.isInteger(e) && !Object.is(e, -0) && e.toString(10).indexOf(`e`) < 0,
|
|
246
|
+
represent: (e) => e.toString(10)
|
|
247
|
+
});
|
|
248
|
+
var _e = RegExp(`^(?:[-+]?[0-9]+(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|[-+]?\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$`);
|
|
249
|
+
var ve = RegExp(`^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$`);
|
|
250
|
+
function ye(t) {
|
|
251
|
+
if (!_e.test(t)) return e;
|
|
252
|
+
let n = t.toLowerCase(), r = n[0] === `-` ? -1 : 1;
|
|
253
|
+
if (`+-`.includes(n[0]) && (n = n.slice(1)), n === `.inf`) return r === 1 ? 1 / 0 : -1 / 0;
|
|
254
|
+
if (n === `.nan`) return NaN;
|
|
255
|
+
let i = r * parseFloat(n);
|
|
256
|
+
return Number.isFinite(i) || ve.test(t) ? i : e;
|
|
257
|
+
}
|
|
258
|
+
function be(e) {
|
|
259
|
+
if (isNaN(e)) return `.nan`;
|
|
260
|
+
if (e === 1 / 0) return `.inf`;
|
|
261
|
+
if (e === -1 / 0) return `-.inf`;
|
|
262
|
+
if (Object.is(e, -0)) return `-0.0`;
|
|
263
|
+
let t = e.toString(10);
|
|
264
|
+
return /^[-+]?[0-9]+e/.test(t) ? t.replace(`e`, `.e`) : t;
|
|
265
|
+
}
|
|
266
|
+
var xe = t(`tag:yaml.org,2002:float`, {
|
|
267
|
+
implicit: !0,
|
|
268
|
+
implicitFirstChars: [
|
|
269
|
+
`-`,
|
|
270
|
+
`+`,
|
|
271
|
+
`.`,
|
|
272
|
+
...`0123456789`
|
|
273
|
+
],
|
|
274
|
+
resolve: ye,
|
|
275
|
+
identify: (e) => typeof e == `number` && (!Number.isInteger(e) || Object.is(e, -0) || e.toString(10).indexOf(`e`) >= 0),
|
|
276
|
+
represent: be
|
|
277
|
+
});
|
|
278
|
+
var Se = RegExp(`^-?(?:0|[1-9][0-9]*)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$`);
|
|
279
|
+
var Ce = RegExp(`^(?:[-+]?[0-9]+(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|[-+]?\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$`);
|
|
280
|
+
function we(t, n) {
|
|
281
|
+
if (n) {
|
|
282
|
+
if (!Ce.test(t)) return e;
|
|
283
|
+
let n = t.toLowerCase(), r = n[0] === `-` ? -1 : 1;
|
|
284
|
+
if (`+-`.includes(n[0]) && (n = n.slice(1)), n === `.inf`) return r === 1 ? 1 / 0 : -1 / 0;
|
|
285
|
+
if (n === `.nan`) return NaN;
|
|
286
|
+
let i = r * parseFloat(n);
|
|
287
|
+
return Number.isFinite(i) ? i : e;
|
|
288
|
+
}
|
|
289
|
+
if (!Se.test(t)) return e;
|
|
290
|
+
let r = Number(t);
|
|
291
|
+
return Number.isFinite(r) ? r : e;
|
|
292
|
+
}
|
|
293
|
+
function Te(e) {
|
|
294
|
+
if (isNaN(e)) return `.nan`;
|
|
295
|
+
if (e === 1 / 0) return `.inf`;
|
|
296
|
+
if (e === -1 / 0) return `-.inf`;
|
|
297
|
+
if (Object.is(e, -0)) return `-0.0`;
|
|
298
|
+
let t = e.toString(10);
|
|
299
|
+
return /^[-+]?[0-9]+e/.test(t) ? t.replace(`e`, `.e`) : t;
|
|
300
|
+
}
|
|
301
|
+
var Ee = t(`tag:yaml.org,2002:float`, {
|
|
302
|
+
implicit: !0,
|
|
303
|
+
implicitFirstChars: [`-`, ...`0123456789`],
|
|
304
|
+
resolve: we,
|
|
305
|
+
identify: (e) => typeof e == `number` && (!Number.isInteger(e) || Object.is(e, -0) || e.toString(10).indexOf(`e`) >= 0),
|
|
306
|
+
represent: Te
|
|
307
|
+
});
|
|
308
|
+
var De = RegExp(`^(?:[-+]?(?:(?:[0-9][0-9_]*)?\\.[0-9_]*)(?:[eE][-+][0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$`);
|
|
309
|
+
var Oe = RegExp(`^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$`);
|
|
310
|
+
function ke(t) {
|
|
311
|
+
if (!De.test(t)) return e;
|
|
312
|
+
let n = t.toLowerCase().replace(/_/g, ``), r = n[0] === `-` ? -1 : 1;
|
|
313
|
+
if (`+-`.includes(n[0]) && (n = n.slice(1)), n === `.inf`) return r === 1 ? 1 / 0 : -1 / 0;
|
|
314
|
+
if (n === `.nan`) return NaN;
|
|
315
|
+
let i = 0;
|
|
316
|
+
if (n.includes(`:`)) {
|
|
317
|
+
for (let e of n.split(`:`)) i = i * 60 + Number(e);
|
|
318
|
+
i *= r;
|
|
319
|
+
} else i = r * parseFloat(n);
|
|
320
|
+
return Number.isFinite(i) || Oe.test(t) ? i : e;
|
|
321
|
+
}
|
|
322
|
+
function Ae(e) {
|
|
323
|
+
if (isNaN(e)) return `.nan`;
|
|
324
|
+
if (e === 1 / 0) return `.inf`;
|
|
325
|
+
if (e === -1 / 0) return `-.inf`;
|
|
326
|
+
if (Object.is(e, -0)) return `-0.0`;
|
|
327
|
+
let t = e.toString(10);
|
|
328
|
+
return /^[-+]?[0-9]+e/.test(t) ? t.replace(`e`, `.e`) : t;
|
|
329
|
+
}
|
|
330
|
+
var je = t(`tag:yaml.org,2002:float`, {
|
|
331
|
+
implicit: !0,
|
|
332
|
+
implicitFirstChars: [
|
|
333
|
+
`-`,
|
|
334
|
+
`+`,
|
|
335
|
+
`.`,
|
|
336
|
+
...`0123456789`
|
|
337
|
+
],
|
|
338
|
+
resolve: ke,
|
|
339
|
+
identify: (e) => typeof e == `number` && (!Number.isInteger(e) || Object.is(e, -0) || e.toString(10).indexOf(`e`) >= 0),
|
|
340
|
+
represent: Ae
|
|
341
|
+
});
|
|
342
|
+
var Me = t(`tag:yaml.org,2002:merge`, {
|
|
343
|
+
implicit: !0,
|
|
344
|
+
implicitFirstChars: [`<`],
|
|
345
|
+
resolve: (t, n) => t === `<<` || n && t === `` ? `<<` : e,
|
|
346
|
+
identify: () => !1
|
|
347
|
+
});
|
|
348
|
+
var Ne = /^[A-Za-z0-9+/]*={0,2}$/;
|
|
349
|
+
function Pe(t) {
|
|
350
|
+
let n = t.replace(/\s/g, ``);
|
|
351
|
+
if (n.length % 4 != 0 || !Ne.test(n)) return e;
|
|
352
|
+
let r = atob(n), i = new Uint8Array(r.length);
|
|
353
|
+
for (let e = 0; e < r.length; e++) i[e] = r.charCodeAt(e);
|
|
354
|
+
return i;
|
|
355
|
+
}
|
|
356
|
+
function Fe(e) {
|
|
357
|
+
let t = ``;
|
|
358
|
+
for (let n = 0; n < e.length; n++) t += String.fromCharCode(e[n]);
|
|
359
|
+
return btoa(t);
|
|
360
|
+
}
|
|
361
|
+
var Ie = t(`tag:yaml.org,2002:binary`, {
|
|
362
|
+
resolve: Pe,
|
|
363
|
+
identify: (e) => Object.prototype.toString.call(e) === `[object Uint8Array]`,
|
|
364
|
+
represent: Fe
|
|
365
|
+
});
|
|
366
|
+
var Le = RegExp(`^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$`);
|
|
367
|
+
var Re = RegExp(`^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$`);
|
|
368
|
+
function ze(e, t, n, r = 0, i = 0, a = 0, o = 0) {
|
|
369
|
+
let s = new Date(Date.UTC(e, t, n, r, i, a, o));
|
|
370
|
+
return s.setUTCFullYear(e, t, n), s;
|
|
371
|
+
}
|
|
372
|
+
function Be(t) {
|
|
373
|
+
let n = Le.exec(t);
|
|
374
|
+
if (n === null && (n = Re.exec(t)), n === null) return e;
|
|
375
|
+
let r = +n[1], i = n[2] - 1, a = +n[3];
|
|
376
|
+
if (!n[4]) {
|
|
377
|
+
let t = ze(r, i, a);
|
|
378
|
+
return t.getUTCFullYear() !== r || t.getUTCMonth() !== i || t.getUTCDate() !== a ? e : t;
|
|
379
|
+
}
|
|
380
|
+
let o = +n[4], s = +n[5], c = +n[6], l = 0;
|
|
381
|
+
if (o > 23 || s > 59 || c > 59) return e;
|
|
382
|
+
if (n[7]) {
|
|
383
|
+
let e = n[7].slice(0, 3);
|
|
384
|
+
for (; e.length < 3;) e += `0`;
|
|
385
|
+
l = +e;
|
|
386
|
+
}
|
|
387
|
+
let u = ze(r, i, a, o, s, c, l);
|
|
388
|
+
if (u.getUTCFullYear() !== r || u.getUTCMonth() !== i || u.getUTCDate() !== a) return e;
|
|
389
|
+
if (n[9]) {
|
|
390
|
+
let t = +n[10], r = +(n[11] || 0);
|
|
391
|
+
if (t > 23 || r > 59) return e;
|
|
392
|
+
let i = (t * 60 + r) * 6e4;
|
|
393
|
+
u.setTime(u.getTime() - (n[9] === `-` ? -i : i));
|
|
394
|
+
}
|
|
395
|
+
return u;
|
|
396
|
+
}
|
|
397
|
+
var Ve = t(`tag:yaml.org,2002:timestamp`, {
|
|
398
|
+
implicit: !0,
|
|
399
|
+
implicitFirstChars: [...`0123456789`],
|
|
400
|
+
resolve: Be,
|
|
401
|
+
identify: (e) => e instanceof Date,
|
|
402
|
+
represent: (e) => e.toISOString()
|
|
403
|
+
});
|
|
404
|
+
var He = n(`tag:yaml.org,2002:seq`, {
|
|
405
|
+
create: () => [],
|
|
406
|
+
addItem: (e, t) => {
|
|
407
|
+
e.push(t);
|
|
408
|
+
},
|
|
409
|
+
identify: Array.isArray
|
|
410
|
+
});
|
|
411
|
+
function g(e) {
|
|
412
|
+
if (typeof e != `object` || !e || Array.isArray(e)) return !1;
|
|
413
|
+
let t = Object.getPrototypeOf(e);
|
|
414
|
+
return t === null || t === Object.prototype;
|
|
415
|
+
}
|
|
416
|
+
function Ue(e, t) {
|
|
417
|
+
let n = {};
|
|
418
|
+
for (let r of t) e[r] !== void 0 && (n[r] = e[r]);
|
|
419
|
+
return n;
|
|
420
|
+
}
|
|
421
|
+
var We = n(`tag:yaml.org,2002:omap`, {
|
|
422
|
+
create: () => ({
|
|
423
|
+
list: [],
|
|
424
|
+
seen: /* @__PURE__ */ new Set()
|
|
425
|
+
}),
|
|
426
|
+
addItem: (e, t) => {
|
|
427
|
+
let n;
|
|
428
|
+
if (t instanceof Map) {
|
|
429
|
+
if (t.size !== 1) return `cannot resolve an ordered map item`;
|
|
430
|
+
n = t.keys().next().value;
|
|
431
|
+
} else if (g(t)) {
|
|
432
|
+
let e = Object.keys(t);
|
|
433
|
+
if (e.length !== 1) return `cannot resolve an ordered map item`;
|
|
434
|
+
n = e[0];
|
|
435
|
+
} else return `cannot resolve an ordered map item`;
|
|
436
|
+
return e.seen.has(n) ? `duplicate key in ordered map` : (e.seen.add(n), e.list.push(t), ``);
|
|
437
|
+
},
|
|
438
|
+
finalize: (e) => e.list,
|
|
439
|
+
identify: () => !1
|
|
440
|
+
});
|
|
441
|
+
var Ge = n(`tag:yaml.org,2002:pairs`, {
|
|
442
|
+
create: () => [],
|
|
443
|
+
addItem: (e, t) => {
|
|
444
|
+
if (t instanceof Map) return t.size === 1 ? (e.push(t.entries().next().value), ``) : `cannot resolve a pairs item`;
|
|
445
|
+
if (Object.prototype.toString.call(t) !== `[object Object]`) return `cannot resolve a pairs item`;
|
|
446
|
+
let n = t, r = Object.keys(n);
|
|
447
|
+
return r.length === 1 ? (e.push([r[0], n[r[0]]]), ``) : `cannot resolve a pairs item`;
|
|
448
|
+
},
|
|
449
|
+
identify: () => !1
|
|
450
|
+
});
|
|
451
|
+
var Ke = r(`tag:yaml.org,2002:map`, {
|
|
452
|
+
create: () => ({}),
|
|
453
|
+
identify: g,
|
|
454
|
+
represent: (e) => {
|
|
455
|
+
let t = /* @__PURE__ */ new Map();
|
|
456
|
+
for (let n of Object.keys(e)) t.set(n, e[n]);
|
|
457
|
+
return t;
|
|
458
|
+
},
|
|
459
|
+
addPair: (e, t, n) => {
|
|
460
|
+
if (typeof t == `object` && t) return `object-based map does not support complex keys`;
|
|
461
|
+
let r = String(t);
|
|
462
|
+
return r === `__proto__` ? Object.defineProperty(e, r, {
|
|
463
|
+
value: n,
|
|
464
|
+
enumerable: !0,
|
|
465
|
+
configurable: !0,
|
|
466
|
+
writable: !0
|
|
467
|
+
}) : e[r] = n, ``;
|
|
468
|
+
},
|
|
469
|
+
has: (e, t) => typeof t == `object` && t ? !1 : Object.prototype.hasOwnProperty.call(e, String(t)),
|
|
470
|
+
keys: (e) => Object.keys(e),
|
|
471
|
+
get: (e, t) => {
|
|
472
|
+
let n = String(t);
|
|
473
|
+
return Object.prototype.hasOwnProperty.call(e, n) ? e[n] : null;
|
|
474
|
+
}
|
|
475
|
+
});
|
|
476
|
+
var qe = r(`tag:yaml.org,2002:set`, {
|
|
477
|
+
create: () => /* @__PURE__ */ new Set(),
|
|
478
|
+
identify: (e) => e instanceof Set,
|
|
479
|
+
represent: (e) => {
|
|
480
|
+
let t = /* @__PURE__ */ new Map();
|
|
481
|
+
for (let n of e) t.set(n, null);
|
|
482
|
+
return t;
|
|
483
|
+
},
|
|
484
|
+
addPair: (e, t, n) => n === null ? (e.add(t), ``) : `cannot resolve a set item`,
|
|
485
|
+
has: (e, t) => e.has(t),
|
|
486
|
+
keys: (e) => e.keys(),
|
|
487
|
+
get: () => null
|
|
488
|
+
});
|
|
489
|
+
function Je() {
|
|
490
|
+
return {
|
|
491
|
+
scalar: Object.create(null),
|
|
492
|
+
sequence: Object.create(null),
|
|
493
|
+
mapping: Object.create(null)
|
|
494
|
+
};
|
|
495
|
+
}
|
|
496
|
+
function Ye() {
|
|
497
|
+
return {
|
|
498
|
+
scalar: [],
|
|
499
|
+
sequence: [],
|
|
500
|
+
mapping: []
|
|
501
|
+
};
|
|
502
|
+
}
|
|
503
|
+
function Xe(e) {
|
|
504
|
+
let t = [];
|
|
505
|
+
for (let n of e) {
|
|
506
|
+
let e = t.length;
|
|
507
|
+
for (let r = 0; r < t.length; r++) {
|
|
508
|
+
let i = t[r];
|
|
509
|
+
if (i.nodeKind === n.nodeKind && i.tagName === n.tagName && i.matchByTagPrefix === n.matchByTagPrefix) {
|
|
510
|
+
e = r;
|
|
511
|
+
break;
|
|
512
|
+
}
|
|
513
|
+
}
|
|
514
|
+
t[e] = n;
|
|
515
|
+
}
|
|
516
|
+
return t;
|
|
517
|
+
}
|
|
518
|
+
var _ = class t {
|
|
519
|
+
tags;
|
|
520
|
+
implicitScalarTags;
|
|
521
|
+
implicitScalarByFirstChar;
|
|
522
|
+
implicitScalarAnyFirstChar;
|
|
523
|
+
defaultScalarTag;
|
|
524
|
+
defaultSequenceTag;
|
|
525
|
+
defaultMappingTag;
|
|
526
|
+
exact;
|
|
527
|
+
prefix;
|
|
528
|
+
constructor(e) {
|
|
529
|
+
let t = Xe(e), n = [], r = Je(), i = Ye();
|
|
530
|
+
for (let e of t) {
|
|
531
|
+
if (e.nodeKind === `scalar` && e.implicit) {
|
|
532
|
+
if (e.matchByTagPrefix) throw Error(`Implicit scalar tags cannot match by tag prefix`);
|
|
533
|
+
n.push(e);
|
|
534
|
+
}
|
|
535
|
+
switch (e.nodeKind) {
|
|
536
|
+
case `scalar`:
|
|
537
|
+
e.matchByTagPrefix ? i.scalar.push(e) : r.scalar[e.tagName] = e;
|
|
538
|
+
break;
|
|
539
|
+
case `sequence`:
|
|
540
|
+
e.matchByTagPrefix ? i.sequence.push(e) : r.sequence[e.tagName] = e;
|
|
541
|
+
break;
|
|
542
|
+
case `mapping`: e.matchByTagPrefix ? i.mapping.push(e) : r.mapping[e.tagName] = e;
|
|
543
|
+
}
|
|
544
|
+
}
|
|
545
|
+
let a = n.filter((e) => e.implicitFirstChars === null), o = /* @__PURE__ */ new Set();
|
|
546
|
+
for (let e of n) if (e.implicitFirstChars !== null) for (let t of e.implicitFirstChars) o.add(t);
|
|
547
|
+
let s = /* @__PURE__ */ new Map();
|
|
548
|
+
for (let e of o) s.set(e, n.filter((t) => t.implicitFirstChars === null || t.implicitFirstChars.indexOf(e) !== -1));
|
|
549
|
+
let c = r.scalar[`tag:yaml.org,2002:str`];
|
|
550
|
+
if (!c) throw Error(`schema does not define the default scalar tag (tag:yaml.org,2002:str)`);
|
|
551
|
+
this.tags = t, this.implicitScalarTags = n, this.implicitScalarByFirstChar = s, this.implicitScalarAnyFirstChar = a, this.defaultScalarTag = c, this.defaultSequenceTag = r.sequence[`tag:yaml.org,2002:seq`], this.defaultMappingTag = r.mapping[`tag:yaml.org,2002:map`], this.exact = r, this.prefix = i;
|
|
552
|
+
}
|
|
553
|
+
lookupScalarTag(e) {
|
|
554
|
+
let t = this.exact.scalar[e];
|
|
555
|
+
if (t) return t;
|
|
556
|
+
for (let t of this.prefix.scalar) if (e.startsWith(t.tagName)) return t;
|
|
557
|
+
}
|
|
558
|
+
lookupSequenceTag(e) {
|
|
559
|
+
let t = this.exact.sequence[e];
|
|
560
|
+
if (t) return t;
|
|
561
|
+
for (let t of this.prefix.sequence) if (e.startsWith(t.tagName)) return t;
|
|
562
|
+
}
|
|
563
|
+
lookupMappingTag(e) {
|
|
564
|
+
let t = this.exact.mapping[e];
|
|
565
|
+
if (t) return t;
|
|
566
|
+
for (let t of this.prefix.mapping) if (e.startsWith(t.tagName)) return t;
|
|
567
|
+
}
|
|
568
|
+
resolveImplicitScalarTag(t) {
|
|
569
|
+
let n = this.implicitScalarByFirstChar.get(t.charAt(0)) ?? this.implicitScalarAnyFirstChar;
|
|
570
|
+
for (let r of n) {
|
|
571
|
+
let n = r.resolve(t, !1, r.tagName);
|
|
572
|
+
if (n !== e) return {
|
|
573
|
+
value: n,
|
|
574
|
+
tag: r
|
|
575
|
+
};
|
|
576
|
+
}
|
|
577
|
+
let r = this.defaultScalarTag;
|
|
578
|
+
return {
|
|
579
|
+
value: r.resolve(t, !1, r.tagName),
|
|
580
|
+
tag: r
|
|
581
|
+
};
|
|
582
|
+
}
|
|
583
|
+
withTags(...e) {
|
|
584
|
+
let n = [];
|
|
585
|
+
for (let t of e) n = n.concat(t);
|
|
586
|
+
return new t([...this.tags, ...n]);
|
|
587
|
+
}
|
|
588
|
+
};
|
|
589
|
+
var Ze = new _([
|
|
590
|
+
i,
|
|
591
|
+
He,
|
|
592
|
+
Ke
|
|
593
|
+
]);
|
|
594
|
+
new _([
|
|
595
|
+
...Ze.tags,
|
|
596
|
+
s$1,
|
|
597
|
+
h,
|
|
598
|
+
fe,
|
|
599
|
+
Ee
|
|
600
|
+
]);
|
|
601
|
+
var Qe = new _([
|
|
602
|
+
...Ze.tags,
|
|
603
|
+
o$1,
|
|
604
|
+
f,
|
|
605
|
+
se,
|
|
606
|
+
xe
|
|
607
|
+
]);
|
|
608
|
+
var $e = new _([
|
|
609
|
+
...Ze.tags,
|
|
610
|
+
l,
|
|
611
|
+
ne,
|
|
612
|
+
ge,
|
|
613
|
+
je,
|
|
614
|
+
Ve,
|
|
615
|
+
Me,
|
|
616
|
+
Ie,
|
|
617
|
+
We,
|
|
618
|
+
Ge,
|
|
619
|
+
qe
|
|
620
|
+
]).withTags({
|
|
621
|
+
...ge,
|
|
622
|
+
resolve: (t, n, r) => {
|
|
623
|
+
let i = ge.resolve(t, n, r);
|
|
624
|
+
return i === e ? se.resolve(t, n, r) : i;
|
|
625
|
+
}
|
|
626
|
+
}, {
|
|
627
|
+
...je,
|
|
628
|
+
resolve: (t, n, r) => {
|
|
629
|
+
let i = je.resolve(t, n, r);
|
|
630
|
+
return i === e ? xe.resolve(t, n, r) : i;
|
|
631
|
+
}
|
|
632
|
+
});
|
|
633
|
+
r(`tag:yaml.org,2002:map`, {
|
|
634
|
+
create: () => /* @__PURE__ */ new Map(),
|
|
635
|
+
addPair: (e, t, n) => (e.set(t, n), ``),
|
|
636
|
+
has: (e, t) => e.has(t),
|
|
637
|
+
keys: (e) => e.keys(),
|
|
638
|
+
get: (e, t) => e.get(t),
|
|
639
|
+
identify: (e) => e instanceof Map || g(e),
|
|
640
|
+
represent: (e) => {
|
|
641
|
+
if (e instanceof Map) return e;
|
|
642
|
+
let t = /* @__PURE__ */ new Map(), n = e;
|
|
643
|
+
for (let e of Object.keys(n)) t.set(e, n[e]);
|
|
644
|
+
return t;
|
|
645
|
+
}
|
|
646
|
+
});
|
|
647
|
+
function et(e) {
|
|
648
|
+
if (Array.isArray(e)) {
|
|
649
|
+
let t = Array.prototype.slice.call(e);
|
|
650
|
+
for (let e = 0; e < t.length; e++) {
|
|
651
|
+
if (Array.isArray(t[e])) return null;
|
|
652
|
+
typeof t[e] == `object` && Object.prototype.toString.call(t[e]) === `[object Object]` && (t[e] = `[object Object]`);
|
|
653
|
+
}
|
|
654
|
+
return String(t);
|
|
655
|
+
}
|
|
656
|
+
return typeof e == `object` && Object.prototype.toString.call(e) === `[object Object]` ? `[object Object]` : String(e);
|
|
657
|
+
}
|
|
658
|
+
r(`tag:yaml.org,2002:map`, {
|
|
659
|
+
create: () => ({}),
|
|
660
|
+
identify: g,
|
|
661
|
+
represent: (e) => {
|
|
662
|
+
let t = /* @__PURE__ */ new Map();
|
|
663
|
+
for (let n of Object.keys(e)) t.set(n, e[n]);
|
|
664
|
+
return t;
|
|
665
|
+
},
|
|
666
|
+
addPair: (e, t, n) => {
|
|
667
|
+
let r = et(t);
|
|
668
|
+
return r === null ? `nested arrays are not supported inside keys` : (r === `__proto__` ? Object.defineProperty(e, r, {
|
|
669
|
+
value: n,
|
|
670
|
+
enumerable: !0,
|
|
671
|
+
configurable: !0,
|
|
672
|
+
writable: !0
|
|
673
|
+
}) : e[r] = n, ``);
|
|
674
|
+
},
|
|
675
|
+
has: (e, t) => {
|
|
676
|
+
let n = et(t);
|
|
677
|
+
return n !== null && Object.prototype.hasOwnProperty.call(e, n);
|
|
678
|
+
},
|
|
679
|
+
keys: (e) => Object.keys(e),
|
|
680
|
+
get: (e, t) => {
|
|
681
|
+
let n = String(t);
|
|
682
|
+
return Object.prototype.hasOwnProperty.call(e, n) ? e[n] : null;
|
|
683
|
+
}
|
|
684
|
+
});
|
|
685
|
+
var tt = {
|
|
686
|
+
maxLength: 79,
|
|
687
|
+
indent: 1,
|
|
688
|
+
linesBefore: 3,
|
|
689
|
+
linesAfter: 2
|
|
690
|
+
};
|
|
691
|
+
function nt(e, t, n, r, i) {
|
|
692
|
+
let a = ``, o = ``, s = Math.floor(i / 2) - 1;
|
|
693
|
+
return r - t > s && (a = ` ... `, t = r - s + a.length), n - r > s && (o = ` ...`, n = r + s - o.length), {
|
|
694
|
+
str: a + e.slice(t, n).replace(/\t/g, `→`) + o,
|
|
695
|
+
pos: r - t + a.length
|
|
696
|
+
};
|
|
697
|
+
}
|
|
698
|
+
function rt(e, t) {
|
|
699
|
+
return ` `.repeat(Math.max(t - e.length, 0)) + e;
|
|
700
|
+
}
|
|
701
|
+
function it(e, t) {
|
|
702
|
+
if (!e.buffer) return null;
|
|
703
|
+
let n = {
|
|
704
|
+
...tt,
|
|
705
|
+
...t
|
|
706
|
+
}, r = /\r?\n|\r|\0/g, i = [0], a = [], o, s = -1;
|
|
707
|
+
for (; o = r.exec(e.buffer);) a.push(o.index), i.push(o.index + o[0].length), e.position <= o.index && s < 0 && (s = i.length - 2);
|
|
708
|
+
s < 0 && (s = i.length - 1);
|
|
709
|
+
let c = ``, l = Math.min(e.line + n.linesAfter, a.length).toString().length, u = n.maxLength - (n.indent + l + 3);
|
|
710
|
+
for (let t = 1; t <= n.linesBefore && !(s - t < 0); t++) {
|
|
711
|
+
let r = nt(e.buffer, i[s - t], a[s - t], e.position - (i[s] - i[s - t]), u);
|
|
712
|
+
c = `${` `.repeat(n.indent)}${rt((e.line - t + 1).toString(), l)} | ${r.str}\n${c}`;
|
|
713
|
+
}
|
|
714
|
+
let d = nt(e.buffer, i[s], a[s], e.position, u);
|
|
715
|
+
c += `${` `.repeat(n.indent)}${rt((e.line + 1).toString(), l)} | ${d.str}\n`, c += `${`-`.repeat(n.indent + l + 3 + d.pos)}^\n`;
|
|
716
|
+
for (let t = 1; t <= n.linesAfter && !(s + t >= a.length); t++) {
|
|
717
|
+
let r = nt(e.buffer, i[s + t], a[s + t], e.position - (i[s] - i[s + t]), u);
|
|
718
|
+
c += `${` `.repeat(n.indent)}${rt((e.line + t + 1).toString(), l)} | ${r.str}\n`;
|
|
719
|
+
}
|
|
720
|
+
return c.replace(/\n$/, ``);
|
|
721
|
+
}
|
|
722
|
+
function at(e, t) {
|
|
723
|
+
let n = ``;
|
|
724
|
+
return e.mark ? (e.mark.name && (n += `in "${e.mark.name}" `), n += `(${e.mark.line + 1}:${e.mark.column + 1})`, !t && e.mark.snippet && (n += `\n\n${e.mark.snippet}`), `${e.reason} ${n}`) : e.reason;
|
|
725
|
+
}
|
|
726
|
+
var v = class e extends Error {
|
|
727
|
+
reason;
|
|
728
|
+
mark;
|
|
729
|
+
constructor(e, t) {
|
|
730
|
+
super(), this.name = `YAMLException`, this.reason = e, this.mark = t, this.message = at(this, !1), Error.captureStackTrace && Error.captureStackTrace(this, this.constructor);
|
|
731
|
+
}
|
|
732
|
+
toString(e) {
|
|
733
|
+
return `${this.name}: ${at(this, e)}`;
|
|
734
|
+
}
|
|
735
|
+
static throwAt(t, n, r, i = ``) {
|
|
736
|
+
let a = 0, o = 0;
|
|
737
|
+
for (let e = 0; e < n; e++) {
|
|
738
|
+
let n = t.charCodeAt(e);
|
|
739
|
+
n === 10 ? (a++, o = e + 1) : n === 13 && (a++, t.charCodeAt(e + 1) === 10 && e++, o = e + 1);
|
|
740
|
+
}
|
|
741
|
+
let s = {
|
|
742
|
+
name: i,
|
|
743
|
+
buffer: t,
|
|
744
|
+
position: n,
|
|
745
|
+
line: a,
|
|
746
|
+
column: n - o
|
|
747
|
+
};
|
|
748
|
+
throw s.snippet = it(s), new e(r, s);
|
|
749
|
+
}
|
|
750
|
+
};
|
|
751
|
+
var y = {
|
|
752
|
+
DOCUMENT: 1,
|
|
753
|
+
SEQUENCE: 2,
|
|
754
|
+
MAPPING: 3,
|
|
755
|
+
SCALAR: 4,
|
|
756
|
+
ALIAS: 5,
|
|
757
|
+
POP: 6
|
|
758
|
+
};
|
|
759
|
+
var b = {
|
|
760
|
+
PLAIN: 1,
|
|
761
|
+
SINGLE_QUOTED: 2,
|
|
762
|
+
DOUBLE_QUOTED: 3,
|
|
763
|
+
LITERAL_BLOCK: 4,
|
|
764
|
+
FOLDED_BLOCK: 5
|
|
765
|
+
};
|
|
766
|
+
var x = {
|
|
767
|
+
BLOCK: 1,
|
|
768
|
+
FLOW: 2
|
|
769
|
+
};
|
|
770
|
+
var S = {
|
|
771
|
+
CLIP: 1,
|
|
772
|
+
STRIP: 2,
|
|
773
|
+
KEEP: 3
|
|
774
|
+
};
|
|
775
|
+
var ot = -1;
|
|
776
|
+
function st(e) {
|
|
777
|
+
switch (e) {
|
|
778
|
+
case 48: return `\0`;
|
|
779
|
+
case 97: return `\x07`;
|
|
780
|
+
case 98: return `\b`;
|
|
781
|
+
case 116: return ` `;
|
|
782
|
+
case 9: return ` `;
|
|
783
|
+
case 110: return `
|
|
784
|
+
`;
|
|
785
|
+
case 118: return `\v`;
|
|
786
|
+
case 102: return `\f`;
|
|
787
|
+
case 114: return `\r`;
|
|
788
|
+
case 101: return `\x1B`;
|
|
789
|
+
case 32: return ` `;
|
|
790
|
+
case 34: return `"`;
|
|
791
|
+
case 47: return `/`;
|
|
792
|
+
case 92: return `\\`;
|
|
793
|
+
case 78: return `
`;
|
|
794
|
+
case 95: return `\xA0`;
|
|
795
|
+
case 76: return `\u2028`;
|
|
796
|
+
case 80: return `\u2029`;
|
|
797
|
+
default: return ``;
|
|
798
|
+
}
|
|
799
|
+
}
|
|
800
|
+
var ct = Array(256);
|
|
801
|
+
var lt = Array(256);
|
|
802
|
+
for (let e = 0; e < 256; e++) ct[e] = +!!st(e), lt[e] = st(e);
|
|
803
|
+
function ut(e) {
|
|
804
|
+
return e <= 65535 ? String.fromCharCode(e) : String.fromCharCode((e - 65536 >> 10) + 55296, (e - 65536 & 1023) + 56320);
|
|
805
|
+
}
|
|
806
|
+
function dt(e) {
|
|
807
|
+
return e >= 48 && e <= 57 ? e - 48 : (e | 32) - 97 + 10;
|
|
808
|
+
}
|
|
809
|
+
function ft(e) {
|
|
810
|
+
return e === 120 ? 2 : e === 117 ? 4 : 8;
|
|
811
|
+
}
|
|
812
|
+
function C(e, t, n) {
|
|
813
|
+
let r = 0;
|
|
814
|
+
for (; t < n;) {
|
|
815
|
+
let n = e.charCodeAt(t);
|
|
816
|
+
if (n === 10) r++, t++;
|
|
817
|
+
else if (n === 13) r++, t++, e.charCodeAt(t) === 10 && t++;
|
|
818
|
+
else if (n === 32 || n === 9) t++;
|
|
819
|
+
else break;
|
|
820
|
+
}
|
|
821
|
+
return {
|
|
822
|
+
position: t,
|
|
823
|
+
breaks: r
|
|
824
|
+
};
|
|
825
|
+
}
|
|
826
|
+
function pt(e) {
|
|
827
|
+
return e === 1 ? ` ` : `
|
|
828
|
+
`.repeat(e - 1);
|
|
829
|
+
}
|
|
830
|
+
function mt(e, t, n) {
|
|
831
|
+
let r = ``, i = t, a = t, o = t;
|
|
832
|
+
for (; i < n;) {
|
|
833
|
+
let t = e.charCodeAt(i);
|
|
834
|
+
if (t === 10 || t === 13) {
|
|
835
|
+
r += e.slice(a, o);
|
|
836
|
+
let t = C(e, i, n);
|
|
837
|
+
r += pt(t.breaks), i = a = o = t.position;
|
|
838
|
+
} else i++, t !== 32 && t !== 9 && (o = i);
|
|
839
|
+
}
|
|
840
|
+
return r + e.slice(a, o);
|
|
841
|
+
}
|
|
842
|
+
function ht(e, t, n) {
|
|
843
|
+
let r = ``, i = t, a = t, o = t;
|
|
844
|
+
for (; i < n;) {
|
|
845
|
+
let t = e.charCodeAt(i);
|
|
846
|
+
if (t === 39) r += e.slice(a, i) + `'`, i += 2, a = o = i;
|
|
847
|
+
else if (t === 10 || t === 13) {
|
|
848
|
+
r += e.slice(a, o);
|
|
849
|
+
let t = C(e, i, n);
|
|
850
|
+
r += pt(t.breaks), i = a = o = t.position;
|
|
851
|
+
} else i++, t !== 32 && t !== 9 && (o = i);
|
|
852
|
+
}
|
|
853
|
+
return r + e.slice(a, n);
|
|
854
|
+
}
|
|
855
|
+
function gt(e, t, n) {
|
|
856
|
+
let r = ``, i = t, a = t, o = t;
|
|
857
|
+
for (; i < n;) {
|
|
858
|
+
let t = e.charCodeAt(i);
|
|
859
|
+
if (t === 92) {
|
|
860
|
+
r += e.slice(a, i), i++;
|
|
861
|
+
let t = e.charCodeAt(i);
|
|
862
|
+
if (t === 10 || t === 13) i = C(e, i, n).position;
|
|
863
|
+
else if (t < 256 && ct[t]) r += lt[t], i++;
|
|
864
|
+
else {
|
|
865
|
+
let n = ft(t), a = 0;
|
|
866
|
+
for (; n > 0; n--) {
|
|
867
|
+
i++;
|
|
868
|
+
let t = dt(e.charCodeAt(i));
|
|
869
|
+
a = (a << 4) + t;
|
|
870
|
+
}
|
|
871
|
+
r += ut(a), i++;
|
|
872
|
+
}
|
|
873
|
+
a = o = i;
|
|
874
|
+
} else if (t === 10 || t === 13) {
|
|
875
|
+
r += e.slice(a, o);
|
|
876
|
+
let t = C(e, i, n);
|
|
877
|
+
r += pt(t.breaks), i = a = o = t.position;
|
|
878
|
+
} else i++, t !== 32 && t !== 9 && (o = i);
|
|
879
|
+
}
|
|
880
|
+
return r + e.slice(a, n);
|
|
881
|
+
}
|
|
882
|
+
function _t(e, t, n, r, i, a) {
|
|
883
|
+
let o = r < 0 ? 0 : r, s = e.slice(t, n).replace(/\r\n?/g, `
|
|
884
|
+
`), c = s === `` ? [] : (s.endsWith(`
|
|
885
|
+
`) ? s.slice(0, -1) : s).split(`
|
|
886
|
+
`), l = ``, u = !1, d = 0, f = !1;
|
|
887
|
+
for (let e of c) {
|
|
888
|
+
let t = 0;
|
|
889
|
+
for (; t < o && e.charCodeAt(t) === 32;) t++;
|
|
890
|
+
if (r < 0 || t >= e.length) {
|
|
891
|
+
d++;
|
|
892
|
+
continue;
|
|
893
|
+
}
|
|
894
|
+
let n = e.slice(o), i = n.charCodeAt(0);
|
|
895
|
+
a ? i === 32 || i === 9 ? (f = !0, l += `
|
|
896
|
+
`.repeat(u ? 1 + d : d)) : f ? (f = !1, l += `
|
|
897
|
+
`.repeat(d + 1)) : d === 0 ? u && (l += ` `) : l += `
|
|
898
|
+
`.repeat(d) : l += `
|
|
899
|
+
`.repeat(u ? 1 + d : d), l += n, u = !0, d = 0;
|
|
900
|
+
}
|
|
901
|
+
return i === S.KEEP ? l += `
|
|
902
|
+
`.repeat(u ? 1 + d : d) : i !== S.STRIP && u && (l += `
|
|
903
|
+
`), l;
|
|
904
|
+
}
|
|
905
|
+
function vt(e, t) {
|
|
906
|
+
if (t.valueStart === ot) return ``;
|
|
907
|
+
let { valueStart: n, valueEnd: r } = t;
|
|
908
|
+
if (t.fast) return e.slice(n, r);
|
|
909
|
+
switch (t.style) {
|
|
910
|
+
case b.SINGLE_QUOTED: return ht(e, n, r);
|
|
911
|
+
case b.DOUBLE_QUOTED: return gt(e, n, r);
|
|
912
|
+
case b.LITERAL_BLOCK: return _t(e, n, r, t.indent, t.chomping, !1);
|
|
913
|
+
case b.FOLDED_BLOCK: return _t(e, n, r, t.indent, t.chomping, !0);
|
|
914
|
+
default: return mt(e, n, r);
|
|
915
|
+
}
|
|
916
|
+
}
|
|
917
|
+
var yt = Object.assign(Object.create(null), {
|
|
918
|
+
"!": `!`,
|
|
919
|
+
"!!": `tag:yaml.org,2002:`
|
|
920
|
+
});
|
|
921
|
+
function bt(e) {
|
|
922
|
+
return encodeURI(e).replace(/!/g, `%21`);
|
|
923
|
+
}
|
|
924
|
+
function xt(e, t) {
|
|
925
|
+
if (e.startsWith(`!<`) && e.endsWith(`>`)) return decodeURIComponent(e.slice(2, -1));
|
|
926
|
+
let n = e.indexOf(`!`, 1), r = n === -1 ? `!` : e.slice(0, n + 1), i = t?.[r] ?? yt[r] ?? r;
|
|
927
|
+
return decodeURIComponent(i) + decodeURIComponent(e.slice(r.length));
|
|
928
|
+
}
|
|
929
|
+
function St(e) {
|
|
930
|
+
let t = e;
|
|
931
|
+
return t.charCodeAt(0) === 33 ? (t = t.slice(1), `!${bt(t)}`) : t.slice(0, 18) === `tag:yaml.org,2002:` ? `!!${bt(t.slice(18))}` : `!<${bt(t)}>`;
|
|
932
|
+
}
|
|
933
|
+
var w = -1;
|
|
934
|
+
var Ct = `tag:yaml.org,2002:merge`;
|
|
935
|
+
var wt = {
|
|
936
|
+
filename: ``,
|
|
937
|
+
schema: Qe,
|
|
938
|
+
json: !1,
|
|
939
|
+
maxTotalMergeKeys: 1e4,
|
|
940
|
+
maxAliases: -1
|
|
941
|
+
};
|
|
942
|
+
function Tt(e) {
|
|
943
|
+
return `tagStart` in e && e.tagStart !== w ? e.tagStart : `anchorStart` in e && e.anchorStart !== w ? e.anchorStart : `valueStart` in e && e.valueStart !== w ? e.valueStart : `start` in e ? e.start : 0;
|
|
944
|
+
}
|
|
945
|
+
function T(e, t) {
|
|
946
|
+
v.throwAt(e.source, e.position, t, e.filename);
|
|
947
|
+
}
|
|
948
|
+
function Et(e, t, n, r) {
|
|
949
|
+
try {
|
|
950
|
+
return n.finalize(r);
|
|
951
|
+
} catch (n) {
|
|
952
|
+
if (n instanceof v) throw n;
|
|
953
|
+
v.throwAt(e.source, t, n instanceof Error ? n.message : String(n), e.filename);
|
|
954
|
+
}
|
|
955
|
+
}
|
|
956
|
+
function Dt(t, n) {
|
|
957
|
+
let r = vt(t.source, n), i = n.tagStart === w ? `` : t.source.slice(n.tagStart, n.tagEnd), a = t.schema.defaultScalarTag;
|
|
958
|
+
if (i !== ``) {
|
|
959
|
+
if (i === `!`) return {
|
|
960
|
+
value: r,
|
|
961
|
+
tag: a
|
|
962
|
+
};
|
|
963
|
+
let n = xt(i, t.tagHandlers), o = t.schema.lookupScalarTag(n);
|
|
964
|
+
if (o) {
|
|
965
|
+
let i = o.resolve(r, !0, n);
|
|
966
|
+
return i === e && T(t, `cannot resolve a node with !<${n}> explicit tag`), {
|
|
967
|
+
value: i,
|
|
968
|
+
tag: o
|
|
969
|
+
};
|
|
970
|
+
}
|
|
971
|
+
let s = t.schema.lookupMappingTag(n) ?? t.schema.lookupSequenceTag(n);
|
|
972
|
+
if (s) {
|
|
973
|
+
r !== `` && T(t, `cannot resolve a node with !<${n}> explicit tag`);
|
|
974
|
+
let e = s.create(n);
|
|
975
|
+
return {
|
|
976
|
+
value: s.carrierIsResult ? e : Et(t, t.position, s, e),
|
|
977
|
+
tag: s
|
|
978
|
+
};
|
|
979
|
+
}
|
|
980
|
+
T(t, `unknown scalar tag !<${n}>`);
|
|
981
|
+
}
|
|
982
|
+
return n.style === b.PLAIN ? t.schema.resolveImplicitScalarTag(r) : {
|
|
983
|
+
value: a.resolve(r, !1, a.tagName),
|
|
984
|
+
tag: a
|
|
985
|
+
};
|
|
986
|
+
}
|
|
987
|
+
function Ot(e, t, n) {
|
|
988
|
+
let r = t.tagStart === w ? `` : e.source.slice(t.tagStart, t.tagEnd);
|
|
989
|
+
return r === `` || r === `!` ? n : xt(r, e.tagHandlers);
|
|
990
|
+
}
|
|
991
|
+
function kt(e) {
|
|
992
|
+
return e.nodeKind === `mapping`;
|
|
993
|
+
}
|
|
994
|
+
function At(e) {
|
|
995
|
+
e.totalMergeKeys++, e.maxTotalMergeKeys !== -1 && e.totalMergeKeys > e.maxTotalMergeKeys && T(e, `merge keys exceeded maxTotalMergeKeys (${e.maxTotalMergeKeys})`);
|
|
996
|
+
}
|
|
997
|
+
function jt(e, t, n, r) {
|
|
998
|
+
At(e);
|
|
999
|
+
for (let i of r.keys(n)) {
|
|
1000
|
+
if (At(e), t.tag.has(t.value, i)) continue;
|
|
1001
|
+
let a = t.tag.addPair(t.value, i, r.get(n, i));
|
|
1002
|
+
a && T(e, a), t.overridable ??= /* @__PURE__ */ new Set(), t.overridable.add(i);
|
|
1003
|
+
}
|
|
1004
|
+
}
|
|
1005
|
+
function Mt(e, t, n, r) {
|
|
1006
|
+
if (e.position = t.keyPosition, kt(r)) jt(e, t, n, r);
|
|
1007
|
+
else if (r.nodeKind === `sequence` && Array.isArray(n)) {
|
|
1008
|
+
n.length > 100 && T(e, `abnormal merge sequence size`);
|
|
1009
|
+
for (let r of n) {
|
|
1010
|
+
let n = e.nodeTags.get(r);
|
|
1011
|
+
n || T(e, `cannot merge mappings; the provided source object is unacceptable`), jt(e, t, r, n);
|
|
1012
|
+
}
|
|
1013
|
+
} else T(e, `cannot merge mappings; the provided source object is unacceptable`);
|
|
1014
|
+
}
|
|
1015
|
+
function Nt(e, t, n, r, i) {
|
|
1016
|
+
if (e.position = t.keyPosition, t.keyIsMerge) {
|
|
1017
|
+
Mt(e, t, r, i);
|
|
1018
|
+
return;
|
|
1019
|
+
}
|
|
1020
|
+
!e.json && t.tag.has(t.value, n) && !t.overridable?.has(n) && T(e, `duplicated mapping key`);
|
|
1021
|
+
let a = t.tag.addPair(t.value, n, r);
|
|
1022
|
+
a && T(e, a), t.overridable?.delete(n);
|
|
1023
|
+
}
|
|
1024
|
+
function Pt(e, t, n) {
|
|
1025
|
+
let r = e.frames[e.frames.length - 1];
|
|
1026
|
+
if (r.kind === `document`) r.value = t, r.hasValue = !0;
|
|
1027
|
+
else if (r.kind === `sequence`) {
|
|
1028
|
+
kt(n) && e.nodeTags.set(t, n);
|
|
1029
|
+
let i = r.tag.addItem(r.value, t, r.index++);
|
|
1030
|
+
i && T(e, i);
|
|
1031
|
+
} else if (r.hasKey) {
|
|
1032
|
+
let i = r.key;
|
|
1033
|
+
r.key = void 0, r.hasKey = !1, Nt(e, r, i, t, n);
|
|
1034
|
+
} else r.key = t, r.keyPosition = e.position, r.hasKey = !0, r.keyIsMerge = n.tagName === Ct;
|
|
1035
|
+
}
|
|
1036
|
+
function Ft(e, t, n, r, i) {
|
|
1037
|
+
if (t.anchorStart !== w) {
|
|
1038
|
+
let a = {
|
|
1039
|
+
value: n,
|
|
1040
|
+
tag: r,
|
|
1041
|
+
isValueFinal: i
|
|
1042
|
+
};
|
|
1043
|
+
return e.anchors.set(e.source.slice(t.anchorStart, t.anchorEnd), a), a;
|
|
1044
|
+
}
|
|
1045
|
+
return null;
|
|
1046
|
+
}
|
|
1047
|
+
function It(e, t) {
|
|
1048
|
+
let n = {
|
|
1049
|
+
...wt,
|
|
1050
|
+
...t,
|
|
1051
|
+
events: e,
|
|
1052
|
+
documents: [],
|
|
1053
|
+
eventIndex: 0,
|
|
1054
|
+
position: 0,
|
|
1055
|
+
frames: [],
|
|
1056
|
+
anchors: /* @__PURE__ */ new Map(),
|
|
1057
|
+
nodeTags: /* @__PURE__ */ new Map(),
|
|
1058
|
+
tagHandlers: Object.create(null),
|
|
1059
|
+
totalMergeKeys: 0,
|
|
1060
|
+
aliasCount: 0
|
|
1061
|
+
};
|
|
1062
|
+
for (; n.eventIndex < n.events.length;) {
|
|
1063
|
+
let e = n.events[n.eventIndex++];
|
|
1064
|
+
switch (n.position = Tt(e), e.type) {
|
|
1065
|
+
case y.DOCUMENT:
|
|
1066
|
+
n.anchors = /* @__PURE__ */ new Map(), n.nodeTags = /* @__PURE__ */ new Map(), n.aliasCount = 0, n.tagHandlers = Object.create(null);
|
|
1067
|
+
for (let t of e.directives) t.kind === `tag` && (n.tagHandlers[t.handle] = t.prefix);
|
|
1068
|
+
n.frames.push({
|
|
1069
|
+
kind: `document`,
|
|
1070
|
+
position: n.position,
|
|
1071
|
+
value: void 0,
|
|
1072
|
+
hasValue: !1
|
|
1073
|
+
});
|
|
1074
|
+
break;
|
|
1075
|
+
case y.SCALAR: {
|
|
1076
|
+
let { value: t, tag: r } = Dt(n, e);
|
|
1077
|
+
Ft(n, e, t, r, !0), Pt(n, t, r);
|
|
1078
|
+
break;
|
|
1079
|
+
}
|
|
1080
|
+
case y.SEQUENCE: {
|
|
1081
|
+
let t = Ot(n, e, `tag:yaml.org,2002:seq`), r = n.schema.lookupSequenceTag(t);
|
|
1082
|
+
r || T(n, `unknown sequence tag !<${t}>`);
|
|
1083
|
+
let i = r.create(t), a = Ft(n, e, i, r, r.carrierIsResult);
|
|
1084
|
+
n.frames.push({
|
|
1085
|
+
kind: `sequence`,
|
|
1086
|
+
position: n.position,
|
|
1087
|
+
value: i,
|
|
1088
|
+
tag: r,
|
|
1089
|
+
anchor: a,
|
|
1090
|
+
index: 0
|
|
1091
|
+
});
|
|
1092
|
+
break;
|
|
1093
|
+
}
|
|
1094
|
+
case y.MAPPING: {
|
|
1095
|
+
let t = Ot(n, e, `tag:yaml.org,2002:map`), r = n.schema.lookupMappingTag(t);
|
|
1096
|
+
r || T(n, `unknown mapping tag !<${t}>`);
|
|
1097
|
+
let i = r.create(t), a = Ft(n, e, i, r, r.carrierIsResult);
|
|
1098
|
+
n.frames.push({
|
|
1099
|
+
kind: `mapping`,
|
|
1100
|
+
position: n.position,
|
|
1101
|
+
value: i,
|
|
1102
|
+
tag: r,
|
|
1103
|
+
anchor: a,
|
|
1104
|
+
key: void 0,
|
|
1105
|
+
keyPosition: n.position,
|
|
1106
|
+
hasKey: !1,
|
|
1107
|
+
keyIsMerge: !1,
|
|
1108
|
+
overridable: null
|
|
1109
|
+
});
|
|
1110
|
+
break;
|
|
1111
|
+
}
|
|
1112
|
+
case y.ALIAS: {
|
|
1113
|
+
n.maxAliases !== -1 && ++n.aliasCount > n.maxAliases && T(n, `aliases exceeded maxAliases (${n.maxAliases})`);
|
|
1114
|
+
let t = n.source.slice(e.anchorStart, e.anchorEnd), r = n.anchors.get(t);
|
|
1115
|
+
r || T(n, `unidentified alias "${t}"`), r.isValueFinal || T(n, `recursive alias "${t}" is not supported for tag ${r.tag.tagName} because it uses finalize()`), Pt(n, r.value, r.tag);
|
|
1116
|
+
break;
|
|
1117
|
+
}
|
|
1118
|
+
case y.POP: {
|
|
1119
|
+
let e = n.frames.pop();
|
|
1120
|
+
if (e.kind === `mapping` && e.hasKey && (n.position = e.keyPosition, T(n, `incomplete mapping pair in event stream`)), e.kind === `document`) n.documents.push(e.value);
|
|
1121
|
+
else {
|
|
1122
|
+
let t = e.tag.carrierIsResult ? e.value : Et(n, e.position, e.tag, e.value);
|
|
1123
|
+
e.anchor && (e.anchor.value = t, e.anchor.isValueFinal = !0), Pt(n, t, e.tag);
|
|
1124
|
+
}
|
|
1125
|
+
break;
|
|
1126
|
+
}
|
|
1127
|
+
}
|
|
1128
|
+
}
|
|
1129
|
+
return n.documents;
|
|
1130
|
+
}
|
|
1131
|
+
var E = -1;
|
|
1132
|
+
var Lt = Object.prototype.hasOwnProperty;
|
|
1133
|
+
var D = 1;
|
|
1134
|
+
var Rt = 2;
|
|
1135
|
+
var zt = 3;
|
|
1136
|
+
var O = 4;
|
|
1137
|
+
var Bt = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;
|
|
1138
|
+
var Vt = /[,\[\]{}]/;
|
|
1139
|
+
var Ht = /^(?:!|!!|![0-9A-Za-z-]+!)$/;
|
|
1140
|
+
var Ut = String.raw`(?:%[0-9A-Fa-f]{2}|[0-9A-Za-z\-#;/?:@&=+$,_.!~*'()\[\]])`;
|
|
1141
|
+
var Wt = String.raw`(?:%[0-9A-Fa-f]{2}|[0-9A-Za-z\-#;/?:@&=+$.~*'()_])`;
|
|
1142
|
+
var Gt = RegExp(`^(?:${Ut})*$`);
|
|
1143
|
+
var Kt = RegExp(`^(?:${Wt})+$`);
|
|
1144
|
+
var qt = RegExp(`^(?:!(?:${Ut})*|${Wt}(?:${Ut})*)$`);
|
|
1145
|
+
var Jt = {
|
|
1146
|
+
filename: ``,
|
|
1147
|
+
maxDepth: 100
|
|
1148
|
+
};
|
|
1149
|
+
function Yt(e, t, n) {
|
|
1150
|
+
e.events.push({
|
|
1151
|
+
type: y.DOCUMENT,
|
|
1152
|
+
explicitStart: t,
|
|
1153
|
+
explicitEnd: n,
|
|
1154
|
+
directives: e.directives
|
|
1155
|
+
});
|
|
1156
|
+
}
|
|
1157
|
+
function Xt(e, t, n, r, i, a, o) {
|
|
1158
|
+
e.events.push({
|
|
1159
|
+
type: y.SEQUENCE,
|
|
1160
|
+
start: t,
|
|
1161
|
+
anchorStart: n,
|
|
1162
|
+
anchorEnd: r,
|
|
1163
|
+
tagStart: i,
|
|
1164
|
+
tagEnd: a,
|
|
1165
|
+
style: o
|
|
1166
|
+
});
|
|
1167
|
+
}
|
|
1168
|
+
function Zt(e, t, n, r, i, a, o) {
|
|
1169
|
+
e.events.push({
|
|
1170
|
+
type: y.MAPPING,
|
|
1171
|
+
start: t,
|
|
1172
|
+
anchorStart: n,
|
|
1173
|
+
anchorEnd: r,
|
|
1174
|
+
tagStart: i,
|
|
1175
|
+
tagEnd: a,
|
|
1176
|
+
style: o
|
|
1177
|
+
});
|
|
1178
|
+
}
|
|
1179
|
+
function Qt(e, t) {
|
|
1180
|
+
e.events.splice(t.eventsLength, 0, {
|
|
1181
|
+
type: y.MAPPING,
|
|
1182
|
+
start: t.position,
|
|
1183
|
+
anchorStart: E,
|
|
1184
|
+
anchorEnd: E,
|
|
1185
|
+
tagStart: E,
|
|
1186
|
+
tagEnd: E,
|
|
1187
|
+
style: x.FLOW
|
|
1188
|
+
});
|
|
1189
|
+
}
|
|
1190
|
+
function k(e, t, n, r, i, a, o, s, c = S.CLIP, l = -1, u = !1) {
|
|
1191
|
+
e.events.push({
|
|
1192
|
+
type: y.SCALAR,
|
|
1193
|
+
valueStart: t,
|
|
1194
|
+
valueEnd: n,
|
|
1195
|
+
anchorStart: r,
|
|
1196
|
+
anchorEnd: i,
|
|
1197
|
+
tagStart: a,
|
|
1198
|
+
tagEnd: o,
|
|
1199
|
+
style: s,
|
|
1200
|
+
chomping: c,
|
|
1201
|
+
indent: l,
|
|
1202
|
+
fast: u
|
|
1203
|
+
});
|
|
1204
|
+
}
|
|
1205
|
+
function $t(e, t, n) {
|
|
1206
|
+
e.events.push({
|
|
1207
|
+
type: y.ALIAS,
|
|
1208
|
+
anchorStart: t,
|
|
1209
|
+
anchorEnd: n
|
|
1210
|
+
});
|
|
1211
|
+
}
|
|
1212
|
+
function A(e) {
|
|
1213
|
+
e.events.push({ type: y.POP });
|
|
1214
|
+
}
|
|
1215
|
+
function j(e) {
|
|
1216
|
+
k(e, E, E, E, E, E, E, b.PLAIN);
|
|
1217
|
+
}
|
|
1218
|
+
function en() {
|
|
1219
|
+
return {
|
|
1220
|
+
anchorStart: E,
|
|
1221
|
+
anchorEnd: E,
|
|
1222
|
+
tagStart: E,
|
|
1223
|
+
tagEnd: E
|
|
1224
|
+
};
|
|
1225
|
+
}
|
|
1226
|
+
function M(e) {
|
|
1227
|
+
return {
|
|
1228
|
+
position: e.position,
|
|
1229
|
+
line: e.line,
|
|
1230
|
+
lineStart: e.lineStart,
|
|
1231
|
+
lineIndent: e.lineIndent,
|
|
1232
|
+
firstTabInLine: e.firstTabInLine,
|
|
1233
|
+
eventsLength: e.events.length
|
|
1234
|
+
};
|
|
1235
|
+
}
|
|
1236
|
+
function N(e, t) {
|
|
1237
|
+
e.position = t.position, e.line = t.line, e.lineStart = t.lineStart, e.lineIndent = t.lineIndent, e.firstTabInLine = t.firstTabInLine, e.events.length = t.eventsLength;
|
|
1238
|
+
}
|
|
1239
|
+
function P(e, t) {
|
|
1240
|
+
v.throwAt(e.input.slice(0, e.length), e.position, t, e.filename);
|
|
1241
|
+
}
|
|
1242
|
+
function F(e) {
|
|
1243
|
+
return e === 10 || e === 13;
|
|
1244
|
+
}
|
|
1245
|
+
function I(e) {
|
|
1246
|
+
return e === 9 || e === 32;
|
|
1247
|
+
}
|
|
1248
|
+
function L(e) {
|
|
1249
|
+
return I(e) || F(e);
|
|
1250
|
+
}
|
|
1251
|
+
function R(e) {
|
|
1252
|
+
return e === 0 || L(e);
|
|
1253
|
+
}
|
|
1254
|
+
function z(e) {
|
|
1255
|
+
return e === 44 || e === 91 || e === 93 || e === 123 || e === 125;
|
|
1256
|
+
}
|
|
1257
|
+
function tn(e) {
|
|
1258
|
+
return e >= 48 && e <= 57 ? e - 48 : -1;
|
|
1259
|
+
}
|
|
1260
|
+
function nn(e) {
|
|
1261
|
+
if (e >= 48 && e <= 57) return e - 48;
|
|
1262
|
+
let t = e | 32;
|
|
1263
|
+
return t >= 97 && t <= 102 ? t - 97 + 10 : -1;
|
|
1264
|
+
}
|
|
1265
|
+
function rn(e) {
|
|
1266
|
+
return e === 120 ? 2 : e === 117 ? 4 : e === 85 ? 8 : 0;
|
|
1267
|
+
}
|
|
1268
|
+
function an(e) {
|
|
1269
|
+
return e === 48 || e === 97 || e === 98 || e === 116 || e === 9 || e === 110 || e === 118 || e === 102 || e === 114 || e === 101 || e === 32 || e === 34 || e === 47 || e === 92 || e === 78 || e === 95 || e === 76 || e === 80;
|
|
1270
|
+
}
|
|
1271
|
+
function B(e) {
|
|
1272
|
+
e.input.charCodeAt(e.position) === 10 ? e.position++ : (e.position++, e.input.charCodeAt(e.position) === 10 && e.position++), e.line++, e.lineStart = e.position, e.lineIndent = 0, e.firstTabInLine = -1;
|
|
1273
|
+
}
|
|
1274
|
+
function V(e, t) {
|
|
1275
|
+
let n = 0, r = e.input.charCodeAt(e.position), i = e.position === e.lineStart || L(e.input.charCodeAt(e.position - 1));
|
|
1276
|
+
for (; r !== 0;) {
|
|
1277
|
+
for (; I(r);) i = !0, r === 9 && e.firstTabInLine === -1 && (e.firstTabInLine = e.position), r = e.input.charCodeAt(++e.position);
|
|
1278
|
+
if (t && i && r === 35) do
|
|
1279
|
+
r = e.input.charCodeAt(++e.position);
|
|
1280
|
+
while (!F(r) && r !== 0);
|
|
1281
|
+
if (!F(r)) break;
|
|
1282
|
+
for (B(e), n++, i = !0, r = e.input.charCodeAt(e.position); r === 32;) e.lineIndent++, r = e.input.charCodeAt(++e.position);
|
|
1283
|
+
}
|
|
1284
|
+
return n;
|
|
1285
|
+
}
|
|
1286
|
+
function H(e, t = e.position) {
|
|
1287
|
+
let n = e.input.charCodeAt(t);
|
|
1288
|
+
if ((n === 45 || n === 46) && n === e.input.charCodeAt(t + 1) && n === e.input.charCodeAt(t + 2)) {
|
|
1289
|
+
let n = e.input.charCodeAt(t + 3);
|
|
1290
|
+
return n === 0 || L(n);
|
|
1291
|
+
}
|
|
1292
|
+
return !1;
|
|
1293
|
+
}
|
|
1294
|
+
function on(e) {
|
|
1295
|
+
e.position === e.lineStart && e.input.charCodeAt(e.position) === 65279 && (e.position++, e.lineStart = e.position);
|
|
1296
|
+
}
|
|
1297
|
+
function sn(e) {
|
|
1298
|
+
if (e.position !== e.lineStart) return !1;
|
|
1299
|
+
if (H(e)) return !0;
|
|
1300
|
+
if (e.input.charCodeAt(e.position) !== 65279) return !1;
|
|
1301
|
+
let t = M(e);
|
|
1302
|
+
on(e), V(e, !0);
|
|
1303
|
+
let n = e.input.charCodeAt(e.position), r = e.position === e.lineStart && (n === 37 || n === 45 && H(e));
|
|
1304
|
+
return N(e, t), r;
|
|
1305
|
+
}
|
|
1306
|
+
function cn(e) {
|
|
1307
|
+
let t = e.input.charCodeAt(e.position);
|
|
1308
|
+
for (; t !== 0 && !F(t);) t = e.input.charCodeAt(++e.position);
|
|
1309
|
+
}
|
|
1310
|
+
function ln(e, t, n) {
|
|
1311
|
+
Bt.test(e.input.slice(t, n)) && P(e, `the stream contains non-printable characters`);
|
|
1312
|
+
}
|
|
1313
|
+
function un(e, t, n) {
|
|
1314
|
+
if (e.input.charCodeAt(e.position) !== 33) return !1;
|
|
1315
|
+
t.tagStart !== E && P(e, `duplication of a tag property`);
|
|
1316
|
+
let r = e.position, i = !1, a = !1, o = `!`, s = e.input.charCodeAt(++e.position);
|
|
1317
|
+
s === 60 ? (i = !0, s = e.input.charCodeAt(++e.position)) : s === 33 && (a = !0, o = `!!`, s = e.input.charCodeAt(++e.position));
|
|
1318
|
+
let c = e.position, l;
|
|
1319
|
+
if (i) {
|
|
1320
|
+
for (; s !== 0 && s !== 62;) s = e.input.charCodeAt(++e.position);
|
|
1321
|
+
s !== 62 && P(e, `unexpected end of the stream within a verbatim tag`), l = e.input.slice(c, e.position), e.position++;
|
|
1322
|
+
} else {
|
|
1323
|
+
for (; s !== 0 && !L(s) && !(n && z(s));) s === 33 && (a ? P(e, `tag suffix cannot contain exclamation marks`) : (o = e.input.slice(c - 1, e.position + 1), Ht.test(o) || P(e, `named tag handle cannot contain such characters`), a = !0, c = e.position + 1)), s = e.input.charCodeAt(++e.position);
|
|
1324
|
+
l = e.input.slice(c, e.position), Vt.test(l) && P(e, `tag suffix cannot contain flow indicator characters`);
|
|
1325
|
+
}
|
|
1326
|
+
return l && !(i ? Gt.test(l) : Kt.test(l)) && P(e, `tag name cannot contain such characters: ${l}`), !i && o !== `!` && o !== `!!` && !Lt.call(e.tagHandlers, o) && P(e, `undeclared tag handle "${o}"`), t.tagStart = r, t.tagEnd = e.position, !0;
|
|
1327
|
+
}
|
|
1328
|
+
function dn(e, t) {
|
|
1329
|
+
if (e.input.charCodeAt(e.position) !== 38) return !1;
|
|
1330
|
+
t.anchorStart !== E && P(e, `duplication of an anchor property`), e.position++;
|
|
1331
|
+
let n = e.position;
|
|
1332
|
+
for (; e.input.charCodeAt(e.position) !== 0 && !L(e.input.charCodeAt(e.position)) && !z(e.input.charCodeAt(e.position));) e.position++;
|
|
1333
|
+
return e.position === n && P(e, `name of an anchor node must contain at least one character`), t.anchorStart = n, t.anchorEnd = e.position, !0;
|
|
1334
|
+
}
|
|
1335
|
+
function fn(e, t) {
|
|
1336
|
+
if (e.input.charCodeAt(e.position) !== 42) return !1;
|
|
1337
|
+
(t.anchorStart !== E || t.tagStart !== E) && P(e, `alias node should not have any properties`), e.position++;
|
|
1338
|
+
let n = e.position;
|
|
1339
|
+
for (; e.input.charCodeAt(e.position) !== 0 && !L(e.input.charCodeAt(e.position)) && !z(e.input.charCodeAt(e.position));) e.position++;
|
|
1340
|
+
return e.position === n && P(e, `name of an alias node must contain at least one character`), $t(e, n, e.position), !0;
|
|
1341
|
+
}
|
|
1342
|
+
function pn(e, t) {
|
|
1343
|
+
V(e, !1), e.lineIndent < t && P(e, `deficient indentation`);
|
|
1344
|
+
}
|
|
1345
|
+
function mn(e, t, n) {
|
|
1346
|
+
if (e.input.charCodeAt(e.position) !== 39) return !1;
|
|
1347
|
+
e.position++;
|
|
1348
|
+
let r = e.position, i = !0;
|
|
1349
|
+
for (; e.input.charCodeAt(e.position) !== 0;) {
|
|
1350
|
+
let a = e.input.charCodeAt(e.position);
|
|
1351
|
+
if (a === 39) {
|
|
1352
|
+
if (e.input.charCodeAt(e.position + 1) === 39) {
|
|
1353
|
+
i = !1, e.position += 2;
|
|
1354
|
+
continue;
|
|
1355
|
+
}
|
|
1356
|
+
let t = e.position;
|
|
1357
|
+
return e.position++, k(e, r, t, n.anchorStart, n.anchorEnd, n.tagStart, n.tagEnd, b.SINGLE_QUOTED, S.CLIP, -1, i), !0;
|
|
1358
|
+
}
|
|
1359
|
+
F(a) ? (i = !1, pn(e, t)) : e.position === e.lineStart && H(e) ? P(e, `unexpected end of the document within a single quoted scalar`) : a !== 9 && a < 32 ? P(e, `expected valid JSON character`) : e.position++;
|
|
1360
|
+
}
|
|
1361
|
+
P(e, `unexpected end of the stream within a single quoted scalar`);
|
|
1362
|
+
}
|
|
1363
|
+
function hn(e, t, n) {
|
|
1364
|
+
if (e.input.charCodeAt(e.position) !== 34) return !1;
|
|
1365
|
+
e.position++;
|
|
1366
|
+
let r = e.position, i = !0;
|
|
1367
|
+
for (; e.input.charCodeAt(e.position) !== 0;) {
|
|
1368
|
+
let a = e.input.charCodeAt(e.position);
|
|
1369
|
+
if (a === 34) {
|
|
1370
|
+
let t = e.position;
|
|
1371
|
+
return e.position++, k(e, r, t, n.anchorStart, n.anchorEnd, n.tagStart, n.tagEnd, b.DOUBLE_QUOTED, S.CLIP, -1, i), !0;
|
|
1372
|
+
}
|
|
1373
|
+
if (a === 92) {
|
|
1374
|
+
i = !1;
|
|
1375
|
+
let n = e.input.charCodeAt(++e.position);
|
|
1376
|
+
if (F(n)) pn(e, t);
|
|
1377
|
+
else if (an(n)) e.position++;
|
|
1378
|
+
else {
|
|
1379
|
+
let t = rn(n);
|
|
1380
|
+
for (t === 0 && P(e, `unknown escape sequence`); t-- > 0;) e.position++, nn(e.input.charCodeAt(e.position)) < 0 && P(e, `expected hexadecimal character`);
|
|
1381
|
+
e.position++;
|
|
1382
|
+
}
|
|
1383
|
+
} else F(a) ? (i = !1, pn(e, t)) : e.position === e.lineStart && H(e) ? P(e, `unexpected end of the document within a double quoted scalar`) : a !== 9 && a < 32 ? P(e, `expected valid JSON character`) : e.position++;
|
|
1384
|
+
}
|
|
1385
|
+
P(e, `unexpected end of the stream within a double quoted scalar`);
|
|
1386
|
+
}
|
|
1387
|
+
function gn(e, t, n) {
|
|
1388
|
+
let r = e.input.charCodeAt(e.position), i = S.CLIP, a = -1, o = !1;
|
|
1389
|
+
if (r !== 124 && r !== 62) return !1;
|
|
1390
|
+
let s = r === 124 ? b.LITERAL_BLOCK : b.FOLDED_BLOCK;
|
|
1391
|
+
for (e.position++; e.input.charCodeAt(e.position) !== 0;) {
|
|
1392
|
+
let n = e.input.charCodeAt(e.position), r = tn(n);
|
|
1393
|
+
if (n === 43 || n === 45) i !== S.CLIP && P(e, `repeat of a chomping mode identifier`), i = n === 43 ? S.KEEP : S.STRIP, e.position++;
|
|
1394
|
+
else if (r >= 0) r === 0 && P(e, `bad explicit indentation width of a block scalar; it cannot be less than one`), o && P(e, `repeat of an indentation width identifier`), a = t + r - 1, o = !0, e.position++;
|
|
1395
|
+
else break;
|
|
1396
|
+
}
|
|
1397
|
+
let c = !1;
|
|
1398
|
+
for (; I(e.input.charCodeAt(e.position));) c = !0, e.position++;
|
|
1399
|
+
c && e.input.charCodeAt(e.position) === 35 && cn(e), F(e.input.charCodeAt(e.position)) ? B(e) : e.input.charCodeAt(e.position) !== 0 && P(e, `a line break is expected`);
|
|
1400
|
+
let l = o ? a : -1, u = 0, d = e.position, f = e.position;
|
|
1401
|
+
for (; e.input.charCodeAt(e.position) !== 0;) {
|
|
1402
|
+
let n = e.position, r = 0;
|
|
1403
|
+
for (; e.input.charCodeAt(n + r) === 32;) r++;
|
|
1404
|
+
let i = e.input.charCodeAt(n + r);
|
|
1405
|
+
if (i === 0) {
|
|
1406
|
+
l >= 0 ? r > l && (f = n + r) : r > 0 && (f = n + r);
|
|
1407
|
+
break;
|
|
1408
|
+
}
|
|
1409
|
+
if (sn(e)) break;
|
|
1410
|
+
if (!o && l === -1 && F(i) && (u = Math.max(u, r)), !o && l === -1 && !F(i) && (i === 9 && r < t && (e.position = n + r, P(e, `tab characters must not be used in indentation`)), r < u && (e.position = n + r, P(e, `bad indentation of a mapping entry`))), l === -1 && i !== 0 && !F(i) && r < t) {
|
|
1411
|
+
e.lineIndent = r, e.position = n + r;
|
|
1412
|
+
break;
|
|
1413
|
+
}
|
|
1414
|
+
!o && i !== 0 && !F(i) && l === -1 && (l = r);
|
|
1415
|
+
let a = l === -1 ? t + 1 : l;
|
|
1416
|
+
if (i !== 0 && !F(i) && r < a) {
|
|
1417
|
+
e.lineIndent = r, e.position = n + r;
|
|
1418
|
+
break;
|
|
1419
|
+
}
|
|
1420
|
+
cn(e), f = e.position, F(e.input.charCodeAt(e.position)) && (B(e), f = e.position);
|
|
1421
|
+
}
|
|
1422
|
+
return ln(e, d, f), k(e, d, f, n.anchorStart, n.anchorEnd, n.tagStart, n.tagEnd, s, i, l), !0;
|
|
1423
|
+
}
|
|
1424
|
+
function _n(e, t) {
|
|
1425
|
+
let n = e.input.charCodeAt(e.position), r = t === D;
|
|
1426
|
+
if (n === 0 || L(n) || n === 35 || n === 38 || n === 42 || n === 33 || n === 124 || n === 62 || n === 39 || n === 34 || n === 37 || n === 64 || n === 96 || r && z(n)) return !1;
|
|
1427
|
+
if (n === 63 || n === 45) {
|
|
1428
|
+
let t = e.input.charCodeAt(e.position + 1);
|
|
1429
|
+
if (R(t) || r && z(t)) return !1;
|
|
1430
|
+
}
|
|
1431
|
+
return !0;
|
|
1432
|
+
}
|
|
1433
|
+
function vn(e, t, n, r) {
|
|
1434
|
+
if (!_n(e, n)) return !1;
|
|
1435
|
+
let i = e.position, a = e.position, o = e.input.charCodeAt(e.position), s = n === D, c = !1;
|
|
1436
|
+
for (; o !== 0 && !sn(e);) {
|
|
1437
|
+
if (o === 58) {
|
|
1438
|
+
let t = e.input.charCodeAt(e.position + 1);
|
|
1439
|
+
if (R(t) || s && z(t)) break;
|
|
1440
|
+
} else if (o === 35) {
|
|
1441
|
+
if (L(e.input.charCodeAt(e.position - 1))) break;
|
|
1442
|
+
} else if (s && z(o)) break;
|
|
1443
|
+
else if (F(o)) {
|
|
1444
|
+
let n = e.position, r = e.line, i = e.lineStart, a = e.lineIndent;
|
|
1445
|
+
if (V(e, !1), e.lineIndent >= t) {
|
|
1446
|
+
c = !0, o = e.input.charCodeAt(e.position);
|
|
1447
|
+
continue;
|
|
1448
|
+
}
|
|
1449
|
+
e.position = n, e.line = r, e.lineStart = i, e.lineIndent = a;
|
|
1450
|
+
break;
|
|
1451
|
+
}
|
|
1452
|
+
I(o) || (a = e.position + 1), o = e.input.charCodeAt(++e.position);
|
|
1453
|
+
}
|
|
1454
|
+
return a !== i && (ln(e, i, a), k(e, i, a, r.anchorStart, r.anchorEnd, r.tagStart, r.tagEnd, b.PLAIN, S.CLIP, -1, !c), !0);
|
|
1455
|
+
}
|
|
1456
|
+
function U(e, t) {
|
|
1457
|
+
let n = e.line;
|
|
1458
|
+
V(e, !0), (e.line > n && e.lineIndent < t || e.firstTabInLine !== -1 && e.lineIndent < t) && P(e, `deficient indentation`);
|
|
1459
|
+
}
|
|
1460
|
+
function yn(e, t, n) {
|
|
1461
|
+
let r = e.input.charCodeAt(e.position), i = r === 123, a = e.position, o = !0;
|
|
1462
|
+
if (r !== 91 && r !== 123) return !1;
|
|
1463
|
+
let s = i ? 125 : 93;
|
|
1464
|
+
for (i ? Zt(e, a, n.anchorStart, n.anchorEnd, n.tagStart, n.tagEnd, x.FLOW) : Xt(e, a, n.anchorStart, n.anchorEnd, n.tagStart, n.tagEnd, x.FLOW), e.position++; e.input.charCodeAt(e.position) !== 0;) {
|
|
1465
|
+
U(e, t);
|
|
1466
|
+
let n = e.input.charCodeAt(e.position);
|
|
1467
|
+
if (n === s) return e.position++, A(e), !0;
|
|
1468
|
+
o ? n === 44 && P(e, `expected the node content, but found ','`) : P(e, `missed comma between flow collection entries`);
|
|
1469
|
+
let r = !1, a = !1;
|
|
1470
|
+
n === 63 && L(e.input.charCodeAt(e.position + 1)) && (r = a = !0, e.position += 1, U(e, t));
|
|
1471
|
+
let c = e.line, l = M(e), u = G(e, t, D, !1, !0);
|
|
1472
|
+
U(e, t), n = e.input.charCodeAt(e.position), (i || a || e.line === c) && n === 58 ? (r = !0, e.position++, U(e, t), i || Qt(e, l), u || j(e), G(e, t, D, !1, !0) || j(e), U(e, t), i || A(e)) : i && r ? (u || j(e), j(e)) : i ? j(e) : r && (Qt(e, l), u || j(e), j(e), A(e)), n = e.input.charCodeAt(e.position), n === 44 ? (o = !0, e.position++) : o = !1;
|
|
1473
|
+
}
|
|
1474
|
+
P(e, `unexpected end of the stream within a flow collection`);
|
|
1475
|
+
}
|
|
1476
|
+
function bn(e, t, n) {
|
|
1477
|
+
if (e.firstTabInLine !== -1 || e.input.charCodeAt(e.position) !== 45 || !R(e.input.charCodeAt(e.position + 1))) return !1;
|
|
1478
|
+
for (Xt(e, e.position, n.anchorStart, n.anchorEnd, n.tagStart, n.tagEnd, x.BLOCK); e.input.charCodeAt(e.position) === 45 && R(e.input.charCodeAt(e.position + 1));) {
|
|
1479
|
+
e.firstTabInLine !== -1 && (e.position = e.firstTabInLine, P(e, `tab characters must not be used in indentation`));
|
|
1480
|
+
let n = e.line;
|
|
1481
|
+
e.position++;
|
|
1482
|
+
let r = V(e, !0) > 0;
|
|
1483
|
+
if (e.firstTabInLine !== -1 && e.input.charCodeAt(e.position) === 45 && R(e.input.charCodeAt(e.position + 1)) && P(e, `bad indentation of a sequence entry`), r && e.lineIndent <= t ? j(e) : G(e, t, zt, !1, !0), V(e, !0), e.lineIndent < t || e.position >= e.length) break;
|
|
1484
|
+
e.lineIndent > t && P(e, `bad indentation of a sequence entry`), e.line === n && e.input.charCodeAt(e.position) === 45 && R(e.input.charCodeAt(e.position + 1)) && P(e, `bad indentation of a sequence entry`);
|
|
1485
|
+
}
|
|
1486
|
+
return A(e), !0;
|
|
1487
|
+
}
|
|
1488
|
+
function W(e, t, n, r) {
|
|
1489
|
+
let i = !1, a = !1, o = !1, s = !1;
|
|
1490
|
+
if (e.firstTabInLine !== -1) return !1;
|
|
1491
|
+
let c = e.input.charCodeAt(e.position);
|
|
1492
|
+
for (; c !== 0;) {
|
|
1493
|
+
!i && e.firstTabInLine !== -1 && (e.position = e.firstTabInLine, P(e, `tab characters must not be used in indentation`));
|
|
1494
|
+
let l = e.input.charCodeAt(e.position + 1), u = e.line;
|
|
1495
|
+
if ((c === 63 || c === 58) && R(l)) o ||= (Zt(e, e.position, r.anchorStart, r.anchorEnd, r.tagStart, r.tagEnd, x.BLOCK), !0), c === 63 ? (i && j(e), a = !0, i = !0) : i ? i = !1 : (j(e), a = !0, i = !1), e.position += 1, s = !0;
|
|
1496
|
+
else {
|
|
1497
|
+
i &&= (j(e), !1);
|
|
1498
|
+
let t = M(e);
|
|
1499
|
+
if (!G(e, n, Rt, !1, !0)) break;
|
|
1500
|
+
if (e.line === u) {
|
|
1501
|
+
for (c = e.input.charCodeAt(e.position); I(c);) c = e.input.charCodeAt(++e.position);
|
|
1502
|
+
if (c === 58) {
|
|
1503
|
+
if (c = e.input.charCodeAt(++e.position), R(c) || P(e, `a whitespace character is expected after the key-value separator within a block mapping`), !o) {
|
|
1504
|
+
for (N(e, t), Zt(e, t.position, r.anchorStart, r.anchorEnd, r.tagStart, r.tagEnd, x.BLOCK), o = !0, G(e, n, Rt, !1, !0), c = e.input.charCodeAt(e.position); I(c);) c = e.input.charCodeAt(++e.position);
|
|
1505
|
+
e.position++;
|
|
1506
|
+
}
|
|
1507
|
+
a = !0, i = !1, s = !1;
|
|
1508
|
+
} else if (a) P(e, `expected ':' after a mapping key`);
|
|
1509
|
+
else return r.anchorStart !== E || r.tagStart !== E ? (N(e, t), !1) : !0;
|
|
1510
|
+
} else if (a) P(e, `can not read a block mapping entry; a multiline key may not be an implicit key`);
|
|
1511
|
+
else return r.anchorStart !== E || r.tagStart !== E ? (N(e, t), !1) : !0;
|
|
1512
|
+
}
|
|
1513
|
+
if (G(e, t, O, !0, s) && (s = !1), i || (s &&= (j(e), !1)), V(e, !0), c = e.input.charCodeAt(e.position), (e.line === u || e.lineIndent > t) && c !== 0) P(e, `bad indentation of a mapping entry`);
|
|
1514
|
+
else if (e.lineIndent < t) break;
|
|
1515
|
+
}
|
|
1516
|
+
return a ? (i && j(e), o && A(e), !0) : !1;
|
|
1517
|
+
}
|
|
1518
|
+
function G(e, t, n, r, i, a = !0) {
|
|
1519
|
+
e.depth >= e.maxDepth && P(e, `nesting exceeded maxDepth (${e.maxDepth})`), e.depth++;
|
|
1520
|
+
let o = 1, s = !1, c = !1, l = null, u = en(), d = n === O || n === zt, f = d, p = d;
|
|
1521
|
+
if (r && V(e, !0) && (s = !0, o = e.lineIndent > t ? 1 : e.lineIndent === t ? 0 : -1), o === 1) for (;;) {
|
|
1522
|
+
let r = e.input.charCodeAt(e.position), i = M(e);
|
|
1523
|
+
if (s && o !== 1 && (r === 33 || r === 38)) break;
|
|
1524
|
+
if (s && p && (u.tagStart !== E || u.anchorStart !== E) && (r === 33 || r === 38)) {
|
|
1525
|
+
let n = M(e), r = t + 1;
|
|
1526
|
+
if (W(e, e.position - e.lineStart, r, u) && e.events[n.eventsLength]?.type === y.MAPPING) return e.depth--, !0;
|
|
1527
|
+
N(e, n);
|
|
1528
|
+
}
|
|
1529
|
+
if (s && (r === 33 && u.tagStart !== E || r === 38 && u.anchorStart !== E) || !un(e, u, n === D) && !dn(e, u)) break;
|
|
1530
|
+
l === null && (l = i), V(e, !0) ? (s = !0, f = p, o = e.lineIndent > t ? 1 : e.lineIndent === t ? 0 : -1) : f = !1;
|
|
1531
|
+
}
|
|
1532
|
+
if (f &&= s || i, o === 1 || n === O) {
|
|
1533
|
+
let r = n === D || n === Rt ? t : t + 1, i = e.position - e.lineStart;
|
|
1534
|
+
if (o === 1) {
|
|
1535
|
+
if (f && (bn(e, i, u) || W(e, i, r, u)) || yn(e, r, u)) c = !0;
|
|
1536
|
+
else {
|
|
1537
|
+
let t = e.input.charCodeAt(e.position);
|
|
1538
|
+
if (l !== null && a && p && !f && t !== 124 && t !== 62) {
|
|
1539
|
+
let t = M(e), n = l.position - l.lineStart;
|
|
1540
|
+
N(e, l), W(e, n, r, en()) && e.events[t.eventsLength]?.type === y.MAPPING ? c = !0 : N(e, t);
|
|
1541
|
+
}
|
|
1542
|
+
!c && (d && gn(e, r, u) || mn(e, r, u) || hn(e, r, u) || fn(e, u) || vn(e, r, n, u)) && (c = !0);
|
|
1543
|
+
}
|
|
1544
|
+
} else o === 0 && (c = f && bn(e, i, u));
|
|
1545
|
+
}
|
|
1546
|
+
return d &&= !c, !c && (u.anchorStart !== E || u.tagStart !== E || d) && (k(e, E, E, u.anchorStart, u.anchorEnd, u.tagStart, u.tagEnd, b.PLAIN), c = !0), e.depth--, c || u.anchorStart !== E || u.tagStart !== E;
|
|
1547
|
+
}
|
|
1548
|
+
function xn(e) {
|
|
1549
|
+
if (e.lineIndent > 0 || e.input.charCodeAt(e.position) !== 37) return !1;
|
|
1550
|
+
e.position++;
|
|
1551
|
+
let t = e.position;
|
|
1552
|
+
for (; e.input.charCodeAt(e.position) !== 0 && !L(e.input.charCodeAt(e.position));) e.position++;
|
|
1553
|
+
let n = e.input.slice(t, e.position), r = [];
|
|
1554
|
+
for (n.length === 0 && P(e, `directive name must not be less than one character in length`); e.input.charCodeAt(e.position) !== 0 && !F(e.input.charCodeAt(e.position));) {
|
|
1555
|
+
for (; I(e.input.charCodeAt(e.position));) e.position++;
|
|
1556
|
+
if (e.input.charCodeAt(e.position) === 35 || F(e.input.charCodeAt(e.position)) || e.input.charCodeAt(e.position) === 0) break;
|
|
1557
|
+
let t = e.position;
|
|
1558
|
+
for (; e.input.charCodeAt(e.position) !== 0 && !L(e.input.charCodeAt(e.position));) e.position++;
|
|
1559
|
+
r.push(e.input.slice(t, e.position));
|
|
1560
|
+
}
|
|
1561
|
+
if (F(e.input.charCodeAt(e.position)) && B(e), n === `YAML`) {
|
|
1562
|
+
e.directives.some((e) => e.kind === `yaml`) && P(e, `duplication of %YAML directive`), r.length !== 1 && P(e, `YAML directive accepts exactly one argument`);
|
|
1563
|
+
let t = /^([0-9]+)\.([0-9]+)$/.exec(r[0]);
|
|
1564
|
+
t === null && P(e, `ill-formed argument of the YAML directive`), parseInt(t[1], 10) !== 1 && P(e, `unacceptable YAML version of the document`), e.directives.push({
|
|
1565
|
+
kind: `yaml`,
|
|
1566
|
+
version: r[0]
|
|
1567
|
+
});
|
|
1568
|
+
} else if (n === `TAG`) {
|
|
1569
|
+
r.length !== 2 && P(e, `TAG directive accepts exactly two arguments`);
|
|
1570
|
+
let [t, n] = r;
|
|
1571
|
+
Ht.test(t) || P(e, `ill-formed tag handle (first argument) of the TAG directive`), Lt.call(e.tagHandlers, t) && P(e, `there is a previously declared suffix for "${t}" tag handle`), qt.test(n) || P(e, `ill-formed tag prefix (second argument) of the TAG directive`), e.tagHandlers[t] = n, e.directives.push({
|
|
1572
|
+
kind: `tag`,
|
|
1573
|
+
handle: t,
|
|
1574
|
+
prefix: n
|
|
1575
|
+
});
|
|
1576
|
+
}
|
|
1577
|
+
return !0;
|
|
1578
|
+
}
|
|
1579
|
+
function Sn(e) {
|
|
1580
|
+
e.directives = [], e.tagHandlers = Object.create(null);
|
|
1581
|
+
let t = !1;
|
|
1582
|
+
for (V(e, !0); xn(e);) t = !0, V(e, !0);
|
|
1583
|
+
let n = !1, r = !1, i = !0;
|
|
1584
|
+
if (e.lineIndent === 0 && e.input.charCodeAt(e.position) === 45 && e.input.charCodeAt(e.position + 1) === 45 && e.input.charCodeAt(e.position + 2) === 45 && R(e.input.charCodeAt(e.position + 3))) {
|
|
1585
|
+
n = !0;
|
|
1586
|
+
let t = e.line;
|
|
1587
|
+
e.position += 3, V(e, !0), i = e.line > t;
|
|
1588
|
+
} else t && P(e, `directives end mark is expected`);
|
|
1589
|
+
let a = e.events.length;
|
|
1590
|
+
if (!n && e.position === e.lineStart && e.input.charCodeAt(e.position) === 46 && H(e)) {
|
|
1591
|
+
e.position += 3, V(e, !0);
|
|
1592
|
+
return;
|
|
1593
|
+
}
|
|
1594
|
+
if (Yt(e, n, !1), G(e, e.lineIndent - 1, O, !1, i, i) || j(e), V(e, !0), e.position === e.lineStart && H(e) && (r = e.input.charCodeAt(e.position) === 46, r)) {
|
|
1595
|
+
let t = e.line;
|
|
1596
|
+
e.position += 3, V(e, !0), e.line === t && e.position < e.length && P(e, `end of the stream or a document separator is expected`);
|
|
1597
|
+
}
|
|
1598
|
+
let o = e.events[a];
|
|
1599
|
+
o?.type === y.DOCUMENT && (o.explicitEnd = r), A(e), !r && e.position < e.length && !sn(e) && P(e, `end of the stream or a document separator is expected`);
|
|
1600
|
+
}
|
|
1601
|
+
function Cn(e, t) {
|
|
1602
|
+
let n = e.length, r = {
|
|
1603
|
+
...Jt,
|
|
1604
|
+
...t,
|
|
1605
|
+
input: `${e}\0`,
|
|
1606
|
+
length: n,
|
|
1607
|
+
position: 0,
|
|
1608
|
+
line: 0,
|
|
1609
|
+
lineStart: 0,
|
|
1610
|
+
lineIndent: 0,
|
|
1611
|
+
firstTabInLine: -1,
|
|
1612
|
+
depth: 0,
|
|
1613
|
+
directives: [],
|
|
1614
|
+
tagHandlers: Object.create(null),
|
|
1615
|
+
events: []
|
|
1616
|
+
}, i = e.indexOf(`\0`);
|
|
1617
|
+
for (i !== -1 && v.throwAt(e, i, `null byte is not allowed in input`, r.filename); r.position < r.length && (on(r), V(r, !0), !(r.position >= r.length));) {
|
|
1618
|
+
let e = r.position;
|
|
1619
|
+
Sn(r), r.position === e && P(r, `can not read a document`);
|
|
1620
|
+
}
|
|
1621
|
+
return r.events;
|
|
1622
|
+
}
|
|
1623
|
+
var wn = {
|
|
1624
|
+
...Jt,
|
|
1625
|
+
...wt
|
|
1626
|
+
};
|
|
1627
|
+
function Tn(e, t = {}) {
|
|
1628
|
+
let n = {
|
|
1629
|
+
...wn,
|
|
1630
|
+
...t
|
|
1631
|
+
}, r = String(e), i = Object.keys(Jt), a = Object.keys(wt);
|
|
1632
|
+
return It(Cn(r, Ue(n, i)), {
|
|
1633
|
+
...Ue(n, a),
|
|
1634
|
+
source: r
|
|
1635
|
+
});
|
|
1636
|
+
}
|
|
1637
|
+
function En(e, t) {
|
|
1638
|
+
let n = Tn(e, t);
|
|
1639
|
+
if (n.length === 0) throw new v(`expected a document, but the input is empty`);
|
|
1640
|
+
if (n.length === 1) return n[0];
|
|
1641
|
+
throw new v(`expected a single document in the stream, but found more`);
|
|
1642
|
+
}
|
|
1643
|
+
var K = Symbol(`INVALID`);
|
|
1644
|
+
function Dn(e) {
|
|
1645
|
+
let t = new Set([
|
|
1646
|
+
e.defaultScalarTag,
|
|
1647
|
+
e.defaultSequenceTag,
|
|
1648
|
+
e.defaultMappingTag
|
|
1649
|
+
].filter((e) => e !== void 0)), n = e.implicitScalarTags, r = e.tags.filter((e) => !(e.nodeKind === `scalar` && e.implicit) && !t.has(e)), i = e.tags.filter((e) => t.has(e));
|
|
1650
|
+
return [
|
|
1651
|
+
...n.map((e) => ({
|
|
1652
|
+
tag: e,
|
|
1653
|
+
implicitTag: !0
|
|
1654
|
+
})),
|
|
1655
|
+
...r.map((e) => ({
|
|
1656
|
+
tag: e,
|
|
1657
|
+
implicitTag: !1
|
|
1658
|
+
})),
|
|
1659
|
+
...i.map((e) => ({
|
|
1660
|
+
tag: e,
|
|
1661
|
+
implicitTag: !0
|
|
1662
|
+
}))
|
|
1663
|
+
];
|
|
1664
|
+
}
|
|
1665
|
+
function On(e, t) {
|
|
1666
|
+
for (let n = 0, r = e.representTypes.length; n < r; n += 1) {
|
|
1667
|
+
let { tag: r, implicitTag: i } = e.representTypes[n];
|
|
1668
|
+
if (r.identify(t)) {
|
|
1669
|
+
let e;
|
|
1670
|
+
return e = r.matchByTagPrefix ? r.representTagName(t) : r.tagName, {
|
|
1671
|
+
tag: r,
|
|
1672
|
+
tagName: e,
|
|
1673
|
+
implicitTag: i
|
|
1674
|
+
};
|
|
1675
|
+
}
|
|
1676
|
+
}
|
|
1677
|
+
return null;
|
|
1678
|
+
}
|
|
1679
|
+
function q(e, t) {
|
|
1680
|
+
if (!e.noRefs && typeof t == `object` && t) {
|
|
1681
|
+
let n = e.refs.get(t);
|
|
1682
|
+
if (n) return n.anchor === void 0 && (n.anchor = `ref_${e.refCounter++}`), {
|
|
1683
|
+
kind: `alias`,
|
|
1684
|
+
anchor: n.anchor
|
|
1685
|
+
};
|
|
1686
|
+
}
|
|
1687
|
+
let n = On(e, t);
|
|
1688
|
+
if (!n) {
|
|
1689
|
+
if (t === void 0 || e.skipInvalid) return K;
|
|
1690
|
+
throw new v(`unacceptable kind of an object to dump ${Object.prototype.toString.call(t)}`);
|
|
1691
|
+
}
|
|
1692
|
+
let { tag: r, tagName: i, implicitTag: a } = n, o = a ? i : St(i);
|
|
1693
|
+
if (r.nodeKind === `scalar`) return {
|
|
1694
|
+
kind: `scalar`,
|
|
1695
|
+
tag: o,
|
|
1696
|
+
tagged: !a,
|
|
1697
|
+
style: b.PLAIN,
|
|
1698
|
+
value: r.represent(t)
|
|
1699
|
+
};
|
|
1700
|
+
if (r.nodeKind === `sequence`) {
|
|
1701
|
+
let n = r.represent(t), i = {
|
|
1702
|
+
kind: `sequence`,
|
|
1703
|
+
tag: o,
|
|
1704
|
+
tagged: !a,
|
|
1705
|
+
style: x.BLOCK,
|
|
1706
|
+
items: []
|
|
1707
|
+
};
|
|
1708
|
+
e.noRefs || e.refs.set(t, i);
|
|
1709
|
+
for (let t = 0, r = n.length; t < r; t += 1) {
|
|
1710
|
+
let r = q(e, n[t]);
|
|
1711
|
+
r === K && n[t] === void 0 && (r = q(e, null)), r !== K && i.items.push(r);
|
|
1712
|
+
}
|
|
1713
|
+
return i;
|
|
1714
|
+
}
|
|
1715
|
+
let s = r.represent(t), c = {
|
|
1716
|
+
kind: `mapping`,
|
|
1717
|
+
tag: o,
|
|
1718
|
+
tagged: !a,
|
|
1719
|
+
style: x.BLOCK,
|
|
1720
|
+
items: []
|
|
1721
|
+
};
|
|
1722
|
+
e.noRefs || e.refs.set(t, c);
|
|
1723
|
+
for (let [t, n] of s) {
|
|
1724
|
+
let r = q(e, t);
|
|
1725
|
+
if (r === K) continue;
|
|
1726
|
+
let i = q(e, n);
|
|
1727
|
+
i !== K && c.items.push({
|
|
1728
|
+
key: r,
|
|
1729
|
+
value: i
|
|
1730
|
+
});
|
|
1731
|
+
}
|
|
1732
|
+
return c;
|
|
1733
|
+
}
|
|
1734
|
+
function kn(e, t, n = {}) {
|
|
1735
|
+
let r = q({
|
|
1736
|
+
representTypes: Dn(t),
|
|
1737
|
+
noRefs: n.noRefs ?? !1,
|
|
1738
|
+
skipInvalid: n.skipInvalid ?? !1,
|
|
1739
|
+
refs: /* @__PURE__ */ new Map(),
|
|
1740
|
+
refCounter: 0
|
|
1741
|
+
}, e);
|
|
1742
|
+
return [{
|
|
1743
|
+
contents: r === K ? null : r,
|
|
1744
|
+
directives: []
|
|
1745
|
+
}];
|
|
1746
|
+
}
|
|
1747
|
+
var An = Symbol(`visit:break`);
|
|
1748
|
+
var jn = Symbol(`visit:skip`);
|
|
1749
|
+
function J(e, t, n) {
|
|
1750
|
+
let r = t(e, n);
|
|
1751
|
+
if (r === An) return !0;
|
|
1752
|
+
if (r === jn) return !1;
|
|
1753
|
+
let i = n.depth + 1;
|
|
1754
|
+
switch (e.kind) {
|
|
1755
|
+
case `sequence`:
|
|
1756
|
+
for (let n of e.items) if (J(n, t, {
|
|
1757
|
+
depth: i,
|
|
1758
|
+
parent: e,
|
|
1759
|
+
isKey: !1
|
|
1760
|
+
})) return !0;
|
|
1761
|
+
break;
|
|
1762
|
+
case `mapping`: for (let { key: n, value: r } of e.items) if (J(n, t, {
|
|
1763
|
+
depth: i,
|
|
1764
|
+
parent: e,
|
|
1765
|
+
isKey: !0
|
|
1766
|
+
}) || J(r, t, {
|
|
1767
|
+
depth: i,
|
|
1768
|
+
parent: e,
|
|
1769
|
+
isKey: !1
|
|
1770
|
+
})) return !0;
|
|
1771
|
+
}
|
|
1772
|
+
return !1;
|
|
1773
|
+
}
|
|
1774
|
+
function Mn(e, t) {
|
|
1775
|
+
for (let n of e) if (n.contents && J(n.contents, t, {
|
|
1776
|
+
depth: 0,
|
|
1777
|
+
parent: null,
|
|
1778
|
+
isKey: !1
|
|
1779
|
+
})) return;
|
|
1780
|
+
}
|
|
1781
|
+
function Y(e, t) {
|
|
1782
|
+
return !!(e & 1 << t);
|
|
1783
|
+
}
|
|
1784
|
+
var Nn = {
|
|
1785
|
+
applyQuoteFlowKeysOption: Fn,
|
|
1786
|
+
doubleQuoteForInvisibles: In,
|
|
1787
|
+
doubleQuoteWhitespaceOnly: Ln,
|
|
1788
|
+
applyForceQuotesOption: Rn,
|
|
1789
|
+
tryLongOrMultilineAsBlock: zn,
|
|
1790
|
+
quoteInvalidPlain: Bn,
|
|
1791
|
+
fallbackToDoubleQuoted: Vn
|
|
1792
|
+
};
|
|
1793
|
+
function Pn(e) {
|
|
1794
|
+
return e.presenterOptions.quoteStyle === `single` && Y(e.allowedStylesMask, b.SINGLE_QUOTED) ? b.SINGLE_QUOTED : b.DOUBLE_QUOTED;
|
|
1795
|
+
}
|
|
1796
|
+
function Fn(e) {
|
|
1797
|
+
e.presenterOptions.quoteFlowKeys && (!e.isKey || !e.flowOnly || e.style !== b.PLAIN || (e.style = b.DOUBLE_QUOTED));
|
|
1798
|
+
}
|
|
1799
|
+
function In(e) {
|
|
1800
|
+
e.style === b.PLAIN && /[\t\x7F-\xA0\u2028\u2029\uFEFF\uFFFE\uFFFF]/.test(e.node.value) && (e.style = b.DOUBLE_QUOTED);
|
|
1801
|
+
}
|
|
1802
|
+
function Ln(e) {
|
|
1803
|
+
e.style === b.PLAIN && /^\s+$/.test(e.node.value) && (e.style = b.DOUBLE_QUOTED);
|
|
1804
|
+
}
|
|
1805
|
+
function Rn(e) {
|
|
1806
|
+
e.presenterOptions.forceQuotes && (e.isKey || e.style !== b.PLAIN || (e.style = e.node.value.includes(`
|
|
1807
|
+
`) ? b.DOUBLE_QUOTED : Pn(e)));
|
|
1808
|
+
}
|
|
1809
|
+
function zn(e) {
|
|
1810
|
+
if (e.style !== b.PLAIN || e.isKey) return;
|
|
1811
|
+
let t = e.node.value, n = t.indexOf(`
|
|
1812
|
+
`) !== -1;
|
|
1813
|
+
if (!Y(e.allowedStylesMask, b.LITERAL_BLOCK)) {
|
|
1814
|
+
n && (e.style = b.DOUBLE_QUOTED);
|
|
1815
|
+
return;
|
|
1816
|
+
}
|
|
1817
|
+
let r = e.presenterOptions.lineWidth;
|
|
1818
|
+
if (r === -1) {
|
|
1819
|
+
n && (e.style = b.LITERAL_BLOCK);
|
|
1820
|
+
return;
|
|
1821
|
+
}
|
|
1822
|
+
let i = Math.max(Math.min(r, 40), r - e.shiftOfContent), a = 0, o = !1;
|
|
1823
|
+
for (; a <= t.length;) {
|
|
1824
|
+
let e = t.length, n = t.indexOf(`
|
|
1825
|
+
`, a);
|
|
1826
|
+
n !== -1 && (e = n);
|
|
1827
|
+
let r = t.slice(a, e);
|
|
1828
|
+
if (r.length > i && r[0] !== ` ` && / [^ \t]/.test(r) && (o = !0), n === -1) break;
|
|
1829
|
+
a = n + 1;
|
|
1830
|
+
}
|
|
1831
|
+
o ? e.style = b.FOLDED_BLOCK : n && (e.style = b.LITERAL_BLOCK);
|
|
1832
|
+
}
|
|
1833
|
+
function Bn(e) {
|
|
1834
|
+
e.style === b.PLAIN && !Y(e.allowedStylesMask, b.PLAIN) && (e.style = Pn(e));
|
|
1835
|
+
}
|
|
1836
|
+
function Vn(e) {
|
|
1837
|
+
Y(e.allowedStylesMask, e.style) || (e.style = b.DOUBLE_QUOTED);
|
|
1838
|
+
}
|
|
1839
|
+
function X(e, t) {
|
|
1840
|
+
return e | 1 << t;
|
|
1841
|
+
}
|
|
1842
|
+
var Hn = `[\\x09\\x0A\\x0D\\x20-\\x7E\\x85\\xA0-\\uD7FF\\uE000-\\uFFFD\\u{10000}-\\u{10FFFF}]`;
|
|
1843
|
+
var Un = `[\\n\\r]`;
|
|
1844
|
+
var Wn = `\\uFEFF`;
|
|
1845
|
+
var Gn = `[ \\t]`;
|
|
1846
|
+
var Kn = `(?:(?!(?:${Un}|${Wn}))${Hn})`;
|
|
1847
|
+
var Z = `(?:(?!${Gn})${Kn})`;
|
|
1848
|
+
var qn = `[\\x09\\x20-\\uD7FF\\uE000-\\uFFFF\\u{10000}-\\u{10FFFF}]`;
|
|
1849
|
+
var Jn = `[-?:,\\[\\]{}#&*!|>'"%@\`]`;
|
|
1850
|
+
var Yn = `[,\\[\\]{}]`;
|
|
1851
|
+
var Xn = Z;
|
|
1852
|
+
var Zn = `(?:(?!${Yn})${Z})`;
|
|
1853
|
+
var Qn = `(?:(?:(?!${Jn})${Z})|[?:-](?=${Xn}))`;
|
|
1854
|
+
var $n = `(?:(?:(?!${Jn})${Z})|[?:-](?=${Zn}))`;
|
|
1855
|
+
var er = `(?:(?:(?![:#])${Xn})|:(?=${Xn}))#*`;
|
|
1856
|
+
var tr = `(?:(?:(?![:#])${Zn})|:(?=${Zn}))#*`;
|
|
1857
|
+
var nr = `(?:${Gn}*${er})*`;
|
|
1858
|
+
var rr = `(?:${Gn}*${tr})*`;
|
|
1859
|
+
var ir = `${Qn}#*${nr}`;
|
|
1860
|
+
var ar = `${$n}#*${rr}`;
|
|
1861
|
+
var or = ir;
|
|
1862
|
+
var sr = ar;
|
|
1863
|
+
var cr = `\\n+${er}${nr}`;
|
|
1864
|
+
var lr = `\\n+${tr}${rr}`;
|
|
1865
|
+
var ur = `${ir}(?:${cr})*`;
|
|
1866
|
+
var dr = `${ar}(?:${lr})*`;
|
|
1867
|
+
var fr = RegExp(`^(?:${ur})$`, `u`);
|
|
1868
|
+
var pr = RegExp(`^(?:${dr})$`, `u`);
|
|
1869
|
+
var mr = RegExp(`^(?:${or})$`, `u`);
|
|
1870
|
+
var hr = RegExp(`^(?:${sr})$`, `u`);
|
|
1871
|
+
var gr = RegExp(`^(?:${qn})*$`, `u`);
|
|
1872
|
+
var _r = RegExp(`^(?:${qn}|\\n)*$`, `u`);
|
|
1873
|
+
var vr = RegExp(`^(?:${Kn}|\\n)*$`, `u`);
|
|
1874
|
+
var yr = /^(?:---|\.\.\.)(?=$|[ \t\n\r])/;
|
|
1875
|
+
var br = /^(?:---|\.\.\.)(?=$|[ \t\n\r])/m;
|
|
1876
|
+
function xr(e) {
|
|
1877
|
+
let t = e.node.value;
|
|
1878
|
+
if (t !== ``) {
|
|
1879
|
+
if (!(e.isKey ? e.flowOnly ? hr : mr : e.flowOnly ? pr : fr).test(t) || e.shiftOfFirstLine === 0 && yr.test(t)) return !1;
|
|
1880
|
+
if (e.shiftOfContent === 0) {
|
|
1881
|
+
let e = t.indexOf(`
|
|
1882
|
+
`);
|
|
1883
|
+
if (e !== -1) {
|
|
1884
|
+
let n = t.slice(e + 1);
|
|
1885
|
+
if (br.test(n)) return !1;
|
|
1886
|
+
}
|
|
1887
|
+
}
|
|
1888
|
+
}
|
|
1889
|
+
let n = e.presenterOptions.schema.resolveImplicitScalarTag(t).tag.tagName;
|
|
1890
|
+
return !(!e.node.tagged && n !== e.node.tag || !e.node.tagged && t === `=` && n === e.presenterOptions.schema.defaultScalarTag.tagName);
|
|
1891
|
+
}
|
|
1892
|
+
function Sr(e) {
|
|
1893
|
+
let t = e.node.value;
|
|
1894
|
+
if (!(e.isKey ? gr : _r).test(t) || /[ \t]\n|\n[ \t]/.test(t)) return !1;
|
|
1895
|
+
if (!e.isKey && e.shiftOfContent === 0) {
|
|
1896
|
+
let e = t.indexOf(`
|
|
1897
|
+
`);
|
|
1898
|
+
if (e !== -1 && br.test(t.slice(e + 1))) return !1;
|
|
1899
|
+
}
|
|
1900
|
+
return !0;
|
|
1901
|
+
}
|
|
1902
|
+
function Cr(e) {
|
|
1903
|
+
if (e.flowOnly || !vr.test(e.node.value)) return !1;
|
|
1904
|
+
let t = e.shiftOfContent - e.shiftOfParent;
|
|
1905
|
+
return !(t < 1 || t > 9 && /^\n* /.test(e.node.value) || e.shiftOfContent === 0 && br.test(e.node.value));
|
|
1906
|
+
}
|
|
1907
|
+
function wr(e) {
|
|
1908
|
+
let t = X(0, b.DOUBLE_QUOTED);
|
|
1909
|
+
xr(e) && (t = X(t, b.PLAIN)), Sr(e) && (t = X(t, b.SINGLE_QUOTED)), Cr(e) && (t = X(X(t, b.LITERAL_BLOCK), b.FOLDED_BLOCK)), e.allowedStylesMask = t;
|
|
1910
|
+
}
|
|
1911
|
+
function Tr(e) {
|
|
1912
|
+
switch (e.style) {
|
|
1913
|
+
case b.PLAIN: return Er(e);
|
|
1914
|
+
case b.SINGLE_QUOTED: return Dr(e);
|
|
1915
|
+
case b.LITERAL_BLOCK: return Or(e);
|
|
1916
|
+
case b.FOLDED_BLOCK: return kr(e);
|
|
1917
|
+
case b.DOUBLE_QUOTED: return Ar(e);
|
|
1918
|
+
}
|
|
1919
|
+
}
|
|
1920
|
+
function Er(e) {
|
|
1921
|
+
return jr(e.node.value, e.shiftOfContent);
|
|
1922
|
+
}
|
|
1923
|
+
function Dr(e) {
|
|
1924
|
+
return `'${jr(e.node.value, e.shiftOfContent).replace(/'/g, `''`)}'`;
|
|
1925
|
+
}
|
|
1926
|
+
function Or(e) {
|
|
1927
|
+
let t = e.node.value;
|
|
1928
|
+
return `|` + Pr(t, e.shiftOfParent, e.shiftOfContent) + Fr(Mr(t, e.shiftOfContent));
|
|
1929
|
+
}
|
|
1930
|
+
function kr(e) {
|
|
1931
|
+
let t = e.node.value, n = e.presenterOptions.lineWidth, r = 1 / 0;
|
|
1932
|
+
return n !== -1 && (r = Math.max(Math.min(n, 40), n - e.shiftOfContent)), `>` + Pr(t, e.shiftOfParent, e.shiftOfContent) + Fr(Mr(Rr(t, r), e.shiftOfContent));
|
|
1933
|
+
}
|
|
1934
|
+
function Ar(e) {
|
|
1935
|
+
return `"${Vr(e.node.value)}"`;
|
|
1936
|
+
}
|
|
1937
|
+
function jr(e, t) {
|
|
1938
|
+
let n = e.indexOf(`
|
|
1939
|
+
`);
|
|
1940
|
+
if (n === -1) return e;
|
|
1941
|
+
let r = ` `.repeat(t), i = e.slice(0, n), a = /(\n+)([^\n]*)/g;
|
|
1942
|
+
a.lastIndex = n;
|
|
1943
|
+
let o;
|
|
1944
|
+
for (; o = a.exec(e);) {
|
|
1945
|
+
let e = o[1].length, t = o[2];
|
|
1946
|
+
i += `
|
|
1947
|
+
`.repeat(e + 1) + r + t;
|
|
1948
|
+
}
|
|
1949
|
+
return i;
|
|
1950
|
+
}
|
|
1951
|
+
function Mr(e, t) {
|
|
1952
|
+
let n = ` `.repeat(t), r = 0, i = ``, a = e.length;
|
|
1953
|
+
for (; r < a;) {
|
|
1954
|
+
let t, o = e.indexOf(`
|
|
1955
|
+
`, r);
|
|
1956
|
+
o === -1 ? (t = e.slice(r), r = a) : (t = e.slice(r, o + 1), r = o + 1), t.length && t !== `
|
|
1957
|
+
` && (i += n), i += t;
|
|
1958
|
+
}
|
|
1959
|
+
return i;
|
|
1960
|
+
}
|
|
1961
|
+
function Nr(e) {
|
|
1962
|
+
return /^\n* /.test(e);
|
|
1963
|
+
}
|
|
1964
|
+
function Pr(e, t, n) {
|
|
1965
|
+
let r = Nr(e) ? String(n - t) : ``, i = e[e.length - 1] === `
|
|
1966
|
+
`;
|
|
1967
|
+
return `${r}${i && (e[e.length - 2] === `
|
|
1968
|
+
` || e === `
|
|
1969
|
+
`) ? `+` : i ? `` : `-`}\n`;
|
|
1970
|
+
}
|
|
1971
|
+
function Fr(e) {
|
|
1972
|
+
return e[e.length - 1] === `
|
|
1973
|
+
` ? e.slice(0, -1) : e;
|
|
1974
|
+
}
|
|
1975
|
+
function Ir(e) {
|
|
1976
|
+
return e === ` ` || e === ` `;
|
|
1977
|
+
}
|
|
1978
|
+
function Lr(e, t) {
|
|
1979
|
+
if (e === `` || Ir(e[0])) return e;
|
|
1980
|
+
let n = / [^ \t]/g, r, i = 0, a, o = 0, s = 0, c = ``;
|
|
1981
|
+
for (; r = n.exec(e);) s = r.index, s - i > t && (a = o > i ? o : s, c += `\n${e.slice(i, a)}`, i = a + 1), o = s;
|
|
1982
|
+
return c += `
|
|
1983
|
+
`, e.length - i > t && o > i ? c += `${e.slice(i, o)}\n${e.slice(o + 1)}` : c += e.slice(i), c.slice(1);
|
|
1984
|
+
}
|
|
1985
|
+
function Rr(e, t) {
|
|
1986
|
+
let n = /(\n+)([^\n]*)/g, r = e.indexOf(`
|
|
1987
|
+
`);
|
|
1988
|
+
r === -1 && (r = e.length), n.lastIndex = r;
|
|
1989
|
+
let i = Lr(e.slice(0, r), t), a = e[0] === `
|
|
1990
|
+
` || Ir(e[0]), o, s;
|
|
1991
|
+
for (; s = n.exec(e);) {
|
|
1992
|
+
let e = s[1], n = s[2];
|
|
1993
|
+
o = n !== `` && Ir(n[0]), i += e + (!a && !o && n !== `` ? `
|
|
1994
|
+
` : ``) + Lr(n, t), a = o;
|
|
1995
|
+
}
|
|
1996
|
+
return i;
|
|
1997
|
+
}
|
|
1998
|
+
var zr = /["\\\x00-\x1F\x7F-\xA0\u2028\u2029\uD800-\uDFFF\uFEFF\uFFFE\uFFFF]/gu;
|
|
1999
|
+
function Br(e) {
|
|
2000
|
+
switch (e) {
|
|
2001
|
+
case `\0`: return `\\0`;
|
|
2002
|
+
case `\x07`: return `\\a`;
|
|
2003
|
+
case `\b`: return `\\b`;
|
|
2004
|
+
case ` `: return `\\t`;
|
|
2005
|
+
case `
|
|
2006
|
+
`: return `\\n`;
|
|
2007
|
+
case `\v`: return `\\v`;
|
|
2008
|
+
case `\f`: return `\\f`;
|
|
2009
|
+
case `\r`: return `\\r`;
|
|
2010
|
+
case `\x1B`: return `\\e`;
|
|
2011
|
+
case `"`: return `\\"`;
|
|
2012
|
+
case `\\`: return `\\\\`;
|
|
2013
|
+
case `
`: return `\\N`;
|
|
2014
|
+
case `\xA0`: return `\\_`;
|
|
2015
|
+
case `\u2028`: return `\\L`;
|
|
2016
|
+
case `\u2029`: return `\\P`;
|
|
2017
|
+
}
|
|
2018
|
+
let t = e.charCodeAt(0), n = t.toString(16).toUpperCase();
|
|
2019
|
+
return t <= 255 ? `\\x${`0`.repeat(2 - n.length)}${n}` : `\\u${`0`.repeat(4 - n.length)}${n}`;
|
|
2020
|
+
}
|
|
2021
|
+
function Vr(e) {
|
|
2022
|
+
return e.replace(zr, Br);
|
|
2023
|
+
}
|
|
2024
|
+
var Q = 10;
|
|
2025
|
+
var Hr = {
|
|
2026
|
+
indent: 2,
|
|
2027
|
+
seqNoIndent: !1,
|
|
2028
|
+
seqInlineFirst: !0,
|
|
2029
|
+
lineWidth: 80,
|
|
2030
|
+
flowBracketPadding: !1,
|
|
2031
|
+
flowSkipCommaSpace: !1,
|
|
2032
|
+
flowSkipColonSpace: !1,
|
|
2033
|
+
quoteFlowKeys: !1,
|
|
2034
|
+
quoteStyle: `single`,
|
|
2035
|
+
forceQuotes: !1,
|
|
2036
|
+
scalarStyleRules: Object.keys(Nn).map((e) => Reflect.get(Nn, e)),
|
|
2037
|
+
tagBeforeAnchor: !1
|
|
2038
|
+
};
|
|
2039
|
+
function Ur(e) {
|
|
2040
|
+
return e.tagged ? e.tag : St(e.tag);
|
|
2041
|
+
}
|
|
2042
|
+
function Wr(e) {
|
|
2043
|
+
let t = {
|
|
2044
|
+
...Hr,
|
|
2045
|
+
...e
|
|
2046
|
+
};
|
|
2047
|
+
return t.flowSkipColonSpace && (t.quoteFlowKeys = !0), {
|
|
2048
|
+
...t,
|
|
2049
|
+
defaultScalarTagName: t.schema.defaultScalarTag.tagName,
|
|
2050
|
+
openEnded: !1
|
|
2051
|
+
};
|
|
2052
|
+
}
|
|
2053
|
+
function Gr(e, t) {
|
|
2054
|
+
return `\n${` `.repeat(e.indent * t)}`;
|
|
2055
|
+
}
|
|
2056
|
+
function Kr(e, t, n, r, i, a) {
|
|
2057
|
+
return {
|
|
2058
|
+
node: t,
|
|
2059
|
+
parent: n,
|
|
2060
|
+
level: r,
|
|
2061
|
+
isKey: i,
|
|
2062
|
+
flowOnly: a,
|
|
2063
|
+
shiftOfParent: r === 0 ? -1 : e.indent * (r - 1),
|
|
2064
|
+
shiftOfContent: e.indent * Math.max(1, r),
|
|
2065
|
+
shiftOfFirstLine: r === 0 ? 0 : e.indent * r,
|
|
2066
|
+
presenterOptions: e,
|
|
2067
|
+
allowedStylesMask: 0,
|
|
2068
|
+
style: t.style
|
|
2069
|
+
};
|
|
2070
|
+
}
|
|
2071
|
+
function qr(e, t, n) {
|
|
2072
|
+
let r = ``;
|
|
2073
|
+
for (let i = 0, a = n.items.length; i < a; i += 1) {
|
|
2074
|
+
let a = $(e, t, n.items[i], n, {}).text;
|
|
2075
|
+
i > 0 && (r += `,${e.flowSkipCommaSpace ? `` : ` `}`), r += a;
|
|
2076
|
+
}
|
|
2077
|
+
let i = e.flowBracketPadding && n.items.length > 0 ? ` ` : ``;
|
|
2078
|
+
return `[${i}${r}${i}]`;
|
|
2079
|
+
}
|
|
2080
|
+
function Jr(e, t, n, r) {
|
|
2081
|
+
let i = ``;
|
|
2082
|
+
for (let a = 0, o = n.items.length; a < o; a += 1) {
|
|
2083
|
+
let o = $(e, t + 1, n.items[a], n, {
|
|
2084
|
+
block: !0,
|
|
2085
|
+
compact: e.seqInlineFirst,
|
|
2086
|
+
isblockseq: !0
|
|
2087
|
+
}).text;
|
|
2088
|
+
(!r || i !== ``) && (i += Gr(e, t)), o === `` || Q === o.charCodeAt(0) ? i += `-` : i += `- `, i += o;
|
|
2089
|
+
}
|
|
2090
|
+
return i;
|
|
2091
|
+
}
|
|
2092
|
+
function Yr(e, t, n) {
|
|
2093
|
+
let r = ``;
|
|
2094
|
+
for (let { key: i, value: a } of n.items) {
|
|
2095
|
+
let o = ``;
|
|
2096
|
+
r !== `` && (o += `,${e.flowSkipCommaSpace ? `` : ` `}`);
|
|
2097
|
+
let s = $(e, t, i, n, { iskey: !0 }), c = s.text, l = $(e, t, a, n, {}).text, u = e.flowSkipColonSpace || l === `` ? `` : ` `, d = i.kind === `scalar` && s.noBody && (i.tagged || i.anchor !== void 0), f = i.kind === `alias` || d ? ` ` : ``;
|
|
2098
|
+
o += `${c}${f}:${u}${l}`, r += o;
|
|
2099
|
+
}
|
|
2100
|
+
let i = e.flowBracketPadding && r !== `` ? ` ` : ``;
|
|
2101
|
+
return `{${i}${r}${i}}`;
|
|
2102
|
+
}
|
|
2103
|
+
function Xr(e, t, n, r) {
|
|
2104
|
+
let i = ``;
|
|
2105
|
+
for (let a = 0, o = n.items.length; a < o; a += 1) {
|
|
2106
|
+
let o = ``;
|
|
2107
|
+
(!r || i !== ``) && (o += Gr(e, t));
|
|
2108
|
+
let { key: s, value: c } = n.items[a], l = (s.kind === `mapping` || s.kind === `sequence`) && s.style === x.BLOCK && s.items.length !== 0 || s.kind === `scalar` && (s.style === b.LITERAL_BLOCK || s.style === b.FOLDED_BLOCK), u = l ? $(e, t + 1, s, n, {
|
|
2109
|
+
block: !0,
|
|
2110
|
+
compact: !0,
|
|
2111
|
+
isblockseq: !Zr(e, s, t + 1)
|
|
2112
|
+
}) : $(e, t + 1, s, n, {
|
|
2113
|
+
block: !0,
|
|
2114
|
+
compact: !0,
|
|
2115
|
+
iskey: !0
|
|
2116
|
+
}), d = u.text, f = s.kind === `scalar` && s.value.indexOf(`
|
|
2117
|
+
`) !== -1, p = d.length > 1024 && /^[\s\S]{1025}/u.test(d), m = l || f || p;
|
|
2118
|
+
m && (d && Q === d.charCodeAt(0) ? o += `?` : o += `? `), o += d, m && (o += Gr(e, t));
|
|
2119
|
+
let h = $(e, t + 1, c, n, {
|
|
2120
|
+
block: !0,
|
|
2121
|
+
compact: m,
|
|
2122
|
+
isblockseq: m && !Zr(e, c, t + 1)
|
|
2123
|
+
}).text, ee = s.kind === `scalar` && u.noBody && (s.tagged || s.anchor !== void 0), te = !m && (s.kind === `alias` || ee) ? ` ` : ``;
|
|
2124
|
+
h === `` || Q === h.charCodeAt(0) ? o += `${te}:` : o += `${te}: `, o += h, i += o;
|
|
2125
|
+
}
|
|
2126
|
+
return i;
|
|
2127
|
+
}
|
|
2128
|
+
function Zr(e, t, n) {
|
|
2129
|
+
return t.kind === `alias` || t.tagged || t.anchor !== void 0 || e.indent < 2 && n > 0;
|
|
2130
|
+
}
|
|
2131
|
+
function $(e, t, n, r, i) {
|
|
2132
|
+
if (n.kind === `alias`) return e.openEnded = !1, {
|
|
2133
|
+
text: `*${n.anchor}`,
|
|
2134
|
+
noBody: !1
|
|
2135
|
+
};
|
|
2136
|
+
let { block: a = !1, iskey: o = !1, isblockseq: s = !1 } = i, c = i.compact ?? !1, l = n.anchor !== void 0;
|
|
2137
|
+
Zr(e, n, t) && (c = !1);
|
|
2138
|
+
let u, d = n.tagged, f = a && (n.kind === `mapping` || n.kind === `sequence`) && n.style === x.BLOCK && n.items.length !== 0;
|
|
2139
|
+
if (n.kind === `mapping`) u = f ? Xr(e, t, n, c) : Yr(e, t, n);
|
|
2140
|
+
else if (n.kind === `sequence`) u = f ? e.seqNoIndent && !s && t > 0 ? Jr(e, t - 1, n, c) : Jr(e, t, n, c) : qr(e, t, n);
|
|
2141
|
+
else {
|
|
2142
|
+
let i = Kr(e, n, r, t, o, !a);
|
|
2143
|
+
wr(i);
|
|
2144
|
+
for (let t of e.scalarStyleRules) t(i);
|
|
2145
|
+
u = Tr(i), e.openEnded = (i.style === b.LITERAL_BLOCK || i.style === b.FOLDED_BLOCK) && (n.value === `
|
|
2146
|
+
` || n.value.endsWith(`
|
|
2147
|
+
|
|
2148
|
+
`)), d = n.tagged || u === `` && i.flowOnly && r?.kind === `sequence` && !l || i.style !== b.PLAIN && n.tag !== e.defaultScalarTagName;
|
|
2149
|
+
}
|
|
2150
|
+
(n.kind === `mapping` || n.kind === `sequence`) && !f && (e.openEnded = !1), f && c && t > 0 && e.indent > 2 && (u = `${` `.repeat(e.indent - 2)}${u}`);
|
|
2151
|
+
let p = u === ``, m = u;
|
|
2152
|
+
if (d || l) {
|
|
2153
|
+
let t = [], r = d ? Ur(n) : null, i = l ? `&${n.anchor}` : null;
|
|
2154
|
+
e.tagBeforeAnchor ? (r !== null && t.push(r), i !== null && t.push(i)) : (i !== null && t.push(i), r !== null && t.push(r));
|
|
2155
|
+
let a = u === `` || u.charCodeAt(0) === Q ? `` : ` `;
|
|
2156
|
+
m = `${t.join(` `)}${a}${u}`;
|
|
2157
|
+
}
|
|
2158
|
+
return {
|
|
2159
|
+
text: m,
|
|
2160
|
+
noBody: p
|
|
2161
|
+
};
|
|
2162
|
+
}
|
|
2163
|
+
function Qr(e) {
|
|
2164
|
+
return (e.kind === `sequence` || e.kind === `mapping`) && e.style === x.BLOCK && e.items.length !== 0 && !e.tagged && e.anchor === void 0;
|
|
2165
|
+
}
|
|
2166
|
+
function $r(e) {
|
|
2167
|
+
let t = ``;
|
|
2168
|
+
for (let n of e.directives) {
|
|
2169
|
+
if (n.kind === `yaml`) {
|
|
2170
|
+
t += `%YAML ${n.version}\n`;
|
|
2171
|
+
continue;
|
|
2172
|
+
}
|
|
2173
|
+
let { handle: e, prefix: r } = n;
|
|
2174
|
+
t += `%TAG ${e} ${r}\n`;
|
|
2175
|
+
}
|
|
2176
|
+
return t;
|
|
2177
|
+
}
|
|
2178
|
+
function ei(e, t) {
|
|
2179
|
+
let n = Wr(t), r = ``, i = !1;
|
|
2180
|
+
for (let t = 0; t < e.length; t += 1) {
|
|
2181
|
+
let a = e[t];
|
|
2182
|
+
n.openEnded = !1;
|
|
2183
|
+
let o = $r(a), s = o !== ``, c = a.explicitStart || s || t > 0 && !i;
|
|
2184
|
+
if (r += o, a.contents === null) c && (r += `---
|
|
2185
|
+
`);
|
|
2186
|
+
else if (c) {
|
|
2187
|
+
let e = $(n, 0, a.contents, null, {
|
|
2188
|
+
block: !0,
|
|
2189
|
+
compact: !0
|
|
2190
|
+
}).text, t = e === `` ? `` : s || Qr(a.contents) ? `
|
|
2191
|
+
` : ` `;
|
|
2192
|
+
r += `---${t}${e}\n`;
|
|
2193
|
+
} else r += $(n, 0, a.contents, null, {
|
|
2194
|
+
block: !0,
|
|
2195
|
+
compact: !0
|
|
2196
|
+
}).text + `
|
|
2197
|
+
`;
|
|
2198
|
+
i = a.explicitEnd || n.openEnded, i && (r += `...
|
|
2199
|
+
`);
|
|
2200
|
+
}
|
|
2201
|
+
return r;
|
|
2202
|
+
}
|
|
2203
|
+
var ti = {
|
|
2204
|
+
...Hr,
|
|
2205
|
+
schema: $e,
|
|
2206
|
+
skipInvalid: !1,
|
|
2207
|
+
noRefs: !1,
|
|
2208
|
+
flowLevel: -1,
|
|
2209
|
+
sortKeys: !1,
|
|
2210
|
+
transform: () => {}
|
|
2211
|
+
};
|
|
2212
|
+
function ni(e, t) {
|
|
2213
|
+
let n = String(e), r = String(t);
|
|
2214
|
+
return n < r ? -1 : +(n > r);
|
|
2215
|
+
}
|
|
2216
|
+
function ri(e, t = {}) {
|
|
2217
|
+
let n = {
|
|
2218
|
+
...ti,
|
|
2219
|
+
...t
|
|
2220
|
+
}, r = kn(e, n.schema, {
|
|
2221
|
+
noRefs: n.noRefs,
|
|
2222
|
+
skipInvalid: n.skipInvalid
|
|
2223
|
+
});
|
|
2224
|
+
if (n.flowLevel >= 0 && Mn(r, (e, t) => {
|
|
2225
|
+
if (!(t.depth < n.flowLevel)) return (e.kind === `sequence` || e.kind === `mapping`) && (e.style = x.FLOW), jn;
|
|
2226
|
+
}), n.sortKeys) {
|
|
2227
|
+
let e = n.sortKeys === !0 ? ni : n.sortKeys;
|
|
2228
|
+
Mn(r, (t) => {
|
|
2229
|
+
t.kind === `mapping` && t.items.sort((t, n) => e(t.key.kind === `scalar` ? t.key.value : ``, n.key.kind === `scalar` ? n.key.value : ``));
|
|
2230
|
+
});
|
|
2231
|
+
}
|
|
2232
|
+
return n.transform(r), ei(r, {
|
|
2233
|
+
...Ue(n, Object.keys(Hr)),
|
|
2234
|
+
schema: n.schema
|
|
2235
|
+
});
|
|
2236
|
+
}
|
|
2237
|
+
y.DOCUMENT, y.SEQUENCE, y.MAPPING, y.SCALAR, y.ALIAS, y.POP, b.PLAIN, b.SINGLE_QUOTED, b.DOUBLE_QUOTED, b.LITERAL_BLOCK, b.FOLDED_BLOCK, x.BLOCK, x.FLOW, S.CLIP, S.STRIP, S.KEEP;
|
|
2238
|
+
//#endregion
|
|
2239
|
+
//#region ../../node_modules/.pnpm/confbox@0.3.1/node_modules/confbox/dist/yaml.mjs
|
|
2240
|
+
function o(e, r) {
|
|
2241
|
+
let i = En(i$1(e), r);
|
|
2242
|
+
return o$2(e, i, r), i;
|
|
2243
|
+
}
|
|
2244
|
+
function s(t, n) {
|
|
2245
|
+
let r = s$2(t, { preserveIndentation: !1 }), o = ri(t, {
|
|
2246
|
+
indent: typeof r.indent == `string` ? r.indent.length : r.indent,
|
|
2247
|
+
...n
|
|
2248
|
+
});
|
|
2249
|
+
return r.whitespace.start + o.trim() + r.whitespace.end;
|
|
2250
|
+
}
|
|
2251
|
+
//#endregion
|
|
2252
|
+
export { o as parseYAML, s as stringifyYAML };
|