PageSourceSearch

https://www.primeasialeather.com/_nuxt/NYDBUs6X.js

js primeasialeather.com collected 2026-10-04 04:48:26 UTC 8,593 bytes, 92 lines download raw bytes

1import{u as we,_ as xe}from"./B0RPnR4s.js";import{_ as Ie}from"./BBh4x5nN.js";import{_ as Se}from"./B600aGZ4.js";import{_ as Te,a as Ee}from"./DFwD7hVA.js";import{_ as be}from"./bEL2b6ch.js";import{_ as ke}from"./DFQP3GLc.js";import{_ as Le}from"./CV3S3PL6.js";import{a7 as qe,B as ce,_ as Be,u as Fe,G as Ae,r as u,m as Re,p as Pe,l as Ue,J as Ne,K as Oe,o as Qe,L as De,M as Me,a as Ve,N as ne,O as je,i as We,c as m,e as d,w as y,f as a,x as Ge,b as i,d as B,t as F,q as M,v as re,P as V,T as se,F as j,Q as ie,g as le,U as He,I as ze,H as Je}from"./C36qi_h9.js";import{L as Ke}from"./Vll99WRj.js";import{L as W}from"./D2RTnE32.js";import{g as G}from"./DR6UG414.js";import{h as Xe}from"./2bYFpNXT.js";import"./CVSDo_55.js";import"./msxPFqq6.js";import"./CgDTC7RO.js";import"./C1XEbZto.js";import"./C2Z0p9ac.js";import"./BooLpxbV.js";import"./DL814E_v.js";import"./YJygMotd.js";const Ye=G`
2  ${Ke}
3  ${W}
4
5  query LeathersIndex($limit: Int = 18, $orderBy: String = "dateCreated DESC") {
6    leathersIndexEntries(limit: 1) {
7      ... on templateLeathers_Entry {
8        seomatic(asArray: true) {
9          metaTitleContainer
10          metaTagContainer
11        }
12        title
13        slug
14        thumbnail {
15          ...LargeImage
16        }
17      }
18    }
19    leatherEntries(limit: $limit, orderBy: $orderBy) {
20      ...LeatherItem
21    }
22    total: entryCount(section: "leather")
23    leatherTypeCategoryEntries {
24      ... on categoryLeatherType_Entry {
25        title
26        slug
27        id
28      }
29    }
30    leatherFinishCategoryEntries {
31      ... on categoryLeatherFinish_Entry {
32        title
33        slug
34        id
35      }
36    }
37    leatherTextureCategoryEntries {
38      ... on categoryLeatherTexture_Entry {
39        title
40        slug
41        id
42      }
43    }
44  }
45`,ue=G`
46  ${W}
47
48  query FilteredLeathers(
49    $limit: Int = 18
50    $offset: Int = 0
51    $leatherType: [QueryArgument]
52    $texture: [QueryArgument]
53    $finish: [QueryArgument]
54    $collection: [QueryArgument]
55    $waterproof: Boolean = null
56    $orderBy: String = "dateCreated DESC"
57  ) {
58    leatherEntries(
59      limit: $limit
60      offset: $offset
61      leatherType: $leatherType
62      texture: $texture
63      finish: $finish
64      collections: $collection
65      waterproof: $waterproof
66      orderBy: $orderBy
67    ) {
68      ...LeatherItem
69    }
70    total: entryCount(
71      section: "leather"
72      leatherType: $leatherType
73      texture: $texture
74      finish: $finish
75      collections: $collection
76      waterproof: $waterproof
77    )
78  }
79`,Ze=G`
80  ${W}
81
82  query PaginatedLeathers(
83    $limit: Int = 18
84    $offset: Int = 0
85    $orderBy: String = "dateCreated DESC"
86  ) {
87    leatherEntries(limit: $limit, offset: $offset, orderBy: $orderBy) {
88      ...LeatherItem
89    }
90    total: entryCount(section: "leather")
91  }
92`;function et(T){const c=we();return c==null?void 0:c.initIndex(T)}function tt(T){const c=T,S=et(c),r=qe(`${c}-search-result`,()=>null),E=async({query:l,requestOptions:h})=>{const _=await S.search(l,h);return r.value=_,_};return{result:ce(()=>r.value),search:E}}const at={class:"title t-h2"},ot={key:0,class:"search-title"},nt={class:"t-h4"},rt={key:1,class:"numb"},st={key:0},it={key:1,class:"t-h3"},I=18,lt={__name:"index",async setup(T){var te,ae;let c,S;const r=Fe(),E=Ae(),l=u(((te=r==null?void 0:r.query)==null?void 0:te.sort)||"newest"),{data:h}=([c,S]=Re(()=>Ge(Ye,{limit:I,orderBy:l.value==="newest"?"dateCreated DESC":"title ASC"})),c=await c,S(),c),_=h.value.leathersIndexEntries[0],H=u(h.value.leatherEntries),b=u(h.value.total),A=+((ae=r==null?void 0:r.query)==null?void 0:ae.page)||1;_!=null&&_.seomatic&&Pe(Xe(_.seomatic)),Ue();const w=u(r.query.search||""),k=u(),{result:R,search:z}=tt("Leathers"),fe=u(null),L=u(),J=u(),P=u(),v=u(!1),g=u(!1),$=u(!1),U=[{id:"leatherType",title:"Leather Type",options:h.value.leatherTypeCategoryEntries},{id:"texture",title:"Texture",options:h.value.leatherTextureCategoryEntries},{id:"finish",title:"Finish",options:h.value.leatherFinishCategoryEntries},{id:"is-waterproof",title:"Waterproof",options:[{title:"Waterproof",slug:"waterproof",id:"waterproof"},{title:"Non-Waterproof",slug:"non-waterproof",id:"non-waterproof"}]}],K={requestOptions:{hitsPerPage:50}};function X(){return U.map(e=>({id:e.id,value:[]}))}const x=Ne(X()),N=ce(()=>x.some(e=>e.value.length>0));Oe(()=>r.query.page,(e,t)=>{O(e)});function Y(){g.value=!1,v.value=!0;const e={limit:I,orderBy:l.value==="newest"?"dateCreated DESC":"title ASC"};ee(e);const{onResult:t}=ne(ue,e);t(o=>{o!=null&&o.data&&(Q(o.data),D(1,!0))}),$.value&&q()}function Z(e=!0){v.value=!0,g.value=!1,Object.assign(x,X()),Q(h.value),D(1,!0,e),$.value&&q()}function pe(){L.value.testScroll()}Qe(async()=>{const{$apollo:e}=De();Me(e.defaultClient),w.value?(g.value=!0,await z({...K,query:w.value}),k.value.setQuery(w.value),v.value=!1):Object.keys(r==null?void 0:r.query).length?de():v.value=!1,(N.value||A>1)&&O(A)}),Ve(()=>{});async function me(e){e&&(g.value=!0,w.value=e,await z({...K,query:w.value}),E.push({query:{search:e}}))}function de(){for(const[e,t]of Object.entries(r.query)){const o=x.find(s=>s.id.replace("is-","")===e);if(o){const s=decodeURIComponent(t).split(",");o.value=s}}}function he(){Je(),$.value=!0}async function q(){$.value=!1,ze(),setTimeout(()=>{J.value.$el.scrollTop=0},600)}function ee(e){x.forEach((t,o)=>{if(t.value.length)if(t.id==="is-waterproof")t.value.length===1&&(e.waterproof=t.value[0]==="waterproof");else{const s=t.value.map(n=>U[o].options.find(p=>p.slug===n).id);e[t.id]=s}})}async function O(e){v.value=!0;const t={limit:I,offset:I*(e-1),orderBy:l.value==="newest"?"dateCreated DESC":"title ASC"};let o;N.value?(ee(t),o=ue):o=Ze;const{onResult:s}=ne(o,t);s(async n=>{n!=null&&n.data&&(Q(n.data),D(e))})}async function Q(e){H.value=e.leatherEntries,b.value=e.total,v.value=!1}async function D(e,t=!1,o=!0){const s={};if(N.value){const n={};x.forEach(p=>{p.value.length&&(p.id==="is-waterproof"?p.value.length===1&&(n.waterproof=p.value[0]):n[p.id]=encodeURIComponent(p.value.join(",")))}),e>1&&(n.page=e),s.query=n}else e>1&&(s.query={page:e});if(E.push({query:{...s.query,sort:l.value}}),t&&P.value&&P.value.setPage(e),o){await je(),We.to(window,{duration:.5,scrollTo:{y:L.value.$el}});const n=L.value.$el.querySelector("li a");n&&n.focus()}}function _e(){Y()}function ye(){k.value.reset(),k.value.play(),Z(!1)}function ge(e){return{url:e,smallUrl:e.replace(/\/([^\/]+)$/,"/_small/$1"),mediumUrl:e.replace(/\/([^\/]+)$/,"/_medium/$1")}}return(e,t)=>{const o=xe,s=Ie,n=Se,p=Ee,oe=be,ve=Te,$e=ke,Ce=Le;return i(),m("div",{ref_key:"root",ref:fe,class:"page"},[d(s,{size:"small",background:a(_).thumbnail[0]},{default:y(()=>[B("h1",at,F(a(_).title),1),d(o,{ref_key:"searchInput",ref:k,class:"input",autoplay:!0,onSubmit:me},null,512)]),_:1},8,["background"]),d(Ce,null,{default:y(()=>[d(ve,{ref_key:"listingView",ref:L,"is-search":a(g),"sort-by":a(l),"onUpdate:sortBy":t[1]||(t[1]=f=>V(l)?l.value=f:null),"filters-mobile":a($),"onUpdate:filtersMobile":t[2]||(t[2]=f=>V($)?$.value=f:null),"show-filters":he,"hide-filters":q,onSortChanged:_e,onClearResults:ye},{header:y(()=>[d(se,{name:"short-fade",mode:"out-in"},{default:y(()=>{var f;return[a(g)?(i(),m("div",ot,[B("p",nt,[t[3]||(t[3]=He(" Search Results for ")),B("span",null,F(a(w)),1)]),B("p",null,F(((f=a(R))==null?void 0:f.hits.length)||0)+" products",1)])):(i(),m("p",rt,F(a(b))+" products",1))]}),_:1})]),aside:y(()=>[d(n,{onClick:q}),d(p,{ref_key:"listingFilters",ref:J,filters:U,"filters-ref":a(x),"sort-by":a(l),"onUpdate:sortBy":t[0]||(t[0]=f=>V(l)?l.value=f:null),onToggle:pe,onSubmit:Y,onReset:Z},null,8,["filters-ref","sort-by"])]),content:y(()=>[d(se,{name:"fade",mode:"out-in"},{default:y(()=>{var f;return[a(v)?re("",!0):(i(),m("div",st,[a(g)?(i(),m(j,{key:0},[(f=a(R))!=null&&f.hits.length?(i(),M(ie,{key:0,tag:"ul",name:"fade",class:"listing",mode:"out-in"},{default:y(()=>[(i(!0),m(j,null,le(a(R).hits,C=>(i(),m("li",{key:C.uri},[d(oe,{item:{...C,thumbnail:C.thumbnailUrl?[ge(C.thumbnailUrl)]:[]}},null,8,["item"])]))),128))]),_:1})):(i(),m("p",it,"No leathers found."))],64)):(i(),M(ie,{key:1,tag:"ul",name:"fade",class:"listing",mode:"out-in"},{default:y(()=>[(i(!0),m(j,null,le(a(H),C=>(i(),m("li",{key:C.slug},[d(oe,{item:C},null,8,["item"])]))),128))]),_:1}))]))]}),_:1})]),_:1},8,["is-search","sort-by","filters-mobile"]),!a(g)&&a(b)>I?(i(),M($e,{key:0,ref_key:"pagination",ref:P,"init-page":a(A),"max-items-shown":I,"total-items":a(b),onPageChange:O},null,8,["init-page","total-items"])):re("",!0)]),_:1})],512)}}},kt=Be(lt,[["__scopeId","data-v-34456614"]]);export{kt 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.