(this["webpackJsonpmtdc-verbal"]=this["webpackJsonpmtdc-verbal"]||[]).push([[0],{106:function(e,t){},136:function(e,t,a){"use strict";a.p},137:function(e,t,a){"use strict"},168:function(e,t,a){},169:function(e,t,a){},172:function(e,t,a){"use strict";(function(e){a.d(t,"a",(function(){return H}));var n=a(59),r=a(11),s=a(9),i=a.n(s),c=a(15),o=a(24),l=a(25),d=a(27),u=a(26),p=a(4),f=a(0),h=a(2),j=a(23),b=a(22),m=a(64),O=a(666),g=a(667),x=a(668),v=a(36),y=a(669),_=a(34),S=a(47),C=a(97),w=a(673),k=a(670),T=a(671),E=a(672),N=(a(75),a(173)),A=a.n(N),F=a(180),I=a(179),P=a(41),R=a(83),D=a(174),M=a(62),z=a(42),L=(a(89),a(319),a(87)),B=a.n(L),U=(a(647),new B.a.S3({accessKeyId:"AKIATE43PKUZC3HME4X6",secretAccessKey:"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"})),W={singleValue:function(e,t){return Object(p.a)(Object(p.a)({},e),{},{color:"red"})},option:function(e,t){return Object(p.a)(Object(p.a)({},e),{},{color:"red"})},input:function(e){return Object(p.a)(Object(p.a)({},e),{},{color:"white"})},valueContainer:function(e,t){return Object(p.a)(Object(p.a)({},e),{},{color:"red"})},container:function(e,t){return Object(p.a)(Object(p.a)({},e),{},{color:"red"})}},H=function(t){Object(d.a)(s,t);var a=Object(u.a)(s);function s(){var t;Object(o.a)(this,s);for(var l=arguments.length,d=new Array(l),u=0;u0?t.state.videos.map((function(t,a){e.document_fields.push({video_url:t||"",sequence:a+1})})):console.log(),t.state.caution_text?e.document_fields.push({caution:t.state.caution_text,sequence:1}):console.log(),t.state.illustrationsTop.length>0?t.state.illustrationsTop.map((function(t,a){e.document_fields.push({image_top_url:t||"",sequence:a+1})})):console.log(),t.state.description_top?e.document_fields.push({description_top:t.state.description_top,sequence:1}):console.log(),t.state.illustrationsMiddle.length>0?t.state.illustrationsMiddle.map((function(t,a){e.document_fields.push({image_middle_url:t||"",sequence:a+1})})):console.log(),t.state.description_middle?e.document_fields.push({description_middle:t.state.description_middle,sequence:1}):console.log(),t.state.illustrationsBottom.length>0?t.state.illustrationsBottom.map((function(t,a){e.document_fields.push({image_bottom_url:t||"",sequence:a+1})})):console.log(),t.state.description_bottom?e.document_fields.push({description_bottom:t.state.description_bottom,sequence:1}):console.log(),t.state.warning_text?e.document_fields.push({warning:t.state.warning_text,sequence:1}):console.log();var n=1;t.state.linked_to_pdf.length>0||t.state.linked_to_pdf[0].length>0?t.state.linked_to_pdf.map((function(t,a){t&&e.document_fields.push({file_url:t||"",sequence:n++})})):console.log(),t.state.linked_parts?e.document_fields.push({sequence:1,related_feature_ids:t.state.linked_parts.map((function(e){return e.value}))}):console.log(),t.props.putData(JSON.stringify(e),a)}else{var r={};r.critical=t.state.isCriticalFeature?1:0,r.verbal=t.state.meant_for.includes("verbal")?1:0,r.vision=t.state.meant_for.includes("vision")?1:0,r.template_reference="msr_v1",r.document_fields=[],t.state.display_name?r.document_fields.push({title:t.state.display_name,sequence:1}):console.log(),t.state.images[0]?r.document_fields.push({icon_url:t.state.images[0],sequence:1}):r.document_fields.push({icon_url:"https://s3.ap-south-1.amazonaws.com/msil-s3-tdc-vision-production/feature_icons/default.png",sequence:1}),t.state.short_text?r.document_fields.push({blurb:t.state.short_text,sequence:1}):console.log(),t.state.videos.length>0?t.state.videos.map((function(e,t){r.document_fields.push({video_url:e||"",sequence:t+1})})):console.log(),t.state.caution_text?r.document_fields.push({caution:t.state.caution_text,sequence:1}):console.log(),t.state.illustrationsTop.length>0?t.state.illustrationsTop.map((function(e,t){r.document_fields.push({image_top_url:e||"",sequence:t+1})})):console.log(),t.state.description_top?r.document_fields.push({description_top:t.state.description_top,sequence:1}):console.log(),t.state.illustrationsMiddle.length>0?t.state.illustrationsMiddle.map((function(e,t){r.document_fields.push({image_middle_url:e||"",sequence:t+1})})):console.log(),t.state.description_middle?r.document_fields.push({description_middle:t.state.description_middle,sequence:1}):console.log(),t.state.illustrationsBottom.length>0?t.state.illustrationsBottom.map((function(e,t){r.document_fields.push({image_bottom_url:e||"",sequence:t+1})})):console.log(),t.state.description_bottom?r.document_fields.push({description_bottom:t.state.description_bottom,sequence:1}):console.log(),t.state.warning_text?r.document_fields.push({warning:t.state.warning_text,sequence:1}):console.log();var s=1;t.state.linked_to_pdf.length>0||t.state.linked_to_pdf[0].length>0?t.state.linked_to_pdf.map((function(e,t){e&&r.document_fields.push({file_url:e||"",sequence:s++})})):console.log(),t.state.linked_parts?r.document_fields.push({sequence:1,related_feature_ids:t.state.linked_parts.map((function(e){return e.value}))}):console.log(),t.state.chapter_number?r.document_fields.push({sequence:1,chapter:t.state.chapter_number}):console.log(),t.props.postData(JSON.stringify(r),t.state.feature_ids)}},t.clearState=function(){t.setState({model:null,make:null,variant:null,feature:null,short_text:"",short_text_state:"",description_top:"",description_state:"",description_middle:"",description_bottom:"",images:[],illustrationsTop:[],illustrationsMiddle:[],illustrationsBottom:[],videos:[],files:null,warning_text:"",warning_text_state:"",caution_text:"",caution_text_state:"",chapter_number:"",isCriticalFeature:!1,modelData:[],variantsData:[],featuresData:[],linked_parts_data:[],makes_data:[],linked_parts:null,display_name:"",linked_to_pdf:[""],meant_for:[],edit:!1,feature_ids:[]}),t.props.history.goBack()},t.onLinkedPartChange=function(e){if(e.target.checked){var a=t.state.meant_for;a.push(e.target.value),t.setState({meant_for:a})}else if(t.state.meant_for.includes(e.target.value)){var n=t.state.meant_for.filter((function(t){return t!==e.target.value}));t.setState({meant_for:n})}},t.hideModal=function(){t.state.view?(t.props.hideModal(),t.props.history.goBack()):(t.clearState(),t.props.hideModal())},t.onInputChange=function(e){t.setState(Object(r.a)({},e.target.name,e.target.value))},t.onInputChangel=function(e,a){var s=t.state.linked_to_pdf;s[a]=e.target.value,t.setState(Object(r.a)({},e.target.name,Object(n.a)(s)))},t.handleAddClick=function(){var e=t.state.linked_to_pdf;t.setState({linked_to_pdf:[].concat(Object(n.a)(e),[""])})},t.handleRemoveClick=function(e){var a=t.state.linked_to_pdf;a.splice(e,1),t.setState({linked_to_pdf:Object(n.a)(a)})},t.handleSwitch=function(e,a){t.setState({isCriticalFeature:a})},t.onChange=function(e,a){var n=t.props.meta.features;if("make"===a){var s,i=e.value,c=Array.from(new Set(n.filter((function(e){return e.make_id===i})).map((function(e){return e.model})))),o=[];c.map((function(e){var t=n.find((function(t){return t.make_id===i&&t.model===e})).model_id;o.push({value:t,label:e})})),t.setState((s={},Object(r.a)(s,a,e),Object(r.a)(s,"modelData",o),s))}if("model"===a){var l,d=t.state.make.value,u=e.value,p=Array.from(new Set(n.filter((function(e){return e.make_id===d&&e.model_id===u})).map((function(e){return e.part})))),f=[];p.map((function(e){var t=n.find((function(t){return t.make_id===d&&t.model_id===u&&t.part===e})).part_id;f.push({value:t,label:e})})),t.setState((l={},Object(r.a)(l,a,e),Object(r.a)(l,"featuresData",f),Object(r.a)(l,"linked_to_pdf",[""]),Object(r.a)(l,"variantsData",[]),Object(r.a)(l,"variant",null),Object(r.a)(l,"feature",null),l))}if("feature"==a){var h,j=t.state.make.value,b=t.state.model.value,m=e.value,O=Array.from(new Set(n.filter((function(e){return e.make_id===j&&e.model_id===b&&e.part_id===m})).map((function(e){return e.variant})))),g=[];O.map((function(e){var t=n.find((function(t){return t.make_id===j&&t.model_id===b&&t.part_id===m&&t.variant===e})).variant_id;g.push({value:t,label:e})})),t.setState((h={},Object(r.a)(h,a,e),Object(r.a)(h,"variantsData",g),Object(r.a)(h,"variant",null),h))}if("variant"==a){var x,v=t.state.make.value,y=t.state.model.value,_=t.state.feature.value,S=e||[],C=[];S.map((function(e,t){var a=n.find((function(t){return t.make_id===v&&t.model_id===y&&t.part_id===_&&t.variant_id===e.value})).id;C.push(a)}));var w=S.map((function(e){return e.value})),k=n.filter((function(e){return e.make_id===v&&e.model_id===y&&w.indexOf(e.variant_id)>=0&&e.part_id!==_})),T=Array.from(new Set(k.map((function(e){return e.part})))),E=[];T.map((function(e){var t=k.find((function(t){return t.part===e}));E.push({value:t.id,label:e})})),t.setState((x={},Object(r.a)(x,a,e),Object(r.a)(x,"feature_ids",C),Object(r.a)(x,"linked_parts_data",E),Object(r.a)(x,"linked_parts",null),x))}"linked_parts"==a&&t.setState(Object(r.a)({},a,e))},t.approve=function(){var e=t.props.match.params.id,a=t.props.history.location.pathname;t.props.approve(e,"view",a)},t.preview=function(){t.setState({isOpen:!0})},t.closePreview=function(){t.setState({isOpen:!1})},t}return Object(l.a)(s,[{key:"componentDidMount",value:function(){var e=Object(c.a)(i.a.mark((function e(){var t=this;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,localStorage.getItem("x-auth");case 2:e.sent||this.props.auth.userToken?this.setState({edit:"/edit/:id"==this.props.match.path,view:"/view/:id"==this.props.match.path,makes_data:this.props.meta.makes,id:this.props.match.params.id},(function(){if(t.state.edit||t.state.view){var e=t.props.location.state.obj;t.props.getDocumentById(t.props.match.params.id),t.setState({make:{label:e.make},model:{label:e.model},feature:{label:e.feature},variant:{label:e.variant}})}})):this.props.history.push("/login");case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"componentDidUpdate",value:function(e){if(this.props.auth!==e.auth&&(this.props.auth.userToken||this.props.history.push("/login")),e.cms.document!==this.props.cms.document){var t=this.props.cms.document,a=this.props.meta.features;if(this.state.edit||this.state.view){var n=this.props.location.state.obj,r=n.feature_id,s=t.related_features.map((function(e){return e.id})),i=a.find((function(e){return e.id===r})),c=[],o=[];a.filter((function(e){return e.make_id===i.make_id&&e.model_id===i.model_id})).map((function(e){s.indexOf(e.id)<0?c.push({value:e.id,label:e.part}):o.push({value:e.id,label:e.part,icon_url:t.related_features.filter((function(t){return e.id===t.id}))[0].icon_url})}));var l=[];"Yes"==n.visual&&l.push("vision"),"Yes"==n.verbal&&l.push("verbal"),this.setState({make:{label:n.make},model:{label:n.model},feature:{label:n.feature},variant:{label:n.variant},images:t.images,linked_to_pdf:t.linked_to_pdf,display_name:t.display_name,short_text:t.short_text,illustrationsTop:t.illustration_top,illustrationsMiddle:t.illustration_middle,illustrationsBottom:t.illustration_bottom,isCriticalFeature:"Yes"==n.critical_feature,meant_for:l,caution_text:t.caution_text,warning_text:t.warning_text,description_top:t.description_top,description_middle:t.description_middle,description_bottom:t.description_bottom,linked_parts_data:c,linked_parts:o,videos:t.videos,chapter_number:t.chapter})}}else e.meta.makes!==this.props.meta.makes&&this.setState({makes_data:this.props.meta.makes})}},{key:"render",value:function(){var e=this,t=this.state,a=t.edit,n=t.view;a&&this.props.location.state.obj;return Object(f.jsx)(f.Fragment,{children:Object(f.jsxs)("div",{className:"content",style:{backgroundColor:"#19191A"},children:[Object(f.jsxs)(j.a,{className:"mt-5",children:[Object(f.jsx)(b.a,{lg:"12",children:this.props.cms.fetchingDocument&&this.state.edit||this.props.meta.loadingMeta?Object(f.jsx)("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",flex:1},children:Object(f.jsx)(m.a,{size:"large"})}):Object(f.jsxs)(O.a,{className:"ml-auto mr-auto",style:{width:"80%",backgroundColor:"#232324"},children:[Object(f.jsxs)(g.a,{style:{display:"flex",justifyContent:"space-between"},children:[Object(f.jsx)(x.a,{tag:"h4",style:{color:"rgb(0,228,228)",fontWeight:"bold",textTransform:"capitalize"},children:this.state.edit?"Edit Feature Content":this.state.view?"Feature Content":"Upload Feature Content"}),Object(f.jsxs)("div",{style:{display:"flex"},children:[n&&"admin"==this.props.auth.role&&"No"==this.props.location.state.obj.approved&&Object(f.jsxs)(v.a,{color:"info",onClick:this.approve,className:"btn-simple",style:{color:"#33FF00",borderColor:"#33FF00",display:"flex",alignItems:"center",justifyContent:"center",width:155,height:35},children:[Object(f.jsx)("i",{className:"fa fa-check-circle-o","aria-hidden":"true"}),Object(f.jsx)("span",{style:{marginLeft:5},children:"Approve"})]}),Object(f.jsxs)(v.a,{color:"info",onClick:this.preview,className:"btn-simple",style:{color:"#FF6600",borderColor:"#FF6600",display:"flex",alignItems:"center",justifyContent:"center",width:155,height:35},children:[Object(f.jsx)("i",{className:"fa fa-eye","aria-hidden":"true"})," ",Object(f.jsx)("span",{style:{marginLeft:5},children:"Preview"})]})]})]}),Object(f.jsxs)(y.a,{action:"#",children:[Object(f.jsxs)(j.a,{style:{justifyContent:"center",padding:10},children:[Object(f.jsxs)(b.a,{md:"5",children:[Object(f.jsx)("label",{children:"Make"}),Object(f.jsx)(_.a,{children:Object(f.jsx)(P.a,{className:"react-select info",classNamePrefix:"react-select",name:"singleSelect",value:this.state.make,onChange:function(t){return e.onChange(t,"make")},options:this.state.makes_data,placeholder:"Select Make",isDisabled:a||n,styles:W})})]}),Object(f.jsxs)(b.a,{md:"5",children:[Object(f.jsx)("label",{children:"Model"}),Object(f.jsx)(_.a,{children:Object(f.jsx)(P.a,{className:"react-select info",classNamePrefix:"react-select",name:"singleSelect",value:this.state.model,onChange:function(t){return e.onChange(t,"model")},options:this.state.modelData,placeholder:"Select Model",isDisabled:a||n,styles:W})})]})]}),Object(f.jsxs)(j.a,{style:{justifyContent:"center",padding:5},children:[Object(f.jsxs)(b.a,{md:"5",children:[Object(f.jsx)("label",{children:"Feature"}),Object(f.jsx)(_.a,{children:Object(f.jsx)(P.a,{className:"react-select info",classNamePrefix:"react-select",name:"singleSelect",value:this.state.feature,onChange:function(t){return e.onChange(t,"feature")},options:this.state.featuresData,placeholder:"Select Feature",isDisabled:a||n,styles:W})})]}),Object(f.jsxs)(b.a,{md:"5",children:[Object(f.jsx)("label",{children:"Variant"}),Object(f.jsx)(_.a,{children:Object(f.jsx)(P.a,{className:"react-select info",classNamePrefix:"react-select",name:"singleSelect",value:this.state.variant,onChange:function(t){return e.onChange(t,"variant")},options:this.state.variantsData,placeholder:"Select Variant",isMulti:!0,isDisabled:null==this.state.make||null==this.state.model||null==this.state.feature||a||n,styles:W},this.state.variant)})]})]}),Object(f.jsx)(j.a,{style:{justifyContent:"center",padding:10},children:Object(f.jsxs)(b.a,{lg:"10",children:[Object(f.jsx)("label",{children:"Display Name"}),Object(f.jsx)(_.a,{children:Object(f.jsx)(S.a,{type:"textarea",autoComplete:"off",value:this.state.display_name,name:"display_name",onChange:function(t){return e.onInputChange(t)},disabled:n})})]})}),Object(f.jsx)(j.a,{style:{justifyContent:"center",padding:10},children:Object(f.jsxs)(b.a,{lg:"10",children:[Object(f.jsx)("label",{children:"Short Description"}),Object(f.jsx)(_.a,{children:Object(f.jsx)(S.a,{type:"textarea",autoComplete:"off",value:this.state.short_text,name:"short_text",onChange:function(t){return e.onInputChange(t)},disabled:n})})]})}),Object(f.jsx)(j.a,{style:{justifyContent:"center",padding:10},children:Object(f.jsxs)(b.a,{lg:"10",children:[Object(f.jsx)("label",{children:"Long Description (Top)"}),Object(f.jsx)(_.a,{children:Object(f.jsx)(S.a,{type:"textarea",autoComplete:"off",value:this.state.description_top,name:"description_top",onChange:function(t){return e.onInputChange(t)},disabled:n})})]})}),Object(f.jsx)(j.a,{style:{justifyContent:"center",padding:10},children:Object(f.jsxs)(b.a,{lg:"10",children:[Object(f.jsx)("label",{children:"Long Description (Middle)"}),Object(f.jsx)(_.a,{children:Object(f.jsx)(S.a,{type:"textarea",autoComplete:"off",value:this.state.description_middle,name:"description_middle",onChange:function(t){return e.onInputChange(t)},disabled:n})})]})}),Object(f.jsx)(j.a,{style:{justifyContent:"center",padding:10},children:Object(f.jsxs)(b.a,{lg:"10",children:[Object(f.jsx)("label",{children:"Long Description (Bottom)"}),Object(f.jsx)(_.a,{children:Object(f.jsx)(S.a,{type:"textarea",autoComplete:"off",value:this.state.description_bottom,name:"description_bottom",onChange:function(t){return e.onInputChange(t)},disabled:n})})]})}),Object(f.jsx)(j.a,{style:{justifyContent:"center",padding:10},children:Object(f.jsxs)(b.a,{lg:"10",children:[Object(f.jsx)("label",{children:"Warning Text"}),Object(f.jsx)(_.a,{children:Object(f.jsx)(S.a,{type:"textarea",autoComplete:"off",value:this.state.warning_text,name:"warning_text",onChange:function(t){return e.onInputChange(t)},disabled:n})})]})}),Object(f.jsx)(j.a,{style:{justifyContent:"center",padding:10},children:Object(f.jsxs)(b.a,{lg:"10",children:[Object(f.jsx)("label",{children:"Caution Text"}),Object(f.jsx)(_.a,{children:Object(f.jsx)(S.a,{type:"textarea",autoComplete:"off",value:this.state.caution_text,name:"caution_text",onChange:function(t){return e.onInputChange(t)},disabled:n})})]})}),Object(f.jsx)(j.a,{style:{justifyContent:"center",padding:10},children:Object(f.jsxs)(b.a,{lg:"10",children:[Object(f.jsx)("label",{children:"Chapter Number"}),Object(f.jsx)(_.a,{children:Object(f.jsx)(S.a,{type:"textarea",autoComplete:"off",value:this.state.chapter_number,name:"chapter_number",onChange:function(t){return e.onInputChange(t)},disabled:n})})]})}),Object(f.jsx)(j.a,{style:{justifyContent:"center",padding:10},children:Object(f.jsxs)(b.a,{lg:"10",children:[Object(f.jsx)("label",{children:"Select Icon Image"}),Object(f.jsxs)(_.a,{children:[this.props.spinner.loadingIcon&&Object(f.jsx)(m.a,{style:{position:"absolute",top:"35%",left:"12.5%"},size:30}),Object(f.jsx)(R.a,{addBtnColor:"default",changeBtnColor:"default",images:this.state.images?this.state.images:[],handleImages:this.handleImages,handleRemove:this.handleImageRemove,name:"icon",disabled:n})]})]})}),Object(f.jsx)(j.a,{style:{justifyContent:"center",padding:10},children:Object(f.jsxs)(b.a,{lg:"10",children:[Object(f.jsx)("label",{children:"Illustration (Top)"}),Object(f.jsxs)(_.a,{children:[this.props.spinner.loadingillustrationsTop&&Object(f.jsx)(m.a,{style:{position:"absolute",top:"35%",left:"12.5%"},size:30}),Object(f.jsx)(R.a,{addBtnColor:"default",changeBtnColor:"default",images:this.state.illustrationsTop?this.state.illustrationsTop:[],handleImages:function(t){return e.handleIllustrations(t,"illustrationsTop")},handleRemove:function(t){return e.handleIllustrationRemove(t,"illustrationsTop")},loading:this.props.spinner.loadingillustrationsTop,disabled:n})]})]})}),Object(f.jsx)(j.a,{style:{justifyContent:"center",padding:10},children:Object(f.jsxs)(b.a,{lg:"10",children:[Object(f.jsx)("label",{children:"Illustration (Middle)"}),Object(f.jsxs)(_.a,{children:[this.props.spinner.loadingillustrationsMiddle&&Object(f.jsx)(m.a,{style:{position:"absolute",top:"35%",left:"12.5%"},size:30}),Object(f.jsx)(R.a,{addBtnColor:"default",changeBtnColor:"default",images:this.state.illustrationsMiddle?this.state.illustrationsMiddle:[],handleImages:function(t){return e.handleIllustrations(t,"illustrationsMiddle")},handleRemove:function(t){return e.handleIllustrationRemove(t,"illustrationsMiddle")},disabled:n})]})]})}),Object(f.jsx)(j.a,{style:{justifyContent:"center",padding:10},children:Object(f.jsxs)(b.a,{lg:"10",children:[Object(f.jsx)("label",{children:"Illustration (Bottom)"}),Object(f.jsxs)(_.a,{children:[this.props.spinner.loadingillustrationsBottom&&Object(f.jsx)(m.a,{style:{position:"absolute",top:"35%",left:"12.5%"},size:30}),Object(f.jsx)(R.a,{addBtnColor:"default",changeBtnColor:"default",images:this.state.illustrationsBottom?this.state.illustrationsBottom:[],handleImages:function(t){return e.handleIllustrations(t,"illustrationsBottom")},handleRemove:function(t){return e.handleIllustrationRemove(t,"illustrationsBottom")},disabled:n})]})]})}),Object(f.jsx)(j.a,{style:{justifyContent:"center",padding:10},children:Object(f.jsxs)(b.a,{lg:"10",children:[Object(f.jsx)("label",{children:"Select Videos"}),Object(f.jsxs)(_.a,{children:[this.props.spinner.loadingVideo&&Object(f.jsx)(m.a,{style:{position:"absolute",top:"35%",left:"12.5%"},size:30}),Object(f.jsx)(D.a,{addBtnColor:"default",changeBtnColor:"default",videos:this.state.videos?this.state.videos:[],handleVideos:this.handleVideos,handleRemove:this.handleVideoRemove,disabled:n}),this.props.spinner.loadingVideo&&Object(f.jsx)("progress",{value:this.state.uploaded,max:this.state.total})]})]})}),Object(f.jsx)(j.a,{style:{justifyContent:"center",padding:10},children:Object(f.jsxs)(b.a,{lg:"10",children:[Object(f.jsx)("label",{children:"Link to PDF"}),Object(f.jsx)(f.Fragment,{children:Object(f.jsx)(_.a,{children:this.state.linked_to_pdf.map((function(t,a){return Object(f.jsxs)(f.Fragment,{children:[Object(f.jsx)(S.a,{type:"textarea",autoComplete:"off",value:e.state.linked_to_pdf[a],name:"linked_to_pdf",onChange:function(t){return e.onInputChangel(t,a)},disabled:n}),1!==e.state.linked_to_pdf.length&&Object(f.jsx)(v.a,{color:e.props.removeBtnColor,className:"btn-simple",onClick:function(){return e.handleRemoveClick(a)},disabled:n,style:{color:"#FD1C03",borderColor:"#FD1C03",fontSize:12,display:"flex",alignItems:"center",justifyContent:"center",width:155,height:35},children:Object(f.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[Object(f.jsx)("i",{className:"fa fa-times"})," ",Object(f.jsx)("span",{style:{marginLeft:5},children:"Remove Page"})]})}),e.state.linked_to_pdf.length-1===a&&Object(f.jsx)(v.a,{color:e.props.addBtnColor,className:"btn-simple",onClick:function(){return e.handleAddClick()},disabled:n||!e.state.linked_to_pdf[a],style:{color:"rgb(248, 186, 0)",borderColor:"rgb(248, 186, 0)",fontSize:12,display:"flex",width:155,height:35},children:Object(f.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[Object(f.jsx)("i",{className:"fa fa-image"})," ",Object(f.jsx)("span",{style:{marginLeft:5},children:"Add Page"})]})})]})}))})})]})}),Object(f.jsx)(j.a,{style:{justifyContent:"center",padding:10},children:Object(f.jsxs)(b.a,{lg:"10",style:{display:"flex",alignItems:"center"},children:[Object(f.jsx)("label",{style:{marginRight:15},children:"Is Feature Critical?"}),Object(f.jsx)(A.a,{value:this.state.isCriticalFeature,offColor:"",offText:Object(f.jsx)("i",{className:"tim-icons icon-simple-remove"}),onColor:"custom",onText:Object(f.jsx)("i",{className:"tim-icons icon-check-2"}),onChange:function(t,a){return e.handleSwitch(t,a)},disabled:n})]})}),Object(f.jsxs)(j.a,{style:{justifyContent:"center",padding:10},children:[Object(f.jsx)(C.a,{lg:"2",children:"Meant For :"}),Object(f.jsxs)(b.a,{lg:"8",children:[Object(f.jsx)(_.a,{check:!0,inline:!0,children:Object(f.jsxs)(C.a,{check:!0,children:[Object(f.jsx)(S.a,{type:"checkbox",onChange:function(t){return e.onLinkedPartChange(t)},value:"vision",checked:!!this.state.meant_for.includes("vision"),disabled:n}),Object(f.jsx)("span",{className:"form-check-sign"}),"Visual"]})}),Object(f.jsx)(_.a,{check:!0,inline:!0,children:Object(f.jsxs)(C.a,{check:!0,children:[Object(f.jsx)(S.a,{type:"checkbox",onChange:function(t){return e.onLinkedPartChange(t)},value:"verbal",checked:!!this.state.meant_for.includes("verbal"),disabled:n}),Object(f.jsx)("span",{className:"form-check-sign"}),"Verbal"]})})]})]}),Object(f.jsxs)(j.a,{style:{justifyContent:"center",padding:10},children:[Object(f.jsx)(C.a,{lg:"2",children:"Related Parts :"}),Object(f.jsx)(b.a,{lg:"8",children:Object(f.jsx)(_.a,{children:Object(f.jsx)(P.a,{className:"react-select info",classNamePrefix:"react-select",value:this.state.linked_parts,onChange:function(t){return e.onChange(t,"linked_parts")},options:this.state.linked_parts_data,placeholder:"Select Feature",isMulti:!0,isDisabled:null==this.state.variant||null==this.state.model||null==this.state.variant||null==this.state.feature||n})})})]})]}),Object(f.jsxs)(j.a,{style:{justifyContent:"center",padding:5},className:"mt-5",children:[!n&&Object(f.jsxs)(v.a,{color:"info",onClick:this.handleSubmit,className:"btn-simple",style:{color:"#33FF00",borderColor:"#33FF00",display:"flex",alignItems:"center",justifyContent:"center",width:155,height:35,margin:5},children:[Object(f.jsx)("i",{className:"fa fa-file-alt","aria-hidden":"true"}),Object(f.jsx)("span",{style:{marginLeft:5},children:"Submit"})]}),n&&"admin"==this.props.auth.role&&"No"==this.props.location.state.obj.approved&&Object(f.jsxs)(v.a,{color:"info",onClick:this.approve,className:"btn-simple",style:{color:"#33FF00",borderColor:"#33FF00",display:"flex",alignItems:"center",justifyContent:"center",width:155,height:35,margin:5},children:[Object(f.jsx)("i",{className:"fa fa-check-circle-o","aria-hidden":"true"}),Object(f.jsx)("span",{style:{marginLeft:5},children:"Approve"})]}),Object(f.jsxs)(v.a,{color:"info",onClick:this.preview,className:"btn-simple",style:{color:"#FF6600",borderColor:"#FF6600",display:"flex",alignItems:"center",justifyContent:"center",width:155,height:35,margin:5},children:[Object(f.jsx)("i",{className:"fa fa-eye","aria-hidden":"true"})," ",Object(f.jsx)("span",{style:{marginLeft:5},children:"Preview"})]})]})]})}),Object(f.jsxs)(w.a,{isOpen:this.state.isOpen,children:[Object(f.jsx)(k.a,{style:{display:"flex",justifyContent:"space-between",flexDirection:"row",flex:1},children:Object(f.jsxs)("div",{style:{width:"100vw"},children:[Object(f.jsx)("p",{style:{color:"black"},children:"Preview"}),Object(f.jsx)(v.a,{style:{background:"none"},onClick:function(){return e.closePreview()},children:Object(f.jsx)("i",{className:"fa fa-times fa-2x","aria-hidden":"true",style:{color:"black"}})})]})}),Object(f.jsx)(T.a,{children:Object(f.jsx)(I.a,{obj:this.state})}),Object(f.jsx)(E.a,{style:{display:"flex",justifyContent:"flex-end"},children:Object(f.jsx)(v.a,{color:"secondary",onClick:function(){return e.closePreview()},children:"Close"})})]})]}),this.props.cms.showModal&&!this.state.view&&Object(f.jsx)(M.a,{uploading:this.props.cms.uploading,hideModal:function(){return e.hideModal()}}),this.props.cms.showModal&&this.state.view&&Object(f.jsx)(M.a,{uploading:!this.props.cms.approve,hideModal:function(){return e.hideModal()}}),this.props.cms.error&&Object(f.jsx)(z.a,{message:this.props.cms.error_msg,hide:function(){return e.props.dismissCmsError()}})]})})}}]),s}(h.Component)}).call(this,a(65).Buffer)},174:function(e,t,a){"use strict";var n=a(24),r=a(25),s=a(49),i=a(27),c=a(26),o=a(0),l=a(2),d=a.n(l),u=a(23),p=a(22),f=a(36),h=(a(136),a(137),function(e){Object(i.a)(a,e);var t=Object(c.a)(a);function a(e){var r;return Object(n.a)(this,a),(r=t.call(this,e)).state={file:null,videoPreviewUrl:null},r.handleVideosChange=r.handleVideosChange.bind(Object(s.a)(r)),r.handleSubmit=r.handleSubmit.bind(Object(s.a)(r)),r.handleClick=r.handleClick.bind(Object(s.a)(r)),r}return Object(r.a)(a,[{key:"handleVideosChange",value:function(e){this.props.handleVideos(e)}},{key:"handleSubmit",value:function(e){e.preventDefault()}},{key:"handleClick",value:function(){this.refs.fileInput.click()}},{key:"render",value:function(){var e=this;return Object(o.jsxs)("div",{className:"fileinput text-center",style:{display:"flex",alignItems:"center",justifyContent:"center"},children:[Object(o.jsx)("input",{type:"file",onChange:this.handleVideosChange,ref:"fileInput",accept:"video/*"}),Object(o.jsx)(u.a,{style:{display:"flex",width:"100%"},children:this.props.videos&&this.props.videos.length>0?Object(o.jsxs)(u.a,{style:{display:"flex",justifyContent:"center",alignItems:"center"},children:[this.props.videos.map((function(t,a){return Object(o.jsxs)(p.a,{style:{width:"30%"},md:"4",children:[Object(o.jsx)("video",{src:t,alt:"...",controls:!0,width:"100%"}),Object(o.jsxs)(f.a,{color:e.props.removeBtnColor,className:"btn-simple",onClick:function(){return e.props.handleRemove(t)},disabled:e.props.disabled,style:{color:"#FD1C03",borderColor:"#FD1C03",fontSize:12,width:155,height:35},children:[Object(o.jsx)("i",{className:"fa fa-times"})," Remove"]})]},a)})),Object(o.jsx)(p.a,{style:{height:"30%"},children:Object(o.jsx)(f.a,{color:this.props.addBtnColor,className:"btn-simple",onClick:function(){return e.handleClick()},disabled:this.props.disabled,style:{color:"rgb(248, 186, 0)",borderColor:"rgb(248, 186, 0)",fontSize:12,width:155,height:35},children:Object(o.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[Object(o.jsx)("i",{className:"fa fa-film"})," ",Object(o.jsx)("span",{style:{marginLeft:5},children:"Select Videos"})]})})})]}):Object(o.jsxs)("div",{style:{width:"30%",display:"flex",flexDirection:"column",alignItems:"center"},children:[Object(o.jsx)("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",width:200,height:150},children:Object(o.jsx)("i",{className:"fa fa-cloud-upload fa-5x",style:{background:"none",color:"rgb(0,228,228)"}})}),(null===this.props.videos||this.props.videos&&0===this.props.videos.length)&&Object(o.jsx)(f.a,{color:this.props.addBtnColor,className:"btn-simple",onClick:function(){return e.handleClick()},disabled:this.props.disabled,style:{color:"rgb(248, 186, 0)",borderColor:"rgb(248, 186, 0)",fontSize:12,width:155,height:35},children:Object(o.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[Object(o.jsx)("i",{className:"fa fa-film"})," ",Object(o.jsx)("span",{style:{marginLeft:5},children:"Select Videos"})]})})]})})]})}}]),a}(d.a.Component));h.defaultProps={avatar:!1,removeBtnClasses:"btn-round",removeBtnColor:"danger",addBtnClasses:"btn-round",addBtnColor:"primary",changeBtnClasses:"btn-round",changeBtnColor:"primary"},t.a=h},179:function(e,t,a){"use strict";var n=a(0);a(2),a(196);function r(e){return Object(n.jsxs)("div",{style:{margin:20,display:"flex",flexDirection:"column",backgroundColor:"white",padding:5,borderRadius:11,boxShadow:"20px 20px 60px #d9d9d9,-20px -20px 60px #ffffff"},children:[Object(n.jsxs)("div",{style:{display:"flex",flexDirection:"row"},children:[Object(n.jsx)("img",{src:e.icon,alt:"image",width:"30%",height:"70px"}),Object(n.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"70%",flexDirection:"column"},children:[Object(n.jsx)("h5",{style:{color:"ButtonText",alignSelf:"flex-start",padding:"10px 5px",fontWeight:"600"},children:e.title}),Object(n.jsx)("h5",{style:{color:"ButtonText",fontWeight:"lighter",padding:"10px 5px",alignSelf:"flex-start"},children:e.short_text})]})]}),Object(n.jsx)("div",{style:{height:"1px",border:"0.5px solid black",width:"100%"}}),Object(n.jsxs)("div",{style:{display:"flex",flexDirection:"row",justifyContent:"space-around",marginTop:5},children:[Object(n.jsx)("div",{style:{fontSize:12,fontWeight:"bold"},children:"VIEW MORE"}),Object(n.jsx)("div",{style:{fontSize:12,fontWeight:"bold"},children:"CONNECT TO WORKSHOP"})]})]})}a(115);function s(e){return Object(n.jsxs)("div",{style:{display:"flex",flexDirection:"column",justifyContent:"center"},children:[Object(n.jsxs)("div",{style:{padding:10},children:[Object(n.jsx)("i",{className:"fa fa-arrow-left","aria-hidden":"true"})," ",Object(n.jsx)("span",{style:{marginLeft:10,fontWeight:"bold"},children:"Videos"})]}),Object(n.jsx)("div",{style:{fontWeight:"bold",padding:10},children:e.title}),Object(n.jsx)("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",minHeight:"100%"},children:e.videos.length<=0?Object(n.jsx)("div",{style:{top:"50%",position:"absolute"},children:Object(n.jsx)("p",{style:{color:"ButtonText"},children:"No Videos Found"})}):e.videos.map((function(e){return Object(n.jsx)("video",{src:e||"",width:"90%",height:"33%",controls:!0,style:{margin:5}},e.toString())}))})]})}function i(e){return Object(n.jsxs)("div",{style:{display:"flex",flexDirection:"column"},children:[Object(n.jsxs)("div",{style:{padding:10},children:[Object(n.jsx)("i",{className:"fa fa-arrow-left","aria-hidden":"true"})," ",Object(n.jsx)("span",{style:{marginLeft:10,fontWeight:"bold"},children:"Part Detail"})]}),Object(n.jsx)("div",{style:{fontWeight:"bold",padding:10},children:e.title}),Object(n.jsx)("div",{style:{display:"flex",justifyContent:"center",textAlign:"justify",padding:10,fontSize:14,fontWeight:"lighter"},children:e.blurb}),Object(n.jsxs)("div",{style:{display:"flex",flexDirection:"column",padding:10,justifyContent:"space-between"},children:[Object(n.jsxs)("div",{style:{display:"flex",flexDirection:"row",justifyContent:"space-around",margin:5},children:[Object(n.jsx)("div",{style:{display:"flex",width:"45%",height:30,backgroundColor:"white",alignItems:"center",justifyContent:"center",fontSize:12,boxShadow:"20px 20px 60px #d9d9d9,-20px -20px 60px #ffffff"},children:"Videos"}),Object(n.jsx)("div",{style:{display:"flex",width:"45%",height:30,backgroundColor:"white",alignItems:"center",justifyContent:"center",fontSize:12,boxShadow:"20px 20px 60px #d9d9d9,-20px -20px 60px #ffffff"},children:"Warnings"})]}),Object(n.jsxs)("div",{style:{display:"flex",flexDirection:"row",justifyContent:"space-around",margin:5},children:[Object(n.jsx)("div",{style:{display:"flex",width:"45%",height:30,backgroundColor:"white",alignItems:"center",justifyContent:"center",fontSize:12,boxShadow:"20px 20px 60px #d9d9d9,-20px -20px 60px #ffffff"},children:"Cautions"}),Object(n.jsx)("div",{style:{display:"flex",width:"45%",height:30,backgroundColor:"white",alignItems:"center",justifyContent:"center",fontSize:12,boxShadow:"20px 20px 60px #d9d9d9,-20px -20px 60px #ffffff"},children:"Workshop"})]}),Object(n.jsxs)("div",{style:{display:"flex",flexDirection:"row",justifyContent:"space-around",margin:5},children:[Object(n.jsx)("div",{style:{display:"flex",width:"45%",height:30,backgroundColor:"white",alignItems:"center",justifyContent:"center",fontSize:12,boxShadow:"20px 20px 60px #d9d9d9,-20px -20px 60px #ffffff"},children:"Owner's Manual"}),Object(n.jsx)("div",{style:{display:"flex",width:"45%",height:30,backgroundColor:"white",alignItems:"center",justifyContent:"center",fontSize:12,boxShadow:"20px 20px 60px #d9d9d9,-20px -20px 60px #ffffff"},children:"More Info"})]})]}),Object(n.jsxs)("div",{style:{margin:5,height:40,display:"flex",backgroundColor:"white",width:"90%",alignItems:"center",padding:2,justifyContent:"space-around",boxShadow:"20px 20px 60px #d9d9d9,-20px -20px 60px #ffffff"},children:["How was your experience ?"," ",Object(n.jsx)("i",{className:"fa fa-thumbs-up","aria-hidden":"true",style:{color:"green"}}),Object(n.jsx)("i",{className:"fa fa-thumbs-down","aria-hidden":"true",style:{color:"red"}})]}),Object(n.jsx)("div",{style:{padding:10,fontWeight:"bold"},children:"Related Features"}),Object(n.jsx)("div",{style:{display:"flex",justifyContent:"space-around",padding:5},children:e.related_features.map((function(e){return Object(n.jsxs)("div",{style:{display:"flex",flexDirection:"column",margin:10},children:[Object(n.jsx)("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",boxShadow:"10px 10px 30px #d9d9d9,-10px -10px 30px #ffffff",height:70},children:Object(n.jsx)("img",{src:e.icon_url?e.icon_url:"https://s3.ap-south-1.amazonaws.com/msil-s3-tdc-vision-production/feature_icons/default.png",alt:"image",width:"30%",height:50})}),Object(n.jsx)("p",{style:{color:"GrayText",marginTop:10},children:e.label})]},e.icon_url?e.icon_url.toString():"https://s3.ap-south-1.amazonaws.com/msil-s3-tdc-vision-production/feature_icons/default.png")}))})]})}var c=function(e){return Object(n.jsxs)("div",{style:{display:"flex",flexDirection:"column",justifyContent:"center"},children:[Object(n.jsxs)("div",{style:{padding:10},children:[Object(n.jsx)("i",{className:"fa fa-arrow-left","aria-hidden":"true"})," ",Object(n.jsx)("span",{style:{marginLeft:10,fontWeight:"bold"},children:"Illustrations and Text"})]}),Object(n.jsx)("div",{style:{fontWeight:"bold",padding:10},children:e.title}),Object(n.jsxs)("div",{style:{display:"flex",flexDirection:"column",alignItems:"center"},children:[e.illustrationsTop.map((function(e){return Object(n.jsx)("img",{src:e||"",width:"90%",height:"33%",style:{margin:5}},e.toString())})),Object(n.jsx)("p",{style:{color:"ButtonText",padding:5,whiteSpace:"pre-wrap"},children:e.description_top}),e.illustrationsMiddle.map((function(e){return Object(n.jsx)("img",{src:e||"",width:"90%",height:"33%",style:{margin:5}},e.toString())})),Object(n.jsx)("p",{style:{color:"ButtonText",padding:5,whiteSpace:"pre-wrap"},children:e.description_middle}),e.illustrationsBottom.map((function(e){return Object(n.jsx)("img",{src:e||"",width:"90%",height:"33%",style:{margin:5}},e.toString())})),Object(n.jsx)("p",{style:{color:"ButtonText",padding:5,whiteSpace:"pre-wrap"},children:e.description_bottom})]})]})};function o(e){return Object(n.jsxs)("div",{style:{display:"flex",flexDirection:"column",justifyContent:"center"},children:[Object(n.jsxs)("div",{style:{padding:10},children:[Object(n.jsx)("i",{className:"fa fa-arrow-left","aria-hidden":"true"})," ",Object(n.jsx)("span",{style:{marginLeft:10,fontWeight:"bold"},children:"Warnings"})]}),Object(n.jsx)("div",{style:{fontWeight:"bold",padding:10},children:e.title}),Object(n.jsx)("div",{style:{display:"flex",flexDirection:"column",alignItems:"center"},children:Object(n.jsx)("p",{style:{color:"ButtonText",padding:10,whiteSpace:"pre-wrap"},children:e.warning_text.length>=1?e.warning_text:Object(n.jsx)("div",{style:{left:"33%",top:"50%",position:"absolute"},children:Object(n.jsx)("p",{style:{color:"ButtonText"},children:"No Content Found"})})})})]})}function l(e){return Object(n.jsxs)("div",{style:{display:"flex",flexDirection:"column",justifyContent:"center"},children:[Object(n.jsxs)("div",{style:{padding:10},children:[Object(n.jsx)("i",{className:"fa fa-arrow-left","aria-hidden":"true"})," ",Object(n.jsx)("span",{style:{marginLeft:10,fontWeight:"bold"},children:"Cautions"})]}),Object(n.jsx)("div",{style:{fontWeight:"bold",padding:10},children:e.title}),Object(n.jsx)("div",{style:{display:"flex",flexDirection:"column",alignItems:"center"},children:Object(n.jsx)("p",{style:{color:"ButtonText",padding:10,whiteSpace:"pre-wrap"},children:e.caution_text.length>=1?e.caution_text:Object(n.jsx)("div",{style:{left:"33%",top:"50%",position:"absolute"},children:Object(n.jsx)("p",{style:{color:"ButtonText"},children:"No Content Found"})})})})]})}var d=a(23);t.a=function(e){var t=e.obj;return Object(n.jsxs)(d.a,{style:{display:"flex",flexDirection:"column",justifyContent:"space-around",minHeight:"100vh",flex:1},children:[Object(n.jsxs)("div",{style:{display:"flex",flexDirection:"row",justifyContent:"space-around",flex:1,paddingBottom:10,paddingTop:20},children:[Object(n.jsxs)("div",{className:"marvel-device iphone8 gold",children:[Object(n.jsx)("div",{className:"top-bar"}),Object(n.jsx)("div",{className:"sleep"}),Object(n.jsx)("div",{className:"volume"}),Object(n.jsx)("div",{className:"camera"}),Object(n.jsx)("div",{className:"sensor"}),Object(n.jsx)("div",{className:"speaker"}),Object(n.jsxs)("div",{className:"screen",children:[Object(n.jsx)("div",{style:{padding:10,fontWeight:"bold"},children:t.display_name}),Object(n.jsx)(r,{icon:t.images[0]?t.images[0]:"https://s3.ap-south-1.amazonaws.com/maruti.data/placeholder_image.jpg",title:t.display_name,short_text:t.short_text}),Object(n.jsx)(r,{icon:t.images[0]?t.images[0]:"https://s3.ap-south-1.amazonaws.com/maruti.data/placeholder_image.jpg",title:t.display_name,short_text:t.short_text}),Object(n.jsx)(r,{icon:t.images[0]?t.images[0]:"https://s3.ap-south-1.amazonaws.com/maruti.data/placeholder_image.jpg",title:t.display_name,short_text:t.short_text})]}),Object(n.jsx)("div",{className:"home"}),Object(n.jsx)("div",{className:"bottom-bar"})]}),Object(n.jsxs)("div",{className:"marvel-device iphone8 gold",children:[Object(n.jsx)("div",{className:"top-bar"}),Object(n.jsx)("div",{className:"sleep"}),Object(n.jsx)("div",{className:"volume"}),Object(n.jsx)("div",{className:"camera"}),Object(n.jsx)("div",{className:"sensor"}),Object(n.jsx)("div",{className:"speaker"}),Object(n.jsx)("div",{className:"screen",children:Object(n.jsx)(i,{title:t.display_name,blurb:t.short_text,related_features:t.linked_parts?t.linked_parts:[]})}),Object(n.jsx)("div",{className:"home"}),Object(n.jsx)("div",{className:"bottom-bar"})]})]}),Object(n.jsxs)("div",{style:{display:"flex",flexDirection:"row",justifyContent:"space-around",flex:1,paddingBottom:10,paddingTop:20},children:[Object(n.jsxs)("div",{className:"marvel-device iphone8 gold",children:[Object(n.jsx)("div",{className:"top-bar"}),Object(n.jsx)("div",{className:"sleep"}),Object(n.jsx)("div",{className:"volume"}),Object(n.jsx)("div",{className:"camera"}),Object(n.jsx)("div",{className:"sensor"}),Object(n.jsx)("div",{className:"speaker"}),Object(n.jsx)("div",{className:"screen",children:Object(n.jsx)(s,{videos:t.videos,title:t.display_name})}),Object(n.jsx)("div",{className:"home"}),Object(n.jsx)("div",{className:"bottom-bar"})]}),Object(n.jsxs)("div",{className:"marvel-device iphone8 gold",children:[Object(n.jsx)("div",{className:"top-bar"}),Object(n.jsx)("div",{className:"sleep"}),Object(n.jsx)("div",{className:"volume"}),Object(n.jsx)("div",{className:"camera"}),Object(n.jsx)("div",{className:"sensor"}),Object(n.jsx)("div",{className:"speaker"}),Object(n.jsx)("div",{className:"screen",children:Object(n.jsx)(c,{title:t.display_name,illustrationsTop:t.illustrationsTop,illustrationsMiddle:t.illustrationsMiddle,illustrationsBottom:t.illustrationsBottom,description_top:t.description_top,description_middle:t.description_middle,description_bottom:t.description_bottom})}),Object(n.jsx)("div",{className:"home"}),Object(n.jsx)("div",{className:"bottom-bar"})]})]}),Object(n.jsxs)("div",{style:{display:"flex",flexDirection:"row",justifyContent:"space-around",flex:1,paddingBottom:10,paddingTop:20},children:[Object(n.jsxs)("div",{className:"marvel-device iphone8 gold",children:[Object(n.jsx)("div",{className:"top-bar"}),Object(n.jsx)("div",{className:"sleep"}),Object(n.jsx)("div",{className:"volume"}),Object(n.jsx)("div",{className:"camera"}),Object(n.jsx)("div",{className:"sensor"}),Object(n.jsx)("div",{className:"speaker"}),Object(n.jsx)("div",{className:"screen",children:Object(n.jsx)(o,{title:t.display_name,warning_text:t.warning_text})}),Object(n.jsx)("div",{className:"home"}),Object(n.jsx)("div",{className:"bottom-bar"})]}),Object(n.jsxs)("div",{className:"marvel-device iphone8 gold",children:[Object(n.jsx)("div",{className:"top-bar"}),Object(n.jsx)("div",{className:"sleep"}),Object(n.jsx)("div",{className:"volume"}),Object(n.jsx)("div",{className:"camera"}),Object(n.jsx)("div",{className:"sensor"}),Object(n.jsx)("div",{className:"speaker"}),Object(n.jsx)("div",{className:"screen",children:Object(n.jsx)(l,{title:t.display_name,caution_text:t.caution_text})}),Object(n.jsx)("div",{className:"home"}),Object(n.jsx)("div",{className:"bottom-bar"})]})]})]})}},19:function(e,t,a){"use strict";a.d(t,"b",(function(){return c})),a.d(t,"c",(function(){return l})),a.d(t,"d",(function(){return u})),a.d(t,"a",(function(){return p}));var n=a(9),r=a.n(n),s=a(15),i=a(21),c=function(e,t){return{type:"RESTORE_TOKEN",payload:{token:e,role:t}}},o=function(e,t){return{type:"SIGN_IN_SUCCESS",payload:{token:e,role:t}}},l=function(e,t){return function(){var a=Object(s.a)(r.a.mark((function a(n){var s,c,l,u;return r.a.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return n({type:"SIGN_IN_STARTED"}),s=null,c=null,(l={}).email=e,l.password=t,a.next=8,Object(i.a)("/auths/login","POST",l);case 8:if("success"!=(u=a.sent).code){a.next=17;break}return s=u.data.session.token,c=u.data.user.cms_role,localStorage.setItem("x-auth",JSON.stringify(s)),localStorage.setItem("role",JSON.stringify(c)),a.abrupt("return",n(o(s,c)));case 17:return a.abrupt("return",n(d(u.message)));case 18:case"end":return a.stop()}}),a)})));return function(e){return a.apply(this,arguments)}}()},d=function(e){return{type:"SIGN_IN_FAILURE",payload:e}},u=function(){return function(){var e=Object(s.a)(r.a.mark((function e(t){var a;return r.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(i.a)("/auths/logout","PUT",{});case 2:if(a=e.sent,e.prev=3,"success"!=a.code&&"authn_fail"!=a.code){e.next=10;break}return e.next=7,localStorage.removeItem("x-auth");case 7:return e.next=9,localStorage.removeItem("role");case 9:return e.abrupt("return",t({type:"SIGN_OUT"}));case 10:e.next=15;break;case 12:e.prev=12,e.t0=e.catch(3),console.error(e.t0);case 15:case"end":return e.stop()}}),e,null,[[3,12]])})));return function(t){return e.apply(this,arguments)}}()},p=function(){return{type:"DISMISS_ERROR"}}},196:function(e,t,a){},21:function(e,t,a){"use strict";a.d(t,"a",(function(){return o}));var n=a(9),r=a.n(n),s=a(15),i=a(279),c={"x-device-id":"cms.device","x-key":"4efc1a9ea64d44e6b54d50ee81064ce1ce49ba2d6bc6494b8d0d4dd9102320d5","x-platform":1,"x-origin":5,"x-version":1,"Content-Type":"application/json"},o=function(){var e=Object(s.a)(r.a.mark((function e(t,a,n){var s,o,l;return r.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s="https://api.cms.assist.marutisuzuki.com/v1"+t,e.t0=JSON,e.next=4,localStorage.getItem("x-auth");case 4:if(e.t1=e.sent,c["x-auth"]=e.t0.parse.call(e.t0,e.t1),"/auths/login"!=t&&"/updates"!=t||delete c["x-auth"],!(["POST","PUT","DELETE"].indexOf(a)>-1&&n)){e.next=14;break}return e.next=10,i({url:s,method:a,data:n,headers:c});case 10:return o=e.sent,e.abrupt("return",o.data);case 14:return e.next=16,i({url:s,method:a,headers:c});case 16:return l=e.sent,e.abrupt("return",l.data);case 18:case"end":return e.stop()}}),e)})));return function(t,a,n){return e.apply(this,arguments)}}()},319:function(e,t,a){},42:function(e,t,a){"use strict";a.d(t,"a",(function(){return i}));var n=a(0),r=(a(2),a(68)),s=a.n(r),i=function(e){return Object(n.jsx)(s.a,{warning:!0,style:{display:"block",marginTop:"-100px"},title:"ERROR",onConfirm:function(){return e.hide()},confirmBtnBsStyle:"success",confirmBtnText:"OK",btnSize:"",children:e.message})}},62:function(e,t,a){"use strict";var n=a(0),r=(a(2),a(68)),s=a.n(r),i=a(64);t.a=function(e){return Object(n.jsx)(s.a,{style:{display:"block",marginTop:"-100px"},title:e.uploading?"Submitting...":"Submitted Successfully",onConfirm:function(){return e.hideModal()},confirmBtnBsStyle:"default",btnSize:"",showConfirm:!e.uploading,children:e.uploading?Object(n.jsx)(i.a,{size:"large"}):Object(n.jsx)("i",{className:"fa fa-check-circle fa-2x","aria-hidden":"true",style:{color:"seagreen",width:24}})})}},658:function(e,t,a){},660:function(e){e.exports=JSON.parse("{}")},661:function(e,t,a){},663:function(e,t,a){},664:function(e,t,a){"use strict";a.r(t),a.d(t,"store",(function(){return _t}));var n,r,s=a(0),i=a(2),c=a.n(i),o=a(33),l=a.n(o),d=function(e){e&&e instanceof Function&&a.e(3).then(a.bind(null,689)).then((function(t){var a=t.getCLS,n=t.getFID,r=t.getFCP,s=t.getLCP,i=t.getTTFB;a(e),n(e),r(e),s(e),i(e)}))},u=a(178),p=a(54),f=a(18),h=a(63),j=a(171),b=a(4),m={loading:!1,loadingFullData:!1,fullData:[],documents:[],error:!1,error_msg:null,uploading:!1,showModal:!1,fetchingDocument:!1,document:[],approve:!1},O={isLoading:!0,isSignout:!1,userToken:null,error:!1,error_msg:null,role:null},g=a(11),x={loadingIcon:!1,loadingillustrationsTop:!1,loadingillustrationsMiddle:!1,loadingillustrationsBottom:!1,loadingVideo:!1},v={loadingMeta:!0,parts_data:[],makes:[],models:[],features:[],error:!1,error_msg:null},y={loadingFeatures:!0,loadingFeature:!0,features_data:[],feature:null,error:!1,error_msg:null,uploading:!1,showModal:!1},_={loadingParts:!1,parts_data:[],error:!1,error_msg:null,part_id:null},S={loadingFeatures:!0,mappable_features:null,error:!1,error_msg:null,uploading:!1,showModal:!1},C=Object(h.c)({cms:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:m,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"FETCH_DATA_START":return Object(b.a)(Object(b.a)({},e),{},{loading:!0});case"FETCH_DATA_SUCCESS":return Object(b.a)(Object(b.a)({},e),{},{documents:t.payload,loading:!1});case"FETCH_DATA_FULL_START":return Object(b.a)(Object(b.a)({},e),{},{loadingFullData:!0});case"FETCH_DATA_FULL_SUCCESS":return Object(b.a)(Object(b.a)({},e),{},{fullData:t.payload,loadingFullData:!1});case"ON_ERROR":return Object(b.a)(Object(b.a)({},e),{},{error:!0,error_msg:t.payload,uploading:!1,showModal:!1});case"DISMISS_CMS_ERROR":return Object(b.a)(Object(b.a)({},e),{},{error:!1,error_msg:null});case"POST_DATA_START":return Object(b.a)(Object(b.a)({},e),{},{uploading:!0,showModal:!0});case"POST_DATA_SUCCESS":return Object(b.a)(Object(b.a)({},e),{},{uploading:!1});case"PUT_DATA_START":return Object(b.a)(Object(b.a)({},e),{},{uploading:!0,showModal:!0});case"PUT_DATA_SUCCESS":return Object(b.a)(Object(b.a)({},e),{},{uploading:!1});case"CLOSE_MODAL":return Object(b.a)(Object(b.a)({},e),{},{showModal:!1});case"GET_DOCUMENT_BY_ID_START":return Object(b.a)(Object(b.a)({},e),{},{fetchingDocument:!0});case"GET_DOCUMENT_BY_ID_SUCCESS":return Object(b.a)(Object(b.a)({},e),{},{document:t.payload,fetchingDocument:!1});case"APPROVE_START":return Object(b.a)(Object(b.a)({},e),{},{showModal:!0,approve:!1});case"APPROVE_SUCCESS":return Object(b.a)(Object(b.a)({},e),{},{approve:!0});default:return e}},auth:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:O,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RESTORE_TOKEN":return Object(b.a)(Object(b.a)({},e),{},{userToken:t.payload.token,isLoading:!1,role:t.payload.role});case"SIGN_IN_SUCCESS":return Object(b.a)(Object(b.a)({},e),{},{isSignout:!1,userToken:t.payload.token,role:t.payload.role,error:!1,error_msg:null});case"SIGN_IN_FAILURE":return Object(b.a)(Object(b.a)({},e),{},{error:!0,error_msg:t.payload});case"SIGN_OUT":return Object(b.a)(Object(b.a)({},e),{},{isSignout:!0,userToken:null,role:null});case"LOGGED_OUT":return Object(b.a)(Object(b.a)({},e),{},{isSignout:!1});case"DISMISS_ERROR":return Object(b.a)(Object(b.a)({},e),{},{error:!1,error_msg:null});default:return e}},spinner:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:x,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SHOW_ICON_SPINNER":return Object(b.a)(Object(b.a)({},e),{},Object(g.a)({},t.payload,!0));case"HIDE_ICON_SPINNER":return Object(b.a)(Object(b.a)({},e),{},Object(g.a)({},t.payload,!1));default:return e}},meta:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:v,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"FETCH_METADATA_START":return Object(b.a)(Object(b.a)({},e),{},{loadingMeta:!0});case"FETCH_METADATA_SUCCESS":return Object(b.a)(Object(b.a)({},e),{},{loadingMeta:!1,makes:t.payload.makes,models:t.payload.models,features:t.payload.features});case"FETCH_METADATA_FAIL":return Object(b.a)(Object(b.a)({},e),{},{error:!0,error_msg:t.payload,loadingMeta:!1});case"DISMISS_ERROR_META":return Object(b.a)(Object(b.a)({},e),{},{error:!1,error_msg:null});default:return e}},features:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:y,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"FETCH_FEATURES_START":return Object(b.a)(Object(b.a)({},e),{},{loadingFeatures:!0});case"FETCH_FEATURES_SUCCESS":return Object(b.a)(Object(b.a)({},e),{},{loadingFeatures:!1,features_data:t.payload});case"FETCH_FEATURES_BY_ID_START":return Object(b.a)(Object(b.a)({},e),{},{loadingFeature:!0});case"FETCH_FEATURE_BY_ID_SUCCESS":return Object(b.a)(Object(b.a)({},e),{},{loadingFeature:!1,feature:t.payload.features});case"ON_FEATURES_ERROR":return Object(b.a)(Object(b.a)({},e),{},{error:!0,error_msg:t.payload,loadingFeatures:!1,loadingFeature:!1,uploading:!1,showModal:!1});case"DISMISS_FEATURES_ERROR":return Object(b.a)(Object(b.a)({},e),{},{error:!1,error_msg:null});case"CREATE_FEATURE_START":return Object(b.a)(Object(b.a)({},e),{},{uploading:!0,showModal:!0});case"CREATE_FEATURE_SUCCESS":return Object(b.a)(Object(b.a)({},e),{},{uploading:!1});case"CLOSE_FEATURE_MODAL":return Object(b.a)(Object(b.a)({},e),{},{showModal:!1});default:return e}},parts:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:_,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"FETCH_PARTS_START":return Object(b.a)(Object(b.a)({},e),{},{loadingParts:!0});case"FETCH_PARTS_SUCCESS":return Object(b.a)(Object(b.a)({},e),{},{loadingParts:!1,parts_data:t.payload});case"ON_PARTS_ERROR":return Object(b.a)(Object(b.a)({},e),{},{error:!0,error_msg:t.payload,loadingParts:!1});case"DISMISS_PARTS_ERROR":return Object(b.a)(Object(b.a)({},e),{},{error:!1,error_msg:null});case"CREATE_PART_START":return Object(b.a)(Object(b.a)({},e),{},{loadingParts:!0});case"CREATE_PART_SUCCESS":return Object(b.a)(Object(b.a)({},e),{},{part_id:t.payload,loadingParts:!1});case"CREATE_PART_ERROR":return Object(b.a)(Object(b.a)({},e),{},{error:!0,error_msg:t.payload,loadingParts:!1});default:return e}},featureMapping:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:S,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"FETCH_MAPPABLE_FEATURES_START":return Object(b.a)(Object(b.a)({},e),{},{loadingFeatures:!0});case"FETCH_MAPPABLE_FEATURES_SUCCESS":return Object(b.a)(Object(b.a)({},e),{},{loadingFeatures:!1,mappable_features:t.payload});case"ON_MAPPABLE_FEATURES_ERROR":return Object(b.a)(Object(b.a)({},e),{},{error:!0,error_msg:t.payload,loadingFeatures:!1,uploading:!1,showModal:!1});case"DISMISS_MAPPABLE_FEATURES_ERROR":return Object(b.a)(Object(b.a)({},e),{},{error:!1,error_msg:null});case"CREATE_FEATURE_MAPPING_START":return Object(b.a)(Object(b.a)({},e),{},{uploading:!0,showModal:!0});case"CREATE_FEATURE_MAPPING_SUCCESS":return Object(b.a)(Object(b.a)({},e),{},{uploading:!1});case"CLOSE_FEATURE_MAPPING_MODAL":return Object(b.a)(Object(b.a)({},e),{},{showModal:!1});case"RESET_FEATURE_MAPPING":return Object(b.a)(Object(b.a)({},e),{},{mappable_features:null});default:return e}}}),w=h.d,k=a(9),T=a.n(k),E=a(15),N=a(32),A=a(24),F=a(25),I=a(27),P=a(26),R=a(71),D=a(172),M=a(21),z=a(19),L=(a(87),function(e){var t=JSON.stringify(e);return function(){var e=Object(E.a)(T.a.mark((function e(a){var n;return T.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a({type:"FETCH_DATA_START"}),e.next=3,Object(M.a)("/documents?summary=1&model_id=".concat(t),"GET",{});case 3:"success"==(n=e.sent).code?a({type:"FETCH_DATA_SUCCESS",payload:n.data.documents}):"authn_fail"==n.code?a(Object(z.d)()):a(B(n.message));case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()}),B=function(e){return{type:"ON_ERROR",payload:e}},U=function(e){return function(){var t=Object(E.a)(T.a.mark((function t(a){var n,r,s;return T.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a({type:"GET_DOCUMENT_BY_ID_START"}),t.next=3,Object(M.a)("/documents/".concat(e),"GET",{});case 3:"success"==(n=t.sent).code?(r=n.data.document.document_fields,(s={}).images=r.filter((function(e){return e.hasOwnProperty("icon_url")})).length>0?[r.filter((function(e){return e.hasOwnProperty("icon_url")}))[0].icon_url]:[],s.display_name=r.filter((function(e){return e.hasOwnProperty("title")}))[0]?r.filter((function(e){return e.hasOwnProperty("title")}))[0].title:"",s.short_text=r.filter((function(e){return e.hasOwnProperty("blurb")}))[0]?r.filter((function(e){return e.hasOwnProperty("blurb")}))[0].blurb:"",s.description_top=r.filter((function(e){return e.hasOwnProperty("description_top")}))[0]?r.filter((function(e){return e.hasOwnProperty("description_top")}))[0].description_top:"",s.description_middle=r.filter((function(e){return e.hasOwnProperty("description_middle")}))[0]?r.filter((function(e){return e.hasOwnProperty("description_middle")}))[0].description_middle:"",s.description_bottom=r.filter((function(e){return e.hasOwnProperty("description_bottom")}))[0]?r.filter((function(e){return e.hasOwnProperty("description_bottom")}))[0].description_bottom:"",s.videos=r.filter((function(e){return e.hasOwnProperty("video_url")})).length>0?r.filter((function(e){return e.hasOwnProperty("video_url")})).map((function(e){return e.video_url})):[],s.caution_text=r.filter((function(e){return e.hasOwnProperty("caution")}))[0]?r.filter((function(e){return e.hasOwnProperty("caution")}))[0].caution:"",s.illustration_top=r.filter((function(e){return e.hasOwnProperty("image_top_url")})).length>0?r.filter((function(e){return e.hasOwnProperty("image_top_url")})).map((function(e){return e.image_top_url})):[],s.illustration_middle=r.filter((function(e){return e.hasOwnProperty("image_middle_url")})).length>0?r.filter((function(e){return e.hasOwnProperty("image_middle_url")})).map((function(e){return e.image_middle_url})):[],s.illustration_bottom=r.filter((function(e){return e.hasOwnProperty("image_bottom_url")})).length>0?r.filter((function(e){return e.hasOwnProperty("image_bottom_url")})).map((function(e){return e.image_bottom_url})):[],s.linked_to_pdf=r.filter((function(e){return e.hasOwnProperty("file_url")})).length>0?r.filter((function(e){return e.hasOwnProperty("file_url")})).map((function(e){return e.file_url})):[""],s.warning_text=r.filter((function(e){return e.hasOwnProperty("warning")}))[0]?r.filter((function(e){return e.hasOwnProperty("warning")}))[0].warning:"",s.chapter=r.filter((function(e){return e.hasOwnProperty("chapter")}))[0]?r.filter((function(e){return e.hasOwnProperty("chapter")}))[0].chapter:"",s.related_features=r.filter((function(e){return e.hasOwnProperty("related_features")}))[0]?r.filter((function(e){return e.hasOwnProperty("related_features")}))[0].related_features:[],a({type:"GET_DOCUMENT_BY_ID_SUCCESS",payload:s})):"authn_fail"==n.code?a(Object(z.d)()):a(B(n.message));case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()},W=function(e,t,a){var n=_t.getState().meta.models,r=n&&n.length>0&&n.filter((function(e){return"/".concat(e.label.toLowerCase())===a}))[0]?n.filter((function(e){return"/".concat(e.label.toLowerCase())===a}))[0].value:1;return function(){var a=Object(E.a)(T.a.mark((function a(n){var s;return T.a.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return n({type:"APPROVE_START"}),a.next=3,Object(M.a)("/documents/".concat(e),"PUT",{approved:1,template_reference:"msr_v1"});case 3:"success"==(s=a.sent).code?(n({type:"APPROVE_SUCCESS"}),n(L(r)),"table"==t&&n({type:"CLOSE_MODAL"})):"authn_fail"==s.code?n(Object(z.d)()):n(B(s.message));case 5:case"end":return a.stop()}}),a)})));return function(e){return a.apply(this,arguments)}}()},H=function(){return function(){var e=Object(E.a)(T.a.mark((function e(t){var a,n,r,s,i,c;return T.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t({type:"FETCH_METADATA_START"}),a=[1,2,3,4,5],e.next=4,Object(M.a)("/meta","GET",{});case 4:if("success"!=(n=e.sent).code){e.next=14;break}r=n.data.metadata.features.filter((function(e,t){return!a.includes(e.variant_id)})),s=Array.from(new Set(r.map((function(e){return e.make})))),i=[],s.map((function(e){var t=r.find((function(t){return t.make===e})).make_id;i.push({value:t,label:e})})),c=Array.from(new Set(r.map((function(e,t,a){return{value:e.model_id,label:e.model.replace(/\ /g,"")}})))).filter((function(e,t,a){return a.findIndex((function(t){return t.value===e.value&&t.model===e.model}))===t})),t({type:"FETCH_METADATA_SUCCESS",payload:{makes:i,models:c,features:r}}),e.next=19;break;case 14:if("authn_fail"!=n.code){e.next=18;break}return e.abrupt("return",t(Object(z.d)()));case 18:return e.abrupt("return",t(V(n.message)));case 19:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},V=function(e){return{type:"FETCH_METADATA_FAIL",payload:e}},q=function(e){Object(I.a)(a,e);var t=Object(P.a)(a);function a(){return Object(A.a)(this,a),t.apply(this,arguments)}return Object(F.a)(a,[{key:"componentDidMount",value:function(){this.props.fetchMetaData()}},{key:"render",value:function(){return Object(s.jsx)(D.a,Object(b.a)({},this.props))}}]),a}(i.Component),G=Object(f.b)((function(e){return{auth:e.auth,spinner:e.spinner,meta:e.meta,cms:e.cms}}),(function(e){return{showIconSpinner:function(t){return e({type:"SHOW_ICON_SPINNER",payload:t})},hideIconSpinner:function(t){return e({type:"HIDE_ICON_SPINNER",payload:t})},postData:function(t,a){return e((n=t,r=a,function(){var e=Object(E.a)(T.a.mark((function e(t){var a;return T.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t({type:"POST_DATA_START"}),a=0,r.map(function(){var e=Object(E.a)(T.a.mark((function e(r,s,i){var c,o,l,d;return T.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(c=JSON.parse(n)).feature_id=r,e.next=4,Object(M.a)("/documents","POST",JSON.stringify(c));case 4:if("success"==(o=e.sent).code?a+=1:"authn_fail"==o.code?t(Object(z.d)()):t(B(o.message)),a!=i.length){e.next=13;break}return e.next=9,Object(M.a)("/features?feature_id=".concat(c.feature_id),"GET",{});case 9:l=e.sent;try{d=l.data.features[0].model_id}catch(s){}t({type:"POST_DATA_SUCCESS"}),t(L(d));case 13:case"end":return e.stop()}}),e)})));return function(t,a,n){return e.apply(this,arguments)}}());case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));var n,r},putData:function(t,a){return e((n=t,r=a,function(){var e=Object(E.a)(T.a.mark((function e(t){var a,s,i,c;return T.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t({type:"PUT_DATA_START"}),(a=JSON.parse(n)).id=r,e.next=5,Object(M.a)("/documents","POST",JSON.stringify(a));case 5:if("success"!=(s=e.sent).code){e.next=15;break}return e.next=9,Object(M.a)("/features?feature_id=".concat(a.id),"GET",{});case 9:i=e.sent;try{c=i.data.features[0].model_id}catch(o){c=null}t({type:"PUT_DATA_SUCCESS"}),t(L(c)),e.next=16;break;case 15:"authn_fail"==s.code?t(Object(z.d)()):t(B(s.message));case 16:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));var n,r},hideModal:function(){return e({type:"CLOSE_MODAL"})},fetchData:function(){return e(L())},getDocumentById:function(t){return e(U(t))},fetchMetaData:function(){return e(H())},approve:function(t,a,n){return e(W(t,a,n))},dismissCmsError:function(){return e({type:"DISMISS_CMS_ERROR"})}}}))(q),Y=a(23),J=a(22),K=a(666),X=a(667),Z=a(668),$=a(36),Q=a(680),ee=a(64),te=a(70),ae=a(89),ne=a(176),re=function(e){return e=e.replace(/"/g,'""')},se=function(e){var t=e.data;e.fullData&&function(){for(var e=[2,3,5,6,8,10,12,14,15],a=function(a){if(t[a].document_fields){t[a].document_fields=t[a].document_fields.filter((function(t){return e.includes(t.template_sequence)})),t[a].document_fields.forEach((function(e){delete e.document_field_sequence,delete e.template_sequence,e.hasOwnProperty("related_features")&&e.related_features.hasOwnProperty("length")&&0!==e.related_features.length&&(e.related_features=e.related_features.map((function(e){return e.part.replace(",","")})).toString().replace(",",";")),t[a]=Object(b.a)(Object(b.a)({},t[a]),e)})),delete t[a].document_fields;var n=t[a];t[a]={},t[a].id=n.hasOwnProperty("id")?n.id:"",t[a].version=n.hasOwnProperty("version")?n.version:"",t[a].approved=n.hasOwnProperty("approved")?n.approved:"",t[a].make=n.hasOwnProperty("make")?n.make:"",t[a].model=n.hasOwnProperty("model")?n.model:"",t[a].variant=n.hasOwnProperty("variant")?n.variant:"",t[a].part=n.hasOwnProperty("part")?n.part:"",t[a].verbal=n.hasOwnProperty("verbal")?n.verbal:"",t[a].vision=n.hasOwnProperty("vision")?n.vision:"",t[a].critical=n.hasOwnProperty("critical")?n.critical:"",t[a].editor_first_name=n.hasOwnProperty("editor_first_name")?n.editor_first_name:"",t[a].editor_last_name=n.hasOwnProperty("editor_last_name")?n.editor_last_name:"",t[a].approver_first_name=n.hasOwnProperty("approver_first_name")?n.approver_first_name:"",t[a].approver_last_name=n.hasOwnProperty("approver_last_name")?n.approver_last_name:"",t[a].title=n.hasOwnProperty("title")?re(n.title):"",t[a].blurb=n.hasOwnProperty("blurb")?re(n.blurb):"",t[a].warning=n.hasOwnProperty("warning")?re(n.warning):"",t[a].caution=n.hasOwnProperty("caution")?re(n.caution):"",t[a].description_top=n.hasOwnProperty("description_top")?re(n.description_top):"",t[a].description_middle=n.hasOwnProperty("description_middle")?re(n.description_middle):"",t[a].description_bottom=n.hasOwnProperty("description_bottom")?re(n.description_bottom):"",t[a].chapter=n.hasOwnProperty("chapter")?re(n.chapter):"",t[a].related_features=n.hasOwnProperty("related_features")?n.related_features:""}else t[a].title="",t[a].blurb="",t[a].warning="",t[a].caution="",t[a].description_top="",t[a].description_middle="",t[a].description_bottom="",t[a].chapter=""},n=0;n3?"up":"down",children:[Object(s.jsx)(le.a,{"aria-expanded":!1,"data-toggle":"dropdown",id:"dropdownMenuButton",className:"customise",children:"..."}),"/features"==e.history.location.pathname?Object(s.jsxs)(de.a,{"aria-labelledby":"dropdownMenuButton",right:!0,children:[Object(s.jsxs)(ue.a,{style:pe,onClick:function(){return e.onViewMappingClick()},disabled:e.disabled,children:[Object(s.jsx)("i",{className:"fa fa-eye","aria-hidden":"true"})," ",Object(s.jsx)("span",{children:"View Mapping"})]}),Object(s.jsxs)(ue.a,{style:pe,disabled:!e.disabled,onClick:function(){return e.onCreateMappingClick()},children:[Object(s.jsx)("i",{className:"fa fa-plus","aria-hidden":"true"})," ",Object(s.jsx)("span",{children:"Create Mapping"})]}),Object(s.jsxs)(ue.a,{style:pe,onClick:function(){return e.onEditMappingClick()},children:[Object(s.jsx)("i",{className:"fa fa-pencil-square-o","aria-hidden":"true"})," ",Object(s.jsx)("span",{children:"Edit Mapping"})]}),Object(s.jsxs)(ue.a,{style:pe,onClick:function(){return e.onDeleteMappingClick()},disabled:e.disabled,children:[Object(s.jsx)("i",{className:"fas fa-times","aria-hidden":"true"})," ",Object(s.jsx)("span",{children:"Delete Mapping"})]}),Object(s.jsxs)(ue.a,{style:pe,onClick:function(){return e.onDeleteFeatureClick()},children:[Object(s.jsx)("i",{className:"fas fa-times","aria-hidden":"true"})," ",Object(s.jsx)("span",{children:"Delete Feature"})]})]}):Object(s.jsxs)(de.a,{"aria-labelledby":"dropdownMenuButton",right:!0,children:[Object(s.jsxs)(ue.a,{style:pe,onClick:function(){return e.onEditClick()},children:[Object(s.jsx)("i",{className:"fa fa-pencil-square-o","aria-hidden":"true"})," ",Object(s.jsx)("span",{children:"Edit"})]}),Object(s.jsxs)(ue.a,{style:pe,onClick:function(){return e.onViewClick()},children:[Object(s.jsx)("i",{className:"fa fa-eye","aria-hidden":"true"})," ",Object(s.jsx)("span",{children:"View"})]}),"admin"===e.role&&Object(s.jsxs)(ue.a,{style:pe,onClick:function(){return e.onApproveClick()},disabled:1===e.item.approved,children:[Object(s.jsx)("i",{className:"fa fa-check-circle-o","aria-hidden":"true"})," ",Object(s.jsx)("span",{children:"Approve"})]})]})]})},he=a(68),je=a.n(he),be=(a(658),function(e){return Object(s.jsx)(je.a,{showCloseButton:!1,style:{display:"block",marginTop:"-100px"},title:e.loading?"Fetching Your Data":"Successfully Fetched",onCancel:function(){return e.hideModal()},cancelBtnBsStyle:"light",btnSize:"",showConfirm:!1,children:e.loading?Object(s.jsx)(ee.a,{size:"large",style:{color:"#595959"}}):Object(s.jsx)(se,{data:e.fullData,fullData:!0})})}),me=function(e){var t=Object(i.useState)(!1),a=Object(ce.a)(t,2),n=a[0],r=a[1],c=Object(i.useState)(),o=Object(ce.a)(c,2),l=(o[0],o[1],Object(f.c)()),d=Object(f.d)((function(e){return e.cms})),u=d.loadingFullData,p=d.error,h=d.error_msg,j=d.fullData;Object(i.useEffect)((function(){var t=e.history.location.pathname,a=e.meta.models&&e.meta.models.length>0&&e.meta.models.filter((function(e){return"/".concat(e.label.toLowerCase())===t}))[0]?e.meta.models.filter((function(e){return"/".concat(e.label.toLowerCase())===t}))[0].value:1;n&&l(function(e){var t=JSON.stringify(e);return function(){var e=Object(E.a)(T.a.mark((function e(a){var n;return T.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a({type:"FETCH_DATA_FULL_START"}),e.next=3,Object(M.a)("/documents?summary=1&full=1&model_id=".concat(t),"GET",{});case 3:"success"==(n=e.sent).code?a({type:"FETCH_DATA_FULL_SUCCESS",payload:n.data.documents}):"authn_fail"==n.code?a(Object(z.d)()):a(B(n.message));case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()}(a))}),[e.history.location.pathname,n]);return Object(s.jsxs)(s.Fragment,{children:[Object(s.jsx)($.a,{onClick:function(){return r(!0)},children:"Export"}),n?Object(s.jsx)(be,{loading:u,fullData:j,error:p,error_msg:h,hideModal:function(){r(!1)}}):null]})},Oe="#4FB32C",ge="#F8BA00",xe="#00E4E4",ve=function(e){Object(I.a)(a,e);var t=Object(P.a)(a);function a(){var e;Object(A.a)(this,a);for(var n=arguments.length,r=new Array(n),i=0;i0&&e.meta.models.filter((function(e){return"/".concat(e.label.toLowerCase())===t}))[0]?e.meta.models.filter((function(e){return"/".concat(e.label.toLowerCase())===t}))[0].value:1;e.fetchData(a)}),[e.meta.models,e.history.location.pathname]),Object(s.jsx)(ve,Object(b.a)({},e))})),_e=a(681),Se=a(682),Ce=function(e){Object(I.a)(a,e);var t=Object(P.a)(a);function a(e){var n;return Object(A.a)(this,a),(n=t.call(this,e)).getCollapseStates=function(e){var t={};return e.map((function(e,a){return e.collapse&&(t=Object(b.a)(Object(b.a)(Object(g.a)({},e.state,n.getCollapseInitialState(e.views)),n.getCollapseStates(e.views)),t)),null})),t},n.createLinks=function(e){var t=n.props.rtlActive;return e.map((function(e,a){if(e.redirect)return null;if(e.collapse){var r={};return r[e.state]=!n.state[e.state],Object(s.jsxs)("li",{className:n.getCollapseInitialState(e.views)?"active":"",children:[Object(s.jsx)("a",{href:"#pablo","data-toggle":"collapse","aria-expanded":n.state[e.state],onClick:function(e){e.preventDefault(),n.setState(r)},children:void 0!==e.icon?Object(s.jsxs)(s.Fragment,{children:[Object(s.jsx)("i",{className:e.icon}),Object(s.jsxs)("p",{children:[t?e.rtlName:e.name,Object(s.jsx)("b",{className:"caret"})]})]}):Object(s.jsxs)(s.Fragment,{children:[Object(s.jsx)("span",{className:"sidebar-mini-icon",children:t?e.rtlMini:e.mini}),Object(s.jsxs)("span",{className:"sidebar-normal",children:[t?e.rtlName:e.name,Object(s.jsx)("b",{className:"caret"})]})]})}),Object(s.jsx)(_e.a,{isOpen:n.state[e.state],children:Object(s.jsx)("ul",{className:"nav",children:n.createLinks(e.views)})})]},a)}return Object(s.jsx)("li",{className:n.activeRoute(e.path),children:Object(s.jsx)(p.b,{to:e.path,activeClassName:"",onClick:n.props.closeSidebar,children:void 0!==e.icon?Object(s.jsxs)(s.Fragment,{children:[Object(s.jsx)("i",{className:e.icon}),Object(s.jsx)("p",{children:t?e.rtlName:e.name})]}):Object(s.jsxs)(s.Fragment,{children:[Object(s.jsx)("span",{className:"sidebar-mini-icon",children:t?e.rtlMini:e.mini}),Object(s.jsx)("span",{className:"sidebar-normal",children:t?e.rtlName:e.name})]})})},a)}))},n.activeRoute=function(e){return n.props.location.pathname===e?"active":""},n.state=n.getCollapseStates(e.routes),n}return Object(F.a)(a,[{key:"getCollapseInitialState",value:function(e){for(var t=0;t-1&&(n=new R.a(this.refs.sidebar,{suppressScrollX:!0,suppressScrollY:!1}))}},{key:"componentWillUnmount",value:function(){navigator.platform.indexOf("Win")>-1&&n.destroy()}},{key:"render",value:function(){var e=this.props,t=e.activeColor,a=e.logo,n=null,r=null;return void 0!==a&&(void 0!==a.outterLink?(n=Object(s.jsx)("a",{href:a.outterLink,className:"simple-text logo-mini",target:"_blank",onClick:this.props.closeSidebar,children:Object(s.jsx)("div",{className:"logo-img",children:Object(s.jsx)("img",{src:a.imgSrc,alt:"react-logo"})})}),r=Object(s.jsx)("a",{href:a.outterLink,className:"simple-text logo-normal",target:"_blank",onClick:this.props.closeSidebar,children:a.text})):r=Object(s.jsx)(p.b,{to:a.innerLink,className:"simple-text logo-normal",onClick:this.props.closeSidebar,children:a.text})),Object(s.jsx)("div",{className:"sidebar",data:t,children:Object(s.jsxs)("div",{className:"sidebar-wrapper",ref:"sidebar",style:{backgroundColor:"#328eb6"},children:[null!==n||null!==r?Object(s.jsx)("div",{className:"logo",style:{textAlign:"center"},children:r}):null,Object(s.jsx)(Se.a,{children:this.createLinks(this.props.routes)})]})})}}]),a}(c.a.Component),we=[{collapse:!0,name:"Nexa",icon:"fa fa-car",state:"pagesCollapse",views:[{path:"/baleno",name:"Baleno"},{path:"/ignis",name:"Ignis"},{path:"/ciaz",name:"Ciaz"},{path:"/s-cross",name:"S-Cross"},{path:"/xl6",name:"XL6"},{path:"/baleno2022",name:"Baleno 2022"},{path:"/xl62022",name:"XL6 2022"},{path:"/grandvitara2022",name:"Grand Vitara 2022"},{path:"/fronx",name:"Fronx"},{path:"/jimny",name:"Jimny"},{path:"/invicto",name:"Invicto"},{path:"/alto",name:"Alto"},{path:"/celerio",name:"Celerio"},{path:"/dzire",name:"Dzire"},{path:"/eeco",name:"Eeco"},{path:"/ertiga",name:"Ertiga"},{path:"/s-presso",name:"S-Presso"},{path:"/supercarry",name:"Super Carry"},{path:"/tourh1",name:"Tour H1"},{path:"/tourh3",name:"Tour H3"},{path:"/tourm",name:"Tour M"},{path:"/tours",name:"Tour S"},{path:"/vitarabrezza",name:"Vitara Brezza"},{path:"/wagonr",name:"WagonR"}]},{path:"/create-mapping",name:"Feature Mapping",icon:"tim-icons icon-settings"},{path:"/features",name:"Features",icon:"fa fa-cog"}],ke=a(669),Te=a(34),Ee=a(177),Ne=a(41),Ae=a(62),Fe={singleValue:function(e,t){return Object(b.a)(Object(b.a)({},e),{},{color:"red"})},option:function(e,t){return Object(b.a)(Object(b.a)({},e),{},{color:"red"})},input:function(e){return Object(b.a)(Object(b.a)({},e),{},{color:"white"})},valueContainer:function(e,t){return Object(b.a)(Object(b.a)({},e),{},{color:"red"})},container:function(e,t){return Object(b.a)(Object(b.a)({},e),{},{color:"red"})}},Ie=function(e){Object(I.a)(a,e);var t=Object(P.a)(a);function a(){var e;Object(A.a)(this,a);for(var n=arguments.length,r=new Array(n),s=0;s0){var p=e.features.find((function(t){return t.id===e.SourcefeatureId})),f=p.make,j=p.make_id,b=p.model,m=p.model_id,g=p.variant,x=p.variant_id,v=p.part,y=p.part_id;d({value:j,label:f}),O({value:y,label:v}),h({value:x,label:g}),r({value:m,label:b}),z(!0)}}else if(!1===e.source){var _=e.editFeature,S=_.make,C=_.model,w=_.variant,k=_.feature;d({label:S}),O({label:k}),h({label:w}),r({label:C})}}),[e.editFeature,e.source]);var L={make:function(e,t){var a=e.value,n=Array.from(new Set(t.filter((function(e){return e.make_id===a})).map((function(e){return e.model})))),r=[];n.map((function(e){var n=t.find((function(t){return t.make_id===a&&t.model===e})).model_id;r.push({value:n,label:e})})),d(e),y(r)},model:function(e,t,a){var n=a.value,s=e.value,i=Array.from(new Set(t.filter((function(e){return e.make_id===n&&e.model_id===s})).map((function(e){return e.part})))),c=[];i.map((function(e){var a=t.find((function(t){return t.make_id===n&&t.model_id===s&&t.part===e})).part_id;c.push({value:a,label:e})})),r(e),N(c),w([]),h(null),O(null)},feature:function(e,t,a,n){var r=a.value,s=n.value,i=e.value,c=Array.from(new Set(t.filter((function(e){return e.make_id===r&&e.model_id===s&&e.part_id===i})).map((function(e){return e.variant})))),o=[];c.map((function(e){var a=t.find((function(t){return t.make_id===r&&t.model_id===s&&t.variant===e})).variant_id;o.push({value:a,label:e})})),O(e),w(o),h(null)},variant:function(e,t,a,n,r){h(e),B(e,a,n,r)}},B=function(t,a,n,r){var s=e.features.filter((function(e,s){return e.make_id===a.value&&e.model_id===n.value&&e.part_id===r.value&&e.variant_id===t.value}));!0!==e.source?e.updateTargetFeature(s[0].id):e.updateSourceFeature(s[0].id,e.index)},U=function(t,a){var r=e.features;L[a](t,r,l,n,m)};return Object(s.jsxs)(ke.a,{action:"#",style:{margin:"10px",backgroundColor:"#292929"},children:[!0===e.source?Object(s.jsx)(Y.a,{children:Object(s.jsx)(J.a,{style:{textAlign:"end"},children:Object(s.jsx)($.a,{className:"btn-link btn-icon btn-neutral btn-icon",color:"danger",id:"tooltip707467505",size:"sm",title:"Remove",type:"button",disabled:e.view,style:{padding:10},onClick:function(){e.handleFeatureRemove(e.index)},children:Object(s.jsx)("i",{className:"tim-icons icon-simple-remove",style:{color:"red"}})})})}):null,Object(s.jsxs)(Y.a,{style:{justifyContent:"center",padding:10},children:[Object(s.jsxs)(J.a,{md:"5",children:[Object(s.jsx)("label",{children:"Make"}),Object(s.jsx)(Te.a,{children:Object(s.jsx)(Ne.a,{className:"react-select info",classNamePrefix:"react-select",name:"singleSelect",value:l,onChange:function(e){return U(e,"make")},options:I,placeholder:"Select Make",isDisabled:e.disabled,styles:at})})]}),Object(s.jsxs)(J.a,{md:"5",children:[Object(s.jsx)("label",{children:"Model"}),Object(s.jsx)(Te.a,{children:Object(s.jsx)(Ne.a,{className:"react-select info",classNamePrefix:"react-select",name:"singleSelect",value:n,onChange:function(e){return U(e,"model")},options:v,placeholder:"Select Model",isDisabled:e.disabled,styles:at})})]})]}),Object(s.jsxs)(Y.a,{style:{justifyContent:"center",padding:5},children:[Object(s.jsxs)(J.a,{md:"5",children:[Object(s.jsx)("label",{children:"Feature"}),Object(s.jsx)(Te.a,{children:Object(s.jsx)(Ne.a,{className:"react-select info",classNamePrefix:"react-select",name:"singleSelect",value:m,onChange:function(e){return U(e,"feature")},options:E,placeholder:"Select Feature",isDisabled:e.disabled,styles:at})})]}),Object(s.jsxs)(J.a,{md:"5",children:[Object(s.jsx)("label",{children:"Variant"}),Object(s.jsx)(Te.a,{children:Object(s.jsx)(Ne.a,{className:"react-select info",classNamePrefix:"react-select",name:"singleSelect",value:f,onChange:function(e){return U(e,"variant")},options:C,placeholder:"Select Variant",isDisabled:e.disabled,styles:at},f)})]})]})]})},rt=a(688),st=a(684),it=a(180),ct=function(e){var t=Object(i.useState)(),a=Object(ce.a)(t,2),n=a[0],r=(a[1],Object(i.useState)([])),c=Object(ce.a)(r,2),o=c[0],l=c[1],d=Object(i.useState)([]),u=Object(ce.a)(d,2),p=u[0],h=u[1],j=Object(i.useState)(),b=Object(ce.a)(j,2),m=b[0],O=b[1],g=Object(i.useState)(!1),x=Object(ce.a)(g,2),v=(x[0],x[1],Object(i.useState)(!1)),y=Object(ce.a)(v,2),_=y[0],S=y[1],C=Object(i.useState)(null),w=Object(ce.a)(C,2),k=w[0],N=w[1],A=(Object(it.a)(),e.history.location.pathname,Object(f.d)((function(e){return e.featureMapping}))),F=A.mappable_features,I=(A.loadingFeatues,A.error),P=A.error_msg,R=A.showModal,D=A.uploading,L=Object(f.d)((function(e){return e.features})),B=Object(f.c)();Object(i.useEffect)((function(){}),[o]),Object(i.useEffect)((function(){"/create-mapping"===e.history.location.pathname.includes&&(B(Ke()),l([]))}),[e.history.location.pathname,p]),Object(i.useEffect)((function(){if(e.edit||e.view){B(Ke());var t=e.location.state.obj,a=t.feature_id,n=t.source_features;O(a),S(!0),l([]),B(Ge(a)),l(n.map((function(e,t){return e.id})))}}),[e.edit,e.view]),Object(i.useEffect)((function(){F&&(h(F.feature.mappable_features),S(!1))}),[F]),Object(i.useEffect)((function(){if(L.feature){var e=L.feature;N(e[0].source_features),l(e[0].source_features.map((function(e,t){return e.id})))}}),[L]);var U=function(e){var t=o;t.splice(e,1),l(Object(tt.a)(t))},W=function(e,t){var a=Object(tt.a)(o);a[t]=e,l(a)};return Object(s.jsx)(s.Fragment,{children:Object(s.jsxs)("div",{className:"content",style:{backgroundColor:"#19191A"},children:[Object(s.jsx)(Y.a,{children:Object(s.jsx)(J.a,{lg:"12",children:n?Object(s.jsx)("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",flex:1},children:Object(s.jsx)(ee.a,{size:"large"})}):Object(s.jsxs)(s.Fragment,{children:[Object(s.jsxs)(K.a,{className:"ml-auto mr-auto",style:{width:"90%",backgroundColor:"#232324"},children:[Object(s.jsxs)(X.a,{style:{display:"flex",justifyContent:"space-between"},children:[Object(s.jsx)(Z.a,{tag:"h4",style:{color:"rgb(0,228,228)",fontWeight:"bold",textTransform:"capitalize"},children:"To"}),Object(s.jsx)("div",{style:{display:"flex"}})]}),Object(s.jsx)(nt,{features:e.features,makes:e.makes,source:!1,view:e.view,disabled:e.edit||e.view,editFeature:!(!e.edit&&!e.view)&&e.location.state.obj,updateTargetFeature:function(e){O(e),S(!0),B(Ge(e)),B(function(e){return function(){var t=Object(E.a)(T.a.mark((function t(a){var n;return T.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a({type:"FETCH_FEATURES_BY_ID_START"}),t.next=3,Object(M.a)("/features/?feature_id=".concat(e),"GET",{});case 3:"success"===(n=t.sent).code?a({type:"FETCH_FEATURE_BY_ID_SUCCESS",payload:n.data}):"authn_fail"===n.code?a(Object(z.d)()):a(Me(n.message));case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()}(e))}})]}),Object(s.jsxs)(K.a,{className:"ml-auto mr-auto",style:{width:"80%",backgroundColor:"#232324"},children:[Object(s.jsxs)(X.a,{style:{display:"flex",justifyContent:"space-between"},children:[Object(s.jsx)(Z.a,{tag:"h4",style:{color:"rgb(0,228,228)",fontWeight:"bold",textTransform:"capitalize"},children:"From"}),Object(s.jsx)("div",{style:{display:"flex"}})]}),_?Object(s.jsx)("div",{className:"content",style:{display:"flex",alignItems:"center",justifyContent:"center"},children:Object(s.jsx)(ee.a,{size:"large"})}):Object(s.jsx)(rt.a,{className:"todo-list",children:o.map((function(t,a){return Object(s.jsx)(st.a,{timeout:300,classNames:"item",children:Object(s.jsxs)("div",{children:[Object(s.jsx)(nt,{source:!0,features:p,sourceFeatures:k?k[a]:null,view:e.view,makes:e.makes,index:a,disabled:e.view,editFeature:!(!e.edit&&!e.view)&&e.location.state.obj,SourcefeatureId:o[a],updateSourceFeature:W,handleFeatureRemove:U},a),Object(s.jsx)("br",{style:{background:"#2d2d2d"}})]},a)},a)}))}),Object(s.jsx)(Y.a,{children:Object(s.jsx)(J.a,{style:{textAlign:"end"},children:Object(s.jsx)($.a,{className:"btn-link btn-icon btn-neutral btn-icon",color:"danger",id:"tooltip707467505",size:"sm",title:"Add",type:"button",style:{padding:15},disabled:e.view||!0===_||""===o[o.length-1],onClick:function(){!function(e){var t=o;l([].concat(Object(tt.a)(t),[""]))}()},children:Object(s.jsx)("i",{className:"tim-icons icon-simple-add",style:{fontWeight:"900",color:"yellow"}})})})})]}),Object(s.jsx)(Y.a,{style:{justifyContent:"center",padding:5},className:"mt-5",children:Object(s.jsxs)($.a,{color:"info",className:"btn-simple",disabled:!m||e.view||o.length<1,style:{color:"#33FF00",borderColor:"#33FF00",display:"flex",alignItems:"center",justifyContent:"center",width:155,height:35,margin:5},onClick:function(){B(function(e,t){var a=t.toString();return function(){var t=Object(E.a)(T.a.mark((function t(n){var r;return T.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n({type:"CREATE_FEATURE_MAPPING_START"}),t.next=3,Object(M.a)("/features/".concat(e),"PUT",{source_feature_ids:a});case 3:"success"==(r=t.sent).code?n({type:"CREATE_FEATURE_MAPPING_SUCCESS"}):"authn_fail"==r.code?n(Object(z.d)()):(n(Ye(r.message)),n(Je()));case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()}(m,o))},children:[Object(s.jsx)("i",{className:"fa fa-file-alt","aria-hidden":"true"}),Object(s.jsx)("span",{style:{marginLeft:5},children:"Submit"})]})})]})})}),I&&Object(s.jsx)(ie.a,{message:P,hide:function(){return B({type:"DISMISS_MAPPABLE_FEATURES_ERROR"})}}),R&&Object(s.jsx)(Ae.a,{uploading:D,hideModal:function(){l([]),B(Je()),e.edit&&e.history.push({pathname:"/features"})}})]})})},ot=function(e){var t=Object(f.c)(),a=Object(f.d)((function(e){return e.meta})),n=(a.error,a.error_msg,a.features),r=a.loadingMeta,c=a.makes;return Object(i.useEffect)((function(){t(H())}),[]),r?Object(s.jsx)("div",{className:"content",style:{display:"flex",alignItems:"center",justifyContent:"center"},children:Object(s.jsx)(ee.a,{size:"large"})}):Object(s.jsx)(ct,Object(b.a)(Object(b.a)({features:n,makes:c},e),{},{edit:!(!e.location.state||!e.location.state.edit),view:!(!e.location.state||!e.location.state.view)}))},lt=function(e){Object(I.a)(a,e);var t=Object(P.a)(a);function a(e){var n;return Object(A.a)(this,a),(n=t.call(this,e)).showNavbarButton=function(){document.documentElement.scrollTop>50||document.scrollingElement.scrollTop>50||n.refs.mainPanel.scrollTop>50?n.setState({opacity:1}):(document.documentElement.scrollTop<=50||document.scrollingElement.scrollTop<=50||n.refs.mainPanel.scrollTop<=50)&&n.setState({opacity:0})},n.handleActiveClick=function(e){n.setState({activeColor:e})},n.handleMiniClick=function(){document.body.classList.contains("sidebar-mini")?n.setState({sidebarMini:!1}):n.setState({sidebarMini:!0}),document.body.classList.toggle("sidebar-mini")},n.toggleSidebar=function(){n.setState({sidebarOpened:!n.state.sidebarOpened}),document.documentElement.classList.toggle("nav-open")},n.closeSidebar=function(){n.setState({sidebarOpened:!1}),document.documentElement.classList.remove("nav-open")},n.state={activeColor:"blue",sidebarMini:!0,opacity:0,sidebarOpened:!1},n}return Object(F.a)(a,[{key:"componentDidMount",value:function(){if(navigator.platform.indexOf("Win")>-1){document.documentElement.classList.add("perfect-scrollbar-on"),document.documentElement.classList.remove("perfect-scrollbar-off"),r=new R.a(this.refs.mainPanel),this.refs.mainPanel.addEventListener("ps-scroll-y",this.showNavbarButton);for(var e=document.querySelectorAll(".table-responsive"),t=0;t-1&&(r.destroy(),document.documentElement.classList.add("perfect-scrollbar-off"),document.documentElement.classList.remove("perfect-scrollbar-on"),this.refs.mainPanel.removeEventListener("ps-scroll-y",this.showNavbarButton)),window.removeEventListener("scroll",this.showNavbarButton)}},{key:"componentDidUpdate",value:function(e){if(e.location.pathname!==e.history.location.pathname){if(navigator.platform.indexOf("Win")>-1)for(var t=document.querySelectorAll(".table-responsive"),a=0;a()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(e)},e.verifyLength=function(e,t){return e.length>=t},e.compare=function(e,t){return e===t},e.verifyNumber=function(e){return!!new RegExp("^[0-9]+$").test(e)},e.verifyUrl=function(e){try{return new URL(e),!0}catch(t){return!1}},e.change=function(t,a,n,r,s){switch(n){case"email":e.verifyEmail(t.target.value)?e.setState(Object(g.a)({},a+"State","has-success")):e.setState(Object(g.a)({},a+"State","has-danger"));break;case"password":e.verifyLength(t.target.value,1)?e.setState(Object(g.a)({},a+"State","has-success")):e.setState(Object(g.a)({},a+"State","has-danger"));break;case"equalTo":e.compare(t.target.value,e.state[r])?(e.setState(Object(g.a)({},a+"State","has-success")),e.setState(Object(g.a)({},r+"State","has-success"))):(e.setState(Object(g.a)({},a+"State","has-danger")),e.setState(Object(g.a)({},r+"State","has-danger")));break;case"number":e.verifyNumber(t.target.value)?e.setState(Object(g.a)({},a+"State","has-success")):e.setState(Object(g.a)({},a+"State","has-danger"));break;case"length":e.verifyLength(t.target.value,r)?e.setState(Object(g.a)({},a+"State","has-success")):e.setState(Object(g.a)({},a+"State","has-danger"));break;case"max-length":e.verifyLength(t.target.value,r+1)?e.setState(Object(g.a)({},a+"State","has-danger")):e.setState(Object(g.a)({},a+"State","has-success"));break;case"url":e.verifyUrl(t.target.value)?e.setState(Object(g.a)({},a+"State","has-success")):e.setState(Object(g.a)({},a+"State","has-danger"));break;case"min-value":e.verifyNumber(t.target.value)&&t.target.value>=r?e.setState(Object(g.a)({},a+"State","has-success")):e.setState(Object(g.a)({},a+"State","has-danger"));break;case"max-value":e.verifyNumber(t.target.value)&&t.target.value<=r?e.setState(Object(g.a)({},a+"State","has-success")):e.setState(Object(g.a)({},a+"State","has-danger"));break;case"range":e.verifyNumber(t.target.value)&&t.target.value>=r&&t.target.value<=s?e.setState(Object(g.a)({},a+"State","has-success")):e.setState(Object(g.a)({},a+"State","has-danger"))}e.setState(Object(g.a)({},a,t.target.value))},e.loginClick=function(){""===e.state.loginEmailState&&e.setState({loginEmailState:"has-danger"}),""===e.state.loginPasswordState&&e.setState({loginPasswordState:"has-danger"}),"has-success"===e.state.loginEmailState&&"has-success"===e.state.loginPasswordState&&e.props.signIn(e.state.loginEmail,e.state.loginPassword)},e.handlePress=function(t){13===t.charCode&&e.loginClick()},e}return Object(F.a)(a,[{key:"componentDidMount",value:function(){var e=Object(E.a)(T.a.mark((function e(){return T.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,localStorage.getItem("x-auth");case 2:e.sent||this.props.auth.userToken?this.props.history.push("/baleno"):this.props.history.push("/login");case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"componentDidUpdate",value:function(){var e=Object(E.a)(T.a.mark((function e(t){return T.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.props.auth===t.auth){e.next=5;break}return e.next=3,localStorage.getItem("x-auth");case 3:e.sent||this.props.auth.userToken?this.props.history.push("/baleno"):this.props.history.push("/login");case 5:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"componentWillUnmount",value:function(){document.body.classList.toggle("login-page")}},{key:"render",value:function(){var e=this,t=this.state,a=t.loginEmailState,n=t.loginPasswordState;return Object(s.jsxs)(s.Fragment,{children:[Object(s.jsx)(Ot,{}),Object(s.jsx)("div",{className:"wrapper wrapper-full-page",ref:"fullPages",children:Object(s.jsx)("div",{className:"full-page login",children:Object(s.jsxs)("div",{className:"content",style:{backgroundColor:"#fff"},children:[Object(s.jsx)(ut.a,{children:Object(s.jsx)(J.a,{className:"ml-auto mr-auto",md:"8",children:Object(s.jsx)(ke.a,{id:"LoginValidation",children:Object(s.jsxs)(K.a,{style:{backgroundColor:"#fff",border:"0.5px solid black"},children:[Object(s.jsxs)(X.a,{children:[Object(s.jsx)(Z.a,{tag:"h3",style:{color:"#000",textAlign:"center"},children:"Content Management System"}),Object(s.jsx)(Z.a,{tag:"h4",style:{color:"#000",alignSelf:"center"},children:"Login"})]}),Object(s.jsxs)(Q.a,{children:[Object(s.jsxs)(Te.a,{className:"has-label ".concat(a),children:[Object(s.jsx)("label",{style:{color:"black",fontWeight:"500"},children:"Email Address *"}),Object(s.jsx)(pt.a,{name:"email",type:"email",style:{color:"black",background:"#fff",border:"1px solid black"},onChange:function(t){return e.change(t,"loginEmail","email")}}),"has-danger"===this.state.loginEmailState?Object(s.jsx)("label",{className:"error",children:"Please enter a valid email address."}):null]}),Object(s.jsxs)(Te.a,{className:"has-label ".concat(n),onKeyPress:this.handlePress,children:[Object(s.jsx)("label",{style:{color:"black",fontWeight:"500"},children:"Password *"}),Object(s.jsx)(pt.a,{name:"password",type:"password",autoComplete:"off",style:{color:"black",background:"#fff",border:"1px solid black"},onChange:function(t){return e.change(t,"loginPassword","password")}}),"has-danger"===this.state.loginPasswordState?Object(s.jsx)("label",{className:"error",children:"This field is required."}):null]}),Object(s.jsx)("div",{className:"category form-category",children:"* Required fields"})]}),Object(s.jsx)(ft.a,{className:"text-center",children:Object(s.jsx)($.a,{color:"#123748",onClick:this.loginClick,style:{backgroundColor:"#123748"},children:"Login"})})]})})})}),this.props.auth.error&&Object(s.jsx)(ie.a,{message:this.props.auth.error_msg,hide:function(){return e.props.dismissError()}})]})})})]})}}]),a}(c.a.Component),xt=Object(f.b)((function(e){return{auth:e.auth}}),(function(e){return{signIn:function(t,a){return e(Object(z.c)(t,a))},signOut:function(){return e(Object(z.d)())},dismissError:function(){return e(Object(z.a)())}}}))((function(e){return Object(s.jsx)(gt,Object(b.a)({},e))})),vt=Object(f.b)((function(e){return{auth:e.auth}}),(function(e){return{restoreToken:function(t,a){return e(Object(z.b)(t,a))},fetchMetaData:function(){return e(H())}}}))((function(e){return Object(i.useEffect)((function(){(function(){var t=Object(E.a)(T.a.mark((function t(){var a,n;return T.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,localStorage.getItem("x-auth");case 2:return a=t.sent,t.t0=JSON,t.next=6,localStorage.getItem("role");case 6:return t.t1=t.sent,n=t.t0.parse.call(t.t0,t.t1),t.prev=8,t.t2=JSON,t.next=12,localStorage.getItem("x-auth");case 12:if(t.t3=t.sent,!t.t2.parse.call(t.t2,t.t3)){t.next=21;break}return t.t5=JSON,t.next=17,localStorage.getItem("x-auth");case 17:t.t6=t.sent,t.t4=t.t5.parse.call(t.t5,t.t6),t.next=22;break;case 21:t.t4=null;case 22:a=t.t4,e.restoreToken(a,n),null==a&&e.hist.push("/login"),t.next=29;break;case 27:t.prev=27,t.t7=t.catch(8);case 29:case"end":return t.stop()}}),t,null,[[8,27]])})));return function(){return t.apply(this,arguments)}})()()}),[e.auth.userToken]),Object(s.jsx)("div",{className:"wrapper",style:{backgroundColor:"#19191A"},children:Object(s.jsxs)(N.d,{children:[Object(s.jsx)(N.b,{exact:!0,path:"/login",component:xt}),Object(s.jsx)(N.b,{path:"/",render:function(e){return Object(s.jsx)(dt,Object(b.a)({},e))}})]})})})),yt=(a(661),a(662),a(663),Object(u.a)()),_t=Object(h.e)(C,w(Object(h.a)(j.a)));l.a.render(Object(s.jsx)(f.a,{store:_t,children:Object(s.jsx)(p.a,{history:yt,children:Object(s.jsx)(vt,{hist:yt})})}),document.getElementById("root")),d()},75:function(e,t,a){},83:function(e,t,a){"use strict";var n=a(24),r=a(25),s=a(49),i=a(27),c=a(26),o=a(0),l=a(2),d=a.n(l),u=a(23),p=a(22),f=a(36),h=(a(136),a(137),function(e){Object(i.a)(a,e);var t=Object(c.a)(a);function a(e){var r;return Object(n.a)(this,a),(r=t.call(this,e)).state={file:null,imagePreviewUrl:null},r.handleImageChange=r.handleImageChange.bind(Object(s.a)(r)),r.handleSubmit=r.handleSubmit.bind(Object(s.a)(r)),r.handleClick=r.handleClick.bind(Object(s.a)(r)),r}return Object(r.a)(a,[{key:"handleImageChange",value:function(e){this.props.handleImages(e)}},{key:"handleSubmit",value:function(e){e.preventDefault()}},{key:"handleClick",value:function(){this.refs.fileInput.click()}},{key:"render",value:function(){var e=this;return Object(o.jsxs)("div",{className:"fileinput text-center",style:{display:"flex",alignItems:"center",justifyContent:"center"},children:[Object(o.jsx)("input",{type:"file",onChange:this.handleImageChange,ref:"fileInput",accept:"image/*"}),Object(o.jsx)(u.a,{style:{display:"flex",width:"100%"},children:this.props.images&&this.props.images.length>0?Object(o.jsxs)(u.a,{style:{display:"flex",justifyContent:"icon"==this.props.name?"flex-start":"center"},children:[this.props.images.map((function(t,a){return Object(o.jsxs)(p.a,{style:{display:"flex",flexDirection:"column",alignItems:"center"},md:4,children:[Object(o.jsx)("img",{src:t,alt:"...",width:"100%",height:"100%",style:{marginBottom:"10px"}}),Object(o.jsx)(f.a,{color:e.props.removeBtnColor,className:"btn-simple",onClick:function(){return e.props.handleRemove(t)},disabled:e.props.disabled,style:{color:"#FD1C03",borderColor:"#FD1C03",fontSize:12,display:"flex",alignItems:"center",justifyContent:"center",width:155,height:35},children:Object(o.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[Object(o.jsx)("i",{className:"fa fa-times"})," ",Object(o.jsx)("span",{style:{marginLeft:5},children:"Remove"})]})})]},a)})),"icon"!==this.props.name&&Object(o.jsx)(p.a,{style:{justifyContent:"center",alignItems:"center",display:"flex"},children:Object(o.jsxs)("div",{style:{display:"flex",flexDirection:"column",alignItems:"center"},children:[Object(o.jsx)("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",width:200,height:150},children:Object(o.jsx)("i",{className:"fa fa-cloud-upload fa-5x",style:{background:"none",color:"rgb(0,228,228)"}})}),Object(o.jsx)(f.a,{color:this.props.addBtnColor,className:"btn-simple",onClick:function(){return e.handleClick()},disabled:this.props.disabled,style:{color:"rgb(248, 186, 0)",borderColor:"rgb(248, 186, 0)",fontSize:12,display:"flex",alignItems:"center",justifyContent:"center",width:155,height:35},children:Object(o.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[Object(o.jsx)("i",{className:"fa fa-image"})," ",Object(o.jsx)("span",{style:{marginLeft:5},children:"Select Images"})]})})]})})]}):Object(o.jsxs)("div",{style:{width:"30%",display:"flex",flexDirection:"column",alignItems:"center"},children:[Object(o.jsx)("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",width:200,height:150},children:Object(o.jsx)("i",{className:"fa fa-cloud-upload fa-5x",style:{background:"none",color:"rgb(0,228,228)"}})}),(null===this.props.images||this.props.images&&0==this.props.images.length)&&Object(o.jsx)(f.a,{color:this.props.addBtnColor,className:"btn-simple",onClick:function(){return e.handleClick()},disabled:this.props.disabled,style:{color:"rgb(248, 186, 0)",borderColor:"rgb(248, 186, 0)",fontSize:12,display:"flex",width:155,height:35},children:Object(o.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[Object(o.jsx)("i",{className:"fa fa-image"})," ",Object(o.jsx)("span",{style:{marginLeft:5},children:"Select Images"})]})})]})})]})}}]),a}(d.a.Component));h.defaultProps={avatar:!1,removeBtnClasses:"btn-round",removeBtnColor:"danger",addBtnClasses:"btn-round",addBtnColor:"primary",changeBtnClasses:"btn-round",changeBtnColor:"primary"},t.a=h},89:function(e,t,a){"use strict";var n=a(24),r=a(25),s=a(27),i=a(26),c=a(0),o=a(2),l=a.n(o),d=a(7),u=a.n(d),p=a.p+"static/media/suzuki_s.dbaa51ce.png",f=a(675),h=a(676),j=a(36),b=a(685),m=a(677),O=a(18),g=a(19),x=function(e){Object(s.a)(a,e);var t=Object(i.a)(a);function a(e){var r;return Object(n.a)(this,a),(r=t.call(this,e)).updateColor=function(){window.innerWidth<993&&r.state.collapseOpen?r.setState({color:"bg-white"}):r.setState({color:"navbar-transparent"})},r.toggleCollapse=function(){r.state.collapseOpen?r.setState({color:"navbar-transparent"}):r.setState({color:"bg-white"}),r.setState({collapseOpen:!r.state.collapseOpen})},r.toggleModalSearch=function(){r.setState({modalSearch:!r.state.modalSearch})},r.state={collapseOpen:!1,modalSearch:!1,color:"navbar-transparent"},r}return Object(r.a)(a,[{key:"componentDidMount",value:function(){window.addEventListener("resize",this.updateColor)}},{key:"componentWillUnmount",value:function(){window.removeEventListener("resize",this.updateColor)}},{key:"render",value:function(){var e=this;return Object(c.jsx)(c.Fragment,{children:Object(c.jsx)(f.a,{expand:"lg",style:{backgroundColor:"#303030",position:"fixed"},children:Object(c.jsxs)(h.a,{fluid:!0,children:[Object(c.jsxs)("div",{className:"navbar-wrapper",children:[Object(c.jsxs)("div",{className:"navbar-minimize d-inline",children:[window.screen.width>450&&Object(c.jsx)("img",{src:p,width:30})," ",Object(c.jsxs)(j.a,{className:"minimize-sidebar btn-just-icon",color:"link",id:"tooltip209599",onClick:this.props.handleMiniClick,children:[Object(c.jsx)("i",{className:"tim-icons icon-double-left visible-on-sidebar-regular"}),Object(c.jsx)("i",{className:"tim-icons icon-double-right visible-on-sidebar-mini"})]}),Object(c.jsx)(b.a,{delay:0,target:"tooltip209599",placement:"right",children:"Sidebar toggle"})]}),Object(c.jsx)("div",{className:u()("navbar-toggle d-inline",{toggled:this.props.sidebarOpened}),children:Object(c.jsxs)("button",{className:"navbar-toggler",type:"button",onClick:this.props.toggleSidebar,children:[Object(c.jsx)("span",{className:"navbar-toggler-bar bar1"}),Object(c.jsx)("span",{className:"navbar-toggler-bar bar2"}),Object(c.jsx)("span",{className:"navbar-toggler-bar bar3"})]})}),Object(c.jsx)(m.a,{href:"#pablo",style:{fontWeight:"600"},onClick:function(e){return e.preventDefault()},children:this.props.brandText})]}),Object(c.jsxs)("div",{children:[Object(c.jsx)("a",{onClick:function(){return e.props.signOut()},children:Object(c.jsx)("i",{className:"fa fa-power-off fa-lg","aria-hidden":"true",style:{color:"#d13400",marginRight:5}})})," "]})]})})})}}]),a}(l.a.Component);t.a=Object(O.b)(null,(function(e){return{signOut:function(){return e(Object(g.d)())}}}))(x)}},[[664,1,2]]]); //# sourceMappingURL=main.115ef0fc.chunk.js.map