@devix-technologies/react-gjirafa-vp-player 1.0.23 → 1.0.24
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(j,v){typeof exports=="object"&&typeof module<"u"?v(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],v):(j=typeof globalThis<"u"?globalThis:j||self,v(j.ReactGjirafaVPPlayer={},j.React))})(this,function(j,v){"use strict";function Ur(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const i=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,i.get?i:{enumerable:!0,get:()=>e[t]})}}return r.default=e,Object.freeze(r)}const ye=Ur(v);var Be={exports:{}},
|
|
1
|
+
(function(j,v){typeof exports=="object"&&typeof module<"u"?v(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],v):(j=typeof globalThis<"u"?globalThis:j||self,v(j.ReactGjirafaVPPlayer={},j.React))})(this,function(j,v){"use strict";function Ur(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const i=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,i.get?i:{enumerable:!0,get:()=>e[t]})}}return r.default=e,Object.freeze(r)}const ye=Ur(v);var Be={exports:{}},Te={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-jsx-runtime.production.js
|
|
4
4
|
*
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var sr;function Mr(){if(sr)return
|
|
9
|
+
*/var sr;function Mr(){if(sr)return Te;sr=1;var e=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function t(i,a,n){var s=null;if(n!==void 0&&(s=""+n),a.key!==void 0&&(s=""+a.key),"key"in a){n={};for(var u in a)u!=="key"&&(n[u]=a[u])}else n=a;return a=n.ref,{$$typeof:e,type:i,key:s,ref:a!==void 0?a:null,props:n}}return Te.Fragment=r,Te.jsx=t,Te.jsxs=t,Te}var Re={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.development.js
|
|
12
12
|
*
|
|
@@ -14,12 +14,12 @@
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var ur;function zr(){return ur||(ur=1,process.env.NODE_ENV!=="production"&&function(){function e(o){if(o==null)return null;if(typeof o=="function")return o.$$typeof===
|
|
17
|
+
*/var ur;function zr(){return ur||(ur=1,process.env.NODE_ENV!=="production"&&function(){function e(o){if(o==null)return null;if(typeof o=="function")return o.$$typeof===f?null:o.displayName||o.name||null;if(typeof o=="string")return o;switch(o){case d:return"Fragment";case b:return"Profiler";case x:return"StrictMode";case U:return"Suspense";case $:return"SuspenseList";case G:return"Activity"}if(typeof o=="object")switch(typeof o.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),o.$$typeof){case E:return"Portal";case N:return(o.displayName||"Context")+".Provider";case C:return(o._context.displayName||"Context")+".Consumer";case O:var m=o.render;return o=o.displayName,o||(o=m.displayName||m.name||"",o=o!==""?"ForwardRef("+o+")":"ForwardRef"),o;case w:return m=o.displayName||null,m!==null?m:e(o.type)||"Memo";case re:m=o._payload,o=o._init;try{return e(o(m))}catch{}}return null}function r(o){return""+o}function t(o){try{r(o);var m=!1}catch{m=!0}if(m){m=console;var L=m.error,A=typeof Symbol=="function"&&Symbol.toStringTag&&o[Symbol.toStringTag]||o.constructor.name||"Object";return L.call(m,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",A),r(o)}}function i(o){if(o===d)return"<>";if(typeof o=="object"&&o!==null&&o.$$typeof===re)return"<...>";try{var m=e(o);return m?"<"+m+">":"<...>"}catch{return"<...>"}}function a(){var o=g.A;return o===null?null:o.getOwner()}function n(){return Error("react-stack-top-frame")}function s(o){if(_.call(o,"key")){var m=Object.getOwnPropertyDescriptor(o,"key").get;if(m&&m.isReactWarning)return!1}return o.key!==void 0}function u(o,m){function L(){q||(q=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",m))}L.isReactWarning=!0,Object.defineProperty(o,"key",{get:L,configurable:!0})}function c(){var o=e(this.type);return z[o]||(z[o]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),o=this.props.ref,o!==void 0?o:null}function y(o,m,L,A,X,Z,J,de){return L=Z.ref,o={$$typeof:S,type:o,key:m,props:Z,_owner:X},(L!==void 0?L:null)!==null?Object.defineProperty(o,"ref",{enumerable:!1,get:c}):Object.defineProperty(o,"ref",{enumerable:!1,value:null}),o._store={},Object.defineProperty(o._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(o,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(o,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:J}),Object.defineProperty(o,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:de}),Object.freeze&&(Object.freeze(o.props),Object.freeze(o)),o}function l(o,m,L,A,X,Z,J,de){var D=m.children;if(D!==void 0)if(A)if(B(D)){for(A=0;A<D.length;A++)h(D[A]);Object.freeze&&Object.freeze(D)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else h(D);if(_.call(m,"key")){D=e(o);var te=Object.keys(m).filter(function(ae){return ae!=="key"});A=0<te.length?"{key: someKey, "+te.join(": ..., ")+": ...}":"{key: someKey}",p[D+A]||(te=0<te.length?"{"+te.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
18
18
|
let props = %s;
|
|
19
19
|
<%s {...props} />
|
|
20
20
|
React keys must be passed directly to JSX without using spread:
|
|
21
21
|
let props = %s;
|
|
22
|
-
<%s key={someKey} {...props} />`,A,D,te,D),h[D+A]=!0)}if(D=null,V!==void 0&&(t(V),D=""+V),s(m)&&(t(m.key),D=""+m.key),"key"in m){V={};for(var fe in m)fe!=="key"&&(V[fe]=m[fe])}else V=m;return D&&u(V,typeof o=="function"?o.displayName||o.name||"Unknown":o),y(o,D,ee,X,a(),V,J,de)}function f(o){typeof o=="object"&&o!==null&&o.$$typeof===S&&o._store&&(o._store.validated=1)}var x=v,S=Symbol.for("react.transitional.element"),g=Symbol.for("react.portal"),p=Symbol.for("react.fragment"),E=Symbol.for("react.strict_mode"),w=Symbol.for("react.profiler"),C=Symbol.for("react.consumer"),N=Symbol.for("react.context"),O=Symbol.for("react.forward_ref"),U=Symbol.for("react.suspense"),$=Symbol.for("react.suspense_list"),b=Symbol.for("react.memo"),Z=Symbol.for("react.lazy"),G=Symbol.for("react.activity"),d=Symbol.for("react.client.reference"),P=x.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,_=Object.prototype.hasOwnProperty,B=Array.isArray,M=console.createTask?console.createTask:function(){return null};x={"react-stack-bottom-frame":function(o){return o()}};var q,z={},H=x["react-stack-bottom-frame"].bind(x,n)(),W=M(i(n)),h={};Te.Fragment=p,Te.jsx=function(o,m,V,A,X){var ee=1e4>P.recentlyCreatedOwnerStacks++;return l(o,m,V,!1,A,X,ee?Error("react-stack-top-frame"):H,ee?M(i(o)):W)},Te.jsxs=function(o,m,V,A,X){var ee=1e4>P.recentlyCreatedOwnerStacks++;return l(o,m,V,!0,A,X,ee?Error("react-stack-top-frame"):H,ee?M(i(o)):W)}}()),Te}var lr;function qr(){return lr||(lr=1,process.env.NODE_ENV==="production"?Be.exports=Mr():Be.exports=zr()),Be.exports}var Q=qr();function Xe(){return Xe=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var i in t)({}).hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},Xe.apply(null,arguments)}function Wr(e){if(e.sheet)return e.sheet;for(var r=0;r<document.styleSheets.length;r++)if(document.styleSheets[r].ownerNode===e)return document.styleSheets[r]}function Yr(e){var r=document.createElement("style");return r.setAttribute("data-emotion",e.key),e.nonce!==void 0&&r.setAttribute("nonce",e.nonce),r.appendChild(document.createTextNode("")),r.setAttribute("data-s",""),r}var Gr=function(){function e(t){var i=this;this._insertTag=function(a){var n;i.tags.length===0?i.insertionPoint?n=i.insertionPoint.nextSibling:i.prepend?n=i.container.firstChild:n=i.before:n=i.tags[i.tags.length-1].nextSibling,i.container.insertBefore(a,n),i.tags.push(a)},this.isSpeedy=t.speedy===void 0?!0:t.speedy,this.tags=[],this.ctr=0,this.nonce=t.nonce,this.key=t.key,this.container=t.container,this.prepend=t.prepend,this.insertionPoint=t.insertionPoint,this.before=null}var r=e.prototype;return r.hydrate=function(i){i.forEach(this._insertTag)},r.insert=function(i){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(Yr(this));var a=this.tags[this.tags.length-1];if(this.isSpeedy){var n=Wr(a);try{n.insertRule(i,n.cssRules.length)}catch{}}else a.appendChild(document.createTextNode(i));this.ctr++},r.flush=function(){this.tags.forEach(function(i){var a;return(a=i.parentNode)==null?void 0:a.removeChild(i)}),this.tags=[],this.ctr=0},e}(),ie="-ms-",De="-moz-",R="-webkit-",cr="comm",Ke="rule",Je="decl",Hr="@import",dr="@keyframes",Xr="@layer",Kr=Math.abs,Fe=String.fromCharCode,Jr=Object.assign;function Qr(e,r){return re(e,0)^45?(((r<<2^re(e,0))<<2^re(e,1))<<2^re(e,2))<<2^re(e,3):0}function fr(e){return e.trim()}function Zr(e,r){return(e=r.exec(e))?e[0]:e}function k(e,r,t){return e.replace(r,t)}function Qe(e,r){return e.indexOf(r)}function re(e,r){return e.charCodeAt(r)|0}function Re(e,r,t){return e.slice(r,t)}function pe(e){return e.length}function Ze(e){return e.length}function Ue(e,r){return r.push(e),e}function et(e,r){return e.map(r).join("")}var Me=1,be=1,pr=0,oe=0,Y=0,Ee="";function ze(e,r,t,i,a,n,s){return{value:e,root:r,parent:t,type:i,props:a,children:n,line:Me,column:be,length:s,return:""}}function ke(e,r){return Jr(ze("",null,null,"",null,null,0),e,{length:-e.length},r)}function rt(){return Y}function tt(){return Y=oe>0?re(Ee,--oe):0,be--,Y===10&&(be=1,Me--),Y}function ue(){return Y=oe<pr?re(Ee,oe++):0,be++,Y===10&&(be=1,Me++),Y}function he(){return re(Ee,oe)}function qe(){return oe}function Oe(e,r){return Re(Ee,e,r)}function Ve(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function hr(e){return Me=be=1,pr=pe(Ee=e),oe=0,[]}function mr(e){return Ee="",e}function We(e){return fr(Oe(oe-1,er(e===91?e+2:e===40?e+1:e)))}function nt(e){for(;(Y=he())&&Y<33;)ue();return Ve(e)>2||Ve(Y)>3?"":" "}function it(e,r){for(;--r&&ue()&&!(Y<48||Y>102||Y>57&&Y<65||Y>70&&Y<97););return Oe(e,qe()+(r<6&&he()==32&&ue()==32))}function er(e){for(;ue();)switch(Y){case e:return oe;case 34:case 39:e!==34&&e!==39&&er(Y);break;case 40:e===41&&er(e);break;case 92:ue();break}return oe}function at(e,r){for(;ue()&&e+Y!==57;)if(e+Y===84&&he()===47)break;return"/*"+Oe(r,oe-1)+"*"+Fe(e===47?e:ue())}function ot(e){for(;!Ve(he());)ue();return Oe(e,oe)}function st(e){return mr(Ye("",null,null,null,[""],e=hr(e),0,[0],e))}function Ye(e,r,t,i,a,n,s,u,c){for(var y=0,l=0,f=s,x=0,S=0,g=0,p=1,E=1,w=1,C=0,N="",O=a,U=n,$=i,b=N;E;)switch(g=C,C=ue()){case 40:if(g!=108&&re(b,f-1)==58){Qe(b+=k(We(C),"&","&\f"),"&\f")!=-1&&(w=-1);break}case 34:case 39:case 91:b+=We(C);break;case 9:case 10:case 13:case 32:b+=nt(g);break;case 92:b+=it(qe()-1,7);continue;case 47:switch(he()){case 42:case 47:Ue(ut(at(ue(),qe()),r,t),c);break;default:b+="/"}break;case 123*p:u[y++]=pe(b)*w;case 125*p:case 59:case 0:switch(C){case 0:case 125:E=0;case 59+l:w==-1&&(b=k(b,/\f/g,"")),S>0&&pe(b)-f&&Ue(S>32?vr(b+";",i,t,f-1):vr(k(b," ","")+";",i,t,f-2),c);break;case 59:b+=";";default:if(Ue($=yr(b,r,t,y,l,a,u,N,O=[],U=[],f),n),C===123)if(l===0)Ye(b,r,$,$,O,n,f,u,U);else switch(x===99&&re(b,3)===110?100:x){case 100:case 108:case 109:case 115:Ye(e,$,$,i&&Ue(yr(e,$,$,0,0,a,u,N,a,O=[],f),U),a,U,f,u,i?O:U);break;default:Ye(b,$,$,$,[""],U,0,u,U)}}y=l=S=0,p=w=1,N=b="",f=s;break;case 58:f=1+pe(b),S=g;default:if(p<1){if(C==123)--p;else if(C==125&&p++==0&&tt()==125)continue}switch(b+=Fe(C),C*p){case 38:w=l>0?1:(b+="\f",-1);break;case 44:u[y++]=(pe(b)-1)*w,w=1;break;case 64:he()===45&&(b+=We(ue())),x=he(),l=f=pe(N=b+=ot(qe())),C++;break;case 45:g===45&&pe(b)==2&&(p=0)}}return n}function yr(e,r,t,i,a,n,s,u,c,y,l){for(var f=a-1,x=a===0?n:[""],S=Ze(x),g=0,p=0,E=0;g<i;++g)for(var w=0,C=Re(e,f+1,f=Kr(p=s[g])),N=e;w<S;++w)(N=fr(p>0?x[w]+" "+C:k(C,/&\f/g,x[w])))&&(c[E++]=N);return ze(e,r,t,a===0?Ke:u,c,y,l)}function ut(e,r,t){return ze(e,r,t,cr,Fe(rt()),Re(e,2,-2),0)}function vr(e,r,t,i){return ze(e,r,t,Je,Re(e,0,i),Re(e,i+1,-1),i)}function we(e,r){for(var t="",i=Ze(e),a=0;a<i;a++)t+=r(e[a],a,e,r)||"";return t}function lt(e,r,t,i){switch(e.type){case Xr:if(e.children.length)break;case Hr:case Je:return e.return=e.return||e.value;case cr:return"";case dr:return e.return=e.value+"{"+we(e.children,i)+"}";case Ke:e.value=e.props.join(",")}return pe(t=we(e.children,i))?e.return=e.value+"{"+t+"}":""}function ct(e){var r=Ze(e);return function(t,i,a,n){for(var s="",u=0;u<r;u++)s+=e[u](t,i,a,n)||"";return s}}function dt(e){return function(r){r.root||(r=r.return)&&e(r)}}function gr(e){var r=Object.create(null);return function(t){return r[t]===void 0&&(r[t]=e(t)),r[t]}}var ft=function(r,t,i){for(var a=0,n=0;a=n,n=he(),a===38&&n===12&&(t[i]=1),!Ve(n);)ue();return Oe(r,oe)},pt=function(r,t){var i=-1,a=44;do switch(Ve(a)){case 0:a===38&&he()===12&&(t[i]=1),r[i]+=ft(oe-1,t,i);break;case 2:r[i]+=We(a);break;case 4:if(a===44){r[++i]=he()===58?"&\f":"",t[i]=r[i].length;break}default:r[i]+=Fe(a)}while(a=ue());return r},ht=function(r,t){return mr(pt(hr(r),t))},Pr=new WeakMap,mt=function(r){if(!(r.type!=="rule"||!r.parent||r.length<1)){for(var t=r.value,i=r.parent,a=r.column===i.column&&r.line===i.line;i.type!=="rule";)if(i=i.parent,!i)return;if(!(r.props.length===1&&t.charCodeAt(0)!==58&&!Pr.get(i))&&!a){Pr.set(r,!0);for(var n=[],s=ht(t,n),u=i.props,c=0,y=0;c<s.length;c++)for(var l=0;l<u.length;l++,y++)r.props[y]=n[c]?s[c].replace(/&\f/g,u[l]):u[l]+" "+s[c]}}},yt=function(r){if(r.type==="decl"){var t=r.value;t.charCodeAt(0)===108&&t.charCodeAt(2)===98&&(r.return="",r.value="")}};function xr(e,r){switch(Qr(e,r)){case 5103:return R+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return R+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return R+e+De+e+ie+e+e;case 6828:case 4268:return R+e+ie+e+e;case 6165:return R+e+ie+"flex-"+e+e;case 5187:return R+e+k(e,/(\w+).+(:[^]+)/,R+"box-$1$2"+ie+"flex-$1$2")+e;case 5443:return R+e+ie+"flex-item-"+k(e,/flex-|-self/,"")+e;case 4675:return R+e+ie+"flex-line-pack"+k(e,/align-content|flex-|-self/,"")+e;case 5548:return R+e+ie+k(e,"shrink","negative")+e;case 5292:return R+e+ie+k(e,"basis","preferred-size")+e;case 6060:return R+"box-"+k(e,"-grow","")+R+e+ie+k(e,"grow","positive")+e;case 4554:return R+k(e,/([^-])(transform)/g,"$1"+R+"$2")+e;case 6187:return k(k(k(e,/(zoom-|grab)/,R+"$1"),/(image-set)/,R+"$1"),e,"")+e;case 5495:case 3959:return k(e,/(image-set\([^]*)/,R+"$1$`$1");case 4968:return k(k(e,/(.+:)(flex-)?(.*)/,R+"box-pack:$3"+ie+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+R+e+e;case 4095:case 3583:case 4068:case 2532:return k(e,/(.+)-inline(.+)/,R+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(pe(e)-1-r>6)switch(re(e,r+1)){case 109:if(re(e,r+4)!==45)break;case 102:return k(e,/(.+:)(.+)-([^]+)/,"$1"+R+"$2-$3$1"+De+(re(e,r+3)==108?"$3":"$2-$3"))+e;case 115:return~Qe(e,"stretch")?xr(k(e,"stretch","fill-available"),r)+e:e}break;case 4949:if(re(e,r+1)!==115)break;case 6444:switch(re(e,pe(e)-3-(~Qe(e,"!important")&&10))){case 107:return k(e,":",":"+R)+e;case 101:return k(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+R+(re(e,14)===45?"inline-":"")+"box$3$1"+R+"$2$3$1"+ie+"$2box$3")+e}break;case 5936:switch(re(e,r+11)){case 114:return R+e+ie+k(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return R+e+ie+k(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return R+e+ie+k(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return R+e+ie+e+e}return e}var vt=function(r,t,i,a){if(r.length>-1&&!r.return)switch(r.type){case Je:r.return=xr(r.value,r.length);break;case dr:return we([ke(r,{value:k(r.value,"@","@"+R)})],a);case Ke:if(r.length)return et(r.props,function(n){switch(Zr(n,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return we([ke(r,{props:[k(n,/:(read-\w+)/,":"+De+"$1")]})],a);case"::placeholder":return we([ke(r,{props:[k(n,/:(plac\w+)/,":"+R+"input-$1")]}),ke(r,{props:[k(n,/:(plac\w+)/,":"+De+"$1")]}),ke(r,{props:[k(n,/:(plac\w+)/,ie+"input-$1")]})],a)}return""})}},gt=[vt],Pt=function(r){var t=r.key;if(t==="css"){var i=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(i,function(p){var E=p.getAttribute("data-emotion");E.indexOf(" ")!==-1&&(document.head.appendChild(p),p.setAttribute("data-s",""))})}var a=r.stylisPlugins||gt,n={},s,u=[];s=r.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),function(p){for(var E=p.getAttribute("data-emotion").split(" "),w=1;w<E.length;w++)n[E[w]]=!0;u.push(p)});var c,y=[mt,yt];{var l,f=[lt,dt(function(p){l.insert(p)})],x=ct(y.concat(a,f)),S=function(E){return we(st(E),x)};c=function(E,w,C,N){l=C,S(E?E+"{"+w.styles+"}":w.styles),N&&(g.inserted[w.name]=!0)}}var g={key:t,sheet:new Gr({key:t,container:s,nonce:r.nonce,speedy:r.speedy,prepend:r.prepend,insertionPoint:r.insertionPoint}),nonce:r.nonce,inserted:n,registered:{},insert:c};return g.sheet.hydrate(u),g},xt=!0;function bt(e,r,t){var i="";return t.split(" ").forEach(function(a){e[a]!==void 0?r.push(e[a]+";"):a&&(i+=a+" ")}),i}var br=function(r,t,i){var a=r.key+"-"+t.name;(i===!1||xt===!1)&&r.registered[a]===void 0&&(r.registered[a]=t.styles)},Et=function(r,t,i){br(r,t,i);var a=r.key+"-"+t.name;if(r.inserted[t.name]===void 0){var n=t;do r.insert(t===n?"."+a:"",n,r.sheet,!0),n=n.next;while(n!==void 0)}};function wt(e){for(var r=0,t,i=0,a=e.length;a>=4;++i,a-=4)t=e.charCodeAt(i)&255|(e.charCodeAt(++i)&255)<<8|(e.charCodeAt(++i)&255)<<16|(e.charCodeAt(++i)&255)<<24,t=(t&65535)*1540483477+((t>>>16)*59797<<16),t^=t>>>24,r=(t&65535)*1540483477+((t>>>16)*59797<<16)^(r&65535)*1540483477+((r>>>16)*59797<<16);switch(a){case 3:r^=(e.charCodeAt(i+2)&255)<<16;case 2:r^=(e.charCodeAt(i+1)&255)<<8;case 1:r^=e.charCodeAt(i)&255,r=(r&65535)*1540483477+((r>>>16)*59797<<16)}return r^=r>>>13,r=(r&65535)*1540483477+((r>>>16)*59797<<16),((r^r>>>15)>>>0).toString(36)}var _t={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},St=/[A-Z]|^ms/g,It=/_EMO_([^_]+?)_([^]*?)_EMO_/g,Er=function(r){return r.charCodeAt(1)===45},wr=function(r){return r!=null&&typeof r!="boolean"},rr=gr(function(e){return Er(e)?e:e.replace(St,"-$&").toLowerCase()}),_r=function(r,t){switch(r){case"animation":case"animationName":if(typeof t=="string")return t.replace(It,function(i,a,n){return me={name:a,styles:n,next:me},a})}return _t[r]!==1&&!Er(r)&&typeof t=="number"&&t!==0?t+"px":t};function Le(e,r,t){if(t==null)return"";var i=t;if(i.__emotion_styles!==void 0)return i;switch(typeof t){case"boolean":return"";case"object":{var a=t;if(a.anim===1)return me={name:a.name,styles:a.styles,next:me},a.name;var n=t;if(n.styles!==void 0){var s=n.next;if(s!==void 0)for(;s!==void 0;)me={name:s.name,styles:s.styles,next:me},s=s.next;var u=n.styles+";";return u}return Ct(e,r,t)}case"function":{if(e!==void 0){var c=me,y=t(e);return me=c,Le(e,r,y)}break}}var l=t;if(r==null)return l;var f=r[l];return f!==void 0?f:l}function Ct(e,r,t){var i="";if(Array.isArray(t))for(var a=0;a<t.length;a++)i+=Le(e,r,t[a])+";";else for(var n in t){var s=t[n];if(typeof s!="object"){var u=s;r!=null&&r[u]!==void 0?i+=n+"{"+r[u]+"}":wr(u)&&(i+=rr(n)+":"+_r(n,u)+";")}else if(Array.isArray(s)&&typeof s[0]=="string"&&(r==null||r[s[0]]===void 0))for(var c=0;c<s.length;c++)wr(s[c])&&(i+=rr(n)+":"+_r(n,s[c])+";");else{var y=Le(e,r,s);switch(n){case"animation":case"animationName":{i+=rr(n)+":"+y+";";break}default:i+=n+"{"+y+"}"}}}return i}var Sr=/label:\s*([^\s;{]+)\s*(;|$)/g,me;function At(e,r,t){if(e.length===1&&typeof e[0]=="object"&&e[0]!==null&&e[0].styles!==void 0)return e[0];var i=!0,a="";me=void 0;var n=e[0];if(n==null||n.raw===void 0)i=!1,a+=Le(t,r,n);else{var s=n;a+=s[0]}for(var u=1;u<e.length;u++)if(a+=Le(t,r,e[u]),i){var c=n;a+=c[u]}Sr.lastIndex=0;for(var y="",l;(l=Sr.exec(a))!==null;)y+="-"+l[1];var f=wt(a)+y;return{name:f,styles:a,next:me}}var Tt=function(r){return r()},Rt=ye.useInsertionEffect?ye.useInsertionEffect:!1,kt=Rt||Tt,Ir=ye.createContext(typeof HTMLElement<"u"?Pt({key:"css"}):null);Ir.Provider;var Ot=function(r){return v.forwardRef(function(t,i){var a=v.useContext(Ir);return r(t,a,i)})},Vt=ye.createContext({}),Lt=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,jt=gr(function(e){return Lt.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91}),$t=jt,Nt=function(r){return r!=="theme"},Cr=function(r){return typeof r=="string"&&r.charCodeAt(0)>96?$t:Nt},Ar=function(r,t,i){var a;if(t){var n=t.shouldForwardProp;a=r.__emotion_forwardProp&&n?function(s){return r.__emotion_forwardProp(s)&&n(s)}:n}return typeof a!="function"&&i&&(a=r.__emotion_forwardProp),a},Bt=function(r){var t=r.cache,i=r.serialized,a=r.isStringTag;return br(t,i,a),kt(function(){return Et(t,i,a)}),null},Dt=function e(r,t){var i=r.__emotion_real===r,a=i&&r.__emotion_base||r,n,s;t!==void 0&&(n=t.label,s=t.target);var u=Ar(r,t,i),c=u||Cr(a),y=!c("as");return function(){var l=arguments,f=i&&r.__emotion_styles!==void 0?r.__emotion_styles.slice(0):[];if(n!==void 0&&f.push("label:"+n+";"),l[0]==null||l[0].raw===void 0)f.push.apply(f,l);else{var x=l[0];f.push(x[0]);for(var S=l.length,g=1;g<S;g++)f.push(l[g],x[g])}var p=Ot(function(E,w,C){var N=y&&E.as||a,O="",U=[],$=E;if(E.theme==null){$={};for(var b in E)$[b]=E[b];$.theme=ye.useContext(Vt)}typeof E.className=="string"?O=bt(w.registered,U,E.className):E.className!=null&&(O=E.className+" ");var Z=At(f.concat(U),w.registered,$);O+=w.key+"-"+Z.name,s!==void 0&&(O+=" "+s);var G=y&&u===void 0?Cr(N):c,d={};for(var P in E)y&&P==="as"||G(P)&&(d[P]=E[P]);return d.className=O,C&&(d.ref=C),ye.createElement(ye.Fragment,null,ye.createElement(Bt,{cache:w,serialized:Z,isStringTag:typeof N=="string"}),ye.createElement(N,d))});return p.displayName=n!==void 0?n:"Styled("+(typeof a=="string"?a:a.displayName||a.name||"Component")+")",p.defaultProps=r.defaultProps,p.__emotion_real=p,p.__emotion_base=a,p.__emotion_styles=f,p.__emotion_forwardProp=u,Object.defineProperty(p,"toString",{value:function(){return"."+s}}),p.withComponent=function(E,w){var C=e(E,Xe({},t,w,{shouldForwardProp:Ar(p,w,!0)}));return C.apply(void 0,f)},p}},Ft=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"],_e=Dt.bind(null);Ft.forEach(function(e){_e[e]=_e(e)});const Ut=_e.div`
|
|
22
|
+
<%s key={someKey} {...props} />`,A,D,te,D),p[D+A]=!0)}if(D=null,L!==void 0&&(t(L),D=""+L),s(m)&&(t(m.key),D=""+m.key),"key"in m){L={};for(var fe in m)fe!=="key"&&(L[fe]=m[fe])}else L=m;return D&&u(L,typeof o=="function"?o.displayName||o.name||"Unknown":o),y(o,D,Z,X,a(),L,J,de)}function h(o){typeof o=="object"&&o!==null&&o.$$typeof===S&&o._store&&(o._store.validated=1)}var P=v,S=Symbol.for("react.transitional.element"),E=Symbol.for("react.portal"),d=Symbol.for("react.fragment"),x=Symbol.for("react.strict_mode"),b=Symbol.for("react.profiler"),C=Symbol.for("react.consumer"),N=Symbol.for("react.context"),O=Symbol.for("react.forward_ref"),U=Symbol.for("react.suspense"),$=Symbol.for("react.suspense_list"),w=Symbol.for("react.memo"),re=Symbol.for("react.lazy"),G=Symbol.for("react.activity"),f=Symbol.for("react.client.reference"),g=P.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,_=Object.prototype.hasOwnProperty,B=Array.isArray,M=console.createTask?console.createTask:function(){return null};P={"react-stack-bottom-frame":function(o){return o()}};var q,z={},H=P["react-stack-bottom-frame"].bind(P,n)(),W=M(i(n)),p={};Re.Fragment=d,Re.jsx=function(o,m,L,A,X){var Z=1e4>g.recentlyCreatedOwnerStacks++;return l(o,m,L,!1,A,X,Z?Error("react-stack-top-frame"):H,Z?M(i(o)):W)},Re.jsxs=function(o,m,L,A,X){var Z=1e4>g.recentlyCreatedOwnerStacks++;return l(o,m,L,!0,A,X,Z?Error("react-stack-top-frame"):H,Z?M(i(o)):W)}}()),Re}var lr;function qr(){return lr||(lr=1,process.env.NODE_ENV==="production"?Be.exports=Mr():Be.exports=zr()),Be.exports}var Q=qr();function Xe(){return Xe=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var i in t)({}).hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},Xe.apply(null,arguments)}function Wr(e){if(e.sheet)return e.sheet;for(var r=0;r<document.styleSheets.length;r++)if(document.styleSheets[r].ownerNode===e)return document.styleSheets[r]}function Yr(e){var r=document.createElement("style");return r.setAttribute("data-emotion",e.key),e.nonce!==void 0&&r.setAttribute("nonce",e.nonce),r.appendChild(document.createTextNode("")),r.setAttribute("data-s",""),r}var Gr=function(){function e(t){var i=this;this._insertTag=function(a){var n;i.tags.length===0?i.insertionPoint?n=i.insertionPoint.nextSibling:i.prepend?n=i.container.firstChild:n=i.before:n=i.tags[i.tags.length-1].nextSibling,i.container.insertBefore(a,n),i.tags.push(a)},this.isSpeedy=t.speedy===void 0?!0:t.speedy,this.tags=[],this.ctr=0,this.nonce=t.nonce,this.key=t.key,this.container=t.container,this.prepend=t.prepend,this.insertionPoint=t.insertionPoint,this.before=null}var r=e.prototype;return r.hydrate=function(i){i.forEach(this._insertTag)},r.insert=function(i){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(Yr(this));var a=this.tags[this.tags.length-1];if(this.isSpeedy){var n=Wr(a);try{n.insertRule(i,n.cssRules.length)}catch{}}else a.appendChild(document.createTextNode(i));this.ctr++},r.flush=function(){this.tags.forEach(function(i){var a;return(a=i.parentNode)==null?void 0:a.removeChild(i)}),this.tags=[],this.ctr=0},e}(),ie="-ms-",De="-moz-",R="-webkit-",cr="comm",Ke="rule",Je="decl",Hr="@import",dr="@keyframes",Xr="@layer",Kr=Math.abs,Fe=String.fromCharCode,Jr=Object.assign;function Qr(e,r){return ee(e,0)^45?(((r<<2^ee(e,0))<<2^ee(e,1))<<2^ee(e,2))<<2^ee(e,3):0}function fr(e){return e.trim()}function Zr(e,r){return(e=r.exec(e))?e[0]:e}function k(e,r,t){return e.replace(r,t)}function Qe(e,r){return e.indexOf(r)}function ee(e,r){return e.charCodeAt(r)|0}function ke(e,r,t){return e.slice(r,t)}function pe(e){return e.length}function Ze(e){return e.length}function Ue(e,r){return r.push(e),e}function et(e,r){return e.map(r).join("")}var Me=1,we=1,pr=0,oe=0,Y=0,Ee="";function ze(e,r,t,i,a,n,s){return{value:e,root:r,parent:t,type:i,props:a,children:n,line:Me,column:we,length:s,return:""}}function Oe(e,r){return Jr(ze("",null,null,"",null,null,0),e,{length:-e.length},r)}function rt(){return Y}function tt(){return Y=oe>0?ee(Ee,--oe):0,we--,Y===10&&(we=1,Me--),Y}function ue(){return Y=oe<pr?ee(Ee,oe++):0,we++,Y===10&&(we=1,Me++),Y}function he(){return ee(Ee,oe)}function qe(){return oe}function Le(e,r){return ke(Ee,e,r)}function Ve(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function hr(e){return Me=we=1,pr=pe(Ee=e),oe=0,[]}function mr(e){return Ee="",e}function We(e){return fr(Le(oe-1,er(e===91?e+2:e===40?e+1:e)))}function nt(e){for(;(Y=he())&&Y<33;)ue();return Ve(e)>2||Ve(Y)>3?"":" "}function it(e,r){for(;--r&&ue()&&!(Y<48||Y>102||Y>57&&Y<65||Y>70&&Y<97););return Le(e,qe()+(r<6&&he()==32&&ue()==32))}function er(e){for(;ue();)switch(Y){case e:return oe;case 34:case 39:e!==34&&e!==39&&er(Y);break;case 40:e===41&&er(e);break;case 92:ue();break}return oe}function at(e,r){for(;ue()&&e+Y!==57;)if(e+Y===84&&he()===47)break;return"/*"+Le(r,oe-1)+"*"+Fe(e===47?e:ue())}function ot(e){for(;!Ve(he());)ue();return Le(e,oe)}function st(e){return mr(Ye("",null,null,null,[""],e=hr(e),0,[0],e))}function Ye(e,r,t,i,a,n,s,u,c){for(var y=0,l=0,h=s,P=0,S=0,E=0,d=1,x=1,b=1,C=0,N="",O=a,U=n,$=i,w=N;x;)switch(E=C,C=ue()){case 40:if(E!=108&&ee(w,h-1)==58){Qe(w+=k(We(C),"&","&\f"),"&\f")!=-1&&(b=-1);break}case 34:case 39:case 91:w+=We(C);break;case 9:case 10:case 13:case 32:w+=nt(E);break;case 92:w+=it(qe()-1,7);continue;case 47:switch(he()){case 42:case 47:Ue(ut(at(ue(),qe()),r,t),c);break;default:w+="/"}break;case 123*d:u[y++]=pe(w)*b;case 125*d:case 59:case 0:switch(C){case 0:case 125:x=0;case 59+l:b==-1&&(w=k(w,/\f/g,"")),S>0&&pe(w)-h&&Ue(S>32?vr(w+";",i,t,h-1):vr(k(w," ","")+";",i,t,h-2),c);break;case 59:w+=";";default:if(Ue($=yr(w,r,t,y,l,a,u,N,O=[],U=[],h),n),C===123)if(l===0)Ye(w,r,$,$,O,n,h,u,U);else switch(P===99&&ee(w,3)===110?100:P){case 100:case 108:case 109:case 115:Ye(e,$,$,i&&Ue(yr(e,$,$,0,0,a,u,N,a,O=[],h),U),a,U,h,u,i?O:U);break;default:Ye(w,$,$,$,[""],U,0,u,U)}}y=l=S=0,d=b=1,N=w="",h=s;break;case 58:h=1+pe(w),S=E;default:if(d<1){if(C==123)--d;else if(C==125&&d++==0&&tt()==125)continue}switch(w+=Fe(C),C*d){case 38:b=l>0?1:(w+="\f",-1);break;case 44:u[y++]=(pe(w)-1)*b,b=1;break;case 64:he()===45&&(w+=We(ue())),P=he(),l=h=pe(N=w+=ot(qe())),C++;break;case 45:E===45&&pe(w)==2&&(d=0)}}return n}function yr(e,r,t,i,a,n,s,u,c,y,l){for(var h=a-1,P=a===0?n:[""],S=Ze(P),E=0,d=0,x=0;E<i;++E)for(var b=0,C=ke(e,h+1,h=Kr(d=s[E])),N=e;b<S;++b)(N=fr(d>0?P[b]+" "+C:k(C,/&\f/g,P[b])))&&(c[x++]=N);return ze(e,r,t,a===0?Ke:u,c,y,l)}function ut(e,r,t){return ze(e,r,t,cr,Fe(rt()),ke(e,2,-2),0)}function vr(e,r,t,i){return ze(e,r,t,Je,ke(e,0,i),ke(e,i+1,-1),i)}function _e(e,r){for(var t="",i=Ze(e),a=0;a<i;a++)t+=r(e[a],a,e,r)||"";return t}function lt(e,r,t,i){switch(e.type){case Xr:if(e.children.length)break;case Hr:case Je:return e.return=e.return||e.value;case cr:return"";case dr:return e.return=e.value+"{"+_e(e.children,i)+"}";case Ke:e.value=e.props.join(",")}return pe(t=_e(e.children,i))?e.return=e.value+"{"+t+"}":""}function ct(e){var r=Ze(e);return function(t,i,a,n){for(var s="",u=0;u<r;u++)s+=e[u](t,i,a,n)||"";return s}}function dt(e){return function(r){r.root||(r=r.return)&&e(r)}}function gr(e){var r=Object.create(null);return function(t){return r[t]===void 0&&(r[t]=e(t)),r[t]}}var ft=function(r,t,i){for(var a=0,n=0;a=n,n=he(),a===38&&n===12&&(t[i]=1),!Ve(n);)ue();return Le(r,oe)},pt=function(r,t){var i=-1,a=44;do switch(Ve(a)){case 0:a===38&&he()===12&&(t[i]=1),r[i]+=ft(oe-1,t,i);break;case 2:r[i]+=We(a);break;case 4:if(a===44){r[++i]=he()===58?"&\f":"",t[i]=r[i].length;break}default:r[i]+=Fe(a)}while(a=ue());return r},ht=function(r,t){return mr(pt(hr(r),t))},Pr=new WeakMap,mt=function(r){if(!(r.type!=="rule"||!r.parent||r.length<1)){for(var t=r.value,i=r.parent,a=r.column===i.column&&r.line===i.line;i.type!=="rule";)if(i=i.parent,!i)return;if(!(r.props.length===1&&t.charCodeAt(0)!==58&&!Pr.get(i))&&!a){Pr.set(r,!0);for(var n=[],s=ht(t,n),u=i.props,c=0,y=0;c<s.length;c++)for(var l=0;l<u.length;l++,y++)r.props[y]=n[c]?s[c].replace(/&\f/g,u[l]):u[l]+" "+s[c]}}},yt=function(r){if(r.type==="decl"){var t=r.value;t.charCodeAt(0)===108&&t.charCodeAt(2)===98&&(r.return="",r.value="")}};function xr(e,r){switch(Qr(e,r)){case 5103:return R+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return R+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return R+e+De+e+ie+e+e;case 6828:case 4268:return R+e+ie+e+e;case 6165:return R+e+ie+"flex-"+e+e;case 5187:return R+e+k(e,/(\w+).+(:[^]+)/,R+"box-$1$2"+ie+"flex-$1$2")+e;case 5443:return R+e+ie+"flex-item-"+k(e,/flex-|-self/,"")+e;case 4675:return R+e+ie+"flex-line-pack"+k(e,/align-content|flex-|-self/,"")+e;case 5548:return R+e+ie+k(e,"shrink","negative")+e;case 5292:return R+e+ie+k(e,"basis","preferred-size")+e;case 6060:return R+"box-"+k(e,"-grow","")+R+e+ie+k(e,"grow","positive")+e;case 4554:return R+k(e,/([^-])(transform)/g,"$1"+R+"$2")+e;case 6187:return k(k(k(e,/(zoom-|grab)/,R+"$1"),/(image-set)/,R+"$1"),e,"")+e;case 5495:case 3959:return k(e,/(image-set\([^]*)/,R+"$1$`$1");case 4968:return k(k(e,/(.+:)(flex-)?(.*)/,R+"box-pack:$3"+ie+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+R+e+e;case 4095:case 3583:case 4068:case 2532:return k(e,/(.+)-inline(.+)/,R+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(pe(e)-1-r>6)switch(ee(e,r+1)){case 109:if(ee(e,r+4)!==45)break;case 102:return k(e,/(.+:)(.+)-([^]+)/,"$1"+R+"$2-$3$1"+De+(ee(e,r+3)==108?"$3":"$2-$3"))+e;case 115:return~Qe(e,"stretch")?xr(k(e,"stretch","fill-available"),r)+e:e}break;case 4949:if(ee(e,r+1)!==115)break;case 6444:switch(ee(e,pe(e)-3-(~Qe(e,"!important")&&10))){case 107:return k(e,":",":"+R)+e;case 101:return k(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+R+(ee(e,14)===45?"inline-":"")+"box$3$1"+R+"$2$3$1"+ie+"$2box$3")+e}break;case 5936:switch(ee(e,r+11)){case 114:return R+e+ie+k(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return R+e+ie+k(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return R+e+ie+k(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return R+e+ie+e+e}return e}var vt=function(r,t,i,a){if(r.length>-1&&!r.return)switch(r.type){case Je:r.return=xr(r.value,r.length);break;case dr:return _e([Oe(r,{value:k(r.value,"@","@"+R)})],a);case Ke:if(r.length)return et(r.props,function(n){switch(Zr(n,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return _e([Oe(r,{props:[k(n,/:(read-\w+)/,":"+De+"$1")]})],a);case"::placeholder":return _e([Oe(r,{props:[k(n,/:(plac\w+)/,":"+R+"input-$1")]}),Oe(r,{props:[k(n,/:(plac\w+)/,":"+De+"$1")]}),Oe(r,{props:[k(n,/:(plac\w+)/,ie+"input-$1")]})],a)}return""})}},gt=[vt],Pt=function(r){var t=r.key;if(t==="css"){var i=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(i,function(d){var x=d.getAttribute("data-emotion");x.indexOf(" ")!==-1&&(document.head.appendChild(d),d.setAttribute("data-s",""))})}var a=r.stylisPlugins||gt,n={},s,u=[];s=r.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),function(d){for(var x=d.getAttribute("data-emotion").split(" "),b=1;b<x.length;b++)n[x[b]]=!0;u.push(d)});var c,y=[mt,yt];{var l,h=[lt,dt(function(d){l.insert(d)})],P=ct(y.concat(a,h)),S=function(x){return _e(st(x),P)};c=function(x,b,C,N){l=C,S(x?x+"{"+b.styles+"}":b.styles),N&&(E.inserted[b.name]=!0)}}var E={key:t,sheet:new Gr({key:t,container:s,nonce:r.nonce,speedy:r.speedy,prepend:r.prepend,insertionPoint:r.insertionPoint}),nonce:r.nonce,inserted:n,registered:{},insert:c};return E.sheet.hydrate(u),E},xt=!0;function bt(e,r,t){var i="";return t.split(" ").forEach(function(a){e[a]!==void 0?r.push(e[a]+";"):a&&(i+=a+" ")}),i}var br=function(r,t,i){var a=r.key+"-"+t.name;(i===!1||xt===!1)&&r.registered[a]===void 0&&(r.registered[a]=t.styles)},wt=function(r,t,i){br(r,t,i);var a=r.key+"-"+t.name;if(r.inserted[t.name]===void 0){var n=t;do r.insert(t===n?"."+a:"",n,r.sheet,!0),n=n.next;while(n!==void 0)}};function Et(e){for(var r=0,t,i=0,a=e.length;a>=4;++i,a-=4)t=e.charCodeAt(i)&255|(e.charCodeAt(++i)&255)<<8|(e.charCodeAt(++i)&255)<<16|(e.charCodeAt(++i)&255)<<24,t=(t&65535)*1540483477+((t>>>16)*59797<<16),t^=t>>>24,r=(t&65535)*1540483477+((t>>>16)*59797<<16)^(r&65535)*1540483477+((r>>>16)*59797<<16);switch(a){case 3:r^=(e.charCodeAt(i+2)&255)<<16;case 2:r^=(e.charCodeAt(i+1)&255)<<8;case 1:r^=e.charCodeAt(i)&255,r=(r&65535)*1540483477+((r>>>16)*59797<<16)}return r^=r>>>13,r=(r&65535)*1540483477+((r>>>16)*59797<<16),((r^r>>>15)>>>0).toString(36)}var _t={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},St=/[A-Z]|^ms/g,It=/_EMO_([^_]+?)_([^]*?)_EMO_/g,wr=function(r){return r.charCodeAt(1)===45},Er=function(r){return r!=null&&typeof r!="boolean"},rr=gr(function(e){return wr(e)?e:e.replace(St,"-$&").toLowerCase()}),_r=function(r,t){switch(r){case"animation":case"animationName":if(typeof t=="string")return t.replace(It,function(i,a,n){return me={name:a,styles:n,next:me},a})}return _t[r]!==1&&!wr(r)&&typeof t=="number"&&t!==0?t+"px":t};function je(e,r,t){if(t==null)return"";var i=t;if(i.__emotion_styles!==void 0)return i;switch(typeof t){case"boolean":return"";case"object":{var a=t;if(a.anim===1)return me={name:a.name,styles:a.styles,next:me},a.name;var n=t;if(n.styles!==void 0){var s=n.next;if(s!==void 0)for(;s!==void 0;)me={name:s.name,styles:s.styles,next:me},s=s.next;var u=n.styles+";";return u}return Ct(e,r,t)}case"function":{if(e!==void 0){var c=me,y=t(e);return me=c,je(e,r,y)}break}}var l=t;if(r==null)return l;var h=r[l];return h!==void 0?h:l}function Ct(e,r,t){var i="";if(Array.isArray(t))for(var a=0;a<t.length;a++)i+=je(e,r,t[a])+";";else for(var n in t){var s=t[n];if(typeof s!="object"){var u=s;r!=null&&r[u]!==void 0?i+=n+"{"+r[u]+"}":Er(u)&&(i+=rr(n)+":"+_r(n,u)+";")}else if(Array.isArray(s)&&typeof s[0]=="string"&&(r==null||r[s[0]]===void 0))for(var c=0;c<s.length;c++)Er(s[c])&&(i+=rr(n)+":"+_r(n,s[c])+";");else{var y=je(e,r,s);switch(n){case"animation":case"animationName":{i+=rr(n)+":"+y+";";break}default:i+=n+"{"+y+"}"}}}return i}var Sr=/label:\s*([^\s;{]+)\s*(;|$)/g,me;function At(e,r,t){if(e.length===1&&typeof e[0]=="object"&&e[0]!==null&&e[0].styles!==void 0)return e[0];var i=!0,a="";me=void 0;var n=e[0];if(n==null||n.raw===void 0)i=!1,a+=je(t,r,n);else{var s=n;a+=s[0]}for(var u=1;u<e.length;u++)if(a+=je(t,r,e[u]),i){var c=n;a+=c[u]}Sr.lastIndex=0;for(var y="",l;(l=Sr.exec(a))!==null;)y+="-"+l[1];var h=Et(a)+y;return{name:h,styles:a,next:me}}var Tt=function(r){return r()},Rt=ye.useInsertionEffect?ye.useInsertionEffect:!1,kt=Rt||Tt,Ir=ye.createContext(typeof HTMLElement<"u"?Pt({key:"css"}):null);Ir.Provider;var Ot=function(r){return v.forwardRef(function(t,i){var a=v.useContext(Ir);return r(t,a,i)})},Lt=ye.createContext({}),Vt=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,jt=gr(function(e){return Vt.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91}),$t=jt,Nt=function(r){return r!=="theme"},Cr=function(r){return typeof r=="string"&&r.charCodeAt(0)>96?$t:Nt},Ar=function(r,t,i){var a;if(t){var n=t.shouldForwardProp;a=r.__emotion_forwardProp&&n?function(s){return r.__emotion_forwardProp(s)&&n(s)}:n}return typeof a!="function"&&i&&(a=r.__emotion_forwardProp),a},Bt=function(r){var t=r.cache,i=r.serialized,a=r.isStringTag;return br(t,i,a),kt(function(){return wt(t,i,a)}),null},Dt=function e(r,t){var i=r.__emotion_real===r,a=i&&r.__emotion_base||r,n,s;t!==void 0&&(n=t.label,s=t.target);var u=Ar(r,t,i),c=u||Cr(a),y=!c("as");return function(){var l=arguments,h=i&&r.__emotion_styles!==void 0?r.__emotion_styles.slice(0):[];if(n!==void 0&&h.push("label:"+n+";"),l[0]==null||l[0].raw===void 0)h.push.apply(h,l);else{var P=l[0];h.push(P[0]);for(var S=l.length,E=1;E<S;E++)h.push(l[E],P[E])}var d=Ot(function(x,b,C){var N=y&&x.as||a,O="",U=[],$=x;if(x.theme==null){$={};for(var w in x)$[w]=x[w];$.theme=ye.useContext(Lt)}typeof x.className=="string"?O=bt(b.registered,U,x.className):x.className!=null&&(O=x.className+" ");var re=At(h.concat(U),b.registered,$);O+=b.key+"-"+re.name,s!==void 0&&(O+=" "+s);var G=y&&u===void 0?Cr(N):c,f={};for(var g in x)y&&g==="as"||G(g)&&(f[g]=x[g]);return f.className=O,C&&(f.ref=C),ye.createElement(ye.Fragment,null,ye.createElement(Bt,{cache:b,serialized:re,isStringTag:typeof N=="string"}),ye.createElement(N,f))});return d.displayName=n!==void 0?n:"Styled("+(typeof a=="string"?a:a.displayName||a.name||"Component")+")",d.defaultProps=r.defaultProps,d.__emotion_real=d,d.__emotion_base=a,d.__emotion_styles=h,d.__emotion_forwardProp=u,Object.defineProperty(d,"toString",{value:function(){return"."+s}}),d.withComponent=function(x,b){var C=e(x,Xe({},t,b,{shouldForwardProp:Ar(d,b,!0)}));return C.apply(void 0,h)},d}},Ft=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"],Se=Dt.bind(null);Ft.forEach(function(e){Se[e]=Se(e)});const Ut=Se.div`
|
|
23
23
|
display: flex;
|
|
24
24
|
align-items: center;
|
|
25
25
|
justify-content: center;
|
|
@@ -47,7 +47,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
47
47
|
background-color: rgba(255, 165, 0, 0.1);
|
|
48
48
|
border: 1px solid orange;
|
|
49
49
|
`;default:return""}}}
|
|
50
|
-
`,tr=({type:e,children:r,className:t,icon:i,action:a})=>Q.jsxs(Ut,{type:e,className:t,children:[i&&Q.jsx("span",{children:i}),Q.jsx("span",{children:r}),a&&Q.jsx("span",{children:a})]}),nr=
|
|
50
|
+
`,tr=({type:e,children:r,className:t,icon:i,action:a})=>Q.jsxs(Ut,{type:e,className:t,children:[i&&Q.jsx("span",{children:i}),Q.jsx("span",{children:r}),a&&Q.jsx("span",{children:a})]}),nr=Se.div`
|
|
51
51
|
width: ${({width:e})=>e||"100%"};
|
|
52
52
|
height: ${({height:e})=>e||"100%"};
|
|
53
53
|
border-radius: 0px !important; /* Force remove rounded corners on container */
|
|
@@ -59,7 +59,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
59
59
|
|
|
60
60
|
/* Hide specific elements inside the player */
|
|
61
61
|
${({$hiddenClasses:e})=>(e==null?void 0:e.length)&&e.map(r=>`.${r} { display: none !important; }`).join("")}
|
|
62
|
-
`,Tr=
|
|
62
|
+
`,Tr=Se.div`
|
|
63
63
|
position: fixed;
|
|
64
64
|
top: 0;
|
|
65
65
|
left: 0;
|
|
@@ -71,11 +71,11 @@ React keys must be passed directly to JSX without using spread:
|
|
|
71
71
|
align-items: center;
|
|
72
72
|
z-index: 1000;
|
|
73
73
|
pointer-events: auto;
|
|
74
|
-
`,Rr=
|
|
74
|
+
`,Rr=Se.div`
|
|
75
75
|
position: relative;
|
|
76
76
|
max-width: 100vw;
|
|
77
77
|
aspect-ratio: 9 / 16;
|
|
78
78
|
height: auto;
|
|
79
79
|
z-index: 1001;
|
|
80
80
|
max-height: 100vh;
|
|
81
|
-
`,Mt=(e,r)=>`https://vp-api.gjirafa.tech/api/v2/projects/${e}/videos?search=${r}`,kr=(e,r)=>`https://vp-api.gjirafa.tech/api/projects/${e}/playlists/${r}/videos`,zt=(e,r)=>`https://vp-api.gjirafa.tech/api/projects/${e}/playlists/${r}`,qt=e=>`https://host.vpplayer.tech/player/${e}/vpplayer.js`,ir=(e,r)=>`vp-player-${e||"default"}-${r||""}`,ar=new Map,Or=(e,r)=>{const[t,i]=v.useState(!1),[a,n]=v.useState(null);return v.useEffect(()=>{let s=null,u,c=0;const y=3;let l;try{l=r||qt(e||"latest")}catch(S){const g=S instanceof Error?S.message:String(S);n(`Failed to resolve script URL: ${g}`),i(!1);return}if(ar.get(l)){i(!0),n(null);return}if(document.querySelector(`script[src="${l}"]`)){ar.set(l,!0),i(!0),n(null);return}const x=()=>{s=document.createElement("script"),s.src=l,s.async=!0,u=window.setTimeout(()=>{i(!1),n(`Loading script timed out: ${l}`)},1e4),s.onload=()=>{clearTimeout(u),ar.set(l,!0),i(!0),n(null)},s.onerror=()=>{clearTimeout(u),c++,c<y?setTimeout(x,1e3*c):(i(!1),n(`Failed to load VP Player script after ${y} attempts: ${l}`))},document.body.appendChild(s)};return x(),()=>{clearTimeout(u),s&&document.body.contains(s)&&document.body.removeChild(s)}},[e,r]),{isLoaded:t,error:a}},Wt={},je=new Map,Yt=3e4,or=5,Vr=({projectId:e,videoId:r,playlistId:t,videoUrl:i,apiKey:a})=>{const[n,s]=v.useState(null),[u,c]=v.useState(null),[y,l]=v.useState(!1),[f,x]=v.useState(null),S=a||(typeof Wt<"u"?"1CFC4B619E9342B6BAC4879BA8C30CF216C4BA9D3F084B11825F4AB2D5CF845E":void 0);return v.useEffect(()=>{const g=r?`video:${r}`:t?`playlist:${t}`:null;if(!e||i||!r&&!t){s(i||null),c(null),l(!1),x(null);return}if(!S){l(!1),x("No API key provided");return}if(g&&je.has(g)){const O=je.get(g);s(O.url),c(O.playlist),l(!1),x(null);return}let p=!0;const E=new AbortController,w=E.signal,N=setTimeout(async()=>{var U,$,b,Z;if(!p)return;l(!0),x(null);let O=0;for(;O<or&&p;)try{const G=r&&!t?Mt(e,r):kr(e,t),d=setTimeout(()=>E.abort(),Yt),P=await fetch(G,{method:"GET",headers:{"api-key":S,Accept:"application/json","Cache-Control":"no-cache"},signal:w});if(clearTimeout(d),!P.ok)throw new Error(`Fetch failed with status ${P.status}`);const _=await P.json();if(!p)return;if(r&&!t){const B=($=(U=_.result)==null?void 0:U.items)==null?void 0:$.find(M=>M.mediaId===r);if(!(B!=null&&B.playbackUrl))throw new Error("Invalid video data");s(B.playbackUrl),c(null),g&&je.set(g,{url:B.playbackUrl,playlist:null})}else{if(!Array.isArray(_.result))throw new Error("Invalid playlist format");const B=zt(e,t),M=await fetch(B,{method:"GET",headers:{"api-key":S,Accept:"application/json","Cache-Control":"no-cache"},signal:w});if(M.ok){const q=await M.json();let z=[..._.result];if((b=q.result)!=null&&b.playlistBackupState&&((Z=q.result)!=null&&Z.playlistBackupId)){const H=kr(e,q.result.playlistBackupId),W=await fetch(H,{method:"GET",headers:{"api-key":S,Accept:"application/json","Cache-Control":"no-cache"},signal:w});if(W.ok){const h=await W.json();if(Array.isArray(h.result)){const o=h.result.map(m=>({...m,isBackupPlaylist:!0}));z=[...z,...o]}}}c(z),s(null),g&&je.set(g,{url:null,playlist:z})}else c(_.result),s(null),g&&je.set(g,{url:null,playlist:_.result})}break}catch(G){if(w.aborted){p&&x("Request timed out");break}if(O++,O>=or){const d=G instanceof Error?G.message:String(G);p&&x(`Failed after ${or} attempts: ${d}`)}else await new Promise(d=>setTimeout(d,2e3))}p&&l(!1)},100);return()=>{p=!1,clearTimeout(N),E.abort()}},[S,e,r,t,i]),{fetchedPlaybackUrl:n,fetchedPlaylist:u,isLoading:y,error:f}},Lr=({playerId:e,playerInstanceRef:r,playerRef:t,videoData:i,trackingMetadata:a,callbacks:n})=>{const s=v.useRef(!1),u=v.useRef(!1),c=v.useRef(!1),y=v.useRef(0),l=v.useRef({}),f=v.useRef(null),x=v.useRef(null),S=v.useRef(null),g=v.useRef(!1),p=v.useRef(!1);v.useEffect(()=>{if(!(n&&(n.onPlayerStart||n.onPlayerPlay||n.onPlayerPause||n.onPlayerResume||n.onPlayerEnd||n.onPlayerProgressEvery10Seconds||n.onPlayerProgressAt20Seconds||n.onPlayerQuartile25||n.onPlayerQuartile50||n.onPlayerQuartile75||n.onPlayerNext||n.onPlayerPrevious||n.onPlayerEvent)))return;(()=>{s.current=!1,u.current=!1,c.current=!1,y.current=0,l.current={}})();const C=()=>{var _;const d=document.getElementById(e);if(!d)return null;if(d.querySelectorAll("video").length>1&&r.current){const B=r.current,M=B.videoIndex??((_=B.playlist)==null?void 0:_.playlistVideoIndex)??0,q=d.querySelector(`video[id="${M}"]`);if(q)return q;const z=d.querySelector("video.active");if(z)return z}return d.querySelector("video")},N=()=>{const d=C();if(!d)return!1;const P=(h,o)=>{var m,V,A,X,ee,J,de,D,te,fe,ae,Pe,He,le;switch(h){case"player_start":(m=n.onPlayerStart)==null||m.call(n,h);break;case"player_play":(V=n.onPlayerPlay)==null||V.call(n,h);break;case"player_pause":(A=n.onPlayerPause)==null||A.call(n,h);break;case"player_resume":(X=n.onPlayerResume)==null||X.call(n,h);break;case"player_end":(ee=n.onPlayerEnd)==null||ee.call(n,h);break;case"player_progress_every_10_seconds":o!==void 0&&((J=n.onPlayerProgressEvery10Seconds)==null||J.call(n,h,o));break;case"player_progress_at_20_seconds":o!==void 0&&((de=n.onPlayerProgressAt20Seconds)==null||de.call(n,h,o));break;case"player_quartile_25":o!==void 0&&((D=n.onPlayerQuartile25)==null||D.call(n,h,o));break;case"player_quartile_50":o!==void 0&&((te=n.onPlayerQuartile50)==null||te.call(n,h,o));break;case"player_quartile_75":o!==void 0&&((fe=n.onPlayerQuartile75)==null||fe.call(n,h,o));break;case"player_next":(ae=n.onPlayerNext)==null||ae.call(n,h);break;case"player_previous":(Pe=n.onPlayerPrevious)==null||Pe.call(n,h);break}o!==void 0&&(h==="player_progress_every_10_seconds"||h==="player_progress_at_20_seconds"||h==="player_quartile_25"||h==="player_quartile_50"||h==="player_quartile_75")?(He=n.onPlayerEvent)==null||He.call(n,h,o):(le=n.onPlayerEvent)==null||le.call(n,h)},_=()=>{if(!s.current){if(p.current){p.current=!1,s.current=!0,d.readyState>=2&&!d.paused&&setTimeout(()=>{!u.current&&!d.paused&&(P("player_play"),u.current=!0,c.current=!1)},100);return}P("player_start"),s.current=!0,d.readyState>=2&&!d.paused&&setTimeout(()=>{!u.current&&!d.paused&&(P("player_play"),u.current=!0,c.current=!1)},100)}},B=()=>{c.current?P("player_resume"):u.current?P("player_play"):(P("player_play"),u.current=!0),c.current=!1},M=()=>{d.ended||g.current||setTimeout(()=>{var h;if(!g.current){if(r.current&&x.current!==null){const o=r.current;if((o.videoIndex??((h=o.playlist)==null?void 0:h.playlistVideoIndex)??0)!==x.current)return}P("player_pause"),c.current=!0}},200)},q=()=>{P("player_end")},z=()=>{s.current&&!u.current&&d.currentTime>=1&&d.currentTime<1.5&&!d.paused&&(P("player_play"),u.current=!0,c.current=!1);const h=d.duration>0?d.currentTime/d.duration*100:0,o=Math.floor(d.currentTime);o-y.current>=10&&(y.current=o,P("player_progress_every_10_seconds",o)),o>=20&&!l.current[20]&&(l.current[20]=!0,P("player_progress_at_20_seconds",o)),h>=25&&!l.current[25]&&(l.current[25]=!0,P("player_quartile_25",o)),h>=50&&!l.current[50]&&(l.current[50]=!0,P("player_quartile_50",o)),h>=75&&!l.current[75]&&(l.current[75]=!0,P("player_quartile_75",o))};if(S.current&&S.current!==d){const h=S.current;h.removeEventListener("loadedmetadata",_),h.removeEventListener("play",B),h.removeEventListener("pause",M),h.removeEventListener("ended",q),h.removeEventListener("timeupdate",z)}S.current=d,d.addEventListener("loadedmetadata",_),d.addEventListener("play",B),d.addEventListener("pause",M),d.addEventListener("ended",q),d.addEventListener("timeupdate",z),d.readyState>=1&&(console.log("[useVPPlayerEvents] Video metadata already loaded, triggering player_start"),_());const H=document.getElementById(e),W=h=>{const o=h.target;(o.closest(".vp-next")||o.closest(".vrt-icon-down")||o.closest(".vrt-arrow.vrt-icon-down"))&&(g.current=!0,p.current=!0,P("player_next"),setTimeout(()=>{g.current=!1},500)),(o.closest(".vp-prev")||o.closest(".vp-previous")||o.closest(".vrt-icon-up")||o.closest(".vrt-arrow.vrt-icon-up"))&&(g.current=!0,p.current=!0,P("player_previous"),setTimeout(()=>{g.current=!1},500))};return H&&H.addEventListener("click",W,!0),f.current=()=>{const h=S.current||d;h.removeEventListener("loadedmetadata",_),h.removeEventListener("play",B),h.removeEventListener("pause",M),h.removeEventListener("ended",q),h.removeEventListener("timeupdate",z),H==null||H.removeEventListener("click",W,!0),S.current=null},!0};let O=null,U=!1;const $=()=>{if(!r.current)return;const d=r.current,P=document.getElementById(e),_=P==null?void 0:P.querySelectorAll("video");_&&_.length>1&&d.videoIndex!==void 0&&(O=window.setInterval(()=>{var M,q,z,H;try{const W=d.videoIndex??((M=d.playlist)==null?void 0:M.playlistVideoIndex)??0;if(x.current!==null&&W!==x.current){const h=W>x.current,o=h?"player_next":"player_previous";n&&!g.current&&(h?(q=n.onPlayerNext)==null||q.call(n,o):(z=n.onPlayerPrevious)==null||z.call(n,o),(H=n.onPlayerEvent)==null||H.call(n,o)),g.current=!0,p.current=!0,f.current&&(f.current(),f.current=null),u.current=!1,c.current=!1,y.current=0,l.current={},S.current=null,setTimeout(()=>{N(),setTimeout(()=>{g.current=!1},200)},100)}x.current=W}catch{}},500))};let b=0;const Z=20,G=setInterval(()=>{b++,N()&&!U?(console.log(`[useVPPlayerEvents] Successfully set up event tracking on attempt ${b}`),U=!0,clearInterval(G),setTimeout(()=>{$()},1e3)):b>=Z&&(console.warn(`[useVPPlayerEvents] Failed to set up event tracking after ${Z} attempts for playerId: ${e}`),clearInterval(G))},500);return()=>{clearInterval(G),O!==null&&(clearInterval(O),O=null),f.current&&(f.current(),f.current=null)}},[e,i,a,n,r,t])},Gt={projectId:"vp-player-projectId",video:{file:"",playlist:{state:!0,playlistVideoIndex:0,videos:[]}},config:{autoplay:!0,muted:!0,loop:!1,size:{width:"100%",height:"30vh"},controls:{settingsButton:!0,chromecastButton:!1,nextButton:!0,fullscreenButton:!0,airplayButton:!1,bigPlayButton:!1,autopausePlayButton:!0,pictureInPictureButton:!1,relatedButton:!1,volumeButton:!0,shareButton:!0}}},jr=({videoUrl:e,fetchedPlaybackUrl:r,fetchedPlaylist:t,projectId:i,config:a={},isVerticalPlayer:n})=>{var l,f,x,S,g,p,E,w,C,N,O,U,$,b,Z,G;const s={...Gt,...a},u={...s.config,...a.config};if(e)return{...s,video:{...s.video,file:e,playlist:void 0},config:u};if(r)return{...s,video:{...s.video,file:r,playlist:void 0},config:u};if(t&&t.length>0){const d=((f=(l=a==null?void 0:a.video)==null?void 0:l.playlist)==null?void 0:f.playlistVideoIndex)??((x=a==null?void 0:a.config)==null?void 0:x.playlistVideoIndex)??0;return n?{...s,projectId:i||"vp-player-projectId",video:{...s.video,videoId:(S=t[0])==null?void 0:S.mediaId,file:(g=t[0])==null?void 0:g.hlsUrl,title:(p=t[0])==null?void 0:p.title,playlist:{state:!0,playlistId:"",playlistVideoIndex:Number(d),videos:t.slice(1).map((_,B)=>({videoId:_.mediaId||String(B+1),title:_.title,file:_.hlsUrl,thumbnailUrl:_.thumbnailUrl,duration:_.duration}))}},config:u}:{...s,projectId:i||"vp-player-projectId",video:{...s.video,videoId:((E=t[Number(d)])==null?void 0:E.mediaId)||((w=t[0])==null?void 0:w.mediaId),file:((C=t[Number(d)])==null?void 0:C.hlsUrl)||((N=t[0])==null?void 0:N.hlsUrl)||"",title:((O=t[Number(d)])==null?void 0:O.title)||((U=t[0])==null?void 0:U.title),thumbnail:(($=t[Number(d)])==null?void 0:$.thumbnailUrl)||((b=t[0])==null?void 0:b.thumbnailUrl),playlist:{state:!0,playlistVideoIndex:Number(d),videos:t.map((_,B)=>({videoId:_.mediaId||String(B),title:_.title,file:_.hlsUrl,thumbnailUrl:_.thumbnailUrl,duration:_.duration}))}},config:u}}const c=((Z=a==null?void 0:a.video)==null?void 0:Z.playlist)||s.video.playlist,y=(G=a==null?void 0:a.video)==null?void 0:G.file;if(y)return{...s,video:{...s.video,file:y,playlist:void 0},config:u};if(c!=null&&c.videos&&c.videos.length>0){const d=c.videos[Number(c.playlistVideoIndex)||0];return{...s,video:{...s.video,file:(d==null?void 0:d.file)||"",playlist:{...c,state:c.state??!0,playlistVideoIndex:Number(c.playlistVideoIndex||0),videos:c.videos}},config:{...s.config,...a==null?void 0:a.config}}}throw new Error("No valid video source found. Provide videoUrl, videoId, playlistId, or config with video.file or playlist.")},$r=e=>{if(!e)return;const r=/https:\/\/host\.vpplayer\.tech\/player\/([^/]+)\/([^/]+)(?:\/[^/]+)?\.js/,t=e.match(r);return t?t[2]:void 0},Nr=({playerId:e,videoId:r,version:t,videoUrl:i,projectId:a,playlistId:n,scriptUrl:s,config:u={},apiKey:c,isReels:y=!1,onPlaylistData:l,onVideoStarted:f,trackingMetadata:x,onPlayerStart:S,onPlayerPlay:g,onPlayerPause:p,onPlayerResume:E,onPlayerEnd:w,onPlayerProgressEvery10Seconds:C,onPlayerProgressAt20Seconds:N,onPlayerQuartile25:O,onPlayerQuartile50:U,onPlayerQuartile75:$,onPlayerNext:b,onPlayerPrevious:Z,onPlayerEvent:G})=>{const d=v.useRef(null),P=v.useRef(null),_=v.useRef(!1),B=v.useRef(""),M=v.useRef([]),q=v.useRef([]),z=v.useRef(null),{isLoaded:H,error:W}=Or(t,s),h=r||$r(s),[o,m]=v.useState(null),{fetchedPlaybackUrl:V,fetchedPlaylist:A,isLoading:X,error:ee}=Vr({projectId:a,videoId:h,playlistId:n,videoUrl:i,apiKey:c}),J=ir(e,h),[de,D]=v.useState(void 0);v.useEffect(()=>{A&&l&&l(A)},[A,l]),Lr({playerId:J,playerInstanceRef:P,playerRef:d,videoData:de,trackingMetadata:x,callbacks:{onPlayerStart:S,onPlayerPlay:g,onPlayerPause:p,onPlayerResume:E,onPlayerEnd:w,onPlayerProgressEvery10Seconds:C,onPlayerProgressAt20Seconds:N,onPlayerQuartile25:O,onPlayerQuartile50:U,onPlayerQuartile75:$,onPlayerNext:b,onPlayerPrevious:Z,onPlayerEvent:G}});const fe=v.useMemo(()=>{const ae=u.config||{},Pe=y&&!ae.size?{sizeType:"RESPONSIVE",aspectRatio:"9:16"}:ae.size||{sizeType:"FIXED",width:"100%"};return{...u,config:{...ae,size:Pe}}},[u,y]);return v.useEffect(()=>{if(W){m(W);return}if(!H||X&&!i)return;let ae=!0;const He=setTimeout(async()=>{try{M.current.forEach(se=>clearInterval(se)),M.current=[],q.current.forEach(se=>clearTimeout(se)),q.current=[],z.current=null;const le=(A==null?void 0:A.length)??0,$e=JSON.stringify({playerId:J,videoId:r||h,playlistId:n,videoUrl:i,fetchedPlaybackUrl:V,scriptUrl:s,isReels:y,projectId:a,playlistLength:le});if(_.current&&P.current&&B.current===$e)return;B.current!==$e&&(_.current=!1,B.current=$e);const Ne=s==null?void 0:s.includes("vertical-player");if(document.querySelectorAll('[id*="player"]').forEach(se=>{var Ie,T;const ge=se.id;if(ge!==J)try{const I=Ne?(Ie=window.vpVerticalPlayer)==null?void 0:Ie.call(window,ge):(T=window.vpPlayer)==null?void 0:T.call(window,ge);I!=null&&I.destroy&&I.destroy()}catch(I){console.warn(`Failed to destroy existing player ${ge}:`,I)}}),await new Promise(se=>setTimeout(se,100)),!ae||!d.current)return;if(!document.getElementById(J)){m("DOM element not found after cleanup.");return}if(!window.vpPlayer&&!window.vpVerticalPlayer){m("VP Player script not loaded.");return}const Fr=Ne?window.vpVerticalPlayer:window.vpPlayer;if(!Fr){m(`VP ${Ne?"Vertical ":""}Player script not loaded.`);return}const Se=jr({videoUrl:i,fetchedPlaybackUrl:V??void 0,fetchedPlaylist:A??void 0,projectId:a,config:fe,isVerticalPlayer:Ne}),K=Fr(J);if(!K){m(`Failed to create VP ${Ne?"Vertical ":""}Player instance.`);return}if(ae&&d.current&&(K.setup(Se),P.current=K,_.current=!0,m(null),f&&K.on)){const se=()=>{var I;const T={};if(A&&A.length>0){const F=K.videoIndex??((I=K.playlist)==null?void 0:I.playlistVideoIndex)??0,L=A[F];L&&(T.title=L.title,T.hlsUrl=L.hlsUrl,T.file=L.hlsUrl,T.thumbnailUrl=L.thumbnailUrl,T.duration=L.duration,T.videoIndex=F,T.playlistVideoIndex=F,T.isBackupPlaylist=L.isBackupPlaylist,T.mediaId=L.mediaId,T.videoId=L.mediaId||L.videoId)}else Se.video&&(T.title=Se.video.title,T.file=Se.video.file,T.hlsUrl=Se.video.file,T.thumbnailUrl=Se.video.thumbnail,T.videoId=r||h,T.videoIndex=0,T.playlistVideoIndex=0,K.getDuration&&(T.duration=K.getDuration()));return T};let ge=null;const Ie=async()=>{var T;try{ge&&clearTimeout(ge),await new Promise(L=>setTimeout(L,100));let I=se();const F=I.videoId||I.mediaId;if(F&&F===z.current)return;if(ge=window.setTimeout(()=>{z.current=null},500),y&&F)try{const ve=`https://host.vpplayer.tech/player/ptkzurnx/${F}.json`,xe=await fetch(ve);if(xe.ok){const ne=await xe.json();ne&&ne.video&&(I={...I,title:ne.video.title||I.title,description:ne.video.description,publishDate:ne.video.publishDate,projectId:ne.projectId||I.projectId,premium:((T=ne.video.videoLocking)==null?void 0:T.isEnabled)||!1,author:ne.video.author,tags:ne.video.tags||[]})}}catch{}z.current=F||null,D(I),f(I)}catch(I){console.warn("Error in video-started handler:",I)}};if(y){let T=!1,I=-1;const F=()=>{if(!T){T=!0;try{K.on&&K.on("vp-video-started",Ie),setTimeout(()=>{Ie(),I=K.videoIndex??0},500)}catch(ne){console.error("Error setting up event listeners:",ne)}}};let L=0;const ve=15,xe=setInterval(()=>{try{const ne=K.videoIndex!==void 0||K.playlist;if(!T)L++,(ne||L>=ve)&&F();else{const Ce=K.videoIndex??0;Ce!==I&&I!==-1&&(I=Ce,Ie())}}catch{}},200);M.current.push(xe);try{K.on&&K.on("vp-listen-ready",F)}catch{}}else{const T=async I=>{var F,L;try{const ve=s==null?void 0:s.match(/player\/([^/.]+)/),xe=ve==null?void 0:ve[1];if(!xe||!I)return se();const ne=`https://host.vpplayer.tech/player/${xe}/${I}.json`,Ce=await fetch(ne);if(!Ce.ok)return console.warn("Failed to fetch full video config:",Ce.status),se();const ce=await Ce.json();return!ce||!ce.video?se():{videoId:I,title:ce.video.title,description:ce.video.description,file:ce.video.file,hlsUrl:ce.video.file,thumbnailUrl:ce.video.thumbnail,duration:ce.video.duration,publishDate:ce.video.publishDate,projectId:ce.projectId,premium:((F=ce.video.videoLocking)==null?void 0:F.isEnabled)||!1,author:ce.video.author,tags:ce.video.tags||[],videoIndex:K.videoIndex??0,playlistVideoIndex:((L=K.playlist)==null?void 0:L.playlistVideoIndex)??0}}catch(ve){return console.warn("Error fetching full video data:",ve),se()}};K.on("ready",async I=>{try{const F=(I==null?void 0:I.id)||r||h;if(F){const L=await T(F);D(L),f(L)}else{const L=se();(L.title||L.file)&&(D(L),f(L))}}catch(F){console.warn("Error in ready handler:",F)}}),K.on("playlistItem",async I=>{try{const F=I==null?void 0:I.id;if(F){const L=await T(F);D(L),f(L)}}catch(F){console.warn("Error in playlistItem handler:",F)}})}}}catch(le){if(ae){const $e=le instanceof Error?le.message:String(le);m($e),console.error("VP Player initialization error:",le)}}},150);return()=>{ae=!1,clearTimeout(He),M.current.forEach(le=>clearInterval(le)),M.current=[],q.current.forEach(le=>clearTimeout(le)),q.current=[],_.current=!1}},[H,X,J,W,s]),v.useEffect(()=>()=>{if(P.current){try{P.current.destroy&&P.current.destroy()}catch(Pe){console.warn(`Failed to destroy player ${J}:`,Pe)}P.current=null}_.current=!1;const ae=document.getElementById(J);ae&&(ae.innerHTML="")},[J]),{playerRef:d,playerInstanceRef:P,isScriptLoaded:H,isLoading:X,error:ee||o||W}},Br=({playerId:e,videoId:r,version:t,videoUrl:i,projectId:a,playlistId:n,scriptUrl:s,config:u={},apiKey:c,isReels:y=!1,hiddenClasses:l=[],onClose:f,className:x,onPlaylistData:S,onVideoStarted:g,trackingMetadata:p,onPlayerStart:E,onPlayerPlay:w,onPlayerPause:C,onPlayerResume:N,onPlayerEnd:O,onPlayerProgressEvery10Seconds:U,onPlayerProgressAt20Seconds:$,onPlayerQuartile25:b,onPlayerQuartile50:Z,onPlayerQuartile75:G,onPlayerNext:d,onPlayerPrevious:P,onPlayerEvent:_})=>{var ee,J,de,D;const{playerRef:B,playerInstanceRef:M,isScriptLoaded:q,isLoading:z,error:H}=Nr({playerId:e,videoId:r,version:t,videoUrl:i,projectId:a,playlistId:n,scriptUrl:s,config:u,apiKey:c,isReels:y,onPlaylistData:S,onVideoStarted:g,trackingMetadata:p,onPlayerStart:E,onPlayerPlay:w,onPlayerPause:C,onPlayerResume:N,onPlayerEnd:O,onPlayerProgressEvery10Seconds:U,onPlayerProgressAt20Seconds:$,onPlayerQuartile25:b,onPlayerQuartile50:Z,onPlayerQuartile75:G,onPlayerNext:d,onPlayerPrevious:P,onPlayerEvent:_}),[W,h]=v.useState(!0),o=()=>y&&h(!0),m=()=>{var te,fe;h(!1),(fe=(te=M.current)==null?void 0:te.play)==null||fe.call(te),f==null||f()},V=(J=(ee=u==null?void 0:u.config)==null?void 0:ee.size)!=null&&J.width?typeof u.config.size.width=="number"?`${u.config.size.width}px`:u.config.size.width:void 0,A=(D=(de=u==null?void 0:u.config)==null?void 0:de.size)!=null&&D.height?typeof u.config.size.height=="number"?`${u.config.size.height}px`:u.config.size.height:void 0,X=ir(e,r);return H?Q.jsxs(tr,{type:"error",children:["An error occurred: ",H]}):z||!q?Q.jsx(tr,{type:"loading",children:"Loading..."}):Q.jsxs(Q.Fragment,{children:[y&&!W?Q.jsx("div",{onClick:o}):null,!y&&Q.jsx("div",{children:Q.jsx(nr,{id:X,ref:B,width:V||"100%",height:A||"auto",$hiddenClasses:l,className:x})},X),y&&W&&Q.jsx(Tr,{onClick:m,className:x,children:Q.jsx(Rr,{className:x,onClick:te=>te.stopPropagation(),children:Q.jsx("div",{children:Q.jsx(nr,{id:X,ref:B,width:"100%",height:"auto",$hiddenClasses:l,className:x})},X)})})]})},Dr=v.createContext(void 0),Ht=({children:e})=>{const[r,t]=v.useState(!1),[i,a]=v.useState(null),[n,s]=v.useState(null),u=v.useCallback(l=>{try{const f=ir(l.playerId,l.videoId);a({...l,playerId:f}),t(!0),s(null)}catch{s("Failed to show player.")}},[]),c=v.useCallback(()=>{t(!1),a(null),s(null)},[]),y=v.useMemo(()=>({showPlayer:u,hidePlayer:c,isPlayerVisible:r,playerParams:i}),[u,c,r,i]);return Q.jsxs(Dr.Provider,{value:y,children:[e,n&&Q.jsx(tr,{type:"error",children:n}),r&&(i==null?void 0:i.playerId)&&Q.jsx(Br,{playerId:i.playerId,videoId:i.videoId,projectId:i.projectId,videoUrl:i.videoUrl,version:i.version,playlistId:i.playlistId,scriptUrl:i.scriptUrl,config:i.config,isReels:i.isReels,thumbnailUrl:i.thumbnailUrl,onClose:c,hiddenClasses:i.hiddenClasses||[],apiKey:i.apiKey,className:i.className})]})},Xt=()=>{const e=v.useContext(Dr);if(!e)throw new Error("useVPPlayer must be used within a VPPlayerProvider");return e},Kt={projectId:"vp-player-projectId",video:{file:"",playlist:{state:!0,playlistVideoIndex:0,videos:[]}},config:{autoplay:!0,pauseOtherVideos:!0,focusOnAutostart:!1,muted:!0,loop:!1,size:{width:"100%"},controls:{settingsButton:!0,chromecastButton:!1,nextButton:!1,fullscreenButton:!0,airplayButton:!1,bigPlayButton:!1,autopausePlayButton:!0,pictureInPictureButton:!1,relatedButton:!1,volumeButton:!0,shareButton:!0}}},Jt={config:{autostartOnLoad:{state:!0,onMobile:!0,onData:!0},muted:!0}},Qt={config:{autoplay:!0,muted:!0}},Ge={video:{advertising:!0,ads:{skipAd:{state:!0,skipFrom:5}}},config:{adAnnouncement:{state:!0,timeBeforeAd:5},adsRequireInteraction:!1}},Zt=(e,r,t="time",i=0)=>{var a;return{...Ge,video:{...Ge.video,ads:{...(a=Ge.video)==null?void 0:a.ads,adBreaks:[{adTagUrl:r,breakType:e,breakTimingType:t,breakTimingValue:i}]}}}},en="http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4",rn="http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4",tn="https://videos.pexels.com/video-files/4678261/4678261-hd_1080_1920_25fps.mp4",nn="https://images.pexels.com/videos/4678261/pexels-photo-4678261.jpeg?auto=compress&cs=tinysrgb&w=600",an="https://pubads.g.doubleclick.net/gampad/ads?sz=640x480&iu=/124319096/external/single_ad_samples&ciu_szs=300x250&impl=s&gdfp_req=1&env=vp&output=vast&unviewed_position_start=1&cust_params=deployment%3Ddevsite%26sample_ct%3Dlinear&correlator=",on="https://pubads.g.doubleclick.net/gampad/ads?sz=640x480&iu=/124319096/external/single_ad_samples&ciu_szs=300x250&impl=s&gdfp_req=1&env=vp&output=vast&unviewed_position_start=1&cust_params=deployment%3Ddevsite%26sample_ct%3Dskippablelinear&correlator=";j.AD_TAG_LINEAR_URL=an,j.AD_TAG_SKIPPABLE_LINEAR_URL=on,j.BIG_BUCK_BUNNY_URL=en,j.ELEPHANTS_DREAM_URL=rn,j.Overlay=Tr,j.PEXELS_THUMBNAIL_URL=nn,j.PEXELS_VERTICAL_VIDEO_URL=tn,j.PlayerContainer=nr,j.PlayerWrapper=Rr,j.VPPlayer=Br,j.VPPlayerProvider=Ht,j.baseConfig=Jt,j.baseConfigWithAds=Ge,j.baseConfigWithAutoplay=Qt,j.buildVPPlayerConfig=jr,j.defaultVPPlayerConfig=Kt,j.extractVideoId=$r,j.getAdConfig=Zt,j.useVPPlayer=Xt,j.useVPPlayerEvents=Lr,j.useVPPlayerLogic=Nr,j.useVPPlayerScript=Or,j.useVideoData=Vr,Object.defineProperty(j,Symbol.toStringTag,{value:"Module"})});
|
|
81
|
+
`,Mt=(e,r)=>`https://vp-api.gjirafa.tech/api/v2/projects/${e}/videos?search=${r}`,kr=(e,r)=>`https://vp-api.gjirafa.tech/api/projects/${e}/playlists/${r}/videos`,zt=(e,r)=>`https://vp-api.gjirafa.tech/api/projects/${e}/playlists/${r}`,qt=e=>`https://host.vpplayer.tech/player/${e}/vpplayer.js`,ir=(e,r)=>`vp-player-${e||"default"}-${r||""}`,ar=new Map,Or=(e,r)=>{const[t,i]=v.useState(!1),[a,n]=v.useState(null);return v.useEffect(()=>{let s=null,u,c=0;const y=3;let l;try{l=r||qt(e||"latest")}catch(S){const E=S instanceof Error?S.message:String(S);n(`Failed to resolve script URL: ${E}`),i(!1);return}if(ar.get(l)){i(!0),n(null);return}if(document.querySelector(`script[src="${l}"]`)){ar.set(l,!0),i(!0),n(null);return}const P=()=>{s=document.createElement("script"),s.src=l,s.async=!0,u=window.setTimeout(()=>{i(!1),n(`Loading script timed out: ${l}`)},1e4),s.onload=()=>{clearTimeout(u),ar.set(l,!0),i(!0),n(null)},s.onerror=()=>{clearTimeout(u),c++,c<y?setTimeout(P,1e3*c):(i(!1),n(`Failed to load VP Player script after ${y} attempts: ${l}`))},document.body.appendChild(s)};return P(),()=>{clearTimeout(u),s&&document.body.contains(s)&&document.body.removeChild(s)}},[e,r]),{isLoaded:t,error:a}},Wt={},$e=new Map,Yt=3e4,or=5,Lr=({projectId:e,videoId:r,playlistId:t,videoUrl:i,apiKey:a})=>{const[n,s]=v.useState(null),[u,c]=v.useState(null),[y,l]=v.useState(!1),[h,P]=v.useState(null),S=a||(typeof Wt<"u"?"1CFC4B619E9342B6BAC4879BA8C30CF216C4BA9D3F084B11825F4AB2D5CF845E":void 0);return v.useEffect(()=>{const E=r?`video:${r}`:t?`playlist:${t}`:null;if(!e||i||!r&&!t){s(i||null),c(null),l(!1),P(null);return}if(!S){l(!1),P("No API key provided");return}if(E&&$e.has(E)){const O=$e.get(E);s(O.url),c(O.playlist),l(!1),P(null);return}let d=!0;const x=new AbortController,b=x.signal,N=setTimeout(async()=>{var U,$,w,re;if(!d)return;l(!0),P(null);let O=0;for(;O<or&&d;)try{const G=r&&!t?Mt(e,r):kr(e,t),f=setTimeout(()=>x.abort(),Yt),g=await fetch(G,{method:"GET",headers:{"api-key":S,Accept:"application/json","Cache-Control":"no-cache"},signal:b});if(clearTimeout(f),!g.ok)throw new Error(`Fetch failed with status ${g.status}`);const _=await g.json();if(!d)return;if(r&&!t){const B=($=(U=_.result)==null?void 0:U.items)==null?void 0:$.find(M=>M.mediaId===r);if(!(B!=null&&B.playbackUrl))throw new Error("Invalid video data");s(B.playbackUrl),c(null),E&&$e.set(E,{url:B.playbackUrl,playlist:null})}else{if(!Array.isArray(_.result))throw new Error("Invalid playlist format");const B=zt(e,t),M=await fetch(B,{method:"GET",headers:{"api-key":S,Accept:"application/json","Cache-Control":"no-cache"},signal:b});if(M.ok){const q=await M.json();let z=[..._.result];if((w=q.result)!=null&&w.playlistBackupState&&((re=q.result)!=null&&re.playlistBackupId)){const H=kr(e,q.result.playlistBackupId),W=await fetch(H,{method:"GET",headers:{"api-key":S,Accept:"application/json","Cache-Control":"no-cache"},signal:b});if(W.ok){const p=await W.json();if(Array.isArray(p.result)){const o=p.result.map(m=>({...m,isBackupPlaylist:!0}));z=[...z,...o]}}}c(z),s(null),E&&$e.set(E,{url:null,playlist:z})}else c(_.result),s(null),E&&$e.set(E,{url:null,playlist:_.result})}break}catch(G){if(b.aborted){d&&P("Request timed out");break}if(O++,O>=or){const f=G instanceof Error?G.message:String(G);d&&P(`Failed after ${or} attempts: ${f}`)}else await new Promise(f=>setTimeout(f,2e3))}d&&l(!1)},100);return()=>{d=!1,clearTimeout(N),x.abort()}},[S,e,r,t,i]),{fetchedPlaybackUrl:n,fetchedPlaylist:u,isLoading:y,error:h}},Vr=({playerId:e,playerInstanceRef:r,playerRef:t,videoData:i,trackingMetadata:a,callbacks:n})=>{const s=v.useRef(!1),u=v.useRef(!1),c=v.useRef(!1),y=v.useRef(0),l=v.useRef({}),h=v.useRef(null),P=v.useRef(null),S=v.useRef(null),E=v.useRef(null),d=v.useRef(!1);v.useEffect(()=>{if(!(n&&(n.onPlayerStart||n.onPlayerPlay||n.onPlayerPause||n.onPlayerResume||n.onPlayerEnd||n.onPlayerProgressEvery10Seconds||n.onPlayerProgressAt20Seconds||n.onPlayerQuartile25||n.onPlayerQuartile50||n.onPlayerQuartile75||n.onPlayerNext||n.onPlayerPrevious||n.onPlayerEvent)))return;(()=>{s.current=!1,u.current=!1,c.current=!1,y.current=0,l.current={}})();const C=()=>{var _;const f=document.getElementById(e);if(!f)return null;if(f.querySelectorAll("video").length>1&&r.current){const B=r.current,M=B.videoIndex??((_=B.playlist)==null?void 0:_.playlistVideoIndex)??0,q=f.querySelector(`video[id="${M}"]`);if(q)return q;const z=f.querySelector("video.active");if(z)return z}return f.querySelector("video")},N=()=>{const f=C();if(!f)return!1;const g=(p,o)=>{var L,A,X,Z,J,de,D,te,fe,ae,xe,He,le,ge;const m=Date.now();if(!(p==="player_start"&&s.current)){switch(E.current={type:p,time:m},p){case"player_start":(L=n.onPlayerStart)==null||L.call(n,p);break;case"player_play":(A=n.onPlayerPlay)==null||A.call(n,p);break;case"player_pause":(X=n.onPlayerPause)==null||X.call(n,p);break;case"player_resume":(Z=n.onPlayerResume)==null||Z.call(n,p);break;case"player_end":(J=n.onPlayerEnd)==null||J.call(n,p);break;case"player_progress_every_10_seconds":o!==void 0&&((de=n.onPlayerProgressEvery10Seconds)==null||de.call(n,p,o));break;case"player_progress_at_20_seconds":o!==void 0&&((D=n.onPlayerProgressAt20Seconds)==null||D.call(n,p,o));break;case"player_quartile_25":o!==void 0&&((te=n.onPlayerQuartile25)==null||te.call(n,p,o));break;case"player_quartile_50":o!==void 0&&((fe=n.onPlayerQuartile50)==null||fe.call(n,p,o));break;case"player_quartile_75":o!==void 0&&((ae=n.onPlayerQuartile75)==null||ae.call(n,p,o));break;case"player_next":(xe=n.onPlayerNext)==null||xe.call(n,p);break;case"player_previous":(He=n.onPlayerPrevious)==null||He.call(n,p);break}o!==void 0&&(p==="player_progress_every_10_seconds"||p==="player_progress_at_20_seconds"||p==="player_quartile_25"||p==="player_quartile_50"||p==="player_quartile_75")?(le=n.onPlayerEvent)==null||le.call(n,p,o):(ge=n.onPlayerEvent)==null||ge.call(n,p)}},_=()=>{s.current||(g("player_start"),s.current=!0,f.readyState>=2&&!f.paused&&setTimeout(()=>{!u.current&&!f.paused&&(g("player_play"),u.current=!0,c.current=!1)},100))},B=()=>{c.current?g("player_resume"):u.current?g("player_play"):(g("player_play"),u.current=!0),c.current=!1},M=()=>{f.ended||d.current||setTimeout(()=>{var p;if(!d.current){if(r.current&&P.current!==null){const o=r.current;if((o.videoIndex??((p=o.playlist)==null?void 0:p.playlistVideoIndex)??0)!==P.current)return}g("player_pause"),c.current=!0}},200)},q=()=>{g("player_end")},z=()=>{s.current&&!u.current&&f.currentTime>=1&&f.currentTime<1.5&&!f.paused&&(g("player_play"),u.current=!0,c.current=!1);const p=f.duration>0?f.currentTime/f.duration*100:0,o=Math.floor(f.currentTime);o-y.current>=10&&(y.current=o,g("player_progress_every_10_seconds",o)),o>=20&&!l.current[20]&&(l.current[20]=!0,g("player_progress_at_20_seconds",o)),p>=25&&!l.current[25]&&(l.current[25]=!0,g("player_quartile_25",o)),p>=50&&!l.current[50]&&(l.current[50]=!0,g("player_quartile_50",o)),p>=75&&!l.current[75]&&(l.current[75]=!0,g("player_quartile_75",o))};if(S.current&&S.current!==f){const p=S.current;p.removeEventListener("loadedmetadata",_),p.removeEventListener("play",B),p.removeEventListener("pause",M),p.removeEventListener("ended",q),p.removeEventListener("timeupdate",z)}S.current=f,f.addEventListener("loadedmetadata",_),f.addEventListener("play",B),f.addEventListener("pause",M),f.addEventListener("ended",q),f.addEventListener("timeupdate",z),f.readyState>=1&&_();const H=document.getElementById(e),W=p=>{const o=p.target;(o.closest(".vp-next")||o.closest(".vrt-icon-down")||o.closest(".vrt-arrow.vrt-icon-down"))&&(d.current=!0,g("player_next"),setTimeout(()=>{d.current=!1},500)),(o.closest(".vp-prev")||o.closest(".vp-previous")||o.closest(".vrt-icon-up")||o.closest(".vrt-arrow.vrt-icon-up"))&&(d.current=!0,g("player_previous"),setTimeout(()=>{d.current=!1},500))};return H&&H.addEventListener("click",W,!0),h.current=()=>{const p=S.current||f;p.removeEventListener("loadedmetadata",_),p.removeEventListener("play",B),p.removeEventListener("pause",M),p.removeEventListener("ended",q),p.removeEventListener("timeupdate",z),H==null||H.removeEventListener("click",W,!0),S.current=null},!0};let O=null,U=!1;const $=()=>{if(!r.current)return;const f=r.current,g=document.getElementById(e),_=g==null?void 0:g.querySelectorAll("video");_&&_.length>1&&f.videoIndex!==void 0&&(O=window.setInterval(()=>{var M,q,z,H;try{const W=f.videoIndex??((M=f.playlist)==null?void 0:M.playlistVideoIndex)??0;if(P.current!==null&&W!==P.current){const p=W>P.current,o=p?"player_next":"player_previous";n&&!d.current&&(p?(q=n.onPlayerNext)==null||q.call(n,o):(z=n.onPlayerPrevious)==null||z.call(n,o),(H=n.onPlayerEvent)==null||H.call(n,o)),d.current=!0,h.current&&(h.current(),h.current=null),s.current=!1,u.current=!1,c.current=!1,y.current=0,l.current={},S.current=null,setTimeout(()=>{N(),setTimeout(()=>{d.current=!1},200)},100)}P.current=W}catch{}},500))};let w=0;const re=20,G=setInterval(()=>{w++,N()&&!U?(U=!0,clearInterval(G),setTimeout(()=>{$()},1e3)):w>=re&&clearInterval(G)},500);return()=>{clearInterval(G),O!==null&&(clearInterval(O),O=null),h.current&&(h.current(),h.current=null)}},[e,i,a,n,r,t])},Gt={projectId:"vp-player-projectId",video:{file:"",playlist:{state:!0,playlistVideoIndex:0,videos:[]}},config:{autoplay:!0,muted:!0,loop:!1,size:{width:"100%",height:"30vh"},controls:{settingsButton:!0,chromecastButton:!1,nextButton:!0,fullscreenButton:!0,airplayButton:!1,bigPlayButton:!1,autopausePlayButton:!0,pictureInPictureButton:!1,relatedButton:!1,volumeButton:!0,shareButton:!0}}},jr=({videoUrl:e,fetchedPlaybackUrl:r,fetchedPlaylist:t,projectId:i,config:a={},isVerticalPlayer:n})=>{var l,h,P,S,E,d,x,b,C,N,O,U,$,w,re,G;const s={...Gt,...a},u={...s.config,...a.config};if(e)return{...s,video:{...s.video,file:e,playlist:void 0},config:u};if(r)return{...s,video:{...s.video,file:r,playlist:void 0},config:u};if(t&&t.length>0){const f=((h=(l=a==null?void 0:a.video)==null?void 0:l.playlist)==null?void 0:h.playlistVideoIndex)??((P=a==null?void 0:a.config)==null?void 0:P.playlistVideoIndex)??0;return n?{...s,projectId:i||"vp-player-projectId",video:{...s.video,videoId:(S=t[0])==null?void 0:S.mediaId,file:(E=t[0])==null?void 0:E.hlsUrl,title:(d=t[0])==null?void 0:d.title,playlist:{state:!0,playlistId:"",playlistVideoIndex:Number(f),videos:t.slice(1).map((_,B)=>({videoId:_.mediaId||String(B+1),title:_.title,file:_.hlsUrl,thumbnailUrl:_.thumbnailUrl,duration:_.duration}))}},config:u}:{...s,projectId:i||"vp-player-projectId",video:{...s.video,videoId:((x=t[Number(f)])==null?void 0:x.mediaId)||((b=t[0])==null?void 0:b.mediaId),file:((C=t[Number(f)])==null?void 0:C.hlsUrl)||((N=t[0])==null?void 0:N.hlsUrl)||"",title:((O=t[Number(f)])==null?void 0:O.title)||((U=t[0])==null?void 0:U.title),thumbnail:(($=t[Number(f)])==null?void 0:$.thumbnailUrl)||((w=t[0])==null?void 0:w.thumbnailUrl),playlist:{state:!0,playlistVideoIndex:Number(f),videos:t.map((_,B)=>({videoId:_.mediaId||String(B),title:_.title,file:_.hlsUrl,thumbnailUrl:_.thumbnailUrl,duration:_.duration}))}},config:u}}const c=((re=a==null?void 0:a.video)==null?void 0:re.playlist)||s.video.playlist,y=(G=a==null?void 0:a.video)==null?void 0:G.file;if(y)return{...s,video:{...s.video,file:y,playlist:void 0},config:u};if(c!=null&&c.videos&&c.videos.length>0){const f=c.videos[Number(c.playlistVideoIndex)||0];return{...s,video:{...s.video,file:(f==null?void 0:f.file)||"",playlist:{...c,state:c.state??!0,playlistVideoIndex:Number(c.playlistVideoIndex||0),videos:c.videos}},config:{...s.config,...a==null?void 0:a.config}}}throw new Error("No valid video source found. Provide videoUrl, videoId, playlistId, or config with video.file or playlist.")},$r=e=>{if(!e)return;const r=/https:\/\/host\.vpplayer\.tech\/player\/([^/]+)\/([^/]+)(?:\/[^/]+)?\.js/,t=e.match(r);return t?t[2]:void 0},Nr=({playerId:e,videoId:r,version:t,videoUrl:i,projectId:a,playlistId:n,scriptUrl:s,config:u={},apiKey:c,isReels:y=!1,onPlaylistData:l,onVideoStarted:h,trackingMetadata:P,onPlayerStart:S,onPlayerPlay:E,onPlayerPause:d,onPlayerResume:x,onPlayerEnd:b,onPlayerProgressEvery10Seconds:C,onPlayerProgressAt20Seconds:N,onPlayerQuartile25:O,onPlayerQuartile50:U,onPlayerQuartile75:$,onPlayerNext:w,onPlayerPrevious:re,onPlayerEvent:G})=>{const f=v.useRef(null),g=v.useRef(null),_=v.useRef(!1),B=v.useRef(""),M=v.useRef([]),q=v.useRef([]),z=v.useRef(null),{isLoaded:H,error:W}=Or(t,s),p=r||$r(s),[o,m]=v.useState(null),{fetchedPlaybackUrl:L,fetchedPlaylist:A,isLoading:X,error:Z}=Lr({projectId:a,videoId:p,playlistId:n,videoUrl:i,apiKey:c}),J=ir(e,p),[de,D]=v.useState(void 0);v.useEffect(()=>{A&&l&&l(A)},[A,l]),Vr({playerId:J,playerInstanceRef:g,playerRef:f,videoData:de,trackingMetadata:P,callbacks:{onPlayerStart:S,onPlayerPlay:E,onPlayerPause:d,onPlayerResume:x,onPlayerEnd:b,onPlayerProgressEvery10Seconds:C,onPlayerProgressAt20Seconds:N,onPlayerQuartile25:O,onPlayerQuartile50:U,onPlayerQuartile75:$,onPlayerNext:w,onPlayerPrevious:re,onPlayerEvent:G}});const fe=v.useMemo(()=>{const ae=u.config||{},xe=y&&!ae.size?{sizeType:"RESPONSIVE",aspectRatio:"9:16"}:ae.size||{sizeType:"FIXED",width:"100%"};return{...u,config:{...ae,size:xe}}},[u,y]);return v.useEffect(()=>{if(W){m(W);return}if(!H||X&&!i)return;let ae=!0;const He=setTimeout(async()=>{try{M.current.forEach(se=>clearInterval(se)),M.current=[],q.current.forEach(se=>clearTimeout(se)),q.current=[],z.current=null;const le=(A==null?void 0:A.length)??0,ge=JSON.stringify({playerId:J,videoId:r||p,playlistId:n,videoUrl:i,fetchedPlaybackUrl:L,scriptUrl:s,isReels:y,projectId:a,playlistLength:le});if(_.current&&g.current&&B.current===ge)return;B.current!==ge&&(_.current=!1,B.current=ge);const Ne=s==null?void 0:s.includes("vertical-player");if(document.querySelectorAll('[id*="player"]').forEach(se=>{var Ce,T;const Pe=se.id;if(Pe!==J)try{const I=Ne?(Ce=window.vpVerticalPlayer)==null?void 0:Ce.call(window,Pe):(T=window.vpPlayer)==null?void 0:T.call(window,Pe);I!=null&&I.destroy&&I.destroy()}catch(I){console.warn(`Failed to destroy existing player ${Pe}:`,I)}}),await new Promise(se=>setTimeout(se,100)),!ae||!f.current)return;if(!document.getElementById(J)){m("DOM element not found after cleanup.");return}if(!window.vpPlayer&&!window.vpVerticalPlayer){m("VP Player script not loaded.");return}const Fr=Ne?window.vpVerticalPlayer:window.vpPlayer;if(!Fr){m(`VP ${Ne?"Vertical ":""}Player script not loaded.`);return}const Ie=jr({videoUrl:i,fetchedPlaybackUrl:L??void 0,fetchedPlaylist:A??void 0,projectId:a,config:fe,isVerticalPlayer:Ne}),K=Fr(J);if(!K){m(`Failed to create VP ${Ne?"Vertical ":""}Player instance.`);return}if(ae&&f.current&&(K.setup(Ie),g.current=K,_.current=!0,m(null),h&&K.on)){const se=()=>{var I;const T={};if(A&&A.length>0){const F=K.videoIndex??((I=K.playlist)==null?void 0:I.playlistVideoIndex)??0,V=A[F];V&&(T.title=V.title,T.hlsUrl=V.hlsUrl,T.file=V.hlsUrl,T.thumbnailUrl=V.thumbnailUrl,T.duration=V.duration,T.videoIndex=F,T.playlistVideoIndex=F,T.isBackupPlaylist=V.isBackupPlaylist,T.mediaId=V.mediaId,T.videoId=V.mediaId||V.videoId)}else Ie.video&&(T.title=Ie.video.title,T.file=Ie.video.file,T.hlsUrl=Ie.video.file,T.thumbnailUrl=Ie.video.thumbnail,T.videoId=r||p,T.videoIndex=0,T.playlistVideoIndex=0,K.getDuration&&(T.duration=K.getDuration()));return T};let Pe=null;const Ce=async()=>{var T;try{Pe&&clearTimeout(Pe),await new Promise(V=>setTimeout(V,100));let I=se();const F=I.videoId||I.mediaId;if(F&&F===z.current)return;if(Pe=window.setTimeout(()=>{z.current=null},500),y&&F)try{const ve=`https://host.vpplayer.tech/player/ptkzurnx/${F}.json`,be=await fetch(ve);if(be.ok){const ne=await be.json();ne&&ne.video&&(I={...I,title:ne.video.title||I.title,description:ne.video.description,publishDate:ne.video.publishDate,projectId:ne.projectId||I.projectId,premium:((T=ne.video.videoLocking)==null?void 0:T.isEnabled)||!1,author:ne.video.author,tags:ne.video.tags||[]})}}catch{}z.current=F||null,D(I),h(I)}catch(I){console.warn("Error in video-started handler:",I)}};if(y){let T=!1,I=-1;const F=()=>{if(!T){T=!0;try{K.on&&K.on("vp-video-started",Ce),setTimeout(()=>{Ce(),I=K.videoIndex??0},500)}catch(ne){console.error("Error setting up event listeners:",ne)}}};let V=0;const ve=15,be=setInterval(()=>{try{const ne=K.videoIndex!==void 0||K.playlist;if(!T)V++,(ne||V>=ve)&&F();else{const Ae=K.videoIndex??0;Ae!==I&&I!==-1&&(I=Ae,Ce())}}catch{}},200);M.current.push(be);try{K.on&&K.on("vp-listen-ready",F)}catch{}}else{const T=async I=>{var F,V;try{const ve=s==null?void 0:s.match(/player\/([^/.]+)/),be=ve==null?void 0:ve[1];if(!be||!I)return se();const ne=`https://host.vpplayer.tech/player/${be}/${I}.json`,Ae=await fetch(ne);if(!Ae.ok)return console.warn("Failed to fetch full video config:",Ae.status),se();const ce=await Ae.json();return!ce||!ce.video?se():{videoId:I,title:ce.video.title,description:ce.video.description,file:ce.video.file,hlsUrl:ce.video.file,thumbnailUrl:ce.video.thumbnail,duration:ce.video.duration,publishDate:ce.video.publishDate,projectId:ce.projectId,premium:((F=ce.video.videoLocking)==null?void 0:F.isEnabled)||!1,author:ce.video.author,tags:ce.video.tags||[],videoIndex:K.videoIndex??0,playlistVideoIndex:((V=K.playlist)==null?void 0:V.playlistVideoIndex)??0}}catch(ve){return console.warn("Error fetching full video data:",ve),se()}};K.on("ready",async I=>{try{const F=(I==null?void 0:I.id)||r||p;if(F){const V=await T(F);D(V),h(V)}else{const V=se();(V.title||V.file)&&(D(V),h(V))}}catch(F){console.warn("Error in ready handler:",F)}}),K.on("playlistItem",async I=>{try{const F=I==null?void 0:I.id;if(F){const V=await T(F);D(V),h(V)}}catch(F){console.warn("Error in playlistItem handler:",F)}})}}}catch(le){if(ae){const ge=le instanceof Error?le.message:String(le);m(ge),console.error("VP Player initialization error:",le)}}},150);return()=>{ae=!1,clearTimeout(He),M.current.forEach(le=>clearInterval(le)),M.current=[],q.current.forEach(le=>clearTimeout(le)),q.current=[],_.current=!1}},[H,X,J,W,s]),v.useEffect(()=>()=>{if(g.current){try{g.current.destroy&&g.current.destroy()}catch(xe){console.warn(`Failed to destroy player ${J}:`,xe)}g.current=null}_.current=!1;const ae=document.getElementById(J);ae&&(ae.innerHTML="")},[J]),{playerRef:f,playerInstanceRef:g,isScriptLoaded:H,isLoading:X,error:Z||o||W}},Br=({playerId:e,videoId:r,version:t,videoUrl:i,projectId:a,playlistId:n,scriptUrl:s,config:u={},apiKey:c,isReels:y=!1,hiddenClasses:l=[],onClose:h,className:P,onPlaylistData:S,onVideoStarted:E,trackingMetadata:d,onPlayerStart:x,onPlayerPlay:b,onPlayerPause:C,onPlayerResume:N,onPlayerEnd:O,onPlayerProgressEvery10Seconds:U,onPlayerProgressAt20Seconds:$,onPlayerQuartile25:w,onPlayerQuartile50:re,onPlayerQuartile75:G,onPlayerNext:f,onPlayerPrevious:g,onPlayerEvent:_})=>{var Z,J,de,D;const{playerRef:B,playerInstanceRef:M,isScriptLoaded:q,isLoading:z,error:H}=Nr({playerId:e,videoId:r,version:t,videoUrl:i,projectId:a,playlistId:n,scriptUrl:s,config:u,apiKey:c,isReels:y,onPlaylistData:S,onVideoStarted:E,trackingMetadata:d,onPlayerStart:x,onPlayerPlay:b,onPlayerPause:C,onPlayerResume:N,onPlayerEnd:O,onPlayerProgressEvery10Seconds:U,onPlayerProgressAt20Seconds:$,onPlayerQuartile25:w,onPlayerQuartile50:re,onPlayerQuartile75:G,onPlayerNext:f,onPlayerPrevious:g,onPlayerEvent:_}),[W,p]=v.useState(!0),o=()=>y&&p(!0),m=()=>{var te,fe;p(!1),(fe=(te=M.current)==null?void 0:te.play)==null||fe.call(te),h==null||h()},L=(J=(Z=u==null?void 0:u.config)==null?void 0:Z.size)!=null&&J.width?typeof u.config.size.width=="number"?`${u.config.size.width}px`:u.config.size.width:void 0,A=(D=(de=u==null?void 0:u.config)==null?void 0:de.size)!=null&&D.height?typeof u.config.size.height=="number"?`${u.config.size.height}px`:u.config.size.height:void 0,X=ir(e,r);return H?Q.jsxs(tr,{type:"error",children:["An error occurred: ",H]}):z||!q?Q.jsx(tr,{type:"loading",children:"Loading..."}):Q.jsxs(Q.Fragment,{children:[y&&!W?Q.jsx("div",{onClick:o}):null,!y&&Q.jsx("div",{children:Q.jsx(nr,{id:X,ref:B,width:L||"100%",height:A||"auto",$hiddenClasses:l,className:P})},X),y&&W&&Q.jsx(Tr,{onClick:m,className:P,children:Q.jsx(Rr,{className:P,onClick:te=>te.stopPropagation(),children:Q.jsx("div",{children:Q.jsx(nr,{id:X,ref:B,width:"100%",height:"auto",$hiddenClasses:l,className:P})},X)})})]})},Dr=v.createContext(void 0),Ht=({children:e})=>{const[r,t]=v.useState(!1),[i,a]=v.useState(null),[n,s]=v.useState(null),u=v.useCallback(l=>{try{const h=ir(l.playerId,l.videoId);a({...l,playerId:h}),t(!0),s(null)}catch{s("Failed to show player.")}},[]),c=v.useCallback(()=>{t(!1),a(null),s(null)},[]),y=v.useMemo(()=>({showPlayer:u,hidePlayer:c,isPlayerVisible:r,playerParams:i}),[u,c,r,i]);return Q.jsxs(Dr.Provider,{value:y,children:[e,n&&Q.jsx(tr,{type:"error",children:n}),r&&(i==null?void 0:i.playerId)&&Q.jsx(Br,{playerId:i.playerId,videoId:i.videoId,projectId:i.projectId,videoUrl:i.videoUrl,version:i.version,playlistId:i.playlistId,scriptUrl:i.scriptUrl,config:i.config,isReels:i.isReels,thumbnailUrl:i.thumbnailUrl,onClose:c,hiddenClasses:i.hiddenClasses||[],apiKey:i.apiKey,className:i.className})]})},Xt=()=>{const e=v.useContext(Dr);if(!e)throw new Error("useVPPlayer must be used within a VPPlayerProvider");return e},Kt={projectId:"vp-player-projectId",video:{file:"",playlist:{state:!0,playlistVideoIndex:0,videos:[]}},config:{autoplay:!0,pauseOtherVideos:!0,focusOnAutostart:!1,muted:!0,loop:!1,size:{width:"100%"},controls:{settingsButton:!0,chromecastButton:!1,nextButton:!1,fullscreenButton:!0,airplayButton:!1,bigPlayButton:!1,autopausePlayButton:!0,pictureInPictureButton:!1,relatedButton:!1,volumeButton:!0,shareButton:!0}}},Jt={config:{autostartOnLoad:{state:!0,onMobile:!0,onData:!0},muted:!0}},Qt={config:{autoplay:!0,muted:!0}},Ge={video:{advertising:!0,ads:{skipAd:{state:!0,skipFrom:5}}},config:{adAnnouncement:{state:!0,timeBeforeAd:5},adsRequireInteraction:!1}},Zt=(e,r,t="time",i=0)=>{var a;return{...Ge,video:{...Ge.video,ads:{...(a=Ge.video)==null?void 0:a.ads,adBreaks:[{adTagUrl:r,breakType:e,breakTimingType:t,breakTimingValue:i}]}}}},en="http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4",rn="http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4",tn="https://videos.pexels.com/video-files/4678261/4678261-hd_1080_1920_25fps.mp4",nn="https://images.pexels.com/videos/4678261/pexels-photo-4678261.jpeg?auto=compress&cs=tinysrgb&w=600",an="https://pubads.g.doubleclick.net/gampad/ads?sz=640x480&iu=/124319096/external/single_ad_samples&ciu_szs=300x250&impl=s&gdfp_req=1&env=vp&output=vast&unviewed_position_start=1&cust_params=deployment%3Ddevsite%26sample_ct%3Dlinear&correlator=",on="https://pubads.g.doubleclick.net/gampad/ads?sz=640x480&iu=/124319096/external/single_ad_samples&ciu_szs=300x250&impl=s&gdfp_req=1&env=vp&output=vast&unviewed_position_start=1&cust_params=deployment%3Ddevsite%26sample_ct%3Dskippablelinear&correlator=";j.AD_TAG_LINEAR_URL=an,j.AD_TAG_SKIPPABLE_LINEAR_URL=on,j.BIG_BUCK_BUNNY_URL=en,j.ELEPHANTS_DREAM_URL=rn,j.Overlay=Tr,j.PEXELS_THUMBNAIL_URL=nn,j.PEXELS_VERTICAL_VIDEO_URL=tn,j.PlayerContainer=nr,j.PlayerWrapper=Rr,j.VPPlayer=Br,j.VPPlayerProvider=Ht,j.baseConfig=Jt,j.baseConfigWithAds=Ge,j.baseConfigWithAutoplay=Qt,j.buildVPPlayerConfig=jr,j.defaultVPPlayerConfig=Kt,j.extractVideoId=$r,j.getAdConfig=Zt,j.useVPPlayer=Xt,j.useVPPlayerEvents=Vr,j.useVPPlayerLogic=Nr,j.useVPPlayerScript=Or,j.useVideoData=Lr,Object.defineProperty(j,Symbol.toStringTag,{value:"Module"})});
|