1(this["webpackJsonppolice-data-website"]=this["webpackJsonppolice-data-website"]||[]).push([[29,44],{129:function(e,t,n){"use strict";n.r(t);var r=n(14),i=n(89),o=n(94),c=n(1),a=n.n(c),l=n(213),s=n(28),u=n.n(s);function f(){return f=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},f.apply(this,arguments)}function d(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var p=Object(c.forwardRef)((function(e,t){var n=e.color,r=void 0===n?"currentColor":n,i=e.size,o=void 0===i?24:i,c=d(e,["color","size"]);return a.a.createElement("svg",f({ref:t,xmlns:"http://www.w3.org/2000/svg",width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:r,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},c),a.a.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),a.a.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"}))}));p.propTypes={color:u.a.string,size:u.a.oneOfType([u.a.string,u.a.number])},p.displayName="X";var h=p;function b(){return b=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},b.apply(this,arguments)}function v(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var m=Object(c.forwardRef)((function(e,t){var n=e.color,r=void 0===n?"currentColor":n,i=e.size,o=void 0===i?24:i,c=v(e,["color","size"]);return a.a.createElement("svg",b({ref:t,xmlns:"http://www.w3.org/2000/svg",width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:r,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},c),a.a.createElement("circle",{cx:"12",cy:"12",r:"10"}),a.a.createElement("polyline",{points:"12 16 16 12 12 8"}),a.a.createElement("line",{x1:"8",y1:"12",x2:"16",y2:"12"}))}));m.propTypes={color:u.a.string,size:u.a.oneOfType([u.a.string,u.a.number])},m.displayName="ArrowRightCircle";var j=m,O=n(257),y=n(39),P=n(108);function g(e,t,n){void 0===t&&(t=0),void 0===n&&(n=[]);var r=function(e,t){void 0===t&&(t=0);var n=Object(c.useRef)(!1),r=Object(c.useRef)(),i=Object(c.useRef)(e),o=Object(c.useCallback)((function(){return n.current}),[]),a=Object(c.useCallback)((function(){n.current=!1,r.current&&clearTimeout(r.current),r.current=setTimeout((function(){n.current=!0,i.current()}),t)}),[t]),l=Object(c.useCallback)((function(){n.current=null,r.current&&clearTimeout(r.current)}),[]);return Object(c.useEffect)((function(){i.current=e}),[e]),Object(c.useEffect)((function(){return a(),l}),[t]),[o,l,a]}(e,t),i=r[0],o=r[1],a=r[2];return Object(c.useEffect)(a,n),[i,o]}var S=n(131),w=n(21);const k=["Arizona","California","Florida","Georgia","Maryland","New York","Oregon","Texas","Virginia","Washington"],x=["Arizona","Arkansas","California","Colorado","Connecticut","District of Columbia","Florida","Georgia","Hawaii","Idaho","Illinois","Indiana","Iowa","Kansas","Louisiana","Maine","Maryland","Massachusetts","Michigan","Minnesota","Missouri","Montana","Nebraska","Nevada","New Hampshire","New Jersey","New Mexico","New York","North Carolina","North Dakota","Ohio","Oklahoma","Oregon","Pennsylvania","Rhode Island","South Carolina","South Dakota","Tennessee","Texas","Utah","Vermont","Virginia","Washington","West Virginia","Wisconsin","Wyoming"],C=r.t.filter((e=>x.indexOf(e.name)>-1));function W(e){let{onChange:t,onClick:a,container:s}=e;const[u,f]=Object(c.useState)(""),[d,p]=Object(c.useState)(!1),[b,v]=Object(c.useState)([]),m=Object(c.useRef)(null),{t:x}=Object(O.a)(),[W,D]=Object(c.useState)(null),[N,$]=Object(c.useState)(null);Object(P.a)((()=>{n.e(27).then(n.t.bind(null,236,7)).then((e=>{D(new e.default({initialize:!0,local:r.t.filter((e=>{let{code:t}=e;return t!==r.B})),queryTokenizer:e.default.tokenizers.whitespace,datumTokenizer:e.default.tokenizers.obj.whitespace("name")}
1)),$(new e.default({initialize:!0,limit:5,queryTokenizer:e.default.tokenizers.whitespace,datumTokenizer:e.default.tokenizers.obj.whitespace("department"),indexRemote:!0,remote:{url:"".concat(r.a,"/state_department_wise.json"),transform:function(e){const t=[];return Object.keys(e).filter((e=>"State Unassigned"!==e&&"NOTICE"!==e)).map((n=>{const r=e[n].departmentData;return Object.keys(r).map((e=>t.push({department:Object(i.b)(e),state:n,name:Object(i.b)(r[e].name),url:r[e].url}))),null})),t}}}))}))}),[d]);const T=Object(c.useCallback)((e=>{if(!W)return null;const t=[];W.search(e,(e=>{e.map(((e,n)=>{const r={name:e.name,type:"state",route:"/report/".concat(e.code)};return t.push(r),null}))})),N.search(e,(e=>{e.slice(0,5).map(((e,n)=>{const r={name:e.department,state:e.state,url:e.url,type:"department",route:e.url};return t.push(r),null})),v([...t])}))}),[N,W]);g((()=>{u?(t&&t(u),T(u)):(t&&t(null),v(Object(o.a)(b,(e=>{e.splice(0)}))))}),100,[u]);const M=Object(c.useCallback)((()=>{t&&t(null),setTimeout((()=>p(!1)),500)}),[t]),z=Object(c.useCallback)(((e,t,n,r)=>(e.textContent="",!0)),[]),E=Object(c.useCallback)(((e,t)=>{const n=e.textContent;if(e.classList.add("disappear"),n.length>0)return setTimeout((function(){e.textContent="",E(e,t)}),1e3),!0;t()}),[]),L=Object(c.useCallback)(((e,t)=>{if(d)return e.textContent="",!0;z(e,t,0,(function(){setTimeout((function(){E(e,(function(){L(e,(t+1)%k.length)}))}),2e3)}))}),[E,d,z]);Object(c.useEffect)((()=>{if(!d){const e=document.getElementsByClassName("search-placeholder")[0];e&&L(e,0)}}),[d,L]);const B=Object(c.useMemo)((()=>{const e=[];return[0,0,0].map(((t,n)=>(e.push({animationDelay:"".concat(250*n,"ms")}),null))),e}),[]),I=Object(c.useCallback)((()=>{f(""),v([]),M()}),[M]),R=Object(c.useCallback)((e=>{f(e.target.value)}),[]);return Object(S.a)("/",(()=>{m.current.focus()})),Object(S.a)("Escape",(()=>{I(),m.current.blur()})),Object(w.jsxs)("div",{className:"Search ".concat(s),children:[Object(w.jsxs)("div",{className:"search-input-wrapper ".concat("navbar"===s?"":"fadeInUp"),style:B[2],children:[Object(w.jsx)("input",{type:"text",value:u,ref:m,placeholder:"".concat("navbar"===s?"Search State or Police":"Go to your state or police agency"),spellCheck:"false",onFocus:p.bind(this,!0),onBlur:"navbar"!==s?M:()=>{},onChange:R}),!d&&""===u&&Object(w.jsx)("span",{className:"search-placeholder"}),("page"===s||"navbar"===s&&0===u.length)&&Object(w.jsx)("div",{className:"search-button",children:Object(w.jsx)(l.a,{})}),u.length>0&&Object(w.jsx)("div",{className:"close-button",onClick:I,children:Object(w.jsx)(h,{})})]}),b.length>0&&Object(w.jsx)("div",{className:"results",children:b.map(((e,t)=>Object(w.jsx)(y.b,{to:e.route,onClick:()=>"function"===typeof a?a():I(),children:Object(w.jsxs)("div",{className:"result",children:[Object(w.jsx)("div",{className:"result-left",children:Object(w.jsxs)("div",{className:"result-name",children:["".concat(e.name),"department"===e.type&&", ".concat(e.state)]})}),Object(w.jsxs)("div",{className:"result-type",children:[" ",Object(w.jsx)("span",{children:"VIEW"})," ",Object(w.jsx)(j,{size:14})]})]})},t)))}),u.length>3&&0===b.length&&Object(w.jsx)("div",{className:"results",children:Object(w.jsx)("div",{className:"no-results",children:x("No results found")})}),d&&"navbar"!==s&&""===u&&Object(w.jsx)(w.Fragment,{children:Object(w.jsx)("div",{className:"expanded",children:Object(w.jsxs)("div",{className:"expanded-left",children:[Object(w.jsx)("h3",{children:x("State")}),Object(w.jsx)("div",{className:"suggestions",children:C.map(((e,t)=>Object(w.jsx)("div",{className:"suggestion",children:Object(w.jsx)(y.b,{to:"/report/".concat(e.code.toLowerCase()),children:x(e.name)},t)},t)))})]})})})]})}const D=()=>!0;t.default=Object(c.memo)(W,D)},131:function(e,t,n){"use strict";var r=n(1),i=n(84),o=i.a?window:null,c=function(e){return!!e.addEventListener},a=function(e){return!!e.on},l=function(e,t,n,l){void 0===n&&(n=o),Object(r.useEffect)((function(){if(t&&n)return c(n)?Object(i.d)(n,e,t,l):a(n)&&n.on(e,t,l),function(){c(n)?Object(i.c)(n,e,t,l):a(n)&&n.off(e,t,l)}}),[e,t,n,JSON.stringify(l)])},s=function(e,t,n,o){void 0===t&&(t=i.b),void 0===n&&(n={}),void 0===o&&(o=[e]);var c=n.event,a=void 0===c?"keydown":c,s=n.target,u=n.options,f=Object(r.useMemo)((function(){var n,r="function"===typeof(n=e)?n:"string"===typeof n?function(e){return e.key===n}:n?function(){return!0}:function(){return!1};return function(e){if(r(e))return t(e)}}),o);l(a,f,s,u)},u=function(e){var t=Object(r.useState)([!1,null]),n=t[0],i=t[1];return s(e,(function(e){return i([!0,e])}),{event:"keydown"},[n]),s(e,(function(e){return i([!1,e])}),{event:"keyup"},[n]),n},f=n(108);t.a=function(e,t,n,r){void 0===r&&(r=u);var i=r(e),o=i[0],c=i[1];Object(f.a)((function(){!o&&n?n(c):o&&t&&t(c)}),[o])}},89:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}
1)),n.d(t,"e",(function(){return c})),n.d(t,"b",(function(){return a})),n.d(t,"c",(function(){return l})),n.d(t,"d",(function(){return h}));const r=function(){const e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e.endsWith(" Metropolitan Police Department")?e.replace(/ Metropolitan Police Department$/," Police"):e.endsWith(" Department of Public Safety")?e.replace(/ Department of Public Safety$/," Police"):e.endsWith(" Township Police Department")?e.replace(/ Police Department$/," Police"):e.endsWith(" Sheriff's Department")?e.replace(/ Sheriff's Department$/," Sheriff"):e.endsWith(" Metropolitan Police")?e.replace(/ Metropolitan Police$/," Police"):e.endsWith(" Division of Police")?e.replace(/ Division of Police$/," Police"):e.endsWith(" Police Department")?e.replace(/ Police Department$/," Police"):e.endsWith(" Sheriff's Office")?e.replace(/ Sheriff's Office$/," Sheriff"):e.endsWith(" Dept Pub Safety")?e.replace(/ Dept Pub Safety$/," Police"):e.endsWith(" Police Division")?e.replace(/ Police Division$/," Police"):e.endsWith(" Township Police")?e:e.endsWith(" Police Bureau")?e.replace(/ Police Bureau$/," Police"):e.endsWith(" Public Safety")?e.replace(/ Public Safety$/," Police"):e.endsWith(" Township")?"".concat(e," Police"):e.endsWith(" DPS")?e.replace(/ DPS$/," Police"):e.endsWith(" Sheriff's Ofice")?e.replace(/ Sheriff's Ofice$/," Sheriff"):e},i=function(){const e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").replace(/ County/,"");return e.endsWith(" Metropolitan Police Department")?e.replace(/ Metropolitan Police Department$/," Police"):e.endsWith(" Department of Public Safety")?e.replace(/ Department of Public Safety$/," Police"):e.endsWith(" Township Police Department")?e.replace(/ Township Police Department$/," Police"):e.endsWith(" Sheriff's Department")?e.replace(/ Sheriff's Department$/," Sheriff"):e.endsWith(" Metropolitan Police")?e.replace(/ Metropolitan Police$/," Police"):e.endsWith(" Division of Police")?e.replace(/ Division of Police$/," Police"):e.endsWith(" Police Department")?e.replace(/ Police Department$/," Police"):e.endsWith(" Sheriff's Office")?e.replace(/ Sheriff's Office$/," Sheriff"):e.endsWith(" Dept Pub Safety")?e.replace(/ Dept Pub Safety$/," Police"):e.endsWith(" Police Division")?e.replace(/ Police Division$/," Police"):e.endsWith(" Township Police")?e.replace(/ Township Police$/," Police"):e.endsWith(" Police Bureau")?e.replace(/ Police Bureau$/," Police"):e.endsWith(" Public Safety")?e.replace(/ Public Safety$/," Police"):e.endsWith(" Township")?e.replace(/ Township$/," Police"):e.endsWith(" DPS")?e.replace(/ DPS$/," Police"):e.endsWith(" Sheriff's Ofice")?e.replace(/ Sheriff's Ofice$/," Sheriff"):e},o=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return"NB"===e.toUpperCase()?"NE":e.toUpperCase()},c=function(){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";const n=o(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"");if(!n)return null;let r="/report/".concat(n.toLowerCase());return e&&(r+="/".concat(e)),t&&(r+="/".concat(t)),r},a=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e.endsWith(" Sheriff")&&!e.endsWith(" County Sheriff")?e.replace(/ Sheriff$/," County Sheriff"):e},l=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const n=Object.entries(e),r=s(n,(e=>{let[,n]=e;return(null===n||void 0===n?void 0:n.slug)===t}));return r.hasMatches?r.key:u(n,(e=>{var n;let[r,o]=e;const c=(null===o||void 0===o||null===(n=o.m)||void 0===n?void 0:n.name)||r;return function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").toLowerCase().replace(/[^A-Za-z ]+/g,"").replace(/ /g,"-")}(i(c))===t}))},s=(e,t)=>{const n=e.filter(t);return{hasMatches:n.length>0,key:1===n.length?n[0][0]:null}},u=(e,t)=>s(e,t).key,f=e=>{if(null===e||"undefined"===typeof e)return null;const t=String(e).trim();return t&&/^\d+$/.test(t)?t.replace(/^0+(?=\d)/,""):null},d=(e,t)=>{const n=f(e),r=f(t);return null!==n&&null!==r&&n===r},p=(e,t,n)=>s(e,(e=>{var r;let[i,o]=e;const c=(null===o||void 0===o||null===(r=o.m)||void 0===r?void 0:r.name)||i,a=new Set([i,c].map(n));return t.some((e=>a.has(n(e))))})),h=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=Object.entries(e),o=t.ori,c=t.city_fp,a=t.county_fp,l=t.type;if(o){const e=s(n,(e=>{var t;let[,n]=e;const r=(null===n||void 0===n||null===(t=n.m)||void 0===t?void 0:t.ori)||
1(null===n||void 0===n?void 0:n.roi);return r&&String(r).trim()===String(o).trim()}));if(e.hasMatches)return e.key}if(null!==c&&"undefined"!==typeof c){const e=s(n,(e=>{var t;let[,n]=e;return d(null===n||void 0===n?void 0:n.id,c)||d(null===n||void 0===n||null===(t=n.m)||void 0===t?void 0:t.fips_place_code,c)}));if(e.hasMatches)return e.key}if(null!==a&&"undefined"!==typeof a&&l){const e=s(n,(e=>{var t,n,r;let[,i]=e;return d(null===i||void 0===i||null===(t=i.m)||void 0===t?void 0:t.fips_county_code,a)&&(null===i||void 0===i||null===(n=i.ta)||void 0===n||null===(r=n.t)||void 0===r?void 0:r.toLowerCase())===String(l).toLowerCase()}));if(e.hasMatches)return e.key}const u=[t.department,t.name].filter(Boolean),f=s(n,(e=>{let[t]=e;return u.includes(t)}));if(f.hasMatches)return f.key;const h=p(n,u,r);return h.hasMatches?h.key:p(n,u,i).key}}}]); 2//# sourceMappingURL=29.b239c042.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.