/*! For license information please see dll.RPlot.js.LICENSE.txt */
(window.webpackJsonp_name_dll=window.webpackJsonp_name_dll||[]).push([[89],{1111:function(t,e,n){"use strict";n.r(e);var a=n(59),r=n.n(a),o=n(13),i=n.n(o),l=n(12),s=n.n(l),c=n(6),p=n.n(c),u=n(14),f=n.n(u),g=n(15),d=n.n(g),h=n(8),m=n.n(h),b=n(5),y=n.n(b),v=n(0),w=n.n(v),x=n(1),D=n.n(x),k=n(1030),P=n.n(k),R=n(1979),T=n.n(R),E=n(87),j=n.n(E),_=n(1354),S=n(533),C=n(232),O=n(20);n(3659);function U(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,a=m()(t);if(e){var r=m()(this).constructor;n=Reflect.construct(a,arguments,r)}else n=a.apply(this,arguments);return d()(this,n)}}var L=function(t){f()(n,t);var e=U(n);function n(t){var a;return i()(this,n),a=e.call(this,t),y()(p()(a),"savePlot",(function(t,e,n){t?a.props.onDone(t):a.setState({plotURL:e,plot:n,waiting:!1},(function(){a.props.onDone(null,e,n)}))})),a.state={plotURL:null,plot:null,last:"",waiting:!1},a}return s()(n,[{key:"componentDidMount",value:function(){this.getPlot()}},{key:"componentDidUpdate",value:function(){this.getPlot()}},{key:"getPlot",value:function(){if(this.props.code!==this.state.last){this.setState({waiting:!0,last:this.props.code});var t=this.context,e=Object(_.default)(this.props.libraries,this.props.prependCode,t)+this.props.code;t.getRPlot(e,this.props.fileType,this.savePlot)}}},{key:"render",value:function(){var t=this,e=null;return this.props.draggable&&(e=w.a.createElement("div",{className:"rplot-draggable-bar",draggable:!0,onDragStart:function(e){var n;if(t.props.meta){var a=t.props.meta;a=T()(a,(function(t,e){return j()(e)})),a=P.a.safeDump(a),n='<img src="'.concat(t.state.plot,'" style="display: block; margin: 0 auto;" data-plot-id="').concat(t.props.id,'" data-plot-meta="').concat(a,'"></img>')}else n='<img src="'.concat(t.state.plot,'" alt="R Plot" style="display: block; margin: 0 auto;" />');e.dataTransfer.setData("text/html",n)}},"Drag Plot")),w.a.createElement("div",{className:"rplot",style:{minHeight:128,cursor:"pointer"}},w.a.createElement(S.default,{running:this.state.waiting,width:256,height:128}),this.state.waiting?w.a.createElement("span",null):w.a.createElement(v.Fragment,null,e,w.a.createElement(C.default,r()({src:this.state.plotURL,body:this.state.plot,title:"R Plot"},this.props))))}}]),n}(v.Component);L.propTypes={code:D.a.string,width:D.a.oneOfType([D.a.number,D.a.string]),height:D.a.oneOfType([D.a.number,D.a.string]),draggable:D.a.bool,fileType:D.a.string,libraries:D.a.array,prependCode:D.a.oneOfType([D.a.string,D.a.array]),meta:D.a.object,onDone:D.a.func},L.defaultProps={code:"",width:600,height:350,draggable:!1,fileType:"png",libraries:[],prependCode:"",meta:null,onDone:function(){}},L.contextType=O.default,e.default=L},1354:function(t,e,n){"use strict";n.r(e);var a=n(19),r=n.n(a);e.default=function(t,e,n){var a=n.config.rshell;a&&a.libraries&&(t=t.concat(a.libraries));var o=function(t){return t.map((function(t){return"library("+t+");"})).join(" ")}(t);return a&&a.global&&(o+=a.global+"\n"),e=r()(e)?e.join("\n"):e,o+=e+="\n"}},1979:function(t,e,n){"use strict";var a=n(1980);t.exports=a},1980:function(t,e,n){"use strict";var a=n(85),r=n(122);t.exports=function(t,e){var n,o,i,l;if("object"!=typeof t||null===t)throw new TypeError("invalid argument. First argument must be an object. Value: `"+t+"`.");if(!r(e))throw new TypeError("invalid argument. Second argument must be a function. Value: `"+e+"`.");for(o={},n=a(t),l=0;l<n.length;l++)e(i=n[l],t[i])||(o[i]=t[i]);return o}},3659:function(t,e,n){var a=n(30),r=n(3660);"string"==typeof(r=r.__esModule?r.default:r)&&(r=[[t.i,r,""]]);var o={insert:"head",singleton:!1};a(r,o);t.exports=r.locals||{}},3660:function(t,e,n){(e=n(31)(!1)).push([t.i,".rplot-draggable-bar {\n\tposition: absolute;\n\ttop: 6px;\n\tleft: 6px;\n\tz-index: 2;\n\twidth: 130px;\n\theight: 26px;\n\tbackground-color: rgba(200, 200, 200, 0.5);\n\topacity: 0.6;\n\tcolor: black;\n\tletter-spacing: 4px;\n\ttext-align: center;\n\tcursor: move;\n\tpadding: 0.1rem 0.3rem;\n}\n\n.rplot-draggable-bar:hover {\n\tbackground-color: rgba(22, 8, 8, 0.8);\n\tcolor: white;\n\topacity: 0.9;\n}\n",""]),t.exports=e}}]);