@vouchfor/embeds-legacy 4.0.3 → 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es/embeds-legacy.js +8 -8
- package/dist/iife/dialog-embed/embed.iife.js +3 -3
- package/dist/iife/dialog-embed/embed.iife.js.map +1 -1
- package/dist/iife/embeds-legacy.iife.js +3 -3
- package/dist/iife/embeds-legacy.iife.js.map +1 -1
- package/dist/iife/player-embed/embed.iife.js +3 -3
- package/dist/iife/player-embed/embed.iife.js.map +1 -1
- package/package.json +8 -8
|
@@ -149,7 +149,7 @@ ${e}`,vg=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),Bg=Objec
|
|
|
149
149
|
"playlist": {{ it._derived?.playlist }},
|
|
150
150
|
"preview": {{ it._derived?.preview }},
|
|
151
151
|
"captions": {{ it._derived?.captions }}
|
|
152
|
-
}`}],root:"{{ it.outro?.questions?.items }}"}],system:!0}],meta:{frameRate:30,resolution:1080,transitionDuration:1/3},options:{videoFormat:"letterbox-video"},default:0,system:!0};async function Vg(){return new Image}const vl=Yt(async function(e,t=Vg){return e?new Promise((i,r)=>{t().then(n=>{n.onload=()=>{i(n)},n.onerror=o=>{r(o)},n.src=e})}):null});async function bo({element:s,meta:e,imageFactory:t},i,r){var n,o,a;let A={...s};const{node:l}=s;if((l==null?void 0:l.type)==="video"&&((n=l==null?void 0:l.value)!=null&&n.src||(o=l==null?void 0:l.value)!=null&&o.playlist)){const c=await i(l.value,e);let h;try{h=await vl(l.value.poster,t)}catch{h=null}A={...A,node:{...l,video:c,poster:h,meta:await r(l.value,c.node,e)}}}if((l==null?void 0:l.type)==="image"&&l.value){let c;try{c=await vl(l.value,t)}catch{c=null}A={...A,node:{...l,image:c}}}return A.node&&((a=s.node)!=null&&a.elements)&&(A.node.elements=await Promise.all(s.node.elements.map(c=>bo({element:c,meta:e,imageFactory:t},i,r)))),s.elements&&(A.elements=await Promise.all(s.elements.map(c=>bo({element:c,meta:e,imageFactory:t},i,r)))),A}async function Jg(){return document.createElement("canvas")}function Xs(s=[]){var e;for(const t of s){if(((e=t==null?void 0:t.node)==null?void 0:e.type)==="video")return t.node;const i=Xs(t==null?void 0:t.elements);if(i)return i}}function Wg(s,e){return s.reduce((t,i,r)=>[...t,i.map((n,o)=>n.map(({duration:a},A)=>r===s.length-1&&o===i.length-1&&A===n.length-1?a:a-e))],[])}function qg(s){if(s===null||typeof s!="object")return!1;if(Object.getPrototypeOf(s)===null)return!0;let e=s;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(s)===e}function jg(s){return s.replace(/\\/g,"\\\\").replace(/\//g,"\\/").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t").replace(/\f/g,"\\f").replace(/"/g,'\\"')}function jr(s){return s.flatMap(e=>Array.isArray(e)?e.flatMap(t=>t):e).reduce((e,t)=>e+t,0)}const Xg=Yt(()=>rl.loadYoga());fo.filters.define("parse",s=>typeof s>"u"?null:typeof s=="string"?`"${jg(s)}"`:qg(s)||Array.isArray(s)?JSON.stringify(s):s);const As=(s,e,t)=>fo.render(s,e,fo.getConfig({autoEscape:!1,defaultFilter:"parse",...t}));async function ls({data:s,template:e,burnCaptions:t=!1,debug:i=!1,imageFactory:r,canvasFactory:n=Jg},o,a,A){var l,c,h,u;const d=await Xg(),g=e??Kg;if(!((l=g.templates)!=null&&l.length))throw new Error(`No templates found for template instance: ${g.id}`);let f=g.templates.find(({version:q})=>q===So);if(!f){const q=g.templates.map(({version:Y})=>`"${Y}"`).join(", ");console.warn(`Template renderer expects template version "${So}" but got ${q}`),f=g.templates[g.templates.length-1]}const p=await Promise.all(f.content.map(async({scenes:q,root:Y})=>{const z={...g.options,...s,intro:g.intro,outro:g.outro};async function S(T,U){return Promise.all(q.map(async({layout:b,duration:R,data:x,derived:V,options:O})=>{var j,se,ce;const Ae={...z,_index:U,_root:T,_derived:await o({data:s,rootData:T,index:U})},ye=x?JSON.parse(await As(x,Ae)):{},Ee=V?JSON.parse(await As(V,Ae)):{},Re=O?JSON.parse(await As(O,Ae)):{},ne=R?parseFloat(await As(R,Ae)):NaN,ue=(j=f.layouts.find(Be=>Be.name===b))==null?void 0:j.tree;if(!ue)throw new Error(`Layout tree "${b}" not found in template "${f.id}" layouts.`);const Se=JSON.parse(await As(ue,{...ye,...Ee,...Re})),Ce=await Promise.all(Se.flatMap(Be=>bo({element:Be,meta:g.meta,imageFactory:r},a,A))),he=Xs(Ce);return{duration:(isNaN(ne)?null:ne)??((se=he==null?void 0:he.meta)==null?void 0:se.duration)??0,captions:(ce=he==null?void 0:he.meta)==null?void 0:ce.captions,elements:Ce}}))}if(Y){const T=JSON.parse(await As(Y,z));return Array.isArray(T)?Promise.all(T.map(async(U,b)=>S(U,b))):Promise.all([S(T,null)])}return Promise.all([S(s,null)])}));if(p.every(q=>q.every(Y=>Y.every(z=>{const S=Xs(z.elements);return!(S!=null&&S.value.src)&&!(S!=null&&S.value.playlist)})))){const q=p.flatMap(Y=>Y.flatMap(z=>z.map(S=>{const T=Xs(S.elements);return!(T!=null&&T.value.src)&&!(T!=null&&T.value.playlist)&&(T==null?void 0:T.value.id)}).filter(Boolean))).join(", ");throw new Error(`Video(s) with ID ${q} failed to load, video can not be processed`)}if(p.every(q=>q.every(Y=>Y.every(z=>z.duration<=0))))throw new Error("No scenes have any duration, video can not be processed");const Q=p.reduce((q,Y)=>{const z=Y.reduce((S,T)=>{const U=T.filter(b=>b.duration>0);return U.length>0?[...S,U]:S},[]);return z.length>0?[...q,z]:q},[]),C=((c=g.meta)==null?void 0:c.frameRate)??30,w=((h=g.meta)==null?void 0:h.resolution)??1080,B=((u=g.meta)==null?void 0:u.transitionDuration)??1/3,L=Wg(Q,B),_=jr(L),$=await Promise.all(Q.map((q,Y)=>{const z=jr(L[Y]),S=jr(L.slice(0,Y));return Promise.all(q.map((T,U)=>Promise.all(T.map(async({duration:b,captions:R,elements:x},V)=>{var O,j;const se=await n(),ce=await n(),Ae=await n(),ye=await n(),Ee=Xs(x),Re=jr([...L.slice(0,Y),...L[Y].slice(0,U),...L[Y][U].slice(0,V)]);return{draw:async({canvas:ue,currentTime:Se})=>{const Ce=Math.max(0,Se-S),he=Math.max(0,Se-Re);await Qo({yoga:d,debug:i,canvas:ue,cropCanvas:se,posterCanvas:ye,letterboxCanvas:ce,elements:x,currentTime:Se,contentTime:Ce,sceneTime:he,totalDuration:_,contentDuration:z,sceneDuration:b}),R&&t&&Ug({canvas:ue,dx:0,dy:0,dw:ue.width,dh:ue.height,vttCaptions:R,sceneTime:he+((Ee==null?void 0:Ee.meta.start)??0)})},duration:b,transitionCanvas:Ae,id:Yg(),start:Re,video:Ee==null?void 0:Ee.video,videoMeta:Ee==null?void 0:Ee.meta,audio:{duration:b,src:(O=Ee==null?void 0:Ee.value)==null?void 0:O.src,start:(j=Ee==null?void 0:Ee.meta)==null?void 0:j.start}}}))))})),F=$.flatMap(q=>q);return{scenes:F.flatMap(q=>q),sections:F,contents:$,frameRate:C,resolution:w,transitionDuration:B,fonts:f.fonts??[],duration:_}}const So="3",zg={name:"@vouchfor/embeds-legacy",version:"4.0.3",license:"MIT",author:"Aaron Williams",main:"dist/es/embeds-legacy.js",module:"dist/es/embeds-legacy.js",type:"module",types:"dist/es/src/index.d.ts",exports:{".":"./dist/es/embeds-legacy.js"},files:["dist","src"],publishConfig:{tag:"latest",access:"public"},engines:{node:">=18.18.0"},scripts:{build:"rm -rf dist && tsc && yarn build:self","build:deps":"yarn --cwd ../media-player-legacy build","build:self":"vite build --mode iife && vite build --mode es && node scripts/build.cjs","build:package":"yarn build","build:storybook":"yarn prebuild && storybook build","generate:manifest":"wca src --outFile custom-elements.json",lint:"eslint . --quiet","lint:fix":"eslint . --fix","lint:staged":"lint-staged",prepublishOnly:"yarn build",size:"size-limit",storybook:"yarn prebuild && storybook dev -p 6007",prebuild:"yarn build:deps && yarn generate:manifest",test:"rm -rf test/lib && yarn prebuild && vite build --mode test && web-test-runner","test:ci":"yarn test --config web-test-runner.ci.config.js","test:watch":"yarn test --watch"},"lint-staged":{"**/*.{ts,tsx,js}":"eslint --fix --quiet","**/*.{md,json,yml}":"prettier --write"},dependencies:{"@a11y/focus-trap":"^1.0.5","@lit/task":"^1.0.0","@vouchfor/canvas-video-legacy":"^9.0.0","@vouchfor/media-player-legacy":"^5.0.3",uuid:"^9.0.1"},peerDependencies:{lit:"^3.1.2"},devDependencies:{"@esm-bundle/chai":"^4.3.4-fix.0","@open-wc/testing":"^4.0.0","@storybook/addon-essentials":"^8.0.4","@storybook/addon-links":"^8.0.4","@storybook/blocks":"^8.0.4","@storybook/web-components":"^8.0.4","@storybook/web-components-vite":"^8.0.4","@svgr/core":"^8.1.0","@types/flat":"^5.0.5","@types/mocha":"^10.0.6","@vouchfor/eslint-config":"^1.0.1","@vouchfor/prettier-config":"^1.0.1","@vouchfor/video-utils-legacy":"^2.0.3","@web/dev-server-esbuild":"^1.0.2","@web/test-runner":"^0.18.1","@web/test-runner-browserstack":"^0.7.1","@web/test-runner-mocha":"^0.9.0","@web/test-runner-playwright":"^0.11.0",glob:"^10.3.10","lint-staged":"^15.2.2",lit:"^3.1.2",lodash:"^4.17.21",react:"^18.2.0","react-dom":"^18.2.0","rollup-plugin-tla":"^0.0.2",sinon:"^17.0.1",storybook:"^8.0.4",svgson:"^5.3.1",typescript:"^5.4.3",vite:"^5.2.2","vite-plugin-commonjs":"^0.10.1","vite-plugin-dts":"^3.7.3","web-component-analyzer":"^2.0.0"}};function Zg(s){const{publicApiUrl:e}=xr(s),t=Ti();return navigator.sendBeacon(`${e}/api/visitor`,JSON.stringify({visitorId:t})),t}function ef(s){var n,o,a,A,l,c,h,u,d,g,f,p;if(typeof window>"u")return{client:null,tab:null,request:Ti()};let e=(o=(n=window.localStorage)==null?void 0:n.getItem)==null?void 0:o.call(n,"vouch-uid-visitor"),t=(A=(a=window.localStorage)==null?void 0:a.getItem)==null?void 0:A.call(a,"vouch-uid-client"),i=(c=(l=window.sessionStorage)==null?void 0:l.getItem)==null?void 0:c.call(l,"vouch-uid-tab");const r=Ti();return e||(e=Zg(s),(u=(h=window.localStorage)==null?void 0:h.setItem)==null||u.call(h,"vouch-uid-visitor",e)),t||(t=Ti(),(g=(d=window.localStorage)==null?void 0:d.setItem)==null||g.call(d,"vouch-uid-client",t)),i||(i=Ti(),(p=(f=window.sessionStorage)==null?void 0:f.setItem)==null||p.call(f,"vouch-uid-tab",i)),{client:t,tab:i,request:r,visitor:e}}function tf(s,e){return s&&"vouchId"in s?s.vouchId:(e==null?void 0:e.id)??null}function sf(s="embedded_player"){var r,n;const[e,t]=((n=(r=Intl.DateTimeFormat().resolvedOptions().timeZone)==null?void 0:r.split)==null?void 0:n.call(r,"/"))??[],i={};return[...new URLSearchParams(location.search).entries()].forEach(([o,a])=>{if(/utm/.test(o)){const A=o.toLowerCase().replace(/[-_][a-z0-9]/g,l=>l.slice(-1).toUpperCase());i[A]=a}}),{source:s,time:new Date,region:t,country:e,screenHeight:window.screen.height,screenWidth:window.screen.width,referrer:document.referrer,currentUrl:location.href,embedType:"media-player-embed",embedVersion:zg.version,templateVersion:So,...i}}const Bl=1;class rf{constructor(e){this._batchedEvents=[],this._hasPlayed=!1,this._hasLoaded={},this._answersViewed={},this._streamStartTime={},this._streamLatestTime={},this._currentlyPlayingVideo=null,this._createTrackingEvent=(t,i)=>{const r=tf(i,this.host.vouch);!r||this.host.disableTracking||this._batchedEvents.push({event:t,payload:{...i,vouchId:r,time:new Date().toISOString()}})},this._sendTrackingEvent=()=>{if(this._batchedEvents.length<=0)return;const{publicApiUrl:t}=xr(this.host.env),{client:i,tab:r,request:n,visitor:o}=ef(this.host.env);navigator.sendBeacon(`${t}/api/batchevents`,JSON.stringify({payload:{events:this._batchedEvents},context:{"x-uid-client":i,"x-uid-tab":r,"x-uid-request":n,"x-uid-visitor":o,"x-reporting-metadata":sf(this.host.trackingSource)}})),this._batchedEvents=[]},this._streamEnded=()=>{if(this._currentlyPlayingVideo){const{id:t,key:i}=this._currentlyPlayingVideo;this._streamLatestTime[i]>this._streamStartTime[i]+Bl&&this._createTrackingEvent("VIDEO_STREAMED",{answerId:t,streamStart:this._streamStartTime[i],streamEnd:this._streamLatestTime[i]}),delete this._streamStartTime[i],delete this._streamLatestTime[i]}},this._handleVouchLoaded=({detail:t})=>{t&&(this._hasLoaded[t]||(this._createTrackingEvent("VOUCH_LOADED",{vouchId:t}),this._hasLoaded[t]=!0))},this._handlePlay=()=>{this._hasPlayed||(this._createTrackingEvent("VIDEO_PLAYED",{streamStart:this.host.currentTime}),this._hasPlayed=!0)},this._handleVideoPlay=({detail:{id:t,key:i}})=>{this._answersViewed[i]||(this._createTrackingEvent("VOUCH_RESPONSE_VIEWED",{answerId:t}),this._answersViewed[i]=!0)},this._handleVideoTimeUpdate=({detail:{id:t,key:i,node:r}})=>{var n,o;!this.host.paused&&t===((o=(n=this.host.scene)==null?void 0:n.video)==null?void 0:o.id)&&(this._currentlyPlayingVideo={id:t,key:i,node:r},this._streamLatestTime[i]=r.currentTime,this._streamStartTime[i]||(this._streamStartTime[i]=r.currentTime,this._streamLatestTime[i]=r.currentTime))},this._handleVideoPause=({detail:{id:t,key:i}})=>{this._streamLatestTime[i]>this._streamStartTime[i]+Bl&&this._createTrackingEvent("VIDEO_STREAMED",{answerId:t,streamStart:this._streamStartTime[i],streamEnd:this._streamLatestTime[i]}),delete this._streamStartTime[i],delete this._streamLatestTime[i]},this._pageUnloading=()=>{this._streamEnded(),this._sendTrackingEvent()},this._handleVisibilityChange=()=>{document.visibilityState==="hidden"&&this._pageUnloading()},this._handlePageHide=()=>{this._pageUnloading()},this.host=e,e.addController(this)}hostConnected(){requestAnimationFrame(()=>{var e,t,i,r;"onvisibilitychange"in document?document.addEventListener("visibilitychange",this._handleVisibilityChange):window.addEventListener("pagehide",this._handlePageHide),this.host.addEventListener("vouch:loaded",this._handleVouchLoaded),(e=this.host.mediaPlayer)==null||e.addEventListener("play",this._handlePlay),(t=this.host.mediaPlayer)==null||t.addEventListener("video:play",this._handleVideoPlay),(i=this.host.mediaPlayer)==null||i.addEventListener("video:pause",this._handleVideoPause),(r=this.host.mediaPlayer)==null||r.addEventListener("video:timeupdate",this._handleVideoTimeUpdate)})}hostDisconnected(){var e,t,i,r;this._pageUnloading(),"onvisibilitychange"in document?document.removeEventListener("visibilitychange",this._handleVisibilityChange):window.removeEventListener("pagehide",this._handlePageHide),this.host.removeEventListener("vouch:loaded",this._handleVouchLoaded),(e=this.host.mediaPlayer)==null||e.removeEventListener("play",this._handlePlay),(t=this.host.mediaPlayer)==null||t.removeEventListener("video:play",this._handleVideoPlay),(i=this.host.mediaPlayer)==null||i.removeEventListener("video:pause",this._handleVideoPause),(r=this.host.mediaPlayer)==null||r.removeEventListener("video:timeupdate",this._handleVideoTimeUpdate)}}var wo={exports:{}};(function(s,e){var t=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof uo<"u"&&uo,i=function(){function n(){this.fetch=!1,this.DOMException=t.DOMException}return n.prototype=t,new n}();(function(n){(function(o){var a=typeof n<"u"&&n||typeof self<"u"&&self||typeof a<"u"&&a,A={searchParams:"URLSearchParams"in a,iterable:"Symbol"in a&&"iterator"in Symbol,blob:"FileReader"in a&&"Blob"in a&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in a,arrayBuffer:"ArrayBuffer"in a};function l(S){return S&&DataView.prototype.isPrototypeOf(S)}if(A.arrayBuffer)var c=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],h=ArrayBuffer.isView||function(S){return S&&c.indexOf(Object.prototype.toString.call(S))>-1};function u(S){if(typeof S!="string"&&(S=String(S)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(S)||S==="")throw new TypeError('Invalid character in header field name: "'+S+'"');return S.toLowerCase()}function d(S){return typeof S!="string"&&(S=String(S)),S}function g(S){var T={next:function(){var U=S.shift();return{done:U===void 0,value:U}}};return A.iterable&&(T[Symbol.iterator]=function(){return T}),T}function f(S){this.map={},S instanceof f?S.forEach(function(T,U){this.append(U,T)},this):Array.isArray(S)?S.forEach(function(T){this.append(T[0],T[1])},this):S&&Object.getOwnPropertyNames(S).forEach(function(T){this.append(T,S[T])},this)}f.prototype.append=function(S,T){S=u(S),T=d(T);var U=this.map[S];this.map[S]=U?U+", "+T:T},f.prototype.delete=function(S){delete this.map[u(S)]},f.prototype.get=function(S){return S=u(S),this.has(S)?this.map[S]:null},f.prototype.has=function(S){return this.map.hasOwnProperty(u(S))},f.prototype.set=function(S,T){this.map[u(S)]=d(T)},f.prototype.forEach=function(S,T){for(var U in this.map)this.map.hasOwnProperty(U)&&S.call(T,this.map[U],U,this)},f.prototype.keys=function(){var S=[];return this.forEach(function(T,U){S.push(U)}),g(S)},f.prototype.values=function(){var S=[];return this.forEach(function(T){S.push(T)}),g(S)},f.prototype.entries=function(){var S=[];return this.forEach(function(T,U){S.push([U,T])}),g(S)},A.iterable&&(f.prototype[Symbol.iterator]=f.prototype.entries);function p(S){if(S.bodyUsed)return Promise.reject(new TypeError("Already read"));S.bodyUsed=!0}function y(S){return new Promise(function(T,U){S.onload=function(){T(S.result)},S.onerror=function(){U(S.error)}})}function v(S){var T=new FileReader,U=y(T);return T.readAsArrayBuffer(S),U}function Q(S){var T=new FileReader,U=y(T);return T.readAsText(S),U}function C(S){for(var T=new Uint8Array(S),U=new Array(T.length),b=0;b<T.length;b++)U[b]=String.fromCharCode(T[b]);return U.join("")}function w(S){if(S.slice)return S.slice(0);var T=new Uint8Array(S.byteLength);return T.set(new Uint8Array(S)),T.buffer}function B(){return this.bodyUsed=!1,this._initBody=function(S){this.bodyUsed=this.bodyUsed,this._bodyInit=S,S?typeof S=="string"?this._bodyText=S:A.blob&&Blob.prototype.isPrototypeOf(S)?this._bodyBlob=S:A.formData&&FormData.prototype.isPrototypeOf(S)?this._bodyFormData=S:A.searchParams&&URLSearchParams.prototype.isPrototypeOf(S)?this._bodyText=S.toString():A.arrayBuffer&&A.blob&&l(S)?(this._bodyArrayBuffer=w(S.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):A.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(S)||h(S))?this._bodyArrayBuffer=w(S):this._bodyText=S=Object.prototype.toString.call(S):this._bodyText="",this.headers.get("content-type")||(typeof S=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):A.searchParams&&URLSearchParams.prototype.isPrototypeOf(S)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},A.blob&&(this.blob=function(){var S=p(this);if(S)return S;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){if(this._bodyArrayBuffer){var S=p(this);return S||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}else return this.blob().then(v)}),this.text=function(){var S=p(this);if(S)return S;if(this._bodyBlob)return Q(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(C(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},A.formData&&(this.formData=function(){return this.text().then(F)}),this.json=function(){return this.text().then(JSON.parse)},this}var L=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function _(S){var T=S.toUpperCase();return L.indexOf(T)>-1?T:S}function $(S,T){if(!(this instanceof $))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');T=T||{};var U=T.body;if(S instanceof $){if(S.bodyUsed)throw new TypeError("Already read");this.url=S.url,this.credentials=S.credentials,T.headers||(this.headers=new f(S.headers)),this.method=S.method,this.mode=S.mode,this.signal=S.signal,!U&&S._bodyInit!=null&&(U=S._bodyInit,S.bodyUsed=!0)}else this.url=String(S);if(this.credentials=T.credentials||this.credentials||"same-origin",(T.headers||!this.headers)&&(this.headers=new f(T.headers)),this.method=_(T.method||this.method||"GET"),this.mode=T.mode||this.mode||null,this.signal=T.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&U)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(U),(this.method==="GET"||this.method==="HEAD")&&(T.cache==="no-store"||T.cache==="no-cache")){var b=/([?&])_=[^&]*/;if(b.test(this.url))this.url=this.url.replace(b,"$1_="+new Date().getTime());else{var R=/\?/;this.url+=(R.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}$.prototype.clone=function(){return new $(this,{body:this._bodyInit})};function F(S){var T=new FormData;return S.trim().split("&").forEach(function(U){if(U){var b=U.split("="),R=b.shift().replace(/\+/g," "),x=b.join("=").replace(/\+/g," ");T.append(decodeURIComponent(R),decodeURIComponent(x))}}),T}function H(S){var T=new f,U=S.replace(/\r?\n[\t ]+/g," ");return U.split("\r").map(function(b){return b.indexOf(`
|
|
152
|
+
}`}],root:"{{ it.outro?.questions?.items }}"}],system:!0}],meta:{frameRate:30,resolution:1080,transitionDuration:1/3},options:{videoFormat:"letterbox-video"},default:0,system:!0};async function Vg(){const s=new Image;return s.crossOrigin="anonymous",s}const vl=Yt(async function(e,t=Vg){return e?new Promise((i,r)=>{t().then(n=>{n.onload=()=>{i(n)},n.onerror=o=>{r(o)},n.src=e})}):null});async function bo({element:s,meta:e,imageFactory:t},i,r){var n,o,a;let A={...s};const{node:l}=s;if((l==null?void 0:l.type)==="video"&&((n=l==null?void 0:l.value)!=null&&n.src||(o=l==null?void 0:l.value)!=null&&o.playlist)){const c=await i(l.value,e);let h;try{h=await vl(l.value.poster,t)}catch{h=null}A={...A,node:{...l,video:c,poster:h,meta:await r(l.value,c.node,e)}}}if((l==null?void 0:l.type)==="image"&&l.value){let c;try{c=await vl(l.value,t)}catch{c=null}A={...A,node:{...l,image:c}}}return A.node&&((a=s.node)!=null&&a.elements)&&(A.node.elements=await Promise.all(s.node.elements.map(c=>bo({element:c,meta:e,imageFactory:t},i,r)))),s.elements&&(A.elements=await Promise.all(s.elements.map(c=>bo({element:c,meta:e,imageFactory:t},i,r)))),A}async function Jg(){return document.createElement("canvas")}function Xs(s=[]){var e;for(const t of s){if(((e=t==null?void 0:t.node)==null?void 0:e.type)==="video")return t.node;const i=Xs(t==null?void 0:t.elements);if(i)return i}}function Wg(s,e){return s.reduce((t,i,r)=>[...t,i.map((n,o)=>n.map(({duration:a},A)=>r===s.length-1&&o===i.length-1&&A===n.length-1?a:a-e))],[])}function qg(s){if(s===null||typeof s!="object")return!1;if(Object.getPrototypeOf(s)===null)return!0;let e=s;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(s)===e}function jg(s){return s.replace(/\\/g,"\\\\").replace(/\//g,"\\/").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t").replace(/\f/g,"\\f").replace(/"/g,'\\"')}function jr(s){return s.flatMap(e=>Array.isArray(e)?e.flatMap(t=>t):e).reduce((e,t)=>e+t,0)}const Xg=Yt(()=>rl.loadYoga());fo.filters.define("parse",s=>typeof s>"u"?null:typeof s=="string"?`"${jg(s)}"`:qg(s)||Array.isArray(s)?JSON.stringify(s):s);const As=(s,e,t)=>fo.render(s,e,fo.getConfig({autoEscape:!1,defaultFilter:"parse",...t}));async function ls({data:s,template:e,burnCaptions:t=!1,debug:i=!1,imageFactory:r,canvasFactory:n=Jg},o,a,A){var l,c,h,u;const d=await Xg(),g=e??Kg;if(!((l=g.templates)!=null&&l.length))throw new Error(`No templates found for template instance: ${g.id}`);let f=g.templates.find(({version:q})=>q===So);if(!f){const q=g.templates.map(({version:Y})=>`"${Y}"`).join(", ");console.warn(`Template renderer expects template version "${So}" but got ${q}`),f=g.templates[g.templates.length-1]}const p=await Promise.all(f.content.map(async({scenes:q,root:Y})=>{const z={...g.options,...s,intro:g.intro,outro:g.outro};async function S(T,U){return Promise.all(q.map(async({layout:b,duration:R,data:x,derived:V,options:O})=>{var j,se,ce;const Ae={...z,_index:U,_root:T,_derived:await o({data:s,rootData:T,index:U})},ye=x?JSON.parse(await As(x,Ae)):{},Ee=V?JSON.parse(await As(V,Ae)):{},Re=O?JSON.parse(await As(O,Ae)):{},ne=R?parseFloat(await As(R,Ae)):NaN,ue=(j=f.layouts.find(Be=>Be.name===b))==null?void 0:j.tree;if(!ue)throw new Error(`Layout tree "${b}" not found in template "${f.id}" layouts.`);const Se=JSON.parse(await As(ue,{...ye,...Ee,...Re})),Ce=await Promise.all(Se.flatMap(Be=>bo({element:Be,meta:g.meta,imageFactory:r},a,A))),he=Xs(Ce);return{duration:(isNaN(ne)?null:ne)??((se=he==null?void 0:he.meta)==null?void 0:se.duration)??0,captions:(ce=he==null?void 0:he.meta)==null?void 0:ce.captions,elements:Ce}}))}if(Y){const T=JSON.parse(await As(Y,z));return Array.isArray(T)?Promise.all(T.map(async(U,b)=>S(U,b))):Promise.all([S(T,null)])}return Promise.all([S(s,null)])}));if(p.every(q=>q.every(Y=>Y.every(z=>{const S=Xs(z.elements);return!(S!=null&&S.value.src)&&!(S!=null&&S.value.playlist)})))){const q=p.flatMap(Y=>Y.flatMap(z=>z.map(S=>{const T=Xs(S.elements);return!(T!=null&&T.value.src)&&!(T!=null&&T.value.playlist)&&(T==null?void 0:T.value.id)}).filter(Boolean))).join(", ");throw new Error(`Video(s) with ID ${q} failed to load, video can not be processed`)}if(p.every(q=>q.every(Y=>Y.every(z=>z.duration<=0))))throw new Error("No scenes have any duration, video can not be processed");const Q=p.reduce((q,Y)=>{const z=Y.reduce((S,T)=>{const U=T.filter(b=>b.duration>0);return U.length>0?[...S,U]:S},[]);return z.length>0?[...q,z]:q},[]),C=((c=g.meta)==null?void 0:c.frameRate)??30,w=((h=g.meta)==null?void 0:h.resolution)??1080,B=((u=g.meta)==null?void 0:u.transitionDuration)??1/3,L=Wg(Q,B),_=jr(L),$=await Promise.all(Q.map((q,Y)=>{const z=jr(L[Y]),S=jr(L.slice(0,Y));return Promise.all(q.map((T,U)=>Promise.all(T.map(async({duration:b,captions:R,elements:x},V)=>{var O,j;const se=await n(),ce=await n(),Ae=await n(),ye=await n(),Ee=Xs(x),Re=jr([...L.slice(0,Y),...L[Y].slice(0,U),...L[Y][U].slice(0,V)]);return{draw:async({canvas:ue,currentTime:Se})=>{const Ce=Math.max(0,Se-S),he=Math.max(0,Se-Re);await Qo({yoga:d,debug:i,canvas:ue,cropCanvas:se,posterCanvas:ye,letterboxCanvas:ce,elements:x,currentTime:Se,contentTime:Ce,sceneTime:he,totalDuration:_,contentDuration:z,sceneDuration:b}),R&&t&&Ug({canvas:ue,dx:0,dy:0,dw:ue.width,dh:ue.height,vttCaptions:R,sceneTime:he+((Ee==null?void 0:Ee.meta.start)??0)})},duration:b,transitionCanvas:Ae,id:Yg(),start:Re,video:Ee==null?void 0:Ee.video,videoMeta:Ee==null?void 0:Ee.meta,audio:{duration:b,src:(O=Ee==null?void 0:Ee.value)==null?void 0:O.src,start:(j=Ee==null?void 0:Ee.meta)==null?void 0:j.start}}}))))})),F=$.flatMap(q=>q);return{scenes:F.flatMap(q=>q),sections:F,contents:$,frameRate:C,resolution:w,transitionDuration:B,fonts:f.fonts??[],duration:_}}const So="3",zg={name:"@vouchfor/embeds-legacy",version:"4.1.0",license:"MIT",author:"Aaron Williams",main:"dist/es/embeds-legacy.js",module:"dist/es/embeds-legacy.js",type:"module",types:"dist/es/src/index.d.ts",exports:{".":"./dist/es/embeds-legacy.js"},files:["dist","src"],publishConfig:{tag:"latest",access:"public"},engines:{node:">=18.18.0"},scripts:{build:"rm -rf dist && tsc && yarn build:self","build:deps":"yarn --cwd ../media-player-legacy build","build:self":"vite build --mode iife && vite build --mode es && node scripts/build.cjs","build:package":"yarn build","build:storybook":"yarn prebuild && storybook build","generate:manifest":"wca src --outFile custom-elements.json",lint:"eslint . --quiet","lint:fix":"eslint . --fix","lint:staged":"lint-staged",prepublishOnly:"yarn build",size:"size-limit",storybook:"yarn prebuild && storybook dev -p 6007",prebuild:"yarn build:deps && yarn generate:manifest",test:"rm -rf test/lib && yarn prebuild && vite build --mode test && web-test-runner","test:ci":"yarn test --config web-test-runner.ci.config.js","test:watch":"yarn test --watch"},"lint-staged":{"**/*.{ts,tsx,js}":"eslint --fix --quiet","**/*.{md,json,yml}":"prettier --write"},dependencies:{"@a11y/focus-trap":"^1.0.5","@lit/task":"^1.0.0","@vouchfor/canvas-video-legacy":"^9.0.0","@vouchfor/media-player-legacy":"^5.1.0",uuid:"^9.0.1"},peerDependencies:{lit:"^3.1.2"},devDependencies:{"@esm-bundle/chai":"^4.3.4-fix.0","@open-wc/testing":"^4.0.0","@storybook/addon-essentials":"^8.5.8","@storybook/addon-links":"^8.5.8","@storybook/blocks":"^8.5.8","@storybook/web-components":"^8.5.8","@storybook/web-components-vite":"^8.5.8","@svgr/core":"^8.1.0","@types/flat":"^5.0.5","@types/mocha":"^10.0.6","@vouchfor/eslint-config":"^1.0.1","@vouchfor/prettier-config":"^1.0.1","@vouchfor/video-utils-legacy":"^2.0.3","@web/dev-server-esbuild":"^1.0.2","@web/test-runner":"^0.18.1","@web/test-runner-browserstack":"^0.7.1","@web/test-runner-mocha":"^0.9.0","@web/test-runner-playwright":"^0.11.0",glob:"^10.3.10","lint-staged":"^15.2.2",lit:"^3.1.2",lodash:"^4.17.21",react:"^18.2.0","react-dom":"^18.2.0","rollup-plugin-tla":"^0.0.2",sinon:"^17.0.1",storybook:"^8.5.8",svgson:"^5.3.1",typescript:"^5.4.3",vite:"^5.2.2","vite-plugin-commonjs":"^0.10.1","vite-plugin-dts":"^3.7.3","web-component-analyzer":"^2.0.0"}};function Zg(s){const{publicApiUrl:e}=xr(s),t=Ti();return navigator.sendBeacon(`${e}/api/visitor`,JSON.stringify({visitorId:t})),t}function ef(s){var n,o,a,A,l,c,h,u,d,g,f,p;if(typeof window>"u")return{client:null,tab:null,request:Ti()};let e=(o=(n=window.localStorage)==null?void 0:n.getItem)==null?void 0:o.call(n,"vouch-uid-visitor"),t=(A=(a=window.localStorage)==null?void 0:a.getItem)==null?void 0:A.call(a,"vouch-uid-client"),i=(c=(l=window.sessionStorage)==null?void 0:l.getItem)==null?void 0:c.call(l,"vouch-uid-tab");const r=Ti();return e||(e=Zg(s),(u=(h=window.localStorage)==null?void 0:h.setItem)==null||u.call(h,"vouch-uid-visitor",e)),t||(t=Ti(),(g=(d=window.localStorage)==null?void 0:d.setItem)==null||g.call(d,"vouch-uid-client",t)),i||(i=Ti(),(p=(f=window.sessionStorage)==null?void 0:f.setItem)==null||p.call(f,"vouch-uid-tab",i)),{client:t,tab:i,request:r,visitor:e}}function tf(s,e){return s&&"vouchId"in s?s.vouchId:(e==null?void 0:e.id)??null}function sf(s="embedded_player"){var r,n;const[e,t]=((n=(r=Intl.DateTimeFormat().resolvedOptions().timeZone)==null?void 0:r.split)==null?void 0:n.call(r,"/"))??[],i={};return[...new URLSearchParams(location.search).entries()].forEach(([o,a])=>{if(/utm/.test(o)){const A=o.toLowerCase().replace(/[-_][a-z0-9]/g,l=>l.slice(-1).toUpperCase());i[A]=a}}),{source:s,time:new Date,region:t,country:e,screenHeight:window.screen.height,screenWidth:window.screen.width,referrer:document.referrer,currentUrl:location.href,embedType:"media-player-embed",embedVersion:zg.version,templateVersion:So,...i}}const Bl=1;class rf{constructor(e){this._batchedEvents=[],this._hasPlayed=!1,this._hasLoaded={},this._answersViewed={},this._streamStartTime={},this._streamLatestTime={},this._currentlyPlayingVideo=null,this._createTrackingEvent=(t,i)=>{const r=tf(i,this.host.vouch);!r||this.host.disableTracking||this._batchedEvents.push({event:t,payload:{...i,vouchId:r,time:new Date().toISOString()}})},this._sendTrackingEvent=()=>{if(this._batchedEvents.length<=0)return;const{publicApiUrl:t}=xr(this.host.env),{client:i,tab:r,request:n,visitor:o}=ef(this.host.env);navigator.sendBeacon(`${t}/api/batchevents`,JSON.stringify({payload:{events:this._batchedEvents},context:{"x-uid-client":i,"x-uid-tab":r,"x-uid-request":n,"x-uid-visitor":o,"x-reporting-metadata":sf(this.host.trackingSource)}})),this._batchedEvents=[]},this._streamEnded=()=>{if(this._currentlyPlayingVideo){const{id:t,key:i}=this._currentlyPlayingVideo;this._streamLatestTime[i]>this._streamStartTime[i]+Bl&&this._createTrackingEvent("VIDEO_STREAMED",{answerId:t,streamStart:this._streamStartTime[i],streamEnd:this._streamLatestTime[i]}),delete this._streamStartTime[i],delete this._streamLatestTime[i]}},this._handleVouchLoaded=({detail:t})=>{t&&(this._hasLoaded[t]||(this._createTrackingEvent("VOUCH_LOADED",{vouchId:t}),this._hasLoaded[t]=!0))},this._handlePlay=()=>{this._hasPlayed||(this._createTrackingEvent("VIDEO_PLAYED",{streamStart:this.host.currentTime}),this._hasPlayed=!0)},this._handleVideoPlay=({detail:{id:t,key:i}})=>{this._answersViewed[i]||(this._createTrackingEvent("VOUCH_RESPONSE_VIEWED",{answerId:t}),this._answersViewed[i]=!0)},this._handleVideoTimeUpdate=({detail:{id:t,key:i,node:r}})=>{var n,o;!this.host.paused&&t===((o=(n=this.host.scene)==null?void 0:n.video)==null?void 0:o.id)&&(this._currentlyPlayingVideo={id:t,key:i,node:r},this._streamLatestTime[i]=r.currentTime,this._streamStartTime[i]||(this._streamStartTime[i]=r.currentTime,this._streamLatestTime[i]=r.currentTime))},this._handleVideoPause=({detail:{id:t,key:i}})=>{this._streamLatestTime[i]>this._streamStartTime[i]+Bl&&this._createTrackingEvent("VIDEO_STREAMED",{answerId:t,streamStart:this._streamStartTime[i],streamEnd:this._streamLatestTime[i]}),delete this._streamStartTime[i],delete this._streamLatestTime[i]},this._pageUnloading=()=>{this._streamEnded(),this._sendTrackingEvent()},this._handleVisibilityChange=()=>{document.visibilityState==="hidden"&&this._pageUnloading()},this._handlePageHide=()=>{this._pageUnloading()},this.host=e,e.addController(this)}hostConnected(){requestAnimationFrame(()=>{var e,t,i,r;"onvisibilitychange"in document?document.addEventListener("visibilitychange",this._handleVisibilityChange):window.addEventListener("pagehide",this._handlePageHide),this.host.addEventListener("vouch:loaded",this._handleVouchLoaded),(e=this.host.mediaPlayer)==null||e.addEventListener("play",this._handlePlay),(t=this.host.mediaPlayer)==null||t.addEventListener("video:play",this._handleVideoPlay),(i=this.host.mediaPlayer)==null||i.addEventListener("video:pause",this._handleVideoPause),(r=this.host.mediaPlayer)==null||r.addEventListener("video:timeupdate",this._handleVideoTimeUpdate)})}hostDisconnected(){var e,t,i,r;this._pageUnloading(),"onvisibilitychange"in document?document.removeEventListener("visibilitychange",this._handleVisibilityChange):window.removeEventListener("pagehide",this._handlePageHide),this.host.removeEventListener("vouch:loaded",this._handleVouchLoaded),(e=this.host.mediaPlayer)==null||e.removeEventListener("play",this._handlePlay),(t=this.host.mediaPlayer)==null||t.removeEventListener("video:play",this._handleVideoPlay),(i=this.host.mediaPlayer)==null||i.removeEventListener("video:pause",this._handleVideoPause),(r=this.host.mediaPlayer)==null||r.removeEventListener("video:timeupdate",this._handleVideoTimeUpdate)}}var wo={exports:{}};(function(s,e){var t=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof uo<"u"&&uo,i=function(){function n(){this.fetch=!1,this.DOMException=t.DOMException}return n.prototype=t,new n}();(function(n){(function(o){var a=typeof n<"u"&&n||typeof self<"u"&&self||typeof a<"u"&&a,A={searchParams:"URLSearchParams"in a,iterable:"Symbol"in a&&"iterator"in Symbol,blob:"FileReader"in a&&"Blob"in a&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in a,arrayBuffer:"ArrayBuffer"in a};function l(S){return S&&DataView.prototype.isPrototypeOf(S)}if(A.arrayBuffer)var c=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],h=ArrayBuffer.isView||function(S){return S&&c.indexOf(Object.prototype.toString.call(S))>-1};function u(S){if(typeof S!="string"&&(S=String(S)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(S)||S==="")throw new TypeError('Invalid character in header field name: "'+S+'"');return S.toLowerCase()}function d(S){return typeof S!="string"&&(S=String(S)),S}function g(S){var T={next:function(){var U=S.shift();return{done:U===void 0,value:U}}};return A.iterable&&(T[Symbol.iterator]=function(){return T}),T}function f(S){this.map={},S instanceof f?S.forEach(function(T,U){this.append(U,T)},this):Array.isArray(S)?S.forEach(function(T){this.append(T[0],T[1])},this):S&&Object.getOwnPropertyNames(S).forEach(function(T){this.append(T,S[T])},this)}f.prototype.append=function(S,T){S=u(S),T=d(T);var U=this.map[S];this.map[S]=U?U+", "+T:T},f.prototype.delete=function(S){delete this.map[u(S)]},f.prototype.get=function(S){return S=u(S),this.has(S)?this.map[S]:null},f.prototype.has=function(S){return this.map.hasOwnProperty(u(S))},f.prototype.set=function(S,T){this.map[u(S)]=d(T)},f.prototype.forEach=function(S,T){for(var U in this.map)this.map.hasOwnProperty(U)&&S.call(T,this.map[U],U,this)},f.prototype.keys=function(){var S=[];return this.forEach(function(T,U){S.push(U)}),g(S)},f.prototype.values=function(){var S=[];return this.forEach(function(T){S.push(T)}),g(S)},f.prototype.entries=function(){var S=[];return this.forEach(function(T,U){S.push([U,T])}),g(S)},A.iterable&&(f.prototype[Symbol.iterator]=f.prototype.entries);function p(S){if(S.bodyUsed)return Promise.reject(new TypeError("Already read"));S.bodyUsed=!0}function y(S){return new Promise(function(T,U){S.onload=function(){T(S.result)},S.onerror=function(){U(S.error)}})}function v(S){var T=new FileReader,U=y(T);return T.readAsArrayBuffer(S),U}function Q(S){var T=new FileReader,U=y(T);return T.readAsText(S),U}function C(S){for(var T=new Uint8Array(S),U=new Array(T.length),b=0;b<T.length;b++)U[b]=String.fromCharCode(T[b]);return U.join("")}function w(S){if(S.slice)return S.slice(0);var T=new Uint8Array(S.byteLength);return T.set(new Uint8Array(S)),T.buffer}function B(){return this.bodyUsed=!1,this._initBody=function(S){this.bodyUsed=this.bodyUsed,this._bodyInit=S,S?typeof S=="string"?this._bodyText=S:A.blob&&Blob.prototype.isPrototypeOf(S)?this._bodyBlob=S:A.formData&&FormData.prototype.isPrototypeOf(S)?this._bodyFormData=S:A.searchParams&&URLSearchParams.prototype.isPrototypeOf(S)?this._bodyText=S.toString():A.arrayBuffer&&A.blob&&l(S)?(this._bodyArrayBuffer=w(S.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):A.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(S)||h(S))?this._bodyArrayBuffer=w(S):this._bodyText=S=Object.prototype.toString.call(S):this._bodyText="",this.headers.get("content-type")||(typeof S=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):A.searchParams&&URLSearchParams.prototype.isPrototypeOf(S)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},A.blob&&(this.blob=function(){var S=p(this);if(S)return S;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){if(this._bodyArrayBuffer){var S=p(this);return S||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}else return this.blob().then(v)}),this.text=function(){var S=p(this);if(S)return S;if(this._bodyBlob)return Q(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(C(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},A.formData&&(this.formData=function(){return this.text().then(F)}),this.json=function(){return this.text().then(JSON.parse)},this}var L=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function _(S){var T=S.toUpperCase();return L.indexOf(T)>-1?T:S}function $(S,T){if(!(this instanceof $))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');T=T||{};var U=T.body;if(S instanceof $){if(S.bodyUsed)throw new TypeError("Already read");this.url=S.url,this.credentials=S.credentials,T.headers||(this.headers=new f(S.headers)),this.method=S.method,this.mode=S.mode,this.signal=S.signal,!U&&S._bodyInit!=null&&(U=S._bodyInit,S.bodyUsed=!0)}else this.url=String(S);if(this.credentials=T.credentials||this.credentials||"same-origin",(T.headers||!this.headers)&&(this.headers=new f(T.headers)),this.method=_(T.method||this.method||"GET"),this.mode=T.mode||this.mode||null,this.signal=T.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&U)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(U),(this.method==="GET"||this.method==="HEAD")&&(T.cache==="no-store"||T.cache==="no-cache")){var b=/([?&])_=[^&]*/;if(b.test(this.url))this.url=this.url.replace(b,"$1_="+new Date().getTime());else{var R=/\?/;this.url+=(R.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}$.prototype.clone=function(){return new $(this,{body:this._bodyInit})};function F(S){var T=new FormData;return S.trim().split("&").forEach(function(U){if(U){var b=U.split("="),R=b.shift().replace(/\+/g," "),x=b.join("=").replace(/\+/g," ");T.append(decodeURIComponent(R),decodeURIComponent(x))}}),T}function H(S){var T=new f,U=S.replace(/\r?\n[\t ]+/g," ");return U.split("\r").map(function(b){return b.indexOf(`
|
|
153
153
|
`)===0?b.substr(1,b.length):b}).forEach(function(b){var R=b.split(":"),x=R.shift().trim();if(x){var V=R.join(":").trim();T.append(x,V)}}),T}B.call($.prototype);function q(S,T){if(!(this instanceof q))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');T||(T={}),this.type="default",this.status=T.status===void 0?200:T.status,this.ok=this.status>=200&&this.status<300,this.statusText=T.statusText===void 0?"":""+T.statusText,this.headers=new f(T.headers),this.url=T.url||"",this._initBody(S)}B.call(q.prototype),q.prototype.clone=function(){return new q(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new f(this.headers),url:this.url})},q.error=function(){var S=new q(null,{status:0,statusText:""});return S.type="error",S};var Y=[301,302,303,307,308];q.redirect=function(S,T){if(Y.indexOf(T)===-1)throw new RangeError("Invalid status code");return new q(null,{status:T,headers:{location:S}})},o.DOMException=a.DOMException;try{new o.DOMException}catch{o.DOMException=function(T,U){this.message=T,this.name=U;var b=Error(T);this.stack=b.stack},o.DOMException.prototype=Object.create(Error.prototype),o.DOMException.prototype.constructor=o.DOMException}function z(S,T){return new Promise(function(U,b){var R=new $(S,T);if(R.signal&&R.signal.aborted)return b(new o.DOMException("Aborted","AbortError"));var x=new XMLHttpRequest;function V(){x.abort()}x.onload=function(){var j={status:x.status,statusText:x.statusText,headers:H(x.getAllResponseHeaders()||"")};j.url="responseURL"in x?x.responseURL:j.headers.get("X-Request-URL");var se="response"in x?x.response:x.responseText;setTimeout(function(){U(new q(se,j))},0)},x.onerror=function(){setTimeout(function(){b(new TypeError("Network request failed"))},0)},x.ontimeout=function(){setTimeout(function(){b(new TypeError("Network request failed"))},0)},x.onabort=function(){setTimeout(function(){b(new o.DOMException("Aborted","AbortError"))},0)};function O(j){try{return j===""&&a.location.href?a.location.href:j}catch{return j}}x.open(R.method,O(R.url),!0),R.credentials==="include"?x.withCredentials=!0:R.credentials==="omit"&&(x.withCredentials=!1),"responseType"in x&&(A.blob?x.responseType="blob":A.arrayBuffer&&R.headers.get("Content-Type")&&R.headers.get("Content-Type").indexOf("application/octet-stream")!==-1&&(x.responseType="arraybuffer")),T&&typeof T.headers=="object"&&!(T.headers instanceof f)?Object.getOwnPropertyNames(T.headers).forEach(function(j){x.setRequestHeader(j,d(T.headers[j]))}):R.headers.forEach(function(j,se){x.setRequestHeader(se,j)}),R.signal&&(R.signal.addEventListener("abort",V),x.onreadystatechange=function(){x.readyState===4&&R.signal.removeEventListener("abort",V)}),x.send(typeof R._bodyInit>"u"?null:R._bodyInit)})}return z.polyfill=!0,a.fetch||(a.fetch=z,a.Headers=f,a.Request=$,a.Response=q),o.Headers=f,o.Request=$,o.Response=q,o.fetch=z,o})({})})(i),i.fetch.ponyfill=!0,delete i.fetch.polyfill;var r=t.fetch?t:i;e=r.fetch,e.default=r.fetch,e.fetch=r.fetch,e.Headers=r.Headers,e.Request=r.Request,e.Response=r.Response,s.exports=e})(wo,wo.exports);var nf=wo.exports;const Ql=Eg(nf);async function of(s){var e;try{if((e=await Ql(s,{method:"HEAD"}))!=null&&e.ok)return s}catch{return}}async function Ro({sources:s}){let e=null;const t=s==null?void 0:s.filter(Boolean),i=t==null?void 0:t.find(n=>n.startsWith("blob:")),r=t==null?void 0:t.find(n=>!n.startsWith("http")&&!n.startsWith("blob:"));if(i||r)return i??r;if(t.length>0){const n=t.map(o=>of(o));e=(await Promise.all(n)).find(Boolean)}return e}async function af(s){try{return(await Ql(s)).text()}catch{return null}}async function Af(s){return s=s.trim(),s.startsWith("http")||s.startsWith("blob:")?af(s):s}const lf=Yt(async({original:s,translation:e,originalLanguage:t="",translationLanguage:i=""},{language:r})=>{var n,o;const a={[(n=i==null?void 0:i.split("-"))==null?void 0:n[0]]:e,[(o=t==null?void 0:t.split("-"))==null?void 0:o[0]]:s},A=(r&&a[r])??s;return A?Af(A):null},{cacheKey:([s,{language:e}])=>JSON.stringify({...s,language:e})}),cf=Yt(async s=>{var e,t,i,r,n,o,a,A,l,c,h;const[u,d,g]=await Promise.all([Ro({sources:[(t=(e=s==null?void 0:s.answer)==null?void 0:e.media)==null?void 0:t.video,(r=(i=s==null?void 0:s.answer)==null?void 0:i.media)==null?void 0:r.input]}),Ro({sources:[(o=(n=s==null?void 0:s.answer)==null?void 0:n.media)==null?void 0:o.playlist]}),Ro({sources:[((A=(a=s==null?void 0:s.answer)==null?void 0:a.media)==null?void 0:A.reducedQuality)??((h=(c=(l=s==null?void 0:s.answer)==null?void 0:l.media)==null?void 0:c.videos)==null?void 0:h.xs)]})]);return{src:u,playlist:d,preview:g}},{cacheKey:([s])=>{var e,t,i,r,n,o,a,A,l,c,h;return JSON.stringify({video:(t=(e=s==null?void 0:s.answer)==null?void 0:e.media)==null?void 0:t.video,input:(r=(i=s==null?void 0:s.answer)==null?void 0:i.media)==null?void 0:r.input,playlist:(o=(n=s==null?void 0:s.answer)==null?void 0:n.media)==null?void 0:o.playlist,preview:((A=(a=s==null?void 0:s.answer)==null?void 0:a.media)==null?void 0:A.reducedQuality)??((h=(c=(l=s==null?void 0:s.answer)==null?void 0:l.media)==null?void 0:c.videos)==null?void 0:h.xs)})}});function bl(s){var e,t,i,r,n,o,a,A,l,c,h,u;const d=((t=(e=s==null?void 0:s.answer)==null?void 0:e.contact)==null?void 0:t.name)==="Anonymous"?"":((n=(r=(i=s==null?void 0:s.answer)==null?void 0:i.contact)==null?void 0:r.name)==null?void 0:n.trim())??"",g=((A=(a=(o=s==null?void 0:s.answer)==null?void 0:o.contact)==null?void 0:a.client)==null?void 0:A.name)==="Not Supplied"?"":((u=(h=(c=(l=s==null?void 0:s.answer)==null?void 0:l.contact)==null?void 0:c.client)==null?void 0:h.name)==null?void 0:u.trim())??"",[f,p]=d.split(" ");return{name:d,firstName:f,lastName:p,companyName:g}}const hf=Yt(async(s,e,t)=>{var i,r,n;const o=(i=e==null?void 0:e.answer)==null?void 0:i.id;return((n=(r=s==null?void 0:s.questions)==null?void 0:r.items)==null?void 0:n.reduce((A,l)=>{var c;return((c=l==null?void 0:l.answer)==null?void 0:c.id)===o?(A??0)+1:A},0))<=1?o:`${o}-${t}`},{cacheKey:([s,e,t])=>{var i;return JSON.stringify({index:t,rootData:e,allQuestions:(i=s==null?void 0:s.questions)==null?void 0:i.items})}});async function To({data:s,rootData:e,index:t},i){var r,n,o,a,A,l,c,h,u,d,g,f,p,y,v,Q,C,w,B,L,_,$,F;const[H,q,Y]=await Promise.all([hf(s,e,t),cf(e),lf({original:((n=(r=e==null?void 0:e.answer)==null?void 0:r.media)==null?void 0:n.captions)??((a=(o=e==null?void 0:e.answer)==null?void 0:o.captions)==null?void 0:a.current),translation:((l=(A=e==null?void 0:e.answer)==null?void 0:A.media)==null?void 0:l.translation)??((h=(c=e==null?void 0:e.answer)==null?void 0:c.captions)==null?void 0:h.translation),originalLanguage:(d=(u=e==null?void 0:e.answer)==null?void 0:u.transcription)==null?void 0:d.language,translationLanguage:(p=(f=(g=e==null?void 0:e.answer)==null?void 0:g.transcription)==null?void 0:f.translation)==null?void 0:p.language},i)]),z=bl(e);return{...q,...z,key:H,captions:Y,answerLabel:((y=e==null?void 0:e.answer)==null?void 0:y.label)??(e==null?void 0:e.title),prevAnswerLabel:t?((w=(C=(Q=(v=s==null?void 0:s.questions)==null?void 0:v.items)==null?void 0:Q[t-1])==null?void 0:C.answer)==null?void 0:w.label)??((_=(L=(B=s==null?void 0:s.questions)==null?void 0:B.items)==null?void 0:L[t-1])==null?void 0:_.title)??null:null,isFirstInstanceOfName:t?((F=($=s==null?void 0:s.questions)==null?void 0:$.items)==null?void 0:F.findIndex(S=>bl(S).name===z.name))===t:!0}}const Xr={af:"Afrikaans",sq:"Albanian",am:"Amharic",ar:"Arabic",hy:"Armenian",az:"Azerbaijani",eu:"Basque",be:"Belarusian",bn:"Bengali",bs:"Bosnian",bg:"Bulgarian",ca:"Catalan",zh:"Chinese (Simplified)",zh_TW:"Chinese (Traditional)",hr:"Croatian",cs:"Czech",da:"Danish",nl:"Dutch",en:"English",et:"Estonian",fi:"Finnish",fr:"French",fa:"Farsi",tl:"Filipino",ka:"Georgian",de:"German",el:"Greek",gu:"Gujarati",ht:"Haitian Creole",ha:"Hausa",he:"Hebrew",hi:"Hindi",hu:"Hungarian",is:"Icelandic",id:"Indonesian",ga:"Irish",it:"Italian",ja:"Japanese",kn:"Kannada",kk:"Kazakh",ko:"Korean",lv:"Latvian",lt:"Lithuanian",mk:"Macedonian",ms:"Malay",ml:"Malayalam",mt:"Maltese",mr:"Marathi",mn:"Mongolian",no:"Norwegian",ps:"Pashto",pl:"Polish",pt:"Portuguese",pa:"Punjabi",ro:"Romanian",ru:"Russian",sr:"Serbian",si:"Sinhala",sk:"Slovak",sl:"Slovenian",so:"Somali",es:"Spanish",sw:"Swahili",sv:"Swedish",ta:"Tamil",te:"Telugu",th:"Thai",tr:"Turkish",uk:"Ukrainian",ur:"Urdu",uz:"Uzbek",vi:"Vietnamese",cy:"Welsh"};function uf({data:s}){var e,t;return((t=(e=s==null?void 0:s.questions)==null?void 0:e.items)==null?void 0:t.reduce((i,r)=>{var n,o,a,A,l,c,h;const u=(a=(o=(n=r==null?void 0:r.answer)==null?void 0:n.transcription)==null?void 0:o.language)==null?void 0:a.split("-")[0],d=(h=(c=(l=(A=r==null?void 0:r.answer)==null?void 0:A.transcription)==null?void 0:l.translation)==null?void 0:c.language)==null?void 0:h.split("-")[0];return u&&Xr[u]&&!i.find(g=>g.value===u)&&i.push({value:u,label:Xr[u]}),d&&Xr[d]&&!i.find(g=>g.value===d)&&i.push({value:d,label:Xr[d]}),i},[]))??[]}/**
|
|
154
154
|
* @license
|
|
155
155
|
* Copyright 2018 Google LLC
|
|
@@ -187,7 +187,7 @@ ${e}`,vg=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),Bg=Objec
|
|
|
187
187
|
* @license
|
|
188
188
|
* Copyright 2017 Google LLC
|
|
189
189
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
190
|
-
*/const Oh=(s,e,t)=>{const i=new Map;for(let r=e;r<=t;r++)i.set(s[r],r);return i},Uh=as(class extends Hs{constructor(s){if(super(s),s.type!==os.CHILD)throw Error("repeat() can only be used in text expressions")}dt(s,e,t){let i;t===void 0?t=e:e!==void 0&&(i=e);const r=[],n=[];let o=0;for(const a of s)r[o]=i?i(a,o):o,n[o]=t(a,o),o++;return{values:n,keys:r}}render(s,e,t){return this.dt(s,e,t).values}update(s,[e,t,i]){const r=od(s),{values:n,keys:o}=this.dt(e,t,i);if(!Array.isArray(r))return this.ut=o,n;const a=this.ut??(this.ut=[]),A=[];let l,c,h=0,u=r.length-1,d=0,g=n.length-1;for(;h<=u&&d<=g;)if(r[h]===null)h++;else if(r[u]===null)u--;else if(a[h]===o[d])A[d]=Hi(r[h],n[d]),h++,d++;else if(a[u]===o[g])A[g]=Hi(r[u],n[g]),u--,g--;else if(a[h]===o[g])A[g]=Hi(r[h],n[g]),Gs(s,A[g+1],r[h]),h++,g--;else if(a[u]===o[d])A[d]=Hi(r[u],n[d]),Gs(s,r[h],r[u]),u--,d++;else if(l===void 0&&(l=Oh(o,d,g),c=Oh(a,h,u)),l.has(a[h]))if(l.has(a[u])){const f=c.get(o[d]),p=f!==void 0?r[f]:null;if(p===null){const y=Gs(s,r[h]);Hi(y,n[d]),A[d]=y}else A[d]=Hi(p,n[d]),Gs(s,r[h],p),r[f]=null;d++}else eo(r[u]),u--;else eo(r[h]),h++;for(;d<=g;){const f=Gs(s,A[g+1]);Hi(f,n[d]),A[d++]=f}for(;h<=u;){const f=r[h++];f!==null&&eo(f)}return this.ut=o,nd(s,A),$t}});var Tt="top",Pt="bottom",Ot="right",xt="left",xa="auto",nr=[Tt,Pt,Ot,xt],vs="start",or="end",GI="clippingParents",Gh="viewport",ar="popper",HI="reference",Hh=nr.reduce(function(s,e){return s.concat([e+"-"+vs,e+"-"+or])},[]),$h=[].concat(nr,[xa]).reduce(function(s,e){return s.concat([e,e+"-"+vs,e+"-"+or])},[]),$I="beforeRead",YI="read",KI="afterRead",VI="beforeMain",JI="main",WI="afterMain",qI="beforeWrite",jI="write",XI="afterWrite",zI=[$I,YI,KI,VI,JI,WI,qI,jI,XI];function oi(s){return s?(s.nodeName||"").toLowerCase():null}function Lt(s){if(s==null)return window;if(s.toString()!=="[object Window]"){var e=s.ownerDocument;return e&&e.defaultView||window}return s}function Xi(s){var e=Lt(s).Element;return s instanceof e||s instanceof Element}function Ut(s){var e=Lt(s).HTMLElement;return s instanceof e||s instanceof HTMLElement}function Da(s){if(typeof ShadowRoot>"u")return!1;var e=Lt(s).ShadowRoot;return s instanceof e||s instanceof ShadowRoot}function ZI(s){var e=s.state;Object.keys(e.elements).forEach(function(t){var i=e.styles[t]||{},r=e.attributes[t]||{},n=e.elements[t];!Ut(n)||!oi(n)||(Object.assign(n.style,i),Object.keys(r).forEach(function(o){var a=r[o];a===!1?n.removeAttribute(o):n.setAttribute(o,a===!0?"":a)}))})}function em(s){var e=s.state,t={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,t.popper),e.styles=t,e.elements.arrow&&Object.assign(e.elements.arrow.style,t.arrow),function(){Object.keys(e.elements).forEach(function(i){var r=e.elements[i],n=e.attributes[i]||{},o=Object.keys(e.styles.hasOwnProperty(i)?e.styles[i]:t[i]),a=o.reduce(function(A,l){return A[l]="",A},{});!Ut(r)||!oi(r)||(Object.assign(r.style,a),Object.keys(n).forEach(function(A){r.removeAttribute(A)}))})}}const Yh={name:"applyStyles",enabled:!0,phase:"write",fn:ZI,effect:em,requires:["computeStyles"]};function ai(s){return s.split("-")[0]}var zi=Math.max,Dn=Math.min,Bs=Math.round;function La(){var s=navigator.userAgentData;return s!=null&&s.brands&&Array.isArray(s.brands)?s.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function Kh(){return!/^((?!chrome|android).)*safari/i.test(La())}function Qs(s,e,t){e===void 0&&(e=!1),t===void 0&&(t=!1);var i=s.getBoundingClientRect(),r=1,n=1;e&&Ut(s)&&(r=s.offsetWidth>0&&Bs(i.width)/s.offsetWidth||1,n=s.offsetHeight>0&&Bs(i.height)/s.offsetHeight||1);var o=Xi(s)?Lt(s):window,a=o.visualViewport,A=!Kh()&&t,l=(i.left+(A&&a?a.offsetLeft:0))/r,c=(i.top+(A&&a?a.offsetTop:0))/n,h=i.width/r,u=i.height/n;return{width:h,height:u,top:c,right:l+h,bottom:c+u,left:l,x:l,y:c}}function _a(s){var e=Qs(s),t=s.offsetWidth,i=s.offsetHeight;return Math.abs(e.width-t)<=1&&(t=e.width),Math.abs(e.height-i)<=1&&(i=e.height),{x:s.offsetLeft,y:s.offsetTop,width:t,height:i}}function Vh(s,e){var t=e.getRootNode&&e.getRootNode();if(s.contains(e))return!0;if(t&&Da(t)){var i=e;do{if(i&&s.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function Bi(s){return Lt(s).getComputedStyle(s)}function tm(s){return["table","td","th"].indexOf(oi(s))>=0}function ki(s){return((Xi(s)?s.ownerDocument:s.document)||window.document).documentElement}function Ln(s){return oi(s)==="html"?s:s.assignedSlot||s.parentNode||(Da(s)?s.host:null)||ki(s)}function Jh(s){return!Ut(s)||Bi(s).position==="fixed"?null:s.offsetParent}function im(s){var e=/firefox/i.test(La()),t=/Trident/i.test(La());if(t&&Ut(s)){var i=Bi(s);if(i.position==="fixed")return null}var r=Ln(s);for(Da(r)&&(r=r.host);Ut(r)&&["html","body"].indexOf(oi(r))<0;){var n=Bi(r);if(n.transform!=="none"||n.perspective!=="none"||n.contain==="paint"||["transform","perspective"].indexOf(n.willChange)!==-1||e&&n.willChange==="filter"||e&&n.filter&&n.filter!=="none")return r;r=r.parentNode}return null}function Ar(s){for(var e=Lt(s),t=Jh(s);t&&tm(t)&&Bi(t).position==="static";)t=Jh(t);return t&&(oi(t)==="html"||oi(t)==="body"&&Bi(t).position==="static")?e:t||im(s)||e}function ka(s){return["top","bottom"].indexOf(s)>=0?"x":"y"}function lr(s,e,t){return zi(s,Dn(e,t))}function sm(s,e,t){var i=lr(s,e,t);return i>t?t:i}function Wh(){return{top:0,right:0,bottom:0,left:0}}function qh(s){return Object.assign({},Wh(),s)}function jh(s,e){return e.reduce(function(t,i){return t[i]=s,t},{})}var rm=function(e,t){return e=typeof e=="function"?e(Object.assign({},t.rects,{placement:t.placement})):e,qh(typeof e!="number"?e:jh(e,nr))};function nm(s){var e,t=s.state,i=s.name,r=s.options,n=t.elements.arrow,o=t.modifiersData.popperOffsets,a=ai(t.placement),A=ka(a),l=[xt,Ot].indexOf(a)>=0,c=l?"height":"width";if(!(!n||!o)){var h=rm(r.padding,t),u=_a(n),d=A==="y"?Tt:xt,g=A==="y"?Pt:Ot,f=t.rects.reference[c]+t.rects.reference[A]-o[A]-t.rects.popper[c],p=o[A]-t.rects.reference[A],y=Ar(n),v=y?A==="y"?y.clientHeight||0:y.clientWidth||0:0,Q=f/2-p/2,C=h[d],w=v-u[c]-h[g],B=v/2-u[c]/2+Q,L=lr(C,B,w),_=A;t.modifiersData[i]=(e={},e[_]=L,e.centerOffset=L-B,e)}}function om(s){var e=s.state,t=s.options,i=t.element,r=i===void 0?"[data-popper-arrow]":i;r!=null&&(typeof r=="string"&&(r=e.elements.popper.querySelector(r),!r)||Vh(e.elements.popper,r)&&(e.elements.arrow=r))}const am={name:"arrow",enabled:!0,phase:"main",fn:nm,effect:om,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function bs(s){return s.split("-")[1]}var Am={top:"auto",right:"auto",bottom:"auto",left:"auto"};function lm(s,e){var t=s.x,i=s.y,r=e.devicePixelRatio||1;return{x:Bs(t*r)/r||0,y:Bs(i*r)/r||0}}function Xh(s){var e,t=s.popper,i=s.popperRect,r=s.placement,n=s.variation,o=s.offsets,a=s.position,A=s.gpuAcceleration,l=s.adaptive,c=s.roundOffsets,h=s.isFixed,u=o.x,d=u===void 0?0:u,g=o.y,f=g===void 0?0:g,p=typeof c=="function"?c({x:d,y:f}):{x:d,y:f};d=p.x,f=p.y;var y=o.hasOwnProperty("x"),v=o.hasOwnProperty("y"),Q=xt,C=Tt,w=window;if(l){var B=Ar(t),L="clientHeight",_="clientWidth";if(B===Lt(t)&&(B=ki(t),Bi(B).position!=="static"&&a==="absolute"&&(L="scrollHeight",_="scrollWidth")),B=B,r===Tt||(r===xt||r===Ot)&&n===or){C=Pt;var $=h&&B===w&&w.visualViewport?w.visualViewport.height:B[L];f-=$-i.height,f*=A?1:-1}if(r===xt||(r===Tt||r===Pt)&&n===or){Q=Ot;var F=h&&B===w&&w.visualViewport?w.visualViewport.width:B[_];d-=F-i.width,d*=A?1:-1}}var H=Object.assign({position:a},l&&Am),q=c===!0?lm({x:d,y:f},Lt(t)):{x:d,y:f};if(d=q.x,f=q.y,A){var Y;return Object.assign({},H,(Y={},Y[C]=v?"0":"",Y[Q]=y?"0":"",Y.transform=(w.devicePixelRatio||1)<=1?"translate("+d+"px, "+f+"px)":"translate3d("+d+"px, "+f+"px, 0)",Y))}return Object.assign({},H,(e={},e[C]=v?f+"px":"",e[Q]=y?d+"px":"",e.transform="",e))}function cm(s){var e=s.state,t=s.options,i=t.gpuAcceleration,r=i===void 0?!0:i,n=t.adaptive,o=n===void 0?!0:n,a=t.roundOffsets,A=a===void 0?!0:a,l={placement:ai(e.placement),variation:bs(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:r,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,Xh(Object.assign({},l,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:o,roundOffsets:A})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,Xh(Object.assign({},l,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:A})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const hm={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:cm,data:{}};var _n={passive:!0};function um(s){var e=s.state,t=s.instance,i=s.options,r=i.scroll,n=r===void 0?!0:r,o=i.resize,a=o===void 0?!0:o,A=Lt(e.elements.popper),l=[].concat(e.scrollParents.reference,e.scrollParents.popper);return n&&l.forEach(function(c){c.addEventListener("scroll",t.update,_n)}),a&&A.addEventListener("resize",t.update,_n),function(){n&&l.forEach(function(c){c.removeEventListener("scroll",t.update,_n)}),a&&A.removeEventListener("resize",t.update,_n)}}const dm={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:um,data:{}};var gm={left:"right",right:"left",bottom:"top",top:"bottom"};function kn(s){return s.replace(/left|right|bottom|top/g,function(e){return gm[e]})}var fm={start:"end",end:"start"};function zh(s){return s.replace(/start|end/g,function(e){return fm[e]})}function Fa(s){var e=Lt(s),t=e.pageXOffset,i=e.pageYOffset;return{scrollLeft:t,scrollTop:i}}function Na(s){return Qs(ki(s)).left+Fa(s).scrollLeft}function pm(s,e){var t=Lt(s),i=ki(s),r=t.visualViewport,n=i.clientWidth,o=i.clientHeight,a=0,A=0;if(r){n=r.width,o=r.height;var l=Kh();(l||!l&&e==="fixed")&&(a=r.offsetLeft,A=r.offsetTop)}return{width:n,height:o,x:a+Na(s),y:A}}function Em(s){var e,t=ki(s),i=Fa(s),r=(e=s.ownerDocument)==null?void 0:e.body,n=zi(t.scrollWidth,t.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),o=zi(t.scrollHeight,t.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),a=-i.scrollLeft+Na(s),A=-i.scrollTop;return Bi(r||t).direction==="rtl"&&(a+=zi(t.clientWidth,r?r.clientWidth:0)-n),{width:n,height:o,x:a,y:A}}function Ma(s){var e=Bi(s),t=e.overflow,i=e.overflowX,r=e.overflowY;return/auto|scroll|overlay|hidden/.test(t+r+i)}function Zh(s){return["html","body","#document"].indexOf(oi(s))>=0?s.ownerDocument.body:Ut(s)&&Ma(s)?s:Zh(Ln(s))}function cr(s,e){var t;e===void 0&&(e=[]);var i=Zh(s),r=i===((t=s.ownerDocument)==null?void 0:t.body),n=Lt(i),o=r?[n].concat(n.visualViewport||[],Ma(i)?i:[]):i,a=e.concat(o);return r?a:a.concat(cr(Ln(o)))}function Pa(s){return Object.assign({},s,{left:s.x,top:s.y,right:s.x+s.width,bottom:s.y+s.height})}function Im(s,e){var t=Qs(s,!1,e==="fixed");return t.top=t.top+s.clientTop,t.left=t.left+s.clientLeft,t.bottom=t.top+s.clientHeight,t.right=t.left+s.clientWidth,t.width=s.clientWidth,t.height=s.clientHeight,t.x=t.left,t.y=t.top,t}function eu(s,e,t){return e===Gh?Pa(pm(s,t)):Xi(e)?Im(e,t):Pa(Em(ki(s)))}function mm(s){var e=cr(Ln(s)),t=["absolute","fixed"].indexOf(Bi(s).position)>=0,i=t&&Ut(s)?Ar(s):s;return Xi(i)?e.filter(function(r){return Xi(r)&&Vh(r,i)&&oi(r)!=="body"}):[]}function Cm(s,e,t,i){var r=e==="clippingParents"?mm(s):[].concat(e),n=[].concat(r,[t]),o=n[0],a=n.reduce(function(A,l){var c=eu(s,l,i);return A.top=zi(c.top,A.top),A.right=Dn(c.right,A.right),A.bottom=Dn(c.bottom,A.bottom),A.left=zi(c.left,A.left),A},eu(s,o,i));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function tu(s){var e=s.reference,t=s.element,i=s.placement,r=i?ai(i):null,n=i?bs(i):null,o=e.x+e.width/2-t.width/2,a=e.y+e.height/2-t.height/2,A;switch(r){case Tt:A={x:o,y:e.y-t.height};break;case Pt:A={x:o,y:e.y+e.height};break;case Ot:A={x:e.x+e.width,y:a};break;case xt:A={x:e.x-t.width,y:a};break;default:A={x:e.x,y:e.y}}var l=r?ka(r):null;if(l!=null){var c=l==="y"?"height":"width";switch(n){case vs:A[l]=A[l]-(e[c]/2-t[c]/2);break;case or:A[l]=A[l]+(e[c]/2-t[c]/2);break}}return A}function hr(s,e){e===void 0&&(e={});var t=e,i=t.placement,r=i===void 0?s.placement:i,n=t.strategy,o=n===void 0?s.strategy:n,a=t.boundary,A=a===void 0?GI:a,l=t.rootBoundary,c=l===void 0?Gh:l,h=t.elementContext,u=h===void 0?ar:h,d=t.altBoundary,g=d===void 0?!1:d,f=t.padding,p=f===void 0?0:f,y=qh(typeof p!="number"?p:jh(p,nr)),v=u===ar?HI:ar,Q=s.rects.popper,C=s.elements[g?v:u],w=Cm(Xi(C)?C:C.contextElement||ki(s.elements.popper),A,c,o),B=Qs(s.elements.reference),L=tu({reference:B,element:Q,strategy:"absolute",placement:r}),_=Pa(Object.assign({},Q,L)),$=u===ar?_:B,F={top:w.top-$.top+y.top,bottom:$.bottom-w.bottom+y.bottom,left:w.left-$.left+y.left,right:$.right-w.right+y.right},H=s.modifiersData.offset;if(u===ar&&H){var q=H[r];Object.keys(F).forEach(function(Y){var z=[Ot,Pt].indexOf(Y)>=0?1:-1,S=[Tt,Pt].indexOf(Y)>=0?"y":"x";F[Y]+=q[S]*z})}return F}function ym(s,e){e===void 0&&(e={});var t=e,i=t.placement,r=t.boundary,n=t.rootBoundary,o=t.padding,a=t.flipVariations,A=t.allowedAutoPlacements,l=A===void 0?$h:A,c=bs(i),h=c?a?Hh:Hh.filter(function(g){return bs(g)===c}):nr,u=h.filter(function(g){return l.indexOf(g)>=0});u.length===0&&(u=h);var d=u.reduce(function(g,f){return g[f]=hr(s,{placement:f,boundary:r,rootBoundary:n,padding:o})[ai(f)],g},{});return Object.keys(d).sort(function(g,f){return d[g]-d[f]})}function vm(s){if(ai(s)===xa)return[];var e=kn(s);return[zh(s),e,zh(e)]}function Bm(s){var e=s.state,t=s.options,i=s.name;if(!e.modifiersData[i]._skip){for(var r=t.mainAxis,n=r===void 0?!0:r,o=t.altAxis,a=o===void 0?!0:o,A=t.fallbackPlacements,l=t.padding,c=t.boundary,h=t.rootBoundary,u=t.altBoundary,d=t.flipVariations,g=d===void 0?!0:d,f=t.allowedAutoPlacements,p=e.options.placement,y=ai(p),v=y===p,Q=A||(v||!g?[kn(p)]:vm(p)),C=[p].concat(Q).reduce(function(se,ce){return se.concat(ai(ce)===xa?ym(e,{placement:ce,boundary:c,rootBoundary:h,padding:l,flipVariations:g,allowedAutoPlacements:f}):ce)},[]),w=e.rects.reference,B=e.rects.popper,L=new Map,_=!0,$=C[0],F=0;F<C.length;F++){var H=C[F],q=ai(H),Y=bs(H)===vs,z=[Tt,Pt].indexOf(q)>=0,S=z?"width":"height",T=hr(e,{placement:H,boundary:c,rootBoundary:h,altBoundary:u,padding:l}),U=z?Y?Ot:xt:Y?Pt:Tt;w[S]>B[S]&&(U=kn(U));var b=kn(U),R=[];if(n&&R.push(T[q]<=0),a&&R.push(T[U]<=0,T[b]<=0),R.every(function(se){return se})){$=H,_=!1;break}L.set(H,R)}if(_)for(var x=g?3:1,V=function(ce){var Ae=C.find(function(ye){var Ee=L.get(ye);if(Ee)return Ee.slice(0,ce).every(function(Re){return Re})});if(Ae)return $=Ae,"break"},O=x;O>0;O--){var j=V(O);if(j==="break")break}e.placement!==$&&(e.modifiersData[i]._skip=!0,e.placement=$,e.reset=!0)}}const Qm={name:"flip",enabled:!0,phase:"main",fn:Bm,requiresIfExists:["offset"],data:{_skip:!1}};function iu(s,e,t){return t===void 0&&(t={x:0,y:0}),{top:s.top-e.height-t.y,right:s.right-e.width+t.x,bottom:s.bottom-e.height+t.y,left:s.left-e.width-t.x}}function su(s){return[Tt,Ot,Pt,xt].some(function(e){return s[e]>=0})}function bm(s){var e=s.state,t=s.name,i=e.rects.reference,r=e.rects.popper,n=e.modifiersData.preventOverflow,o=hr(e,{elementContext:"reference"}),a=hr(e,{altBoundary:!0}),A=iu(o,i),l=iu(a,r,n),c=su(A),h=su(l);e.modifiersData[t]={referenceClippingOffsets:A,popperEscapeOffsets:l,isReferenceHidden:c,hasPopperEscaped:h},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":c,"data-popper-escaped":h})}const Sm={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:bm};function wm(s,e,t){var i=ai(s),r=[xt,Tt].indexOf(i)>=0?-1:1,n=typeof t=="function"?t(Object.assign({},e,{placement:s})):t,o=n[0],a=n[1];return o=o||0,a=(a||0)*r,[xt,Ot].indexOf(i)>=0?{x:a,y:o}:{x:o,y:a}}function Rm(s){var e=s.state,t=s.options,i=s.name,r=t.offset,n=r===void 0?[0,0]:r,o=$h.reduce(function(c,h){return c[h]=wm(h,e.rects,n),c},{}),a=o[e.placement],A=a.x,l=a.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=A,e.modifiersData.popperOffsets.y+=l),e.modifiersData[i]=o}const Tm={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Rm};function xm(s){var e=s.state,t=s.name;e.modifiersData[t]=tu({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const Dm={name:"popperOffsets",enabled:!0,phase:"read",fn:xm,data:{}};function Lm(s){return s==="x"?"y":"x"}function _m(s){var e=s.state,t=s.options,i=s.name,r=t.mainAxis,n=r===void 0?!0:r,o=t.altAxis,a=o===void 0?!1:o,A=t.boundary,l=t.rootBoundary,c=t.altBoundary,h=t.padding,u=t.tether,d=u===void 0?!0:u,g=t.tetherOffset,f=g===void 0?0:g,p=hr(e,{boundary:A,rootBoundary:l,padding:h,altBoundary:c}),y=ai(e.placement),v=bs(e.placement),Q=!v,C=ka(y),w=Lm(C),B=e.modifiersData.popperOffsets,L=e.rects.reference,_=e.rects.popper,$=typeof f=="function"?f(Object.assign({},e.rects,{placement:e.placement})):f,F=typeof $=="number"?{mainAxis:$,altAxis:$}:Object.assign({mainAxis:0,altAxis:0},$),H=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,q={x:0,y:0};if(B){if(n){var Y,z=C==="y"?Tt:xt,S=C==="y"?Pt:Ot,T=C==="y"?"height":"width",U=B[C],b=U+p[z],R=U-p[S],x=d?-_[T]/2:0,V=v===vs?L[T]:_[T],O=v===vs?-_[T]:-L[T],j=e.elements.arrow,se=d&&j?_a(j):{width:0,height:0},ce=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:Wh(),Ae=ce[z],ye=ce[S],Ee=lr(0,L[T],se[T]),Re=Q?L[T]/2-x-Ee-Ae-F.mainAxis:V-Ee-Ae-F.mainAxis,ne=Q?-L[T]/2+x+Ee+ye+F.mainAxis:O+Ee+ye+F.mainAxis,ue=e.elements.arrow&&Ar(e.elements.arrow),Se=ue?C==="y"?ue.clientTop||0:ue.clientLeft||0:0,Ce=(Y=H==null?void 0:H[C])!=null?Y:0,he=U+Re-Ce-Se,te=U+ne-Ce,Be=lr(d?Dn(b,he):b,U,d?zi(R,te):R);B[C]=Be,q[C]=Be-U}if(a){var De,Fe=C==="x"?Tt:xt,Te=C==="x"?Pt:Ot,Me=B[w],Ne=w==="y"?"height":"width",ve=Me+p[Fe],Ve=Me-p[Te],Xe=[Tt,xt].indexOf(y)!==-1,nt=(De=H==null?void 0:H[w])!=null?De:0,Je=Xe?ve:Me-L[Ne]-_[Ne]-nt+F.altAxis,yt=Xe?Me+L[Ne]+_[Ne]-nt-F.altAxis:Ve,Qi=d&&Xe?sm(Je,Me,yt):lr(d?Je:ve,Me,d?yt:Ve);B[w]=Qi,q[w]=Qi-Me}e.modifiersData[i]=q}}const km={name:"preventOverflow",enabled:!0,phase:"main",fn:_m,requiresIfExists:["offset"]};function Fm(s){return{scrollLeft:s.scrollLeft,scrollTop:s.scrollTop}}function Nm(s){return s===Lt(s)||!Ut(s)?Fa(s):Fm(s)}function Mm(s){var e=s.getBoundingClientRect(),t=Bs(e.width)/s.offsetWidth||1,i=Bs(e.height)/s.offsetHeight||1;return t!==1||i!==1}function Pm(s,e,t){t===void 0&&(t=!1);var i=Ut(e),r=Ut(e)&&Mm(e),n=ki(e),o=Qs(s,r,t),a={scrollLeft:0,scrollTop:0},A={x:0,y:0};return(i||!i&&!t)&&((oi(e)!=="body"||Ma(n))&&(a=Nm(e)),Ut(e)?(A=Qs(e,!0),A.x+=e.clientLeft,A.y+=e.clientTop):n&&(A.x=Na(n))),{x:o.left+a.scrollLeft-A.x,y:o.top+a.scrollTop-A.y,width:o.width,height:o.height}}function Om(s){var e=new Map,t=new Set,i=[];s.forEach(function(n){e.set(n.name,n)});function r(n){t.add(n.name);var o=[].concat(n.requires||[],n.requiresIfExists||[]);o.forEach(function(a){if(!t.has(a)){var A=e.get(a);A&&r(A)}}),i.push(n)}return s.forEach(function(n){t.has(n.name)||r(n)}),i}function Um(s){var e=Om(s);return zI.reduce(function(t,i){return t.concat(e.filter(function(r){return r.phase===i}))},[])}function Gm(s){var e;return function(){return e||(e=new Promise(function(t){Promise.resolve().then(function(){e=void 0,t(s())})})),e}}function Hm(s){var e=s.reduce(function(t,i){var r=t[i.name];return t[i.name]=r?Object.assign({},r,i,{options:Object.assign({},r.options,i.options),data:Object.assign({},r.data,i.data)}):i,t},{});return Object.keys(e).map(function(t){return e[t]})}var ru={placement:"bottom",modifiers:[],strategy:"absolute"};function nu(){for(var s=arguments.length,e=new Array(s),t=0;t<s;t++)e[t]=arguments[t];return!e.some(function(i){return!(i&&typeof i.getBoundingClientRect=="function")})}function $m(s){s===void 0&&(s={});var e=s,t=e.defaultModifiers,i=t===void 0?[]:t,r=e.defaultOptions,n=r===void 0?ru:r;return function(a,A,l){l===void 0&&(l=n);var c={placement:"bottom",orderedModifiers:[],options:Object.assign({},ru,n),modifiersData:{},elements:{reference:a,popper:A},attributes:{},styles:{}},h=[],u=!1,d={state:c,setOptions:function(y){var v=typeof y=="function"?y(c.options):y;f(),c.options=Object.assign({},n,c.options,v),c.scrollParents={reference:Xi(a)?cr(a):a.contextElement?cr(a.contextElement):[],popper:cr(A)};var Q=Um(Hm([].concat(i,c.options.modifiers)));return c.orderedModifiers=Q.filter(function(C){return C.enabled}),g(),d.update()},forceUpdate:function(){if(!u){var y=c.elements,v=y.reference,Q=y.popper;if(nu(v,Q)){c.rects={reference:Pm(v,Ar(Q),c.options.strategy==="fixed"),popper:_a(Q)},c.reset=!1,c.placement=c.options.placement,c.orderedModifiers.forEach(function(F){return c.modifiersData[F.name]=Object.assign({},F.data)});for(var C=0;C<c.orderedModifiers.length;C++){if(c.reset===!0){c.reset=!1,C=-1;continue}var w=c.orderedModifiers[C],B=w.fn,L=w.options,_=L===void 0?{}:L,$=w.name;typeof B=="function"&&(c=B({state:c,options:_,name:$,instance:d})||c)}}}},update:Gm(function(){return new Promise(function(p){d.forceUpdate(),p(c)})}),destroy:function(){f(),u=!0}};if(!nu(a,A))return d;d.setOptions(l).then(function(p){!u&&l.onFirstUpdate&&l.onFirstUpdate(p)});function g(){c.orderedModifiers.forEach(function(p){var y=p.name,v=p.options,Q=v===void 0?{}:v,C=p.effect;if(typeof C=="function"){var w=C({state:c,name:y,instance:d,options:Q}),B=function(){};h.push(w||B)}})}function f(){h.forEach(function(p){return p()}),h=[]}return d}}var Ym=[dm,Dm,hm,Yh,Tm,Qm,km,am,Sm],Km=$m({defaultModifiers:Ym}),Vm="tippy-box",ou="tippy-content",Jm="tippy-backdrop",au="tippy-arrow",Au="tippy-svg-arrow",Zi={passive:!0,capture:!0},lu=function(){return document.body};function Oa(s,e,t){if(Array.isArray(s)){var i=s[e];return i??(Array.isArray(t)?t[e]:t)}return s}function Ua(s,e){var t={}.toString.call(s);return t.indexOf("[object")===0&&t.indexOf(e+"]")>-1}function cu(s,e){return typeof s=="function"?s.apply(void 0,e):s}function hu(s,e){if(e===0)return s;var t;return function(i){clearTimeout(t),t=setTimeout(function(){s(i)},e)}}function Wm(s){return s.split(/\s+/).filter(Boolean)}function Ss(s){return[].concat(s)}function uu(s,e){s.indexOf(e)===-1&&s.push(e)}function qm(s){return s.filter(function(e,t){return s.indexOf(e)===t})}function jm(s){return s.split("-")[0]}function Fn(s){return[].slice.call(s)}function du(s){return Object.keys(s).reduce(function(e,t){return s[t]!==void 0&&(e[t]=s[t]),e},{})}function ur(){return document.createElement("div")}function Nn(s){return["Element","Fragment"].some(function(e){return Ua(s,e)})}function Xm(s){return Ua(s,"NodeList")}function zm(s){return Ua(s,"MouseEvent")}function Zm(s){return!!(s&&s._tippy&&s._tippy.reference===s)}function eC(s){return Nn(s)?[s]:Xm(s)?Fn(s):Array.isArray(s)?s:Fn(document.querySelectorAll(s))}function Ga(s,e){s.forEach(function(t){t&&(t.style.transitionDuration=e+"ms")})}function gu(s,e){s.forEach(function(t){t&&t.setAttribute("data-state",e)})}function tC(s){var e,t=Ss(s),i=t[0];return i!=null&&(e=i.ownerDocument)!=null&&e.body?i.ownerDocument:document}function iC(s,e){var t=e.clientX,i=e.clientY;return s.every(function(r){var n=r.popperRect,o=r.popperState,a=r.props,A=a.interactiveBorder,l=jm(o.placement),c=o.modifiersData.offset;if(!c)return!0;var h=l==="bottom"?c.top.y:0,u=l==="top"?c.bottom.y:0,d=l==="right"?c.left.x:0,g=l==="left"?c.right.x:0,f=n.top-i+h>A,p=i-n.bottom-u>A,y=n.left-t+d>A,v=t-n.right-g>A;return f||p||y||v})}function Ha(s,e,t){var i=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(r){s[i](r,t)})}function fu(s,e){for(var t=e;t;){var i;if(s.contains(t))return!0;t=t.getRootNode==null||(i=t.getRootNode())==null?void 0:i.host}return!1}var Ai={isTouch:!1},pu=0;function sC(){Ai.isTouch||(Ai.isTouch=!0,window.performance&&document.addEventListener("mousemove",Eu))}function Eu(){var s=performance.now();s-pu<20&&(Ai.isTouch=!1,document.removeEventListener("mousemove",Eu)),pu=s}function rC(){var s=document.activeElement;if(Zm(s)){var e=s._tippy;s.blur&&!e.state.isVisible&&s.blur()}}function nC(){document.addEventListener("touchstart",sC,Zi),window.addEventListener("blur",rC)}var oC=typeof window<"u"&&typeof document<"u",aC=oC?!!window.msCrypto:!1,AC={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},lC={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},Wt=Object.assign({appendTo:lu,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},AC,lC),cC=Object.keys(Wt),hC=function(e){var t=Object.keys(e);t.forEach(function(i){Wt[i]=e[i]})};function Iu(s){var e=s.plugins||[],t=e.reduce(function(i,r){var n=r.name,o=r.defaultValue;if(n){var a;i[n]=s[n]!==void 0?s[n]:(a=Wt[n])!=null?a:o}return i},{});return Object.assign({},s,t)}function uC(s,e){var t=e?Object.keys(Iu(Object.assign({},Wt,{plugins:e}))):cC,i=t.reduce(function(r,n){var o=(s.getAttribute("data-tippy-"+n)||"").trim();if(!o)return r;if(n==="content")r[n]=o;else try{r[n]=JSON.parse(o)}catch{r[n]=o}return r},{});return i}function mu(s,e){var t=Object.assign({},e,{content:cu(e.content,[s])},e.ignoreAttributes?{}:uC(s,e.plugins));return t.aria=Object.assign({},Wt.aria,t.aria),t.aria={expanded:t.aria.expanded==="auto"?e.interactive:t.aria.expanded,content:t.aria.content==="auto"?e.interactive?null:"describedby":t.aria.content},t}var dC=function(){return"innerHTML"};function $a(s,e){s[dC()]=e}function Cu(s){var e=ur();return s===!0?e.className=au:(e.className=Au,Nn(s)?e.appendChild(s):$a(e,s)),e}function yu(s,e){Nn(e.content)?($a(s,""),s.appendChild(e.content)):typeof e.content!="function"&&(e.allowHTML?$a(s,e.content):s.textContent=e.content)}function Ya(s){var e=s.firstElementChild,t=Fn(e.children);return{box:e,content:t.find(function(i){return i.classList.contains(ou)}),arrow:t.find(function(i){return i.classList.contains(au)||i.classList.contains(Au)}),backdrop:t.find(function(i){return i.classList.contains(Jm)})}}function vu(s){var e=ur(),t=ur();t.className=Vm,t.setAttribute("data-state","hidden"),t.setAttribute("tabindex","-1");var i=ur();i.className=ou,i.setAttribute("data-state","hidden"),yu(i,s.props),e.appendChild(t),t.appendChild(i),r(s.props,s.props);function r(n,o){var a=Ya(e),A=a.box,l=a.content,c=a.arrow;o.theme?A.setAttribute("data-theme",o.theme):A.removeAttribute("data-theme"),typeof o.animation=="string"?A.setAttribute("data-animation",o.animation):A.removeAttribute("data-animation"),o.inertia?A.setAttribute("data-inertia",""):A.removeAttribute("data-inertia"),A.style.maxWidth=typeof o.maxWidth=="number"?o.maxWidth+"px":o.maxWidth,o.role?A.setAttribute("role",o.role):A.removeAttribute("role"),(n.content!==o.content||n.allowHTML!==o.allowHTML)&&yu(l,s.props),o.arrow?c?n.arrow!==o.arrow&&(A.removeChild(c),A.appendChild(Cu(o.arrow))):A.appendChild(Cu(o.arrow)):c&&A.removeChild(c)}return{popper:e,onUpdate:r}}vu.$$tippy=!0;var gC=1,Mn=[],Ka=[];function fC(s,e){var t=mu(s,Object.assign({},Wt,Iu(du(e)))),i,r,n,o=!1,a=!1,A=!1,l=!1,c,h,u,d=[],g=hu(he,t.interactiveDebounce),f,p=gC++,y=null,v=qm(t.plugins),Q={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},C={id:p,reference:s,popper:ur(),popperInstance:y,props:t,state:Q,plugins:v,clearDelayTimeouts:Je,setProps:yt,setContent:Qi,show:vt,hide:hi,hideWithInteractivity:ui,enable:Xe,disable:nt,unmount:di,destroy:It};if(!t.render)return C;var w=t.render(C),B=w.popper,L=w.onUpdate;B.setAttribute("data-tippy-root",""),B.id="tippy-"+C.id,C.popper=B,s._tippy=C,B._tippy=C;var _=v.map(function(K){return K.fn(C)}),$=s.hasAttribute("aria-expanded");return ue(),x(),U(),b("onCreate",[C]),t.showOnCreate&&ve(),B.addEventListener("mouseenter",function(){C.props.interactive&&C.state.isVisible&&C.clearDelayTimeouts()}),B.addEventListener("mouseleave",function(){C.props.interactive&&C.props.trigger.indexOf("mouseenter")>=0&&z().addEventListener("mousemove",g)}),C;function F(){var K=C.props.touch;return Array.isArray(K)?K:[K,0]}function H(){return F()[0]==="hold"}function q(){var K;return!!((K=C.props.render)!=null&&K.$$tippy)}function Y(){return f||s}function z(){var K=Y().parentNode;return K?tC(K):document}function S(){return Ya(B)}function T(K){return C.state.isMounted&&!C.state.isVisible||Ai.isTouch||c&&c.type==="focus"?0:Oa(C.props.delay,K?0:1,Wt.delay)}function U(K){K===void 0&&(K=!1),B.style.pointerEvents=C.props.interactive&&!K?"":"none",B.style.zIndex=""+C.props.zIndex}function b(K,le,fe){if(fe===void 0&&(fe=!0),_.forEach(function(we){we[K]&&we[K].apply(we,le)}),fe){var Le;(Le=C.props)[K].apply(Le,le)}}function R(){var K=C.props.aria;if(K.content){var le="aria-"+K.content,fe=B.id,Le=Ss(C.props.triggerTarget||s);Le.forEach(function(we){var We=we.getAttribute(le);if(C.state.isVisible)we.setAttribute(le,We?We+" "+fe:fe);else{var Bt=We&&We.replace(fe,"").trim();Bt?we.setAttribute(le,Bt):we.removeAttribute(le)}})}}function x(){if(!($||!C.props.aria.expanded)){var K=Ss(C.props.triggerTarget||s);K.forEach(function(le){C.props.interactive?le.setAttribute("aria-expanded",C.state.isVisible&&le===Y()?"true":"false"):le.removeAttribute("aria-expanded")})}}function V(){z().removeEventListener("mousemove",g),Mn=Mn.filter(function(K){return K!==g})}function O(K){if(!(Ai.isTouch&&(A||K.type==="mousedown"))){var le=K.composedPath&&K.composedPath()[0]||K.target;if(!(C.props.interactive&&fu(B,le))){if(Ss(C.props.triggerTarget||s).some(function(fe){return fu(fe,le)})){if(Ai.isTouch||C.state.isVisible&&C.props.trigger.indexOf("click")>=0)return}else b("onClickOutside",[C,K]);C.props.hideOnClick===!0&&(C.clearDelayTimeouts(),C.hide(),a=!0,setTimeout(function(){a=!1}),C.state.isMounted||Ae())}}}function j(){A=!0}function se(){A=!1}function ce(){var K=z();K.addEventListener("mousedown",O,!0),K.addEventListener("touchend",O,Zi),K.addEventListener("touchstart",se,Zi),K.addEventListener("touchmove",j,Zi)}function Ae(){var K=z();K.removeEventListener("mousedown",O,!0),K.removeEventListener("touchend",O,Zi),K.removeEventListener("touchstart",se,Zi),K.removeEventListener("touchmove",j,Zi)}function ye(K,le){Re(K,function(){!C.state.isVisible&&B.parentNode&&B.parentNode.contains(B)&&le()})}function Ee(K,le){Re(K,le)}function Re(K,le){var fe=S().box;function Le(we){we.target===fe&&(Ha(fe,"remove",Le),le())}if(K===0)return le();Ha(fe,"remove",h),Ha(fe,"add",Le),h=Le}function ne(K,le,fe){fe===void 0&&(fe=!1);var Le=Ss(C.props.triggerTarget||s);Le.forEach(function(we){we.addEventListener(K,le,fe),d.push({node:we,eventType:K,handler:le,options:fe})})}function ue(){H()&&(ne("touchstart",Ce,{passive:!0}),ne("touchend",te,{passive:!0})),Wm(C.props.trigger).forEach(function(K){if(K!=="manual")switch(ne(K,Ce),K){case"mouseenter":ne("mouseleave",te);break;case"focus":ne(aC?"focusout":"blur",Be);break;case"focusin":ne("focusout",Be);break}})}function Se(){d.forEach(function(K){var le=K.node,fe=K.eventType,Le=K.handler,we=K.options;le.removeEventListener(fe,Le,we)}),d=[]}function Ce(K){var le,fe=!1;if(!(!C.state.isEnabled||De(K)||a)){var Le=((le=c)==null?void 0:le.type)==="focus";c=K,f=K.currentTarget,x(),!C.state.isVisible&&zm(K)&&Mn.forEach(function(we){return we(K)}),K.type==="click"&&(C.props.trigger.indexOf("mouseenter")<0||o)&&C.props.hideOnClick!==!1&&C.state.isVisible?fe=!0:ve(K),K.type==="click"&&(o=!fe),fe&&!Le&&Ve(K)}}function he(K){var le=K.target,fe=Y().contains(le)||B.contains(le);if(!(K.type==="mousemove"&&fe)){var Le=Ne().concat(B).map(function(we){var We,Bt=we._tippy,Qt=(We=Bt.popperInstance)==null?void 0:We.state;return Qt?{popperRect:we.getBoundingClientRect(),popperState:Qt,props:t}:null}).filter(Boolean);iC(Le,K)&&(V(),Ve(K))}}function te(K){var le=De(K)||C.props.trigger.indexOf("click")>=0&&o;if(!le){if(C.props.interactive){C.hideWithInteractivity(K);return}Ve(K)}}function Be(K){C.props.trigger.indexOf("focusin")<0&&K.target!==Y()||C.props.interactive&&K.relatedTarget&&B.contains(K.relatedTarget)||Ve(K)}function De(K){return Ai.isTouch?H()!==K.type.indexOf("touch")>=0:!1}function Fe(){Te();var K=C.props,le=K.popperOptions,fe=K.placement,Le=K.offset,we=K.getReferenceClientRect,We=K.moveTransition,Bt=q()?Ya(B).arrow:null,Qt=we?{getBoundingClientRect:we,contextElement:we.contextElement||Y()}:s,xs={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(Ds){var Mi=Ds.state;if(q()){var mr=S(),Cr=mr.box;["placement","reference-hidden","escaped"].forEach(function(Ls){Ls==="placement"?Cr.setAttribute("data-placement",Mi.placement):Mi.attributes.popper["data-popper-"+Ls]?Cr.setAttribute("data-"+Ls,""):Cr.removeAttribute("data-"+Ls)}),Mi.attributes.popper={}}}},bt=[{name:"offset",options:{offset:Le}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!We}},xs];q()&&Bt&&bt.push({name:"arrow",options:{element:Bt,padding:3}}),bt.push.apply(bt,(le==null?void 0:le.modifiers)||[]),C.popperInstance=Km(Qt,B,Object.assign({},le,{placement:fe,onFirstUpdate:u,modifiers:bt}))}function Te(){C.popperInstance&&(C.popperInstance.destroy(),C.popperInstance=null)}function Me(){var K=C.props.appendTo,le,fe=Y();C.props.interactive&&K===lu||K==="parent"?le=fe.parentNode:le=cu(K,[fe]),le.contains(B)||le.appendChild(B),C.state.isMounted=!0,Fe()}function Ne(){return Fn(B.querySelectorAll("[data-tippy-root]"))}function ve(K){C.clearDelayTimeouts(),K&&b("onTrigger",[C,K]),ce();var le=T(!0),fe=F(),Le=fe[0],we=fe[1];Ai.isTouch&&Le==="hold"&&we&&(le=we),le?i=setTimeout(function(){C.show()},le):C.show()}function Ve(K){if(C.clearDelayTimeouts(),b("onUntrigger",[C,K]),!C.state.isVisible){Ae();return}if(!(C.props.trigger.indexOf("mouseenter")>=0&&C.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(K.type)>=0&&o)){var le=T(!1);le?r=setTimeout(function(){C.state.isVisible&&C.hide()},le):n=requestAnimationFrame(function(){C.hide()})}}function Xe(){C.state.isEnabled=!0}function nt(){C.hide(),C.state.isEnabled=!1}function Je(){clearTimeout(i),clearTimeout(r),cancelAnimationFrame(n)}function yt(K){if(!C.state.isDestroyed){b("onBeforeUpdate",[C,K]),Se();var le=C.props,fe=mu(s,Object.assign({},le,du(K),{ignoreAttributes:!0}));C.props=fe,ue(),le.interactiveDebounce!==fe.interactiveDebounce&&(V(),g=hu(he,fe.interactiveDebounce)),le.triggerTarget&&!fe.triggerTarget?Ss(le.triggerTarget).forEach(function(Le){Le.removeAttribute("aria-expanded")}):fe.triggerTarget&&s.removeAttribute("aria-expanded"),x(),U(),L&&L(le,fe),C.popperInstance&&(Fe(),Ne().forEach(function(Le){requestAnimationFrame(Le._tippy.popperInstance.forceUpdate)})),b("onAfterUpdate",[C,K])}}function Qi(K){C.setProps({content:K})}function vt(){var K=C.state.isVisible,le=C.state.isDestroyed,fe=!C.state.isEnabled,Le=Ai.isTouch&&!C.props.touch,we=Oa(C.props.duration,0,Wt.duration);if(!(K||le||fe||Le)&&!Y().hasAttribute("disabled")&&(b("onShow",[C],!1),C.props.onShow(C)!==!1)){if(C.state.isVisible=!0,q()&&(B.style.visibility="visible"),U(),ce(),C.state.isMounted||(B.style.transition="none"),q()){var We=S(),Bt=We.box,Qt=We.content;Ga([Bt,Qt],0)}u=function(){var bt;if(!(!C.state.isVisible||l)){if(l=!0,B.offsetHeight,B.style.transition=C.props.moveTransition,q()&&C.props.animation){var ss=S(),Ds=ss.box,Mi=ss.content;Ga([Ds,Mi],we),gu([Ds,Mi],"visible")}R(),x(),uu(Ka,C),(bt=C.popperInstance)==null||bt.forceUpdate(),b("onMount",[C]),C.props.animation&&q()&&Ee(we,function(){C.state.isShown=!0,b("onShown",[C])})}},Me()}}function hi(){var K=!C.state.isVisible,le=C.state.isDestroyed,fe=!C.state.isEnabled,Le=Oa(C.props.duration,1,Wt.duration);if(!(K||le||fe)&&(b("onHide",[C],!1),C.props.onHide(C)!==!1)){if(C.state.isVisible=!1,C.state.isShown=!1,l=!1,o=!1,q()&&(B.style.visibility="hidden"),V(),Ae(),U(!0),q()){var we=S(),We=we.box,Bt=we.content;C.props.animation&&(Ga([We,Bt],Le),gu([We,Bt],"hidden"))}R(),x(),C.props.animation?q()&&ye(Le,C.unmount):C.unmount()}}function ui(K){z().addEventListener("mousemove",g),uu(Mn,g),g(K)}function di(){C.state.isVisible&&C.hide(),C.state.isMounted&&(Te(),Ne().forEach(function(K){K._tippy.unmount()}),B.parentNode&&B.parentNode.removeChild(B),Ka=Ka.filter(function(K){return K!==C}),C.state.isMounted=!1,b("onHidden",[C]))}function It(){C.state.isDestroyed||(C.clearDelayTimeouts(),C.unmount(),Se(),delete s._tippy,C.state.isDestroyed=!0,b("onDestroy",[C]))}}function es(s,e){e===void 0&&(e={});var t=Wt.plugins.concat(e.plugins||[]);nC();var i=Object.assign({},e,{plugins:t}),r=eC(s),n=r.reduce(function(o,a){var A=a&&fC(a,i);return A&&o.push(A),o},[]);return Nn(s)?n[0]:n}es.defaultProps=Wt,es.setDefaultProps=hC,es.currentInput=Ai,Object.assign({},Yh,{effect:function(e){var t=e.state,i={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(t.elements.popper.style,i.popper),t.styles=i,t.elements.arrow&&Object.assign(t.elements.arrow.style,i.arrow)}}),es.setDefaultProps({render:vu});class pC{constructor(){this.currentTask=null,this.nextTask=null}async enqueue(e){this.nextTask=async()=>{await e()},this.currentTask||this.runNext()}async runNext(){if(!this.nextTask){this.currentTask=null;return}const e=this.nextTask;this.nextTask=null,this.currentTask=e().finally(()=>this.runNext())}}class li extends Error{constructor(e,t=new Error,i=!1){super(),this.fatal=!1,this.fatal=i,this.stack=t.stack,this.message=[e,t.message].filter(Boolean).join(" - ")}}const EC=5;function IC(s,e){const t=s.map(({id:r})=>r).join("|"),i=e.map(({id:r})=>r).join("|");return t===i}class mC{constructor(e){this._caption="",this._currentTime=0,this._activeScenes=[],this._upcomingScenes=[],this._limitedQueue=new pC,this._canvas=dt(),this._controls=dt(),this.host=e}set activeScenes(e){IC(e,this._activeScenes)||(this._activeScenes=e,this.host.dispatchEvent(new CustomEvent("scenechange",{detail:e})),this.host.requestUpdate())}get activeScenes(){return this._activeScenes}set currentTime(e){var t,i,r,n,o;const a=Math.min(this.host.duration,Math.max(0,e));this.activeScenes=((t=this.host.scenes)==null?void 0:t.filter(({start:h,duration:u})=>a>=h&&a<h+u))??[];const A=a!==this.currentTime;this._currentTime=a,this._upcomingScenes=((i=this.host.scenes)==null?void 0:i.filter(({start:h})=>a>=h-EC&&a<h))??[],this.loadScenes(),this.syncVideoState(),(r=this._controls.value)==null||r.setAttribute("currentTime",a.toString());const l=this.activeScenes[0],c=Cl((n=l==null?void 0:l.videoMeta)==null?void 0:n.captions);this.caption=((o=c.find(({start:h,end:u})=>{var d;const g=a-l.start+(((d=l.videoMeta)==null?void 0:d.start)??0);return h&&u&&g>=Wr(h)&&g<=Wr(u)}))==null?void 0:o.text)??"",A&&this.host.dispatchEvent(new CustomEvent("timeupdate",{detail:a})),this.draw(a)}get currentTime(){return this._currentTime}set caption(e){e!==this._caption&&(this._caption=e,this.host.requestUpdate())}get caption(){return this._caption}canvas(){return gt(this._canvas)}controls(){return gt(this._controls)}loadScenes(){[...this.activeScenes,...this._upcomingScenes].forEach(e=>{var t,i,r;const{start:n,duration:o,video:a,videoMeta:A}=e,l=this.host.currentTime>0||this.host.preload==="auto"||!this.host.paused;if(a&&A){const{key:c,hls:h,node:u}=a,{start:d,duration:g}=A,f=this.host.videoState[c];u&&f&&(u.currentTime>=d+g||u.ended||l&&(h?(t=h.startLoadOnce)==null||t.call(h,d):f.initialised||(i=u.startLoadOnce)==null||i.call(u)))}else if(l){const c=`${n}-${o}`,h=this.host._sceneController.videoState[c];this.host.duration&&!((r=h==null?void 0:h.buffered)!=null&&r.length)&&(this.host._sceneController.videoState={...this.host._sceneController.videoState,[c]:{...h,buffered:[{start:Math.max(0,n/this.host.duration*100),end:Math.min((n+o)/this.host.duration*100,100)}]}})}})}syncVideoState(){var e;(e=this.host.scenes)==null||e.forEach(t=>{if(t.video){const{key:i,node:r}=t.video,n=this.host.videoState[i],o=this.activeScenes.includes(t);if(r&&n)if(o&&!this.host.waiting&&!this.host.loading&&!this.host.paused){if(r.paused&&n.initialised)try{return r.play()}catch(a){throw new li("Video play error",a,!0)}}else r.paused||r.pause()}})}draw(e=this.currentTime){this._limitedQueue.enqueue(async()=>{var t,i;this.host.sceneConfig&&this._canvas.value&&await((i=(t=this.host).compilation)==null?void 0:i.call(t,{currentTime:e,scenes:this.host.sceneConfig,canvas:this._canvas.value}))})}clear(){var e;const t=this._canvas.value;(e=t==null?void 0:t.getContext("2d"))==null||e.clearRect(0,0,t.width,t.height)}}function CC(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function yC(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function vC(s,e){return new Promise(t=>{const{id:i,key:r,duration:n}=e,o=document.createElement("video");o.playsInline=!0,o.muted=!0,o.loop=!1,o.src=s;let a=!1;if(o.startLoadOnce=()=>{a||(o.preload="auto",o.load(),a=!0)},n)o.preload="none",t({id:i,key:r,hls:null,config:e,node:o});else{o.preload="metadata";const A=async()=>{t({id:i,key:r,hls:null,config:e,node:o}),o.removeEventListener("loadedmetadata",A)};o.addEventListener("loadedmetadata",A)}})}function BC(s,e){return new Promise(t=>{const{id:i,key:r}=e,n=document.createElement("video");n.playsInline=!0,n.muted=!0,n.loop=!1;let o=!1;const a=new vi({autoStartLoad:!0,xhrSetup:A=>{const{open:l}=A,c=s.split("?")[1];A.open=function(h,u,d){u.toString().includes("?")||(u+="?"+c),!(!o&&u.toString().includes(".ts"))&&l.apply(this,[h,u,d])}}});a.on(vi.Events.LEVEL_LOADED,async()=>{o||a==null||a.stopLoad(),t({id:i,key:r,hls:a,config:e,node:n})}),a.loadSource(s),a.attachMedia(n),a.startLoadOnce=(A=-1,l)=>{if(a&&!o){const c=a==null?void 0:a.levels.findIndex(h=>Math.min(h.height,h.width)===l);o=!0,a.startLevel=a.firstLevel,a.startLoad(A),a.currentLevel=c!==-1?c:a.firstLevel}}})}function Va(s){const{src:e,playlist:t}=s;return t&&!CC()&&vi.isSupported()?BC(t,s):vC(e,s)}async function Bu(s){return s.duration===1/0?new Promise(e=>{s.currentTime=Number.MAX_SAFE_INTEGER,s.ontimeupdate=()=>{s.ontimeupdate=null,e(s.duration),s.currentTime=0}}):s.duration}const QC=Yt(async function(e){return new FontFace(e.name,`url(${e.woff2??e.url})`,{style:e.style,weight:e.weight}).load()},{cacheKey:([s])=>JSON.stringify(s)});let bC=class{constructor(e){this._hasPlayed=!1,this._memoKey=null,this._lastDeps=null,this._duration=0,this._scenes=null,this._videos={},this._videoMeta={},this._videoState={},this._delayProcessing=(t=100)=>{const i=new AbortController,r=setTimeout(()=>{i.signal.aborted||(this.host._processing=!0)},t);return i.signal.addEventListener("abort",()=>{clearTimeout(r)}),i},this._createDataResolver=t=>i=>this.host.dataResolver(i,{language:t}),this._resolveVideo=Yt(async t=>{const{id:i,key:r}=t,n=await Va(t);n.node.volume=this.host.volume,n.node.playbackRate=this.host.playbackRate;const o={loadeddata:this._handleLoadedData,waiting:this._handleWaiting,canplay:this._handleCanPlay,progress:this._handleProgress,seeking:this._handleSeeking,seeked:this._handleSeeked,play:this._handlePlay,playing:this._handlePlaying,pause:this._handlePause,stalled:this._handleStalled,timeupdate:this._handleTimeUpdate,ended:this._handleEnded,error:this._handleError},a=Object.keys(o).reduce((A,l)=>{const c=l,h=o[c]({id:i,key:r,node:n.node});return A[c]=h,n.node.addEventListener(l,h),A},{});return{...n,listeners:a}},{cacheKey:([{id:t,key:i,src:r,playlist:n}])=>JSON.stringify({id:t,key:i,src:r==null?void 0:r.split("?")[0],playlist:n==null?void 0:n.split("?")[0]})}),this._resolveVideoMeta=Yt(async(t,i)=>{const{id:r,captions:n,duration:o,startOffset:a,endOffset:A}=t,l=o??await Bu(i),c=(a??0)*l,h=(1-(A??0))*l;return{id:r,config:t,captions:n,start:c,duration:h-c}},{cacheKey:([t])=>JSON.stringify(t)}),this._handleLoadedData=({id:t,key:i,node:r})=>()=>{var n,o;const a=this.videoState[i];if(!(a!=null&&a.initialised)){this.videoState={...this.videoState,[i]:{...a,initialised:!0,waiting:!1,buffered:(a==null?void 0:a.buffered)??[]}};const A=(o=(n=this.scenes)==null?void 0:n.scenes)==null?void 0:o.find(({video:l})=>{l==null||l.key});A&&this._setVideoCurrentTime({scene:A,time:this.host.currentTime}),this.host.dispatchEvent(new CustomEvent("video:loadeddata",{detail:{id:t,key:i,node:r}}))}},this._handleWaiting=({key:t})=>()=>{const i=this.videoState[t];i!=null&&i.initialised&&!(i!=null&&i.waiting)&&(this.videoState={...this.videoState,[t]:{...i,waiting:!0}})},this._handleCanPlay=({key:t})=>()=>{const i=this.videoState[t];i!=null&&i.initialised&&(i!=null&&i.waiting)&&(this.videoState={...this.videoState,[t]:{...i,waiting:!1}}),this.host.paused&&this.host.draw()},this._handleProgress=({key:t,node:i})=>()=>{const r=this.videoState[t],n=this._getBufferSegments({key:t,node:i,duration:this.host.duration});this.videoState={...this.videoState,[t]:{...r,buffered:n}}},this._handleSeeking=({id:t,key:i,node:r})=>()=>{this.host.dispatchEvent(new CustomEvent("video:seeking",{detail:{id:t,key:i,node:r}}))},this._handleSeeked=({id:t,key:i,node:r})=>()=>{const n=this.videoState[i];n!=null&&n.initialised&&(this.host.draw(),this.host.activeScenes.map(o=>{var a;return(a=o.videoMeta)==null?void 0:a.id}).includes(t)&&this.host.dispatchEvent(new CustomEvent("seeked",{detail:this.host.currentTime})),this.host.dispatchEvent(new CustomEvent("video:seeked",{detail:{id:t,key:i,node:r}})))},this._handlePlay=({id:t,key:i,node:r})=>()=>{this.hasPlayed=!0,this.host.dispatchEvent(new CustomEvent("video:play",{detail:{id:t,key:i,node:r}}))},this._handlePlaying=({id:t,key:i,node:r})=>()=>{this.host.dispatchEvent(new CustomEvent("video:playing",{detail:{id:t,key:i,node:r}}))},this._handlePause=({id:t,key:i,node:r})=>()=>{this.host.dispatchEvent(new CustomEvent("video:pause",{detail:{id:t,key:i,node:r}}))},this._handleStalled=({id:t,key:i,node:r})=>()=>{this.host.dispatchEvent(new CustomEvent("video:stalled",{detail:{id:t,key:i,node:r}}))},this._handleTimeUpdate=({id:t,key:i,node:r})=>()=>{this.host.dispatchEvent(new CustomEvent("video:timeupdate",{detail:{id:t,key:i,node:r}}))},this._handleEnded=({id:t,key:i,node:r})=>()=>{this.host.dispatchEvent(new CustomEvent("video:ended",{detail:{id:t,key:i,node:r}}))},this._handleError=({id:t,key:i,node:r})=>()=>{const n=new li(`Video error - answer ${t} failed to load`);this.host.dispatchEvent(new ErrorEvent("error",{bubbles:!0,composed:!0,error:n,message:n.message})),this.host.dispatchEvent(new CustomEvent("video:error",{detail:{id:t,key:i,node:r}}))},this._cleanupVideo=t=>{var i;const r=this.videos[t];r&&(r.node.pause(),r.node.src="",(i=r.hls)==null||i.destroy(),Object.keys(r.listeners??{}).forEach(n=>{var o,a;if((o=this.videos)!=null&&o[t]){const A=(a=r.listeners)==null?void 0:a[n];A&&r.node.removeEventListener(n,A)}}),delete this.videos[t])},this.host=e,this.host.addController(this)}set hasPlayed(e){e!==this._hasPlayed&&(this._hasPlayed=e,this.host.requestUpdate())}get hasPlayed(){return this._hasPlayed}set duration(e){!isNaN(e)&&e!==this._duration&&(this._duration=e,this.host.requestUpdate(),this.host.dispatchEvent(new CustomEvent("durationchange",{detail:this._duration})))}get duration(){return this._duration}set scenes(e){e!==this._scenes&&(this._scenes=e,this.host.requestUpdate())}get scenes(){return this._scenes}set videos(e){e!==this._videos&&(this._videos=e,this.host.requestUpdate())}get videos(){return this._videos}set videoMeta(e){e!==this._videoMeta&&(this._videoMeta=e,this.host.requestUpdate())}get videoMeta(){return this._videoMeta}set videoState(e){e!==this._videoState&&(this._videoState=e,this.host.requestUpdate())}get videoState(){return this._videoState}_getBufferSegments({key:e,node:t,duration:i}){var r;const n=t==null?void 0:t.buffered,o=[],{start:a,video:A,videoMeta:l}=((r=this.scenes)==null?void 0:r.scenes.find(({video:c})=>e===(c==null?void 0:c.key)))??{};if(t&&n&&A&&l&&typeof a<"u")for(let c=0;c<n.length;c++){const h=n.start(c),u=n.end(c);Math.max(h,l.start)<=Math.min(u,l.start+l.duration)&&o.push({start:Math.max(0,(Math.max(h-l.start,0)+a)/i*100),end:Math.min((Math.min(u-l.start,l.duration)+a)/i*100,100)})}return o}_setupTask(){new Rr(this.host,async([e,t,i,r,n,o,a])=>{var A;const l=this._delayProcessing();try{let c=null;if(this.host._errors=[],this.host._languages=this.host.languageResolver({data:e}),(!n||!this.host._languages.find(({value:h})=>n===h))&&(this.host._language=(A=this.host._languages[0])==null?void 0:A.value),i||e){if(i){let f=null;if(r)try{f=await(await fetch(r,{method:"GET"})).text()}catch(v){const Q=new li("Track failed to fetch",v);this.host.dispatchEvent(new ErrorEvent("error",{composed:!0,bubbles:!0,error:Q,message:Q.message}))}const y={questions:{items:[{answer:{id:"source",media:{[i.includes(".m3u8")?"playlist":"video"]:i},captions:{current:f}}}]}};try{this.scenes=await ls({data:y,template:t,burnCaptions:o,debug:a},this._createDataResolver(this.host.language),this._resolveVideo,this._resolveVideoMeta)}catch(v){try{this.scenes=await ls({data:y,burnCaptions:o,debug:a},this._createDataResolver(this.host.language),this._resolveVideo,this._resolveVideoMeta)}catch(Q){throw new li("Fatal source template error",Q,!0)}c=new li("Source template error",v)}}else try{this.scenes=await ls({data:e,template:t,burnCaptions:o,debug:a},this._createDataResolver(this.host.language),this._resolveVideo,this._resolveVideoMeta)}catch(f){try{this.scenes=await ls({data:e,burnCaptions:o,debug:a},this._createDataResolver(this.host.language),this._resolveVideo,this._resolveVideoMeta)}catch(p){throw new li("Fatal data template error",p,!0)}c=new li("Data template error",f)}Object.keys(this.videos).forEach(f=>{this.scenes.scenes.find(({video:p})=>f===(p==null?void 0:p.key))||this._videos[f].node.pause()});const[h,u,d]=this.scenes.scenes.reduce((f,{video:p,videoMeta:y,start:v,duration:Q})=>{var C;p&&(f[0][p.key]=p,y&&(f[1][p.key]=y));const w=(p==null?void 0:p.key)??`${v}-${Q}`,B=this._getBufferSegments({key:w,node:p==null?void 0:p.node,duration:this.scenes.duration});return f[2][w]={initialised:!p,waiting:!!p,...this.videoState[w],buffered:p?B:(C=this.videoState[w])==null?void 0:C.buffered},f},[{},{},{}]);this.videos=h,this.videoMeta=u,this.videoState={...this.videoState,...d},(await Promise.all(this.scenes.fonts.map(f=>QC(f)))).forEach(f=>{document.fonts.add(f)}),this.duration=this.scenes.duration,this.host.currentTime>this.duration?this.host.reset(this.duration,!1):this.host.paused&&this.host.reset(this.host.currentTime,!this.host.paused)}c&&this.host.dispatchEvent(new ErrorEvent("error",{composed:!0,bubbles:!0,error:c,message:c.message})),this.host.dispatchEvent(new CustomEvent("scenesupdate",{detail:this.scenes,bubbles:!0,composed:!0}))}catch(c){this.scenes=null,this.duration=0,this.host.dispatchEvent(new ErrorEvent("error",{composed:!0,bubbles:!0,error:c,message:c.message}))}finally{l.abort(),this.host._processing=!1}},()=>{const e=JSON.stringify({data:this.host.data,template:this.host.template,src:this.host.src,track:this.host.track,language:this.host.language,burnCaptions:this.host.burnCaptions,debug:this.host.debug});if(this._lastDeps&&this._memoKey===e)return this._lastDeps;const t=[this.host.data,this.host.template,this.host.src,this.host.track,this.host.language,this.host.burnCaptions,this.host.debug];return this._memoKey=e,this._lastDeps=t,t})}_setVideoCurrentTime({time:e,scene:t}){const{start:i,video:r,videoMeta:n}=t;if(r&&r.node&&n&&typeof i<"u"){const o=e-i;r.node.currentTime=Math.max(n.start,Math.min(n.start+n.duration,o+n.start))}}setVideosCurrentTime(e){var t;(t=this.scenes)==null||t.scenes.forEach(i=>{this._setVideoCurrentTime({time:e,scene:i})})}hostConnected(){this._setupTask()}hostDisconnected(){Object.keys(this.videos).forEach(e=>{this._cleanupVideo(e)}),this.videos={}}};function SC(s){s.requestFullscreen?s.requestFullscreen():s.mozRequestFullScreen?s.mozRequestFullScreen():s.webkitRequestFullscreen?s.webkitRequestFullscreen():s.msRequestFullscreen&&s.msRequestFullscreen()}function wC(){document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen&&document.webkitExitFullscreen()}const Ja=["progress","play-large","navigation","play","volume","current-time","duration","speed","captions","fullscreen","preview"],RC={id:"captions",event:"captions:click",label:"Closed Captions"},TC={id:"fullscreen",event:"fullscreen:click",label:"Full Screen"},Qu={title:"Playback Speed",items:[{id:"playback-rate-0.5",event:"playbackRate:click",label:"0.5x",value:.5},{id:"playback-rate-1",event:"playbackRate:click",label:"1.0x",value:1},{id:"playback-rate-1.5",event:"playbackRate:click",label:"1.5x",value:1.5},{id:"playback-rate-2",event:"playbackRate:click",label:"2.0x",value:2}]},xC={id:"playbackRate",label:"Playback playbackRate",subItems:Qu};class DC extends xA{constructor(e){if(super(e),this.element=null,this.observer=void 0,e.type!==os.ELEMENT)throw new Error("Resize directive must be used in an Element expression")}disconnected(){var e;(e=this.observer)==null||e.disconnect(),this.observer=void 0}reconnected(){var e;this.element&&((e=this.observer)==null||e.observe(this.element))}update(e,[t]){return this.isConnected&&!this.observer&&(this.observer=new ResizeObserver(t),this.element=e.element,this.observer.observe(this.element)),$t}}const Wa=as(DC),LC=UI(()=>{const s=new FontFace("Roobert","url(https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/Roobert-Regular.woff2)",{style:"normal",weight:"400"}),e=new FontFace("Roobert","url(https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/Roobert-SemiBold.woff2)",{style:"normal",weight:"600"}),t=new FontFace("Roobert Captions","url(https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/Roobert-Regular.woff2)",{style:"normal",weight:"400"}),i=El.map(r=>({load:!1,font:new FontFace(r.family,`url(${r.url})`,{style:r.style})}));return[{load:!0,font:s},{load:!0,font:e},{load:!0,font:t},...i]}),ci={"red-120":"#feeded","red-130":"#fcd5d0","red-400":"#e84a4a","red-500":"#c51c3a","red-700":"#a21c39","red-800":"#850231","red-900":"#580A2D","teal-80":"#f3fafa","teal-100":"#d6f1f1","teal-200":"#ace3e3","teal-300":"#7acace","teal-400":"#4faab2","teal-500":"#358f97","teal-600":"#287179","teal-700":"#22555c","teal-800":"#21484e","teal-900":"#1f3d42","teal-950":"#0d2126","purple-100":"#d7cfff","purple-700":"#5f2fe9","green-200":"#a4d7aa","green-500":"#38b319","green-800":"#2b3c2f","grey-100":"#f0f0f0","light-50":"rgba(255, 255, 255, .05)","light-100":"rgba(255, 255, 255, .1)","light-200":"rgba(255, 255, 255, .2)","light-400":"rgba(255, 255, 255, .4)","light-500":"rgba(255, 255, 255, .5)","light-640":"rgba(255, 255, 255, .64)","light-800":"rgba(255, 255, 255, .8)","light-1000":"#fff","dark-50":"rgba(0, 0, 0, .05)","dark-80":"rgba(0, 0, 0, .08)","dark-100":"rgba(0, 0, 0, .1)","dark-200":"rgba(0, 0, 0, .2)","dark-250":"rgba(0, 0, 0, .25)","dark-400":"rgba(0, 0, 0, .4)","dark-500":"rgba(0, 0, 0, .5)","dark-640":"rgba(0, 0, 0, .64)","dark-800":"rgba(0, 0, 0, .8)","dark-900":"rgba(0, 0, 0, .9)","dark-1000":"#000"},_C={colors:ci,space:{xxs:".25rem",xs:".5rem",small:".75rem",medium:"1rem",large:"1.5rem",xl:"2.5rem"},sizes:{xxs:"1rem",xs:"1.5rem",small:"2rem",medium:"2.5rem",large:"3rem"},fontWeights:{regular:400,semibold:600},lineHeights:{small:1.1,medium:1.25,large:1.4},letterSpacings:{xxs:"-.04rem",xs:"-.03rem",small:"-.02rem",medium:"-.01rem",large:0},fontSizes:{micro:".625rem",small:".75rem",medium:".875rem",large:"1rem",xl:"1.25rem",xxl:"1.5rem",xxxl:"2rem",huge:"2.75rem"},fontFamilies:{sans:'Roobert, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial,"Noto Sans", "Noto Color Emoji", sans-serif, "Segoe UI Emoji", "Segoe UI Symbol", "Apple Color Emoji"',mono:'"Maison Neue Mono", Menlo, Monaco, Consolas, Liberation Mono, "Courier New", monospace'},borderWidths:{thin:".0625rem"},radii:{small:".25rem",medium:".5rem",large:".75rem",xl:"1rem"},shadows:{small:`.25rem .25rem .25rem ${ci["dark-100"]}`,medium:`0 .125rem .625rem ${ci["dark-100"]}`,large:`0 .25rem 1rem ${ci["dark-50"]}`,xl:`.25rem .25rem 1rem ${ci["dark-250"]}`,xxl:`0 .25rem 2rem ${ci["dark-100"]}`,xxxl:`.25rem .25rem 3rem ${ci["dark-250"]}`,toolbar:`0 -.625rem .625rem ${ci["dark-50"]}`,text:`0 0 .25rem ${ci["dark-250"]}`},timings:{fast:".1s",normal:".2s",slow:".3s"},easings:{linear:"linear"},focusOutline:{width:".2rem",color:ci["dark-400"]},iconSizes:{small:"0.75rem",medium:"1rem",large:"1.5rem"}},bu=MI(_C,{delimiter:"-"}),kC=Object.keys(bu).map(s=>_s(`:host { --${s}: ${bu[s]}; }`)),Oe=(s=>{const e=class extends s{firstUpdated(){LC().forEach(({load:n,font:o})=>{document.fonts.add(o),n&&o.load()})}};return e.styles=[(s==null?void 0:s.styles)??[],kC,at`
|
|
190
|
+
*/const Oh=(s,e,t)=>{const i=new Map;for(let r=e;r<=t;r++)i.set(s[r],r);return i},Uh=as(class extends Hs{constructor(s){if(super(s),s.type!==os.CHILD)throw Error("repeat() can only be used in text expressions")}dt(s,e,t){let i;t===void 0?t=e:e!==void 0&&(i=e);const r=[],n=[];let o=0;for(const a of s)r[o]=i?i(a,o):o,n[o]=t(a,o),o++;return{values:n,keys:r}}render(s,e,t){return this.dt(s,e,t).values}update(s,[e,t,i]){const r=od(s),{values:n,keys:o}=this.dt(e,t,i);if(!Array.isArray(r))return this.ut=o,n;const a=this.ut??(this.ut=[]),A=[];let l,c,h=0,u=r.length-1,d=0,g=n.length-1;for(;h<=u&&d<=g;)if(r[h]===null)h++;else if(r[u]===null)u--;else if(a[h]===o[d])A[d]=Hi(r[h],n[d]),h++,d++;else if(a[u]===o[g])A[g]=Hi(r[u],n[g]),u--,g--;else if(a[h]===o[g])A[g]=Hi(r[h],n[g]),Gs(s,A[g+1],r[h]),h++,g--;else if(a[u]===o[d])A[d]=Hi(r[u],n[d]),Gs(s,r[h],r[u]),u--,d++;else if(l===void 0&&(l=Oh(o,d,g),c=Oh(a,h,u)),l.has(a[h]))if(l.has(a[u])){const f=c.get(o[d]),p=f!==void 0?r[f]:null;if(p===null){const y=Gs(s,r[h]);Hi(y,n[d]),A[d]=y}else A[d]=Hi(p,n[d]),Gs(s,r[h],p),r[f]=null;d++}else eo(r[u]),u--;else eo(r[h]),h++;for(;d<=g;){const f=Gs(s,A[g+1]);Hi(f,n[d]),A[d++]=f}for(;h<=u;){const f=r[h++];f!==null&&eo(f)}return this.ut=o,nd(s,A),$t}});var Tt="top",Pt="bottom",Ot="right",xt="left",xa="auto",nr=[Tt,Pt,Ot,xt],vs="start",or="end",GI="clippingParents",Gh="viewport",ar="popper",HI="reference",Hh=nr.reduce(function(s,e){return s.concat([e+"-"+vs,e+"-"+or])},[]),$h=[].concat(nr,[xa]).reduce(function(s,e){return s.concat([e,e+"-"+vs,e+"-"+or])},[]),$I="beforeRead",YI="read",KI="afterRead",VI="beforeMain",JI="main",WI="afterMain",qI="beforeWrite",jI="write",XI="afterWrite",zI=[$I,YI,KI,VI,JI,WI,qI,jI,XI];function oi(s){return s?(s.nodeName||"").toLowerCase():null}function Lt(s){if(s==null)return window;if(s.toString()!=="[object Window]"){var e=s.ownerDocument;return e&&e.defaultView||window}return s}function Xi(s){var e=Lt(s).Element;return s instanceof e||s instanceof Element}function Ut(s){var e=Lt(s).HTMLElement;return s instanceof e||s instanceof HTMLElement}function Da(s){if(typeof ShadowRoot>"u")return!1;var e=Lt(s).ShadowRoot;return s instanceof e||s instanceof ShadowRoot}function ZI(s){var e=s.state;Object.keys(e.elements).forEach(function(t){var i=e.styles[t]||{},r=e.attributes[t]||{},n=e.elements[t];!Ut(n)||!oi(n)||(Object.assign(n.style,i),Object.keys(r).forEach(function(o){var a=r[o];a===!1?n.removeAttribute(o):n.setAttribute(o,a===!0?"":a)}))})}function em(s){var e=s.state,t={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,t.popper),e.styles=t,e.elements.arrow&&Object.assign(e.elements.arrow.style,t.arrow),function(){Object.keys(e.elements).forEach(function(i){var r=e.elements[i],n=e.attributes[i]||{},o=Object.keys(e.styles.hasOwnProperty(i)?e.styles[i]:t[i]),a=o.reduce(function(A,l){return A[l]="",A},{});!Ut(r)||!oi(r)||(Object.assign(r.style,a),Object.keys(n).forEach(function(A){r.removeAttribute(A)}))})}}const Yh={name:"applyStyles",enabled:!0,phase:"write",fn:ZI,effect:em,requires:["computeStyles"]};function ai(s){return s.split("-")[0]}var zi=Math.max,Dn=Math.min,Bs=Math.round;function La(){var s=navigator.userAgentData;return s!=null&&s.brands&&Array.isArray(s.brands)?s.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function Kh(){return!/^((?!chrome|android).)*safari/i.test(La())}function Qs(s,e,t){e===void 0&&(e=!1),t===void 0&&(t=!1);var i=s.getBoundingClientRect(),r=1,n=1;e&&Ut(s)&&(r=s.offsetWidth>0&&Bs(i.width)/s.offsetWidth||1,n=s.offsetHeight>0&&Bs(i.height)/s.offsetHeight||1);var o=Xi(s)?Lt(s):window,a=o.visualViewport,A=!Kh()&&t,l=(i.left+(A&&a?a.offsetLeft:0))/r,c=(i.top+(A&&a?a.offsetTop:0))/n,h=i.width/r,u=i.height/n;return{width:h,height:u,top:c,right:l+h,bottom:c+u,left:l,x:l,y:c}}function _a(s){var e=Qs(s),t=s.offsetWidth,i=s.offsetHeight;return Math.abs(e.width-t)<=1&&(t=e.width),Math.abs(e.height-i)<=1&&(i=e.height),{x:s.offsetLeft,y:s.offsetTop,width:t,height:i}}function Vh(s,e){var t=e.getRootNode&&e.getRootNode();if(s.contains(e))return!0;if(t&&Da(t)){var i=e;do{if(i&&s.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function Bi(s){return Lt(s).getComputedStyle(s)}function tm(s){return["table","td","th"].indexOf(oi(s))>=0}function ki(s){return((Xi(s)?s.ownerDocument:s.document)||window.document).documentElement}function Ln(s){return oi(s)==="html"?s:s.assignedSlot||s.parentNode||(Da(s)?s.host:null)||ki(s)}function Jh(s){return!Ut(s)||Bi(s).position==="fixed"?null:s.offsetParent}function im(s){var e=/firefox/i.test(La()),t=/Trident/i.test(La());if(t&&Ut(s)){var i=Bi(s);if(i.position==="fixed")return null}var r=Ln(s);for(Da(r)&&(r=r.host);Ut(r)&&["html","body"].indexOf(oi(r))<0;){var n=Bi(r);if(n.transform!=="none"||n.perspective!=="none"||n.contain==="paint"||["transform","perspective"].indexOf(n.willChange)!==-1||e&&n.willChange==="filter"||e&&n.filter&&n.filter!=="none")return r;r=r.parentNode}return null}function Ar(s){for(var e=Lt(s),t=Jh(s);t&&tm(t)&&Bi(t).position==="static";)t=Jh(t);return t&&(oi(t)==="html"||oi(t)==="body"&&Bi(t).position==="static")?e:t||im(s)||e}function ka(s){return["top","bottom"].indexOf(s)>=0?"x":"y"}function lr(s,e,t){return zi(s,Dn(e,t))}function sm(s,e,t){var i=lr(s,e,t);return i>t?t:i}function Wh(){return{top:0,right:0,bottom:0,left:0}}function qh(s){return Object.assign({},Wh(),s)}function jh(s,e){return e.reduce(function(t,i){return t[i]=s,t},{})}var rm=function(e,t){return e=typeof e=="function"?e(Object.assign({},t.rects,{placement:t.placement})):e,qh(typeof e!="number"?e:jh(e,nr))};function nm(s){var e,t=s.state,i=s.name,r=s.options,n=t.elements.arrow,o=t.modifiersData.popperOffsets,a=ai(t.placement),A=ka(a),l=[xt,Ot].indexOf(a)>=0,c=l?"height":"width";if(!(!n||!o)){var h=rm(r.padding,t),u=_a(n),d=A==="y"?Tt:xt,g=A==="y"?Pt:Ot,f=t.rects.reference[c]+t.rects.reference[A]-o[A]-t.rects.popper[c],p=o[A]-t.rects.reference[A],y=Ar(n),v=y?A==="y"?y.clientHeight||0:y.clientWidth||0:0,Q=f/2-p/2,C=h[d],w=v-u[c]-h[g],B=v/2-u[c]/2+Q,L=lr(C,B,w),_=A;t.modifiersData[i]=(e={},e[_]=L,e.centerOffset=L-B,e)}}function om(s){var e=s.state,t=s.options,i=t.element,r=i===void 0?"[data-popper-arrow]":i;r!=null&&(typeof r=="string"&&(r=e.elements.popper.querySelector(r),!r)||Vh(e.elements.popper,r)&&(e.elements.arrow=r))}const am={name:"arrow",enabled:!0,phase:"main",fn:nm,effect:om,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function bs(s){return s.split("-")[1]}var Am={top:"auto",right:"auto",bottom:"auto",left:"auto"};function lm(s,e){var t=s.x,i=s.y,r=e.devicePixelRatio||1;return{x:Bs(t*r)/r||0,y:Bs(i*r)/r||0}}function Xh(s){var e,t=s.popper,i=s.popperRect,r=s.placement,n=s.variation,o=s.offsets,a=s.position,A=s.gpuAcceleration,l=s.adaptive,c=s.roundOffsets,h=s.isFixed,u=o.x,d=u===void 0?0:u,g=o.y,f=g===void 0?0:g,p=typeof c=="function"?c({x:d,y:f}):{x:d,y:f};d=p.x,f=p.y;var y=o.hasOwnProperty("x"),v=o.hasOwnProperty("y"),Q=xt,C=Tt,w=window;if(l){var B=Ar(t),L="clientHeight",_="clientWidth";if(B===Lt(t)&&(B=ki(t),Bi(B).position!=="static"&&a==="absolute"&&(L="scrollHeight",_="scrollWidth")),B=B,r===Tt||(r===xt||r===Ot)&&n===or){C=Pt;var $=h&&B===w&&w.visualViewport?w.visualViewport.height:B[L];f-=$-i.height,f*=A?1:-1}if(r===xt||(r===Tt||r===Pt)&&n===or){Q=Ot;var F=h&&B===w&&w.visualViewport?w.visualViewport.width:B[_];d-=F-i.width,d*=A?1:-1}}var H=Object.assign({position:a},l&&Am),q=c===!0?lm({x:d,y:f},Lt(t)):{x:d,y:f};if(d=q.x,f=q.y,A){var Y;return Object.assign({},H,(Y={},Y[C]=v?"0":"",Y[Q]=y?"0":"",Y.transform=(w.devicePixelRatio||1)<=1?"translate("+d+"px, "+f+"px)":"translate3d("+d+"px, "+f+"px, 0)",Y))}return Object.assign({},H,(e={},e[C]=v?f+"px":"",e[Q]=y?d+"px":"",e.transform="",e))}function cm(s){var e=s.state,t=s.options,i=t.gpuAcceleration,r=i===void 0?!0:i,n=t.adaptive,o=n===void 0?!0:n,a=t.roundOffsets,A=a===void 0?!0:a,l={placement:ai(e.placement),variation:bs(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:r,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,Xh(Object.assign({},l,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:o,roundOffsets:A})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,Xh(Object.assign({},l,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:A})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const hm={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:cm,data:{}};var _n={passive:!0};function um(s){var e=s.state,t=s.instance,i=s.options,r=i.scroll,n=r===void 0?!0:r,o=i.resize,a=o===void 0?!0:o,A=Lt(e.elements.popper),l=[].concat(e.scrollParents.reference,e.scrollParents.popper);return n&&l.forEach(function(c){c.addEventListener("scroll",t.update,_n)}),a&&A.addEventListener("resize",t.update,_n),function(){n&&l.forEach(function(c){c.removeEventListener("scroll",t.update,_n)}),a&&A.removeEventListener("resize",t.update,_n)}}const dm={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:um,data:{}};var gm={left:"right",right:"left",bottom:"top",top:"bottom"};function kn(s){return s.replace(/left|right|bottom|top/g,function(e){return gm[e]})}var fm={start:"end",end:"start"};function zh(s){return s.replace(/start|end/g,function(e){return fm[e]})}function Fa(s){var e=Lt(s),t=e.pageXOffset,i=e.pageYOffset;return{scrollLeft:t,scrollTop:i}}function Na(s){return Qs(ki(s)).left+Fa(s).scrollLeft}function pm(s,e){var t=Lt(s),i=ki(s),r=t.visualViewport,n=i.clientWidth,o=i.clientHeight,a=0,A=0;if(r){n=r.width,o=r.height;var l=Kh();(l||!l&&e==="fixed")&&(a=r.offsetLeft,A=r.offsetTop)}return{width:n,height:o,x:a+Na(s),y:A}}function Em(s){var e,t=ki(s),i=Fa(s),r=(e=s.ownerDocument)==null?void 0:e.body,n=zi(t.scrollWidth,t.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),o=zi(t.scrollHeight,t.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),a=-i.scrollLeft+Na(s),A=-i.scrollTop;return Bi(r||t).direction==="rtl"&&(a+=zi(t.clientWidth,r?r.clientWidth:0)-n),{width:n,height:o,x:a,y:A}}function Ma(s){var e=Bi(s),t=e.overflow,i=e.overflowX,r=e.overflowY;return/auto|scroll|overlay|hidden/.test(t+r+i)}function Zh(s){return["html","body","#document"].indexOf(oi(s))>=0?s.ownerDocument.body:Ut(s)&&Ma(s)?s:Zh(Ln(s))}function cr(s,e){var t;e===void 0&&(e=[]);var i=Zh(s),r=i===((t=s.ownerDocument)==null?void 0:t.body),n=Lt(i),o=r?[n].concat(n.visualViewport||[],Ma(i)?i:[]):i,a=e.concat(o);return r?a:a.concat(cr(Ln(o)))}function Pa(s){return Object.assign({},s,{left:s.x,top:s.y,right:s.x+s.width,bottom:s.y+s.height})}function Im(s,e){var t=Qs(s,!1,e==="fixed");return t.top=t.top+s.clientTop,t.left=t.left+s.clientLeft,t.bottom=t.top+s.clientHeight,t.right=t.left+s.clientWidth,t.width=s.clientWidth,t.height=s.clientHeight,t.x=t.left,t.y=t.top,t}function eu(s,e,t){return e===Gh?Pa(pm(s,t)):Xi(e)?Im(e,t):Pa(Em(ki(s)))}function mm(s){var e=cr(Ln(s)),t=["absolute","fixed"].indexOf(Bi(s).position)>=0,i=t&&Ut(s)?Ar(s):s;return Xi(i)?e.filter(function(r){return Xi(r)&&Vh(r,i)&&oi(r)!=="body"}):[]}function Cm(s,e,t,i){var r=e==="clippingParents"?mm(s):[].concat(e),n=[].concat(r,[t]),o=n[0],a=n.reduce(function(A,l){var c=eu(s,l,i);return A.top=zi(c.top,A.top),A.right=Dn(c.right,A.right),A.bottom=Dn(c.bottom,A.bottom),A.left=zi(c.left,A.left),A},eu(s,o,i));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function tu(s){var e=s.reference,t=s.element,i=s.placement,r=i?ai(i):null,n=i?bs(i):null,o=e.x+e.width/2-t.width/2,a=e.y+e.height/2-t.height/2,A;switch(r){case Tt:A={x:o,y:e.y-t.height};break;case Pt:A={x:o,y:e.y+e.height};break;case Ot:A={x:e.x+e.width,y:a};break;case xt:A={x:e.x-t.width,y:a};break;default:A={x:e.x,y:e.y}}var l=r?ka(r):null;if(l!=null){var c=l==="y"?"height":"width";switch(n){case vs:A[l]=A[l]-(e[c]/2-t[c]/2);break;case or:A[l]=A[l]+(e[c]/2-t[c]/2);break}}return A}function hr(s,e){e===void 0&&(e={});var t=e,i=t.placement,r=i===void 0?s.placement:i,n=t.strategy,o=n===void 0?s.strategy:n,a=t.boundary,A=a===void 0?GI:a,l=t.rootBoundary,c=l===void 0?Gh:l,h=t.elementContext,u=h===void 0?ar:h,d=t.altBoundary,g=d===void 0?!1:d,f=t.padding,p=f===void 0?0:f,y=qh(typeof p!="number"?p:jh(p,nr)),v=u===ar?HI:ar,Q=s.rects.popper,C=s.elements[g?v:u],w=Cm(Xi(C)?C:C.contextElement||ki(s.elements.popper),A,c,o),B=Qs(s.elements.reference),L=tu({reference:B,element:Q,strategy:"absolute",placement:r}),_=Pa(Object.assign({},Q,L)),$=u===ar?_:B,F={top:w.top-$.top+y.top,bottom:$.bottom-w.bottom+y.bottom,left:w.left-$.left+y.left,right:$.right-w.right+y.right},H=s.modifiersData.offset;if(u===ar&&H){var q=H[r];Object.keys(F).forEach(function(Y){var z=[Ot,Pt].indexOf(Y)>=0?1:-1,S=[Tt,Pt].indexOf(Y)>=0?"y":"x";F[Y]+=q[S]*z})}return F}function ym(s,e){e===void 0&&(e={});var t=e,i=t.placement,r=t.boundary,n=t.rootBoundary,o=t.padding,a=t.flipVariations,A=t.allowedAutoPlacements,l=A===void 0?$h:A,c=bs(i),h=c?a?Hh:Hh.filter(function(g){return bs(g)===c}):nr,u=h.filter(function(g){return l.indexOf(g)>=0});u.length===0&&(u=h);var d=u.reduce(function(g,f){return g[f]=hr(s,{placement:f,boundary:r,rootBoundary:n,padding:o})[ai(f)],g},{});return Object.keys(d).sort(function(g,f){return d[g]-d[f]})}function vm(s){if(ai(s)===xa)return[];var e=kn(s);return[zh(s),e,zh(e)]}function Bm(s){var e=s.state,t=s.options,i=s.name;if(!e.modifiersData[i]._skip){for(var r=t.mainAxis,n=r===void 0?!0:r,o=t.altAxis,a=o===void 0?!0:o,A=t.fallbackPlacements,l=t.padding,c=t.boundary,h=t.rootBoundary,u=t.altBoundary,d=t.flipVariations,g=d===void 0?!0:d,f=t.allowedAutoPlacements,p=e.options.placement,y=ai(p),v=y===p,Q=A||(v||!g?[kn(p)]:vm(p)),C=[p].concat(Q).reduce(function(se,ce){return se.concat(ai(ce)===xa?ym(e,{placement:ce,boundary:c,rootBoundary:h,padding:l,flipVariations:g,allowedAutoPlacements:f}):ce)},[]),w=e.rects.reference,B=e.rects.popper,L=new Map,_=!0,$=C[0],F=0;F<C.length;F++){var H=C[F],q=ai(H),Y=bs(H)===vs,z=[Tt,Pt].indexOf(q)>=0,S=z?"width":"height",T=hr(e,{placement:H,boundary:c,rootBoundary:h,altBoundary:u,padding:l}),U=z?Y?Ot:xt:Y?Pt:Tt;w[S]>B[S]&&(U=kn(U));var b=kn(U),R=[];if(n&&R.push(T[q]<=0),a&&R.push(T[U]<=0,T[b]<=0),R.every(function(se){return se})){$=H,_=!1;break}L.set(H,R)}if(_)for(var x=g?3:1,V=function(ce){var Ae=C.find(function(ye){var Ee=L.get(ye);if(Ee)return Ee.slice(0,ce).every(function(Re){return Re})});if(Ae)return $=Ae,"break"},O=x;O>0;O--){var j=V(O);if(j==="break")break}e.placement!==$&&(e.modifiersData[i]._skip=!0,e.placement=$,e.reset=!0)}}const Qm={name:"flip",enabled:!0,phase:"main",fn:Bm,requiresIfExists:["offset"],data:{_skip:!1}};function iu(s,e,t){return t===void 0&&(t={x:0,y:0}),{top:s.top-e.height-t.y,right:s.right-e.width+t.x,bottom:s.bottom-e.height+t.y,left:s.left-e.width-t.x}}function su(s){return[Tt,Ot,Pt,xt].some(function(e){return s[e]>=0})}function bm(s){var e=s.state,t=s.name,i=e.rects.reference,r=e.rects.popper,n=e.modifiersData.preventOverflow,o=hr(e,{elementContext:"reference"}),a=hr(e,{altBoundary:!0}),A=iu(o,i),l=iu(a,r,n),c=su(A),h=su(l);e.modifiersData[t]={referenceClippingOffsets:A,popperEscapeOffsets:l,isReferenceHidden:c,hasPopperEscaped:h},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":c,"data-popper-escaped":h})}const Sm={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:bm};function wm(s,e,t){var i=ai(s),r=[xt,Tt].indexOf(i)>=0?-1:1,n=typeof t=="function"?t(Object.assign({},e,{placement:s})):t,o=n[0],a=n[1];return o=o||0,a=(a||0)*r,[xt,Ot].indexOf(i)>=0?{x:a,y:o}:{x:o,y:a}}function Rm(s){var e=s.state,t=s.options,i=s.name,r=t.offset,n=r===void 0?[0,0]:r,o=$h.reduce(function(c,h){return c[h]=wm(h,e.rects,n),c},{}),a=o[e.placement],A=a.x,l=a.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=A,e.modifiersData.popperOffsets.y+=l),e.modifiersData[i]=o}const Tm={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Rm};function xm(s){var e=s.state,t=s.name;e.modifiersData[t]=tu({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const Dm={name:"popperOffsets",enabled:!0,phase:"read",fn:xm,data:{}};function Lm(s){return s==="x"?"y":"x"}function _m(s){var e=s.state,t=s.options,i=s.name,r=t.mainAxis,n=r===void 0?!0:r,o=t.altAxis,a=o===void 0?!1:o,A=t.boundary,l=t.rootBoundary,c=t.altBoundary,h=t.padding,u=t.tether,d=u===void 0?!0:u,g=t.tetherOffset,f=g===void 0?0:g,p=hr(e,{boundary:A,rootBoundary:l,padding:h,altBoundary:c}),y=ai(e.placement),v=bs(e.placement),Q=!v,C=ka(y),w=Lm(C),B=e.modifiersData.popperOffsets,L=e.rects.reference,_=e.rects.popper,$=typeof f=="function"?f(Object.assign({},e.rects,{placement:e.placement})):f,F=typeof $=="number"?{mainAxis:$,altAxis:$}:Object.assign({mainAxis:0,altAxis:0},$),H=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,q={x:0,y:0};if(B){if(n){var Y,z=C==="y"?Tt:xt,S=C==="y"?Pt:Ot,T=C==="y"?"height":"width",U=B[C],b=U+p[z],R=U-p[S],x=d?-_[T]/2:0,V=v===vs?L[T]:_[T],O=v===vs?-_[T]:-L[T],j=e.elements.arrow,se=d&&j?_a(j):{width:0,height:0},ce=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:Wh(),Ae=ce[z],ye=ce[S],Ee=lr(0,L[T],se[T]),Re=Q?L[T]/2-x-Ee-Ae-F.mainAxis:V-Ee-Ae-F.mainAxis,ne=Q?-L[T]/2+x+Ee+ye+F.mainAxis:O+Ee+ye+F.mainAxis,ue=e.elements.arrow&&Ar(e.elements.arrow),Se=ue?C==="y"?ue.clientTop||0:ue.clientLeft||0:0,Ce=(Y=H==null?void 0:H[C])!=null?Y:0,he=U+Re-Ce-Se,te=U+ne-Ce,Be=lr(d?Dn(b,he):b,U,d?zi(R,te):R);B[C]=Be,q[C]=Be-U}if(a){var De,Fe=C==="x"?Tt:xt,Te=C==="x"?Pt:Ot,Me=B[w],Ne=w==="y"?"height":"width",ve=Me+p[Fe],Ve=Me-p[Te],Xe=[Tt,xt].indexOf(y)!==-1,nt=(De=H==null?void 0:H[w])!=null?De:0,Je=Xe?ve:Me-L[Ne]-_[Ne]-nt+F.altAxis,yt=Xe?Me+L[Ne]+_[Ne]-nt-F.altAxis:Ve,Qi=d&&Xe?sm(Je,Me,yt):lr(d?Je:ve,Me,d?yt:Ve);B[w]=Qi,q[w]=Qi-Me}e.modifiersData[i]=q}}const km={name:"preventOverflow",enabled:!0,phase:"main",fn:_m,requiresIfExists:["offset"]};function Fm(s){return{scrollLeft:s.scrollLeft,scrollTop:s.scrollTop}}function Nm(s){return s===Lt(s)||!Ut(s)?Fa(s):Fm(s)}function Mm(s){var e=s.getBoundingClientRect(),t=Bs(e.width)/s.offsetWidth||1,i=Bs(e.height)/s.offsetHeight||1;return t!==1||i!==1}function Pm(s,e,t){t===void 0&&(t=!1);var i=Ut(e),r=Ut(e)&&Mm(e),n=ki(e),o=Qs(s,r,t),a={scrollLeft:0,scrollTop:0},A={x:0,y:0};return(i||!i&&!t)&&((oi(e)!=="body"||Ma(n))&&(a=Nm(e)),Ut(e)?(A=Qs(e,!0),A.x+=e.clientLeft,A.y+=e.clientTop):n&&(A.x=Na(n))),{x:o.left+a.scrollLeft-A.x,y:o.top+a.scrollTop-A.y,width:o.width,height:o.height}}function Om(s){var e=new Map,t=new Set,i=[];s.forEach(function(n){e.set(n.name,n)});function r(n){t.add(n.name);var o=[].concat(n.requires||[],n.requiresIfExists||[]);o.forEach(function(a){if(!t.has(a)){var A=e.get(a);A&&r(A)}}),i.push(n)}return s.forEach(function(n){t.has(n.name)||r(n)}),i}function Um(s){var e=Om(s);return zI.reduce(function(t,i){return t.concat(e.filter(function(r){return r.phase===i}))},[])}function Gm(s){var e;return function(){return e||(e=new Promise(function(t){Promise.resolve().then(function(){e=void 0,t(s())})})),e}}function Hm(s){var e=s.reduce(function(t,i){var r=t[i.name];return t[i.name]=r?Object.assign({},r,i,{options:Object.assign({},r.options,i.options),data:Object.assign({},r.data,i.data)}):i,t},{});return Object.keys(e).map(function(t){return e[t]})}var ru={placement:"bottom",modifiers:[],strategy:"absolute"};function nu(){for(var s=arguments.length,e=new Array(s),t=0;t<s;t++)e[t]=arguments[t];return!e.some(function(i){return!(i&&typeof i.getBoundingClientRect=="function")})}function $m(s){s===void 0&&(s={});var e=s,t=e.defaultModifiers,i=t===void 0?[]:t,r=e.defaultOptions,n=r===void 0?ru:r;return function(a,A,l){l===void 0&&(l=n);var c={placement:"bottom",orderedModifiers:[],options:Object.assign({},ru,n),modifiersData:{},elements:{reference:a,popper:A},attributes:{},styles:{}},h=[],u=!1,d={state:c,setOptions:function(y){var v=typeof y=="function"?y(c.options):y;f(),c.options=Object.assign({},n,c.options,v),c.scrollParents={reference:Xi(a)?cr(a):a.contextElement?cr(a.contextElement):[],popper:cr(A)};var Q=Um(Hm([].concat(i,c.options.modifiers)));return c.orderedModifiers=Q.filter(function(C){return C.enabled}),g(),d.update()},forceUpdate:function(){if(!u){var y=c.elements,v=y.reference,Q=y.popper;if(nu(v,Q)){c.rects={reference:Pm(v,Ar(Q),c.options.strategy==="fixed"),popper:_a(Q)},c.reset=!1,c.placement=c.options.placement,c.orderedModifiers.forEach(function(F){return c.modifiersData[F.name]=Object.assign({},F.data)});for(var C=0;C<c.orderedModifiers.length;C++){if(c.reset===!0){c.reset=!1,C=-1;continue}var w=c.orderedModifiers[C],B=w.fn,L=w.options,_=L===void 0?{}:L,$=w.name;typeof B=="function"&&(c=B({state:c,options:_,name:$,instance:d})||c)}}}},update:Gm(function(){return new Promise(function(p){d.forceUpdate(),p(c)})}),destroy:function(){f(),u=!0}};if(!nu(a,A))return d;d.setOptions(l).then(function(p){!u&&l.onFirstUpdate&&l.onFirstUpdate(p)});function g(){c.orderedModifiers.forEach(function(p){var y=p.name,v=p.options,Q=v===void 0?{}:v,C=p.effect;if(typeof C=="function"){var w=C({state:c,name:y,instance:d,options:Q}),B=function(){};h.push(w||B)}})}function f(){h.forEach(function(p){return p()}),h=[]}return d}}var Ym=[dm,Dm,hm,Yh,Tm,Qm,km,am,Sm],Km=$m({defaultModifiers:Ym}),Vm="tippy-box",ou="tippy-content",Jm="tippy-backdrop",au="tippy-arrow",Au="tippy-svg-arrow",Zi={passive:!0,capture:!0},lu=function(){return document.body};function Oa(s,e,t){if(Array.isArray(s)){var i=s[e];return i??(Array.isArray(t)?t[e]:t)}return s}function Ua(s,e){var t={}.toString.call(s);return t.indexOf("[object")===0&&t.indexOf(e+"]")>-1}function cu(s,e){return typeof s=="function"?s.apply(void 0,e):s}function hu(s,e){if(e===0)return s;var t;return function(i){clearTimeout(t),t=setTimeout(function(){s(i)},e)}}function Wm(s){return s.split(/\s+/).filter(Boolean)}function Ss(s){return[].concat(s)}function uu(s,e){s.indexOf(e)===-1&&s.push(e)}function qm(s){return s.filter(function(e,t){return s.indexOf(e)===t})}function jm(s){return s.split("-")[0]}function Fn(s){return[].slice.call(s)}function du(s){return Object.keys(s).reduce(function(e,t){return s[t]!==void 0&&(e[t]=s[t]),e},{})}function ur(){return document.createElement("div")}function Nn(s){return["Element","Fragment"].some(function(e){return Ua(s,e)})}function Xm(s){return Ua(s,"NodeList")}function zm(s){return Ua(s,"MouseEvent")}function Zm(s){return!!(s&&s._tippy&&s._tippy.reference===s)}function eC(s){return Nn(s)?[s]:Xm(s)?Fn(s):Array.isArray(s)?s:Fn(document.querySelectorAll(s))}function Ga(s,e){s.forEach(function(t){t&&(t.style.transitionDuration=e+"ms")})}function gu(s,e){s.forEach(function(t){t&&t.setAttribute("data-state",e)})}function tC(s){var e,t=Ss(s),i=t[0];return i!=null&&(e=i.ownerDocument)!=null&&e.body?i.ownerDocument:document}function iC(s,e){var t=e.clientX,i=e.clientY;return s.every(function(r){var n=r.popperRect,o=r.popperState,a=r.props,A=a.interactiveBorder,l=jm(o.placement),c=o.modifiersData.offset;if(!c)return!0;var h=l==="bottom"?c.top.y:0,u=l==="top"?c.bottom.y:0,d=l==="right"?c.left.x:0,g=l==="left"?c.right.x:0,f=n.top-i+h>A,p=i-n.bottom-u>A,y=n.left-t+d>A,v=t-n.right-g>A;return f||p||y||v})}function Ha(s,e,t){var i=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(r){s[i](r,t)})}function fu(s,e){for(var t=e;t;){var i;if(s.contains(t))return!0;t=t.getRootNode==null||(i=t.getRootNode())==null?void 0:i.host}return!1}var Ai={isTouch:!1},pu=0;function sC(){Ai.isTouch||(Ai.isTouch=!0,window.performance&&document.addEventListener("mousemove",Eu))}function Eu(){var s=performance.now();s-pu<20&&(Ai.isTouch=!1,document.removeEventListener("mousemove",Eu)),pu=s}function rC(){var s=document.activeElement;if(Zm(s)){var e=s._tippy;s.blur&&!e.state.isVisible&&s.blur()}}function nC(){document.addEventListener("touchstart",sC,Zi),window.addEventListener("blur",rC)}var oC=typeof window<"u"&&typeof document<"u",aC=oC?!!window.msCrypto:!1,AC={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},lC={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},Wt=Object.assign({appendTo:lu,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},AC,lC),cC=Object.keys(Wt),hC=function(e){var t=Object.keys(e);t.forEach(function(i){Wt[i]=e[i]})};function Iu(s){var e=s.plugins||[],t=e.reduce(function(i,r){var n=r.name,o=r.defaultValue;if(n){var a;i[n]=s[n]!==void 0?s[n]:(a=Wt[n])!=null?a:o}return i},{});return Object.assign({},s,t)}function uC(s,e){var t=e?Object.keys(Iu(Object.assign({},Wt,{plugins:e}))):cC,i=t.reduce(function(r,n){var o=(s.getAttribute("data-tippy-"+n)||"").trim();if(!o)return r;if(n==="content")r[n]=o;else try{r[n]=JSON.parse(o)}catch{r[n]=o}return r},{});return i}function mu(s,e){var t=Object.assign({},e,{content:cu(e.content,[s])},e.ignoreAttributes?{}:uC(s,e.plugins));return t.aria=Object.assign({},Wt.aria,t.aria),t.aria={expanded:t.aria.expanded==="auto"?e.interactive:t.aria.expanded,content:t.aria.content==="auto"?e.interactive?null:"describedby":t.aria.content},t}var dC=function(){return"innerHTML"};function $a(s,e){s[dC()]=e}function Cu(s){var e=ur();return s===!0?e.className=au:(e.className=Au,Nn(s)?e.appendChild(s):$a(e,s)),e}function yu(s,e){Nn(e.content)?($a(s,""),s.appendChild(e.content)):typeof e.content!="function"&&(e.allowHTML?$a(s,e.content):s.textContent=e.content)}function Ya(s){var e=s.firstElementChild,t=Fn(e.children);return{box:e,content:t.find(function(i){return i.classList.contains(ou)}),arrow:t.find(function(i){return i.classList.contains(au)||i.classList.contains(Au)}),backdrop:t.find(function(i){return i.classList.contains(Jm)})}}function vu(s){var e=ur(),t=ur();t.className=Vm,t.setAttribute("data-state","hidden"),t.setAttribute("tabindex","-1");var i=ur();i.className=ou,i.setAttribute("data-state","hidden"),yu(i,s.props),e.appendChild(t),t.appendChild(i),r(s.props,s.props);function r(n,o){var a=Ya(e),A=a.box,l=a.content,c=a.arrow;o.theme?A.setAttribute("data-theme",o.theme):A.removeAttribute("data-theme"),typeof o.animation=="string"?A.setAttribute("data-animation",o.animation):A.removeAttribute("data-animation"),o.inertia?A.setAttribute("data-inertia",""):A.removeAttribute("data-inertia"),A.style.maxWidth=typeof o.maxWidth=="number"?o.maxWidth+"px":o.maxWidth,o.role?A.setAttribute("role",o.role):A.removeAttribute("role"),(n.content!==o.content||n.allowHTML!==o.allowHTML)&&yu(l,s.props),o.arrow?c?n.arrow!==o.arrow&&(A.removeChild(c),A.appendChild(Cu(o.arrow))):A.appendChild(Cu(o.arrow)):c&&A.removeChild(c)}return{popper:e,onUpdate:r}}vu.$$tippy=!0;var gC=1,Mn=[],Ka=[];function fC(s,e){var t=mu(s,Object.assign({},Wt,Iu(du(e)))),i,r,n,o=!1,a=!1,A=!1,l=!1,c,h,u,d=[],g=hu(he,t.interactiveDebounce),f,p=gC++,y=null,v=qm(t.plugins),Q={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},C={id:p,reference:s,popper:ur(),popperInstance:y,props:t,state:Q,plugins:v,clearDelayTimeouts:Je,setProps:yt,setContent:Qi,show:vt,hide:hi,hideWithInteractivity:ui,enable:Xe,disable:nt,unmount:di,destroy:It};if(!t.render)return C;var w=t.render(C),B=w.popper,L=w.onUpdate;B.setAttribute("data-tippy-root",""),B.id="tippy-"+C.id,C.popper=B,s._tippy=C,B._tippy=C;var _=v.map(function(K){return K.fn(C)}),$=s.hasAttribute("aria-expanded");return ue(),x(),U(),b("onCreate",[C]),t.showOnCreate&&ve(),B.addEventListener("mouseenter",function(){C.props.interactive&&C.state.isVisible&&C.clearDelayTimeouts()}),B.addEventListener("mouseleave",function(){C.props.interactive&&C.props.trigger.indexOf("mouseenter")>=0&&z().addEventListener("mousemove",g)}),C;function F(){var K=C.props.touch;return Array.isArray(K)?K:[K,0]}function H(){return F()[0]==="hold"}function q(){var K;return!!((K=C.props.render)!=null&&K.$$tippy)}function Y(){return f||s}function z(){var K=Y().parentNode;return K?tC(K):document}function S(){return Ya(B)}function T(K){return C.state.isMounted&&!C.state.isVisible||Ai.isTouch||c&&c.type==="focus"?0:Oa(C.props.delay,K?0:1,Wt.delay)}function U(K){K===void 0&&(K=!1),B.style.pointerEvents=C.props.interactive&&!K?"":"none",B.style.zIndex=""+C.props.zIndex}function b(K,le,fe){if(fe===void 0&&(fe=!0),_.forEach(function(we){we[K]&&we[K].apply(we,le)}),fe){var Le;(Le=C.props)[K].apply(Le,le)}}function R(){var K=C.props.aria;if(K.content){var le="aria-"+K.content,fe=B.id,Le=Ss(C.props.triggerTarget||s);Le.forEach(function(we){var We=we.getAttribute(le);if(C.state.isVisible)we.setAttribute(le,We?We+" "+fe:fe);else{var Bt=We&&We.replace(fe,"").trim();Bt?we.setAttribute(le,Bt):we.removeAttribute(le)}})}}function x(){if(!($||!C.props.aria.expanded)){var K=Ss(C.props.triggerTarget||s);K.forEach(function(le){C.props.interactive?le.setAttribute("aria-expanded",C.state.isVisible&&le===Y()?"true":"false"):le.removeAttribute("aria-expanded")})}}function V(){z().removeEventListener("mousemove",g),Mn=Mn.filter(function(K){return K!==g})}function O(K){if(!(Ai.isTouch&&(A||K.type==="mousedown"))){var le=K.composedPath&&K.composedPath()[0]||K.target;if(!(C.props.interactive&&fu(B,le))){if(Ss(C.props.triggerTarget||s).some(function(fe){return fu(fe,le)})){if(Ai.isTouch||C.state.isVisible&&C.props.trigger.indexOf("click")>=0)return}else b("onClickOutside",[C,K]);C.props.hideOnClick===!0&&(C.clearDelayTimeouts(),C.hide(),a=!0,setTimeout(function(){a=!1}),C.state.isMounted||Ae())}}}function j(){A=!0}function se(){A=!1}function ce(){var K=z();K.addEventListener("mousedown",O,!0),K.addEventListener("touchend",O,Zi),K.addEventListener("touchstart",se,Zi),K.addEventListener("touchmove",j,Zi)}function Ae(){var K=z();K.removeEventListener("mousedown",O,!0),K.removeEventListener("touchend",O,Zi),K.removeEventListener("touchstart",se,Zi),K.removeEventListener("touchmove",j,Zi)}function ye(K,le){Re(K,function(){!C.state.isVisible&&B.parentNode&&B.parentNode.contains(B)&&le()})}function Ee(K,le){Re(K,le)}function Re(K,le){var fe=S().box;function Le(we){we.target===fe&&(Ha(fe,"remove",Le),le())}if(K===0)return le();Ha(fe,"remove",h),Ha(fe,"add",Le),h=Le}function ne(K,le,fe){fe===void 0&&(fe=!1);var Le=Ss(C.props.triggerTarget||s);Le.forEach(function(we){we.addEventListener(K,le,fe),d.push({node:we,eventType:K,handler:le,options:fe})})}function ue(){H()&&(ne("touchstart",Ce,{passive:!0}),ne("touchend",te,{passive:!0})),Wm(C.props.trigger).forEach(function(K){if(K!=="manual")switch(ne(K,Ce),K){case"mouseenter":ne("mouseleave",te);break;case"focus":ne(aC?"focusout":"blur",Be);break;case"focusin":ne("focusout",Be);break}})}function Se(){d.forEach(function(K){var le=K.node,fe=K.eventType,Le=K.handler,we=K.options;le.removeEventListener(fe,Le,we)}),d=[]}function Ce(K){var le,fe=!1;if(!(!C.state.isEnabled||De(K)||a)){var Le=((le=c)==null?void 0:le.type)==="focus";c=K,f=K.currentTarget,x(),!C.state.isVisible&&zm(K)&&Mn.forEach(function(we){return we(K)}),K.type==="click"&&(C.props.trigger.indexOf("mouseenter")<0||o)&&C.props.hideOnClick!==!1&&C.state.isVisible?fe=!0:ve(K),K.type==="click"&&(o=!fe),fe&&!Le&&Ve(K)}}function he(K){var le=K.target,fe=Y().contains(le)||B.contains(le);if(!(K.type==="mousemove"&&fe)){var Le=Ne().concat(B).map(function(we){var We,Bt=we._tippy,Qt=(We=Bt.popperInstance)==null?void 0:We.state;return Qt?{popperRect:we.getBoundingClientRect(),popperState:Qt,props:t}:null}).filter(Boolean);iC(Le,K)&&(V(),Ve(K))}}function te(K){var le=De(K)||C.props.trigger.indexOf("click")>=0&&o;if(!le){if(C.props.interactive){C.hideWithInteractivity(K);return}Ve(K)}}function Be(K){C.props.trigger.indexOf("focusin")<0&&K.target!==Y()||C.props.interactive&&K.relatedTarget&&B.contains(K.relatedTarget)||Ve(K)}function De(K){return Ai.isTouch?H()!==K.type.indexOf("touch")>=0:!1}function Fe(){Te();var K=C.props,le=K.popperOptions,fe=K.placement,Le=K.offset,we=K.getReferenceClientRect,We=K.moveTransition,Bt=q()?Ya(B).arrow:null,Qt=we?{getBoundingClientRect:we,contextElement:we.contextElement||Y()}:s,xs={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(Ds){var Mi=Ds.state;if(q()){var mr=S(),Cr=mr.box;["placement","reference-hidden","escaped"].forEach(function(Ls){Ls==="placement"?Cr.setAttribute("data-placement",Mi.placement):Mi.attributes.popper["data-popper-"+Ls]?Cr.setAttribute("data-"+Ls,""):Cr.removeAttribute("data-"+Ls)}),Mi.attributes.popper={}}}},bt=[{name:"offset",options:{offset:Le}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!We}},xs];q()&&Bt&&bt.push({name:"arrow",options:{element:Bt,padding:3}}),bt.push.apply(bt,(le==null?void 0:le.modifiers)||[]),C.popperInstance=Km(Qt,B,Object.assign({},le,{placement:fe,onFirstUpdate:u,modifiers:bt}))}function Te(){C.popperInstance&&(C.popperInstance.destroy(),C.popperInstance=null)}function Me(){var K=C.props.appendTo,le,fe=Y();C.props.interactive&&K===lu||K==="parent"?le=fe.parentNode:le=cu(K,[fe]),le.contains(B)||le.appendChild(B),C.state.isMounted=!0,Fe()}function Ne(){return Fn(B.querySelectorAll("[data-tippy-root]"))}function ve(K){C.clearDelayTimeouts(),K&&b("onTrigger",[C,K]),ce();var le=T(!0),fe=F(),Le=fe[0],we=fe[1];Ai.isTouch&&Le==="hold"&&we&&(le=we),le?i=setTimeout(function(){C.show()},le):C.show()}function Ve(K){if(C.clearDelayTimeouts(),b("onUntrigger",[C,K]),!C.state.isVisible){Ae();return}if(!(C.props.trigger.indexOf("mouseenter")>=0&&C.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(K.type)>=0&&o)){var le=T(!1);le?r=setTimeout(function(){C.state.isVisible&&C.hide()},le):n=requestAnimationFrame(function(){C.hide()})}}function Xe(){C.state.isEnabled=!0}function nt(){C.hide(),C.state.isEnabled=!1}function Je(){clearTimeout(i),clearTimeout(r),cancelAnimationFrame(n)}function yt(K){if(!C.state.isDestroyed){b("onBeforeUpdate",[C,K]),Se();var le=C.props,fe=mu(s,Object.assign({},le,du(K),{ignoreAttributes:!0}));C.props=fe,ue(),le.interactiveDebounce!==fe.interactiveDebounce&&(V(),g=hu(he,fe.interactiveDebounce)),le.triggerTarget&&!fe.triggerTarget?Ss(le.triggerTarget).forEach(function(Le){Le.removeAttribute("aria-expanded")}):fe.triggerTarget&&s.removeAttribute("aria-expanded"),x(),U(),L&&L(le,fe),C.popperInstance&&(Fe(),Ne().forEach(function(Le){requestAnimationFrame(Le._tippy.popperInstance.forceUpdate)})),b("onAfterUpdate",[C,K])}}function Qi(K){C.setProps({content:K})}function vt(){var K=C.state.isVisible,le=C.state.isDestroyed,fe=!C.state.isEnabled,Le=Ai.isTouch&&!C.props.touch,we=Oa(C.props.duration,0,Wt.duration);if(!(K||le||fe||Le)&&!Y().hasAttribute("disabled")&&(b("onShow",[C],!1),C.props.onShow(C)!==!1)){if(C.state.isVisible=!0,q()&&(B.style.visibility="visible"),U(),ce(),C.state.isMounted||(B.style.transition="none"),q()){var We=S(),Bt=We.box,Qt=We.content;Ga([Bt,Qt],0)}u=function(){var bt;if(!(!C.state.isVisible||l)){if(l=!0,B.offsetHeight,B.style.transition=C.props.moveTransition,q()&&C.props.animation){var ss=S(),Ds=ss.box,Mi=ss.content;Ga([Ds,Mi],we),gu([Ds,Mi],"visible")}R(),x(),uu(Ka,C),(bt=C.popperInstance)==null||bt.forceUpdate(),b("onMount",[C]),C.props.animation&&q()&&Ee(we,function(){C.state.isShown=!0,b("onShown",[C])})}},Me()}}function hi(){var K=!C.state.isVisible,le=C.state.isDestroyed,fe=!C.state.isEnabled,Le=Oa(C.props.duration,1,Wt.duration);if(!(K||le||fe)&&(b("onHide",[C],!1),C.props.onHide(C)!==!1)){if(C.state.isVisible=!1,C.state.isShown=!1,l=!1,o=!1,q()&&(B.style.visibility="hidden"),V(),Ae(),U(!0),q()){var we=S(),We=we.box,Bt=we.content;C.props.animation&&(Ga([We,Bt],Le),gu([We,Bt],"hidden"))}R(),x(),C.props.animation?q()&&ye(Le,C.unmount):C.unmount()}}function ui(K){z().addEventListener("mousemove",g),uu(Mn,g),g(K)}function di(){C.state.isVisible&&C.hide(),C.state.isMounted&&(Te(),Ne().forEach(function(K){K._tippy.unmount()}),B.parentNode&&B.parentNode.removeChild(B),Ka=Ka.filter(function(K){return K!==C}),C.state.isMounted=!1,b("onHidden",[C]))}function It(){C.state.isDestroyed||(C.clearDelayTimeouts(),C.unmount(),Se(),delete s._tippy,C.state.isDestroyed=!0,b("onDestroy",[C]))}}function es(s,e){e===void 0&&(e={});var t=Wt.plugins.concat(e.plugins||[]);nC();var i=Object.assign({},e,{plugins:t}),r=eC(s),n=r.reduce(function(o,a){var A=a&&fC(a,i);return A&&o.push(A),o},[]);return Nn(s)?n[0]:n}es.defaultProps=Wt,es.setDefaultProps=hC,es.currentInput=Ai,Object.assign({},Yh,{effect:function(e){var t=e.state,i={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(t.elements.popper.style,i.popper),t.styles=i,t.elements.arrow&&Object.assign(t.elements.arrow.style,i.arrow)}}),es.setDefaultProps({render:vu});class pC{constructor(){this.currentTask=null,this.nextTask=null}async enqueue(e){this.nextTask=async()=>{await e()},this.currentTask||this.runNext()}async runNext(){if(!this.nextTask){this.currentTask=null;return}const e=this.nextTask;this.nextTask=null,this.currentTask=e().finally(()=>this.runNext())}}class li extends Error{constructor(e,t=new Error,i=!1){super(),this.fatal=!1,this.fatal=i,this.stack=t.stack,this.message=[e,t.message].filter(Boolean).join(" - ")}}const EC=5;function IC(s,e){const t=s.map(({id:r})=>r).join("|"),i=e.map(({id:r})=>r).join("|");return t===i}class mC{constructor(e){this._caption="",this._currentTime=0,this._activeScenes=[],this._upcomingScenes=[],this._limitedQueue=new pC,this._canvas=dt(),this._controls=dt(),this.host=e}set activeScenes(e){IC(e,this._activeScenes)||(this._activeScenes=e,this.host.dispatchEvent(new CustomEvent("scenechange",{detail:e})),this.host.requestUpdate())}get activeScenes(){return this._activeScenes}set currentTime(e){var t,i,r,n,o;const a=Math.min(this.host.duration,Math.max(0,e));this.activeScenes=((t=this.host.scenes)==null?void 0:t.filter(({start:h,duration:u})=>a>=h&&a<h+u))??[];const A=a!==this.currentTime;this._currentTime=a,this._upcomingScenes=((i=this.host.scenes)==null?void 0:i.filter(({start:h})=>a>=h-EC&&a<h))??[],this.loadScenes(),this.syncVideoState(),(r=this._controls.value)==null||r.setAttribute("currentTime",a.toString());const l=this.activeScenes[0],c=Cl((n=l==null?void 0:l.videoMeta)==null?void 0:n.captions);this.caption=((o=c.find(({start:h,end:u})=>{var d;const g=a-l.start+(((d=l.videoMeta)==null?void 0:d.start)??0);return h&&u&&g>=Wr(h)&&g<=Wr(u)}))==null?void 0:o.text)??"",A&&this.host.dispatchEvent(new CustomEvent("timeupdate",{detail:a})),this.draw(a)}get currentTime(){return this._currentTime}set caption(e){e!==this._caption&&(this._caption=e,this.host.requestUpdate())}get caption(){return this._caption}canvas(){return gt(this._canvas)}controls(){return gt(this._controls)}loadScenes(){[...this.activeScenes,...this._upcomingScenes].forEach(e=>{var t,i,r;const{start:n,duration:o,video:a,videoMeta:A}=e,l=this.host.currentTime>0||this.host.preload==="auto"||!this.host.paused;if(a&&A){const{key:c,hls:h,node:u}=a,{start:d,duration:g}=A,f=this.host.videoState[c];u&&f&&(u.currentTime>=d+g||u.ended||l&&(h?(t=h.startLoadOnce)==null||t.call(h,d):f.initialised||(i=u.startLoadOnce)==null||i.call(u)))}else if(l){const c=`${n}-${o}`,h=this.host._sceneController.videoState[c];this.host.duration&&!((r=h==null?void 0:h.buffered)!=null&&r.length)&&(this.host._sceneController.videoState={...this.host._sceneController.videoState,[c]:{...h,buffered:[{start:Math.max(0,n/this.host.duration*100),end:Math.min((n+o)/this.host.duration*100,100)}]}})}})}syncVideoState(){var e;(e=this.host.scenes)==null||e.forEach(t=>{if(t.video){const{key:i,node:r}=t.video,n=this.host.videoState[i],o=this.activeScenes.includes(t);if(r&&n)if(o&&!this.host.waiting&&!this.host.loading&&!this.host.paused){if(r.paused&&n.initialised)try{return r.play()}catch(a){throw new li("Video play error",a,!0)}}else r.paused||r.pause()}})}draw(e=this.currentTime){this._limitedQueue.enqueue(async()=>{var t,i;this.host.sceneConfig&&this._canvas.value&&await((i=(t=this.host).compilation)==null?void 0:i.call(t,{currentTime:e,scenes:this.host.sceneConfig,canvas:this._canvas.value}))})}clear(){var e;const t=this._canvas.value;(e=t==null?void 0:t.getContext("2d"))==null||e.clearRect(0,0,t.width,t.height)}}function CC(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function yC(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function vC(s,e){return new Promise(t=>{const{id:i,key:r,duration:n}=e,o=document.createElement("video");o.playsInline=!0,o.muted=!0,o.loop=!1,o.crossOrigin="anonymous",o.src=s;let a=!1;if(o.startLoadOnce=()=>{a||(o.preload="auto",o.load(),a=!0)},n)o.preload="none",t({id:i,key:r,hls:null,config:e,node:o});else{o.preload="metadata";const A=async()=>{t({id:i,key:r,hls:null,config:e,node:o}),o.removeEventListener("loadedmetadata",A)};o.addEventListener("loadedmetadata",A)}})}function BC(s,e){return new Promise(t=>{const{id:i,key:r}=e,n=document.createElement("video");n.playsInline=!0,n.muted=!0,n.loop=!1,n.crossOrigin="anonymous";let o=!1;const a=new vi({autoStartLoad:!0,xhrSetup:A=>{const{open:l}=A,c=s.split("?")[1];A.open=function(h,u,d){u.toString().includes("?")||(u+="?"+c),!(!o&&u.toString().includes(".ts"))&&l.apply(this,[h,u,d])}}});a.on(vi.Events.LEVEL_LOADED,async()=>{o||a==null||a.stopLoad(),t({id:i,key:r,hls:a,config:e,node:n})}),a.loadSource(s),a.attachMedia(n),a.startLoadOnce=(A=-1,l)=>{if(a&&!o){const c=a==null?void 0:a.levels.findIndex(h=>Math.min(h.height,h.width)===l);o=!0,a.startLevel=a.firstLevel,a.startLoad(A),a.currentLevel=c!==-1?c:a.firstLevel}}})}function Va(s){const{src:e,playlist:t}=s;return t&&!CC()&&vi.isSupported()?BC(t,s):vC(e,s)}async function Bu(s){return s.duration===1/0?new Promise(e=>{s.currentTime=Number.MAX_SAFE_INTEGER,s.ontimeupdate=()=>{s.ontimeupdate=null,e(s.duration),s.currentTime=0}}):s.duration}const QC=Yt(async function(e){return new FontFace(e.name,`url(${e.woff2??e.url})`,{style:e.style,weight:e.weight}).load()},{cacheKey:([s])=>JSON.stringify(s)});let bC=class{constructor(e){this._hasPlayed=!1,this._memoKey=null,this._lastDeps=null,this._duration=0,this._scenes=null,this._videos={},this._videoMeta={},this._videoState={},this._delayProcessing=(t=100)=>{const i=new AbortController,r=setTimeout(()=>{i.signal.aborted||(this.host._processing=!0)},t);return i.signal.addEventListener("abort",()=>{clearTimeout(r)}),i},this._createDataResolver=t=>i=>this.host.dataResolver(i,{language:t}),this._resolveVideo=Yt(async t=>{const{id:i,key:r}=t,n=await Va(t);n.node.volume=this.host.volume,n.node.playbackRate=this.host.playbackRate;const o={loadeddata:this._handleLoadedData,waiting:this._handleWaiting,canplay:this._handleCanPlay,progress:this._handleProgress,seeking:this._handleSeeking,seeked:this._handleSeeked,play:this._handlePlay,playing:this._handlePlaying,pause:this._handlePause,stalled:this._handleStalled,timeupdate:this._handleTimeUpdate,ended:this._handleEnded,error:this._handleError},a=Object.keys(o).reduce((A,l)=>{const c=l,h=o[c]({id:i,key:r,node:n.node});return A[c]=h,n.node.addEventListener(l,h),A},{});return{...n,listeners:a}},{cacheKey:([{id:t,key:i,src:r,playlist:n}])=>JSON.stringify({id:t,key:i,src:r==null?void 0:r.split("?")[0],playlist:n==null?void 0:n.split("?")[0]})}),this._resolveVideoMeta=Yt(async(t,i)=>{const{id:r,captions:n,duration:o,startOffset:a,endOffset:A}=t,l=o??await Bu(i),c=(a??0)*l,h=(1-(A??0))*l;return{id:r,config:t,captions:n,start:c,duration:h-c}},{cacheKey:([t])=>JSON.stringify(t)}),this._handleLoadedData=({id:t,key:i,node:r})=>()=>{var n,o;const a=this.videoState[i];if(!(a!=null&&a.initialised)){this.videoState={...this.videoState,[i]:{...a,initialised:!0,waiting:!1,buffered:(a==null?void 0:a.buffered)??[]}};const A=(o=(n=this.scenes)==null?void 0:n.scenes)==null?void 0:o.find(({video:l})=>{l==null||l.key});A&&this._setVideoCurrentTime({scene:A,time:this.host.currentTime}),this.host.dispatchEvent(new CustomEvent("video:loadeddata",{detail:{id:t,key:i,node:r}}))}},this._handleWaiting=({key:t})=>()=>{const i=this.videoState[t];i!=null&&i.initialised&&!(i!=null&&i.waiting)&&(this.videoState={...this.videoState,[t]:{...i,waiting:!0}})},this._handleCanPlay=({key:t})=>()=>{const i=this.videoState[t];i!=null&&i.initialised&&(i!=null&&i.waiting)&&(this.videoState={...this.videoState,[t]:{...i,waiting:!1}}),this.host.paused&&this.host.draw()},this._handleProgress=({key:t,node:i})=>()=>{const r=this.videoState[t],n=this._getBufferSegments({key:t,node:i,duration:this.host.duration});this.videoState={...this.videoState,[t]:{...r,buffered:n}}},this._handleSeeking=({id:t,key:i,node:r})=>()=>{this.host.dispatchEvent(new CustomEvent("video:seeking",{detail:{id:t,key:i,node:r}}))},this._handleSeeked=({id:t,key:i,node:r})=>()=>{const n=this.videoState[i];n!=null&&n.initialised&&(this.host.draw(),this.host.activeScenes.map(o=>{var a;return(a=o.videoMeta)==null?void 0:a.id}).includes(t)&&this.host.dispatchEvent(new CustomEvent("seeked",{detail:this.host.currentTime})),this.host.dispatchEvent(new CustomEvent("video:seeked",{detail:{id:t,key:i,node:r}})))},this._handlePlay=({id:t,key:i,node:r})=>()=>{this.hasPlayed=!0,this.host.dispatchEvent(new CustomEvent("video:play",{detail:{id:t,key:i,node:r}}))},this._handlePlaying=({id:t,key:i,node:r})=>()=>{this.host.dispatchEvent(new CustomEvent("video:playing",{detail:{id:t,key:i,node:r}}))},this._handlePause=({id:t,key:i,node:r})=>()=>{this.host.dispatchEvent(new CustomEvent("video:pause",{detail:{id:t,key:i,node:r}}))},this._handleStalled=({id:t,key:i,node:r})=>()=>{this.host.dispatchEvent(new CustomEvent("video:stalled",{detail:{id:t,key:i,node:r}}))},this._handleTimeUpdate=({id:t,key:i,node:r})=>()=>{this.host.dispatchEvent(new CustomEvent("video:timeupdate",{detail:{id:t,key:i,node:r}}))},this._handleEnded=({id:t,key:i,node:r})=>()=>{this.host.dispatchEvent(new CustomEvent("video:ended",{detail:{id:t,key:i,node:r}}))},this._handleError=({id:t,key:i,node:r})=>()=>{const n=new li(`Video error - answer ${t} failed to load`);this.host.dispatchEvent(new ErrorEvent("error",{bubbles:!0,composed:!0,error:n,message:n.message})),this.host.dispatchEvent(new CustomEvent("video:error",{detail:{id:t,key:i,node:r}}))},this._cleanupVideo=t=>{var i;const r=this.videos[t];r&&(r.node.pause(),r.node.src="",(i=r.hls)==null||i.destroy(),Object.keys(r.listeners??{}).forEach(n=>{var o,a;if((o=this.videos)!=null&&o[t]){const A=(a=r.listeners)==null?void 0:a[n];A&&r.node.removeEventListener(n,A)}}),delete this.videos[t])},this.host=e,this.host.addController(this)}set hasPlayed(e){e!==this._hasPlayed&&(this._hasPlayed=e,this.host.requestUpdate())}get hasPlayed(){return this._hasPlayed}set duration(e){!isNaN(e)&&e!==this._duration&&(this._duration=e,this.host.requestUpdate(),this.host.dispatchEvent(new CustomEvent("durationchange",{detail:this._duration})))}get duration(){return this._duration}set scenes(e){e!==this._scenes&&(this._scenes=e,this.host.requestUpdate())}get scenes(){return this._scenes}set videos(e){e!==this._videos&&(this._videos=e,this.host.requestUpdate())}get videos(){return this._videos}set videoMeta(e){e!==this._videoMeta&&(this._videoMeta=e,this.host.requestUpdate())}get videoMeta(){return this._videoMeta}set videoState(e){e!==this._videoState&&(this._videoState=e,this.host.requestUpdate())}get videoState(){return this._videoState}_getBufferSegments({key:e,node:t,duration:i}){var r;const n=t==null?void 0:t.buffered,o=[],{start:a,video:A,videoMeta:l}=((r=this.scenes)==null?void 0:r.scenes.find(({video:c})=>e===(c==null?void 0:c.key)))??{};if(t&&n&&A&&l&&typeof a<"u")for(let c=0;c<n.length;c++){const h=n.start(c),u=n.end(c);Math.max(h,l.start)<=Math.min(u,l.start+l.duration)&&o.push({start:Math.max(0,(Math.max(h-l.start,0)+a)/i*100),end:Math.min((Math.min(u-l.start,l.duration)+a)/i*100,100)})}return o}_setupTask(){new Rr(this.host,async([e,t,i,r,n,o,a])=>{var A;const l=this._delayProcessing();try{let c=null;if(this.host._errors=[],this.host._languages=this.host.languageResolver({data:e}),(!n||!this.host._languages.find(({value:h})=>n===h))&&(this.host._language=(A=this.host._languages[0])==null?void 0:A.value),i||e){if(i){let f=null;if(r)try{f=await(await fetch(r,{method:"GET"})).text()}catch(v){const Q=new li("Track failed to fetch",v);this.host.dispatchEvent(new ErrorEvent("error",{composed:!0,bubbles:!0,error:Q,message:Q.message}))}const y={questions:{items:[{answer:{id:"source",media:{[i.includes(".m3u8")?"playlist":"video"]:i},captions:{current:f}}}]}};try{this.scenes=await ls({data:y,template:t,burnCaptions:o,debug:a},this._createDataResolver(this.host.language),this._resolveVideo,this._resolveVideoMeta)}catch(v){try{this.scenes=await ls({data:y,burnCaptions:o,debug:a},this._createDataResolver(this.host.language),this._resolveVideo,this._resolveVideoMeta)}catch(Q){throw new li("Fatal source template error",Q,!0)}c=new li("Source template error",v)}}else try{this.scenes=await ls({data:e,template:t,burnCaptions:o,debug:a},this._createDataResolver(this.host.language),this._resolveVideo,this._resolveVideoMeta)}catch(f){try{this.scenes=await ls({data:e,burnCaptions:o,debug:a},this._createDataResolver(this.host.language),this._resolveVideo,this._resolveVideoMeta)}catch(p){throw new li("Fatal data template error",p,!0)}c=new li("Data template error",f)}Object.keys(this.videos).forEach(f=>{this.scenes.scenes.find(({video:p})=>f===(p==null?void 0:p.key))||this._videos[f].node.pause()});const[h,u,d]=this.scenes.scenes.reduce((f,{video:p,videoMeta:y,start:v,duration:Q})=>{var C;p&&(f[0][p.key]=p,y&&(f[1][p.key]=y));const w=(p==null?void 0:p.key)??`${v}-${Q}`,B=this._getBufferSegments({key:w,node:p==null?void 0:p.node,duration:this.scenes.duration});return f[2][w]={initialised:!p,waiting:!!p,...this.videoState[w],buffered:p?B:(C=this.videoState[w])==null?void 0:C.buffered},f},[{},{},{}]);this.videos=h,this.videoMeta=u,this.videoState={...this.videoState,...d},(await Promise.all(this.scenes.fonts.map(f=>QC(f)))).forEach(f=>{document.fonts.add(f)}),this.duration=this.scenes.duration,this.host.currentTime>this.duration?this.host.reset(this.duration,!1):this.host.paused&&this.host.reset(this.host.currentTime,!this.host.paused)}c&&this.host.dispatchEvent(new ErrorEvent("error",{composed:!0,bubbles:!0,error:c,message:c.message})),this.host.dispatchEvent(new CustomEvent("scenesupdate",{detail:this.scenes,bubbles:!0,composed:!0}))}catch(c){this.scenes=null,this.duration=0,this.host.dispatchEvent(new ErrorEvent("error",{composed:!0,bubbles:!0,error:c,message:c.message}))}finally{l.abort(),this.host._processing=!1}},()=>{const e=JSON.stringify({data:this.host.data,template:this.host.template,src:this.host.src,track:this.host.track,language:this.host.language,burnCaptions:this.host.burnCaptions,debug:this.host.debug});if(this._lastDeps&&this._memoKey===e)return this._lastDeps;const t=[this.host.data,this.host.template,this.host.src,this.host.track,this.host.language,this.host.burnCaptions,this.host.debug];return this._memoKey=e,this._lastDeps=t,t})}_setVideoCurrentTime({time:e,scene:t}){const{start:i,video:r,videoMeta:n}=t;if(r&&r.node&&n&&typeof i<"u"){const o=e-i;r.node.currentTime=Math.max(n.start,Math.min(n.start+n.duration,o+n.start))}}setVideosCurrentTime(e){var t;(t=this.scenes)==null||t.scenes.forEach(i=>{this._setVideoCurrentTime({time:e,scene:i})})}hostConnected(){this._setupTask()}hostDisconnected(){Object.keys(this.videos).forEach(e=>{this._cleanupVideo(e)}),this.videos={}}};function SC(s){s.requestFullscreen?s.requestFullscreen():s.mozRequestFullScreen?s.mozRequestFullScreen():s.webkitRequestFullscreen?s.webkitRequestFullscreen():s.msRequestFullscreen&&s.msRequestFullscreen()}function wC(){document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen&&document.webkitExitFullscreen()}const Ja=["progress","play-large","navigation","play","volume","current-time","duration","speed","captions","fullscreen","preview"],RC={id:"captions",event:"captions:click",label:"Closed Captions"},TC={id:"fullscreen",event:"fullscreen:click",label:"Full Screen"},Qu={title:"Playback Speed",items:[{id:"playback-rate-0.5",event:"playbackRate:click",label:"0.5x",value:.5},{id:"playback-rate-1",event:"playbackRate:click",label:"1.0x",value:1},{id:"playback-rate-1.5",event:"playbackRate:click",label:"1.5x",value:1.5},{id:"playback-rate-2",event:"playbackRate:click",label:"2.0x",value:2}]},xC={id:"playbackRate",label:"Playback playbackRate",subItems:Qu};class DC extends xA{constructor(e){if(super(e),this.element=null,this.observer=void 0,e.type!==os.ELEMENT)throw new Error("Resize directive must be used in an Element expression")}disconnected(){var e;(e=this.observer)==null||e.disconnect(),this.observer=void 0}reconnected(){var e;this.element&&((e=this.observer)==null||e.observe(this.element))}update(e,[t]){return this.isConnected&&!this.observer&&(this.observer=new ResizeObserver(t),this.element=e.element,this.observer.observe(this.element)),$t}}const Wa=as(DC),LC=UI(()=>{const s=new FontFace("Roobert","url(https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/Roobert-Regular.woff2)",{style:"normal",weight:"400"}),e=new FontFace("Roobert","url(https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/Roobert-SemiBold.woff2)",{style:"normal",weight:"600"}),t=new FontFace("Roobert Captions","url(https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/Roobert-Regular.woff2)",{style:"normal",weight:"400"}),i=El.map(r=>({load:!1,font:new FontFace(r.family,`url(${r.url})`,{style:r.style})}));return[{load:!0,font:s},{load:!0,font:e},{load:!0,font:t},...i]}),ci={"red-120":"#feeded","red-130":"#fcd5d0","red-400":"#e84a4a","red-500":"#c51c3a","red-700":"#a21c39","red-800":"#850231","red-900":"#580A2D","teal-80":"#f3fafa","teal-100":"#d6f1f1","teal-200":"#ace3e3","teal-300":"#7acace","teal-400":"#4faab2","teal-500":"#358f97","teal-600":"#287179","teal-700":"#22555c","teal-800":"#21484e","teal-900":"#1f3d42","teal-950":"#0d2126","purple-100":"#d7cfff","purple-700":"#5f2fe9","green-200":"#a4d7aa","green-500":"#38b319","green-800":"#2b3c2f","grey-100":"#f0f0f0","light-50":"rgba(255, 255, 255, .05)","light-100":"rgba(255, 255, 255, .1)","light-200":"rgba(255, 255, 255, .2)","light-400":"rgba(255, 255, 255, .4)","light-500":"rgba(255, 255, 255, .5)","light-640":"rgba(255, 255, 255, .64)","light-800":"rgba(255, 255, 255, .8)","light-1000":"#fff","dark-50":"rgba(0, 0, 0, .05)","dark-80":"rgba(0, 0, 0, .08)","dark-100":"rgba(0, 0, 0, .1)","dark-200":"rgba(0, 0, 0, .2)","dark-250":"rgba(0, 0, 0, .25)","dark-400":"rgba(0, 0, 0, .4)","dark-500":"rgba(0, 0, 0, .5)","dark-640":"rgba(0, 0, 0, .64)","dark-800":"rgba(0, 0, 0, .8)","dark-900":"rgba(0, 0, 0, .9)","dark-1000":"#000"},_C={colors:ci,space:{xxs:".25rem",xs:".5rem",small:".75rem",medium:"1rem",large:"1.5rem",xl:"2.5rem"},sizes:{xxs:"1rem",xs:"1.5rem",small:"2rem",medium:"2.5rem",large:"3rem"},fontWeights:{regular:400,semibold:600},lineHeights:{small:1.1,medium:1.25,large:1.4},letterSpacings:{xxs:"-.04rem",xs:"-.03rem",small:"-.02rem",medium:"-.01rem",large:0},fontSizes:{micro:".625rem",small:".75rem",medium:".875rem",large:"1rem",xl:"1.25rem",xxl:"1.5rem",xxxl:"2rem",huge:"2.75rem"},fontFamilies:{sans:'Roobert, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial,"Noto Sans", "Noto Color Emoji", sans-serif, "Segoe UI Emoji", "Segoe UI Symbol", "Apple Color Emoji"',mono:'"Maison Neue Mono", Menlo, Monaco, Consolas, Liberation Mono, "Courier New", monospace'},borderWidths:{thin:".0625rem"},radii:{small:".25rem",medium:".5rem",large:".75rem",xl:"1rem"},shadows:{small:`.25rem .25rem .25rem ${ci["dark-100"]}`,medium:`0 .125rem .625rem ${ci["dark-100"]}`,large:`0 .25rem 1rem ${ci["dark-50"]}`,xl:`.25rem .25rem 1rem ${ci["dark-250"]}`,xxl:`0 .25rem 2rem ${ci["dark-100"]}`,xxxl:`.25rem .25rem 3rem ${ci["dark-250"]}`,toolbar:`0 -.625rem .625rem ${ci["dark-50"]}`,text:`0 0 .25rem ${ci["dark-250"]}`},timings:{fast:".1s",normal:".2s",slow:".3s"},easings:{linear:"linear"},focusOutline:{width:".2rem",color:ci["dark-400"]},iconSizes:{small:"0.75rem",medium:"1rem",large:"1.5rem"}},bu=MI(_C,{delimiter:"-"}),kC=Object.keys(bu).map(s=>_s(`:host { --${s}: ${bu[s]}; }`)),Oe=(s=>{const e=class extends s{firstUpdated(){LC().forEach(({load:n,font:o})=>{document.fonts.add(o),n&&o.load()})}};return e.styles=[(s==null?void 0:s.styles)??[],kC,at`
|
|
191
191
|
:host {
|
|
192
192
|
font-family: var(--fontFamilies-sans);
|
|
193
193
|
font-size: var(--fontSizes-medium);
|
|
@@ -268,7 +268,7 @@ ${e}`,vg=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),Bg=Objec
|
|
|
268
268
|
scroll-behavior: auto !important;
|
|
269
269
|
}
|
|
270
270
|
}
|
|
271
|
-
`],e})(fi),FC=(s,e)=>(typeof window<"u"&&(window.customElements.get(s)??window.customElements.define(s,e)),e),NC=(s,e)=>{const{kind:t,elements:i}=e;return{kind:t,elements:i,finisher(r){typeof window<"u"&&(window.customElements.get(s)??window.customElements.define(s,r))}}},St=s=>e=>typeof e=="function"?FC(s,e):NC(s,e);class MC{constructor(e){this._memoKey=null,this._lastDeps=null,this._scenes=null,this._video=null,this._handleSeeked=()=>{this.host._draw()},this._createDataResolver=t=>i=>this.host.dataResolver(i,{language:t}),this._resolveVideo=Yt(async t=>{const i=await Va(t);return i.node.play=async()=>{},i.node.addEventListener("seeked",this._handleSeeked),i},{cacheKey:([{id:t,src:i,playlist:r}])=>JSON.stringify({id:t,src:i==null?void 0:i.split("?")[0],playlist:r==null?void 0:r.split("?")[0]})}),this._resolveAnswer=Yt(async t=>{const{id:i,key:r,poster:n}=t,{node:o}=await Va(t),a=new Image;return{id:i,key:r,config:t,node:o,getSource:()=>(n&&a.src!==n&&(a.onload=()=>{this.host._draw()},a.src=n),a)}},{cacheKey:([{id:t,src:i,playlist:r,poster:n}])=>JSON.stringify({id:t,src:i==null?void 0:i.split("?")[0],playlist:r==null?void 0:r.split("?")[0],poster:n==null?void 0:n.split("?")[0]})}),this._resolveVideoMeta=Yt(async(t,i)=>{const{id:r,captions:n,duration:o,startOffset:a,endOffset:A}=t,l=o??await Bu(i),c=(a??0)*l,h=(1-(A??0))*l;return{id:r,config:t,captions:n,start:c,duration:h-c}},{cacheKey:([{id:t,duration:i,startOffset:r,endOffset:n}])=>JSON.stringify({id:t,duration:i,startOffset:r,endOffset:n})}),this.host=e,this.host.addController(this)}set scenes(e){e!==this._scenes&&(this._scenes=e,this.host.requestUpdate())}get scenes(){return this._scenes}_setupTask(){new Rr(this.host,async([e,t,i,r,n,o])=>{var a,A;try{if(e)return;if(t){const l=t.includes(".m3u8")?"playlist":"video";try{this.scenes=await ls({data:{questions:{items:[{answer:{id:"source",media:{[l]:t,reducedQuality:t}}}]}},template:r,burnCaptions:o},this._createDataResolver(n),this._resolveVideo,this._resolveVideoMeta)}catch(c){throw new li("Video preview source template error",c)}this._video=((A=(a=this.scenes.scenes[0])==null?void 0:a.video)==null?void 0:A.node)??null}else if(i)try{this.scenes=await ls({data:i,template:r,burnCaptions:o},this._createDataResolver(n),this._resolveAnswer,this._resolveVideoMeta)}catch(l){throw new li("Video preview data template error",l)}}catch(l){this.scenes=null,this.host.dispatchEvent(new ErrorEvent("error",{composed:!0,bubbles:!0,error:l,message:l.message}))}},()=>{const e=JSON.stringify({disabled:this.host.disabled,src:this.host.src,data:this.host.data,template:this.host.template,language:this.host.language,burnCaptions:this.host.burnCaptions});if(this._lastDeps&&this._memoKey===e)return this._lastDeps;const t=[this.host.disabled,this.host.src,this.host.data,this.host.template,this.host.language,this.host.burnCaptions];return this._memoKey=e,this._lastDeps=t,t})}hostConnected(){this._setupTask()}hostDisconnected(){this._video&&(this._video.pause(),this._video.removeEventListener("seeked",this._handleSeeked),this._video.src="",this._video=null)}}function Su(s,e,t){return Math.min(Math.max(e,s),t)}function dr(s,e){return e?e instanceof ShadowRoot?dr(s,e.host):e instanceof HTMLElement&&e.matches(s)?e:dr(s,e.parentNode):null}function qa(s,e={}){const t=Math.max(0,s||0),i=Math.floor(t/3600),r=Math.floor(t%3600/60),n=Math.floor(t%3600%60),o=Math.floor(t%1*1e3);let a=i?`${i}:${`${r}`.padStart(2,"0")}:${`${n}`.padStart(2,"0")}`:`${r}:${`${n}`.padStart(2,"0")}`;return e.includeMs&&(a+=`:${`${o}`.padStart(3,"0")}`),a}var PC=Object.defineProperty,OC=Object.getOwnPropertyDescriptor,ws=(s,e,t,i)=>{for(var r=i>1?void 0:i?OC(e,t):e,n=s.length-1,o;n>=0;n--)(o=s[n])&&(r=(i?o(e,t,r):o(r))||r);return i&&r&&PC(e,t,r),r};let Fi=class extends Oe{constructor(){super(...arguments),this.active=!1,this.size="small",this.rounded="medium",this.weight="light"}render(){return pe`<button
|
|
271
|
+
`],e})(fi),FC=(s,e)=>(typeof window<"u"&&(window.customElements.get(s)??window.customElements.define(s,e)),e),NC=(s,e)=>{const{kind:t,elements:i}=e;return{kind:t,elements:i,finisher(r){typeof window<"u"&&(window.customElements.get(s)??window.customElements.define(s,r))}}},St=s=>e=>typeof e=="function"?FC(s,e):NC(s,e);class MC{constructor(e){this._memoKey=null,this._lastDeps=null,this._scenes=null,this._video=null,this._handleSeeked=()=>{this.host._draw()},this._createDataResolver=t=>i=>this.host.dataResolver(i,{language:t}),this._resolveVideo=Yt(async t=>{const i=await Va(t);return i.node.play=async()=>{},i.node.addEventListener("seeked",this._handleSeeked),i},{cacheKey:([{id:t,src:i,playlist:r}])=>JSON.stringify({id:t,src:i==null?void 0:i.split("?")[0],playlist:r==null?void 0:r.split("?")[0]})}),this._resolveAnswer=Yt(async t=>{const{id:i,key:r,poster:n}=t,{node:o}=await Va(t),a=new Image;return a.crossOrigin="anonymous",{id:i,key:r,config:t,node:o,getSource:()=>(n&&a.src!==n&&(a.onload=()=>{this.host._draw()},a.src=n),a)}},{cacheKey:([{id:t,src:i,playlist:r,poster:n}])=>JSON.stringify({id:t,src:i==null?void 0:i.split("?")[0],playlist:r==null?void 0:r.split("?")[0],poster:n==null?void 0:n.split("?")[0]})}),this._resolveVideoMeta=Yt(async(t,i)=>{const{id:r,captions:n,duration:o,startOffset:a,endOffset:A}=t,l=o??await Bu(i),c=(a??0)*l,h=(1-(A??0))*l;return{id:r,config:t,captions:n,start:c,duration:h-c}},{cacheKey:([{id:t,duration:i,startOffset:r,endOffset:n}])=>JSON.stringify({id:t,duration:i,startOffset:r,endOffset:n})}),this.host=e,this.host.addController(this)}set scenes(e){e!==this._scenes&&(this._scenes=e,this.host.requestUpdate())}get scenes(){return this._scenes}_setupTask(){new Rr(this.host,async([e,t,i,r,n,o])=>{var a,A;try{if(e)return;if(t){const l=t.includes(".m3u8")?"playlist":"video";try{this.scenes=await ls({data:{questions:{items:[{answer:{id:"source",media:{[l]:t,reducedQuality:t}}}]}},template:r,burnCaptions:o},this._createDataResolver(n),this._resolveVideo,this._resolveVideoMeta)}catch(c){throw new li("Video preview source template error",c)}this._video=((A=(a=this.scenes.scenes[0])==null?void 0:a.video)==null?void 0:A.node)??null}else if(i)try{this.scenes=await ls({data:i,template:r,burnCaptions:o},this._createDataResolver(n),this._resolveAnswer,this._resolveVideoMeta)}catch(l){throw new li("Video preview data template error",l)}}catch(l){this.scenes=null,this.host.dispatchEvent(new ErrorEvent("error",{composed:!0,bubbles:!0,error:l,message:l.message}))}},()=>{const e=JSON.stringify({disabled:this.host.disabled,src:this.host.src,data:this.host.data,template:this.host.template,language:this.host.language,burnCaptions:this.host.burnCaptions});if(this._lastDeps&&this._memoKey===e)return this._lastDeps;const t=[this.host.disabled,this.host.src,this.host.data,this.host.template,this.host.language,this.host.burnCaptions];return this._memoKey=e,this._lastDeps=t,t})}hostConnected(){this._setupTask()}hostDisconnected(){this._video&&(this._video.pause(),this._video.removeEventListener("seeked",this._handleSeeked),this._video.src="",this._video=null)}}function Su(s,e,t){return Math.min(Math.max(e,s),t)}function dr(s,e){return e?e instanceof ShadowRoot?dr(s,e.host):e instanceof HTMLElement&&e.matches(s)?e:dr(s,e.parentNode):null}function qa(s,e={}){const t=Math.max(0,s||0),i=Math.floor(t/3600),r=Math.floor(t%3600/60),n=Math.floor(t%3600%60),o=Math.floor(t%1*1e3);let a=i?`${i}:${`${r}`.padStart(2,"0")}:${`${n}`.padStart(2,"0")}`:`${r}:${`${n}`.padStart(2,"0")}`;return e.includeMs&&(a+=`:${`${o}`.padStart(3,"0")}`),a}var PC=Object.defineProperty,OC=Object.getOwnPropertyDescriptor,ws=(s,e,t,i)=>{for(var r=i>1?void 0:i?OC(e,t):e,n=s.length-1,o;n>=0;n--)(o=s[n])&&(r=(i?o(e,t,r):o(r))||r);return i&&r&&PC(e,t,r),r};let Fi=class extends Oe{constructor(){super(...arguments),this.active=!1,this.size="small",this.rounded="medium",this.weight="light"}render(){return pe`<button
|
|
272
272
|
class=${He({active:this.active,"size-tiny":this.size==="tiny","size-small":this.size==="small","size-large":this.size==="large","radius-medium":this.rounded==="medium","radius-full":this.rounded==="full","weight-light":this.weight==="light","weight-heavy":this.weight==="heavy"})}
|
|
273
273
|
>
|
|
274
274
|
<slot></slot>
|