PageSourceSearch

https://cgp.omneky.com/assets/MarketTrends-CFWcR1mt.js

js omneky.com collected 2026-10-02 04:47:37 UTC 3,219 bytes, 2 lines download raw bytes

1import{u as b,h as B,r as o,g as N,l as U,i as G,f as P,cc as $,k as z,o as H,cd as _,j as s,F as y,bp as v,_ as K,a4 as L,B as O,a as Q,aV as q,ce as D}from"./index-DPTmGuAB.js";import{u as J,M as w,a as W,A as X}from"./MarketTrendCard-ZjdHmW9G.js";import{M as Y}from"./react-masonry-css.module-DGMBrZ1d.js";import"./useSwipeDownToDismiss-C0nelMZ5.js";import"./MultiSelect-BiPd_RU4.js";import"./Pill-BVN6toRf.js";import"./PillsInput-BCMmdG7_.js";import"./pick-calendar-levels-props-CRIPWTN7.js";import"./utc-C_TpHYAh.js";import"./ImageRenderComponent-DB26oM6L.js";import"./VideoRenderComponent-FKd2z5xd.js";import"./use-hover-B2XHP9_y.js";const Z={default:4,3840:8,2560:7,1920:6,1800:5,1600:4,1400:4,1100:3,700:3,500:2,300:2},fe=()=>{var M,T,C;const{t:A}=b(),{marketTrendsFilter:m,trendingAds:n}=B(e=>e.adGallery),g=o.useRef(null),{brandId:i}=N(),{brandOverviewData:l}=B(e=>e.library),{data:t,isLoading:ee}=U(i),u=G(),p=P("(max-width: 768px)",!1,{getInitialValueInEffect:!1});o.useEffect(()=>{var e,a;(e=t==null?void 0:t.country)!=null&&e.countryCode&&u($({...m,countryCode:(a=t==null?void 0:t.country)==null?void 0:a.countryCode}))},[t,(M=t==null?void 0:t.country)==null?void 0:M.countryCode]);const[r,E]=o.useState(null),[S,h]=o.useState(!1),[R,j]=o.useState(!1),V=z(),k=async e=>{if(!R)try{const a=q();j(!0);const F=e.displayFormat==="IMAGE",I=F?e.media.originalImageUrl:e.media.videoHdUrl;if(!I)throw new Error("Missing media URL for clone");u(D({storageKey:I,id:a})),V(`/brands/${i}/ads-central?panel=${encodeURIComponent(F?"cloneImage":"cloneAd")}`)}catch(a){console.log("error",a)}finally{j(!1)}},{isLoading:f,refetch:d,isFetching:c}=J(l==null?void 0:l.brandIndustryVerticalId,i);o.useEffect(()=>{i&&!(l!=null&&l.brandIndustryVerticalId)&&u(H({brandId:i}))},[i,u]);const x=_(g,{root:null,rootMargin:"200px",threshold:0});return o.useEffect(()=>{x&&!c&&d&&!f&&m.nextPageToken&&d(),x&&!c&&d&&!f&&m.nextPageTokens&&d()},[x,c,d]),s.jsxs(y,{w:"100%",h:"100%",direction:"column",px:p?"sm":"xl",children:[s.jsx(v,{pageName:"topBar.inspiration.title",pageSubtitle:"topBar.inspiration.subtitle",titleOrder:4}),!p&&s.jsx(w,{}),s.jsx(K,{opened:S,size:"xl",withCloseButton:p,centered:!0,onClose:()=>h(!1),children:s.jsx(W,{media:r==null?void 0:r.media,marketTrend:r,handleCloneAd:k,displayFormat:(r==null?void 0:r.displayFormat)??""})}),f?s.jsx(y,{justify:"center",w:"100%",align:"center",h:"100%",children:s.jsx(L,{})}):s.jsxs(O,{w:"100%",className:"market-trends-ads-container",children:[p&&s.jsx(w,{}),((T=n==null?void 0:n.ads)==null?void 0:T.length)===0&&!f&&!c&&s.jsx(y,{justify:"center",w:"100%",py:20,children:s.jsx(Q,{children:A("marketTrends.noAdsFound")})}),s.jsx(Y,{breakpointCols:Z,className:"my-masonry-grid",columnClassName:"my-masonry-grid_column",children:(C=n==null?void 0:n.ads)==null?void 0:C.map((e,a)=>s.jsx(X,{marketTrend:e,mediaType:m.format,media:e.media,pageLikeCount:e.pageLikeCount,startDate:e.startDate,displayFormat:e.displayFormat,setSelectedMarketTrend:()=>{E(e),h(!0)},handleCloneAd:k},`${a}`))}),c&&s.jsx(y,{justify:"center",w:"100%",py:20,children:s.jsx(L,{size:"sm"})}),s.jsx("div",{ref:g,style:{height:1}})]})]})};export{fe as default};
2//# sourceMappingURL=MarketTrends-CFWcR1mt.js.map

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.