(this.webpackJsonpstreamlit_component_template=this.webpackJsonpstreamlit_component_template||[]).push([[0],{17:function(e,t,o){e.exports={poButton:"style_poButton__3x8Ka"}},18:function(e,t,o){e.exports=o(26)},26:function(e,t,o){"use strict";o.r(t);var n,s=o(8),r=o.n(s),i=o(15),a=o.n(i),l=o(6),p=o(0),c=o(1),u=o(2),d=o(3),f=o(13),m=o(17),g=o.n(m);!function(e){e[e.sketchup=0]="sketchup",e[e.rhino=1]="rhino",e[e.revit=2]="revit"}(n||(n={}));var y=function(e){Object(u.a)(o,e);var t=Object(d.a)(o);function o(e){var s;Object(p.a)(this,o),(s=t.call(this,e)).render=function(){return r.a.createElement("span",null,r.a.createElement("button",{className:g.a.poButton,onClick:s._onClicked,disabled:s.props.disabled,onFocus:s._onFocus,onBlur:s._onBlur},r.a.createElement("span",null,r.a.createElement("img",{style:{margin:"0px 3px 2px 0px"},src:"./img/pollination.png",alt:"logo"})),"Get ",s.state.isPollinationModel?"Pollination Model":"Geometry",Boolean(s.props.args.syncToken)&&" (Sync)"))},s._setStateNow=function(e){s.setState((function(t){return Object(l.a)(Object(l.a)({},t),{},{geometry:e.geometry,identifier:e.identifier,isPollinationModel:e.isPollinationModel,syncToken:e.syncToken,platform:e.platform})}),(function(){return f.a.setComponentValue(s.state.geometry)})),console.log("[POLLINATION-DEBUG]: JSON string sent.")},s._rubyRun=function(){if("undefined"!=typeof window.parent.sketchup){var e=null;return s.props.args.isPollinationModel?(window.parent.sketchup.get_model(),null==(e=window.parent.sketchup.hb_model)?s.state:(console.log(e),{geometry:e.Geometry,identifier:e.Identifier,isPollinationModel:s.props.args.isPollinationModel,syncToken:s.props.args.syncToken,platform:s.props.args.platform})):(console.log("[POLLINATION-DEBUG]: sketchup geometry only not supported."),s.state)}return console.log("[POLLINATION-DEBUG]: sketchup not found."),s.state},s._dotNetRun=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if("undefined"!=typeof window.parent.chrome){if("undefined"==typeof window.parent.chrome.webview)return console.log("[POLLINATION-DEBUG]: webview not found."),s.state;var t=null;if(null==(t=s.props.args.isPollinationModel?window.parent.chrome.webview.hostObjects.sync.hbjson.PassPollinationModel(e):window.parent.chrome.webview.hostObjects.sync.geometry.PassJsonGeometry(s.props.args.key,e)))return s.state;var o={geometry:t.Geometry,identifier:t.Identifier,isPollinationModel:s.props.args.isPollinationModel,syncToken:s.props.args.syncToken,platform:s.props.args.platform};return o}return console.log("[POLLINATION-DEBUG]: chrome not found."),s.state},s._onClicked=function(){var e=s.props.args.platform,t={platform:e};e==n[n.rhino]?t=s._dotNetRun(!0):e==n[n.sketchup]&&(t=s._rubyRun()),s._setStateNow(t)},s._onFocus=function(){s.setState({isFocused:!0})},s._onBlur=function(){s.setState({isFocused:!1})};var i={geometry:"",identifier:"",isPollinationModel:s.props.args.isPollinationModel,platform:s.props.args.platform};return s.state=Object(l.a)({},i),s}return Object(c.a)(o,[{key:"componentDidUpdate",value:function(){if(""!==this.state.identifier&&this.props.args.syncToken!==this.state.syncToken){var e=JSON.parse(this.state.identifier);if(e){var t=this.props.args.syncToken.split(":",1)[0];if(e.includes(t)&&this.state.syncToken!==this.props.args.syncToken){var o={};this.state.platform==n[n.rhino]&&(o=this._dotNetRun()),this._setStateNow(o),console.log("[POLLINATION-DEBUG]: auto-update.")}}}}}]),o}(f.b),h=Object(f.c)(y);a.a.render(r.a.createElement(r.a.StrictMode,null,r.a.createElement(h,null)),document.getElementById("root"))}},[[18,1,2]]]);
//# sourceMappingURL=main.bf749f0e.chunk.js.map