"use strict";var stringUtil=require("./stringUtil-0d797e21.js"),React=require("react"),mobxReact=require("mobx-react"),classNames=require("classnames"),index=require("./index-136fc3e3.js"),MapEditView=require("./MapEditView-b37f9adc.js");function _interopDefaultLegacy(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}require("@loadable/component"),require("@tanem/react-nprogress"),require("dayjs"),require("sql-formatter-fork"),require("axios"),require("superstruct"),require("lodash"),require("chroma-js"),require("localforage"),require("react-draggable"),require("react-rnd"),require("react-is"),require("react-dom"),require("react-virtualized"),require("ahooks"),require("rc-menu"),require("mobx"),require("react-beautiful-dnd"),require("ali-oss"),require("minio"),require("lz-string"),require("spark-md5"),require("js-cookie"),require("is-email"),require("is-uuid"),require("is-url"),require("@syncpoint/wkx"),require("buffer"),require("@turf/turf"),require("@mapbox/polylabel"),require("turf-multipolygon"),require("turf-polygon"),require("gcoord"),require("eventemitter2"),require("anymatch"),require("crypto"),require("uuid"),require("perfect-scrollbar"),require("react-contextmenu"),require("./isNil-f0d356da.js"),require("./orderBy-b01c6edd.js"),require("coordtransform"),require("./compact-741ec811.js"),require("react-use"),require("./useDataValue-47abfdcd.js"),require("./trim-95cf03c4.js"),require("react-dnd-html5-backend"),require("./VirtualizedTable-118b071e.js"),require("ali-react-table-fork"),require("./Transfer-7e33684b.js"),require("maptalks"),require("js-beautify"),require("jquery"),require("geobuf"),require("./index-7befc29a.js"),require("./index-2c2dd454.js"),require("./index-9a1c259f.js"),require("jszip"),require("file-saver"),require("screenfull"),require("array-move"),require("turf-multilinestring"),require("copy-to-clipboard"),require("maptalks.three"),require("ajv"),require("turf-point"),require("decamelize"),require("rbush"),require("qs"),require("./index-5efb31e1.js"),require("./index-9174f5fe.js"),require("./index-32dfda69.js"),require("./index-567d7302.js"),require("./index-03d46886.js"),require("stream"),require("./ResizeObserver.es-c4381b73.js");var React__default=_interopDefaultLegacy(React),classNames__default=_interopDefaultLegacy(classNames),DataTableHeader=mobxReact.observer(function(e){var r=e.expand,i=e.expandRight,e=React__default.default.useContext(index.MyDataTableContext),a=e.store,u=e.delPackage,e=e.tabPopupConfirm||{},l=e.showPopup,t=e.tabIndex,d=e.message,o=stringUtil.__rest(e,["showPopup","tabIndex","message"]),s=a.packages,n=a.tableIndex,f=a.changeTab,c=a.showFullScreen,q=null!=t?t:n,e=React__default.default.useMemo(function(){return c&&React__default.default.createElement("div",{className:index.prefixCls+"-header-expand"},React__default.default.createElement(stringUtil.IconButton,{icon:r.direction===MapEditView.ExpandDirect.Right&&r.expanded||r.direction===MapEditView.ExpandDirect.Left&&!r.expanded&&0<s.length?"minimize":"maximize",onClick:i,ghost:!0}))},[r.direction,r.expanded,i,s.length,c]);return React__default.default.createElement("div",{className:index.prefixCls+"-header"},React__default.default.createElement("div",{className:index.prefixCls+"-tabs"},s.map(function(i,e){var r=classNames__default.default(index.prefixCls+"-tab",((r={})[index.prefixCls+"-tab-active"]=n===e,r)),a=React__default.default.createElement("div",{className:index.prefixCls+"-tab-name"},i.name),t=null!==(t=stringUtil.GEO_TYPE_ICON_MAP[i.geometryType])&&void 0!==t?t:"file";return React__default.default.createElement("div",{className:r,onClick:function(){return f(e)},key:e},React__default.default.createElement(stringUtil.Tooltip,{title:i.name},React__default.default.createElement("div",{className:index.prefixCls+"-tab-left"},React__default.default.createElement(stringUtil.Icon,{icon:t,className:index.prefixCls+"-tab-icon-package"}),l&&q===e?React__default.default.createElement(stringUtil.Popconfirm,stringUtil.__assign({message:d,defaultVisible:!0},o),a):a)),React__default.default.createElement(stringUtil.IconButton,{type:"only-icon",icon:"close",onClick:function(e){e.stopPropagation();var r=i.packageUuid;u&&u(r,e)},className:index.prefixCls+"-tab-icon-close"}))})),e)});exports.default=DataTableHeader;
