import * as React from 'react';
import React__default from 'react';
import { observer } from 'mobx-react';
import { cE as Icon, s as __assign, w as appContext } from './MapEditView-24782753.js';
import classNames from 'classnames';
import { M as MapVisualGeoIcon } from './MapVisualGeoIcon-fdf6d163.js';
import { map } from 'lodash';
import { B as BottomWrapper } from './BottomWrapper-ad37adf8.js';
import { F as ForwardRef$1, a as ForwardRef$2 } from './ChevronsUp-55ebe1da.js';
import 'maptalks';
import 'uuid';
import 'mobx';
import 'lz-string';
import 'dayjs';
import 'react-dom';
import 'react-is';
import '@loadable/component';
import 'js-beautify';
import 'axios';
import 'superstruct';
import '@tanem/react-nprogress';
import 'jquery';
import 'chroma-js';
import 'js-cookie';
import 'is-email';
import 'is-uuid';
import 'is-url';
import 'anymatch';
import 'perf-request';
import '@syncpoint/wkx';
import 'buffer';
import '@turf/turf';
import '@mapbox/polylabel';
import 'turf-multipolygon';
import 'turf-polygon';
import 'gcoord';
import 'eventemitter2';
import 'geobuf';
import 'localforage';
import 'rc-menu';
import 'perfect-scrollbar';
import 'ahooks';
import 'jszip';
import 'file-saver';
import 'screenfull';
import 'sql-formatter-fork';
import 'array-move';
import 'turf-multilinestring';
import 'copy-to-clipboard';
import 'maptalks.three';
import 'ajv';
import 'spark-md5';
import 'react-draggable';
import 'react-virtualized';
import 'turf-point';
import 'decamelize';
import 'rbush';
import 'qs';
import 'maptalks.snap';
import 'react-use';
import 'react-rnd';
import 'react-beautiful-dnd';
import './index-ae07a940.js';
import './MapColorPicker-41ec1c5c.js';
import './index-f58067b3.js';
import './index-3fbe476f.js';

function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
var generateComp = function generateComp(svgRef) {
  return function () {
    return /*#__PURE__*/React.createElement("svg", {
      width: "1em",
      height: "1em",
      viewBox: "0 0 48 48",
      fill: "currentColor",
      xmlns: "http://www.w3.org/2000/svg",
      focusable: false,
      "aria-hidden": "true",
      ref: svgRef
    }, /*#__PURE__*/React.createElement("path", {
      fillRule: "evenodd",
      clipRule: "evenodd",
      d: "M21.198 42.2c-.6 0-1.1-.1-1.6-.4-.5-.3-1-.7-1.3-1.2-.3-.5-.5-1.1-.5-1.7v-13l-11.4-12.2c-.5-.5-.8-1.1-.9-1.8-.1-.6 0-1.3.3-1.9.3-.6.7-1.1 1.2-1.5.6-.3 1.2-.5 1.9-.5h30.3c.7 0 1.3.2 1.8.5.5.4 1 .9 1.2 1.5.3.6.4 1.3.3 1.9-.1.7-.4 1.2-.8 1.7l-11.6 12.3v9.3c0 .6-.1 1.1-.4 1.6-.3.5-.6.9-1.1 1.2l-5.5 3.7c-.5.3-1.1.5-1.7.6 0-.1-.1-.1-.2-.1zM10.298 12l10.6 11.4c.6.6.9 1.4.9 2.3v12l4.3-2.8v-9.2c0-.9.3-1.7.9-2.3l10.7-11.4h-27.4z",
      fill: "currentColor"
    }));
  };
};
var SvgFilterOutlined = function SvgFilterOutlined(props, svgRef) {
  var newProps = _objectSpread(_objectSpread({}, props), {}, {
    name: "SvgFilterOutlined"
  });
  return /*#__PURE__*/React.createElement(Icon, _objectSpread(_objectSpread({}, newProps), {}, {
    component: generateComp(svgRef)
  }));
};
var ForwardRef = /*#__PURE__*/React.forwardRef(SvgFilterOutlined);

var FenceItem = function (props) {
    var geometryType = props.geometryType, defaultStyle = props.defaultStyle, selected = props.selected;
    return (React__default.createElement("div", { className: classNames('dm-map-mobile-fence-item', {
            selected: props.selected,
        }), onClick: props.onSelected },
        React__default.createElement("div", null,
            React__default.createElement(MapVisualGeoIcon, { className: "mr4", 
                // isHeat={isHeat}
                // className={`${prefixCls}-icon`}
                type: geometryType, style: __assign(__assign({}, defaultStyle), { width: 20, height: 20 }) })),
        React__default.createElement("div", { style: { flex: 1 } },
            React__default.createElement("div", { className: "dm-map-mobile-fence-item-name" }, props.name),
            selected && React__default.createElement("div", { className: "dm-map-mobile-fence-item-des" },
                "\u5171",
                props.num,
                "\u6761\u6570\u636E")),
        React__default.createElement("div", { style: {
                display: props.selected ? 'flex' : 'none',
                flexDirection: 'column',
                alignItems: 'center',
            }, onClick: props.openFilter },
            React__default.createElement(ForwardRef, null),
            React__default.createElement("div", null, "\u7B5B\u9009"))));
};

var FenceAll = observer(function () {
    var Context = appContext.getContext();
    var value = React__default.useContext(Context);
    var routeStore = value.routeStore; value.prefixCls;
    var _a = routeStore.MobileUIStore, setFenceSingleList = _a.setFenceSingleList, fenceAllIsPackUp = _a.fenceAllIsPackUp, setFenceAllIsPackUp = _a.setFenceAllIsPackUp, _b = routeStore.GeoFiltersStore, geoDataCount = _b.geoDataCount, geoFilters = _b.geoFilters, setCurrentGeoFilter = _b.setCurrentGeoFilter, currentGeoFilter = _b.currentGeoFilter;
    return (React__default.createElement(BottomWrapper, { title: "\u56F4\u680F", icon: fenceAllIsPackUp ? (React__default.createElement(ForwardRef$1, { onClick: function () {
                setFenceAllIsPackUp(false);
            }, className: "dm-map-mobile-bottom-wrapper-header-icon" })) : (React__default.createElement(ForwardRef$2, { onClick: function () {
                setFenceAllIsPackUp(true);
            }, className: "dm-map-mobile-bottom-wrapper-header-icon" })) },
        React__default.createElement("div", { className: "dm-map-mobile-fence-all", style: { maxHeight: '40vh', overflow: 'auto', display: fenceAllIsPackUp ? 'none' : 'flex' } }, map(geoFilters, function (item) {
            var selected = item.uuid === currentGeoFilter;
            return (React__default.createElement(FenceItem, { key: item.uuid, name: item.alias || item.objectType, num: selected ? geoDataCount : '-', geometryType: item.geometryType, defaultStyle: item.defaultStyle, onSelected: function () {
                    setCurrentGeoFilter(item.uuid);
                }, openFilter: function () {
                    setFenceSingleList(true);
                }, selected: selected }));
        }))));
});

export { FenceAll as default };
