@carbonplan/components 11.1.3 → 11.1.4-develop.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2874 +1,2 @@
1
- import React, { forwardRef, cloneElement, useRef, useState, useEffect, useCallback } from 'react';
2
- import { Box, Link as Link$2, Flex, Grid, IconButton, Container, useColorMode, useThemeUI, Text, Styled, Input as Input$1, Slider as Slider$1 } from 'theme-ui';
3
- import { transparentize } from '@theme-ui/color';
4
- import NextLink from 'next/link';
5
- import { Arrow, Sun } from '@carbonplan/icons';
6
- import { PoopSad } from '@carbonplan/emoji';
7
- import Head from 'next/head';
8
- import { keyframes } from '@emotion/react';
9
-
10
- function _extends() {
11
- _extends = Object.assign || function (target) {
12
- for (var i = 1; i < arguments.length; i++) {
13
- var source = arguments[i];
14
-
15
- for (var key in source) {
16
- if (Object.prototype.hasOwnProperty.call(source, key)) {
17
- target[key] = source[key];
18
- }
19
- }
20
- }
21
-
22
- return target;
23
- };
24
-
25
- return _extends.apply(this, arguments);
26
- }
27
-
28
- function _objectWithoutPropertiesLoose(source, excluded) {
29
- if (source == null) return {};
30
- var target = {};
31
- var sourceKeys = Object.keys(source);
32
- var key, i;
33
-
34
- for (i = 0; i < sourceKeys.length; i++) {
35
- key = sourceKeys[i];
36
- if (excluded.indexOf(key) >= 0) continue;
37
- target[key] = source[key];
38
- }
39
-
40
- return target;
41
- }
42
-
43
- const _excluded$g = ["sx", "children"];
44
-
45
- const Badge = _ref => {
46
- let {
47
- sx,
48
- children
49
- } = _ref,
50
- props = _objectWithoutPropertiesLoose(_ref, _excluded$g);
51
-
52
- const color = sx && sx.color ? sx.color : 'primary';
53
- return /*#__PURE__*/React.createElement(Box, _extends({
54
- sx: _extends({
55
- display: 'inline-block',
56
- width: 'fit-content',
57
- height: ['24px', '24px', '24px', '26px'],
58
- borderRadius: '5px',
59
- backgroundColor: color == 'primary' || color == 'secondary' ? 'muted' : transparentize(color, 0.7),
60
- textAlign: 'center',
61
- userSelect: 'none',
62
- fontSize: [2, 2, 2, 3]
63
- }, sx)
64
- }, props), /*#__PURE__*/React.createElement(Box, {
65
- sx: {
66
- letterSpacing: '0.02em',
67
- fontFamily: 'mono',
68
- mt: ['1px', '1px', '1px', '0px'],
69
- px: [1, 1, 1, '5px'],
70
- color: color
71
- }
72
- }, children));
73
- };
74
-
75
- const _excluded$f = ["href", "children", "internal", "tracking"];
76
-
77
- const event = ({
78
- action,
79
- category,
80
- label,
81
- value
82
- }) => {
83
- if (typeof window.gtag !== 'function') {
84
- console.warn(`Missing window.gtag, skipping analytics action: '${action}'.`);
85
- return;
86
- }
87
-
88
- window.gtag('event', action, {
89
- event_category: category,
90
- event_label: label,
91
- value: value
92
- });
93
- };
94
-
95
- const Link = (_ref, ref) => {
96
- let {
97
- href,
98
- children,
99
- internal = false,
100
- tracking = false
101
- } = _ref,
102
- props = _objectWithoutPropertiesLoose(_ref, _excluded$f);
103
-
104
- if (internal || href && href.startsWith('/')) {
105
- return /*#__PURE__*/React.createElement(NextLink, {
106
- href: href,
107
- passHref: true
108
- }, /*#__PURE__*/React.createElement(Link$2, _extends({
109
- ref: ref
110
- }, props), children));
111
- } else if (tracking) {
112
- let action;
113
- let category;
114
-
115
- if (href && href.includes('pdf')) {
116
- action = 'PDF';
117
- category = 'download';
118
- } else {
119
- action = 'website';
120
- category = 'external';
121
- }
122
-
123
- const track = e => {
124
- event({
125
- action: action,
126
- category: category,
127
- label: href
128
- });
129
- };
130
-
131
- return /*#__PURE__*/React.createElement(Link$2, _extends({
132
- ref: ref,
133
- onClick: track,
134
- onContextMenu: track,
135
- href: href
136
- }, props), children);
137
- } else {
138
- return /*#__PURE__*/React.createElement(Link$2, _extends({
139
- ref: ref,
140
- href: href
141
- }, props), children);
142
- }
143
- };
144
-
145
- var Link$1 = forwardRef(Link);
146
-
147
- const getSizeStyles = size => {
148
- if (!['xs', 'sm', 'md', 'lg', 'xl'].includes(size)) {
149
- throw new Error('Size must be xs, sm, md, lg, or xl');
150
- }
151
-
152
- let fontSize, fontFamily, letterSpacing, lineHeight;
153
-
154
- if (size === 'xs') {
155
- fontSize = [2, 2, 2, 3];
156
- fontFamily = 'body';
157
- letterSpacing = 'body';
158
- lineHeight = [1.2];
159
- }
160
-
161
- if (size === 'sm') {
162
- fontSize = [3, 3, 3, 4];
163
- fontFamily = 'body';
164
- letterSpacing = 'body';
165
- lineHeight = [1.2];
166
- }
167
-
168
- if (size === 'md') {
169
- fontSize = [4, 4, 4, 5];
170
- fontFamily = 'body';
171
- letterSpacing = 'body';
172
- lineHeight = [1.2];
173
- }
174
-
175
- if (size === 'lg') {
176
- fontSize = [5, 5, 6, 7];
177
- fontFamily = 'heading';
178
- letterSpacing = 'heading';
179
- lineHeight = [1.2, 1.2, 1.25, 1.25];
180
- }
181
-
182
- if (size === 'xl') {
183
- fontSize = [6, 7, 8, 9];
184
- fontFamily = 'heading';
185
- letterSpacing = 'heading';
186
- lineHeight = [1.25];
187
- }
188
-
189
- return {
190
- fontSize,
191
- fontFamily,
192
- letterSpacing,
193
- lineHeight
194
- };
195
- };
196
-
197
- const _excluded$e = ["size", "prefix", "suffix", "inverted", "sx", "children", "align", "href", "internal", "tracking"];
198
-
199
- const Button = (_ref, ref) => {
200
- let {
201
- size = 'sm',
202
- prefix,
203
- suffix,
204
- inverted,
205
- sx,
206
- children,
207
- align,
208
- href,
209
- internal,
210
- tracking
211
- } = _ref,
212
- props = _objectWithoutPropertiesLoose(_ref, _excluded$e);
213
-
214
- if (!['xs', 'sm', 'md', 'lg', 'xl'].includes(size)) {
215
- throw new Error('Size must be xs, sm, md, lg, or xl');
216
- }
217
-
218
- let offset, margin, height, width, strokeWidth;
219
- const color = sx && sx.color ? sx.color : null;
220
- const baseColor = color || (inverted ? 'secondary' : 'primary');
221
- const hoverColor = color ? 'primary' : inverted ? 'primary' : 'secondary';
222
-
223
- if (size === 'xs') {
224
- margin = ['6px', '6px', '6px', '6px'];
225
- height = [12, 12, 12, 13];
226
- width = [12, 12, 12, 13];
227
- strokeWidth = [1.5, 1.5, 1.5, 1.5];
228
- offset = {
229
- transform: 'translateY(0.25px)'
230
- };
231
- }
232
-
233
- if (size === 'sm') {
234
- margin = ['7px', '7px', '7px', '7px'];
235
- height = [13, 13, 13, 18];
236
- width = [13, 13, 13, 18];
237
- strokeWidth = [1.5, 1.5, 1.5, 2];
238
- offset = {
239
- transform: 'translateY(0.25px)'
240
- };
241
- }
242
-
243
- if (size === 'md') {
244
- margin = ['8px', '8px', '8px', '8px'];
245
- height = [18, 18, 18, 24];
246
- width = [18, 18, 18, 24];
247
- strokeWidth = [2, 2, 2, 3];
248
- }
249
-
250
- if (size === 'lg') {
251
- margin = ['10px', '10px', '12px', '16px'];
252
- height = [24, 24, 34, 46];
253
- width = [24, 24, 34, 46];
254
- strokeWidth = [3, 3, 4, 5];
255
- }
256
-
257
- if (size === 'xl') {
258
- margin = ['12px', '16px', '18px', '20px'];
259
- height = [34, 46, 56, 68];
260
- width = [34, 46, 56, 68];
261
- strokeWidth = [4, 5, 6, 7];
262
- }
263
-
264
- let prefixHover, suffixHover, prefixAlign, suffixAlign, prefixOffset, suffixOffset;
265
-
266
- if (align) {
267
- prefixAlign = align;
268
- suffixAlign = align;
269
- } else {
270
- if (prefix && suffix) {
271
- prefixAlign = 'initial';
272
- suffixAlign = 'initial';
273
- } else if (prefix) {
274
- prefixAlign = 'initial';
275
- } else if (suffix) {
276
- suffixAlign = 'middle';
277
- }
278
- }
279
-
280
- if (prefixAlign === 'middle') {
281
- prefixOffset = {};
282
- } else {
283
- prefixOffset = offset;
284
- }
285
-
286
- if (suffixAlign === 'middle') {
287
- suffixOffset = {};
288
- } else {
289
- suffixOffset = offset;
290
- }
291
-
292
- if (prefix) {
293
- prefixHover = {
294
- '&:hover > #prefix-span > #prefix': _extends({
295
- color: hoverColor
296
- }, prefix.type.hover)
297
- };
298
- prefix = cloneElement(prefix, {
299
- id: 'prefix',
300
- sx: _extends({
301
- position: 'relative',
302
- height: height,
303
- width: width,
304
- mr: children ? margin : [0],
305
- strokeWidth: strokeWidth,
306
- verticalAlign: prefixAlign,
307
- transition: 'color 0.15s, transform 0.15s'
308
- }, prefix.props.sx)
309
- });
310
- }
311
-
312
- if (suffix) {
313
- suffixHover = {
314
- '&:hover > #suffix-span >#suffix': _extends({
315
- color: hoverColor
316
- }, suffix.type.hover)
317
- };
318
- suffix = cloneElement(suffix, {
319
- id: 'suffix',
320
- sx: _extends({
321
- height: height,
322
- width: width,
323
- ml: children ? margin : [0],
324
- strokeWidth: strokeWidth,
325
- verticalAlign: suffixAlign,
326
- transition: 'color 0.15s, transform 0.15s'
327
- }, suffix.props.sx)
328
- });
329
- }
330
-
331
- let sizeStyles = getSizeStyles(size);
332
-
333
- const style = _extends({}, sizeStyles, {
334
- lineHeight: 1.05,
335
- border: 'none',
336
- background: 'transparent',
337
- display: 'block',
338
- color: baseColor,
339
- padding: [0],
340
- textAlign: 'left',
341
- cursor: 'pointer',
342
- width: 'fit-content',
343
- '@media (hover: hover) and (pointer: fine)': _extends({
344
- '&:hover': {
345
- color: hoverColor
346
- }
347
- }, suffixHover, prefixHover)
348
- }, sx);
349
-
350
- const Inner = /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Box, {
351
- as: "span",
352
- id: "prefix-span",
353
- sx: _extends({
354
- display: 'inline-block'
355
- }, prefixOffset)
356
- }, prefix && prefix), /*#__PURE__*/React.createElement(Box, {
357
- as: "span",
358
- sx: {
359
- transition: 'color 0.15s'
360
- }
361
- }, children), /*#__PURE__*/React.createElement(Box, {
362
- as: "span",
363
- id: "suffix-span",
364
- sx: _extends({
365
- display: 'inline-block'
366
- }, suffixOffset)
367
- }, suffix && suffix));
368
-
369
- if (href) {
370
- return /*#__PURE__*/React.createElement(Link$1, _extends({
371
- ref: ref,
372
- href: href,
373
- internal: internal,
374
- tracking: tracking,
375
- sx: _extends({}, style, {
376
- textDecoration: 'none'
377
- })
378
- }, props), Inner);
379
- } else {
380
- return /*#__PURE__*/React.createElement(Box, _extends({
381
- ref: ref,
382
- as: "button",
383
- sx: style
384
- }, props), Inner);
385
- }
386
- };
387
-
388
- var button = forwardRef(Button);
389
-
390
- const _excluded$d = ["label", "children", "inverted", "color", "href", "internal", "tracking", "sx"];
391
-
392
- const Callout = (_ref, ref) => {
393
- let {
394
- label,
395
- children,
396
- inverted,
397
- color,
398
- href,
399
- internal,
400
- tracking,
401
- sx
402
- } = _ref,
403
- props = _objectWithoutPropertiesLoose(_ref, _excluded$d);
404
-
405
- const baseColor = color || (inverted ? 'secondary' : 'primary');
406
- const hoverColor = color ? 'primary' : inverted ? 'primary' : 'secondary';
407
-
408
- const style = _extends({
409
- border: 'none',
410
- padding: [0],
411
- fontSize: [3, 3, 3, 4],
412
- color: baseColor,
413
- background: 'transparent',
414
- textDecoration: 'none',
415
- fontFamily: 'body',
416
- lineHeight: 'h3',
417
- letterSpacing: 'body',
418
- width: 'fit-content',
419
- cursor: 'pointer',
420
- textAlign: 'left',
421
- mb: [1],
422
- '@media (hover: hover) and (pointer: fine)': {
423
- '&:hover > #container > #arrow': {
424
- transform: 'rotate(45deg)',
425
- fill: hoverColor
426
- },
427
- '&:hover': {
428
- color: hoverColor
429
- }
430
- }
431
- }, sx);
432
-
433
- const Inner = /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Box, {
434
- sx: {
435
- transition: '0.15s',
436
- letterSpacing: 'body',
437
- pb: ['6px']
438
- }
439
- }, children), /*#__PURE__*/React.createElement(Box, {
440
- sx: {
441
- transition: '0.15s',
442
- display: 'inline-block',
443
- textTransform: 'uppercase',
444
- letterSpacing: 'smallcaps',
445
- fontFamily: 'heading',
446
- fontSize: [2, 2, 2, 3]
447
- }
448
- }, label), /*#__PURE__*/React.createElement(Box, {
449
- as: "span",
450
- id: "container",
451
- sx: {
452
- ml: [2],
453
- display: 'inline-block'
454
- }
455
- }, /*#__PURE__*/React.createElement(Arrow, {
456
- id: "arrow",
457
- sx: {
458
- transition: 'fill 0.15s, transform 0.15s',
459
- position: 'relative',
460
- top: ['2px'],
461
- color: baseColor,
462
- height: [15, 15, 15, 17],
463
- width: [15, 15, 15, 17]
464
- }
465
- })));
466
-
467
- if (href) {
468
- return /*#__PURE__*/React.createElement(Link$1, _extends({
469
- ref: ref,
470
- href: href,
471
- internal: internal,
472
- tracking: tracking,
473
- sx: style
474
- }, props), Inner);
475
- } else {
476
- return /*#__PURE__*/React.createElement(Box, _extends({
477
- ref: ref,
478
- as: "button",
479
- sx: style
480
- }, props), Inner);
481
- }
482
- };
483
-
484
- var callout = forwardRef(Callout);
485
-
486
- const _excluded$c = ["colormap", "label", "clim", "setClim", "setClimStep", "discrete", "units", "width", "height", "format", "horizontal", "bottom", "sx", "sxClim"];
487
- const styles$1 = {
488
- clim: setClim => {
489
- return {
490
- fontFamily: 'mono',
491
- fontSize: ['9px', 0, 0, 1],
492
- letterSpacing: 'smallcaps',
493
- textTransform: 'uppercase',
494
- '@media (hover: hover) and (pointer: fine)': {
495
- '&:hover': {
496
- borderBottom: setClim ? ({
497
- colors
498
- }) => `solid 1px ${colors.primary} !important` : 'unset'
499
- }
500
- },
501
- '&:focus': {
502
- outline: 'none',
503
- borderBottom: setClim ? ({
504
- colors
505
- }) => `solid 1px ${colors.primary} !important` : 'unset'
506
- },
507
- transition: 'border 0.15s',
508
- userSelect: setClim ? 'none !important' : 'unset',
509
- width: 'fit-content',
510
- minWidth: 'fit-content'
511
- };
512
- }
513
- };
514
- const DIMENSIONS = {
515
- width: ['10px', '16px', '16px', '17px'],
516
- height: ['80px', '110px', '110px', '130px']
517
- };
518
-
519
- const Gradient = ({
520
- colormap,
521
- discrete,
522
- horizontal,
523
- width,
524
- height
525
- }) => {
526
- const step = 1 / colormap.length * 100;
527
- const values = colormap.map((d, i) => {
528
- return `rgb(${d}) ${i * step}% ${discrete && i < colormap.length - 1 ? `${(i + 1) * step}%` : ''}`;
529
- });
530
- const css = `linear-gradient(to ${horizontal ? 'right' : 'top'}, ${values.join(',')})`;
531
- return /*#__PURE__*/React.createElement(Box, {
532
- sx: _extends({}, horizontal ? {
533
- width: width || DIMENSIONS.height,
534
- height: height || DIMENSIONS.width
535
- } : {
536
- width: width || DIMENSIONS.width,
537
- minHeight: height || DIMENSIONS.height
538
- }, {
539
- mt: horizontal ? ['1px', '1px', '1px', 0] : 0,
540
- border: ({
541
- colors
542
- }) => `solid 1px ${colors.hinted}`,
543
- background: css
544
- })
545
- });
546
- };
547
-
548
- const Label = ({
549
- label,
550
- units,
551
- horizontal
552
- }) => /*#__PURE__*/React.createElement(Box, {
553
- sx: !horizontal && {
554
- width: ['13px', '17px', '17px', '19px'],
555
- alignSelf: 'flex-end'
556
- }
557
- }, /*#__PURE__*/React.createElement(Box, {
558
- sx: _extends({
559
- mb: horizontal ? 0 : ['-4px', '-4px', '-4px', '-3px'],
560
- fontFamily: 'mono',
561
- fontSize: ['9px', 0, 0, 1],
562
- letterSpacing: 'smallcaps',
563
- textTransform: 'uppercase'
564
- }, horizontal ? {} : {
565
- writingMode: 'vertical-rl',
566
- transform: 'rotate(180deg)',
567
- whiteSpace: 'nowrap',
568
- display: 'inline-block',
569
- overflow: 'visible'
570
- })
571
- }, label, ' ', /*#__PURE__*/React.createElement(Box, {
572
- as: "span",
573
- sx: {
574
- textTransform: 'none',
575
- color: 'secondary',
576
- display: 'inline-block'
577
- }
578
- }, units)));
579
-
580
- const Colorbar = _ref => {
581
- let {
582
- colormap,
583
- label,
584
- clim,
585
- setClim,
586
- setClimStep = 1,
587
- discrete,
588
- units,
589
- width,
590
- height,
591
- format = d => d,
592
- horizontal = false,
593
- bottom = false,
594
- sx,
595
- sxClim
596
- } = _ref,
597
- props = _objectWithoutPropertiesLoose(_ref, _excluded$c);
598
-
599
- if (!Array.isArray(colormap)) {
600
- throw new Error(`expected array for colormap, got '${colormap}'.`);
601
- }
602
-
603
- const climRef = [useRef(), useRef()];
604
- const [climMinDragging, setClimMinDragging] = useState(false);
605
- const [climMaxDragging, setClimMaxDragging] = useState(false);
606
- let x,
607
- y,
608
- dx,
609
- dy = 0;
610
- let id = null;
611
- let init = [0, 0];
612
- let scale = setClimStep;
613
-
614
- const draggingFunction = e => {
615
- if (id === 'min' && !climMinDragging) setClimMinDragging(true);
616
- if (id === 'max' && !climMaxDragging) setClimMaxDragging(true);
617
- dx = e.pageX - x;
618
- dy = e.pageY - y;
619
-
620
- if (horizontal) {
621
- if (id === 'min') setClim(prev => [Math.min(init[0] + dx * scale, init[1]), prev[1]]);
622
- if (id === 'max') setClim(prev => [prev[0], Math.max(init[1] + dx * scale, init[0])]);
623
- } else {
624
- if (id === 'min') setClim(prev => [Math.min(init[0] - dy * scale, init[1]), prev[1]]);
625
- if (id === 'max') setClim(prev => [prev[0], Math.max(init[1] - dy * scale, init[0])]);
626
- }
627
- };
628
-
629
- const handleMouseDown = e => {
630
- y = e.pageY;
631
- x = e.pageX;
632
- id = e.target.id;
633
- init = clim;
634
- document.body.setAttribute('style', horizontal ? 'cursor: ew-resize !important' : 'cursor: ns-resize !important');
635
- document.addEventListener('mousemove', draggingFunction);
636
-
637
- const updater = () => {
638
- document.body.setAttribute('style', 'cursor: unset');
639
- document.removeEventListener('mousemove', draggingFunction);
640
- window.removeEventListener('mouseup', updater);
641
- if (id === 'min') setClimMinDragging(false);
642
- if (id === 'max') setClimMaxDragging(false);
643
- };
644
-
645
- window.addEventListener('mouseup', updater);
646
- };
647
-
648
- const increment = e => {
649
- if (climRef[0].current === document.activeElement) {
650
- e.preventDefault();
651
- setClim(prev => [Math.min(prev[0] + scale, prev[1]), prev[1]]);
652
- climRef[0].current.focus();
653
- }
654
-
655
- if (climRef[1].current === document.activeElement) {
656
- e.preventDefault();
657
- setClim(prev => [prev[0], Math.max(prev[1] + scale, prev[0])]);
658
- climRef[1].current.focus();
659
- }
660
- };
661
-
662
- const decrement = e => {
663
- if (climRef[0].current === document.activeElement) {
664
- e.preventDefault();
665
- setClim(prev => [Math.min(prev[0] - scale, prev[1]), prev[1]]);
666
- climRef[0].current.focus();
667
- }
668
-
669
- if (climRef[1].current === document.activeElement) {
670
- e.preventDefault();
671
- setClim(prev => [prev[0], Math.max(prev[1] - scale, prev[0])]);
672
- climRef[1].current.focus();
673
- }
674
- };
675
-
676
- useEffect(() => {
677
- const listener = e => {
678
- if (['ArrowUp', 'ArrowRight'].includes(e.code) || ['ArrowUp', 'ArrowRight'].includes(e.key)) {
679
- increment(e);
680
- }
681
-
682
- if (['ArrowDown', 'ArrowLeft'].includes(e.code) || ['ArrowDown', 'ArrowLeft'].includes(e.key)) {
683
- decrement(e);
684
- }
685
- };
686
-
687
- window.addEventListener('keydown', listener);
688
- return () => {
689
- window.removeEventListener('keydown', listener);
690
- };
691
- }, [clim]);
692
-
693
- const ClimMin = () => {
694
- return /*#__PURE__*/React.createElement(Box, {
695
- id: "min",
696
- ref: climRef[0],
697
- tabIndex: 0,
698
- sx: _extends({}, styles$1.clim(setClim), {
699
- ml: label ? horizontal ? bottom ? '0px' : '10px' : ['2px', '1px', '1px', '2px'] : 0,
700
- mr: horizontal ? ['2px', '1px', '1px', '2px'] : 0,
701
- mb: horizontal ? 0 : ['-2px', '-2px', '-2px', '-3px'],
702
- borderBottom: setClim ? climMinDragging ? ({
703
- colors
704
- }) => `solid 1px ${colors.primary}` : ({
705
- colors
706
- }) => `solid 1px ${colors.secondary}` : 'unset',
707
- cursor: setClim ? horizontal ? 'ew-resize' : 'ns-resize' : 'default'
708
- }, sxClim),
709
- onMouseDown: setClim ? handleMouseDown : () => {},
710
- onClick: () => climRef[0].current.focus()
711
- }, format(clim[0]));
712
- };
713
-
714
- const ClimMax = () => {
715
- return /*#__PURE__*/React.createElement(Box, {
716
- id: "max",
717
- ref: climRef[1],
718
- tabIndex: 0,
719
- sx: _extends({}, styles$1.clim(setClim), {
720
- ml: horizontal ? ['2px', '1px', '1px', '2px'] : ['2px', '1px', '1px', '2px'],
721
- mt: horizontal ? 0 : ['-2px', '-3px', '-3px', '-3px'],
722
- borderBottom: setClim ? climMaxDragging ? ({
723
- colors
724
- }) => `solid 1px ${colors.primary}` : ({
725
- colors
726
- }) => `solid 1px ${colors.secondary}` : 'unset',
727
- cursor: setClim ? horizontal ? 'ew-resize' : 'ns-resize' : 'default'
728
- }, sxClim),
729
- onMouseDown: setClim ? handleMouseDown : () => {},
730
- onClick: () => climRef[1].current.focus()
731
- }, format(clim[1]));
732
- };
733
-
734
- return /*#__PURE__*/React.createElement(Flex, _extends({}, props, {
735
- sx: _extends({
736
- flexDirection: 'row',
737
- alignItems: 'start',
738
- justifyContent: 'flex-start',
739
- gap: ['3px', '6px', '6px', '7px'],
740
- height: !horizontal ? '100%' : 'unset'
741
- }, sx)
742
- }), label && /*#__PURE__*/React.createElement(Label, {
743
- label: label,
744
- units: units,
745
- horizontal: horizontal
746
- }), /*#__PURE__*/React.createElement(Flex, {
747
- sx: {
748
- flexGrow: horizontal ? 1 : 'unset',
749
- flexDirection: 'column',
750
- ml: bottom && label ? '4px' : '0px',
751
- height: !horizontal ? '100%' : 'unset'
752
- }
753
- }, /*#__PURE__*/React.createElement(Flex, {
754
- sx: {
755
- gap: ['3px', '6px', '6px', '7px'],
756
- height: !horizontal ? '100%' : 'unset'
757
- }
758
- }, horizontal && clim && !bottom && /*#__PURE__*/React.createElement(ClimMin, null), /*#__PURE__*/React.createElement(Gradient, {
759
- colormap: colormap,
760
- horizontal: horizontal,
761
- discrete: discrete,
762
- width: width,
763
- height: height
764
- }), horizontal && clim && !bottom && /*#__PURE__*/React.createElement(ClimMax, null)), horizontal && clim && bottom && /*#__PURE__*/React.createElement(Flex, {
765
- sx: {
766
- justifyContent: 'space-between'
767
- }
768
- }, /*#__PURE__*/React.createElement(ClimMin, null), /*#__PURE__*/React.createElement(ClimMax, null))), !horizontal && /*#__PURE__*/React.createElement(Flex, {
769
- sx: {
770
- flexDirection: 'column-reverse',
771
- justifyContent: 'space-between',
772
- height: height || DIMENSIONS.height
773
- }
774
- }, clim && /*#__PURE__*/React.createElement(ClimMin, null), clim && /*#__PURE__*/React.createElement(ClimMax, null)));
775
- };
776
-
777
- const _excluded$b = ["start", "width", "dl", "dr", "children", "sx"];
778
-
779
- const Column = _ref => {
780
- let {
781
- start,
782
- width,
783
- dl,
784
- dr,
785
- children,
786
- sx
787
- } = _ref,
788
- props = _objectWithoutPropertiesLoose(_ref, _excluded$b);
789
-
790
- start = start || 'auto';
791
- width = width || 'auto';
792
-
793
- const makeArray = input => {
794
- if (input && !Array.isArray(input)) {
795
- input = [input];
796
- }
797
-
798
- if (![1, 2, 4].includes(input.length)) {
799
- throw new Error('Array length must be 1, 2, or 4');
800
- }
801
-
802
- if (Array.isArray(input) && input.length == 1) {
803
- input = input.map(d => [d, d, d, d]).flat();
804
- } else if (Array.isArray(input) && input.length == 2) {
805
- input = input.map(d => [d, d]).flat();
806
- }
807
-
808
- return input;
809
- };
810
-
811
- start = makeArray(start);
812
- width = makeArray(width);
813
- const end = start.map((d, i) => {
814
- if (d == 'auto') return 'auto';
815
- return d + width[i];
816
- });
817
- let ml, mr;
818
-
819
- if (dl) {
820
- if (![0.5, 1].includes(dl)) {
821
- throw new Error('dl must be 0.5 or 1');
822
- }
823
-
824
- if (dl === 0.5) {
825
- ml = ['-12px', -3, -3, -4];
826
- }
827
-
828
- if (dl === 1) {
829
- ml = [-4, -5, -5, -6];
830
- }
831
- }
832
-
833
- if (dr) {
834
- if (![0.5, 1].includes(dr)) {
835
- throw new Error('dr must be 0.5 or 1');
836
- }
837
-
838
- if (dr === 0.5) {
839
- mr = ['-12px', -3, -3, -4];
840
- }
841
-
842
- if (dr === 1) {
843
- mr = [-4, -5, -5, -6];
844
- }
845
- }
846
-
847
- return /*#__PURE__*/React.createElement(Box, _extends({}, props, {
848
- sx: _extends({
849
- gridColumnStart: start,
850
- gridColumnEnd: end,
851
- ml: ml,
852
- mr: mr
853
- }, sx)
854
- }), children);
855
- };
856
-
857
- const Meta = ({
858
- title,
859
- description,
860
- card
861
- }) => {
862
- title = title ? title : 'carbonplan';
863
- description = description ? description : 'Data and science for climate action.';
864
- card = card ? card : 'https://images.carbonplan.org/social/homepage.png';
865
- return /*#__PURE__*/React.createElement(Head, null, /*#__PURE__*/React.createElement("title", null, title), /*#__PURE__*/React.createElement("meta", {
866
- name: "description",
867
- content: description
868
- }), /*#__PURE__*/React.createElement("meta", {
869
- name: "viewport",
870
- content: "initial-scale=1.0, width=device-width"
871
- }), /*#__PURE__*/React.createElement("link", {
872
- rel: "canonical",
873
- content: "https://carbonplan.org/"
874
- }), /*#__PURE__*/React.createElement("link", {
875
- rel: "icon",
876
- type: "image/svg+xml",
877
- href: "https://images.carbonplan.org/favicon.svg"
878
- }), /*#__PURE__*/React.createElement("link", {
879
- rel: "preload",
880
- href: "https://fonts.carbonplan.org/relative/relative-book-pro.woff2",
881
- as: "font",
882
- type: "font/woff2",
883
- crossOrigin: "anonymous"
884
- }), /*#__PURE__*/React.createElement("link", {
885
- rel: "preload",
886
- href: "https://fonts.carbonplan.org/relative/relative-medium-pro.woff2",
887
- as: "font",
888
- type: "font/woff2",
889
- crossOrigin: "anonymous"
890
- }), /*#__PURE__*/React.createElement("link", {
891
- rel: "preload",
892
- href: "https://fonts.carbonplan.org/relative/relative-mono-11-pitch-pro.woff2",
893
- as: "font",
894
- type: "font/woff2",
895
- crossOrigin: "anonymous"
896
- }), /*#__PURE__*/React.createElement("link", {
897
- rel: "preload",
898
- href: "https://fonts.carbonplan.org/relative/relative-faux-book-pro.woff2",
899
- as: "font",
900
- type: "font/woff2",
901
- crossOrigin: "anonymous"
902
- }), /*#__PURE__*/React.createElement("link", {
903
- rel: "manifest",
904
- href: "https://images.carbonplan.org/manifest.json"
905
- }), /*#__PURE__*/React.createElement("meta", {
906
- name: "theme-color",
907
- content: "#1b1e23"
908
- }), /*#__PURE__*/React.createElement("link", {
909
- rel: "alternate icon",
910
- type: "image/png",
911
- href: "https://images.carbonplan.org/favicon.png"
912
- }), /*#__PURE__*/React.createElement("link", {
913
- rel: "mask-icon",
914
- href: "https://images.carbonplan.org/safari-pinned-tab.svg",
915
- color: "#000000"
916
- }), /*#__PURE__*/React.createElement("link", {
917
- rel: "apple-touch-icon",
918
- sizes: "180x180",
919
- href: "https://images.carbonplan.org/apple-touch-icon.png"
920
- }), /*#__PURE__*/React.createElement("meta", {
921
- name: "msapplication-TileColor",
922
- content: "#1b1e23"
923
- }), /*#__PURE__*/React.createElement("meta", {
924
- name: "msapplication-TileImage",
925
- content: "https://images.carbonplan.org/mstile-144x144.png"
926
- }), /*#__PURE__*/React.createElement("meta", {
927
- name: "msapplication-config",
928
- content: "https://images.carbonplan.org/browserconfig.xml"
929
- }), /*#__PURE__*/React.createElement("meta", {
930
- property: "og:title",
931
- content: title
932
- }), /*#__PURE__*/React.createElement("meta", {
933
- property: "og:description",
934
- content: description
935
- }), /*#__PURE__*/React.createElement("meta", {
936
- property: "og:image",
937
- content: card
938
- }), /*#__PURE__*/React.createElement("meta", {
939
- property: "og:url",
940
- content: "https://carbonplan.org"
941
- }), /*#__PURE__*/React.createElement("meta", {
942
- name: "twitter:title",
943
- content: title
944
- }), /*#__PURE__*/React.createElement("meta", {
945
- name: "twitter:description",
946
- content: description
947
- }), /*#__PURE__*/React.createElement("meta", {
948
- name: "twitter:image",
949
- content: card
950
- }), /*#__PURE__*/React.createElement("meta", {
951
- name: "twitter:card",
952
- content: "summary_large_image"
953
- }));
954
- };
955
-
956
- const Logo = _ref => {
957
- let props = _extends({}, _ref);
958
-
959
- return /*#__PURE__*/React.createElement(Box, _extends({
960
- as: "svg",
961
- width: "150",
962
- fill: "currentColor",
963
- stroke: "none",
964
- viewBox: "0 0 151.1 28.8"
965
- }, props), /*#__PURE__*/React.createElement("g", null, /*#__PURE__*/React.createElement("g", null, /*#__PURE__*/React.createElement("path", {
966
- d: "M9.7,20.1c-1.3-1.4-2-3.1-2-5.2c0-2.1,0.7-3.9,2-5.2c1.3-1.4,3-2,5.1-2c1.7,0,3.1,0.4,4.3,1.3 c1.1,0.9,1.8,2.1,2.1,3.5c0,0.1,0,0.2,0,0.3s-0.1,0.2-0.2,0.2h-2.3c-0.2,0-0.3-0.1-0.4-0.2c-0.3-0.8-0.7-1.4-1.3-1.8 c-0.6-0.4-1.4-0.6-2.2-0.6c-1.3,0-2.3,0.4-3,1.2c-0.8,0.8-1.1,1.9-1.1,3.4c0,1.5,0.4,2.6,1.1,3.4c0.8,0.8,1.8,1.2,3,1.2 c0.8,0,1.6-0.2,2.2-0.6c0.6-0.4,1.1-1,1.3-1.8c0.1-0.2,0.2-0.2,0.4-0.3H21c0.1,0,0.2,0.1,0.2,0.2c0,0.1,0,0.2,0,0.3 c-0.3,1.4-1,2.6-2.1,3.5c-1.1,0.9-2.5,1.3-4.3,1.3C12.7,22.1,11,21.4,9.7,20.1z"
967
- })), /*#__PURE__*/React.createElement("g", null, /*#__PURE__*/React.createElement("path", {
968
- d: "M22.5,17.6c0-1.5,0.5-2.6,1.6-3.5c1.1-0.8,2.4-1.2,4.1-1.2c1.1,0,2.4,0.2,3.7,0.6V13c0-0.9-0.3-1.6-0.8-2.1 c-0.5-0.5-1.2-0.8-2.2-0.8c-1.4,0-2.4,0.6-2.9,1.8c-0.1,0.2-0.2,0.2-0.4,0.2h-2.3c-0.1,0-0.2-0.1-0.2-0.2c0-0.1,0-0.2,0-0.3 c0.3-1.2,0.9-2.2,1.9-2.9c1-0.8,2.3-1.1,3.8-1.1C30.6,7.6,32,8.1,33,9c1,0.9,1.5,2.2,1.5,3.8V19c0,1.1,0.2,1.9,0.5,2.6 c0,0.1,0.1,0.1,0.1,0.1c0,0.1-0.1,0.1-0.3,0.1h-2.8c-0.2,0-0.3-0.1-0.3-0.3v-1c-1.1,1.1-2.5,1.6-4.3,1.6c-1.4,0-2.6-0.4-3.6-1.2 C23,20.1,22.5,19,22.5,17.6z M25.4,17.5c0,0.6,0.2,1.1,0.7,1.5c0.4,0.4,1.1,0.5,1.9,0.5c1.1,0,2-0.3,2.8-0.9 c0.8-0.6,1.1-1.5,1.1-2.6c-1.3-0.4-2.5-0.6-3.6-0.6c-0.8,0-1.5,0.2-2.1,0.5C25.7,16.3,25.4,16.8,25.4,17.5z"
969
- })), /*#__PURE__*/React.createElement("g", null, /*#__PURE__*/React.createElement("path", {
970
- d: "M37,21.6V8.2c0-0.2,0.1-0.3,0.3-0.3h2.2c0.2,0,0.3,0.1,0.3,0.3v1.1c1-1.1,2.3-1.6,3.7-1.6 c0.8,0,1.7,0.1,2.5,0.4c0.2,0.1,0.3,0.3,0.3,0.5v2.2c0,0.2-0.1,0.3-0.2,0.3c0,0-0.1,0-0.2-0.1c-1.1-0.5-2-0.8-2.9-0.8 c-0.9,0-1.7,0.4-2.3,1.1c-0.6,0.7-0.9,1.7-0.9,3v7.3c0,0.2-0.1,0.3-0.3,0.3h-2.2C37.1,21.8,37,21.7,37,21.6z"
971
- })), /*#__PURE__*/React.createElement("g", null, /*#__PURE__*/React.createElement("path", {
972
- d: "M47.6,21.6V2.7c0-0.2,0.1-0.3,0.3-0.3H50c0.2,0,0.3,0.1,0.3,0.3v6.5c1.3-1.1,2.7-1.6,4.3-1.6 c1.9,0,3.4,0.7,4.6,2c1.1,1.3,1.7,3.1,1.7,5.3c0,2.2-0.6,4-1.7,5.3c-1.1,1.3-2.7,2-4.6,2c-1.8,0-3.2-0.5-4.3-1.6v1 c0,0.2-0.1,0.3-0.3,0.3h-2.2C47.7,21.8,47.6,21.7,47.6,21.6z M51.2,11.5c-0.7,0.9-1.1,2-1.1,3.3c0,1.4,0.4,2.5,1.1,3.3 s1.7,1.3,2.9,1.3c1.2,0,2.2-0.4,2.9-1.3c0.7-0.9,1.1-2,1.1-3.3c0-1.4-0.4-2.5-1.1-3.3c-0.7-0.9-1.7-1.3-2.9-1.3 C52.9,10.2,51.9,10.7,51.2,11.5z"
973
- })), /*#__PURE__*/React.createElement("g", null, /*#__PURE__*/React.createElement("path", {
974
- d: "M64.3,20.1c-1.4-1.4-2.1-3.1-2.1-5.2c0-2.1,0.7-3.9,2.1-5.2c1.4-1.4,3.1-2,5.2-2c2.1,0,3.8,0.7,5.2,2 c1.4,1.4,2.1,3.1,2.1,5.2c0,2.1-0.7,3.9-2.1,5.2c-1.4,1.4-3.1,2-5.2,2C67.4,22.1,65.7,21.4,64.3,20.1z M66.4,11.5 c-0.8,0.8-1.2,2-1.2,3.4c0,1.4,0.4,2.5,1.2,3.4s1.9,1.3,3.1,1.3c1.3,0,2.3-0.4,3.1-1.3c0.8-0.8,1.2-2,1.2-3.4 c0-1.4-0.4-2.5-1.2-3.4c-0.8-0.8-1.9-1.3-3.1-1.3C68.2,10.2,67.2,10.7,66.4,11.5z"
975
- })), /*#__PURE__*/React.createElement("g", null, /*#__PURE__*/React.createElement("path", {
976
- d: "M78.7,21.6V8.2c0-0.2,0.1-0.3,0.3-0.3h2.2c0.2,0,0.3,0.1,0.3,0.3v1.3c1.3-1.2,2.7-1.8,4.4-1.8 c1.5,0,2.7,0.4,3.5,1.3c0.8,0.9,1.3,2,1.3,3.6v9.1c0,0.2-0.1,0.3-0.3,0.3h-2.2c-0.2,0-0.3-0.1-0.3-0.3v-8.3c0-2-0.9-3.1-2.8-3.1 c-1.1,0-1.9,0.4-2.7,1.2c-0.7,0.8-1.1,2-1.1,3.5v6.6c0,0.2-0.1,0.3-0.3,0.3h-2.2C78.7,21.8,78.7,21.7,78.7,21.6z"
977
- })), /*#__PURE__*/React.createElement("g", null, /*#__PURE__*/React.createElement("path", {
978
- d: "M101.7,27.1V8.2c0-0.2,0.1-0.3,0.3-0.3h2.2c0.2,0,0.3,0.1,0.3,0.3v1c1.1-1.1,2.5-1.6,4.3-1.6 c1.9,0,3.4,0.7,4.6,2s1.7,3.1,1.7,5.3c0,2.2-0.6,4-1.7,5.3c-1.1,1.3-2.7,2-4.6,2c-1.5,0-3-0.5-4.3-1.6v6.6c0,0.2-0.1,0.3-0.3,0.3 H102C101.8,27.3,101.7,27.2,101.7,27.1z M105.3,11.5c-0.7,0.9-1.1,2-1.1,3.3c0,1.4,0.4,2.5,1.1,3.3s1.7,1.3,2.9,1.3 c1.2,0,2.2-0.4,2.9-1.3c0.7-0.9,1.1-2,1.1-3.3c0-1.4-0.4-2.5-1.1-3.3c-0.7-0.9-1.7-1.3-2.9-1.3C107,10.2,106,10.7,105.3,11.5z"
979
- })), /*#__PURE__*/React.createElement("g", null, /*#__PURE__*/React.createElement("path", {
980
- d: "M117.2,21.6V2.7c0-0.2,0.1-0.3,0.3-0.3h2.2c0.2,0,0.3,0.1,0.3,0.3v18.9c0,0.2-0.1,0.3-0.3,0.3h-2.2 C117.3,21.8,117.2,21.7,117.2,21.6z"
981
- })), /*#__PURE__*/React.createElement("g", null, /*#__PURE__*/React.createElement("path", {
982
- d: "M122,17.6c0-1.5,0.5-2.6,1.6-3.5c1.1-0.8,2.4-1.2,4.1-1.2c1.1,0,2.4,0.2,3.7,0.6V13c0-0.9-0.3-1.6-0.8-2.1 c-0.5-0.5-1.2-0.8-2.2-0.8c-1.4,0-2.4,0.6-2.9,1.8c-0.1,0.2-0.2,0.2-0.4,0.2h-2.3c-0.1,0-0.2-0.1-0.2-0.2c0-0.1,0-0.2,0-0.3 c0.3-1.2,0.9-2.2,1.9-2.9c1-0.8,2.3-1.1,3.8-1.1c1.7,0,3.1,0.5,4.2,1.4s1.5,2.2,1.5,3.8V19c0,1.1,0.2,1.9,0.5,2.6 c0,0.1,0.1,0.1,0.1,0.1c0,0.1-0.1,0.1-0.3,0.1h-2.8c-0.2,0-0.3-0.1-0.3-0.3v-1c-1.1,1.1-2.5,1.6-4.3,1.6c-1.4,0-2.6-0.4-3.6-1.2 C122.5,20.1,122,19,122,17.6z M124.9,17.5c0,0.6,0.2,1.1,0.7,1.5c0.4,0.4,1.1,0.5,1.9,0.5c1.1,0,2-0.3,2.8-0.9 c0.8-0.6,1.1-1.5,1.1-2.6c-1.3-0.4-2.5-0.6-3.6-0.6c-0.8,0-1.5,0.2-2.1,0.5C125.2,16.3,124.9,16.8,124.9,17.5z"
983
- })), /*#__PURE__*/React.createElement("g", null, /*#__PURE__*/React.createElement("path", {
984
- d: "M136.9,21.6V8.2c0-0.2,0.1-0.3,0.3-0.3h2.2c0.2,0,0.3,0.1,0.3,0.3v1.3c1.3-1.2,2.7-1.8,4.4-1.8 c1.5,0,2.7,0.4,3.5,1.3c0.8,0.9,1.3,2,1.3,3.6v9.1c0,0.2-0.1,0.3-0.3,0.3h-2.2c-0.2,0-0.3-0.1-0.3-0.3v-8.3c0-2-0.9-3.1-2.8-3.1 c-1.1,0-1.9,0.4-2.7,1.2c-0.7,0.8-1.1,2-1.1,3.5v6.6c0,0.2-0.1,0.3-0.3,0.3h-2.2C137,21.8,136.9,21.7,136.9,21.6z"
985
- })), /*#__PURE__*/React.createElement("path", {
986
- d: "M97.6,14.9c0,4.2-0.6,8.3-1.6,12.3c0,0.1-0.1,0.2-0.2,0.2h-2.4c-0.1,0-0.2-0.1-0.2-0.3c1.1-3.9,1.7-8,1.7-12.2 s-0.6-8.3-1.7-12.2c0-0.1,0.1-0.3,0.2-0.3l2.4,0c0.1,0,0.2,0.1,0.2,0.2C97.1,6.5,97.6,10.6,97.6,14.9z"
987
- }), /*#__PURE__*/React.createElement("path", {
988
- d: "M1.4,14.9C1.4,10.6,2,6.5,3,2.6c0-0.1,0.1-0.2,0.2-0.2l2.4,0c0.1,0,0.2,0.1,0.2,0.3c-1.1,3.9-1.7,8-1.7,12.2 s0.6,8.3,1.7,12.2c0,0.1-0.1,0.3-0.2,0.3H3.3c-0.1,0-0.2-0.1-0.2-0.2C2,23.2,1.4,19.1,1.4,14.9z"
989
- })));
990
- };
991
-
992
- const _excluded$a = ["children", "sx", "columns", "gap"];
993
-
994
- const Row = _ref => {
995
- let {
996
- children,
997
- sx,
998
- columns,
999
- gap
1000
- } = _ref,
1001
- props = _objectWithoutPropertiesLoose(_ref, _excluded$a);
1002
-
1003
- const makeArray = input => {
1004
- if (!Array.isArray(input)) {
1005
- input = [input, input, input, input];
1006
- }
1007
-
1008
- if (Array.isArray(input) && ![1, 2, 4].includes(input.length)) {
1009
- throw new Error('Array length must be 1, 2, or 4');
1010
- }
1011
-
1012
- if (Array.isArray(input) && input.length == 1) {
1013
- input = input.map(d => [d]).flat();
1014
- }
1015
-
1016
- if (Array.isArray(input) && input.length == 2) {
1017
- input = input.map(d => [d, d]).flat();
1018
- }
1019
-
1020
- return input;
1021
- };
1022
-
1023
- let columnGap, rowGap;
1024
-
1025
- if (Number.isInteger(gap) || Array.isArray(gap)) {
1026
- gap = makeArray(gap);
1027
- columnGap = gap;
1028
- rowGap = gap;
1029
- } else {
1030
- columnGap = [4, 5, 5, 6];
1031
- rowGap = [0, 0, 0, 0];
1032
- }
1033
-
1034
- if (Number.isInteger(columns) || Array.isArray(columns)) {
1035
- columns = makeArray(columns);
1036
- } else {
1037
- columns = [6, 8, 12, 12];
1038
- }
1039
-
1040
- return /*#__PURE__*/React.createElement(Grid, _extends({}, props, {
1041
- columns: columns,
1042
- sx: _extends({
1043
- columnGap: columnGap,
1044
- rowGap: rowGap
1045
- }, sx)
1046
- }), children);
1047
- };
1048
-
1049
- const _excluded$9 = ["value", "sx"];
1050
-
1051
- const Menu = _ref => {
1052
- let {
1053
- value,
1054
- sx
1055
- } = _ref,
1056
- props = _objectWithoutPropertiesLoose(_ref, _excluded$9);
1057
-
1058
- return /*#__PURE__*/React.createElement(IconButton, _extends({
1059
- sx: _extends({
1060
- cursor: 'pointer',
1061
- fill: 'none',
1062
- strokeWidth: '2px',
1063
- stroke: 'text',
1064
- '.paren': {
1065
- opacity: '0'
1066
- },
1067
- '@media (hover: hover) and (pointer: fine)': {
1068
- '&:hover .paren': {
1069
- opacity: '1'
1070
- }
1071
- }
1072
- }, sx),
1073
- "aria-label": "Toggle Menu"
1074
- }, props), !value && /*#__PURE__*/React.createElement("svg", {
1075
- style: {
1076
- width: '50px',
1077
- height: '30px',
1078
- transform: 'scale(2)',
1079
- marginTop: '-3px'
1080
- },
1081
- xmlns: "http://www.w3.org/2000/svg",
1082
- viewBox: "0 0 68 36"
1083
- }, /*#__PURE__*/React.createElement("line", {
1084
- x1: "52",
1085
- y1: "29.9",
1086
- x2: "16",
1087
- y2: "29.9"
1088
- }), /*#__PURE__*/React.createElement("line", {
1089
- x1: "52",
1090
- y1: "6.1",
1091
- x2: "16",
1092
- y2: "6.1"
1093
- }), /*#__PURE__*/React.createElement("line", {
1094
- x1: "52",
1095
- y1: "18",
1096
- x2: "16",
1097
- y2: "18"
1098
- }), /*#__PURE__*/React.createElement("path", {
1099
- style: {
1100
- transition: 'all 0.2s'
1101
- },
1102
- className: "paren",
1103
- d: "M6.4,1.2c-6.3,10.3-6.3,23.3,0,33.6"
1104
- }), /*#__PURE__*/React.createElement("path", {
1105
- style: {
1106
- transition: 'all 0.2s'
1107
- },
1108
- className: "paren",
1109
- d: "M61.6,34.8c6.3-10.3,6.3-23.3,0-33.6"
1110
- })), value && /*#__PURE__*/React.createElement("svg", {
1111
- style: {
1112
- width: '50px',
1113
- height: '30px',
1114
- transform: 'scale(2)',
1115
- marginTop: '-3px'
1116
- },
1117
- xmlns: "http://www.w3.org/2000/svg",
1118
- viewBox: "0 0 68 36"
1119
- }, /*#__PURE__*/React.createElement("line", {
1120
- x1: "50.85",
1121
- y1: "29.79",
1122
- x2: "17.15",
1123
- y2: "6.21"
1124
- }), /*#__PURE__*/React.createElement("line", {
1125
- x1: "17.15",
1126
- y1: "29.79",
1127
- x2: "50.85",
1128
- y2: "6.21"
1129
- }), /*#__PURE__*/React.createElement("path", {
1130
- style: {
1131
- transition: 'all 0.2s'
1132
- },
1133
- className: "paren",
1134
- d: "M6.4,1.2c-6.3,10.3-6.3,23.3,0,33.6"
1135
- }), /*#__PURE__*/React.createElement("path", {
1136
- style: {
1137
- transition: 'all 0.2s'
1138
- },
1139
- className: "paren",
1140
- d: "M61.6,34.8c6.3-10.3,6.3-23.3,0-33.6"
1141
- })));
1142
- };
1143
-
1144
- const sx$1 = {
1145
- link: (current, label, first = false) => {
1146
- return {
1147
- width: 'auto',
1148
- color: current === label ? 'secondary' : 'text',
1149
- fontSize: [6, 6, 7, 8],
1150
- fontFamily: 'heading',
1151
- letterSpacing: 'heading',
1152
- borderStyle: 'solid',
1153
- borderColor: 'muted',
1154
- borderWidth: '0px',
1155
- borderBottomWidth: '1px',
1156
- borderTopWidth: first ? '1px' : '0px',
1157
- py: [3, 3, 4, 5],
1158
- textDecoration: 'none',
1159
- display: 'block',
1160
- position: 'relative',
1161
- transition: 'color 0.15s',
1162
- '@media (hover: hover) and (pointer: fine)': {
1163
- '&:hover > #arrow': {
1164
- opacity: 1
1165
- }
1166
- },
1167
- '&:hover': {
1168
- color: current == label ? 'secondary' : 'text'
1169
- }
1170
- };
1171
- }
1172
- };
1173
- const links = [{
1174
- url: 'about',
1175
- display: 'About'
1176
- }, {
1177
- url: 'research',
1178
- display: 'Research'
1179
- }, {
1180
- url: 'blog',
1181
- display: 'Blog'
1182
- }, {
1183
- url: 'press',
1184
- display: 'Press'
1185
- }];
1186
-
1187
- const HoverArrow = () => {
1188
- return /*#__PURE__*/React.createElement(Arrow, {
1189
- id: "arrow",
1190
- sx: {
1191
- pointerEvents: 'none',
1192
- display: 'inline-block',
1193
- position: 'absolute',
1194
- left: ['-60px', '-68px', '-80px', '-104px'],
1195
- top: ['32px', '32px', '46px', '62px'],
1196
- opacity: 0,
1197
- transition: 'opacity 0.2s ease-out',
1198
- transform: 'rotate(45deg)',
1199
- width: [36, 36, 48, 56],
1200
- height: [36, 36, 48, 56]
1201
- }
1202
- });
1203
- };
1204
-
1205
- const Nav = ({
1206
- link,
1207
- mode,
1208
- nav,
1209
- first,
1210
- setExpanded
1211
- }) => {
1212
- const {
1213
- url,
1214
- display
1215
- } = link;
1216
- const href = mode === 'remote' ? 'https://carbonplan.org/' + url : '/' + url;
1217
-
1218
- if (mode === 'homepage' || mode === 'local' && nav === url) {
1219
- return /*#__PURE__*/React.createElement(NextLink, {
1220
- href: href,
1221
- passHref: true
1222
- }, /*#__PURE__*/React.createElement(Link$2, {
1223
- onClick: () => {
1224
- if (nav === url) setExpanded(false);
1225
- },
1226
- sx: sx$1.link(nav, url, first)
1227
- }, /*#__PURE__*/React.createElement(HoverArrow, null), display));
1228
- } else {
1229
- return /*#__PURE__*/React.createElement(Link$2, {
1230
- href: href,
1231
- sx: sx$1.link(nav, url, first)
1232
- }, /*#__PURE__*/React.createElement(HoverArrow, null), display);
1233
- }
1234
- };
1235
-
1236
- const NavGroup = ({
1237
- links,
1238
- nav,
1239
- mode,
1240
- setExpanded
1241
- }) => {
1242
- return links.map((d, i) => {
1243
- return /*#__PURE__*/React.createElement(Nav, {
1244
- key: i,
1245
- link: d,
1246
- mode: mode,
1247
- nav: nav,
1248
- first: i === 0,
1249
- setExpanded: setExpanded
1250
- });
1251
- });
1252
- };
1253
-
1254
- const Header = ({
1255
- status,
1256
- mode,
1257
- nav,
1258
- menuItems
1259
- }) => {
1260
- const [expanded, setExpanded] = useState(false);
1261
-
1262
- const toggle = e => {
1263
- setExpanded(!expanded);
1264
- };
1265
-
1266
- return /*#__PURE__*/React.createElement(Row, {
1267
- sx: {
1268
- pt: ['12px'],
1269
- pb: [3]
1270
- }
1271
- }, /*#__PURE__*/React.createElement(Column, {
1272
- start: [1],
1273
- width: [2]
1274
- }, /*#__PURE__*/React.createElement(Box, {
1275
- sx: {
1276
- pointerEvents: 'all',
1277
- display: 'block',
1278
- width: 'fit-content'
1279
- }
1280
- }, (mode == 'homepage' || mode == 'local') && /*#__PURE__*/React.createElement(NextLink, {
1281
- href: "/",
1282
- passHref: true
1283
- }, /*#__PURE__*/React.createElement(Link$2, {
1284
- "aria-label": "CarbonPlan Homepage",
1285
- sx: {
1286
- display: 'block'
1287
- }
1288
- }, /*#__PURE__*/React.createElement(Logo, {
1289
- id: "logo",
1290
- sx: {
1291
- cursor: 'pointer',
1292
- color: 'primary'
1293
- }
1294
- }))), (mode == null || mode == 'remote') && /*#__PURE__*/React.createElement(Link$2, {
1295
- href: "https://carbonplan.org",
1296
- "aria-label": "CarbonPlan Homepage",
1297
- sx: {
1298
- display: 'block'
1299
- }
1300
- }, /*#__PURE__*/React.createElement(Logo, {
1301
- sx: {
1302
- cursor: 'pointer',
1303
- color: 'primary'
1304
- }
1305
- })))), /*#__PURE__*/React.createElement(Column, {
1306
- start: [4, 9],
1307
- width: [2, 2],
1308
- dr: 1,
1309
- sx: {
1310
- display: [status ? 'flex' : 'none', 'flex', 'flex', 'flex'],
1311
- alignItems: 'center'
1312
- }
1313
- }, /*#__PURE__*/React.createElement(Box, {
1314
- sx: {
1315
- fontSize: [1, 2, 3],
1316
- position: 'relative',
1317
- top: ['-2px', '-3px', '-3px']
1318
- }
1319
- }, status ? `(${status})` : '')), /*#__PURE__*/React.createElement(Column, {
1320
- start: [status ? 6 : 4, 6, 11, 11],
1321
- width: [status ? 1 : 3, 3, 2, 2],
1322
- sx: {
1323
- zIndex: 5000
1324
- }
1325
- }, /*#__PURE__*/React.createElement(Flex, {
1326
- sx: {
1327
- pointerEvents: 'all',
1328
- justifyContent: 'flex-end'
1329
- }
1330
- }, /*#__PURE__*/React.createElement(Flex, {
1331
- sx: {
1332
- mr: '18px',
1333
- gap: '18px',
1334
- opacity: expanded ? 0 : 1,
1335
- transition: 'opacity 0.15s',
1336
- justifyContent: 'space-between',
1337
- alignItems: 'center'
1338
- }
1339
- }, status ? null : menuItems), /*#__PURE__*/React.createElement(Menu, {
1340
- sx: {
1341
- flexShrink: 0,
1342
- mr: ['-2px']
1343
- },
1344
- value: expanded,
1345
- onClick: toggle
1346
- }))), /*#__PURE__*/React.createElement(Box, {
1347
- sx: {
1348
- opacity: expanded ? 1 : 0,
1349
- pointerEvents: expanded ? 'all' : 'none',
1350
- position: 'fixed',
1351
- top: '0px',
1352
- right: '0px',
1353
- bottom: '0px',
1354
- minWidth: '0px',
1355
- maxHeight: '100vh',
1356
- width: '100vw',
1357
- backgroundColor: 'background',
1358
- zIndex: 4000,
1359
- pt: ['79px'],
1360
- transition: 'opacity 0.25s'
1361
- }
1362
- }, /*#__PURE__*/React.createElement(Container, null, /*#__PURE__*/React.createElement(Row, null, /*#__PURE__*/React.createElement(Column, {
1363
- start: [2, 4, 7, 7],
1364
- width: [5, 4, 5, 5]
1365
- }, /*#__PURE__*/React.createElement(Box, {
1366
- as: "nav",
1367
- sx: {
1368
- display: expanded ? 'inherit' : 'none',
1369
- mt: [5, 5, 5, 6]
1370
- }
1371
- }, /*#__PURE__*/React.createElement(NavGroup, {
1372
- links: links,
1373
- nav: nav,
1374
- mode: mode,
1375
- setExpanded: setExpanded
1376
- })))))));
1377
- };
1378
-
1379
- const Monogram = _ref => {
1380
- let props = _extends({}, _ref);
1381
-
1382
- return /*#__PURE__*/React.createElement(Box, _extends({
1383
- as: "svg",
1384
- width: "80",
1385
- stroke: "none",
1386
- fill: "currentColor",
1387
- viewBox: "0 0 32 32"
1388
- }, props), /*#__PURE__*/React.createElement("path", {
1389
- d: "M21.9395,14.9395 L17.5005,19.3785 L17.5005,7.0005 L14.5005,7.0005 L14.5005,19.3785 L10.0605,14.9395 L7.9395,17.0605 L14.9395,24.0605 C15.2325,24.3535 15.6165,24.5005 16.0005,24.5005 C16.3835,24.5005 16.7675,24.3535 17.0605,24.0605 L24.0605,17.0605 L21.9395,14.9395 Z"
1390
- }), /*#__PURE__*/React.createElement("path", {
1391
- d: "M27.5986,4 L22.8966,4 C26.5556,6.303 28.9996,10.366 28.9996,15 C28.9996,20.4 25.6896,25.039 20.9926,27 L26.5586,27 C29.8886,24.068 31.9996,19.785 31.9996,15 C31.9996,10.734 30.3196,6.868 27.5986,4"
1392
- }), /*#__PURE__*/React.createElement("path", {
1393
- d: "M3,15 C3,10.366 5.444,6.303 9.104,4 L4.401,4 C1.68,6.868 0,10.734 0,15 C0,19.785 2.112,24.068 5.441,27 L11.008,27 C6.311,25.039 3,20.4 3,15"
1394
- }));
1395
- };
1396
-
1397
- const Footer = () => {
1398
- return /*#__PURE__*/React.createElement(Box, {
1399
- sx: {
1400
- mt: [7, 7, 7, 8],
1401
- mb: [7, 7, 7, 8],
1402
- pb: [2, 1, 0, 0]
1403
- }
1404
- }, /*#__PURE__*/React.createElement(Row, {
1405
- sx: {
1406
- mb: [0, 0, 4, 5]
1407
- }
1408
- }, /*#__PURE__*/React.createElement(Column, {
1409
- start: [1, 2],
1410
- width: [3, 3]
1411
- }, /*#__PURE__*/React.createElement(Box, null, /*#__PURE__*/React.createElement(Box, {
1412
- sx: {
1413
- fontSize: [2, 2, 2, 3],
1414
- fontFamily: 'heading',
1415
- letterSpacing: 'mono',
1416
- mb: [2]
1417
- }
1418
- }, "EMAIL"), /*#__PURE__*/React.createElement(Link$2, {
1419
- href: "mailto:hello@carbonplan.org",
1420
- sx: {
1421
- textDecoration: 'none',
1422
- fontSize: [2, 2, 2, 3]
1423
- }
1424
- }, "hello@carbonplan.org"))), /*#__PURE__*/React.createElement(Column, {
1425
- start: [5],
1426
- width: [1],
1427
- dl: 1,
1428
- dr: 1,
1429
- sx: {
1430
- display: ['flex', 'none', 'none', 'none'],
1431
- justifyContent: ['center']
1432
- }
1433
- }, /*#__PURE__*/React.createElement(Monogram, {
1434
- sx: {
1435
- mt: ['-4px'],
1436
- width: '60px',
1437
- height: '60px'
1438
- }
1439
- })), /*#__PURE__*/React.createElement(Column, {
1440
- start: [1, 5, 5, 5],
1441
- width: [3, 3],
1442
- sx: {
1443
- mt: [3, 0, 0, 0]
1444
- }
1445
- }, /*#__PURE__*/React.createElement(Box, null, /*#__PURE__*/React.createElement(Box, {
1446
- sx: {
1447
- fontSize: [2, 2, 2, 3],
1448
- fontFamily: 'heading',
1449
- letterSpacing: 'mono',
1450
- mb: [2]
1451
- }
1452
- }, "FOLLOW"), /*#__PURE__*/React.createElement(Link$2, {
1453
- href: "https://twitter.com/carbonplanorg",
1454
- sx: {
1455
- textDecoration: 'none',
1456
- fontSize: [2, 2, 2, 3]
1457
- }
1458
- }, "@carbonplanorg"))), /*#__PURE__*/React.createElement(Column, {
1459
- start: [1, 9],
1460
- width: [5, 4, 3, 3],
1461
- sx: {
1462
- mt: ['42px', '42px', 0, 0],
1463
- mb: [3, 3, 0, 0]
1464
- }
1465
- }, /*#__PURE__*/React.createElement(Box, null, /*#__PURE__*/React.createElement(Box, {
1466
- sx: {
1467
- fontSize: [2, 2, 2, 3],
1468
- fontFamily: 'body',
1469
- color: 'secondary'
1470
- }
1471
- }, "CarbonPlan is a registered non-profit public benefit corporation in California with 501(c)(3) status.")))), /*#__PURE__*/React.createElement(Row, {
1472
- sx: {
1473
- mb: ['2px'],
1474
- mt: [5, 5, 4]
1475
- }
1476
- }, /*#__PURE__*/React.createElement(Column, {
1477
- start: [1, 1, 2, 2],
1478
- width: [3, 2, 3, 3],
1479
- sx: {
1480
- display: 'flex',
1481
- alignItems: ['flex-start', 'flex-start', 'flex-end']
1482
- }
1483
- }, /*#__PURE__*/React.createElement(Box, {
1484
- sx: {
1485
- bottom: '0px',
1486
- borderStyle: 'solid',
1487
- borderColor: 'muted',
1488
- borderWidth: '0px',
1489
- borderTopWidth: '1px',
1490
- pt: [2]
1491
- }
1492
- }, /*#__PURE__*/React.createElement(Box, {
1493
- sx: {
1494
- color: 'secondary',
1495
- fontSize: [1, 1, 1, 2],
1496
- fontFamily: 'mono',
1497
- letterSpacing: 'mono'
1498
- }
1499
- }, "(c) 2021 CARBONPLAN"))), /*#__PURE__*/React.createElement(Column, {
1500
- start: [4, 3, 5, 5],
1501
- width: [2, 2, 3, 3],
1502
- sx: {
1503
- display: 'flex',
1504
- alignItems: ['flex-start', 'flex-start', 'flex-end'],
1505
- mt: [0, 0, 0, 0]
1506
- }
1507
- }, /*#__PURE__*/React.createElement(Box, {
1508
- sx: {
1509
- bottom: '0px',
1510
- borderStyle: 'solid',
1511
- borderColor: 'muted',
1512
- borderWidth: '0px',
1513
- borderTopWidth: '1px',
1514
- width: ['100%', 'auto', 'auto', 'auto'],
1515
- pt: [2]
1516
- }
1517
- }, /*#__PURE__*/React.createElement(NextLink, {
1518
- href: "/terms",
1519
- passHref: true
1520
- }, /*#__PURE__*/React.createElement(Box, {
1521
- as: "a",
1522
- sx: {
1523
- textDecoration: 'none',
1524
- fontSize: [1, 1, 1, 2],
1525
- color: 'secondary',
1526
- fontFamily: 'mono',
1527
- letterSpacing: 'mono',
1528
- display: 'block'
1529
- }
1530
- }, "READ OUR TERMS")))), /*#__PURE__*/React.createElement(Column, {
1531
- start: [5, 7, 9, 9],
1532
- width: [2, 3, 3, 3],
1533
- sx: {
1534
- display: ['none', 'initial', 'initial', 'initial']
1535
- }
1536
- }, /*#__PURE__*/React.createElement(Monogram, {
1537
- sx: {
1538
- width: 80,
1539
- height: 80,
1540
- mt: [0, '-10px', 4, 5],
1541
- mb: ['-12px']
1542
- }
1543
- }))));
1544
- };
1545
-
1546
- const _excluded$8 = ["sx"];
1547
-
1548
- const Dimmer = _ref => {
1549
- let {
1550
- sx
1551
- } = _ref,
1552
- props = _objectWithoutPropertiesLoose(_ref, _excluded$8);
1553
-
1554
- const [colorMode, setColorMode] = useColorMode();
1555
- const toggle = useCallback(() => {
1556
- setColorMode(colorMode === 'light' ? 'dark' : 'light');
1557
- }, [colorMode]);
1558
- return /*#__PURE__*/React.createElement(IconButton, _extends({
1559
- "aria-label": "Toggle dark mode",
1560
- onClick: toggle,
1561
- role: "checkbox",
1562
- sx: _extends({
1563
- width: 32,
1564
- height: 32,
1565
- display: 'inline-block',
1566
- cursor: 'pointer',
1567
- color: 'secondary'
1568
- }, sx)
1569
- }, props), /*#__PURE__*/React.createElement(Sun, {
1570
- sx: {
1571
- strokeWidth: '1.75',
1572
- transition: 'stroke 0.15s',
1573
- '@media (hover: hover) and (pointer: fine)': {
1574
- '&:hover': {
1575
- stroke: 'primary'
1576
- }
1577
- }
1578
- }
1579
- }));
1580
- };
1581
-
1582
- const GitSha = () => {
1583
- const sha = process.env.NEXT_PUBLIC_VERCEL_GIT_COMMIT_SHA;
1584
- const owner = process.env.NEXT_PUBLIC_VERCEL_GIT_REPO_OWNER;
1585
- const slug = process.env.NEXT_PUBLIC_VERCEL_GIT_REPO_SLUG;
1586
- const {
1587
- theme
1588
- } = useThemeUI();
1589
- const color = theme.rawColors.secondary;
1590
-
1591
- if (sha && owner && slug) {
1592
- const shortSha = sha.substring(0, 7);
1593
- const href = 'https://github.com/' + owner + '/' + slug + '/tree/' + sha;
1594
- return /*#__PURE__*/React.createElement(Box, {
1595
- sx: {
1596
- display: 'inline-block',
1597
- width: '87px'
1598
- }
1599
- }, /*#__PURE__*/React.createElement(Separator, {
1600
- color: color
1601
- }), /*#__PURE__*/React.createElement(Link$2, {
1602
- href: href,
1603
- sx: {
1604
- whiteSpace: 'nowrap',
1605
- display: 'inline-block',
1606
- ml: [2],
1607
- fontFamily: 'mono',
1608
- letterSpacing: 'body',
1609
- color: color,
1610
- fontSize: [1],
1611
- textTransform: 'uppercase',
1612
- textDecoration: 'none'
1613
- }
1614
- }, shortSha));
1615
- } else {
1616
- // fallback
1617
- return /*#__PURE__*/React.createElement(Box, {
1618
- sx: {
1619
- display: 'inline-block',
1620
- width: '87px'
1621
- }
1622
- }, /*#__PURE__*/React.createElement(Separator, {
1623
- color: color
1624
- }), /*#__PURE__*/React.createElement(Text, {
1625
- sx: {
1626
- whiteSpace: 'nowrap',
1627
- display: 'inline-block',
1628
- ml: [2],
1629
- fontFamily: 'mono',
1630
- letterSpacing: 'body',
1631
- color: color,
1632
- fontSize: [1],
1633
- textTransform: 'uppercase'
1634
- }
1635
- }, color));
1636
- }
1637
- };
1638
-
1639
- const Separator = ({
1640
- color
1641
- }) => {
1642
- return /*#__PURE__*/React.createElement("svg", {
1643
- fill: color,
1644
- opacity: "0.8",
1645
- viewBox: "0 0 24 24",
1646
- width: "24",
1647
- height: "24"
1648
- }, /*#__PURE__*/React.createElement("circle", {
1649
- r: 5,
1650
- cx: 19,
1651
- cy: 19
1652
- }));
1653
- };
1654
-
1655
- const Value = ({
1656
- mode
1657
- }) => {
1658
- const [display, setDisplay] = useState(init(mode));
1659
- useEffect(() => {
1660
- if (mode === 'mouse') {
1661
- const setFromEvent = e => {
1662
- const x = format(e.clientX, 4);
1663
- const y = format(e.clientY, 4);
1664
- setDisplay(`X,Y: ${x},${y}`);
1665
- };
1666
-
1667
- window.addEventListener('mousemove', setFromEvent);
1668
- return () => {
1669
- window.removeEventListener('mousemove', setFromEvent);
1670
- };
1671
- }
1672
-
1673
- if (mode === 'scroll') {
1674
- const setFromEvent = e => {
1675
- const y = scrollFraction(window);
1676
- setDisplay(`SCROLL: 0.${format((y * 100).toFixed(0), 2)}`);
1677
- };
1678
-
1679
- window.addEventListener('scroll', setFromEvent);
1680
- return () => {
1681
- window.removeEventListener('scroll', setFromEvent);
1682
- };
1683
- }
1684
- }, []);
1685
- return /*#__PURE__*/React.createElement(Text, {
1686
- sx: {
1687
- whiteSpace: 'nowrap',
1688
- display: 'inline-block',
1689
- mr: '-6px',
1690
- fontFamily: 'mono',
1691
- letterSpacing: 'body',
1692
- color: 'secondary',
1693
- fontSize: [1],
1694
- textTransform: 'uppercase'
1695
- }
1696
- }, display);
1697
- };
1698
-
1699
- const Metadata = ({
1700
- mode
1701
- }) => {
1702
- return /*#__PURE__*/React.createElement(Box, {
1703
- sx: {
1704
- userSelect: 'none',
1705
- position: 'fixed',
1706
- bottom: '42px',
1707
- right: '24px',
1708
- transformOrigin: 'right',
1709
- transform: 'rotate(90deg)',
1710
- display: ['none', 'none', 'initial']
1711
- }
1712
- }, /*#__PURE__*/React.createElement(Value, {
1713
- mode: mode
1714
- }), /*#__PURE__*/React.createElement(GitSha, null));
1715
- };
1716
-
1717
- function init(mode) {
1718
- if (mode === 'mouse') {
1719
- return `X,Y: ${format(0, 4)},${format(0, 4)}`;
1720
- } else if (mode === 'scroll') {
1721
- return `SCROLL: 0.${format(0 .toFixed(0), 2)}`;
1722
- } else {
1723
- return mode;
1724
- }
1725
- }
1726
-
1727
- function format(num, pad) {
1728
- return num.toString().padStart(pad, '0');
1729
- }
1730
-
1731
- function scrollFraction(window, documnt) {
1732
- return Math.min(window.scrollY / (document.body.offsetHeight - 770), 0.99);
1733
- }
1734
-
1735
- const _excluded$7 = ["duration", "delay", "children"];
1736
- const fade = keyframes({
1737
- from: {
1738
- opacity: 0
1739
- },
1740
- to: {
1741
- opacity: 1
1742
- }
1743
- });
1744
-
1745
- const FadeIn = _ref => {
1746
- let {
1747
- duration = 300,
1748
- delay = 0,
1749
- children
1750
- } = _ref,
1751
- delegated = _objectWithoutPropertiesLoose(_ref, _excluded$7);
1752
-
1753
- return /*#__PURE__*/React.createElement(Box, _extends({}, delegated, {
1754
- sx: {
1755
- animationDuration: duration + 'ms',
1756
- animationDelay: delay + 'ms',
1757
- animationName: fade.toString(),
1758
- animationFillMode: 'backwards'
1759
- }
1760
- }), children);
1761
- };
1762
-
1763
- const getScrollbarWidth = document => {
1764
- const outer = document.createElement('div');
1765
- outer.style.visibility = 'hidden';
1766
- outer.style.width = '100px';
1767
- document.body.appendChild(outer);
1768
- outer.style.overflow = 'scroll';
1769
- const inner = document.createElement('div');
1770
- inner.style.width = '100%';
1771
- outer.appendChild(inner);
1772
- const delta = outer.offsetWidth - inner.offsetWidth;
1773
- outer.parentNode.removeChild(outer);
1774
- return delta;
1775
- };
1776
-
1777
- const Scrollbar = () => {
1778
- useEffect(() => {
1779
- if (typeof document !== 'undefined') {
1780
- const delta = getScrollbarWidth(document);
1781
-
1782
- if (delta > 0) {
1783
- document.body.classList.add('custom-scrollbar');
1784
- document.getElementsByTagName('html')[0].classList.add('custom-scrollbar');
1785
- }
1786
- }
1787
- }, []);
1788
- return null;
1789
- };
1790
-
1791
- const Guide = ({
1792
- color: _color = 'muted'
1793
- }) => {
1794
- const [display, setDisplay] = useState(false);
1795
- useEffect(() => {
1796
- function handler(event) {
1797
- const {
1798
- key,
1799
- keyCode,
1800
- metaKey
1801
- } = event;
1802
-
1803
- if (key === ';' && metaKey) {
1804
- setDisplay(prev => !prev);
1805
- }
1806
- }
1807
-
1808
- document.addEventListener('keydown', handler);
1809
- return () => {
1810
- document.removeEventListener('keydown', handler);
1811
- };
1812
- }, []);
1813
- return /*#__PURE__*/React.createElement(Box, {
1814
- sx: {
1815
- position: 'fixed',
1816
- width: '100%',
1817
- left: 0,
1818
- top: 0,
1819
- zIndex: _color === 'teal' ? 5000 : -1,
1820
- pointerEvents: 'none',
1821
- display: display ? 'initial' : 'none'
1822
- }
1823
- }, /*#__PURE__*/React.createElement(Container, null, /*#__PURE__*/React.createElement(Box, {
1824
- sx: {
1825
- display: ['none', 'none', 'initial', 'initial']
1826
- }
1827
- }, /*#__PURE__*/React.createElement(GuideColumns, {
1828
- indices: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12],
1829
- color: _color
1830
- })), /*#__PURE__*/React.createElement(Box, {
1831
- sx: {
1832
- display: ['none', 'initial', 'none', 'none']
1833
- }
1834
- }, /*#__PURE__*/React.createElement(GuideColumns, {
1835
- indices: [1, 2, 3, 4, 5, 6, 7, 8],
1836
- color: _color
1837
- })), /*#__PURE__*/React.createElement(Box, {
1838
- sx: {
1839
- display: ['initial', 'none', 'none', 'none']
1840
- }
1841
- }, /*#__PURE__*/React.createElement(GuideColumns, {
1842
- indices: [1, 2, 3, 4, 5, 6],
1843
- color: _color
1844
- }))));
1845
- };
1846
-
1847
- const colorCycle = ['red', 'orange', 'yellow', 'green', 'teal', 'blue', 'purple', 'pink'];
1848
-
1849
- function GuideColumns({
1850
- indices,
1851
- color
1852
- }) {
1853
- const sx = {
1854
- outerGuideColumn: {
1855
- borderStyle: 'solid',
1856
- borderWidth: '0px',
1857
- borderLeftWidth: color === 'teal' ? '0px' : '1px',
1858
- borderRightWidth: color === 'teal' ? '0px' : '1px',
1859
- opacity: color == 'teal' ? 0.4 : 1
1860
- },
1861
- innerGuideColumn: {
1862
- borderStyle: 'solid',
1863
- borderWidth: '0px',
1864
- borderLeftWidth: '0px',
1865
- borderRightWidth: '0px',
1866
- opacity: color == 'teal' ? 0.4 : 1
1867
- }
1868
- };
1869
- return /*#__PURE__*/React.createElement(Row, null, indices.map(i => {
1870
- return /*#__PURE__*/React.createElement(Column, {
1871
- key: i,
1872
- start: [i],
1873
- width: [1, 1],
1874
- dl: 0.5,
1875
- dr: 0.5,
1876
- sx: _extends({
1877
- bg: color === 'teal' ? 'teal' : 'transparent',
1878
- height: '100vh'
1879
- }, sx.innerGuideColumn)
1880
- }, /*#__PURE__*/React.createElement(Box, {
1881
- sx: _extends({
1882
- mx: ['12px', 3, 3, 4],
1883
- bg: color === 'teal' ? 'background' : 'transparent',
1884
- height: '100%',
1885
- borderLeftColor: color === 'rainbow' ? colorCycle[i % 8] : 'muted',
1886
- borderRightColor: color === 'rainbow' ? colorCycle[i % 8] : 'muted'
1887
- }, sx.outerGuideColumn)
1888
- }));
1889
- }));
1890
- }
1891
-
1892
- const _excluded$6 = ["value", "sx"];
1893
-
1894
- const Settings = _ref => {
1895
- let {
1896
- value,
1897
- sx
1898
- } = _ref,
1899
- props = _objectWithoutPropertiesLoose(_ref, _excluded$6);
1900
-
1901
- return /*#__PURE__*/React.createElement(IconButton, _extends({
1902
- sx: _extends({
1903
- cursor: 'pointer',
1904
- fill: 'none',
1905
- strokeWidth: '2px',
1906
- stroke: 'text',
1907
- '.paren': {
1908
- opacity: '0'
1909
- },
1910
- '@media (hover: hover) and (pointer: fine)': {
1911
- '&:hover .paren': {
1912
- opacity: '1'
1913
- }
1914
- }
1915
- }, sx),
1916
- "aria-label": "Toggle Menu"
1917
- }, props), !value && /*#__PURE__*/React.createElement("svg", {
1918
- style: {
1919
- width: '50px',
1920
- height: '30px',
1921
- transform: 'scale(2)',
1922
- marginTop: '-3px'
1923
- },
1924
- xmlns: "http://www.w3.org/2000/svg",
1925
- viewBox: "0 0 68 36"
1926
- }, /*#__PURE__*/React.createElement("line", {
1927
- x1: "24",
1928
- y1: "2.1",
1929
- x2: "24",
1930
- y2: "6.1"
1931
- }), /*#__PURE__*/React.createElement("line", {
1932
- x1: "24",
1933
- y1: "24.1",
1934
- x2: "24",
1935
- y2: "33.9"
1936
- }), /*#__PURE__*/React.createElement("line", {
1937
- x1: "44",
1938
- y1: "2.1",
1939
- x2: "44",
1940
- y2: "12.1"
1941
- }), /*#__PURE__*/React.createElement("line", {
1942
- x1: "44",
1943
- y1: "30.1",
1944
- x2: "44",
1945
- y2: "33.9"
1946
- }), /*#__PURE__*/React.createElement("circle", {
1947
- cx: "24",
1948
- cy: "15.1",
1949
- r: "5"
1950
- }), /*#__PURE__*/React.createElement("circle", {
1951
- cx: "44",
1952
- cy: "21.1",
1953
- r: "5"
1954
- }), /*#__PURE__*/React.createElement("path", {
1955
- style: {
1956
- transition: 'all 0.2s'
1957
- },
1958
- className: "paren",
1959
- d: "M6.4,1.2c-6.3,10.3-6.3,23.3,0,33.6"
1960
- }), /*#__PURE__*/React.createElement("path", {
1961
- style: {
1962
- transition: 'all 0.2s'
1963
- },
1964
- className: "paren",
1965
- d: "M61.6,34.8c6.3-10.3,6.3-23.3,0-33.6"
1966
- })), value && /*#__PURE__*/React.createElement("svg", {
1967
- style: {
1968
- width: '50px',
1969
- height: '30px',
1970
- transform: 'scale(2)',
1971
- marginTop: '-3px'
1972
- },
1973
- xmlns: "http://www.w3.org/2000/svg",
1974
- viewBox: "0 0 68 36"
1975
- }, /*#__PURE__*/React.createElement("line", {
1976
- x1: "50.85",
1977
- y1: "29.79",
1978
- x2: "17.15",
1979
- y2: "6.21"
1980
- }), /*#__PURE__*/React.createElement("line", {
1981
- x1: "17.15",
1982
- y1: "29.79",
1983
- x2: "50.85",
1984
- y2: "6.21"
1985
- }), /*#__PURE__*/React.createElement("path", {
1986
- style: {
1987
- transition: 'all 0.2s'
1988
- },
1989
- className: "paren",
1990
- d: "M6.4,1.2c-6.3,10.3-6.3,23.3,0,33.6"
1991
- }), /*#__PURE__*/React.createElement("path", {
1992
- style: {
1993
- transition: 'all 0.2s'
1994
- },
1995
- className: "paren",
1996
- d: "M61.6,34.8c6.3-10.3,6.3-23.3,0-33.6"
1997
- })));
1998
- };
1999
-
2000
- const Layout = ({
2001
- title,
2002
- description,
2003
- card,
2004
- children,
2005
- status,
2006
- nav,
2007
- settings,
2008
- footer: _footer = true,
2009
- header: _header = true,
2010
- metadata: _metadata = 'mouse',
2011
- links: _links = 'remote',
2012
- dimmer: _dimmer = 'bottom',
2013
- guide: _guide = true,
2014
- scrollbar: _scrollbar = true,
2015
- fade: _fade = true,
2016
- container: _container = true
2017
- }) => {
2018
- let content = children;
2019
-
2020
- if (_fade) {
2021
- content = /*#__PURE__*/React.createElement(FadeIn, {
2022
- duration: 250
2023
- }, content);
2024
- }
2025
-
2026
- if (_container) {
2027
- content = /*#__PURE__*/React.createElement(Box, {
2028
- sx: {
2029
- mb: [8, 8, 9, 10]
2030
- }
2031
- }, /*#__PURE__*/React.createElement(Container, null, content));
2032
- }
2033
-
2034
- const {
2035
- theme
2036
- } = useThemeUI();
2037
- useEffect(() => {
2038
- if (!theme) return;
2039
-
2040
- const handler = e => {
2041
- if (e.matches && settings != null && settings.value && settings != null && settings.onClick) {
2042
- settings == null ? void 0 : settings.onClick();
2043
- }
2044
- };
2045
-
2046
- const query = window.matchMedia(`(min-width: ${theme.breakpoints[1]})`);
2047
- query.onchange = handler;
2048
- return () => {
2049
- query.onchange = null;
2050
- };
2051
- }, [theme == null ? void 0 : theme.breakpoints, settings == null ? void 0 : settings.value, settings == null ? void 0 : settings.onClick]);
2052
- const menuItems = [/*#__PURE__*/React.createElement(Dimmer, {
2053
- key: "dimmer",
2054
- sx: {
2055
- color: 'primary',
2056
- mt: '-2px',
2057
- display: ['block', 'block', _dimmer === 'top' ? 'block' : 'none', _dimmer === 'top' ? 'block' : 'none']
2058
- }
2059
- })];
2060
-
2061
- if (settings) {
2062
- menuItems.push( /*#__PURE__*/React.createElement(Settings, _extends({
2063
- key: "settings",
2064
- sx: {
2065
- mr: ['2px'],
2066
- display: ['inherit', 'inherit', 'none', 'none']
2067
- }
2068
- }, settings)));
2069
- }
2070
-
2071
- return /*#__PURE__*/React.createElement(React.Fragment, null, _guide && /*#__PURE__*/React.createElement(Guide, {
2072
- color: _guide
2073
- }), _scrollbar && /*#__PURE__*/React.createElement(Scrollbar, null), /*#__PURE__*/React.createElement(Meta, {
2074
- card: card,
2075
- description: description,
2076
- title: title
2077
- }), /*#__PURE__*/React.createElement(Flex, {
2078
- sx: {
2079
- flexDirection: 'column',
2080
- minHeight: '100vh'
2081
- }
2082
- }, _header && /*#__PURE__*/React.createElement(Box, {
2083
- as: "header",
2084
- sx: {
2085
- width: '100%',
2086
- borderStyle: 'solid',
2087
- borderColor: 'muted',
2088
- borderWidth: '0px',
2089
- borderBottomWidth: '1px',
2090
- position: 'sticky',
2091
- top: 0,
2092
- bg: 'background',
2093
- height: '56px',
2094
- zIndex: 2000
2095
- }
2096
- }, /*#__PURE__*/React.createElement(Container, null, /*#__PURE__*/React.createElement(Header, {
2097
- mode: _links,
2098
- status: status,
2099
- nav: nav,
2100
- menuItems: menuItems
2101
- }))), /*#__PURE__*/React.createElement(Box, {
2102
- sx: {
2103
- width: '100%',
2104
- flex: '1 1 auto'
2105
- }
2106
- }, content), _footer && /*#__PURE__*/React.createElement(Box, {
2107
- as: "footer",
2108
- sx: {
2109
- width: '100%',
2110
- borderStyle: 'solid',
2111
- borderColor: 'muted',
2112
- borderWidth: '0px',
2113
- borderTopWidth: '1px'
2114
- }
2115
- }, /*#__PURE__*/React.createElement(Container, null, /*#__PURE__*/React.createElement(Footer, null))), _dimmer === 'bottom' && /*#__PURE__*/React.createElement(Box, {
2116
- sx: {
2117
- display: ['none', 'none', 'initial', 'initial'],
2118
- position: ['fixed'],
2119
- right: [13],
2120
- bottom: [17, 17, 15, 15]
2121
- }
2122
- }, /*#__PURE__*/React.createElement(Dimmer, null)), _metadata && /*#__PURE__*/React.createElement(Metadata, {
2123
- mode: _metadata
2124
- })));
2125
- };
2126
-
2127
- const Custom404 = () => {
2128
- return /*#__PURE__*/React.createElement(Layout, {
2129
- footer: false,
2130
- title: '404 / carbonplan'
2131
- }, /*#__PURE__*/React.createElement(Row, {
2132
- sx: {
2133
- mb: [5, 0, 0],
2134
- pt: [0, 0, 6]
2135
- }
2136
- }, /*#__PURE__*/React.createElement(Column, {
2137
- start: [1, 1, 3, 3],
2138
- width: [6, 4, 4, 4]
2139
- }, /*#__PURE__*/React.createElement(Styled.h1, null, "Oops!"), /*#__PURE__*/React.createElement(Box, {
2140
- sx: {
2141
- fontSize: [4, 4, 4, 5],
2142
- lineHeight: 'h3',
2143
- mt: [3, 4, 4],
2144
- mb: [2, 3, 3],
2145
- maxWidth: ['90%', '90%', '400px']
2146
- }
2147
- }, "Sorry but we can't seem to find the page you are looking for."), /*#__PURE__*/React.createElement(Box, {
2148
- sx: {
2149
- color: 'secondary',
2150
- fontFamily: 'mono',
2151
- letterSpacing: 'mono',
2152
- fontSize: [2, 2, 2, 3],
2153
- mt: [4, 5, 5]
2154
- }
2155
- }, "ERROR CODE 404")), /*#__PURE__*/React.createElement(Column, {
2156
- start: [2, 5, 7, 7],
2157
- width: [4, 4, 4, 4]
2158
- }, /*#__PURE__*/React.createElement(Box, {
2159
- sx: {
2160
- width: ['100%'],
2161
- mt: [2, 4, 4, 5],
2162
- fill: 'primary'
2163
- }
2164
- }, /*#__PURE__*/React.createElement(PoopSad, {
2165
- sx: {
2166
- width: '100%',
2167
- height: 'auto'
2168
- }
2169
- })))));
2170
- };
2171
-
2172
- const Expander = ({
2173
- value,
2174
- id,
2175
- onClick,
2176
- sx
2177
- }) => {
2178
- return /*#__PURE__*/React.createElement(IconButton, {
2179
- onClick: onClick,
2180
- id: id,
2181
- role: "checkbox",
2182
- "aria-checked": value,
2183
- "aria-label": "Expand",
2184
- sx: _extends({
2185
- display: 'inline-block',
2186
- width: 24,
2187
- height: 24,
2188
- p: [1],
2189
- cursor: 'pointer',
2190
- fill: 'secondary',
2191
- stroke: 'secondary',
2192
- '@media (hover: hover) and (pointer: fine)': {
2193
- '&:hover': {
2194
- fill: 'primary',
2195
- stroke: 'primary'
2196
- }
2197
- }
2198
- }, sx)
2199
- }, /*#__PURE__*/React.createElement("svg", {
2200
- viewBox: "0 0 16 16"
2201
- }, /*#__PURE__*/React.createElement("path", {
2202
- d: "M8,0 V16 M0,8 H16",
2203
- style: {
2204
- strokeWidth: 2,
2205
- transition: '0.25s all',
2206
- transformOrigin: '8px 8px',
2207
- transform: value ? 'rotate(45deg)' : ''
2208
- }
2209
- })));
2210
- };
2211
-
2212
- const _excluded$5 = ["label", "value", "sx", "children"];
2213
-
2214
- const Tag = _ref => {
2215
- let {
2216
- label,
2217
- value,
2218
- sx,
2219
- children
2220
- } = _ref,
2221
- props = _objectWithoutPropertiesLoose(_ref, _excluded$5);
2222
-
2223
- const color = sx && sx.color ? sx.color : 'primary';
2224
- const isClickable = props && (props.onClick || props.onDoubleClick);
2225
- return /*#__PURE__*/React.createElement(Box, _extends({
2226
- as: isClickable ? 'button' : 'span',
2227
- role: "checkbox",
2228
- "aria-checked": value,
2229
- "aria-label": label,
2230
- sx: _extends({
2231
- display: 'inline-block',
2232
- fontSize: [1, 1, 1, 2],
2233
- fontFamily: 'mono',
2234
- letterSpacing: 'mono',
2235
- cursor: isClickable ? 'pointer' : 'inherit',
2236
- color: color,
2237
- backgroundColor: 'transparent',
2238
- borderStyle: 'solid',
2239
- borderColor: color,
2240
- lineHeight: 'body',
2241
- borderWidth: '0px',
2242
- borderBottomWidth: '1px',
2243
- textTransform: 'uppercase',
2244
- userSelect: 'none',
2245
- transition: 'opacity 0.05s',
2246
- pt: ['1px'],
2247
- pb: ['2px'],
2248
- px: [0],
2249
- m: [0],
2250
- opacity: value == null || value ? 1 : color == 'primary' ? 0.24 : 0.33
2251
- }, sx)
2252
- }, props), children);
2253
- };
2254
-
2255
- const _excluded$4 = ["values", "setValues", "label", "colors", "showAll", "multiSelect"];
2256
- const sx = {
2257
- label: {
2258
- fontFamily: 'mono',
2259
- letterSpacing: 'mono',
2260
- fontSize: [1, 1, 1, 2],
2261
- color: 'secondary',
2262
- userSelect: 'none',
2263
- textTransform: 'uppercase'
2264
- }
2265
- };
2266
-
2267
- const duplicateOptions = (options, defaultValue, overrides = {}) => {
2268
- return Object.keys(options).reduce((o, key) => Object.assign(o, {
2269
- [key]: overrides[key] || defaultValue
2270
- }), {});
2271
- };
2272
-
2273
- const isAll = option => {
2274
- return Object.keys(option).filter(d => option[d]).length == Object.keys(option).length;
2275
- };
2276
-
2277
- const updateValues = ({
2278
- values,
2279
- multiSelect,
2280
- setValues,
2281
- value
2282
- }) => {
2283
- const isAllAlreadySelected = isAll(values);
2284
- const isSelectingAll = value === 'all';
2285
- let updatedToggle;
2286
-
2287
- if (multiSelect) {
2288
- if (isSelectingAll && !isAllAlreadySelected) {
2289
- // select all
2290
- updatedToggle = duplicateOptions(values, true);
2291
- } else if (isSelectingAll && isAllAlreadySelected) {
2292
- // deselect all
2293
- updatedToggle = duplicateOptions(values, false);
2294
- } else {
2295
- // de/select value, inherit other values
2296
- updatedToggle = _extends({}, values, {
2297
- [value]: !values[value]
2298
- });
2299
- }
2300
- } else {
2301
- if (isSelectingAll && !isAllAlreadySelected) {
2302
- // select all
2303
- updatedToggle = duplicateOptions(values, true);
2304
- } else if (isSelectingAll && isAllAlreadySelected) ; else {
2305
- // select only value
2306
- updatedToggle = duplicateOptions(values, false, {
2307
- [value]: true
2308
- });
2309
- }
2310
- }
2311
-
2312
- if (updatedToggle) {
2313
- setValues(updatedToggle);
2314
- }
2315
- };
2316
-
2317
- const Filter = _ref => {
2318
- let {
2319
- values,
2320
- setValues,
2321
- label,
2322
- colors,
2323
- showAll = false,
2324
- multiSelect = false
2325
- } = _ref,
2326
- props = _objectWithoutPropertiesLoose(_ref, _excluded$4);
2327
-
2328
- return /*#__PURE__*/React.createElement(Box, props, label && /*#__PURE__*/React.createElement(Box, {
2329
- sx: sx.label
2330
- }, label), /*#__PURE__*/React.createElement(Box, {
2331
- sx: {
2332
- mt: label ? [3] : 0
2333
- }
2334
- }, showAll && /*#__PURE__*/React.createElement(Tag, {
2335
- onClick: () => updateValues({
2336
- values: values,
2337
- multiSelect,
2338
- setValues: setValues,
2339
- value: 'all'
2340
- }),
2341
- value: isAll(values),
2342
- sx: {
2343
- mr: [2]
2344
- }
2345
- }, "All"), Object.keys(values).map((d, i) => /*#__PURE__*/React.createElement(Tag, {
2346
- onClick: () => updateValues({
2347
- values: values,
2348
- multiSelect,
2349
- setValues: setValues,
2350
- value: d
2351
- }),
2352
- onDoubleClick: () => updateValues({
2353
- values: values,
2354
- multiSelect: false,
2355
- setValues: setValues,
2356
- value: d
2357
- }),
2358
- key: i,
2359
- value: values[d],
2360
- sx: {
2361
- width: 'max-content',
2362
- color: colors ? colors[d] : 'primary',
2363
- mr: [2],
2364
- mb: [1]
2365
- }
2366
- }, d))));
2367
- };
2368
-
2369
- const sizes = {
2370
- xs: [1],
2371
- sm: [3],
2372
- md: [5],
2373
- lg: [7],
2374
- xl: [9]
2375
- };
2376
-
2377
- const Group = ({
2378
- children,
2379
- direction: _direction = 'vertical',
2380
- spacing: _spacing = 'md'
2381
- }) => {
2382
- let marginValue;
2383
-
2384
- if (typeof _spacing === 'string') {
2385
- marginValue = sizes[_spacing];
2386
- } else if (typeof _spacing === 'number') {
2387
- marginValue = [_spacing];
2388
- } else if (Array.isArray(_spacing) && _spacing.every(el => typeof el === 'number')) {
2389
- marginValue = _spacing;
2390
- }
2391
-
2392
- if (!marginValue) {
2393
- throw new Error('Invalid spacing size. Must be numeric value(s) or one of xs, sm, md, lg, or xl');
2394
- }
2395
-
2396
- if (!['horizontal', 'vertical'].includes(_direction)) {
2397
- throw new Error('Invalid direction value. Must be either horizontal or vertical');
2398
- }
2399
-
2400
- const marginProperty = _direction === 'vertical' ? 'mt' : 'ml';
2401
- const additionalStyles = _direction === 'horizontal' ? {
2402
- display: 'inline-block'
2403
- } : {};
2404
- return /*#__PURE__*/React.createElement(Box, null, React.Children.map(children, (child, i) => {
2405
- return /*#__PURE__*/React.createElement(Box, {
2406
- sx: _extends({
2407
- [marginProperty]: i > 0 ? marginValue : 0
2408
- }, additionalStyles)
2409
- }, child);
2410
- }));
2411
- };
2412
-
2413
- const _excluded$3 = ["size", "inverted", "sx"];
2414
-
2415
- const Input = (_ref, ref) => {
2416
- let {
2417
- size = 'sm',
2418
- inverted,
2419
- sx
2420
- } = _ref,
2421
- props = _objectWithoutPropertiesLoose(_ref, _excluded$3);
2422
-
2423
- const defaultColor = inverted ? 'secondary' : 'primary';
2424
-
2425
- const styles = _extends({
2426
- color: defaultColor,
2427
- borderColor: 'secondary',
2428
- borderStyle: 'solid',
2429
- borderWidth: '0px',
2430
- borderBottomWidth: '1px',
2431
- borderRadius: '0px',
2432
- transition: 'border 0.15s',
2433
- borderBottomWidth: '1px',
2434
- width: 'calc(min(15ch, 100%))',
2435
- p: [0],
2436
- py: ['2px'],
2437
- 'input::-webkit-outer-spin-button': {
2438
- WebkitAppearance: 'none',
2439
- margin: 0
2440
- },
2441
- 'input::-webkit-inner-spin-button': {
2442
- WebkitAppearance: 'none',
2443
- margin: 0
2444
- },
2445
- ':focus': {
2446
- borderColor: 'primary'
2447
- },
2448
- ':focus-visible': {
2449
- outline: 'none !important',
2450
- background: 'none !important'
2451
- }
2452
- }, getSizeStyles(size), sx);
2453
-
2454
- return /*#__PURE__*/React.createElement(Input$1, _extends({}, props, {
2455
- ref: ref,
2456
- sx: styles
2457
- }));
2458
- };
2459
-
2460
- var input = forwardRef(Input);
2461
-
2462
- const getProps = test => props => {
2463
- const next = {};
2464
-
2465
- for (const key in props) {
2466
- if (test(key || '')) next[key] = props[key];
2467
- }
2468
-
2469
- return next;
2470
- };
2471
-
2472
- const _excluded$2 = ["children", "size", "sx", "sxSelect"];
2473
-
2474
- const Select = _ref => {
2475
- let {
2476
- children,
2477
- size = 'sm',
2478
- sx,
2479
- sxSelect
2480
- } = _ref,
2481
- props = _objectWithoutPropertiesLoose(_ref, _excluded$2);
2482
-
2483
- const color = sx && sx.color ? sx.color : 'primary';
2484
- const sizeStyles = getSizeStyles(size);
2485
- const ref = useRef(null);
2486
- const {
2487
- onChange
2488
- } = props;
2489
- const omitOnChange = getProps(k => k !== 'onChange')(props);
2490
-
2491
- if (!['xs', 'sm', 'md'].includes(size)) {
2492
- throw new Error('Size must be xs, sm, or md');
2493
- }
2494
-
2495
- let pr, height, width, ml, top;
2496
-
2497
- if (size === 'xs') {
2498
- height = [14, 14, 14, 16];
2499
- width = [14, 14, 14, 14];
2500
- top = ['1px'];
2501
- ml = ['-14px', '-14px', '-14px', '-16px'];
2502
- }
2503
-
2504
- if (size === 'sm') {
2505
- height = [15, 15, 15, 20];
2506
- width = [15, 15, 15, 20];
2507
- top = ['1px'];
2508
- ml = ['-16px', '-16px', '-16px', '-20px'];
2509
- }
2510
-
2511
- if (size === 'md') {
2512
- height = [20, 20, 20, 20];
2513
- width = [20, 20, 20, 20];
2514
- top = ['2px'];
2515
- ml = ['-20px', '-20px', '-20px', '-20px'];
2516
- }
2517
-
2518
- pr = width.map(d => d + 12);
2519
- return /*#__PURE__*/React.createElement(Box, {
2520
- sx: _extends({
2521
- display: 'inline-block'
2522
- }, sx)
2523
- }, /*#__PURE__*/React.createElement(Box, _extends({
2524
- as: "select",
2525
- ref: ref,
2526
- onChange: e => {
2527
- ref.current.blur();
2528
- if (onChange) onChange(e);
2529
- },
2530
- sx: _extends({}, sizeStyles, {
2531
- lineHeight: 'normal',
2532
- cursor: 'pointer',
2533
- WebkitAppearance: 'none',
2534
- MozAppearance: 'none',
2535
- pb: ['5px'],
2536
- bg: 'transparent',
2537
- pr: pr,
2538
- border: 'none',
2539
- borderBottomStyle: 'solid',
2540
- borderBottomWidth: '1px',
2541
- borderBottomColor: 'primary',
2542
- borderRadius: '0px',
2543
- color: 'text',
2544
- width: 'fit-content',
2545
- color: color,
2546
- userSelect: 'none',
2547
- '@media (hover: none) and (pointer: coarse)': {
2548
- '&:focus-visible': {
2549
- outline: 'none !important',
2550
- background: 'transparent !important'
2551
- }
2552
- }
2553
- }, sxSelect)
2554
- }, omitOnChange), children), /*#__PURE__*/React.createElement(Arrow, {
2555
- sx: {
2556
- width: width,
2557
- height: height,
2558
- position: 'relative',
2559
- ml: ml,
2560
- top: top,
2561
- fill: 'secondary',
2562
- transform: 'rotate(135deg)',
2563
- pointerEvents: 'none'
2564
- }
2565
- }));
2566
- };
2567
-
2568
- const _excluded$1 = ["sx"];
2569
-
2570
- const Slider = (_ref, ref) => {
2571
- let {
2572
- sx
2573
- } = _ref,
2574
- props = _objectWithoutPropertiesLoose(_ref, _excluded$1);
2575
-
2576
- const color = sx && sx.color ? sx.color : 'primary';
2577
- const {
2578
- theme: {
2579
- rawColors: colors
2580
- }
2581
- } = useThemeUI();
2582
- return /*#__PURE__*/React.createElement(Slider$1, _extends({
2583
- ref: ref,
2584
- sx: _extends({
2585
- '&::-webkit-slider-thumb': {
2586
- height: [22, 18, 16],
2587
- width: [22, 18, 16],
2588
- boxShadow: `0 0 0 0px ${colors.secondary}`,
2589
- transition: 'box-shadow .15s ease'
2590
- },
2591
- '&::-moz-range-thumb': {
2592
- height: [22, 18, 16],
2593
- width: [22, 18, 16],
2594
- boxShadow: `0 0 0 0px ${colors.secondary}`,
2595
- transition: 'box-shadow .15s ease'
2596
- },
2597
- ':focus-visible': {
2598
- outline: 'none !important',
2599
- background: `${colors.secondary} !important`
2600
- },
2601
- ':focus': {
2602
- color: color,
2603
- '&::-webkit-slider-thumb': {
2604
- boxShadow: `0 0 0 4px ${colors.secondary}`
2605
- },
2606
- '&::-moz-range-thumb': {
2607
- boxShadow: `0 0 0 4px ${colors.secondary}`
2608
- }
2609
- },
2610
- color: color
2611
- }, sx)
2612
- }, props));
2613
- };
2614
-
2615
- var slider = forwardRef(Slider);
2616
-
2617
- const styles = {
2618
- reset: {
2619
- verticalAlign: 'baseline',
2620
- border: 0,
2621
- outline: 0,
2622
- margin: 0,
2623
- padding: 0
2624
- },
2625
- row: {
2626
- borderStyle: 'solid',
2627
- borderWidth: '0px',
2628
- borderTopWidth: '1px',
2629
- borderColor: 'muted',
2630
- pt: [3, 3, 3, '20px'],
2631
- pb: [3, 3, 3, '20px'],
2632
- mb: ['2px']
2633
- },
2634
- header: {
2635
- display: 'block',
2636
- textTransform: 'uppercase',
2637
- letterSpacing: 'smallcaps',
2638
- fontFamily: 'heading',
2639
- fontSize: [2, 2, 2, 3]
2640
- },
2641
- index: {
2642
- display: 'block',
2643
- textTransform: 'uppercase',
2644
- letterSpacing: 'smallcaps',
2645
- fontFamily: 'heading',
2646
- fontSize: [2, 2, 2, 3]
2647
- },
2648
- entry: {
2649
- display: 'block',
2650
- fontSize: [2, 2, 2, 3],
2651
- fontFamily: 'faux',
2652
- letterSpacing: 'faux',
2653
- mb: ['1px'],
2654
- mt: [2, 0, 0, 0]
2655
- }
2656
- };
2657
-
2658
- const Table = ({
2659
- data,
2660
- sx,
2661
- color,
2662
- header,
2663
- columns,
2664
- start,
2665
- width,
2666
- index: _index = true,
2667
- borderBottom: _borderBottom = true,
2668
- borderTop: _borderTop = true
2669
- }) => {
2670
- if (!start || !columns || !width) {
2671
- throw new Error('Must provide columns, start, and width');
2672
- }
2673
-
2674
- return /*#__PURE__*/React.createElement(Box, {
2675
- as: "table",
2676
- sx: _extends({
2677
- display: 'block'
2678
- }, sx)
2679
- }, /*#__PURE__*/React.createElement(Box, {
2680
- as: "tbody",
2681
- sx: {
2682
- display: 'block'
2683
- }
2684
- }, header && /*#__PURE__*/React.createElement(Row, {
2685
- as: "tr",
2686
- sx: _extends({}, styles.reset, styles.header, styles.row, {
2687
- color: color,
2688
- borderTopWidth: !_borderTop ? '0px' : '1px'
2689
- })
2690
- }, /*#__PURE__*/React.createElement(Column, {
2691
- as: "td",
2692
- start: [1],
2693
- width: columns,
2694
- sx: styles.index
2695
- }, header)), data.map((row, i) => {
2696
- return /*#__PURE__*/React.createElement(Row, {
2697
- as: "tr",
2698
- columns: columns,
2699
- key: i,
2700
- sx: _extends({}, styles.reset, styles.row, {
2701
- pb: _borderBottom && i === data.length - 1 ? ['18px', '18px', '18px', '22px'] : [3, 3, 3, '20px'],
2702
- borderBottomWidth: _borderBottom && i === data.length - 1 ? '1px' : '0px',
2703
- borderTopWidth: !_borderTop && i === 0 && !header ? '0px' : '1px'
2704
- })
2705
- }, row.map((column, j) => {
2706
- return /*#__PURE__*/React.createElement(Column, {
2707
- as: "td",
2708
- key: j,
2709
- start: start[j],
2710
- width: width[j],
2711
- sx: j == 0 && _index ? _extends({}, styles.reset, styles.index) : _extends({}, styles.reset, styles.entry)
2712
- }, column);
2713
- }));
2714
- })));
2715
- };
2716
-
2717
- const _excluded = ["value", "onClick", "disabled", "sx"];
2718
-
2719
- const Toggle = (_ref, ref) => {
2720
- let {
2721
- value,
2722
- onClick,
2723
- disabled,
2724
- sx
2725
- } = _ref,
2726
- props = _objectWithoutPropertiesLoose(_ref, _excluded);
2727
-
2728
- const color = sx && sx.color ? sx.color : 'primary';
2729
- value = disabled ? false : value;
2730
- return /*#__PURE__*/React.createElement(Box, _extends({
2731
- ref: ref,
2732
- as: "button",
2733
- onClick: onClick,
2734
- role: "checkbox",
2735
- "aria-checked": value,
2736
- "aria-label": "Toggle",
2737
- sx: _extends({
2738
- border: 'none',
2739
- background: 'none',
2740
- cursor: disabled ? 'default' : 'pointer',
2741
- p: [0],
2742
- m: [0],
2743
- display: 'inline-block'
2744
- }, sx)
2745
- }, props), /*#__PURE__*/React.createElement(Box, {
2746
- sx: {
2747
- width: '50px',
2748
- height: '20px',
2749
- borderRadius: '20px',
2750
- backgroundColor: value ? transparentize(color, color == 'primary' ? 0.5 : 0.45) : 'muted',
2751
- position: 'relative',
2752
- transition: '0.15s',
2753
- display: 'inline-block'
2754
- }
2755
- }, /*#__PURE__*/React.createElement(Box, {
2756
- sx: {
2757
- width: '14px',
2758
- height: '14px',
2759
- borderRadius: '7px',
2760
- position: 'absolute',
2761
- left: value ? '32px' : '4px',
2762
- top: '3px',
2763
- backgroundColor: value ? color : 'secondary',
2764
- transition: '0.15s'
2765
- }
2766
- })));
2767
- };
2768
-
2769
- var toggle = forwardRef(Toggle);
2770
-
2771
- const Tracking = ({
2772
- id
2773
- }) => {
2774
- if (!id) {
2775
- return null;
2776
- }
2777
-
2778
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("script", {
2779
- async: true,
2780
- src: `https://www.googletagmanager.com/gtag/js?id=${id}`
2781
- }), /*#__PURE__*/React.createElement("script", {
2782
- dangerouslySetInnerHTML: {
2783
- __html: `
2784
- window.dataLayer = window.dataLayer || [];
2785
- function gtag(){dataLayer.push(arguments);}
2786
- gtag('js', new Date());
2787
- gtag('config', '${id}', {
2788
- page_path: window.location.pathname,
2789
- });
2790
- `
2791
- }
2792
- }));
2793
- };
2794
-
2795
- const Tray = ({
2796
- expanded,
2797
- sx,
2798
- children
2799
- }) => {
2800
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Box, {
2801
- sx: {
2802
- position: 'fixed',
2803
- top: '56px',
2804
- bottom: '0px',
2805
- left: '0px',
2806
- width: 'calc(100vw)',
2807
- mt: ['56px'],
2808
- bg: 'background',
2809
- zIndex: 1000,
2810
- transition: 'opacity 0.15s',
2811
- opacity: expanded ? 0.9 : 0,
2812
- pointerEvents: expanded ? 'all' : 'none'
2813
- }
2814
- }), /*#__PURE__*/React.createElement(Box, {
2815
- sx: _extends({
2816
- position: 'fixed',
2817
- width: 'calc(100vw)',
2818
- top: '0px',
2819
- mt: ['56px'],
2820
- pb: [6, 7, 7, 8],
2821
- pt: [5, 6, 7, 8],
2822
- bg: 'background',
2823
- zIndex: 1100,
2824
- borderStyle: 'solid',
2825
- borderColor: 'muted',
2826
- borderWidth: '0px',
2827
- borderBottomWidth: '1px',
2828
- transition: 'transform 0.15s',
2829
- ml: [-3, -4, -5, -6],
2830
- pl: [3, 4, 5, 6],
2831
- pr: [3, 4, 5, 6],
2832
- transform: expanded ? 'translateY(0)' : 'translateY(-100%)'
2833
- }, sx)
2834
- }, /*#__PURE__*/React.createElement(Row, null, /*#__PURE__*/React.createElement(Column, {
2835
- start: [1, 1, 1, 1],
2836
- width: [6, 8, 10, 10]
2837
- }, children))));
2838
- };
2839
-
2840
- const defaultOptions = {
2841
- month: 'short',
2842
- day: 'numeric',
2843
- year: 'numeric'
2844
- };
2845
-
2846
- const formatDateElement = (date, element, option) => {
2847
- if (!option) {
2848
- return null;
2849
- }
2850
-
2851
- const format = typeof option === 'string' ? option : defaultOptions[element];
2852
- const result = date.toLocaleString('default', {
2853
- [element]: format
2854
- });
2855
-
2856
- if (format === 'numeric' && ['day', 'month'].includes(element)) {
2857
- return result.padStart(2, '0');
2858
- } else {
2859
- return result;
2860
- }
2861
- };
2862
-
2863
- const formatDate = (date, options = defaultOptions) => {
2864
- var _options$separator;
2865
-
2866
- const d = new Date(date.replace(/-/g, '/'));
2867
- const month = formatDateElement(d, 'month', options.month);
2868
- const day = formatDateElement(d, 'day', options.day);
2869
- const year = formatDateElement(d, 'year', options.year);
2870
- return [month, day, year].filter(Boolean).join((_options$separator = options.separator) != null ? _options$separator : ' ');
2871
- };
2872
-
2873
- export { Badge, button as Button, callout as Callout, Colorbar, Column, Custom404, Dimmer, Expander, FadeIn, Filter, Footer, Group, Guide, Header, input as Input, Layout, Link$1 as Link, Logo, Menu, Meta, Monogram, Row, Scrollbar, Select, Settings, slider as Slider, Table, Tag, toggle as Toggle, Tracking, Tray, formatDate, getScrollbarWidth };
1
+ import e,{forwardRef as t,cloneElement as r,useRef as n,useState as o,useEffect as a,useCallback as l}from"react";import{Box as i,Link as c,Flex as s,Grid as m,IconButton as p,Container as d,useColorMode as x,useThemeUI as h,Text as u,Styled as f,Input as g,Slider as y}from"theme-ui";import{transparentize as E}from"@theme-ui/color";import b from"next/link";import{Arrow as w,Sun as v}from"@carbonplan/icons";import{PoopSad as k}from"@carbonplan/emoji";import C from"next/head";import{keyframes as S}from"@emotion/react";function z(){return z=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},z.apply(this,arguments)}function M(e,t){if(null==e)return{};var r,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)t.indexOf(r=a[n])>=0||(o[r]=e[r]);return o}const A=["sx","children"],L=t=>{let{sx:r,children:n}=t,o=M(t,A);const a=r&&r.color?r.color:"primary";return e.createElement(i,z({sx:z({display:"inline-block",width:"fit-content",height:["24px","24px","24px","26px"],borderRadius:"5px",backgroundColor:"primary"==a||"secondary"==a?"muted":E(a,.7),textAlign:"center",userSelect:"none",fontSize:[2,2,2,3]},r)},o),e.createElement(i,{sx:{letterSpacing:"0.02em",fontFamily:"mono",mt:["1px","1px","1px","0px"],px:[1,1,1,"5px"],color:a}},n))},W=({children:t})=>{const r=t.props.children.slice(0,1);return e.createElement(i,{variant:"styles.blockquote",sx:{textIndent:"“"===r?["-0.4em"]:[0]}},t)},T=["href","children","internal","tracking"];var F=t((t,r)=>{let{href:n,children:o,internal:a=!1,tracking:l=!1}=t,i=M(t,T);if(a||n&&n.startsWith("/"))return e.createElement(b,{href:n,passHref:!0},e.createElement(c,z({ref:r},i),o));if(l){let t,a;n&&n.includes("pdf")?(t="PDF",a="download"):(t="website",a="external");const l=e=>{(({action:e,category:t,label:r,value:n})=>{"function"==typeof window.gtag?window.gtag("event",e,{event_category:t,event_label:r,value:n}):console.warn(`Missing window.gtag, skipping analytics action: '${e}'.`)})({action:t,category:a,label:n})};return e.createElement(c,z({ref:r,onClick:l,onContextMenu:l,href:n},i),o)}return e.createElement(c,z({ref:r,href:n},i),o)});const I=e=>{if(!["xs","sm","md","lg","xl"].includes(e))throw new Error("Size must be xs, sm, md, lg, or xl");let t,r,n,o;return"xs"===e&&(t=[2,2,2,3],r="body",n="body",o=[1.2]),"sm"===e&&(t=[3,3,3,4],r="body",n="body",o=[1.2]),"md"===e&&(t=[4,4,4,5],r="body",n="body",o=[1.2]),"lg"===e&&(t=[5,5,6,7],r="heading",n="heading",o=[1.2,1.2,1.25,1.25]),"xl"===e&&(t=[6,7,8,9],r="heading",n="heading",o=[1.25]),{fontSize:t,fontFamily:r,letterSpacing:n,lineHeight:o}},B=["size","prefix","suffix","inverted","sx","children","align","href","internal","tracking"];var D=t((t,n)=>{let o,a,l,c,s,{size:m="sm",prefix:p,suffix:d,inverted:x,sx:h,children:u,align:f,href:g,internal:y,tracking:E}=t,b=M(t,B);if(!["xs","sm","md","lg","xl"].includes(m))throw new Error("Size must be xs, sm, md, lg, or xl");const w=h&&h.color?h.color:null,v=w||(x?"secondary":"primary"),k=w||x?"primary":"secondary";let C,S,A,L,W,T;"xs"===m&&(a=["6px","6px","6px","6px"],l=[12,12,12,13],c=[12,12,12,13],s=[1.5,1.5,1.5,1.5],o={transform:"translateY(0.25px)"}),"sm"===m&&(a=["7px","7px","7px","7px"],l=[13,13,13,18],c=[13,13,13,18],s=[1.5,1.5,1.5,2],o={transform:"translateY(0.25px)"}),"md"===m&&(a=["8px","8px","8px","8px"],l=[18,18,18,24],c=[18,18,18,24],s=[2,2,2,3]),"lg"===m&&(a=["10px","10px","12px","16px"],l=[24,24,34,46],c=[24,24,34,46],s=[3,3,4,5]),"xl"===m&&(a=["12px","16px","18px","20px"],l=[34,46,56,68],c=[34,46,56,68],s=[4,5,6,7]),f?(A=f,L=f):p&&d?(A="initial",L="initial"):p?A="initial":d&&(L="middle"),W="middle"===A?{}:o,T="middle"===L?{}:o,p&&(C={"&:hover > #prefix-span > #prefix":z({color:k},p.type.hover)},p=r(p,{id:"prefix",sx:z({position:"relative",height:l,width:c,mr:u?a:[0],strokeWidth:s,verticalAlign:A,transition:"color 0.15s, transform 0.15s"},p.props.sx)})),d&&(S={"&:hover > #suffix-span >#suffix":z({color:k},d.type.hover)},d=r(d,{id:"suffix",sx:z({height:l,width:c,ml:u?a:[0],strokeWidth:s,verticalAlign:L,transition:"color 0.15s, transform 0.15s"},d.props.sx)}));const D=z({},I(m),{lineHeight:1.05,border:"none",background:"transparent",display:"block",color:v,padding:[0],textAlign:"left",cursor:"pointer",width:"fit-content","@media (hover: hover) and (pointer: fine)":z({"&:hover":{color:k}},S,C)},h),O=e.createElement(e.Fragment,null,e.createElement(i,{as:"span",id:"prefix-span",sx:z({display:"inline-block"},W)},p&&p),e.createElement(i,{as:"span",sx:{transition:"color 0.15s"}},u),e.createElement(i,{as:"span",id:"suffix-span",sx:z({display:"inline-block"},T)},d&&d));return g?e.createElement(F,z({ref:n,href:g,internal:y,tracking:E,sx:z({},D,{textDecoration:"none"})},b),O):e.createElement(i,z({ref:n,as:"button",sx:D},b),O)});const O=["label","children","inverted","color","href","internal","tracking","sx"];var $=t((t,r)=>{let{label:n,children:o,inverted:a,color:l,href:c,internal:s,tracking:m,sx:p}=t,d=M(t,O);const x=l||(a?"secondary":"primary"),h=l||a?"primary":"secondary",u=z({border:"none",padding:[0],fontSize:[3,3,3,4],color:x,background:"transparent",textDecoration:"none",fontFamily:"body",lineHeight:"h3",letterSpacing:"body",width:"fit-content",cursor:"pointer",textAlign:"left",mb:[1],"@media (hover: hover) and (pointer: fine)":{"&:hover > #container > #arrow":{transform:"rotate(45deg)",fill:h},"&:hover":{color:h}}},p),f=e.createElement(e.Fragment,null,e.createElement(i,{sx:{transition:"0.15s",letterSpacing:"body",pb:["6px"]}},o),e.createElement(i,{sx:{transition:"0.15s",display:"inline-block",textTransform:"uppercase",letterSpacing:"smallcaps",fontFamily:"heading",fontSize:[2,2,2,3]}},n),e.createElement(i,{as:"span",id:"container",sx:{ml:[2],display:"inline-block"}},e.createElement(w,{id:"arrow",sx:{transition:"fill 0.15s, transform 0.15s",position:"relative",top:["2px"],color:x,height:[15,15,15,17],width:[15,15,15,17]}})));return c?e.createElement(F,z({ref:r,href:c,internal:s,tracking:m,sx:u},d),f):e.createElement(i,z({ref:r,as:"button",sx:u},d),f)});const R=["colormap","label","clim","setClim","setClimStep","discrete","units","width","height","format","horizontal","bottom","sx","sxClim"],H=e=>({fontFamily:"mono",fontSize:["9px",0,0,1],letterSpacing:"smallcaps",textTransform:"uppercase","@media (hover: hover) and (pointer: fine)":{"&:hover":{borderBottom:e?({colors:e})=>`solid 1px ${e.primary} !important`:"unset"}},"&:focus":{outline:"none",borderBottom:e?({colors:e})=>`solid 1px ${e.primary} !important`:"unset"},transition:"border 0.15s",userSelect:e?"none !important":"unset",width:"fit-content",minWidth:"fit-content"}),_={width:["10px","16px","16px","17px"],height:["80px","110px","110px","130px"]},j=({colormap:t,discrete:r,horizontal:n,width:o,height:a})=>{const l=1/t.length*100,c=`linear-gradient(to ${n?"right":"top"}, ${t.map((e,n)=>`rgb(${e}) ${n*l}% ${r&&n<t.length-1?(n+1)*l+"%":""}`).join(",")})`;return e.createElement(i,{sx:z({},n?{width:o||_.height,height:a||_.width}:{width:o||_.width,minHeight:a||_.height},{mt:n?["1px","1px","1px",0]:0,border:({colors:e})=>`solid 1px ${e.hinted}`,background:c})})},V=({label:t,units:r,horizontal:n})=>e.createElement(i,{sx:!n&&{width:["13px","17px","17px","19px"],alignSelf:"flex-end"}},e.createElement(i,{sx:z({mb:n?0:["-4px","-4px","-4px","-3px"],fontFamily:"mono",fontSize:["9px",0,0,1],letterSpacing:"smallcaps",textTransform:"uppercase"},n?{}:{writingMode:"vertical-rl",transform:"rotate(180deg)",whiteSpace:"nowrap",display:"inline-block",overflow:"visible"})},t," ",e.createElement(i,{as:"span",sx:{textTransform:"none",color:"secondary",display:"inline-block"}},r))),N=t=>{let{colormap:r,label:l,clim:c,setClim:m,setClimStep:p=1,discrete:d,units:x,width:h,height:u,format:f=(e=>e),horizontal:g=!1,bottom:y=!1,sx:E,sxClim:b}=t,w=M(t,R);if(!Array.isArray(r))throw new Error(`expected array for colormap, got '${r}'.`);const v=[n(),n()],[k,C]=o(!1),[S,A]=o(!1);let L,W,T,F=0,I=null,B=[0,0],D=p;const O=e=>{"min"!==I||k||C(!0),"max"!==I||S||A(!0),T=e.pageX-L,F=e.pageY-W,g?("min"===I&&m(e=>[Math.min(B[0]+T*D,B[1]),e[1]]),"max"===I&&m(e=>[e[0],Math.max(B[1]+T*D,B[0])])):("min"===I&&m(e=>[Math.min(B[0]-F*D,B[1]),e[1]]),"max"===I&&m(e=>[e[0],Math.max(B[1]-F*D,B[0])]))},$=e=>{W=e.pageY,L=e.pageX,I=e.target.id,B=c,document.body.setAttribute("style",g?"cursor: ew-resize !important":"cursor: ns-resize !important"),document.addEventListener("mousemove",O);const t=()=>{document.body.setAttribute("style","cursor: unset"),document.removeEventListener("mousemove",O),window.removeEventListener("mouseup",t),"min"===I&&C(!1),"max"===I&&A(!1)};window.addEventListener("mouseup",t)};a(()=>{const e=e=>{(["ArrowUp","ArrowRight"].includes(e.code)||["ArrowUp","ArrowRight"].includes(e.key))&&(e=>{v[0].current===document.activeElement&&(e.preventDefault(),m(e=>[Math.min(e[0]+D,e[1]),e[1]]),v[0].current.focus()),v[1].current===document.activeElement&&(e.preventDefault(),m(e=>[e[0],Math.max(e[1]+D,e[0])]),v[1].current.focus())})(e),(["ArrowDown","ArrowLeft"].includes(e.code)||["ArrowDown","ArrowLeft"].includes(e.key))&&(e=>{v[0].current===document.activeElement&&(e.preventDefault(),m(e=>[Math.min(e[0]-D,e[1]),e[1]]),v[0].current.focus()),v[1].current===document.activeElement&&(e.preventDefault(),m(e=>[e[0],Math.max(e[1]-D,e[0])]),v[1].current.focus())})(e)};return window.addEventListener("keydown",e),()=>{window.removeEventListener("keydown",e)}},[c]);const N=()=>e.createElement(i,{id:"min",ref:v[0],tabIndex:0,sx:z({},H(m),{ml:l?g?y?"0px":"10px":["2px","1px","1px","2px"]:0,mr:g?["2px","1px","1px","2px"]:0,mb:g?0:["-2px","-2px","-2px","-3px"],borderBottom:m?k?({colors:e})=>`solid 1px ${e.primary}`:({colors:e})=>`solid 1px ${e.secondary}`:"unset",cursor:m?g?"ew-resize":"ns-resize":"default"},b),onMouseDown:m?$:()=>{},onClick:()=>v[0].current.focus()},f(c[0])),P=()=>e.createElement(i,{id:"max",ref:v[1],tabIndex:0,sx:z({},H(m),{ml:["2px","1px","1px","2px"],mt:g?0:["-2px","-3px","-3px","-3px"],borderBottom:m?S?({colors:e})=>`solid 1px ${e.primary}`:({colors:e})=>`solid 1px ${e.secondary}`:"unset",cursor:m?g?"ew-resize":"ns-resize":"default"},b),onMouseDown:m?$:()=>{},onClick:()=>v[1].current.focus()},f(c[1]));return e.createElement(s,z({},w,{sx:z({flexDirection:"row",alignItems:"start",justifyContent:"flex-start",gap:["3px","6px","6px","7px"],height:g?"unset":"100%"},E)}),l&&e.createElement(V,{label:l,units:x,horizontal:g}),e.createElement(s,{sx:{flexGrow:g?1:"unset",flexDirection:"column",ml:y&&l?"4px":"0px",height:g?"unset":"100%"}},e.createElement(s,{sx:{gap:["3px","6px","6px","7px"],height:g?"unset":"100%"}},g&&c&&!y&&e.createElement(N,null),e.createElement(j,{colormap:r,horizontal:g,discrete:d,width:h,height:u}),g&&c&&!y&&e.createElement(P,null)),g&&c&&y&&e.createElement(s,{sx:{justifyContent:"space-between"}},e.createElement(N,null),e.createElement(P,null))),!g&&e.createElement(s,{sx:{flexDirection:"column-reverse",justifyContent:"space-between",height:u||_.height}},c&&e.createElement(N,null),c&&e.createElement(P,null)))},P=["start","width","dl","dr","children","sx"],G=t=>{let{start:r,width:n,dl:o,dr:a,children:l,sx:c}=t,s=M(t,P);r=r||"auto",n=n||"auto";const m=e=>{if(e&&!Array.isArray(e)&&(e=[e]),![1,2,4].includes(e.length))throw new Error("Array length must be 1, 2, or 4");return Array.isArray(e)&&1==e.length?e=e.map(e=>[e,e,e,e]).flat():Array.isArray(e)&&2==e.length&&(e=e.map(e=>[e,e]).flat()),e};r=m(r),n=m(n);const p=r.map((e,t)=>"auto"==e?"auto":e+n[t]);let d,x;if(o){if(![.5,1].includes(o))throw new Error("dl must be 0.5 or 1");.5===o&&(d=["-12px",-3,-3,-4]),1===o&&(d=[-4,-5,-5,-6])}if(a){if(![.5,1].includes(a))throw new Error("dr must be 0.5 or 1");.5===a&&(x=["-12px",-3,-3,-4]),1===a&&(x=[-4,-5,-5,-6])}return e.createElement(i,z({},s,{sx:z({gridColumnStart:r,gridColumnEnd:p,ml:d,mr:x},c)}),l)},Y=({title:t,description:r,card:n})=>(r=r||"Data and science for climate action.",n=n||"https://images.carbonplan.org/social/homepage.png",e.createElement(C,null,e.createElement("title",null,t=t||"carbonplan"),e.createElement("meta",{name:"description",content:r}),e.createElement("meta",{name:"viewport",content:"initial-scale=1.0, width=device-width"}),e.createElement("link",{rel:"canonical",content:"https://carbonplan.org/"}),e.createElement("link",{rel:"icon",type:"image/svg+xml",href:"https://images.carbonplan.org/favicon.svg"}),e.createElement("link",{rel:"preload",href:"https://fonts.carbonplan.org/relative/relative-book-pro.woff2",as:"font",type:"font/woff2",crossOrigin:"anonymous"}),e.createElement("link",{rel:"preload",href:"https://fonts.carbonplan.org/relative/relative-medium-pro.woff2",as:"font",type:"font/woff2",crossOrigin:"anonymous"}),e.createElement("link",{rel:"preload",href:"https://fonts.carbonplan.org/relative/relative-mono-11-pitch-pro.woff2",as:"font",type:"font/woff2",crossOrigin:"anonymous"}),e.createElement("link",{rel:"preload",href:"https://fonts.carbonplan.org/relative/relative-faux-book-pro.woff2",as:"font",type:"font/woff2",crossOrigin:"anonymous"}),e.createElement("link",{rel:"manifest",href:"https://images.carbonplan.org/manifest.json"}),e.createElement("meta",{name:"theme-color",content:"#1b1e23"}),e.createElement("link",{rel:"alternate icon",type:"image/png",href:"https://images.carbonplan.org/favicon.png"}),e.createElement("link",{rel:"mask-icon",href:"https://images.carbonplan.org/safari-pinned-tab.svg",color:"#000000"}),e.createElement("link",{rel:"apple-touch-icon",sizes:"180x180",href:"https://images.carbonplan.org/apple-touch-icon.png"}),e.createElement("meta",{name:"msapplication-TileColor",content:"#1b1e23"}),e.createElement("meta",{name:"msapplication-TileImage",content:"https://images.carbonplan.org/mstile-144x144.png"}),e.createElement("meta",{name:"msapplication-config",content:"https://images.carbonplan.org/browserconfig.xml"}),e.createElement("meta",{property:"og:title",content:t}),e.createElement("meta",{property:"og:description",content:r}),e.createElement("meta",{property:"og:image",content:n}),e.createElement("meta",{property:"og:url",content:"https://carbonplan.org"}),e.createElement("meta",{name:"twitter:title",content:t}),e.createElement("meta",{name:"twitter:description",content:r}),e.createElement("meta",{name:"twitter:image",content:n}),e.createElement("meta",{name:"twitter:card",content:"summary_large_image"}))),X=t=>{let r=z({},t);return e.createElement(i,z({as:"svg",width:"150",fill:"currentColor",stroke:"none",viewBox:"0 0 151.1 28.8"},r),e.createElement("g",null,e.createElement("g",null,e.createElement("path",{d:"M9.7,20.1c-1.3-1.4-2-3.1-2-5.2c0-2.1,0.7-3.9,2-5.2c1.3-1.4,3-2,5.1-2c1.7,0,3.1,0.4,4.3,1.3 c1.1,0.9,1.8,2.1,2.1,3.5c0,0.1,0,0.2,0,0.3s-0.1,0.2-0.2,0.2h-2.3c-0.2,0-0.3-0.1-0.4-0.2c-0.3-0.8-0.7-1.4-1.3-1.8 c-0.6-0.4-1.4-0.6-2.2-0.6c-1.3,0-2.3,0.4-3,1.2c-0.8,0.8-1.1,1.9-1.1,3.4c0,1.5,0.4,2.6,1.1,3.4c0.8,0.8,1.8,1.2,3,1.2 c0.8,0,1.6-0.2,2.2-0.6c0.6-0.4,1.1-1,1.3-1.8c0.1-0.2,0.2-0.2,0.4-0.3H21c0.1,0,0.2,0.1,0.2,0.2c0,0.1,0,0.2,0,0.3 c-0.3,1.4-1,2.6-2.1,3.5c-1.1,0.9-2.5,1.3-4.3,1.3C12.7,22.1,11,21.4,9.7,20.1z"})),e.createElement("g",null,e.createElement("path",{d:"M22.5,17.6c0-1.5,0.5-2.6,1.6-3.5c1.1-0.8,2.4-1.2,4.1-1.2c1.1,0,2.4,0.2,3.7,0.6V13c0-0.9-0.3-1.6-0.8-2.1 c-0.5-0.5-1.2-0.8-2.2-0.8c-1.4,0-2.4,0.6-2.9,1.8c-0.1,0.2-0.2,0.2-0.4,0.2h-2.3c-0.1,0-0.2-0.1-0.2-0.2c0-0.1,0-0.2,0-0.3 c0.3-1.2,0.9-2.2,1.9-2.9c1-0.8,2.3-1.1,3.8-1.1C30.6,7.6,32,8.1,33,9c1,0.9,1.5,2.2,1.5,3.8V19c0,1.1,0.2,1.9,0.5,2.6 c0,0.1,0.1,0.1,0.1,0.1c0,0.1-0.1,0.1-0.3,0.1h-2.8c-0.2,0-0.3-0.1-0.3-0.3v-1c-1.1,1.1-2.5,1.6-4.3,1.6c-1.4,0-2.6-0.4-3.6-1.2 C23,20.1,22.5,19,22.5,17.6z M25.4,17.5c0,0.6,0.2,1.1,0.7,1.5c0.4,0.4,1.1,0.5,1.9,0.5c1.1,0,2-0.3,2.8-0.9 c0.8-0.6,1.1-1.5,1.1-2.6c-1.3-0.4-2.5-0.6-3.6-0.6c-0.8,0-1.5,0.2-2.1,0.5C25.7,16.3,25.4,16.8,25.4,17.5z"})),e.createElement("g",null,e.createElement("path",{d:"M37,21.6V8.2c0-0.2,0.1-0.3,0.3-0.3h2.2c0.2,0,0.3,0.1,0.3,0.3v1.1c1-1.1,2.3-1.6,3.7-1.6 c0.8,0,1.7,0.1,2.5,0.4c0.2,0.1,0.3,0.3,0.3,0.5v2.2c0,0.2-0.1,0.3-0.2,0.3c0,0-0.1,0-0.2-0.1c-1.1-0.5-2-0.8-2.9-0.8 c-0.9,0-1.7,0.4-2.3,1.1c-0.6,0.7-0.9,1.7-0.9,3v7.3c0,0.2-0.1,0.3-0.3,0.3h-2.2C37.1,21.8,37,21.7,37,21.6z"})),e.createElement("g",null,e.createElement("path",{d:"M47.6,21.6V2.7c0-0.2,0.1-0.3,0.3-0.3H50c0.2,0,0.3,0.1,0.3,0.3v6.5c1.3-1.1,2.7-1.6,4.3-1.6 c1.9,0,3.4,0.7,4.6,2c1.1,1.3,1.7,3.1,1.7,5.3c0,2.2-0.6,4-1.7,5.3c-1.1,1.3-2.7,2-4.6,2c-1.8,0-3.2-0.5-4.3-1.6v1 c0,0.2-0.1,0.3-0.3,0.3h-2.2C47.7,21.8,47.6,21.7,47.6,21.6z M51.2,11.5c-0.7,0.9-1.1,2-1.1,3.3c0,1.4,0.4,2.5,1.1,3.3 s1.7,1.3,2.9,1.3c1.2,0,2.2-0.4,2.9-1.3c0.7-0.9,1.1-2,1.1-3.3c0-1.4-0.4-2.5-1.1-3.3c-0.7-0.9-1.7-1.3-2.9-1.3 C52.9,10.2,51.9,10.7,51.2,11.5z"})),e.createElement("g",null,e.createElement("path",{d:"M64.3,20.1c-1.4-1.4-2.1-3.1-2.1-5.2c0-2.1,0.7-3.9,2.1-5.2c1.4-1.4,3.1-2,5.2-2c2.1,0,3.8,0.7,5.2,2 c1.4,1.4,2.1,3.1,2.1,5.2c0,2.1-0.7,3.9-2.1,5.2c-1.4,1.4-3.1,2-5.2,2C67.4,22.1,65.7,21.4,64.3,20.1z M66.4,11.5 c-0.8,0.8-1.2,2-1.2,3.4c0,1.4,0.4,2.5,1.2,3.4s1.9,1.3,3.1,1.3c1.3,0,2.3-0.4,3.1-1.3c0.8-0.8,1.2-2,1.2-3.4 c0-1.4-0.4-2.5-1.2-3.4c-0.8-0.8-1.9-1.3-3.1-1.3C68.2,10.2,67.2,10.7,66.4,11.5z"})),e.createElement("g",null,e.createElement("path",{d:"M78.7,21.6V8.2c0-0.2,0.1-0.3,0.3-0.3h2.2c0.2,0,0.3,0.1,0.3,0.3v1.3c1.3-1.2,2.7-1.8,4.4-1.8 c1.5,0,2.7,0.4,3.5,1.3c0.8,0.9,1.3,2,1.3,3.6v9.1c0,0.2-0.1,0.3-0.3,0.3h-2.2c-0.2,0-0.3-0.1-0.3-0.3v-8.3c0-2-0.9-3.1-2.8-3.1 c-1.1,0-1.9,0.4-2.7,1.2c-0.7,0.8-1.1,2-1.1,3.5v6.6c0,0.2-0.1,0.3-0.3,0.3h-2.2C78.7,21.8,78.7,21.7,78.7,21.6z"})),e.createElement("g",null,e.createElement("path",{d:"M101.7,27.1V8.2c0-0.2,0.1-0.3,0.3-0.3h2.2c0.2,0,0.3,0.1,0.3,0.3v1c1.1-1.1,2.5-1.6,4.3-1.6 c1.9,0,3.4,0.7,4.6,2s1.7,3.1,1.7,5.3c0,2.2-0.6,4-1.7,5.3c-1.1,1.3-2.7,2-4.6,2c-1.5,0-3-0.5-4.3-1.6v6.6c0,0.2-0.1,0.3-0.3,0.3 H102C101.8,27.3,101.7,27.2,101.7,27.1z M105.3,11.5c-0.7,0.9-1.1,2-1.1,3.3c0,1.4,0.4,2.5,1.1,3.3s1.7,1.3,2.9,1.3 c1.2,0,2.2-0.4,2.9-1.3c0.7-0.9,1.1-2,1.1-3.3c0-1.4-0.4-2.5-1.1-3.3c-0.7-0.9-1.7-1.3-2.9-1.3C107,10.2,106,10.7,105.3,11.5z"})),e.createElement("g",null,e.createElement("path",{d:"M117.2,21.6V2.7c0-0.2,0.1-0.3,0.3-0.3h2.2c0.2,0,0.3,0.1,0.3,0.3v18.9c0,0.2-0.1,0.3-0.3,0.3h-2.2 C117.3,21.8,117.2,21.7,117.2,21.6z"})),e.createElement("g",null,e.createElement("path",{d:"M122,17.6c0-1.5,0.5-2.6,1.6-3.5c1.1-0.8,2.4-1.2,4.1-1.2c1.1,0,2.4,0.2,3.7,0.6V13c0-0.9-0.3-1.6-0.8-2.1 c-0.5-0.5-1.2-0.8-2.2-0.8c-1.4,0-2.4,0.6-2.9,1.8c-0.1,0.2-0.2,0.2-0.4,0.2h-2.3c-0.1,0-0.2-0.1-0.2-0.2c0-0.1,0-0.2,0-0.3 c0.3-1.2,0.9-2.2,1.9-2.9c1-0.8,2.3-1.1,3.8-1.1c1.7,0,3.1,0.5,4.2,1.4s1.5,2.2,1.5,3.8V19c0,1.1,0.2,1.9,0.5,2.6 c0,0.1,0.1,0.1,0.1,0.1c0,0.1-0.1,0.1-0.3,0.1h-2.8c-0.2,0-0.3-0.1-0.3-0.3v-1c-1.1,1.1-2.5,1.6-4.3,1.6c-1.4,0-2.6-0.4-3.6-1.2 C122.5,20.1,122,19,122,17.6z M124.9,17.5c0,0.6,0.2,1.1,0.7,1.5c0.4,0.4,1.1,0.5,1.9,0.5c1.1,0,2-0.3,2.8-0.9 c0.8-0.6,1.1-1.5,1.1-2.6c-1.3-0.4-2.5-0.6-3.6-0.6c-0.8,0-1.5,0.2-2.1,0.5C125.2,16.3,124.9,16.8,124.9,17.5z"})),e.createElement("g",null,e.createElement("path",{d:"M136.9,21.6V8.2c0-0.2,0.1-0.3,0.3-0.3h2.2c0.2,0,0.3,0.1,0.3,0.3v1.3c1.3-1.2,2.7-1.8,4.4-1.8 c1.5,0,2.7,0.4,3.5,1.3c0.8,0.9,1.3,2,1.3,3.6v9.1c0,0.2-0.1,0.3-0.3,0.3h-2.2c-0.2,0-0.3-0.1-0.3-0.3v-8.3c0-2-0.9-3.1-2.8-3.1 c-1.1,0-1.9,0.4-2.7,1.2c-0.7,0.8-1.1,2-1.1,3.5v6.6c0,0.2-0.1,0.3-0.3,0.3h-2.2C137,21.8,136.9,21.7,136.9,21.6z"})),e.createElement("path",{d:"M97.6,14.9c0,4.2-0.6,8.3-1.6,12.3c0,0.1-0.1,0.2-0.2,0.2h-2.4c-0.1,0-0.2-0.1-0.2-0.3c1.1-3.9,1.7-8,1.7-12.2 s-0.6-8.3-1.7-12.2c0-0.1,0.1-0.3,0.2-0.3l2.4,0c0.1,0,0.2,0.1,0.2,0.2C97.1,6.5,97.6,10.6,97.6,14.9z"}),e.createElement("path",{d:"M1.4,14.9C1.4,10.6,2,6.5,3,2.6c0-0.1,0.1-0.2,0.2-0.2l2.4,0c0.1,0,0.2,0.1,0.2,0.3c-1.1,3.9-1.7,8-1.7,12.2 s0.6,8.3,1.7,12.2c0,0.1-0.1,0.3-0.2,0.3H3.3c-0.1,0-0.2-0.1-0.2-0.2C2,23.2,1.4,19.1,1.4,14.9z"})))},U=["children","sx","columns","gap"],q=t=>{let{children:r,sx:n,columns:o,gap:a}=t,l=M(t,U);const i=e=>{if(Array.isArray(e)||(e=[e,e,e,e]),Array.isArray(e)&&![1,2,4].includes(e.length))throw new Error("Array length must be 1, 2, or 4");return Array.isArray(e)&&1==e.length&&(e=e.map(e=>[e]).flat()),Array.isArray(e)&&2==e.length&&(e=e.map(e=>[e,e]).flat()),e};let c,s;return Number.isInteger(a)||Array.isArray(a)?(a=i(a),c=a,s=a):(c=[4,5,5,6],s=[0,0,0,0]),o=Number.isInteger(o)||Array.isArray(o)?i(o):[6,8,12,12],e.createElement(m,z({},l,{columns:o,sx:z({columnGap:c,rowGap:s},n)}),r)},K=["value","sx"],Z=t=>{let{value:r,sx:n}=t,o=M(t,K);return e.createElement(p,z({sx:z({cursor:"pointer",fill:"none",strokeWidth:"2px",stroke:"text",".paren":{opacity:"0"},"@media (hover: hover) and (pointer: fine)":{"&:hover .paren":{opacity:"1"}}},n),"aria-label":"Toggle Menu"},o),!r&&e.createElement("svg",{style:{width:"50px",height:"30px",transform:"scale(2)",marginTop:"-3px"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 68 36"},e.createElement("line",{x1:"52",y1:"29.9",x2:"16",y2:"29.9"}),e.createElement("line",{x1:"52",y1:"6.1",x2:"16",y2:"6.1"}),e.createElement("line",{x1:"52",y1:"18",x2:"16",y2:"18"}),e.createElement("path",{style:{transition:"all 0.2s"},className:"paren",d:"M6.4,1.2c-6.3,10.3-6.3,23.3,0,33.6"}),e.createElement("path",{style:{transition:"all 0.2s"},className:"paren",d:"M61.6,34.8c6.3-10.3,6.3-23.3,0-33.6"})),r&&e.createElement("svg",{style:{width:"50px",height:"30px",transform:"scale(2)",marginTop:"-3px"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 68 36"},e.createElement("line",{x1:"50.85",y1:"29.79",x2:"17.15",y2:"6.21"}),e.createElement("line",{x1:"17.15",y1:"29.79",x2:"50.85",y2:"6.21"}),e.createElement("path",{style:{transition:"all 0.2s"},className:"paren",d:"M6.4,1.2c-6.3,10.3-6.3,23.3,0,33.6"}),e.createElement("path",{style:{transition:"all 0.2s"},className:"paren",d:"M61.6,34.8c6.3-10.3,6.3-23.3,0-33.6"})))},J=(e,t,r=!1)=>({width:"auto",color:e===t?"secondary":"text",fontSize:[6,6,7,8],fontFamily:"heading",letterSpacing:"heading",borderStyle:"solid",borderColor:"muted",borderWidth:"0px",borderBottomWidth:"1px",borderTopWidth:r?"1px":"0px",py:[3,3,4,5],textDecoration:"none",display:"block",position:"relative",transition:"color 0.15s","@media (hover: hover) and (pointer: fine)":{"&:hover > #arrow":{opacity:1}},"&:hover":{color:e==t?"secondary":"text"}}),Q=[{url:"about",display:"About"},{url:"research",display:"Research"},{url:"blog",display:"Blog"},{url:"press",display:"Press"}],ee=()=>e.createElement(w,{id:"arrow",sx:{pointerEvents:"none",display:"inline-block",position:"absolute",left:["-60px","-68px","-80px","-104px"],top:["32px","32px","46px","62px"],opacity:0,transition:"opacity 0.2s ease-out",transform:"rotate(45deg)",width:[36,36,48,56],height:[36,36,48,56]}}),te=({link:t,mode:r,nav:n,first:o,setExpanded:a})=>{const{url:l,display:i}=t,s="remote"===r?"https://carbonplan.org/"+l:"/"+l;return"homepage"===r||"local"===r&&n===l?e.createElement(b,{href:s,passHref:!0},e.createElement(c,{onClick:()=>{n===l&&a(!1)},sx:J(n,l,o)},e.createElement(ee,null),i)):e.createElement(c,{href:s,sx:J(n,l,o)},e.createElement(ee,null),i)},re=({links:t,nav:r,mode:n,setExpanded:o})=>t.map((t,a)=>e.createElement(te,{key:a,link:t,mode:n,nav:r,first:0===a,setExpanded:o})),ne=({status:t,mode:r,nav:n,menuItems:a})=>{const[l,m]=o(!1);return e.createElement(q,{sx:{pt:["12px"],pb:[3]}},e.createElement(G,{start:[1],width:[2]},e.createElement(i,{sx:{pointerEvents:"all",display:"block",width:"fit-content"}},("homepage"==r||"local"==r)&&e.createElement(b,{href:"/",passHref:!0},e.createElement(c,{"aria-label":"CarbonPlan Homepage",sx:{display:"block"}},e.createElement(X,{id:"logo",sx:{cursor:"pointer",color:"primary"}}))),(null==r||"remote"==r)&&e.createElement(c,{href:"https://carbonplan.org","aria-label":"CarbonPlan Homepage",sx:{display:"block"}},e.createElement(X,{sx:{cursor:"pointer",color:"primary"}})))),e.createElement(G,{start:[4,9],width:[2,2],dr:1,sx:{display:[t?"flex":"none","flex","flex","flex"],alignItems:"center"}},e.createElement(i,{sx:{fontSize:[1,2,3],position:"relative",top:["-2px","-3px","-3px"]}},t?`(${t})`:"")),e.createElement(G,{start:[t?6:4,6,11,11],width:[t?1:3,3,2,2],sx:{zIndex:5e3}},e.createElement(s,{sx:{pointerEvents:"all",justifyContent:"flex-end"}},e.createElement(i,{sx:{display:[t?"none":"flex","flex","flex","flex"],mr:"18px",gap:"18px",opacity:l?0:1,transition:"opacity 0.15s",justifyContent:"space-between",alignItems:"center"}},a),e.createElement(Z,{sx:{flexShrink:0,mr:["-2px"]},value:l,onClick:e=>{m(!l)}}))),e.createElement(i,{sx:{opacity:l?1:0,pointerEvents:l?"all":"none",position:"fixed",top:"0px",right:"0px",bottom:"0px",minWidth:"0px",maxHeight:"100vh",width:"100vw",backgroundColor:"background",zIndex:4e3,pt:["79px"],transition:"opacity 0.25s"}},e.createElement(d,null,e.createElement(q,null,e.createElement(G,{start:[2,4,7,7],width:[5,4,5,5]},e.createElement(i,{as:"nav",sx:{display:l?"inherit":"none",mt:[5,5,5,6]}},e.createElement(re,{links:Q,nav:n,mode:r,setExpanded:m})))))))},oe=t=>{let r=z({},t);return e.createElement(i,z({as:"svg",width:"80",stroke:"none",fill:"currentColor",viewBox:"0 0 32 32"},r),e.createElement("path",{d:"M21.9395,14.9395 L17.5005,19.3785 L17.5005,7.0005 L14.5005,7.0005 L14.5005,19.3785 L10.0605,14.9395 L7.9395,17.0605 L14.9395,24.0605 C15.2325,24.3535 15.6165,24.5005 16.0005,24.5005 C16.3835,24.5005 16.7675,24.3535 17.0605,24.0605 L24.0605,17.0605 L21.9395,14.9395 Z"}),e.createElement("path",{d:"M27.5986,4 L22.8966,4 C26.5556,6.303 28.9996,10.366 28.9996,15 C28.9996,20.4 25.6896,25.039 20.9926,27 L26.5586,27 C29.8886,24.068 31.9996,19.785 31.9996,15 C31.9996,10.734 30.3196,6.868 27.5986,4"}),e.createElement("path",{d:"M3,15 C3,10.366 5.444,6.303 9.104,4 L4.401,4 C1.68,6.868 0,10.734 0,15 C0,19.785 2.112,24.068 5.441,27 L11.008,27 C6.311,25.039 3,20.4 3,15"}))},ae=()=>e.createElement(i,{sx:{mt:[7,7,7,8],mb:[7,7,7,8],pb:[2,1,0,0]}},e.createElement(q,{sx:{mb:[0,0,4,5]}},e.createElement(G,{start:[1,2],width:[3,3]},e.createElement(i,null,e.createElement(i,{sx:{fontSize:[2,2,2,3],fontFamily:"heading",letterSpacing:"mono",mb:[2]}},"EMAIL"),e.createElement(c,{href:"mailto:hello@carbonplan.org",sx:{textDecoration:"none",fontSize:[2,2,2,3]}},"hello@carbonplan.org"))),e.createElement(G,{start:[5],width:[1],dl:1,dr:1,sx:{display:["flex","none","none","none"],justifyContent:["center"]}},e.createElement(oe,{sx:{mt:["-4px"],width:"60px",height:"60px"}})),e.createElement(G,{start:[1,5,5,5],width:[3,3],sx:{mt:[3,0,0,0]}},e.createElement(i,null,e.createElement(i,{sx:{fontSize:[2,2,2,3],fontFamily:"heading",letterSpacing:"mono",mb:[2]}},"FOLLOW"),e.createElement(c,{href:"https://twitter.com/carbonplanorg",sx:{textDecoration:"none",fontSize:[2,2,2,3]}},"@carbonplanorg"))),e.createElement(G,{start:[1,9],width:[5,4,3,3],sx:{mt:["42px","42px",0,0],mb:[3,3,0,0]}},e.createElement(i,null,e.createElement(i,{sx:{fontSize:[2,2,2,3],fontFamily:"body",color:"secondary"}},"CarbonPlan is a registered non-profit public benefit corporation in California with 501(c)(3) status.")))),e.createElement(q,{sx:{mb:["2px"],mt:[5,5,4]}},e.createElement(G,{start:[1,1,2,2],width:[3,2,3,3],sx:{display:"flex",alignItems:["flex-start","flex-start","flex-end"]}},e.createElement(i,{sx:{bottom:"0px",borderStyle:"solid",borderColor:"muted",borderWidth:"0px",borderTopWidth:"1px",pt:[2]}},e.createElement(i,{sx:{color:"secondary",fontSize:[1,1,1,2],fontFamily:"mono",letterSpacing:"mono"}},"(c) 2021 CARBONPLAN"))),e.createElement(G,{start:[4,3,5,5],width:[2,2,3,3],sx:{display:"flex",alignItems:["flex-start","flex-start","flex-end"],mt:[0,0,0,0]}},e.createElement(i,{sx:{bottom:"0px",borderStyle:"solid",borderColor:"muted",borderWidth:"0px",borderTopWidth:"1px",width:["100%","auto","auto","auto"],pt:[2]}},e.createElement(b,{href:"/terms",passHref:!0},e.createElement(i,{as:"a",sx:{textDecoration:"none",fontSize:[1,1,1,2],color:"secondary",fontFamily:"mono",letterSpacing:"mono",display:"block"}},"READ OUR TERMS")))),e.createElement(G,{start:[5,7,9,9],width:[2,3,3,3],sx:{display:["none","initial","initial","initial"]}},e.createElement(oe,{sx:{width:80,height:80,mt:[0,"-10px",4,5],mb:["-12px"]}})))),le=["sx"],ie=t=>{let{sx:r}=t,n=M(t,le);const[o,a]=x(),i=l(()=>{a("light"===o?"dark":"light")},[o]);return e.createElement(p,z({"aria-label":"Toggle dark mode",onClick:i,role:"checkbox",sx:z({width:32,height:32,display:"inline-block",cursor:"pointer",color:"secondary"},r)},n),e.createElement(v,{sx:{strokeWidth:"1.75",transition:"stroke 0.15s","@media (hover: hover) and (pointer: fine)":{"&:hover":{stroke:"primary"}}}}))},ce=()=>{const t=process.env.NEXT_PUBLIC_VERCEL_GIT_COMMIT_SHA,r=process.env.NEXT_PUBLIC_VERCEL_GIT_REPO_OWNER,n=process.env.NEXT_PUBLIC_VERCEL_GIT_REPO_SLUG,{theme:o}=h(),a=o.rawColors.secondary;if(t&&r&&n){const o=t.substring(0,7),l="https://github.com/"+r+"/"+n+"/tree/"+t;return e.createElement(i,{sx:{display:"inline-block",width:"87px"}},e.createElement(se,{color:a}),e.createElement(c,{href:l,sx:{whiteSpace:"nowrap",display:"inline-block",ml:[2],fontFamily:"mono",letterSpacing:"body",color:a,fontSize:[1],textTransform:"uppercase",textDecoration:"none"}},o))}return e.createElement(i,{sx:{display:"inline-block",width:"87px"}},e.createElement(se,{color:a}),e.createElement(u,{sx:{whiteSpace:"nowrap",display:"inline-block",ml:[2],fontFamily:"mono",letterSpacing:"body",color:a,fontSize:[1],textTransform:"uppercase"}},a))},se=({color:t})=>e.createElement("svg",{fill:t,opacity:"0.8",viewBox:"0 0 24 24",width:"24",height:"24"},e.createElement("circle",{r:5,cx:19,cy:19})),me=({mode:t})=>{const[r,n]=o(function(e){return"mouse"===e?`X,Y: ${de(0,4)},${de(0,4)}`:"scroll"===e?`SCROLL: 0.${de((0).toFixed(0),2)}`:e}(t));return a(()=>{if("mouse"===t){const e=e=>{const t=de(e.clientX,4),r=de(e.clientY,4);n(`X,Y: ${t},${r}`)};return window.addEventListener("mousemove",e),()=>{window.removeEventListener("mousemove",e)}}if("scroll"===t){const e=e=>{const t=function(e,t){return Math.min(e.scrollY/(document.body.offsetHeight-770),.99)}(window);n(`SCROLL: 0.${de((100*t).toFixed(0),2)}`)};return window.addEventListener("scroll",e),()=>{window.removeEventListener("scroll",e)}}},[]),e.createElement(u,{sx:{whiteSpace:"nowrap",display:"inline-block",mr:"-6px",fontFamily:"mono",letterSpacing:"body",color:"secondary",fontSize:[1],textTransform:"uppercase"}},r)},pe=({mode:t})=>e.createElement(i,{sx:{userSelect:"none",position:"fixed",bottom:"42px",right:"24px",transformOrigin:"right",transform:"rotate(90deg)",display:["none","none","initial"]}},e.createElement(me,{mode:t}),e.createElement(ce,null));function de(e,t){return e.toString().padStart(t,"0")}const xe=["duration","delay","children"],he=S({from:{opacity:0},to:{opacity:1}}),ue=t=>{let{duration:r=300,delay:n=0,children:o}=t,a=M(t,xe);return e.createElement(i,z({},a,{sx:{animationDuration:r+"ms",animationDelay:n+"ms",animationName:he.toString(),animationFillMode:"backwards"}}),o)},fe=e=>{const t=e.createElement("div");t.style.visibility="hidden",t.style.width="100px",e.body.appendChild(t),t.style.overflow="scroll";const r=e.createElement("div");r.style.width="100%",t.appendChild(r);const n=t.offsetWidth-r.offsetWidth;return t.parentNode.removeChild(t),n},ge=()=>(a(()=>{"undefined"!=typeof document&&fe(document)>0&&(document.body.classList.add("custom-scrollbar"),document.getElementsByTagName("html")[0].classList.add("custom-scrollbar"))},[]),null),ye=({color:t="muted"})=>{const[r,n]=o(!1);return a(()=>{function e(e){const{key:t,metaKey:r}=e;";"===t&&r&&n(e=>!e)}return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}},[]),e.createElement(i,{sx:{position:"fixed",width:"100%",left:0,top:0,zIndex:"teal"===t?5e3:-1,pointerEvents:"none",display:r?"initial":"none"}},e.createElement(d,null,e.createElement(i,{sx:{display:["none","none","initial","initial"]}},e.createElement(be,{indices:[1,2,3,4,5,6,7,8,9,10,11,12],color:t})),e.createElement(i,{sx:{display:["none","initial","none","none"]}},e.createElement(be,{indices:[1,2,3,4,5,6,7,8],color:t})),e.createElement(i,{sx:{display:["initial","none","none","none"]}},e.createElement(be,{indices:[1,2,3,4,5,6],color:t}))))},Ee=["red","orange","yellow","green","teal","blue","purple","pink"];function be({indices:t,color:r}){const n={outerGuideColumn:{borderStyle:"solid",borderWidth:"0px",borderLeftWidth:"teal"===r?"0px":"1px",borderRightWidth:"teal"===r?"0px":"1px",opacity:"teal"==r?.4:1},innerGuideColumn:{borderStyle:"solid",borderWidth:"0px",borderLeftWidth:"0px",borderRightWidth:"0px",opacity:"teal"==r?.4:1}};return e.createElement(q,null,t.map(t=>e.createElement(G,{key:t,start:[t],width:[1,1],dl:.5,dr:.5,sx:z({bg:"teal"===r?"teal":"transparent",height:"100vh"},n.innerGuideColumn)},e.createElement(i,{sx:z({mx:["12px",3,3,4],bg:"teal"===r?"background":"transparent",height:"100%",borderLeftColor:"rainbow"===r?Ee[t%8]:"muted",borderRightColor:"rainbow"===r?Ee[t%8]:"muted"},n.outerGuideColumn)}))))}const we=["value","sx"],ve=t=>{let{value:r,sx:n}=t,o=M(t,we);return e.createElement(p,z({sx:z({cursor:"pointer",fill:"none",strokeWidth:"2px",stroke:"text",".paren":{opacity:"0"},"@media (hover: hover) and (pointer: fine)":{"&:hover .paren":{opacity:"1"}}},n),"aria-label":"Toggle Menu"},o),!r&&e.createElement("svg",{style:{width:"50px",height:"30px",transform:"scale(2)",marginTop:"-3px"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 68 36"},e.createElement("line",{x1:"24",y1:"2.1",x2:"24",y2:"6.1"}),e.createElement("line",{x1:"24",y1:"24.1",x2:"24",y2:"33.9"}),e.createElement("line",{x1:"44",y1:"2.1",x2:"44",y2:"12.1"}),e.createElement("line",{x1:"44",y1:"30.1",x2:"44",y2:"33.9"}),e.createElement("circle",{cx:"24",cy:"15.1",r:"5"}),e.createElement("circle",{cx:"44",cy:"21.1",r:"5"}),e.createElement("path",{style:{transition:"all 0.2s"},className:"paren",d:"M6.4,1.2c-6.3,10.3-6.3,23.3,0,33.6"}),e.createElement("path",{style:{transition:"all 0.2s"},className:"paren",d:"M61.6,34.8c6.3-10.3,6.3-23.3,0-33.6"})),r&&e.createElement("svg",{style:{width:"50px",height:"30px",transform:"scale(2)",marginTop:"-3px"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 68 36"},e.createElement("line",{x1:"50.85",y1:"29.79",x2:"17.15",y2:"6.21"}),e.createElement("line",{x1:"17.15",y1:"29.79",x2:"50.85",y2:"6.21"}),e.createElement("path",{style:{transition:"all 0.2s"},className:"paren",d:"M6.4,1.2c-6.3,10.3-6.3,23.3,0,33.6"}),e.createElement("path",{style:{transition:"all 0.2s"},className:"paren",d:"M61.6,34.8c6.3-10.3,6.3-23.3,0-33.6"})))},ke=({title:t,description:r,card:n,children:o,status:l,nav:c,settings:m,footer:p=!0,header:x=!0,metadata:u="mouse",links:f="remote",dimmer:g="bottom",guide:y=!0,scrollbar:E=!0,fade:b=!0,container:w=!0})=>{let v=o;b&&(v=e.createElement(ue,{duration:250},v)),w&&(v=e.createElement(i,{sx:{mb:[8,8,9,10]}},e.createElement(d,null,v)));const{theme:k}=h();a(()=>{if(!k)return;const e=window.matchMedia(`(min-width: ${k.breakpoints[1]})`);return e.onchange=e=>{e.matches&&null!=m&&m.value&&null!=m&&m.onClick&&(null==m||m.onClick())},()=>{e.onchange=null}},[null==k?void 0:k.breakpoints,null==m?void 0:m.value,null==m?void 0:m.onClick]);const C=[e.createElement(ie,{key:"dimmer",sx:{color:"primary",mt:"-2px",display:["block","block","top"===g?"block":"none","top"===g?"block":"none"]}})];return m&&C.push(e.createElement(ve,z({key:"settings",sx:{mr:["2px"],display:["inherit","inherit","none","none"]}},m))),e.createElement(e.Fragment,null,y&&e.createElement(ye,{color:y}),E&&e.createElement(ge,null),e.createElement(Y,{card:n,description:r,title:t}),e.createElement(s,{sx:{flexDirection:"column",minHeight:"100vh"}},x&&e.createElement(i,{as:"header",sx:{width:"100%",borderStyle:"solid",borderColor:"muted",borderWidth:"0px",borderBottomWidth:"1px",position:"sticky",top:0,bg:"background",height:"56px",zIndex:2e3}},e.createElement(d,null,e.createElement(ne,{mode:f,status:l,nav:c,menuItems:C}))),e.createElement(i,{sx:{width:"100%",flex:"1 1 auto"}},v),p&&e.createElement(i,{as:"footer",sx:{width:"100%",borderStyle:"solid",borderColor:"muted",borderWidth:"0px",borderTopWidth:"1px"}},e.createElement(d,null,e.createElement(ae,null))),"bottom"===g&&e.createElement(i,{sx:{display:["none","none","initial","initial"],position:["fixed"],right:[13],bottom:[17,17,15,15]}},e.createElement(ie,null)),u&&e.createElement(pe,{mode:u})))},Ce=()=>e.createElement(ke,{footer:!1,title:"404 / carbonplan"},e.createElement(q,{sx:{mb:[5,0,0],pt:[0,0,6]}},e.createElement(G,{start:[1,1,3,3],width:[6,4,4,4]},e.createElement(f.h1,null,"Oops!"),e.createElement(i,{sx:{fontSize:[4,4,4,5],lineHeight:"h3",mt:[3,4,4],mb:[2,3,3],maxWidth:["90%","90%","400px"]}},"Sorry but we can't seem to find the page you are looking for."),e.createElement(i,{sx:{color:"secondary",fontFamily:"mono",letterSpacing:"mono",fontSize:[2,2,2,3],mt:[4,5,5]}},"ERROR CODE 404")),e.createElement(G,{start:[2,5,7,7],width:[4,4,4,4]},e.createElement(i,{sx:{width:["100%"],mt:[2,4,4,5],fill:"primary"}},e.createElement(k,{sx:{width:"100%",height:"auto"}}))))),Se=({value:t,id:r,onClick:n,sx:o})=>e.createElement(p,{onClick:n,id:r,role:"checkbox","aria-checked":t,"aria-label":"Expand",sx:z({display:"inline-block",width:24,height:24,p:[1],cursor:"pointer",fill:"secondary",stroke:"secondary","@media (hover: hover) and (pointer: fine)":{"&:hover":{fill:"primary",stroke:"primary"}}},o)},e.createElement("svg",{viewBox:"0 0 16 16"},e.createElement("path",{d:"M8,0 V16 M0,8 H16",style:{strokeWidth:2,transition:"0.25s all",transformOrigin:"8px 8px",transform:t?"rotate(45deg)":""}}))),ze=["label","value","sx","children"],Me=t=>{let{label:r,value:n,sx:o,children:a}=t,l=M(t,ze);const c=o&&o.color?o.color:"primary",s=l&&(l.onClick||l.onDoubleClick);return e.createElement(i,z({as:s?"button":"span",role:"checkbox","aria-checked":n,"aria-label":r,sx:z({display:"inline-block",fontSize:[1,1,1,2],fontFamily:"mono",letterSpacing:"mono",cursor:s?"pointer":"inherit",color:c,backgroundColor:"transparent",borderStyle:"solid",borderColor:c,lineHeight:"body",borderWidth:"0px",borderBottomWidth:"1px",textTransform:"uppercase",userSelect:"none",transition:"opacity 0.05s",pt:["1px"],pb:["2px"],px:[0],m:[0],opacity:null==n||n?1:"primary"==c?.24:.33},o)},l),a)},Ae=["values","setValues","label","colors","showAll","multiSelect"],Le={label:{fontFamily:"mono",letterSpacing:"mono",fontSize:[1,1,1,2],color:"secondary",userSelect:"none",textTransform:"uppercase"}},We=(e,t,r={})=>Object.keys(e).reduce((e,n)=>Object.assign(e,{[n]:r[n]||t}),{}),Te=e=>Object.keys(e).filter(t=>e[t]).length==Object.keys(e).length,Fe=({values:e,multiSelect:t,setValues:r,value:n})=>{const o=Te(e),a="all"===n;let l;t?l=a&&!o?We(e,!0):a&&o?We(e,!1):z({},e,{[n]:!e[n]}):a&&!o?l=We(e,!0):a&&o||(l=We(e,!1,{[n]:!0})),l&&r(l)},Ie=t=>{let{values:r,setValues:n,label:o,colors:a,showAll:l=!1,multiSelect:c=!1}=t,s=M(t,Ae);return e.createElement(i,s,o&&e.createElement(i,{sx:Le.label},o),e.createElement(i,{sx:{mt:o?[3]:0}},l&&e.createElement(Me,{onClick:()=>Fe({values:r,multiSelect:c,setValues:n,value:"all"}),value:Te(r),sx:{mr:[2]}},"All"),Object.keys(r).map((t,o)=>e.createElement(Me,{onClick:()=>Fe({values:r,multiSelect:c,setValues:n,value:t}),onDoubleClick:()=>Fe({values:r,multiSelect:!1,setValues:n,value:t}),key:o,value:r[t],sx:{width:"max-content",color:a?a[t]:"primary",mr:[2],mb:[1]}},t))))},Be={xs:[1],sm:[3],md:[5],lg:[7],xl:[9]},De=({children:t,direction:r="vertical",spacing:n="md"})=>{let o;if("string"==typeof n?o=Be[n]:"number"==typeof n?o=[n]:Array.isArray(n)&&n.every(e=>"number"==typeof e)&&(o=n),!o)throw new Error("Invalid spacing size. Must be numeric value(s) or one of xs, sm, md, lg, or xl");if(!["horizontal","vertical"].includes(r))throw new Error("Invalid direction value. Must be either horizontal or vertical");const a="vertical"===r?"mt":"ml",l="horizontal"===r?{display:"inline-block"}:{};return e.createElement(i,null,e.Children.map(t,(t,r)=>e.createElement(i,{sx:z({[a]:r>0?o:0},l)},t)))},Oe=({children:t,variant:r="h1"})=>{let n;return"h1"===r&&(n=[4,"27px","42px","54px"]),"h2"===r&&(n=[4,4,"14px","54px"]),e.createElement(e.Fragment,null,e.createElement(G,{start:[1,4,8,8],width:[1,1,1,1]},e.createElement(i,{sx:{mt:n,fontFamily:"faux",letterSpacing:"faux",fontSize:[2,2,2,3],textAlign:"right"}},"/")),e.createElement(G,{start:[2,5,9,9],width:[3,3,2,2]},e.createElement(i,{sx:{mt:n,fontFamily:"faux",letterSpacing:"faux",fontSize:[2,2,2,3],height:["100%","0px","0px","0px"]}},t)))},$e=({children:t,sidenote:r,description:n,descriptionStart:o=[1,3,5,5],descriptionWidth:a=[5,5,5,4],sx:l})=>e.createElement(q,{sx:{mt:[5,6,7,8],mb:[5,6,7,8]}},e.createElement(G,{start:[1,1,2,2],width:[6,2,3,3]},e.createElement(i,{as:"h1",variant:"styles.h1",sx:z({my:[0,0,0,0]},l)},t)),r&&e.createElement(Oe,null,r),n&&e.createElement(G,{start:o,width:a},e.createElement(i,{sx:{mt:[4,"5px","20px","31px"],fontSize:[2,2,2,3]}},n))),Re=["size","inverted","sx"];var He=t((t,r)=>{let{size:n="sm",inverted:o,sx:a}=t,l=M(t,Re);const i=z({color:o?"secondary":"primary",borderColor:"secondary",borderStyle:"solid",borderWidth:"0px",borderBottomWidth:"1px",borderRadius:"0px",transition:"border 0.15s",borderBottomWidth:"1px",width:"calc(min(15ch, 100%))",p:[0],py:["2px"],"input::-webkit-outer-spin-button":{WebkitAppearance:"none",margin:0},"input::-webkit-inner-spin-button":{WebkitAppearance:"none",margin:0},":focus":{borderColor:"primary"},":focus-visible":{outline:"none !important",background:"none !important"}},I(n),a);return e.createElement(g,z({},l,{ref:r,sx:i}))});const _e=["children","size","sx","sxSelect"],je=t=>{let{children:r,size:o="sm",sx:a,sxSelect:l}=t,c=M(t,_e);const s=a&&a.color?a.color:"primary",m=I(o),p=n(null),{onChange:d}=c,x=(h=e=>"onChange"!==e,e=>{const t={};for(const r in e)h(r||"")&&(t[r]=e[r]);return t})(c);var h;if(!["xs","sm","md"].includes(o))throw new Error("Size must be xs, sm, or md");let u,f,g,y,E;return"xs"===o&&(f=[14,14,14,16],g=[14,14,14,14],E=["1px"],y=["-14px","-14px","-14px","-16px"]),"sm"===o&&(f=[15,15,15,20],g=[15,15,15,20],E=["1px"],y=["-16px","-16px","-16px","-20px"]),"md"===o&&(f=[20,20,20,20],g=[20,20,20,20],E=["2px"],y=["-20px","-20px","-20px","-20px"]),u=g.map(e=>e+12),e.createElement(i,{sx:z({display:"inline-block"},a)},e.createElement(i,z({as:"select",ref:p,onChange:e=>{p.current.blur(),d&&d(e)},sx:z({},m,{lineHeight:"normal",cursor:"pointer",WebkitAppearance:"none",MozAppearance:"none",pb:["5px"],bg:"transparent",pr:u,border:"none",borderBottomStyle:"solid",borderBottomWidth:"1px",borderBottomColor:"primary",borderRadius:"0px",color:"text",width:"fit-content",color:s,userSelect:"none","@media (hover: none) and (pointer: coarse)":{"&:focus-visible":{outline:"none !important",background:"transparent !important"}}},l)},x),r),e.createElement(w,{sx:{width:g,height:f,position:"relative",ml:y,top:E,fill:"secondary",transform:"rotate(135deg)",pointerEvents:"none"}}))},Ve=["sx"];var Ne=t((t,r)=>{let{sx:n}=t,o=M(t,Ve);const a=n&&n.color?n.color:"primary",{theme:{rawColors:l}}=h();return e.createElement(y,z({ref:r,sx:z({"&::-webkit-slider-thumb":{height:[22,18,16],width:[22,18,16],boxShadow:`0 0 0 0px ${l.secondary}`,transition:"box-shadow .15s ease"},"&::-moz-range-thumb":{height:[22,18,16],width:[22,18,16],boxShadow:`0 0 0 0px ${l.secondary}`,transition:"box-shadow .15s ease"},":focus-visible":{outline:"none !important",background:`${l.secondary} !important`},":focus":{color:a,"&::-webkit-slider-thumb":{boxShadow:`0 0 0 4px ${l.secondary}`},"&::-moz-range-thumb":{boxShadow:`0 0 0 4px ${l.secondary}`}},color:a},n)},o))});const Pe={reset:{verticalAlign:"baseline",border:0,outline:0,margin:0,padding:0},row:{borderStyle:"solid",borderWidth:"0px",borderTopWidth:"1px",borderColor:"muted",pt:[3,3,3,"20px"],pb:[3,3,3,"20px"],mb:["2px"]},header:{display:"block",textTransform:"uppercase",letterSpacing:"smallcaps",fontFamily:"heading",fontSize:[2,2,2,3]},index:{display:"block",textTransform:"uppercase",letterSpacing:"smallcaps",fontFamily:"heading",fontSize:[2,2,2,3]},entry:{display:"block",fontSize:[2,2,2,3],fontFamily:"faux",letterSpacing:"faux",mb:["1px"],mt:[2,0,0,0]}},Ge=({data:t,sx:r,color:n,header:o,columns:a,start:l,width:c,index:s=!0,borderBottom:m=!0,borderTop:p=!0})=>{if(!l||!a||!c)throw new Error("Must provide columns, start, and width");return e.createElement(i,{as:"table",sx:z({display:"block"},r)},e.createElement(i,{as:"tbody",sx:{display:"block"}},o&&e.createElement(q,{as:"tr",sx:z({},Pe.reset,Pe.header,Pe.row,{color:n,borderTopWidth:p?"1px":"0px"})},e.createElement(G,{as:"td",start:[1],width:a,sx:Pe.index},o)),t.map((r,n)=>e.createElement(q,{as:"tr",columns:a,key:n,sx:z({},Pe.reset,Pe.row,{pb:m&&n===t.length-1?["18px","18px","18px","22px"]:[3,3,3,"20px"],borderBottomWidth:m&&n===t.length-1?"1px":"0px",borderTopWidth:p||0!==n||o?"1px":"0px"})},r.map((t,r)=>e.createElement(G,{as:"td",key:r,start:l[r],width:c[r],sx:z({},Pe.reset,0==r&&s?Pe.index:Pe.entry)},t))))))},Ye=["value","onClick","disabled","sx"];var Xe=t((t,r)=>{let{value:n,onClick:o,disabled:a,sx:l}=t,c=M(t,Ye);const s=l&&l.color?l.color:"primary";return n=!a&&n,e.createElement(i,z({ref:r,as:"button",onClick:o,role:"checkbox","aria-checked":n,"aria-label":"Toggle",sx:z({border:"none",background:"none",cursor:a?"default":"pointer",p:[0],m:[0],display:"inline-block"},l)},c),e.createElement(i,{sx:{width:"50px",height:"20px",borderRadius:"20px",backgroundColor:n?E(s,"primary"==s?.5:.45):"muted",position:"relative",transition:"0.15s",display:"inline-block"}},e.createElement(i,{sx:{width:"14px",height:"14px",borderRadius:"7px",position:"absolute",left:n?"32px":"4px",top:"3px",backgroundColor:n?s:"secondary",transition:"0.15s"}})))});const Ue=({id:t})=>t?e.createElement(e.Fragment,null,e.createElement("script",{async:!0,src:`https://www.googletagmanager.com/gtag/js?id=${t}`}),e.createElement("script",{dangerouslySetInnerHTML:{__html:`\n window.dataLayer = window.dataLayer || [];\n function gtag(){dataLayer.push(arguments);}\n gtag('js', new Date());\n gtag('config', '${t}', {\n page_path: window.location.pathname,\n });\n `}})):null,qe=({expanded:t,sx:r,children:n})=>e.createElement(e.Fragment,null,e.createElement(i,{sx:{position:"fixed",top:"56px",bottom:"0px",left:"0px",width:"calc(100vw)",mt:["56px"],bg:"background",zIndex:1e3,transition:"opacity 0.15s",opacity:t?.9:0,pointerEvents:t?"all":"none"}}),e.createElement(i,{sx:z({position:"fixed",width:"calc(100vw)",top:"0px",mt:["56px"],pb:[6,7,7,8],pt:[5,6,7,8],bg:"background",zIndex:1100,borderStyle:"solid",borderColor:"muted",borderWidth:"0px",borderBottomWidth:"1px",transition:"transform 0.15s",ml:[-3,-4,-5,-6],pl:[3,4,5,6],pr:[3,4,5,6],transform:t?"translateY(0)":"translateY(-100%)"},r)},e.createElement(q,null,e.createElement(G,{start:[1,1,1,1],width:[6,8,10,10]},n)))),Ke={month:"short",day:"numeric",year:"numeric"},Ze=(e,t,r)=>{if(!r)return null;const n="string"==typeof r?r:Ke[t],o=e.toLocaleString("default",{[t]:n});return"numeric"===n&&["day","month"].includes(t)?o.padStart(2,"0"):o},Je=(e,t=Ke)=>{var r;const n=new Date(e.replace(/-/g,"/"));return[Ze(n,"month",t.month),Ze(n,"day",t.day),Ze(n,"year",t.year)].filter(Boolean).join(null!=(r=t.separator)?r:" ")};export{L as Badge,W as Blockquote,D as Button,$ as Callout,N as Colorbar,G as Column,Ce as Custom404,ie as Dimmer,Se as Expander,ue as FadeIn,Ie as Filter,ae as Footer,De as Group,ye as Guide,ne as Header,$e as Heading,He as Input,ke as Layout,F as Link,X as Logo,Z as Menu,Y as Meta,oe as Monogram,q as Row,ge as Scrollbar,je as Select,ve as Settings,Oe as Sidenote,Ne as Slider,Ge as Table,Me as Tag,Xe as Toggle,Ue as Tracking,qe as Tray,Je as formatDate,fe as getScrollbarWidth};
2874
2
  //# sourceMappingURL=index.modern.js.map