@ampproject/amp-accordion
Advanced tools
Comparing version 1.2107212010.0 to 1.2107230121.0
@@ -1,3 +0,3 @@ | ||
var Be=Object.create,Z=Object.defineProperty,er=Object.getOwnPropertyDescriptor,rr=Object.getOwnPropertyNames,tr=Object.getPrototypeOf,nr=Object.prototype.hasOwnProperty,Se=function(e){return Z(e,"__esModule",{value:!0})},or=function(e,r){for(var n in Se(e),r)Z(e,n,{get:r[n],enumerable:!0})},ir=function(e,r,n){if(r&&"object"==typeof r||"function"==typeof r)for(var t,o=rr(r),i=0,a=o.length;i<a;i++)t=o[i],!nr.call(e,t)&&"default"!==t&&Z(e,t,{get:function(e){return r[e]}.bind(null,t),enumerable:!(n=er(r,t))||n.enumerable});return e},q=function(e){return ir(Se(Z(null!=e?Be(tr(e)):{},"default",e&&e.__esModule&&"default"in e?{get:function(){return e.default},enumerable:!0}:{value:e,enumerable:!0})),e)};or(exports,{Accordion:function(){return qe},AccordionContent:function(){return Ur},AccordionHeader:function(){return Lr},AccordionSection:function(){return Hr}});var K,J="section-child-00fce3c",Ee="header-00fce3c",_e="content-hidden-00fce3c";function Q(){return K||(K=Promise.resolve(void 0))}var H,N=q(require("preact")),Oe=q(require("preact")),v=q(require("preact/hooks"));function I(e,r,n){return N.createElement.apply(void 0,arguments)}function F(e){return N.createContext(e,void 0)}function M(e){return v.useState(e)}function Y(e){return v.useRef(e)}function ce(e,r){v.useEffect(e,r)}function k(e,r){v.useLayoutEffect(e,r)}function D(e){return v.useContext(e)}function G(e,r){return v.useMemo(e,r)}function R(e,r){return v.useCallback(e,r)}function Pe(e,r,n){return v.useImperativeHandle(e,r,n)}function B(e,r,n){return r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}var Ie,S={AUTO:"auto",LAZY:"lazy",EAGER:"eager",UNLOAD:"unload"},ar=[S.AUTO,S.LAZY,S.EAGER,S.UNLOAD],Ce=(B(H={},S.AUTO,0),B(H,S.LAZY,1),B(H,S.EAGER,2),B(H,S.UNLOAD,3),H);function de(e,r){var n=Ce[e]||0,t=Ce[r]||0,o=Math.max(n,t);return ar[o]}function we(){return Ie||(Ie=F({renderable:!0,playable:!0,loading:S.AUTO}))}function Me(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,u=e.renderable,c=void 0===u||u,l=ur(),f=c&&l.renderable,d=f&&a&&l.playable,v=de(f?S.AUTO:S.LAZY,de(t,l.loading)),s=o||l.notify,p=G((function(){return{renderable:f,playable:d,loading:v,notify:s}}),[f,d,v,s]);return I(we().Provider,{children:r,value:p})}function ur(){return D(we())}var Te=Array.isArray,Ne=Object.prototype,dt=Ne.hasOwnProperty,lt=Ne.toString;function je(e){var r=Object.create(null);return e&&Object.assign(r,e),r}function le(e,r){return Object.keys(e).reduce((function(n,t){return r.includes(t)||(n[t]=e[t]),n}),{})}var ee,$e=["Webkit","webkit","Moz","moz","ms","O","o"];function gr(e){return e.charAt(0).toUpperCase()+e.slice(1)}function yr(e,r){for(var n=0;n<$e.length;n++){var t=$e[n]+r;if(void 0!==e[t])return t}return""}function De(e,r,n){if(me(r))return r;ee||(ee=je());var t=ee[r];if(!t||n){if(t=r,void 0===e[r]){var o=yr(e,gr(r));void 0!==e[o]&&(t=o)}n||(ee[r]=t)}return t}function br(e,r,n,t,o){var i=De(e.style,r,o);if(i){var a=t?n+t:n;me(i)?e.style.setProperty(i,a):e.style[i]=a}}function re(e,r,n){var t=De(e.style,r,n);if(t)return me(t)?e.style.getPropertyValue(t):e.style[t]}function pe(e,r){for(var n in r)br(e,n,r[n])}function me(e){return e.startsWith("--")}var He=500,Ar=200,Sr="cubic-bezier(0.47, 0, 0.745, 0.715)",Er="cubic-bezier(0.39, 0.575, 0.565, 1)";function Le(e){return Fe(e,(function(){var r=re(e,"height"),n=re(e,"opacity"),t=re(e,"overflowY");pe(e,{height:0,opacity:0,overflowY:"auto"});var o=e.scrollHeight;pe(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:Sr,duration:i})}))}function Ue(e){return Fe(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 Fe(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*He;return Math.min(Math.max(n,Ar),He)}var te=q(require("preact/compat"));function ke(e){return te.forwardRef(e)}function Ge(){var e=0;return function(){return String(++e)}}function Ve(e){return function(){return String(Math.floor(Math.random()*e))}}var _r=["animate","as","children","expandSingleSection","id"],Or=["animate","as","children","expanded","id","onExpandStateChange"],Pr=["as","children","className","id","role","tabIndex"],Cr=["as","children","className","id","role"];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 _(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){ne(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 ne(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 Rr(e)||Mr(e,r)||wr(e,r)||Ir()}function Ir(){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 wr(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 Mr(e,r){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var t,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(t=n.next()).done)&&(i.push(t.value),!r||i.length!==r);a=!0);}catch(e){u=!0,o=e}finally{try{!a&&null!=n.return&&n.return()}finally{if(u)throw o}}return i}}function Rr(e){if(Array.isArray(e))return e}function oe(e,r){if(null==e)return{};var n,t,o=Tr(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 Tr(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 Xe=F({}),ve=F({}),Nr={},jr={},$r=Ge(),Ze=Ve(1e5);function Dr(e,r){var n=e.animate,t=void 0!==n&&n,o=e.as,i=void 0===o?"section":o,a=e.children,u=e.expandSingleSection,c=void 0!==u&&u,l=e.id,f=oe(e,_r),d=j(M(Nr),2),v=d[0],s=d[1],p=Y(jr),b=j(M(Ze),1)[0],y=l||"a".concat(b);ce((function(){!c||s((function(e){var r={},n=0;for(var t in e)r[t]=e[t]&&0==n++;return r}))}),[c]);var h=R((function(e,r,n){var t=n.current;return s((function(n){return Je(e,r,n,c)})),p.current=_(_({},p.current),{},ne({},e,t)),function(){s((function(r){return le(r,e)})),p.current=le(p.current,e)}}),[c]),g=R((function(e,r){s((function(n){var t=null!=r?r:!n[e],o=Je(e,t,n,c);return Q().then((function(){for(var e in n){var r=p.current[e];r&&n[e]!=o[e]&&r(o[e])}})),o}))}),[c]),m=R((function(e,r){var n;return null!==(n=v[e])&&void 0!==n?n:r}),[v]),O=R((function(e){if(e)e in v&&g(e);else if(!c)for(var r in v)g(r)}),[v,g,c]),S=R((function(e){if(e)m(e,!0)||g(e);else if(!c)for(var r in v)m(r,!0)||g(r)}),[v,g,m,c]),w=R((function(e){if(e)m(e,!1)&&g(e);else for(var r in v)m(r,!1)&&g(r)}),[v,g,m]);Pe(r,(function(){return{toggle:O,expand:S,collapse:w}}),[O,w,S]);var x=G((function(){return{registerSection:h,toggleExpanded:g,isExpanded:m,animate:t,prefix:y}}),[h,g,m,t,y]);return I(i,_({id:l},f),I(Xe.Provider,{value:x},a))}var qe=ke(Dr);function Je(e,r,n,t){var o;if(t&&r)for(var i in o=ne({},e,r),n)i!=e&&(o[i]=!1);else o=_(_({},n),{},ne({},e,r));return o}function Hr(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,u=void 0!==a&&a,c=e.id,l=e.onExpandStateChange,f=oe(e,Or),d=j(M($r),1)[0],v=c||d,s=j(M(Ze),1)[0],p=j(M(u),2),b=p[0],y=p[1],h=j(M(null),2),g=h[0],m=h[1],O=j(M(null),2),S=O[0],w=O[1],x=D(Xe),A=x.animate,P=x.isExpanded,E=x.prefix,H=x.registerSection,N=x.toggleExpanded,C=P?P(v,u):b,L=null!=A?A:n,U=g||"".concat(E||"a","-content-").concat(v,"-").concat(s),q=S||"".concat(E||"a","-header-").concat(v,"-").concat(s),Z=Y(null);Z.current=l,k((function(){if(H)return H(v,u,Z)}),[H,v,u]);var T=R((function(e){N?N(v,e):y((function(r){var n=null!=e?e:!r;return Q().then((function(){var e=Z.current;e&&e(n)})),n}))}),[v,N]),z=G((function(){return{animate:L,contentId:U,headerId:q,expanded:C,toggleHandler:T,setContentId:m,setHeaderId:w}}),[L,U,q,C,T]);return I(o,_(_({},f),{},{expanded:C}),I(ve.Provider,{value:z},i))}function Lr(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,u=e.role,c=void 0===u?"button":u,l=e.tabIndex,f=void 0===l?0:l,d=oe(e,Pr),v=D(ve),s=v.contentId,p=v.expanded,b=v.headerId,y=v.setHeaderId,h=v.toggleHandler;return k((function(){y&&y(a)}),[y,a]),I(n,_(_({},d),{},{id:b,role:c,className:"".concat(i," ").concat(J," ").concat(Ee),tabIndex:f,"aria-controls":s,onClick:function(){return h()},"aria-expanded":String(p)}),t)}function Ur(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,u=e.role,c=void 0===u?"region":u,l=oe(e,Cr),f=Y(null),d=Y(!1),v=D(ve),s=v.animate,p=v.contentId,b=v.expanded,y=v.headerId,h=v.setContentId;return ce((function(){return d.current=!0,function(){return d.current=!1}}),[]),k((function(){h&&h(a)}),[h,a]),k((function(){var e=d.current,r=f.current;if(s&&e&&r&&r.animate)return b?Le(r):Ue(r)}),[b,s]),I(Me,{renderable:b},I(n,_(_({},l),{},{ref:f,className:i+(" "+J)+(b?"":" "+_e),id:p,"aria-labelledby":y,role:c}),t))} | ||
var Be=Object.create,Z=Object.defineProperty,er=Object.getOwnPropertyDescriptor,rr=Object.getOwnPropertyNames,tr=Object.getPrototypeOf,nr=Object.prototype.hasOwnProperty,Se=function(e){return Z(e,"__esModule",{value:!0})},or=function(e,r){for(var n in Se(e),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=rr(r),i=0,a=o.length;i<a;i++)t=o[i],!nr.call(e,t)&&"default"!==t&&Z(e,t,{get:function(e){return r[e]}.bind(null,t),enumerable:!(n=er(r,t))||n.enumerable});return e},q=function(e){return ar(Se(Z(null!=e?Be(tr(e)):{},"default",e&&e.__esModule&&"default"in e?{get:function(){return e.default},enumerable:!0}:{value:e,enumerable:!0})),e)};or(exports,{Accordion:function(){return qe},AccordionContent:function(){return Ur},AccordionHeader:function(){return Lr},AccordionSection:function(){return Hr}});var K,J="section-child-00fce3c",Ee="header-00fce3c",_e="content-hidden-00fce3c";function Q(){return K||(K=Promise.resolve(void 0))}var H,N=q(require("preact")),Pe=q(require("preact")),v=q(require("preact/hooks"));function I(e,r,n){return N.createElement.apply(void 0,arguments)}function Y(e){return N.createContext(e,void 0)}function M(e){return v.useState(e)}function k(e){return v.useRef(e)}function se(e,r){v.useEffect(e,r)}function F(e,r){v.useLayoutEffect(e,r)}function D(e){return v.useContext(e)}function G(e,r){return v.useMemo(e,r)}function R(e,r){return v.useCallback(e,r)}function Oe(e,r,n){return v.useImperativeHandle(e,r,n)}function B(e,r,n){return r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}var Ie,S={AUTO:"auto",LAZY:"lazy",EAGER:"eager",UNLOAD:"unload"},ir=[S.AUTO,S.LAZY,S.EAGER,S.UNLOAD],Ce=(B(H={},S.AUTO,0),B(H,S.LAZY,1),B(H,S.EAGER,2),B(H,S.UNLOAD,3),H);function de(e,r){var n=Ce[e]||0,t=Ce[r]||0,o=Math.max(n,t);return ir[o]}function we(){return Ie||(Ie=Y({renderable:!0,playable:!0,loading:S.AUTO}))}function Me(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,u=e.renderable,c=void 0===u||u,l=ur(),f=c&&l.renderable,d=f&&a&&l.playable,v=de(f?S.AUTO:S.LAZY,de(t,l.loading)),s=o||l.notify,p=G((function(){return{renderable:f,playable:d,loading:v,notify:s}}),[f,d,v,s]);return I(we().Provider,{children:r,value:p})}function ur(){return D(we())}var Te=Array.isArray,Ne=Object.prototype,dt=Ne.hasOwnProperty,lt=Ne.toString;function je(e){var r=Object.create(null);return e&&Object.assign(r,e),r}function le(e,r){return Object.keys(e).reduce((function(n,t){return r.includes(t)||(n[t]=e[t]),n}),{})}var ee,$e=["Webkit","webkit","Moz","moz","ms","O","o"];function gr(e){return e.charAt(0).toUpperCase()+e.slice(1)}function yr(e,r){for(var n=0;n<$e.length;n++){var t=$e[n]+r;if(void 0!==e[t])return t}return""}function De(e,r,n){if(me(r))return r;ee||(ee=je());var t=ee[r];if(!t||n){if(t=r,void 0===e[r]){var o=yr(e,gr(r));void 0!==e[o]&&(t=o)}n||(ee[r]=t)}return t}function br(e,r,n,t,o){var i=De(e.style,r,o);if(i){var a=t?n+t:n;me(i)?e.style.setProperty(i,a):e.style[i]=a}}function re(e,r,n){var t=De(e.style,r,n);if(t)return me(t)?e.style.getPropertyValue(t):e.style[t]}function pe(e,r){for(var n in r)br(e,n,r[n])}function me(e){return e.startsWith("--")}var He=500,Ar=200,Sr="cubic-bezier(0.47, 0, 0.745, 0.715)",Er="cubic-bezier(0.39, 0.575, 0.565, 1)";function Le(e){return Ye(e,(function(){var r=re(e,"height"),n=re(e,"opacity"),t=re(e,"overflowY");pe(e,{height:0,opacity:0,overflowY:"auto"});var o=e.scrollHeight;pe(e,{height:r,opacity:n,overflowY:t});var i=ke(o);return e.animate([{height:0,opacity:0,overflowY:"hidden"},{height:o+"px",opacity:1,overflowY:"hidden"}],{easing:Sr,duration:i})}))}function Ue(e){return Ye(e,(function(){var r=e.offsetHeight,n=ke(r);return e.animate([{height:r+"px",opacity:1,overflowY:"hidden"},{height:"0",opacity:0,overflowY:"hidden"}],{easing:Er,duration:n})}))}function Ye(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 ke(e){var r=window.innerHeight,n=Math.abs(e)/r*He;return Math.min(Math.max(n,Ar),He)}var te=q(require("preact/compat"));function Fe(e){return te.forwardRef(e)}function Ge(){var e=0;return function(){return String(++e)}}function Ve(e){return function(){return String(Math.floor(Math.random()*e))}}var _r=["animate","as","children","expandSingleSection","id"],Pr=["animate","as","children","expanded","id","onExpandStateChange"],Or=["as","children","className","id","role","tabIndex"],Cr=["as","children","className","id","role"];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 _(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){ne(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 ne(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 Rr(e)||Mr(e,r)||wr(e,r)||Ir()}function Ir(){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 wr(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 Mr(e,r){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var t,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(t=n.next()).done)&&(i.push(t.value),!r||i.length!==r);a=!0);}catch(e){u=!0,o=e}finally{try{!a&&null!=n.return&&n.return()}finally{if(u)throw o}}return i}}function Rr(e){if(Array.isArray(e))return e}function oe(e,r){if(null==e)return{};var n,t,o=Tr(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 Tr(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 Xe=Y({}),ve=Y({}),Nr={},jr={},$r=Ge(),Ze=Ve(1e5);function Dr(e,r){var n=e.animate,t=void 0!==n&&n,o=e.as,i=void 0===o?"section":o,a=e.children,u=e.expandSingleSection,c=void 0!==u&&u,l=e.id,f=oe(e,_r),d=j(M(Nr),2),v=d[0],s=d[1],p=k(jr),b=j(M(Ze),1)[0],y=l||"a".concat(b);se((function(){!c||s((function(e){var r={},n=0;for(var t in e)r[t]=e[t]&&0==n++;return r}))}),[c]);var h=R((function(e,r,n){var t=n.current;return s((function(n){return Je(e,r,n,c)})),p.current=_(_({},p.current),{},ne({},e,t)),function(){s((function(r){return le(r,e)})),p.current=le(p.current,e)}}),[c]),g=R((function(e,r){s((function(n){var t=null!=r?r:!n[e],o=Je(e,t,n,c);return Q().then((function(){for(var e in n){var r=p.current[e];r&&n[e]!=o[e]&&r(o[e])}})),o}))}),[c]),m=R((function(e,r){var n;return null!==(n=v[e])&&void 0!==n?n:r}),[v]),O=R((function(e){if(e)e in v&&g(e);else if(!c)for(var r in v)g(r)}),[v,g,c]),S=R((function(e){if(e)m(e,!0)||g(e);else if(!c)for(var r in v)m(r,!0)||g(r)}),[v,g,m,c]),w=R((function(e){if(e)m(e,!1)&&g(e);else for(var r in v)m(r,!1)&&g(r)}),[v,g,m]);Oe(r,(function(){return{toggle:O,expand:S,collapse:w}}),[O,w,S]);var x=G((function(){return{registerSection:h,toggleExpanded:g,isExpanded:m,animate:t,prefix:y}}),[h,g,m,t,y]);return I(i,_({id:l},f),I(Xe.Provider,{value:x},a))}var qe=Fe(Dr);function Je(e,r,n,t){var o;if(t&&r)for(var i in o=ne({},e,r),n)i!=e&&(o[i]=!1);else o=_(_({},n),{},ne({},e,r));return o}function Hr(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,u=void 0!==a&&a,c=e.id,l=e.onExpandStateChange,f=oe(e,Pr),d=j(M($r),1)[0],v=c||d,s=j(M(Ze),1)[0],p=j(M(u),2),b=p[0],y=p[1],h=j(M(null),2),g=h[0],m=h[1],O=j(M(null),2),S=O[0],w=O[1],x=D(Xe),A=x.animate,P=x.isExpanded,E=x.prefix,H=x.registerSection,N=x.toggleExpanded,Y=P?P(v,u):b,C=null!=A?A:n,L=g||"".concat(E||"a","-content-").concat(v,"-").concat(s),U=S||"".concat(E||"a","-header-").concat(v,"-").concat(s),q=k(null);q.current=l,F((function(){if(H)return H(v,u,q)}),[H,v,u]);var Z=R((function(e){N?N(v,e):y((function(r){var n=null!=e?e:!r;return Q().then((function(){var e=q.current;e&&e(n)})),n}))}),[v,N]),T=G((function(){return{animate:C,contentId:L,headerId:U,expanded:Y,toggleHandler:Z,setContentId:m,setHeaderId:w}}),[C,L,U,Y,Z]);return I(o,_(_({},f),{},{expanded:Y}),I(ve.Provider,{value:T},i))}function Lr(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,u=e.role,c=void 0===u?"button":u,l=e.tabIndex,f=void 0===l?0:l,d=oe(e,Or),v=D(ve),s=v.contentId,p=v.expanded,b=v.headerId,y=v.setHeaderId,h=v.toggleHandler;return F((function(){y&&y(a)}),[y,a]),I(n,_(_({},d),{},{id:b,role:c,className:"".concat(i," ").concat(J," ").concat(Ee),tabIndex:f,"aria-controls":s,onClick:function(){return h()},"aria-expanded":String(p)}),t)}function Ur(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,u=e.role,c=void 0===u?"region":u,l=oe(e,Cr),f=k(null),d=k(!1),v=D(ve),s=v.animate,p=v.contentId,b=v.expanded,y=v.headerId,h=v.setContentId;return se((function(){return d.current=!0,function(){return d.current=!1}}),[]),F((function(){h&&h(a)}),[h,a]),F((function(){var e=d.current,r=f.current;if(s&&e&&r&&r.animate)return b?Le(r):Ue(r)}),[b,s]),I(Me,{renderable:b},I(n,_(_({},l),{},{ref:f,className:i+(" "+J)+(b?"":" "+_e),id:p,"aria-labelledby":y,role:c}),t))} | ||
//# sourceMappingURL=component-preact.js.map | ||
qe.displayName="Accordion"; |
@@ -1,3 +0,3 @@ | ||
var Be=Object.create,Z=Object.defineProperty,er=Object.getOwnPropertyDescriptor,rr=Object.getOwnPropertyNames,tr=Object.getPrototypeOf,nr=Object.prototype.hasOwnProperty,Se=function(e){return Z(e,"__esModule",{value:!0})},or=function(e,r){for(var n in Se(e),r)Z(e,n,{get:r[n],enumerable:!0})},ir=function(e,r,n){if(r&&"object"==typeof r||"function"==typeof r)for(var t,o=rr(r),i=0,a=o.length;i<a;i++)t=o[i],!nr.call(e,t)&&"default"!==t&&Z(e,t,{get:function(e){return r[e]}.bind(null,t),enumerable:!(n=er(r,t))||n.enumerable});return e},q=function(e){return ir(Se(Z(null!=e?Be(tr(e)):{},"default",e&&e.__esModule&&"default"in e?{get:function(){return e.default},enumerable:!0}:{value:e,enumerable:!0})),e)};or(exports,{Accordion:function(){return qe},AccordionContent:function(){return Ur},AccordionHeader:function(){return Lr},AccordionSection:function(){return Hr}});var K,J="section-child-00fce3c",Ee="header-00fce3c",_e="content-hidden-00fce3c";function Q(){return K||(K=Promise.resolve(void 0))}var H,N=q(require("react")),Oe=q(require("react-dom")),v=q(require("react"));function I(e,r,n){return N.createElement.apply(void 0,arguments)}function F(e){return N.createContext(e,void 0)}function M(e){return v.useState(e)}function Y(e){return v.useRef(e)}function ce(e,r){v.useEffect(e,r)}function k(e,r){v.useLayoutEffect(e,r)}function D(e){return v.useContext(e)}function G(e,r){return v.useMemo(e,r)}function R(e,r){return v.useCallback(e,r)}function Pe(e,r,n){return v.useImperativeHandle(e,r,n)}function B(e,r,n){return r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}var Ie,S={AUTO:"auto",LAZY:"lazy",EAGER:"eager",UNLOAD:"unload"},ar=[S.AUTO,S.LAZY,S.EAGER,S.UNLOAD],Ce=(B(H={},S.AUTO,0),B(H,S.LAZY,1),B(H,S.EAGER,2),B(H,S.UNLOAD,3),H);function de(e,r){var n=Ce[e]||0,t=Ce[r]||0,o=Math.max(n,t);return ar[o]}function we(){return Ie||(Ie=F({renderable:!0,playable:!0,loading:S.AUTO}))}function Me(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,u=e.renderable,c=void 0===u||u,l=ur(),f=c&&l.renderable,d=f&&a&&l.playable,v=de(f?S.AUTO:S.LAZY,de(t,l.loading)),s=o||l.notify,p=G((function(){return{renderable:f,playable:d,loading:v,notify:s}}),[f,d,v,s]);return I(we().Provider,{children:r,value:p})}function ur(){return D(we())}var Te=Array.isArray,Ne=Object.prototype,dt=Ne.hasOwnProperty,lt=Ne.toString;function je(e){var r=Object.create(null);return e&&Object.assign(r,e),r}function le(e,r){return Object.keys(e).reduce((function(n,t){return r.includes(t)||(n[t]=e[t]),n}),{})}var ee,$e=["Webkit","webkit","Moz","moz","ms","O","o"];function gr(e){return e.charAt(0).toUpperCase()+e.slice(1)}function yr(e,r){for(var n=0;n<$e.length;n++){var t=$e[n]+r;if(void 0!==e[t])return t}return""}function De(e,r,n){if(me(r))return r;ee||(ee=je());var t=ee[r];if(!t||n){if(t=r,void 0===e[r]){var o=yr(e,gr(r));void 0!==e[o]&&(t=o)}n||(ee[r]=t)}return t}function br(e,r,n,t,o){var i=De(e.style,r,o);if(i){var a=t?n+t:n;me(i)?e.style.setProperty(i,a):e.style[i]=a}}function re(e,r,n){var t=De(e.style,r,n);if(t)return me(t)?e.style.getPropertyValue(t):e.style[t]}function pe(e,r){for(var n in r)br(e,n,r[n])}function me(e){return e.startsWith("--")}var He=500,Ar=200,Sr="cubic-bezier(0.47, 0, 0.745, 0.715)",Er="cubic-bezier(0.39, 0.575, 0.565, 1)";function Le(e){return Fe(e,(function(){var r=re(e,"height"),n=re(e,"opacity"),t=re(e,"overflowY");pe(e,{height:0,opacity:0,overflowY:"auto"});var o=e.scrollHeight;pe(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:Sr,duration:i})}))}function Ue(e){return Fe(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 Fe(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*He;return Math.min(Math.max(n,Ar),He)}var te=q(require("react"));function ke(e){return te.forwardRef(e)}function Ge(){var e=0;return function(){return String(++e)}}function Ve(e){return function(){return String(Math.floor(Math.random()*e))}}var _r=["animate","as","children","expandSingleSection","id"],Or=["animate","as","children","expanded","id","onExpandStateChange"],Pr=["as","children","className","id","role","tabIndex"],Cr=["as","children","className","id","role"];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 _(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){ne(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 ne(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 Rr(e)||Mr(e,r)||wr(e,r)||Ir()}function Ir(){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 wr(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 Mr(e,r){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var t,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(t=n.next()).done)&&(i.push(t.value),!r||i.length!==r);a=!0);}catch(e){u=!0,o=e}finally{try{!a&&null!=n.return&&n.return()}finally{if(u)throw o}}return i}}function Rr(e){if(Array.isArray(e))return e}function oe(e,r){if(null==e)return{};var n,t,o=Tr(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 Tr(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 Xe=F({}),ve=F({}),Nr={},jr={},$r=Ge(),Ze=Ve(1e5);function Dr(e,r){var n=e.animate,t=void 0!==n&&n,o=e.as,i=void 0===o?"section":o,a=e.children,u=e.expandSingleSection,c=void 0!==u&&u,l=e.id,f=oe(e,_r),d=j(M(Nr),2),v=d[0],s=d[1],p=Y(jr),b=j(M(Ze),1)[0],y=l||"a".concat(b);ce((function(){!c||s((function(e){var r={},n=0;for(var t in e)r[t]=e[t]&&0==n++;return r}))}),[c]);var h=R((function(e,r,n){var t=n.current;return s((function(n){return Je(e,r,n,c)})),p.current=_(_({},p.current),{},ne({},e,t)),function(){s((function(r){return le(r,e)})),p.current=le(p.current,e)}}),[c]),g=R((function(e,r){s((function(n){var t=null!=r?r:!n[e],o=Je(e,t,n,c);return Q().then((function(){for(var e in n){var r=p.current[e];r&&n[e]!=o[e]&&r(o[e])}})),o}))}),[c]),m=R((function(e,r){var n;return null!==(n=v[e])&&void 0!==n?n:r}),[v]),O=R((function(e){if(e)e in v&&g(e);else if(!c)for(var r in v)g(r)}),[v,g,c]),S=R((function(e){if(e)m(e,!0)||g(e);else if(!c)for(var r in v)m(r,!0)||g(r)}),[v,g,m,c]),w=R((function(e){if(e)m(e,!1)&&g(e);else for(var r in v)m(r,!1)&&g(r)}),[v,g,m]);Pe(r,(function(){return{toggle:O,expand:S,collapse:w}}),[O,w,S]);var x=G((function(){return{registerSection:h,toggleExpanded:g,isExpanded:m,animate:t,prefix:y}}),[h,g,m,t,y]);return I(i,_({id:l},f),I(Xe.Provider,{value:x},a))}var qe=ke(Dr);function Je(e,r,n,t){var o;if(t&&r)for(var i in o=ne({},e,r),n)i!=e&&(o[i]=!1);else o=_(_({},n),{},ne({},e,r));return o}function Hr(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,u=void 0!==a&&a,c=e.id,l=e.onExpandStateChange,f=oe(e,Or),d=j(M($r),1)[0],v=c||d,s=j(M(Ze),1)[0],p=j(M(u),2),b=p[0],y=p[1],h=j(M(null),2),g=h[0],m=h[1],O=j(M(null),2),S=O[0],w=O[1],x=D(Xe),A=x.animate,P=x.isExpanded,E=x.prefix,H=x.registerSection,N=x.toggleExpanded,C=P?P(v,u):b,L=null!=A?A:n,U=g||"".concat(E||"a","-content-").concat(v,"-").concat(s),q=S||"".concat(E||"a","-header-").concat(v,"-").concat(s),Z=Y(null);Z.current=l,k((function(){if(H)return H(v,u,Z)}),[H,v,u]);var T=R((function(e){N?N(v,e):y((function(r){var n=null!=e?e:!r;return Q().then((function(){var e=Z.current;e&&e(n)})),n}))}),[v,N]),z=G((function(){return{animate:L,contentId:U,headerId:q,expanded:C,toggleHandler:T,setContentId:m,setHeaderId:w}}),[L,U,q,C,T]);return I(o,_(_({},f),{},{expanded:C}),I(ve.Provider,{value:z},i))}function Lr(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,u=e.role,c=void 0===u?"button":u,l=e.tabIndex,f=void 0===l?0:l,d=oe(e,Pr),v=D(ve),s=v.contentId,p=v.expanded,b=v.headerId,y=v.setHeaderId,h=v.toggleHandler;return k((function(){y&&y(a)}),[y,a]),I(n,_(_({},d),{},{id:b,role:c,className:"".concat(i," ").concat(J," ").concat(Ee),tabIndex:f,"aria-controls":s,onClick:function(){return h()},"aria-expanded":String(p)}),t)}function Ur(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,u=e.role,c=void 0===u?"region":u,l=oe(e,Cr),f=Y(null),d=Y(!1),v=D(ve),s=v.animate,p=v.contentId,b=v.expanded,y=v.headerId,h=v.setContentId;return ce((function(){return d.current=!0,function(){return d.current=!1}}),[]),k((function(){h&&h(a)}),[h,a]),k((function(){var e=d.current,r=f.current;if(s&&e&&r&&r.animate)return b?Le(r):Ue(r)}),[b,s]),I(Me,{renderable:b},I(n,_(_({},l),{},{ref:f,className:i+(" "+J)+(b?"":" "+_e),id:p,"aria-labelledby":y,role:c}),t))} | ||
var Be=Object.create,Z=Object.defineProperty,er=Object.getOwnPropertyDescriptor,rr=Object.getOwnPropertyNames,tr=Object.getPrototypeOf,nr=Object.prototype.hasOwnProperty,Se=function(e){return Z(e,"__esModule",{value:!0})},or=function(e,r){for(var n in Se(e),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=rr(r),i=0,a=o.length;i<a;i++)t=o[i],!nr.call(e,t)&&"default"!==t&&Z(e,t,{get:function(e){return r[e]}.bind(null,t),enumerable:!(n=er(r,t))||n.enumerable});return e},q=function(e){return ar(Se(Z(null!=e?Be(tr(e)):{},"default",e&&e.__esModule&&"default"in e?{get:function(){return e.default},enumerable:!0}:{value:e,enumerable:!0})),e)};or(exports,{Accordion:function(){return qe},AccordionContent:function(){return Ur},AccordionHeader:function(){return Lr},AccordionSection:function(){return Hr}});var K,J="section-child-00fce3c",Ee="header-00fce3c",_e="content-hidden-00fce3c";function Q(){return K||(K=Promise.resolve(void 0))}var H,N=q(require("react")),Pe=q(require("react-dom")),v=q(require("react"));function I(e,r,n){return N.createElement.apply(void 0,arguments)}function Y(e){return N.createContext(e,void 0)}function M(e){return v.useState(e)}function k(e){return v.useRef(e)}function se(e,r){v.useEffect(e,r)}function F(e,r){v.useLayoutEffect(e,r)}function D(e){return v.useContext(e)}function G(e,r){return v.useMemo(e,r)}function R(e,r){return v.useCallback(e,r)}function Oe(e,r,n){return v.useImperativeHandle(e,r,n)}function B(e,r,n){return r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}var Ie,S={AUTO:"auto",LAZY:"lazy",EAGER:"eager",UNLOAD:"unload"},ir=[S.AUTO,S.LAZY,S.EAGER,S.UNLOAD],Ce=(B(H={},S.AUTO,0),B(H,S.LAZY,1),B(H,S.EAGER,2),B(H,S.UNLOAD,3),H);function de(e,r){var n=Ce[e]||0,t=Ce[r]||0,o=Math.max(n,t);return ir[o]}function we(){return Ie||(Ie=Y({renderable:!0,playable:!0,loading:S.AUTO}))}function Me(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,u=e.renderable,c=void 0===u||u,l=ur(),f=c&&l.renderable,d=f&&a&&l.playable,v=de(f?S.AUTO:S.LAZY,de(t,l.loading)),s=o||l.notify,p=G((function(){return{renderable:f,playable:d,loading:v,notify:s}}),[f,d,v,s]);return I(we().Provider,{children:r,value:p})}function ur(){return D(we())}var Te=Array.isArray,Ne=Object.prototype,dt=Ne.hasOwnProperty,lt=Ne.toString;function je(e){var r=Object.create(null);return e&&Object.assign(r,e),r}function le(e,r){return Object.keys(e).reduce((function(n,t){return r.includes(t)||(n[t]=e[t]),n}),{})}var ee,$e=["Webkit","webkit","Moz","moz","ms","O","o"];function gr(e){return e.charAt(0).toUpperCase()+e.slice(1)}function yr(e,r){for(var n=0;n<$e.length;n++){var t=$e[n]+r;if(void 0!==e[t])return t}return""}function De(e,r,n){if(me(r))return r;ee||(ee=je());var t=ee[r];if(!t||n){if(t=r,void 0===e[r]){var o=yr(e,gr(r));void 0!==e[o]&&(t=o)}n||(ee[r]=t)}return t}function br(e,r,n,t,o){var i=De(e.style,r,o);if(i){var a=t?n+t:n;me(i)?e.style.setProperty(i,a):e.style[i]=a}}function re(e,r,n){var t=De(e.style,r,n);if(t)return me(t)?e.style.getPropertyValue(t):e.style[t]}function pe(e,r){for(var n in r)br(e,n,r[n])}function me(e){return e.startsWith("--")}var He=500,Ar=200,Sr="cubic-bezier(0.47, 0, 0.745, 0.715)",Er="cubic-bezier(0.39, 0.575, 0.565, 1)";function Le(e){return Ye(e,(function(){var r=re(e,"height"),n=re(e,"opacity"),t=re(e,"overflowY");pe(e,{height:0,opacity:0,overflowY:"auto"});var o=e.scrollHeight;pe(e,{height:r,opacity:n,overflowY:t});var i=ke(o);return e.animate([{height:0,opacity:0,overflowY:"hidden"},{height:o+"px",opacity:1,overflowY:"hidden"}],{easing:Sr,duration:i})}))}function Ue(e){return Ye(e,(function(){var r=e.offsetHeight,n=ke(r);return e.animate([{height:r+"px",opacity:1,overflowY:"hidden"},{height:"0",opacity:0,overflowY:"hidden"}],{easing:Er,duration:n})}))}function Ye(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 ke(e){var r=window.innerHeight,n=Math.abs(e)/r*He;return Math.min(Math.max(n,Ar),He)}var te=q(require("react"));function Fe(e){return te.forwardRef(e)}function Ge(){var e=0;return function(){return String(++e)}}function Ve(e){return function(){return String(Math.floor(Math.random()*e))}}var _r=["animate","as","children","expandSingleSection","id"],Pr=["animate","as","children","expanded","id","onExpandStateChange"],Or=["as","children","className","id","role","tabIndex"],Cr=["as","children","className","id","role"];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 _(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){ne(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 ne(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 Rr(e)||Mr(e,r)||wr(e,r)||Ir()}function Ir(){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 wr(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 Mr(e,r){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var t,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(t=n.next()).done)&&(i.push(t.value),!r||i.length!==r);a=!0);}catch(e){u=!0,o=e}finally{try{!a&&null!=n.return&&n.return()}finally{if(u)throw o}}return i}}function Rr(e){if(Array.isArray(e))return e}function oe(e,r){if(null==e)return{};var n,t,o=Tr(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 Tr(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 Xe=Y({}),ve=Y({}),Nr={},jr={},$r=Ge(),Ze=Ve(1e5);function Dr(e,r){var n=e.animate,t=void 0!==n&&n,o=e.as,i=void 0===o?"section":o,a=e.children,u=e.expandSingleSection,c=void 0!==u&&u,l=e.id,f=oe(e,_r),d=j(M(Nr),2),v=d[0],s=d[1],p=k(jr),b=j(M(Ze),1)[0],y=l||"a".concat(b);se((function(){!c||s((function(e){var r={},n=0;for(var t in e)r[t]=e[t]&&0==n++;return r}))}),[c]);var h=R((function(e,r,n){var t=n.current;return s((function(n){return Je(e,r,n,c)})),p.current=_(_({},p.current),{},ne({},e,t)),function(){s((function(r){return le(r,e)})),p.current=le(p.current,e)}}),[c]),g=R((function(e,r){s((function(n){var t=null!=r?r:!n[e],o=Je(e,t,n,c);return Q().then((function(){for(var e in n){var r=p.current[e];r&&n[e]!=o[e]&&r(o[e])}})),o}))}),[c]),m=R((function(e,r){var n;return null!==(n=v[e])&&void 0!==n?n:r}),[v]),O=R((function(e){if(e)e in v&&g(e);else if(!c)for(var r in v)g(r)}),[v,g,c]),S=R((function(e){if(e)m(e,!0)||g(e);else if(!c)for(var r in v)m(r,!0)||g(r)}),[v,g,m,c]),w=R((function(e){if(e)m(e,!1)&&g(e);else for(var r in v)m(r,!1)&&g(r)}),[v,g,m]);Oe(r,(function(){return{toggle:O,expand:S,collapse:w}}),[O,w,S]);var x=G((function(){return{registerSection:h,toggleExpanded:g,isExpanded:m,animate:t,prefix:y}}),[h,g,m,t,y]);return I(i,_({id:l},f),I(Xe.Provider,{value:x},a))}var qe=Fe(Dr);function Je(e,r,n,t){var o;if(t&&r)for(var i in o=ne({},e,r),n)i!=e&&(o[i]=!1);else o=_(_({},n),{},ne({},e,r));return o}function Hr(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,u=void 0!==a&&a,c=e.id,l=e.onExpandStateChange,f=oe(e,Pr),d=j(M($r),1)[0],v=c||d,s=j(M(Ze),1)[0],p=j(M(u),2),b=p[0],y=p[1],h=j(M(null),2),g=h[0],m=h[1],O=j(M(null),2),S=O[0],w=O[1],x=D(Xe),A=x.animate,P=x.isExpanded,E=x.prefix,H=x.registerSection,N=x.toggleExpanded,Y=P?P(v,u):b,C=null!=A?A:n,L=g||"".concat(E||"a","-content-").concat(v,"-").concat(s),U=S||"".concat(E||"a","-header-").concat(v,"-").concat(s),q=k(null);q.current=l,F((function(){if(H)return H(v,u,q)}),[H,v,u]);var Z=R((function(e){N?N(v,e):y((function(r){var n=null!=e?e:!r;return Q().then((function(){var e=q.current;e&&e(n)})),n}))}),[v,N]),T=G((function(){return{animate:C,contentId:L,headerId:U,expanded:Y,toggleHandler:Z,setContentId:m,setHeaderId:w}}),[C,L,U,Y,Z]);return I(o,_(_({},f),{},{expanded:Y}),I(ve.Provider,{value:T},i))}function Lr(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,u=e.role,c=void 0===u?"button":u,l=e.tabIndex,f=void 0===l?0:l,d=oe(e,Or),v=D(ve),s=v.contentId,p=v.expanded,b=v.headerId,y=v.setHeaderId,h=v.toggleHandler;return F((function(){y&&y(a)}),[y,a]),I(n,_(_({},d),{},{id:b,role:c,className:"".concat(i," ").concat(J," ").concat(Ee),tabIndex:f,"aria-controls":s,onClick:function(){return h()},"aria-expanded":String(p)}),t)}function Ur(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,u=e.role,c=void 0===u?"region":u,l=oe(e,Cr),f=k(null),d=k(!1),v=D(ve),s=v.animate,p=v.contentId,b=v.expanded,y=v.headerId,h=v.setContentId;return se((function(){return d.current=!0,function(){return d.current=!1}}),[]),F((function(){h&&h(a)}),[h,a]),F((function(){var e=d.current,r=f.current;if(s&&e&&r&&r.animate)return b?Le(r):Ue(r)}),[b,s]),I(Me,{renderable:b},I(n,_(_({},l),{},{ref:f,className:i+(" "+J)+(b?"":" "+_e),id:p,"aria-labelledby":y,role:c}),t))} | ||
//# sourceMappingURL=component-react.js.map | ||
qe.displayName="Accordion"; |
{ | ||
"name": "@ampproject/amp-accordion", | ||
"version": "1.2107212010.0", | ||
"version": "1.2107230121.0", | ||
"description": "AMP HTML amp-accordion 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
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
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license.
Found 2 instances 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
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license.
Found 2 instances in 1 package