@devix-technologies/react-gjirafa-vp-player 1.0.18 → 1.0.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +271 -0
- package/dist/react-gjirafa-vp-player.es.js +767 -623
- package/dist/react-gjirafa-vp-player.umd.js +8 -8
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(O,P){typeof exports=="object"&&typeof module<"u"?P(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],P):(O=typeof globalThis<"u"?globalThis:O||self,P(O.ReactGjirafaVPPlayer={},O.React))})(this,function(O,P){"use strict";function _t(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const ce=_t(P);var _e={exports:{}},ge={};/**
|
|
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
|
|
9
|
+
*/var qe;function St(){if(qe)return ge;qe=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function r(n,a,i){var o=null;if(i!==void 0&&(o=""+i),a.key!==void 0&&(o=""+a.key),"key"in a){i={};for(var l in a)l!=="key"&&(i[l]=a[l])}else i=a;return a=i.ref,{$$typeof:e,type:n,key:o,ref:a!==void 0?a:null,props:i}}return ge.Fragment=t,ge.jsx=r,ge.jsxs=r,ge}var ve={};/**
|
|
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
|
|
17
|
+
*/var He;function Tt(){return He||(He=1,process.env.NODE_ENV!=="production"&&function(){function e(s){if(s==null)return null;if(typeof s=="function")return s.$$typeof===N?null:s.displayName||s.name||null;if(typeof s=="string")return s;switch(s){case d:return"Fragment";case g:return"Profiler";case y:return"StrictMode";case V:return"Suspense";case $:return"SuspenseList";case _:return"Activity"}if(typeof s=="object")switch(typeof s.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),s.$$typeof){case v:return"Portal";case j:return(s.displayName||"Context")+".Provider";case E:return(s._context.displayName||"Context")+".Consumer";case C:var w=s.render;return s=s.displayName,s||(s=w.displayName||w.name||"",s=s!==""?"ForwardRef("+s+")":"ForwardRef"),s;case f:return w=s.displayName||null,w!==null?w:e(s.type)||"Memo";case X:w=s._payload,s=s._init;try{return e(s(w))}catch{}}return null}function t(s){return""+s}function r(s){try{t(s);var w=!1}catch{w=!0}if(w){w=console;var L=w.error,U=typeof Symbol=="function"&&Symbol.toStringTag&&s[Symbol.toStringTag]||s.constructor.name||"Object";return L.call(w,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",U),t(s)}}function n(s){if(s===d)return"<>";if(typeof s=="object"&&s!==null&&s.$$typeof===X)return"<...>";try{var w=e(s);return w?"<"+w+">":"<...>"}catch{return"<...>"}}function a(){var s=G.A;return s===null?null:s.getOwner()}function i(){return Error("react-stack-top-frame")}function o(s){if(M.call(s,"key")){var w=Object.getOwnPropertyDescriptor(s,"key").get;if(w&&w.isReactWarning)return!1}return s.key!==void 0}function l(s,w){function L(){W||(W=!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)",w))}L.isReactWarning=!0,Object.defineProperty(s,"key",{get:L,configurable:!0})}function u(){var s=e(this.type);return te[s]||(te[s]=!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.")),s=this.props.ref,s!==void 0?s:null}function m(s,w,L,U,R,F,re,le){return L=F.ref,s={$$typeof:k,type:s,key:w,props:F,_owner:R},(L!==void 0?L:null)!==null?Object.defineProperty(s,"ref",{enumerable:!1,get:u}):Object.defineProperty(s,"ref",{enumerable:!1,value:null}),s._store={},Object.defineProperty(s._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(s,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(s,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:re}),Object.defineProperty(s,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:le}),Object.freeze&&(Object.freeze(s.props),Object.freeze(s)),s}function c(s,w,L,U,R,F,re,le){var h=w.children;if(h!==void 0)if(U)if(Z(h)){for(U=0;U<h.length;U++)p(h[U]);Object.freeze&&Object.freeze(h)}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 p(h);if(M.call(w,"key")){h=e(s);var b=Object.keys(w).filter(function(I){return I!=="key"});U=0<b.length?"{key: someKey, "+b.join(": ..., ")+": ...}":"{key: someKey}",ae[h+U]||(b=0<b.length?"{"+b.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} />`,M,U,se,U),te[U+M]=!0)}if(U=null,O!==void 0&&(r(O),U=""+O),o(m)&&(r(m.key),U=""+m.key),"key"in m){O={};for(var Me in m)Me!=="key"&&(O[Me]=m[Me])}else O=m;return U&&c(O,typeof s=="function"?s.displayName||s.name||"Unknown":s),y(s,U,Z,re,a(),O,Fe,Be)}function f(s){typeof s=="object"&&s!==null&&s.$$typeof===k&&s._store&&(s._store.validated=1)}var b=P,k=Symbol.for("react.transitional.element"),g=Symbol.for("react.portal"),d=Symbol.for("react.fragment"),v=Symbol.for("react.strict_mode"),p=Symbol.for("react.profiler"),w=Symbol.for("react.consumer"),S=Symbol.for("react.context"),A=Symbol.for("react.forward_ref"),j=Symbol.for("react.suspense"),x=Symbol.for("react.suspense_list"),h=Symbol.for("react.memo"),I=Symbol.for("react.lazy"),C=Symbol.for("react.activity"),$=Symbol.for("react.client.reference"),R=b.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,z=Object.prototype.hasOwnProperty,Y=Array.isArray,V=console.createTask?console.createTask:function(){return null};b={"react-stack-bottom-frame":function(s){return s()}};var G,q={},ee=b["react-stack-bottom-frame"].bind(b,i)(),J=V(n(i)),te={};le.Fragment=d,le.jsx=function(s,m,O,M,re){var Z=1e4>R.recentlyCreatedOwnerStacks++;return l(s,m,O,!1,M,re,Z?Error("react-stack-top-frame"):ee,Z?V(n(s)):J)},le.jsxs=function(s,m,O,M,re){var Z=1e4>R.recentlyCreatedOwnerStacks++;return l(s,m,O,!0,M,re,Z?Error("react-stack-top-frame"):ee,Z?V(n(s)):J)}}()),le}var ze;function Pt(){return ze||(ze=1,process.env.NODE_ENV==="production"?ye.exports=wt():ye.exports=xt()),ye.exports}var N=Pt();function Se(){return Se=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Se.apply(null,arguments)}function kt(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}function Et(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),e.nonce!==void 0&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}var _t=function(){function e(r){var n=this;this._insertTag=function(a){var i;n.tags.length===0?n.insertionPoint?i=n.insertionPoint.nextSibling:n.prepend?i=n.container.firstChild:i=n.before:i=n.tags[n.tags.length-1].nextSibling,n.container.insertBefore(a,i),n.tags.push(a)},this.isSpeedy=r.speedy===void 0?!0:r.speedy,this.tags=[],this.ctr=0,this.nonce=r.nonce,this.key=r.key,this.container=r.container,this.prepend=r.prepend,this.insertionPoint=r.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(n){n.forEach(this._insertTag)},t.insert=function(n){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(Et(this));var a=this.tags[this.tags.length-1];if(this.isSpeedy){var i=kt(a);try{i.insertRule(n,i.cssRules.length)}catch{}}else a.appendChild(document.createTextNode(n));this.ctr++},t.flush=function(){this.tags.forEach(function(n){var a;return(a=n.parentNode)==null?void 0:a.removeChild(n)}),this.tags=[],this.ctr=0},e}(),B="-ms-",ge="-moz-",E="-webkit-",We="comm",Ae="rule",Ce="decl",St="@import",Ye="@keyframes",At="@layer",Ct=Math.abs,be=String.fromCharCode,Tt=Object.assign;function Rt(e,t){return F(e,0)^45?(((t<<2^F(e,0))<<2^F(e,1))<<2^F(e,2))<<2^F(e,3):0}function Ge(e){return e.trim()}function It(e,t){return(e=t.exec(e))?e[0]:e}function _(e,t,r){return e.replace(t,r)}function Te(e,t){return e.indexOf(t)}function F(e,t){return e.charCodeAt(t)|0}function ue(e,t,r){return e.slice(t,r)}function H(e){return e.length}function Re(e){return e.length}function ve(e,t){return t.push(e),e}function Ot(e,t){return e.map(t).join("")}var we=1,ne=1,qe=0,D=0,L=0,ae="";function xe(e,t,r,n,a,i,o){return{value:e,root:t,parent:r,type:n,props:a,children:i,line:we,column:ne,length:o,return:""}}function de(e,t){return Tt(xe("",null,null,"",null,null,0),e,{length:-e.length},t)}function jt(){return L}function $t(){return L=D>0?F(ae,--D):0,ne--,L===10&&(ne=1,we--),L}function W(){return L=D<qe?F(ae,D++):0,ne++,L===10&&(ne=1,we++),L}function X(){return F(ae,D)}function Pe(){return D}function fe(e,t){return ue(ae,e,t)}function pe(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 He(e){return we=ne=1,qe=H(ae=e),D=0,[]}function Xe(e){return ae="",e}function ke(e){return Ge(fe(D-1,Ie(e===91?e+2:e===40?e+1:e)))}function Lt(e){for(;(L=X())&&L<33;)W();return pe(e)>2||pe(L)>3?"":" "}function Nt(e,t){for(;--t&&W()&&!(L<48||L>102||L>57&&L<65||L>70&&L<97););return fe(e,Pe()+(t<6&&X()==32&&W()==32))}function Ie(e){for(;W();)switch(L){case e:return D;case 34:case 39:e!==34&&e!==39&&Ie(L);break;case 40:e===41&&Ie(e);break;case 92:W();break}return D}function Vt(e,t){for(;W()&&e+L!==57;)if(e+L===84&&X()===47)break;return"/*"+fe(t,D-1)+"*"+be(e===47?e:W())}function Ft(e){for(;!pe(X());)W();return fe(e,D)}function Bt(e){return Xe(Ee("",null,null,null,[""],e=He(e),0,[0],e))}function Ee(e,t,r,n,a,i,o,c,u){for(var y=0,l=0,f=o,b=0,k=0,g=0,d=1,v=1,p=1,w=0,S="",A=a,j=i,x=n,h=S;v;)switch(g=w,w=W()){case 40:if(g!=108&&F(h,f-1)==58){Te(h+=_(ke(w),"&","&\f"),"&\f")!=-1&&(p=-1);break}case 34:case 39:case 91:h+=ke(w);break;case 9:case 10:case 13:case 32:h+=Lt(g);break;case 92:h+=Nt(Pe()-1,7);continue;case 47:switch(X()){case 42:case 47:ve(Mt(Vt(W(),Pe()),t,r),u);break;default:h+="/"}break;case 123*d:c[y++]=H(h)*p;case 125*d:case 59:case 0:switch(w){case 0:case 125:v=0;case 59+l:p==-1&&(h=_(h,/\f/g,"")),k>0&&H(h)-f&&ve(k>32?Je(h+";",n,r,f-1):Je(_(h," ","")+";",n,r,f-2),u);break;case 59:h+=";";default:if(ve(x=Ke(h,t,r,y,l,a,c,S,A=[],j=[],f),i),w===123)if(l===0)Ee(h,t,x,x,A,i,f,c,j);else switch(b===99&&F(h,3)===110?100:b){case 100:case 108:case 109:case 115:Ee(e,x,x,n&&ve(Ke(e,x,x,0,0,a,c,S,a,A=[],f),j),a,j,f,c,n?A:j);break;default:Ee(h,x,x,x,[""],j,0,c,j)}}y=l=k=0,d=p=1,S=h="",f=o;break;case 58:f=1+H(h),k=g;default:if(d<1){if(w==123)--d;else if(w==125&&d++==0&&$t()==125)continue}switch(h+=be(w),w*d){case 38:p=l>0?1:(h+="\f",-1);break;case 44:c[y++]=(H(h)-1)*p,p=1;break;case 64:X()===45&&(h+=ke(W())),b=X(),l=f=H(S=h+=Ft(Pe())),w++;break;case 45:g===45&&H(h)==2&&(d=0)}}return i}function Ke(e,t,r,n,a,i,o,c,u,y,l){for(var f=a-1,b=a===0?i:[""],k=Re(b),g=0,d=0,v=0;g<n;++g)for(var p=0,w=ue(e,f+1,f=Ct(d=o[g])),S=e;p<k;++p)(S=Ge(d>0?b[p]+" "+w:_(w,/&\f/g,b[p])))&&(u[v++]=S);return xe(e,t,r,a===0?Ae:c,u,y,l)}function Mt(e,t,r){return xe(e,t,r,We,be(jt()),ue(e,2,-2),0)}function Je(e,t,r,n){return xe(e,t,r,Ce,ue(e,0,n),ue(e,n+1,-1),n)}function ie(e,t){for(var r="",n=Re(e),a=0;a<n;a++)r+=t(e[a],a,e,t)||"";return r}function Ut(e,t,r,n){switch(e.type){case At:if(e.children.length)break;case St:case Ce:return e.return=e.return||e.value;case We:return"";case Ye:return e.return=e.value+"{"+ie(e.children,n)+"}";case Ae:e.value=e.props.join(",")}return H(r=ie(e.children,n))?e.return=e.value+"{"+r+"}":""}function Dt(e){var t=Re(e);return function(r,n,a,i){for(var o="",c=0;c<t;c++)o+=e[c](r,n,a,i)||"";return o}}function zt(e){return function(t){t.root||(t=t.return)&&e(t)}}function Ze(e){var t=Object.create(null);return function(r){return t[r]===void 0&&(t[r]=e(r)),t[r]}}var Wt=function(t,r,n){for(var a=0,i=0;a=i,i=X(),a===38&&i===12&&(r[n]=1),!pe(i);)W();return fe(t,D)},Yt=function(t,r){var n=-1,a=44;do switch(pe(a)){case 0:a===38&&X()===12&&(r[n]=1),t[n]+=Wt(D-1,r,n);break;case 2:t[n]+=ke(a);break;case 4:if(a===44){t[++n]=X()===58?"&\f":"",r[n]=t[n].length;break}default:t[n]+=be(a)}while(a=W());return t},Gt=function(t,r){return Xe(Yt(He(t),r))},Qe=new WeakMap,qt=function(t){if(!(t.type!=="rule"||!t.parent||t.length<1)){for(var r=t.value,n=t.parent,a=t.column===n.column&&t.line===n.line;n.type!=="rule";)if(n=n.parent,!n)return;if(!(t.props.length===1&&r.charCodeAt(0)!==58&&!Qe.get(n))&&!a){Qe.set(t,!0);for(var i=[],o=Gt(r,i),c=n.props,u=0,y=0;u<o.length;u++)for(var l=0;l<c.length;l++,y++)t.props[y]=i[u]?o[u].replace(/&\f/g,c[l]):c[l]+" "+o[u]}}},Ht=function(t){if(t.type==="decl"){var r=t.value;r.charCodeAt(0)===108&&r.charCodeAt(2)===98&&(t.return="",t.value="")}};function et(e,t){switch(Rt(e,t)){case 5103:return E+"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 E+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return E+e+ge+e+B+e+e;case 6828:case 4268:return E+e+B+e+e;case 6165:return E+e+B+"flex-"+e+e;case 5187:return E+e+_(e,/(\w+).+(:[^]+)/,E+"box-$1$2"+B+"flex-$1$2")+e;case 5443:return E+e+B+"flex-item-"+_(e,/flex-|-self/,"")+e;case 4675:return E+e+B+"flex-line-pack"+_(e,/align-content|flex-|-self/,"")+e;case 5548:return E+e+B+_(e,"shrink","negative")+e;case 5292:return E+e+B+_(e,"basis","preferred-size")+e;case 6060:return E+"box-"+_(e,"-grow","")+E+e+B+_(e,"grow","positive")+e;case 4554:return E+_(e,/([^-])(transform)/g,"$1"+E+"$2")+e;case 6187:return _(_(_(e,/(zoom-|grab)/,E+"$1"),/(image-set)/,E+"$1"),e,"")+e;case 5495:case 3959:return _(e,/(image-set\([^]*)/,E+"$1$`$1");case 4968:return _(_(e,/(.+:)(flex-)?(.*)/,E+"box-pack:$3"+B+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+E+e+e;case 4095:case 3583:case 4068:case 2532:return _(e,/(.+)-inline(.+)/,E+"$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(H(e)-1-t>6)switch(F(e,t+1)){case 109:if(F(e,t+4)!==45)break;case 102:return _(e,/(.+:)(.+)-([^]+)/,"$1"+E+"$2-$3$1"+ge+(F(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~Te(e,"stretch")?et(_(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(F(e,t+1)!==115)break;case 6444:switch(F(e,H(e)-3-(~Te(e,"!important")&&10))){case 107:return _(e,":",":"+E)+e;case 101:return _(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+E+(F(e,14)===45?"inline-":"")+"box$3$1"+E+"$2$3$1"+B+"$2box$3")+e}break;case 5936:switch(F(e,t+11)){case 114:return E+e+B+_(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return E+e+B+_(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return E+e+B+_(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return E+e+B+e+e}return e}var Xt=function(t,r,n,a){if(t.length>-1&&!t.return)switch(t.type){case Ce:t.return=et(t.value,t.length);break;case Ye:return ie([de(t,{value:_(t.value,"@","@"+E)})],a);case Ae:if(t.length)return Ot(t.props,function(i){switch(It(i,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return ie([de(t,{props:[_(i,/:(read-\w+)/,":"+ge+"$1")]})],a);case"::placeholder":return ie([de(t,{props:[_(i,/:(plac\w+)/,":"+E+"input-$1")]}),de(t,{props:[_(i,/:(plac\w+)/,":"+ge+"$1")]}),de(t,{props:[_(i,/:(plac\w+)/,B+"input-$1")]})],a)}return""})}},Kt=[Xt],Jt=function(t){var r=t.key;if(r==="css"){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,function(d){var v=d.getAttribute("data-emotion");v.indexOf(" ")!==-1&&(document.head.appendChild(d),d.setAttribute("data-s",""))})}var a=t.stylisPlugins||Kt,i={},o,c=[];o=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+r+' "]'),function(d){for(var v=d.getAttribute("data-emotion").split(" "),p=1;p<v.length;p++)i[v[p]]=!0;c.push(d)});var u,y=[qt,Ht];{var l,f=[Ut,zt(function(d){l.insert(d)})],b=Dt(y.concat(a,f)),k=function(v){return ie(Bt(v),b)};u=function(v,p,w,S){l=w,k(v?v+"{"+p.styles+"}":p.styles),S&&(g.inserted[p.name]=!0)}}var g={key:r,sheet:new _t({key:r,container:o,nonce:t.nonce,speedy:t.speedy,prepend:t.prepend,insertionPoint:t.insertionPoint}),nonce:t.nonce,inserted:i,registered:{},insert:u};return g.sheet.hydrate(c),g},Zt=!0;function Qt(e,t,r){var n="";return r.split(" ").forEach(function(a){e[a]!==void 0?t.push(e[a]+";"):a&&(n+=a+" ")}),n}var tt=function(t,r,n){var a=t.key+"-"+r.name;(n===!1||Zt===!1)&&t.registered[a]===void 0&&(t.registered[a]=r.styles)},er=function(t,r,n){tt(t,r,n);var a=t.key+"-"+r.name;if(t.inserted[r.name]===void 0){var i=r;do t.insert(r===i?"."+a:"",i,t.sheet,!0),i=i.next;while(i!==void 0)}};function tr(e){for(var t=0,r,n=0,a=e.length;a>=4;++n,a-=4)r=e.charCodeAt(n)&255|(e.charCodeAt(++n)&255)<<8|(e.charCodeAt(++n)&255)<<16|(e.charCodeAt(++n)&255)<<24,r=(r&65535)*1540483477+((r>>>16)*59797<<16),r^=r>>>24,t=(r&65535)*1540483477+((r>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(a){case 3:t^=(e.charCodeAt(n+2)&255)<<16;case 2:t^=(e.charCodeAt(n+1)&255)<<8;case 1:t^=e.charCodeAt(n)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var rr={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},nr=/[A-Z]|^ms/g,ar=/_EMO_([^_]+?)_([^]*?)_EMO_/g,rt=function(t){return t.charCodeAt(1)===45},nt=function(t){return t!=null&&typeof t!="boolean"},Oe=Ze(function(e){return rt(e)?e:e.replace(nr,"-$&").toLowerCase()}),at=function(t,r){switch(t){case"animation":case"animationName":if(typeof r=="string")return r.replace(ar,function(n,a,i){return K={name:a,styles:i,next:K},a})}return rr[t]!==1&&!rt(t)&&typeof r=="number"&&r!==0?r+"px":r};function he(e,t,r){if(r==null)return"";var n=r;if(n.__emotion_styles!==void 0)return n;switch(typeof r){case"boolean":return"";case"object":{var a=r;if(a.anim===1)return K={name:a.name,styles:a.styles,next:K},a.name;var i=r;if(i.styles!==void 0){var o=i.next;if(o!==void 0)for(;o!==void 0;)K={name:o.name,styles:o.styles,next:K},o=o.next;var c=i.styles+";";return c}return ir(e,t,r)}case"function":{if(e!==void 0){var u=K,y=r(e);return K=u,he(e,t,y)}break}}var l=r;if(t==null)return l;var f=t[l];return f!==void 0?f:l}function ir(e,t,r){var n="";if(Array.isArray(r))for(var a=0;a<r.length;a++)n+=he(e,t,r[a])+";";else for(var i in r){var o=r[i];if(typeof o!="object"){var c=o;t!=null&&t[c]!==void 0?n+=i+"{"+t[c]+"}":nt(c)&&(n+=Oe(i)+":"+at(i,c)+";")}else if(Array.isArray(o)&&typeof o[0]=="string"&&(t==null||t[o[0]]===void 0))for(var u=0;u<o.length;u++)nt(o[u])&&(n+=Oe(i)+":"+at(i,o[u])+";");else{var y=he(e,t,o);switch(i){case"animation":case"animationName":{n+=Oe(i)+":"+y+";";break}default:n+=i+"{"+y+"}"}}}return n}var it=/label:\s*([^\s;{]+)\s*(;|$)/g,K;function or(e,t,r){if(e.length===1&&typeof e[0]=="object"&&e[0]!==null&&e[0].styles!==void 0)return e[0];var n=!0,a="";K=void 0;var i=e[0];if(i==null||i.raw===void 0)n=!1,a+=he(r,t,i);else{var o=i;a+=o[0]}for(var c=1;c<e.length;c++)if(a+=he(r,t,e[c]),n){var u=i;a+=u[c]}it.lastIndex=0;for(var y="",l;(l=it.exec(a))!==null;)y+="-"+l[1];var f=tr(a)+y;return{name:f,styles:a,next:K}}var sr=function(t){return t()},cr=Q.useInsertionEffect?Q.useInsertionEffect:!1,lr=cr||sr,ot=Q.createContext(typeof HTMLElement<"u"?Jt({key:"css"}):null);ot.Provider;var ur=function(t){return P.forwardRef(function(r,n){var a=P.useContext(ot);return t(r,a,n)})},dr=Q.createContext({}),fr=/^((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)-.*))$/,pr=Ze(function(e){return fr.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91}),hr=pr,mr=function(t){return t!=="theme"},st=function(t){return typeof t=="string"&&t.charCodeAt(0)>96?hr:mr},ct=function(t,r,n){var a;if(r){var i=r.shouldForwardProp;a=t.__emotion_forwardProp&&i?function(o){return t.__emotion_forwardProp(o)&&i(o)}:i}return typeof a!="function"&&n&&(a=t.__emotion_forwardProp),a},yr=function(t){var r=t.cache,n=t.serialized,a=t.isStringTag;return tt(r,n,a),lr(function(){return er(r,n,a)}),null},gr=function e(t,r){var n=t.__emotion_real===t,a=n&&t.__emotion_base||t,i,o;r!==void 0&&(i=r.label,o=r.target);var c=ct(t,r,n),u=c||st(a),y=!u("as");return function(){var l=arguments,f=n&&t.__emotion_styles!==void 0?t.__emotion_styles.slice(0):[];if(i!==void 0&&f.push("label:"+i+";"),l[0]==null||l[0].raw===void 0)f.push.apply(f,l);else{var b=l[0];f.push(b[0]);for(var k=l.length,g=1;g<k;g++)f.push(l[g],b[g])}var d=ur(function(v,p,w){var S=y&&v.as||a,A="",j=[],x=v;if(v.theme==null){x={};for(var h in v)x[h]=v[h];x.theme=Q.useContext(dr)}typeof v.className=="string"?A=Qt(p.registered,j,v.className):v.className!=null&&(A=v.className+" ");var I=or(f.concat(j),p.registered,x);A+=p.key+"-"+I.name,o!==void 0&&(A+=" "+o);var C=y&&c===void 0?st(S):u,$={};for(var R in v)y&&R==="as"||C(R)&&($[R]=v[R]);return $.className=A,w&&($.ref=w),Q.createElement(Q.Fragment,null,Q.createElement(yr,{cache:p,serialized:I,isStringTag:typeof S=="string"}),Q.createElement(S,$))});return d.displayName=i!==void 0?i:"Styled("+(typeof a=="string"?a:a.displayName||a.name||"Component")+")",d.defaultProps=t.defaultProps,d.__emotion_real=d,d.__emotion_base=a,d.__emotion_styles=f,d.__emotion_forwardProp=c,Object.defineProperty(d,"toString",{value:function(){return"."+o}}),d.withComponent=function(v,p){var w=e(v,Se({},r,p,{shouldForwardProp:ct(d,p,!0)}));return w.apply(void 0,f)},d}},br=["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"],oe=gr.bind(null);br.forEach(function(e){oe[e]=oe(e)});const vr=oe.div`
|
|
22
|
+
<%s key={someKey} {...props} />`,U,h,b,h),ae[h+U]=!0)}if(h=null,L!==void 0&&(r(L),h=""+L),o(w)&&(r(w.key),h=""+w.key),"key"in w){L={};for(var A in w)A!=="key"&&(L[A]=w[A])}else L=w;return h&&l(L,typeof s=="function"?s.displayName||s.name||"Unknown":s),m(s,h,F,R,a(),L,re,le)}function p(s){typeof s=="object"&&s!==null&&s.$$typeof===k&&s._store&&(s._store.validated=1)}var x=P,k=Symbol.for("react.transitional.element"),v=Symbol.for("react.portal"),d=Symbol.for("react.fragment"),y=Symbol.for("react.strict_mode"),g=Symbol.for("react.profiler"),E=Symbol.for("react.consumer"),j=Symbol.for("react.context"),C=Symbol.for("react.forward_ref"),V=Symbol.for("react.suspense"),$=Symbol.for("react.suspense_list"),f=Symbol.for("react.memo"),X=Symbol.for("react.lazy"),_=Symbol.for("react.activity"),N=Symbol.for("react.client.reference"),G=x.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,M=Object.prototype.hasOwnProperty,Z=Array.isArray,D=console.createTask?console.createTask:function(){return null};x={"react-stack-bottom-frame":function(s){return s()}};var W,te={},K=x["react-stack-bottom-frame"].bind(x,i)(),ne=D(n(i)),ae={};ve.Fragment=d,ve.jsx=function(s,w,L,U,R){var F=1e4>G.recentlyCreatedOwnerStacks++;return c(s,w,L,!1,U,R,F?Error("react-stack-top-frame"):K,F?D(n(s)):ne)},ve.jsxs=function(s,w,L,U,R){var F=1e4>G.recentlyCreatedOwnerStacks++;return c(s,w,L,!0,U,R,F?Error("react-stack-top-frame"):K,F?D(n(s)):ne)}}()),ve}var Xe;function Ct(){return Xe||(Xe=1,process.env.NODE_ENV==="production"?_e.exports=St():_e.exports=Tt()),_e.exports}var z=Ct();function $e(){return $e=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},$e.apply(null,arguments)}function At(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}function It(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),e.nonce!==void 0&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}var Rt=function(){function e(r){var n=this;this._insertTag=function(a){var i;n.tags.length===0?n.insertionPoint?i=n.insertionPoint.nextSibling:n.prepend?i=n.container.firstChild:i=n.before:i=n.tags[n.tags.length-1].nextSibling,n.container.insertBefore(a,i),n.tags.push(a)},this.isSpeedy=r.speedy===void 0?!0:r.speedy,this.tags=[],this.ctr=0,this.nonce=r.nonce,this.key=r.key,this.container=r.container,this.prepend=r.prepend,this.insertionPoint=r.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(n){n.forEach(this._insertTag)},t.insert=function(n){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(It(this));var a=this.tags[this.tags.length-1];if(this.isSpeedy){var i=At(a);try{i.insertRule(n,i.cssRules.length)}catch{}}else a.appendChild(document.createTextNode(n));this.ctr++},t.flush=function(){this.tags.forEach(function(n){var a;return(a=n.parentNode)==null?void 0:a.removeChild(n)}),this.tags=[],this.ctr=0},e}(),H="-ms-",Se="-moz-",S="-webkit-",Ke="comm",Le="rule",Ne="decl",Ot="@import",Je="@keyframes",jt="@layer",Vt=Math.abs,Te=String.fromCharCode,$t=Object.assign;function Lt(e,t){return Y(e,0)^45?(((t<<2^Y(e,0))<<2^Y(e,1))<<2^Y(e,2))<<2^Y(e,3):0}function Ze(e){return e.trim()}function Nt(e,t){return(e=t.exec(e))?e[0]:e}function T(e,t,r){return e.replace(t,r)}function Fe(e,t){return e.indexOf(t)}function Y(e,t){return e.charCodeAt(t)|0}function be(e,t,r){return e.slice(t,r)}function ie(e){return e.length}function De(e){return e.length}function Ce(e,t){return t.push(e),e}function Ft(e,t){return e.map(t).join("")}var Ae=1,fe=1,Qe=0,J=0,B=0,pe="";function Ie(e,t,r,n,a,i,o){return{value:e,root:t,parent:r,type:n,props:a,children:i,line:Ae,column:fe,length:o,return:""}}function we(e,t){return $t(Ie("",null,null,"",null,null,0),e,{length:-e.length},t)}function Dt(){return B}function Ut(){return B=J>0?Y(pe,--J):0,fe--,B===10&&(fe=1,Ae--),B}function Q(){return B=J<Qe?Y(pe,J++):0,fe++,B===10&&(fe=1,Ae++),B}function oe(){return Y(pe,J)}function Re(){return J}function xe(e,t){return be(pe,e,t)}function Pe(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 et(e){return Ae=fe=1,Qe=ie(pe=e),J=0,[]}function tt(e){return pe="",e}function Oe(e){return Ze(xe(J-1,Ue(e===91?e+2:e===40?e+1:e)))}function Bt(e){for(;(B=oe())&&B<33;)Q();return Pe(e)>2||Pe(B)>3?"":" "}function Mt(e,t){for(;--t&&Q()&&!(B<48||B>102||B>57&&B<65||B>70&&B<97););return xe(e,Re()+(t<6&&oe()==32&&Q()==32))}function Ue(e){for(;Q();)switch(B){case e:return J;case 34:case 39:e!==34&&e!==39&&Ue(B);break;case 40:e===41&&Ue(e);break;case 92:Q();break}return J}function zt(e,t){for(;Q()&&e+B!==57;)if(e+B===84&&oe()===47)break;return"/*"+xe(t,J-1)+"*"+Te(e===47?e:Q())}function Wt(e){for(;!Pe(oe());)Q();return xe(e,J)}function Yt(e){return tt(je("",null,null,null,[""],e=et(e),0,[0],e))}function je(e,t,r,n,a,i,o,l,u){for(var m=0,c=0,p=o,x=0,k=0,v=0,d=1,y=1,g=1,E=0,j="",C=a,V=i,$=n,f=j;y;)switch(v=E,E=Q()){case 40:if(v!=108&&Y(f,p-1)==58){Fe(f+=T(Oe(E),"&","&\f"),"&\f")!=-1&&(g=-1);break}case 34:case 39:case 91:f+=Oe(E);break;case 9:case 10:case 13:case 32:f+=Bt(v);break;case 92:f+=Mt(Re()-1,7);continue;case 47:switch(oe()){case 42:case 47:Ce(Gt(zt(Q(),Re()),t,r),u);break;default:f+="/"}break;case 123*d:l[m++]=ie(f)*g;case 125*d:case 59:case 0:switch(E){case 0:case 125:y=0;case 59+c:g==-1&&(f=T(f,/\f/g,"")),k>0&&ie(f)-p&&Ce(k>32?nt(f+";",n,r,p-1):nt(T(f," ","")+";",n,r,p-2),u);break;case 59:f+=";";default:if(Ce($=rt(f,t,r,m,c,a,l,j,C=[],V=[],p),i),E===123)if(c===0)je(f,t,$,$,C,i,p,l,V);else switch(x===99&&Y(f,3)===110?100:x){case 100:case 108:case 109:case 115:je(e,$,$,n&&Ce(rt(e,$,$,0,0,a,l,j,a,C=[],p),V),a,V,p,l,n?C:V);break;default:je(f,$,$,$,[""],V,0,l,V)}}m=c=k=0,d=g=1,j=f="",p=o;break;case 58:p=1+ie(f),k=v;default:if(d<1){if(E==123)--d;else if(E==125&&d++==0&&Ut()==125)continue}switch(f+=Te(E),E*d){case 38:g=c>0?1:(f+="\f",-1);break;case 44:l[m++]=(ie(f)-1)*g,g=1;break;case 64:oe()===45&&(f+=Oe(Q())),x=oe(),c=p=ie(j=f+=Wt(Re())),E++;break;case 45:v===45&&ie(f)==2&&(d=0)}}return i}function rt(e,t,r,n,a,i,o,l,u,m,c){for(var p=a-1,x=a===0?i:[""],k=De(x),v=0,d=0,y=0;v<n;++v)for(var g=0,E=be(e,p+1,p=Vt(d=o[v])),j=e;g<k;++g)(j=Ze(d>0?x[g]+" "+E:T(E,/&\f/g,x[g])))&&(u[y++]=j);return Ie(e,t,r,a===0?Le:l,u,m,c)}function Gt(e,t,r){return Ie(e,t,r,Ke,Te(Dt()),be(e,2,-2),0)}function nt(e,t,r,n){return Ie(e,t,r,Ne,be(e,0,n),be(e,n+1,-1),n)}function he(e,t){for(var r="",n=De(e),a=0;a<n;a++)r+=t(e[a],a,e,t)||"";return r}function qt(e,t,r,n){switch(e.type){case jt:if(e.children.length)break;case Ot:case Ne:return e.return=e.return||e.value;case Ke:return"";case Je:return e.return=e.value+"{"+he(e.children,n)+"}";case Le:e.value=e.props.join(",")}return ie(r=he(e.children,n))?e.return=e.value+"{"+r+"}":""}function Ht(e){var t=De(e);return function(r,n,a,i){for(var o="",l=0;l<t;l++)o+=e[l](r,n,a,i)||"";return o}}function Xt(e){return function(t){t.root||(t=t.return)&&e(t)}}function at(e){var t=Object.create(null);return function(r){return t[r]===void 0&&(t[r]=e(r)),t[r]}}var Kt=function(t,r,n){for(var a=0,i=0;a=i,i=oe(),a===38&&i===12&&(r[n]=1),!Pe(i);)Q();return xe(t,J)},Jt=function(t,r){var n=-1,a=44;do switch(Pe(a)){case 0:a===38&&oe()===12&&(r[n]=1),t[n]+=Kt(J-1,r,n);break;case 2:t[n]+=Oe(a);break;case 4:if(a===44){t[++n]=oe()===58?"&\f":"",r[n]=t[n].length;break}default:t[n]+=Te(a)}while(a=Q());return t},Zt=function(t,r){return tt(Jt(et(t),r))},it=new WeakMap,Qt=function(t){if(!(t.type!=="rule"||!t.parent||t.length<1)){for(var r=t.value,n=t.parent,a=t.column===n.column&&t.line===n.line;n.type!=="rule";)if(n=n.parent,!n)return;if(!(t.props.length===1&&r.charCodeAt(0)!==58&&!it.get(n))&&!a){it.set(t,!0);for(var i=[],o=Zt(r,i),l=n.props,u=0,m=0;u<o.length;u++)for(var c=0;c<l.length;c++,m++)t.props[m]=i[u]?o[u].replace(/&\f/g,l[c]):l[c]+" "+o[u]}}},er=function(t){if(t.type==="decl"){var r=t.value;r.charCodeAt(0)===108&&r.charCodeAt(2)===98&&(t.return="",t.value="")}};function ot(e,t){switch(Lt(e,t)){case 5103:return S+"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 S+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return S+e+Se+e+H+e+e;case 6828:case 4268:return S+e+H+e+e;case 6165:return S+e+H+"flex-"+e+e;case 5187:return S+e+T(e,/(\w+).+(:[^]+)/,S+"box-$1$2"+H+"flex-$1$2")+e;case 5443:return S+e+H+"flex-item-"+T(e,/flex-|-self/,"")+e;case 4675:return S+e+H+"flex-line-pack"+T(e,/align-content|flex-|-self/,"")+e;case 5548:return S+e+H+T(e,"shrink","negative")+e;case 5292:return S+e+H+T(e,"basis","preferred-size")+e;case 6060:return S+"box-"+T(e,"-grow","")+S+e+H+T(e,"grow","positive")+e;case 4554:return S+T(e,/([^-])(transform)/g,"$1"+S+"$2")+e;case 6187:return T(T(T(e,/(zoom-|grab)/,S+"$1"),/(image-set)/,S+"$1"),e,"")+e;case 5495:case 3959:return T(e,/(image-set\([^]*)/,S+"$1$`$1");case 4968:return T(T(e,/(.+:)(flex-)?(.*)/,S+"box-pack:$3"+H+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+S+e+e;case 4095:case 3583:case 4068:case 2532:return T(e,/(.+)-inline(.+)/,S+"$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(ie(e)-1-t>6)switch(Y(e,t+1)){case 109:if(Y(e,t+4)!==45)break;case 102:return T(e,/(.+:)(.+)-([^]+)/,"$1"+S+"$2-$3$1"+Se+(Y(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~Fe(e,"stretch")?ot(T(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(Y(e,t+1)!==115)break;case 6444:switch(Y(e,ie(e)-3-(~Fe(e,"!important")&&10))){case 107:return T(e,":",":"+S)+e;case 101:return T(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+S+(Y(e,14)===45?"inline-":"")+"box$3$1"+S+"$2$3$1"+H+"$2box$3")+e}break;case 5936:switch(Y(e,t+11)){case 114:return S+e+H+T(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return S+e+H+T(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return S+e+H+T(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return S+e+H+e+e}return e}var tr=function(t,r,n,a){if(t.length>-1&&!t.return)switch(t.type){case Ne:t.return=ot(t.value,t.length);break;case Je:return he([we(t,{value:T(t.value,"@","@"+S)})],a);case Le:if(t.length)return Ft(t.props,function(i){switch(Nt(i,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return he([we(t,{props:[T(i,/:(read-\w+)/,":"+Se+"$1")]})],a);case"::placeholder":return he([we(t,{props:[T(i,/:(plac\w+)/,":"+S+"input-$1")]}),we(t,{props:[T(i,/:(plac\w+)/,":"+Se+"$1")]}),we(t,{props:[T(i,/:(plac\w+)/,H+"input-$1")]})],a)}return""})}},rr=[tr],nr=function(t){var r=t.key;if(r==="css"){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,function(d){var y=d.getAttribute("data-emotion");y.indexOf(" ")!==-1&&(document.head.appendChild(d),d.setAttribute("data-s",""))})}var a=t.stylisPlugins||rr,i={},o,l=[];o=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+r+' "]'),function(d){for(var y=d.getAttribute("data-emotion").split(" "),g=1;g<y.length;g++)i[y[g]]=!0;l.push(d)});var u,m=[Qt,er];{var c,p=[qt,Xt(function(d){c.insert(d)})],x=Ht(m.concat(a,p)),k=function(y){return he(Yt(y),x)};u=function(y,g,E,j){c=E,k(y?y+"{"+g.styles+"}":g.styles),j&&(v.inserted[g.name]=!0)}}var v={key:r,sheet:new Rt({key:r,container:o,nonce:t.nonce,speedy:t.speedy,prepend:t.prepend,insertionPoint:t.insertionPoint}),nonce:t.nonce,inserted:i,registered:{},insert:u};return v.sheet.hydrate(l),v},ar=!0;function ir(e,t,r){var n="";return r.split(" ").forEach(function(a){e[a]!==void 0?t.push(e[a]+";"):a&&(n+=a+" ")}),n}var st=function(t,r,n){var a=t.key+"-"+r.name;(n===!1||ar===!1)&&t.registered[a]===void 0&&(t.registered[a]=r.styles)},or=function(t,r,n){st(t,r,n);var a=t.key+"-"+r.name;if(t.inserted[r.name]===void 0){var i=r;do t.insert(r===i?"."+a:"",i,t.sheet,!0),i=i.next;while(i!==void 0)}};function sr(e){for(var t=0,r,n=0,a=e.length;a>=4;++n,a-=4)r=e.charCodeAt(n)&255|(e.charCodeAt(++n)&255)<<8|(e.charCodeAt(++n)&255)<<16|(e.charCodeAt(++n)&255)<<24,r=(r&65535)*1540483477+((r>>>16)*59797<<16),r^=r>>>24,t=(r&65535)*1540483477+((r>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(a){case 3:t^=(e.charCodeAt(n+2)&255)<<16;case 2:t^=(e.charCodeAt(n+1)&255)<<8;case 1:t^=e.charCodeAt(n)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var lr={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},cr=/[A-Z]|^ms/g,ur=/_EMO_([^_]+?)_([^]*?)_EMO_/g,lt=function(t){return t.charCodeAt(1)===45},ct=function(t){return t!=null&&typeof t!="boolean"},Be=at(function(e){return lt(e)?e:e.replace(cr,"-$&").toLowerCase()}),ut=function(t,r){switch(t){case"animation":case"animationName":if(typeof r=="string")return r.replace(ur,function(n,a,i){return se={name:a,styles:i,next:se},a})}return lr[t]!==1&&!lt(t)&&typeof r=="number"&&r!==0?r+"px":r};function ke(e,t,r){if(r==null)return"";var n=r;if(n.__emotion_styles!==void 0)return n;switch(typeof r){case"boolean":return"";case"object":{var a=r;if(a.anim===1)return se={name:a.name,styles:a.styles,next:se},a.name;var i=r;if(i.styles!==void 0){var o=i.next;if(o!==void 0)for(;o!==void 0;)se={name:o.name,styles:o.styles,next:se},o=o.next;var l=i.styles+";";return l}return dr(e,t,r)}case"function":{if(e!==void 0){var u=se,m=r(e);return se=u,ke(e,t,m)}break}}var c=r;if(t==null)return c;var p=t[c];return p!==void 0?p:c}function dr(e,t,r){var n="";if(Array.isArray(r))for(var a=0;a<r.length;a++)n+=ke(e,t,r[a])+";";else for(var i in r){var o=r[i];if(typeof o!="object"){var l=o;t!=null&&t[l]!==void 0?n+=i+"{"+t[l]+"}":ct(l)&&(n+=Be(i)+":"+ut(i,l)+";")}else if(Array.isArray(o)&&typeof o[0]=="string"&&(t==null||t[o[0]]===void 0))for(var u=0;u<o.length;u++)ct(o[u])&&(n+=Be(i)+":"+ut(i,o[u])+";");else{var m=ke(e,t,o);switch(i){case"animation":case"animationName":{n+=Be(i)+":"+m+";";break}default:n+=i+"{"+m+"}"}}}return n}var dt=/label:\s*([^\s;{]+)\s*(;|$)/g,se;function fr(e,t,r){if(e.length===1&&typeof e[0]=="object"&&e[0]!==null&&e[0].styles!==void 0)return e[0];var n=!0,a="";se=void 0;var i=e[0];if(i==null||i.raw===void 0)n=!1,a+=ke(r,t,i);else{var o=i;a+=o[0]}for(var l=1;l<e.length;l++)if(a+=ke(r,t,e[l]),n){var u=i;a+=u[l]}dt.lastIndex=0;for(var m="",c;(c=dt.exec(a))!==null;)m+="-"+c[1];var p=sr(a)+m;return{name:p,styles:a,next:se}}var pr=function(t){return t()},hr=ce.useInsertionEffect?ce.useInsertionEffect:!1,mr=hr||pr,ft=ce.createContext(typeof HTMLElement<"u"?nr({key:"css"}):null);ft.Provider;var yr=function(t){return P.forwardRef(function(r,n){var a=P.useContext(ft);return t(r,a,n)})},gr=ce.createContext({}),vr=/^((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)-.*))$/,br=at(function(e){return vr.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91}),wr=br,xr=function(t){return t!=="theme"},pt=function(t){return typeof t=="string"&&t.charCodeAt(0)>96?wr:xr},ht=function(t,r,n){var a;if(r){var i=r.shouldForwardProp;a=t.__emotion_forwardProp&&i?function(o){return t.__emotion_forwardProp(o)&&i(o)}:i}return typeof a!="function"&&n&&(a=t.__emotion_forwardProp),a},Pr=function(t){var r=t.cache,n=t.serialized,a=t.isStringTag;return st(r,n,a),mr(function(){return or(r,n,a)}),null},kr=function e(t,r){var n=t.__emotion_real===t,a=n&&t.__emotion_base||t,i,o;r!==void 0&&(i=r.label,o=r.target);var l=ht(t,r,n),u=l||pt(a),m=!u("as");return function(){var c=arguments,p=n&&t.__emotion_styles!==void 0?t.__emotion_styles.slice(0):[];if(i!==void 0&&p.push("label:"+i+";"),c[0]==null||c[0].raw===void 0)p.push.apply(p,c);else{var x=c[0];p.push(x[0]);for(var k=c.length,v=1;v<k;v++)p.push(c[v],x[v])}var d=yr(function(y,g,E){var j=m&&y.as||a,C="",V=[],$=y;if(y.theme==null){$={};for(var f in y)$[f]=y[f];$.theme=ce.useContext(gr)}typeof y.className=="string"?C=ir(g.registered,V,y.className):y.className!=null&&(C=y.className+" ");var X=fr(p.concat(V),g.registered,$);C+=g.key+"-"+X.name,o!==void 0&&(C+=" "+o);var _=m&&l===void 0?pt(j):u,N={};for(var G in y)m&&G==="as"||_(G)&&(N[G]=y[G]);return N.className=C,E&&(N.ref=E),ce.createElement(ce.Fragment,null,ce.createElement(Pr,{cache:g,serialized:X,isStringTag:typeof j=="string"}),ce.createElement(j,N))});return d.displayName=i!==void 0?i:"Styled("+(typeof a=="string"?a:a.displayName||a.name||"Component")+")",d.defaultProps=t.defaultProps,d.__emotion_real=d,d.__emotion_base=a,d.__emotion_styles=p,d.__emotion_forwardProp=l,Object.defineProperty(d,"toString",{value:function(){return"."+o}}),d.withComponent=function(y,g){var E=e(y,$e({},r,g,{shouldForwardProp:ht(d,g,!0)}));return E.apply(void 0,p)},d}},Er=["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"],me=kr.bind(null);Er.forEach(function(e){me[e]=me(e)});const _r=me.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
|
-
`,
|
|
50
|
+
`,Me=({type:e,children:t,className:r,icon:n,action:a})=>z.jsxs(_r,{type:e,className:r,children:[n&&z.jsx("span",{children:n}),z.jsx("span",{children:t}),a&&z.jsx("span",{children:a})]}),ze=me.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(t=>`.${t} { display: none !important; }`).join("")}
|
|
62
|
-
`,
|
|
62
|
+
`,mt=me.div`
|
|
63
63
|
position: fixed;
|
|
64
64
|
top: 0;
|
|
65
65
|
left: 0;
|
|
@@ -71,7 +71,7 @@ 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
|
-
`,
|
|
74
|
+
`,yt=me.div`
|
|
75
75
|
position: relative;
|
|
76
76
|
width: min(360px, 100%);
|
|
77
77
|
max-width: 360px;
|
|
@@ -83,4 +83,4 @@ React keys must be passed directly to JSX without using spread:
|
|
|
83
83
|
width: 100%;
|
|
84
84
|
max-width: 100%;
|
|
85
85
|
}
|
|
86
|
-
`,wr=(e,t)=>`https://vp-api.gjirafa.tech/api/v2/projects/${e}/videos?search=${t}`,dt=(e,t)=>`https://vp-api.gjirafa.tech/api/projects/${e}/playlists/${t}/videos`,xr=(e,t)=>`https://vp-api.gjirafa.tech/api/projects/${e}/playlists/${t}`,Pr=e=>`https://host.vpplayer.tech/player/${e}/vpplayer.js`,Le=(e,t)=>`vp-player-${e||"default"}-${t||""}`,Ne=new Map,ft=(e,t)=>{const[r,n]=P.useState(!1),[a,i]=P.useState(null);return P.useEffect(()=>{let o=null,c,u=0;const y=3;let l;try{l=t||Pr(e||"latest")}catch(k){const g=k instanceof Error?k.message:String(k);i(`Failed to resolve script URL: ${g}`),n(!1);return}if(Ne.get(l)){n(!0),i(null);return}if(document.querySelector(`script[src="${l}"]`)){Ne.set(l,!0),n(!0),i(null);return}const b=()=>{o=document.createElement("script"),o.src=l,o.async=!0,c=window.setTimeout(()=>{n(!1),i(`Loading script timed out: ${l}`)},1e4),o.onload=()=>{clearTimeout(c),Ne.set(l,!0),n(!0),i(null)},o.onerror=()=>{clearTimeout(c),u++,u<y?setTimeout(b,1e3*u):(n(!1),i(`Failed to load VP Player script after ${y} attempts: ${l}`))},document.body.appendChild(o)};return b(),()=>{clearTimeout(c),o&&document.body.contains(o)&&document.body.removeChild(o)}},[e,t]),{isLoaded:r,error:a}},kr={},me=new Map,Er=3e4,Ve=5,pt=({projectId:e,videoId:t,playlistId:r,videoUrl:n,apiKey:a})=>{const[i,o]=P.useState(null),[c,u]=P.useState(null),[y,l]=P.useState(!1),[f,b]=P.useState(null),k=a||(typeof kr<"u"?"1CFC4B619E9342B6BAC4879BA8C30CF216C4BA9D3F084B11825F4AB2D5CF845E":void 0);return P.useEffect(()=>{const g=t?`video:${t}`:r?`playlist:${r}`:null;if(!e||n||!t&&!r){o(n||null),u(null),l(!1),b(null);return}if(!k){l(!1),b("No API key provided");return}if(g&&me.has(g)){const A=me.get(g);o(A.url),u(A.playlist),l(!1),b(null);return}let d=!0;const v=new AbortController,p=v.signal,S=setTimeout(async()=>{var j,x,h,I;if(!d)return;l(!0),b(null);let A=0;for(;A<Ve&&d;)try{const C=t&&!r?wr(e,t):dt(e,r),$=setTimeout(()=>v.abort(),Er),R=await fetch(C,{method:"GET",headers:{"api-key":k,Accept:"application/json","Cache-Control":"no-cache"},signal:p});if(clearTimeout($),!R.ok)throw new Error(`Fetch failed with status ${R.status}`);const z=await R.json();if(!d)return;if(t&&!r){const Y=(x=(j=z.result)==null?void 0:j.items)==null?void 0:x.find(V=>V.mediaId===t);if(!(Y!=null&&Y.playbackUrl))throw new Error("Invalid video data");o(Y.playbackUrl),u(null),g&&me.set(g,{url:Y.playbackUrl,playlist:null})}else{if(!Array.isArray(z.result))throw new Error("Invalid playlist format");const Y=xr(e,r),V=await fetch(Y,{method:"GET",headers:{"api-key":k,Accept:"application/json","Cache-Control":"no-cache"},signal:p});if(V.ok){const G=await V.json();let q=[...z.result];if((h=G.result)!=null&&h.playlistBackupState&&((I=G.result)!=null&&I.playlistBackupId)){const ee=dt(e,G.result.playlistBackupId),J=await fetch(ee,{method:"GET",headers:{"api-key":k,Accept:"application/json","Cache-Control":"no-cache"},signal:p});if(J.ok){const te=await J.json();if(Array.isArray(te.result)){const s=te.result.map(m=>({...m,isBackupPlaylist:!0}));q=[...q,...s]}}}u(q),o(null),g&&me.set(g,{url:null,playlist:q})}else u(z.result),o(null),g&&me.set(g,{url:null,playlist:z.result})}break}catch(C){if(p.aborted){d&&b("Request timed out");break}if(A++,A>=Ve){const $=C instanceof Error?C.message:String(C);d&&b(`Failed after ${Ve} attempts: ${$}`)}else await new Promise($=>setTimeout($,2e3))}d&&l(!1)},100);return()=>{d=!1,clearTimeout(S),v.abort()}},[k,e,t,r,n]),{fetchedPlaybackUrl:i,fetchedPlaylist:c,isLoading:y,error:f}},_r={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}}},ht=({videoUrl:e,fetchedPlaybackUrl:t,fetchedPlaylist:r,projectId:n,config:a={},isVerticalPlayer:i})=>{var l,f,b,k,g,d,v,p,w,S,A,j,x;const o={..._r,...a},c={...o.config,...a.config};if(e)return{...o,video:{...o.video,file:e,playlist:void 0},config:c};if(t)return{...o,video:{...o.video,file:t,playlist:void 0},config:c};if(r&&r.length>0){const h=((f=(l=a==null?void 0:a.video)==null?void 0:l.playlist)==null?void 0:f.playlistVideoIndex)??((b=a==null?void 0:a.config)==null?void 0:b.playlistVideoIndex)??0;return i?{...o,projectId:n||"vp-player-projectId",video:{...o.video,file:(k=r[0])==null?void 0:k.hlsUrl,title:(g=r[0])==null?void 0:g.title,playlist:{state:!0,playlistId:"",playlistVideoIndex:Number(h),videos:r.slice(1).map((C,$)=>({videoId:String($+1),title:C.title,file:C.hlsUrl,thumbnailUrl:C.thumbnailUrl,duration:C.duration}))}},config:c}:{...o,projectId:n||"vp-player-projectId",video:{...o.video,file:((d=r[Number(h)])==null?void 0:d.hlsUrl)||((v=r[0])==null?void 0:v.hlsUrl)||"",title:((p=r[Number(h)])==null?void 0:p.title)||((w=r[0])==null?void 0:w.title),thumbnail:((S=r[Number(h)])==null?void 0:S.thumbnailUrl)||((A=r[0])==null?void 0:A.thumbnailUrl),playlist:{state:!0,playlistVideoIndex:Number(h),videos:r.map((C,$)=>({videoId:String($),title:C.title,file:C.hlsUrl,thumbnailUrl:C.thumbnailUrl,duration:C.duration}))}},config:c}}const u=((j=a==null?void 0:a.video)==null?void 0:j.playlist)||o.video.playlist,y=(x=a==null?void 0:a.video)==null?void 0:x.file;if(y)return{...o,video:{...o.video,file:y,playlist:void 0},config:c};if(u!=null&&u.videos&&u.videos.length>0){const h=u.videos[Number(u.playlistVideoIndex)||0];return{...o,video:{...o.video,file:(h==null?void 0:h.file)||"",playlist:{...u,state:u.state??!0,playlistVideoIndex:Number(u.playlistVideoIndex||0),videos:u.videos}},config:{...o.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.")},mt=e=>{if(!e)return;const t=/https:\/\/host\.vpplayer\.tech\/player\/([^/]+)\/([^/]+)(?:\/[^/]+)?\.js/,r=e.match(t);return r?r[2]:void 0},yt=({playerId:e,videoId:t,version:r,videoUrl:n,projectId:a,playlistId:i,scriptUrl:o,config:c={},apiKey:u,isReels:y=!1,onPlaylistData:l})=>{const f=P.useRef(null),b=P.useRef(null),{isLoaded:k,error:g}=ft(r,o),d=t||mt(o),[v,p]=P.useState(null),{fetchedPlaybackUrl:w,fetchedPlaylist:S,isLoading:A,error:j}=pt({projectId:a,videoId:d,playlistId:i,videoUrl:n,apiKey:u}),x=Le(e,d);P.useEffect(()=>{S&&l&&l(S)},[S,l]);const h=P.useMemo(()=>{const I=c.config||{},C=y&&!I.size?{sizeType:"RESPONSIVE",aspectRatio:"9:16"}:I.size||{sizeType:"FIXED",width:"100%"};return{...c,config:{...I,size:C}}},[c,y]);return P.useEffect(()=>{if(g){p(g);return}if(!k||A&&!n)return;let I=!0;const $=setTimeout(async()=>{try{const R=o==null?void 0:o.includes("vertical-player");if(document.querySelectorAll('[id*="player"]').forEach(ee=>{var te,s;const J=ee.id;if(J!==x)try{const m=R?(te=window.vpVerticalPlayer)==null?void 0:te.call(window,J):(s=window.vpPlayer)==null?void 0:s.call(window,J);m!=null&&m.destroy&&m.destroy()}catch(m){console.warn(`Failed to destroy existing player ${J}:`,m)}}),await new Promise(ee=>setTimeout(ee,100)),!I||!f.current)return;if(!document.getElementById(x)){p("DOM element not found after cleanup.");return}if(!window.vpPlayer&&!window.vpVerticalPlayer){p("VP Player script not loaded.");return}const V=R?window.vpVerticalPlayer:window.vpPlayer;if(!V){p(`VP ${R?"Vertical ":""}Player script not loaded.`);return}const G=ht({videoUrl:n,fetchedPlaybackUrl:w??void 0,fetchedPlaylist:S??void 0,projectId:a,config:h,isVerticalPlayer:R}),q=V(x);if(!q){p(`Failed to create VP ${R?"Vertical ":""}Player instance.`);return}I&&f.current&&(q.setup(G),b.current=q,p(null))}catch(R){if(I){const z=R instanceof Error?R.message:String(R);p(z),console.error("VP Player initialization error:",R)}}},150);return()=>{I=!1,clearTimeout($)}},[k,A,n,w,S,a,h,x,g,o]),P.useEffect(()=>()=>{if(b.current){try{b.current.destroy&&b.current.destroy()}catch(C){console.warn(`Failed to destroy player ${x}:`,C)}b.current=null}const I=document.getElementById(x);I&&(I.innerHTML="")},[x]),{playerRef:f,playerInstanceRef:b,isScriptLoaded:k,isLoading:A,error:j||v||g}},gt=({playerId:e,videoId:t,version:r,videoUrl:n,projectId:a,playlistId:i,scriptUrl:o,config:c={},apiKey:u,isReels:y=!1,hiddenClasses:l=[],onClose:f,className:b,onPlaylistData:k})=>{var $,R,z,Y;const{playerRef:g,playerInstanceRef:d,isScriptLoaded:v,isLoading:p,error:w}=yt({playerId:e,videoId:t,version:r,videoUrl:n,projectId:a,playlistId:i,scriptUrl:o,config:c,apiKey:u,isReels:y,onPlaylistData:k}),[S,A]=P.useState(!0),j=()=>y&&A(!0),x=()=>{var V,G;A(!1),(G=(V=d.current)==null?void 0:V.play)==null||G.call(V),f==null||f()},h=(R=($=c==null?void 0:c.config)==null?void 0:$.size)!=null&&R.width?typeof c.config.size.width=="number"?`${c.config.size.width}px`:c.config.size.width:void 0,I=(Y=(z=c==null?void 0:c.config)==null?void 0:z.size)!=null&&Y.height?typeof c.config.size.height=="number"?`${c.config.size.height}px`:c.config.size.height:void 0,C=Le(e,t);return w?N.jsxs(je,{type:"error",children:["An error occurred: ",w]}):p||!v?N.jsx(je,{type:"loading",children:"Loading..."}):N.jsxs(N.Fragment,{children:[y&&!S?N.jsx("div",{onClick:j}):null,!y&&N.jsx("div",{children:N.jsx($e,{id:C,ref:g,width:h||"100%",height:I||"auto",$hiddenClasses:l,className:b})},C),y&&S&&N.jsx(lt,{onClick:x,className:b,children:N.jsx(ut,{className:b,onClick:V=>V.stopPropagation(),children:N.jsx("div",{children:N.jsx($e,{id:C,ref:g,width:"100%",height:"auto",$hiddenClasses:l,className:b})},C)})})]})},bt=P.createContext(void 0),Sr=({children:e})=>{const[t,r]=P.useState(!1),[n,a]=P.useState(null),[i,o]=P.useState(null),c=P.useCallback(l=>{try{const f=Le(l.playerId,l.videoId);a({...l,playerId:f}),r(!0),o(null)}catch{o("Failed to show player.")}},[]),u=P.useCallback(()=>{r(!1),a(null),o(null)},[]),y=P.useMemo(()=>({showPlayer:c,hidePlayer:u,isPlayerVisible:t,playerParams:n}),[c,u,t,n]);return N.jsxs(bt.Provider,{value:y,children:[e,i&&N.jsx(je,{type:"error",children:i}),t&&(n==null?void 0:n.playerId)&&N.jsx(gt,{playerId:n.playerId,videoId:n.videoId,projectId:n.projectId,videoUrl:n.videoUrl,version:n.version,playlistId:n.playlistId,scriptUrl:n.scriptUrl,config:n.config,isReels:n.isReels,thumbnailUrl:n.thumbnailUrl,onClose:u,hiddenClasses:n.hiddenClasses||[],apiKey:n.apiKey,className:n.className})]})},Ar=()=>{const e=P.useContext(bt);if(!e)throw new Error("useVPPlayer must be used within a VPPlayerProvider");return e},Cr={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}}},Tr={config:{autostartOnLoad:{state:!0,onMobile:!0,onData:!0},muted:!0}},Rr={config:{autoplay:!0,muted:!0}},_e={video:{advertising:!0,ads:{skipAd:{state:!0,skipFrom:5}}},config:{adAnnouncement:{state:!0,timeBeforeAd:5},adsRequireInteraction:!1}},Ir=(e,t,r="time",n=0)=>{var a;return{..._e,video:{..._e.video,ads:{...(a=_e.video)==null?void 0:a.ads,adBreaks:[{adTagUrl:t,breakType:e,breakTimingType:r,breakTimingValue:n}]}}}},Or="http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4",jr="http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4",$r="https://videos.pexels.com/video-files/4678261/4678261-hd_1080_1920_25fps.mp4",Lr="https://images.pexels.com/videos/4678261/pexels-photo-4678261.jpeg?auto=compress&cs=tinysrgb&w=600",Nr="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=",Vr="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=";T.AD_TAG_LINEAR_URL=Nr,T.AD_TAG_SKIPPABLE_LINEAR_URL=Vr,T.BIG_BUCK_BUNNY_URL=Or,T.ELEPHANTS_DREAM_URL=jr,T.Overlay=lt,T.PEXELS_THUMBNAIL_URL=Lr,T.PEXELS_VERTICAL_VIDEO_URL=$r,T.PlayerContainer=$e,T.PlayerWrapper=ut,T.VPPlayer=gt,T.VPPlayerProvider=Sr,T.baseConfig=Tr,T.baseConfigWithAds=_e,T.baseConfigWithAutoplay=Rr,T.buildVPPlayerConfig=ht,T.defaultVPPlayerConfig=Cr,T.extractVideoId=mt,T.getAdConfig=Ir,T.useVPPlayer=Ar,T.useVPPlayerLogic=yt,T.useVPPlayerScript=ft,T.useVideoData=pt,Object.defineProperty(T,Symbol.toStringTag,{value:"Module"})});
|
|
86
|
+
`,Sr=(e,t)=>`https://vp-api.gjirafa.tech/api/v2/projects/${e}/videos?search=${t}`,gt=(e,t)=>`https://vp-api.gjirafa.tech/api/projects/${e}/playlists/${t}/videos`,Tr=(e,t)=>`https://vp-api.gjirafa.tech/api/projects/${e}/playlists/${t}`,Cr=e=>`https://host.vpplayer.tech/player/${e}/vpplayer.js`,We=(e,t)=>`vp-player-${e||"default"}-${t||""}`,Ye=new Map,vt=(e,t)=>{const[r,n]=P.useState(!1),[a,i]=P.useState(null);return P.useEffect(()=>{let o=null,l,u=0;const m=3;let c;try{c=t||Cr(e||"latest")}catch(k){const v=k instanceof Error?k.message:String(k);i(`Failed to resolve script URL: ${v}`),n(!1);return}if(Ye.get(c)){n(!0),i(null);return}if(document.querySelector(`script[src="${c}"]`)){Ye.set(c,!0),n(!0),i(null);return}const x=()=>{o=document.createElement("script"),o.src=c,o.async=!0,l=window.setTimeout(()=>{n(!1),i(`Loading script timed out: ${c}`)},1e4),o.onload=()=>{clearTimeout(l),Ye.set(c,!0),n(!0),i(null)},o.onerror=()=>{clearTimeout(l),u++,u<m?setTimeout(x,1e3*u):(n(!1),i(`Failed to load VP Player script after ${m} attempts: ${c}`))},document.body.appendChild(o)};return x(),()=>{clearTimeout(l),o&&document.body.contains(o)&&document.body.removeChild(o)}},[e,t]),{isLoaded:r,error:a}},Ar={},Ee=new Map,Ir=3e4,Ge=5,bt=({projectId:e,videoId:t,playlistId:r,videoUrl:n,apiKey:a})=>{const[i,o]=P.useState(null),[l,u]=P.useState(null),[m,c]=P.useState(!1),[p,x]=P.useState(null),k=a||(typeof Ar<"u"?"1CFC4B619E9342B6BAC4879BA8C30CF216C4BA9D3F084B11825F4AB2D5CF845E":void 0);return P.useEffect(()=>{const v=t?`video:${t}`:r?`playlist:${r}`:null;if(!e||n||!t&&!r){o(n||null),u(null),c(!1),x(null);return}if(!k){c(!1),x("No API key provided");return}if(v&&Ee.has(v)){const C=Ee.get(v);o(C.url),u(C.playlist),c(!1),x(null);return}let d=!0;const y=new AbortController,g=y.signal,j=setTimeout(async()=>{var V,$,f,X;if(!d)return;c(!0),x(null);let C=0;for(;C<Ge&&d;)try{const _=t&&!r?Sr(e,t):gt(e,r),N=setTimeout(()=>y.abort(),Ir),G=await fetch(_,{method:"GET",headers:{"api-key":k,Accept:"application/json","Cache-Control":"no-cache"},signal:g});if(clearTimeout(N),!G.ok)throw new Error(`Fetch failed with status ${G.status}`);const M=await G.json();if(!d)return;if(t&&!r){const Z=($=(V=M.result)==null?void 0:V.items)==null?void 0:$.find(D=>D.mediaId===t);if(!(Z!=null&&Z.playbackUrl))throw new Error("Invalid video data");o(Z.playbackUrl),u(null),v&&Ee.set(v,{url:Z.playbackUrl,playlist:null})}else{if(!Array.isArray(M.result))throw new Error("Invalid playlist format");const Z=Tr(e,r),D=await fetch(Z,{method:"GET",headers:{"api-key":k,Accept:"application/json","Cache-Control":"no-cache"},signal:g});if(D.ok){const W=await D.json();let te=[...M.result];if((f=W.result)!=null&&f.playlistBackupState&&((X=W.result)!=null&&X.playlistBackupId)){const K=gt(e,W.result.playlistBackupId),ne=await fetch(K,{method:"GET",headers:{"api-key":k,Accept:"application/json","Cache-Control":"no-cache"},signal:g});if(ne.ok){const ae=await ne.json();if(Array.isArray(ae.result)){const s=ae.result.map(w=>({...w,isBackupPlaylist:!0}));te=[...te,...s]}}}u(te),o(null),v&&Ee.set(v,{url:null,playlist:te})}else u(M.result),o(null),v&&Ee.set(v,{url:null,playlist:M.result})}break}catch(_){if(g.aborted){d&&x("Request timed out");break}if(C++,C>=Ge){const N=_ instanceof Error?_.message:String(_);d&&x(`Failed after ${Ge} attempts: ${N}`)}else await new Promise(N=>setTimeout(N,2e3))}d&&c(!1)},100);return()=>{d=!1,clearTimeout(j),y.abort()}},[k,e,t,r,n]),{fetchedPlaybackUrl:i,fetchedPlaylist:l,isLoading:m,error:p}},Rr={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}}},wt=({videoUrl:e,fetchedPlaybackUrl:t,fetchedPlaylist:r,projectId:n,config:a={},isVerticalPlayer:i})=>{var c,p,x,k,v,d,y,g,E,j,C,V,$;const o={...Rr,...a},l={...o.config,...a.config};if(e)return{...o,video:{...o.video,file:e,playlist:void 0},config:l};if(t)return{...o,video:{...o.video,file:t,playlist:void 0},config:l};if(r&&r.length>0){const f=((p=(c=a==null?void 0:a.video)==null?void 0:c.playlist)==null?void 0:p.playlistVideoIndex)??((x=a==null?void 0:a.config)==null?void 0:x.playlistVideoIndex)??0;return i?{...o,projectId:n||"vp-player-projectId",video:{...o.video,file:(k=r[0])==null?void 0:k.hlsUrl,title:(v=r[0])==null?void 0:v.title,playlist:{state:!0,playlistId:"",playlistVideoIndex:Number(f),videos:r.slice(1).map((_,N)=>({videoId:String(N+1),title:_.title,file:_.hlsUrl,thumbnailUrl:_.thumbnailUrl,duration:_.duration}))}},config:l}:{...o,projectId:n||"vp-player-projectId",video:{...o.video,file:((d=r[Number(f)])==null?void 0:d.hlsUrl)||((y=r[0])==null?void 0:y.hlsUrl)||"",title:((g=r[Number(f)])==null?void 0:g.title)||((E=r[0])==null?void 0:E.title),thumbnail:((j=r[Number(f)])==null?void 0:j.thumbnailUrl)||((C=r[0])==null?void 0:C.thumbnailUrl),playlist:{state:!0,playlistVideoIndex:Number(f),videos:r.map((_,N)=>({videoId:String(N),title:_.title,file:_.hlsUrl,thumbnailUrl:_.thumbnailUrl,duration:_.duration}))}},config:l}}const u=((V=a==null?void 0:a.video)==null?void 0:V.playlist)||o.video.playlist,m=($=a==null?void 0:a.video)==null?void 0:$.file;if(m)return{...o,video:{...o.video,file:m,playlist:void 0},config:l};if(u!=null&&u.videos&&u.videos.length>0){const f=u.videos[Number(u.playlistVideoIndex)||0];return{...o,video:{...o.video,file:(f==null?void 0:f.file)||"",playlist:{...u,state:u.state??!0,playlistVideoIndex:Number(u.playlistVideoIndex||0),videos:u.videos}},config:{...o.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.")},xt=e=>{if(!e)return;const t=/https:\/\/host\.vpplayer\.tech\/player\/([^/]+)\/([^/]+)(?:\/[^/]+)?\.js/,r=e.match(t);return r?r[2]:void 0},Pt=({playerId:e,videoId:t,version:r,videoUrl:n,projectId:a,playlistId:i,scriptUrl:o,config:l={},apiKey:u,isReels:m=!1,onPlaylistData:c,onVideoStarted:p})=>{const x=P.useRef(null),k=P.useRef(null),v=P.useRef(!1),d=P.useRef(""),y=P.useRef([]),g=P.useRef([]),E=P.useRef(null),{isLoaded:j,error:C}=vt(r,o),V=t||xt(o),[$,f]=P.useState(null),{fetchedPlaybackUrl:X,fetchedPlaylist:_,isLoading:N,error:G}=bt({projectId:a,videoId:V,playlistId:i,videoUrl:n,apiKey:u}),M=We(e,V);P.useEffect(()=>{_&&c&&c(_)},[_,c]);const Z=P.useMemo(()=>{const D=l.config||{},W=m&&!D.size?{sizeType:"RESPONSIVE",aspectRatio:"9:16"}:D.size||{sizeType:"FIXED",width:"100%"};return{...l,config:{...D,size:W}}},[l,m]);return P.useEffect(()=>{if(C){f(C);return}if(!j||N&&!n)return;let D=!0;const te=setTimeout(async()=>{try{y.current.forEach(F=>clearInterval(F)),y.current=[],g.current.forEach(F=>clearTimeout(F)),g.current=[],E.current=null;const K=(_==null?void 0:_.length)??0,ne=JSON.stringify({playerId:M,videoId:t||V,playlistId:i,videoUrl:n,fetchedPlaybackUrl:X,scriptUrl:o,isReels:m,projectId:a,playlistLength:K});if(v.current&&k.current&&d.current===ne)return;d.current!==ne&&(v.current=!1,d.current=ne);const ae=o==null?void 0:o.includes("vertical-player");if(document.querySelectorAll('[id*="player"]').forEach(F=>{var le,h;const re=F.id;if(re!==M)try{const b=ae?(le=window.vpVerticalPlayer)==null?void 0:le.call(window,re):(h=window.vpPlayer)==null?void 0:h.call(window,re);b!=null&&b.destroy&&b.destroy()}catch(b){console.warn(`Failed to destroy existing player ${re}:`,b)}}),await new Promise(F=>setTimeout(F,100)),!D||!x.current)return;if(!document.getElementById(M)){f("DOM element not found after cleanup.");return}if(!window.vpPlayer&&!window.vpVerticalPlayer){f("VP Player script not loaded.");return}const L=ae?window.vpVerticalPlayer:window.vpPlayer;if(!L){f(`VP ${ae?"Vertical ":""}Player script not loaded.`);return}const U=wt({videoUrl:n,fetchedPlaybackUrl:X??void 0,fetchedPlaylist:_??void 0,projectId:a,config:Z,isVerticalPlayer:ae}),R=L(M);if(!R){f(`Failed to create VP ${ae?"Vertical ":""}Player instance.`);return}if(D&&x.current&&(R.setup(U),k.current=R,v.current=!0,f(null),p&&R.on)){const F=()=>{var b;const h={};if(_&&_.length>0){const A=R.videoIndex??((b=R.playlist)==null?void 0:b.playlistVideoIndex)??0,I=_[A];I&&(h.title=I.title,h.hlsUrl=I.hlsUrl,h.file=I.hlsUrl,h.thumbnailUrl=I.thumbnailUrl,h.duration=I.duration,h.videoIndex=A,h.playlistVideoIndex=A,h.isBackupPlaylist=I.isBackupPlaylist,h.mediaId=I.mediaId,h.videoId=I.mediaId||I.videoId)}else U.video&&(h.title=U.video.title,h.file=U.video.file,h.hlsUrl=U.video.file,h.thumbnailUrl=U.video.thumbnail,h.videoId=t||V,h.videoIndex=0,h.playlistVideoIndex=0,R.getDuration&&(h.duration=R.getDuration()));return h};let re=null;const le=async()=>{var h;try{re&&clearTimeout(re),await new Promise(I=>setTimeout(I,100));let b=F();const A=b.videoId||b.mediaId;if(A&&A===E.current)return;if(re=window.setTimeout(()=>{E.current=null},500),m&&A)try{const ue=`https://host.vpplayer.tech/player/ptkzurnx/${A}.json`,de=await fetch(ue);if(de.ok){const q=await de.json();q&&q.video&&(b={...b,title:q.video.title||b.title,description:q.video.description,publishDate:q.video.publishDate,projectId:q.projectId||b.projectId,premium:((h=q.video.videoLocking)==null?void 0:h.isEnabled)||!1,author:q.video.author,tags:q.video.tags||[]})}}catch{}E.current=A||null,p(b)}catch(b){console.warn("Error in video-started handler:",b)}};if(m){let h=!1,b=-1;const A=()=>{if(!h){h=!0;try{R.on&&R.on("vp-video-started",le),setTimeout(()=>{le(),b=R.videoIndex??0},500)}catch(q){console.error("Error setting up event listeners:",q)}}};let I=0;const ue=15,de=setInterval(()=>{try{const q=R.videoIndex!==void 0||R.playlist;if(!h)I++,(q||I>=ue)&&A();else{const ye=R.videoIndex??0;ye!==b&&b!==-1&&(b=ye,le())}}catch{}},200);y.current.push(de);try{R.on&&R.on("vp-listen-ready",A)}catch{}}else{const h=async b=>{var A,I;try{const ue=o==null?void 0:o.match(/player\/([^/.]+)/),de=ue==null?void 0:ue[1];if(!de||!b)return F();const q=`https://host.vpplayer.tech/player/${de}/${b}.json`,ye=await fetch(q);if(!ye.ok)return console.warn("Failed to fetch full video config:",ye.status),F();const ee=await ye.json();return!ee||!ee.video?F():{videoId:b,title:ee.video.title,description:ee.video.description,file:ee.video.file,hlsUrl:ee.video.file,thumbnailUrl:ee.video.thumbnail,duration:ee.video.duration,publishDate:ee.video.publishDate,projectId:ee.projectId,premium:((A=ee.video.videoLocking)==null?void 0:A.isEnabled)||!1,author:ee.video.author,tags:ee.video.tags||[],videoIndex:R.videoIndex??0,playlistVideoIndex:((I=R.playlist)==null?void 0:I.playlistVideoIndex)??0}}catch(ue){return console.warn("Error fetching full video data:",ue),F()}};R.on("ready",async b=>{try{const A=(b==null?void 0:b.id)||t||V;if(A){const I=await h(A);p(I)}else{const I=F();(I.title||I.file)&&p(I)}}catch(A){console.warn("Error in ready handler:",A)}}),R.on("playlistItem",async b=>{try{const A=b==null?void 0:b.id;if(A){const I=await h(A);p(I)}}catch(A){console.warn("Error in playlistItem handler:",A)}})}}}catch(K){if(D){const ne=K instanceof Error?K.message:String(K);f(ne),console.error("VP Player initialization error:",K)}}},150);return()=>{D=!1,clearTimeout(te),y.current.forEach(K=>clearInterval(K)),y.current=[],g.current.forEach(K=>clearTimeout(K)),g.current=[],v.current=!1}},[j,N,M,C,o]),P.useEffect(()=>()=>{if(k.current){try{k.current.destroy&&k.current.destroy()}catch(W){console.warn(`Failed to destroy player ${M}:`,W)}k.current=null}v.current=!1;const D=document.getElementById(M);D&&(D.innerHTML="")},[M]),{playerRef:x,playerInstanceRef:k,isScriptLoaded:j,isLoading:N,error:G||$||C}},kt=({playerId:e,videoId:t,version:r,videoUrl:n,projectId:a,playlistId:i,scriptUrl:o,config:l={},apiKey:u,isReels:m=!1,hiddenClasses:c=[],onClose:p,className:x,onPlaylistData:k,onVideoStarted:v})=>{var G,M,Z,D;const{playerRef:d,playerInstanceRef:y,isScriptLoaded:g,isLoading:E,error:j}=Pt({playerId:e,videoId:t,version:r,videoUrl:n,projectId:a,playlistId:i,scriptUrl:o,config:l,apiKey:u,isReels:m,onPlaylistData:k,onVideoStarted:v}),[C,V]=P.useState(!0),$=()=>m&&V(!0),f=()=>{var W,te;V(!1),(te=(W=y.current)==null?void 0:W.play)==null||te.call(W),p==null||p()},X=(M=(G=l==null?void 0:l.config)==null?void 0:G.size)!=null&&M.width?typeof l.config.size.width=="number"?`${l.config.size.width}px`:l.config.size.width:void 0,_=(D=(Z=l==null?void 0:l.config)==null?void 0:Z.size)!=null&&D.height?typeof l.config.size.height=="number"?`${l.config.size.height}px`:l.config.size.height:void 0,N=We(e,t);return j?z.jsxs(Me,{type:"error",children:["An error occurred: ",j]}):E||!g?z.jsx(Me,{type:"loading",children:"Loading..."}):z.jsxs(z.Fragment,{children:[m&&!C?z.jsx("div",{onClick:$}):null,!m&&z.jsx("div",{children:z.jsx(ze,{id:N,ref:d,width:X||"100%",height:_||"auto",$hiddenClasses:c,className:x})},N),m&&C&&z.jsx(mt,{onClick:f,className:x,children:z.jsx(yt,{className:x,onClick:W=>W.stopPropagation(),children:z.jsx("div",{children:z.jsx(ze,{id:N,ref:d,width:"100%",height:"auto",$hiddenClasses:c,className:x})},N)})})]})},Et=P.createContext(void 0),Or=({children:e})=>{const[t,r]=P.useState(!1),[n,a]=P.useState(null),[i,o]=P.useState(null),l=P.useCallback(c=>{try{const p=We(c.playerId,c.videoId);a({...c,playerId:p}),r(!0),o(null)}catch{o("Failed to show player.")}},[]),u=P.useCallback(()=>{r(!1),a(null),o(null)},[]),m=P.useMemo(()=>({showPlayer:l,hidePlayer:u,isPlayerVisible:t,playerParams:n}),[l,u,t,n]);return z.jsxs(Et.Provider,{value:m,children:[e,i&&z.jsx(Me,{type:"error",children:i}),t&&(n==null?void 0:n.playerId)&&z.jsx(kt,{playerId:n.playerId,videoId:n.videoId,projectId:n.projectId,videoUrl:n.videoUrl,version:n.version,playlistId:n.playlistId,scriptUrl:n.scriptUrl,config:n.config,isReels:n.isReels,thumbnailUrl:n.thumbnailUrl,onClose:u,hiddenClasses:n.hiddenClasses||[],apiKey:n.apiKey,className:n.className})]})},jr=()=>{const e=P.useContext(Et);if(!e)throw new Error("useVPPlayer must be used within a VPPlayerProvider");return e},Vr={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}}},$r={config:{autostartOnLoad:{state:!0,onMobile:!0,onData:!0},muted:!0}},Lr={config:{autoplay:!0,muted:!0}},Ve={video:{advertising:!0,ads:{skipAd:{state:!0,skipFrom:5}}},config:{adAnnouncement:{state:!0,timeBeforeAd:5},adsRequireInteraction:!1}},Nr=(e,t,r="time",n=0)=>{var a;return{...Ve,video:{...Ve.video,ads:{...(a=Ve.video)==null?void 0:a.ads,adBreaks:[{adTagUrl:t,breakType:e,breakTimingType:r,breakTimingValue:n}]}}}},Fr="http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4",Dr="http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4",Ur="https://videos.pexels.com/video-files/4678261/4678261-hd_1080_1920_25fps.mp4",Br="https://images.pexels.com/videos/4678261/pexels-photo-4678261.jpeg?auto=compress&cs=tinysrgb&w=600",Mr="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=",zr="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=";O.AD_TAG_LINEAR_URL=Mr,O.AD_TAG_SKIPPABLE_LINEAR_URL=zr,O.BIG_BUCK_BUNNY_URL=Fr,O.ELEPHANTS_DREAM_URL=Dr,O.Overlay=mt,O.PEXELS_THUMBNAIL_URL=Br,O.PEXELS_VERTICAL_VIDEO_URL=Ur,O.PlayerContainer=ze,O.PlayerWrapper=yt,O.VPPlayer=kt,O.VPPlayerProvider=Or,O.baseConfig=$r,O.baseConfigWithAds=Ve,O.baseConfigWithAutoplay=Lr,O.buildVPPlayerConfig=wt,O.defaultVPPlayerConfig=Vr,O.extractVideoId=xt,O.getAdConfig=Nr,O.useVPPlayer=jr,O.useVPPlayerLogic=Pt,O.useVPPlayerScript=vt,O.useVideoData=bt,Object.defineProperty(O,Symbol.toStringTag,{value:"Module"})});
|