1 2!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="6941eff7-f10e-5eb2-8f4a-4d8597dda8e6")}catch(e){}}(); 3import{K as V,j as t,r as x,u as _t,a as Ut,G as z,T as Ot,f as Ft,N as Ht}from"./constants-psci6gc1.js";import{e as ne,i as xe}from"./fleamarketIdlError-Do-JGE7V.js";import{c as ue,I as Wt,S as k,i as qt}from"./variants-BpGuSOo8.js";import{I as je}from"./IconChevronRightLine-Dk4j3wBd.js";import{u as $t}from"./index-QYIIn1r2.js";import{a as L,u as Vt,g as zt,G as $e,j as Y,M,P as Se,a9 as Ve,J as Yt,F as Gt,E as Kt,U as Qt}from"./useResponsiveClientValue-82rXJak1.js";import{N as Ee,_ as I,H as J,V as u,L as X,l as S,u as Jt,T as N}from"./Link-BOm1qwNN.js";import{m as Xt,a as Zt,b as ea,c as ta,s as aa,d as ia,t as sa,A as ra,i as ze,I as na,e as oa,f as la,E as ca,g as ve,W as da,h as ua,j as ha,q as ma,k as ga,l as Ye,n as Ge,o as Ke,L as pa,p as fa,r as Ca}from"./WhereToMeet-Cna9jdTU.js";import{g as G,F as ya}from"./getFleamarketArticlePriceLabel-rvkMtHVw.js";import{F as A,b as Qe}from"./FleamarketArticleStatusV2-jOKjdzCz.js";import{a6 as xa,a7 as P,a8 as ke,a9 as Sa,aa as va,ab as ba,ac as ja,ad as st,ae as Ea,af as ka,ag as Ia,ah as La,ai as Ta,aj as Aa,ak as Ra,al as wa,am as Ma,an as Na,ao as Je,ap as Da,aq as Pa,ar as Ba,as as _a,u as Ua,d as Oa,H as Fa,e as K,at as Ha,g as rt,au as Wa,av as qa,aw as $a,ax as Va}from"./Header-BCtZByOG.js";import{L as oe,g as le}from"./ModalLocationVerification-BfngTnGh.js";import{f as za,g as Ya,T as Ga}from"./getDateFnsLocale-3Ywmp112.js";import{N as E}from"./StepIndicator-DsblN2Ap.js";import{a as Ka,u as Qa,c as Ja,b as Xa,d as Za,D as ei}from"./DeleteAlertDialog-DJUMs5CM.js";import{u as ti,a as ai}from"./useWatchArticle-r32tvdvn.js";import{g as ii}from"./useLocale-BvOEoNgk.js";import{c as si}from"./canonicalMeta-8i0JAm00.js";import{t as ri,d as ni,i as oi}from"./titleMeta-B7faHupF.js";import{a as li,l as Xe}from"./index-DNTrIOFe.js";import{n as ci}from"./noindexMeta-DK5jYImr.js";import{s as di}from"./safeMeta-D1Yix68w.js";import{A as ce}from"./ArticleDetailMoreOptions-K9FbVnm4.js";import{B as ui}from"./BottomBannerSection-C5QWiQiW.js";import{D}from"./DetailGroup-DATYx5MB.js";import{F as T}from"./FeedItem-eN5ys786.js";import{B as nt,u as hi,s as Q}from"./services-VIymWOJT.js";import{F as mi}from"./Footer-Cpr5shm-.js";import{v as gi,K as pi}from"./KarrotUserProfileSummary-l99xPYRd.js";import{M as fi,a as Ci}from"./ModalMarkAs-BZfeec2L.js";import{M as yi,Q as de}from"./QuickChat-DlEBf2wE.js";import{I as xi}from"./IconHeartFill-DIat1pZP.js";import{u as F}from"./getUserRole-CnWO5RTV.js";import{B as be}from"./index-CFnXTLIn.js";import{c as H}from"./exports-Bqt9E6uA.js";import"./IconChevronDownLine-CwIQAFhQ.js";import"./IconChevronLeftLine-CYEqnivC.js";import"./transformImageUrl-DOKV3ylq.js";import"./IconHeartLine-Bzvg-_bk.js";import"./Loader-B6W929u-.js";import"./IconShoppingbagLine-DnkRyOr3.js";import"./useMutation-BoetWcyS.js";import"./mutation-Boo0lJuK.js";import"./IconKarrotSymbol-DjDfRHuS.js";import"./url-pattern-DcJ_9d7r.js";import"./JoinCreatorCommunityBanner-CkP13Yr3.js";import"./StatusBadge-D7qWtsQs.js";import"./KarrotUserAvatar-BOOS6-3D.js";import"./CurrentLocationButton-BS2xBd3x.js";import"./CurrentLocationCircle-Dk_fZggF.js";function Ze(e){const i=e.scrollHeight-e.clientHeight;return i<=0?!0:Math.ceil(e.scrollTop)>=Math.floor(i)}const Si={[V.KR]:"ëì¬",[V.CA]:"boosted",[V.UK]:"boosted",[V.US]:"boosted",[V.JP]:"åã¢ãã"},vi=({createdAt:e,boostedAt:i,karrotLocalCountryCode:o,republishCount:l})=>{const n=i>e,m=n?i:e,g=za(new Date(m),{addSuffix:!0,locale:Ya({karrotLocalCountryCode:o})}),s=n||typeof l=="number"&&l>0?`${Si[o]} ${g}`:g;return{dateTime:m,label:s}},et=e=>{var i;return(e==null?void 0:e.thumbnail)??((i=e.category)==null?void 0:i.thumbnail)??xa},bi=({images:e,category:i})=>Ee({images:e,category:i}).with({images:I.when(o=>o.length>0)},o=>o.images.map(l=>({src:l}))).with({images:I.when(o=>o.length===0),category:I.not(I.nullish)},o=>[{src:o.category.thumbnail}]).otherwise(()=>[]);var tt="_1s5lq6b0";function at({title:e,moreLabel:i,moreHref:o}){return t.jsxs("header",{children:[t.jsx(J,{hide:{s:!0,m:!1},children:t.jsxs(u,{direction:"row",justify:"space-between",align:"center",children:[t.jsx("h2",{className:tt,children:e}),t.jsx(X,{href:o,children:t.jsx(nt,{as:"div",type:"button",color:"neutral",size:"medium",variant:"outline",endIcon:t.jsx(je,{size:16}),children:i})})]})}),t.jsx(J,{hide:{s:!1,m:!0},children:t.jsx(X,{href:o,children:t.jsxs(u,{direction:"row",justify:"space-between",align:"center",children:[t.jsx("h2",{className:tt,children:e}),t.jsx(je,{"aria-label":i,size:18})]})})})]})}var ji="o5qjyq0",Ei="o5qjyq1",ki="o5qjyq2",Ii="o5qjyq3",Li="o5qjyq4",Ti="o5qjyq5",Ai="o5qjyq6",Ri="o5qjyq7",wi="o5qjyq8",Mi="o5qjyq9";const Ie=5,Ni=Ie,Di=[Ei,ki,Ii,Li,Ti],Pi=({slides:e,articleTitle:i,onTileClick:o,"data-gtm":l})=>
3{if(e.length===0)return null;const n=Math.min(e.length,Ie),m=Math.max(0,e.length-Ie),g=e.slice(0,n),s=n>=3,c=Di[n-1];return t.jsx("div",{className:ue(ji,c),role:"group","aria-label":`${i} photo collage`,children:g.map((p,C)=>{const b=C===n-1&&m>0,f=b?`View ${m} more photo${m===1?"":"s"}`:`Open photo ${C+1} of ${e.length}`,B=s&&C!==0?"small":n===2?"medium":"hero",_=Xt(p.src,B);return t.jsxs("button",{type:"button",className:ue(Ri,s&&C===0&&Ai),onClick:()=>o(b?Ni:C),"data-gtm":l,"aria-label":f,children:[t.jsx("img",{..._,className:wi,alt:C===0?i:`${i} - photo ${C+1}`,loading:C===0?"eager":"lazy",fetchPriority:C===0?"high":"auto",decoding:C===0?"auto":"async",onError:U=>{const R=U.currentTarget.closest("button");R&&(R.style.visibility="hidden")}}),b&&t.jsxs("span",{className:Mi,"aria-hidden":"true",children:["+",m]})]},`${p.src}-${C}`)})})},it=x.memo(Pi);var Bi="opcvrb0",_i="opcvrb1";function Ui({watched:e,onClick:i,disabled:o=!1}){return t.jsx("button",{type:"button","aria-pressed":e,"aria-label":e?"Remove from favorites":"Add to favorites",disabled:o,onClick:i,className:ue(Bi,e&&_i),children:t.jsx(Wt,{svg:t.jsx(xi,{}),size:5,color:e?"primary":"neutral"})})}function Oi({articleDbId:e,senderId:i,receiverId:o}){var s;const l=P.getState().channel,n=P.getState().article,m=Sa.selectEntities(l),g=(s=Object.values(m).find(c=>{if(S.isNil(c.article))return;const p=va.selectById(n,{primaryKey:c.article});return(p==null?void 0:p.id)===e&&(p==null?void 0:p.user_id)===o&&(c==null?void 0:c.me)===i}))==null?void 0:s.id;if(!g)throw new Error("openChatByEntity: Channel not found");ot({channelId:g})}function ot({channelId:e}){P.dispatch(ke({channelId:e}))}async function Fi({channel:e,message:i},o){const{resourceType:l,articleDbId:n,readOnly:m=!1,sender:g,receiver:s}=e,{channel_id:c,content:p}=i,v=(await ba({chatRequest:{create_channel:ja.CreateChannelRequest.create({message:{channel_id:c,content:p,receiver:s,sender:g,type:st.TEXT},read_only:m,receiver:s,resource_id:n,resource_type:l,sender:g}),name:"CreateChannelRequest"},socket:o})).create_channel;if(S.isNil(v))throw new Error("createChannel: createChannelResponse is nil");const b=v.channel,f=v.message;if(S.isNil(b)||S.isNil(f))throw new Error("createChannel: channelResponse or messageResponse is nil");const B=Ea({message:f}),_=B.result??ka({message:{channelId:b.id,id:f.id}}),U=Ia({chatMessageId:_,normalizedData:B});return La.of(b).buildChannelResponseWith({lastChatMessage:U,raw:v})}const Hi=Ta(Aa("createChannelThunk"),async({channel:e,users:i,article:o,lastChatMessage:l},{dispatch:n})=>{n(Ra(e)),n(wa(i)),l&&n(Ma(l)),o&&n(Na(o))}),Wi=async({resourceType:e,articleDbId:i,senderId:o,receiverId:l,message:n})=>{const m={articleDbId:i,receiver:Je.fromJS({id:l}),resourceType:e,sender:Je.fromJS({id:o})},g=Da.getInstance().getWebSocket(),s=await Pa(m,g);if(!s.channel)throw new Error("startChatWithPost.getChannelForce: channel is nil");if(!s.channel.is_temporary){const{message:p}=await Ba({message:{channelId:s.channel.id,content:n,receiver:m.receiver,sender:m.sender,type:st.TEXT}},g);P.dispatch(_a({channel:s.channel,lastChatMessage:p,users:s.users,article:s.article})),P.dispatch(ke({channelId:s.channel.id}));return}const c=await Fi({channel:m,message:{channel_id:s.channel.id,content:n}},g);if(!c.channel)throw new Error("startChatWithPost.createChannel: channel is nil");P.dispatch(Hi({channel:c.channel,lastChatMessage:c.lastChatMessage,users:c.users,article:c.article})),P.dispatch(ke({channelId:c.channel.id}))},Os=({data:e,matches:i})=>{var C,v,b;if(!e)return[];const{t:o}=ii(e.karrotLang),l=i.flatMap(f=>qt(f)?f.meta??[]:[]),m=Ft(e.stage)({url:`${e.origin}/${e.karrotLocalCountryCode}/buy-sell/${e.article.nodeId}/`}),g=e.article.images.map(f=>f.url).filter(f=>!!f),s=g.length>
30?g:((C=e.article.category)==null?void 0:C.thumbnailUrl)||void 0,c=li.buySellDetailPage({name:e.article.title,description:e.article.content,image:s,url:m.canonicalUrl,price:(v=e.article.price)==null?void 0:v.toString(),availability:S.upperFirst(e.article.status),sellerName:e.article.user.nickname}),p=e.article.region.countryCode?Ht(e.article.region.countryCode.toLowerCase()):e.karrotLocalCountryCode;return di([...l,...si({path:m.normalizedPath,karrotLocalCountryCode:p,stage:e.stage,selfHreflang:!0}),...ri(o("FleamarketArticleDetailPage.meta_title",{title:e.article.title})),...ni(e.article.content.replace(/\s+/g," ").trim()),...oi(e.karrotLocalCountryCode,(b=e.article.images[0])==null?void 0:b.url),{name:"twitter:card",content:"summary_large_image"},{property:"og:type",content:"article"},...S.isNil(c)?[]:Xe.buySellDetailPage(c,e.karrotLocalCountryCode),Xe.breadcrumbList([{url:`${e.origin}${rt.BUY_SELL}`,label:o("Breadcrumbs.buy-and-sell")},{label:e.article.title}])??{},...ci({shouldBlock:e.shouldBlock})])};function Fs(){var Ue,Oe,Fe,He,We,qe;const{article:e,karrotLocalCountryCode:i,stage:o,userRole:l}=_t(),{user:n,regionIdFromURL:m,currentUserLocation:g}=Jt(),s=hi();$t({regionIdFromURL:m});const[c,p]=x.useState(e.status),[C,v]=x.useState(e.visible),[b,f]=x.useState(!1),[B,_]=x.useState(e.isChattedByMe),[U,R]=x.useState(e.isWatchedByMe),[lt,he]=x.useState(e.watchesCount);x.useEffect(()=>{p(e.status),v(e.visible),_(e.isChattedByMe),f(!1),R(e.isWatchedByMe),he(e.watchesCount)},[e.id,e.isWatchedByMe,e.watchesCount]);const Le=x.useRef(null),me=x.useRef(null),[ct,dt]=x.useState(!0);x.useEffect(()=>{const a=me.current;if(!a)return;const r=()=>dt(Ze(a));r(),a.addEventListener("scroll",r,{passive:!0});const h=new ResizeObserver(r);h.observe(a);for(const d of a.children)h.observe(d);return()=>{a.removeEventListener("scroll",r),h.disconnect()}},[]),x.useEffect(()=>{const a=Le.current,r=me.current;if(!a||!r)return;const h=d=>{if(r.scrollHeight-r.clientHeight<=0)return;const j=d.deltaMode===1?d.deltaY*16:d.deltaMode===2?d.deltaY*r.clientHeight:d.deltaY,re=r.scrollTop<=0,Bt=Ze(r);(j>0&&!Bt||j<0&&!re)&&(d.preventDefault(),r.scrollTop+=j)};return a.addEventListener("wheel",h,{passive:!1}),()=>a.removeEventListener("wheel",h)},[]);const Te=Ut(),{login:ut}=Ua(),{mutate:ht,isPending:mt}=ti(),{mutate:gt,isPending:pt}=ai(),ft=()=>{if(!n){Qt({loginButtonPosition:"ARTICLE_PAGE",countryCode:i,serviceName:null}),ut({redirectPath:Te.pathname+Te.search});return}const a=U,r=!a;R(r),he(y=>Math.max(0,y+(r?1:-1)));const h=()=>{R(a),he(y=>Math.max(0,y+(r?-1:1))),s.error({text:r?"Failed to add to favorites. Please try again.":"Failed to remove from favorites. Please try again."})};(r?ht:gt)({articleId:String(e.id)},{onError:h})},W=t.jsx(Ui,{watched:U,onClick:ft,disabled:mt||pt}),[Ct,yt]=x.useState(0),Z=L(!1),Ae=x.useCallback(a=>{yt(a),Z.activate()},[Z.activate]),q=L(!1),ge=L(!1),ee=L(!1),te=L(!1),pe=L(!1),ae=L(!1),$=L(!1),[O,xt]=x.useState(null),w=L(!1),{mutate:St,isPending:vt}=Ka(),{navigateToNormalizedUrl:bt}=Vt(),jt=Oa(),{onEdit:ie}=Qa({productCountryCode:i,productNodeId:e.nodeId}),[Et,Re]=x.useState(""),{moveToApp:fe,isQrModalOpen:we,setQrModalStatus:Me}=zt(),{mutate:kt,isPending:Ne}=Ja(),{mutate:It,isPending:De}=Xa(),{mutate:Lt,isPending:Ce}=Za(),Pe=vi({createdAt:e.createdAt,boostedAt:e.publishedAt,republishCount:e.republishCount,karrotLocalCountryCode:i}),se=bi({images:e.images.map(a=>a.url),category:{thumbnail:e.category.thumbnailUrl}}),Be=gi({karrotLocalCountryCode:i,stage:o,userNickname:e.user.nickname||""}),Tt=()=>{vt||St({articleId:String(e.id)},{onSuccess:()=>{c===A.Reserved&&s.success({text:E.Success.ReserveToActive}),Y({articleId:e.id,countryCode:i,serviceName:k.BUY_SELL,fleamarketArticleStatusType:"ON_GOING"}),p(A.Ongoing)},onError:()=>{s.error({text:E.Error.MarkAsAvailable})}})},At=async()=>{try{return await Q.getInstance().karrotmarket.getStartChatPermission({articleId:String(e.id)}),{ok:!0}}catch(a){return fa(a)}},Rt=async a=>{f(!0);const r=await At();if(!r.ok){switch(f(!1),r.reason.type){case ne.ErrorType.ERROR_TYPE_FLEAMARKET_REQUIRED_CHECK_IN:ge.activate();return;
3case ne.ErrorType.ERROR_TYPE_FLEAMARKET_USER_NEEDS_TO_LINEUP_QUEUE_ON_ARTICLE:ae.activate();return;case ne.ErrorType.ERROR_TYPE_FLEAMARKET_REQUIRED_CHANGE_REGION:xt({title:r.reason.serverTitle??"Change your neighborhood",message:r.reason.serverMessage??"This listing isn't in your current neighborhood. Switch to your other verified neighborhood in the Karrot app to start chatting."}),$.activate();return;default:s.error({text:r.reason.message})}return}const h=a.trim();if(S.isNil(n==null?void 0:n.id)||S.isNil(e.user.id)||h.length===0){f(!1);return}try{await Wi({articleDbId:String(e.id),senderId:n.id,receiverId:String(e.user.id),resourceType:qa.FLEA,message:h}),Ve({chatWidgetPosition:"ARTICLE_PAGE",countryCode:i,serviceName:k.BUY_SELL}),_(!0)}catch(d){if($a(d)){const y=S.get(Va,d.status,"Unable to send message. Please try again later.");s.error({text:y});return}s.error({text:"Unable to send message. Please try again later."})}finally{f(!1)}},wt=()=>{if(!(S.isNil(n==null?void 0:n.id)||S.isNil(e.user.id))){if(Ve({chatWidgetPosition:"ARTICLE_PAGE",countryCode:i,serviceName:k.BUY_SELL}),e.channelId){ot({channelId:e.channelId});return}try{Oi({articleDbId:String(e.id),senderId:n.id,receiverId:String(e.user.id)})}catch{s.error({text:"Unable to see chat. Please try again later."})}}},_e=()=>{Ne||kt({articleId:String(e.id)},{onSuccess:()=>{s.success({text:E.Success.Hide}),Y({articleId:e.id,countryCode:i,serviceName:k.BUY_SELL,fleamarketArticleStatusType:"HIDE"}),v(!1)},onError:a=>{var h,d,y,j;const r=E.Error.Hide;if(xe(a)){S.isNil((d=(h=a.message)==null?void 0:h.message)==null?void 0:d.text)&&H(a),s.error({text:((j=(y=a.message)==null?void 0:y.message)==null?void 0:j.text)??r});return}H(a),s.error({text:r})}})},Mt=()=>{De||It({articleId:String(e.id)},{onSuccess:()=>{Y({articleId:e.id,countryCode:i,serviceName:k.BUY_SELL,fleamarketArticleStatusType:"UNHIDE"}),s.success({text:E.Success.Unhide}),v(!0)},onError:a=>{var h,d,y,j,re;const r=E.Error.Unhide;if(xe(a)){if(S.isNil((d=(h=a.message)==null?void 0:h.message)==null?void 0:d.text)&&H(a),((y=a.message)==null?void 0:y.type)===ne.ErrorType.ERROR_TYPE_FLEAMARKET_REQUIRED_CHECK_IN){ee.activate();return}s.error({text:((re=(j=a.message)==null?void 0:j.message)==null?void 0:re.text)??r});return}H(a),s.error({text:r})}})},Nt=()=>{Yt({articleId:e.id,countryCode:i,serviceName:k.BUY_SELL}),!Ce&&Lt({articleId:String(e.id)},{onSuccess:()=>{Y({articleId:e.id,countryCode:i,serviceName:k.BUY_SELL,fleamarketArticleStatusType:"DELETE"}),w.deactivate(),bt({pathname:`/${i}/my-karrot/listings/`})},onError:a=>{var h,d,y,j;const r=E.Error.Delete;if(xe(a)){S.isNil((d=(h=a.message)==null?void 0:h.message)==null?void 0:d.text)&&H(a),s.error({text:((j=(y=a.message)==null?void 0:y.message)==null?void 0:j.text)??r});return}H(a),s.error({text:r})}})},Dt=()=>{Re("Scan the QR code to boost your listing to get more views!"),Gt({articleId:Number(e.id),boostUpButtonPosition:"ARTICLE_PAGE",countryCode:i,serviceName:k.BUY_SELL}),fe({position:Se.DetailPage,appScheme:z.Mobile.ArticleDetail(e.id.toString())})},Pt=()=>
3{Re("Scan the QR code to write review."),Kt({articleId:Number(e.id),countryCode:i,serviceName:k.BUY_SELL}),fe({position:Se.DetailPage,appScheme:z.Mobile.ArticleDetail(e.id.toString())})},ye=Ce||Ne||De;return t.jsxs(t.Fragment,{children:[t.jsx(Fa,{isAuthenticated:l!==F.loggedOut,style:{position:"sticky",zIndex:1}}),t.jsxs(u,{as:"main",children:[t.jsxs(u,{as:"article",direction:{s:"column",l:"row"},className:Zt,children:[t.jsx(J,{hide:{s:!1,l:!0},children:t.jsx("section",{className:ea,children:t.jsx(it,{"data-gtm":K.BuySellPageCarousel,slides:se,articleTitle:e.title,onTileClick:Ae})})}),t.jsx(J,{hide:{s:!0,l:!1},children:t.jsx(u,{className:ta,attributes:{ref:Le},children:t.jsx(it,{"data-gtm":K.BuySellPageCarousel,slides:se,articleTitle:e.title,onTileClick:Ae})})}),t.jsxs(u,{width:{s:"100%",l:"40%"},grow:!1,shrink:!1,paddingStart:{s:0,l:4,xl:6},paddingTop:{s:6,l:0},className:aa,children:[t.jsxs("div",{ref:me,className:ia,tabIndex:0,"aria-label":"Listing details",children:[t.jsxs(u,{gap:2,children:[t.jsx(J,{hide:{s:!0,l:!1},children:t.jsxs(be,{separator:t.jsx(je,{size:12}),children:[t.jsx(X,{href:jt({pathname:`/${i}/buy-sell/all/`,intent:"continue"}),children:t.jsx(be.Item,{children:t.jsx(N,{color:"neutral-faded",variant:"body-3",children:"Buy & Sell"})})}),t.jsx(be.Item,{children:t.jsx(N,{color:"neutral-faded",variant:"body-3",weight:"bold",children:e.title})})]})}),t.jsx("h1",{className:sa,children:e.title}),t.jsx(N,{color:"neutral",variant:"featured-2",weight:"bold",children:G({karrotLocalCountryCode:i,listingType:e.listingType,price:e.price,priceDescription:e.priceDescription})})]}),t.jsxs(u,{direction:"row",justify:"space-between",align:"end",paddingTop:l===F.owner?0:4,children:[t.jsxs(D.Root,{size:"medium",children:[(Ue=e.tradingLocation)!=null&&Ue.relativeDistanceDescription?t.jsx(D.Item,{ellipsis:!0,children:(Oe=e.tradingLocation)==null?void 0:Oe.relativeDistanceDescription}):null,t.jsx(D.Item,{children:t.jsx(Ga,{dateTime:Pe.dateTime,children:Pe.label})})]}),l===F.owner&&!S.isNil(n)?t.jsxs(u,{direction:"row",gap:2,align:"center",children:[t.jsx(ra,{status:c,onOngoingClick:Tt,onReservedClick:te.activate,onSoldClick:pe.activate}),Ee({status:c,isHidden:!C}).with({status:A.Ongoing,isHidden:!1},()=>t.jsx(ce.Ongoing,{loading:ye,onEditClick:ie,onBoostClick:Dt,onHideClick:_e,onDeleteListingClick:w.activate})).with({status:A.Reserved,isHidden:!1},()=>t.jsx(ce.Reserved,{onEditClick:ie,onWhoReservedClick:te.activate})).with({status:A.Closed,isHidden:!1},()=>t.jsx(ce.Sold,{loading:ye,onEditClick:ie,onWriteReviewClick:Pt,onHideClick:_e,onDeleteListingClick:w.activate})).with({isHidden:!0},()=>t.jsx(ce.Hidden,{loading:ye,onUnhideClick:Mt,onEditClick:ie,onDeleteListingClick:w.activate})).otherwise(()=>null),t.jsx(fi,{open:te.active,onClose:te.deactivate,article:{dbId:String(e.id),title:e.title,price:G({karrotLocalCountryCode:i,listingType:e.listingType,price:e.price,priceDescription:e.priceDescription}),thumbnailUrl:et({thumbnail:(Fe=e.images[0])==null?void 0:Fe.thumbnailUrl,category:{thumbnail:e.category.thumbnailUrl}}),favoriteCount:e.watchesCount,chatCount:e.chatRoomsCount},onMarkAsReservedSuccess:()=>{s.success({text:E.Success.MarkAsReserved}),p(A.Reserved)},onMarkAsReservedError:()=>{s.error({text:E.Error.MarkAsReserved})}}),t.jsx(Ci,{open:pe.active,onClose:pe.deactivate,article:{dbId:String(e.id),title:e.title,price:G({karrotLocalCountryCode:i,listingType:e.listingType,price:e.price,priceDescription:e.priceDescription}),thumbnailUrl:et({thumbnail:(He=e.images[0])==null?void 0:He.thumbnailUrl,category:{thumbnail:e.category.thumbnailUrl}}),favoriteCount:e.watchesCount,chatCount:e.chatRoomsCount},onMarkAsSoldSuccess:()=>{s.success({text:E.Success.MarkAsSold}),p(A.Closed)},onMarkAsSoldError:()=>{s.error({text:E.Error.MarkAsSold})}}),t.jsx($e,{subTitle:"Continue on Karrot",description:Et,open:we,onClose:()=>{Me(!1)},qrLink:z.Web.ArticleDetail(e.id.toString())}),t.jsx(oe.EventTracker,{countryCode:i,permissionType:"unhide_article",children:t.jsx(oe.Modal,{open:ee.active,onClose:ee.deactivate,nickname:n.nickname,locationName:(We=le(n.userLocations))==null?void 0:We.name,checkInCount:(qe=le(n.userLocations))==null?void 0:qe.checkinCount,sendLocationVerificationNotification:{action:()=>Q.getInstance().karrotmarket.sendLocationVerificationNotification(),onError:()=>{s.error({text:"Failed to send location verification notification. Please try again."})}},checkLocationVerification:{action:()=>Q.getInstance().karrotmarket.changeArticleVisible({articleId:String(e.id)}),onSuccess:()=>{s.success({text:E.Success.Unhide}),Y({articleId:e.id,countryCode:i,serviceName:k.BUY_SELL,fleamarketArticleStatusType:"UNHIDE"}),v(!0),ee.deactivate()},onError:a=>{if(ze(a)){s.error({text:"Failed to check location verification. Please try again."});return}s.error({text:"Something went wrong. Please try again."})}}})}),t.jsx(ei,{open:w.active,onClose:w.deactivate,onConfirm:Nt,onCancel:w.deactivate,isDeletingArticle:Ce})]}):null]}),t.jsx(u,{paddingTop:6,children:t.jsx(Ha,{width:6,height:"3px"})}),t.jsxs(u,{paddingTop:6,gap:6,children:[e.listingType===ya.Trade&&!S.isNil(e.inSearchOf)&&t.jsx(na,{inSearchOf:e.inSearchOf,tradeFAQHref:Ot[o]}),t.jsx(N,{color:"neutral",variant:"body-2",className:oa,children:e.content}),e.articlePropertyContents.length>0&&t.jsx(la,{articlePropertyContents:e.articlePropertyContents})]}),t.jsxs(u,{paddingTop:9,children:[e.tradingLocation&&!Be?t.jsxs(ca,{fallback:t.jsx("div",{}),children:[t.jsxs(u,{gap:2,children:[t.jsx(N,{as:"h2",variant:"body-3",weight:"bold",color:"neutral-faded",className:ve,children:"WHERE TO MEET"}),l===F.loggedOut?t.jsx(da,{name:e.tradingLocation.name,onClick:q.activate,showIcon:!1}):t.jsx(ua,{latitude:e.tradingLocation.latitude,longitude:e.tradingLocation.longitude,name:e.tradingLocation.name,onClick:q.activate}),t.jsx(nt,{size:"large",fullWidth:!0,onClick:q.activate,children:"View Map"})]}),t.jsx(yi,{latitude:e.tradingLocation.latitude,longitude:e.tradingLocation.longitude,open:q.active,onClose:()=>{q.deactivate()}})]}):null,t.jsxs(u,{gap:3,paddingTop:9,children:[t.jsx(N,{as:"h2",variant:"body-3",weight:"bold",color:"neutral-faded",className:ve,children:"SELLER"}),t.jsx(pi,{karrotUser:{id:`/${i}/users/${e.user.nodeId}/`,nickname:e.user.nickname,profileImage:e.user.profileImageUrl,isPersonaVerified:e.user.isPersonaVerified,score:e.user.score,scoreSymbol:e.user.scoreSymbolImageUrl,reviewCount:e.user.receivedReviewCount,region:{dbId:String(e.region.id),name:e.region.name,countryCode:e.region.countryCode},locationName:{name:e.user.locationName}},dataGtm:{profileImage:K.BuySellPageProfileImage,nickname:K.BuySellPageProfileNickname,region:K.BuySellPageProfileRegion}})]})]}),t.jsx(u,{paddingTop:6,paddingBottom:e.chatEnabled?5:0,children:t.jsxs(D.Root,{size:"medium",children:[t.jsxs(D.Item,{children:[e.chatRoomsCount," chats"]}),t.jsxs(D.Item,{children:[lt," favorites"]}),t.jsxs(D.Item,{children:[e.readsCount," views"]})]})}),t.jsx("div",{className:ha,"data-at-bottom":ct,"aria-hidden":!0})]}),t.jsx("div",{className:ma,children:t.jsxs(u,{direction:"column",align:"stretch",gap:3,children:[l!==F.owner&&e.chatEnabled&&t.jsx(N,{as:"h2",variant:"body-3",weight:"bold",color:"neutral-faded",className:ve,children:"SEND CHAT TO SELLER"}),t.jsx(u.Item,{className:ga,children:l!==F.owner&&e.chatEnabled?Ee({buyer:n,seller:{nickname:e.user.nickname??""},productStatus:c,isChattedByMe:B}).with({buyer:I.nullish},({seller:a})=>t.jsx(de.Unauthenticated,{seller:a,productDbId:String(e.id),watchButton:W})).with({buyer:I.not(I.nullish),productStatus:A.Closed,isChattedByMe:!1},({buyer:a})=>t.jsx(de.SoldOut,{buyer:a,watchButton:W})).with({buyer:I.not(I.nullish),isChattedByMe:!0},({buyer:a})=>t.jsx(de.ExistingChat,{buyer:a,productDbId:String(e.id),onSeeChat:wt,watchButton:W})).with({buyer:I.not(I.nullish),isChattedByMe:!1},({buyer:a,seller:r})=>{var h,d;return t.jsxs(t.Fragment,{children:[t.jsx(de.CreateChat,{buyer:a,seller:r,productDbId:String(e.id),onSend:Rt,loading:b,watchButton:W}),t.jsx(oe.EventTracker,{countryCode:i,permissionType:"open_chat",children:t.jsx(oe.Modal,{open:ge.active,onClose:ge.deactivate,nickname:a.nickname,locationName:(h=le(a.userLocations))==null?void 0:h.name,checkInCount:(d=le(a.userLocations))==null?void 0:d.checkinCount,sendLocationVerificationNotification:{action:()=>Q.getInstance().karrotmarket.sendLocationVerificationNotification(),onError:()=>{s.error({text:"Failed to send location verification notification. Please try again."})}},checkLocationVerification:{action:()=>Q.getInstance().karrotmarket.getStartChatPermission({articleId:String(e.id)}),onSuccess:()=>{s.success({text:"Check location verification successful."})},onError:y=>{if(ze(y)){s.error({text:"Failed to check location verification. Please try again."});return}s.error({text:"Something went wrong. Please try again."})}}})}),t.jsx(M,{title:(O==null?void 0:O.title)??"Change your neighborhood",description:(O==null?void 0:O.message)??"",open:$.active,onClose:$.deactivate,children:t.jsxs(M.ButtonGroup,{children:[t.jsx(M.Cancel,{onClose:$.deactivate,children:"Cancel"}),t.jsx(M.Action,{color:"primary",onClick:()=>{$.deactivate(),fe({position:Se.ModalChangeRegionRequired,serviceName:k.BUY_SELL,appScheme:z.Mobile.ArticleDetail(e.id.toString())})},children:"Change in the Karrot app"})]})}),t.jsx($e,{subTitle:"Continue on Karrot",description:"Scan the QR code to change your neighborhood in the app.",open:we,onClose:()=>{Me(!1)},qrLink:z.Web.ArticleDetail(e.id.toString())}),t.jsx(M,{title:"Reserved listing",description:"You can't chat on a reserved listing.",open:ae.active,onClose:ae.deactivate,children:t.jsx(M.ButtonGroup,{children:t.jsx(M.Cancel,{onClose:ae.deactivate,children:"Okay"})})})]})}).otherwise(()=>null):W})]})})]})]}),e.recommendedArticles.length>0?t.jsxs(u,{as:"section",paddingInline:4,paddingTop:6,paddingBottom:4,gap:4,children:[t.jsx(at,{title:"You might also like",moreLabel:"See more",moreHref:`/${i}${rt.BUY_SELL}${Wa.stringify({regionId:String(e.region.id),categoryId:String(e.category.id)},g?{id:String(g.userRegion.id),name:g.userRegion.name}:{id:String(e.region.id),name:e.region.name})}`}),t.jsx(u,{className:Ye,children:e.recommendedArticles.map(a=>{const r=a.status.toLowerCase();return Qe(r)?t.jsx(X,{href:`/${i}/buy-sell/${a.nodeId}/`,className:Ge,children:t.jsxs(T.Root,{className:Ke,children:[t.jsx(T.Image,{thumbnail:a.firstImage.thumbnailUrl,alt:a.title,status:r}),t.jsxs(u,{children:[t.jsx(T.Price,{price:G({karrotLocalCountryCode:i,listingType:a.listingType,price:a.price,priceDescription:a.priceDescription})}),t.jsx("h3",{children:t.jsx(T.Title,{title:a.title})}),a.relativeDistanceDescription||a.displayLocationName?t.jsx(T.Distance,{description:a.relativeDistanceDescription,displayLocationName:a.displayLocationName}):null]})]})},a.id):null})})]}):null,!Be&&e.userArticles.length>0?t.jsxs(u,{as:"section",paddingInline:4,paddingTop:6,paddingBottom:4,gap:4,children:[t.jsx(at,{title:`Other listings by ${e.user.nickname}`,moreLabel:"Show all",moreHref:`/${i}/users/${e.user.nodeId}/`}),t.jsx(u,{className:Ye,children:e.userArticles.map(a=>{const r=a.status.toLowerCase();return Qe(r)?t.jsx(X,{href:`/${i}/buy-sell/${a.nodeId}/`,className:ue(Ge,Ca),children:t.jsxs(T.Root,{className:Ke,children:[t.jsx(T.Image,{thumbnail:a.firstImage.thumbnailUrl,alt:a.title,status:r}),t.jsxs(u,{children:[t.jsx(T.Price,{price:G({karrotLocalCountryCode:i,listingType:a.listingType,price:a.price,priceDescription:a.priceDescription})}),t.jsx("h3",{children:t.jsx(T.Title,{title:a.title})})]})]})},a.id):null})})]}):null]}),t.jsx(u,{paddingBlock:12,paddingInline:4,children:t.jsx(ui,{})}),t.jsx(mi,{}),t.jsx(pa,{index:Ct,open:Z.active,close:()=>{Z.deactivate()},slides:se.map((a,r)=>
3({src:a.src,alt:`${e.title} - photo ${r+1} of ${se.length}`}))})]})}export{Fs as default,Os as meta}; 4//# sourceMappingURL=(_lang).buy-sell._buy_sell_id-H7sACo9c.js.map 5 6//# debugId=6941eff7-f10e-5eb2-8f4a-4d8597dda8e6
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.