"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8136],{18136:function(t,n,e){e.d(n,{c:function(){return Q}});var i=e(92228),a=e(52322),r=e(30382),o=e.n(r),l=e(2784),c=e(45103),u=e(95128),s=e(31619),d=e(89254),f=e(2366),g=e(98621),m=e(47842),p=e(70865),x=e(72779),h=e.n(x),v=e(19596),T=e(91842),b={id:"common_ariaLabels_gotoTitle",defaultMessage:"View title page for {titleName}"},y={id:"common_ariaLabels_ratingButtonRated",defaultMessage:"Your rating: {rating}"},_={id:"common_ariaLabels_ratingButtonUnrated",defaultMessage:"Rate {titleName}"},R={id:"common_ratingPrompt_header",defaultMessage:"Rate this"},N={id:"common_ratingPrompt_rate",defaultMessage:"Rate"},C={id:"common_ratingPrompt_removeRating",defaultMessage:"Remove rating"},P={id:"common_ratingPrompt_ariaLabelPrefix",defaultMessage:"Rating"},I={id:"common_buttons_trailer",defaultMessage:"Trailer"};function w(){var t=(0,i.Z)(["\n display: flex;\n width: 100%;\n align-items: center;\n padding: "," 0;\n margin-bottom: -1rem;\n\n &.justify--space-between {\n justify-content: space-between;\n }\n\n &.justify--space-around {\n justify-content: space-around;\n }\n\n &.justify--left {\n justify-content: flex-start;\n }\n\n &.justify--right {\n justify-content: flex-end;\n }\n\n &.both-card-actions {\n > .card-action-button {\n margin-left: -0.25rem;\n padding-right: 0.5rem;\n padding-left: 0.5rem;\n }\n > .card-action-icon {\n margin-right: -0.25rem;\n }\n }\n\n > .card-action-button {\n text-overflow: ellipsis;\n overflow: hidden;\n }\n"]);return w=function(){return t},t}var j;!function(t){t.SPACE_BETWEEN="space-between",t.SPACE_AROUND="space-around",t.RIGHT="right",t.LEFT="left"}(j||(j={}));var Z=function(t){var n=t.title.latestTrailerId,e=t.refPrefix,i=t.refSuffix,r=t.iconButtons,o=(0,s.N)(I),l=(0,s.N)(I),u=[];if(n){var d="/video/".concat(n,"/?ref_=").concat(e,"tr_vp").concat(i);u.push({preIcon:"play-arrow",onColor:"textPrimary",href:d,ariaLabel:o,children:(0,a.jsx)("div",{className:"trailers-button-text","data-testid":"trailer-button",children:l})})}var f=j.SPACE_AROUND;if(1===(null===r||void 0===r?void 0:r.length)&&u.length<1&&(f=j.RIGHT),!(null===r||void 0===r?void 0:r.length)&&!u.length)return null;var g=h()(["justify--".concat(f)],(0,m.Z)({},"both-card-actions",(null===r||void 0===r?void 0:r.length)&&u.length));return(0,a.jsxs)(L,{className:g,children:[u.map((function(t,n){return(0,a.jsx)(c.TextButton,(0,p.Z)({className:h()("card-action-button",t.className)},t),n)})),null===r||void 0===r?void 0:r.map((function(t,n){return(0,a.jsx)(c.IconButton,(0,p.Z)({className:h()("card-action-icon",t.className)},t),n)}))]})},L=v.default.div.withConfig({componentId:"sc-3a643f09-0"})(w(),T.spacing.xs),B=e(96670),S=e(13813),M=e(58267);function k(){var t=(0,i.Z)(["\n max-height: ",";\n max-width: ",";\n vertical-align: middle;\n"]);return k=function(){return t},t}var E=function(t){var n=t.title.id,e=t.alternateButton,i=t.refPrefix,r=t.refSuffix,o=(0,S.y)(),l=o.pageType,u=o.subPageType;if(e){var s=(0,B.Z)((0,p.Z)({},e.props),{width:"full-width"});return(0,a.jsx)(c.SecondaryButton,(0,B.Z)((0,p.Z)({},s),{children:e.fetching?(0,a.jsx)(D,{className:"alternate-button-loader",type:"circle"}):e.text}))}return(0,a.jsx)(M.Z,{titleId:n,watchlistMetricsContext:{pageType:l,subPageType:u,refTag:"".concat(i,"wl_btn").concat(r)}},n)},D=(0,v.default)(c.Loader).withConfig({componentId:"sc-43e87107-0"})(k(),T.spacing.xl,T.spacing.xl),U=e(98788),F=e(45680),A=e(89363),W=e(61436),O=e(92281),$=e(90551),Y=e(95460),z=e(11992),G=e(26688);function H(){var t=(0,i.Z)(["\n min-height: 36px;\n"]);return H=function(){return t},t}var q=function(t){var n=t.className,e=t.title,i=e.id,r=e.titleText,o=e.ratingsSummary,u=e.canRate,d=t.refPrefix,f=t.refSuffix,g=(0,l.useState)(!1),m=g[0],p=g[1],x=(0,$.n)(),h=(0,c.useRatingsContext)(i),v=h.rating,T=h.updateRating,b=h.deleteRating,I=(0,W.P)(o,"imdb"),w=(0,W.P)(v,"user"),j="".concat(d,"rt").concat(f),Z="".concat(d.replace(/_/g,"-")).concat("urate"),L=(0,S.F)((0,S.y)()),B=u?function(){(0,Y.ar)(L,Z,z.qB.POP_UP),p(!0)}:void 0,M=(0,O.vY)({titleId:i,refTag:j,currentRating:v}),k=M.updateTitleRating,E=M.deleteTitleRating,D=M.tempRateUpdateLogRef,H=(0,s.N)(y,{rating:w}),q=(0,s.N)(_,{titleName:r}),V=(0,s.N)(R),X=(0,s.N)(N),J=(0,s.N)(C),Q=(0,s.N)(P);return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(K,{className:n,formattedImdbRating:I,formattedUserRating:w,onUserRatingClick:B,ariaLabelRated:H,ariaLabelUnrated:q}),B&&(0,a.jsx)(c.RatingPrompt,{isOpen:m,tconst:i,title:r,headerLabel:V,rateLabel:X,ariaLabelPrefix:Q,shouldUseNewRatingFlow:!0,secondaryButtonText:J,secondaryButtonType:A.uu.RemoveRating,onPrimaryButtonClicked:function(){var t=(0,U.Z)((function(t,n){return(0,F.__generator)(this,(function(e){switch(e.label){case 0:return t?x?(p(!1),T(t,j,(function(){return k(t,n)})),[3,3]):[3,1]:(p(!1),[2]);case 1:return[4,D(t,n)];case 2:e.sent(),(0,G.O)(t,n,j,L),e.label=3;case 3:return[2]}}))}));return function(n,e){return t.apply(this,arguments)}}(),onSecondaryButtonClicked:function(){var t=(0,U.Z)((function(t,n){return(0,F.__generator)(this,(function(t){return p(!1),b(j,(function(){return E(n)})),[2]}))}));return function(n,e){return t.apply(this,arguments)}}(),onCloseClicked:function(){p(!1)}})]})},K=(0,v.default)(c.PosterCard.RatingStarGroup).withConfig({componentId:"sc-35aa5ff-0"})(H());function V(){var t=(0,i.Z)(["\n fragment BaseTitleCard on Title {\n id\n titleText {\n text\n }\n titleType {\n id\n text\n canHaveEpisodes\n displayableProperty {\n value {\n plainText\n }\n }\n }\n originalTitleText {\n text\n }\n primaryImage {\n id\n width\n height\n url\n caption {\n plainText\n }\n }\n releaseYear {\n year\n endYear\n }\n ratingsSummary {\n aggregateRating\n voteCount\n }\n runtime {\n seconds\n }\n certificate {\n rating\n }\n canRate {\n isRatable\n }\n titleGenres {\n genres(limit: 3) {\n genre {\n text\n }\n }\n }\n canHaveEpisodes\n }\n "]);return V=function(){return t},t}function X(){var t=(0,i.Z)(["\n fragment TitleCardTrailer on Title {\n latestTrailer {\n id\n }\n }\n "]);return X=function(){return t},t}function J(){var t=(0,i.Z)(["\n fragment PersonalizedTitleCardUserRating on Title {\n userRating @include(if: $includeUserRating) {\n value\n }\n }\n "]);return J=function(){return t},t}var Q=function(t){var n=t.data,e=n.id,i=n.titleText,r=n.originalTitleText,o=n.titleType,l=n.primaryImage,m=n.ratingsSummary,p=n.canRate,x=n.latestTrailer,h=(0,g.hg)({weblabID:f.lh.IMDB_NEXT_EXPERIMENT_SINGLE_LINE_CARDS_919557,treatments:{T1:!0}}),v=t.refMarker,T=void 0===v?{}:v,y=T.prefix,_=void 0===y?"":y,R=T.suffix,N=void 0===R?"":R,C=_?"".concat(_,"_"):"",P=_?"_".concat(N):"",I=(0,d.K)({originalTitleText:r,titleText:i}),w=(0,s.N)(b,{titleName:I}),j="/title/".concat(e,"/?ref_=").concat(C,"tt_t").concat(P),L="string"===typeof t.className?t.className:void 0;return I&&o?(0,a.jsxs)(c.PosterCard,{dynamicWidth:!0,className:L,children:[(0,a.jsx)(u.y,{title:{id:e,titleText:I,titleTypeId:o.id,image:{url:null===l||void 0===l?void 0:l.url,height:null===l||void 0===l?void 0:l.height,width:null===l||void 0===l?void 0:l.width}},onClick:t.onClick,refPrefix:C,refSuffix:P}),(0,a.jsx)(q,{title:{id:e,titleText:I,ratingsSummary:null===m||void 0===m?void 0:m.aggregateRating,canRate:null===p||void 0===p?void 0:p.isRatable},refPrefix:C,refSuffix:P}),(0,a.jsx)(c.PosterCard.Title,{href:j,onClick:t.onClick,ariaLabel:w,lineClamp:h?1:void 0,children:(0,a.jsx)("span",{"data-testid":"title",children:I})}),(0,a.jsxs)(c.PosterCard.Actions,{children:[(0,a.jsx)(E,{title:{id:e},alternateButton:t.alternateButton,refPrefix:C,refSuffix:P}),(0,a.jsx)(Z,{title:{latestTrailerId:null===x||void 0===x?void 0:x.id},refPrefix:C,refSuffix:P,iconButtons:t.iconButtons})]})]}):null};Q.fragments={baseTitleCard:o()(V()),titleCardTrailer:o()(X()),personalizedTitleCardUserRating:o()(J())}},95128:function(t,n,e){e.d(n,{y:function(){return c}});var i=e(52322),a=(e(2784),e(45103)),r=e(31619),o=e(13813),l=e(23104),c=function(t){var n=t.className,e=t.title,c=e.id,u=e.titleText,s=e.titleTypeId,d=e.image,f=d.url,g=d.height,m=d.width,p=t.onClick,x=t.refPrefix,h=t.refSuffix,v="/title/".concat(c,"/?ref_=").concat(x,"tt_i").concat(h),T=(0,o.y)(),b=T.pageType,y=T.subPageType,_=(0,r.N)({id:"common_ariaLabels_gotoTitle",defaultMessage:"View title page for {titleName}"},{titleName:u});return(0,i.jsxs)(a.PosterCard.Poster,{href:v,ariaLabel:_,onClick:p,className:n,children:[(0,i.jsx)(l.Z,{titleId:c,watchlistMetricsContext:{pageType:b,subPageType:y,refTag:"".concat(x,"wl_rbn").concat(h)},onPoster:!0,className:"poster-card-watchlist-ribbon"},c),(0,i.jsx)(a.Poster.Image,{imageModel:f&&g&&m?{url:f,maxHeight:g,maxWidth:m,caption:u}:void 0,imageType:s,className:"poster-card-image",dynamicAspectRatio:!1})]})}},58267:function(t,n,e){e.d(n,{f:function(){return s}});var i=e(92228),a=e(52322),r=(e(2784),e(19596)),o=e(45103),l=e(75467),c=e(31619);function u(){var t=(0,i.Z)(["\n max-height: 30px;\n max-width: 30px;\n vertical-align: middle;\n"]);return u=function(){return t},t}var s=function(t){var n=t.titleId,e=t.watchlistMetricsContext,i=(0,c.N)({id:"common_buttons_watchlist",defaultMessage:"Watchlist"}),r=(0,c.N)({id:"common_ariaLabel_loading",defaultMessage:"Loading"});return(0,a.jsx)(l.WatchlistConsumer,{id:n,metricsContext:e,render:function(t){var n=t.inWatchlist,e=t.isLoading,l=t.onClick,c=(0,a.jsx)(o.SecondaryButton,{onClick:l,preIcon:n?"done":"add",width:"full-width",children:i});return e&&(c=(0,a.jsx)(o.SecondaryButton,{onClick:l,width:"full-width",ariaLabel:r,children:(0,a.jsx)(d,{"data-testid":"watchlist-button-loader",type:"circle"})})),c}})},d=(0,r.default)(o.Loader).withConfig({componentId:"sc-f81fedf8-0"})(u());n.Z=s},23104:function(t,n,e){var i=e(70865),a=e(96670),r=e(52322),o=(e(2784),e(45103)),l=e(75467);n.Z=function(t){var n=t.titleId,e=t.watchlistMetricsContext,c=t.onPoster,u=t.onImage,s=void 0===u||u,d=t.size,f=t.className;return(0,r.jsx)(l.WatchlistConsumer,{id:n,metricsContext:e,render:function(t){return c?(0,r.jsx)(o.Poster.WatchlistRibbon,(0,a.Z)((0,i.Z)({},t),{className:f,size:d})):(0,r.jsx)(o.WatchlistRibbon,(0,a.Z)((0,i.Z)({},t),{className:f,onImage:s,size:d}))}})}},61436:function(t,n,e){e.d(n,{P:function(){return r}});var i=e(73857),a={default:{maximumFractionDigits:1,minimumFractionDigits:1},imdb:{maximumFractionDigits:1,minimumFractionDigits:1},user:{maximumFractionDigits:0,minimumFractionDigits:0}},r=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"default",e=arguments.length>2?arguments[2]:void 0,r=(0,i.Z)();if(!t)return"";if(10===t)return"10";var o="user"===n?Math.trunc(t):Number(t.toFixed(1)),l=null!==e&&void 0!==e?e:a[n];return r.formatNumber(o,l)}},92281:function(t,n,e){e.d(n,{vY:function(){return h}});var i=e(98788),a=e(66383),r=e(92228),o=e(45680),l=e(30382),c=e.n(l),u=e(95460),s=e(11992),d=e(25140),f=e(48543);function g(){var t=(0,r.Z)(["\n mutation UpdateTitleRating($rating: Int!, $titleId: ID!) {\n rateTitle(input: { rating: $rating, titleId: $titleId }) {\n rating {\n value\n }\n }\n }\n"]);return g=function(){return t},t}function m(){var t=(0,r.Z)(["\n mutation DeleteTitleRating($titleId: ID!) {\n deleteTitleRating(input: { titleId: $titleId }) {\n date\n }\n }\n"]);return m=function(){return t},t}var p=c()(g()),x=c()(m()),h=function(t){var n=(0,a.Z)((0,f.Z)(p),2),e=(n[0],n[1]),r=(0,a.Z)((0,f.Z)(x),2),l=(r[0],r[1]),c=(0,d.B)().context,g={type:c.pageType,subType:c.subPageType,id:t.titleId},m=function(n){(0,u.K8)(t.refTag,g,n,s.qB.ACTION_ONLY)},h=function(){var t=(0,i.Z)((function(t,n){var e;return(0,o.__generator)(this,(function(i){return e="".concat("tmp-rating-add","-").concat(n,"-").concat(t),m(e),[2]}))}));return function(n,e){return t.apply(this,arguments)}}();return{updateTitleRating:function(t,n){var i="".concat("rating-add","-").concat(n,"-").concat(t);return m(i),e({rating:t,titleId:n})},deleteTitleRating:function(t){var n="".concat("rating-del","-").concat(t);return m(n),l({titleId:t})},tempRateUpdateLogRef:h}}}}]);