text: (window.webpackJsonp=window.webpackJsonp||[]).push([[4],{1362:function(e,n,a){"use strict";a.r(n);var t,s=a(47),l=a(48),i=a(242),o=a(1380),r=a(5),d=a(683),c=a.n(d),u=a(0),E=a.n(u),p=a(11),y=a(19);const _=void 0!==t?t:t=a(761);function h(e,n,a){const t=e.get(n.id),s=y.ConnectionHandler.getConnection(t,"EnsayoList_Ensayos");s&&y.ConnectionHandler.insertEdgeAfter(s,a)}let m=0;var g,C={commit:function(e,n,a,t,s){const l=m++;return Object(p.commitMutation)(e,{mutation:_,variables:{input:{Ensayo_Title:a,Ensayo_Description:t,Ensayo_Content:s,clientMutationId:`${l}`}},updater(e){const a=e.getRootField("EnsayoAdd");h(e,n,a.getLinkedRecord("EnsayosEdge"))},optimisticUpdater(e){const i=`client:EnsayoAdd:Ensayo:${l}`,o=e.create(i,"Ensayo");o.setValue(a,"Ensayo_Title"),o.setValue(t,"Ensayo_Description"),o.setValue(s,"Ensayo_Content"),o.setValue(i,"id");const r=e.create(`client:EnsayoAdd:EnsayosEdge:${l}`,"EnsayosEdge");r.setLinkedRecord(o,"node"),h(e,n,r)}})}},k=a(35),f=a(293);class b extends E.a.Component{constructor(e,n){super(e,n),this._handle_updateHandler_Ensayo=e=>{const{Ensayo_Title:n,Ensayo_Description:a,Ensayo_Content:t}=e,{relay:s,Viewer:l}=this.props;C.commit(s.environment,l,n,a,t)},this._handle_Close_Properties=()=>{this.setState({propertiesIsOpen:!1})},this._handle_onClick_Add=()=>{this.setState({propertiesIsOpen:!0})},this.state={propertiesIsOpen:!1}}render(){const{classes:e}=this.props,{propertiesIsOpen:n}=this.state;return E.a.createElement(k.a,null,E.a.createElement(s.a,{className:e.card},E.a.createElement(i.a,{title:"Ensayo",subheader:"List of essays"}),E.a.createElement(l.a,null,E.a.createElement("div",{className:e.addNewButton},E.a.createElement(o.a,{color:"primary",className:e.button,onClick:this._handle_onClick_Add},E.a.createElement(c.a,null))),this.props.children),n&&E.a.createElement(f.a,{Ensayo_Title:"",Ensayo_Content:"",Ensayo_Description:"",handlerUpdate:this._handle_updateHandler_Ensayo,handlerClose:this._handle_Close_Properties})))}}n.default=Object(p.createFragmentContainer)(Object(r.a)(e=>({card:{minWidth:275},addNewButton:{float:"right",marginTop:-58,marginRight:20}}))(b),{Viewer:void 0!==g?g:g=a(762)})},293:function(e,n,a){"use strict";var t=a(71),s=a(1335),l=a(1346),i=a(1337),o=a(1336),r=a(400),d=a(0),c=a.n(d),u=a(367),E=a.n(u),p=a(5);class y extends c.a.Component{constructor(e,n){super(e,n),this._handle_OnChange_RTE_Ensayo_Content=e=>{this.setState({Ensayo_Content_RTE:e})},this._handle_Close=()=>{this.props.handlerClose()},this._handle_OK=()=>{const{handlerClose:e,handlerUpdate:n}=this.props;n({Ensayo_Title:this.state.Ensayo_Title,Ensayo_Description:this.state.Ensayo_Description,Ensayo_Content:this.state.Ensayo_Content_RTE.toString("html")}),e()};const{Ensayo_Title:a,Ensayo_Description:t,Ensayo_Content:s}=this.props;this.state={Ensayo_Title:a,Ensayo_Description:t,Ensayo_Content_RTE:E.a.createValueFromString(s,"html")}}render(){const{classes:e}=this.props,{Ensayo_Title:n,Ensayo_Description:a}=this.state;return c.a.createElement("div",null,c.a.createElement(s.a,{open:!0,onClose:this._handle_Close},c.a.createElement(o.a,null,"Ensayo"),c.a.createElement(i.a,null,c.a.createElement(r.a,{label:"Title",fullWidth:!0,value:n,onChange:e=>this.setState({Ensayo_Title:e.target.value})}),c.a.createElement(r.a,{label:"Description",fullWidth:!0,value:a,onChange:e=>this.setState({Ensayo_Description:e.target.value})}),c.a.createElement("div",{className:e.richTextContainer},null==E.a?c.a.createElement("div",null):c.a.createElement(E.a,{value:this.state.Ensayo_Content_RTE,onChange:this._handle_OnChange_RTE_Ensayo_Content}))),c.a.createElement(l.a,null,c.a.createElement(t.a,{onClick:this._handle_Close},"Cancel"),c.a.createElement(t.a,{onClick:this._handle_OK,color:"primary"},"OK"))))}}n.a=Object(p.a)(e=>({container:{display:"flex",flexWrap:"wrap"},richTextContainer:{width:"100%",height:300,display:"inline-block",position:"relative"}}))(y)},761:function(e,n,a){"use strict";const t={fragment:{argumentDefinitions:s=[{defaultValue:null,kind:"LocalArgument",name:"input"}],kind:"Fragment",metadata:null,name:"EnsayoAddMutation",selections:i=[{alias:null,args:[{kind:"Variable",name:"input",variableName:"input"}],concreteType:"EnsayoAddPayload",kind:"LinkedField",name:"EnsayoAdd",plural:!1,selections:[{alias:null,args:null,concreteType:"Viewer",kind:"LinkedField",name:"Viewer",plural:!1,selections:[l={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"EnsayosEdge",kind:"LinkedField",name:"EnsayosEdge",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"cursor",storageKey:null},{alias:null,args:null,concreteType:"Ensayo",kind:"LinkedField",name:"node",plural:!1,selections:[l,{alias:null,args:null,kind:"ScalarField",name:"Ensayo_Title",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"Ensayo_Description",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"Ensayo_Content",storageKey:null}],storageKey:null}],storageKey:null}],storageKey:null}],type:"Mutation",abstractKey:null},kind:"Request",operation:{argumentDefinitions:s,kind:"Operation",name:"EnsayoAddMutation",selections:i},params:{cacheID:"c338ca1b2bf2f6b2bc5fb4a83bdcea0d",id:null,metadata:{},name:"EnsayoAddMutation",operationKind:"mutation",text:"mutation EnsayoAddMutation(\n  $input: EnsayoAddInput!\n) {\n  EnsayoAdd(input: $input) {\n    Viewer {\n      id\n    }\n    EnsayosEdge {\n      cursor\n      node {\n        id\n        Ensayo_Title\n        Ensayo_Description\n        Ensayo_Content\n      }\n    }\n  }\n}\n"}};var s,l,i;t.hash="ea5acd7697360f56ea79ddb77f8ad1bc",e.exports=t},762:function(e,n,a){"use strict";const t={argumentDefinitions:[],kind:"Fragment",metadata:null,name:"EnsayoInPaceEditScreen_Viewer",selections:[{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null}],type:"Viewer",abstractKey:null,hash:"f1f409a6abe1cb35bffc9124153858ca"};e.exports=t}}]);