text: System.register(["jimu-core","jimu-ui","jimu-ui/advanced/setting-components","jimu-arcgis","jimu-ui/advanced/data-source-selector"],(function(t){var e,n,o,s,i;return{setters:[function(t){e=t},function(t){n=t},function(t){o=t},function(t){s=t},function(t){i=t}],execute:function(){t(function(t){var e={};function n(o){if(e[o])return e[o].exports;var s=e[o]={i:o,l:!1,exports:{}};return t[o].call(s.exports,s,s.exports,n),s.l=!0,s.exports}return n.m=t,n.c=e,n.d=function(t,e,o){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var s in t)n.d(o,s,function(e){return t[e]}.bind(null,s));return o},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=388)}({0:function(t,n){t.exports=e},1:function(t,e){t.exports=n},11:function(t,e){t.exports=i},2:function(t,e){t.exports=o},388:function(t,e,n){"use strict";n.r(e);var o,s,i=n(0),a=n(1),r=n(2),c=n(11),p=n(4),l="Source",u="Zoom to",d="Adjust layer transparency",g="View layer details",h="Options",m="Toggle layer visibility",f="Show layers for map data only",b="Interact with a Map widget",j=(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),S=function(t){function e(e){var n=t.call(this,e)||this;return n.unmount=!1,n.setMapThumbUrl=function(t){if(t||n.setState({mapThumbUrl:null}),n.props.portUrl&&n.props.portUrl!==Object(i.getAppStore)().getState().portalUrl)i.esri.restPortal.searchItems({q:"id:"+t,portal:n.props.portUrl+"/sharing/rest"}).then((function(t){if(!n.unmount)if(t.results[0]){var e=n.props.portUrl+"/sharing/rest/content/items/"+t.results[0].id+"/info/"+t.results[0].thumbnail;n.setState({mapThumbUrl:e})}else n.setState({mapThumbUrl:null})}));else{var e=Object(i.getAppStore)().getState().portalUrl,o=i.SessionManager.getInstance().getSessionByUrl(e);i.esri.restPortal.searchItems({q:"id:"+t,authentication:i.SessionManager.getInstance().getSessionByUrl(e),portal:e+"/sharing/rest"}).then((function(t){if(!n.unmount)if(t.results[0]){var s=e+"/sharing/rest/content/items/"+t.results[0].id+"/info/"+t.results[0].thumbnail+"?token="+(null==o?void 0:o.token);n.setState({mapThumbUrl:s})}else n.setState({mapThumbUrl:null})}))}},n.state={mapThumbUrl:null},n}return j(e,t),e.prototype.componentDidMount=function(){this.unmount=!1,this.setMapThumbUrl(this.props.mapItemId)},e.prototype.componentDidUpdate=function(t,e){t.mapItemId!==this.props.mapItemId&&this.setMapThumbUrl(this.props.mapItemId)},e.prototype.componentWillUnmount=function(){this.unmount=!0},e.prototype.render=function(){return this.state.mapThumbUrl?i.React.createElement(a.ImageWithParam,{imageParam:{url:this.state.mapThumbUrl}}):i.React.createElement(a.ImageWithParam,{imageParam:{}})},e}(i.React.PureComponent),y=function(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t};var x=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),O=function(t){function e(e){var n=t.call(this,e)||this;return n.supportedDsTypes=Object(i.Immutable)([p.DataSourceTypes.WebMap,p.DataSourceTypes.WebScene]),n.getPortUrl=function(){return Object(i.getAppStore)().getState().portalUrl},n.onRadioChange=function(t){n.props.onSettingChange({id:n.props.id,config:n.props.config.set("useMapWidget",t)}),n.setState({useMapWidget:t})},n.onToolsChanged=function(t,e){n.props.onSettingChange({id:n.props.id,config:n.props.config.set(e,t)})},n.onOptionsChanged=function(t,e){n.props.onSettingChange({id:n.props.id,config:n.props.config.set(e,t)})},n.onToggleUseDataEnabled=function(t){n.props.onSettingChange({id:n.props.id,useDataSourcesEnabled:t})},n.onDataSourceChange=function(t){t&&n.props.onSettingChange({id:n.props.id,useDataSources:t})},n.onMapWidgetSelected=function(t){n.props.onSettingChange({id:n.props.id,useMapWidgetIds:t})},n.state={useMapWidget:n.props.config.useMapWidget||!1},n}return x(e,t),e.prototype.render=function(){var t,e,n,o,p=this,j=this.getPortUrl(),x=null,O=null,w=null;return e=Object(i.jsx)("div",{className:"data-selector-section"},Object(i.jsx)(r.SettingRow,null,Object(i.jsx)(c.DataSourceSelector,{types:this.supportedDsTypes,useDataSources:this.props.useDataSources,useDataSourcesEnabled:!0,mustUseDataSource:!0,onChange:this.onDataSourceChange,widgetId:this.props.id})),j&&this.props.dsJsons&&this.props.useDataSources&&1===this.props.useDataSources.length&&Object(i.jsx)(r.SettingRow,null,Object(i.jsx)("div",{className:"w-100"},Object(i.jsx)("div",{className:"webmap-thumbnail",title:null===(t=this.props.dsJsons[this.props.useDataSources[0].dataSourceId])||void 0===t?void 0:t.label},Object(i.jsx)(S,{mapItemId:this.props.dsJsons[this.props.useDataSources[0].dataSourceId]?this.props.dsJsons[this.props.useDataSources[0].dataSourceId].itemId:null,portUrl:this.props.dsJsons[this.props.useDataSources[0].dataSourceId]?this.props.dsJsons[this.props.useDataSources[0].dataSourceId].portalUrl:null}))))),n=Object(i.jsx)("div",{className:"map-selector-section"},Object(i.jsx)(r.SettingRow,null,Object(i.jsx)(r.JimuMapViewSelector,{onSelect:this.onMapWidgetSelected,useMapWidgetIds:this.props.useMapWidgetIds}))),this.state.useMapWidget?(x=n,O=Object(i.jsx)(i.React.Fragment,null,Object(i.jsx)(r.SettingRow,{label:Object(i.jsx)(i.FormattedMessage,{id:"goto",defaultMessage:u})},Object(i.jsx)(a.Switch,{className:"can-x-switch",checked:this.props.config&&this.props.config.goto||!1,"data-key":"goto",onChange:function(t){p.onToolsChanged(t.target.checked,"goto")}})),Object(i.jsx)(r.SettingRow,{label:Object(i.jsx)(i.FormattedMessage,{id:"transparency",defaultMessage:d})},Object(i.jsx)(a.Switch,{className:"can-x-switch",checked:this.props.config&&this.props.config.opacity||!1,"data-key":"opacity",onChange:function(t){p.onToolsChanged(t.target.checked,"opacity")}}))),w=Object(i.jsx)(r.SettingRow,{label:Object(i.jsx)(i.FormattedMessage,{id:"setVisibility",defaultMessage:m})},Object(i.jsx)(a.Switch,{className:"can-x-switch",checked:this.props.config&&this.props.config.setVisibility||!1,"data-key":"setVisibility",onChange:function(t){p.onOptionsChanged(t.target.checked,"setVisibility")}}))):x=e,Object(i.jsx)("div",{css:(o=this.props.theme,Object(i.css)(s||(s=y(["\n    .widget-setting-layerlist{\n      font-weight: lighter;\n      font-size: 13px;\n\n      .source-descript {\n        color: ",";\t\n      }\n\n      .webmap-thumbnail{\n        cursor: auto;\n        width: 100%;\n        height: 120px;\n        overflow: hidden;\n        padding: 1px;\n        border: "," solid initial;\n        img, div{\n          width: 100%;\n          height: 100%;\n        }\n      }\n\n      .layerlist-tools{\n        .layerlist-tools-item{\n          display: flex;\n          /* justify-content: space-between; */\n          margin-bottom: 8px;\n        }\n      }\n\n      .map-selector-section .component-map-selector .form-control{\n        width: 100%;\n      }\n\n      .data-selector-section, .map-selector-section{\n        padding-top: 10px;\n      }\n\n    }\n  "],["\n    .widget-setting-layerlist{\n      font-weight: lighter;\n      font-size: 13px;\n\n      .source-descript {\n        color: ",";\t\n      }\n\n      .webmap-thumbnail{\n        cursor: auto;\n        width: 100%;\n        height: 120px;\n        overflow: hidden;\n        padding: 1px;\n        border: "," solid initial;\n        img, div{\n          width: 100%;\n          height: 100%;\n        }\n      }\n\n      .layerlist-tools{\n        .layerlist-tools-item{\n          display: flex;\n          /* justify-content: space-between; */\n          margin-bottom: 8px;\n        }\n      }\n\n      .map-selector-section .component-map-selector .form-control{\n        width: 100%;\n      }\n\n      .data-selector-section, .map-selector-section{\n        padding-top: 10px;\n      }\n\n    }\n  "])),o.colors.palette.dark[600],i.polished.rem(2)))},Object(i.jsx)("div",{className:"widget-setting-layerlist"},Object(i.jsx)(r.SettingSection,{title:this.props.intl.formatMessage({id:"sourceLabel",defaultMessage:l})},Object(i.jsx)(r.SettingRow,null,Object(i.jsx)("div",{className:"layerlist-tools w-100"},Object(i.jsx)("div",{className:"w-100"},Object(i.jsx)("div",{className:"layerlist-tools-item radio"},Object(i.jsx)(a.Radio,{id:"map-data",style:{cursor:"pointer"},name:"map-data",onChange:function(t){return p.onRadioChange(!1)},checked:!this.state.useMapWidget}),Object(i.jsx)(a.Label,{style:{cursor:"pointer"},for:"map-data",className:"ml-1"},this.props.intl.formatMessage({id:"showLayerForMap",defaultMessage:f})))),Object(i.jsx)("div",{className:"w-100"},Object(i.jsx)("div",{className:"layerlist-tools-item radio"},Object(i.jsx)(a.Radio,{id:"map-view",style:{cursor:"pointer"},name:"map-view",onChange:function(t){return p.onRadioChange(!0)},checked:this.state.useMapWidget}),Object(i.jsx)(a.Label,{style:{cursor:"pointer"},for:"map-view",className:"ml-1"},this.props.intl.formatMessage({id:"interactWithMap",defaultMessage:b})))))),x),Object(i.jsx)(r.SettingSection,{title:this.props.intl.formatMessage({id:"options",defaultMessage:h})},O,Object(i.jsx)(r.SettingRow,{label:Object(i.jsx)(i.FormattedMessage,{id:"information",defaultMessage:g})},Object(i.jsx)(a.Switch,{className:"can-x-switch",checked:this.props.config&&this.props.config.information||!1,"data-key":"information",onChange:function(t){p.onToolsChanged(t.target.checked,"information")}})),w)))},e.mapExtraStateProps=function(t){return{dsJsons:t.appStateInBuilder.appConfig.dataSources}},e}(i.React.PureComponent);e.default=O},4:function(t,e){t.exports=s}}))}}}));