1"use strict";(self.__LOADABLE_LOADED_CHUNKS__=self.__LOADABLE_LOADED_CHUNKS__||[]).push([[2983],{27067(e,t,s){s.d(t,{A:()=>u});var i=s(73620),a=s(96540),o=s(5556),n=s.n(o),r=s(56347);const d="QIbU3H_SaslyuTTisM6w",l="nG5HCILT7DDV99jS0bqq",c="e1hTGifKbyVMYTCLKBjw",p="NJ9qCFN9NLi4hIotMWMJ";class h extends a.Component{constructor(e){super(e);let t=0;const s=new URLSearchParams(this.props.location.search).get("tab");"string"!=typeof s||isNaN(s)||(t=parseInt(s)),this.state={selected_tab:t}}changeTab(e){this.setState({selected_tab:e}),"undefined"!=typeof window&&window.history.pushState("","","?tab="+e)}render(){const{titles:e,tabs:t,className:s}=this.props,{selected_tab:a}=this.state;let o=[];for(let s=0;s<t.length;s++)o.push((0,i.A)("li",{onClick:()=>{this.changeTab(s)},className:a===s?p:""},s,e[s]));const n=t[a],r=s?d+" "+s:d;return(0,i.A)("div",{className:r},void 0,(0,i.A)("div",{className:l},void 0,(0,i.A)("ul",{className:c},void 0,o)),(0,i.A)("div",{},a,n))}}h.propTypes={titles:n().arrayOf(n().node).isRequired,tabs:n().arrayOf(n().element).isRequired,className:n().string};const u=(0,r.y)(h)},54479(e,t,s){s.d(t,{A:()=>I});var i=s(73620),a=(s(96540),s(63710));s(69733);const o="SnfPBqglyLJzSMYS_Vxn",n="HFtS740JasGaUxO0W9rs",r="EqKpQzgP4d5TWHTvuxCT",d="tXI22bNGQJjVm7rBiWCj",l="vPj5eS30wzoyvFSIF1cD",c="oUFiUOK9rLtRsOMQiZsM",p="N73ngDXZEbC3Mk7cg4it",h="mI1LV1BQ6k4uFJf0IorZ";s(10233);var u=s(28097),A=s(67210),v=s(55023),m=s(40424),_=(s(2598),s(97173),s(54150),s(29921)),b=s(84759),g=s(60008),f=s(39782),y=s(51930),C=s(63306),N=s(267),S=(0,i.A)(y.A,{}),x=(0,i.A)(g.A,{});class w extends u.A{render(){const{instance:e,errors:t,is_saving:s,saved:a}=this.state,{t:u}=this.props;if(e){const a=(0,C.Ks)(N.vQ);let p=[];return e.subcategories&&(p=e.subcategories.reduce((e,s,a)=>(s.delete||e.push((0,i.A)(A.A,{values:s,errors:void 0!==t.subcategories?t.subcategories[a]:void 0,handleChange:e=>{this.updateScalableField("subcategories",a,e)},handleSubmit:this.handleSubmit.bind(this)},a,(0,i.A)("div",{className:n},void 0,(0,i.A)(v.A,{name:"name",placeholder:u("Subcategory"),className:r}),(0,i.A)("div",{},void 0,(0,i.A)("i",{className:d+" fa fa-times "+l,onClick:()=>{this.setDeleteScalableField("subcategories",a)}}))))),e),[])),(0,i.A)("div",{},void 0,(0,i.A)(A.A,{values:e,errors:t,handleChange:this.handleChange.bind(this),handleSubmit:this.handleSubmit.bind(this)},void 0,(0,i.A)("fieldset",{className:o},void 0,(0,i.A)("legend",{},void 0,u("Basic Information")),(0,i.A)(v.A,{name:"name",placeholder:u("Name"),label:u("Name")}),(0,i.A)(m.A,{name:"description",placeholder:u("Description"),label:u("Description"),rows:4,maxLength:240}),a&&(0,i.A)("div",{className:h},void 0,(0,i.A)(f.A,{name:"show_on_website",value:{active:!0,inactive:!1},label:u("Show on Website?")})))),(0,i.A)("fieldset",{className:o},void 0,(0,i.A)("legend",{},void 0,u("Subcategories")),p,(0,i.A)(b.A,{onClick:()=>{this.addScalableFields("subcategories")},theme:"primary_full"},void 0,u("Add Subcategory"))),(0,i.A)(A.A,{values:e,errors:t,handleChange:this.handleChange.bind(this),handleSubmit:this.handleSubmit.bind(this)},void 0,(0,i.A)("fieldset",{className:o},void 0,s?S:(0,i.A)("div",{className:c},void 0,(0,i.A)(_.A,{type:"submit",theme:"submit"},void 0,u("Save")),x))))}return(0,i.A)("div",{className:p})}}const I=(0,a.CI)("app")(w)},72010(e,t,s){s.d(t,{A:()=>g});var i=s(73620),a=(s(96540),s(63710));s(44913);const o={column:"ym6C4LlkSnZvpDKlMHJc",form_group:"u6QUZp7bWoOP67tihXkD",fieldset:"avq1giZcNsKGKgvfd_FF",flex_row:"WT8lQ3xxNGkoWLHpIVpA",flex_1:"bbyBD1kkdBORarbekzm5",field_70:"_ZMu2IeXIkNLvXulR0s2",field_30:"HP_ZHYLsB8o_DuvHRymd",checkbox_grid:"wr27hZG9GGYuv3XMYczN",feature_toggle_note:"vWNOTTTuj15opgyunaOy",half:"DkNIvYHt87gQUdsHf6F5",third:"j1arW1f8UqMvx8yvBGgW",twothirds:"qckCZ4ieAt3p1bCuECX9",instructions:"EXms156p7STWO5HuJrxH",price:"TE15rlWZyFCTKsUK2V0v",currency:"vuSAYZrXuHR1lEb_sw1o",button_clear:"QJUBmQGFIldX49vspKNP",button_clear_big:"EiD9tD9_SgyPBxcPw_oT",error:"yEUGSflpGDYNZ4hoFVh5",actions:"ElWQt7Shum2aa5XXepxo",submit_button:"NPaK4DPy8OlAVq0uAxtM",modal_submit_button:"Hm54owzmwQ
1DQnkh1ui7d",loading_overlay:"n37DmH0m0JncgxWvbt35",loader:"cbLec1GDFtg3OO2Hruvq",action_button_position:"h9oCupQVa06TYDle90Uh",coupon_code:"N_mvtIs8SbLGUsj_wpSB",expiration_message:"_8FlcCRoepFpkqgRfj9it"};var n=s(28097),r=s(67210),d=s(55023),l=s(29921),c=s(42888),p=s(97173),h=s(54150),u=s(60008),A=s(51930),v=s(12901),m=(0,i.A)(u.A,{}),_=(0,i.A)(A.A,{});class b extends n.A{constructor(e){super(e),this.state={instance:{},display_date:!1}}render(){const{instance:e,errors:t,is_saving:s,saved:a}=this.state,{t:n}=this.props,u=void 0===e.external_id;let A;return u&&(A=(0,i.A)(l.A,{type:"submit",theme:"submit"},void 0,n("Save"))),e?(0,i.A)("fieldset",{className:o.form_group},void 0,(0,i.A)(r.A,{values:e,errors:t,handleChange:this.handleChange.bind(this),handleSubmit:this.handleSubmit.bind(this)},void 0,void 0!==t&&void 0!==t.error&&(0,i.A)("div",{className:o.error},void 0,t.error),(0,i.A)("div",{className:o.coupon_code},void 0,(0,i.A)(d.A,{name:"code",placeholder:n("Coupon Code"),label:n("Coupon Code"),disabled:!u})),(0,i.A)("div",{className:o.row},void 0,(0,i.A)(h.A,{name:"discount_type",label:n("Type of Discount"),className:o.half,disabled:!0},void 0,(0,i.A)("option",{value:v.me},void 0,n("Percentage"))),(0,i.A)(d.A,{name:"discount_rate",placeholder:n("Coupon Amount"),label:n("Coupon Amount"),className:o.half,type:"number",disabled:!u})),(u||void 0!==e.name)&&(0,i.A)(d.A,{name:"description",placeholder:n("Description"),label:n("Coupon Description"),disabled:!u}),(0,i.A)(c.A,{name:"from_date",label:n("Starting Date"),placeholder:n("Starting Date"),disabled:!u}),u&&(0,i.A)(p.A,{name:"expires",label:n("Set expiration date"),toggle:!0,value:!0}),e.expires?(0,i.A)(c.A,{name:"to_date",label:n("Expiration Date"),placeholder:n("None"),disabled:!u}):(0,i.A)("p",{className:o.expiration_message},void 0,n("This coupon will remain valid until deleted.")),!u&&(0,i.A)("div",{className:o.action_button_position},void 0,m),s?_:A)):(0,i.A)("div",{className:o.loading_overlay})}}const g=(0,a.CI)("app")(b)},27798(e,t,s){s.d(t,{A:()=>C});var i=s(73620),a=(s(96540),s(63710)),o=s(69733);const n="BWwjN2NBYgnnEH6UP1XU",r="KClI1Z_mxZftd9HFyUgH";s(10233);var d=s(28097),l=s(82960),c=s(80930),p=s(76808);const h=(0,p.t)("settings","subscriber_locations",(e,t)=>({...e,title:e.title,subtitle:e.address?e.address:""})),u=(0,a.CI)("app")(p.A),A=(0,o.Ng)(h,e=>(0,l.zH)({fetchList:c.vG},e))(u);var v=s(67210),m=s(55023),_=(s(40424),s(2598),s(97173),s(54150),s(29921)),b=s(34001),g=s(51930),f=(0,i.A)(g.A,{});class y extends d.A{openLocationModal(){this.setState({show_location_modal:!0})}closeLocationModal(e){void 0!==e&&this.setFields({location:e}),this.setState({show_location_modal:!1})}render(){const{instance:e,errors:t,is_saving:s,saved:a,show_location_modal:o}=this.state,{t:d}=this.props;return e?(0,i.A)("div",{},void 0,(0,i.A)("fieldset",{className:n},void 0,(0,i.A)("legend",{},void 0,d("Basic Information")),(0,i.A)(v.A,{values:e,errors:t,handleChange:this.handleChange.bind(this),handleSubmit:this.handleSubmit.bind(this)},void 0,(0,i.A)(m.A,{name:"description",placeholder:d("Description"),label:d("Description")}),(0,i.A)(b.A,{name:"location",titleKeys:["title","address"],label:d("Location"),placeholder:d("Select Location"),onClick:this.openLocationModal.bind(this),handleClear:()=>{this.setFields({location:void 0})}}),s?f:(0,i.A)(_.A,{type:"submit",theme:"submit"},void 0,d("Save"))),(0,i.A)(A,{show_modal:o,handleClose:this.closeLocationModal.bind(this),title:d("Locations")}))):(0,i.A)("div",{className:r})}}const C=(0,a.CI)("app")(y)},26069(e,t,s){s.d(t,{A:()=>Ut});var i=s(73620),a=s(96540),o=s(5556),n=s.n(o),r=s(63710),d=s(69733);const l="wI9V2la1DNf1y8edlZd3",c="KozWC_j8u03uzsRV35OV",p="ySN2YSzq_COvXPrvivML",h="W3xu8VTKl9KGUOAPFBVe",u="WPunvNOSY9BkbhMD9BcV",A="oZo0hdkfxjiZFK0LIFAQ",v="n16R8SD_IhucX4i3RVRy",m="nMlrH4uiXn3IcFhGu02T",_="IXbE2rj4zxA6Ey9WxcXG",b="ZW_k6PrSjdgIRwWz5oKT",g="yVID_wbbzEz_U83kmZvs",f="JqIyttbFDYo_UfFkaEiI",y="ZyFYQWwexfZ2VteilEBi",C="Zt5Z97YFqkgJFl3LgzVG",N="Q6XisdmIVAIoOJch2xVP",S="lRZVY4agOHoJzgcZhE9W",x="rG92QVRgVhqDCvVPPeAm",w="bIxVsnn9d6vScsZRmnrT",I="tjgHUIbwcYBUIAcy4aqm",k="Tg83s7Q7eLJ9T7b5Cx_4",T="u0oU4SPQYwsAORB1qFR0",D="_BCHHvFMwj_dKWLJIBDg",M="qxXENXRDUnsmavBleZ_C",R="QG7McNMtUhzTbVmHiBNJ",P="E1yccA3gSOQdH8B_VHYU",L="XlN_4INcHuXUnGcnJtp1",F="IVwBx3jfPKHKdWzi0TJu",O="auzyCYIa_GXTwxVRWUWh",q="Ob5ynngU59ghpiXY4g4f",B="t5iS9bwf1uEUIK4P56SB",E="Duzx61Kq5BNLeTj2LSzd",H="dpG4D4yyrCgpx_fokw6L",V="auXF69UiBYLvs1PFo9OT",Q="iXGBoOZRjm0BAn95veQj",W="zixfjpcqmPgyJQ6AG7LP",K="bHhdwgf5sFBPQTQvkU2w",Z="RCFtwcU4ArfiAWtG7wT6",U="gN4A6ivAtAX4Fq4Ol0hI",z="rt4nLxD9DyiYkpriKCMN",j="xhvnp7A9TgKzTXwZet3c",X="Lw7ZokEgwu7yhp8O6jJ6",Y="FhWIZ7ptA7D8WXFEtwxu",J="xGFu0nombfDHIq3QtYWa",G="Sc2yj7klB5b5cfXNSOwK";var $=s(27067),ee=s(53028),te=s(79167);const se="kC8RZidAcfi4cv1noiCa",ie="v4_WJp7LoxFidozvomQl",ae="MESnOgN_7HD0scixeF4K",oe="J9hYRVxAz5sgDO1ZPqJM",ne="ymLd0J4FDM47XWDIOQJp",re="dgvXEEimsK3QPzvWSMPf";var de=s(67210),le=s(55023),ce=s(40424),pe=s(2598),he=s(97173),ue=s(54150),Ae=s(39782),ve=s(29921),me=s(84759),_e=s(62193);class be extends a.Component{constructor(e){super(e),this.state={}}getProductOptionI(e,t){const{product_option_types:s}=this.props;for(let i=0;i<s.length;i++){const a=s[i];if(a.external_id==e){if(!a.product_options)break;for(let e=0;e<a.product_options.length;e++){if(a.product_options[e].id==t)return e}break}}}UNSAFE_componentWillReceiveProps(e){!this.props.show_modal&&e.show_modal&&this.setState((t,s)=>{let i={...e.instance};const{product_options:a}=i;if(a)for(let e=0;e<a.length;e++){const t=a[e],{product_option_type:s}=t,o=this.getProductOptionI(s.external_id,t.id);i["product_option_"+s.external_id]=o}return{instance:i,errors:e.errors}})}handleChange(e,t){this.setState({instance:e})}handleClose(e){const{product_option_types:t}=this.props,{instance:s}=this.state,{t:i}=this.props;let a=!1,o={errors:[]};void 0!==s.price&&""!==s.price||(a=!0,o.price=i("Valid Price is required")),void 0!==s.code&&""!==s.co
1de||(a=!0,o.code=i("Valid Code is required"));const n={...s};if(t){let e=[];for(let s=0;s<t.length;s++){const r=t[s],d="product_option_"+r.external_id,l=n[d];if(delete n[d],void 0!==l){const t=r.product_options[l];e.push({...t,product_option_type:r})}else a=!0,o[d]=i("Select Option")}n.product_options=e}if(e)n.delete=!0,this.props.handleClose(n);else{if(a)return void this.setState({errors:o});this.props.handleClose(n)}}handleSubmit(){this.handleClose()}handleDelete(){this.handleClose(!0)}render(){const{selected_currency:e,product_option_types:t,product_type:s}=this.props,{instance:o,errors:n}=this.state,{t:r}=this.props;let d,l;if(t){const e=t.length>1?ie:"";d=t.map((t,s)=>{let a;return t.product_options&&(a=t.product_options.map((e,t)=>(0,i.A)("option",{value:t},e.id,e.name))),(0,i.A)(ue.A,{name:"product_option_"+t.external_id,label:t.name,className:e},t.external_id,(0,i.A)("option",{},-1,r("Select Value")),a)})}return n&&n.errors&&(l=n.errors.map((e,t)=>(0,i.A)("p",{className:ne},t,e))),a.createElement(te.default,this.props,l,(0,i.A)("fieldset",{className:se},void 0,(0,i.A)(de.A,{values:o,errors:n,handleChange:this.handleChange.bind(this),handleSubmit:this.handleSubmit.bind(this)},void 0,d)),(0,i.A)("fieldset",{className:se},void 0,(0,i.A)("legend",{},void 0,r("Product Version")),(0,i.A)(de.A,{values:o,errors:n,handleChange:this.handleChange.bind(this),handleSubmit:this.handleSubmit.bind(this)},void 0,(0,i.A)(le.A,{name:"code",placeholder:r("Code"),label:r("Code")}),(0,i.A)(ue.A,{name:"currency",label:r("Price"),className:oe,disabled:!0},void 0,(0,i.A)("option",{},void 0,e.alphabetic_code)),(0,i.A)(le.A,{name:"price",placeholder:r("Price"),label:"Â ",className:ae}),s==_e.jt&&(0,i.A)(le.A,{name:"weight",placeholder:r("Weight (Kg)"),label:r("Weight (Kg)")}),s==_e.er&&(0,i.A)(le.A,{name:"product_version_downloadable",placeholder:r("Digital Product Link"),label:r("Digital Product Link")}),(0,i.A)("div",{className:re},void 0,(0,i.A)(Ae.A,{name:"is_default",value:{active:!0,inactive:!1},label:r("Default/Main Version")})),(0,i.A)(ve.A,{type:"submit",theme:"submit"},void 0,r("Edit")),(0,i.A)(me.A,{theme:"submit_danger",onClick:this.handleDelete.bind(this)},void 0,o&&o.external_id?r("Delete"):r("Discard")))))}}be.defaultProps={...te.default.defaultProps},be.propTypes={...te.default.propTypes};const ge=(0,r.CI)("app")(be);var fe=s(2972),ye=s(6632),Ce=s(62168),Ne=s(82960),Se=s(57248),xe=s(76808);const we=(0,xe.t)("products","product_option_types",(e,t)=>({...e,id:e.external_id,title:e.name})),Ie=(0,r.CI)("app")(xe.A),ke=(0,d.Ng)(we,e=>(0,Ne.zH)({fetchList:Se.wS},e))(Ie);var Te=s(62138),De=s(58168),Me=s(44913);class Re extends a.Component{render(){const e=`products/${this.props.category_id}/categories/subcategories/`;return a.createElement(xe.A,(0,De.A)({},this.props,{endpoint_override:e}))}}Re.propTypes={...xe.A.propTypes,category_id:n().oneOfType([n().string,n().number]).isRequired};const Pe=(0,xe.t)("products","subcategories",(e,t)=>({...e,id:e.id,title:e.name})),Le=(0,r.CI)("app")(Re),Fe=(0,d.Ng)(Pe,e=>(0,Ne.zH)({fetchList:Se.PS},e))(Le);var Oe=s(22101),qe=s(40961),Be=s(20181),Ee=s.n(Be),He=s(51930);const Ve="NxS08IoNG6E8B_WH8MwH",Qe="aC3HJlbX2MQNn0QOq6SM",We="T9x8Bm2DB2JzeItBlUhA",Ke="m_Ud4rv9Z5DYH6oNRBmh",Ze="Y5GwW18ppfymiDybUS8V";var Ue=(0,i.A)("div",{},void 0,(0,i.A)(He.A,{}));class ze extends a.Component{constructor(e,t){super(e),this.state={instance:{cabys_category_list:[]}}}UNSAFE_componentWillReceiveProps(e){const{should_fetch:t}=this.props;let s=this.state.instance.cabys_category_list;this.props.is_fetching&&e.fetched?(s.push(e.list),this.setState(e=>({instance:{...e.instance,cabys_category_list:s}}))):!t&&e.should_fetch&&(this.setState(e=>({instance:{cabys_category_list:[]}})),this.props.fetchList({query:{cabys_category_id:void 0},temp_list:!0}))}fetchOnChange(e){this.props.fetchList({query:{cabys_category_id:e},temp_list:!0})}callChange(e){const{values:t,handleChange:s,handleCategoryChange:i}=this.props,a={...t},o=e.target.value,n=e.target.name,r=parseInt(e.target.getAttribute("data-index")),d=_e.lu-1;let l=a.cabys_category_ids_list;r<this.state.instance.cabys_category_list.length-1&&(this.cleanCabysCategoryList(r),l=this.cleanCabysCategoryIdsList(r,l,o)),""!==o&&r<d&&this.fetchOnChange(o),""!==o&&(l?l.push(o):l=[o]),s({...t,cabys_category_ids_list:l},n),this.handleSelectChange(n,o),i(l)}handleSelectChange(e,t){this.setState(s=>({instance:{...s.instance,[e]:t}}))}cleanCabysCategoryList(e){const{instance:t}=this.state;let s={...t},i=s.cabys_category_list.length-(e+1);void 0!==t.cabys_category_list&&(s.cabys_category_list.splice(e+1,i),this.setState({instance:s}))}
1cleanCabysCategoryIdsList(e,t,s){const{instance:i}=this.state;let a={...i};if(""===s)return t.splice(e-1,e);{const s=a.cabys_category_list.length-(e+1);return t.splice(e+1,s)}}render(){const{is_fetching:e,fetched:t}=this.props,{instance:s}=this.state,{t:a}=this.props;let o;return!e&&t&&s.cabys_category_list.length>0&&(o=s.cabys_category_list.map((e,t)=>{const o="cabys_category_"+t;let n=void 0!==s[o]?s[o]:"",r=e.map((e,t)=>(0,i.A)("option",{value:e.id},e.code,e.name));return r.unshift((0,i.A)("option",{value:""},-1,a("All"))),(0,i.A)("div",{className:Qe},void 0,(0,i.A)("label",{className:Ve},void 0,a("Category {{n}}",{n:t+1}),(0,i.A)("div",{className:We},void 0,(0,i.A)("select",{onChange:this.callChange.bind(this),className:Ke,name:"cabys_category_"+t,value:n,"data-index":t},t,r),(0,i.A)("span",{className:Ze}))))})),(0,i.A)("div",{},void 0,e?Ue:(0,i.A)("div",{},void 0,o))}}ze.propTypes={...ue.A.propTypes,name:n().string,values:n().object.isRequired,handleChange:n().func.isRequired,handleCategoryChange:n().func.isRequired,should_fetch:n().bool};const je=(0,xe.t)("products","cabys_categories",(e,t)=>e),Xe=(0,r.CI)("app")(ze),Ye=(0,d.Ng)(je,e=>(0,Ne.zH)({fetchList:Se.XW},e))(Xe),Je="W_NyOFjM4rWBkzlo8_Sl",Ge="c1AbfQFydBU9aGTGnG3N",$e="rLgDmujkKf0KRzq_yckI",et="KsO7v9eHQtYANif0y7Q2",tt="cYpX4BJI_gJ6vTIv3n7I",st="N5rAu4B_pkRyWjSLHnDf",it="dccMuJ_O72_CksdRxAXX",at="DrEmECa3lSzgj13H7xKn",ot="k92Pdm_3AjzV2IDdMwq7",nt="MUoZQr_sApkxVVbCiuBA",rt="V7Rfe8XbfNLP6Juf2eFg",dt="XVsHfwixAxNLB0fxgXEA",lt="wwCJOh3yZwqMqz9GVSDs",ct="CaQto48S67usPJDA8xRq",pt="iX1R40Hc7aO44PYCzqQD",ht="OQuaSFUetoBK6lMDJ7TF";var ut=(0,i.A)(He.A,{}),At=(0,i.A)("i",{className:"fa fa-times"});class vt extends xe.A{constructor(e,t){super(e),this.state={selected_items:[],search:"",cabys_category_ids_list:[],show_open_message:!0,list:[]},this.debounced_fetchList=Ee()(e.fetchList,300)}UNSAFE_componentWillReceiveProps(e){const{list:t}=this.state,{is_fetching:s,show_modal:i}=this.props;if(s&&e.fetched){let s=this.mergeLists(t,e.list);"function"==typeof this.cleanList&&(s=this.cleanList(s)),this.setState({list:s,show_open_message:!1})}this.toggleEventListeners(i,e.show_modal)}handleSearchChange(e){this.debounced_fetchList({query:{search:""!==e.target.value?e.target.value:void 0,cabys_category_ids_list:this.state.cabys_category_ids_list},temp_list:!0});const{selected_items:t}=this.state;let s;const i=this.state.list.reduce((e,i,a)=>("number"==typeof t?t==a&&(s=e.length,e.push(i)):void 0!==t&&(void 0===s&&(s=[]),t.includes(a)&&(s.push(e.length),e.push(i))),e),[]);this.setState({query:e.target.value,selected_items:s,list:i})}handleCategoryChange(e){this.setState({list:[]}),this.props.fetchList({query:{search:""!==this.state.query?this.state.query:void 0,cabys_category_ids_list:e},temp_list:!0})}loadMoreResults(){const{pagination_offset:e}=this.props;this.props.fetchList({update_list:!0,temp_list:!0,offset:e,query:{search:""!==this.state.query?this.state.query:void 0,cabys_category_ids_list:this.state.cabys_category_ids_list}})}resetModal(){this.setState({selected_items:[],search:"",cabys_category_ids_list:[],list:[],query:"",show_open_message:!0})}render(){const{show_modal:e,title:t,multiple:s,is_fetching:o,fetched:n,pagination_available:r}=this.props,{selected_items:d,list:l,show_open_message:c}=this.state,{t:p}=this.props,h=e?Ge:"",u=void 0!==d&&"number"==typeof d;let A,v=!1;return c?A=(0,i.A)("li",{},-1,(0,i.A)("h4",{className:pt},void 0,p("Search for a code using the product/service name or CABYS number (if you know it already).")),(0,i.A)("h5",{className:pt},void 0,p("If you don't know what you are looking for, use the category filters to view all available choices."))):void 0!==l&&l.length>0?(v=!0,A=l.map((e,t)=>{if(void 0!==e)return s?(0,i.A)("label",{},e.code,(0,i.A)("li",{},void 0,(0,i.A)(he.A,{name:"selected_items",value:t}),(0,i.A)("span",{className:ct}),(0,i.A)("h4",{},void 0,e.title),(0,i.A)("p",{},void 0,e.subtitle))):(0,i.A)("label",{},e.id,(0,i.A)("li",{},void 0,(0,i.A)(pe.A,{name:"selected_items",value:t}),(0,i.A)("span",{className:ct}),(0,i.A)("h4",{},void 0,e.title),(0,i.A)("p",{},void 0,e.subtitle)))})):o?A=(0,i.A)("li",{className:lt},-1,ut):n&&(A=(0,i.A)("li",{},-1,(0,i.A)("h4",{className:pt},void 0,p("No results. Try changing the search parameters.")))),qe.createPortal((0,i.A)("div",{className:Je+" "+h},void 0,(0,i.A)("div",{className:$e,onClick:this.handleClose.bind(this)}),(0,i.A)("div",{className:et},void 0,(0,i.A)("div",{className:tt,onClick:this.handleClose.bind(this)},void 0,At),(0,i.A)("h3",{className:st},void 0,t),(0,i.A)("div",{className:at},void 0,(0,i.A)("div",{className:ot},void 0,(0,i.A)("div",{className:rt},void 0,a.createElement("input",{type:"text",placeholder:p("Search"),onChange:this.handleSearchChange.bind(this),value:this.state.query,ref:this.setInputRef.bind(this)})),(0,i.A)(Ye,{values:this.state,handleChange:this.handleChange.bind(this),handleCategoryChange:this.handleCategoryChange.bind(this),should_fetch:e})),(0,i.A)("div",{className:nt},void 0,(0,i.A)("div",{className:it},void 0,(0,i.A)(de.A,{values:this.state,handleChange:this.handleChange.bind(this),handleSubmit:this.handleSubmit.bind(this)},void 0,(0,i.A)("ul",{className:dt},void 0,A,r&&!o&&n&&!c&&(0,i.A)("li",{className:lt},-2,(0,i.A)(me.A,{type:"button",theme:"primary_full",onClick:this.loadMoreResults.bind(this)},void 0,p("More Results")))),(0,i.A)("div",{className:ht},void 0,(0,i.A)(me.A,{onClick:this.handleClose.bind(this)},void 0,p("Cancel")),(0,i.A)(ve.A,{type:"submit",disabled:!u},void 0,p("Select"))))))))),this.el)}}vt.propTypes={...xe.A.propTypes};const mt=(0,xe.t)("products","cabys_codes",(e,t)=>({...e,id:e.id,title:e.name,subtitle:e.code})),_t=(0,r.CI)("app")(vt),bt=(0,d.Ng)(mt,e=>(0,Ne.zH)({fetchList:Se.p9},e))(_t),gt=(0,xe.t)("products","registration_categories",(e,t)=>({...e,title:e.name,subtitle:`Cod. ${e.code}`})),ft=(0,r.CI)("app")(xe.A),yt=(0,d.Ng)(gt,e=>(0,Ne.zH)({fetchList:Se.mn},e))(ft);var Ct=s(28097),Nt=s(44399),St=s(60008),xt=s(34001),wt=s(55882),It=s(63306),
1kt=s(267),Tt=s(85636),Dt=s(79141),Mt=(s(43505),s(75897)),Rt=(0,i.A)(He.A,{}),Pt=(0,i.A)(St.A,{}),Lt=(0,i.A)("i",{className:"fa fa-star"}),Ft=(0,i.A)("i",{className:"fa fa-star"}),Ot=(0,i.A)("i",{className:"fa fa-times"}),qt=(0,i.A)("i",{className:"fa fa-star"}),Bt=(0,i.A)("i",{className:"fa fa-star-o"}),Et=(0,i.A)("br",{}),Ht=(0,i.A)("br",{}),Vt=(0,i.A)("i",{className:"fa fa-info-circle"}),Qt=(0,i.A)("legend",{},void 0,"Â "),Wt=(0,i.A)("i",{className:"fa fa-info-circle"}),Kt=(0,i.A)(He.A,{});class Zt extends Ct.A{openSupplierModal(){this.setState({show_supplier_modal:!0})}closeSupplierModal(e){void 0!==e&&this.setFields({supplier:e}),this.setState({show_supplier_modal:!1})}openCategoryModal(e){this.setState({show_category_modal:!0})}closeCategoryModal(e){void 0!==e&&this.addScalableFields("category",e),this.setState({show_category_modal:!1})}openProductOptionTypeModal(e){this.setState({show_product_option_type_modal:!0})}closeProductOptionTypeModal(e){void 0!==e&&this.addScalableFields("product_option_types",e),this.setState({show_product_option_type_modal:!1})}openTaxModal(){this.setState({show_tax_modal:!0})}closeTaxModal(e){void 0!==e&&this.addScalableFields("taxes",e),this.setState({show_tax_modal:!1})}openInventoryModal(e){this.setState({show_inventory_modal:!0,selected_product_version_i:e})}closeInventoryModal(e){const{selected_product_version_i:t}=this.state;void 0===t?(e&&this.addScalableFields("inventories",e),this.setState({show_inventory_modal:!1,selected_product_version_i:void 0})):this.setState((s,i)=>{let a={show_inventory_modal:!1,selected_product_version_i:void 0};return e&&(a.instance={...s.instance,product_versions:s.instance.product_versions.map((s,i)=>{if(t!=i)return s;let a={...s};return void 0!==a.inventories?a.inventories=[...a.inventories,...e]:a.inventories=[...e],a})}),a})}handleInventoryModalChange(e,t,s){this.setState((i,a)=>{let o={...i.instance},n={...o.product_versions[e]};return n.inventories[t]=s,o.product_versions[e]=n,{instance:o}})}openProductVersionModal(e){this.setState({show_product_version_modal:!0,selected_product_version_i:e})}closeProductVersionModal(e){const t=!!e;let s,i;if(t&&(s=e.is_default,i=e.delete),t&&!i){const{selected_product_version_i:t}=this.state;void 0!==t?this.updateScalableField("product_versions",t,e):this.addScalableFields("product_versions",e)}this.setState((e,a)=>{let o={show_product_version_modal:!1,selected_product_version_i:void 0};if(t&&(s||i)){let{selected_product_version_i:t}=e,a={...e.instance},n=!0;if(null==t&&(t=a.product_versions?a.product_versions.length-1:0,n=!1),i){if(n){a.product_versions[t].external_id?a.product_versions[t]={...a.product_versions[t],delete:!0}:a.product_versions.splice(t,1)}}else s&&(a.product_versions=a.product_versions.map((e,s)=>s==t?e:{...e,is_default:!1}));o.instance=a}return o})}openCabysCodeModal(){this.setState({show_cabys_code_modal:!0})}closeCabysCodeModal(e){void 0!==e&&this.setFields({cabys_code:e}),this.setState({show_cabys_code_modal:!1})}openRegistrationCategoryModal(){this.setState({show_registration_category_modal:!0})}closeRegistrationCategoryModal(e){void 0!==e&&this.setFields({registration_category:e}),this.setState({show_registration_category_modal:!1})}deleteImage(e){this.setState((t,s)=>{let i={...t.instance};return i.images=[...t.instance.images],void 0===i.delete_images&&(i.delete_images=[]),i.delete_images.push(i.images[e].id),i.images.splice(e,1),{instance:i}})}setAsMain(e){this.setState((t,s)=>{let i,a;return void 0!==t.instance.images&&(i=t.instance.images.map((t,s)=>{let i=!1;return s==e&&(i=!0,a=t.id),{...t,is_main:i}})),{instance:{...t.instance,images:i,set_main:a}}})}closeSubcategoryModal(e,t,s){void 0!==s&&this.addScalableFields("subcategories",s),this.setState({[e]:!1})}getProductTypeName(e){const{t}=this.props;return e===_e.jt?t("Product"):e===_e.L9?t("Service"):e===_e.er?t("Digital"):void 0}render(){const{currencies:e,subscriber:t,has_gateway:s}=this.props,{instance:a,errors:o,is_saving:n,saved:d,selected_product_version_i:te,show_supplier_modal:se,show_category_modal:ie,show_tax_modal:ae,show_inventory_modal:oe,show_product_option_type_modal:ne,show_product_version_modal:re,show_cabys_code_modal:pe,show_registration_category_modal:he}=this.state,{t:Ae}=this.props,be=void 0===a.external_id,Ne=(0,It.Ks)(kt.TN),Se=(0,It.Ks)(kt.vQ),xe=a.product_option_types&&a.product_option_types.length;let we=!1;const Ie=t&&t.country&&t.country.id==Tt.y4;if(a){const t=a.product_type==_e.jt;let s,d,C,De,Re;a.category&&(s=a.category.map((e,t)=>{let s;a.subcategories&&(s=a.subcategories.reduce((t,s,a)=>
1(s.category_id==e.id&&t.push((0,i.A)("li",{},s.id,(0,i.A)("i",{className:"fa fa-times "+g,onClick:()=>this.deleteScalableField("subcategories",a)}),s.name)),t),[]));const o=`show_subcategory_${e.id}_modal`;return(0,i.A)("li",{},e.id,(0,i.A)("div",{className:U},void 0,(0,i.A)("div",{className:z},void 0,(0,i.A)("h3",{className:j},void 0,e.name)),(0,i.A)("i",{className:`fa fa-times ${g} ${X}`,onClick:()=>this.deleteScalableField("category",t)})),(0,i.A)("div",{className:Y},void 0,(0,i.A)("ul",{className:J},void 0,s),(0,i.A)("div",{className:G,onClick:()=>this.openModal(o)},void 0,Ae("Add Subcategories")),(0,i.A)(Fe,{category_id:e.id,title:Ae("Subcategories"),show_modal:this.state[o],handleClose:t=>this.closeSubcategoryModal(o,e.id,t),multiple:!0})))})),a.taxes&&(d=a.taxes.map((e,t)=>(0,i.A)(de.A,{values:e,handleChange:this.handleChange.bind(this),handleSubmit:this.handleSubmit.bind(this)},t,(0,i.A)(xt.A,{name:"name",handleClear:()=>{this.deleteScalableField("taxes",t)}})))),xe&&(C=a.product_option_types.map((e,t)=>(0,i.A)(de.A,{values:e,handleChange:this.handleChange.bind(this),handleSubmit:this.handleSubmit.bind(this)},t,(0,i.A)(xt.A,{name:"name",handleClear:()=>{this.deleteScalableField("product_option_types",t)}})))),o.product_option_types&&(De=o.product_option_types.map((e,t)=>(0,i.A)("p",{className:f},t,e)));const Pe=o&&Object.values(o),Le=!!Pe?.length&&Pe.every(e=>"string"==typeof e);if(Le||o.errors&&o.errors.length){const e=Le?Pe:o.errors;Re=(0,i.A)(ee.Me,{},void 0,(0,i.A)(ee.ok,{},void 0,(0,i.A)(ee.Zp,{},void 0,(0,i.A)("fieldset",{className:p},void 0,e.map((e,t)=>(0,i.A)("p",{className:f},t,e))))))}let qe={};const Be=void 0!==e?e.map((e,t)=>(a.currency&&a.currency==e.id&&(qe=e),(0,i.A)("option",{value:e.id},t,e.alphabetic_code))):void 0,Ee={pathname:Me.A.reverse("payments:payment_button_add"),state:{selectedProduct:{external_id:a.external_id,name:a.name,currency:a.currency,code:a.code}}},He=(0,i.A)("fieldset",{className:p},void 0,(0,i.A)("legend",{},void 0,Ae("Actions")),(0,i.A)("div",{className:y},void 0,n?(0,i.A)("div",{className:y},void 0,Rt):(0,i.A)("div",{},void 0,(0,i.A)(de.A,{values:a,errors:o,handleChange:this.handleChange.bind(this),handleSubmit:this.handleSubmit.bind(this)},void 0,(0,i.A)(ve.A,{type:"submit",theme:"submit"},void 0,Ae("Save")),Pt),!be&&Ne&&(0,i.A)(me.A,{theme:"primary_full",type:"link",to:Ee},void 0,Ae("Create Fygaro Link for Product")))));let Ve;if(xe){let e,t;void 0!==te?(e=a.product_versions[te],o.product_versions&&(t=o.product_versions[te])):(e={},t={});const s=(0,i.A)(ge,{handleClose:this.closeProductVersionModal.bind(this),show_modal:re,title:Ae("Product Version"),instance:e,errors:t,product_option_types:a.product_option_types,selected_currency:qe,product_type:a.product_type});let n;a.product_versions&&a.product_versions.length?(we=!0,n=a.product_versions.reduce((e,t,s)=>{if(t.delete)return e;const a=t.is_default;let n=!1;if(o&&o.product_versions){const e=o.product_versions[s];if(void 0!==e){let t=0;e.inventories&&(t=1),Object.entries(e).length>t&&(n=!0)}}return e.push((0,i.A)("li",{className:R,onClick:e=>{this.openProductVersionModal(s)}},s,(0,i.A)("div",{className:h},void 0,(0,i.A)("div",{className:A},void 0,(0,i.A)("h3",{className:P},void 0,n&&(0,i.A)("i",{className:"fa fa-warning "+L}),a&&Lt," ",t.code)),(0,i.A)("div",{className:v},void 0,(0,i.A)("h5",{className:F},void 0,qe.symbol,(0,wt.N8)(t.price)))),(0,i.A)("div",{className:h},void 0,t.product_options?t.product_options.map((e,t)=>(0,i.A)("div",{className:u},t,(0,i.A)("h4",{className:O},void 0,e.product_option_type.name),(0,i.A)("p",{className:q},void 0,e.name))):void 0),n&&(0,i.A)("p",{className:f},void 0,Ae("Errors in version, click here to see more.")))),e},[])):n=(0,i.A)("li",{className:M},void 0,Ae("No Product Versions Available.")),Ve=(0,i.A)("div",{},void 0,(0,i.A)("ul",{className:D},void 0,n),we&&(0,i.A)("small",{className:T},void 0,Ft," = ",Ae("Default or Main Version")),(0,i.A)(me.A,{onClick:e=>{this.openProductVersionModal()},theme:"primary_full"},void 0,Ae("Add Version")),s)}else Ve=(0,i.A)(de.A,{values:a,errors:o,handleChange:this.handleChange.bind(this),handleSubmit:this.handleSubmit.bind(this)},void 0,(0,i.A)(le.A,{name:"code",label:Ae("Code"),className:m}),(0,i.A)(le.A,{name:"price",label:Ae("Price"),className:m}));const Qe=_e.Wd.map((e,t)=>(0,i.A)("option",{value:e},e,this.getProductTypeName(e)));let We,Ke=[];if(Ne&&void 0!==a.images){const e=a.images.length;for(let t=0;t<e;t++){let e=a.images[t];e.is_main&&(We=e),Ke.push((0,i.A)("li",{},e.id,(0,i.A)("div",{className:Q,style:{backgroundImage:`url('${e.thumbnail}')`}}),(0,i.A)("div",{className:W,onClick:this.deleteImage.bind(this,t)},void 0,Ot),e.is_main?(0,i.A)("div",{className:K},void 0,qt):(0,i.A)("div",{className:K,onClick:this.setAsMain.bind(this,t)},void 0,Bt)))}}const Ze=(0,i.A)("fieldset",{className:p},void 0,(0,i.A)(de.A,{values:a,errors:o,handleChange:this.handleChange.bind(this),handleSubmit:this.handleSubmit.bind(this)},void 0,(0,i.A)(ue.A,{name:"currency",label:Ae("Currency"),className:b},void 0,Be),(0,i.A)(ue.A,{name:"product_type",label:Ae("Type of Item"),className:_},void 0,Qe),!xe&&a.product_type==_e.jt&&(0,i.A)(le.A,{name:"weight",placeholder:Ae("Weight (Kg)"),label:Ae("Weight (Kg)")}),!xe&&a.product_type==_e.er&&(0,i.A)(le.A,{name:"product_version_downloadable",placeholder:Ae("Digital Product Link"),label:Ae("Digital Product Link")}),Se&&(0,i.A)(ue.A,{name:"show_in_website",label:Ae("Show In Website")},void 0,(0,i.A)("option",{value:!0},void 0,Ae("Yes")),(0,i.A)("option",{value:!1},void 0,Ae("No"))))),Ue=a.product_option_types&&a.product_option_types.length>=2,ze=(0,i.A)("fieldset",{className:p},void 0,(0,i.A)("legend",{},void 0,Ae("Product Options")),De,C,(0,i.A)(me.A,{onClick:this.openProductOptionTypeModal.bind(this),theme:"primary_full",disabled:Ue},void 0,Ae(Ue?"Max. Options Reached":"Add Option")));let je;if(Ie&&a.inactive_cabys_code){const e=(0,i.A)(r.x6,{t:Ae},void 0,(0,i.A)("p",{},void 0,"This product's Cabys Code was excluded from the new list of Cabys Codes published by the C
1osta Rican Central Bank. Please update your Cabys Code.",Et,Ht,"If you need more information, check the Central Bank's resources at: ",(0,i.A)("a",{className:B,rel:"noopener",href:"https://www.bccr.fi.cr/indicadores-economicos/cat%C3%A1logo-de-bienes-y-servicios"},void 0,"https://www.bccr.fi.cr/indicadores-economicos/cat%C3%A1logo-de-bienes-y-servicios")," or reach out to your accountant."));je=(0,i.A)(ee.Me,{},void 0,(0,i.A)(ee.ok,{},void 0,(0,i.A)(ee.Zp,{},void 0,(0,i.A)("fieldset",{className:p},void 0,(0,i.A)(fe.Ay,{type:fe.nk,message:e})))))}const Xe=(0,i.A)(ee.PE,{},void 0,Re,je,(0,i.A)(ee.Me,{},void 0,(0,i.A)(ee.c_,{},void 0,(0,i.A)(ee.Zp,{className:S},void 0,Ze),(0,i.A)(ee.Zp,{className:S},void 0,ze),(0,i.A)(ee.Zp,{},void 0,(0,i.A)("fieldset",{className:p},void 0,(0,i.A)(de.A,{values:a,errors:o,handleChange:this.handleChange.bind(this),handleSubmit:this.handleSubmit.bind(this)},void 0,(0,i.A)(le.A,{name:"name",placeholder:Ae("Name"),label:Ae("Name")})),Ve)),(0,i.A)(ee.Zp,{},void 0,(0,i.A)(de.A,{values:a,errors:o,handleChange:this.handleChange.bind(this),handleSubmit:this.handleSubmit.bind(this)},void 0,(0,i.A)("div",{className:Ne?l:""},void 0,(0,i.A)("fieldset",{className:p},void 0,(0,i.A)("legend",{},void 0,Ae("Description")),(0,i.A)(ce.A,{name:"description",label:Ae("Invoicing"),rows:6}),(0,i.A)("small",{className:k},void 0,Vt,"Â ",Ae("Description automatically added to invoices containing this product.")))),Ne&&(0,i.A)("div",{className:l},void 0,(0,i.A)("fieldset",{className:p},void 0,Qt,(0,i.A)(ce.A,{name:"ecommerce_description",label:Ae("eCommerce"),rows:6}),(0,i.A)("small",{className:k},void 0,Wt,"Â ",Ae("Short description shown in payment Links and Shops.")))))),Ne&&(0,i.A)(ee.Zp,{gray:!0,noBorders:!0},void 0,(0,i.A)("fieldset",{className:p},void 0,(0,i.A)("legend",{},void 0,Ae("Gallery")),Ke.length>0?(0,i.A)("ul",{className:V},void 0,Ke):(0,i.A)("p",{className:H},void 0,Ae("Saved images will be shown here.")),(0,i.A)(de.A,{values:a,errors:o,handleChange:this.handleChange.bind(this),handleSubmit:this.handleSubmit.bind(this)},void 0,(0,i.A)(Nt.A,{name:"files",label:Ae("Add Image"),multiple:!0,placeholder:Ae("Click here or drop files to select"),maxWidth:Mt.No,maxHeight:Mt.No})))),(0,i.A)(ee.Zp,{},void 0,(0,i.A)("fieldset",{className:p},void 0,(0,i.A)(de.A,{values:a,errors:o,handleChange:this.handleChange.bind(this),handleSubmit:this.handleSubmit.bind(this)},void 0,(0,i.A)(xt.A,{name:"supplier",titleKeys:["company_name","legal_name"],label:Ae("Supplier"),placeholder:Ae("Select Supplier"),onClick:this.openSupplierModal.bind(this),handleClear:()=>{this.setFields({supplier:void 0})}}),(0,i.A)(le.A,{name:"registration_id",label:Ae("Registration Number")}),(0,i.A)("small",{className:k},void 0,Ae("Use this field to store government or industry compliance IDs such as a sanitary registration.")),Ie&&(0,i.A)("div",{},void 0,(0,i.A)(xt.A,{name:"cabys_code",className:m,titleKeys:["code"],label:Ae("CABYS Code"),placeholder:Ae("CABYS Code"),onClick:this.openCabysCodeModal.bind(this),handleClear:()=>{this.setFields({cabys_code:void 0})}}),(0,i.A)(le.A,{name:"tariff_heading",className:m,placeholder:Ae("Tariff Heading"),label:Ae("Tariff Heading")}),void 0!==a.cabys_code&&(0,i.A)("small",{className:k},void 0,Ae("CABYS"),": ",a.cabys_code.name)),a.cabys_code?.is_pharma&&(0,i.A)(xt.A,{name:"registration_category",titleKeys:["name"],label:Ae("Pharmaceutical Form"),onClick:this.openRegistrationCategoryModal.bind(this),handleClear:()=>{this.setFields({registration_category:void 0})}}))))),(0,i.A)(ee.Mn,{},void 0,(0,i.A)(ee.Zp,{className:x},void 0,Ze),(0,i.A)(ee.Zp,{className:x},void 0,ze),(0,i.A)(ee.Zp,{},void 0,He))),(0,i.A)(ke,{show_modal:ne,handleClose:this.closeProductOptionTypeModal.bind(this),title:Ae("Product Options"),hide_search:!0}),(0,i.A)(ye.A,{show_modal:se,handleClose:this.closeSupplierModal.bind(this),title:Ae("Suppliers")}),(0,i.A)(bt,{title:Ae("CABYS Codes"),show_modal:pe,handleClose:this.closeCabysCodeModal.bind(this)}),a.cabys_code?.is_pharma&&(0,i.A)(yt,{title:Ae("Pharmaceutical Form"),show_modal:he,handleClose:this.closeRegistrationCategoryModal.bind(this),extra_payload:{cabys_code:a.cabys_code.code}})),Ye=(0,i.A)(ee.PE,{},void 0,Re,(0,i.A)(ee.Me,{},void 0,(0,i.A)(ee.c_,{},void 0,(0,i.A)(ee.Zp,{},void 0,(0,i.A)("fieldset",{className:p},void 0,(0,i.A)("legend",{},void 0,Ae("Categories")),s?(0,i.A)("ul",{className:Z},void 0,s):(0,i.A)("p",{},void 0,Ae("Add categories.")),(0,i.A)(me.A,{onClick:this.openCategoryModal.bind(this),theme:"primary_full"},void 0,Ae("Add Categories")),(0,i.A)(Ce.A,{show_modal:ie,handleClose:this.closeCategoryModal.bind(this),title:Ae("Categories"),multiple:!0}))),(0,i.A)(ee.Zp,{},void 0,(0,i.A)("fieldset",{className:p},void 0,(0,i.A)("legend",{},void 0,Ae("Taxes")),d,(0,i.A)(me.A,{onClick:this.openTaxModal.bind(this),theme:"primary_full"},void 0,Ae("Add Taxes")),(0,i.A)(Oe.A,{show_modal:ae,handleClose:this.closeTaxModal.bind(this),title:Ae("Taxes"),multiple:!0})))),(0,i.A)(ee.Mn,{},void 0,(0,i.A)(ee.Zp,{},void 0,He))));let Je,Ge,$e;if(t){let e;if(xe)if(we){const t=p+" "+w;e=a.product_versions.map((e,s)=>{let a,n=[];return o&&o.product_versions&&o.product_versions[s]&&(a=o.product_versions[s]),e.inventories&&(n=e.inventories.map((e,t)=>{let o;return a&&a.inventories&&a.inventories[t]&&(o=a.inventories[t]),(0,i.A)(de.A,{values:e,errors:o,handleChange:e=>this.handleInventoryModalChange(s,t,e),handleSubmit:this.handleSubmit.bind(this)},t,(0,i.A)(le.A,{name:"description",placeholder:Ae("Description"),className:m,disabled:!0}),(0,i.A)(le.A,{name:"quantity",placeholder:Ae("Quantity"),className:m}))})),(0,i.A)("fieldset",{className:t},s,(0,i.A)("legend",{},void 0,Ae("Version"),": ",e.code),n,(0,i.A)(me.A,{onClick:e=>this.openInventoryModal(s),theme:"primary_full"},void 0,Ae("Add to Inventory")))})}else e=(0,i.A)("fieldset",{className:p},void 0,(0,i.A)("legend",{},void 0,Ae("Inventories")),(0,i.A)("p",{},void 0,Ae("Create at least one version to enable Inventories.")));else{let t=[];a.inventories&&(t=a.inventories.map((e,t)=>(0,i.A)(de.A,{values:e,errors:void 0!==o.inventories?o.inventories[t]:void 0,handleChange:e=>{this.updateScalableField("inventories",t,e)},handleSubmit:this.handleSubmit.bind(this)},t,(0,i.A)(le.A,{name:"description",placeholder:Ae("Description"),className:m,disabled:!0}),(0,i.A)(le.A,{name:"quantity",placeholder:Ae("Quantity"),className:m})))),e=(0,i.A)("fieldset",{className:p},void 0,(0,i.A)("legend",{},void 0,Ae("Inventories")),t,(0,i.A)(me.A,{onClick:e=>this.openInventoryModal(),theme:"primary_full"},void 0,Ae("Add to Inventory")))}Je=(0,i.A)(ee.PE,{},void 0,Re,(0,i.A)(ee.Me,{},void 0,(0,i.A)(ee.c_,{},void 0,(0,i.A)(ee.Zp,{},void 0,e,(0,i.A)(Te.A,{show_modal:oe,handleClose:this.closeInventoryModal.bind(this),title:Ae("Inventories"),multiple:!0}))),(0,i.A)(ee.Mn,{},void 0,(0,i.A)(ee.Zp,{},void 0,He))))}let et,tt,st=Ae("Product"),it=Ae("Categories & Taxes"),at=Ae("Inventory");Se&&(tt=Ae("Shop"),et=(0,i.A)("div",{},void 0,(0,i.A)("fieldset",{className:c+" "+N},void 0,(0,i.A)("h3",{},void 0,Ae("Product Detail")),(0,i.A)("small",{}
1,void 0,Ae("Content will be shown in this product's detail page of your Shop."))),void 0!==a.page_data?(0,i.A)(Dt.A,{data:a.page_data,setData:e=>this.setField("page_data",e),is_saving:n,handleSubmit:this.handleSubmit.bind(this),t:Ae,builderConf:a.builder_conf}):Kt));const ot=Object.entries(o).length;if(o&&ot>0){let e=0;if((o.categories||o.taxes)&&(it=(0,i.A)("span",{className:E},void 0,(0,i.A)("i",{className:"fa fa-circle "+I})," ",it)),o.categories&&(e+=1),o.taxes&&(e+=1),o.inventories)e+=1,at=(0,i.A)("span",{className:E},void 0,(0,i.A)("i",{className:"fa fa-circle "+I})," ",at);else if(o.product_versions)for(let t of o.product_versions)if(t.inventories){e+=1,at=(0,i.A)("span",{className:E},void 0,(0,i.A)("i",{className:"fa fa-circle "+I})," ",at);break}o.errors&&(e+=1),ot>e&&(st=(0,i.A)("span",{className:E},void 0,(0,i.A)("i",{className:"fa fa-circle "+I})," ",st))}return Ge=[st,it],$e=[Xe,Ye],t&&(Ge.push(at),$e.push(Je)),Se&&(Ge.splice(1,0,tt),$e.splice(1,0,et)),(0,i.A)($.A,{titles:Ge,tabs:$e})}return(0,i.A)("div",{className:C})}}Zt.propTypes={currencies:n().arrayOf(n().object),has_gateway:n().bool};const Ut=(0,r.CI)("app")(Zt)},51188(e,t,s){s.d(t,{A:()=>y});var i=s(73620),a=(s(96540),s(63710));s(69733);const o="TTUeWc7miU4xClIrmJjX",n="HNN6kKXjt2wEVj1CRaRB",r="F5nsaosPxOXkN6RImhNf",d="M5kRor5Lh_cARuVylTrn",l="swvlgfeal2NFFgxVr19B",c="NggtHDR9Ol0UAAeokplY",p="nh997HMpqCx3YZxs2Mte",h="CS33ZHorfBnS4uokLtqh";s(10233);var u=s(28097),A=s(67210),v=s(55023),m=(s(40424),s(2598),s(97173),s(54150),s(29921)),_=(s(60008),s(39782),s(51930)),b=(0,i.A)("br",{}),g=(0,i.A)(_.A,{});class f extends u.A{componentDidUpdate(e,t){if(t.is_saving&&!this.state.is_saving&&this.state.errors&&this.state.errors.product_options){const e=this.state.errors.product_options,t=e.length;for(let s=0;s<t;s++){e[s]&&this.unDeleteProductOption(s)}}}unDeleteProductOption(e){let t={...this.state.instance.product_options[e]};delete t.delete,this.updateScalableField("product_options",e,t)}render(){const{instance:e,errors:t,is_saving:s,saved:a}=this.state,{t:u}=this.props;if(e){let a=[],h=0;e.product_options&&(a=e.product_options.reduce((e,s,a)=>{const o=void 0!==t.product_options?t.product_options[a]:void 0;return s.delete||e.push((0,i.A)(A.A,{values:s,errors:o,handleChange:e=>{this.updateScalableField("product_options",a,e)},handleSubmit:this.handleSubmit.bind(this)},a,(0,i.A)("div",{className:n},void 0,(0,i.A)(v.A,{name:"name",placeholder:u("Name"),className:r}),(0,i.A)("div",{},void 0,(0,i.A)("i",{className:d+" fa fa-times "+l,onClick:()=>{this.setDeleteScalableField("product_options",a)}}))),o&&o.errors&&o.errors.map((e,t)=>(0,i.A)("p",{className:c},t,e)))),e},[]),h=e.product_options.length),a.push((0,i.A)(A.A,{values:{},handleChange:e=>{this.updateScalableField("product_options",h,e)},handleSubmit:this.handleSubmit.bind(this)},h,(0,i.A)("div",{className:n},void 0,(0,i.A)(v.A,{name:"name",placeholder:u("New Value"),className:r}))));const _=(0,i.A)("fieldset",{className:o},void 0,(0,i.A)("legend",{},void 0,u("Values")),a);return(0,i.A)("div",{},void 0,(0,i.A)("fieldset",{className:o},void 0,(0,i.A)("legend",{},void 0,u("Basic Information")),(0,i.A)(A.A,{values:e,errors:t,handleChange:this.handleChange.bind(this),handleSubmit:this.handleSubmit.bind(this)},void 0,(0,i.A)(v.A,{name:"name",placeholder:u("Name"),label:u("Name")}))),b,_,(0,i.A)("fieldset",{className:o},void 0,t&&t.errors&&t.errors.map((e,t)=>(0,i.A)("p",{className:c},t,e)),(0,i.A)(A.A,{values:e,errors:t,handleChange:this.handleChange.bind(this),handleSubmit:this.handleSubmit.bind(this)},void 0,s?g:(0,i.A)("div",{className:p},void 0,(0,i.A)(m.A,{type:"submit",theme:"submit"},void 0,u("Save"))))))}return(0,i.A)("div",{className:h})}}const y=(0,a.CI)("app")(f)},83337(e,t,s){s.d(t,{A:()=>R});var i=s(73620),a=s(96540),o=s(63710);s(69733);const n="apfcMnV5l6bpbkVKdF3k",r="z63tnOO6uy1zkaWqOtbY",d="wxoDQ4_BMS4OJOAHXF4t",l="Q5bBE0_N13eKTNln528X",c="K57UACbhwlwVRLz0HSB5",p="KSwJTesiXb8sxwTGqb1q",h="b_6fdTgC2r4xmUrLYgP_",u="rZTU12ossqjUb04jQvYt",A="fGwSgUarmkXfIScLbBgZ",v="xQyihfUHkbc_PvbzZuv2";s(10233);var m=s(28097),_=s(47650),b=s(67210),g=s(55023),f=s(40424),y=(s(2598),s(97173),s(54150)),C=s(29921),N=s(84759),S=s(60008),x=s(51930),w=s(89630),I=s(85636),k=s(62193),T=(0,i.A)(x.A,{}),D=(0,i.A)(S.A,{});class M extends m.A{cleanErrors(e){if(void 0!==e){const t={...e};return t.supplier_ebilling_information&&(t.province=t.supplier_ebilling_information.province,t.canton=t.supplier_ebilling_information.canton,t.district=t.supplier_ebilling_information.district,t.other_signs=t.supplier_ebilling_information.other_signs,t.identification_type=t.supplier_ebilling_information.identification_type),t}}render(){const{identification_types:e,locationsCR:t,subscriber:s,pulse:o}=this.props,{instance:m,errors:S,is_saving:x,saved:M}=this.state,{t:R}=this.props;const P=this.cleanErrors(S),L=t?.body,F=!(!o||!o.has_ebilling_cr)&&o.has_ebilling_cr;void 0!==e&&e.length>0&&e.map((e,t)=>(0,i.A)("option",{value:e.id},t,e.name));if(m){const e=m.country?.id==I.y4,t=s&&s.country&&s.country.id==I.y4;let o,A,S;const M=L?L.provinces:void 0;t&&e&&void 0!==M&&(o=M.map((e,t)=>(void 0!==m.province&&m.province==e.id&&void 0!==e.cantons&&(A=e.cantons.map((e,t)=>(void 0!==m.canton&&m.canton==e.id&&void 0!==e.districts&&(S=e.districts.map((e,t)=>(0,i.A)("option",{value:e.id},e.id,e.name))),(0,i.A)("option",{value:e.id},e.id,e.name)))),(0,i.A)("option",{value:e.id},e.id,e.name))));let O=[];m.emails&&(O=m.emails.reduce((e,t,s)=>(t.delete||e.push((0,i.A)(b.A,{values:t,errors:void 0!==P.emails?P.emails[s]:void 0,handleChange:e=>{this.updateScalableField("emails",s,e)},handleSubmit:this.handleSubmit.bind(this)},s,(0,i.A)("div",{className:d},void 0,(0,i.A)(g.A,{name:"email",autoComplete:"off",placeholder:R("Email"),className:l}),(0,i.A)("div",{},void 0,(0,i.A)("i",{className:p+" fa fa-times "+h,onClick:()=>{this.setDeleteScalableField("emails",s)}}))))),e),[]));let q=[];m.phones&&(q=m.phones.reduce((e,t,s)=>(t.delete||e.push((0,i.A)(b.A,{values:t,errors:void 0!==P.phones?P.phones[s]:void 0,handleChange:e=>{this.updateScalableField("phones",s,e)},handleSubmit:this.handleSubmit.bind(this)},s,(0,i.A)("div",{className:d},void 0,(0,i.A)(g.A,{name:"title",placeholder:R("Title"),className:l,autoComplete:"off"}),(0,i.A)(g.A,{name:"number",placeholder:R("Phone"),className:l,autoComplete:"off"}),(0,i.A)("div",{},void 0,(0,i.A)("i",{className:p+" fa fa-times "+h,onClick:()=>{this.setDeleteScalableField("phones",s)}}))))),e),[]));let B,E,H=[];return m.addresses&&(H=m.addresses.reduce((e,t,s)=>(t.delete||e.push((0,i.A)(_.A,{values:t,errors:void 0!==P.addresses?P.addresses[s]:void 0,handleChange:e=>{this.updateScalableField("addresses",s,e)},handleSubmit:this.handleSubmit.bind(this),handleDelete:()=>{this.setDeleteScalableField("addresses",s)}},s)),e),[])),B=m.type==k.ir?R("Full Name"):R("Legal Name"),P&&P.errors&&(E=P.errors.map((e,t)=>(0,i.A)("p",{className:v},t,e))),(0,i.A)("div",{},void 0,void 0!==E&&(0,i.A)("fieldset",{className:r},void 0,E),(0,i.A)("div",{className:n},void 0,(0,i.A)("fieldset",{className:r},void 0,(0,i.A)("legend",{},void 0,R("Basic Information")),(0,i.A)(b.A,{values:m,errors:P,handleChange:this.handleChange.bind(this),handleSubmit:this.handleSubmit.bind(this)},void 0,(0,i.A)(y.A,{name:"type",label:R("Supplier Type")},void 0,(0,i.A)("option",{value:k.oA},void 0,R("Company")),(0,i.A)("option",{value:k.ir},void 0,R("Freelancer"))),m.type==k.oA&&(0,i.A)(g.A,{name:"company_name",placeholder:R("Name"),label:R("Name")}
1),(0,i.A)(g.A,{name:"legal_name",placeholder:B,label:B}),(0,i.A)(g.A,{name:"legal_id",placeholder:R("Legal ID"),label:R("Legal ID")}),t&&e&&(0,i.A)(y.A,{name:"identification_type",label:R("ID Type")},void 0,(0,i.A)("option",{value:""},void 0,R("Select Type")),(0,i.A)("option",{value:I.jR},void 0,R("Personal ID")),(0,i.A)("option",{value:I.WK},void 0,R("Company ID")),(0,i.A)("option",{value:I.g$},void 0,R("DIMEX")),(0,i.A)("option",{value:I.jQ},void 0,R("NITE"))),a.createElement(w.A,this.state),t&&e&&(0,i.A)(g.A,{name:"activity_code",placeholder:R("Activity Code"),label:R("Activity Code")}))),(0,i.A)("fieldset",{className:r},void 0,(0,i.A)("legend",{},void 0,R("Emails")),O,(0,i.A)(N.A,{onClick:()=>{this.addScalableFields("emails")},theme:"primary_full"},void 0,R("Add Email"))),(0,i.A)("fieldset",{className:r},void 0,(0,i.A)("legend",{},void 0,R("Phones")),q,(0,i.A)(N.A,{onClick:()=>{this.addScalableFields("phones")},theme:"primary_full"},void 0,R("Add Phone")))),(0,i.A)("div",{className:n},void 0,t&&e&&F&&(0,i.A)("fieldset",{className:r},void 0,(0,i.A)("legend",{},void 0,R("Billing Address")),(0,i.A)(b.A,{values:m,errors:P,handleChange:this.handleChange.bind(this),handleSubmit:this.handleSubmit.bind(this)},void 0,(0,i.A)(y.A,{name:"province",className:c,label:R("Province")},void 0,(0,i.A)("option",{},void 0,R("Select")),o),(0,i.A)(y.A,{name:"canton",className:c,label:R("Canton")},void 0,(0,i.A)("option",{},void 0,void 0!==m.province?R("Select"):R("Waiting for Province")),A),(0,i.A)(y.A,{name:"district",className:c,label:R("District")},void 0,(0,i.A)("option",{},void 0,void 0!==m.canton?R("Select"):R("Waiting for Canton")),S),(0,i.A)(f.A,{name:"other_signs",label:R("Other Signs")}))),(0,i.A)("fieldset",{className:r},void 0,(0,i.A)("legend",{},void 0,R("Address")),H,(0,i.A)(N.A,{onClick:()=>{this.addScalableFields("addresses")},theme:"primary_full"},void 0,R("Add Address"))),(0,i.A)("fieldset",{className:r},void 0,(0,i.A)("div",{className:u},void 0,x?(0,i.A)("div",{className:u},void 0,T):(0,i.A)("div",{className:u},void 0,(0,i.A)(b.A,{values:m,errors:P,handleChange:this.handleChange.bind(this),handleSubmit:this.handleSubmit.bind(this)},void 0,(0,i.A)(C.A,{type:"submit",theme:"submit"},void 0,R("Save")),D))))))}return(0,i.A)("div",{className:A})}}const R=(0,o.CI)("app")(M)},25684(e,t,s){s.d(t,{A:()=>g});var i=s(73620),a=(s(96540),s(63710));s(69733);const o={column:"Vz3PoNYole_WcifxWfMN",form_group:"NStHeNslJrn70VYc1hAw",fieldset:"Wb_n29WIqZNpPLSi2ycM",flex_row:"TTSPSIS5io9B2mdtof4Y",flex_1:"gBPsWxNvUemyrMdSvXgu",field_70:"hUMmGhm9OlqcwPs1pngQ",field_30:"HJgHIK6VB0VwjkbxDhMP",checkbox_grid:"d0AIvEqjqgEZmhSftmiL",feature_toggle_note:"cRCiKwfjfk1bJiJlS1hP",half:"RgaDMvJwehorZ9op_j12",third:"fScYETgYD7xofcmaYt2Q",twothirds:"cwpjkZIsoddDotxYBJEp",instructions:"DGB6S0F_UIeKo4yY1hcg",price:"OJRQcOffTM7GHNIlj3DG",currency:"lKaVOwgO6C713iRq8o70",button_clear:"QD4Auzw24H3v13QAJbO3",button_clear_big:"Kn7KK3r6M_b5RszQtjIs",error:"NVw_pnwNO9HLKhFGrtiR",actions:"mmKVagEw8jhyokxEg49Q",submit_button:"N1CyM1oSYUZUfwQ0Aedh",modal_submit_button:"S1Nfp8lca3061HgSonaw",loading_overlay:"iWtPEZSUUKGA5l5O2p7l",loader:"w_RIX73a13YzIMWQ6vDP",toggle_input:"hzuAw2di_jRJTuGFT8U4"};s(10233);var n=s(28097),r=s(67210),d=s(55023),l=s(40424),c=(s(2598),s(97173),s(54150)),p=s(29921),h=s(39782),u=s(60008),A=s(51930),v=s(62193),m=(0,i.A)(A.A,{}),_=(0,i.A)(u.A,{});class b extends n.A{handleChange(e,t){this.setState(t=>(t.instance.is_default!==e.is_default&&(e.update_existing=!1),{instance:e}),"function"==typeof t?t:void 0)}render(){const{instance:e}=this.props,{instance:t,errors:s,is_saving:a,saved:n}=this.state,{t:u}=this.props;const A=e.is_default!==t.is_default;let b="";return b=t.is_default?u("add this tax to every existing product"):u("remove this tax from every existing product"),t?(0,i.A)("div",{},void 0,(0,i.A)(r.A,{values:t,errors:s,handleChange:this.handleChange.bind(this),handleSubmit:this.handleSubmit.bind(this)},void 0,(0,i.A)("fieldset",{className:o.form_group},void 0,(0,i.A)("legend",{},void 0,u("Basic Information")),(0,i.A)(d.A,{name:"name",placeholder:u("Name"),label:u("Name")}
1),(0,i.A)(d.A,{name:"amount",placeholder:u("Amount"),label:u("Amount"),className:o.half}),(0,i.A)(c.A,{name:"type",placeholder:u("Type"),label:u("Type"),className:o.half},void 0,(0,i.A)("option",{},void 0,u("Select")),(0,i.A)("option",{value:v.iq},void 0,u("Percentage")),(0,i.A)("option",{value:v.et},void 0,u("Fixed"))),(0,i.A)(l.A,{name:"description",placeholder:u("Description"),label:u("Description"),rows:4,maxLength:240})),(0,i.A)("fieldset",{className:o.form_group},void 0,(0,i.A)("legend",{},void 0,u("Set as Default")),(0,i.A)("p",{},void 0,u("By setting the next toggle to `Yes´, we will add this Tax to all new products automatically.")),(0,i.A)("div",{className:o.toggle_input},void 0,(0,i.A)(h.A,{label:u("Add by default to all new products"),name:"is_default",value:{active:!0,inactive:!1},className:o.client_type_toggle})),A&&(0,i.A)("div",{},void 0,(0,i.A)("p",{},void 0,u("By setting the next toggle to `Yes´, we will {{a}}.",{a:b})),(0,i.A)("div",{className:o.toggle_input},void 0,(0,i.A)(h.A,{label:u("Update Existing Products"),name:"update_existing",value:{active:!0,inactive:!1},className:o.client_type_toggle}))),(0,i.A)("p",{},void 0,u("If you need to configure the taxes (add or remove) for a specific product, go to the product detail page and change the tax setting."))),(0,i.A)("fieldset",{className:o.form_group},void 0,(0,i.A)("legend",{},void 0,u("Actions")),a?(0,i.A)("div",{className:o.actions},void 0,m):(0,i.A)("div",{className:o.actions},void 0,(0,i.A)(p.A,{type:"submit",theme:"submit"},void 0,u("Save")),_)))):(0,i.A)("div",{className:o.loading_overlay})}}const g=(0,a.CI)("app")(b)},6632(e,t,s){s.d(t,{A:()=>p});s(96540);var i=s(63710),a=s(82960),o=s(69733),n=s(20360),r=s(62193),d=s(76808);const l=(0,d.t)("products","suppliers",(e,t)=>{let s,i;return e.type==r.ir?(s=e.legal_name,i=e.legal_id):(s=e.company_name,i=void 0===e.legal_id?e.legal_name:e.legal_name+" ["+e.legal_id+"]"),{...e,id:e.external_id,title:s,subtitle:i}}),c=(0,i.CI)("app")(d.A),p=(0,o.Ng)(l,e=>(0,a.zH)({fetchList:n.qQ},e))(c)},22101(e,t,s){s.d(t,{A:()=>p});s(96540);var i=s(63710),a=s(82960),o=s(69733),n=s(20360),r=s(62193),d=s(76808);const l=(0,d.t)("products","taxes",(e,t)=>{let s="";void 0!==e.amount&&(s=void 0!==e.type&&e.type==r.iq?e.amount+"%":e.amount);const i=void 0!==e.description?`${s} - ${e.description}`:s;return{...e,title:e.name||"",subtitle:i}}),c=(0,i.CI)("app")(d.A),p=(0,o.Ng)(l,e=>(0,a.zH)({fetchList:n.sr},e))(c)},40895(e,t,s){s.r(t),s.d(t,{default:()=>u});var i=s(73620),a=s(64467),o=(s(96540),s(63710)),n=s(97530),r=s(24835),d=s(10233),l=s(54479);var c=(0,i.A)("br",{}),p=(0,i.A)("br",{});class h extends n.A{constructor(...e){super(...e),(0,a.A)(this,"apiEndpoint","products/categories/"),(0,a.A)(this,"successRoute","products:category_list"),(0,a.A)(this,"updateListActionType",r.ml)}render(){const{instance:e,errors:t}=this.state,{t:s}=this.props;return(0,i.A)(d.A,{title:s("New Category"),small:!0},void 0,(0,i.A)(l.A,{handleSubmit:this.save,instance:e,saveState:this.state.saveRequest?.state,errors:t}),c,p)}}const u=(0,o.CI)("app")(h)},87172(e,t,s){s.r(t),s.d(t,{default:()=>u});var i=s(64467),a=(s(96540),s(63710)),o=s(82960),n=s(69733),r=s(44913),d=s(57248),l=s(39685);class c extends l.uO{constructor(...e){super(...e),(0,i.A)(this,"add_permission","products_edit"),(0,i.A)(this,"add_instance_route","products:category_add")}getTitle(){const{t:e}=this.props;return e("Categories")}getDescription(){const{t:e}=this.props;return e("Recently Modified Categories.")}}const p=(0,l.tr)("products","categories",(e,t)=>({title:e.name||"",subtitle:e.description||"",link:{pathname:r.A.reverse("products:category_permalink",{external_id:e.id}),state:{localId:t,instance:e}}})),h=(0,a.CI)("app")(c),u=(0,n.Ng)(p,e=>(0,o.zH)({fetchInstances:d.jE},e))(h)},85640(e,t,s){s.r(t),s.d(t,{default:()=>u});var i=s(73620),a=s(64467),o=(s(96540),s(63710)),n=s(68119),r=s(24835),d=s(10233),l=s(54479);var c=(0,i.A)("br",{}),p=(0,i.A)("br",{});class h extends n.A{constructor(...e){super(...e),(0,a.A)(this,"apiEndpoint","products/{external_id}/categories/"),(0,a.A)(this,"updateListActionType",r.ml)}render(){const{instance:e,errors:t}=this.state,{t:s}=this.props,a=void 0!==e.name?e.name:"";return(0,i.A)(d.A,{title:s("Category:")+" "+a,small:!0},void 0,(0,i.A)(l.A,{instance:e,handleSubmit:this.save,fetchState:this.state.fetchRequest?.state,saveState:this.state.saveRequest?.state,errors:t}),c,p)}}const u=(0,o.CI)("app")(h)},575(e,t,s){s.r(t),s.d(t,{default:()=>u});
1var i=s(73620),a=s(64467),o=(s(96540),s(63710)),n=s(97530),r=s(24835),d=s(10233),l=s(72010),c=(0,i.A)("br",{}),p=(0,i.A)("br",{});class h extends n.A{constructor(...e){super(...e),(0,a.A)(this,"apiEndpoint","coupons/"),(0,a.A)(this,"successRoute","products:coupon_list"),(0,a.A)(this,"updateListActionType",r.QP)}render(){const{instance:e,errors:t}=this.state,{t:s}=this.props;return(0,i.A)(d.A,{title:s("Create Coupon"),small:!0},void 0,(0,i.A)(l.A,{handleSubmit:this.save,instance:e,saveState:this.state.saveRequest?.state,errors:t}),c,p)}}const u=(0,o.CI)("app")(h)},40182(e,t,s){s.r(t),s.d(t,{default:()=>A});var i=s(64467),a=(s(96540),s(63710)),o=s(82960),n=s(69733),r=s(44913),d=s(57248),l=s(39685),c=s(41801);class p extends l.uO{constructor(...e){super(...e),(0,i.A)(this,"add_permission","coupons_edit"),(0,i.A)(this,"add_instance_route","products:coupon_add")}getTitle(){const{t:e}=this.props;return e("Coupons")}getDescription(){const{t:e}=this.props;return e("Recently created coupons.")}getExtraActions(){const{t:e}=this.props;return[{icon_class:"fa fa-history",name:e("Inactive Coupons List"),handleClick:r.A.reverse("products:inactive_coupon_list")}]}}const h=(0,l.tr)("products","coupons",(e,t)=>{let s=(0,c.L5)(e.discount_type,e.discount_rate);return{title:e.code||"",subtitle:s,link:{pathname:r.A.reverse("products:coupon_permalink",{external_id:e.external_id}),state:{localId:t,instance:e}}}}),u=(0,a.CI)("app")(p),A=(0,n.Ng)(h,e=>(0,o.zH)({fetchInstances:d.w6},e))(u)},95614(e,t,s){s.r(t),s.d(t,{default:()=>A});var i=s(73620),a=s(64467),o=(s(96540),s(63710)),n=s(68119),r=s(24835),d=s(10233),l=s(72010),c=s(44913),p=(0,i.A)("br",{}),h=(0,i.A)("br",{});class u extends n.A{constructor(...e){super(...e),(0,a.A)(this,"apiEndpoint","coupons/{external_id}/coupon/"),(0,a.A)(this,"updateListActionType",r.QP)}render(){const{instance:e,errors:t}=this.state,{t:s}=this.props;let a,o;if(void 0===e.external_id)a=s("Create Coupon");else{a=s("Coupon {{c}}",{c:void 0!==e.code?e.code:""})}e.is_active?o=c.A.reverse("products:coupon_list"):(o=c.A.reverse("products:inactive_coupon_list"),a+=" - "+s("Deleted"));const n=[{icon_class:"fa fa-arrow-circle-o-left",name:s("Back"),handleClick:o}];return(0,i.A)(d.A,{title:a,small:!0,actions:n},void 0,(0,i.A)(l.A,{instance:e,handleSubmit:this.save,fetchState:this.state.fetchRequest?.state,saveState:this.state.saveRequest?.state,errors:t}),p,h)}}const A=(0,o.CI)("app")(u)},84959(e,t,s){s.r(t),s.d(t,{default:()=>A});var i=s(64467),a=(s(96540),s(63710)),o=s(82960),n=s(69733),r=s(44913),d=s(57248),l=s(39685),c=s(41801);class p extends l.uO{constructor(...e){super(...e),(0,i.A)(this,"add_permission","coupons_edit"),(0,i.A)(this,"add_instance_route","products:coupon_add")}getTitle(){const{t:e}=this.props;return e("Deleted Coupons")}getDescription(){const{t:e}=this.props;return e("Recently deleted coupons.")}getExtraActions(){const{t:e}=this.props;return[{icon_class:"fa fa-arrow-circle-o-left",name:e("Back to Coupons"),handleClick:r.A.reverse("products:coupon_list")}]}}const h=(0,l.tr)("products","inactive_coupons",(e,t)=>{let s=(0,c.L5)(e.discount_type,e.discount_rate);return{title:e.code||"",subtitle:s,link:r.A.reverse("products:coupon_permalink",{external_id:e.external_id})}}),u=(0,a.CI)("app")(p),A=(0,n.Ng)(h,e=>(0,o.zH)({fetchInstances:d.NW},e))(u)},71508(e,t,s){s.r(t),s.d(t,{default:()=>A});var i=s(73620),a=s(64467),o=(s(96540),s(63710)),n=s(97530),r=s(24835),d=s(57248),l=s(10233),c=s(27798);var p=(0,i.A)("br",{}),h=(0,i.A)("br",{});class u extends n.A{constructor(...e){super(...e),(0,a.A)(this,"apiEndpoint","products/inventories/"),(0,a.A)(this,"successRoute","products:inventory_list"),(0,a.A)(this,"updateListActionType",r.ee),(0,a.A)(this,"cleanSave",d.Q2)}render(){const{instance:e,errors:t}=this.state,{t:s}=this.props;return(0,i.A)(l.A,{title:s("New Inventory"),small:!0},void 0,(0,i.A)(c.A,{handleSubmit:this.save,instance:e,saveState:this.state.saveRequest?.state,errors:t}),p,h)}}const A=(0,o.CI)("app")(u)},13578(e,t,s){s.r(t),s.d(t,{default:()=>u});var i=s(64467),a=(s(96540),s(63710)),o=s(82960),n=s(69733),r=s(44913),d=s(57248),l=s(39685);class c extends l.uO{constructor(...e){super(...e),(0,i.A)(this,"add_permission","products_edit"),(0,i.A)(this,"add_instance_route","products:inventory_add")}getTitle(){const{t:e}=this.props;return e("Inventories")}getDescription(){const{t:e}=this.props;return e("Recently Modified Inventories.")}}const p=(0,l.tr)("products","inventories",(e,t)=>({title:e.description||"",subtitle:e.location.address||"",link:{pathname:r.A.reverse("products:inventory_permalink",{external_id:e.id}),state:{localId:t,instance:e}}})),h=(0,a.CI)("app")(c),u=(0,n.Ng)(p,e=>(0,o.zH)({fetchInstances:d.B0},e))(h)},97030(e,t,s){s.r(t),s.d(t,{default:()=>A});var i=s(73620),a=s(64467),o=(s(96540),s(63710)),n=s(68119),r=s(24835),d=s(57248),l=s(10233),c=s(27798);var p=(0,i.A)("br",{}),h=(0,i.A)("br",{});class u extends n.A{constructor(...e){super(...e),(0,a.A)(this,"apiEndpoint","products/{external_id}/inventories/"),(0,a.A)(this,"updateListActionType",r.ee),(0,a.A)(this,"cleanSave",d.Q2)}render(){const{instance:e,errors:t}=this.state,{t:s}=this.props,a=void 0!==e.description?e.description:"";return(0,i.A)(l.A,{title:s("Inventory:")+" "+a,small:!0},void 0,(0,i.A)(c.A,{instance:e,handleSubmit:this.save,fetchState:this.state.fetchRequest?.state,saveState:this.state.saveRequest?.state,errors:t}),p,h)}}const A=(0,o.CI)("app")(u)},38490(e,t,s){s.r(t),s.d(t,{default:()=>f});var i=s(73620),a=s(64467),o=(s(96540),s(63710)),n=s(69733),r=s(97530),d=s(14165),l=s(24835),c=s(57248),p=s(53028),h=s(26069),u=s(62193),A=s(63306),v=s(267),m=s(43505);class _ extends r.A{constructor(...e){super(...e),(0,a.A)(this,"apiEndpoint","products/"),(0,a.A)(this,"successRoute","products:product_list"),(0,a.A)(this,"updateListActionType",l.B3),(0,a.A)(this,"cleanSave",c.jr)}getInitialInstance(){const{currencies:e}=this.props;let t={product_type:u.jt,currency:void 0!==e[0]?e[0].id:void 0,show_in_website:!0};return(0,A.Ks)(v.vQ)&&(t.page_data=[(0,m.FV)()]),t}render(){const{currencies:e,subscriber:t}=this.props,{instance:s,errors:a}=this.state,{t:o}=this.props;return(0,i.A)(p.Ay,{title:o("New Item")},void 0,(0,i.A)(h.A,{handleSubmit:this.save,instance:s,saveState:this.state.saveRequest?.state,errors:a,currencies:e,subscriber:t}))}}const b=(0,d.t)({currencies:!0,subscriber:!0}),g=(0,o.CI)("app")(_),f=(0,n.Ng)(b)(g)},71641(e,t,s){s.r(t),s.d(t,{default:()=>u});var i=s(64467),a=(s(96540),s(63710)),o=s(82960),n=s(69733),r=s(20360),d=s(39685),l=s(17908);class c extends d.uO{constructor(...e){super(...e),(0,i.A)(this,"add_permission","products_edit"),(0,i.A)(this,"add_instance_route","products:product_add")}getTitle(){const{t:e}=this.props;return e("Products & Services")}getDescription(){const{t:e}=this.props;return e("Recently Created Items.")}}const p=(0,d.tr)("products","products",(0,l.S)(!0)),h=(0,a.CI)("app")(c),u=(0,n.Ng)(p,e=>(0,o.zH)({fetchInstances:r.j0},e))(h)},56737(e,t,s){s.r(t),s.d(t,{default:()=>u});
1var i=s(73620),a=s(64467),o=(s(96540),s(63710)),n=s(97530),r=s(24835),d=s(10233),l=s(51188);var c=(0,i.A)("br",{}),p=(0,i.A)("br",{});class h extends n.A{constructor(...e){super(...e),(0,a.A)(this,"apiEndpoint","products/product-option-types/"),(0,a.A)(this,"successRoute","products:product_option_type_list"),(0,a.A)(this,"updateListActionType",r.c4)}render(){const{instance:e,errors:t}=this.state,{t:s}=this.props;return(0,i.A)(d.A,{title:s("New Product Option"),small:!0},void 0,(0,i.A)(l.A,{handleSubmit:this.save,instance:e,saveState:this.state.saveRequest?.state,errors:t}),c,p)}}const u=(0,o.CI)("app")(h)},37008(e,t,s){s.r(t),s.d(t,{default:()=>u});var i=s(64467),a=(s(96540),s(63710)),o=s(82960),n=s(69733),r=s(44913),d=s(57248),l=s(39685);class c extends l.uO{constructor(...e){super(...e),(0,i.A)(this,"add_permission","products_edit"),(0,i.A)(this,"add_instance_route","products:product_option_type_add")}getTitle(){const{t:e}=this.props;return e("Product Options")}getDescription(){const{t:e}=this.props;return e("Recently Modified Product Options.")}}const p=(0,l.tr)("products","product_option_types",(e,t)=>({title:e.name,link:{pathname:r.A.reverse("products:product_option_type_permalink",{external_id:e.external_id}),state:{localId:t,instance:e}}})),h=(0,a.CI)("app")(c),u=(0,n.Ng)(p,e=>(0,o.zH)({fetchInstances:d.gL},e))(h)},49909(e,t,s){s.r(t),s.d(t,{default:()=>u});var i=s(73620),a=s(64467),o=(s(96540),s(63710)),n=s(68119),r=s(24835),d=s(10233),l=s(51188);var c=(0,i.A)("br",{}),p=(0,i.A)("br",{});class h extends n.A{constructor(...e){super(...e),(0,a.A)(this,"apiEndpoint","products/{external_id}/product-option-types/"),(0,a.A)(this,"updateListActionType",r.c4)}render(){const{instance:e,errors:t}=this.state,{t:s}=this.props,a=void 0!==e.name?e.name:"";return(0,i.A)(d.A,{title:s("Option:")+" "+a,small:!0},void 0,(0,i.A)(l.A,{instance:e,handleSubmit:this.save,fetchState:this.state.fetchRequest?.state,saveState:this.state.saveRequest?.state,errors:t}),c,p)}}const u=(0,o.CI)("app")(h)},59329(e,t,s){s.r(t),s.d(t,{default:()=>g});var i=s(73620),a=s(64467),o=(s(96540),s(63710)),n=s(69733),r=s(68119),d=s(14165),l=s(24835),c=s(57248),p=s(53028),h=s(26069),u=s(63306),A=s(267),v=s(43505);class m extends r.A{constructor(...e){super(...e),(0,a.A)(this,"apiEndpoint","products/{external_id}/product/"),(0,a.A)(this,"updateListActionType",l.B3),(0,a.A)(this,"cleanSave",c.jr)}cleanFetch(e){let t={...e};return"object"==typeof t.currency&&(t.currency=t.currency.id),void 0===t.page_data&&(0,u.Ks)(A.vQ)&&(t.page_data=[(0,v.FV)()]),t}render(){const{currencies:e,has_gateway:t,subscriber:s}=this.props,{instance:a,errors:o}=this.state,{t:n}=this.props;return(0,i.A)(p.Ay,{caption:n("Item"),title:a.name},void 0,(0,i.A)(h.A,{instance:a,handleSubmit:this.save,fetchState:this.state.fetchRequest?.state,saveState:this.state.saveRequest?.state,errors:o,currencies:e,subscriber:s,has_gateway:t}))}}const _=(0,d.t)({currencies:!0,subscriber:!0,has_gateway:!0}),b=(0,o.CI)("app")(m),g=(0,n.Ng)(_)(b)},91983(e,t,s){s.r(t),s.d(t,{default:()=>p});var i=s(73620),a=s(96540),o=s(63710),n=s(44913),r=s(63306),d=s(267),l=s(92855);class c extends a.Component{constructor(e,t){super(e);const{subscriber:s}=this.props,{t:i}=this.props,a=(0,r.Ks)(d.TN);let o=[];(0,r.Jh)("products_view")&&(o.push({text:i("Products & Services"),className:"fa fa-flask",path:n.A.reverse("products:product_list")}),o.push({text:i("Product Options"),className:"fa fa-sliders",path:n.A.reverse("products:product_option_type_list")}),o.push({text:i("Categories"),className:"fa fa-list",path:n.A.reverse("products:category_list")}),o.push({text:i("Suppliers"),className:"fa fa-truck",path:n.A.reverse("products:supplier_list")}),o.push({text:i("Inventories"),className:"fa fa-pencil-square-o",path:n.A.reverse("products:inventory_list")}),o.push({text:i("Taxes"),className:"fa fa-gavel",path:n.A.reverse("products:tax_list")})),(0,r.Jh)("coupons_view")&&a&&o.push({text:i("Coupons"),className:"fa fa-tags",path:n.A.reverse("products:coupon_list")}),this.state={links:o,fromAlfred:e.location.state?.fromAlfred}}render(){const{t:e}=this.props,{links:t,fromAlfred:s}=this.state;let a;return s&&(a={text:e("Back to My Shop"),path:n.A.reverse("alfred:dashboard")}),(0,i.A)(l.A,{links:t,routeName:"products",backLink:a})}}const p=(0,o.CI)("app")(c)},86749(e,t,s){s.r(t),s.d(t,{default:()=>f});var i=s(73620),a=s(64467),o=(s(96540),s(63710)),n=s(69733),r=s(97530),d=s(14165),l=s(24835),c=s(57248),p=s(10233),h=s(83337),u=s(62193),A=s(12938);var v=(0,i.A)("br",{}),m=(0,i.A)("br",{});class _ extends r.A{constructor(...e){super(...e),(0,a.A)(this,"apiEndpoint","suppliers/"),(0,a.A)(this,"successRoute","products:supplier_list"),(0,a.A)(this,"updateListActionType",l.az),(0,a.A)(this,"cleanSave",c.Wd),(0,a.A)(this,"fetchOnMount",{locationsCR:"gatekeeper/costa-rica/locations/"})}getInitialInstance(){const{subscriber:e}=this.props;return{type:u.oA,country:e&&e.country?e.country:void 0}}render(){const{subscriber:e,pulse:t}=this.props,{instance:s,errors:a,locationsCR:o}=this.state,{t:n}=this.props;return(0,i.A)(p.A,{title:n("New Supplier")},void 0,(0,i.A)(h.A,{handleSubmit:this.save,instance:s,saveState:this.state.saveRequest?.state,errors:a,subscriber:e,pulse:t,locationsCR:o,identification_types:A.dQ}),v,m)}
1}const b=(0,d.t)({subscriber:!0,pulse:!0}),g=(0,o.CI)("app")(_),f=(0,n.Ng)(b)(g)},71532(e,t,s){s.r(t),s.d(t,{default:()=>u});var i=s(64467),a=(s(96540),s(63710)),o=s(82960),n=s(69733),r=s(20360),d=s(39685),l=s(62277);class c extends d.uO{constructor(...e){super(...e),(0,i.A)(this,"add_permission","products_edit"),(0,i.A)(this,"add_instance_route","products:supplier_add")}getTitle(){const{t:e}=this.props;return e("Suppliers")}getDescription(){const{t:e}=this.props;return e("Recently Modified Suppliers.")}}const p=(0,d.tr)("products","suppliers",(0,l.N)(!0)),h=(0,a.CI)("app")(c),u=(0,n.Ng)(p,e=>(0,o.zH)({fetchInstances:r.qQ},e))(h)},48350(e,t,s){s.r(t),s.d(t,{default:()=>g});var i=s(73620),a=s(64467),o=(s(96540),s(63710)),n=s(69733),r=s(68119),d=s(14165),l=s(24835),c=s(57248),p=s(10233),h=s(83337),u=s(12938);var A=(0,i.A)("br",{}),v=(0,i.A)("br",{});class m extends r.A{constructor(...e){super(...e),(0,a.A)(this,"apiEndpoint","suppliers/{external_id}/"),(0,a.A)(this,"updateListActionType",l.az),(0,a.A)(this,"cleanSave",c.Wd),(0,a.A)(this,"fetchOnMount",{locationsCR:"gatekeeper/costa-rica/locations/"})}cleanFetch(e){let t={...e};return void 0===t.country&&(t.country=subscriber&&subscriber.country?subscriber.country:void 0),t.supplier_ebilling_information&&(t.province=t.supplier_ebilling_information.province,t.canton=t.supplier_ebilling_information.canton,t.district=t.supplier_ebilling_information.district,t.other_signs=t.supplier_ebilling_information.other_signs,t.identification_type=t.supplier_ebilling_information.identification_type),t}render(){const{subscriber:e,pulse:t}=this.props,{instance:s,errors:a,locationsCR:o}=this.state,{t:n}=this.props;let r="";return s.company_name?r=s.company_name:s.legal_name&&(r=s.legal_name),(0,i.A)(p.A,{title:n("Supplier: {{n}}",{n:r})},void 0,(0,i.A)(h.A,{instance:s,handleSubmit:this.save,fetchState:this.state.fetchRequest?.state,saveState:this.state.saveRequest?.state,errors:a,subscriber:e,pulse:t,locationsCR:o,identification_types:u.dQ}),A,v)}}const _=(0,d.t)({subscriber:!0,pulse:!0}),b=(0,o.CI)("app")(m),g=(0,n.Ng)(_)(b)},7013(e,t,s){s.r(t),s.d(t,{default:()=>u});var i=s(73620),a=s(64467),o=(s(96540),s(63710)),n=s(97530),r=s(24835),d=s(10233),l=s(25684);var c=(0,i.A)("br",{}),p=(0,i.A)("br",{});class h extends n.A{constructor(...e){super(...e),(0,a.A)(this,"apiEndpoint","products/taxes/"),(0,a.A)(this,"successRoute","products:tax_list"),(0,a.A)(this,"updateListActionType",r.XV)}getInitialInstance(){return{is_default:!1}}render(){const{instance:e,errors:t}=this.state,{t:s}=this.props;return(0,i.A)(d.A,{title:s("New Tax"),small:!0},void 0,(0,i.A)(l.A,{handleSubmit:this.save,instance:e,saveState:this.state.saveRequest?.state,errors:t}),c,p)}}const u=(0,o.CI)("app")(h)},53556(e,t,s){s.r(t),s.d(t,{default:()=>A});var i=s(64467),a=(s(96540),s(63710)),o=s(82960),n=s(69733),r=s(44913),d=s(20360),l=s(39685),c=s(10661);class p extends l.uO{constructor(...e){super(...e),(0,i.A)(this,"add_permission","products_edit"),(0,i.A)(this,"add_instance_route","products:tax_add")}getTitle(){const{t:e}=this.props;return e("Taxes")}getDescription(){const{t:e}=this.props;return e("Recently Modified Taxes.")}}const h=(0,l.tr)("products","taxes",(e,t)=>({title:e.name||"",subtitle:e.description||"",extra:(0,c.G)(e),link:{pathname:r.A.reverse("products:tax_permalink",{external_id:e.id}),state:{localId:t,instance:e}}})),u=(0,a.CI)("app")(p),A=(0,n.Ng)(h,e=>(0,o.zH)({fetchInstances:d.sr},e))(u)},65795(e,t,s){s.r(t),s.d(t,{default:()=>u});var i=s(73620),a=s(64467),o=(s(96540),s(63710)),n=s(68119),r=s(24835),d=s(10233),l=s(25684);var c=(0,i.A)("br",{}),p=(0,i.A)("br",{});class h extends n.A{constructor(...e){super(...e),(0,a.A)(this,"apiEndpoint","products/{external_id}/taxes/"),(0,a.A)(this,"updateListActionType",r.XV)}render(){const{instance:e,errors:t}=this.state,{t:s}=this.props,a=void 0!==e.name?e.name:"";return(0,i.A)(d.A,{title:s("Tax:")+" "+a,small:!0},void 0,(0,i.A)(l.A,{instance:e,handleSubmit:this.save,fetchState:this.state.fetchRequest?.state,saveState:this.state.saveRequest?.state,errors:t}),c,p)}}const u=(0,o.CI)("app")(h)},10661(e,t,s){s.d(t,{G:()=>n,_:()=>r});var i=s(15192),a=s(62193),o=s(12901);function n(e){return void 0!==e&&void 0!==e.amount?e.type==a.iq?e.amount+"%":e.amount:""}function r(e,t,s,n){if(void 0!==e&&void 0!==t)if("string"==typeof t&&(t=new i.A(t)),e==a.iq){if(void 0!==s)return"string"==typeof s&&(s=new i.A(s)),void 0!==n?(n=""!==n?new i.A(n):new i.A(0),s.times(n.minus(1)).round(2,o.Oz)):s.div(100).times(t).round(2,o.Oz)}else if(e==a.et)return new i.A(t);return new i.A(0)}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.