(window.webpackJsonp=window.webpackJsonp||[]).push([[17],{1262:function(e,t,n){"use strict";n.r(t);var r=n(0),o=n.n(r),i=n(1260),a=n(356),c=n.n(a);function s(e){return(s="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 u(e,t,n,r,o,i,a){try{var c=e[i](a),s=c.value}catch(e){return void n(e)}c.done?t(s):Promise.resolve(s).then(r,o)}function l(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function f(e){return(f=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function p(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function y(e,t){return(y=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function h(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var d=function(e){function t(e){var n,r,i;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),r=this,i=f(t).call(this,e),n=!i||"object"!==s(i)&&"function"!=typeof i?p(r):i,h(p(n),"state",{error:null}),h(p(n),"viewer",null),h(p(n),"onWindowResize",(function(){n.debouncedResize()})),n.container=o.a.createRef(),n.debouncedResize=c()((function(){n.viewer&&n.viewer.resize()}),100),n}var r,a,d;return 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&&y(e,t)}(t,e),r=t,(a=[{key:"installOpenLayersRenderer",value:function(e,t){var r=this,o=t.dicomWebClient,i={studyInstanceUID:t.StudyInstanceUID,seriesInstanceUID:t.SeriesInstanceUID};o.searchForInstances(i).then((function(e){for(var n=[],r=0;r<e.length;r++){var i=e[r]["00080018"].Value[0],a={studyInstanceUID:t.StudyInstanceUID,seriesInstanceUID:t.SeriesInstanceUID,sopInstanceUID:i},c=o.retrieveInstanceMetadata(a).then((function(e){if("VOLUME"===e[0]["00080008"].Value[2])return e[0]}));n.push(c)}return Promise.all(n)})).then(function(){var t,i=(t=regeneratorRuntime.mark((function t(i){var a,c,s,u,l,f,p;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=i.filter((function(e){return e})),t.next=3,n.e(11).then(n.t.bind(null,1258,7));case 3:a=t.sent,c=a.api,s=c.VLWholeSlideMicroscopyImageViewer;try{r.viewer=new s({client:o,metadata:i,retrieveRendered:!1})}catch(e){console.error("[Microscopy Viewer] Failed to load:",e),u=r.props.servicesManager.services,l=u.UINotificationService,f=u.LoggerService,l&&(p="Failed to load viewport. Please check that you have hardware acceleration enabled.",f.error({error:e,message:p}),l.show({autoClose:!1,title:"Microscopy Viewport",message:p,type:"error"}))}r.viewer.render({container:e});case 8:case"end":return t.stop()}}),t)})),function(){var e=this,n=arguments;return new Promise((function(r,o){var i=t.apply(e,n);function a(e){u(i,r,o,a,c,"next",e)}function c(e){u(i,r,o,a,c,"throw",e)}a(void 0)}))});return function(e){return i.apply(this,arguments)}}())}},{key:"componentDidMount",value:function(){var e=this.props.viewportData.displaySet;this.installOpenLayersRenderer(this.container.current,e)}},{key:"render",value:function(){var e={width:"100%",height:"100%"};return o.a.createElement("div",{className:"DicomMicroscopyViewer",style:e},i.a&&o.a.createElement(i.a,{handleWidth:!0,handleHeight:!0,onResize:this.onWindowResize}),this.state.error?o.a.createElement("h2",null,JSON.stringify(this.state.error)):o.a.createElement("div",{style:e,ref:this.container}))}}])&&l(r.prototype,a),d&&l(r,d),t}(r.Component);t.default=d}}]);