var pikadayDefaults={format:"YYYY-MM-DD",minDate:new Date},vc_pickaday={props:{value:{required:!0},options:{"default":function(){return{}}},placeholder:"",arialabel:"",toggle:{type:Boolean,"default":!1}},template:'<input type="text" :value="value" :placeholder="placeholder" :aria-label="arialabel">',computed:{opts:function(){return $.extend({},pikadayDefaults,this.options)}},watch:{toggle:function(a){a?this.show():this.hide()}},mounted:function(){var a=this,b=this.opts;if(b.onSelect){var c=b.onSelect;
b.onSelect=function(){c(Array.from(arguments));a.change(this.toString())}}else b.onSelect=function(){a.change(this.toString())};b.field=this.$el;this.pikaday=new Pikaday(b)},beforeDestroy:function(){this.pikaday.destroy()},methods:{change:function(a){this.$emit("input",a)},show:function(){this.pikaday.show()},hide:function(){this.pikaday.hide()}}},giftcard=new Vue({el:"#v-giftcard",store:vo_store,data:function(){return{valueoptions:[20,50,100,150,200],cardoptions:["digital","physical"],value:20,cardtype:"digital",
carddesign:0,senddate:"",recipientname:"",recipientemail:"",sendername:"",message:"",messagemax:140,messagechars:140,messageerror:!1,preview:!1,errors:[]}},components:{pickaday:vc_pickaday},filters:{currency:function(a){return parseFloat(a).toFixed(2)}},computed:{canpreview:function(){return""!=this.recipientname&&""!=this.sendername&&""!=this.message}},methods:{showpreview:function(){this.preview=!0},closepreview:function(){this.preview=!1},addtocart:function(){var a=this;$.ajax("_ps/api/giftcardapi/addtocart",
{data:JSON.stringify(this.$data),type:"POST",processData:!1,contentType:"application/json"}).done(function(b){a.errors=b.errors;b.status?$.post("/cart-endpoint?a=addgiftcardtocard",{payload:{data:b.giftcard,key:a.itemkey}},function(a){$(".itemcount").html(a.cartqty);$(".headerCartTotal").html(a.carttotal);opensidebarcart()},"JSON"):$("html, body").animate({scrollTop:$(".r-inError").offset().top},500)})}},created:function(){this.carddesign=window.giftcardsdesign}});