UNPKG

streaming-availability

Version:

Streaming Availability API allows getting streaming availability information of movies and series; and querying the list of available shows on streaming services such as Netflix, Disney+, Apple TV, Max and Hulu across 60 countries!

1 lines 58.6 kB
"use strict";(()=>{var p=(e,i)=>()=>(i||e((i={exports:{}}).exports,i),i.exports);var oe=p(d=>{"use strict";var _e=d&&d.__extends||function(){var e=function(i,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,t){a.__proto__=t}||function(a,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(a[r]=t[r])},e(i,n)};return function(i,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(i,n);function a(){this.constructor=i}i.prototype=n===null?Object.create(n):(a.prototype=n.prototype,new a)}}(),ee=d&&d.__assign||function(){return ee=Object.assign||function(e){for(var i,n=1,a=arguments.length;n<a;n++){i=arguments[n];for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(e[t]=i[t])}return e},ee.apply(this,arguments)},ne=d&&d.__awaiter||function(e,i,n,a){function t(r){return r instanceof n?r:new n(function(u){u(r)})}return new(n||(n=Promise))(function(r,u){function c(s){try{o(a.next(s))}catch(f){u(f)}}function l(s){try{o(a.throw(s))}catch(f){u(f)}}function o(s){s.done?r(s.value):t(s.value).then(c,l)}o((a=a.apply(e,i||[])).next())})},re=d&&d.__generator||function(e,i){var n={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},a,t,r,u;return u={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(u[Symbol.iterator]=function(){return this}),u;function c(o){return function(s){return l([o,s])}}function l(o){if(a)throw new TypeError("Generator is already executing.");for(;u&&(u=0,o[0]&&(n=0)),n;)try{if(a=1,t&&(r=o[0]&2?t.return:o[0]?t.throw||((r=t.return)&&r.call(t),0):t.next)&&!(r=r.call(t,o[1])).done)return r;switch(t=0,r&&(o=[o[0]&2,r.value]),o[0]){case 0:case 1:r=o;break;case 4:return n.label++,{value:o[1],done:!1};case 5:n.label++,t=o[1],o=[0];continue;case 7:o=n.ops.pop(),n.trys.pop();continue;default:if(r=n.trys,!(r=r.length>0&&r[r.length-1])&&(o[0]===6||o[0]===2)){n=0;continue}if(o[0]===3&&(!r||o[1]>r[0]&&o[1]<r[3])){n.label=o[1];break}if(o[0]===6&&n.label<r[1]){n.label=r[1],r=o;break}if(r&&n.label<r[2]){n.label=r[2],n.ops.push(o);break}r[2]&&n.ops.pop(),n.trys.pop();continue}o=i.call(e,n)}catch(s){o=[6,s],t=0}finally{a=r=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}};Object.defineProperty(d,"__esModule",{value:!0});d.TextApiResponse=d.BlobApiResponse=d.VoidApiResponse=d.JSONApiResponse=d.canConsumeForm=d.mapValues=d.querystring=d.COLLECTION_FORMATS=d.RequiredError=d.FetchError=d.ResponseError=d.BaseAPI=d.DefaultConfig=d.Configuration=d.BASE_PATH=void 0;d.BASE_PATH="https://api.movieofthenight.com/v4".replace(/\/+$/,"");var Xe=function(){function e(i){i===void 0&&(i={}),this.configuration=i}return Object.defineProperty(e.prototype,"config",{set:function(i){this.configuration=i},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"basePath",{get:function(){return this.configuration.basePath!=null?this.configuration.basePath:d.BASE_PATH},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fetchApi",{get:function(){return this.configuration.fetchApi},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"middleware",{get:function(){return this.configuration.middleware||[]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"queryParamsStringify",{get:function(){return this.configuration.queryParamsStringify||ve},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"username",{get:function(){return this.configuration.username},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"password",{get:function(){return this.configuration.password},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"apiKey",{get:function(){var i=this.configuration.apiKey;if(i)return typeof i=="function"?i:function(){return i}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"accessToken",{get:function(){var i=this,n=this.configuration.accessToken;if(n)return typeof n=="function"?n:function(){return ne(i,void 0,void 0,function(){return re(this,function(a){return[2,n]})})}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"headers",{get:function(){return this.configuration.headers},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"credentials",{get:function(){return this.configuration.credentials},enumerable:!1,configurable:!0}),e}();d.Configuration=Xe;d.DefaultConfig=new Xe;var Sr=function(){function e(i){i===void 0&&(i=d.DefaultConfig);var n=this;this.configuration=i,this.fetchApi=function(a,t){return ne(n,void 0,void 0,function(){var r,u,c,w,l,o,s,f,w,h,T,w;return re(this,function(O){switch(O.label){case 0:r={url:a,init:t},u=0,c=this.middleware,O.label=1;case 1:return u<c.length?(w=c[u],w.pre?[4,w.pre(ee({fetch:this.fetchApi},r))]:[3,3]):[3,4];case 2:r=O.sent()||r,O.label=3;case 3:return u++,[3,1];case 4:l=void 0,O.label=5;case 5:return O.trys.push([5,7,,12]),[4,(this.configuration.fetchApi||fetch)(r.url,r.init)];case 6:return l=O.sent(),[3,12];case 7:o=O.sent(),s=0,f=this.middleware,O.label=8;case 8:return s<f.length?(w=f[s],w.onError?[4,w.onError({fetch:this.fetchApi,url:r.url,init:r.init,error:o,response:l?l.clone():void 0})]:[3,10]):[3,11];case 9:l=O.sent()||l,O.label=10;case 10:return s++,[3,8];case 11:if(l===void 0)throw o instanceof Error?new ze(o,"The request failed and the interceptors did not return an alternative response"):o;return[3,12];case 12:h=0,T=this.middleware,O.label=13;case 13:return h<T.length?(w=T[h],w.post?[4,w.post({fetch:this.fetchApi,url:r.url,init:r.init,response:l.clone()})]:[3,15]):[3,16];case 14:l=O.sent()||l,O.label=15;case 15:return h++,[3,13];case 16:return[2,l]}})})},this.middleware=i.middleware}return e.prototype.withMiddleware=function(){for(var i,n=[],a=0;a<arguments.length;a++)n[a]=arguments[a];var t=this.clone();return t.middleware=(i=t.middleware).concat.apply(i,n),t},e.prototype.withPreMiddleware=function(){for(var i=[],n=0;n<arguments.length;n++)i[n]=arguments[n];var a=i.map(function(t){return{pre:t}});return this.withMiddleware.apply(this,a)},e.prototype.withPostMiddleware=function(){for(var i=[],n=0;n<arguments.length;n++)i[n]=arguments[n];var a=i.map(function(t){return{post:t}});return this.withMiddleware.apply(this,a)},e.prototype.isJsonMime=function(i){return i?e.jsonRegex.test(i):!1},e.prototype.request=function(i,n){return ne(this,void 0,void 0,function(){var a,t,r,u;return re(this,function(c){switch(c.label){case 0:return[4,this.createFetchParams(i,n)];case 1:return a=c.sent(),t=a.url,r=a.init,[4,this.fetchApi(t,r)];case 2:if(u=c.sent(),u&&u.status>=200&&u.status<300)return[2,u];throw new Ye(u,"Response returned an error code")}})})},e.prototype.createFetchParams=function(i,n){return ne(this,void 0,void 0,function(){var a,t,r,u,c,l,o,s,f=this;return re(this,function(h){switch(h.label){case 0:return a=this.configuration.basePath+i.path,i.query!==void 0&&Object.keys(i.query).length!==0&&(a+="?"+this.configuration.queryParamsStringify(i.query)),t=Object.assign({},this.configuration.headers,i.headers),Object.keys(t).forEach(function(T){return t[T]===void 0?delete t[T]:{}}),r=typeof n=="function"?n:function(){return ne(f,void 0,void 0,function(){return re(this,function(T){return[2,n]})})},u={method:i.method,headers:t,body:i.body,credentials:this.configuration.credentials},l=[ee({},u)],[4,r({init:u,context:i})];case 1:return c=ee.apply(void 0,l.concat([h.sent()])),mr(c.body)||c.body instanceof URLSearchParams||gr(c.body)?o=c.body:this.isJsonMime(t["Content-Type"])?o=JSON.stringify(c.body):o=c.body,s=ee(ee({},c),{body:o}),[2,{url:a,init:s}]}})})},e.prototype.clone=function(){var i=this.constructor,n=new i(this.configuration);return n.middleware=this.middleware.slice(),n},e.jsonRegex=new RegExp("^(:?application/json|[^;/ ]+/[^;/ ]+[+]json)[ ]*(:?;.*)?$","i"),e}();d.BaseAPI=Sr;function gr(e){return typeof Blob<"u"&&e instanceof Blob}function mr(e){return typeof FormData<"u"&&e instanceof FormData}var Ye=function(e){_e(i,e);function i(n,a){var t=e.call(this,a)||this;return t.response=n,t.name="ResponseError",t}return i}(Error);d.ResponseError=Ye;var ze=function(e){_e(i,e);function i(n,a){var t=e.call(this,a)||this;return t.cause=n,t.name="FetchError",t}return i}(Error);d.FetchError=ze;var Or=function(e){_e(i,e);function i(n,a){var t=e.call(this,a)||this;return t.field=n,t.name="RequiredError",t}return i}(Error);d.RequiredError=Or;d.COLLECTION_FORMATS={csv:",",ssv:" ",tsv:" ",pipes:"|"};function ve(e,i){return i===void 0&&(i=""),Object.keys(e).map(function(n){return Ve(n,e[n],i)}).filter(function(n){return n.length>0}).join("&")}d.querystring=ve;function Ve(e,i,n){n===void 0&&(n="");var a=n+(n.length?"[".concat(e,"]"):e);if(i instanceof Array){var t=i.map(function(u){return encodeURIComponent(String(u))}).join("&".concat(encodeURIComponent(a),"="));return"".concat(encodeURIComponent(a),"=").concat(t)}if(i instanceof Set){var r=Array.from(i);return Ve(e,r,n)}return i instanceof Date?"".concat(encodeURIComponent(a),"=").concat(encodeURIComponent(i.toISOString())):i instanceof Object?ve(i,a):"".concat(encodeURIComponent(a),"=").concat(encodeURIComponent(String(i)))}function wr(e,i){return Object.keys(e).reduce(function(n,a){var t;return ee(ee({},n),(t={},t[a]=i(e[a]),t))},{})}d.mapValues=wr;function Tr(e){for(var i=0,n=e;i<n.length;i++){var a=n[i];if(a.contentType==="multipart/form-data")return!0}return!1}d.canConsumeForm=Tr;var Nr=function(){function e(i,n){n===void 0&&(n=function(a){return a}),this.raw=i,this.transformer=n}return e.prototype.value=function(){return ne(this,void 0,void 0,function(){var i;return re(this,function(n){switch(n.label){case 0:return i=this.transformer,[4,this.raw.json()];case 1:return[2,i.apply(this,[n.sent()])]}})})},e}();d.JSONApiResponse=Nr;var Jr=function(){function e(i){this.raw=i}return e.prototype.value=function(){return ne(this,void 0,void 0,function(){return re(this,function(i){return[2,void 0]})})},e}();d.VoidApiResponse=Jr;var br=function(){function e(i){this.raw=i}return e.prototype.value=function(){return ne(this,void 0,void 0,function(){return re(this,function(i){switch(i.label){case 0:return[4,this.raw.blob()];case 1:return[2,i.sent()]}})})},e}();d.BlobApiResponse=br;var _r=function(){function e(i){this.raw=i}return e.prototype.value=function(){return ne(this,void 0,void 0,function(){return re(this,function(i){switch(i.label){case 0:return[4,this.raw.text()];case 1:return[2,i.sent()]}})})},e}();d.TextApiResponse=_r});var fe=p(R=>{"use strict";Object.defineProperty(R,"__esModule",{value:!0});R.ServiceImageSetToJSON=R.ServiceImageSetFromJSONTyped=R.ServiceImageSetFromJSON=R.instanceOfServiceImageSet=void 0;function vr(e){return!(!("lightThemeImage"in e)||!("darkThemeImage"in e)||!("whiteImage"in e))}R.instanceOfServiceImageSet=vr;function Fr(e){return He(e,!1)}R.ServiceImageSetFromJSON=Fr;function He(e,i){return e==null?e:{lightThemeImage:e.lightThemeImage,darkThemeImage:e.darkThemeImage,whiteImage:e.whiteImage}}R.ServiceImageSetFromJSONTyped=He;function Cr(e){return e==null?e:{lightThemeImage:e.lightThemeImage,darkThemeImage:e.darkThemeImage,whiteImage:e.whiteImage}}R.ServiceImageSetToJSON=Cr});var le=p(P=>{"use strict";Object.defineProperty(P,"__esModule",{value:!0});P.AddonToJSON=P.AddonFromJSONTyped=P.AddonFromJSON=P.instanceOfAddon=void 0;var Ue=fe();function Ir(e){return!(!("id"in e)||!("name"in e)||!("homePage"in e)||!("themeColorCode"in e)||!("imageSet"in e))}P.instanceOfAddon=Ir;function Ar(e){return Qe(e,!1)}P.AddonFromJSON=Ar;function Qe(e,i){return e==null?e:{id:e.id,name:e.name,homePage:e.homePage,themeColorCode:e.themeColorCode,imageSet:(0,Ue.ServiceImageSetFromJSON)(e.imageSet)}}P.AddonFromJSONTyped=Qe;function Er(e){return e==null?e:{id:e.id,name:e.name,homePage:e.homePage,themeColorCode:e.themeColorCode,imageSet:(0,Ue.ServiceImageSetToJSON)(e.imageSet)}}P.AddonToJSON=Er});var Fe=p(J=>{"use strict";Object.defineProperty(J,"__esModule",{value:!0});J.ChangeTypeToJSON=J.ChangeTypeFromJSONTyped=J.ChangeTypeFromJSON=J.instanceOfChangeType=J.ChangeType=void 0;J.ChangeType={New:"new",Removed:"removed",Updated:"updated",Expiring:"expiring",Upcoming:"upcoming"};function Rr(e){return Object.values(J.ChangeType).includes(e)}J.instanceOfChangeType=Rr;function Pr(e){return We(e,!1)}J.ChangeTypeFromJSON=Pr;function We(e,i){return e}J.ChangeTypeFromJSONTyped=We;function Mr(e){return e}J.ChangeTypeToJSON=Mr});var Ce=p(b=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});b.ItemTypeToJSON=b.ItemTypeFromJSONTyped=b.ItemTypeFromJSON=b.instanceOfItemType=b.ItemType=void 0;b.ItemType={Show:"show",Season:"season",Episode:"episode"};function Kr(e){return Object.values(b.ItemType).includes(e)}b.instanceOfItemType=Kr;function Gr(e){return $e(e,!1)}b.ItemTypeFromJSON=Gr;function $e(e,i){return e}b.ItemTypeFromJSONTyped=$e;function Lr(e){return e}b.ItemTypeToJSON=Lr});var he=p(M=>{"use strict";Object.defineProperty(M,"__esModule",{value:!0});M.ServiceInfoToJSON=M.ServiceInfoFromJSONTyped=M.ServiceInfoFromJSON=M.instanceOfServiceInfo=void 0;var Ze=fe();function Br(e){return!(!("id"in e)||!("name"in e)||!("homePage"in e)||!("themeColorCode"in e)||!("imageSet"in e))}M.instanceOfServiceInfo=Br;function Dr(e){return je(e,!1)}M.ServiceInfoFromJSON=Dr;function je(e,i){return e==null?e:{id:e.id,name:e.name,homePage:e.homePage,themeColorCode:e.themeColorCode,imageSet:(0,Ze.ServiceImageSetFromJSON)(e.imageSet)}}M.ServiceInfoFromJSONTyped=je;function qr(e){return e==null?e:{id:e.id,name:e.name,homePage:e.homePage,themeColorCode:e.themeColorCode,imageSet:(0,Ze.ServiceImageSetToJSON)(e.imageSet)}}M.ServiceInfoToJSON=qr});var pe=p(_=>{"use strict";Object.defineProperty(_,"__esModule",{value:!0});_.ShowTypeToJSON=_.ShowTypeFromJSONTyped=_.ShowTypeFromJSON=_.instanceOfShowType=_.ShowType=void 0;_.ShowType={Movie:"movie",Series:"series"};function xr(e){return Object.values(_.ShowType).includes(e)}_.instanceOfShowType=xr;function kr(e){return en(e,!1)}_.ShowTypeFromJSON=kr;function en(e,i){return e}_.ShowTypeFromJSONTyped=en;function Xr(e){return e}_.ShowTypeToJSON=Xr});var ye=p(v=>{"use strict";Object.defineProperty(v,"__esModule",{value:!0});v.StreamingOptionTypeToJSON=v.StreamingOptionTypeFromJSONTyped=v.StreamingOptionTypeFromJSON=v.instanceOfStreamingOptionType=v.StreamingOptionType=void 0;v.StreamingOptionType={Free:"free",Subscription:"subscription",Buy:"buy",Rent:"rent",Addon:"addon"};function Yr(e){return Object.values(v.StreamingOptionType).includes(e)}v.instanceOfStreamingOptionType=Yr;function zr(e){return nn(e,!1)}v.StreamingOptionTypeFromJSON=zr;function nn(e,i){return e}v.StreamingOptionTypeFromJSONTyped=nn;function Vr(e){return e}v.StreamingOptionTypeToJSON=Vr});var Ie=p(K=>{"use strict";Object.defineProperty(K,"__esModule",{value:!0});K.ChangeToJSON=K.ChangeFromJSONTyped=K.ChangeFromJSON=K.instanceOfChange=void 0;var rn=le(),tn=Fe(),on=Ce(),an=he(),un=pe(),sn=ye();function Hr(e){return!(!("changeType"in e)||!("itemType"in e)||!("showId"in e)||!("showType"in e)||!("service"in e)||!("streamingOptionType"in e))}K.instanceOfChange=Hr;function Ur(e){return cn(e,!1)}K.ChangeFromJSON=Ur;function cn(e,i){return e==null?e:{changeType:(0,tn.ChangeTypeFromJSON)(e.changeType),itemType:(0,on.ItemTypeFromJSON)(e.itemType),showId:e.showId,showType:(0,un.ShowTypeFromJSON)(e.showType),season:e.season==null?void 0:e.season,episode:e.episode==null?void 0:e.episode,service:(0,an.ServiceInfoFromJSON)(e.service),streamingOptionType:(0,sn.StreamingOptionTypeFromJSON)(e.streamingOptionType),addon:e.addon==null?void 0:(0,rn.AddonFromJSON)(e.addon),timestamp:e.timestamp==null?void 0:e.timestamp,link:e.link==null?void 0:e.link}}K.ChangeFromJSONTyped=cn;function Qr(e){return e==null?e:{changeType:(0,tn.ChangeTypeToJSON)(e.changeType),itemType:(0,on.ItemTypeToJSON)(e.itemType),showId:e.showId,showType:(0,un.ShowTypeToJSON)(e.showType),season:e.season,episode:e.episode,service:(0,an.ServiceInfoToJSON)(e.service),streamingOptionType:(0,sn.StreamingOptionTypeToJSON)(e.streamingOptionType),addon:(0,rn.AddonToJSON)(e.addon),timestamp:e.timestamp,link:e.link}}K.ChangeToJSON=Qr});var dn=p(G=>{"use strict";Object.defineProperty(G,"__esModule",{value:!0});G.ChangesResultToJSON=G.ChangesResultFromJSONTyped=G.ChangesResultFromJSON=G.instanceOfChangesResult=void 0;var fn=Ie();function Wr(e){return!(!("changes"in e)||!("shows"in e)||!("hasMore"in e))}G.instanceOfChangesResult=Wr;function $r(e){return ln(e,!1)}G.ChangesResultFromJSON=$r;function ln(e,i){return e==null?e:{changes:e.changes.map(fn.ChangeFromJSON),shows:e.shows,hasMore:e.hasMore,nextCursor:e.nextCursor==null?void 0:e.nextCursor}}G.ChangesResultFromJSONTyped=ln;function Zr(e){return e==null?e:{changes:e.changes.map(fn.ChangeToJSON),shows:e.shows,hasMore:e.hasMore,nextCursor:e.nextCursor}}G.ChangesResultToJSON=Zr});var Ae=p(L=>{"use strict";Object.defineProperty(L,"__esModule",{value:!0});L.StreamingOptionTypesToJSON=L.StreamingOptionTypesFromJSONTyped=L.StreamingOptionTypesFromJSON=L.instanceOfStreamingOptionTypes=void 0;function jr(e){return!(!("addon"in e)||!("buy"in e)||!("rent"in e)||!("free"in e)||!("subscription"in e))}L.instanceOfStreamingOptionTypes=jr;function et(e){return hn(e,!1)}L.StreamingOptionTypesFromJSON=et;function hn(e,i){return e==null?e:{addon:e.addon,buy:e.buy,rent:e.rent,free:e.free,subscription:e.subscription}}L.StreamingOptionTypesFromJSONTyped=hn;function nt(e){return e==null?e:{addon:e.addon,buy:e.buy,rent:e.rent,free:e.free,subscription:e.subscription}}L.StreamingOptionTypesToJSON=nt});var Ee=p(B=>{"use strict";Object.defineProperty(B,"__esModule",{value:!0});B.ServiceToJSON=B.ServiceFromJSONTyped=B.ServiceFromJSON=B.instanceOfService=void 0;var pn=le(),yn=fe(),Sn=Ae();function rt(e){return!(!("id"in e)||!("name"in e)||!("homePage"in e)||!("themeColorCode"in e)||!("imageSet"in e)||!("streamingOptionTypes"in e)||!("addons"in e))}B.instanceOfService=rt;function tt(e){return gn(e,!1)}B.ServiceFromJSON=tt;function gn(e,i){return e==null?e:{id:e.id,name:e.name,homePage:e.homePage,themeColorCode:e.themeColorCode,imageSet:(0,yn.ServiceImageSetFromJSON)(e.imageSet),streamingOptionTypes:(0,Sn.StreamingOptionTypesFromJSON)(e.streamingOptionTypes),addons:e.addons.map(pn.AddonFromJSON)}}B.ServiceFromJSONTyped=gn;function it(e){return e==null?e:{id:e.id,name:e.name,homePage:e.homePage,themeColorCode:e.themeColorCode,imageSet:(0,yn.ServiceImageSetToJSON)(e.imageSet),streamingOptionTypes:(0,Sn.StreamingOptionTypesToJSON)(e.streamingOptionTypes),addons:e.addons.map(pn.AddonToJSON)}}B.ServiceToJSON=it});var wn=p(D=>{"use strict";Object.defineProperty(D,"__esModule",{value:!0});D.CountryToJSON=D.CountryFromJSONTyped=D.CountryFromJSON=D.instanceOfCountry=void 0;var mn=Ee();function ot(e){return!(!("countryCode"in e)||!("name"in e)||!("services"in e))}D.instanceOfCountry=ot;function at(e){return On(e,!1)}D.CountryFromJSON=at;function On(e,i){return e==null?e:{countryCode:e.countryCode,name:e.name,services:e.services.map(mn.ServiceFromJSON)}}D.CountryFromJSONTyped=On;function ut(e){return e==null?e:{countryCode:e.countryCode,name:e.name,services:e.services.map(mn.ServiceToJSON)}}D.CountryToJSON=ut});var Re=p(q=>{"use strict";Object.defineProperty(q,"__esModule",{value:!0});q.EpisodeToJSON=q.EpisodeFromJSONTyped=q.EpisodeFromJSON=q.instanceOfEpisode=void 0;function st(e){return!(!("itemType"in e)||!("title"in e)||!("airYear"in e)||!("streamingOptions"in e))}q.instanceOfEpisode=st;function ct(e){return Tn(e,!1)}q.EpisodeFromJSON=ct;function Tn(e,i){return e==null?e:{itemType:e.itemType,title:e.title,overview:e.overview==null?void 0:e.overview,airYear:e.airYear,streamingOptions:e.streamingOptions}}q.EpisodeFromJSONTyped=Tn;function ft(e){return e==null?e:{itemType:e.itemType,title:e.title,overview:e.overview,airYear:e.airYear,streamingOptions:e.streamingOptions}}q.EpisodeToJSON=ft});var Pe=p(x=>{"use strict";Object.defineProperty(x,"__esModule",{value:!0});x.GenreToJSON=x.GenreFromJSONTyped=x.GenreFromJSON=x.instanceOfGenre=void 0;function lt(e){return!(!("id"in e)||!("name"in e))}x.instanceOfGenre=lt;function dt(e){return Nn(e,!1)}x.GenreFromJSON=dt;function Nn(e,i){return e==null?e:{id:e.id,name:e.name}}x.GenreFromJSONTyped=Nn;function ht(e){return e==null?e:{id:e.id,name:e.name}}x.GenreToJSON=ht});var Me=p(k=>{"use strict";Object.defineProperty(k,"__esModule",{value:!0});k.HorizontalImageToJSON=k.HorizontalImageFromJSONTyped=k.HorizontalImageFromJSON=k.instanceOfHorizontalImage=void 0;function pt(e){return!(!("w360"in e)||!("w480"in e)||!("w720"in e)||!("w1080"in e)||!("w1440"in e))}k.instanceOfHorizontalImage=pt;function yt(e){return Jn(e,!1)}k.HorizontalImageFromJSON=yt;function Jn(e,i){return e==null?e:{w360:e.w360,w480:e.w480,w720:e.w720,w1080:e.w1080,w1440:e.w1440}}k.HorizontalImageFromJSONTyped=Jn;function St(e){return e==null?e:{w360:e.w360,w480:e.w480,w720:e.w720,w1080:e.w1080,w1440:e.w1440}}k.HorizontalImageToJSON=St});var Se=p(X=>{"use strict";Object.defineProperty(X,"__esModule",{value:!0});X.LocaleToJSON=X.LocaleFromJSONTyped=X.LocaleFromJSON=X.instanceOfLocale=void 0;function gt(e){return"language"in e}X.instanceOfLocale=gt;function mt(e){return bn(e,!1)}X.LocaleFromJSON=mt;function bn(e,i){return e==null?e:{language:e.language,region:e.region==null?void 0:e.region}}X.LocaleFromJSONTyped=bn;function Ot(e){return e==null?e:{language:e.language,region:e.region}}X.LocaleToJSON=Ot});var vn=p(Y=>{"use strict";Object.defineProperty(Y,"__esModule",{value:!0});Y.ModelErrorToJSON=Y.ModelErrorFromJSONTyped=Y.ModelErrorFromJSON=Y.instanceOfModelError=void 0;function wt(e){return"message"in e}Y.instanceOfModelError=wt;function Tt(e){return _n(e,!1)}Y.ModelErrorFromJSON=Tt;function _n(e,i){return e==null?e:{message:e.message}}Y.ModelErrorFromJSONTyped=_n;function Nt(e){return e==null?e:{message:e.message}}Y.ModelErrorToJSON=Nt});var Cn=p(F=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0});F.OrderDirectionToJSON=F.OrderDirectionFromJSONTyped=F.OrderDirectionFromJSON=F.instanceOfOrderDirection=F.OrderDirection=void 0;F.OrderDirection={Asc:"asc",Desc:"desc"};function Jt(e){return Object.values(F.OrderDirection).includes(e)}F.instanceOfOrderDirection=Jt;function bt(e){return Fn(e,!1)}F.OrderDirectionFromJSON=bt;function Fn(e,i){return e}F.OrderDirectionFromJSONTyped=Fn;function _t(e){return e}F.OrderDirectionToJSON=_t});var Ke=p(z=>{"use strict";Object.defineProperty(z,"__esModule",{value:!0});z.PriceToJSON=z.PriceFromJSONTyped=z.PriceFromJSON=z.instanceOfPrice=void 0;function vt(e){return!(!("amount"in e)||!("currency"in e)||!("formatted"in e))}z.instanceOfPrice=vt;function Ft(e){return In(e,!1)}z.PriceFromJSON=Ft;function In(e,i){return e==null?e:{amount:e.amount,currency:e.currency,formatted:e.formatted}}z.PriceFromJSONTyped=In;function Ct(e){return e==null?e:{amount:e.amount,currency:e.currency,formatted:e.formatted}}z.PriceToJSON=Ct});var Ge=p(V=>{"use strict";Object.defineProperty(V,"__esModule",{value:!0});V.SeasonToJSON=V.SeasonFromJSONTyped=V.SeasonFromJSON=V.instanceOfSeason=void 0;var An=Re();function It(e){return!(!("itemType"in e)||!("title"in e)||!("firstAirYear"in e)||!("lastAirYear"in e)||!("streamingOptions"in e))}V.instanceOfSeason=It;function At(e){return En(e,!1)}V.SeasonFromJSON=At;function En(e,i){return e==null?e:{itemType:e.itemType,title:e.title,firstAirYear:e.firstAirYear,lastAirYear:e.lastAirYear,streamingOptions:e.streamingOptions,episodes:e.episodes==null?void 0:e.episodes.map(An.EpisodeFromJSON)}}V.SeasonFromJSONTyped=En;function Et(e){return e==null?e:{itemType:e.itemType,title:e.title,firstAirYear:e.firstAirYear,lastAirYear:e.lastAirYear,streamingOptions:e.streamingOptions,episodes:e.episodes==null?void 0:e.episodes.map(An.EpisodeToJSON)}}V.SeasonToJSON=Et});var Le=p(H=>{"use strict";Object.defineProperty(H,"__esModule",{value:!0});H.VerticalImageToJSON=H.VerticalImageFromJSONTyped=H.VerticalImageFromJSON=H.instanceOfVerticalImage=void 0;function Rt(e){return!(!("w240"in e)||!("w360"in e)||!("w480"in e)||!("w600"in e)||!("w720"in e))}H.instanceOfVerticalImage=Rt;function Pt(e){return Rn(e,!1)}H.VerticalImageFromJSON=Pt;function Rn(e,i){return e==null?e:{w240:e.w240,w360:e.w360,w480:e.w480,w600:e.w600,w720:e.w720}}H.VerticalImageFromJSONTyped=Rn;function Mt(e){return e==null?e:{w240:e.w240,w360:e.w360,w480:e.w480,w600:e.w600,w720:e.w720}}H.VerticalImageToJSON=Mt});var Be=p(U=>{"use strict";Object.defineProperty(U,"__esModule",{value:!0});U.ShowImageSetToJSON=U.ShowImageSetFromJSONTyped=U.ShowImageSetFromJSON=U.instanceOfShowImageSet=void 0;var ge=Me(),me=Le();function Kt(e){return!(!("verticalPoster"in e)||!("horizontalPoster"in e))}U.instanceOfShowImageSet=Kt;function Gt(e){return Pn(e,!1)}U.ShowImageSetFromJSON=Gt;function Pn(e,i){return e==null?e:{verticalPoster:(0,me.VerticalImageFromJSON)(e.verticalPoster),horizontalPoster:(0,ge.HorizontalImageFromJSON)(e.horizontalPoster),verticalBackdrop:e.verticalBackdrop==null?void 0:(0,me.VerticalImageFromJSON)(e.verticalBackdrop),horizontalBackdrop:e.horizontalBackdrop==null?void 0:(0,ge.HorizontalImageFromJSON)(e.horizontalBackdrop)}}U.ShowImageSetFromJSONTyped=Pn;function Lt(e){return e==null?e:{verticalPoster:(0,me.VerticalImageToJSON)(e.verticalPoster),horizontalPoster:(0,ge.HorizontalImageToJSON)(e.horizontalPoster),verticalBackdrop:(0,me.VerticalImageToJSON)(e.verticalBackdrop),horizontalBackdrop:(0,ge.HorizontalImageToJSON)(e.horizontalBackdrop)}}U.ShowImageSetToJSON=Lt});var De=p(Q=>{"use strict";Object.defineProperty(Q,"__esModule",{value:!0});Q.ShowToJSON=Q.ShowFromJSONTyped=Q.ShowFromJSON=Q.instanceOfShow=void 0;var Mn=Pe(),Kn=Ge(),Gn=Be(),Ln=pe();function Bt(e){return!(!("itemType"in e)||!("showType"in e)||!("id"in e)||!("imdbId"in e)||!("tmdbId"in e)||!("title"in e)||!("overview"in e)||!("originalTitle"in e)||!("genres"in e)||!("cast"in e)||!("rating"in e)||!("imageSet"in e)||!("streamingOptions"in e))}Q.instanceOfShow=Bt;function Dt(e){return Bn(e,!1)}Q.ShowFromJSON=Dt;function Bn(e,i){return e==null?e:{itemType:e.itemType,showType:(0,Ln.ShowTypeFromJSON)(e.showType),id:e.id,imdbId:e.imdbId,tmdbId:e.tmdbId,title:e.title,overview:e.overview,releaseYear:e.releaseYear==null?void 0:e.releaseYear,firstAirYear:e.firstAirYear==null?void 0:e.firstAirYear,lastAirYear:e.lastAirYear==null?void 0:e.lastAirYear,originalTitle:e.originalTitle,genres:e.genres.map(Mn.GenreFromJSON),directors:e.directors==null?void 0:e.directors,creators:e.creators==null?void 0:e.creators,cast:e.cast,rating:e.rating,seasonCount:e.seasonCount==null?void 0:e.seasonCount,episodeCount:e.episodeCount==null?void 0:e.episodeCount,runtime:e.runtime==null?void 0:e.runtime,imageSet:(0,Gn.ShowImageSetFromJSON)(e.imageSet),streamingOptions:e.streamingOptions,seasons:e.seasons==null?void 0:e.seasons.map(Kn.SeasonFromJSON)}}Q.ShowFromJSONTyped=Bn;function qt(e){return e==null?e:{itemType:e.itemType,showType:(0,Ln.ShowTypeToJSON)(e.showType),id:e.id,imdbId:e.imdbId,tmdbId:e.tmdbId,title:e.title,overview:e.overview,releaseYear:e.releaseYear,firstAirYear:e.firstAirYear,lastAirYear:e.lastAirYear,originalTitle:e.originalTitle,genres:e.genres.map(Mn.GenreToJSON),directors:e.directors,creators:e.creators,cast:e.cast,rating:e.rating,seasonCount:e.seasonCount,episodeCount:e.episodeCount,runtime:e.runtime,imageSet:(0,Gn.ShowImageSetToJSON)(e.imageSet),streamingOptions:e.streamingOptions,seasons:e.seasons==null?void 0:e.seasons.map(Kn.SeasonToJSON)}}Q.ShowToJSON=qt});var xn=p(W=>{"use strict";Object.defineProperty(W,"__esModule",{value:!0});W.SearchResultToJSON=W.SearchResultFromJSONTyped=W.SearchResultFromJSON=W.instanceOfSearchResult=void 0;var Dn=De();function xt(e){return!(!("shows"in e)||!("hasMore"in e))}W.instanceOfSearchResult=xt;function kt(e){return qn(e,!1)}W.SearchResultFromJSON=kt;function qn(e,i){return e==null?e:{shows:e.shows.map(Dn.ShowFromJSON),hasMore:e.hasMore,nextCursor:e.nextCursor==null?void 0:e.nextCursor}}W.SearchResultFromJSONTyped=qn;function Xt(e){return e==null?e:{shows:e.shows.map(Dn.ShowToJSON),hasMore:e.hasMore,nextCursor:e.nextCursor}}W.SearchResultToJSON=Xt});var qe=p($=>{"use strict";Object.defineProperty($,"__esModule",{value:!0});$.SubtitleToJSON=$.SubtitleFromJSONTyped=$.SubtitleFromJSON=$.instanceOfSubtitle=void 0;var kn=Se();function Yt(e){return!(!("closedCaptions"in e)||!("locale"in e))}$.instanceOfSubtitle=Yt;function zt(e){return Xn(e,!1)}$.SubtitleFromJSON=zt;function Xn(e,i){return e==null?e:{closedCaptions:e.closedCaptions,locale:(0,kn.LocaleFromJSON)(e.locale)}}$.SubtitleFromJSONTyped=Xn;function Vt(e){return e==null?e:{closedCaptions:e.closedCaptions,locale:(0,kn.LocaleToJSON)(e.locale)}}$.SubtitleToJSON=Vt});var $n=p(I=>{"use strict";Object.defineProperty(I,"__esModule",{value:!0});I.StreamingOptionToJSON=I.StreamingOptionFromJSONTyped=I.StreamingOptionFromJSON=I.instanceOfStreamingOption=I.StreamingOptionQualityEnum=void 0;var Yn=le(),zn=Se(),Vn=Ke(),Hn=he(),Un=ye(),Qn=qe();I.StreamingOptionQualityEnum={Sd:"sd",Hd:"hd",Qhd:"qhd",Uhd:"uhd"};function Ht(e){return!(!("service"in e)||!("type"in e)||!("link"in e)||!("audios"in e)||!("subtitles"in e)||!("expiresSoon"in e)||!("availableSince"in e))}I.instanceOfStreamingOption=Ht;function Ut(e){return Wn(e,!1)}I.StreamingOptionFromJSON=Ut;function Wn(e,i){return e==null?e:{service:(0,Hn.ServiceInfoFromJSON)(e.service),type:(0,Un.StreamingOptionTypeFromJSON)(e.type),addon:e.addon==null?void 0:(0,Yn.AddonFromJSON)(e.addon),link:e.link,videoLink:e.videoLink==null?void 0:e.videoLink,quality:e.quality==null?void 0:e.quality,audios:e.audios.map(zn.LocaleFromJSON),subtitles:e.subtitles.map(Qn.SubtitleFromJSON),price:e.price==null?void 0:(0,Vn.PriceFromJSON)(e.price),expiresSoon:e.expiresSoon,expiresOn:e.expiresOn==null?void 0:e.expiresOn,availableSince:e.availableSince}}I.StreamingOptionFromJSONTyped=Wn;function Qt(e){return e==null?e:{service:(0,Hn.ServiceInfoToJSON)(e.service),type:(0,Un.StreamingOptionTypeToJSON)(e.type),addon:(0,Yn.AddonToJSON)(e.addon),link:e.link,videoLink:e.videoLink,quality:e.quality,audios:e.audios.map(zn.LocaleToJSON),subtitles:e.subtitles.map(Qn.SubtitleToJSON),price:(0,Vn.PriceToJSON)(e.price),expiresSoon:e.expiresSoon,expiresOn:e.expiresOn,availableSince:e.availableSince}}I.StreamingOptionToJSON=Qt});var ae=p(y=>{"use strict";var Wt=y&&y.__createBinding||(Object.create?function(e,i,n,a){a===void 0&&(a=n);var t=Object.getOwnPropertyDescriptor(i,n);(!t||("get"in t?!i.__esModule:t.writable||t.configurable))&&(t={enumerable:!0,get:function(){return i[n]}}),Object.defineProperty(e,a,t)}:function(e,i,n,a){a===void 0&&(a=n),e[a]=i[n]}),g=y&&y.__exportStar||function(e,i){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(i,n)&&Wt(i,e,n)};Object.defineProperty(y,"__esModule",{value:!0});g(le(),y);g(Ie(),y);g(Fe(),y);g(dn(),y);g(wn(),y);g(Re(),y);g(Pe(),y);g(Me(),y);g(Ce(),y);g(Se(),y);g(vn(),y);g(Cn(),y);g(Ke(),y);g(xn(),y);g(Ge(),y);g(Ee(),y);g(fe(),y);g(he(),y);g(De(),y);g(Be(),y);g(pe(),y);g($n(),y);g(ye(),y);g(Ae(),y);g(qe(),y);g(Le(),y)});var er=p(A=>{"use strict";var $t=A&&A.__extends||function(){var e=function(i,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,t){a.__proto__=t}||function(a,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(a[r]=t[r])},e(i,n)};return function(i,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(i,n);function a(){this.constructor=i}i.prototype=n===null?Object.create(n):(a.prototype=n.prototype,new a)}}(),Zn=A&&A.__awaiter||function(e,i,n,a){function t(r){return r instanceof n?r:new n(function(u){u(r)})}return new(n||(n=Promise))(function(r,u){function c(s){try{o(a.next(s))}catch(f){u(f)}}function l(s){try{o(a.throw(s))}catch(f){u(f)}}function o(s){s.done?r(s.value):t(s.value).then(c,l)}o((a=a.apply(e,i||[])).next())})},jn=A&&A.__generator||function(e,i){var n={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},a,t,r,u;return u={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(u[Symbol.iterator]=function(){return this}),u;function c(o){return function(s){return l([o,s])}}function l(o){if(a)throw new TypeError("Generator is already executing.");for(;u&&(u=0,o[0]&&(n=0)),n;)try{if(a=1,t&&(r=o[0]&2?t.return:o[0]?t.throw||((r=t.return)&&r.call(t),0):t.next)&&!(r=r.call(t,o[1])).done)return r;switch(t=0,r&&(o=[o[0]&2,r.value]),o[0]){case 0:case 1:r=o;break;case 4:return n.label++,{value:o[1],done:!1};case 5:n.label++,t=o[1],o=[0];continue;case 7:o=n.ops.pop(),n.trys.pop();continue;default:if(r=n.trys,!(r=r.length>0&&r[r.length-1])&&(o[0]===6||o[0]===2)){n=0;continue}if(o[0]===3&&(!r||o[1]>r[0]&&o[1]<r[3])){n.label=o[1];break}if(o[0]===6&&n.label<r[1]){n.label=r[1],r=o;break}if(r&&n.label<r[2]){n.label=r[2],n.ops.push(o);break}r[2]&&n.ops.pop(),n.trys.pop();continue}o=i.call(e,n)}catch(s){o=[6,s],t=0}finally{a=r=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}};Object.defineProperty(A,"__esModule",{value:!0});A.GetChangesOutputLanguageEnum=A.ChangesApi=void 0;var ue=oe(),Zt=ae(),jt=function(e){$t(i,e);function i(){return e!==null&&e.apply(this,arguments)||this}return i.prototype.getChangesRaw=function(n,a){return Zn(this,void 0,void 0,function(){var t,r,u,c,l,o,s;return jn(this,function(f){switch(f.label){case 0:if(n.country==null)throw new ue.RequiredError("country",'Required parameter "country" was null or undefined when calling getChanges().');if(n.changeType==null)throw new ue.RequiredError("changeType",'Required parameter "changeType" was null or undefined when calling getChanges().');if(n.itemType==null)throw new ue.RequiredError("itemType",'Required parameter "itemType" was null or undefined when calling getChanges().');return t={},n.country!=null&&(t.country=n.country),n.catalogs!=null&&(t.catalogs=n.catalogs.join(ue.COLLECTION_FORMATS.csv)),n.changeType!=null&&(t.change_type=n.changeType),n.itemType!=null&&(t.item_type=n.itemType),n.showType!=null&&(t.show_type=n.showType),n.from!=null&&(t.from=n.from),n.to!=null&&(t.to=n.to),n.includeUnknownDates!=null&&(t.include_unknown_dates=n.includeUnknownDates),n.cursor!=null&&(t.cursor=n.cursor),n.orderDirection!=null&&(t.order_direction=n.orderDirection),n.outputLanguage!=null&&(t.output_language=n.outputLanguage),r={},this.configuration&&this.configuration.apiKey?(u=r,c="X-API-Key",[4,this.configuration.apiKey("X-API-Key")]):[3,2];case 1:u[c]=f.sent(),f.label=2;case 2:return this.configuration&&this.configuration.apiKey?(l=r,o="X-RapidAPI-Key",[4,this.configuration.apiKey("X-RapidAPI-Key")]):[3,4];case 3:l[o]=f.sent(),f.label=4;case 4:return[4,this.request({path:"/changes",method:"GET",headers:r,query:t},a)];case 5:return s=f.sent(),[2,new ue.JSONApiResponse(s,function(h){return(0,Zt.ChangesResultFromJSON)(h)})]}})})},i.prototype.getChanges=function(n,a){return Zn(this,void 0,void 0,function(){var t;return jn(this,function(r){switch(r.label){case 0:return[4,this.getChangesRaw(n,a)];case 1:return t=r.sent(),[4,t.value()];case 2:return[2,r.sent()]}})})},i}(ue.BaseAPI);A.ChangesApi=jt;A.GetChangesOutputLanguageEnum={En:"en",Es:"es",Tr:"tr",Fr:"fr"}});var rr=p(N=>{"use strict";var ei=N&&N.__extends||function(){var e=function(i,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,t){a.__proto__=t}||function(a,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(a[r]=t[r])},e(i,n)};return function(i,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(i,n);function a(){this.constructor=i}i.prototype=n===null?Object.create(n):(a.prototype=n.prototype,new a)}}(),Oe=N&&N.__awaiter||function(e,i,n,a){function t(r){return r instanceof n?r:new n(function(u){u(r)})}return new(n||(n=Promise))(function(r,u){function c(s){try{o(a.next(s))}catch(f){u(f)}}function l(s){try{o(a.throw(s))}catch(f){u(f)}}function o(s){s.done?r(s.value):t(s.value).then(c,l)}o((a=a.apply(e,i||[])).next())})},we=N&&N.__generator||function(e,i){var n={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},a,t,r,u;return u={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(u[Symbol.iterator]=function(){return this}),u;function c(o){return function(s){return l([o,s])}}function l(o){if(a)throw new TypeError("Generator is already executing.");for(;u&&(u=0,o[0]&&(n=0)),n;)try{if(a=1,t&&(r=o[0]&2?t.return:o[0]?t.throw||((r=t.return)&&r.call(t),0):t.next)&&!(r=r.call(t,o[1])).done)return r;switch(t=0,r&&(o=[o[0]&2,r.value]),o[0]){case 0:case 1:r=o;break;case 4:return n.label++,{value:o[1],done:!1};case 5:n.label++,t=o[1],o=[0];continue;case 7:o=n.ops.pop(),n.trys.pop();continue;default:if(r=n.trys,!(r=r.length>0&&r[r.length-1])&&(o[0]===6||o[0]===2)){n=0;continue}if(o[0]===3&&(!r||o[1]>r[0]&&o[1]<r[3])){n.label=o[1];break}if(o[0]===6&&n.label<r[1]){n.label=r[1],r=o;break}if(r&&n.label<r[2]){n.label=r[2],n.ops.push(o);break}r[2]&&n.ops.pop(),n.trys.pop();continue}o=i.call(e,n)}catch(s){o=[6,s],t=0}finally{a=r=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}};Object.defineProperty(N,"__esModule",{value:!0});N.GetCountryOutputLanguageEnum=N.GetCountriesOutputLanguageEnum=N.CountriesApi=void 0;var de=oe(),nr=ae(),ni=function(e){ei(i,e);function i(){return e!==null&&e.apply(this,arguments)||this}return i.prototype.getCountriesRaw=function(n,a){return Oe(this,void 0,void 0,function(){var t,r,u,c,l,o,s;return we(this,function(f){switch(f.label){case 0:return t={},n.outputLanguage!=null&&(t.output_language=n.outputLanguage),r={},this.configuration&&this.configuration.apiKey?(u=r,c="X-API-Key",[4,this.configuration.apiKey("X-API-Key")]):[3,2];case 1:u[c]=f.sent(),f.label=2;case 2:return this.configuration&&this.configuration.apiKey?(l=r,o="X-RapidAPI-Key",[4,this.configuration.apiKey("X-RapidAPI-Key")]):[3,4];case 3:l[o]=f.sent(),f.label=4;case 4:return[4,this.request({path:"/countries",method:"GET",headers:r,query:t},a)];case 5:return s=f.sent(),[2,new de.JSONApiResponse(s,function(h){return de.mapValues(h,nr.CountryFromJSON)})]}})})},i.prototype.getCountries=function(n,a){return n===void 0&&(n={}),Oe(this,void 0,void 0,function(){var t;return we(this,function(r){switch(r.label){case 0:return[4,this.getCountriesRaw(n,a)];case 1:return t=r.sent(),[4,t.value()];case 2:return[2,r.sent()]}})})},i.prototype.getCountryRaw=function(n,a){return Oe(this,void 0,void 0,function(){var t,r,u,c,l,o,s;return we(this,function(f){switch(f.label){case 0:if(n.countryCode==null)throw new de.RequiredError("countryCode",'Required parameter "countryCode" was null or undefined when calling getCountry().');return t={},n.outputLanguage!=null&&(t.output_language=n.outputLanguage),r={},this.configuration&&this.configuration.apiKey?(u=r,c="X-API-Key",[4,this.configuration.apiKey("X-API-Key")]):[3,2];case 1:u[c]=f.sent(),f.label=2;case 2:return this.configuration&&this.configuration.apiKey?(l=r,o="X-RapidAPI-Key",[4,this.configuration.apiKey("X-RapidAPI-Key")]):[3,4];case 3:l[o]=f.sent(),f.label=4;case 4:return[4,this.request({path:"/countries/{country-code}".replace("{".concat("country-code","}"),encodeURIComponent(String(n.countryCode))),method:"GET",headers:r,query:t},a)];case 5:return s=f.sent(),[2,new de.JSONApiResponse(s,function(h){return(0,nr.CountryFromJSON)(h)})]}})})},i.prototype.getCountry=function(n,a){return Oe(this,void 0,void 0,function(){var t;return we(this,function(r){switch(r.label){case 0:return[4,this.getCountryRaw(n,a)];case 1:return t=r.sent(),[4,t.value()];case 2:return[2,r.sent()]}})})},i}(de.BaseAPI);N.CountriesApi=ni;N.GetCountriesOutputLanguageEnum={En:"en",Es:"es",Tr:"tr",Fr:"fr"};N.GetCountryOutputLanguageEnum={En:"en",Es:"es",Tr:"tr",Fr:"fr"}});var ar=p(E=>{"use strict";var ri=E&&E.__extends||function(){var e=function(i,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,t){a.__proto__=t}||function(a,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(a[r]=t[r])},e(i,n)};return function(i,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(i,n);function a(){this.constructor=i}i.prototype=n===null?Object.create(n):(a.prototype=n.prototype,new a)}}(),tr=E&&E.__awaiter||function(e,i,n,a){function t(r){return r instanceof n?r:new n(function(u){u(r)})}return new(n||(n=Promise))(function(r,u){function c(s){try{o(a.next(s))}catch(f){u(f)}}function l(s){try{o(a.throw(s))}catch(f){u(f)}}function o(s){s.done?r(s.value):t(s.value).then(c,l)}o((a=a.apply(e,i||[])).next())})},ir=E&&E.__generator||function(e,i){var n={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},a,t,r,u;return u={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(u[Symbol.iterator]=function(){return this}),u;function c(o){return function(s){return l([o,s])}}function l(o){if(a)throw new TypeError("Generator is already executing.");for(;u&&(u=0,o[0]&&(n=0)),n;)try{if(a=1,t&&(r=o[0]&2?t.return:o[0]?t.throw||((r=t.return)&&r.call(t),0):t.next)&&!(r=r.call(t,o[1])).done)return r;switch(t=0,r&&(o=[o[0]&2,r.value]),o[0]){case 0:case 1:r=o;break;case 4:return n.label++,{value:o[1],done:!1};case 5:n.label++,t=o[1],o=[0];continue;case 7:o=n.ops.pop(),n.trys.pop();continue;default:if(r=n.trys,!(r=r.length>0&&r[r.length-1])&&(o[0]===6||o[0]===2)){n=0;continue}if(o[0]===3&&(!r||o[1]>r[0]&&o[1]<r[3])){n.label=o[1];break}if(o[0]===6&&n.label<r[1]){n.label=r[1],r=o;break}if(r&&n.label<r[2]){n.label=r[2],n.ops.push(o);break}r[2]&&n.ops.pop(),n.trys.pop();continue}o=i.call(e,n)}catch(s){o=[6,s],t=0}finally{a=r=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}};Object.defineProperty(E,"__esModule",{value:!0});E.GetGenresOutputLanguageEnum=E.GenresApi=void 0;var or=oe(),ti=ae(),ii=function(e){ri(i,e);function i(){return e!==null&&e.apply(this,arguments)||this}return i.prototype.getGenresRaw=function(n,a){return tr(this,void 0,void 0,function(){var t,r,u,c,l,o,s;return ir(this,function(f){switch(f.label){case 0:return t={},n.outputLanguage!=null&&(t.output_language=n.outputLanguage),r={},this.configuration&&this.configuration.apiKey?(u=r,c="X-API-Key",[4,this.configuration.apiKey("X-API-Key")]):[3,2];case 1:u[c]=f.sent(),f.label=2;case 2:return this.configuration&&this.configuration.apiKey?(l=r,o="X-RapidAPI-Key",[4,this.configuration.apiKey("X-RapidAPI-Key")]):[3,4];case 3:l[o]=f.sent(),f.label=4;case 4:return[4,this.request({path:"/genres",method:"GET",headers:r,query:t},a)];case 5:return s=f.sent(),[2,new or.JSONApiResponse(s,function(h){return h.map(ti.GenreFromJSON)})]}})})},i.prototype.getGenres=function(n,a){return n===void 0&&(n={}),tr(this,void 0,void 0,function(){var t;return ir(this,function(r){switch(r.label){case 0:return[4,this.getGenresRaw(n,a)];case 1:return t=r.sent(),[4,t.value()];case 2:return[2,r.sent()]}})})},i}(or.BaseAPI);E.GenresApi=ii;E.GetGenresOutputLanguageEnum={En:"en",Es:"es",Tr:"tr",Fr:"fr"}});var ur=p(S=>{"use strict";var oi=S&&S.__extends||function(){var e=function(i,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,t){a.__proto__=t}||function(a,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(a[r]=t[r])},e(i,n)};return function(i,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(i,n);function a(){this.constructor=i}i.prototype=n===null?Object.create(n):(a.prototype=n.prototype,new a)}}(),te=S&&S.__awaiter||function(e,i,n,a){function t(r){return r instanceof n?r:new n(function(u){u(r)})}return new(n||(n=Promise))(function(r,u){function c(s){try{o(a.next(s))}catch(f){u(f)}}function l(s){try{o(a.throw(s))}catch(f){u(f)}}function o(s){s.done?r(s.value):t(s.value).then(c,l)}o((a=a.apply(e,i||[])).next())})},ie=S&&S.__generator||function(e,i){var n={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},a,t,r,u;return u={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(u[Symbol.iterator]=function(){return this}),u;function c(o){return function(s){return l([o,s])}}function l(o){if(a)throw new TypeError("Generator is already executing.");for(;u&&(u=0,o[0]&&(n=0)),n;)try{if(a=1,t&&(r=o[0]&2?t.return:o[0]?t.throw||((r=t.return)&&r.call(t),0):t.next)&&!(r=r.call(t,o[1])).done)return r;switch(t=0,r&&(o=[o[0]&2,r.value]),o[0]){case 0:case 1:r=o;break;case 4:return n.label++,{value:o[1],done:!1};case 5:n.label++,t=o[1],o=[0];continue;case 7:o=n.ops.pop(),n.trys.pop();continue;default:if(r=n.trys,!(r=r.length>0&&r[r.length-1])&&(o[0]===6||o[0]===2)){n=0;continue}if(o[0]===3&&(!r||o[1]>r[0]&&o[1]<r[3])){n.label=o[1];break}if(o[0]===6&&n.label<r[1]){n.label=r[1],r=o;break}if(r&&n.label<r[2]){n.label=r[2],n.ops.push(o);break}r[2]&&n.ops.pop(),n.trys.pop();continue}o=i.call(e,n)}catch(s){o=[6,s],t=0}finally{a=r=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}};Object.defineProperty(S,"__esModule",{value:!0});S.SearchShowsByTitleOutputLanguageEnum=S.SearchShowsByTitleSeriesGranularityEnum=S.SearchShowsByFiltersOrderByEnum=S.SearchShowsByFiltersSeriesGranularityEnum=S.SearchShowsByFiltersGenresRelationEnum=S.SearchShowsByFiltersOutputLanguageEnum=S.GetTopShowsOutputLanguageEnum=S.GetShowOutputLanguageEnum=S.GetShowSeriesGranularityEnum=S.ShowsApi=void 0;var C=oe(),Te=ae(),ai=function(e){oi(i,e);function i(){return e!==null&&e.apply(this,arguments)||this}return i.prototype.getShowRaw=function(n,a){return te(this,void 0,void 0,function(){var t,r,u,c,l,o,s;return ie(this,function(f){switch(f.label){case 0:if(n.id==null)throw new C.RequiredError("id",'Required parameter "id" was null or undefined when calling getShow().');return t={},n.country!=null&&(t.country=n.country),n.seriesGranularity!=null&&(t.series_granularity=n.seriesGranularity),n.outputLanguage!=null&&(t.output_language=n.outputLanguage),r={},this.configuration&&this.configuration.apiKey?(u=r,c="X-API-Key",[4,this.configuration.apiKey("X-API-Key")]):[3,2];case 1:u[c]=f.sent(),f.label=2;case 2:return this.configuration&&this.configuration.apiKey?(l=r,o="X-RapidAPI-Key",[4,this.configuration.apiKey("X-RapidAPI-Key")]):[3,4];case 3:l[o]=f.sent(),f.label=4;case 4:return[4,this.request({path:"/shows/{id}".replace("{".concat("id","}"),encodeURIComponent(String(n.id))),method:"GET",headers:r,query:t},a)];case 5:return s=f.sent(),[2,new C.JSONApiResponse(s,function(h){return(0,Te.ShowFromJSON)(h)})]}})})},i.prototype.getShow=function(n,a){return te(this,void 0,void 0,function(){var t;return ie(this,function(r){switch(r.label){case 0:return[4,this.getShowRaw(n,a)];case 1:return t=r.sent(),[4,t.value()];case 2:return[2,r.sent()]}})})},i.prototype.getTopShowsRaw=function(n,a){return te(this,void 0,void 0,function(){var t,r,u,c,l,o,s;return ie(this,function(f){switch(f.label){case 0:if(n.country==null)throw new C.RequiredError("country",'Required parameter "country" was null or undefined when calling getTopShows().');if(n.service==null)throw new C.RequiredError("service",'Required parameter "service" was null or undefined when calling getTopShows().');return t={},n.country!=null&&(t.country=n.country),n.service!=null&&(t.service=n.service),n.outputLanguage!=null&&(t.output_language=n.outputLanguage),n.showType!=null&&(t.show_type=n.showType),r={},this.configuration&&this.configuration.apiKey?(u=r,c="X-API-Key",[4,this.configuration.apiKey("X-API-Key")]):[3,2];case 1:u[c]=f.sent(),f.label=2;case 2:return this.configuration&&this.configuration.apiKey?(l=r,o="X-RapidAPI-Key",[4,this.configuration.apiKey("X-RapidAPI-Key")]):[3,4];case 3:l[o]=f.sent(),f.label=4;case 4:return[4,this.request({path:"/shows/top",method:"GET",headers:r,query:t},a)];case 5:return s=f.sent(),[2,new C.JSONApiResponse(s,function(h){return h.map(Te.ShowFromJSON)})]}})})},i.prototype.getTopShows=function(n,a){return te(this,void 0,void 0,function(){var t;return ie(this,function(r){switch(r.label){case 0:return[4,this.getTopShowsRaw(n,a)];case 1:return t=r.sent(),[4,t.value()];case 2:return[2,r.sent()]}})})},i.prototype.searchShowsByFiltersRaw=function(n,a){return te(this,void 0,void 0,function(){var t,r,u,c,l,o,s;return ie(this,function(f){switch(f.label){case 0:if(n.country==null)throw new C.RequiredError("country",'Required parameter "country" was null or undefined when calling searchShowsByFilters().');return t={},n.country!=null&&(t.country=n.country),n.catalogs!=null&&(t.catalogs=n.catalogs.join(C.COLLECTION_FORMATS.csv)),n.outputLanguage!=null&&(t.output_language=n.outputLanguage),n.showType!=null&&(t.show_type=n.showType),n.genres!=null&&(t.genres=n.genres.join(C.COLLECTION_FORMATS.csv)),n.genresRelation!=null&&(t.genres_relation=n.genresRelation),n.showOriginalLanguage!=null&&(t.show_original_language=n.showOriginalLanguage),n.yearMin!=null&&(t.year_min=n.yearMin),n.yearMax!=null&&(t.year_max=n.yearMax),n.ratingMin!=null&&(t.rating_min=n.ratingMin),n.ratingMax!=null&&(t.rating_max=n.ratingMax),n.keyword!=null&&(t.keyword=n.keyword),n.seriesGranularity!=null&&(t.series_granularity=n.seriesGranularity),n.orderBy!=null&&(t.order_by=n.orderBy),n.orderDirection!=null&&(t.order_direction=n.orderDirection),n.cursor!=null&&(t.cursor=n.cursor),r={},this.configuration&&this.configuration.apiKey?(u=r,c="X-API-Key",[4,this.configuration.apiKey("X-API-Key")]):[3,2];case 1:u[c]=f.sent(),f.label=2;case 2:return this.configuration&&this.configuration.apiKey?(l=r,o="X-RapidAPI-Key",[4,this.configuration.apiKey("X-RapidAPI-Key")]):[3,4];case 3:l[o]=f.sent(),f.label=4;case 4:return[4,this.request({path:"/shows/search/filters",method:"GET",headers:r,query:t},a)];case 5:return s=f.sent(),[2,new C.JSONApiResponse(s,function(h){return(0,Te.SearchResultFromJSON)(h)})]}})})},i.prototype.searchShowsByFilters=function(n,a){return te(this,void 0,void 0,function(){var t;return ie(this,function(r){switch(r.label){case 0:return[4,this.searchShowsByFiltersRaw(n,a)];case 1:return t=r.sent(),[4,t.value()];case 2:return[2,r.sent()]}})})},i.prototype.searchShowsByTitleRaw=function(n,a){return te(th