import{ao as a,aO as c,ba as p,aq as t,aR as d,o as g,r as h,E as f,p as j}from"./app-k0jcl5PQ.js";import{S as m}from"./BwBaQklX.chunk.js";function u(i,n,s){if(!n)return null;const e=i.params??{};return s?e!=null&&e.previous?{application:i.application,action:i.action,args:i.args,params:{...e,cursor:e==null?void 0:e.previous,previous:null}}:{application:i.application,action:i.action,args:i.args,params:{...e,cursor:null,previous:null}}:{application:i.application,action:i.action,args:i.args,params:{...e,cursor:n,previous:e.cursor}}}b.defaultProps={className:"py-2",buttonVariant:"secondary"};function b({appLink:i,cursors:n,className:s,buttonVariant:e,prevHack:x,scrollTop:v,onClick:l}){function o(r){i&&v===!1&&m.preventScrollTop(),g.logUserAction({page:r},{location:j.Pagination,entity:f.Pagination,actionType:h.Navigate}),l&&l(n[r])}return i?a.jsx(c.Provider,{value:"shared.pagination",children:a.jsxs("div",{className:s,children:[a.jsx(p,{appLink:u(i,n.previous,x),className:`btn btn-${e} me-1 ${n.previous?"":"disabled"}`,onClick:()=>o("previous"),style:{display:"inline-block"},children:a.jsx(t,{phrase:"previous"})}),a.jsx(p,{appLink:u(i,n.next),className:`btn btn-${e} ${n.next?"":"disabled"}`,onClick:()=>o("next"),style:{display:"inline-block"},children:a.jsx(t,{phrase:"next"})})]})}):a.jsx(c.Provider,{value:"shared.pagination",children:a.jsxs("div",{className:s,children:[a.jsx(d,{variant:e,className:`me-1 ${n.previous?"":"disabled"}`,onClick:()=>o("previous"),children:a.jsx(t,{phrase:"previous"})}),a.jsx(d,{variant:e,className:`btn ${n.next?"":"disabled"}`,onClick:()=>o("next"),children:a.jsx(t,{phrase:"next"})})]})})}export{b as P};
//# sourceMappingURL=D9SGbB34.chunk.js.map
