PageSourceSearch

https://watch.plex.tv/_next/static/chunks/335-w9-xvjnen.js

js plex.tv collected 2026-10-01 08:39:11 UTC 56,614 bytes, 1 lines download raw bytes

1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,300169,e=>{"use strict";let t;var s=e.i(39693),r=e.i(161605),i=e.i(766271),n=e.i(959243),o=e.i(259864),a=e.i(578889),l=class extends a.Subscribable{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,s){let r=t.queryKey,o=t.queryHash??(0,i.hashQueryKeyByOptions)(r,t),a=this.get(o);return a||(a=new n.Query({client:e,queryKey:r,queryHash:o,options:e.defaultQueryOptions(t),state:s,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){o.notifyManager.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>(0,i.matchQuery)(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>(0,i.matchQuery)(e,t)):t}notify(e){o.notifyManager.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){o.notifyManager.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){o.notifyManager.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},c=e.i(51449),u=a,d=class extends u.Subscribable{constructor(e={}){super(),this.config=e,this.#t=new Set,this.#s=new Map,this.#r=0}#t;#s;#r;build(e,t,s){let r=new c.Mutation({client:e,mutationCache:this,mutationId:++this.#r,options:e.defaultMutationOptions(t),state:s});return this.add(r),r}add(e){this.#t.add(e);let t=h(e);if("string"==typeof t){let s=this.#s.get(t);s?s.push(e):this.#s.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#t.delete(e)){let t=h(e);if("string"==typeof t){let s=this.#s.get(t);if(s)if(s.length>1){let t=s.indexOf(e);-1!==t&&s.splice(t,1)}else s[0]===e&&this.#s.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){let t=h(e);if("string"!=typeof t)return!0;{let s=this.#s.get(t),r=s?.find(e=>"pending"===e.state.status);return!r||r===e}}runNext(e){let t=h(e);if("string"!=typeof t)return Promise.resolve();{let s=this.#s.get(t)?.find(t=>
1t!==e&&t.state.isPaused);return s?.continue()??Promise.resolve()}}clear(){o.notifyManager.batch(()=>{this.#t.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#t.clear(),this.#s.clear()})}getAll(){return Array.from(this.#t)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>(0,i.matchMutation)(t,e))}findAll(e={}){return this.getAll().filter(t=>(0,i.matchMutation)(e,t))}notify(e){o.notifyManager.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return o.notifyManager.batch(()=>Promise.all(e.map(e=>e.continue().catch(i.noop))))}};function h(e){return e.options.scope?.id}var p=e.i(82679),g=e.i(60045),f=e.i(384778),m=class{#i;#n;#o;#a;#l;#c;#u;#d;constructor(e={}){this.#i=e.queryCache||new l,this.#n=e.mutationCache||new d,this.#o=e.defaultOptions||{},this.#a=new Map,this.#l=new Map,this.#c=0}mount(){this.#c++,1===this.#c&&(this.#u=p.focusManager.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#i.onFocus())}),this.#d=g.onlineManager.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#i.onOnline())}))}unmount(){this.#c--,0===this.#c&&(this.#u?.(),this.#u=void 0,this.#d?.(),this.#d=void 0)}isFetching(e){return this.#i.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#n.findAll({...e,status:"pending"}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#i.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),s=this.#i.build(this,t),r=s.state.data;return void 0===r?this.fetchQuery(e):(e.revalidateIfStale&&s.isStaleByTime((0,i.resolveStaleTime)(t.staleTime,s))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#i.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,s){let r=this.defaultQueryOptions({queryKey:e}),n=this.#i.get(r.queryHash),o=n?.state.data,a=(0,i.functionalUpdate)(t,o);if(void 0!==a)return this.#i.build(this,r).setData(a,{...s,manual:!0})}setQueriesData(e,t,s){return o.notifyManager.batch(()=>this.#i.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,s)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#i.get(t.queryHash)?.state}removeQueries(e){let t=this.#i;o.notifyManager.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let s=this.#i;return o.notifyManager.batch(()=>(s.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){let s={revert:!0,...t};return Promise.all(o.notifyManager.batch(()=>this.#i.findAll(e).map(e=>e.cancel(s)))).then(i.noop).catch(i.noop)}invalidateQueries(e,t={}){return o.notifyManager.batch(()=>(this.#i.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType==="none")?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t))}refetchQueries(e,t={}){let s={...t,cancelRefetch:t.cancelRefetch??!0};return Promise.all(o.notifyManager.batch(()=>this.#i.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,s);return s.throwOnError||(t=t.catch(i.noop)),"paused"===e.state.fetchStatus?Promise.resolve():t}))).then(i.noop)}fetchQuery(e){let t=this.defaultQueryOptions(e);void 0===t.retry&&(t.retry=!1);let s=this.#i.build(this,t);return s.isStaleByTime((0,i.resolveStaleTime)(t.staleTime,s))?s.fetch(t):Promise.resolve(s.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(i.noop).catch(i.noop)}fetchInfiniteQuery(e){return e.behavior=(0,f.infiniteQueryBehavior)(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(i.noop).catch(i.noop)}ensureInfiniteQueryData(e){return e.behavior=(0,f.infiniteQueryBehavior)(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return g.onlineManager.isOnline()?this.#n.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#i}getMutationCache(){return this.#n}getDefaultOptions(){return this.#o}setDefaultOptions(e){this.#o=e}setQueryDefaults(e,t){this.#a.set((0,i.hashKey)(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#a.values()],s={};return t.forEach(t=>{(0,i.partialMatchKey)(e,t.queryKey)&&Object.assign(s,t.defaultOptions)}),s}setMutationDefaults(e,t){this.#l.set((0,i.hashKey)(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#l.values()],s={};return t.forEach(t=>{(0,i.partialMatchKey)(e,t.mutationKey)&&Object.assign(s,t.defaultOptions)}),s}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#o.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=(0,i.hashQueryKeyByOptions)(t.queryKey,t)),void 0===t.refetchOnReconnect&&(t.refetchOnReconnect="always"!==t.networkMode),void 0===t.throwOnError&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===i.skipToken&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#o.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#i.clear(),this.#n.clear()}},v=e.i(393202),y=e.i(459873),C=e.i(719302),E=e.i(630242),S=e.i(745401),I=e.i(753587),b=e.i(691532),L=e.i(798970);function A({children:e,linkComponent:t,overlayZIndex:s}){return(0,E.useEffect)(()=>{(0,L.isSSR)()||null==s||document.documentElement.style.setProperty("--overlay-z-index",String(s))},[s]),(0,r.jsx)(I.ToastProvider,{children:(0,r.jsx)(b.TooltipProvider,{children:(0,r.jsxs)(S.LinkComponentProvider,{value:t,children:[e,(0,r.jsx)(I.ToastViewport,{})]})})})}var w=e.i(598352),T=e.i(919435),_=e.i(858993),O=e.i(259608);let V="CastProvider";function P({receiverApplicationId:e,children:t}){let[s,i]=(0,E.useState)(),[n,o]=(0,E.useState)(),[a,l]=(0,E.useState)(),[c,u]=(0,E.useState)(!1),[d,h]=(0,E.useState)(!1);(0,E.useEffect)(()=>
1{if(c&&e)try{let t=cast.framework.CastContext.getInstance(),s=new cast.framework.RemotePlayer,r=new cast.framework.RemotePlayerController(s);t.setOptions({receiverApplicationId:e,autoJoinPolicy:chrome.cast.AutoJoinPolicy.ORIGIN_SCOPED}),i(t),o(s),l(r)}catch(e){(0,O.default)(V).error("Failed to initialize Chromecast SDK:",String(e)),u(!1)}},[e,c]),(0,E.useEffect)(()=>{if(!s)return;let e=cast.framework.CastState,t=t=>h(t.castState===e.CONNECTED);return s.addEventListener(cast.framework.CastContextEventType.CAST_STATE_CHANGED,t),h(s.getCastState()===e.CONNECTED),()=>{s.removeEventListener(cast.framework.CastContextEventType.CAST_STATE_CHANGED,t)}},[s]),(0,E.useEffect)(()=>{window.__onGCastApiAvailable=e=>{u(e)}},[]);let p=(0,E.useCallback)(async()=>{if(s)try{await s.requestSession()}catch(e){"cancel"!==e&&(0,O.default)(V).error("Failed to cast:",String(e))}},[s]),g=(0,E.useCallback)(e=>{(0,O.default)(V).error("Failed to load Chromecast SDK: ",String(e))},[]);return(0,r.jsxs)(_.default.Provider,{value:{castSession:s?.getCurrentSession()??void 0,remotePlayer:n,remotePlayerController:a,isCastSupported:c,isCasting:d,onCastButtonPress:p},children:[t,(0,r.jsx)(T.default,{src:"//www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1",strategy:"afterInteractive",onError:g})]})}var D=e.i(406956),R=e.i(471677),N=e.i(441044),x=e.i(71473);let M=(0,E.forwardRef)(function({"data-metrics":e,href:t,prefetch:i="enabled"===s.default.env.NEXT_PUBLIC_LINK_PREFETCH||void 0,replace:n,scroll:o,onClick:a,...l},c){let u=(0,E.useCallback)(t=>{if(a?.(t),"string"==typeof e&&!t.defaultPrevented)try{let t=JSON.parse(e);(0,R.default)(t)}catch{(0,O.default)("Metrics").error(`Failed to parse link \`data-metrics\` prop: "${e}"`)}},[a,e]),d=(0,N.default)(t),h=i??d,p=(0,E.useCallback)(()=>{n||h||(0,D.startProgress)(t)},[t,h,n]);return(0,x.default)(t)?(0,r.jsx)(y.Link,{...l,ref:c,href:t,prefetch:h,replace:n,scroll:o??!d,onClick:u,onNavigate:p}):(0,r.jsx)("a",{...l,ref:c,href:t,onClick:u})});var F=e.i(701689),U=e.i(79907);function k(){return new m({defaultOptions:{queries:{retry:!1}}})}e.s(["default",0,function({autoPlay:e=!1,children:s,locale:n,messages:o}){let a=i.isServer?k():(t||(t=k()),t);return(0,E.useEffect)(()=>{(0,U.isProdEnv)()||(window.__TANSTACK_QUERY_CLIENT__=a)},[a]),(0,r.jsx)(C.NextIntlClientProvider,{locale:n,messages:o,timeZone:"UTC",children:(0,r.jsx)(v.QueryClientProvider,{client:a,children:(0,r.jsx)(w.UltraBlurProvider,{children:(0,r.jsx)(P,{receiverApplicationId:"9AC194DC",children:(0,r.jsx)(A,{linkComponent:M,children:e?(0,r.jsx)(F.AutoPlayProvider,{children:s}):s})})})})})}],300169)},569568,e=>{"use strict";let t;var s,r,i,n,o,a,l,c,u,d,h,p,g,f,m,v,y=e.i(161605);e.i(39693),e.i(459873);var C=e.i(560819),E=e.i(630242),S=e.i(665846),I=e.i(242304),b=e.i(806420),L=e.i(397906),A=e.i(539369),w=e.i(856734),T=e.i(507623),_=e.i(8138);function O({isOpen:e,isSubmitting:t=!1,vendorCount:s,onAgree:r,onDisagree:i}){let n=(0,C.useTranslations)("core.ad-consent"),o=(0,w.default)(),[a,l]=(0,E.useState)(null),c=(0,E.useCallback)(()=>{l("agree"),r()},[r]),u=(0,E.useCallback)(()=>{l("disagree"),i()},[i]),d=t&&"agree"===a,h=t&&"disagree"===a,{data:p}=(0,T.default)(o?.anonymous&&e?`https://plex.tv/api/v2/security/token/?${new URLSearchParams({scope:"all",type:"delegation"}).toString()}`:null,{auth:o});return(0,y.jsx)(L.Modal,{dismissible:!1,open:e,children:(0,y.jsxs)(L.ModalContent,{accessibilityLabel:n("modal-accessibility-label"),closeButton:!1,"data-testid":"adConsentModal",size:"s",children:[(0,y.jsx)(L.ModalBody,{children:(0,y.jsxs)(I.Stack,{gap:"s",children:[(0,y.jsx)(A.Text,{children:n("intro-paragraph",{plex:"Plex"})}),(0,y.jsx)(A.Text,{children:n.rich("consent-paragraph",{plex:"Plex",vendorCount:s,vendorsLink:e=>(0,y.jsx)(b.Link,{color:"accent","data-id":"adConsentVendorsLink",href:(0,_.wwwUrl)(`/vendors${p?.token?`?token=${p.token}`:""}`),target:"_blank",children:e})})})]})}),(0,y.jsx)(L.ModalFooter,{children:(0,y.jsxs)(L.ModalButtonGroup,{align:"center",children:[(0,y.jsx)(S.Button,{"data-testid":"adConsentAgreeButton",disabled:t,label:n("agree-label"),waiting:d,onPress:c}),(0,y.jsx)(S.Button,{"data-testid":"adConsentDisagreeButton",disabled:t,label:n("disagree-label"),waiting:h,onPress:u})]})})]})})}var V=e.i(66443),P=e.i(208058);let D="https://plex.tv/api/v2/user/consent";var R=e.i(988632);(s=u||(u={})).PING="ping",s.GET_TC_DATA="getTCData",s.GET_IN_APP_TC_DATA="getInAppTCData",s.GET_VENDOR_LIST="getVendorList",s.ADD_EVENT_LISTENER="addEventListener",s.REMOVE_EVENT_LISTENER="removeEventListener",(r=d||(d={})).STUB="stub",r.LOADING="loading",r.LOADED="loaded",r.ERROR="error",(i=h||(h={})).VISIBLE="visible",i.HIDDEN="hidden",i.DISABLED="disabled",(n=p||(p={})).TC_LOADED="tcloaded",n.CMP_UI_SHOWN="cmpuishown",n.USER_ACTION_COMPLETE="useractioncomplete";class N{eventQueue=new Map;queueNumber=0;add(e){return this.eventQueue.set(this.queueNumber,e),this.queueNumber++}remove(e){return this.eventQueue.delete(e)}exec(){this.eventQueue.forEach((e,s)=>{new t(e.callback,e.param,s,e.next)})}clear(){this.queueNumber=0,this.eventQueue.clear()}get size(){return this.eventQueue.size}}class x{static apiVersion="2";static tcfPolicyVersion;static eventQueue=new N;static cmpStatus=d.LOADING;static disabled=!1;static displayStatus=h.HIDDEN;static cmpId;static cmpVersion;static eventStatus;static gdprApplies;static tcModel;static tcString;static reset(){delete this.cmpId,delete this.cmpVersion,delete this.eventStatus,delete this.gdprApplies,delete this.tcModel,delete this.tcString,delete this.tcfPolicyVersion,this.cmpStatus=d.LOADING,this.disabled=!1,this.displayStatus=h.HIDDEN,this.eventQueue.clear()}}class M{cmpId=x.cmpId;cmpVersion=x.cmpVersion;gdprApplies=x.gdprApplies;tcfPolicyVersion=x.tcfPolicyVersion}class F extends M{cmpStatus=d.ERROR}class U extends M{tcString;listenerId;eventStatus;cmpStatus;isServiceSpecific;useNonStandardTexts;publisherCC;purposeOneTreatment;outOfBand;purpose;vendor;specialFeatureOptins;publisher;constructor(e,t){if(super(),this.eventStatus=x.eventStatus,this.cmpStatus=x.cmpStatus,this.listenerId=t,x.gdprApplies){const t=x.tcModel;this.tcString=x.tcString,this.isServiceSpecific=t.isServiceSpecific,this.useNonStandardTexts=t.useNonStandardTexts,this.purposeOneTreatment=t.purposeOneTreatment,this.publisherCC=t.publisherCountryCode,!1===this.isServiceSpecific&&(this.outOfBand={allowedVendors:this.createVectorField(t.vendorsAllowed,e),disclosedVendors:this.createVectorField(t.vendorsDisclosed,e)}),this.purpose={consents:this.createVectorField(t.purposeConsents),legitimateInterests:this.createVectorField(t.purposeLegitimateInterests)},this.vendor={consents:this.createVectorField(t.vendorConsents,e),legitimateInterests:this.createVectorField(t.vendorLegitimateInterests,e),disclosedVendors:this.createVectorField(t.vendorsDisclosed,e)},this.specialFeatureOptins=this.createVectorField(t.specialFeatureOptins),this.publisher={consents:this.createVectorField(t.publisherConsents),legitimateInterests:this.createVectorField(t.publisherLegitimateInterests),customPurpose:{consents:this.createVectorField(t.publisherCustomConsents),legitimateInterests:this.createVectorField(t.publisherCustomLegitimateInterests)},restrictions:this.createRestrictions(t.publisherRestrictions)}}}createRestrictions(e){let t={};if(e.numRestrictions>0){let s=e.getMaxVendorId();for(let r=1;r<=s;r++){let s=r.toString();
1e.getRestrictions(r).forEach(e=>{let r=e.purposeId.toString();t[r]||(t[r]={}),t[r][s]=e.restrictionType})}}return t}createVectorField(e,t){return t?t.reduce((t,s)=>(t[String(s)]=e.has(Number(s)),t),{}):[...e].reduce((e,t)=>(e[t[0].toString(10)]=t[1],e),{})}}class k extends U{constructor(e){super(e),delete this.outOfBand}createVectorField(e){return[...e].reduce((e,t)=>e+=t[1]?"1":"0","")}createRestrictions(e){let t={};if(e.numRestrictions>0){let s=e.getMaxVendorId();e.getRestrictions().forEach(e=>{t[e.purposeId.toString()]="_".repeat(s)});for(let r=0;r<s;r++){let s=r+1;e.getRestrictions(s).forEach(e=>{let s=e.restrictionType.toString(),i=e.purposeId.toString(),n=t[i].substr(0,r),o=t[i].substr(r+1);t[i]=n+s+o})}}return t}}class Q extends M{cmpLoaded=!0;cmpStatus=x.cmpStatus;displayStatus=x.displayStatus;apiVersion=String(x.apiVersion);gvlVersion;constructor(){super(),x.tcModel&&x.tcModel.vendorListVersion&&(this.gvlVersion=+x.tcModel.vendorListVersion)}}class H{listenerId;callback;next;param;success=!0;constructor(e,t,s,r){Object.assign(this,{callback:e,listenerId:s,param:t,next:r});try{this.respond()}catch(e){this.invokeCallback(null)}}invokeCallback(e){let t=null!==e;"function"==typeof this.next?this.callback(this.next,e,t):this.callback(e,t)}}class G extends H{respond(){this.invokeCallback(new Q)}}class j extends H{respond(){this.throwIfParamInvalid(),this.invokeCallback(new U(this.param,this.listenerId))}throwIfParamInvalid(){if(void 0!==this.param&&(!Array.isArray(this.param)||!this.param.every(Number.isInteger)))throw Error("Invalid Parameter")}}t=j;class q extends j{respond(){this.throwIfParamInvalid(),this.invokeCallback(new k(this.param))}}class B{clone(){let e=new this.constructor;return Object.keys(this).forEach(t=>{let s=this.deepClone(this[t]);void 0!==s&&(e[t]=s)}),e}deepClone(e){let t=typeof e;if("number"===t||"string"===t||"boolean"===t)return e;if(null!==e&&"object"===t)if("function"==typeof e.clone)return e.clone();else if(e instanceof Date)return new Date(e.getTime());else if(void 0!==e[Symbol.iterator]){let t=[];for(let s of e)t.push(this.deepClone(s));return e instanceof Array?t:new e.constructor(t)}else{let t={};for(let s in e)e.hasOwnProperty(s)&&(t[s]=this.deepClone(e[s]));return t}}}class K extends Error{constructor(e,t,s=""){super(`invalid value ${t} passed for ${e} ${s}`),this.name="TCModelError"}}(o=g||(g={}))[o.NOT_ALLOWED=0]="NOT_ALLOWED",o[o.REQUIRE_CONSENT=1]="REQUIRE_CONSENT",o[o.REQUIRE_LI=2]="REQUIRE_LI";class $ extends B{static hashSeparator="-";purposeId_;restrictionType;constructor(e,t){super(),void 0!==e&&(this.purposeId=e),void 0!==t&&(this.restrictionType=t)}static unHash(e){let t=e.split(this.hashSeparator),s=new $;if(2!==t.length)throw new K("hash",e);return s.purposeId=parseInt(t[0],10),s.restrictionType=parseInt(t[1],10),s}get hash(){if(!this.isValid())throw Error("cannot hash invalid PurposeRestriction");return`${this.purposeId}${$.hashSeparator}${this.restrictionType}`}get purposeId(){return this.purposeId_}set purposeId(e){this.purposeId_=e}isValid(){return Number.isInteger(this.purposeId)&&this.purposeId>0&&(this.restrictionType===g.NOT_ALLOWED||this.restrictionType===g.REQUIRE_CONSENT||this.restrictionType===g.REQUIRE_LI)}isSameAs(e){return this.purposeId===e.purposeId&&this.restrictionType===e.restrictionType}}class W extends B{bitLength=0;map=new Map;gvl_;has(e){return this.map.has(e)}isOkToHave(e,t,s){let r=!0;if(this.gvl?.vendors){let i=this.gvl.vendors[s];if(i)if(e===g.NOT_ALLOWED)r=i.legIntPurposes.includes(t)||i.purposes.includes(t);else if(i.flexiblePurposes.length)switch(e){case g.REQUIRE_CONSENT:r=i.flexiblePurposes.includes(t)&&i.legIntPurposes.includes(t);break;case g.REQUIRE_LI:r=i.flexiblePurposes.includes(t)&&i.purposes.includes(t)}else r=!1;else r=!1}return r}add(e,t){if(this.isOkToHave(t.restrictionType,t.purposeId,e)){let s=t.hash;this.has(s)||(this.map.set(s,new Set),this.bitLength=0),this.map.get(s).add(e)}}restrictPurposeToLegalBasis(e){let t=Array.from(this.gvl.vendorIds),s=e.hash,r=t[t.length-1],i=[...Array(r).keys()].map(e=>e+1);if(this.has(s))for(let e=1;e<=r;e++)this.map.get(s).add(e);else this.map.set(s,new Set(i)),this.bitLength=0}getVendors(e){let t=[];if(e){let s=e.hash;this.has(s)&&(t=Array.from(this.map.get(s)))}else{let e=new Set;
1this.map.forEach(t=>{t.forEach(t=>{e.add(t)})}),t=Array.from(e)}return t.sort((e,t)=>e-t)}getRestrictionType(e,t){let s;return this.getRestrictions(e).forEach(e=>{e.purposeId===t&&(void 0===s||s>e.restrictionType)&&(s=e.restrictionType)}),s}vendorHasRestriction(e,t){let s=!1,r=this.getRestrictions(e);for(let e=0;e<r.length&&!s;e++)s=t.isSameAs(r[e]);return s}getMaxVendorId(){let e=0;return this.map.forEach(t=>{e=Math.max(Array.from(t)[t.size-1],e)}),e}getRestrictions(e){let t=[];return this.map.forEach((s,r)=>{e?s.has(e)&&t.push($.unHash(r)):t.push($.unHash(r))}),t}getPurposes(){let e=new Set;return this.map.forEach((t,s)=>{e.add($.unHash(s).purposeId)}),Array.from(e)}remove(e,t){let s=t.hash,r=this.map.get(s);r&&(r.delete(e),0==r.size&&(this.map.delete(s),this.bitLength=0))}set gvl(e){this.gvl_||(this.gvl_=e,this.map.forEach((e,t)=>{let s=$.unHash(t);Array.from(e).forEach(t=>{this.isOkToHave(s.restrictionType,s.purposeId,t)||e.delete(t)})}))}get gvl(){return this.gvl_}isEmpty(){return 0===this.map.size}get numRestrictions(){return this.map.size}}(a=f||(f={})).COOKIE="cookie",a.WEB="web",a.APP="app",(l=m||(m={})).CORE="core",l.VENDORS_DISCLOSED="vendorsDisclosed",l.VENDORS_ALLOWED="vendorsAllowed",l.PUBLISHER_TC="publisherTC";class z{static ID_TO_KEY=[m.CORE,m.VENDORS_DISCLOSED,m.VENDORS_ALLOWED,m.PUBLISHER_TC];static KEY_TO_ID={[m.CORE]:0,[m.VENDORS_DISCLOSED]:1,[m.VENDORS_ALLOWED]:2,[m.PUBLISHER_TC]:3}}class J{static cmpId="cmpId";static cmpVersion="cmpVersion";static consentLanguage="consentLanguage";static consentScreen="consentScreen";static created="created";static supportOOB="supportOOB";static isServiceSpecific="isServiceSpecific";static lastUpdated="lastUpdated";static numCustomPurposes="numCustomPurposes";static policyVersion="policyVersion";static publisherCountryCode="publisherCountryCode";static publisherCustomConsents="publisherCustomConsents";static publisherCustomLegitimateInterests="publisherCustomLegitimateInterests";static publisherLegitimateInterests="publisherLegitimateInterests";static publisherConsents="publisherConsents";static publisherRestrictions="publisherRestrictions";static purposeConsents="purposeConsents";static purposeLegitimateInterests="purposeLegitimateInterests";static purposeOneTreatment="purposeOneTreatment";static specialFeatureOptins="specialFeatureOptins";static useNonStandardTexts="useNonStandardTexts";static vendorConsents="vendorConsents";static vendorLegitimateInterests="vendorLegitimateInterests";static vendorListVersion="vendorListVersion";static vendorsAllowed="vendorsAllowed";static vendorsDisclosed="vendorsDisclosed";static version="version"}class Y{static [J.cmpId]=12;static [J.cmpVersion]=12;static [J.consentLanguage]=12;static [J.consentScreen]=6;static [J.created]=36;static [J.isServiceSpecific]=1;static [J.lastUpdated]=36;static [J.policyVersion]=6;static [J.publisherCountryCode]=12;static [J.publisherLegitimateInterests]=24;static [J.publisherConsents]=24;static [J.purposeConsents]=24;static [J.purposeLegitimateInterests]=24;static [J.purposeOneTreatment]=1;static [J.specialFeatureOptins]=12;static [J.useNonStandardTexts]=1;static [J.vendorListVersion]=12;static [J.version]=6;static anyBoolean=1;static encodingType=1;static maxId=16;static numCustomPurposes=6;static numEntries=12;static numRestrictions=12;static purposeId=6;static restrictionType=2;static segmentType=3;static singleOrRange=1;static vendorId=16}
1class Z extends Error{constructor(e){super(e),this.name="DecodingError"}}class X extends Error{constructor(e){super(e),this.name="EncodingError"}}class ee{static DICT="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";static REVERSE_DICT=new Map([["A",0],["B",1],["C",2],["D",3],["E",4],["F",5],["G",6],["H",7],["I",8],["J",9],["K",10],["L",11],["M",12],["N",13],["O",14],["P",15],["Q",16],["R",17],["S",18],["T",19],["U",20],["V",21],["W",22],["X",23],["Y",24],["Z",25],["a",26],["b",27],["c",28],["d",29],["e",30],["f",31],["g",32],["h",33],["i",34],["j",35],["k",36],["l",37],["m",38],["n",39],["o",40],["p",41],["q",42],["r",43],["s",44],["t",45],["u",46],["v",47],["w",48],["x",49],["y",50],["z",51],["0",52],["1",53],["2",54],["3",55],["4",56],["5",57],["6",58],["7",59],["8",60],["9",61],["-",62],["_",63]]);static BASIS=6;static LCM=24;static encode(e){if(!/^[0-1]+$/.test(e))throw new X("Invalid bitField");let t=e.length%this.LCM;e+=t?"0".repeat(this.LCM-t):"";let s="";for(let t=0;t<e.length;t+=this.BASIS)s+=this.DICT[parseInt(e.substr(t,this.BASIS),2)];return s}static decode(e){if(!/^[A-Za-z0-9\-_]+$/.test(e))throw new Z("Invalidly encoded Base64URL string");let t="";for(let s=0;s<e.length;s++){let r=this.REVERSE_DICT.get(e[s]).toString(2);t+="0".repeat(this.BASIS-r.length)+r}return t}}class et{static encode(e){return String(Number(e))}static decode(e){return"1"===e}}class es{static encode(e,t){let s;if("string"==typeof e&&(e=parseInt(e,10)),(s=e.toString(2)).length>t||e<0)throw new X(`${e} too large to encode into ${t}`);return s.length<t&&(s="0".repeat(t-s.length)+s),s}static decode(e,t){if(t!==e.length)throw new Z("invalid bit length");return parseInt(e,2)}}class er{static encode(e,t){return es.encode(Math.round(e.getTime()/100),t)}static decode(e,t){if(t!==e.length)throw new Z("invalid bit length");let s=new Date;return s.setTime(100*es.decode(e,t)),s}}
1class ei extends B{bitLength=0;maxId_=0;set_=new Set;*[Symbol.iterator](){for(let e=1;e<=this.maxId;e++)yield[e,this.has(e)]}values(){return this.set_.values()}get maxId(){return this.maxId_}has(e){return this.set_.has(e)}unset(e){Array.isArray(e)?e.forEach(e=>this.unset(e)):"object"==typeof e?this.unset(Object.keys(e).map(e=>Number(e))):(this.set_.delete(Number(e)),this.bitLength=0,e===this.maxId&&(this.maxId_=0,this.set_.forEach(e=>{this.maxId_=Math.max(this.maxId,e)})))}isIntMap(e){let t="object"==typeof e;return t&&Object.keys(e).every(t=>{let s=Number.isInteger(parseInt(t,10));return(s=s&&this.isValidNumber(e[t].id))&&void 0!==e[t].name})}isValidNumber(e){return parseInt(e,10)>0}isSet(e){let t=!1;return e instanceof Set&&(t=Array.from(e).every(this.isValidNumber)),t}set(e){if(Array.isArray(e))e.forEach(e=>this.set(e));else if(this.isSet(e))this.set(Array.from(e));else if(this.isIntMap(e))this.set(Object.keys(e).map(e=>Number(e)));else if(this.isValidNumber(e))this.set_.add(e),this.maxId_=Math.max(this.maxId,e),this.bitLength=0;else throw new K("set()",e,"must be positive integer array, positive integer, Set<number>, or IntMap")}empty(){this.set_=new Set,this.maxId_=0}forEach(e){for(let t=1;t<=this.maxId;t++)e(this.has(t),t)}get size(){return this.set_.size}setAll(e){this.set(e)}unsetAll(e){this.unset(e)}}class en{static encode(e,t){let s="";for(let r=1;r<=t;r++)s+=et.encode(e.has(r));return s}static decode(e,t){if(e.length!==t)throw new Z("bitfield encoding length mismatch");let s=new ei;for(let r=1;r<=t;r++)et.decode(e[r-1])&&s.set(r);return s.bitLength=e.length,s}}class eo{static encode(e,t){let s=(e=e.toUpperCase()).charCodeAt(0)-65,r=e.charCodeAt(1)-65;if(s<0||s>25||r<0||r>25)throw new X(`invalid language code: ${e}`);if(t%2==1)throw new X(`numBits must be even, ${t} is not valid`);return t/=2,es.encode(s,t)+es.encode(r,t)}static decode(e,t){let s;if(t!==e.length||e.length%2)throw new Z("invalid bit length for language");{let t=e.length/2,r=es.decode(e.slice(0,t),t)+65,i=es.decode(e.slice(t),t)+65;s=String.fromCharCode(r)+String.fromCharCode(i)}return s}}class ea{static encode(e){let t=es.encode(e.numRestrictions,Y.numRestrictions);if(!e.isEmpty()){let s=(t,s)=>{for(let r=t+1;r<=s;r++)if(e.gvl.vendorIds.has(r))return r;return t};e.getRestrictions().forEach(r=>{t+=es.encode(r.purposeId,Y.purposeId),t+=es.encode(r.restrictionType,Y.restrictionType);let i=e.getVendors(r),n=i.length,o=0,a=0,l="";for(let e=0;e<n;e++){let t=i[e];if(0===a&&(o++,a=t),e===n-1||i[e+1]>s(t,i[n-1])){let e=t!==a;l+=et.encode(e),l+=es.encode(a,Y.vendorId),e&&(l+=es.encode(t,Y.vendorId)),a=0}}t+=es.encode(o,Y.numEntries),t+=l})}return t}static decode(e){let t=0,s=new W,r=es.decode(e.substr(t,Y.numRestrictions),Y.numRestrictions);t+=Y.numRestrictions;for(let i=0;i<r;i++){let r=es.decode(e.substr(t,Y.purposeId),Y.purposeId);t+=Y.purposeId;let i=es.decode(e.substr(t,Y.restrictionType),Y.restrictionType);t+=Y.restrictionType;let n=new $(r,i),o=es.decode(e.substr(t,Y.numEntries),Y.numEntries);t+=Y.numEntries;for(let r=0;r<o;r++){let r=et.decode(e.substr(t,Y.anyBoolean));t+=Y.anyBoolean;let i=es.decode(e.substr(t,Y.vendorId),Y.vendorId);if(t+=Y.vendorId,r){let r=es.decode(e.substr(t,Y.vendorId),Y.vendorId);if(t+=Y.vendorId,r<i)throw new Z(`Invalid RangeEntry: endVendorId ${r} is less than ${i}`);for(let e=i;e<=r;e++)s.add(e,n)}else s.add(i,n)}}return s.bitLength=t,s}}(c=v||(v={}))[c.FIELD=0]="FIELD",c[c.RANGE=1]="RANGE";class el{static encode(e){let t,s=[],r=[],i=es.encode(e.maxId,Y.maxId),n="",o=Y.maxId+Y.encodingType,a=o+e.maxId,l=2*Y.vendorId+Y.singleOrRange+Y.numEntries,c=o+Y.numEntries;return e.forEach((i,o)=>{n+=et.encode(i),(t=e.maxId>l&&c<a)&&i&&(e.has(o+1)?0===r.length&&(r.push(o),c+=Y.singleOrRange,c+=Y.vendorId):(r.push(o),c+=Y.vendorId,s.push(r),r=[]))}),t?(i+=String(v.RANGE),i+=this.buildRangeEncoding(s)):(i+=String(v.FIELD),i+=n),i}static decode(e,t){let s,r=0,i=es.decode(e.substr(r,Y.maxId),Y.maxId);r+=Y.maxId;let n=es.decode(e.charAt(r),Y.encodingType);if(r+=Y.encodingType,n===v.RANGE){if(s=new ei,1===t){if("1"===e.substr(r,1))throw new Z("Unable to decode default consent=1");r++}let i=es.decode(e.substr(r,Y.numEntries),Y.numEntries);r+=Y.numEntries;for(let t=0;t<i;t++){let t=et.decode(e.charAt(r));r+=Y.singleOrRange;let i=es.decode(e.substr(r,Y.vendorId),Y.vendorId);
1if(r+=Y.vendorId,t){let t=es.decode(e.substr(r,Y.vendorId),Y.vendorId);r+=Y.vendorId;for(let e=i;e<=t;e++)s.set(e)}else s.set(i)}}else{let t=e.substr(r,i);r+=i,s=en.decode(t,i)}return s.bitLength=r,s}static buildRangeEncoding(e){let t=e.length,s=es.encode(t,Y.numEntries);return e.forEach(e=>{let t=1===e.length;s+=et.encode(!t),s+=es.encode(e[0],Y.vendorId),t||(s+=es.encode(e[1],Y.vendorId))}),s}}function ec(){return{[J.version]:es,[J.created]:er,[J.lastUpdated]:er,[J.cmpId]:es,[J.cmpVersion]:es,[J.consentScreen]:es,[J.consentLanguage]:eo,[J.vendorListVersion]:es,[J.policyVersion]:es,[J.isServiceSpecific]:et,[J.useNonStandardTexts]:et,[J.specialFeatureOptins]:en,[J.purposeConsents]:en,[J.purposeLegitimateInterests]:en,[J.purposeOneTreatment]:et,[J.publisherCountryCode]:eo,[J.vendorConsents]:el,[J.vendorLegitimateInterests]:el,[J.publisherRestrictions]:ea,segmentType:es,[J.vendorsDisclosed]:el,[J.vendorsAllowed]:el,[J.publisherConsents]:en,[J.publisherLegitimateInterests]:en,[J.numCustomPurposes]:es,[J.publisherCustomConsents]:en,[J.publisherCustomLegitimateInterests]:en}}class eu{1={[m.CORE]:[J.version,J.created,J.lastUpdated,J.cmpId,J.cmpVersion,J.consentScreen,J.consentLanguage,J.vendorListVersion,J.purposeConsents,J.vendorConsents]};2={[m.CORE]:[J.version,J.created,J.lastUpdated,J.cmpId,J.cmpVersion,J.consentScreen,J.consentLanguage,J.vendorListVersion,J.policyVersion,J.isServiceSpecific,J.useNonStandardTexts,J.specialFeatureOptins,J.purposeConsents,J.purposeLegitimateInterests,J.purposeOneTreatment,J.publisherCountryCode,J.vendorConsents,J.vendorLegitimateInterests,J.publisherRestrictions],[m.VENDORS_DISCLOSED]:[J.vendorsDisclosed],[m.PUBLISHER_TC]:[J.publisherConsents,J.publisherLegitimateInterests,J.numCustomPurposes,J.publisherCustomConsents,J.publisherCustomLegitimateInterests],[m.VENDORS_ALLOWED]:[J.vendorsAllowed]}}class ed{1=[m.CORE];2=[m.CORE];constructor(e,t){if(2===e.version)if(e.isServiceSpecific)this["2"].push(m.VENDORS_DISCLOSED),this["2"].push(m.PUBLISHER_TC);else{const s=!!(t&&t.isForVendors);s&&!0!==e[J.supportOOB]||this["2"].push(m.VENDORS_DISCLOSED),s&&(e[J.supportOOB]&&e[J.vendorsAllowed].size>0&&this["2"].push(m.VENDORS_ALLOWED),this["2"].push(m.PUBLISHER_TC))}}}class eh{static fieldSequence=new eu;static encode(e,t){let s;try{s=this.fieldSequence[String(e.version)][t]}catch(s){throw new X(`Unable to encode version: ${e.version}, segment: ${t}`)}let r="";t!==m.CORE&&(r=es.encode(z.KEY_TO_ID[t],Y.segmentType));let i=ec();return s.forEach(s=>{let n=e[s],o=i[s],a=Y[s];void 0===a&&this.isPublisherCustom(s)&&(a=Number(e[J.numCustomPurposes]));try{r+=o.encode(n,a)}catch(e){throw new X(`Error encoding ${t}->${s}: ${e.message}`)}}),ee.encode(r)}static decode(e,t,s){let r=ee.decode(e),i=0;s===m.CORE&&(t.version=es.decode(r.substr(i,Y[J.version]),Y[J.version])),s!==m.CORE&&(i+=Y.segmentType);let n=this.fieldSequence[String(t.version)][s],o=ec();return n.forEach(e=>{let s=o[e],n=Y[e];if(void 0===n&&this.isPublisherCustom(e)&&(n=Number(t[J.numCustomPurposes])),0!==n){let o=r.substr(i,n);if(s===el?t[e]=s.decode(o,t.version):t[e]=s.decode(o,n),Number.isInteger(n))i+=n;else if(Number.isInteger(t[e].bitLength))i+=t[e].bitLength;else throw new Z(e)}}),t}static isPublisherCustom(e){return 0===e.indexOf("publisherCustom")}}class ep{static processor=[e=>e,(e,t)=>{e.publisherRestrictions.gvl=t,e.purposeLegitimateInterests.unset([1,3,4,5,6]);let s=new Map;return s.set("legIntPurposes",e.vendorLegitimateInterests),s.set("purposes",e.vendorConsents),s.forEach((s,r)=>{s.forEach((i,n)=>{if(i){let i=t.vendors[n];if(!i||i.deletedDate)s.unset(n);else if(0===i[r].length)if(e.isServiceSpecific)if(0===i.flexiblePurposes.length)s.unset(n);else{let t=e.publisherRestrictions.getRestrictions(n),i=!1;for(let e=0,s=t.length;e<s&&!i;e++)i=t[e].restrictionType===g.REQUIRE_CONSENT&&"purposes"===r||t[e].restrictionType===g.REQUIRE_LI&&"legIntPurposes"===r;i||s.unset(n)}else s.unset(n)}})}),e}];static process(e,t){let s=e.gvl;if(!s)throw new X("Unable to encode TCModel without a GVL");if(!s.isReady)throw new X("Unable to encode TCModel tcModel.gvl.readyPromise is not resolved");(e=e.clone()).consentLanguage=s.language.slice(0,2).toUpperCase(),t?.version>0&&t?.version<=this.processor.length?e.version=t.version:e.version=this.processor.length;let r=e.version-1;
1if(!this.processor[r])throw new X(`Invalid version: ${e.version}`);return this.processor[r](e,s)}}class eg extends Error{constructor(e){super(e),this.name="GVLError"}}class ef{static absCall(e,t,s,r){return new Promise((i,n)=>{let o=new XMLHttpRequest;o.withCredentials=s,o.addEventListener("load",()=>{if(o.readyState==XMLHttpRequest.DONE)if(o.status>=200&&o.status<300){let e=o.response;if("string"==typeof e)try{e=JSON.parse(e)}catch(e){}i(e)}else n(Error(`HTTP Status: ${o.status} response type: ${o.responseType}`))}),o.addEventListener("error",()=>{n(Error("error"))}),o.addEventListener("abort",()=>{n(Error("aborted"))}),null===t?o.open("GET",e,!0):o.open("POST",e,!0),o.responseType="json",o.timeout=r,o.ontimeout=()=>{n(Error("Timeout "+r+"ms "+e))},o.send(t)})}static post(e,t,s=!1,r=0){return this.absCall(e,JSON.stringify(t),s,r)}static fetch(e,t=!1,s=0){return this.absCall(e,null,t,s)}}class em{static langSet=new Set(["AR","BG","BS","CA","CS","CY","DA","DE","EL","EN","ES","ET","EU","FI","FR","GL","HE","HI","HR","HU","ID","IS","IT","JA","KA","KO","LT","LV","MK","MS","MT","NL","NO","PL","PT-BR","PT-PT","RO","RU","SK","SL","SQ","SR-LATN","SR-CYRL","SV","SW","TH","TL","TR","UK","VI","ZH","ZH-HANT"]);has(e){return em.langSet.has(e)}parseLanguage(e){let t=(e=e.toUpperCase()).split("-")[0];if(e.length>=2&&2==t.length){if(em.langSet.has(e))return e;if(em.langSet.has(t))return t;let s=t+"-"+t;if(em.langSet.has(s))return s;for(let s of em.langSet)if(-1!==s.indexOf(e)||-1!==s.indexOf(t))return s}throw Error(`unsupported language ${e}`)}forEach(e){em.langSet.forEach(e)}get size(){return em.langSet.size}}class ev extends B{static LANGUAGE_CACHE=new Map;static CACHE=new Map;static LATEST_CACHE_KEY=0;static DEFAULT_LANGUAGE="EN";static consentLanguages=new em;static baseUrl_;static set baseUrl(e){if(/^https?:\/\/vendorlist\.consensu\.org\//.test(e))throw new eg("Invalid baseUrl!  You may not pull directly from vendorlist.consensu.org and must provide your own cache");e.length>0&&"/"!==e[e.length-1]&&(e+="/"),this.baseUrl_=e}static get baseUrl(){return this.baseUrl_}static latestFilename="vendor-list.json";static versionedFilename="archives/vendor-list-v[VERSION].json";static languageFilename="purposes-[LANG].json";readyPromise;gvlSpecificationVersion;vendorListVersion;tcfPolicyVersion;lastUpdated;purposes;specialPurposes;features;specialFeatures;isReady_=!1;vendors_;vendorIds;fullVendorList;byPurposeVendorMap;bySpecialPurposeVendorMap;byFeatureVendorMap;bySpecialFeatureVendorMap;stacks;dataCategories;standardTexts;lang_;cacheLang_;isLatest=!1;constructor(e,t){super();let s=ev.baseUrl,r=t?.language;if(r)try{r=ev.consentLanguages.parseLanguage(r)}catch(e){throw new eg("Error during parsing the language: "+e.message)}if(this.lang_=r||ev.DEFAULT_LANGUAGE,this.cacheLang_=r||ev.DEFAULT_LANGUAGE,this.isVendorList(e))this.populate(e),this.readyPromise=Promise.resolve();else{if(!s)throw new eg("must specify GVL.baseUrl before loading GVL json");e>0?ev.CACHE.has(e)?(this.populate(ev.CACHE.get(e)),this.readyPromise=Promise.resolve()):(s+=ev.versionedFilename.replace("[VERSION]",String(e)),this.readyPromise=this.fetchJson(s)):ev.CACHE.has(ev.LATEST_CACHE_KEY)?(this.populate(ev.CACHE.get(ev.LATEST_CACHE_KEY)),this.readyPromise=Promise.resolve()):(this.isLatest=!0,this.readyPromise=this.fetchJson(s+ev.latestFilename))}}static emptyLanguageCache(e){let t=!1;return null==e&&ev.LANGUAGE_CACHE.size>0?(ev.LANGUAGE_CACHE=new Map,t=!0):"string"==typeof e&&this.consentLanguages.has(e.toUpperCase())&&(ev.LANGUAGE_CACHE.delete(e.toUpperCase()),t=!0),t}static emptyCache(e){let t=!1;return Number.isInteger(e)&&e>=0?(ev.CACHE.delete(e),t=!0):void 0===e&&(ev.CACHE=new Map,t=!0),t}cacheLanguage(){ev.LANGUAGE_CACHE.has(this.cacheLang_)||ev.LANGUAGE_CACHE.set(this.cacheLang_,{purposes:this.purposes,specialPurposes:this.specialPurposes,features:this.features,specialFeatures:this.specialFeatures,stacks:this.stacks,dataCategories:this.dataCategories,standardTexts:this.standardTexts})}async fetchJson(e){try{this.populate(await ef.fetch(e))}catch(e){throw new eg(e.message)}}getJson(){return{gvlSpecificationVersion:this.gvlSpecificationVersion,vendorListVersion:this.vendorListVersion,tcfPolicyVersion:this.tcfPolicyVersion,lastUpdated:this.lastUpdated,purposes:this.clonePurposes(),specialPurposes:this.cloneSpecialPurposes(),features:this.cloneFeatures(),specialFeatures:this.cloneSpecialFeatures(),...this.standardTexts?{standardTexts:this.standardTexts}:{},stacks:this.cloneStacks(),...this.dataCategories?{dataCategories:this.cloneDataCategories()}:{},vendors:this.cloneVendors()}}cloneSpecialFeatures(){let e={};for(let t of Object.keys(this.specialFeatures))e[t]=ev.cloneFeature(this.specialFeatures[t]);return e}cloneFeatures(){let e={};for(let t of Object.keys(this.features))e[t]=ev.cloneFeature(this.features[t]);return e}cloneStacks(){let e={};for(let t of Object.keys(this.stacks))e[t]=ev.cloneStack(this.stacks[t]);return e}cloneDataCategories(){let e={};for(let t of Object.keys(this.dataCategories))e[t]=ev.cloneDataCategory(this.dataCategories[t]);return e}cloneSpecialPurposes(){let e={};for(let t of Object.keys(this.specialPurposes))e[t]=ev.clonePurpose(this.specialPurposes[t]);return e}clonePurposes(){let e={};for(let t of Object.keys(this.purposes))e[t]=ev.clonePurpose(this.purposes[t]);return e}static clonePurpose(e){return{id:e.id,name:e.name,description:e.description,...e.descriptionLegal?{descriptionLegal:e.descriptionLegal}:{},...e.illustrations?{illustrations:Array.from(e.illustrations)}:{}}}static cloneFeature(e){return{id:e.id,name:e.name,description:e.description,...e.descriptionLegal?{descriptionLegal:e.descriptionLegal}:{},...e.illustrations?{illustrations:Array.from(e.illustrations)}:{}}}static cloneDataCategory(e){return{id:e.id,name:e.name,description:e.description}}static cloneStack(e){return{id:e.id,name:e.name,description:e.description,purposes:Array.from(e.purposes),specialFeatures:Array.from(e.specialFeatures)}}static cloneDataRetention(e){return{..."number"==typeof e.stdRetention?{stdRetention:e.stdRetention}:{},purposes:{...e.purposes},specialPurposes:{...e.specialPurposes}}}static cloneVendorUrls(e){return e.map(e=>({langId:e.langId,privacy:e.privacy,...e.legIntClaim?{legIntClaim:e.legIntClaim}:{}}))}static cloneVendor(e){return{id:e.id,name:e.name,purposes:Array.from(e.purposes),legIntPurposes:Array.from(e.legIntPurposes),flexiblePurposes:Array.from(e.flexiblePurposes),specialPurposes:Array.from(e.specialPurposes),features:Array.from(e.features),specialFeatures:Array.from(e.specialFeatures),...e.overflow?{overflow:{httpGetLimit:e.overflow.httpGetLimit}}:{},..."number"==typeof e.cookieMaxAgeSeconds||null===e.cookieMaxAgeSeconds?{cookieMaxAgeSeconds:e.cookieMaxAgeSeconds}:{},...void 0!==e.usesCookies?{usesCookies:e.usesCookies}:{},...e.policyUrl?{policyUrl:e.policyUrl}:{},...void 0!==e.cookieRefresh?{cookieRefresh:e.cookieRefresh}:{},...void 0!==e.usesNonCookieAccess?{usesNonCookieAccess:e.usesNonCookieAccess}:{},...e.dataRetention?{dataRetention:this.cloneDataRetention(e.dataRetention)}:{},...e.urls?{urls:this.cloneVendorUrls(e.urls)}:{},...e.dataDeclaration?{dataDeclaration:Array.from(e.dataDeclaration)}:{},...e.deviceStorageDisclosureUrl?{deviceStorageDisclosureUrl:e.deviceStorageDisclosureUrl}:{},...e.deletedDate?{deletedDate:e.deletedDate}:{}}}cloneVendors(){let e={};for(let t of Object.keys(this.fullVendorList))e[t]=ev.cloneVendor(this.fullVendorList[t]);return e}async changeLanguage(e){let t=e;try{t=ev.consentLanguages.parseLanguage(e)}catch(e){throw new eg("Error during parsing the language: "+e.message)}let s=e.toUpperCase();if((t.toLowerCase()!==ev.DEFAULT_LANGUAGE.toLowerCase()||ev.LANGUAGE_CACHE.has(s))&&t!==this.lang_)if(this.lang_=t,ev.LANGUAGE_CACHE.has(s)){let e=ev.LANGUAGE_CACHE.get(s);for(let t in e)e.hasOwnProperty(t)&&(this[t]=e[t])}else{let e=ev.baseUrl+ev.languageFilename.replace("[LANG]",this.lang_.toLowerCase());try{await this.fetchJson(e),this.cacheLang_=s,this.cacheLanguage()}catch(e){throw new eg("unable to load language: "+e.message)}}}get language(){return this.lang_}isVendorList(e){return void 0!==e&&void 0!==e.vendors}populate(e){this.purposes=e.purposes,this.specialPurposes=e.specialPurposes,this.features=e.features,this.specialFeatures=e.specialFeatures,this.standardTexts=e.standardTexts,this.stacks=e.stacks,this.dataCategories=e.dataCategories,this.isVendorList(e)&&(this.gvlSpecificationVersion=e.gvlSpecificationVersion,this.tcfPolicyVersion=e.tcfPolicyVersion,this.vendorListVersion=e.vendorListVersion,this.lastUpdated=e.lastUpdated,"string"==typeof this.lastUpdated&&(this.lastUpdated=new Date(this.lastUpdated)),this.vendors_=e.vendors,this.fullVendorList=e.vend
1ors,this.mapVendors(),this.isReady_=!0,this.isLatest&&ev.CACHE.set(ev.LATEST_CACHE_KEY,this.getJson()),ev.CACHE.has(this.vendorListVersion)||ev.CACHE.set(this.vendorListVersion,this.getJson())),this.cacheLanguage()}mapVendors(e){this.byPurposeVendorMap={},this.bySpecialPurposeVendorMap={},this.byFeatureVendorMap={},this.bySpecialFeatureVendorMap={},Object.keys(this.purposes).forEach(e=>{this.byPurposeVendorMap[e]={legInt:new Set,consent:new Set,flexible:new Set}}),Object.keys(this.specialPurposes).forEach(e=>{this.bySpecialPurposeVendorMap[e]=new Set}),Object.keys(this.features).forEach(e=>{this.byFeatureVendorMap[e]=new Set}),Object.keys(this.specialFeatures).forEach(e=>{this.bySpecialFeatureVendorMap[e]=new Set}),Array.isArray(e)||(e=Object.keys(this.fullVendorList).map(e=>+e)),this.vendorIds=new Set(e),this.vendors_=e.reduce((e,t)=>{let s=this.vendors_[String(t)];return s&&void 0===s.deletedDate&&(s.purposes.forEach(e=>{this.byPurposeVendorMap[String(e)].consent.add(t)}),s.specialPurposes.forEach(e=>{this.bySpecialPurposeVendorMap[String(e)].add(t)}),s.legIntPurposes.forEach(e=>{this.byPurposeVendorMap[String(e)].legInt.add(t)}),s.flexiblePurposes&&s.flexiblePurposes.forEach(e=>{this.byPurposeVendorMap[String(e)].flexible.add(t)}),s.features.forEach(e=>{this.byFeatureVendorMap[String(e)].add(t)}),s.specialFeatures.forEach(e=>{this.bySpecialFeatureVendorMap[String(e)].add(t)}),e[t]=s),e},{})}getFilteredVendors(e,t,s,r){let i=e.charAt(0).toUpperCase()+e.slice(1),n={};return("purpose"===e&&s?this["by"+i+"VendorMap"][String(t)][s]:this["by"+(r?"Special":"")+i+"VendorMap"][String(t)]).forEach(e=>{n[String(e)]=this.vendors[String(e)]}),n}getVendorsWithConsentPurpose(e){return this.getFilteredVendors("purpose",e,"consent")}getVendorsWithLegIntPurpose(e){return this.getFilteredVendors("purpose",e,"legInt")}getVendorsWithFlexiblePurpose(e){return this.getFilteredVendors("purpose",e,"flexible")}getVendorsWithSpecialPurpose(e){return this.getFilteredVendors("purpose",e,void 0,!0)}getVendorsWithFeature(e){return this.getFilteredVendors("feature",e)}getVendorsWithSpecialFeature(e){return this.getFilteredVendors("feature",e,void 0,!0)}get vendors(){return this.vendors_}narrowVendorsTo(e){this.mapVendors(e)}get isReady(){return this.isReady_}clone(){let e=new ev(this.getJson());return this.lang_!==ev.DEFAULT_LANGUAGE&&e.changeLanguage(this.lang_),e}static isInstanceOf(e){return"object"==typeof e&&"function"==typeof e.narrowVendorsTo}}class ey extends B{static consentLanguages=ev.consentLanguages;isServiceSpecific_=!0;supportOOB_=!1;useNonStandardTexts_=!1;purposeOneTreatment_=!1;publisherCountryCode_="AA";version_=2;consentScreen_=0;policyVersion_=5;consentLanguage_="EN";cmpId_=0;cmpVersion_=0;vendorListVersion_=0;numCustomPurposes_=0;gvl_;created;lastUpdated;specialFeatureOptins=new ei;purposeConsents=new ei;purposeLegitimateInterests=new ei;publisherConsents=new ei;publisherLegitimateInterests=new ei;publisherCustomConsents=new ei;publisherCustomLegitimateInterests=new ei;customPurposes;vendorConsents=new ei;vendorLegitimateInterests=new ei;vendorsDisclosed=new ei;vendorsAllowed=new ei;publisherRestrictions=new W;constructor(e){super(),e&&(this.gvl=e),this.updated()}set gvl(e){ev.isInstanceOf(e)||(e=new ev(e)),this.gvl_=e,this.publisherRestrictions.gvl=e}get gvl(){return this.gvl_}set cmpId(e){if(Number.isInteger(e=Number(e))&&e>1)this.cmpId_=e;else throw new K("cmpId",e)}get cmpId(){return this.cmpId_}set cmpVersion(e){if(Number.isInteger(e=Number(e))&&e>-1)this.cmpVersion_=e;else throw new K("cmpVersion",e)}get cmpVersion(){return this.cmpVersion_}set consentScreen(e){if(Number.isInteger(e=Number(e))&&e>-1)this.consentScreen_=e;else throw new K("consentScreen",e)}get consentScreen(){return this.consentScreen_}set consentLanguage(e){this.consentLanguage_=e}get consentLanguage(){return this.consentLanguage_}set publisherCountryCode(e){if(/^([A-z]){2}$/.test(e))this.publisherCountryCode_=e.toUpperCase();else throw new K("publisherCountryCode",e)}get publisherCountryCode(){return this.publisherCountryCode_}set vendorListVersion(e){if((e=0|Number(e))<0)throw new K("vendorListVersion",e);this.vendorListVersion_=e}get vendorListVersion(){return this.gvl?this.gvl.vendorListVersion:this.vendorListVersion_}set policyVersion(e){if(this.policyVersion_=parseInt(e,10),this.policyVersion_<0)throw new K("policyVersion",e)}get policyVersion(){return this.gvl?this.gvl.tcfPolicyVersion:this.policyVersion_}set version(e){this.version_=parseInt(e,10)}get version(){return this.version_}set isServiceSpecific(e){this.isServiceSpecific_=e}get isServiceSpecific(){return this.isServiceSpecific_}set useNonStandardTexts(e){this.useNonStandardTexts_=e}get useNonStandardTexts(){return this.useNonStandardTexts_}set supportOOB(e){this.supportOOB_=e}get supportOOB(){return this.supportOOB_}set purposeOneTreatment(e){this.purposeOneTreatment_=e}get purposeOneTreatment(){return this.purposeOneTreatment_}setAllVendorConsents(){this.vendorConsents.set(this.gvl.vendors)}unsetAllVendorConsents(){this.vendorConsents.empty()}setAllVendorsDisclosed(){this.vendorsDisclosed.set(this.gvl.vendors)}unsetAllVendorsDisclosed(){this.vendorsDisclosed.empty()}setAllVendorsAllowed(){this.vendorsAllowed.set(this.gvl.vendors)}unsetAllVendorsAllowed(){this.vendorsAllowed.empty()}setAllVendorLegitimateInterests(){this.vendorLegitimateInterests.set(this.gvl.vendors)}unsetAllVendorLegitimateInterests(){this.vendorLegitimateInterests.empty()}setAllPurposeConsents(){this.purposeConsents.set(this.gvl.purposes)}unsetAllPurposeConsents(){this.purposeConsents.empty()}setAllPurposeLegitimateInterests(){this.purposeLegitimateInterests.set(this.gvl.purposes)}unsetAllPurposeLegitimateInterests(){this.purposeLegitimateInterests.empty()}setAllSpecialFeatureOptins(){this.specialFeatureOptins.set(this.gvl.specialFeatures)}unsetAllSpecialFeatureOptins(){this.specialFeatureOptins.empty()}setAll(){this.setAllVendorConsents(),this.setAllPurposeLegitimateInterests(),this.setAllSpecialFeatureOptins(),this.setAllPurposeConsents(),this.setAllVendorLegitimateInterests()}unsetAll(){this.unsetAllVendorConsents(),this.unsetAllPurposeLegitimateInterests(),this.unsetAllSpecialFeatureOptins(),this.unsetAllPurposeConsents(),this.unsetAllVendorLegitimateInterests()}get numCustomPurposes(){let e=this.numCustomPurposes_;
1return"object"==typeof this.customPurposes&&(e=parseInt(Object.keys(this.customPurposes).sort((e,t)=>Number(e)-Number(t)).pop(),10)),e}set numCustomPurposes(e){if(this.numCustomPurposes_=parseInt(e,10),this.numCustomPurposes_<0)throw new K("numCustomPurposes",e)}updated(){let e=new Date,t=new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()));this.created=t,this.lastUpdated=t}}class eC{static encode(e,t){let s,r="";return e=ep.process(e,t),(s=Array.isArray(t?.segments)?t.segments:new ed(e,t)[""+e.version]).forEach((t,i)=>{let n="";i<s.length-1&&(n="."),r+=eh.encode(e,t)+n}),r}static decode(e,t){let s=e.split("."),r=s.length;t||(t=new ey);for(let e=0;e<r;e++){let r=s[e],i=ee.decode(r.charAt(0)).substr(0,Y.segmentType),n=z.ID_TO_KEY[es.decode(i,Y.segmentType).toString()];eh.decode(r,t,n)}return t}}class eE extends H{respond(){let e,t=x.tcModel,s=t.vendorListVersion;void 0===this.param&&(this.param=s),(e=this.param===s&&t.gvl?t.gvl:new ev(this.param)).readyPromise.then(()=>{this.invokeCallback(e.getJson())})}}class eS extends j{respond(){this.listenerId=x.eventQueue.add({callback:this.callback,param:this.param,next:this.next}),super.respond()}}class eI extends H{respond(){this.invokeCallback(x.eventQueue.remove(this.param))}}class eb{static [u.PING]=G;static [u.GET_TC_DATA]=j;static [u.GET_IN_APP_TC_DATA]=q;static [u.GET_VENDOR_LIST]=eE;static [u.ADD_EVENT_LISTENER]=eS;static [u.REMOVE_EVENT_LISTENER]=eI}class eL{static set_=new Set([0,2,void 0,null]);static has(e){return"string"==typeof e&&(e=Number(e)),this.set_.has(e)}}let eA="__tcfapi";class ew{callQueue;customCommands;constructor(e){if(e){let t=u.ADD_EVENT_LISTENER;if(e?.[t])throw Error(`Built-In Custom Commmand for ${t} not allowed: Use ${u.GET_TC_DATA} instead`);if(t=u.REMOVE_EVENT_LISTENER,e?.[t])throw Error(`Built-In Custom Commmand for ${t} not allowed`);e?.[u.GET_TC_DATA]&&(e[u.ADD_EVENT_LISTENER]=e[u.GET_TC_DATA],e[u.REMOVE_EVENT_LISTENER]=e[u.GET_TC_DATA]),this.customCommands=e}try{this.callQueue=window[eA]()||[]}catch(e){this.callQueue=[]}finally{window[eA]=this.apiCall.bind(this),this.purgeQueuedCalls()}}apiCall(e,t,s,...r){if("string"!=typeof e&&"function"==typeof s)s(null,!1);else if(eL.has(t))if("function"!=typeof s)throw Error("invalid callback function");else x.disabled?s(new F,!1):this.isCustomCommand(e)||this.isBuiltInCommand(e)?this.isCustomCommand(e)&&!this.isBuiltInCommand(e)?this.customCommands[e](s,...r):e===u.PING?this.isCustomCommand(e)?new eb[e](this.customCommands[e],r[0],null,s):new eb[e](s,r[0]):void 0===x.tcModel?this.callQueue.push([e,t,s,...r]):this.isCustomCommand(e)&&this.isBuiltInCommand(e)?new eb[e](this.customCommands[e],r[0],null,s):new eb[e](s,r[0]):s(null,!1);else s(null,!1)}purgeQueuedCalls(){let e=this.callQueue;this.callQueue=[],e.forEach(e=>{window[eA](...e)})}isCustomCommand(e){return this.customCommands&&"function"==typeof this.customCommands[e]}isBuiltInCommand(e){return void 0!==eb[e]}}class eT{callResponder;isServiceSpecific;numUpdates=0;constructor(e,t,s=!0,r){this.throwIfInvalidInt(e,"cmpId",2),this.throwIfInvalidInt(t,"cmpVersion",0),x.cmpId=e,x.cmpVersion=t,x.tcfPolicyVersion=5,this.isServiceSpecific=!!s,this.callResponder=new ew(r)}throwIfInvalidInt(e,t,s){if(!("number"==typeof e&&Number.isInteger(e)&&e>=s))throw Error(`Invalid ${t}: ${e}`)}update(e,t=!1){if(x.disabled)throw Error("CmpApi Disabled");x.cmpStatus=d.LOADED,t?(x.displayStatus=h.VISIBLE,x.eventStatus=p.CMP_UI_SHOWN):void 0===x.tcModel?(x.displayStatus=h.DISABLED,x.eventStatus=p.TC_LOADED):(x.displayStatus=h.HIDDEN,x.eventStatus=p.USER_ACTION_COMPLETE),x.gdprApplies=null!==e,x.gdprApplies?(""===e?(x.tcModel=new ey,x.tcModel.cmpId=x.cmpId,x.tcModel.cmpVersion=x.cmpVersion):x.tcModel=eC.decode(e),x.tcModel.isServiceSpecific=this.isServiceSpecific,x.tcfPolicyVersion=Number(x.tcModel.policyVersion),x.tcString=e):x.tcModel=null,0===this.numUpdates?this.callResponder.purgeQueuedCalls():x.eventQueue.exec(),this.numUpdates++}disable(){x.disabled=!0,x.cmpStatus=d.ERROR}}var e_=e.i(259608);let eO=null;var eV=e.i(851192),eP=e.i(90137),eD=e.i(382697),eR=e.i(233706);e.s(["default",0,function(){let{isSubmitting:e,onAgree:t,onDisagree:s,showAdConsentModal:r,vendorCount:i}=function(){let{country:e,error:t}=(0,eV.default)(),s=(0,V.useLocale)(),r=(0,R.useTcfString)(),i=(0,R.useTcfConsentDenied)(),[n,o]=(0,E.useState)(!1),a=e?.isPrivacyRestricted??!1,l=(0,w.default)({allowAnonymousUserCreation:a&&!r}),c=(0,eP.default)({auth:l}),{data:u,error:d}=(0,eD.default)(a&&!r?"https://plex.tv/api/v2/ads/vendors":null,{auth:l,config:{keepPreviousData:!0,revalidateIfStale:!1,revalidateOnFocus:!1,revalidateOnReconnect:!1,shouldRetryOnError:!1}});(0,E.useEffect)(()=>{(t||d)&&(0,R.denyTcfConsent)()},[t,d]);let h=a&&!r&&!i&&!!u,p=(0,E.useCallback)(async e=>{if(!u||!c)return void(0,R.denyTcfConsent)();o(!0);try{await (0,eR.default)(D,{...c,method:"PUT",body:{language:s.slice(0,2),vendors:u.vendors.map(t=>({consent:e,id:t.id}))}});let t=await (0,eR.default)(D,c),r={gvlSpecificationVersion:t.gvlSpecificationVersion,language:t.language,updatedAt:t.updatedAt??Math.floor(Date.now()/P.SECOND_IN_MILLISECONDS),vendorListVersion:t.vendorListVersion,vendors:u.vendors.map(({id:t,regions:s,tcfId:r})=>({consent:e,id:t,regions:s,tcfId:r}))},{tcfString:i}=await (0,eR.default)("https://vod.provider.plex.tv/ad/generate-consent",{method:"POST",body:r});(0,R.updateTcfConsent)(i,t.remindAt)}catch{(0,R.denyTcfConsent)()}finally{o(!1)}},[c,s,u]),g=(0,E.useCallback)(async()=>{await p(!0)},[p]),f=(0,E.useCallback)(async()=>{await p(!1)},[p]);return(0,E.useEffect)(()=>(eO=new eT(311,1,!0),()=>{eO&&(eO.disable(),eO=null),x.reset(),delete window.__tcfapi}
1),[]),(0,E.useEffect)(()=>{var t;e&&(t=e.isPrivacyRestricted?r??"":null,eO?function(e,t,s){try{e.update(t,s)}catch(e){(0,e_.default)("TCF").error("Failed to update CMP:",String(e))}}(eO,t,h):(0,e_.default)("TCF").error("updateTcfApi called before installTcfApi"))},[e,h,r]),{isSubmitting:n,onAgree:g,onDisagree:f,showAdConsentModal:h,vendorCount:u?.vendors.length??0}}();return(0,y.jsx)(O,{isOpen:r,isSubmitting:e,vendorCount:i,onAgree:t,onDisagree:s})}],569568)},752925,e=>{"use strict";e.i(39693);var t=e.i(161605),s=e.i(630242),r=e.i(208058),i=e.i(471677),n=e.i(352968);let o="session_metrics";function a(){return Math.round(Date.now()/r.SECOND_IN_MILLISECONDS)}var l=e.i(581424),c=e.i(787737),u=e.i(52798),d=e.i(125920);e.s(["default",0,function({children:e,sessionID:r,anonymousSessionID:h}){let p=(0,u.default)(),g=(0,d.default)(),{data:f}=(0,c.default)("https://plex.tv/api/v2/user/privacy");return(0,s.useEffect)(()=>{(0,l.syncWithSession)(r,h,p,g,f)},[h,p,f,r,g]),(0,s.useEffect)(()=>{if(!r)return;let e=n.safeLocalStorage.getItem(o);if(e?.sessionID===r)e.shutdownTimestamp&&(e={...e,shutdownTimestamp:void 0},n.safeLocalStorage.setItem(o,e));else{if(e){let t=e.shutdownTimestamp??a();(0,i.default)({event:"client:shutdown",interaction:!1,sessionIdentifier:e.sessionID,timestamp:t,properties:{sessionLength:t-e.startTimestamp}})}(0,i.default)({event:"client:start",sessionIdentifier:r}),e={sessionID:r,startTimestamp:a()},n.safeLocalStorage.setItem(o,e)}let t=()=>{n.safeLocalStorage.setItem(o,{...e,shutdownTimestamp:a()})};return window.addEventListener("beforeunload",t),()=>{window.removeEventListener("beforeunload",t)}},[r]),(0,t.jsx)(t.Fragment,{children:e})}],752925)},502207,e=>{"use strict";var t=e.i(161605),s=e.i(630242),r=e.i(831877);let i=(0,s.createContext)(void 0),n=(0,s.createContext)(void 0);e.s(["CommissionJunctionContext",0,i,"IterableAttributionContext",0,n,"default",0,function({children:e,commissionJunction:s,iterable:o}){let a=(0,r.default)(s),l=(0,r.default)(o);return(0,t.jsx)(i.Provider,{value:a,children:(0,t.jsx)(n.Provider,{value:l,children:e})})}])}]);

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.