@prokodo/ui 0.0.53 → 0.0.54

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/dist/_virtual/_commonjsHelpers.js +9 -0
  2. package/dist/_virtual/common.js +7 -0
  3. package/dist/components/post-item/PostItem.client.js +3 -4
  4. package/dist/components/post-item/PostItem.server.js +3 -4
  5. package/dist/components/post-item/PostItem.view.js +2 -2
  6. package/dist/components/post-teaser/PostTeaser.client.js +5 -6
  7. package/dist/components/post-teaser/PostTeaser.server.js +3 -4
  8. package/dist/components/post-teaser/PostTeaser.view.js +4 -4
  9. package/dist/components/rich-text/RichText.client.js +175 -10
  10. package/dist/components/rich-text/RichText.module.scss.js +1 -1
  11. package/dist/constants/project.js +1 -1
  12. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/common.js +5 -0
  13. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/common.js +90 -0
  14. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/core.js +1629 -0
  15. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/languages/bash.js +407 -0
  16. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/languages/c.js +307 -0
  17. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/languages/cpp.js +556 -0
  18. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/languages/csharp.js +413 -0
  19. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/languages/css.js +950 -0
  20. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/languages/diff.js +66 -0
  21. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/languages/go.js +167 -0
  22. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/languages/graphql.js +83 -0
  23. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/languages/ini.js +129 -0
  24. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/languages/java.js +268 -0
  25. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/languages/javascript.js +715 -0
  26. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/languages/json.js +53 -0
  27. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/languages/kotlin.js +268 -0
  28. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/languages/less.js +1031 -0
  29. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/languages/lua.js +74 -0
  30. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/languages/makefile.js +84 -0
  31. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/languages/markdown.js +245 -0
  32. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/languages/objectivec.js +256 -0
  33. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/languages/perl.js +498 -0
  34. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/languages/php-template.js +59 -0
  35. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/languages/php.js +614 -0
  36. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/languages/plaintext.js +25 -0
  37. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/languages/python-repl.js +38 -0
  38. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/languages/python.js +428 -0
  39. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/languages/r.js +223 -0
  40. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/languages/ruby.js +426 -0
  41. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/languages/rust.js +326 -0
  42. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/languages/scss.js +935 -0
  43. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/languages/shell.js +37 -0
  44. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/languages/sql.js +658 -0
  45. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/languages/swift.js +893 -0
  46. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/languages/typescript.js +829 -0
  47. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/languages/vbnet.js +146 -0
  48. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/languages/wasm.js +134 -0
  49. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/languages/xml.js +239 -0
  50. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/languages/yaml.js +214 -0
  51. package/dist/node_modules/.pnpm/marked-highlight@2.2.2_marked@15.0.12/node_modules/marked-highlight/src/index.js +93 -0
  52. package/dist/tsconfig.build.tsbuildinfo +1 -1
  53. package/dist/types/components/post-item/PostItem.model.d.ts +1 -1
  54. package/dist/types/components/post-teaser/PostTeaser.model.d.ts +1 -1
  55. package/dist/types/components/rich-text/RichText.client.d.ts +1 -1
  56. package/dist/types/components/rich-text/RichText.d.ts +5 -0
  57. package/dist/types/components/rich-text/RichText.lazy.d.ts +5 -0
  58. package/dist/types/components/rich-text/RichText.model.d.ts +5 -0
  59. package/dist/ui.css +38 -30
  60. package/package.json +3 -1
  61. package/dist/helpers/calculation.js +0 -6
@@ -0,0 +1,893 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
+ var swift_1;
4
+ var hasRequiredSwift;
5
+ function requireSwift() {
6
+ if (hasRequiredSwift) return swift_1;
7
+ hasRequiredSwift = 1;
8
+ function source(re) {
9
+ if (!re) return null;
10
+ if (typeof re === "string") return re;
11
+ return re.source;
12
+ }
13
+ __name(source, "source");
14
+ function lookahead(re) {
15
+ return concat("(?=", re, ")");
16
+ }
17
+ __name(lookahead, "lookahead");
18
+ function concat(...args) {
19
+ const joined = args.map((x) => source(x)).join("");
20
+ return joined;
21
+ }
22
+ __name(concat, "concat");
23
+ function stripOptionsFromArgs(args) {
24
+ const opts = args[args.length - 1];
25
+ if (typeof opts === "object" && opts.constructor === Object) {
26
+ args.splice(args.length - 1, 1);
27
+ return opts;
28
+ } else {
29
+ return {};
30
+ }
31
+ }
32
+ __name(stripOptionsFromArgs, "stripOptionsFromArgs");
33
+ function either(...args) {
34
+ const opts = stripOptionsFromArgs(args);
35
+ const joined = "(" + (opts.capture ? "" : "?:") + args.map((x) => source(x)).join("|") + ")";
36
+ return joined;
37
+ }
38
+ __name(either, "either");
39
+ const keywordWrapper = /* @__PURE__ */ __name((keyword) => concat(
40
+ /\b/,
41
+ keyword,
42
+ /\w$/.test(keyword) ? /\b/ : /\B/
43
+ ), "keywordWrapper");
44
+ const dotKeywords = [
45
+ "Protocol",
46
+ // contextual
47
+ "Type"
48
+ // contextual
49
+ ].map(keywordWrapper);
50
+ const optionalDotKeywords = [
51
+ "init",
52
+ "self"
53
+ ].map(keywordWrapper);
54
+ const keywordTypes = [
55
+ "Any",
56
+ "Self"
57
+ ];
58
+ const keywords = [
59
+ // strings below will be fed into the regular `keywords` engine while regex
60
+ // will result in additional modes being created to scan for those keywords to
61
+ // avoid conflicts with other rules
62
+ "actor",
63
+ "any",
64
+ // contextual
65
+ "associatedtype",
66
+ "async",
67
+ "await",
68
+ /as\?/,
69
+ // operator
70
+ /as!/,
71
+ // operator
72
+ "as",
73
+ // operator
74
+ "borrowing",
75
+ // contextual
76
+ "break",
77
+ "case",
78
+ "catch",
79
+ "class",
80
+ "consume",
81
+ // contextual
82
+ "consuming",
83
+ // contextual
84
+ "continue",
85
+ "convenience",
86
+ // contextual
87
+ "copy",
88
+ // contextual
89
+ "default",
90
+ "defer",
91
+ "deinit",
92
+ "didSet",
93
+ // contextual
94
+ "distributed",
95
+ "do",
96
+ "dynamic",
97
+ // contextual
98
+ "each",
99
+ "else",
100
+ "enum",
101
+ "extension",
102
+ "fallthrough",
103
+ /fileprivate\(set\)/,
104
+ "fileprivate",
105
+ "final",
106
+ // contextual
107
+ "for",
108
+ "func",
109
+ "get",
110
+ // contextual
111
+ "guard",
112
+ "if",
113
+ "import",
114
+ "indirect",
115
+ // contextual
116
+ "infix",
117
+ // contextual
118
+ /init\?/,
119
+ /init!/,
120
+ "inout",
121
+ /internal\(set\)/,
122
+ "internal",
123
+ "in",
124
+ "is",
125
+ // operator
126
+ "isolated",
127
+ // contextual
128
+ "nonisolated",
129
+ // contextual
130
+ "lazy",
131
+ // contextual
132
+ "let",
133
+ "macro",
134
+ "mutating",
135
+ // contextual
136
+ "nonmutating",
137
+ // contextual
138
+ /open\(set\)/,
139
+ // contextual
140
+ "open",
141
+ // contextual
142
+ "operator",
143
+ "optional",
144
+ // contextual
145
+ "override",
146
+ // contextual
147
+ "package",
148
+ "postfix",
149
+ // contextual
150
+ "precedencegroup",
151
+ "prefix",
152
+ // contextual
153
+ /private\(set\)/,
154
+ "private",
155
+ "protocol",
156
+ /public\(set\)/,
157
+ "public",
158
+ "repeat",
159
+ "required",
160
+ // contextual
161
+ "rethrows",
162
+ "return",
163
+ "set",
164
+ // contextual
165
+ "some",
166
+ // contextual
167
+ "static",
168
+ "struct",
169
+ "subscript",
170
+ "super",
171
+ "switch",
172
+ "throws",
173
+ "throw",
174
+ /try\?/,
175
+ // operator
176
+ /try!/,
177
+ // operator
178
+ "try",
179
+ // operator
180
+ "typealias",
181
+ /unowned\(safe\)/,
182
+ // contextual
183
+ /unowned\(unsafe\)/,
184
+ // contextual
185
+ "unowned",
186
+ // contextual
187
+ "var",
188
+ "weak",
189
+ // contextual
190
+ "where",
191
+ "while",
192
+ "willSet"
193
+ // contextual
194
+ ];
195
+ const literals = [
196
+ "false",
197
+ "nil",
198
+ "true"
199
+ ];
200
+ const precedencegroupKeywords = [
201
+ "assignment",
202
+ "associativity",
203
+ "higherThan",
204
+ "left",
205
+ "lowerThan",
206
+ "none",
207
+ "right"
208
+ ];
209
+ const numberSignKeywords = [
210
+ "#colorLiteral",
211
+ "#column",
212
+ "#dsohandle",
213
+ "#else",
214
+ "#elseif",
215
+ "#endif",
216
+ "#error",
217
+ "#file",
218
+ "#fileID",
219
+ "#fileLiteral",
220
+ "#filePath",
221
+ "#function",
222
+ "#if",
223
+ "#imageLiteral",
224
+ "#keyPath",
225
+ "#line",
226
+ "#selector",
227
+ "#sourceLocation",
228
+ "#warning"
229
+ ];
230
+ const builtIns = [
231
+ "abs",
232
+ "all",
233
+ "any",
234
+ "assert",
235
+ "assertionFailure",
236
+ "debugPrint",
237
+ "dump",
238
+ "fatalError",
239
+ "getVaList",
240
+ "isKnownUniquelyReferenced",
241
+ "max",
242
+ "min",
243
+ "numericCast",
244
+ "pointwiseMax",
245
+ "pointwiseMin",
246
+ "precondition",
247
+ "preconditionFailure",
248
+ "print",
249
+ "readLine",
250
+ "repeatElement",
251
+ "sequence",
252
+ "stride",
253
+ "swap",
254
+ "swift_unboxFromSwiftValueWithType",
255
+ "transcode",
256
+ "type",
257
+ "unsafeBitCast",
258
+ "unsafeDowncast",
259
+ "withExtendedLifetime",
260
+ "withUnsafeMutablePointer",
261
+ "withUnsafePointer",
262
+ "withVaList",
263
+ "withoutActuallyEscaping",
264
+ "zip"
265
+ ];
266
+ const operatorHead = either(
267
+ /[/=\-+!*%<>&|^~?]/,
268
+ /[\u00A1-\u00A7]/,
269
+ /[\u00A9\u00AB]/,
270
+ /[\u00AC\u00AE]/,
271
+ /[\u00B0\u00B1]/,
272
+ /[\u00B6\u00BB\u00BF\u00D7\u00F7]/,
273
+ /[\u2016-\u2017]/,
274
+ /[\u2020-\u2027]/,
275
+ /[\u2030-\u203E]/,
276
+ /[\u2041-\u2053]/,
277
+ /[\u2055-\u205E]/,
278
+ /[\u2190-\u23FF]/,
279
+ /[\u2500-\u2775]/,
280
+ /[\u2794-\u2BFF]/,
281
+ /[\u2E00-\u2E7F]/,
282
+ /[\u3001-\u3003]/,
283
+ /[\u3008-\u3020]/,
284
+ /[\u3030]/
285
+ );
286
+ const operatorCharacter = either(
287
+ operatorHead,
288
+ /[\u0300-\u036F]/,
289
+ /[\u1DC0-\u1DFF]/,
290
+ /[\u20D0-\u20FF]/,
291
+ /[\uFE00-\uFE0F]/,
292
+ /[\uFE20-\uFE2F]/
293
+ // TODO: The following characters are also allowed, but the regex isn't supported yet.
294
+ // /[\u{E0100}-\u{E01EF}]/u
295
+ );
296
+ const operator = concat(operatorHead, operatorCharacter, "*");
297
+ const identifierHead = either(
298
+ /[a-zA-Z_]/,
299
+ /[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,
300
+ /[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,
301
+ /[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,
302
+ /[\u1E00-\u1FFF]/,
303
+ /[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,
304
+ /[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,
305
+ /[\u2C00-\u2DFF\u2E80-\u2FFF]/,
306
+ /[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,
307
+ /[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,
308
+ /[\uFE47-\uFEFE\uFF00-\uFFFD]/
309
+ // Should be /[\uFE47-\uFFFD]/, but we have to exclude FEFF.
310
+ // The following characters are also allowed, but the regexes aren't supported yet.
311
+ // /[\u{10000}-\u{1FFFD}\u{20000-\u{2FFFD}\u{30000}-\u{3FFFD}\u{40000}-\u{4FFFD}]/u,
312
+ // /[\u{50000}-\u{5FFFD}\u{60000-\u{6FFFD}\u{70000}-\u{7FFFD}\u{80000}-\u{8FFFD}]/u,
313
+ // /[\u{90000}-\u{9FFFD}\u{A0000-\u{AFFFD}\u{B0000}-\u{BFFFD}\u{C0000}-\u{CFFFD}]/u,
314
+ // /[\u{D0000}-\u{DFFFD}\u{E0000-\u{EFFFD}]/u
315
+ );
316
+ const identifierCharacter = either(
317
+ identifierHead,
318
+ /\d/,
319
+ /[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/
320
+ );
321
+ const identifier = concat(identifierHead, identifierCharacter, "*");
322
+ const typeIdentifier = concat(/[A-Z]/, identifierCharacter, "*");
323
+ const keywordAttributes = [
324
+ "attached",
325
+ "autoclosure",
326
+ concat(/convention\(/, either("swift", "block", "c"), /\)/),
327
+ "discardableResult",
328
+ "dynamicCallable",
329
+ "dynamicMemberLookup",
330
+ "escaping",
331
+ "freestanding",
332
+ "frozen",
333
+ "GKInspectable",
334
+ "IBAction",
335
+ "IBDesignable",
336
+ "IBInspectable",
337
+ "IBOutlet",
338
+ "IBSegueAction",
339
+ "inlinable",
340
+ "main",
341
+ "nonobjc",
342
+ "NSApplicationMain",
343
+ "NSCopying",
344
+ "NSManaged",
345
+ concat(/objc\(/, identifier, /\)/),
346
+ "objc",
347
+ "objcMembers",
348
+ "propertyWrapper",
349
+ "requires_stored_property_inits",
350
+ "resultBuilder",
351
+ "Sendable",
352
+ "testable",
353
+ "UIApplicationMain",
354
+ "unchecked",
355
+ "unknown",
356
+ "usableFromInline",
357
+ "warn_unqualified_access"
358
+ ];
359
+ const availabilityKeywords = [
360
+ "iOS",
361
+ "iOSApplicationExtension",
362
+ "macOS",
363
+ "macOSApplicationExtension",
364
+ "macCatalyst",
365
+ "macCatalystApplicationExtension",
366
+ "watchOS",
367
+ "watchOSApplicationExtension",
368
+ "tvOS",
369
+ "tvOSApplicationExtension",
370
+ "swift"
371
+ ];
372
+ function swift(hljs) {
373
+ const WHITESPACE = {
374
+ match: /\s+/,
375
+ relevance: 0
376
+ };
377
+ const BLOCK_COMMENT = hljs.COMMENT(
378
+ "/\\*",
379
+ "\\*/",
380
+ { contains: ["self"] }
381
+ );
382
+ const COMMENTS = [
383
+ hljs.C_LINE_COMMENT_MODE,
384
+ BLOCK_COMMENT
385
+ ];
386
+ const DOT_KEYWORD = {
387
+ match: [
388
+ /\./,
389
+ either(...dotKeywords, ...optionalDotKeywords)
390
+ ],
391
+ className: { 2: "keyword" }
392
+ };
393
+ const KEYWORD_GUARD = {
394
+ // Consume .keyword to prevent highlighting properties and methods as keywords.
395
+ match: concat(/\./, either(...keywords)),
396
+ relevance: 0
397
+ };
398
+ const PLAIN_KEYWORDS = keywords.filter((kw) => typeof kw === "string").concat(["_|0"]);
399
+ const REGEX_KEYWORDS = keywords.filter((kw) => typeof kw !== "string").concat(keywordTypes).map(keywordWrapper);
400
+ const KEYWORD = { variants: [
401
+ {
402
+ className: "keyword",
403
+ match: either(...REGEX_KEYWORDS, ...optionalDotKeywords)
404
+ }
405
+ ] };
406
+ const KEYWORDS = {
407
+ $pattern: either(
408
+ /\b\w+/,
409
+ // regular keywords
410
+ /#\w+/
411
+ // number keywords
412
+ ),
413
+ keyword: PLAIN_KEYWORDS.concat(numberSignKeywords),
414
+ literal: literals
415
+ };
416
+ const KEYWORD_MODES = [
417
+ DOT_KEYWORD,
418
+ KEYWORD_GUARD,
419
+ KEYWORD
420
+ ];
421
+ const BUILT_IN_GUARD = {
422
+ // Consume .built_in to prevent highlighting properties and methods.
423
+ match: concat(/\./, either(...builtIns)),
424
+ relevance: 0
425
+ };
426
+ const BUILT_IN = {
427
+ className: "built_in",
428
+ match: concat(/\b/, either(...builtIns), /(?=\()/)
429
+ };
430
+ const BUILT_INS = [
431
+ BUILT_IN_GUARD,
432
+ BUILT_IN
433
+ ];
434
+ const OPERATOR_GUARD = {
435
+ // Prevent -> from being highlighting as an operator.
436
+ match: /->/,
437
+ relevance: 0
438
+ };
439
+ const OPERATOR = {
440
+ className: "operator",
441
+ relevance: 0,
442
+ variants: [
443
+ { match: operator },
444
+ {
445
+ // dot-operator: only operators that start with a dot are allowed to use dots as
446
+ // characters (..., ...<, .*, etc). So there rule here is: a dot followed by one or more
447
+ // characters that may also include dots.
448
+ match: `\\.(\\.|${operatorCharacter})+`
449
+ }
450
+ ]
451
+ };
452
+ const OPERATORS = [
453
+ OPERATOR_GUARD,
454
+ OPERATOR
455
+ ];
456
+ const decimalDigits = "([0-9]_*)+";
457
+ const hexDigits = "([0-9a-fA-F]_*)+";
458
+ const NUMBER = {
459
+ className: "number",
460
+ relevance: 0,
461
+ variants: [
462
+ // decimal floating-point-literal (subsumes decimal-literal)
463
+ { match: `\\b(${decimalDigits})(\\.(${decimalDigits}))?([eE][+-]?(${decimalDigits}))?\\b` },
464
+ // hexadecimal floating-point-literal (subsumes hexadecimal-literal)
465
+ { match: `\\b0x(${hexDigits})(\\.(${hexDigits}))?([pP][+-]?(${decimalDigits}))?\\b` },
466
+ // octal-literal
467
+ { match: /\b0o([0-7]_*)+\b/ },
468
+ // binary-literal
469
+ { match: /\b0b([01]_*)+\b/ }
470
+ ]
471
+ };
472
+ const ESCAPED_CHARACTER = /* @__PURE__ */ __name((rawDelimiter = "") => ({
473
+ className: "subst",
474
+ variants: [
475
+ { match: concat(/\\/, rawDelimiter, /[0\\tnr"']/) },
476
+ { match: concat(/\\/, rawDelimiter, /u\{[0-9a-fA-F]{1,8}\}/) }
477
+ ]
478
+ }), "ESCAPED_CHARACTER");
479
+ const ESCAPED_NEWLINE = /* @__PURE__ */ __name((rawDelimiter = "") => ({
480
+ className: "subst",
481
+ match: concat(/\\/, rawDelimiter, /[\t ]*(?:[\r\n]|\r\n)/)
482
+ }), "ESCAPED_NEWLINE");
483
+ const INTERPOLATION = /* @__PURE__ */ __name((rawDelimiter = "") => ({
484
+ className: "subst",
485
+ label: "interpol",
486
+ begin: concat(/\\/, rawDelimiter, /\(/),
487
+ end: /\)/
488
+ }), "INTERPOLATION");
489
+ const MULTILINE_STRING = /* @__PURE__ */ __name((rawDelimiter = "") => ({
490
+ begin: concat(rawDelimiter, /"""/),
491
+ end: concat(/"""/, rawDelimiter),
492
+ contains: [
493
+ ESCAPED_CHARACTER(rawDelimiter),
494
+ ESCAPED_NEWLINE(rawDelimiter),
495
+ INTERPOLATION(rawDelimiter)
496
+ ]
497
+ }), "MULTILINE_STRING");
498
+ const SINGLE_LINE_STRING = /* @__PURE__ */ __name((rawDelimiter = "") => ({
499
+ begin: concat(rawDelimiter, /"/),
500
+ end: concat(/"/, rawDelimiter),
501
+ contains: [
502
+ ESCAPED_CHARACTER(rawDelimiter),
503
+ INTERPOLATION(rawDelimiter)
504
+ ]
505
+ }), "SINGLE_LINE_STRING");
506
+ const STRING = {
507
+ className: "string",
508
+ variants: [
509
+ MULTILINE_STRING(),
510
+ MULTILINE_STRING("#"),
511
+ MULTILINE_STRING("##"),
512
+ MULTILINE_STRING("###"),
513
+ SINGLE_LINE_STRING(),
514
+ SINGLE_LINE_STRING("#"),
515
+ SINGLE_LINE_STRING("##"),
516
+ SINGLE_LINE_STRING("###")
517
+ ]
518
+ };
519
+ const REGEXP_CONTENTS = [
520
+ hljs.BACKSLASH_ESCAPE,
521
+ {
522
+ begin: /\[/,
523
+ end: /\]/,
524
+ relevance: 0,
525
+ contains: [hljs.BACKSLASH_ESCAPE]
526
+ }
527
+ ];
528
+ const BARE_REGEXP_LITERAL = {
529
+ begin: /\/[^\s](?=[^/\n]*\/)/,
530
+ end: /\//,
531
+ contains: REGEXP_CONTENTS
532
+ };
533
+ const EXTENDED_REGEXP_LITERAL = /* @__PURE__ */ __name((rawDelimiter) => {
534
+ const begin = concat(rawDelimiter, /\//);
535
+ const end = concat(/\//, rawDelimiter);
536
+ return {
537
+ begin,
538
+ end,
539
+ contains: [
540
+ ...REGEXP_CONTENTS,
541
+ {
542
+ scope: "comment",
543
+ begin: `#(?!.*${end})`,
544
+ end: /$/
545
+ }
546
+ ]
547
+ };
548
+ }, "EXTENDED_REGEXP_LITERAL");
549
+ const REGEXP = {
550
+ scope: "regexp",
551
+ variants: [
552
+ EXTENDED_REGEXP_LITERAL("###"),
553
+ EXTENDED_REGEXP_LITERAL("##"),
554
+ EXTENDED_REGEXP_LITERAL("#"),
555
+ BARE_REGEXP_LITERAL
556
+ ]
557
+ };
558
+ const QUOTED_IDENTIFIER = { match: concat(/`/, identifier, /`/) };
559
+ const IMPLICIT_PARAMETER = {
560
+ className: "variable",
561
+ match: /\$\d+/
562
+ };
563
+ const PROPERTY_WRAPPER_PROJECTION = {
564
+ className: "variable",
565
+ match: `\\$${identifierCharacter}+`
566
+ };
567
+ const IDENTIFIERS = [
568
+ QUOTED_IDENTIFIER,
569
+ IMPLICIT_PARAMETER,
570
+ PROPERTY_WRAPPER_PROJECTION
571
+ ];
572
+ const AVAILABLE_ATTRIBUTE = {
573
+ match: /(@|#(un)?)available/,
574
+ scope: "keyword",
575
+ starts: { contains: [
576
+ {
577
+ begin: /\(/,
578
+ end: /\)/,
579
+ keywords: availabilityKeywords,
580
+ contains: [
581
+ ...OPERATORS,
582
+ NUMBER,
583
+ STRING
584
+ ]
585
+ }
586
+ ] }
587
+ };
588
+ const KEYWORD_ATTRIBUTE = {
589
+ scope: "keyword",
590
+ match: concat(/@/, either(...keywordAttributes), lookahead(either(/\(/, /\s+/)))
591
+ };
592
+ const USER_DEFINED_ATTRIBUTE = {
593
+ scope: "meta",
594
+ match: concat(/@/, identifier)
595
+ };
596
+ const ATTRIBUTES = [
597
+ AVAILABLE_ATTRIBUTE,
598
+ KEYWORD_ATTRIBUTE,
599
+ USER_DEFINED_ATTRIBUTE
600
+ ];
601
+ const TYPE = {
602
+ match: lookahead(/\b[A-Z]/),
603
+ relevance: 0,
604
+ contains: [
605
+ {
606
+ // Common Apple frameworks, for relevance boost
607
+ className: "type",
608
+ match: concat(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/, identifierCharacter, "+")
609
+ },
610
+ {
611
+ // Type identifier
612
+ className: "type",
613
+ match: typeIdentifier,
614
+ relevance: 0
615
+ },
616
+ {
617
+ // Optional type
618
+ match: /[?!]+/,
619
+ relevance: 0
620
+ },
621
+ {
622
+ // Variadic parameter
623
+ match: /\.\.\./,
624
+ relevance: 0
625
+ },
626
+ {
627
+ // Protocol composition
628
+ match: concat(/\s+&\s+/, lookahead(typeIdentifier)),
629
+ relevance: 0
630
+ }
631
+ ]
632
+ };
633
+ const GENERIC_ARGUMENTS = {
634
+ begin: /</,
635
+ end: />/,
636
+ keywords: KEYWORDS,
637
+ contains: [
638
+ ...COMMENTS,
639
+ ...KEYWORD_MODES,
640
+ ...ATTRIBUTES,
641
+ OPERATOR_GUARD,
642
+ TYPE
643
+ ]
644
+ };
645
+ TYPE.contains.push(GENERIC_ARGUMENTS);
646
+ const TUPLE_ELEMENT_NAME = {
647
+ match: concat(identifier, /\s*:/),
648
+ keywords: "_|0",
649
+ relevance: 0
650
+ };
651
+ const TUPLE = {
652
+ begin: /\(/,
653
+ end: /\)/,
654
+ relevance: 0,
655
+ keywords: KEYWORDS,
656
+ contains: [
657
+ "self",
658
+ TUPLE_ELEMENT_NAME,
659
+ ...COMMENTS,
660
+ REGEXP,
661
+ ...KEYWORD_MODES,
662
+ ...BUILT_INS,
663
+ ...OPERATORS,
664
+ NUMBER,
665
+ STRING,
666
+ ...IDENTIFIERS,
667
+ ...ATTRIBUTES,
668
+ TYPE
669
+ ]
670
+ };
671
+ const GENERIC_PARAMETERS = {
672
+ begin: /</,
673
+ end: />/,
674
+ keywords: "repeat each",
675
+ contains: [
676
+ ...COMMENTS,
677
+ TYPE
678
+ ]
679
+ };
680
+ const FUNCTION_PARAMETER_NAME = {
681
+ begin: either(
682
+ lookahead(concat(identifier, /\s*:/)),
683
+ lookahead(concat(identifier, /\s+/, identifier, /\s*:/))
684
+ ),
685
+ end: /:/,
686
+ relevance: 0,
687
+ contains: [
688
+ {
689
+ className: "keyword",
690
+ match: /\b_\b/
691
+ },
692
+ {
693
+ className: "params",
694
+ match: identifier
695
+ }
696
+ ]
697
+ };
698
+ const FUNCTION_PARAMETERS = {
699
+ begin: /\(/,
700
+ end: /\)/,
701
+ keywords: KEYWORDS,
702
+ contains: [
703
+ FUNCTION_PARAMETER_NAME,
704
+ ...COMMENTS,
705
+ ...KEYWORD_MODES,
706
+ ...OPERATORS,
707
+ NUMBER,
708
+ STRING,
709
+ ...ATTRIBUTES,
710
+ TYPE,
711
+ TUPLE
712
+ ],
713
+ endsParent: true,
714
+ illegal: /["']/
715
+ };
716
+ const FUNCTION_OR_MACRO = {
717
+ match: [
718
+ /(func|macro)/,
719
+ /\s+/,
720
+ either(QUOTED_IDENTIFIER.match, identifier, operator)
721
+ ],
722
+ className: {
723
+ 1: "keyword",
724
+ 3: "title.function"
725
+ },
726
+ contains: [
727
+ GENERIC_PARAMETERS,
728
+ FUNCTION_PARAMETERS,
729
+ WHITESPACE
730
+ ],
731
+ illegal: [
732
+ /\[/,
733
+ /%/
734
+ ]
735
+ };
736
+ const INIT_SUBSCRIPT = {
737
+ match: [
738
+ /\b(?:subscript|init[?!]?)/,
739
+ /\s*(?=[<(])/
740
+ ],
741
+ className: { 1: "keyword" },
742
+ contains: [
743
+ GENERIC_PARAMETERS,
744
+ FUNCTION_PARAMETERS,
745
+ WHITESPACE
746
+ ],
747
+ illegal: /\[|%/
748
+ };
749
+ const OPERATOR_DECLARATION = {
750
+ match: [
751
+ /operator/,
752
+ /\s+/,
753
+ operator
754
+ ],
755
+ className: {
756
+ 1: "keyword",
757
+ 3: "title"
758
+ }
759
+ };
760
+ const PRECEDENCEGROUP = {
761
+ begin: [
762
+ /precedencegroup/,
763
+ /\s+/,
764
+ typeIdentifier
765
+ ],
766
+ className: {
767
+ 1: "keyword",
768
+ 3: "title"
769
+ },
770
+ contains: [TYPE],
771
+ keywords: [
772
+ ...precedencegroupKeywords,
773
+ ...literals
774
+ ],
775
+ end: /}/
776
+ };
777
+ const CLASS_FUNC_DECLARATION = {
778
+ match: [
779
+ /class\b/,
780
+ /\s+/,
781
+ /func\b/,
782
+ /\s+/,
783
+ /\b[A-Za-z_][A-Za-z0-9_]*\b/
784
+ ],
785
+ scope: {
786
+ 1: "keyword",
787
+ 3: "keyword",
788
+ 5: "title.function"
789
+ }
790
+ };
791
+ const CLASS_VAR_DECLARATION = {
792
+ match: [
793
+ /class\b/,
794
+ /\s+/,
795
+ /var\b/
796
+ ],
797
+ scope: {
798
+ 1: "keyword",
799
+ 3: "keyword"
800
+ }
801
+ };
802
+ const TYPE_DECLARATION = {
803
+ begin: [
804
+ /(struct|protocol|class|extension|enum|actor)/,
805
+ /\s+/,
806
+ identifier,
807
+ /\s*/
808
+ ],
809
+ beginScope: {
810
+ 1: "keyword",
811
+ 3: "title.class"
812
+ },
813
+ keywords: KEYWORDS,
814
+ contains: [
815
+ GENERIC_PARAMETERS,
816
+ ...KEYWORD_MODES,
817
+ {
818
+ begin: /:/,
819
+ end: /\{/,
820
+ keywords: KEYWORDS,
821
+ contains: [
822
+ {
823
+ scope: "title.class.inherited",
824
+ match: typeIdentifier
825
+ },
826
+ ...KEYWORD_MODES
827
+ ],
828
+ relevance: 0
829
+ }
830
+ ]
831
+ };
832
+ for (const variant of STRING.variants) {
833
+ const interpolation = variant.contains.find((mode) => mode.label === "interpol");
834
+ interpolation.keywords = KEYWORDS;
835
+ const submodes = [
836
+ ...KEYWORD_MODES,
837
+ ...BUILT_INS,
838
+ ...OPERATORS,
839
+ NUMBER,
840
+ STRING,
841
+ ...IDENTIFIERS
842
+ ];
843
+ interpolation.contains = [
844
+ ...submodes,
845
+ {
846
+ begin: /\(/,
847
+ end: /\)/,
848
+ contains: [
849
+ "self",
850
+ ...submodes
851
+ ]
852
+ }
853
+ ];
854
+ }
855
+ return {
856
+ name: "Swift",
857
+ keywords: KEYWORDS,
858
+ contains: [
859
+ ...COMMENTS,
860
+ FUNCTION_OR_MACRO,
861
+ INIT_SUBSCRIPT,
862
+ CLASS_FUNC_DECLARATION,
863
+ CLASS_VAR_DECLARATION,
864
+ TYPE_DECLARATION,
865
+ OPERATOR_DECLARATION,
866
+ PRECEDENCEGROUP,
867
+ {
868
+ beginKeywords: "import",
869
+ end: /$/,
870
+ contains: [...COMMENTS],
871
+ relevance: 0
872
+ },
873
+ REGEXP,
874
+ ...KEYWORD_MODES,
875
+ ...BUILT_INS,
876
+ ...OPERATORS,
877
+ NUMBER,
878
+ STRING,
879
+ ...IDENTIFIERS,
880
+ ...ATTRIBUTES,
881
+ TYPE,
882
+ TUPLE
883
+ ]
884
+ };
885
+ }
886
+ __name(swift, "swift");
887
+ swift_1 = swift;
888
+ return swift_1;
889
+ }
890
+ __name(requireSwift, "requireSwift");
891
+ export {
892
+ requireSwift as __require
893
+ };