@ampproject/amp-instagram
Advanced tools
Comparing version 1.2108280007.0 to 1.2108280007.1
; | ||
var __create=Object.create,__defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty,__markAsModule=function(e){return __defProp(e,"__esModule",{value:!0})},__export=function(e,t){for(var r in __markAsModule(e),t)__defProp(e,r,{get:t[r],enumerable:!0})},__reExport=function(e,t,r){if(t&&"object"==typeof t||"function"==typeof t)for(var n,a=__getOwnPropNames(t),o=0,i=a.length;o<i;o++)n=a[o],__hasOwnProp.call(e,n)||"default"===n||__defProp(e,n,{get:function(e){return t[e]}.bind(null,n),enumerable:!(r=__getOwnPropDesc(t,n))||r.enumerable});return e},__toModule=function(e){return __reExport(__markAsModule(__defProp(null!=e?__create(__getProtoOf(e)):{},"default",e&&e.__esModule&&"default"in e?{get:function(){return e.default},enumerable:!0}:{value:e,enumerable:!0})),e)};function _defineProperty(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ownKeys(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function _objectSpread2(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(r),!0).forEach((function(t){_defineProperty(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function _arrayWithHoles(e){if(Array.isArray(e))return e}function _iterableToArrayLimit(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,o=[],i=!0,c=!1;try{for(r=r.call(e);!(i=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);i=!0);}catch(e){c=!0,a=e}finally{try{i||null==r.return||r.return()}finally{if(c)throw a}}return o}}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(e,t):void 0}}function _nonIterableRest(){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 _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_unsupportedIterableToArray(e,t)||_nonIterableRest()}function _objectWithoutPropertiesLoose(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}__export(exports,{Instagram:function(){return Instagram}});var _Object$prototype=Object.prototype,hasOwn_=_Object$prototype.hasOwnProperty,toString_=_Object$prototype.toString;function dict(e){return e||{}}var isArray=Array.isArray;function parseJson(e){return JSON.parse(e)}var preact=__toModule(require("preact")),preactDOM=__toModule(require("preact")),hooks=__toModule(require("preact/hooks"));function createElement2(e,t,r){return preact.createElement.apply(void 0,arguments)}function createContext2(e){return preact.createContext(e,void 0)}function useState2(e){return hooks.useState(e)}function useRef2(e){return hooks.useRef(e)}function useEffect2(e,t){hooks.useEffect(e,t)}function useLayoutEffect2(e,t){hooks.useLayoutEffect(e,t)}function useContext2(e){return hooks.useContext(e)}function useCallback2(e,t){return hooks.useCallback(e,t)}function useImperativeHandle2(e,t,r){return hooks.useImperativeHandle(e,t,r)}var _MAP,compat=__toModule(require("preact/compat"));function forwardRef2(e){return compat.forwardRef(e)}var Loading={AUTO:"auto",LAZY:"lazy",EAGER:"eager",UNLOAD:"unload"},ORDER=[Loading.AUTO,Loading.LAZY,Loading.EAGER,Loading.UNLOAD],MAP=(_defineProperty(_MAP={},Loading.AUTO,0),_defineProperty(_MAP,Loading.LAZY,1),_defineProperty(_MAP,Loading.EAGER,2),_defineProperty(_MAP,Loading.UNLOAD,3),_MAP);function reducer(e,t){var r=MAP[e]||0,n=MAP[t]||0,a=Math.max(r,n);return ORDER[a]}var ReadyState={UPGRADING:"upgrading",BUILDING:"building",MOUNTING:"mounting",LOADING:"loading",COMPLETE:"complete",ERROR:"error"},_excluded=["as","children","class","contentAs","contentClassName","contentProps","contentRef","contentStyle","layout","paint","size","style","wrapperClassName","wrapperStyle"],CONTAIN=[null,"paint","layout","content","size","size paint","size layout","strict"],SIZE_CONTENT_STYLE={"position":"relative","width":"100%","height":"100%"};function ContainWrapperWithRef(e,t){var r=e.as,n=void 0===r?"div":r,a=e.children,o=e.class,i=e.contentAs,c=void 0===i?"div":i,l=e.contentClassName,u=e.contentProps,s=e.contentRef,d=e.contentStyle,p=e.layout,f=void 0!==p&&p,_=e.paint,y=void 0!==_&&_,m=e.size,g=void 0!==m&&m,b=e.style,v=e.wrapperClassName,h=e.wrapperStyle,O=(g?4:0)+(f?2:0)+(y?1:0);return createElement2(n,_objectSpread2(_objectSpread2({},_objectWithoutPropertiesLoose(e,_excluded)),{},{ref:t,class:"".concat(o||""," ").concat(v||"").trim()||null,style:_objectSpread2(_objectSpread2(_objectSpread2({},b),h),{},{contain:CONTAIN[O]})}),createElement2(c,_objectSpread2(_objectSpread2({},u),{},{ref:s,class:l,style:_objectSpread2(_objectSpread2({},g&&SIZE_CONTENT_STYLE),{},{"overflow":y?"hidden":"visible"},d)}),a))}var ContainWrapper=forwardRef2(ContainWrapperWithRef),_excluded2=["as","children","class","style","wrapperClassName","wrapperStyle"];function WrapperWithRef(e,t){var r=e.as,n=void 0===r?"div":r,a=e.children,o=e.class,i=e.style,c=e.wrapperClassName,l=e.wrapperStyle;return createElement2(n,_objectSpread2(_objectSpread2({},_objectWithoutPropertiesLoose(e,_excluded2)),{},{ref:t,class:"".concat(o||""," ").concat(c||"").trim()||null,style:_objectSpread2(_objectSpread2({},i),l)}),a)}var context,Wrapper=forwardRef2(WrapperWithRef);function useValueRef(e){var t=useRef2(null);return t.current=e,t}function getAmpContext(){return context||(context=createContext2({renderable:!0,playable:!0,loading:Loading.AUTO}))}function useAmpContext(){return useContext2(getAmpContext())}function useLoading(e){return reducer(e,useAmpContext().loading)}var _excluded3=["allow","allowFullScreen","allowTransparency","iframeStyle","name","title","matchesMessagingOrigin","messageHandler","ready","loading","onReadyState","sandbox","src"],DEFAULT_MATCHES_MESSAGING_ORIGIN=function(){return!1},ABOUT_BLANK="about:blank",canResetSrc=function(e){return e&&e!=ABOUT_BLANK&&!e.includes("#")};function IframeEmbedWithRef(e,t){var r=e.allow,n=e.allowFullScreen,a=e.allowTransparency,o=e.iframeStyle,i=e.name,c=e.title,l=e.matchesMessagingOrigin,u=void 0===l?DEFAULT_MATCHES_MESSAGING_ORIGIN:l,s=e.messageHandler,d=e.ready,p=void 0===d||d,f=e.loading,_=e.onReadyState,y=e.sandbox,m=e.src,g=_objectWithoutPropertiesLoose(e,_excluded3),b=useAmpContext().playable,v=useLoading(f),h=v!==Loading.UNLOAD,O=useRef2(!1),A=useValueRef(_),S=useCallback2((function(e){if(e!==O.current){O.current=e;var t=A.current;null==t||t(e?ReadyState.COMPLETE:ReadyState.LOADING)}}),[A]),P=useRef2(null);return useImperativeHandle2(t,(function(){return{get readyState(){return O.current?ReadyState.COMPLETE:ReadyState.LOADING},get node(){return P.current}}}),[]),useLayoutEffect2((function(){h||S(!1)}),[h,S]),useEffect2((function(){var e=P.current;if(!b&&e){var t=e.src;canResetSrc(t)?e.src=e.src:e.parentNode.insertBefore(e,e.nextSibling)}}),[b]),useLayoutEffect2((function(){var e=P.current;if(e&&h){var t=function(e){var t=P.current;t&&e.source==t.contentWindow&&u(e.origin)&&s(e)},r=e.ownerDocument.defaultView;return r.addEventListener("message",t),function(){return r.removeEventListener("message",t)}}}),[u,s,h,p]),createElement2(ContainWrapper,_objectSpread2(_objectSpread2({},g),{},{layout:!0,size:!0,paint:!0}),h&&p&&createElement2("iframe",{allow:r,allowFullScreen:n,allowTransparency:a,frameborder:"0",loading:v,name:i,onLoad:function(){return S(!0)},part:"iframe",ref:P,sandbox:y,scrolling:"no",src:m,style:_objectSpread2(_objectSpread2({},o),{},{width:"100%",height:"100%",contentVisibility:"auto"}),title:c}))}var IframeEmbed=forwardRef2(IframeEmbedWithRef);IframeEmbed.displayName="IframeEmbed";var env=self.AMP_CONFIG||{},thirdPartyFrameRegex=("string"==typeof env.thirdPartyFrameRegex?new RegExp(env.thirdPartyFrameRegex):env.thirdPartyFrameRegex)||/^d-\d+\.ampproject\.net$/,cdnProxyRegex=("string"==typeof env.cdnProxyRegex?new RegExp(env.cdnProxyRegex):env.cdnProxyRegex)||/^https:\/\/([a-zA-Z0-9_-]+\.)?cdn\.ampproject\.org$/;function getMetaUrl(e){if(!self.document||!self.document.head)return null;if(self.location&&cdnProxyRegex.test(self.location.origin))return null;var t=self.document.head.querySelector('meta[name="'.concat(e,'"]'));return t&&t.getAttribute("content")||null}var urls={thirdParty:env.thirdPartyUrl||"https://3p.ampproject.net",thirdPartyFrameHost:env.thirdPartyFrameHost||"ampproject.net",thirdPartyFrameRegex:thirdPartyFrameRegex,cdn:env.cdnUrl||getMetaUrl("runtime-host")||"https://cdn.ampproject.org",cdnProxyRegex:cdnProxyRegex,localhostRegex:/^https?:\/\/localhost(:\d+)?$/,errorReporting:env.errorReportingUrl||"https://us-central1-amp-error-reporting.cloudfunctions.net/r",betaErrorReporting:env.betaErrorReportingUrl||"https://us-central1-amp-error-reporting.cloudfunctions.net/r-beta",localDev:env.localDev||!1,trustedViewerHosts:[/(^|\.)google\.(com?|[a-z]{2}|com?\.[a-z]{2}|cat)$/,/(^|\.)gmail\.(com|dev)$/],geoApi:env.geoApiUrl||getMetaUrl("amp-geo-api")};self.__AMP_LOG=self.__AMP_LOG||{user:null,dev:null,userForEmbed:null};var logs=self.__AMP_LOG;function getData(e){return e.data}var _excluded4=["captioned","requestResize","shortcode","title"],NO_HEIGHT_STYLE=dict(),MATCHES_MESSAGING_ORIGIN=function(e){return"https://www.instagram.com"===e};function InstagramWithRef(e,t){var r=e.captioned,n=e.requestResize,a=e.shortcode,o=e.title,i=void 0===o?"Instagram":o,c=_objectWithoutPropertiesLoose(e,_excluded4),l=_slicedToArray(useState2(NO_HEIGHT_STYLE),2),u=l[0],s=l[1],d=_slicedToArray(useState2(0),2),p=d[0],f=d[1],_=useCallback2((function(e){var t=parseJson(getData(e));if("MEASURE"==t.type&&t.details){var r=t.details.height;n&&n(r),s(dict({"height":r})),f(1)}}),[n]);return createElement2(IframeEmbed,_objectSpread2({allowTransparency:!0,iframeStyle:{opacity:p},matchesMessagingOrigin:MATCHES_MESSAGING_ORIGIN,messageHandler:_,ref:t,src:"https://www.instagram.com/p/"+encodeURIComponent(a)+"/embed/"+(r?"captioned/":"")+"?cr=1&v=12",title:i,wrapperStyle:u},c))}var Instagram=forwardRef2(InstagramWithRef);Instagram.displayName="Instagram"; | ||
var __create=Object.create,__defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty,__markAsModule=function(e){return __defProp(e,"__esModule",{value:!0})},__export=function(e,t){for(var r in __markAsModule(e),t)__defProp(e,r,{get:t[r],enumerable:!0})},__reExport=function(e,t,r){if(t&&"object"==typeof t||"function"==typeof t)for(var n,o=__getOwnPropNames(t),a=0,i=o.length;a<i;a++)n=o[a],__hasOwnProp.call(e,n)||"default"===n||__defProp(e,n,{get:function(e){return t[e]}.bind(null,n),enumerable:!(r=__getOwnPropDesc(t,n))||r.enumerable});return e},__toModule=function(e){return __reExport(__markAsModule(__defProp(null!=e?__create(__getProtoOf(e)):{},"default",e&&e.__esModule&&"default"in e?{get:function(){return e.default},enumerable:!0}:{value:e,enumerable:!0})),e)};function _defineProperty(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ownKeys(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function _objectSpread2(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(r),!0).forEach((function(t){_defineProperty(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function _arrayWithHoles(e){if(Array.isArray(e))return e}function _iterableToArrayLimit(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,a=[],i=!0,c=!1;try{for(r=r.call(e);!(i=(n=r.next()).done)&&(a.push(n.value),!t||a.length!==t);i=!0);}catch(e){c=!0,o=e}finally{try{i||null==r.return||r.return()}finally{if(c)throw o}}return a}}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(e,t):void 0}}function _nonIterableRest(){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 _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_unsupportedIterableToArray(e,t)||_nonIterableRest()}function _objectWithoutPropertiesLoose(e,t){if(null==e)return{};var r,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}__export(exports,{BentoInstagram:function(){return BentoInstagram}});var _Object$prototype=Object.prototype,hasOwn_=_Object$prototype.hasOwnProperty,toString_=_Object$prototype.toString;function dict(e){return e||{}}var isArray=Array.isArray;function parseJson(e){return JSON.parse(e)}var preact=__toModule(require("preact")),preactDOM=__toModule(require("preact")),hooks=__toModule(require("preact/hooks"));function createElement2(e,t,r){return preact.createElement.apply(void 0,arguments)}function createContext2(e){return preact.createContext(e,void 0)}function useState2(e){return hooks.useState(e)}function useRef2(e){return hooks.useRef(e)}function useEffect2(e,t){hooks.useEffect(e,t)}function useLayoutEffect2(e,t){hooks.useLayoutEffect(e,t)}function useContext2(e){return hooks.useContext(e)}function useCallback2(e,t){return hooks.useCallback(e,t)}function useImperativeHandle2(e,t,r){return hooks.useImperativeHandle(e,t,r)}var compat=__toModule(require("preact/compat"));function forwardRef2(e){return compat.forwardRef(e)}var _excluded=["as","children","class","contentAs","contentClassName","contentProps","contentRef","contentStyle","layout","paint","size","style","wrapperClassName","wrapperStyle"],CONTAIN=[null,"paint","layout","content","size","size paint","size layout","strict"],SIZE_CONTENT_STYLE={"position":"relative","width":"100%","height":"100%"};function ContainWrapperWithRef(e,t){var r=e.as,n=void 0===r?"div":r,o=e.children,a=e.class,i=e.contentAs,c=void 0===i?"div":i,l=e.contentClassName,u=e.contentProps,s=e.contentRef,d=e.contentStyle,p=e.layout,f=void 0!==p&&p,_=e.paint,y=void 0!==_&&_,m=e.size,g=void 0!==m&&m,b=e.style,v=e.wrapperClassName,h=e.wrapperStyle,O=(g?4:0)+(f?2:0)+(y?1:0);return createElement2(n,_objectSpread2(_objectSpread2({},_objectWithoutPropertiesLoose(e,_excluded)),{},{ref:t,class:"".concat(a||""," ").concat(v||"").trim()||null,style:_objectSpread2(_objectSpread2(_objectSpread2({},b),h),{},{contain:CONTAIN[O]})}),createElement2(c,_objectSpread2(_objectSpread2({},u),{},{ref:s,class:l,style:_objectSpread2(_objectSpread2({},g&&SIZE_CONTENT_STYLE),{},{"overflow":y?"hidden":"visible"},d)}),o))}var ContainWrapper=forwardRef2(ContainWrapperWithRef),_excluded2=["as","children","class","style","wrapperClassName","wrapperStyle"];function WrapperWithRef(e,t){var r=e.as,n=void 0===r?"div":r,o=e.children,a=e.class,i=e.style,c=e.wrapperClassName,l=e.wrapperStyle;return createElement2(n,_objectSpread2(_objectSpread2({},_objectWithoutPropertiesLoose(e,_excluded2)),{},{ref:t,class:"".concat(a||""," ").concat(c||"").trim()||null,style:_objectSpread2(_objectSpread2({},i),l)}),o)}var _MAP,Wrapper=forwardRef2(WrapperWithRef);function useValueRef(e){var t=useRef2(null);return t.current=e,t}var Loading={AUTO:"auto",LAZY:"lazy",EAGER:"eager",UNLOAD:"unload"},ORDER=[Loading.AUTO,Loading.LAZY,Loading.EAGER,Loading.UNLOAD],MAP=(_defineProperty(_MAP={},Loading.AUTO,0),_defineProperty(_MAP,Loading.LAZY,1),_defineProperty(_MAP,Loading.EAGER,2),_defineProperty(_MAP,Loading.UNLOAD,3),_MAP);function reducer(e,t){var r=MAP[e]||0,n=MAP[t]||0,o=Math.max(r,n);return ORDER[o]}var context,ReadyState={UPGRADING:"upgrading",BUILDING:"building",MOUNTING:"mounting",LOADING:"loading",COMPLETE:"complete",ERROR:"error"};function getAmpContext(){return context||(context=createContext2({renderable:!0,playable:!0,loading:Loading.AUTO}))}function useAmpContext(){return useContext2(getAmpContext())}function useLoading(e){return reducer(e,useAmpContext().loading)}var _excluded3=["allow","allowFullScreen","allowTransparency","iframeStyle","name","title","matchesMessagingOrigin","messageHandler","ready","loading","onReadyState","sandbox","src"],DEFAULT_MATCHES_MESSAGING_ORIGIN=function(){return!1},ABOUT_BLANK="about:blank",canResetSrc=function(e){return e&&e!=ABOUT_BLANK&&!e.includes("#")};function IframeEmbedWithRef(e,t){var r=e.allow,n=e.allowFullScreen,o=e.allowTransparency,a=e.iframeStyle,i=e.name,c=e.title,l=e.matchesMessagingOrigin,u=void 0===l?DEFAULT_MATCHES_MESSAGING_ORIGIN:l,s=e.messageHandler,d=e.ready,p=void 0===d||d,f=e.loading,_=e.onReadyState,y=e.sandbox,m=e.src,g=_objectWithoutPropertiesLoose(e,_excluded3),b=useAmpContext().playable,v=useLoading(f),h=v!==Loading.UNLOAD,O=useRef2(!1),A=useValueRef(_),S=useCallback2((function(e){if(e!==O.current){O.current=e;var t=A.current;null==t||t(e?ReadyState.COMPLETE:ReadyState.LOADING)}}),[A]),P=useRef2(null);return useImperativeHandle2(t,(function(){return{get readyState(){return O.current?ReadyState.COMPLETE:ReadyState.LOADING},get node(){return P.current}}}),[]),useLayoutEffect2((function(){h||S(!1)}),[h,S]),useEffect2((function(){var e=P.current;if(!b&&e){var t=e.src;canResetSrc(t)?e.src=e.src:e.parentNode.insertBefore(e,e.nextSibling)}}),[b]),useLayoutEffect2((function(){var e=P.current;if(e&&h){var t=function(e){var t=P.current;t&&e.source==t.contentWindow&&u(e.origin)&&s(e)},r=e.ownerDocument.defaultView;return r.addEventListener("message",t),function(){return r.removeEventListener("message",t)}}}),[u,s,h,p]),createElement2(ContainWrapper,_objectSpread2(_objectSpread2({},g),{},{layout:!0,size:!0,paint:!0}),h&&p&&createElement2("iframe",{allow:r,allowFullScreen:n,allowTransparency:o,frameborder:"0",loading:v,name:i,onLoad:function(){return S(!0)},part:"iframe",ref:P,sandbox:y,scrolling:"no",src:m,style:_objectSpread2(_objectSpread2({},a),{},{width:"100%",height:"100%",contentVisibility:"auto"}),title:c}))}var IframeEmbed=forwardRef2(IframeEmbedWithRef);IframeEmbed.displayName="IframeEmbed";var env=self.AMP_CONFIG||{},thirdPartyFrameRegex=("string"==typeof env.thirdPartyFrameRegex?new RegExp(env.thirdPartyFrameRegex):env.thirdPartyFrameRegex)||/^d-\d+\.ampproject\.net$/,cdnProxyRegex=("string"==typeof env.cdnProxyRegex?new RegExp(env.cdnProxyRegex):env.cdnProxyRegex)||/^https:\/\/([a-zA-Z0-9_-]+\.)?cdn\.ampproject\.org$/;function getMetaUrl(e){if(!self.document||!self.document.head)return null;if(self.location&&cdnProxyRegex.test(self.location.origin))return null;var t=self.document.head.querySelector('meta[name="'.concat(e,'"]'));return t&&t.getAttribute("content")||null}var urls={thirdParty:env.thirdPartyUrl||"https://3p.ampproject.net",thirdPartyFrameHost:env.thirdPartyFrameHost||"ampproject.net",thirdPartyFrameRegex:thirdPartyFrameRegex,cdn:env.cdnUrl||getMetaUrl("runtime-host")||"https://cdn.ampproject.org",cdnProxyRegex:cdnProxyRegex,localhostRegex:/^https?:\/\/localhost(:\d+)?$/,errorReporting:env.errorReportingUrl||"https://us-central1-amp-error-reporting.cloudfunctions.net/r",betaErrorReporting:env.betaErrorReportingUrl||"https://us-central1-amp-error-reporting.cloudfunctions.net/r-beta",localDev:env.localDev||!1,trustedViewerHosts:[/(^|\.)google\.(com?|[a-z]{2}|com?\.[a-z]{2}|cat)$/,/(^|\.)gmail\.(com|dev)$/],geoApi:env.geoApiUrl||getMetaUrl("amp-geo-api")};self.__AMP_LOG=self.__AMP_LOG||{user:null,dev:null,userForEmbed:null};var logs=self.__AMP_LOG;function getData(e){return e.data}var _excluded4=["captioned","onLoad","requestResize","shortcode","title"],NO_HEIGHT_STYLE=dict(),MATCHES_MESSAGING_ORIGIN=function(e){return"https://www.instagram.com"===e};function BentoInstagramWithRef(e,t){var r=e.captioned,n=e.onLoad,o=e.requestResize,a=e.shortcode,i=e.title,c=void 0===i?"Instagram":i,l=_objectWithoutPropertiesLoose(e,_excluded4),u=_slicedToArray(useState2(NO_HEIGHT_STYLE),2),s=u[0],d=u[1],p=_slicedToArray(useState2(0),2),f=p[0],_=p[1],y=useValueRef(n),m=useCallback2((function(e){var t=parseJson(getData(e));if("MEASURE"==t.type&&t.details){var r,n=t.details.height;o&&o(n),d(dict({"height":n})),_(1),null===(r=y.current)||void 0===r||r.call(y)}}),[o,y]);return createElement2(IframeEmbed,_objectSpread2({allowTransparency:!0,iframeStyle:{opacity:f},matchesMessagingOrigin:MATCHES_MESSAGING_ORIGIN,messageHandler:m,ref:t,src:"https://www.instagram.com/p/"+encodeURIComponent(a)+"/embed/"+(r?"captioned/":"")+"?cr=1&v=12",title:c,wrapperStyle:s},l))}var BentoInstagram=forwardRef2(BentoInstagramWithRef);BentoInstagram.displayName="Instagram"; | ||
/*! https://mths.be/cssescape v1.5.1 by @mathias | MIT license */ |
@@ -34,4 +34,4 @@ var __create = Object.create; | ||
__export(exports, { | ||
Instagram: function() { | ||
return Instagram; | ||
BentoInstagram: function() { | ||
return BentoInstagram; | ||
} | ||
@@ -94,29 +94,2 @@ }); | ||
// src/core/constants/loading-instructions.js | ||
var _MAP; | ||
var Loading = { | ||
AUTO: "auto", | ||
LAZY: "lazy", | ||
EAGER: "eager", | ||
UNLOAD: "unload" | ||
}; | ||
var ORDER = [Loading.AUTO, Loading.LAZY, Loading.EAGER, Loading.UNLOAD]; | ||
var MAP = (_MAP = {}, _MAP[Loading.AUTO] = 0, _MAP[Loading.LAZY] = 1, _MAP[Loading.EAGER] = 2, _MAP[Loading.UNLOAD] = 3, _MAP); | ||
function reducer(v1, v2) { | ||
var ordinal1 = MAP[v1] || 0; | ||
var ordinal2 = MAP[v2] || 0; | ||
var ordinal = Math.max(ordinal1, ordinal2); | ||
return ORDER[ordinal]; | ||
} | ||
// src/core/constants/ready-state.js | ||
var ReadyState = { | ||
UPGRADING: "upgrading", | ||
BUILDING: "building", | ||
MOUNTING: "mounting", | ||
LOADING: "loading", | ||
COMPLETE: "complete", | ||
ERROR: "error" | ||
}; | ||
// src/preact/component/contain.js | ||
@@ -233,2 +206,29 @@ var _excluded = ["as", "children", "class", "contentAs", "contentClassName", "contentProps", "contentRef", "contentStyle", "layout", "paint", "size", "style", "wrapperClassName", "wrapperStyle"]; | ||
// src/core/constants/loading-instructions.js | ||
var _MAP; | ||
var Loading = { | ||
AUTO: "auto", | ||
LAZY: "lazy", | ||
EAGER: "eager", | ||
UNLOAD: "unload" | ||
}; | ||
var ORDER = [Loading.AUTO, Loading.LAZY, Loading.EAGER, Loading.UNLOAD]; | ||
var MAP = (_MAP = {}, _MAP[Loading.AUTO] = 0, _MAP[Loading.LAZY] = 1, _MAP[Loading.EAGER] = 2, _MAP[Loading.UNLOAD] = 3, _MAP); | ||
function reducer(v1, v2) { | ||
var ordinal1 = MAP[v1] || 0; | ||
var ordinal2 = MAP[v2] || 0; | ||
var ordinal = Math.max(ordinal1, ordinal2); | ||
return ORDER[ordinal]; | ||
} | ||
// src/core/constants/ready-state.js | ||
var ReadyState = { | ||
UPGRADING: "upgrading", | ||
BUILDING: "building", | ||
MOUNTING: "mounting", | ||
LOADING: "loading", | ||
COMPLETE: "complete", | ||
ERROR: "error" | ||
}; | ||
// src/preact/context.js | ||
@@ -421,3 +421,3 @@ var context; | ||
// extensions/amp-instagram/1.0/component.js | ||
var _excluded4 = ["captioned", "requestResize", "shortcode", "title"]; | ||
var _excluded4 = ["captioned", "onLoad", "requestResize", "shortcode", "title"]; | ||
function _extends4() { | ||
@@ -455,6 +455,7 @@ _extends4 = Object.assign || function(target) { | ||
}; | ||
function InstagramWithRef(_ref, ref) { | ||
var captioned = _ref.captioned, requestResize = _ref.requestResize, shortcode = _ref.shortcode, _ref$title = _ref.title, title = _ref$title === void 0 ? "Instagram" : _ref$title, rest = _objectWithoutPropertiesLoose4(_ref, _excluded4); | ||
function BentoInstagramWithRef(_ref, ref) { | ||
var captioned = _ref.captioned, onLoad = _ref.onLoad, requestResize = _ref.requestResize, shortcode = _ref.shortcode, _ref$title = _ref.title, title = _ref$title === void 0 ? "Instagram" : _ref$title, rest = _objectWithoutPropertiesLoose4(_ref, _excluded4); | ||
var _useState = useState2(NO_HEIGHT_STYLE), heightStyle = _useState[0], setHeightStyle = _useState[1]; | ||
var _useState2 = useState2(0), opacity = _useState2[0], setOpacity = _useState2[1]; | ||
var onLoadRef = useValueRef(onLoad); | ||
var messageHandler = useCallback2(function(event) { | ||
@@ -471,4 +472,5 @@ var data = parseJson(getData(event)); | ||
setOpacity(1); | ||
onLoadRef.current == null ? void 0 : onLoadRef.current(); | ||
} | ||
}, [requestResize]); | ||
}, [requestResize, onLoadRef]); | ||
return createElement2(IframeEmbed, _extends4({ | ||
@@ -487,5 +489,5 @@ allowTransparency: true, | ||
} | ||
var Instagram = forwardRef2(InstagramWithRef); | ||
Instagram.displayName = "Instagram"; | ||
var BentoInstagram = forwardRef2(BentoInstagramWithRef); | ||
BentoInstagram.displayName = "Instagram"; | ||
/*! https://mths.be/cssescape v1.5.1 by @mathias | MIT license */ | ||
//# sourceMappingURL=component-preact.max.js.map |
@@ -74,33 +74,2 @@ // src/core/types/object/index.js | ||
// src/core/constants/loading-instructions.js | ||
var Loading = { | ||
AUTO: "auto", | ||
LAZY: "lazy", | ||
EAGER: "eager", | ||
UNLOAD: "unload" | ||
}; | ||
var ORDER = [Loading.AUTO, Loading.LAZY, Loading.EAGER, Loading.UNLOAD]; | ||
var MAP = { | ||
[Loading.AUTO]: 0, | ||
[Loading.LAZY]: 1, | ||
[Loading.EAGER]: 2, | ||
[Loading.UNLOAD]: 3 | ||
}; | ||
function reducer(v1, v2) { | ||
const ordinal1 = MAP[v1] || 0; | ||
const ordinal2 = MAP[v2] || 0; | ||
const ordinal = Math.max(ordinal1, ordinal2); | ||
return ORDER[ordinal]; | ||
} | ||
// src/core/constants/ready-state.js | ||
var ReadyState = { | ||
UPGRADING: "upgrading", | ||
BUILDING: "building", | ||
MOUNTING: "mounting", | ||
LOADING: "loading", | ||
COMPLETE: "complete", | ||
ERROR: "error" | ||
}; | ||
// src/preact/component/contain.js | ||
@@ -239,2 +208,33 @@ var _excluded = ["as", "children", "class", "contentAs", "contentClassName", "contentProps", "contentRef", "contentStyle", "layout", "paint", "size", "style", "wrapperClassName", "wrapperStyle"]; | ||
// src/core/constants/loading-instructions.js | ||
var Loading = { | ||
AUTO: "auto", | ||
LAZY: "lazy", | ||
EAGER: "eager", | ||
UNLOAD: "unload" | ||
}; | ||
var ORDER = [Loading.AUTO, Loading.LAZY, Loading.EAGER, Loading.UNLOAD]; | ||
var MAP = { | ||
[Loading.AUTO]: 0, | ||
[Loading.LAZY]: 1, | ||
[Loading.EAGER]: 2, | ||
[Loading.UNLOAD]: 3 | ||
}; | ||
function reducer(v1, v2) { | ||
const ordinal1 = MAP[v1] || 0; | ||
const ordinal2 = MAP[v2] || 0; | ||
const ordinal = Math.max(ordinal1, ordinal2); | ||
return ORDER[ordinal]; | ||
} | ||
// src/core/constants/ready-state.js | ||
var ReadyState = { | ||
UPGRADING: "upgrading", | ||
BUILDING: "building", | ||
MOUNTING: "mounting", | ||
LOADING: "loading", | ||
COMPLETE: "complete", | ||
ERROR: "error" | ||
}; | ||
// src/preact/context.js | ||
@@ -439,3 +439,3 @@ var context; | ||
// extensions/amp-instagram/1.0/component.js | ||
var _excluded4 = ["captioned", "requestResize", "shortcode", "title"]; | ||
var _excluded4 = ["captioned", "onLoad", "requestResize", "shortcode", "title"]; | ||
function _extends4() { | ||
@@ -471,5 +471,6 @@ _extends4 = Object.assign || function(target) { | ||
var MATCHES_MESSAGING_ORIGIN = (origin) => origin === "https://www.instagram.com"; | ||
function InstagramWithRef(_ref, ref) { | ||
function BentoInstagramWithRef(_ref, ref) { | ||
let { | ||
captioned, | ||
onLoad, | ||
requestResize, | ||
@@ -481,2 +482,3 @@ shortcode, | ||
const [opacity, setOpacity] = useState2(0); | ||
const onLoadRef = useValueRef(onLoad); | ||
const messageHandler = useCallback2((event) => { | ||
@@ -493,4 +495,5 @@ const data = parseJson(getData(event)); | ||
setOpacity(1); | ||
onLoadRef.current == null ? void 0 : onLoadRef.current(); | ||
} | ||
}, [requestResize]); | ||
}, [requestResize, onLoadRef]); | ||
return createElement2(IframeEmbed, _extends4({ | ||
@@ -509,8 +512,8 @@ allowTransparency: true, | ||
} | ||
var Instagram = forwardRef2(InstagramWithRef); | ||
Instagram.displayName = "Instagram"; | ||
var BentoInstagram = forwardRef2(BentoInstagramWithRef); | ||
BentoInstagram.displayName = "Instagram"; | ||
export { | ||
BentoInstagram | ||
}; | ||
/*! https://mths.be/cssescape v1.5.1 by @mathias | MIT license */ | ||
//# sourceMappingURL=component-preact.max.module.js.map |
; | ||
function e(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function t(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function r(r){for(var n=1;n<arguments.length;n++){var a=null!=arguments[n]?arguments[n]:{};n%2?t(Object(a),!0).forEach((function(t){e(r,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(a)):t(Object(a)).forEach((function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(a,e))}))}return r}function n(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}var{hasOwnProperty:a,toString:o}=Object.prototype;function l(e){return e||{}}import{cloneElement as i,createContext as s,createElement as c,createRef as u}from"preact";import{hydrate as p,render as d}from"preact";import{useCallback as f,useContext as m,useEffect as y,useImperativeHandle as g,useLayoutEffect as w,useMemo as h,useRef as b,useState as O}from"preact/hooks";function v(e,t,r){return c.apply(void 0,arguments)}function P(e){return O(e)}function S(e){return b(e)}function x(e,t){w(e,t)}function R(e,t){return f(e,t)}import{Children as j,createPortal as z,forwardRef as E}from"preact/compat";function N(e){return E(e)}var _,A=["auto","lazy","eager","unload"],F={auto:0,lazy:1,eager:2,unload:3},M=["as","children","class","contentAs","contentClassName","contentProps","contentRef","contentStyle","layout","paint","size","style","wrapperClassName","wrapperStyle"],C=[null,"paint","layout","content","size","size paint","size layout","strict"],U={"position":"relative","width":"100%","height":"100%"},D=N((function(e,t){let{as:a="div",children:o,"class":l,contentAs:i="div",contentClassName:s,contentProps:c,contentRef:u,contentStyle:p,layout:d=!1,paint:f=!1,size:m=!1,"style":y,wrapperClassName:g,wrapperStyle:w}=e;const h=(m?4:0)+(d?2:0)+(f?1:0);return v(a,r(r({},n(e,M)),{},{ref:t,class:`${l||""} ${g||""}`.trim()||null,style:r(r(r({},y),w),{},{contain:C[h]})}),v(i,r(r({},c),{},{ref:u,class:s,style:r(r({},m&&U),{},{"overflow":f?"hidden":"visible"},p)}),o))})),L=["as","children","class","style","wrapperClassName","wrapperStyle"];function $(){const e=_||(_=s({renderable:!0,playable:!0,loading:"auto"},void 0));return m(e)}N((function(e,t){let{as:a="div",children:o,"class":l,"style":i,wrapperClassName:s,wrapperStyle:c}=e;return v(a,r(r({},n(e,L)),{},{ref:t,class:`${l||""} ${s||""}`.trim()||null,style:r(r({},i),c)}),o)}));var I=["allow","allowFullScreen","allowTransparency","iframeStyle","name","title","matchesMessagingOrigin","messageHandler","ready","loading","onReadyState","sandbox","src"],k=()=>!1,G=N((function(e,t){let{allow:a,allowFullScreen:o,allowTransparency:l,iframeStyle:i,name:s,title:c,matchesMessagingOrigin:u=k,messageHandler:p,ready:d=!0,loading:f,onReadyState:m,sandbox:w,src:h}=e,b=n(e,I);const{playable:O}=$(),P=function(e){const{loading:t}=$();return function(e,t){const r=F[e]||0,n=F[t]||0,a=Math.max(r,n);return A[a]}(e,t)}(f),j="unload"!==P,z=S(!1),E=function(e){const t=S(null);return t.current=e,t}(m),N=R((e=>{if(e!==z.current){z.current=e;const t=E.current;null==t||t(e?"complete":"loading")}}),[E]),_=S(null);return function(e,t,r){g(e,(()=>({get readyState(){return z.current?"complete":"loading"},get node(){return _.current}})),[])}(t),x((()=>{j||N(!1)}),[j,N]),y((()=>{const e=_.current;if(!O&&e){const{src:t}=e;(e=>e&&"about:blank"!=e&&!e.includes("#"))(t)?e.src=e.src:e.parentNode.insertBefore(e,e.nextSibling)}}),[O]),x((()=>{const e=_.current;if(!e||!j)return;const t=e=>{const t=_.current;t&&e.source==t.contentWindow&&u(e.origin)&&p(e)},{defaultView:r}=e.ownerDocument;return r.addEventListener("message",t),()=>r.removeEventListener("message",t)}),[u,p,j,d]),v(D,r(r({},b),{},{layout:!0,size:!0,paint:!0}),j&&d&&v("iframe",{allow:a,allowFullScreen:o,allowTransparency:l,frameborder:"0",loading:P,name:s,onLoad:()=>N(!0),part:"iframe",ref:_,sandbox:w,scrolling:"no",src:h,style:r(r({},i),{},{width:"100%",height:"100%",contentVisibility:"auto"}),title:c}))}));G.displayName="IframeEmbed";var H=self.AMP_CONFIG||{},T=("string"==typeof H.thirdPartyFrameRegex?new RegExp(H.thirdPartyFrameRegex):H.thirdPartyFrameRegex,("string"==typeof H.cdnProxyRegex?new RegExp(H.cdnProxyRegex):H.cdnProxyRegex)||/^https:\/\/([a-zA-Z0-9_-]+\.)?cdn\.ampproject\.org$/);function q(e){if(!self.document||!self.document.head)return null;if(self.location&&T.test(self.location.origin))return null;const t=self.document.head.querySelector(`meta[name="${e}"]`);return t&&t.getAttribute("content")||null}H.thirdPartyUrl,H.thirdPartyFrameHost,H.cdnUrl||q("runtime-host"),H.errorReportingUrl,H.betaErrorReportingUrl,H.localDev,H.geoApiUrl||q("amp-geo-api"),self.__AMP_LOG=self.__AMP_LOG||{user:null,dev:null,userForEmbed:null},self.__AMP_LOG;var V=["captioned","requestResize","shortcode","title"],B=l(),J=e=>"https://www.instagram.com"===e,W=N((function(e,t){let{captioned:a,requestResize:o,shortcode:i,title:s="Instagram"}=e,c=n(e,V);const[u,p]=P(B),[d,f]=P(0),m=R((e=>{const t=(r=function(e){return e.data}(e),JSON.parse(r));var r;if("MEASURE"==t.type&&t.details){const e=t.details.height;o&&o(e),p(l({"height":e})),f(1)}}),[o]);return v(G,r({allowTransparency:!0,iframeStyle:{opacity:d},matchesMessagingOrigin:J,messageHandler:m,ref:t,src:"https://www.instagram.com/p/"+encodeURIComponent(i)+"/embed/"+(a?"captioned/":"")+"?cr=1&v=12",title:s,wrapperStyle:u},c))}));W.displayName="Instagram";export{W as Instagram}; | ||
function e(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function t(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function r(r){for(var n=1;n<arguments.length;n++){var a=null!=arguments[n]?arguments[n]:{};n%2?t(Object(a),!0).forEach((function(t){e(r,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(a)):t(Object(a)).forEach((function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(a,e))}))}return r}function n(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}var{hasOwnProperty:a,toString:o}=Object.prototype;function l(e){return e||{}}import{cloneElement as i,createContext as s,createElement as c,createRef as u}from"preact";import{hydrate as p,render as d}from"preact";import{useCallback as f,useContext as m,useEffect as y,useImperativeHandle as g,useLayoutEffect as w,useMemo as h,useRef as b,useState as O}from"preact/hooks";function v(e,t,r){return c.apply(void 0,arguments)}function P(e){return O(e)}function S(e){return b(e)}function x(e,t){w(e,t)}function R(e,t){return f(e,t)}import{Children as j,createPortal as z,forwardRef as E}from"preact/compat";function N(e){return E(e)}var _=["as","children","class","contentAs","contentClassName","contentProps","contentRef","contentStyle","layout","paint","size","style","wrapperClassName","wrapperStyle"],A=[null,"paint","layout","content","size","size paint","size layout","strict"],F={"position":"relative","width":"100%","height":"100%"},M=N((function(e,t){let{as:a="div",children:o,"class":l,contentAs:i="div",contentClassName:s,contentProps:c,contentRef:u,contentStyle:p,layout:d=!1,paint:f=!1,size:m=!1,"style":y,wrapperClassName:g,wrapperStyle:w}=e;const h=(m?4:0)+(d?2:0)+(f?1:0);return v(a,r(r({},n(e,_)),{},{ref:t,class:`${l||""} ${g||""}`.trim()||null,style:r(r(r({},y),w),{},{contain:A[h]})}),v(i,r(r({},c),{},{ref:u,class:s,style:r(r({},m&&F),{},{"overflow":f?"hidden":"visible"},p)}),o))})),C=["as","children","class","style","wrapperClassName","wrapperStyle"];function L(e){const t=S(null);return t.current=e,t}N((function(e,t){let{as:a="div",children:o,"class":l,"style":i,wrapperClassName:s,wrapperStyle:c}=e;return v(a,r(r({},n(e,C)),{},{ref:t,class:`${l||""} ${s||""}`.trim()||null,style:r(r({},i),c)}),o)}));var U,D=["auto","lazy","eager","unload"],$={auto:0,lazy:1,eager:2,unload:3};function I(){const e=U||(U=s({renderable:!0,playable:!0,loading:"auto"},void 0));return m(e)}var k=["allow","allowFullScreen","allowTransparency","iframeStyle","name","title","matchesMessagingOrigin","messageHandler","ready","loading","onReadyState","sandbox","src"],G=()=>!1,H=N((function(e,t){let{allow:a,allowFullScreen:o,allowTransparency:l,iframeStyle:i,name:s,title:c,matchesMessagingOrigin:u=G,messageHandler:p,ready:d=!0,loading:f,onReadyState:m,sandbox:w,src:h}=e,b=n(e,k);const{playable:O}=I(),P=function(e){const{loading:t}=I();return function(e,t){const r=$[e]||0,n=$[t]||0,a=Math.max(r,n);return D[a]}(e,t)}(f),j="unload"!==P,z=S(!1),E=L(m),N=R((e=>{if(e!==z.current){z.current=e;const t=E.current;null==t||t(e?"complete":"loading")}}),[E]),_=S(null);return function(e,t,r){g(e,(()=>({get readyState(){return z.current?"complete":"loading"},get node(){return _.current}})),[])}(t),x((()=>{j||N(!1)}),[j,N]),y((()=>{const e=_.current;if(!O&&e){const{src:t}=e;(e=>e&&"about:blank"!=e&&!e.includes("#"))(t)?e.src=e.src:e.parentNode.insertBefore(e,e.nextSibling)}}),[O]),x((()=>{const e=_.current;if(!e||!j)return;const t=e=>{const t=_.current;t&&e.source==t.contentWindow&&u(e.origin)&&p(e)},{defaultView:r}=e.ownerDocument;return r.addEventListener("message",t),()=>r.removeEventListener("message",t)}),[u,p,j,d]),v(M,r(r({},b),{},{layout:!0,size:!0,paint:!0}),j&&d&&v("iframe",{allow:a,allowFullScreen:o,allowTransparency:l,frameborder:"0",loading:P,name:s,onLoad:()=>N(!0),part:"iframe",ref:_,sandbox:w,scrolling:"no",src:h,style:r(r({},i),{},{width:"100%",height:"100%",contentVisibility:"auto"}),title:c}))}));H.displayName="IframeEmbed";var T=self.AMP_CONFIG||{},q=("string"==typeof T.thirdPartyFrameRegex?new RegExp(T.thirdPartyFrameRegex):T.thirdPartyFrameRegex,("string"==typeof T.cdnProxyRegex?new RegExp(T.cdnProxyRegex):T.cdnProxyRegex)||/^https:\/\/([a-zA-Z0-9_-]+\.)?cdn\.ampproject\.org$/);function V(e){if(!self.document||!self.document.head)return null;if(self.location&&q.test(self.location.origin))return null;const t=self.document.head.querySelector(`meta[name="${e}"]`);return t&&t.getAttribute("content")||null}T.thirdPartyUrl,T.thirdPartyFrameHost,T.cdnUrl||V("runtime-host"),T.errorReportingUrl,T.betaErrorReportingUrl,T.localDev,T.geoApiUrl||V("amp-geo-api"),self.__AMP_LOG=self.__AMP_LOG||{user:null,dev:null,userForEmbed:null},self.__AMP_LOG;var B=["captioned","onLoad","requestResize","shortcode","title"],J=l(),W=e=>"https://www.instagram.com"===e,Z=N((function(e,t){let{captioned:a,onLoad:o,requestResize:i,shortcode:s,title:c="Instagram"}=e,u=n(e,B);const[p,d]=P(J),[f,m]=P(0),y=L(o),g=R((e=>{const t=(r=function(e){return e.data}(e),JSON.parse(r));var r;if("MEASURE"==t.type&&t.details){var n;const e=t.details.height;i&&i(e),d(l({"height":e})),m(1),null===(n=y.current)||void 0===n||n.call(y)}}),[i,y]);return v(H,r({allowTransparency:!0,iframeStyle:{opacity:f},matchesMessagingOrigin:W,messageHandler:g,ref:t,src:"https://www.instagram.com/p/"+encodeURIComponent(s)+"/embed/"+(a?"captioned/":"")+"?cr=1&v=12",title:c,wrapperStyle:p},u))}));Z.displayName="Instagram";export{Z as BentoInstagram}; | ||
/*! https://mths.be/cssescape v1.5.1 by @mathias | MIT license */ |
; | ||
var __create=Object.create,__defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty,__markAsModule=function(e){return __defProp(e,"__esModule",{value:!0})},__export=function(e,t){for(var r in __markAsModule(e),t)__defProp(e,r,{get:t[r],enumerable:!0})},__reExport=function(e,t,r){if(t&&"object"==typeof t||"function"==typeof t)for(var n,a=__getOwnPropNames(t),o=0,i=a.length;o<i;o++)n=a[o],__hasOwnProp.call(e,n)||"default"===n||__defProp(e,n,{get:function(e){return t[e]}.bind(null,n),enumerable:!(r=__getOwnPropDesc(t,n))||r.enumerable});return e},__toModule=function(e){return __reExport(__markAsModule(__defProp(null!=e?__create(__getProtoOf(e)):{},"default",e&&e.__esModule&&"default"in e?{get:function(){return e.default},enumerable:!0}:{value:e,enumerable:!0})),e)};function _defineProperty(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ownKeys(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function _objectSpread2(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(r),!0).forEach((function(t){_defineProperty(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function _arrayWithHoles(e){if(Array.isArray(e))return e}function _iterableToArrayLimit(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,o=[],i=!0,c=!1;try{for(r=r.call(e);!(i=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);i=!0);}catch(e){c=!0,a=e}finally{try{i||null==r.return||r.return()}finally{if(c)throw a}}return o}}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(e,t):void 0}}function _nonIterableRest(){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 _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_unsupportedIterableToArray(e,t)||_nonIterableRest()}function _objectWithoutPropertiesLoose(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}__export(exports,{Instagram:function(){return Instagram}});var _Object$prototype=Object.prototype,hasOwn_=_Object$prototype.hasOwnProperty,toString_=_Object$prototype.toString;function dict(e){return e||{}}var isArray=Array.isArray;function parseJson(e){return JSON.parse(e)}var preact=__toModule(require("react")),preactDOM=__toModule(require("react-dom")),hooks=__toModule(require("react"));function createElement2(e,t,r){return preact.createElement.apply(void 0,arguments)}function createContext2(e){return preact.createContext(e,void 0)}function useState2(e){return hooks.useState(e)}function useRef2(e){return hooks.useRef(e)}function useEffect2(e,t){hooks.useEffect(e,t)}function useLayoutEffect2(e,t){hooks.useLayoutEffect(e,t)}function useContext2(e){return hooks.useContext(e)}function useCallback2(e,t){return hooks.useCallback(e,t)}function useImperativeHandle2(e,t,r){return hooks.useImperativeHandle(e,t,r)}var _MAP,compat=__toModule(require("react"));function forwardRef2(e){return compat.forwardRef(e)}var Loading={AUTO:"auto",LAZY:"lazy",EAGER:"eager",UNLOAD:"unload"},ORDER=[Loading.AUTO,Loading.LAZY,Loading.EAGER,Loading.UNLOAD],MAP=(_defineProperty(_MAP={},Loading.AUTO,0),_defineProperty(_MAP,Loading.LAZY,1),_defineProperty(_MAP,Loading.EAGER,2),_defineProperty(_MAP,Loading.UNLOAD,3),_MAP);function reducer(e,t){var r=MAP[e]||0,n=MAP[t]||0,a=Math.max(r,n);return ORDER[a]}var ReadyState={UPGRADING:"upgrading",BUILDING:"building",MOUNTING:"mounting",LOADING:"loading",COMPLETE:"complete",ERROR:"error"},_excluded=["as","children","class","contentAs","contentClassName","contentProps","contentRef","contentStyle","layout","paint","size","style","wrapperClassName","wrapperStyle"],CONTAIN=[null,"paint","layout","content","size","size paint","size layout","strict"],SIZE_CONTENT_STYLE={"position":"relative","width":"100%","height":"100%"};function ContainWrapperWithRef(e,t){var r=e.as,n=void 0===r?"div":r,a=e.children,o=e.class,i=e.contentAs,c=void 0===i?"div":i,l=e.contentClassName,u=e.contentProps,s=e.contentRef,d=e.contentStyle,p=e.layout,f=void 0!==p&&p,_=e.paint,y=void 0!==_&&_,m=e.size,g=void 0!==m&&m,b=e.style,v=e.wrapperClassName,h=e.wrapperStyle,O=(g?4:0)+(f?2:0)+(y?1:0);return createElement2(n,_objectSpread2(_objectSpread2({},_objectWithoutPropertiesLoose(e,_excluded)),{},{ref:t,class:"".concat(o||""," ").concat(v||"").trim()||null,style:_objectSpread2(_objectSpread2(_objectSpread2({},b),h),{},{contain:CONTAIN[O]})}),createElement2(c,_objectSpread2(_objectSpread2({},u),{},{ref:s,class:l,style:_objectSpread2(_objectSpread2({},g&&SIZE_CONTENT_STYLE),{},{"overflow":y?"hidden":"visible"},d)}),a))}var ContainWrapper=forwardRef2(ContainWrapperWithRef),_excluded2=["as","children","class","style","wrapperClassName","wrapperStyle"];function WrapperWithRef(e,t){var r=e.as,n=void 0===r?"div":r,a=e.children,o=e.class,i=e.style,c=e.wrapperClassName,l=e.wrapperStyle;return createElement2(n,_objectSpread2(_objectSpread2({},_objectWithoutPropertiesLoose(e,_excluded2)),{},{ref:t,class:"".concat(o||""," ").concat(c||"").trim()||null,style:_objectSpread2(_objectSpread2({},i),l)}),a)}var context,Wrapper=forwardRef2(WrapperWithRef);function useValueRef(e){var t=useRef2(null);return t.current=e,t}function getAmpContext(){return context||(context=createContext2({renderable:!0,playable:!0,loading:Loading.AUTO}))}function useAmpContext(){return useContext2(getAmpContext())}function useLoading(e){return reducer(e,useAmpContext().loading)}var _excluded3=["allow","allowFullScreen","allowTransparency","iframeStyle","name","title","matchesMessagingOrigin","messageHandler","ready","loading","onReadyState","sandbox","src"],DEFAULT_MATCHES_MESSAGING_ORIGIN=function(){return!1},ABOUT_BLANK="about:blank",canResetSrc=function(e){return e&&e!=ABOUT_BLANK&&!e.includes("#")};function IframeEmbedWithRef(e,t){var r=e.allow,n=e.allowFullScreen,a=e.allowTransparency,o=e.iframeStyle,i=e.name,c=e.title,l=e.matchesMessagingOrigin,u=void 0===l?DEFAULT_MATCHES_MESSAGING_ORIGIN:l,s=e.messageHandler,d=e.ready,p=void 0===d||d,f=e.loading,_=e.onReadyState,y=e.sandbox,m=e.src,g=_objectWithoutPropertiesLoose(e,_excluded3),b=useAmpContext().playable,v=useLoading(f),h=v!==Loading.UNLOAD,O=useRef2(!1),A=useValueRef(_),S=useCallback2((function(e){if(e!==O.current){O.current=e;var t=A.current;null==t||t(e?ReadyState.COMPLETE:ReadyState.LOADING)}}),[A]),P=useRef2(null);return useImperativeHandle2(t,(function(){return{get readyState(){return O.current?ReadyState.COMPLETE:ReadyState.LOADING},get node(){return P.current}}}),[]),useLayoutEffect2((function(){h||S(!1)}),[h,S]),useEffect2((function(){var e=P.current;if(!b&&e){var t=e.src;canResetSrc(t)?e.src=e.src:e.parentNode.insertBefore(e,e.nextSibling)}}),[b]),useLayoutEffect2((function(){var e=P.current;if(e&&h){var t=function(e){var t=P.current;t&&e.source==t.contentWindow&&u(e.origin)&&s(e)},r=e.ownerDocument.defaultView;return r.addEventListener("message",t),function(){return r.removeEventListener("message",t)}}}),[u,s,h,p]),createElement2(ContainWrapper,_objectSpread2(_objectSpread2({},g),{},{layout:!0,size:!0,paint:!0}),h&&p&&createElement2("iframe",{allow:r,allowFullScreen:n,allowTransparency:a,frameborder:"0",loading:v,name:i,onLoad:function(){return S(!0)},part:"iframe",ref:P,sandbox:y,scrolling:"no",src:m,style:_objectSpread2(_objectSpread2({},o),{},{width:"100%",height:"100%",contentVisibility:"auto"}),title:c}))}var IframeEmbed=forwardRef2(IframeEmbedWithRef);IframeEmbed.displayName="IframeEmbed";var env=self.AMP_CONFIG||{},thirdPartyFrameRegex=("string"==typeof env.thirdPartyFrameRegex?new RegExp(env.thirdPartyFrameRegex):env.thirdPartyFrameRegex)||/^d-\d+\.ampproject\.net$/,cdnProxyRegex=("string"==typeof env.cdnProxyRegex?new RegExp(env.cdnProxyRegex):env.cdnProxyRegex)||/^https:\/\/([a-zA-Z0-9_-]+\.)?cdn\.ampproject\.org$/;function getMetaUrl(e){if(!self.document||!self.document.head)return null;if(self.location&&cdnProxyRegex.test(self.location.origin))return null;var t=self.document.head.querySelector('meta[name="'.concat(e,'"]'));return t&&t.getAttribute("content")||null}var urls={thirdParty:env.thirdPartyUrl||"https://3p.ampproject.net",thirdPartyFrameHost:env.thirdPartyFrameHost||"ampproject.net",thirdPartyFrameRegex:thirdPartyFrameRegex,cdn:env.cdnUrl||getMetaUrl("runtime-host")||"https://cdn.ampproject.org",cdnProxyRegex:cdnProxyRegex,localhostRegex:/^https?:\/\/localhost(:\d+)?$/,errorReporting:env.errorReportingUrl||"https://us-central1-amp-error-reporting.cloudfunctions.net/r",betaErrorReporting:env.betaErrorReportingUrl||"https://us-central1-amp-error-reporting.cloudfunctions.net/r-beta",localDev:env.localDev||!1,trustedViewerHosts:[/(^|\.)google\.(com?|[a-z]{2}|com?\.[a-z]{2}|cat)$/,/(^|\.)gmail\.(com|dev)$/],geoApi:env.geoApiUrl||getMetaUrl("amp-geo-api")};self.__AMP_LOG=self.__AMP_LOG||{user:null,dev:null,userForEmbed:null};var logs=self.__AMP_LOG;function getData(e){return e.data}var _excluded4=["captioned","requestResize","shortcode","title"],NO_HEIGHT_STYLE=dict(),MATCHES_MESSAGING_ORIGIN=function(e){return"https://www.instagram.com"===e};function InstagramWithRef(e,t){var r=e.captioned,n=e.requestResize,a=e.shortcode,o=e.title,i=void 0===o?"Instagram":o,c=_objectWithoutPropertiesLoose(e,_excluded4),l=_slicedToArray(useState2(NO_HEIGHT_STYLE),2),u=l[0],s=l[1],d=_slicedToArray(useState2(0),2),p=d[0],f=d[1],_=useCallback2((function(e){var t=parseJson(getData(e));if("MEASURE"==t.type&&t.details){var r=t.details.height;n&&n(r),s(dict({"height":r})),f(1)}}),[n]);return createElement2(IframeEmbed,_objectSpread2({allowTransparency:!0,iframeStyle:{opacity:p},matchesMessagingOrigin:MATCHES_MESSAGING_ORIGIN,messageHandler:_,ref:t,src:"https://www.instagram.com/p/"+encodeURIComponent(a)+"/embed/"+(r?"captioned/":"")+"?cr=1&v=12",title:i,wrapperStyle:u},c))}var Instagram=forwardRef2(InstagramWithRef);Instagram.displayName="Instagram"; | ||
var __create=Object.create,__defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty,__markAsModule=function(e){return __defProp(e,"__esModule",{value:!0})},__export=function(e,t){for(var r in __markAsModule(e),t)__defProp(e,r,{get:t[r],enumerable:!0})},__reExport=function(e,t,r){if(t&&"object"==typeof t||"function"==typeof t)for(var n,o=__getOwnPropNames(t),a=0,i=o.length;a<i;a++)n=o[a],__hasOwnProp.call(e,n)||"default"===n||__defProp(e,n,{get:function(e){return t[e]}.bind(null,n),enumerable:!(r=__getOwnPropDesc(t,n))||r.enumerable});return e},__toModule=function(e){return __reExport(__markAsModule(__defProp(null!=e?__create(__getProtoOf(e)):{},"default",e&&e.__esModule&&"default"in e?{get:function(){return e.default},enumerable:!0}:{value:e,enumerable:!0})),e)};function _defineProperty(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ownKeys(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function _objectSpread2(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(r),!0).forEach((function(t){_defineProperty(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function _arrayWithHoles(e){if(Array.isArray(e))return e}function _iterableToArrayLimit(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,a=[],i=!0,c=!1;try{for(r=r.call(e);!(i=(n=r.next()).done)&&(a.push(n.value),!t||a.length!==t);i=!0);}catch(e){c=!0,o=e}finally{try{i||null==r.return||r.return()}finally{if(c)throw o}}return a}}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(e,t):void 0}}function _nonIterableRest(){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 _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_unsupportedIterableToArray(e,t)||_nonIterableRest()}function _objectWithoutPropertiesLoose(e,t){if(null==e)return{};var r,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}__export(exports,{BentoInstagram:function(){return BentoInstagram}});var _Object$prototype=Object.prototype,hasOwn_=_Object$prototype.hasOwnProperty,toString_=_Object$prototype.toString;function dict(e){return e||{}}var isArray=Array.isArray;function parseJson(e){return JSON.parse(e)}var preact=__toModule(require("react")),preactDOM=__toModule(require("react-dom")),hooks=__toModule(require("react"));function createElement2(e,t,r){return preact.createElement.apply(void 0,arguments)}function createContext2(e){return preact.createContext(e,void 0)}function useState2(e){return hooks.useState(e)}function useRef2(e){return hooks.useRef(e)}function useEffect2(e,t){hooks.useEffect(e,t)}function useLayoutEffect2(e,t){hooks.useLayoutEffect(e,t)}function useContext2(e){return hooks.useContext(e)}function useCallback2(e,t){return hooks.useCallback(e,t)}function useImperativeHandle2(e,t,r){return hooks.useImperativeHandle(e,t,r)}var compat=__toModule(require("react"));function forwardRef2(e){return compat.forwardRef(e)}var _excluded=["as","children","class","contentAs","contentClassName","contentProps","contentRef","contentStyle","layout","paint","size","style","wrapperClassName","wrapperStyle"],CONTAIN=[null,"paint","layout","content","size","size paint","size layout","strict"],SIZE_CONTENT_STYLE={"position":"relative","width":"100%","height":"100%"};function ContainWrapperWithRef(e,t){var r=e.as,n=void 0===r?"div":r,o=e.children,a=e.class,i=e.contentAs,c=void 0===i?"div":i,l=e.contentClassName,u=e.contentProps,s=e.contentRef,d=e.contentStyle,p=e.layout,f=void 0!==p&&p,_=e.paint,y=void 0!==_&&_,m=e.size,g=void 0!==m&&m,b=e.style,v=e.wrapperClassName,h=e.wrapperStyle,O=(g?4:0)+(f?2:0)+(y?1:0);return createElement2(n,_objectSpread2(_objectSpread2({},_objectWithoutPropertiesLoose(e,_excluded)),{},{ref:t,class:"".concat(a||""," ").concat(v||"").trim()||null,style:_objectSpread2(_objectSpread2(_objectSpread2({},b),h),{},{contain:CONTAIN[O]})}),createElement2(c,_objectSpread2(_objectSpread2({},u),{},{ref:s,class:l,style:_objectSpread2(_objectSpread2({},g&&SIZE_CONTENT_STYLE),{},{"overflow":y?"hidden":"visible"},d)}),o))}var ContainWrapper=forwardRef2(ContainWrapperWithRef),_excluded2=["as","children","class","style","wrapperClassName","wrapperStyle"];function WrapperWithRef(e,t){var r=e.as,n=void 0===r?"div":r,o=e.children,a=e.class,i=e.style,c=e.wrapperClassName,l=e.wrapperStyle;return createElement2(n,_objectSpread2(_objectSpread2({},_objectWithoutPropertiesLoose(e,_excluded2)),{},{ref:t,class:"".concat(a||""," ").concat(c||"").trim()||null,style:_objectSpread2(_objectSpread2({},i),l)}),o)}var _MAP,Wrapper=forwardRef2(WrapperWithRef);function useValueRef(e){var t=useRef2(null);return t.current=e,t}var Loading={AUTO:"auto",LAZY:"lazy",EAGER:"eager",UNLOAD:"unload"},ORDER=[Loading.AUTO,Loading.LAZY,Loading.EAGER,Loading.UNLOAD],MAP=(_defineProperty(_MAP={},Loading.AUTO,0),_defineProperty(_MAP,Loading.LAZY,1),_defineProperty(_MAP,Loading.EAGER,2),_defineProperty(_MAP,Loading.UNLOAD,3),_MAP);function reducer(e,t){var r=MAP[e]||0,n=MAP[t]||0,o=Math.max(r,n);return ORDER[o]}var context,ReadyState={UPGRADING:"upgrading",BUILDING:"building",MOUNTING:"mounting",LOADING:"loading",COMPLETE:"complete",ERROR:"error"};function getAmpContext(){return context||(context=createContext2({renderable:!0,playable:!0,loading:Loading.AUTO}))}function useAmpContext(){return useContext2(getAmpContext())}function useLoading(e){return reducer(e,useAmpContext().loading)}var _excluded3=["allow","allowFullScreen","allowTransparency","iframeStyle","name","title","matchesMessagingOrigin","messageHandler","ready","loading","onReadyState","sandbox","src"],DEFAULT_MATCHES_MESSAGING_ORIGIN=function(){return!1},ABOUT_BLANK="about:blank",canResetSrc=function(e){return e&&e!=ABOUT_BLANK&&!e.includes("#")};function IframeEmbedWithRef(e,t){var r=e.allow,n=e.allowFullScreen,o=e.allowTransparency,a=e.iframeStyle,i=e.name,c=e.title,l=e.matchesMessagingOrigin,u=void 0===l?DEFAULT_MATCHES_MESSAGING_ORIGIN:l,s=e.messageHandler,d=e.ready,p=void 0===d||d,f=e.loading,_=e.onReadyState,y=e.sandbox,m=e.src,g=_objectWithoutPropertiesLoose(e,_excluded3),b=useAmpContext().playable,v=useLoading(f),h=v!==Loading.UNLOAD,O=useRef2(!1),A=useValueRef(_),S=useCallback2((function(e){if(e!==O.current){O.current=e;var t=A.current;null==t||t(e?ReadyState.COMPLETE:ReadyState.LOADING)}}),[A]),P=useRef2(null);return useImperativeHandle2(t,(function(){return{get readyState(){return O.current?ReadyState.COMPLETE:ReadyState.LOADING},get node(){return P.current}}}),[]),useLayoutEffect2((function(){h||S(!1)}),[h,S]),useEffect2((function(){var e=P.current;if(!b&&e){var t=e.src;canResetSrc(t)?e.src=e.src:e.parentNode.insertBefore(e,e.nextSibling)}}),[b]),useLayoutEffect2((function(){var e=P.current;if(e&&h){var t=function(e){var t=P.current;t&&e.source==t.contentWindow&&u(e.origin)&&s(e)},r=e.ownerDocument.defaultView;return r.addEventListener("message",t),function(){return r.removeEventListener("message",t)}}}),[u,s,h,p]),createElement2(ContainWrapper,_objectSpread2(_objectSpread2({},g),{},{layout:!0,size:!0,paint:!0}),h&&p&&createElement2("iframe",{allow:r,allowFullScreen:n,allowTransparency:o,frameborder:"0",loading:v,name:i,onLoad:function(){return S(!0)},part:"iframe",ref:P,sandbox:y,scrolling:"no",src:m,style:_objectSpread2(_objectSpread2({},a),{},{width:"100%",height:"100%",contentVisibility:"auto"}),title:c}))}var IframeEmbed=forwardRef2(IframeEmbedWithRef);IframeEmbed.displayName="IframeEmbed";var env=self.AMP_CONFIG||{},thirdPartyFrameRegex=("string"==typeof env.thirdPartyFrameRegex?new RegExp(env.thirdPartyFrameRegex):env.thirdPartyFrameRegex)||/^d-\d+\.ampproject\.net$/,cdnProxyRegex=("string"==typeof env.cdnProxyRegex?new RegExp(env.cdnProxyRegex):env.cdnProxyRegex)||/^https:\/\/([a-zA-Z0-9_-]+\.)?cdn\.ampproject\.org$/;function getMetaUrl(e){if(!self.document||!self.document.head)return null;if(self.location&&cdnProxyRegex.test(self.location.origin))return null;var t=self.document.head.querySelector('meta[name="'.concat(e,'"]'));return t&&t.getAttribute("content")||null}var urls={thirdParty:env.thirdPartyUrl||"https://3p.ampproject.net",thirdPartyFrameHost:env.thirdPartyFrameHost||"ampproject.net",thirdPartyFrameRegex:thirdPartyFrameRegex,cdn:env.cdnUrl||getMetaUrl("runtime-host")||"https://cdn.ampproject.org",cdnProxyRegex:cdnProxyRegex,localhostRegex:/^https?:\/\/localhost(:\d+)?$/,errorReporting:env.errorReportingUrl||"https://us-central1-amp-error-reporting.cloudfunctions.net/r",betaErrorReporting:env.betaErrorReportingUrl||"https://us-central1-amp-error-reporting.cloudfunctions.net/r-beta",localDev:env.localDev||!1,trustedViewerHosts:[/(^|\.)google\.(com?|[a-z]{2}|com?\.[a-z]{2}|cat)$/,/(^|\.)gmail\.(com|dev)$/],geoApi:env.geoApiUrl||getMetaUrl("amp-geo-api")};self.__AMP_LOG=self.__AMP_LOG||{user:null,dev:null,userForEmbed:null};var logs=self.__AMP_LOG;function getData(e){return e.data}var _excluded4=["captioned","onLoad","requestResize","shortcode","title"],NO_HEIGHT_STYLE=dict(),MATCHES_MESSAGING_ORIGIN=function(e){return"https://www.instagram.com"===e};function BentoInstagramWithRef(e,t){var r=e.captioned,n=e.onLoad,o=e.requestResize,a=e.shortcode,i=e.title,c=void 0===i?"Instagram":i,l=_objectWithoutPropertiesLoose(e,_excluded4),u=_slicedToArray(useState2(NO_HEIGHT_STYLE),2),s=u[0],d=u[1],p=_slicedToArray(useState2(0),2),f=p[0],_=p[1],y=useValueRef(n),m=useCallback2((function(e){var t=parseJson(getData(e));if("MEASURE"==t.type&&t.details){var r,n=t.details.height;o&&o(n),d(dict({"height":n})),_(1),null===(r=y.current)||void 0===r||r.call(y)}}),[o,y]);return createElement2(IframeEmbed,_objectSpread2({allowTransparency:!0,iframeStyle:{opacity:f},matchesMessagingOrigin:MATCHES_MESSAGING_ORIGIN,messageHandler:m,ref:t,src:"https://www.instagram.com/p/"+encodeURIComponent(a)+"/embed/"+(r?"captioned/":"")+"?cr=1&v=12",title:c,wrapperStyle:s},l))}var BentoInstagram=forwardRef2(BentoInstagramWithRef);BentoInstagram.displayName="Instagram"; | ||
/*! https://mths.be/cssescape v1.5.1 by @mathias | MIT license */ |
@@ -34,4 +34,4 @@ var __create = Object.create; | ||
__export(exports, { | ||
Instagram: function() { | ||
return Instagram; | ||
BentoInstagram: function() { | ||
return BentoInstagram; | ||
} | ||
@@ -94,29 +94,2 @@ }); | ||
// src/core/constants/loading-instructions.js | ||
var _MAP; | ||
var Loading = { | ||
AUTO: "auto", | ||
LAZY: "lazy", | ||
EAGER: "eager", | ||
UNLOAD: "unload" | ||
}; | ||
var ORDER = [Loading.AUTO, Loading.LAZY, Loading.EAGER, Loading.UNLOAD]; | ||
var MAP = (_MAP = {}, _MAP[Loading.AUTO] = 0, _MAP[Loading.LAZY] = 1, _MAP[Loading.EAGER] = 2, _MAP[Loading.UNLOAD] = 3, _MAP); | ||
function reducer(v1, v2) { | ||
var ordinal1 = MAP[v1] || 0; | ||
var ordinal2 = MAP[v2] || 0; | ||
var ordinal = Math.max(ordinal1, ordinal2); | ||
return ORDER[ordinal]; | ||
} | ||
// src/core/constants/ready-state.js | ||
var ReadyState = { | ||
UPGRADING: "upgrading", | ||
BUILDING: "building", | ||
MOUNTING: "mounting", | ||
LOADING: "loading", | ||
COMPLETE: "complete", | ||
ERROR: "error" | ||
}; | ||
// src/preact/component/contain.js | ||
@@ -233,2 +206,29 @@ var _excluded = ["as", "children", "class", "contentAs", "contentClassName", "contentProps", "contentRef", "contentStyle", "layout", "paint", "size", "style", "wrapperClassName", "wrapperStyle"]; | ||
// src/core/constants/loading-instructions.js | ||
var _MAP; | ||
var Loading = { | ||
AUTO: "auto", | ||
LAZY: "lazy", | ||
EAGER: "eager", | ||
UNLOAD: "unload" | ||
}; | ||
var ORDER = [Loading.AUTO, Loading.LAZY, Loading.EAGER, Loading.UNLOAD]; | ||
var MAP = (_MAP = {}, _MAP[Loading.AUTO] = 0, _MAP[Loading.LAZY] = 1, _MAP[Loading.EAGER] = 2, _MAP[Loading.UNLOAD] = 3, _MAP); | ||
function reducer(v1, v2) { | ||
var ordinal1 = MAP[v1] || 0; | ||
var ordinal2 = MAP[v2] || 0; | ||
var ordinal = Math.max(ordinal1, ordinal2); | ||
return ORDER[ordinal]; | ||
} | ||
// src/core/constants/ready-state.js | ||
var ReadyState = { | ||
UPGRADING: "upgrading", | ||
BUILDING: "building", | ||
MOUNTING: "mounting", | ||
LOADING: "loading", | ||
COMPLETE: "complete", | ||
ERROR: "error" | ||
}; | ||
// src/preact/context.js | ||
@@ -421,3 +421,3 @@ var context; | ||
// extensions/amp-instagram/1.0/component.js | ||
var _excluded4 = ["captioned", "requestResize", "shortcode", "title"]; | ||
var _excluded4 = ["captioned", "onLoad", "requestResize", "shortcode", "title"]; | ||
function _extends4() { | ||
@@ -455,6 +455,7 @@ _extends4 = Object.assign || function(target) { | ||
}; | ||
function InstagramWithRef(_ref, ref) { | ||
var captioned = _ref.captioned, requestResize = _ref.requestResize, shortcode = _ref.shortcode, _ref$title = _ref.title, title = _ref$title === void 0 ? "Instagram" : _ref$title, rest = _objectWithoutPropertiesLoose4(_ref, _excluded4); | ||
function BentoInstagramWithRef(_ref, ref) { | ||
var captioned = _ref.captioned, onLoad = _ref.onLoad, requestResize = _ref.requestResize, shortcode = _ref.shortcode, _ref$title = _ref.title, title = _ref$title === void 0 ? "Instagram" : _ref$title, rest = _objectWithoutPropertiesLoose4(_ref, _excluded4); | ||
var _useState = useState2(NO_HEIGHT_STYLE), heightStyle = _useState[0], setHeightStyle = _useState[1]; | ||
var _useState2 = useState2(0), opacity = _useState2[0], setOpacity = _useState2[1]; | ||
var onLoadRef = useValueRef(onLoad); | ||
var messageHandler = useCallback2(function(event) { | ||
@@ -471,4 +472,5 @@ var data = parseJson(getData(event)); | ||
setOpacity(1); | ||
onLoadRef.current == null ? void 0 : onLoadRef.current(); | ||
} | ||
}, [requestResize]); | ||
}, [requestResize, onLoadRef]); | ||
return createElement2(IframeEmbed, _extends4({ | ||
@@ -487,5 +489,5 @@ allowTransparency: true, | ||
} | ||
var Instagram = forwardRef2(InstagramWithRef); | ||
Instagram.displayName = "Instagram"; | ||
var BentoInstagram = forwardRef2(BentoInstagramWithRef); | ||
BentoInstagram.displayName = "Instagram"; | ||
/*! https://mths.be/cssescape v1.5.1 by @mathias | MIT license */ | ||
//# sourceMappingURL=component-react.max.js.map |
@@ -74,33 +74,2 @@ // src/core/types/object/index.js | ||
// src/core/constants/loading-instructions.js | ||
var Loading = { | ||
AUTO: "auto", | ||
LAZY: "lazy", | ||
EAGER: "eager", | ||
UNLOAD: "unload" | ||
}; | ||
var ORDER = [Loading.AUTO, Loading.LAZY, Loading.EAGER, Loading.UNLOAD]; | ||
var MAP = { | ||
[Loading.AUTO]: 0, | ||
[Loading.LAZY]: 1, | ||
[Loading.EAGER]: 2, | ||
[Loading.UNLOAD]: 3 | ||
}; | ||
function reducer(v1, v2) { | ||
const ordinal1 = MAP[v1] || 0; | ||
const ordinal2 = MAP[v2] || 0; | ||
const ordinal = Math.max(ordinal1, ordinal2); | ||
return ORDER[ordinal]; | ||
} | ||
// src/core/constants/ready-state.js | ||
var ReadyState = { | ||
UPGRADING: "upgrading", | ||
BUILDING: "building", | ||
MOUNTING: "mounting", | ||
LOADING: "loading", | ||
COMPLETE: "complete", | ||
ERROR: "error" | ||
}; | ||
// src/preact/component/contain.js | ||
@@ -239,2 +208,33 @@ var _excluded = ["as", "children", "class", "contentAs", "contentClassName", "contentProps", "contentRef", "contentStyle", "layout", "paint", "size", "style", "wrapperClassName", "wrapperStyle"]; | ||
// src/core/constants/loading-instructions.js | ||
var Loading = { | ||
AUTO: "auto", | ||
LAZY: "lazy", | ||
EAGER: "eager", | ||
UNLOAD: "unload" | ||
}; | ||
var ORDER = [Loading.AUTO, Loading.LAZY, Loading.EAGER, Loading.UNLOAD]; | ||
var MAP = { | ||
[Loading.AUTO]: 0, | ||
[Loading.LAZY]: 1, | ||
[Loading.EAGER]: 2, | ||
[Loading.UNLOAD]: 3 | ||
}; | ||
function reducer(v1, v2) { | ||
const ordinal1 = MAP[v1] || 0; | ||
const ordinal2 = MAP[v2] || 0; | ||
const ordinal = Math.max(ordinal1, ordinal2); | ||
return ORDER[ordinal]; | ||
} | ||
// src/core/constants/ready-state.js | ||
var ReadyState = { | ||
UPGRADING: "upgrading", | ||
BUILDING: "building", | ||
MOUNTING: "mounting", | ||
LOADING: "loading", | ||
COMPLETE: "complete", | ||
ERROR: "error" | ||
}; | ||
// src/preact/context.js | ||
@@ -439,3 +439,3 @@ var context; | ||
// extensions/amp-instagram/1.0/component.js | ||
var _excluded4 = ["captioned", "requestResize", "shortcode", "title"]; | ||
var _excluded4 = ["captioned", "onLoad", "requestResize", "shortcode", "title"]; | ||
function _extends4() { | ||
@@ -471,5 +471,6 @@ _extends4 = Object.assign || function(target) { | ||
var MATCHES_MESSAGING_ORIGIN = (origin) => origin === "https://www.instagram.com"; | ||
function InstagramWithRef(_ref, ref) { | ||
function BentoInstagramWithRef(_ref, ref) { | ||
let { | ||
captioned, | ||
onLoad, | ||
requestResize, | ||
@@ -481,2 +482,3 @@ shortcode, | ||
const [opacity, setOpacity] = useState2(0); | ||
const onLoadRef = useValueRef(onLoad); | ||
const messageHandler = useCallback2((event) => { | ||
@@ -493,4 +495,5 @@ const data = parseJson(getData(event)); | ||
setOpacity(1); | ||
onLoadRef.current == null ? void 0 : onLoadRef.current(); | ||
} | ||
}, [requestResize]); | ||
}, [requestResize, onLoadRef]); | ||
return createElement2(IframeEmbed, _extends4({ | ||
@@ -509,8 +512,8 @@ allowTransparency: true, | ||
} | ||
var Instagram = forwardRef2(InstagramWithRef); | ||
Instagram.displayName = "Instagram"; | ||
var BentoInstagram = forwardRef2(BentoInstagramWithRef); | ||
BentoInstagram.displayName = "Instagram"; | ||
export { | ||
BentoInstagram | ||
}; | ||
/*! https://mths.be/cssescape v1.5.1 by @mathias | MIT license */ | ||
//# sourceMappingURL=component-react.max.module.js.map |
; | ||
function e(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function t(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function r(r){for(var n=1;n<arguments.length;n++){var a=null!=arguments[n]?arguments[n]:{};n%2?t(Object(a),!0).forEach((function(t){e(r,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(a)):t(Object(a)).forEach((function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(a,e))}))}return r}function n(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}var{hasOwnProperty:a,toString:o}=Object.prototype;function l(e){return e||{}}import{cloneElement as i,createContext as s,createElement as c,createRef as u}from"react";import{hydrate as p,render as d}from"react-dom";import{useCallback as f,useContext as m,useEffect as y,useImperativeHandle as g,useLayoutEffect as w,useMemo as h,useRef as b,useState as O}from"react";function v(e,t,r){return c.apply(void 0,arguments)}function P(e){return O(e)}function S(e){return b(e)}function x(e,t){w(e,t)}function R(e,t){return f(e,t)}import{Children as j,createPortal as z,forwardRef as E}from"react";function N(e){return E(e)}var _,A=["auto","lazy","eager","unload"],F={auto:0,lazy:1,eager:2,unload:3},M=["as","children","class","contentAs","contentClassName","contentProps","contentRef","contentStyle","layout","paint","size","style","wrapperClassName","wrapperStyle"],C=[null,"paint","layout","content","size","size paint","size layout","strict"],U={"position":"relative","width":"100%","height":"100%"},D=N((function(e,t){let{as:a="div",children:o,"class":l,contentAs:i="div",contentClassName:s,contentProps:c,contentRef:u,contentStyle:p,layout:d=!1,paint:f=!1,size:m=!1,"style":y,wrapperClassName:g,wrapperStyle:w}=e;const h=(m?4:0)+(d?2:0)+(f?1:0);return v(a,r(r({},n(e,M)),{},{ref:t,class:`${l||""} ${g||""}`.trim()||null,style:r(r(r({},y),w),{},{contain:C[h]})}),v(i,r(r({},c),{},{ref:u,class:s,style:r(r({},m&&U),{},{"overflow":f?"hidden":"visible"},p)}),o))})),L=["as","children","class","style","wrapperClassName","wrapperStyle"];function $(){const e=_||(_=s({renderable:!0,playable:!0,loading:"auto"},void 0));return m(e)}N((function(e,t){let{as:a="div",children:o,"class":l,"style":i,wrapperClassName:s,wrapperStyle:c}=e;return v(a,r(r({},n(e,L)),{},{ref:t,class:`${l||""} ${s||""}`.trim()||null,style:r(r({},i),c)}),o)}));var I=["allow","allowFullScreen","allowTransparency","iframeStyle","name","title","matchesMessagingOrigin","messageHandler","ready","loading","onReadyState","sandbox","src"],G=()=>!1,H=N((function(e,t){let{allow:a,allowFullScreen:o,allowTransparency:l,iframeStyle:i,name:s,title:c,matchesMessagingOrigin:u=G,messageHandler:p,ready:d=!0,loading:f,onReadyState:m,sandbox:w,src:h}=e,b=n(e,I);const{playable:O}=$(),P=function(e){const{loading:t}=$();return function(e,t){const r=F[e]||0,n=F[t]||0,a=Math.max(r,n);return A[a]}(e,t)}(f),j="unload"!==P,z=S(!1),E=function(e){const t=S(null);return t.current=e,t}(m),N=R((e=>{if(e!==z.current){z.current=e;const t=E.current;null==t||t(e?"complete":"loading")}}),[E]),_=S(null);return function(e,t,r){g(e,(()=>({get readyState(){return z.current?"complete":"loading"},get node(){return _.current}})),[])}(t),x((()=>{j||N(!1)}),[j,N]),y((()=>{const e=_.current;if(!O&&e){const{src:t}=e;(e=>e&&"about:blank"!=e&&!e.includes("#"))(t)?e.src=e.src:e.parentNode.insertBefore(e,e.nextSibling)}}),[O]),x((()=>{const e=_.current;if(!e||!j)return;const t=e=>{const t=_.current;t&&e.source==t.contentWindow&&u(e.origin)&&p(e)},{defaultView:r}=e.ownerDocument;return r.addEventListener("message",t),()=>r.removeEventListener("message",t)}),[u,p,j,d]),v(D,r(r({},b),{},{layout:!0,size:!0,paint:!0}),j&&d&&v("iframe",{allow:a,allowFullScreen:o,allowTransparency:l,frameborder:"0",loading:P,name:s,onLoad:()=>N(!0),part:"iframe",ref:_,sandbox:w,scrolling:"no",src:h,style:r(r({},i),{},{width:"100%",height:"100%",contentVisibility:"auto"}),title:c}))}));H.displayName="IframeEmbed";var T=self.AMP_CONFIG||{},k=("string"==typeof T.thirdPartyFrameRegex?new RegExp(T.thirdPartyFrameRegex):T.thirdPartyFrameRegex,("string"==typeof T.cdnProxyRegex?new RegExp(T.cdnProxyRegex):T.cdnProxyRegex)||/^https:\/\/([a-zA-Z0-9_-]+\.)?cdn\.ampproject\.org$/);function q(e){if(!self.document||!self.document.head)return null;if(self.location&&k.test(self.location.origin))return null;const t=self.document.head.querySelector(`meta[name="${e}"]`);return t&&t.getAttribute("content")||null}T.thirdPartyUrl,T.thirdPartyFrameHost,T.cdnUrl||q("runtime-host"),T.errorReportingUrl,T.betaErrorReportingUrl,T.localDev,T.geoApiUrl||q("amp-geo-api"),self.__AMP_LOG=self.__AMP_LOG||{user:null,dev:null,userForEmbed:null},self.__AMP_LOG;var V=["captioned","requestResize","shortcode","title"],B=l(),J=e=>"https://www.instagram.com"===e,W=N((function(e,t){let{captioned:a,requestResize:o,shortcode:i,title:s="Instagram"}=e,c=n(e,V);const[u,p]=P(B),[d,f]=P(0),m=R((e=>{const t=(r=function(e){return e.data}(e),JSON.parse(r));var r;if("MEASURE"==t.type&&t.details){const e=t.details.height;o&&o(e),p(l({"height":e})),f(1)}}),[o]);return v(H,r({allowTransparency:!0,iframeStyle:{opacity:d},matchesMessagingOrigin:J,messageHandler:m,ref:t,src:"https://www.instagram.com/p/"+encodeURIComponent(i)+"/embed/"+(a?"captioned/":"")+"?cr=1&v=12",title:s,wrapperStyle:u},c))}));W.displayName="Instagram";export{W as Instagram}; | ||
function e(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function t(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function r(r){for(var n=1;n<arguments.length;n++){var a=null!=arguments[n]?arguments[n]:{};n%2?t(Object(a),!0).forEach((function(t){e(r,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(a)):t(Object(a)).forEach((function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(a,e))}))}return r}function n(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}var{hasOwnProperty:a,toString:o}=Object.prototype;function l(e){return e||{}}import{cloneElement as i,createContext as s,createElement as c,createRef as u}from"react";import{hydrate as p,render as d}from"react-dom";import{useCallback as f,useContext as m,useEffect as y,useImperativeHandle as g,useLayoutEffect as w,useMemo as h,useRef as b,useState as O}from"react";function v(e,t,r){return c.apply(void 0,arguments)}function P(e){return O(e)}function S(e){return b(e)}function x(e,t){w(e,t)}function R(e,t){return f(e,t)}import{Children as j,createPortal as z,forwardRef as E}from"react";function N(e){return E(e)}var _=["as","children","class","contentAs","contentClassName","contentProps","contentRef","contentStyle","layout","paint","size","style","wrapperClassName","wrapperStyle"],A=[null,"paint","layout","content","size","size paint","size layout","strict"],F={"position":"relative","width":"100%","height":"100%"},M=N((function(e,t){let{as:a="div",children:o,"class":l,contentAs:i="div",contentClassName:s,contentProps:c,contentRef:u,contentStyle:p,layout:d=!1,paint:f=!1,size:m=!1,"style":y,wrapperClassName:g,wrapperStyle:w}=e;const h=(m?4:0)+(d?2:0)+(f?1:0);return v(a,r(r({},n(e,_)),{},{ref:t,class:`${l||""} ${g||""}`.trim()||null,style:r(r(r({},y),w),{},{contain:A[h]})}),v(i,r(r({},c),{},{ref:u,class:s,style:r(r({},m&&F),{},{"overflow":f?"hidden":"visible"},p)}),o))})),C=["as","children","class","style","wrapperClassName","wrapperStyle"];function L(e){const t=S(null);return t.current=e,t}N((function(e,t){let{as:a="div",children:o,"class":l,"style":i,wrapperClassName:s,wrapperStyle:c}=e;return v(a,r(r({},n(e,C)),{},{ref:t,class:`${l||""} ${s||""}`.trim()||null,style:r(r({},i),c)}),o)}));var U,D=["auto","lazy","eager","unload"],$={auto:0,lazy:1,eager:2,unload:3};function I(){const e=U||(U=s({renderable:!0,playable:!0,loading:"auto"},void 0));return m(e)}var G=["allow","allowFullScreen","allowTransparency","iframeStyle","name","title","matchesMessagingOrigin","messageHandler","ready","loading","onReadyState","sandbox","src"],H=()=>!1,T=N((function(e,t){let{allow:a,allowFullScreen:o,allowTransparency:l,iframeStyle:i,name:s,title:c,matchesMessagingOrigin:u=H,messageHandler:p,ready:d=!0,loading:f,onReadyState:m,sandbox:w,src:h}=e,b=n(e,G);const{playable:O}=I(),P=function(e){const{loading:t}=I();return function(e,t){const r=$[e]||0,n=$[t]||0,a=Math.max(r,n);return D[a]}(e,t)}(f),j="unload"!==P,z=S(!1),E=L(m),N=R((e=>{if(e!==z.current){z.current=e;const t=E.current;null==t||t(e?"complete":"loading")}}),[E]),_=S(null);return function(e,t,r){g(e,(()=>({get readyState(){return z.current?"complete":"loading"},get node(){return _.current}})),[])}(t),x((()=>{j||N(!1)}),[j,N]),y((()=>{const e=_.current;if(!O&&e){const{src:t}=e;(e=>e&&"about:blank"!=e&&!e.includes("#"))(t)?e.src=e.src:e.parentNode.insertBefore(e,e.nextSibling)}}),[O]),x((()=>{const e=_.current;if(!e||!j)return;const t=e=>{const t=_.current;t&&e.source==t.contentWindow&&u(e.origin)&&p(e)},{defaultView:r}=e.ownerDocument;return r.addEventListener("message",t),()=>r.removeEventListener("message",t)}),[u,p,j,d]),v(M,r(r({},b),{},{layout:!0,size:!0,paint:!0}),j&&d&&v("iframe",{allow:a,allowFullScreen:o,allowTransparency:l,frameborder:"0",loading:P,name:s,onLoad:()=>N(!0),part:"iframe",ref:_,sandbox:w,scrolling:"no",src:h,style:r(r({},i),{},{width:"100%",height:"100%",contentVisibility:"auto"}),title:c}))}));T.displayName="IframeEmbed";var k=self.AMP_CONFIG||{},q=("string"==typeof k.thirdPartyFrameRegex?new RegExp(k.thirdPartyFrameRegex):k.thirdPartyFrameRegex,("string"==typeof k.cdnProxyRegex?new RegExp(k.cdnProxyRegex):k.cdnProxyRegex)||/^https:\/\/([a-zA-Z0-9_-]+\.)?cdn\.ampproject\.org$/);function V(e){if(!self.document||!self.document.head)return null;if(self.location&&q.test(self.location.origin))return null;const t=self.document.head.querySelector(`meta[name="${e}"]`);return t&&t.getAttribute("content")||null}k.thirdPartyUrl,k.thirdPartyFrameHost,k.cdnUrl||V("runtime-host"),k.errorReportingUrl,k.betaErrorReportingUrl,k.localDev,k.geoApiUrl||V("amp-geo-api"),self.__AMP_LOG=self.__AMP_LOG||{user:null,dev:null,userForEmbed:null},self.__AMP_LOG;var B=["captioned","onLoad","requestResize","shortcode","title"],J=l(),W=e=>"https://www.instagram.com"===e,Z=N((function(e,t){let{captioned:a,onLoad:o,requestResize:i,shortcode:s,title:c="Instagram"}=e,u=n(e,B);const[p,d]=P(J),[f,m]=P(0),y=L(o),g=R((e=>{const t=(r=function(e){return e.data}(e),JSON.parse(r));var r;if("MEASURE"==t.type&&t.details){var n;const e=t.details.height;i&&i(e),d(l({"height":e})),m(1),null===(n=y.current)||void 0===n||n.call(y)}}),[i,y]);return v(T,r({allowTransparency:!0,iframeStyle:{opacity:f},matchesMessagingOrigin:W,messageHandler:g,ref:t,src:"https://www.instagram.com/p/"+encodeURIComponent(s)+"/embed/"+(a?"captioned/":"")+"?cr=1&v=12",title:c,wrapperStyle:p},u))}));Z.displayName="Instagram";export{Z as BentoInstagram}; | ||
/*! https://mths.be/cssescape v1.5.1 by @mathias | MIT license */ |
{ | ||
"name": "@ampproject/amp-instagram", | ||
"version": "1.2108280007.0", | ||
"version": "1.2108280007.1", | ||
"description": "AMP HTML amp-instagram Component", | ||
@@ -5,0 +5,0 @@ "author": "The AMP HTML Authors", |
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
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
434421
2078