@bentoproject/dailymotion
Advanced tools
Comparing version 1.2204160405.0 to 1.2204182206.0
; | ||
var n=Object.create,r=Object.defineProperty,e=Object.getOwnPropertyDescriptor,t=Object.getOwnPropertyNames,o=Object.getPrototypeOf,u=Object.prototype.hasOwnProperty,i=function(n){return r(n,"__esModule",{value:!0})},a=function(a){return function(n,o,i){if(o&&"object"==typeof o||"function"==typeof o)for(var a,c=t(o),l=0,f=c.length;l<f;l++)a=c[l],u.call(n,a)||"default"===a||r(n,a,{get:function(n){return o[n]}.bind(null,a),enumerable:!(i=e(o,a))||i.enumerable});return n}(i(r(null!=a?n(o(a)):{},"default",a&&a.__esModule&&"default"in a?{get:function(){return a.default},enumerable:!0}:{value:a,enumerable:!0})),a)};function c(n,r,e){return r in n?Object.defineProperty(n,r,{value:e,enumerable:!0,configurable:!0,writable:!0}):n[r]=e,n}function l(n,r){var e=Object.keys(n);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(n);r&&(t=t.filter((function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable}))),e.push.apply(e,t)}return e}function f(n){for(var r=1;r<arguments.length;r++){var e=null!=arguments[r]?arguments[r]:{};r%2?l(Object(e),!0).forEach((function(r){c(n,r,e[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(e)):l(Object(e)).forEach((function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(e,r))}))}return n}function v(n,r){if(null==n)return{};var e,t,o={},u=Object.keys(n);for(t=0;t<u.length;t++)e=u[t],r.indexOf(e)>=0||(o[e]=n[e]);return o}!function(n,e){for(var t in i(n),e)r(n,t,{get:e[t],enumerable:!0})}(exports,{BentoDailymotion:function(){return yn},BentoDailymotionWithRef:function(){return mn}});var s=Array.isArray;function d(n){return(d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n})(n)}function p(n,r){(null==r||r>n.length)&&(r=n.length);for(var e=0,t=new Array(r);e<r;e++)t[e]=n[e];return t}function b(n,r){if(n){if("string"==typeof n)return p(n,r);var e=Object.prototype.toString.call(n).slice(8,-1);return"Object"===e&&n.constructor&&(e=n.constructor.name),"Map"===e||"Set"===e?Array.from(n):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?p(n,r):void 0}}function m(n,r){var e="undefined"!=typeof Symbol&&n[Symbol.iterator]||n["@@iterator"];if(e)return(e=e.call(n)).next.bind(e);if(Array.isArray(n)||(e=b(n))||r&&n&&"number"==typeof n.length){e&&(n=e);var t=0;return function(){return t>=n.length?{done:!0}:{done:!1,value:n[t++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var y=Object.prototype;function g(n){var r=Object.create(null);return n&&Object.assign(r,n),r}y.hasOwnProperty,y.toString;var j,w=function(){var n=this;this.promise=new Promise((function(r,e){n.resolve=r,n.reject=e}))};function h(n){return new Promise((function(r){r(n())}))}function O(n){var r=Object.getOwnPropertyDescriptor(n,"message");if(null!=r&&r.writable)return n;var e=n.message,t=n.stack,o=new Error(e);for(var u in n)o[u]=n[u];return o.stack=t,o}function S(n){for(var r,e=null,t="",o=m(arguments,!0);!(r=o()).done;){var u=r.value;u instanceof Error&&!e?e=O(u):(t&&(t+=" "),t+=u)}return e?t&&(e.message=t+": "+e.message):e=new Error(t),e}function q(n){var r,e;null===(r=(e=self).__AMP_REPORT_ERROR)||void 0===r||r.call(e,n)}function I(n){var r=S.apply(null,arguments);return r.expected=!0,r}var k=["Webkit","webkit","Moz","moz","ms","O","o"];function C(n,r,e,t,o){var u=function(n,r,e){if(r.startsWith("--"))return r;j||(j=g());var t=j[r];if(!t||e){if(t=r,void 0===n[r]){var o=function(n){return n.charAt(0).toUpperCase()+n.slice(1)}(r),u=function(n,r){for(var e=0;e<k.length;e++){var t=k[e]+r;if(void 0!==n[t])return t}return""}(n,o);void 0!==n[u]&&(t=u)}e||(j[r]=t)}return t}(n.style,r,o);if(u){var i,a=t?e+t:e;n.style.setProperty((i=u.replace(/[A-Z]/g,(function(n){return"-"+n.toLowerCase()})),k.some((function(n){return i.startsWith(n+"-")}))?"-".concat(i):i),a)}}function E(n){return null==n.__AMP_AUTOPLAY&&(n.__AMP_AUTOPLAY=function(n){var r,e=n.document.createElement("video");return e.setAttribute("muted",""),e.setAttribute("playsinline",""),e.setAttribute("webkit-playsinline",""),e.setAttribute("height","0"),e.setAttribute("width","0"),e.muted=!0,e.playsInline=!0,e.playsinline=!0,e.webkitPlaysinline=!0,function(n,r){for(var e in r)C(n,e,r[e])}(e,{position:"fixed",top:"0",width:"0",height:"0",opacity:"0"}),r=e,h((function(){return r.play()})).catch((function(){})),Promise.resolve(!e.paused)}(n)),n.__AMP_AUTOPLAY}var P=/(?:^[#?]?|&)([^=&]+)(?:=([^&]*))?/g;function A(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";try{return decodeURIComponent(n)}catch(n){return r}}var M={bubbles:!0,cancelable:!0};function R(n,r,e,t){var o=e||{};n.ownerDocument;var u=n.ownerDocument.createEvent("Event");u.data=o;var i=t||M,a=i.bubbles,c=i.cancelable;u.initEvent(r,a,c),n.dispatchEvent(u)}function N(n,r){return function(n,r,e){if(!r)return n;var t=n.split("#",2),o=t[0].split("?",2);return o[0]+(o[1]?"?".concat(o[1],"&").concat(r):"?".concat(r))+(t[1]?"#".concat(t[1]):"")}(n,function(n){var r,e,t,o=[];for(var u in n){var i=n[u];if(null!=i){i=s(t=i)?t:[t];for(var a=0;a<i.length;a++)o.push((r=u,e=i[a],"".concat(encodeURIComponent(r),"=").concat(encodeURIComponent(e))))}}return o.join("&")}(r))}function T(n,r){return JSON.stringify({"command":n,"parameters":r})}self.__AMP_LOG=self.__AMP_LOG||{user:null,dev:null,userForEmbed:null},self.__AMP_LOG,new Set(["c","v","a","ad"]);var x,U=a(require("@bentoproject/core")),L=a(require("@bentoproject/core")),z=a(require("@bentoproject/core"));function F(n,r){return function(n){if(Array.isArray(n))return n}(n)||function(n,r){var e=null==n?null:"undefined"!=typeof Symbol&&n[Symbol.iterator]||n["@@iterator"];if(null!=e){var t,o,u=[],i=!0,a=!1;try{for(e=e.call(n);!(i=(t=e.next()).done)&&(u.push(t.value),!r||u.length!==r);i=!0);}catch(n){a=!0,o=n}finally{try{i||null==e.return||e.return()}finally{if(a)throw o}}return u}}(n,r)||b(n,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function B(n){var r=function(n,r){if("object"!==d(n)||null===n)return n;var e=n[Symbol.toPrimitive];if(void 0!==e){var t=e.call(n,"string");if("object"!==d(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(n)}(n);return"symbol"===d(r)?r:String(r)}var D=(c(x={},"auto",0),c(x,"lazy",1),c(x,"eager",2),c(x,"unload",3),"loading"),V=a(require("@bentoproject/core")),W=a(require("@bentoproject/core")),J=a(require("@bentoproject/core")),Y=a(require("@bentoproject/core")),_=a(require("@bentoproject/core")),H=a(require("@bentoproject/core")),Z=a(require("@bentoproject/core")),$={"title":"","artist":"","album":"","artwork":[{"src":""}]};function G(n){var r=n.querySelector('script[type="application/ld+json"]');if(r){var e=function(n,r){try{return function(n){return JSON.parse(n)}(n)}catch(n){return null}}(r.textContent);if(e&&e.image)return"string"==typeof e.image?e.image:e.image["@list"]&&"string"==typeof e.image["@list"][0]?e.image["@list"][0]:"string"==typeof e.image.url?e.image.url:"string"==typeof e.image[0]?e.image[0]:void 0}}function K(n){var r=n.querySelector('link[rel="shortcut icon"]')||n.querySelector('link[rel="icon"]');return r?r.getAttribute("href"):void 0}function Q(n){var r=n.displayIcon,e=n.displayOverlay,t=n.metadata,o=n.onOverlayClick,u=n.pause,i=n.play,a=n.playing,c=n.wrapperRef,l=(0,_.useAmpContext)().playable;return(0,W.useEffect)((function(){if(l){var n=new IntersectionObserver((function(n){n[n.length-1].isIntersecting?i().catch((function(){})):u()}),{threshold:.5});return n.observe(c.current),function(){n.disconnect()}}u()}),[c,i,u,l]),V.createElement(V.Fragment,null,r&&V.createElement("div",{class:"eq-9e7199f"+(a?" eq-playing-9e7199f":"")},V.createElement(en,null)),e&&V.createElement("button",{"aria-label":t&&t.title||"Unmute video",tabindex:"0",class:"autoplay-mask-button-9e7199f fill-content-overlay-fc551a7",onClick:o}))}var X,nn,rn,en=(X=!1,nn=null,rn=function(){return[1,2,3,4].map((function(n){return V.createElement("div",{class:"eq-col-9e7199f",key:n})}))},function(){if(!X){for(var n=arguments.length,r=new Array(n),e=0;e<n;e++)r[e]=arguments[e];nn=rn.apply(self,r),X=!0,rn=null}return nn}),tn=(0,J.forwardRef)((function(n,r){var e,t="class",o=n.autoplay,u=void 0!==o&&o,i=n.component,a=void 0===i?"video":i,c=n.controls,l=void 0!==c&&c,s=n.loading,d=n.loop,p=void 0!==d&&d,b=n.mediasession,m=void 0===b||b,y=n.noaudio,g=void 0!==y&&y,j=n.onPlayingState,O=n.onReadyState,S=n.poster,k=n.sources,C=n.src,E=n.style,P=n[t],A=v(n,["autoplay","component","controls","loading","loop","mediasession","noaudio","onPlayingState","onReadyState","poster","sources","src","style",t].map(B));e=(0,Z.useAmpContext)().notify,(0,H.useLayoutEffect)((function(){e&&e()}));var M=(0,_.useAmpContext)().playable,R=(0,_.useLoading)(s),N="unload"!==R,T=F((0,W.useState)(u),2),x=T[0],U=T[1],L=F((0,W.useState)(!1),2),z=L[0],J=L[1],X=F((0,W.useState)(null),2),nn=X[0],rn=X[1],en=F((0,W.useState)(!u),2),tn=en[0],on=en[1],un=(0,W.useRef)(null),an=(0,W.useRef)(null),cn=(0,W.useMemo)((function(){return new w}),[]),ln=(0,W.useRef)(D),fn=(0,Y.useValueRef)(O),vn=(0,W.useCallback)((function(n,r){if(n!==ln.current){ln.current=n;var e=fn.current;e&&e(n,r)}}),[fn]),sn=(0,Y.useValueRef)(j),dn=(0,W.useCallback)((function(n){J(n);var r=sn.current;r&&r(n)}),[sn]);(0,W.useLayoutEffect)((function(){N||dn(!1)}),[N,dn]);var pn=(0,W.useCallback)((function(){return cn.promise.then((function(){return n=an.current,(r=h((function(){return n.play(!1)}))).catch((function(n){!function(n){for(var r=arguments.length,e=new Array(r>1?r-1:0),t=1;t<r;t++)e[t-1]=arguments[t];q(I.apply(null,e))}("TRYPLAY",n)})),r;var n,r}))}),[cn]),bn=(0,W.useCallback)((function(){cn.promise.then((function(){var n;return null===(n=an.current)||void 0===n?void 0:n.pause()}))}),[cn]),mn=(0,W.useCallback)((function(){return cn.promise.then((function(){return an.current.requestFullscreen()}))}),[cn]),yn=(0,W.useCallback)((function(){U(!1),on(!0)}),[]);return(0,W.useLayoutEffect)((function(){var n,r=null===(n=an.current)||void 0===n?void 0:n.readyState;null!=r&&vn(r>0?"complete":D)}),[vn]),(0,W.useLayoutEffect)((function(){return m&&z&&nn&&function(n,r,e,t){var o=n.navigator;"mediaSession"in o&&n.MediaMetadata&&(o.mediaSession.metadata=new n.MediaMetadata($),o.mediaSession.metadata=new n.MediaMetadata(r),o.mediaSession.setActionHandler("play",e),o.mediaSession.setActionHandler("pause",t))}(window,nn,pn,bn),function(){}}),[m,z,nn,pn,bn]),(0,W.useEffect)((function(){M||bn()}),[M,bn]),(0,W.useImperativeHandle)(r,(function(){return{get readyState(){return ln.current},play:pn,pause:bn,requestFullscreen:mn,get currentTime(){return an.current?an.current.currentTime:0},get duration(){return an.current?an.current.duration:NaN},get autoplay(){return u},get controls(){return l},get loop(){return p},userInteracted:yn,mute:function(){return U(!0)},unmute:function(){tn&&U(!1)}}}),[pn,bn,mn,yn,tn,u,l,p]),V.createElement(Y.ContainWrapper,{contentRef:un,class:P,style:E,size:!0,layout:!0,paint:!0},N&&V.createElement(a,f(f({},A),{},{ref:an,loading:R,muted:x,loop:p,controls:l&&(!u||tn),onCanPlay:function(){cn.resolve(),vn("complete")},onLoadedMetadata:function(){m&&cn.promise.then((function(){var n,r,e,t;rn((n=an.current,f({"title":(r=A).title||r["aria-label"]||document.title,"artist":r.artist||"","album":r.album||"","artwork":[{"src":r.artwork||r.poster||G(document)||(e=document,t=e.querySelector('meta[property="og:image"]'),t?t.getAttribute("content"):void 0)||K(document)||""}]},n&&n.getMetadata?n.getMetadata():Object.create(null))))})),vn("complete")},onPlaying:function(){return dn(!0)},onPause:function(){return dn(!1)},onEnded:function(){return dn(!1)},onError:function(n){vn("error",n),cn.reject(n)},class:"fill-stretch-fc551a7",src:C,poster:S}),k),u&&!tn&&V.createElement(Q,{metadata:nn,playing:z,displayIcon:!g&&x,wrapperRef:un,play:pn,pause:bn,displayOverlay:l,onOverlayClick:yn}))}));tn.displayName="VideoWrapper";var on=["loading","unloadOnPause","sandbox","muted","controls","origin","onCanPlay","onMessage","playerStateRef","makeMethodMessage","makeFullscreenMessage","onIframeLoad"],un=["allow-scripts","allow-same-origin","allow-popups","allow-popups-to-escape-sandbox","allow-top-navigation-by-user-activation"].join(" ");function an(n,r,e){n&&n.contentWindow&&r.then((function(){n.contentWindow.postMessage(e(),"*")}))}var cn=(0,z.forwardRef)((function(n,r){var e=n.loading,t=n.unloadOnPause,o=void 0!==t&&t,u=n.sandbox,i=void 0===u?un:u,a=n.muted,c=void 0!==a&&a,l=n.controls,s=void 0!==l&&l,d=n.origin,p=n.onCanPlay,b=n.onMessage,m=n.playerStateRef,y=n.makeMethodMessage,g=n.makeFullscreenMessage,j=n.onIframeLoad,h=v(n,on),O=(0,L.useRef)(null),S=(0,L.useMemo)((function(){return new w}),[]),q=(0,L.useRef)(y),I=(0,L.useCallback)((function(n){an(null==O?void 0:O.current,S.promise,(function(){return q.current(n)}))}),[S.promise]),k=(0,L.useRef)(g),C=(0,L.useCallback)((function(){return an(null==O?void 0:O.current,S.promise,k.current)}),[S.promise]);(0,L.useImperativeHandle)(r,(function(){return{get currentTime(){var n,r;return null!==(n=null==m||null===(r=m.current)||void 0===r?void 0:r.currentTime)&&void 0!==n?n:NaN},get duration(){var n,r;return null!==(n=null==m||null===(r=m.current)||void 0===r?void 0:r.duration)&&void 0!==n?n:NaN},requestFullscreen:function(){if(!k.current)return S.promise.then((function(){O.current.requestFullscreen()}));C()},play:function(){return I("play")},pause:function(){if(o){var n=O.current;n&&(n.src=n.src)}else I("pause")}}}),[m,I,C,S.promise,o]);var E=function(n){var r=(0,L.useRef)(null);return r.current=n,r}(b);return(0,L.useLayoutEffect)((function(){if(O.current){var n=O.current.ownerDocument.defaultView;return n.addEventListener("message",r),function(){return n.removeEventListener("message",r)}}function r(n){E.current&&(d&&!d.test(n.origin)||n.source!=O.current.contentWindow||E.current({currentTarget:O.current,target:O.current,data:n.data}))}}),[d,E]),(0,L.useLayoutEffect)((function(){I(c?"mute":"unmute")}),[c,I]),(0,L.useLayoutEffect)((function(){I(s?"showControls":"hideControls")}),[s,I]),U.createElement("iframe",f(f({},h),{},{ref:O,allowfullscreen:!0,frameborder:"0",sandbox:i,loading:e,onCanPlay:function(){p&&S.promise.then(p),S.resolve()},onLoad:function(n){null==j||j(n)}}))}));cn.displayName="VideoIframeInternal";var ln=(0,z.forwardRef)((function(n,r){return U.createElement(tn,f(f({ref:r},n),{},{component:cn}))}));ln.displayName="VideoIframe";var fn=a(require("@bentoproject/core")),vn=a(require("@bentoproject/core")),sn=a(require("@bentoproject/core")),dn=["autoplay","endscreenEnable","info","mute","sharingEnable","start","uiHighlight","uiLogo","videoId"];function pn(n){switch(n){case"mute":return T("muted",[!0]);case"unmute":return T("muted",[!1]);case"showControls":return T("controls",[!0]);case"hideControls":return T("controls",[!1]);default:return T(n)}}function bn(n){var r=n.currentTarget,e=function(n){var r,e=g();if(!n)return e;for(;r=P.exec(n);){var t=A(r[1],r[1]),o=r[2]?A(r[2].replace(/\+/g," "),r[2]):"";e[t]=o}return e}(n.data),t=null==e?void 0:e.event;"pause"===t?R(r,"pause"):"play"===t?R(r,"playing"):"end"===t?(R(r,"pause"),R(r,"end")):"apiready"===t&&R(r,"canplay")}function mn(n,r){var e=n.autoplay,t=n.endscreenEnable,o=n.info,u=n.mute,i=n.sharingEnable,a=n.start,c=n.uiHighlight,l=n.uiLogo,s=n.videoId,d=v(n,dn),p=(0,vn.useMemo)((function(){return function(n,r){var e=arguments.length>2&&void 0!==arguments[2]&&arguments[2],t=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],o=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],u=arguments.length>5&&void 0!==arguments[5]&&arguments[5],i=!(arguments.length>6&&void 0!==arguments[6])||arguments[6],a=arguments.length>7?arguments[7]:void 0,c=arguments.length>8?arguments[8]:void 0,l=!(arguments.length>9&&void 0!==arguments[9])||arguments[9],v=arguments.length>10?arguments[10]:void 0;return N("https://www.dailymotion.com/embed/video/".concat(encodeURIComponent(r),"?api=1&html=1&app=amp"),f({"endscreen-enable":t?void 0:t,"info":o?void 0:o,"mute":u||e&&E(n)?1:void 0,"sharing-enable":i?void 0:i,"start":a,"ui-highlight":c,"ui-logo":l?void 0:l},v))}(window,s,e,t,o,u,i,a,c,l)}),[s,e,t,o,u,i,a,c,l]);return fn.createElement(ln,f(f({autoplay:e,controls:!0,ref:r},d),{},{src:p,makeMethodMessage:pn,onMessage:bn}))}var yn=(0,sn.forwardRef)(mn);yn.displayName="BentoDailymotion"; | ||
var n=Object.create,r=Object.defineProperty,e=Object.getOwnPropertyDescriptor,t=Object.getOwnPropertyNames,o=Object.getPrototypeOf,u=Object.prototype.hasOwnProperty,i=function(n){return r(n,"__esModule",{value:!0})},a=function(a){return function(n,o,i){if(o&&"object"==typeof o||"function"==typeof o)for(var a,c=t(o),l=0,f=c.length;l<f;l++)a=c[l],u.call(n,a)||"default"===a||r(n,a,{get:function(n){return o[n]}.bind(null,a),enumerable:!(i=e(o,a))||i.enumerable});return n}(i(r(null!=a?n(o(a)):{},"default",a&&a.__esModule&&"default"in a?{get:function(){return a.default},enumerable:!0}:{value:a,enumerable:!0})),a)};function c(n,r,e){return r in n?Object.defineProperty(n,r,{value:e,enumerable:!0,configurable:!0,writable:!0}):n[r]=e,n}function l(n,r){var e=Object.keys(n);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(n);r&&(t=t.filter((function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable}))),e.push.apply(e,t)}return e}function f(n){for(var r=1;r<arguments.length;r++){var e=null!=arguments[r]?arguments[r]:{};r%2?l(Object(e),!0).forEach((function(r){c(n,r,e[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(e)):l(Object(e)).forEach((function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(e,r))}))}return n}function v(n,r){if(null==n)return{};var e,t,o={},u=Object.keys(n);for(t=0;t<u.length;t++)e=u[t],r.indexOf(e)>=0||(o[e]=n[e]);return o}!function(n,e){for(var t in i(n),e)r(n,t,{get:e[t],enumerable:!0})}(exports,{BentoDailymotion:function(){return yn},BentoDailymotionWithRef:function(){return mn}});var s=Array.isArray;function d(n){return(d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n})(n)}function p(n,r){(null==r||r>n.length)&&(r=n.length);for(var e=0,t=new Array(r);e<r;e++)t[e]=n[e];return t}function b(n,r){if(n){if("string"==typeof n)return p(n,r);var e=Object.prototype.toString.call(n).slice(8,-1);return"Object"===e&&n.constructor&&(e=n.constructor.name),"Map"===e||"Set"===e?Array.from(n):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?p(n,r):void 0}}function m(n,r){var e="undefined"!=typeof Symbol&&n[Symbol.iterator]||n["@@iterator"];if(e)return(e=e.call(n)).next.bind(e);if(Array.isArray(n)||(e=b(n))||r&&n&&"number"==typeof n.length){e&&(n=e);var t=0;return function(){return t>=n.length?{done:!0}:{done:!1,value:n[t++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var y=Object.prototype;function g(n){var r=Object.create(null);return n&&Object.assign(r,n),r}y.hasOwnProperty,y.toString;var j,w=function(){var n=this;this.promise=new Promise((function(r,e){n.resolve=r,n.reject=e}))};function h(n){return new Promise((function(r){r(n())}))}function O(n){var r=Object.getOwnPropertyDescriptor(n,"message");if(null!=r&&r.writable)return n;var e=n.message,t=n.stack,o=new Error(e);for(var u in n)o[u]=n[u];return o.stack=t,o}function S(n){for(var r,e=null,t="",o=m(arguments,!0);!(r=o()).done;){var u=r.value;u instanceof Error&&!e?e=O(u):(t&&(t+=" "),t+=u)}return e?t&&(e.message=t+": "+e.message):e=new Error(t),e}function q(n){var r,e;null===(r=(e=self).__AMP_REPORT_ERROR)||void 0===r||r.call(e,n)}function I(n){var r=S.apply(null,arguments);return r.expected=!0,r}var k=["Webkit","webkit","Moz","moz","ms","O","o"];function C(n,r,e,t,o){var u=function(n,r,e){if(r.startsWith("--"))return r;j||(j=g());var t=j[r];if(!t||e){if(t=r,void 0===n[r]){var o=function(n){return n.charAt(0).toUpperCase()+n.slice(1)}(r),u=function(n,r){for(var e=0;e<k.length;e++){var t=k[e]+r;if(void 0!==n[t])return t}return""}(n,o);void 0!==n[u]&&(t=u)}e||(j[r]=t)}return t}(n.style,r,o);if(u){var i,a=t?e+t:e;n.style.setProperty((i=u.replace(/[A-Z]/g,(function(n){return"-"+n.toLowerCase()})),k.some((function(n){return i.startsWith(n+"-")}))?"-".concat(i):i),a)}}function E(n){return null==n.__AMP_AUTOPLAY&&(n.__AMP_AUTOPLAY=function(n){var r,e=n.document.createElement("video");return e.setAttribute("muted",""),e.setAttribute("playsinline",""),e.setAttribute("webkit-playsinline",""),e.setAttribute("height","0"),e.setAttribute("width","0"),e.muted=!0,e.playsInline=!0,e.playsinline=!0,e.webkitPlaysinline=!0,function(n,r){for(var e in r)C(n,e,r[e])}(e,{position:"fixed",top:"0",width:"0",height:"0",opacity:"0"}),r=e,h((function(){return r.play()})).catch((function(){})),Promise.resolve(!e.paused)}(n)),n.__AMP_AUTOPLAY}var P=/(?:^[#?]?|&)([^=&]+)(?:=([^&]*))?/g;function A(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";try{return decodeURIComponent(n)}catch(n){return r}}var M={bubbles:!0,cancelable:!0};function R(n,r,e,t){var o=e||{};n.ownerDocument;var u=n.ownerDocument.createEvent("Event");u.data=o;var i=t||M,a=i.bubbles,c=i.cancelable;u.initEvent(r,a,c),n.dispatchEvent(u)}function N(n,r){return function(n,r,e){if(!r)return n;var t=n.split("#",2),o=t[0].split("?",2);return o[0]+(o[1]?"?".concat(o[1],"&").concat(r):"?".concat(r))+(t[1]?"#".concat(t[1]):"")}(n,function(n){var r,e,t,o=[];for(var u in n){var i=n[u];if(null!=i){i=s(t=i)?t:[t];for(var a=0;a<i.length;a++)o.push((r=u,e=i[a],"".concat(encodeURIComponent(r),"=").concat(encodeURIComponent(e))))}}return o.join("&")}(r))}function T(n,r){return JSON.stringify({"command":n,"parameters":r})}self.__AMP_LOG=self.__AMP_LOG||{user:null,dev:null,userForEmbed:null},self.__AMP_LOG,new Set(["c","v","a","ad"]);var x,U=a(require("@bentoproject/core/preact")),L=a(require("@bentoproject/core/preact")),z=a(require("@bentoproject/core/preact"));function F(n,r){return function(n){if(Array.isArray(n))return n}(n)||function(n,r){var e=null==n?null:"undefined"!=typeof Symbol&&n[Symbol.iterator]||n["@@iterator"];if(null!=e){var t,o,u=[],i=!0,a=!1;try{for(e=e.call(n);!(i=(t=e.next()).done)&&(u.push(t.value),!r||u.length!==r);i=!0);}catch(n){a=!0,o=n}finally{try{i||null==e.return||e.return()}finally{if(a)throw o}}return u}}(n,r)||b(n,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function B(n){var r=function(n,r){if("object"!==d(n)||null===n)return n;var e=n[Symbol.toPrimitive];if(void 0!==e){var t=e.call(n,"string");if("object"!==d(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(n)}(n);return"symbol"===d(r)?r:String(r)}var D=(c(x={},"auto",0),c(x,"lazy",1),c(x,"eager",2),c(x,"unload",3),"loading"),V=a(require("@bentoproject/core/preact")),W=a(require("@bentoproject/core/preact")),J=a(require("@bentoproject/core/preact")),Y=a(require("@bentoproject/core/preact")),_=a(require("@bentoproject/core/preact")),H=a(require("@bentoproject/core/preact")),Z=a(require("@bentoproject/core/preact")),$={"title":"","artist":"","album":"","artwork":[{"src":""}]};function G(n){var r=n.querySelector('script[type="application/ld+json"]');if(r){var e=function(n,r){try{return function(n){return JSON.parse(n)}(n)}catch(n){return null}}(r.textContent);if(e&&e.image)return"string"==typeof e.image?e.image:e.image["@list"]&&"string"==typeof e.image["@list"][0]?e.image["@list"][0]:"string"==typeof e.image.url?e.image.url:"string"==typeof e.image[0]?e.image[0]:void 0}}function K(n){var r=n.querySelector('link[rel="shortcut icon"]')||n.querySelector('link[rel="icon"]');return r?r.getAttribute("href"):void 0}function Q(n){var r=n.displayIcon,e=n.displayOverlay,t=n.metadata,o=n.onOverlayClick,u=n.pause,i=n.play,a=n.playing,c=n.wrapperRef,l=(0,_.useAmpContext)().playable;return(0,W.useEffect)((function(){if(l){var n=new IntersectionObserver((function(n){n[n.length-1].isIntersecting?i().catch((function(){})):u()}),{threshold:.5});return n.observe(c.current),function(){n.disconnect()}}u()}),[c,i,u,l]),V.createElement(V.Fragment,null,r&&V.createElement("div",{class:"eq-9e7199f"+(a?" eq-playing-9e7199f":"")},V.createElement(en,null)),e&&V.createElement("button",{"aria-label":t&&t.title||"Unmute video",tabindex:"0",class:"autoplay-mask-button-9e7199f fill-content-overlay-fc551a7",onClick:o}))}var X,nn,rn,en=(X=!1,nn=null,rn=function(){return[1,2,3,4].map((function(n){return V.createElement("div",{class:"eq-col-9e7199f",key:n})}))},function(){if(!X){for(var n=arguments.length,r=new Array(n),e=0;e<n;e++)r[e]=arguments[e];nn=rn.apply(self,r),X=!0,rn=null}return nn}),tn=(0,J.forwardRef)((function(n,r){var e,t="class",o=n.autoplay,u=void 0!==o&&o,i=n.component,a=void 0===i?"video":i,c=n.controls,l=void 0!==c&&c,s=n.loading,d=n.loop,p=void 0!==d&&d,b=n.mediasession,m=void 0===b||b,y=n.noaudio,g=void 0!==y&&y,j=n.onPlayingState,O=n.onReadyState,S=n.poster,k=n.sources,C=n.src,E=n.style,P=n[t],A=v(n,["autoplay","component","controls","loading","loop","mediasession","noaudio","onPlayingState","onReadyState","poster","sources","src","style",t].map(B));e=(0,Z.useAmpContext)().notify,(0,H.useLayoutEffect)((function(){e&&e()}));var M=(0,_.useAmpContext)().playable,R=(0,_.useLoading)(s),N="unload"!==R,T=F((0,W.useState)(u),2),x=T[0],U=T[1],L=F((0,W.useState)(!1),2),z=L[0],J=L[1],X=F((0,W.useState)(null),2),nn=X[0],rn=X[1],en=F((0,W.useState)(!u),2),tn=en[0],on=en[1],un=(0,W.useRef)(null),an=(0,W.useRef)(null),cn=(0,W.useMemo)((function(){return new w}),[]),ln=(0,W.useRef)(D),fn=(0,Y.useValueRef)(O),vn=(0,W.useCallback)((function(n,r){if(n!==ln.current){ln.current=n;var e=fn.current;e&&e(n,r)}}),[fn]),sn=(0,Y.useValueRef)(j),dn=(0,W.useCallback)((function(n){J(n);var r=sn.current;r&&r(n)}),[sn]);(0,W.useLayoutEffect)((function(){N||dn(!1)}),[N,dn]);var pn=(0,W.useCallback)((function(){return cn.promise.then((function(){return n=an.current,(r=h((function(){return n.play(!1)}))).catch((function(n){!function(n){for(var r=arguments.length,e=new Array(r>1?r-1:0),t=1;t<r;t++)e[t-1]=arguments[t];q(I.apply(null,e))}("TRYPLAY",n)})),r;var n,r}))}),[cn]),bn=(0,W.useCallback)((function(){cn.promise.then((function(){var n;return null===(n=an.current)||void 0===n?void 0:n.pause()}))}),[cn]),mn=(0,W.useCallback)((function(){return cn.promise.then((function(){return an.current.requestFullscreen()}))}),[cn]),yn=(0,W.useCallback)((function(){U(!1),on(!0)}),[]);return(0,W.useLayoutEffect)((function(){var n,r=null===(n=an.current)||void 0===n?void 0:n.readyState;null!=r&&vn(r>0?"complete":D)}),[vn]),(0,W.useLayoutEffect)((function(){return m&&z&&nn&&function(n,r,e,t){var o=n.navigator;"mediaSession"in o&&n.MediaMetadata&&(o.mediaSession.metadata=new n.MediaMetadata($),o.mediaSession.metadata=new n.MediaMetadata(r),o.mediaSession.setActionHandler("play",e),o.mediaSession.setActionHandler("pause",t))}(window,nn,pn,bn),function(){}}),[m,z,nn,pn,bn]),(0,W.useEffect)((function(){M||bn()}),[M,bn]),(0,W.useImperativeHandle)(r,(function(){return{get readyState(){return ln.current},play:pn,pause:bn,requestFullscreen:mn,get currentTime(){return an.current?an.current.currentTime:0},get duration(){return an.current?an.current.duration:NaN},get autoplay(){return u},get controls(){return l},get loop(){return p},userInteracted:yn,mute:function(){return U(!0)},unmute:function(){tn&&U(!1)}}}),[pn,bn,mn,yn,tn,u,l,p]),V.createElement(Y.ContainWrapper,{contentRef:un,class:P,style:E,size:!0,layout:!0,paint:!0},N&&V.createElement(a,f(f({},A),{},{ref:an,loading:R,muted:x,loop:p,controls:l&&(!u||tn),onCanPlay:function(){cn.resolve(),vn("complete")},onLoadedMetadata:function(){m&&cn.promise.then((function(){var n,r,e,t;rn((n=an.current,f({"title":(r=A).title||r["aria-label"]||document.title,"artist":r.artist||"","album":r.album||"","artwork":[{"src":r.artwork||r.poster||G(document)||(e=document,t=e.querySelector('meta[property="og:image"]'),t?t.getAttribute("content"):void 0)||K(document)||""}]},n&&n.getMetadata?n.getMetadata():Object.create(null))))})),vn("complete")},onPlaying:function(){return dn(!0)},onPause:function(){return dn(!1)},onEnded:function(){return dn(!1)},onError:function(n){vn("error",n),cn.reject(n)},class:"fill-stretch-fc551a7",src:C,poster:S}),k),u&&!tn&&V.createElement(Q,{metadata:nn,playing:z,displayIcon:!g&&x,wrapperRef:un,play:pn,pause:bn,displayOverlay:l,onOverlayClick:yn}))}));tn.displayName="VideoWrapper";var on=["loading","unloadOnPause","sandbox","muted","controls","origin","onCanPlay","onMessage","playerStateRef","makeMethodMessage","makeFullscreenMessage","onIframeLoad"],un=["allow-scripts","allow-same-origin","allow-popups","allow-popups-to-escape-sandbox","allow-top-navigation-by-user-activation"].join(" ");function an(n,r,e){n&&n.contentWindow&&r.then((function(){n.contentWindow.postMessage(e(),"*")}))}var cn=(0,z.forwardRef)((function(n,r){var e=n.loading,t=n.unloadOnPause,o=void 0!==t&&t,u=n.sandbox,i=void 0===u?un:u,a=n.muted,c=void 0!==a&&a,l=n.controls,s=void 0!==l&&l,d=n.origin,p=n.onCanPlay,b=n.onMessage,m=n.playerStateRef,y=n.makeMethodMessage,g=n.makeFullscreenMessage,j=n.onIframeLoad,h=v(n,on),O=(0,L.useRef)(null),S=(0,L.useMemo)((function(){return new w}),[]),q=(0,L.useRef)(y),I=(0,L.useCallback)((function(n){an(null==O?void 0:O.current,S.promise,(function(){return q.current(n)}))}),[S.promise]),k=(0,L.useRef)(g),C=(0,L.useCallback)((function(){return an(null==O?void 0:O.current,S.promise,k.current)}),[S.promise]);(0,L.useImperativeHandle)(r,(function(){return{get currentTime(){var n,r;return null!==(n=null==m||null===(r=m.current)||void 0===r?void 0:r.currentTime)&&void 0!==n?n:NaN},get duration(){var n,r;return null!==(n=null==m||null===(r=m.current)||void 0===r?void 0:r.duration)&&void 0!==n?n:NaN},requestFullscreen:function(){if(!k.current)return S.promise.then((function(){O.current.requestFullscreen()}));C()},play:function(){return I("play")},pause:function(){if(o){var n=O.current;n&&(n.src=n.src)}else I("pause")}}}),[m,I,C,S.promise,o]);var E=function(n){var r=(0,L.useRef)(null);return r.current=n,r}(b);return(0,L.useLayoutEffect)((function(){if(O.current){var n=O.current.ownerDocument.defaultView;return n.addEventListener("message",r),function(){return n.removeEventListener("message",r)}}function r(n){E.current&&(d&&!d.test(n.origin)||n.source!=O.current.contentWindow||E.current({currentTarget:O.current,target:O.current,data:n.data}))}}),[d,E]),(0,L.useLayoutEffect)((function(){I(c?"mute":"unmute")}),[c,I]),(0,L.useLayoutEffect)((function(){I(s?"showControls":"hideControls")}),[s,I]),U.createElement("iframe",f(f({},h),{},{ref:O,allowfullscreen:!0,frameborder:"0",sandbox:i,loading:e,onCanPlay:function(){p&&S.promise.then(p),S.resolve()},onLoad:function(n){null==j||j(n)}}))}));cn.displayName="VideoIframeInternal";var ln=(0,z.forwardRef)((function(n,r){return U.createElement(tn,f(f({ref:r},n),{},{component:cn}))}));ln.displayName="VideoIframe";var fn=a(require("@bentoproject/core/preact")),vn=a(require("@bentoproject/core/preact")),sn=a(require("@bentoproject/core/preact")),dn=["autoplay","endscreenEnable","info","mute","sharingEnable","start","uiHighlight","uiLogo","videoId"];function pn(n){switch(n){case"mute":return T("muted",[!0]);case"unmute":return T("muted",[!1]);case"showControls":return T("controls",[!0]);case"hideControls":return T("controls",[!1]);default:return T(n)}}function bn(n){var r=n.currentTarget,e=function(n){var r,e=g();if(!n)return e;for(;r=P.exec(n);){var t=A(r[1],r[1]),o=r[2]?A(r[2].replace(/\+/g," "),r[2]):"";e[t]=o}return e}(n.data),t=null==e?void 0:e.event;"pause"===t?R(r,"pause"):"play"===t?R(r,"playing"):"end"===t?(R(r,"pause"),R(r,"end")):"apiready"===t&&R(r,"canplay")}function mn(n,r){var e=n.autoplay,t=n.endscreenEnable,o=n.info,u=n.mute,i=n.sharingEnable,a=n.start,c=n.uiHighlight,l=n.uiLogo,s=n.videoId,d=v(n,dn),p=(0,vn.useMemo)((function(){return function(n,r){var e=arguments.length>2&&void 0!==arguments[2]&&arguments[2],t=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],o=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],u=arguments.length>5&&void 0!==arguments[5]&&arguments[5],i=!(arguments.length>6&&void 0!==arguments[6])||arguments[6],a=arguments.length>7?arguments[7]:void 0,c=arguments.length>8?arguments[8]:void 0,l=!(arguments.length>9&&void 0!==arguments[9])||arguments[9],v=arguments.length>10?arguments[10]:void 0;return N("https://www.dailymotion.com/embed/video/".concat(encodeURIComponent(r),"?api=1&html=1&app=amp"),f({"endscreen-enable":t?void 0:t,"info":o?void 0:o,"mute":u||e&&E(n)?1:void 0,"sharing-enable":i?void 0:i,"start":a,"ui-highlight":c,"ui-logo":l?void 0:l},v))}(window,s,e,t,o,u,i,a,c,l)}),[s,e,t,o,u,i,a,c,l]);return fn.createElement(ln,f(f({autoplay:e,controls:!0,ref:r},d),{},{src:p,makeMethodMessage:pn,onMessage:bn}))}var yn=(0,sn.forwardRef)(mn);yn.displayName="BentoDailymotion"; | ||
/*! https://mths.be/cssescape v1.5.1 by @mathias | MIT license */ | ||
//# sourceMappingURL=component-preact.js.map |
@@ -573,5 +573,5 @@ var __create = Object.create; | ||
// src/bento/components/bento-video/1.0/video-iframe.js | ||
var Preact2 = __toModule(require("@bentoproject/core")); | ||
var import_preact2 = __toModule(require("@bentoproject/core")); | ||
var import_compat2 = __toModule(require("@bentoproject/core")); | ||
var Preact2 = __toModule(require("@bentoproject/core/preact")); | ||
var import_preact2 = __toModule(require("@bentoproject/core/preact")); | ||
var import_compat2 = __toModule(require("@bentoproject/core/preact")); | ||
@@ -622,11 +622,11 @@ // src/bento/components/bento-video/1.0/autoplay.jss.js | ||
// src/bento/components/bento-video/1.0/component.js | ||
var Preact = __toModule(require("@bentoproject/core")); | ||
var import_preact = __toModule(require("@bentoproject/core")); | ||
var import_compat = __toModule(require("@bentoproject/core")); | ||
var import_component3 = __toModule(require("@bentoproject/core")); | ||
var import_context2 = __toModule(require("@bentoproject/core")); | ||
var Preact = __toModule(require("@bentoproject/core/preact")); | ||
var import_preact = __toModule(require("@bentoproject/core/preact")); | ||
var import_compat = __toModule(require("@bentoproject/core/preact")); | ||
var import_component3 = __toModule(require("@bentoproject/core/preact")); | ||
var import_context2 = __toModule(require("@bentoproject/core/preact")); | ||
// src/preact/utils.js | ||
var import__ = __toModule(require("@bentoproject/core")); | ||
var import_context = __toModule(require("@bentoproject/core")); | ||
var import__ = __toModule(require("@bentoproject/core/preact")); | ||
var import_context = __toModule(require("@bentoproject/core/preact")); | ||
function useResourcesNotify() { | ||
@@ -1126,5 +1126,5 @@ var _useAmpContext = (0, import_context.useAmpContext)(), notify = _useAmpContext.notify; | ||
// src/bento/components/bento-dailymotion/1.0/component.js | ||
var Preact3 = __toModule(require("@bentoproject/core")); | ||
var import_preact3 = __toModule(require("@bentoproject/core")); | ||
var import_compat3 = __toModule(require("@bentoproject/core")); | ||
var Preact3 = __toModule(require("@bentoproject/core/preact")); | ||
var import_preact3 = __toModule(require("@bentoproject/core/preact")); | ||
var import_compat3 = __toModule(require("@bentoproject/core/preact")); | ||
var _excluded2 = ["autoplay", "endscreenEnable", "info", "mute", "sharingEnable", "start", "uiHighlight", "uiLogo", "videoId"]; | ||
@@ -1131,0 +1131,0 @@ function _extends4() { |
@@ -462,5 +462,5 @@ // src/core/mode/minified.js | ||
createElement as createElement2 | ||
} from "@bentoproject/core"; | ||
import { useCallback as useCallback3, useImperativeHandle as useImperativeHandle2, useLayoutEffect as useLayoutEffect3, useMemo as useMemo2, useRef as useRef2 } from "@bentoproject/core"; | ||
import { forwardRef as forwardRef2 } from "@bentoproject/core"; | ||
} from "@bentoproject/core/preact"; | ||
import { useCallback as useCallback3, useImperativeHandle as useImperativeHandle2, useLayoutEffect as useLayoutEffect3, useMemo as useMemo2, useRef as useRef2 } from "@bentoproject/core/preact"; | ||
import { forwardRef as forwardRef2 } from "@bentoproject/core/preact"; | ||
@@ -518,11 +518,11 @@ // src/bento/components/bento-video/1.0/autoplay.jss.js | ||
createElement | ||
} from "@bentoproject/core"; | ||
import { useCallback as useCallback2, useEffect, useImperativeHandle, useLayoutEffect as useLayoutEffect2, useMemo, useRef, useState } from "@bentoproject/core"; | ||
import { forwardRef } from "@bentoproject/core"; | ||
import { ContainWrapper, useValueRef } from "@bentoproject/core"; | ||
import { useAmpContext as useAmpContext2, useLoading } from "@bentoproject/core"; | ||
} from "@bentoproject/core/preact"; | ||
import { useCallback as useCallback2, useEffect, useImperativeHandle, useLayoutEffect as useLayoutEffect2, useMemo, useRef, useState } from "@bentoproject/core/preact"; | ||
import { forwardRef } from "@bentoproject/core/preact"; | ||
import { ContainWrapper, useValueRef } from "@bentoproject/core/preact"; | ||
import { useAmpContext as useAmpContext2, useLoading } from "@bentoproject/core/preact"; | ||
// src/preact/utils.js | ||
import { useCallback, useLayoutEffect } from "@bentoproject/core"; | ||
import { useAmpContext } from "@bentoproject/core"; | ||
import { useCallback, useLayoutEffect } from "@bentoproject/core/preact"; | ||
import { useAmpContext } from "@bentoproject/core/preact"; | ||
function useResourcesNotify() { | ||
@@ -1043,5 +1043,5 @@ const { | ||
createElement as createElement3 | ||
} from "@bentoproject/core"; | ||
import { useMemo as useMemo3 } from "@bentoproject/core"; | ||
import { forwardRef as forwardRef3 } from "@bentoproject/core"; | ||
} from "@bentoproject/core/preact"; | ||
import { useMemo as useMemo3 } from "@bentoproject/core/preact"; | ||
import { forwardRef as forwardRef3 } from "@bentoproject/core/preact"; | ||
var _excluded2 = ["autoplay", "endscreenEnable", "info", "mute", "sharingEnable", "start", "uiHighlight", "uiLogo", "videoId"]; | ||
@@ -1048,0 +1048,0 @@ function _extends4() { |
; | ||
function e(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function n(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function t(t){for(var o=1;o<arguments.length;o++){var r=null!=arguments[o]?arguments[o]:{};o%2?n(Object(r),!0).forEach((function(n){e(t,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function o(e,n){if(null==e)return{};var t,o,r={},a=Object.keys(e);for(o=0;o<a.length;o++)t=a[o],n.indexOf(t)>=0||(r[t]=e[t]);return r}var{isArray:r}=Array,{hasOwnProperty:a,toString:i}=Object.prototype;function l(e){const n=Object.create(null);return e&&Object.assign(n,e),n}var u,c=class{constructor(){this.promise=new Promise(((e,n)=>{this.resolve=e,this.reject=n}))}};function s(e){return new Promise((n=>{n(e())}))}function f(e){const n=Object.getOwnPropertyDescriptor(e,"message");if(null!=n&&n.writable)return e;const{message:t,stack:o}=e,r=new Error(t);for(const n in e)r[n]=e[n];return r.stack=o,r}function d(e){let n=null,t="";for(const e of arguments)e instanceof Error&&!n?n=f(e):(t&&(t+=" "),t+=e);return n?t&&(n.message=t+": "+n.message):n=new Error(t),n}function p(e){const n=d.apply(null,arguments);return n.expected=!0,n}function m(e,...n){var t,o,r;t=p.apply(null,n),null===(o=(r=self).__AMP_REPORT_ERROR)||void 0===o||o.call(r,t)}var y=["Webkit","webkit","Moz","moz","ms","O","o"];function b(e,n,t,o,r){const a=function(e,n,t){if(n.startsWith("--"))return n;u||(u=l());let o=u[n];if(!o||t){if(o=n,void 0===e[n]){const t=function(e){return e.charAt(0).toUpperCase()+e.slice(1)}(n),r=function(e,n){for(let t=0;t<y.length;t++){const o=y[t]+n;if(void 0!==e[o])return o}return""}(e,t);void 0!==e[r]&&(o=r)}t||(u[n]=o)}return o}(e.style,n,r);if(!a)return;const i=o?t+o:t;e.style.setProperty(function(e){const n=e.replace(/[A-Z]/g,(e=>"-"+e.toLowerCase()));return y.some((e=>n.startsWith(e+"-")))?`-${n}`:n}(a),i)}function v(e){return null==e.__AMP_AUTOPLAY&&(e.__AMP_AUTOPLAY=function(e){const n=e.document.createElement("video");var t;return n.setAttribute("muted",""),n.setAttribute("playsinline",""),n.setAttribute("webkit-playsinline",""),n.setAttribute("height","0"),n.setAttribute("width","0"),n.muted=!0,n.playsInline=!0,n.playsinline=!0,n.webkitPlaysinline=!0,function(e,n){for(const t in n)b(e,t,n[t])}(n,{position:"fixed",top:"0",width:"0",height:"0",opacity:"0"}),t=n,s((()=>t.play())).catch((()=>{})),Promise.resolve(!n.paused)}(e)),e.__AMP_AUTOPLAY}var g=/(?:^[#?]?|&)([^=&]+)(?:=([^&]*))?/g;function w(e,n=""){try{return decodeURIComponent(e)}catch(e){return n}}var h={bubbles:!0,cancelable:!0};function j(e,n,t,o){const r=t||{};e.ownerDocument;const a=e.ownerDocument.createEvent("Event");a.data=r;const{bubbles:i,cancelable:l}=o||h;a.initEvent(n,i,l),e.dispatchEvent(a)}function O(e,n){return JSON.stringify({"command":e,"parameters":n})}self.__AMP_LOG=self.__AMP_LOG||{user:null,dev:null,userForEmbed:null},self.__AMP_LOG,new Set(["c","v","a","ad"]);import{createElement as k}from"@bentoproject/core";import{useCallback as S,useImperativeHandle as C,useLayoutEffect as E,useMemo as I,useRef as M}from"@bentoproject/core";import{forwardRef as P}from"@bentoproject/core";function R(e){return(R="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function x(e){var n=function(e,n){if("object"!==R(e)||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var o=t.call(e,"string");if("object"!==R(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===R(n)?n:String(n)}import{Fragment as L,createElement as N}from"@bentoproject/core";import{useCallback as $,useEffect as q,useImperativeHandle as F,useLayoutEffect as T,useMemo as U,useRef as A,useState as V}from"@bentoproject/core";import{forwardRef as z}from"@bentoproject/core";import{ContainWrapper as H,useValueRef as J}from"@bentoproject/core";import{useAmpContext as W,useLoading as B}from"@bentoproject/core";import{useCallback as D,useLayoutEffect as Z}from"@bentoproject/core";import{useAmpContext as G}from"@bentoproject/core";var K={"title":"","artist":"","album":"","artwork":[{"src":""}]};function Q(e){const n=e.querySelector('script[type="application/ld+json"]');if(!n)return;const t=function(e,n){try{return function(e){return JSON.parse(e)}(e)}catch(e){return null}}(n.textContent);return t&&t.image?"string"==typeof t.image?t.image:t.image["@list"]&&"string"==typeof t.image["@list"][0]?t.image["@list"][0]:"string"==typeof t.image.url?t.image.url:"string"==typeof t.image[0]?t.image[0]:void 0:void 0}function X(e){const n=e.querySelector('meta[property="og:image"]');return n?n.getAttribute("content"):void 0}function Y(e){const n=e.querySelector('link[rel="shortcut icon"]')||e.querySelector('link[rel="icon"]');return n?n.getAttribute("href"):void 0}function _({displayIcon:e,displayOverlay:n,metadata:t,onOverlayClick:o,pause:r,play:a,playing:i,wrapperRef:l}){const{playable:u}=W();return q((()=>{if(!u)return void r();const e=new IntersectionObserver((e=>{e[e.length-1].isIntersecting?a().catch((()=>{})):r()}),{threshold:.5});return e.observe(l.current),()=>{e.disconnect()}}),[l,a,r,u]),N(L,null,e&&N("div",{class:"eq-9e7199f"+(i?" eq-playing-9e7199f":"")},N(ee,null)),n&&N("button",{"aria-label":t&&t.title||"Unmute video",tabindex:"0",class:"autoplay-mask-button-9e7199f fill-content-overlay-fc551a7",onClick:o}))}var ee=function(e){let n=!1,t=null,o=()=>[1,2,3,4].map((e=>N("div",{class:"eq-col-9e7199f",key:e})));return(...e)=>(n||(t=o.apply(self,e),n=!0,o=null),t)}(),ne=z((function(e,n){let r="class",{autoplay:a=!1,component:i="video",controls:l=!1,loading:u,loop:f=!1,mediasession:d=!0,noaudio:p=!1,onPlayingState:y,onReadyState:b,poster:v,sources:g,src:w,style:h,[r]:j}=e,O=o(e,["autoplay","component","controls","loading","loop","mediasession","noaudio","onPlayingState","onReadyState","poster","sources","src","style",r].map(x));!function(){const{notify:e}=G();Z((()=>{e&&e()}))}();const{playable:k}=W(),S=B(u),C="unload"!==S,[E,I]=V(a),[M,P]=V(!1),[R,L]=V(null),[z,D]=V(!a),ee=A(null),ne=A(null),te=U((()=>new c),[]),oe=A("loading"),re=J(b),ae=$(((e,n)=>{if(e!==oe.current){oe.current=e;const t=re.current;t&&t(e,n)}}),[re]),ie=J(y),le=$((e=>{P(e);const n=ie.current;n&&n(e)}),[ie]);T((()=>{C||le(!1)}),[C,le]);const ue=$((()=>te.promise.then((()=>function(e,n){const t=s((()=>e.play(!1)));return t.catch((e=>{m(0,e)})),t}(ne.current)))),[te]),ce=$((()=>{te.promise.then((()=>{var e;return null===(e=ne.current)||void 0===e?void 0:e.pause()}))}),[te]),se=$((()=>te.promise.then((()=>ne.current.requestFullscreen()))),[te]),fe=$((()=>{I(!1),D(!0)}),[]);return T((()=>{var e;const n=null===(e=ne.current)||void 0===e?void 0:e.readyState;null!=n&&ae(n>0?"complete":"loading")}),[ae]),T((()=>(d&&M&&R&&function(e,n,t,o){const{navigator:r}=e;"mediaSession"in r&&e.MediaMetadata&&(r.mediaSession.metadata=new e.MediaMetadata(K),r.mediaSession.metadata=new e.MediaMetadata(n),r.mediaSession.setActionHandler("play",t),r.mediaSession.setActionHandler("pause",o))}(window,R,ue,ce),()=>{})),[d,M,R,ue,ce]),q((()=>{k||ce()}),[k,ce]),F(n,(()=>({get readyState(){return oe.current},play:ue,pause:ce,requestFullscreen:se,get currentTime(){return ne.current?ne.current.currentTime:0},get duration(){return ne.current?ne.current.duration:NaN},get autoplay(){return a},get controls(){return l},get loop(){return f},userInteracted:fe,mute:()=>I(!0),unmute:()=>{z&&I(!1)}})),[ue,ce,se,fe,z,a,l,f]),N(H,{contentRef:ee,class:j,style:h,size:!0,layout:!0,paint:!0},C&&N(i,t(t({},O),{},{ref:ne,loading:S,muted:E,loop:f,controls:l&&(!a||z),onCanPlay:()=>{te.resolve(),ae("complete")},onLoadedMetadata:()=>{d&&te.promise.then((()=>{var e,n;L((e=ne.current,t({"title":(n=O).title||n["aria-label"]||document.title,"artist":n.artist||"","album":n.album||"","artwork":[{"src":n.artwork||n.poster||Q(document)||X(document)||Y(document)||""}]},e&&e.getMetadata?e.getMetadata():Object.create(null))))})),ae("complete")},onPlaying:()=>le(!0),onPause:()=>le(!1),onEnded:()=>le(!1),onError:e=>{ae("error",e),te.reject(e)},class:"fill-stretch-fc551a7",src:w,poster:v}),g),a&&!z&&N(_,{metadata:R,playing:M,displayIcon:!p&&E,wrapperRef:ee,play:ue,pause:ce,displayOverlay:l,onOverlayClick:fe}))}));ne.displayName="VideoWrapper";var te=["loading","unloadOnPause","sandbox","muted","controls","origin","onCanPlay","onMessage","playerStateRef","makeMethodMessage","makeFullscreenMessage","onIframeLoad"],oe=["allow-scripts","allow-same-origin","allow-popups","allow-popups-to-escape-sandbox","allow-top-navigation-by-user-activation"].join(" ");function re(e,n,t){e&&e.contentWindow&&n.then((()=>{e.contentWindow.postMessage(t(),"*")}))}var ae=P((function(e,n){let{loading:r,unloadOnPause:a=!1,sandbox:i=oe,muted:l=!1,controls:u=!1,origin:s,onCanPlay:f,onMessage:d,playerStateRef:p,makeMethodMessage:m,makeFullscreenMessage:y,onIframeLoad:b}=e,v=o(e,te);const g=M(null),w=I((()=>new c),[]),h=M(m),j=S((e=>{re(null==g?void 0:g.current,w.promise,(()=>h.current(e)))}),[w.promise]),O=M(y),P=S((()=>re(null==g?void 0:g.current,w.promise,O.current)),[w.promise]);C(n,(()=>({get currentTime(){var e,n;return null!==(e=null==p||null===(n=p.current)||void 0===n?void 0:n.currentTime)&&void 0!==e?e:NaN},get duration(){var e,n;return null!==(e=null==p||null===(n=p.current)||void 0===n?void 0:n.duration)&&void 0!==e?e:NaN},requestFullscreen:()=>{if(!O.current)return w.promise.then((()=>{g.current.requestFullscreen()}));P()},play:()=>j("play"),pause:()=>{if(a){const e=g.current;e&&(e.src=e.src)}else j("pause")}})),[p,j,P,w.promise,a]);const R=function(e){const n=M(null);return n.current=e,n}(d);return E((()=>{if(!g.current)return;function e(e){R.current&&(s&&!s.test(e.origin)||e.source!=g.current.contentWindow||R.current({currentTarget:g.current,target:g.current,data:e.data}))}const{defaultView:n}=g.current.ownerDocument;return n.addEventListener("message",e),()=>n.removeEventListener("message",e)}),[s,R]),E((()=>{j(l?"mute":"unmute")}),[l,j]),E((()=>{j(u?"showControls":"hideControls")}),[u,j]),k("iframe",t(t({},v),{},{ref:g,allowfullscreen:!0,frameborder:"0",sandbox:i,loading:r,onCanPlay:()=>{f&&w.promise.then(f),w.resolve()},onLoad:e=>{null==b||b(e)}}))}));ae.displayName="VideoIframeInternal";var ie=P((function(e,n){return k(ne,t(t({ref:n},e),{},{component:ae}))}));ie.displayName="VideoIframe";import{createElement as le}from"@bentoproject/core";import{useMemo as ue}from"@bentoproject/core";import{forwardRef as ce}from"@bentoproject/core";var se=["autoplay","endscreenEnable","info","mute","sharingEnable","start","uiHighlight","uiLogo","videoId"];function fe(e){switch(e){case"mute":return O("muted",[!0]);case"unmute":return O("muted",[!1]);case"showControls":return O("controls",[!0]);case"hideControls":return O("controls",[!1]);default:return O(e)}}function de({currentTarget:e,data:n}){const t=function(e){const n=l();if(!e)return n;let t;for(;t=g.exec(e);){const e=w(t[1],t[1]),o=t[2]?w(t[2].replace(/\+/g," "),t[2]):"";n[e]=o}return n}(n),o=null==t?void 0:t.event;"pause"===o?j(e,"pause"):"play"===o?j(e,"playing"):"end"===o?(j(e,"pause"),j(e,"end")):"apiready"===o&&j(e,"canplay")}function pe(e,n){let{autoplay:a,endscreenEnable:i,info:l,mute:u,sharingEnable:c,start:s,uiHighlight:f,uiLogo:d,videoId:p}=e,m=o(e,se);const y=ue((()=>function(e,n,o=!1,a=!0,i=!0,l=!1,u=!0,c,s,f=!0,d){return function(e,n,t){if(!n)return e;const o=e.split("#",2),r=o[0].split("?",2);let a=r[0]+(r[1]?`?${r[1]}&${n}`:`?${n}`);return a+=o[1]?`#${o[1]}`:"",a}(`https://www.dailymotion.com/embed/video/${encodeURIComponent(n)}?api=1&html=1&app=amp`,function(e){const n=[];for(const i in e){let l=e[i];if(null!=l){l=r(a=l)?a:[a];for(let e=0;e<l.length;e++)n.push((t=i,o=l[e],`${encodeURIComponent(t)}=${encodeURIComponent(o)}`))}}var t,o,a;return n.join("&")}(t({"endscreen-enable":a?void 0:a,"info":i?void 0:i,"mute":l||o&&v(e)?1:void 0,"sharing-enable":u?void 0:u,"start":c,"ui-highlight":s,"ui-logo":f?void 0:f},d)))}(window,p,a,i,l,u,c,s,f,d)),[p,a,i,l,u,c,s,f,d]);return le(ie,t(t({autoplay:a,controls:!0,ref:n},m),{},{src:y,makeMethodMessage:fe,onMessage:de}))}var me=ce(pe);me.displayName="BentoDailymotion";export{me as BentoDailymotion,pe as BentoDailymotionWithRef}; | ||
function e(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function n(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function t(t){for(var o=1;o<arguments.length;o++){var r=null!=arguments[o]?arguments[o]:{};o%2?n(Object(r),!0).forEach((function(n){e(t,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function o(e,n){if(null==e)return{};var t,o,r={},a=Object.keys(e);for(o=0;o<a.length;o++)t=a[o],n.indexOf(t)>=0||(r[t]=e[t]);return r}var{isArray:r}=Array,{hasOwnProperty:a,toString:i}=Object.prototype;function l(e){const n=Object.create(null);return e&&Object.assign(n,e),n}var u,c=class{constructor(){this.promise=new Promise(((e,n)=>{this.resolve=e,this.reject=n}))}};function s(e){return new Promise((n=>{n(e())}))}function f(e){const n=Object.getOwnPropertyDescriptor(e,"message");if(null!=n&&n.writable)return e;const{message:t,stack:o}=e,r=new Error(t);for(const n in e)r[n]=e[n];return r.stack=o,r}function p(e){let n=null,t="";for(const e of arguments)e instanceof Error&&!n?n=f(e):(t&&(t+=" "),t+=e);return n?t&&(n.message=t+": "+n.message):n=new Error(t),n}function d(e){const n=p.apply(null,arguments);return n.expected=!0,n}function m(e,...n){var t,o,r;t=d.apply(null,n),null===(o=(r=self).__AMP_REPORT_ERROR)||void 0===o||o.call(r,t)}var y=["Webkit","webkit","Moz","moz","ms","O","o"];function b(e,n,t,o,r){const a=function(e,n,t){if(n.startsWith("--"))return n;u||(u=l());let o=u[n];if(!o||t){if(o=n,void 0===e[n]){const t=function(e){return e.charAt(0).toUpperCase()+e.slice(1)}(n),r=function(e,n){for(let t=0;t<y.length;t++){const o=y[t]+n;if(void 0!==e[o])return o}return""}(e,t);void 0!==e[r]&&(o=r)}t||(u[n]=o)}return o}(e.style,n,r);if(!a)return;const i=o?t+o:t;e.style.setProperty(function(e){const n=e.replace(/[A-Z]/g,(e=>"-"+e.toLowerCase()));return y.some((e=>n.startsWith(e+"-")))?`-${n}`:n}(a),i)}function v(e){return null==e.__AMP_AUTOPLAY&&(e.__AMP_AUTOPLAY=function(e){const n=e.document.createElement("video");var t;return n.setAttribute("muted",""),n.setAttribute("playsinline",""),n.setAttribute("webkit-playsinline",""),n.setAttribute("height","0"),n.setAttribute("width","0"),n.muted=!0,n.playsInline=!0,n.playsinline=!0,n.webkitPlaysinline=!0,function(e,n){for(const t in n)b(e,t,n[t])}(n,{position:"fixed",top:"0",width:"0",height:"0",opacity:"0"}),t=n,s((()=>t.play())).catch((()=>{})),Promise.resolve(!n.paused)}(e)),e.__AMP_AUTOPLAY}var g=/(?:^[#?]?|&)([^=&]+)(?:=([^&]*))?/g;function w(e,n=""){try{return decodeURIComponent(e)}catch(e){return n}}var h={bubbles:!0,cancelable:!0};function j(e,n,t,o){const r=t||{};e.ownerDocument;const a=e.ownerDocument.createEvent("Event");a.data=r;const{bubbles:i,cancelable:l}=o||h;a.initEvent(n,i,l),e.dispatchEvent(a)}function O(e,n){return JSON.stringify({"command":e,"parameters":n})}self.__AMP_LOG=self.__AMP_LOG||{user:null,dev:null,userForEmbed:null},self.__AMP_LOG,new Set(["c","v","a","ad"]);import{createElement as k}from"@bentoproject/core/preact";import{useCallback as S,useImperativeHandle as C,useLayoutEffect as E,useMemo as I,useRef as M}from"@bentoproject/core/preact";import{forwardRef as P}from"@bentoproject/core/preact";function R(e){return(R="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function x(e){var n=function(e,n){if("object"!==R(e)||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var o=t.call(e,"string");if("object"!==R(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===R(n)?n:String(n)}import{Fragment as L,createElement as N}from"@bentoproject/core/preact";import{useCallback as $,useEffect as q,useImperativeHandle as F,useLayoutEffect as T,useMemo as U,useRef as A,useState as V}from"@bentoproject/core/preact";import{forwardRef as z}from"@bentoproject/core/preact";import{ContainWrapper as H,useValueRef as J}from"@bentoproject/core/preact";import{useAmpContext as W,useLoading as B}from"@bentoproject/core/preact";import{useCallback as D,useLayoutEffect as Z}from"@bentoproject/core/preact";import{useAmpContext as G}from"@bentoproject/core/preact";var K={"title":"","artist":"","album":"","artwork":[{"src":""}]};function Q(e){const n=e.querySelector('script[type="application/ld+json"]');if(!n)return;const t=function(e,n){try{return function(e){return JSON.parse(e)}(e)}catch(e){return null}}(n.textContent);return t&&t.image?"string"==typeof t.image?t.image:t.image["@list"]&&"string"==typeof t.image["@list"][0]?t.image["@list"][0]:"string"==typeof t.image.url?t.image.url:"string"==typeof t.image[0]?t.image[0]:void 0:void 0}function X(e){const n=e.querySelector('meta[property="og:image"]');return n?n.getAttribute("content"):void 0}function Y(e){const n=e.querySelector('link[rel="shortcut icon"]')||e.querySelector('link[rel="icon"]');return n?n.getAttribute("href"):void 0}function _({displayIcon:e,displayOverlay:n,metadata:t,onOverlayClick:o,pause:r,play:a,playing:i,wrapperRef:l}){const{playable:u}=W();return q((()=>{if(!u)return void r();const e=new IntersectionObserver((e=>{e[e.length-1].isIntersecting?a().catch((()=>{})):r()}),{threshold:.5});return e.observe(l.current),()=>{e.disconnect()}}),[l,a,r,u]),N(L,null,e&&N("div",{class:"eq-9e7199f"+(i?" eq-playing-9e7199f":"")},N(ee,null)),n&&N("button",{"aria-label":t&&t.title||"Unmute video",tabindex:"0",class:"autoplay-mask-button-9e7199f fill-content-overlay-fc551a7",onClick:o}))}var ee=function(e){let n=!1,t=null,o=()=>[1,2,3,4].map((e=>N("div",{class:"eq-col-9e7199f",key:e})));return(...e)=>(n||(t=o.apply(self,e),n=!0,o=null),t)}(),ne=z((function(e,n){let r="class",{autoplay:a=!1,component:i="video",controls:l=!1,loading:u,loop:f=!1,mediasession:p=!0,noaudio:d=!1,onPlayingState:y,onReadyState:b,poster:v,sources:g,src:w,style:h,[r]:j}=e,O=o(e,["autoplay","component","controls","loading","loop","mediasession","noaudio","onPlayingState","onReadyState","poster","sources","src","style",r].map(x));!function(){const{notify:e}=G();Z((()=>{e&&e()}))}();const{playable:k}=W(),S=B(u),C="unload"!==S,[E,I]=V(a),[M,P]=V(!1),[R,L]=V(null),[z,D]=V(!a),ee=A(null),ne=A(null),te=U((()=>new c),[]),oe=A("loading"),re=J(b),ae=$(((e,n)=>{if(e!==oe.current){oe.current=e;const t=re.current;t&&t(e,n)}}),[re]),ie=J(y),le=$((e=>{P(e);const n=ie.current;n&&n(e)}),[ie]);T((()=>{C||le(!1)}),[C,le]);const ue=$((()=>te.promise.then((()=>function(e,n){const t=s((()=>e.play(!1)));return t.catch((e=>{m(0,e)})),t}(ne.current)))),[te]),ce=$((()=>{te.promise.then((()=>{var e;return null===(e=ne.current)||void 0===e?void 0:e.pause()}))}),[te]),se=$((()=>te.promise.then((()=>ne.current.requestFullscreen()))),[te]),fe=$((()=>{I(!1),D(!0)}),[]);return T((()=>{var e;const n=null===(e=ne.current)||void 0===e?void 0:e.readyState;null!=n&&ae(n>0?"complete":"loading")}),[ae]),T((()=>(p&&M&&R&&function(e,n,t,o){const{navigator:r}=e;"mediaSession"in r&&e.MediaMetadata&&(r.mediaSession.metadata=new e.MediaMetadata(K),r.mediaSession.metadata=new e.MediaMetadata(n),r.mediaSession.setActionHandler("play",t),r.mediaSession.setActionHandler("pause",o))}(window,R,ue,ce),()=>{})),[p,M,R,ue,ce]),q((()=>{k||ce()}),[k,ce]),F(n,(()=>({get readyState(){return oe.current},play:ue,pause:ce,requestFullscreen:se,get currentTime(){return ne.current?ne.current.currentTime:0},get duration(){return ne.current?ne.current.duration:NaN},get autoplay(){return a},get controls(){return l},get loop(){return f},userInteracted:fe,mute:()=>I(!0),unmute:()=>{z&&I(!1)}})),[ue,ce,se,fe,z,a,l,f]),N(H,{contentRef:ee,class:j,style:h,size:!0,layout:!0,paint:!0},C&&N(i,t(t({},O),{},{ref:ne,loading:S,muted:E,loop:f,controls:l&&(!a||z),onCanPlay:()=>{te.resolve(),ae("complete")},onLoadedMetadata:()=>{p&&te.promise.then((()=>{var e,n;L((e=ne.current,t({"title":(n=O).title||n["aria-label"]||document.title,"artist":n.artist||"","album":n.album||"","artwork":[{"src":n.artwork||n.poster||Q(document)||X(document)||Y(document)||""}]},e&&e.getMetadata?e.getMetadata():Object.create(null))))})),ae("complete")},onPlaying:()=>le(!0),onPause:()=>le(!1),onEnded:()=>le(!1),onError:e=>{ae("error",e),te.reject(e)},class:"fill-stretch-fc551a7",src:w,poster:v}),g),a&&!z&&N(_,{metadata:R,playing:M,displayIcon:!d&&E,wrapperRef:ee,play:ue,pause:ce,displayOverlay:l,onOverlayClick:fe}))}));ne.displayName="VideoWrapper";var te=["loading","unloadOnPause","sandbox","muted","controls","origin","onCanPlay","onMessage","playerStateRef","makeMethodMessage","makeFullscreenMessage","onIframeLoad"],oe=["allow-scripts","allow-same-origin","allow-popups","allow-popups-to-escape-sandbox","allow-top-navigation-by-user-activation"].join(" ");function re(e,n,t){e&&e.contentWindow&&n.then((()=>{e.contentWindow.postMessage(t(),"*")}))}var ae=P((function(e,n){let{loading:r,unloadOnPause:a=!1,sandbox:i=oe,muted:l=!1,controls:u=!1,origin:s,onCanPlay:f,onMessage:p,playerStateRef:d,makeMethodMessage:m,makeFullscreenMessage:y,onIframeLoad:b}=e,v=o(e,te);const g=M(null),w=I((()=>new c),[]),h=M(m),j=S((e=>{re(null==g?void 0:g.current,w.promise,(()=>h.current(e)))}),[w.promise]),O=M(y),P=S((()=>re(null==g?void 0:g.current,w.promise,O.current)),[w.promise]);C(n,(()=>({get currentTime(){var e,n;return null!==(e=null==d||null===(n=d.current)||void 0===n?void 0:n.currentTime)&&void 0!==e?e:NaN},get duration(){var e,n;return null!==(e=null==d||null===(n=d.current)||void 0===n?void 0:n.duration)&&void 0!==e?e:NaN},requestFullscreen:()=>{if(!O.current)return w.promise.then((()=>{g.current.requestFullscreen()}));P()},play:()=>j("play"),pause:()=>{if(a){const e=g.current;e&&(e.src=e.src)}else j("pause")}})),[d,j,P,w.promise,a]);const R=function(e){const n=M(null);return n.current=e,n}(p);return E((()=>{if(!g.current)return;function e(e){R.current&&(s&&!s.test(e.origin)||e.source!=g.current.contentWindow||R.current({currentTarget:g.current,target:g.current,data:e.data}))}const{defaultView:n}=g.current.ownerDocument;return n.addEventListener("message",e),()=>n.removeEventListener("message",e)}),[s,R]),E((()=>{j(l?"mute":"unmute")}),[l,j]),E((()=>{j(u?"showControls":"hideControls")}),[u,j]),k("iframe",t(t({},v),{},{ref:g,allowfullscreen:!0,frameborder:"0",sandbox:i,loading:r,onCanPlay:()=>{f&&w.promise.then(f),w.resolve()},onLoad:e=>{null==b||b(e)}}))}));ae.displayName="VideoIframeInternal";var ie=P((function(e,n){return k(ne,t(t({ref:n},e),{},{component:ae}))}));ie.displayName="VideoIframe";import{createElement as le}from"@bentoproject/core/preact";import{useMemo as ue}from"@bentoproject/core/preact";import{forwardRef as ce}from"@bentoproject/core/preact";var se=["autoplay","endscreenEnable","info","mute","sharingEnable","start","uiHighlight","uiLogo","videoId"];function fe(e){switch(e){case"mute":return O("muted",[!0]);case"unmute":return O("muted",[!1]);case"showControls":return O("controls",[!0]);case"hideControls":return O("controls",[!1]);default:return O(e)}}function pe({currentTarget:e,data:n}){const t=function(e){const n=l();if(!e)return n;let t;for(;t=g.exec(e);){const e=w(t[1],t[1]),o=t[2]?w(t[2].replace(/\+/g," "),t[2]):"";n[e]=o}return n}(n),o=null==t?void 0:t.event;"pause"===o?j(e,"pause"):"play"===o?j(e,"playing"):"end"===o?(j(e,"pause"),j(e,"end")):"apiready"===o&&j(e,"canplay")}function de(e,n){let{autoplay:a,endscreenEnable:i,info:l,mute:u,sharingEnable:c,start:s,uiHighlight:f,uiLogo:p,videoId:d}=e,m=o(e,se);const y=ue((()=>function(e,n,o=!1,a=!0,i=!0,l=!1,u=!0,c,s,f=!0,p){return function(e,n,t){if(!n)return e;const o=e.split("#",2),r=o[0].split("?",2);let a=r[0]+(r[1]?`?${r[1]}&${n}`:`?${n}`);return a+=o[1]?`#${o[1]}`:"",a}(`https://www.dailymotion.com/embed/video/${encodeURIComponent(n)}?api=1&html=1&app=amp`,function(e){const n=[];for(const i in e){let l=e[i];if(null!=l){l=r(a=l)?a:[a];for(let e=0;e<l.length;e++)n.push((t=i,o=l[e],`${encodeURIComponent(t)}=${encodeURIComponent(o)}`))}}var t,o,a;return n.join("&")}(t({"endscreen-enable":a?void 0:a,"info":i?void 0:i,"mute":l||o&&v(e)?1:void 0,"sharing-enable":u?void 0:u,"start":c,"ui-highlight":s,"ui-logo":f?void 0:f},p)))}(window,d,a,i,l,u,c,s,f,p)),[d,a,i,l,u,c,s,f,p]);return le(ie,t(t({autoplay:a,controls:!0,ref:n},m),{},{src:y,makeMethodMessage:fe,onMessage:pe}))}var me=ce(de);me.displayName="BentoDailymotion";export{me as BentoDailymotion,de as BentoDailymotionWithRef}; | ||
/*! https://mths.be/cssescape v1.5.1 by @mathias | MIT license */ | ||
//# sourceMappingURL=component-preact.module.js.map |
; | ||
var n=Object.create,r=Object.defineProperty,e=Object.getOwnPropertyDescriptor,t=Object.getOwnPropertyNames,o=Object.getPrototypeOf,u=Object.prototype.hasOwnProperty,i=function(n){return r(n,"__esModule",{value:!0})},a=function(a){return function(n,o,i){if(o&&"object"==typeof o||"function"==typeof o)for(var a,c=t(o),l=0,f=c.length;l<f;l++)a=c[l],u.call(n,a)||"default"===a||r(n,a,{get:function(n){return o[n]}.bind(null,a),enumerable:!(i=e(o,a))||i.enumerable});return n}(i(r(null!=a?n(o(a)):{},"default",a&&a.__esModule&&"default"in a?{get:function(){return a.default},enumerable:!0}:{value:a,enumerable:!0})),a)};function c(n,r,e){return r in n?Object.defineProperty(n,r,{value:e,enumerable:!0,configurable:!0,writable:!0}):n[r]=e,n}function l(n,r){var e=Object.keys(n);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(n);r&&(t=t.filter((function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable}))),e.push.apply(e,t)}return e}function f(n){for(var r=1;r<arguments.length;r++){var e=null!=arguments[r]?arguments[r]:{};r%2?l(Object(e),!0).forEach((function(r){c(n,r,e[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(e)):l(Object(e)).forEach((function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(e,r))}))}return n}function v(n,r){if(null==n)return{};var e,t,o={},u=Object.keys(n);for(t=0;t<u.length;t++)e=u[t],r.indexOf(e)>=0||(o[e]=n[e]);return o}!function(n,e){for(var t in i(n),e)r(n,t,{get:e[t],enumerable:!0})}(exports,{BentoDailymotion:function(){return yn},BentoDailymotionWithRef:function(){return bn}});var s=Array.isArray;function d(n){return(d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n})(n)}function p(n,r){(null==r||r>n.length)&&(r=n.length);for(var e=0,t=new Array(r);e<r;e++)t[e]=n[e];return t}function m(n,r){if(n){if("string"==typeof n)return p(n,r);var e=Object.prototype.toString.call(n).slice(8,-1);return"Object"===e&&n.constructor&&(e=n.constructor.name),"Map"===e||"Set"===e?Array.from(n):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?p(n,r):void 0}}function b(n,r){var e="undefined"!=typeof Symbol&&n[Symbol.iterator]||n["@@iterator"];if(e)return(e=e.call(n)).next.bind(e);if(Array.isArray(n)||(e=m(n))||r&&n&&"number"==typeof n.length){e&&(n=e);var t=0;return function(){return t>=n.length?{done:!0}:{done:!1,value:n[t++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var y=Object.prototype;function g(n){var r=Object.create(null);return n&&Object.assign(r,n),r}y.hasOwnProperty,y.toString;var w,j=function(){var n=this;this.promise=new Promise((function(r,e){n.resolve=r,n.reject=e}))};function h(n){return new Promise((function(r){r(n())}))}function O(n){var r=Object.getOwnPropertyDescriptor(n,"message");if(null!=r&&r.writable)return n;var e=n.message,t=n.stack,o=new Error(e);for(var u in n)o[u]=n[u];return o.stack=t,o}function S(n){for(var r,e=null,t="",o=b(arguments,!0);!(r=o()).done;){var u=r.value;u instanceof Error&&!e?e=O(u):(t&&(t+=" "),t+=u)}return e?t&&(e.message=t+": "+e.message):e=new Error(t),e}function q(n){var r,e;null===(r=(e=self).__AMP_REPORT_ERROR)||void 0===r||r.call(e,n)}function I(n){var r=S.apply(null,arguments);return r.expected=!0,r}var k=["Webkit","webkit","Moz","moz","ms","O","o"];function C(n,r,e,t,o){var u=function(n,r,e){if(r.startsWith("--"))return r;w||(w=g());var t=w[r];if(!t||e){if(t=r,void 0===n[r]){var o=function(n){return n.charAt(0).toUpperCase()+n.slice(1)}(r),u=function(n,r){for(var e=0;e<k.length;e++){var t=k[e]+r;if(void 0!==n[t])return t}return""}(n,o);void 0!==n[u]&&(t=u)}e||(w[r]=t)}return t}(n.style,r,o);if(u){var i,a=t?e+t:e;n.style.setProperty((i=u.replace(/[A-Z]/g,(function(n){return"-"+n.toLowerCase()})),k.some((function(n){return i.startsWith(n+"-")}))?"-".concat(i):i),a)}}function N(n){return null==n.__AMP_AUTOPLAY&&(n.__AMP_AUTOPLAY=function(n){var r,e=n.document.createElement("video");return e.setAttribute("muted",""),e.setAttribute("playsinline",""),e.setAttribute("webkit-playsinline",""),e.setAttribute("height","0"),e.setAttribute("width","0"),e.muted=!0,e.playsInline=!0,e.playsinline=!0,e.webkitPlaysinline=!0,function(n,r){for(var e in r)C(n,e,r[e])}(e,{position:"fixed",top:"0",width:"0",height:"0",opacity:"0"}),r=e,h((function(){return r.play()})).catch((function(){})),Promise.resolve(!e.paused)}(n)),n.__AMP_AUTOPLAY}var E=/(?:^[#?]?|&)([^=&]+)(?:=([^&]*))?/g;function P(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";try{return decodeURIComponent(n)}catch(n){return r}}var A={bubbles:!0,cancelable:!0};function M(n,r,e,t){var o=e||{};n.ownerDocument;var u=n.ownerDocument.createEvent("Event");u.data=o;var i=t||A,a=i.bubbles,c=i.cancelable;u.initEvent(r,a,c),n.dispatchEvent(u)}function R(n,r){return function(n,r,e){if(!r)return n;var t=n.split("#",2),o=t[0].split("?",2);return o[0]+(o[1]?"?".concat(o[1],"&").concat(r):"?".concat(r))+(t[1]?"#".concat(t[1]):"")}(n,function(n){var r,e,t,o=[];for(var u in n){var i=n[u];if(null!=i){i=s(t=i)?t:[t];for(var a=0;a<i.length;a++)o.push((r=u,e=i[a],"".concat(encodeURIComponent(r),"=").concat(encodeURIComponent(e))))}}return o.join("&")}(r))}function T(n,r){return JSON.stringify({"command":n,"parameters":r})}self.__AMP_LOG=self.__AMP_LOG||{user:null,dev:null,userForEmbed:null},self.__AMP_LOG,new Set(["c","v","a","ad"]);var x,U=a(require("@bentoproject/core")),L=a(require("@bentoproject/core")),z=a(require("react"));function F(n,r){return function(n){if(Array.isArray(n))return n}(n)||function(n,r){var e=null==n?null:"undefined"!=typeof Symbol&&n[Symbol.iterator]||n["@@iterator"];if(null!=e){var t,o,u=[],i=!0,a=!1;try{for(e=e.call(n);!(i=(t=e.next()).done)&&(u.push(t.value),!r||u.length!==r);i=!0);}catch(n){a=!0,o=n}finally{try{i||null==e.return||e.return()}finally{if(a)throw o}}return u}}(n,r)||m(n,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function B(n){var r=function(n,r){if("object"!==d(n)||null===n)return n;var e=n[Symbol.toPrimitive];if(void 0!==e){var t=e.call(n,"string");if("object"!==d(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(n)}(n);return"symbol"===d(r)?r:String(r)}var D=(c(x={},"auto",0),c(x,"lazy",1),c(x,"eager",2),c(x,"unload",3),"loading"),V=a(require("@bentoproject/core")),W=a(require("@bentoproject/core")),J=a(require("react")),Y=a(require("@bentoproject/core")),_=a(require("@bentoproject/core")),H=a(require("@bentoproject/core")),Z=a(require("@bentoproject/core")),$={"title":"","artist":"","album":"","artwork":[{"src":""}]};function G(n){var r=n.querySelector('script[type="application/ld+json"]');if(r){var e=function(n,r){try{return function(n){return JSON.parse(n)}(n)}catch(n){return null}}(r.textContent);if(e&&e.image)return"string"==typeof e.image?e.image:e.image["@list"]&&"string"==typeof e.image["@list"][0]?e.image["@list"][0]:"string"==typeof e.image.url?e.image.url:"string"==typeof e.image[0]?e.image[0]:void 0}}function K(n){var r=n.querySelector('link[rel="shortcut icon"]')||n.querySelector('link[rel="icon"]');return r?r.getAttribute("href"):void 0}function Q(n){var r=n.displayIcon,e=n.displayOverlay,t=n.metadata,o=n.onOverlayClick,u=n.pause,i=n.play,a=n.playing,c=n.wrapperRef,l=(0,_.useAmpContext)().playable;return(0,W.useEffect)((function(){if(l){var n=new IntersectionObserver((function(n){n[n.length-1].isIntersecting?i().catch((function(){})):u()}),{threshold:.5});return n.observe(c.current),function(){n.disconnect()}}u()}),[c,i,u,l]),V.createElement(V.Fragment,null,r&&V.createElement("div",{className:"eq-9e7199f"+(a?" eq-playing-9e7199f":"")},V.createElement(en,null)),e&&V.createElement("button",{"aria-label":t&&t.title||"Unmute video",tabIndex:"0",className:"autoplay-mask-button-9e7199f fill-content-overlay-fc551a7",onClick:o}))}var X,nn,rn,en=(X=!1,nn=null,rn=function(){return[1,2,3,4].map((function(n){return V.createElement("div",{className:"eq-col-9e7199f",key:n})}))},function(){if(!X){for(var n=arguments.length,r=new Array(n),e=0;e<n;e++)r[e]=arguments[e];nn=rn.apply(self,r),X=!0,rn=null}return nn}),tn=(0,J.forwardRef)((function(n,r){var e,t="className",o=n.autoplay,u=void 0!==o&&o,i=n.component,a=void 0===i?"video":i,c=n.controls,l=void 0!==c&&c,s=n.loading,d=n.loop,p=void 0!==d&&d,m=n.mediasession,b=void 0===m||m,y=n.noaudio,g=void 0!==y&&y,w=n.onPlayingState,O=n.onReadyState,S=n.poster,k=n.sources,C=n.src,N=n.style,E=n[t],P=v(n,["autoplay","component","controls","loading","loop","mediasession","noaudio","onPlayingState","onReadyState","poster","sources","src","style",t].map(B));e=(0,Z.useAmpContext)().notify,(0,H.useLayoutEffect)((function(){e&&e()}));var A=(0,_.useAmpContext)().playable,M=(0,_.useLoading)(s),R="unload"!==M,T=F((0,W.useState)(u),2),x=T[0],U=T[1],L=F((0,W.useState)(!1),2),z=L[0],J=L[1],X=F((0,W.useState)(null),2),nn=X[0],rn=X[1],en=F((0,W.useState)(!u),2),tn=en[0],on=en[1],un=(0,W.useRef)(null),an=(0,W.useRef)(null),cn=(0,W.useMemo)((function(){return new j}),[]),ln=(0,W.useRef)(D),fn=(0,Y.useValueRef)(O),vn=(0,W.useCallback)((function(n,r){if(n!==ln.current){ln.current=n;var e=fn.current;e&&e(n,r)}}),[fn]),sn=(0,Y.useValueRef)(w),dn=(0,W.useCallback)((function(n){J(n);var r=sn.current;r&&r(n)}),[sn]);(0,W.useLayoutEffect)((function(){R||dn(!1)}),[R,dn]);var pn=(0,W.useCallback)((function(){return cn.promise.then((function(){return n=an.current,(r=h((function(){return n.play(!1)}))).catch((function(n){!function(n){for(var r=arguments.length,e=new Array(r>1?r-1:0),t=1;t<r;t++)e[t-1]=arguments[t];q(I.apply(null,e))}("TRYPLAY",n)})),r;var n,r}))}),[cn]),mn=(0,W.useCallback)((function(){cn.promise.then((function(){var n;return null===(n=an.current)||void 0===n?void 0:n.pause()}))}),[cn]),bn=(0,W.useCallback)((function(){return cn.promise.then((function(){return an.current.requestFullscreen()}))}),[cn]),yn=(0,W.useCallback)((function(){U(!1),on(!0)}),[]);return(0,W.useLayoutEffect)((function(){var n,r=null===(n=an.current)||void 0===n?void 0:n.readyState;null!=r&&vn(r>0?"complete":D)}),[vn]),(0,W.useLayoutEffect)((function(){return b&&z&&nn&&function(n,r,e,t){var o=n.navigator;"mediaSession"in o&&n.MediaMetadata&&(o.mediaSession.metadata=new n.MediaMetadata($),o.mediaSession.metadata=new n.MediaMetadata(r),o.mediaSession.setActionHandler("play",e),o.mediaSession.setActionHandler("pause",t))}(window,nn,pn,mn),function(){}}),[b,z,nn,pn,mn]),(0,W.useEffect)((function(){A||mn()}),[A,mn]),(0,W.useImperativeHandle)(r,(function(){return{get readyState(){return ln.current},play:pn,pause:mn,requestFullscreen:bn,get currentTime(){return an.current?an.current.currentTime:0},get duration(){return an.current?an.current.duration:NaN},get autoplay(){return u},get controls(){return l},get loop(){return p},userInteracted:yn,mute:function(){return U(!0)},unmute:function(){tn&&U(!1)}}}),[pn,mn,bn,yn,tn,u,l,p]),V.createElement(Y.ContainWrapper,{contentRef:un,className:E,style:N,size:!0,layout:!0,paint:!0},R&&V.createElement(a,f(f({},P),{},{ref:an,loading:M,muted:x,loop:p,controls:l&&(!u||tn),onCanPlay:function(){cn.resolve(),vn("complete")},onLoadedMetadata:function(){b&&cn.promise.then((function(){var n,r,e,t;rn((n=an.current,f({"title":(r=P).title||r["aria-label"]||document.title,"artist":r.artist||"","album":r.album||"","artwork":[{"src":r.artwork||r.poster||G(document)||(e=document,t=e.querySelector('meta[property="og:image"]'),t?t.getAttribute("content"):void 0)||K(document)||""}]},n&&n.getMetadata?n.getMetadata():Object.create(null))))})),vn("complete")},onPlaying:function(){return dn(!0)},onPause:function(){return dn(!1)},onEnded:function(){return dn(!1)},onError:function(n){vn("error",n),cn.reject(n)},className:"fill-stretch-fc551a7",src:C,poster:S}),k),u&&!tn&&V.createElement(Q,{metadata:nn,playing:z,displayIcon:!g&&x,wrapperRef:un,play:pn,pause:mn,displayOverlay:l,onOverlayClick:yn}))}));tn.displayName="VideoWrapper";var on=["loading","unloadOnPause","sandbox","muted","controls","origin","onCanPlay","onMessage","playerStateRef","makeMethodMessage","makeFullscreenMessage","onIframeLoad"],un=["allow-scripts","allow-same-origin","allow-popups","allow-popups-to-escape-sandbox","allow-top-navigation-by-user-activation"].join(" ");function an(n,r,e){n&&n.contentWindow&&r.then((function(){n.contentWindow.postMessage(e(),"*")}))}var cn=(0,z.forwardRef)((function(n,r){var e=n.loading,t=n.unloadOnPause,o=void 0!==t&&t,u=n.sandbox,i=void 0===u?un:u,a=n.muted,c=void 0!==a&&a,l=n.controls,s=void 0!==l&&l,d=n.origin,p=n.onCanPlay,m=n.onMessage,b=n.playerStateRef,y=n.makeMethodMessage,g=n.makeFullscreenMessage,w=n.onIframeLoad,h=v(n,on),O=(0,L.useRef)(null),S=(0,L.useMemo)((function(){return new j}),[]),q=(0,L.useRef)(y),I=(0,L.useCallback)((function(n){an(null==O?void 0:O.current,S.promise,(function(){return q.current(n)}))}),[S.promise]),k=(0,L.useRef)(g),C=(0,L.useCallback)((function(){return an(null==O?void 0:O.current,S.promise,k.current)}),[S.promise]);(0,L.useImperativeHandle)(r,(function(){return{get currentTime(){var n,r;return null!==(n=null==b||null===(r=b.current)||void 0===r?void 0:r.currentTime)&&void 0!==n?n:NaN},get duration(){var n,r;return null!==(n=null==b||null===(r=b.current)||void 0===r?void 0:r.duration)&&void 0!==n?n:NaN},requestFullscreen:function(){if(!k.current)return S.promise.then((function(){O.current.requestFullscreen()}));C()},play:function(){return I("play")},pause:function(){if(o){var n=O.current;n&&(n.src=n.src)}else I("pause")}}}),[b,I,C,S.promise,o]);var N=function(n){var r=(0,L.useRef)(null);return r.current=n,r}(m);return(0,L.useLayoutEffect)((function(){if(O.current){var n=O.current.ownerDocument.defaultView;return n.addEventListener("message",r),function(){return n.removeEventListener("message",r)}}function r(n){N.current&&(d&&!d.test(n.origin)||n.source!=O.current.contentWindow||N.current({currentTarget:O.current,target:O.current,data:n.data}))}}),[d,N]),(0,L.useLayoutEffect)((function(){I(c?"mute":"unmute")}),[c,I]),(0,L.useLayoutEffect)((function(){I(s?"showControls":"hideControls")}),[s,I]),U.createElement("iframe",f(f({},h),{},{ref:O,allowfullscreen:!0,frameborder:"0",sandbox:i,loading:e,onCanPlay:function(){p&&S.promise.then(p),S.resolve()},onLoad:function(n){null==w||w(n)}}))}));cn.displayName="VideoIframeInternal";var ln=(0,z.forwardRef)((function(n,r){return U.createElement(tn,f(f({ref:r},n),{},{component:cn}))}));ln.displayName="VideoIframe";var fn=a(require("@bentoproject/core")),vn=a(require("@bentoproject/core")),sn=a(require("react")),dn=["autoplay","endscreenEnable","info","mute","sharingEnable","start","uiHighlight","uiLogo","videoId"];function pn(n){switch(n){case"mute":return T("muted",[!0]);case"unmute":return T("muted",[!1]);case"showControls":return T("controls",[!0]);case"hideControls":return T("controls",[!1]);default:return T(n)}}function mn(n){var r=n.currentTarget,e=function(n){var r,e=g();if(!n)return e;for(;r=E.exec(n);){var t=P(r[1],r[1]),o=r[2]?P(r[2].replace(/\+/g," "),r[2]):"";e[t]=o}return e}(n.data),t=null==e?void 0:e.event;"pause"===t?M(r,"pause"):"play"===t?M(r,"playing"):"end"===t?(M(r,"pause"),M(r,"end")):"apiready"===t&&M(r,"canplay")}function bn(n,r){var e=n.autoplay,t=n.endscreenEnable,o=n.info,u=n.mute,i=n.sharingEnable,a=n.start,c=n.uiHighlight,l=n.uiLogo,s=n.videoId,d=v(n,dn),p=(0,vn.useMemo)((function(){return function(n,r){var e=arguments.length>2&&void 0!==arguments[2]&&arguments[2],t=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],o=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],u=arguments.length>5&&void 0!==arguments[5]&&arguments[5],i=!(arguments.length>6&&void 0!==arguments[6])||arguments[6],a=arguments.length>7?arguments[7]:void 0,c=arguments.length>8?arguments[8]:void 0,l=!(arguments.length>9&&void 0!==arguments[9])||arguments[9],v=arguments.length>10?arguments[10]:void 0;return R("https://www.dailymotion.com/embed/video/".concat(encodeURIComponent(r),"?api=1&html=1&app=amp"),f({"endscreen-enable":t?void 0:t,"info":o?void 0:o,"mute":u||e&&N(n)?1:void 0,"sharing-enable":i?void 0:i,"start":a,"ui-highlight":c,"ui-logo":l?void 0:l},v))}(window,s,e,t,o,u,i,a,c,l)}),[s,e,t,o,u,i,a,c,l]);return fn.createElement(ln,f(f({autoplay:e,controls:!0,ref:r},d),{},{src:p,makeMethodMessage:pn,onMessage:mn}))}var yn=(0,sn.forwardRef)(bn);yn.displayName="BentoDailymotion"; | ||
var n=Object.create,e=Object.defineProperty,r=Object.getOwnPropertyDescriptor,t=Object.getOwnPropertyNames,o=Object.getPrototypeOf,u=Object.prototype.hasOwnProperty,i=function(n){return e(n,"__esModule",{value:!0})},a=function(a){return function(n,o,i){if(o&&"object"==typeof o||"function"==typeof o)for(var a,c=t(o),l=0,f=c.length;l<f;l++)a=c[l],u.call(n,a)||"default"===a||e(n,a,{get:function(n){return o[n]}.bind(null,a),enumerable:!(i=r(o,a))||i.enumerable});return n}(i(e(null!=a?n(o(a)):{},"default",a&&a.__esModule&&"default"in a?{get:function(){return a.default},enumerable:!0}:{value:a,enumerable:!0})),a)};function c(n,e,r){return e in n?Object.defineProperty(n,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):n[e]=r,n}function l(n,e){var r=Object.keys(n);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(n);e&&(t=t.filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.push.apply(r,t)}return r}function f(n){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?l(Object(r),!0).forEach((function(e){c(n,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(r)):l(Object(r)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(r,e))}))}return n}function v(n,e){if(null==n)return{};var r,t,o={},u=Object.keys(n);for(t=0;t<u.length;t++)r=u[t],e.indexOf(r)>=0||(o[r]=n[r]);return o}!function(n,r){for(var t in i(n),r)e(n,t,{get:r[t],enumerable:!0})}(exports,{BentoDailymotion:function(){return yn},BentoDailymotionWithRef:function(){return bn}});var s=Array.isArray;function d(n){return(d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n})(n)}function p(n,e){(null==e||e>n.length)&&(e=n.length);for(var r=0,t=new Array(e);r<e;r++)t[r]=n[r];return t}function m(n,e){if(n){if("string"==typeof n)return p(n,e);var r=Object.prototype.toString.call(n).slice(8,-1);return"Object"===r&&n.constructor&&(r=n.constructor.name),"Map"===r||"Set"===r?Array.from(n):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?p(n,e):void 0}}function b(n,e){var r="undefined"!=typeof Symbol&&n[Symbol.iterator]||n["@@iterator"];if(r)return(r=r.call(n)).next.bind(r);if(Array.isArray(n)||(r=m(n))||e&&n&&"number"==typeof n.length){r&&(n=r);var t=0;return function(){return t>=n.length?{done:!0}:{done:!1,value:n[t++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var y=Object.prototype;function g(n){var e=Object.create(null);return n&&Object.assign(e,n),e}y.hasOwnProperty,y.toString;var j,w=function(){var n=this;this.promise=new Promise((function(e,r){n.resolve=e,n.reject=r}))};function h(n){return new Promise((function(e){e(n())}))}function O(n){var e=Object.getOwnPropertyDescriptor(n,"message");if(null!=e&&e.writable)return n;var r=n.message,t=n.stack,o=new Error(r);for(var u in n)o[u]=n[u];return o.stack=t,o}function S(n){for(var e,r=null,t="",o=b(arguments,!0);!(e=o()).done;){var u=e.value;u instanceof Error&&!r?r=O(u):(t&&(t+=" "),t+=u)}return r?t&&(r.message=t+": "+r.message):r=new Error(t),r}function q(n){var e,r;null===(e=(r=self).__AMP_REPORT_ERROR)||void 0===e||e.call(r,n)}function I(n){var e=S.apply(null,arguments);return e.expected=!0,e}var k=["Webkit","webkit","Moz","moz","ms","O","o"];function C(n,e,r,t,o){var u=function(n,e,r){if(e.startsWith("--"))return e;j||(j=g());var t=j[e];if(!t||r){if(t=e,void 0===n[e]){var o=function(n){return n.charAt(0).toUpperCase()+n.slice(1)}(e),u=function(n,e){for(var r=0;r<k.length;r++){var t=k[r]+e;if(void 0!==n[t])return t}return""}(n,o);void 0!==n[u]&&(t=u)}r||(j[e]=t)}return t}(n.style,e,o);if(u){var i,a=t?r+t:r;n.style.setProperty((i=u.replace(/[A-Z]/g,(function(n){return"-"+n.toLowerCase()})),k.some((function(n){return i.startsWith(n+"-")}))?"-".concat(i):i),a)}}function N(n){return null==n.__AMP_AUTOPLAY&&(n.__AMP_AUTOPLAY=function(n){var e,r=n.document.createElement("video");return r.setAttribute("muted",""),r.setAttribute("playsinline",""),r.setAttribute("webkit-playsinline",""),r.setAttribute("height","0"),r.setAttribute("width","0"),r.muted=!0,r.playsInline=!0,r.playsinline=!0,r.webkitPlaysinline=!0,function(n,e){for(var r in e)C(n,r,e[r])}(r,{position:"fixed",top:"0",width:"0",height:"0",opacity:"0"}),e=r,h((function(){return e.play()})).catch((function(){})),Promise.resolve(!r.paused)}(n)),n.__AMP_AUTOPLAY}var E=/(?:^[#?]?|&)([^=&]+)(?:=([^&]*))?/g;function P(n){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";try{return decodeURIComponent(n)}catch(n){return e}}var A={bubbles:!0,cancelable:!0};function M(n,e,r,t){var o=r||{};n.ownerDocument;var u=n.ownerDocument.createEvent("Event");u.data=o;var i=t||A,a=i.bubbles,c=i.cancelable;u.initEvent(e,a,c),n.dispatchEvent(u)}function R(n,e){return function(n,e,r){if(!e)return n;var t=n.split("#",2),o=t[0].split("?",2);return o[0]+(o[1]?"?".concat(o[1],"&").concat(e):"?".concat(e))+(t[1]?"#".concat(t[1]):"")}(n,function(n){var e,r,t,o=[];for(var u in n){var i=n[u];if(null!=i){i=s(t=i)?t:[t];for(var a=0;a<i.length;a++)o.push((e=u,r=i[a],"".concat(encodeURIComponent(e),"=").concat(encodeURIComponent(r))))}}return o.join("&")}(e))}function T(n,e){return JSON.stringify({"command":n,"parameters":e})}self.__AMP_LOG=self.__AMP_LOG||{user:null,dev:null,userForEmbed:null},self.__AMP_LOG,new Set(["c","v","a","ad"]);var x,U=a(require("@bentoproject/core/react")),L=a(require("@bentoproject/core/react")),z=a(require("@bentoproject/core/react"));function F(n,e){return function(n){if(Array.isArray(n))return n}(n)||function(n,e){var r=null==n?null:"undefined"!=typeof Symbol&&n[Symbol.iterator]||n["@@iterator"];if(null!=r){var t,o,u=[],i=!0,a=!1;try{for(r=r.call(n);!(i=(t=r.next()).done)&&(u.push(t.value),!e||u.length!==e);i=!0);}catch(n){a=!0,o=n}finally{try{i||null==r.return||r.return()}finally{if(a)throw o}}return u}}(n,e)||m(n,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function B(n){var e=function(n,e){if("object"!==d(n)||null===n)return n;var r=n[Symbol.toPrimitive];if(void 0!==r){var t=r.call(n,"string");if("object"!==d(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(n)}(n);return"symbol"===d(e)?e:String(e)}var D=(c(x={},"auto",0),c(x,"lazy",1),c(x,"eager",2),c(x,"unload",3),"loading"),V=a(require("@bentoproject/core/react")),W=a(require("@bentoproject/core/react")),J=a(require("@bentoproject/core/react")),Y=a(require("@bentoproject/core/react")),_=a(require("@bentoproject/core/react")),H=a(require("@bentoproject/core/react")),Z=a(require("@bentoproject/core/react")),$={"title":"","artist":"","album":"","artwork":[{"src":""}]};function G(n){var e=n.querySelector('script[type="application/ld+json"]');if(e){var r=function(n,e){try{return function(n){return JSON.parse(n)}(n)}catch(n){return null}}(e.textContent);if(r&&r.image)return"string"==typeof r.image?r.image:r.image["@list"]&&"string"==typeof r.image["@list"][0]?r.image["@list"][0]:"string"==typeof r.image.url?r.image.url:"string"==typeof r.image[0]?r.image[0]:void 0}}function K(n){var e=n.querySelector('link[rel="shortcut icon"]')||n.querySelector('link[rel="icon"]');return e?e.getAttribute("href"):void 0}function Q(n){var e=n.displayIcon,r=n.displayOverlay,t=n.metadata,o=n.onOverlayClick,u=n.pause,i=n.play,a=n.playing,c=n.wrapperRef,l=(0,_.useAmpContext)().playable;return(0,W.useEffect)((function(){if(l){var n=new IntersectionObserver((function(n){n[n.length-1].isIntersecting?i().catch((function(){})):u()}),{threshold:.5});return n.observe(c.current),function(){n.disconnect()}}u()}),[c,i,u,l]),V.createElement(V.Fragment,null,e&&V.createElement("div",{className:"eq-9e7199f"+(a?" eq-playing-9e7199f":"")},V.createElement(rn,null)),r&&V.createElement("button",{"aria-label":t&&t.title||"Unmute video",tabIndex:"0",className:"autoplay-mask-button-9e7199f fill-content-overlay-fc551a7",onClick:o}))}var X,nn,en,rn=(X=!1,nn=null,en=function(){return[1,2,3,4].map((function(n){return V.createElement("div",{className:"eq-col-9e7199f",key:n})}))},function(){if(!X){for(var n=arguments.length,e=new Array(n),r=0;r<n;r++)e[r]=arguments[r];nn=en.apply(self,e),X=!0,en=null}return nn}),tn=(0,J.forwardRef)((function(n,e){var r,t="className",o=n.autoplay,u=void 0!==o&&o,i=n.component,a=void 0===i?"video":i,c=n.controls,l=void 0!==c&&c,s=n.loading,d=n.loop,p=void 0!==d&&d,m=n.mediasession,b=void 0===m||m,y=n.noaudio,g=void 0!==y&&y,j=n.onPlayingState,O=n.onReadyState,S=n.poster,k=n.sources,C=n.src,N=n.style,E=n[t],P=v(n,["autoplay","component","controls","loading","loop","mediasession","noaudio","onPlayingState","onReadyState","poster","sources","src","style",t].map(B));r=(0,Z.useAmpContext)().notify,(0,H.useLayoutEffect)((function(){r&&r()}));var A=(0,_.useAmpContext)().playable,M=(0,_.useLoading)(s),R="unload"!==M,T=F((0,W.useState)(u),2),x=T[0],U=T[1],L=F((0,W.useState)(!1),2),z=L[0],J=L[1],X=F((0,W.useState)(null),2),nn=X[0],en=X[1],rn=F((0,W.useState)(!u),2),tn=rn[0],on=rn[1],un=(0,W.useRef)(null),an=(0,W.useRef)(null),cn=(0,W.useMemo)((function(){return new w}),[]),ln=(0,W.useRef)(D),fn=(0,Y.useValueRef)(O),vn=(0,W.useCallback)((function(n,e){if(n!==ln.current){ln.current=n;var r=fn.current;r&&r(n,e)}}),[fn]),sn=(0,Y.useValueRef)(j),dn=(0,W.useCallback)((function(n){J(n);var e=sn.current;e&&e(n)}),[sn]);(0,W.useLayoutEffect)((function(){R||dn(!1)}),[R,dn]);var pn=(0,W.useCallback)((function(){return cn.promise.then((function(){return n=an.current,(e=h((function(){return n.play(!1)}))).catch((function(n){!function(n){for(var e=arguments.length,r=new Array(e>1?e-1:0),t=1;t<e;t++)r[t-1]=arguments[t];q(I.apply(null,r))}("TRYPLAY",n)})),e;var n,e}))}),[cn]),mn=(0,W.useCallback)((function(){cn.promise.then((function(){var n;return null===(n=an.current)||void 0===n?void 0:n.pause()}))}),[cn]),bn=(0,W.useCallback)((function(){return cn.promise.then((function(){return an.current.requestFullscreen()}))}),[cn]),yn=(0,W.useCallback)((function(){U(!1),on(!0)}),[]);return(0,W.useLayoutEffect)((function(){var n,e=null===(n=an.current)||void 0===n?void 0:n.readyState;null!=e&&vn(e>0?"complete":D)}),[vn]),(0,W.useLayoutEffect)((function(){return b&&z&&nn&&function(n,e,r,t){var o=n.navigator;"mediaSession"in o&&n.MediaMetadata&&(o.mediaSession.metadata=new n.MediaMetadata($),o.mediaSession.metadata=new n.MediaMetadata(e),o.mediaSession.setActionHandler("play",r),o.mediaSession.setActionHandler("pause",t))}(window,nn,pn,mn),function(){}}),[b,z,nn,pn,mn]),(0,W.useEffect)((function(){A||mn()}),[A,mn]),(0,W.useImperativeHandle)(e,(function(){return{get readyState(){return ln.current},play:pn,pause:mn,requestFullscreen:bn,get currentTime(){return an.current?an.current.currentTime:0},get duration(){return an.current?an.current.duration:NaN},get autoplay(){return u},get controls(){return l},get loop(){return p},userInteracted:yn,mute:function(){return U(!0)},unmute:function(){tn&&U(!1)}}}),[pn,mn,bn,yn,tn,u,l,p]),V.createElement(Y.ContainWrapper,{contentRef:un,className:E,style:N,size:!0,layout:!0,paint:!0},R&&V.createElement(a,f(f({},P),{},{ref:an,loading:M,muted:x,loop:p,controls:l&&(!u||tn),onCanPlay:function(){cn.resolve(),vn("complete")},onLoadedMetadata:function(){b&&cn.promise.then((function(){var n,e,r,t;en((n=an.current,f({"title":(e=P).title||e["aria-label"]||document.title,"artist":e.artist||"","album":e.album||"","artwork":[{"src":e.artwork||e.poster||G(document)||(r=document,t=r.querySelector('meta[property="og:image"]'),t?t.getAttribute("content"):void 0)||K(document)||""}]},n&&n.getMetadata?n.getMetadata():Object.create(null))))})),vn("complete")},onPlaying:function(){return dn(!0)},onPause:function(){return dn(!1)},onEnded:function(){return dn(!1)},onError:function(n){vn("error",n),cn.reject(n)},className:"fill-stretch-fc551a7",src:C,poster:S}),k),u&&!tn&&V.createElement(Q,{metadata:nn,playing:z,displayIcon:!g&&x,wrapperRef:un,play:pn,pause:mn,displayOverlay:l,onOverlayClick:yn}))}));tn.displayName="VideoWrapper";var on=["loading","unloadOnPause","sandbox","muted","controls","origin","onCanPlay","onMessage","playerStateRef","makeMethodMessage","makeFullscreenMessage","onIframeLoad"],un=["allow-scripts","allow-same-origin","allow-popups","allow-popups-to-escape-sandbox","allow-top-navigation-by-user-activation"].join(" ");function an(n,e,r){n&&n.contentWindow&&e.then((function(){n.contentWindow.postMessage(r(),"*")}))}var cn=(0,z.forwardRef)((function(n,e){var r=n.loading,t=n.unloadOnPause,o=void 0!==t&&t,u=n.sandbox,i=void 0===u?un:u,a=n.muted,c=void 0!==a&&a,l=n.controls,s=void 0!==l&&l,d=n.origin,p=n.onCanPlay,m=n.onMessage,b=n.playerStateRef,y=n.makeMethodMessage,g=n.makeFullscreenMessage,j=n.onIframeLoad,h=v(n,on),O=(0,L.useRef)(null),S=(0,L.useMemo)((function(){return new w}),[]),q=(0,L.useRef)(y),I=(0,L.useCallback)((function(n){an(null==O?void 0:O.current,S.promise,(function(){return q.current(n)}))}),[S.promise]),k=(0,L.useRef)(g),C=(0,L.useCallback)((function(){return an(null==O?void 0:O.current,S.promise,k.current)}),[S.promise]);(0,L.useImperativeHandle)(e,(function(){return{get currentTime(){var n,e;return null!==(n=null==b||null===(e=b.current)||void 0===e?void 0:e.currentTime)&&void 0!==n?n:NaN},get duration(){var n,e;return null!==(n=null==b||null===(e=b.current)||void 0===e?void 0:e.duration)&&void 0!==n?n:NaN},requestFullscreen:function(){if(!k.current)return S.promise.then((function(){O.current.requestFullscreen()}));C()},play:function(){return I("play")},pause:function(){if(o){var n=O.current;n&&(n.src=n.src)}else I("pause")}}}),[b,I,C,S.promise,o]);var N=function(n){var e=(0,L.useRef)(null);return e.current=n,e}(m);return(0,L.useLayoutEffect)((function(){if(O.current){var n=O.current.ownerDocument.defaultView;return n.addEventListener("message",e),function(){return n.removeEventListener("message",e)}}function e(n){N.current&&(d&&!d.test(n.origin)||n.source!=O.current.contentWindow||N.current({currentTarget:O.current,target:O.current,data:n.data}))}}),[d,N]),(0,L.useLayoutEffect)((function(){I(c?"mute":"unmute")}),[c,I]),(0,L.useLayoutEffect)((function(){I(s?"showControls":"hideControls")}),[s,I]),U.createElement("iframe",f(f({},h),{},{ref:O,allowfullscreen:!0,frameborder:"0",sandbox:i,loading:r,onCanPlay:function(){p&&S.promise.then(p),S.resolve()},onLoad:function(n){null==j||j(n)}}))}));cn.displayName="VideoIframeInternal";var ln=(0,z.forwardRef)((function(n,e){return U.createElement(tn,f(f({ref:e},n),{},{component:cn}))}));ln.displayName="VideoIframe";var fn=a(require("@bentoproject/core/react")),vn=a(require("@bentoproject/core/react")),sn=a(require("@bentoproject/core/react")),dn=["autoplay","endscreenEnable","info","mute","sharingEnable","start","uiHighlight","uiLogo","videoId"];function pn(n){switch(n){case"mute":return T("muted",[!0]);case"unmute":return T("muted",[!1]);case"showControls":return T("controls",[!0]);case"hideControls":return T("controls",[!1]);default:return T(n)}}function mn(n){var e=n.currentTarget,r=function(n){var e,r=g();if(!n)return r;for(;e=E.exec(n);){var t=P(e[1],e[1]),o=e[2]?P(e[2].replace(/\+/g," "),e[2]):"";r[t]=o}return r}(n.data),t=null==r?void 0:r.event;"pause"===t?M(e,"pause"):"play"===t?M(e,"playing"):"end"===t?(M(e,"pause"),M(e,"end")):"apiready"===t&&M(e,"canplay")}function bn(n,e){var r=n.autoplay,t=n.endscreenEnable,o=n.info,u=n.mute,i=n.sharingEnable,a=n.start,c=n.uiHighlight,l=n.uiLogo,s=n.videoId,d=v(n,dn),p=(0,vn.useMemo)((function(){return function(n,e){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],t=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],o=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],u=arguments.length>5&&void 0!==arguments[5]&&arguments[5],i=!(arguments.length>6&&void 0!==arguments[6])||arguments[6],a=arguments.length>7?arguments[7]:void 0,c=arguments.length>8?arguments[8]:void 0,l=!(arguments.length>9&&void 0!==arguments[9])||arguments[9],v=arguments.length>10?arguments[10]:void 0;return R("https://www.dailymotion.com/embed/video/".concat(encodeURIComponent(e),"?api=1&html=1&app=amp"),f({"endscreen-enable":t?void 0:t,"info":o?void 0:o,"mute":u||r&&N(n)?1:void 0,"sharing-enable":i?void 0:i,"start":a,"ui-highlight":c,"ui-logo":l?void 0:l},v))}(window,s,r,t,o,u,i,a,c,l)}),[s,r,t,o,u,i,a,c,l]);return fn.createElement(ln,f(f({autoplay:r,controls:!0,ref:e},d),{},{src:p,makeMethodMessage:pn,onMessage:mn}))}var yn=(0,sn.forwardRef)(bn);yn.displayName="BentoDailymotion"; | ||
/*! https://mths.be/cssescape v1.5.1 by @mathias | MIT license */ | ||
//# sourceMappingURL=component-react.js.map |
@@ -573,5 +573,5 @@ var __create = Object.create; | ||
// src/bento/components/bento-video/1.0/video-iframe.js | ||
var Preact2 = __toModule(require("@bentoproject/core")); | ||
var import_preact2 = __toModule(require("@bentoproject/core")); | ||
var import_compat2 = __toModule(require("react")); | ||
var Preact2 = __toModule(require("@bentoproject/core/react")); | ||
var import_preact2 = __toModule(require("@bentoproject/core/react")); | ||
var import_compat2 = __toModule(require("@bentoproject/core/react")); | ||
@@ -622,11 +622,11 @@ // src/bento/components/bento-video/1.0/autoplay.jss.js | ||
// src/bento/components/bento-video/1.0/component.js | ||
var Preact = __toModule(require("@bentoproject/core")); | ||
var import_preact = __toModule(require("@bentoproject/core")); | ||
var import_compat = __toModule(require("react")); | ||
var import_component3 = __toModule(require("@bentoproject/core")); | ||
var import_context2 = __toModule(require("@bentoproject/core")); | ||
var Preact = __toModule(require("@bentoproject/core/react")); | ||
var import_preact = __toModule(require("@bentoproject/core/react")); | ||
var import_compat = __toModule(require("@bentoproject/core/react")); | ||
var import_component3 = __toModule(require("@bentoproject/core/react")); | ||
var import_context2 = __toModule(require("@bentoproject/core/react")); | ||
// src/preact/utils.js | ||
var import__ = __toModule(require("@bentoproject/core")); | ||
var import_context = __toModule(require("@bentoproject/core")); | ||
var import__ = __toModule(require("@bentoproject/core/react")); | ||
var import_context = __toModule(require("@bentoproject/core/react")); | ||
function useResourcesNotify() { | ||
@@ -1123,5 +1123,5 @@ var _useAmpContext = (0, import_context.useAmpContext)(), notify = _useAmpContext.notify; | ||
// src/bento/components/bento-dailymotion/1.0/component.js | ||
var Preact3 = __toModule(require("@bentoproject/core")); | ||
var import_preact3 = __toModule(require("@bentoproject/core")); | ||
var import_compat3 = __toModule(require("react")); | ||
var Preact3 = __toModule(require("@bentoproject/core/react")); | ||
var import_preact3 = __toModule(require("@bentoproject/core/react")); | ||
var import_compat3 = __toModule(require("@bentoproject/core/react")); | ||
var _excluded2 = ["autoplay", "endscreenEnable", "info", "mute", "sharingEnable", "start", "uiHighlight", "uiLogo", "videoId"]; | ||
@@ -1128,0 +1128,0 @@ function _extends4() { |
@@ -462,5 +462,5 @@ // src/core/mode/minified.js | ||
createElement as createElement2 | ||
} from "@bentoproject/core"; | ||
import { useCallback as useCallback3, useImperativeHandle as useImperativeHandle2, useLayoutEffect as useLayoutEffect3, useMemo as useMemo2, useRef as useRef2 } from "@bentoproject/core"; | ||
import { forwardRef as forwardRef2 } from "react"; | ||
} from "@bentoproject/core/react"; | ||
import { useCallback as useCallback3, useImperativeHandle as useImperativeHandle2, useLayoutEffect as useLayoutEffect3, useMemo as useMemo2, useRef as useRef2 } from "@bentoproject/core/react"; | ||
import { forwardRef as forwardRef2 } from "@bentoproject/core/react"; | ||
@@ -518,11 +518,11 @@ // src/bento/components/bento-video/1.0/autoplay.jss.js | ||
createElement | ||
} from "@bentoproject/core"; | ||
import { useCallback as useCallback2, useEffect, useImperativeHandle, useLayoutEffect as useLayoutEffect2, useMemo, useRef, useState } from "@bentoproject/core"; | ||
import { forwardRef } from "react"; | ||
import { ContainWrapper, useValueRef } from "@bentoproject/core"; | ||
import { useAmpContext as useAmpContext2, useLoading } from "@bentoproject/core"; | ||
} from "@bentoproject/core/react"; | ||
import { useCallback as useCallback2, useEffect, useImperativeHandle, useLayoutEffect as useLayoutEffect2, useMemo, useRef, useState } from "@bentoproject/core/react"; | ||
import { forwardRef } from "@bentoproject/core/react"; | ||
import { ContainWrapper, useValueRef } from "@bentoproject/core/react"; | ||
import { useAmpContext as useAmpContext2, useLoading } from "@bentoproject/core/react"; | ||
// src/preact/utils.js | ||
import { useCallback, useLayoutEffect } from "@bentoproject/core"; | ||
import { useAmpContext } from "@bentoproject/core"; | ||
import { useCallback, useLayoutEffect } from "@bentoproject/core/react"; | ||
import { useAmpContext } from "@bentoproject/core/react"; | ||
function useResourcesNotify() { | ||
@@ -1040,5 +1040,5 @@ const { | ||
createElement as createElement3 | ||
} from "@bentoproject/core"; | ||
import { useMemo as useMemo3 } from "@bentoproject/core"; | ||
import { forwardRef as forwardRef3 } from "react"; | ||
} from "@bentoproject/core/react"; | ||
import { useMemo as useMemo3 } from "@bentoproject/core/react"; | ||
import { forwardRef as forwardRef3 } from "@bentoproject/core/react"; | ||
var _excluded2 = ["autoplay", "endscreenEnable", "info", "mute", "sharingEnable", "start", "uiHighlight", "uiLogo", "videoId"]; | ||
@@ -1045,0 +1045,0 @@ function _extends4() { |
; | ||
function e(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function n(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function t(t){for(var o=1;o<arguments.length;o++){var r=null!=arguments[o]?arguments[o]:{};o%2?n(Object(r),!0).forEach((function(n){e(t,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function o(e,n){if(null==e)return{};var t,o,r={},a=Object.keys(e);for(o=0;o<a.length;o++)t=a[o],n.indexOf(t)>=0||(r[t]=e[t]);return r}var{isArray:r}=Array,{hasOwnProperty:a,toString:i}=Object.prototype;function l(e){const n=Object.create(null);return e&&Object.assign(n,e),n}var u,c=class{constructor(){this.promise=new Promise(((e,n)=>{this.resolve=e,this.reject=n}))}};function s(e){return new Promise((n=>{n(e())}))}function f(e){const n=Object.getOwnPropertyDescriptor(e,"message");if(null!=n&&n.writable)return e;const{message:t,stack:o}=e,r=new Error(t);for(const n in e)r[n]=e[n];return r.stack=o,r}function d(e){let n=null,t="";for(const e of arguments)e instanceof Error&&!n?n=f(e):(t&&(t+=" "),t+=e);return n?t&&(n.message=t+": "+n.message):n=new Error(t),n}function p(e){const n=d.apply(null,arguments);return n.expected=!0,n}function m(e,...n){var t,o,r;t=p.apply(null,n),null===(o=(r=self).__AMP_REPORT_ERROR)||void 0===o||o.call(r,t)}var y=["Webkit","webkit","Moz","moz","ms","O","o"];function v(e,n,t,o,r){const a=function(e,n,t){if(n.startsWith("--"))return n;u||(u=l());let o=u[n];if(!o||t){if(o=n,void 0===e[n]){const t=function(e){return e.charAt(0).toUpperCase()+e.slice(1)}(n),r=function(e,n){for(let t=0;t<y.length;t++){const o=y[t]+n;if(void 0!==e[o])return o}return""}(e,t);void 0!==e[r]&&(o=r)}t||(u[n]=o)}return o}(e.style,n,r);if(!a)return;const i=o?t+o:t;e.style.setProperty(function(e){const n=e.replace(/[A-Z]/g,(e=>"-"+e.toLowerCase()));return y.some((e=>n.startsWith(e+"-")))?`-${n}`:n}(a),i)}function b(e){return null==e.__AMP_AUTOPLAY&&(e.__AMP_AUTOPLAY=function(e){const n=e.document.createElement("video");var t;return n.setAttribute("muted",""),n.setAttribute("playsinline",""),n.setAttribute("webkit-playsinline",""),n.setAttribute("height","0"),n.setAttribute("width","0"),n.muted=!0,n.playsInline=!0,n.playsinline=!0,n.webkitPlaysinline=!0,function(e,n){for(const t in n)v(e,t,n[t])}(n,{position:"fixed",top:"0",width:"0",height:"0",opacity:"0"}),t=n,s((()=>t.play())).catch((()=>{})),Promise.resolve(!n.paused)}(e)),e.__AMP_AUTOPLAY}var g=/(?:^[#?]?|&)([^=&]+)(?:=([^&]*))?/g;function w(e,n=""){try{return decodeURIComponent(e)}catch(e){return n}}var h={bubbles:!0,cancelable:!0};function j(e,n,t,o){const r=t||{};e.ownerDocument;const a=e.ownerDocument.createEvent("Event");a.data=r;const{bubbles:i,cancelable:l}=o||h;a.initEvent(n,i,l),e.dispatchEvent(a)}function O(e,n){return JSON.stringify({"command":e,"parameters":n})}self.__AMP_LOG=self.__AMP_LOG||{user:null,dev:null,userForEmbed:null},self.__AMP_LOG,new Set(["c","v","a","ad"]);import{createElement as k}from"@bentoproject/core";import{useCallback as S,useImperativeHandle as C,useLayoutEffect as I,useMemo as E,useRef as M}from"@bentoproject/core";import{forwardRef as P}from"react";function N(e){return(N="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function R(e){var n=function(e,n){if("object"!==N(e)||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var o=t.call(e,"string");if("object"!==N(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===N(n)?n:String(n)}import{Fragment as x,createElement as L}from"@bentoproject/core";import{useCallback as $,useEffect as q,useImperativeHandle as F,useLayoutEffect as T,useMemo as U,useRef as A,useState as V}from"@bentoproject/core";import{forwardRef as z}from"react";import{ContainWrapper as H,useValueRef as J}from"@bentoproject/core";import{useAmpContext as W,useLoading as B}from"@bentoproject/core";import{useCallback as D,useLayoutEffect as Z}from"@bentoproject/core";import{useAmpContext as G}from"@bentoproject/core";var K={"title":"","artist":"","album":"","artwork":[{"src":""}]};function Q(e){const n=e.querySelector('script[type="application/ld+json"]');if(!n)return;const t=function(e,n){try{return function(e){return JSON.parse(e)}(e)}catch(e){return null}}(n.textContent);return t&&t.image?"string"==typeof t.image?t.image:t.image["@list"]&&"string"==typeof t.image["@list"][0]?t.image["@list"][0]:"string"==typeof t.image.url?t.image.url:"string"==typeof t.image[0]?t.image[0]:void 0:void 0}function X(e){const n=e.querySelector('meta[property="og:image"]');return n?n.getAttribute("content"):void 0}function Y(e){const n=e.querySelector('link[rel="shortcut icon"]')||e.querySelector('link[rel="icon"]');return n?n.getAttribute("href"):void 0}function _({displayIcon:e,displayOverlay:n,metadata:t,onOverlayClick:o,pause:r,play:a,playing:i,wrapperRef:l}){const{playable:u}=W();return q((()=>{if(!u)return void r();const e=new IntersectionObserver((e=>{e[e.length-1].isIntersecting?a().catch((()=>{})):r()}),{threshold:.5});return e.observe(l.current),()=>{e.disconnect()}}),[l,a,r,u]),L(x,null,e&&L("div",{className:"eq-9e7199f"+(i?" eq-playing-9e7199f":"")},L(ee,null)),n&&L("button",{"aria-label":t&&t.title||"Unmute video",tabIndex:"0",className:"autoplay-mask-button-9e7199f fill-content-overlay-fc551a7",onClick:o}))}var ee=function(e){let n=!1,t=null,o=()=>[1,2,3,4].map((e=>L("div",{className:"eq-col-9e7199f",key:e})));return(...e)=>(n||(t=o.apply(self,e),n=!0,o=null),t)}(),ne=z((function(e,n){let r="className",{autoplay:a=!1,component:i="video",controls:l=!1,loading:u,loop:f=!1,mediasession:d=!0,noaudio:p=!1,onPlayingState:y,onReadyState:v,poster:b,sources:g,src:w,style:h,[r]:j}=e,O=o(e,["autoplay","component","controls","loading","loop","mediasession","noaudio","onPlayingState","onReadyState","poster","sources","src","style",r].map(R));!function(){const{notify:e}=G();Z((()=>{e&&e()}))}();const{playable:k}=W(),S=B(u),C="unload"!==S,[I,E]=V(a),[M,P]=V(!1),[N,x]=V(null),[z,D]=V(!a),ee=A(null),ne=A(null),te=U((()=>new c),[]),oe=A("loading"),re=J(v),ae=$(((e,n)=>{if(e!==oe.current){oe.current=e;const t=re.current;t&&t(e,n)}}),[re]),ie=J(y),le=$((e=>{P(e);const n=ie.current;n&&n(e)}),[ie]);T((()=>{C||le(!1)}),[C,le]);const ue=$((()=>te.promise.then((()=>function(e,n){const t=s((()=>e.play(!1)));return t.catch((e=>{m(0,e)})),t}(ne.current)))),[te]),ce=$((()=>{te.promise.then((()=>{var e;return null===(e=ne.current)||void 0===e?void 0:e.pause()}))}),[te]),se=$((()=>te.promise.then((()=>ne.current.requestFullscreen()))),[te]),fe=$((()=>{E(!1),D(!0)}),[]);return T((()=>{var e;const n=null===(e=ne.current)||void 0===e?void 0:e.readyState;null!=n&&ae(n>0?"complete":"loading")}),[ae]),T((()=>(d&&M&&N&&function(e,n,t,o){const{navigator:r}=e;"mediaSession"in r&&e.MediaMetadata&&(r.mediaSession.metadata=new e.MediaMetadata(K),r.mediaSession.metadata=new e.MediaMetadata(n),r.mediaSession.setActionHandler("play",t),r.mediaSession.setActionHandler("pause",o))}(window,N,ue,ce),()=>{})),[d,M,N,ue,ce]),q((()=>{k||ce()}),[k,ce]),F(n,(()=>({get readyState(){return oe.current},play:ue,pause:ce,requestFullscreen:se,get currentTime(){return ne.current?ne.current.currentTime:0},get duration(){return ne.current?ne.current.duration:NaN},get autoplay(){return a},get controls(){return l},get loop(){return f},userInteracted:fe,mute:()=>E(!0),unmute:()=>{z&&E(!1)}})),[ue,ce,se,fe,z,a,l,f]),L(H,{contentRef:ee,className:j,style:h,size:!0,layout:!0,paint:!0},C&&L(i,t(t({},O),{},{ref:ne,loading:S,muted:I,loop:f,controls:l&&(!a||z),onCanPlay:()=>{te.resolve(),ae("complete")},onLoadedMetadata:()=>{d&&te.promise.then((()=>{var e,n;x((e=ne.current,t({"title":(n=O).title||n["aria-label"]||document.title,"artist":n.artist||"","album":n.album||"","artwork":[{"src":n.artwork||n.poster||Q(document)||X(document)||Y(document)||""}]},e&&e.getMetadata?e.getMetadata():Object.create(null))))})),ae("complete")},onPlaying:()=>le(!0),onPause:()=>le(!1),onEnded:()=>le(!1),onError:e=>{ae("error",e),te.reject(e)},className:"fill-stretch-fc551a7",src:w,poster:b}),g),a&&!z&&L(_,{metadata:N,playing:M,displayIcon:!p&&I,wrapperRef:ee,play:ue,pause:ce,displayOverlay:l,onOverlayClick:fe}))}));ne.displayName="VideoWrapper";var te=["loading","unloadOnPause","sandbox","muted","controls","origin","onCanPlay","onMessage","playerStateRef","makeMethodMessage","makeFullscreenMessage","onIframeLoad"],oe=["allow-scripts","allow-same-origin","allow-popups","allow-popups-to-escape-sandbox","allow-top-navigation-by-user-activation"].join(" ");function re(e,n,t){e&&e.contentWindow&&n.then((()=>{e.contentWindow.postMessage(t(),"*")}))}var ae=P((function(e,n){let{loading:r,unloadOnPause:a=!1,sandbox:i=oe,muted:l=!1,controls:u=!1,origin:s,onCanPlay:f,onMessage:d,playerStateRef:p,makeMethodMessage:m,makeFullscreenMessage:y,onIframeLoad:v}=e,b=o(e,te);const g=M(null),w=E((()=>new c),[]),h=M(m),j=S((e=>{re(null==g?void 0:g.current,w.promise,(()=>h.current(e)))}),[w.promise]),O=M(y),P=S((()=>re(null==g?void 0:g.current,w.promise,O.current)),[w.promise]);C(n,(()=>({get currentTime(){var e,n;return null!==(e=null==p||null===(n=p.current)||void 0===n?void 0:n.currentTime)&&void 0!==e?e:NaN},get duration(){var e,n;return null!==(e=null==p||null===(n=p.current)||void 0===n?void 0:n.duration)&&void 0!==e?e:NaN},requestFullscreen:()=>{if(!O.current)return w.promise.then((()=>{g.current.requestFullscreen()}));P()},play:()=>j("play"),pause:()=>{if(a){const e=g.current;e&&(e.src=e.src)}else j("pause")}})),[p,j,P,w.promise,a]);const N=function(e){const n=M(null);return n.current=e,n}(d);return I((()=>{if(!g.current)return;function e(e){N.current&&(s&&!s.test(e.origin)||e.source!=g.current.contentWindow||N.current({currentTarget:g.current,target:g.current,data:e.data}))}const{defaultView:n}=g.current.ownerDocument;return n.addEventListener("message",e),()=>n.removeEventListener("message",e)}),[s,N]),I((()=>{j(l?"mute":"unmute")}),[l,j]),I((()=>{j(u?"showControls":"hideControls")}),[u,j]),k("iframe",t(t({},b),{},{ref:g,allowfullscreen:!0,frameborder:"0",sandbox:i,loading:r,onCanPlay:()=>{f&&w.promise.then(f),w.resolve()},onLoad:e=>{null==v||v(e)}}))}));ae.displayName="VideoIframeInternal";var ie=P((function(e,n){return k(ne,t(t({ref:n},e),{},{component:ae}))}));ie.displayName="VideoIframe";import{createElement as le}from"@bentoproject/core";import{useMemo as ue}from"@bentoproject/core";import{forwardRef as ce}from"react";var se=["autoplay","endscreenEnable","info","mute","sharingEnable","start","uiHighlight","uiLogo","videoId"];function fe(e){switch(e){case"mute":return O("muted",[!0]);case"unmute":return O("muted",[!1]);case"showControls":return O("controls",[!0]);case"hideControls":return O("controls",[!1]);default:return O(e)}}function de({currentTarget:e,data:n}){const t=function(e){const n=l();if(!e)return n;let t;for(;t=g.exec(e);){const e=w(t[1],t[1]),o=t[2]?w(t[2].replace(/\+/g," "),t[2]):"";n[e]=o}return n}(n),o=null==t?void 0:t.event;"pause"===o?j(e,"pause"):"play"===o?j(e,"playing"):"end"===o?(j(e,"pause"),j(e,"end")):"apiready"===o&&j(e,"canplay")}function pe(e,n){let{autoplay:a,endscreenEnable:i,info:l,mute:u,sharingEnable:c,start:s,uiHighlight:f,uiLogo:d,videoId:p}=e,m=o(e,se);const y=ue((()=>function(e,n,o=!1,a=!0,i=!0,l=!1,u=!0,c,s,f=!0,d){return function(e,n,t){if(!n)return e;const o=e.split("#",2),r=o[0].split("?",2);let a=r[0]+(r[1]?`?${r[1]}&${n}`:`?${n}`);return a+=o[1]?`#${o[1]}`:"",a}(`https://www.dailymotion.com/embed/video/${encodeURIComponent(n)}?api=1&html=1&app=amp`,function(e){const n=[];for(const i in e){let l=e[i];if(null!=l){l=r(a=l)?a:[a];for(let e=0;e<l.length;e++)n.push((t=i,o=l[e],`${encodeURIComponent(t)}=${encodeURIComponent(o)}`))}}var t,o,a;return n.join("&")}(t({"endscreen-enable":a?void 0:a,"info":i?void 0:i,"mute":l||o&&b(e)?1:void 0,"sharing-enable":u?void 0:u,"start":c,"ui-highlight":s,"ui-logo":f?void 0:f},d)))}(window,p,a,i,l,u,c,s,f,d)),[p,a,i,l,u,c,s,f,d]);return le(ie,t(t({autoplay:a,controls:!0,ref:n},m),{},{src:y,makeMethodMessage:fe,onMessage:de}))}var me=ce(pe);me.displayName="BentoDailymotion";export{me as BentoDailymotion,pe as BentoDailymotionWithRef}; | ||
function e(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function n(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function t(t){for(var o=1;o<arguments.length;o++){var r=null!=arguments[o]?arguments[o]:{};o%2?n(Object(r),!0).forEach((function(n){e(t,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function o(e,n){if(null==e)return{};var t,o,r={},a=Object.keys(e);for(o=0;o<a.length;o++)t=a[o],n.indexOf(t)>=0||(r[t]=e[t]);return r}var{isArray:r}=Array,{hasOwnProperty:a,toString:i}=Object.prototype;function l(e){const n=Object.create(null);return e&&Object.assign(n,e),n}var u,c=class{constructor(){this.promise=new Promise(((e,n)=>{this.resolve=e,this.reject=n}))}};function s(e){return new Promise((n=>{n(e())}))}function f(e){const n=Object.getOwnPropertyDescriptor(e,"message");if(null!=n&&n.writable)return e;const{message:t,stack:o}=e,r=new Error(t);for(const n in e)r[n]=e[n];return r.stack=o,r}function d(e){let n=null,t="";for(const e of arguments)e instanceof Error&&!n?n=f(e):(t&&(t+=" "),t+=e);return n?t&&(n.message=t+": "+n.message):n=new Error(t),n}function p(e){const n=d.apply(null,arguments);return n.expected=!0,n}function m(e,...n){var t,o,r;t=p.apply(null,n),null===(o=(r=self).__AMP_REPORT_ERROR)||void 0===o||o.call(r,t)}var y=["Webkit","webkit","Moz","moz","ms","O","o"];function b(e,n,t,o,r){const a=function(e,n,t){if(n.startsWith("--"))return n;u||(u=l());let o=u[n];if(!o||t){if(o=n,void 0===e[n]){const t=function(e){return e.charAt(0).toUpperCase()+e.slice(1)}(n),r=function(e,n){for(let t=0;t<y.length;t++){const o=y[t]+n;if(void 0!==e[o])return o}return""}(e,t);void 0!==e[r]&&(o=r)}t||(u[n]=o)}return o}(e.style,n,r);if(!a)return;const i=o?t+o:t;e.style.setProperty(function(e){const n=e.replace(/[A-Z]/g,(e=>"-"+e.toLowerCase()));return y.some((e=>n.startsWith(e+"-")))?`-${n}`:n}(a),i)}function v(e){return null==e.__AMP_AUTOPLAY&&(e.__AMP_AUTOPLAY=function(e){const n=e.document.createElement("video");var t;return n.setAttribute("muted",""),n.setAttribute("playsinline",""),n.setAttribute("webkit-playsinline",""),n.setAttribute("height","0"),n.setAttribute("width","0"),n.muted=!0,n.playsInline=!0,n.playsinline=!0,n.webkitPlaysinline=!0,function(e,n){for(const t in n)b(e,t,n[t])}(n,{position:"fixed",top:"0",width:"0",height:"0",opacity:"0"}),t=n,s((()=>t.play())).catch((()=>{})),Promise.resolve(!n.paused)}(e)),e.__AMP_AUTOPLAY}var g=/(?:^[#?]?|&)([^=&]+)(?:=([^&]*))?/g;function w(e,n=""){try{return decodeURIComponent(e)}catch(e){return n}}var h={bubbles:!0,cancelable:!0};function j(e,n,t,o){const r=t||{};e.ownerDocument;const a=e.ownerDocument.createEvent("Event");a.data=r;const{bubbles:i,cancelable:l}=o||h;a.initEvent(n,i,l),e.dispatchEvent(a)}function O(e,n){return JSON.stringify({"command":e,"parameters":n})}self.__AMP_LOG=self.__AMP_LOG||{user:null,dev:null,userForEmbed:null},self.__AMP_LOG,new Set(["c","v","a","ad"]);import{createElement as k}from"@bentoproject/core/react";import{useCallback as S,useImperativeHandle as C,useLayoutEffect as I,useMemo as E,useRef as M}from"@bentoproject/core/react";import{forwardRef as P}from"@bentoproject/core/react";function N(e){return(N="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function R(e){var n=function(e,n){if("object"!==N(e)||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var o=t.call(e,"string");if("object"!==N(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===N(n)?n:String(n)}import{Fragment as x,createElement as L}from"@bentoproject/core/react";import{useCallback as $,useEffect as q,useImperativeHandle as F,useLayoutEffect as T,useMemo as U,useRef as A,useState as V}from"@bentoproject/core/react";import{forwardRef as z}from"@bentoproject/core/react";import{ContainWrapper as H,useValueRef as J}from"@bentoproject/core/react";import{useAmpContext as W,useLoading as B}from"@bentoproject/core/react";import{useCallback as D,useLayoutEffect as Z}from"@bentoproject/core/react";import{useAmpContext as G}from"@bentoproject/core/react";var K={"title":"","artist":"","album":"","artwork":[{"src":""}]};function Q(e){const n=e.querySelector('script[type="application/ld+json"]');if(!n)return;const t=function(e,n){try{return function(e){return JSON.parse(e)}(e)}catch(e){return null}}(n.textContent);return t&&t.image?"string"==typeof t.image?t.image:t.image["@list"]&&"string"==typeof t.image["@list"][0]?t.image["@list"][0]:"string"==typeof t.image.url?t.image.url:"string"==typeof t.image[0]?t.image[0]:void 0:void 0}function X(e){const n=e.querySelector('meta[property="og:image"]');return n?n.getAttribute("content"):void 0}function Y(e){const n=e.querySelector('link[rel="shortcut icon"]')||e.querySelector('link[rel="icon"]');return n?n.getAttribute("href"):void 0}function _({displayIcon:e,displayOverlay:n,metadata:t,onOverlayClick:o,pause:r,play:a,playing:i,wrapperRef:l}){const{playable:u}=W();return q((()=>{if(!u)return void r();const e=new IntersectionObserver((e=>{e[e.length-1].isIntersecting?a().catch((()=>{})):r()}),{threshold:.5});return e.observe(l.current),()=>{e.disconnect()}}),[l,a,r,u]),L(x,null,e&&L("div",{className:"eq-9e7199f"+(i?" eq-playing-9e7199f":"")},L(ee,null)),n&&L("button",{"aria-label":t&&t.title||"Unmute video",tabIndex:"0",className:"autoplay-mask-button-9e7199f fill-content-overlay-fc551a7",onClick:o}))}var ee=function(e){let n=!1,t=null,o=()=>[1,2,3,4].map((e=>L("div",{className:"eq-col-9e7199f",key:e})));return(...e)=>(n||(t=o.apply(self,e),n=!0,o=null),t)}(),ne=z((function(e,n){let r="className",{autoplay:a=!1,component:i="video",controls:l=!1,loading:u,loop:f=!1,mediasession:d=!0,noaudio:p=!1,onPlayingState:y,onReadyState:b,poster:v,sources:g,src:w,style:h,[r]:j}=e,O=o(e,["autoplay","component","controls","loading","loop","mediasession","noaudio","onPlayingState","onReadyState","poster","sources","src","style",r].map(R));!function(){const{notify:e}=G();Z((()=>{e&&e()}))}();const{playable:k}=W(),S=B(u),C="unload"!==S,[I,E]=V(a),[M,P]=V(!1),[N,x]=V(null),[z,D]=V(!a),ee=A(null),ne=A(null),te=U((()=>new c),[]),oe=A("loading"),re=J(b),ae=$(((e,n)=>{if(e!==oe.current){oe.current=e;const t=re.current;t&&t(e,n)}}),[re]),ie=J(y),le=$((e=>{P(e);const n=ie.current;n&&n(e)}),[ie]);T((()=>{C||le(!1)}),[C,le]);const ue=$((()=>te.promise.then((()=>function(e,n){const t=s((()=>e.play(!1)));return t.catch((e=>{m(0,e)})),t}(ne.current)))),[te]),ce=$((()=>{te.promise.then((()=>{var e;return null===(e=ne.current)||void 0===e?void 0:e.pause()}))}),[te]),se=$((()=>te.promise.then((()=>ne.current.requestFullscreen()))),[te]),fe=$((()=>{E(!1),D(!0)}),[]);return T((()=>{var e;const n=null===(e=ne.current)||void 0===e?void 0:e.readyState;null!=n&&ae(n>0?"complete":"loading")}),[ae]),T((()=>(d&&M&&N&&function(e,n,t,o){const{navigator:r}=e;"mediaSession"in r&&e.MediaMetadata&&(r.mediaSession.metadata=new e.MediaMetadata(K),r.mediaSession.metadata=new e.MediaMetadata(n),r.mediaSession.setActionHandler("play",t),r.mediaSession.setActionHandler("pause",o))}(window,N,ue,ce),()=>{})),[d,M,N,ue,ce]),q((()=>{k||ce()}),[k,ce]),F(n,(()=>({get readyState(){return oe.current},play:ue,pause:ce,requestFullscreen:se,get currentTime(){return ne.current?ne.current.currentTime:0},get duration(){return ne.current?ne.current.duration:NaN},get autoplay(){return a},get controls(){return l},get loop(){return f},userInteracted:fe,mute:()=>E(!0),unmute:()=>{z&&E(!1)}})),[ue,ce,se,fe,z,a,l,f]),L(H,{contentRef:ee,className:j,style:h,size:!0,layout:!0,paint:!0},C&&L(i,t(t({},O),{},{ref:ne,loading:S,muted:I,loop:f,controls:l&&(!a||z),onCanPlay:()=>{te.resolve(),ae("complete")},onLoadedMetadata:()=>{d&&te.promise.then((()=>{var e,n;x((e=ne.current,t({"title":(n=O).title||n["aria-label"]||document.title,"artist":n.artist||"","album":n.album||"","artwork":[{"src":n.artwork||n.poster||Q(document)||X(document)||Y(document)||""}]},e&&e.getMetadata?e.getMetadata():Object.create(null))))})),ae("complete")},onPlaying:()=>le(!0),onPause:()=>le(!1),onEnded:()=>le(!1),onError:e=>{ae("error",e),te.reject(e)},className:"fill-stretch-fc551a7",src:w,poster:v}),g),a&&!z&&L(_,{metadata:N,playing:M,displayIcon:!p&&I,wrapperRef:ee,play:ue,pause:ce,displayOverlay:l,onOverlayClick:fe}))}));ne.displayName="VideoWrapper";var te=["loading","unloadOnPause","sandbox","muted","controls","origin","onCanPlay","onMessage","playerStateRef","makeMethodMessage","makeFullscreenMessage","onIframeLoad"],oe=["allow-scripts","allow-same-origin","allow-popups","allow-popups-to-escape-sandbox","allow-top-navigation-by-user-activation"].join(" ");function re(e,n,t){e&&e.contentWindow&&n.then((()=>{e.contentWindow.postMessage(t(),"*")}))}var ae=P((function(e,n){let{loading:r,unloadOnPause:a=!1,sandbox:i=oe,muted:l=!1,controls:u=!1,origin:s,onCanPlay:f,onMessage:d,playerStateRef:p,makeMethodMessage:m,makeFullscreenMessage:y,onIframeLoad:b}=e,v=o(e,te);const g=M(null),w=E((()=>new c),[]),h=M(m),j=S((e=>{re(null==g?void 0:g.current,w.promise,(()=>h.current(e)))}),[w.promise]),O=M(y),P=S((()=>re(null==g?void 0:g.current,w.promise,O.current)),[w.promise]);C(n,(()=>({get currentTime(){var e,n;return null!==(e=null==p||null===(n=p.current)||void 0===n?void 0:n.currentTime)&&void 0!==e?e:NaN},get duration(){var e,n;return null!==(e=null==p||null===(n=p.current)||void 0===n?void 0:n.duration)&&void 0!==e?e:NaN},requestFullscreen:()=>{if(!O.current)return w.promise.then((()=>{g.current.requestFullscreen()}));P()},play:()=>j("play"),pause:()=>{if(a){const e=g.current;e&&(e.src=e.src)}else j("pause")}})),[p,j,P,w.promise,a]);const N=function(e){const n=M(null);return n.current=e,n}(d);return I((()=>{if(!g.current)return;function e(e){N.current&&(s&&!s.test(e.origin)||e.source!=g.current.contentWindow||N.current({currentTarget:g.current,target:g.current,data:e.data}))}const{defaultView:n}=g.current.ownerDocument;return n.addEventListener("message",e),()=>n.removeEventListener("message",e)}),[s,N]),I((()=>{j(l?"mute":"unmute")}),[l,j]),I((()=>{j(u?"showControls":"hideControls")}),[u,j]),k("iframe",t(t({},v),{},{ref:g,allowfullscreen:!0,frameborder:"0",sandbox:i,loading:r,onCanPlay:()=>{f&&w.promise.then(f),w.resolve()},onLoad:e=>{null==b||b(e)}}))}));ae.displayName="VideoIframeInternal";var ie=P((function(e,n){return k(ne,t(t({ref:n},e),{},{component:ae}))}));ie.displayName="VideoIframe";import{createElement as le}from"@bentoproject/core/react";import{useMemo as ue}from"@bentoproject/core/react";import{forwardRef as ce}from"@bentoproject/core/react";var se=["autoplay","endscreenEnable","info","mute","sharingEnable","start","uiHighlight","uiLogo","videoId"];function fe(e){switch(e){case"mute":return O("muted",[!0]);case"unmute":return O("muted",[!1]);case"showControls":return O("controls",[!0]);case"hideControls":return O("controls",[!1]);default:return O(e)}}function de({currentTarget:e,data:n}){const t=function(e){const n=l();if(!e)return n;let t;for(;t=g.exec(e);){const e=w(t[1],t[1]),o=t[2]?w(t[2].replace(/\+/g," "),t[2]):"";n[e]=o}return n}(n),o=null==t?void 0:t.event;"pause"===o?j(e,"pause"):"play"===o?j(e,"playing"):"end"===o?(j(e,"pause"),j(e,"end")):"apiready"===o&&j(e,"canplay")}function pe(e,n){let{autoplay:a,endscreenEnable:i,info:l,mute:u,sharingEnable:c,start:s,uiHighlight:f,uiLogo:d,videoId:p}=e,m=o(e,se);const y=ue((()=>function(e,n,o=!1,a=!0,i=!0,l=!1,u=!0,c,s,f=!0,d){return function(e,n,t){if(!n)return e;const o=e.split("#",2),r=o[0].split("?",2);let a=r[0]+(r[1]?`?${r[1]}&${n}`:`?${n}`);return a+=o[1]?`#${o[1]}`:"",a}(`https://www.dailymotion.com/embed/video/${encodeURIComponent(n)}?api=1&html=1&app=amp`,function(e){const n=[];for(const i in e){let l=e[i];if(null!=l){l=r(a=l)?a:[a];for(let e=0;e<l.length;e++)n.push((t=i,o=l[e],`${encodeURIComponent(t)}=${encodeURIComponent(o)}`))}}var t,o,a;return n.join("&")}(t({"endscreen-enable":a?void 0:a,"info":i?void 0:i,"mute":l||o&&v(e)?1:void 0,"sharing-enable":u?void 0:u,"start":c,"ui-highlight":s,"ui-logo":f?void 0:f},d)))}(window,p,a,i,l,u,c,s,f,d)),[p,a,i,l,u,c,s,f,d]);return le(ie,t(t({autoplay:a,controls:!0,ref:n},m),{},{src:y,makeMethodMessage:fe,onMessage:de}))}var me=ce(pe);me.displayName="BentoDailymotion";export{me as BentoDailymotion,pe as BentoDailymotionWithRef}; | ||
/*! https://mths.be/cssescape v1.5.1 by @mathias | MIT license */ | ||
//# sourceMappingURL=component-react.module.js.map |
{ | ||
"name": "@bentoproject/dailymotion", | ||
"version": "1.2204160405.0", | ||
"version": "1.2204182206.0", | ||
"description": "Bento dailymotion Component", | ||
@@ -30,4 +30,5 @@ "author": "Bento Authors", | ||
"dist/*", | ||
"react.js", | ||
"styles.css" | ||
"styles.css", | ||
"preact", | ||
"react" | ||
], | ||
@@ -45,4 +46,4 @@ "repository": { | ||
"dependencies": { | ||
"@bentoproject/core": "0.2204160405.0" | ||
"@bentoproject/core": "0.2204182206.0" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1605054
28
7451
+ Added@bentoproject/core@0.2204182206.0(transitive)
- Removed@bentoproject/core@0.2204160405.0(transitive)