@rabbitio/ui-kit 1.0.0-beta.2 → 1.0.0-beta.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +0 -0
- package/README.md +23 -16
- package/dist/index.cjs +4404 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +8757 -1
- package/dist/index.css.map +1 -1
- package/dist/index.modern.js +3692 -1
- package/dist/index.modern.js.map +1 -1
- package/dist/index.module.js +4375 -1
- package/dist/index.module.js.map +1 -1
- package/dist/index.umd.js +4406 -1
- package/dist/index.umd.js.map +1 -1
- package/index.js +1 -1
- package/package.json +17 -24
- package/src/common/amountUtils.js +423 -0
- package/src/common/errorUtils.js +27 -0
- package/src/common/fiatCurrenciesService.js +161 -0
- package/src/common/models/blockchain.js +10 -0
- package/src/common/models/coin.js +157 -0
- package/src/common/models/protocol.js +5 -0
- package/src/common/utils/cache.js +268 -0
- package/src/common/utils/emailAPI.js +18 -0
- package/src/common/utils/logging/logger.js +48 -0
- package/src/common/utils/logging/logsStorage.js +61 -0
- package/src/common/utils/safeStringify.js +50 -0
- package/src/components/atoms/AssetIcon/AssetIcon.jsx +55 -0
- package/src/components/atoms/AssetIcon/asset-icon.module.scss +42 -0
- package/{stories → src/components}/atoms/LoadingDots/LoadingDots.module.scss +1 -1
- package/src/components/atoms/SupportChat/SupportChat.jsx +40 -0
- package/{stories → src/components}/atoms/buttons/Button/Button.jsx +6 -6
- package/{stories → src/components}/atoms/buttons/Button/Button.module.scss +6 -1
- package/src/components/hooks/useCallHandlingErrors.js +26 -0
- package/src/components/hooks/useReferredState.js +24 -0
- package/src/index.js +33 -0
- package/src/swaps-lib/external-apis/swapProvider.js +169 -0
- package/src/swaps-lib/external-apis/swapspaceSwapProvider.js +812 -0
- package/src/swaps-lib/models/baseSwapCreationInfo.js +40 -0
- package/src/swaps-lib/models/existingSwap.js +58 -0
- package/src/swaps-lib/models/existingSwapWithFiatData.js +115 -0
- package/src/swaps-lib/services/publicSwapService.js +602 -0
- package/src/swaps-lib/utils/swapUtils.js +209 -0
- package/stories/index.js +0 -2
- /package/{stories → src/components}/atoms/LoadingDots/LoadingDots.jsx +0 -0
package/dist/index.cjs
CHANGED
|
@@ -1,2 +1,4405 @@
|
|
|
1
|
-
var m=require("react"),_=require("react-router-dom");function l(m){var _={exports:{}};return m(_,_.exports),_.exports}var t="function"==typeof Symbol&&Symbol.for,p=t?Symbol.for("react.element"):60103,r=t?Symbol.for("react.portal"):60106,e=t?Symbol.for("react.fragment"):60107,n=t?Symbol.for("react.strict_mode"):60108,o=t?Symbol.for("react.profiler"):60114,s=t?Symbol.for("react.provider"):60109,i=t?Symbol.for("react.context"):60110,a=t?Symbol.for("react.async_mode"):60111,d=t?Symbol.for("react.concurrent_mode"):60111,x=t?Symbol.for("react.forward_ref"):60112,c=t?Symbol.for("react.suspense"):60113,y=t?Symbol.for("react.suspense_list"):60120,u=t?Symbol.for("react.memo"):60115,g=t?Symbol.for("react.lazy"):60116,b=t?Symbol.for("react.block"):60121,f=t?Symbol.for("react.fundamental"):60117,v=t?Symbol.for("react.responder"):60118,S=t?Symbol.for("react.scope"):60119;function w(m){if("object"==typeof m&&null!==m){var _=m.$$typeof;switch(_){case p:switch(m=m.type){case a:case d:case e:case o:case n:case c:return m;default:switch(m=m&&m.$$typeof){case i:case x:case g:case u:case s:return m;default:return _}}case r:return _}}}function T(m){return w(m)===d}var O={AsyncMode:a,ConcurrentMode:d,ContextConsumer:i,ContextProvider:s,Element:p,ForwardRef:x,Fragment:e,Lazy:g,Memo:u,Portal:r,Profiler:o,StrictMode:n,Suspense:c,isAsyncMode:function(m){return T(m)||w(m)===a},isConcurrentMode:T,isContextConsumer:function(m){return w(m)===i},isContextProvider:function(m){return w(m)===s},isElement:function(m){return"object"==typeof m&&null!==m&&m.$$typeof===p},isForwardRef:function(m){return w(m)===x},isFragment:function(m){return w(m)===e},isLazy:function(m){return w(m)===g},isMemo:function(m){return w(m)===u},isPortal:function(m){return w(m)===r},isProfiler:function(m){return w(m)===o},isStrictMode:function(m){return w(m)===n},isSuspense:function(m){return w(m)===c},isValidElementType:function(m){return"string"==typeof m||"function"==typeof m||m===e||m===d||m===o||m===n||m===c||m===y||"object"==typeof m&&null!==m&&(m.$$typeof===g||m.$$typeof===u||m.$$typeof===s||m.$$typeof===i||m.$$typeof===x||m.$$typeof===f||m.$$typeof===v||m.$$typeof===S||m.$$typeof===b)},typeOf:w},E=l(function(m,_){"production"!==process.env.NODE_ENV&&function(){var m="function"==typeof Symbol&&Symbol.for,l=m?Symbol.for("react.element"):60103,t=m?Symbol.for("react.portal"):60106,p=m?Symbol.for("react.fragment"):60107,r=m?Symbol.for("react.strict_mode"):60108,e=m?Symbol.for("react.profiler"):60114,n=m?Symbol.for("react.provider"):60109,o=m?Symbol.for("react.context"):60110,s=m?Symbol.for("react.async_mode"):60111,i=m?Symbol.for("react.concurrent_mode"):60111,a=m?Symbol.for("react.forward_ref"):60112,d=m?Symbol.for("react.suspense"):60113,x=m?Symbol.for("react.suspense_list"):60120,c=m?Symbol.for("react.memo"):60115,y=m?Symbol.for("react.lazy"):60116,u=m?Symbol.for("react.block"):60121,g=m?Symbol.for("react.fundamental"):60117,b=m?Symbol.for("react.responder"):60118,f=m?Symbol.for("react.scope"):60119;function h(m){if("object"==typeof m&&null!==m){var _=m.$$typeof;switch(_){case l:var x=m.type;switch(x){case s:case i:case p:case e:case r:case d:return x;default:var u=x&&x.$$typeof;switch(u){case o:case a:case y:case c:case n:return u;default:return _}}case t:return _}}}var v=i,S=o,w=n,T=l,O=a,E=p,k=y,P=c,C=t,j=e,B=r,I=d,N=!1;function R(m){return h(m)===i}_.AsyncMode=s,_.ConcurrentMode=v,_.ContextConsumer=S,_.ContextProvider=w,_.Element=T,_.ForwardRef=O,_.Fragment=E,_.Lazy=k,_.Memo=P,_.Portal=C,_.Profiler=j,_.StrictMode=B,_.Suspense=I,_.isAsyncMode=function(m){return N||(N=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),R(m)||h(m)===s},_.isConcurrentMode=R,_.isContextConsumer=function(m){return h(m)===o},_.isContextProvider=function(m){return h(m)===n},_.isElement=function(m){return"object"==typeof m&&null!==m&&m.$$typeof===l},_.isForwardRef=function(m){return h(m)===a},_.isFragment=function(m){return h(m)===p},_.isLazy=function(m){return h(m)===y},_.isMemo=function(m){return h(m)===c},_.isPortal=function(m){return h(m)===t},_.isProfiler=function(m){return h(m)===e},_.isStrictMode=function(m){return h(m)===r},_.isSuspense=function(m){return h(m)===d},_.isValidElementType=function(m){return"string"==typeof m||"function"==typeof m||m===p||m===i||m===e||m===r||m===d||m===x||"object"==typeof m&&null!==m&&(m.$$typeof===y||m.$$typeof===c||m.$$typeof===n||m.$$typeof===o||m.$$typeof===a||m.$$typeof===g||m.$$typeof===b||m.$$typeof===f||m.$$typeof===u)},_.typeOf=h}()}),k=l(function(m){m.exports="production"===process.env.NODE_ENV?O:E}),P=Object.getOwnPropertySymbols,C=Object.prototype.hasOwnProperty,j=Object.prototype.propertyIsEnumerable,B=function(){try{if(!Object.assign)return!1;var m=new String("abc");if(m[5]="de","5"===Object.getOwnPropertyNames(m)[0])return!1;for(var _={},l=0;l<10;l++)_["_"+String.fromCharCode(l)]=l;var t=Object.getOwnPropertyNames(_).map(function(m){return _[m]});if("0123456789"!==t.join(""))return!1;var p={};return"abcdefghijklmnopqrst".split("").forEach(function(m){p[m]=m}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},p)).join("")}catch(m){return!1}}()?Object.assign:function(m,_){for(var l,t,p=function(m){if(null==m)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(m)}(m),r=1;r<arguments.length;r++){for(var e in l=Object(arguments[r]))C.call(l,e)&&(p[e]=l[e]);if(P){t=P(l);for(var n=0;n<t.length;n++)j.call(l,t[n])&&(p[t[n]]=l[t[n]])}}return p},I=Function.call.bind(Object.prototype.hasOwnProperty),N="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",R=I,q=function(){};if("production"!==process.env.NODE_ENV){var K=N,D={},G=R;q=function(m){var _="Warning: "+m;"undefined"!=typeof console&&console.error(_);try{throw new Error(_)}catch(m){}}}function M(m,_,l,t,p){if("production"!==process.env.NODE_ENV)for(var r in m)if(G(m,r)){var e;try{if("function"!=typeof m[r]){var n=Error((t||"React class")+": "+l+" type `"+r+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof m[r]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw n.name="Invariant Violation",n}e=m[r](_,r,t,l,null,K)}catch(m){e=m}if(!e||e instanceof Error||q((t||"React class")+": type specification of "+l+" `"+r+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof e+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),e instanceof Error&&!(e.message in D)){D[e.message]=!0;var o=p?p():"";q("Failed "+l+" type: "+e.message+(null!=o?o:""))}}}M.resetWarningCache=function(){"production"!==process.env.NODE_ENV&&(D={})};var A=M,V=function(){};function Z(){return null}function F(){}function W(){}"production"!==process.env.NODE_ENV&&(V=function(m){var _="Warning: "+m;"undefined"!=typeof console&&console.error(_);try{throw new Error(_)}catch(m){}}),W.resetWarningCache=F;var U=l(function(m){m.exports="production"!==process.env.NODE_ENV?function(m,_){var l="function"==typeof Symbol&&Symbol.iterator,t="<<anonymous>>",p={array:o("array"),bigint:o("bigint"),bool:o("boolean"),func:o("function"),number:o("number"),object:o("object"),string:o("string"),symbol:o("symbol"),any:n(Z),arrayOf:function(m){return n(function(_,l,t,p,r){if("function"!=typeof m)return new e("Property `"+r+"` of component `"+t+"` has invalid PropType notation inside arrayOf.");var n=_[l];if(!Array.isArray(n))return new e("Invalid "+p+" `"+r+"` of type `"+a(n)+"` supplied to `"+t+"`, expected an array.");for(var o=0;o<n.length;o++){var s=m(n,o,t,p,r+"["+o+"]",N);if(s instanceof Error)return s}return null})},element:n(function(_,l,t,p,r){var n=_[l];return m(n)?null:new e("Invalid "+p+" `"+r+"` of type `"+a(n)+"` supplied to `"+t+"`, expected a single ReactElement.")}),elementType:n(function(m,_,l,t,p){var r=m[_];return k.isValidElementType(r)?null:new e("Invalid "+t+" `"+p+"` of type `"+a(r)+"` supplied to `"+l+"`, expected a single ReactElement type.")}),instanceOf:function(m){return n(function(_,l,p,r,n){return _[l]instanceof m?null:new e("Invalid "+r+" `"+n+"` of type `"+((o=_[l]).constructor&&o.constructor.name?o.constructor.name:t)+"` supplied to `"+p+"`, expected instance of `"+(m.name||t)+"`.");var o})},node:n(function(m,_,l,t,p){return i(m[_])?null:new e("Invalid "+t+" `"+p+"` supplied to `"+l+"`, expected a ReactNode.")}),objectOf:function(m){return n(function(_,l,t,p,r){if("function"!=typeof m)return new e("Property `"+r+"` of component `"+t+"` has invalid PropType notation inside objectOf.");var n=_[l],o=a(n);if("object"!==o)return new e("Invalid "+p+" `"+r+"` of type `"+o+"` supplied to `"+t+"`, expected an object.");for(var s in n)if(R(n,s)){var i=m(n,s,t,p,r+"."+s,N);if(i instanceof Error)return i}return null})},oneOf:function(m){return Array.isArray(m)?n(function(_,l,t,p,n){for(var o=_[l],s=0;s<m.length;s++)if(r(o,m[s]))return null;var i=JSON.stringify(m,function(m,_){return"symbol"===d(_)?String(_):_});return new e("Invalid "+p+" `"+n+"` of value `"+String(o)+"` supplied to `"+t+"`, expected one of "+i+".")}):("production"!==process.env.NODE_ENV&&V(arguments.length>1?"Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).":"Invalid argument supplied to oneOf, expected an array."),Z)},oneOfType:function(m){if(!Array.isArray(m))return"production"!==process.env.NODE_ENV&&V("Invalid argument supplied to oneOfType, expected an instance of array."),Z;for(var _=0;_<m.length;_++){var l=m[_];if("function"!=typeof l)return V("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+x(l)+" at index "+_+"."),Z}return n(function(_,l,t,p,r){for(var n=[],o=0;o<m.length;o++){var s=(0,m[o])(_,l,t,p,r,N);if(null==s)return null;s.data&&R(s.data,"expectedType")&&n.push(s.data.expectedType)}return new e("Invalid "+p+" `"+r+"` supplied to `"+t+"`"+(n.length>0?", expected one of type ["+n.join(", ")+"]":"")+".")})},shape:function(m){return n(function(_,l,t,p,r){var n=_[l],o=a(n);if("object"!==o)return new e("Invalid "+p+" `"+r+"` of type `"+o+"` supplied to `"+t+"`, expected `object`.");for(var i in m){var x=m[i];if("function"!=typeof x)return s(t,p,r,i,d(x));var c=x(n,i,t,p,r+"."+i,N);if(c)return c}return null})},exact:function(m){return n(function(_,l,t,p,r){var n=_[l],o=a(n);if("object"!==o)return new e("Invalid "+p+" `"+r+"` of type `"+o+"` supplied to `"+t+"`, expected `object`.");var i=B({},_[l],m);for(var x in i){var c=m[x];if(R(m,x)&&"function"!=typeof c)return s(t,p,r,x,d(c));if(!c)return new e("Invalid "+p+" `"+r+"` key `"+x+"` supplied to `"+t+"`.\nBad object: "+JSON.stringify(_[l],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(m),null," "));var y=c(n,x,t,p,r+"."+x,N);if(y)return y}return null})}};function r(m,_){return m===_?0!==m||1/m==1/_:m!=m&&_!=_}function e(m,_){this.message=m,this.data=_&&"object"==typeof _?_:{},this.stack=""}function n(m){if("production"!==process.env.NODE_ENV)var l={},p=0;function r(r,n,o,s,i,a,d){if(s=s||t,a=a||o,d!==N){if(_){var x=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw x.name="Invariant Violation",x}if("production"!==process.env.NODE_ENV&&"undefined"!=typeof console){var c=s+":"+o;!l[c]&&p<3&&(V("You are manually calling a React.PropTypes validation function for the `"+a+"` prop on `"+s+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),l[c]=!0,p++)}}return null==n[o]?r?new e(null===n[o]?"The "+i+" `"+a+"` is marked as required in `"+s+"`, but its value is `null`.":"The "+i+" `"+a+"` is marked as required in `"+s+"`, but its value is `undefined`."):null:m(n,o,s,i,a)}var n=r.bind(null,!1);return n.isRequired=r.bind(null,!0),n}function o(m){return n(function(_,l,t,p,r,n){var o=_[l];return a(o)!==m?new e("Invalid "+p+" `"+r+"` of type `"+d(o)+"` supplied to `"+t+"`, expected `"+m+"`.",{expectedType:m}):null})}function s(m,_,l,t,p){return new e((m||"React class")+": "+_+" type `"+l+"."+t+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+p+"`.")}function i(_){switch(typeof _){case"number":case"string":case"undefined":return!0;case"boolean":return!_;case"object":if(Array.isArray(_))return _.every(i);if(null===_||m(_))return!0;var t=function(m){var _=m&&(l&&m[l]||m["@@iterator"]);if("function"==typeof _)return _}(_);if(!t)return!1;var p,r=t.call(_);if(t!==_.entries){for(;!(p=r.next()).done;)if(!i(p.value))return!1}else for(;!(p=r.next()).done;){var e=p.value;if(e&&!i(e[1]))return!1}return!0;default:return!1}}function a(m){var _=typeof m;return Array.isArray(m)?"array":m instanceof RegExp?"object":function(m,_){return"symbol"===m||!!_&&("Symbol"===_["@@toStringTag"]||"function"==typeof Symbol&&_ instanceof Symbol)}(_,m)?"symbol":_}function d(m){if(null==m)return""+m;var _=a(m);if("object"===_){if(m instanceof Date)return"date";if(m instanceof RegExp)return"regexp"}return _}function x(m){var _=d(m);switch(_){case"array":case"object":return"an "+_;case"boolean":case"date":case"regexp":return"a "+_;default:return _}}return e.prototype=Error.prototype,p.checkPropTypes=A,p.resetWarningCache=A.resetWarningCache,p.PropTypes=p,p}(k.isElement,!0):function(){function m(m,_,l,t,p,r){if(r!==N){var e=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw e.name="Invariant Violation",e}}function _(){return m}m.isRequired=m;var l={array:m,bigint:m,bool:m,func:m,number:m,object:m,string:m,symbol:m,any:m,arrayOf:_,element:m,elementType:m,instanceOf:_,node:m,objectOf:_,oneOf:_,oneOfType:_,shape:_,exact:_,checkPropTypes:W,resetWarningCache:F};return l.PropTypes=l,l}()}),z={container:"_Og09u",button:"_Jk9i-","m-0":"_1KRN6","p-0":"_gcKRj","m-1":"_yWCA-","p-1":"_vnN2l","m-2":"_oVgmY","p-2":"_OguP4","m-3":"_Kh1Mk","p-3":"_Z3Isk","m-4":"_6MAp6","p-4":"_Diglh","m-5":"_TO5Nq","p-5":"_HXLSK","m-6":"_HUNIG","p-6":"_f4arD","m-7":"_mZxzR","p-7":"_wzNuy","m-8":"_RVlle","p-8":"_OjqW3","m-9":"_Dejbg","p-9":"_islrX","m-10":"_wj-xZ","p-10":"_xz5kd","ml-0":"_B6vO4","pl-0":"_d137A","ml-1":"_F964v","pl-1":"_cUcnb","ml-2":"_sAUua","pl-2":"_ineea","ml-3":"_Q7vDo","pl-3":"_RaOUn","ml-4":"_QXOxT","pl-4":"_IOfD0","ml-5":"_yxiUW","pl-5":"_Tppy4","ml-6":"_mMW5i","pl-6":"_74GpL","ml-7":"_fFz-u","pl-7":"_QJPKy","ml-8":"_6sPXU","pl-8":"_6-6Yi","ml-9":"_9eU2j","pl-9":"_5QdLq","ml-10":"_AppHk","pl-10":"_czH97","mr-0":"_vcD-O","pr-0":"_yLhIL","mr-1":"_oSLHt","pr-1":"_whfEJ","mr-2":"_nyXH6","pr-2":"_reUdF","mr-3":"_Rs2-c","pr-3":"_sGm42","mr-4":"_vobRL","pr-4":"_wpM-u","mr-5":"_q3dAo","pr-5":"_6PIFR","mr-6":"_ZqDGE","pr-6":"_gw5Dd","mr-7":"_lFAcr","pr-7":"_b36Iz","mr-8":"_PTl3K","pr-8":"_Znc0Y","mr-9":"_P1LS0","pr-9":"_n8V-T","mr-10":"_wdhB1","pr-10":"_xiGuq","mt-0":"_wTXui","pt-0":"_qv-eO","mt-1":"_EZHmH","pt-1":"_rVDqJ","mt-2":"_Vokqr","pt-2":"_Gy6Cr","mt-3":"_W8aoH","pt-3":"_r82YV","mt-4":"_muG0F","pt-4":"_CGaJi","mt-5":"_hiY1E","pt-5":"_7v6rs","mt-6":"_bQZSd","pt-6":"_jAtjI","mt-7":"_R5w8y","pt-7":"_4mWsy","mt-8":"_Sj-di","pt-8":"_-NNao","mt-9":"_Q-fHV","pt-9":"_r8woe","mt-10":"_bSMww","pt-10":"_avmlE","mb-0":"_iCCS3","pb-0":"_gwmOn","mb-1":"_Xl7QX","pb-1":"_WUz0H","mb-2":"_XgCgc","pb-2":"_jPgTM","mb-3":"_3teTS","pb-3":"_dG1rJ","mb-4":"_b9OzE","pb-4":"_IgI2C","mb-5":"_smDd1","pb-5":"_50YOa","mb-6":"_uJfnB","pb-6":"_kl0z7","mb-7":"_L-oZk","pb-7":"_3aui0","mb-8":"_SmtYl","pb-8":"_n-QXT","mb-9":"_mkkKF","pb-9":"_jS1HG","mb-10":"_KDXkK","pb-10":"_eFwJS","mx-0":"_e-HqA","px-0":"_BSmPJ","mx-1":"_x36PW","px-1":"_Gx2xG","mx-2":"_QNnpK","px-2":"_RRwnp","mx-3":"_ZPmuA","px-3":"_f61Ux","mx-4":"_DgyA6","px-4":"_BAKix","mx-5":"_vibgJ","px-5":"_bTxPW","mx-6":"_Yj9Z7","px-6":"_fhT5q","mx-7":"_q-6lp","px-7":"_DQb93","mx-8":"_6G9nX","px-8":"_o-551","mx-9":"_2cubL","px-9":"_4JCU0","mx-10":"_KxEiD","px-10":"_czVGr","my-0":"_CqLSs","py-0":"_8uC-B","my-1":"_ZZG5X","py-1":"_aYbyO","my-2":"_w8TwE","py-2":"_qpOCn","my-3":"_PkA2e","py-3":"_OMDQd","my-4":"_aNFBd","py-4":"_eCXIU","my-5":"_apq2l","py-5":"_mk-sc","my-6":"_sh1-C","py-6":"_ZobGH","my-7":"_8758c","py-7":"_1iT1D","my-8":"_bAfQx","py-8":"_WWkd-","my-9":"_ynwaZ","py-9":"_4bOJI","my-10":"_l-I5b","py-10":"_re6Jp","m-sm-0":"_UPkcx","p-sm-0":"_t5gDA","m-sm-1":"_Rx29j","p-sm-1":"_t6SQY","m-sm-2":"_TyVqN","p-sm-2":"_Z1ogo","m-sm-3":"_gbZcT","p-sm-3":"_Mb1ST","m-sm-4":"_cUvON","p-sm-4":"_Pi4BO","m-sm-5":"_GgM3g","p-sm-5":"_uPFJ2","m-sm-6":"_cCDZS","p-sm-6":"_-e-Jr","m-sm-7":"_f2nRJ","p-sm-7":"_B6vun","m-sm-8":"_pidE0","p-sm-8":"_Qf8oe","m-sm-9":"_OyLmR","p-sm-9":"_soKag","m-sm-10":"_Hnysz","p-sm-10":"_SceBA","ml-sm-0":"_-l5XN","pl-sm-0":"_23QUK","ml-sm-1":"_3nzoa","pl-sm-1":"_Ys-wQ","ml-sm-2":"_cnl0C","pl-sm-2":"_9zniH","ml-sm-3":"_COjSH","pl-sm-3":"_ZoalV","ml-sm-4":"_7PcV0","pl-sm-4":"_yBtfl","ml-sm-5":"_0t-j9","pl-sm-5":"_lrbtT","ml-sm-6":"_441I5","pl-sm-6":"_kDiN3","ml-sm-7":"_7LdG3","pl-sm-7":"_g0gh-","ml-sm-8":"_J0xVz","pl-sm-8":"_Y6n12","ml-sm-9":"_0WKKn","pl-sm-9":"_3Seov","ml-sm-10":"_LbfWV","pl-sm-10":"_yJT8F","mr-sm-0":"_5iTiW","pr-sm-0":"_Z-yPd","mr-sm-1":"_HjxwF","pr-sm-1":"_JibpI","mr-sm-2":"_osijT","pr-sm-2":"_tlR9d","mr-sm-3":"_xxUub","pr-sm-3":"_OM4YU","mr-sm-4":"_tZTrU","pr-sm-4":"_co3SR","mr-sm-5":"_ZV8NG","pr-sm-5":"_6lrgR","mr-sm-6":"_mgH6r","pr-sm-6":"_oirFH","mr-sm-7":"_cDefz","pr-sm-7":"_PbMd1","mr-sm-8":"_GEylU","pr-sm-8":"_w9iBc","mr-sm-9":"_U-I4Y","pr-sm-9":"_VM49L","mr-sm-10":"_A-Fqb","pr-sm-10":"_jAp4X","mt-sm-0":"_kxvbF","pt-sm-0":"_-1AUk","mt-sm-1":"_utpJq","pt-sm-1":"_5aGnP","mt-sm-2":"_hH5bv","pt-sm-2":"_Lf-Hs","mt-sm-3":"_QKQTL","pt-sm-3":"_pS4ep","mt-sm-4":"_cf-lt","pt-sm-4":"_lGSoR","mt-sm-5":"_gSiyG","pt-sm-5":"_WWQxH","mt-sm-6":"_u9dIF","pt-sm-6":"_3rt-l","mt-sm-7":"_9HdeB","pt-sm-7":"_zzUxk","mt-sm-8":"_6dlAC","pt-sm-8":"_gDL-V","mt-sm-9":"_o7STq","pt-sm-9":"_7uyRq","mt-sm-10":"_VRUs5","pt-sm-10":"_nuFOu","mb-sm-0":"_gYIh5","pb-sm-0":"_9EoF6","mb-sm-1":"_h47Qi","pb-sm-1":"_zEE-R","mb-sm-2":"_qNAln","pb-sm-2":"_lAEEB","mb-sm-3":"_qz2f7","pb-sm-3":"_zDV2S","mb-sm-4":"_HziQr","pb-sm-4":"_Z8Nr-","mb-sm-5":"_2-0Mg","pb-sm-5":"_jd6YT","mb-sm-6":"_29u0R","pb-sm-6":"_rv5lz","mb-sm-7":"_34gYX","pb-sm-7":"_QK5rm","mb-sm-8":"_GTTt-","pb-sm-8":"_i9KXS","mb-sm-9":"_aOWnz","pb-sm-9":"_he9qa","mb-sm-10":"_zzLEf","pb-sm-10":"_a3Kx7","mx-sm-0":"_BxA9q","px-sm-0":"_W9ngp","mx-sm-1":"_sw7Ji","px-sm-1":"_CC5F4","mx-sm-2":"_wNsfZ","px-sm-2":"_7HUQW","mx-sm-3":"_7SvR7","px-sm-3":"_MhTrn","mx-sm-4":"_iQFZf","px-sm-4":"_-Kc-C","mx-sm-5":"_uAYfU","px-sm-5":"_zSyRo","mx-sm-6":"_M9NRe","px-sm-6":"_rqh6J","mx-sm-7":"_xC2ZW","px-sm-7":"_2ldRI","mx-sm-8":"_IdyE1","px-sm-8":"_nEOT4","mx-sm-9":"_MZcKX","px-sm-9":"_gn7RL","mx-sm-10":"_qc1L8","px-sm-10":"_eqRhA","my-sm-0":"_Fz6F6","py-sm-0":"_xO1X5","my-sm-1":"_-FpA3","py-sm-1":"_nbaB5","my-sm-2":"_O9I74","py-sm-2":"_luGVj","my-sm-3":"_HiEIn","py-sm-3":"_CYpX7","my-sm-4":"_J6Y94","py-sm-4":"_wB9Cu","my-sm-5":"_NsPY8","py-sm-5":"_mLSOY","my-sm-6":"_KsNN2","py-sm-6":"_ksiG3","my-sm-7":"_I-MIQ","py-sm-7":"_8LmM-","my-sm-8":"_N9K-q","py-sm-8":"_UmDUW","my-sm-9":"_Kx729","py-sm-9":"_T07OJ","my-sm-10":"_IW66T","py-sm-10":"_4gdB-","m-lg-0":"_zIg6p","p-lg-0":"_JuNiH","m-lg-1":"_PYsvw","p-lg-1":"_lcX2G","m-lg-2":"_FqRzp","p-lg-2":"_61LiW","m-lg-3":"_lKWuo","p-lg-3":"_c-9AA","m-lg-4":"_5iPC8","p-lg-4":"_3ucGN","m-lg-5":"_ZcKza","p-lg-5":"_53nUa","m-lg-6":"_nf5Tb","p-lg-6":"_QOkP1","m-lg-7":"_Yaf7S","p-lg-7":"_fS5OB","m-lg-8":"_3hP03","p-lg-8":"_w90dv","m-lg-9":"_eTZmn","p-lg-9":"_rEjn2","m-lg-10":"_MRZfv","p-lg-10":"_GvH8S","ml-lg-0":"_dma-K","pl-lg-0":"_dtgDg","ml-lg-1":"_lSg5Q","pl-lg-1":"_3Bq7W","ml-lg-2":"_ai140","pl-lg-2":"_eHQz2","ml-lg-3":"_IjfYo","pl-lg-3":"_mhnHv","ml-lg-4":"_gB4r4","pl-lg-4":"_GZbML","ml-lg-5":"_i2xfh","pl-lg-5":"_x9yPX","ml-lg-6":"_SeQQZ","pl-lg-6":"_wS39q","ml-lg-7":"_r8f4e","pl-lg-7":"_irihU","ml-lg-8":"_1QsQf","pl-lg-8":"_GXSU9","ml-lg-9":"_MJYz8","pl-lg-9":"_yaJGg","ml-lg-10":"_-AsD8","pl-lg-10":"_yn9Yb","mr-lg-0":"_vjC97","pr-lg-0":"_V3kGD","mr-lg-1":"_wf9z-","pr-lg-1":"_McW7I","mr-lg-2":"_kheh0","pr-lg-2":"_Q9Upz","mr-lg-3":"_zCz0A","pr-lg-3":"_YtfCI","mr-lg-4":"_qQN9B","pr-lg-4":"_S9PbV","mr-lg-5":"_bDTdZ","pr-lg-5":"_AcAC1","mr-lg-6":"_Ei18A","pr-lg-6":"_5YQVo","mr-lg-7":"_x18aw","pr-lg-7":"_N8GDD","mr-lg-8":"_OaFkM","pr-lg-8":"_-9lBB","mr-lg-9":"_52zo-","pr-lg-9":"_9T-Cb","mr-lg-10":"_IXqTb","pr-lg-10":"_zJmVt","mt-lg-0":"_2g62L","pt-lg-0":"_XBXKM","mt-lg-1":"_HMX9J","pt-lg-1":"_7rDIG","mt-lg-2":"_Y6X7U","pt-lg-2":"_fyycG","mt-lg-3":"_DvRKb","pt-lg-3":"_QKOEA","mt-lg-4":"_7qwy-","pt-lg-4":"_wl7f7","mt-lg-5":"_r-Zpt","pt-lg-5":"_-SnjV","mt-lg-6":"_q-hht","pt-lg-6":"_sOK9J","mt-lg-7":"_SUp-d","pt-lg-7":"_PugoZ","mt-lg-8":"_3NhkP","pt-lg-8":"_1n7tp","mt-lg-9":"_N7-FS","pt-lg-9":"_dnC7J","mt-lg-10":"_8IqDn","pt-lg-10":"_zMpbv","mb-lg-0":"_v5nv6","pb-lg-0":"_PMrYJ","mb-lg-1":"_O-soc","pb-lg-1":"_11FYR","mb-lg-2":"_zEeyp","pb-lg-2":"_hXqMT","mb-lg-3":"_san6w","pb-lg-3":"_7Xb0V","mb-lg-4":"_2Vzmv","pb-lg-4":"_fMirW","mb-lg-5":"_pKo-L","pb-lg-5":"_xC4Fx","mb-lg-6":"_snApN","pb-lg-6":"_b9Dsw","mb-lg-7":"_bFu0D","pb-lg-7":"_0qgZX","mb-lg-8":"_Gf3om","pb-lg-8":"_hX-O2","mb-lg-9":"_zZ-9Y","pb-lg-9":"_jk292","mb-lg-10":"_gYyhL","pb-lg-10":"_aPUfC","mx-lg-0":"_tmMx3","px-lg-0":"_GxctH","mx-lg-1":"_Ky0cs","px-lg-1":"_oGNqQ","mx-lg-2":"_9mQLc","px-lg-2":"_laRSV","mx-lg-3":"_xZFwU","px-lg-3":"_BgGbp","mx-lg-4":"_8m58X","px-lg-4":"_hosE8","mx-lg-5":"_r-0ww","px-lg-5":"_pIVfH","mx-lg-6":"_-BStC","px-lg-6":"_v42m-","mx-lg-7":"_DVgVD","px-lg-7":"_olele","mx-lg-8":"_5Vgts","px-lg-8":"_vV7Sg","mx-lg-9":"_R6Pid","px-lg-9":"_qmY7B","mx-lg-10":"_NW4OT","px-lg-10":"_i8Zad","my-lg-0":"_7PFtp","py-lg-0":"_vhTEf","my-lg-1":"_1yOov","py-lg-1":"_oKB3P","my-lg-2":"_loQJ5","py-lg-2":"_S67Pf","my-lg-3":"_HNTDI","py-lg-3":"_LWHvE","my-lg-4":"_b-KHI","py-lg-4":"_0mixG","my-lg-5":"_Vlo-t","py-lg-5":"_xLHlx","my-lg-6":"_0KXBa","py-lg-6":"_9s-me","my-lg-7":"_60cF9","py-lg-7":"_qwIHZ","my-lg-8":"_suf27","py-lg-8":"_c6pD4","my-lg-9":"_KSJpX","py-lg-9":"_C6ZV-","my-lg-10":"_JA-YG","py-lg-10":"_YuxKJ","m-md-0":"_62Zm-","p-md-0":"_7qxYP","m-md-1":"_3xHIn","p-md-1":"_A0jQv","m-md-2":"_gn3k4","p-md-2":"_EpVD0","m-md-3":"_apmcB","p-md-3":"_ldRmv","m-md-4":"_BOjUR","p-md-4":"_93an6","m-md-5":"_W5v56","p-md-5":"_SIBoU","m-md-6":"_VBmMD","p-md-6":"_7ZqTb","m-md-7":"_5Jogx","p-md-7":"_KpbGF","m-md-8":"_lw6bA","p-md-8":"_D21Xs","m-md-9":"_buMId","p-md-9":"_87RlS","m-md-10":"_ojudf","p-md-10":"_sjNOB","ml-md-0":"_V1IX-","pl-md-0":"_ZTBpt","ml-md-1":"_4jtTs","pl-md-1":"_cY-xk","ml-md-2":"_ydZsR","pl-md-2":"_MJk1L","ml-md-3":"_ocW9e","pl-md-3":"_WuBzD","ml-md-4":"_eKU4l","pl-md-4":"_cgptP","ml-md-5":"_Ov-v8","pl-md-5":"_gDnV3","ml-md-6":"_o3eWU","pl-md-6":"_Cr8hz","ml-md-7":"_sX69x","pl-md-7":"_-Ci6A","ml-md-8":"_fGNjF","pl-md-8":"_PeKiX","ml-md-9":"_yVD5i","pl-md-9":"_gxUIi","ml-md-10":"_ZPQrh","pl-md-10":"_oL88W","mr-md-0":"_rETVL","pr-md-0":"_UePrS","mr-md-1":"_wGOhL","pr-md-1":"_lXRvw","mr-md-2":"_5zLmB","pr-md-2":"_gZGtH","mr-md-3":"_jFCGk","pr-md-3":"_iimql","mr-md-4":"_yhePq","pr-md-4":"_xtBfX","mr-md-5":"_KiBHO","pr-md-5":"_WCKkT","mr-md-6":"_Q8jWF","pr-md-6":"_mu6zn","mr-md-7":"_wgy4D","pr-md-7":"_HaN0x","mr-md-8":"_0hc4i","pr-md-8":"_RomM-","mr-md-9":"_vHSBw","pr-md-9":"_4D7JM","mr-md-10":"_4kgs5","pr-md-10":"_KbOqY","mt-md-0":"_PnJEf","pt-md-0":"_Wr2Ts","mt-md-1":"_ZhVjl","pt-md-1":"_0DgRY","mt-md-2":"_WCZNy","pt-md-2":"_632Ah","mt-md-3":"_I1rX1","pt-md-3":"_yLblG","mt-md-4":"_H6sYD","pt-md-4":"_EHXef","mt-md-5":"_A-e3J","pt-md-5":"_-sV7U","mt-md-6":"_hXU9-","pt-md-6":"_n13ly","mt-md-7":"_NvbHC","pt-md-7":"_og4j4","mt-md-8":"_K3M9K","pt-md-8":"_G0D0h","mt-md-9":"_gqgsH","pt-md-9":"_2DuSs","mt-md-10":"_Bd2SX","pt-md-10":"_4zQZt","mb-md-0":"_-zK4R","pb-md-0":"_-5KU3","mb-md-1":"_DsvDi","pb-md-1":"_iBeit","mb-md-2":"_1DyrC","pb-md-2":"_We5TJ","mb-md-3":"_gHMvz","pb-md-3":"_zYpR2","mb-md-4":"_OEEgj","pb-md-4":"_Rc-ZO","mb-md-5":"_qmwpY","pb-md-5":"_t53dC","mb-md-6":"_Z7IKd","pb-md-6":"_Tr1Mj","mb-md-7":"_VAOZd","pb-md-7":"_F6Hvf","mb-md-8":"_bDJti","pb-md-8":"_-Hyix","mb-md-9":"_5NMzS","pb-md-9":"_ka3la","mb-md-10":"_m7Y4u","pb-md-10":"_GKtFW","mx-md-0":"_S-sWu","px-md-0":"_Cbp07","mx-md-1":"_0cWET","px-md-1":"_B62bC","mx-md-2":"_fk8cj","px-md-2":"_hDUD4","mx-md-3":"_3rc6m","px-md-3":"_Ybukf","mx-md-4":"_Cc05e","px-md-4":"_WuZgX","mx-md-5":"_Bizql","px-md-5":"_-p46c","mx-md-6":"_9UcKL","px-md-6":"_JBebf","mx-md-7":"_v-pvB","px-md-7":"_rA-mH","mx-md-8":"_IuwmJ","px-md-8":"_q43Ow","mx-md-9":"_d-qUi","px-md-9":"_z4nCB","mx-md-10":"_kRlX7","px-md-10":"_c-33g","my-md-0":"_PDUR4","py-md-0":"_bYhI-","my-md-1":"_GuZMi","py-md-1":"_odsUL","my-md-2":"_PnosJ","py-md-2":"_eF79-","my-md-3":"_nqJqe","py-md-3":"_Wcv28","my-md-4":"_pg-Cw","py-md-4":"_TQVBc","my-md-5":"_oq3ru","py-md-5":"_ruQ8P","my-md-6":"_udw0b","py-md-6":"_vStkc","my-md-7":"_EHkUk","py-md-7":"_oGosV","my-md-8":"_Sr4G3","py-md-8":"_eDYMt","my-md-9":"_mmQcX","py-md-9":"_J0xZx","my-md-10":"_6PNQm","py-md-10":"_N-J8O","m-xl-0":"_b9ste","p-xl-0":"_09iuo","m-xl-1":"_6sC3f","p-xl-1":"_PtZdh","m-xl-2":"_9tNY-","p-xl-2":"_ovaeX","m-xl-3":"_P2BFM","p-xl-3":"_FEEeY","m-xl-4":"_PVfE9","p-xl-4":"_65pR5","m-xl-5":"_--nhA","p-xl-5":"_jsSAE","m-xl-6":"_R6Xge","p-xl-6":"_m8aQq","m-xl-7":"_siLSo","p-xl-7":"_v7l5L","m-xl-8":"_hHbXe","p-xl-8":"_Rqlns","m-xl-9":"_oGDyI","p-xl-9":"_s-jO5","m-xl-10":"_Acff7","p-xl-10":"_r1WLU","ml-xl-0":"_R-5jP","pl-xl-0":"_4Q5-9","ml-xl-1":"_KtDt9","pl-xl-1":"_WO0X1","ml-xl-2":"_1iTCd","pl-xl-2":"_cwGpB","ml-xl-3":"_U-UBZ","pl-xl-3":"_K6-fp","ml-xl-4":"_Qj-GA","pl-xl-4":"_3HWJh","ml-xl-5":"_tHgFt","pl-xl-5":"_HDbai","ml-xl-6":"_R5iu-","pl-xl-6":"_kiBpR","ml-xl-7":"_IBpxp","pl-xl-7":"_dnEPn","ml-xl-8":"_BKEU-","pl-xl-8":"_Na3WX","ml-xl-9":"_ChhZh","pl-xl-9":"_mn3TM","ml-xl-10":"_-UMhn","pl-xl-10":"_sYOxA","mr-xl-0":"_cpZo1","pr-xl-0":"_JNcnY","mr-xl-1":"_OCoEG","pr-xl-1":"_1muOs","mr-xl-2":"_jhx4t","pr-xl-2":"_vT9VS","mr-xl-3":"_Syl0-","pr-xl-3":"_Vh6yI","mr-xl-4":"_Andea","pr-xl-4":"_IELTR","mr-xl-5":"_tR-Dd","pr-xl-5":"_tFdrE","mr-xl-6":"_MfbBj","pr-xl-6":"_-RDRT","mr-xl-7":"_2TUZ4","pr-xl-7":"_FDwKR","mr-xl-8":"_JILtJ","pr-xl-8":"_vHCTj","mr-xl-9":"_7wU9i","pr-xl-9":"_SqcZw","mr-xl-10":"_V70NV","pr-xl-10":"_-KQQG","mt-xl-0":"_sKVTL","pt-xl-0":"_ZF6Hm","mt-xl-1":"_I5EGT","pt-xl-1":"_-Ig-5","mt-xl-2":"_RIFhP","pt-xl-2":"_zaWNn","mt-xl-3":"_dPd93","pt-xl-3":"_O4wYu","mt-xl-4":"_T1XOW","pt-xl-4":"_b6dFq","mt-xl-5":"_dTI2S","pt-xl-5":"_qyuWu","mt-xl-6":"_0pvAa","pt-xl-6":"_sSQ8V","mt-xl-7":"_P-2W8","pt-xl-7":"_ek09W","mt-xl-8":"_g4vXZ","pt-xl-8":"_b2MMp","mt-xl-9":"_6JmBY","pt-xl-9":"_EG1jC","mt-xl-10":"_tHeBK","pt-xl-10":"_nYubC","mb-xl-0":"_9fyt1","pb-xl-0":"_66Js3","mb-xl-1":"_ARk1H","pb-xl-1":"_kKNTV","mb-xl-2":"_0TmE5","pb-xl-2":"_Zysst","mb-xl-3":"_XiA7F","pb-xl-3":"_SO1hI","mb-xl-4":"_W-4kw","pb-xl-4":"_-sfn8","mb-xl-5":"_NTfVD","pb-xl-5":"_LFC-6","mb-xl-6":"_pp7Gy","pb-xl-6":"_j-vtb","mb-xl-7":"_wpFKE","pb-xl-7":"_BbnyF","mb-xl-8":"_4qmjI","pb-xl-8":"_7pytN","mb-xl-9":"_B3YZo","pb-xl-9":"_cRfJG","mb-xl-10":"_NMhPX","pb-xl-10":"_Ekqdk","mx-xl-0":"_SkbmN","px-xl-0":"_JKZdb","mx-xl-1":"_UKYJi","px-xl-1":"_f-FqJ","mx-xl-2":"_gwtRl","px-xl-2":"_CSJ3f","mx-xl-3":"_tg3Yl","px-xl-3":"_EWUVo","mx-xl-4":"_p2pqT","px-xl-4":"_3DzEy","mx-xl-5":"_0xDrA","px-xl-5":"_NUhX6","mx-xl-6":"_bhY09","px-xl-6":"_mUAfo","mx-xl-7":"_Lug5G","px-xl-7":"_2kUJp","mx-xl-8":"_kTsP1","px-xl-8":"_Chv-7","mx-xl-9":"_h9kIo","px-xl-9":"_gfikM","mx-xl-10":"_3Th0M","px-xl-10":"_A4Mab","my-xl-0":"_62UqO","py-xl-0":"_BkC6O","my-xl-1":"_QJWcf","py-xl-1":"_WWFRs","my-xl-2":"_tkrQM","py-xl-2":"_-qca8","my-xl-3":"_bpoTO","py-xl-3":"_OnKLk","my-xl-4":"_o-kvn","py-xl-4":"_Icmal","my-xl-5":"_cEkTF","py-xl-5":"_mPD3K","my-xl-6":"_b2wEf","py-xl-6":"_SPrOl","my-xl-7":"_BpIhB","py-xl-7":"_9p80f","my-xl-8":"_u3RLs","py-xl-8":"_mc-ae","my-xl-9":"_Q8X-B","py-xl-9":"_SAYlD","my-xl-10":"_vUbME","py-xl-10":"_JgNyS","background-shine":"_31QK4",path:"_LID96",line:"_w2-BZ",skeleton:"_rfGkx","skeleton-animate":"_UY78C","skeleton-dark":"_KmySi","skeleton-dark-animate":"_KF46B","skeleton-transparent":"_50VFe","skeleton-transparent-animate":"_Q6BCG","semi-transparent":"_y91i5",disable:"_87Qkw","full-width-on-tablets":"_wymzG","full-width-on-mobiles":"_uhhSq",xl:"_zdQKm",lg:"_jG9wj",md:"_QrK--",sm:"_jc1W9","small-padding-on-small-mobiles":"_rS2Bk",primary:"_d-gJO","primary-bordered":"_jjfA2","primary-transparent":"_AEbcr",transparent:"_w53db","transparent-bordered":"_WW-Ps","transparent-without-shadow":"_Ltn9c",white:"_csamW","button-primary-dots-wrapper":"_Dmv-l",show:"_GkptB","button-success-icon":"_xImUU","button-text":"_ur-Oh",hide:"_-5XCZ","button-with-icon":"_ZrOKh","button-with-icon-text":"_ixQmJ","big-icon":"_8e4E7"},L={container:"_wfTsj","m-0":"_UeiuB","p-0":"_QD4AZ","m-1":"_wOM1E","p-1":"_kJ3GD","m-2":"_5G5Rf","p-2":"_dyuup","m-3":"_m4kZr","p-3":"_-aSKV","m-4":"_lqeth","p-4":"_WFhaj","m-5":"_bgee8","p-5":"_Y2Iup","m-6":"_c873k","p-6":"_Huak-","m-7":"_c2rt4","p-7":"_2dT3Y","m-8":"_7rQUz","p-8":"_fjzT8","m-9":"_jmGJQ","p-9":"_CTpOZ","m-10":"_lEJ9M","p-10":"_1LfZ2","ml-0":"_j6sNe","pl-0":"_i8R7s","ml-1":"_oM6Eu","pl-1":"_QllX8","ml-2":"_r3xcV","pl-2":"_fd0jL","ml-3":"_SP5MI","pl-3":"_wQD-b","ml-4":"_uV9BF","pl-4":"_k1Kla","ml-5":"_FTlGy","pl-5":"_k20cZ","ml-6":"_5gR0D","pl-6":"_ICAcq","ml-7":"_-PQGU","pl-7":"_VxSDF","ml-8":"_bKyKZ","pl-8":"_2DqEG","ml-9":"_1SlOv","pl-9":"_EIiNs","ml-10":"_5WCGB","pl-10":"_qdKd3","mr-0":"_JWuXP","pr-0":"_5aqFq","mr-1":"_GTimu","pr-1":"_VC6Mm","mr-2":"_iuK1E","pr-2":"_YREDe","mr-3":"_qttq2","pr-3":"_FRB7c","mr-4":"_tyLXy","pr-4":"_khAbL","mr-5":"_-pPmp","pr-5":"_Zn6P3","mr-6":"_UXDvD","pr-6":"_Pyjz-","mr-7":"_ydv6O","pr-7":"_W2-PF","mr-8":"_AeBpV","pr-8":"_GNhM6","mr-9":"_6r58X","pr-9":"_nDQS4","mr-10":"_z6oMu","pr-10":"_NqF8M","mt-0":"_5BywF","pt-0":"_G3lb7","mt-1":"_O8qGt","pt-1":"_KxUDK","mt-2":"_feZvx","pt-2":"_i4LGd","mt-3":"_8rWTr","pt-3":"_5KtzE","mt-4":"_22EES","pt-4":"_ktDxC","mt-5":"_hNJ8a","pt-5":"_l-BdA","mt-6":"_V7rTE","pt-6":"_yO380","mt-7":"_64Gbc","pt-7":"_slV9V","mt-8":"_PAPZ0","pt-8":"_SlH81","mt-9":"_OmKU7","pt-9":"_m4Y5T","mt-10":"_N7MOD","pt-10":"_5EmMY","mb-0":"_umP3K","pb-0":"_tdjdM","mb-1":"_RUpVI","pb-1":"_qhSG-","mb-2":"_UE6hY","pb-2":"_bhwY3","mb-3":"_gCNY5","pb-3":"_CT9SA","mb-4":"_hXf14","pb-4":"_dBd4j","mb-5":"_BJm2f","pb-5":"_osAXf","mb-6":"_sksVG","pb-6":"_vq2P1","mb-7":"_GGqWv","pb-7":"_Wp-xn","mb-8":"_ao8-b","pb-8":"_Fcz6J","mb-9":"_HTDCN","pb-9":"_j2geM","mb-10":"_tQ3f4","pb-10":"_k5-cY","mx-0":"_C-RwH","px-0":"_fGmBQ","mx-1":"_SJIAI","px-1":"_V6h6n","mx-2":"_RpAL-","px-2":"_MtnJr","mx-3":"_bJAjq","loading-dots":"_i9YR0",big:"_Gf-5X",dot:"_yU4CC","px-3":"_bKF6h","mx-4":"_2YwpF","px-4":"_sv9HO","mx-5":"_fyywB","px-5":"_PAvUg","mx-6":"_-7Y93","px-6":"_2HnrR","mx-7":"_mO0GJ","px-7":"_-XBUb","mx-8":"_rPzNl","px-8":"_lxUkB","mx-9":"_wtwwN","px-9":"_ewGa-","mx-10":"_CUJzg","px-10":"_9fyow","my-0":"_D3hCP","py-0":"_fUhkb","my-1":"_-gS0u","py-1":"_DCjg-","my-2":"_REwX3","py-2":"_5qEqQ","my-3":"_4P9yd","py-3":"_3Q6jo","my-4":"_pJ9JL","py-4":"_fvyEP","my-5":"_7HH0Y","py-5":"_pfPnT","my-6":"_HMzw4","py-6":"_nGGuj","my-7":"_ZQcHb","py-7":"_Q5rCt","my-8":"_yurdg","py-8":"_z2Rnm","my-9":"_SGsqH","py-9":"_RkTBo","my-10":"_hgG--","py-10":"_iKSyb","m-sm-0":"_hG8Pd","p-sm-0":"_paicL","m-sm-1":"_zYVem","p-sm-1":"_Iifls","m-sm-2":"_C0HAk","p-sm-2":"_tyMH8","m-sm-3":"_Nw8NT","p-sm-3":"_mOvjR","m-sm-4":"_auqaY","p-sm-4":"_nqq-T","m-sm-5":"_uC7a4","p-sm-5":"_QmBt-","m-sm-6":"_E1Mby","p-sm-6":"_2b-XB","m-sm-7":"_shE-L","p-sm-7":"_DZiE4","m-sm-8":"_VrAWC","p-sm-8":"_wBvI1","m-sm-9":"_nT5hR","p-sm-9":"_utagJ","m-sm-10":"_suXWh","p-sm-10":"_HqYvz","ml-sm-0":"_XKTYr","pl-sm-0":"_-69hr","ml-sm-1":"_EnQBB","pl-sm-1":"_OBDbZ","ml-sm-2":"_4uEtT","pl-sm-2":"_jxnnV","ml-sm-3":"_4dyy7","pl-sm-3":"_fcp9m","ml-sm-4":"_Su7vR","pl-sm-4":"_iGsH0","ml-sm-5":"_j5bIe","pl-sm-5":"_iiiem","ml-sm-6":"_OSCRC","pl-sm-6":"_a6Ij8","ml-sm-7":"_cESaw","pl-sm-7":"_PZAKp","ml-sm-8":"_u1e7W","pl-sm-8":"_MMjU3","ml-sm-9":"_AEo-h","pl-sm-9":"_g6Qm-","ml-sm-10":"_RSzPa","pl-sm-10":"_5lIjk","mr-sm-0":"_iq-8E","pr-sm-0":"_6e7Oo","mr-sm-1":"_eRKuI","pr-sm-1":"_HaKr0","mr-sm-2":"_sl8Y1","pr-sm-2":"_-eAaQ","mr-sm-3":"_hqMXk","pr-sm-3":"_-nPxR","mr-sm-4":"_PFLZC","pr-sm-4":"_bz8kn","mr-sm-5":"_IDOFd","pr-sm-5":"_YphYe","mr-sm-6":"_DFP8e","pr-sm-6":"_uffDW","mr-sm-7":"_K4gIP","pr-sm-7":"_mFIwC","mr-sm-8":"_ZnbXS","pr-sm-8":"_SJ5sd","mr-sm-9":"_I4pB1","pr-sm-9":"_7Be-A","mr-sm-10":"_BlQpX","pr-sm-10":"_zoDIK","mt-sm-0":"_PpfXn","pt-sm-0":"_MLL-T","mt-sm-1":"_sFLGW","pt-sm-1":"_cssHG","mt-sm-2":"_-CEBu","pt-sm-2":"_3164x","mt-sm-3":"_Q-yYF","pt-sm-3":"_aSP--","mt-sm-4":"_HCnTw","pt-sm-4":"_pkP3Z","mt-sm-5":"_wpfr4","pt-sm-5":"_090aI","mt-sm-6":"_1YJBr","pt-sm-6":"_jYnK3","mt-sm-7":"_1f6jW","pt-sm-7":"_yPAeS","mt-sm-8":"_dNsVh","pt-sm-8":"_5n5Di","mt-sm-9":"_4RACJ","pt-sm-9":"_lgByZ","mt-sm-10":"_SBIrM","pt-sm-10":"_YsBHF","mb-sm-0":"_-z2mG","pb-sm-0":"_uz-nV","mb-sm-1":"_bPTQE","pb-sm-1":"_qTKZa","mb-sm-2":"_DWs80","pb-sm-2":"_7Pkyh","mb-sm-3":"_c5AbJ","pb-sm-3":"_0BQOV","mb-sm-4":"_V1gvx","pb-sm-4":"_s56MP","mb-sm-5":"_abqTk","pb-sm-5":"_YVQSJ","mb-sm-6":"_URgQP","pb-sm-6":"_3cTRb","mb-sm-7":"_tbZgH","pb-sm-7":"_oprz5","mb-sm-8":"_1tsmq","pb-sm-8":"_rp6hG","mb-sm-9":"_HI-9l","pb-sm-9":"_FnTxa","mb-sm-10":"_RHo4c","pb-sm-10":"_PZUR0","mx-sm-0":"_AvLmU","px-sm-0":"_PtUTn","mx-sm-1":"_WdN3k","px-sm-1":"_ytExi","mx-sm-2":"_RWE1V","px-sm-2":"_vw43o","mx-sm-3":"_Cbm5H","px-sm-3":"_P-Cf6","mx-sm-4":"_pjfwR","px-sm-4":"_WtStS","mx-sm-5":"_9a-hP","px-sm-5":"_JMDVm","mx-sm-6":"_OS2my","px-sm-6":"_-GrIc","mx-sm-7":"_BCsIq","px-sm-7":"_WhZnF","mx-sm-8":"_1aj2C","px-sm-8":"_THUvZ","mx-sm-9":"_JGLYJ","px-sm-9":"_A-5uV","mx-sm-10":"_va7ij","px-sm-10":"_XIozX","my-sm-0":"_iYNXh","py-sm-0":"_A4kOE","my-sm-1":"_vMEVL","py-sm-1":"_Xp5yf","my-sm-2":"_VXJt9","py-sm-2":"_LFrIT","my-sm-3":"_KkriU","py-sm-3":"_5locy","my-sm-4":"_FbhGv","py-sm-4":"_lhkY0","my-sm-5":"_iI3NO","py-sm-5":"_YPAWx","my-sm-6":"_nsvtx","py-sm-6":"_fzqyr","my-sm-7":"_HCcpN","py-sm-7":"_yw1CE","my-sm-8":"_FvOZ-","py-sm-8":"_H3dR0","my-sm-9":"_AgJBK","py-sm-9":"_1xEHl","my-sm-10":"_TkKl8","py-sm-10":"_B3-Sv","m-lg-0":"_67BGW","p-lg-0":"_hLq7o","m-lg-1":"_7N5-4","p-lg-1":"_b-vnX","m-lg-2":"_7k7Vs","p-lg-2":"_Q2FO1","m-lg-3":"_ZTSBV","p-lg-3":"_rstCV","m-lg-4":"_juJVU","p-lg-4":"_-F4s-","m-lg-5":"_e2ifF","p-lg-5":"_U4gTc","m-lg-6":"_-4I70","p-lg-6":"_VEcMB","m-lg-7":"_LQqFi","p-lg-7":"_eX0vJ","m-lg-8":"_qPpjy","p-lg-8":"_Bhr2u","m-lg-9":"_DPuMB","p-lg-9":"_H5C3L","m-lg-10":"_1EPHM","p-lg-10":"_mVFm8","ml-lg-0":"_jLUCv","pl-lg-0":"_sdQR4","ml-lg-1":"_dO-42","pl-lg-1":"_RDmEN","ml-lg-2":"_zilrt","pl-lg-2":"_3ZlSF","ml-lg-3":"_ywVg2","pl-lg-3":"_EVjPm","ml-lg-4":"_PBq8D","pl-lg-4":"_-NNsy","ml-lg-5":"_EKt1p","pl-lg-5":"_AAU--","ml-lg-6":"_M3D3t","pl-lg-6":"_VXvIT","ml-lg-7":"_yRT7X","pl-lg-7":"_0XsPz","ml-lg-8":"_HazA-","pl-lg-8":"_JZBh1","ml-lg-9":"_BU6zu","pl-lg-9":"_UPban","ml-lg-10":"_17FL5","pl-lg-10":"_mtv0u","mr-lg-0":"_YxsrA","pr-lg-0":"_1Wmvv","mr-lg-1":"_cQiRZ","pr-lg-1":"_9oheo","mr-lg-2":"_hwBOD","pr-lg-2":"_3i51G","mr-lg-3":"_iwzVs","pr-lg-3":"_1oRFN","mr-lg-4":"_3NfjL","pr-lg-4":"_9OJfa","mr-lg-5":"_YokXX","pr-lg-5":"_owhix","mr-lg-6":"_5Grwo","pr-lg-6":"_r0hct","mr-lg-7":"_dSkGq","pr-lg-7":"_mohcn","mr-lg-8":"_NUor1","pr-lg-8":"_Sjzdu","mr-lg-9":"_Py-ID","pr-lg-9":"_cZdrq","mr-lg-10":"_Etrwm","pr-lg-10":"_YCNLZ","mt-lg-0":"_qEoXx","pt-lg-0":"_nAw0E","mt-lg-1":"_pzDlL","pt-lg-1":"_h8g2E","mt-lg-2":"_QBTy7","pt-lg-2":"_IQoFB","mt-lg-3":"_UGd6N","pt-lg-3":"_PBzO5","mt-lg-4":"_SCRsd","pt-lg-4":"_aFnaW","mt-lg-5":"_EvBB0","pt-lg-5":"_U2iJt","mt-lg-6":"_5mahS","pt-lg-6":"_bzKPx","mt-lg-7":"_E-ZPb","pt-lg-7":"_bspLi","mt-lg-8":"_UA8zu","pt-lg-8":"_3KcAQ","mt-lg-9":"_Ze8Hr","pt-lg-9":"_FKo1d","mt-lg-10":"_kIAZR","pt-lg-10":"_j2qBV","mb-lg-0":"_u8RSu","pb-lg-0":"_7uW-o","mb-lg-1":"_1MnIg","pb-lg-1":"_EeRag","mb-lg-2":"_D-pBo","pb-lg-2":"_TTAjX","mb-lg-3":"_ZldL-","pb-lg-3":"_racM9","mb-lg-4":"_bv3JQ","pb-lg-4":"_m4wR1","mb-lg-5":"_G-OW-","pb-lg-5":"_hTxUe","mb-lg-6":"_-r5uZ","pb-lg-6":"_Ri3sL","mb-lg-7":"_yay34","pb-lg-7":"_H0ybB","mb-lg-8":"_kWcyP","pb-lg-8":"_f7KWI","mb-lg-9":"_f-ap7","pb-lg-9":"_piZbL","mb-lg-10":"_7GnNB","pb-lg-10":"_8RaRH","mx-lg-0":"_E0yc1","px-lg-0":"_jXVGt","mx-lg-1":"_SLGEt","px-lg-1":"_sfpGl","mx-lg-2":"_TQdd5","px-lg-2":"_ZH4kx","mx-lg-3":"_ByYI-","px-lg-3":"_sa8fi","mx-lg-4":"_QFKsD","px-lg-4":"_S-owE","mx-lg-5":"_T-3pC","px-lg-5":"_592xL","mx-lg-6":"_nHCUC","px-lg-6":"_SHGGx","mx-lg-7":"_u8AGu","px-lg-7":"_HGDmM","mx-lg-8":"_DoojR","px-lg-8":"_-xfYS","mx-lg-9":"_a39AX","px-lg-9":"_otRdO","mx-lg-10":"_0jC0L","px-lg-10":"_o3uqZ","my-lg-0":"_fWar-","py-lg-0":"_1KGBQ","my-lg-1":"_rmTwc","py-lg-1":"_SNpLr","my-lg-2":"_nZTm1","py-lg-2":"_fo45m","my-lg-3":"_DP8Cy","py-lg-3":"_tWJ-N","my-lg-4":"_Unnfi","py-lg-4":"_TJ7sH","my-lg-5":"_xIoEe","py-lg-5":"_CH2tq","my-lg-6":"_-4iWK","py-lg-6":"_di773","my-lg-7":"_ZAyLn","py-lg-7":"_yxUoV","my-lg-8":"_AAbVi","py-lg-8":"_ijW6K","my-lg-9":"_2SOZJ","py-lg-9":"_904so","my-lg-10":"_RuT9u","py-lg-10":"_bM8I-","m-md-0":"_JzJkX","p-md-0":"_f8nh5","m-md-1":"_hBYXm","p-md-1":"_X1BU4","m-md-2":"_dnzT0","p-md-2":"_5y79V","m-md-3":"_eBoSQ","p-md-3":"_3KIpC","m-md-4":"_J4f2b","p-md-4":"_-GqF4","m-md-5":"_FaWzb","p-md-5":"_c-ssZ","m-md-6":"_R6a8a","p-md-6":"_3OwFZ","m-md-7":"_VwKx8","p-md-7":"_oICA0","m-md-8":"_D9SPT","p-md-8":"_WqmxK","m-md-9":"_K-6kd","p-md-9":"_RNgLg","m-md-10":"_X2S0Q","p-md-10":"_dUN9U","ml-md-0":"_KI-v9","pl-md-0":"_J-z-m","ml-md-1":"_40NhZ","pl-md-1":"_dwk56","ml-md-2":"_-gtX1","pl-md-2":"_M-jkC","ml-md-3":"_bbVwf","pl-md-3":"_RzC-C","ml-md-4":"_QmHWn","pl-md-4":"_2Lg6Z","ml-md-5":"_TwW16","pl-md-5":"_NvcKj","ml-md-6":"_wxYmK","pl-md-6":"_Ay-nQ","ml-md-7":"_7FRbu","pl-md-7":"_zQusT","ml-md-8":"_f0-0U","pl-md-8":"_rE4oG","ml-md-9":"_8sF7X","pl-md-9":"_RPdXC","ml-md-10":"_-3o3f","pl-md-10":"_JN4N-","mr-md-0":"_5uGyZ","pr-md-0":"_sHCfS","mr-md-1":"_T-APd","pr-md-1":"_EWggr","mr-md-2":"_-IV1z","pr-md-2":"_Mj-hm","mr-md-3":"_W4jcg","pr-md-3":"_rACeA","mr-md-4":"_NVp7l","pr-md-4":"_6LfUe","mr-md-5":"_VyxVE","pr-md-5":"_edWIM","mr-md-6":"_FZQF6","pr-md-6":"_LJpMl","mr-md-7":"_xwZ6q","pr-md-7":"_YflPE","mr-md-8":"_RiPLi","pr-md-8":"_HZNIr","mr-md-9":"_2ZsDj","pr-md-9":"_XBBrF","mr-md-10":"_-kG-G","pr-md-10":"_co3mI","mt-md-0":"_e6IV0","pt-md-0":"_eLP-0","mt-md-1":"_27KXx","pt-md-1":"_gQ2-y","mt-md-2":"_L6-1Q","pt-md-2":"_x7jaE","mt-md-3":"_r5yZl","pt-md-3":"_jTIZh","mt-md-4":"_TxxTT","pt-md-4":"_znNzQ","mt-md-5":"_aPml3","pt-md-5":"_o-WiU","mt-md-6":"_ePcku","pt-md-6":"_7PW3g","mt-md-7":"_qOy4h","pt-md-7":"_czEFY","mt-md-8":"_C5QNJ","pt-md-8":"_LXyGu","mt-md-9":"_BzCq8","pt-md-9":"_j6x7Q","mt-md-10":"_RyoZo","pt-md-10":"_HO6RH","mb-md-0":"_dBqjR","pb-md-0":"_Vtnl-","mb-md-1":"_4CIBM","pb-md-1":"_nkuIR","mb-md-2":"_jioqc","pb-md-2":"_KVlPp","mb-md-3":"_NVp7e","pb-md-3":"_51YgW","mb-md-4":"_6ZjBo","pb-md-4":"_5ewFY","mb-md-5":"_ttOxi","pb-md-5":"_VLqqB","mb-md-6":"_Vl1FM","pb-md-6":"_lj2o-","mb-md-7":"_fY9Hi","pb-md-7":"_vdqU0","mb-md-8":"_MBU95","pb-md-8":"_z-gSw","mb-md-9":"_Wr9dI","pb-md-9":"_D1Q7Q","mb-md-10":"_-resl","pb-md-10":"_Jamfb","mx-md-0":"_0r9rS","px-md-0":"_epgof","mx-md-1":"_aYYOb","px-md-1":"_g6u4x","mx-md-2":"_v6Jsi","px-md-2":"_e7lpx","mx-md-3":"_B5OpT","px-md-3":"_IJdST","mx-md-4":"_Vgq7O","px-md-4":"_q2tQ3","mx-md-5":"_udCxk","px-md-5":"_dkBwz","mx-md-6":"_HAAdk","px-md-6":"_gxcpD","mx-md-7":"_-wAGl","px-md-7":"_PBj8s","mx-md-8":"_51YzX","px-md-8":"_Ht55U","mx-md-9":"_UaNNS","px-md-9":"_A3qbp","mx-md-10":"_O9ir-","px-md-10":"_2jJOG","my-md-0":"_p6EfS","py-md-0":"_8FGSM","my-md-1":"_T6eYc","py-md-1":"_Jrh0m","my-md-2":"_oxohh","py-md-2":"_DTd2y","my-md-3":"_iGc8i","py-md-3":"_jqXbJ","my-md-4":"_wCkrO","py-md-4":"_4p1cz","my-md-5":"_m1Dhe","py-md-5":"_UFngr","my-md-6":"_FdWqj","py-md-6":"_utySi","my-md-7":"_TsKhD","py-md-7":"_8aght","my-md-8":"_H2tbJ","py-md-8":"_mX8dL","my-md-9":"_YP8V8","py-md-9":"_GEd1x","my-md-10":"_qnAfn","py-md-10":"_3MK3a","m-xl-0":"_QUeDl","p-xl-0":"_tpnY6","m-xl-1":"_JhTnG","p-xl-1":"_leasc","m-xl-2":"_rj70q","p-xl-2":"_nmUas","m-xl-3":"_SH7Mw","p-xl-3":"_2sLhA","m-xl-4":"_WKBLF","p-xl-4":"_JTlZn","m-xl-5":"_keccz","p-xl-5":"_W2L9n","m-xl-6":"_MmHtB","p-xl-6":"_16QWL","m-xl-7":"_qoXt8","p-xl-7":"_aZTjp","m-xl-8":"_Gl1CI","p-xl-8":"_u033S","m-xl-9":"_fgyK-","p-xl-9":"_gWQMQ","m-xl-10":"_1zthQ","p-xl-10":"_jYgaz","ml-xl-0":"_Gc0yF","pl-xl-0":"_7r0qa","ml-xl-1":"_riQOx","pl-xl-1":"_ZOf2r","ml-xl-2":"_aqpam","pl-xl-2":"_Kzewg","ml-xl-3":"_riGnY","pl-xl-3":"_fImnr","ml-xl-4":"_Spb-1","pl-xl-4":"_xqk-P","ml-xl-5":"_5ZrWS","pl-xl-5":"_KEqQd","ml-xl-6":"_6cdvz","pl-xl-6":"_RjL-8","ml-xl-7":"_hfyi5","pl-xl-7":"_-xSML","ml-xl-8":"_eHDDu","pl-xl-8":"_iDidv","ml-xl-9":"_Gg4Fk","pl-xl-9":"_fYSK3","ml-xl-10":"_1V3MM","pl-xl-10":"_4jnhK","mr-xl-0":"_8fnBs","pr-xl-0":"_Kemkd","mr-xl-1":"_4ox8d","pr-xl-1":"_zG2Y2","mr-xl-2":"_Pl4X2","pr-xl-2":"_EZpb9","mr-xl-3":"_efgC0","pr-xl-3":"_6hd7x","mr-xl-4":"_rp8M9","pr-xl-4":"_nsRMj","mr-xl-5":"_ayyUE","pr-xl-5":"_BHXMH","mr-xl-6":"_Ez0-c","pr-xl-6":"_xTS9o","mr-xl-7":"_KlyJI","pr-xl-7":"_w3-5z","mr-xl-8":"_onnmv","pr-xl-8":"_aQYpF","mr-xl-9":"_D4mrX","pr-xl-9":"_-MGmg","mr-xl-10":"_KmLe8","pr-xl-10":"_rxxtP","mt-xl-0":"_0-1Kw","pt-xl-0":"_jVAPE","mt-xl-1":"_dO4nc","pt-xl-1":"_oFjXt","mt-xl-2":"_njinL","pt-xl-2":"_EVcqW","mt-xl-3":"_k7EwU","pt-xl-3":"_oALYA","mt-xl-4":"_SSrqv","pt-xl-4":"_8ZIWU","mt-xl-5":"_PXga1","pt-xl-5":"_ewSdF","mt-xl-6":"_0hKMy","pt-xl-6":"_fmLlw","mt-xl-7":"_aBbeO","pt-xl-7":"_Ghd-T","mt-xl-8":"_QILjg","pt-xl-8":"_4401M","mt-xl-9":"_mdFN4","pt-xl-9":"_uBjA3","mt-xl-10":"_l3TPU","pt-xl-10":"_hIKVS","mb-xl-0":"_2Et8-","pb-xl-0":"_uBGMl","mb-xl-1":"_AnrEX","pb-xl-1":"_-PMBv","mb-xl-2":"_cr4lU","pb-xl-2":"_BVCap","mb-xl-3":"_PgCvP","pb-xl-3":"_69b-5","mb-xl-4":"_x5odK","pb-xl-4":"_LzoYk","mb-xl-5":"_3q-dE","pb-xl-5":"_DXCCv","mb-xl-6":"_I8Qbz","pb-xl-6":"_wK-Lg","mb-xl-7":"_NXT2E","pb-xl-7":"_hw62n","mb-xl-8":"_w5tOT","pb-xl-8":"_KA9xk","mb-xl-9":"_B5jk4","pb-xl-9":"_N5trL","mb-xl-10":"_JU9c5","pb-xl-10":"_kP-VE","mx-xl-0":"_jgBYj","px-xl-0":"_iLny2","mx-xl-1":"_1PpJT","px-xl-1":"_eAdDk","mx-xl-2":"_v1kJm","px-xl-2":"_hU50M","mx-xl-3":"_L1JqU","px-xl-3":"_lGvGI","mx-xl-4":"_KNNj2","px-xl-4":"_6-Kgj","mx-xl-5":"_r9t8u","px-xl-5":"_pI6ok","mx-xl-6":"_YO3KF","px-xl-6":"_LIjtn","mx-xl-7":"_Yz-3Z","px-xl-7":"_7xWar","mx-xl-8":"_NEAsT","px-xl-8":"_KSLjS","mx-xl-9":"_XqTby","px-xl-9":"_y5sVK","mx-xl-10":"_GysTi","px-xl-10":"_udCRM","my-xl-0":"_iWpWS","py-xl-0":"_cyc8U","my-xl-1":"_IcUiN","py-xl-1":"_bfKBO","my-xl-2":"_IFTOa","py-xl-2":"_sXWH4","my-xl-3":"_TXATm","py-xl-3":"_Vt5Ze","my-xl-4":"_GLPso","py-xl-4":"_dI2DM","my-xl-5":"_twkBw","py-xl-5":"_m7dMy","my-xl-6":"_a-KcP","py-xl-6":"_dLwS8","my-xl-7":"_qkPb4","py-xl-7":"_uZaN7","my-xl-8":"_2btRT","py-xl-8":"_qsAt5","my-xl-9":"_LpPEh","py-xl-9":"_v1Rtf","my-xl-10":"_xKXEK","py-xl-10":"_pZt9W","background-shine":"_K7sQH",path:"_ko8i0",line:"_uhBI-",skeleton:"_tfiqH","skeleton-animate":"_haT-0","skeleton-dark":"_ZpubN","skeleton-dark-animate":"_BVbU1","skeleton-transparent":"_p-CoM","skeleton-transparent-animate":"_YElIQ","semi-transparent":"_wSCsK","no-margins":"_lNgTM",dots:"_igFzN",colored:"_iCiK-",small:"_zvmsC","extra-small":"_6tLmp","align-left":"_jJMP1","align-right":"_jpWFr"},J=function(m){var _=m.size,l=m.isColored,t=void 0!==l&&l,p=m.noMargins,r=m.align,e=void 0!==r&&r;return h("div",{className:L["loading-dots"]+" "+L[void 0===_?"small":_]+" "+(void 0!==p&&p?" "+L["no-margins"]:"")+" "+(e?L["align-"+e]:"")},h("div",{className:L.dot+" "+(t?" "+L.colored:"")}),h("div",{className:L.dot+" "+(t?" "+L.colored:"")}),h("div",{className:L.dot+" "+(t?" "+L.colored:"")}))};J.propTypes={size:U.oneOf(["big","small","extra-small"]),isColored:U.bool,noMargins:U.bool,align:U.oneOfType([U.oneOf(["left","right"]),U.bool])};var Y=function(l){var t=l.size,p=void 0===t?"xl":t,r=l.className,e=void 0===r?"":r,n=l.mode,o=void 0===n?"transparent":n,s=l.onClick,i=void 0===s?function(m,_){}:s,a=l.loader,d=void 0===a||a,x=l.loading,c=void 0!==x&&x,y=l.to,u=void 0===y?"":y,g=l.fullWidthOnMobiles,b=void 0!==g&&g,f=l.fullWidthOnTablets,v=void 0!==f&&f,S=l.icon,w=void 0===S?"":S,T=l.content,O=void 0===T?"":T,E=l.isDisabled,k=void 0!==E&&E,P=l.setClickTrigger,C=void 0===P?function(m){}:P,j=l.isFormSubmittingButton,B=void 0!==j&&j,I=l.bigIcon,N=void 0!==I&&I,R=l.checkmarkOnClick,q=void 0!==R&&R,K=l.propagatePrimaryButtonClick,D=void 0===K||K,G=l.smallPaddingOnSmallMobiles,M=void 0!==G&&G,A=l.handleError,V=void 0===A?function(m,_){return m(_)}:A,Z=m.useState(c),F=Z[0],W=Z[1],U=m.useState(!1),L=U[0],Y=U[1],Q=m.useState(null),X=Q[0],H=Q[1],$=m.useRef();m.useEffect(function(){C(function(){return $.current.click()})},[$]),m.useEffect(function(){F&&i(function(){return W(!1)},X)},[F]);var mm=function(m){if(F||k)return!1;!q||L||d||c||(Y(!0),setTimeout(function(){Y(!1)},2e3)),m.persist(),!D&&m.stopPropagation(),d?(W(!0),H(m)):i(function(){return W(!1)},m)},_m=z.button+" "+z[p]+" "+z[e]+" "+z[o]+(b?" "+z["full-width-on-mobiles"]:"")+(v?" "+z["full-width-on-tablets"]:"")+(k?" "+z.disable:"")+(M?" "+z["small-padding-on-small-mobiles"]:"");return h(Fragment,null,B?h("input",{type:"submit",hidden:!0}):null,u?h(_.Link,{className:_m,onClick:function(m){return V(mm,m)},to:u,innerRef:$},w?h("div",{className:z["button-with-icon"]+(N?" "+z["big-icon"]:"")},h("img",{src:w,alt:"button icon"}),h("span",{className:z["button-with-icon-text"]},O)):O):h("div",{className:_m,onClick:function(m){return V(mm,m)},ref:$},h("div",{className:z["button-primary-dots-wrapper"]+" "+(F&&d?z.show:"")},d&&F?h(J,{isColored:"white"===o}):null),h("div",{className:z["button-success-icon"]+" "+z[o]+" "+(L?z.show:"")}),w?h("div",{className:z["button-with-icon"]+" "+(F&&d||q&&L?z.hide:"")+" "+(N?z["big-icon"]:"")},h("img",{src:w,alt:"button icon"}),h("span",{className:z["button-with-icon-text"]},O)):h("span",{className:z["button-text"]+" "+(F&&d||q&&L?z.hide:"")},O)))};Y.propTypes={size:U.oneOf(["xl","lg","md","sm"]),className:U.string,mode:U.oneOf(["transparent","white","primary","primary-bordered","primary-transparent","transparent-bordered","transparent-without-shadow"]),onClick:U.func,loader:U.bool,loading:U.bool,to:U.string,fullWidthOnMobiles:U.bool,fullWidthOnTablets:U.bool,icon:U.string,content:U.node,isDisabled:U.bool,setClickTrigger:U.func,isFormSubmittingButton:U.bool,bigIcon:U.bool,checkmarkOnClick:U.bool,propagatePrimaryButtonClick:U.bool,smallPaddingOnSmallMobiles:U.bool,handleError:U.func},Y.defaultProps={size:"xl",className:"",mode:"transparent",onClick:function(m,_){},loader:!0,loading:!1,to:"",fullWidthOnMobiles:!1,fullWidthOnTablets:!1,icon:"",content:"",isDisabled:!1,setClickTrigger:function(m){},isFormSubmittingButton:!1,bigIcon:!1,checkmarkOnClick:!1,propagatePrimaryButtonClick:!0,smallPaddingOnSmallMobiles:!1,handleError:function(m){return m()}},exports.Button=Y,exports.LoadingDots=J;
|
|
1
|
+
var React = require('react');
|
|
2
|
+
var bignumber_js = require('bignumber.js');
|
|
3
|
+
var axios = require('axios');
|
|
4
|
+
var EventBusInstance = require('eventbusjs');
|
|
5
|
+
|
|
6
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
7
|
+
|
|
8
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
9
|
+
var axios__default = /*#__PURE__*/_interopDefaultLegacy(axios);
|
|
10
|
+
var EventBusInstance__default = /*#__PURE__*/_interopDefaultLegacy(EventBusInstance);
|
|
11
|
+
|
|
12
|
+
function createCommonjsModule(fn) {
|
|
13
|
+
var module = { exports: {} };
|
|
14
|
+
return fn(module, module.exports), module.exports;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/** @license React v16.13.1
|
|
18
|
+
* react-is.production.min.js
|
|
19
|
+
*
|
|
20
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
21
|
+
*
|
|
22
|
+
* This source code is licensed under the MIT license found in the
|
|
23
|
+
* LICENSE file in the root directory of this source tree.
|
|
24
|
+
*/
|
|
25
|
+
var b="function"===typeof Symbol&&Symbol.for,c=b?Symbol.for("react.element"):60103,d=b?Symbol.for("react.portal"):60106,e=b?Symbol.for("react.fragment"):60107,f=b?Symbol.for("react.strict_mode"):60108,g=b?Symbol.for("react.profiler"):60114,h=b?Symbol.for("react.provider"):60109,k=b?Symbol.for("react.context"):60110,l=b?Symbol.for("react.async_mode"):60111,m=b?Symbol.for("react.concurrent_mode"):60111,n=b?Symbol.for("react.forward_ref"):60112,p=b?Symbol.for("react.suspense"):60113,q=b?
|
|
26
|
+
Symbol.for("react.suspense_list"):60120,r=b?Symbol.for("react.memo"):60115,t=b?Symbol.for("react.lazy"):60116,v=b?Symbol.for("react.block"):60121,w=b?Symbol.for("react.fundamental"):60117,x=b?Symbol.for("react.responder"):60118,y=b?Symbol.for("react.scope"):60119;
|
|
27
|
+
function z(a){if("object"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case t:case r:case h:return a;default:return u}}case d:return u}}}function A(a){return z(a)===m}var AsyncMode=l;var ConcurrentMode=m;var ContextConsumer=k;var ContextProvider=h;var Element=c;var ForwardRef=n;var Fragment=e;var Lazy=t;var Memo=r;var Portal=d;
|
|
28
|
+
var Profiler=g;var StrictMode=f;var Suspense=p;var isAsyncMode=function(a){return A(a)||z(a)===l};var isConcurrentMode=A;var isContextConsumer=function(a){return z(a)===k};var isContextProvider=function(a){return z(a)===h};var isElement=function(a){return "object"===typeof a&&null!==a&&a.$$typeof===c};var isForwardRef=function(a){return z(a)===n};var isFragment=function(a){return z(a)===e};var isLazy=function(a){return z(a)===t};
|
|
29
|
+
var isMemo=function(a){return z(a)===r};var isPortal=function(a){return z(a)===d};var isProfiler=function(a){return z(a)===g};var isStrictMode=function(a){return z(a)===f};var isSuspense=function(a){return z(a)===p};
|
|
30
|
+
var isValidElementType=function(a){return "string"===typeof a||"function"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q||"object"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n||a.$$typeof===w||a.$$typeof===x||a.$$typeof===y||a.$$typeof===v)};var typeOf=z;
|
|
31
|
+
|
|
32
|
+
var reactIs_production_min = {
|
|
33
|
+
AsyncMode: AsyncMode,
|
|
34
|
+
ConcurrentMode: ConcurrentMode,
|
|
35
|
+
ContextConsumer: ContextConsumer,
|
|
36
|
+
ContextProvider: ContextProvider,
|
|
37
|
+
Element: Element,
|
|
38
|
+
ForwardRef: ForwardRef,
|
|
39
|
+
Fragment: Fragment,
|
|
40
|
+
Lazy: Lazy,
|
|
41
|
+
Memo: Memo,
|
|
42
|
+
Portal: Portal,
|
|
43
|
+
Profiler: Profiler,
|
|
44
|
+
StrictMode: StrictMode,
|
|
45
|
+
Suspense: Suspense,
|
|
46
|
+
isAsyncMode: isAsyncMode,
|
|
47
|
+
isConcurrentMode: isConcurrentMode,
|
|
48
|
+
isContextConsumer: isContextConsumer,
|
|
49
|
+
isContextProvider: isContextProvider,
|
|
50
|
+
isElement: isElement,
|
|
51
|
+
isForwardRef: isForwardRef,
|
|
52
|
+
isFragment: isFragment,
|
|
53
|
+
isLazy: isLazy,
|
|
54
|
+
isMemo: isMemo,
|
|
55
|
+
isPortal: isPortal,
|
|
56
|
+
isProfiler: isProfiler,
|
|
57
|
+
isStrictMode: isStrictMode,
|
|
58
|
+
isSuspense: isSuspense,
|
|
59
|
+
isValidElementType: isValidElementType,
|
|
60
|
+
typeOf: typeOf
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
/** @license React v16.13.1
|
|
64
|
+
* react-is.development.js
|
|
65
|
+
*
|
|
66
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
67
|
+
*
|
|
68
|
+
* This source code is licensed under the MIT license found in the
|
|
69
|
+
* LICENSE file in the root directory of this source tree.
|
|
70
|
+
*/
|
|
71
|
+
|
|
72
|
+
var reactIs_development = createCommonjsModule(function (module, exports) {
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
if (process.env.NODE_ENV !== "production") {
|
|
77
|
+
(function() {
|
|
78
|
+
|
|
79
|
+
// The Symbol used to tag the ReactElement-like types. If there is no native Symbol
|
|
80
|
+
// nor polyfill, then a plain number is used for performance.
|
|
81
|
+
var hasSymbol = typeof Symbol === 'function' && Symbol.for;
|
|
82
|
+
var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
|
|
83
|
+
var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
|
|
84
|
+
var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
|
|
85
|
+
var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
|
|
86
|
+
var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
|
|
87
|
+
var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
|
|
88
|
+
var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary
|
|
89
|
+
// (unstable) APIs that have been removed. Can we remove the symbols?
|
|
90
|
+
|
|
91
|
+
var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf;
|
|
92
|
+
var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
|
|
93
|
+
var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
|
|
94
|
+
var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
|
|
95
|
+
var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;
|
|
96
|
+
var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
|
|
97
|
+
var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
|
|
98
|
+
var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9;
|
|
99
|
+
var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;
|
|
100
|
+
var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;
|
|
101
|
+
var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7;
|
|
102
|
+
|
|
103
|
+
function isValidElementType(type) {
|
|
104
|
+
return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
|
|
105
|
+
type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
function typeOf(object) {
|
|
109
|
+
if (typeof object === 'object' && object !== null) {
|
|
110
|
+
var $$typeof = object.$$typeof;
|
|
111
|
+
|
|
112
|
+
switch ($$typeof) {
|
|
113
|
+
case REACT_ELEMENT_TYPE:
|
|
114
|
+
var type = object.type;
|
|
115
|
+
|
|
116
|
+
switch (type) {
|
|
117
|
+
case REACT_ASYNC_MODE_TYPE:
|
|
118
|
+
case REACT_CONCURRENT_MODE_TYPE:
|
|
119
|
+
case REACT_FRAGMENT_TYPE:
|
|
120
|
+
case REACT_PROFILER_TYPE:
|
|
121
|
+
case REACT_STRICT_MODE_TYPE:
|
|
122
|
+
case REACT_SUSPENSE_TYPE:
|
|
123
|
+
return type;
|
|
124
|
+
|
|
125
|
+
default:
|
|
126
|
+
var $$typeofType = type && type.$$typeof;
|
|
127
|
+
|
|
128
|
+
switch ($$typeofType) {
|
|
129
|
+
case REACT_CONTEXT_TYPE:
|
|
130
|
+
case REACT_FORWARD_REF_TYPE:
|
|
131
|
+
case REACT_LAZY_TYPE:
|
|
132
|
+
case REACT_MEMO_TYPE:
|
|
133
|
+
case REACT_PROVIDER_TYPE:
|
|
134
|
+
return $$typeofType;
|
|
135
|
+
|
|
136
|
+
default:
|
|
137
|
+
return $$typeof;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
case REACT_PORTAL_TYPE:
|
|
143
|
+
return $$typeof;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
return undefined;
|
|
148
|
+
} // AsyncMode is deprecated along with isAsyncMode
|
|
149
|
+
|
|
150
|
+
var AsyncMode = REACT_ASYNC_MODE_TYPE;
|
|
151
|
+
var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
|
|
152
|
+
var ContextConsumer = REACT_CONTEXT_TYPE;
|
|
153
|
+
var ContextProvider = REACT_PROVIDER_TYPE;
|
|
154
|
+
var Element = REACT_ELEMENT_TYPE;
|
|
155
|
+
var ForwardRef = REACT_FORWARD_REF_TYPE;
|
|
156
|
+
var Fragment = REACT_FRAGMENT_TYPE;
|
|
157
|
+
var Lazy = REACT_LAZY_TYPE;
|
|
158
|
+
var Memo = REACT_MEMO_TYPE;
|
|
159
|
+
var Portal = REACT_PORTAL_TYPE;
|
|
160
|
+
var Profiler = REACT_PROFILER_TYPE;
|
|
161
|
+
var StrictMode = REACT_STRICT_MODE_TYPE;
|
|
162
|
+
var Suspense = REACT_SUSPENSE_TYPE;
|
|
163
|
+
var hasWarnedAboutDeprecatedIsAsyncMode = false; // AsyncMode should be deprecated
|
|
164
|
+
|
|
165
|
+
function isAsyncMode(object) {
|
|
166
|
+
{
|
|
167
|
+
if (!hasWarnedAboutDeprecatedIsAsyncMode) {
|
|
168
|
+
hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint
|
|
169
|
+
|
|
170
|
+
console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
|
|
175
|
+
}
|
|
176
|
+
function isConcurrentMode(object) {
|
|
177
|
+
return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
|
|
178
|
+
}
|
|
179
|
+
function isContextConsumer(object) {
|
|
180
|
+
return typeOf(object) === REACT_CONTEXT_TYPE;
|
|
181
|
+
}
|
|
182
|
+
function isContextProvider(object) {
|
|
183
|
+
return typeOf(object) === REACT_PROVIDER_TYPE;
|
|
184
|
+
}
|
|
185
|
+
function isElement(object) {
|
|
186
|
+
return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
187
|
+
}
|
|
188
|
+
function isForwardRef(object) {
|
|
189
|
+
return typeOf(object) === REACT_FORWARD_REF_TYPE;
|
|
190
|
+
}
|
|
191
|
+
function isFragment(object) {
|
|
192
|
+
return typeOf(object) === REACT_FRAGMENT_TYPE;
|
|
193
|
+
}
|
|
194
|
+
function isLazy(object) {
|
|
195
|
+
return typeOf(object) === REACT_LAZY_TYPE;
|
|
196
|
+
}
|
|
197
|
+
function isMemo(object) {
|
|
198
|
+
return typeOf(object) === REACT_MEMO_TYPE;
|
|
199
|
+
}
|
|
200
|
+
function isPortal(object) {
|
|
201
|
+
return typeOf(object) === REACT_PORTAL_TYPE;
|
|
202
|
+
}
|
|
203
|
+
function isProfiler(object) {
|
|
204
|
+
return typeOf(object) === REACT_PROFILER_TYPE;
|
|
205
|
+
}
|
|
206
|
+
function isStrictMode(object) {
|
|
207
|
+
return typeOf(object) === REACT_STRICT_MODE_TYPE;
|
|
208
|
+
}
|
|
209
|
+
function isSuspense(object) {
|
|
210
|
+
return typeOf(object) === REACT_SUSPENSE_TYPE;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
exports.AsyncMode = AsyncMode;
|
|
214
|
+
exports.ConcurrentMode = ConcurrentMode;
|
|
215
|
+
exports.ContextConsumer = ContextConsumer;
|
|
216
|
+
exports.ContextProvider = ContextProvider;
|
|
217
|
+
exports.Element = Element;
|
|
218
|
+
exports.ForwardRef = ForwardRef;
|
|
219
|
+
exports.Fragment = Fragment;
|
|
220
|
+
exports.Lazy = Lazy;
|
|
221
|
+
exports.Memo = Memo;
|
|
222
|
+
exports.Portal = Portal;
|
|
223
|
+
exports.Profiler = Profiler;
|
|
224
|
+
exports.StrictMode = StrictMode;
|
|
225
|
+
exports.Suspense = Suspense;
|
|
226
|
+
exports.isAsyncMode = isAsyncMode;
|
|
227
|
+
exports.isConcurrentMode = isConcurrentMode;
|
|
228
|
+
exports.isContextConsumer = isContextConsumer;
|
|
229
|
+
exports.isContextProvider = isContextProvider;
|
|
230
|
+
exports.isElement = isElement;
|
|
231
|
+
exports.isForwardRef = isForwardRef;
|
|
232
|
+
exports.isFragment = isFragment;
|
|
233
|
+
exports.isLazy = isLazy;
|
|
234
|
+
exports.isMemo = isMemo;
|
|
235
|
+
exports.isPortal = isPortal;
|
|
236
|
+
exports.isProfiler = isProfiler;
|
|
237
|
+
exports.isStrictMode = isStrictMode;
|
|
238
|
+
exports.isSuspense = isSuspense;
|
|
239
|
+
exports.isValidElementType = isValidElementType;
|
|
240
|
+
exports.typeOf = typeOf;
|
|
241
|
+
})();
|
|
242
|
+
}
|
|
243
|
+
});
|
|
244
|
+
|
|
245
|
+
var reactIs = createCommonjsModule(function (module) {
|
|
246
|
+
|
|
247
|
+
if (process.env.NODE_ENV === 'production') {
|
|
248
|
+
module.exports = reactIs_production_min;
|
|
249
|
+
} else {
|
|
250
|
+
module.exports = reactIs_development;
|
|
251
|
+
}
|
|
252
|
+
});
|
|
253
|
+
|
|
254
|
+
/*
|
|
255
|
+
object-assign
|
|
256
|
+
(c) Sindre Sorhus
|
|
257
|
+
@license MIT
|
|
258
|
+
*/
|
|
259
|
+
/* eslint-disable no-unused-vars */
|
|
260
|
+
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
|
|
261
|
+
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
262
|
+
var propIsEnumerable = Object.prototype.propertyIsEnumerable;
|
|
263
|
+
|
|
264
|
+
function toObject(val) {
|
|
265
|
+
if (val === null || val === undefined) {
|
|
266
|
+
throw new TypeError('Object.assign cannot be called with null or undefined');
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
return Object(val);
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
function shouldUseNative() {
|
|
273
|
+
try {
|
|
274
|
+
if (!Object.assign) {
|
|
275
|
+
return false;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
// Detect buggy property enumeration order in older V8 versions.
|
|
279
|
+
|
|
280
|
+
// https://bugs.chromium.org/p/v8/issues/detail?id=4118
|
|
281
|
+
var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
|
|
282
|
+
test1[5] = 'de';
|
|
283
|
+
if (Object.getOwnPropertyNames(test1)[0] === '5') {
|
|
284
|
+
return false;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
// https://bugs.chromium.org/p/v8/issues/detail?id=3056
|
|
288
|
+
var test2 = {};
|
|
289
|
+
for (var i = 0; i < 10; i++) {
|
|
290
|
+
test2['_' + String.fromCharCode(i)] = i;
|
|
291
|
+
}
|
|
292
|
+
var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
|
|
293
|
+
return test2[n];
|
|
294
|
+
});
|
|
295
|
+
if (order2.join('') !== '0123456789') {
|
|
296
|
+
return false;
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
// https://bugs.chromium.org/p/v8/issues/detail?id=3056
|
|
300
|
+
var test3 = {};
|
|
301
|
+
'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
|
|
302
|
+
test3[letter] = letter;
|
|
303
|
+
});
|
|
304
|
+
if (Object.keys(Object.assign({}, test3)).join('') !==
|
|
305
|
+
'abcdefghijklmnopqrst') {
|
|
306
|
+
return false;
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
return true;
|
|
310
|
+
} catch (err) {
|
|
311
|
+
// We don't expect any of the above to throw, but better to be safe.
|
|
312
|
+
return false;
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
var objectAssign = shouldUseNative() ? Object.assign : function (target, source) {
|
|
317
|
+
var from;
|
|
318
|
+
var to = toObject(target);
|
|
319
|
+
var symbols;
|
|
320
|
+
|
|
321
|
+
for (var s = 1; s < arguments.length; s++) {
|
|
322
|
+
from = Object(arguments[s]);
|
|
323
|
+
|
|
324
|
+
for (var key in from) {
|
|
325
|
+
if (hasOwnProperty.call(from, key)) {
|
|
326
|
+
to[key] = from[key];
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
if (getOwnPropertySymbols) {
|
|
331
|
+
symbols = getOwnPropertySymbols(from);
|
|
332
|
+
for (var i = 0; i < symbols.length; i++) {
|
|
333
|
+
if (propIsEnumerable.call(from, symbols[i])) {
|
|
334
|
+
to[symbols[i]] = from[symbols[i]];
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
return to;
|
|
341
|
+
};
|
|
342
|
+
|
|
343
|
+
/**
|
|
344
|
+
* Copyright (c) 2013-present, Facebook, Inc.
|
|
345
|
+
*
|
|
346
|
+
* This source code is licensed under the MIT license found in the
|
|
347
|
+
* LICENSE file in the root directory of this source tree.
|
|
348
|
+
*/
|
|
349
|
+
|
|
350
|
+
var ReactPropTypesSecret$2 = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
|
|
351
|
+
|
|
352
|
+
var ReactPropTypesSecret_1 = ReactPropTypesSecret$2;
|
|
353
|
+
|
|
354
|
+
var has$2 = Function.call.bind(Object.prototype.hasOwnProperty);
|
|
355
|
+
|
|
356
|
+
var ReactPropTypesSecret$1 = ReactPropTypesSecret_1;
|
|
357
|
+
|
|
358
|
+
var has$1 = has$2;
|
|
359
|
+
|
|
360
|
+
/**
|
|
361
|
+
* Copyright (c) 2013-present, Facebook, Inc.
|
|
362
|
+
*
|
|
363
|
+
* This source code is licensed under the MIT license found in the
|
|
364
|
+
* LICENSE file in the root directory of this source tree.
|
|
365
|
+
*/
|
|
366
|
+
|
|
367
|
+
var printWarning$1 = function() {};
|
|
368
|
+
|
|
369
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
370
|
+
var ReactPropTypesSecret = ReactPropTypesSecret$1;
|
|
371
|
+
var loggedTypeFailures = {};
|
|
372
|
+
var has = has$1;
|
|
373
|
+
|
|
374
|
+
printWarning$1 = function(text) {
|
|
375
|
+
var message = 'Warning: ' + text;
|
|
376
|
+
if (typeof console !== 'undefined') {
|
|
377
|
+
console.error(message);
|
|
378
|
+
}
|
|
379
|
+
try {
|
|
380
|
+
// --- Welcome to debugging React ---
|
|
381
|
+
// This error was thrown as a convenience so that you can use this stack
|
|
382
|
+
// to find the callsite that caused this warning to fire.
|
|
383
|
+
throw new Error(message);
|
|
384
|
+
} catch (x) { /**/ }
|
|
385
|
+
};
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
/**
|
|
389
|
+
* Assert that the values match with the type specs.
|
|
390
|
+
* Error messages are memorized and will only be shown once.
|
|
391
|
+
*
|
|
392
|
+
* @param {object} typeSpecs Map of name to a ReactPropType
|
|
393
|
+
* @param {object} values Runtime values that need to be type-checked
|
|
394
|
+
* @param {string} location e.g. "prop", "context", "child context"
|
|
395
|
+
* @param {string} componentName Name of the component for error messages.
|
|
396
|
+
* @param {?Function} getStack Returns the component stack.
|
|
397
|
+
* @private
|
|
398
|
+
*/
|
|
399
|
+
function checkPropTypes$1(typeSpecs, values, location, componentName, getStack) {
|
|
400
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
401
|
+
for (var typeSpecName in typeSpecs) {
|
|
402
|
+
if (has(typeSpecs, typeSpecName)) {
|
|
403
|
+
var error;
|
|
404
|
+
// Prop type validation may throw. In case they do, we don't want to
|
|
405
|
+
// fail the render phase where it didn't fail before. So we log it.
|
|
406
|
+
// After these have been cleaned up, we'll let them throw.
|
|
407
|
+
try {
|
|
408
|
+
// This is intentionally an invariant that gets caught. It's the same
|
|
409
|
+
// behavior as without this statement except with a better message.
|
|
410
|
+
if (typeof typeSpecs[typeSpecName] !== 'function') {
|
|
411
|
+
var err = Error(
|
|
412
|
+
(componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' +
|
|
413
|
+
'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' +
|
|
414
|
+
'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.'
|
|
415
|
+
);
|
|
416
|
+
err.name = 'Invariant Violation';
|
|
417
|
+
throw err;
|
|
418
|
+
}
|
|
419
|
+
error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
|
|
420
|
+
} catch (ex) {
|
|
421
|
+
error = ex;
|
|
422
|
+
}
|
|
423
|
+
if (error && !(error instanceof Error)) {
|
|
424
|
+
printWarning$1(
|
|
425
|
+
(componentName || 'React class') + ': type specification of ' +
|
|
426
|
+
location + ' `' + typeSpecName + '` is invalid; the type checker ' +
|
|
427
|
+
'function must return `null` or an `Error` but returned a ' + typeof error + '. ' +
|
|
428
|
+
'You may have forgotten to pass an argument to the type checker ' +
|
|
429
|
+
'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' +
|
|
430
|
+
'shape all require an argument).'
|
|
431
|
+
);
|
|
432
|
+
}
|
|
433
|
+
if (error instanceof Error && !(error.message in loggedTypeFailures)) {
|
|
434
|
+
// Only monitor this failure once because there tends to be a lot of the
|
|
435
|
+
// same error.
|
|
436
|
+
loggedTypeFailures[error.message] = true;
|
|
437
|
+
|
|
438
|
+
var stack = getStack ? getStack() : '';
|
|
439
|
+
|
|
440
|
+
printWarning$1(
|
|
441
|
+
'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '')
|
|
442
|
+
);
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
/**
|
|
450
|
+
* Resets warning cache when testing.
|
|
451
|
+
*
|
|
452
|
+
* @private
|
|
453
|
+
*/
|
|
454
|
+
checkPropTypes$1.resetWarningCache = function() {
|
|
455
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
456
|
+
loggedTypeFailures = {};
|
|
457
|
+
}
|
|
458
|
+
};
|
|
459
|
+
|
|
460
|
+
var checkPropTypes_1 = checkPropTypes$1;
|
|
461
|
+
|
|
462
|
+
var checkPropTypes = checkPropTypes_1;
|
|
463
|
+
|
|
464
|
+
/**
|
|
465
|
+
* Copyright (c) 2013-present, Facebook, Inc.
|
|
466
|
+
*
|
|
467
|
+
* This source code is licensed under the MIT license found in the
|
|
468
|
+
* LICENSE file in the root directory of this source tree.
|
|
469
|
+
*/
|
|
470
|
+
|
|
471
|
+
|
|
472
|
+
|
|
473
|
+
|
|
474
|
+
|
|
475
|
+
|
|
476
|
+
|
|
477
|
+
|
|
478
|
+
var printWarning = function() {};
|
|
479
|
+
|
|
480
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
481
|
+
printWarning = function(text) {
|
|
482
|
+
var message = 'Warning: ' + text;
|
|
483
|
+
if (typeof console !== 'undefined') {
|
|
484
|
+
console.error(message);
|
|
485
|
+
}
|
|
486
|
+
try {
|
|
487
|
+
// --- Welcome to debugging React ---
|
|
488
|
+
// This error was thrown as a convenience so that you can use this stack
|
|
489
|
+
// to find the callsite that caused this warning to fire.
|
|
490
|
+
throw new Error(message);
|
|
491
|
+
} catch (x) {}
|
|
492
|
+
};
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
function emptyFunctionThatReturnsNull() {
|
|
496
|
+
return null;
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
|
|
500
|
+
/* global Symbol */
|
|
501
|
+
var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
|
|
502
|
+
var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
|
|
503
|
+
|
|
504
|
+
/**
|
|
505
|
+
* Returns the iterator method function contained on the iterable object.
|
|
506
|
+
*
|
|
507
|
+
* Be sure to invoke the function with the iterable as context:
|
|
508
|
+
*
|
|
509
|
+
* var iteratorFn = getIteratorFn(myIterable);
|
|
510
|
+
* if (iteratorFn) {
|
|
511
|
+
* var iterator = iteratorFn.call(myIterable);
|
|
512
|
+
* ...
|
|
513
|
+
* }
|
|
514
|
+
*
|
|
515
|
+
* @param {?object} maybeIterable
|
|
516
|
+
* @return {?function}
|
|
517
|
+
*/
|
|
518
|
+
function getIteratorFn(maybeIterable) {
|
|
519
|
+
var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
|
|
520
|
+
if (typeof iteratorFn === 'function') {
|
|
521
|
+
return iteratorFn;
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
/**
|
|
526
|
+
* Collection of methods that allow declaration and validation of props that are
|
|
527
|
+
* supplied to React components. Example usage:
|
|
528
|
+
*
|
|
529
|
+
* var Props = require('ReactPropTypes');
|
|
530
|
+
* var MyArticle = React.createClass({
|
|
531
|
+
* propTypes: {
|
|
532
|
+
* // An optional string prop named "description".
|
|
533
|
+
* description: Props.string,
|
|
534
|
+
*
|
|
535
|
+
* // A required enum prop named "category".
|
|
536
|
+
* category: Props.oneOf(['News','Photos']).isRequired,
|
|
537
|
+
*
|
|
538
|
+
* // A prop named "dialog" that requires an instance of Dialog.
|
|
539
|
+
* dialog: Props.instanceOf(Dialog).isRequired
|
|
540
|
+
* },
|
|
541
|
+
* render: function() { ... }
|
|
542
|
+
* });
|
|
543
|
+
*
|
|
544
|
+
* A more formal specification of how these methods are used:
|
|
545
|
+
*
|
|
546
|
+
* type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)
|
|
547
|
+
* decl := ReactPropTypes.{type}(.isRequired)?
|
|
548
|
+
*
|
|
549
|
+
* Each and every declaration produces a function with the same signature. This
|
|
550
|
+
* allows the creation of custom validation functions. For example:
|
|
551
|
+
*
|
|
552
|
+
* var MyLink = React.createClass({
|
|
553
|
+
* propTypes: {
|
|
554
|
+
* // An optional string or URI prop named "href".
|
|
555
|
+
* href: function(props, propName, componentName) {
|
|
556
|
+
* var propValue = props[propName];
|
|
557
|
+
* if (propValue != null && typeof propValue !== 'string' &&
|
|
558
|
+
* !(propValue instanceof URI)) {
|
|
559
|
+
* return new Error(
|
|
560
|
+
* 'Expected a string or an URI for ' + propName + ' in ' +
|
|
561
|
+
* componentName
|
|
562
|
+
* );
|
|
563
|
+
* }
|
|
564
|
+
* }
|
|
565
|
+
* },
|
|
566
|
+
* render: function() {...}
|
|
567
|
+
* });
|
|
568
|
+
*
|
|
569
|
+
* @internal
|
|
570
|
+
*/
|
|
571
|
+
|
|
572
|
+
var ANONYMOUS = '<<anonymous>>';
|
|
573
|
+
|
|
574
|
+
// Important!
|
|
575
|
+
// Keep this list in sync with production version in `./factoryWithThrowingShims.js`.
|
|
576
|
+
var ReactPropTypes = {
|
|
577
|
+
array: createPrimitiveTypeChecker('array'),
|
|
578
|
+
bigint: createPrimitiveTypeChecker('bigint'),
|
|
579
|
+
bool: createPrimitiveTypeChecker('boolean'),
|
|
580
|
+
func: createPrimitiveTypeChecker('function'),
|
|
581
|
+
number: createPrimitiveTypeChecker('number'),
|
|
582
|
+
object: createPrimitiveTypeChecker('object'),
|
|
583
|
+
string: createPrimitiveTypeChecker('string'),
|
|
584
|
+
symbol: createPrimitiveTypeChecker('symbol'),
|
|
585
|
+
|
|
586
|
+
any: createAnyTypeChecker(),
|
|
587
|
+
arrayOf: createArrayOfTypeChecker,
|
|
588
|
+
element: createElementTypeChecker(),
|
|
589
|
+
elementType: createElementTypeTypeChecker(),
|
|
590
|
+
instanceOf: createInstanceTypeChecker,
|
|
591
|
+
node: createNodeChecker(),
|
|
592
|
+
objectOf: createObjectOfTypeChecker,
|
|
593
|
+
oneOf: createEnumTypeChecker,
|
|
594
|
+
oneOfType: createUnionTypeChecker,
|
|
595
|
+
shape: createShapeTypeChecker,
|
|
596
|
+
exact: createStrictShapeTypeChecker,
|
|
597
|
+
};
|
|
598
|
+
|
|
599
|
+
/**
|
|
600
|
+
* inlined Object.is polyfill to avoid requiring consumers ship their own
|
|
601
|
+
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
|
|
602
|
+
*/
|
|
603
|
+
/*eslint-disable no-self-compare*/
|
|
604
|
+
function is(x, y) {
|
|
605
|
+
// SameValue algorithm
|
|
606
|
+
if (x === y) {
|
|
607
|
+
// Steps 1-5, 7-10
|
|
608
|
+
// Steps 6.b-6.e: +0 != -0
|
|
609
|
+
return x !== 0 || 1 / x === 1 / y;
|
|
610
|
+
} else {
|
|
611
|
+
// Step 6.a: NaN == NaN
|
|
612
|
+
return x !== x && y !== y;
|
|
613
|
+
}
|
|
614
|
+
}
|
|
615
|
+
/*eslint-enable no-self-compare*/
|
|
616
|
+
|
|
617
|
+
/**
|
|
618
|
+
* We use an Error-like object for backward compatibility as people may call
|
|
619
|
+
* PropTypes directly and inspect their output. However, we don't use real
|
|
620
|
+
* Errors anymore. We don't inspect their stack anyway, and creating them
|
|
621
|
+
* is prohibitively expensive if they are created too often, such as what
|
|
622
|
+
* happens in oneOfType() for any type before the one that matched.
|
|
623
|
+
*/
|
|
624
|
+
function PropTypeError(message, data) {
|
|
625
|
+
this.message = message;
|
|
626
|
+
this.data = data && typeof data === 'object' ? data: {};
|
|
627
|
+
this.stack = '';
|
|
628
|
+
}
|
|
629
|
+
// Make `instanceof Error` still work for returned errors.
|
|
630
|
+
PropTypeError.prototype = Error.prototype;
|
|
631
|
+
|
|
632
|
+
function createChainableTypeChecker(validate) {
|
|
633
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
634
|
+
var manualPropTypeCallCache = {};
|
|
635
|
+
var manualPropTypeWarningCount = 0;
|
|
636
|
+
}
|
|
637
|
+
function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
|
|
638
|
+
componentName = componentName || ANONYMOUS;
|
|
639
|
+
propFullName = propFullName || propName;
|
|
640
|
+
|
|
641
|
+
if (secret !== ReactPropTypesSecret$1) {
|
|
642
|
+
if (throwOnDirectAccess) {
|
|
643
|
+
// New behavior only for users of `prop-types` package
|
|
644
|
+
var err = new Error(
|
|
645
|
+
'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
|
|
646
|
+
'Use `PropTypes.checkPropTypes()` to call them. ' +
|
|
647
|
+
'Read more at http://fb.me/use-check-prop-types'
|
|
648
|
+
);
|
|
649
|
+
err.name = 'Invariant Violation';
|
|
650
|
+
throw err;
|
|
651
|
+
} else if (process.env.NODE_ENV !== 'production' && typeof console !== 'undefined') {
|
|
652
|
+
// Old behavior for people using React.PropTypes
|
|
653
|
+
var cacheKey = componentName + ':' + propName;
|
|
654
|
+
if (
|
|
655
|
+
!manualPropTypeCallCache[cacheKey] &&
|
|
656
|
+
// Avoid spamming the console because they are often not actionable except for lib authors
|
|
657
|
+
manualPropTypeWarningCount < 3
|
|
658
|
+
) {
|
|
659
|
+
printWarning(
|
|
660
|
+
'You are manually calling a React.PropTypes validation ' +
|
|
661
|
+
'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' +
|
|
662
|
+
'and will throw in the standalone `prop-types` package. ' +
|
|
663
|
+
'You may be seeing this warning due to a third-party PropTypes ' +
|
|
664
|
+
'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.'
|
|
665
|
+
);
|
|
666
|
+
manualPropTypeCallCache[cacheKey] = true;
|
|
667
|
+
manualPropTypeWarningCount++;
|
|
668
|
+
}
|
|
669
|
+
}
|
|
670
|
+
}
|
|
671
|
+
if (props[propName] == null) {
|
|
672
|
+
if (isRequired) {
|
|
673
|
+
if (props[propName] === null) {
|
|
674
|
+
return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));
|
|
675
|
+
}
|
|
676
|
+
return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));
|
|
677
|
+
}
|
|
678
|
+
return null;
|
|
679
|
+
} else {
|
|
680
|
+
return validate(props, propName, componentName, location, propFullName);
|
|
681
|
+
}
|
|
682
|
+
}
|
|
683
|
+
|
|
684
|
+
var chainedCheckType = checkType.bind(null, false);
|
|
685
|
+
chainedCheckType.isRequired = checkType.bind(null, true);
|
|
686
|
+
|
|
687
|
+
return chainedCheckType;
|
|
688
|
+
}
|
|
689
|
+
|
|
690
|
+
function createPrimitiveTypeChecker(expectedType) {
|
|
691
|
+
function validate(props, propName, componentName, location, propFullName, secret) {
|
|
692
|
+
var propValue = props[propName];
|
|
693
|
+
var propType = getPropType(propValue);
|
|
694
|
+
if (propType !== expectedType) {
|
|
695
|
+
// `propValue` being instance of, say, date/regexp, pass the 'object'
|
|
696
|
+
// check, but we can offer a more precise error message here rather than
|
|
697
|
+
// 'of type `object`'.
|
|
698
|
+
var preciseType = getPreciseType(propValue);
|
|
699
|
+
|
|
700
|
+
return new PropTypeError(
|
|
701
|
+
'Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'),
|
|
702
|
+
{expectedType: expectedType}
|
|
703
|
+
);
|
|
704
|
+
}
|
|
705
|
+
return null;
|
|
706
|
+
}
|
|
707
|
+
return createChainableTypeChecker(validate);
|
|
708
|
+
}
|
|
709
|
+
|
|
710
|
+
function createAnyTypeChecker() {
|
|
711
|
+
return createChainableTypeChecker(emptyFunctionThatReturnsNull);
|
|
712
|
+
}
|
|
713
|
+
|
|
714
|
+
function createArrayOfTypeChecker(typeChecker) {
|
|
715
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
716
|
+
if (typeof typeChecker !== 'function') {
|
|
717
|
+
return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');
|
|
718
|
+
}
|
|
719
|
+
var propValue = props[propName];
|
|
720
|
+
if (!Array.isArray(propValue)) {
|
|
721
|
+
var propType = getPropType(propValue);
|
|
722
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
|
|
723
|
+
}
|
|
724
|
+
for (var i = 0; i < propValue.length; i++) {
|
|
725
|
+
var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret$1);
|
|
726
|
+
if (error instanceof Error) {
|
|
727
|
+
return error;
|
|
728
|
+
}
|
|
729
|
+
}
|
|
730
|
+
return null;
|
|
731
|
+
}
|
|
732
|
+
return createChainableTypeChecker(validate);
|
|
733
|
+
}
|
|
734
|
+
|
|
735
|
+
function createElementTypeChecker() {
|
|
736
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
737
|
+
var propValue = props[propName];
|
|
738
|
+
if (!isValidElement(propValue)) {
|
|
739
|
+
var propType = getPropType(propValue);
|
|
740
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));
|
|
741
|
+
}
|
|
742
|
+
return null;
|
|
743
|
+
}
|
|
744
|
+
return createChainableTypeChecker(validate);
|
|
745
|
+
}
|
|
746
|
+
|
|
747
|
+
function createElementTypeTypeChecker() {
|
|
748
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
749
|
+
var propValue = props[propName];
|
|
750
|
+
if (!reactIs.isValidElementType(propValue)) {
|
|
751
|
+
var propType = getPropType(propValue);
|
|
752
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement type.'));
|
|
753
|
+
}
|
|
754
|
+
return null;
|
|
755
|
+
}
|
|
756
|
+
return createChainableTypeChecker(validate);
|
|
757
|
+
}
|
|
758
|
+
|
|
759
|
+
function createInstanceTypeChecker(expectedClass) {
|
|
760
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
761
|
+
if (!(props[propName] instanceof expectedClass)) {
|
|
762
|
+
var expectedClassName = expectedClass.name || ANONYMOUS;
|
|
763
|
+
var actualClassName = getClassName(props[propName]);
|
|
764
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
|
|
765
|
+
}
|
|
766
|
+
return null;
|
|
767
|
+
}
|
|
768
|
+
return createChainableTypeChecker(validate);
|
|
769
|
+
}
|
|
770
|
+
|
|
771
|
+
function createEnumTypeChecker(expectedValues) {
|
|
772
|
+
if (!Array.isArray(expectedValues)) {
|
|
773
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
774
|
+
if (arguments.length > 1) {
|
|
775
|
+
printWarning(
|
|
776
|
+
'Invalid arguments supplied to oneOf, expected an array, got ' + arguments.length + ' arguments. ' +
|
|
777
|
+
'A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).'
|
|
778
|
+
);
|
|
779
|
+
} else {
|
|
780
|
+
printWarning('Invalid argument supplied to oneOf, expected an array.');
|
|
781
|
+
}
|
|
782
|
+
}
|
|
783
|
+
return emptyFunctionThatReturnsNull;
|
|
784
|
+
}
|
|
785
|
+
|
|
786
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
787
|
+
var propValue = props[propName];
|
|
788
|
+
for (var i = 0; i < expectedValues.length; i++) {
|
|
789
|
+
if (is(propValue, expectedValues[i])) {
|
|
790
|
+
return null;
|
|
791
|
+
}
|
|
792
|
+
}
|
|
793
|
+
|
|
794
|
+
var valuesString = JSON.stringify(expectedValues, function replacer(key, value) {
|
|
795
|
+
var type = getPreciseType(value);
|
|
796
|
+
if (type === 'symbol') {
|
|
797
|
+
return String(value);
|
|
798
|
+
}
|
|
799
|
+
return value;
|
|
800
|
+
});
|
|
801
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + String(propValue) + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
|
|
802
|
+
}
|
|
803
|
+
return createChainableTypeChecker(validate);
|
|
804
|
+
}
|
|
805
|
+
|
|
806
|
+
function createObjectOfTypeChecker(typeChecker) {
|
|
807
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
808
|
+
if (typeof typeChecker !== 'function') {
|
|
809
|
+
return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');
|
|
810
|
+
}
|
|
811
|
+
var propValue = props[propName];
|
|
812
|
+
var propType = getPropType(propValue);
|
|
813
|
+
if (propType !== 'object') {
|
|
814
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
|
|
815
|
+
}
|
|
816
|
+
for (var key in propValue) {
|
|
817
|
+
if (has$1(propValue, key)) {
|
|
818
|
+
var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret$1);
|
|
819
|
+
if (error instanceof Error) {
|
|
820
|
+
return error;
|
|
821
|
+
}
|
|
822
|
+
}
|
|
823
|
+
}
|
|
824
|
+
return null;
|
|
825
|
+
}
|
|
826
|
+
return createChainableTypeChecker(validate);
|
|
827
|
+
}
|
|
828
|
+
|
|
829
|
+
function createUnionTypeChecker(arrayOfTypeCheckers) {
|
|
830
|
+
if (!Array.isArray(arrayOfTypeCheckers)) {
|
|
831
|
+
process.env.NODE_ENV !== 'production' ? printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') : void 0;
|
|
832
|
+
return emptyFunctionThatReturnsNull;
|
|
833
|
+
}
|
|
834
|
+
|
|
835
|
+
for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
|
|
836
|
+
var checker = arrayOfTypeCheckers[i];
|
|
837
|
+
if (typeof checker !== 'function') {
|
|
838
|
+
printWarning(
|
|
839
|
+
'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' +
|
|
840
|
+
'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.'
|
|
841
|
+
);
|
|
842
|
+
return emptyFunctionThatReturnsNull;
|
|
843
|
+
}
|
|
844
|
+
}
|
|
845
|
+
|
|
846
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
847
|
+
var expectedTypes = [];
|
|
848
|
+
for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
|
|
849
|
+
var checker = arrayOfTypeCheckers[i];
|
|
850
|
+
var checkerResult = checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret$1);
|
|
851
|
+
if (checkerResult == null) {
|
|
852
|
+
return null;
|
|
853
|
+
}
|
|
854
|
+
if (checkerResult.data && has$1(checkerResult.data, 'expectedType')) {
|
|
855
|
+
expectedTypes.push(checkerResult.data.expectedType);
|
|
856
|
+
}
|
|
857
|
+
}
|
|
858
|
+
var expectedTypesMessage = (expectedTypes.length > 0) ? ', expected one of type [' + expectedTypes.join(', ') + ']': '';
|
|
859
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`' + expectedTypesMessage + '.'));
|
|
860
|
+
}
|
|
861
|
+
return createChainableTypeChecker(validate);
|
|
862
|
+
}
|
|
863
|
+
|
|
864
|
+
function createNodeChecker() {
|
|
865
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
866
|
+
if (!isNode(props[propName])) {
|
|
867
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
|
|
868
|
+
}
|
|
869
|
+
return null;
|
|
870
|
+
}
|
|
871
|
+
return createChainableTypeChecker(validate);
|
|
872
|
+
}
|
|
873
|
+
|
|
874
|
+
function invalidValidatorError(componentName, location, propFullName, key, type) {
|
|
875
|
+
return new PropTypeError(
|
|
876
|
+
(componentName || 'React class') + ': ' + location + ' type `' + propFullName + '.' + key + '` is invalid; ' +
|
|
877
|
+
'it must be a function, usually from the `prop-types` package, but received `' + type + '`.'
|
|
878
|
+
);
|
|
879
|
+
}
|
|
880
|
+
|
|
881
|
+
function createShapeTypeChecker(shapeTypes) {
|
|
882
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
883
|
+
var propValue = props[propName];
|
|
884
|
+
var propType = getPropType(propValue);
|
|
885
|
+
if (propType !== 'object') {
|
|
886
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
|
|
887
|
+
}
|
|
888
|
+
for (var key in shapeTypes) {
|
|
889
|
+
var checker = shapeTypes[key];
|
|
890
|
+
if (typeof checker !== 'function') {
|
|
891
|
+
return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
|
|
892
|
+
}
|
|
893
|
+
var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret$1);
|
|
894
|
+
if (error) {
|
|
895
|
+
return error;
|
|
896
|
+
}
|
|
897
|
+
}
|
|
898
|
+
return null;
|
|
899
|
+
}
|
|
900
|
+
return createChainableTypeChecker(validate);
|
|
901
|
+
}
|
|
902
|
+
|
|
903
|
+
function createStrictShapeTypeChecker(shapeTypes) {
|
|
904
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
905
|
+
var propValue = props[propName];
|
|
906
|
+
var propType = getPropType(propValue);
|
|
907
|
+
if (propType !== 'object') {
|
|
908
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
|
|
909
|
+
}
|
|
910
|
+
// We need to check all keys in case some are required but missing from props.
|
|
911
|
+
var allKeys = objectAssign({}, props[propName], shapeTypes);
|
|
912
|
+
for (var key in allKeys) {
|
|
913
|
+
var checker = shapeTypes[key];
|
|
914
|
+
if (has$1(shapeTypes, key) && typeof checker !== 'function') {
|
|
915
|
+
return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
|
|
916
|
+
}
|
|
917
|
+
if (!checker) {
|
|
918
|
+
return new PropTypeError(
|
|
919
|
+
'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' +
|
|
920
|
+
'\nBad object: ' + JSON.stringify(props[propName], null, ' ') +
|
|
921
|
+
'\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ')
|
|
922
|
+
);
|
|
923
|
+
}
|
|
924
|
+
var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret$1);
|
|
925
|
+
if (error) {
|
|
926
|
+
return error;
|
|
927
|
+
}
|
|
928
|
+
}
|
|
929
|
+
return null;
|
|
930
|
+
}
|
|
931
|
+
|
|
932
|
+
return createChainableTypeChecker(validate);
|
|
933
|
+
}
|
|
934
|
+
|
|
935
|
+
function isNode(propValue) {
|
|
936
|
+
switch (typeof propValue) {
|
|
937
|
+
case 'number':
|
|
938
|
+
case 'string':
|
|
939
|
+
case 'undefined':
|
|
940
|
+
return true;
|
|
941
|
+
case 'boolean':
|
|
942
|
+
return !propValue;
|
|
943
|
+
case 'object':
|
|
944
|
+
if (Array.isArray(propValue)) {
|
|
945
|
+
return propValue.every(isNode);
|
|
946
|
+
}
|
|
947
|
+
if (propValue === null || isValidElement(propValue)) {
|
|
948
|
+
return true;
|
|
949
|
+
}
|
|
950
|
+
|
|
951
|
+
var iteratorFn = getIteratorFn(propValue);
|
|
952
|
+
if (iteratorFn) {
|
|
953
|
+
var iterator = iteratorFn.call(propValue);
|
|
954
|
+
var step;
|
|
955
|
+
if (iteratorFn !== propValue.entries) {
|
|
956
|
+
while (!(step = iterator.next()).done) {
|
|
957
|
+
if (!isNode(step.value)) {
|
|
958
|
+
return false;
|
|
959
|
+
}
|
|
960
|
+
}
|
|
961
|
+
} else {
|
|
962
|
+
// Iterator will provide entry [k,v] tuples rather than values.
|
|
963
|
+
while (!(step = iterator.next()).done) {
|
|
964
|
+
var entry = step.value;
|
|
965
|
+
if (entry) {
|
|
966
|
+
if (!isNode(entry[1])) {
|
|
967
|
+
return false;
|
|
968
|
+
}
|
|
969
|
+
}
|
|
970
|
+
}
|
|
971
|
+
}
|
|
972
|
+
} else {
|
|
973
|
+
return false;
|
|
974
|
+
}
|
|
975
|
+
|
|
976
|
+
return true;
|
|
977
|
+
default:
|
|
978
|
+
return false;
|
|
979
|
+
}
|
|
980
|
+
}
|
|
981
|
+
|
|
982
|
+
function isSymbol(propType, propValue) {
|
|
983
|
+
// Native Symbol.
|
|
984
|
+
if (propType === 'symbol') {
|
|
985
|
+
return true;
|
|
986
|
+
}
|
|
987
|
+
|
|
988
|
+
// falsy value can't be a Symbol
|
|
989
|
+
if (!propValue) {
|
|
990
|
+
return false;
|
|
991
|
+
}
|
|
992
|
+
|
|
993
|
+
// 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'
|
|
994
|
+
if (propValue['@@toStringTag'] === 'Symbol') {
|
|
995
|
+
return true;
|
|
996
|
+
}
|
|
997
|
+
|
|
998
|
+
// Fallback for non-spec compliant Symbols which are polyfilled.
|
|
999
|
+
if (typeof Symbol === 'function' && propValue instanceof Symbol) {
|
|
1000
|
+
return true;
|
|
1001
|
+
}
|
|
1002
|
+
|
|
1003
|
+
return false;
|
|
1004
|
+
}
|
|
1005
|
+
|
|
1006
|
+
// Equivalent of `typeof` but with special handling for array and regexp.
|
|
1007
|
+
function getPropType(propValue) {
|
|
1008
|
+
var propType = typeof propValue;
|
|
1009
|
+
if (Array.isArray(propValue)) {
|
|
1010
|
+
return 'array';
|
|
1011
|
+
}
|
|
1012
|
+
if (propValue instanceof RegExp) {
|
|
1013
|
+
// Old webkits (at least until Android 4.0) return 'function' rather than
|
|
1014
|
+
// 'object' for typeof a RegExp. We'll normalize this here so that /bla/
|
|
1015
|
+
// passes PropTypes.object.
|
|
1016
|
+
return 'object';
|
|
1017
|
+
}
|
|
1018
|
+
if (isSymbol(propType, propValue)) {
|
|
1019
|
+
return 'symbol';
|
|
1020
|
+
}
|
|
1021
|
+
return propType;
|
|
1022
|
+
}
|
|
1023
|
+
|
|
1024
|
+
// This handles more types than `getPropType`. Only used for error messages.
|
|
1025
|
+
// See `createPrimitiveTypeChecker`.
|
|
1026
|
+
function getPreciseType(propValue) {
|
|
1027
|
+
if (typeof propValue === 'undefined' || propValue === null) {
|
|
1028
|
+
return '' + propValue;
|
|
1029
|
+
}
|
|
1030
|
+
var propType = getPropType(propValue);
|
|
1031
|
+
if (propType === 'object') {
|
|
1032
|
+
if (propValue instanceof Date) {
|
|
1033
|
+
return 'date';
|
|
1034
|
+
} else if (propValue instanceof RegExp) {
|
|
1035
|
+
return 'regexp';
|
|
1036
|
+
}
|
|
1037
|
+
}
|
|
1038
|
+
return propType;
|
|
1039
|
+
}
|
|
1040
|
+
|
|
1041
|
+
// Returns a string that is postfixed to a warning about an invalid type.
|
|
1042
|
+
// For example, "undefined" or "of type array"
|
|
1043
|
+
function getPostfixForTypeWarning(value) {
|
|
1044
|
+
var type = getPreciseType(value);
|
|
1045
|
+
switch (type) {
|
|
1046
|
+
case 'array':
|
|
1047
|
+
case 'object':
|
|
1048
|
+
return 'an ' + type;
|
|
1049
|
+
case 'boolean':
|
|
1050
|
+
case 'date':
|
|
1051
|
+
case 'regexp':
|
|
1052
|
+
return 'a ' + type;
|
|
1053
|
+
default:
|
|
1054
|
+
return type;
|
|
1055
|
+
}
|
|
1056
|
+
}
|
|
1057
|
+
|
|
1058
|
+
// Returns class name of the object, if any.
|
|
1059
|
+
function getClassName(propValue) {
|
|
1060
|
+
if (!propValue.constructor || !propValue.constructor.name) {
|
|
1061
|
+
return ANONYMOUS;
|
|
1062
|
+
}
|
|
1063
|
+
return propValue.constructor.name;
|
|
1064
|
+
}
|
|
1065
|
+
|
|
1066
|
+
ReactPropTypes.checkPropTypes = checkPropTypes;
|
|
1067
|
+
ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache;
|
|
1068
|
+
ReactPropTypes.PropTypes = ReactPropTypes;
|
|
1069
|
+
|
|
1070
|
+
return ReactPropTypes;
|
|
1071
|
+
};
|
|
1072
|
+
|
|
1073
|
+
/**
|
|
1074
|
+
* Copyright (c) 2013-present, Facebook, Inc.
|
|
1075
|
+
*
|
|
1076
|
+
* This source code is licensed under the MIT license found in the
|
|
1077
|
+
* LICENSE file in the root directory of this source tree.
|
|
1078
|
+
*/
|
|
1079
|
+
|
|
1080
|
+
|
|
1081
|
+
|
|
1082
|
+
function emptyFunction() {}
|
|
1083
|
+
function emptyFunctionWithReset() {}
|
|
1084
|
+
emptyFunctionWithReset.resetWarningCache = emptyFunction;
|
|
1085
|
+
|
|
1086
|
+
var factoryWithThrowingShims = function() {
|
|
1087
|
+
function shim(props, propName, componentName, location, propFullName, secret) {
|
|
1088
|
+
if (secret === ReactPropTypesSecret$1) {
|
|
1089
|
+
// It is still safe when called from React.
|
|
1090
|
+
return;
|
|
1091
|
+
}
|
|
1092
|
+
var err = new Error(
|
|
1093
|
+
'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
|
|
1094
|
+
'Use PropTypes.checkPropTypes() to call them. ' +
|
|
1095
|
+
'Read more at http://fb.me/use-check-prop-types'
|
|
1096
|
+
);
|
|
1097
|
+
err.name = 'Invariant Violation';
|
|
1098
|
+
throw err;
|
|
1099
|
+
} shim.isRequired = shim;
|
|
1100
|
+
function getShim() {
|
|
1101
|
+
return shim;
|
|
1102
|
+
} // Important!
|
|
1103
|
+
// Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
|
|
1104
|
+
var ReactPropTypes = {
|
|
1105
|
+
array: shim,
|
|
1106
|
+
bigint: shim,
|
|
1107
|
+
bool: shim,
|
|
1108
|
+
func: shim,
|
|
1109
|
+
number: shim,
|
|
1110
|
+
object: shim,
|
|
1111
|
+
string: shim,
|
|
1112
|
+
symbol: shim,
|
|
1113
|
+
|
|
1114
|
+
any: shim,
|
|
1115
|
+
arrayOf: getShim,
|
|
1116
|
+
element: shim,
|
|
1117
|
+
elementType: shim,
|
|
1118
|
+
instanceOf: getShim,
|
|
1119
|
+
node: shim,
|
|
1120
|
+
objectOf: getShim,
|
|
1121
|
+
oneOf: getShim,
|
|
1122
|
+
oneOfType: getShim,
|
|
1123
|
+
shape: getShim,
|
|
1124
|
+
exact: getShim,
|
|
1125
|
+
|
|
1126
|
+
checkPropTypes: emptyFunctionWithReset,
|
|
1127
|
+
resetWarningCache: emptyFunction
|
|
1128
|
+
};
|
|
1129
|
+
|
|
1130
|
+
ReactPropTypes.PropTypes = ReactPropTypes;
|
|
1131
|
+
|
|
1132
|
+
return ReactPropTypes;
|
|
1133
|
+
};
|
|
1134
|
+
|
|
1135
|
+
var require$$1 = factoryWithTypeCheckers;
|
|
1136
|
+
|
|
1137
|
+
var require$$2 = factoryWithThrowingShims;
|
|
1138
|
+
|
|
1139
|
+
/**
|
|
1140
|
+
* Copyright (c) 2013-present, Facebook, Inc.
|
|
1141
|
+
*
|
|
1142
|
+
* This source code is licensed under the MIT license found in the
|
|
1143
|
+
* LICENSE file in the root directory of this source tree.
|
|
1144
|
+
*/
|
|
1145
|
+
|
|
1146
|
+
var propTypes = createCommonjsModule(function (module) {
|
|
1147
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1148
|
+
var ReactIs = reactIs;
|
|
1149
|
+
|
|
1150
|
+
// By explicitly using `prop-types` you are opting into new development behavior.
|
|
1151
|
+
// http://fb.me/prop-types-in-prod
|
|
1152
|
+
var throwOnDirectAccess = true;
|
|
1153
|
+
module.exports = require$$1(ReactIs.isElement, throwOnDirectAccess);
|
|
1154
|
+
} else {
|
|
1155
|
+
// By explicitly using `prop-types` you are opting into new production behavior.
|
|
1156
|
+
// http://fb.me/prop-types-in-prod
|
|
1157
|
+
module.exports = require$$2();
|
|
1158
|
+
}
|
|
1159
|
+
});
|
|
1160
|
+
|
|
1161
|
+
var PropTypes = propTypes;
|
|
1162
|
+
|
|
1163
|
+
var styles$1 = {"container":"_lIpAT","button":"_sS-Yj","m-0":"_hBGrg","p-0":"_fOezx","m-1":"_R79vC","p-1":"_BGhZS","m-2":"_4WQa1","p-2":"_-hkj1","m-3":"_ePtXr","p-3":"_ihe2B","m-4":"_KplPo","p-4":"_2vDkp","m-5":"_4AqfI","p-5":"_FfAMs","m-6":"_53MvX","p-6":"_e-x4J","m-7":"_EtdrG","p-7":"_FLCe5","m-8":"_1IHYX","p-8":"_fZzmM","m-9":"_QsD9D","p-9":"_6Sr2Q","m-10":"_LvJdU","p-10":"_ah-tz","ml-0":"_De6uE","pl-0":"_aQ1ph","ml-1":"_5Bwy4","pl-1":"_j4wAR","ml-2":"_qeK50","pl-2":"_VC868","ml-3":"_LuNZb","pl-3":"_3fxbv","ml-4":"_XiU0I","pl-4":"_hPWPx","ml-5":"_xkmy7","pl-5":"_vZWUx","ml-6":"_HJ-Oe","pl-6":"_nx5bN","ml-7":"_L-cTm","pl-7":"_XyNJZ","ml-8":"_GUJTt","pl-8":"_O-OPx","ml-9":"_4DBUs","pl-9":"_W5E4J","ml-10":"_TsFNa","pl-10":"_a07G-","mr-0":"_KuY5-","pr-0":"_Zv2gF","mr-1":"_IylJL","pr-1":"_DIaMC","mr-2":"_wodzN","pr-2":"_x7vGR","mr-3":"_cg-WA","pr-3":"_-GR0e","mr-4":"_zip09","pr-4":"_mrzBz","mr-5":"_Z3SdR","pr-5":"_FOt7u","mr-6":"_DX3gj","pr-6":"_caE8K","mr-7":"_SRVDr","pr-7":"_7h7Xw","mr-8":"_bvjcP","pr-8":"_WxJl8","mr-9":"_CDXo1","pr-9":"_uftSg","mr-10":"_WqvBW","pr-10":"_75aX1","mt-0":"_lfLEb","pt-0":"_FszNW","mt-1":"_xtok6","pt-1":"_cDFtN","mt-2":"_j96uZ","pt-2":"_BX40s","mt-3":"_3--yt","pt-3":"_qkmXr","mt-4":"_DhLUo","pt-4":"_AG7V9","mt-5":"_Gn5bX","pt-5":"_5-rlk","mt-6":"_c6g6t","pt-6":"_iWQbs","mt-7":"_6X-oB","pt-7":"_i82Td","mt-8":"_uK93t","pt-8":"_ESUrY","mt-9":"_LmSrq","pt-9":"_BgZxc","mt-10":"_mPy8r","pt-10":"_ddKoS","mb-0":"_gs1hc","pb-0":"_k94Xn","mb-1":"_8XN6g","pb-1":"_lJSHs","mb-2":"_y04oG","pb-2":"_cNkcX","mb-3":"_3-Ex4","pb-3":"_UlTDL","mb-4":"_ZchCM","pb-4":"_PrDJ0","mb-5":"_Al-qI","pb-5":"_9ExxH","mb-6":"_38fJH","pb-6":"_YPJnw","mb-7":"_ViLUm","pb-7":"_YtQHK","mb-8":"_Jm2m3","pb-8":"_hQSln","mb-9":"_73cuP","pb-9":"_Hm-oe","mb-10":"_90atw","pb-10":"_GxdOW","mx-0":"_786dB","px-0":"_b-KUL","mx-1":"_1sw2D","px-1":"_pfikG","mx-2":"_ZCsfc","px-2":"_-E-rP","mx-3":"_Vzqfk","px-3":"_Evygh","mx-4":"_g6XKX","px-4":"_hzPZK","mx-5":"_6Yusw","px-5":"_43D2o","mx-6":"_l7jig","px-6":"_X4DAB","mx-7":"_xCEJ4","px-7":"_kFsKL","mx-8":"_bcZ3x","px-8":"_qKJ-o","mx-9":"_pmzk-","px-9":"_5kFZh","mx-10":"_ZtyHL","px-10":"_RzSP4","my-0":"_iGkHt","py-0":"_tFXK8","my-1":"_9p151","py-1":"_1ExYH","my-2":"_hDX-y","py-2":"_j2Iqz","my-3":"_ZoP-i","py-3":"_JiyfX","my-4":"_6dHeQ","py-4":"_Val1l","my-5":"_yF8w9","py-5":"_3Do00","my-6":"_5ATW7","py-6":"_EqQi0","my-7":"_6Kng-","py-7":"_kFB05","my-8":"_fqkrf","py-8":"_wkYlc","my-9":"_yC6ha","py-9":"_nR4hK","my-10":"_46v2E","py-10":"_yjbuZ","m-sm-0":"_mXg7O","p-sm-0":"_sRkzF","m-sm-1":"_uh76t","p-sm-1":"_mnvOq","m-sm-2":"_-Lxwk","p-sm-2":"_9AoV6","m-sm-3":"_k6uGI","p-sm-3":"_FPlck","m-sm-4":"_XWNGm","p-sm-4":"_UhY4z","m-sm-5":"_nqmEm","p-sm-5":"_O3yzT","m-sm-6":"_1C7QT","p-sm-6":"_yR3CC","m-sm-7":"_vlqMl","p-sm-7":"_otIfI","m-sm-8":"_f-GUL","p-sm-8":"_oMnLQ","m-sm-9":"_Klhy3","p-sm-9":"_xYdqe","m-sm-10":"_jg7tY","p-sm-10":"_-28KU","ml-sm-0":"_6hhVb","pl-sm-0":"_WV4uZ","ml-sm-1":"_u--dD","pl-sm-1":"_k2dSZ","ml-sm-2":"_ng1Wx","pl-sm-2":"_A6pLt","ml-sm-3":"_OKwcI","pl-sm-3":"_uxcE6","ml-sm-4":"_dHy5x","pl-sm-4":"_loKKN","ml-sm-5":"_pWXnn","pl-sm-5":"_6KcZ0","ml-sm-6":"_8DdT4","pl-sm-6":"_atdfH","ml-sm-7":"_-BksR","pl-sm-7":"_B6uGl","ml-sm-8":"_rL6Yi","pl-sm-8":"_L0Gt6","ml-sm-9":"_sDCuc","pl-sm-9":"_5ndTT","ml-sm-10":"_d0sOv","pl-sm-10":"_MzCci","mr-sm-0":"_TxpxL","pr-sm-0":"_ReTjB","mr-sm-1":"_ZDd-C","pr-sm-1":"_6ux6P","mr-sm-2":"_SbIys","pr-sm-2":"_0dAjY","mr-sm-3":"_WT-FE","pr-sm-3":"_hgzpB","mr-sm-4":"_ovLOk","pr-sm-4":"_YVXRD","mr-sm-5":"_3gKfj","pr-sm-5":"_GKqKE","mr-sm-6":"_EJ3Ig","pr-sm-6":"_pKU7W","mr-sm-7":"_MfWyc","pr-sm-7":"_439vk","mr-sm-8":"_HsLqa","pr-sm-8":"_Afu8-","mr-sm-9":"_k-uXQ","pr-sm-9":"_GSZg6","mr-sm-10":"_buR-E","pr-sm-10":"_GoGHq","mt-sm-0":"_3eC5V","pt-sm-0":"_w0Row","mt-sm-1":"_lFsar","pt-sm-1":"_rhMZX","mt-sm-2":"_HchNc","pt-sm-2":"_Xyn5a","mt-sm-3":"_INU0e","pt-sm-3":"_i9zkC","mt-sm-4":"_d1xqQ","pt-sm-4":"_eMU-M","mt-sm-5":"_gYMLN","pt-sm-5":"_sG2g-","mt-sm-6":"_U4BDm","pt-sm-6":"_nagya","mt-sm-7":"_f4nLP","pt-sm-7":"_3jMHw","mt-sm-8":"_hZW3J","pt-sm-8":"_woC7I","mt-sm-9":"_SFf2s","pt-sm-9":"_nuLoR","mt-sm-10":"_k1lF9","pt-sm-10":"_WG3-N","mb-sm-0":"_fQPR-","pb-sm-0":"_eL6LV","mb-sm-1":"_Z7gTR","pb-sm-1":"_OdGhD","mb-sm-2":"_dkjwo","pb-sm-2":"_kKhvE","mb-sm-3":"_meX0E","pb-sm-3":"_kh7Ku","mb-sm-4":"_rrb92","pb-sm-4":"_aytJc","mb-sm-5":"_wPkH4","pb-sm-5":"_1nZ-9","mb-sm-6":"_MkdDA","pb-sm-6":"_BxNLc","mb-sm-7":"_Nfm1A","pb-sm-7":"_-r452","mb-sm-8":"_K1omF","pb-sm-8":"_4-6gt","mb-sm-9":"_OUWsR","pb-sm-9":"_7DXr5","mb-sm-10":"_wZv7f","pb-sm-10":"_21WIP","mx-sm-0":"_hCRDg","px-sm-0":"_Bdj31","mx-sm-1":"_sx6bH","px-sm-1":"_jQXbZ","mx-sm-2":"_aCjIb","px-sm-2":"_-DBsZ","mx-sm-3":"_p2bFN","px-sm-3":"_d6ice","mx-sm-4":"_GZmNE","px-sm-4":"_7D10W","mx-sm-5":"_tKkEN","px-sm-5":"_J2iH5","mx-sm-6":"_iJju-","px-sm-6":"_m2ygK","mx-sm-7":"_chPCu","px-sm-7":"_C0aVt","mx-sm-8":"_twRB-","px-sm-8":"_6DezI","mx-sm-9":"_z1iZL","px-sm-9":"_HLE-F","mx-sm-10":"_F58U0","px-sm-10":"_Mat2S","my-sm-0":"_nADuT","py-sm-0":"_yu79u","my-sm-1":"_TEHyf","py-sm-1":"_MkRV5","my-sm-2":"_wfxJN","py-sm-2":"_qjIa5","my-sm-3":"_ch7TX","py-sm-3":"_0ZM5Q","my-sm-4":"_KQyj3","py-sm-4":"_npV56","my-sm-5":"_antvz","py-sm-5":"_qK29t","my-sm-6":"_PIZw6","py-sm-6":"_kwzra","my-sm-7":"_IPjVc","py-sm-7":"_NPJ-2","my-sm-8":"_Sxu2p","py-sm-8":"_VUG-4","my-sm-9":"_mLy-T","py-sm-9":"_U-1Tz","my-sm-10":"_6LGF-","py-sm-10":"_1I7Qo","m-lg-0":"_7JHxT","p-lg-0":"_dZxSG","m-lg-1":"_ap69K","p-lg-1":"_yAiEU","m-lg-2":"_cu0Gq","p-lg-2":"_p2Nvp","m-lg-3":"_ipTnO","p-lg-3":"_uekmi","m-lg-4":"_Ocj1U","p-lg-4":"_T5xZ0","m-lg-5":"_9QwAr","p-lg-5":"_S73RR","m-lg-6":"_TQDUS","p-lg-6":"_SVpzt","m-lg-7":"_u7-7x","p-lg-7":"_tVwwR","m-lg-8":"_VMheR","p-lg-8":"_dnoel","m-lg-9":"_bs68b","p-lg-9":"_-fPka","m-lg-10":"_JaRq8","p-lg-10":"_222SK","ml-lg-0":"_snW5C","pl-lg-0":"_cbC4p","ml-lg-1":"_ZcZqo","pl-lg-1":"_Ox1R-","ml-lg-2":"_GYhhL","pl-lg-2":"_RQnGa","ml-lg-3":"_PUix3","pl-lg-3":"_TXjNe","ml-lg-4":"_ctO4e","pl-lg-4":"_HGdnK","ml-lg-5":"_0kAql","pl-lg-5":"_j374-","ml-lg-6":"_DTSzU","pl-lg-6":"_f8fRt","ml-lg-7":"_SOGpN","pl-lg-7":"_ftCov","ml-lg-8":"_yyg3O","pl-lg-8":"_es-pp","ml-lg-9":"_ujiYm","pl-lg-9":"_hEH2f","ml-lg-10":"_sOymp","pl-lg-10":"_zABMD","mr-lg-0":"_bZvOK","pr-lg-0":"_1MjdX","mr-lg-1":"_lVGe-","pr-lg-1":"_hJzV5","mr-lg-2":"_9az71","pr-lg-2":"_vBVKt","mr-lg-3":"_SK-xp","pr-lg-3":"_BymTx","mr-lg-4":"_C-P-K","pr-lg-4":"_oDktY","mr-lg-5":"_e8X2c","pr-lg-5":"_XugCG","mr-lg-6":"_CycFS","pr-lg-6":"_aXn7x","mr-lg-7":"_woi9n","pr-lg-7":"_Xz9XT","mr-lg-8":"_p4H3g","pr-lg-8":"_2GHoq","mr-lg-9":"_OZukC","pr-lg-9":"_ckY7k","mr-lg-10":"_tu3W5","pr-lg-10":"_9v3FG","mt-lg-0":"_I-1g6","pt-lg-0":"_cUyFD","mt-lg-1":"_c94QP","pt-lg-1":"_g75ry","mt-lg-2":"_XiT9Y","pt-lg-2":"_OzwIr","mt-lg-3":"_TZnYh","pt-lg-3":"_qC-3V","mt-lg-4":"_ClD8h","pt-lg-4":"_n1T93","mt-lg-5":"_yfqL8","pt-lg-5":"_oRkf6","mt-lg-6":"_6sndc","pt-lg-6":"_zKuFI","mt-lg-7":"_61kz3","pt-lg-7":"_5Q2hr","mt-lg-8":"_s2ReT","pt-lg-8":"_Ap8SS","mt-lg-9":"_bV6Hp","pt-lg-9":"_G5Dl9","mt-lg-10":"_hSJ91","pt-lg-10":"_amgjj","mb-lg-0":"_p-7me","pb-lg-0":"_ys8Fm","mb-lg-1":"_ZFPzR","pb-lg-1":"_Low3Q","mb-lg-2":"_UKfD5","pb-lg-2":"_Z4xYz","mb-lg-3":"_WYCZq","pb-lg-3":"_lOmpq","mb-lg-4":"_3f13Q","pb-lg-4":"_tfvEW","mb-lg-5":"_DxAtv","pb-lg-5":"_lN1KV","mb-lg-6":"_pEAAo","pb-lg-6":"_9pLfP","mb-lg-7":"_lZzWZ","pb-lg-7":"_E76Lg","mb-lg-8":"_Biywb","pb-lg-8":"_PKNGt","mb-lg-9":"_af7LP","pb-lg-9":"_769vF","mb-lg-10":"_p6W2n","pb-lg-10":"_44r6t","mx-lg-0":"_noonL","px-lg-0":"_g6n-m","mx-lg-1":"_V3fJC","px-lg-1":"_h-048","mx-lg-2":"_VBXFM","px-lg-2":"_yXjeI","mx-lg-3":"_anxPB","px-lg-3":"_umXxh","mx-lg-4":"_arYWt","px-lg-4":"_v21qY","mx-lg-5":"_VJrBv","px-lg-5":"_Wg7-s","mx-lg-6":"_qiDC7","px-lg-6":"_1VXpg","mx-lg-7":"_d0c15","px-lg-7":"_sfSeF","mx-lg-8":"_2gYLA","px-lg-8":"_DEL7d","mx-lg-9":"_KmU1j","px-lg-9":"_Qs2ud","mx-lg-10":"_cEBsK","px-lg-10":"_mQH7b","my-lg-0":"_ag2WO","py-lg-0":"_lnVBo","my-lg-1":"_xEHQX","py-lg-1":"_9Tj2M","my-lg-2":"_Iqbzp","py-lg-2":"_8tcVx","my-lg-3":"_caNHW","py-lg-3":"_XJ-2h","my-lg-4":"_6q91a","py-lg-4":"_EwkV-","my-lg-5":"_vAyw8","py-lg-5":"_5fbq2","my-lg-6":"_15LIk","py-lg-6":"_HIyvD","my-lg-7":"_kBk-L","py-lg-7":"_t5Eqq","my-lg-8":"_7QdOv","py-lg-8":"_mWXQT","my-lg-9":"_AgF1j","py-lg-9":"_Hw03a","my-lg-10":"_lgtEt","py-lg-10":"_VLUO-","m-md-0":"_bZzK1","p-md-0":"_hf1u1","m-md-1":"_D90hf","p-md-1":"_T8Wci","m-md-2":"_OV2C9","p-md-2":"_GFg-F","m-md-3":"_tOGww","p-md-3":"_p0NdJ","m-md-4":"_gUtm-","p-md-4":"_92JAP","m-md-5":"_V4DwP","p-md-5":"_KzYIR","m-md-6":"_RYzMI","p-md-6":"_bV-UI","m-md-7":"_bZ8rT","p-md-7":"_sz5lw","m-md-8":"_Tt85A","p-md-8":"_o9XsL","m-md-9":"_5Z2zG","p-md-9":"_QFUvw","m-md-10":"_o-CSv","p-md-10":"_I0UW7","ml-md-0":"_Ec-jt","pl-md-0":"_AsNUW","ml-md-1":"_FkvyK","pl-md-1":"_eWpHd","ml-md-2":"_C-N9j","pl-md-2":"_f4IXC","ml-md-3":"_i4rpE","pl-md-3":"_u1wxV","ml-md-4":"_bfpFB","pl-md-4":"_LFkDV","ml-md-5":"_ChenT","pl-md-5":"_Tseed","ml-md-6":"_5OVzE","pl-md-6":"_kKZuw","ml-md-7":"_HkEvd","pl-md-7":"_-UCQ1","ml-md-8":"_Mil4J","pl-md-8":"_ibj8N","ml-md-9":"_hZgvD","pl-md-9":"_x58o7","ml-md-10":"_aNTRb","pl-md-10":"_B9Ytk","mr-md-0":"_5fzNR","pr-md-0":"_UcmnK","mr-md-1":"_7GSVQ","pr-md-1":"_lKZ6y","mr-md-2":"_Vuc2l","pr-md-2":"_OWoeF","mr-md-3":"_GfGNW","pr-md-3":"_039xq","mr-md-4":"_XUUw7","pr-md-4":"_hNdK8","mr-md-5":"_PchvO","pr-md-5":"_YBTBv","mr-md-6":"_irZPz","pr-md-6":"_xez9v","mr-md-7":"_IWCJD","pr-md-7":"_Nymwz","mr-md-8":"_1ypEg","pr-md-8":"_hJvwk","mr-md-9":"_AisV-","pr-md-9":"_6jqua","mr-md-10":"_LdBUv","pr-md-10":"_Rhahl","mt-md-0":"_iI75A","pt-md-0":"_GCK2h","mt-md-1":"_QoRcE","pt-md-1":"_Q3gZh","mt-md-2":"_rzNrf","pt-md-2":"_mrtOR","mt-md-3":"_-Xx-x","pt-md-3":"_vhZY4","mt-md-4":"_Ie5M9","pt-md-4":"_Bv-Vz","mt-md-5":"_sC4OE","pt-md-5":"_sZzfz","mt-md-6":"_b8qW3","pt-md-6":"_sca5l","mt-md-7":"_Pn6m9","pt-md-7":"_9klOR","mt-md-8":"_oY4i-","pt-md-8":"_QpcKU","mt-md-9":"_-PssV","pt-md-9":"_IBITO","mt-md-10":"_hmDGa","pt-md-10":"_rPOnf","mb-md-0":"_KsSuI","pb-md-0":"_E01ZW","mb-md-1":"_mu8n4","pb-md-1":"_obt8N","mb-md-2":"_4uUmS","pb-md-2":"_eCQut","mb-md-3":"_gckFx","pb-md-3":"_v76WA","mb-md-4":"_HNG1G","pb-md-4":"_WF2cS","mb-md-5":"_y0d7f","pb-md-5":"_Ulg5o","mb-md-6":"_gGNca","pb-md-6":"_L6tTJ","mb-md-7":"_JFKoe","pb-md-7":"_cotbI","mb-md-8":"_zWuLC","pb-md-8":"_PZ98d","mb-md-9":"_0OLPw","pb-md-9":"_diSZ0","mb-md-10":"_tZv9r","pb-md-10":"_8DINx","mx-md-0":"_TlILw","px-md-0":"_nYb1A","mx-md-1":"_8F9Eu","px-md-1":"_zdtgY","mx-md-2":"_Hf2VU","px-md-2":"_R7ntT","mx-md-3":"_7koGZ","px-md-3":"_SjYZ0","mx-md-4":"_mfX1U","px-md-4":"_wpmO4","mx-md-5":"_yWbVN","px-md-5":"_c-PDJ","mx-md-6":"_F98A-","px-md-6":"_k2aB-","mx-md-7":"_PyjZi","px-md-7":"_1p7LO","mx-md-8":"_at5B-","px-md-8":"_Wlop7","mx-md-9":"_MP-IT","px-md-9":"_ZEJLn","mx-md-10":"_t-qxH","px-md-10":"_m2jcH","my-md-0":"_mamXD","py-md-0":"_XfnLL","my-md-1":"_wltQA","py-md-1":"_kMSov","my-md-2":"_PB9Lu","py-md-2":"_ZHQxJ","my-md-3":"_ROfrO","py-md-3":"_5pjW-","my-md-4":"_asOWk","py-md-4":"_521lJ","my-md-5":"_sfKXT","py-md-5":"_0hhLg","my-md-6":"_vBIkT","py-md-6":"_mh-mU","my-md-7":"_SbaIW","py-md-7":"_4U--m","my-md-8":"_8Ml4g","py-md-8":"_8CAbC","my-md-9":"_2W5Vi","py-md-9":"_ifVgs","my-md-10":"_jOwwL","py-md-10":"_xGEHg","m-xl-0":"_Cmi8h","p-xl-0":"_YOJnv","m-xl-1":"_IlYRc","p-xl-1":"_qg39r","m-xl-2":"_NZu1F","p-xl-2":"_ChCeZ","m-xl-3":"_wCJFO","p-xl-3":"_s5DXB","m-xl-4":"_-ooyS","p-xl-4":"_1rcFF","m-xl-5":"_2--cB","p-xl-5":"_0s8cD","m-xl-6":"_zMbs-","p-xl-6":"_qAR79","m-xl-7":"_sRWyz","p-xl-7":"_ykFCJ","m-xl-8":"_dj226","p-xl-8":"_XLB7-","m-xl-9":"_eM-R4","p-xl-9":"_QuQVl","m-xl-10":"_UUuwy","p-xl-10":"_nDqX9","ml-xl-0":"_LL8WU","pl-xl-0":"_AIPph","ml-xl-1":"_pKFo-","pl-xl-1":"_tQEXN","ml-xl-2":"_F-wn7","pl-xl-2":"_wcxv3","ml-xl-3":"_M94zg","pl-xl-3":"_I3KoK","ml-xl-4":"_0PzeG","pl-xl-4":"_lzci3","ml-xl-5":"_XRI4C","pl-xl-5":"_XlhyA","ml-xl-6":"_GjzL0","pl-xl-6":"_ASrOm","ml-xl-7":"_-0WjA","pl-xl-7":"_hx5P8","ml-xl-8":"_XlbUH","pl-xl-8":"_Vonli","ml-xl-9":"_LwuSL","pl-xl-9":"_MxuFJ","ml-xl-10":"_v7xZI","pl-xl-10":"_Tvo-Z","mr-xl-0":"_SzVWx","pr-xl-0":"_K1dhq","mr-xl-1":"_JOZtq","pr-xl-1":"_c1i37","mr-xl-2":"_R3B8Q","pr-xl-2":"_63cME","mr-xl-3":"_91LCJ","pr-xl-3":"_WxNaS","mr-xl-4":"_BauAg","pr-xl-4":"_V6rST","mr-xl-5":"_H0Uy4","pr-xl-5":"_idyBA","mr-xl-6":"_lIBS-","pr-xl-6":"_hm7f2","mr-xl-7":"_DcV1a","pr-xl-7":"_L9DAM","mr-xl-8":"_M62Cx","pr-xl-8":"_nso5O","mr-xl-9":"_M-vkg","pr-xl-9":"_Jm-de","mr-xl-10":"_V5v9Y","pr-xl-10":"_jt-a5","mt-xl-0":"_YPHmA","pt-xl-0":"_XVXEh","mt-xl-1":"_pJbYc","pt-xl-1":"_i-ZXc","mt-xl-2":"_SHsME","pt-xl-2":"_ak-Hh","mt-xl-3":"_wzbs7","pt-xl-3":"_py3lR","mt-xl-4":"_HBXKA","pt-xl-4":"_GQBlv","mt-xl-5":"_5d6Ee","pt-xl-5":"_KFPkO","mt-xl-6":"_Yf-yF","pt-xl-6":"_1e6oC","mt-xl-7":"_kg9lU","pt-xl-7":"_SHs7f","mt-xl-8":"_KXugL","pt-xl-8":"_VyRfA","mt-xl-9":"_EOyB7","pt-xl-9":"_5KMcS","mt-xl-10":"_8W-Zj","pt-xl-10":"_cz8iz","mb-xl-0":"_rWALs","pb-xl-0":"_LpkfT","mb-xl-1":"_RzmHQ","pb-xl-1":"_6ad54","mb-xl-2":"_Ajc4e","pb-xl-2":"_SbX8t","mb-xl-3":"_vSzzB","pb-xl-3":"_yidEJ","mb-xl-4":"_mrCP3","pb-xl-4":"_3TrW-","mb-xl-5":"_6j8-6","pb-xl-5":"_D1WrN","mb-xl-6":"_XDRU9","pb-xl-6":"_dcA8T","mb-xl-7":"_-i7kC","pb-xl-7":"_81QE4","mb-xl-8":"_X9-zp","pb-xl-8":"_HTClM","mb-xl-9":"_klb-D","pb-xl-9":"_RReN9","mb-xl-10":"_vPsb7","pb-xl-10":"_OVfeI","mx-xl-0":"_YNCB1","px-xl-0":"_hiVA4","mx-xl-1":"_k6kz-","px-xl-1":"_rONSC","mx-xl-2":"_pBneY","px-xl-2":"_po-3F","mx-xl-3":"_Bpbr7","px-xl-3":"_KdGyy","mx-xl-4":"_brh6E","px-xl-4":"_qqxT0","mx-xl-5":"_BfzzU","px-xl-5":"_R-Rw5","mx-xl-6":"_sSR5n","px-xl-6":"_thByS","mx-xl-7":"_r5nPW","px-xl-7":"_Qn6um","mx-xl-8":"_J9EDO","px-xl-8":"_9rkVI","mx-xl-9":"_Mltks","px-xl-9":"_g-Ham","mx-xl-10":"_sbya6","px-xl-10":"_8-jLj","my-xl-0":"_5yWBG","py-xl-0":"_xbHHG","my-xl-1":"_PlYBL","py-xl-1":"_F3Fon","my-xl-2":"_tsmUe","py-xl-2":"_a-0sQ","my-xl-3":"_sY3wJ","py-xl-3":"_iMcG-","my-xl-4":"_oHAzn","py-xl-4":"_SVfuw","my-xl-5":"_PvaIf","py-xl-5":"_J1xNt","my-xl-6":"_opQCd","py-xl-6":"_BykWn","my-xl-7":"_wYtgV","py-xl-7":"_rWN6g","my-xl-8":"_QHTpr","py-xl-8":"_6lwHD","my-xl-9":"_sKUSa","py-xl-9":"_HEg44","my-xl-10":"_mR1Ig","py-xl-10":"_-KK9e","background-shine":"_GS93D","path":"_Yio2J","line":"_hUBrW","skeleton":"_jhzCK","skeleton-animate":"_E3Vdv","skeleton-dark":"_wQ36Y","skeleton-dark-animate":"_j-rmG","skeleton-transparent":"_trTiX","skeleton-transparent-animate":"_4QQUW","semi-transparent":"_jW9cZ","disable":"_07-2N","full-width-on-tablets":"_at3Is","full-width-on-mobiles":"_7mVhH","xl":"_YBEjy","lg":"_4T1JY","md":"_y81Q7","sm":"_HlFvs","small-padding-on-small-mobiles":"_pC5i6","primary":"_rf33o","primary-bordered":"_bpdoC","primary-transparent":"_FNwOe","transparent":"_9LspZ","transparent-bordered":"_HgM7r","transparent-without-shadow":"_tkp-m","white":"_bv597","white-flat":"_IhewT","button-primary-dots-wrapper":"_OEKG8","show":"_MQYPo","button-success-icon":"_Y24W2","button-text":"_o-rLq","hide":"_4GC9-","button-with-icon":"_m1W6m","button-with-icon-text":"_75-fw","big-icon":"_gHcQi"};
|
|
1164
|
+
|
|
1165
|
+
var styles = {"container":"_a5RSj","m-0":"_wcoyj","p-0":"_Rd5sE","m-1":"_vAsxv","p-1":"_KZ14Z","m-2":"_Bvk20","p-2":"_Z7fhL","m-3":"_ZqDCi","p-3":"_CiGc9","m-4":"_8JK-L","p-4":"_FadoA","m-5":"_baCle","p-5":"_cvJqX","m-6":"_P3lUT","p-6":"_ZmGGH","m-7":"_5Tnff","p-7":"_-t7z9","m-8":"_1JxUQ","p-8":"_EATOh","m-9":"_pJGV0","p-9":"_B762d","m-10":"_Z3rGU","p-10":"_0ULM0","ml-0":"_ZSfG7","pl-0":"_hjKq0","ml-1":"_srwbU","pl-1":"_oz-sG","ml-2":"_RnILi","pl-2":"_-nAjZ","ml-3":"_lges5","pl-3":"_AwVsn","ml-4":"_p4arL","pl-4":"_upAfC","ml-5":"_-iEnG","pl-5":"_bqApa","ml-6":"_uF0xd","pl-6":"_WUUFo","ml-7":"_eXFZs","pl-7":"_ZforM","ml-8":"_2AA5o","pl-8":"_u6bF0","ml-9":"_19IxL","pl-9":"_vmLg6","ml-10":"_eyqFK","pl-10":"_mr36J","mr-0":"_6RpFz","pr-0":"_fgnzi","mr-1":"_fBjrA","pr-1":"_QrC2Y","mr-2":"_0Y6RC","pr-2":"_5kZkr","mr-3":"_iaZj-","pr-3":"_A-IQ7","mr-4":"_zBHHn","pr-4":"_pHQ4t","mr-5":"_1JTCi","pr-5":"_ODvHf","mr-6":"_n6Enr","pr-6":"_XNdBl","mr-7":"_YfaVy","pr-7":"_ZfZDh","mr-8":"_le3sp","pr-8":"_K1rvN","mr-9":"_mL6UV","pr-9":"_76mZn","mr-10":"_fo-sf","pr-10":"_xvsK1","mt-0":"_1uBdK","pt-0":"_30qg7","mt-1":"_NKlWd","pt-1":"_3yj99","mt-2":"_lLyiG","pt-2":"_GsXqc","mt-3":"_zC55o","pt-3":"_3OZTc","mt-4":"_v1VXO","pt-4":"_sFrdR","mt-5":"_qbBFx","pt-5":"_DQrF8","mt-6":"_dJG8P","pt-6":"_Zxte7","mt-7":"_sUtkp","pt-7":"_9B1r5","mt-8":"_Qrnld","pt-8":"_7xBV7","mt-9":"_OPKw2","pt-9":"_cXhnD","mt-10":"_m5k36","pt-10":"_b9nMR","mb-0":"_7AyaR","pb-0":"_u0vFs","mb-1":"_ivpnr","pb-1":"_1dkPf","mb-2":"_D8KfL","pb-2":"_wzuIB","mb-3":"_zwh5E","pb-3":"_rT8wS","mb-4":"_wpLh9","pb-4":"_AGvn8","mb-5":"_-phDB","pb-5":"_r4HWg","mb-6":"_RZI7I","pb-6":"_-t4Gs","mb-7":"_Vw-z1","pb-7":"_qwD1B","mb-8":"_f3nKh","pb-8":"_Sk1Fn","mb-9":"_2MDAw","pb-9":"_jZbwv","mb-10":"_gRDI3","pb-10":"_W7OVZ","mx-0":"_I6mmv","px-0":"_BVRG5","mx-1":"_b7fTJ","px-1":"_bZf6u","mx-2":"_FoGd8","px-2":"_-vX3t","mx-3":"_0H3Cj","loading-dots":"_pnWN9","big":"_k0j0g","dot":"_9LXS6","px-3":"_ggifM","mx-4":"_leP-v","px-4":"_7Kcun","mx-5":"_sBxud","px-5":"_oJO7X","mx-6":"_F-Una","px-6":"_Bl-A8","mx-7":"_NVWrT","px-7":"_Bn6vR","mx-8":"_OK9GD","px-8":"_iv1v2","mx-9":"_WVtLI","px-9":"_ntW3v","mx-10":"_21M1-","px-10":"_BjXo-","my-0":"_3v8p4","py-0":"_EBmV-","my-1":"_DcOh5","py-1":"_udCfN","my-2":"_Lk0RK","py-2":"_wIENK","my-3":"_nsOf5","py-3":"_No-oK","my-4":"_L1ycy","py-4":"_42DgQ","my-5":"_3bZSh","py-5":"_XjTMT","my-6":"_Ty-GG","py-6":"_7Dr5E","my-7":"_PILBF","py-7":"_vyvsk","my-8":"_AkmkO","py-8":"_X0xg-","my-9":"_VSxcf","py-9":"_Hq-yp","my-10":"_FxwFR","py-10":"_BnN2G","m-sm-0":"_EZHgz","p-sm-0":"_oKPqX","m-sm-1":"_gdysh","p-sm-1":"_-7KK8","m-sm-2":"_BLBqZ","p-sm-2":"_IgrmD","m-sm-3":"_zbrA7","p-sm-3":"_eimPJ","m-sm-4":"_7RaaP","p-sm-4":"_0-Cvi","m-sm-5":"_PhCOs","p-sm-5":"_CIKFA","m-sm-6":"_8WC3P","p-sm-6":"_2FqT5","m-sm-7":"_D7sDK","p-sm-7":"_L3EpN","m-sm-8":"_mG6-A","p-sm-8":"_D2Gx9","m-sm-9":"_2tGFi","p-sm-9":"_8n6VA","m-sm-10":"_G-MMA","p-sm-10":"_pgJzb","ml-sm-0":"_BF125","pl-sm-0":"_81k6q","ml-sm-1":"_JSywC","pl-sm-1":"_1eoeN","ml-sm-2":"_q5cSf","pl-sm-2":"_A6Li5","ml-sm-3":"_-7C1-","pl-sm-3":"_lBIcx","ml-sm-4":"_bvj1N","pl-sm-4":"_SQmLb","ml-sm-5":"_pwy33","pl-sm-5":"_iuqDu","ml-sm-6":"_CNiYb","pl-sm-6":"_tQ2J-","ml-sm-7":"_Zuec-","pl-sm-7":"_iJF5q","ml-sm-8":"_lP-ls","pl-sm-8":"_1xIwn","ml-sm-9":"_Jld-6","pl-sm-9":"_pfOVT","ml-sm-10":"_TGfAU","pl-sm-10":"_MYgNP","mr-sm-0":"_CEiPO","pr-sm-0":"_rZ5kD","mr-sm-1":"_-bdjz","pr-sm-1":"_nRBRL","mr-sm-2":"_17O3E","pr-sm-2":"_uBaUj","mr-sm-3":"_5oO1d","pr-sm-3":"_jQWXm","mr-sm-4":"_peO4Y","pr-sm-4":"_P2f3n","mr-sm-5":"_AUc3q","pr-sm-5":"_7TR99","mr-sm-6":"_e3d5h","pr-sm-6":"_QqPl1","mr-sm-7":"_Yc1cR","pr-sm-7":"_5fd5H","mr-sm-8":"_z4g3-","pr-sm-8":"_gY3T9","mr-sm-9":"_P9chP","pr-sm-9":"_G4k6A","mr-sm-10":"_QWMD2","pr-sm-10":"_2POWv","mt-sm-0":"_xYS0m","pt-sm-0":"_gYD3b","mt-sm-1":"_08rCY","pt-sm-1":"_UsP-z","mt-sm-2":"_HWQec","pt-sm-2":"_cjIgZ","mt-sm-3":"_gZV20","pt-sm-3":"_zJZJm","mt-sm-4":"_4FE5W","pt-sm-4":"_VpJhv","mt-sm-5":"_eu88H","pt-sm-5":"_V7qwC","mt-sm-6":"_09LyL","pt-sm-6":"_n8bba","mt-sm-7":"_q-ASs","pt-sm-7":"_3b9S8","mt-sm-8":"_iTxDv","pt-sm-8":"_--Hdk","mt-sm-9":"_OaVE-","pt-sm-9":"_cd-UP","mt-sm-10":"_ZIr-H","pt-sm-10":"_6jYkb","mb-sm-0":"_YgN23","pb-sm-0":"_F8F6A","mb-sm-1":"_4QH8u","pb-sm-1":"_A2I8v","mb-sm-2":"_jrZxh","pb-sm-2":"_2VL1m","mb-sm-3":"_IB8uX","pb-sm-3":"_meger","mb-sm-4":"_-gCVy","pb-sm-4":"_R-qMm","mb-sm-5":"_YwvXh","pb-sm-5":"_pyu5v","mb-sm-6":"_qwhTX","pb-sm-6":"_l61nc","mb-sm-7":"_0KfeR","pb-sm-7":"_YXuNM","mb-sm-8":"_75fJr","pb-sm-8":"_jp-Qe","mb-sm-9":"_V0wM-","pb-sm-9":"_vMKpc","mb-sm-10":"_sxEY8","pb-sm-10":"_k2mOD","mx-sm-0":"_qPF9i","px-sm-0":"_cl18e","mx-sm-1":"_LvMUO","px-sm-1":"_RcIbD","mx-sm-2":"_xLMK5","px-sm-2":"_GCL1S","mx-sm-3":"_t0q4o","px-sm-3":"_cuiW8","mx-sm-4":"_pHjdd","px-sm-4":"_LDu1N","mx-sm-5":"_cYpLd","px-sm-5":"_24Yji","mx-sm-6":"_pXCM6","px-sm-6":"_uoSDI","mx-sm-7":"_qbXoQ","px-sm-7":"_0RlFx","mx-sm-8":"_3f-s3","px-sm-8":"_xAS-y","mx-sm-9":"_vx3dZ","px-sm-9":"_ndXm6","mx-sm-10":"_6lFsZ","px-sm-10":"_EZ6Qr","my-sm-0":"_0t-Cg","py-sm-0":"_N3sbI","my-sm-1":"_jdmVi","py-sm-1":"_GlMKb","my-sm-2":"_yFRs8","py-sm-2":"_LNRZQ","my-sm-3":"_qSuwF","py-sm-3":"_ON3vd","my-sm-4":"_1h6pX","py-sm-4":"_TZg0h","my-sm-5":"_vT295","py-sm-5":"_J1zu8","my-sm-6":"_7LuwF","py-sm-6":"_qbbdP","my-sm-7":"_9vKuY","py-sm-7":"_C9gzg","my-sm-8":"_Nx1-S","py-sm-8":"_8lmEZ","my-sm-9":"_LxGxx","py-sm-9":"_3y4jy","my-sm-10":"_61y0C","py-sm-10":"_fxmBa","m-lg-0":"_PJydR","p-lg-0":"_3o1cd","m-lg-1":"_MAdi8","p-lg-1":"_JDc1V","m-lg-2":"_pEH2Q","p-lg-2":"_Ic9tL","m-lg-3":"_P6cGt","p-lg-3":"_nzx-g","m-lg-4":"_9bH-j","p-lg-4":"_KdZTF","m-lg-5":"_hxjaE","p-lg-5":"_LDamm","m-lg-6":"_xXtVI","p-lg-6":"_ZWhTL","m-lg-7":"_mPnVe","p-lg-7":"_lJnBT","m-lg-8":"_J-MQA","p-lg-8":"_MGs60","m-lg-9":"_ixlkP","p-lg-9":"_Lru1O","m-lg-10":"_eH6ht","p-lg-10":"_ugZzQ","ml-lg-0":"_6z3OE","pl-lg-0":"_PDwaH","ml-lg-1":"_GMcN9","pl-lg-1":"_NoDTB","ml-lg-2":"_PQ5AQ","pl-lg-2":"_8-Pu6","ml-lg-3":"_PktVo","pl-lg-3":"_JTpEZ","ml-lg-4":"_zIcyb","pl-lg-4":"_e4YYS","ml-lg-5":"_HrlcA","pl-lg-5":"_cwG3s","ml-lg-6":"_Xf7Wv","pl-lg-6":"_XYe-E","ml-lg-7":"_vnGAT","pl-lg-7":"_NnScU","ml-lg-8":"_9z7Tj","pl-lg-8":"_DDEn1","ml-lg-9":"_sxSQp","pl-lg-9":"_-r39c","ml-lg-10":"_kppNg","pl-lg-10":"_1mgTz","mr-lg-0":"_WtS6h","pr-lg-0":"_NKNU9","mr-lg-1":"_kxaOQ","pr-lg-1":"_8OvSK","mr-lg-2":"_bTQt8","pr-lg-2":"_yQerd","mr-lg-3":"_f7H9P","pr-lg-3":"_Kwfoa","mr-lg-4":"_lkF5d","pr-lg-4":"_b7tIe","mr-lg-5":"_H4e5a","pr-lg-5":"_pxwBt","mr-lg-6":"_I81Hq","pr-lg-6":"_1Xwlf","mr-lg-7":"_gtO-Y","pr-lg-7":"_vjm3Z","mr-lg-8":"_ZfEr1","pr-lg-8":"_je0MD","mr-lg-9":"_h43Co","pr-lg-9":"_Lnbh5","mr-lg-10":"_HoaFo","pr-lg-10":"_3puFA","mt-lg-0":"_a7pDC","pt-lg-0":"_-URo7","mt-lg-1":"_Ot-U1","pt-lg-1":"_rMvMf","mt-lg-2":"_95ooz","pt-lg-2":"_vkEgW","mt-lg-3":"_9XqX5","pt-lg-3":"_b-oGK","mt-lg-4":"_eYL6E","pt-lg-4":"_zgUGu","mt-lg-5":"_BqCaM","pt-lg-5":"_Y9PL4","mt-lg-6":"_0aOPb","pt-lg-6":"_nvMum","mt-lg-7":"_-pNQS","pt-lg-7":"_funa7","mt-lg-8":"_sDweY","pt-lg-8":"_S1hmu","mt-lg-9":"_Y4BpR","pt-lg-9":"_J3203","mt-lg-10":"_Jm-dV","pt-lg-10":"_0WSnk","mb-lg-0":"_4uWrE","pb-lg-0":"_qy0mb","mb-lg-1":"_jUNMm","pb-lg-1":"_pUTOt","mb-lg-2":"_aGqhb","pb-lg-2":"_xAKUw","mb-lg-3":"_kado5","pb-lg-3":"_htLgL","mb-lg-4":"_mWWU1","pb-lg-4":"_gqGWe","mb-lg-5":"_ceycQ","pb-lg-5":"_RzNIh","mb-lg-6":"_VLMG4","pb-lg-6":"_-8-Aj","mb-lg-7":"_HBnRW","pb-lg-7":"_ZsIEk","mb-lg-8":"_bj2r5","pb-lg-8":"_cBnkL","mb-lg-9":"_w3001","pb-lg-9":"_Kua-7","mb-lg-10":"_wZKsF","pb-lg-10":"_GX-Wb","mx-lg-0":"_-G50w","px-lg-0":"_OTPQl","mx-lg-1":"_JJ9DD","px-lg-1":"_jedSl","mx-lg-2":"_n9zl3","px-lg-2":"_Cg-Eq","mx-lg-3":"_6ZhL3","px-lg-3":"_0oPYT","mx-lg-4":"_H9sE1","px-lg-4":"_aV3U2","mx-lg-5":"_Y2BNn","px-lg-5":"_EzRHI","mx-lg-6":"_fp9jU","px-lg-6":"_wghWL","mx-lg-7":"_zB5Qv","px-lg-7":"_gclTH","mx-lg-8":"_Qxq2x","px-lg-8":"_M7akr","mx-lg-9":"_Vfhs-","px-lg-9":"_Rv7m-","mx-lg-10":"_lni3U","px-lg-10":"_gdVVu","my-lg-0":"_rMuza","py-lg-0":"_MZopi","my-lg-1":"_Thq10","py-lg-1":"_BXQnr","my-lg-2":"_lHRe-","py-lg-2":"_6MiWj","my-lg-3":"_-vobr","py-lg-3":"_xtsGY","my-lg-4":"_m2hen","py-lg-4":"_-069Y","my-lg-5":"_nTHzp","py-lg-5":"_r4pes","my-lg-6":"_LTkTV","py-lg-6":"_13TOF","my-lg-7":"_Em859","py-lg-7":"_mJzVF","my-lg-8":"_T8EVh","py-lg-8":"_h2ol5","my-lg-9":"_T-LZJ","py-lg-9":"_QIrnZ","my-lg-10":"_EY0q7","py-lg-10":"_hvU2E","m-md-0":"_u8Not","p-md-0":"_PVgyV","m-md-1":"_y-q4l","p-md-1":"_7X2x6","m-md-2":"_r3IGF","p-md-2":"_abaFH","m-md-3":"_rH0Ca","p-md-3":"_m-V0R","m-md-4":"_NQj-k","p-md-4":"_xjGzA","m-md-5":"_41oza","p-md-5":"_cgf0Z","m-md-6":"_lelHI","p-md-6":"_2C8Oa","m-md-7":"_w1Eil","p-md-7":"_EtEzw","m-md-8":"_Q8a3D","p-md-8":"_5nsxA","m-md-9":"_LzOqJ","p-md-9":"_7LEzr","m-md-10":"_CRNVR","p-md-10":"_ClNNV","ml-md-0":"_3abXz","pl-md-0":"_7BRiC","ml-md-1":"_Jbe0V","pl-md-1":"_Ok-KV","ml-md-2":"_5SO4-","pl-md-2":"_IvJ88","ml-md-3":"_NWLcP","pl-md-3":"_XASwl","ml-md-4":"_La-jA","pl-md-4":"_M8vz7","ml-md-5":"_4UZJ3","pl-md-5":"_ikRMN","ml-md-6":"_GpxKA","pl-md-6":"_-vp4I","ml-md-7":"_qZisY","pl-md-7":"_UspU5","ml-md-8":"_xTqIg","pl-md-8":"_8LLNG","ml-md-9":"_u3Wi6","pl-md-9":"_yukVA","ml-md-10":"_BJ3Kb","pl-md-10":"_Ncx33","mr-md-0":"_-dCKD","pr-md-0":"_p4Xdb","mr-md-1":"_DZXj3","pr-md-1":"_YZLPN","mr-md-2":"_IEATr","pr-md-2":"_OGWz-","mr-md-3":"_UxMFq","pr-md-3":"_qMmI8","mr-md-4":"_KEt4t","pr-md-4":"_nLevO","mr-md-5":"_AMVPM","pr-md-5":"_3m10o","mr-md-6":"_fzrrj","pr-md-6":"_Wbjjj","mr-md-7":"_mZWrU","pr-md-7":"_mqIEB","mr-md-8":"_5p3E5","pr-md-8":"_NyrXd","mr-md-9":"_gez8y","pr-md-9":"_qLaJ8","mr-md-10":"_TR-zd","pr-md-10":"_SqjX-","mt-md-0":"_Okpug","pt-md-0":"_xIGF1","mt-md-1":"_kkttT","pt-md-1":"_6Fntk","mt-md-2":"_jjt3V","pt-md-2":"_MBCLj","mt-md-3":"_AcRpn","pt-md-3":"_9e4N3","mt-md-4":"_TEYLB","pt-md-4":"_G-b2b","mt-md-5":"_ADYmJ","pt-md-5":"_-PW2W","mt-md-6":"_IiBSh","pt-md-6":"_oOMKv","mt-md-7":"_LzMKR","pt-md-7":"_P93Fk","mt-md-8":"_ZPChR","pt-md-8":"_IjZLd","mt-md-9":"_OYWyj","pt-md-9":"_6VDq-","mt-md-10":"_NFUMl","pt-md-10":"_9N5Rs","mb-md-0":"_KNEZM","pb-md-0":"_dlRtG","mb-md-1":"_2TJCJ","pb-md-1":"_FYJz-","mb-md-2":"_p5q4o","pb-md-2":"_W20R5","mb-md-3":"_QMtNI","pb-md-3":"_X4ghG","mb-md-4":"_ROsHu","pb-md-4":"_LLz3c","mb-md-5":"_FKlov","pb-md-5":"_qQje5","mb-md-6":"_zHdHt","pb-md-6":"_7vH68","mb-md-7":"_5-25V","pb-md-7":"_a5Jzs","mb-md-8":"_9NPzr","pb-md-8":"_NpZZI","mb-md-9":"_F5182","pb-md-9":"_2SM3y","mb-md-10":"_R3bvz","pb-md-10":"_Sop9H","mx-md-0":"_OUA4d","px-md-0":"_s-0Qy","mx-md-1":"_cBeVb","px-md-1":"_34ZBT","mx-md-2":"_-dnuU","px-md-2":"_0-UrT","mx-md-3":"_CewFh","px-md-3":"_ZrFGb","mx-md-4":"_5Cvub","px-md-4":"_9CpfN","mx-md-5":"_O1iRv","px-md-5":"_dnUx0","mx-md-6":"_QmgAB","px-md-6":"_vP8Uq","mx-md-7":"_PcZ9w","px-md-7":"_5l4s3","mx-md-8":"_isOXv","px-md-8":"_cvHBA","mx-md-9":"_LIRJ0","px-md-9":"_09Gju","mx-md-10":"_b-TCB","px-md-10":"_5UoX8","my-md-0":"_wrYvU","py-md-0":"_Fwd2A","my-md-1":"_vBwvs","py-md-1":"_vl1f-","my-md-2":"_7g5va","py-md-2":"_D0JS-","my-md-3":"_8DN0N","py-md-3":"_qvNWl","my-md-4":"_o5Mnp","py-md-4":"_rFfbU","my-md-5":"_7XZDH","py-md-5":"_1B0Rr","my-md-6":"_s09ut","py-md-6":"_jnQRw","my-md-7":"_PgL1b","py-md-7":"_T4779","my-md-8":"_R0d0D","py-md-8":"_Fkri-","my-md-9":"_FM-XK","py-md-9":"_H-snR","my-md-10":"_Z49JP","py-md-10":"_01G-F","m-xl-0":"_H4Jyh","p-xl-0":"_WMtq9","m-xl-1":"_FeJPz","p-xl-1":"_00t3r","m-xl-2":"_svLno","p-xl-2":"_2C22I","m-xl-3":"_T5qYA","p-xl-3":"_dcbn0","m-xl-4":"_Xl89-","p-xl-4":"_Ctf-y","m-xl-5":"_ZWihS","p-xl-5":"_Lzig2","m-xl-6":"_jljvY","p-xl-6":"_X1owU","m-xl-7":"_l1myf","p-xl-7":"_T1fTP","m-xl-8":"_FWU16","p-xl-8":"_R2T50","m-xl-9":"_2TtzQ","p-xl-9":"_-142y","m-xl-10":"_975wG","p-xl-10":"_DPori","ml-xl-0":"_9Zc9q","pl-xl-0":"_On2x0","ml-xl-1":"_IryvS","pl-xl-1":"_J2DXA","ml-xl-2":"_S7cyp","pl-xl-2":"_YxNk9","ml-xl-3":"_6eyqg","pl-xl-3":"_cwyGU","ml-xl-4":"_TbIDB","pl-xl-4":"_JKpl8","ml-xl-5":"_P17BD","pl-xl-5":"_w8ccI","ml-xl-6":"_fUJPM","pl-xl-6":"_mgqKZ","ml-xl-7":"_p-Fn9","pl-xl-7":"_eMF8n","ml-xl-8":"_VO2-y","pl-xl-8":"_O9n-E","ml-xl-9":"_wqX4W","pl-xl-9":"_wDG35","ml-xl-10":"_-TNE-","pl-xl-10":"_jyfgf","mr-xl-0":"_9aQeC","pr-xl-0":"_zWCV0","mr-xl-1":"_vL8LJ","pr-xl-1":"_yA6nk","mr-xl-2":"_ZkYxH","pr-xl-2":"_-LN7c","mr-xl-3":"_WtPxc","pr-xl-3":"_Yn0F0","mr-xl-4":"_M1pzN","pr-xl-4":"_zX1qM","mr-xl-5":"_HWX7s","pr-xl-5":"_0jJWY","mr-xl-6":"_cG-JL","pr-xl-6":"_o2-cg","mr-xl-7":"_g0V5o","pr-xl-7":"_seBWS","mr-xl-8":"_1Rg0L","pr-xl-8":"_uZxYI","mr-xl-9":"_DJD2r","pr-xl-9":"_WXY42","mr-xl-10":"_-EWpt","pr-xl-10":"_W-0Oq","mt-xl-0":"_A3mxM","pt-xl-0":"_mG8-q","mt-xl-1":"_eSV7Q","pt-xl-1":"_9SJkd","mt-xl-2":"_mdspA","pt-xl-2":"_GloWk","mt-xl-3":"_Fn9WR","pt-xl-3":"_l5z5Q","mt-xl-4":"_J5EuO","pt-xl-4":"_z4jGH","mt-xl-5":"_SjIc3","pt-xl-5":"_inlrN","mt-xl-6":"_9iy8O","pt-xl-6":"_FGdNq","mt-xl-7":"_DNLb-","pt-xl-7":"_FDvwW","mt-xl-8":"_cB8Ua","pt-xl-8":"_sFRzN","mt-xl-9":"_iFCES","pt-xl-9":"_M8U3T","mt-xl-10":"_zrBn9","pt-xl-10":"_kYhdD","mb-xl-0":"_AVjLW","pb-xl-0":"_S2OiP","mb-xl-1":"_vnN5p","pb-xl-1":"_ukgJ7","mb-xl-2":"_wZjwy","pb-xl-2":"_rINJ4","mb-xl-3":"_MFAs1","pb-xl-3":"_BjtEQ","mb-xl-4":"_72dvy","pb-xl-4":"_bCnbX","mb-xl-5":"_Uyt6r","pb-xl-5":"_F3Ibd","mb-xl-6":"_iBLUD","pb-xl-6":"_yjY5Y","mb-xl-7":"_6TfYx","pb-xl-7":"_QdVWm","mb-xl-8":"_p-cIL","pb-xl-8":"_saIeH","mb-xl-9":"_Z3PUh","pb-xl-9":"_f8cy7","mb-xl-10":"_ndw2F","pb-xl-10":"_Yxkus","mx-xl-0":"_Bb6PX","px-xl-0":"_M5EOJ","mx-xl-1":"_iWwKY","px-xl-1":"_nWXZF","mx-xl-2":"_OCB5d","px-xl-2":"_GIqDO","mx-xl-3":"_mskG2","px-xl-3":"_-TVSP","mx-xl-4":"_rp-dc","px-xl-4":"_rfQsy","mx-xl-5":"_FgYNJ","px-xl-5":"_yA-K0","mx-xl-6":"_KJ12G","px-xl-6":"_gmhRk","mx-xl-7":"_XF8NS","px-xl-7":"_C0zhm","mx-xl-8":"_rOBd5","px-xl-8":"_FZf4w","mx-xl-9":"_GosX1","px-xl-9":"_zvpad","mx-xl-10":"_uU6kY","px-xl-10":"_XfRJ5","my-xl-0":"_zhez-","py-xl-0":"_-Dum7","my-xl-1":"_QvfIQ","py-xl-1":"_66V5-","my-xl-2":"_e84Sk","py-xl-2":"_pOej1","my-xl-3":"_uv8an","py-xl-3":"_6iY-g","my-xl-4":"_Ur6W4","py-xl-4":"_JPq7T","my-xl-5":"_3GKlh","py-xl-5":"_Gcnsl","my-xl-6":"_JrBH1","py-xl-6":"_IP0ND","my-xl-7":"_7BzpU","py-xl-7":"_BIUqI","my-xl-8":"_mZ-p0","py-xl-8":"_Sdn5j","my-xl-9":"_P3V1N","py-xl-9":"_Z9lbF","my-xl-10":"_VAfcF","py-xl-10":"_X4Bq6","background-shine":"_361tW","path":"_qtb88","line":"_XQ9Yw","skeleton":"_BQ0X7","skeleton-animate":"_vEv3B","skeleton-dark":"_l5qsf","skeleton-dark-animate":"_yk159","skeleton-transparent":"_857E4","skeleton-transparent-animate":"_RzhIE","semi-transparent":"_LacS6","no-margins":"_bmB3S","dots":"_5kMd-","colored":"_-lTGD","small":"_GTU1q","extra-small":"_BEmi7","align-left":"_HuG6N","align-right":"_U3h5U"};
|
|
1166
|
+
|
|
1167
|
+
/**
|
|
1168
|
+
* LoadingDots Component - Displays a loading animation with dots.
|
|
1169
|
+
* This component allows customization of size, color, margins, and alignment.
|
|
1170
|
+
*
|
|
1171
|
+
* @component
|
|
1172
|
+
* @param {Object} props - The props of the component.
|
|
1173
|
+
* @param {('big'|'small'|'extra-small')} [props.size='small'] - Sets the size of the loading dots.
|
|
1174
|
+
* @param {boolean} [props.isColored=false] - If true, the dots will be colored, otherwise they will be monochrome.
|
|
1175
|
+
* @param {boolean} [props.noMargins=false] - If true, removes the margins around the loading dots.
|
|
1176
|
+
* @param {(boolean|'left'|'right')} [props.align=false] - Aligns the loading dots to the left or right if specified, otherwise centered.
|
|
1177
|
+
* @returns {React.ReactElement} A React component that renders the loading dots animation.
|
|
1178
|
+
*/
|
|
1179
|
+
var LoadingDots = function LoadingDots(_ref) {
|
|
1180
|
+
var _ref$size = _ref.size,
|
|
1181
|
+
size = _ref$size === void 0 ? "small" : _ref$size,
|
|
1182
|
+
_ref$isColored = _ref.isColored,
|
|
1183
|
+
isColored = _ref$isColored === void 0 ? false : _ref$isColored,
|
|
1184
|
+
_ref$noMargins = _ref.noMargins,
|
|
1185
|
+
noMargins = _ref$noMargins === void 0 ? false : _ref$noMargins,
|
|
1186
|
+
_ref$align = _ref.align,
|
|
1187
|
+
align = _ref$align === void 0 ? false : _ref$align;
|
|
1188
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
1189
|
+
className: styles["loading-dots"] + " " + styles[size] + " " + (noMargins ? " " + styles["no-margins"] : "") + " " + (align ? styles["align-" + align] : "")
|
|
1190
|
+
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
1191
|
+
className: styles.dot + " " + (isColored ? " " + styles.colored : "")
|
|
1192
|
+
}), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
1193
|
+
className: styles.dot + " " + (isColored ? " " + styles.colored : "")
|
|
1194
|
+
}), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
1195
|
+
className: styles.dot + " " + (isColored ? " " + styles.colored : "")
|
|
1196
|
+
}));
|
|
1197
|
+
};
|
|
1198
|
+
LoadingDots.propTypes = {
|
|
1199
|
+
size: PropTypes.oneOf(["big", "small", "extra-small"]),
|
|
1200
|
+
isColored: PropTypes.bool,
|
|
1201
|
+
noMargins: PropTypes.bool,
|
|
1202
|
+
align: PropTypes.oneOfType([PropTypes.oneOf(["left", "right"]), PropTypes.bool])
|
|
1203
|
+
};
|
|
1204
|
+
|
|
1205
|
+
/**
|
|
1206
|
+
* Button component - A versatile and customizable button for React applications.
|
|
1207
|
+
* It supports various sizes, styles, and functionalities, including loaders, icons, and handling of click events.
|
|
1208
|
+
* This component can also be used as a link if "to" is provided.
|
|
1209
|
+
*
|
|
1210
|
+
* @component
|
|
1211
|
+
* @param {Object} props
|
|
1212
|
+
* @param {('xl'|'lg'|'md'|'sm')} [props.size='xl'] - Sets the size of the button.
|
|
1213
|
+
* @param {string} [props.className=''] - An optional custom CSS class name for additional styling.
|
|
1214
|
+
* @param {string} [props.mode='transparent'] - Determines the button's visual style.
|
|
1215
|
+
* @param {Function} [props.onClick=(resetButtonLoader, event) => {}] - Callback function that triggers on button click.
|
|
1216
|
+
* @param {boolean} [props.loader=true] - If true, displays a loader animation on the button when clicked.
|
|
1217
|
+
* @param {boolean} [props.loading=false] - Controls the actual display of the loader if `loader` is true.
|
|
1218
|
+
* @param {string} [props.to=''] - The path for the button to act as a link.
|
|
1219
|
+
* @param {boolean} [props.fullWidthOnMobiles=false] - Expands the button to full width on mobiles.
|
|
1220
|
+
* @param {boolean} [props.fullWidthOnTablets=false] - Expands the button to full width on tablets.
|
|
1221
|
+
* @param {string} [props.icon=''] - The path to the button's icon.
|
|
1222
|
+
* @param {React.ReactNode} [props.content=''] - The text or content displayed inside the button.
|
|
1223
|
+
* @param {boolean} [props.isDisabled=false] - Disables the button if true.
|
|
1224
|
+
* @param {Function} [props.setClickTrigger=(p) => {}] - Function to programmatically trigger a button click.
|
|
1225
|
+
* @param {boolean} [props.isFormSubmittingButton=false] - If true, adds a hidden `<input type="submit">`.
|
|
1226
|
+
* @param {boolean} [props.bigIcon=false] - If true, displays a larger icon on the button.
|
|
1227
|
+
* @param {boolean} [props.checkmarkOnClick=false] - Shows a checkmark instead of content for a few seconds after click.
|
|
1228
|
+
* @param {boolean} [props.propagatePrimaryButtonClick=true] - Propagates the primary button click event if true.
|
|
1229
|
+
* @param {boolean} [props.smallPaddingOnSmallMobiles=false] - Enables smaller paddings for extra-small screen sizes.
|
|
1230
|
+
* @param {Function} [props.handleError=(func) => func()] - Function to handle errors during button click events.
|
|
1231
|
+
* @returns {React.ReactElement}
|
|
1232
|
+
*/
|
|
1233
|
+
var Button = function Button(_ref) {
|
|
1234
|
+
var _ref$size = _ref.size,
|
|
1235
|
+
size = _ref$size === void 0 ? "xl" : _ref$size,
|
|
1236
|
+
_ref$className = _ref.className,
|
|
1237
|
+
className = _ref$className === void 0 ? "" : _ref$className,
|
|
1238
|
+
_ref$mode = _ref.mode,
|
|
1239
|
+
mode = _ref$mode === void 0 ? "transparent" : _ref$mode,
|
|
1240
|
+
_ref$onClick = _ref.onClick,
|
|
1241
|
+
onClick = _ref$onClick === void 0 ? function (resetButtonLoader, event) {} : _ref$onClick,
|
|
1242
|
+
_ref$loader = _ref.loader,
|
|
1243
|
+
loader = _ref$loader === void 0 ? true : _ref$loader,
|
|
1244
|
+
_ref$loading = _ref.loading,
|
|
1245
|
+
loading = _ref$loading === void 0 ? false : _ref$loading,
|
|
1246
|
+
_ref$to = _ref.to,
|
|
1247
|
+
to = _ref$to === void 0 ? "" : _ref$to,
|
|
1248
|
+
_ref$fullWidthOnMobil = _ref.fullWidthOnMobiles,
|
|
1249
|
+
fullWidthOnMobiles = _ref$fullWidthOnMobil === void 0 ? false : _ref$fullWidthOnMobil,
|
|
1250
|
+
_ref$fullWidthOnTable = _ref.fullWidthOnTablets,
|
|
1251
|
+
fullWidthOnTablets = _ref$fullWidthOnTable === void 0 ? false : _ref$fullWidthOnTable,
|
|
1252
|
+
_ref$icon = _ref.icon,
|
|
1253
|
+
icon = _ref$icon === void 0 ? "" : _ref$icon,
|
|
1254
|
+
_ref$content = _ref.content,
|
|
1255
|
+
content = _ref$content === void 0 ? "" : _ref$content,
|
|
1256
|
+
_ref$isDisabled = _ref.isDisabled,
|
|
1257
|
+
isDisabled = _ref$isDisabled === void 0 ? false : _ref$isDisabled,
|
|
1258
|
+
_ref$setClickTrigger = _ref.setClickTrigger,
|
|
1259
|
+
setClickTrigger = _ref$setClickTrigger === void 0 ? function (p) {} : _ref$setClickTrigger,
|
|
1260
|
+
_ref$isFormSubmitting = _ref.isFormSubmittingButton,
|
|
1261
|
+
isFormSubmittingButton = _ref$isFormSubmitting === void 0 ? false : _ref$isFormSubmitting,
|
|
1262
|
+
_ref$bigIcon = _ref.bigIcon,
|
|
1263
|
+
bigIcon = _ref$bigIcon === void 0 ? false : _ref$bigIcon,
|
|
1264
|
+
_ref$checkmarkOnClick = _ref.checkmarkOnClick,
|
|
1265
|
+
checkmarkOnClick = _ref$checkmarkOnClick === void 0 ? false : _ref$checkmarkOnClick,
|
|
1266
|
+
_ref$propagatePrimary = _ref.propagatePrimaryButtonClick,
|
|
1267
|
+
propagatePrimaryButtonClick = _ref$propagatePrimary === void 0 ? true : _ref$propagatePrimary,
|
|
1268
|
+
_ref$smallPaddingOnSm = _ref.smallPaddingOnSmallMobiles,
|
|
1269
|
+
smallPaddingOnSmallMobiles = _ref$smallPaddingOnSm === void 0 ? false : _ref$smallPaddingOnSm,
|
|
1270
|
+
_ref$handleError = _ref.handleError,
|
|
1271
|
+
handleError = _ref$handleError === void 0 ? function (func, event) {
|
|
1272
|
+
return func(event);
|
|
1273
|
+
} : _ref$handleError;
|
|
1274
|
+
var _useState = React.useState(loading),
|
|
1275
|
+
isLoading = _useState[0],
|
|
1276
|
+
setIsLoading = _useState[1];
|
|
1277
|
+
var _useState2 = React.useState(false),
|
|
1278
|
+
isCheckShown = _useState2[0],
|
|
1279
|
+
setIsCheckShown = _useState2[1];
|
|
1280
|
+
var _useState3 = React.useState(null),
|
|
1281
|
+
event = _useState3[0],
|
|
1282
|
+
setEvent = _useState3[1];
|
|
1283
|
+
var buttonRef = React.useRef();
|
|
1284
|
+
React.useEffect(function () {
|
|
1285
|
+
setClickTrigger(function () {
|
|
1286
|
+
return buttonRef.current.click();
|
|
1287
|
+
});
|
|
1288
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1289
|
+
}, [buttonRef]);
|
|
1290
|
+
React.useEffect(function () {
|
|
1291
|
+
if (isLoading) {
|
|
1292
|
+
onClick(function () {
|
|
1293
|
+
return setIsLoading(false);
|
|
1294
|
+
}, event);
|
|
1295
|
+
}
|
|
1296
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1297
|
+
}, [isLoading]);
|
|
1298
|
+
var buttonClick = function buttonClick(e) {
|
|
1299
|
+
if (isLoading || isDisabled) {
|
|
1300
|
+
return false;
|
|
1301
|
+
}
|
|
1302
|
+
if (checkmarkOnClick && !isCheckShown && !loader && !loading) {
|
|
1303
|
+
setIsCheckShown(true);
|
|
1304
|
+
setTimeout(function () {
|
|
1305
|
+
setIsCheckShown(false);
|
|
1306
|
+
}, 2000);
|
|
1307
|
+
}
|
|
1308
|
+
e.persist(); // Persisting React's SyntheticEvent to be able to use it in any async context
|
|
1309
|
+
!propagatePrimaryButtonClick && e.stopPropagation();
|
|
1310
|
+
if (loader) {
|
|
1311
|
+
setIsLoading(true);
|
|
1312
|
+
setEvent(e);
|
|
1313
|
+
} else {
|
|
1314
|
+
onClick(function () {
|
|
1315
|
+
return setIsLoading(false);
|
|
1316
|
+
}, e);
|
|
1317
|
+
}
|
|
1318
|
+
};
|
|
1319
|
+
var classNames = styles$1.button + " " + styles$1[size] + " " + styles$1[className] + " " + styles$1[mode] + (fullWidthOnMobiles ? " " + styles$1["full-width-on-mobiles"] : "") + (fullWidthOnTablets ? " " + styles$1["full-width-on-tablets"] : "") + (isDisabled ? " " + styles$1.disable : "") + (smallPaddingOnSmallMobiles ? " " + styles$1["small-padding-on-small-mobiles"] : "");
|
|
1320
|
+
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, isFormSubmittingButton ? /*#__PURE__*/React__default["default"].createElement("input", {
|
|
1321
|
+
type: "submit",
|
|
1322
|
+
hidden: true
|
|
1323
|
+
}) : null, to ? /*#__PURE__*/React__default["default"].createElement("a", {
|
|
1324
|
+
className: classNames,
|
|
1325
|
+
onClick: function onClick(e) {
|
|
1326
|
+
return handleError(buttonClick, e);
|
|
1327
|
+
},
|
|
1328
|
+
href: to,
|
|
1329
|
+
ref: buttonRef
|
|
1330
|
+
}, icon ? /*#__PURE__*/React__default["default"].createElement("div", {
|
|
1331
|
+
className: styles$1["button-with-icon"] + (bigIcon ? " " + styles$1["big-icon"] : "")
|
|
1332
|
+
}, /*#__PURE__*/React__default["default"].createElement("img", {
|
|
1333
|
+
src: icon,
|
|
1334
|
+
alt: "button icon"
|
|
1335
|
+
}), /*#__PURE__*/React__default["default"].createElement("span", {
|
|
1336
|
+
className: styles$1["button-with-icon-text"]
|
|
1337
|
+
}, content)) : content) : /*#__PURE__*/React__default["default"].createElement("div", {
|
|
1338
|
+
className: classNames,
|
|
1339
|
+
onClick: function onClick(e) {
|
|
1340
|
+
return handleError(buttonClick, e);
|
|
1341
|
+
},
|
|
1342
|
+
ref: buttonRef
|
|
1343
|
+
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
1344
|
+
className: styles$1["button-primary-dots-wrapper"] + " " + (isLoading && loader ? styles$1.show : "")
|
|
1345
|
+
}, loader && isLoading ? /*#__PURE__*/React__default["default"].createElement(LoadingDots, {
|
|
1346
|
+
isColored: mode === "white"
|
|
1347
|
+
}) : null), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
1348
|
+
className: styles$1["button-success-icon"] + " " + styles$1[mode] + " " + (isCheckShown ? styles$1["show"] : "")
|
|
1349
|
+
}), icon ? /*#__PURE__*/React__default["default"].createElement("div", {
|
|
1350
|
+
className: styles$1["button-with-icon"] + " " + (isLoading && loader || checkmarkOnClick && isCheckShown ? styles$1["hide"] : "") + " " + (bigIcon ? styles$1["big-icon"] : "")
|
|
1351
|
+
}, /*#__PURE__*/React__default["default"].createElement("img", {
|
|
1352
|
+
src: icon,
|
|
1353
|
+
alt: "button icon"
|
|
1354
|
+
}), /*#__PURE__*/React__default["default"].createElement("span", {
|
|
1355
|
+
className: styles$1["button-with-icon-text"]
|
|
1356
|
+
}, content)) : /*#__PURE__*/React__default["default"].createElement("span", {
|
|
1357
|
+
className: styles$1["button-text"] + " " + (isLoading && loader || checkmarkOnClick && isCheckShown ? styles$1["hide"] : "")
|
|
1358
|
+
}, content)));
|
|
1359
|
+
};
|
|
1360
|
+
Button.propTypes = {
|
|
1361
|
+
size: PropTypes.oneOf(["xl", "lg", "md", "sm"]),
|
|
1362
|
+
className: PropTypes.string,
|
|
1363
|
+
mode: PropTypes.oneOf(["transparent", "white", "white-flat", "primary", "primary-bordered", "primary-transparent", "transparent-bordered", "transparent-without-shadow"]),
|
|
1364
|
+
onClick: PropTypes.func,
|
|
1365
|
+
loader: PropTypes.bool,
|
|
1366
|
+
loading: PropTypes.bool,
|
|
1367
|
+
to: PropTypes.string,
|
|
1368
|
+
fullWidthOnMobiles: PropTypes.bool,
|
|
1369
|
+
fullWidthOnTablets: PropTypes.bool,
|
|
1370
|
+
icon: PropTypes.string,
|
|
1371
|
+
content: PropTypes.node,
|
|
1372
|
+
isDisabled: PropTypes.bool,
|
|
1373
|
+
setClickTrigger: PropTypes.func,
|
|
1374
|
+
isFormSubmittingButton: PropTypes.bool,
|
|
1375
|
+
bigIcon: PropTypes.bool,
|
|
1376
|
+
checkmarkOnClick: PropTypes.bool,
|
|
1377
|
+
propagatePrimaryButtonClick: PropTypes.bool,
|
|
1378
|
+
smallPaddingOnSmallMobiles: PropTypes.bool,
|
|
1379
|
+
handleError: PropTypes.func
|
|
1380
|
+
};
|
|
1381
|
+
Button.defaultProps = {
|
|
1382
|
+
size: "xl",
|
|
1383
|
+
className: "",
|
|
1384
|
+
mode: "transparent",
|
|
1385
|
+
onClick: function onClick(resetButtonLoader, event) {},
|
|
1386
|
+
loader: true,
|
|
1387
|
+
loading: false,
|
|
1388
|
+
to: "",
|
|
1389
|
+
fullWidthOnMobiles: false,
|
|
1390
|
+
fullWidthOnTablets: false,
|
|
1391
|
+
icon: "",
|
|
1392
|
+
content: "",
|
|
1393
|
+
isDisabled: false,
|
|
1394
|
+
setClickTrigger: function setClickTrigger(p) {},
|
|
1395
|
+
isFormSubmittingButton: false,
|
|
1396
|
+
bigIcon: false,
|
|
1397
|
+
checkmarkOnClick: false,
|
|
1398
|
+
propagatePrimaryButtonClick: true,
|
|
1399
|
+
smallPaddingOnSmallMobiles: false,
|
|
1400
|
+
handleError: function handleError(func) {
|
|
1401
|
+
return func();
|
|
1402
|
+
}
|
|
1403
|
+
};
|
|
1404
|
+
|
|
1405
|
+
var SupportChat = function SupportChat(_ref) {
|
|
1406
|
+
var url = _ref.url,
|
|
1407
|
+
websiteToken = _ref.websiteToken,
|
|
1408
|
+
_ref$welcomeMessage = _ref.welcomeMessage,
|
|
1409
|
+
welcomeMessage = _ref$welcomeMessage === void 0 ? "" : _ref$welcomeMessage;
|
|
1410
|
+
React.useEffect(function () {
|
|
1411
|
+
window.chatwootSettings = {
|
|
1412
|
+
position: "right",
|
|
1413
|
+
type: "standard",
|
|
1414
|
+
launcherTitle: welcomeMessage
|
|
1415
|
+
};
|
|
1416
|
+
(function (d, t) {
|
|
1417
|
+
var BASE_URL = url;
|
|
1418
|
+
var g = d.createElement(t),
|
|
1419
|
+
s = d.getElementsByTagName(t)[0];
|
|
1420
|
+
g.src = BASE_URL + "/packs/js/sdk.js";
|
|
1421
|
+
g.defer = true;
|
|
1422
|
+
g.async = true;
|
|
1423
|
+
s.parentNode.insertBefore(g, s);
|
|
1424
|
+
g.onload = function () {
|
|
1425
|
+
window.chatwootSDK.run({
|
|
1426
|
+
websiteToken: websiteToken,
|
|
1427
|
+
baseUrl: BASE_URL
|
|
1428
|
+
});
|
|
1429
|
+
};
|
|
1430
|
+
})(document, "script");
|
|
1431
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1432
|
+
}, []);
|
|
1433
|
+
return null;
|
|
1434
|
+
};
|
|
1435
|
+
SupportChat.propTypes = {
|
|
1436
|
+
url: PropTypes.string.isRequired,
|
|
1437
|
+
websiteToken: PropTypes.string.isRequired,
|
|
1438
|
+
welcomeMessage: PropTypes.string
|
|
1439
|
+
};
|
|
1440
|
+
SupportChat.defaultProps = {
|
|
1441
|
+
welcomeMessage: ""
|
|
1442
|
+
};
|
|
1443
|
+
|
|
1444
|
+
var s = {"container":"_DYS-g","m-0":"_85R9d","p-0":"_wi0-U","m-1":"_YoewO","p-1":"_vuJBW","m-2":"_ruaYI","p-2":"_dO-cg","m-3":"_3Oh59","p-3":"_x4uSr","m-4":"_zN8us","p-4":"_rjv4I","m-5":"_5T1F-","p-5":"_-nWHT","m-6":"_Skgdf","p-6":"_Oux4z","m-7":"_yKPSq","p-7":"_sOsqF","m-8":"_8EoDT","p-8":"_G4M7b","m-9":"_ZZJBC","p-9":"_2PU3N","m-10":"_XRmXO","p-10":"_lhLN8","ml-0":"_SIynD","pl-0":"_VCLgc","ml-1":"_9vhMT","pl-1":"_4O5ig","ml-2":"_f1saV","pl-2":"_sHxk9","ml-3":"_kiltH","pl-3":"_jUw5Z","ml-4":"_CF1wj","pl-4":"_eXCZ1","ml-5":"_HZlH9","pl-5":"_6xbwv","ml-6":"_jNpyz","pl-6":"_k5lHk","ml-7":"_LgB9F","pl-7":"_ol9Tb","ml-8":"_I25tR","pl-8":"_TN4dc","ml-9":"_ywWxC","pl-9":"_4UsSQ","ml-10":"_9rfct","pl-10":"_LoViP","mr-0":"_-1PzO","pr-0":"_Ekco3","mr-1":"_EfRd0","pr-1":"_GspC-","mr-2":"_91QSK","pr-2":"_dU7Vb","mr-3":"_tW92i","pr-3":"_qNnnG","mr-4":"_XC1FW","pr-4":"_09RVw","mr-5":"_I4KRh","pr-5":"_eag2b","mr-6":"_E-KDc","pr-6":"_0d7JN","mr-7":"_9GUd-","pr-7":"_5Jseh","mr-8":"_Z-z3u","pr-8":"_rjPRa","mr-9":"_R2d68","pr-9":"_YI-lc","mr-10":"_ORX-B","pr-10":"_F5ib8","mt-0":"_OAl4b","pt-0":"_iJ5QU","mt-1":"_x72-c","pt-1":"_DGuKS","mt-2":"_ZYCC4","pt-2":"_6oj3E","mt-3":"_ADXHX","pt-3":"_asJoO","mt-4":"_Bz8Hu","pt-4":"_N7CCb","mt-5":"_OyQQ8","pt-5":"_C46Cf","mt-6":"_Bfrcj","pt-6":"_NN4sF","mt-7":"_RWFV0","pt-7":"_zUauA","mt-8":"_v7txm","pt-8":"_qgvMl","mt-9":"_9s32w","pt-9":"_aJZt7","mt-10":"_feBhr","pt-10":"_EfI4E","mb-0":"_RUzt9","pb-0":"_0Zjn8","mb-1":"_EmcPj","pb-1":"_zuqTv","mb-2":"_jYcdG","pb-2":"_fjMa6","mb-3":"_Lcgzu","pb-3":"_MHHa3","mb-4":"_Aoo0-","pb-4":"_B1ap3","mb-5":"_xdjCc","pb-5":"_lnrC3","mb-6":"_TFmkS","pb-6":"_YNj2R","mb-7":"_i0-JZ","pb-7":"_qSvSL","mb-8":"_7ziqB","pb-8":"_W-Cdi","mb-9":"_lUUVq","pb-9":"_LrgoL","mb-10":"_xX8mu","pb-10":"_DU6C6","mx-0":"_71D1Q","px-0":"_U8dyv","mx-1":"_2VhDN","px-1":"_d8Tlo","mx-2":"_uDkn4","px-2":"_a6Z6h","mx-3":"_W9yqm","px-3":"_MCbca","mx-4":"_sIDVk","px-4":"_wZ8Qz","mx-5":"_-6tEi","px-5":"_8vfpL","mx-6":"_mbXa9","px-6":"_LcSh5","mx-7":"_mF9-c","px-7":"_TfjhQ","mx-8":"_RG7wu","px-8":"_19Sdb","mx-9":"_JkKgx","px-9":"_Ir3LH","mx-10":"_70tWA","px-10":"_d1BrW","my-0":"_0PauS","py-0":"_FP0FE","my-1":"_znn6s","py-1":"_-FHoU","my-2":"_EqZco","py-2":"_fuTfe","my-3":"_D2LQ5","py-3":"_YWhnK","my-4":"_kCXTL","py-4":"_j1vj6","my-5":"_naEoR","py-5":"_QK3Z-","my-6":"_L1TOy","py-6":"_dQH-e","my-7":"_sVZ3Y","py-7":"_Fi779","my-8":"_1mAkX","py-8":"_yTTVv","my-9":"_jCeMV","py-9":"_qfn2C","my-10":"_eqneu","py-10":"_Atu-j","m-sm-0":"_hsKWE","p-sm-0":"_j3m-2","m-sm-1":"_NQOee","p-sm-1":"_sB5mJ","m-sm-2":"_KivoH","p-sm-2":"_YjE2j","m-sm-3":"_kObhZ","p-sm-3":"_TDlKW","m-sm-4":"_aJWH3","p-sm-4":"_Vntgp","m-sm-5":"_k-Hjs","p-sm-5":"_mJt7k","m-sm-6":"_Yxxob","p-sm-6":"_E5a-A","m-sm-7":"_M1OJO","p-sm-7":"_-5OJr","m-sm-8":"_UYrWD","p-sm-8":"_FJeV6","m-sm-9":"_DosWW","p-sm-9":"_T9yES","m-sm-10":"_tLYqH","p-sm-10":"_5dbE7","ml-sm-0":"_PM9wP","pl-sm-0":"_0Eoi7","ml-sm-1":"_Mb-hF","pl-sm-1":"_n4rCF","ml-sm-2":"_JJgiX","pl-sm-2":"_WOdAR","ml-sm-3":"_umhPB","pl-sm-3":"_tETqx","ml-sm-4":"_PQ088","pl-sm-4":"_ON2pV","ml-sm-5":"_IrMTT","pl-sm-5":"_12IZU","ml-sm-6":"_s8vHJ","pl-sm-6":"_9Od-S","ml-sm-7":"_4uuhE","pl-sm-7":"_TTrnJ","ml-sm-8":"_6TEO5","pl-sm-8":"_ZEPSH","ml-sm-9":"_I05iS","pl-sm-9":"_F5rHi","ml-sm-10":"_AJZ2R","pl-sm-10":"_zgudu","mr-sm-0":"_AD7v0","pr-sm-0":"_katlS","mr-sm-1":"_RMNwS","pr-sm-1":"_SC0VS","mr-sm-2":"_YFbee","pr-sm-2":"_I2cqm","mr-sm-3":"_KJzfk","pr-sm-3":"_aDNge","mr-sm-4":"_ERg9u","pr-sm-4":"_wlgHy","mr-sm-5":"_spxY0","pr-sm-5":"_pAEEu","mr-sm-6":"_HM7Z6","pr-sm-6":"_rf9My","mr-sm-7":"_b-V6W","pr-sm-7":"_YFXWV","mr-sm-8":"_96NiE","pr-sm-8":"_0ynKz","mr-sm-9":"_9NqL0","pr-sm-9":"_ZEN2v","mr-sm-10":"_oxmC7","pr-sm-10":"_AsAlz","mt-sm-0":"_Yl8e7","pt-sm-0":"_fkSmd","mt-sm-1":"_l4X69","pt-sm-1":"_i7WdP","mt-sm-2":"_ggYWK","pt-sm-2":"_3-z2g","mt-sm-3":"_IzZ-y","pt-sm-3":"_c3PEq","mt-sm-4":"_BbTvo","pt-sm-4":"_iAXVy","mt-sm-5":"_RNscW","pt-sm-5":"_7dHkj","mt-sm-6":"_iKCRS","pt-sm-6":"_an673","mt-sm-7":"_1Atcr","pt-sm-7":"_KA-HC","mt-sm-8":"_45ifh","pt-sm-8":"_26wBi","mt-sm-9":"_VaqUk","pt-sm-9":"_cx10Q","mt-sm-10":"_83RI-","pt-sm-10":"_vTZq7","mb-sm-0":"_IDhal","pb-sm-0":"_3IjzN","mb-sm-1":"_sjxoK","pb-sm-1":"_fmWwG","mb-sm-2":"_GNlxw","pb-sm-2":"_r3zJV","mb-sm-3":"_FFWRt","pb-sm-3":"_arvvr","mb-sm-4":"_qaIKp","pb-sm-4":"_wSca9","mb-sm-5":"_-cXAZ","pb-sm-5":"_grIUD","mb-sm-6":"_PUPyR","pb-sm-6":"_nA8VL","mb-sm-7":"_t7JYD","pb-sm-7":"_OpbJn","mb-sm-8":"_x1wdN","pb-sm-8":"_3Z-mA","mb-sm-9":"_BPrSY","pb-sm-9":"_b-NQ7","mb-sm-10":"_lSN9Q","pb-sm-10":"_E7xwy","mx-sm-0":"_-cSXk","px-sm-0":"_VlISI","mx-sm-1":"_6derN","px-sm-1":"_in01f","mx-sm-2":"_nskhZ","px-sm-2":"_Thnqg","mx-sm-3":"_xR8rV","px-sm-3":"_zUOaf","mx-sm-4":"_0c-bw","px-sm-4":"_X-g0R","mx-sm-5":"_p3iVv","px-sm-5":"_RdgSR","mx-sm-6":"_vK8xL","px-sm-6":"_xGpLP","mx-sm-7":"_uvb2q","px-sm-7":"_YvDjG","mx-sm-8":"_8nvEy","px-sm-8":"_L3gRg","mx-sm-9":"_pRh4Y","px-sm-9":"_5yig0","mx-sm-10":"_syXdz","px-sm-10":"_TfV9e","my-sm-0":"_WXfoP","py-sm-0":"_SBx-N","my-sm-1":"_dPEq6","py-sm-1":"_UrxQl","my-sm-2":"_ULvTZ","py-sm-2":"_I4Sll","my-sm-3":"_YVvfW","py-sm-3":"_9qflx","my-sm-4":"_j4ltv","py-sm-4":"_u-NN2","my-sm-5":"_mC1LQ","py-sm-5":"_6Wcc2","my-sm-6":"_eE8rw","py-sm-6":"_AeFpW","my-sm-7":"_CAnzA","py-sm-7":"_7h-Vs","my-sm-8":"_Z9Aft","py-sm-8":"_Ww8LU","my-sm-9":"_3sbBd","py-sm-9":"_ZcdCh","my-sm-10":"_PGBDh","py-sm-10":"_i6Fc2","m-lg-0":"_PkOb8","p-lg-0":"_3UpkE","m-lg-1":"_nCbz9","p-lg-1":"_1lThO","m-lg-2":"_ARtYq","p-lg-2":"_vHeBX","m-lg-3":"_cpKBp","p-lg-3":"_n-7p1","m-lg-4":"_1bWgj","p-lg-4":"_niPSW","m-lg-5":"_T9s09","p-lg-5":"_OS1Yy","m-lg-6":"_GvZeA","p-lg-6":"_8cgsA","m-lg-7":"_d0oC7","p-lg-7":"_TuBYJ","m-lg-8":"_slAc2","p-lg-8":"_ay3FH","m-lg-9":"_r3-kR","p-lg-9":"_IuC-U","m-lg-10":"_9P6I9","p-lg-10":"_RUR7-","ml-lg-0":"_xf3wx","pl-lg-0":"_Q-8ZY","ml-lg-1":"_4tg9Q","pl-lg-1":"_2rsuI","ml-lg-2":"_-YU8G","pl-lg-2":"_Eds1N","ml-lg-3":"_tD4RQ","pl-lg-3":"_R0Rk2","ml-lg-4":"_pZcNJ","pl-lg-4":"_5jvIR","ml-lg-5":"_sjk-4","pl-lg-5":"_RwLHv","ml-lg-6":"_dyXyT","pl-lg-6":"_nVLAC","ml-lg-7":"_FPuf8","pl-lg-7":"_M5bYC","ml-lg-8":"_Uet9k","pl-lg-8":"_UrAQv","ml-lg-9":"_VPraG","pl-lg-9":"_8HJkV","ml-lg-10":"_ILHbQ","pl-lg-10":"_QaxaT","mr-lg-0":"_2QrJI","pr-lg-0":"_0XJPD","mr-lg-1":"_qSATY","pr-lg-1":"_fzyzB","mr-lg-2":"_pY4IE","pr-lg-2":"_lc7Gu","mr-lg-3":"_KeRuW","pr-lg-3":"_zc2cu","mr-lg-4":"_RvxVY","pr-lg-4":"_v5XDn","mr-lg-5":"_Kipoo","pr-lg-5":"_K-vHR","mr-lg-6":"_1nl-K","pr-lg-6":"_nVUH-","mr-lg-7":"_M1Ue1","pr-lg-7":"_B75ua","mr-lg-8":"_CmlKz","pr-lg-8":"_FnY12","mr-lg-9":"_8-uRA","pr-lg-9":"_1DG22","mr-lg-10":"_vzMQh","pr-lg-10":"_2iqul","mt-lg-0":"_1eCp-","pt-lg-0":"_ucRUw","mt-lg-1":"_9YQ4e","pt-lg-1":"_pzmV0","mt-lg-2":"_1Z7OF","pt-lg-2":"_FUFhX","mt-lg-3":"_HPI-W","pt-lg-3":"_NwVgV","mt-lg-4":"_duZYq","pt-lg-4":"_h0NfP","mt-lg-5":"_sszGU","pt-lg-5":"_nNi-i","mt-lg-6":"_YYWl4","pt-lg-6":"_rqDrl","mt-lg-7":"_MmkeY","pt-lg-7":"_TZx0T","mt-lg-8":"_mdoth","pt-lg-8":"_2pGPR","mt-lg-9":"_csumg","pt-lg-9":"_BIWSR","mt-lg-10":"_TN07y","pt-lg-10":"_ojQGh","mb-lg-0":"_eXETo","pb-lg-0":"_FeL5F","mb-lg-1":"_Zc1bw","pb-lg-1":"_34sNS","mb-lg-2":"_2XgD-","pb-lg-2":"_OTB4o","mb-lg-3":"_xJ4EC","pb-lg-3":"_-Uc7P","mb-lg-4":"_thqbO","pb-lg-4":"_lqHuw","mb-lg-5":"_gDmAe","pb-lg-5":"_zAiLu","mb-lg-6":"_96HP2","pb-lg-6":"_TCehU","mb-lg-7":"_1Guas","pb-lg-7":"_vn7-Z","mb-lg-8":"_Cc-m8","pb-lg-8":"_dbCuX","mb-lg-9":"_U5Qon","pb-lg-9":"_b54cM","mb-lg-10":"_cGYyA","pb-lg-10":"_U5qus","mx-lg-0":"_TDPp0","px-lg-0":"_hUlWn","mx-lg-1":"_uh5DO","px-lg-1":"_N8r0e","mx-lg-2":"_vsfWJ","px-lg-2":"_LaBP6","mx-lg-3":"_JxquV","px-lg-3":"_Tb8mk","mx-lg-4":"_wDKd1","px-lg-4":"_lIguL","mx-lg-5":"_RSd-x","px-lg-5":"_Mdf1f","mx-lg-6":"_uvK2D","px-lg-6":"_4k20p","mx-lg-7":"_iXTh7","px-lg-7":"_W2faz","mx-lg-8":"_HHM9t","px-lg-8":"_n54Rq","mx-lg-9":"_douwI","px-lg-9":"_KWSHJ","mx-lg-10":"_L-r4v","px-lg-10":"_qeSLU","my-lg-0":"_U9qcF","py-lg-0":"_sSD4U","my-lg-1":"_vNl2c","py-lg-1":"_Cfkag","my-lg-2":"_gVDuB","py-lg-2":"_FwQsB","my-lg-3":"_oiJaa","py-lg-3":"_FASGS","my-lg-4":"_va2Tm","py-lg-4":"_EPTkJ","my-lg-5":"_jvYOP","py-lg-5":"_NTxiG","my-lg-6":"_8Y7Xj","py-lg-6":"_Nrsd7","my-lg-7":"_-e9e5","py-lg-7":"_NOh2l","my-lg-8":"_nyCDl","py-lg-8":"_fpL5p","my-lg-9":"_BbcqH","py-lg-9":"_VlI3L","my-lg-10":"_OGNmd","py-lg-10":"_Q-3bw","m-md-0":"_P6WIc","p-md-0":"_3YuAI","m-md-1":"_VwK3z","p-md-1":"_ArFsR","m-md-2":"_5Hp7o","p-md-2":"_-R4rJ","m-md-3":"_J55VC","p-md-3":"_TxlAj","m-md-4":"_FHPQG","p-md-4":"_iZW10","m-md-5":"_Kiuiv","p-md-5":"_0Qiry","m-md-6":"_Ja9dp","p-md-6":"_GBAS-","m-md-7":"_uuE4u","p-md-7":"_kAuu-","m-md-8":"_CaU4W","p-md-8":"_GbyMJ","m-md-9":"_brWmN","p-md-9":"_-1z0O","m-md-10":"_dIML4","p-md-10":"_eJliD","ml-md-0":"_nuVMQ","pl-md-0":"_PCyiw","ml-md-1":"_NX2qp","pl-md-1":"_yJ39l","ml-md-2":"_BV1WB","pl-md-2":"_x24YX","ml-md-3":"_kvTBw","pl-md-3":"_7G7wo","ml-md-4":"_s1oaO","pl-md-4":"_nTHBq","ml-md-5":"_2AyzN","pl-md-5":"_VmocP","ml-md-6":"_QEhdf","pl-md-6":"_Ywy9t","ml-md-7":"_Mybnc","pl-md-7":"_zHudI","ml-md-8":"_AT4F-","pl-md-8":"_1-CLq","ml-md-9":"_cZ0UL","pl-md-9":"_AKT8q","ml-md-10":"_uo54H","pl-md-10":"_2Edrz","mr-md-0":"_8NtcB","pr-md-0":"_BN5kR","mr-md-1":"_hIIXR","pr-md-1":"_KWi0C","mr-md-2":"_kP9GD","pr-md-2":"_fo1s0","mr-md-3":"_ptgO9","pr-md-3":"_AIGLm","mr-md-4":"_GJNi6","pr-md-4":"_-ZfQA","mr-md-5":"_hW-OG","pr-md-5":"_ePqmc","mr-md-6":"_ghuDl","pr-md-6":"_C9rlZ","mr-md-7":"_bIHB6","pr-md-7":"_xPHzJ","mr-md-8":"_6ZssD","pr-md-8":"_-N-QR","mr-md-9":"_T-XzG","pr-md-9":"_k8hdA","mr-md-10":"_26xvU","pr-md-10":"_U6Fpn","mt-md-0":"_ZIFgT","pt-md-0":"_6JBhp","mt-md-1":"_lIu84","pt-md-1":"_yPyiK","mt-md-2":"_sWcbm","pt-md-2":"_-7S2K","mt-md-3":"_-Zt6X","pt-md-3":"_pmFds","mt-md-4":"_dlz9t","pt-md-4":"_HQv-M","mt-md-5":"_9tUBj","pt-md-5":"_Jdc38","mt-md-6":"_BEZDD","pt-md-6":"_c3r6r","mt-md-7":"_KSCEr","pt-md-7":"_-Tpjo","mt-md-8":"_O-cOs","pt-md-8":"_DPwEz","mt-md-9":"_eBVAf","pt-md-9":"_Fnftl","mt-md-10":"_tlAu5","pt-md-10":"_ufMho","mb-md-0":"_NKFtN","pb-md-0":"_QEyOV","mb-md-1":"_t8EVs","pb-md-1":"_hVqy6","mb-md-2":"_Dwa5p","pb-md-2":"_A6iqX","mb-md-3":"_DAzrF","pb-md-3":"_o9L2-","mb-md-4":"_zMG5y","pb-md-4":"_wC2az","mb-md-5":"_LYF0o","pb-md-5":"_rrbij","mb-md-6":"_tUQcN","pb-md-6":"_MgAD-","mb-md-7":"_9lVsl","pb-md-7":"_Z7z8R","mb-md-8":"_CMrj4","pb-md-8":"_X4Qb0","mb-md-9":"_dQuWg","pb-md-9":"_98aa5","mb-md-10":"_tjfzH","pb-md-10":"_n5Id2","mx-md-0":"_kbQ3E","px-md-0":"_LWqO4","mx-md-1":"_8dqNC","px-md-1":"_QBFBY","mx-md-2":"_QXy6I","px-md-2":"_vBqGQ","mx-md-3":"_asgRe","px-md-3":"_i67O7","mx-md-4":"_-9eXp","px-md-4":"_ZQIEY","mx-md-5":"_l4FN1","px-md-5":"_vYBmq","mx-md-6":"_j4Fiy","px-md-6":"_BLvHs","mx-md-7":"_hg5ZA","px-md-7":"_OclOz","mx-md-8":"_NNMXz","px-md-8":"_KUBjL","mx-md-9":"_x5vxD","px-md-9":"_x1Hj-","mx-md-10":"_RnJFW","px-md-10":"_laoTv","my-md-0":"_gAG5i","py-md-0":"_KQkB8","my-md-1":"_90Emt","py-md-1":"_a93vq","my-md-2":"_wzerE","py-md-2":"_vpawj","my-md-3":"_ijUtT","py-md-3":"_9G-7C","my-md-4":"_GfQTx","py-md-4":"_vGRDM","my-md-5":"_MVaN3","py-md-5":"_5Ju4e","my-md-6":"_StvD2","py-md-6":"_03iO9","my-md-7":"_nlUi8","py-md-7":"_e58lN","my-md-8":"_VKoKR","py-md-8":"_Xa5lD","my-md-9":"_nLjef","py-md-9":"_88ryZ","my-md-10":"_-f4Oc","py-md-10":"_60CJ8","m-xl-0":"_YdUVc","p-xl-0":"_ceNl-","m-xl-1":"_cn-PK","p-xl-1":"_8pBVr","m-xl-2":"_UNu8h","p-xl-2":"_6mIBX","m-xl-3":"_LXA70","p-xl-3":"_nkNjg","m-xl-4":"_DH3uC","p-xl-4":"_b631X","m-xl-5":"_PU5TK","p-xl-5":"_Y9Pj5","m-xl-6":"_DQUfX","p-xl-6":"_cmXs1","m-xl-7":"_Hr4dN","p-xl-7":"_pwyLG","m-xl-8":"_XkBIo","p-xl-8":"_oSfQ1","m-xl-9":"_TXGD8","p-xl-9":"_r8XiA","m-xl-10":"_cbucW","p-xl-10":"_FnUT2","ml-xl-0":"_Lc2b0","pl-xl-0":"_8ofmI","ml-xl-1":"_yOkOl","pl-xl-1":"_5cZix","ml-xl-2":"_F0JQw","pl-xl-2":"_pWIp6","ml-xl-3":"_9CDHy","pl-xl-3":"_M9MOq","ml-xl-4":"_L6LLW","pl-xl-4":"_NZlEo","ml-xl-5":"_Milvj","pl-xl-5":"_N-hPa","ml-xl-6":"_HEU-c","pl-xl-6":"_x-uz3","ml-xl-7":"_xVYoD","pl-xl-7":"_TV3yu","ml-xl-8":"_WVmm8","pl-xl-8":"_Wsfh3","ml-xl-9":"_Rse0C","pl-xl-9":"_p-0My","ml-xl-10":"_LN1Pv","pl-xl-10":"_WtXyv","mr-xl-0":"_aQ8fC","pr-xl-0":"_x7HY1","mr-xl-1":"_rzUKT","pr-xl-1":"_ggRzA","mr-xl-2":"_j88Jb","pr-xl-2":"_6Ztzi","mr-xl-3":"_RNldP","pr-xl-3":"_uC4PP","mr-xl-4":"_14KPU","pr-xl-4":"_RoGxi","mr-xl-5":"_MYSFB","pr-xl-5":"_0fjNm","mr-xl-6":"_aK553","pr-xl-6":"_B-5Vf","mr-xl-7":"_nLta-","pr-xl-7":"_AhsZ-","mr-xl-8":"_emyPo","pr-xl-8":"_Dc6lK","mr-xl-9":"_MqsWc","pr-xl-9":"_j4A-H","mr-xl-10":"_v7rIi","pr-xl-10":"_aIhOc","mt-xl-0":"_1KMHA","pt-xl-0":"_SmBQC","mt-xl-1":"_FpHTe","pt-xl-1":"_tRIkV","mt-xl-2":"_ISAHh","pt-xl-2":"_KcOk8","mt-xl-3":"_cklRo","pt-xl-3":"_MqQSr","mt-xl-4":"_iaWfp","pt-xl-4":"_mcXBl","mt-xl-5":"_qNaL5","pt-xl-5":"_3tRQZ","mt-xl-6":"_MjyPP","pt-xl-6":"_wGTYM","mt-xl-7":"_WkpWd","pt-xl-7":"_-fXMT","mt-xl-8":"_xgRm6","pt-xl-8":"_mNE0F","mt-xl-9":"_tHRgU","pt-xl-9":"_pUanr","mt-xl-10":"_75l23","pt-xl-10":"_VjjB-","mb-xl-0":"_wNZHn","pb-xl-0":"_6weX6","mb-xl-1":"_xbDsG","pb-xl-1":"_WLHB6","mb-xl-2":"_JCck5","pb-xl-2":"_Ef822","mb-xl-3":"_-Izvj","pb-xl-3":"_kizTx","mb-xl-4":"_wDLLt","pb-xl-4":"_6vfXW","mb-xl-5":"_qa8hX","pb-xl-5":"_2cdIL","mb-xl-6":"_PPuX7","pb-xl-6":"_SYsiu","mb-xl-7":"_au29R","pb-xl-7":"_Wo-v3","mb-xl-8":"_7DCh1","pb-xl-8":"_8Qtxz","mb-xl-9":"_U5ePL","pb-xl-9":"_QdSRg","mb-xl-10":"_xwDK-","pb-xl-10":"_5HXQF","mx-xl-0":"_U-5An","px-xl-0":"_t0GQI","mx-xl-1":"_l2Q9y","px-xl-1":"_-6SLy","mx-xl-2":"_OO5ra","px-xl-2":"_DpWnU","mx-xl-3":"_umWwt","px-xl-3":"_gLeFm","mx-xl-4":"_O6nxp","px-xl-4":"_RXch7","mx-xl-5":"_GLCbl","px-xl-5":"_wOP1U","mx-xl-6":"_n1gJF","px-xl-6":"_jHA8-","mx-xl-7":"_ZG5zQ","px-xl-7":"_33-Bi","mx-xl-8":"_wGBwu","px-xl-8":"_jnqCE","mx-xl-9":"_-q541","px-xl-9":"_hQqb-","mx-xl-10":"_oOjVu","px-xl-10":"_8iBI4","my-xl-0":"_5V5-G","py-xl-0":"_ZIETe","my-xl-1":"_VhBbg","py-xl-1":"_qkd1g","my-xl-2":"_MONRd","py-xl-2":"_wBVYq","my-xl-3":"_oUD7x","py-xl-3":"_9C1YA","my-xl-4":"_akz7W","py-xl-4":"_sczsh","my-xl-5":"_CEcRg","py-xl-5":"_xFnw3","my-xl-6":"_RReJQ","py-xl-6":"_gx-E-","my-xl-7":"_NTw09","py-xl-7":"_VniPR","my-xl-8":"_zhVnN","py-xl-8":"_e-lj8","my-xl-9":"_p5Z-c","py-xl-9":"_L1zCc","my-xl-10":"_NqJ-Z","py-xl-10":"_LGmu1","background-shine":"_HkIXJ","path":"_VW1Ys","line":"_x1Ry-","skeleton":"_rh5J1","skeleton-animate":"_ukRhW","skeleton-dark":"_SuY0j","skeleton-dark-animate":"_wHz7j","skeleton-transparent":"_DehL2","skeleton-transparent-animate":"_nwZzB","semi-transparent":"_KJuSy","asset-icon":"_V0pcT","small":"_AXy-6","asset-icon-primary":"_wDjNx","asset-icon-secondary":"_uTjfo"};
|
|
1445
|
+
|
|
1446
|
+
var AssetIcon = function AssetIcon(_ref) {
|
|
1447
|
+
var assetIconSrc = _ref.assetIconSrc,
|
|
1448
|
+
_ref$assetIconProtoco = _ref.assetIconProtocolSrc,
|
|
1449
|
+
assetIconProtocolSrc = _ref$assetIconProtoco === void 0 ? null : _ref$assetIconProtoco,
|
|
1450
|
+
_ref$fallbackSrc = _ref.fallbackSrc,
|
|
1451
|
+
fallbackSrc = _ref$fallbackSrc === void 0 ? null : _ref$fallbackSrc,
|
|
1452
|
+
_ref$small = _ref.small,
|
|
1453
|
+
small = _ref$small === void 0 ? false : _ref$small;
|
|
1454
|
+
var handleFailedLoad = function handleFailedLoad(e) {
|
|
1455
|
+
e.target.onerror = null;
|
|
1456
|
+
e.target.src = fallbackSrc;
|
|
1457
|
+
};
|
|
1458
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
1459
|
+
className: s["asset-icon"] + (small ? " " + s["small"] : "")
|
|
1460
|
+
}, /*#__PURE__*/React__default["default"].createElement("img", {
|
|
1461
|
+
src: assetIconSrc,
|
|
1462
|
+
className: s["asset-icon-primary"] + (small ? " " + s["small"] : ""),
|
|
1463
|
+
alt: " ",
|
|
1464
|
+
onError: handleFailedLoad
|
|
1465
|
+
}), assetIconProtocolSrc ? /*#__PURE__*/React__default["default"].createElement("img", {
|
|
1466
|
+
src: assetIconProtocolSrc,
|
|
1467
|
+
className: s["asset-icon-secondary"] + (small ? " " + s["small"] : ""),
|
|
1468
|
+
alt: " ",
|
|
1469
|
+
onError: handleFailedLoad
|
|
1470
|
+
}) : "");
|
|
1471
|
+
};
|
|
1472
|
+
AssetIcon.propTypes = {
|
|
1473
|
+
assetIconSrc: PropTypes.string.isRequired,
|
|
1474
|
+
assetIconProtocolSrc: PropTypes.string,
|
|
1475
|
+
fallbackSrc: PropTypes.string,
|
|
1476
|
+
small: PropTypes.bool
|
|
1477
|
+
};
|
|
1478
|
+
AssetIcon.defaultProps = {
|
|
1479
|
+
assetIconProtocolSrc: null,
|
|
1480
|
+
fallbackSrc: null,
|
|
1481
|
+
small: false
|
|
1482
|
+
};
|
|
1483
|
+
|
|
1484
|
+
var LogsStorage = /*#__PURE__*/function () {
|
|
1485
|
+
function LogsStorage() {}
|
|
1486
|
+
LogsStorage.saveLog = function saveLog(log) {
|
|
1487
|
+
this._inMemoryStorage.push(log);
|
|
1488
|
+
};
|
|
1489
|
+
LogsStorage.getInMemoryLogs = function getInMemoryLogs() {
|
|
1490
|
+
return this._inMemoryStorage;
|
|
1491
|
+
};
|
|
1492
|
+
LogsStorage.getAllLogs = function getAllLogs() {
|
|
1493
|
+
var storedLogs = "";
|
|
1494
|
+
if (typeof window !== "undefined") {
|
|
1495
|
+
storedLogs = localStorage.getItem(this._logsStorageId);
|
|
1496
|
+
}
|
|
1497
|
+
return storedLogs + "\n" + this._inMemoryStorage.join("\n");
|
|
1498
|
+
}
|
|
1499
|
+
|
|
1500
|
+
/**
|
|
1501
|
+
* @param logger {Logger}
|
|
1502
|
+
*/;
|
|
1503
|
+
LogsStorage.saveToTheDisk = function saveToTheDisk(logger) {
|
|
1504
|
+
try {
|
|
1505
|
+
var MAX_LOCAL_STORAGE_VOLUME_BYTES = 5 * 1024 * 1024;
|
|
1506
|
+
var MAX_LOGS_STORAGE_BYTES = MAX_LOCAL_STORAGE_VOLUME_BYTES * 0.65;
|
|
1507
|
+
if (typeof window !== "undefined") {
|
|
1508
|
+
var existingLogs = localStorage.getItem(this._logsStorageId);
|
|
1509
|
+
var logsString = existingLogs + "\n" + this._inMemoryStorage.join("\n");
|
|
1510
|
+
var lettersCountToRemove = logsString.length - Math.round(MAX_LOGS_STORAGE_BYTES / 2);
|
|
1511
|
+
if (lettersCountToRemove > 0) {
|
|
1512
|
+
localStorage.setItem(this._logsStorageId, logsString.slice(lettersCountToRemove, logsString.length));
|
|
1513
|
+
} else {
|
|
1514
|
+
localStorage.setItem(this._logsStorageId, logsString);
|
|
1515
|
+
}
|
|
1516
|
+
this._inMemoryStorage = [];
|
|
1517
|
+
}
|
|
1518
|
+
} catch (e) {
|
|
1519
|
+
logger == null || logger.logError(e, "saveToTheDisk", "Failed to save logs to disk");
|
|
1520
|
+
}
|
|
1521
|
+
};
|
|
1522
|
+
LogsStorage.removeAllClientLogs = function removeAllClientLogs() {
|
|
1523
|
+
if (typeof window !== "undefined") {
|
|
1524
|
+
if (localStorage.getItem("doNotRemoveClientLogsWhenSignedOut") !== "true") {
|
|
1525
|
+
localStorage.removeItem(this._logsStorageId);
|
|
1526
|
+
}
|
|
1527
|
+
}
|
|
1528
|
+
this._inMemoryStorage = [];
|
|
1529
|
+
};
|
|
1530
|
+
LogsStorage.setDoNotRemoveClientLogsWhenSignedOut = function setDoNotRemoveClientLogsWhenSignedOut(value) {
|
|
1531
|
+
if (typeof window !== "undefined") {
|
|
1532
|
+
localStorage.setItem("doNotRemoveClientLogsWhenSignedOut", value);
|
|
1533
|
+
}
|
|
1534
|
+
};
|
|
1535
|
+
return LogsStorage;
|
|
1536
|
+
}();
|
|
1537
|
+
LogsStorage._inMemoryStorage = [];
|
|
1538
|
+
LogsStorage._logsStorageId = "clietnLogs_j203fj2D0n-d1";
|
|
1539
|
+
|
|
1540
|
+
/**
|
|
1541
|
+
* Stringify given object by use of JSON.stringify but handles circular structures and "response", "request" properties
|
|
1542
|
+
* to avoid stringing redundant data when printing errors containing request/response objects.
|
|
1543
|
+
*
|
|
1544
|
+
* @param object - object to be stringed
|
|
1545
|
+
* @param indent - custom indentation
|
|
1546
|
+
* @return {string} - stringed object
|
|
1547
|
+
*/
|
|
1548
|
+
function safeStringify(object, indent) {
|
|
1549
|
+
if (indent === void 0) {
|
|
1550
|
+
indent = 2;
|
|
1551
|
+
}
|
|
1552
|
+
var cache = [];
|
|
1553
|
+
if (typeof object === "string" || typeof object === "function" || typeof object === "number" || typeof object === "undefined" || typeof object === "boolean") {
|
|
1554
|
+
return String(object);
|
|
1555
|
+
}
|
|
1556
|
+
var retVal = JSON.stringify(object, function (key, value) {
|
|
1557
|
+
if (key.toLowerCase().includes("request")) {
|
|
1558
|
+
return JSON.stringify({
|
|
1559
|
+
body: value == null ? void 0 : value.body,
|
|
1560
|
+
query: value == null ? void 0 : value.query,
|
|
1561
|
+
headers: value == null ? void 0 : value.headers
|
|
1562
|
+
});
|
|
1563
|
+
}
|
|
1564
|
+
if (key.toLowerCase().includes("response")) {
|
|
1565
|
+
return JSON.stringify({
|
|
1566
|
+
statusText: value == null ? void 0 : value.statusText,
|
|
1567
|
+
status: value == null ? void 0 : value.status,
|
|
1568
|
+
data: value == null ? void 0 : value.data,
|
|
1569
|
+
headers: value == null ? void 0 : value.headers
|
|
1570
|
+
});
|
|
1571
|
+
}
|
|
1572
|
+
return typeof value === "object" && value !== null ? cache.includes(value) ? "duplicated reference" // Duplicated references were found, discarding this key
|
|
1573
|
+
: cache.push(value) && value // Store value in our collection
|
|
1574
|
+
: value;
|
|
1575
|
+
}, indent);
|
|
1576
|
+
cache = null;
|
|
1577
|
+
return retVal;
|
|
1578
|
+
}
|
|
1579
|
+
|
|
1580
|
+
var Logger = /*#__PURE__*/function () {
|
|
1581
|
+
function Logger() {}
|
|
1582
|
+
/**
|
|
1583
|
+
* Logs to client logs storage.
|
|
1584
|
+
*
|
|
1585
|
+
* WARNING! this method should ce used carefully for critical logging as we have the restriction for storing logs
|
|
1586
|
+
* on client side as we store them inside the local storage. Please see details inside storage.js
|
|
1587
|
+
* @param logString {string} log string
|
|
1588
|
+
* @param source {string} source of the log entry
|
|
1589
|
+
*/
|
|
1590
|
+
Logger.log = function log(logString, source) {
|
|
1591
|
+
var timestamp = new Date().toISOString();
|
|
1592
|
+
LogsStorage.saveLog(timestamp + "|" + source + ":" + logString);
|
|
1593
|
+
};
|
|
1594
|
+
Logger.logError = function logError(e, settingFunction, additionalMessage, onlyToConsole) {
|
|
1595
|
+
var _e$errorDescription, _e$howToFix;
|
|
1596
|
+
if (additionalMessage === void 0) {
|
|
1597
|
+
additionalMessage = "";
|
|
1598
|
+
}
|
|
1599
|
+
if (onlyToConsole === void 0) {
|
|
1600
|
+
onlyToConsole = false;
|
|
1601
|
+
}
|
|
1602
|
+
var message = "\nFunction call " + (settingFunction != null ? settingFunction : "") + " failed. Error message: " + (e == null ? void 0 : e.message) + ". " + additionalMessage + " ";
|
|
1603
|
+
message += "" + ((_e$errorDescription = e == null ? void 0 : e.errorDescription) != null ? _e$errorDescription : "") + ((_e$howToFix = e == null ? void 0 : e.howToFix) != null ? _e$howToFix : "") + ((e == null ? void 0 : e.httpStatus) === 403 ? "Authentication has expired or was lost. " : "");
|
|
1604
|
+
if (e != null && e.response) {
|
|
1605
|
+
try {
|
|
1606
|
+
var responseData = safeStringify({
|
|
1607
|
+
response: e.response
|
|
1608
|
+
});
|
|
1609
|
+
responseData && (message += "\n" + responseData + ". ");
|
|
1610
|
+
} catch (e) {}
|
|
1611
|
+
}
|
|
1612
|
+
var finalErrorText = message + ". " + safeStringify(e);
|
|
1613
|
+
// eslint-disable-next-line no-console
|
|
1614
|
+
console.error(finalErrorText, e);
|
|
1615
|
+
if (!onlyToConsole) {
|
|
1616
|
+
this.log(finalErrorText, "logError");
|
|
1617
|
+
}
|
|
1618
|
+
};
|
|
1619
|
+
return Logger;
|
|
1620
|
+
}();
|
|
1621
|
+
|
|
1622
|
+
function _catch$4(body, recover) {
|
|
1623
|
+
try {
|
|
1624
|
+
var result = body();
|
|
1625
|
+
} catch (e) {
|
|
1626
|
+
return recover(e);
|
|
1627
|
+
}
|
|
1628
|
+
if (result && result.then) {
|
|
1629
|
+
return result.then(void 0, recover);
|
|
1630
|
+
}
|
|
1631
|
+
return result;
|
|
1632
|
+
}
|
|
1633
|
+
function useCallHandlingErrors() {
|
|
1634
|
+
var _useState = React.useState(),
|
|
1635
|
+
setState = _useState[1];
|
|
1636
|
+
return React.useCallback(function (functionToBeCalled, event) {
|
|
1637
|
+
try {
|
|
1638
|
+
var _temp = _catch$4(function () {
|
|
1639
|
+
return Promise.resolve(functionToBeCalled(event)).then(function () {});
|
|
1640
|
+
}, function (error) {
|
|
1641
|
+
Logger.logError(error, (functionToBeCalled == null ? void 0 : functionToBeCalled.name) || "errorBoundaryTrigger", "Caught by ErrorBoundary");
|
|
1642
|
+
// Triggering ErrorBoundary
|
|
1643
|
+
setState(function () {
|
|
1644
|
+
throw error;
|
|
1645
|
+
});
|
|
1646
|
+
});
|
|
1647
|
+
return Promise.resolve(_temp && _temp.then ? _temp.then(function () {}) : void 0);
|
|
1648
|
+
} catch (e) {
|
|
1649
|
+
return Promise.reject(e);
|
|
1650
|
+
}
|
|
1651
|
+
}, []);
|
|
1652
|
+
}
|
|
1653
|
+
|
|
1654
|
+
/**
|
|
1655
|
+
* Adds reference to standard state variable. It is helpful to be able to use state variable value inside
|
|
1656
|
+
* event handlers and other callbacks without the need to call setState(prev => { value = prev; return prev; }).
|
|
1657
|
+
*
|
|
1658
|
+
* @param initialValue {any} to be passed to useState
|
|
1659
|
+
* @return {[React.Ref, function]} reference to state variable and its setter
|
|
1660
|
+
*/
|
|
1661
|
+
function useReferredState(initialValue) {
|
|
1662
|
+
var _React$useState = React__default["default"].useState(initialValue),
|
|
1663
|
+
state = _React$useState[0],
|
|
1664
|
+
setState = _React$useState[1];
|
|
1665
|
+
var reference = React__default["default"].useRef(state);
|
|
1666
|
+
var setReferredState = function setReferredState(value) {
|
|
1667
|
+
if (value && {}.toString.call(value) === "[object Function]") {
|
|
1668
|
+
value = value(reference.current);
|
|
1669
|
+
}
|
|
1670
|
+
reference.current = value;
|
|
1671
|
+
setState(value);
|
|
1672
|
+
};
|
|
1673
|
+
return [reference, setReferredState];
|
|
1674
|
+
}
|
|
1675
|
+
|
|
1676
|
+
/**
|
|
1677
|
+
* This function improves the passed error object (its message) by adding the passed function name
|
|
1678
|
+
* and additional message to it.
|
|
1679
|
+
* This is useful as Javascript doesn't guarantee the stack-traces, so we should manually add these details to errors
|
|
1680
|
+
* to be able to troubleshoot.
|
|
1681
|
+
*
|
|
1682
|
+
* @param e {Error}
|
|
1683
|
+
* @param settingFunction {string}
|
|
1684
|
+
* @param [additionalMessage=""] {string|undefined}
|
|
1685
|
+
* @throws {Error} always rethrows the original passed error but with an improved message
|
|
1686
|
+
*/
|
|
1687
|
+
function improveAndRethrow(e, settingFunction, additionalMessage) {
|
|
1688
|
+
if (additionalMessage === void 0) {
|
|
1689
|
+
additionalMessage = "";
|
|
1690
|
+
}
|
|
1691
|
+
var message = improvedErrorMessage(e, settingFunction, additionalMessage);
|
|
1692
|
+
if (e) {
|
|
1693
|
+
e.message = message;
|
|
1694
|
+
throw e; // to preserve existing stacktrace if present
|
|
1695
|
+
}
|
|
1696
|
+
throw new Error(message);
|
|
1697
|
+
}
|
|
1698
|
+
function improvedErrorMessage(e, settingFunction, additionalMessage) {
|
|
1699
|
+
var message = "\nFunction call " + (settingFunction != null ? settingFunction : "") + " failed. ";
|
|
1700
|
+
e && e.message && (message += "Error message: " + e.message + ". ");
|
|
1701
|
+
additionalMessage && (message += additionalMessage + " ");
|
|
1702
|
+
return message;
|
|
1703
|
+
}
|
|
1704
|
+
|
|
1705
|
+
var FiatCurrenciesService = /*#__PURE__*/function () {
|
|
1706
|
+
function FiatCurrenciesService() {}
|
|
1707
|
+
FiatCurrenciesService.getFullCurrencyNameByCode = function getFullCurrencyNameByCode(code) {
|
|
1708
|
+
if (code === void 0) {
|
|
1709
|
+
code = "";
|
|
1710
|
+
}
|
|
1711
|
+
var data = fiatCurrenciesList.find(function (currencyData) {
|
|
1712
|
+
return currencyData[0] === code.toUpperCase();
|
|
1713
|
+
});
|
|
1714
|
+
return data && data[2] || null;
|
|
1715
|
+
};
|
|
1716
|
+
FiatCurrenciesService.isCodeValid = function isCodeValid(code) {
|
|
1717
|
+
return !!fiatCurrenciesList.find(function (currenciesData) {
|
|
1718
|
+
return currenciesData[0] === code;
|
|
1719
|
+
});
|
|
1720
|
+
}
|
|
1721
|
+
|
|
1722
|
+
/**
|
|
1723
|
+
* Returns currency symbol by code if present
|
|
1724
|
+
*
|
|
1725
|
+
* @param code {string} currency code
|
|
1726
|
+
* @return {string|null} code or null if there is no symbol for the currency
|
|
1727
|
+
*/;
|
|
1728
|
+
FiatCurrenciesService.getCurrencySymbolByCode = function getCurrencySymbolByCode(code) {
|
|
1729
|
+
var _data$;
|
|
1730
|
+
if (code === void 0) {
|
|
1731
|
+
code = "";
|
|
1732
|
+
}
|
|
1733
|
+
var data = fiatCurrenciesList.find(function (currencyData) {
|
|
1734
|
+
return currencyData[0] === code.toUpperCase();
|
|
1735
|
+
});
|
|
1736
|
+
return (_data$ = data == null ? void 0 : data[1]) != null ? _data$ : null;
|
|
1737
|
+
}
|
|
1738
|
+
|
|
1739
|
+
/**
|
|
1740
|
+
* @param code {string}
|
|
1741
|
+
* @return {number|null}
|
|
1742
|
+
*/;
|
|
1743
|
+
FiatCurrenciesService.getCurrencyDecimalCountByCode = function getCurrencyDecimalCountByCode(code) {
|
|
1744
|
+
var _data$2;
|
|
1745
|
+
if (code === void 0) {
|
|
1746
|
+
code = "";
|
|
1747
|
+
}
|
|
1748
|
+
var data = fiatCurrenciesList.find(function (currencyData) {
|
|
1749
|
+
return currencyData[0] === code.toUpperCase();
|
|
1750
|
+
});
|
|
1751
|
+
return (_data$2 = data == null ? void 0 : data[3]) != null ? _data$2 : null;
|
|
1752
|
+
};
|
|
1753
|
+
return FiatCurrenciesService;
|
|
1754
|
+
}();
|
|
1755
|
+
var fiatCurrenciesList = [["USD", "$", "US Dollar", 2], ["CAD", "CA$", "Canadian Dollar", 2], ["EUR", "€", "Euro", 2], ["AED", "AED", "UAE Dirham", 2], ["AFN", "؋", "Afghan Afghani", 0], ["ALL", "ALL", "Albanian Lek", 0], ["AMD", "֏", "Armenian Dram", 0], ["ARS", "AR$", "Argentine Peso", 2], ["AUD", "AU$", "Australian Dollar", 2], ["AZN", "₼", "Azerbaijani Manat", 2], ["BAM", "KM", "Bosnia-Herzegovina Convertible Mark", 2], ["BDT", "Tk", "Bangladeshi Taka", 2], ["BGN", "BGN", "Bulgarian Lev", 2], ["BHD", "BD", "Bahraini Dinar", 3], ["BIF", "FBu", "Burundian Franc", 0], ["BND", "BN$", "Brunei Dollar", 2], ["BOB", "Bs", "Bolivian Boliviano", 2], ["BRL", "R$", "Brazilian Real", 2], ["BWP", "BWP", "Botswanan Pula", 2], ["BYN", "Br", "Belarusian Ruble", 2], ["BZD", "BZ$", "Belize Dollar", 2], ["CDF", "CDF", "Congolese Franc", 2], ["CHF", "CHF", "Swiss Franc", 2], ["CLP", "CL$", "Chilean Peso", 0], ["CNY", "CN¥", "Chinese Yuan", 2], ["COP", "CO$", "Colombian Peso", 0], ["CRC", "₡", "Costa Rican Colón", 0], ["CVE", "CV$", "Cape Verdean Escudo", 2], ["CZK", "Kč", "Czech Republic Koruna", 2], ["DJF", "Fdj", "Djiboutian Franc", 0], ["DKK", "Dkr", "Danish Krone", 2], ["DOP", "RD$", "Dominican Peso", 2], ["DZD", "DA", "Algerian Dinar", 2], ["EEK", "Ekr", "Estonian Kroon", 2], ["EGP", "EGP", "Egyptian Pound", 2], ["ERN", "Nfk", "Eritrean Nakfa", 2], ["ETB", "Br", "Ethiopian Birr", 2], ["GBP", "£", "British Pound Sterling", 2], ["GEL", "₾", "Georgian Lari", 2], ["GHS", "₵", "Ghanaian Cedi", 2], ["GNF", "FG", "Guinean Franc", 0], ["GTQ", "GTQ", "Guatemalan Quetzal", 2], ["HKD", "HK$", "Hong Kong Dollar", 2], ["HNL", "HNL", "Honduran Lempira", 2], ["HRK", "kn", "Croatian Kuna", 2], ["HUF", "Ft", "Hungarian Forint", 0], ["IDR", "Rp", "Indonesian Rupiah", 0], ["ILS", "₪", "Israeli New Sheqel", 2], ["INR", "₹", "Indian Rupee", 2], ["IQD", "IQD", "Iraqi Dinar", 0], ["IRR", "﷼", "Iranian Rial", 0], ["ISK", "Ikr", "Icelandic Króna", 0], ["JMD", "J$", "Jamaican Dollar", 2], ["JOD", "JD", "Jordanian Dinar", 3], ["JPY", "¥", "Japanese Yen", 0], ["KES", "Ksh", "Kenyan Shilling", 2], ["KHR", "KHR", "Cambodian Riel", 2], ["KMF", "CF", "Comorian Franc", 0], ["KRW", "₩", "South Korean Won", 0], ["KWD", "KD", "Kuwaiti Dinar", 3], ["KZT", "₸", "Kazakhstani Tenge", 2], ["LBP", "LB£", "Lebanese Pound", 0], ["LKR", "SLRs", "Sri Lankan Rupee", 2], ["LTL", "Lt", "Lithuanian Litas", 2], ["LVL", "Ls", "Latvian Lats", 2], ["LYD", "LD", "Libyan Dinar", 3], ["MAD", "MAD", "Moroccan Dirham", 2], ["MDL", "MDL", "Moldovan Leu", 2], ["MGA", "MGA", "Malagasy Ariary", 0], ["MKD", "MKD", "Macedonian Denar", 2], ["MMK", "MMK", "Myanma Kyat", 0], ["MNT", "₮", "Mongolian Tugrik", 0], ["MOP", "MOP$", "Macanese Pataca", 2], ["MUR", "MURs", "Mauritian Rupee", 0], ["MXN", "MX$", "Mexican Peso", 2], ["MYR", "RM", "Malaysian Ringgit", 2], ["MZN", "MTn", "Mozambican Metical", 2], ["NAD", "N$", "Namibian Dollar", 2], ["NGN", "₦", "Nigerian Naira", 2], ["NIO", "C$", "Nicaraguan Córdoba", 2], ["NOK", "Nkr", "Norwegian Krone", 2], ["NPR", "NPRs", "Nepalese Rupee", 2], ["NZD", "NZ$", "New Zealand Dollar", 2], ["OMR", "OMR", "Omani Rial", 3], ["PAB", "B/.", "Panamanian Balboa", 2], ["PEN", "S/.", "Peruvian Nuevo Sol", 2], ["PHP", "₱", "Philippine Peso", 2], ["PKR", "PKRs", "Pakistani Rupee", 0], ["PLN", "zł", "Polish Zloty", 2], ["PYG", "₲", "Paraguayan Guarani", 0], ["QAR", "QR", "Qatari Rial", 2], ["RON", "RON", "Romanian Leu", 2], ["RSD", "din.", "Serbian Dinar", 0], ["RUB", "₽", "Russian Ruble", 2], ["RWF", "RWF", "Rwandan Franc", 0], ["SAR", "SR", "Saudi Riyal", 2], ["SDG", "SDG", "Sudanese Pound", 2], ["SEK", "Skr", "Swedish Krona", 2], ["SGD", "S$", "Singapore Dollar", 2], ["SOS", "Ssh", "Somali Shilling", 0], ["SYP", "SY£", "Syrian Pound", 0], ["THB", "฿", "Thai Baht", 2], ["TND", "DT", "Tunisian Dinar", 3], ["TOP", "T$", "Tongan Paʻanga", 2], ["TRY", "₺", "Turkish Lira", 2], ["TTD", "TT$", "Trinidad and Tobago Dollar", 2], ["TWD", "NT$", "New Taiwan Dollar", 2], ["TZS", "TSh", "Tanzanian Shilling", 0], ["UAH", "₴", "Ukrainian Hryvnia", 2], ["UGX", "USh", "Ugandan Shilling", 0], ["UYU", "$U", "Uruguayan Peso", 2], ["UZS", "UZS", "Uzbekistan Som", 0], ["VEF", "Bs.F.", "Venezuelan Bolívar", 2], ["VND", "₫", "Vietnamese Dong", 0], ["XAF", "FCFA", "CFA Franc BEAC", 0], ["XOF", "CFA", "CFA Franc BCEAO", 0], ["YER", "﷼", "Yemeni Rial", 0], ["ZAR", "R", "South African Rand", 2], ["ZMK", "ZK", "Zambian Kwacha", 0], ["ZWL", "ZWL$", "Zimbabwean Dollar", 0]];
|
|
1756
|
+
|
|
1757
|
+
function _extends() {
|
|
1758
|
+
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
1759
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
1760
|
+
var source = arguments[i];
|
|
1761
|
+
for (var key in source) {
|
|
1762
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
1763
|
+
target[key] = source[key];
|
|
1764
|
+
}
|
|
1765
|
+
}
|
|
1766
|
+
}
|
|
1767
|
+
return target;
|
|
1768
|
+
};
|
|
1769
|
+
return _extends.apply(this, arguments);
|
|
1770
|
+
}
|
|
1771
|
+
function _inheritsLoose(subClass, superClass) {
|
|
1772
|
+
subClass.prototype = Object.create(superClass.prototype);
|
|
1773
|
+
subClass.prototype.constructor = subClass;
|
|
1774
|
+
_setPrototypeOf(subClass, superClass);
|
|
1775
|
+
}
|
|
1776
|
+
function _setPrototypeOf(o, p) {
|
|
1777
|
+
_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
|
|
1778
|
+
o.__proto__ = p;
|
|
1779
|
+
return o;
|
|
1780
|
+
};
|
|
1781
|
+
return _setPrototypeOf(o, p);
|
|
1782
|
+
}
|
|
1783
|
+
function _unsupportedIterableToArray(o, minLen) {
|
|
1784
|
+
if (!o) return;
|
|
1785
|
+
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
1786
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
1787
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
1788
|
+
if (n === "Map" || n === "Set") return Array.from(o);
|
|
1789
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
1790
|
+
}
|
|
1791
|
+
function _arrayLikeToArray(arr, len) {
|
|
1792
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
1793
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
1794
|
+
return arr2;
|
|
1795
|
+
}
|
|
1796
|
+
function _createForOfIteratorHelperLoose(o, allowArrayLike) {
|
|
1797
|
+
var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
|
|
1798
|
+
if (it) return (it = it.call(o)).next.bind(it);
|
|
1799
|
+
if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
|
|
1800
|
+
if (it) o = it;
|
|
1801
|
+
var i = 0;
|
|
1802
|
+
return function () {
|
|
1803
|
+
if (i >= o.length) return {
|
|
1804
|
+
done: true
|
|
1805
|
+
};
|
|
1806
|
+
return {
|
|
1807
|
+
done: false,
|
|
1808
|
+
value: o[i++]
|
|
1809
|
+
};
|
|
1810
|
+
};
|
|
1811
|
+
}
|
|
1812
|
+
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
1813
|
+
}
|
|
1814
|
+
|
|
1815
|
+
// TODO: [dev] return addCommasToAmountString internal method to encapsulate commas adding
|
|
1816
|
+
|
|
1817
|
+
var AmountUtils = /*#__PURE__*/function () {
|
|
1818
|
+
function AmountUtils() {}
|
|
1819
|
+
AmountUtils.fiatXs = function fiatXs(amount, code) {
|
|
1820
|
+
return this.fiat(amount, code, {
|
|
1821
|
+
extraSmallLength: true
|
|
1822
|
+
});
|
|
1823
|
+
}
|
|
1824
|
+
|
|
1825
|
+
/**
|
|
1826
|
+
* Universal method for rendering of fiat amounts, taking into account the rules of
|
|
1827
|
+
* the passed fiat currency code.
|
|
1828
|
+
*
|
|
1829
|
+
* TODO: [feature, high] remove 'number' from accepted types list task_id=1e692bcfabbe487a9d1638fc8ff17448
|
|
1830
|
+
* @param amount {BigNumber|number|string|null|undefined} The number value to be trimmed
|
|
1831
|
+
* @param currencyCode {string|null} The currency code. Can be omitted if { ticker: false } in the config
|
|
1832
|
+
* @param [passedParams={}] {object} Formatting parameters
|
|
1833
|
+
* @return {string} Formatted fiat amount string
|
|
1834
|
+
*/;
|
|
1835
|
+
AmountUtils.fiat = function fiat(amount, currencyCode, passedParams) {
|
|
1836
|
+
if (passedParams === void 0) {
|
|
1837
|
+
passedParams = {};
|
|
1838
|
+
}
|
|
1839
|
+
try {
|
|
1840
|
+
var params = _extends({}, this.defaultFiatParams, passedParams);
|
|
1841
|
+
if (this._checkIfAmountInvalid(amount, true) || typeof currencyCode !== "string") return "NULL";
|
|
1842
|
+
var currencySymbol = FiatCurrenciesService.getCurrencySymbolByCode(currencyCode);
|
|
1843
|
+
var currencyDecimalCount = FiatCurrenciesService.getCurrencyDecimalCountByCode(currencyCode);
|
|
1844
|
+
var trimmedByMaxDigits = bignumber_js.BigNumber(amount).toFixed(currencyDecimalCount, bignumber_js.BigNumber.ROUND_FLOOR);
|
|
1845
|
+
var processedAmount = bignumber_js.BigNumber(trimmedByMaxDigits);
|
|
1846
|
+
if (params.collapsible && processedAmount.gte(bignumber_js.BigNumber("1000000"))) {
|
|
1847
|
+
processedAmount = this._collapseToMillionsAndFormat(processedAmount, this.collapsedDecimalCount, params);
|
|
1848
|
+
} else {
|
|
1849
|
+
var limitResult = this._limitTotalAmountLengthIfNeeded(trimmedByMaxDigits, params);
|
|
1850
|
+
processedAmount = bignumber_js.BigNumber(limitResult.processedAmount).toFormat(); // Adds commas to integer part
|
|
1851
|
+
}
|
|
1852
|
+
|
|
1853
|
+
// Add the currency code or currency symbol, if symbol is enabled and available
|
|
1854
|
+
if (params.ticker) {
|
|
1855
|
+
if (typeof currencySymbol === "string" && params.enableCurrencySymbols) {
|
|
1856
|
+
processedAmount = currencySymbol + (currencySymbol.length > 1 ? " " : "") + processedAmount;
|
|
1857
|
+
} else {
|
|
1858
|
+
processedAmount = processedAmount + " " + currencyCode;
|
|
1859
|
+
}
|
|
1860
|
+
}
|
|
1861
|
+
return processedAmount;
|
|
1862
|
+
} catch (e) {
|
|
1863
|
+
improveAndRethrow(e, "fiat", "Passed: " + amount);
|
|
1864
|
+
}
|
|
1865
|
+
};
|
|
1866
|
+
AmountUtils.cryptoWoTicker = function cryptoWoTicker(amount, digits) {
|
|
1867
|
+
return this.crypto(amount, null, digits, {
|
|
1868
|
+
ticker: false
|
|
1869
|
+
});
|
|
1870
|
+
};
|
|
1871
|
+
AmountUtils.cryptoWoTickerXs = function cryptoWoTickerXs(amount, digits) {
|
|
1872
|
+
return this.crypto(amount, null, digits, {
|
|
1873
|
+
ticker: false,
|
|
1874
|
+
extraSmallLength: true
|
|
1875
|
+
});
|
|
1876
|
+
};
|
|
1877
|
+
AmountUtils.cryptoXs = function cryptoXs(amount, ticker, digits) {
|
|
1878
|
+
return this.crypto(amount, ticker, digits, {
|
|
1879
|
+
extraSmallLength: true,
|
|
1880
|
+
periods: false
|
|
1881
|
+
});
|
|
1882
|
+
};
|
|
1883
|
+
AmountUtils.cryptoFull = function cryptoFull(amount, ticker, digits) {
|
|
1884
|
+
return this.crypto(amount, ticker, digits, {
|
|
1885
|
+
collapsible: false,
|
|
1886
|
+
trim: false,
|
|
1887
|
+
limitTotalLength: false
|
|
1888
|
+
});
|
|
1889
|
+
}
|
|
1890
|
+
|
|
1891
|
+
/**
|
|
1892
|
+
* Universal method for rendering of crypto amounts, taking into account the rules of
|
|
1893
|
+
* the passed ticker. Requires the number of digits after period to be less of equal to
|
|
1894
|
+
* the number of digits, supported by the passed ticker.
|
|
1895
|
+
*
|
|
1896
|
+
* @param amount {BigNumber|string|null|undefined} The number value to be formatted
|
|
1897
|
+
* @param ticker {string|null} Coin ticker
|
|
1898
|
+
* @param [digits=8] {number} max digits after the dot
|
|
1899
|
+
* @param passedParams {object} Formatting parameters
|
|
1900
|
+
* @return {string} Formatted crypto amount string
|
|
1901
|
+
*/;
|
|
1902
|
+
AmountUtils.crypto = function crypto(amount, ticker, digits, passedParams) {
|
|
1903
|
+
if (digits === void 0) {
|
|
1904
|
+
digits = this.significantDecimalCount;
|
|
1905
|
+
}
|
|
1906
|
+
try {
|
|
1907
|
+
var params = _extends({}, this.defaultCryptoParams, passedParams);
|
|
1908
|
+
if (this._checkIfAmountInvalid(amount) || typeof ticker !== "string" && params.ticker) return "NULL";
|
|
1909
|
+
var addPeriods = false;
|
|
1910
|
+
var amountBigNumber = bignumber_js.BigNumber(amount);
|
|
1911
|
+
var processedAmount = amountBigNumber.toFixed(digits, bignumber_js.BigNumber.ROUND_FLOOR);
|
|
1912
|
+
processedAmount = this.removeRedundantRightZerosFromNumberString(processedAmount);
|
|
1913
|
+
var originalAmountDecimalPlaces = bignumber_js.BigNumber(processedAmount).decimalPlaces();
|
|
1914
|
+
// Check decimal count and throw an error, if the amount has more decimal digits than supported by the asset
|
|
1915
|
+
if (originalAmountDecimalPlaces > digits) {
|
|
1916
|
+
var errorMessage = "An attempt to render a crypto value with too many digits after period was made: " + amount + ", allowed digits: " + digits + ". This is a no-op, since the logical and visually rendered values would differ, which is not acceptable for crypto amounts. Please trim the amount before rendering, using the trimCryptoAmountByCoin(amount, coin) method.";
|
|
1917
|
+
// throw new Error(errorMessage);
|
|
1918
|
+
// eslint-disable-next-line no-console
|
|
1919
|
+
console.log(errorMessage, "crypto");
|
|
1920
|
+
}
|
|
1921
|
+
|
|
1922
|
+
// Shortening the value to general significant number of digits after period
|
|
1923
|
+
if (params.trim) {
|
|
1924
|
+
processedAmount = this.removeRedundantRightZerosFromNumberString(amountBigNumber.toFixed(this.significantDecimalCount, bignumber_js.BigNumber.ROUND_FLOOR));
|
|
1925
|
+
addPeriods = originalAmountDecimalPlaces > this.significantDecimalCount;
|
|
1926
|
+
}
|
|
1927
|
+
var limitResult = this._limitTotalAmountLengthIfNeeded(processedAmount, params);
|
|
1928
|
+
processedAmount = limitResult.processedAmount;
|
|
1929
|
+
addPeriods || (addPeriods = limitResult.addPeriods);
|
|
1930
|
+
var wereMillionsCollapsed = false;
|
|
1931
|
+
if (params.collapsible && amountBigNumber.gte("1000000")) {
|
|
1932
|
+
// Collapse the 1M+ amounts if applicable
|
|
1933
|
+
processedAmount = this._collapseToMillionsAndFormat(bignumber_js.BigNumber(processedAmount), this.collapsedDecimalCount, params);
|
|
1934
|
+
wereMillionsCollapsed = true;
|
|
1935
|
+
} else {
|
|
1936
|
+
// Add separators to integer part of the amount
|
|
1937
|
+
processedAmount = bignumber_js.BigNumber(processedAmount).toFormat();
|
|
1938
|
+
}
|
|
1939
|
+
|
|
1940
|
+
// Adding periods, if the amount was shortened
|
|
1941
|
+
if (params.periods && addPeriods && !wereMillionsCollapsed) {
|
|
1942
|
+
processedAmount = processedAmount + this.periods;
|
|
1943
|
+
}
|
|
1944
|
+
|
|
1945
|
+
// Adding an adaptive (printable/full) ticker
|
|
1946
|
+
if (params.ticker && ticker) {
|
|
1947
|
+
processedAmount = processedAmount + " " + ticker;
|
|
1948
|
+
}
|
|
1949
|
+
return processedAmount;
|
|
1950
|
+
} catch (e) {
|
|
1951
|
+
improveAndRethrow(e, "crypto", "Passed: " + amount + ", " + ticker + ", " + digits);
|
|
1952
|
+
}
|
|
1953
|
+
};
|
|
1954
|
+
AmountUtils._checkIfAmountInvalid = function _checkIfAmountInvalid(amount, allowNumbers) {
|
|
1955
|
+
if (allowNumbers === void 0) {
|
|
1956
|
+
allowNumbers = false;
|
|
1957
|
+
}
|
|
1958
|
+
return amount == null || amount === "" || !bignumber_js.BigNumber.isBigNumber(amount) && typeof amount !== "string" && (!allowNumbers || typeof amount !== "number");
|
|
1959
|
+
}
|
|
1960
|
+
|
|
1961
|
+
/**
|
|
1962
|
+
* Trims all digits after period that exceed the number of digits provided.
|
|
1963
|
+
* Use this everywhere when calculating some amount value to ensure the result is correct in terms
|
|
1964
|
+
* of max digits allowed by specific currency.
|
|
1965
|
+
*
|
|
1966
|
+
* @param amount {BigNumber|number|string|null|undefined} The number value to be trimmed.
|
|
1967
|
+
* HEX strings also allowed "0x..." and JS hex numbers
|
|
1968
|
+
* @param digits {number} allowed digits
|
|
1969
|
+
* @return {string|null} String with trimmed number or null for invalid amount
|
|
1970
|
+
*/;
|
|
1971
|
+
AmountUtils.trim = function trim(amount, digits) {
|
|
1972
|
+
try {
|
|
1973
|
+
if (this._checkIfAmountInvalid(amount, true)) return null;
|
|
1974
|
+
return bignumber_js.BigNumber(amount).toFixed(digits, bignumber_js.BigNumber.ROUND_FLOOR);
|
|
1975
|
+
} catch (e) {
|
|
1976
|
+
improveAndRethrow(e, "trim", "Passed: " + amount + ", " + digits);
|
|
1977
|
+
}
|
|
1978
|
+
}
|
|
1979
|
+
|
|
1980
|
+
/**
|
|
1981
|
+
* @param amount {BigNumber|number|string|null|undefined} The number value to be trimmed.
|
|
1982
|
+
* HEX strings also allowed "0x..." and JS hex numbers
|
|
1983
|
+
* @return {string|null}
|
|
1984
|
+
*/;
|
|
1985
|
+
AmountUtils.intStr = function intStr(amount) {
|
|
1986
|
+
return this.trim(amount, 0);
|
|
1987
|
+
}
|
|
1988
|
+
|
|
1989
|
+
/**
|
|
1990
|
+
* Shortens the line length by using a "1.52M" representation of big amounts.
|
|
1991
|
+
*
|
|
1992
|
+
* @param amountBigNumber {BigNumber} The number value to be trimmed
|
|
1993
|
+
* @param decimalCount {number} The number of digits after period to keep in millions representation
|
|
1994
|
+
* @param params {object} params object
|
|
1995
|
+
* @return {string} A shortened string, converted into "millions" format, if the amount exceeds 1 million
|
|
1996
|
+
*/;
|
|
1997
|
+
AmountUtils._collapseToMillionsAndFormat = function _collapseToMillionsAndFormat(amountBigNumber, decimalCount, params) {
|
|
1998
|
+
if (params === void 0) {
|
|
1999
|
+
params = {};
|
|
2000
|
+
}
|
|
2001
|
+
try {
|
|
2002
|
+
// TODO: [feature, moderate] use local format here - take from JS locales (comma/dot etc.)
|
|
2003
|
+
var millionBigNumber = bignumber_js.BigNumber("1000000");
|
|
2004
|
+
var millions = amountBigNumber.div(millionBigNumber).toFixed(decimalCount, bignumber_js.BigNumber.ROUND_FLOOR);
|
|
2005
|
+
var limitedResult = this._limitTotalAmountLengthIfNeeded(millions, params);
|
|
2006
|
+
var formatted = bignumber_js.BigNumber(limitedResult.processedAmount).toFormat();
|
|
2007
|
+
return formatted + "M";
|
|
2008
|
+
} catch (e) {
|
|
2009
|
+
improveAndRethrow(e, "_collapseAmountAndFormat", "Passed: " + amountBigNumber.toFixed() + ", " + decimalCount);
|
|
2010
|
+
}
|
|
2011
|
+
}
|
|
2012
|
+
|
|
2013
|
+
/**
|
|
2014
|
+
* @param amountString {string} The amount to be restricted by length
|
|
2015
|
+
* @param params {object} Params object used for formatting
|
|
2016
|
+
* @return {{processedAmount:string, addPeriods: boolean}} A shortened string
|
|
2017
|
+
*/;
|
|
2018
|
+
AmountUtils._limitTotalAmountLengthIfNeeded = function _limitTotalAmountLengthIfNeeded(amountString, params) {
|
|
2019
|
+
try {
|
|
2020
|
+
var addPeriods = false;
|
|
2021
|
+
if (params.limitTotalLength || params.extraSmallLength) {
|
|
2022
|
+
var maxLength = params.extraSmallLength ? this.extraSmallMaxTotalLength : this.maxTotalLength;
|
|
2023
|
+
if (amountString.length > maxLength) {
|
|
2024
|
+
var delta = amountString.length - maxLength;
|
|
2025
|
+
var currentDecimalsCount = bignumber_js.BigNumber(amountString).decimalPlaces();
|
|
2026
|
+
var newDecimalCount = currentDecimalsCount - delta;
|
|
2027
|
+
amountString = bignumber_js.BigNumber(amountString).toFixed(newDecimalCount > 2 ? newDecimalCount : 2, bignumber_js.BigNumber.ROUND_FLOOR);
|
|
2028
|
+
addPeriods = currentDecimalsCount > newDecimalCount;
|
|
2029
|
+
}
|
|
2030
|
+
}
|
|
2031
|
+
return {
|
|
2032
|
+
addPeriods: addPeriods,
|
|
2033
|
+
processedAmount: amountString
|
|
2034
|
+
};
|
|
2035
|
+
} catch (e) {
|
|
2036
|
+
improveAndRethrow(e, "_limitTotalAmountLengthIfNeeded", "Passed: " + amountString + ", " + params);
|
|
2037
|
+
}
|
|
2038
|
+
}
|
|
2039
|
+
|
|
2040
|
+
/**
|
|
2041
|
+
* Safely composes rate string (handles small/big rates)
|
|
2042
|
+
*
|
|
2043
|
+
* @param leftTicker {string}
|
|
2044
|
+
* @param rightTicker {string}
|
|
2045
|
+
* @param rate {number|string|BigNumber}
|
|
2046
|
+
* @param [rightCurrencyDigitsAfterDots=8] {number}
|
|
2047
|
+
* @return {string}
|
|
2048
|
+
*/;
|
|
2049
|
+
AmountUtils.composeRateText = function composeRateText(leftTicker, rightTicker, rate, rightCurrencyDigitsAfterDots) {
|
|
2050
|
+
if (rightCurrencyDigitsAfterDots === void 0) {
|
|
2051
|
+
rightCurrencyDigitsAfterDots = this.significantDecimalCount;
|
|
2052
|
+
}
|
|
2053
|
+
try {
|
|
2054
|
+
/* Here we try to calculate a clear rate for the user. The difficulty is that the rate value can be pretty
|
|
2055
|
+
* small as some coins have significantly higher price than the other. For such cases we calculate
|
|
2056
|
+
* not the "1 <coin_A> is X <coin B>" but "Y <coin_A> is X <coin B>" where Y is one of the powers of 100.
|
|
2057
|
+
*/
|
|
2058
|
+
var leftNumber = bignumber_js.BigNumber("1");
|
|
2059
|
+
var multiplier = bignumber_js.BigNumber("100");
|
|
2060
|
+
var maxAttemptsToGetRate = 10;
|
|
2061
|
+
var right = null;
|
|
2062
|
+
var rateBigNumber = bignumber_js.BigNumber(rate);
|
|
2063
|
+
for (var i = 0; i < maxAttemptsToGetRate; ++i) {
|
|
2064
|
+
var rightNumberAttempt = rateBigNumber.times(leftNumber).toFixed(rightCurrencyDigitsAfterDots, bignumber_js.BigNumber.ROUND_FLOOR);
|
|
2065
|
+
if (!bignumber_js.BigNumber(rightNumberAttempt).eq(bignumber_js.BigNumber("0"))) {
|
|
2066
|
+
right = bignumber_js.BigNumber(rightNumberAttempt);
|
|
2067
|
+
break;
|
|
2068
|
+
} else {
|
|
2069
|
+
leftNumber = leftNumber.times(multiplier);
|
|
2070
|
+
}
|
|
2071
|
+
}
|
|
2072
|
+
var leftAmountString = AmountUtils.intStr(leftNumber);
|
|
2073
|
+
var rightAmountString = right != null ? right.toFixed(rightCurrencyDigitsAfterDots, bignumber_js.BigNumber.ROUND_FLOOR) : null;
|
|
2074
|
+
return leftAmountString + " " + leftTicker + " ~ " + (rightAmountString != null ? rightAmountString : "?") + " " + rightTicker;
|
|
2075
|
+
} catch (e) {
|
|
2076
|
+
// eslint-disable-next-line no-console
|
|
2077
|
+
console.log("composeRateText", e);
|
|
2078
|
+
}
|
|
2079
|
+
return "-";
|
|
2080
|
+
}
|
|
2081
|
+
|
|
2082
|
+
/**
|
|
2083
|
+
* @param numberAsAString {string}
|
|
2084
|
+
* @return {string}
|
|
2085
|
+
*/;
|
|
2086
|
+
AmountUtils.removeRedundantRightZerosFromNumberString = function removeRedundantRightZerosFromNumberString(numberAsAString) {
|
|
2087
|
+
try {
|
|
2088
|
+
var _right2;
|
|
2089
|
+
var parts = ("" + numberAsAString).split(".");
|
|
2090
|
+
var right = parts[1];
|
|
2091
|
+
while ((_right = right) != null && _right.length && right[right.length - 1] === "0") {
|
|
2092
|
+
var _right;
|
|
2093
|
+
right = right.slice(0, right.length - 1);
|
|
2094
|
+
}
|
|
2095
|
+
return "" + parts[0] + ((_right2 = right) != null && _right2.length ? "." + right : "");
|
|
2096
|
+
} catch (e) {
|
|
2097
|
+
improveAndRethrow(e, "removeRedundantRightZerosFromNumberString", "Passed: " + numberAsAString);
|
|
2098
|
+
}
|
|
2099
|
+
};
|
|
2100
|
+
return AmountUtils;
|
|
2101
|
+
}();
|
|
2102
|
+
AmountUtils.significantDecimalCount = 8;
|
|
2103
|
+
AmountUtils.collapsedDecimalCount = 2;
|
|
2104
|
+
AmountUtils.maxTotalLength = 12;
|
|
2105
|
+
AmountUtils.extraSmallMaxTotalLength = 9;
|
|
2106
|
+
// >=10 breaks transactions list (mobile) and it is hard to avoid this
|
|
2107
|
+
AmountUtils.periods = "..";
|
|
2108
|
+
AmountUtils.defaultFiatParams = {
|
|
2109
|
+
ticker: true,
|
|
2110
|
+
// If true, currency code will be shown
|
|
2111
|
+
enableCurrencySymbols: true,
|
|
2112
|
+
// Enables currency symbols where available. Requires "ticker: true"
|
|
2113
|
+
collapsible: true,
|
|
2114
|
+
// Enables minimization of amounts over 1 million (example: 1.52M)
|
|
2115
|
+
limitTotalLength: true,
|
|
2116
|
+
// Limits the total amount length to maxTotalLength
|
|
2117
|
+
extraSmallLength: false // Limits the total amount length to extraSmallMaxTotalLength
|
|
2118
|
+
};
|
|
2119
|
+
AmountUtils.defaultCryptoParams = {
|
|
2120
|
+
ticker: true,
|
|
2121
|
+
// If true, asset ticker will be shown
|
|
2122
|
+
collapsible: true,
|
|
2123
|
+
// Enables minimization of amounts over 1 million (example: 1.52M)
|
|
2124
|
+
trim: true,
|
|
2125
|
+
// Cuts the right part of the amount if necessary, and adds ".." in the end
|
|
2126
|
+
limitTotalLength: true,
|
|
2127
|
+
// Limits the total amount length to maxTotalLength
|
|
2128
|
+
extraSmallLength: false,
|
|
2129
|
+
// Limits the total amount length to extraSmallMaxTotalLength
|
|
2130
|
+
periods: true // Whether we add periods ("..") as suffix for trimmed numbers
|
|
2131
|
+
};
|
|
2132
|
+
|
|
2133
|
+
var Blockchain =
|
|
2134
|
+
/**
|
|
2135
|
+
* @param name {string} latin printable name of blockchain
|
|
2136
|
+
* @param supportedProtocols {Protocol[]}
|
|
2137
|
+
*/
|
|
2138
|
+
function Blockchain(name, supportedProtocols) {
|
|
2139
|
+
if (supportedProtocols === void 0) {
|
|
2140
|
+
supportedProtocols = [];
|
|
2141
|
+
}
|
|
2142
|
+
this.name = name;
|
|
2143
|
+
this.supportedProtocols = supportedProtocols;
|
|
2144
|
+
};
|
|
2145
|
+
|
|
2146
|
+
var Protocol = function Protocol(protocolName) {
|
|
2147
|
+
this.protocol = protocolName;
|
|
2148
|
+
};
|
|
2149
|
+
|
|
2150
|
+
/**
|
|
2151
|
+
* The model for cryptocurrency coins.
|
|
2152
|
+
*
|
|
2153
|
+
* WARNING: this class should not be instantiated directly. Use only predefined singleton Coin (or descendants) instances.
|
|
2154
|
+
*/
|
|
2155
|
+
var Coin = /*#__PURE__*/function () {
|
|
2156
|
+
/**
|
|
2157
|
+
* Creates new coin
|
|
2158
|
+
*
|
|
2159
|
+
* @param latinName {string} the coin name in latin symbols like "Bitcoin"
|
|
2160
|
+
* @param ticker {string} the coin symbol/ticker/code like 'BTC'. Always upper case. A unique coin identifier
|
|
2161
|
+
* @param tickerPrintable {string} ticker but in printable format. Useful for tokens based on external blockchains
|
|
2162
|
+
* like ERC20 or TRC20. It is not friendly to display USDTERC20 or BUSDTRC20 - more neat options are just
|
|
2163
|
+
* USDT and BUSD. Note that you should always care about user's understanding of what coin he/she is working
|
|
2164
|
+
* with as printable ticker for USDTERC20 and USDTTRC20 are the same.
|
|
2165
|
+
* @param digitsCountAfterComma {number} count of digits after the comma. E.g. 8 for bitcoin
|
|
2166
|
+
* @param maxValue {number|null} max possible value for cryptocurrency. Null means that the currency has no max possible value
|
|
2167
|
+
* @param atomName {string} name of the coin's atomic value. Like 'satoshi' for bitcoin
|
|
2168
|
+
* @param mainnet {Network} main network for this coin
|
|
2169
|
+
* @param testnet {Network} test network for this coin
|
|
2170
|
+
* @param minConfirmations {number} min confirmations count to treat the coin's transaction confirmed
|
|
2171
|
+
* @param payableEntityStringForFeeRate {string|null} the payable fee entity like byte for bitcoin or gas for ether if present
|
|
2172
|
+
* @param feeOptionsTimeStringsSortedDesc {string[]} array of 4 strings for fee options when sending coins. Should be sorted from the highest time to the smallest
|
|
2173
|
+
* @param feeRatesExpirationTimeMs {number} number of milliseconds to treat the fee rates as expired
|
|
2174
|
+
* @param blockchain {Blockchain} blockchain object
|
|
2175
|
+
* @param [protocol] {Protocol|null} token/coin protocol if relevant
|
|
2176
|
+
* @param [tokenAddress] {string|null} address of contract of this token (if the coin is token)
|
|
2177
|
+
* @param [doesUseLowerCaseAddresses] {boolean} flag to clarify whether we can use lower case addresses to ensure more robust comparisons
|
|
2178
|
+
* @param [doesUseOutputs=false] {boolean} true if this coin uses inputs/outputs concept and false if it uses just balances
|
|
2179
|
+
*/
|
|
2180
|
+
function Coin(latinName, ticker, tickerPrintable, digitsCountAfterComma, maxValue, atomName, mainnet, testnet, minConfirmations, payableEntityStringForFeeRate, feeOptionsTimeStringsSortedDesc, feeRatesExpirationTimeMs, blockchain, protocol, tokenAddress, doesUseLowerCaseAddresses, doesUseOutputs) {
|
|
2181
|
+
if (protocol === void 0) {
|
|
2182
|
+
protocol = null;
|
|
2183
|
+
}
|
|
2184
|
+
if (tokenAddress === void 0) {
|
|
2185
|
+
tokenAddress = null;
|
|
2186
|
+
}
|
|
2187
|
+
if (doesUseLowerCaseAddresses === void 0) {
|
|
2188
|
+
doesUseLowerCaseAddresses = true;
|
|
2189
|
+
}
|
|
2190
|
+
if (doesUseOutputs === void 0) {
|
|
2191
|
+
doesUseOutputs = false;
|
|
2192
|
+
}
|
|
2193
|
+
this.latinName = latinName;
|
|
2194
|
+
this.ticker = ticker;
|
|
2195
|
+
this.tickerPrintable = tickerPrintable;
|
|
2196
|
+
this.digits = digitsCountAfterComma;
|
|
2197
|
+
this.maxValue = maxValue;
|
|
2198
|
+
this.atomName = atomName;
|
|
2199
|
+
this.mainnet = mainnet;
|
|
2200
|
+
this.testnet = testnet;
|
|
2201
|
+
this.minConfirmations = minConfirmations;
|
|
2202
|
+
this.payableEntityStringForFeeRate = payableEntityStringForFeeRate;
|
|
2203
|
+
this.feeOptionsTimeStringsSortedDesc = feeOptionsTimeStringsSortedDesc;
|
|
2204
|
+
this.feeRatesExpirationTimeMs = feeRatesExpirationTimeMs;
|
|
2205
|
+
this.protocol = protocol;
|
|
2206
|
+
this.blockchain = blockchain;
|
|
2207
|
+
// TODO: [bug, critical] use testnet property for testnet contract address as it blocks the app work in testnets
|
|
2208
|
+
this.tokenAddress = tokenAddress;
|
|
2209
|
+
this.feeCoin = this;
|
|
2210
|
+
this._significantDigits = 8;
|
|
2211
|
+
this.doesUseLowerCaseAddresses = doesUseLowerCaseAddresses;
|
|
2212
|
+
this.doesUseOutputs = doesUseOutputs;
|
|
2213
|
+
}
|
|
2214
|
+
|
|
2215
|
+
/**
|
|
2216
|
+
* Sets fee coin
|
|
2217
|
+
*
|
|
2218
|
+
* @param feeCoin {Coin} some tokens use another coin to charge transaction fee as they work on top of some external
|
|
2219
|
+
* blockchain. So pass here the coin the token uses for fee charging. Like for ERC20 token the fee coin is ETH.
|
|
2220
|
+
* By default, the creating coin will be set as a value for this field.
|
|
2221
|
+
*/
|
|
2222
|
+
var _proto = Coin.prototype;
|
|
2223
|
+
_proto.setFeeCoin = function setFeeCoin(feeCoin) {
|
|
2224
|
+
this.feeCoin = feeCoin;
|
|
2225
|
+
}
|
|
2226
|
+
|
|
2227
|
+
/**
|
|
2228
|
+
* Checks whether this coin uses another coin (blockchain) to charge fee for transactions (means works on base of
|
|
2229
|
+
* some external blockchain).
|
|
2230
|
+
*
|
|
2231
|
+
* @return {boolean} true if this coin uses external blockchain to perform transactions and charge fee
|
|
2232
|
+
*/;
|
|
2233
|
+
_proto.doesUseDifferentCoinFee = function doesUseDifferentCoinFee() {
|
|
2234
|
+
return this.feeCoin !== this;
|
|
2235
|
+
}
|
|
2236
|
+
|
|
2237
|
+
/**
|
|
2238
|
+
* Converts the given atoms string/number to string representing the same amount in coin itself - floating point number
|
|
2239
|
+
*
|
|
2240
|
+
* @param atoms {string} atoms positive integer amount
|
|
2241
|
+
* @return {string} coin amount floating point number as a string
|
|
2242
|
+
*/;
|
|
2243
|
+
_proto.atomsToCoinAmount = function atomsToCoinAmount(atoms) {
|
|
2244
|
+
throw new Error("Not implemented in base Coin");
|
|
2245
|
+
}
|
|
2246
|
+
|
|
2247
|
+
/**
|
|
2248
|
+
* Converts the given coins amount string/number to string representing the same amount in coin atoms - integer number
|
|
2249
|
+
*
|
|
2250
|
+
* @param coinsAmount {string} coins positive floating point amount
|
|
2251
|
+
* @return {string} coin atoms amount integer number as a string
|
|
2252
|
+
*/;
|
|
2253
|
+
_proto.coinAmountToAtoms = function coinAmountToAtoms(coinsAmount) {
|
|
2254
|
+
throw new Error("Not implemented in base Coin");
|
|
2255
|
+
}
|
|
2256
|
+
|
|
2257
|
+
/**
|
|
2258
|
+
* Composes URL to view the tx with given id in the external blockchain explorer
|
|
2259
|
+
*
|
|
2260
|
+
* @param txId {string} id of transaction
|
|
2261
|
+
* @return {string} URL string
|
|
2262
|
+
*/;
|
|
2263
|
+
_proto.composeUrlToTransactionExplorer = function composeUrlToTransactionExplorer(txId) {
|
|
2264
|
+
throw new Error("Not implemented in base Coin");
|
|
2265
|
+
}
|
|
2266
|
+
|
|
2267
|
+
/**
|
|
2268
|
+
* Most of the cryptocurrencies has specific fee rate or fee price metric. This value usually has specific measure
|
|
2269
|
+
* like satoshi/byte or gWei/gas. This function adds the described denomination string to the given amount
|
|
2270
|
+
* as a suffix and returns the result string ready to be show to a user.
|
|
2271
|
+
*
|
|
2272
|
+
* @param coinAtomsString {string} coin atoms positive integer amount
|
|
2273
|
+
* @return {string} string of coin amount and fee rate units
|
|
2274
|
+
*/;
|
|
2275
|
+
_proto.coinAtomsFeeRateToCommonlyUsedAmountFormatWithDenominationString = function coinAtomsFeeRateToCommonlyUsedAmountFormatWithDenominationString(coinAtomsString) {
|
|
2276
|
+
throw new Error("Not implemented in base Coin");
|
|
2277
|
+
}
|
|
2278
|
+
|
|
2279
|
+
/**
|
|
2280
|
+
* Check whether this coin support transaction prioritisation during the sending process.
|
|
2281
|
+
*
|
|
2282
|
+
* @return {boolean} true if support transaction prioritisation and false otherwise
|
|
2283
|
+
*/;
|
|
2284
|
+
_proto.doesSupportTransactionPrioritisation = function doesSupportTransactionPrioritisation() {
|
|
2285
|
+
return Array.isArray(this.feeOptionsTimeStringsSortedDesc);
|
|
2286
|
+
};
|
|
2287
|
+
_proto.tickerAndProtocol = function tickerAndProtocol() {
|
|
2288
|
+
try {
|
|
2289
|
+
var _ref;
|
|
2290
|
+
return "" + this.tickerPrintable + (this.protocol ? (_ref = " " + this.protocol.protocol) != null ? _ref : "" : "");
|
|
2291
|
+
} catch (e) {
|
|
2292
|
+
improveAndRethrow(e, "tickerAndProtocol");
|
|
2293
|
+
}
|
|
2294
|
+
};
|
|
2295
|
+
return Coin;
|
|
2296
|
+
}();
|
|
2297
|
+
|
|
2298
|
+
/**
|
|
2299
|
+
* TODO: [tests, critical] Ued by payments logic
|
|
2300
|
+
*
|
|
2301
|
+
* Simple cache based on Map.
|
|
2302
|
+
* Provides ability to store event-dependent data.
|
|
2303
|
+
*/
|
|
2304
|
+
var Cache = /*#__PURE__*/function () {
|
|
2305
|
+
/**
|
|
2306
|
+
* @param eventBus {EventBus} EventBus.js lib instance
|
|
2307
|
+
* @param [noSessionEvents=[]] {string[]} array of events that will be treated as "no session"
|
|
2308
|
+
*/
|
|
2309
|
+
function Cache(eventBus, noSessionEvents) {
|
|
2310
|
+
if (noSessionEvents === void 0) {
|
|
2311
|
+
noSessionEvents = [];
|
|
2312
|
+
}
|
|
2313
|
+
this._cache = new Map();
|
|
2314
|
+
this._eventDependentDataKeys = [];
|
|
2315
|
+
this._noSessionEvents = noSessionEvents;
|
|
2316
|
+
this._eventBus = eventBus;
|
|
2317
|
+
}
|
|
2318
|
+
var _proto = Cache.prototype;
|
|
2319
|
+
_proto._setupIntervalClearingExpired = function _setupIntervalClearingExpired() {
|
|
2320
|
+
var cleaner = function cleaner() {
|
|
2321
|
+
try {
|
|
2322
|
+
for (var _iterator = _createForOfIteratorHelperLoose(this._cache.keys()), _step; !(_step = _iterator()).done;) {
|
|
2323
|
+
var key = _step.value;
|
|
2324
|
+
var item = this._cache.get(key);
|
|
2325
|
+
if (item && item.ttlMs && item.addedMsTimestamp + item.ttlMs < Date.now()) {
|
|
2326
|
+
this._cache["delete"](key);
|
|
2327
|
+
}
|
|
2328
|
+
}
|
|
2329
|
+
} catch (e) {
|
|
2330
|
+
improveAndRethrow(e, "_intervalClearingExpiredCache");
|
|
2331
|
+
}
|
|
2332
|
+
};
|
|
2333
|
+
cleaner = cleaner.bind(this);
|
|
2334
|
+
setInterval(cleaner, 1000);
|
|
2335
|
+
}
|
|
2336
|
+
|
|
2337
|
+
/**
|
|
2338
|
+
* Puts data to cache
|
|
2339
|
+
*
|
|
2340
|
+
* @param key {string} string key for this data
|
|
2341
|
+
* @param data {any} any data
|
|
2342
|
+
* @param ttlMs {number|null} optional milliseconds number for cache lifetime
|
|
2343
|
+
* @throws {Error} when the data is null/undefined because these values for data are reserved for internal logic
|
|
2344
|
+
*/;
|
|
2345
|
+
_proto.put = function put(key, data, ttlMs) {
|
|
2346
|
+
if (ttlMs === void 0) {
|
|
2347
|
+
ttlMs = null;
|
|
2348
|
+
}
|
|
2349
|
+
try {
|
|
2350
|
+
if (typeof key !== "string" || data == null) {
|
|
2351
|
+
throw new Error("Trying to cache corrupted data: " + key + ", " + data);
|
|
2352
|
+
}
|
|
2353
|
+
this._cache.set(key, {
|
|
2354
|
+
data: data,
|
|
2355
|
+
addedMsTimestamp: Date.now(),
|
|
2356
|
+
ttlMs: ttlMs
|
|
2357
|
+
});
|
|
2358
|
+
} catch (e) {
|
|
2359
|
+
improveAndRethrow(e, "cache.put");
|
|
2360
|
+
}
|
|
2361
|
+
};
|
|
2362
|
+
_proto.putSessionDependentData = function putSessionDependentData(key, data, ttlMs) {
|
|
2363
|
+
if (ttlMs === void 0) {
|
|
2364
|
+
ttlMs = null;
|
|
2365
|
+
}
|
|
2366
|
+
this._putEventDependentData(key, data, this._noSessionEvents, ttlMs);
|
|
2367
|
+
}
|
|
2368
|
+
|
|
2369
|
+
/**
|
|
2370
|
+
* Puts data to cache and adds its key to list of keys that should be related by each of given events.
|
|
2371
|
+
*
|
|
2372
|
+
* @param key {string} key for cache
|
|
2373
|
+
* @param data {any} any caching data
|
|
2374
|
+
* @param events {string[]} list of events forcing putting data to be removed when triggered
|
|
2375
|
+
* @param ttlMs {|null} optional time to live for this cache item
|
|
2376
|
+
* @throws {Error} when the data is null/undefined because these values for data are reserved for internal logic
|
|
2377
|
+
*/;
|
|
2378
|
+
_proto.putEventDependentData = function putEventDependentData(key, data, events, ttlMs) {
|
|
2379
|
+
if (ttlMs === void 0) {
|
|
2380
|
+
ttlMs = null;
|
|
2381
|
+
}
|
|
2382
|
+
this._putEventDependentData(key, data, events, ttlMs);
|
|
2383
|
+
};
|
|
2384
|
+
_proto._putEventDependentData = function _putEventDependentData(key, data, events, ttlMs) {
|
|
2385
|
+
var _this = this;
|
|
2386
|
+
if (ttlMs === void 0) {
|
|
2387
|
+
ttlMs = null;
|
|
2388
|
+
}
|
|
2389
|
+
try {
|
|
2390
|
+
if (typeof key !== "string" || data == null) {
|
|
2391
|
+
throw new Error("Trying to cache corrupted data: " + key + ", " + data);
|
|
2392
|
+
}
|
|
2393
|
+
this._cache.set(key, {
|
|
2394
|
+
data: data,
|
|
2395
|
+
addedMsTimestamp: Date.now(),
|
|
2396
|
+
ttlMs: ttlMs
|
|
2397
|
+
});
|
|
2398
|
+
var _loop = function _loop() {
|
|
2399
|
+
var event = _step2.value;
|
|
2400
|
+
var eventAndKeys = _this._eventDependentDataKeys.find(function (item) {
|
|
2401
|
+
return item[0] === event;
|
|
2402
|
+
});
|
|
2403
|
+
if (eventAndKeys) {
|
|
2404
|
+
eventAndKeys.push(key);
|
|
2405
|
+
} else {
|
|
2406
|
+
_this._eventDependentDataKeys.push([event, key]);
|
|
2407
|
+
_this._eventBus.addEventListener(event, function () {
|
|
2408
|
+
try {
|
|
2409
|
+
var keys = _this._eventDependentDataKeys.find(function (item) {
|
|
2410
|
+
return item[0] === event;
|
|
2411
|
+
});
|
|
2412
|
+
(keys != null ? keys : [event]).slice(1).forEach(function (key) {
|
|
2413
|
+
return _this._cache["delete"](key);
|
|
2414
|
+
});
|
|
2415
|
+
} catch (e) {
|
|
2416
|
+
Logger.logError(e, "cache.removing-for-event", "Event: " + event);
|
|
2417
|
+
}
|
|
2418
|
+
});
|
|
2419
|
+
}
|
|
2420
|
+
};
|
|
2421
|
+
for (var _iterator2 = _createForOfIteratorHelperLoose(events), _step2; !(_step2 = _iterator2()).done;) {
|
|
2422
|
+
_loop();
|
|
2423
|
+
}
|
|
2424
|
+
} catch (e) {
|
|
2425
|
+
improveAndRethrow(e, "cache.putEventDependentData");
|
|
2426
|
+
}
|
|
2427
|
+
}
|
|
2428
|
+
|
|
2429
|
+
// TODO: [feature, low] add clearing of expired data by schedule
|
|
2430
|
+
;
|
|
2431
|
+
_proto.get = function get(key) {
|
|
2432
|
+
try {
|
|
2433
|
+
var item = this._cache.get(key);
|
|
2434
|
+
if (item) {
|
|
2435
|
+
if (item.addedMsTimestamp && item.ttlMs !== null && item.addedMsTimestamp + item.ttlMs < Date.now()) {
|
|
2436
|
+
this._cache["delete"](key);
|
|
2437
|
+
return null;
|
|
2438
|
+
} else {
|
|
2439
|
+
return item.data;
|
|
2440
|
+
}
|
|
2441
|
+
}
|
|
2442
|
+
return null;
|
|
2443
|
+
} catch (e) {
|
|
2444
|
+
improveAndRethrow(e, "cache.get");
|
|
2445
|
+
}
|
|
2446
|
+
};
|
|
2447
|
+
_proto.getLastUpdateTimestamp = function getLastUpdateTimestamp(key) {
|
|
2448
|
+
var _this$_cache$get$adde, _this$_cache$get;
|
|
2449
|
+
return (_this$_cache$get$adde = (_this$_cache$get = this._cache.get(key)) == null ? void 0 : _this$_cache$get.addedMsTimestamp) != null ? _this$_cache$get$adde : null;
|
|
2450
|
+
}
|
|
2451
|
+
|
|
2452
|
+
/**
|
|
2453
|
+
* Updates the timestamp of the last update for specified key to the provided value.
|
|
2454
|
+
* Can be useful when TTL is controlled outside this class.
|
|
2455
|
+
*
|
|
2456
|
+
* @param key {string}
|
|
2457
|
+
* @param timestamp {number}
|
|
2458
|
+
* @return {boolean}
|
|
2459
|
+
*/;
|
|
2460
|
+
_proto.setLastUpdateTimestamp = function setLastUpdateTimestamp(key, timestamp) {
|
|
2461
|
+
try {
|
|
2462
|
+
var item = this._cache.get(key);
|
|
2463
|
+
if (item != null && typeof timestamp === "number") {
|
|
2464
|
+
this._cache.set(key, _extends({}, item, {
|
|
2465
|
+
addedTimestampMs: timestamp
|
|
2466
|
+
}));
|
|
2467
|
+
return true;
|
|
2468
|
+
}
|
|
2469
|
+
return false;
|
|
2470
|
+
} catch (e) {
|
|
2471
|
+
improveAndRethrow("cache.setLastUpdateTimestamp");
|
|
2472
|
+
}
|
|
2473
|
+
};
|
|
2474
|
+
_proto.invalidate = function invalidate(key) {
|
|
2475
|
+
try {
|
|
2476
|
+
this._cache["delete"](key);
|
|
2477
|
+
} catch (e) {
|
|
2478
|
+
improveAndRethrow(e, "cache.invalidate");
|
|
2479
|
+
}
|
|
2480
|
+
};
|
|
2481
|
+
_proto.invalidateContaining = function invalidateContaining(keyPart) {
|
|
2482
|
+
if (typeof keyPart !== "string" || keyPart === "") {
|
|
2483
|
+
throw new Error("Trying to invalidate containing wrong key or empty key: " + keyPart);
|
|
2484
|
+
}
|
|
2485
|
+
try {
|
|
2486
|
+
var matchedKeys = Array.from(this._cache.keys()).filter(function (key) {
|
|
2487
|
+
return typeof key === "string" && new RegExp(keyPart).test(key);
|
|
2488
|
+
});
|
|
2489
|
+
for (var i = 0; i < matchedKeys.length; ++i) {
|
|
2490
|
+
this._cache["delete"](matchedKeys[i]);
|
|
2491
|
+
}
|
|
2492
|
+
} catch (e) {
|
|
2493
|
+
improveAndRethrow(e, "invalidateContaining");
|
|
2494
|
+
}
|
|
2495
|
+
};
|
|
2496
|
+
_proto.clear = function clear() {
|
|
2497
|
+
this._cache.clear();
|
|
2498
|
+
this._sessionDependentDataKeys = [];
|
|
2499
|
+
}
|
|
2500
|
+
|
|
2501
|
+
/**
|
|
2502
|
+
* Saves given data string to persistent cache.
|
|
2503
|
+
* NOTE: we have no TTL here, implement if needed.
|
|
2504
|
+
*
|
|
2505
|
+
* WARNING: use only when really needed and don't store big data as we use localStorage
|
|
2506
|
+
* under the hood and its capacity is restricted.
|
|
2507
|
+
*
|
|
2508
|
+
* @param uniqueKey {string} the key should be unique
|
|
2509
|
+
* @param data {string} only string data allowed
|
|
2510
|
+
*/;
|
|
2511
|
+
_proto.putClientPersistentData = function putClientPersistentData(uniqueKey, data) {
|
|
2512
|
+
try {
|
|
2513
|
+
if (typeof window !== "undefined") {
|
|
2514
|
+
localStorage.setItem(uniqueKey, data);
|
|
2515
|
+
}
|
|
2516
|
+
} catch (e) {
|
|
2517
|
+
improveAndRethrow(e, "cache.putClientPersistentData");
|
|
2518
|
+
}
|
|
2519
|
+
}
|
|
2520
|
+
|
|
2521
|
+
/**
|
|
2522
|
+
* @param uniqueKey {string}
|
|
2523
|
+
* @return {string|null}
|
|
2524
|
+
*/;
|
|
2525
|
+
_proto.getClientPersistentData = function getClientPersistentData(uniqueKey) {
|
|
2526
|
+
try {
|
|
2527
|
+
if (typeof window !== "undefined") {
|
|
2528
|
+
return localStorage.getItem(uniqueKey);
|
|
2529
|
+
}
|
|
2530
|
+
return null;
|
|
2531
|
+
} catch (e) {
|
|
2532
|
+
improveAndRethrow(e, "cache.getClientPersistentData");
|
|
2533
|
+
}
|
|
2534
|
+
}
|
|
2535
|
+
|
|
2536
|
+
/**
|
|
2537
|
+
* Only makes effect if the TTL is not null.
|
|
2538
|
+
*
|
|
2539
|
+
* @param key {string}
|
|
2540
|
+
* @param ttlMs {number|null}
|
|
2541
|
+
*/;
|
|
2542
|
+
_proto.markCacheItemAsExpiredButDontRemove = function markCacheItemAsExpiredButDontRemove(key, ttlMs) {
|
|
2543
|
+
if (ttlMs === void 0) {
|
|
2544
|
+
ttlMs = null;
|
|
2545
|
+
}
|
|
2546
|
+
try {
|
|
2547
|
+
var _ttlMs;
|
|
2548
|
+
var item = this._cache.get(key);
|
|
2549
|
+
var ttlFinalMs = (_ttlMs = ttlMs) != null ? _ttlMs : item == null ? void 0 : item.ttlMs;
|
|
2550
|
+
if (item != null && ttlFinalMs) {
|
|
2551
|
+
this._cache.set(key, {
|
|
2552
|
+
data: item.data,
|
|
2553
|
+
addedMsTimestamp: Date.now() - ttlFinalMs - 1,
|
|
2554
|
+
ttlMs: ttlFinalMs
|
|
2555
|
+
});
|
|
2556
|
+
}
|
|
2557
|
+
} catch (e) {
|
|
2558
|
+
improveAndRethrow(e, "cache.markCacheItemAsExpiredButDontRemove");
|
|
2559
|
+
}
|
|
2560
|
+
};
|
|
2561
|
+
return Cache;
|
|
2562
|
+
}();
|
|
2563
|
+
|
|
2564
|
+
function _catch$3(body, recover) {
|
|
2565
|
+
try {
|
|
2566
|
+
var result = body();
|
|
2567
|
+
} catch (e) {
|
|
2568
|
+
return recover(e);
|
|
2569
|
+
}
|
|
2570
|
+
if (result && result.then) {
|
|
2571
|
+
return result.then(void 0, recover);
|
|
2572
|
+
}
|
|
2573
|
+
return result;
|
|
2574
|
+
}
|
|
2575
|
+
var EmailsApi = /*#__PURE__*/function () {
|
|
2576
|
+
function EmailsApi() {}
|
|
2577
|
+
EmailsApi.sendEmail = function sendEmail(subject, body) {
|
|
2578
|
+
try {
|
|
2579
|
+
var _this = this;
|
|
2580
|
+
var _temp = _catch$3(function () {
|
|
2581
|
+
var url = window.location.protocol + "//" + window.location.host + "/api/v1/" + _this.serverEndpointEntity;
|
|
2582
|
+
return Promise.resolve(axios__default["default"].post(url, {
|
|
2583
|
+
subject: subject,
|
|
2584
|
+
body: body
|
|
2585
|
+
})).then(function () {});
|
|
2586
|
+
}, function (e) {
|
|
2587
|
+
improveAndRethrow(e, "sendEmail", subject + body);
|
|
2588
|
+
});
|
|
2589
|
+
return Promise.resolve(_temp && _temp.then ? _temp.then(function () {}) : void 0);
|
|
2590
|
+
} catch (e) {
|
|
2591
|
+
return Promise.reject(e);
|
|
2592
|
+
}
|
|
2593
|
+
};
|
|
2594
|
+
return EmailsApi;
|
|
2595
|
+
}();
|
|
2596
|
+
EmailsApi.serverEndpointEntity = "emails";
|
|
2597
|
+
|
|
2598
|
+
var ExistingSwap =
|
|
2599
|
+
/**
|
|
2600
|
+
* @param swapId {string}
|
|
2601
|
+
* @param status {SwapProvider.SWAP_STATUSES}
|
|
2602
|
+
* @param createdAt {number}
|
|
2603
|
+
* @param expiresAt {number}
|
|
2604
|
+
* @param confirmations {number}
|
|
2605
|
+
* @param rate {string}
|
|
2606
|
+
* @param refundAddress {string}
|
|
2607
|
+
* @param fromCoin {Coin}
|
|
2608
|
+
* @param fromAmount {string}
|
|
2609
|
+
* @param fromTransactionId {string}
|
|
2610
|
+
* @param toCoin {Coin}
|
|
2611
|
+
* @param toAmount {string}
|
|
2612
|
+
* @param toTransactionId {string|null}
|
|
2613
|
+
* @param toAddress {string}
|
|
2614
|
+
* @param partner {string}
|
|
2615
|
+
*/
|
|
2616
|
+
function ExistingSwap(swapId, status, createdAt, expiresAt, confirmations, rate, refundAddress, payToAddress, fromCoin, fromAmount, fromTransactionId, fromTransactionLink, toCoin, toAmount, toTransactionId, toTransactionLink, toAddress,
|
|
2617
|
+
// TODO: [refactoring, moderate] toAddress is not quite clear. How about recipientAddress? task_id=0815a111c99543b78d374217eadbde4f
|
|
2618
|
+
partner) {
|
|
2619
|
+
this.swapId = swapId;
|
|
2620
|
+
this.status = status;
|
|
2621
|
+
this.createdAt = createdAt;
|
|
2622
|
+
this.expiresAt = expiresAt;
|
|
2623
|
+
this.confirmations = confirmations;
|
|
2624
|
+
this.rate = rate;
|
|
2625
|
+
this.refundAddress = refundAddress;
|
|
2626
|
+
this.payToAddress = payToAddress;
|
|
2627
|
+
this.fromCoin = fromCoin;
|
|
2628
|
+
this.fromTransactionId = fromTransactionId;
|
|
2629
|
+
this.fromAmount = fromAmount;
|
|
2630
|
+
this.fromTransactionLink = fromTransactionLink;
|
|
2631
|
+
this.toCoin = toCoin;
|
|
2632
|
+
this.toTransactionId = toTransactionId;
|
|
2633
|
+
this.toTransactionLink = toTransactionLink;
|
|
2634
|
+
this.toAmount = toAmount;
|
|
2635
|
+
this.toAddress = toAddress;
|
|
2636
|
+
this.partner = partner;
|
|
2637
|
+
};
|
|
2638
|
+
|
|
2639
|
+
var ExistingSwapWithFiatData = /*#__PURE__*/function (_ExistingSwap) {
|
|
2640
|
+
_inheritsLoose(ExistingSwapWithFiatData, _ExistingSwap);
|
|
2641
|
+
/**
|
|
2642
|
+
* @param swapId {string}
|
|
2643
|
+
* @param status {SwapProvider.SWAP_STATUSES}
|
|
2644
|
+
* @param createdAt {number}
|
|
2645
|
+
* @param expiresAt {number}
|
|
2646
|
+
* @param confirmations {number}
|
|
2647
|
+
* @param rate {string}
|
|
2648
|
+
* @param refundAddress {string}
|
|
2649
|
+
* @param fromCoin {Coin}
|
|
2650
|
+
* @param fromAmount {string}
|
|
2651
|
+
* @param fromTransactionId {string}
|
|
2652
|
+
* @param toCoin {Coin}
|
|
2653
|
+
* @param toAmount {string}
|
|
2654
|
+
* @param toTransactionId {string|null}
|
|
2655
|
+
* @param toAddress {string}
|
|
2656
|
+
* @param partner {string}
|
|
2657
|
+
* @param fromAmountFiat {number}
|
|
2658
|
+
* @param toAmountFiat {number}
|
|
2659
|
+
* @param fiatCurrencyCode {string}
|
|
2660
|
+
* @param fiatCurrencyDecimals {number}
|
|
2661
|
+
*/
|
|
2662
|
+
function ExistingSwapWithFiatData(swapId, status, createdAt, expiresAt, confirmations, rate, refundAddress, payToAddress, fromCoin, fromAmount, fromTransactionId, fromTransactionLink, toCoin, toAmount, toTransactionId, toTransactionLink, toAddress, partner, fromAmountFiat, toAmountFiat, fiatCurrencyCode, fiatCurrencyDecimals) {
|
|
2663
|
+
var _this;
|
|
2664
|
+
_this = _ExistingSwap.call(this, swapId, status, createdAt, expiresAt, confirmations, rate, refundAddress, payToAddress, fromCoin, fromAmount, fromTransactionId, fromTransactionLink, toCoin, toAmount, toTransactionId, toTransactionLink, toAddress, partner) || this;
|
|
2665
|
+
_this.fromAmountFiat = fromAmountFiat;
|
|
2666
|
+
_this.toAmountFiat = toAmountFiat;
|
|
2667
|
+
_this.fiatCurrencyCode = fiatCurrencyCode;
|
|
2668
|
+
_this.fiatCurrencyDecimals = fiatCurrencyDecimals;
|
|
2669
|
+
return _this;
|
|
2670
|
+
}
|
|
2671
|
+
|
|
2672
|
+
/**
|
|
2673
|
+
* @param existingSwap {ExistingSwap}
|
|
2674
|
+
* @param fromAmountFiat {number}
|
|
2675
|
+
* @param toAmountFiat {number}
|
|
2676
|
+
* @param fiatCurrencyCode {string}
|
|
2677
|
+
* @param fiatCurrencyDecimals {number}
|
|
2678
|
+
* @return {ExistingSwapWithFiatData}
|
|
2679
|
+
*/
|
|
2680
|
+
ExistingSwapWithFiatData.fromExistingSwap = function fromExistingSwap(existingSwap, fromAmountFiat, toAmountFiat, fiatCurrencyCode, fiatCurrencyDecimals) {
|
|
2681
|
+
return new ExistingSwapWithFiatData(existingSwap.swapId, existingSwap.status, existingSwap.createdAt, existingSwap.expiresAt, existingSwap.confirmations, existingSwap.rate, existingSwap.refundAddress, existingSwap.payToAddress, existingSwap.fromCoin, existingSwap.fromAmount, existingSwap.fromTransactionId, existingSwap.fromTransactionLink, existingSwap.toCoin, existingSwap.toAmount, existingSwap.toTransactionId, existingSwap.toTransactionLink, existingSwap.toAddress, existingSwap.partner, fromAmountFiat, toAmountFiat, fiatCurrencyCode, fiatCurrencyDecimals);
|
|
2682
|
+
};
|
|
2683
|
+
return ExistingSwapWithFiatData;
|
|
2684
|
+
}(ExistingSwap);
|
|
2685
|
+
|
|
2686
|
+
var BaseSwapCreationInfo =
|
|
2687
|
+
/**
|
|
2688
|
+
* @param fromCoin {Coin}
|
|
2689
|
+
* @param toCoin {Coin}
|
|
2690
|
+
* @param fromAmountCoins {string}
|
|
2691
|
+
* @param toAmountCoins {string}
|
|
2692
|
+
* @param rate {string}
|
|
2693
|
+
* @param rawSwapData {Object}
|
|
2694
|
+
* @param min {string}
|
|
2695
|
+
* @param fiatMin {number}
|
|
2696
|
+
* @param max {string}
|
|
2697
|
+
* @param fiatMax {number}
|
|
2698
|
+
* @param durationMinutesRange {string}
|
|
2699
|
+
*/
|
|
2700
|
+
function BaseSwapCreationInfo(fromCoin, toCoin, fromAmountCoins, toAmountCoins, rate, rawSwapData, min, fiatMin, max, fiatMax, durationMinutesRange) {
|
|
2701
|
+
this.fromCoin = fromCoin;
|
|
2702
|
+
this.toCoin = toCoin;
|
|
2703
|
+
this.fromAmountCoins = fromAmountCoins;
|
|
2704
|
+
this.toAmountCoins = toAmountCoins;
|
|
2705
|
+
this.rate = rate;
|
|
2706
|
+
this.rawSwapData = rawSwapData;
|
|
2707
|
+
this.min = min;
|
|
2708
|
+
this.fiatMin = fiatMin;
|
|
2709
|
+
this.max = max;
|
|
2710
|
+
this.fiatMax = fiatMax;
|
|
2711
|
+
this.durationMinutesRange = durationMinutesRange;
|
|
2712
|
+
};
|
|
2713
|
+
|
|
2714
|
+
var SwapProvider = /*#__PURE__*/function () {
|
|
2715
|
+
function SwapProvider() {}
|
|
2716
|
+
var _proto = SwapProvider.prototype;
|
|
2717
|
+
/**
|
|
2718
|
+
* @return {Promise<void>}
|
|
2719
|
+
*/
|
|
2720
|
+
_proto.initialize = function initialize() {
|
|
2721
|
+
try {
|
|
2722
|
+
throw new Error("Not implemented in base");
|
|
2723
|
+
} catch (e) {
|
|
2724
|
+
return Promise.reject(e);
|
|
2725
|
+
}
|
|
2726
|
+
}
|
|
2727
|
+
/**
|
|
2728
|
+
* @return {number} milliseconds TTL
|
|
2729
|
+
*/
|
|
2730
|
+
;
|
|
2731
|
+
_proto.getSwapCreationInfoTtlMs = function getSwapCreationInfoTtlMs() {
|
|
2732
|
+
throw new Error("Not implemented in base");
|
|
2733
|
+
}
|
|
2734
|
+
|
|
2735
|
+
/**
|
|
2736
|
+
* Retrieves all deposit currencies supported by this swap provider.
|
|
2737
|
+
* Returns one of SwapProvider.COMMON_ERRORS in case of processable fail.
|
|
2738
|
+
*
|
|
2739
|
+
* @return {Promise<({ result: true, coins: Coin[] }|{ result: false, reason: string })>}
|
|
2740
|
+
*/;
|
|
2741
|
+
_proto.getDepositCurrencies = function getDepositCurrencies() {
|
|
2742
|
+
try {
|
|
2743
|
+
throw new Error("Not implemented in base");
|
|
2744
|
+
} catch (e) {
|
|
2745
|
+
return Promise.reject(e);
|
|
2746
|
+
}
|
|
2747
|
+
}
|
|
2748
|
+
/**
|
|
2749
|
+
* Retrieves all withdrawable currencies supported by this swap provider.
|
|
2750
|
+
* Returns one of SwapProvider.COMMON_ERRORS in case of processable fail.
|
|
2751
|
+
*
|
|
2752
|
+
* @param [exceptCurrency=null] {Coin|null}
|
|
2753
|
+
* @return {Promise<({ result: true, coins: Coin[] }|{ result: false, reason: string })>}
|
|
2754
|
+
*/
|
|
2755
|
+
;
|
|
2756
|
+
_proto.getWithdrawalCurrencies = function getWithdrawalCurrencies(exceptCurrency) {
|
|
2757
|
+
try {
|
|
2758
|
+
throw new Error("Not implemented in base");
|
|
2759
|
+
} catch (e) {
|
|
2760
|
+
return Promise.reject(e);
|
|
2761
|
+
}
|
|
2762
|
+
}
|
|
2763
|
+
/**
|
|
2764
|
+
* Retrieves URL for coin icon or fallback if not found.
|
|
2765
|
+
*
|
|
2766
|
+
* @param coin {Coin|string} coin or rabbit-format of coin ticker
|
|
2767
|
+
* @return {string}
|
|
2768
|
+
*/
|
|
2769
|
+
;
|
|
2770
|
+
_proto.getIconUrl = function getIconUrl(coin) {
|
|
2771
|
+
throw new Error("Not implemented in base");
|
|
2772
|
+
}
|
|
2773
|
+
|
|
2774
|
+
/**
|
|
2775
|
+
* Retrieves coin to USDT rate.
|
|
2776
|
+
*
|
|
2777
|
+
* @param coin {Coin}
|
|
2778
|
+
* @return {{result: true, rate: string}|{result: false}}
|
|
2779
|
+
*/;
|
|
2780
|
+
_proto.getCoinToUSDTRate = function getCoinToUSDTRate(coin) {
|
|
2781
|
+
try {
|
|
2782
|
+
throw new Error("Not implemented in base");
|
|
2783
|
+
} catch (e) {
|
|
2784
|
+
return Promise.reject(e);
|
|
2785
|
+
}
|
|
2786
|
+
}
|
|
2787
|
+
/**
|
|
2788
|
+
* Retrieves estimation for swapping giving coins amount.
|
|
2789
|
+
* null min or max signals there is no corresponding limitation. undefined means that the limits were not retrieved.
|
|
2790
|
+
* For fail result on of SwapProvider.NO_SWAPS_REASONS or SwapProvider.COMMON_ERRORS reasons will be returned.
|
|
2791
|
+
*
|
|
2792
|
+
* @param fromCoin {Coin}
|
|
2793
|
+
* @param toCoin {Coin}
|
|
2794
|
+
* @param amountCoins {string}
|
|
2795
|
+
* @param [fromCoinToUsdRate=null] pass if you want to increase the min amount returned
|
|
2796
|
+
* by provider with some fixed "insurance" amount to cover min amount fluctuations.
|
|
2797
|
+
* @return {Promise<({
|
|
2798
|
+
* result: false,
|
|
2799
|
+
* reason: string,
|
|
2800
|
+
* smallestMin: (string|null|undefined),
|
|
2801
|
+
* greatestMax: (string|null|undefined),
|
|
2802
|
+
* }|{
|
|
2803
|
+
* result: true,
|
|
2804
|
+
* min: (string|null),
|
|
2805
|
+
* max: (string|null),
|
|
2806
|
+
* smallestMin: (string|null),
|
|
2807
|
+
* greatestMax: (string|null),
|
|
2808
|
+
* rate: (string|null),
|
|
2809
|
+
* durationMinutesRange: string,
|
|
2810
|
+
* [rawSwapData]: Object
|
|
2811
|
+
* })>}
|
|
2812
|
+
*/
|
|
2813
|
+
;
|
|
2814
|
+
_proto.getSwapInfo = function getSwapInfo(fromCoin, toCoin, amountCoins, fromCoinToUsdRate) {
|
|
2815
|
+
try {
|
|
2816
|
+
throw new Error("Not implemented in base");
|
|
2817
|
+
} catch (e) {
|
|
2818
|
+
return Promise.reject(e);
|
|
2819
|
+
}
|
|
2820
|
+
}
|
|
2821
|
+
/**
|
|
2822
|
+
* For fail result we return one of SwapProvider.CREATION_FAIL_REASONS or SwapProvider.COMMON_ERRORS.
|
|
2823
|
+
*
|
|
2824
|
+
* @param fromCoin {Coin}
|
|
2825
|
+
* @param toCoin {Coin}
|
|
2826
|
+
* @param amount {string}
|
|
2827
|
+
* @param toAddress {string}
|
|
2828
|
+
* @param refundAddress {string}
|
|
2829
|
+
* @param rawSwapData {Object|null}
|
|
2830
|
+
* @param clientIpAddress {string}
|
|
2831
|
+
* @return {Promise<({
|
|
2832
|
+
* result: true,
|
|
2833
|
+
* swapId: string,
|
|
2834
|
+
* fromCoin: Coin,
|
|
2835
|
+
* fromAmount: string,
|
|
2836
|
+
* fromAddress: string,
|
|
2837
|
+
* toCoin: Coin,
|
|
2838
|
+
* toAmount: string,
|
|
2839
|
+
* toAddress: string,
|
|
2840
|
+
* rate: string
|
|
2841
|
+
* }|{
|
|
2842
|
+
* result: false,
|
|
2843
|
+
* reason: string,
|
|
2844
|
+
* partner: string
|
|
2845
|
+
* })>}
|
|
2846
|
+
*/
|
|
2847
|
+
;
|
|
2848
|
+
_proto.createSwap = function createSwap(fromCoin, toCoin, amount, toAddress, refundAddress, rawSwapData, clientIpAddress) {
|
|
2849
|
+
try {
|
|
2850
|
+
throw new Error("Not implemented in base");
|
|
2851
|
+
} catch (e) {
|
|
2852
|
+
return Promise.reject(e);
|
|
2853
|
+
}
|
|
2854
|
+
}
|
|
2855
|
+
/**
|
|
2856
|
+
* Retrieves details and status for swaps by given ids.
|
|
2857
|
+
* If some swap is not found by id then there is no item in return list.
|
|
2858
|
+
*
|
|
2859
|
+
* @param swapIds {string[]}
|
|
2860
|
+
* @return {Promise<{result: false, reason: string}|{result:true, swaps: ExistingSwap[]}>}
|
|
2861
|
+
*/
|
|
2862
|
+
;
|
|
2863
|
+
_proto.getExistingSwapsDetailsAndStatus = function getExistingSwapsDetailsAndStatus(swapIds) {
|
|
2864
|
+
try {
|
|
2865
|
+
throw new Error("Not implemented in base");
|
|
2866
|
+
} catch (e) {
|
|
2867
|
+
return Promise.reject(e);
|
|
2868
|
+
}
|
|
2869
|
+
}
|
|
2870
|
+
/**
|
|
2871
|
+
* @param ticker {string}
|
|
2872
|
+
* @return {Coin|null}
|
|
2873
|
+
*/
|
|
2874
|
+
;
|
|
2875
|
+
_proto.getCoinByTickerIfPresent = function getCoinByTickerIfPresent(ticker) {
|
|
2876
|
+
throw new Error("Not implemented in base");
|
|
2877
|
+
}
|
|
2878
|
+
|
|
2879
|
+
/**
|
|
2880
|
+
* @param asset {Coin}
|
|
2881
|
+
* @param address {string}
|
|
2882
|
+
* @return {boolean}
|
|
2883
|
+
*/;
|
|
2884
|
+
_proto.isAddressValidForAsset = function isAddressValidForAsset(asset, address) {
|
|
2885
|
+
throw new Error("Not implemented in base");
|
|
2886
|
+
};
|
|
2887
|
+
return SwapProvider;
|
|
2888
|
+
}();
|
|
2889
|
+
SwapProvider.COMMON_ERRORS = {
|
|
2890
|
+
REQUESTS_LIMIT_EXCEEDED: "requestsLimitExceeded"
|
|
2891
|
+
};
|
|
2892
|
+
SwapProvider.NO_SWAPS_REASONS = {
|
|
2893
|
+
TOO_LOW: "tooLow",
|
|
2894
|
+
TOO_HIGH: "tooHigh",
|
|
2895
|
+
NOT_SUPPORTED: "notSupported"
|
|
2896
|
+
};
|
|
2897
|
+
SwapProvider.CREATION_FAIL_REASONS = {
|
|
2898
|
+
RETRIABLE_FAIL: "retriableFail"
|
|
2899
|
+
};
|
|
2900
|
+
SwapProvider.SWAP_STATUSES = {
|
|
2901
|
+
WAITING_FOR_PAYMENT: "waiting_for_payment",
|
|
2902
|
+
// public +
|
|
2903
|
+
CONFIRMING: "confirming",
|
|
2904
|
+
PAYMENT_RECEIVED: "payment_received",
|
|
2905
|
+
// public +
|
|
2906
|
+
EXCHANGING: "exchanging",
|
|
2907
|
+
// session full // public +
|
|
2908
|
+
COMPLETED: "completed",
|
|
2909
|
+
// session full // public +
|
|
2910
|
+
REFUNDED: "refunded",
|
|
2911
|
+
// session full // public +
|
|
2912
|
+
EXPIRED: "expired",
|
|
2913
|
+
// public +
|
|
2914
|
+
FAILED: "failed" // public +
|
|
2915
|
+
};
|
|
2916
|
+
|
|
2917
|
+
function _catch$2(body, recover) {
|
|
2918
|
+
try {
|
|
2919
|
+
var result = body();
|
|
2920
|
+
} catch (e) {
|
|
2921
|
+
return recover(e);
|
|
2922
|
+
}
|
|
2923
|
+
if (result && result.then) {
|
|
2924
|
+
return result.then(void 0, recover);
|
|
2925
|
+
}
|
|
2926
|
+
return result;
|
|
2927
|
+
}
|
|
2928
|
+
var BANNED_PARTNERS = ["stealthex", "changee", "coincraddle"];
|
|
2929
|
+
var FALLBACK_ICON_URL = "https://rabbit.io/asset-icons/fallback.svg";
|
|
2930
|
+
var SwapspaceSwapProvider = /*#__PURE__*/function (_SwapProvider) {
|
|
2931
|
+
_inheritsLoose(SwapspaceSwapProvider, _SwapProvider);
|
|
2932
|
+
function SwapspaceSwapProvider(apiKeysProxyUrl, cache, customCoinBuilder, useRestrictedCoinsSet) {
|
|
2933
|
+
var _this;
|
|
2934
|
+
if (customCoinBuilder === void 0) {
|
|
2935
|
+
customCoinBuilder = function customCoinBuilder(coin, network) {
|
|
2936
|
+
return null;
|
|
2937
|
+
};
|
|
2938
|
+
}
|
|
2939
|
+
if (useRestrictedCoinsSet === void 0) {
|
|
2940
|
+
useRestrictedCoinsSet = true;
|
|
2941
|
+
}
|
|
2942
|
+
_this = _SwapProvider.call(this) || this;
|
|
2943
|
+
_this._supportedCoins = [];
|
|
2944
|
+
_this._URL = apiKeysProxyUrl + "/swapspace";
|
|
2945
|
+
_this._maxRateDigits = 20;
|
|
2946
|
+
_this.useRestrictedCoinsSet = useRestrictedCoinsSet;
|
|
2947
|
+
_this._customCoinBuilder = customCoinBuilder;
|
|
2948
|
+
_this._cache = cache;
|
|
2949
|
+
return _this;
|
|
2950
|
+
}
|
|
2951
|
+
var _proto = SwapspaceSwapProvider.prototype;
|
|
2952
|
+
_proto.getSwapCreationInfoTtlMs = function getSwapCreationInfoTtlMs() {
|
|
2953
|
+
/* Actually 2 minutes and only relevant for some partners, but we use it
|
|
2954
|
+
* (and even a bit smaller value) for better consistency */
|
|
2955
|
+
return 110000;
|
|
2956
|
+
};
|
|
2957
|
+
_proto.getDepositCurrencies = function getDepositCurrencies() {
|
|
2958
|
+
try {
|
|
2959
|
+
var _this2 = this;
|
|
2960
|
+
var loggerSource = "getDepositCurrencies";
|
|
2961
|
+
return Promise.resolve(_catch$2(function () {
|
|
2962
|
+
return Promise.resolve(_this2._fetchSupportedCurrenciesIfNeeded()).then(function () {
|
|
2963
|
+
var _this2$_supportedCoin;
|
|
2964
|
+
Logger.log("We have " + ((_this2$_supportedCoin = _this2._supportedCoins) == null ? void 0 : _this2$_supportedCoin.length) + " supported coins, getting depositable", loggerSource);
|
|
2965
|
+
return {
|
|
2966
|
+
result: true,
|
|
2967
|
+
coins: _this2._supportedCoins.filter(function (item) {
|
|
2968
|
+
return item.deposit;
|
|
2969
|
+
}).map(function (item) {
|
|
2970
|
+
return item.coin;
|
|
2971
|
+
})
|
|
2972
|
+
};
|
|
2973
|
+
});
|
|
2974
|
+
}, function (e) {
|
|
2975
|
+
var _e$response;
|
|
2976
|
+
if ((e == null || (_e$response = e.response) == null ? void 0 : _e$response.status) === 429) {
|
|
2977
|
+
return {
|
|
2978
|
+
result: false,
|
|
2979
|
+
reason: SwapProvider.COMMON_ERRORS.REQUESTS_LIMIT_EXCEEDED
|
|
2980
|
+
};
|
|
2981
|
+
}
|
|
2982
|
+
improveAndRethrow(e, loggerSource);
|
|
2983
|
+
}));
|
|
2984
|
+
} catch (e) {
|
|
2985
|
+
return Promise.reject(e);
|
|
2986
|
+
}
|
|
2987
|
+
};
|
|
2988
|
+
_proto.getWithdrawalCurrencies = function getWithdrawalCurrencies(exceptCurrency) {
|
|
2989
|
+
if (exceptCurrency === void 0) {
|
|
2990
|
+
exceptCurrency = null;
|
|
2991
|
+
}
|
|
2992
|
+
try {
|
|
2993
|
+
var _this3 = this;
|
|
2994
|
+
var loggerSource = "getWithdrawalCurrencies";
|
|
2995
|
+
return Promise.resolve(_catch$2(function () {
|
|
2996
|
+
return Promise.resolve(_this3._fetchSupportedCurrenciesIfNeeded()).then(function () {
|
|
2997
|
+
var _this3$_supportedCoin;
|
|
2998
|
+
Logger.log("We have " + ((_this3$_supportedCoin = _this3._supportedCoins) == null ? void 0 : _this3$_supportedCoin.length) + " supported coins, getting withdrawable", loggerSource);
|
|
2999
|
+
return {
|
|
3000
|
+
result: true,
|
|
3001
|
+
coins: _this3._supportedCoins.filter(function (item) {
|
|
3002
|
+
var _item$coin, _exceptCurrency;
|
|
3003
|
+
return item.withdrawal && (!exceptCurrency || ((_item$coin = item.coin) == null ? void 0 : _item$coin.ticker) !== ((_exceptCurrency = exceptCurrency) == null ? void 0 : _exceptCurrency.ticker));
|
|
3004
|
+
}).map(function (item) {
|
|
3005
|
+
return item.coin;
|
|
3006
|
+
})
|
|
3007
|
+
};
|
|
3008
|
+
});
|
|
3009
|
+
}, function (e) {
|
|
3010
|
+
var _e$response2;
|
|
3011
|
+
if ((e == null || (_e$response2 = e.response) == null ? void 0 : _e$response2.status) === 429) {
|
|
3012
|
+
return {
|
|
3013
|
+
result: false,
|
|
3014
|
+
reason: SwapProvider.COMMON_ERRORS.REQUESTS_LIMIT_EXCEEDED
|
|
3015
|
+
};
|
|
3016
|
+
}
|
|
3017
|
+
improveAndRethrow(e, loggerSource);
|
|
3018
|
+
}));
|
|
3019
|
+
} catch (e) {
|
|
3020
|
+
return Promise.reject(e);
|
|
3021
|
+
}
|
|
3022
|
+
};
|
|
3023
|
+
_proto.initialize = function initialize() {
|
|
3024
|
+
try {
|
|
3025
|
+
var _this4 = this;
|
|
3026
|
+
return Promise.resolve(_this4._fetchSupportedCurrenciesIfNeeded()).then(function () {});
|
|
3027
|
+
} catch (e) {
|
|
3028
|
+
return Promise.reject(e);
|
|
3029
|
+
}
|
|
3030
|
+
};
|
|
3031
|
+
_proto.getIconUrl = function getIconUrl(coinOrTicker) {
|
|
3032
|
+
var loggerSource = "getIconUrl";
|
|
3033
|
+
try {
|
|
3034
|
+
var _this$_supportedCoins2, _this$_supportedCoins3;
|
|
3035
|
+
var coin = coinOrTicker;
|
|
3036
|
+
if (!(coinOrTicker instanceof Coin)) {
|
|
3037
|
+
var _this$_supportedCoins;
|
|
3038
|
+
coin = (_this$_supportedCoins = this._supportedCoins.find(function (i) {
|
|
3039
|
+
return i.coin.ticker === coinOrTicker;
|
|
3040
|
+
})) == null ? void 0 : _this$_supportedCoins.coin;
|
|
3041
|
+
}
|
|
3042
|
+
return (_this$_supportedCoins2 = (_this$_supportedCoins3 = this._supportedCoins.find(function (item) {
|
|
3043
|
+
var _item$coin2, _coin;
|
|
3044
|
+
return ((_item$coin2 = item.coin) == null ? void 0 : _item$coin2.ticker) === ((_coin = coin) == null ? void 0 : _coin.ticker);
|
|
3045
|
+
})) == null ? void 0 : _this$_supportedCoins3.iconURL) != null ? _this$_supportedCoins2 : FALLBACK_ICON_URL;
|
|
3046
|
+
} catch (e) {
|
|
3047
|
+
improveAndRethrow(e, loggerSource);
|
|
3048
|
+
}
|
|
3049
|
+
};
|
|
3050
|
+
_proto._fetchSupportedCurrenciesIfNeeded = function _fetchSupportedCurrenciesIfNeeded() {
|
|
3051
|
+
try {
|
|
3052
|
+
var _this5 = this;
|
|
3053
|
+
var loggerSource = "_fetchSupportedCurrenciesIfNeeded";
|
|
3054
|
+
return Promise.resolve(_catch$2(function () {
|
|
3055
|
+
var _temp = function (_this5$_supportedCoin) {
|
|
3056
|
+
if (!((_this5$_supportedCoin = _this5._supportedCoins) != null && _this5$_supportedCoin.length)) {
|
|
3057
|
+
return Promise.resolve(axios__default["default"].get(_this5._URL + "/api/v2/currencies")).then(function (rawResponse) {
|
|
3058
|
+
var _rawResponse$data, _rawResponse$data2;
|
|
3059
|
+
Logger.log("Retrieved " + (rawResponse == null || (_rawResponse$data = rawResponse.data) == null ? void 0 : _rawResponse$data.length) + " currencies", loggerSource);
|
|
3060
|
+
_this5._supportedCoins = ((_rawResponse$data2 = rawResponse == null ? void 0 : rawResponse.data) != null ? _rawResponse$data2 : []).map(function (item) {
|
|
3061
|
+
var coin = _this5._customCoinBuilder(item.code, item.network);
|
|
3062
|
+
if (!coin && !_this5.useRestrictedCoinsSet) {
|
|
3063
|
+
/** Building coin object for coin that isn't supported OOB in Rabbit.
|
|
3064
|
+
* We are doing this way to be able to use extended coins set for swaps.
|
|
3065
|
+
* These temporary built coins are only for in-swap use, and we omit some usual
|
|
3066
|
+
* coin details here.
|
|
3067
|
+
* Ideally we should add some new abstractions e.g. BaseCoin:
|
|
3068
|
+
* Coin will extend BaseCoin, SwapCoin will extend BaseCoin etc.
|
|
3069
|
+
* But for now it is reasonable to use this simpler approach.
|
|
3070
|
+
*/
|
|
3071
|
+
var code = item.code.toUpperCase();
|
|
3072
|
+
var network = item.network.toUpperCase();
|
|
3073
|
+
var ticker = "" + code + (code === network ? "" : network);
|
|
3074
|
+
var defaultDecimalPlacesForCoinNotSupportedOOB = 8;
|
|
3075
|
+
var defaultMinConfirmationsForCoinNotSupportedOOB = 1;
|
|
3076
|
+
coin = new Coin(item.name, ticker, code, defaultDecimalPlacesForCoinNotSupportedOOB, null, "", null, null, defaultMinConfirmationsForCoinNotSupportedOOB, null, [], 60000, null,
|
|
3077
|
+
// We cannot recognize blockchain from swapspace data
|
|
3078
|
+
code !== network ? new Protocol(network) : null,
|
|
3079
|
+
// TODO: [dev] maybe we should recognize standard protocols?
|
|
3080
|
+
item.contractAddress || null, false);
|
|
3081
|
+
}
|
|
3082
|
+
if (coin) {
|
|
3083
|
+
var _item$deposit, _item$withdrawal, _item$validationRegex;
|
|
3084
|
+
return {
|
|
3085
|
+
coin: coin,
|
|
3086
|
+
code: item.code,
|
|
3087
|
+
network: item.network,
|
|
3088
|
+
extraId: item.extraIdName,
|
|
3089
|
+
isPopular: !!(item != null && item.popular),
|
|
3090
|
+
iconURL: item.icon ? "https://storage.swapspace.co" + item.icon : FALLBACK_ICON_URL,
|
|
3091
|
+
deposit: (_item$deposit = item.deposit) != null ? _item$deposit : false,
|
|
3092
|
+
withdrawal: (_item$withdrawal = item.withdrawal) != null ? _item$withdrawal : false,
|
|
3093
|
+
validationRegexp: (_item$validationRegex = item.validationRegexp) != null ? _item$validationRegex : null
|
|
3094
|
+
};
|
|
3095
|
+
}
|
|
3096
|
+
return [];
|
|
3097
|
+
}).flat();
|
|
3098
|
+
_this5._putPopularCoinsFirst();
|
|
3099
|
+
});
|
|
3100
|
+
}
|
|
3101
|
+
}();
|
|
3102
|
+
if (_temp && _temp.then) return _temp.then(function () {});
|
|
3103
|
+
}, function (e) {
|
|
3104
|
+
improveAndRethrow(e, loggerSource);
|
|
3105
|
+
}));
|
|
3106
|
+
} catch (e) {
|
|
3107
|
+
return Promise.reject(e);
|
|
3108
|
+
}
|
|
3109
|
+
}
|
|
3110
|
+
/**
|
|
3111
|
+
* This method sort internal list putting popular (as swapspace thinks) coins to the top.
|
|
3112
|
+
* This is just for users of this API if they don't care about the sorting - we just improve a list a bit this way.
|
|
3113
|
+
* @private
|
|
3114
|
+
*/
|
|
3115
|
+
;
|
|
3116
|
+
_proto._putPopularCoinsFirst = function _putPopularCoinsFirst() {
|
|
3117
|
+
this._supportedCoins.sort(function (i1, i2) {
|
|
3118
|
+
if (i1.isPopular && !i2.isPopular) return -1;
|
|
3119
|
+
if (i2.isPopular && !i1.isPopular) return 1;
|
|
3120
|
+
return i1.coin.ticker > i2.coin.ticker ? 1 : i1.coin.ticker < i2.coin.ticker ? -1 : 0;
|
|
3121
|
+
});
|
|
3122
|
+
};
|
|
3123
|
+
_proto.getCoinToUSDTRate = function getCoinToUSDTRate(coin) {
|
|
3124
|
+
try {
|
|
3125
|
+
var _this6 = this;
|
|
3126
|
+
var loggerSource = "getCoinToUSDTRate";
|
|
3127
|
+
return Promise.resolve(_catch$2(function () {
|
|
3128
|
+
return coin ? Promise.resolve(_this6._fetchSupportedCurrenciesIfNeeded()).then(function () {
|
|
3129
|
+
var _this6$_supportedCoin;
|
|
3130
|
+
// Using USDT TRC20 as usually fee in this network is smaller than ERC20 and this network is widely used for USDT
|
|
3131
|
+
var usdtTrc20 = (_this6$_supportedCoin = _this6._supportedCoins.find(function (i) {
|
|
3132
|
+
return i.coin.ticker === "USDTTRC20";
|
|
3133
|
+
})) == null ? void 0 : _this6$_supportedCoin.coin;
|
|
3134
|
+
if (!usdtTrc20) {
|
|
3135
|
+
return {
|
|
3136
|
+
result: false
|
|
3137
|
+
};
|
|
3138
|
+
}
|
|
3139
|
+
var cached = _this6._cache.get("swapspace_usdt_rate_" + coin.ticker);
|
|
3140
|
+
if (cached != null) {
|
|
3141
|
+
return {
|
|
3142
|
+
result: true,
|
|
3143
|
+
rate: cached
|
|
3144
|
+
};
|
|
3145
|
+
}
|
|
3146
|
+
Logger.log("Loading USDT->coin rate as not found in cache:", coin == null ? void 0 : coin.ticker);
|
|
3147
|
+
return Promise.resolve(_this6.getSwapInfo(usdtTrc20, coin, "5000")).then(function (result) {
|
|
3148
|
+
if (!result.result) {
|
|
3149
|
+
return {
|
|
3150
|
+
result: false
|
|
3151
|
+
};
|
|
3152
|
+
}
|
|
3153
|
+
|
|
3154
|
+
// This calculation is not precise as we cannot recognize the actual fee and network fee. Just approximate.
|
|
3155
|
+
var standardSwapspaceFeeMultiplier = 1.002; // usually 0.2%
|
|
3156
|
+
var rate = bignumber_js.BigNumber(1).div(bignumber_js.BigNumber(result.rate).times(standardSwapspaceFeeMultiplier)).toString();
|
|
3157
|
+
_this6._cache.put("swapspace_usdt_rate_" + coin.ticker, rate, 15 * 60000 // 15 minutes
|
|
3158
|
+
);
|
|
3159
|
+
return {
|
|
3160
|
+
result: true,
|
|
3161
|
+
rate: rate
|
|
3162
|
+
};
|
|
3163
|
+
});
|
|
3164
|
+
}) : null;
|
|
3165
|
+
}, function (e) {
|
|
3166
|
+
improveAndRethrow(e, loggerSource);
|
|
3167
|
+
}));
|
|
3168
|
+
} catch (e) {
|
|
3169
|
+
return Promise.reject(e);
|
|
3170
|
+
}
|
|
3171
|
+
};
|
|
3172
|
+
_proto.getCoinByTickerIfPresent = function getCoinByTickerIfPresent(ticker) {
|
|
3173
|
+
try {
|
|
3174
|
+
var _item$coin3;
|
|
3175
|
+
var item = this._supportedCoins.find(function (i) {
|
|
3176
|
+
return i.coin.ticker === ticker;
|
|
3177
|
+
});
|
|
3178
|
+
return (_item$coin3 = item == null ? void 0 : item.coin) != null ? _item$coin3 : null;
|
|
3179
|
+
} catch (e) {
|
|
3180
|
+
improveAndRethrow(e, "getCoinByTickerIfPresent");
|
|
3181
|
+
}
|
|
3182
|
+
};
|
|
3183
|
+
_proto.getSwapInfo = function getSwapInfo(fromCoin, toCoin, amountCoins, fromCoinToUsdRate) {
|
|
3184
|
+
if (fromCoinToUsdRate === void 0) {
|
|
3185
|
+
fromCoinToUsdRate = null;
|
|
3186
|
+
}
|
|
3187
|
+
try {
|
|
3188
|
+
var _this7 = this;
|
|
3189
|
+
var loggerSource = "getSwapInfo";
|
|
3190
|
+
return Promise.resolve(_catch$2(function () {
|
|
3191
|
+
if (!(fromCoin instanceof Coin) || !(toCoin instanceof Coin) || typeof amountCoins !== "string" || bignumber_js.BigNumber(amountCoins).lt("0")) {
|
|
3192
|
+
throw new Error("Wrong input params: " + amountCoins + " " + fromCoin.ticker + " -> " + toCoin.ticker + (fromCoin instanceof Coin) + (toCoin instanceof Coin));
|
|
3193
|
+
}
|
|
3194
|
+
var fromCoinSwapspaceDetails = _this7._supportedCoins.find(function (i) {
|
|
3195
|
+
var _i$coin;
|
|
3196
|
+
return ((_i$coin = i.coin) == null ? void 0 : _i$coin.ticker) === (fromCoin == null ? void 0 : fromCoin.ticker);
|
|
3197
|
+
});
|
|
3198
|
+
var toCoinSwapspaceDetails = _this7._supportedCoins.find(function (i) {
|
|
3199
|
+
var _i$coin2;
|
|
3200
|
+
return ((_i$coin2 = i.coin) == null ? void 0 : _i$coin2.ticker) === (toCoin == null ? void 0 : toCoin.ticker);
|
|
3201
|
+
});
|
|
3202
|
+
if (!fromCoinSwapspaceDetails || !toCoinSwapspaceDetails) {
|
|
3203
|
+
throw new Error("Failed to find swapspace coin details for: " + fromCoin.ticker + " -> " + toCoin.ticker);
|
|
3204
|
+
}
|
|
3205
|
+
/* Here we use not documented parameter 'estimated=false'. This parameter controls whether we want to use
|
|
3206
|
+
* cached rate values stored in swapspace cache. Their support says they store at most for 30 sec.
|
|
3207
|
+
* But we are better off using the most actual rates.
|
|
3208
|
+
*/
|
|
3209
|
+
return Promise.resolve(axios__default["default"].get(_this7._URL + "/api/v2/amounts?fromCurrency=" + fromCoinSwapspaceDetails.code + "&fromNetwork=" + fromCoinSwapspaceDetails.network + "&toNetwork=" + toCoinSwapspaceDetails.network + "&toCurrency=" + toCoinSwapspaceDetails.code + "&amount=" + amountCoins + "&float=true&estimated=false")).then(function (response) {
|
|
3210
|
+
var _response$data;
|
|
3211
|
+
Logger.log("Retrieved " + (response == null || (_response$data = response.data) == null ? void 0 : _response$data.length) + " options", loggerSource);
|
|
3212
|
+
var options = Array.isArray(response.data) ? response.data : [];
|
|
3213
|
+
var exchangesSupportingThePair = options.filter(function (exchange) {
|
|
3214
|
+
return (exchange == null ? void 0 : exchange.exists) && !BANNED_PARTNERS.find(function (bannedPartner) {
|
|
3215
|
+
return bannedPartner === (exchange == null ? void 0 : exchange.partner);
|
|
3216
|
+
}) && (exchange == null ? void 0 : exchange.fixed) === false && (exchange.min === 0 || exchange.max === 0 || exchange.max > exchange.min || (typeof exchange.min !== "number" || typeof exchange.max !== "number") && exchange.toAmount > 0);
|
|
3217
|
+
});
|
|
3218
|
+
Logger.log((exchangesSupportingThePair == null ? void 0 : exchangesSupportingThePair.length) + " of them have exist=true", loggerSource);
|
|
3219
|
+
if (!exchangesSupportingThePair.length) {
|
|
3220
|
+
return {
|
|
3221
|
+
result: false,
|
|
3222
|
+
reason: SwapProvider.NO_SWAPS_REASONS.NOT_SUPPORTED
|
|
3223
|
+
};
|
|
3224
|
+
}
|
|
3225
|
+
var availableExchanges = exchangesSupportingThePair.filter(function (exchange) {
|
|
3226
|
+
return typeof (exchange == null ? void 0 : exchange.toAmount) === "number" && exchange.toAmount > 0;
|
|
3227
|
+
});
|
|
3228
|
+
Logger.log("Available (having amountTo): " + safeStringify(availableExchanges), loggerSource);
|
|
3229
|
+
// min=0 or max=0 means there is no limit for the partner
|
|
3230
|
+
var smallestMin = null;
|
|
3231
|
+
if (exchangesSupportingThePair.find(function (ex) {
|
|
3232
|
+
return bignumber_js.BigNumber(ex.min).isZero();
|
|
3233
|
+
}) == null) {
|
|
3234
|
+
smallestMin = exchangesSupportingThePair.reduce(function (prev, cur) {
|
|
3235
|
+
if (typeof cur.min === "number" && (prev === null || bignumber_js.BigNumber(cur.min).lt(prev))) return bignumber_js.BigNumber(cur.min);
|
|
3236
|
+
return prev;
|
|
3237
|
+
}, null);
|
|
3238
|
+
}
|
|
3239
|
+
var greatestMax = null;
|
|
3240
|
+
if (exchangesSupportingThePair.find(function (ex) {
|
|
3241
|
+
return bignumber_js.BigNumber(ex.max).isZero();
|
|
3242
|
+
}) == null) {
|
|
3243
|
+
greatestMax = exchangesSupportingThePair.reduce(function (prev, cur) {
|
|
3244
|
+
if (typeof cur.max === "number" && (prev === null || bignumber_js.BigNumber(cur.max).gt(prev))) return bignumber_js.BigNumber(cur.max);
|
|
3245
|
+
return prev;
|
|
3246
|
+
}, null);
|
|
3247
|
+
}
|
|
3248
|
+
var extraCoinsToFitMinMax = "0";
|
|
3249
|
+
if (typeof fromCoinToUsdRate === "string" && bignumber_js.BigNumber(fromCoinToUsdRate).gt("0")) {
|
|
3250
|
+
var extraUsdToFitMinMax = bignumber_js.BigNumber("1"); // We correct the limits as the exact limit can fluctuate and cause failed swap creation
|
|
3251
|
+
extraCoinsToFitMinMax = AmountUtils.trim(extraUsdToFitMinMax.div(fromCoinToUsdRate), fromCoin.digits);
|
|
3252
|
+
}
|
|
3253
|
+
if (smallestMin instanceof bignumber_js.BigNumber) {
|
|
3254
|
+
smallestMin = AmountUtils.trim(smallestMin.plus(extraCoinsToFitMinMax), fromCoin.digits);
|
|
3255
|
+
}
|
|
3256
|
+
if (greatestMax instanceof bignumber_js.BigNumber) {
|
|
3257
|
+
if (greatestMax > extraCoinsToFitMinMax) {
|
|
3258
|
+
greatestMax = AmountUtils.trim(greatestMax.minus(extraCoinsToFitMinMax), fromCoin.digits);
|
|
3259
|
+
} else {
|
|
3260
|
+
greatestMax = "0";
|
|
3261
|
+
}
|
|
3262
|
+
}
|
|
3263
|
+
if (availableExchanges.length) {
|
|
3264
|
+
var _bestOpt$duration;
|
|
3265
|
+
var sorted = availableExchanges.sort(function (op1, op2) {
|
|
3266
|
+
return op2.toAmount - op1.toAmount;
|
|
3267
|
+
});
|
|
3268
|
+
var bestOpt = sorted[0];
|
|
3269
|
+
Logger.log("Returning first option after sorting: " + safeStringify(bestOpt), loggerSource);
|
|
3270
|
+
var max = null;
|
|
3271
|
+
var min = null;
|
|
3272
|
+
if (extraCoinsToFitMinMax != null) {
|
|
3273
|
+
if (typeof bestOpt.max === "number" && bestOpt.max !== 0) {
|
|
3274
|
+
max = bignumber_js.BigNumber(bestOpt.max).minus(extraCoinsToFitMinMax);
|
|
3275
|
+
max = AmountUtils.trim(max.lt(0) ? "0" : max, fromCoin.digits);
|
|
3276
|
+
}
|
|
3277
|
+
if (typeof bestOpt.min === "number" && bestOpt.min !== 0) {
|
|
3278
|
+
min = AmountUtils.trim(bignumber_js.BigNumber(bestOpt.min).plus(extraCoinsToFitMinMax), fromCoin.digits);
|
|
3279
|
+
}
|
|
3280
|
+
}
|
|
3281
|
+
var rate = bestOpt.toAmount && bestOpt.fromAmount ? bignumber_js.BigNumber(bestOpt.toAmount).div(bestOpt.fromAmount) : null;
|
|
3282
|
+
return {
|
|
3283
|
+
result: true,
|
|
3284
|
+
min: min,
|
|
3285
|
+
max: max,
|
|
3286
|
+
smallestMin: smallestMin,
|
|
3287
|
+
greatestMax: greatestMax,
|
|
3288
|
+
rate: rate != null ? AmountUtils.trim(rate, _this7._maxRateDigits) : null,
|
|
3289
|
+
durationMinutesRange: (_bestOpt$duration = bestOpt.duration) != null ? _bestOpt$duration : null,
|
|
3290
|
+
rawSwapData: bestOpt
|
|
3291
|
+
};
|
|
3292
|
+
}
|
|
3293
|
+
var result = {
|
|
3294
|
+
result: false,
|
|
3295
|
+
reason: smallestMin && bignumber_js.BigNumber(amountCoins).lt(smallestMin) ? SwapProvider.NO_SWAPS_REASONS.TOO_LOW : greatestMax && bignumber_js.BigNumber(amountCoins).gt(greatestMax) ? SwapProvider.NO_SWAPS_REASONS.TOO_HIGH : SwapProvider.NO_SWAPS_REASONS.NOT_SUPPORTED,
|
|
3296
|
+
smallestMin: smallestMin,
|
|
3297
|
+
greatestMax: greatestMax
|
|
3298
|
+
};
|
|
3299
|
+
Logger.log("Returning result " + safeStringify(result), loggerSource);
|
|
3300
|
+
return result;
|
|
3301
|
+
});
|
|
3302
|
+
}, function (e) {
|
|
3303
|
+
var _e$response3;
|
|
3304
|
+
if ((e == null || (_e$response3 = e.response) == null ? void 0 : _e$response3.status) === 429) {
|
|
3305
|
+
return {
|
|
3306
|
+
result: false,
|
|
3307
|
+
reason: SwapProvider.COMMON_ERRORS.REQUESTS_LIMIT_EXCEEDED
|
|
3308
|
+
};
|
|
3309
|
+
}
|
|
3310
|
+
Logger.log("Internal swapspace/rabbit error when getting swap options " + safeStringify(e), loggerSource);
|
|
3311
|
+
improveAndRethrow(e, loggerSource);
|
|
3312
|
+
}));
|
|
3313
|
+
} catch (e) {
|
|
3314
|
+
return Promise.reject(e);
|
|
3315
|
+
}
|
|
3316
|
+
};
|
|
3317
|
+
_proto.createSwap = function createSwap(fromCoin, toCoin, amount, toAddress, refundAddress, rawSwapData, clientIpAddress) {
|
|
3318
|
+
try {
|
|
3319
|
+
var _this8 = this;
|
|
3320
|
+
var loggerSource = "createSwap";
|
|
3321
|
+
var partner = rawSwapData == null ? void 0 : rawSwapData.partner;
|
|
3322
|
+
return Promise.resolve(_catch$2(function () {
|
|
3323
|
+
if (!(fromCoin instanceof Coin) || !(toCoin instanceof Coin) || typeof amount !== "string" || typeof toAddress !== "string" || typeof refundAddress !== "string") {
|
|
3324
|
+
throw new Error("Invalid input: " + fromCoin + " " + toCoin + " " + amount + " " + toAddress + " " + refundAddress);
|
|
3325
|
+
}
|
|
3326
|
+
if (typeof partner !== "string" || typeof (rawSwapData == null ? void 0 : rawSwapData.fromCurrency) !== "string" || typeof (rawSwapData == null ? void 0 : rawSwapData.fromNetwork) !== "string" || typeof (rawSwapData == null ? void 0 : rawSwapData.toCurrency) !== "string" || typeof (rawSwapData == null ? void 0 : rawSwapData.toNetwork) !== "string" || typeof (rawSwapData == null ? void 0 : rawSwapData.id) !== "string" // can be just empty
|
|
3327
|
+
) {
|
|
3328
|
+
throw new Error("Invalid raw swap data: " + safeStringify(rawSwapData));
|
|
3329
|
+
}
|
|
3330
|
+
return Promise.resolve(_this8._fetchSupportedCurrenciesIfNeeded()).then(function () {
|
|
3331
|
+
var _this8$_supportedCoin, _this8$_supportedCoin2;
|
|
3332
|
+
var toCurrencyExtraId = (_this8$_supportedCoin = (_this8$_supportedCoin2 = _this8._supportedCoins.find(function (item) {
|
|
3333
|
+
var _item$coin4;
|
|
3334
|
+
return ((_item$coin4 = item.coin) == null ? void 0 : _item$coin4.ticker) === (toCoin == null ? void 0 : toCoin.ticker);
|
|
3335
|
+
})) == null ? void 0 : _this8$_supportedCoin2.extraId) != null ? _this8$_supportedCoin : "";
|
|
3336
|
+
var requestData = {
|
|
3337
|
+
partner: partner,
|
|
3338
|
+
fromCurrency: rawSwapData == null ? void 0 : rawSwapData.fromCurrency,
|
|
3339
|
+
fromNetwork: rawSwapData == null ? void 0 : rawSwapData.fromNetwork,
|
|
3340
|
+
toCurrency: rawSwapData == null ? void 0 : rawSwapData.toCurrency,
|
|
3341
|
+
toNetwork: rawSwapData == null ? void 0 : rawSwapData.toNetwork,
|
|
3342
|
+
address: toAddress,
|
|
3343
|
+
amount: amount,
|
|
3344
|
+
fixed: false,
|
|
3345
|
+
extraId: toCurrencyExtraId != null ? toCurrencyExtraId : "",
|
|
3346
|
+
rateId: rawSwapData == null ? void 0 : rawSwapData.id,
|
|
3347
|
+
userIp: clientIpAddress,
|
|
3348
|
+
refund: refundAddress
|
|
3349
|
+
};
|
|
3350
|
+
Logger.log("Sending create request: " + safeStringify(requestData), loggerSource);
|
|
3351
|
+
return Promise.resolve(axios__default["default"].post(_this8._URL + "/api/v2/exchange", requestData)).then(function (response) {
|
|
3352
|
+
var result = response.data;
|
|
3353
|
+
Logger.log("Creation result " + safeStringify(result), loggerSource);
|
|
3354
|
+
if (result != null && result.id) {
|
|
3355
|
+
var _result$from, _result$from2, _result$to, _result$to2, _result$from4, _result$from5, _result$to4, _result$to5;
|
|
3356
|
+
if (typeof (result == null || (_result$from = result.from) == null ? void 0 : _result$from.amount) !== "number" || typeof (result == null || (_result$from2 = result.from) == null ? void 0 : _result$from2.address) !== "string" || typeof (result == null || (_result$to = result.to) == null ? void 0 : _result$to.amount) !== "number" || typeof (result == null || (_result$to2 = result.to) == null ? void 0 : _result$to2.address) !== "string") throw new Error("Wrong swap creation result " + result);
|
|
3357
|
+
/* We use the returned rate preferably but if the retrieved
|
|
3358
|
+
* rate 0/null/undefined we calculate it manually */
|
|
3359
|
+
var rate = result.rate;
|
|
3360
|
+
if (typeof rate !== "number" || bignumber_js.BigNumber(rate).isZero()) {
|
|
3361
|
+
var _result$to3, _result$from3;
|
|
3362
|
+
rate = bignumber_js.BigNumber(result == null || (_result$to3 = result.to) == null ? void 0 : _result$to3.amount).div(result == null || (_result$from3 = result.from) == null ? void 0 : _result$from3.amount);
|
|
3363
|
+
} else {
|
|
3364
|
+
rate = bignumber_js.BigNumber(rate);
|
|
3365
|
+
}
|
|
3366
|
+
return {
|
|
3367
|
+
result: true,
|
|
3368
|
+
swapId: result == null ? void 0 : result.id,
|
|
3369
|
+
fromCoin: fromCoin,
|
|
3370
|
+
fromAmount: AmountUtils.trim(result == null || (_result$from4 = result.from) == null ? void 0 : _result$from4.amount, fromCoin.digits),
|
|
3371
|
+
fromAddress: result == null || (_result$from5 = result.from) == null ? void 0 : _result$from5.address,
|
|
3372
|
+
toCoin: toCoin,
|
|
3373
|
+
toAmount: AmountUtils.trim(result == null || (_result$to4 = result.to) == null ? void 0 : _result$to4.amount, toCoin.digits),
|
|
3374
|
+
toAddress: result == null || (_result$to5 = result.to) == null ? void 0 : _result$to5.address,
|
|
3375
|
+
rate: AmountUtils.trim(rate, _this8._maxRateDigits)
|
|
3376
|
+
};
|
|
3377
|
+
}
|
|
3378
|
+
var errorMessage = "Swap creation succeeded but the response is wrong: " + safeStringify(response);
|
|
3379
|
+
Logger.log(errorMessage, loggerSource);
|
|
3380
|
+
throw new Error(errorMessage);
|
|
3381
|
+
});
|
|
3382
|
+
});
|
|
3383
|
+
}, function (e) {
|
|
3384
|
+
var _e$response4, _e$response5;
|
|
3385
|
+
Logger.logError(e, loggerSource, "Failed to create swap. Error is: " + safeStringify(e));
|
|
3386
|
+
var composeFailResult = function composeFailResult(reason) {
|
|
3387
|
+
return {
|
|
3388
|
+
result: false,
|
|
3389
|
+
reason: reason,
|
|
3390
|
+
partner: partner
|
|
3391
|
+
};
|
|
3392
|
+
};
|
|
3393
|
+
var status = e == null || (_e$response4 = e.response) == null ? void 0 : _e$response4.status;
|
|
3394
|
+
var data = e == null || (_e$response5 = e.response) == null ? void 0 : _e$response5.data;
|
|
3395
|
+
if (status === 429) {
|
|
3396
|
+
Logger.log("Returning fail - RPS limit exceeded " + data, loggerSource);
|
|
3397
|
+
return composeFailResult(SwapProvider.COMMON_ERRORS.REQUESTS_LIMIT_EXCEEDED);
|
|
3398
|
+
}
|
|
3399
|
+
var texts422 = ["Pair cannot be processed by", "Currency not found", "Amount maximum is", "Amount minimum is"];
|
|
3400
|
+
var text403 = "IP address is forbidden";
|
|
3401
|
+
if (typeof data === "string" && (status === 403 && data.includes(text403) || status === 422 && texts422.find(function (text) {
|
|
3402
|
+
return data.includes(text);
|
|
3403
|
+
}))) {
|
|
3404
|
+
Logger.log("Returning retriable fail: " + status + " - " + data + ", " + partner, loggerSource);
|
|
3405
|
+
return composeFailResult(SwapProvider.CREATION_FAIL_REASONS.RETRIABLE_FAIL);
|
|
3406
|
+
}
|
|
3407
|
+
Logger.log("Internal swapspace/rabbit error for " + partner + ": " + safeStringify(e), loggerSource);
|
|
3408
|
+
improveAndRethrow(e, loggerSource);
|
|
3409
|
+
}));
|
|
3410
|
+
} catch (e) {
|
|
3411
|
+
return Promise.reject(e);
|
|
3412
|
+
}
|
|
3413
|
+
};
|
|
3414
|
+
_proto._mapSwapspaceStatusToRabbitStatus = function _mapSwapspaceStatusToRabbitStatus(status, isExpiredByTime) {
|
|
3415
|
+
switch (status) {
|
|
3416
|
+
case "waiting":
|
|
3417
|
+
if (isExpiredByTime) {
|
|
3418
|
+
return SwapProvider.SWAP_STATUSES.EXPIRED;
|
|
3419
|
+
}
|
|
3420
|
+
return SwapProvider.SWAP_STATUSES.WAITING_FOR_PAYMENT;
|
|
3421
|
+
case "confirming":
|
|
3422
|
+
return SwapProvider.SWAP_STATUSES.CONFIRMING;
|
|
3423
|
+
case "exchanging":
|
|
3424
|
+
return SwapProvider.SWAP_STATUSES.EXCHANGING;
|
|
3425
|
+
case "sending":
|
|
3426
|
+
return SwapProvider.SWAP_STATUSES.PAYMENT_RECEIVED;
|
|
3427
|
+
case "finished":
|
|
3428
|
+
return SwapProvider.SWAP_STATUSES.COMPLETED;
|
|
3429
|
+
case "verifying":
|
|
3430
|
+
return SwapProvider.SWAP_STATUSES.EXCHANGING;
|
|
3431
|
+
case "refunded":
|
|
3432
|
+
return SwapProvider.SWAP_STATUSES.REFUNDED;
|
|
3433
|
+
case "expired":
|
|
3434
|
+
return SwapProvider.SWAP_STATUSES.EXPIRED;
|
|
3435
|
+
case "failed":
|
|
3436
|
+
return SwapProvider.SWAP_STATUSES.FAILED;
|
|
3437
|
+
default:
|
|
3438
|
+
throw new Error("Unknown swapspace status: " + status);
|
|
3439
|
+
}
|
|
3440
|
+
};
|
|
3441
|
+
_proto.getExistingSwapsDetailsAndStatus = function getExistingSwapsDetailsAndStatus(swapIds) {
|
|
3442
|
+
try {
|
|
3443
|
+
var _this9 = this;
|
|
3444
|
+
var loggerSource = "getExistingSwapsDetailsAndStatus";
|
|
3445
|
+
return Promise.resolve(_catch$2(function () {
|
|
3446
|
+
if (swapIds.find(function (id) {
|
|
3447
|
+
return typeof id !== "string";
|
|
3448
|
+
})) {
|
|
3449
|
+
throw new Error("Swap id is not string: " + safeStringify(swapIds));
|
|
3450
|
+
}
|
|
3451
|
+
var getNotFailingOn404 = function getNotFailingOn404(swapId) {
|
|
3452
|
+
try {
|
|
3453
|
+
return Promise.resolve(_catch$2(function () {
|
|
3454
|
+
return Promise.resolve(axios__default["default"].get(_this9._URL + "/api/v2/exchange/" + swapId));
|
|
3455
|
+
}, function (error) {
|
|
3456
|
+
var _error$response;
|
|
3457
|
+
if ((error == null || (_error$response = error.response) == null ? void 0 : _error$response.status) === 404) return [];
|
|
3458
|
+
throw error;
|
|
3459
|
+
}));
|
|
3460
|
+
} catch (e) {
|
|
3461
|
+
return Promise.reject(e);
|
|
3462
|
+
}
|
|
3463
|
+
};
|
|
3464
|
+
return Promise.resolve(Promise.all(swapIds.map(function (swapId) {
|
|
3465
|
+
return getNotFailingOn404(swapId);
|
|
3466
|
+
}))).then(function (responses) {
|
|
3467
|
+
var wo404 = responses.flat();
|
|
3468
|
+
var swaps = wo404.map(function (r) {
|
|
3469
|
+
return r.data;
|
|
3470
|
+
}).map(function (swap, index) {
|
|
3471
|
+
var _this9$_supportedCoin, _this9$_supportedCoin2;
|
|
3472
|
+
var fromCoin = (_this9$_supportedCoin = _this9._supportedCoins.find(function (i) {
|
|
3473
|
+
return i.code === swap.from.code && i.network === swap.from.network;
|
|
3474
|
+
})) == null ? void 0 : _this9$_supportedCoin.coin;
|
|
3475
|
+
var toCoin = (_this9$_supportedCoin2 = _this9._supportedCoins.find(function (i) {
|
|
3476
|
+
return i.code === swap.to.code && i.network === swap.to.network;
|
|
3477
|
+
})) == null ? void 0 : _this9$_supportedCoin2.coin;
|
|
3478
|
+
if (!fromCoin || !toCoin) {
|
|
3479
|
+
return []; // We skip swaps with not supported coins for now
|
|
3480
|
+
}
|
|
3481
|
+
var toUtcTimestamp = function toUtcTimestamp(timeStr) {
|
|
3482
|
+
return Date.parse(timeStr.match(/.+[Zz]$/) ? timeStr : timeStr + "Z");
|
|
3483
|
+
};
|
|
3484
|
+
var expiresAt = toUtcTimestamp(swap.timestamps.expiresAt);
|
|
3485
|
+
var isExpiredByTime = expiresAt > Date.now();
|
|
3486
|
+
var status = _this9._mapSwapspaceStatusToRabbitStatus(swap.status, isExpiredByTime);
|
|
3487
|
+
var toDigits = status === SwapProvider.SWAP_STATUSES.REFUNDED ? fromCoin.digits : toCoin.digits;
|
|
3488
|
+
var addressToSendCoinsToSwapspace = swap.from.address;
|
|
3489
|
+
return new ExistingSwap(swapIds[index], status, toUtcTimestamp(swap.timestamps.createdAt), expiresAt, swap.confirmations, AmountUtils.trim(swap.rate, _this9._maxRateDigits), swap.refundAddress, addressToSendCoinsToSwapspace, fromCoin, AmountUtils.trim(swap.from.amount, fromCoin.digits), swap.from.transactionHash, swap.blockExplorerTransactionUrl.from, toCoin, AmountUtils.trim(swap.to.amount, toDigits), swap.to.transactionHash, swap.blockExplorerTransactionUrl.to, swap.to.address, swap.partner);
|
|
3490
|
+
}).flat();
|
|
3491
|
+
Logger.log("Swap details result " + safeStringify(swaps), loggerSource);
|
|
3492
|
+
return {
|
|
3493
|
+
result: true,
|
|
3494
|
+
swaps: swaps
|
|
3495
|
+
};
|
|
3496
|
+
});
|
|
3497
|
+
}, function (e) {
|
|
3498
|
+
var _e$response6, _e$response7;
|
|
3499
|
+
Logger.logError(e, loggerSource, "Failed to get swap details. Error is: " + safeStringify(e));
|
|
3500
|
+
var composeFailResult = function composeFailResult(reason) {
|
|
3501
|
+
return {
|
|
3502
|
+
result: false,
|
|
3503
|
+
reason: reason
|
|
3504
|
+
};
|
|
3505
|
+
};
|
|
3506
|
+
var status = e == null || (_e$response6 = e.response) == null ? void 0 : _e$response6.status;
|
|
3507
|
+
var data = e == null || (_e$response7 = e.response) == null ? void 0 : _e$response7.data;
|
|
3508
|
+
if (status === 429) {
|
|
3509
|
+
Logger.log("Returning fail - RPS limit exceeded " + data, loggerSource);
|
|
3510
|
+
return composeFailResult(SwapProvider.COMMON_ERRORS.REQUESTS_LIMIT_EXCEEDED);
|
|
3511
|
+
}
|
|
3512
|
+
improveAndRethrow(e, loggerSource);
|
|
3513
|
+
}));
|
|
3514
|
+
} catch (e) {
|
|
3515
|
+
return Promise.reject(e);
|
|
3516
|
+
}
|
|
3517
|
+
};
|
|
3518
|
+
_proto.isAddressValidForAsset = function isAddressValidForAsset(asset, address) {
|
|
3519
|
+
try {
|
|
3520
|
+
var assetData = this._supportedCoins.find(function (i) {
|
|
3521
|
+
var _i$coin3;
|
|
3522
|
+
return ((_i$coin3 = i.coin) == null ? void 0 : _i$coin3.ticker) === (asset == null ? void 0 : asset.ticker);
|
|
3523
|
+
});
|
|
3524
|
+
if (assetData) {
|
|
3525
|
+
var corrected = assetData.validationRegexp.trim();
|
|
3526
|
+
corrected = corrected[0] === "/" ? corrected.slice(1) : corrected;
|
|
3527
|
+
corrected = corrected[corrected.length - 1] === "/" ? corrected.slice(0, corrected.length - 1) : corrected;
|
|
3528
|
+
return address.match(corrected) != null;
|
|
3529
|
+
}
|
|
3530
|
+
} catch (e) {
|
|
3531
|
+
Logger.logError(e, "isAddressValidForAsset");
|
|
3532
|
+
}
|
|
3533
|
+
return false;
|
|
3534
|
+
};
|
|
3535
|
+
return SwapspaceSwapProvider;
|
|
3536
|
+
}(SwapProvider);
|
|
3537
|
+
|
|
3538
|
+
function _catch$1(body, recover) {
|
|
3539
|
+
try {
|
|
3540
|
+
var result = body();
|
|
3541
|
+
} catch (e) {
|
|
3542
|
+
return recover(e);
|
|
3543
|
+
}
|
|
3544
|
+
if (result && result.then) {
|
|
3545
|
+
return result.then(void 0, recover);
|
|
3546
|
+
}
|
|
3547
|
+
return result;
|
|
3548
|
+
}
|
|
3549
|
+
var _iteratorSymbol = typeof Symbol !== "undefined" ? Symbol.iterator || (Symbol.iterator = Symbol("Symbol.iterator")) : "@@iterator";
|
|
3550
|
+
function _settle(pact, state, value) {
|
|
3551
|
+
if (!pact.s) {
|
|
3552
|
+
if (value instanceof _Pact) {
|
|
3553
|
+
if (value.s) {
|
|
3554
|
+
if (state & 1) {
|
|
3555
|
+
state = value.s;
|
|
3556
|
+
}
|
|
3557
|
+
value = value.v;
|
|
3558
|
+
} else {
|
|
3559
|
+
value.o = _settle.bind(null, pact, state);
|
|
3560
|
+
return;
|
|
3561
|
+
}
|
|
3562
|
+
}
|
|
3563
|
+
if (value && value.then) {
|
|
3564
|
+
value.then(_settle.bind(null, pact, state), _settle.bind(null, pact, 2));
|
|
3565
|
+
return;
|
|
3566
|
+
}
|
|
3567
|
+
pact.s = state;
|
|
3568
|
+
pact.v = value;
|
|
3569
|
+
var observer = pact.o;
|
|
3570
|
+
if (observer) {
|
|
3571
|
+
observer(pact);
|
|
3572
|
+
}
|
|
3573
|
+
}
|
|
3574
|
+
}
|
|
3575
|
+
var _Pact = /*#__PURE__*/function () {
|
|
3576
|
+
function _Pact() {}
|
|
3577
|
+
_Pact.prototype.then = function (onFulfilled, onRejected) {
|
|
3578
|
+
var result = new _Pact();
|
|
3579
|
+
var state = this.s;
|
|
3580
|
+
if (state) {
|
|
3581
|
+
var callback = state & 1 ? onFulfilled : onRejected;
|
|
3582
|
+
if (callback) {
|
|
3583
|
+
try {
|
|
3584
|
+
_settle(result, 1, callback(this.v));
|
|
3585
|
+
} catch (e) {
|
|
3586
|
+
_settle(result, 2, e);
|
|
3587
|
+
}
|
|
3588
|
+
return result;
|
|
3589
|
+
} else {
|
|
3590
|
+
return this;
|
|
3591
|
+
}
|
|
3592
|
+
}
|
|
3593
|
+
this.o = function (_this) {
|
|
3594
|
+
try {
|
|
3595
|
+
var value = _this.v;
|
|
3596
|
+
if (_this.s & 1) {
|
|
3597
|
+
_settle(result, 1, onFulfilled ? onFulfilled(value) : value);
|
|
3598
|
+
} else if (onRejected) {
|
|
3599
|
+
_settle(result, 1, onRejected(value));
|
|
3600
|
+
} else {
|
|
3601
|
+
_settle(result, 2, value);
|
|
3602
|
+
}
|
|
3603
|
+
} catch (e) {
|
|
3604
|
+
_settle(result, 2, e);
|
|
3605
|
+
}
|
|
3606
|
+
};
|
|
3607
|
+
return result;
|
|
3608
|
+
};
|
|
3609
|
+
return _Pact;
|
|
3610
|
+
}();
|
|
3611
|
+
function _isSettledPact(thenable) {
|
|
3612
|
+
return thenable instanceof _Pact && thenable.s & 1;
|
|
3613
|
+
}
|
|
3614
|
+
function _forTo(array, body, check) {
|
|
3615
|
+
var i = -1,
|
|
3616
|
+
pact,
|
|
3617
|
+
reject;
|
|
3618
|
+
function _cycle(result) {
|
|
3619
|
+
try {
|
|
3620
|
+
while (++i < array.length && (!check || !check())) {
|
|
3621
|
+
result = body(i);
|
|
3622
|
+
if (result && result.then) {
|
|
3623
|
+
if (_isSettledPact(result)) {
|
|
3624
|
+
result = result.v;
|
|
3625
|
+
} else {
|
|
3626
|
+
result.then(_cycle, reject || (reject = _settle.bind(null, pact = new _Pact(), 2)));
|
|
3627
|
+
return;
|
|
3628
|
+
}
|
|
3629
|
+
}
|
|
3630
|
+
}
|
|
3631
|
+
if (pact) {
|
|
3632
|
+
_settle(pact, 1, result);
|
|
3633
|
+
} else {
|
|
3634
|
+
pact = result;
|
|
3635
|
+
}
|
|
3636
|
+
} catch (e) {
|
|
3637
|
+
_settle(pact || (pact = new _Pact()), 2, e);
|
|
3638
|
+
}
|
|
3639
|
+
}
|
|
3640
|
+
_cycle();
|
|
3641
|
+
return pact;
|
|
3642
|
+
}
|
|
3643
|
+
function _forOf(target, body, check) {
|
|
3644
|
+
if (typeof target[_iteratorSymbol] === "function") {
|
|
3645
|
+
var _cycle = function _cycle(result) {
|
|
3646
|
+
try {
|
|
3647
|
+
while (!(step = iterator.next()).done && (!check || !check())) {
|
|
3648
|
+
result = body(step.value);
|
|
3649
|
+
if (result && result.then) {
|
|
3650
|
+
if (_isSettledPact(result)) {
|
|
3651
|
+
result = result.v;
|
|
3652
|
+
} else {
|
|
3653
|
+
result.then(_cycle, reject || (reject = _settle.bind(null, pact = new _Pact(), 2)));
|
|
3654
|
+
return;
|
|
3655
|
+
}
|
|
3656
|
+
}
|
|
3657
|
+
}
|
|
3658
|
+
if (pact) {
|
|
3659
|
+
_settle(pact, 1, result);
|
|
3660
|
+
} else {
|
|
3661
|
+
pact = result;
|
|
3662
|
+
}
|
|
3663
|
+
} catch (e) {
|
|
3664
|
+
_settle(pact || (pact = new _Pact()), 2, e);
|
|
3665
|
+
}
|
|
3666
|
+
};
|
|
3667
|
+
var iterator = target[_iteratorSymbol](),
|
|
3668
|
+
step,
|
|
3669
|
+
pact,
|
|
3670
|
+
reject;
|
|
3671
|
+
_cycle();
|
|
3672
|
+
if (iterator["return"]) {
|
|
3673
|
+
var _fixup = function _fixup(value) {
|
|
3674
|
+
try {
|
|
3675
|
+
if (!step.done) {
|
|
3676
|
+
iterator["return"]();
|
|
3677
|
+
}
|
|
3678
|
+
} catch (e) {}
|
|
3679
|
+
return value;
|
|
3680
|
+
};
|
|
3681
|
+
if (pact && pact.then) {
|
|
3682
|
+
return pact.then(_fixup, function (e) {
|
|
3683
|
+
throw _fixup(e);
|
|
3684
|
+
});
|
|
3685
|
+
}
|
|
3686
|
+
_fixup();
|
|
3687
|
+
}
|
|
3688
|
+
return pact;
|
|
3689
|
+
}
|
|
3690
|
+
// No support for Symbol.iterator
|
|
3691
|
+
if (!("length" in target)) {
|
|
3692
|
+
throw new TypeError("Object is not iterable");
|
|
3693
|
+
}
|
|
3694
|
+
// Handle live collections properly
|
|
3695
|
+
var values = [];
|
|
3696
|
+
for (var i = 0; i < target.length; i++) {
|
|
3697
|
+
values.push(target[i]);
|
|
3698
|
+
}
|
|
3699
|
+
return _forTo(values, function (i) {
|
|
3700
|
+
return body(values[i]);
|
|
3701
|
+
}, check);
|
|
3702
|
+
}
|
|
3703
|
+
var SwapUtils = /*#__PURE__*/function () {
|
|
3704
|
+
function SwapUtils() {}
|
|
3705
|
+
/**
|
|
3706
|
+
* Retrieves min and max limits for swapping giving currencies.
|
|
3707
|
+
* Returns also conversion rate if possible with predefined amount logic.
|
|
3708
|
+
* Rate is how many "to" coins does 1 "from" coin contain.
|
|
3709
|
+
*
|
|
3710
|
+
* In case of errors returns one of reasons
|
|
3711
|
+
* - SwapProvider.NO_SWAPS_REASONS.NOT_SUPPORTED
|
|
3712
|
+
* - one of SwapProvider.COMMON_ERRORS.*
|
|
3713
|
+
*
|
|
3714
|
+
* @param swapProvider {SwapProvider}
|
|
3715
|
+
* @param fromCoin {Coin} enabled coin (to swap amount from)
|
|
3716
|
+
* @param toCoin {Coin}
|
|
3717
|
+
* @return {Promise<{
|
|
3718
|
+
* result: true,
|
|
3719
|
+
* min: string,
|
|
3720
|
+
* fiatMin: (number|null),
|
|
3721
|
+
* max: string,
|
|
3722
|
+
* fiatMax: (number|null),
|
|
3723
|
+
* rate: (string|null),
|
|
3724
|
+
* }|{
|
|
3725
|
+
* result: false,
|
|
3726
|
+
* reason: string
|
|
3727
|
+
* }>}
|
|
3728
|
+
*/
|
|
3729
|
+
SwapUtils.getInitialSwapData = function getInitialSwapData(swapProvider, fromCoin, toCoin) {
|
|
3730
|
+
try {
|
|
3731
|
+
var loggerSource = "getInitialSwapData";
|
|
3732
|
+
return Promise.resolve(_catch$1(function () {
|
|
3733
|
+
/* We use some amount here that should fit at least some of the limits of the swap providers.
|
|
3734
|
+
* So we are going to get some rate to be used as the default for the on-flight calculations before we get
|
|
3735
|
+
* the exact rate (that should be retrieved by getSwapCreationInfo method) for a specific amount.
|
|
3736
|
+
*/
|
|
3737
|
+
var defaultAmountUsd = bignumber_js.BigNumber("300");
|
|
3738
|
+
return Promise.resolve(swapProvider.getCoinToUSDTRate(fromCoin)).then(function (coinUsdRate) {
|
|
3739
|
+
var coinAmountForDefaultUsdAmount = AmountUtils.trim(coinUsdRate.result ? defaultAmountUsd.div(coinUsdRate == null ? void 0 : coinUsdRate.rate) : defaultAmountUsd, fromCoin.digits);
|
|
3740
|
+
Logger.log("Init: " + coinAmountForDefaultUsdAmount + " " + fromCoin.ticker + "->" + toCoin.ticker, loggerSource);
|
|
3741
|
+
return Promise.resolve(swapProvider.getSwapInfo(fromCoin, toCoin, coinAmountForDefaultUsdAmount)).then(function (details) {
|
|
3742
|
+
if (!details) {
|
|
3743
|
+
throw new Error("The details are empty: " + safeStringify(details));
|
|
3744
|
+
}
|
|
3745
|
+
if (!details.result) {
|
|
3746
|
+
Logger.log("Failed with reason: " + details.reason + ". " + fromCoin.ticker + "->" + toCoin.ticker, loggerSource);
|
|
3747
|
+
if ((details == null ? void 0 : details.reason) === SwapProvider.NO_SWAPS_REASONS.NOT_SUPPORTED || (details == null ? void 0 : details.reason) === SwapProvider.COMMON_ERRORS.REQUESTS_LIMIT_EXCEEDED) {
|
|
3748
|
+
return {
|
|
3749
|
+
result: false,
|
|
3750
|
+
reason: details.reason
|
|
3751
|
+
};
|
|
3752
|
+
} else {
|
|
3753
|
+
throw new Error("Unhandled error case: " + (details == null ? void 0 : details.reason));
|
|
3754
|
+
}
|
|
3755
|
+
}
|
|
3756
|
+
var fiatMin = null;
|
|
3757
|
+
var fiatMax = null;
|
|
3758
|
+
if ((coinUsdRate == null ? void 0 : coinUsdRate.rate) != null) {
|
|
3759
|
+
var usdDecimals = FiatCurrenciesService.getCurrencyDecimalCountByCode("USD");
|
|
3760
|
+
fiatMin = bignumber_js.BigNumber(details == null ? void 0 : details.smallestMin).times(coinUsdRate.rate).toFixed(usdDecimals);
|
|
3761
|
+
fiatMax = bignumber_js.BigNumber(details == null ? void 0 : details.greatestMax).times(coinUsdRate.rate).toFixed(usdDecimals);
|
|
3762
|
+
}
|
|
3763
|
+
var result = {
|
|
3764
|
+
result: true,
|
|
3765
|
+
min: details == null ? void 0 : details.smallestMin,
|
|
3766
|
+
fiatMin: fiatMin,
|
|
3767
|
+
max: details == null ? void 0 : details.greatestMax,
|
|
3768
|
+
fiatMax: fiatMax,
|
|
3769
|
+
rate: AmountUtils.trim(details.rate, 30)
|
|
3770
|
+
};
|
|
3771
|
+
Logger.log("Returning: " + safeStringify(result), loggerSource);
|
|
3772
|
+
return result;
|
|
3773
|
+
});
|
|
3774
|
+
});
|
|
3775
|
+
}, function (e) {
|
|
3776
|
+
Logger.logError(e, loggerSource, "Failed to init swap: " + safeStringify(e));
|
|
3777
|
+
improveAndRethrow(e, loggerSource);
|
|
3778
|
+
}));
|
|
3779
|
+
} catch (e) {
|
|
3780
|
+
return Promise.reject(e);
|
|
3781
|
+
}
|
|
3782
|
+
};
|
|
3783
|
+
SwapUtils.safeHandleRequestsLimitExceeding = function safeHandleRequestsLimitExceeding() {
|
|
3784
|
+
(function () {
|
|
3785
|
+
try {
|
|
3786
|
+
var _temp = _catch$1(function () {
|
|
3787
|
+
return Promise.resolve(EmailsApi.sendEmail("AUTOMATIC EMAIL - SWAPSPACE REQUESTS LIMIT EXCEEDED", "Requests limit exceeded. Urgently ask swaps provider support for limit increasing")).then(function () {});
|
|
3788
|
+
}, function (e) {
|
|
3789
|
+
Logger.log("Failed to handle limit exceeding " + safeStringify(e), "_safeHandleRequestsLimitExceeding");
|
|
3790
|
+
});
|
|
3791
|
+
return _temp && _temp.then ? _temp.then(function () {}) : void 0;
|
|
3792
|
+
} catch (e) {
|
|
3793
|
+
Promise.reject(e);
|
|
3794
|
+
}
|
|
3795
|
+
})();
|
|
3796
|
+
}
|
|
3797
|
+
|
|
3798
|
+
/**
|
|
3799
|
+
* If some swap is not found by id then there is no item in return list.
|
|
3800
|
+
*
|
|
3801
|
+
* @param swapProvider {SwapProvider}
|
|
3802
|
+
* @param swapIds {string[]}
|
|
3803
|
+
* @return {Promise<{
|
|
3804
|
+
* result: true,
|
|
3805
|
+
* swaps: ExistingSwapWithFiatData[]
|
|
3806
|
+
* }|{
|
|
3807
|
+
* result: false,
|
|
3808
|
+
* reason: string
|
|
3809
|
+
* }>}
|
|
3810
|
+
*/;
|
|
3811
|
+
SwapUtils.getExistingSwapsDetailsWithFiatAmounts = function getExistingSwapsDetailsWithFiatAmounts(swapProvider, swapIds) {
|
|
3812
|
+
try {
|
|
3813
|
+
return Promise.resolve(_catch$1(function () {
|
|
3814
|
+
return Promise.resolve(swapProvider.getExistingSwapsDetailsAndStatus(swapIds)).then(function (result) {
|
|
3815
|
+
var _temp5 = function () {
|
|
3816
|
+
if (result.result) {
|
|
3817
|
+
var _temp4 = function _temp4() {
|
|
3818
|
+
result.swaps = _extendedSwaps;
|
|
3819
|
+
};
|
|
3820
|
+
var _extendedSwaps = [];
|
|
3821
|
+
var _temp3 = _forOf(result.swaps, function (swap) {
|
|
3822
|
+
var _temp2 = function () {
|
|
3823
|
+
if (swap.status === SwapProvider.SWAP_STATUSES.REFUNDED) {
|
|
3824
|
+
return Promise.resolve(swapProvider.getCoinToUSDTRate(swap.fromCoin)).then(function (rate) {
|
|
3825
|
+
_extendedSwaps.push(ExistingSwapWithFiatData.fromExistingSwap(swap, (rate == null ? void 0 : rate.rate) != null ? bignumber_js.BigNumber(swap.fromAmount).times(rate.rate).toNumber() : null, (rate == null ? void 0 : rate.rate) != null ? bignumber_js.BigNumber(swap.toAmount).times(rate.rate).toNumber() : null, "USD", FiatCurrenciesService.getCurrencyDecimalCountByCode("USD")));
|
|
3826
|
+
});
|
|
3827
|
+
} else {
|
|
3828
|
+
return Promise.resolve(Promise.all([swapProvider.getCoinToUSDTRate(swap.fromCoin), swapProvider.getCoinToUSDTRate(swap.toCoin)])).then(function (_ref) {
|
|
3829
|
+
var fromCoinFiatRate = _ref[0],
|
|
3830
|
+
toConFiatRate = _ref[1];
|
|
3831
|
+
_extendedSwaps.push(ExistingSwapWithFiatData.fromExistingSwap(swap, (fromCoinFiatRate == null ? void 0 : fromCoinFiatRate.rate) != null ? bignumber_js.BigNumber(swap.fromAmount).times(fromCoinFiatRate.rate).toNumber() : null, (toConFiatRate == null ? void 0 : toConFiatRate.rate) != null ? bignumber_js.BigNumber(swap.toAmount).times(toConFiatRate.rate).toNumber() : null, "USD", FiatCurrenciesService.getCurrencyDecimalCountByCode("USD")));
|
|
3832
|
+
});
|
|
3833
|
+
}
|
|
3834
|
+
}();
|
|
3835
|
+
if (_temp2 && _temp2.then) return _temp2.then(function () {});
|
|
3836
|
+
});
|
|
3837
|
+
return _temp3 && _temp3.then ? _temp3.then(_temp4) : _temp4(_temp3);
|
|
3838
|
+
}
|
|
3839
|
+
}();
|
|
3840
|
+
return _temp5 && _temp5.then ? _temp5.then(function () {
|
|
3841
|
+
return result;
|
|
3842
|
+
}) : result;
|
|
3843
|
+
});
|
|
3844
|
+
}, function (e) {
|
|
3845
|
+
improveAndRethrow(e, "getExistingSwapsDetailsWithFiatAmounts");
|
|
3846
|
+
}));
|
|
3847
|
+
} catch (e) {
|
|
3848
|
+
return Promise.reject(e);
|
|
3849
|
+
}
|
|
3850
|
+
};
|
|
3851
|
+
return SwapUtils;
|
|
3852
|
+
}();
|
|
3853
|
+
|
|
3854
|
+
function _catch(body, recover) {
|
|
3855
|
+
try {
|
|
3856
|
+
var result = body();
|
|
3857
|
+
} catch (e) {
|
|
3858
|
+
return recover(e);
|
|
3859
|
+
}
|
|
3860
|
+
if (result && result.then) {
|
|
3861
|
+
return result.then(void 0, recover);
|
|
3862
|
+
}
|
|
3863
|
+
return result;
|
|
3864
|
+
}
|
|
3865
|
+
var PublicSwapService = /*#__PURE__*/function () {
|
|
3866
|
+
function PublicSwapService(API_KEYS_PROXY_URL, cache) {
|
|
3867
|
+
this._swapProvider = new SwapspaceSwapProvider(API_KEYS_PROXY_URL, cache, function () {
|
|
3868
|
+
return null;
|
|
3869
|
+
}, false);
|
|
3870
|
+
}
|
|
3871
|
+
var _proto = PublicSwapService.prototype;
|
|
3872
|
+
_proto.initialize = function initialize() {
|
|
3873
|
+
try {
|
|
3874
|
+
var _this = this;
|
|
3875
|
+
var _temp = _catch(function () {
|
|
3876
|
+
return Promise.resolve(_this._swapProvider.initialize()).then(function () {});
|
|
3877
|
+
}, function (e) {
|
|
3878
|
+
Logger.logError(e, "PublicSwapService.initialize");
|
|
3879
|
+
});
|
|
3880
|
+
return Promise.resolve(_temp && _temp.then ? _temp.then(function () {}) : void 0);
|
|
3881
|
+
} catch (e) {
|
|
3882
|
+
return Promise.reject(e);
|
|
3883
|
+
}
|
|
3884
|
+
};
|
|
3885
|
+
_proto.getDepositCurrenciesListForPublicSwap = function getDepositCurrenciesListForPublicSwap() {
|
|
3886
|
+
try {
|
|
3887
|
+
var _this2 = this;
|
|
3888
|
+
return Promise.resolve(_catch(function () {
|
|
3889
|
+
return Promise.resolve(_this2._getCurrenciesListForPublicSwap(false));
|
|
3890
|
+
}, function (e) {
|
|
3891
|
+
improveAndRethrow(e, "getDepositCurrenciesListForPublicSwap");
|
|
3892
|
+
}));
|
|
3893
|
+
} catch (e) {
|
|
3894
|
+
return Promise.reject(e);
|
|
3895
|
+
}
|
|
3896
|
+
};
|
|
3897
|
+
_proto.getWithdrawCurrenciesListForPublicSwap = function getWithdrawCurrenciesListForPublicSwap() {
|
|
3898
|
+
try {
|
|
3899
|
+
var _this3 = this;
|
|
3900
|
+
return Promise.resolve(_catch(function () {
|
|
3901
|
+
return Promise.resolve(_this3._getCurrenciesListForPublicSwap(true));
|
|
3902
|
+
}, function (e) {
|
|
3903
|
+
improveAndRethrow(e, "getWithdrawCurrenciesListForPublicSwap");
|
|
3904
|
+
}));
|
|
3905
|
+
} catch (e) {
|
|
3906
|
+
return Promise.reject(e);
|
|
3907
|
+
}
|
|
3908
|
+
};
|
|
3909
|
+
_proto._getCurrenciesListForPublicSwap = function _getCurrenciesListForPublicSwap(withdraw) {
|
|
3910
|
+
if (withdraw === void 0) {
|
|
3911
|
+
withdraw = false;
|
|
3912
|
+
}
|
|
3913
|
+
try {
|
|
3914
|
+
var _this4 = this;
|
|
3915
|
+
var loggerSource = "getCurrenciesListForPublicSwap";
|
|
3916
|
+
return Promise.resolve(_catch(function () {
|
|
3917
|
+
return Promise.resolve(withdraw ? _this4._swapProvider.getWithdrawalCurrencies() : _this4._swapProvider.getDepositCurrencies()).then(function (result) {
|
|
3918
|
+
var _result$coins;
|
|
3919
|
+
if (result.reason === SwapProvider.COMMON_ERRORS.REQUESTS_LIMIT_EXCEEDED) {
|
|
3920
|
+
SwapUtils.safeHandleRequestsLimitExceeding();
|
|
3921
|
+
return {
|
|
3922
|
+
result: false,
|
|
3923
|
+
reason: PublicSwapService.PUBLIC_SWAPS_COMMON_ERRORS.REQUESTS_LIMIT_EXCEEDED
|
|
3924
|
+
};
|
|
3925
|
+
}
|
|
3926
|
+
Logger.log("Retrieved " + (result == null || (_result$coins = result.coins) == null ? void 0 : _result$coins.length) + " supported currencies for swap", loggerSource);
|
|
3927
|
+
if (result.coins.length > 1) {
|
|
3928
|
+
var temp = result.coins[0];
|
|
3929
|
+
result.coins[0] = result.coins[1];
|
|
3930
|
+
result.coins[1] = temp;
|
|
3931
|
+
}
|
|
3932
|
+
return {
|
|
3933
|
+
result: true,
|
|
3934
|
+
coins: result.coins
|
|
3935
|
+
};
|
|
3936
|
+
});
|
|
3937
|
+
}, function (e) {
|
|
3938
|
+
improveAndRethrow(e, loggerSource);
|
|
3939
|
+
}));
|
|
3940
|
+
} catch (e) {
|
|
3941
|
+
return Promise.reject(e);
|
|
3942
|
+
}
|
|
3943
|
+
}
|
|
3944
|
+
/**
|
|
3945
|
+
* Retrieves initial data for swapping two coins.
|
|
3946
|
+
*
|
|
3947
|
+
* @param fromCoin {Coin}
|
|
3948
|
+
* @param toCoin {Coin}
|
|
3949
|
+
* @return {Promise<{
|
|
3950
|
+
* result: true,
|
|
3951
|
+
* min: string,
|
|
3952
|
+
* fiatMin: (number|null),
|
|
3953
|
+
* max: string,
|
|
3954
|
+
* fiatMax: (number|null),
|
|
3955
|
+
* rate: (string|null)
|
|
3956
|
+
* }|{
|
|
3957
|
+
* result: false,
|
|
3958
|
+
* reason: string
|
|
3959
|
+
* }>}
|
|
3960
|
+
*/
|
|
3961
|
+
;
|
|
3962
|
+
_proto.getInitialPublicSwapData = function getInitialPublicSwapData(fromCoin, toCoin) {
|
|
3963
|
+
try {
|
|
3964
|
+
var _this5 = this;
|
|
3965
|
+
return Promise.resolve(_catch(function () {
|
|
3966
|
+
return Promise.resolve(SwapUtils.getInitialSwapData(_this5._swapProvider, fromCoin, toCoin)).then(function (result) {
|
|
3967
|
+
if (!result.result) {
|
|
3968
|
+
if (result.reason === SwapProvider.COMMON_ERRORS.REQUESTS_LIMIT_EXCEEDED) {
|
|
3969
|
+
SwapUtils.safeHandleRequestsLimitExceeding();
|
|
3970
|
+
return {
|
|
3971
|
+
result: false,
|
|
3972
|
+
reason: PublicSwapService.PUBLIC_SWAPS_COMMON_ERRORS.REQUESTS_LIMIT_EXCEEDED
|
|
3973
|
+
};
|
|
3974
|
+
}
|
|
3975
|
+
if (result.reason === SwapProvider.NO_SWAPS_REASONS.NOT_SUPPORTED) {
|
|
3976
|
+
return {
|
|
3977
|
+
result: false,
|
|
3978
|
+
reason: PublicSwapService.PUBLIC_SWAP_DETAILS_FAIL_REASONS.PAIR_NOT_SUPPORTED
|
|
3979
|
+
};
|
|
3980
|
+
}
|
|
3981
|
+
}
|
|
3982
|
+
return result;
|
|
3983
|
+
});
|
|
3984
|
+
}, function (e) {
|
|
3985
|
+
improveAndRethrow(e, "getInitialPublicSwapData");
|
|
3986
|
+
}));
|
|
3987
|
+
} catch (e) {
|
|
3988
|
+
return Promise.reject(e);
|
|
3989
|
+
}
|
|
3990
|
+
}
|
|
3991
|
+
/**
|
|
3992
|
+
* Retrieves swap details that can be used to create swap.
|
|
3993
|
+
*
|
|
3994
|
+
* @param fromCoin {Coin}
|
|
3995
|
+
* @param toCoin {Coin}
|
|
3996
|
+
* @param fromAmountCoins {string}
|
|
3997
|
+
* @return {Promise<{
|
|
3998
|
+
* result: false,
|
|
3999
|
+
* reason: string,
|
|
4000
|
+
* min: (string|null),
|
|
4001
|
+
* max: (string|null),
|
|
4002
|
+
* rate: (string|undefined),
|
|
4003
|
+
* fiatMin: (number|null),
|
|
4004
|
+
* fiatMax: (number|null)
|
|
4005
|
+
* }|{
|
|
4006
|
+
* result: true,
|
|
4007
|
+
* swapCreationInfo: BaseSwapCreationInfo
|
|
4008
|
+
* }>}
|
|
4009
|
+
*/
|
|
4010
|
+
;
|
|
4011
|
+
_proto.getPublicSwapDetails = function getPublicSwapDetails(fromCoin, toCoin, fromAmountCoins) {
|
|
4012
|
+
try {
|
|
4013
|
+
var _this6 = this;
|
|
4014
|
+
var loggerSource = "getPublicSwapDetails";
|
|
4015
|
+
return Promise.resolve(_catch(function () {
|
|
4016
|
+
return Promise.resolve(_this6._swapProvider.getCoinToUSDTRate(fromCoin)).then(function (_this6$_swapProvider$) {
|
|
4017
|
+
var _this6$_swapProvider$2;
|
|
4018
|
+
var coinUsdtRate = (_this6$_swapProvider$2 = _this6$_swapProvider$ == null ? void 0 : _this6$_swapProvider$.rate) != null ? _this6$_swapProvider$2 : null;
|
|
4019
|
+
return Promise.resolve(_this6._swapProvider.getSwapInfo(fromCoin, toCoin, fromAmountCoins, coinUsdtRate)).then(function (details) {
|
|
4020
|
+
var _result$swapCreationI, _result$swapCreationI2;
|
|
4021
|
+
var min = details.result ? details.min : details.smallestMin;
|
|
4022
|
+
var max = details.result ? details.max : details.greatestMax;
|
|
4023
|
+
var fiatMin = null,
|
|
4024
|
+
fiatMax = null;
|
|
4025
|
+
if (coinUsdtRate != null) {
|
|
4026
|
+
if (min != null) {
|
|
4027
|
+
fiatMin = bignumber_js.BigNumber(min).times(coinUsdtRate).toFixed(PublicSwapService._fiatDecimalsCount);
|
|
4028
|
+
}
|
|
4029
|
+
if (max != null) {
|
|
4030
|
+
fiatMax = bignumber_js.BigNumber(max).times(coinUsdtRate).toFixed(PublicSwapService._fiatDecimalsCount);
|
|
4031
|
+
}
|
|
4032
|
+
}
|
|
4033
|
+
var composeFailResult = function composeFailResult(reason) {
|
|
4034
|
+
var _details$rate;
|
|
4035
|
+
return {
|
|
4036
|
+
result: false,
|
|
4037
|
+
reason: reason,
|
|
4038
|
+
min: min != null ? min : null,
|
|
4039
|
+
fiatMin: fiatMin,
|
|
4040
|
+
max: max != null ? max : null,
|
|
4041
|
+
fiatMax: fiatMax,
|
|
4042
|
+
rate: (_details$rate = details.rate) != null ? _details$rate : null
|
|
4043
|
+
};
|
|
4044
|
+
};
|
|
4045
|
+
if (!details.result) {
|
|
4046
|
+
if ((details == null ? void 0 : details.reason) === SwapProvider.NO_SWAPS_REASONS.NOT_SUPPORTED) return composeFailResult(PublicSwapService.PUBLIC_SWAP_DETAILS_FAIL_REASONS.PAIR_NOT_SUPPORTED);else if ((details == null ? void 0 : details.reason) === SwapProvider.COMMON_ERRORS.REQUESTS_LIMIT_EXCEEDED) {
|
|
4047
|
+
SwapUtils.safeHandleRequestsLimitExceeding();
|
|
4048
|
+
return composeFailResult(PublicSwapService.PUBLIC_SWAPS_COMMON_ERRORS.REQUESTS_LIMIT_EXCEEDED);
|
|
4049
|
+
}
|
|
4050
|
+
}
|
|
4051
|
+
var fromAmountBigNumber = bignumber_js.BigNumber(fromAmountCoins);
|
|
4052
|
+
if (typeof min === "string" && fromAmountBigNumber.lt(min)) {
|
|
4053
|
+
return composeFailResult(PublicSwapService.PUBLIC_SWAP_DETAILS_FAIL_REASONS.AMOUNT_LESS_THAN_MIN_SWAPPABLE);
|
|
4054
|
+
} else if (typeof max === "string" && fromAmountBigNumber.gt(max)) {
|
|
4055
|
+
return composeFailResult(PublicSwapService.PUBLIC_SWAP_DETAILS_FAIL_REASONS.AMOUNT_HIGHER_THAN_MAX_SWAPPABLE);
|
|
4056
|
+
}
|
|
4057
|
+
var toAmountCoins = AmountUtils.trim(fromAmountBigNumber.times(details.rate), fromCoin.digits);
|
|
4058
|
+
var result = {
|
|
4059
|
+
result: true,
|
|
4060
|
+
swapCreationInfo: new BaseSwapCreationInfo(fromCoin, toCoin, fromAmountCoins, toAmountCoins, details.rate, details.rawSwapData, min, fiatMin, max, fiatMax, details.durationMinutesRange)
|
|
4061
|
+
};
|
|
4062
|
+
Logger.log("Result: " + safeStringify({
|
|
4063
|
+
result: result.result,
|
|
4064
|
+
swapCreationInfo: _extends({}, result.swapCreationInfo, {
|
|
4065
|
+
fromCoin: result == null || (_result$swapCreationI = result.swapCreationInfo) == null || (_result$swapCreationI = _result$swapCreationI.fromCoin) == null ? void 0 : _result$swapCreationI.ticker,
|
|
4066
|
+
toCoin: result == null || (_result$swapCreationI2 = result.swapCreationInfo) == null || (_result$swapCreationI2 = _result$swapCreationI2.toCoin) == null ? void 0 : _result$swapCreationI2.ticker
|
|
4067
|
+
})
|
|
4068
|
+
}), loggerSource);
|
|
4069
|
+
return result;
|
|
4070
|
+
});
|
|
4071
|
+
});
|
|
4072
|
+
}, function (e) {
|
|
4073
|
+
improveAndRethrow(e, loggerSource);
|
|
4074
|
+
}));
|
|
4075
|
+
} catch (e) {
|
|
4076
|
+
return Promise.reject(e);
|
|
4077
|
+
}
|
|
4078
|
+
}
|
|
4079
|
+
/**
|
|
4080
|
+
* Creates swap by given params.
|
|
4081
|
+
*
|
|
4082
|
+
* @param fromCoin {Coin}
|
|
4083
|
+
* @param toCoin {Coin}
|
|
4084
|
+
* @param fromAmount {string}
|
|
4085
|
+
* @param swapCreationInfo {BaseSwapCreationInfo}
|
|
4086
|
+
* @param toAddress {string}
|
|
4087
|
+
* @param refundAddress {string}
|
|
4088
|
+
* @param clientIp {string}
|
|
4089
|
+
* @return {Promise<{
|
|
4090
|
+
* result: true,
|
|
4091
|
+
* fiatCurrencyCode: string,
|
|
4092
|
+
* toCoin: Coin,
|
|
4093
|
+
* fromAmountFiat: (number|null),
|
|
4094
|
+
* address: string,
|
|
4095
|
+
* durationMinutesRange: string,
|
|
4096
|
+
* fromAmount: string,
|
|
4097
|
+
* toAmount: string,
|
|
4098
|
+
* toAmountFiat: (number|null),
|
|
4099
|
+
* fiatCurrencyDecimals: number,
|
|
4100
|
+
* fromCoin: Coin,
|
|
4101
|
+
* rate: string,
|
|
4102
|
+
* swapId: string
|
|
4103
|
+
* }|{
|
|
4104
|
+
* result: false,
|
|
4105
|
+
* reason: string
|
|
4106
|
+
* }>}
|
|
4107
|
+
*/
|
|
4108
|
+
;
|
|
4109
|
+
_proto.createPublicSwap = function createPublicSwap(fromCoin, toCoin, fromAmount, swapCreationInfo, toAddress, refundAddress, clientIp) {
|
|
4110
|
+
try {
|
|
4111
|
+
var _this7 = this;
|
|
4112
|
+
var loggerSource = "createPublicSwap";
|
|
4113
|
+
return Promise.resolve(_catch(function () {
|
|
4114
|
+
var _swapCreationInfo$fro, _swapCreationInfo$toC;
|
|
4115
|
+
if (!(fromCoin instanceof Coin) || !(toCoin instanceof Coin) || typeof fromAmount !== "string" || typeof toAddress !== "string" || typeof refundAddress !== "string" || !(swapCreationInfo instanceof BaseSwapCreationInfo)) {
|
|
4116
|
+
throw new Error("Wrong input: " + fromCoin.ticker + " " + toCoin.ticker + " " + fromAmount + " " + swapCreationInfo);
|
|
4117
|
+
}
|
|
4118
|
+
Logger.log("Start: " + fromAmount + " " + fromCoin.ticker + " -> " + toCoin.ticker + ". Details: " + safeStringify(_extends({}, swapCreationInfo, {
|
|
4119
|
+
fromCoin: swapCreationInfo == null || (_swapCreationInfo$fro = swapCreationInfo.fromCoin) == null ? void 0 : _swapCreationInfo$fro.ticker,
|
|
4120
|
+
toCoin: swapCreationInfo == null || (_swapCreationInfo$toC = swapCreationInfo.toCoin) == null ? void 0 : _swapCreationInfo$toC.ticker
|
|
4121
|
+
})), loggerSource);
|
|
4122
|
+
return Promise.resolve(_this7._swapProvider.createSwap(fromCoin, toCoin, fromAmount, toAddress, refundAddress, swapCreationInfo.rawSwapData, clientIp)).then(function (result) {
|
|
4123
|
+
var _exit;
|
|
4124
|
+
function _temp5(_result7) {
|
|
4125
|
+
if (_exit) return _result7;
|
|
4126
|
+
throw new Error("Unexpected result from provider " + safeStringify(result));
|
|
4127
|
+
}
|
|
4128
|
+
Logger.log("Created:" + safeStringify(_extends({}, result, {
|
|
4129
|
+
fromCoin: fromCoin == null ? void 0 : fromCoin.ticker,
|
|
4130
|
+
toCoin: toCoin == null ? void 0 : toCoin.ticker
|
|
4131
|
+
})), loggerSource);
|
|
4132
|
+
if (!(result != null && result.result)) {
|
|
4133
|
+
if ((result == null ? void 0 : result.reason) === SwapProvider.COMMON_ERRORS.REQUESTS_LIMIT_EXCEEDED) {
|
|
4134
|
+
SwapUtils.safeHandleRequestsLimitExceeding();
|
|
4135
|
+
return {
|
|
4136
|
+
result: false,
|
|
4137
|
+
reason: PublicSwapService.PUBLIC_SWAPS_COMMON_ERRORS.REQUESTS_LIMIT_EXCEEDED
|
|
4138
|
+
};
|
|
4139
|
+
}
|
|
4140
|
+
if ((result == null ? void 0 : result.reason) === SwapProvider.CREATION_FAIL_REASONS.RETRIABLE_FAIL) {
|
|
4141
|
+
// TODO: [feature, high] implement retrying if one partner fail and we have another partners task_id=a07e367e488f4a4899613ac9056fa359
|
|
4142
|
+
// return {
|
|
4143
|
+
// result: false,
|
|
4144
|
+
// reason: PublicSwapService.SWAP_CREATION_FAIL_REASONS.RETRIABLE_FAIL,
|
|
4145
|
+
// };
|
|
4146
|
+
}
|
|
4147
|
+
}
|
|
4148
|
+
var _temp4 = function () {
|
|
4149
|
+
if (result.result && result != null && result.swapId) {
|
|
4150
|
+
var _temp3 = function _temp3() {
|
|
4151
|
+
EventBusInstance__default["default"].dispatch(PublicSwapService.PUBLIC_SWAP_CREATED_EVENT, null, fromCoin.ticker, toCoin.ticker, _fromAmountFiat);
|
|
4152
|
+
var toReturn = {
|
|
4153
|
+
result: true,
|
|
4154
|
+
swapId: result.swapId,
|
|
4155
|
+
fromCoin: fromCoin,
|
|
4156
|
+
toCoin: toCoin,
|
|
4157
|
+
fromAmount: result.fromAmount,
|
|
4158
|
+
toAmount: result.toAmount,
|
|
4159
|
+
fromAmountFiat: _fromAmountFiat,
|
|
4160
|
+
toAmountFiat: _toAmountFiat,
|
|
4161
|
+
fiatCurrencyCode: "USD",
|
|
4162
|
+
fiatCurrencyDecimals: PublicSwapService._fiatDecimalsCount,
|
|
4163
|
+
rate: result.rate,
|
|
4164
|
+
durationMinutesRange: swapCreationInfo.durationMinutesRange,
|
|
4165
|
+
address: result.fromAddress // CRITICAL: this is the address to send coins to swaps provider
|
|
4166
|
+
};
|
|
4167
|
+
_this7._savePublicSwapIdLocally(result.swapId);
|
|
4168
|
+
Logger.log("Returning: " + safeStringify(_extends({}, toReturn, {
|
|
4169
|
+
fromCoin: fromCoin == null ? void 0 : fromCoin.ticker,
|
|
4170
|
+
toCoin: toCoin == null ? void 0 : toCoin.ticker
|
|
4171
|
+
})), loggerSource);
|
|
4172
|
+
_exit = 1;
|
|
4173
|
+
return toReturn;
|
|
4174
|
+
};
|
|
4175
|
+
var _fromAmountFiat = null,
|
|
4176
|
+
_toAmountFiat = null;
|
|
4177
|
+
var _temp2 = _catch(function () {
|
|
4178
|
+
return Promise.resolve(_this7._swapProvider.getCoinToUSDTRate(fromCoin)).then(function (_this7$_swapProvider$) {
|
|
4179
|
+
var _this7$_swapProvider$3;
|
|
4180
|
+
var fromCoinUsdtRate = (_this7$_swapProvider$3 = _this7$_swapProvider$ == null ? void 0 : _this7$_swapProvider$.rate) != null ? _this7$_swapProvider$3 : null;
|
|
4181
|
+
return Promise.resolve(_this7._swapProvider.getCoinToUSDTRate(fromCoin)).then(function (_this7$_swapProvider$2) {
|
|
4182
|
+
var _this7$_swapProvider$4;
|
|
4183
|
+
var toCoinUsdtRate = (_this7$_swapProvider$4 = _this7$_swapProvider$2 == null ? void 0 : _this7$_swapProvider$2.rate) != null ? _this7$_swapProvider$4 : null;
|
|
4184
|
+
if (fromCoinUsdtRate != null && result.fromAmount != null) {
|
|
4185
|
+
_fromAmountFiat = bignumber_js.BigNumber(result.fromAmount).times(fromCoinUsdtRate).toFixed(PublicSwapService._fiatDecimalsCount);
|
|
4186
|
+
}
|
|
4187
|
+
if (toCoinUsdtRate != null && result.toAmount != null) {
|
|
4188
|
+
_toAmountFiat = bignumber_js.BigNumber(result.toAmount).times(toCoinUsdtRate).toFixed(PublicSwapService._fiatDecimalsCount);
|
|
4189
|
+
}
|
|
4190
|
+
});
|
|
4191
|
+
});
|
|
4192
|
+
}, function (e) {
|
|
4193
|
+
Logger.logError(e, loggerSource, "Failed to calculate fiat amounts for result");
|
|
4194
|
+
});
|
|
4195
|
+
return _temp2 && _temp2.then ? _temp2.then(_temp3) : _temp3(_temp2);
|
|
4196
|
+
}
|
|
4197
|
+
}();
|
|
4198
|
+
return _temp4 && _temp4.then ? _temp4.then(_temp5) : _temp5(_temp4);
|
|
4199
|
+
});
|
|
4200
|
+
}, function (e) {
|
|
4201
|
+
improveAndRethrow(e, loggerSource);
|
|
4202
|
+
}));
|
|
4203
|
+
} catch (e) {
|
|
4204
|
+
return Promise.reject(e);
|
|
4205
|
+
}
|
|
4206
|
+
}
|
|
4207
|
+
/**
|
|
4208
|
+
* Retrieves swap details and status for existing swaps by their ids.
|
|
4209
|
+
*
|
|
4210
|
+
* @param swapIds {string[]}
|
|
4211
|
+
* @return {Promise<{
|
|
4212
|
+
* result: true,
|
|
4213
|
+
* swaps: ExistingSwapWithFiatData[]
|
|
4214
|
+
* }|{
|
|
4215
|
+
* result: false,
|
|
4216
|
+
* reason: string
|
|
4217
|
+
* }>}
|
|
4218
|
+
* error reason is one of PUBLIC_SWAPS_COMMON_ERRORS
|
|
4219
|
+
*/
|
|
4220
|
+
;
|
|
4221
|
+
_proto.getPublicExistingSwapDetailsAndStatus = function getPublicExistingSwapDetailsAndStatus(swapIds) {
|
|
4222
|
+
try {
|
|
4223
|
+
var _this8 = this;
|
|
4224
|
+
var loggerSource = "getPublicExistingSwapDetailsAndStatus";
|
|
4225
|
+
return Promise.resolve(_catch(function () {
|
|
4226
|
+
return Promise.resolve(SwapUtils.getExistingSwapsDetailsWithFiatAmounts(_this8._swapProvider, swapIds)).then(function (result) {
|
|
4227
|
+
if (!(result != null && result.result)) {
|
|
4228
|
+
if (result.reason === SwapProvider.COMMON_ERRORS.REQUESTS_LIMIT_EXCEEDED) {
|
|
4229
|
+
SwapUtils.safeHandleRequestsLimitExceeding();
|
|
4230
|
+
return {
|
|
4231
|
+
result: false,
|
|
4232
|
+
reason: PublicSwapService.PUBLIC_SWAPS_COMMON_ERRORS.REQUESTS_LIMIT_EXCEEDED
|
|
4233
|
+
};
|
|
4234
|
+
}
|
|
4235
|
+
throw new Error("Unknown reason: " + (result == null ? void 0 : result.reason));
|
|
4236
|
+
}
|
|
4237
|
+
return result;
|
|
4238
|
+
});
|
|
4239
|
+
}, function (e) {
|
|
4240
|
+
improveAndRethrow(e, loggerSource);
|
|
4241
|
+
}));
|
|
4242
|
+
} catch (e) {
|
|
4243
|
+
return Promise.reject(e);
|
|
4244
|
+
}
|
|
4245
|
+
}
|
|
4246
|
+
/**
|
|
4247
|
+
* Retrieves the whole available swaps history by ids saved locally.
|
|
4248
|
+
*
|
|
4249
|
+
* @return {Promise<{
|
|
4250
|
+
* result: true,
|
|
4251
|
+
* swaps: ExistingSwapWithFiatData[]
|
|
4252
|
+
* }|{
|
|
4253
|
+
* result: false,
|
|
4254
|
+
* reason: string
|
|
4255
|
+
* }>}
|
|
4256
|
+
*/
|
|
4257
|
+
;
|
|
4258
|
+
_proto.getPublicSwapsHistory = function getPublicSwapsHistory() {
|
|
4259
|
+
try {
|
|
4260
|
+
var _exit2;
|
|
4261
|
+
var _this9 = this;
|
|
4262
|
+
return Promise.resolve(_catch(function () {
|
|
4263
|
+
function _temp7(_result9) {
|
|
4264
|
+
return _exit2 ? _result9 : {
|
|
4265
|
+
result: true,
|
|
4266
|
+
swaps: []
|
|
4267
|
+
};
|
|
4268
|
+
}
|
|
4269
|
+
var swapIds = _this9._getPublicSwapIdsSavedLocally();
|
|
4270
|
+
var _temp6 = function () {
|
|
4271
|
+
if (swapIds.length) {
|
|
4272
|
+
return Promise.resolve(_this9.getPublicExistingSwapDetailsAndStatus(swapIds)).then(function (_await$_this9$getPubl) {
|
|
4273
|
+
_exit2 = 1;
|
|
4274
|
+
return _await$_this9$getPubl;
|
|
4275
|
+
});
|
|
4276
|
+
}
|
|
4277
|
+
}();
|
|
4278
|
+
return _temp6 && _temp6.then ? _temp6.then(_temp7) : _temp7(_temp6);
|
|
4279
|
+
}, function (e) {
|
|
4280
|
+
improveAndRethrow(e, "getPublicSwapsHistory");
|
|
4281
|
+
}));
|
|
4282
|
+
} catch (e) {
|
|
4283
|
+
return Promise.reject(e);
|
|
4284
|
+
}
|
|
4285
|
+
}
|
|
4286
|
+
/**
|
|
4287
|
+
* @param swapId {string}
|
|
4288
|
+
* @private
|
|
4289
|
+
*/
|
|
4290
|
+
;
|
|
4291
|
+
_proto._savePublicSwapIdLocally = function _savePublicSwapIdLocally(swapId) {
|
|
4292
|
+
if (typeof window !== "undefined") {
|
|
4293
|
+
try {
|
|
4294
|
+
var saved = localStorage.getItem("publicSwapIds");
|
|
4295
|
+
var ids = typeof saved === "string" && saved.length > 0 ? saved.split(",") : [];
|
|
4296
|
+
ids.push(swapId);
|
|
4297
|
+
localStorage.setItem("publicSwapIds", ids.join(","));
|
|
4298
|
+
} catch (e) {
|
|
4299
|
+
improveAndRethrow(e, "_savePublicSwapIdLocally");
|
|
4300
|
+
}
|
|
4301
|
+
}
|
|
4302
|
+
}
|
|
4303
|
+
|
|
4304
|
+
/**
|
|
4305
|
+
* @private
|
|
4306
|
+
* @return {string[]}
|
|
4307
|
+
*/;
|
|
4308
|
+
_proto._getPublicSwapIdsSavedLocally = function _getPublicSwapIdsSavedLocally() {
|
|
4309
|
+
if (typeof window !== "undefined") {
|
|
4310
|
+
try {
|
|
4311
|
+
var saved = localStorage.getItem("publicSwapIds");
|
|
4312
|
+
return typeof saved === "string" && saved.length > 0 ? saved.split(",") : [];
|
|
4313
|
+
} catch (e) {
|
|
4314
|
+
improveAndRethrow(e, "_getPublicSwapIdsSavedLocally");
|
|
4315
|
+
}
|
|
4316
|
+
}
|
|
4317
|
+
}
|
|
4318
|
+
|
|
4319
|
+
/**
|
|
4320
|
+
* @param coinOrTicker {Coin|string}
|
|
4321
|
+
* @return {string} icon URL (ready to use)
|
|
4322
|
+
*/;
|
|
4323
|
+
_proto.getAssetIconUrl = function getAssetIconUrl(coinOrTicker) {
|
|
4324
|
+
return this._swapProvider.getIconUrl(coinOrTicker);
|
|
4325
|
+
}
|
|
4326
|
+
|
|
4327
|
+
/**
|
|
4328
|
+
* @param ticker {string}
|
|
4329
|
+
* @return {Coin|null}
|
|
4330
|
+
*/;
|
|
4331
|
+
_proto.getCoinByTickerIfPresent = function getCoinByTickerIfPresent(ticker) {
|
|
4332
|
+
return this._swapProvider.getCoinByTickerIfPresent(ticker);
|
|
4333
|
+
}
|
|
4334
|
+
|
|
4335
|
+
/**
|
|
4336
|
+
* TODO: [feature, moderate] add other fiat currencies support. task_id=5490e21b8b9c4f89a2247b28db3c9e0a
|
|
4337
|
+
* @param asset {Coin}
|
|
4338
|
+
* @return {Promise<string|null>}
|
|
4339
|
+
*/;
|
|
4340
|
+
_proto.getAssetToUsdtRate = function getAssetToUsdtRate(asset) {
|
|
4341
|
+
try {
|
|
4342
|
+
var _this10 = this;
|
|
4343
|
+
return Promise.resolve(_catch(function () {
|
|
4344
|
+
return Promise.resolve(_this10._swapProvider.getCoinToUSDTRate(asset)).then(function (result) {
|
|
4345
|
+
var _result$rate;
|
|
4346
|
+
return (_result$rate = result == null ? void 0 : result.rate) != null ? _result$rate : null;
|
|
4347
|
+
});
|
|
4348
|
+
}, function (e) {
|
|
4349
|
+
improveAndRethrow(e, "getAssetToUsdtRate");
|
|
4350
|
+
}));
|
|
4351
|
+
} catch (e) {
|
|
4352
|
+
return Promise.reject(e);
|
|
4353
|
+
}
|
|
4354
|
+
}
|
|
4355
|
+
/**
|
|
4356
|
+
* @param asset {Coin}
|
|
4357
|
+
* @param address {string}
|
|
4358
|
+
* @return {boolean}
|
|
4359
|
+
*/
|
|
4360
|
+
;
|
|
4361
|
+
_proto.isAddressValidForAsset = function isAddressValidForAsset(asset, address) {
|
|
4362
|
+
try {
|
|
4363
|
+
return this._swapProvider.isAddressValidForAsset(asset, address);
|
|
4364
|
+
} catch (e) {
|
|
4365
|
+
improveAndRethrow(e, "isAddressValidForAsset");
|
|
4366
|
+
}
|
|
4367
|
+
};
|
|
4368
|
+
return PublicSwapService;
|
|
4369
|
+
}();
|
|
4370
|
+
PublicSwapService.PUBLIC_SWAP_CREATED_EVENT = "publicSwapCreatedEvent";
|
|
4371
|
+
PublicSwapService.PUBLIC_SWAPS_COMMON_ERRORS = {
|
|
4372
|
+
REQUESTS_LIMIT_EXCEEDED: "requestsLimitExceeded"
|
|
4373
|
+
};
|
|
4374
|
+
PublicSwapService.PUBLIC_SWAP_DETAILS_FAIL_REASONS = {
|
|
4375
|
+
AMOUNT_LESS_THAN_MIN_SWAPPABLE: "amountLessThanMinSwappable",
|
|
4376
|
+
AMOUNT_HIGHER_THAN_MAX_SWAPPABLE: "amountHigherThanMaxSwappable",
|
|
4377
|
+
PAIR_NOT_SUPPORTED: "pairNotSupported"
|
|
4378
|
+
};
|
|
4379
|
+
PublicSwapService._fiatDecimalsCount = FiatCurrenciesService.getCurrencyDecimalCountByCode("USD");
|
|
4380
|
+
|
|
4381
|
+
exports.AmountUtils = AmountUtils;
|
|
4382
|
+
exports.AssetIcon = AssetIcon;
|
|
4383
|
+
exports.BaseSwapCreationInfo = BaseSwapCreationInfo;
|
|
4384
|
+
exports.Blockchain = Blockchain;
|
|
4385
|
+
exports.Button = Button;
|
|
4386
|
+
exports.Cache = Cache;
|
|
4387
|
+
exports.Coin = Coin;
|
|
4388
|
+
exports.EmailsApi = EmailsApi;
|
|
4389
|
+
exports.ExistingSwap = ExistingSwap;
|
|
4390
|
+
exports.ExistingSwapWithFiatData = ExistingSwapWithFiatData;
|
|
4391
|
+
exports.FiatCurrenciesService = FiatCurrenciesService;
|
|
4392
|
+
exports.LoadingDots = LoadingDots;
|
|
4393
|
+
exports.Logger = Logger;
|
|
4394
|
+
exports.LogsStorage = LogsStorage;
|
|
4395
|
+
exports.Protocol = Protocol;
|
|
4396
|
+
exports.PublicSwapService = PublicSwapService;
|
|
4397
|
+
exports.SupportChat = SupportChat;
|
|
4398
|
+
exports.SwapProvider = SwapProvider;
|
|
4399
|
+
exports.SwapUtils = SwapUtils;
|
|
4400
|
+
exports.SwapspaceSwapProvider = SwapspaceSwapProvider;
|
|
4401
|
+
exports.improveAndRethrow = improveAndRethrow;
|
|
4402
|
+
exports.safeStringify = safeStringify;
|
|
4403
|
+
exports.useCallHandlingErrors = useCallHandlingErrors;
|
|
4404
|
+
exports.useReferredState = useReferredState;
|
|
2
4405
|
//# sourceMappingURL=index.cjs.map
|