sherick-ui 1.0.3 → 1.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.esm.js CHANGED
@@ -1,16 +1,17 @@
1
+ import { __rest } from 'tslib';
2
+ import React, { useState, useEffect, useRef, useId } from 'react';
1
3
  import { clsx } from 'clsx';
2
4
  import { twMerge } from 'tailwind-merge';
3
- import React$1, { useState, useEffect, useRef, useId } from 'react';
4
5
  import { cva } from 'class-variance-authority';
5
6
  import { Loader2, ChevronDown, Search as Search$1, X, Check, Copy, Info, XCircle, AlertCircle, CheckCircle } from 'lucide-react';
6
- import require$$2 from 'react/jsx-runtime';
7
- import require$$4, { createPortal } from 'react-dom';
7
+ import NextImage from 'next/image';
8
+ import { createPortal } from 'react-dom';
8
9
  import ReactMarkdown from 'react-markdown';
9
10
  import remarkGfm from 'remark-gfm';
10
11
  import rehypeKatex from 'rehype-katex';
11
12
  import remarkMath from 'remark-math';
12
13
  import { Highlight } from 'prism-react-renderer';
13
- import Prism$1 from 'prismjs';
14
+ import Prism from 'prismjs';
14
15
 
15
16
  function _extends() {
16
17
  return _extends = Object.assign ? Object.assign.bind() : function (n) {
@@ -22,40 +23,6 @@ function _extends() {
22
23
  }, _extends.apply(null, arguments);
23
24
  }
24
25
 
25
- /******************************************************************************
26
- Copyright (c) Microsoft Corporation.
27
-
28
- Permission to use, copy, modify, and/or distribute this software for any
29
- purpose with or without fee is hereby granted.
30
-
31
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
32
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
33
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
34
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
35
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
36
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
37
- PERFORMANCE OF THIS SOFTWARE.
38
- ***************************************************************************** */
39
- /* global Reflect, Promise, SuppressedError, Symbol, Iterator */
40
-
41
-
42
- function __rest(s, e) {
43
- var t = {};
44
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
45
- t[p] = s[p];
46
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
47
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
48
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
49
- t[p[i]] = s[p[i]];
50
- }
51
- return t;
52
- }
53
-
54
- typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
55
- var e = new Error(message);
56
- return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
57
- };
58
-
59
26
  var cn = function cn() {
60
27
  var inputs = [];
61
28
  for (var _i = 0; _i < arguments.length; _i++) {
@@ -114,11 +81,11 @@ function Spinner(_a) {
114
81
  show = _a.show,
115
82
  children = _a.children,
116
83
  className = _a.className;
117
- return /*#__PURE__*/React$1.createElement("span", {
84
+ return /*#__PURE__*/React.createElement("span", {
118
85
  className: spinnerVariants({
119
86
  show: show
120
87
  })
121
- }, /*#__PURE__*/React$1.createElement(Loader2, {
88
+ }, /*#__PURE__*/React.createElement(Loader2, {
122
89
  className: cn(loaderVariants({
123
90
  size: size
124
91
  }), className)
@@ -286,1622 +253,6 @@ var Input = function Input(_a) {
286
253
  }));
287
254
  };
288
255
 
289
- function getDefaultExportFromCjs (x) {
290
- return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
291
- }
292
-
293
- var imageExternal = {};
294
-
295
- var _interop_require_default = {};
296
-
297
- var hasRequired_interop_require_default;
298
-
299
- function require_interop_require_default () {
300
- if (hasRequired_interop_require_default) return _interop_require_default;
301
- hasRequired_interop_require_default = 1;
302
-
303
- _interop_require_default._ = _interop_require_default._interop_require_default = _interop_require_default$1;
304
- function _interop_require_default$1(obj) {
305
- return obj && obj.__esModule ? obj : { default: obj };
306
- }
307
- return _interop_require_default;
308
- }
309
-
310
- var getImgProps = {};
311
-
312
- var warnOnce = {};
313
-
314
- var hasRequiredWarnOnce;
315
-
316
- function requireWarnOnce () {
317
- if (hasRequiredWarnOnce) return warnOnce;
318
- hasRequiredWarnOnce = 1;
319
- (function (exports) {
320
- Object.defineProperty(exports, "__esModule", {
321
- value: true
322
- });
323
- Object.defineProperty(exports, "warnOnce", {
324
- enumerable: true,
325
- get: function() {
326
- return warnOnce;
327
- }
328
- });
329
- let warnOnce = (_)=>{};
330
- if (process.env.NODE_ENV !== "production") {
331
- const warnings = new Set();
332
- warnOnce = (msg)=>{
333
- if (!warnings.has(msg)) {
334
- console.warn(msg);
335
- }
336
- warnings.add(msg);
337
- };
338
- }
339
-
340
-
341
- } (warnOnce));
342
- return warnOnce;
343
- }
344
-
345
- var imageBlurSvg = {};
346
-
347
- /**
348
- * A shared function, used on both client and server, to generate a SVG blur placeholder.
349
- */
350
-
351
- var hasRequiredImageBlurSvg;
352
-
353
- function requireImageBlurSvg () {
354
- if (hasRequiredImageBlurSvg) return imageBlurSvg;
355
- hasRequiredImageBlurSvg = 1;
356
- (function (exports) {
357
- Object.defineProperty(exports, "__esModule", {
358
- value: true
359
- });
360
- Object.defineProperty(exports, "getImageBlurSvg", {
361
- enumerable: true,
362
- get: function() {
363
- return getImageBlurSvg;
364
- }
365
- });
366
- function getImageBlurSvg(param) {
367
- let { widthInt, heightInt, blurWidth, blurHeight, blurDataURL, objectFit } = param;
368
- const std = 20;
369
- const svgWidth = blurWidth ? blurWidth * 40 : widthInt;
370
- const svgHeight = blurHeight ? blurHeight * 40 : heightInt;
371
- const viewBox = svgWidth && svgHeight ? "viewBox='0 0 " + svgWidth + " " + svgHeight + "'" : "";
372
- const preserveAspectRatio = viewBox ? "none" : objectFit === "contain" ? "xMidYMid" : objectFit === "cover" ? "xMidYMid slice" : "none";
373
- return "%3Csvg xmlns='http://www.w3.org/2000/svg' " + viewBox + "%3E%3Cfilter id='b' color-interpolation-filters='sRGB'%3E%3CfeGaussianBlur stdDeviation='" + std + "'/%3E%3CfeColorMatrix values='1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 100 -1' result='s'/%3E%3CfeFlood x='0' y='0' width='100%25' height='100%25'/%3E%3CfeComposite operator='out' in='s'/%3E%3CfeComposite in2='SourceGraphic'/%3E%3CfeGaussianBlur stdDeviation='" + std + "'/%3E%3C/filter%3E%3Cimage width='100%25' height='100%25' x='0' y='0' preserveAspectRatio='" + preserveAspectRatio + "' style='filter: url(%23b);' href='" + blurDataURL + "'/%3E%3C/svg%3E";
374
- }
375
-
376
-
377
- } (imageBlurSvg));
378
- return imageBlurSvg;
379
- }
380
-
381
- var imageConfig = {};
382
-
383
- var hasRequiredImageConfig;
384
-
385
- function requireImageConfig () {
386
- if (hasRequiredImageConfig) return imageConfig;
387
- hasRequiredImageConfig = 1;
388
- (function (exports) {
389
- Object.defineProperty(exports, "__esModule", {
390
- value: true
391
- });
392
- function _export(target, all) {
393
- for(var name in all)Object.defineProperty(target, name, {
394
- enumerable: true,
395
- get: all[name]
396
- });
397
- }
398
- _export(exports, {
399
- VALID_LOADERS: function() {
400
- return VALID_LOADERS;
401
- },
402
- imageConfigDefault: function() {
403
- return imageConfigDefault;
404
- }
405
- });
406
- const VALID_LOADERS = [
407
- "default",
408
- "imgix",
409
- "cloudinary",
410
- "akamai",
411
- "custom"
412
- ];
413
- const imageConfigDefault = {
414
- deviceSizes: [
415
- 640,
416
- 750,
417
- 828,
418
- 1080,
419
- 1200,
420
- 1920,
421
- 2048,
422
- 3840
423
- ],
424
- imageSizes: [
425
- 16,
426
- 32,
427
- 48,
428
- 64,
429
- 96,
430
- 128,
431
- 256,
432
- 384
433
- ],
434
- path: "/_next/image",
435
- loader: "default",
436
- loaderFile: "",
437
- domains: [],
438
- disableStaticImages: false,
439
- minimumCacheTTL: 60,
440
- formats: [
441
- "image/webp"
442
- ],
443
- dangerouslyAllowSVG: false,
444
- contentSecurityPolicy: "script-src 'none'; frame-src 'none'; sandbox;",
445
- contentDispositionType: "inline",
446
- remotePatterns: [],
447
- unoptimized: false
448
- };
449
-
450
-
451
- } (imageConfig));
452
- return imageConfig;
453
- }
454
-
455
- var hasRequiredGetImgProps;
456
-
457
- function requireGetImgProps () {
458
- if (hasRequiredGetImgProps) return getImgProps;
459
- hasRequiredGetImgProps = 1;
460
- (function (exports) {
461
- Object.defineProperty(exports, "__esModule", {
462
- value: true
463
- });
464
- Object.defineProperty(exports, "getImgProps", {
465
- enumerable: true,
466
- get: function() {
467
- return getImgProps;
468
- }
469
- });
470
- const _warnonce = requireWarnOnce();
471
- const _imageblursvg = requireImageBlurSvg();
472
- const _imageconfig = requireImageConfig();
473
- const VALID_LOADING_VALUES = [
474
- "lazy",
475
- "eager",
476
- undefined
477
- ];
478
- function isStaticRequire(src) {
479
- return src.default !== undefined;
480
- }
481
- function isStaticImageData(src) {
482
- return src.src !== undefined;
483
- }
484
- function isStaticImport(src) {
485
- return typeof src === "object" && (isStaticRequire(src) || isStaticImageData(src));
486
- }
487
- const allImgs = new Map();
488
- let perfObserver;
489
- function getInt(x) {
490
- if (typeof x === "undefined") {
491
- return x;
492
- }
493
- if (typeof x === "number") {
494
- return Number.isFinite(x) ? x : NaN;
495
- }
496
- if (typeof x === "string" && /^[0-9]+$/.test(x)) {
497
- return parseInt(x, 10);
498
- }
499
- return NaN;
500
- }
501
- function getWidths(param, width, sizes) {
502
- let { deviceSizes, allSizes } = param;
503
- if (sizes) {
504
- // Find all the "vw" percent sizes used in the sizes prop
505
- const viewportWidthRe = /(^|\s)(1?\d?\d)vw/g;
506
- const percentSizes = [];
507
- for(let match; match = viewportWidthRe.exec(sizes); match){
508
- percentSizes.push(parseInt(match[2]));
509
- }
510
- if (percentSizes.length) {
511
- const smallestRatio = Math.min(...percentSizes) * 0.01;
512
- return {
513
- widths: allSizes.filter((s)=>s >= deviceSizes[0] * smallestRatio),
514
- kind: "w"
515
- };
516
- }
517
- return {
518
- widths: allSizes,
519
- kind: "w"
520
- };
521
- }
522
- if (typeof width !== "number") {
523
- return {
524
- widths: deviceSizes,
525
- kind: "w"
526
- };
527
- }
528
- const widths = [
529
- ...new Set(// > This means that most OLED screens that say they are 3x resolution,
530
- // > are actually 3x in the green color, but only 1.5x in the red and
531
- // > blue colors. Showing a 3x resolution image in the app vs a 2x
532
- // > resolution image will be visually the same, though the 3x image
533
- // > takes significantly more data. Even true 3x resolution screens are
534
- // > wasteful as the human eye cannot see that level of detail without
535
- // > something like a magnifying glass.
536
- // https://blog.twitter.com/engineering/en_us/topics/infrastructure/2019/capping-image-fidelity-on-ultra-high-resolution-devices.html
537
- [
538
- width,
539
- width * 2 /*, width * 3*/
540
- ].map((w)=>allSizes.find((p)=>p >= w) || allSizes[allSizes.length - 1]))
541
- ];
542
- return {
543
- widths,
544
- kind: "x"
545
- };
546
- }
547
- function generateImgAttrs(param) {
548
- let { config, src, unoptimized, width, quality, sizes, loader } = param;
549
- if (unoptimized) {
550
- return {
551
- src,
552
- srcSet: undefined,
553
- sizes: undefined
554
- };
555
- }
556
- const { widths, kind } = getWidths(config, width, sizes);
557
- const last = widths.length - 1;
558
- return {
559
- sizes: !sizes && kind === "w" ? "100vw" : sizes,
560
- srcSet: widths.map((w, i)=>loader({
561
- config,
562
- src,
563
- quality,
564
- width: w
565
- }) + " " + (kind === "w" ? w : i + 1) + kind).join(", "),
566
- // It's intended to keep `src` the last attribute because React updates
567
- // attributes in order. If we keep `src` the first one, Safari will
568
- // immediately start to fetch `src`, before `sizes` and `srcSet` are even
569
- // updated by React. That causes multiple unnecessary requests if `srcSet`
570
- // and `sizes` are defined.
571
- // This bug cannot be reproduced in Chrome or Firefox.
572
- src: loader({
573
- config,
574
- src,
575
- quality,
576
- width: widths[last]
577
- })
578
- };
579
- }
580
- function getImgProps(param, _state) {
581
- let { src, sizes, unoptimized = false, priority = false, loading, className, quality, width, height, fill = false, style, overrideSrc, onLoad, onLoadingComplete, placeholder = "empty", blurDataURL, fetchPriority, layout, objectFit, objectPosition, lazyBoundary, lazyRoot, ...rest } = param;
582
- const { imgConf, showAltText, blurComplete, defaultLoader } = _state;
583
- let config;
584
- let c = imgConf || _imageconfig.imageConfigDefault;
585
- if ("allSizes" in c) {
586
- config = c;
587
- } else {
588
- const allSizes = [
589
- ...c.deviceSizes,
590
- ...c.imageSizes
591
- ].sort((a, b)=>a - b);
592
- const deviceSizes = c.deviceSizes.sort((a, b)=>a - b);
593
- config = {
594
- ...c,
595
- allSizes,
596
- deviceSizes
597
- };
598
- }
599
- if (typeof defaultLoader === "undefined") {
600
- throw new Error("images.loaderFile detected but the file is missing default export.\nRead more: https://nextjs.org/docs/messages/invalid-images-config");
601
- }
602
- let loader = rest.loader || defaultLoader;
603
- // Remove property so it's not spread on <img> element
604
- delete rest.loader;
605
- delete rest.srcSet;
606
- // This special value indicates that the user
607
- // didn't define a "loader" prop or "loader" config.
608
- const isDefaultLoader = "__next_img_default" in loader;
609
- if (isDefaultLoader) {
610
- if (config.loader === "custom") {
611
- throw new Error('Image with src "' + src + '" is missing "loader" prop.' + "\nRead more: https://nextjs.org/docs/messages/next-image-missing-loader");
612
- }
613
- } else {
614
- // The user defined a "loader" prop or config.
615
- // Since the config object is internal only, we
616
- // must not pass it to the user-defined "loader".
617
- const customImageLoader = loader;
618
- loader = (obj)=>{
619
- const { config: _, ...opts } = obj;
620
- return customImageLoader(opts);
621
- };
622
- }
623
- if (layout) {
624
- if (layout === "fill") {
625
- fill = true;
626
- }
627
- const layoutToStyle = {
628
- intrinsic: {
629
- maxWidth: "100%",
630
- height: "auto"
631
- },
632
- responsive: {
633
- width: "100%",
634
- height: "auto"
635
- }
636
- };
637
- const layoutToSizes = {
638
- responsive: "100vw",
639
- fill: "100vw"
640
- };
641
- const layoutStyle = layoutToStyle[layout];
642
- if (layoutStyle) {
643
- style = {
644
- ...style,
645
- ...layoutStyle
646
- };
647
- }
648
- const layoutSizes = layoutToSizes[layout];
649
- if (layoutSizes && !sizes) {
650
- sizes = layoutSizes;
651
- }
652
- }
653
- let staticSrc = "";
654
- let widthInt = getInt(width);
655
- let heightInt = getInt(height);
656
- let blurWidth;
657
- let blurHeight;
658
- if (isStaticImport(src)) {
659
- const staticImageData = isStaticRequire(src) ? src.default : src;
660
- if (!staticImageData.src) {
661
- throw new Error("An object should only be passed to the image component src parameter if it comes from a static image import. It must include src. Received " + JSON.stringify(staticImageData));
662
- }
663
- if (!staticImageData.height || !staticImageData.width) {
664
- throw new Error("An object should only be passed to the image component src parameter if it comes from a static image import. It must include height and width. Received " + JSON.stringify(staticImageData));
665
- }
666
- blurWidth = staticImageData.blurWidth;
667
- blurHeight = staticImageData.blurHeight;
668
- blurDataURL = blurDataURL || staticImageData.blurDataURL;
669
- staticSrc = staticImageData.src;
670
- if (!fill) {
671
- if (!widthInt && !heightInt) {
672
- widthInt = staticImageData.width;
673
- heightInt = staticImageData.height;
674
- } else if (widthInt && !heightInt) {
675
- const ratio = widthInt / staticImageData.width;
676
- heightInt = Math.round(staticImageData.height * ratio);
677
- } else if (!widthInt && heightInt) {
678
- const ratio = heightInt / staticImageData.height;
679
- widthInt = Math.round(staticImageData.width * ratio);
680
- }
681
- }
682
- }
683
- src = typeof src === "string" ? src : staticSrc;
684
- let isLazy = !priority && (loading === "lazy" || typeof loading === "undefined");
685
- if (!src || src.startsWith("data:") || src.startsWith("blob:")) {
686
- // https://developer.mozilla.org/docs/Web/HTTP/Basics_of_HTTP/Data_URIs
687
- unoptimized = true;
688
- isLazy = false;
689
- }
690
- if (config.unoptimized) {
691
- unoptimized = true;
692
- }
693
- if (isDefaultLoader && src.endsWith(".svg") && !config.dangerouslyAllowSVG) {
694
- // Special case to make svg serve as-is to avoid proxying
695
- // through the built-in Image Optimization API.
696
- unoptimized = true;
697
- }
698
- if (priority) {
699
- fetchPriority = "high";
700
- }
701
- const qualityInt = getInt(quality);
702
- if (process.env.NODE_ENV !== "production") {
703
- if (config.output === "export" && isDefaultLoader && !unoptimized) {
704
- throw new Error("Image Optimization using the default loader is not compatible with `{ output: 'export' }`.\n Possible solutions:\n - Remove `{ output: 'export' }` and run \"next start\" to run server mode including the Image Optimization API.\n - Configure `{ images: { unoptimized: true } }` in `next.config.js` to disable the Image Optimization API.\n Read more: https://nextjs.org/docs/messages/export-image-api");
705
- }
706
- if (!src) {
707
- // React doesn't show the stack trace and there's
708
- // no `src` to help identify which image, so we
709
- // instead console.error(ref) during mount.
710
- unoptimized = true;
711
- } else {
712
- if (fill) {
713
- if (width) {
714
- throw new Error('Image with src "' + src + '" has both "width" and "fill" properties. Only one should be used.');
715
- }
716
- if (height) {
717
- throw new Error('Image with src "' + src + '" has both "height" and "fill" properties. Only one should be used.');
718
- }
719
- if ((style == null ? void 0 : style.position) && style.position !== "absolute") {
720
- throw new Error('Image with src "' + src + '" has both "fill" and "style.position" properties. Images with "fill" always use position absolute - it cannot be modified.');
721
- }
722
- if ((style == null ? void 0 : style.width) && style.width !== "100%") {
723
- throw new Error('Image with src "' + src + '" has both "fill" and "style.width" properties. Images with "fill" always use width 100% - it cannot be modified.');
724
- }
725
- if ((style == null ? void 0 : style.height) && style.height !== "100%") {
726
- throw new Error('Image with src "' + src + '" has both "fill" and "style.height" properties. Images with "fill" always use height 100% - it cannot be modified.');
727
- }
728
- } else {
729
- if (typeof widthInt === "undefined") {
730
- throw new Error('Image with src "' + src + '" is missing required "width" property.');
731
- } else if (isNaN(widthInt)) {
732
- throw new Error('Image with src "' + src + '" has invalid "width" property. Expected a numeric value in pixels but received "' + width + '".');
733
- }
734
- if (typeof heightInt === "undefined") {
735
- throw new Error('Image with src "' + src + '" is missing required "height" property.');
736
- } else if (isNaN(heightInt)) {
737
- throw new Error('Image with src "' + src + '" has invalid "height" property. Expected a numeric value in pixels but received "' + height + '".');
738
- }
739
- }
740
- }
741
- if (!VALID_LOADING_VALUES.includes(loading)) {
742
- throw new Error('Image with src "' + src + '" has invalid "loading" property. Provided "' + loading + '" should be one of ' + VALID_LOADING_VALUES.map(String).join(",") + ".");
743
- }
744
- if (priority && loading === "lazy") {
745
- throw new Error('Image with src "' + src + '" has both "priority" and "loading=\'lazy\'" properties. Only one should be used.');
746
- }
747
- if (placeholder !== "empty" && placeholder !== "blur" && !placeholder.startsWith("data:image/")) {
748
- throw new Error('Image with src "' + src + '" has invalid "placeholder" property "' + placeholder + '".');
749
- }
750
- if (placeholder !== "empty") {
751
- if (widthInt && heightInt && widthInt * heightInt < 1600) {
752
- (0, _warnonce.warnOnce)('Image with src "' + src + '" is smaller than 40x40. Consider removing the "placeholder" property to improve performance.');
753
- }
754
- }
755
- if (placeholder === "blur" && !blurDataURL) {
756
- const VALID_BLUR_EXT = [
757
- "jpeg",
758
- "png",
759
- "webp",
760
- "avif"
761
- ] // should match next-image-loader
762
- ;
763
- throw new Error('Image with src "' + src + '" has "placeholder=\'blur\'" property but is missing the "blurDataURL" property.\n Possible solutions:\n - Add a "blurDataURL" property, the contents should be a small Data URL to represent the image\n - Change the "src" property to a static import with one of the supported file types: ' + VALID_BLUR_EXT.join(",") + ' (animated images not supported)\n - Remove the "placeholder" property, effectively no blur effect\n Read more: https://nextjs.org/docs/messages/placeholder-blur-data-url');
764
- }
765
- if ("ref" in rest) {
766
- (0, _warnonce.warnOnce)('Image with src "' + src + '" is using unsupported "ref" property. Consider using the "onLoad" property instead.');
767
- }
768
- if (!unoptimized && !isDefaultLoader) {
769
- const urlStr = loader({
770
- config,
771
- src,
772
- width: widthInt || 400,
773
- quality: qualityInt || 75
774
- });
775
- let url;
776
- try {
777
- url = new URL(urlStr);
778
- } catch (err) {}
779
- if (urlStr === src || url && url.pathname === src && !url.search) {
780
- (0, _warnonce.warnOnce)('Image with src "' + src + '" has a "loader" property that does not implement width. Please implement it or use the "unoptimized" property instead.' + "\nRead more: https://nextjs.org/docs/messages/next-image-missing-loader-width");
781
- }
782
- }
783
- if (onLoadingComplete) {
784
- (0, _warnonce.warnOnce)('Image with src "' + src + '" is using deprecated "onLoadingComplete" property. Please use the "onLoad" property instead.');
785
- }
786
- for (const [legacyKey, legacyValue] of Object.entries({
787
- layout,
788
- objectFit,
789
- objectPosition,
790
- lazyBoundary,
791
- lazyRoot
792
- })){
793
- if (legacyValue) {
794
- (0, _warnonce.warnOnce)('Image with src "' + src + '" has legacy prop "' + legacyKey + '". Did you forget to run the codemod?' + "\nRead more: https://nextjs.org/docs/messages/next-image-upgrade-to-13");
795
- }
796
- }
797
- if (typeof window !== "undefined" && !perfObserver && window.PerformanceObserver) {
798
- perfObserver = new PerformanceObserver((entryList)=>{
799
- for (const entry of entryList.getEntries()){
800
- var _entry_element;
801
- // @ts-ignore - missing "LargestContentfulPaint" class with "element" prop
802
- const imgSrc = (entry == null ? void 0 : (_entry_element = entry.element) == null ? void 0 : _entry_element.src) || "";
803
- const lcpImage = allImgs.get(imgSrc);
804
- if (lcpImage && !lcpImage.priority && lcpImage.placeholder === "empty" && !lcpImage.src.startsWith("data:") && !lcpImage.src.startsWith("blob:")) {
805
- // https://web.dev/lcp/#measure-lcp-in-javascript
806
- (0, _warnonce.warnOnce)('Image with src "' + lcpImage.src + '" was detected as the Largest Contentful Paint (LCP). Please add the "priority" property if this image is above the fold.' + "\nRead more: https://nextjs.org/docs/api-reference/next/image#priority");
807
- }
808
- }
809
- });
810
- try {
811
- perfObserver.observe({
812
- type: "largest-contentful-paint",
813
- buffered: true
814
- });
815
- } catch (err) {
816
- // Log error but don't crash the app
817
- console.error(err);
818
- }
819
- }
820
- }
821
- const imgStyle = Object.assign(fill ? {
822
- position: "absolute",
823
- height: "100%",
824
- width: "100%",
825
- left: 0,
826
- top: 0,
827
- right: 0,
828
- bottom: 0,
829
- objectFit,
830
- objectPosition
831
- } : {}, showAltText ? {} : {
832
- color: "transparent"
833
- }, style);
834
- const backgroundImage = !blurComplete && placeholder !== "empty" ? placeholder === "blur" ? 'url("data:image/svg+xml;charset=utf-8,' + (0, _imageblursvg.getImageBlurSvg)({
835
- widthInt,
836
- heightInt,
837
- blurWidth,
838
- blurHeight,
839
- blurDataURL: blurDataURL || "",
840
- objectFit: imgStyle.objectFit
841
- }) + '")' : 'url("' + placeholder + '")' // assume `data:image/`
842
- : null;
843
- let placeholderStyle = backgroundImage ? {
844
- backgroundSize: imgStyle.objectFit || "cover",
845
- backgroundPosition: imgStyle.objectPosition || "50% 50%",
846
- backgroundRepeat: "no-repeat",
847
- backgroundImage
848
- } : {};
849
- if (process.env.NODE_ENV === "development") {
850
- if (placeholderStyle.backgroundImage && placeholder === "blur" && (blurDataURL == null ? void 0 : blurDataURL.startsWith("/"))) {
851
- // During `next dev`, we don't want to generate blur placeholders with webpack
852
- // because it can delay starting the dev server. Instead, `next-image-loader.js`
853
- // will inline a special url to lazily generate the blur placeholder at request time.
854
- placeholderStyle.backgroundImage = 'url("' + blurDataURL + '")';
855
- }
856
- }
857
- const imgAttributes = generateImgAttrs({
858
- config,
859
- src,
860
- unoptimized,
861
- width: widthInt,
862
- quality: qualityInt,
863
- sizes,
864
- loader
865
- });
866
- if (process.env.NODE_ENV !== "production") {
867
- if (typeof window !== "undefined") {
868
- let fullUrl;
869
- try {
870
- fullUrl = new URL(imgAttributes.src);
871
- } catch (e) {
872
- fullUrl = new URL(imgAttributes.src, window.location.href);
873
- }
874
- allImgs.set(fullUrl.href, {
875
- src,
876
- priority,
877
- placeholder
878
- });
879
- }
880
- }
881
- const props = {
882
- ...rest,
883
- loading: isLazy ? "lazy" : loading,
884
- fetchPriority,
885
- width: widthInt,
886
- height: heightInt,
887
- decoding: "async",
888
- className,
889
- style: {
890
- ...imgStyle,
891
- ...placeholderStyle
892
- },
893
- sizes: imgAttributes.sizes,
894
- srcSet: imgAttributes.srcSet,
895
- src: overrideSrc || imgAttributes.src
896
- };
897
- const meta = {
898
- unoptimized,
899
- priority,
900
- placeholder,
901
- fill
902
- };
903
- return {
904
- props,
905
- meta
906
- };
907
- }
908
-
909
-
910
- } (getImgProps));
911
- return getImgProps;
912
- }
913
-
914
- var imageComponent = {exports: {}};
915
-
916
- var _interop_require_wildcard = {};
917
-
918
- var hasRequired_interop_require_wildcard;
919
-
920
- function require_interop_require_wildcard () {
921
- if (hasRequired_interop_require_wildcard) return _interop_require_wildcard;
922
- hasRequired_interop_require_wildcard = 1;
923
-
924
- function _getRequireWildcardCache(nodeInterop) {
925
- if (typeof WeakMap !== "function") return null;
926
-
927
- var cacheBabelInterop = new WeakMap();
928
- var cacheNodeInterop = new WeakMap();
929
-
930
- return (_getRequireWildcardCache = function(nodeInterop) {
931
- return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
932
- })(nodeInterop);
933
- }
934
- _interop_require_wildcard._ = _interop_require_wildcard._interop_require_wildcard = _interop_require_wildcard$1;
935
- function _interop_require_wildcard$1(obj, nodeInterop) {
936
- if (!nodeInterop && obj && obj.__esModule) return obj;
937
- if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { default: obj };
938
-
939
- var cache = _getRequireWildcardCache(nodeInterop);
940
-
941
- if (cache && cache.has(obj)) return cache.get(obj);
942
-
943
- var newObj = { __proto__: null };
944
- var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
945
-
946
- for (var key in obj) {
947
- if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
948
- var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
949
- if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc);
950
- else newObj[key] = obj[key];
951
- }
952
- }
953
-
954
- newObj.default = obj;
955
-
956
- if (cache) cache.set(obj, newObj);
957
-
958
- return newObj;
959
- }
960
- return _interop_require_wildcard;
961
- }
962
-
963
- var head = {exports: {}};
964
-
965
- var sideEffect = {};
966
-
967
- var hasRequiredSideEffect;
968
-
969
- function requireSideEffect () {
970
- if (hasRequiredSideEffect) return sideEffect;
971
- hasRequiredSideEffect = 1;
972
- (function (exports) {
973
- Object.defineProperty(exports, "__esModule", {
974
- value: true
975
- });
976
- Object.defineProperty(exports, "default", {
977
- enumerable: true,
978
- get: function() {
979
- return SideEffect;
980
- }
981
- });
982
- const _react = React$1;
983
- const isServer = typeof window === "undefined";
984
- const useClientOnlyLayoutEffect = isServer ? ()=>{} : _react.useLayoutEffect;
985
- const useClientOnlyEffect = isServer ? ()=>{} : _react.useEffect;
986
- function SideEffect(props) {
987
- const { headManager, reduceComponentsToState } = props;
988
- function emitChange() {
989
- if (headManager && headManager.mountedInstances) {
990
- const headElements = _react.Children.toArray(Array.from(headManager.mountedInstances).filter(Boolean));
991
- headManager.updateHead(reduceComponentsToState(headElements, props));
992
- }
993
- }
994
- if (isServer) {
995
- var _headManager_mountedInstances;
996
- headManager == null ? void 0 : (_headManager_mountedInstances = headManager.mountedInstances) == null ? void 0 : _headManager_mountedInstances.add(props.children);
997
- emitChange();
998
- }
999
- useClientOnlyLayoutEffect(()=>{
1000
- var _headManager_mountedInstances;
1001
- headManager == null ? void 0 : (_headManager_mountedInstances = headManager.mountedInstances) == null ? void 0 : _headManager_mountedInstances.add(props.children);
1002
- return ()=>{
1003
- var _headManager_mountedInstances;
1004
- headManager == null ? void 0 : (_headManager_mountedInstances = headManager.mountedInstances) == null ? void 0 : _headManager_mountedInstances.delete(props.children);
1005
- };
1006
- });
1007
- // We need to call `updateHead` method whenever the `SideEffect` is trigger in all
1008
- // life-cycles: mount, update, unmount. However, if there are multiple `SideEffect`s
1009
- // being rendered, we only trigger the method from the last one.
1010
- // This is ensured by keeping the last unflushed `updateHead` in the `_pendingUpdate`
1011
- // singleton in the layout effect pass, and actually trigger it in the effect pass.
1012
- useClientOnlyLayoutEffect(()=>{
1013
- if (headManager) {
1014
- headManager._pendingUpdate = emitChange;
1015
- }
1016
- return ()=>{
1017
- if (headManager) {
1018
- headManager._pendingUpdate = emitChange;
1019
- }
1020
- };
1021
- });
1022
- useClientOnlyEffect(()=>{
1023
- if (headManager && headManager._pendingUpdate) {
1024
- headManager._pendingUpdate();
1025
- headManager._pendingUpdate = null;
1026
- }
1027
- return ()=>{
1028
- if (headManager && headManager._pendingUpdate) {
1029
- headManager._pendingUpdate();
1030
- headManager._pendingUpdate = null;
1031
- }
1032
- };
1033
- });
1034
- return null;
1035
- }
1036
-
1037
-
1038
- } (sideEffect));
1039
- return sideEffect;
1040
- }
1041
-
1042
- var ampContext_sharedRuntime = {};
1043
-
1044
- var hasRequiredAmpContext_sharedRuntime;
1045
-
1046
- function requireAmpContext_sharedRuntime () {
1047
- if (hasRequiredAmpContext_sharedRuntime) return ampContext_sharedRuntime;
1048
- hasRequiredAmpContext_sharedRuntime = 1;
1049
- (function (exports) {
1050
- Object.defineProperty(exports, "__esModule", {
1051
- value: true
1052
- });
1053
- Object.defineProperty(exports, "AmpStateContext", {
1054
- enumerable: true,
1055
- get: function() {
1056
- return AmpStateContext;
1057
- }
1058
- });
1059
- const _interop_require_default = /*@__PURE__*/ require_interop_require_default();
1060
- const _react = /*#__PURE__*/ _interop_require_default._(React$1);
1061
- const AmpStateContext = _react.default.createContext({});
1062
- if (process.env.NODE_ENV !== "production") {
1063
- AmpStateContext.displayName = "AmpStateContext";
1064
- }
1065
-
1066
-
1067
- } (ampContext_sharedRuntime));
1068
- return ampContext_sharedRuntime;
1069
- }
1070
-
1071
- var headManagerContext_sharedRuntime = {};
1072
-
1073
- var hasRequiredHeadManagerContext_sharedRuntime;
1074
-
1075
- function requireHeadManagerContext_sharedRuntime () {
1076
- if (hasRequiredHeadManagerContext_sharedRuntime) return headManagerContext_sharedRuntime;
1077
- hasRequiredHeadManagerContext_sharedRuntime = 1;
1078
- (function (exports) {
1079
- Object.defineProperty(exports, "__esModule", {
1080
- value: true
1081
- });
1082
- Object.defineProperty(exports, "HeadManagerContext", {
1083
- enumerable: true,
1084
- get: function() {
1085
- return HeadManagerContext;
1086
- }
1087
- });
1088
- const _interop_require_default = /*@__PURE__*/ require_interop_require_default();
1089
- const _react = /*#__PURE__*/ _interop_require_default._(React$1);
1090
- const HeadManagerContext = _react.default.createContext({});
1091
- if (process.env.NODE_ENV !== "production") {
1092
- HeadManagerContext.displayName = "HeadManagerContext";
1093
- }
1094
-
1095
-
1096
- } (headManagerContext_sharedRuntime));
1097
- return headManagerContext_sharedRuntime;
1098
- }
1099
-
1100
- var ampMode = {};
1101
-
1102
- var hasRequiredAmpMode;
1103
-
1104
- function requireAmpMode () {
1105
- if (hasRequiredAmpMode) return ampMode;
1106
- hasRequiredAmpMode = 1;
1107
- (function (exports) {
1108
- Object.defineProperty(exports, "__esModule", {
1109
- value: true
1110
- });
1111
- Object.defineProperty(exports, "isInAmpMode", {
1112
- enumerable: true,
1113
- get: function() {
1114
- return isInAmpMode;
1115
- }
1116
- });
1117
- function isInAmpMode(param) {
1118
- let { ampFirst = false, hybrid = false, hasQuery = false } = param === void 0 ? {} : param;
1119
- return ampFirst || hybrid && hasQuery;
1120
- }
1121
-
1122
-
1123
- } (ampMode));
1124
- return ampMode;
1125
- }
1126
-
1127
- var hasRequiredHead;
1128
-
1129
- function requireHead () {
1130
- if (hasRequiredHead) return head.exports;
1131
- hasRequiredHead = 1;
1132
- (function (module, exports) {
1133
- "use client";
1134
- Object.defineProperty(exports, "__esModule", {
1135
- value: true
1136
- });
1137
- function _export(target, all) {
1138
- for(var name in all)Object.defineProperty(target, name, {
1139
- enumerable: true,
1140
- get: all[name]
1141
- });
1142
- }
1143
- _export(exports, {
1144
- default: function() {
1145
- return _default;
1146
- },
1147
- defaultHead: function() {
1148
- return defaultHead;
1149
- }
1150
- });
1151
- const _interop_require_default = /*@__PURE__*/ require_interop_require_default();
1152
- const _interop_require_wildcard = /*@__PURE__*/ require_interop_require_wildcard();
1153
- const _jsxruntime = require$$2;
1154
- const _react = /*#__PURE__*/ _interop_require_wildcard._(React$1);
1155
- const _sideeffect = /*#__PURE__*/ _interop_require_default._(requireSideEffect());
1156
- const _ampcontextsharedruntime = requireAmpContext_sharedRuntime();
1157
- const _headmanagercontextsharedruntime = requireHeadManagerContext_sharedRuntime();
1158
- const _ampmode = requireAmpMode();
1159
- const _warnonce = requireWarnOnce();
1160
- function defaultHead(inAmpMode) {
1161
- if (inAmpMode === void 0) inAmpMode = false;
1162
- const head = [
1163
- /*#__PURE__*/ (0, _jsxruntime.jsx)("meta", {
1164
- charSet: "utf-8"
1165
- })
1166
- ];
1167
- if (!inAmpMode) {
1168
- head.push(/*#__PURE__*/ (0, _jsxruntime.jsx)("meta", {
1169
- name: "viewport",
1170
- content: "width=device-width"
1171
- }));
1172
- }
1173
- return head;
1174
- }
1175
- function onlyReactElement(list, child) {
1176
- // React children can be "string" or "number" in this case we ignore them for backwards compat
1177
- if (typeof child === "string" || typeof child === "number") {
1178
- return list;
1179
- }
1180
- // Adds support for React.Fragment
1181
- if (child.type === _react.default.Fragment) {
1182
- return list.concat(// @ts-expect-error @types/react does not remove fragments but this could also return ReactPortal[]
1183
- _react.default.Children.toArray(child.props.children).reduce(// @ts-expect-error @types/react does not remove fragments but this could also return ReactPortal[]
1184
- (fragmentList, fragmentChild)=>{
1185
- if (typeof fragmentChild === "string" || typeof fragmentChild === "number") {
1186
- return fragmentList;
1187
- }
1188
- return fragmentList.concat(fragmentChild);
1189
- }, []));
1190
- }
1191
- return list.concat(child);
1192
- }
1193
- const METATYPES = [
1194
- "name",
1195
- "httpEquiv",
1196
- "charSet",
1197
- "itemProp"
1198
- ];
1199
- /*
1200
- returns a function for filtering head child elements
1201
- which shouldn't be duplicated, like <title/>
1202
- Also adds support for deduplicated `key` properties
1203
- */ function unique() {
1204
- const keys = new Set();
1205
- const tags = new Set();
1206
- const metaTypes = new Set();
1207
- const metaCategories = {};
1208
- return (h)=>{
1209
- let isUnique = true;
1210
- let hasKey = false;
1211
- if (h.key && typeof h.key !== "number" && h.key.indexOf("$") > 0) {
1212
- hasKey = true;
1213
- const key = h.key.slice(h.key.indexOf("$") + 1);
1214
- if (keys.has(key)) {
1215
- isUnique = false;
1216
- } else {
1217
- keys.add(key);
1218
- }
1219
- }
1220
- // eslint-disable-next-line default-case
1221
- switch(h.type){
1222
- case "title":
1223
- case "base":
1224
- if (tags.has(h.type)) {
1225
- isUnique = false;
1226
- } else {
1227
- tags.add(h.type);
1228
- }
1229
- break;
1230
- case "meta":
1231
- for(let i = 0, len = METATYPES.length; i < len; i++){
1232
- const metatype = METATYPES[i];
1233
- if (!h.props.hasOwnProperty(metatype)) continue;
1234
- if (metatype === "charSet") {
1235
- if (metaTypes.has(metatype)) {
1236
- isUnique = false;
1237
- } else {
1238
- metaTypes.add(metatype);
1239
- }
1240
- } else {
1241
- const category = h.props[metatype];
1242
- const categories = metaCategories[metatype] || new Set();
1243
- if ((metatype !== "name" || !hasKey) && categories.has(category)) {
1244
- isUnique = false;
1245
- } else {
1246
- categories.add(category);
1247
- metaCategories[metatype] = categories;
1248
- }
1249
- }
1250
- }
1251
- break;
1252
- }
1253
- return isUnique;
1254
- };
1255
- }
1256
- /**
1257
- *
1258
- * @param headChildrenElements List of children of <Head>
1259
- */ function reduceComponents(headChildrenElements, props) {
1260
- const { inAmpMode } = props;
1261
- return headChildrenElements.reduce(onlyReactElement, []).reverse().concat(defaultHead(inAmpMode).reverse()).filter(unique()).reverse().map((c, i)=>{
1262
- const key = c.key || i;
1263
- if (process.env.NODE_ENV !== "development" && process.env.__NEXT_OPTIMIZE_FONTS && !inAmpMode) {
1264
- if (c.type === "link" && c.props["href"] && // TODO(prateekbh@): Replace this with const from `constants` when the tree shaking works.
1265
- [
1266
- "https://fonts.googleapis.com/css",
1267
- "https://use.typekit.net/"
1268
- ].some((url)=>c.props["href"].startsWith(url))) {
1269
- const newProps = {
1270
- ...c.props || {}
1271
- };
1272
- newProps["data-href"] = newProps["href"];
1273
- newProps["href"] = undefined;
1274
- // Add this attribute to make it easy to identify optimized tags
1275
- newProps["data-optimized-fonts"] = true;
1276
- return /*#__PURE__*/ _react.default.cloneElement(c, newProps);
1277
- }
1278
- }
1279
- if (process.env.NODE_ENV === "development") {
1280
- // omit JSON-LD structured data snippets from the warning
1281
- if (c.type === "script" && c.props["type"] !== "application/ld+json") {
1282
- const srcMessage = c.props["src"] ? '<script> tag with src="' + c.props["src"] + '"' : "inline <script>";
1283
- (0, _warnonce.warnOnce)("Do not add <script> tags using next/head (see " + srcMessage + "). Use next/script instead. \nSee more info here: https://nextjs.org/docs/messages/no-script-tags-in-head-component");
1284
- } else if (c.type === "link" && c.props["rel"] === "stylesheet") {
1285
- (0, _warnonce.warnOnce)('Do not add stylesheets using next/head (see <link rel="stylesheet"> tag with href="' + c.props["href"] + '"). Use Document instead. \nSee more info here: https://nextjs.org/docs/messages/no-stylesheets-in-head-component');
1286
- }
1287
- }
1288
- return /*#__PURE__*/ _react.default.cloneElement(c, {
1289
- key
1290
- });
1291
- });
1292
- }
1293
- /**
1294
- * This component injects elements to `<head>` of your page.
1295
- * To avoid duplicated `tags` in `<head>` you can use the `key` property, which will make sure every tag is only rendered once.
1296
- */ function Head(param) {
1297
- let { children } = param;
1298
- const ampState = (0, _react.useContext)(_ampcontextsharedruntime.AmpStateContext);
1299
- const headManager = (0, _react.useContext)(_headmanagercontextsharedruntime.HeadManagerContext);
1300
- return /*#__PURE__*/ (0, _jsxruntime.jsx)(_sideeffect.default, {
1301
- reduceComponentsToState: reduceComponents,
1302
- headManager: headManager,
1303
- inAmpMode: (0, _ampmode.isInAmpMode)(ampState),
1304
- children: children
1305
- });
1306
- }
1307
- const _default = Head;
1308
-
1309
- if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
1310
- Object.defineProperty(exports.default, '__esModule', { value: true });
1311
- Object.assign(exports.default, exports);
1312
- module.exports = exports.default;
1313
- }
1314
-
1315
-
1316
- } (head, head.exports));
1317
- return head.exports;
1318
- }
1319
-
1320
- var imageConfigContext_sharedRuntime = {};
1321
-
1322
- var hasRequiredImageConfigContext_sharedRuntime;
1323
-
1324
- function requireImageConfigContext_sharedRuntime () {
1325
- if (hasRequiredImageConfigContext_sharedRuntime) return imageConfigContext_sharedRuntime;
1326
- hasRequiredImageConfigContext_sharedRuntime = 1;
1327
- (function (exports) {
1328
- Object.defineProperty(exports, "__esModule", {
1329
- value: true
1330
- });
1331
- Object.defineProperty(exports, "ImageConfigContext", {
1332
- enumerable: true,
1333
- get: function() {
1334
- return ImageConfigContext;
1335
- }
1336
- });
1337
- const _interop_require_default = /*@__PURE__*/ require_interop_require_default();
1338
- const _react = /*#__PURE__*/ _interop_require_default._(React$1);
1339
- const _imageconfig = requireImageConfig();
1340
- const ImageConfigContext = _react.default.createContext(_imageconfig.imageConfigDefault);
1341
- if (process.env.NODE_ENV !== "production") {
1342
- ImageConfigContext.displayName = "ImageConfigContext";
1343
- }
1344
-
1345
-
1346
- } (imageConfigContext_sharedRuntime));
1347
- return imageConfigContext_sharedRuntime;
1348
- }
1349
-
1350
- var routerContext_sharedRuntime = {};
1351
-
1352
- var hasRequiredRouterContext_sharedRuntime;
1353
-
1354
- function requireRouterContext_sharedRuntime () {
1355
- if (hasRequiredRouterContext_sharedRuntime) return routerContext_sharedRuntime;
1356
- hasRequiredRouterContext_sharedRuntime = 1;
1357
- (function (exports) {
1358
- Object.defineProperty(exports, "__esModule", {
1359
- value: true
1360
- });
1361
- Object.defineProperty(exports, "RouterContext", {
1362
- enumerable: true,
1363
- get: function() {
1364
- return RouterContext;
1365
- }
1366
- });
1367
- const _interop_require_default = /*@__PURE__*/ require_interop_require_default();
1368
- const _react = /*#__PURE__*/ _interop_require_default._(React$1);
1369
- const RouterContext = _react.default.createContext(null);
1370
- if (process.env.NODE_ENV !== "production") {
1371
- RouterContext.displayName = "RouterContext";
1372
- }
1373
-
1374
-
1375
- } (routerContext_sharedRuntime));
1376
- return routerContext_sharedRuntime;
1377
- }
1378
-
1379
- var imageLoader = {};
1380
-
1381
- var matchRemotePattern = {};
1382
-
1383
- var picomatch = {exports: {}};
1384
-
1385
- var hasRequiredPicomatch;
1386
-
1387
- function requirePicomatch () {
1388
- if (hasRequiredPicomatch) return picomatch.exports;
1389
- hasRequiredPicomatch = 1;
1390
- (()=>{var t={170:(t,e,u)=>{const n=u(510);const isWindows=()=>{if(typeof navigator!=="undefined"&&navigator.platform){const t=navigator.platform.toLowerCase();return t==="win32"||t==="windows"}if(typeof process!=="undefined"&&process.platform){return process.platform==="win32"}return false};function picomatch(t,e,u=false){if(e&&(e.windows===null||e.windows===undefined)){e={...e,windows:isWindows()};}return n(t,e,u)}Object.assign(picomatch,n);t.exports=picomatch;},154:t=>{const e="\\\\/";const u=`[^${e}]`;const n="\\.";const o="\\+";const s="\\?";const r="\\/";const a="(?=.)";const i="[^/]";const c=`(?:${r}|$)`;const p=`(?:^|${r})`;const l=`${n}{1,2}${c}`;const f=`(?!${n})`;const A=`(?!${p}${l})`;const _=`(?!${n}{0,1}${c})`;const R=`(?!${l})`;const E=`[^.${r}]`;const h=`${i}*?`;const g="/";const b={DOT_LITERAL:n,PLUS_LITERAL:o,QMARK_LITERAL:s,SLASH_LITERAL:r,ONE_CHAR:a,QMARK:i,END_ANCHOR:c,DOTS_SLASH:l,NO_DOT:f,NO_DOTS:A,NO_DOT_SLASH:_,NO_DOTS_SLASH:R,QMARK_NO_DOT:E,STAR:h,START_ANCHOR:p,SEP:g};const C={...b,SLASH_LITERAL:`[${e}]`,QMARK:u,STAR:`${u}*?`,DOTS_SLASH:`${n}{1,2}(?:[${e}]|$)`,NO_DOT:`(?!${n})`,NO_DOTS:`(?!(?:^|[${e}])${n}{1,2}(?:[${e}]|$))`,NO_DOT_SLASH:`(?!${n}{0,1}(?:[${e}]|$))`,NO_DOTS_SLASH:`(?!${n}{1,2}(?:[${e}]|$))`,QMARK_NO_DOT:`[^.${e}]`,START_ANCHOR:`(?:^|[${e}])`,END_ANCHOR:`(?:[${e}]|$)`,SEP:"\\"};const y={alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};t.exports={MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:y,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars(t){return {"!":{type:"negate",open:"(?:(?!(?:",close:`))${t.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(t){return t===true?C:b}};},697:(t,e,u)=>{const n=u(154);const o=u(96);const{MAX_LENGTH:s,POSIX_REGEX_SOURCE:r,REGEX_NON_SPECIAL_CHARS:a,REGEX_SPECIAL_CHARS_BACKREF:i,REPLACEMENTS:c}=n;const expandRange=(t,e)=>{if(typeof e.expandRange==="function"){return e.expandRange(...t,e)}t.sort();const u=`[${t.join("-")}]`;try{new RegExp(u);}catch(e){return t.map((t=>o.escapeRegex(t))).join("..")}return u};const syntaxError=(t,e)=>`Missing ${t}: "${e}" - use "\\\\${e}" to match literal characters`;const parse=(t,e)=>{if(typeof t!=="string"){throw new TypeError("Expected a string")}t=c[t]||t;const u={...e};const p=typeof u.maxLength==="number"?Math.min(s,u.maxLength):s;let l=t.length;if(l>p){throw new SyntaxError(`Input length: ${l}, exceeds maximum allowed length: ${p}`)}const f={type:"bos",value:"",output:u.prepend||""};const A=[f];const _=u.capture?"":"?:";const R=n.globChars(u.windows);const E=n.extglobChars(R);const{DOT_LITERAL:h,PLUS_LITERAL:g,SLASH_LITERAL:b,ONE_CHAR:C,DOTS_SLASH:y,NO_DOT:$,NO_DOT_SLASH:x,NO_DOTS_SLASH:S,QMARK:H,QMARK_NO_DOT:v,STAR:d,START_ANCHOR:L}=R;const globstar=t=>`(${_}(?:(?!${L}${t.dot?y:h}).)*?)`;const T=u.dot?"":$;const O=u.dot?H:v;let k=u.bash===true?globstar(u):d;if(u.capture){k=`(${k})`;}if(typeof u.noext==="boolean"){u.noextglob=u.noext;}const m={input:t,index:-1,start:0,dot:u.dot===true,consumed:"",output:"",prefix:"",backtrack:false,negated:false,brackets:0,braces:0,parens:0,quotes:0,globstar:false,tokens:A};t=o.removePrefix(t,m);l=t.length;const w=[];const N=[];const I=[];let B=f;let G;const eos=()=>m.index===l-1;const D=m.peek=(e=1)=>t[m.index+e];const M=m.advance=()=>t[++m.index]||"";const remaining=()=>t.slice(m.index+1);const consume=(t="",e=0)=>{m.consumed+=t;m.index+=e;};const append=t=>{m.output+=t.output!=null?t.output:t.value;consume(t.value);};const negate=()=>{let t=1;while(D()==="!"&&(D(2)!=="("||D(3)==="?")){M();m.start++;t++;}if(t%2===0){return false}m.negated=true;m.start++;return true};const increment=t=>{m[t]++;I.push(t);};const decrement=t=>{m[t]--;I.pop();};const push=t=>{if(B.type==="globstar"){const e=m.braces>0&&(t.type==="comma"||t.type==="brace");const u=t.extglob===true||w.length&&(t.type==="pipe"||t.type==="paren");if(t.type!=="slash"&&t.type!=="paren"&&!e&&!u){m.output=m.output.slice(0,-B.output.length);B.type="star";B.value="*";B.output=k;m.output+=B.output;}}if(w.length&&t.type!=="paren"){w[w.length-1].inner+=t.value;}if(t.value||t.output)append(t);if(B&&B.type==="text"&&t.type==="text"){B.output=(B.output||B.value)+t.value;B.value+=t.value;return}t.prev=B;A.push(t);B=t;};const extglobOpen=(t,e)=>{const n={...E[e],conditions:1,inner:""};n.prev=B;n.parens=m.parens;n.output=m.output;const o=(u.capture?"(":"")+n.open;increment("parens");push({type:t,value:e,output:m.output?"":C});push({type:"paren",extglob:true,value:M(),output:o});w.push(n);};const extglobClose=t=>{let n=t.close+(u.capture?")":"");let o;if(t.type==="negate"){let s=k;if(t.inner&&t.inner.length>1&&t.inner.includes("/")){s=globstar(u);}if(s!==k||eos()||/^\)+$/.test(remaining())){n=t.close=`)$))${s}`;}if(t.inner.includes("*")&&(o=remaining())&&/^\.[^\\/.]+$/.test(o)){const u=parse(o,{...e,fastpaths:false}).output;n=t.close=`)${u})${s})`;}if(t.prev.type==="bos"){m.negatedExtglob=true;}}push({type:"paren",extglob:true,value:G,output:n});decrement("parens");};if(u.fastpaths!==false&&!/(^[*!]|[/()[\]{}"])/.test(t)){let n=false;let s=t.replace(i,((t,e,u,o,s,r)=>{if(o==="\\"){n=true;return t}if(o==="?"){if(e){return e+o+(s?H.repeat(s.length):"")}if(r===0){return O+(s?H.repeat(s.length):"")}return H.repeat(u.length)}if(o==="."){return h.repeat(u.length)}if(o==="*"){if(e){return e+o+(s?k:"")}return k}return e?t:`\\${t}`}));if(n===true){if(u.unescape===true){s=s.replace(/\\/g,"");}else {s=s.replace(/\\+/g,(t=>t.length%2===0?"\\\\":t?"\\":""));}}if(s===t&&u.contains===true){m.output=t;return m}m.output=o.wrapOutput(s,m,e);return m}while(!eos()){G=M();if(G==="\0"){continue}if(G==="\\"){const t=D();if(t==="/"&&u.bash!==true){continue}if(t==="."||t===";"){continue}if(!t){G+="\\";push({type:"text",value:G});continue}const e=/^\\+/.exec(remaining());let n=0;if(e&&e[0].length>2){n=e[0].length;m.index+=n;if(n%2!==0){G+="\\";}}if(u.unescape===true){G=M();}else {G+=M();}if(m.brackets===0){push({type:"text",value:G});continue}}if(m.brackets>0&&(G!=="]"||B.value==="["||B.value==="[^")){if(u.posix!==false&&G===":"){const t=B.value.slice(1);if(t.includes("[")){B.posix=true;if(t.includes(":")){const t=B.value.lastIndexOf("[");const e=B.value.slice(0,t);const u=B.value.slice(t+2);const n=r[u];if(n){B.value=e+n;m.backtrack=true;M();if(!f.output&&A.indexOf(B)===1){f.output=C;}continue}}}}if(G==="["&&D()!==":"||G==="-"&&D()==="]"){G=`\\${G}`;}if(G==="]"&&(B.value==="["||B.value==="[^")){G=`\\${G}`;}if(u.posix===true&&G==="!"&&B.value==="["){G="^";}B.value+=G;append({value:G});continue}if(m.quotes===1&&G!=='"'){G=o.escapeRegex(G);B.value+=G;append({value:G});continue}if(G==='"'){m.quotes=m.quotes===1?0:1;if(u.keepQuotes===true){push({type:"text",value:G});}continue}if(G==="("){increment("parens");push({type:"paren",value:G});continue}if(G===")"){if(m.parens===0&&u.strictBrackets===true){throw new SyntaxError(syntaxError("opening","("))}const t=w[w.length-1];if(t&&m.parens===t.parens+1){extglobClose(w.pop());continue}push({type:"paren",value:G,output:m.parens?")":"\\)"});decrement("parens");continue}if(G==="["){if(u.nobracket===true||!remaining().includes("]")){if(u.nobracket!==true&&u.strictBrackets===true){throw new SyntaxError(syntaxError("closing","]"))}G=`\\${G}`;}else {increment("brackets");}push({type:"bracket",value:G});continue}if(G==="]"){if(u.nobracket===true||B&&B.type==="bracket"&&B.value.length===1){push({type:"text",value:G,output:`\\${G}`});continue}if(m.brackets===0){if(u.strictBrackets===true){throw new SyntaxError(syntaxError("opening","["))}push({type:"text",value:G,output:`\\${G}`});continue}decrement("brackets");const t=B.value.slice(1);if(B.posix!==true&&t[0]==="^"&&!t.includes("/")){G=`/${G}`;}B.value+=G;append({value:G});if(u.literalBrackets===false||o.hasRegexChars(t)){continue}const e=o.escapeRegex(B.value);m.output=m.output.slice(0,-B.value.length);if(u.literalBrackets===true){m.output+=e;B.value=e;continue}B.value=`(${_}${e}|${B.value})`;m.output+=B.value;continue}if(G==="{"&&u.nobrace!==true){increment("braces");const t={type:"brace",value:G,output:"(",outputIndex:m.output.length,tokensIndex:m.tokens.length};N.push(t);push(t);continue}if(G==="}"){const t=N[N.length-1];if(u.nobrace===true||!t){push({type:"text",value:G,output:G});continue}let e=")";if(t.dots===true){const t=A.slice();const n=[];for(let e=t.length-1;e>=0;e--){A.pop();if(t[e].type==="brace"){break}if(t[e].type!=="dots"){n.unshift(t[e].value);}}e=expandRange(n,u);m.backtrack=true;}if(t.comma!==true&&t.dots!==true){const u=m.output.slice(0,t.outputIndex);const n=m.tokens.slice(t.tokensIndex);t.value=t.output="\\{";G=e="\\}";m.output=u;for(const t of n){m.output+=t.output||t.value;}}push({type:"brace",value:G,output:e});decrement("braces");N.pop();continue}if(G==="|"){if(w.length>0){w[w.length-1].conditions++;}push({type:"text",value:G});continue}if(G===","){let t=G;const e=N[N.length-1];if(e&&I[I.length-1]==="braces"){e.comma=true;t="|";}push({type:"comma",value:G,output:t});continue}if(G==="/"){if(B.type==="dot"&&m.index===m.start+1){m.start=m.index+1;m.consumed="";m.output="";A.pop();B=f;continue}push({type:"slash",value:G,output:b});continue}if(G==="."){if(m.braces>0&&B.type==="dot"){if(B.value===".")B.output=h;const t=N[N.length-1];B.type="dots";B.output+=G;B.value+=G;t.dots=true;continue}if(m.braces+m.parens===0&&B.type!=="bos"&&B.type!=="slash"){push({type:"text",value:G,output:h});continue}push({type:"dot",value:G,output:h});continue}if(G==="?"){const t=B&&B.value==="(";if(!t&&u.noextglob!==true&&D()==="("&&D(2)!=="?"){extglobOpen("qmark",G);continue}if(B&&B.type==="paren"){const t=D();let e=G;if(B.value==="("&&!/[!=<:]/.test(t)||t==="<"&&!/<([!=]|\w+>)/.test(remaining())){e=`\\${G}`;}push({type:"text",value:G,output:e});continue}if(u.dot!==true&&(B.type==="slash"||B.type==="bos")){push({type:"qmark",value:G,output:v});continue}push({type:"qmark",value:G,output:H});continue}if(G==="!"){if(u.noextglob!==true&&D()==="("){if(D(2)!=="?"||!/[!=<:]/.test(D(3))){extglobOpen("negate",G);continue}}if(u.nonegate!==true&&m.index===0){negate();continue}}if(G==="+"){if(u.noextglob!==true&&D()==="("&&D(2)!=="?"){extglobOpen("plus",G);continue}if(B&&B.value==="("||u.regex===false){push({type:"plus",value:G,output:g});continue}if(B&&(B.type==="bracket"||B.type==="paren"||B.type==="brace")||m.parens>0){push({type:"plus",value:G});continue}push({type:"plus",value:g});continue}if(G==="@"){if(u.noextglob!==true&&D()==="("&&D(2)!=="?"){push({type:"at",extglob:true,value:G,output:""});continue}push({type:"text",value:G});continue}if(G!=="*"){if(G==="$"||G==="^"){G=`\\${G}`;}const t=a.exec(remaining());if(t){G+=t[0];m.index+=t[0].length;}push({type:"text",value:G});continue}if(B&&(B.type==="globstar"||B.star===true)){B.type="star";B.star=true;B.value+=G;B.output=k;m.backtrack=true;m.globstar=true;consume(G);continue}let e=remaining();if(u.noextglob!==true&&/^\([^?]/.test(e)){extglobOpen("star",G);continue}if(B.type==="star"){if(u.noglobstar===true){consume(G);continue}const n=B.prev;const o=n.prev;const s=n.type==="slash"||n.type==="bos";const r=o&&(o.type==="star"||o.type==="globstar");if(u.bash===true&&(!s||e[0]&&e[0]!=="/")){push({type:"star",value:G,output:""});continue}const a=m.braces>0&&(n.type==="comma"||n.type==="brace");const i=w.length&&(n.type==="pipe"||n.type==="paren");if(!s&&n.type!=="paren"&&!a&&!i){push({type:"star",value:G,output:""});continue}while(e.slice(0,3)==="/**"){const u=t[m.index+4];if(u&&u!=="/"){break}e=e.slice(3);consume("/**",3);}if(n.type==="bos"&&eos()){B.type="globstar";B.value+=G;B.output=globstar(u);m.output=B.output;m.globstar=true;consume(G);continue}if(n.type==="slash"&&n.prev.type!=="bos"&&!r&&eos()){m.output=m.output.slice(0,-(n.output+B.output).length);n.output=`(?:${n.output}`;B.type="globstar";B.output=globstar(u)+(u.strictSlashes?")":"|$)");B.value+=G;m.globstar=true;m.output+=n.output+B.output;consume(G);continue}if(n.type==="slash"&&n.prev.type!=="bos"&&e[0]==="/"){const t=e[1]!==void 0?"|$":"";m.output=m.output.slice(0,-(n.output+B.output).length);n.output=`(?:${n.output}`;B.type="globstar";B.output=`${globstar(u)}${b}|${b}${t})`;B.value+=G;m.output+=n.output+B.output;m.globstar=true;consume(G+M());push({type:"slash",value:"/",output:""});continue}if(n.type==="bos"&&e[0]==="/"){B.type="globstar";B.value+=G;B.output=`(?:^|${b}|${globstar(u)}${b})`;m.output=B.output;m.globstar=true;consume(G+M());push({type:"slash",value:"/",output:""});continue}m.output=m.output.slice(0,-B.output.length);B.type="globstar";B.output=globstar(u);B.value+=G;m.output+=B.output;m.globstar=true;consume(G);continue}const n={type:"star",value:G,output:k};if(u.bash===true){n.output=".*?";if(B.type==="bos"||B.type==="slash"){n.output=T+n.output;}push(n);continue}if(B&&(B.type==="bracket"||B.type==="paren")&&u.regex===true){n.output=G;push(n);continue}if(m.index===m.start||B.type==="slash"||B.type==="dot"){if(B.type==="dot"){m.output+=x;B.output+=x;}else if(u.dot===true){m.output+=S;B.output+=S;}else {m.output+=T;B.output+=T;}if(D()!=="*"){m.output+=C;B.output+=C;}}push(n);}while(m.brackets>0){if(u.strictBrackets===true)throw new SyntaxError(syntaxError("closing","]"));m.output=o.escapeLast(m.output,"[");decrement("brackets");}while(m.parens>0){if(u.strictBrackets===true)throw new SyntaxError(syntaxError("closing",")"));m.output=o.escapeLast(m.output,"(");decrement("parens");}while(m.braces>0){if(u.strictBrackets===true)throw new SyntaxError(syntaxError("closing","}"));m.output=o.escapeLast(m.output,"{");decrement("braces");}if(u.strictSlashes!==true&&(B.type==="star"||B.type==="bracket")){push({type:"maybe_slash",value:"",output:`${b}?`});}if(m.backtrack===true){m.output="";for(const t of m.tokens){m.output+=t.output!=null?t.output:t.value;if(t.suffix){m.output+=t.suffix;}}}return m};parse.fastpaths=(t,e)=>{const u={...e};const r=typeof u.maxLength==="number"?Math.min(s,u.maxLength):s;const a=t.length;if(a>r){throw new SyntaxError(`Input length: ${a}, exceeds maximum allowed length: ${r}`)}t=c[t]||t;const{DOT_LITERAL:i,SLASH_LITERAL:p,ONE_CHAR:l,DOTS_SLASH:f,NO_DOT:A,NO_DOTS:_,NO_DOTS_SLASH:R,STAR:E,START_ANCHOR:h}=n.globChars(u.windows);const g=u.dot?_:A;const b=u.dot?R:A;const C=u.capture?"":"?:";const y={negated:false,prefix:""};let $=u.bash===true?".*?":E;if(u.capture){$=`(${$})`;}const globstar=t=>{if(t.noglobstar===true)return $;return `(${C}(?:(?!${h}${t.dot?f:i}).)*?)`};const create=t=>{switch(t){case"*":return `${g}${l}${$}`;case".*":return `${i}${l}${$}`;case"*.*":return `${g}${$}${i}${l}${$}`;case"*/*":return `${g}${$}${p}${l}${b}${$}`;case"**":return g+globstar(u);case"**/*":return `(?:${g}${globstar(u)}${p})?${b}${l}${$}`;case"**/*.*":return `(?:${g}${globstar(u)}${p})?${b}${$}${i}${l}${$}`;case"**/.*":return `(?:${g}${globstar(u)}${p})?${i}${l}${$}`;default:{const e=/^(.*?)\.(\w+)$/.exec(t);if(!e)return;const u=create(e[1]);if(!u)return;return u+i+e[2]}}};const x=o.removePrefix(t,y);let S=create(x);if(S&&u.strictSlashes!==true){S+=`${p}?`;}return S};t.exports=parse;},510:(t,e,u)=>{const n=u(716);const o=u(697);const s=u(96);const r=u(154);const isObject=t=>t&&typeof t==="object"&&!Array.isArray(t);const picomatch=(t,e,u=false)=>{if(Array.isArray(t)){const n=t.map((t=>picomatch(t,e,u)));const arrayMatcher=t=>{for(const e of n){const u=e(t);if(u)return u}return false};return arrayMatcher}const n=isObject(t)&&t.tokens&&t.input;if(t===""||typeof t!=="string"&&!n){throw new TypeError("Expected pattern to be a non-empty string")}const o=e||{};const s=o.windows;const r=n?picomatch.compileRe(t,e):picomatch.makeRe(t,e,false,true);const a=r.state;delete r.state;let isIgnored=()=>false;if(o.ignore){const t={...e,ignore:null,onMatch:null,onResult:null};isIgnored=picomatch(o.ignore,t,u);}const matcher=(u,n=false)=>{const{isMatch:i,match:c,output:p}=picomatch.test(u,r,e,{glob:t,posix:s});const l={glob:t,state:a,regex:r,posix:s,input:u,output:p,match:c,isMatch:i};if(typeof o.onResult==="function"){o.onResult(l);}if(i===false){l.isMatch=false;return n?l:false}if(isIgnored(u)){if(typeof o.onIgnore==="function"){o.onIgnore(l);}l.isMatch=false;return n?l:false}if(typeof o.onMatch==="function"){o.onMatch(l);}return n?l:true};if(u){matcher.state=a;}return matcher};picomatch.test=(t,e,u,{glob:n,posix:o}={})=>{if(typeof t!=="string"){throw new TypeError("Expected input to be a string")}if(t===""){return {isMatch:false,output:""}}const r=u||{};const a=r.format||(o?s.toPosixSlashes:null);let i=t===n;let c=i&&a?a(t):t;if(i===false){c=a?a(t):t;i=c===n;}if(i===false||r.capture===true){if(r.matchBase===true||r.basename===true){i=picomatch.matchBase(t,e,u,o);}else {i=e.exec(c);}}return {isMatch:Boolean(i),match:i,output:c}};picomatch.matchBase=(t,e,u)=>{const n=e instanceof RegExp?e:picomatch.makeRe(e,u);return n.test(s.basename(t))};picomatch.isMatch=(t,e,u)=>picomatch(e,u)(t);picomatch.parse=(t,e)=>{if(Array.isArray(t))return t.map((t=>picomatch.parse(t,e)));return o(t,{...e,fastpaths:false})};picomatch.scan=(t,e)=>n(t,e);picomatch.compileRe=(t,e,u=false,n=false)=>{if(u===true){return t.output}const o=e||{};const s=o.contains?"":"^";const r=o.contains?"":"$";let a=`${s}(?:${t.output})${r}`;if(t&&t.negated===true){a=`^(?!${a}).*$`;}const i=picomatch.toRegex(a,e);if(n===true){i.state=t;}return i};picomatch.makeRe=(t,e={},u=false,n=false)=>{if(!t||typeof t!=="string"){throw new TypeError("Expected a non-empty string")}let s={negated:false,fastpaths:true};if(e.fastpaths!==false&&(t[0]==="."||t[0]==="*")){s.output=o.fastpaths(t,e);}if(!s.output){s=o(t,e);}return picomatch.compileRe(s,e,u,n)};picomatch.toRegex=(t,e)=>{try{const u=e||{};return new RegExp(t,u.flags||(u.nocase?"i":""))}catch(t){if(e&&e.debug===true)throw t;return /$^/}};picomatch.constants=r;t.exports=picomatch;},716:(t,e,u)=>{const n=u(96);const{CHAR_ASTERISK:o,CHAR_AT:s,CHAR_BACKWARD_SLASH:r,CHAR_COMMA:a,CHAR_DOT:i,CHAR_EXCLAMATION_MARK:c,CHAR_FORWARD_SLASH:p,CHAR_LEFT_CURLY_BRACE:l,CHAR_LEFT_PARENTHESES:f,CHAR_LEFT_SQUARE_BRACKET:A,CHAR_PLUS:_,CHAR_QUESTION_MARK:R,CHAR_RIGHT_CURLY_BRACE:E,CHAR_RIGHT_PARENTHESES:h,CHAR_RIGHT_SQUARE_BRACKET:g}=u(154);const isPathSeparator=t=>t===p||t===r;const depth=t=>{if(t.isPrefix!==true){t.depth=t.isGlobstar?Infinity:1;}};const scan=(t,e)=>{const u=e||{};const b=t.length-1;const C=u.parts===true||u.scanToEnd===true;const y=[];const $=[];const x=[];let S=t;let H=-1;let v=0;let d=0;let L=false;let T=false;let O=false;let k=false;let m=false;let w=false;let N=false;let I=false;let B=false;let G=false;let D=0;let M;let P;let K={value:"",depth:0,isGlob:false};const eos=()=>H>=b;const peek=()=>S.charCodeAt(H+1);const advance=()=>{M=P;return S.charCodeAt(++H)};while(H<b){P=advance();let t;if(P===r){N=K.backslashes=true;P=advance();if(P===l){w=true;}continue}if(w===true||P===l){D++;while(eos()!==true&&(P=advance())){if(P===r){N=K.backslashes=true;advance();continue}if(P===l){D++;continue}if(w!==true&&P===i&&(P=advance())===i){L=K.isBrace=true;O=K.isGlob=true;G=true;if(C===true){continue}break}if(w!==true&&P===a){L=K.isBrace=true;O=K.isGlob=true;G=true;if(C===true){continue}break}if(P===E){D--;if(D===0){w=false;L=K.isBrace=true;G=true;break}}}if(C===true){continue}break}if(P===p){y.push(H);$.push(K);K={value:"",depth:0,isGlob:false};if(G===true)continue;if(M===i&&H===v+1){v+=2;continue}d=H+1;continue}if(u.noext!==true){const t=P===_||P===s||P===o||P===R||P===c;if(t===true&&peek()===f){O=K.isGlob=true;k=K.isExtglob=true;G=true;if(P===c&&H===v){B=true;}if(C===true){while(eos()!==true&&(P=advance())){if(P===r){N=K.backslashes=true;P=advance();continue}if(P===h){O=K.isGlob=true;G=true;break}}continue}break}}if(P===o){if(M===o)m=K.isGlobstar=true;O=K.isGlob=true;G=true;if(C===true){continue}break}if(P===R){O=K.isGlob=true;G=true;if(C===true){continue}break}if(P===A){while(eos()!==true&&(t=advance())){if(t===r){N=K.backslashes=true;advance();continue}if(t===g){T=K.isBracket=true;O=K.isGlob=true;G=true;break}}if(C===true){continue}break}if(u.nonegate!==true&&P===c&&H===v){I=K.negated=true;v++;continue}if(u.noparen!==true&&P===f){O=K.isGlob=true;if(C===true){while(eos()!==true&&(P=advance())){if(P===f){N=K.backslashes=true;P=advance();continue}if(P===h){G=true;break}}continue}break}if(O===true){G=true;if(C===true){continue}break}}if(u.noext===true){k=false;O=false;}let U=S;let X="";let F="";if(v>0){X=S.slice(0,v);S=S.slice(v);d-=v;}if(U&&O===true&&d>0){U=S.slice(0,d);F=S.slice(d);}else if(O===true){U="";F=S;}else {U=S;}if(U&&U!==""&&U!=="/"&&U!==S){if(isPathSeparator(U.charCodeAt(U.length-1))){U=U.slice(0,-1);}}if(u.unescape===true){if(F)F=n.removeBackslashes(F);if(U&&N===true){U=n.removeBackslashes(U);}}const Q={prefix:X,input:t,start:v,base:U,glob:F,isBrace:L,isBracket:T,isGlob:O,isExtglob:k,isGlobstar:m,negated:I,negatedExtglob:B};if(u.tokens===true){Q.maxDepth=0;if(!isPathSeparator(P)){$.push(K);}Q.tokens=$;}if(u.parts===true||u.tokens===true){let e;for(let n=0;n<y.length;n++){const o=e?e+1:v;const s=y[n];const r=t.slice(o,s);if(u.tokens){if(n===0&&v!==0){$[n].isPrefix=true;$[n].value=X;}else {$[n].value=r;}depth($[n]);Q.maxDepth+=$[n].depth;}if(n!==0||r!==""){x.push(r);}e=s;}if(e&&e+1<t.length){const n=t.slice(e+1);x.push(n);if(u.tokens){$[$.length-1].value=n;depth($[$.length-1]);Q.maxDepth+=$[$.length-1].depth;}}Q.slashes=y;Q.parts=x;}return Q};t.exports=scan;},96:(t,e,u)=>{const{REGEX_BACKSLASH:n,REGEX_REMOVE_BACKSLASH:o,REGEX_SPECIAL_CHARS:s,REGEX_SPECIAL_CHARS_GLOBAL:r}=u(154);e.isObject=t=>t!==null&&typeof t==="object"&&!Array.isArray(t);e.hasRegexChars=t=>s.test(t);e.isRegexChar=t=>t.length===1&&e.hasRegexChars(t);e.escapeRegex=t=>t.replace(r,"\\$1");e.toPosixSlashes=t=>t.replace(n,"/");e.removeBackslashes=t=>t.replace(o,(t=>t==="\\"?"":t));e.escapeLast=(t,u,n)=>{const o=t.lastIndexOf(u,n);if(o===-1)return t;if(t[o-1]==="\\")return e.escapeLast(t,u,o-1);return `${t.slice(0,o)}\\${t.slice(o)}`};e.removePrefix=(t,e={})=>{let u=t;if(u.startsWith("./")){u=u.slice(2);e.prefix="./";}return u};e.wrapOutput=(t,e={},u={})=>{const n=u.contains?"":"^";const o=u.contains?"":"$";let s=`${n}(?:${t})${o}`;if(e.negated===true){s=`(?:^(?!${s}).*$)`;}return s};e.basename=(t,{windows:e}={})=>{const u=t.split(e?/[\\/]/:"/");const n=u[u.length-1];if(n===""){return u[u.length-2]}return n};}};var e={};function __nccwpck_require__(u){var n=e[u];if(n!==undefined){return n.exports}var o=e[u]={exports:{}};var s=true;try{t[u](o,o.exports,__nccwpck_require__);s=false;}finally{if(s)delete e[u];}return o.exports}if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var u=__nccwpck_require__(170);picomatch.exports=u;})();
1391
- return picomatch.exports;
1392
- }
1393
-
1394
- var hasRequiredMatchRemotePattern;
1395
-
1396
- function requireMatchRemotePattern () {
1397
- if (hasRequiredMatchRemotePattern) return matchRemotePattern;
1398
- hasRequiredMatchRemotePattern = 1;
1399
- (function (exports) {
1400
- Object.defineProperty(exports, "__esModule", {
1401
- value: true
1402
- });
1403
- function _export(target, all) {
1404
- for(var name in all)Object.defineProperty(target, name, {
1405
- enumerable: true,
1406
- get: all[name]
1407
- });
1408
- }
1409
- _export(exports, {
1410
- hasMatch: function() {
1411
- return hasMatch;
1412
- },
1413
- matchRemotePattern: function() {
1414
- return matchRemotePattern;
1415
- }
1416
- });
1417
- const _picomatch = requirePicomatch();
1418
- function matchRemotePattern(pattern, url) {
1419
- if (pattern.protocol !== undefined) {
1420
- const actualProto = url.protocol.slice(0, -1);
1421
- if (pattern.protocol !== actualProto) {
1422
- return false;
1423
- }
1424
- }
1425
- if (pattern.port !== undefined) {
1426
- if (pattern.port !== url.port) {
1427
- return false;
1428
- }
1429
- }
1430
- if (pattern.hostname === undefined) {
1431
- throw new Error("Pattern should define hostname but found\n" + JSON.stringify(pattern));
1432
- } else {
1433
- if (!(0, _picomatch.makeRe)(pattern.hostname).test(url.hostname)) {
1434
- return false;
1435
- }
1436
- }
1437
- var _pattern_pathname;
1438
- if (!(0, _picomatch.makeRe)((_pattern_pathname = pattern.pathname) != null ? _pattern_pathname : "**", {
1439
- dot: true
1440
- }).test(url.pathname)) {
1441
- return false;
1442
- }
1443
- return true;
1444
- }
1445
- function hasMatch(domains, remotePatterns, url) {
1446
- return domains.some((domain)=>url.hostname === domain) || remotePatterns.some((p)=>matchRemotePattern(p, url));
1447
- }
1448
-
1449
-
1450
- } (matchRemotePattern));
1451
- return matchRemotePattern;
1452
- }
1453
-
1454
- var hasRequiredImageLoader;
1455
-
1456
- function requireImageLoader () {
1457
- if (hasRequiredImageLoader) return imageLoader;
1458
- hasRequiredImageLoader = 1;
1459
- (function (exports) {
1460
- Object.defineProperty(exports, "__esModule", {
1461
- value: true
1462
- });
1463
- Object.defineProperty(exports, "default", {
1464
- enumerable: true,
1465
- get: function() {
1466
- return _default;
1467
- }
1468
- });
1469
- function defaultLoader(param) {
1470
- let { config, src, width, quality } = param;
1471
- if (process.env.NODE_ENV !== "production") {
1472
- const missingValues = [];
1473
- // these should always be provided but make sure they are
1474
- if (!src) missingValues.push("src");
1475
- if (!width) missingValues.push("width");
1476
- if (missingValues.length > 0) {
1477
- throw new Error("Next Image Optimization requires " + missingValues.join(", ") + " to be provided. Make sure you pass them as props to the `next/image` component. Received: " + JSON.stringify({
1478
- src,
1479
- width,
1480
- quality
1481
- }));
1482
- }
1483
- if (src.startsWith("//")) {
1484
- throw new Error('Failed to parse src "' + src + '" on `next/image`, protocol-relative URL (//) must be changed to an absolute URL (http:// or https://)');
1485
- }
1486
- if (!src.startsWith("/") && (config.domains || config.remotePatterns)) {
1487
- let parsedSrc;
1488
- try {
1489
- parsedSrc = new URL(src);
1490
- } catch (err) {
1491
- console.error(err);
1492
- throw new Error('Failed to parse src "' + src + '" on `next/image`, if using relative image it must start with a leading slash "/" or be an absolute URL (http:// or https://)');
1493
- }
1494
- if (process.env.NODE_ENV !== "test" && // micromatch isn't compatible with edge runtime
1495
- process.env.NEXT_RUNTIME !== "edge") {
1496
- // We use dynamic require because this should only error in development
1497
- const { hasMatch } = requireMatchRemotePattern();
1498
- if (!hasMatch(config.domains, config.remotePatterns, parsedSrc)) {
1499
- throw new Error("Invalid src prop (" + src + ') on `next/image`, hostname "' + parsedSrc.hostname + '" is not configured under images in your `next.config.js`\n' + "See more info: https://nextjs.org/docs/messages/next-image-unconfigured-host");
1500
- }
1501
- }
1502
- }
1503
- }
1504
- return config.path + "?url=" + encodeURIComponent(src) + "&w=" + width + "&q=" + (quality || 75) + (process.env.NEXT_DEPLOYMENT_ID ? "&dpl=" + process.env.NEXT_DEPLOYMENT_ID : "");
1505
- }
1506
- // We use this to determine if the import is the default loader
1507
- // or a custom loader defined by the user in next.config.js
1508
- defaultLoader.__next_img_default = true;
1509
- const _default = defaultLoader;
1510
-
1511
-
1512
- } (imageLoader));
1513
- return imageLoader;
1514
- }
1515
-
1516
- var hasRequiredImageComponent;
1517
-
1518
- function requireImageComponent () {
1519
- if (hasRequiredImageComponent) return imageComponent.exports;
1520
- hasRequiredImageComponent = 1;
1521
- (function (module, exports) {
1522
- "use client";
1523
- Object.defineProperty(exports, "__esModule", {
1524
- value: true
1525
- });
1526
- Object.defineProperty(exports, "Image", {
1527
- enumerable: true,
1528
- get: function() {
1529
- return Image;
1530
- }
1531
- });
1532
- const _interop_require_default = /*@__PURE__*/ require_interop_require_default();
1533
- const _interop_require_wildcard = /*@__PURE__*/ require_interop_require_wildcard();
1534
- const _jsxruntime = require$$2;
1535
- const _react = /*#__PURE__*/ _interop_require_wildcard._(React$1);
1536
- const _reactdom = /*#__PURE__*/ _interop_require_default._(require$$4);
1537
- const _head = /*#__PURE__*/ _interop_require_default._(requireHead());
1538
- const _getimgprops = requireGetImgProps();
1539
- const _imageconfig = requireImageConfig();
1540
- const _imageconfigcontextsharedruntime = requireImageConfigContext_sharedRuntime();
1541
- const _warnonce = requireWarnOnce();
1542
- const _routercontextsharedruntime = requireRouterContext_sharedRuntime();
1543
- const _imageloader = /*#__PURE__*/ _interop_require_default._(requireImageLoader());
1544
- // This is replaced by webpack define plugin
1545
- const configEnv = process.env.__NEXT_IMAGE_OPTS;
1546
- if (typeof window === "undefined") {
1547
- globalThis.__NEXT_IMAGE_IMPORTED = true;
1548
- }
1549
- // See https://stackoverflow.com/q/39777833/266535 for why we use this ref
1550
- // handler instead of the img's onLoad attribute.
1551
- function handleLoading(img, placeholder, onLoadRef, onLoadingCompleteRef, setBlurComplete, unoptimized, sizesInput) {
1552
- const src = img == null ? void 0 : img.src;
1553
- if (!img || img["data-loaded-src"] === src) {
1554
- return;
1555
- }
1556
- img["data-loaded-src"] = src;
1557
- const p = "decode" in img ? img.decode() : Promise.resolve();
1558
- p.catch(()=>{}).then(()=>{
1559
- if (!img.parentElement || !img.isConnected) {
1560
- // Exit early in case of race condition:
1561
- // - onload() is called
1562
- // - decode() is called but incomplete
1563
- // - unmount is called
1564
- // - decode() completes
1565
- return;
1566
- }
1567
- if (placeholder !== "empty") {
1568
- setBlurComplete(true);
1569
- }
1570
- if (onLoadRef == null ? void 0 : onLoadRef.current) {
1571
- // Since we don't have the SyntheticEvent here,
1572
- // we must create one with the same shape.
1573
- // See https://reactjs.org/docs/events.html
1574
- const event = new Event("load");
1575
- Object.defineProperty(event, "target", {
1576
- writable: false,
1577
- value: img
1578
- });
1579
- let prevented = false;
1580
- let stopped = false;
1581
- onLoadRef.current({
1582
- ...event,
1583
- nativeEvent: event,
1584
- currentTarget: img,
1585
- target: img,
1586
- isDefaultPrevented: ()=>prevented,
1587
- isPropagationStopped: ()=>stopped,
1588
- persist: ()=>{},
1589
- preventDefault: ()=>{
1590
- prevented = true;
1591
- event.preventDefault();
1592
- },
1593
- stopPropagation: ()=>{
1594
- stopped = true;
1595
- event.stopPropagation();
1596
- }
1597
- });
1598
- }
1599
- if (onLoadingCompleteRef == null ? void 0 : onLoadingCompleteRef.current) {
1600
- onLoadingCompleteRef.current(img);
1601
- }
1602
- if (process.env.NODE_ENV !== "production") {
1603
- const origSrc = new URL(src, "http://n").searchParams.get("url") || src;
1604
- if (img.getAttribute("data-nimg") === "fill") {
1605
- if (!unoptimized && (!sizesInput || sizesInput === "100vw")) {
1606
- let widthViewportRatio = img.getBoundingClientRect().width / window.innerWidth;
1607
- if (widthViewportRatio < 0.6) {
1608
- if (sizesInput === "100vw") {
1609
- (0, _warnonce.warnOnce)('Image with src "' + origSrc + '" has "fill" prop and "sizes" prop of "100vw", but image is not rendered at full viewport width. Please adjust "sizes" to improve page performance. Read more: https://nextjs.org/docs/api-reference/next/image#sizes');
1610
- } else {
1611
- (0, _warnonce.warnOnce)('Image with src "' + origSrc + '" has "fill" but is missing "sizes" prop. Please add it to improve page performance. Read more: https://nextjs.org/docs/api-reference/next/image#sizes');
1612
- }
1613
- }
1614
- }
1615
- if (img.parentElement) {
1616
- const { position } = window.getComputedStyle(img.parentElement);
1617
- const valid = [
1618
- "absolute",
1619
- "fixed",
1620
- "relative"
1621
- ];
1622
- if (!valid.includes(position)) {
1623
- (0, _warnonce.warnOnce)('Image with src "' + origSrc + '" has "fill" and parent element with invalid "position". Provided "' + position + '" should be one of ' + valid.map(String).join(",") + ".");
1624
- }
1625
- }
1626
- if (img.height === 0) {
1627
- (0, _warnonce.warnOnce)('Image with src "' + origSrc + '" has "fill" and a height value of 0. This is likely because the parent element of the image has not been styled to have a set height.');
1628
- }
1629
- }
1630
- const heightModified = img.height.toString() !== img.getAttribute("height");
1631
- const widthModified = img.width.toString() !== img.getAttribute("width");
1632
- if (heightModified && !widthModified || !heightModified && widthModified) {
1633
- (0, _warnonce.warnOnce)('Image with src "' + origSrc + '" has either width or height modified, but not the other. If you use CSS to change the size of your image, also include the styles \'width: "auto"\' or \'height: "auto"\' to maintain the aspect ratio.');
1634
- }
1635
- }
1636
- });
1637
- }
1638
- function getDynamicProps(fetchPriority) {
1639
- const [majorStr, minorStr] = _react.version.split(".", 2);
1640
- const major = parseInt(majorStr, 10);
1641
- const minor = parseInt(minorStr, 10);
1642
- if (major > 18 || major === 18 && minor >= 3) {
1643
- // In React 18.3.0 or newer, we must use camelCase
1644
- // prop to avoid "Warning: Invalid DOM property".
1645
- // See https://github.com/facebook/react/pull/25927
1646
- return {
1647
- fetchPriority
1648
- };
1649
- }
1650
- // In React 18.2.0 or older, we must use lowercase prop
1651
- // to avoid "Warning: Invalid DOM property".
1652
- return {
1653
- fetchpriority: fetchPriority
1654
- };
1655
- }
1656
- const ImageElement = /*#__PURE__*/ (0, _react.forwardRef)((param, forwardedRef)=>{
1657
- let { src, srcSet, sizes, height, width, decoding, className, style, fetchPriority, placeholder, loading, unoptimized, fill, onLoadRef, onLoadingCompleteRef, setBlurComplete, setShowAltText, sizesInput, onLoad, onError, ...rest } = param;
1658
- return /*#__PURE__*/ (0, _jsxruntime.jsx)("img", {
1659
- ...rest,
1660
- ...getDynamicProps(fetchPriority),
1661
- // It's intended to keep `loading` before `src` because React updates
1662
- // props in order which causes Safari/Firefox to not lazy load properly.
1663
- // See https://github.com/facebook/react/issues/25883
1664
- loading: loading,
1665
- width: width,
1666
- height: height,
1667
- decoding: decoding,
1668
- "data-nimg": fill ? "fill" : "1",
1669
- className: className,
1670
- style: style,
1671
- // It's intended to keep `src` the last attribute because React updates
1672
- // attributes in order. If we keep `src` the first one, Safari will
1673
- // immediately start to fetch `src`, before `sizes` and `srcSet` are even
1674
- // updated by React. That causes multiple unnecessary requests if `srcSet`
1675
- // and `sizes` are defined.
1676
- // This bug cannot be reproduced in Chrome or Firefox.
1677
- sizes: sizes,
1678
- srcSet: srcSet,
1679
- src: src,
1680
- ref: (0, _react.useCallback)((img)=>{
1681
- if (forwardedRef) {
1682
- if (typeof forwardedRef === "function") forwardedRef(img);
1683
- else if (typeof forwardedRef === "object") {
1684
- // @ts-ignore - .current is read only it's usually assigned by react internally
1685
- forwardedRef.current = img;
1686
- }
1687
- }
1688
- if (!img) {
1689
- return;
1690
- }
1691
- if (onError) {
1692
- // If the image has an error before react hydrates, then the error is lost.
1693
- // The workaround is to wait until the image is mounted which is after hydration,
1694
- // then we set the src again to trigger the error handler (if there was an error).
1695
- // eslint-disable-next-line no-self-assign
1696
- img.src = img.src;
1697
- }
1698
- if (process.env.NODE_ENV !== "production") {
1699
- if (!src) {
1700
- console.error('Image is missing required "src" property:', img);
1701
- }
1702
- if (img.getAttribute("alt") === null) {
1703
- console.error('Image is missing required "alt" property. Please add Alternative Text to describe the image for screen readers and search engines.');
1704
- }
1705
- }
1706
- if (img.complete) {
1707
- handleLoading(img, placeholder, onLoadRef, onLoadingCompleteRef, setBlurComplete, unoptimized, sizesInput);
1708
- }
1709
- }, [
1710
- src,
1711
- placeholder,
1712
- onLoadRef,
1713
- onLoadingCompleteRef,
1714
- setBlurComplete,
1715
- onError,
1716
- unoptimized,
1717
- sizesInput,
1718
- forwardedRef
1719
- ]),
1720
- onLoad: (event)=>{
1721
- const img = event.currentTarget;
1722
- handleLoading(img, placeholder, onLoadRef, onLoadingCompleteRef, setBlurComplete, unoptimized, sizesInput);
1723
- },
1724
- onError: (event)=>{
1725
- // if the real image fails to load, this will ensure "alt" is visible
1726
- setShowAltText(true);
1727
- if (placeholder !== "empty") {
1728
- // If the real image fails to load, this will still remove the placeholder.
1729
- setBlurComplete(true);
1730
- }
1731
- if (onError) {
1732
- onError(event);
1733
- }
1734
- }
1735
- });
1736
- });
1737
- function ImagePreload(param) {
1738
- let { isAppRouter, imgAttributes } = param;
1739
- const opts = {
1740
- as: "image",
1741
- imageSrcSet: imgAttributes.srcSet,
1742
- imageSizes: imgAttributes.sizes,
1743
- crossOrigin: imgAttributes.crossOrigin,
1744
- referrerPolicy: imgAttributes.referrerPolicy,
1745
- ...getDynamicProps(imgAttributes.fetchPriority)
1746
- };
1747
- if (isAppRouter && _reactdom.default.preload) {
1748
- // See https://github.com/facebook/react/pull/26940
1749
- _reactdom.default.preload(imgAttributes.src, // @ts-expect-error TODO: upgrade to `@types/react-dom@18.3.x`
1750
- opts);
1751
- return null;
1752
- }
1753
- return /*#__PURE__*/ (0, _jsxruntime.jsx)(_head.default, {
1754
- children: /*#__PURE__*/ (0, _jsxruntime.jsx)("link", {
1755
- rel: "preload",
1756
- // Note how we omit the `href` attribute, as it would only be relevant
1757
- // for browsers that do not support `imagesrcset`, and in those cases
1758
- // it would cause the incorrect image to be preloaded.
1759
- //
1760
- // https://html.spec.whatwg.org/multipage/semantics.html#attr-link-imagesrcset
1761
- href: imgAttributes.srcSet ? undefined : imgAttributes.src,
1762
- ...opts
1763
- }, "__nimg-" + imgAttributes.src + imgAttributes.srcSet + imgAttributes.sizes)
1764
- });
1765
- }
1766
- const Image = /*#__PURE__*/ (0, _react.forwardRef)((props, forwardedRef)=>{
1767
- const pagesRouter = (0, _react.useContext)(_routercontextsharedruntime.RouterContext);
1768
- // We're in the app directory if there is no pages router.
1769
- const isAppRouter = !pagesRouter;
1770
- const configContext = (0, _react.useContext)(_imageconfigcontextsharedruntime.ImageConfigContext);
1771
- const config = (0, _react.useMemo)(()=>{
1772
- const c = configEnv || configContext || _imageconfig.imageConfigDefault;
1773
- const allSizes = [
1774
- ...c.deviceSizes,
1775
- ...c.imageSizes
1776
- ].sort((a, b)=>a - b);
1777
- const deviceSizes = c.deviceSizes.sort((a, b)=>a - b);
1778
- return {
1779
- ...c,
1780
- allSizes,
1781
- deviceSizes
1782
- };
1783
- }, [
1784
- configContext
1785
- ]);
1786
- const { onLoad, onLoadingComplete } = props;
1787
- const onLoadRef = (0, _react.useRef)(onLoad);
1788
- (0, _react.useEffect)(()=>{
1789
- onLoadRef.current = onLoad;
1790
- }, [
1791
- onLoad
1792
- ]);
1793
- const onLoadingCompleteRef = (0, _react.useRef)(onLoadingComplete);
1794
- (0, _react.useEffect)(()=>{
1795
- onLoadingCompleteRef.current = onLoadingComplete;
1796
- }, [
1797
- onLoadingComplete
1798
- ]);
1799
- const [blurComplete, setBlurComplete] = (0, _react.useState)(false);
1800
- const [showAltText, setShowAltText] = (0, _react.useState)(false);
1801
- const { props: imgAttributes, meta: imgMeta } = (0, _getimgprops.getImgProps)(props, {
1802
- defaultLoader: _imageloader.default,
1803
- imgConf: config,
1804
- blurComplete,
1805
- showAltText
1806
- });
1807
- return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
1808
- children: [
1809
- /*#__PURE__*/ (0, _jsxruntime.jsx)(ImageElement, {
1810
- ...imgAttributes,
1811
- unoptimized: imgMeta.unoptimized,
1812
- placeholder: imgMeta.placeholder,
1813
- fill: imgMeta.fill,
1814
- onLoadRef: onLoadRef,
1815
- onLoadingCompleteRef: onLoadingCompleteRef,
1816
- setBlurComplete: setBlurComplete,
1817
- setShowAltText: setShowAltText,
1818
- sizesInput: props.sizes,
1819
- ref: forwardedRef
1820
- }),
1821
- imgMeta.priority ? /*#__PURE__*/ (0, _jsxruntime.jsx)(ImagePreload, {
1822
- isAppRouter: isAppRouter,
1823
- imgAttributes: imgAttributes
1824
- }) : null
1825
- ]
1826
- });
1827
- });
1828
-
1829
- if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
1830
- Object.defineProperty(exports.default, '__esModule', { value: true });
1831
- Object.assign(exports.default, exports);
1832
- module.exports = exports.default;
1833
- }
1834
-
1835
-
1836
- } (imageComponent, imageComponent.exports));
1837
- return imageComponent.exports;
1838
- }
1839
-
1840
- var hasRequiredImageExternal;
1841
-
1842
- function requireImageExternal () {
1843
- if (hasRequiredImageExternal) return imageExternal;
1844
- hasRequiredImageExternal = 1;
1845
- (function (exports) {
1846
- Object.defineProperty(exports, "__esModule", {
1847
- value: true
1848
- });
1849
- function _export(target, all) {
1850
- for(var name in all)Object.defineProperty(target, name, {
1851
- enumerable: true,
1852
- get: all[name]
1853
- });
1854
- }
1855
- _export(exports, {
1856
- default: function() {
1857
- return _default;
1858
- },
1859
- getImageProps: function() {
1860
- return getImageProps;
1861
- }
1862
- });
1863
- const _interop_require_default = /*@__PURE__*/ require_interop_require_default();
1864
- const _getimgprops = requireGetImgProps();
1865
- const _imagecomponent = requireImageComponent();
1866
- const _imageloader = /*#__PURE__*/ _interop_require_default._(requireImageLoader());
1867
- function getImageProps(imgProps) {
1868
- const { props } = (0, _getimgprops.getImgProps)(imgProps, {
1869
- defaultLoader: _imageloader.default,
1870
- // This is replaced by webpack define plugin
1871
- imgConf: process.env.__NEXT_IMAGE_OPTS
1872
- });
1873
- // Normally we don't care about undefined props because we pass to JSX,
1874
- // but this exported function could be used by the end user for anything
1875
- // so we delete undefined props to clean it up a little.
1876
- for (const [key, value] of Object.entries(props)){
1877
- if (value === undefined) {
1878
- delete props[key];
1879
- }
1880
- }
1881
- return {
1882
- props
1883
- };
1884
- }
1885
- const _default = _imagecomponent.Image;
1886
-
1887
-
1888
- } (imageExternal));
1889
- return imageExternal;
1890
- }
1891
-
1892
- var image;
1893
- var hasRequiredImage;
1894
-
1895
- function requireImage () {
1896
- if (hasRequiredImage) return image;
1897
- hasRequiredImage = 1;
1898
- image = requireImageExternal();
1899
- return image;
1900
- }
1901
-
1902
- var imageExports = requireImage();
1903
- var NextImage = /*@__PURE__*/getDefaultExportFromCjs(imageExports);
1904
-
1905
256
  var sizeMap = {
1906
257
  sm: {
1907
258
  element: 32,
@@ -2099,2077 +450,6 @@ var Badge = function Badge(_a) {
2099
450
  }, icon), children);
2100
451
  };
2101
452
 
2102
- (function (Prism) {
2103
-
2104
- var javascript = Prism.util.clone(Prism.languages.javascript);
2105
-
2106
- var space = /(?:\s|\/\/.*(?!.)|\/\*(?:[^*]|\*(?!\/))\*\/)/.source;
2107
- var braces = /(?:\{(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])*\})/.source;
2108
- var spread = /(?:\{<S>*\.{3}(?:[^{}]|<BRACES>)*\})/.source;
2109
-
2110
- /**
2111
- * @param {string} source
2112
- * @param {string} [flags]
2113
- */
2114
- function re(source, flags) {
2115
- source = source
2116
- .replace(/<S>/g, function () { return space; })
2117
- .replace(/<BRACES>/g, function () { return braces; })
2118
- .replace(/<SPREAD>/g, function () { return spread; });
2119
- return RegExp(source, flags);
2120
- }
2121
-
2122
- spread = re(spread).source;
2123
-
2124
-
2125
- Prism.languages.jsx = Prism.languages.extend('markup', javascript);
2126
- Prism.languages.jsx.tag.pattern = re(
2127
- /<\/?(?:[\w.:-]+(?:<S>+(?:[\w.:$-]+(?:=(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s{'"/>=]+|<BRACES>))?|<SPREAD>))*<S>*\/?)?>/.source
2128
- );
2129
-
2130
- Prism.languages.jsx.tag.inside['tag'].pattern = /^<\/?[^\s>\/]*/;
2131
- Prism.languages.jsx.tag.inside['attr-value'].pattern = /=(?!\{)(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s'">]+)/;
2132
- Prism.languages.jsx.tag.inside['tag'].inside['class-name'] = /^[A-Z]\w*(?:\.[A-Z]\w*)*$/;
2133
- Prism.languages.jsx.tag.inside['comment'] = javascript['comment'];
2134
-
2135
- Prism.languages.insertBefore('inside', 'attr-name', {
2136
- 'spread': {
2137
- pattern: re(/<SPREAD>/.source),
2138
- inside: Prism.languages.jsx
2139
- }
2140
- }, Prism.languages.jsx.tag);
2141
-
2142
- Prism.languages.insertBefore('inside', 'special-attr', {
2143
- 'script': {
2144
- // Allow for two levels of nesting
2145
- pattern: re(/=<BRACES>/.source),
2146
- alias: 'language-javascript',
2147
- inside: {
2148
- 'script-punctuation': {
2149
- pattern: /^=(?=\{)/,
2150
- alias: 'punctuation'
2151
- },
2152
- rest: Prism.languages.jsx
2153
- },
2154
- }
2155
- }, Prism.languages.jsx.tag);
2156
-
2157
- // The following will handle plain text inside tags
2158
- var stringifyToken = function (token) {
2159
- if (!token) {
2160
- return '';
2161
- }
2162
- if (typeof token === 'string') {
2163
- return token;
2164
- }
2165
- if (typeof token.content === 'string') {
2166
- return token.content;
2167
- }
2168
- return token.content.map(stringifyToken).join('');
2169
- };
2170
-
2171
- var walkTokens = function (tokens) {
2172
- var openedTags = [];
2173
- for (var i = 0; i < tokens.length; i++) {
2174
- var token = tokens[i];
2175
- var notTagNorBrace = false;
2176
-
2177
- if (typeof token !== 'string') {
2178
- if (token.type === 'tag' && token.content[0] && token.content[0].type === 'tag') {
2179
- // We found a tag, now find its kind
2180
-
2181
- if (token.content[0].content[0].content === '</') {
2182
- // Closing tag
2183
- if (openedTags.length > 0 && openedTags[openedTags.length - 1].tagName === stringifyToken(token.content[0].content[1])) {
2184
- // Pop matching opening tag
2185
- openedTags.pop();
2186
- }
2187
- } else {
2188
- if (token.content[token.content.length - 1].content === '/>') ; else {
2189
- // Opening tag
2190
- openedTags.push({
2191
- tagName: stringifyToken(token.content[0].content[1]),
2192
- openedBraces: 0
2193
- });
2194
- }
2195
- }
2196
- } else if (openedTags.length > 0 && token.type === 'punctuation' && token.content === '{') {
2197
-
2198
- // Here we might have entered a JSX context inside a tag
2199
- openedTags[openedTags.length - 1].openedBraces++;
2200
-
2201
- } else if (openedTags.length > 0 && openedTags[openedTags.length - 1].openedBraces > 0 && token.type === 'punctuation' && token.content === '}') {
2202
-
2203
- // Here we might have left a JSX context inside a tag
2204
- openedTags[openedTags.length - 1].openedBraces--;
2205
-
2206
- } else {
2207
- notTagNorBrace = true;
2208
- }
2209
- }
2210
- if (notTagNorBrace || typeof token === 'string') {
2211
- if (openedTags.length > 0 && openedTags[openedTags.length - 1].openedBraces === 0) {
2212
- // Here we are inside a tag, and not inside a JSX context.
2213
- // That's plain text: drop any tokens matched.
2214
- var plainText = stringifyToken(token);
2215
-
2216
- // And merge text with adjacent text
2217
- if (i < tokens.length - 1 && (typeof tokens[i + 1] === 'string' || tokens[i + 1].type === 'plain-text')) {
2218
- plainText += stringifyToken(tokens[i + 1]);
2219
- tokens.splice(i + 1, 1);
2220
- }
2221
- if (i > 0 && (typeof tokens[i - 1] === 'string' || tokens[i - 1].type === 'plain-text')) {
2222
- plainText = stringifyToken(tokens[i - 1]) + plainText;
2223
- tokens.splice(i - 1, 1);
2224
- i--;
2225
- }
2226
-
2227
- tokens[i] = new Prism.Token('plain-text', plainText, null, plainText);
2228
- }
2229
- }
2230
-
2231
- if (token.content && typeof token.content !== 'string') {
2232
- walkTokens(token.content);
2233
- }
2234
- }
2235
- };
2236
-
2237
- Prism.hooks.add('after-tokenize', function (env) {
2238
- if (env.language !== 'jsx' && env.language !== 'tsx') {
2239
- return;
2240
- }
2241
- walkTokens(env.tokens);
2242
- });
2243
-
2244
- }(Prism));
2245
-
2246
- var prismTypescript = {};
2247
-
2248
- var hasRequiredPrismTypescript;
2249
-
2250
- function requirePrismTypescript () {
2251
- if (hasRequiredPrismTypescript) return prismTypescript;
2252
- hasRequiredPrismTypescript = 1;
2253
- (function (Prism) {
2254
-
2255
- Prism.languages.typescript = Prism.languages.extend('javascript', {
2256
- 'class-name': {
2257
- pattern: /(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,
2258
- lookbehind: true,
2259
- greedy: true,
2260
- inside: null // see below
2261
- },
2262
- 'builtin': /\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/,
2263
- });
2264
-
2265
- // The keywords TypeScript adds to JavaScript
2266
- Prism.languages.typescript.keyword.push(
2267
- /\b(?:abstract|declare|is|keyof|readonly|require)\b/,
2268
- // keywords that have to be followed by an identifier
2269
- /\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,
2270
- // This is for `import type *, {}`
2271
- /\btype\b(?=\s*(?:[\{*]|$))/
2272
- );
2273
-
2274
- // doesn't work with TS because TS is too complex
2275
- delete Prism.languages.typescript['parameter'];
2276
- delete Prism.languages.typescript['literal-property'];
2277
-
2278
- // a version of typescript specifically for highlighting types
2279
- var typeInside = Prism.languages.extend('typescript', {});
2280
- delete typeInside['class-name'];
2281
-
2282
- Prism.languages.typescript['class-name'].inside = typeInside;
2283
-
2284
- Prism.languages.insertBefore('typescript', 'function', {
2285
- 'decorator': {
2286
- pattern: /@[$\w\xA0-\uFFFF]+/,
2287
- inside: {
2288
- 'at': {
2289
- pattern: /^@/,
2290
- alias: 'operator'
2291
- },
2292
- 'function': /^[\s\S]+/
2293
- }
2294
- },
2295
- 'generic-function': {
2296
- // e.g. foo<T extends "bar" | "baz">( ...
2297
- pattern: /#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,
2298
- greedy: true,
2299
- inside: {
2300
- 'function': /^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,
2301
- 'generic': {
2302
- pattern: /<[\s\S]+/, // everything after the first <
2303
- alias: 'class-name',
2304
- inside: typeInside
2305
- }
2306
- }
2307
- }
2308
- });
2309
-
2310
- Prism.languages.ts = Prism.languages.typescript;
2311
-
2312
- }(Prism));
2313
- return prismTypescript;
2314
- }
2315
-
2316
- requirePrismTypescript();
2317
-
2318
- (function (Prism) {
2319
- // $ set | grep '^[A-Z][^[:space:]]*=' | cut -d= -f1 | tr '\n' '|'
2320
- // + LC_ALL, RANDOM, REPLY, SECONDS.
2321
- // + make sure PS1..4 are here as they are not always set,
2322
- // - some useless things.
2323
- var envVars = '\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b';
2324
-
2325
- var commandAfterHeredoc = {
2326
- pattern: /(^(["']?)\w+\2)[ \t]+\S.*/,
2327
- lookbehind: true,
2328
- alias: 'punctuation', // this looks reasonably well in all themes
2329
- inside: null // see below
2330
- };
2331
-
2332
- var insideString = {
2333
- 'bash': commandAfterHeredoc,
2334
- 'environment': {
2335
- pattern: RegExp('\\$' + envVars),
2336
- alias: 'constant'
2337
- },
2338
- 'variable': [
2339
- // [0]: Arithmetic Environment
2340
- {
2341
- pattern: /\$?\(\([\s\S]+?\)\)/,
2342
- greedy: true,
2343
- inside: {
2344
- // If there is a $ sign at the beginning highlight $(( and )) as variable
2345
- 'variable': [
2346
- {
2347
- pattern: /(^\$\(\([\s\S]+)\)\)/,
2348
- lookbehind: true
2349
- },
2350
- /^\$\(\(/
2351
- ],
2352
- 'number': /\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,
2353
- // Operators according to https://www.gnu.org/software/bash/manual/bashref.html#Shell-Arithmetic
2354
- 'operator': /--|\+\+|\*\*=?|<<=?|>>=?|&&|\|\||[=!+\-*/%<>^&|]=?|[?~:]/,
2355
- // If there is no $ sign at the beginning highlight (( and )) as punctuation
2356
- 'punctuation': /\(\(?|\)\)?|,|;/
2357
- }
2358
- },
2359
- // [1]: Command Substitution
2360
- {
2361
- pattern: /\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/,
2362
- greedy: true,
2363
- inside: {
2364
- 'variable': /^\$\(|^`|\)$|`$/
2365
- }
2366
- },
2367
- // [2]: Brace expansion
2368
- {
2369
- pattern: /\$\{[^}]+\}/,
2370
- greedy: true,
2371
- inside: {
2372
- 'operator': /:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,
2373
- 'punctuation': /[\[\]]/,
2374
- 'environment': {
2375
- pattern: RegExp('(\\{)' + envVars),
2376
- lookbehind: true,
2377
- alias: 'constant'
2378
- }
2379
- }
2380
- },
2381
- /\$(?:\w+|[#?*!@$])/
2382
- ],
2383
- // Escape sequences from echo and printf's manuals, and escaped quotes.
2384
- 'entity': /\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/
2385
- };
2386
-
2387
- Prism.languages.bash = {
2388
- 'shebang': {
2389
- pattern: /^#!\s*\/.*/,
2390
- alias: 'important'
2391
- },
2392
- 'comment': {
2393
- pattern: /(^|[^"{\\$])#.*/,
2394
- lookbehind: true
2395
- },
2396
- 'function-name': [
2397
- // a) function foo {
2398
- // b) foo() {
2399
- // c) function foo() {
2400
- // but not “foo {”
2401
- {
2402
- // a) and c)
2403
- pattern: /(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/,
2404
- lookbehind: true,
2405
- alias: 'function'
2406
- },
2407
- {
2408
- // b)
2409
- pattern: /\b[\w-]+(?=\s*\(\s*\)\s*\{)/,
2410
- alias: 'function'
2411
- }
2412
- ],
2413
- // Highlight variable names as variables in for and select beginnings.
2414
- 'for-or-select': {
2415
- pattern: /(\b(?:for|select)\s+)\w+(?=\s+in\s)/,
2416
- alias: 'variable',
2417
- lookbehind: true
2418
- },
2419
- // Highlight variable names as variables in the left-hand part
2420
- // of assignments (“=” and “+=”).
2421
- 'assign-left': {
2422
- pattern: /(^|[\s;|&]|[<>]\()\w+(?:\.\w+)*(?=\+?=)/,
2423
- inside: {
2424
- 'environment': {
2425
- pattern: RegExp('(^|[\\s;|&]|[<>]\\()' + envVars),
2426
- lookbehind: true,
2427
- alias: 'constant'
2428
- }
2429
- },
2430
- alias: 'variable',
2431
- lookbehind: true
2432
- },
2433
- // Highlight parameter names as variables
2434
- 'parameter': {
2435
- pattern: /(^|\s)-{1,2}(?:\w+:[+-]?)?\w+(?:\.\w+)*(?=[=\s]|$)/,
2436
- alias: 'variable',
2437
- lookbehind: true
2438
- },
2439
- 'string': [
2440
- // Support for Here-documents https://en.wikipedia.org/wiki/Here_document
2441
- {
2442
- pattern: /((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,
2443
- lookbehind: true,
2444
- greedy: true,
2445
- inside: insideString
2446
- },
2447
- // Here-document with quotes around the tag
2448
- // → No expansion (so no “inside”).
2449
- {
2450
- pattern: /((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/,
2451
- lookbehind: true,
2452
- greedy: true,
2453
- inside: {
2454
- 'bash': commandAfterHeredoc
2455
- }
2456
- },
2457
- // “Normal” string
2458
- {
2459
- // https://www.gnu.org/software/bash/manual/html_node/Double-Quotes.html
2460
- pattern: /(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,
2461
- lookbehind: true,
2462
- greedy: true,
2463
- inside: insideString
2464
- },
2465
- {
2466
- // https://www.gnu.org/software/bash/manual/html_node/Single-Quotes.html
2467
- pattern: /(^|[^$\\])'[^']*'/,
2468
- lookbehind: true,
2469
- greedy: true
2470
- },
2471
- {
2472
- // https://www.gnu.org/software/bash/manual/html_node/ANSI_002dC-Quoting.html
2473
- pattern: /\$'(?:[^'\\]|\\[\s\S])*'/,
2474
- greedy: true,
2475
- inside: {
2476
- 'entity': insideString.entity
2477
- }
2478
- }
2479
- ],
2480
- 'environment': {
2481
- pattern: RegExp('\\$?' + envVars),
2482
- alias: 'constant'
2483
- },
2484
- 'variable': insideString.variable,
2485
- 'function': {
2486
- pattern: /(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cargo|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|java|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|sysctl|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,
2487
- lookbehind: true
2488
- },
2489
- 'keyword': {
2490
- pattern: /(^|[\s;|&]|[<>]\()(?:case|do|done|elif|else|esac|fi|for|function|if|in|select|then|until|while)(?=$|[)\s;|&])/,
2491
- lookbehind: true
2492
- },
2493
- // https://www.gnu.org/software/bash/manual/html_node/Shell-Builtin-Commands.html
2494
- 'builtin': {
2495
- pattern: /(^|[\s;|&]|[<>]\()(?:\.|:|alias|bind|break|builtin|caller|cd|command|continue|declare|echo|enable|eval|exec|exit|export|getopts|hash|help|let|local|logout|mapfile|printf|pwd|read|readarray|readonly|return|set|shift|shopt|source|test|times|trap|type|typeset|ulimit|umask|unalias|unset)(?=$|[)\s;|&])/,
2496
- lookbehind: true,
2497
- // Alias added to make those easier to distinguish from strings.
2498
- alias: 'class-name'
2499
- },
2500
- 'boolean': {
2501
- pattern: /(^|[\s;|&]|[<>]\()(?:false|true)(?=$|[)\s;|&])/,
2502
- lookbehind: true
2503
- },
2504
- 'file-descriptor': {
2505
- pattern: /\B&\d\b/,
2506
- alias: 'important'
2507
- },
2508
- 'operator': {
2509
- // Lots of redirections here, but not just that.
2510
- pattern: /\d?<>|>\||\+=|=[=~]?|!=?|<<[<-]?|[&\d]?>>|\d[<>]&?|[<>][&=]?|&[>&]?|\|[&|]?/,
2511
- inside: {
2512
- 'file-descriptor': {
2513
- pattern: /^\d/,
2514
- alias: 'important'
2515
- }
2516
- }
2517
- },
2518
- 'punctuation': /\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/,
2519
- 'number': {
2520
- pattern: /(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,
2521
- lookbehind: true
2522
- }
2523
- };
2524
-
2525
- commandAfterHeredoc.inside = Prism.languages.bash;
2526
-
2527
- /* Patterns in command substitution. */
2528
- var toBeCopied = [
2529
- 'comment',
2530
- 'function-name',
2531
- 'for-or-select',
2532
- 'assign-left',
2533
- 'parameter',
2534
- 'string',
2535
- 'environment',
2536
- 'function',
2537
- 'keyword',
2538
- 'builtin',
2539
- 'boolean',
2540
- 'file-descriptor',
2541
- 'operator',
2542
- 'punctuation',
2543
- 'number'
2544
- ];
2545
- var inside = insideString.variable[1].inside;
2546
- for (var i = 0; i < toBeCopied.length; i++) {
2547
- inside[toBeCopied[i]] = Prism.languages.bash[toBeCopied[i]];
2548
- }
2549
-
2550
- Prism.languages.sh = Prism.languages.bash;
2551
- Prism.languages.shell = Prism.languages.bash;
2552
- }(Prism));
2553
-
2554
- (function (Prism) {
2555
-
2556
- var string = /(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;
2557
-
2558
- Prism.languages.css = {
2559
- 'comment': /\/\*[\s\S]*?\*\//,
2560
- 'atrule': {
2561
- pattern: RegExp('@[\\w-](?:' + /[^;{\s"']|\s+(?!\s)/.source + '|' + string.source + ')*?' + /(?:;|(?=\s*\{))/.source),
2562
- inside: {
2563
- 'rule': /^@[\w-]+/,
2564
- 'selector-function-argument': {
2565
- pattern: /(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,
2566
- lookbehind: true,
2567
- alias: 'selector'
2568
- },
2569
- 'keyword': {
2570
- pattern: /(^|[^\w-])(?:and|not|only|or)(?![\w-])/,
2571
- lookbehind: true
2572
- }
2573
- // See rest below
2574
- }
2575
- },
2576
- 'url': {
2577
- // https://drafts.csswg.org/css-values-3/#urls
2578
- pattern: RegExp('\\burl\\((?:' + string.source + '|' + /(?:[^\\\r\n()"']|\\[\s\S])*/.source + ')\\)', 'i'),
2579
- greedy: true,
2580
- inside: {
2581
- 'function': /^url/i,
2582
- 'punctuation': /^\(|\)$/,
2583
- 'string': {
2584
- pattern: RegExp('^' + string.source + '$'),
2585
- alias: 'url'
2586
- }
2587
- }
2588
- },
2589
- 'selector': {
2590
- pattern: RegExp('(^|[{}\\s])[^{}\\s](?:[^{};"\'\\s]|\\s+(?![\\s{])|' + string.source + ')*(?=\\s*\\{)'),
2591
- lookbehind: true
2592
- },
2593
- 'string': {
2594
- pattern: string,
2595
- greedy: true
2596
- },
2597
- 'property': {
2598
- pattern: /(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,
2599
- lookbehind: true
2600
- },
2601
- 'important': /!important\b/i,
2602
- 'function': {
2603
- pattern: /(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,
2604
- lookbehind: true
2605
- },
2606
- 'punctuation': /[(){};:,]/
2607
- };
2608
-
2609
- Prism.languages.css['atrule'].inside.rest = Prism.languages.css;
2610
-
2611
- var markup = Prism.languages.markup;
2612
- if (markup) {
2613
- markup.tag.addInlined('style', 'css');
2614
- markup.tag.addAttribute('style', 'css');
2615
- }
2616
-
2617
- }(Prism));
2618
-
2619
- (function (Prism) {
2620
-
2621
- Prism.languages.diff = {
2622
- 'coord': [
2623
- // Match all kinds of coord lines (prefixed by "+++", "---" or "***").
2624
- /^(?:\*{3}|-{3}|\+{3}).*$/m,
2625
- // Match "@@ ... @@" coord lines in unified diff.
2626
- /^@@.*@@$/m,
2627
- // Match coord lines in normal diff (starts with a number).
2628
- /^\d.*$/m
2629
- ]
2630
-
2631
- // deleted, inserted, unchanged, diff
2632
- };
2633
-
2634
- /**
2635
- * A map from the name of a block to its line prefix.
2636
- *
2637
- * @type {Object<string, string>}
2638
- */
2639
- var PREFIXES = {
2640
- 'deleted-sign': '-',
2641
- 'deleted-arrow': '<',
2642
- 'inserted-sign': '+',
2643
- 'inserted-arrow': '>',
2644
- 'unchanged': ' ',
2645
- 'diff': '!',
2646
- };
2647
-
2648
- // add a token for each prefix
2649
- Object.keys(PREFIXES).forEach(function (name) {
2650
- var prefix = PREFIXES[name];
2651
-
2652
- var alias = [];
2653
- if (!/^\w+$/.test(name)) { // "deleted-sign" -> "deleted"
2654
- alias.push(/\w+/.exec(name)[0]);
2655
- }
2656
- if (name === 'diff') {
2657
- alias.push('bold');
2658
- }
2659
-
2660
- Prism.languages.diff[name] = {
2661
- pattern: RegExp('^(?:[' + prefix + '].*(?:\r\n?|\n|(?![\\s\\S])))+', 'm'),
2662
- alias: alias,
2663
- inside: {
2664
- 'line': {
2665
- pattern: /(.)(?=[\s\S]).*(?:\r\n?|\n)?/,
2666
- lookbehind: true
2667
- },
2668
- 'prefix': {
2669
- pattern: /[\s\S]/,
2670
- alias: /\w+/.exec(name)[0]
2671
- }
2672
- }
2673
- };
2674
-
2675
- });
2676
-
2677
- // make prefixes available to Diff plugin
2678
- Object.defineProperty(Prism.languages.diff, 'PREFIXES', {
2679
- value: PREFIXES
2680
- });
2681
-
2682
- }(Prism));
2683
-
2684
- (function (Prism) {
2685
-
2686
- // Many of the following regexes will contain negated lookaheads like `[ \t]+(?![ \t])`. This is a trick to ensure
2687
- // that quantifiers behave *atomically*. Atomic quantifiers are necessary to prevent exponential backtracking.
2688
-
2689
- var spaceAfterBackSlash = /\\[\r\n](?:\s|\\[\r\n]|#.*(?!.))*(?![\s#]|\\[\r\n])/.source;
2690
- // At least one space, comment, or line break
2691
- var space = /(?:[ \t]+(?![ \t])(?:<SP_BS>)?|<SP_BS>)/.source
2692
- .replace(/<SP_BS>/g, function () { return spaceAfterBackSlash; });
2693
-
2694
- var string = /"(?:[^"\\\r\n]|\\(?:\r\n|[\s\S]))*"|'(?:[^'\\\r\n]|\\(?:\r\n|[\s\S]))*'/.source;
2695
- var option = /--[\w-]+=(?:<STR>|(?!["'])(?:[^\s\\]|\\.)+)/.source.replace(/<STR>/g, function () { return string; });
2696
-
2697
- var stringRule = {
2698
- pattern: RegExp(string),
2699
- greedy: true
2700
- };
2701
- var commentRule = {
2702
- pattern: /(^[ \t]*)#.*/m,
2703
- lookbehind: true,
2704
- greedy: true
2705
- };
2706
-
2707
- /**
2708
- * @param {string} source
2709
- * @param {string} flags
2710
- * @returns {RegExp}
2711
- */
2712
- function re(source, flags) {
2713
- source = source
2714
- .replace(/<OPT>/g, function () { return option; })
2715
- .replace(/<SP>/g, function () { return space; });
2716
-
2717
- return RegExp(source, flags);
2718
- }
2719
-
2720
- Prism.languages.docker = {
2721
- 'instruction': {
2722
- pattern: /(^[ \t]*)(?:ADD|ARG|CMD|COPY|ENTRYPOINT|ENV|EXPOSE|FROM|HEALTHCHECK|LABEL|MAINTAINER|ONBUILD|RUN|SHELL|STOPSIGNAL|USER|VOLUME|WORKDIR)(?=\s)(?:\\.|[^\r\n\\])*(?:\\$(?:\s|#.*$)*(?![\s#])(?:\\.|[^\r\n\\])*)*/im,
2723
- lookbehind: true,
2724
- greedy: true,
2725
- inside: {
2726
- 'options': {
2727
- pattern: re(/(^(?:ONBUILD<SP>)?\w+<SP>)<OPT>(?:<SP><OPT>)*/.source, 'i'),
2728
- lookbehind: true,
2729
- greedy: true,
2730
- inside: {
2731
- 'property': {
2732
- pattern: /(^|\s)--[\w-]+/,
2733
- lookbehind: true
2734
- },
2735
- 'string': [
2736
- stringRule,
2737
- {
2738
- pattern: /(=)(?!["'])(?:[^\s\\]|\\.)+/,
2739
- lookbehind: true
2740
- }
2741
- ],
2742
- 'operator': /\\$/m,
2743
- 'punctuation': /=/
2744
- }
2745
- },
2746
- 'keyword': [
2747
- {
2748
- // https://docs.docker.com/engine/reference/builder/#healthcheck
2749
- pattern: re(/(^(?:ONBUILD<SP>)?HEALTHCHECK<SP>(?:<OPT><SP>)*)(?:CMD|NONE)\b/.source, 'i'),
2750
- lookbehind: true,
2751
- greedy: true
2752
- },
2753
- {
2754
- // https://docs.docker.com/engine/reference/builder/#from
2755
- pattern: re(/(^(?:ONBUILD<SP>)?FROM<SP>(?:<OPT><SP>)*(?!--)[^ \t\\]+<SP>)AS/.source, 'i'),
2756
- lookbehind: true,
2757
- greedy: true
2758
- },
2759
- {
2760
- // https://docs.docker.com/engine/reference/builder/#onbuild
2761
- pattern: re(/(^ONBUILD<SP>)\w+/.source, 'i'),
2762
- lookbehind: true,
2763
- greedy: true
2764
- },
2765
- {
2766
- pattern: /^\w+/,
2767
- greedy: true
2768
- }
2769
- ],
2770
- 'comment': commentRule,
2771
- 'string': stringRule,
2772
- 'variable': /\$(?:\w+|\{[^{}"'\\]*\})/,
2773
- 'operator': /\\$/m
2774
- }
2775
- },
2776
- 'comment': commentRule
2777
- };
2778
-
2779
- Prism.languages.dockerfile = Prism.languages.docker;
2780
-
2781
- }(Prism));
2782
-
2783
- Prism.languages.git = {
2784
- /*
2785
- * A simple one line comment like in a git status command
2786
- * For instance:
2787
- * $ git status
2788
- * # On branch infinite-scroll
2789
- * # Your branch and 'origin/sharedBranches/frontendTeam/infinite-scroll' have diverged,
2790
- * # and have 1 and 2 different commits each, respectively.
2791
- * nothing to commit (working directory clean)
2792
- */
2793
- 'comment': /^#.*/m,
2794
-
2795
- /*
2796
- * Regexp to match the changed lines in a git diff output. Check the example below.
2797
- */
2798
- 'deleted': /^[-–].*/m,
2799
- 'inserted': /^\+.*/m,
2800
-
2801
- /*
2802
- * a string (double and simple quote)
2803
- */
2804
- 'string': /("|')(?:\\.|(?!\1)[^\\\r\n])*\1/,
2805
-
2806
- /*
2807
- * a git command. It starts with a random prompt finishing by a $, then "git" then some other parameters
2808
- * For instance:
2809
- * $ git add file.txt
2810
- */
2811
- 'command': {
2812
- pattern: /^.*\$ git .*$/m,
2813
- inside: {
2814
- /*
2815
- * A git command can contain a parameter starting by a single or a double dash followed by a string
2816
- * For instance:
2817
- * $ git diff --cached
2818
- * $ git log -p
2819
- */
2820
- 'parameter': /\s--?\w+/
2821
- }
2822
- },
2823
-
2824
- /*
2825
- * Coordinates displayed in a git diff command
2826
- * For instance:
2827
- * $ git diff
2828
- * diff --git file.txt file.txt
2829
- * index 6214953..1d54a52 100644
2830
- * --- file.txt
2831
- * +++ file.txt
2832
- * @@ -1 +1,2 @@
2833
- * -Here's my tetx file
2834
- * +Here's my text file
2835
- * +And this is the second line
2836
- */
2837
- 'coord': /^@@.*@@$/m,
2838
-
2839
- /*
2840
- * Match a "commit [SHA1]" line in a git log output.
2841
- * For instance:
2842
- * $ git log
2843
- * commit a11a14ef7e26f2ca62d4b35eac455ce636d0dc09
2844
- * Author: lgiraudel
2845
- * Date: Mon Feb 17 11:18:34 2014 +0100
2846
- *
2847
- * Add of a new line
2848
- */
2849
- 'commit-sha1': /^commit \w{40}$/m
2850
- };
2851
-
2852
- Prism.languages.go = Prism.languages.extend('clike', {
2853
- 'string': {
2854
- pattern: /(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,
2855
- lookbehind: true,
2856
- greedy: true
2857
- },
2858
- 'keyword': /\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,
2859
- 'boolean': /\b(?:_|false|iota|nil|true)\b/,
2860
- 'number': [
2861
- // binary and octal integers
2862
- /\b0(?:b[01_]+|o[0-7_]+)i?\b/i,
2863
- // hexadecimal integers and floats
2864
- /\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,
2865
- // decimal integers and floats
2866
- /(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i
2867
- ],
2868
- 'operator': /[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,
2869
- 'builtin': /\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/
2870
- });
2871
-
2872
- Prism.languages.insertBefore('go', 'string', {
2873
- 'char': {
2874
- pattern: /'(?:\\.|[^'\\\r\n]){0,10}'/,
2875
- greedy: true
2876
- }
2877
- });
2878
-
2879
- delete Prism.languages.go['class-name'];
2880
-
2881
- Prism.languages.graphql = {
2882
- 'comment': /#.*/,
2883
- 'description': {
2884
- pattern: /(?:"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*")(?=\s*[a-z_])/i,
2885
- greedy: true,
2886
- alias: 'string',
2887
- inside: {
2888
- 'language-markdown': {
2889
- pattern: /(^"(?:"")?)(?!\1)[\s\S]+(?=\1$)/,
2890
- lookbehind: true,
2891
- inside: Prism.languages.markdown
2892
- }
2893
- }
2894
- },
2895
- 'string': {
2896
- pattern: /"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*"/,
2897
- greedy: true
2898
- },
2899
- 'number': /(?:\B-|\b)\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,
2900
- 'boolean': /\b(?:false|true)\b/,
2901
- 'variable': /\$[a-z_]\w*/i,
2902
- 'directive': {
2903
- pattern: /@[a-z_]\w*/i,
2904
- alias: 'function'
2905
- },
2906
- 'attr-name': {
2907
- pattern: /\b[a-z_]\w*(?=\s*(?:\((?:[^()"]|"(?:\\.|[^\\"\r\n])*")*\))?:)/i,
2908
- greedy: true
2909
- },
2910
- 'atom-input': {
2911
- pattern: /\b[A-Z]\w*Input\b/,
2912
- alias: 'class-name'
2913
- },
2914
- 'scalar': /\b(?:Boolean|Float|ID|Int|String)\b/,
2915
- 'constant': /\b[A-Z][A-Z_\d]*\b/,
2916
- 'class-name': {
2917
- pattern: /(\b(?:enum|implements|interface|on|scalar|type|union)\s+|&\s*|:\s*|\[)[A-Z_]\w*/,
2918
- lookbehind: true
2919
- },
2920
- 'fragment': {
2921
- pattern: /(\bfragment\s+|\.{3}\s*(?!on\b))[a-zA-Z_]\w*/,
2922
- lookbehind: true,
2923
- alias: 'function'
2924
- },
2925
- 'definition-mutation': {
2926
- pattern: /(\bmutation\s+)[a-zA-Z_]\w*/,
2927
- lookbehind: true,
2928
- alias: 'function'
2929
- },
2930
- 'definition-query': {
2931
- pattern: /(\bquery\s+)[a-zA-Z_]\w*/,
2932
- lookbehind: true,
2933
- alias: 'function'
2934
- },
2935
- 'keyword': /\b(?:directive|enum|extend|fragment|implements|input|interface|mutation|on|query|repeatable|scalar|schema|subscription|type|union)\b/,
2936
- 'operator': /[!=|&]|\.{3}/,
2937
- 'property-query': /\w+(?=\s*\()/,
2938
- 'object': /\w+(?=\s*\{)/,
2939
- 'punctuation': /[!(){}\[\]:=,]/,
2940
- 'property': /\w+/
2941
- };
2942
-
2943
- Prism.hooks.add('after-tokenize', function afterTokenizeGraphql(env) {
2944
- if (env.language !== 'graphql') {
2945
- return;
2946
- }
2947
-
2948
- /**
2949
- * get the graphql token stream that we want to customize
2950
- *
2951
- * @typedef {InstanceType<import("./prism-core")["Token"]>} Token
2952
- * @type {Token[]}
2953
- */
2954
- var validTokens = env.tokens.filter(function (token) {
2955
- return typeof token !== 'string' && token.type !== 'comment' && token.type !== 'scalar';
2956
- });
2957
-
2958
- var currentIndex = 0;
2959
-
2960
- /**
2961
- * Returns whether the token relative to the current index has the given type.
2962
- *
2963
- * @param {number} offset
2964
- * @returns {Token | undefined}
2965
- */
2966
- function getToken(offset) {
2967
- return validTokens[currentIndex + offset];
2968
- }
2969
-
2970
- /**
2971
- * Returns whether the token relative to the current index has the given type.
2972
- *
2973
- * @param {readonly string[]} types
2974
- * @param {number} [offset=0]
2975
- * @returns {boolean}
2976
- */
2977
- function isTokenType(types, offset) {
2978
- offset = offset || 0;
2979
- for (var i = 0; i < types.length; i++) {
2980
- var token = getToken(i + offset);
2981
- if (!token || token.type !== types[i]) {
2982
- return false;
2983
- }
2984
- }
2985
- return true;
2986
- }
2987
-
2988
- /**
2989
- * Returns the index of the closing bracket to an opening bracket.
2990
- *
2991
- * It is assumed that `token[currentIndex - 1]` is an opening bracket.
2992
- *
2993
- * If no closing bracket could be found, `-1` will be returned.
2994
- *
2995
- * @param {RegExp} open
2996
- * @param {RegExp} close
2997
- * @returns {number}
2998
- */
2999
- function findClosingBracket(open, close) {
3000
- var stackHeight = 1;
3001
-
3002
- for (var i = currentIndex; i < validTokens.length; i++) {
3003
- var token = validTokens[i];
3004
- var content = token.content;
3005
-
3006
- if (token.type === 'punctuation' && typeof content === 'string') {
3007
- if (open.test(content)) {
3008
- stackHeight++;
3009
- } else if (close.test(content)) {
3010
- stackHeight--;
3011
-
3012
- if (stackHeight === 0) {
3013
- return i;
3014
- }
3015
- }
3016
- }
3017
- }
3018
-
3019
- return -1;
3020
- }
3021
-
3022
- /**
3023
- * Adds an alias to the given token.
3024
- *
3025
- * @param {Token} token
3026
- * @param {string} alias
3027
- * @returns {void}
3028
- */
3029
- function addAlias(token, alias) {
3030
- var aliases = token.alias;
3031
- if (!aliases) {
3032
- token.alias = aliases = [];
3033
- } else if (!Array.isArray(aliases)) {
3034
- token.alias = aliases = [aliases];
3035
- }
3036
- aliases.push(alias);
3037
- }
3038
-
3039
- for (; currentIndex < validTokens.length;) {
3040
- var startToken = validTokens[currentIndex++];
3041
-
3042
- // add special aliases for mutation tokens
3043
- if (startToken.type === 'keyword' && startToken.content === 'mutation') {
3044
- // any array of the names of all input variables (if any)
3045
- var inputVariables = [];
3046
-
3047
- if (isTokenType(['definition-mutation', 'punctuation']) && getToken(1).content === '(') {
3048
- // definition
3049
-
3050
- currentIndex += 2; // skip 'definition-mutation' and 'punctuation'
3051
-
3052
- var definitionEnd = findClosingBracket(/^\($/, /^\)$/);
3053
- if (definitionEnd === -1) {
3054
- continue;
3055
- }
3056
-
3057
- // find all input variables
3058
- for (; currentIndex < definitionEnd; currentIndex++) {
3059
- var t = getToken(0);
3060
- if (t.type === 'variable') {
3061
- addAlias(t, 'variable-input');
3062
- inputVariables.push(t.content);
3063
- }
3064
- }
3065
-
3066
- currentIndex = definitionEnd + 1;
3067
- }
3068
-
3069
- if (isTokenType(['punctuation', 'property-query']) && getToken(0).content === '{') {
3070
- currentIndex++; // skip opening bracket
3071
-
3072
- addAlias(getToken(0), 'property-mutation');
3073
-
3074
- if (inputVariables.length > 0) {
3075
- var mutationEnd = findClosingBracket(/^\{$/, /^\}$/);
3076
- if (mutationEnd === -1) {
3077
- continue;
3078
- }
3079
-
3080
- // give references to input variables a special alias
3081
- for (var i = currentIndex; i < mutationEnd; i++) {
3082
- var varToken = validTokens[i];
3083
- if (varToken.type === 'variable' && inputVariables.indexOf(varToken.content) >= 0) {
3084
- addAlias(varToken, 'variable-input');
3085
- }
3086
- }
3087
- }
3088
- }
3089
- }
3090
- }
3091
- });
3092
-
3093
- var prismJava = {};
3094
-
3095
- var hasRequiredPrismJava;
3096
-
3097
- function requirePrismJava () {
3098
- if (hasRequiredPrismJava) return prismJava;
3099
- hasRequiredPrismJava = 1;
3100
- (function (Prism) {
3101
-
3102
- var keywords = /\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/;
3103
-
3104
- // full package (optional) + parent classes (optional)
3105
- var classNamePrefix = /(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source;
3106
-
3107
- // based on the java naming conventions
3108
- var className = {
3109
- pattern: RegExp(/(^|[^\w.])/.source + classNamePrefix + /[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),
3110
- lookbehind: true,
3111
- inside: {
3112
- 'namespace': {
3113
- pattern: /^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,
3114
- inside: {
3115
- 'punctuation': /\./
3116
- }
3117
- },
3118
- 'punctuation': /\./
3119
- }
3120
- };
3121
-
3122
- Prism.languages.java = Prism.languages.extend('clike', {
3123
- 'string': {
3124
- pattern: /(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,
3125
- lookbehind: true,
3126
- greedy: true
3127
- },
3128
- 'class-name': [
3129
- className,
3130
- {
3131
- // variables, parameters, and constructor references
3132
- // this to support class names (or generic parameters) which do not contain a lower case letter (also works for methods)
3133
- pattern: RegExp(/(^|[^\w.])/.source + classNamePrefix + /[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source),
3134
- lookbehind: true,
3135
- inside: className.inside
3136
- },
3137
- {
3138
- // class names based on keyword
3139
- // this to support class names (or generic parameters) which do not contain a lower case letter (also works for methods)
3140
- pattern: RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source + classNamePrefix + /[A-Z]\w*\b/.source),
3141
- lookbehind: true,
3142
- inside: className.inside
3143
- }
3144
- ],
3145
- 'keyword': keywords,
3146
- 'function': [
3147
- Prism.languages.clike.function,
3148
- {
3149
- pattern: /(::\s*)[a-z_]\w*/,
3150
- lookbehind: true
3151
- }
3152
- ],
3153
- 'number': /\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,
3154
- 'operator': {
3155
- pattern: /(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,
3156
- lookbehind: true
3157
- },
3158
- 'constant': /\b[A-Z][A-Z_\d]+\b/
3159
- });
3160
-
3161
- Prism.languages.insertBefore('java', 'string', {
3162
- 'triple-quoted-string': {
3163
- // http://openjdk.java.net/jeps/355#Description
3164
- pattern: /"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,
3165
- greedy: true,
3166
- alias: 'string'
3167
- },
3168
- 'char': {
3169
- pattern: /'(?:\\.|[^'\\\r\n]){1,6}'/,
3170
- greedy: true
3171
- }
3172
- });
3173
-
3174
- Prism.languages.insertBefore('java', 'class-name', {
3175
- 'annotation': {
3176
- pattern: /(^|[^.])@\w+(?:\s*\.\s*\w+)*/,
3177
- lookbehind: true,
3178
- alias: 'punctuation'
3179
- },
3180
- 'generics': {
3181
- pattern: /<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,
3182
- inside: {
3183
- 'class-name': className,
3184
- 'keyword': keywords,
3185
- 'punctuation': /[<>(),.:]/,
3186
- 'operator': /[?&|]/
3187
- }
3188
- },
3189
- 'import': [
3190
- {
3191
- pattern: RegExp(/(\bimport\s+)/.source + classNamePrefix + /(?:[A-Z]\w*|\*)(?=\s*;)/.source),
3192
- lookbehind: true,
3193
- inside: {
3194
- 'namespace': className.inside.namespace,
3195
- 'punctuation': /\./,
3196
- 'operator': /\*/,
3197
- 'class-name': /\w+/
3198
- }
3199
- },
3200
- {
3201
- pattern: RegExp(/(\bimport\s+static\s+)/.source + classNamePrefix + /(?:\w+|\*)(?=\s*;)/.source),
3202
- lookbehind: true,
3203
- alias: 'static',
3204
- inside: {
3205
- 'namespace': className.inside.namespace,
3206
- 'static': /\b\w+$/,
3207
- 'punctuation': /\./,
3208
- 'operator': /\*/,
3209
- 'class-name': /\w+/
3210
- }
3211
- }
3212
- ],
3213
- 'namespace': {
3214
- pattern: RegExp(
3215
- /(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)(?!<keyword>)[a-z]\w*(?:\.[a-z]\w*)*\.?/
3216
- .source.replace(/<keyword>/g, function () { return keywords.source; })),
3217
- lookbehind: true,
3218
- inside: {
3219
- 'punctuation': /\./,
3220
- }
3221
- }
3222
- });
3223
- }(Prism));
3224
- return prismJava;
3225
- }
3226
-
3227
- requirePrismJava();
3228
-
3229
- // https://www.json.org/json-en.html
3230
- Prism.languages.json = {
3231
- 'property': {
3232
- pattern: /(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,
3233
- lookbehind: true,
3234
- greedy: true
3235
- },
3236
- 'string': {
3237
- pattern: /(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,
3238
- lookbehind: true,
3239
- greedy: true
3240
- },
3241
- 'comment': {
3242
- pattern: /\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,
3243
- greedy: true
3244
- },
3245
- 'number': /-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,
3246
- 'punctuation': /[{}[\],]/,
3247
- 'operator': /:/,
3248
- 'boolean': /\b(?:false|true)\b/,
3249
- 'null': {
3250
- pattern: /\bnull\b/,
3251
- alias: 'keyword'
3252
- }
3253
- };
3254
-
3255
- Prism.languages.webmanifest = Prism.languages.json;
3256
-
3257
- (function (Prism) {
3258
- Prism.languages.kotlin = Prism.languages.extend('clike', {
3259
- 'keyword': {
3260
- // The lookbehind prevents wrong highlighting of e.g. kotlin.properties.get
3261
- pattern: /(^|[^.])\b(?:abstract|actual|annotation|as|break|by|catch|class|companion|const|constructor|continue|crossinline|data|do|dynamic|else|enum|expect|external|final|finally|for|fun|get|if|import|in|infix|init|inline|inner|interface|internal|is|lateinit|noinline|null|object|open|operator|out|override|package|private|protected|public|reified|return|sealed|set|super|suspend|tailrec|this|throw|to|try|typealias|val|var|vararg|when|where|while)\b/,
3262
- lookbehind: true
3263
- },
3264
- 'function': [
3265
- {
3266
- pattern: /(?:`[^\r\n`]+`|\b\w+)(?=\s*\()/,
3267
- greedy: true
3268
- },
3269
- {
3270
- pattern: /(\.)(?:`[^\r\n`]+`|\w+)(?=\s*\{)/,
3271
- lookbehind: true,
3272
- greedy: true
3273
- }
3274
- ],
3275
- 'number': /\b(?:0[xX][\da-fA-F]+(?:_[\da-fA-F]+)*|0[bB][01]+(?:_[01]+)*|\d+(?:_\d+)*(?:\.\d+(?:_\d+)*)?(?:[eE][+-]?\d+(?:_\d+)*)?[fFL]?)\b/,
3276
- 'operator': /\+[+=]?|-[-=>]?|==?=?|!(?:!|==?)?|[\/*%<>]=?|[?:]:?|\.\.|&&|\|\||\b(?:and|inv|or|shl|shr|ushr|xor)\b/
3277
- });
3278
-
3279
- delete Prism.languages.kotlin['class-name'];
3280
-
3281
- var interpolationInside = {
3282
- 'interpolation-punctuation': {
3283
- pattern: /^\$\{?|\}$/,
3284
- alias: 'punctuation'
3285
- },
3286
- 'expression': {
3287
- pattern: /[\s\S]+/,
3288
- inside: Prism.languages.kotlin
3289
- }
3290
- };
3291
-
3292
- Prism.languages.insertBefore('kotlin', 'string', {
3293
- // https://kotlinlang.org/spec/expressions.html#string-interpolation-expressions
3294
- 'string-literal': [
3295
- {
3296
- pattern: /"""(?:[^$]|\$(?:(?!\{)|\{[^{}]*\}))*?"""/,
3297
- alias: 'multiline',
3298
- inside: {
3299
- 'interpolation': {
3300
- pattern: /\$(?:[a-z_]\w*|\{[^{}]*\})/i,
3301
- inside: interpolationInside
3302
- },
3303
- 'string': /[\s\S]+/
3304
- }
3305
- },
3306
- {
3307
- pattern: /"(?:[^"\\\r\n$]|\\.|\$(?:(?!\{)|\{[^{}]*\}))*"/,
3308
- alias: 'singleline',
3309
- inside: {
3310
- 'interpolation': {
3311
- pattern: /((?:^|[^\\])(?:\\{2})*)\$(?:[a-z_]\w*|\{[^{}]*\})/i,
3312
- lookbehind: true,
3313
- inside: interpolationInside
3314
- },
3315
- 'string': /[\s\S]+/
3316
- }
3317
- }
3318
- ],
3319
- 'char': {
3320
- // https://kotlinlang.org/spec/expressions.html#character-literals
3321
- pattern: /'(?:[^'\\\r\n]|\\(?:.|u[a-fA-F0-9]{0,4}))'/,
3322
- greedy: true
3323
- }
3324
- });
3325
-
3326
- delete Prism.languages.kotlin['string'];
3327
-
3328
- Prism.languages.insertBefore('kotlin', 'keyword', {
3329
- 'annotation': {
3330
- pattern: /\B@(?:\w+:)?(?:[A-Z]\w*|\[[^\]]+\])/,
3331
- alias: 'builtin'
3332
- }
3333
- });
3334
-
3335
- Prism.languages.insertBefore('kotlin', 'function', {
3336
- 'label': {
3337
- pattern: /\b\w+@|@\w+\b/,
3338
- alias: 'symbol'
3339
- }
3340
- });
3341
-
3342
- Prism.languages.kt = Prism.languages.kotlin;
3343
- Prism.languages.kts = Prism.languages.kotlin;
3344
- }(Prism));
3345
-
3346
- (function (Prism) {
3347
-
3348
- // Allow only one line break
3349
- var inner = /(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;
3350
-
3351
- /**
3352
- * This function is intended for the creation of the bold or italic pattern.
3353
- *
3354
- * This also adds a lookbehind group to the given pattern to ensure that the pattern is not backslash-escaped.
3355
- *
3356
- * _Note:_ Keep in mind that this adds a capturing group.
3357
- *
3358
- * @param {string} pattern
3359
- * @returns {RegExp}
3360
- */
3361
- function createInline(pattern) {
3362
- pattern = pattern.replace(/<inner>/g, function () { return inner; });
3363
- return RegExp(/((?:^|[^\\])(?:\\{2})*)/.source + '(?:' + pattern + ')');
3364
- }
3365
-
3366
-
3367
- var tableCell = /(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source;
3368
- var tableRow = /\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g, function () { return tableCell; });
3369
- var tableLine = /\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source;
3370
-
3371
-
3372
- Prism.languages.markdown = Prism.languages.extend('markup', {});
3373
- Prism.languages.insertBefore('markdown', 'prolog', {
3374
- 'front-matter-block': {
3375
- pattern: /(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,
3376
- lookbehind: true,
3377
- greedy: true,
3378
- inside: {
3379
- 'punctuation': /^---|---$/,
3380
- 'front-matter': {
3381
- pattern: /\S+(?:\s+\S+)*/,
3382
- alias: ['yaml', 'language-yaml'],
3383
- inside: Prism.languages.yaml
3384
- }
3385
- }
3386
- },
3387
- 'blockquote': {
3388
- // > ...
3389
- pattern: /^>(?:[\t ]*>)*/m,
3390
- alias: 'punctuation'
3391
- },
3392
- 'table': {
3393
- pattern: RegExp('^' + tableRow + tableLine + '(?:' + tableRow + ')*', 'm'),
3394
- inside: {
3395
- 'table-data-rows': {
3396
- pattern: RegExp('^(' + tableRow + tableLine + ')(?:' + tableRow + ')*$'),
3397
- lookbehind: true,
3398
- inside: {
3399
- 'table-data': {
3400
- pattern: RegExp(tableCell),
3401
- inside: Prism.languages.markdown
3402
- },
3403
- 'punctuation': /\|/
3404
- }
3405
- },
3406
- 'table-line': {
3407
- pattern: RegExp('^(' + tableRow + ')' + tableLine + '$'),
3408
- lookbehind: true,
3409
- inside: {
3410
- 'punctuation': /\||:?-{3,}:?/
3411
- }
3412
- },
3413
- 'table-header-row': {
3414
- pattern: RegExp('^' + tableRow + '$'),
3415
- inside: {
3416
- 'table-header': {
3417
- pattern: RegExp(tableCell),
3418
- alias: 'important',
3419
- inside: Prism.languages.markdown
3420
- },
3421
- 'punctuation': /\|/
3422
- }
3423
- }
3424
- }
3425
- },
3426
- 'code': [
3427
- {
3428
- // Prefixed by 4 spaces or 1 tab and preceded by an empty line
3429
- pattern: /((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,
3430
- lookbehind: true,
3431
- alias: 'keyword'
3432
- },
3433
- {
3434
- // ```optional language
3435
- // code block
3436
- // ```
3437
- pattern: /^```[\s\S]*?^```$/m,
3438
- greedy: true,
3439
- inside: {
3440
- 'code-block': {
3441
- pattern: /^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,
3442
- lookbehind: true
3443
- },
3444
- 'code-language': {
3445
- pattern: /^(```).+/,
3446
- lookbehind: true
3447
- },
3448
- 'punctuation': /```/
3449
- }
3450
- }
3451
- ],
3452
- 'title': [
3453
- {
3454
- // title 1
3455
- // =======
3456
-
3457
- // title 2
3458
- // -------
3459
- pattern: /\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,
3460
- alias: 'important',
3461
- inside: {
3462
- punctuation: /==+$|--+$/
3463
- }
3464
- },
3465
- {
3466
- // # title 1
3467
- // ###### title 6
3468
- pattern: /(^\s*)#.+/m,
3469
- lookbehind: true,
3470
- alias: 'important',
3471
- inside: {
3472
- punctuation: /^#+|#+$/
3473
- }
3474
- }
3475
- ],
3476
- 'hr': {
3477
- // ***
3478
- // ---
3479
- // * * *
3480
- // -----------
3481
- pattern: /(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,
3482
- lookbehind: true,
3483
- alias: 'punctuation'
3484
- },
3485
- 'list': {
3486
- // * item
3487
- // + item
3488
- // - item
3489
- // 1. item
3490
- pattern: /(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,
3491
- lookbehind: true,
3492
- alias: 'punctuation'
3493
- },
3494
- 'url-reference': {
3495
- // [id]: http://example.com "Optional title"
3496
- // [id]: http://example.com 'Optional title'
3497
- // [id]: http://example.com (Optional title)
3498
- // [id]: <http://example.com> "Optional title"
3499
- pattern: /!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,
3500
- inside: {
3501
- 'variable': {
3502
- pattern: /^(!?\[)[^\]]+/,
3503
- lookbehind: true
3504
- },
3505
- 'string': /(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,
3506
- 'punctuation': /^[\[\]!:]|[<>]/
3507
- },
3508
- alias: 'url'
3509
- },
3510
- 'bold': {
3511
- // **strong**
3512
- // __strong__
3513
-
3514
- // allow one nested instance of italic text using the same delimiter
3515
- pattern: createInline(/\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\b|\*\*(?:(?!\*)<inner>|\*(?:(?!\*)<inner>)+\*)+\*\*/.source),
3516
- lookbehind: true,
3517
- greedy: true,
3518
- inside: {
3519
- 'content': {
3520
- pattern: /(^..)[\s\S]+(?=..$)/,
3521
- lookbehind: true,
3522
- inside: {} // see below
3523
- },
3524
- 'punctuation': /\*\*|__/
3525
- }
3526
- },
3527
- 'italic': {
3528
- // *em*
3529
- // _em_
3530
-
3531
- // allow one nested instance of bold text using the same delimiter
3532
- pattern: createInline(/\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\b|\*(?:(?!\*)<inner>|\*\*(?:(?!\*)<inner>)+\*\*)+\*/.source),
3533
- lookbehind: true,
3534
- greedy: true,
3535
- inside: {
3536
- 'content': {
3537
- pattern: /(^.)[\s\S]+(?=.$)/,
3538
- lookbehind: true,
3539
- inside: {} // see below
3540
- },
3541
- 'punctuation': /[*_]/
3542
- }
3543
- },
3544
- 'strike': {
3545
- // ~~strike through~~
3546
- // ~strike~
3547
- // eslint-disable-next-line regexp/strict
3548
- pattern: createInline(/(~~?)(?:(?!~)<inner>)+\2/.source),
3549
- lookbehind: true,
3550
- greedy: true,
3551
- inside: {
3552
- 'content': {
3553
- pattern: /(^~~?)[\s\S]+(?=\1$)/,
3554
- lookbehind: true,
3555
- inside: {} // see below
3556
- },
3557
- 'punctuation': /~~?/
3558
- }
3559
- },
3560
- 'code-snippet': {
3561
- // `code`
3562
- // ``code``
3563
- pattern: /(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,
3564
- lookbehind: true,
3565
- greedy: true,
3566
- alias: ['code', 'keyword']
3567
- },
3568
- 'url': {
3569
- // [example](http://example.com "Optional title")
3570
- // [example][id]
3571
- // [example] [id]
3572
- pattern: createInline(/!?\[(?:(?!\])<inner>)+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\])<inner>)+\])/.source),
3573
- lookbehind: true,
3574
- greedy: true,
3575
- inside: {
3576
- 'operator': /^!/,
3577
- 'content': {
3578
- pattern: /(^\[)[^\]]+(?=\])/,
3579
- lookbehind: true,
3580
- inside: {} // see below
3581
- },
3582
- 'variable': {
3583
- pattern: /(^\][ \t]?\[)[^\]]+(?=\]$)/,
3584
- lookbehind: true
3585
- },
3586
- 'url': {
3587
- pattern: /(^\]\()[^\s)]+/,
3588
- lookbehind: true
3589
- },
3590
- 'string': {
3591
- pattern: /(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,
3592
- lookbehind: true
3593
- }
3594
- }
3595
- }
3596
- });
3597
-
3598
- ['url', 'bold', 'italic', 'strike'].forEach(function (token) {
3599
- ['url', 'bold', 'italic', 'strike', 'code-snippet'].forEach(function (inside) {
3600
- if (token !== inside) {
3601
- Prism.languages.markdown[token].inside.content.inside[inside] = Prism.languages.markdown[inside];
3602
- }
3603
- });
3604
- });
3605
-
3606
- Prism.hooks.add('after-tokenize', function (env) {
3607
- if (env.language !== 'markdown' && env.language !== 'md') {
3608
- return;
3609
- }
3610
-
3611
- function walkTokens(tokens) {
3612
- if (!tokens || typeof tokens === 'string') {
3613
- return;
3614
- }
3615
-
3616
- for (var i = 0, l = tokens.length; i < l; i++) {
3617
- var token = tokens[i];
3618
-
3619
- if (token.type !== 'code') {
3620
- walkTokens(token.content);
3621
- continue;
3622
- }
3623
-
3624
- /*
3625
- * Add the correct `language-xxxx` class to this code block. Keep in mind that the `code-language` token
3626
- * is optional. But the grammar is defined so that there is only one case we have to handle:
3627
- *
3628
- * token.content = [
3629
- * <span class="punctuation">```</span>,
3630
- * <span class="code-language">xxxx</span>,
3631
- * '\n', // exactly one new lines (\r or \n or \r\n)
3632
- * <span class="code-block">...</span>,
3633
- * '\n', // exactly one new lines again
3634
- * <span class="punctuation">```</span>
3635
- * ];
3636
- */
3637
-
3638
- var codeLang = token.content[1];
3639
- var codeBlock = token.content[3];
3640
-
3641
- if (codeLang && codeBlock &&
3642
- codeLang.type === 'code-language' && codeBlock.type === 'code-block' &&
3643
- typeof codeLang.content === 'string') {
3644
-
3645
- // this might be a language that Prism does not support
3646
-
3647
- // do some replacements to support C++, C#, and F#
3648
- var lang = codeLang.content.replace(/\b#/g, 'sharp').replace(/\b\+\+/g, 'pp');
3649
- // only use the first word
3650
- lang = (/[a-z][\w-]*/i.exec(lang) || [''])[0].toLowerCase();
3651
- var alias = 'language-' + lang;
3652
-
3653
- // add alias
3654
- if (!codeBlock.alias) {
3655
- codeBlock.alias = [alias];
3656
- } else if (typeof codeBlock.alias === 'string') {
3657
- codeBlock.alias = [codeBlock.alias, alias];
3658
- } else {
3659
- codeBlock.alias.push(alias);
3660
- }
3661
- }
3662
- }
3663
- }
3664
-
3665
- walkTokens(env.tokens);
3666
- });
3667
-
3668
- Prism.hooks.add('wrap', function (env) {
3669
- if (env.type !== 'code-block') {
3670
- return;
3671
- }
3672
-
3673
- var codeLang = '';
3674
- for (var i = 0, l = env.classes.length; i < l; i++) {
3675
- var cls = env.classes[i];
3676
- var match = /language-(.+)/.exec(cls);
3677
- if (match) {
3678
- codeLang = match[1];
3679
- break;
3680
- }
3681
- }
3682
-
3683
- var grammar = Prism.languages[codeLang];
3684
-
3685
- if (!grammar) {
3686
- if (codeLang && codeLang !== 'none' && Prism.plugins.autoloader) {
3687
- var id = 'md-' + new Date().valueOf() + '-' + Math.floor(Math.random() * 1e16);
3688
- env.attributes['id'] = id;
3689
-
3690
- Prism.plugins.autoloader.loadLanguages(codeLang, function () {
3691
- var ele = document.getElementById(id);
3692
- if (ele) {
3693
- ele.innerHTML = Prism.highlight(ele.textContent, Prism.languages[codeLang], codeLang);
3694
- }
3695
- });
3696
- }
3697
- } else {
3698
- env.content = Prism.highlight(textContent(env.content), grammar, codeLang);
3699
- }
3700
- });
3701
-
3702
- var tagPattern = RegExp(Prism.languages.markup.tag.pattern.source, 'gi');
3703
-
3704
- /**
3705
- * A list of known entity names.
3706
- *
3707
- * This will always be incomplete to save space. The current list is the one used by lowdash's unescape function.
3708
- *
3709
- * @see {@link https://github.com/lodash/lodash/blob/2da024c3b4f9947a48517639de7560457cd4ec6c/unescape.js#L2}
3710
- */
3711
- var KNOWN_ENTITY_NAMES = {
3712
- 'amp': '&',
3713
- 'lt': '<',
3714
- 'gt': '>',
3715
- 'quot': '"',
3716
- };
3717
-
3718
- // IE 11 doesn't support `String.fromCodePoint`
3719
- var fromCodePoint = String.fromCodePoint || String.fromCharCode;
3720
-
3721
- /**
3722
- * Returns the text content of a given HTML source code string.
3723
- *
3724
- * @param {string} html
3725
- * @returns {string}
3726
- */
3727
- function textContent(html) {
3728
- // remove all tags
3729
- var text = html.replace(tagPattern, '');
3730
-
3731
- // decode known entities
3732
- text = text.replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi, function (m, code) {
3733
- code = code.toLowerCase();
3734
-
3735
- if (code[0] === '#') {
3736
- var value;
3737
- if (code[1] === 'x') {
3738
- value = parseInt(code.slice(2), 16);
3739
- } else {
3740
- value = Number(code.slice(1));
3741
- }
3742
-
3743
- return fromCodePoint(value);
3744
- } else {
3745
- var known = KNOWN_ENTITY_NAMES[code];
3746
- if (known) {
3747
- return known;
3748
- }
3749
-
3750
- // unable to decode
3751
- return m;
3752
- }
3753
- });
3754
-
3755
- return text;
3756
- }
3757
-
3758
- Prism.languages.md = Prism.languages.markdown;
3759
-
3760
- }(Prism));
3761
-
3762
- Prism.languages.markup = {
3763
- 'comment': {
3764
- pattern: /<!--(?:(?!<!--)[\s\S])*?-->/,
3765
- greedy: true
3766
- },
3767
- 'prolog': {
3768
- pattern: /<\?[\s\S]+?\?>/,
3769
- greedy: true
3770
- },
3771
- 'doctype': {
3772
- // https://www.w3.org/TR/xml/#NT-doctypedecl
3773
- pattern: /<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,
3774
- greedy: true,
3775
- inside: {
3776
- 'internal-subset': {
3777
- pattern: /(^[^\[]*\[)[\s\S]+(?=\]>$)/,
3778
- lookbehind: true,
3779
- greedy: true,
3780
- inside: null // see below
3781
- },
3782
- 'string': {
3783
- pattern: /"[^"]*"|'[^']*'/,
3784
- greedy: true
3785
- },
3786
- 'punctuation': /^<!|>$|[[\]]/,
3787
- 'doctype-tag': /^DOCTYPE/i,
3788
- 'name': /[^\s<>'"]+/
3789
- }
3790
- },
3791
- 'cdata': {
3792
- pattern: /<!\[CDATA\[[\s\S]*?\]\]>/i,
3793
- greedy: true
3794
- },
3795
- 'tag': {
3796
- pattern: /<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,
3797
- greedy: true,
3798
- inside: {
3799
- 'tag': {
3800
- pattern: /^<\/?[^\s>\/]+/,
3801
- inside: {
3802
- 'punctuation': /^<\/?/,
3803
- 'namespace': /^[^\s>\/:]+:/
3804
- }
3805
- },
3806
- 'special-attr': [],
3807
- 'attr-value': {
3808
- pattern: /=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,
3809
- inside: {
3810
- 'punctuation': [
3811
- {
3812
- pattern: /^=/,
3813
- alias: 'attr-equals'
3814
- },
3815
- {
3816
- pattern: /^(\s*)["']|["']$/,
3817
- lookbehind: true
3818
- }
3819
- ]
3820
- }
3821
- },
3822
- 'punctuation': /\/?>/,
3823
- 'attr-name': {
3824
- pattern: /[^\s>\/]+/,
3825
- inside: {
3826
- 'namespace': /^[^\s>\/:]+:/
3827
- }
3828
- }
3829
-
3830
- }
3831
- },
3832
- 'entity': [
3833
- {
3834
- pattern: /&[\da-z]{1,8};/i,
3835
- alias: 'named-entity'
3836
- },
3837
- /&#x?[\da-f]{1,8};/i
3838
- ]
3839
- };
3840
-
3841
- Prism.languages.markup['tag'].inside['attr-value'].inside['entity'] =
3842
- Prism.languages.markup['entity'];
3843
- Prism.languages.markup['doctype'].inside['internal-subset'].inside = Prism.languages.markup;
3844
-
3845
- // Plugin to make entity title show the real entity, idea by Roman Komarov
3846
- Prism.hooks.add('wrap', function (env) {
3847
-
3848
- if (env.type === 'entity') {
3849
- env.attributes['title'] = env.content.replace(/&amp;/, '&');
3850
- }
3851
- });
3852
-
3853
- Object.defineProperty(Prism.languages.markup.tag, 'addInlined', {
3854
- /**
3855
- * Adds an inlined language to markup.
3856
- *
3857
- * An example of an inlined language is CSS with `<style>` tags.
3858
- *
3859
- * @param {string} tagName The name of the tag that contains the inlined language. This name will be treated as
3860
- * case insensitive.
3861
- * @param {string} lang The language key.
3862
- * @example
3863
- * addInlined('style', 'css');
3864
- */
3865
- value: function addInlined(tagName, lang) {
3866
- var includedCdataInside = {};
3867
- includedCdataInside['language-' + lang] = {
3868
- pattern: /(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,
3869
- lookbehind: true,
3870
- inside: Prism.languages[lang]
3871
- };
3872
- includedCdataInside['cdata'] = /^<!\[CDATA\[|\]\]>$/i;
3873
-
3874
- var inside = {
3875
- 'included-cdata': {
3876
- pattern: /<!\[CDATA\[[\s\S]*?\]\]>/i,
3877
- inside: includedCdataInside
3878
- }
3879
- };
3880
- inside['language-' + lang] = {
3881
- pattern: /[\s\S]+/,
3882
- inside: Prism.languages[lang]
3883
- };
3884
-
3885
- var def = {};
3886
- def[tagName] = {
3887
- pattern: RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g, function () { return tagName; }), 'i'),
3888
- lookbehind: true,
3889
- greedy: true,
3890
- inside: inside
3891
- };
3892
-
3893
- Prism.languages.insertBefore('markup', 'cdata', def);
3894
- }
3895
- });
3896
- Object.defineProperty(Prism.languages.markup.tag, 'addAttribute', {
3897
- /**
3898
- * Adds an pattern to highlight languages embedded in HTML attributes.
3899
- *
3900
- * An example of an inlined language is CSS with `style` attributes.
3901
- *
3902
- * @param {string} attrName The name of the tag that contains the inlined language. This name will be treated as
3903
- * case insensitive.
3904
- * @param {string} lang The language key.
3905
- * @example
3906
- * addAttribute('style', 'css');
3907
- */
3908
- value: function (attrName, lang) {
3909
- Prism.languages.markup.tag.inside['special-attr'].push({
3910
- pattern: RegExp(
3911
- /(^|["'\s])/.source + '(?:' + attrName + ')' + /\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,
3912
- 'i'
3913
- ),
3914
- lookbehind: true,
3915
- inside: {
3916
- 'attr-name': /^[^\s=]+/,
3917
- 'attr-value': {
3918
- pattern: /=[\s\S]+/,
3919
- inside: {
3920
- 'value': {
3921
- pattern: /(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,
3922
- lookbehind: true,
3923
- alias: [lang, 'language-' + lang],
3924
- inside: Prism.languages[lang]
3925
- },
3926
- 'punctuation': [
3927
- {
3928
- pattern: /^=/,
3929
- alias: 'attr-equals'
3930
- },
3931
- /"|'/
3932
- ]
3933
- }
3934
- }
3935
- }
3936
- });
3937
- }
3938
- });
3939
-
3940
- Prism.languages.html = Prism.languages.markup;
3941
- Prism.languages.mathml = Prism.languages.markup;
3942
- Prism.languages.svg = Prism.languages.markup;
3943
-
3944
- Prism.languages.xml = Prism.languages.extend('markup', {});
3945
- Prism.languages.ssml = Prism.languages.xml;
3946
- Prism.languages.atom = Prism.languages.xml;
3947
- Prism.languages.rss = Prism.languages.xml;
3948
-
3949
- var prismPython = {};
3950
-
3951
- var hasRequiredPrismPython;
3952
-
3953
- function requirePrismPython () {
3954
- if (hasRequiredPrismPython) return prismPython;
3955
- hasRequiredPrismPython = 1;
3956
- Prism.languages.python = {
3957
- 'comment': {
3958
- pattern: /(^|[^\\])#.*/,
3959
- lookbehind: true,
3960
- greedy: true
3961
- },
3962
- 'string-interpolation': {
3963
- pattern: /(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,
3964
- greedy: true,
3965
- inside: {
3966
- 'interpolation': {
3967
- // "{" <expression> <optional "!s", "!r", or "!a"> <optional ":" format specifier> "}"
3968
- pattern: /((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,
3969
- lookbehind: true,
3970
- inside: {
3971
- 'format-spec': {
3972
- pattern: /(:)[^:(){}]+(?=\}$)/,
3973
- lookbehind: true
3974
- },
3975
- 'conversion-option': {
3976
- pattern: /![sra](?=[:}]$)/,
3977
- alias: 'punctuation'
3978
- },
3979
- rest: null
3980
- }
3981
- },
3982
- 'string': /[\s\S]+/
3983
- }
3984
- },
3985
- 'triple-quoted-string': {
3986
- pattern: /(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,
3987
- greedy: true,
3988
- alias: 'string'
3989
- },
3990
- 'string': {
3991
- pattern: /(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,
3992
- greedy: true
3993
- },
3994
- 'function': {
3995
- pattern: /((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,
3996
- lookbehind: true
3997
- },
3998
- 'class-name': {
3999
- pattern: /(\bclass\s+)\w+/i,
4000
- lookbehind: true
4001
- },
4002
- 'decorator': {
4003
- pattern: /(^[\t ]*)@\w+(?:\.\w+)*/m,
4004
- lookbehind: true,
4005
- alias: ['annotation', 'punctuation'],
4006
- inside: {
4007
- 'punctuation': /\./
4008
- }
4009
- },
4010
- 'keyword': /\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,
4011
- 'builtin': /\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,
4012
- 'boolean': /\b(?:False|None|True)\b/,
4013
- 'number': /\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,
4014
- 'operator': /[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,
4015
- 'punctuation': /[{}[\];(),.:]/
4016
- };
4017
-
4018
- Prism.languages.python['string-interpolation'].inside['interpolation'].inside.rest = Prism.languages.python;
4019
-
4020
- Prism.languages.py = Prism.languages.python;
4021
- return prismPython;
4022
- }
4023
-
4024
- requirePrismPython();
4025
-
4026
- Prism.languages.sql = {
4027
- 'comment': {
4028
- pattern: /(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,
4029
- lookbehind: true
4030
- },
4031
- 'variable': [
4032
- {
4033
- pattern: /@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,
4034
- greedy: true
4035
- },
4036
- /@[\w.$]+/
4037
- ],
4038
- 'string': {
4039
- pattern: /(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,
4040
- greedy: true,
4041
- lookbehind: true
4042
- },
4043
- 'identifier': {
4044
- pattern: /(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,
4045
- greedy: true,
4046
- lookbehind: true,
4047
- inside: {
4048
- 'punctuation': /^`|`$/
4049
- }
4050
- },
4051
- 'function': /\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i, // Should we highlight user defined functions too?
4052
- 'keyword': /\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,
4053
- 'boolean': /\b(?:FALSE|NULL|TRUE)\b/i,
4054
- 'number': /\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,
4055
- 'operator': /[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,
4056
- 'punctuation': /[;[\]()`,.]/
4057
- };
4058
-
4059
- (function (Prism) {
4060
-
4061
- // https://yaml.org/spec/1.2/spec.html#c-ns-anchor-property
4062
- // https://yaml.org/spec/1.2/spec.html#c-ns-alias-node
4063
- var anchorOrAlias = /[*&][^\s[\]{},]+/;
4064
- // https://yaml.org/spec/1.2/spec.html#c-ns-tag-property
4065
- var tag = /!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/;
4066
- // https://yaml.org/spec/1.2/spec.html#c-ns-properties(n,c)
4067
- var properties = '(?:' + tag.source + '(?:[ \t]+' + anchorOrAlias.source + ')?|'
4068
- + anchorOrAlias.source + '(?:[ \t]+' + tag.source + ')?)';
4069
- // https://yaml.org/spec/1.2/spec.html#ns-plain(n,c)
4070
- // This is a simplified version that doesn't support "#" and multiline keys
4071
- // All these long scarry character classes are simplified versions of YAML's characters
4072
- var plainKey = /(?:[^\s\x00-\x08\x0e-\x1f!"#%&'*,\-:>?@[\]`{|}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]|[?:-]<PLAIN>)(?:[ \t]*(?:(?![#:])<PLAIN>|:<PLAIN>))*/.source
4073
- .replace(/<PLAIN>/g, function () { return /[^\s\x00-\x08\x0e-\x1f,[\]{}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]/.source; });
4074
- var string = /"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;
4075
-
4076
- /**
4077
- *
4078
- * @param {string} value
4079
- * @param {string} [flags]
4080
- * @returns {RegExp}
4081
- */
4082
- function createValuePattern(value, flags) {
4083
- flags = (flags || '').replace(/m/g, '') + 'm'; // add m flag
4084
- var pattern = /([:\-,[{]\s*(?:\s<<prop>>[ \t]+)?)(?:<<value>>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source
4085
- .replace(/<<prop>>/g, function () { return properties; }).replace(/<<value>>/g, function () { return value; });
4086
- return RegExp(pattern, flags);
4087
- }
4088
-
4089
- Prism.languages.yaml = {
4090
- 'scalar': {
4091
- pattern: RegExp(/([\-:]\s*(?:\s<<prop>>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\S[^\r\n]*(?:\2[^\r\n]+)*)/.source
4092
- .replace(/<<prop>>/g, function () { return properties; })),
4093
- lookbehind: true,
4094
- alias: 'string'
4095
- },
4096
- 'comment': /#.*/,
4097
- 'key': {
4098
- pattern: RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<<prop>>[ \t]+)?)<<key>>(?=\s*:\s)/.source
4099
- .replace(/<<prop>>/g, function () { return properties; })
4100
- .replace(/<<key>>/g, function () { return '(?:' + plainKey + '|' + string + ')'; })),
4101
- lookbehind: true,
4102
- greedy: true,
4103
- alias: 'atrule'
4104
- },
4105
- 'directive': {
4106
- pattern: /(^[ \t]*)%.+/m,
4107
- lookbehind: true,
4108
- alias: 'important'
4109
- },
4110
- 'datetime': {
4111
- pattern: createValuePattern(/\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?))?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?/.source),
4112
- lookbehind: true,
4113
- alias: 'number'
4114
- },
4115
- 'boolean': {
4116
- pattern: createValuePattern(/false|true/.source, 'i'),
4117
- lookbehind: true,
4118
- alias: 'important'
4119
- },
4120
- 'null': {
4121
- pattern: createValuePattern(/null|~/.source, 'i'),
4122
- lookbehind: true,
4123
- alias: 'important'
4124
- },
4125
- 'string': {
4126
- pattern: createValuePattern(string),
4127
- lookbehind: true,
4128
- greedy: true
4129
- },
4130
- 'number': {
4131
- pattern: createValuePattern(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source, 'i'),
4132
- lookbehind: true
4133
- },
4134
- 'tag': tag,
4135
- 'important': anchorOrAlias,
4136
- 'punctuation': /---|[:[\]{}\-,|>?]|\.\.\./
4137
- };
4138
-
4139
- Prism.languages.yml = Prism.languages.yaml;
4140
-
4141
- }(Prism));
4142
-
4143
- function styleInject(css, ref) {
4144
- if ( ref === void 0 ) ref = {};
4145
- var insertAt = ref.insertAt;
4146
-
4147
- if (typeof document === 'undefined') { return; }
4148
-
4149
- var head = document.head || document.getElementsByTagName('head')[0];
4150
- var style = document.createElement('style');
4151
- style.type = 'text/css';
4152
-
4153
- if (insertAt === 'top') {
4154
- if (head.firstChild) {
4155
- head.insertBefore(style, head.firstChild);
4156
- } else {
4157
- head.appendChild(style);
4158
- }
4159
- } else {
4160
- head.appendChild(style);
4161
- }
4162
-
4163
- if (style.styleSheet) {
4164
- style.styleSheet.cssText = css;
4165
- } else {
4166
- style.appendChild(document.createTextNode(css));
4167
- }
4168
- }
4169
-
4170
- var css_248z = "code[class*=language-],pre[class*=language-]{word-wrap:normal;background:none;color:#ccc;font-family:Consolas,Monaco,Andale Mono,Ubuntu Mono,monospace;font-size:1em;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4;text-align:left;white-space:pre;word-break:normal;word-spacing:normal}pre[class*=language-]{margin:.5em 0;overflow:auto;padding:1em}:not(pre)>code[class*=language-],pre[class*=language-]{background:#2d2d2d}:not(pre)>code[class*=language-]{border-radius:.3em;padding:.1em;white-space:normal}.prism-tomorrow_token__KrW-C.prism-tomorrow_block-comment__fmeiG,.prism-tomorrow_token__KrW-C.prism-tomorrow_cdata__gaM1U,.prism-tomorrow_token__KrW-C.prism-tomorrow_comment__MpEjR,.prism-tomorrow_token__KrW-C.prism-tomorrow_doctype__34yKK,.prism-tomorrow_token__KrW-C.prism-tomorrow_prolog__2XDAA{color:#999}.prism-tomorrow_token__KrW-C.prism-tomorrow_punctuation__GT4Hh{color:#ccc}.prism-tomorrow_token__KrW-C.prism-tomorrow_attr-name__RiyBx,.prism-tomorrow_token__KrW-C.prism-tomorrow_deleted__fbS8t,.prism-tomorrow_token__KrW-C.prism-tomorrow_namespace__LDKlc,.prism-tomorrow_token__KrW-C.prism-tomorrow_tag__wwC6b{color:#e2777a}.prism-tomorrow_token__KrW-C.prism-tomorrow_function-name__rqSQu{color:#6196cc}.prism-tomorrow_token__KrW-C.prism-tomorrow_boolean__6L25S,.prism-tomorrow_token__KrW-C.prism-tomorrow_function__VtlZD,.prism-tomorrow_token__KrW-C.prism-tomorrow_number__Z59SX{color:#f08d49}.prism-tomorrow_token__KrW-C.prism-tomorrow_class-name__QD5Je,.prism-tomorrow_token__KrW-C.prism-tomorrow_constant__UpgQc,.prism-tomorrow_token__KrW-C.prism-tomorrow_property__PI46C,.prism-tomorrow_token__KrW-C.prism-tomorrow_symbol__MsngS{color:#f8c555}.prism-tomorrow_token__KrW-C.prism-tomorrow_atrule__dQpZ0,.prism-tomorrow_token__KrW-C.prism-tomorrow_builtin__PtyR-,.prism-tomorrow_token__KrW-C.prism-tomorrow_important__utoFb,.prism-tomorrow_token__KrW-C.prism-tomorrow_keyword__08y7S,.prism-tomorrow_token__KrW-C.prism-tomorrow_selector__2Nh-h{color:#cc99cd}.prism-tomorrow_token__KrW-C.prism-tomorrow_attr-value__BBClg,.prism-tomorrow_token__KrW-C.prism-tomorrow_char__mbFhI,.prism-tomorrow_token__KrW-C.prism-tomorrow_regex__iN-NT,.prism-tomorrow_token__KrW-C.prism-tomorrow_string__0zO2B,.prism-tomorrow_token__KrW-C.prism-tomorrow_variable__jgQen{color:#7ec699}.prism-tomorrow_token__KrW-C.prism-tomorrow_entity__Mfep8,.prism-tomorrow_token__KrW-C.prism-tomorrow_operator__roMFP,.prism-tomorrow_token__KrW-C.prism-tomorrow_url__Arvav{color:#67cdcc}.prism-tomorrow_token__KrW-C.prism-tomorrow_bold__uoby2,.prism-tomorrow_token__KrW-C.prism-tomorrow_important__utoFb{font-weight:700}.prism-tomorrow_token__KrW-C.prism-tomorrow_italic__OOrET{font-style:italic}.prism-tomorrow_token__KrW-C.prism-tomorrow_entity__Mfep8{cursor:help}.prism-tomorrow_token__KrW-C.prism-tomorrow_inserted__U8Old{color:green}";
4171
- styleInject(css_248z);
4172
-
4173
453
  var theme = {
4174
454
  plain: {
4175
455
  color: "#e2e8f0",
@@ -4225,9 +505,8 @@ var theme = {
4225
505
  };
4226
506
 
4227
507
  var CodeBlock = function CodeBlock(_a) {
4228
- var inline = _a.inline;
4229
- _a.className;
4230
- var language = _a.language,
508
+ var inline = _a.inline,
509
+ language = _a.language,
4231
510
  children = _a.children,
4232
511
  rest = __rest(_a, ["inline", "className", "language", "children"]);
4233
512
  var _b = useState(false),
@@ -4246,47 +525,47 @@ var CodeBlock = function CodeBlock(_a) {
4246
525
  return (
4247
526
  /*#__PURE__*/
4248
527
  // Small inline code block, that should be used in a sentence
4249
- React$1.createElement("code", _extends({
528
+ React.createElement("code", _extends({
4250
529
  className: "bg-stone-800 text-white p-1 rounded"
4251
530
  }, rest), children)
4252
531
  );
4253
532
  }
4254
- return /*#__PURE__*/React$1.createElement("div", {
533
+ return /*#__PURE__*/React.createElement("div", {
4255
534
  className: "group relative mt-4"
4256
- }, /*#__PURE__*/React$1.createElement("div", {
535
+ }, /*#__PURE__*/React.createElement("div", {
4257
536
  className: "absolute right-4 top-4 z-10"
4258
- }, /*#__PURE__*/React$1.createElement("button", {
537
+ }, /*#__PURE__*/React.createElement("button", {
4259
538
  onClick: onCopy,
4260
539
  className: cn("flex items-center space-x-1 rounded-md px-2 py-1 text-xs", "bg-gray-700/50 text-gray-300 transition-colors", "hover:bg-gray-600/50 hover:text-gray-200")
4261
- }, copied ? /*#__PURE__*/React$1.createElement(React$1.Fragment, null, /*#__PURE__*/React$1.createElement(Check, {
540
+ }, copied ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Check, {
4262
541
  className: "h-3 w-3"
4263
- }), /*#__PURE__*/React$1.createElement("span", null, "Copied!")) : /*#__PURE__*/React$1.createElement(React$1.Fragment, null, /*#__PURE__*/React$1.createElement(Copy, {
542
+ }), /*#__PURE__*/React.createElement("span", null, "Copied!")) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Copy, {
4264
543
  className: "h-3 w-3"
4265
- }), /*#__PURE__*/React$1.createElement("span", null, "Copy")))), /*#__PURE__*/React$1.createElement(Highlight, {
544
+ }), /*#__PURE__*/React.createElement("span", null, "Copy")))), /*#__PURE__*/React.createElement(Highlight, {
4266
545
  code: children.trim(),
4267
546
  language: language === "tsx" ? "jsx" : language,
4268
547
  theme: theme,
4269
- prism: Prism$1
548
+ prism: Prism
4270
549
  }, function (_a) {
4271
550
  var className = _a.className,
4272
551
  style = _a.style,
4273
552
  tokens = _a.tokens,
4274
553
  getLineProps = _a.getLineProps,
4275
554
  getTokenProps = _a.getTokenProps;
4276
- return /*#__PURE__*/React$1.createElement("pre", {
555
+ return /*#__PURE__*/React.createElement("pre", {
4277
556
  className: cn("overflow-x-auto rounded-3xl p-4 text-sm leading-6", "bg-gray-800/80 backdrop-blur-xl", "border border-gray-700/50", className),
4278
557
  style: style
4279
- }, /*#__PURE__*/React$1.createElement("code", {
558
+ }, /*#__PURE__*/React.createElement("code", {
4280
559
  className: "inline-block min-w-full"
4281
560
  }, tokens.map(function (line, i) {
4282
- return /*#__PURE__*/React$1.createElement("div", _extends({
561
+ return /*#__PURE__*/React.createElement("div", _extends({
4283
562
  key: i
4284
563
  }, getLineProps({
4285
564
  line: line
4286
- })), /*#__PURE__*/React$1.createElement("span", {
565
+ })), /*#__PURE__*/React.createElement("span", {
4287
566
  className: "mr-4 inline-block w-4 text-right text-gray-500 select-none"
4288
567
  }, i + 1), line.map(function (token, key) {
4289
- return /*#__PURE__*/React$1.createElement("span", _extends({
568
+ return /*#__PURE__*/React.createElement("span", _extends({
4290
569
  key: key
4291
570
  }, getTokenProps({
4292
571
  token: token
@@ -4301,8 +580,7 @@ var Markdown = function Markdown(_a) {
4301
580
  return /*#__PURE__*/React.createElement(ReactMarkdown, {
4302
581
  components: {
4303
582
  code: function code(_a) {
4304
- _a.node;
4305
- var inline = _a.inline,
583
+ var inline = _a.inline,
4306
584
  className = _a.className,
4307
585
  children = _a.children;
4308
586
  __rest(_a, ["node", "inline", "className", "children"]);
@@ -4465,4 +743,3 @@ var Table = function Table(_a) {
4465
743
  };
4466
744
 
4467
745
  export { ActionButton, Alert, Avatar, Badge, Card, Dropdown, Input, Markdown, Modal, Search, Skeleton, Spinner, Switch, TabGroup, Table, Textarea, Tooltip };
4468
- //# sourceMappingURL=index.esm.js.map