text: (window.webpackJsonp=window.webpackJsonp||[]).push([[11],{"/IIy":function(e,t,a){"use strict";a.r(t);var s=a("dhqo"),o=a.n(s),i=a("ke3Z"),r={head:{title:function(){return{inner:"Create a "+_.startCase(this.singular)||!1}}},data:function(){return{taxonomy:{},form:new i.a({})}},components:{"shared-form":a("tqtD").a},computed:{sections:function(){var e=[],t=[];return this.taxonomy.fieldset&&(e=_.filter(this.taxonomy.fieldset.sections,(function(e){return"body"==e.placement})),t=_.filter(this.taxonomy.fieldset.sections,(function(e){return"sidebar"==e.placement}))),{body:e,sidebar:t}},singular:function(){return this.taxonomy.name?o.a.singular(this.taxonomy.name):""}},methods:{submit:function(){var e=this;this.form.post("/api/taxonomies/"+this.taxonomy.slug).then((function(t){toast("Entry saved successfully","success"),e.$router.push("/taxonomies/"+e.taxonomy.slug)})).catch((function(e){toast(e.response.data.message,"failed")}))}},beforeRouteEnter:function(e,t,a){axios.get("/api/taxonomies/slug/"+e.params.taxonomy).then((function(e){a((function(t){t.taxonomy=e.data.data;var a={name:"",slug:"",status:1};t.taxonomy.fieldset&&_.forEach(t.taxonomy.fieldset.sections,(function(e){_.forEach(e.fields,(function(e){Vue.set(a,e.handle,e.default)}))})),t.form=new i.a(a,!0),t.$emit("updateHead"),t.$nextTick((function(){t.form.resetChangeListener()}))}))}))}},n=a("KHd+"),l=Object(n.a)(r,(function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",[a("portal",{attrs:{to:"title"}},[a("app-title",{attrs:{icon:e.taxonomy.icon}},[e._v("Create "+e._s(e.singular))])],1),e._v(" "),a("portal",{attrs:{to:"subtitle"}},[e._v(e._s(e.taxonomy.description))]),e._v(" "),a("shared-form",{attrs:{taxonomy:e.taxonomy,form:e.form}})],1)}),[],!1,null,null,null);t.default=l.exports},dhqo:function(e,t,a){e.exports=function(){var e=[],t=[],a={},s={},o={};function i(e){return"string"==typeof e?new RegExp("^"+e+"$","i"):e}function r(e,t){return e===t?t:e===e.toLowerCase()?t.toLowerCase():e===e.toUpperCase()?t.toUpperCase():e[0]===e[0].toUpperCase()?t.charAt(0).toUpperCase()+t.substr(1).toLowerCase():t.toLowerCase()}function n(e,t){return e.replace(/\$(\d{1,2})/g,(function(e,a){return t[a]||""}))}function l(e,t){return e.replace(t[0],(function(a,s){var o=n(t[1],arguments);return r(""===a?e[s-1]:a,o)}))}function u(e,t,s){if(!e.length||a.hasOwnProperty(e))return t;for(var o=s.length;o--;){var i=s[o];if(i[0].test(t))return l(t,i)}return t}function c(e,t,a){return function(s){var o=s.toLowerCase();return t.hasOwnProperty(o)?r(s,o):e.hasOwnProperty(o)?r(s,e[o]):u(o,s,a)}}function m(e,t,a,s){return function(s){var o=s.toLowerCase();return!!t.hasOwnProperty(o)||!e.hasOwnProperty(o)&&u(o,o,a)===o}}function d(e,t,a){return(a?t+" ":"")+(1===t?d.singular(e):d.plural(e))}return d.plural=c(o,s,e),d.isPlural=m(o,s,e),d.singular=c(s,o,t),d.isSingular=m(s,o,t),d.addPluralRule=function(t,a){e.push([i(t),a])},d.addSingularRule=function(e,a){t.push([i(e),a])},d.addUncountableRule=function(e){"string"!=typeof e?(d.addPluralRule(e,"$0"),d.addSingularRule(e,"$0")):a[e.toLowerCase()]=!0},d.addIrregularRule=function(e,t){t=t.toLowerCase(),e=e.toLowerCase(),o[e]=t,s[t]=e},[["I","we"],["me","us"],["he","they"],["she","they"],["them","them"],["myself","ourselves"],["yourself","yourselves"],["itself","themselves"],["herself","themselves"],["himself","themselves"],["themself","themselves"],["is","are"],["was","were"],["has","have"],["this","these"],["that","those"],["echo","echoes"],["dingo","dingoes"],["volcano","volcanoes"],["tornado","tornadoes"],["torpedo","torpedoes"],["genus","genera"],["viscus","viscera"],["stigma","stigmata"],["stoma","stomata"],["dogma","dogmata"],["lemma","lemmata"],["schema","schemata"],["anathema","anathemata"],["ox","oxen"],["axe","axes"],["die","dice"],["yes","yeses"],["foot","feet"],["eave","eaves"],["goose","geese"],["tooth","teeth"],["quiz","quizzes"],["human","humans"],["proof","proofs"],["carve","carves"],["valve","valves"],["looey","looies"],["thief","thieves"],["groove","grooves"],["pickaxe","pickaxes"],["passerby","passersby"]].forEach((function(e){return d.addIrregularRule(e[0],e[1])})),[[/s?$/i,"s"],[/[^\u0000-\u007F]$/i,"$0"],[/([^aeiou]ese)$/i,"$1"],[/(ax|test)is$/i,"$1es"],[/(alias|[^aou]us|t[lm]as|gas|ris)$/i,"$1es"],[/(e[mn]u)s?$/i,"$1s"],[/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i,"$1"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1i"],[/(alumn|alg|vertebr)(?:a|ae)$/i,"$1ae"],[/(seraph|cherub)(?:im)?$/i,"$1im"],[/(her|at|gr)o$/i,"$1oes"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i,"$1a"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i,"$1a"],[/sis$/i,"ses"],[/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i,"$1$2ves"],[/([^aeiouy]|qu)y$/i,"$1ies"],[/([^ch][ieo][ln])ey$/i,"$1ies"],[/(x|ch|ss|sh|zz)$/i,"$1es"],[/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i,"$1ices"],[/\b((?:tit)?m|l)(?:ice|ouse)$/i,"$1ice"],[/(pe)(?:rson|ople)$/i,"$1ople"],[/(child)(?:ren)?$/i,"$1ren"],[/eaux$/i,"$0"],[/m[ae]n$/i,"men"],["thou","you"]].forEach((function(e){return d.addPluralRule(e[0],e[1])})),[[/s$/i,""],[/(ss)$/i,"$1"],[/(wi|kni|(?:after|half|high|low|mid|non|night|[^\w]|^)li)ves$/i,"$1fe"],[/(ar|(?:wo|[ae])l|[eo][ao])ves$/i,"$1f"],[/ies$/i,"y"],[/\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i,"$1ie"],[/\b(mon|smil)ies$/i,"$1ey"],[/\b((?:tit)?m|l)ice$/i,"$1ouse"],[/(seraph|cherub)im$/i,"$1"],[/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|t[lm]as|gas|(?:her|at|gr)o|[aeiou]ris)(?:es)?$/i,"$1"],[/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i,"$1sis"],[/(movie|twelve|abuse|e[mn]u)s$/i,"$1"],[/(test)(?:is|es)$/i,"$1is"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1us"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i,"$1um"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i,"$1on"],[/(alumn|alg|vertebr)ae$/i,"$1a"],[/(cod|mur|sil|vert|ind)ices$/i,"$1ex"],[/(matr|append)ices$/i,"$1ix"],[/(pe)(rson|ople)$/i,"$1rson"],[/(child)ren$/i,"$1"],[/(eau)x?$/i,"$1"],[/men$/i,"man"]].forEach((function(e){return d.addSingularRule(e[0],e[1])})),["adulthood","advice","agenda","aid","aircraft","alcohol","ammo","analytics","anime","athletics","audio","bison","blood","bream","buffalo","butter","carp","cash","chassis","chess","clothing","cod","commerce","cooperation","corps","debris","diabetes","digestion","elk","energy","equipment","excretion","expertise","firmware","flounder","fun","gallows","garbage","graffiti","hardware","headquarters","health","herpes","highjinks","homework","housework","information","jeans","justice","kudos","labour","literature","machinery","mackerel","mail","media","mews","moose","music","mud","manga","news","only","personnel","pike","plankton","pliers","police","pollution","premises","rain","research","rice","salmon","scissors","series","sewage","shambles","shrimp","software","species","staff","swine","tennis","traffic","transportation","trout","tuna","wealth","welfare","whiting","wildebeest","wildlife","you",/pok[eé]mon$/i,/[^aeiou]ese$/i,/deer$/i,/fish$/i,/measles$/i,/o[iu]s$/i,/pox$/i,/sheep$/i].forEach(d.addUncountableRule),d}()},tqtD:function(e,t,a){"use strict";var s={props:{taxonomy:{type:Object,required:!0},form:{type:Object,required:!0}},computed:{sections:function(){return this.$parent.sections}}},o=a("KHd+"),i=Object(o.a)(s,(function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"row"},[a("portal",{attrs:{to:"actions"}},[e.taxonomy.slug?a("router-link",{staticClass:"button mr-3",attrs:{to:{name:"terms.index",params:{taxonomy:e.taxonomy.slug}}}},[e._v("Go Back")]):e._e(),e._v(" "),a("button",{staticClass:"button button--primary",class:{"button--disabled":!e.form.hasChanges},attrs:{type:"submit",disabled:!e.form.hasChanges},on:{click:function(t){return t.preventDefault(),e.$parent.submit(t)}}},[e._v("Save Term")])],1),e._v(" "),a("div",{staticClass:"content-container"},[a("form",{on:{submit:function(t){return t.preventDefault(),e.$parent.submit(t)}}},[a("p-card",[a("div",{staticClass:"row"},[a("div",{staticClass:"col form-sidebar"},[a("div",{staticClass:"xxl:mr-10"})]),e._v(" "),a("div",{staticClass:"col mb-6 form-content"},[a("div",{staticClass:"row"},[a("div",{staticClass:"col w-1/2"},[a("p-input",{attrs:{name:"name",label:"Name","has-error":e.form.errors.has("name"),"error-message":e.form.errors.get("name")},model:{value:e.form.name,callback:function(t){e.$set(e.form,"name",t)},expression:"form.name"}})],1),e._v(" "),a("div",{staticClass:"col w-1/2"},[a("p-slug",{attrs:{name:"slug",label:"Slug",monospaced:"","has-error":e.form.errors.has("slug"),"error-message":e.form.errors.get("slug"),watch:e.form.name},model:{value:e.form.slug,callback:function(t){e.$set(e.form,"slug",t)},expression:"form.slug"}})],1)])])]),e._v(" "),e.sections.body.length>0?a("div",e._l(e.sections.body,(function(t,s){return a("div",{key:t.handle},[a("div",{staticClass:"row"},[a("div",{staticClass:"col form-sidebar"},[a("div",{staticClass:"xxl:mr-10"},[a("h3",[e._v(e._s(t.name))]),e._v(" "),a("p",{staticClass:"text-sm"},[e._v(e._s(t.description))])])]),e._v(" "),a("div",{staticClass:"col form-content"},e._l(t.fields,(function(t){return a("div",{key:t.handle,staticClass:"form__group"},[a(t.type.id+"-fieldtype",{tag:"component",attrs:{field:t},model:{value:e.form[t.handle],callback:function(a){e.$set(e.form,t.handle,a)},expression:"form[field.handle]"}})],1)})),0)]),e._v(" "),s!==e.sections.body.length-1?a("hr"):e._e()])})),0):a("div",{staticClass:"text-center"},[a("p",[e._v("You should configure your Taxonomy with some sections and fields first "),a("fa-icon",{staticClass:"text-emoji",attrs:{icon:["fas","hand-peace"]}})],1),e._v(" "),e.taxonomy.id?a("router-link",{staticClass:"button items-center",attrs:{to:{name:"taxonomies.edit",params:{taxonomy:e.taxonomy.id}}}},[a("fa-icon",{staticClass:"mr-2 text-sm",attrs:{icon:["fas","edit"]}}),e._v(" Manage your taxonomy")],1):e._e()],1)])],1)]),e._v(" "),a("div",{staticClass:"side-container"},[a("form",{on:{submit:function(t){return t.preventDefault(),e.$parent.submit(t)}}},[a("p-card",[a("div",{staticClass:"row"},[a("div",{staticClass:"col w-full"},[a("p-select",{attrs:{name:"status",label:"Status",options:[{label:"Enabled",value:1},{label:"Disabled",value:0}]},model:{value:e.form.status,callback:function(t){e.$set(e.form,"status",t)},expression:"form.status"}})],1)])]),e._v(" "),e._l(e.sections.sidebar,(function(t){return a("p-card",{key:t.handle,staticClass:"mt-6"},[a("h3",[e._v(e._s(t.name))]),e._v(" "),a("p",{staticClass:"text-sm"},[e._v(e._s(t.description))]),e._v(" "),a("div",{staticClass:"w-full"},e._l(t.fields,(function(t){return a("div",{key:t.handle,staticClass:"form__group"},[a(t.type.id+"-fieldtype",{tag:"component",attrs:{field:t},model:{value:e.form[t.handle],callback:function(a){e.$set(e.form,t.handle,a)},expression:"form[field.handle]"}})],1)})),0)])}))],2)])],1)}),[],!1,null,null,null);t.a=i.exports}}]);