@ampproject/amp-accordion
Advanced tools
Comparing version 1.2104150129.0 to 1.2105242203.0
@@ -1,3 +0,3 @@ | ||
var Be=Object.create,Z=Object.defineProperty,er=Object.getPrototypeOf,rr=Object.prototype.hasOwnProperty,tr=Object.getOwnPropertyNames,nr=Object.getOwnPropertyDescriptor,be=function(e){return Z(e,"__esModule",{value:!0})},or=function(e,r){for(var n in r)Z(e,n,{get:r[n],enumerable:!0})},ar=function(e,r,n){if(r&&"object"==typeof r||"function"==typeof r)for(var t,o=tr(r),i=0,a=o.length;i<a;i++)t=o[i],!rr.call(e,t)&&"default"!==t&&Z(e,t,{get:function(e){return r[e]}.bind(null,t),enumerable:!(n=nr(r,t))||n.enumerable});return e},Q=function(e){return ar(be(Z(null!=e?Be(er(e)):{},"default",e&&e.__esModule&&"default"in e?{get:function(){return e.default},enumerable:!0}:{value:e,enumerable:!0})),e)};be(exports),or(exports,{Accordion:function(){return Qe},AccordionContent:function(){return Mr},AccordionHeader:function(){return Cr},AccordionSection:function(){return Ir}});var K,J="section-child-00fce3c",Oe="header-00fce3c",Re="content-hidden-00fce3c";function B(){return K||(K=Promise.resolve(void 0))}var U,v=Q(require("preact/hooks")),L=Q(require("preact")),Pe=Q(require("preact"));function C(e,r,n){return L.createElement.apply(void 0,arguments)}function H(e){return L.createContext(e)}function N(e){return v.useState(e)}function V(e){return v.useRef(e)}function fe(e,r){v.useEffect(e,r)}function Y(e,r){v.useLayoutEffect(e,r)}function D(e){return v.useContext(e)}function G(e,r){return v.useMemo(e,r)}function T(e,r){return v.useCallback(e,r)}function Se(e,r,n){return v.useImperativeHandle(e,r,n)}function ee(e,r,n){return r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}var Ce,b={AUTO:"auto",LAZY:"lazy",EAGER:"eager",UNLOAD:"unload"},ir=[b.AUTO,b.LAZY,b.EAGER,b.UNLOAD],Ie=(ee(U={},b.AUTO,0),ee(U,b.LAZY,1),ee(U,b.EAGER,2),ee(U,b.UNLOAD,3),U);function le(e,r){var n=Ie[e]||0,t=Ie[r]||0,o=Math.max(n,t);return ir[o]}function Me(){return Ce||(Ce=H({renderable:!0,playable:!0,loading:b.AUTO}))}function we(e){var r=e.renderable,n=void 0===r||r,t=e.playable,o=void 0===t||t,i=e.loading,a=void 0===i?"auto":i,c=e.notify,u=e.children,l=sr(),f=n&&l.renderable,d=f&&o&&l.playable,s=le(f?b.AUTO:b.LAZY,le(a,l.loading)),v=c||l.notify,p=G((function(){return{renderable:f,playable:d,loading:s,notify:v}}),[f,d,s,v]);return C(Me().Provider,{children:u,value:p})}function sr(){return D(Me())}var ur=Array.isArray,y=self.AMP_CONFIG||{},lr=("string"==typeof y.thirdPartyFrameRegex?new RegExp(y.thirdPartyFrameRegex):y.thirdPartyFrameRegex)||/^d-\d+\.ampproject\.net$/,Ne=("string"==typeof y.cdnProxyRegex?new RegExp(y.cdnProxyRegex):y.cdnProxyRegex)||/^https:\/\/([a-zA-Z0-9_-]+\.)?cdn\.ampproject\.org$/;function Te(e){if(!self.document||!self.document.head||self.location&&Ne.test(self.location.origin))return null;var r=self.document.head.querySelector('meta[name="'.concat(e,'"]'));return r&&r.getAttribute("content")||null}var dr={thirdParty:y.thirdPartyUrl||"https://3p.ampproject.net",thirdPartyFrameHost:y.thirdPartyFrameHost||"ampproject.net",thirdPartyFrameRegex:lr,cdn:y.cdnUrl||Te("runtime-host")||"https://cdn.ampproject.org",cdnProxyRegex:Ne,localhostRegex:/^https?:\/\/localhost(:\d+)?$/,errorReporting:y.errorReportingUrl||"https://us-central1-amp-error-reporting.cloudfunctions.net/r",betaErrorReporting:y.betaErrorReportingUrl||"https://us-central1-amp-error-reporting.cloudfunctions.net/r-beta",localDev:y.localDev||!1,trustedViewerHosts:[/(^|\.)google\.(com?|[a-z]{2}|com?\.[a-z]{2}|cat)$/,/(^|\.)gmail\.(com|dev)$/],geoApi:y.geoApiUrl||Te("amp-geo-api")};self.__AMP_LOG=self.__AMP_LOG||{user:null,dev:null,userForEmbed:null};var Ot=self.__AMP_LOG;function Le(e){var r=Object.create(null);return e&&Object.assign(r,e),r}function de(e,r){return Object.keys(e).reduce((function(n,t){return r.includes(t)||(n[t]=e[t]),n}),{})}var re,Fe=["Webkit","webkit","Moz","moz","ms","O","o"];function pr(e){return e.charAt(0).toUpperCase()+e.slice(1)}function vr(e,r){for(var n=0;n<Fe.length;n++){var t=Fe[n]+r;if(void 0!==e[t])return t}return""}function je(e,r,n){if(pe(r))return r;re||(re=Le());var t=re[r];if(!t||n){if(t=r,void 0===e[r]){var o=vr(e,pr(r));void 0!==e[o]&&(t=o)}n||(re[r]=t)}return t}function mr(e,r,n,t,o){var i=je(e.style,r,o);if(i){var a=t?n+t:n;pe(i)?e.style.setProperty(i,a):e.style[i]=a}}function te(e,r,n){var t=je(e.style,r,n);if(t)return pe(t)?e.style.getPropertyValue(t):e.style[t]}function ve(e,r){for(var n in r)mr(e,n,r[n])}function pe(e){return e.startsWith("--")}var De=500,gr=200,hr="cubic-bezier(0.47, 0, 0.745, 0.715)",xr="cubic-bezier(0.39, 0.575, 0.565, 1)";function ke(e){return Ue(e,(function(){var r=te(e,"height"),n=te(e,"opacity"),t=te(e,"overflowY");ve(e,{height:0,opacity:0,overflowY:"auto"});var o=e.scrollHeight;ve(e,{height:r,opacity:n,overflowY:t});var i=$e(o);return e.animate([{height:0,opacity:0,overflowY:"hidden"},{height:o+"px",opacity:1,overflowY:"hidden"}],{easing:hr,duration:i})}))}function He(e){return Ue(e,(function(){var r=e.offsetHeight,n=$e(r);return e.animate([{height:r+"px",opacity:1,overflowY:"hidden"},{height:"0",opacity:0,overflowY:"hidden"}],{easing:xr,duration:n})}))}function Ue(e,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;e.classList.add("i-amphtml-animating");var t=r();return t.onfinish=t.oncancel=function(){t=null,n&&n(),e.classList.remove("i-amphtml-animating")},function(){t&&t.cancel()}}function $e(e){var r=window.innerHeight,n=Math.abs(e)/r*De;return Math.min(Math.max(n,gr),De)}var ne=Q(require("preact/compat"));function Ve(e){return ne.forwardRef(e)}function Ye(){var e=0;return function(){return String(++e)}}function Ge(e){return function(){return String(Math.floor(Math.random()*e))}}function We(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r&&(t=t.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),n.push.apply(n,t)}return n}function P(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?We(Object(n),!0).forEach((function(r){oe(e,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):We(Object(n)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))}))}return e}function oe(e,r,n){return r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function F(e,r){return Ar(e)||Er(e,r)||_r(e,r)||yr()}function yr(){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 _r(e,r){if(e){if("string"==typeof e)return ze(e,r);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ze(e,r)}}function ze(e,r){(null==r||r>e.length)&&(r=e.length);for(var n=0,t=new Array(r);n<r;n++)t[n]=e[n];return t}function Er(e,r){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var n=[],t=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(t=(a=c.next()).done)&&(n.push(a.value),!r||n.length!==r);t=!0);}catch(e){o=!0,i=e}finally{try{!t&&null!=c.return&&c.return()}finally{if(o)throw i}}return n}}function Ar(e){if(Array.isArray(e))return e}function ae(e,r){if(null==e)return{};var n,t,o=br(e,r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(t=0;t<i.length;t++)n=i[t],!(r.indexOf(n)>=0)&&(!Object.prototype.propertyIsEnumerable.call(e,n)||(o[n]=e[n]))}return o}function br(e,r){if(null==e)return{};var n,t,o={},i=Object.keys(e);for(t=0;t<i.length;t++)n=i[t],!(r.indexOf(n)>=0)&&(o[n]=e[n]);return o}var qe=H({}),me=H({}),Or={},Rr={},Pr=Ye(),Xe=Ge(1e5);function Sr(e,r){var n=e.as,t=void 0===n?"section":n,o=e.expandSingleSection,i=void 0!==o&&o,a=e.animate,c=void 0!==a&&a,u=e.children,l=e.id,f=ae(e,["as","expandSingleSection","animate","children","id"]),d=F(N(Or),2),s=d[0],v=d[1],p=V(Rr),y=F(N(Xe),1)[0],b=l||"a".concat(y);fe((function(){!i||v((function(e){var r={},n=0;for(var t in e)r[t]=e[t]&&0==n++;return r}))}),[i]);var g=T((function(e,r,n){var t=n.current;return v((function(n){return Ze(e,r,n,i)})),p.current=P(P({},p.current),{},oe({},e,t)),function(){v((function(r){return de(r,e)})),p.current=de(p.current,e)}}),[i]),h=T((function(e,r){v((function(n){var t=null!=r?r:!n[e],o=Ze(e,t,n,i);return B().then((function(){for(var e in n){var r=p.current[e];r&&n[e]!=o[e]&&r(o[e])}})),o}))}),[i]),m=T((function(e,r){var n;return null!==(n=s[e])&&void 0!==n?n:r}),[s]),O=T((function(e){if(e)e in s&&h(e);else if(!i)for(var r in s)h(r)}),[s,h,i]),x=T((function(e){if(e)m(e,!0)||h(e);else if(!i)for(var r in s)m(r,!0)||h(r)}),[s,h,m,i]),j=T((function(e){if(e)m(e,!1)&&h(e);else for(var r in s)m(r,!1)&&h(r)}),[s,h,m]);Se(r,(function(){return{toggle:O,expand:x,collapse:j}}),[O,j,x]);var A=G((function(){return{registerSection:g,toggleExpanded:h,isExpanded:m,animate:c,prefix:b}}),[g,h,m,c,b]);return C(t,P({id:l},f),C(qe.Provider,{value:A},u))}var Qe=Ve(Sr);function Ze(e,r,n,t){var o;if(t&&r)for(var i in o=oe({},e,r),n)i!=e&&(o[i]=!1);else o=P(P({},n),{},oe({},e,r));return o}function Ir(e){var r=e.as,n=void 0===r?"section":r,t=e.expanded,o=void 0!==t&&t,i=e.animate,a=void 0!==i&&i,c=e.id,u=e.children,l=e.onExpandStateChange,f=ae(e,["as","expanded","animate","id","children","onExpandStateChange"]),d=F(N(Pr),1)[0],s=c||d,v=F(N(Xe),1)[0],p=F(N(o),2),y=p[0],b=p[1],g=F(N(null),2),h=g[0],m=g[1],O=F(N(null),2),x=O[0],j=O[1],A=D(qe),w=A.registerSection,S=A.animate,E=A.isExpanded,I=A.toggleExpanded,R=A.prefix,U=E?E(s,o):y,M=null!=S?S:a,H=h||"".concat(R||"a","-content-").concat(s,"-").concat(v),L=x||"".concat(R||"a","-header-").concat(s,"-").concat(v),_=V(null);_.current=l,Y((function(){if(w)return w(s,o,_)}),[w,s,o]);var Z=T((function(e){I?I(s,e):b((function(r){var n=null!=e?e:!r;return B().then((function(){var e=_.current;e&&e(n)})),n}))}),[s,I]),z=G((function(){return{animate:M,contentId:H,headerId:L,expanded:U,toggleHandler:Z,setContentId:m,setHeaderId:j}}),[M,H,L,U,Z]);return C(n,P(P({},f),{},{expanded:U}),C(me.Provider,{value:z},u))}function Cr(e){var r=e.as,n=void 0===r?"div":r,t=e.role,o=void 0===t?"button":t,i=e.className,a=void 0===i?"":i,c=e.tabIndex,u=void 0===c?0:c,l=e.id,f=e.children,d=ae(e,["as","role","className","tabIndex","id","children"]),s=D(me),v=s.contentId,p=s.headerId,y=s.expanded,b=s.toggleHandler,g=s.setHeaderId;return Y((function(){g&&g(l)}),[g,l]),C(n,P(P({},d),{},{id:p,role:o,className:"".concat(a," ").concat(J," ").concat(Oe),tabIndex:u,"aria-controls":v,onClick:function(){return b()},"aria-expanded":String(y)}),f)}function Mr(e){var r=e.as,n=void 0===r?"div":r,t=e.role,o=void 0===t?"region":t,i=e.className,a=void 0===i?"":i,c=e.id,u=e.children,l=ae(e,["as","role","className","id","children"]),f=V(null),d=V(!1),s=D(me),v=s.contentId,p=s.headerId,y=s.expanded,b=s.animate,g=s.setContentId;return fe((function(){return d.current=!0,function(){return d.current=!1}}),[]),Y((function(){g&&g(c)}),[g,c]),Y((function(){var e=d.current,r=f.current;if(b&&e&&r&&r.animate)return y?ke(r):He(r)}),[y,b]),C(we,{renderable:y},C(n,P(P({},l),{},{ref:f,className:a+(" "+J)+(y?"":" "+Re),id:v,"aria-labelledby":p,role:o}),u))} | ||
var rr=Object.create,Q=Object.defineProperty,tr=Object.getOwnPropertyDescriptor,nr=Object.getOwnPropertyNames,or=Object.getPrototypeOf,ar=Object.prototype.hasOwnProperty,Oe=function(e){return Q(e,"__esModule",{value:!0})},ir=function(e,r){for(var n in r)Q(e,n,{get:r[n],enumerable:!0})},ur=function(e,r,n){if(r&&"object"==typeof r||"function"==typeof r)for(var t,o=nr(r),i=0,a=o.length;i<a;i++)t=o[i],!ar.call(e,t)&&"default"!==t&&Q(e,t,{get:function(e){return r[e]}.bind(null,t),enumerable:!(n=tr(r,t))||n.enumerable});return e},q=function(e){return ur(Oe(Q(null!=e?rr(or(e)):{},"default",e&&e.__esModule&&"default"in e?{get:function(){return e.default},enumerable:!0}:{value:e,enumerable:!0})),e)};Oe(exports),ir(exports,{Accordion:function(){return Je},AccordionContent:function(){return Nr},AccordionHeader:function(){return Tr},AccordionSection:function(){return Mr}});var B,J="section-child-00fce3c",Re="header-00fce3c",Pe="content-hidden-00fce3c";function K(){return B||(B=Promise.resolve(void 0))}var U,v=q(require("preact/hooks")),F=q(require("preact")),Ie=q(require("preact"));function w(e,r,n){return F.createElement.apply(void 0,arguments)}function V(e){return F.createContext(e,void 0)}function M(e){return v.useState(e)}function k(e){return v.useRef(e)}function le(e,r){v.useEffect(e,r)}function Y(e,r){v.useLayoutEffect(e,r)}function D(e){return v.useContext(e)}function G(e,r){return v.useMemo(e,r)}function T(e,r){return v.useCallback(e,r)}function we(e,r,n){return v.useImperativeHandle(e,r,n)}function ee(e,r,n){return r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}var Me,A={AUTO:"auto",LAZY:"lazy",EAGER:"eager",UNLOAD:"unload"},sr=[A.AUTO,A.LAZY,A.EAGER,A.UNLOAD],Ce=(ee(U={},A.AUTO,0),ee(U,A.LAZY,1),ee(U,A.EAGER,2),ee(U,A.UNLOAD,3),U);function de(e,r){var n=Ce[e]||0,t=Ce[r]||0,o=Math.max(n,t);return sr[o]}function Te(){return Me||(Me=V({renderable:!0,playable:!0,loading:A.AUTO}))}function Ne(e){var r=e.children,n=e.loading,t=void 0===n?"auto":n,o=e.notify,i=e.playable,a=void 0===i||i,c=e.renderable,u=void 0===c||c,l=cr(),f=u&&l.renderable,d=f&&a&&l.playable,s=de(f?A.AUTO:A.LAZY,de(t,l.loading)),v=o||l.notify,p=G((function(){return{renderable:f,playable:d,loading:s,notify:v}}),[f,d,s,v]);return w(Te().Provider,{children:r,value:p})}function cr(){return D(Te())}var pe=Array.isArray,Fe=Object.prototype,zr=Fe.hasOwnProperty,Xr=Fe.toString;function me(e){var r=Object.create(null);return e&&Object.assign(r,e),r}function ve(e,r){return Object.keys(e).reduce((function(n,t){return r.includes(t)||(n[t]=e[t]),n}),{})}var b=self.AMP_CONFIG||{},mr=("string"==typeof b.thirdPartyFrameRegex?new RegExp(b.thirdPartyFrameRegex):b.thirdPartyFrameRegex)||/^d-\d+\.ampproject\.net$/,je=("string"==typeof b.cdnProxyRegex?new RegExp(b.cdnProxyRegex):b.cdnProxyRegex)||/^https:\/\/([a-zA-Z0-9_-]+\.)?cdn\.ampproject\.org$/;function Le(e){if(!self.document||!self.document.head||self.location&&je.test(self.location.origin))return null;var r=self.document.head.querySelector('meta[name="'.concat(e,'"]'));return r&&r.getAttribute("content")||null}var vr={thirdParty:b.thirdPartyUrl||"https://3p.ampproject.net",thirdPartyFrameHost:b.thirdPartyFrameHost||"ampproject.net",thirdPartyFrameRegex:mr,cdn:b.cdnUrl||Le("runtime-host")||"https://cdn.ampproject.org",cdnProxyRegex:je,localhostRegex:/^https?:\/\/localhost(:\d+)?$/,errorReporting:b.errorReportingUrl||"https://us-central1-amp-error-reporting.cloudfunctions.net/r",betaErrorReporting:b.betaErrorReportingUrl||"https://us-central1-amp-error-reporting.cloudfunctions.net/r-beta",localDev:b.localDev||!1,trustedViewerHosts:[/(^|\.)google\.(com?|[a-z]{2}|com?\.[a-z]{2}|cat)$/,/(^|\.)gmail\.(com|dev)$/],geoApi:b.geoApiUrl||Le("amp-geo-api")};self.__AMP_LOG=self.__AMP_LOG||{user:null,dev:null,userForEmbed:null};var re,Gt=self.__AMP_LOG,De=["Webkit","webkit","Moz","moz","ms","O","o"];function gr(e){return e.charAt(0).toUpperCase()+e.slice(1)}function hr(e,r){for(var n=0;n<De.length;n++){var t=De[n]+r;if(void 0!==e[t])return t}return""}function Ue(e,r,n){if(he(r))return r;re||(re=me());var t=re[r];if(!t||n){if(t=r,void 0===e[r]){var o=hr(e,gr(r));void 0!==e[o]&&(t=o)}n||(re[r]=t)}return t}function xr(e,r,n,t,o){var i=Ue(e.style,r,o);if(i){var a=t?n+t:n;he(i)?e.style.setProperty(i,a):e.style[i]=a}}function te(e,r,n){var t=Ue(e.style,r,n);if(t)return he(t)?e.style.getPropertyValue(t):e.style[t]}function ge(e,r){for(var n in r)xr(e,n,r[n])}function he(e){return e.startsWith("--")}var $e=500,yr=200,br="cubic-bezier(0.47, 0, 0.745, 0.715)",Er="cubic-bezier(0.39, 0.575, 0.565, 1)";function He(e){return ke(e,(function(){var r=te(e,"height"),n=te(e,"opacity"),t=te(e,"overflowY");ge(e,{height:0,opacity:0,overflowY:"auto"});var o=e.scrollHeight;ge(e,{height:r,opacity:n,overflowY:t});var i=Ye(o);return e.animate([{height:0,opacity:0,overflowY:"hidden"},{height:o+"px",opacity:1,overflowY:"hidden"}],{easing:br,duration:i})}))}function Ve(e){return ke(e,(function(){var r=e.offsetHeight,n=Ye(r);return e.animate([{height:r+"px",opacity:1,overflowY:"hidden"},{height:"0",opacity:0,overflowY:"hidden"}],{easing:Er,duration:n})}))}function ke(e,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;e.classList.add("i-amphtml-animating");var t=r();return t.onfinish=t.oncancel=function(){t=null,n&&n(),e.classList.remove("i-amphtml-animating")},function(){t&&t.cancel()}}function Ye(e){var r=window.innerHeight,n=Math.abs(e)/r*$e;return Math.min(Math.max(n,yr),$e)}var ne=q(require("preact/compat"));function Ge(e){return ne.forwardRef(e)}function We(){var e=0;return function(){return String(++e)}}function ze(e){return function(){return String(Math.floor(Math.random()*e))}}function Xe(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r&&(t=t.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),n.push.apply(n,t)}return n}function O(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?Xe(Object(n),!0).forEach((function(r){oe(e,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Xe(Object(n)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))}))}return e}function oe(e,r,n){return r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function j(e,r){return Or(e)||Sr(e,r)||Ar(e,r)||_r()}function _r(){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 Ar(e,r){if(e){if("string"==typeof e)return Ze(e,r);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ze(e,r)}}function Ze(e,r){(null==r||r>e.length)&&(r=e.length);for(var n=0,t=new Array(r);n<r;n++)t[n]=e[n];return t}function Sr(e,r){var n=e&&("undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null!=n){var t,o,i=[],a=!0,c=!1;try{for(n=n.call(e);!(a=(t=n.next()).done)&&(i.push(t.value),!r||i.length!==r);a=!0);}catch(e){c=!0,o=e}finally{try{!a&&null!=n.return&&n.return()}finally{if(c)throw o}}return i}}function Or(e){if(Array.isArray(e))return e}function ae(e,r){if(null==e)return{};var n,t,o=Rr(e,r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(t=0;t<i.length;t++)n=i[t],!(r.indexOf(n)>=0)&&(!Object.prototype.propertyIsEnumerable.call(e,n)||(o[n]=e[n]))}return o}function Rr(e,r){if(null==e)return{};var n,t,o={},i=Object.keys(e);for(t=0;t<i.length;t++)n=i[t],!(r.indexOf(n)>=0)&&(o[n]=e[n]);return o}var Qe=V({}),xe=V({}),Pr={},Ir={},wr=We(),qe=ze(1e5);function Cr(e,r){var n=e.animate,t=void 0!==n&&n,o=e.as,i=void 0===o?"section":o,a=e.children,c=e.expandSingleSection,u=void 0!==c&&c,l=e.id,f=ae(e,["animate","as","children","expandSingleSection","id"]),d=j(M(Pr),2),s=d[0],v=d[1],p=k(Ir),g=j(M(qe),1)[0],b=l||"a".concat(g);le((function(){!u||v((function(e){var r={},n=0;for(var t in e)r[t]=e[t]&&0==n++;return r}))}),[u]);var h=T((function(e,r,n){var t=n.current;return v((function(n){return Be(e,r,n,u)})),p.current=O(O({},p.current),{},oe({},e,t)),function(){v((function(r){return ve(r,e)})),p.current=ve(p.current,e)}}),[u]),y=T((function(e,r){v((function(n){var t=null!=r?r:!n[e],o=Be(e,t,n,u);return K().then((function(){for(var e in n){var r=p.current[e];r&&n[e]!=o[e]&&r(o[e])}})),o}))}),[u]),m=T((function(e,r){var n;return null!==(n=s[e])&&void 0!==n?n:r}),[s]),x=T((function(e){if(e)e in s&&y(e);else if(!u)for(var r in s)y(r)}),[s,y,u]),A=T((function(e){if(e)m(e,!0)||y(e);else if(!u)for(var r in s)m(r,!0)||y(r)}),[s,y,m,u]),P=T((function(e){if(e)m(e,!1)&&y(e);else for(var r in s)m(r,!1)&&y(r)}),[s,y,m]);we(r,(function(){return{toggle:x,expand:A,collapse:P}}),[x,P,A]);var E=G((function(){return{registerSection:h,toggleExpanded:y,isExpanded:m,animate:t,prefix:b}}),[h,y,m,t,b]);return w(i,O({id:l},f),w(Qe.Provider,{value:E},a))}var Je=Ge(Cr);function Be(e,r,n,t){var o;if(t&&r)for(var i in o=oe({},e,r),n)i!=e&&(o[i]=!1);else o=O(O({},n),{},oe({},e,r));return o}function Mr(e){var r=e.animate,n=void 0!==r&&r,t=e.as,o=void 0===t?"section":t,i=e.children,a=e.expanded,c=void 0!==a&&a,u=e.id,l=e.onExpandStateChange,f=ae(e,["animate","as","children","expanded","id","onExpandStateChange"]),d=j(M(wr),1)[0],s=u||d,v=j(M(qe),1)[0],p=j(M(c),2),g=p[0],b=p[1],h=j(M(null),2),y=h[0],m=h[1],x=j(M(null),2),A=x[0],P=x[1],E=D(Qe),S=E.animate,R=E.isExpanded,U=E.prefix,I=E.registerSection,C=E.toggleExpanded,_=R?R(s,c):g,L=null!=S?S:n,N=y||"".concat(U||"a","-content-").concat(s,"-").concat(v),F=A||"".concat(U||"a","-header-").concat(s,"-").concat(v),H=k(null);H.current=l,Y((function(){if(I)return I(s,c,H)}),[I,s,c]);var q=T((function(e){C?C(s,e):b((function(r){var n=null!=e?e:!r;return K().then((function(){var e=H.current;e&&e(n)})),n}))}),[s,C]),z=G((function(){return{animate:L,contentId:N,headerId:F,expanded:_,toggleHandler:q,setContentId:m,setHeaderId:P}}),[L,N,F,_,q]);return w(o,O(O({},f),{},{expanded:_}),w(xe.Provider,{value:z},i))}function Tr(e){var r=e.as,n=void 0===r?"div":r,t=e.children,o=e.className,i=void 0===o?"":o,a=e.id,c=e.role,u=void 0===c?"button":c,l=e.tabIndex,f=void 0===l?0:l,d=ae(e,["as","children","className","id","role","tabIndex"]),s=D(xe),v=s.contentId,p=s.expanded,g=s.headerId,b=s.setHeaderId,h=s.toggleHandler;return Y((function(){b&&b(a)}),[b,a]),w(n,O(O({},d),{},{id:g,role:u,className:"".concat(i," ").concat(J," ").concat(Re),tabIndex:f,"aria-controls":v,onClick:function(){return h()},"aria-expanded":String(p)}),t)}function Nr(e){var r=e.as,n=void 0===r?"div":r,t=e.children,o=e.className,i=void 0===o?"":o,a=e.id,c=e.role,u=void 0===c?"region":c,l=ae(e,["as","children","className","id","role"]),f=k(null),d=k(!1),s=D(xe),v=s.animate,p=s.contentId,g=s.expanded,b=s.headerId,h=s.setContentId;return le((function(){return d.current=!0,function(){return d.current=!1}}),[]),Y((function(){h&&h(a)}),[h,a]),Y((function(){var e=d.current,r=f.current;if(v&&e&&r&&r.animate)return g?He(r):Ve(r)}),[g,v]),w(Ne,{renderable:g},w(n,O(O({},l),{},{ref:f,className:i+(" "+J)+(g?"":" "+Pe),id:p,"aria-labelledby":b,role:u}),t))} | ||
//# sourceMappingURL=component-preact.js.map | ||
Qe.displayName="Accordion"; | ||
Je.displayName="Accordion"; |
var __create = Object.create; | ||
var __defProp = Object.defineProperty; | ||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | ||
var __getOwnPropNames = Object.getOwnPropertyNames; | ||
var __getProtoOf = Object.getPrototypeOf; | ||
var __hasOwnProp = Object.prototype.hasOwnProperty; | ||
var __getOwnPropNames = Object.getOwnPropertyNames; | ||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | ||
var __markAsModule = function(target) { | ||
return __defProp(target, "__esModule", {value: true}); | ||
return __defProp(target, "__esModule", { value: true }); | ||
}; | ||
var __export = function(target, all) { | ||
for (var name in all) | ||
__defProp(target, name, {get: all[name], enumerable: true}); | ||
__defProp(target, name, { get: all[name], enumerable: true }); | ||
}; | ||
var __exportStar = function(target, module2, desc) { | ||
var __reExport = function(target, module2, desc) { | ||
if (module2 && typeof module2 === "object" || typeof module2 === "function") | ||
@@ -19,5 +19,5 @@ for (var keys = __getOwnPropNames(module2), i = 0, n = keys.length, key; i < n; i++) { | ||
if (!__hasOwnProp.call(target, key) && key !== "default") | ||
__defProp(target, key, {get: function(k) { | ||
__defProp(target, key, { get: function(k) { | ||
return module2[k]; | ||
}.bind(null, key), enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable}); | ||
}.bind(null, key), enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable }); | ||
} | ||
@@ -27,5 +27,5 @@ return target; | ||
var __toModule = function(module2) { | ||
return __exportStar(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", module2 && module2.__esModule && "default" in module2 ? {get: function() { | ||
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", module2 && module2.__esModule && "default" in module2 ? { get: function() { | ||
return module2.default; | ||
}, enumerable: true} : {value: module2, enumerable: true})), module2); | ||
}, enumerable: true } : { value: module2, enumerable: true })), module2); | ||
}; | ||
@@ -55,3 +55,3 @@ | ||
// src/resolved-promise.js | ||
// src/core/data-structures/promise.js | ||
var resolved; | ||
@@ -74,3 +74,3 @@ function resolvedPromise() { | ||
function createContext2(value) { | ||
return preact.createContext(value); | ||
return preact.createContext(value, void 0); | ||
} | ||
@@ -129,3 +129,3 @@ function useState2(initial) { | ||
function WithAmpContext(_ref) { | ||
var _ref$renderable = _ref.renderable, renderableProp = _ref$renderable === void 0 ? true : _ref$renderable, _ref$playable = _ref.playable, playableProp = _ref$playable === void 0 ? true : _ref$playable, _ref$loading = _ref.loading, loadingProp = _ref$loading === void 0 ? "auto" : _ref$loading, notifyProp = _ref.notify, children = _ref.children; | ||
var children = _ref.children, _ref$loading = _ref.loading, loadingProp = _ref$loading === void 0 ? "auto" : _ref$loading, notifyProp = _ref.notify, _ref$playable = _ref.playable, playableProp = _ref$playable === void 0 ? true : _ref$playable, _ref$renderable = _ref.renderable, renderableProp = _ref$renderable === void 0 ? true : _ref$renderable; | ||
var parent = useAmpContext(); | ||
@@ -158,2 +158,22 @@ var renderable = renderableProp && parent.renderable; | ||
// src/core/types/object/index.js | ||
var _Object$prototype = Object.prototype; | ||
var hasOwn_ = _Object$prototype.hasOwnProperty; | ||
var toString_ = _Object$prototype.toString; | ||
function map(opt_initial) { | ||
var obj = Object.create(null); | ||
if (opt_initial) { | ||
Object.assign(obj, opt_initial); | ||
} | ||
return obj; | ||
} | ||
function omit(o, props) { | ||
return Object.keys(o).reduce(function(acc, key) { | ||
if (!props.includes(key)) { | ||
acc[key] = o[key]; | ||
} | ||
return acc; | ||
}, {}); | ||
} | ||
// src/config.js | ||
@@ -195,19 +215,2 @@ var env = self.AMP_CONFIG || {}; | ||
// src/utils/object.js | ||
function map(opt_initial) { | ||
var obj = Object.create(null); | ||
if (opt_initial) { | ||
Object.assign(obj, opt_initial); | ||
} | ||
return obj; | ||
} | ||
function omit(o, props) { | ||
return Object.keys(o).reduce(function(acc, key) { | ||
if (!props.includes(key)) { | ||
acc[key] = o[key]; | ||
} | ||
return acc; | ||
}, {}); | ||
} | ||
// src/style.js | ||
@@ -367,3 +370,3 @@ var propertyNameCache; | ||
// src/utils/id-generator.js | ||
// src/core/math/id-generator.js | ||
function sequentialIdGenerator() { | ||
@@ -429,3 +432,3 @@ var counter = 0; | ||
function AccordionWithRef(_ref, ref) { | ||
var _ref$as = _ref.as, Comp = _ref$as === void 0 ? "section" : _ref$as, _ref$expandSingleSect = _ref.expandSingleSection, expandSingleSection = _ref$expandSingleSect === void 0 ? false : _ref$expandSingleSect, _ref$animate = _ref.animate, animate2 = _ref$animate === void 0 ? false : _ref$animate, children = _ref.children, id = _ref.id, rest = _objectWithoutPropertiesLoose(_ref, ["as", "expandSingleSection", "animate", "children", "id"]); | ||
var _ref$animate = _ref.animate, animate2 = _ref$animate === void 0 ? false : _ref$animate, _ref$as = _ref.as, Comp = _ref$as === void 0 ? "section" : _ref$as, children = _ref.children, _ref$expandSingleSect = _ref.expandSingleSection, expandSingleSection = _ref$expandSingleSect === void 0 ? false : _ref$expandSingleSect, id = _ref.id, rest = _objectWithoutPropertiesLoose(_ref, ["animate", "as", "children", "expandSingleSection", "id"]); | ||
var _useState = useState2(EMPTY_EXPANDED_MAP), expandedMap = _useState[0], setExpandedMap = _useState[1]; | ||
@@ -563,3 +566,3 @@ var eventMapRef = useRef2(EMPTY_EVENT_MAP); | ||
function AccordionSection(_ref3) { | ||
var _ref3$as = _ref3.as, Comp = _ref3$as === void 0 ? "section" : _ref3$as, _ref3$expanded = _ref3.expanded, defaultExpanded = _ref3$expanded === void 0 ? false : _ref3$expanded, _ref3$animate = _ref3.animate, defaultAnimate = _ref3$animate === void 0 ? false : _ref3$animate, propId = _ref3.id, children = _ref3.children, onExpandStateChange = _ref3.onExpandStateChange, rest = _objectWithoutPropertiesLoose(_ref3, ["as", "expanded", "animate", "id", "children", "onExpandStateChange"]); | ||
var _ref3$animate = _ref3.animate, defaultAnimate = _ref3$animate === void 0 ? false : _ref3$animate, _ref3$as = _ref3.as, Comp = _ref3$as === void 0 ? "section" : _ref3$as, children = _ref3.children, _ref3$expanded = _ref3.expanded, defaultExpanded = _ref3$expanded === void 0 ? false : _ref3$expanded, propId = _ref3.id, onExpandStateChange = _ref3.onExpandStateChange, rest = _objectWithoutPropertiesLoose(_ref3, ["animate", "as", "children", "expanded", "id", "onExpandStateChange"]); | ||
var _useState3 = useState2(generateSectionId), genId = _useState3[0]; | ||
@@ -571,3 +574,3 @@ var id = propId || genId; | ||
var _useState7 = useState2(null), headerIdState = _useState7[0], setHeaderIdState = _useState7[1]; | ||
var _useContext = useContext2(AccordionContext), registerSection = _useContext.registerSection, contextAnimate = _useContext.animate, isExpanded = _useContext.isExpanded, toggleExpanded = _useContext.toggleExpanded, prefix = _useContext.prefix; | ||
var _useContext = useContext2(AccordionContext), contextAnimate = _useContext.animate, isExpanded = _useContext.isExpanded, prefix = _useContext.prefix, registerSection = _useContext.registerSection, toggleExpanded = _useContext.toggleExpanded; | ||
var expanded = isExpanded ? isExpanded(id, defaultExpanded) : expandedState; | ||
@@ -618,4 +621,4 @@ var animate2 = contextAnimate != null ? contextAnimate : defaultAnimate; | ||
function AccordionHeader(_ref4) { | ||
var _ref4$as = _ref4.as, Comp = _ref4$as === void 0 ? "div" : _ref4$as, _ref4$role = _ref4.role, role = _ref4$role === void 0 ? "button" : _ref4$role, _ref4$className = _ref4.className, className = _ref4$className === void 0 ? "" : _ref4$className, _ref4$tabIndex = _ref4.tabIndex, tabIndex = _ref4$tabIndex === void 0 ? 0 : _ref4$tabIndex, id = _ref4.id, children = _ref4.children, rest = _objectWithoutPropertiesLoose(_ref4, ["as", "role", "className", "tabIndex", "id", "children"]); | ||
var _useContext2 = useContext2(SectionContext), contentId = _useContext2.contentId, headerId = _useContext2.headerId, expanded = _useContext2.expanded, toggleHandler = _useContext2.toggleHandler, setHeaderId = _useContext2.setHeaderId; | ||
var _ref4$as = _ref4.as, Comp = _ref4$as === void 0 ? "div" : _ref4$as, children = _ref4.children, _ref4$className = _ref4.className, className = _ref4$className === void 0 ? "" : _ref4$className, id = _ref4.id, _ref4$role = _ref4.role, role = _ref4$role === void 0 ? "button" : _ref4$role, _ref4$tabIndex = _ref4.tabIndex, tabIndex = _ref4$tabIndex === void 0 ? 0 : _ref4$tabIndex, rest = _objectWithoutPropertiesLoose(_ref4, ["as", "children", "className", "id", "role", "tabIndex"]); | ||
var _useContext2 = useContext2(SectionContext), contentId = _useContext2.contentId, expanded = _useContext2.expanded, headerId = _useContext2.headerId, setHeaderId = _useContext2.setHeaderId, toggleHandler = _useContext2.toggleHandler; | ||
useLayoutEffect2(function() { | ||
@@ -640,6 +643,6 @@ if (setHeaderId) { | ||
var _objstr; | ||
var _ref5$as = _ref5.as, Comp = _ref5$as === void 0 ? "div" : _ref5$as, _ref5$role = _ref5.role, role = _ref5$role === void 0 ? "region" : _ref5$role, _ref5$className = _ref5.className, className = _ref5$className === void 0 ? "" : _ref5$className, id = _ref5.id, children = _ref5.children, rest = _objectWithoutPropertiesLoose(_ref5, ["as", "role", "className", "id", "children"]); | ||
var _ref5$as = _ref5.as, Comp = _ref5$as === void 0 ? "div" : _ref5$as, children = _ref5.children, _ref5$className = _ref5.className, className = _ref5$className === void 0 ? "" : _ref5$className, id = _ref5.id, _ref5$role = _ref5.role, role = _ref5$role === void 0 ? "region" : _ref5$role, rest = _objectWithoutPropertiesLoose(_ref5, ["as", "children", "className", "id", "role"]); | ||
var ref = useRef2(null); | ||
var hasMountedRef = useRef2(false); | ||
var _useContext3 = useContext2(SectionContext), contentId = _useContext3.contentId, headerId = _useContext3.headerId, expanded = _useContext3.expanded, animate2 = _useContext3.animate, setContentId = _useContext3.setContentId; | ||
var _useContext3 = useContext2(SectionContext), animate2 = _useContext3.animate, contentId = _useContext3.contentId, expanded = _useContext3.expanded, headerId = _useContext3.headerId, setContentId = _useContext3.setContentId; | ||
useEffect2(function() { | ||
@@ -646,0 +649,0 @@ hasMountedRef.current = true; |
@@ -1,3 +0,3 @@ | ||
var Be=Object.create,Z=Object.defineProperty,er=Object.getPrototypeOf,rr=Object.prototype.hasOwnProperty,tr=Object.getOwnPropertyNames,nr=Object.getOwnPropertyDescriptor,be=function(e){return Z(e,"__esModule",{value:!0})},or=function(e,r){for(var n in r)Z(e,n,{get:r[n],enumerable:!0})},ar=function(e,r,n){if(r&&"object"==typeof r||"function"==typeof r)for(var t,o=tr(r),i=0,a=o.length;i<a;i++)t=o[i],!rr.call(e,t)&&"default"!==t&&Z(e,t,{get:function(e){return r[e]}.bind(null,t),enumerable:!(n=nr(r,t))||n.enumerable});return e},Q=function(e){return ar(be(Z(null!=e?Be(er(e)):{},"default",e&&e.__esModule&&"default"in e?{get:function(){return e.default},enumerable:!0}:{value:e,enumerable:!0})),e)};be(exports),or(exports,{Accordion:function(){return Qe},AccordionContent:function(){return Mr},AccordionHeader:function(){return Cr},AccordionSection:function(){return Ir}});var K,J="section-child-00fce3c",Oe="header-00fce3c",Re="content-hidden-00fce3c";function B(){return K||(K=Promise.resolve(void 0))}var U,v=Q(require("react")),L=Q(require("react")),Pe=Q(require("react-dom"));function C(e,r,n){return L.createElement.apply(void 0,arguments)}function H(e){return L.createContext(e)}function N(e){return v.useState(e)}function V(e){return v.useRef(e)}function fe(e,r){v.useEffect(e,r)}function Y(e,r){v.useLayoutEffect(e,r)}function D(e){return v.useContext(e)}function G(e,r){return v.useMemo(e,r)}function T(e,r){return v.useCallback(e,r)}function Se(e,r,n){return v.useImperativeHandle(e,r,n)}function ee(e,r,n){return r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}var Ce,b={AUTO:"auto",LAZY:"lazy",EAGER:"eager",UNLOAD:"unload"},ir=[b.AUTO,b.LAZY,b.EAGER,b.UNLOAD],Ie=(ee(U={},b.AUTO,0),ee(U,b.LAZY,1),ee(U,b.EAGER,2),ee(U,b.UNLOAD,3),U);function le(e,r){var n=Ie[e]||0,t=Ie[r]||0,o=Math.max(n,t);return ir[o]}function Me(){return Ce||(Ce=H({renderable:!0,playable:!0,loading:b.AUTO}))}function we(e){var r=e.renderable,n=void 0===r||r,t=e.playable,o=void 0===t||t,i=e.loading,a=void 0===i?"auto":i,c=e.notify,u=e.children,l=sr(),f=n&&l.renderable,d=f&&o&&l.playable,s=le(f?b.AUTO:b.LAZY,le(a,l.loading)),v=c||l.notify,p=G((function(){return{renderable:f,playable:d,loading:s,notify:v}}),[f,d,s,v]);return C(Me().Provider,{children:u,value:p})}function sr(){return D(Me())}var ur=Array.isArray,y=self.AMP_CONFIG||{},lr=("string"==typeof y.thirdPartyFrameRegex?new RegExp(y.thirdPartyFrameRegex):y.thirdPartyFrameRegex)||/^d-\d+\.ampproject\.net$/,Ne=("string"==typeof y.cdnProxyRegex?new RegExp(y.cdnProxyRegex):y.cdnProxyRegex)||/^https:\/\/([a-zA-Z0-9_-]+\.)?cdn\.ampproject\.org$/;function Te(e){if(!self.document||!self.document.head||self.location&&Ne.test(self.location.origin))return null;var r=self.document.head.querySelector('meta[name="'.concat(e,'"]'));return r&&r.getAttribute("content")||null}var dr={thirdParty:y.thirdPartyUrl||"https://3p.ampproject.net",thirdPartyFrameHost:y.thirdPartyFrameHost||"ampproject.net",thirdPartyFrameRegex:lr,cdn:y.cdnUrl||Te("runtime-host")||"https://cdn.ampproject.org",cdnProxyRegex:Ne,localhostRegex:/^https?:\/\/localhost(:\d+)?$/,errorReporting:y.errorReportingUrl||"https://us-central1-amp-error-reporting.cloudfunctions.net/r",betaErrorReporting:y.betaErrorReportingUrl||"https://us-central1-amp-error-reporting.cloudfunctions.net/r-beta",localDev:y.localDev||!1,trustedViewerHosts:[/(^|\.)google\.(com?|[a-z]{2}|com?\.[a-z]{2}|cat)$/,/(^|\.)gmail\.(com|dev)$/],geoApi:y.geoApiUrl||Te("amp-geo-api")};self.__AMP_LOG=self.__AMP_LOG||{user:null,dev:null,userForEmbed:null};var Ot=self.__AMP_LOG;function Le(e){var r=Object.create(null);return e&&Object.assign(r,e),r}function de(e,r){return Object.keys(e).reduce((function(n,t){return r.includes(t)||(n[t]=e[t]),n}),{})}var re,Fe=["Webkit","webkit","Moz","moz","ms","O","o"];function pr(e){return e.charAt(0).toUpperCase()+e.slice(1)}function vr(e,r){for(var n=0;n<Fe.length;n++){var t=Fe[n]+r;if(void 0!==e[t])return t}return""}function je(e,r,n){if(pe(r))return r;re||(re=Le());var t=re[r];if(!t||n){if(t=r,void 0===e[r]){var o=vr(e,pr(r));void 0!==e[o]&&(t=o)}n||(re[r]=t)}return t}function mr(e,r,n,t,o){var i=je(e.style,r,o);if(i){var a=t?n+t:n;pe(i)?e.style.setProperty(i,a):e.style[i]=a}}function te(e,r,n){var t=je(e.style,r,n);if(t)return pe(t)?e.style.getPropertyValue(t):e.style[t]}function ve(e,r){for(var n in r)mr(e,n,r[n])}function pe(e){return e.startsWith("--")}var De=500,gr=200,hr="cubic-bezier(0.47, 0, 0.745, 0.715)",xr="cubic-bezier(0.39, 0.575, 0.565, 1)";function ke(e){return Ue(e,(function(){var r=te(e,"height"),n=te(e,"opacity"),t=te(e,"overflowY");ve(e,{height:0,opacity:0,overflowY:"auto"});var o=e.scrollHeight;ve(e,{height:r,opacity:n,overflowY:t});var i=$e(o);return e.animate([{height:0,opacity:0,overflowY:"hidden"},{height:o+"px",opacity:1,overflowY:"hidden"}],{easing:hr,duration:i})}))}function He(e){return Ue(e,(function(){var r=e.offsetHeight,n=$e(r);return e.animate([{height:r+"px",opacity:1,overflowY:"hidden"},{height:"0",opacity:0,overflowY:"hidden"}],{easing:xr,duration:n})}))}function Ue(e,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;e.classList.add("i-amphtml-animating");var t=r();return t.onfinish=t.oncancel=function(){t=null,n&&n(),e.classList.remove("i-amphtml-animating")},function(){t&&t.cancel()}}function $e(e){var r=window.innerHeight,n=Math.abs(e)/r*De;return Math.min(Math.max(n,gr),De)}var ne=Q(require("react"));function Ve(e){return ne.forwardRef(e)}function Ye(){var e=0;return function(){return String(++e)}}function Ge(e){return function(){return String(Math.floor(Math.random()*e))}}function We(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r&&(t=t.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),n.push.apply(n,t)}return n}function P(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?We(Object(n),!0).forEach((function(r){oe(e,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):We(Object(n)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))}))}return e}function oe(e,r,n){return r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function F(e,r){return Ar(e)||Er(e,r)||_r(e,r)||yr()}function yr(){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 _r(e,r){if(e){if("string"==typeof e)return ze(e,r);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ze(e,r)}}function ze(e,r){(null==r||r>e.length)&&(r=e.length);for(var n=0,t=new Array(r);n<r;n++)t[n]=e[n];return t}function Er(e,r){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var n=[],t=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(t=(a=c.next()).done)&&(n.push(a.value),!r||n.length!==r);t=!0);}catch(e){o=!0,i=e}finally{try{!t&&null!=c.return&&c.return()}finally{if(o)throw i}}return n}}function Ar(e){if(Array.isArray(e))return e}function ae(e,r){if(null==e)return{};var n,t,o=br(e,r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(t=0;t<i.length;t++)n=i[t],!(r.indexOf(n)>=0)&&(!Object.prototype.propertyIsEnumerable.call(e,n)||(o[n]=e[n]))}return o}function br(e,r){if(null==e)return{};var n,t,o={},i=Object.keys(e);for(t=0;t<i.length;t++)n=i[t],!(r.indexOf(n)>=0)&&(o[n]=e[n]);return o}var qe=H({}),me=H({}),Or={},Rr={},Pr=Ye(),Xe=Ge(1e5);function Sr(e,r){var n=e.as,t=void 0===n?"section":n,o=e.expandSingleSection,i=void 0!==o&&o,a=e.animate,c=void 0!==a&&a,u=e.children,l=e.id,f=ae(e,["as","expandSingleSection","animate","children","id"]),d=F(N(Or),2),s=d[0],v=d[1],p=V(Rr),y=F(N(Xe),1)[0],b=l||"a".concat(y);fe((function(){!i||v((function(e){var r={},n=0;for(var t in e)r[t]=e[t]&&0==n++;return r}))}),[i]);var g=T((function(e,r,n){var t=n.current;return v((function(n){return Ze(e,r,n,i)})),p.current=P(P({},p.current),{},oe({},e,t)),function(){v((function(r){return de(r,e)})),p.current=de(p.current,e)}}),[i]),h=T((function(e,r){v((function(n){var t=null!=r?r:!n[e],o=Ze(e,t,n,i);return B().then((function(){for(var e in n){var r=p.current[e];r&&n[e]!=o[e]&&r(o[e])}})),o}))}),[i]),m=T((function(e,r){var n;return null!==(n=s[e])&&void 0!==n?n:r}),[s]),O=T((function(e){if(e)e in s&&h(e);else if(!i)for(var r in s)h(r)}),[s,h,i]),x=T((function(e){if(e)m(e,!0)||h(e);else if(!i)for(var r in s)m(r,!0)||h(r)}),[s,h,m,i]),j=T((function(e){if(e)m(e,!1)&&h(e);else for(var r in s)m(r,!1)&&h(r)}),[s,h,m]);Se(r,(function(){return{toggle:O,expand:x,collapse:j}}),[O,j,x]);var A=G((function(){return{registerSection:g,toggleExpanded:h,isExpanded:m,animate:c,prefix:b}}),[g,h,m,c,b]);return C(t,P({id:l},f),C(qe.Provider,{value:A},u))}var Qe=Ve(Sr);function Ze(e,r,n,t){var o;if(t&&r)for(var i in o=oe({},e,r),n)i!=e&&(o[i]=!1);else o=P(P({},n),{},oe({},e,r));return o}function Ir(e){var r=e.as,n=void 0===r?"section":r,t=e.expanded,o=void 0!==t&&t,i=e.animate,a=void 0!==i&&i,c=e.id,u=e.children,l=e.onExpandStateChange,f=ae(e,["as","expanded","animate","id","children","onExpandStateChange"]),d=F(N(Pr),1)[0],s=c||d,v=F(N(Xe),1)[0],p=F(N(o),2),y=p[0],b=p[1],g=F(N(null),2),h=g[0],m=g[1],O=F(N(null),2),x=O[0],j=O[1],A=D(qe),w=A.registerSection,S=A.animate,E=A.isExpanded,I=A.toggleExpanded,R=A.prefix,U=E?E(s,o):y,M=null!=S?S:a,H=h||"".concat(R||"a","-content-").concat(s,"-").concat(v),L=x||"".concat(R||"a","-header-").concat(s,"-").concat(v),_=V(null);_.current=l,Y((function(){if(w)return w(s,o,_)}),[w,s,o]);var Z=T((function(e){I?I(s,e):b((function(r){var n=null!=e?e:!r;return B().then((function(){var e=_.current;e&&e(n)})),n}))}),[s,I]),z=G((function(){return{animate:M,contentId:H,headerId:L,expanded:U,toggleHandler:Z,setContentId:m,setHeaderId:j}}),[M,H,L,U,Z]);return C(n,P(P({},f),{},{expanded:U}),C(me.Provider,{value:z},u))}function Cr(e){var r=e.as,n=void 0===r?"div":r,t=e.role,o=void 0===t?"button":t,i=e.className,a=void 0===i?"":i,c=e.tabIndex,u=void 0===c?0:c,l=e.id,f=e.children,d=ae(e,["as","role","className","tabIndex","id","children"]),s=D(me),v=s.contentId,p=s.headerId,y=s.expanded,b=s.toggleHandler,g=s.setHeaderId;return Y((function(){g&&g(l)}),[g,l]),C(n,P(P({},d),{},{id:p,role:o,className:"".concat(a," ").concat(J," ").concat(Oe),tabIndex:u,"aria-controls":v,onClick:function(){return b()},"aria-expanded":String(y)}),f)}function Mr(e){var r=e.as,n=void 0===r?"div":r,t=e.role,o=void 0===t?"region":t,i=e.className,a=void 0===i?"":i,c=e.id,u=e.children,l=ae(e,["as","role","className","id","children"]),f=V(null),d=V(!1),s=D(me),v=s.contentId,p=s.headerId,y=s.expanded,b=s.animate,g=s.setContentId;return fe((function(){return d.current=!0,function(){return d.current=!1}}),[]),Y((function(){g&&g(c)}),[g,c]),Y((function(){var e=d.current,r=f.current;if(b&&e&&r&&r.animate)return y?ke(r):He(r)}),[y,b]),C(we,{renderable:y},C(n,P(P({},l),{},{ref:f,className:a+(" "+J)+(y?"":" "+Re),id:v,"aria-labelledby":p,role:o}),u))} | ||
var rr=Object.create,Q=Object.defineProperty,tr=Object.getOwnPropertyDescriptor,nr=Object.getOwnPropertyNames,or=Object.getPrototypeOf,ar=Object.prototype.hasOwnProperty,Oe=function(e){return Q(e,"__esModule",{value:!0})},ir=function(e,r){for(var n in r)Q(e,n,{get:r[n],enumerable:!0})},ur=function(e,r,n){if(r&&"object"==typeof r||"function"==typeof r)for(var t,o=nr(r),i=0,a=o.length;i<a;i++)t=o[i],!ar.call(e,t)&&"default"!==t&&Q(e,t,{get:function(e){return r[e]}.bind(null,t),enumerable:!(n=tr(r,t))||n.enumerable});return e},q=function(e){return ur(Oe(Q(null!=e?rr(or(e)):{},"default",e&&e.__esModule&&"default"in e?{get:function(){return e.default},enumerable:!0}:{value:e,enumerable:!0})),e)};Oe(exports),ir(exports,{Accordion:function(){return Je},AccordionContent:function(){return Nr},AccordionHeader:function(){return Tr},AccordionSection:function(){return Mr}});var B,J="section-child-00fce3c",Re="header-00fce3c",Pe="content-hidden-00fce3c";function K(){return B||(B=Promise.resolve(void 0))}var U,v=q(require("react")),F=q(require("react")),Ie=q(require("react-dom"));function w(e,r,n){return F.createElement.apply(void 0,arguments)}function V(e){return F.createContext(e,void 0)}function M(e){return v.useState(e)}function k(e){return v.useRef(e)}function le(e,r){v.useEffect(e,r)}function Y(e,r){v.useLayoutEffect(e,r)}function D(e){return v.useContext(e)}function G(e,r){return v.useMemo(e,r)}function T(e,r){return v.useCallback(e,r)}function we(e,r,n){return v.useImperativeHandle(e,r,n)}function ee(e,r,n){return r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}var Me,A={AUTO:"auto",LAZY:"lazy",EAGER:"eager",UNLOAD:"unload"},sr=[A.AUTO,A.LAZY,A.EAGER,A.UNLOAD],Ce=(ee(U={},A.AUTO,0),ee(U,A.LAZY,1),ee(U,A.EAGER,2),ee(U,A.UNLOAD,3),U);function de(e,r){var n=Ce[e]||0,t=Ce[r]||0,o=Math.max(n,t);return sr[o]}function Te(){return Me||(Me=V({renderable:!0,playable:!0,loading:A.AUTO}))}function Ne(e){var r=e.children,n=e.loading,t=void 0===n?"auto":n,o=e.notify,i=e.playable,a=void 0===i||i,c=e.renderable,u=void 0===c||c,l=cr(),f=u&&l.renderable,d=f&&a&&l.playable,s=de(f?A.AUTO:A.LAZY,de(t,l.loading)),v=o||l.notify,p=G((function(){return{renderable:f,playable:d,loading:s,notify:v}}),[f,d,s,v]);return w(Te().Provider,{children:r,value:p})}function cr(){return D(Te())}var pe=Array.isArray,Fe=Object.prototype,zr=Fe.hasOwnProperty,Xr=Fe.toString;function me(e){var r=Object.create(null);return e&&Object.assign(r,e),r}function ve(e,r){return Object.keys(e).reduce((function(n,t){return r.includes(t)||(n[t]=e[t]),n}),{})}var b=self.AMP_CONFIG||{},mr=("string"==typeof b.thirdPartyFrameRegex?new RegExp(b.thirdPartyFrameRegex):b.thirdPartyFrameRegex)||/^d-\d+\.ampproject\.net$/,je=("string"==typeof b.cdnProxyRegex?new RegExp(b.cdnProxyRegex):b.cdnProxyRegex)||/^https:\/\/([a-zA-Z0-9_-]+\.)?cdn\.ampproject\.org$/;function Le(e){if(!self.document||!self.document.head||self.location&&je.test(self.location.origin))return null;var r=self.document.head.querySelector('meta[name="'.concat(e,'"]'));return r&&r.getAttribute("content")||null}var vr={thirdParty:b.thirdPartyUrl||"https://3p.ampproject.net",thirdPartyFrameHost:b.thirdPartyFrameHost||"ampproject.net",thirdPartyFrameRegex:mr,cdn:b.cdnUrl||Le("runtime-host")||"https://cdn.ampproject.org",cdnProxyRegex:je,localhostRegex:/^https?:\/\/localhost(:\d+)?$/,errorReporting:b.errorReportingUrl||"https://us-central1-amp-error-reporting.cloudfunctions.net/r",betaErrorReporting:b.betaErrorReportingUrl||"https://us-central1-amp-error-reporting.cloudfunctions.net/r-beta",localDev:b.localDev||!1,trustedViewerHosts:[/(^|\.)google\.(com?|[a-z]{2}|com?\.[a-z]{2}|cat)$/,/(^|\.)gmail\.(com|dev)$/],geoApi:b.geoApiUrl||Le("amp-geo-api")};self.__AMP_LOG=self.__AMP_LOG||{user:null,dev:null,userForEmbed:null};var re,Gt=self.__AMP_LOG,De=["Webkit","webkit","Moz","moz","ms","O","o"];function gr(e){return e.charAt(0).toUpperCase()+e.slice(1)}function hr(e,r){for(var n=0;n<De.length;n++){var t=De[n]+r;if(void 0!==e[t])return t}return""}function Ue(e,r,n){if(he(r))return r;re||(re=me());var t=re[r];if(!t||n){if(t=r,void 0===e[r]){var o=hr(e,gr(r));void 0!==e[o]&&(t=o)}n||(re[r]=t)}return t}function xr(e,r,n,t,o){var i=Ue(e.style,r,o);if(i){var a=t?n+t:n;he(i)?e.style.setProperty(i,a):e.style[i]=a}}function te(e,r,n){var t=Ue(e.style,r,n);if(t)return he(t)?e.style.getPropertyValue(t):e.style[t]}function ge(e,r){for(var n in r)xr(e,n,r[n])}function he(e){return e.startsWith("--")}var $e=500,yr=200,br="cubic-bezier(0.47, 0, 0.745, 0.715)",Er="cubic-bezier(0.39, 0.575, 0.565, 1)";function He(e){return ke(e,(function(){var r=te(e,"height"),n=te(e,"opacity"),t=te(e,"overflowY");ge(e,{height:0,opacity:0,overflowY:"auto"});var o=e.scrollHeight;ge(e,{height:r,opacity:n,overflowY:t});var i=Ye(o);return e.animate([{height:0,opacity:0,overflowY:"hidden"},{height:o+"px",opacity:1,overflowY:"hidden"}],{easing:br,duration:i})}))}function Ve(e){return ke(e,(function(){var r=e.offsetHeight,n=Ye(r);return e.animate([{height:r+"px",opacity:1,overflowY:"hidden"},{height:"0",opacity:0,overflowY:"hidden"}],{easing:Er,duration:n})}))}function ke(e,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;e.classList.add("i-amphtml-animating");var t=r();return t.onfinish=t.oncancel=function(){t=null,n&&n(),e.classList.remove("i-amphtml-animating")},function(){t&&t.cancel()}}function Ye(e){var r=window.innerHeight,n=Math.abs(e)/r*$e;return Math.min(Math.max(n,yr),$e)}var ne=q(require("react"));function Ge(e){return ne.forwardRef(e)}function We(){var e=0;return function(){return String(++e)}}function ze(e){return function(){return String(Math.floor(Math.random()*e))}}function Xe(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r&&(t=t.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),n.push.apply(n,t)}return n}function O(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?Xe(Object(n),!0).forEach((function(r){oe(e,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Xe(Object(n)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))}))}return e}function oe(e,r,n){return r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function j(e,r){return Or(e)||Sr(e,r)||Ar(e,r)||_r()}function _r(){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 Ar(e,r){if(e){if("string"==typeof e)return Ze(e,r);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ze(e,r)}}function Ze(e,r){(null==r||r>e.length)&&(r=e.length);for(var n=0,t=new Array(r);n<r;n++)t[n]=e[n];return t}function Sr(e,r){var n=e&&("undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null!=n){var t,o,i=[],a=!0,c=!1;try{for(n=n.call(e);!(a=(t=n.next()).done)&&(i.push(t.value),!r||i.length!==r);a=!0);}catch(e){c=!0,o=e}finally{try{!a&&null!=n.return&&n.return()}finally{if(c)throw o}}return i}}function Or(e){if(Array.isArray(e))return e}function ae(e,r){if(null==e)return{};var n,t,o=Rr(e,r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(t=0;t<i.length;t++)n=i[t],!(r.indexOf(n)>=0)&&(!Object.prototype.propertyIsEnumerable.call(e,n)||(o[n]=e[n]))}return o}function Rr(e,r){if(null==e)return{};var n,t,o={},i=Object.keys(e);for(t=0;t<i.length;t++)n=i[t],!(r.indexOf(n)>=0)&&(o[n]=e[n]);return o}var Qe=V({}),xe=V({}),Pr={},Ir={},wr=We(),qe=ze(1e5);function Cr(e,r){var n=e.animate,t=void 0!==n&&n,o=e.as,i=void 0===o?"section":o,a=e.children,c=e.expandSingleSection,u=void 0!==c&&c,l=e.id,f=ae(e,["animate","as","children","expandSingleSection","id"]),d=j(M(Pr),2),s=d[0],v=d[1],p=k(Ir),g=j(M(qe),1)[0],b=l||"a".concat(g);le((function(){!u||v((function(e){var r={},n=0;for(var t in e)r[t]=e[t]&&0==n++;return r}))}),[u]);var h=T((function(e,r,n){var t=n.current;return v((function(n){return Be(e,r,n,u)})),p.current=O(O({},p.current),{},oe({},e,t)),function(){v((function(r){return ve(r,e)})),p.current=ve(p.current,e)}}),[u]),y=T((function(e,r){v((function(n){var t=null!=r?r:!n[e],o=Be(e,t,n,u);return K().then((function(){for(var e in n){var r=p.current[e];r&&n[e]!=o[e]&&r(o[e])}})),o}))}),[u]),m=T((function(e,r){var n;return null!==(n=s[e])&&void 0!==n?n:r}),[s]),x=T((function(e){if(e)e in s&&y(e);else if(!u)for(var r in s)y(r)}),[s,y,u]),A=T((function(e){if(e)m(e,!0)||y(e);else if(!u)for(var r in s)m(r,!0)||y(r)}),[s,y,m,u]),P=T((function(e){if(e)m(e,!1)&&y(e);else for(var r in s)m(r,!1)&&y(r)}),[s,y,m]);we(r,(function(){return{toggle:x,expand:A,collapse:P}}),[x,P,A]);var E=G((function(){return{registerSection:h,toggleExpanded:y,isExpanded:m,animate:t,prefix:b}}),[h,y,m,t,b]);return w(i,O({id:l},f),w(Qe.Provider,{value:E},a))}var Je=Ge(Cr);function Be(e,r,n,t){var o;if(t&&r)for(var i in o=oe({},e,r),n)i!=e&&(o[i]=!1);else o=O(O({},n),{},oe({},e,r));return o}function Mr(e){var r=e.animate,n=void 0!==r&&r,t=e.as,o=void 0===t?"section":t,i=e.children,a=e.expanded,c=void 0!==a&&a,u=e.id,l=e.onExpandStateChange,f=ae(e,["animate","as","children","expanded","id","onExpandStateChange"]),d=j(M(wr),1)[0],s=u||d,v=j(M(qe),1)[0],p=j(M(c),2),g=p[0],b=p[1],h=j(M(null),2),y=h[0],m=h[1],x=j(M(null),2),A=x[0],P=x[1],E=D(Qe),S=E.animate,R=E.isExpanded,U=E.prefix,I=E.registerSection,C=E.toggleExpanded,_=R?R(s,c):g,L=null!=S?S:n,N=y||"".concat(U||"a","-content-").concat(s,"-").concat(v),F=A||"".concat(U||"a","-header-").concat(s,"-").concat(v),H=k(null);H.current=l,Y((function(){if(I)return I(s,c,H)}),[I,s,c]);var q=T((function(e){C?C(s,e):b((function(r){var n=null!=e?e:!r;return K().then((function(){var e=H.current;e&&e(n)})),n}))}),[s,C]),z=G((function(){return{animate:L,contentId:N,headerId:F,expanded:_,toggleHandler:q,setContentId:m,setHeaderId:P}}),[L,N,F,_,q]);return w(o,O(O({},f),{},{expanded:_}),w(xe.Provider,{value:z},i))}function Tr(e){var r=e.as,n=void 0===r?"div":r,t=e.children,o=e.className,i=void 0===o?"":o,a=e.id,c=e.role,u=void 0===c?"button":c,l=e.tabIndex,f=void 0===l?0:l,d=ae(e,["as","children","className","id","role","tabIndex"]),s=D(xe),v=s.contentId,p=s.expanded,g=s.headerId,b=s.setHeaderId,h=s.toggleHandler;return Y((function(){b&&b(a)}),[b,a]),w(n,O(O({},d),{},{id:g,role:u,className:"".concat(i," ").concat(J," ").concat(Re),tabIndex:f,"aria-controls":v,onClick:function(){return h()},"aria-expanded":String(p)}),t)}function Nr(e){var r=e.as,n=void 0===r?"div":r,t=e.children,o=e.className,i=void 0===o?"":o,a=e.id,c=e.role,u=void 0===c?"region":c,l=ae(e,["as","children","className","id","role"]),f=k(null),d=k(!1),s=D(xe),v=s.animate,p=s.contentId,g=s.expanded,b=s.headerId,h=s.setContentId;return le((function(){return d.current=!0,function(){return d.current=!1}}),[]),Y((function(){h&&h(a)}),[h,a]),Y((function(){var e=d.current,r=f.current;if(v&&e&&r&&r.animate)return g?He(r):Ve(r)}),[g,v]),w(Ne,{renderable:g},w(n,O(O({},l),{},{ref:f,className:i+(" "+J)+(g?"":" "+Pe),id:p,"aria-labelledby":b,role:u}),t))} | ||
//# sourceMappingURL=component-react.js.map | ||
Qe.displayName="Accordion"; | ||
Je.displayName="Accordion"; |
var __create = Object.create; | ||
var __defProp = Object.defineProperty; | ||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | ||
var __getOwnPropNames = Object.getOwnPropertyNames; | ||
var __getProtoOf = Object.getPrototypeOf; | ||
var __hasOwnProp = Object.prototype.hasOwnProperty; | ||
var __getOwnPropNames = Object.getOwnPropertyNames; | ||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | ||
var __markAsModule = function(target) { | ||
return __defProp(target, "__esModule", {value: true}); | ||
return __defProp(target, "__esModule", { value: true }); | ||
}; | ||
var __export = function(target, all) { | ||
for (var name in all) | ||
__defProp(target, name, {get: all[name], enumerable: true}); | ||
__defProp(target, name, { get: all[name], enumerable: true }); | ||
}; | ||
var __exportStar = function(target, module2, desc) { | ||
var __reExport = function(target, module2, desc) { | ||
if (module2 && typeof module2 === "object" || typeof module2 === "function") | ||
@@ -19,5 +19,5 @@ for (var keys = __getOwnPropNames(module2), i = 0, n = keys.length, key; i < n; i++) { | ||
if (!__hasOwnProp.call(target, key) && key !== "default") | ||
__defProp(target, key, {get: function(k) { | ||
__defProp(target, key, { get: function(k) { | ||
return module2[k]; | ||
}.bind(null, key), enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable}); | ||
}.bind(null, key), enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable }); | ||
} | ||
@@ -27,5 +27,5 @@ return target; | ||
var __toModule = function(module2) { | ||
return __exportStar(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", module2 && module2.__esModule && "default" in module2 ? {get: function() { | ||
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", module2 && module2.__esModule && "default" in module2 ? { get: function() { | ||
return module2.default; | ||
}, enumerable: true} : {value: module2, enumerable: true})), module2); | ||
}, enumerable: true } : { value: module2, enumerable: true })), module2); | ||
}; | ||
@@ -55,3 +55,3 @@ | ||
// src/resolved-promise.js | ||
// src/core/data-structures/promise.js | ||
var resolved; | ||
@@ -74,3 +74,3 @@ function resolvedPromise() { | ||
function createContext2(value) { | ||
return preact.createContext(value); | ||
return preact.createContext(value, void 0); | ||
} | ||
@@ -129,3 +129,3 @@ function useState2(initial) { | ||
function WithAmpContext(_ref) { | ||
var _ref$renderable = _ref.renderable, renderableProp = _ref$renderable === void 0 ? true : _ref$renderable, _ref$playable = _ref.playable, playableProp = _ref$playable === void 0 ? true : _ref$playable, _ref$loading = _ref.loading, loadingProp = _ref$loading === void 0 ? "auto" : _ref$loading, notifyProp = _ref.notify, children = _ref.children; | ||
var children = _ref.children, _ref$loading = _ref.loading, loadingProp = _ref$loading === void 0 ? "auto" : _ref$loading, notifyProp = _ref.notify, _ref$playable = _ref.playable, playableProp = _ref$playable === void 0 ? true : _ref$playable, _ref$renderable = _ref.renderable, renderableProp = _ref$renderable === void 0 ? true : _ref$renderable; | ||
var parent = useAmpContext(); | ||
@@ -158,2 +158,22 @@ var renderable = renderableProp && parent.renderable; | ||
// src/core/types/object/index.js | ||
var _Object$prototype = Object.prototype; | ||
var hasOwn_ = _Object$prototype.hasOwnProperty; | ||
var toString_ = _Object$prototype.toString; | ||
function map(opt_initial) { | ||
var obj = Object.create(null); | ||
if (opt_initial) { | ||
Object.assign(obj, opt_initial); | ||
} | ||
return obj; | ||
} | ||
function omit(o, props) { | ||
return Object.keys(o).reduce(function(acc, key) { | ||
if (!props.includes(key)) { | ||
acc[key] = o[key]; | ||
} | ||
return acc; | ||
}, {}); | ||
} | ||
// src/config.js | ||
@@ -195,19 +215,2 @@ var env = self.AMP_CONFIG || {}; | ||
// src/utils/object.js | ||
function map(opt_initial) { | ||
var obj = Object.create(null); | ||
if (opt_initial) { | ||
Object.assign(obj, opt_initial); | ||
} | ||
return obj; | ||
} | ||
function omit(o, props) { | ||
return Object.keys(o).reduce(function(acc, key) { | ||
if (!props.includes(key)) { | ||
acc[key] = o[key]; | ||
} | ||
return acc; | ||
}, {}); | ||
} | ||
// src/style.js | ||
@@ -367,3 +370,3 @@ var propertyNameCache; | ||
// src/utils/id-generator.js | ||
// src/core/math/id-generator.js | ||
function sequentialIdGenerator() { | ||
@@ -429,3 +432,3 @@ var counter = 0; | ||
function AccordionWithRef(_ref, ref) { | ||
var _ref$as = _ref.as, Comp = _ref$as === void 0 ? "section" : _ref$as, _ref$expandSingleSect = _ref.expandSingleSection, expandSingleSection = _ref$expandSingleSect === void 0 ? false : _ref$expandSingleSect, _ref$animate = _ref.animate, animate2 = _ref$animate === void 0 ? false : _ref$animate, children = _ref.children, id = _ref.id, rest = _objectWithoutPropertiesLoose(_ref, ["as", "expandSingleSection", "animate", "children", "id"]); | ||
var _ref$animate = _ref.animate, animate2 = _ref$animate === void 0 ? false : _ref$animate, _ref$as = _ref.as, Comp = _ref$as === void 0 ? "section" : _ref$as, children = _ref.children, _ref$expandSingleSect = _ref.expandSingleSection, expandSingleSection = _ref$expandSingleSect === void 0 ? false : _ref$expandSingleSect, id = _ref.id, rest = _objectWithoutPropertiesLoose(_ref, ["animate", "as", "children", "expandSingleSection", "id"]); | ||
var _useState = useState2(EMPTY_EXPANDED_MAP), expandedMap = _useState[0], setExpandedMap = _useState[1]; | ||
@@ -563,3 +566,3 @@ var eventMapRef = useRef2(EMPTY_EVENT_MAP); | ||
function AccordionSection(_ref3) { | ||
var _ref3$as = _ref3.as, Comp = _ref3$as === void 0 ? "section" : _ref3$as, _ref3$expanded = _ref3.expanded, defaultExpanded = _ref3$expanded === void 0 ? false : _ref3$expanded, _ref3$animate = _ref3.animate, defaultAnimate = _ref3$animate === void 0 ? false : _ref3$animate, propId = _ref3.id, children = _ref3.children, onExpandStateChange = _ref3.onExpandStateChange, rest = _objectWithoutPropertiesLoose(_ref3, ["as", "expanded", "animate", "id", "children", "onExpandStateChange"]); | ||
var _ref3$animate = _ref3.animate, defaultAnimate = _ref3$animate === void 0 ? false : _ref3$animate, _ref3$as = _ref3.as, Comp = _ref3$as === void 0 ? "section" : _ref3$as, children = _ref3.children, _ref3$expanded = _ref3.expanded, defaultExpanded = _ref3$expanded === void 0 ? false : _ref3$expanded, propId = _ref3.id, onExpandStateChange = _ref3.onExpandStateChange, rest = _objectWithoutPropertiesLoose(_ref3, ["animate", "as", "children", "expanded", "id", "onExpandStateChange"]); | ||
var _useState3 = useState2(generateSectionId), genId = _useState3[0]; | ||
@@ -571,3 +574,3 @@ var id = propId || genId; | ||
var _useState7 = useState2(null), headerIdState = _useState7[0], setHeaderIdState = _useState7[1]; | ||
var _useContext = useContext2(AccordionContext), registerSection = _useContext.registerSection, contextAnimate = _useContext.animate, isExpanded = _useContext.isExpanded, toggleExpanded = _useContext.toggleExpanded, prefix = _useContext.prefix; | ||
var _useContext = useContext2(AccordionContext), contextAnimate = _useContext.animate, isExpanded = _useContext.isExpanded, prefix = _useContext.prefix, registerSection = _useContext.registerSection, toggleExpanded = _useContext.toggleExpanded; | ||
var expanded = isExpanded ? isExpanded(id, defaultExpanded) : expandedState; | ||
@@ -618,4 +621,4 @@ var animate2 = contextAnimate != null ? contextAnimate : defaultAnimate; | ||
function AccordionHeader(_ref4) { | ||
var _ref4$as = _ref4.as, Comp = _ref4$as === void 0 ? "div" : _ref4$as, _ref4$role = _ref4.role, role = _ref4$role === void 0 ? "button" : _ref4$role, _ref4$className = _ref4.className, className = _ref4$className === void 0 ? "" : _ref4$className, _ref4$tabIndex = _ref4.tabIndex, tabIndex = _ref4$tabIndex === void 0 ? 0 : _ref4$tabIndex, id = _ref4.id, children = _ref4.children, rest = _objectWithoutPropertiesLoose(_ref4, ["as", "role", "className", "tabIndex", "id", "children"]); | ||
var _useContext2 = useContext2(SectionContext), contentId = _useContext2.contentId, headerId = _useContext2.headerId, expanded = _useContext2.expanded, toggleHandler = _useContext2.toggleHandler, setHeaderId = _useContext2.setHeaderId; | ||
var _ref4$as = _ref4.as, Comp = _ref4$as === void 0 ? "div" : _ref4$as, children = _ref4.children, _ref4$className = _ref4.className, className = _ref4$className === void 0 ? "" : _ref4$className, id = _ref4.id, _ref4$role = _ref4.role, role = _ref4$role === void 0 ? "button" : _ref4$role, _ref4$tabIndex = _ref4.tabIndex, tabIndex = _ref4$tabIndex === void 0 ? 0 : _ref4$tabIndex, rest = _objectWithoutPropertiesLoose(_ref4, ["as", "children", "className", "id", "role", "tabIndex"]); | ||
var _useContext2 = useContext2(SectionContext), contentId = _useContext2.contentId, expanded = _useContext2.expanded, headerId = _useContext2.headerId, setHeaderId = _useContext2.setHeaderId, toggleHandler = _useContext2.toggleHandler; | ||
useLayoutEffect2(function() { | ||
@@ -640,6 +643,6 @@ if (setHeaderId) { | ||
var _objstr; | ||
var _ref5$as = _ref5.as, Comp = _ref5$as === void 0 ? "div" : _ref5$as, _ref5$role = _ref5.role, role = _ref5$role === void 0 ? "region" : _ref5$role, _ref5$className = _ref5.className, className = _ref5$className === void 0 ? "" : _ref5$className, id = _ref5.id, children = _ref5.children, rest = _objectWithoutPropertiesLoose(_ref5, ["as", "role", "className", "id", "children"]); | ||
var _ref5$as = _ref5.as, Comp = _ref5$as === void 0 ? "div" : _ref5$as, children = _ref5.children, _ref5$className = _ref5.className, className = _ref5$className === void 0 ? "" : _ref5$className, id = _ref5.id, _ref5$role = _ref5.role, role = _ref5$role === void 0 ? "region" : _ref5$role, rest = _objectWithoutPropertiesLoose(_ref5, ["as", "children", "className", "id", "role"]); | ||
var ref = useRef2(null); | ||
var hasMountedRef = useRef2(false); | ||
var _useContext3 = useContext2(SectionContext), contentId = _useContext3.contentId, headerId = _useContext3.headerId, expanded = _useContext3.expanded, animate2 = _useContext3.animate, setContentId = _useContext3.setContentId; | ||
var _useContext3 = useContext2(SectionContext), animate2 = _useContext3.animate, contentId = _useContext3.contentId, expanded = _useContext3.expanded, headerId = _useContext3.headerId, setContentId = _useContext3.setContentId; | ||
useEffect2(function() { | ||
@@ -646,0 +649,0 @@ hasMountedRef.current = true; |
{ | ||
"name": "@ampproject/amp-accordion", | ||
"version": "v1.2104150129.000", | ||
"description": "AMP Accordion Component", | ||
"author": "The AMP HTML Authors", | ||
"license": "Apache-2.0", | ||
"main": "dist/component.js", | ||
"module": "dist/component.mjs", | ||
"exports": { | ||
".": "./preact", | ||
"./preact": { | ||
"import": "dist/component-preact.mjs", | ||
"require": "dist/component-preact.js" | ||
}, | ||
"./react": { | ||
"import": "dist/component-react.mjs", | ||
"require": "dist/component-react.js" | ||
} | ||
"name": "@ampproject/amp-accordion", | ||
"version": "1.2105242203.0", | ||
"description": "AMP HTML amp-accordion Component", | ||
"author": "The AMP HTML Authors", | ||
"license": "Apache-2.0", | ||
"main": "dist/component.js", | ||
"module": "dist/component.mjs", | ||
"exports": { | ||
".": "./preact", | ||
"./preact": { | ||
"import": "dist/component-preact.mjs", | ||
"require": "dist/component-preact.js" | ||
}, | ||
"files": ["dist/*"], | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/ampproject/amphtml.git", | ||
"directory": "extensions/amp-accordion/1.0" | ||
}, | ||
"homepage": "https://github.com/ampproject/amphtml/tree/main/extensions/amp-accordion/1.0", | ||
"peerDependencies": { | ||
"preact": "^10.2.1", | ||
"react": "^17.0.0" | ||
"./react": { | ||
"import": "dist/component-react.mjs", | ||
"require": "dist/component-react.js" | ||
} | ||
}, | ||
"files": [ | ||
"dist/*" | ||
], | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/ampproject/amphtml.git", | ||
"directory": "extensions/amp-accordion/1.0" | ||
}, | ||
"homepage": "https://github.com/ampproject/amphtml/tree/main/extensions/amp-accordion/1.0", | ||
"peerDependencies": { | ||
"preact": "^10.2.1", | ||
"react": "^17.0.0" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license.
Found 1 instance in 1 package
1
286678
9
1396