1import{e as a,a as s,i as w,t as u,g as f,d as m,F as P,r as A,o as l,n as I,w as b,v as D,m as q,b as j,k as g,h as B,s as M,p as h,f as te,l as W,j as _e,q as he,c as fe}from"./vendor-vue-DJSV8KcG.js";import{f as we,p as oe,b as ye,l as ge,a as U,P as ve,S as xe}from"./vendor-D9xTN7gH.js";import{C as ke,p as Se}from"./vendor-chart-4GRbbgLd.js";import{_ as Ce}from"./vendor-lodash-DwdiLwCp.js";import{$ as se}from"./vendor-jquery-CQCSSOc1.js";import{i as Me,s as $,S as Re}from"./vendor-sentry-CH99OFcq.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};o.SENTRY_RELEASE={id:"8c2bbc1f398890c9f4689a376b5b85a46959ab7f"};var e=new o.Error().stack;e&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[e]="cf149f57-79b3-4abf-8f2d-150332147620",o._sentryDebugIdIdentifier="sentry-dbid-cf149f57-79b3-4abf-8f2d-150332147620")}catch{}})();const v=(o,e)=>{const r=o.__vccOpts||o;for(const[d,t]of e)r[d]=t;return r},Ie={name:"AssistantSidebar",props:["shop","review","order"],data(){return{timelineKeys:{placed_at:"Placed At",fulfilled_at:"Fulfilled At"}}},computed:{timelineItems(){const o={};for(const[e,r]of Object.entries(this.timelineKeys))this.order[e]&&(o[e]=we(oe(this.order[e]),"MMM dd, yyyy"));return o},shippingAddrISO(){const o=this.order.shipping_address;let e="";o.line1&&(e+=o.line1+"<br/>"),o.line2&&(e+=o.line2+"<br/>");let r=[];return o.postalCode&&r.push(o.postalCode),o.city&&r.push(o.city),o.state&&r.push(o.state),e+=r.join(" "),o.country&&(e+="<br/>"+o.country),e},profilePictureColor(){let o,e=0;const r=this.review.customer_name;for(o=0;o<r.length;o++)e=r.charCodeAt(o)+((e<<5)-e);let d="#";for(o=0;o<3;o++){const t=e>>o*8&255;d+=("00"+t.toString(16)).substr(-2)}return d}}},Pe={class:"border-l h-full"},Ee={class:"p-8 pl-4"},Ae={class:"flex flex-col items-center"},Le={class:"text-center mb-5 font-weight-bold",style:{"font-size":"1.25rem"}},je={class:"customer-details-list mb-5 whitespace-nowrap"},Te={class:"flex items-center text-gray-700 mt-4 h-4 tooltip flex-row"},Be={class:"tooltip-body"},Ue={class:"truncate"},Oe={key:0,class:"whitespace-normal text-gray-700 mt-4 h-4 text-sm"},Fe={key:1,class:"flex items-start text-gray-700 mt-4"},Ve=["innerHTML"],De={key:0},qe={class:"customer-details-list small text-secondary order-timeline"},Ne={class:"font-semibold"};function ze(o,e,r,d,t,n){return l(),a("div",Pe,[s("div",Ee,[s("div",Ae,[s("div",{class:"customer-profile-picture mb-2",style:w(`max-height: 4rem; height: 4rem; width: 4rem; background-color: ${n.profilePictureColor}; background-image: url(${r.review.customer_profile_picture_url})`)},null,4),s("h2",Le,u(r.review.customer_name),1)]),s("ul",je,[s("li",Te,[s("div",Be,u(r.review.customer_email),1),e[0]||(e[0]=s("div",null,[s("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"mr-4 h-5 w-5"},[s("path",{d:"M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z"}),s("polyline",{points:"22,6 12,13 2,6"})])],-1)),s("div",Ue,u(r.review.customer_email),1)]),r.review.marketing_opt_in?(l(),a("li",Oe,[...e[1]||(e[1]=[s("span",{class:"mr-4"},"â
",-1),f(" Opted into Marketing Communications ",-1)])])):m("",!0),r.order&&r.shop.shop_type==="WEBFLOW"?(l(),a("li",Fe,[e[2]||(e[2]=s("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"mr-4 mt-1"},[s("path",{d:"M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z"}),s("circle",{cx:"12",cy:"10",r:"3"})],-1)),s("span",{innerHTML:n.shippingAddrISO},null,8,Ve)])):m("",!0)]),r.order?(l(),a("div",De,[e[3]||(e[3]=s("h2",{class:"mb-2 font-weight-bold",style:{"font-size":"1rem"}},"Order Details",-1)),s("ul",qe,[(l(!0),a(P,null,A(t.timelineKeys,(i,c)=>(l(),a("li",{key:c,class:"whitespace-nowrap flex justify-between items-center @isset($selectedReview['order'][$k]) order-timeline-item--completed @endisset"},[s("div",Ne,u(i),1),f(" "+u(n.timelineItems[c]),1)]))),128))])])):m("",!0)])])}const re=v(Ie,[["render",ze]]),He=Object.freeze(Object.defineProperty({__proto__:null,default:re},Symbol.toStringTag,{value:"Module"})),Ke={name:"CustomerProfilePicture",props:["url"]};function We(o,e,r,d,t,n){return l(),a("div",{class:"customer-profile-picture",style:w(`margin-right: 1rem; height: 48px; width: 48px; background-image: url('${r.url}') !important;`)},null,4)}const ie=v(Ke,[["render",We],["__scopeId","data-v-6975f33a"]]),Ye=Object.freeze(Object.defineProperty({__proto__:null,default:ie},Symbol.toStringTag,{value:"Module"})),Je={name:"TinyStarBadge",props:["score"]},Ze={class:"inline-block mr-1",style:{"line-height":"1"}};function Xe(o,e,r,d,t,n){return l(),a("span",{class:I(["tiny-star-badge badge badge-pill flex align-items-center badge-primary h-100 px-2 py-1",{negative:r.score===1||r.score===2,neutral:r.score===3,"score-4":r.score===4,"score-5":r.score===5}])},[s("span",Ze,u(r.score),1),e[0]||(e[0]=s("svg",{width:"12px",height:"13px",viewBox:"0 0 20 19",version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"},[s("g",{id:"star",fill:"#fff"},[s("polygon",{id:"Path",points:"10 0 13.09 6.26 20 7.27 15 12.14 16.18 19.02 10 15.77 3.82 19.02 5 12.14 0 7.27 6.91 6.26"})])],-1))],2)}const ne=v(Je,[["render",Xe]]),Qe=Object.freeze(Object.defineProperty({__proto__:null,default:ne},Symbol.toStringTag,{value:"Module"})),Ge={name:"ReviewBrowser",components:{AssistantSidebar:re,TinyStarBadge:ne},props:["isAdmin"],beforeMount(){try{this.fetchReviews(),this.fetchShop(),this.fetchReviewables()}finally{this.loading=!1}},beforeUnmount(){},data(){return{reviewables:[],loading:!0,pollReviewsIntervalId:null,reviews:[],shop:null,filter:[],reviewableId:"",selectedReviewIndex:0,reviewsNextUrl:null,filterByStar:""}},computed:{selectedReview(){return this.reviews[this.selectedReviewIndex]}},methods:{async fetchReviews(o=!1){let e="",r="/reviews",d=!1;if(o&&this.reviewsNextUrl){const y=this.reviewsNextUrl.split("?");r=y[0],e=y[1]}let t=new URLSearchParams(e);this.filter.length>0&&(t.append("filter",this.filter.join(",")),d=!0),this.reviewableId!==""&&(t.append("reviewable_id",this.reviewableId),d=!0),this.filterByStar&&(t.append("filter_by_star",this.filterByStar),d=!0);const i=new URLSearchParams(window.location.search).get("review_id");!d&&!o&&i&&!this.reviews.includes(y=>y.id==i)&&t.append("required_review_id",i);const c=await axios.get(`${r}?`+t.toString());o===!0?this.reviews=[...this.reviews,...c.data.data.splice(0,this.reviews.length)]:(this.reviews=c.data.data,!d&&i&&(this.selectedReviewIndex=this.reviews.findIndex(y=>y.id==i)||0)),this.reviewsNextUrl=c.data.next_page_url},async refetchSelectedReview(o=null){o||(o=(await axios.get(`/reviews/${this.selectedReview.id}`)).data);const e=this.reviews[this.selectedReviewIndex];this.reviews.splice(this.selectedReviewIndex,1,{...o,media:e.media,media_cdn:e.media_cdn})},async publishReview(){await axios.put(`/reviews/${this.selectedReview.id}`,{published:!0}),await this.refetchSelectedReview()},async unpublishReview(){await axios.put(`/reviews/${this.selectedReview.id}`,{published:!1}),await this.refetchSelectedReview()},async featureReview(o){await axios.put(`/reviews/${this.selectedReview.id}`,{featured:o}),await this.refetchSelectedReview()},async togglePinned(){await axios.put(`/reviews/${this.selectedReview.id}`,{pinned:!this.selectedReview.pinned}),await this.refetchSelectedReview()},async fetchShop(){const o=await axios.get("/shop");this.shop=o.data},async fetchReviewables(){const o=await axios.get("/reviewables");this.reviewables=o.data},selectReview(o){this.selectedReviewIndex=o,this.selectedReview.read||this.markRead(this.selectedReview.id)},async markRead(o){this.selectedReview.read=!0,await axios.put(`/reviews/${o}`,{read:!0})},async deleteReview(o){const[e]=this.reviews.splice(o,1);await axios.delete(`/reviews/${e.id}`)},async restoreReview(o){const[e]=this.reviews.splice(o,1);await axios.post(`/reviews/${e.id}/restore`)}}},$e={class:"flex flex-1"},et={class:"border-r w-4/12 bg-gray-100",style:{"min-width":"300
1px","max-width":"360px"}},tt={class:"bg-white border-b flex items-center justify-between py-4 px-4"},ot={class:"relative z-50","x-data":"{ open: false }"},st={"x-show":"open","x-on:click.away":"open = false",class:"shadow-lg origin-top-right border border-gray-300 block mt-2 mb-4 rounded-md text-sm absolute w-48 transition ease-in-out duration-150 bg-white right-0","x-transition:enter":"transition ease-out duration-100","x-transition:enter-start":"transform opacity-0 scale-95","x-transition:enter-end":"transform opacity-100 scale-100","x-transition:leave":"transition ease-in duration-75","x-transition:leave-start":"transform opacity-100 scale-100","x-transition:leave-end":"transform opacity-0 scale-95"},rt={class:"px-4 py-2"},it={class:"px-4 py-2"},nt={class:"px-4 py-2"},lt={class:"px-4 py-2"},at={class:"px-4 py-2"},dt=["value"],ut={class:"px-4 py-2 form-group"},ct=["value"],mt={class:"overflow-y-scroll max-h-screen"},pt=["onClick"],bt={class:"flex items-center"},_t={key:0,class:"rounded-full bg-blue-500 inline-block mr-2",style:{width:"6px",height:"6px",top:"12px",left:"12px"}},ht={class:"mr-auto ml-3 text-dark"},ft={class:"inline-flex items-center"},wt={key:0,class:"text-gray-500 mr-1",alt:"Pinned to Top",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 512 512"},yt={class:"text-xs text-gray-500"},gt={class:"leading-normal text-gray-600 text-sm mt-2",style:{flex:"4"}},vt={class:"mt-2"},xt={key:0,class:"bg-red-200 font-semibold text-red-700 rounded-full uppercase text-xxs px-2 py-1"},kt={class:"w-full p-8"},St={key:0,class:"flex items-center justify-center text-2xl h-full"},Ct={key:1,class:"max-w-screen-lg mx-auto h-full"},Mt={class:"w-1/5 ml-auto",style:{"max-width":"360px"}};function Rt(o,e,r,d,t,n){const i=g("tiny-star-badge"),c=g("review-browser-details"),y=g("assistant-sidebar");return l(),a("div",$e,[s("div",et,[s("div",tt,[e[26]||(e[26]=s("h1",{class:"font-bold text-lg inline-block tracking-wide"},"Reviews",-1)),s("div",ot,[e[25]||(e[25]=s("button",{type:"button",class:"bg-gray-200 rounded-md p-1 text-gray-700","x-on:click":"open = true"},[s("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 512 512"},[s("path",{d:"M472,168H40a24,24,0,0,1,0-48H472a24,24,0,0,1,0,48Z",fill:"currentColor"}),s("path",{d:"M392,280H120a24,24,0,0,1,0-48H392a24,24,0,0,1,0,48Z",fill:"currentColor"}),s("path",{d:"M296,392H216a24,24,0,0,1,0-48h80a24,24,0,0,1,0,48Z",fill:"currentColor"})])],-1)),s("ul",st,[e[24]||(e[24]=s("li",{class:"text-center font-semibold bg-gray-200 text-gray-800 py-1 text-sm"}," Filter ",-1)),s("li",rt,[b(s("input",{type:"checkbox","onUpdate:modelValue":e[0]||(e[0]=p=>t.filter=p),value:"deleted",id:"filterDeleted",onChange:e[1]||(e[1]=p=>n.fetchReviews(!1))},null,544),[[D,t.filter]]),e[18]||(e[18]=s("label",{for:"filterDeleted",class:"ml-1"},"Deleted",-1))]),s("li",it,[b(s("input",{type:"checkbox","onUpdate:modelValue":e[2]||(e[2]=p=>t.filter=p),value:"published",id:"filterPublished",onChange:e[3]||(e[3]=p=>n.fetchReviews(!1))},null,544),[[D,t.filter]]),e[19]||(e[19]=s("label",{for:"filterPublished",class:"ml-1"},"Published",-1))]),s("li",nt,[b(s("input",{type:"checkbox","onUpdate:modelValue":e[4]||(e[4]=p=>t.filter=p),value:"unpublished",id:"filterUnpublished",onChange:e[5]||(e[5]=p=>n.fetchReviews(!1))},null,544),[[D,t.filter]]),e[20]||(e[20]=s("label",{for:"filterUnpublished",class:"ml-1"},"Unpublished",-1))]),s("li",lt,[b(s("input",{type:"checkbox","onUpdate:modelValue":e[6]||(e[6]=p=>t.filter=p),value:"not-responded",id:"filterNotResponded",onChange:e[7]||(e[7]=p=>n.fetchReviews(!1))},null,544),[[D,t.filter]]),e[21]||(e[21]=s("label",{for:"filterNotResponded",class:"ml-1"},"Not Responded",-1))]),s("li",at,[b(s("select",{class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-1.5","onUpdate:modelValue":e[8]||(e[8]=p=>t.reviewableId=p),onChange:e[9]||(e[9]=p=>n.fetchReviews(!1))},[e[22]||(e[22]=s("option",{value:""},"Filter By Product",-1)),(l(!0),a(P,null,A(this.reviewables,p=>(l(),a("option",{value:p.id},u(p.name)+" ("+u(p.ext_id)+") ",9,dt))),256))],544),[[q,t.reviewableId]])]),s("li",ut,[b(s("select",{class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-1.5","onUpdate:modelValue":e[10]||(e[10]=p=>t.filterByStar=p),onChange:e[11]||(e[11]=p=>n.fetchReviews(!1))},[e[23]||(e[23]=s("option",{value:""},"Filter By Star Rating",-1)),(l(),a(P,null,A([5,4,3,2,1],p=>s("option",{value:p},u(p===1?"1 star":`${p} stars`),9,ct)),64))],544),[[q,t.filterByStar]])])])])]),s("ul",mt,[(l(!0),a(P,null,A(t.reviews,(p,_)=>(l(),a("li",{class:"bg-white py-4 px-4 border-b cursor-pointer hover:bg-blue-100",style:w([t.selectedReviewIndex===_?{"border-left":"3px solid #0080ff"}:{}]),onClick:R=>n.selectReview(_)},[s("span",bt,[p.read?m("",!0):(l(),a("span",_t)),B(i,{score:p.score},null,8,["score"]),s("span",ht,u(p.customer_name),1),s("span",ft,[p.pinned?(l(),a("svg",wt,[...e[27]||(e[27]=[s("polyline",{points:"176 249.38 256 170 336 249.38",style:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32px"}},null,-1),s("line",{x1:"256",y1:"181.03",x2:"256",y2:"342",style:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32px"}},null,-1),s("path",{d:"M448,256c0-106-86-192-192-192S64,150,64,256s86,192,192,192S448,362,448,256Z",style:{fill:"none",stroke:"currentColor","stroke-miterlimit":"10","stroke-width":"32px"}},null,-1)])])):m("",!0),s("span",yt,u(p.created_at_tri_formatted),1)])]),s("p",gt,u(p.message_shorted),1),s("div",vt,[p.deleted_at?(l(),a("span",xt,"Deleted")):m("",!0)])],12,pt))),256)),t.reviewsNextUrl?(l(),a("li",{key:0,onClick:e[12]||(e[12]=p=>n.fetchReviews(!0)),class:"flex"},[...e[28]||(e[28]=[s("button",{class:"flex py-5 hover:bg-gray-200 w-full items-center justify-center font-medium text-sm text-gray-800"}," Load More ",-1)])])):m("",!0)])]),s("div",kt,[this.loading===!1&&t.reviews.length===0?(l(),a("div",St,[...e[29]||(e[29]=[s("div",{class:"text-gray-500 font-semibold"},[s("span",null,"You currently have no reviews.")],-1)])])):m("",!0),n.selectedReview&&t.shop?(l(),a("div",Ct,[(l(),j(c,{key:n.selectedReview.id,review:n.selectedReview,shop:t.shop,isAdmin:r.isAdmin,reviewables:t.reviewables,onRefreshSelectedReview:n.refetchSelectedReview,onDeleteReview:e[13]||(e[13]=p=>n.deleteReview(t.selectedReviewIndex)),onRestoreReview:e[14]||(e[14]=p=>n.restoreReview(t.selectedReviewIndex)),onTogglePinned:e[15]||(e[15]=p=>n.togglePinned(t.selectedReviewIndex)),onFeatureReview:n.featureReview,onPublishReview:e[16]||(e[16]=p=>n.publishReview(t.selectedReviewIndex)),onUnpublishReview:e[17]||(e[17]=p=>n.unpublishReview(t.selectedReviewIndex))},null,8,["review","shop","isAdmin","reviewables","onRefreshSelectedReview","onFeatureReview"]))])):m("",!0)]),s("div",Mt,[n.selectedReview&&t.shop?(l(),j(y,{key:0,review:n.selectedReview,order:n.selectedReview.order,shop:t.shop},null,8,["review","order","shop"])):m("",!0)])])}const It=v(Ge,[["render",Rt]]),Pt=Object.freeze(Object.defineProperty({__proto__:null,default:It},Symbol.toStringTag,{value:"Module"})),Et={name:"ReviewEditModal",props:{review:Object,isAdmin:[Boolean,Number]},data(){return{form:{created_at:ye(oe(this.review.created_at),{}),message:this.review.message},errors:{}}},methods:{async updateReview(){try{const o=await axios.put(`/reviews/${this.review.id}`,this.form);this.$emit("refresh-selected-review",o.data),this.$emit("close")}catch(o){this.errors=o.response.data.errors}}}},At={class:"inset-0 fixed z-50 flex items-center justify-center",style:{background:"rgba(0, 0, 0, .5)"}},Lt={class:"bg-white max-w-screen-sm w-full rounded p-8 shadow animated slideInUp"},jt={class:"flex justify-between"},Tt={key:0,class:"text-red-700 text-xs font-semibold mt-1"},Bt={key:0},Ut={key:0,class:"text-red-700 text-xs font-semibold mt-1"};function Ot(o,e,r,d,t,n){return l(),a("div",At,[s("div",Lt,[s("div",jt,[e[5]||
1(e[5]=s("h3",{class:"font-bold text-2xl"},"Update Review",-1)),s("button",{type:"button",onClick:e[0]||(e[0]=i=>o.$emit("close")),class:"text-gray-500 hover:text-gray-900"},[...e[4]||(e[4]=[s("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24",viewBox:"0 0 24 24",width:"24"},[s("path",{fill:"currentColor",d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})],-1)])])]),s("form",{action:"",method:"post",onSubmit:e[3]||(e[3]=M((...i)=>n.updateReview&&n.updateReview(...i),["prevent"])),class:"mt-8 flex flex-col"},[s("div",null,[e[6]||(e[6]=s("label",{for:"createdAt",class:"form-label form-label-block"},"Published At",-1)),b(s("input",{id:"createdAt",class:"form-input",type:"date",name:"created_at","onUpdate:modelValue":e[1]||(e[1]=i=>t.form.created_at=i),placeholder:"",required:""},null,512),[[h,t.form.created_at]]),t.errors.created_at?(l(),a("div",Tt,u(t.errors.created_at[0]),1)):m("",!0)]),r.isAdmin?(l(),a("div",Bt,[e[7]||(e[7]=s("label",{class:"form-label form-label-block"},"Message",-1)),b(s("textarea",{cols:"30",rows:"10","onUpdate:modelValue":e[2]||(e[2]=i=>t.form.message=i),class:"form-input"}," ",512),[[h,t.form.message]]),t.errors.message?(l(),a("div",Ut,u(t.errors.message[0]),1)):m("",!0)])):m("",!0),e[8]||(e[8]=s("button",{type:"submit",class:"ml-auto mt-8 ml-auto btn btn--primary rounded ml-auto sm:w-full lg:w-auto shadow"}," Update ",-1))],32)])])}const le=v(Et,[["render",Ot]]),Ft=Object.freeze(Object.defineProperty({__proto__:null,default:le},Symbol.toStringTag,{value:"Module"})),Vt={name:"ReviewBrowserDetails",components:{ReviewEditModal:le},props:["shop","review","isAdmin","reviewables"],data(){return{reviewEditModalVisible:!1,reviewReassignModalVisible:!1,replyForm:{message:null,private:!1},replyEditing:!1,replyFormErrors:{},showTooltipFeatured:!1}},computed:{getUrlToProductPage(){var e,r,d,t,n,i;let o="#";return((r=(e=this.review)==null?void 0:e.reviewable)==null?void 0:r.wf_collection_slug)==="my_site"?o=this.shop.url:(t=(d=this.review)==null?void 0:d.reviewable)!=null&&t.product_url?o=this.review.reviewable.product_url:(i=(n=this.review)==null?void 0:n.reviewable)!=null&&i.wf_collection_slug&&(o=`${this.shop.url}/${this.review.reviewable.wf_collection_slug}/${this.review.reviewable.ext_id}`),o}},methods:{async sendReply(){try{if(this.replyFormErrors={},this.replyEditing){const o=await axios.put(`/reviews/${this.review.id}/reply/${this.review.reply.id}`,this.replyForm)}else{const o=await axios.post(`/reviews/${this.review.id}/reply`,this.replyForm)}this.replyForm={message:null,private:!1},this.replyEditing=!1,this.$emit("refresh-selected-review")}catch(o){console.error(o),this.replyFormErrors=o.response.data.errors}},editReply(){this.replyEditing=!0,this.replyForm={message:this.review.reply.message,private:this.review.reply.private}},uploadImage(o){const e=new FormData;e.append("image",o.target.files[0]),axios.post(`/reviews/${this.review.id}/media`,e).then(r=>{this.review.media_cdn.push(r.data.media)}).catch(r=>{console.error("error while uploading",r)})},deleteImageReview(o){confirm("Are you sure you want to delete image?")&&axios.delete(`/reviews/${this.review.id}/media/${o}`).then(e=>{const r=this.review.media_cdn.findIndex(d=>d.id==o);~r&&this.review.media_cdn.splice(r,1)}).catch(e=>{console.error("error while deleting",e)})}}},Dt={class:"flex flex-col p-8 h-full"},qt={class:"mb-8 pb-8 border-b"},Nt={class:"flex items-center"},zt=["src"],Ht={key:1,class:"bg-gray-200 h-16 w-16"},Kt={class:"ml-4"},Wt=["href"],Yt={class:"text-gray-600 text-sm"},Jt={class:"text-gray-600 text-sm"},Zt={class:"mb-8 flex items-center"},Xt={class:"flex items-center"},Qt={class:"font-bold mb-1"},Gt={class:"ml-auto flex flex-col justify-end"},$t={class:"text-gray-600 flex text-right items-center self-end"},eo={class:"mr-2"},to={key:0,class:"tooltip-body"},oo={key:1,class:"tooltip-body"},so={class:"flex mt-2 items-center"},ro={"x-data":"{ open: false }",class:"relative ml-auto"},io={"x-show":"open","x-on:click.away":"open = false",class:"bg-white shadow absolute rounded right-0 mt-3 border z-10",style:{"min-width":"8rem"}},no={key:0},lo={key:1},ao={key:0,class:"text-lg font-bold mb-4"},uo={class:"text-lg text-gray-700 leading-normal whitespace-pre-wrap"},co={class:"grid grid-cols-3 gap-4"}
1,mo={class:"mr-2 mt-8 relative"},po=["onClick"],bo=["href"],_o=["src"],ho={key:0,class:"mr-2 mt-8"},fo={key:1,class:"relative mt-auto"},wo={key:0,class:"alert alert-error mb-4"},yo={for:"replyMsg",class:"text-gray-700 font-medium text-sm mb-2 inline-block"},go={class:"flex items-center"},vo={class:"inline-flex items-center ml-auto"},xo={class:"flex items-center"},ko={key:2,class:"mt-8 pt-8 border-t"},So={class:"bg-gray-200 p-8 rounded"},Co={class:"text-sm mb-4 flex justify-between"},Mo={class:"text-gray-500"},Ro={class:"whitespace-pre-wrap"};function Io(o,e,r,d,t,n){const i=g("customer-profile-picture"),c=g("star-rating"),y=g("review-edit-modal"),p=g("review-reassign-modal");return l(),a("div",Dt,[e[26]||(e[26]=s("div",{class:"flex justify-content-end"},null,-1)),s("div",qt,[e[17]||(e[17]=s("h3",{class:"font-bold mb-4"},"Reviewable",-1)),s("div",Nt,[r.review.reviewable.image_urls&&r.review.reviewable.image_urls.original?(l(),a("img",{key:0,src:r.review.reviewable.image_urls.original,class:"h-16"},null,8,zt)):(l(),a("div",Ht)),s("div",Kt,[s("a",{href:n.getUrlToProductPage,class:"font-bold text-monto-metrics-main-green hover:text-monto-metrics-light-green",target:"_blank"},u(r.review.reviewable.name),9,Wt),s("div",Yt,"Collection name: "+u(r.review.reviewable.wf_collection_slug),1),s("div",Jt,"Product slug: "+u(r.review.reviewable.ext_id),1)])])]),s("div",Zt,[s("div",Xt,[B(i,{url:r.review.customer_profile_picture_url},null,8,["url"]),s("div",null,[s("div",Qt,u(r.review.customer_name),1),B(c,{score:r.review.score,color:"orange"},null,8,["score"])])]),s("div",Gt,[s("div",$t,[s("span",eo,u(r.review.created_at_tri_formatted),1),s("a",{class:"cursor-pointer tooltip",onClick:e[0]||(e[0]=_=>o.$emit("feature-review",!r.review.featured))},[r.review.featured?(l(),a("div",oo," Remove this review from the slider layout ")):(l(),a("div",to," Feature this review in the slider layout ")),(l(),a("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",class:I(r.review.featured?"text-orange-450":"text-gray-600"),height:"1.5em",width:"1.5em",viewBox:"0 0 18 20.8",style:{"enable-background":"new 0 0 18 20.8"},"xml:space":"preserve"},[...e[18]||(e[18]=[s("path",{d:`M9,11.5l2.9,1.5l-0.6-3.3l2.4-2.3L10.5,7L9,4L7.5,7L4.2,7.5l2.4,2.3L6.1,13L9,11.5z M1,0h16c0.3,0,0.5,0.1,0.7,0.3 2 C17.9,0.5,18,0.7,18,1v19.3c0,0.2-0.1,0.3-0.2,0.4s-0.3,0.1-0.5,0L9,17l-8.3,3.7c-0.2,0.1-0.3,0.1-0.5,0S0,20.5,0,20.3V1 3 c0-0.3,0.1-0.5,0.3-0.7C0.5,0.1,0.7,0,1,0z`},null,-1)])],2))])]),s("div",so,[r.review.published_at?m("",!0):(l(),a("button",{key:0,onClick:e[1]||(e[1]=_=>o.$emit("publish-review")),type:"button",class:"btn py-2 btn--primary mr-4 flex items-center"},[...e[19]||(e[19]=[s("svg",{class:"mr-1",xmlns:"http://www.w3.org/2000/svg",height:"16",viewBox:"0 0 512 512"},[s("polyline",{points:"416 128 192 384 96 288",style:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"64px"}})],-1),f(" Publish ",-1)])])),s("div",ro,[e[20]||(e[20]=s("button",{type:"button","x-on:click":"open = true",class:"bg-gray-200 px-4 py-3 rounded block text-gray-600 hover:text-gray-900 transition-colors duration-100"},[s("svg",{width:"18px",height:"4px",viewBox:"0 0 18 4",version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"},[s("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd","stroke-linecap":"round","stroke-linejoin":"round"},[s("g",{id:"Group",transform:"translate(1.000000, 1.000000)",stroke:"currentColor","stroke-width":"2"},[s("circle",{id:"Oval",cx:"8",cy:"1",r:"1"}),s("circle",{id:"Oval",cx:"15",cy:"1",r:"1"}),s("circle",{id:"Oval",cx:"1",cy:"1",r:"1"})])])])],-1)),t.reviewEditModalVisible?(l(),j(y,{key:0,onClose:e[2]||(e[2]=_=>t.reviewEditModalVisible=!1),onRefreshSelectedReview:e[3]||(e[3]=_=>o.$emit("refresh-selected-review",_)),isAdmin:r.isAdmin,review:r.review},null,8,["isAdmin","review"])):m("",!0),t.reviewReassignModalVisible?(l(),j(p,{key:1,onClose:e[4]||(e[4]=_=>t.reviewReassignModalVisible=!1),onRefreshSelectedReview:e[5]||(e[5]=_=>o.$emit("refresh-selected-review",_)),reviewables:r.reviewables,review:r.review},null,8,["reviewables","review"])):m("",!0),s("div",io,[s("button",{type:"button",onClick:e[6]||(e[6]=_=>t.reviewEditModalVisible=!0),class:"text-left w-full px-4 py-2 transition-colors duration-100 hover:bg-gray-100"}," Edit "),s("button",{type:"button",onClick:e[7]||(e[7]=_=>t.reviewReassignModalVisible=!0),class:"text-left w-full px-4 py-2 transition-colors duration-100 hover:bg-gray-100"}
3," Reassign "),r.review.published_at?(l(),a("button",{key:0,type:"button",onClick:e[8]||(e[8]=_=>o.$emit("unpublish-review")),class:"text-left w-full px-4 py-2 transition-colors duration-100 hover:bg-gray-100"}," Unpublish ")):m("",!0),s("button",{type:"button",onClick:e[9]||(e[9]=_=>o.$emit("toggle-pinned")),class:"text-left w-full px-4 py-2 transition-colors duration-100 hover:bg-gray-100"},[r.review.pinned?(l(),a("span",no," Unpin ")):(l(),a("span",lo," Pin to Top "))]),r.review.deleted_at?(l(),a("button",{key:1,type:"button",onClick:e[10]||(e[10]=_=>o.$emit("restore-review")),class:"text-left w-full px-4 py-2 transition-colors duration-100 hover:bg-gray-100"}," Restore ")):(l(),a("button",{key:2,type:"button",onClick:e[11]||(e[11]=_=>o.$emit("delete-review")),class:"text-left w-full px-4 py-2 transition-colors duration-100 hover:bg-gray-100"}," Delete "))])])])])]),r.review.title?(l(),a("h4",ao,u(r.review.title),1)):m("",!0),s("div",uo,u(r.review.message),1),s("ul",co,[(l(!0),a(P,null,A(this.review.media_cdn,_=>(l(),a("li",mo,[r.isAdmin?(l(),a("button",{key:0,type:"button",onClick:R=>n.deleteImageReview(_.id),class:"absolute top-0 right-0 p-3 text-3xl text-gray-500 hover:text-gray-700"},[...e[21]||(e[21]=[s("svg",{width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},[s("path",{"fill-rule":"evenodd",d:"M4.646 4.646a.5.5 0 0 1 .708 0L8 7.293l2.646-2.647a.5.5 0 0 1 .708.708L8.707 8l2.647 2.646a.5.5 0 0 1-.708.708L8 8.707l-2.646 2.647a.5.5 0 0 1-.708-.708L7.293 8 4.646 5.354a.5.5 0 0 1 0-.708z"})],-1)])],8,po)):m("",!0),s("a",{href:_.original,target:"_blank"},[s("img",{src:_.thumbnail,style:{"max-height":"315px","max-width":"100%"}},null,8,_o)],8,bo)]))),256)),r.isAdmin?(l(),a("li",ho,[e[22]||(e[22]=te('<label class="mx-auto relative" for="reviewNewFile"><div class="border border-gray-400 hover:border-gray-500 bg-white opacity-50 hover:cursor-pointer transition-opacity text-gray-800 absolute inset-0 flex items-center justify-center"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" height="1.5em" width="1.5em"><path fill-rule="evenodd" d="M3 17a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM6.293 6.707a1 1 0 010-1.414l3-3a1 1 0 011.414 0l3 3a1 1 0 01-1.414 1.414L11 5.414V13a1 1 0 11-2 0V5.414L7.707 6.707a1 1 0 01-1.414 0z" clip-rule="evenodd"></path></svg></div><img class="mx-auto" style="width:4rem;height:4rem;" id="mediaPreview"></label>',1)),s("input",{type:"file",id:"reviewNewFile",hidden:"",accept:"image/jpeg",onChange:e[12]||(e[12]=(..._)=>n.uploadImage&&n.uploadImage(..._))},null,32)])):m("",!0)]),!r.review.reply||t.replyEditing?(l(),a("div",fo,[s("form",{onSubmit:e[15]||(e[15]=M((..._)=>n.sendReply&&n.sendReply(..._),["prevent"]))},[t.replyFormErrors.message?(l(),a("div",wo,u(t.replyFormErrors.message[0]),1)):m("",!0),s("label",yo,"Reply to "+u(r.review.customer_name)+":",1),b(s("textarea",{id:"replyMsg",rows:"5",class:"form-input mb-4 w-full","onUpdate:modelValue":e[13]||(e[13]=_=>t.replyForm.message=_)}," ",512),[[h,t.replyForm.message]]),s("div",go,[e[25]||(e[25]=s("p",{class:"pr-16 text-gray-500 text-xs"}," The customer will be notified via mail if consent to marketing communications was given. Private replies will not be published and not visible in the review widget. ",-1)),s("div",vo,[s("div",xo,[b(s("input",{type:"checkbox","onUpdate:modelValue":e[14]||(e[14]=_=>t.replyForm.private=_),id:"privateReply",class:"mr-2"},null,512),[[D,t.replyForm.private]]),e[23]||(e[23]=s("label",{for:"privateReply",class:"form-label"},"Private",-1))]),e[24]||(e[24]=s("button",{type:"submit",class:"btn btn--primary ml-6"},"Send",-1))])])],32)])):(l(),a("div",ko,[s("div",So,[s("div",Co,[s("span",Mo,"Your "+u(r.review.reply.private?"private":"public")+" reply:",1),s("button",{onClick:e[16]||(e[16]=(..._)=>n.editReply&&n.editReply(..._)),type:"button",class:"text-gray-600 hover:text-gray-700 border-b border-dotted border-gray-500"},"Edit")]),s("span",Ro,u(r.review.reply.message),1)])]))])}const Po=v(Vt,[["render",Io]]),Eo=Object.freeze(Object.defineProperty({__proto__:null,default:Po},Symbol.toStringTag,{value:"Module"})),Ao={name:"ReviewReassignModal",props:{review:Object,reviewables:Array},data(){return{reassignedReviewableId:this.review.reviewable_id,errors:{}}},methods:{async reassignReview(){try{const o=await axios.post(`/reviews/${this.review.id}/reassign`,{reviewable_id:this.reassignedReviewableId});this.$emit("refresh-selected-review",o.data),this.$emit("close")}catch(o){this.errors=o.response.data.errors}}}},Lo={class:"inset-0 fixed z-50 flex items-center justify-center",style:{background:"rgba(0, 0, 0, .5)"}},jo={class:"bg-white max-w-screen-sm w-full rounded p-8 shadow animated slideInUp"},To={class:"flex justify-between"},Bo=["value"],Uo={key:0,class:"text-red-700 text-xs font-semibold mt-1"};function Oo(o,e,r,d,t,n){return l(),a("div",Lo,[s("div",jo,[s("div",To,[e[4]||(e[4]=s("h3",{class:"font-bold text-2xl"},"Reassigning a review to a different product",-1)),s("button",{type:"button",onClick:e[0]||(e[0]=i=>o.$emit("close")),class:"text-gray-500 hover:text-gray-900"},[...e[3]||(e[3]=[s("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24",viewBox:"0 0 24 24",width:"24"},[s("path",{fill:"currentColor",d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})],-1)])])]),s("form",{action:"",method:"post",onSubmit:e[2]||(e[2]=M((...i)=>n.reassignReview&&n.reassignReview(...i),["prevent"])),class:"mt-8 flex flex-col"}
3,[s("div",null,[e[5]||(e[5]=s("label",{for:"createdAt",class:"form-label form-label-block"},"Products list",-1)),b(s("select",{class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-1.5","onUpdate:modelValue":e[1]||(e[1]=i=>t.reassignedReviewableId=i)},[(l(!0),a(P,null,A(this.reviewables,i=>(l(),a("option",{value:i.id},u(i.name)+" ("+u(i.ext_id)+" / "+u(i.wf_collection_slug)+") ",9,Bo))),256))],512),[[q,t.reassignedReviewableId]]),t.errors.reviewable_id?(l(),a("div",Uo,u(t.errors.reviewable_id[0]),1)):m("",!0)]),e[6]||(e[6]=s("button",{type:"submit",class:"ml-auto mt-8 ml-auto btn btn--primary rounded ml-auto sm:w-full lg:w-auto shadow"}," Update ",-1))],32)])])}const Fo=v(Ao,[["render",Oo]]),Vo=Object.freeze(Object.defineProperty({__proto__:null,default:Fo},Symbol.toStringTag,{value:"Module"})),Do={name:"StarRating",props:["score","color"]},qo={class:"material-icons"};function No(o,e,r,d,t,n){return l(),a("ul",{class:"flex",style:w({color:r.color})},[(l(!0),a(P,null,A(r.score,i=>(l(),a("li",qo,"star"))),256))],4)}const ae=v(Do,[["render",No]]),zo=Object.freeze(Object.defineProperty({__proto__:null,default:ae},Symbol.toStringTag,{value:"Module"})),Ho={name:"SubscriptionFormModal",props:{productKey:String,product:Object,subscription:Object,dudaAppId:String,useStripe:Boolean|Number,step:{type:String,default:"current_plan"},stripe:Object},data(){const o=Object.keys(this.product.plans)[0];return{loading:!1,selectedPlanForLimit1:this.subscription.plan_id||o,selectedPlanForLimit2:this.product.limit_unit2?this.subscription.plan_id||o:null,stepLocal:this.step,errors:{},visiblePlansList:{},billingInterval:"monthly",selectedPlanId:null}},beforeMount(){let o={monthly:0,yearly:0};this.visiblePlansList=this.step==="plans_list"?Object.entries(this.product.plans).filter(e=>o[e[1].interval]++<3).reduce((e,[r,d])=>({...e,[r]:d}),{}):{}},mounted(){if(!this.useStripe&&!document.getElementById("dudaIframeScript")){let e=document.createElement("script");e.setAttribute("src","https://sandbox-ms-cdn.multiscreensite.com/integrationhub/3264/res/sdk/iframe.js"),e.setAttribute("id","dudaIframeScript"),document.head.appendChild(e)}},computed:{productPlansLimit1(){let o=[];for(var e in this.product.plans)this.product.plans[e].interval==="monthly"&&o.push([e,this.product.plans[e].limit]);return o.sort((r,d)=>r[1]-d[1])},productPlansLimit2(){let o=[];for(var e in this.product.plans)this.product.plans[e].interval==="monthly"&&o.push([e,this.product.plans[e].limit2]);return o.sort((r,d)=>r[1]-d[1])},currentPlanInfo(){var o;return(o=this.subscription)!=null&&o.plan_id?this.product.plans[this.subscription.plan_id]:null},upgradePlanInfo(){var o;return(o=this.currentPlanInfo)!=null&&o.upgrade_plan_id?this.product.plans[this.currentPlanInfo.upgrade_plan_id]:null}},watch:{stepLocal(){this.errors.general=""}},methods:{seePlans(){this.visiblePlansList={};let o=null;if(!this.selectedPlanForLimit2||Number(this.product.plans[this.selectedPlanForLimit1].limit)>=Number(this.product.plans[this.selectedPlanForLimit2].limit)&&Number(this.product.plans[this.selectedPlanForLimit1].limit2)>=Number(this.product.plans[this.selectedPlanForLimit2].limit2)?o=this.selectedPlanForLimit1:o=this.selectedPlanForLimit2,o=this.getNextPlanIdIfThereIsCurrent(o),o){const e=this.product.plans[o];this.visiblePlansList[o]=e;let r=e.upgrade_plan_id||this.findNextPlan("monthly",e);r&&(r=this.getNextPlanIdIfThereIsCurrent(r),this.visiblePlansList[r]=this.product.plans[r]);for(let d in this.visiblePlansList){const t=this.getYearlyPlanIdByMonthlyPlan(this.product.plans[d]);t&&(this.visiblePlansList[t]=this.product.plans[t])}}this.stepLocal="plans_list"},getYearlyPlanIdByMonthlyPlan(o){for(let e in this.product.plans)if(this.product.plans[e].interval==="yearly"&&this.product.plans[e].limit==o.limit*12)return this.getNextPlanIdIfThereIsCurrent(e);return null},findNextPlan(o,e){let r=Number.POSITIVE_INFINITY,d=null;for(let t in this.product.plans)this.product.plans[t].interval===o&&Number(e.limit)<Number(this.product.plans[t].limit)&&r>Number(this.product.plans[t].limit)&&(r=Number(this.product.plans[t].limit),d=t);return d},formatInterval(o){return o==="monthly"?"month":"year"},getNextPlanIdIfThereIsCurrent(o){var e,r;
3return o&&o===((e=this.subscription)==null?void 0:e.plan_id)&&(o=((r=this.currentPlanInfo)==null?void 0:r.upgrade_plan_id)||this.findNextPlan(this.subscription.interval,this.currentPlanInfo)),o},async changePlan(o){if(this.useStripe)try{this.loading=!0;const e=await axios.put(`/billing/subscription/${this.productKey}/swap`,{product_key:this.productKey,plan_id:o});this.$emit("plan-changed",e.data.subscription)}catch(e){console.error(e),this.errors.general="Failed to upgrade subscription. Please try again later or contact the support."}finally{this.loading=!1}else{const e={type:"upgradeApp",appId:this.dudaAppId,planId:o};window._dAPI.upgrade(e),this.$emit("close")}},upgradeToNextTier(){this.changePlan(this.currentPlanInfo.upgrade_plan_id)},async subscribe(){var o,e;try{if(this.errors={},this.loading=!0,!this.selectedPlanId){this.errors.general="Please select a plan";return}if(!this.useStripe){const t=await axios.get(`/billing/subscription/${this.productKey}/plan/${this.selectedPlanId}`);location.assign(t.data.link);return}const r=await axios.post("/billing/stripe/checkout",{plan_id:this.selectedPlanId,product_key:this.productKey}),{error:d}=await this.stripe.redirectToCheckout({sessionId:r.data.checkout_session_id});d&&console.log(d)}catch(r){(e=(o=r.response)==null?void 0:o.data)!=null&&e.message?this.errors.general=r.response.data.message:r.response.data.errors&&(this.errors=r.response.data.errors)}finally{this.loading=!1}},swapPlan(){if(this.errors={},!this.selectedPlanId){this.errors.general="Please select a plan";return}this.changePlan(this.selectedPlanId)},async cancelSubscription(){if(!this.loading)try{this.loading=!0;const o=await axios.delete(`/billing/subscription/${this.productKey}`);this.$emit("plan-changed",o.data.subscription)}catch{this.errors.general="Failed to cancel subscription. Please try again later or contact the support."}finally{this.loading=!1}},async resumeSubscription(){if(!this.loading)try{this.loading=!0;const o=await axios.post(`/billing/subscription/${this.productKey}/resume`);this.$emit("plan-changed",o.data.subscription)}catch{this.errors.general="Failed to resume subscription. Please try again later or contact the support."}finally{this.loading=!1}}}},Ko={key:0},Wo={class:"text-2xl font-bold"},Yo={key:1},Jo={class:"text-2xl font-bold"},Zo={key:2,class:"mb-8 text-red-700 text-center"},Xo={key:3},Qo={class:"text-xl"},Go={key:0},$o={key:1},es={key:2},ts={key:0,class:"py-2"},os={key:1},ss={class:"mb-2"},rs={key:0,class:"pt-4 pb-2 text-xs"},is={class:"w-full bg-white mr-4 rounded-md",style:{border:"1px solid #C0C0C0"}},ns={class:"mt-2 font-medium text-gray-700 whitespace-nowrap"},ls={key:1,class:"pt-2 text-xs"},as={class:"w-full bg-white mr-4 rounded-md",style:{border:"1px solid #C0C0C0"}},ds={class:"mt-2 font-medium text-gray-700 whitespace-nowrap"},us={class:"mt-2 text-center"},cs=["disabled"],ms={class:"mt-4 text-center"},ps={key:2,class:"mt-4 text-center"},bs=["disabled"],_s={key:3,class:"mt-4 text-center"},hs=["disabled"],fs={key:4},ws={class:"mt-2"},ys={class:"text-lowercase"},gs=["value"],vs={key:0,class:"mt-4"},xs={class:"text-lowercase"},ks=["value"],Ss={class:"mt-8 text-center"},Cs={key:5},Ms={key:0,class:"mb-4 text-sm uppercase text-center"},Rs=["for"],Is={class:"flex items-center"},Ps=["value","id"],Es={class:"ml-4"},As={class:"flex items-center"},Ls={class:"font-semibold capitalize"},js={key:0,class:"inline-flex items-center px-2 ml-2 text-xs font-medium text-gray-700 uppercase bg-gray-200 rounded-full"},Ts={class:"block text-sm text-gray-700"},Bs={class:"text-gray-700"},Us={class:"mt-4 text-center"},Os={class:"mt-4 text-center"},Fs=["disabled"],Vs={key:1},Ds=["disabled"],qs={class:"mt-2 text-xs text-gray-500"},Ns={key:0};function zs(o,e,r,d,t,n){return l(),a("div",{onClick:e[15]||(e[15]=i=>o.$emit("close")),class:"fixed inset-0 z-10 flex items-center justify-center",style:{background:"rgba(0, 0, 0, .5)"}},[s("div",{onClick:e[14]||(e[14]=M(()=>{},["stop"])),class:"relative w-full max-w-lg px-12 py-10 bg-white rounded-md shadow-md overflow-y-auto max-h-full"},[s("button",{type:"button",onClick:e[0]||(e[0]=i=>o.$emit("close")),class:"absolute top-0 right-0 p-4 text-gray-500 hover:text-gray-700"},[...e[16]||(e[16]=[s("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24",viewBox:"0 0 24 24",width:"24"},[s("path",{fill:"currentColor",d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})],-1)])]),s("div",null,[!r.subscription||r.subscription.status!=="subscribed"?(l(),a("div",Ko,[s("h3",Wo," Subscribe to "+u(r.product.product_display_name),1),e[17]||(e[17]=s("p",{class:"mb-8 text-gray-700"}," Select a plan that works for you and get started using the app! ",-1))])):(l(),a("div",Yo,[s("h3",Jo," Manage "+u(r.product.product_display_name)+" Subscription ",1),e[18]||(e[18]=s("p",{class:"mb-8 text-gray-700"}," Here you can change your current subscription plan or cancel your subscription. ",-1))])),t.errors.general?(l(),a("p",Zo,u(t.errors.general),1)):m("",!0),t.stepLocal==="current_plan"?(l(),a("div",Xo,[s("h2",Qo,[e[19]||(e[19]=s("b",null,"Current Plan: ",-1)),r.subscription.status=="trial"?(l(),a("span",Go," Monto Trial ")):r.subscription.status=="trial_ended"?(l(),a("span",$o," Monto Trial Ended ")):r.subscription.name?(l(),a("span",es,u(r.subscription.name),1)):m("",!0)]),r.subscription.status&&r.subscription.status!=="subscribed"?(l(),a("div",ts," Status: "+u(r.subscription.status.split("_").join(" ")),1)):m("",!0),r.subscription.status=="subscribed"?(l(),a("div",os,[s("div",null,"Price: $"+u(r.subscription.price)+" / "+u(n.formatInterval(r.subscription.interval)),1),s("div",ss,"Next Bill: "+u(r.subscription.next_billing),1),r.subscription.quota_limit>0?(l(),a("div",rs,[s("div",is,[s("div",{class:I([{"bg-lightseagreen-700":r.subscription.depleted_quota/r.subscription.quota_limit<.8,"bg-chocolate-400":r.subscription.depleted_quota/r.subscription.quota_limit>=.8&&r.subscription.depleted_quota/r.subscription.quota_limit<.9,"bg-indianred-500":r.subscription.depleted_quota/r.subscription.quota_limit>=.9},"h-2 rounded-md"]),style:w(`width: ${r.subscription.depleted_quota*100/r.subscription.quota_limit}%; max-width: 100%`)},null,6)]),s("div",ns,u(r.subscription.depleted_quota)+" / "+u(r.subscription.quota_limit)+" "+u(r.product.limit_unit)+" depleted.",1)])):m("",!0),r.subscription.quota_limit2>0?(l(),a("div",ls,[s("div",as,[s("div",{class:I([{"bg-lightseagreen-700":r.subscription.depleted_quota2/r.subscription.quota_limit2<.8,"bg-chocolate-400":r.subscription.depleted_quota2/r.subscription.quota_limit2>=.8&&r.subscription.depleted_quota2/r.subscription.quota_limit2<.9,"bg-indianred-500":r.subscription.depleted_quota2/r.subscription.quota_limit2>=.9},"h-2 rounded-md"]),style:w(`width: ${r.subscription.depleted_quota2*100/r.subscription.quota_limit2}%; max-width: 100%`)},null,6)]),s("div",ds,u(r.subscription.depleted_quota2)+" / "+u(r.subscription.quota_limit2)+" "+u(r.product.limit_unit2)+" depleted.",1)])):m("",!0)])):m("",!0),e[23]||(e[23]=s("div",{class:"mt-8 text-sm"}," By changing your plan, you will be charged the new plan amount immediately and reset your current app usage and billing date ",-1)),s("div",us,[n.upgradePlanInfo?(l(),a("button",{key:0,t
3ype:"button",onClick:e[1]||(e[1]=(...i)=>n.upgradeToNextTier&&n.upgradeToNextTier(...i)),disabled:t.loading,class:"w-full btn btn--primary flex-col leading-5"},[e[20]||(e[20]=s("div",{class:"font-bold text-base"},"Upgrade to Next Tier",-1)),f(" $"+u(n.upgradePlanInfo.price)+" / "+u(n.formatInterval(n.upgradePlanInfo.interval)),1),e[21]||(e[21]=s("br",null,null,-1)),f(" "+u(n.upgradePlanInfo.limit_description),1),e[22]||(e[22]=s("br",null,null,-1))],8,cs)):m("",!0)]),s("div",ms,[Object.keys(r.product.plans).length>1?(l(),a("button",{key:0,type:"button",onClick:e[2]||(e[2]=i=>t.stepLocal="change_plan"),class:"w-full btn btn--white"}," See More Plans ")):m("",!0)]),r.useStripe&&r.subscription.status=="subscribed"?(l(),a("div",ps,[s("button",{type:"button",onClick:e[3]||(e[3]=M((...i)=>n.cancelSubscription&&n.cancelSubscription(...i),["prevent"])),disabled:t.loading,class:"w-full px-3 py-2 mb-2 font-semibold text-sm whitespace-nowrap bg-white hover:border-gray-500 text-indianred-700"}," Cancel Subscription ",8,bs)])):r.useStripe&&r.subscription.status=="grace_period"?(l(),a("div",_s,[s("button",{type:"button",onClick:e[4]||(e[4]=M((...i)=>n.resumeSubscription&&n.resumeSubscription(...i),["prevent"])),disabled:t.loading,class:"w-full btn btn--white"}," Resume Subscription ",8,hs)])):m("",!0)])):t.stepLocal==="change_plan"?(l(),a("form",fs,[e[28]||(e[28]=s("h2",{class:"text-xl font-bold"},"Plan Builder",-1)),s("div",ws,[s("div",null,[e[24]||(e[24]=f("How many ",-1)),s("span",ys,u(r.product.limit_unit),1),e[25]||(e[25]=f(" per month do you need?",-1))]),b(s("select",{class:"mt-2 bg-white p-2 w-full form-input form-input--sm","onUpdate:modelValue":e[5]||(e[5]=i=>t.selectedPlanForLimit1=i)},[(l(!0),a(P,null,A(n.productPlansLimit1,i=>(l(),a("option",{value:i[0],key:i[0]},u(i[1])+" "+u(r.product.limit_unit),9,gs))),128))],512),[[q,t.selectedPlanForLimit1]])]),r.product.limit_unit2?(l(),a("div",vs,[s("div",null,[e[26]||(e[26]=f("How many ",-1)),s("span",xs,u(r.product.limit_unit2),1),e[27]||(e[27]=f(" per month do you need?",-1))]),b(s("select",{class:"mt-2 bg-white p-2 w-full form-input form-input--sm","onUpdate:modelValue":e[6]||(e[6]=i=>t.selectedPlanForLimit2=i)},[(l(!0),a(P,null,A(n.productPlansLimit2,i=>(l(),a("option",{value:i[0],key:i[0]},u(i[1])+" "+u(r.product.limit_unit2),9,ks))),128))],512),[[q,t.selectedPlanForLimit2]])])):m("",!0),s("div",Ss,[s("button",{type:"button",onClick:e[7]||(e[7]=M((...i)=>n.seePlans&&n.seePlans(...i),["prevent"])),class:"w-full btn btn--primary"}," See Plans ")])])):t.stepLocal==="plans_list"?(l(),a("div",Cs,[r.useStripe?(l(),a("div",Ms,[s("button",{type:"button",class:I(["btn rounded-none rounded-l-md",[t.billingInterval==="monthly"?"btn--primary":"btn--white"]]),onClick:e[8]||(e[8]=i=>t.billingInterval="monthly")}," Monthly ",2),s("button",{type:"button",class:I(["-ml-1 btn rounded-none rounded-r-md",[t.billingInterval==="yearly"?"btn--primary":"btn--white"]]),onClick:e[9]||(e[9]=i=>t.billingInterval="yearly")}," Yearly - 2 months free! ",2)])):m("",!0),(l(!0),a(P,null,A(t.visiblePlansList,(i,c)=>(l(),a(P,{key:c},[i.interval===t.billingInterval?(l(),a("label",{key:0,for:c,class:I(["flex items-center justify-between p-6 mb-4 border rounded-md shadow-sm cursor-pointer",[t.selectedPlanId===c?"border-2 border-lightseagreen-500":"hover:border-lightseagreen-300"]])},[s("span",Is,[b(s("input",{type:"radio",name:"form.plan_id","onUpdate:modelValue":e[10]||(e[10]=y=>t.selectedPlanId=y),value:c,id:c},null,8,Ps),[[W,t.selectedPlanId]]),s("span",Es,[s("span",As,[s("span",Ls,u(i.name),1),r.subscription&&r.subscription.plan_id&&c===r.subscription.plan_id&&r.subscription.status!=="ended"?(l(),a("span",js," Current Plan ")):m("",!0)]),s("span",Ts,u(i.limit_description),1)])]),s("span",Bs,"$"+u(i.price),1)],10,Rs)):m("",!0)],64))),128)),s("div",Us,[s("button",{type:"button",onClick:e[11]||(e[11]=i=>t.stepLocal="change_plan"),class:"w-full btn btn--white"}," See More Plans ")]),s("div",Os,[r.subscription&&r.subscription.status!=="trial"&&r.subscription.status!=="trial_ended"&&r.subscription.status!=="ended"?(l(),a("button",{key:0,t
3ype:"button",disabled:t.loading,onClick:e[12]||(e[12]=M((...i)=>n.swapPlan&&n.swapPlan(...i),["prevent"])),class:"w-full btn btn--primary"}," Change Plan ",8,Fs)):(l(),a("div",Vs,[s("button",{type:"button",onClick:e[13]||(e[13]=M((...i)=>n.subscribe&&n.subscribe(...i),["prevent"])),disabled:t.loading,class:"w-full btn btn--primary"}," Subscribe ",8,Ds)])),s("p",qs,[r.useStripe&&(!r.subscription||r.subscription.status!=="subscribed")?(l(),a("span",Ns,"You will be redirected to Stripe.")):m("",!0)])])])):m("",!0)])])])}const de=v(Ho,[["render",zs]]),Hs=Object.freeze(Object.defineProperty({__proto__:null,default:de},Symbol.toStringTag,{value:"Module"})),Ks={name:"SubscriptionForm",components:{SubscriptionFormModal:de},props:{productKey:String,useStripe:{type:Boolean|Number,default:!0}},data(){return{loading:!0,stripe:null,product:null,subscription:null,paymentMethod:null,errors:{},showModal:!this.useStripe&&window.location.search.includes(`sub_form_open_${this.productKey}=1`),dudaAppId:"",dudaLinkToProfileApp:null,dudaLinkToInstallApp:null,formModalStep:"current_plan"}},computed:{learnMoreLink(){return this.dudaLinkToProfileApp||this.productKey=="reviews"&&"https://www.monto.io/webflow-reviews"||this.productKey=="acr"&&"https://www.monto.io/abandoned-cart-recovery"||this.productKey=="aff"&&"https://www.monto.io/affiliates"||this.productKey=="curconv"&&"https://www.monto.io/multi-currency"||this.productKey=="ss"&&"https://www.monto.io/simple-subscriptions"||this.productKey=="crm"&&"https://www.monto.io/webflow-crm"||this.productKey=="portal"&&"https://www.monto.io/customer-portal"||this.productKey=="proof"&&"https://www.monto.io/social-proof"||this.productKey=="loyalty"&&"https://www.monto.io/loyalty-referrals"||""}},async beforeMount(){this.useStripe&&(this.stripe=await ge("pk_live_51HVM3bBfAxmClfiT5zdSbPDg01QDACyJxhhVQrJW2D3OM7q0SnZU8LxAE0S27l7sdfr2IFfutX7HgHA95SQzxc8Y00YHJ2Dvlm")),await this.fetchSubscriptionStatus()},methods:{async fetchSubscriptionStatus(){try{const o=await axios.get(`/billing/subscription/${this.productKey}`);this.subscription=o.data.subscription,this.product=o.data.product,this.dudaAppId=o.data.duda_app_id,this.dudaLinkToProfileApp=o.data.duda_link_to_profile_app,this.dudaLinkToInstallApp=o.data.duda_link_to_install_app,this.product.plans=Object.entries(this.product.plans).sort(([,e],[,r])=>e.price-r.price).reduce((e,[r,d])=>({...e,[r]:d}),{}),this.paymentMethod=o.data.payment_method}catch(o){console.log(o)}finally{this.loading=!1}},async showSubscribeModal(o=!1){if(this.useStripe)this.modalVisible=!0;else{const e=await axios.get(`/billing/subscription/${this.productKey}/upgrade`);o?window.open(e.data.link,"_blank").focus():location.assign(e.data.link)}},async startTrial(){try{if(this.useStripe)await axios.post(`/billing/subscription/${this.productKey}/trial`),await this.fetchSubscriptionStatus();else{window.open(this.dudaLinkToInstallApp,"_blank").focus();return}this.productKey==="ss"?window.location.href="/ss/products":window.location.href="/setup?app="+this.productKey}catch{this.errors.general="Failed to start trial. Please try again later or contact the support."}},async updatePaymentMethod(){try{this.errors={};const o=await axios.put("/billing/stripe/payment_details",{product_key:this.productKey});console.log(o);const{error:e}=await this.stripe.redirectToCheckout({sessionId:o.data.checkout_session_id});e&&console.log(e)}catch(o){console.log(o),this.errors=o.response.data.errors}},subscriptionUpdated(o){this.subscription=o,this.formModalStep="current_plan"}}},Ws={key:0,class:"mt-2 border rounded-md bg-lightseagreen-50"},Ys={key:0,class:"mb-8 text-red-700 text-center"},Js={class:"flex items-center justify-between p-4"},Zs={class:"flex items-center"},Xs={class:"ml-4"},Qs={class:"font-semibold"},Gs={key:0,class:"text-sm text-gray-600"},$s=["href"],er={key:1,class:"text-sm text-gray-600"},tr={key:0},or={key:1},sr={key:2,class:"text-sm text-gray-600"},rr={key:3,class:"text-sm text-gray-600"},ir={class:"font-medium"},nr={key:0},lr={class:"capitalize"},ar={key:4,class:"text-sm text-gray-600"},dr={key:5,class:"mr-8 text-sm text-red-800 text"},ur={key:6,class:"mr-8 text-sm text-red-800 text"},cr={class:"ml-4"},mr={key:0,class:"mr-6 font-semibold text-gray-700"},pr={key:0},br={key:1},_r={key:2,class:"p-4 flex justify-between items-center border-t text-xs"},hr={class:"w-full bg-white mr-4 rounded-md"},fr={class:"font-medium text-gray-700 whitespace-nowrap"},wr={key:3,class:"p-4 flex justify-between items-center border-t text-xs"},yr={class:"w-full bg-white mr-4 rounded-md"},gr={class:"font-medium text-gray-700 whitespace-nowrap"};function vr(o,e,r,d,t,n){const i=g("subscription-form-modal");return t.loading?m("",!0):(l(),a("li",Ws,[t.errors.general?(l(),a("p",Ys,u(t.errors.general),1)):m("",!0),t.showModal?(l(),j(i,{key:1,product:t.product,productKey:r.productKey,subscription:t.subscription,dudaAppId:t.dudaAppId,useStripe:r.useStripe,step:t.formModalStep,stripe:t.stripe,onPlanChanged:n.subscriptionUpdated,onClose:e[0]||(e[0]=c=>t.showModal=!1)},null,8,["product","productKey","subscription","dudaAppId","useStripe","step","stripe","onPlanChanged"])):m("",!0),s("div",Js,[s("div",Zs,[_e(o.$slots,"icon"),s("div",Xs,[s("div",Qs,u(t.product.product_display_name),1),t.subscription?t.subscription.status==="trial"?(l(),a("div",er,[t.product.product_subscription_name==="portal"||!r.useStripe&&t.product.product_subscription_name==="crm"?(l(),a("div",tr,"You are on your free plan.")):(l(),a("div",or,"You are on your free trial."))])):t.subscription.status==="ended"?(l(),a("p",sr,"You are not subscribed.")):t.subscription.status==="subscribed"?(l(),a("p",rr,[e[7]||(e[7]=f(" You are currently subscribed to ",-1)),s("span",ir,u(t.subscription.name),1),e[8]||(e[8]=f(".",-1)),e[9]||(e[9]=s("br",null,null,-1)),r.useStripe?(l(),a("span",nr,[e[6]||(e[6]=f(" This account is billed to a ",-1)),s("span",lr,u(t.paymentMethod.pm_type),1),f(" ending in "+u(t.paymentMethod.pm_last_four)+". ",1)])):m("",!0)])):t.subscription.status==="grace_peri
3od"?(l(),a("p",ar," Subscription is cancelled and ends on "+u(t.subscription.ends_at)+". ",1)):t.subscription.status==="incomplete_payment"?(l(),a("p",dr,[...e[10]||(e[10]=[s("span",{class:"font-bold"},"Subscription requires confirmation.",-1),s("br",null,null,-1),f(" Please confirm your subscription via 3D secure in the email we've sent you. ",-1)])])):t.subscription.status==="past_due"?(l(),a("p",ur,[...e[11]||(e[11]=[s("span",{class:"font-bold"},"Your latest payment is past due.",-1),s("br",null,null,-1),f("Please ensure that your payment method is up-to-date ",-1)])])):m("",!0):(l(),a("div",Gs,[f(u(t.product.product_description)+" ",1),e[5]||(e[5]=s("br",null,null,-1)),s("a",{class:"text-monto-metrics-main-green hover:text-monto-metrics-light-green",href:n.learnMoreLink,target:"_blank"},"Learn More",8,$s)]))])]),s("div",cr,[t.product.product_subscription_name==="dashboard"?(l(),a("span",mr," Free ")):t.subscription?!r.useStripe&&t.product.product_subscription_name!=="crm"&&t.product.product_subscription_name!=="portal"?(l(),a("button",{key:2,type:"button",onClick:e[2]||(e[2]=c=>t.showModal=!0),class:"px-3 py-2 ml-4 text-sm font-semibold text-gray-700 whitespace-nowrap bg-white border border-gray-400 rounded-md shadow-sm hover:border-gray-500"}," Manage Subscription ")):r.useStripe&&t.subscription.status!=="ended"&&t.subscription.status!=="trial"&&t.subscription.status!=="trial_ended"?(l(),a("button",{key:3,type:"button",onClick:e[3]||(e[3]=c=>{t.formModalStep="current_plan",t.showModal=!0}),class:"px-3 py-2 ml-4 text-sm font-semibold text-gray-700 whitespace-nowrap bg-white border border-gray-400 rounded-md shadow-sm hover:border-gray-500"}," Manage Subscription ")):t.product.product_subscription_name==="portal"||!r.useStripe&&t.product.product_subscription_name==="crm"?m("",!0):(l(),a("button",{key:4,type:"button",onClick:e[4]||(e[4]=c=>{t.formModalStep="plans_list",t.showModal=!0}),class:"whitespace-nowrap btn btn--primary"}," Subscribe ")):(l(),a("button",{key:1,type:"button",onClick:e[1]||(e[1]=(...c)=>n.startTrial&&n.startTrial(...c)),class:"whitespace-nowrap btn btn--primary"},[t.product.product_subscription_name==="portal"||!r.useStripe&&t.product.product_subscription_name==="crm"?(l(),a("div",pr,"Use for Free")):(l(),a("div",br,"Start Trial"))]))])]),t.product.product_subscription_name!=="dashboard"&&t.subscription&&t.subscription.status==="subscribed"&&t.subscription.quota_limit>0?(l(),a("div",_r,[s("div",hr,[s("div",{class:I([{"bg-lightseagreen-700":t.subscription.depleted_quota/t.subscription.quota_limit<.8,"bg-chocolate-400":t.subscription.depleted_quota/t.subscription.quota_limit>=.8&&t.subscription.depleted_quota/t.subscription.quota_limit<.9,"bg-indianred-500":t.subscription.depleted_quota/t.subscription.quota_limit>=.9},"h-2 rounded-md"]),style:w(`width: ${t.subscription.depleted_quota*100/t.subscription.quota_limit}%; max-width: 100%`)},null,6)]),s("span",fr,u(t.subscription.depleted_quota)+" / "+u(t.subscription.quota_limit)+" "+u(t.product.limit_unit)+" depleted.",1)])):m("",!0),t.product.product_subscription_name!=="dashboard"&&t.subscription&&t.subscription.status==="subscribed"&&t.subscription.quota_limit2>0?(l(),a("div",wr,[s("div",yr,[s("div",{class:I([{"bg-lightseagreen-700":t.subscription.depleted_quota2/t.subscription.quota_limit2<.8,"bg-chocolate-400":t.subscription.depleted_quota2/t.subscription.quota_limit2>=.8&&t.subscription.depleted_quota2/t.subscription.quota_limit2<.9,"bg-indianred-500":t.subscription.depleted_quota2/t.subscription.quota_limit2>=.9},"h-2 rounded-md"]),style:w(`width: ${t.subscription.depleted_quota2*100/t.subscription.quota_limit2}%; max-width: 100%`)},null,6)]),s("span",gr,u(t.subscription.depleted_quota2)+" / "+u(t.subscription.quota_limit2)+" "+u(t.product.limit_unit2)+" depleted.",1)])):m("",!0)]))}const xr=v(Ks,[["render",vr]]),kr=Object.freeze(Object.defineProperty({__proto__:null,default:xr},Symbol.toStringTag,{value:"Module"})),E="https://api.monto.io",L={"Content-Type":"application/json",Accept:"application/json"},Sr={cache:{},init(o){this.shopHashId=o},async getStore(){return typeof this.cache.shop<"u"?this.cache.shop:(this.cache.shop=(await fetch(`${E}/shops/${this.shopHashId}?include_apps_statuses=aff`,{headers:L})).json(),this.cache.shop)},async getAffConfig(){return await fetch(`${E}/s/${this.shopHashId}/aff/config`,{headers:L})},async getLoyaltyConfig(){return await fetch(`${E}/s/${this.shopHashId}/loyalty/config`,{headers:L})},async increaseAffSession(o){return await fetch(`${E}/s/${this.shopHashId}/aff/sessions/${o}`,{headers:L,method:"POST"})},async createAffiliateLink(o){return await fetch(`${E}/s/${this.shopHashId}/aff/links`,{method:"POST",headers:{"X-Requested-With":"XMLHttpRequest",Accept:"application/json"},body:o})},async getAffiliateLink(o){return await fetch(`${E}/s/${this.shopHashId}/aff/find-link`,{method:"POST",headers:L,body:JSON.stringify({email:o})})},async upsertCart(o){return await fetch(`${E}/s/${this.shopHashId}/carts/${o.type}`,{method:"PUT",headers:L,body:JSON.stringify(o,(e,r)=>e==="loop"||e==="locations"||e==="lang"?null:r)})},async containsAnySubscribables(o){return await fetch(`${E}/shops/${this.shopHashId}/ss/contains_any_subscribables`,{method:"PUT",headers:L,body:JSON.stringify({skus:o})})},async getPopupData(){return await fetch(`${E}/s/${this.shopHashId}/proof/popups`,{headers:L})},async getCurrencyRate(o=null){let e=`${E}/shops/${this.shopHashId}/curconv/rate`;return o&&(e+=`?currency=${o}`),(await fetch(e,{headers:L})).json()},async pushProofEvent(o){return await fetch(`${E}/s/${this.shopHashId}/proof/events`,{method:"POST",headers:L,body:JSON.stringify(o)})},async increasePageViews(o){return await fetch(`${E}/s/${this.shopHashId}/stats/pageviews`,{headers:L,method:"POST",body:JSON.stringify(o)})}};function Cr(o,e="",r=!0,d=!0){var p,_;const t=` 4 --monto-earn-money-background: ${o.background}; 5 --monto-earn-money-text: ${o.text_color}; 6 --monto-earn-money-button-text: ${o.button_text_color}; 7 --monto-earn-money-button-background: ${o.button_background}; 8 `,n=((_=(p=window.MONTO)==null?void 0:p.store)==null?void 0:_.shop_type)==="DUDA"?"font-family: Arial;":"",i=document.createElement("style");if(i.innerHTML=` 9 #montoEarnMoneyModal { 10 ${t} 11 display: none; 12 position: absolute; 13 width: 350px; 14 background: var(--monto-earn-money-background); 15 padding: 1.5rem; 16 border-radius: 0.375rem; 17 box-shadow: 0px 0px 5px grey; 18 border-color: rgba(226, 232, 240, 1); 19 z-index: 100; 20 text-align: center; 21 color: var(--monto-earn-money-text); 22 ${n} 23 } 24 25 #montoEarnMoneyModal.show { 26 display: block; 27 } 28 29 #montoEarnMoneyModal .headline { 30 font-size: 1rem; 31 font-weight: bold; 32 } 33 34 #montoEarnMoneyModal .body-copy { 35 margin-top: 0.5rem; 36 font-size: 0.8rem; 37 } 38 #montoEarnMoneyModal .form-item { 39 margin-top: 1rem; 40 text-align: left; 41 } 42 #montoEarnMoneyModal label > span { 43 opacity: 0.6; 44 font-size: 0.8rem; 45 } 46 #montoEarnMoneyModal input { 47 width: 100%; 48 background: var(--monto-earn-money-background); 49 color: var(--monto-earn-money-text); 50 padding: 0.7rem; 51 border: 1px solid rgba(226, 232, 240, 1); 52 border-radius: 0.2rem; 53 } 54 #montoEarnMoneyModal .btn-get-ref-link { 55 width: 100%; 56 background: var(--monto-earn-money-button-background); 57 color: var(--monto-earn-money-button-text); 58 padding: 0.5rem; 59 border-radius: 0.375rem; 60 text-align: center; 61 margin-top: 1.5rem; 62 } 63 #montoEarnMoneyModal .error { 64 display: none; 65 width: 100%; 66 color: red; 67 padding: 0.1rem; 68 } 69 #montoEarnMoneyModal .monto-switch-holder { 70 cursor: pointer; 71 display: flex; 72 align-items: center; 73 } 74 #montoEarnMoneyModal .monto-switch-input { 75 position: absolute; 76 width: 1px; 77 height: 1px; 78 padding: 0; 79 margin: -1px; 80 overflow: hidden; 81 clip: rect(0, 0, 0, 0); 82 white-space: nowrap; 83 border-width: 0; 84 } 85 #montoEarnMoneyModal .monto-switch { 86 --switch-container-width: 32px; 87 --switch-size: calc(var(--switch-container-width) / 2); 88 89 display: flex; 90 align-items: center; 91 position: relative; 92 height: var(--switch-size); 93 flex-basis: var(--switch-container-width); 94 border-radius: var(--switch-size); 95 background-color: #edf2f7; 96 flex-shrink: 0; 97 transition: background-color 0.25s ease-in-out; 98 opacity: 1; 99 margin-right: 0.5rem; 100 } 101 #montoEarnMoneyModal .monto-switch::before { 102 content: ""; 103 position: absolute; 104 left: 1px; 105 height: calc(var(--switch-size) + 0px); 106 width: calc(var(--switch-size) + 0px); 107 border-radius: 9999px; 108 background-color: var(--monto-earn-money-background); 109 border: 2px solid var(--monto-earn-money-button-background); 110 111 transition: transform 0.375s ease-in-out; 112 } 113 #montoEarnMoneyModal .monto-switch-input:checked + .monto-switch { 114 background-color: var(--monto-earn-money-button-background); 115 } 116 #montoEarnMoneyModal .monto-switch-input:checked + .monto-switch::before { 117 background-color: var(--monto-earn-money-background); 118 border-color: var(--monto-earn-money-button-background); 119 transform: translateX( 120 calc(var(--switch-container-width) - var(--switch-size)) 121 ); 122 } 123 #montoEarnMoneyModal .monto-switch-input:focus + .monto-switch::before { 124 border-color: var(--monto-earn-money-background); 125 } 126 #montoEarnMoneyModal .monto-paypal-email-address-holder { 127 display: none; 128 } 129 ${e} 130 `,document.head.appendChild(i),o.custom_css){const R=document.createElement("style");R.id="montoEarnMoneyModalCustomCss",document.head.appendChild(R)}const c=document.createElement("div");c.id="montoEarnMoneyModal";let y=` 131 <form> 132 <div style="position: absolute; padding: 10px; top: -5px; right: -5px; z-index: 10;"> 133 <button class="monto-earn-money-close-button" style="background: none; border: none; padding: 0; margin: 0; cursor: pointer; opacity: 0.4;"> 134 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" height="18px"> 135 <path fill-rule="evenodd" d="M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z" clip-rule="evenodd" /> 136 </svg> 137 </button> 138 </div> 139 <div class="headline">${o.headline}</div> 140 <div class="body-copy">${o.body_copy}</div> 141 <div class="form-item"> 142 <label>
143 <span>Name</span> 144 <input name="name" type="text"> 145 </label> 146 <span id="montoEarnMoneyModalErrorName" class="error"></span> 147 </div> 148 149 <div class="form-item"> 150 <label> 151 <span>Email Address</span> 152 <input name="email" type="email"> 153 </label> 154 <span id="montoEarnMoneyModalErrorEmail" class="error"></span> 155 </div> 156 157 <div class="form-item"> 158 <label class="monto-switch-holder"> 159 <input 160 id="montoEarnMoneyModalSwitch" 161 name="paypal_email_same" 162 class="monto-switch-input" 163 type="checkbox" 164 checked 165 /> 166 <span class="monto-switch"></span> 167 <span>Paypal email address is same as above</span> 168 </label> 169 </div> 170 171 <div class="form-item monto-paypal-email-address-holder"> 172 <label> 173 <span>Paypal Email Address (optional)</span> 174 <input name="paypal_email" type="email"> 175 </label> 176 <span id="montoEarnMoneyModalErrorPaypalEmail" class="error"></span> 177 </div> 178 179 <button type="button" class="btn-get-ref-link">Get Referral Link</button> 180 </form> 181 `;return c.innerHTML=y,c.addEventListener("click",R=>{R.stopPropagation(),R.preventDefault()}),r&&c.querySelector(".monto-earn-money-close-button").addEventListener("click",R=>{document.getElementById("montoEarnMoneyModal").classList.toggle("show")}),c.querySelector(".monto-switch-holder").addEventListener("click",R=>{const O=document.getElementById("montoEarnMoneyModalSwitch");O.checked=!O.checked,document.querySelector(".monto-paypal-email-address-holder").style.display=O.checked?"none":"block"}),r&&c.querySelector(".btn-get-ref-link").addEventListener("click",R=>{event.preventDefault(),Mr();const O=document.getElementById("montoEarnMoneyModal").querySelector("form"),Z=new FormData(O);Sr.createAffiliateLink(Z).then(async T=>{var X,Q,G;if(T.ok)return T.json();if(T.status===401){const F=await T.json();throw new Error(F.error)}else if(T.status===422){const F=await T.json();throw(X=F.errors)!=null&&X.name&&K("montoEarnMoneyModalErrorName",F.errors.name[0]),(Q=F.errors)!=null&&Q.email&&K("montoEarnMoneyModalErrorEmail",F.errors.email[0]),(G=F.errors)!=null&&G.paypal_email&&K("montoEarnMoneyModalErrorPaypalEmail",F.errors.paypal_email[0]),new Error("Incorrect data")}else throw new Error("Failed to create Monto Affiliate.")}).then(T=>{document.dispatchEvent(new CustomEvent("montoShareLink",{detail:T}))}).catch(T=>console.error("err",T))}),d&&document.querySelector("body").appendChild(c),c}function Mr(){document.getElementById("montoEarnMoneyModalErrorName").style.display="none",document.getElementById("montoEarnMoneyModalErrorEmail").style.display="none",document.getElementById("montoEarnMoneyModalErrorPaypalEmail").style.display="none"}function K(o,e){const r=document.getElementById(o);r.style.display="block",r.innerHTML=e}function Rr(o,e,r=!0,d=!0){var R,O;const t=o.share_and_earn,n=encodeURIComponent(e),i=` 182 --monto-earn-money-background: ${o.earn_money.background}; 183 --monto-earn-money-text: ${o.earn_money.text_color}; 184 --monto-earn-money-button-text: ${o.earn_money.button_text_color}; 185 --monto-earn-money-button-background: ${o.earn_money.button_background}; 186 `,c=((O=(R=window.MONTO)==null?void 0:R.store)==null?void 0:O.shop_type)==="DUDA"?"font-family: Arial;":"",y=document.createElement("style");y.innerHTML=` 187 #montoShareAndEarnModal { 188 ${i} 189 display: none; 190 position: absolute; 191 width: 350px; 192 background: var(--monto-earn-money-background); 193 padding: 1.5rem; 194 border-radius: 0.375rem; 195 box-shadow: 0px 0px 5px grey; 196 border-color: rgba(226, 232, 240, 1); 197 z-index: 100; 198 text-align: center; 199 color: var(--monto-earn-money-text); 200 font-size: 0.8rem; 201 ${c} 202 } 203 #montoShareAndEarnModal.show { 204 display: block; 205 } 206 #montoShareAndEarnModal .headline { 207 font-size: 1rem; 208 font-weight: bold; 209 } 210 #montoShareAndEarnModal .body-copy { 211 margin-top: 0.5rem; 212 } 213 #montoShareAndEarnModal .instructions { 214 margin-top: 1rem; 215 opacity: 0.6; 216 cursor: pointer; 217 } 218 #montoShareAndEarnModal .link-holder { 219 display: flex; 220 align-items: center; 221 justify-content: center; 222 margin-top: 0.3rem; 223 padding: 0.5rem; 224 border: 1px solid rgb(203, 213, 224); 225 border-radius: 0.375rem; 226 cursor: pointer; 227 } 228 #montoShareAndEarnModal .link-holder > svg { 229 color: var(--monto-earn-money-button-background); 230 margin-right: 1rem; 231 } 232 #montoShareAndEarnModal .share-buttons-holder { 233 display: flex; 234 margin-top: 2rem; 235 } 236 #montoShareAndEarnModal .share-buttons-holder a { 237 color: white; 238 padding: 0.6rem 1rem; 239 border-radius: 0.375rem; 240 text-align: center; 241 display: flex; 242 align-items: center; 243 text-decoration: none; 244 } 245 #montoShareAndEarnModal .share-buttons-holder a > svg { 246 margin-right: 0.6rem; 247 } 248 #montoShareAndEarnModal .btn-facebook { 249 background: #3b5998; 250 } 251 #montoShareAndEarnModal .btn-facebook:hover { 252 background: #4e71ba; 253 } 254 #montoShareAndEarnModal .btn-twitter { 255 background: #00acee; 256 margin-left: 0.4rem; 257 margin-right: 0.4rem; 258 } 259 #montoShareAndEarnModal .btn-twitter:hover { 260 background: #2bc4ff; 261 } 262 #montoShareAndEarnModal .btn-email { 263 background: #2c8474; 264 } 265 #montoShareAndEarnModal .btn-email:hover { 266 background: #37a591; 267 } 268 `,document.head.appendChild(y);const p=document.createElement("div");p.id="montoShareAndEarnModal";let _=` 269 <div style="position: absolute; padding: 10px; top: -5px; right: -5px; z-index: 10;"> 270 <button class="monto-share-and-earn-close-button" style="background: none; border: none; padding: 0; margin: 0; cursor: pointer; opacity: 0.4;"> 271 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" height="18px"> 272 <path fill-rule="evenodd" d="M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z" clip-rule="evenodd" /> 273 </svg> 274 </button> 275 </div> 276 <div class="headline">${t.headline}</div> 277 <div class="body-copy">${t.body_copy}</div> 278 <div class="instructions">${t.instructions}</div> 279 <div class="link-holder"> 280 <svg id="montoShareAndEarnModal_copied_icon" xmlns="http://www.w3.org/2000/svg" height="1.5em" viewBox="0 0 448 512" style="display: none;" fill="currentColor"><path d="M438.6 105.4c12.5 12.5 12.5 32.8 0 45.3l-256 256c-12.5 12.5-32.8 12.5-45.3 0l-128-128c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L160 338.7 393.4 105.4c12.5-12.5 32.8-12.5 45.3 0z"/></svg> 281 <div class="link">${e}</div> 282 </div> 283 <div class="share-buttons-holder"> 284 <a href="https://www.facebook.com/sharer/sharer.php?u=${n}" target="_blank" class="btn-facebook"> 285 <svg xmlns="http://www.w3.org/2000/svg" height="1.5rem" viewBox="0 0 320 512" fill="currentColor">
285<path d="M279.14 288l14.22-92.66h-88.91v-60.13c0-25.35 12.42-50.06 52.24-50.06h40.42V6.26S260.43 0 225.36 0c-73.22 0-121.08 44.38-121.08 124.72v70.62H22.89V288h81.39v224h100.17V288z"/></svg> 286 Share 287 </a> 288 <a href="https://twitter.com/intent/tweet?url=${n}" target="_blank" class="btn-twitter"> 289 <svg xmlns="http://www.w3.org/2000/svg" height="1.5rem" viewBox="0 0 512 512" fill="currentColor"><path d="M459.37 151.716c.325 4.548.325 9.097.325 13.645 0 138.72-105.583 298.558-298.558 298.558-59.452 0-114.68-17.219-161.137-47.106 8.447.974 16.568 1.299 25.34 1.299 49.055 0 94.213-16.568 130.274-44.832-46.132-.975-84.792-31.188-98.112-72.772 6.498.974 12.995 1.624 19.818 1.624 9.421 0 18.843-1.3 27.614-3.573-48.081-9.747-84.143-51.98-84.143-102.985v-1.299c13.969 7.797 30.214 12.67 47.431 13.319-28.264-18.843-46.781-51.005-46.781-87.391 0-19.492 5.197-37.36 14.294-52.954 51.655 63.675 129.3 105.258 216.365 109.807-1.624-7.797-2.599-15.918-2.599-24.04 0-57.828 46.782-104.934 104.934-104.934 30.213 0 57.502 12.67 76.67 33.137 23.715-4.548 46.456-13.32 66.599-25.34-7.798 24.366-24.366 44.833-46.132 57.827 21.117-2.273 41.584-8.122 60.426-16.243-14.292 20.791-32.161 39.308-52.628 54.253z"/></svg> 290 Tweet 291 </a> 292 <a href="mailto:?subject=I wanted you to see this site&body=${n}" target="_blank" class="btn-email"> 293 <svg xmlns="http://www.w3.org/2000/svg" height="1.5rem" viewBox="0 0 512 512" fill="currentColor"><path d="M48 64C21.5 64 0 85.5 0 112c0 15.1 7.1 29.3 19.2 38.4L236.8 313.6c11.4 8.5 27 8.5 38.4 0L492.8 150.4c12.1-9.1 19.2-23.3 19.2-38.4c0-26.5-21.5-48-48-48H48zM0 176V384c0 35.3 28.7 64 64 64H448c35.3 0 64-28.7 64-64V176L294.4 339.2c-22.8 17.1-54 17.1-76.8 0L0 176z"/></svg> 294 Email 295 </a> 296 </div> 297 `;return p.innerHTML=_,r&&p.querySelector(".monto-share-and-earn-close-button").addEventListener("click",Z=>{document.getElementById("montoShareAndEarnModal").classList.toggle("show")}),p.querySelector(".link-holder").addEventListener("click",ee),p.querySelector(".instructions").addEventListener("click",ee),d&&document.querySelector("body").appendChild(p),p}function ee(){window.navigator.clipboard.writeText(document.getElementById("montoShareAndEarnModal").querySelector(".link").textContent),document.getElementById("montoShareAndEarnModal_copied_icon").style.display="block",setTimeout(o=>document.getElementById("montoShareAndEarnModal_copied_icon").style.display="none",2e3)}const Ir={name:"AffCustomize",data(){return{form:{earn_money:{},share_and_earn:{}},errors:{},loading:!1,earnMoneyModal:null,customCssElem:null,defaultButtonColor:null,defaultButtonBgColor:null}},mounted(){this.loading=!0,axios.get("/shop/aff-settings").then(o=>{this.form=o.data.aff_referral_settings,this.defaultButtonColor=o.data.default_button_color,this.defaultButtonBgColor=o.data.default_button_bg_color,this.earnMoneyModal=Cr(this.form.earn_money,this.form.custom_css,!1,!1),this.$refs.earnMoneyHolder.appendChild(this.earnMoneyModal),this.earnMoneyModal.classList.toggle("show"),this.shareAndEarn=Rr(this.form,"https://shop.com?via=firstlast",!1,!1),this.$refs.shareAndEarnHolder.appendChild(this.shareAndEarn),this.shareAndEarn.classList.toggle("show")}).finally(o=>this.loading=!1)},watch:{"form.earn_money":{handler:function(o,e){this.earnMoneyModal.style.setProperty("--monto-earn-money-background",this.form.earn_money.background),this.earnMoneyModal.style.setProperty("--monto-earn-money-text",this.form.earn_money.text_color),this.earnMoneyModal.style.setProperty("--monto-earn-money-button-text",this.form.earn_money.button_text_color||this.defaultButtonColor),this.earnMoneyModal.style.setProperty("--monto-earn-money-button-background",this.form.earn_money.button_background||this.defaultButtonBgColor),this.shareAndEarn.style.setProperty("--monto-earn-money-background",this.form.earn_money.background),this.shareAndEarn.style.setProperty("--monto-earn-money-text",this.form.earn_money.text_color),this.shareAndEarn.style.setProperty("--monto-earn-money-button-text",this.form.earn_money.button_text_color),this.shareAndEarn.style.setProperty("--monto-earn-money-button-background",this.form.earn_money.button_background),this.earnMoneyModal.querySelector(".headline").innerHTML=this.form.earn_money.headline,this.earnMoneyModal.querySelector(".body-copy").innerHTML=this.form.earn_money.body_copy},deep:!0},"form.share_and_earn":{handler:function(o,e){this.shareAndEarn.querySelector(".headline").innerHTML=this.form.share_and_earn.headline,this.shareAndEarn.querySelector(".body-copy").innerHTML=this.form.share_and_earn.body_copy,this.shareAndEarn.querySelector(".instructions").innerHTML=this.form.share_and_earn.instructions},deep:!0},"form.custom_css"(){this.customCssElem||(this.customCssElem=document.getElementById("montoEarnMoneyModalCustomCss")||document.head.appendChild(document.createElement("style"))),this.customCssElem.innerHTML=this.form.custom_css}},methods:{save(){this.loading=!0,this.errors={},axios.put("/shop/aff-settings",this.form).catch(o=>this.errors=o.response.data.errors).finally(o=>this.loading=!1)}}},Pr={class:"mt-4 bg-white rounded-md shadow py-8 px-4 xl:px-8"},Er={class:"flex flex-1"},Ar={class:"w-1/2 pr-2"},Lr={class:"attribute-row"},jr={class:"text-gray-700 text-sm w-1/3"},Tr={key:0,class:"mt-3 block text-red-500"},Br={class:"attribute-row"},Ur={class:"text-gray-700 text-sm w-1/3"},Or={key:0,class:"mt-3 block text-red-500"},Fr={class:"attribute-row"},Vr={class:"flex"},Dr={class:"ml-3 rounded border border-gray-400"},qr={key:0,class:"mt-3 block text-red-500"},Nr={class:"attribute-row"},zr={class:"flex"},Hr={class:"ml-3 rounded border border-gray-400"},Kr={key:0,class:"mt-3 block text-red-500"},Wr={class:"attribute-row"},Yr={class:"flex"},Jr=["placeholder"],Zr={class:"ml-3 rounded border border-gray-400"},Xr={key:0,class:"mt-3 block text-red-500"},Qr={class:"attribute-row"},Gr={class:"flex"},$r=["placeholder"],ei={class:"ml-3 rounded border border-gray-400"},ti={key:0,class:"mt-3 block text-red-500"},oi={class:"w-1/2 mt-8",style:{"min-width":"350px"}},si={ref:"earnMoneyHolder",class:"relative flex justify-center"},ri={class:"flex flex-1 mt-16"},ii={class:"w-1/2 pr-2"},ni={class:"attribute-row"},li={class:"text-gray-700 text-sm w-1/3"},ai={key:0,class:"mt-3 block text-red-500"},di={class:"attribute-row"},ui={class:"text-gray-700 text-sm w-1/3"},ci={key:0,class:"mt-3 block text-red-500"},mi={class:"attribute-row"},pi={class:"text-gray-700 text-sm w-1/3"},bi={key:0,class:"mt-3 block text-red-500"},_i={class:"w-1/2 mt-8",style:{"min-width":"350px"}},hi={ref:"shareAndEarnHolder",class:"relative flex justify-center"},fi={class:"attribute-row w-1/2 pr-2"},wi={class:"attribute-row"},yi={key:0,class:"mt-3 block text-red-500"},gi=["disabled"];function vi(o,e,r,d,t,n){return l(),a("div",Pr,[e[25]||(e[25]=s("h2",{class:"text-xl font-medium mb-3"}," Affiliate Popup Signup Form ",-1)),e[26]||(e[26]=s("div",{class:"mb-3"},[f(" Add the custom attribute "),s("b",{id:"data-monto-referral-signup"},'data-monto-referral-signup="true"'),f(" to any button or text to display a popup that will allow customers to
297signup as affiliates. ")],-1)),s("div",Er,[s("div",Ar,[s("div",Lr,[s("label",jr,[e[15]||(e[15]=f(" Headline ",-1)),b(s("input",{"onUpdate:modelValue":e[0]||(e[0]=i=>t.form.earn_money.headline=i),class:"form-input form-input--sm"},null,512),[[h,t.form.earn_money.headline]])]),t.errors["earn_money.headline"]?(l(),a("small",Tr,u(t.errors["earn_money.headline"][0]),1)):m("",!0)]),s("div",Br,[s("label",Ur,[e[16]||(e[16]=f(" Body Copy ",-1)),b(s("input",{"onUpdate:modelValue":e[1]||(e[1]=i=>t.form.earn_money.body_copy=i),class:"form-input form-input--sm"},null,512),[[h,t.form.earn_money.body_copy]])]),t.errors["earn_money.body_copy"]?(l(),a("small",Or,u(t.errors["earn_money.body_copy"][0]),1)):m("",!0)]),s("div",Fr,[e[17]||(e[17]=s("label",{for:"earn_money_background",class:"text-gray-700 text-sm w-1/3"}," Background ",-1)),s("div",Vr,[b(s("input",{name:"earn_money_background",type:"text","onUpdate:modelValue":e[2]||(e[2]=i=>t.form.earn_money.background=i),class:"form-input form-input--sm"},null,512),[[h,t.form.earn_money.background]]),s("label",Dr,[s("div",{class:"rounded w-8 h-full",style:w({background:t.form.earn_money.background})},null,4),b(s("input",{type:"color","onUpdate:modelValue":e[3]||(e[3]=i=>t.form.earn_money.background=i),class:"colorInput"},null,512),[[h,t.form.earn_money.background]])])]),t.errors["earn_money.background"]?(l(),a("small",qr,u(t.errors["earn_money.background"][0]),1)):m("",!0)]),s("div",Nr,[e[18]||(e[18]=s("label",{for:"earn_money_text_color",class:"text-gray-700 text-sm w-1/3"}," Text Color ",-1)),s("div",zr,[b(s("input",{name:"earn_money_text_color",type:"text","onUpdate:modelValue":e[4]||(e[4]=i=>t.form.earn_money.text_color=i),class:"form-input form-input--sm"},null,512),[[h,t.form.earn_money.text_color]]),s("label",Hr,[s("div",{class:"rounded w-8 h-full",style:w({background:t.form.earn_money.text_color})},null,4),b(s("input",{type:"color","onUpdate:modelValue":e[5]||(e[5]=i=>t.form.earn_money.text_color=i),class:"colorInput"},null,512),[[h,t.form.earn_money.text_color]])])]),t.errors["earn_money.text_color"]?(l(),a("small",Kr,u(t.errors["earn_money.text_color"][0]),1)):m("",!0)]),s("div",Wr,[e[19]||(e[19]=s("label",{for:"earn_money_button_text_color",class:"text-gray-700 text-sm w-1/3"}," Button Text ",-1)),s("div",Yr,[b(s("input",{name:"earn_money_button_text_color",type:"text","onUpdate:modelValue":e[6]||(e[6]=i=>t.form.earn_money.button_text_color=i),placeholder:t.defaultButtonColor,class:"form-input form-input--sm"},null,8,Jr),[[h,t.form.earn_money.button_text_color]]),s("label",Zr,[s("div",{class:"rounded w-8 h-full",style:w({background:t.form.earn_money.button_text_color})},null,4),b(s("input",{type:"color","onUpdate:modelValue":e[7]||(e[7]=i=>t.form.earn_money.button_text_color=i),class:"colorInput"},null,512),[[h,t.form.earn_money.button_text_color]])])]),t.errors["earn_money.button_text_color"]?(l(),a("small",Xr,u(t.errors["earn_money.button_text_color"][0]),1)):m("",!0)]),s("div",Qr,[e[20]||(e[20]=s("label",{for:"earn_money_button_background",class:"text-gray-700 text-sm w-1/3"}," Button Background ",-1)),s("div",Gr,[b(s("input",{name:"earn_money_button_background",type:"text","onUpdate:modelValue":e[8]||(e[8]=i=>t.form.earn_money.button_background=i),placeholder:t.defaultButtonBgColor,class:"form-input form-input--sm"},null,8,$r),[[h,t.form.earn_money.button_background]]),s("label",ei,[s("div",{class:"rounded w-8 h-full",style:w({background:t.form.earn_money.button_background})},null,4),b(s("input",{type:"color","onUpdate:modelValue":e[9]||(e[9]=i=>t.form.earn_money.button_background=i),class:"colorInput"},null,512),[[h,t.form.earn_money.button_background]])])]),t.errors["earn_money.button_background"]?(l(),a("small",ti,u(t.errors["earn_money.button_background"][0]),1)):m("",!0)])]),s("div",oi,[s("div",si,null,512)])]),s("div",ri,[s("div",ii,[s("div",ni,[s("label",li,[e[21]||(e[21]=f(" Headline ",-1)),b(s("input",{"onUpdate:modelValue":e[10]||(e[10]=i=>t.form.share_and_earn.headline=i),class:"form-input form-input--sm"},null,512),[[h,t.form.share_and_earn.headline]])]),t.errors["share_and_earn.headline"]?(l(),a("small",ai,u(t.errors["share_and_earn.headline"][0]),1)):m("",!0)]),s("div",di,[s("label",ui,[e[22]||(e[22]=f(" Body Copy ",-1)),b(s("input",{"onUpdate:modelValue":e[11]||(e[11]=i=>t.form.share_and_earn.body_copy=i),class:"form-input form-input--sm"},null,512),[[h,t.form.share_and_earn.body_copy]])]),t.errors["share_and_earn.body_copy"]?(l(),a("small",ci,u(t.errors["share_and_earn.body_copy"][0]),1)):m("",!0)]),s("div",mi,[s("label",pi,[e[23]||(e[23]=f(" Instructions Text ",-1)),b(s("input",{"onUpdate:modelValue":e[12]||(e[12]=i=>t.form.share_and_earn.instructions=i),class:"form-input form-input--sm"},null,512),[[h,t.form.share_and_earn.instructions]])]),t.errors["share_and_earn.instructions"]?(l(),a("small",bi,u(t.errors["share_and_earn.instructions"][0]),1)):m("",!0)])]),s("div",_i,[s("div",hi,null,512)])]),s("div",fi,[s("div",wi,[e[24]||(e[24]=s("label",{for:"customCssInput",class:"text-gray-700 w-full text-sm"},"Custom CSS",-1)),b(s("textarea",{name:"customCss","onUpdate:modelValue":e[13]||(e[13]=i=>t.form.custom_css=i),id:"customCssInput",cols:"30",rows:"10",class:"font-mono text-sm form-input"}," ",512),[[h,t.form.custom_css]]),t.errors.custom_css?(l(),a("small",yi,u(t.errors.custom_css[0]),1)):m("",!0)]),s("button",{onClick:e[14]||(e[14]=(...i)=>n.save&&n.save(...i)),class:"btn btn--primary w-full text-center mt-3",disabled:t.loading},"Save",8,gi)])])}const xi=v(Ir,[["render",vi]]),ki=Object.freeze(Object.defineProperty({__proto__:null,default:xi},Symbol.toStringTag,{value:"Module"})),Si={name:"StarScore",props:["hideAvg","scoreAvg","starColor"],computed:{scoreRounded(){return Math.round(this.scoreAvg)}}},Ci={class:"mb-0"},Mi={xmlns:"http://www.w3.org/2000/svg",style:{display:"none"}},Ri={key:0,class:"score-text"};function Ii(o,e,r,d,t,n){return l(),a("ul",Ci,[(l(),a("svg",Mi,[...e[0]||(e[0]=[s("symbol",{id:"iconStar",viewbox:"0 0 17 16"},[s("g",{stroke:"none","stroke-width":"1","fill-rule":"evenodd"},[s("polygon",{points:`13.6252632 16 12.2484211 10.0808421 298 16.8421053 6.10021053 10.7865263 5.58063158 299 8.42105263 0 6.05557895 5.58063158 0 6.10021053 300 4.59368421 10.0808421 3.21684211 16 8.42105263 301 12.8606316`})])],-1)])])),s("li",{class:I({"one-star":n.scoreRounded>=1&&n.scoreRounded<2,"two-stars":n.scoreRounded>=2&&n.scoreRounded<3,"three-stars":n.scoreRounded>=3&&n.scoreRounded<4,"four-stars":n.scoreRounded>
301=4&&n.scoreRounded<5,"five-stars":n.scoreRounded>=5})},[r.hideAvg?m("",!0):(l(),a("span",Ri,u(r.scoreAvg.toFixed(1)),1)),(l(),a("svg",{class:"star-icon",style:w({"--fill-color":r.starColor})},[...e[1]||(e[1]=[s("use",{"xlink:href":"#iconStar"},null,-1)])],4)),(l(),a("svg",{class:"star-icon",style:w({"--fill-color":r.starColor})},[...e[2]||(e[2]=[s("use",{"xlink:href":"#iconStar"},null,-1)])],4)),(l(),a("svg",{class:"star-icon",style:w({"--fill-color":r.starColor})},[...e[3]||(e[3]=[s("use",{"xlink:href":"#iconStar"},null,-1)])],4)),(l(),a("svg",{class:"star-icon",style:w({"--fill-color":r.starColor})},[...e[4]||(e[4]=[s("use",{"xlink:href":"#iconStar"},null,-1)])],4)),(l(),a("svg",{class:"star-icon",style:w({"--fill-color":r.starColor})},[...e[5]||(e[5]=[s("use",{"xlink:href":"#iconStar"},null,-1)])],4))],2)])}const Y=v(Si,[["render",Ii],["__scopeId","data-v-434a1d4d"]]),Pi=Object.freeze(Object.defineProperty({__proto__:null,default:Y},Symbol.toStringTag,{value:"Module"})),Ei={name:"ReviewListItem",props:{shopName:String,review:Object,starColor:String,showProfilePictures:Boolean,showTitles:Boolean,showReviewDate:Boolean},components:{CustomerProfilePicture:ie,StarRating:ae}},Ai={class:"list-none"},Li={class:"flex justify-between"},ji={class:"flex items-center"},Ti={class:"flex flex-col"},Bi={class:"flex items-center"},Ui={class:"ml-4 font-bold"},Oi={class:"flex items-center font-semibold mt-2"},Fi={key:0,class:"font-bold"},Vi={key:1,class:"ml-2 flex","aria-label":"Verified Order","data-balloon-pos":"up"},Di={class:"mt-3 leading-normal whitespace-pre-wrap"},qi={key:0,class:"mt-4 ml-2 pl-4 border-l text-sm text-gray-700"},Ni={class:"text-sm font-bold"},zi={class:"whitespace-pre-wrap"};function Hi(o,e,r,d,t,n){const i=g("customer-profile-picture"),c=g("star-rating");return l(),a("li",Ai,[s("header",Li,[s("span",ji,[b(s("span",null,[B(i,{url:r.review.customer_profile_picture_url},null,8,["url"])],512),[[he,r.showProfilePictures]]),s("span",Ti,[s("span",Bi,[B(c,{score:r.review.score,color:r.starColor},null,8,["score","color"]),s("span",Ui,u(r.review.customer_name),1)]),s("span",Oi,[r.showTitles&&r.review.title?(l(),a("span",Fi,u(r.review.title),1)):m("",!0),r.review.is_verified?(l(),a("span",Vi,[...e[0]||(e[0]=[s("svg",{width:"14px",height:"14px",version:"1.1",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},null,-1)])])):m("",!0)])])]),s("div",{class:I(["text-gray-600 text-sm",{hidden:!r.showReviewDate}])},u(r.review.created_at_tri_formatted),3)]),s("div",Di,u(r.review.message),1),r.review.reply?(l(),a("div",qi,[s("h4",Ni,u(r.shopName)+" replied:",1),s("div",zi,u(r.review.reply.message),1)])):m("",!0)])}const J=v(Ei,[["render",Hi]]),Ki=Object.freeze(Object.defineProperty({__proto__:null,default:J},Symbol.toStringTag,{value:"Module"})),Wi={name:"RatingDistribution",props:{reviewable:Object,primaryColor:String}},Yi={class:"leading-none"},Ji={class:"distribution-list flex items-center"},Zi=["value","max"],Xi={class:"distribution-list flex items-center"},Qi=["value","max"],Gi={class:"distribution-list flex items-center"},$i=["value","max"],en={class:"distribution-list flex items-center"},tn=["value","max"],on={class:"distribution-list flex items-center"},sn=["value","max"];function rn(o,e,r,d,t,n){return l(),a("ul",Yi,[s("li",Ji,[e[0]||(e[0]=f(" 5 Stars ",-1)),s("progress",{value:r.reviewable.score_distribution.five,max:r.reviewable.score_distribution.total_rating_count,class:"ml-4",style:w({"--bar-fill-color":r.primaryColor})},null,12,Zi)]),s("li",Xi,[e[1]||(e[1]=f(" 4 Stars ",-1)),s("progress",{value:r.reviewable.score_distribution.four,max:r.reviewable.score_distribution.total_rating_count,class:"ml-4",style:w({"--bar-fill-color":r.primaryColor})},null,12,Qi)]),s("li",Gi,[e[2]||(e[2]=f(" 3 Stars ",-1)),s("progress",{value:r.reviewable.score_distribution.three,max:r.reviewable.score_distribution.total_rating_count,class:"ml-4",style:w({"--bar-fill-color":r.primaryColor})},null,12,$i)]),s("li",en,[e[3]||(e[3]=f(" 2 Stars ",-1)),s("progress",{value:r.reviewable.score_distribution.two,max:r.reviewable.score_distribution.total_rating_count,class:"ml-4",style:w({"--bar-fill-color":r.primaryColor})},null,12,tn)]),s("li",on,[e[4]||(e[4]=f(" 1 Stars ",-1)),s("progress",{value:r.reviewable.score_distribution.one,max:r.reviewable.score_distribution.total_rating_count,class:"ml-4",style:w({"--bar-fill-color":r.primaryColor})},null,12,sn)])])}const ue=v(Wi,[["render",rn],["__scopeId","data-v-97284dc4"]]),nn=Object.freeze(Object.defineProperty({__proto__:null,default:ue},Symbol.toStringTag,{value:"Module"})),ln={name:"RatingInput",props:{rating:Number,showLabel:Boolean},computed:{ratingDescription(){switch(this.rating){case 1:return"Very Dissatisfied";case 2:return"Dissatisfied";case 3:return"Neutral";case 4:return"Good";case 5:return"Excellent"}}}},an={class:"flex items-center relative"},dn={class:"rating-input star-rating-input--readonly"},un=["checked"],cn=["checked"],mn=["checked"],pn=["checked"],bn=["checked"],_n={key:0,class:"ml-4 font-medium"};function hn(o,e,r,d,t,n){return l(),a("div",an,[s("fieldset",dn,[s("input",{type:"radio",value:"5",name:"rating",onInput:e[0]||(e[0]=i=>o.$emit("input",5)),id:"star5",checked:r.rating===5,required:""},null,40,un),e[5]||(e[5]=s("label",{for:"star5",title:"Excellent"}
301,null,-1)),s("input",{type:"radio",value:"4",name:"rating",onInput:e[1]||(e[1]=i=>o.$emit("input",4)),id:"star4",checked:r.rating===4,required:""},null,40,cn),e[6]||(e[6]=s("label",{for:"star4",title:"Good"},null,-1)),s("input",{type:"radio",value:"3",name:"rating",onInput:e[2]||(e[2]=i=>o.$emit("input",3)),id:"star3",checked:r.rating===3,required:""},null,40,mn),e[7]||(e[7]=s("label",{for:"star3",title:"Neutral"},null,-1)),s("input",{type:"radio",value:"2",name:"rating",onInput:e[3]||(e[3]=i=>o.$emit("input",2)),id:"star2",checked:r.rating===2,required:""},null,40,pn),e[8]||(e[8]=s("label",{for:"star2",title:"Dissatisfied"},null,-1)),s("input",{type:"radio",value:"1",name:"rating",onInput:e[4]||(e[4]=i=>o.$emit("input",1)),id:"star1",checked:r.rating===1,required:""},null,40,bn),e[9]||(e[9]=s("label",{for:"star1",title:"Very Dissatisfied"},null,-1))]),r.showLabel?(l(),a("span",_n,u(n.ratingDescription),1)):m("",!0)])}const ce=v(ln,[["render",hn],["__scopeId","data-v-690974e4"]]),fn=Object.freeze(Object.defineProperty({__proto__:null,default:ce},Symbol.toStringTag,{value:"Module"})),wn={name:"MediaStep",props:{shop:Object},data(){return{files:[],isDragging:!1}},methods:{appUrlize(o){return o?(o=o.toString(),o.includes("https")?o:"http://www.monto.test"+o):""},async handleDrop(o){try{const e=new FormData;o.dataTransfer.files.forEach(d=>{e.append("media[]",d)});const r=await U.post(`/shops/${this.shop.hash_id}/reviews/media`,e);this.files=[...this.files,...r.data],this.$emit("update:media",this.files)}catch(e){console.error(e)}},removeFile(o){this.files.splice(o,1),this.$emit("update:media",this.files)}}},yn={class:"flex justify-between items-center"},gn={class:"-mx-2 inline-flex"},vn={class:"rounded w-12 h-12 relative mx-2"},xn=["onClick"],kn=["src"];function Sn(o,e,r,d,t,n){return l(),a("div",null,[s("div",{class:"flex flex-col justify-center items-center p-16",onDrop:e[0]||(e[0]=M((...i)=>n.handleDrop&&n.handleDrop(...i),["prevent"])),onDragover:[e[1]||(e[1]=i=>t.isDragging=!0),e[4]||(e[4]=M(()=>{},["prevent"]))],onDragenter:e[2]||(e[2]=i=>t.isDragging=!0),onDragleave:e[3]||(e[3]=i=>t.isDragging=!1)},[s("div",{class:I(["rounded-full bg-blue-500 text-white h-24 w-24 inline-flex items-center justify-center mb-8",[t.isDragging?"opacity-100":"opacity-50"]])},[...e[8]||(e[8]=[s("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"h-12 w-12"},[s("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),s("polyline",{points:"17 8 12 3 7 8"}),s("line",{x1:"12",y1:"3",x2:"12",y2:"15"})],-1)])],2),e[9]||(e[9]=s("p",{class:"font-bold text-lg"},"An image is worth a thousand words.",-1)),e[10]||(e[10]=s("p",{class:"text-gray-800"},[f("Drop up to five images here, or "),s("button",{type:"button",class:"text-blue-500"},"click to browse"),f(" . ")],-1))],32),s("div",yn,[s("div",null,[s("ul",gn,[(l(!0),a(P,null,A(t.files,(i,c)=>(l(),a("li",vn,[s("button",{type:"button",onClick:y=>n.removeFile(c),class:"absolute transition-opacity opacity-0 hover:opacity-100 w-full h-full flex items-center justify-center",style:{background:"rgba(255, 255, 255, .75)"}},[...e[11]||(e[11]=[s("span",{class:"rounded-full"},[s("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:""},[s("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),s("line",{x1:"6",y1:"6",x2:"18",y2:"18"})])],-1)])],8,xn),s("img",{src:n.appUrlize(i.thumbnail),class:"object-cover rounded h-full w-full"},null,8,kn)]))),256))]),s("button",{type:"button",class:"btn bg-gray-500 hover:bg-gray-600",onClick:e[5]||(e[5]=i=>o.$emit("back"))}," Back ")]),t.files.length===0?(l(),a("button",{key:0,type:"button",class:"btn bg-gray-500 hover:bg-gray-600",onClick:e[6]||(e[6]=i=>o.$emit("continue"))}," Skip ")):(l(),a("button",{key:1,type:"button",class:"btn btn-primary",onClick:e[7]||(e[7]=i=>o.$emit("continue"))},"Continue"))])])}const me=v(wn,[["render",Sn]]),Cn=Object.freeze(Object.defineProperty({__proto__:null,default:me},Symbol.toStringTag,{value:"Module"}));var Mn=function(o){var e=Rn(Pn(En(In(o),8*o.length)));return e.toLowerCase()};function Rn(o){for(var e,r="0123456789ABCDEF",d="",t=0;t<o.length;
301t++)e=o.charCodeAt(t),d+=r.charAt(e>>>4&15)+r.charAt(15&e);return d}function In(o){for(var e=Array(o.length>>2),r=0;r<e.length;r++)e[r]=0;for(r=0;r<8*o.length;r+=8)e[r>>5]|=(255&o.charCodeAt(r/8))<<r%32;return e}function Pn(o){for(var e="",r=0;r<32*o.length;r+=8)e+=String.fromCharCode(o[r>>5]>>>r%32&255);return e}function En(o,e){o[e>>5]|=128<<e%32,o[14+(e+64>>>9<<4)]=e;for(var r=1732584193,d=-271733879,t=-1732584194,n=271733878,i=0;i<o.length;i+=16){var c=r,y=d,p=t,_=n;d=C(d=C(d=C(d=C(d=S(d=S(d=S(d=S(d=k(d=k(d=k(d=k(d=x(d=x(d=x(d=x(d,t=x(t,n=x(n,r=x(r,d,t,n,o[i+0],7,-680876936),d,t,o[i+1],12,-389564586),r,d,o[i+2],17,606105819),n,r,o[i+3],22,-1044525330),t=x(t,n=x(n,r=x(r,d,t,n,o[i+4],7,-176418897),d,t,o[i+5],12,1200080426),r,d,o[i+6],17,-1473231341),n,r,o[i+7],22,-45705983),t=x(t,n=x(n,r=x(r,d,t,n,o[i+8],7,1770035416),d,t,o[i+9],12,-1958414417),r,d,o[i+10],17,-42063),n,r,o[i+11],22,-1990404162),t=x(t,n=x(n,r=x(r,d,t,n,o[i+12],7,1804603682),d,t,o[i+13],12,-40341101),r,d,o[i+14],17,-1502002290),n,r,o[i+15],22,1236535329),t=k(t,n=k(n,r=k(r,d,t,n,o[i+1],5,-165796510),d,t,o[i+6],9,-1069501632),r,d,o[i+11],14,643717713),n,r,o[i+0],20,-373897302),t=k(t,n=k(n,r=k(r,d,t,n,o[i+5],5,-701558691),d,t,o[i+10],9,38016083),r,d,o[i+15],14,-660478335),n,r,o[i+4],20,-405537848),t=k(t,n=k(n,r=k(r,d,t,n,o[i+9],5,568446438),d,t,o[i+14],9,-1019803690),r,d,o[i+3],14,-187363961),n,r,o[i+8],20,1163531501),t=k(t,n=k(n,r=k(r,d,t,n,o[i+13],5,-1444681467),d,t,o[i+2],9,-51403784),r,d,o[i+7],14,1735328473),n,r,o[i+12],20,-1926607734),t=S(t,n=S(n,r=S(r,d,t,n,o[i+5],4,-378558),d,t,o[i+8],11,-2022574463),r,d,o[i+11],16,1839030562),n,r,o[i+14],23,-35309556),t=S(t,n=S(n,r=S(r,d,t,n,o[i+1],4,-1530992060),d,t,o[i+4],11,1272893353),r,d,o[i+7],16,-155497632),n,r,o[i+10],23,-1094730640),t=S(t,n=S(n,r=S(r,d,t,n,o[i+13],4,681279174),d,t,o[i+0],11,-358537222),r,d,o[i+3],16,-722521979),n,r,o[i+6],23,76029189),t=S(t,n=S(n,r=S(r,d,t,n,o[i+9],4,-640364487),d,t,o[i+12],11,-421815835),r,d,o[i+15],16,530742520),n,r,o[i+2],23,-995338651),t=C(t,n=C(n,r=C(r,d,t,n,o[i+0],6,-198630844),d,t,o[i+7],10,1126891415),r,d,o[i+14],15,-1416354905),n,r,o[i+5],21,-57434055),t=C(t,n=C(n,r=C(r,d,t,n,o[i+12],6,1700485571),d,t,o[i+3],10,-1894986606),r,d,o[i+10],15,-1051523),n,r,o[i+1],21,-2054922799),t=C(t,n=C(n,r=C(r,d,t,n,o[i+8],6,1873313359),d,t,o[i+15],10,-30611744),r,d,o[i+6],15,-1560198380),n,r,o[i+13],21,1309151649),t=C(t,n=C(n,r=C(r,d,t,n,o[i+4],6,-145523070),d,t,o[i+11],10,-1120210379),r,d,o[i+2],15,718787259),n,r,o[i+9],21,-343485551),r=V(r,c),d=V(d,y),t=V(t,p),n=V(n,_)}return Array(r,d,t,n)}function H(o,e,r,d,t,n){return V(An(V(V(e,o),V(d,n)),t),r)}function x(o,e,r,d,t,n,i){return H(e&r|~e&d,o,e,t,n,i)}function k(o,e,r,d,t,n,i){return H(e&d|r&~d,o,e,t,n,i)}function S(o,e,r,d,t,n,i){return H(e^r^d,o,e,t,n,i)}function C(o,e,r,d,t,n,i){return H(r^(e|~d),o,e,t,n,i)}function V(o,e){var r=(65535&o)+(65535&e);return(o>>16)+(e>>16)+(r>>16)<<16|65535&r}function An(o,e){return o<<e|o>>>32-e}const Ln={name:"CreateReviewModal",components:{RatingInput:ce,ReviewListItem:J,MediaStep:me},props:{shop:Object,reviewable:Object},data(){const o=new URLSearchParams(window.location.search);return{currentStep:"review",form:{title:null,message:"",score:o.has("stars")?parseInt(o.get("stars")):0,customer_name:o.get("name")||"",customer_email:o.get("email")||null,order_id:o.get("o_id")||null,marketing_opt_in:!1,media:[]},errors:{}}},methods:{openShareWindow(o,e){window.open(o,e,"height=640,width=480").focus()},async createReview(){try{const o=await U.post(`/shops/${this.shop.hash_id}/reviewables/${this.reviewable.ext_id}/reviews`,this.form);this.currentStep="post-hook"}catch{}},handleMediaUpdated(o){this.form.media=o}},computed:{customerProfilePictureUrl(){return`https://www.gravatar.com/avatar/${Mn(this.form.customer_email||"")}?d=blank`},previewReview(){return{message:this.form.message,score:this.form.score,customer_profile_picture_url:this.customerProfilePictureUrl,customer_name:this.form.customer_name}},shareLinkTwitter(){const o={original_referer:"https://www.monto.io",ref_src:"https://www.monto.io",text:this.message};return"https://twitter.com/intent/tweet?"+Object.keys(o).map(e=>encodeURIComponent(e)+"="+encodeURIComponent(o[e])).join("&")}}},jn={class:"inset-0 fixed flex items-center justify-center",style:{background:"rgba(0, 0, 0, .5)","z-index":"99999"}},Tn={class:"bg-white max-w-screen-md w-full rounded p-8 shadow animated slideInUp max-h-full overflow-y-scroll"},Bn={class:"flex justify-end"},Un={key:0},On={class:"mb-8 flex items-center"},Fn=["src","alt"],Vn={key:1,class:"h-24 w-24 mr-4 bg-gray-300"},Dn={class:"inline-block font-medium text-lg"},qn={class:"mb-8"},Nn={class:"flex items-center"},zn={key:0,class:"mt-3 block text-red-500"}
301,Hn={key:0,class:"mb-8"},Kn={key:0,class:"mt-3 block text-red-500"},Wn={class:"mb-8"},Yn={key:0,class:"mt-3 block text-red-500"},Jn={key:1},Zn={class:"mb-8"},Xn={key:0,class:"mt-3 block text-red-500"},Qn={class:"mb-8"},Gn=["required"],$n={key:0,class:"mt-3 block text-red-500"},el={key:0,class:"mb-8"},tl={class:"flex"},ol={for:"marketingOptIn",class:"ml-2 form-label"},sl={key:0,class:"mt-3 block text-red-500"},rl={class:"flex"},il={key:3},nl={class:"border p-6 mb-8"},ll={class:"flex mb-2"},al={key:4},dl={class:"leading-normal mb-8 text-gray-700"},ul={key:0},cl={class:"font-semibold"},ml={class:"font-semibold"},pl={key:1},bl={class:"font-semibold"},_l={key:0},hl={class:"flex justify-center"},fl=["href"];function wl(o,e,r,d,t,n){const i=g("rating-input"),c=g("media-step"),y=g("review-list-item");return l(),a("div",jn,[s("div",Tn,[s("div",Bn,[s("button",{type:"button",onClick:e[0]||(e[0]=p=>o.$emit("close")),class:"text-gray-500 hover:text-gray-900"},[...e[16]||(e[16]=[s("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24",viewBox:"0 0 24 24",width:"24"},[s("path",{fill:"currentColor",d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})],-1)])])]),s("form",{method:"post",ref:"pForm",onSubmit:e[15]||(e[15]=M((...p)=>n.createReview&&n.createReview(...p),["prevent"]))},[t.currentStep==="review"?(l(),a("div",Un,[e[20]||(e[20]=s("h2",{class:"h6 form-label block mb-2 font-normal"},"You are reviewing",-1)),s("div",On,[r.reviewable.image_urls&&r.reviewable.image_urls.original?(l(),a("img",{key:0,src:r.reviewable.image_urls.original,alt:`Product Image of ${r.reviewable.name}`,class:"mr-4 h-24"},null,8,Fn)):(l(),a("span",Vn)),s("div",Dn,[s("span",null,u(r.reviewable.name),1)])]),s("div",qn,[e[17]||(e[17]=s("label",{class:"form-label block mb-2"},"Rating",-1)),s("div",Nn,[B(i,{rating:t.form.score,"show-label":!0,onInput:e[1]||(e[1]=p=>t.form.score=p)},null,8,["rating"])]),t.errors.score?(l(),a("small",zn,u(t.errors.score),1)):m("",!0)]),r.shop.review_titles_enabled?(l(),a("div",Hn,[e[18]||(e[18]=s("label",{for:"titleInput",class:"form-label"},"Title",-1)),b(s("input",{type:"text","onUpdate:modelValue":e[2]||(e[2]=p=>t.form.title=p),class:"form-input",id:"titleInput"},null,512),[[h,t.form.title,void 0,{lazy:!0,trim:!0}]]),t.errors.title?(l(),a("small",Kn,u(t.errors.title),1)):m("",!0)])):m("",!0),s("div",Wn,[e[19]||(e[19]=s("label",{for:"messageInput",class:"form-label block"},"Your Review",-1)),b(s("textarea",{cols:"30",rows:"10",placeholder:"What do you like/dislike about the product?","onUpdate:modelValue":e[3]||(e[3]=p=>t.form.message=p),class:"form-input h-full",id:"messageInput",required:""},null,512),[[h,t.form.message,void 0,{lazy:!0,trim:!0}]]),t.errors.message?(l(),a("small",Yn,u(t.errors.message),1)):m("",!0)]),s("button",{class:"btn w-full transition-color duration-100",style:w({background:r.shop.widget_settings.primary_color}),type:"button",onClick:e[4]||(e[4]=p=>o.$refs.pForm.reportValidity()&&(t.currentStep="confirmation"))}," Continue ",4)])):m("",!0),t.currentStep==="confirmation"?(l(),a("div",Jn,[s("div",Zn,[e[21]||(e[21]=s("label",{for:"customerNameInput",class:"form-label"},"Your Name",-1)),b(s("input",{type:"text","onUpdate:modelValue":e[5]||(e[5]=p=>t.form.customer_name=p),class:"form-input",id:"customerNameInput",required:""},null,512),[[h,t.form.customer_name,void 0,{lazy:!0,trim:!0}]]),t.errors.customer_name?(l(),a("small",Xn,u(t.errors.customer_name),1)):m("",!0)]),s("div",Qn,[e[22]||(e[22]=s("label",{for:"emailAddressInput",class:"form-label"},"Email Address",-1)),b(s("input",{type:"email","onUpdate:modelValue":e[6]||(e[6]=p=>t.form.customer_email=p),class:"form-input",id:"emailAddressInput",required:r.shop.widget_customer_email_required},null,8,Gn),[[h,t.form.customer_email,void 0,{lazy:!0,trim:!0}]]),t.errors.customer_email?(l(),a("small",$n,u(t.errors.customer_email),1)):m("",!0)]),r.shop.request_marketing_opt_in?(l(),a("div",el,[s("div",tl,[b(s("input",{type:"checkbox","onUpdate:modelValue":e[7]||(e[7]=p=>t.form.marketing_opt_in=p),id:"marketingOptIn"},null,512),[[D,t.form.marketing_opt_in]]),s("label",ol,"I agree to re
301ceive a reply to my review, and other marketing communications of "+u(r.shop.name)+".",1)]),t.errors.marketing_opt_in?(l(),a("small",sl,u(t.errors.marketing_opt_in),1)):m("",!0)])):m("",!0),s("div",rl,[s("button",{type:"button",onClick:e[8]||(e[8]=p=>t.currentStep="review"),class:"mr-4 flex-initial btn bg-gray-500 hover:bg-gray-600"}," Back "),s("button",{type:"button",onClick:e[9]||(e[9]=p=>o.$refs.pForm.reportValidity()&&(t.currentStep="media")),style:w({background:r.shop.widget_settings.primary_color}),class:"flex-grow btn btn-primary"}," Continue ",4)])])):m("",!0),t.currentStep==="media"?(l(),j(c,{key:2,shop:r.shop,onBack:e[10]||(e[10]=p=>t.currentStep="confirmation"),onContinue:e[11]||(e[11]=p=>t.currentStep="preview"),"onUpdate:media":n.handleMediaUpdated},null,8,["shop","onUpdate:media"])):m("",!0),t.currentStep==="preview"?(l(),a("div",il,[e[23]||(e[23]=s("p",{class:"font-bold text-xl mb-2"},"You are almost done.",-1)),e[24]||(e[24]=s("p",{class:"mb-8"},"Here is a preview of your review. Hit the submit button if you are happy with it.",-1)),s("div",nl,[B(y,{review:n.previewReview,"star-color":r.shop.widget_settings.star_color,class:""},null,8,["review","star-color"])]),s("div",ll,[s("button",{type:"button",onClick:e[12]||(e[12]=M(p=>t.currentStep="media",["prevent"])),class:"mr-4 flex-initial btn bg-gray-500 hover:bg-gray-600"}," Back "),s("button",{type:"button",onClick:e[13]||(e[13]=M((...p)=>n.createReview&&n.createReview(...p),["prevent"])),style:w({background:r.shop.widget_settings.primary_color}),class:"flex-grow btn btn-primary"}," Submit Review ",4)]),e[25]||(e[25]=s("p",{class:"text-center text-gray-600 mb-1 text-sm",style:{"margin-top":"1rem"}},[f(" By submitting the review you agree to our "),s("a",{href:"https://www.monto.io/terms",class:"text-blue-500 no-underline"},"Terms and Conditions"),f(", and "),s("a",{href:"https://www.monto.io/privacy",class:"text-blue-500 no-underline"},"Privacy Policy"),f(". ")],-1))])):m("",!0),t.currentStep==="post-hook"?(l(),a("div",al,[e[32]||(e[32]=s("h2",{class:"text-3xl text-center mb-4 text-green"},"Done!",-1)),s("p",dl,[r.shop.auto_publish_reviews?(l(),a("span",ul,[e[26]||(e[26]=f(" Your review for ",-1)),s("span",cl,u(r.reviewable.name),1),e[27]||(e[27]=f(" was successfully submitted and will be a great help to everyone visiting ",-1)),s("span",ml,u(r.shop.name),1),e[28]||(e[28]=f(". ",-1))])):(l(),a("span",pl,[e[29]||(e[29]=f(" Thank you for submitting a review on ",-1)),s("span",bl,u(r.reviewable.name),1),e[30]||(e[30]=f(". Your review will be published after it has been verified by a moderator. ",-1))]))]),r.shop.widget_social_sharing_followup_enabled?(l(),a("div",_l,[e[31]||(e[31]=s("p",{class:"leading-normal text-gray-700 text-center mb-8 font-semibold"}," Share your review with your family and friends. ",-1)),s("div",hl,[s("a",{href:n.shareLinkTwitter,onClick:e[14]||(e[14]=M(p=>n.openShareWindow(n.shareLinkTwitter,"Share on Twitter"),["prevent"])),class:"w-1/2 btn btn-lg bg-twitter text-center"},"Share on Twitter",8,fl)])])):m("",!0)])):m("",!0)],544)])])}const pe=v(Ln,[["render",wl]]),yl=Object.freeze(Object.defineProperty({__proto__:null,default:pe},Symbol.toStringTag,{value:"Module"})),gl={name:"ReviewWidget",props:{shopId:String,reviewableId:String,overwriteData:Object},components:{StarScore:Y,ReviewListItem:J,RatingDistribution:ue,CreateReviewModal:pe},beforeMount(){this.overwriteData||(this.fetchShop(),this.fetchReviewable(),this.fetchReviews())},data(){const o=new URLSearchParams(window.location.search),e=document.getElementById("monto-reviews-widget");e&&e.scrollIntoView();let r={shop:null,reviewable:null,reviews:null,nextReviewsUrl:null,labelFont:null,createReviewModalVisible:o.has("o_id"),reviewableNotFound:!1};return r=Object.assign({},r,this.overwriteData),r},watch:{overwriteData(){this.shop.widget_settings=this.overwriteData.shop.widget_settings}},computed:{scoreAvg(){const o=this.reviewable.score_distribution,e=o.total_rating_count;return e===0?0:(1*o.one+2*o.two+3*o.three+4*o.four+5*o.five)/e},jsonLd(){var e;let o={"@type":"Product",name:this.reviewable.name,description:(e=this.reviewable.raw)==null?void 0:e.description,aggregateRating:{"@type":"AggregateRating",ratingValue:this.scoreAvg.toFixed(1),ratingCount:this.reviewable.score_distribution.total_rating_count}};return this.reviewable&&this.reviewable.image_urls&&this.reviewable.image_urls.original&&(o.image=this.reviewable.image_urls.original),o}},methods:{async fetchShop(){try{const o=await U.get(`/shops/${this.shopI
301d}`);this.shop=o.data,this.labelFont=this.shop.widget_settings.font}catch(o){if(o.response.status===401)console.error("%cmonto","color: white;background:#0080ff;font-weight: bold; font-size:10px; padding:2px 6px; border-radius: 5px",o.response.data.error);else throw o}},async fetchReviewable(){try{const o=await U.get(`/shops/${this.shopId}/reviewables/${this.reviewableId}`);this.reviewable=o.data}catch(o){if(o.response.status===401)console.error("%cmonto","color: white;background:#0080ff;font-weight: bold; font-size:10px; padding:2px 6px; border-radius: 5px",o.response.data.error);else if(o.response.status===404)this.reviewableNotFound=!0;else throw o}},async fetchReviews(){try{if(this.nextReviewsUrl){const o=await U.get(this.nextReviewsUrl);this.reviews.data=this.reviews.data.concat(o.data.data),this.nextReviewsUrl=o.data.links.next}else{const o=await U.get(`/shops/${this.shopId}/reviewables/${this.reviewableId}/reviews`);this.reviews=o.data,this.nextReviewsUrl=o.data.links.next}}catch(o){if(o.response.status===401)console.error("%cmonto","color: white;background:#0080ff;font-weight: bold; font-size:10px; padding:2px 6px; border-radius: 5px",o.response.data.error);else throw o}}}},vl={class:"monto-widget",id:"monto-reviews-widget"},xl={key:1,class:"flex flex-col justify-between mb-4"},kl={class:"flex justify-between items-start"},Sl={class:"mb-1 text-gray-600 mt-1 text-md"},Cl={key:0,class:"border-t pt-6"},Ml={class:"text-center"},Rl={key:2,class:"opacity-25"};function Il(o,e,r,d,t,n){const i=g("create-review-modal"),c=g("star-score"),y=g("rating-distribution"),p=g("review-list-item");return l(),a("div",vl,[o.shop&&o.reviewable&&o.createReviewModalVisible?(l(),j(i,{key:0,onClose:e[0]||(e[0]=_=>o.createReviewModalVisible=!1),shop:o.shop,reviewable:o.reviewable},null,8,["shop","reviewable"])):m("",!0),o.shop&&o.reviewable?(l(),a("div",xl,[s("div",kl,[s("div",null,[B(c,{"score-avg":n.scoreAvg,"star-color":o.shop.widget_settings.star_color,"hide-avg":!1},null,8,["score-avg","star-color"]),s("div",Sl," Based on "+u(o.reviewable.score_distribution.total_rating_count)+" reviews. ",1)]),o.shop.widget_settings.show_review_form_link?(l(),a("button",{key:0,type:"button",onClick:e[1]||(e[1]=_=>o.createReviewModalVisible=!0),class:"btn transition-color duration-100",style:w([{color:"white"},{"background-color":o.shop.widget_settings.primary_color}])}," Write Review ",4)):m("",!0)]),B(y,{reviewable:o.reviewable,"primary-color":o.shop.widget_settings.rating_distribution_bar_color,class:"mt-4 mb-16"},null,8,["reviewable","primary-color"]),o.reviews&&o.reviews.data.length>0?(l(),a("ul",Cl,[(l(!0),a(P,null,A(o.reviews.data,(_,R)=>(l(),j(p,{key:_.id,review:_,"shop-name":o.shop.name,"star-color":o.shop.widget_settings.star_color,"show-profile-pictures":o.shop.widget_settings.show_profile_pictures,"show-review-date":o.shop.widget_settings.show_review_date,"show-titles":o.shop.widget_settings.review_titles_enabled,class:"mb-16"},null,8,["review","shop-name","star-color","show-profile-pictures","show-review-date","show-titles"]))),128))])):m("",!0),s("div",Ml,[o.nextReviewsUrl?(l(),a("button",{key:0,onClick:e[2]||(e[2]=(..._)=>n.fetchReviews&&n.fetchReviews(..._)),class:"btn transition-color duration-100 opacity-75 hover:opacity-100",style:w([{color:"white"},{"background-color":o.shop.widget_settings.primary_color}])}," Show More ",4)):m("",!0)])])):m("",!0),o.reviewableNotFound?(l(),a("div",Rl,"This product is not indexed by Monto, yet.")):m("",!0)])}const be=v(gl,[["render",Il]]),Pl=Object.freeze(Object.defineProperty({__proto__:null,default:be},Symbol.toStringTag,{value:"Module"})),El={name:"WidgetStyler",components:{ReviewWidget:be},props:{defaultMailColors:Object,defaultBrandColors:Object},beforeMount(){this.fetchShop()},data(){return{mode:"widget",saving:!1,hasLogo:!1,form:{reviews_hidden_if_empty:null,reviews_review_product_name_visible:null,rating_distribution_bar_color:null,show_review_date:null,primary_color:null,custom_css:null,star_color:null,show_review_form_link:null,show_profile_pictures:null,reviews_per_page:null,default_sort:null,review_titles_enabled:null,mail:{canvas_bg:null,panel_bg:null,primary_color:null,link_color:null,primary_copy:null,subject:null,secondary_copy:null,primary_copy_color:null,secondary_copy_color:null}},logo:null,errors:{},widgetData:null}},computed:{emailTemplateSettingsUrl(){return`${location.origin}/shop#email`}},methods:{getMailFrameUrl(){return`${location.origin}/shop/ctr/preview`},handleLogoChange(o){this.logo=o.target.files[0]},async removeLogo(){this.saving=!0;try{const e=await axios.delete("/shop/mail/logo");this.hasLogo=!1}catch(e){this.errors=e.response.errors}finally{this.saving=!1}const o=document.getElementById("mailFrame");o&&o.contentWindow.location.reload()},async fetchShop(){const o=await axios.get("/shop");this.form={...o.data.widget_settings,review_titles_enabled:o.data.review_titles_enabled,reviews_hidden_if_empty:o.data.reviews_hidden_if_empty,reviews_review_product_name_visible:o.data.reviews_review_product_name_visible},this.hasLogo=o.data.logo_original!==null},async save(){var e,r;this.saving=!0,this.errors={};try{const d=await axios.put("/shop/widget/settings",this.form);if((e=window.top)==null||e.postMessage("montoWidgetSettingsChanged","*"),this.logo){const t=new FormData;t.append("logo",this.logo);const n=await axios.post("/shop/logo",t);this.logo=null,this.hasLogo=!0}}catch(d){console.error("Save reviews settings",d),this.errors=((r=d.response)==null?void 0:r.data.errors)||{}}finally{this.saving=!1}const o=document.getElementById("mailFrame");o&&o.contentWindow.location.reload()},handleShowProfilePictures(o){this.form.show_profile_pictures=o.target.enabled}},watch:{form:{handler:function(o,e){let r={reviewable:{ext_id:"monto-example-reviewable",name:"Monto Example Reviewable",score_distribution:{total_rating_count:3,one:0,two:0,three:0,four:1,five:2}},shop:{widget_settings:{...this.form}},reviews:{current_page:1,data:[{id:207,reviewable_id:748,order_id:null,
301score:5,title:"These candles smell amazing!",message:"Looks great in our votives! Ordering more.",customer_name:"Kim Jenner",customer_profile_picture_url:"https://cdn.monto.io/reviews/media/preview-mode/profile1.jpg",created_at:"2019-11-07T15:09:48.000000Z",updated_at:"2019-11-07T15:09:48.000000Z",read:!1,deleted_at:null,is_verified:!1,created_at_tri_formatted:"Nov 7, 2019",message_shorted:"Looks great in our votives! Ordering more."},{id:206,reviewable_id:748,order_id:null,score:5,title:"Perfect for our home decor style",message:"Just tried a few in our space. Love the look!",customer_name:"Jack Ryan",customer_profile_picture_url:"https://cdn.monto.io/reviews/media/preview-mode/profile2.jpg",created_at:"2019-11-06T16:37:51.000000Z",updated_at:"2019-11-06T16:37:51.000000Z",read:!1,deleted_at:null,is_verified:!1,created_at_tri_formatted:"Nov 6, 2019",message_shorted:"Just tried a few in our space. Love the look!"},{id:279,reviewable_id:748,order_id:null,score:4,title:"Solid quality - but needs hardware",message:"Matches my room almost perfectly. Wish it would come with a small set of tools to attach it to the walls.",customer_name:"Amanda Saffert",customer_email:"[email protected]",customer_profile_picture_url:"https://cdn.monto.io/reviews/media/preview-mode/profile3.jpg",created_at:"2019-12-04T19:09:11.000000Z",updated_at:"2019-12-04T19:09:11.000000Z",read:!1,deleted_at:null,is_verified:!1,created_at_tri_formatted:"Dec 4, 2019",message_shorted:"Matches my room almost perfectly. Wish it would come with a small set of tools to attach it to the walls."}],total:3,reviews_score_avg:"4.6",distribution:{5:2,4:1}},labelFont:null,createReviewModalVisible:!1};r.shop.widget_settings.primary_color||(r.shop.widget_settings.primary_color=this.defaultBrandColors.main_color),r.shop.widget_settings.rating_distribution_bar_color||(r.shop.widget_settings.rating_distribution_bar_color=this.defaultBrandColors.secondary_color),this.widgetData=r},deep:!0}}},Al={class:"flex flex-1"},Ll={class:"pl-4 xl:pl-0 flex justify-center items-center max-w-screen-md mx-auto flex-col pt-8"},jl={class:"mb-16 flex text-lg w-full border-b"},Tl={key:1},Bl=["src"],Ul={class:"border-l max-w-xs w-full"},Ol={key:0},Fl={class:"px-4 py-2"},Vl={class:"attribute-row"},Dl={class:"flex"},ql=["placeholder"],Nl={for:"primaryColorInput",class:"ml-1 border border-white"},zl={key:0,class:"mt-3 block text-red-500"},Hl={class:"attribute-row"},Kl={class:"flex"},Wl={for:"starColorInput",class:"ml-1 border border-white"},Yl={key:0,class:"mt-3 block text-red-500"},Jl={class:"attribute-row"},Zl={class:"flex"},Xl=["placeholder"],Ql={for:"ratingDistributionBarColor",class:"ml-1 border border-white"},Gl={key:0,class:"mt-3 block text-red-500"},$l={class:"attribute-row"},ea={class:"flex items-center justify-between"},ta=["enabled"],oa={key:0,class:"mt-3 block text-red-500"},sa={class:"attribute-row"},ra={class:"flex items-center justify-between"},ia=["enabled"],na={key:0,class:"mt-3 block text-red-500"},la={class:"attribute-row"},aa={class:"flex items-center justify-between"},da=["enabled"],ua={key:0,class:"mt-3 block text-red-500"},ca={class:"attribute-row"},ma={class:"flex items-center justify-between"},pa=["enabled"],ba={key:0,class:"mt-3 block text-red-500"},_a={class:"attribute-row"},ha={class:"flex items-center justify-between"},fa=["enabled"],wa={key:0,class:"mt-3 block text-red-500"},ya={class:"attribute-row"},ga={class:"flex items-center justify-between"},va=["enabled"],xa={key:0,class:"mt-3 block text-red-500"},ka={class:"attribute-row flex"},Sa={class:"w-16"},Ca={key:0,class:"mb-3 block text-red-500"},Ma={class:"attribute-row flex"},Ra={key:0,class:"mt-3 block text-red-500"},Ia={class:"attribute-row"},Pa={key:0,class:"mt-3 block text-red-500"},Ea={key:1,"x-data":"{open: true}"},Aa={class:"px-4 py-2","x-show":"open"},La={class:"attribute-row"},ja=["href"],Ta={class:"attribute-row"},Ba={class:"flex"},Ua=["placeholder"],Oa={for:"mailCanvasBgInput",class:"ml-1 border border-white"},Fa={key:0,class:"mt-3 block text-red-500"},Va={class:"attribute-row"},Da={class:"flex"},qa=["placeholder"],Na={for:"mailPanelBgInput",class:"ml-1 border border-white"},za={key:0,class:"mt-3 block text-red-500"},Ha={class:"attribute-row"},Ka={class:"flex"},Wa=["placeholder"],Ya={for:"mailPrimaryColorInput",class:"ml-1 border border-white"},Ja={key:0,class:"mt-3 block text-red-500"},Za={class:"attribute-row"},Xa={class:"flex"},Qa=["placeholder"],Ga={for:"mailLinkColorInput",class:"ml-1 border border-white"},$a={key:0,class:"mt-3 block text-red-500"},ed={class:"attribute-row"},td={class:"flex"},od=["placeholder"],sd={for:"mailPrimaryCopyColorInput",class:"ml-1 border border-white"}
301,rd={key:0,class:"mt-3 block text-red-500"},id={class:"attribute-row"},nd={class:"flex"},ld=["placeholder"],ad={for:"mailSecondaryCopyColorInput",class:"ml-1 border border-white"},dd={key:0,class:"mt-3 block text-red-500"},ud={class:"attribute-row"},cd={key:0,class:"mt-3 block text-red-500"},md={class:"attribute-row"},pd={key:0,class:"mt-3 block text-red-500"},bd={class:"attribute-row"},_d={key:0,class:"mt-3 block text-red-500"},hd={class:"px-4 border-t sticky bottom-0 bg-white py-3"},fd={key:0,type:"button",class:"btn btn--primary w-full text-center opacity-50"};function wd(o,e,r,d,t,n){const i=g("review-widget");return l(),a("div",Al,[s("div",Ll,[s("ul",jl,[s("li",null,[b(s("input",{type:"radio",id:"toggleModeWidgetCheckbox",name:"view_mode",value:"widget","onUpdate:modelValue":e[0]||(e[0]=c=>t.mode=c),class:"hidden"},null,512),[[W,t.mode]]),s("label",{for:"toggleModeWidgetCheckbox",class:I(["bg-white py-2 px-6 rounded inline-block",[t.mode==="widget"?"-mb-px text-monto-accent border-t border-r border-l":"hover:cursor-pointer"]])},"Widget",2)]),s("li",null,[b(s("input",{type:"radio",id:"toggleModeEmailCheckbox",name:"view_mode",value:"mail","onUpdate:modelValue":e[1]||(e[1]=c=>t.mode=c),class:"hidden"},null,512),[[W,t.mode]]),s("label",{for:"toggleModeEmailCheckbox",class:I(["bg-white py-2 px-6 rounded inline-block",[t.mode==="mail"?"-mb-px text-monto-accent border-t border-r border-l":"hover:cursor-pointer"]])},"Email",2)])]),t.widgetData&&t.mode==="widget"?(l(),j(i,{key:0,"overwrite-data":t.widgetData},null,8,["overwrite-data"])):m("",!0),t.mode==="mail"?(l(),a("div",Tl,[e[33]||(e[33]=s("p",{class:"text-center mb-4"},"Save to see changes.",-1)),s("iframe",{src:n.getMailFrameUrl(),frameborder:"0",width:"800px",height:"800px",id:"mailFrame"},null,8,Bl)])):m("",!0)]),s("div",Ul,[t.mode==="widget"?(l(),a("div",Ol,[e[47]||(e[47]=s("div",{class:"flex justify-between items-center w-full bg-monto-gray-4 text-monto-gray-9 font-medium px-6 py-4 text-sm border-b border-monto-gray-3"}," Appearance ",-1)),s("div",Fl,[s("div",Vl,[e[34]||(e[34]=s("label",{for:"primaryColorInput",class:"text-gray-700 text-sm w-1/3"},"Primary",-1)),s("div",Dl,[b(s("input",{type:"text","onUpdate:modelValue":e[2]||(e[2]=c=>t.form.primary_color=c),class:"form-input form-input--sm",placeholder:r.defaultBrandColors.main_color},null,8,ql),[[h,t.form.primary_color]]),s("label",Nl,[s("div",{class:"rounded w-8 h-full",style:w({background:t.form.primary_color})},null,4),b(s("input",{type:"color","onUpdate:modelValue":e[3]||(e[3]=c=>t.form.primary_color=c),class:"colorInput",id:"primaryColorInput"},null,512),[[h,t.form.primary_color]])])]),t.errors.primary_color?(l(),a("small",zl,u(t.errors.primary_color[0]),1)):m("",!0)]),s("div",Hl,[e[35]||(e[35]=s("label",{for:"starColorInput",class:"text-gray-700 w-full text-sm"},"Star Color",-1)),s("div",Kl,[b(s("input",{type:"text",name:"star_color","onUpdate:modelValue":e[4]||(e[4]=c=>t.form.star_color=c),class:"form-input form-input--sm"},null,512),[[h,t.form.star_color]]),s("label",Wl,[s("div",{class:"rounded w-8 h-full",style:w({background:t.form.star_color})},null,4),b(s("input",{type:"color","onUpdate:modelValue":e[5]||(e[5]=c=>t.form.star_color=c),class:"colorInput",id:"starColorInput"},null,512),[[h,t.form.star_color]])])]),t.errors.star_color?(l(),a("small",Yl,u(t.errors.star_color[0]),1)):m("",!0)]),s("div",Jl,[e[36]||(e[36]=s("label",{for:"ratingDistributionBarColor",class:"text-gray-700 w-full text-sm"},"Rating Distribution Bar Color",-1)),s("div",Zl,[b(s("input",{type:"text",name:"rating_distribution_bar_color","onUpdate:modelValue":e[6]||(e[6]=c=>t.form.rating_distribution_bar_color=c),placeholder:r.defaultBrandColors.secondary_color,class:"form-input form-input--sm"},null,8,Xl),[[h,t.form.rating_distribution_bar_color]]),s("label",Ql,[s("div",{class:"rounded w-8 h-full",style:w({background:t.form.rating_distribution_bar_color})},null,4),b(s("input",{type:"color","onUpdate:modelValue":e[7]||(e[7]=c=>t.form.rating_distribution_bar_color=c),class:"colorInput",id:"ratingDistributionBarColor"},null,512),[[h,t.form.rating_distribution_bar_color]])])]),t.errors.rating_distribution_bar_color?(l(),a("small",Gl,u(t.errors.rating_distribution_bar_color[0]),1)):m("",!0)]),s("div",$l,[s("div",ea,[e[37]||(e[37]=s("label",{for:"showReviewFormLinkInput",class:"text-gray-700 text-sm"},'Show "Add Review" Button',-1)),s("monto-switch",{for:"showReviewFormLinkInput",enabled:t.form.show_review_form_link,"on:enabledChange":e[8]||(e[8]=c=>this.form.show_review_form_link=c.target.enabled)},null,40,ta)]),t.errors.show_review_form_link?(l(),a("small",oa,u(t.errors.show_review_form_link),1)):m("",!0)]),s("div",sa,[s("div",ra,[e[38]||(e[38]=s("label",{for:"showReviewD
301ateInput",class:"text-gray-700 text-sm"},"Show Review Date",-1)),s("monto-switch",{for:"showReviewDateInput",enabled:t.form.show_review_date,"on:enabledChange":e[9]||(e[9]=c=>this.form.show_review_date=c.target.enabled)},null,40,ia)]),t.errors.show_review_date?(l(),a("small",na,u(t.errors.show_review_date),1)):m("",!0)]),s("div",la,[s("div",aa,[e[39]||(e[39]=s("label",{for:"showProfilePictures",class:"text-gray-700 text-sm"},"Show Profile Pictures",-1)),s("monto-switch",{for:"showProfilePictures",enabled:t.form.show_profile_pictures,"on:enabledChange":e[10]||(e[10]=(...c)=>n.handleShowProfilePictures&&n.handleShowProfilePictures(...c))},null,40,da)]),t.errors.show_profile_pictures?(l(),a("small",ua,u(t.errors.show_profile_pictures),1)):m("",!0)]),s("div",ca,[s("div",ma,[e[40]||(e[40]=s("label",{for:"enableReviewTitles",class:"text-gray-700 text-sm"},"Enable Review Titles",-1)),s("monto-switch",{for:"enableReviewTitles",enabled:t.form.review_titles_enabled,"on:enabledChange":e[11]||(e[11]=c=>this.form.review_titles_enabled=c.target.enabled)},null,40,pa)]),t.errors.review_titles_enabled?(l(),a("small",ba,u(t.errors.review_titles_enabled),1)):m("",!0)]),s("div",_a,[s("div",ha,[e[41]||(e[41]=s("label",{for:"reviewsHiddenIfEmpty",class:"text-gray-700 text-sm"},"Hide If No Reviews",-1)),s("monto-switch",{for:"reviewsHiddenIfEmpty",enabled:t.form.reviews_hidden_if_empty,"on:enabledChange":e[12]||(e[12]=c=>this.form.reviews_hidden_if_empty=c.target.enabled)},null,40,fa)]),t.errors.reviews_hidden_if_empty?(l(),a("small",wa,u(t.errors.reviews_hidden_if_empty),1)):m("",!0)]),s("div",ya,[s("div",ga,[e[42]||(e[42]=s("label",{for:"reviewProductNameVisible",class:"text-gray-700 text-sm"},"Review Product Names Visible",-1)),s("monto-switch",{for:"reviewProductNameVisible",enabled:t.form.reviews_review_product_name_visible,"on:enabledChange":e[13]||(e[13]=c=>this.form.reviews_review_product_name_visible=c.target.enabled)},null,40,va)]),t.errors.reviews_review_product_name_visible?(l(),a("small",xa,u(t.errors.reviews_review_product_name_visible),1)):m("",!0)]),s("div",ka,[e[43]||(e[43]=s("label",{for:"reviewsPerPage",class:"flex-1 text-gray-700 text-sm"},"Reviews per Page",-1)),s("span",Sa,[b(s("input",{type:"text","onUpdate:modelValue":e[14]||(e[14]=c=>t.form.reviews_per_page=c),class:"form-input form-input--sm",min:"1",max:"25"},null,512),[[h,t.form.reviews_per_page]])])]),t.errors.reviews_per_page?(l(),a("small",Ca,u(t.errors.reviews_per_page[0]),1)):m("",!0),s("div",Ma,[e[45]||(e[45]=s("label",{for:"defaultSort",class:"text-gray-700 w-full text-sm mr-auto"},"Default Sorting",-1)),b(s("select",{"onUpdate:modelValue":e[15]||(e[15]=c=>t.form.default_sort=c),id:"defaultSort"},[...e[44]||(e[44]=[te('<option value="DATE_DESC">Newest First</option><option value="DATE_ASC">Oldest First</option><option value="MEDIA">Media First</option><option value="SCORE_DESC">Best Rating First</option><option value="SCORE_ASC">Worst Rating First</option>',5)])],512),[[q,t.form.default_sort]]),t.errors.default_sort?(l(),a("small",Ra,u(t.errors.default_sort),1)):m("",!0)]),s("div",Ia,[e[46]||(e[46]=s("label",{for:"customCssInput",class:"text-gray-700 w-full text-sm"},"Custom CSS",-1)),b(s("textarea",{name:"customCss","onUpdate:modelValue":e[16]||(e[16]=c=>t.form.custom_css=c),id:"customCssInput",cols:"30",rows:"10",class:"font-mono text-sm form-input"}," ",512),[[h,t.form.custom_css]]),t.errors.custom_css?(l(),a("small",Pa,u(t.errors.custom_css),1)):m("",!0)])])])):m("",!0),t.mode==="mail"?(l(),a("div",Ea,[e[59]||(e[59]=s("button",{type:"button","x-on:click":"open = !open",class:"flex justify-between items-center w-full bg-monto-primary text-white font-medium px-6 py-4 text-sm border-b border-monto-gray-3"},[f(" Mail Appearance "),s("svg",{"x-bind:class":"{ 'transform -rotate-90': !open }",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"feather feather-chevron-down"},[s("polyline",{points:"6 9 12 15 18 9"})])],-1)),s("div",Aa,[s("div",La,[e[48]||(e[48]=s("label",{class:"text-sm text-gray-700"}," Edit Universal Brand Colors ",-1)),s("a",{href:n.emailTemplateSettingsUrl,class:"btn btn--primary mt-2"},"Go to Email Template",8,ja),e[49]||(e[49]=s("div",{class:"mt-4 text-sm text-gray-700"},"Editing these styles will override your brand's email template",-1))]),s("div",Ta,[e[50]||(e[50]=s("label",{for:"mailCanvasBgInput",class:"text-gray-700 text-sm w-1/3"}
301,"Canvas Background",-1)),s("div",Ba,[b(s("input",{type:"text","onUpdate:modelValue":e[17]||(e[17]=c=>t.form.mail.canvas_bg=c),class:"form-input form-input--sm",placeholder:r.defaultMailColors.background_color},null,8,Ua),[[h,t.form.mail.canvas_bg]]),s("label",Oa,[s("div",{class:"rounded w-8 h-full",style:w({background:t.form.mail.canvas_bg})},null,4),b(s("input",{type:"color","onUpdate:modelValue":e[18]||(e[18]=c=>t.form.mail.canvas_bg=c),class:"colorInput",id:"mailCanvasBgInput"},null,512),[[h,t.form.mail.canvas_bg]])])]),t.errors.mail&&t.errors.mail.canvas_bg?(l(),a("small",Fa,u(t.errors.mail.canvas_bg),1)):m("",!0)]),s("div",Va,[e[51]||(e[51]=s("label",{for:"mailPanelBgInput",class:"text-gray-700 text-sm w-1/3"},"Panel Background",-1)),s("div",Da,[b(s("input",{type:"text","onUpdate:modelValue":e[19]||(e[19]=c=>t.form.mail.panel_bg=c),class:"form-input form-input--sm",placeholder:r.defaultMailColors.body_color},null,8,qa),[[h,t.form.mail.panel_bg]]),s("label",Na,[s("div",{class:"rounded w-8 h-full",style:w({background:t.form.mail.panel_bg})},null,4),b(s("input",{type:"color","onUpdate:modelValue":e[20]||(e[20]=c=>t.form.mail.panel_bg=c),class:"colorInput",id:"mailPanelBgInput"},null,512),[[h,t.form.mail.panel_bg]])])]),t.errors.mail&&t.errors.mail.panel_bg?(l(),a("small",za,u(t.errors.mail.panel_bg),1)):m("",!0)]),s("div",Ha,[e[52]||(e[52]=s("label",{for:"mailPrimaryColorInput",class:"text-gray-700 text-sm w-1/3"},"Primary Color",-1)),s("div",Ka,[b(s("input",{type:"text","onUpdate:modelValue":e[21]||(e[21]=c=>t.form.mail.primary_color=c),class:"form-input form-input--sm",placeholder:r.defaultMailColors.accent_color},null,8,Wa),[[h,t.form.mail.primary_color]]),s("label",Ya,[s("div",{class:"rounded w-8 h-full",style:w({background:t.form.mail.primary_color})},null,4),b(s("input",{type:"color","onUpdate:modelValue":e[22]||(e[22]=c=>t.form.mail.primary_color=c),class:"colorInput",id:"mailPrimaryColorInput"},null,512),[[h,t.form.mail.primary_color]])])]),t.errors.mail&&t.errors.mail.primary_color?(l(),a("small",Ja,u(t.errors.mail.primary_color),1)):m("",!0)]),s("div",Za,[e[53]||(e[53]=s("label",{for:"mailLinkColorInput",class:"text-gray-700 text-sm w-1/3"},"Link Color",-1)),s("div",Xa,[b(s("input",{type:"text","onUpdate:modelValue":e[23]||(e[23]=c=>t.form.mail.link_color=c),class:"form-input form-input--sm",placeholder:r.defaultMailColors.link_color},null,8,Qa),[[h,t.form.mail.link_color]]),s("label",Ga,[s("div",{class:"rounded w-8 h-full",style:w({background:t.form.mail.link_color})},null,4),b(s("input",{type:"color","onUpdate:modelValue":e[24]||(e[24]=c=>t.form.mail.link_color=c),class:"colorInput",id:"mailLinkColorInput"},null,512),[[h,t.form.mail.link_color]])])]),t.errors.mail&&t.errors.mail.link_color?(l(),a("small",$a,u(t.errors.mail.link_color),1)):m("",!0)]),s("div",ed,[e[54]||(e[54]=s("label",{for:"mailPrimaryCopyColorInput",class:"text-gray-700 text-sm w-1/3"},"Primary Copy Color",-1)),s("div",td,[b(s("input",{type:"text","onUpdate:modelValue":e[25]||(e[25]=c=>t.form.mail.primary_copy_color=c),class:"form-input form-input--sm",placeholder:r.defaultMailColors.body_text_color},null,8,od),[[h,t.form.mail.primary_copy_color]]),s("label",sd,[s("div",{class:"rounded w-8 h-full",style:w({background:t.form.mail.primary_copy_color})},null,4),b(s("input",{type:"color","onUpdate:modelValue":e[26]||(e[26]=c=>t.form.mail.primary_copy_color=c),class:"colorInput",id:"mailPrimaryCopyColorInput"},null,512),[[h,t.form.mail.primary_copy_color]])])]),t.errors.mail&&t.errors.mail.primary_copy_color?(l(),a("small",rd,u(t.errors.mail.primary_copy_color),1)):m("",!0)]),s("div",id,[e[55]||(e[55]=s("label",{for:"mailSecondaryCopyColorInput",class:"text-gray-700 text-sm w-1/3"},"Secondary Copy Color",-1)),s("div",nd,[b(s("input",{type:"text","onUpdate:modelValue":e[27]||(e[27]=c=>t.form.mail.secondary_copy_color=c),class:"form-input form-input--sm",placeholder:t.form.mail.primary_copy_color},null,8,ld),[[h,t.form.mail.secondary_copy_color]]),s("label",ad,[s("div",{class:"rounded w-8 h-full",style:w({background:t.form.mail.secondary_copy_color})},null,4),b(s("input",{type:"color","onUpdate:modelValue":e[28]||(e[28]=c=>t.form.mail.secondary_copy_color=c),class:"colorInput",id:"mailSecondaryCopyColorInput"},null,512),[[h,t.form.mail.secondary_copy_color]])])]),t.errors.mail&&t.errors.mail.secondary_copy_color?(l(),a("small",dd,u(t.errors.mail.secondary_copy_color),1)):m("",!0)]),s("div",ud,[e[56]||(e[56]=s("label",{for:"mailSubjectInput",class:"text-gray-700 text-sm w-1/3"},"Subject",-1)),b(s("input",{id:"mailSubjectInput","onUpdate:modelValue":e[29]||(e[29]=c=>t.form.mail.subject=c),class:"form-input"},null,512),[[h,t.form.mail.subject]]),t.errors.mail&&t.errors.mail.subject?(l(),a("small",cd,u(t.errors.mail.subject),1)):m("",!0)]),s("div",md,[e[57]||(e[57]=s("label",{for:"mailPrimaryCopyInput",class:"text-gray-700 text-sm w-1/3"},"Primary Copy",-1)),b(s("textarea",{id:"mailPrimaryCopyInput","onUpdate:modelValue":e[30]||(e[30]=c=>t.form.mail.primary_copy=c),class:"form-input",cols:"30",rows:"8"},null,512),[[h,t.form.mail.primary_copy]]),t.errors.mail&&t.errors.mail.primary_copy?(l(),a("small",pd,u(t.errors.mail.primary_copy),1)):m("",!0)]),s("div",bd,[e[58]||(e[58]=s("label",{for:"mailSecondaryCopyInput",class:"text-gray-700 text-sm w-1/3"},"Secondary Copy",-1)),b(s("textarea",{id:"mailSecondaryCopyInput","onUpdate:modelValue":e[31]||(e[31]=c=>t.form.mail.secondary_copy=c),class:"form-input",cols:"30",rows:"8"},null,512),[[h,t.form.mail.secondary_copy]]),t.errors.mail&&t.errors.mail.secondary?(l(),a("small",_d,u(t.errors.mail.secondary_copy),1)):m("",!0)])])])):m("",!0),s("div",hd,[t.saving?(l(),a("button",fd,"Saving...")):(l(),a("button",{key:1,type:"button",onClick:e[32]||(e[32]=M((...c)=>n.save&&n.save(...c),["prevent"])),class:"btn btn--primary w-full text-center"},"Save"))])])])}const yd=v(El,[["render",wd]]),gd=Object.freeze(Object.defineProperty({__proto__:null,default:yd},Symbol.toStringTag,{value:"Module"})),vd={name:"StarWidget",props:["shopId","reviewableId"],components:{StarScore:Y},beforeMount(){this.fetchShop(),this.fetchReviewable()},data(){return{shop:null,reviewable:null,labelFont:null}},computed:{scoreAvg(){const o=this.reviewable.score_distribution,e=o.total_rating_count;return e===0?0:(1*o.one+2*o.two+3*o.three+4*o.four+5*o.five)/e},jsonLd(){var e;let o={"@type":"Product",name:this.reviewable.name,description:(e=this.reviewable.raw)==null?void 0:e.description,aggregateRating:{"@type":"AggregateRating",ratingValue:this.scoreAvg.toFixed(1),ratingCount:this.reviewable.score_distribution.total_rating_count}};return this.reviewable&&this.reviewable.image_urls&&this.reviewable.image_urls.original&&(o.image=this.reviewable.image_urls.original),o}},methods:{async fetchShop(){try{const o=await U.get(`/shops/${this.shopI
301d}`);this.shop=o.data,this.labelFont=this.shop.widget_settings.font}catch(o){if(o.response.status===401)console.error("%cmonto","color: white;background:#0080ff;font-weight: bold; font-size:10px; padding:2px 6px; border-radius: 5px",o.response.data.error);else throw o}},async fetchReviewable(){try{const o=await U.get(`/shops/${this.shopId}/reviewables/${this.reviewableId}`);this.reviewable=o.data}catch(o){if(o.response.status===401)console.error("%cmonto","color: white;background:#0080ff;font-weight: bold; font-size:10px; padding:2px 6px; border-radius: 5px",o.response.data.error);else throw o}}}},xd={key:0},kd={class:"flex items-center"},Sd={class:"ml-3 mb-1 text-gray-600 mt-1"};function Cd(o,e,r,d,t,n){const i=g("star-score");return t.shop&&t.reviewable?(l(),a("div",xd,[s("div",{class:"flex",style:w([t.labelFont?{fontFamily:t.labelFont}:""])},[s("div",kd,[B(i,{"score-avg":n.scoreAvg,"star-color":t.shop.widget_settings.star_color,"hide-avg":!0},null,8,["score-avg","star-color"]),s("div",Sd,u(t.reviewable.score_distribution.total_rating_count)+" Reviews ",1)])],4)])):m("",!0)}const Md=v(vd,[["render",Cd],["__scopeId","data-v-7d28463e"]]),Rd=Object.freeze(Object.defineProperty({__proto__:null,default:Md},Symbol.toStringTag,{value:"Module"})),Id={name:"WidgetBootstrapper",props:["shopId","reviewableId","widgetType"]};function Pd(o,e,r,d,t,n){const i=g("star-widget"),c=g("review-widget");return l(),a("div",null,[r.widgetType==="stars"?(l(),j(i,{key:0,"shop-id":r.shopId,"reviewable-id":r.reviewableId},null,8,["shop-id","reviewable-id"])):m("",!0),r.widgetType==="reviews"?(l(),j(c,{key:1,"shop-id":r.shopId,"reviewable-id":r.reviewableId},null,8,["shop-id","reviewable-id"])):m("",!0)])}const Ed=v(Id,[["render",Pd]]),Ad=Object.freeze(Object.defineProperty({__proto__:null,default:Ed},Symbol.toStringTag,{value:"Module"}));window.Chart=ke;window.ChartDataLabels=Se;window._=Ce;window.Pikaday=ve;window.$=se;window.jQuery=se;window.axios=U;window.axios.defaults.headers.common["X-Requested-With"]="XMLHttpRequest";window.axios.defaults.baseURL="https://www.monto.io/fp_api";window.$(document).ready(function(){function o(d){const n=`; ${document.cookie}`.split(`; ${d}=`);return n.length===2?n.pop().split(";").shift():null}const e=new URLSearchParams(window.location.search);if(e.has("via")&&!document.cookie.includes("monto_ref=")){console.log("Adding affiliate tag...");const d=new Date(Date.now()+1440*60*1e3);document.cookie=`monto_ref=${e.get("via").trim()}; domain=monto.io; expires=${d.toUTCString()}; Secure; path=/`}document.cookie.includes("monto_ref=")&&window.location.pathname==="/register"&&(document.getElementById("montoRef").value=o("monto_ref"));const r=o("duda_active_app");r&&sessionStorage.setItem("current_duda_app",r)});function Ld(o,e,r,d=!0,t=null){if(!(e!=null&&e.length))return;let n=document.getElementById(o).getContext("2d");const i={maintainAspectRatio:!1,responsive:!0,interaction:{mode:"index",intersect:!1},layout:{padding:{left:0,bottom:10}},scales:{x:{grid:{color:"#f8f8f8",borderDash:[10]},border:{display:!1},ticks:{maxTicksLimit:4,padding:15,color:"#aaa",autoSkip:!0,maxRotation:0,minRotation:0}},y:{min:0,grid:{color:"#f0f0f0",borderDash:[10,10]},border:{display:!1},ticks:{maxTicksLimit:5,autoSkip:!0,color:"#aaa",padding:20}}},elements:{point:{radius:1,backgroundColor:"transparent"}},plugins:{legend:{display:!1},tooltip:{mode:"index",intersect:!1}}};return t&&(i.plugins.tooltip.callbacks={label:function(c){let y=c.dataset.label||"";return y+=`\r 302`,y+=t[c.dataIndex],y}}),new Chart(n,{type:"line",data:{labels:e,datasets:[{backgroundColor:"transparent",borderColor:"#174d4d",data:r}]},options:i})}const jd=Object.freeze(Object.defineProperty({__proto__:null,createChart:Ld},Symbol.toStringTag,{value:"Module"})),Td=[/monto\.io/i,/montodev\.com/i,/monto\.(test|local)/i],N=(o="")=>typeof o!="string"?!1:Td.some(e=>e.test(o)),Bd=o=>[o==null?void 0:o.filename,o==null?void 0:o.abs_path,o==null?void 0:o.module].some(e=>typeof e=="string"&&/@sentry[/\\]/i.test(e)),Ud=o=>{var r,d;const e=(r=o==null?void 0:o.exception)==null?void 0:r.values;if(Array.isArray(e))for(const t of e){const n=(d=t==null?void 0:t.stacktrace)==null?void 0:d.frames;if(Array.isArray(n)){for(const i of n)if(!Bd(i)&&(N(i==null?void 0:i.filename)||N(i==null?void 0:i.abs_path)||N(i==null?void 0:i.module)))return!0}}return N(o==null?void 0:o.culprit)||N(o==null?void 0:o.transaction)},Od=o=>{var r;const e=(r=o==null?void 0:o.exception)==null?void 0:r.values;return Array.isArray(e)?e.some(d=>{const t=d==null?void 0:d.mechanism,n=t==null?void 0:t.type;return(t==null?void 0:t.handled)===!1||n==="onerror"||n==="onunhandledrejection"}):!1},Fd=o=>
302o?Od(o)&&!Ud(o):!1,Vd=new Set([401,403,404]),z="(?:\\s+\\([^)]*\\))?",Dd=[new RegExp(`^load failed${z}$`,"i"),new RegExp(`^failed to fetch${z}$`,"i"),new RegExp(`^networkerror when attempting to fetch resource\\.?${z}$`,"i"),new RegExp(`^(?:cancelled|canceled|Äã há»§y)${z}$`,"i")],qd=o=>{if(o.name!=="TypeError")return!1;const e=typeof o.message=="string"?o.message:"";return Dd.some(r=>r.test(e))},Nd=o=>{var r;if(!o||typeof o!="object")return!1;if(qd(o))return!0;const e=(r=o.response)==null?void 0:r.status;return typeof e=="number"?Vd.has(e):o.isAxiosError===!0||o.name==="AxiosError"},zd=new Set(["BrowserApiErrors","Breadcrumbs"]);function Hd(o={}){if(o.dsn)return Me({dsn:o.dsn,environment:o.environment||"production",release:o.release||void 0,sampleRate:typeof o.sampleRate=="number"?o.sampleRate:1,tracesSampleRate:typeof o.tracesSampleRate=="number"?o.tracesSampleRate:0,integrations:o.sharedEnvironment===!0?e=>e.filter(r=>!zd.has(r.name)):void 0,ignoreErrors:[/ResizeObserver loop (limit exceeded|completed)/,"Non-Error promise rejection captured","top.GLOBALS","Script error.","AbortError","The operation was aborted","Network Error",/timeout of \d+ms exceeded/i,/Request aborted/i,/Shop ID (is )?missing\./i,...o.ignoreErrors||[]],denyUrls:[/^chrome-extension:\/\//i,/^moz-extension:\/\//i,/^safari-(web-)?extension:\/\//i,/extensions\//i,/\/(gtm|gtag|analytics|fbevents)\.js/i,/googletagmanager\.com/i,/google-analytics\.com/i,/connect\.facebook\.net/i,...o.denyUrls||[]],beforeSend(e,r){return Fd(e)||Nd(r==null?void 0:r.originalException)?null:e}}),o.source&&$("monto.source",o.source),o.impersonating&&$("monto.impersonating","true"),Re}Hd({...window.__montoSentry||{},source:"admin"});window.montoHelpers=jd;window.Sortable=xe;document.addEventListener("livewire:init",function(){window.performance&&window.performance.navigation.type===window.performance.navigation.TYPE_BACK_FORWARD&&Livewire.all().map(o=>{o.call("render")})});if(document.getElementById("app")){const o=fe({});o.config.compilerOptions.isCustomElement=r=>r.startsWith("monto-"),Object.entries(Object.assign({"./components/AssistantSidebar.vue":He,"./components/CustomerProfilePicture.vue":Ye,"./components/ReviewBrowser.vue":Pt,"./components/ReviewBrowserDetails.vue":Eo,"./components/ReviewEditModal.vue":Ft,"./components/ReviewReassignModal.vue":Vo,"./components/StarRating.vue":zo,"./components/SubscriptionForm.vue":kr,"./components/SubscriptionFormModal.vue":Hs,"./components/TinyStarBadge.vue":Qe,"./components/affiliates/AffCustomize.vue":ki,"./components/styler/WidgetStyler.vue":gd,"./components/widgets/CreateReviewModal.vue":yl,"./components/widgets/RatingDistribution.vue":nn,"./components/widgets/RatingInput.vue":fn,"./components/widgets/ReviewListItem.vue":Ki,"./components/widgets/ReviewWidget.vue":Pl,"./components/widgets/StarScore.vue":Pi,"./components/widgets/StarWidget.vue":Rd,"./components/widgets/WidgetBootstrapper.vue":Ad,"./components/widgets/review-form/MediaStep.vue":Cn})).forEach(([r,d])=>{const t=r.split("/").pop().replace(/\.vue$/i,"");o.component(t,d.default)}),o.mount("#app")}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.