{"version":3,"sources":["webpack:///./src/components/elements/audio-grid.js","webpack:///./src/hooks/use-asmet-audios.js","webpack:///./src/pages/audios.js"],"names":["filtersTypeDefault","Todos","type","label","Cuna","Programa","Entrevista","Otro","AudioGrid","allAudios","location","useLocation","queryString","parse","search","t","c","useState","categories","setCategories","filterType","updateFilterType","filterCategory","updateFilterCategory","filteredAudios","setFilteredAudios","useEffect","updateCategories","filteredArr","el","blog_subcategorias","nombre","length","tipo","filteredArr2","navigate","arr","newCategories","id","slug","forEach","ca","className","Object","keys","map","f","i","key","name","defaultValue","onChange","checked","htmlFor","audio","index","controls","src","archivo","publicURL","default","kind","srcLang","titulo","format","publicado_en","to","role","defaultProps","strapiId","useAsmetAudios","useStaticQuery","allStrapiMediaAudio","edges","AudiosPage","asmetHome","useAsmetHome","flattenAudios","concat","values","meta","og_titulo","crumbs","path","menuSecundario","menu_secundario"],"mappings":"8OAUMA,EAAqB,CACzBC,MAAO,CACLC,KAAM,QACNC,MAAO,SAETC,KAAM,CACJF,KAAM,OACNC,MAAO,QAETE,SAAU,CACRH,KAAM,WACNC,MAAO,YAETG,WAAY,CACVJ,KAAM,aACNC,MAAO,cAETI,KAAM,CACJL,KAAM,OACNC,MAAO,SAILK,EAAY,SAAH,GAAuB,IAAjBC,EAAS,EAATA,UACbC,EAAWC,wBAEjB,EAAeC,IAAYC,MAAMH,EAASI,QAApCC,EAAC,EAADA,EAAGC,EAAC,EAADA,EACTD,EAAIA,KAAKf,EAAqBe,EAAI,QAElC,MAAoCE,mBAAS,IAAtCC,EAAU,KAAEC,EAAa,KAChC,EAAuCF,mBAASF,GAAK,SAA9CK,EAAU,KAAEC,EAAgB,KACnC,EAA+CJ,mBAASD,GAAK,SAAtDM,EAAc,KAAEC,EAAoB,KAC3C,EAA4CN,mBAASR,GAA9Ce,EAAc,KAAEC,EAAiB,KAExCC,qBAAU,WACR,GAAmB,UAAfN,EAEF,GADAO,EAAiBlB,GACM,UAAnBa,EACFG,EAAkBhB,OACb,CACL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MACLR,OAAO,WAOFvB,O,kCCvOf,kDAEa8D,EAAiB,WAkC5B,OAjCaC,yBAAe,cAiChBC,oBAAoBC,Q,kCCpClC,wGA+CeC,UAnCI,WACjB,IAAMC,EAAYC,cACZnE,EAAY6D,cAOdO,EAAgB,GAKpB,OAJApE,EAAU+B,SAAQ,SAAAX,GAChBgD,EAAgBA,EAAcC,OAAOnC,OAAOoC,OAAOlD,OAInD,kBAAC,IAAM,CAACmD,KAAM,CAAEC,UAAW,WACzB,yBAAK3C,GAAG,sBAAsBI,UAAU,6BACtC,yBAAKA,UAAU,aACb,yBAAKA,UAAU,OACb,yBAAKA,UAAU,OACb,kBAAC,IAAU,CAACwC,OAhBT,CACb,CAAEC,KAAK,SAAWhF,MAAO,SACzB,CAAEgF,KAAK,UAAYhF,MAAO,aAehB,wBAAIuC,UAAU,mCAAiC,yBAKvD,yBAAKA,UAAU,iCACb,kBAAC,IAAS,CAACjC,UAAWoE,KAExB,6BACA,kBAAC,IAAI,CAACO,eAAgBT,EAAUU","file":"component---src-pages-audios-js-c1bb551cd6271932f2c6.js","sourcesContent":["import React, { useState, useEffect } from \"react\"\nimport PropTypes from \"prop-types\"\nimport Moment from \"react-moment\"\nimport { Link } from \"gatsby\"\nimport _ from \"lodash\"\n\nimport { useLocation, navigate } from \"@reach/router\"\nimport queryString from \"query-string\"\n\n// Default Filters by Type\nconst filtersTypeDefault = {\n Todos: {\n type: \"Todos\",\n label: \"Todos\",\n },\n Cuna: {\n type: \"Cuna\",\n label: \"Cuña\",\n },\n Programa: {\n type: \"Programa\",\n label: \"Programa\",\n },\n Entrevista: {\n type: \"Entrevista\",\n label: \"Entrevista\",\n },\n Otro: {\n type: \"Otro\",\n label: \"Otro\",\n },\n}\n\nconst AudioGrid = ({ allAudios }) => {\n const location = useLocation()\n // Get variables (t,c) from Url params\n let { t, c } = queryString.parse(location.search)\n t = t in filtersTypeDefault ? t : \"Todos\"\n\n const [categories, setCategories] = useState([])\n const [filterType, updateFilterType] = useState(t || \"Todos\")\n const [filterCategory, updateFilterCategory] = useState(c || \"Todos\")\n const [filteredAudios, setFilteredAudios] = useState(allAudios)\n\n useEffect(() => {\n if (filterType === \"Todos\") {\n updateCategories(allAudios)\n if (filterCategory === \"Todos\") {\n setFilteredAudios(allAudios)\n } else {\n let filteredArr = _.filter(allAudios, function (el) {\n return _.filter(el.blog_subcategorias, { nombre: filterCategory })\n .length > 0\n ? el\n : null\n })\n setFilteredAudios(filteredArr)\n }\n } else {\n let filteredArr = _.filter(allAudios, { tipo: filterType })\n updateCategories(filteredArr)\n if (filterCategory === \"Todos\") {\n setFilteredAudios(filteredArr)\n } else {\n let filteredArr2 = _.filter(filteredArr, function (el) {\n return _.filter(el.blog_subcategorias, { nombre: filterCategory })\n .length > 0\n ? el\n : null\n })\n setFilteredAudios(filteredArr2)\n }\n }\n }, [filterType, filterCategory, allAudios])\n\n useEffect(() => {\n navigate(`?t=${filterType}&c=${filterCategory}`)\n }, [filterType, filterCategory])\n\n const updateCategories = arr => {\n let newCategories = [{ id: \"01\", slug: \"todos\", nombre: \"Todos\" }]\n arr.forEach(el => {\n el.blog_subcategorias.forEach(ca => {\n newCategories = [...newCategories, ca]\n })\n })\n setCategories(_.uniqBy(newCategories, \"id\"))\n }\n\n return (\n
\n \n {audio.tipo}\n
\n )}\n\n Publicado el \n