(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[749],{6049:function(e,t,a){"use strict";a.r(t),a.d(t,{__N_SSP:function(){return G},default:function(){return q}});var l=a(2479),i=a(6557);let r=(0,i.Z)("div",{target:"e1j4xhjp0"})({name:"1m1hq9d",styles:"width:100%;padding:10px;height:100%;position:fixed;font-family:AGBold;src:url('../../../public/fonts/akzidenz/AkzidenzGrotesk-Bold.otf') format('opentype');font-size:14pt"});var n=a(2784);let s=(0,i.Z)("div",{target:"eht9a7r0"})({name:"67or3u",styles:"margin:auto;margin-top:5px;width:99%;border-top:1px solid #95a5a6;border-bottom:1px solid #95a5a6;display:flex;.indexTitle{font-size:12px;color:#95a5a6;}.nav{margin-left:auto;margin-right:auto;display:flex;justify-content:space-between;width:58%;}.alphabetNav{width:60%;display:flex;justify-content:space-between;}.link{color:#95a5a6;padding:3px;cursor:pointer;&:hover{color:white;}}.mobile{display:none;}.desktop{width:100%;}@media only screen and (max-width: 900px){.mobile{display:block;width:100%;.top{width:100%;display:block;.top-left{font-size:12px;color:#95a5a6;float:left;}.top-right{float:right;}}.nav-mobile{width:100%;display:flex;justify-content:center;.alphabetNav-mobile{margin:auto;width:80%;.alphabetlinksmobile{width:100%;display:flex;justify-content:space-around;overflow-x:auto;padding-left:170px;}}}}.desktop{display:none;}}"});var o=a(1664),d=a.n(o),c=a(9656),p=a(2903);let h=e=>{let{tags:t,videoTags:a,selectedVideo:l,lang:i="en",setIndexMedia:r,indexMedia:n}=e,o=[];t.forEach(e=>{e.tag.label&&o.push((e=>{let t=e.toLowerCase().split(" ");for(let e=0;e<t.length;e++)t[e]=t[e].charAt(0).toUpperCase()+t[e].substring(1);return t.join(" ").normalize("NFD").replace(/[\u0300-\u036f]/g,"")})(e.tag.label[i]))}),o.sort();let h=(()=>{let e=[];return n.data&&"media"===n.type?n.data.map((t,a)=>{(0===a||n.data&&t.charAt(0).toUpperCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"")!==n.data[a-1].charAt(0).toUpperCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"")&&!e.includes(t.charAt(0).toUpperCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"")))&&e.push(t.charAt(0).toUpperCase().normalize("NFD").replace(/[\u0300-\u036f]/g,""))}):"default"===n.type&&o.forEach((t,a)=>{(0===a||t.charAt(0).toUpperCase()!==o[a-1].charAt(0).toUpperCase())&&e.push(t.charAt(0).toUpperCase())}),e})();return(0,p.tZ)(p.HY,{children:a.length>0&&l&&"false"!==l.thumb||l&&l.tags&&""!==l.tags[0].tag_slug?(0,p.tZ)(c.L,{categories:a,lang:i}):(0,p.BX)(s,{children:[(0,p.tZ)("div",{className:"desktop",children:(0,p.tZ)("div",{className:"nav",children:(0,p.tZ)("div",{className:"alphabetNav",children:h.map(e=>(0,p.tZ)(d(),{href:"#"+e,passHref:!0,children:(0,p.tZ)("p",{className:"link",children:e})},e))})})}),(0,p.BX)("div",{className:"mobile",children:[(0,p.BX)("div",{className:"top",children:[(0,p.tZ)("div",{className:"top-left",children:"Index"}),(0,p.BX)("div",{className:"top-right",children:[(0,p.tZ)("button",{className:"link",children:"DATE"}),(0,p.tZ)("button",{className:"link",children:"MEDIA"})]})]}),(0,p.tZ)("div",{className:"nav-mobile",children:(0,p.tZ)("div",{className:"alphabetNav-mobile",children:(0,p.tZ)("div",{className:"alphabetlinksmobile",children:h.map(e=>(0,p.tZ)(d(),{href:"#"+e,passHref:!0,children:(0,p.tZ)("p",{className:"link",children:e})},e))})})})]})]})})},m=(0,i.Z)("div",{target:"e1fqxxv00"})({name:"q4o1fo",styles:"@media screen and (min-width: 1024px){.btn-mobile{display:none;}}.desktop{.embed-menu{margin-left:80px;margin-top:-130px;width:100px;cursor:pointer;position:fixed;.toggle{margin-left:20px;height:30px;margin-top:90px;}.toggle-road{margin-top:79px;margin-left:34px;height:45px;width:30px;}.toggle-workshop{margin-top:79px;margin-left:27px;height:45px;}}.index-topbar{width:97%;border-top:1px solid #95a5a6;border-bottom:1px solid #95a5a6;margin:auto;display:flex;justify-content:space-between;.desktop{width:100%;display:flex;justify-content:space-between;}.left{width:20%;margin-left:5px;color:#95a5a6;}.right{width:20%;display:flex;justify-content:end;.favBtn{margin-top:2.5px;height:20px;cursor:pointer;}.allBtn{margin-right:5px;height:19.5px;margin-top:2px;cursor:pointer;}}.center{text-align:center;display:flex;justify-content:center;}.center-icon{cursor:pointer;margin-left:3px;margin-right:3px;&:hover{scale:1.1;}}}.video-topbar{margin-top:-30px;.head{width:97%;border-top:1px solid #95a5a6;border-bottom:1px solid #95a5a6;margin:auto;display:flex;justify-content:space-between;.desktop{width:100%;display:flex;justify-content:space-between;}.left{width:35%;margin-left:5px;color:#95a5a6;display:flex;.favBtn{margin-left:15px;&:hover{filter:brightness(125);}}.credBtn{margin-left:5px;&:hover{filter:brightness(125);}}}.right{width:35%;display:flex;justify-content:end;.favBtn{margin-top:2.5px;height:20px;cursor:pointer;}.allBtn{margin-right:5px;height:19.5px;margin-top:2px;cursor:pointer;}}.arrow{height:17px;margin-top:2.3px;cursor:pointer;}.dir-right{margin-right:-5px;margin-left:5px;}.dir-left{margin-right:5px;margin-left:-5px;}.center{text-align:center;display:flex;justify-content:center;}.center-icon{cursor:pointer;margin-left:3px;margin-right:3px;&:hover{scale:1.1;}}}}}.mobile{display:none;}.btn-icon{height:20px;margin-top:3px;cursor:pointer;margin-left:5px;&:hover{filter:brightness(130%);}}@media only screen and (max-width: 1520px) and (min-width: 650px){.desktop{.video-topbar{margin-top:4%;}}}@media only screen and (max-width: 650px){.embed-menu{display:none;}.desktop{display:none;}.mobile{display:block;margin-top:-230px;background:#1D1C22;.index-topbar{margin-top:120px;width:100%;border-top:1px solid #95a5a6;padding-top:3px;display:flex;justify-content:center;.allBtn{height:20px;margin-top:2px;margin-right:5px;}.favBtn{height:21px;margin-top:2px;}}.video-topbar{.head{color:#95a5a6;border-top:1px solid #95a5a6;border-bottom:1px solid #95a5a6;width:100%;.center{margin-top:-30px;}.arrow{margin-left:3px;margin-right:3px;margin-bottom:-3px;}.allBtn{height:20px;margin-top:2px;margin-right:5px;}.favBtn{height:21px;margin-top:2px;}}.center{width:100%;display:flex;justify-content:center;}.bottom{width:100%;display:flex;justify-content:center;}}.center{width:100%;display:flex;justify-content:center;}.bottom{width:100%;display:flex;justify-content:center;}}}"});var g=a(8059),u=a(6360),f=a(5067),b=a(8499),v=a(7732),Z=a(9725),x=a(9638),y=a(2599),N=a.n(y),w=a(7398),B=a(6577),k=a(162);let C=new u.g,A=e=>{let{selectedTag:t,selectedVideo:a,selectVideo:l,selectedMedia:i,lang:r="en",fav:s,setFav:o}=e,{0:c,1:h}=(0,n.useState)(C.findByCategory("index")),{0:u,1:y}=(0,n.useState)(!1),{0:A,1:E}=(0,n.useState)(!1),{0:H,1:M}=(0,n.useState)(!1),[S,O]=(0,b.ZP)("token","0"),{0:X,1:D}=(0,n.useState)(!1),{0:j,1:U}=(0,n.useState)([{htmlLabel:{en:'<b><i>Dance with Life. Anna, a Living Legend</i></…tp://www.annahalprin.org">www.annahalprin.org</a>',fr:'<b><i>Dance with Life. Anna, a Living Legend</i></…tp://www.annahalprin.org">www.annahalprin.org</a>'},id:11,index:!0,year:0}]);(0,n.useEffect)(()=>{S&&"0"!==S?D(!0):D(!1)},[S]),(0,n.useEffect)(()=>{if(t.label&&"false"!==t.label.en&&t.media)h(t.media);else if("false"!==i.thumb){let e=[];e.push(a),h(e)}},[t,i]);let z=async()=>{let e=N().decode(S,"Halprin-Web-App").user;console.log(await k.Z.put("/api/users",{email:e,playlist:"fav",media:a.media_slug}))},_=new w.k,L=!!a&&"false"!==a.thumb&&(()=>{if(a&&"false"!==a.thumb&&a.creditsIds)return _.getMediaCredits(a.creditsIds)})(),T={"Life-art":"en"===r?"My life & arts themes":"Ma vie et l'art",Roadmaps:"en"===r?"Roadmaps":"Feuilles de route",Workshops:"en"===r?"A workshop":"Un atelier",INDEX:"Index"};return(0,p.tZ)(p.HY,{children:(0,p.BX)(m,{children:[(0,p.tZ)("div",{className:"mobile",children:a&&"false"!==a.thumb&&c?(0,p.BX)("div",{className:"video-topbar",children:[(0,p.BX)("div",{className:"head",children:[(0,p.tZ)("div",{className:"left",children:S&&"0"!==S?(0,p.BX)("div",{children:[s?(0,p.tZ)("button",{className:"favBtn",onClick:()=>o(!1),children:(0,p.tZ)(v.G,{icon:B.Tab,color:"#cc8e35"})}):(0,p.tZ)("button",{className:"favBtn",onClick:()=>{z(),o(!0)},children:(0,p.tZ)(v.G,{icon:Z.Tab})}),(0,p.tZ)("button",{className:"credBtn",onClick:()=>{L&&L[0]&&U(L)},children:(0,p.tZ)(v.G,{icon:Z.rUM})})]}):null}),(0,p.BX)("div",{className:"center",children:[(0,p.tZ)("div",{className:"btn-mobile",children:c.indexOf(a)>0&&(0,p.tZ)(d(),{href:"#"+c[c.indexOf(a)-1].media_slug,passHref:!0,children:(0,p.tZ)("button",{onClick:()=>{l(c[c.indexOf(a)-1])},children:(0,p.tZ)("img",{src:"/images/ui/elements/left-arrow-halprin.png",alt:"<",className:"arrow dir-left"})})})}),!t||t.media||i?(0,p.BX)(p.HY,{children:[c.indexOf(a)+1," / ",c.length]}):null,(0,p.tZ)("div",{className:"btn-mobile",children:c.indexOf(a)<c.length-1&&(0,p.tZ)(d(),{href:"#"+c[c.indexOf(a)+1].media_slug,passHref:!0,children:(0,p.tZ)("button",{onClick:()=>{l(c[c.indexOf(a)+1])},children:(0,p.tZ)("img",{src:"/images/ui/elements/right-arrow-halprin.png",alt:">",className:"arrow dir-right"})})})})]}),(0,p.BX)("div",{className:"bottom",children:[(0,p.tZ)(d(),{href:"/video/all",passHref:!0,children:A?(0,p.tZ)("img",{src:"/images/ui/elements/all-halprin-hover.png",onMouseLeave:()=>E(!1),alt:"All",className:"allBtn"}):(0,p.tZ)("img",{src:"/images/ui/elements/all-halprin.png",onMouseEnter:()=>E(!0),alt:"All",className:"allBtn"})}),(0,p.tZ)(d(),{href:"/video/favorites",passHref:!0,children:H?(0,p.tZ)("img",{src:"/images/ui/elements/favorite-halprin.png",onMouseLeave:()=>M(!1),alt:"Favorite",className:"favBtn"}):(0,p.tZ)("img",{src:"/images/ui/elements/favorite-hover-halprin.png",onMouseEnter:()=>M(!0),alt:"Favorite",className:"favBtn"})}),(0,p.tZ)(d(),{href:"/video/watched",passHref:!0,children:(0,p.tZ)("img",{src:"/images/ui/video/eye-arrow.png",className:"btn-icon",alt:"Already seen"})}),(0,p.tZ)(d(),{href:"/video/unwatched",passHref:!0,children:(0,p.tZ)("img",{src:"/images/ui/video/eye.png",className:"btn-icon",alt:"Unseen"})})]})]}),(0,p.tZ)(g.C,{lang:r,media:c,selectedVideo:a,selectVideo:l})]}):(0,p.BX)("div",{className:"index-topbar",children:[(0,p.tZ)(d(),{href:"/video/all",passHref:!0,children:A?(0,p.tZ)("img",{src:"/images/ui/elements/all-halprin-hover.png",onMouseLeave:()=>E(!1),alt:"All",className:"allBtn"}):(0,p.tZ)("img",{src:"/images/ui/elements/all-halprin.png",onMouseEnter:()=>E(!0),alt:"All",className:"allBtn"})}),(0,p.tZ)(d(),{href:"/video/favorites",passHref:!0,children:H?(0,p.tZ)("img",{src:"/images/ui/elements/favorite-halprin.png",onMouseLeave:()=>M(!1),alt:"Favorite",className:"favBtn"}):(0,p.tZ)("img",{src:"/images/ui/elements/favorite-hover-halprin.png",onMouseEnter:()=>M(!0),alt:"Favorite",className:"favBtn"})}),(0,p.tZ)(d(),{href:"/video/watched",passHref:!0,children:(0,p.tZ)("img",{src:"/images/ui/video/eye-arrow.png",className:"btn-icon",alt:"Already seen"})}),(0,p.tZ)(d(),{href:"/video/unwatched",passHref:!0,children:(0,p.tZ)("img",{src:"/images/ui/video/eye.png",className:"btn-icon",alt:"Unseen"})})]})}),(0,p.BX)("div",{className:"desktop",children:[(0,p.tZ)("div",{className:"embed-menu desktop",onMouseEnter:()=>y(!0),onMouseOver:()=>y(!0),onFocus:()=>y(!0),onMouseLeave:()=>y(!1),children:u?(0,p.tZ)(f.F,{selectVideo:l,selectedVideo:a}):(0,p.tZ)("img",{src:(null==a?void 0:a.category)==="life-art"?"/images/ui/menu/eye.png":(null==a?void 0:a.category)==="roadmaps"?"/images/ui/menu/hand.png":(null==a?void 0:a.category)==="workshops"?"/images/ui/menu/round.png":"/images/ui/menu/mouth.png",alt:"menu",className:(null==a?void 0:a.category)==="workshops"?"toggle-workshop":(null==a?void 0:a.category)==="roadmaps"?"toggle-road":"toggle"})}),a&&"false"!==a.thumb&&c?(0,p.BX)("div",{className:"video-topbar",children:[(0,p.BX)("div",{className:"head",children:[(0,p.BX)("div",{className:"left",children:[a?T[F(a.category)]:T[c[0]&&F(c[0].category)],S&&"0"!==S?(0,p.BX)("div",{children:[(0,p.tZ)("button",{className:"favBtn",onClick:()=>z(),children:(0,p.tZ)(v.G,{icon:Z.Tab})}),(0,p.tZ)("button",{className:"credBtn",onClick:()=>{L&&L[0]&&U(L)},children:(0,p.tZ)(v.G,{icon:Z.rUM})})]}):null]}),(0,p.BX)("div",{className:"center",children:[(0,p.tZ)("div",{className:"btn-mobile",children:c.indexOf(a)>0&&(0,p.tZ)(d(),{href:"#"+c[c.indexOf(a)-1].media_slug,passHref:!0,children:(0,p.tZ)(d(),{href:"#"+c[c.indexOf(a)-1].media_slug,passHref:!0,children:(0,p.tZ)("button",{onClick:()=>{l(c[c.indexOf(a)-1])},children:(0,p.tZ)("img",{src:"/images/ui/elements/left-arrow-halprin.png",alt:"<",className:"arrow dir-left"})})})})}),t&&!t.media?null:(0,p.BX)(p.HY,{children:[c.indexOf(a)+1," / ",c.length]}),(0,p.tZ)("div",{className:"btn-mobile",children:c.indexOf(a)<c.length-1&&(0,p.tZ)(d(),{href:"#"+c[c.indexOf(a)+1].media_slug,passHref:!0,children:(0,p.tZ)("button",{onClick:()=>{l(c[c.indexOf(a)+1])},children:(0,p.tZ)("img",{src:"/images/ui/elements/right-arrow-halprin.png",alt:">",className:"arrow dir-right"})})})})]}),(0,p.BX)("div",{className:"right",children:[(0,p.tZ)(d(),{href:"/video/all",passHref:!0,children:A?(0,p.tZ)("img",{src:"/images/ui/elements/all-halprin-hover.png",onMouseLeave:()=>E(!1),alt:"All",className:"allBtn"}):(0,p.tZ)("img",{src:"/images/ui/elements/all-halprin.png",onMouseEnter:()=>E(!0),alt:"All",className:"allBtn"})}),(0,p.tZ)(d(),{href:"/video/favorites",passHref:!0,children:H?(0,p.tZ)("img",{src:"/images/ui/elements/favorite-halprin.png",onMouseEnter:()=>M(!1),alt:"Favorite",className:"favBtn"}):(0,p.tZ)("img",{src:"/images/ui/elements/favorite-hover-halprin.png",onMouseEnter:()=>M(!0),alt:"Favorite",className:"favBtn"})}),(0,p.tZ)(d(),{href:"/video/watched",passHref:!0,children:(0,p.tZ)("img",{src:"/images/ui/video/eye-arrow.png",className:"btn-icon",alt:"Already Seen"})}),(0,p.tZ)(d(),{href:"/video/unwatched",passHref:!0,children:(0,p.tZ)("img",{src:"/images/ui/video/eye.png",className:"btn-icon",alt:"Unseen"})})]})]}),(0,p.tZ)(g.C,{lang:r,media:c,selectedVideo:a,selectVideo:l})]}):(0,p.BX)("div",{className:"index-topbar",children:[(0,p.tZ)("div",{className:"left",children:t&&t.label?(0,p.tZ)(p.HY,{children:"Index"}):null}),(0,p.BX)("div",{className:"right",children:[(0,p.tZ)(d(),{href:"/video/all",passHref:!0,children:A?(0,p.tZ)("img",{src:"/images/ui/elements/all-halprin-hover.png",onMouseLeave:()=>E(!1),alt:"All",className:"allBtn"}):(0,p.tZ)("img",{src:"/images/ui/elements/all-halprin.png",onMouseEnter:()=>E(!0),alt:"All",className:"allBtn"})}),(0,p.tZ)(d(),{href:"/video/favorites",passHref:!0,children:H?(0,p.tZ)("img",{src:"/images/ui/elements/favorite-halprin.png",onMouseLeave:()=>M(!1),alt:"Favorite",className:"favBtn"}):(0,p.tZ)("img",{src:"/images/ui/elements/favorite-hover-halprin.png",onMouseEnter:()=>M(!0),alt:"Favorite",className:"favBtn"})}),(0,p.tZ)(d(),{href:"/video/watched",passHref:!0,children:(0,p.tZ)("img",{src:"/images/ui/video/eye-arrow.png",className:"btn-icon",alt:"Already Seen"})}),(0,p.tZ)(d(),{href:"/video/unwatched",passHref:!0,children:(0,p.tZ)("img",{src:"/images/ui/video/eye.png",className:"btn-icon",alt:"Unseen"})})]})]})]}),0!==j[0].year?(0,p.tZ)(x.L,{showModal:U,modal:j,lang:r}):null]})})};function F(e){return e.charAt(0).toUpperCase()+e.slice(1)}var E=a(5420);let H=(0,i.Z)("div",{target:"e1mmh4n40"})({name:"1nppawt",styles:"padding:5px;margin-top:15px;width:60%;padding-bottom:50px;margin-left:auto;margin-right:auto;height:80%;.container{height:95%;overflow-y:auto;}.selected{color:red;&:hover{color:red;}}.tag{cursor:pointer;margin:5px;}table{width:100%;tr{border-top:1px solid grey;border-bottom:1px solid grey;}.desktop{width:100%;}}.letterTitle{text-align:center;th{margin:auto;}}td\xa0{cursor:pointer;&:hover{color:grey;}}.mobile{display:none;}@media only screen and (max-width: 1520px){height:60%;.video-container{margin-top:-3%;}}@media only screen and (max-width: 650px){.video-container{height:0;background:red;margin-top:-120px;}height:80%;width:96%;.container{height:80%;}.mobile{display:block;width:100%;tr{width:100%;td{width:100%;}}}.desktop{display:none;}}"}),M=e=>{let{selectedTag:t,setSelectedTag:a,selectVideo:l,selectedCred:i,selectCred:r,credits:s,selectedVideo:o,selectMedia:d,tags:c,chronologicMedia:h,lang:m="en",indexMedia:g}=e,f=e=>e.charAt(0).toUpperCase()+e.slice(1),b=e=>{let t,i;c.forEach(i=>{i.tag.label&&f(i.tag.label[m])===e&&i.tag.media&&(a(i.tag),l(i.tag.media[0]),r({label:"false",index:!0,id:0}),d({thumb:"false"}),t=!0)}),t||s.map(t=>{t.label===e&&(r(t),a({label:{en:"false",fr:""},media:[]}),d({thumb:"false"}),i=!0)}),i||t||new u.g().get().map(t=>{t.title&&t.title[m]===e&&(r({label:"false",index:!0,id:0}),a({label:{en:"false",fr:""},media:[]}),d(t),l(t))})},v=[];c.forEach(e=>{e.tag.label&&v.push(f(e.tag.label[m]))}),s.map(e=>{v.push(e.label)}),v.sort(Intl.Collator().compare);let Z=e=>{let{letter:a,titles:l}=e,r=[];"media"===g.type&&g.data?g.data.map(e=>{e.charAt(0).toUpperCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"")===a.normalize("NFD").replace(/[\u0300-\u036f]/g,"")&&r.push(e)}):"date"===g.type&&l&&"FALSE"===a?l.map(e=>{r.push(e)}):v.map(e=>{e.charAt(0).toUpperCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"")===a.normalize("NFD").replace(/[\u0300-\u036f]/g,"")&&r.push(e)});let o=e=>{let t="loading";return s.map((a,l)=>{a.label===e&&(t=!0),l===s.length-1&&!0!==t&&(t=!1)}),t};return(0,p.BX)(n.Fragment,{children:[r.length>2?r.map((e,l)=>(0,p.tZ)(n.Fragment,{children:((l+1)/3).toFixed(0).toString()===((l+1)/3).toString()?(0,p.BX)(p.HY,{children:[(0,p.BX)("tr",{className:"desktop",children:[(0,p.tZ)("td",{className:t.label&&f(t.label[m])===r[l-2]||i&&i.label===r[l-2]?"selected":"",children:(0,p.tZ)("button",{onClick:()=>b(r[l-2]),children:o(r[l-2])?(0,p.tZ)("i",{children:r[l-2]}):(0,p.tZ)(p.HY,{children:r[l-2]})})}),(0,p.tZ)("td",{className:t.label&&f(t.label[m])===r[l-1]||i&&i.label===r[l-1]?"selected":"",children:(0,p.tZ)("button",{onClick:()=>b(r[l-1]),children:o(r[l-1])?(0,p.tZ)("i",{children:r[l-1]}):(0,p.tZ)(p.HY,{children:r[l-1]})})}),(0,p.tZ)("td",{className:t.label&&f(t.label[m])===e||i&&i.label===e?"selected":"",children:(0,p.tZ)("button",{onClick:()=>b(e),children:o(e)?(0,p.tZ)("i",{children:e}):(0,p.tZ)(p.HY,{children:e})})})]},"tr"+a+l),!r[l+2]&&r[l+1]||!r[l+3]&&r[l+1]&&r[l+2]?(0,p.BX)("tr",{className:"desktop",children:[(0,p.tZ)("td",{className:t.label&&f(t.label[m])===r[l+1]||i&&i.label===r[l+1]?"selected":"",children:(0,p.tZ)("button",{onClick:()=>b(r[l+1]),children:o(r[l+1])?(0,p.tZ)("i",{children:r[l+1]}):(0,p.tZ)(p.HY,{children:r[l+1]})})}),r[l+2]?(0,p.tZ)("td",{className:t.label&&f(t.label[m])===r[l+2]||i&&i.label===r[l+2]?"selected":"",children:(0,p.tZ)("button",{onClick:()=>b(r[l+2]),children:o(r[l+2])?(0,p.tZ)("i",{children:r[l+2]}):(0,p.tZ)(p.HY,{children:r[l+2]})})}):null]}):null]}):null},"tag"+l)):(0,p.tZ)(n.Fragment,{children:(0,p.BX)("tr",{className:"desktop",children:[(0,p.tZ)("td",{className:t.label&&f(t.label[m])===r[0]||i&&i.label===r[0]?"selected":"",children:(0,p.tZ)("button",{onClick:()=>b(r[0]),children:o(r[0])?(0,p.tZ)("i",{children:r[0]}):(0,p.tZ)(p.HY,{children:r[0]})})}),r[1]?(0,p.tZ)("td",{className:t.label&&f(t.label[m])===r[1]||i&&i.label===r[1]?"selected":"",children:(0,p.tZ)("button",{onClick:()=>b(r[1]),children:o(r[1])?(0,p.tZ)("i",{children:r[1]}):(0,p.tZ)(p.HY,{children:r[1]})})}):null]},"tr-desk"+a)},"desktop"+a),(0,p.tZ)(n.Fragment,{children:r.map((e,l)=>(0,p.tZ)(n.Fragment,{children:(0,p.tZ)("tr",{className:"mobile",children:(0,p.tZ)("td",{colSpan:3,className:t.label&&f(t.label[m])===e||i&&i.label===e?"selected":"",children:(0,p.tZ)("button",{onClick:()=>b(e),children:o(e)?(0,p.tZ)("i",{children:e}):(0,p.tZ)(p.HY,{children:e})},"td-mobile-btn"+a)},"td-mobile"+a)},"tr-mobile"+a)},"mobile-tag-"+l))},"mobile-letter"+a)]},"letter-tag-"+a)};return(0,p.tZ)(H,{children:!o||o&&"false"===o.thumb?(0,p.tZ)("div",{className:"container",children:(0,p.tZ)("table",{children:(0,p.tZ)("tbody",{children:g.data&&"media"===g.type?g.data.map((e,t)=>0===t||g.data&&e.charAt(0).normalize("NFD").replace(/[\u0300-\u036f]/g,"")!==g.data[t-1].charAt(0).normalize("NFD").replace(/[\u0300-\u036f]/g,"")&&"E"!==e.charAt(0).normalize("NFD").replace(/[\u0300-\u036f]/g,"")?(0,p.BX)(n.Fragment,{children:[(0,p.tZ)("tr",{className:"letterTitle",id:e.charAt(0).toUpperCase(),children:(0,p.tZ)("th",{colSpan:3,children:e.charAt(0).toUpperCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"")})}),(0,p.tZ)(Z,{letter:e.charAt(0).toUpperCase()})]},t):"E"===e.charAt(0).normalize("NFD").replace(/[\u0300-\u036f]/g,"")&&"fr"===m&&17===t||g.data&&"E"===e.charAt(0).normalize("NFD").replace(/[\u0300-\u036f]/g,"")&&"en"===m&&e.charAt(0).normalize("NFD").replace(/[\u0300-\u036f]/g,"")!==g.data[t-1].charAt(0).normalize("NFD").replace(/[\u0300-\u036f]/g,"")?(0,p.BX)(n.Fragment,{children:[(0,p.tZ)("tr",{className:"letterTitle",id:e.charAt(0).toUpperCase(),children:(0,p.tZ)("th",{colSpan:3,children:e.charAt(0).toUpperCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"")})}),(0,p.tZ)(Z,{letter:e.charAt(0).toUpperCase()})]},t):void 0):"date"===g.type?[0].map((e,t)=>{let a=[];return h.forEach((e,t)=>{let l=[];e.map(e=>{e.title&&l.push(e.title[m])}),l.sort(),a.push((0,p.BX)(n.Fragment,{children:[(0,p.tZ)("tr",{className:"letterTitle",children:(0,p.tZ)("th",{colSpan:3,children:t})}),(0,p.tZ)(Z,{titles:l,letter:"FALSE"})]},t))}),(0,p.tZ)(n.Fragment,{children:a.map((e,t)=>(0,p.tZ)(n.Fragment,{children:e},t))},t)}):v.map((e,t)=>{if(0===t||e.charAt(0).normalize("NFD").replace(/[\u0300-\u036f]/g,"")!==v[t-1].charAt(0).normalize("NFD").replace(/[\u0300-\u036f]/g,""))return(0,p.BX)(n.Fragment,{children:[(0,p.tZ)("tr",{className:"letterTitle",id:e.charAt(0).toUpperCase(),children:(0,p.tZ)("th",{colSpan:3,children:e.charAt(0).toUpperCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"")})}),(0,p.tZ)(Z,{letter:e.charAt(0).toUpperCase()})]},t)})})})}):(0,p.tZ)("div",{className:"video-container",children:(0,p.tZ)("div",{className:"player",children:(0,p.tZ)(E.Y,{source:"index",video:o,lang:m,setFav:e.setFav,selectVideo:l,media:t.media})})})})};var S=a(8307),O=a(9780),X=a(2418);function D(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);t&&(l=l.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),a.push.apply(a,l)}return a}function j(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?D(Object(a),!0).forEach(function(t){(0,S.Z)(e,t,a[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):D(Object(a)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))})}return e}class U{constructor(e){(0,S.Z)(this,"data",void 0),(0,S.Z)(this,"getMediaByTags",()=>{let e=new Map([]);return this.data.forEach(t=>{t.tags&&t.tags.forEach(a=>{let{tag_slug:l}=a;if(e.has(l)){let a=e.get(l);if(void 0!==a)e.set(l,j(j({},a),{media:[...a.media,t]}));else throw Error("Unexpected empty existing medias, check your code")}else{var i;let a=null===(i=X.L.filter(e=>e.tag_slug===l))||void 0===i?void 0:i[0].label;a&&e.set(l,{media:[t],label:{en:a.en,fr:a.fr}})}})}),e}),this.data=(null==e?void 0:e.mediaData)??O.O}}var z=a(7970),_=a(4367),L=a(745);class T{static isPresent(e,t){if(null===e||void 0==e)throw T.createException(t,"Value is null or undefined.")}static safeInteger(e,t){if("number"!=typeof e||!Number.isSafeInteger(e))throw T.createException(t,"Value is not a safe integer")}static nonEmptyString(e,t,a){if(!(0,L.HH)(e,a??!0))throw T.createException(t)}static never(e,t){throw Error(t??"Unexpected value")}static createException(e,t){if("string"==typeof e||void 0===e)throw Error(e??t??"Assertion did not pass.");throw e()}}class I{}(0,S.Z)(I,"toSafeInteger",e=>(0,L.G_)(e)?"string"==typeof e?Number.parseInt(e,10):e:null),(0,S.Z)(I,"toFloat",e=>{if(!(0,L.mr)("number"==typeof e?e.toString(10):e??""))return null;let t=Number.parseFloat("string"==typeof e?e:e.toString(10));return Number.isNaN(t)?null:t});class V{constructor(e){(0,S.Z)(this,"data",void 0),(0,S.Z)(this,"getCredits",()=>this.data),(0,S.Z)(this,"getCredit",e=>{let t=I.toSafeInteger(e);T.isPresent(t,()=>Error("Cannot getCredit, invalid creditId parameter"));let a=this.data.filter(e=>e.id===t);return a.length>0?a[0]:null}),this.data=(null==e?void 0:e.creditsData)??_.U}}var Y=a(8263);let P=e=>{let{lang:t}=e,{0:a,1:i}=(0,n.useState)({label:{en:"false",fr:""},media:[]}),{0:s,1:o}=(0,n.useState)({label:"false",index:!0,id:0}),{0:d,1:c}=(0,n.useState)(!1),{0:m,1:g}=(0,n.useState)({thumb:"false"}),{0:f,1:b}=(0,n.useState)({thumb:"false"}),{0:v,1:Z}=(0,n.useState)([]),{0:x,1:y}=(0,n.useState)({type:"default"}),{0:N,1:w}=(0,n.useState)(new Map),B=Array.from(new U().getMediaByTags(),e=>{let[t,a]=e;return{slug:t,tag:a}}),k=new V,C=k.getCredits(),F=new u.g,E=[];return C.map(e=>{if(e.index){let a="en"===t?e.htmlLabel.en.split("</")[0].split(">")[2]:e.htmlLabel.fr.split("</")[0].split(">")[2];E.push({label:a,id:e.id})}}),(0,n.useEffect)(()=>{if(f&&"false"!==f.thumb&&f.tags){let e=[];f.tags.map(t=>{let a=t.tag_slug?new z.c().findBySlug(t.tag_slug):null;t.label=a?a.label:{fr:"",en:""},e.push({tag_slug:t.tag_slug,label:t.label,relevance:t.relevance})}),Z(e)}},[f]),(0,n.useEffect)(()=>{if(s&&"false"!==s.label){let e=F.findByCredits(s.id);i({label:{fr:s.label,en:s.label},media:e}),b(e[0])}},[s]),(0,n.useEffect)(()=>{if("loading-media"===x.type){let e=F.get(),a=[];e.map(e=>{if(e.title){let l="en"===t?e.title.en:e.title.fr;a.push(l)}}),y({type:"media",data:a.sort()})}else if("loading-date"===x.type){let e=F.get(),t=k.getCredits(),a=new Map;t.map(e=>{if(e.index){if(e.year&&a.get(e.year)){let t=a.get(e.year);a.set(e.year,[...t,e.id])}else e.year&&a.set(e.year,[e.id])}});let l=t=>{let a=[];return e.map(e=>{e.creditsIds&&e.creditsIds.map(l=>{t.includes(l)&&!a.includes(e)&&a.push(e)})}),a},i=new Map;a.forEach((e,t)=>{let a=l(e);i.set(t,a)}),y({type:"date"}),w(i)}},[x]),(0,p.tZ)(l.Z,{media:f,lang:t,children:(0,p.BX)("div",{children:[(0,p.tZ)(Y.k,{lang:t,index:{selectTag:i,selectVideo:b},source:"mouth"}),(0,p.BX)(r,{children:[(0,p.tZ)(h,{tags:B,videoTags:v,selectedVideo:f,lang:t,setIndexMedia:y,indexMedia:x}),(0,p.tZ)(M,{selectedTag:a,setSelectedTag:i,selectedVideo:f,selectVideo:b,selectedCred:s,selectCred:o,selectMedia:g,tags:B,credits:E,lang:t,setFav:c,indexMedia:x,chronologicMedia:N}),(0,p.tZ)(A,{selectedTag:a,selectedVideo:f,selectVideo:b,setFav:c,selectedMedia:m,lang:t,fav:d})]})]})})};var G=!0;function q(e){let{lang:t}=e;return(0,p.tZ)(P,{lang:t})}},759:function(e,t,a){(window.__NEXT_P=window.__NEXT_P||[]).push(["/tag-index",function(){return a(6049)}])}},function(e){e.O(0,[1,893,162,894,479,765,888,774,179],function(){return e(e.s=759)}),_N_E=e.O()}]);
//# sourceMappingURL=tag-index-18a770236f459b39.js.map