PageSourceSearch

https://www.worldvision.org.tw/_nuxt/XacaLPy1.js

js worldvision.org.tw collected 2026-10-01 12:03:22 UTC 12,449 bytes, 1 lines download raw bytes

1import{_ as Ct}from"./I9T9YxBZ.js";import{_ as Tt}from"./C1gZcYGR.js";import{_ as Vt}from"./TJx2Pcg4.js";import{_ as It,a as Pt}from"./N0EM4CIK.js";import{l as _t,m as ft,c as M,o as n,a as c,b as o,t as m,g as e,d as p,e as y,F as x,i as q,j as P,h as k,f as tt,k as et,_ as St,z as gt,G as zt,p as Et,u as Lt,r as I,v as Bt,q as Dt,w as ct,J as lt,x as dt,C as Nt,D as jt,K as qt,n as mt,y as Gt}from"./6IIxn3OZ.js";import{_ as At}from"./BWXtQtPH.js";import{S as Mt,N as Rt,a as Ot}from"./TqLrjbEG.js";import{E as Ut}from"./Dbl9yNlp.js";import{E as Wt,a as Ft}from"./BHKgj5r4.js";import{E as Ht,a as Jt}from"./C_ySaf3l.js";import{u as Kt}from"./Cua5bpza.js";/* empty css        *//* empty css        */import"./BQm0S9Gs.js";import"./D1uZie_T.js";import{a as Qt,b as Xt,x as Yt,y as pt,n as Zt,u as te,E as Z,o as ut,p as ee}from"./DeERfVqQ.js";import{u as oe,a as se}from"./tozEpRo-.js";import{s as ae}from"./CqWVj-YM.js";import"./CzPHhKso.js";import"./DQ2I2Ovm.js";import"./CelxogyL.js";import"./Dp09WBWk.js";import"./D6m1_92R.js";import"./F7sx1R8b.js";import"./BV0VNZHr.js";import"./DdLWuqla.js";import"./sUvVD9-T.js";import"./C9IjlZSK.js";import"./CJycbbzu.js";import"./M-ntCJWh.js";import"./CC6Ll0MO.js";import"./C3JIWPxk.js";const ne={class:"my-section related-stories"},ie={class:"wvt-title"},re={class:"item-card"},ce={class:"item-card__title font-bold"},le={class:"item-card__img"},de=["src","alt"],me={class:"item-card__tags"},pe={class:"m-0"},ue={class:"item-card__text"},_e={key:0,class:"swiper-button-next"},fe={key:1,class:"swiper-button-prev"},ge={class:"flex justify-center"},he={__name:"RelatedStories",props:{contents:{type:Array,default:()=>[]}},setup(ot){const{t:f}=_t(),$=ft(),{public:{assetsImgBase:l}}=et(),z=ot,v=M(()=>z.contents.map(g=>{const E=g.url||"";return{id:g.id,title:g.title_zh_tw??g.title??"",description:g.description_zh_tw??g.description??"",image:g.image||`${l}/no_picture.jpg`,isExternal:/^https?:\/\//.test(E),to:E||`/sponsorships/story/${g.id}`}}));return(g,E)=>{const L=St,R=At,O=gt;return n(),c("section",ne,[o("h2",ie,[o("span",null,m(e(f)("successStories")),1)]),p(R,null,{default:y(()=>[p(e(Mt),{modules:[e(Rt)],"slides-per-view":1,"space-between":20,navigation:{nextEl:".related-stories .swiper-button-next",prevEl:".related-stories .swiper-button-prev"},breakpoints:{768:{slidesPerView:2,spaceBetween:24},1024:{slidesPerView:3,spaceBetween:30}},class:"swiper related-stories__swiper my-grid"},{default:y(()=>[(n(!0),c(x,null,q(e(v),u=>(n(),P(e(Ot),{key:u.id},{default:y(()=>[p(L,{to:u.isExternal?u.to:e($)(u.to)},{default:y(()=>[o("div",re,[o("h3",ce,m(u.title),1),o("div",le,[o("img",{class:"block w-full h-full object-cover",src:u.image,alt:`${u.title} ${e(f)("coverImage")}`},null,8,de),o("div",me,[o("p",pe,m(e(f)("stories")),1)])]),o("div",ue,m(u.description),1)])]),_:2},1032,["to"])]),_:2},1024))),128)),e(v).length>2?(n(),c("div",_e)):k("",!0),e(v).length>2?(n(),c("div",fe)):k("",!0)]),_:1},8,["modules"])]),_:1}),o("div",ge,[p(L,{to:e($)("/sponsorships/stories")},{default:y(()=>[p(O,{type:"outline"},{default:y(()=>[tt(m(e(f)("successStoriesMore")),1)]),_:1})]),_:1},8,["to"])])])}}},be={class:"flex-1 flex flex-col"},ye={class:"block lg:mb-14 lg:flex lg:fixed-w-container"},ve={class:"px-4 lg:px-0 lg:min-w-[70%] lg:w-[70%]"},we={key:1,class:"w-full rounded-lg aspect-[3/2]"},xe=["src","alt"],ke={class:"relative -mt-1.5 px-4 pb-5 bg-white border-t-8 border-primary-normal rounded-t-xl md:px-6 md:pb-5 lg:top-0 lg:right-0 lg:-left-48 lg:pt-4 lg:my-5 lg:z-10 lg:rounded-lg lg:min-w-[480px] lg:max-w-[480px]"},$e={class:"font-medium my-3","data-cy":"product-detail-title"},Ce={class:"whitespace-pre-line"},Te={key:0,class:"flex flex-wrap overflow-hidden pb-12 bg-white border-t border-gray-300"},Ve={class:"w-full lg:w-2/3 md:basis-full lg:basis-3/5 mb-10 lg:ml-auto px-4 md:px-6 lg:pl-4"},Ie={class:"w-screen relative flex justify-evenly items-center left-1/2 right-1/2 mx-[-50vw] mb-7 after:content-[''] after:block after:absolute after:bg-gray-300 after:w-[133vw] after:h-px after:bottom-0 after:z-10"},Pe={class:"text-lg pb-1 after:content-[''] after:inline-block after:absolute after:bottom-0 after:inset-x-0 after:w-20 after:h-1 after:my-0 after:mx-auto after:bg-primary-normal after:rounded"},Se=["innerHTML"],ze={class:"flex fixed left-0 bottom-0 w-full p-4 z-50 backdrop-blur-sm lg:hidden"},Ee={id:"product-variant-area",class:"mx-4 px-0 md:px-4 w-full md:flex-1 lg:flex-3 lg:px-8 lg:max-w-md lg:mr-auto lg:pr-4 lg:w-1/3"},Le={class:"bg-bg-gray md:flex md:flex-wrap lg:block rounded-b-lg pt-7 pb-2 px-3 lg:px-4"},Be=["data-cy"],De={class:"w-full mb-2 aspect-[3/2] rounded-lg"},Ne=["src","alt"],je=["src","alt"],qe=["data-cy"],Ge={class:"flex justify-between my-3.5 font-medium text-xl"},Ae={key:1,"data-cy":"variant-price"},Me={key:0},Re={class:"flex justify-between"},Oe={__name:"[id]",async setup(ot){var rt;let f,$;const{t:l}=_t(),z=Et(),v=ft(),{productApi:g,spApi:E}=te(),{public:{assetsImgBase:L,appDomain:R}}=et(),O=oe(),u=Kt(),ht=Lt(),B=Qt(),bt=Xt(),st=z.params.id,U=I([{link:v("/"),name:l("home")},{link:v("/donations"),name:l("donations")}]),W=I(!0),G=I([]),A=I([]),F=I({}),r=I(),at=I([]);M(()=>B.totalPrice);const yt=M(()=>bt.isLogin),vt=M(()=>{{const t=document.getElementById("product-variant-area"),s=document.getElementById("Microsoft_Omnichannel_LCWidget_Chat_Iframe_Window"),_=ht.scrollPosition;if(t&&s)return _<t.offsetTop-120?(s.style.bottom="75px",!0):(s.style.bottom="20px",!1)}});Bt(()=>z.path,()=>{u.setCurrentTime(new Date)},{immediate:!0}),Dt(()=>{Yt(u.currentTime,`/donation/${st}`)});const nt=t=>(t.sort((s,_)=>s.sorting<_.sorting?-1:s.sorting>_.sorting?1:0),t),wt=t=>{window.dataLayer.push({event:"view_item",ecommerce:{currency:"TWD",items:[pt(t,t.variants[0])]}})},xt=t=>l(t==="onetimeVariants"?"donationTabOneTime":"donationTabRecurring"),it=async(t,s,_)=>{const d=/^[0-9]*$/,i=t.price_customizable,D=i&&t.price,N=!i&&!d.test(t.price),J=D&&!d.test(t.price),K=!i&&parseInt(t.price)<100,Q=D&&parseInt(t.price)<100;if(N||J)Z.warning(l("validNum"));else if(K||Q)Z.warning(l("validPrice"));else{const X=s.id===40||s.title==="資助等待最久兒童",Y=s.id===21266||s.title==="資助1000女孩";if(X)for(let h=0;h<t.quantity;h++){const C=h===t.quantity-1&&_,T=await B.getFormatLongestChild(C);if(!T)break;const V={...T,wvt_sp_m_code:"donations_waiting_longest"},w={formatCart:V,from:"userChild"};t.id=V.variantId,t.title_zh_tw=s.title_zh_tw,await B.addItemInCart(w)}else if(Y)for(let h=0;h<t.quantity;h++){const C=h===t.quantity-1&&_,T=await E.getGirlChildren(),V=Math.floor(Math.random()*T.data.data.length),w=T.data.data[V];if(!w){Z.info("目前尚無待資助1000女孩,請稍候再試");break}const S=w.variants[0],a={...ut(S,w,C),wvt_sp_m_code:"donations_1000_girls"},b={formatCart:a,from:"userChild"};t.id=a.variantId,t.title_zh_tw=s.title_zh_tw,await B.addItemInCart(b)}else{const C={formatCart:ut(t,s,_),from:"userDonation"};B.addItemInCart(C)}kt(t,s),yt.value||ee(t,s)}},kt=(t,s)=>{window.dataLayer.push({event:"add_to_cart",ecommerce:{currency:"TWD",value:t.quantity*parseInt(t.price),items:[pt(s,t,!0)]}})},$t=t=>{{const s=document.getElementById(t).offsetTop;window.scrollTo(0,s-120)}},H=([f,$]=ct(()=>g.getProductDetail(st)),f=await f,$(),f);if(H.status==="success"){const t=H.donationDetail,s=t.variants[0].product_variant_type_id;if(t.variants){const d=t.variants.map(i=>({...i,quantity:1,priceText:i.priceText?i.priceText:i.price,price:i.price_customizable?null:i.priceText?i.priceText:i.price}));t.variants=d,G.value=nt(d.filter(i=>i.type.id===1)),A.value=nt(d.filter(i=>i.type.id===2))}wt(t),U.value.push({link:v(`/donations/category/${t.category.id}`),name:t.category.name}),U.value.push({name:t.title}),u.setBreadcrumb(U.value);const _={url:et().public.baseUrl+v(z.path),title:t.meta_title_zh_tw||t.title_zh_tw,description:t.meta_description_zh_t
1w||t.brief_zh_tw,type:"product",image:(rt=t.image)==null?void 0:rt.link};ae(_),r.value=t,s===1?F.value={onetimeVariants:G.value,pledgeVariants:A.value}:F.value={pledgeVariants:A.value,onetimeVariants:G.value},t.variants.forEach(d=>{const i=d.image?d.image.link:`${L}/wvt-logo.png`;at.value.find(N=>N===d.id)||(se({"@context":"https://schema.org","@type":"Product",sku:d.id,name:d.title,image:i,description:d.brief,offers:{"@type":"Offer",url:`https://${R}${O.pathname}`,price:d.priceText,priceCurrency:"TWD",availability:"https://schema.org/InStock"}}),at.value.push(d.id))})}else H.error.statusCode==404&&([f,$]=ct(()=>qt(v("/donations"))),await f,$());return W.value=!1,(t,s)=>{var V,w;const _=Ct,d=Tt,i=Vt,D=It,N=Pt,J=he,K=Ut,Q=Wt,X=Ft,Y=Gt,h=gt,C=Jt,T=Ht;return n(),c("div",be,[p(_,{class:"fixed-w-container"}),o("article",null,[o("div",ye,[o("div",ve,[e(W)||!e(r)?(n(),P(d,{key:0,class:"w-full aspect-[3/2]"})):(n(),c("div",we,[o("img",{src:e(r).image.link,alt:e(r).image.alt_text||`${e(l)("donationsTitle")} ${e(r).title} ${e(l)("coverImage")}`,class:"object-cover aspect-[3/2] rounded-lg"},null,8,xe)]))]),o("div",ke,[e(W)||!e(r)?(n(),c(x,{key:0},[p(i,{type:"title",class:"my-3"}),p(i,{type:"sub-title",class:"mb-3"}),s[1]||(s[1]=o("hr",{class:"my-4"},null,-1)),(n(),c(x,null,q(3,S=>p(i,{key:S,type:"text",class:"mb-3"})),64))],64)):(n(),c(x,{key:1},[o("h1",$e,m(e(r).title),1),o("p",null,m(e(r).category.name),1),s[2]||(s[2]=o("hr",{class:"my-4"},null,-1)),o("p",Ce,m(e(r).brief),1),e(r).free_gift_offers.length>0?(n(),P(D,lt(dt({key:0},{giftOffers:e(r).free_gift_offers})),null,16)):k("",!0)],64))])]),e(r)?(n(),c("div",Te,[o("div",Ve,[o("div",Ie,[o("p",Pe,m(e(l)("donationContent")),1)]),o("div",{class:"product-detail-description",innerHTML:e(r).description},null,8,Se),e(r).free_gift_offers.length>0?(n(),P(N,lt(dt({key:0},{giftOffers:e(r).free_gift_offers})),null,16)):k("",!0),(w=(V=e(r))==null?void 0:V.related_contents)!=null&&w.length?(n(),P(J,{key:1,contents:e(r).related_contents},null,8,["contents"])):k("",!0),Nt(o("div",ze,[o("a",{class:"w-full bg-primary-normal text-white text-center rounded-md p-2 text-base",href:"javascript:void(0)",onClick:s[0]||(s[0]=S=>$t("product-variant-area"))},m(e(l)("donateNow")),1)],512),[[jt,e(vt)]])]),o("div",Ee,[p(T,{stretch:!0,type:"card",class:"product-variant-tab"},{default:y(()=>[(n(!0),c(x,null,q(e(F),(S,j)=>(n(),c(x,null,[S.length>0?(n(),P(C,{key:j,label:xt(j),"data-cy":`tab-${j}`},{default:y(()=>[o("div",Le,[(n(!0),c(x,null,q(j==="onetimeVariants"?e(G):e(A),a=>(n(),c("div",{key:a.id,class:"flex-4.5 mx-[2.5%] mb-4 pb-4 border-b border-solid border-gray-300 last:border-b-0","data-cy":`product-variant-item-${a.id}`},[o("div",De,[a.image?(n(),c("img",{key:0,class:"object-cover rounded-lg aspect-[3/2]",src:a.image.link,alt:a.image.alt_text||`${e(l)("donationsTitle")} ${a.title} ${e(l)("coverImage")}`},null,8,Ne)):(n(),c("img",{key:1,src:`${e(L)}/wvt-logo.png`,class:"aspect-[3/2] object-contain bg-primary-normal rounded-lg",alt:`${e(l)("donationsTitle")} ${a.title} ${e(l)("coverImage")}`},null,8,je))]),o("div",{class:"font-medium","data-cy":`variant-name-${a.id}`},m(a.title),9,qe),o("div",Ge,[o("div",{class:mt(["flex w-full text-primary-normal",a.price_customizable?"items-center":"items-baseline self-end"])},[o("div",{class:mt({"text-sm":!a.price_customizable})},"NT$",2),a.price_customizable?(n(),P(K,{key:0,modelValue:a.price,"onUpdate:modelValue":b=>a.price=b,placeholder:a.priceText,class:"ml-4","data-cy":"variant-customized-price"},null,8,["modelValue","onUpdate:modelValue","placeholder"])):(n(),c("b",Ae,m(e(Zt)(a.priceText)),1))],2),a.price_customizable?k("",!0):(n(),c("div",Me,[p(X,{modelValue:a.quantity,"onUpdate:modelValue":b=>a.quantity=b,class:"quantity w-20",placeholder:"1",size:"large","data-cy":"variant-quantity"},{default:y(()=>[(n(),c(x,null,q(20,b=>p(Q,{key:b,label:`${b} ${a.unit||""}`,value:b},null,8,["label","value"])),64))]),_:2},1032,["modelValue","onUpdate:modelValue"])]))]),o("p",null,m(a.brief),1),o("div",Re,[p(h,{class:"flex-7","data-cy":`add-to-cart-${a.id}`,onClick:b=>it(a,e(r))},{default:y(()=>[tt(m(e(l)("donationAddToCart"))+" ",1),p(Y,{name:"fa6-solid:heart",class:"ml-1.5"})]),_:2},1032,["data-cy","onClick"]),p(h,{type:"outline",class:"flex-3 ml-2.5","data-cy":`add-to-cart-page-${a.id}`,onClick:b=>it(a,e(r),!0)},{default:y(()=>[tt(m(e(l)("donateNow")),1)]),_:2},1032,["data-cy","onClick"])])],8,Be))),128))])]),_:2},1032,["label","data-cy"])):k("",!0)],64))),256))]),_:1})])])):k("",!0)])])}}},ko=zt(Oe,[["__scopeId","data-v-eaa7d4be"]]);export{ko 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.