Files
004_comission/_utils/_comment_backup/louis coding's Reviews on Carousell Hong Kong_files/0da3242e754f555e.min.js.download
louiscklaw 6c60a73f30 update,
2025-01-31 19:15:17 +08:00

6 lines
7.1 KiB
Plaintext

"use strict";
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="4d173795-d3c7-5f32-a2f3-a8b7fb4d8bca")}catch(e){}}();
(self.__LOADABLE_LOADED_CHUNKS__=self.__LOADABLE_LOADED_CHUNKS__||[]).push([[464],{1268:(e,s,a)=>{a.r(s),a.d(s,{ListingShareOptionsModalDesktop:()=>E,default:()=>V});var c=a(1003),n=a.n(c),r=a(0),i=a(10),t=a(777),l=a(398),o=a(400),d=a(399),h=a(72),m=a(172),p=a(397),u=a(16),x=a(24),_=a(39),w=a(15),k=a(756),b=a(402),j=a(17),g=a(18),N=a(109),Z=a(982),v=a(720),y=a(99),D=a(1);const f=({className:e="",color:s,size:a=24})=>{const c=(0,y._x)(),n=s??c.urbanGrey60;return(0,D.jsxs)("svg",{className:e,fill:"none",height:a,viewBox:"0 0 22 24",width:a,xmlns:"http://www.w3.org/2000/svg",children:[(0,D.jsx)("path",{d:"M2 2V18H7C7.55228 18 8 18.4477 8 19C8 19.5523 7.55228 20 7 20H1C0.447715 20 0 19.5523 0 19V1C0 0.447715 0.447715 0 1 0H16C16.5523 0 17 0.447715 17 1V6C17 6.55228 16.5523 7 16 7C15.4477 7 15 6.55228 15 6V2H2Z",fill:n}),(0,D.jsx)("path",{clipRule:"evenodd",d:"M10 10C10 9.44771 10.4477 9 11 9H21C21.5523 9 22 9.44771 22 10V23C22 23.5523 21.5523 24 21 24H11C10.4477 24 10 23.5523 10 23V10ZM12 11V22H20V11H12Z",fill:n,fillRule:"evenodd"})]})};var C=a(200),$=a(106),S=a(76),T=a(1192),I=a.n(T);var L=a(1442),H="D_bke",M="D_bkf";const E=({ccId:e,listingId:s,listingTitle:a,sellerId:c})=>{const b=(0,i.I0)(),y=(0,m.Z)(),T=(0,i.v9)(w.RR),E=(0,i.v9)(u.XM),V=(0,i.v9)((e=>(0,$.MO)(e,{listingID:parseInt(s,10)}))),[A,z]=(0,r.useState)(""),[O,P]=(0,r.useState)(!1),[R,q]=(0,r.useState)(!1),[B,G]=(0,r.useState)(!1),U=(0,r.useRef)(null),F=(0,r.useRef)(null),J=(0,i.v9)(x.S$),K=`https://${T}${(0,j.xF)(s)}`,W=!E||E.id!==c&&E.id!==V?.seller?.id?"share-listing":"share-own-listing";(0,r.useEffect)((()=>{Q("share-copylink")}),[]),(0,r.useEffect)((()=>function(){F.current&&clearTimeout(F.current)}),[F]);const X=(0,Z.Z)(),Q=async a=>{const c=((e,s,a)=>{const c=new(I())(e,!0);return c.set("query",{...c.query,utm_campaign:a,utm_medium:"sharing",utm_source:s}).toString()})(K,a,W);let n,r;V&&-1!==V.collection?.cc_id?X?n=(0,S.Su)({campaign:"share-listing",ccId:V?.collection?.cc_id,cgproductId:V?.cgproduct_id,cgproductVariantId:V?.cgproduct_variant_id,channel:a,countryCode:J.country_code,isDesktop:!0,listingId:V?.id}):(0,j.jd)(window.location.pathname)&&(n=(0,S.JB)({campaign:W,channel:a,countryCode:J.country_code,isDesktop:!0,listing:V})):n={campaign:W,channel:a,data:{$deeplink_path:`${(0,N.LJ)(J.country_code.toUpperCase())}p/${s}`,$desktop_url:K,$fallback_url:K},feature:"sharing",tags:[`listing_id=${s}`,"page_type=listing",`ccid=${e}`,"platform=dweb"]};try{r=await Promise.any([(0,S.CW)({...n}),(i=C.Lz,new Promise((e=>setTimeout(e,i))))])}catch{r=c}var i;return r||(r=c),"share-copylink"===a&&z(r),r},Y=async e=>{if("share-copylink"===e)n()(A),q(!0),F.current=setTimeout((()=>{q(!1)}),3e3);else{const s=await Q(e);switch(e){case"share-facebook":window.open(`https://www.facebook.com/sharer/sharer.php?u=${escape(s)}`);break;case"share-twitter":window.open(`https://twitter.com/intent/tweet?url=${escape(s)}`);break;case"share-messenger":window.open(`https://www.facebook.com/dialog/send?app_id=379979055398817&link=${escape(s)}&redirect_uri=${escape(s)}`);break;case"share-whatsapp":window.open(`https://web.whatsapp.com/send?text=${escape(s)}`);break;case"share-email":window.open(`mailto:?body=${escape(s)}`);break;case"share-viber":window.open(`viber://forward?text=${escape(s)}`)}}};return(0,D.jsxs)("div",{className:"D_bjZ",children:[(0,D.jsxs)("div",{className:"D_bka",children:[(0,D.jsx)(o.Z,{level:"3",children:(0,D.jsx)(p.Z,{id:(0,g.ZP)("Share this with your community")})}),(0,D.jsx)(l.Z,{onClick:()=>{q(!1),b((0,_.qf)())},type:"linkTeal",children:(0,D.jsx)(v.Z,{})})]}),(0,D.jsxs)("div",{className:"D_bkb",children:[O&&null,(0,D.jsxs)("div",{className:"D_bkc",children:[(0,D.jsx)(l.Z,{className:H,onClick:()=>Y("share-facebook"),type:"icon",children:(0,D.jsx)(d.Z,{className:M,src:"https://mweb-cdn.karousell.com/build/share-fb-b78f9c986e.svg"})}),(0,D.jsx)(l.Z,{className:H,onClick:()=>Y("share-messenger"),type:"icon",children:(0,D.jsx)(d.Z,{className:M,src:"https://mweb-cdn.karousell.com/build/share-messenger-a1e7962edf.svg"})}),"PH"===J.country_code?(0,D.jsxs)(l.Z,{className:H,onClick:()=>Y("share-viber"),onMouseEnter:()=>{P(!0),U.current=setTimeout((()=>{P(!1)}),2e3)},onMouseLeave:()=>{U.current&&clearTimeout(U.current),P(!1)},type:"icon",children:[(0,D.jsx)(d.Z,{className:M,src:"https://mweb-cdn.karousell.com/build/share-viber-6709ddde24.svg"}),O&&(0,D.jsx)(t.Z,{className:"D_bkm",direction:"topLeft",children:(0,D.jsx)(h.Z,{hyphensNone:!0,size:"s",children:(0,D.jsx)(p.Z,{id:(0,g.ZP)("Viber desktop app required")})})})]}):(0,D.jsx)(l.Z,{className:H,onClick:()=>Y("share-whatsapp"),type:"icon",children:(0,D.jsx)(d.Z,{className:M,src:L})}),(0,D.jsx)(l.Z,{className:H,onClick:()=>Y("share-twitter"),type:"icon",children:(0,D.jsx)(d.Z,{className:M,src:"https://mweb-cdn.karousell.com/build/share-twitter-6d373c546f.svg"})}),(0,D.jsx)(l.Z,{className:H,onClick:()=>Y("share-email"),type:"icon",children:(0,D.jsx)(d.Z,{className:M,src:"https://mweb-cdn.karousell.com/build/share-email-b4311371d5.svg"})})]}),(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(h.Z,{className:"D_bkg",size:"s",textAlign:"center",children:(0,D.jsx)(p.Z,{id:(0,g.ZP)("Or copy link")})}),R?(0,D.jsx)(k.Z,{type:"success",children:(0,D.jsx)(h.Z,{hyphensNone:!0,size:"s",children:(0,D.jsx)(p.Z,{id:(0,g.ZP)("Link copied to your clipboard")})})}):(0,D.jsxs)("div",{className:"D_bkh",children:[(0,D.jsx)(h.Z,{className:"D_bkk",color:y.urbanGrey80,singleline:!0,size:"s",children:A}),(0,D.jsx)(l.Z,{className:"D_bki",onClick:()=>Y("share-copylink"),onMouseEnter:()=>{G(!0)},onMouseLeave:()=>{G(!1)},type:"icon",children:(0,D.jsx)(f,{className:"D_bkj",color:B?y.white:y.urbanGrey60})})]})]})]})]})},V=(0,b.TE)("LISTING_SHARE",E)},756:(e,s,a)=>{a.d(s,{Z:()=>d});var c=a(9),n=a.n(c),r=(a(0),a(72)),i=a(403),t=a(404),l=a(408),o=a(1);const d=function(e){const{children:s,className:a="",onClose:c,title:d,type:h,customIcon:m}=e,p=n()(a,"D_xj",{D_xs:"error"===h,D_xt:"info"===h,D_xu:"success"===h,D_xv:"warning"===h}),{className:u,name:x}=function(e){switch(e){case"error":return{className:"D_xm",name:t.T.alert};case"info":return{className:"D_xp",name:t.T.help};case"success":return{className:"D_xo",name:t.T.check_mark_c};case"warning":return{className:"D_xn",name:t.T.alert};default:return Sentry.captureMessage("Invalid CDS Alert type"),{className:"",name:t.T.alert}}}(h),_=m||(0,o.jsx)(i.Z,{className:u,name:x,size:24});return(0,o.jsxs)("div",{className:p,children:[(0,o.jsxs)("div",{className:"D_xk",children:[(0,o.jsx)("div",{className:"D_xl",children:_}),d?(0,o.jsxs)("div",{children:[(0,o.jsx)(r.Z,{className:"D_xq",hyphensNone:!0,responsive:!0,weight:"semibold",children:d}),s]}):s]}),c&&(0,o.jsx)(l.Z,{className:"D_xr",onClick:c,children:(0,o.jsx)(i.Z,{name:t.T.close,size:24})})]})}},1442:e=>{e.exports="https://mweb-cdn.karousell.com/build/share-whatsapp-c4cac1166b.svg"}}]);
//# sourceMappingURL=https://mdev.llesuorac.com/01857052a1fbff6c7926249973b6164fd2b19d8b/0da3242e754f555e.min.js.map
//# debugId=4d173795-d3c7-5f32-a2f3-a8b7fb4d8bca