@redus/georedus-ui 0.9.0 → 0.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/main.js CHANGED
@@ -2,9 +2,9 @@ import { get, isPlainObject, pick, omit, set, uniqBy, groupBy, uniq } from 'loda
2
2
  import { slugify, dataJoin } from '@orioro/util';
3
3
  import { makeResolve, $$literal, withExpressionResolvers, expressions, ALL_EXPR, fetchExpr, resolve, resolveAsync } from '@orioro/resolve';
4
4
  import { __assign, __spreadArray, __awaiter, __generator, __makeTemplateObject } from 'tslib';
5
- import { schemeTableau10, schemeSet3, schemeSet2, schemeSet1, schemePastel2, schemePastel1, schemePaired, schemeObservable10, schemeDark2, schemeAccent, schemeCategory10, schemeSpectral, schemeRdYlGn, schemeRdYlBu, schemeRdGy, schemeRdBu, schemePuOr, schemePiYG, schemePRGn, schemeBrBG, schemeYlOrRd, schemeYlOrBr, schemeYlGn, schemeYlGnBu, schemeRdPu, schemePuRd, schemePuBu, schemePuBuGn, schemeOrRd, schemeGnBu, schemeBuPu, schemeBuGn, schemeReds, schemePurples, schemeOranges, schemeGreys, schemeGreens, schemeBlues } from 'd3-scale-chromatic';
5
+ import { schemeTableau10, schemeSet3, schemeSet2, schemeSet1, schemePastel2, schemePastel1, schemePaired, schemeObservable10, schemeDark2, schemeAccent, schemeCategory10, schemeSpectral, schemeRdYlGn, schemeRdYlBu, schemeRdGy, schemeRdBu, schemePuOr, schemePiYG, schemePRGn, schemeBrBG, schemeYlOrRd, schemeYlOrBr, schemeYlGn, schemeYlGnBu, schemeRdPu, schemePuRd, schemePuBu, schemePuBuGn, schemeOrRd, schemeGnBu, schemeBuPu, schemeBuGn, schemeReds, schemePurples, schemeOranges, schemeGreys, schemeGreens, schemeBlues, interpolateSpectral } from 'd3-scale-chromatic';
6
6
  import { saveAs } from 'file-saver';
7
- import { CANCELLED, fileReadAs, MARKDOWN_DEFAULT_REMARK_PLUGINS, MARKDOWN_DEFAULT_REHYPE_PLUGINS, Markdown as Markdown$1, Flex, DropdownMenu, Box, Input, SwitchInput, TextEllipsis, withDefaults, LoadingOverlay, Button, SingleFileInput, InputProvider as InputProvider$1, rendererSpecList, TextInput, withLabeledLayout, INPUTS, useLocalState, EvenSpacedList, LoadingIndicator } from '@orioro/react-ui-core';
7
+ import { CANCELLED, fileReadAs, AspectRatio, LoadingIndicator, Flex, Box, RichTextOutput, EvenSpacedList, FileOutput, MARKDOWN_DEFAULT_REMARK_PLUGINS, MARKDOWN_DEFAULT_REHYPE_PLUGINS, Markdown as Markdown$1, DropdownMenu, Input, SwitchInput, TextEllipsis, withDefaults, LoadingOverlay, Button, SingleFileInput, InputProvider as InputProvider$1, rendererSpecList, TextInput, withLabeledLayout, INPUTS, useLocalState } from '@orioro/react-ui-core';
8
8
  import initGdalJs from 'gdal3.js';
9
9
  import queryString from 'query-string';
10
10
  import { wrap } from 'comlink';
@@ -14,14 +14,16 @@ import { get as get$1 } from '@orioro/get';
14
14
  import { buffer } from '@turf/turf';
15
15
  import { csvParse } from 'd3-dsv';
16
16
  import { strAutoCast } from '@orioro/cast';
17
- import { fmtLayerAbsoluteId, svgImageGenerator, SVG_PATTERNS, makeSyncedMaps, LayeredMap, useMapRegistry, useTilesLoading, HoverTooltip, layeredMapOnClickHandler, DynamicImages, ControlContainer, InspectControl, MapWindow, TerrainControl, fitGeometry } from '@orioro/react-maplibre-util';
17
+ import { fmtLayerAbsoluteId, waves_1, svgImageGenerator, SVG_PATTERNS, makeSyncedMaps, LayeredMap, useMapRegistry, useTilesLoading, HoverTooltip, layeredMapOnClickHandler, DynamicImages, ControlContainer, InspectControl, MapWindow, TerrainControl, fitGeometry } from '@orioro/react-maplibre-util';
18
+ import { colord } from 'colord';
18
19
  import React, { useState, useMemo, useCallback, useContext, createContext, useReducer, useEffect, useRef } from 'react';
20
+ import { Heading, Portal, Badge, Tabs, Tooltip, IconButton, Theme, Text, Popover, Dialog } from '@radix-ui/themes';
21
+ import styled, { keyframes } from 'styled-components';
22
+ import { mdiSprout, mdiTree, mdiCurrencyUsd, mdiAccountMultipleOutline, mdiScaleBalance, mdiHelpCircleOutline, mdiDownload, mdiDotsVertical, mdiOpacity, mdiFilterVariant, mdiMap, mdiEarth, mdiHospitalBox, mdiHomeCity, mdiSchool, mdiAccountGroup, mdiContentCopy, mdiLinkVariant, mdiChevronLeft, mdiShareVariantOutline, mdiForumOutline, mdiDragVertical, mdiLayers, mdiClose, mdiHospital } from '@mdi/js';
23
+ import { Icon } from '@mdi/react';
24
+ import Confetti from 'react-confetti';
19
25
  import { nodeIdFromPath } from '@orioro/tree-model';
20
26
  import { makeDirNav } from '@orioro/react-dir-nav';
21
- import { Icon } from '@mdi/react';
22
- import { mdiHelpCircleOutline, mdiDownload, mdiDotsVertical, mdiOpacity, mdiFilterVariant, mdiMap, mdiEarth, mdiHospitalBox, mdiHomeCity, mdiSchool, mdiAccountGroup, mdiContentCopy, mdiLinkVariant, mdiChevronLeft, mdiShareVariantOutline, mdiForumOutline, mdiDragVertical, mdiLayers, mdiClose, mdiHospital, mdiAccountMultipleOutline, mdiScaleBalance, mdiCurrencyUsd, mdiSprout, mdiTree } from '@mdi/js';
23
- import { Tabs, Tooltip, IconButton, Theme, Heading, Text, Popover, Dialog, Portal } from '@radix-ui/themes';
24
- import styled, { keyframes } from 'styled-components';
25
27
  import * as Collapsible from '@radix-ui/react-collapsible';
26
28
  import remarkMath from 'remark-math';
27
29
  import rehypeKatex from 'rehype-katex';
@@ -6449,15 +6451,1173 @@ function resolveView(viewSpec, viewConf, viewResolutionContextBase) {
6449
6451
  });
6450
6452
  }
6451
6453
 
6454
+ function _util_bacia(_ref) {
6455
+ var VECTOR_TILE_SERVER_ENDPOINT = _ref.VECTOR_TILE_SERVER_ENDPOINT,
6456
+ id = _ref.id,
6457
+ _ref$label = _ref.label,
6458
+ label = _ref$label === void 0 ? id : _ref$label;
6459
+ _ref.year;
6460
+ var paint = _ref.paint;
6461
+ return {
6462
+ collection_id: 'ana_br_bacias_hidrograficas',
6463
+ indicator_id: id,
6464
+ id: id,
6465
+ label: label,
6466
+ path: "Divis\xF5es territoriais / _ / Bacias Hidrogr\xE1ficas",
6467
+ metadata: {},
6468
+ sources: _defineProperty({}, id, {
6469
+ type: 'vector',
6470
+ minzoom: 3,
6471
+ tiles: ["".concat(VECTOR_TILE_SERVER_ENDPOINT, "/").concat(id, "/{z}/{x}/{y}")]
6472
+ }),
6473
+ layers: _defineProperty({}, "".concat(id, "_bounds"), {
6474
+ source: id,
6475
+ minzoom: 3,
6476
+ 'source-layer': id,
6477
+ type: 'line',
6478
+ paint: paint
6479
+ })
6480
+ };
6481
+ }
6482
+ function ana_br_bacias_hidrograficas(conf) {
6483
+ return [_util_bacia(_objectSpread2(_objectSpread2({}, conf), {}, {
6484
+ year: '2017',
6485
+ label: 'Bacias Hidrográficas - Otto 1',
6486
+ id: 'ana_malha_br_bacias_hidrograficas_2017_otto_1.geom',
6487
+ paint: {
6488
+ 'line-color': 'blue',
6489
+ 'line-width': 10,
6490
+ 'line-opacity': 0.5
6491
+ }
6492
+ })), _util_bacia(_objectSpread2(_objectSpread2({}, conf), {}, {
6493
+ year: '2017',
6494
+ label: 'Bacias Hidrográficas - Otto 2',
6495
+ id: 'ana_malha_br_bacias_hidrograficas_2017_otto_2.geom',
6496
+ paint: {
6497
+ 'line-color': 'blue',
6498
+ 'line-width': 10,
6499
+ 'line-opacity': 0.5
6500
+ }
6501
+ })), _util_bacia(_objectSpread2(_objectSpread2({}, conf), {}, {
6502
+ year: '2017',
6503
+ label: 'Bacias Hidrográficas - Otto 3',
6504
+ id: 'ana_malha_br_bacias_hidrograficas_2017_otto_3.geom',
6505
+ paint: {
6506
+ 'line-color': 'blue',
6507
+ 'line-width': 10,
6508
+ 'line-opacity': 0.5
6509
+ }
6510
+ })), _util_bacia(_objectSpread2(_objectSpread2({}, conf), {}, {
6511
+ year: '2017',
6512
+ label: 'Bacias Hidrográficas - Otto 4',
6513
+ id: 'ana_malha_br_bacias_hidrograficas_2017_otto_4.geom',
6514
+ paint: {
6515
+ 'line-color': 'blue',
6516
+ 'line-width': 10,
6517
+ 'line-opacity': 0.5
6518
+ }
6519
+ })), _util_bacia(_objectSpread2(_objectSpread2({}, conf), {}, {
6520
+ year: '2017',
6521
+ label: 'Bacias Hidrográficas - Otto 5',
6522
+ id: 'ana_malha_br_bacias_hidrograficas_2017_otto_5.geom',
6523
+ paint: {
6524
+ 'line-color': 'blue',
6525
+ 'line-width': 10,
6526
+ 'line-opacity': 0.5
6527
+ }
6528
+ })), _util_bacia(_objectSpread2(_objectSpread2({}, conf), {}, {
6529
+ year: '2017',
6530
+ label: 'Bacias Hidrográficas - Otto 6',
6531
+ id: 'ana_malha_br_bacias_hidrograficas_2017_otto_6.geom',
6532
+ paint: {
6533
+ 'line-color': 'blue',
6534
+ 'line-width': 10,
6535
+ 'line-opacity': 0.5
6536
+ }
6537
+ })), _util_bacia(_objectSpread2(_objectSpread2({}, conf), {}, {
6538
+ year: '2017',
6539
+ label: 'Bacias Hidrográficas - Otto 7',
6540
+ id: 'ana_malha_br_bacias_hidrograficas_2017_otto_7.geom',
6541
+ paint: {
6542
+ 'line-color': 'blue',
6543
+ 'line-width': 10,
6544
+ 'line-opacity': 0.5
6545
+ }
6546
+ }))];
6547
+ }
6548
+
6549
+ function svgBgImage(svg) {
6550
+ return "url(\"data:image/svg+xml,".concat(encodeURIComponent(svg), "\")");
6551
+ }
6552
+ function br_divisao_territorial(_ref) {
6553
+ var VECTOR_TILE_SERVER_ENDPOINT = _ref.VECTOR_TILE_SERVER_ENDPOINT,
6554
+ id = _ref.id,
6555
+ path = _ref.path,
6556
+ _ref$label = _ref.label,
6557
+ label = _ref$label === void 0 ? id : _ref$label,
6558
+ _ref$line = _ref.line,
6559
+ line = _ref$line === void 0 ? {} : _ref$line,
6560
+ _ref$fill = _ref.fill,
6561
+ fill = _ref$fill === void 0 ? {} : _ref$fill;
6562
+ return {
6563
+ collection_id: id,
6564
+ indicator_id: id,
6565
+ id: id,
6566
+ label: label,
6567
+ path: "Divis\xF5es territoriais / _ / ".concat(path),
6568
+ metadata: {},
6569
+ sources: _defineProperty({}, id, {
6570
+ promoteId: 'id',
6571
+ type: 'vector',
6572
+ tiles: ["".concat(VECTOR_TILE_SERVER_ENDPOINT, "/").concat(id, "/{z}/{x}/{y}")]
6573
+ }),
6574
+ layers: _defineProperty(_defineProperty({}, "".concat(id, "_bounds"), _objectSpread2({
6575
+ zIndex: Z_OVERLAY_BASE_1000,
6576
+ source: id,
6577
+ 'source-layer': id,
6578
+ type: 'line'
6579
+ }, line)), "".concat(id, "_fill"), _objectSpread2(_objectSpread2({
6580
+ zIndex: Z_OVERLAY_BASE_1000,
6581
+ source: id,
6582
+ 'source-layer': id,
6583
+ type: 'fill'
6584
+ }, fill), {}, {
6585
+ paint: _objectSpread2({
6586
+ 'fill-opacity': 0
6587
+ }, fill.paint)
6588
+ }))
6589
+ };
6590
+ }
6591
+ function br_divisao_territorial_views(conf) {
6592
+ return [
6593
+ //
6594
+ // 2024
6595
+ //
6596
+ br_divisao_territorial(_objectSpread2(_objectSpread2({}, conf), {}, {
6597
+ year: '2022',
6598
+ path: 'Municípios',
6599
+ label: 'Municípios',
6600
+ id: 'ibge_malha_br_municipio_2024.geom',
6601
+ line: {
6602
+ paint: {
6603
+ 'line-color': schemeCategory10[0],
6604
+ 'line-width': 5,
6605
+ 'line-dasharray': [2, 2],
6606
+ 'line-opacity': 0.5
6607
+ }
6608
+ }
6609
+ })), br_divisao_territorial(_objectSpread2(_objectSpread2({}, conf), {}, {
6610
+ year: '2022',
6611
+ path: 'Municípios',
6612
+ label: 'Regiões Metropolitanas',
6613
+ id: 'ibge_malha_br_regiao_metropolitana_2024.geom',
6614
+ line: {
6615
+ paint: {
6616
+ 'line-color': schemeCategory10[1],
6617
+ 'line-width': 10,
6618
+ 'line-opacity': 0.5
6619
+ }
6620
+ }
6621
+ })), br_divisao_territorial(_objectSpread2(_objectSpread2({}, conf), {}, {
6622
+ year: '2022',
6623
+ path: 'Municípios',
6624
+ label: 'Concentrações Urbanas',
6625
+ id: 'ibge_malha_br_concurb_2024.geom',
6626
+ line: {
6627
+ paint: {
6628
+ 'line-color': schemeCategory10[2],
6629
+ 'line-width': 5,
6630
+ 'line-opacity': 0.5
6631
+ }
6632
+ }
6633
+ })),
6634
+ // Favelas e Comunidades Urbanas
6635
+ br_divisao_territorial(_objectSpread2({
6636
+ year: '2022',
6637
+ path: 'Favelas e Comunidades Urbanas',
6638
+ label: 'Favelas e Comunidades Urbanas',
6639
+ id: 'ibge_malha_br_fcu_2022.geom',
6640
+ line: {
6641
+ paint: {
6642
+ 'line-color': 'brown',
6643
+ 'line-width': 1,
6644
+ 'line-opacity': 1
6645
+ }
6646
+ },
6647
+ fill: {
6648
+ paint: {
6649
+ 'fill-opacity': ['case', ['boolean', ['feature-state', 'hover'], false], 1, 0.6],
6650
+ 'fill-pattern': 'waves_1({ stroke: "brown", scale: 0.25 })'
6651
+ },
6652
+ interactive: true,
6653
+ tooltip: {
6654
+ title: ['$literal', ['$get', 'feature.properties.name']],
6655
+ entries: [['Favela ou Comunidade Urbana', null]]
6656
+ },
6657
+ legends: [{
6658
+ type: 'CategoricalLegend',
6659
+ items: [{
6660
+ label: 'Favelas e Comunidades Urbanas',
6661
+ box: {
6662
+ style: {
6663
+ borderColor: 'brown',
6664
+ borderStyle: 'solid',
6665
+ borderWidth: '1px',
6666
+ backgroundImage: svgBgImage(waves_1({
6667
+ stroke: 'brown',
6668
+ scale: '0.25'
6669
+ }))
6670
+ }
6671
+ }
6672
+ }]
6673
+ }]
6674
+ }
6675
+ }, conf)),
6676
+ // Censo 2022
6677
+ br_divisao_territorial(_objectSpread2({
6678
+ path: 'Censo 2022',
6679
+ id: 'ibge_malha_br_regiao_intermediaria_2024.geom',
6680
+ year: '2022',
6681
+ label: 'Região intermediária',
6682
+ line: {
6683
+ paint: {
6684
+ 'line-color': schemeCategory10[3],
6685
+ 'line-width': 6,
6686
+ 'line-opacity': 0.5
6687
+ }
6688
+ }
6689
+ }, conf)), br_divisao_territorial(_objectSpread2({
6690
+ path: 'Censo 2022',
6691
+ id: 'ibge_malha_br_regiao_imediata_2024.geom',
6692
+ year: '2022',
6693
+ label: 'Região imediata',
6694
+ line: {
6695
+ paint: {
6696
+ 'line-color': schemeCategory10[4],
6697
+ 'line-width': 6,
6698
+ 'line-opacity': 0.5
6699
+ }
6700
+ }
6701
+ }, conf)),
6702
+ //
6703
+ // Censo 2022
6704
+ //
6705
+ br_divisao_territorial(_objectSpread2({
6706
+ path: 'Censo 2022',
6707
+ id: 'ibge_malha_br_distrito_2022.geom',
6708
+ year: '2022',
6709
+ label: 'Distritos',
6710
+ line: {
6711
+ paint: {
6712
+ 'line-color': schemeCategory10[5],
6713
+ 'line-width': 6,
6714
+ 'line-opacity': 0.5
6715
+ }
6716
+ }
6717
+ }, conf)), br_divisao_territorial(_objectSpread2(_objectSpread2({
6718
+ path: 'Censo 2022'
6719
+ }, conf), {}, {
6720
+ year: '2022',
6721
+ label: 'Subdistritos',
6722
+ id: 'ibge_malha_br_subdistrito_2022.geom',
6723
+ line: {
6724
+ paint: {
6725
+ 'line-color': schemeCategory10[6],
6726
+ 'line-width': 2,
6727
+ 'line-opacity': 0.5
6728
+ }
6729
+ }
6730
+ })), br_divisao_territorial(_objectSpread2(_objectSpread2({
6731
+ path: 'Censo 2022'
6732
+ }, conf), {}, {
6733
+ year: '2022',
6734
+ label: 'Bairros',
6735
+ id: 'ibge_malha_br_bairro_2022.geom',
6736
+ line: {
6737
+ paint: {
6738
+ 'line-color': 'black',
6739
+ 'line-width': 1,
6740
+ 'line-opacity': 0.5
6741
+ }
6742
+ }
6743
+ })),
6744
+ //
6745
+ // Censo 2010
6746
+ //
6747
+ br_divisao_territorial(_objectSpread2({
6748
+ path: 'Censo 2010',
6749
+ year: '2010',
6750
+ label: 'Distritos',
6751
+ id: 'ibge_malha_br_distrito_2010.geom',
6752
+ line: {
6753
+ paint: {
6754
+ 'line-color': 'blue',
6755
+ 'line-width': 6,
6756
+ 'line-opacity': 0.5
6757
+ }
6758
+ }
6759
+ }, conf)), br_divisao_territorial(_objectSpread2({
6760
+ path: 'Censo 2010',
6761
+ year: '2010',
6762
+ label: 'Subdistritos',
6763
+ id: 'ibge_malha_br_subdistrito_2010.geom',
6764
+ line: {
6765
+ paint: {
6766
+ 'line-color': 'magenta',
6767
+ 'line-width': 2,
6768
+ 'line-opacity': 0.5
6769
+ }
6770
+ }
6771
+ }, conf))];
6772
+ }
6773
+
6774
+ var CURVATURA_ID = 'curvatura';
6775
+ function curvatura(_ref) {
6776
+ var RASTER_TILE_SERVER_ENDPOINT = _ref.RASTER_TILE_SERVER_ENDPOINT,
6777
+ mosaicJsonUrl = _ref.mosaicJsonUrl;
6778
+ var DEVICE_PIXEL_RATIO_SUFFIX = typeof window !== 'undefined' && window.devicePixelRatio > 1 ? '@2x' : '';
6779
+ return {
6780
+ viewType: VIEW_TYPE_SURFACE_CHOROPLETH,
6781
+ collection_id: CURVATURA_ID,
6782
+ indicator_id: CURVATURA_ID,
6783
+ id: CURVATURA_ID,
6784
+ label: 'Forma da encosta - Em perfil',
6785
+ path: "Emerg\xEAncias clim\xE1ticas / / Suscetibilidade a deslizamentos",
6786
+ confSchema: {
6787
+ data: {
6788
+ // temperaturaRange: {
6789
+ // type: 'range',
6790
+ // defaultValue: DEFAULT_DECLIVIDADE_RANGE,
6791
+ // step: 1,
6792
+ // min: DEFAULT_DECLIVIDADE_RANGE[0],
6793
+ // max: DEFAULT_DECLIVIDADE_RANGE[1],
6794
+ // label: resolve.literal(
6795
+ // resolve.fn((context) => {
6796
+ // const temperaturaRange = _temperaturaRange(
6797
+ // context.value?.temperaturaRange,
6798
+ // )
6799
+ // const minLabel = `${temperaturaRange[0]}°`
6800
+ // const maxLabel = `${temperaturaRange[1]}°${temperaturaRange[1] === DEFAULT_DECLIVIDADE_RANGE[1] ? '+' : ''}`
6801
+ // return `Intervalo de temperatura (${minLabel} - ${maxLabel})`
6802
+ // }),
6803
+ // ),
6804
+ // helperText: 'Intervalo de temperatura apresentado',
6805
+ // },
6806
+ }
6807
+ },
6808
+ metadata: {},
6809
+ sources: _defineProperty({}, CURVATURA_ID, {
6810
+ minzoom: 7,
6811
+ maxzoom: 14,
6812
+ type: 'raster',
6813
+ tiles: [resolve.fn(function (_ref2) {
6814
+ _ref2.view.conf;
6815
+ // const temperaturaRange = _temperaturaRange(
6816
+ // conf?.data?.temperaturaRange,
6817
+ // )
6818
+
6819
+ var baseUrl = "".concat(RASTER_TILE_SERVER_ENDPOINT, "/mosaicjson/tiles/WebMercatorQuad/{z}/{x}/{y}").concat(DEVICE_PIXEL_RATIO_SUFFIX);
6820
+ var COLOR_MAP = {
6821
+ 1: '#d92bcb',
6822
+ 2: '#b49bcb',
6823
+ 3: '#dcdcdc',
6824
+ 4: '#f3ce5e',
6825
+ 5: '#fd952e'
6826
+ };
6827
+ return "".concat(baseUrl, "?").concat($urlSearch([{
6828
+ url: mosaicJsonUrl,
6829
+ colormap: COLOR_MAP
6830
+ }]));
6831
+ })]
6832
+ }),
6833
+ layers: _defineProperty({}, "".concat(CURVATURA_ID), {
6834
+ minzoom: 7,
6835
+ // zIndex: 10,
6836
+ type: 'raster',
6837
+ source: CURVATURA_ID,
6838
+ paint: {
6839
+ 'raster-opacity': 0.85
6840
+ }
6841
+ })
6842
+ };
6843
+ }
6844
+
6845
+ var DECLIVIDADE_ID = 'declividade';
6846
+ var DEFAULT_DECLIVIDADE_RANGE = [0, 45];
6847
+ var TRANSPARENT$1 = [0, 0, 0, 0];
6848
+ function _declividadeRange(candidate) {
6849
+ return Array.isArray(candidate) && candidate.length === 2 && typeof candidate[0] === 'number' && typeof candidate[1] === 'number' ? candidate : DEFAULT_DECLIVIDADE_RANGE;
6850
+ }
6851
+ var PRECISION$1 = 0.00000001;
6852
+ var CLASSES_DECLIVIDADE = [{
6853
+ color: '#2B83BA',
6854
+ label: '0º',
6855
+ range: [0, 0 + PRECISION$1 - PRECISION$1 / 10]
6856
+ }, {
6857
+ color: '#6BB0AF',
6858
+ label: '0 a 2º',
6859
+ range: [0 + PRECISION$1, 2]
6860
+ }, {
6861
+ color: '#ABDDA4',
6862
+ label: '2 a 5º',
6863
+ range: [2 + PRECISION$1, 5]
6864
+ }, {
6865
+ color: '#D5EEB1',
6866
+ label: '5 a 10º',
6867
+ range: [5 + PRECISION$1, 10]
6868
+ }, {
6869
+ color: '#FFFFBF',
6870
+ label: '10 a 17º',
6871
+ range: [10 + PRECISION$1, 17]
6872
+ }, {
6873
+ color: '#FED690',
6874
+ label: '17 a 20º',
6875
+ range: [17 + PRECISION$1, 20]
6876
+ }, {
6877
+ color: '#FDAE61',
6878
+ label: '20 a 25º',
6879
+ range: [20 + PRECISION$1, 25]
6880
+ }, {
6881
+ color: '#EA633E',
6882
+ label: '25 a 30º',
6883
+ range: [25 + PRECISION$1, 30]
6884
+ }, {
6885
+ color: '#D7191C',
6886
+ label: '30 a 45º',
6887
+ range: [30 + PRECISION$1, 45]
6888
+ }, {
6889
+ color: '#860003',
6890
+ label: 'Acima de 45º',
6891
+ range: [45 + PRECISION$1, 999999]
6892
+ }];
6893
+ function declividade(_ref) {
6894
+ var RASTER_TILE_SERVER_ENDPOINT = _ref.RASTER_TILE_SERVER_ENDPOINT,
6895
+ mosaicJsonUrl = _ref.mosaicJsonUrl;
6896
+ var DEVICE_PIXEL_RATIO_SUFFIX = typeof window !== 'undefined' && window.devicePixelRatio > 1 ? '@2x' : '';
6897
+ return {
6898
+ viewType: VIEW_TYPE_SURFACE_CHOROPLETH,
6899
+ collection_id: DECLIVIDADE_ID,
6900
+ indicator_id: DECLIVIDADE_ID,
6901
+ id: DECLIVIDADE_ID,
6902
+ label: 'Declividade',
6903
+ path: "Emerg\xEAncias clim\xE1ticas / / Suscetibilidade a deslizamentos",
6904
+ confSchema: {
6905
+ data: {
6906
+ declividadeRange: {
6907
+ type: 'range',
6908
+ defaultValue: DEFAULT_DECLIVIDADE_RANGE,
6909
+ step: 1,
6910
+ min: DEFAULT_DECLIVIDADE_RANGE[0],
6911
+ max: DEFAULT_DECLIVIDADE_RANGE[1],
6912
+ label: resolve.literal(resolve.fn(function (context) {
6913
+ var _context$value;
6914
+ var declividadeRange = _declividadeRange((_context$value = context.value) === null || _context$value === void 0 ? void 0 : _context$value.declividadeRange);
6915
+ var minLabel = "".concat(declividadeRange[0], "\xB0");
6916
+ var maxLabel = "".concat(declividadeRange[1], "\xB0").concat(declividadeRange[1] === DEFAULT_DECLIVIDADE_RANGE[1] ? '+' : '');
6917
+ return "Intervalo de declividade (".concat(minLabel, " - ").concat(maxLabel, ")");
6918
+ })),
6919
+ helperText: 'Intervalo de declividade apresentado'
6920
+ }
6921
+ }
6922
+ },
6923
+ metadata: {},
6924
+ sources: _defineProperty({}, DECLIVIDADE_ID, {
6925
+ minzoom: 7,
6926
+ maxzoom: 14,
6927
+ type: 'raster',
6928
+ tiles: [resolve.fn(function (_ref2) {
6929
+ var _conf$data;
6930
+ var conf = _ref2.view.conf;
6931
+ var declividadeRange = _declividadeRange(conf === null || conf === void 0 || (_conf$data = conf.data) === null || _conf$data === void 0 ? void 0 : _conf$data.declividadeRange);
6932
+ var baseUrl = "".concat(RASTER_TILE_SERVER_ENDPOINT, "/mosaicjson/tiles/WebMercatorQuad/{z}/{x}/{y}").concat(DEVICE_PIXEL_RATIO_SUFFIX);
6933
+ var COLOR_MAP = CLASSES_DECLIVIDADE.map(function (cl) {
6934
+ return [cl.range, cl.color];
6935
+ });
6936
+ return "".concat(baseUrl, "?").concat($urlSearch([{
6937
+ url: mosaicJsonUrl,
6938
+ colormap: COLOR_MAP.map(function (_ref3) {
6939
+ var _ref4 = _slicedToArray(_ref3, 2),
6940
+ bounds = _ref4[0],
6941
+ color = _ref4[1];
6942
+ return [bounds, bounds[0] >= declividadeRange[0] && bounds[1] <= declividadeRange[1] ? color : TRANSPARENT$1];
6943
+ })
6944
+ }]));
6945
+ })]
6946
+ }),
6947
+ layers: _defineProperty({}, "".concat(DECLIVIDADE_ID), {
6948
+ minzoom: 7,
6949
+ // zIndex: 10,
6950
+ type: 'raster',
6951
+ source: DECLIVIDADE_ID,
6952
+ paint: {
6953
+ 'raster-opacity': 0.85
6954
+ },
6955
+ legends: [{
6956
+ type: 'CategoricalLegend',
6957
+ title: 'Classes de Declividade',
6958
+ items: CLASSES_DECLIVIDADE
6959
+ }]
6960
+ })
6961
+ };
6962
+ }
6963
+
6964
+ var HAND_ID = 'hand';
6965
+ var DEFAULT_HAND_VALUE = 2;
6966
+ var MAX_HAND_VALUE = 6;
6967
+ function _handValue(conf) {
6968
+ var _conf$data;
6969
+ return typeof (conf === null || conf === void 0 || (_conf$data = conf.data) === null || _conf$data === void 0 ? void 0 : _conf$data.handValue) === 'number' ? conf.data.handValue : DEFAULT_HAND_VALUE;
6970
+ }
6971
+
6972
+ //
6973
+ // Color at DEFAULT_HAND_VALUE
6974
+ //
6975
+ var BASE_COLOR = '#2B83BA';
6976
+ var COLOR_MAP_BASE = [[[0, 0.1], colord(BASE_COLOR).darken(0.2).toHex()], [[0.10000000001, 0.25], colord(BASE_COLOR).darken(0.15).toHex()], [[0.25000000001, 0.5], colord(BASE_COLOR).darken(0.1).toHex()], [[0.50000000001, 1], colord(BASE_COLOR).darken(0.05).toHex()], [[1.00000000001, 1.5], BASE_COLOR], [[1.50000000001, 2], colord(BASE_COLOR).lighten(0.1).toHex()], [[2.00000000001, 2.5], colord(BASE_COLOR).lighten(0.2).toHex()], [[2.50000000001, 3], colord(BASE_COLOR).lighten(0.25).toHex()], [[3.00000000001, 3.5], colord(BASE_COLOR).lighten(0.3).toHex()], [[3.50000000001, 4], colord(BASE_COLOR).lighten(0.35).toHex()], [[4.00000000001, 4.5], colord(BASE_COLOR).lighten(0.4).toHex()], [[4.50000000001, 5], colord(BASE_COLOR).lighten(0.45).toHex()], [[5.00000000001, MAX_HAND_VALUE], colord(BASE_COLOR).lighten(0.5).toHex()]];
6977
+ function hand_legends() {
6978
+ return [{
6979
+ type: 'ContinuousColorLegend',
6980
+ title: 'Altura da drenagem mais próxima',
6981
+ unit: 'Metros',
6982
+ numberUnit: 'm',
6983
+ colors: resolve.fn(function (_ref) {
6984
+ var conf = _ref.view.conf;
6985
+ var handValue = _handValue(conf);
6986
+ return COLOR_MAP_BASE.filter(function (_ref2) {
6987
+ var _ref3 = _slicedToArray(_ref2, 2),
6988
+ range = _ref3[0];
6989
+ _ref3[1];
6990
+ return range[1] <= handValue;
6991
+ }).map(function (_ref4) {
6992
+ var _ref5 = _slicedToArray(_ref4, 2);
6993
+ _ref5[0];
6994
+ var color = _ref5[1];
6995
+ return color;
6996
+ });
6997
+ }),
6998
+ domain: resolve.fn(function (_ref6) {
6999
+ var conf = _ref6.view.conf;
7000
+ var handValue = _handValue(conf);
7001
+ return [0, handValue];
7002
+ }),
7003
+ barHeight: 50
7004
+ }];
7005
+ }
7006
+ function hand(_ref7) {
7007
+ var RASTER_TILE_SERVER_ENDPOINT = _ref7.RASTER_TILE_SERVER_ENDPOINT,
7008
+ mosaicJsonUrl = _ref7.mosaicJsonUrl;
7009
+ var DEVICE_PIXEL_RATIO_SUFFIX = typeof window !== 'undefined' && window.devicePixelRatio > 1 ? '@2x' : '';
7010
+ return {
7011
+ viewType: VIEW_TYPE_SURFACE_CHOROPLETH,
7012
+ collection_id: HAND_ID,
7013
+ indicator_id: HAND_ID,
7014
+ id: HAND_ID,
7015
+ label: 'Suscetibilidade à inundação',
7016
+ path: "Emerg\xEAncias clim\xE1ticas / / Riscos hidrol\xF3gicos",
7017
+ confSchema: {
7018
+ data: {
7019
+ handValue: {
7020
+ type: 'slider',
7021
+ defaultValue: DEFAULT_HAND_VALUE,
7022
+ step: 1,
7023
+ min: 0,
7024
+ max: MAX_HAND_VALUE,
7025
+ label: resolve.literal(resolve.fn(function (context) {
7026
+ var _context$value;
7027
+ return "Altura (".concat(typeof ((_context$value = context.value) === null || _context$value === void 0 ? void 0 : _context$value.handValue) === 'number' ? context.value.handValue : DEFAULT_HAND_VALUE, "m)");
7028
+ })),
7029
+ helperText: 'Altura acima da drenagem mais próxima'
7030
+ }
7031
+ }
7032
+ },
7033
+ metadata: {},
7034
+ sources: _defineProperty({}, HAND_ID, {
7035
+ type: 'raster',
7036
+ minzoom: 7,
7037
+ maxzoom: 14,
7038
+ tiles: [resolve.fn(function (_ref8) {
7039
+ var conf = _ref8.view.conf;
7040
+ var handValue = _handValue(conf);
7041
+ var baseUrl = "".concat(RASTER_TILE_SERVER_ENDPOINT, "/mosaicjson/tiles/WebMercatorQuad/{z}/{x}/{y}").concat(DEVICE_PIXEL_RATIO_SUFFIX);
7042
+ return "".concat(baseUrl, "?").concat($urlSearch([{
7043
+ url: mosaicJsonUrl,
7044
+ // colormap: [[[0, handValue], '#2B83BA']],
7045
+ colormap: COLOR_MAP_BASE.filter(function (_ref9) {
7046
+ var _ref10 = _slicedToArray(_ref9, 2),
7047
+ range = _ref10[0];
7048
+ _ref10[1];
7049
+ return range[1] <= handValue;
7050
+ })
7051
+ }]));
7052
+ })]
7053
+ }),
7054
+ layers: _defineProperty({}, "".concat(HAND_ID), {
7055
+ minzoom: 7,
7056
+ // zIndex: 10,
7057
+ type: 'raster',
7058
+ source: HAND_ID,
7059
+ paint: {
7060
+ 'raster-opacity': 0.85
7061
+ },
7062
+ legends: hand_legends()
7063
+ })
7064
+ };
7065
+ }
7066
+
7067
+ function overture_places_poc(_ref) {
7068
+ var VECTOR_TILE_SERVER_ENDPOINT = _ref.VECTOR_TILE_SERVER_ENDPOINT;
7069
+ return {
7070
+ collection_id: 'proof_of_concept',
7071
+ indicator_id: 'overture_places_poc',
7072
+ id: 'overture_places_poc',
7073
+ label: 'Pontos de atividade comercial',
7074
+ sourceLabel: 'Overture Maps',
7075
+ path: 'Infraestrutura e serviços urbanos / 2022 / Atividade comercial',
7076
+ metadata: {},
7077
+ sources: {
7078
+ atividade_comercial: tableVectorSource({
7079
+ VECTOR_TILE_SERVER_ENDPOINT: VECTOR_TILE_SERVER_ENDPOINT
7080
+ }, 'overture_br_places', {
7081
+ attribution: 'Overture Maps',
7082
+ minzoom: 10
7083
+ })
7084
+ },
7085
+ layers: {
7086
+ atividade_comercial: {
7087
+ source: 'atividade_comercial',
7088
+ 'source-layer': 'overture_br_places.geom',
7089
+ filter: ['==', ['get', 'municipio_id'], ['$get', 'app.municipioId']],
7090
+ type: 'circle',
7091
+ paint: {
7092
+ 'circle-radius': 2,
7093
+ // small circle size
7094
+ 'circle-color': '#3E63DD',
7095
+ // red fill
7096
+ 'circle-opacity': ['interpolate', ['linear'], ['zoom'], 10, 0.1, 16, 0.4]
7097
+ // 'circle-stroke-width': .5, // no outline
7098
+ // 'circle-stroke-color': '#ff0000', // no outline
7099
+ }
7100
+
7101
+ // type: 'heatmap',
7102
+ // paint: {
7103
+ // // Increase the heatmap weight based on frequency and property magnitude
7104
+ // 'heatmap-weight': [
7105
+ // 'interpolate',
7106
+ // ['linear'],
7107
+ // ['get', 'mag'],
7108
+ // 0,
7109
+ // 0,
7110
+ // 6,
7111
+ // 1,
7112
+ // ],
7113
+ // // Increase the heatmap color weight weight by zoom level
7114
+ // // heatmap-intensity is a multiplier on top of heatmap-weight
7115
+ // 'heatmap-intensity': [
7116
+ // 'interpolate',
7117
+ // ['linear'],
7118
+ // ['zoom'],
7119
+ // 0,
7120
+ // 1,
7121
+ // 9,
7122
+ // 3,
7123
+ // ],
7124
+ // // Color ramp for heatmap. Domain is 0 (low) to 1 (high).
7125
+ // // Begin color ramp at 0-stop with a 0-transparency color
7126
+ // // to create a blur-like effect.
7127
+ // 'heatmap-color': [
7128
+ // 'interpolate',
7129
+ // ['linear'],
7130
+ // ['heatmap-density'],
7131
+ // 0,
7132
+ // 'rgba(33,102,172,0)',
7133
+ // 0.2,
7134
+ // 'rgb(103,169,207)',
7135
+ // 0.4,
7136
+ // 'rgb(209,229,240)',
7137
+ // 0.6,
7138
+ // 'rgb(253,219,199)',
7139
+ // 0.8,
7140
+ // 'rgb(239,138,98)',
7141
+ // 1,
7142
+ // 'rgb(178,24,43)',
7143
+ // ],
7144
+ // // Adjust the heatmap radius by zoom level
7145
+ // 'heatmap-radius': [
7146
+ // 'interpolate',
7147
+ // ['linear'],
7148
+ // ['zoom'],
7149
+ // 0,
7150
+ // 2,
7151
+ // 9,
7152
+ // 20,
7153
+ // ],
7154
+ // },
7155
+ }
7156
+ }
7157
+ };
7158
+ }
7159
+
7160
+ var _templateObject$5, _templateObject2$3;
7161
+ var AutoWrapContainer = styled.div(_templateObject$5 || (_templateObject$5 = _taggedTemplateLiteral(["\n display: flex;\n direction: row;\n flex-wrap: wrap;\n margin-left: -10px;\n margin-top: -10px;\n\n > * {\n margin-left: 10px;\n margin-top: 10px;\n }\n"])));
7162
+ var UnstyledList = styled.ul(_templateObject2$3 || (_templateObject2$3 = _taggedTemplateLiteral(["\n margin: 0;\n"])));
7163
+ var REDUS_MUTIRAO_COP_2025_ID = 'redus_mutirao_cop_2025.geom';
7164
+ var URL_RE = /^https?:\/\//;
7165
+ function _ensureUrl(url) {
7166
+ if (!url) {
7167
+ return '';
7168
+ }
7169
+ return URL_RE.test(url) ? url : "https://".concat(url);
7170
+ }
7171
+ function AsyncImage(_ref) {
7172
+ var src = _ref.src;
7173
+ var _useState = useState(false),
7174
+ _useState2 = _slicedToArray(_useState, 2),
7175
+ loaded = _useState2[0],
7176
+ setLoaded = _useState2[1];
7177
+ return /*#__PURE__*/React.createElement("div", {
7178
+ style: {
7179
+ position: 'relative'
7180
+ }
7181
+ }, /*#__PURE__*/React.createElement(AspectRatio, {
7182
+ ratio: 16 / 9
7183
+ }, /*#__PURE__*/React.createElement("img", {
7184
+ src: src,
7185
+ onLoad: function onLoad() {
7186
+ return setLoaded(true);
7187
+ },
7188
+ onError: function onError() {
7189
+ return setLoaded(true);
7190
+ },
7191
+ style: {
7192
+ display: loaded ? 'block' : 'none',
7193
+ maxWidth: '100%'
7194
+ }
7195
+ })), !loaded && /*#__PURE__*/React.createElement(LoadingIndicator, {
7196
+ style: {
7197
+ position: 'absolute',
7198
+ top: '50%',
7199
+ left: '50%',
7200
+ transform: 'translate(-50%, -50%)'
7201
+ }
7202
+ }));
7203
+ }
7204
+ var MITIGACAO = 'Mitigação – energias renováveis, eficiência energética, mobilidade sustentável, construções verdes, redução de emissões';
7205
+ var ADAPTACAO = 'Adaptação – resiliência climática, gestão da água, reflorestamento, agricultura sustentável, saúde, nutrição';
7206
+ var FINANCIAMENTO = 'Financiamento climático – bioeconomia, finanças sustentáveis, empreendedorismo climático, compras públicas verdes';
7207
+ var GOVERNANCA = 'Governança – políticas públicas, governança multinível, inovação digital, participação social, fortalecimento institucional';
7208
+ var JUSTICA_CLIMATICA = 'Justiça climática – direito à cidade, moradia digna, cultura e povos tradicionais, redução de desigualdades, segurança alimentar';
7209
+ var OUTRO = 'Outro';
7210
+ var LEGEND_ITEMS = [{
7211
+ label: 'Mitigação',
7212
+ value: MITIGACAO,
7213
+ color: schemeCategory10[8],
7214
+ iconPath: mdiSprout,
7215
+ icon: 'mdiSprout({fill:"white"})'
7216
+ }, {
7217
+ label: 'Adaptação',
7218
+ value: ADAPTACAO,
7219
+ color: schemeCategory10[2],
7220
+ iconPath: mdiTree,
7221
+ icon: 'mdiTree({fill:"white"})'
7222
+ }, {
7223
+ label: 'Financiamento',
7224
+ value: FINANCIAMENTO,
7225
+ color: schemeCategory10[9],
7226
+ iconPath: mdiCurrencyUsd,
7227
+ icon: 'mdiCurrencyUsd({fill:"white"})'
7228
+ }, {
7229
+ label: 'Governança',
7230
+ value: GOVERNANCA,
7231
+ color: schemeCategory10[0],
7232
+ iconPath: mdiAccountMultipleOutline,
7233
+ icon: 'mdiAccountMultipleOutline({fill:"white"})'
7234
+ }, {
7235
+ label: 'Justiça climática',
7236
+ value: JUSTICA_CLIMATICA,
7237
+ color: schemeCategory10[1],
7238
+ iconPath: mdiScaleBalance,
7239
+ icon: 'mdiScaleBalance({fill:"white"})'
7240
+ }, {
7241
+ label: 'Outro',
7242
+ value: OUTRO,
7243
+ color: schemeCategory10[7],
7244
+ iconPath: null,
7245
+ icon: 'none'
7246
+ }];
7247
+ function _eixoShortLabel(value) {
7248
+ var _LEGEND_ITEMS$find;
7249
+ return ((_LEGEND_ITEMS$find = LEGEND_ITEMS.find(function (item) {
7250
+ return item.value === value;
7251
+ })) === null || _LEGEND_ITEMS$find === void 0 ? void 0 : _LEGEND_ITEMS$find.label) || 'Outro';
7252
+ }
7253
+ function redus_mutirao_cop_2025(conf) {
7254
+ var VECTOR_TILE_SERVER_ENDPOINT = conf.VECTOR_TILE_SERVER_ENDPOINT;
7255
+ return {
7256
+ collection_id: REDUS_MUTIRAO_COP_2025_ID,
7257
+ indicator_id: REDUS_MUTIRAO_COP_2025_ID,
7258
+ id: REDUS_MUTIRAO_COP_2025_ID,
7259
+ label: 'Mutirão ReDUS COP30',
7260
+ path: "Emerg\xEAncias Clim\xE1ticas / _ / COP30",
7261
+ metadata: {},
7262
+ sources: _defineProperty({}, REDUS_MUTIRAO_COP_2025_ID, {
7263
+ type: 'vector',
7264
+ minzoom: 3,
7265
+ tiles: ["".concat(VECTOR_TILE_SERVER_ENDPOINT, "/").concat(REDUS_MUTIRAO_COP_2025_ID, "/{z}/{x}/{y}")]
7266
+ }),
7267
+ layers: _defineProperty(_defineProperty({}, "".concat(REDUS_MUTIRAO_COP_2025_ID, "_symbols"), {
7268
+ type: 'symbol',
7269
+ source: REDUS_MUTIRAO_COP_2025_ID,
7270
+ zIndex: Z_OVERLAY_MIDDLE_2000 + 1,
7271
+ 'source-layer': REDUS_MUTIRAO_COP_2025_ID,
7272
+ minzoom: 3,
7273
+ layout: {
7274
+ 'icon-image': ['match', ['get', 'eixos_cop_30_primeiro']].concat(_toConsumableArray(LEGEND_ITEMS.map(function (item) {
7275
+ return [item.value, ['literal', item.icon]];
7276
+ }).flat()), [
7277
+ // default:
7278
+ 'none']),
7279
+ 'icon-size': ['interpolate', ['linear'], ['zoom'], 5, 0.5,
7280
+ // at zoom 5 → radius 0.5
7281
+ 15, 0.8 // at zoom 15 → radius 0.8
7282
+ ]
7283
+ }
7284
+ }), "".concat(REDUS_MUTIRAO_COP_2025_ID, "_circles"), {
7285
+ zIndex: Z_OVERLAY_MIDDLE_2000,
7286
+ source: REDUS_MUTIRAO_COP_2025_ID,
7287
+ 'source-layer': REDUS_MUTIRAO_COP_2025_ID,
7288
+ minzoom: 3,
7289
+ type: 'circle',
7290
+ paint: {
7291
+ 'circle-opacity': 1,
7292
+ 'circle-radius': ['interpolate', ['linear'], ['zoom'], 5, 10,
7293
+ // at zoom 5 → radius 10
7294
+ 15, 15 // at zoom 15 → radius 15
7295
+ ],
7296
+ 'circle-stroke-width': 1,
7297
+ 'circle-stroke-color': '#000000',
7298
+ // 'circle-color': '#3E63DD',
7299
+ 'circle-color': ['match', ['get', 'eixos_cop_30_primeiro']].concat(_toConsumableArray(LEGEND_ITEMS.map(function (item) {
7300
+ return [item.value, item.color];
7301
+ }).flat()), [
7302
+ // default
7303
+ schemeCategory10[7]])
7304
+ },
7305
+ interactive: true,
7306
+ onClick: function () {
7307
+ var _onClick = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(feature, e, context) {
7308
+ var properties;
7309
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
7310
+ while (1) switch (_context.prev = _context.next) {
7311
+ case 0:
7312
+ properties = feature.properties;
7313
+ _context.next = 3;
7314
+ return context.dialogs.view(/*#__PURE__*/React.createElement(Flex, {
7315
+ direction: "column",
7316
+ gap: "4"
7317
+ }, /*#__PURE__*/React.createElement(Flex, {
7318
+ direction: "column",
7319
+ gap: "2"
7320
+ }, /*#__PURE__*/React.createElement(Heading, {
7321
+ as: "h1",
7322
+ size: "6"
7323
+ }, properties.name), /*#__PURE__*/React.createElement(Portal, null, /*#__PURE__*/React.createElement(Confetti, {
7324
+ style: {
7325
+ position: 'fixed',
7326
+ top: 0,
7327
+ left: 0,
7328
+ zIndex: 9999
7329
+ },
7330
+ recycle: false,
7331
+ numberOfPieces: 700,
7332
+ tweenDuration: 8000
7333
+ })), (properties.eixos_cop_30_text || properties.odus_text) && /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(AutoWrapContainer, null, JSON.parse(properties.eixos_cop_30_text).map(function (eixo, idx) {
7334
+ return /*#__PURE__*/React.createElement(Badge, {
7335
+ color: "green",
7336
+ key: idx
7337
+ }, _eixoShortLabel(eixo));
7338
+ }), JSON.parse(properties.odus_text).map(function (obj, idx) {
7339
+ return /*#__PURE__*/React.createElement(Badge, {
7340
+ key: idx
7341
+ }, obj);
7342
+ }))), /*#__PURE__*/React.createElement(Heading, {
7343
+ as: "h3",
7344
+ size: "2",
7345
+ style: {
7346
+ fontWeight: 'normal'
7347
+ }
7348
+ }, "Organiza\xE7\xE3o respons\xE1vel:", ' ', /*#__PURE__*/React.createElement("strong", null, properties.organizacao)), properties.parcerias && /*#__PURE__*/React.createElement(Heading, {
7349
+ as: "h3",
7350
+ size: "2",
7351
+ style: {
7352
+ fontWeight: 'normal'
7353
+ }
7354
+ }, "Em parceria com: ", /*#__PURE__*/React.createElement("strong", null, properties.parcerias)), /*#__PURE__*/React.createElement(Heading, {
7355
+ as: "h3",
7356
+ size: "2",
7357
+ style: {
7358
+ fontWeight: 'normal'
7359
+ }
7360
+ }, "Cidade:", ' ', /*#__PURE__*/React.createElement("strong", null, properties.cidade, " - ", properties.estado))), properties.cover_image && /*#__PURE__*/React.createElement(Box, null, /*#__PURE__*/React.createElement("img", {
7361
+ style: {
7362
+ maxWidth: '100%'
7363
+ },
7364
+ src: properties.cover_image
7365
+ })), properties.descricao_text && /*#__PURE__*/React.createElement(Flex, {
7366
+ gap: "2"
7367
+ }, /*#__PURE__*/React.createElement(Heading, {
7368
+ size: "3"
7369
+ }, "Descri\xE7\xE3o:"), /*#__PURE__*/React.createElement(RichTextOutput, {
7370
+ value: JSON.parse(properties.descricao_text)
7371
+ })), properties.impacto_text && /*#__PURE__*/React.createElement(Flex, {
7372
+ gap: "2"
7373
+ }, /*#__PURE__*/React.createElement(Heading, {
7374
+ size: "3"
7375
+ }, "Impacto:"), /*#__PURE__*/React.createElement(RichTextOutput, {
7376
+ value: JSON.parse(properties.impacto_text)
7377
+ })), properties.escala_de_atuacao_text && /*#__PURE__*/React.createElement(Flex, {
7378
+ gap: "2"
7379
+ }, /*#__PURE__*/React.createElement(Heading, {
7380
+ size: "3"
7381
+ }, "Escala de atua\xE7\xE3o:"), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(UnstyledList, null, JSON.parse(properties.escala_de_atuacao_text).map(function (escala, idx) {
7382
+ return /*#__PURE__*/React.createElement("li", {
7383
+ key: idx
7384
+ }, escala);
7385
+ })))), properties.fase_text && /*#__PURE__*/React.createElement(Flex, {
7386
+ gap: "2"
7387
+ }, /*#__PURE__*/React.createElement(Heading, {
7388
+ size: "3"
7389
+ }, "Fase:"), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(UnstyledList, null, JSON.parse(properties.fase_text).map(function (fase, idx) {
7390
+ return /*#__PURE__*/React.createElement("li", {
7391
+ key: idx
7392
+ }, fase);
7393
+ })))), /*#__PURE__*/React.createElement(Flex, {
7394
+ gap: "2"
7395
+ }, /*#__PURE__*/React.createElement(Heading, {
7396
+ size: "3"
7397
+ }, "Informa\xE7\xF5es de contato:"), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(UnstyledList, null, _ensureUrl(properties.site) && /*#__PURE__*/React.createElement("li", null, "Site:", ' ', /*#__PURE__*/React.createElement("a", {
7398
+ href: _ensureUrl(properties.site),
7399
+ target: "_blank",
7400
+ rel: "noreferrer noopener"
7401
+ }, _ensureUrl(properties.site))), properties.redes_sociais && /*#__PURE__*/React.createElement("li", null, "Redes sociais: ", properties.redes_sociais), properties.email && /*#__PURE__*/React.createElement("li", null, "E-mail:", ' ', /*#__PURE__*/React.createElement("a", {
7402
+ href: "mailto:".concat(properties.email)
7403
+ }, properties.email))))), properties.other_attachments_text && /*#__PURE__*/React.createElement(Flex, {
7404
+ gap: "2"
7405
+ }, /*#__PURE__*/React.createElement(Heading, {
7406
+ size: "3"
7407
+ }, "Mais informa\xE7\xF5es:"), /*#__PURE__*/React.createElement(EvenSpacedList, {
7408
+ columns: 2,
7409
+ gap: "3"
7410
+ }, JSON.parse(properties.other_attachments_text).map(function (fase, idx) {
7411
+ return /*#__PURE__*/React.createElement(FileOutput, {
7412
+ value: fase,
7413
+ key: idx
7414
+ });
7415
+ })))));
7416
+ case 3:
7417
+ case "end":
7418
+ return _context.stop();
7419
+ }
7420
+ }, _callee);
7421
+ }));
7422
+ function onClick(_x, _x2, _x3) {
7423
+ return _onClick.apply(this, arguments);
7424
+ }
7425
+ return onClick;
7426
+ }(),
7427
+ tooltip: {
7428
+ title: resolve.literal(resolve.fn(function (_ref2) {
7429
+ var _feature$properties2;
7430
+ var feature = _ref2.feature;
7431
+ var eixo = LEGEND_ITEMS.find(function (item) {
7432
+ var _feature$properties;
7433
+ return item.value === (feature === null || feature === void 0 || (_feature$properties = feature.properties) === null || _feature$properties === void 0 ? void 0 : _feature$properties.eixos_cop_30_primeiro);
7434
+ }) || null;
7435
+ return /*#__PURE__*/React.createElement("div", {
7436
+ style: {
7437
+ display: 'inline-flex'
7438
+ }
7439
+ }, eixo && /*#__PURE__*/React.createElement(Icon, {
7440
+ path: eixo.iconPath,
7441
+ size: "18px",
7442
+ style: {
7443
+ flexGrow: 0,
7444
+ flexShrink: 0,
7445
+ marginRight: 5
7446
+ },
7447
+ color: "white"
7448
+ }), "".concat(eixo === null || eixo === void 0 ? void 0 : eixo.label, ": ").concat(feature === null || feature === void 0 || (_feature$properties2 = feature.properties) === null || _feature$properties2 === void 0 ? void 0 : _feature$properties2.name));
7449
+ })),
7450
+ // title: ['$literal', ['$get', 'feature.properties.name']],
7451
+ entries: [['Organização', ['$literal', ['$get', 'feature.properties.organizacao']]], resolve.literal(resolve.fn(function (_ref3) {
7452
+ var _feature$properties3, _feature$properties4;
7453
+ var feature = _ref3.feature;
7454
+ return (_feature$properties3 = feature.properties) !== null && _feature$properties3 !== void 0 && _feature$properties3.parcerias ? ['Parcerias', (_feature$properties4 = feature.properties) === null || _feature$properties4 === void 0 ? void 0 : _feature$properties4.parcerias] : null;
7455
+ })), resolve.literal(resolve.fn(function (_ref4) {
7456
+ var feature = _ref4.feature;
7457
+ return feature.properties.cover_image ? [null, /*#__PURE__*/React.createElement(AsyncImage, {
7458
+ style: {
7459
+ maxWidth: '100%'
7460
+ },
7461
+ src: feature.properties.cover_image
7462
+ })] : null;
7463
+ }))].filter(Boolean)
7464
+ },
7465
+ legends: [{
7466
+ type: 'CategoricalLegend',
7467
+ title: 'Eixos de atuação',
7468
+ unit: 'Eixos de atuação da COP30',
7469
+ items: LEGEND_ITEMS.map(function (item) {
7470
+ return _objectSpread2(_objectSpread2({}, item), {}, {
7471
+ box: {
7472
+ children: item.iconPath && /*#__PURE__*/React.createElement(Icon, {
7473
+ path: item.iconPath,
7474
+ size: "14px",
7475
+ color: "white"
7476
+ }),
7477
+ style: {
7478
+ borderRadius: '100%',
7479
+ borderColor: '#000000'
7480
+ }
7481
+ }
7482
+ });
7483
+ })
7484
+ }]
7485
+ })
7486
+ };
7487
+ }
7488
+
7489
+ var TEMPERATURA_SUPERFICIE_ID = 'temperatura_superficie';
7490
+ var TEMPERATURA_MIN = 20;
7491
+ var TEMPERATURA_MAX = 60;
7492
+ var DEFAULT_TEMPERATURA_RANGE = [TEMPERATURA_MIN, TEMPERATURA_MAX];
7493
+ var TRANSPARENT = [0, 0, 0, 0];
7494
+ function _temperaturaRange(candidate) {
7495
+ return Array.isArray(candidate) && candidate.length === 2 && typeof candidate[0] === 'number' && typeof candidate[1] === 'number' ? candidate : DEFAULT_TEMPERATURA_RANGE;
7496
+ }
7497
+ var COLOR_STEPS = TEMPERATURA_MAX - TEMPERATURA_MIN + 1;
7498
+ var PRECISION = 0.00000001;
7499
+ var COLOR_MAP = Array.from({
7500
+ length: COLOR_STEPS
7501
+ }, function (_, idx) {
7502
+ var progress = idx / (COLOR_STEPS - 1);
7503
+ var rangeStart = TEMPERATURA_MIN + idx;
7504
+ var rangeEnd = idx === COLOR_STEPS - 1 ? 9999999 : rangeStart + 1 - PRECISION;
7505
+ return [[rangeStart, rangeEnd], colord(interpolateSpectral(1 - progress)).toHex()];
7506
+ });
7507
+ function temperatura_legends() {
7508
+ return [{
7509
+ type: 'ContinuousColorLegend',
7510
+ title: 'Temperatura máxima de superfície (ºC)',
7511
+ unit: 'Valor médio em º Celsiu da temperatur máxima no período de 2021 - 2025',
7512
+ numberUnit: 'º',
7513
+ colors: resolve.fn(function (_ref) {
7514
+ var _conf$data;
7515
+ var conf = _ref.view.conf;
7516
+ var temperaturaRange = _temperaturaRange(conf === null || conf === void 0 || (_conf$data = conf.data) === null || _conf$data === void 0 ? void 0 : _conf$data.temperaturaRange);
7517
+ return COLOR_MAP.filter(function (_ref2) {
7518
+ var _ref3 = _slicedToArray(_ref2, 1),
7519
+ range = _ref3[0];
7520
+ return range[0] <= temperaturaRange[1] && range[1] >= temperaturaRange[0];
7521
+ }).map(function (_ref4) {
7522
+ var _ref5 = _slicedToArray(_ref4, 2);
7523
+ _ref5[0];
7524
+ var color = _ref5[1];
7525
+ return color;
7526
+ });
7527
+ }),
7528
+ domain: resolve.fn(function (_ref6) {
7529
+ var _conf$data2;
7530
+ var conf = _ref6.view.conf;
7531
+ var temperaturaRange = _temperaturaRange(conf === null || conf === void 0 || (_conf$data2 = conf.data) === null || _conf$data2 === void 0 ? void 0 : _conf$data2.temperaturaRange);
7532
+ return temperaturaRange;
7533
+ }),
7534
+ barDirection: 'to right',
7535
+ barWidth: '100%',
7536
+ barHeight: 15
7537
+ }];
7538
+ }
7539
+ function temperatura_superficie(_ref7) {
7540
+ var RASTER_TILE_SERVER_ENDPOINT = _ref7.RASTER_TILE_SERVER_ENDPOINT,
7541
+ mosaicJsonUrl = _ref7.mosaicJsonUrl;
7542
+ var DEVICE_PIXEL_RATIO_SUFFIX = typeof window !== 'undefined' && window.devicePixelRatio > 1 ? '@2x' : '';
7543
+ return {
7544
+ viewType: VIEW_TYPE_SURFACE_CHOROPLETH,
7545
+ collection_id: TEMPERATURA_SUPERFICIE_ID,
7546
+ indicator_id: TEMPERATURA_SUPERFICIE_ID,
7547
+ id: TEMPERATURA_SUPERFICIE_ID,
7548
+ label: 'Temperatura máxima de superfície (ºC)',
7549
+ year: '2021 - 2025',
7550
+ path: "Emerg\xEAncias clim\xE1ticas / / Extremos de temperatura",
7551
+ confSchema: {
7552
+ data: {
7553
+ temperaturaRange: {
7554
+ type: 'range',
7555
+ defaultValue: DEFAULT_TEMPERATURA_RANGE,
7556
+ step: 1,
7557
+ min: DEFAULT_TEMPERATURA_RANGE[0],
7558
+ max: DEFAULT_TEMPERATURA_RANGE[1],
7559
+ label: resolve.literal(resolve.fn(function (context) {
7560
+ var _context$value;
7561
+ var temperaturaRange = _temperaturaRange((_context$value = context.value) === null || _context$value === void 0 ? void 0 : _context$value.temperaturaRange);
7562
+ var minLabel = "".concat(temperaturaRange[0], "\xB0");
7563
+ var maxLabel = "".concat(temperaturaRange[1], "\xB0").concat(temperaturaRange[1] === DEFAULT_TEMPERATURA_RANGE[1] ? '+' : '');
7564
+ return "Intervalo de temperatura (".concat(minLabel, " - ").concat(maxLabel, ")");
7565
+ })),
7566
+ helperText: 'Intervalo de temperatura apresentado'
7567
+ }
7568
+ }
7569
+ },
7570
+ metadata: {},
7571
+ sources: _defineProperty({}, TEMPERATURA_SUPERFICIE_ID, {
7572
+ minzoom: 7,
7573
+ maxzoom: 14,
7574
+ type: 'raster',
7575
+ tiles: [resolve.fn(function (_ref8) {
7576
+ var _conf$data3;
7577
+ var conf = _ref8.view.conf;
7578
+ var temperaturaRange = _temperaturaRange(conf === null || conf === void 0 || (_conf$data3 = conf.data) === null || _conf$data3 === void 0 ? void 0 : _conf$data3.temperaturaRange);
7579
+ var baseUrl = "".concat(RASTER_TILE_SERVER_ENDPOINT, "/mosaicjson/tiles/WebMercatorQuad/{z}/{x}/{y}").concat(DEVICE_PIXEL_RATIO_SUFFIX);
7580
+ return "".concat(baseUrl, "?").concat($urlSearch([{
7581
+ url: mosaicJsonUrl,
7582
+ colormap: COLOR_MAP.map(function (_ref9) {
7583
+ var _ref10 = _slicedToArray(_ref9, 2),
7584
+ bounds = _ref10[0],
7585
+ color = _ref10[1];
7586
+ return [bounds, bounds[0] >= temperaturaRange[0] && bounds[1] <= temperaturaRange[1] ? color : TRANSPARENT];
7587
+ })
7588
+ }]));
7589
+ })]
7590
+ }),
7591
+ layers: _defineProperty({}, "".concat(TEMPERATURA_SUPERFICIE_ID), {
7592
+ minzoom: 7,
7593
+ // zIndex: 10,
7594
+ type: 'raster',
7595
+ source: TEMPERATURA_SUPERFICIE_ID,
7596
+ paint: {
7597
+ 'raster-opacity': 0.85
7598
+ },
7599
+ legends: temperatura_legends()
7600
+ })
7601
+ };
7602
+ }
7603
+
6452
7604
  var index = /*#__PURE__*/Object.freeze({
6453
7605
  __proto__: null,
6454
7606
  STAGE_SPECIAL_KEYS: STAGE_SPECIAL_KEYS,
6455
7607
  STAGE_VALUE_KEY: STAGE_VALUE_KEY,
7608
+ ana_br_bacias_hidrograficas: ana_br_bacias_hidrograficas,
7609
+ br_divisao_territorial: br_divisao_territorial,
7610
+ br_divisao_territorial_views: br_divisao_territorial_views,
6456
7611
  cem_censo_2010_2022: cem_censo_2010_2022,
6457
7612
  cem_censo_2022: cem_censo_2022,
6458
7613
  cem_escolas_2022: cem_escolas_2022,
6459
7614
  cem_saude_2024: cem_saude_2024,
7615
+ curvatura: curvatura,
7616
+ declividade: declividade,
6460
7617
  fetchViewSpecs: fetchViewSpecs,
7618
+ hand: hand,
7619
+ overture_places_poc: overture_places_poc,
7620
+ redus_mutirao_cop_2025: redus_mutirao_cop_2025,
6461
7621
  resolveConfSchema: resolveConfSchema,
6462
7622
  resolveControls: resolveControls,
6463
7623
  resolveDownload: resolveDownload,
@@ -6465,7 +7625,8 @@ var index = /*#__PURE__*/Object.freeze({
6465
7625
  resolveMetadata: resolveMetadata,
6466
7626
  resolveSources: resolveSources,
6467
7627
  resolveView: resolveView,
6468
- resolveViewSpecs: resolveViewSpecs
7628
+ resolveViewSpecs: resolveViewSpecs,
7629
+ temperatura_superficie: temperatura_superficie
6469
7630
  });
6470
7631
 
6471
7632
  var CollapsibleContent_slideDown = keyframes(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n from {\n height: 0;\n }\n to {\n height: var(--radix-collapsible-content-height);\n }\n"], ["\n from {\n height: 0;\n }\n to {\n height: var(--radix-collapsible-content-height);\n }\n"])));
@@ -8322,99 +9483,6 @@ function useViews(viewResolutionContextBase) {
8322
9483
  };
8323
9484
  }
8324
9485
 
8325
- function overture_places_poc(_ref) {
8326
- var VECTOR_TILE_SERVER_ENDPOINT = _ref.VECTOR_TILE_SERVER_ENDPOINT;
8327
- return {
8328
- collection_id: 'proof_of_concept',
8329
- indicator_id: 'overture_places_poc',
8330
- id: 'overture_places_poc',
8331
- label: 'Pontos de atividade comercial',
8332
- sourceLabel: 'Overture Maps',
8333
- path: 'Infraestrutura e serviços urbanos / 2022 / Atividade comercial',
8334
- metadata: {},
8335
- sources: {
8336
- atividade_comercial: tableVectorSource({
8337
- VECTOR_TILE_SERVER_ENDPOINT: VECTOR_TILE_SERVER_ENDPOINT
8338
- }, 'overture_br_places', {
8339
- attribution: 'Overture Maps',
8340
- minzoom: 10
8341
- })
8342
- },
8343
- layers: {
8344
- atividade_comercial: {
8345
- source: 'atividade_comercial',
8346
- 'source-layer': 'overture_br_places.geom',
8347
- filter: ['==', ['get', 'municipio_id'], ['$get', 'app.municipioId']],
8348
- type: 'circle',
8349
- paint: {
8350
- 'circle-radius': 2,
8351
- // small circle size
8352
- 'circle-color': '#3E63DD',
8353
- // red fill
8354
- 'circle-opacity': ['interpolate', ['linear'], ['zoom'], 10, 0.1, 16, 0.4]
8355
- // 'circle-stroke-width': .5, // no outline
8356
- // 'circle-stroke-color': '#ff0000', // no outline
8357
- }
8358
-
8359
- // type: 'heatmap',
8360
- // paint: {
8361
- // // Increase the heatmap weight based on frequency and property magnitude
8362
- // 'heatmap-weight': [
8363
- // 'interpolate',
8364
- // ['linear'],
8365
- // ['get', 'mag'],
8366
- // 0,
8367
- // 0,
8368
- // 6,
8369
- // 1,
8370
- // ],
8371
- // // Increase the heatmap color weight weight by zoom level
8372
- // // heatmap-intensity is a multiplier on top of heatmap-weight
8373
- // 'heatmap-intensity': [
8374
- // 'interpolate',
8375
- // ['linear'],
8376
- // ['zoom'],
8377
- // 0,
8378
- // 1,
8379
- // 9,
8380
- // 3,
8381
- // ],
8382
- // // Color ramp for heatmap. Domain is 0 (low) to 1 (high).
8383
- // // Begin color ramp at 0-stop with a 0-transparency color
8384
- // // to create a blur-like effect.
8385
- // 'heatmap-color': [
8386
- // 'interpolate',
8387
- // ['linear'],
8388
- // ['heatmap-density'],
8389
- // 0,
8390
- // 'rgba(33,102,172,0)',
8391
- // 0.2,
8392
- // 'rgb(103,169,207)',
8393
- // 0.4,
8394
- // 'rgb(209,229,240)',
8395
- // 0.6,
8396
- // 'rgb(253,219,199)',
8397
- // 0.8,
8398
- // 'rgb(239,138,98)',
8399
- // 1,
8400
- // 'rgb(178,24,43)',
8401
- // ],
8402
- // // Adjust the heatmap radius by zoom level
8403
- // 'heatmap-radius': [
8404
- // 'interpolate',
8405
- // ['linear'],
8406
- // ['zoom'],
8407
- // 0,
8408
- // 2,
8409
- // 9,
8410
- // 20,
8411
- // ],
8412
- // },
8413
- }
8414
- }
8415
- };
8416
- }
8417
-
8418
9486
  var BR_MUNICIPIOS_ID = 'ibge_malha_br_municipio_2024.geom';
8419
9487
  function br_municipios(_ref) {
8420
9488
  var api = _ref.api,