(function(e){function t(t){for(var a,o,i=t[0],d=t[1],l=t[2],u=0,m=[];u1&&(e.order.decreaseQuantity(e.product.productId),e.$forceUpdate())}}},[e._v("-")]),r("input",{directives:[{name:"model",rawName:"v-model",value:e.productQuantity,expression:"productQuantity"}],staticClass:"form-control max-width-50 d-inline text-center",attrs:{type:"number",min:"1",step:"1"},domProps:{value:e.productQuantity},on:{input:function(t){t.target.composing||(e.productQuantity=t.target.value)}}}),r("button",{staticClass:"btn btn-link text-dark",on:{click:function(){e.order.increaseQuantity(e.product.productId),e.$forceUpdate()}}},[e._v("+")])]),e.getConfigProperty("discountCode")?[r("div",{staticClass:"my-4"},[r("input",{directives:[{name:"model",rawName:"v-model",value:e.discountCode,expression:"discountCode"}],staticClass:"form-control max-width-230 d-inline",attrs:{placeholder:"Discount code"},domProps:{value:e.discountCode},on:{input:function(t){t.target.composing||(e.discountCode=t.target.value)}}}),r("button",{staticClass:"btn btn-link text-dark",on:{click:e.applyDiscountCode}},[e._v(" Apply ")]),r("div",[e.order.getFieldError("discountCode")?r("span",{staticClass:"text-danger"},[e._v(e._s(e.order.getFieldError("discountCode")))]):e._e()])])]:e._e(),r("button",{staticClass:"btn btn-gradient-dark md-block my-4",attrs:{disabled:e.pending},on:{click:function(t){return e.switchStage(2)}}},[e._v("Order and pay "+e._s(e.amountToPay)+" "),e.pending?r("b-spinner",{staticClass:"ml-2",attrs:{variant:"light",small:"",label:"Payment pending"}}):e._e()],1)],2)])]:e._e(),2===e.stage?[r("div",{staticClass:"row-out d-flex flex-wrap pt-4"},[r("div",{staticClass:"col-12 col-md-4 card-out border-0 pl-0 pr-4"},[r("p",{staticClass:"title_section top-border text-uppercase"},[e._v("Shipping Method")]),r("div",[r("ul",{attrs:{id:"delivery-options-list"}},e._l(e.deliveryOptions,(function(t,a){return r("li",{key:a,class:{selected:e.order.data.deliveryProduct===t.id}},[r("b-form-radio",{attrs:{name:"deliveryProduct",value:t.id},model:{value:e.order.data.deliveryProduct,callback:function(t){e.$set(e.order.data,"deliveryProduct",t)},expression:"order.data.deliveryProduct"}},[t.data.image?r("div",{staticClass:"mr-1"},[r("img",{attrs:{src:t.data.image,alt:""}})]):e._e(),r("div",[e._v(e._s(t.name))]),r("div",[e._v("1 - 2 days")])])],1)})),0)]),e.order.getFieldError("deliveryProduct")?r("span",{staticClass:"text-danger"},[e._v(e._s(e.order.getFieldError("deliveryProduct")))]):e._e()]),r("div",{staticClass:"col-12 col-md-4 card-out border-0 pl-0 pr-4"},[r("p",{staticClass:"title_section top-border text-uppercase"},[e._v("Your details")]),r("div",[r("b-form-radio",{attrs:{name:"clientKind",value:"0",inline:""},model:{value:e.order.data.client.kind,callback:function(t){e.$set(e.order.data.client,"kind",t)},expression:"order.data.client.kind"}},[e._v(" Private person ")]),r("b-form-radio",{attrs:{name:"clientKind",value:"1",inline:""},model:{value:e.order.data.client.kind,callback:function(t){e.$set(e.order.data.client,"kind",t)},expression:"order.data.client.kind"}},[e._v(" Firm ")])],1),r("div",{staticClass:"row"},["1"===e.order.data.client.kind?[r("div",{staticClass:"col-12 my-1"},[r("input",{directives:[{name:"model",rawName:"v-model",value:e.order.data.client.address.company,expression:"order.data.client.address.company"}],staticClass:"form-control",attrs:{type:"text",name:"company",placeholder:"Company name*"},domProps:{value:e.order.data.client.address.company},on:{input:function(t){t.target.composing||e.$set(e.order.data.client.address,"company",t.target.value)}}}),e.order.getFieldError("client.address.company")?r("span",{staticClass:"text-danger"},[e._v(e._s(e.order.getFieldError("client.address.company")))]):e._e()])]:e._e(),r("div",{staticClass:"col-12 my-1"},[r("input",{directives:[{name:"model",rawName:"v-model",value:e.order.data.client.email,expression:"order.data.client.email"}],staticClass:"form-control",attrs:{type:"text",name:"email",placeholder:"Email*"},domProps:{value:e.order.data.client.email},on:{input:function(t){t.target.composing||e.$set(e.order.data.client,"email",t.target.value)}}}),e.order.getFieldError("client.email")?r("span",{staticClass:"text-danger"},[e._v(e._s(e.order.getFieldError("client.email")))]):e._e()]),r("div",{staticClass:"col-12 my-1"},[r("input",{directives:[{name:"model",rawName:"v-model",value:e.order.data.client.address.forename,expression:"order.data.client.address.forename"}],staticClass:"form-control",attrs:{type:"text",name:"forename",placeholder:"Name*"},domProps:{value:e.order.data.client.address.forename},on:{input:function(t){t.target.composing||e.$set(e.order.data.client.address,"forename",t.target.value)}}}),e.order.getFieldError("client.address.forename")?r("span",{staticClass:"text-danger"},[e._v(e._s(e.order.getFieldError("client.address.forename")))]):e._e()]),r("div",{staticClass:"col-12 my-1"},[r("input",{directives:[{name:"model",rawName:"v-model",value:e.order.data.client.address.surname,expression:"order.data.client.address.surname"}],staticClass:"form-control",attrs:{type:"text",name:"surname",placeholder:"Surname*"},domProps:{value:e.order.data.client.address.surname},on:{input:function(t){t.target.composing||e.$set(e.order.data.client.address,"surname",t.target.value)}}}),e.order.getFieldError("client.address.surname")?r("span",{staticClass:"text-danger"},[e._v(e._s(e.order.getFieldError("client.address.surname")))]):e._e()]),r("div",{staticClass:"col-8 my-1 pr-1"},[r("input",{directives:[{name:"model",rawName:"v-model",value:e.order.data.client.address.street,expression:"order.data.client.address.street"}],staticClass:"form-control",attrs:{type:"text",name:"street",placeholder:"Street*"},domProps:{value:e.order.data.client.address.street},on:{input:function(t){t.target.composing||e.$set(e.order.data.client.address,"street",t.target.value)}}}),e.order.getFieldError("client.address.street")?r("span",{staticClass:"text-danger"},[e._v(e._s(e.order.getFieldError("client.address.street")))]):e._e()]),r("div",{staticClass:"col-4 my-1 pl-1"},[r("input",{directives:[{name:"model",rawName:"v-model",value:e.order.data.client.address.building_number,expression:"order.data.client.address.building_number"}],staticClass:"form-control",attrs:{type:"text",name:"building_number",placeholder:"No.*"},domProps:{value:e.order.data.client.address.building_number},on:{input:function(t){t.target.composing||e.$set(e.order.data.client.address,"building_number",t.target.value)}}}),e.order.getFieldError("client.address.building_number")?r("span",{staticClass:"text-danger"},[e._v(e._s(e.order.getFieldError("client.address.building_number")))]):e._e()]),r("div",{staticClass:"col-5 my-1 pr-1"},[r("input",{directives:[{name:"model",rawName:"v-model",value:e.order.data.client.address.post_code,expression:"order.data.client.address.post_code"}],staticClass:"form-control",attrs:{type:"text",name:"post_code",placeholder:"Postcode*"},domProps:{value:e.order.data.client.address.post_code},on:{input:function(t){t.target.composing||e.$set(e.order.data.client.address,"post_code",t.target.value)}}}),e.order.getFieldError("client.address.post_code")?r("span",{staticClass:"text-danger"},[e._v(e._s(e.order.getFieldError("client.address.post_code")))]):e._e()]),r("div",{staticClass:"col-7 my-1 pl-1"},[r("input",{directives:[{name:"model",rawName:"v-model",value:e.order.data.client.address.city,expression:"order.data.client.address.city"}],staticClass:"form-control",attrs:{type:"text",name:"city",placeholder:"City*"},domProps:{value:e.order.data.client.address.city},on:{input:function(t){t.target.composing||e.$set(e.order.data.client.address,"city",t.target.value)}}}),e.order.getFieldError("client.address.city")?r("span",{staticClass:"text-danger"},[e._v(e._s(e.order.getFieldError("client.address.city")))]):e._e()]),r("div",{staticClass:"col-12 my-1"},[r("select",{directives:[{name:"model",rawName:"v-model",value:e.order.data.client.address.countryCode,expression:"order.data.client.address.countryCode"}],staticClass:"custom-select form-control",on:{change:function(t){var r=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){var t="_value"in e?e._value:e.value;return t}));e.$set(e.order.data.client.address,"countryCode",t.target.multiple?r:r[0])}}},[r("option",{attrs:{value:"",disabled:"",selected:""}},[e._v("Select your country*")]),e._l(e.countryCodes,(function(t,a){return r("option",{key:a,domProps:{value:a}},[e._v(e._s(t))])}))],2),e.order.getFieldError("client.address.countryCode")?r("span",{staticClass:"text-danger"},[e._v(e._s(e.order.getFieldError("client.address.countryCode")))]):e._e()]),"1"===e.order.data.client.kind?[r("div",{staticClass:"col-3 my-1 pr-1"},[r("select",{directives:[{name:"model",rawName:"v-model",value:e.order.data.client.address.nipPrefix,expression:"order.data.client.address.nipPrefix"}],staticClass:"custom-select form-control",on:{change:function(t){var r=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){var t="_value"in e?e._value:e.value;return t}));e.$set(e.order.data.client.address,"nipPrefix",t.target.multiple?r:r[0])}}},e._l(e.nipPrefixes,(function(t,a){return r("option",{key:a,domProps:{value:t}},[e._v(e._s(t))])})),0),e.order.getFieldError("client.address.countryCode")?r("span",{staticClass:"text-danger"},[e._v(e._s(e.order.getFieldError("client.address.nipPrefix")))]):e._e()]),r("div",{staticClass:"col-9 my-1 pl-1"},[r("input",{directives:[{name:"model",rawName:"v-model",value:e.order.data.client.address.nip,expression:"order.data.client.address.nip"}],staticClass:"form-control",attrs:{type:"text",name:"nip",placeholder:"Tax ID*"},domProps:{value:e.order.data.client.address.nip},on:{input:function(t){t.target.composing||e.$set(e.order.data.client.address,"nip",t.target.value)}}}),e.order.getFieldError("client.address.nip")?r("span",{staticClass:"text-danger"},[e._v(e._s(e.order.getFieldError("client.address.nip")))]):e._e()])]:e._e(),r("div",{staticClass:"col-12 my-1"},[r("input",{directives:[{name:"model",rawName:"v-model",value:e.order.data.client.address.phone,expression:"order.data.client.address.phone"}],staticClass:"form-control",attrs:{type:"text",name:"phone",placeholder:"Phone number*"},domProps:{value:e.order.data.client.address.phone},on:{keypress:function(t){return e.numberOnly(t)},input:function(t){t.target.composing||e.$set(e.order.data.client.address,"phone",t.target.value)}}}),e.order.getFieldError("client.address.phone")?r("span",{staticClass:"text-danger"},[e._v(e._s(e.order.getFieldError("client.address.phone")))]):e._e()])],2),e.optionalDeliveryAddress&&e.order.data.deliveryProduct?r("div",[r("div",{staticClass:"form-group form-text form-check"},[r("label",{staticClass:"form-check-label",attrs:{for:"addDeliveryAddress"}},[e._v(" Different delivery address "),r("input",{directives:[{name:"model",rawName:"v-model",value:e.addDeliveryAddress,expression:"addDeliveryAddress"}],staticClass:"form-check-input",attrs:{type:"checkbox",id:"addDeliveryAddress",name:"addDeliveryAddress"},domProps:{checked:Array.isArray(e.addDeliveryAddress)?e._i(e.addDeliveryAddress,null)>-1:e.addDeliveryAddress},on:{change:function(t){var r=e.addDeliveryAddress,a=t.target,s=!!a.checked;if(Array.isArray(r)){var n=null,o=e._i(r,n);a.checked?o<0&&(e.addDeliveryAddress=r.concat([n])):o>-1&&(e.addDeliveryAddress=r.slice(0,o).concat(r.slice(o+1)))}else e.addDeliveryAddress=s}}}),r("span",{staticClass:"checkmark"})])])]):e._e(),e.addDeliveryAddress||!e.optionalDeliveryAddress?[2===e.order.data.deliveryProduct?[r("div",{staticClass:"row"},[r("div",{staticClass:"col-12 my-1"},[r("input",{directives:[{name:"model",rawName:"v-model",value:e.order.data.deliveryAddress.forename,expression:"order.data.deliveryAddress.forename"}],staticClass:"form-control",attrs:{type:"text",name:"deliveryAddress.forename",placeholder:"Name*"},domProps:{value:e.order.data.deliveryAddress.forename},on:{input:function(t){t.target.composing||e.$set(e.order.data.deliveryAddress,"forename",t.target.value)}}}),e.order.getFieldError("deliveryAddress.forename")?r("span",{staticClass:"text-danger"},[e._v(e._s(e.order.getFieldError("deliveryAddress.forename")))]):e._e()]),r("div",{staticClass:"col-12 my-1"},[r("input",{directives:[{name:"model",rawName:"v-model",value:e.order.data.deliveryAddress.surname,expression:"order.data.deliveryAddress.surname"}],staticClass:"form-control",attrs:{type:"text",name:"deliveryAddress.surname",placeholder:"Surname*"},domProps:{value:e.order.data.deliveryAddress.surname},on:{input:function(t){t.target.composing||e.$set(e.order.data.deliveryAddress,"surname",t.target.value)}}}),e.order.getFieldError("deliveryAddress.surname")?r("span",{staticClass:"text-danger"},[e._v(e._s(e.order.getFieldError("deliveryAddress.surname")))]):e._e()]),r("div",{staticClass:"col-8 my-1 pr-1"},[r("input",{directives:[{name:"model",rawName:"v-model",value:e.order.data.deliveryAddress.street,expression:"order.data.deliveryAddress.street"}],staticClass:"form-control",attrs:{type:"text",name:"deliveryAddress.street",placeholder:"Street*"},domProps:{value:e.order.data.deliveryAddress.street},on:{input:function(t){t.target.composing||e.$set(e.order.data.deliveryAddress,"street",t.target.value)}}}),e.order.getFieldError("deliveryAddress.street")?r("span",{staticClass:"text-danger"},[e._v(e._s(e.order.getFieldError("deliveryAddress.street")))]):e._e()]),r("div",{staticClass:"col-4 my-1 pl-1"},[r("input",{directives:[{name:"model",rawName:"v-model",value:e.order.data.deliveryAddress.building_number,expression:"order.data.deliveryAddress.building_number"}],staticClass:"form-control",attrs:{type:"text",name:"deliveryAddress.buildingNumber",placeholder:"No.*"},domProps:{value:e.order.data.deliveryAddress.building_number},on:{input:function(t){t.target.composing||e.$set(e.order.data.deliveryAddress,"building_number",t.target.value)}}}),e.order.getFieldError("deliveryAddress.building_number")?r("span",{staticClass:"text-danger"},[e._v(e._s(e.order.getFieldError("deliveryAddress.building_number")))]):e._e()]),r("div",{staticClass:"col-5 my-1 pr-1"},[r("input",{directives:[{name:"model",rawName:"v-model",value:e.order.data.deliveryAddress.post_code,expression:"order.data.deliveryAddress.post_code"}],staticClass:"form-control",attrs:{type:"text",name:"deliveryAddress.postCode",placeholder:"Postcode*"},domProps:{value:e.order.data.deliveryAddress.post_code},on:{input:function(t){t.target.composing||e.$set(e.order.data.deliveryAddress,"post_code",t.target.value)}}}),e.order.getFieldError("deliveryAddress.post_code")?r("span",{staticClass:"text-danger"},[e._v(e._s(e.order.getFieldError("deliveryAddress.post_code")))]):e._e()]),r("div",{staticClass:"col-7 my-1 pl-1"},[r("input",{directives:[{name:"model",rawName:"v-model",value:e.order.data.deliveryAddress.city,expression:"order.data.deliveryAddress.city"}],staticClass:"form-control",attrs:{type:"text",name:"deliveryAddress.city",placeholder:"City*"},domProps:{value:e.order.data.deliveryAddress.city},on:{input:function(t){t.target.composing||e.$set(e.order.data.deliveryAddress,"city",t.target.value)}}}),e.order.getFieldError("deliveryAddress.city")?r("span",{staticClass:"text-danger"},[e._v(e._s(e.order.getFieldError("deliveryAddress.city")))]):e._e()]),r("div",{staticClass:"col-12 my-1"},[r("select",{directives:[{name:"model",rawName:"v-model",value:e.order.data.deliveryAddress.countryCode,expression:"order.data.deliveryAddress.countryCode"}],staticClass:"custom-select form-control",on:{change:function(t){var r=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){var t="_value"in e?e._value:e.value;return t}));e.$set(e.order.data.deliveryAddress,"countryCode",t.target.multiple?r:r[0])}}},[r("option",{attrs:{value:"",disabled:"",selected:""}},[e._v("Select your country*")]),e._l(e.countryCodes,(function(t,a){return r("option",{key:a,domProps:{value:a}},[e._v(" "+e._s(t)+" ")])}))],2),e.order.getFieldError("deliveryAddress.countryCode")?r("span",{staticClass:"text-danger"},[e._v(e._s(e.order.getFieldError("deliveryAddress.countryCode")))]):e._e()]),r("div",{staticClass:"col-12 my-1"},[r("input",{directives:[{name:"model",rawName:"v-model",value:e.order.data.deliveryAddress.phone,expression:"order.data.deliveryAddress.phone"}],staticClass:"form-control",attrs:{type:"text",name:"deliveryAddress.phone",placeholder:"Phone number*"},domProps:{value:e.order.data.deliveryAddress.phone},on:{keypress:function(t){return e.numberOnly(t)},input:function(t){t.target.composing||e.$set(e.order.data.deliveryAddress,"phone",t.target.value)}}}),e.order.getFieldError("deliveryAddress.phone")?r("span",{staticClass:"text-danger"},[e._v(e._s(e.order.getFieldError("deliveryAddress.phone")))]):e._e()])])]:[r("div",{staticClass:"row"},e._l(e.deliveryAddressRequiredFields,(function(t,a){return r("div",{key:a,staticClass:"col-12 my-1"},["inpostPointName"===t?[r("b-button",{staticClass:"btn-gradient-light m-0 w-100 float-left",on:{click:e.choseInpostPoint}},[e._v("Choose Paczkomat ")]),e._v(" "+e._s(e.order.data.deliveryAddress.inpostPointName)),r("br"),e._v(" "+e._s(e.order.data.deliveryAddress.inpostPointAddressLine1)),r("br"),e._v(" "+e._s(e.order.data.deliveryAddress.inpostPointAddressLine2)+" "),e.order.getFieldError("deliveryAddress.inpostPointName")?r("span",{staticClass:"text-danger"},[e._v(e._s(e.order.getFieldError("deliveryAddress.inpostPointName")))]):e._e()]:[r("input",{directives:[{name:"model",rawName:"v-model",value:e.order.data.deliveryAddress[t],expression:"order.data.deliveryAddress[field]"}],staticClass:"form-control",attrs:{type:"text",name:"field",placeholder:e.getFieldLabel(t)},domProps:{value:e.order.data.deliveryAddress[t]},on:{input:function(r){r.target.composing||e.$set(e.order.data.deliveryAddress,t,r.target.value)}}}),e.order.getFieldError("deliveryAddress."+t)?r("span",{staticClass:"text-danger"},[e._v(e._s(e.order.getFieldError("deliveryAddress."+t)))]):e._e()]],2)})),0)],e.order.getFieldError("deliveryAddress")?r("span",{staticClass:"text-danger"},[e._v(e._s(e.order.getFieldError("deliveryAddress")))]):e._e()]:e._e()],2),r("div",{staticClass:"col-12 col-md-4 card-out border-0 pl-0 pr-4"},[r("p",{staticClass:"title_section top-border text-uppercase"},[e._v("Confirmation")]),r("div",[e._l(e.order.getOrderProducts(),(function(t,a){return[2!==t.product.type?r("div",{key:a},[r("div",{staticClass:"d-flex justify-content-start"},[r("div",{staticClass:"mr-1"},[r("img",{attrs:{src:t.product.data.image,alt:"",width:"60",height:"60"}})]),r("div",[r("div",{staticStyle:{height:"60px"}},[e._v(" "+e._s(t.product.name)+" ")]),r("div",{staticClass:"mt-1"},[e._v(" Quantity: "),r("button",{staticClass:"btn btn-link text-dark",on:{click:function(){e.order.data.products[t.product.id].quantity>1&&(e.order.decreaseQuantity(t.product.id),e.$forceUpdate())}}},[e._v("- ")]),r("input",{directives:[{name:"model",rawName:"v-model",value:t.quantity,expression:"product.quantity"}],staticClass:"form-control max-width-50 d-inline text-center",attrs:{type:"number",min:"1",step:"1"},domProps:{value:t.quantity},on:{input:function(r){r.target.composing||e.$set(t,"quantity",r.target.value)}}}),r("button",{staticClass:"btn btn-link text-dark",on:{click:function(){e.order.increaseQuantity(t.product.id),e.$forceUpdate()}}},[e._v("+ ")])])])])]):e._e()]}))],2),e.getConfigProperty("discountCode")?[r("div",{staticClass:"mt-4 d-flex"},[r("input",{directives:[{name:"model",rawName:"v-model",value:e.discountCode,expression:"discountCode"}],staticClass:"form-control d-inline",attrs:{placeholder:"Discount code"},domProps:{value:e.discountCode},on:{input:function(t){t.target.composing||(e.discountCode=t.target.value)}}}),r("button",{staticClass:"btn btn-link text-dark",on:{click:e.applyDiscountCode}},[e._v(" Apply ")])])]:e._e(),r("div",[e.order.getFieldError("discountCode")?r("span",{staticClass:"text-danger"},[e._v(e._s(e.order.getFieldError("discountCode")))]):e._e()]),e.order.getPayment()?r("div",{staticClass:"my-4"},[r("div",{staticClass:"d-flex justify-content-between"},[r("div",[e._v(" Subtotal ")]),r("div",[e._v(" "+e._s(e.amountFormat(e.order.getPayment().amount))+" ")])]),r("div",{staticClass:"d-flex justify-content-between"},[r("div",[e._v(" Shipping ")]),r("div",[e._v(" "+e._s(e.amountFormat(0))+" ")])]),r("div",{staticClass:"d-flex justify-content-between"},[e._m(2),r("div",[null!==e.order.getPayment().discount_amount?[r("small",{staticClass:"text-danger"},[r("s",[e._v(e._s(e.amountFormat(e.order.getPayment().amount)))])]),r("span",{staticClass:"lead ml-1"},[r("strong",[e._v(e._s(e.amountFormat(e.order.getPayment().discount_amount)))])])]:[r("span",{staticClass:"lead"},[e._v(e._s(e.amountFormat(e.order.getPayment().amount)))])]],2)])]):e._e(),r("div",{staticClass:"my-2"},[r("div",{attrs:{id:"shop-agreements"}},[r("div",{staticClass:"form-group form-text form-check undefined"},[r("label",{staticClass:"form-check-label",attrs:{for:"store-regulations"}},[r("span",{domProps:{innerHTML:e._s(e.agreements.store.lessContent)}}),e.agreements.store.showMore?[e._v(" "),r("span",{domProps:{innerHTML:e._s(e.agreements.store.moreContent)}}),e._v(" "),r("a",{attrs:{tabindex:"0"},on:{click:function(t){e.agreements.store.showMore=!1}}},[e._v("more")])]:e.agreements.store.moreContent?[e._v(" "),r("a",{attrs:{tabindex:"0"},on:{click:function(t){e.agreements.store.showMore=!0}}},[e._v("more")])]:e._e(),e.agreements.store.required?r("span",{staticClass:"val-label"},[e._v("*")]):e._e(),r("input",{directives:[{name:"model",rawName:"v-model",value:e.agreements.store.selected,expression:"agreements.store.selected"}],staticClass:"form-check-input",attrs:{type:"checkbox",id:"store-regulations",name:"agreement"},domProps:{checked:Array.isArray(e.agreements.store.selected)?e._i(e.agreements.store.selected,null)>-1:e.agreements.store.selected},on:{change:function(t){var r=e.agreements.store.selected,a=t.target,s=!!a.checked;if(Array.isArray(r)){var n=null,o=e._i(r,n);a.checked?o<0&&e.$set(e.agreements.store,"selected",r.concat([n])):o>-1&&e.$set(e.agreements.store,"selected",r.slice(0,o).concat(r.slice(o+1)))}else e.$set(e.agreements.store,"selected",s)}}}),r("span",{staticClass:"checkmark"})],2),e.agreements.store.error?r("span",{staticClass:"text-danger",staticStyle:{"margin-left":"15px"}},[e._v(e._s(e.agreements.store.error))]):e._e()]),r("div",{staticClass:"form-group form-text form-check undefined"},[r("label",{staticClass:"form-check-label",attrs:{for:"agreements__ma1"}},[r("span",{domProps:{innerHTML:e._s(e.agreements.ma1.lessContent)}}),e.agreements.ma1.showMore?[e._v(" "),r("span",{domProps:{innerHTML:e._s(e.agreements.ma1.moreContent)}}),e._v(" "),r("a",{attrs:{tabindex:"0"},on:{click:function(t){e.agreements.ma1.showMore=!1}}},[e._v("less")])]:[e._v(" "),r("a",{attrs:{tabindex:"0"},on:{click:function(t){e.agreements.ma1.showMore=!0}}},[e._v("more")])],r("input",{directives:[{name:"model",rawName:"v-model",value:e.agreements.ma1.selected,expression:"agreements.ma1.selected"}],staticClass:"form-check-input",attrs:{type:"checkbox",id:"agreements__ma1",name:"ma1"},domProps:{checked:Array.isArray(e.agreements.ma1.selected)?e._i(e.agreements.ma1.selected,null)>-1:e.agreements.ma1.selected},on:{change:function(t){var r=e.agreements.ma1.selected,a=t.target,s=!!a.checked;if(Array.isArray(r)){var n=null,o=e._i(r,n);a.checked?o<0&&e.$set(e.agreements.ma1,"selected",r.concat([n])):o>-1&&e.$set(e.agreements.ma1,"selected",r.slice(0,o).concat(r.slice(o+1)))}else e.$set(e.agreements.ma1,"selected",s)}}}),r("span",{staticClass:"checkmark"})],2)]),r("div",{staticClass:"form-group form-text form-info_a form-check"},[r("label",{staticClass:"form-check-label"},[r("span",{domProps:{innerHTML:e._s(e.adminsInfo.admin1.lessContent)}}),e.adminsInfo.admin1.showMore?[e._v(" "),r("span",{domProps:{innerHTML:e._s(e.adminsInfo.admin1.moreContent)}}),e._v(" "),r("a",{attrs:{tabindex:"0"},on:{click:function(t){e.adminsInfo.admin1.showMore=!1}}},[e._v("less")])]:[e._v(" "),r("a",{attrs:{tabindex:"0"},on:{click:function(t){e.adminsInfo.admin1.showMore=!0}}},[e._v("more")])]],2)]),r("div",{staticClass:"form-group form-text form-check"},[r("label",{staticClass:"form-check-label",attrs:{for:"agreements__ma2"}},[r("span",{domProps:{innerHTML:e._s(e.agreements.ma2.lessContent)}}),e.agreements.ma2.showMore?[e._v(" "),r("span",{domProps:{innerHTML:e._s(e.agreements.ma2.moreContent)}}),e._v(" "),r("a",{attrs:{tabindex:"0"},on:{click:function(t){e.agreements.ma2.showMore=!1}}},[e._v("less")])]:[e._v(" "),r("a",{attrs:{tabindex:"0"},on:{click:function(t){e.agreements.ma2.showMore=!0}}},[e._v("more")])],r("input",{directives:[{name:"model",rawName:"v-model",value:e.agreements.ma2.selected,expression:"agreements.ma2.selected"}],staticClass:"form-check-input",attrs:{type:"checkbox",id:"agreements__ma2",name:"ma2"},domProps:{checked:Array.isArray(e.agreements.ma2.selected)?e._i(e.agreements.ma2.selected,null)>-1:e.agreements.ma2.selected},on:{change:function(t){var r=e.agreements.ma2.selected,a=t.target,s=!!a.checked;if(Array.isArray(r)){var n=null,o=e._i(r,n);a.checked?o<0&&e.$set(e.agreements.ma2,"selected",r.concat([n])):o>-1&&e.$set(e.agreements.ma2,"selected",r.slice(0,o).concat(r.slice(o+1)))}else e.$set(e.agreements.ma2,"selected",s)}}}),r("span",{staticClass:"checkmark"})],2)]),r("div",{staticClass:"form-group form-text form-info_a form-check"},[r("label",{staticClass:"form-check-label"},[r("span",{domProps:{innerHTML:e._s(e.adminsInfo.admin2.lessContent)}}),e.adminsInfo.admin2.showMore?[e._v(" "),r("span",{domProps:{innerHTML:e._s(e.adminsInfo.admin2.moreContent)}}),e._v(" "),r("a",{attrs:{tabindex:"0"},on:{click:function(t){e.adminsInfo.admin2.showMore=!1}}},[e._v("less")])]:[e._v(" "),r("a",{attrs:{tabindex:"0"},on:{click:function(t){e.adminsInfo.admin2.showMore=!0}}},[e._v("more")])]],2)])]),r("p",[e._v("*The field is required")])]),r("button",{staticClass:"btn btn-gradient-dark md-block my-4 w-100",attrs:{disabled:e.payPending},on:{click:e.pay}},[e._v("Order and pay "),e.payPending?r("b-spinner",{staticClass:"ml-2",attrs:{variant:"light",small:"",label:"Payment pending"}}):e._e()],1)],2)])]:e._e()],2)},n=[function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"col-12 card-out border-0 px-0 pt-4"},[r("p",{staticClass:"title_section"},[e._v("BUY THE BOOK")])])},function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("p",[e._v("Authors: Zuzanna Skalska, Rafał Kołodziej"),r("br"),e._v(" Publisher: Greenhat, Autopay"),r("br"),e._v(" Publishing partners: Greenhat, Autopay, 360Inspiration"),r("br"),e._v(" Graphic design: van Rixtel van der Put ontwerpers"),r("br"),e._v(" Illustrations: Olga Mrozek"),r("br"),e._v(" Number of pages: 272"),r("br"),e._v(" Language: English"),r("br"),e._v(" Paperback"),r("br")])},function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",[r("span",{staticClass:"lead"},[r("strong",[e._v("Total incl. tax:")])])])}],o=(r("b0c0"),r("b680"),r("d3b7"),r("ac1f"),r("5319"),r("b85c")),i=(r("96cf"),r("1da1")),d=r("d4ec"),l=r("bee2"),c=r("ade3"),u=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";Object(d["a"])(this,e),Object(c["a"])(this,"_baseUrl",""),Object(c["a"])(this,"_response",null),Object(c["a"])(this,"_successResponse",null),Object(c["a"])(this,"data",{products:{},client:{address:{}},deliveryAddress:{},agreement:!0}),this._baseUrl=t;var r=JSON.parse(localStorage.getItem("order"));null!==r&&(this.data=r)}return Object(l["a"])(e,[{key:"addProduct",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;"undefined"===typeof this.data.products&&(this.data.products={}),"undefined"===typeof this.data.products[e]?this.data.products[e]={product_id:e,quantity:t}:this.data.products[e].quantity+=t,this._request()}},{key:"removeProduct",value:function(e){delete this.data.products[e],this._request()}},{key:"increaseQuantity",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return!!this._checkHasProduct(e)&&(this.data.products[e].quantity+=t,this._request(),!0)}},{key:"decreaseQuantity",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return!!this._checkHasProduct(e)&&(this.data.products[e].quantity<=t?this.removeProduct(e):this.data.products[e].quantity-=t,this._request(),!0)}},{key:"setDelivery",value:function(e){this.data.deliveryProduct=e,this._request()}},{key:"setClientAddress",value:function(e){this.data.client.address=e,this._request()}},{key:"setClientEmail",value:function(e){this.data.client.email=e,this._request()}},{key:"setDeliveryAddress",value:function(e){this.deliveryAddress=e,this._request()}},{key:"removeDeliveryAddress",value:function(){delete this.deliveryAddress,this._request()}},{key:"setDiscountCode",value:function(e){this.data.discountCode=e,this._request()}},{key:"removeDiscountCode",value:function(){delete this.data.discountCode,this._request()}},{key:"pay",value:function(){var e=Object(i["a"])(regeneratorRuntime.mark((function e(){var t,r;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if("undefined"===typeof(null===(t=this._response)||void 0===t||null===(r=t._links)||void 0===r?void 0:r.paymentUrl)){e.next=4;break}return e.next=3,fetch(this._response._links.paymentUrl).then((function(e){return e.json()})).then((function(e){return"undefined"!==typeof e.redirectUrl?e.redirectUrl:(alert("An unexpected error has occurred"),!1)}));case 3:return e.abrupt("return",e.sent);case 4:return e.abrupt("return",!1);case 5:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}()},{key:"confirm",value:function(){var e=Object(i["a"])(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,this._request(!0);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}()},{key:"_request",value:function(e){var t=this;localStorage.setItem("order",JSON.stringify(this.data));var r="POST",a=this._baseUrl+"/api/shop/orders";return"undefined"!==typeof this.data.id&&(r="PUT",a+="/"+this.data.id,e&&(r="POST",a+="/confirm")),fetch(a,{method:r,headers:{"Content-Type":"application/json"},body:JSON.stringify({order:this.data})}).then((function(e){return e.json()})).then((function(e){var r;return t._response=e,"failure"!==e.status&&(t.data.id=e.item.id,t._successResponse=e),"undefined"!==typeof(null===(r=t.errors)||void 0===r?void 0:r.form)&&alert(t.errors.form[0]),"failure"!==e.status}))}},{key:"_findProductById",value:function(e){var t,r=Object(o["a"])(this.data.products);try{for(r.s();!(t=r.n()).done;){var a=t.value;if(a.id===e)return a}}catch(s){r.e(s)}finally{r.f()}return null}},{key:"_checkHasProduct",value:function(e){return"undefined"!==typeof this.data.products[e]}},{key:"getErrors",value:function(){var e;return null===(e=this._response)||void 0===e?void 0:e.errors}},{key:"getFieldError",value:function(e){var t=this.getErrors();return"undefined"===typeof t||"undefined"===typeof t[e]?null:t[e][0]}},{key:"getDeliveryAddress",value:function(){var e,t;return null===(e=this._successResponse)||void 0===e||null===(t=e.item)||void 0===t?void 0:t.deliveryAddress}},{key:"getOrderProducts",value:function(){var e,t;return null===(e=this._successResponse)||void 0===e||null===(t=e.item)||void 0===t?void 0:t.orderProducts}},{key:"getPayment",value:function(){var e,t;return null===(e=this._successResponse)||void 0===e||null===(t=e.item)||void 0===t?void 0:t.initPayment}},{key:"getDiscountCodeTickets",value:function(){var e,t,r;return null===(e=this._successResponse)||void 0===e||null===(t=e.item)||void 0===t||null===(r=t.initPayment)||void 0===r?void 0:r.discountCodeTickets}},{key:"getDeliveryProductDetails",value:function(){var e,t;if("undefined"!==typeof(null===(e=this._successResponse)||void 0===e||null===(t=e.item)||void 0===t?void 0:t.orderProducts))for(var r in this._successResponse.item.orderProducts){var a=this._successResponse.item.orderProducts[r].product;if(2===a.type)return a}return null}}]),e}(),m=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";Object(d["a"])(this,e),Object(c["a"])(this,"_baseUrl",""),Object(c["a"])(this,"_response",null),Object(c["a"])(this,"data",{deliveryOptions:[]}),this._baseUrl=t,this.fetchDeliveryOptions()}return Object(l["a"])(e,[{key:"fetchDeliveryOptions",value:function(){var e=this;fetch(this._baseUrl+"/api/shop/delivery/options").then((function(e){return e.json()})).then((function(t){e._response=t,e.data.deliveryOptions=t.items}))}},{key:"getDeliveryOptions",value:function(){return this.data.deliveryOptions}}]),e}(),p=r("0156"),v={name:"shop",data:function(){return{product:{productId:3},discountCode:"",stage:1,selectedProducts:[],order:null,pending:!1,errors:[],addDeliveryAddress:!1,shop:null,fieldLabels:{forename:"Name*",phone:"Phone number*"},gallery:{selectedImage:0},payPending:!1,defaultConfig:{galleryImages:[{src:"/storage/1.png",min:"/storage/1.png"},{src:"/storage/2.png",min:"/storage/2.png"},{src:"/storage/3.png",min:"/storage/3.png"}],currency:"€",startStage:1,discountCode:!1},config:{},countryCodes:p,agreements:{store:{selected:!1,showMore:!1,lessContent:'I confirm that I have read the Store Regulations Regulamin and accept its provisions.',moreContent:"",required:!0},ma1:{selected:!1,showMore:!1,lessContent:"Do you want to receive notifications via email, SMS, or telephone about the most interesting future events (newsletter) or other events organized by Greenhat sp. z o.o.?",moreContent:"You can revoke your consent at any time."},ma2:{selected:!1,showMore:!1,lessContent:"Do you want to receive notifications via email, SMS, or telephone about the best offers, promotions, competitions, and other interesting events organized by by Autopay S.A.?",moreContent:"We promise not to send spam! If you get bored with our messages, you can revoke your consent at any time. "}},adminsInfo:{admin1:{showMore:!1,lessContent:"The controller of the personal data is Greenhat Sp. z o.o",moreContent:'with its registered office in Poznań at the address: ul. Nowowiejskiego 25/4, registered in the District Court Poznań, Nowe Miasto i Wilda in Poznań, the 8th Commercial Division of the National Court Register under the number: 0000705292, with share capital in the amount of PLN 5,000 (paid in full), NIP [Tax ID. No.]: 7811953789, Regon 368434897, that runs the website: https://greenhat.pl/
Privacy policy '},admin2:{showMore:!1,lessContent:"The controller of the personal data is Autopay S.A. ",moreContent:'with its registered office in Sopot at the address: ul. Powstańców Warszawy 6, registered in the District Court Gdańsk-Północ in Gdańsk, the 8th Commercial Division of the National Court Register under the number: 0000320590, with share capital in the amount of PLN 2,000,000 (paid in full), NIP [Tax ID. No.]: 585-13-51-185; entered into the register of payment services providers under the number IP17/2013, into the register of loan institutions under the number RIP000109, into the register of credit agents under the number RPK002057, into the register of telecommunication entrepreneurs under the number 11050
Privacy policy '}}}},computed:{optionalDeliveryAddress:function(){var e,t,r=this.order.getDeliveryProductDetails();return null===r||"undefined"===typeof(null===r||void 0===r||null===(e=r.data)||void 0===e||null===(t=e.deliveryAddress)||void 0===t?void 0:t.extra)},deliveryOptions:function(){var e=this.shop.getDeliveryOptions();return e},deliveryAddressRequiredFields:function(){var e,t,r=this.order.getDeliveryProductDetails();return null===r||void 0===r||null===(e=r.data)||void 0===e||null===(t=e.deliveryAddress)||void 0===t?void 0:t.requiredFields},productQuantity:{get:function(){return"undefined"===typeof this.order.data.products?1:this.order.data.products[this.product.productId].quantity},set:function(e){e>0&&this.$set(this.order.data.products[this.product.productId],"quantity",e)}},amountToPay:function(){var e=this.order.getPayment();return"undefined"===typeof e?"":null!==e.discount_amount?this.amountFormat(e.discount_amount):this.amountFormat(e.amount)},nipPrefixes:function(){var e=[];return""!==this.order.data.client.address.countryCode&&e.push(this.order.data.client.address.countryCode),e.push(""),e}},created:function(){"undefined"!==typeof window.shopConfig&&(this.config=window.shopConfig),this.stage=this.getConfigProperty("startStage"),null!==this.stage?this.stage=parseInt(this.stage):this.stage=1,this.order=new u,"undefined"===typeof this.order.data.products[this.product.productId]&&this.$set(this.order.data.products,this.product.productId,{product_id:this.product.productId,quantity:1}),"undefined"===typeof this.order.data.client.address.countryCode&&this.$set(this.order.data.client.address,"countryCode",""),"undefined"===typeof this.order.data.client.kind&&this.$set(this.order.data.client,"kind",0),this.discountCode=this.order.data.discountCode,this.shop=new m},methods:{getConfigProperty:function(e){return"undefined"===typeof this.config[e]?"undefined"===typeof this.defaultConfig[e]?null:this.defaultConfig[e]:this.config[e]},switchStage:function(e){this.pending=!0;var t=this.getConfigProperty("stage"+e);null===t?(this.stage=e,localStorage.setItem("shop-stage",this.stage),this.pending=!1):window.location=t},addToCart:function(){this.order.addProduct(this.product.productId,this.product.quantity)},addDiscountCode:function(){this.order.addDiscountCode(this.discountCode)},amountFormat:function(e){return(parseInt(e)/100).toFixed(2).replace(".",",")+" "+this.getConfigProperty("currency")},getFieldLabel:function(e){return"undefined"!==typeof this.fieldLabels[e]?this.fieldLabels[e]:e},confirm:function(){var e=this;return Object(i["a"])(regeneratorRuntime.mark((function t(){var r;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e.order.confirm();case 2:r=t.sent,r&&e.stage++;case 4:case"end":return t.stop()}}),t)})))()},pay:function(){var e=this;return Object(i["a"])(regeneratorRuntime.mark((function t(){var r;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(e.payPending=!0,e.agreementsValidation()){t.next=4;break}return e.payPending=!1,t.abrupt("return");case 4:return t.next=6,e.order.confirm();case 6:if(r=t.sent,r){t.next=10;break}return e.payPending=!1,t.abrupt("return");case 10:return t.next=12,e.sendToLMS();case 12:if(r=t.sent,r){t.next=17;break}return alert("An unexpected error has occurred"),e.payPending=!1,t.abrupt("return");case 17:return e.gaEvent(),t.next=20,e.order.pay();case 20:r=t.sent,!1!==r?(localStorage.removeItem("order"),localStorage.removeItem("shop-stage"),location.href=r):e.payPending=!1;case 22:case"end":return t.stop()}}),t)})))()},choseInpostPoint:function(){var e=this;easyPack.init({defaultLocale:"pl",points:{types:["parcel_locker"]},map:{defaultLocation:[52.24942509964067,21.01531721067023],initialTypes:["parcel_locker"]}}),easyPack.modalMap((function(t,r){r.closeModal(),e.$set(e.order.data.deliveryAddress,"inpostPointName",t.name),e.$set(e.order.data.deliveryAddress,"inpostPointAddressLine1",t.address.line1),e.$set(e.order.data.deliveryAddress,"inpostPointAddressLine2",t.address.line2)}),{width:900,height:600})},applyDiscountCode:function(){this.order.setDiscountCode(this.discountCode),this.$forceUpdate()},agreementsValidation:function(){var e=!0;for(var t in this.agreements){var r=this.agreements[t];delete this.agreements[t].error,!0===r.required&&!1===r.selected&&(this.$set(this.agreements[t],"error","The field is required"),e=!1)}return e},sendToLMS:function(){var e=this;return Object(i["a"])(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,fetch("https://lms.bm.pl/lms/lead/receive",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({_form:"futuresthinking-agreements",store:e.agreements.store.selected,ma1:e.agreements.ma1.selected,ma2:e.agreements.ma2.selected,email:e.order.data.client.email})}).then((function(e){return 200===e.status}));case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t)})))()},numberOnly:function(e){var t=String.fromCharCode(e.keyCode);if(/^[0-9]+$/.test(t))return!0;e.preventDefault()},gaEvent:function(){window.dataLayer=window.dataLayer||[];var e,t=5,r=this.order.getPayment().amount/100,a=[],s=Object(o["a"])(this.order.getOrderProducts());try{for(s.s();!(e=s.n()).done;){var n=e.value;2!==n.product.type&&a.push({sku:n.product.id,name:n.product.name,category:"Books",price:n.product.price/100,quantity:n.quantity})}}catch(d){s.e(d)}finally{s.f()}var i={event:"purchase",transactionId:this.order.getPayment().id,transactionTotal:r,transactionTax:Math.round(r*t/(100+t)*100)/100,transactionShipping:this.order.getDeliveryProductDetails().price/100,transactionProducts:a};window.dataLayer.push(i)}},watch:{"order.data.products":{deep:!0,handler:function(){this.order._request()}},"order.data.deliveryProduct":{deep:!1,handler:function(){this.order._request()}},addDeliveryAddress:function(e){!1===e?delete this.order.data.deliveryAddress:this.order.data.deliveryAddress={countryCode:this.order.data.client.address.countryCode}},"order.data.client.address.countryCode":function(e){this.$set(this.order.data.client.address,"nipPrefix",e)}}},g=v,y=(r("d301"),r("f855"),r("2877")),f=Object(y["a"])(g,s,n,!1,null,"07524bdc",null),h=f.exports,_=r("5f5b");a["default"].use(_["a"]),a["default"].config.productionTip=!1,window.shop=h,window.vue=a["default"],new a["default"]({render:function(e){return e(h)}}).$mount("#app")},f855:function(e,t,r){"use strict";var a=r("39fb"),s=r.n(a);s.a}}); //# sourceMappingURL=frontend.js.map