@ampproject/amp-instagram
Advanced tools
Comparing version 1.2109100544.0 to 1.2109102127.0
@@ -1,3 +0,2 @@ | ||
; | ||
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,{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,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 Wrapper=forwardRef2(WrapperWithRef);function useValueRef(e){var t=useRef2(null);return t.current=e,t}var _MAP,viewportObservers=new WeakMap,viewportCallbacks=new WeakMap,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 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,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","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,a=e.requestResize,o=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;a&&a(n),d(dict({"height":n})),_(1),null===(r=y.current)||void 0===r||r.call(y)}}),[a,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(o)+"/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 */ |
@@ -1,3 +0,2 @@ | ||
; | ||
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 M(e){return E(e)}var N=["as","children","class","contentAs","contentClassName","contentProps","contentRef","contentStyle","layout","paint","size","style","wrapperClassName","wrapperStyle"],_=[null,"paint","layout","content","size","size paint","size layout","strict"],A={"position":"relative","width":"100%","height":"100%"},F=M((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,N)),{},{ref:t,class:`${l||""} ${g||""}`.trim()||null,style:r(r(r({},y),w),{},{contain:_[h]})}),v(i,r(r({},c),{},{ref:u,class:s,style:r(r({},m&&A),{},{"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}M((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)})),new WeakMap,new WeakMap;var U,k=["auto","lazy","eager","unload"],D={auto:0,lazy:1,eager:2,unload:3};function $(){const e=U||(U=s({renderable:!0,playable:!0,loading:"auto"},void 0));return m(e)}var I=["allow","allowFullScreen","allowTransparency","iframeStyle","name","title","matchesMessagingOrigin","messageHandler","ready","loading","onReadyState","sandbox","src"],G=()=>!1,H=M((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=D[e]||0,n=D[t]||0,a=Math.max(r,n);return k[a]}(e,t)}(f),j="unload"!==P,z=S(!1),E=L(m),M=R((e=>{if(e!==z.current){z.current=e;const t=E.current;null==t||t(e?"complete":"loading")}}),[E]),N=S(null);return function(e,t,r){g(e,(()=>({get readyState(){return z.current?"complete":"loading"},get node(){return N.current}})),[])}(t),x((()=>{j||M(!1)}),[j,M]),y((()=>{const e=N.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=N.current;if(!e||!j)return;const t=e=>{const t=N.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(F,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:()=>M(!0),part:"iframe",ref:N,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 W(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||W("runtime-host"),T.errorReportingUrl,T.betaErrorReportingUrl,T.localDev,T.geoApiUrl||W("amp-geo-api"),self.__AMP_LOG=self.__AMP_LOG||{user:null,dev:null,userForEmbed:null},self.__AMP_LOG;var V=["captioned","onLoad","requestResize","shortcode","title"],B=l(),J=e=>"https://www.instagram.com"===e,Z=M((function(e,t){let{captioned:a,onLoad:o,requestResize:i,shortcode:s,title:c="Instagram"}=e,u=n(e,V);const[p,d]=P(B),[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:J,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 */ |
@@ -1,3 +0,2 @@ | ||
; | ||
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,{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,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 Wrapper=forwardRef2(WrapperWithRef);function useValueRef(e){var t=useRef2(null);return t.current=e,t}var _MAP,viewportObservers=new WeakMap,viewportCallbacks=new WeakMap,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 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,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","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,a=e.requestResize,o=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;a&&a(n),d(dict({"height":n})),_(1),null===(r=y.current)||void 0===r||r.call(y)}}),[a,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(o)+"/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 */ |
@@ -1,3 +0,2 @@ | ||
; | ||
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 M(e){return E(e)}var N=["as","children","class","contentAs","contentClassName","contentProps","contentRef","contentStyle","layout","paint","size","style","wrapperClassName","wrapperStyle"],_=[null,"paint","layout","content","size","size paint","size layout","strict"],A={"position":"relative","width":"100%","height":"100%"},F=M((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,N)),{},{ref:t,class:`${l||""} ${g||""}`.trim()||null,style:r(r(r({},y),w),{},{contain:_[h]})}),v(i,r(r({},c),{},{ref:u,class:s,style:r(r({},m&&A),{},{"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}M((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)})),new WeakMap,new WeakMap;var U,D=["auto","lazy","eager","unload"],$={auto:0,lazy:1,eager:2,unload:3};function k(){const e=U||(U=s({renderable:!0,playable:!0,loading:"auto"},void 0));return m(e)}var I=["allow","allowFullScreen","allowTransparency","iframeStyle","name","title","matchesMessagingOrigin","messageHandler","ready","loading","onReadyState","sandbox","src"],G=()=>!1,H=M((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}=k(),P=function(e){const{loading:t}=k();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),M=R((e=>{if(e!==z.current){z.current=e;const t=E.current;null==t||t(e?"complete":"loading")}}),[E]),N=S(null);return function(e,t,r){g(e,(()=>({get readyState(){return z.current?"complete":"loading"},get node(){return N.current}})),[])}(t),x((()=>{j||M(!1)}),[j,M]),y((()=>{const e=N.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=N.current;if(!e||!j)return;const t=e=>{const t=N.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(F,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:()=>M(!0),part:"iframe",ref:N,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 W(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||W("runtime-host"),T.errorReportingUrl,T.betaErrorReportingUrl,T.localDev,T.geoApiUrl||W("amp-geo-api"),self.__AMP_LOG=self.__AMP_LOG||{user:null,dev:null,userForEmbed:null},self.__AMP_LOG;var V=["captioned","onLoad","requestResize","shortcode","title"],B=l(),J=e=>"https://www.instagram.com"===e,Z=M((function(e,t){let{captioned:a,onLoad:o,requestResize:i,shortcode:s,title:c="Instagram"}=e,u=n(e,V);const[p,d]=P(B),[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:J,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.2109100544.0", | ||
"version": "1.2109102127.0", | ||
"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
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
453213
2086