1import j from"./C4ggZHLQ.js";import{aP as N,aQ as z,aR as B,aS as J,dR as M,aT as a,aU as o,d0 as P,aX as E,bi as k,b0 as b,aV as i,dV as Z,bw as y,cR as q,d2 as V,aW as O,fN as G,b1 as s,dk as W,ec as H,b3 as Y,dC as Q,eg as X,b5 as K,d3 as ee,bA as te,aZ as C,a_ as U,f8 as r,bD as ae}from"./DqUoKSZT.js";import{a as ne}from"./BsBlJo2u.js";import{P as se}from"./DApT-KMa.js";import{u as re,o as ie}from"./DQyXtnC3.js";import{u as oe}from"./DpUyCZU2.js";import{o as le}from"./B6iQ-czK.js";import{_ as ce}from"./BFxdvv8E.js";import{u as ue}from"./BuZIXkFZ.js";import"./D6ib26MG.js";import"./COl0qh72.js";import"./eFD-pGqk.js";import"./DB3PCr5H.js";import"./C8IHZ5i3.js";import"./COrXGPYm.js";import"./DKFpnJaf.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};e.SENTRY_RELEASE={id:"5e0fb5f8cfa644e65037bca5f9960ea76b3077d0"};var n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="eecd4c5e-f5b1-444b-9d11-e183f1569da8",e._sentryDebugIdIdentifier="sentry-dbid-eecd4c5e-f5b1-444b-9d11-e183f1569da8")}catch{}})();const de={class:"rental-item__img-wrapper"},pe={key:1,class:"progress-bar"},me={class:"rental-item__details"},fe={class:"details-text"},ve={class:"details-text__title"},_e={class:"rent-again"},ge={class:"play-btn"},Te=N({__name:"TitleRentalItem",props:{rental:{},index:{}},setup(e){const n=e,{trackJwtvTitleRental:v}=oe(),{language:l,country:u}=z(B()),x=s(()=>n.rental.node.content.backdrops.map(t=>t.backdropUrl)),R=s(()=>{const t=n.rental;return Y.getTitleContextGraphql(t.node.objectId,t.node.objectType)}),d=s(()=>n.rental?.node?.offers?.find(t=>t.package?.shortName==="jwt"&&t.monetizationType===Q.Rent)),p=s(()=>new X(d.value).addContexts(R.value).set("uct_country",u.value)),{onVisibilityChanged:h}=ne({preventDuplicateAdditionalContext:!0}),{onIntersection:_}=re({additionalContexts:()=>[]});function L(t){d.value&&_(p.value,t)}const c=s(()=>({callback:L,...ie})),m=s(()=>{const t=n.rental.expiry;if(!t)return{status:"active",text:""};const f=new Date(t),S=new Date,g=f.getTime()-S.getTime(),A=Math.ceil(g/(1e3*60*60*24)),T=Math.ceil(g/(1e3*60*60)),w=`${l.value.split("-")[0]}-${u.value}`,D=Intl.DateTimeFormat().resolvedOptions().timeZone,$={hour:"2-digit",minute:"2-digit",timeZoneName:"short",timeZone:D};if(T<48&&T>=24)return{status:"active",text:`Expires tomorrow at ${f.toLocaleTimeString(w,$)}`};if(T<24&&T>=1)return{status:"active",text:`Expires today at ${f.toLocaleTimeString(w,$)}`};if(A>=2)return{status:"active",text:`Expires in ${A} Days`};if(T<0){const I=d.value?.retailPrice;return{status:"expired",text:I?`Rent again for ${I}`:"Rent again"}}return{status:"active",text:f.toLocaleDateString(w,{year:"numeric",month:"long",day:"2-digit",hour:"2-digit",minute:"2-digit",timeZoneName:"short",timeZone:D})}});async function F(){const t=n.rental.node;if(v("rented_title_click",{spec:{property:m.value.status==="expired"?"rent-again":"continue-watching"},contexts:[R.value]}),!d.value){W({message:"Error fetching JustWatch TV offer",duration:3e3});return}H(p.value),le({modalProps:{title:t,offer:d.value,additionalContexts:[p.value.contexts.LinkContext,p.value.contexts.ClickoutContextGraphql,p.value.contexts.TitleContextGraphql]}})}return(t,f)=>{const S=J("FontAwesomeIcon"),g=M("observe-visibility");return a(),o("div",{class:"rental-item",onClick:F},[P((a(),o("div",de,[x.value.length>0?(a(),k(se,{key:0,imageProfile:"backdrop",imageUrl:x.value[0],alt:e.rental.title,lazy:!1,class:"rental-item__img","object-position-top":!0},null,8,["imageUrl","alt"])):b("",!0),e.rental.playbackProgress!==null?(a(),o("div",pe,[i("div",{class:"progress-bar__inner",style:Z({width:`${e.rental.playbackProgress}%`})},null,4)])):b("",!0)])),[[g,E(h)({title:e.rental.node,index:e.index})]]),P((a(),o("div",me,[i("div",fe,[i("span",ve,y(e.rental.title),1),e.rental.expiry?(a(),o("div",{key:0,class:q(["details-text__expiry",{expired:m.value.status==="expired"}])},[i("span",null,y(m.value.status==="expired"?"Expired":m.value.text),1),m.value.status==="expired"?(a(),o(V,{key:0},[f[0]||(f[0]=i("div",{class:"divider"},null,-1)),i("span",_e,y(m.value.text),1)],64)):b("",!0)],2)):b("",!0)]),i("button",ge,[O(S,{icon:E(G)},null,8,["icon"])])])),[[g,c.value]])])}}}),be=K(Te,[["__scopeId","data-v-7e59d28f"]]),ye={class:"rental-title-list-card"},xe={class:"rental-title-list-card__grid rental-title-list-card__grid--new"},Re=N({__name:"TitleRentalList",props:{rentals:{}},setup(e){return(n,v)=>(a(),o("div",ye,[i("div",xe,[(a(!0),o(V,null,ee(e.rentals,(l,u)=>(a(),k(be,{key:u+l.title,rental:l,index:u},null,8,["rental","index"]))),128))])]))}}),ke={class:"user-rentals-page"},he={class:"container-fluid container-max-width"},Be=N({__name:"UserRentals",setup(e){const n=te(),v=s(()=>n.filters(ae.MY_RENTALS)),l=s(()=>v.value.inner_tab||r.ALL_RENTALS),u=s(()=>[{key:r.ALL_RENTALS,translation:"All"},{key:r.CURRENT_RENTALS,translation:"Current rentals"},{key:r.PAST_RENTALS,translation:"Past rentals"}]),x=s(()=>{switch(l.value){case r.ALL_RENTALS:return"No rentals found";case r.CURRENT_RENTALS:return"No current rentals found";case r.PAST_RENTALS:return"No past rentals found";default:return"No rentals found"}}),{allUserRentals:R,activeUserRentals:d,pastUserRentals:p,loading:h}=ue(),_=s(()=>{switch(l.value){case r.ALL_RENTALS:return R.value;case r.CURRENT_RENTALS:return d.value;case r.PAST_RENTALS:return p.value;default:return[]}});return(L,c)=>(a(),o("div",ke,[O(ce,{tabs:u.value,selectedTab:l.value,trackingLabel:"rentals",onScrollToTop:c[0]||(c[0]=m=>L.$emit("scrollToTop"))},null,8,["tabs","selectedTab"]),i("div",he,[_.value.length>0?(a(),k(Re,{key:0,rentals:_.value},null,8,["rentals"])):!E(h)&&_.value.length===0?(a(),k(j,{key:1},{title:C(()=>[U(y(x.value),1)]),message:C(()=>[...c[1]||(c[1]=[])]),button:C(()=>[...c[2]||(c[2]=[U(y(" "),-1)])]),_:1})):b("",!0)])]))}});
1export{Be as default}; 2//# sourceMappingURL=eopPfeWy.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.