(this["webpackJsonpmusic-vine"]=this["webpackJsonpmusic-vine"]||[]).push([[57],{1406:function(e,t,s){"use strict";s.r(t);var a=s(4),c=s(5),n=s(8),i=s(7),r=s(6),l=s(1),o=s.n(l),d=s(29),h=s(252),u=s.n(h),p=s(2),b=s.n(p),y=s(66),j=s(831),g=s(255),m=s(799),f=s(188),v=s(821),O=s(848),_=s(24),x=s(49),k=s(0);function S(e){if(e.parent){if($("body").addClass("sub-style-parent"),e.parent.header_image)return{backgroundImage:"url(".concat(Object(x.b)(e.parent.header_image,"?auto=compress"),")"),backgroundPosition:"center",backgroundSize:"cover"}}else $("body").removeClass("sub-style-parent");return e.header_image?{backgroundImage:"url(".concat(Object(x.b)(e.header_image,"?auto=compress"),")"),backgroundPosition:"center",backgroundSize:"cover"}:null}function C(e){return e.parent?Object(k.jsxs)("div",{children:[Object(k.jsxs)("h4",{className:"browse-parent__style",children:[" ",Object(k.jsx)(_.a,{to:"/browse/style/".concat(e.parent.slug?e.parent.slug:e.parent.id),children:e.parent.name})]}),Object(k.jsx)("div",{className:"browse-parent__style-line"})]}):null}var w=function(e){var t=e.style;return Object(k.jsx)("div",{className:"d-flex flex-column d-lg-block",children:Object(k.jsx)("div",{style:S(t),className:"hero hero--styles",children:Object(k.jsxs)("div",{className:"hero__main hero__main--secondary",children:[Object(k.jsxs)("div",{className:"hero__intro hero__intro--secondary",children:[C(t),Object(k.jsx)("h1",{className:"hero__title hero__title--secondary".concat(t.description||0!==t.children.length?"":" no-style-info"),children:t.name}),Object(k.jsx)("span",{className:"hero__desc",children:t.description})]}),Object(k.jsx)("div",{className:"hero__categories",children:Object(k.jsx)("div",{className:"row",children:t.children&&t.children.map((function(e,t){return Object(k.jsx)("div",{className:"col-6 col-md-4",children:Object(k.jsx)("div",{className:"hero__list hero__list--left",children:Object(k.jsx)("ul",{className:"list-bare",children:Object(k.jsx)("li",{children:Object(k.jsx)(_.a,{to:"/browse/style/".concat(e.slug?e.slug:e.id),children:e.name})})})})},t)}))})})]})})})},N=s(14),I=s(838),F=s.n(I),L=function(e){var t=e.mainStyle,s=(e.subStyles,e.onFilterToggle,e.currentState);return Object(k.jsxs)("div",{className:"filter__categories",style:{width:"auto"},children:[Object(k.jsx)(N.a,{className:"filter__title filter__title--first",to:"/styles",children:"Styles"}),Object(k.jsx)("div",{children:Object(k.jsxs)("ul",{children:[Object(k.jsx)("li",{children:Object(k.jsx)(N.a,{className:"filter__styles-dropdown filter__styles-dropdown--main "+(s.style.name===t.name?"filter__breadcrumb-active":""),to:"/browse/style/".concat(t.slug),children:Object(k.jsx)(F.a,{text:t.name,length:30})})}),s.style.name!=t.name&&Object(k.jsx)("li",{children:Object(k.jsx)(N.a,{className:"filter__styles-dropdown--sub filter__breadcrumb-active",to:"/browse/style/".concat(s.style.slug?s.style.slug:s.style.id),children:Object(k.jsx)(F.a,{text:s.style.name,length:30})})})]})})]})},M=s(945),T=function(e){Object(i.a)(s,e);var t=Object(r.a)(s);function s(e){var c;return Object(a.a)(this,s),(c=t.call(this,e)).state={styleId:c.props.params.styleId,style:{},filter:!1},Object(j.d)(c.props.params.styleId).then((function(e){c.setState({style:e}),c.props.params.styleId!==e.slug&&e.slug&&c.props.router.push("/browse/style/"+e.slug)})).catch((function(e){return e})),c.loadData=c.loadData.bind(Object(n.a)(c)),c.onFilterToggle=c.onFilterToggle.bind(Object(n.a)(c)),c}return Object(c.a)(s,[{key:"componentWillMount",value:function(){this.props.onSetAppliedFilters(this.props.location.query)}},{key:"componentDidMount",value:function(){var e=this;window.addEventListener("popstate",(function(){e.props.onSetAppliedFilters(e.props.location.query),e.props.onSetNotFiltered()}),!1)}},{key:"componentDidUpdate",value:function(e){var t=this;(this.state.styleId!==this.props.params.styleId||this.props.location.search!==e.location.search&&""===this.props.location.search)&&(this.setState({styleId:this.props.params.styleId}),Object(j.d)(this.props.params.styleId).then((function(e){t.setState({style:e})})).catch((function(e){return e})),this.props.onFetchStyleTracks(this.props.params.styleId,0,0,"Relevance",0,[],1),this.props.onFetchStyleCollections(this.props.params.styleId,0,0,"Relevance",[],1),this.props.onSetAppliedFilters(this.props.location.query),this.props.onSetNotFiltered())}},{key:"loadData",value:function(e,t,s,a,c,n){Object(g.h)(e,t,s,a,c,n)?this.props.onFetchStyleTracks(this.state.styleId,e,t,s,a,c,n):this.props.onFetchAllStyleTracks(this.state.styleId,e,t,s,a,c,n),this.props.onFetchStyleCollections(this.state.styleId,e,t,s,c,n)}},{key:"onFilterToggle",value:function(){this.setState({filter:!this.state.filter})}},{key:"render",value:function(){var e=!1,t=null,s=null,a=null,c=this.state.style,n=[];this.state.style.parent&&(c=this.state.style.parent,n=this.state.style.parent.children,e=!0),this.state.style.children&&(n=this.state.style.children),Object.keys(this.state.style).length>0&&(t=Object(k.jsx)(w,{style:this.state.style}),a=Object(k.jsx)(L,{mainStyle:c,subStyles:n,onFilterToggle:this.onFilterToggle,currentState:this.state})),this.state.filter&&(s=Object(k.jsx)(M.a,{})),0===this.state.style.length?document.querySelector("body").classList.add("no-styles"):document.querySelector("body").classList.remove("no-styles"),this.state.styleId>0?document.querySelector("body").classList.add("main-styles-active"):document.querySelector("body").classList.remove("main-styles-active");var i="";c.name&&this.state.style.name!==c.name?i="".concat(this.state.style.name," ").concat(c.name," Music"):this.state.style.name&&(i="".concat(this.state.style.name," Music"));var r=Object(v.c)(this.state.style.meta_title,i,"style"),l=Object(v.b)(this.state.style.meta_description,{name:this.state.style.name},"style");return Object(k.jsxs)("section",{id:"browse-style-page",children:[Object(k.jsxs)(u.a,{children:[Object(k.jsx)("title",{children:r}),Object(k.jsx)("meta",{name:"description",content:l})]}),s,Object(k.jsx)(O.a,{breadcrumb:a,url:"/browse/style/".concat(this.state.styleId),hero:t,loadData:this.loadData,browseStyleId:this.state.styleId,hideCollection:e})]})}}]),s}(o.a.Component);T.contextTypes={router:b.a.object};var D=Object(y.createStructuredSelector)({});t.default=Object(d.b)(D,(function(e){return{onFetchStyleTracks:function(t,s,a,c,n,i,r){e(Object(g.f)("style",t,s,a,c,n,i,r))},onFetchAllStyleTracks:function(t,s,a,c,n,i,r){e(Object(g.a)("style",t,s,a,c,n,i,r,[]))},onFetchStyleCollections:function(t,s,a,c,n,i){e(Object(m.h)(t,s,a,c,n,i))},onSetAppliedFilters:function(t){e(Object(f.c)(t))},onSetNotFiltered:function(){e(Object(f.e)())}}}))(T)},821:function(e,t,s){"use strict";function a(e,t,s){var a=t,c="";if(e&&""!==e)return e;if(void 0===t||""===t)return"";switch(s){case"artist":c="Production Music Licensing";break;case"collection":c="Music For Video";break;case"style":case"track":case"general":c="Music Licensing";break;default:c="Music Licensing For Video And Film"}return"".concat(a," ").concat("\u2022"," ").concat(c," ").concat("\u2022"," ").concat("Music Vine")}function c(e,t,s){var a="";if(e&&""!==e)return e;if(void 0===t||""===t)return"";switch(s){case"collection":t&&t.desc&&t.name&&(a="".concat(t.desc," Explore '").concat(t.name,"' on Music Vine."));break;case"style":case"track":a="Music Licensing";break;case"general":a=t.subtitle?"".concat(t.name,". ").concat(t.subtitle):t.name;break;default:a=""}return a}function n(e,t){var s="";return e&&t&&(s="".concat(e," by ").concat(t," \u2022 Music Licensing \u2022 Music Vine")),s}function i(e,t,s,a){var c="";if(a)return"Page not found \u2022 Music Vine";if(e&&(c=e),t&&(c+=" \u2022 ".concat(t)),""===c){if(!s||""===s)return"";c="".concat(s," \u2022 Music Licensing")}return c+=" \u2022 Music Vine"}function r(e){var t="",s=l(e.styles,2),a=l(e.moods,2,s);return(t="Listen to this ".concat(a[0]," and ").concat(a[1]," track from ").concat(e.artist," that's perfect for ").concat(s[0]," and ").concat(s[1]," productions. License ").concat(e.track," now.")).includes("undefined")&&(t=""),t}function l(e,t,s){var a=[],c=!1;for(var n in e){for(var i in e[n])if(c=e[n][i][0],s&&s.includes(c)||a.push(c),a.length>=t)break;if(a.length>=t)break}return a}s.d(t,"c",(function(){return a})),s.d(t,"b",(function(){return c})),s.d(t,"e",(function(){return n})),s.d(t,"a",(function(){return i})),s.d(t,"d",(function(){return r}))},945:function(e,t,s){"use strict";s.d(t,"a",(function(){return S}));var a,c=s(4),n=s(5),i=s(8),r=s(7),l=s(6),o=s(1),d=s.n(o),h=s(847),u=s(831),p=s(45),b=s(24),y=s(44),j=Object(y.c)(b.a)(a||(a=Object(p.a)(["\n display: inline-block;\n text-decoration: none;\n border-radius: 4px;\n -webkit-font-smoothing: antialiased;\n -webkit-touch-callout: none;\n user-select: none;\n cursor: pointer;\n outline: 0;\n font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;\n font-weight: bold;\n font-size: 16px;\n"]))),g=s(81),m=s(1041),f=s(0),v=function(e){Object(r.a)(s,e);var t=Object(l.a)(s);function s(e){var a;return Object(c.a)(this,s),(a=t.call(this,e)).handleImageLoaded=a.handleImageLoaded.bind(Object(i.a)(a)),a}return Object(n.a)(s,[{key:"handleImageLoaded",value:function(){var e=$(".categories-main-block").height();$(".categories-main-block").css("height","auto");var t=$(".categories-main-block").height();(new m.a).fromTo($(".categories-main-block"),.4,{height:e},{height:t,ease:Power0.easeIn})}},{key:"render",value:function(){var e,t=g.a;return""!=this.props.style.tile_image&&(t=this.props.style.tile_image),this.props.style.tile_svg?(this.props.style.tile_svg=this.props.style.tile_svg.replace('id="Capa_1" ',""),this.props.style.tile_svg=this.props.style.tile_svg.replace(/Degradado_sin_nombre/g,"Degradado_sin_nombre_"+this.props.style.id),e=Object(f.jsx)("i",{dangerouslySetInnerHTML:{__html:this.props.style.tile_svg},onLoad:this.handleImageLoaded.bind(this)})):e=Object(f.jsx)("img",{src:t,alt:this.props.style.name,onLoad:this.handleImageLoaded.bind(this)}),Object(f.jsx)("div",{className:"col-6 col-lg-5ths styles-tiles",children:Object(f.jsx)(j,{to:"/browse/style/".concat(this.props.style.slug?this.props.style.slug:this.props.style.id),style:{display:"block"},children:Object(f.jsxs)("div",{className:"filter-styles__item categories-image-block",children:[Object(f.jsx)("div",{className:"filter-styles__item-overlay"}),e]})})})}}]),s}(d.a.Component),O=function(e){Object(r.a)(s,e);var t=Object(l.a)(s);function s(){return Object(c.a)(this,s),t.apply(this,arguments)}return Object(n.a)(s,[{key:"render",value:function(){for(var e=15-this.props.styles.length,t=[],s=0;s0;return Object(f.jsxs)("div",{className:"browse-filter-container",children:[!e&&Object(f.jsx)(k,{}),Object(f.jsxs)("div",{className:"row browse-filter-grid",children:[Object(f.jsx)("div",{className:"col-12 col-lg-2",children:Object(f.jsx)(_,{categories:this.state.categories,categoryId:this.state.categoryId,onCategorySelect:this.handleCategorySelect})}),Object(f.jsx)("div",{className:"col-12 col-lg-10 categories-main-block",style:{minHeight:e?"80vh":"0"},children:e&&Object(f.jsx)(O,{styles:this.state.styles})})]})]})}}]),s}(d.a.Component)}}]); //# sourceMappingURL=57.chunk.js.map?hash=501e8524