forked from duneanalytics/DuneQueryRepo
-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
8785-c768d2756e2890a5.js.download
2 lines (2 loc) · 5.98 KB
/
8785-c768d2756e2890a5.js.download
1
2
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8785],{10874:function(e,r,n){n.d(r,{Z:function(){return l}});var t=n(67294),i=n(7659),s=n(84077),c=n(68583);function l(){let[e,r]=(0,s.Z)("q","",{onChangeTransform:c.X}),[n,l]=(0,t.useState)(e);return(0,t.useEffect)(()=>{l(e)},[e]),(0,i.b)({delayMs:300},()=>r(n),[n]),{freetextFilter:n,setFreetextFilter:l,freetextFilterDebounced:e}}},90869:function(e,r,n){n.d(r,{p:function(){return d},e:function(){return u}});var t=n(85893),i=n(77251),s=n(10398),c=n(10933),l=n(41118),a=n(45439);function d(e){let{searchStringState:r,placeholder:n}=e;return(0,t.jsx)(i.$0,{title:"Filter results",children:(0,t.jsx)("li",{children:(0,t.jsx)(s.U,{size:"M",style:"contained",placeholder:n,value:r.value,onChange:e=>r.setState(e.target.value),prefix:(0,t.jsx)(a.IconMagnifyingGlass,{}),suffix:(0,t.jsx)(c.h,{size:"XS",theme:"ghost",onClick:()=>r.setState(""),style:""===r.value?{visibility:"hidden"}:void 0,children:(0,t.jsx)(l.IconCross,{})})})})})}var o=n(10874);function u(){let{freetextFilter:e,freetextFilterDebounced:r,setFreetextFilter:n}=(0,o.Z)();return{value:e,debouncedValue:r,setState:n}}},32279:function(e,r,n){n.d(r,{h:function(){return a},e:function(){return v}});var t=n(85893),i=n(77251),s=n(45186),c=n(32613),l=n(78528);function a(e){return(0,t.jsxs)(i.$0,{title:"Sort by",children:[(0,t.jsx)(d,{...e}),(0,t.jsx)(o,{...e}),(0,t.jsx)(u,{...e})]})}function d(e){let{value:r,setState:n}=e.orderState;function a(e){switch(e){case"created_at":return"Created date";case"updated_at":return"Updated date";case"favorites":return"Favorites"}}return(0,t.jsx)("li",{children:(0,t.jsx)(s.f,{position:"below-align-left-full-width",content:e=>{let{close:i}=e;return(0,t.jsx)(c.s_,{children:(0,t.jsxs)(c.$0,{children:[(0,t.jsx)(c.ys,{selected:"created_at"===r.by,onClick:()=>{n({by:"created_at",order:"order"in r?r.order:"Desc"}),i()},children:(0,t.jsx)("span",{children:a("created_at")})}),(0,t.jsx)(c.ys,{selected:"updated_at"===r.by,onClick:()=>{n({by:"updated_at",order:"order"in r?r.order:"Desc"}),i()},children:(0,t.jsx)("span",{children:a("updated_at")})}),(0,t.jsx)(c.ys,{selected:"favorites"===r.by,onClick:()=>{n({by:"favorites",time_range:"7d"}),i()},children:(0,t.jsx)("span",{children:a("favorites")})})]})})},children:(0,t.jsxs)(i.V1,{color:"gray",children:[(0,t.jsx)(i.xv,{children:a(r.by)}),(0,t.jsx)(l.IconChevronDown,{})]})})})}function o(e){let{value:r,setState:n}=e.orderState;if("favorites"===r.by)return null;function a(e){switch(e){case"Desc":return"Descending";case"Asc":return"Ascending"}}return(0,t.jsx)("li",{children:(0,t.jsx)(s.f,{position:"below-align-left-full-width",content:e=>{let{close:i}=e;return(0,t.jsx)(c.s_,{children:(0,t.jsxs)(c.$0,{children:[(0,t.jsx)(c.ys,{selected:"Desc"===r.order,onClick:()=>{n({by:r.by,order:"Desc"}),i()},children:(0,t.jsx)("span",{children:a("Desc")})}),(0,t.jsx)(c.ys,{selected:"Asc"===r.order,onClick:()=>{n({by:r.by,order:"Asc"}),i()},children:(0,t.jsx)("span",{children:a("Asc")})})]})})},children:(0,t.jsxs)(i.V1,{color:"gray",children:[(0,t.jsx)(i.xv,{children:a(r.order)}),(0,t.jsx)(l.IconChevronDown,{})]})})})}function u(e){let{value:r,setState:n}=e.orderState;if("favorites"!==r.by)return null;function a(e){switch(e){case"24h":return"24 hours";case"7d":return"7 days";case"30d":return"30 days";case"all":return"All time"}}return(0,t.jsx)("li",{children:(0,t.jsx)(s.f,{position:"below-align-left-full-width",content:e=>{let{close:i}=e;return(0,t.jsx)(c.s_,{children:(0,t.jsxs)(c.$0,{children:[(0,t.jsx)(c.ys,{onClick:()=>{n({by:"favorites",time_range:"24h"}),i()},selected:"24h"===r.time_range,children:a("24h")}),(0,t.jsx)(c.ys,{onClick:()=>{n({by:"favorites",time_range:"7d"}),i()},selected:"7d"===r.time_range,children:a("7d")}),(0,t.jsx)(c.ys,{onClick:()=>{n({by:"favorites",time_range:"30d"}),i()},selected:"30d"===r.time_range,children:a("30d")}),(0,t.jsx)(c.ys,{onClick:()=>{n({by:"favorites",time_range:"all"}),i()},selected:"all"===r.time_range,children:a("all")})]})})},children:(0,t.jsxs)(i.V1,{color:"gray",children:[(0,t.jsx)(i.xv,{children:a(r.time_range)}),(0,t.jsx)(l.IconChevronDown,{})]})})})}var h=n(48821),f=n(18446),x=n.n(f);function v(){let[e,r,n]=(0,h.Z)(function(e){switch(e.sort){case"favorites":switch(e.time_range){case"24h":case"7d":case"30d":case"all":return{by:"favorites",time_range:e.time_range};default:return{by:"favorites",time_range:"7d"}}case"created_at":if("Asc"===e.order)return{by:"created_at",order:"Asc"};return{by:"created_at",order:"Desc"};default:if("Asc"===e.order)return{by:"updated_at",order:"Asc"};return{by:"updated_at",order:"Desc"}}},function(e){return x()(e,{by:"updated_at",order:"Desc"})?{sort:void 0,order:void 0,time_range:void 0,page:void 0}:{sort:e.by,order:"order"in e?e.order:void 0,time_range:"time_range"in e?e.time_range:void 0,page:void 0}});return{value:e,setState:r,getUrl:n}}},55114:function(e,r,n){n.d(r,{h:function(){return h},e:function(){return u}});var t=n(85893),i=n(77251),s=n(45186),c=n(32613),l=n(78528),a=n(10295),d=n(68583);let o=["all","public","private"];function u(){let[e,r,n]=(0,a.s)({key:"publicness",defaultValue:"all",validValues:o,onChangeTransform:d.X});return{value:e,setState:r,getUrl:n}}function h(e){let{publicnessFilterState:r}=e;function n(e){switch(e){case"public":return"Public";case"private":return"Private";case"all":return"Public & private"}}return(0,t.jsx)("li",{children:(0,t.jsx)(s.f,{position:"below-align-left-full-width",content:e=>{let{close:i}=e;return(0,t.jsx)(c.s_,{children:(0,t.jsx)(c.$0,{children:o.map(e=>(0,t.jsx)(c.FB,{selected:r.value===e,href:r.getUrl(e),onOpen:i,children:(0,t.jsx)(c.xv,{children:n(e)})},e))})})},children:(0,t.jsxs)(i.V1,{color:"gray",children:[(0,t.jsx)(i.xv,{children:n(r.value)}),(0,t.jsx)(l.IconChevronDown,{})]})})})}},10295:function(e,r,n){n.d(r,{s:function(){return i}});var t=n(48821);function i(e){let{key:r,defaultValue:n,validValues:i,...s}=e,c=e=>"string"==typeof e&&i.includes(e);return(0,t.Z)(function(e){let t=e[r];return c(t)?t:n},function(e){return e===n?{[r]:void 0}:{[r]:e}},s)}}}]);
//# sourceMappingURL=8785-c768d2756e2890a5.js.map