PageSourceSearch

https://www.theposh.com/modules/custom/clubcast_streamamg/js/deferred-async.51371cbfed0b202a0f44.js

js theposh.com collected 2026-10-02 11:32:47 UTC 10,563 bytes, 3 lines download raw bytes

1/*! For license information please see deferred-async.51371cbfed0b202a0f44.js.LICENSE.txt */
2(self.webpackChunkclubcast=self.webpackChunkclubcast||[]).push([[580589],{302613:function(e,t,r){"use strict";r.d(t,{Po:function(){return v},X4:function(){return j},d$:function(){return O},fw:function(){return h},uQ:function(){return g}});r(681278),r(842762),r(423500);var n=r(673383),o=r(173032),i=r.n(o),u=r(1434),c=r(778083),a=r(148100),s=r(384490),l=r(307506),f=r(8927);function p(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function b(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?p(Object(r),!0).forEach(function(t){y(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):p(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function y(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function d(){var e;return(null===(e=i().clubcastStreamamg)||void 0===e?void 0:e.fusion)||{}}function m(){const{apiKey:e}=d();return{"x-api-key":e,Accept:"application/json"}}function g(){return(0,n.Ay)("SSO",e=>e.get("streamamg","urn:ietf:params:oauth:token-type:id_token")).pipe((0,a.T)(e=>{var t;return null!==(t=null==e?void 0:e.id_token)&&void 0!==t?t:null}),(0,c.W)(()=>(0,f.of)(null)))}let w=null;function O(){if(!w){const{apiUrl:e}=d();w=u.R.getJSON(`${e}/v1/products`,m()).pipe((0,a.T)(e=>e.products||[]),(0,l.t)({bufferSize:1,refCount:!1}))}return w}function h(e){const{apiUrl:t}=d();return g().pipe((0,s.ZZ)(r=>{if(!r||!r.trim())throw new Error("createCheckoutSession requires a JWT auth token");return(0,u.R)({method:"POST",url:`${t}/v1/billing/create-checkout-session`,headers:b(b({},m()),{},{"Content-Type":"application/json",Authorization:"Bearer "+r}),body:{priceId:e}})}),(0,a.T)(e=>e.response.checkoutUrl))}function v(){const{apiUrl:e}=d();return g().pipe((0,s.ZZ)(t=>(0,u.R)({method:"POST",url:`${e}/v1/billing/customer-portal`,headers:b(b({},m()),{},{"Content-Type":"application/json"},t?{Authorization:`Bearer ${t}`}:{})})),(0,a.T)(e=>e.response.url))}function j(){const{apiUrl:e}=d();return g().pipe((0,s.ZZ)(t=>t&&t.trim()?u.R.getJSON(`${e}/v1/users/me/subscriptions`,b(b({},m()),{},{Authorization:"Bearer "+t})):(0,f.of)([])),(0,c.W)(()=>(0,f.of)([])))}},15751:function(e,t,r){"use strict";r.d(t,{L_:function(){return O},QC:function(){return h},e2:function(){return w},gF:function(){return m},y_:function(){return g}});r(123792),r(327495),r(842762),r(962953),r(803296),r(527208),r(548408);var n=r(296540),o=r(302613),i=r(173032),u=r.n(i),c=r(32152),a=r(72596),s=r(464833);const l="streamamg-checkout",f="clubcastStreamamgPendingCheckoutPriceId",p="__clubcastStreamamgCheckoutResumeProcessed";function b(){if(window[p])return null;if(!new URLSearchParams(window.location.search).has(l))return null;const e=function(){try{const e=window.sessionStorage.getItem(f);return window.sessionStorage.removeItem(f),null!=e&&e.trim()?e:null}catch(e){return console.error(e),null}}();return function(){const e=new URL(window.location.href);e.searchParams.delete(l),window.history.replaceState({},"",e.pathname+e.search+e.hash)}(),window[p]=!0,e}function y(e,t="warning"){var r;if("function"==typeof(null===(r=Drupal)||void 0===r?void 0:r.Message)){(new Drupal.Message).add(e,{type:t})}}function d(e){const{loginUrl:t}=(null===(r=u().clubcastStreamamg)||void 0===r?void 0:r.clubcastPlayer)||{};var r;if(!t)return!1;!function(e){if(null!=e&&e.trim())try{window.sessionStorage.setItem(f,e)}catch(e){console.error(e)}}(e);const n=new URL(t,window.location.origin);return n.searchParams.set("destination",function(){const e=new URL(window.location.href);return e.searchParams.set(l,"1"),e.pathname+e.search+e.hash}()),window.location.href=n.toString(),!0}
2function m(){const[e,t]=(0,n.useState)(null);return(0,n.useEffect)(()=>{let e=null,r=null,n=[],i=null,u=!1,c=!1;function a(){u&&c&&t({entitlements:n.map(e=>e.entitlement).filter(Boolean),productIds:n.map(e=>e.productId).filter(Boolean),subscriptions:n,authToken:i})}return r=(0,o.uQ)().subscribe({next:e=>{i=e,c=!0,a()}}),e=(0,o.X4)().subscribe({next:e=>{n=e,u=!0,a()},error:()=>{n=[],u=!0,a()}}),()=>{e&&e.unsubscribe(),r&&r.unsubscribe()}},[]),e}function g(e){const[t,r]=(0,n.useState)([]),[i,u]=(0,n.useState)(!0);return(0,n.useEffect)(()=>{const t=(0,o.d$)().subscribe({next:t=>{if(e){const n=e.split(",").map(e=>e.trim()).filter(Boolean);r(t.filter(e=>n.some(t=>{var r;return(null===(r=e.metadata)||void 0===r?void 0:r.tag)===t})))}else r(t.filter(e=>{var t;return!(null!==(t=e.metadata)&&void 0!==t&&t.tag)}));u(!1)},error:()=>u(!1)});return()=>t.unsubscribe()},[e]),[t,i]}function w(){const[e,t]=(0,n.useState)(!1);return[(0,n.useCallback)((r,n,i)=>{e||(t(!0),(0,o.uQ)().pipe((0,a.n)(e=>e?((0,c.A)("video-package","click",null!=n?n:null,null!=i?i:null,{priceId:r}),(0,o.fw)(r)):(t(!1),d(r)||y(Drupal.t("Please log in to continue checkout.")),s.w))).subscribe({next:e=>{t(!1),window.location.href=e},error:e=>{console.error(e),t(!1),y(Drupal.t("Unable to start checkout at the moment."),"error")}}))},[e]),e]}function O(e=[]){const[t,r]=(0,n.useState)(!1);return(0,n.useEffect)(()=>{const t=(0,o.uQ)().pipe((0,a.n)(t=>{if(!t)return s.w;const n=b();return!n||e.length>0&&!e.includes(n)?s.w:(r(!0),(0,o.fw)(n))})).subscribe({next:e=>{r(!1),window.location.href=e},error:e=>{console.error(e),r(!1)}});return()=>t.unsubscribe()},[e]),t}function h(){const[e,t]=(0,n.useState)(!1);return[(0,n.useCallback)(()=>{e||(t(!0),(0,o.Po)().subscribe({next:e=>{t(!1),window.location.href=e},error:e=>{console.error(e),t(!1)}}))},[e]),e]}},270263:function(e,t,r){"use strict";r.d(t,{o:function(){return o}});r(123792),r(962953);var n=r(296540);function o(){const[e,t]=(0,n.useState)([]);return[e,(0,n.useCallback)(e=>{Array.isArray(e)?t(t=>[...t.filter(t=>!t.key||!e.find(e=>e.key&&e.key===t.key)),...e]):t(t=>[...t.filter(t=>!t.key||!e.key||t.key!==e.key),e])},[]),(0,n.useCallback)(e=>{t(e?t=>[...t.filter(t=>t.key!=e)]:[])},[]),(0,n.useCallback)(()=>{t(e=>[...e.filter(e=>!["billing_failure","payment_expire","payment_invalid"].includes(e.key))])},[])]}},549922:function(e,t,r){"use strict";r.d(t,{default:function(){return g}});r(489463),r(681278),r(423500);var n=r(440961),o=(r(123792),r(962953),r(333092)),i=r(257897),u=r(867264),c=r(15751),a=r(270263),s=r(474848);function l(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function f(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?l(Object(r),!0).forEach(function(t){p(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):l(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function p(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function b(e){const t=null===(0,c.gF)(),[r,,n]=(0,a.o)();return(0,s.jsx)(o.Ay,{loading:t,children:t?null:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(i.A,{removeMessage:n,messages:r}),(0,s.jsx)(u.A,f({},e))]})})}function y(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function d(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};
2t%2?y(Object(r),!0).forEach(function(t){m(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):y(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function m(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var g={embed(e){return(0,s.jsx)(b,d({},e))},attach(e,t){let r={entryId:t.entryId,name:t.name,description:t.description};Object.hasOwn(t,"autoplay")&&(r.autoplay=t.autoplay),n.render((0,s.jsx)(b,d({},r)),e)},detach(e){n.unmountComponentAtNode(e)}}},987914:function(e){var t=Object.prototype.toString;e.exports=function(e){return!0===e||!1===e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Boolean]"==t.call(e)}},45228:function(e){"use strict";var t=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach(function(e){n[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(e){return!1}}()?Object.assign:function(e,o){for(var i,u,c=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),a=1;a<arguments.length;a++){for(var s in i=Object(arguments[a]))r.call(i,s)&&(c[s]=i[s]);if(t){u=t(i);for(var l=0;l<u.length;l++)n.call(i,u[l])&&(c[u[l]]=i[u[l]])}}return c}}}]);
3//# sourceMappingURL=deferred-async.51371cbfed0b202a0f44.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.