PageSourceSearch

https://dressagetests.netlify.app/static/js/10.a9f616d9.chunk.js

js dressagetests.netlify.app collected 2026-10-03 10:40:11 UTC 9,057 bytes, 2 lines download raw bytes

1(this["webpackJsonpdressage-spa"]=this["webpackJsonpdressage-spa"]||[]).push([[10],{262:function(e,t,r){"use strict";r.r(t);var a=r(14),c=r(0),n=r(42),s=r(77),i=r(9),o=r(22),l=r(103),u=r(165),d=r(38),j=r(256),b=r(159),h=r(257),f=r(258),g=r(12),O=r(207),m=r.n(O),p=r(211),v=r(166),x=r(163),y=r(255),k=r(234),w=r(2),C=function(e){var t=Object(c.useState)("true"),r=Object(a.a)(t,2),s=r[0],i=r[1],o=Object(c.useState)([{id:"intro",checked:!1},{id:"training",checked:!1},{id:"first",checked:!1}]),l=Object(a.a)(o,2),u=l[0],j=l[1],b=Object(g.f)(),h=Object(g.g)(),f=Object(g.g)().search,O=m.a.parse(f).current,C=m.a.parse(f).level;return Object(c.useEffect)((function(){var e=u.filter((function(e){return!0===e.checked})).map((function(e){return e.id}));if(console.log("levels",e),0===e.length){var t=m.a.parse(h.search);delete t.level,b.push({search:m.a.stringify(t)})}else if(void 0!==e){var r=e.toString(),a=m.a.parse(h.search);console.log("location",a);var c=Object(n.a)(Object(n.a)({},a),{},{level:r});b.push({search:m.a.stringify(c)})}return function(){}}),[u]),Object(c.useEffect)((function(){if(i(void 0!==O?O:"true"),void 0!==C){var e=C.split(","),t=u.map((function(t){return e.includes(t.id)?{id:t.id,checked:!0}:{id:t.id,checked:t.checked}}));j(t)}return function(){}}),[]),Object(c.useEffect)((function(){var e=m.a.parse(h.search),t=Object(n.a)(Object(n.a)({},e),{},{current:s});b.push({search:m.a.stringify(t)})}),[s]),Object(w.jsxs)("div",{className:"row align-content-center",children:[Object(w.jsxs)("div",{className:"col",children:["Level",Object(w.jsx)(v.a,{name:"LevelsCheckbox",valueKey:"id",options:[{label:"Training",id:"training"},{label:"First",id:"first"}],value:u.filter((function(e){return!0===e.checked})).map((function(e){return e.id})),onChange:function(e,t){console.log("check",e.target.id,e.target.checked);var r=u.findIndex((function(t){return t.id===e.target.id})),a=Object(p.a)(u);a[r].checked=e.target.checked,j(a)}})]}),Object(w.jsxs)("div",{className:"col",children:["Current",Object(w.jsx)(x.a,{focusIndicator:!0,className:"current-radio",name:"isCurrent",value:s,options:[{name:"Current",label:"Current",value:"true"},{name:"Historical",label:"Historical",value:"false"},{name:"All",label:"All",value:"all"}],onChange:function(e){i(e.target.value)}})]}),Object(w.jsx)("div",{className:"col-md col-12 pt-4",children:Object(w.jsxs)("div",{style:{float:"right"},children:[Object(w.jsx)(d.a,{icon:Object(w.jsx)(y.a,{}),label:"Display All",onClick:function(e){b.push({search:"?current=all"}),i("all");var t=u.map((function(e){return{id:e.id,checked:!1}}));j(t)},gap:"xsmall",margin:{bottom:"xsmall"}}),Object(w.jsx)(d.a,{icon:Object(w.jsx)(k.a,{}),label:"Reset All",gap:"xsmall",margin:{bottom:"xsmall"},onClick:function(){b.push({search:"?current=true"}),i("true");var e=u.map((function(e){return{id:e.id,checked:!1}}));j(e)}})]})})]})},N=r(49),S=r(220),_=r(223),z=r(198),L=r(260),E=r(156),T=r(21),A=r(40),Y=function(e,t){var r=e.data,n=e.search,s=Object(c.useContext)(A.a),l=s.DeleteFavourite,u=s.CreateFavourite,d=Object(c.useState)([]),j=Object(a.a)(d,2),b=j[0],h=j[1],f=[{property:"is_faved",render:function(e){return!0===e.is_faved?Object(w.jsx)(E.a,{onClick:function(){return l(e.fav[0].id)}}):Object(w.jsx)(E.a,{color:"surface",onClick:function(){return u(e.id)}})}},{property:"org_name",header:"Organization"},{property:"level",header:"Level"},{property:"name",header:"Name"},{property:"year",header:"Year"},{property:"current",header:"Current",render:function(e){return!0===e.current?Object(w.jsx)(o.a,{color:"status-ok",children:"Yes"}):Object(w.jsx)(o.a,{color:"status-warning",children:"No"})}},{property:"Go to Test",render:function(e){return Object(w.jsx)(z.a,{as:T.b,to:"/tests/".concat(e.id),children:Object(w.jsxs)(i.a,{flex:!0,align:"center",children:[Object(w.jsx)(y.a,{}),Object(w.jsx)(o.a,{children:"View"})]})})}}],g=[{property:"item.org_name",header:"Organization"},{property:"item.level",header:"Level"},{property:"item.name",header:"Name"},{property:"item.year",header:"Year"},{property:"item.current",header:"Current",render:function(e){return Object(w.jsx)(o.a,{color:"status-ok",children:"Yes"})}},{property:"Go to Test",render:function(e){return"go to test"}}
1],O=b.reduce((function(e,t){return e[t]={background:"hoverBackground"},e}),{});return Object(w.jsx)("div",{className:"container-fluid",children:Object(w.jsx)(i.a,{background:"surface",animation:"fadeIn",style:{overflow:"auto"},children:Object(w.jsx)(L.a,{style:{overflow:"auto"},className:"test-table",background:{select:"light-1"},columns:n?g:f,data:r,sortable:!0,pad:"small",select:b,onClickRow:function(e){return console.log(e.datum)},onSelect:function(e){return function(e){h(e)}(e)},rowProps:O,primaryKey:"id"})})})},q=r(209),F=function(e){var t=Object(c.useRef)(),r=Object(c.useState)([]),O=Object(a.a)(r,2),p=O[0],v=O[1],x=Object(c.useState)(""),y=Object(a.a)(x,2),k=y[0],z=y[1],L=Object(c.useState)(""),E=Object(a.a)(L,2),T=E[0],A=E[1],F=Object(g.g)().search,H=m.a.parse(F).query,I=Object(c.useContext)(q.a),M=I.view,R=I.setTableView,V=I.setListView,D=Object(c.useMemo)((function(){return p.map((function(e){var t=e.item;return{label:Object(w.jsxs)(i.a,{direction:"row",align:"center",gap:"small",pad:"small",justify:"between",children:[Object(w.jsx)(o.a,{size:"large",children:Object(w.jsx)(S.Highlight,{search:H,matchStyle:{fontWeight:"bold",background:"none",color:"#097de3"},children:t.full_name})}),Object(w.jsx)(i.a,{background:t.current?"status-ok":"status-warning",round:"10px",pad:"xxsmall",children:Object(w.jsx)(o.a,{weight:"bold",color:"white",size:"small",children:t.current?"current":"outdated"})})]}),value:t.id}}))}),[p]);Object(c.useEffect)((function(){!function(e){void 0!==e?(z(e),A(e)):A("")}(H)}),[H]),Object(c.useEffect)((function(){!function(t){if(void 0!==k&&void 0!==e.tests.dressage_tests){var r=new _.a(e.tests.dressage_tests,{keys:["name","level","org_name","full_name"],threshold:.4,includeScore:!0,includeMatches:!0,minMatchCharLength:2}).search(t);v(r),console.log("searching",r)}else console.log("undefined do not send to search")}(k)}
1),[k,e.tests.dressage_tests]),console.log("array to search",e.tests);var G=Object(g.g)(),J=Object(g.f)();return console.log("filtered tests",e),Object(w.jsxs)("div",{children:[Object(w.jsxs)("div",{className:"container-fluid d-flex align-items-center flex-column",children:[H?Object(w.jsxs)("h2",{children:[' Searching for: "',H,'" ']}):Object(w.jsx)("h2",{children:"Search for tests"}),Object(w.jsxs)(l.a,{background:"surface",elevation:"none",round:!1,width:"large",direction:"row",border:!0,ref:t,children:[Object(w.jsx)(u.a,{plain:!0,placeholder:"search",icon:Object(w.jsx)(j.a,{}),value:T,onChange:function(e,t){A(e.target.value),setTimeout((function(){z(e.target.value);var t=m.a.parse(G.search),r=Object(n.a)(Object(n.a)({},t),{},{query:e.target.value});J.push({search:m.a.stringify(r)})}),1e3)},width:"small",suggestions:D,onSuggestionSelect:function(e){J.push("/tests/".concat(e.suggestion.value))},round:"10px",dropProps:{stretch:!0,target:t.current}}),H?Object(w.jsx)(d.a,{icon:Object(w.jsx)(b.a,{}),onClick:function(){z(void 0),A("");var e=m.a.parse(G.search);delete e.query,console.log("what is left",e),J.push({search:m.a.stringify(e)})}}):""]}),Object(w.jsx)(C,{})]}),Object(w.jsx)("div",{className:"view-control container-fluid",children:Object(w.jsxs)(i.a,{flex:!0,direction:"row",justify:"end",children:[Object(w.jsx)(d.a,{size:"small",margin:{horizontal:"0.3rem"},label:"list",icon:Object(w.jsx)(h.a,{}),gap:"xsmall",primary:"list"===M,onClick:V}),Object(w.jsx)(d.a,{size:"small",label:"table",gap:"xsmall",margin:{horizontal:"0.3rem"},icon:Object(w.jsx)(f.a,{}),primary:"table"===M,onClick:R})]})}),void 0===H||0===H.length?Object(w.jsx)("div",{className:"row no-gutters mb-4 mt-4",children:void 0===e.tests.dressage_tests?Object(w.jsx)(N.a,{}):"list"===M?e.tests.dressage_tests.map((function(e,t){return Object(w.jsx)("div",{className:"col-12 col-md-9 mx-auto",children:Object(w.jsx)(s.a,Object(n.a)(Object(n.a)({id:e.id},e),{},{index:t}))})})):Object(w.jsx)(Y,{data:e.tests.dressage_tests})}):0===p.length?"There is nothing found for ".concat(H):Object(w.jsx)("div",{className:"row no-gutter mb-4 mt-4",children:"list"===M?p.map((function(e,t){var r=e.item;return Object(w.jsx)("div",{className:"col-12 col-md-9 mx-auto",children:Object(w.jsx)(s.a,Object(n.a)(Object(n.a)({id:r.id},r),{},{index:t}))})})):Object(w.jsx)(Y,{data:p,search:!0})})]})};t.default=function(e){var t=Object(g.g)().search,r=m.a.parse(t).current,n=m.a.parse(t).level,s=Object(c.useState)([]),i=Object(a.a)(s,2),o=i[0],l=i[1],u=e.tests;return Object(c.useEffect)((function(){var e=n?n.split(","):[],t=function(e){return"all"===r?e:e.current.toString()===r},a=function(t){return 0===e.length?t:e.includes(t.level.toLowerCase())},c=u.dressage_tests.filter((function(e){return t(e)&&a(e)}));return l({dressage_tests:c}),function(){}}),[n,r]),Object(w.jsx)("div",{children:void 0===o?"loading":Object(w.jsx)(F,{tests:o})})}}}]);
2//# sourceMappingURL=10.a9f616d9.chunk.js.map

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.