text: (self.webpackChunkgeonode_mapstore_client=self.webpackChunkgeonode_mapstore_client||[]).push([[3739],{43120:(e,t,r)=>{var n={"./cesium.js":[61133,6882,3219,5794,9437],"./leaflet.js":[48507,6259,5030,7517,9993,5378,6882,3991,3846,5701,7161],"./openlayers.js":[34637,6259,5030,2582,2043,5265,479,7202,4720,4738,9141,84,6932,658,3772,3715,4155,987,6830,5378,6882,2035,8767,3546,6909,6576,3498,6037],"./sink.js":[60620,5442]};function o(e){if(!r.o(n,e))return Promise.resolve().then((()=>{var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}));var t=n[e],o=t[0];return Promise.all(t.slice(1).map(r.e)).then((()=>r(o)))}o.keys=()=>Object.keys(n),o.id=43120,e.exports=o},40986:(e,t,r)=>{"use strict";r.d(t,{Z:()=>p});var n=r(24852),o=r(45697),i=r.n(o),a=r(86267),l=r(52043);function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var u={openlayers:{fit:function(e){var t,r=e.map,n=e.geometry,o=e.padding,i=e.geometryProjection,c=e.fixedZoom,u=e.maxZoom,s=e.duration,p=r.getView(),f=p.getProjection().getCode();if(2===n.length){var m=(0,a.reproject)(n,i,f),d=m.x,y=m.y;t=new l.Z([d,y])}else t=(0,a.reprojectBbox)(n,i,f);var v=o||{},b=v.top,g=void 0===b?0:b,h=v.right,O=void 0===h?0:h,w=v.bottom,E=void 0===w?0:w,j=v.left,P=void 0===j?0:j;p.fit(t,{padding:[g,O,E,P],maxZoom:c?p.getZoom():u,duration:s})}},leaflet:{fit:function(e){var t,r,n,o=e.map,i=e.geometry,l=e.padding,u=e.geometryProjection,s=e.fixedZoom,p=e.maxZoom,f=e.duration,m=s?o.getZoom():p,d=l.top,y=void 0===d?0:d,v=l.right,b=void 0===v?0:v,g=l.bottom,h=void 0===g?0:g,O=l.left,w=void 0===O?0:O;if(2===i.length){var E=(0,a.reproject)(i,u,"EPSG:4326"),j=E.x,P=E.y;t=[[P,j],[P,j]]}else{var S=(r=(0,a.reprojectBbox)(i,u,"EPSG:4326"),n=4,function(e){if(Array.isArray(e))return e}(r)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i=[],a=!0,l=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,o=e}finally{try{a||null==r.return||r.return()}finally{if(l)throw o}}return i}}(r,n)||function(e,t){if(e){if("string"==typeof e)return c(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?c(e,t):void 0}}(r,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),C=S[0],k=S[1],T=S[2];t=[[k,C],[S[3],T]]}o.flyToBounds(t,{paddingTopLeft:[w,y],paddingBottomRight:[b,h],maxZoom:m,animate:!!f,duration:f/1e3})}}};function s(e){var t=e.map,r=e.mapType,o=e.active,i=e.geometry,a=e.geometryProjection,l=void 0===a?"EPSG:4326":a,c=e.padding,s=e.maxZoom,p=e.fixedZoom,f=e.duration,m=(0,n.useRef)();return m.current=function(){t&&u[r]&&u[r].fit({map:t,geometry:i,padding:c,geometryProjection:l,maxZoom:s,fixedZoom:p,duration:f})},(0,n.useEffect)((function(){o&&i&&m.current()}),[i,o]),null}s.propTypes={id:i().string,map:i().object,mapType:i().string,active:i().boolean,geometry:i().array,geometryProjection:i().string,padding:i().object,maxZoom:i().number,fixedZoom:i().boolean,duration:i().number},s.defaultProps={geometryProjection:"EPSG:4326",padding:{top:0,right:0,bottom:0,left:0}};const p=s},43837:(e,t,r)=>{"use strict";r.d(t,{Z:()=>y});var n=r(24852),o=r.n(n),i=r(45697),a=r.n(i),l=r(6909),c=["map","active","method","mapId","mapType","features","options","onChange"];function u(){return(u=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}).apply(this,arguments)}function s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function p(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?s(Object(r),!0).forEach((function(t){f(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function f(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function m(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function d(e){var t,r,i=e.map,a=e.active,s=e.method,f=e.mapId,d=e.mapType,y=e.features,v=e.options,b=e.onChange,g=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,c),h=(t=(0,n.useState)([]),r=2,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i=[],a=!0,l=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,o=e}finally{try{a||null==r.return||r.return()}finally{if(l)throw o}}return i}}(t,r)||function(e,t){if(e){if("string"==typeof e)return m(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?m(e,t):void 0}}(t,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),O=h[0],w=h[1];return(0,n.useEffect)((function(){w(a?"drawOrEdit":"clean")}),[a]),"openlayers"!==d?null:o().createElement(l.Z,u({},g,{map:i,drawOwner:f,drawStatus:O,drawMethod:s,features:y,options:p({drawEnabled:a,addClickCallback:!0,editEnabled:!0,featureProjection:"EPSG:4326",geodesic:!1,stopAfterDrawing:!1,transformToFeatureCollection:!0,translateEnabled:!1,useSelectedStyle:!0},v),onDrawingFeatures:b.bind(null,f)}))}d.propTypes={active:a().boolean,method:a().string,features:a().array,onChange:a().func,options:a().object},d.defaultProps={active:!1,method:"Point",features:[],onChange:function(){},options:{}};const y=d},61928:(e,t,r)=>{"use strict";r.d(t,{Z:()=>j});var n=r(24852),o=r.n(n),i=r(45697),a=r.n(i),l=r(47037),c=r.n(l);function u(e){return(u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var s=["impl","name"];function p(){return(p=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}).apply(this,arguments)}function f(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function m(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function d(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?m(Object(r),!0).forEach((function(t){w(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):m(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function y(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function v(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function b(e,t){return(b=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function g(e,t){if(t&&("object"===u(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return h(e)}function h(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function O(e){return(O=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function w(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var E=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&b(e,t)}(l,e);var t,r,n,i,a=(n=l,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=O(n);if(i){var r=O(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return g(this,e)});function l(){var e;y(this,l);for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return w(h(e=a.call.apply(a,[this].concat(r))),"getTool",(function(t){var r=e.props.plugins;return c()(t)?{name:t,impl:r.tools[t]}:d({name:t.name,impl:r.tools[t.name]},t)})),w(h(e),"renderLayers",(function(){var t=e.props.map&&e.props.map.projection||"EPSG:3857",r=e.props.plugins.Layer;return e.props.layers.map((function(n,i){return o().createElement(r,{type:n.type,srs:t,position:i,key:n.id||n.name,options:n,env:n.localizedLayerStyles?e.props.env:[]},e.renderLayerContent(n,t))}))})),w(h(e),"renderLayerContent",(function(t,r){if(t.features&&"vector"===t.type){var n=e.props.plugins.Feature;return t.features.map((function(e){return o().createElement(n,{key:e.id,msId:e.id,type:e.type,crs:r,geometry:e.geometry,features:e.features,featuresCrs:t.featuresCrs||"EPSG:4326",layerStyle:t.style,style:e.style||t.style||null,properties:e.properties})}))}return null})),w(h(e),"renderTools",(function(){return e.props.tools.map((function(t){var r=e.getTool(t),n=r.impl,i=r.name,a=f(r,s);return o().createElement(n,p({key:i},a))}))})),e}return t=l,(r=[{key:"render",value:function(){var e=this.props.plugins.Map,t=this.props.map&&this.props.map.projection||"EPSG:3857";return this.props.map&&e?o().createElement(e,p({projectionDefs:this.props.projectionDefs,style:this.props.styleMap,id:this.props.id,zoomControl:!1,center:{x:0,y:0},zoom:1,hookRegister:this.props.hookRegister,mapStateSource:this.props.mapStateSource||this.props.id},this.props.options,this.props.map,{projection:t},this.props.eventHandlers),this.renderLayers(),this.renderTools(),this.props.children):null}}])&&v(t.prototype,r),l}(o().Component);w(E,"propTypes",{id:a().string,options:a().object,map:a().object,mapStateSource:a().string,eventHandlers:a().object,styleMap:a().object,layers:a().array,hookRegister:a().object,projectionDefs:a().array,plugins:a().any,tools:a().array,getLayerProps:a().func,env:a().array}),w(E,"defaultProps",{id:"__base_map__",options:{},map:{},styleMap:{},tools:[],projectionDefs:[],eventHandlers:{onMapViewChanges:function(){},onClick:function(){},onMouseMove:function(){},onLayerLoading:function(){},onLayerError:function(){}},env:[]});const j=E},19180:(e,t,r)=>{"use strict";r.d(t,{Z:()=>v});var n=r(24852),o=r.n(n),i=r(45697),a=r.n(i);function l(e){return(l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function c(){return(c=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}).apply(this,arguments)}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function p(e,t){return(p=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function f(e,t){if(t&&("object"===l(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return m(e)}function m(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function d(e){return(d=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function y(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const v=function(e){var t=function(t){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&p(e,t)}(b,t);var n,i,a,l,v=(a=b,l=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=d(a);if(l){var r=d(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return f(this,e)});function b(){var e;u(this,b);for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return y(m(e=v.call.apply(v,[this].concat(r))),"state",{plugins:{}}),e}return n=b,(i=[{key:"componentDidMount",value:function(){this.setPlugins(this.props),this._isMounted=!0}},{key:"componentWillUpdate",value:function(e){e.mapType!==this.props.mapType&&this.setPlugins(e)}},{key:"componentWillUnmount",value:function(){this._isMounted=!1}},{key:"render",value:function(){var t=this.state.plugins;return o().createElement(e,c({},this.props,{plugins:t}))}},{key:"setPlugins",value:function(e){var t=this;e.mapType&&r(43120)("./"+e.mapType+".js").then((function(e){t._isMounted&&(t.setState({plugins:e.default()}),t.props.onMapTypeLoaded())}))}}])&&s(n.prototype,i),b}(o().Component);return y(t,"propTypes",{mapType:a().string,onMapTypeLoaded:a().func}),y(t,"defaultProps",{onMapTypeLoaded:function(){}}),t.displayName="".concat(e.displayName,"WithMapType"),t}},93451:(e,t,r)=>{"use strict";r.d(t,{Z:()=>E});var n=r(86638),o=r(45697),i=r.n(o),a=r(84596),l=r.n(a),c=r(1469),u=r.n(c),s=r(14293),p=r.n(s),f=r(47037),m=r.n(f),d=r(67076),y=["messages"];function v(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function b(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function g(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?b(Object(r),!0).forEach((function(t){h(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):b(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function h(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var O=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"label";if(u()(t))return t.map((function(o){var i=(0,n.S$)(e,o[r]||m()(o)&&o||"");return g(g({},o),{},h({},r,p()(i)?t:i))}));var o=(0,n.S$)(e,t);return p()(o)?t:o},w=function(e,t,r){return function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1?arguments[1]:void 0;return g(g({},n),{},h({},o,e[o]&&O(t,e[o],r)))}};const E=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"label";return(0,d.compose)((0,d.getContext)({messages:i().object}),(0,d.mapProps)((function(r){var n=r.messages,o=v(r,y);return g(g({},o),l()(e).reduce(w(o,n,t),{}))})))}},824:(e,t,r)=>{"use strict";r.d(t,{Z:()=>c});var n=r(24852),o=r.n(n);function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function a(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?i(Object(r),!0).forEach((function(t){l(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function l(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const c=(0,n.forwardRef)((function(e,t){var r=e.enabled,n=e.style,i=e.children;return r?o().createElement("div",{ref:t,className:"gn-overlay-container",style:a({position:"relative",width:"100%",height:"100%"},n)},i):null}))},28261:(e,t,r)=>{"use strict";r.d(t,{Z:()=>s});var n=r(24852),o=r.n(n),i=r(45697),a=r.n(i),l=["id","className","style","children"];function c(){return(c=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}).apply(this,arguments)}function u(e){var t=e.id,r=e.className,n=e.style,i=e.children,a=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,l),u=r?" "+r:"";return o().createElement(o().Fragment,null,o().createElement("div",c({},a,{id:t,className:"gn-spinner".concat(u),style:n}),o().createElement("div",null)),i)}u.propTypes={id:a().string,className:a().string,style:a().object},u.defaultProps={};const s=u},51605:(e,t,r)=>{"use strict";r.d(t,{Z:()=>n.Z});var n=r(28261)},97610:(e,t,r)=>{"use strict";r.d(t,{Z:()=>o});var n=r(24852);const o=function(e){var t=e.scrollContainer,r=e.shouldScroll,o=void 0===r?function(){return!0}:r,i=e.onLoad,a=e.offset,l=void 0===a?200:a,c=(0,n.useRef)({});c.current=function(){(t?t.scrollTop:document.body.scrollTop||document.documentElement.scrollTop)+(t?t.clientHeight:window.innerHeight)>=(t?t.scrollHeight:document.body.scrollHeight||document.documentElement.scrollHeight)-l&&o()&&i()},(0,n.useEffect)((function(){var e=t||window;function r(){c.current()}return e.addEventListener("scroll",r),function(){e.removeEventListener("scroll",r)}}),[t])}},91579:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>Ve});var n=r(24852),o=r.n(n),i=r(45697),a=r.n(i),l=r(71703),c=r(22222),u=r(22843),s=r(82904),p=r(5346),f=r(25108),m=r(93473),d=r(827),y=r(75110),v=r(824),b=r(3828),g=r(43892),h=r(17594),O=r(57588),w=r(90702),E=r(97610),j=r(97111),P=r(43129);function S(e){var t=e.type,r=e.name,n=e.options,i=e.hideOptions,a=e.hideIcon,l=e.permissions,c=e.avatar,u=e.children,s=e.clearable,f=e.onChange;return o().createElement("div",{className:"gn-share-permissions-row"},!a&&(t||c)&&o().createElement("div",{className:"gn-share-permissions-icon"},c?o().createElement("img",{src:c}):o().createElement(h.Z,{name:t})),o().createElement("div",{className:"gn-share-permissions-name"},r),o().createElement("div",{className:"gn-share-permissions-tools"},u),!i&&o().createElement("div",{className:"gn-share-permissions-options"},"owner"===l?o().createElement(p.Z,{msgId:"gnviewer.permissionOwner"}):o().createElement(P.ZP,{clearable:s,options:n.map((function(e){var t=e.value,r=e.labelId;return{value:t,label:o().createElement(p.Z,{msgId:r})}})),value:l,onChange:function(e){return f({permissions:(null==e?void 0:e.value)||""})}})))}S.propTypes={options:a().array,clearable:a().bool,onChange:a().func},S.defaultProps={options:[{value:"view",labelId:"gnviewer.permissionView"},{value:"download",labelId:"gnviewer.permissionDownload"},{value:"edit",labelId:"gnviewer.permissionEdit"},{value:"manage",labelId:"gnviewer.permissionManage"}],clearable:!1,onChange:function(){}};const C=S;var k=r(51605),T=r(93451),I=["onChange","value"],Z=["permissions"];function x(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function A(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?x(Object(r),!0).forEach((function(t){D(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):x(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function D(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function N(e){return function(e){if(Array.isArray(e))return _(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||R(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function L(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i=[],a=!0,l=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,o=e}finally{try{a||null==r.return||r.return()}finally{if(l)throw o}}return i}}(e,t)||R(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function R(e,t){if(e){if("string"==typeof e)return _(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_(e,t):void 0}}function _(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function M(){return(M=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}).apply(this,arguments)}function G(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var U=(0,T.Z)("placeholder")(O.FormControl),z=(0,j.Z)("onChange","value")((function(e){var t=e.onChange,r=e.value,n=G(e,I);return o().createElement(U,M({},n,{value:r,onChange:function(e){return t(e.target.value)}}))}));function F(e){var t=e.request,r=e.responseToEntries,i=e.onAdd,a=e.onRemove,l=e.defaultPermission,c=e.pageSize,u=e.placeholderId,s=(0,n.useRef)(),f=L((0,n.useState)([]),2),d=f[0],y=f[1],v=L((0,n.useState)(!1),2),b=v[0],g=v[1],O=L((0,n.useState)(1),2),w=O[0],j=O[1],P=L((0,n.useState)(!1),2),S=P[0],T=P[1],I=L((0,n.useState)(""),2),x=I[0],D=I[1],R=(0,n.useRef)();(0,E.Z)({scrollContainer:s.current,shouldScroll:function(){return!b&&S},onLoad:function(){j(w+1)}});var _=(0,n.useRef)();function U(e){y(d.map((function(t){return t.id===e.id?e:t})))}return _.current=function(e){!b&&t&&(g(!0),t({q:x,page:e.page,pageSize:c}).then((function(t){if(R.current){var n=r(t);T(t.isNextPageAvailable),y(1===e.page?n:[].concat(N(d),N(n))),g(!1)}})).catch((function(){R.current&&g(!1)})))},(0,n.useEffect)((function(){return R.current=!0,function(){R.current=!1}}),[]),(0,n.useEffect)((function(){w>1&&_.current({page:w})}),[w]),(0,n.useEffect)((function(){j(1),_.current({page:1})}),[x]),o().createElement("div",{className:"gn-add-permissions-entries-panel"},o().createElement("div",{className:"gn-share-filter"},o().createElement(z,{placeholder:u,value:x,debounceTime:300,onChange:function(e){return D(e)}}),x&&!b&&o().createElement(m.Z,{onClick:function(){return D("")}},o().createElement(h.Z,{name:"times"})),b&&o().createElement(k.Z,null)),o().createElement("ul",{className:"gn-share-permissions-list",ref:s},d.map((function(e,t){return o().createElement("li",{key:e.id+"-"+t},o().createElement(C,M({},e,{hideOptions:!0}),e.permissions?o().createElement(m.Z,{onClick:function(){return function(e){e.permissions;var t=G(e,Z);a(t),U(t)}(e)}},o().createElement(h.Z,{name:"trash"})):o().createElement(m.Z,{onClick:function(){return function(e){var t=A(A({},e),{},{permissions:l});i(t),U(t)}(e)}},o().createElement(h.Z,{name:"plus"}))))})),0===d.length&&!b&&o().createElement("div",{className:"gn-permissions-alert"},o().createElement(p.Z,{msgId:"gnviewer.permissionsEntriesNoResults"}))))}F.propTypes={request:a().func,responseToEntries:a().func,onAdd:a().func,onRemove:a().func,defaultPermission:a().string,pageSize:a().number,placeholderId:a().string},F.defaultProps={defaultPermission:"view",pageSize:20,onAdd:function(){},onRemove:function(){},responseToEntries:function(e){return e.resources},placeholderId:"gnviewer.filterBy"};const H=F;var B=r(61928),$=r(19180),V=r(43837),q=r(40986),W=r(97842),K=r(13292),X=r.n(K);function J(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Q(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?J(Object(r),!0).forEach((function(t){Y(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):J(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Y(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ee(e){return function(e){if(Array.isArray(e))return ne(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||re(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function te(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i=[],a=!0,l=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,o=e}finally{try{a||null==r.return||r.return()}finally{if(l)throw o}}return i}}(e,t)||re(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function re(e,t){if(e){if("string"==typeof e)return ne(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ne(e,t):void 0}}function ne(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var oe=(0,$.Z)(B.Z);function ie(e){var t=e.projection,r=e.layers,i=e.features,a=e.onChange,l=e.mapType,c=e.children,u=e.onRefresh,s=e.loading,p=te((0,n.useState)([]),2),f=p[0],d=p[1],y=te((0,n.useState)(i),2),v=y[0],b=y[1],g=te((0,n.useState)(!1),2),h=g[0],O=g[1],w=te((0,n.useState)(!1),2),E=w[0],j=w[1],P=te((0,n.useState)(function(e){var t=e.features,r=e.layers;if(t&&t.length>0)return X()({type:"FeatureCollection",features:t});var n=(r.find((function(e){return e.isDataset}))||{}).bbox||{},o=n.bounds,i=n.crs;return o&&"EPSG:4326"===i?[o.minx,o.miny,o.maxx,o.maxy]:null}({layers:r,features:i})),1)[0];function S(e){b(e),a({features:e})}return(0,n.useEffect)((function(){O(!1),setTimeout((function(){O(!0)}))}),[E]),o().createElement("div",{className:"gn-geo-limits"},o().createElement(oe,{id:"gn-geo-limits-map",mapType:l,map:{registerHooks:!1,projection:t},styleMap:{position:"absolute",width:"100%",height:"100%"},eventHandlers:{},layers:[].concat(ee(r),[{type:"vector",id:"v",features:v}])},o().createElement(V.Z,{active:h,mapType:l,features:v,method:"Polygon",onChange:function(e,t){E||S((t||[]).map((function(e){return Q(Q({},e),{},{id:e.properties.id})})))},options:E?{drawEnabled:!0,addClickCallback:!1,editEnabled:!1,selectEnabled:!1,featureProjection:"EPSG:4326",geodesic:!1,stopAfterDrawing:!1,transformToFeatureCollection:!0,translateEnabled:!1,useSelectedStyle:!0}:{drawEnabled:!1,addClickCallback:!1,editEnabled:!0,selectEnabled:!0,featureProjection:"EPSG:4326",geodesic:!1,stopAfterDrawing:!1,transformToFeatureCollection:!0,translateEnabled:!1,useSelectedStyle:!0},onSelectFeatures:function(e){var t=e.map((function(e){var t=e.selected,r=e.id;return t?r:null})).filter((function(e){return null!==e}));d(t)},onEndDrawing:function(e){var t,r,n;n=(null==e||null===(t=e.features)||void 0===t?void 0:t[(null==e||null===(r=e.features)||void 0===r?void 0:r.length)-1])||{},S([].concat(ee(v),[Q(Q({},n),{},{id:n.properties.id})]))}}),o().createElement(q.Z,{mapType:l,active:!0,geometry:P,duration:300})),o().createElement("div",{className:"gn-geo-limits-tools"},o().createElement(m.Z,{variant:E?"primary":"default",onClick:function(){return j(!E)}},o().createElement(W.Z,{name:"pencil"})),o().createElement(m.Z,{disabled:E,onClick:function(){S(v.filter((function(e){var t=e.properties;return!f.includes(t.id)})))}},o().createElement(W.Z,{name:"trash"})),c,o().createElement(m.Z,{disabled:E,onClick:function(){u()}},o().createElement(W.Z,{name:"refresh"}))),s&&o().createElement("div",{className:"gn-geo-limits-loader"},o().createElement(k.Z,null)))}oe.displayName="Map",ie.propTypes={projection:a().string,layers:a().array,features:a().array,onChange:a().func,mapType:a().string},ie.defaultProps={projection:"EPSG:3857",layers:[],features:[],onChange:function(){},mapType:"openlayers"};const ae=ie;var le=r(35721),ce=r(89514);function ue(){return(ue=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}).apply(this,arguments)}function se(e){return function(e){if(Array.isArray(e))return ve(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||ye(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function pe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function fe(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?pe(Object(r),!0).forEach((function(t){me(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):pe(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function me(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function de(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i=[],a=!0,l=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,o=e}finally{try{a||null==r.return||r.return()}finally{if(l)throw o}}return i}}(e,t)||ye(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ye(e,t){if(e){if("string"==typeof e)return ve(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ve(e,t):void 0}}function ve(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var be=(0,T.Z)("placeholder")(O.FormControl);const ge=function(e){var t,r=e.compactPermissions,i=void 0===r?{}:r,a=e.layers,l=void 0===a?[]:a,c=e.onChange,u=void 0===c?function(){}:c,s=e.entriesTabs,f=void 0===s?[]:s,d=e.options,y=e.groupOptions,v=e.defaultGroupOptions,b=e.enableGeoLimits,g=e.requestGeoLimits,E=void 0===g?ce.B9:g,j=e.resourceId,P=e.loading,S=(0,le.MH)(i),T=S.entries,I=void 0===T?[]:T,Z=S.groups,x=void 0===Z?[]:Z,A=de((0,n.useState)((null==f||null===(t=f[0])||void 0===t?void 0:t.id)||""),2),D=A[0],N=A[1],L=de((0,n.useState)(I),2),R=L[0],_=L[1],M=de((0,n.useState)(x),2),G=M[0],U=M[1],z=de((0,n.useState)([]),2),F=z[0],B=z[1],$=de((0,n.useState)(""),2),V=$[0],q=$[1];function W(e){u((0,le.gI)(fe({entries:R,groups:G},e)))}function K(e,t){var r=G.map((function(r){return r.id===e?fe(fe({},r),t):r}));U(r),W({groups:r})}function X(e){var t=[].concat(se(R),[fe(fe({},e),{},{permissions:"view"})]);_(t),W({entries:t})}function J(e){var t=R.filter((function(t){return t.id!==e.id}));_(t),W({entries:t})}function Q(e,t,r){var n=R.map((function(r){return r.id===e?fe(fe({},r),t):r}));_(n),r||W({entries:n})}function Y(e){var t=!F[1];function r(r,n){var o=(r[e]||"").toLowerCase(),i=(n[e]||"").toLowerCase();return t?o>i?1:-1:o>i?-1:1}B([e,t]),_(se(R).sort(r)),U(se(G).sort(r))}(0,n.useEffect)((function(){Y(F[1]||"name")}),[]);var ee=R.filter((function(e){var t,r,n,o;return!V||(null==e||null===(t=e.name)||void 0===t||null===(r=t.toLowerCase())||void 0===r?void 0:r.includes(null==V?void 0:V.toLowerCase()))||(null==e||null===(n=e.permissions)||void 0===n||null===(o=n.toLowerCase())||void 0===o?void 0:o.includes(null==V?void 0:V.toLowerCase()))})),te=(0,n.useRef)();function re(e){e.geoLimitsLoading||(Q(e.id,{geoLimitsLoading:!0},!0),E(j,e.id,e.type).then((function(t){te.current&&Q(e.id,{geoLimitsLoading:!1,features:t.features||[],isGeoLimitsChanged:!1})})).catch((function(){te.current&&Q(e.id,{geoLimitsLoading:!1,features:[],isGeoLimitsChanged:!1})})))}return(0,n.useEffect)((function(){return te.current=!0,function(){te.current=!1}}),[]),o().createElement("div",{className:"gn-share-permissions-container"},o().createElement("div",{className:"gn-share-permissions-list-head"},o().createElement(w.Z,{placement:"bottom",content:o().createElement("div",{className:"gn-add-permissions-entries-container"},o().createElement(O.Nav,{bsStyle:"tabs",activeKey:D},f.map((function(e){return o().createElement(O.NavItem,{key:e.id,eventKey:e.id,onClick:function(){return N(e.id)}},o().createElement(p.Z,{msgId:e.labelId}))}))),o().createElement("div",{className:"gn-add-permissions-entries-body"},f.filter((function(e){return e.id===D})).map((function(e){return o().createElement(H,{key:e.id,request:function(t){return e.request(fe(fe({},t),{},{entries:R,groups:G}))},onAdd:X,onRemove:J,responseToEntries:function(t){return e.responseToEntries({response:t,entries:R})}})}))))},o().createElement(m.Z,{size:"sm"},o().createElement(h.Z,{name:"plus"})," ",o().createElement(p.Z,{msgId:"gnviewer.addPermissionsEntry"}))),o().createElement("div",{className:"gn-share-filter"},o().createElement(be,{placeholder:"gnviewer.filterByNameOrPermissions",value:V,onChange:function(e){return q(e.target.value)}}),V&&o().createElement(m.Z,{onClick:function(){return q("")}},o().createElement(h.Z,{name:"times"}))),o().createElement("div",{className:"gn-share-permissions-head"},o().createElement("div",{className:"gn-share-permissions-row"},o().createElement("div",{className:"gn-share-permissions-name"},o().createElement(m.Z,{onClick:Y.bind(null,"name")},o().createElement(p.Z,{msgId:"gnviewer.permissionsName"}),"name"===F[0]&&o().createElement(o().Fragment,null," ",o().createElement(h.Z,{name:F[1]?"chevron-up":"chevron-down"})))),o().createElement("div",{className:"gn-share-permissions-options"},o().createElement(m.Z,{onClick:Y.bind(null,"permissions")},o().createElement(p.Z,{msgId:"gnviewer.permissions"}),"permissions"===F[0]&&o().createElement(o().Fragment,null," ",o().createElement(h.Z,{name:F[1]?"chevron-up":"chevron-down"}))))))),o().createElement("ul",{className:"gn-share-permissions-list"},o().createElement("li",{className:"gn-share-permissions-pinned"},G.map((function(e){return o().createElement(C,ue({key:e.id},e,{hideIcon:!0,onChange:K.bind(null,e.id),name:o().createElement("strong",null,o().createElement(p.Z,{msgId:"gnviewer.".concat(e.name)})),options:y[e.name]||v}))}))),ee.map((function(e,t){return o().createElement("li",{key:e.id+"-"+t},o().createElement(C,ue({},e,{onChange:Q.bind(null,e.id),options:d}),"owner"!==e.permissions&&o().createElement(o().Fragment,null,b&&o().createElement(w.Z,{placement:"left",onOpen:function(t){t&&!e.features&&re(e)},content:o().createElement(ae,{key:e.geoLimitsLoading,layers:l,features:e.features,loading:e.geoLimitsLoading,onChange:function(t){return Q(e.id,fe(fe({},t),{},{isGeoLimitsChanged:!0}))},onRefresh:re.bind(null,e)})},o().createElement(m.Z,null,o().createElement(h.Z,{name:"globe"}))),o().createElement(m.Z,{onClick:J.bind(null,e)},o().createElement(h.Z,{name:"trash"})))))}))),0===ee.length&&o().createElement("div",{className:"gn-permissions-alert"},o().createElement(p.Z,{msgId:"gnviewer.permissionsEntriesNoResults"})),P&&o().createElement("div",{className:"gn-spinner-container"},o().createElement(k.Z,null)))};var he=r(99380),Oe=r(74855),we=r.n(Oe),Ee=r(72500),je=r.n(Ee),Pe=["search"];function Se(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Ce(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ke(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ce(Object(r),!0).forEach((function(t){Te(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ce(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Te(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ie(e){var t=je().parse(e),r=(t.search,function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(t,Pe)),n=r.hash&&"#".concat(Ie(r.hash.replace("#","")));return je().format(ke(ke({},r),n&&{hash:n}))}const Ze=function(){var e,t,r=Ie(window.location.href),i=(e=(0,n.useState)(!1),t=2,function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i=[],a=!0,l=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,o=e}finally{try{a||null==r.return||r.return()}finally{if(l)throw o}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Se(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Se(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),a=i[0],l=i[1];return(0,n.useEffect)((function(){a&&setTimeout((function(){l(!1)}),1e3)}),[a]),o().createElement("div",{className:"gn-share-link"},o().createElement("input",{readOnly:!0,rel:"noopener noreferrer",target:"_blank",value:r}),!a&&o().createElement(we(),{text:r},o().createElement(m.Z,{size:"sm",onClick:function(){return l(!0)}},o().createElement(h.Z,{name:"copy"}))),a&&o().createElement(m.Z,{size:"sm"},o().createElement(h.Z,{name:"check"})))};function xe(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}const Ae=function(e){var t,r,i=e.allowFullScreen,a=e.shareUrl,l=e.width,c=void 0===l?600:l,u=e.height,s=void 0===u?400:u,p="<iframe ".concat(i?"allowFullScreen":"",' style="border: none;" height="').concat(s||0,'" width="').concat(c||0,'" src="').concat(a,'"></iframe>'),f=(t=(0,n.useState)(!1),r=2,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i=[],a=!0,l=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,o=e}finally{try{a||null==r.return||r.return()}finally{if(l)throw o}}return i}}(t,r)||function(e,t){if(e){if("string"==typeof e)return xe(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?xe(e,t):void 0}}(t,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),d=f[0],y=f[1];return(0,n.useEffect)((function(){d&&setTimeout((function(){y(!1)}),1e3)}),[d]),o().createElement("div",{className:"gn-share-link"},o().createElement("textarea",{readOnly:!0},p),!d&&o().createElement(we(),{text:p},o().createElement(m.Z,{size:"sm",onClick:function(){return y(!0)}},o().createElement(h.Z,{name:"copy"}))),d&&o().createElement(m.Z,{size:"sm"},o().createElement(h.Z,{name:"check"})))};var De=r(52992),Ne=["entries","groups"],Le=["entries","groups"];function Re(e){return function(e){if(Array.isArray(e))return _e(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return _e(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_e(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _e(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Me(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ge(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Me(Object(r),!0).forEach((function(t){Ue(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Me(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Ue(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ze(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var Fe=[{id:"user",labelId:"gnviewer.users",request:function(e){var t=e.entries,r=(e.groups,ze(e,Ne)),n=t.filter((function(e){return"user"===e.type})).map((function(e){return e.id}));return(0,he.Rf)(Ge(Ge({},r),{},{"filter{-pk.in}":[].concat(Re(n),[-1])}))},responseToEntries:function(e){var t=e.response,r=e.entries;return null==t?void 0:t.users.map((function(e){var t=(r.find((function(t){return t.id===e.pk}))||{}).permissions;return Ge(Ge({},(0,le.d1)("user",e)),{},{permissions:t})}))}},{id:"group",labelId:"gnviewer.groups",request:function(e){var t=e.entries,r=e.groups,n=ze(e,Le),o=t.filter((function(e){return"group"===e.type})).map((function(e){return e.id})),i=r.map((function(e){return e.id})),a=[].concat(Re(o||[]),Re(i||[]));return(0,he.jA)(Ge(Ge({},n),{},{"filter{-group.pk.in}":a}))},responseToEntries:function(e){var t=e.response,r=e.entries;return null==t?void 0:t.groups.map((function(e){var t=(r.find((function(t){return t.id===e.pk}))||{}).permissions;return Ge(Ge({},(0,le.d1)("group",e)),{},{permissions:t})}))}}];function He(e){var t=e.enabled,r=e.width,n=e.permissionsOptions,i=e.resourceId,a=e.compactPermissions,l=e.layers,c=e.onChangePermissions,u=e.enableGeoLimits,s=e.onClose,f=e.canEdit,d=e.permissionsGroupOptions,y=e.permissionsDefaultGroupOptions,b=e.permissionsLoading,g=e.embedUrl;return o().createElement(v.Z,{enabled:t,style:{width:r}},o().createElement("section",{className:"gn-share-panel"},o().createElement("div",{className:"gn-share-panel-head"},o().createElement("h2",null,o().createElement(p.Z,{msgId:"gnviewer.shareThisResource"})),o().createElement(m.Z,{size:"sm",onClick:function(){return s()}},o().createElement(h.Z,{name:"times"}))),o().createElement("div",{className:"gn-share-panel-body"},o().createElement(Ze,null),o().createElement("div",{className:"gn-share-panel-label"},o().createElement("label",null,o().createElement(p.Z,{msgId:"gnviewer.embed"}),":")),o().createElement(Ae,{shareUrl:g}),f&&o().createElement(o().Fragment,null,o().createElement("div",{className:"gn-share-panel-label"},o().createElement("label",null,o().createElement(p.Z,{msgId:"gnviewer.permissions"}),":")),o().createElement(ge,{compactPermissions:a,layers:l,entriesTabs:Fe,onChange:c,options:n,enableGeoLimits:u,resourceId:i,groupOptions:d,defaultGroupOptions:y,loading:b})))))}He.propTypes={resourceId:a().oneOfType([a().number,a().string]),enabled:a().bool,onClose:a().func,width:a().number,permissionsOptions:a().array,defaultGroupOptions:a().array,groupOptions:a().array},He.defaultProps={resourceId:null,enabled:!1,onClose:function(){},width:800,permissionsGroupOptions:{anonymous:[{value:"none",labelId:"gnviewer.permissionNone"},{value:"view",labelId:"gnviewer.permissionView"},{value:"download",labelId:"gnviewer.permissionDownload"}]},permissionsOptions:[{value:"view",labelId:"gnviewer.permissionView"},{value:"download",labelId:"gnviewer.permissionDownload"},{value:"edit",labelId:"gnviewer.permissionEdit"},{value:"manage",labelId:"gnviewer.permissionManage"}],permissionsDefaultGroupOptions:[{value:"none",labelId:"gnviewer.permissionNone"},{value:"view",labelId:"gnviewer.permissionView"},{value:"download",labelId:"gnviewer.permissionDownload"},{value:"edit",labelId:"gnviewer.permissionEdit"}]};var Be=(0,l.connect)((0,c.P1)([function(e){var t,r;return"Share"===(null==e||null===(t=e.controls)||void 0===t||null===(r=t.rightOverlay)||void 0===r?void 0:r.enabled)},b.fg,d._H,b.iV,y.l2,b.gH,De.I,b.yK],(function(e,t,r,n,o,i,a,l){return{enabled:e,resourceId:t||(null==r?void 0:r.id),compactPermissions:n,layers:o,canEdit:i,permissionsLoading:a,embedUrl:null==l?void 0:l.embed_url}})),{onClose:s.Xg.bind(null,"rightOverlay","enabled",!1),onChangePermissions:g.nO})(He),$e=(0,l.connect)((0,c.P1)(b.V$,b.fg,d._H,(function(e,t,r){return{enabled:!e&&(t||(null==r?void 0:r.id))}})),{onClick:s.Xg.bind(null,"rightOverlay","enabled","Share")})((function(e){var t=e.enabled,r=e.variant,n=e.onClick,i=e.size;return t?o().createElement(m.Z,{variant:r||"primary",size:i,onClick:function(){return n()}},o().createElement(p.Z,{msgId:"share.title"})):null}));const Ve=(0,u.rx)("Share",{component:Be,containers:{ViewerLayout:{name:"Share",target:"rightOverlay",priority:1},ActionNavbar:{name:"Share",Component:$e,priority:1}},epics:{},reducers:{controls:f.Z}})},52992:(e,t,r)=>{"use strict";r.d(t,{j:()=>i,I:()=>a});var n=r(3828),o=r(12530),i=function(e,t){var r,n;return((null==e||null===(r=e.resourceservice)||void 0===r||null===(n=r.processes)||void 0===n?void 0:n.find((function(e){var r,n;return(null==e||null===(r=e.resource)||void 0===r?void 0:r.pk)===(null==t||null===(n=t.resource)||void 0===n?void 0:n.pk)&&(null==e?void 0:e.processType)===(null==t?void 0:t.processType)})))||{}).completed},a=function(e){var t,r,i=(0,n.yK)(e),a=i&&(null==e||null===(t=e.resourceservice)||void 0===t||null===(r=t.processes)||void 0===r?void 0:r.find((function(e){var t;return(null==e||null===(t=e.resource)||void 0===t?void 0:t.pk)===(null==i?void 0:i.pk)&&(null==e?void 0:e.processType)===o.zj.PERMISSIONS_RESOURCE})));return!(!a||null!=a&&a.completed)}},20640:(e,t,r)=>{"use strict";var n=r(11742),o={"text/plain":"Text","text/html":"Url",default:"Text"};e.exports=function(e,t){var r,i,a,l,c,u,s=!1;t||(t={}),r=t.debug||!1;try{if(a=n(),l=document.createRange(),c=document.getSelection(),(u=document.createElement("span")).textContent=e,u.style.all="unset",u.style.position="fixed",u.style.top=0,u.style.clip="rect(0, 0, 0, 0)",u.style.whiteSpace="pre",u.style.webkitUserSelect="text",u.style.MozUserSelect="text",u.style.msUserSelect="text",u.style.userSelect="text",u.addEventListener("copy",(function(n){if(n.stopPropagation(),t.format)if(n.preventDefault(),void 0===n.clipboardData){r&&console.warn("unable to use e.clipboardData"),r&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var i=o[t.format]||o.default;window.clipboardData.setData(i,e)}else n.clipboardData.clearData(),n.clipboardData.setData(t.format,e);t.onCopy&&(n.preventDefault(),t.onCopy(n.clipboardData))})),document.body.appendChild(u),l.selectNodeContents(u),c.addRange(l),!document.execCommand("copy"))throw new Error("copy command was unsuccessful");s=!0}catch(n){r&&console.error("unable to copy using execCommand: ",n),r&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(t.format||"text",e),t.onCopy&&t.onCopy(window.clipboardData),s=!0}catch(n){r&&console.error("unable to copy using clipboardData: ",n),r&&console.error("falling back to prompt"),i=function(e){var t=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return e.replace(/#{\s*key\s*}/g,t)}("message"in t?t.message:"Copy to clipboard: #{key}, Enter"),window.prompt(i,e)}}finally{c&&("function"==typeof c.removeRange?c.removeRange(l):c.removeAllRanges()),u&&document.body.removeChild(u),a()}return s}},23279:(e,t,r)=>{var n=r(13218),o=r(7771),i=r(14841),a=Math.max,l=Math.min;e.exports=function(e,t,r){var c,u,s,p,f,m,d=0,y=!1,v=!1,b=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function g(t){var r=c,n=u;return c=u=void 0,d=t,p=e.apply(n,r)}function h(e){return d=e,f=setTimeout(w,t),y?g(e):p}function O(e){var r=e-m;return void 0===m||r>=t||r<0||v&&e-d>=s}function w(){var e=o();if(O(e))return E(e);f=setTimeout(w,function(e){var r=t-(e-m);return v?l(r,s-(e-d)):r}(e))}function E(e){return f=void 0,b&&c?g(e):(c=u=void 0,p)}function j(){var e=o(),r=O(e);if(c=arguments,u=this,m=e,r){if(void 0===f)return h(m);if(v)return clearTimeout(f),f=setTimeout(w,t),g(m)}return void 0===f&&(f=setTimeout(w,t)),p}return t=i(t)||0,n(r)&&(y=!!r.leading,s=(v="maxWait"in r)?a(i(r.maxWait)||0,t):s,b="trailing"in r?!!r.trailing:b),j.cancel=function(){void 0!==f&&clearTimeout(f),d=0,c=m=u=f=void 0},j.flush=function(){return void 0===f?p:E(o())},j}},7771:(e,t,r)=>{var n=r(55639);e.exports=function(){return n.Date.now()}},74300:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CopyToClipboard=void 0;var n=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},o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=l(r(24852)),a=l(r(20640));function l(e){return e&&e.__esModule?e:{default:e}}function c(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}t.CopyToClipboard=function(e){function t(){var e,r,n;c(this,t);for(var o=arguments.length,l=Array(o),s=0;s<o;s++)l[s]=arguments[s];return r=n=u(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(l))),n.onClick=function(e){var t=n.props,r=t.text,o=t.onCopy,l=t.children,c=t.options,u=i.default.Children.only(l),s=(0,a.default)(r,c);o&&o(r,s),u&&u.props&&"function"==typeof u.props.onClick&&u.props.onClick(e)},u(n,r)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),o(t,[{key:"render",value:function(){var e=this.props,t=(e.text,e.onCopy,e.options,e.children),r=function(e,t){var r={};for(var n in e)t.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r}(e,["text","onCopy","options","children"]),o=i.default.Children.only(t);return i.default.cloneElement(o,n({},r,{onClick:this.onClick}))}}]),t}(i.default.PureComponent)},74855:(e,t,r)=>{"use strict";var n=r(74300).CopyToClipboard;e.exports=n},11742:e=>{e.exports=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,r=[],n=0;n<e.rangeCount;n++)r.push(e.getRangeAt(n));switch(t.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":t.blur();break;default:t=null}return e.removeAllRanges(),function(){"Caret"===e.type&&e.removeAllRanges(),e.rangeCount||r.forEach((function(t){e.addRange(t)})),t&&t.focus()}}}}]);