@dolaanpls/react-awesome-button
Version:
Performant, extendable, highly customisable, production ready React Component that renders an animated basic set of UI buttons
2 lines • 30.4 kB
JavaScript
/*! For license information please see index.js.LICENSE.txt */
!function webpackUniversalModuleDefinition(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["react"],t):"object"==typeof exports?exports["react-awesome-button"]=t(require("react")):e["react-awesome-button"]=t(e.React)}(this,(e=>(()=>{var t={415:function(e){!function webpackUniversalModuleDefinition(t,n){e.exports=n()}(0,(()=>(()=>{"use strict";var e={d:(t,n)=>{for(var c in n)e.o(n,c)&&!e.o(t,c)&&Object.defineProperty(t,c,{enumerable:!0,get:n[c]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{beforeCssLayout:()=>beforeCssLayout,beforeFutureCssLayout:()=>beforeFutureCssLayout,frameThrower:()=>frameThrower,onceAnimationEnd:()=>onceAnimationEnd,onceNextCssLayout:()=>onceNextCssLayout,onceTransitionEnd:()=>onceTransitionEnd,recursiveAnimationFrame:()=>recursiveAnimationFrame,setCssEndEvent:()=>setCssEndEvent});var recursiveAnimationFrame=function(e,t){window&&e&&Number.isInteger(e)&&e>0?window.requestAnimationFrame((function(){recursiveAnimationFrame(e-1,t)})):t()};function setCssEndEvent(e,t,n){var c=void 0===n?{}:n,r=c.tolerance,o=void 0===r?0:r,i=c.propertyName;return new Promise((function(n){var c;if(e){var r=null,l=t.charAt(0).toUpperCase()+t.slice(1),a=0;void 0!==e.style["Webkit".concat(l)]&&(r="webkit".concat(l,"End")),void 0!==(null===(c=e.style)||void 0===c?void 0:c.OTransition)&&(r="o".concat(t,"End")),void 0!==e.style[t]&&(r="".concat(t,"end")),e.clearCssEndEvent&&e.clearCssEndEvent(),e.clearCssEndEvent=function(){e.removeEventListener(r,end)},e.addEventListener(r,end)}else n(!1);function end(t){if((t.srcElement||t.target)===e){if(a>=o){if(i&&i!==t.propertyName)return;e.removeEventListener(r,end),n(t)}a+=1}}}))}function beforeCssLayout(e){"undefined"!=typeof window&&(null===window||void 0===window?void 0:window.requestAnimationFrame)||e(),window.requestAnimationFrame(e)}function beforeFutureCssLayout(e,t){"undefined"!=typeof window&&(null===window||void 0===window?void 0:window.requestAnimationFrame)||t(),recursiveAnimationFrame(e+1,t)}function frameThrower(e){return new Promise((function(t){beforeFutureCssLayout(e,t)}))}function onceNextCssLayout(){return new Promise((function(e){recursiveAnimationFrame(2,e)}))}function onceTransitionEnd(e,t){return void 0===t&&(t={}),new Promise((function(n){setCssEndEvent(e,"transition",t).then(n)}))}function onceAnimationEnd(e,t){return void 0===t&&(t={}),new Promise((function(n){setCssEndEvent(e,"animation",t).then(n)}))}return t})()))},420:(e,t,n)=>{"use strict";e.exports=n(870)},442:t=>{"use strict";t.exports=e},870:(e,t)=>{"use strict";var n=Symbol.for("react.transitional.element");function jsxProd(e,t,c){var r=null;if(void 0!==c&&(r=""+c),void 0!==t.key&&(r=""+t.key),"key"in t)for(var o in c={},t)"key"!==o&&(c[o]=t[o]);else c=t;return t=c.ref,{$$typeof:n,type:e,key:r,ref:void 0!==t?t:null,props:c}}Symbol.for("react.fragment"),t.jsx=jsxProd,t.jsxs=jsxProd}},n={};function __webpack_require__(e){var c=n[e];if(void 0!==c)return c.exports;var r=n[e]={exports:{}};return t[e].call(r.exports,r,r.exports,__webpack_require__),r.exports}__webpack_require__.d=(e,t)=>{for(var n in t)__webpack_require__.o(t,n)&&!__webpack_require__.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var c={};return(()=>{"use strict";__webpack_require__.r(c),__webpack_require__.d(c,{AwesomeButton:()=>components_AwesomeButton,AwesomeButtonProgress:()=>components_AwesomeButtonProgress,AwesomeButtonSocial:()=>components_AwesomeButtonSocial});var e=__webpack_require__(420),t=__webpack_require__(442),n=__webpack_require__(415),r=["middle","left","right"];function serialize(e,t){return void 0===t&&(t="&"),Object.entries(e).map((function(e){var t=e[0],n=e[1];return"".concat(t,"=").concat(n)})).join(t)}function classToModules(e,t){if(void 0===e&&(e=[]),!t)return e.join(" ").trim();for(var n=[],c=e.length;c--;)t[e[c]]&&n.push(t[e[c]]);return n.join(" ").trim()}function getClassName(e,t){return void 0===e&&(e=""),t&&t[e]||e}function toggleMoveClasses(e){var t,n=e.element,c=e.root,o=e.cssModule,i=void 0===o?null:o,l=e.state,a=void 0===l?null:l;if(!(null===(t=null==n?void 0:n.classList)||void 0===t?void 0:t.remove))return!1;if(!a)return[classToModules(["".concat(c,"--").concat(r[0])],i),classToModules(["".concat(c,"--").concat(r[1])],i),classToModules(["".concat(c,"--").concat(r[2])],i)].forEach((function(e){e&&n.classList.remove(e)})),!1;for(var s=r.filter((function(e){return e!==a})),u=s.length;u--;){var d=classToModules(["".concat(c,"--").concat(s[u])],i);d&&n.classList.remove(d)}var v=classToModules(["".concat(c,"--").concat(a)],i);return v&&n.classList.add(v),!0}var __assign=function(){return __assign=Object.assign||function(e){for(var t,n=1,c=arguments.length;n<c;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},__assign.apply(this,arguments)},o="undefined"!=typeof window,i=o&&"ontouchstart"in window||o&&navigator.maxTouchPoints>0,l=t.forwardRef((function(t,n){return(0,e.jsx)("a",__assign({ref:n},t))})),a=t.forwardRef((function(t,n){return(0,e.jsx)("button",__assign({ref:n},t))}));const components_AwesomeButton=function(c){var r=c.active,s=void 0!==r&&r,u=c.after,d=void 0===u?null:u,v=c.before,f=void 0===v?null:v,p=c.between,h=void 0!==p&&p,m=c.children,w=void 0===m?null:m,b=c.className,g=void 0===b?null:b,y=c.containerProps,M=void 0===y?{}:y,C=c.cssModule,_=void 0===C?null:C,E=c.disabled,L=void 0!==E&&E,x=c.element,z=void 0===x?null:x,j=c.extra,O=void 0===j?null:j,k=c.href,S=void 0===k?null:k,P=c.moveEvents,T=void 0===P||P,q=c.onMouseDown,N=void 0===q?null:q,R=c.onMouseUp,A=void 0===R?null:R,F=c.onPress,H=void 0===F?null:F,V=c.onPressed,D=void 0===V?null:V,W=c.onReleased,Y=void 0===W?null:W,B=c.placeholder,U=void 0===B||B,I=c.ripple,X=void 0!==I&&I,G=c.rootElement,$=void 0===G?"aws-btn":G,J=c.size,K=void 0===J?null:J,Q=c.style,Z=void 0===Q?{}:Q,ee=c.type,te=void 0===ee?"primary":ee,ne=c.visible,ce=void 0===ne||ne,re=t.useState(null),oe=re[0],ie=re[1],le=t.useRef(null),ae=t.useRef(null),se=t.useRef(null),ue=t.useRef(null),de=t.useRef(!1),ve=t.useRef(0),fe=t.useRef(null),pe=t.useRef(0),he=z||(S?l:a),me={href:S},we=t.useMemo((function(){return!0===U&&!w||L}),[U,w,L]);t.useEffect((function(){return(null==le?void 0:le.current)&&(se.current=le.current.parentNode),function(){(null==fe?void 0:fe.current)&&clearTimeout(fe.current)}}),[]);t.useEffect((function(){null!==oe&&!1===s&&clearPress({force:!0})}),[s]);var be,clearPressCallback=function(){ve.current=0,Y&&Y(se.current)},clearPress=function(e){var t,c=void 0===e?{}:e,r=c.force,o=void 0!==r&&r,i=c.leave,l=void 0!==i&&i;if(toggleMoveClasses({element:se.current,root:$,cssModule:_}),!0!==l||0!==ve.current){var a=s&&!o?"".concat($,"--active"):null;(null===(t=null==ae?void 0:ae.current)||void 0===t?void 0:t.clearCssEvent)&&ae.current.clearCssEvent(),null===a&&(null==oe?void 0:oe.match(/active/gim))&&(0,n.setCssEndEvent)(ae.current,"transition",{tolerance:1}).then(clearPressCallback),ie(a)}},createRipple=function(e){!function createRippleEffect(e){var t,c,r=e.event,o=e.button,i=e.content,l=e.className,a=o.getBoundingClientRect(),s=window.pageYOffset||document.documentElement.scrollTop||0,u=document.createElement("span"),d=a.width<50?3*a.width:2*a.width;r.nativeEvent instanceof TouchEvent?(t=r.changedTouches[0].pageX,c=r.changedTouches[0].pageY):(t=r.pageX,c=r.pageY),u.className=l,u.style.top="-".concat(d/2-(c-a.top-s),"px"),u.style.left="-".concat(d/2-(t-a.left),"px"),u.style.width="".concat(d,"px"),u.style.height="".concat(d,"px"),(0,n.setCssEndEvent)(u,"animation").then((function(){window.requestAnimationFrame((function(){i.removeChild(u)}))})),window.requestAnimationFrame((function(){i.appendChild(u)}))}({event:e,button:le.current,content:ae.current,className:getClassName("".concat($,"__bubble"),_)})},pressIn=function(e){!0!==we&&2!==ve.current&&(ve.current=1,(0,n.setCssEndEvent)(ae.current,"transition",{tolerance:1}).then((function(){return D&&D(e)})),ie("".concat($,"--active")))},pressOut=function(e){if(!0!==we&&1===ve.current){if(fe.current&&clearTimeout(fe.current),!0===X&&createRipple(e),o&&le.current){var t=new Event("btn-press");le.current.dispatchEvent(t)}handleAction(e),!0!==s?clearPress():ve.current=2}},handleAction=function(e){se.current&&H&&H(e)};return(0,e.jsx)(he,__assign({style:Z,className:t.useMemo((function(){var e=[$,te&&"".concat($,"--").concat(te),K&&"".concat($,"--").concat(K),ce&&"".concat($,"--visible"),h&&"".concat($,"--between"),U&&!w&&"".concat($,"--placeholder")||null];return!0===we&&e.push("".concat($,"--disabled")),oe&&e.push(oe),g&&e.push.apply(e,g.split(" ")),_&&_["aws-btn"]?classToModules(e,_):e.join(" ").trim().replace(/[\s]+/gi," ")}),[$,te,K,ce,h,U,w,we,oe,g,_]),role:"button",ref:se},M,me,(be={onClick:function(e){S&&we&&e.preventDefault()}},i?(be.onTouchStart=function(e){var t,n;N&&N(e),pe.current=null===(n=null===(t=null==e?void 0:e.changedTouches)||void 0===t?void 0:t[0])||void 0===n?void 0:n.clientY,pressIn(e)},be.onTouchEnd=function(e){var t,n;A&&A(e),(pe.current&&(null===(n=null===(t=null==e?void 0:e.changedTouches)||void 0===t?void 0:t[0])||void 0===n?void 0:n.clientY)?Math.abs(pe.current-e.changedTouches[0].clientY):0)>le.current.offsetHeight?clearPress({force:!0}):pressOut(e)},be):(be.onMouseLeave=function(){de.current=!1,!0!==s||2===ve.current?clearPress({leave:!0}):clearPress({force:!0})},be.onMouseDown=function(e){var t;N&&N(e),0===(null===(t=null==e?void 0:e.nativeEvent)||void 0===t?void 0:t.button)&&pressIn(e)},be.onMouseUp=function(e){A&&A(e),!0!==we?pressOut(e):e.preventDefault()},!0===T?(be.onMouseMove=function(e){if(!0!==we){de.current=!0;var t=le.current,n=t.getBoundingClientRect().left,c=t.offsetWidth,r=e.pageX<n+.3*c?"left":e.pageX>n+.65*c?"right":"middle";toggleMoveClasses({element:se.current,root:$,cssModule:_,state:r})}},be):(be.onMouseEnter=function(){de.current=!0,toggleMoveClasses({element:se.current,root:$,cssModule:_,state:"middle"})},be))),{children:(0,e.jsxs)("span",__assign({ref:le,className:getClassName("".concat($,"__wrapper"),_)},{children:[(0,e.jsxs)("span",__assign({ref:ae,className:getClassName("".concat($,"__content"),_)},{children:[f,(0,e.jsx)("span",__assign({ref:ue},{children:w})),d]})),O]}))}))};var sharer_assign=function(){return sharer_assign=Object.assign||function(e){for(var t,n=1,c=arguments.length;n<c;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},sharer_assign.apply(this,arguments)};function Sharer(e){var t=e.url,n=e.message,c=e.title,r=e.image,o=e.user,i=e.type,l=e.phone,a=e.width,s=e.height,u={},d={};switch(i){case"facebook":d.u=encodeURIComponent(t),u.url="https://www.facebook.com/sharer.php?".concat(serialize(d,"&")),u.title="Facebook Sharer";break;case"twitter":d.text=n,d.url=t,u.height=250,u.url="https://twitter.com/share?".concat(serialize(d,"&")),u.title="Twitter Sharer";break;case"pinterest":d.url=t,r&&(d.media=r),u.url="https://pinterest.com/pin/create/button/?".concat(serialize(d,"&")),u.title="Pinterest Sharer";break;case"google":case"gplus":d.url=t,u.url="https://plus.google.com/share?".concat(serialize(d,"&")),u.title="Google+ Sharer",u.width=400;break;case"linkedin":d.mini=!0,d.url=t,d.title=n||c,u.url="https://www.linkedin.com/shareArticle?".concat(serialize(d,"&")),u.title="Linkedin Sharer";break;case"reddit":d.url=t,d.title=n||c,u.url="https://www.reddit.com/submit?".concat(serialize(d,"&")),u.title="",u.width=850;break;case"whatsapp":d.phone=null==l?void 0:l.replace(/\+|(|)/gim,""),d.title=n||c,u.url="https://api.whatsapp.com/send?".concat(serialize(d,"&")),u.title="Whatsapp Message",u.width=850;break;case"messenger":u.url="https://m.me/".concat(o),u.title="Messenger Message",u.width=850;break;case"mail":u.url="mailto:".concat(t),u.title="_self";break;case"instagram":u.url=t,u.title="_self";break;default:return u}return u.extra=serialize(sharer_assign({width:"".concat(u.width||a,"px"),height:"".concat(u.height||s,"px")},function centerWindow(e,t){if("undefined"==typeof window)return{top:0,left:0};var n=window.screenLeft,c=void 0===n?0:n,r=window.screenTop,o=void 0===r?0:r,i=window.innerWidth,l=window.innerHeight,a=i||(document.documentElement.clientWidth?document.documentElement.clientWidth:0);return{top:(l||(document.documentElement.clientHeight?document.documentElement.clientHeight:0))/2-t/2+o,left:a/2-e/2+c}}(u.width||a,u.height||s)),","),u}var icons_assign=function(){return icons_assign=Object.assign||function(e){for(var t,n=1,c=arguments.length;n<c;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},icons_assign.apply(this,arguments)},s={youtube:"M38.1,23H11.9c-4.1,0-7.6,3.4-7.6,7.6v6.1c0,4.1,3.4,7.6,7.6,7.6h26.3c4.1,0,7.6-3.4,7.6-7.6v-6.1C45.8,26.4,42.4,23,38.1,23z M17.4,27.7h-2.5v12.2h-2.4V27.7h-2.5v-2h7.3V27.7z M24.3,39.9h-2.1v-1.2c-0.4,0.4-0.8,0.8-1.2,0.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5,4,4.9c1.1,0.9,2.3,1.5,3.6,2.2c0.4,0.2,0.7,0.2,1-0.2c0.6-0.7,1.3-1.4,1.9-2.1c0.4-0.5,0.6-0.6,1.1-0.3c1.5,0.8,3.1,1.6,4.6,2.4C36.8,29,36.9,29.3,36.8,29.8z",messenger:"M27.5,30l-5.4-5.7L11.7,30l11.5-12.2l5.5,5.7L39,17.8L27.5,30z M25.5,3.8c-11.6,0-21.1,8.7-21.1,19.5c0,6.1,3.1,11.6,7.9,15.2v7.4l7.2-3.9c1.9,0.5,3.9,0.8,6,0.8c11.6,0,21.1-8.7,21.1-19.5S37.1,3.8,25.5,3.8z",instagram:"M25,13.3c-5.8,0-10.6,4.7-10.6,10.6S19.1,34.6,25,34.6S35.6,29.8,35.6,24S30.8,13.3,25,13.3z M25,30.7c-3.7,0-6.8-3.1-6.8-6.8s3.1-6.8,6.8-6.8s6.8,3.1,6.8,6.8S28.7,30.7,25,30.7z M36.1,10.6c1.3,0,2.4,1.1,2.4,2.4s-1.1,2.4-2.4,2.4c-1.3,0-2.4-1.1-2.4-2.4S34.7,10.6,36.1,10.6z M42.3,6.8c-2.2-2.2-5.2-3.4-8.7-3.4H16.4c-7.2,0-12,4.8-12,12v17c0,3.6,1.2,6.7,3.5,8.9c2.2,2.2,5.2,3.2,8.6,3.2h17c3.6,0,6.6-1.2,8.7-3.2c2.2-2.2,3.4-5.2,3.4-8.8V15.4C45.6,11.9,44.5,8.9,42.3,6.8z M42,32.6c0,2.6-0.9,4.7-2.4,6.1s-3.6,2.2-6.1,2.2h-17c-2.5,0-4.6-0.7-6.1-2.2s-2.2-3.6-2.2-6.2v-17c0-2.5,0.7-4.6,2.2-6.1C11.8,8,14,7.2,16.5,7.2h17.1c2.5,0,4.6,0.7,6.1,2.2c1.4,1.5,2.2,3.6,2.2,6v17.2H42z",twitter:"M49.3,9.1c-1.8,0.8-3.6,1.3-5.6,1.5c2-1.2,3.6-3.1,4.3-5.4c-1.9,1.1-4,1.9-6.2,2.4c-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0.5C33.3,29.5,33.1,29.3,32.9,29.2zM16.8,19.8c-1.7,0-3.1,1.4-3.1,3.1s1.4,3.1,3.1,3.1s3.1-1.4,3.1-3.1C19.9,21.1,18.5,19.8,16.8,19.8z M32.1,19.8c-1.7,0-3.1,1.4-3.1,3.1s1.4,3.1,3.1,3.1s3.1-1.4,3.1-3.1C35.1,21.1,33.8,19.8,32.1,19.8z"};const u=function getIcon(t){var n=t.type,c=t.width,r=t.height,o=t.color;return(0,e.jsx)("svg",icons_assign({version:"1.1",xmlns:"http://www.w3.org/2000/svg",preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 50 50",width:c,height:r},{children:(0,e.jsx)("path",{fill:o,d:s[n]})}))};var AwesomeButtonSocial_assign=function(){return AwesomeButtonSocial_assign=Object.assign||function(e){for(var t,n=1,c=arguments.length;n<c;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},AwesomeButtonSocial_assign.apply(this,arguments)},__rest=function(e,t){var n={};for(var c in e)Object.prototype.hasOwnProperty.call(e,c)&&t.indexOf(c)<0&&(n[c]=e[c]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(c=Object.getOwnPropertySymbols(e);r<c.length;r++)t.indexOf(c[r])<0&&Object.prototype.propertyIsEnumerable.call(e,c[r])&&(n[c[r]]=e[c[r]])}return n};const components_AwesomeButtonSocial=function(n){var c=n.onPress,r=void 0===c?null:c,o=n.children,i=void 0===o?null:o,l=n.icon,a=void 0===l||l,s=n.sharer,d=void 0===s?{}:s,v=n.dimensions,f=void 0===v?{width:640,height:480}:v,p=n.type,h=__rest(n,["onPress","children","icon","sharer","dimensions","type"]),m="undefined"!=typeof window,w=t.useRef(function isMobile(){var e;return"undefined"!=typeof navigator&&(null===(e=null===navigator||void 0===navigator?void 0:navigator.userAgent)||void 0===e?void 0:e.match(/iPhone|iPad|iPod|Android/i))}()).current,getMessage=function(){if(null==d?void 0:d.message)return d.message;if(m){var e=document.querySelector("title");if(null==e?void 0:e.innerHTML)return e.innerHTML}return null},getImage=function(){if(null==d?void 0:d.image)return d.image;if(null!==m){var e=document.querySelector('meta[property="og:image"]');if(e)return e.getAttribute("content")}return null};return(0,e.jsx)(components_AwesomeButton,AwesomeButtonSocial_assign({type:p,onPress:function(e){if(r)r(e);else if(!h.href){var t=Sharer({height:null==f?void 0:f.height,width:null==f?void 0:f.width,url:(null==d?void 0:d.url)?d.url:m?window.location.href:null,message:getMessage(),image:getImage(),type:p,user:d.user,phone:d.phone});(null==t?void 0:t.url)&&((null===navigator||void 0===navigator?void 0:navigator.share)&&w?navigator.share({url:t.url,text:t.text,title:t.title}):m&&window.open(t.url,t.title,t.extra))}}},h,{before:a?u({type:p,width:!0===a?24:a.width||24,height:!0===a?24:a.height||24,color:h.disabled?"rgba(255,255,255,0.35)":"#FFF"}):null},{children:i}))};var AwesomeButtonProgress_assign=function(){return AwesomeButtonProgress_assign=Object.assign||function(e){for(var t,n=1,c=arguments.length;n<c;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},AwesomeButtonProgress_assign.apply(this,arguments)},__awaiter=function(e,t,n,c){return new(n||(n=Promise))((function(r,o){function fulfilled(e){try{step(c.next(e))}catch(e){o(e)}}function rejected(e){try{step(c.throw(e))}catch(e){o(e)}}function step(e){e.done?r(e.value):function adopt(e){return e instanceof n?e:new n((function(t){t(e)}))}(e.value).then(fulfilled,rejected)}step((c=c.apply(e,t||[])).next())}))},__generator=function(e,t){var n,c,r,o,i={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function verb(l){return function(a){return function step(l){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,l[0]&&(i=0)),i;)try{if(n=1,c&&(r=2&l[0]?c.return:l[0]?c.throw||((r=c.return)&&r.call(c),0):c.next)&&!(r=r.call(c,l[1])).done)return r;switch(c=0,r&&(l=[2&l[0],r.value]),l[0]){case 0:case 1:r=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,c=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!(r=i.trys,(r=r.length>0&&r[r.length-1])||6!==l[0]&&2!==l[0])){i=0;continue}if(3===l[0]&&(!r||l[1]>r[0]&&l[1]<r[3])){i.label=l[1];break}if(6===l[0]&&i.label<r[1]){i.label=r[1],r=l;break}if(r&&i.label<r[2]){i.label=r[2],i.ops.push(l);break}r[2]&&i.ops.pop(),i.trys.pop();continue}l=t.call(e,i)}catch(e){l=[6,e],c=0}finally{n=r=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,a])}}},AwesomeButtonProgress_rest=function(e,t){var n={};for(var c in e)Object.prototype.hasOwnProperty.call(e,c)&&t.indexOf(c)<0&&(n[c]=e[c]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(c=Object.getOwnPropertySymbols(e);r<c.length;r++)t.indexOf(c[r])<0&&Object.prototype.propertyIsEnumerable.call(e,c[r])&&(n[c[r]]=e[c[r]])}return n},d="undefined"!=typeof window;const components_AwesomeButtonProgress=function(c){var r=c.onPress,o=void 0===r?null:r,i=c.rootElement,l=void 0===i?null:i,a=c.loadingLabel,s=void 0===a?"Wait..":a,u=c.resultLabel,v=void 0===u?"Success!":u,f=(c.disabled,c.cssModule),p=void 0===f?null:f,h=c.children,m=void 0===h?null:h,w=c.size,b=void 0===w?null:w,g=c.type,y=void 0===g?null:g,M=c.releaseDelay,C=void 0===M?500:M,_=AwesomeButtonProgress_rest(c,["onPress","rootElement","loadingLabel","resultLabel","disabled","cssModule","children","size","type","releaseDelay"]),E=l||"aws-btn",L=t.useRef(null),x=t.useRef(null),z=function(e){var n=t.useState(e),c=n[0],r=n[1],o=t.useRef(e);return[c,function(e){var t=AwesomeButtonProgress_assign(AwesomeButtonProgress_assign({},o.current),e);o.current=t,r(t)},o.current]}({loadingEnd:!1,loadingStart:!1,loadingError:!1,errorLabel:null,active:!1}),j=(z[0],z[1]),O=z[2];t.useEffect((function(){return function(){(null==L?void 0:L.current)&&clearTimeout(L.current)}}),[]);var k,S,P,endLoading=function(e,t){void 0===e&&(e=!0),void 0===t&&(t=null),j({loadingEnd:!0,loadingError:!e,errorLabel:t})},clearStagedWrapperAnimation=function(){L.current=setTimeout((function(){d&&(0,n.beforeFutureCssLayout)(2,(function(){var e;e=function(){j({loadingError:!1,errorLabel:null})},j({loadingStart:!1,loadingEnd:!1,active:!1}),(0,n.beforeFutureCssLayout)(2,e)}))}),C)},T=t.useCallback((function(){j({active:!0})}),[j]),q=O.active,N=O.errorLabel;return(0,e.jsx)(components_AwesomeButton,AwesomeButtonProgress_assign({size:b,type:y,className:(k=O.loadingStart,S=O.loadingEnd,P=O.loadingError,[k&&"".concat(E,"--start")||null,S&&"".concat(E,"--end")||null,P&&"".concat(E,"--errored")||null,"".concat(E,"--progress")].join(" ").trim().replace(/[\s]+/gi," ")),onPress:function(e){return __awaiter(void 0,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:return!0===(null==O?void 0:O.loadingStart)?[2]:((0,n.beforeFutureCssLayout)(4,(function(){j({loadingStart:!0})})),[4,(0,n.onceTransitionEnd)(x.current)]);case 1:return t.sent(),o&&o(e,endLoading),(0,n.setCssEndEvent)(x.current,"transition",{tolerance:3}).then(clearStagedWrapperAnimation),[2]}}))}))},onMouseDown:T,cssModule:p,active:q,extra:(0,e.jsx)("span",{children:(0,e.jsx)("span",{ref:x,"data-loading":s||null,"data-status":N||v||null,className:getClassName("".concat(E,"__progress"),p)})})},_,{children:(0,e.jsx)("span",{children:m})}))}})(),c})()));