PageSourceSearch

https://store.gemnote.com/_nuxt/B7oekFc4.js

js gemnote.com collected 2026-10-02 06:15:44 UTC 9,031 bytes, 1 lines download raw bytes

1import{R as j,u as F,a as G}from"./CXPEL8V5.js";import{u as J}from"./Dp2UzT0L.js";import{u as K}from"./BU1Wq2eS.js";import{L as E}from"./Bf3nNcCe.js";import{_ as Q,r as O,c as u,o as l,C as S,f as y,F as $,a as i,p as W,i as w,az as z,A as U,j as Z,h as b,t as q,e as _,x as ee,d as L}from"./SuPpnckH.js";import{T as te}from"./BnxQaBgI.js";import{R as D}from"./BjCpkKro.js";import{C as ie}from"./D2wopb2D.js";import{u as se}from"./D9aFf6E0.js";import"./W9H1toHc.js";import"./JiKMaLLI.js";import"./jdmn6HMp.js";import"./QVoDY9p2.js";import"./B2rf8-HE.js";import"./YgdDChio.js";import"./OFMm6V_k.js";import"./BVnAYhmB.js";import"./hYJoJCZL.js";const ae={"data-testid":"tier-gallery"},ne={key:1,"data-testid":"tier-1-header"},le={key:2,"data-testid":"tier-header"},oe={class:"tier-details","data-testid":"tier-details"},de={class:"flex flex-col md:flex-row gap-4 items-start md:items-center"},re={class:"form-input-value input-value"},ue=["placeholder","value"],me={class:"flex gap-4 flex-wrap items-center"},ce={class:"form-input-value input-value flex flex-wrap md:flex-nowrap items-center gap-6"},ve={class:"flex items-center gap-10","data-testid":"selection-type-radios"},pe=["value"],fe={class:"tier-gallery","data-testid":"product-gallery"},ye=["data-testid"],ge=["data-testid","onClick"],be={class:"tier-checkbox"},Te={class:"checkbox-container"},he=["checked","data-testid","onChange"],xe=["src","alt"],Ie={class:"portrait-info"},ke={key:0},we={key:2,class:"empty-state","data-testid":"empty-state"},Le={__name:"RedemptionsRedemptionTierGallery",props:{tier:{type:Object,required:!0},sequence:{type:Number,required:!0},products:{type:Array,default:()=>[]},disabled:{type:Boolean,default:!1},isLoading:{type:Boolean,default:!1},isSubmitting:{type:Boolean,default:!1},currentStep:{type:Number,default:3},showPrices:{type:Boolean,default:!0}},emits:["update:name","update:tierQuantityLimit","update:selectionType","update:selectedItems","removeTier","prevStep","nextStep"],setup(s,{emit:C}){const d=s,r=C,{formatCurrency:P,handleBrokenImage:m,getProductImage:R}=se(),g=O(!1);function x(T){return d.tier.selectedItems?.some(t=>t.itemableId===T.id)||!1}function k(T,t){T.preventDefault();const e=d.tier.selectedItems||[],c=d.tier.savedItems||[];if(x(t))r("update:selectedItems",d.tier.id,e.filter(I=>I.itemableId!==t.id));else{const I=c.find(h=>h.itemableId===t.id),A={itemableId:t.id,itemableType:t.type==="products"?"Product":"bundles",itemId:I?.itemId||t.id};r("update:selectedItems",d.tier.id,[...e,A])}}function B(){g.value=!1,r("removeTier",d.tier.id)}return(T,t)=>(l(),u("div",ae,[s.isLoading?(l(),S(E,{key:0,"data-testid":"tier-loading",text:"Loading gifts"})):y("",!0),!s.isLoading&&s.products.length?(l(),u($,{key:1},[g.value?(l(),S(ie,{key:0,"show-footer":!0,"color-variation":"secondary","data-testid":"remove-tier-modal",onConfirmAction:B,onHideModal:t[0]||(t[0]=e=>g.value=!1)},{header:W(()=>[...t[9]||(t[9]=[i("h4",null,"Are you sure you want to remove this tier?",-1)])]),_:1})):y("",!0),s.sequence<=1?(l(),u("section",ne,[w(j,{title:"Set up your store","header-text":"Tier 1","current-step":s.currentStep,"is-submitting":s.isSubmitting,onOnPrevStep:t[1]||(t[1]=e=>r("prevStep")),onOnNextStep:t[2]||(t[2]=e=>r("nextStep"))},null,8,["current-step","is-submitting"])])):y("",!0),s.sequence>1?(l(),u("section",le,[w(te,{title:`Tier ${s.sequence}`,disabled:s.disabled,onOnRemoveTier:t[3]||(t[3]=e=>g.value=!0)},null,8,["title","disabled"])])):y("",!0),i("div",{class:U({disabled:s.disabled}),"data-testid":"tier-content"},[i("div",oe,[i("div",de,[t[10]||(t[10]=i("div",{class:"form-label"},[i("p",null,[i("strong",null,"Tier name (Optional)")])],-1)),i("div",re,[i("input",{autocomplete:"off",placeholder:`Tier ${s.sequence}`,value:s.tier.name,type:"text",class:"form-control","data-testid":"tier-name-input",onBlur:t[4]||(t[4]=e=>r("update:name",s.tier.id,e.target.value))},null,40,ue)])]),i("div",me,[t[11]||(t[11]=i("div",{class:"form-label"},[i("p",null,[i("strong",null,"Number of products a user can choose")])],-1)),i("div",ce,[i("div",ve,[w(D,{label:"Up to",value:"UPTO","model-value":s.tier.selectionType||"EXACTLY","is-group-order":!0,"is-transparent":!0,"custom-styles":"font-size: 0.813rem; width:max-content","data-testid":"selection-type-upto","onUpdate:modelValue":t[5]||(t[5]=e=>r("update:selectionType",s.tier.id,"UPTO"))},null,8,["model-value"]),w(D,{label:"Exactly",value:"EXACTLY","model-value":s.tier.selectionType||"EXACTLY","is-group-order":!0,"is-transparent":!0,"custom-styles":"font-size: 0.813rem","data-testid":"selection-type-exactly","onUpdate:modelValue":t[6]||(t[6]=e=>r("update:selectionType",s.tier.id,"EXACTLY"))},null,8,["model-value"])]),i("input",{autocomplete:"off",placeholder:"Enter value",type:"number",min:"1",class:"form-control w-max",style:{width:"max-content"},value:s.tier.tierQuantityLimit,"data-testid":"quantity-limit-input",onInput:t[7]||(t[7]=e=>e.target.value&&r("update:tierQuantityLimit",s.tier.id,e.target.value))},null,40,pe)])])]),t[13]||(t[13]=i("div",{class:"flex gap-4 items-center margin-top-3 tier-product-info"},[i("div",{class:"form-label"},[i("p",null,[i("strong",null,"Add products to this tier by selecting from items below:")])])],-1)),i("div",fe,[(l(!0),u($,null,z(s.products,e=>(l(),u("div",{key:e.id,class:"gallery-image","data-testid":`product-${e.id}`},[i("div",{class:U(["portrait",{"is-selected":x(e)}]),"data-testid":`product-card-${e.id}`,onClick:c=>k(c,e)},[i("div",be,[i("label",Te,[i("input",{type:"checkbox",checked:x(e),"data-testid":`product-checkbox-${e.id}
1`,onChange:Z(c=>k(c,e),["stop"])},null,40,he),t[12]||(t[12]=i("span",{class:"checkmark checkmark-center"},null,-1))])]),i("img",{src:b(R)(e),alt:e.attributes?.name||"Product",onError:t[8]||(t[8]=(...c)=>b(m)&&b(m)(...c))},null,40,xe)],10,ge),i("div",Ie,[i("div",null,[i("p",null,q(e.attributes?.name),1),s.showPrices?(l(),u("span",ke,q(b(P)(e.attributes?.retailPrice||0)),1)):y("",!0)])])],8,ye))),128))])],2)],64)):y("",!0),!s.isLoading&&!s.products.length?(l(),u("div",we,[...t[14]||(t[14]=[i("p",null,"No products available for selection.",-1)])])):y("",!0)]))}},Se=Q(Le,[["__scopeId","data-v-ba87d3d3"]]),$e={"data-testid":"items-selection-page"},Ce={class:"tiers","data-testid":"tiers-container"},Pe={class:"button-left"},Re=["disabled"],Be={__name:"[id]",setup(s){_({title:"Select Items"});const{currentStep:C,redemptionId:d,next:r,prev:P}=F(),m=G(),{notifyError:R}=K(),{redemption:g,tiers:x,galleryProducts:k,isLoadingRedemption:B,isLoadingTiers:T,isLoadingProducts:t}=J(d),e=O([]);ee(x,n=>{n&&!e.value.length&&(e.value=n.map(a=>({...a,selectedItems:[...a.tierItems||[]],savedItems:[...a.tierItems||[]]})))},{immediate:!0});const c=L(()=>T.value||t.value||B.value),I=L(()=>g.value?.showPrices??!0),A=L(()=>g.value?.state==="finalized"),h=L(()=>m.isAddingTier.value||m.isDeletingTier.value||m.isSavingTierItems.value);async function M(){const n=await m.addTier(d.value);n&&(e.value=[...e.value,{...n,selectedItems:[],savedItems:[]}])}async function N(n,a){const o=e.value.find(f=>f.id===n);if(!o)return;const v={name:o.name||"",tierQuantityLimit:o.tierQuantityLimit,selectionType:o.selectionType,...a};await m.updateTier(d.value,n,v);const p=e.value.findIndex(f=>f.id===n);p!==-1&&(e.value[p]={...e.value[p],...a})}async function V(n){await m.deleteTier(d.value,n),e.value=e.value.filter(a=>a.id!==n)}function H(n,a){const o=e.value.findIndex(v=>v.id===n);o!==-1&&(e.value[o].selectedItems=[...a])}async function X(){for(let a=0;a<e.value.length;a++){const o=e.value[a],v=parseInt(o.tierQuantityLimit)||1;if((o.selectedItems?.length||0)<v){R(`Tier ${a+1} needs at least ${v} item(s).`);return}}const n=await m.saveTierItems(d.value,e.value);(n.success||n.errors.added.length===0)&&(e.value=e.value.map(a=>({...a,savedItems:[...a.selectedItems||[]]})),r())}function Y(){P()}return(n,a)=>(l(),u("div",$e,[c.value?(l(),S(E,{key:0,"data-testid":"loading-indicator",text:"Loading group order..."})):y("",!0),c.value?y("",!0):(l(),u($,{key:1},[i("div",Ce,[(l(!0),u($,null,z(e.value,(o,v)=>(l(),S(Se,{key:o.id,tier:o,sequence:v+1,products:b(k)||[],disabled:!o.editable,"is-loading":b(t),"is-submitting":h.value,"current-step":b(C),"show-prices":I.value,"data-testid":`tier-gallery-${v+1}`,"onUpdate:name":a[0]||(a[0]=(p,f)=>N(p,{name:f})),"onUpdate:tierQuantityLimit":a[1]||(a[1]=(p,f)=>N(p,{tierQuantityLimit:f})),"onUpdate:selectionType":a[2]||(a[2]=(p,f)=>N(p,{selectionType:f})),"onUpdate:selectedItems":H,onRemoveTier:V,onPrevStep:Y,onNextStep:X},null,8,["tier","sequence","products","disabled","is-loading","is-submitting","current-step","show-prices","data-testid"]))),128))]),i("div",{class:U(["group-order-buttons",{disabled:A.value||h.value}]),"data-testid":"buttons-container"},[i("div",Pe,[i("button",{class:"whitebutton-gemnote whitebutton-gemnote--small",disabled:h.value,"data-testid":"add-tier-button",onClick:M},[i("span",null,q(h.value?"Processing...":"+ ADD TIER"),1)],8,Re)])],2)],64))]))}},Ke=Q(Be,[["__scopeId","data-v-299e2fa9"]]);export{Ke 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.