'use client';
import{jsx as e,jsxs as l}from"react/jsx-runtime";import{useCollection as o}from"@gem-sdk/core";import{createClass as r,createStyle as t,If as s}from"@gem-sdk/system";import{getClassContainer as a,getClassToolbarWrapper as m,getClassToolbarSortWrapper as i,getClassSelect as c,getClassToolbarWrapperQuantity as n}from"./common/classes.js";import{getStyleCollectionToolbar as d,getStyleToolbarWrapper as p,getStyleSelect as u,getStyleToolbarWrapperQuantity as f}from"./common/styles.js";import{getSortingTextDisplayVal as h,getQuantityTextDisplayVal as v,sortBy as g,SORT_OPTIONS as y}from"./common/helpers.js";let CollectionToolbar=({setting:N,builderProps:j,pageContext:x})=>{let{displayQuantity:b}=N??{},C=o(),k=C?.products?.totalCount??12,S=r({...a()}),T=r({...m()}),V=r({...i()}),$=r({...c(N)}),q=r({...n(N)}),w=r({"gp-flex-1":!0}),z=t({...d(N)}),A=t({...p(N)}),B=t({...u(N)}),D=t({...f(N)}),E=h({setting:N,builderProps:j,pageContext:x},"react"),F=v({setting:N,builderProps:j,pageContext:x},"react");return e("div",{className:S,style:z,id:j?.uid,children:l("div",{className:T,style:A,children:[e("div",{className:V,children:l("select",{id:"sorting",className:$,style:B,defaultValue:g,children:[e("option",{value:"",children:E},E?.toString()),y.map(l=>e("option",{value:l.value,children:l.name},l.value))]})}),e("div",{className:q,style:D,children:s(b,(F?.toString()??"").replace("%number%",`${k}`),"")}),e("div",{className:w,children:"\xa0"})]})})};export{CollectionToolbar as default};
