text: (this.webpackJsonp=this.webpackJsonp||[]).push([["dvsn-product-option"],{CYRR:function(t,e,n){},HFQS:function(t){t.exports=JSON.parse('{"dvsn-product-option":{"general":{"name":"Product Options","menu-item-name":"Options","menu-item-description":"Manage all product options here","type":{"percental":"Percentage","absolute":"Absolute"},"calculation":{"once":"Per position","quantity":"Per piece"},"icon":{"bag":"Cart","bag-product":"Cart and product","warning":"Warning","alert":"Alert","trophy":"Trophy","star":"Star","plus":"Plus symbol","plus-block":"Plus symbol - angular frame","plus-circle":"Plus symbol - round frame","plus-wide":"Plus symbol - broad","checkmark":"Checkmark","checkmark-block":"Checkmark - angular frame","checkmark-circle":"Checkmark - round frame","checkmark-wide":"Checkmark - broad","arrow-circle-down":"Arrow - down","arrow-circle-left":"Arrow - left","arrow-circle-right":"Arrow - right","arrow-circle-up":"Arrow - up"}},"list":{"column-number":"Number","column-name":"Name","column-active":"Active","column-created-at":"Date","search":{"placeholder":"Search all product options...","type":"Product Options"},"actions":{"add":"Create product option"},"sidebar":{"refresh":"Refresh"}},"detail":{"actions":{"save-button":"Save","cancel-button":"Cancel"},"success-title":"Product option saved","success-message":"The product option was saved successfully.","error-message":"An error has occurred","error-message-tax-required-title":"Select tax rate","error-message-tax-required-message":"When selecting an absolute surcharge, you must select a tax rate.","card-product":{"title":"Master data","active":"Active","number":"Number","number-help":"The part number of the option.","name":"Name","name-help":"The name of the option.","description":"Description","description-help":"An optional description for the product detail page.","media":"Image","icon-select":"Icon","icon-select-help":"If you do not store an image for this option, you can select an icon here that will be displayed in the shopping cart.","weight":"Weight"},"card-surcharge":{"title":"Surcharge / Discount","type-select":"Type of surcharge / discount","surcharge":"Surcharge / discount","calculation-select":"Calculation of the surcharge / discount","tax":"Tax rate","tax-help":"The selection of a tax rate is only obligatory in the case of an absolute surcharge / discount."}}}}')},PJNE:function(t,e){t.exports='\n<sw-page class="dvsn-product-option-detail">\n    <template slot="smart-bar-actions">\n        <sw-button\n            :disabled="isLoading"\n            :routerLink="{ name: \'dvsn.product.option.list\' }">\n            {{ $t(\'dvsn-product-option.detail.actions.cancel-button\') }}\n        </sw-button>\n        <sw-button-process\n            :isLoading="isLoading"\n            v-model="isSaveSuccessful"\n            variant="primary"\n            @process-finish="saveFinish"\n            @click="onClickSave">\n            {{ $t(\'dvsn-product-option.detail.actions.save-button\') }}\n        </sw-button-process>\n    </template>\n\n    {% block dvsn_product_option_detail_language_select %}\n    <template #language-switch>\n        <sw-language-switch\n            :saveChangesFunction="saveOnLanguageChange"\n            :abortChangeFunction="abortOnLanguageChange"\n            @on-change="onChangeLanguage">\n        </sw-language-switch>\n    </template>\n    {% endblock %}\n\n    <template slot="content">\n        <sw-card-view>\n            <sw-card :isLoading="isLoading"\n                     :title="$tc(\'dvsn-product-option.detail.card-product.title\')">\n                <sw-field\n                    v-if="productOption"\n                    type="switch"\n                    :label="$tc(\'dvsn-product-option.detail.card-product.active\')"\n                    :noMarginTop="true"\n                    v-model="productOption.active">\n                </sw-field>\n\n                <sw-container columns="1fr 1fr" style="column-gap: 40px">\n                    <sw-field\n                        v-if="productOption"\n                        type="switch"\n                        :label="$tc(\'dvsn-product-option.detail.card-product.mandatory\')"\n                        :helpText="$tc(\'dvsn-product-option.detail.card-product.mandatory-help\')"\n                        :noMarginTop="true"\n                        v-model="productOption.mandatory">\n                    </sw-field>\n\n                    <sw-field\n                        v-if="productOption"\n                        type="switch"\n                        :label="$tc(\'dvsn-product-option.detail.card-product.hidden\')"\n                        :helpText="$tc(\'dvsn-product-option.detail.card-product.hidden-help\')"\n                        :noMarginTop="true"\n                        v-model="productOption.hidden">\n                    </sw-field>\n                </sw-container>\n\n                <sw-field\n                    type="text"\n                    v-if="productOption"\n                    v-model="productOption.number"\n                    validation="required"\n                    required\n                    :label="$t(\'dvsn-product-option.detail.card-product.number\')"\n                    :helpText="$tc(\'dvsn-product-option.detail.card-product.number-help\')">\n                </sw-field>\n\n                <sw-field\n                    v-if="productOption"\n                    v-model="productOption.name"\n                    validation="required"\n                    required\n                    :label="$t(\'dvsn-product-option.detail.card-product.name\')"\n                    :helpText="$tc(\'dvsn-product-option.detail.card-product.name-help\')">\n                </sw-field>\n\n                <sw-field\n                    v-if="productOption"\n                    v-model="productOption.description"\n                    :label="$t(\'dvsn-product-option.detail.card-product.description\')"\n                    :helpText="$tc(\'dvsn-product-option.detail.card-product.description-help\')">\n                </sw-field>\n\n                \x3c!--\n                <sw-number-field\n                    v-if="productOption"\n                    v-model="productOption.weight"\n                    numberType="float"\n                    :digits="3"\n                    :label="$t(\'dvsn-product-option.detail.card-product.weight\')">\n                </sw-number-field>\n                --\x3e\n            </sw-card>\n\n            <sw-card :isLoading="isLoading"\n                     :title="$tc(\'dvsn-product-option.detail.card-surcharge.title\')">\n                <sw-field v-if="productOption"\n                          v-model="productOption.surchargeType"\n                          validation="required"\n                          required\n                          type="select"\n                          :label="$tc(\'dvsn-product-option.detail.card-surcharge.type-select\')" >\n                    <option slot="options"\n                            v-for="option in type"\n                            :key="option.value"\n                            :value="option.value">\n                        {{ option.label }}\n                    </option>\n                </sw-field>\n\n                <sw-number-field\n                    v-if="productOption"\n                    v-model="productOption.surcharge"\n                    numberType="float"\n                    validation="required"\n                    required\n                    :digits="2"\n                    :label="$t(\'dvsn-product-option.detail.card-surcharge.surcharge\')">\n                </sw-number-field>\n\n                <sw-field v-if="productOption"\n                          v-model="productOption.surchargeCalculation"\n                          validation="required"\n                          required\n                          type="select"\n                          :label="$tc(\'dvsn-product-option.detail.card-surcharge.calculation-select\')" >\n                    <option slot="options"\n                            v-for="option in calculation"\n                            :key="option.value"\n                            :value="option.value">\n                        {{ option.label }}\n                    </option>\n                </sw-field>\n\n                <sw-entity-single-select\n                    v-if="productOption"\n                    entity="tax"\n                    v-model="productOption.taxId"\n                    :helpText="$tc(\'dvsn-product-option.detail.card-surcharge.tax-help\')"\n                    :label="$t(\'dvsn-product-option.detail.card-surcharge.tax\')">\n                </sw-entity-single-select>\n            </sw-card>\n        </sw-card-view>\n    </template>\n</sw-page>\n'},TPg0:function(t,e){t.exports="\n{% block dvsn_product_option_detail_language_select %}{% endblock %}\n"},ZLo0:function(t,e,n){},bJG5:function(t){t.exports=JSON.parse('{"dvsn-product-option":{"general":{"name":"Produkt Optionen","menu-item-name":"Optionen","menu-item-description":"Verwalte alle Produkt Optionen hier","type":{"percental":"Prozentual","absolute":"Absolut"},"calculation":{"once":"Pro Position","quantity":"Pro Stück"},"icon":{"bag":"Warenkorb","bag-product":"Warenkorb und Produkt","warning":"Warnung","alert":"Hinweis","trophy":"Pokal","star":"Stern","plus":"Plus Zeichen","plus-block":"Plus Zeichen - eckiger Rahmen","plus-circle":"Plus Zeichen - runder Rahmen","plus-wide":"Plus Zeichen - breit","checkmark":"Häkchen","checkmark-block":"Häkchen - eckiger Rahmen","checkmark-circle":"Häkchen - runder Rahmen","checkmark-wide":"Häkchen - breit","arrow-circle-down":"Pfeil - nach unten","arrow-circle-left":"Pfeil - nach links","arrow-circle-right":"Pfeil - nach rechts","arrow-circle-up":"Pfeil - nach oben"}},"list":{"column-number":"Nummer","column-name":"Name","column-active":"Aktiv","column-created-at":"Datum","search":{"placeholder":"Durchsuche alle Produkt Optionen...","type":"Produkt Optionen"},"actions":{"add":"Produkt Option anlegen"},"sidebar":{"refresh":"Aktualisieren"}},"detail":{"actions":{"save-button":"Speichern","cancel-button":"Abbrechen"},"success-title":"Pseudo Produkt gespeichert","success-message":"Das Pseudo Produkt wurde erfolgreich gespeichert.","error-message":"Ein Fehler ist aufgetreten","error-message-tax-required-title":"Steuersatz wählen","error-message-tax-required-message":"Bei der Auswahl eines absoluten Auf-/Abschlags müssen Sie einen Steuersatz wählen.","card-product":{"title":"Stammdaten","active":"Aktiv","mandatory":"Pflichtfeld","mandatory-help":"Pflichtfelder sind immer automatisch markiert und können nicht abgewählt werden.","hidden":"Versteckt","hidden-help":"Versteckte Optionen werden dem Kunden nicht angezeigt. Nur sinnvoll, wenn das Feld als Pflichtfeld markiert ist.","number":"Nummer","number-help":"Die Artikelnummer der Option.","name":"Name","name-help":"Der Name der Option","description":"Beschreibung","description-help":"Eine optionale Beschreibung für die Artikeldetailseite.","media":"Bild","icon-select":"Icon","icon-select-help":"Falls Sie für die Option kein Bild hinterlegen, dann können Sie hier ein Icon auswählen, das im Warenkorb angezeigt wird.","weight":"Gewicht"},"card-surcharge":{"title":"Auf-/Abschlag","type-select":"Art des Auf-/Abschlags","surcharge":"Auf-/Abschlag","calculation-select":"Berechnung des Auf-/Abschlags","tax":"Steuersatz","tax-help":"Die Auswahl eines Steuersatzes ist nur bei einem absoluten Auf-/Abschlag verpflichtend."}}}}')},bgWF:function(t,e,n){var o=n("CYRR");"string"==typeof o&&(o=[[t.i,o,""]]),o.locals&&(t.exports=o.locals);(0,n("SZ7m").default)("742b55fc",o,!0,{})},oSJ6:function(t,e,n){"use strict";n.r(e);var o=n("uqrl"),i=n.n(o),r=(n("tTHr"),Shopware),a=r.Component,s=r.Mixin,c=Shopware.Data.Criteria;a.register("dvsn-product-option-list",{template:i.a,inject:["repositoryFactory"],mixins:[s.getByName("notification"),s.getByName("listing")],data:function(){return{productOptions:null,isLoading:!0}},metaInfo:function(){return{title:this.$createTitle()}},computed:{columns:function(){return this.getColumns()},repository:function(){return this.getRepository()}},methods:{getColumns:function(){return[{property:"name",dataIndex:"name",label:this.$t("dvsn-product-option.list.column-name"),allowResize:!0},{property:"number",dataIndex:"number",label:this.$t("dvsn-product-option.list.column-number"),allowResize:!0},{property:"active",dataIndex:"active",label:this.$t("dvsn-product-option.list.column-active"),allowResize:!0},{property:"createdAt",dataIndex:"createdAt",label:this.$t("dvsn-product-option.list.column-created-at"),allowResize:!0}]},getRepository:function(){return this.repositoryFactory.create("dvsn_product_option")},getList:function(){var t=this;this.isLoading=!0;var e=new c;e.addSorting(c.sort("createdAt","DESC")),e.setTerm(this.term),this.repository.search(e,Shopware.Context.api).then((function(e){t.productOptions=e,t.isLoading=!1}))}},created:function(){}});var d=n("PJNE"),l=n.n(d),p=(n("bgWF"),Shopware),u=p.Component,h=p.Mixin,m=(p.StateDeprecated,Shopware.Data.Criteria);u.register("dvsn-product-option-detail",{template:l.a,inject:["repositoryFactory"],mixins:[h.getByName("placeholder"),h.getByName("notification")],metaInfo:function(){return{title:this.$createTitle()}},data:function(){return{productOption:null,isLoading:!1,isSaveSuccessful:!1,type:[{value:"percental",label:this.$tc("dvsn-product-option.general.type.percental")},{value:"absolute",label:this.$tc("dvsn-product-option.general.type.absolute")}],calculation:[{value:"once",label:this.$tc("dvsn-product-option.general.calculation.once")},{value:"quantity",label:this.$tc("dvsn-product-option.general.calculation.quantity")}]}},created:function(){this.getProductOption()},computed:{repository:function(){return this.repositoryFactory.create("dvsn_product_option")},criteria:function(){var t=new m;return t.addAssociation("tax").addAssociation("media").addSorting(m.sort("createdAt","DESC")),t}},methods:{getProductOption:function(){var t=this;this.isLoading=!0,this.repository.get(this.$route.params.id,Shopware.Context.api,this.criteria).then((function(e){t.productOption=e,t.isLoading=!1}))},abortOnLanguageChange:function(){return this.repository.hasChanges(this.productOption)},saveOnLanguageChange:function(){return this.onClickSave()},onChangeLanguage:function(){this.getProductOption()},onClickSave:function(){var t=this;if("absolute"===this.productOption.surchargeType&&null===this.productOption.taxId)return this.createNotificationError({title:this.$t("dvsn-product-option.detail.error-message-tax-required-title"),message:this.$t("dvsn-product-option.detail.error-message-tax-required-message")});this.isLoading=!0,this.isSaveSuccessful=!1,this.repository.save(this.productOption,Shopware.Context.api,this.criteria).then((function(){t.getProductOption(),t.isLoading=!1,t.isSaveSuccessful=!0})).catch((function(e){t.isLoading=!1,t.createNotificationError({title:t.$t("dvsn-product-option.detail.error-message"),message:e})}))},saveFinish:function(){}}});var g=n("TPg0"),v=n.n(g);Shopware.Component.extend("dvsn-product-option-create","dvsn-product-option-detail",{template:v.a,methods:{getProductOption:function(){Shopware.State.commit("context/setApiLanguageId",Shopware.Context.api.systemLanguageId),this.productOption=this.repository.create(Shopware.Context.api),this.productOption.active=!0,this.productOption.hidden=!1,this.productOption.mandatory=!1,this.productOption.icon="arrow-circle-right",this.productOption.surcharge=0,this.productOption.surchargeType="percental",this.productOption.surchargeCalculation="once"},onClickSave:function(){var t=this;if(this.productOption.active=Boolean(this.productOption.active),this.productOption.hidden=Boolean(this.productOption.hidden),this.productOption.mandatory=Boolean(this.productOption.mandatory),"absolute"===this.productOption.surchargeType&&(null===this.productOption.taxId||void 0===this.productOption.taxId))return this.createNotificationError({title:this.$t("dvsn-product-option.detail.error-message-tax-required-title"),message:this.$t("dvsn-product-option.detail.error-message-tax-required-message")});this.isLoading=!0,this.repository.save(this.productOption,Shopware.Context.api).then((function(){t.isLoading=!1,t.$router.push({name:"dvsn.product.option.detail",params:{id:t.productOption.id}}),t.createNotificationSuccess({title:t.$t("dvsn-product-option.detail.success-title"),message:t.$t("dvsn-product-option.detail.success-message")})})).catch((function(e){t.isLoading=!1,t.createNotificationError({title:t.$t("dvsn-product-option.detail.error-message"),message:e})}))}}});var f=n("bJG5"),b=n("HFQS");Shopware.Module.register("dvsn-product-option",{type:"plugin",name:"dvsn-product-option.general.name",title:"dvsn-product-option.general.menu-item-name",description:"dvsn-product-option.general.menu-item-description",color:"#57D9A3",icon:"default-symbol-content",snippets:{"de-DE":f,"en-GB":b},routes:{list:{component:"dvsn-product-option-list",path:"list"},detail:{component:"dvsn-product-option-detail",path:"detail/:id",meta:{parentPath:"dvsn.product.option.list"}},create:{component:"dvsn-product-option-create",path:"create",meta:{parentPath:"dvsn.product.option.list"}}},navigation:[{id:"dvsn-product-option",label:"dvsn-product-option.general.menu-item-name",color:"#57D9A3",position:95,path:"dvsn.product.option.list",icon:"default-symbol-content",parent:"sw-catalogue"}]})},tTHr:function(t,e,n){var o=n("ZLo0");"string"==typeof o&&(o=[[t.i,o,""]]),o.locals&&(t.exports=o.locals);(0,n("SZ7m").default)("5fa6d9a9",o,!0,{})},uqrl:function(t,e){t.exports='\n<sw-page class="dvsn-product-option-list">\n    <template slot="search-bar">\n        <sw-search-bar :initialSearchType="$tc(\'dvsn-product-option.list.search.type\')"\n                       :placeholder="$tc(\'dvsn-product-option.list.search.placeholder\')"\n                       :initialSearch="term"\n                       @search="onSearch">\n        </sw-search-bar>\n    </template>\n\n    <template slot="smart-bar-actions">\n        <sw-button data-cy="addButton" variant="primary" :routerLink="{ name: \'dvsn.product.option.create\' }">\n            {{ $t(\'dvsn-product-option.list.actions.add\') }}\n        </sw-button>\n    </template>\n\n    <template slot="content">\n        <sw-entity-listing\n            v-if="productOptions"\n            :items="productOptions"\n            :repository="repository"\n            :columns="columns"\n            :isLoading="isLoading"\n            :showActions="true"\n            :showSelection="false"\n            :showSettings="false"\n            detailRoute="dvsn.product.option.detail">\n            <template #column-name="{ item }">\n                {{ item.name }}\n            </template>\n\n            <template #column-number="{ item }">\n                {{ item.number }}\n            </template>\n\n            <template #column-active="{ item }">\n                <template>\n                    <sw-icon v-if="item.active" name="small-default-checkmark-line-medium" small class="is--active"></sw-icon>\n                    <sw-icon v-else name="small-default-x-line-medium" small class="is--inactive"></sw-icon>\n                </template>\n            </template>\n\n            <template #column-createdAt="{ item }">\n                {{ item.createdAt | date({hour: \'2-digit\', minute: \'2-digit\'}) }} Uhr\n            </template>\n        </sw-entity-listing>\n\n        <sw-loader v-if="isLoading"></sw-loader>\n    </template>\n\n    <sw-sidebar slot="sidebar">\n        <sw-sidebar-item\n            icon="default-arrow-360-left"\n            :title="$tc(\'dvsn-product-option.list.sidebar.refresh\')"\n            @click="onRefresh">\n        </sw-sidebar-item>\n    </sw-sidebar>\n</sw-page>\n'}},[["oSJ6","runtime","vendors-node"]]]);