1import{an as U,ab as Z,q as F,d as u,g as I,_ as T,c as k,o as C,a as e,y as K,i as h,p as W,aG as G,aH as Y,h as L,bx as J,r as y,x as X,s as ee,f as z,A as te,e as oe}from"./SuPpnckH.js";import{u as ae}from"./QVoDY9p2.js";import{u as D}from"./W9H1toHc.js";import{u as $}from"./BU1Wq2eS.js";import{T as A}from"./Dd9dY7P3.js";import{I as ne}from"./dVSoXCyd.js";import{d as se}from"./BVnAYhmB.js";import{n as ie}from"./B77K48aa.js";function O(s){const t=s.attributes||{};return{id:s.id,...t,preferencesBlob:t.preferencesBlob?.nonDeliveryOptionForInternationalShipment||"",teamLogo:t.teamLogo||{},teamCustomBackground:t.teamCustomBackground||{},hideLogo:t.hideLogo||!1,hideBackground:t.hideBackground||!1}}const re=[{label:"Return to sender",value:"return_to_sender"},{label:"Treat as abandoned",value:"treat_as_abandoned"}],P={async getTeam(){const s=await U.get("/team");return O(s.data.data)},async updatePreferences(s){const t=await U.patch("/team",{team:{non_delivery_option_for_international_shipment:s}});return O(t.data.data)},async uploadLogoOrBackground(s){const t=await U.patch("/team",s,{headers:{"Content-Type":"multipart/form-data"}});return O(t.data.data)}};function N(){const s=Z(),{notifyError:t,notifySuccess:p}=$(),{data:g,isLoading:_,isError:v,error:d,refetch:n}=ae({queryKey:F.settings.team(),queryFn:()=>P.getTeam()}),i=u(()=>{if(!g.value?.preferencesBlob)return"";switch(g.value.preferencesBlob){case"return_to_sender":return"Return to sender";case"treat_as_abandoned":return"Treat as abandoned";default:return""}}),f=D({mutationFn:o=>P.updatePreferences(o),onSuccess:o=>{s.setQueryData(F.settings.team(),o),p("Shipping preference updated")},onError:o=>{t(I(o,"Failed to update shipping preference"))}}),r=D({mutationFn:o=>P.uploadLogoOrBackground(o),onSuccess:o=>{s.setQueryData(F.settings.team(),o)},onError:o=>{t(I(o,"Failed to upload image"))}});async function m(o){const l=new FormData;return l.append("team[hide_logo]",!1),l.append("team[custom_logo]",o),r.mutateAsync(l)}async function b(){const o=new FormData;return o.append("team[hide_logo]",!0),r.mutateAsync(o)}async function w(o){const l=new FormData;return l.append("team[custom_background]",o),l.append("team[hide_background]",!1),r.mutateAsync(l)}async function R(){const o=new FormData;return o.append("team[hide_background]",!0),r.mutateAsync(o)}const M=u(()=>f.isPending.value),B=u(()=>r.isPending.value);return{team:g,isLoading:_,isError:v,error:d,shippingOptions:re,selectedShippingOptionLabel:i,isUpdatingPreferences:M,isUploading:B,uploadLogo:m,removeLogo:b,uploadBackground:w,removeBackground:R,updateShippingPreference:o=>f.mutateAsync(o),refetch:n}}const le={class:"row"},de={class:"grid-column"},ue={class:"shipping-options-select"},pe={__name:"ShippingOptions",setup(s){const{team:t,shippingOptions:p,selectedShippingOptionLabel:g,updateShippingPreference:_}=N(),v=u({get:()=>t.value?.preferencesBlob||"",set:d=>{d&&_(d)}});return(d,n)=>(C(),k("div",null,[e("div",le,[n[4]||(n[4]=e("h4",{class:"editorial"},"Shipping",-1)),e("div",de,[n[2]||(n[2]=e("div",{class:"shipping-options-title"},[e("p",null,"Undeliverable international shipments")],-1)),e("div",ue,[h(L(J),{modelValue:v.value,"onUpdate:modelValue":n[0]||(n[0]=i=>v.value=i),class:"custom gift-select","data-testid":"shipping-select",placeholder:L(g),options:L(p),clearable:!1,searchable:!1,label:"label",reduce:i=>i.value},{"open-indicator":W(({attributes:i})=>[e("span",G(Y(i)),[...n[1]||(n[1]=[e("svg",{width:"9",height:"5",viewBox:"0 0 9 5",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M4.5 5C4.38766 5 4.27531 4.95646 4.18974 4.86983L0.128691 0.758491C-0.0428969 0.584779 -0.0428969 0.303996 0.128691 0.130284C0.300278 -0.043428 0.577626 -0.043428 0.749214 0.130284L4.5 3.92752L8.25079 0.130284C8.42237 -0.043428 8.69972 -0.043428 8.87131 0.130284C9.0429 0.303996 9.0429 0.584779 8.87131 0.758491L4.81026 4.86983C4.72469 4.95646 4.61234 5 4.5 5Z",fill:"#25282A"})],-1)])],16)]),_:1},8,["modelValue","placeholder","options","reduce"])]),n[3]||(n[3]=e("div",{class:"shipping-options-note"},[e("p",null," Note - You will be responsible for return shipping charges when a shipment is returned. "),e("p")],-1))]),n[5]||(n[5]=K('<div class="flex items-center" data-v-c9017d03><svg width="23" height="28" viewBox="0 0 23 28" fill="none" xmlns="http://www.w3.org/2000/svg" data-v-c9017d03><path d="M9.78773 8.83679C10.5656 7.54814 12.4344 7.54814 13.2123 8.83679L19.6283 19.4665C20.4328 20.7994 19.473 22.5 17.916 22.5H5.08398C3.52704 22.5 2.56715 20.7994 3.37172 19.4665L9.78773 8.83679Z" fill="#232220" data-v-c9017d03></path><path d="M11.5 13.1818L11.4432 17.3636H10.7841L10.7273 13.1818H11.5ZM11.1136 19.0455C10.9735 19.0455 10.8532 18.9953 10.7528 18.8949C10.6525 18.7945 10.6023 18.6742 10.6023 18.5341C10.6023 18.3939 10.6525 18.2737 10.7528 18.1733C10.8532 18.0729 10.9735 18.0227 11.1136 18.0227C11.2538 18.0227 11.3741 18.0729 11.4744 18.1733C11.5748 18.2737 11.625 18.3939 11.625 18.5341C11.625 18.6269 11.6013 18.7121 11.554 18.7898C11.5085 18.8674 11.447 18.9299 11.3693 18.9773C11.2936 19.0227 11.2083 19.0455 11.1136 19.0455Z" fill="#F5F2EE" data-v-c9017d03></path></svg><p class="disclaimer" data-v-c9017d03> Returns will incur applicable shipping charges. </p></div>',1))])]))}},ce=T(pe,[["__scopeId","data-v-c9017d03"]]),ge={class:"row-logo"},me={class:"tip-holder"},ve={class:"logo-section"},fe={class:"portrait"},he=["src"],_e={class:"row-logo redemption"},be={class:"tip-holder"},we={class:"logo-section relative"},ye={class:"portrait redemption"},ke=["src"],E="image/jpeg,image/gif,image/png,application/pdf,image/x-eps",Ce={__name:"RedemptionSettings",setup(s){const{team:t,uploadLogo:p,removeLogo:g,uploadBackgroun
1d:_,removeBackground:v}=N(),{notifyError:d}=$(),n=y(window.innerWidth),i=y(""),f=y(!1),r=y(""),m=y(""),b=se,w=ie,R=u(()=>"For best results, we recommend uploading image with Aspect Ratio 1:1."),M=u(()=>`Maximum file size supported: 5MB. 2 3 For best results, we recommend uploading image with Aspect Ratio 9:16.`),B=u(()=>n.value<1e3?"bottom-start":"right"),o=u(()=>t.value?.teamLogo&&Object.keys(t.value.teamLogo).length>0),l=u(()=>t.value?.teamCustomBackground&&Object.keys(t.value.teamCustomBackground).length>0);function x(){t.value&&(t.value.hideLogo?r.value=b:r.value=o.value?t.value.teamLogo.url:b,t.value.hideBackground?m.value=w:m.value=l.value?t.value.teamCustomBackground.url:w)}function V(c){const a=c.target.files[0];if(!a)return;if(Math.round(a.size/1024)>=5048){d("Image size exceeded 5MB limit");return}if(a.type.indexOf("image/")===-1){d("Please select an image file");return}i.value=URL.createObjectURL(a),f.value=!0}async function j(c){if(c.target.files.length>0){const a=c.target.files[0];if(Math.round(a.size/1024)>=2048){d("Image size exceeded 2MB limit");return}r.value=URL.createObjectURL(a),await p(a)}}async function q(c){i.value="",m.value=URL.createObjectURL(c),await _(c)}async function H(){await g(),x()}async function Q(){await v(),x()}return X(t,()=>{x()},{immediate:!0}),ee(()=>{x()}),(c,a)=>(C(),k("div",null,[a[7]||(a[7]=e("p",{class:"team-header"},"Redemption Page",-1)),e("div",ge,[e("div",me,[a[2]||(a[2]=e("p",{class:"logo-label"},"Logo",-1)),h(A,{"pop-over-content":R.value,"pop-over-position":B.value,icon:"i"},null,8,["pop-over-content","pop-over-position"])]),e("div",ve,[e("div",fe,[e("img",{src:r.value?r.value:L(b),class:te({padded:o.value}),"data-testid":"logo-preview"},null,10,he)]),a[3]||(a[3]=e("label",{for:"logo-upload",class:"custom-file-upload","data-testid":"logo-upload-label"}," Upload ",-1)),o.value?(C(),k("label",{key:0,class:"custom-file-upload","data-testid":"logo-remove-button",onClick:H}," Remove Logo ")):z("",!0),e("input",{id:"logo-upload",type:"file","data-testid":"logo-upload-input",accept:E,onChange:j},null,32)])]),e("div",_e,[e("div",be,[a[4]||(a[4]=e("p",{class:"logo-label"},"Background Photo",-1)),h(A,{"pop-over-content":M.value,"pop-over-position":B.value,icon:"i"},null,8,["pop-over-content","pop-over-position"])]),e("div",we,[e("div",ye,[e("img",{src:m.value?m.value:L(w),class:"redemption","data-testid":"background-preview"},null,8,ke)]),a[5]||(a[5]=e("label",{for:"redemption-upload",class:"custom-file-upload","data-testid":"background-upload-label"}," Upload ",-1)),l.value?(C(),k("label",{key:0,class:"custom-file-upload","data-testid":"background-remove-button",onClick:Q}
3," Remove Background ")):z("",!0),e("input",{id:"redemption-upload",type:"file","data-testid":"background-upload-input",accept:E,onChange:a[0]||(a[0]=S=>V(S))},null,32),h(ne,{image:i.value,"is-open":f.value,"aspect-ratio":9/16,onCloseModal:a[1]||(a[1]=S=>f.value=!1),onCrop:q},null,8,["image","is-open"]),a[6]||(a[6]=e("p",{class:"absolute max-upload"},"Maximum upload file size: 5MB",-1))])])]))}},Le=T(Ce,[["__scopeId","data-v-9a2771f1"]]),Be={class:"content-wrapper","data-testid":"settings-page"},xe={class:"card-holder","data-testid":"shipping-options-section"},Se={class:"card-holder last","data-testid":"redemption-settings-section"},Re={__name:"index",setup(s){return oe({title:"Settings"}),(t,p)=>(C(),k("div",Be,[p[0]||(p[0]=e("h2",{class:"page-titles","data-testid":"settings-title"},"Settings",-1)),e("div",xe,[h(ce)]),e("div",Se,[h(Le)])]))}},De=T(Re,[["__scopeId","data-v-77b44cc6"]]);export{De as default};
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.