(window.webpackJsonp=window.webpackJsonp||[]).push([[26,33,86,104,106,107],{317:function(t,e,n){"use strict";n.r(e);var o=n(0),r=(n(19),n(8),n(10),n(132),n(133),n(73),{name:"CommentForm",props:{postId:{type:Number,required:!0},parentId:{type:Number,default:0}},data:t=>({loading:!1,filePreview:null,fileType:null,fileExtension:null,form:t.$vform.make({content:"",attachment:null,parent:t.parentId,author_name:null,author_email:null})}),computed:{user(){return this.$store.getters["auth/user"]},isSubcommentForm(){return 0!==this.parentId}},methods:{isInvalid(){if(""===this.form.content)return this.$notify({color:"error",message:"El comentario no puede estar vacío."}),!0},submit(){var t=this;return Object(o.a)(function*(){if(!t.isInvalid()){if(!t.user)return t.$notify({color:"error",message:"Debe iniciar sesión para comentar."}),void setTimeout(()=>{t.$router.push("/auth/login")},2e3);try{t.loading=!0,t.form.author_name=t.user.nombre,t.form.author_email=t.user.email;var{data:e}=yield t.form.post("articles/".concat(t.postId,"/comments"));t.form.reset(),t.filePreview=null,t.$emit("comment-saved",e),t.$notify("Comentario guardado exitosamente.")}catch(e){var n,o,r,c=null!==(n=null===(o=e.response)||void 0===o||null===(r=o.data)||void 0===r?void 0:r.message)&&void 0!==n?n:"Error.";t.$notify({color:"error",message:c})}finally{t.loading=!1}}})()},onUploadFile(t){t&&(this.fileType=this.getFileType(t.name),this.filePreview=URL.createObjectURL(t))},redirectToLogin(){var t=encodeURIComponent(this.$route.path);this.$router.push("/auth/login?redirect=".concat(t))},removeFile(){this.filePreview=null,this.form.attachment=null},getFileType(t){this.extensionFile=this.getExtensionFile(t);return["jpg","jpeg","jpe","gif","png","bmp","tiff","tif","webp","ico","heic"].includes(this.extensionFile)?"image":["asf","wmv","avi","divx","flv","mov","qt","mpeg","mpg","mp4","m4v","ogv","mkv","3gp","3gpp","3g2"].includes(this.extensionFile)?"video":void 0},getExtensionFile(t){var e=t.split(".");return e[e.length-1]}}}),c=(n(723),n(1)),component=Object(c.a)(r,function(){var t=this,e=t._self._c;return e("v-form",{ref:"form",staticClass:"comment-form",class:{"subcomment-form":t.isSubcommentForm},attrs:{"lazy-validation":""},on:{submit:function(e){return e.preventDefault(),t.submit.apply(null,arguments)}}},[e("h1",{staticClass:"mb-3"},[t._v("\n Nuevo comentario\n ")]),t._v(" "),t.user?t._e():e("div",{staticClass:"comment-form-no-logged"},[e("p",[t._v("\n Sección Para clientes fishboxlovers.\n "),e("br"),t._v("\n Para poder realizar un comentario debes iniciar sesión.\n ")]),t._v(" "),e("v-btn",{staticClass:"font-weight-bold",attrs:{color:"success"},nativeOn:{click:function(e){return t.redirectToLogin.apply(null,arguments)}}},[t._v("\n iniciar Seción!\n ")])],1),t._v(" "),e("v-textarea",{staticClass:"comment-form-textarea",class:{"with-file-preview":t.filePreview},attrs:{solo:"",name:"input-7-4",label:"Escriba un comentario",loading:t.loading,disabled:t.loading},scopedSlots:t._u([{key:"append",fn:function(){return[t.filePreview?e("div",{staticClass:"comment-form-file-preview-wrapper"},["image"===t.fileType?e("img",{staticClass:"comment-form-file-preview",attrs:{src:t.filePreview}}):"video"===t.fileType?e("video",{staticClass:"comment-form-file-preview",attrs:{preload:"metadata"}},[e("source",{attrs:{type:"video/".concat(t.extensionFile),src:t.filePreview}})]):t._e(),t._v(" "),e("div",{staticClass:"comment-form-file-preview-button",on:{click:t.removeFile}},[e("v-icon",{attrs:{color:"#ffffff",size:"10px"}},[t._v("fa-times")])],1),t._v(" "),"video"===t.fileType?e("div",{staticClass:"comment-form-file-preview-play",on:{click:t.removeFile}},[e("v-icon",{attrs:{color:"#f2f2f2",size:"20px"}},[t._v("fa-play")])],1):t._e()]):t._e(),t._v(" "),e("v-file-input",{staticClass:"comment-form-file-upload",attrs:{"hide-input":"","truncate-length":"15",accept:"image/*",disabled:t.loading},on:{change:t.onUploadFile},model:{value:t.form.attachment,callback:function(e){t.$set(t.form,"attachment",e)},expression:"form.attachment"}})]},proxy:!0}]),model:{value:t.form.content,callback:function(e){t.$set(t.form,"content",e)},expression:"form.content"}}),t._v(" "),e("v-btn",{staticClass:"mr-4",attrs:{type:"submit",color:"success",loading:t.loading}},[t._v("\n Enviar\n ")])],1)},[],!1,null,"aa107446",null);e.default=component.exports},323:function(t,e,n){"use strict";n.r(e);var o={props:{image:{type:Array,required:!0}},data:()=>({width:null,height:null,maxWidth:"90vw",maxHeight:"80vh"}),computed:{styleObject(){return{width:"".concat(this.width,"px"),height:"".concat(this.height,"px"),"max-width":"".concat(this.maxWidth,"px"),"max-height":"".concat(this.maxHeight,"px")}},src(){return this.image[0]}},mounted(){this.width=this.image[1],this.height=this.image[2];var t=this.width/this.height,e=.85*window.innerWidth,n=.85*window.innerHeight;this.width>e&&(this.width=.85*window.innerWidth,this.height=this.width/t),this.height>n&&(this.height=.85*window.innerHeight,this.width=this.height*t);new this.$pinchZoom(this.$refs.commentImageZoom.firstChild,{})}},r=(n(724),n(1)),component=Object(r.a)(o,function(){var t=this,e=t._self._c;return e("div",{ref:"commentImageZoom",staticClass:"comment-image-zoom",staticStyle:{"max-height":"90vh"},style:t.styleObject},[e("img",{staticClass:"comment__dialog-image",attrs:{src:t.src,alt:""}})])},[],!1,null,null,null);e.default=component.exports},367:function(t,e,n){"use strict";n.r(e);var o=n(0),r=(n(19),n(26),n(708)),c=n.n(r),m=n(317),l=n(91),d=n(323),h={name:"CommentItem",components:{CommentForm:m.default,CommentIcon:l.default,CommentImage:d.default},props:{comment:{type:Object,required:!0},isSubcomment:{type:Boolean,default:!1}},data:()=>({showCommentForm:!1,loading:!1,dialog:!1}),computed:{content(){return c.a.sanitize(this.comment.content.rendered)},date(){return new Date(this.comment.date).toLocaleString("es",{year:"numeric",month:"numeric",day:"numeric"})},user(){return this.$store.getters["auth/user"]},likesCount(){return this.comment.likes.length},liked(){var t;return this.comment.likes.includes(null===(t=this.user)||void 0===t?void 0:t.id)},hasWebpImage(){var t=this.comment.attachment_data[0];if(!t)return!1;var e=t.split(".");return"string"==typeof t&&"webp"===e[e.length-1]},hasAttachment(){return this.comment.attachment_data.full||this.comment.attachment_data.src},attachmentIsImage(){if(!this.comment.attachment_data.src)return!1;var t=this.getExtensionFile(this.comment.attachment_data.src);return["jpg","jpeg","jpe","gif","png","bmp","tiff","tif","webp","ico","heic"].includes(t)},attachmentIsVideo(){if(!this.comment.attachment_data.src)return!1;var t=this.getExtensionFile(this.comment.attachment_data.src);return["asf","wmv","avi","divx","flv","mov","qt","mpeg","mpg","mp4","m4v","ogv","mkv","3gp","3gpp","3g2"].includes(t)},dialogWidth(){return this.attachmentIsVideo?"100%":this.comment.attachment_data.src[1]},attachmentExtension(){return this.getExtensionFile(this.comment.attachment_data.src)}},methods:{like(t){var e=this;return Object(o.a)(function*(){if(e.user){var data={};t&&(data.is_dislike=1);try{e.loading=!0;var{data:n}=yield e.$axios.post("articles/comments/".concat(e.comment.id,"/likes"),data);e.$emit("set-likes",n.data)}catch(t){e.$notify({color:"error",message:"Error."})}finally{e.loading=!1}}else e.$notify({color:"error",message:"Debe ingresar para poder dar like."})})()},toggleCommentForm(){if(this.user)this.showCommentForm=!this.showCommentForm;else{this.$notify({color:"error",message:"Debe ingresar para responder a este comentario."});var t=encodeURIComponent(this.$route.path);this.$router.push("/auth/login?redirect=".concat(t))}},onCommentSaved(t){this.showCommentForm=!1,this.$emit("add-comment",t)},getExtensionFile(t){var e=t.split(".");return e[e.length-1]}}},v=(n(746),n(747),n(1)),component=Object(v.a)(h,function(){var t=this,e=t._self._c;return e("div",{staticClass:"comment"},[e("div",{staticClass:"comment__left"},[e("div",{staticClass:"comment__avatar"},[e("img",{attrs:{src:t.comment.author_avatar_urls[96],alt:"avatar"}})])]),t._v(" "),e("div",{staticClass:"comment__right"},[e("div",{staticClass:"comment__title"},[e("h2",[t._v(t._s(t.comment.author_name))]),t._v(" "),e("span",{staticClass:"comment__date"},[t._v("\n "+t._s(t.date)+"\n ")])]),t._v(" "),e("client-only",[e("div",{staticClass:"comment__content"},[e("p",[t._v(t._s(t.comment.raw_content))]),t._v(" "),t.hasAttachment?e("p",{staticClass:"dco-attachment dco-image-attachment"},[e("v-dialog",{attrs:{"content-class":"comment-attachment-dialog",width:"auto","max-width":"90%"},scopedSlots:t._u([{key:"activator",fn:function(n){var{on:o,attrs:r}=n;return[t.attachmentIsImage?e("img",t._g(t._b({attrs:{src:t.comment.attachment_data.full[0]}},"img",r,!1),o)):t.attachmentIsVideo?e("div",t._g(t._b({staticClass:"wp-video"},"div",r,!1),o),[e("video",{staticClass:"wp-video-shortcode",attrs:{preload:"metadata",controls:"controls"}},[e("source",{attrs:{type:"video/mp4",src:t.comment.attachment_data.src}}),t._v(" "),e("a",{attrs:{href:t.comment.attachment_data.src}},[t._v("\n "+t._s(t.comment.attachment_data.src)+"\n ")])])]):t._e(),t._v(" "),e("div",t._g(t._b({staticClass:"comment-attachment-open"},"div",r,!1),o),[t._v("\n Ampliar\n ")])]}}],null,!1,1741832284),model:{value:t.dialog,callback:function(e){t.dialog=e},expression:"dialog"}},[t._v(" "),t.attachmentIsImage?e("CommentImage",{attrs:{image:t.comment.attachment_data.full}}):t.attachmentIsVideo?e("div",{staticClass:"wp-video dialog"},[e("video",{staticClass:"wp-video-shortcode",attrs:{preload:"metadata",controls:"controls"}},[e("source",{attrs:{type:"video/".concat(t.attachmentExtension),src:t.comment.attachment_data.src}}),t._v(" "),e("a",{attrs:{href:t.comment.attachment_data.src}},[t._v("\n "+t._s(t.comment.attachment_data.src)+"\n ")])])]):t._e(),t._v(" "),e("div",{staticClass:"comment__dialog-close",on:{click:function(e){t.dialog=!1}}},[e("v-icon",{attrs:{color:"#ffffff",size:"17px"}},[t._v("fa-times")])],1)],1)],1):t._e()])]),t._v(" "),e("div",{staticClass:"comment__actions"},[e("likes",{attrs:{likes:t.likesCount,"comment-id":t.comment.id,"is-liked":t.liked,loading:t.loading},on:{like:t.like}}),t._v(" "),t.isSubcomment?t._e():e("div",{staticClass:"comment__reply",on:{click:t.toggleCommentForm}},[e("comment-icon",{staticStyle:{"transform-origin":"50% 50%",transform:"rotate(180deg)"},attrs:{icon:"comment-reply-icon"}}),t._v(" "),e("span",[t._v("Responder")])],1)],1),t._v(" "),t.user&&t.showCommentForm?e("comment-form",{attrs:{"post-id":t.comment.post,"parent-id":t.comment.id},on:{"comment-saved":t.onCommentSaved}}):t._e(),t._v(" "),e("div",[t._t("subcomments")],2)],1)])},[],!1,null,"04abd613",null);e.default=component.exports},368:function(t,e,n){"use strict";n.r(e);var o={name:"CommentsList"},r=(n(748),n(1)),component=Object(r.a)(o,function(){return(0,this._self._c)("div",{staticClass:"comments-list"},[this._t("default")],2)},[],!1,null,"a08311d8",null);e.default=component.exports},369:function(t,e,n){"use strict";n.r(e);var o={props:{postName:{type:String,required:!0}}},r=(n(749),n(1)),component=Object(r.a)(o,function(){var t=this,e=t._self._c;return e("div",{staticClass:"comments-empty"},[e("span",{staticClass:"comments-empty__title"},[t._v("\n Sé el primero!\n ")]),t._v(" "),e("span",{staticClass:"comments-empty__title"},[t._v("\n en comentar esta receta "+t._s(t.postName)+".\n ")]),t._v(" "),e("v-icon",{staticClass:"comments-empty__icon",attrs:{large:""},domProps:{textContent:t._s("fa-arrow-down")}})],1)},[],!1,null,"59c0b446",null);e.default=component.exports},458:function(t,e,n){"use strict";n.r(e);n(134);var o=n(2),r=n(0),c=(n(19),n(14),n(26),n(29),n(708)),m=n.n(c),l=n(367),d=n(368),h=n(317),v=n(369),f=n(36);function _(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,o)}return n}function C(t){for(var e=1;eObject(r.a)(function*(){var{$axios:e,$config:n,params:o,error:r}=t;try{var{data:article}=yield e.get(encodeURI("/articles/".concat(o.article))),{data:c}=yield e.get(encodeURI("/articles/".concat(article.id,"/comments")));return{article:article,comments:c.original.data}}catch(t){var m;404===(null==t||null===(m=t.response)||void 0===m?void 0:m.status)&&r(t.response)}})(),data:()=>({article:{},loading:!1,loadedWeb:!1,networks:[{network:"facebook",name:"Facebook",icon:"fab fa-facebook-f",color:"#1877f2"},{network:"twitter",name:"Twitter",icon:"fab fa-twitter",color:"#1da1f2"},{network:"whatsapp",name:"Whatsapp",icon:"fab fa-whatsapp",color:"#25d366"},{network:"email",name:"Email",icon:"far fa-envelope",color:"#333333"},{network:"linkedin",name:"LinkedIn",icon:"fab fa-linkedin",color:"#007bb5"}]}),head:t=>{var e,n,o;return{title:null===(e=t.article.title)||void 0===e?void 0:e.rendered,meta:null!==(n=null===(o=t.article.meta)||void 0===o?void 0:o.map(t=>({hid:t.name?t.name:t.property,name:t.name?t.name:t.property,content:t.content})))&&void 0!==n?n:[]}},computed:{content(){return m.a.sanitize(this.article.content.rendered)},featuredImage(){var t,e;return null!==(t=this.article)&&void 0!==t&&t.meta.length?null===(e=this.article.meta.find(t=>"og:image"===t.property))||void 0===e?void 0:e.content:""},optimizedFeaturedImage(){if(!this.featuredImage)return"";var t=/^((?!chrome|android|crios|fxios).)*safari/i.test(navigator.userAgent);return this.requestResizedImage(this.featuredImage,{w:1600,q:90,fm:t?"jpg":"webp",fit:"max",sharp:12})},optimizedFeaturedImagePlaceholder(){return this.featuredImage?this.requestResizedImage(this.featuredImage,{w:40,q:40,fm:"jpg",fit:"max",blur:3}):""},user(){return this.$store.getters["auth/user"]},orderedComments(){var t,e=[],n=[],o={};return null===(t=this.comments)||void 0===t||t.forEach(t=>{0===t.parent?(e.push(C(C({},t),{},{subcomments:[]})),o[t.id]=e.length-1):n.push(t)}),n.forEach(t=>{var n=o[t.parent];"number"==typeof n&&e[n].subcomments.push(t)}),e},likesCount(){var t;return null===(t=this.article)||void 0===t?void 0:t.likes.length},isLiked(){var t;return this.article.likes.includes(null===(t=this.user)||void 0===t?void 0:t.id)},sharing(){return{hashtags:"fishboxchile",title:this.article.title.rendered,description:this.removeTags(this.article.excerpt.rendered)}},articleUrl(){return this.loadedWeb?window.location.href:""}},created(){this.loadedWeb=!0},methods:{addComment(t){this.comments.unshift(t)},setCommentsLikes(t,e){var n=this.comments.findIndex(e=>e.id===t);-1!==n?this.comments[n].likes=e:this.$notify({color:"error",message:"Error."})},likeArticle(t){var e=this;return Object(r.a)(function*(){if(e.user){var data={};t&&(data.is_dislike=1);try{e.loading=!0;var{data:n}=yield e.$axios.post("articles/".concat(e.article.id,"/likes"),data);e.article.likes=n.data}catch(t){e.$notify({color:"error",message:"Error."})}finally{e.loading=!1}}else e.$notify({color:"error",message:"Debe ingresar para poder dar like."})})()},removeTags:t=>t.replace(/(<([^>]+)>)/gi,"").slice(0,150)+"..."}},y=(n(861),n(1)),component=Object(y.a)(w,function(){var t=this,e=t._self._c;return e("v-row",{attrs:{justify:"center"}},[e("v-col",{attrs:{cols:"12",lg:"10",xl:"8"}},[e("v-card",{staticClass:"premium-card",attrs:{elevation:"8"}},[e("div",{staticClass:"image-container"},[e("v-img",{staticClass:"featured-image white--text align-end",attrs:{contain:"",loading:"lazy",src:t.optimizedFeaturedImage,"lazy-src":t.optimizedFeaturedImagePlaceholder,gradient:"to bottom, rgba(0,23,50,0.1), rgba(1,36,77,0.7)"},scopedSlots:t._u([{key:"placeholder",fn:function(){return[e("v-row",{staticClass:"fill-height ma-0",attrs:{align:"center",justify:"center"}},[e("v-progress-circular",{attrs:{indeterminate:"",size:70,width:8,color:"fishboxColor","aria-label":"cargando"}})],1)]},proxy:!0}])},[t._v(" "),e("div",{staticClass:"title-overlay pa-6"},[e("v-chip",{staticClass:"mb-3 category-chip",attrs:{small:"",color:"rgba(255,255,255,0.2)","text-color":"white"}},[t._v("\n Artículo Destacado\n ")]),t._v(" "),e("h1",{staticClass:"article-title px-2",class:t.$isMobile()?"text-h4":"text-h3",domProps:{textContent:t._s(t.article.title.rendered)}}),t._v(" "),e("div",{staticClass:"divider-line mt-4"})],1)])],1),t._v(" "),e("v-card-text",{staticClass:"post-content premium-content pa-6"},[e("div",{staticClass:"content-wrapper",domProps:{innerHTML:t._s(t.content)}})]),t._v(" "),e("div",{staticClass:"post-actions premium-actions pa-6"},[e("div",{staticClass:"actions-container"},[e("likes",{attrs:{likes:t.likesCount,"is-liked":t.isLiked,loading:t.loading},on:{like:t.likeArticle}}),t._v(" "),e("client-only",[t.loadedWeb?e("div",{staticClass:"social-section"},[e("v-divider",{staticClass:"my-4"}),t._v(" "),e("h4",{staticClass:"social-title text-center mb-4"},[t._v("\n Comparte este contenido\n ")]),t._v(" "),e("div",{staticClass:"social-links"},t._l(t.networks,function(n){return e("ShareNetwork",{key:n.network,staticStyle:{"text-decoration":"none"},attrs:{url:t.articleUrl,title:t.sharing.title,quote:t.sharing.quote,network:n.network,hashtags:t.sharing.hashtags,description:t.sharing.description,"twitter-user":t.sharing.twitterUser}},[e("v-chip",{staticClass:"social-chip ma-1",attrs:{link:"",color:n.color,label:"","text-color":"white",small:""}},[e("v-icon",{attrs:{left:"",size:14},domProps:{textContent:t._s(n.icon)}}),t._v(" "),e("span",{domProps:{textContent:t._s(n.name)}})],1)],1)}),1)],1):t._e()])],1)])],1),t._v(" "),e("v-card",{staticClass:"premium-card mt-6",attrs:{elevation:"8"}},[e("div",{staticClass:"comments-header"},[e("v-icon",{staticClass:"mr-2",attrs:{color:"#001732"}},[t._v("mdi-comment-text-multiple")]),t._v(" "),e("h2",{staticClass:"comments-title"},[t._v("\n Comentarios\n ")])],1),t._v(" "),e("v-divider",{staticClass:"mx-4"}),t._v(" "),e("v-card-text",{staticClass:"comments-content pa-4"},[0===t.orderedComments.length?e("comments-empty",{attrs:{"post-name":t.article.title.rendered}}):e("comments-list",{staticClass:"premium-comments"},t._l(t.orderedComments,function(n){return e("comment-item",{key:n.id,attrs:{comment:n},on:{"set-likes":e=>t.setCommentsLikes(n.id,e),"add-comment":t.addComment},scopedSlots:t._u([{key:"subcomments",fn:function(){return t._l(n.subcomments,function(n){return e("comment-item",{key:n.id,attrs:{comment:n,"is-subcomment":""},on:{"set-likes":e=>t.setCommentsLikes(n.id,e)}})})},proxy:!0}],null,!0)})}),1),t._v(" "),e("comment-form",{attrs:{"post-id":t.article.id},on:{"comment-saved":t.addComment}})],1)],1)],1)],1)},[],!1,null,"debdf704",null);e.default=component.exports},679:function(t,e,n){t.exports={}},680:function(t,e,n){t.exports={}},723:function(t,e,n){"use strict";n(679)},724:function(t,e,n){"use strict";n(680)},725:function(t,e,n){t.exports={}},726:function(t,e,n){t.exports={}},727:function(t,e,n){t.exports={}},728:function(t,e,n){t.exports={}},746:function(t,e,n){"use strict";n(725)},747:function(t,e,n){"use strict";n(726)},748:function(t,e,n){"use strict";n(727)},749:function(t,e,n){"use strict";n(728)},801:function(t,e,n){t.exports={}},861:function(t,e,n){"use strict";n(801)}}]);