/**
 * Minified by jsDelivr using Terser v5.39.0.
 * Original file: /npm/@nteract/transform-plotly@7.0.1/lib/index.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
"use strict";var __importDefault=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(exports,"__esModule",{value:!0});const lodash_clonedeep_1=__importDefault(require("lodash.clonedeep")),react_1=__importDefault(require("react")),NULL_MIMETYPE="text/vnd.plotly.v1+html",MIMETYPE="application/vnd.plotly.v1+json",PlotlyNullTransform=()=>null;exports.PlotlyNullTransform=PlotlyNullTransform,PlotlyNullTransform.MIMETYPE=NULL_MIMETYPE,PlotlyNullTransform.defaultProps={mediaType:NULL_MIMETYPE};class PlotlyTransform extends react_1.default.Component{constructor(){super(...arguments),this.plotDivRef=t=>{this.plotDiv=t},this.getFigure=()=>{const t=this.props.data;if("string"==typeof t)return JSON.parse(t);if(Object.isFrozen(t))return lodash_clonedeep_1.default(t);const{data:e={},layout:o={}}=t;return{data:e,layout:o}}}componentDidMount(){const t=this.getFigure();this.Plotly=require("plotly.js-dist"),this.Plotly.newPlot(this.plotDiv,t.data,t.layout)}shouldComponentUpdate(t){return this.props.data!==t.data}componentDidUpdate(){const t=this.getFigure();this.plotDiv&&(this.plotDiv.data=t.data,this.plotDiv.layout=t.layout,this.Plotly.redraw(this.plotDiv))}render(){const{layout:t}=this.getFigure(),e={};return t&&t.height&&!t.autosize&&(e.height=t.height),react_1.default.createElement("div",{ref:this.plotDivRef,style:e})}}exports.PlotlyTransform=PlotlyTransform,PlotlyTransform.MIMETYPE=MIMETYPE,PlotlyTransform.defaultProps={mediaType:MIMETYPE},exports.default=PlotlyTransform;
//# sourceMappingURL=/sm/691022b0bc73443033c06a0321d7c06fd5deb30d34660ba4ab60ca04affa1ade.map