1import{a as X}from"./chunk-YV6XQMVJ.js";import{a as j,b as H,c as W,d as Y,e as y,k as q,l as G,m as J}from"./chunk-7FOIO444.js";import{a as Q}from"./chunk-IJJ4FMOI.js";import{a as $}from"./chunk-WQ4PZYG4.js";import{G as z}from"./chunk-COBNBFGF.js";import"./chunk-P52SAZ7N.js";import"./chunk-G3PWCLSY.js";import"./chunk-372BPJQ3.js";import"./chunk-AFVSMPBC.js";import"./chunk-JUAHV2TC.js";import{a as U}from"./chunk-RMFEZUNF.js";import"./chunk-BXOGPMZZ.js";import"./chunk-NRC4EHFH.js";import"./chunk-S2LG7ZZI.js";import{a as O}from"./chunk-FRZHUY6N.js";import"./chunk-32B64V2R.js";import"./chunk-3XLVKQRY.js";import"./chunk-DJ5AJG3T.js";import"./chunk-SLPC3Y4V.js";import"./chunk-XIRWNEM2.js";import"./chunk-AAORKXGN.js";import"./chunk-KDGXQRVY.js";import"./chunk-Q2KKZV5J.js";import"./chunk-JICM7NVH.js";import{a as L}from"./chunk-AB6CKZTE.js";import{c as V,d as K,e as B}from"./chunk-DIGPPQJE.js";import{o as F,x as D}from"./chunk-EU6HCBUP.js";import"./chunk-KAJMKXZ6.js";import"./chunk-ZAQTNZYS.js";import"./chunk-SRTXE2HR.js";import{Ba as a,Ib as T,Jb as m,Lb as R,Nb as I,Rb as b,Ub as N,Uc as u,Vb as A,Vc as _,Wb as s,Xb as p,Yb as l,ac as C,da as c,db as r,gc as h,hc as d,la as g,ld as v,ma as f,sa as E,sb as w,t as S,uc as P,vc as k,yb as x}from"./chunk-NTTV6FWH.js";import"./chunk-W7GRJBO5.js";var ee=(i,n)=>n.id;function te(i,n){if(i&1){let e=C();l(0,"i",6),s(1,"h1",7),P(2),u(3,"translate"),p(),s(4,"button",8),u(5,"translate"),u(6,"translate"),h("click",function(){g(e);let o=d();return f(o.refresh())}),l(7,"i",9),p()}if(i&2){let e=n,t=d();I("pi "+e.icon),r(2),k(_(3,8,e.title)),r(2),m("disabled",t.refreshing()),T("aria-label",_(5,10,"APP.MARKET.REFRESH"))("title",_(6,12,"APP.MARKET.REFRESH")),r(3),R("pi-spin",t.refreshing())}}function ie(i,n){i&1&&l(0,"app-mp-state",2)}function ne(i,n){i&1&&(s(0,"div",3),l(1,"i",10),s(2,"span",11),P(3),u(4,"translate"),p()()),i&2&&(r(3),k(_(4,1,"COMMON.LOADING")))}function oe(i,n){if(i&1){let e=C();s(0,"app-mp-state",12),h("action",function(){g(e);let o=d();return f(o.retry())}),p()}i&2&&m("error",!0)}function ae(i,n){i&1&&l(0,"app-mp-state",5)}function re(i,n){if(i&1&&l(0,"app-marketplace-product-card",14),i&2){let e=n.$implicit;m("product",e)}}function se(i,n){if(i&1){let e=C();s(0,"div",13),N(1,re,1,1,"app-marketplace-product-card",14,ee),p(),s(3,"app-mp-load-more",15),h("retry",function(){g(e);let o=d();return f(o.loadMore(!0))}),p(),s(4,"span",16),h("nearEnd",function(){g(e);let o=d();return f(o.loadMore())}),p()}if(i&2){let e=d();r(),A(e.products()),r(2),m("loading",e.loadingMore())("failed",e.showRetry()),r(),m("nearEndKey",e.products().length)}}var Z=class i{static LIMIT=20;route=c(F);api=c(j);seo=c(U);translate=c(V);destroyRef=c(E);ssrStatus=c($,{optional:!0});section=a(null);notFound=a(!1);products=a([]);loading=a(!0);loadingMore=a(!1);hasError=a(!1);hasMore=a(!1);backoff=a(new y);refreshing=a(!1);showRetry=v(()=>this.backoff().hasFailed&&this.hasMore());def=v(()=>W.find(n=>n.key===this.section())||null);categoryId=null;cursor=null;generation=0;ngOnInit(){S([this.route.paramMap,this.route.queryParamMap]).pipe(O(this.destroyRef)).subscribe(([n,e])=>{let t=n.get("section");if(this.categoryId=e.get("category")||null,!H(t)){this.section.set(null),this.notFound.set(!0),this.loading.set(!1),this.seo.disableFollow(),this.ssrStatus&&(this.ssrStatus.code=404);return}this.notFound.set(!1),this.section.set(t),this.seo.enableFollow(),this.applySeo(),this.products.set([]),this.load()}),this.translate.onLangChange.pipe(O(this.destroyRef)).subscribe(()=>this.section()&&this.applySeo())}applySeo(){let n=this.def();if(!n)return;let e=this.translate.instant(n.title),t=this.translate.instant("APP.MARKET.SECTION_SEO_TITLE",{section:e});this.seo.updateTitle(t),this.seo.updateDescription(this.translate.instant("APP.MARKET.SECTION_SEO_DESC",{section:e}));let o=`a/marketplace/section/${n.key}`;this.seo.updateCanonical(o),this.seo.updateOgUrl(`${L.app}/${o}`),this.seo.updatePageOgImage(t)}load(n=!0){let e=this.section();if(!e)return Promise.resolve();let t=++this.generation;return n&&this.loading.set(!0),new Promise(o=>{this.api.products({page:1,limit:i.LIMIT,section:e,categoryId:this.categoryId}).subscribe({next:M=>{t===this.generation&&(this.products.set(M.data),this.cursor=M.nextCursor,this.hasMore.set(M.hasMore&&!!M.nextCursor),this.backoff.set(new y),this.hasError.
1set(!1),this.loading.set(!1)),o()},error:()=>{t===this.generation&&(this.hasError.set(this.products().length===0),this.loading.set(!1)),o()}})})}loadMore(n=!1){let e=this.section();if(!e||this.loadingMore()||!this.hasMore()||!n&&this.backoff().isCoolingDown())return;let t=this.generation;this.loadingMore.set(!0),this.api.products({cursor:this.cursor,limit:i.LIMIT,section:e,categoryId:this.categoryId}).subscribe({next:o=>{t===this.generation&&(this.products.set(Y(this.products(),o.data)),this.cursor=o.nextCursor,this.hasMore.set(o.hasMore&&!!o.nextCursor),this.backoff.set(new y),this.loadingMore.set(!1))},error:()=>{t===this.generation&&(this.backoff.set(this.backoff().nextFailure()),this.loadingMore.set(!1))}})}refresh(){this.refreshing()||(this.refreshing.set(!0),this.load(!1).finally(()=>this.refreshing.set(!1)))}retry(){this.load()}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=w({type:i,selectors:[["app-marketplace-section-page"]],decls:10,vars:2,consts:[["data-testid","mp-section-page",1,"mps-page"],[1,"mps-page__top"],["icon","pi-compass","message","APP.MARKET.SECTION_NOT_FOUND"],["role","status",1,"mps-page__spinner"],["icon","pi-exclamation-circle","message","COMMON.ERROR","actionLabel","COMMON.RETRY",3,"error"],["icon","pi-shopping-bag","message","COMMON.NO_RESULTS"],["aria-hidden","true"],[1,"mps-page__title"],["type","button",1,"mp-icon-btn",3,"click","disabled"],["aria-hidden","true",1,"pi","pi-refresh"],["aria-hidden","true",1,"pi","pi-spin","pi-spinner"],[1,"mp-sr"],["icon","pi-exclamation-circle","message","COMMON.ERROR","actionLabel","COMMON.RETRY",3,"action","error"],["data-testid","mp-section-grid",1,"mp-grid"],[3,"product"],[3,"retry","loading","failed"],["appNearEnd","",1,"mp-sentinel",3,"nearEnd","nearEndKey"]],template:function(e,t){if(e&1&&(s(0,"app-shell")(1,"div",0)(2,"header",1),l(3,"app-mp-back"),x(4,te,8,14),p(),x(5,ie,1,0,"app-mp-state",2)(6,ne,5,3,"div",3)(7,oe,1,1,"app-mp-state",4)(8,ae,1,0,"app-mp-state",5)(9,se,5,3),p()()),e&2){let o;r(4),b((o=t.def())?4:-1,o),r(),b(t.notFound()?5:t.loading()&&!t.products().length?6:t.hasError()&&!t.products().length?7:t.products().length?9:8)}},dependencies:[D,B,K,z,q,G,J,Q,X],styles:["[_nghost-%COMP%]{--paper: #0a0a14;--surface: #12121e;--surface-2: #1a1a2e;--ink: #ffffff;--ink-soft: rgba(255, 255, 255, .66);--ink-muted: rgba(255, 255, 255, .45);--accent: #2f8eef;--accent-bright: #54a6f6;--live: #ff3b30;--error: #ef4444;--border: rgba(255, 255, 255, .1);--border-soft: rgba(255, 255, 255, .06);--topbar: 64px;--story-ring-a: #ffc83a;--story-ring-b: #ff7a1a;--story-ring-seen: rgba(255, 255, 255, .22);display:block;color:var(--ink);font-family:Inter,system-ui,sans-serif;-webkit-font-smoothing:antialiased}[_nghost-%COMP%] *[_ngcontent-%COMP%]{box-sizing:border-box}[_nghost-%COMP%] button[_ngcontent-%COMP%]{font-family:inherit;cursor:pointer}[_nghost-%COMP%] a[_ngcontent-%COMP%]{color:inherit;text-decoration:none}[_nghost-%COMP%] [_ngcontent-%COMP%]:focus-visible{outline:2px solid var(--accent-bright);outline-offset:2px}.mp-icon-btn[_ngcontent-%COMP%]{flex-shrink:0;width:40px;height:40px;border-radius:50%;background:var(--surface-2);border:1px solid var(--border);color:var(--ink);display:inline-flex;align-items:center;justify-content:center}.mp-icon-btn[_ngcontent-%COMP%]:hover{border-color:var(--accent)}.mp-icon-btn[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:default}.mps-page[_ngcontent-%COMP%]{max-width:1280px;margin:0 auto;padding:0 0 32px}.mps-page__top[_ngcontent-%COMP%]{display:flex;align-items:center;gap:10px;padding:12px 16px}.mps-page__top[_ngcontent-%COMP%] > .pi[_ngcontent-%COMP%]{color:var(--accent-bright);font-size:19px}.mps-page__title[_ngcontent-%COMP%]{margin:0;flex:1;min-width:0;font-size:18px;font-weight:700}.mps-page__spinner[_ngcontent-%COMP%]{display:flex;justify-content:center;padding:80px 0;color:var(--accent-bright)}.mps-page__spinner[_ngcontent-%COMP%] .pi[_ngcontent-%COMP%]{font-size:28px}.mp-grid[_ngcontent-%COMP%]{padding:0 12px;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px 10px}@media (min-width: 600px){.mp-grid[_ngcontent-%COMP%]{grid-template-columns:repeat(3,minmax(0,1fr));gap:18px 14px}}@media (min-width: 1000px){.mp-grid[_ngcontent-%COMP%]{grid-template-columns:repeat(4,minmax(0,1fr))}}@media (min-width: 1300px){.mp-grid[_ngcontent-%COMP%]{grid-template-columns:repeat(5,minmax(0,1fr))}}.mp-sentinel[_ngcontent-%COMP%]{display:block;height:1px}.mp-sr[_ngcontent-%COMP%]{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}"]})};export{Z as MarketplaceSectionPageComponent};
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.