@hackler/react-sdk 3.0.2 → 3.0.3
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/lib/config.d.ts +1 -1
- package/lib/index.es.js +1 -1
- package/lib/index.js +1 -1
- package/lib/index.umd.js +1 -1
- package/package.json +3 -3
package/lib/config.d.ts
CHANGED
package/lib/index.es.js
CHANGED
package/lib/index.js
CHANGED
package/lib/index.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@hackler/js-client-sdk")):"function"==typeof define&&define.amd?define(["exports","@hackler/js-client-sdk"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).hackleReactSDK={},e.Hackle)}(this,function(t,r){"use strict";function e(r){if(r&&r.__esModule)return r;var n=Object.create(null);return r&&Object.keys(r).forEach(function(e){var t;"default"!==e&&(t=Object.getOwnPropertyDescriptor(r,e),Object.defineProperty(n,e,t.get?t:{enumerable:!0,get:function(){return r[e]}}))}),n.default=r,Object.freeze(n)}var n=e(r),c=function(){return(c=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function f(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),u=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)u.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u}var o=(i.prototype.variation=function(e,t,r){return this.client.variation(e,t,r)},i.prototype.variationDetail=function(e,t,r){return this.client.variationDetail(e,t,r)},i.prototype.isFeatureOn=function(e,t){return this.client.isFeatureOn(e,t)},i.prototype.featureFlagDetail=function(e,t){return this.client.featureFlagDetail(e,t)},i.prototype.track=function(e,t){this.client.track(e,t)},i.prototype.trackPageView=function(e){this.client.trackPageView(e)},i.prototype.onReady=function(e,t){this.client.onReady(e,t)},i);function i(e,t){this.client=n.createInstance(e,c(c({},t),{SDK_NAME_HEADER:"react-sdk",SDK_VERSION_HEADER:"3.0.2"}))}var l={exports:{}},u={},s=Object.getOwnPropertySymbols,p=Object.prototype.hasOwnProperty,y=Object.prototype.propertyIsEnumerable;var Ne=function(){try{if(!Object.assign)return;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return;for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return;var n={};return"abcdefghijklmnopqrst".split("").forEach(function(e){n[e]=e}),"abcdefghijklmnopqrst"!==Object.keys(Object.assign({},n)).join("")?void 0:1}catch(e){return}}()?Object.assign:function(e,t){for(var r,n=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),o=1;o<arguments.length;o++){for(var i in r=Object(arguments[o]))p.call(r,i)&&(n[i]=r[i]);if(s)for(var u=s(r),a=0;a<u.length;a++)y.call(r,u[a])&&(n[u[a]]=r[u[a]])}return n},h=Ne,a="function"==typeof Symbol&&Symbol.for,d=a?Symbol.for("react.element"):60103,m=a?Symbol.for("react.portal"):60106,v=a?Symbol.for("react.fragment"):60107,E=a?Symbol.for("react.strict_mode"):60108,g=a?Symbol.for("react.profiler"):60114,T=a?Symbol.for("react.provider"):60109,b=a?Symbol.for("react.context"):60110,_=a?Symbol.for("react.forward_ref"):60112,R=a?Symbol.for("react.suspense"):60113,w=a?Symbol.for("react.memo"):60115,O=a?Symbol.for("react.lazy"):60116,A="function"==typeof Symbol&&Symbol.iterator;function k(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var C={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},N={};function I(e,t,r){this.props=e,this.context=t,this.refs=N,this.updater=r||C}function x(){}function P(e,t,r){this.props=e,this.context=t,this.refs=N,this.updater=r||C}I.prototype.isReactComponent={},I.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error(k(85));this.updater.enqueueSetState(this,e,t,"setState")},I.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},x.prototype=I.prototype;a=P.prototype=new x;a.constructor=P,h(a,I.prototype),a.isPureReactComponent=!0;var S={current:null},D=Object.prototype.hasOwnProperty,F={key:!0,ref:!0,__self:!0,__source:!0};function M(e,t,r){var n,o={},i=null,u=null;if(null!=t)for(n in void 0!==t.ref&&(u=t.ref),void 0!==t.key&&(i=""+t.key),t)D.call(t,n)&&!F.hasOwnProperty(n)&&(o[n]=t[n]);var a=arguments.length-2;if(1===a)o.children=r;else if(1<a){for(var s=Array(a),c=0;c<a;c++)s[c]=arguments[c+2];o.children=s}if(e&&e.defaultProps)for(n in a=e.defaultProps)void 0===o[n]&&(o[n]=a[n]);return{$$typeof:d,type:e,key:i,ref:u,props:o,_owner:S.current}}function j(e){return"object"==typeof e&&null!==e&&e.$$typeof===d}var L=/\/+/g,U=[];function V(e,t,r,n){if(U.length){var o=U.pop();return o.result=e,o.keyPrefix=t,o.func=r,o.context=n,o.count=0,o}return{result:e,keyPrefix:t,func:r,context:n,count:0}}function H(e){e.result=null,e.keyPrefix=null,e.func=null,e.context=null,e.count=0,U.length<10&&U.push(e)}function $(e,t,r){return null==e?0:function e(t,r,n,o){var i=!1;if(null===(t="undefined"==(a=typeof t)||"boolean"===a?null:t))i=!0;else switch(a){case"string":case"number":i=!0;break;case"object":switch(t.$$typeof){case d:case m:i=!0}}if(i)return n(o,t,""===r?"."+B(t,0):r),1;if(i=0,r=""===r?".":r+":",Array.isArray(t))for(var u=0;u<t.length;u++){var a,s=r+B(a=t[u],u);i+=e(a,s,n,o)}else if("function"==typeof(s=null!==t&&"object"==typeof t&&"function"==typeof(s=A&&t[A]||t["@@iterator"])?s:null))for(t=s.call(t),u=0;!(a=t.next()).done;)i+=e(a=a.value,s=r+B(a,u++),n,o);else if("object"===a)throw n=""+t,Error(k(31,"[object Object]"===n?"object with keys {"+Object.keys(t).join(", ")+"}":n,""));return i}(e,"",t,r)}function B(e,t){return"object"==typeof e&&null!==e&&null!=e.key?(e=e.key,r={"=":"=0",":":"=2"},"$"+(""+e).replace(/[=:]/g,function(e){return r[e]})):t.toString(36);var r}function G(e,t){e.func.call(e.context,t,e.count++)}function K(e,t,r){var n=e.result,o=e.keyPrefix;e=e.func.call(e.context,t,e.count++),Array.isArray(e)?q(e,n,r,function(e){return e}):null!=e&&(j(e)&&(r=o+(!(o=e).key||t&&t.key===e.key?"":(""+e.key).replace(L,"$&/")+"/")+r,e={$$typeof:d,type:o.type,key:r,ref:o.ref,props:o.props,_owner:o._owner}),n.push(e))}function q(e,t,r,n,o){var i="";$(e,K,t=V(t,i=null!=r?(""+r).replace(L,"$&/")+"/":i,n,o)),H(t)}var Y={current:null};function W(){var e=Y.current;if(null===e)throw Error(k(321));return e}a={ReactCurrentDispatcher:Y,ReactCurrentBatchConfig:{suspense:null},ReactCurrentOwner:S,IsSomeRendererActing:{current:!1},assign:h};u.Children={map:function(e,t,r){if(null==e)return e;var n=[];return q(e,n,null,t,r),n},forEach:function(e,t,r){if(null==e)return e;$(e,G,t=V(null,null,t,r)),H(t)},count:function(e){return $(e,function(){return null},null)},toArray:function(e){var t=[];return q(e,t,null,function(e){return e}),t},only:function(e){if(!j(e))throw Error(k(143));return e}},u.Component=I,u.Fragment=v,u.Profiler=g,u.PureComponent=P,u.StrictMode=E,u.Suspense=R,u.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=a,u.cloneElement=function(e,t,r){if(null==e)throw Error(k(267,e));var n=h({},e.props),o=e.key,i=e.ref,u=e._owner;if(null!=t)for(a in void 0!==t.ref&&(i=t.ref,u=S.current),void 0!==t.key&&(o=""+t.key),e.type&&e.type.defaultProps&&(s=e.type.defaultProps),t)D.call(t,a)&&!F.hasOwnProperty(a)&&(n[a]=(void 0===t[a]&&void 0!==s?s:t)[a]);var a=arguments.length-2;if(1===a)n.children=r;else if(1<a){for(var s=Array(a),c=0;c<a;c++)s[c]=arguments[c+2];n.children=s}return{$$typeof:d,type:e.type,key:o,ref:i,props:n,_owner:u}},u.createContext=function(e,t){return(e={$$typeof:b,_calculateChangedBits:t=void 0===t?null:t,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null}).Provider={$$typeof:T,_context:e},e.Consumer=e},u.createElement=M,u.createFactory=function(e){var t=M.bind(null,e);return t.type=e,t},u.createRef=function(){return{current:null}},u.forwardRef=function(e){return{$$typeof:_,render:e}},u.isValidElement=j,u.lazy=function(e){return{$$typeof:O,_ctor:e,_status:-1,_result:null}},u.memo=function(e,t){return{$$typeof:w,type:e,compare:void 0===t?null:t}},u.useCallback=function(e,t){return W().useCallback(e,t)},u.useContext=function(e,t){return W().useContext(e,t)},u.useDebugValue=function(){},u.useEffect=function(e,t){return W().useEffect(e,t)},u.useImperativeHandle=function(e,t,r){return W().useImperativeHandle(e,t,r)},u.useLayoutEffect=function(e,t){return W().useLayoutEffect(e,t)},u.useMemo=function(e,t){return W().useMemo(e,t)},u.useReducer=function(e,t,r){return W().useReducer(e,t,r)},u.useRef=function(e){return W().useRef(e)},u.useState=function(e){return W().useState(e)},u.version="16.14.0";var z,X,Z,Ie={},Q=function(){};function J(e,t,r,n,o){if("production"!==production)for(var i in e)if(Z(e,i)){var u;try{if("function"!=typeof e[i]){var a=Error((n||"React class")+": "+r+" type `"+i+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[i]+"`.");throw a.name="Invariant Violation",a}u=e[i](t,i,n,r,null,z)}catch(e){u=e}!u||u instanceof Error||Q((n||"React class")+": type specification of "+r+" `"+i+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof u+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),u instanceof Error&&!(u.message in X)&&(X[u.message]=!0,i=o?o():"",Q("Failed "+r+" type: "+u.message+(null!=i?i:"")))}}"production"!==production&&(z="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",X={},Z=Function.call.bind(Object.prototype.hasOwnProperty),Q=function(e){e="Warning: "+e;"undefined"!=typeof console&&console.error(e);try{throw new Error(e)}catch(e){}}),J.resetWarningCache=function(){"production"!==production&&(X={})};var xe=J;"production"!==production&&function(){var h=Ne,o=xe,e="function"==typeof Symbol&&Symbol.for,d=e?Symbol.for("react.element"):60103,m=e?Symbol.for("react.portal"):60106,a=e?Symbol.for("react.fragment"):60107,n=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,u=e?Symbol.for("react.provider"):60109,s=e?Symbol.for("react.context"):60110,t=e?Symbol.for("react.concurrent_mode"):60111,c=e?Symbol.for("react.forward_ref"):60112,f=e?Symbol.for("react.suspense"):60113,l=e?Symbol.for("react.suspense_list"):60120,p=e?Symbol.for("react.memo"):60115,y=e?Symbol.for("react.lazy"):60116,v=e?Symbol.for("react.block"):60121,r=e?Symbol.for("react.fundamental"):60117,E=e?Symbol.for("react.responder"):60118,g=e?Symbol.for("react.scope"):60119,T="function"==typeof Symbol&&Symbol.iterator,b="@@iterator";function _(e){if(null===e||"object"!=typeof e)return null;e=T&&e[T]||e[b];return"function"==typeof e?e:null}var R={current:null},w={current:null},O=/^(.*)[\\\/]/;var A=1;function k(e){if(null==e)return null;if("number"==typeof e.tag&&S("Received an unexpected object in getComponentName(). This is likely a bug in React. Please file an issue."),"function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case a:return"Fragment";case m:return"Portal";case i:return"Profiler";case n:return"StrictMode";case f:return"Suspense";case l:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case s:return"Context.Consumer";case u:return"Context.Provider";case c:return t=e.render,r="ForwardRef",t=t.displayName||t.name||"",e.displayName||(""!==t?r+"("+t+")":r);case p:return k(e.type);case v:return k(e.render);case y:r=(r=e)._status===A?r._result:null;if(r)return k(r)}var t,r;return null}var C={},N=null;function I(e){N=e}C.getCurrentStack=null,C.getStackAddendum=function(){var e,t,r,n,o,i="";N&&(n=k(N.type),o=N._owner,i+=(e=n,t=N._source,r=o&&k(o.type),u="",t?(o=(n=t.fileName).replace(O,""),/^index\./.test(o)&&(!(n=n.match(O))||(n=n[1])&&(o=n.replace(O,"")+"/"+o)),u=" (at "+o+":"+t.lineNumber+")"):r&&(u=" (created by "+r+")"),"\n in "+(e||"Unknown")+u));var u=C.getCurrentStack;return u&&(i+=u()||""),i};var x={ReactCurrentDispatcher:R,ReactCurrentBatchConfig:{suspense:null},ReactCurrentOwner:w,IsSomeRendererActing:{current:!1},assign:h};function P(e){for(var t=arguments.length,r=new Array(1<t?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];D("warn",e,r)}function S(e){for(var t=arguments.length,r=new Array(1<t?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];D("error",e,r)}function D(e,t,r){0<r.length&&"string"==typeof r[r.length-1]&&0===r[r.length-1].indexOf("\n in")||""!==(n=x.ReactDebugCurrentFrame.getStackAddendum())&&(t+="%s",r=r.concat([n]));var n=r.map(function(e){return""+e});n.unshift("Warning: "+t),Function.prototype.apply.call(console[e],console,n);try{var o=0,i="Warning: "+t.replace(/%s/g,function(){return r[o++]});throw new Error(i)}catch(e){}}h(x,{ReactDebugCurrentFrame:C,ReactComponentTreeHook:{}});var F={};function M(e,t){var r=e.constructor,e=r&&(r.displayName||r.name)||"ReactClass",r=e+"."+t;F[r]||(S("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",t,e),F[r]=!0)}var j={isMounted:function(e){return!1},enqueueForceUpdate:function(e,t,r){M(e,"forceUpdate")},enqueueReplaceState:function(e,t,r,n){M(e,"replaceState")},enqueueSetState:function(e,t,r,n){M(e,"setState")}},L={};function U(e,t,r){this.props=e,this.context=t,this.refs=L,this.updater=r||j}Object.freeze(L),U.prototype.isReactComponent={},U.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},U.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};var V,H={isMounted:["isMounted","Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],replaceState:["replaceState","Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."]};for(V in H)H.hasOwnProperty(V)&&function(e,t){Object.defineProperty(U.prototype,e,{get:function(){P("%s(...) is deprecated in plain JavaScript React classes. %s",t[0],t[1])}})}(V,H[V]);function $(){}function B(e,t,r){this.props=e,this.context=t,this.refs=L,this.updater=r||j}$.prototype=U.prototype;e=B.prototype=new $;e.constructor=B,h(e,U.prototype),e.isPureReactComponent=!0;var G,K,q=Object.prototype.hasOwnProperty,Y={key:!0,ref:!0,__self:!0,__source:!0};function W(e){if(q.call(e,"ref")){var t=Object.getOwnPropertyDescriptor(e,"ref").get;if(t&&t.isReactWarning)return}return void 0!==e.ref}function z(e){if(q.call(e,"key")){var t=Object.getOwnPropertyDescriptor(e,"key").get;if(t&&t.isReactWarning)return}return void 0!==e.key}var X={},Z=function(e,t,r,n,o,i,u){i={$$typeof:d,type:e,key:t,ref:r,props:u,_owner:i,_store:{}};return Object.defineProperty(i._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(i,"_self",{configurable:!1,enumerable:!1,writable:!1,value:n}),Object.defineProperty(i,"_source",{configurable:!1,enumerable:!1,writable:!1,value:o}),Object.freeze&&(Object.freeze(i.props),Object.freeze(i)),i};function Q(e,t,r){var n,o,i,u={},a=null,s=null,c=null,f=null;if(null!=t)for(n in W(t)&&(s=t.ref,"string"==typeof(o=t).ref&&w.current&&o.__self&&w.current.stateNode!==o.__self&&(i=k(w.current.type),X[i]||(S('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://fb.me/react-strict-mode-string-ref',k(w.current.type),o.ref),X[i]=!0))),z(t)&&(a=""+t.key),c=void 0===t.__self?null:t.__self,f=void 0===t.__source?null:t.__source,t)q.call(t,n)&&!Y.hasOwnProperty(n)&&(u[n]=t[n]);var l,p,y,h=arguments.length-2;if(1==h)u.children=r;else if(1<h){for(var d=Array(h),m=0;m<h;m++)d[m]=arguments[m+2];Object.freeze&&Object.freeze(d),u.children=d}if(e&&e.defaultProps){var v=e.defaultProps;for(n in v)void 0===u[n]&&(u[n]=v[n])}function E(){K||(K=!0,S("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://fb.me/react-special-props)",l))}function g(){G||(G=!0,S("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://fb.me/react-special-props)",y))}return(a||s)&&(r="function"==typeof e?e.displayName||e.name||"Unknown":e,a&&(p=u,y=r,g.isReactWarning=!0,Object.defineProperty(p,"key",{get:g,configurable:!0})),s&&(p=u,l=r,E.isReactWarning=!0,Object.defineProperty(p,"ref",{get:E,configurable:!0}))),Z(e,a,s,c,f,w.current,u)}function J(e){return"object"==typeof e&&null!==e&&e.$$typeof===d}var ee=".",te=":";var re=!1,ne=/\/+/g;function oe(e){return(""+e).replace(ne,"$&/")}var ie=10,ue=[];function ae(e,t,r,n){if(ue.length){var o=ue.pop();return o.result=e,o.keyPrefix=t,o.func=r,o.context=n,o.count=0,o}return{result:e,keyPrefix:t,func:r,context:n,count:0}}function se(e){e.result=null,e.keyPrefix=null,e.func=null,e.context=null,e.count=0,ue.length<ie&&ue.push(e)}function ce(e,t,r){return null==e?0:function e(t,r,n,o){var i,u=typeof t,a=!1;if(null===(t="undefined"==u||"boolean"==u?null:t))a=!0;else switch(u){case"string":case"number":a=!0;break;case"object":switch(t.$$typeof){case d:case m:a=!0}}if(a)return n(o,t,""===r?ee+fe(t,0):r),1;var s=0,c=""===r?ee:r+te;if(Array.isArray(t))for(var f=0;f<t.length;f++)s+=e(i=t[f],c+fe(i,f),n,o);else if("function"==typeof(r=_(t))){r===t.entries&&(re||P("Using Maps as children is deprecated and will be removed in a future major release. Consider converting children to an array of keyed ReactElements instead."),re=!0);for(var l,p=r.call(t),y=0;!(l=p.next()).done;)s+=e(i=l.value,c+fe(i,y++),n,o)}else if("object"==u)throw r=" If you meant to render a collection of children, use an array instead."+C.getStackAddendum(),u=""+t,Error("Objects are not valid as a React child (found: "+("[object Object]"==u?"object with keys {"+Object.keys(t).join(", ")+"}":u)+")."+r);return s}(e,"",t,r)}function fe(e,t){return"object"==typeof e&&null!==e&&null!=e.key?(e=e.key,r={"=":"=0",":":"=2"},"$"+(""+e).replace(/[=:]/g,function(e){return r[e]})):t.toString(36);var r}function le(e,t,r){var n=e.func,o=e.context;n.call(o,t,e.count++)}function pe(e,t,r){var n=e.result,o=e.keyPrefix,i=e.func,u=e.context,e=i.call(u,t,e.count++);Array.isArray(e)?ye(e,n,r,function(e){return e}):null!=e&&(J(e)&&(r=o+(!(o=e).key||t&&t.key===e.key?"":oe(e.key)+"/")+r,e=Z(o.type,r,o.ref,o._self,o._source,o._owner,o.props)),n.push(e))}function ye(e,t,r,n,o){var i="",o=ae(t,i=null!=r?oe(r)+"/":i,n,o);ce(e,pe,o),se(o)}function he(e){return"string"==typeof e||"function"==typeof e||e===a||e===t||e===i||e===n||e===f||e===l||"object"==typeof e&&null!==e&&(e.$$typeof===y||e.$$typeof===p||e.$$typeof===u||e.$$typeof===s||e.$$typeof===c||e.$$typeof===r||e.$$typeof===E||e.$$typeof===g||e.$$typeof===v)}function de(){var e=R.current;if(null===e)throw Error("Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://fb.me/react-invalid-hook-call for tips about how to debug and fix this problem.");return e}function me(){if(w.current){var e=k(w.current.type);if(e)return"\n\nCheck the render method of `"+e+"`."}return""}var ve=!1,Ee={};function ge(e,t){var r;e._store&&!e._store.validated&&null==e.key&&(e._store.validated=!0,r=t,(t=me())||(r="string"==typeof r?r:r.displayName||r.name)&&(t="\n\nCheck the top-level render call using <"+r+">."),Ee[r=t]||(Ee[r]=!0,t="",e&&e._owner&&e._owner!==w.current&&(t=" It was passed a child from "+k(e._owner.type)+"."),I(e),S('Each child in a list should have a unique "key" prop.%s%s See https://fb.me/react-warning-keys for more information.',r,t),I(null)))}function Te(e,t){if("object"==typeof e)if(Array.isArray(e))for(var r=0;r<e.length;r++){var n=e[r];J(n)&&ge(n,t)}else if(J(e))e._store&&(e._store.validated=!0);else if(e){var o=_(e);if("function"==typeof o&&o!==e.entries)for(var i,u=o.call(e);!(i=u.next()).done;)J(i.value)&&ge(i.value,t)}}function be(e){var t=e.type;if(null!=t&&"string"!=typeof t){var r,n=k(t);if("function"==typeof t)r=t.propTypes;else{if("object"!=typeof t||t.$$typeof!==c&&t.$$typeof!==p)return;r=t.propTypes}r?(I(e),o(r,e.props,"prop",n,C.getStackAddendum),I(null)):void 0===t.PropTypes||ve||(ve=!0,S("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",n||"Unknown")),"function"!=typeof t.getDefaultProps||t.getDefaultProps.isReactClassApproved||S("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function _e(e,t,r){var n,o=he(e);o||(i="",(void 0===e||"object"==typeof e&&null!==e&&0===Object.keys(e).length)&&(i+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."),i+=(null==(t=t)||void 0===(t=t.__source)?"":"\n\nCheck your code at "+t.fileName.replace(/^.*[\\\/]/,"")+":"+t.lineNumber+".")||me(),null===e?n="null":Array.isArray(e)?n="array":void 0!==e&&e.$$typeof===d?(n="<"+(k(e.type)||"Unknown")+" />",i=" Did you accidentally export a JSX literal instead of a component?"):n=typeof e,S("React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",n,i));var i=Q.apply(this,arguments);if(null==i)return i;if(o)for(var u=2;u<arguments.length;u++)Te(arguments[u],e);return(e===a?function(e){I(e);for(var t=Object.keys(e.props),r=0;r<t.length;r++){var n=t[r];if("children"!==n&&"key"!==n){S("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",n);break}}null!==e.ref&&S("Invalid attribute `ref` supplied to `React.Fragment`."),I(null)}:be)(i),i}var Re=!1;try{var we=Object.freeze({}),Oe=new Map([[we,null]]),Ae=new Set([we]);Oe.set(0,0),Ae.add(0)}catch(e){}function ke(e,t,r){for(var n=function(e,t,r){if(null==e)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var n,o,i=h({},e.props),u=e.key,a=e.ref,s=e._self,c=e._source,f=e._owner;if(null!=t)for(n in W(t)&&(a=t.ref,f=w.current),z(t)&&(u=""+t.key),e.type&&e.type.defaultProps&&(o=e.type.defaultProps),t)q.call(t,n)&&!Y.hasOwnProperty(n)&&(void 0===t[n]&&void 0!==o?i[n]=o[n]:i[n]=t[n]);var l=arguments.length-2;if(1==l)i.children=r;else if(1<l){for(var p=Array(l),y=0;y<l;y++)p[y]=arguments[y+2];i.children=p}return Z(e.type,u,a,s,c,f,i)}.apply(this,arguments),o=2;o<arguments.length;o++)Te(arguments[o],n.type);return be(n),n}function Ce(e){var t=_e.bind(null,e);return t.type=e,Re||(Re=!0,P("React.createFactory() is deprecated and will be removed in a future major release. Consider using JSX or use React.createElement() directly instead.")),Object.defineProperty(t,"type",{enumerable:!1,get:function(){return P("Factory.type is deprecated. Access the class directly before passing it to createFactory."),Object.defineProperty(this,"type",{value:e}),e}}),t}Ae=_e;Ie.Children={map:function(e,t,r){if(null==e)return e;var n=[];return ye(e,n,null,t,r),n},forEach:function(e,t,r){if(null==e)return e;r=ae(null,null,t,r),ce(e,le,r),se(r)},count:function(e){return ce(e,function(){return null},null)},toArray:function(e){var t=[];return ye(e,t,null,function(e){return e}),t},only:function(e){if(!J(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},Ie.Component=U,Ie.Fragment=a,Ie.Profiler=i,Ie.PureComponent=B,Ie.StrictMode=n,Ie.Suspense=f,Ie.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=x,Ie.cloneElement=ke,Ie.createContext=function(e,t){void 0===t?t=null:null!==t&&"function"!=typeof t&&S("createContext: Expected the optional second argument to be a function. Instead received: %s",t);var r={$$typeof:s,_calculateChangedBits:t,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},n=!(r.Provider={$$typeof:u,_context:r}),o=!1,e={$$typeof:s,_context:r,_calculateChangedBits:r._calculateChangedBits};return Object.defineProperties(e,{Provider:{get:function(){return o||(o=!0,S("Rendering <Context.Consumer.Provider> is not supported and will be removed in a future major release. Did you mean to render <Context.Provider> instead?")),r.Provider},set:function(e){r.Provider=e}},_currentValue:{get:function(){return r._currentValue},set:function(e){r._currentValue=e}},_currentValue2:{get:function(){return r._currentValue2},set:function(e){r._currentValue2=e}},_threadCount:{get:function(){return r._threadCount},set:function(e){r._threadCount=e}},Consumer:{get:function(){return n||(n=!0,S("Rendering <Context.Consumer.Consumer> is not supported and will be removed in a future major release. Did you mean to render <Context.Consumer> instead?")),r.Consumer}}}),r.Consumer=e,r._currentRenderer=null,r._currentRenderer2=null,r},Ie.createElement=Ae,Ie.createFactory=Ce,Ie.createRef=function(){var e={current:null};return Object.seal(e),e},Ie.forwardRef=function(e){return null!=e&&e.$$typeof===p?S("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."):"function"!=typeof e?S("forwardRef requires a render function but was given %s.",null===e?"null":typeof e):0!==e.length&&2!==e.length&&S("forwardRef render functions accept exactly two parameters: props and ref. %s",1===e.length?"Did you forget to use the ref parameter?":"Any additional parameter will be undefined."),null!=e&&(null==e.defaultProps&&null==e.propTypes||S("forwardRef render functions do not support propTypes or defaultProps. Did you accidentally pass a React component?")),{$$typeof:c,render:e}},Ie.isValidElement=J,Ie.lazy=function(e){var t,r,n={$$typeof:y,_ctor:e,_status:-1,_result:null};return Object.defineProperties(n,{defaultProps:{configurable:!0,get:function(){return t},set:function(e){S("React.lazy(...): It is not supported to assign `defaultProps` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."),t=e,Object.defineProperty(n,"defaultProps",{enumerable:!0})}},propTypes:{configurable:!0,get:function(){return r},set:function(e){S("React.lazy(...): It is not supported to assign `propTypes` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."),r=e,Object.defineProperty(n,"propTypes",{enumerable:!0})}}}),n},Ie.memo=function(e,t){return he(e)||S("memo: The first argument must be a component. Instead received: %s",null===e?"null":typeof e),{$$typeof:p,type:e,compare:void 0===t?null:t}},Ie.useCallback=function(e,t){return de().useCallback(e,t)},Ie.useContext=function(e,t){var r,n=de();return void 0!==t&&S("useContext() second argument is reserved for future use in React. Passing it is not supported. You passed: %s.%s",t,"number"==typeof t&&Array.isArray(arguments[2])?"\n\nDid you call array.map(useContext)? Calling Hooks inside a loop is not supported. Learn more at https://fb.me/rules-of-hooks":""),void 0!==e._context&&((r=e._context).Consumer===e?S("Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be removed in a future major release. Did you mean to call useContext(Context) instead?"):r.Provider===e&&S("Calling useContext(Context.Provider) is not supported. Did you mean to call useContext(Context) instead?")),n.useContext(e,t)},Ie.useDebugValue=function(e,t){return de().useDebugValue(e,t)},Ie.useEffect=function(e,t){return de().useEffect(e,t)},Ie.useImperativeHandle=function(e,t,r){return de().useImperativeHandle(e,t,r)},Ie.useLayoutEffect=function(e,t){return de().useLayoutEffect(e,t)},Ie.useMemo=function(e,t){return de().useMemo(e,t)},Ie.useReducer=function(e,t,r){return de().useReducer(e,t,r)},Ie.useRef=function(e){return de().useRef(e)},Ie.useState=function(e){return de().useState(e)},Ie.version="16.14.0"}(),"production"===production?l.exports=u:l.exports=Ie;var ee=l.exports,te=l.exports.createContext({hackle:void 0,user:void 0}),v=te.Consumer,re=te.Provider;var ne,oe,ie,ue,ae,se,ce,fe,le,pe,ye,he,de,me,ve,Ee,ge,Te,be,_e,Re,we,Oe,Ae,ke,Ce,Pe,Se,De,Fe,Me,je,Le,Ue,Ve,He,$e,Be,Ge,Ke,qe,Ye,We,ze,Xe,Ze,Qe,Je,et,tt,rt,nt,ot,it,ut,at,st,ct,ft,lt,pt,yt,ht,dt,mt,vt,Et,gt,Tt={exports:{}};function bt(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}oe(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}function _t(e,t){return e.timestamp==t.timestamp&&e.user.id==t.user.id&&e.user.properties==t.user.properties}g=Tt.exports,E=g,ne={DISABLE:0,ERROR:1,WARN:2,INFO:3,DEBUG:4},R=function(){function t(){}return t.setLogLevel=function(e){this.logLevel=e=void 0===e?ne.INFO:e},t._log=function(e,t){var r;switch(e){case"WARN":r="orange";break;case"ERROR":r="red";break;default:r="#AAAAAA"}try{console.log("%c[".concat(e,"] Hackle: ").concat(t),"color: ".concat(r))}catch(e){}},t.logLevel=ne.INFO,t.log={error:function(e){ne.ERROR<=t.logLevel&&t._log("ERROR",e)},warn:function(e){ne.WARN<=t.logLevel&&t._log("WARN",e)},info:function(e){ne.INFO<=t.logLevel&&t._log("INFO",e)},debug:function(e){ne.DEBUG<=t.logLevel&&t._log("DEBUG",e)}},t}(),oe=function(e,t){return(oe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},ie=function(){return(ie=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},ue=function(){function r(e,t){this.variation=e,this.reason=t}return r.of=function(e,t){return new r(e,t)},r}(),ae=function(){function t(e,t){this.isOn=e,this.reason=t}return t.on=function(e){return new t(!0,e)},t.off=function(e){return new t(!1,e)},t}(),se=function(){function e(){}return e.SDK_NOT_READY="SDK_NOT_READY",e.EXCEPTION="EXCEPTION",e.INVALID_INPUT="INVALID_INPUT",e.EXPERIMENT_NOT_FOUND="EXPERIMENT_NOT_FOUND",e.EXPERIMENT_DRAFT="EXPERIMENT_DRAFT",e.EXPERIMENT_PAUSED="EXPERIMENT_PAUSED",e.EXPERIMENT_COMPLETED="EXPERIMENT_COMPLETED",e.OVERRIDDEN="OVERRIDDEN",e.TRAFFIC_NOT_ALLOCATED="TRAFFIC_NOT_ALLOCATED",e.VARIATION_DROPPED="VARIATION_DROPPED",e.TRAFFIC_ALLOCATED="TRAFFIC_ALLOCATED",e.NOT_IN_EXPERIMENT_TARGET="NOT_IN_EXPERIMENT_TARGET",e.FEATURE_FLAG_NOT_FOUND="FEATURE_FLAG_NOT_FOUND",e.FEATURE_FLAG_INACTIVE="FEATURE_FLAG_INACTIVE",e.INDIVIDUAL_TARGET_MATCH="INDIVIDUAL_TARGET_MATCH",e.TARGET_RULE_MATCH="TARGET_RULE_MATCH",e.DEFAULT_RULE="DEFAULT_RULE",e}(),ce=function(){function e(e,t,r,n,o){this.id=e,this.key=t,this.type=r,this.variations=n,this.overrides=o}return e.prototype._getVariationByIdOrNull=function(t){return this.variations.find(function(e){return e.id===t})},e.prototype._getVariationByKeyOrNull=function(t){return this.variations.find(function(e){return e.key===t})},e.prototype._getOverriddenVariation=function(e){e=this.overrides.get(e.id);return e?this._getVariationByIdOrNull(e):void 0},e.Draft=(bt(o,a=e),o),e.Running=(bt(n,s=e),n),e.Paused=(bt(r,i=e),r),e.Completed=(bt(t,u=e),t.prototype.winnerVariation=function(){var t=this;return this.variations.find(function(e){return e.id===t._winnerVariationId})},t),e;function t(e,t,r,n,o,i){o=u.call(this,e,t,r,n,o)||this;return o._winnerVariationId=i,o}var u,i,s,a;function r(e,t,r,n,o){return i.call(this,e,t,r,n,o)||this}function n(e,t,r,n,o,i,u,a){o=s.call(this,e,t,r,n,o)||this;return o.targetAudiences=i,o.targetRules=u,o.defaultRule=a,o}function o(e,t,r,n,o){return a.call(this,e,t,r,n,o)||this}}(),fe=function(e,t,r){this.id=e,this.key=t,this.isDropped=r},le=function(e,t,r){this.seed=e,this.slotSize=t,this.slots=r},pe=function(){function e(e,t,r){this.startInclusive=e,this.endExclusive=t,this.variationId=r}return e.prototype.contains=function(e){return this.startInclusive<=e&&e<this.endExclusive},e}(),ye=function(e,t){this.id=e,this.key=t},he=function(e){this.conditions=e},de=function(e,t){this.key=e,this.match=t},me=function(e,t){this.type=e,this.name=t},ve=function(e,t,r,n){this.type=e,this.operator=t,this.valueType=r,this.values=n},Ee=function(e,t,r){this.type=e,this.variationId=t,this.bucketId=r},ge=function(e,t){this.target=e,this.action=t},Te=function(){function i(e,t,r){this.coreVersion=e,this.prerelease=t,this.build=r}return i.tryParse=function(e){var u=i.regExp.exec(e);if(u){var t=function(e){var t="function"==typeof Symbol&&u[Symbol.iterator];if(!t)return u;var r,n,o=t.call(u),i=[];try{for(;(void 0===e||0<e--)&&!(r=o.next()).done;)i.push(r.value)}catch(e){n={error:e}}finally{try{r&&!r.done&&(t=o.return)&&t.call(o)}finally{if(n)throw n.error}}return i}(6);t[0];var r=t[1],n=t[2],o=void 0===n?"0":n,e=t[3],n=void 0===e?"0":e,e=t[4],t=t[5];return new i(new be(parseInt(r,10),parseInt(o,10),parseInt(n,10)),_e.parse(e),_e.parse(t))}},i.prototype.compareTo=function(e){return this.coreVersion.compareTo(e.coreVersion)||this.prerelease.compareTo(e.prerelease)},i.prototype.isEqualTo=function(e){return 0===this.compareTo(e)},i.prototype.isGreaterThan=function(e){return 0<this.compareTo(e)},i.prototype.isGreaterThanOrEqualTo=function(e){return 0<=this.compareTo(e)},i.prototype.isLessThan=function(e){return this.compareTo(e)<0},i.prototype.isLessThanOrEqualTo=function(e){return this.compareTo(e)<=0},i.regExp=/^(0|[1-9]\d*)(?:\.(0|[1-9]\d*))?(?:\.(0|[1-9]\d*))?(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/,i}(),be=function(){function e(e,t,r){this.major=e,this.minor=t,this.patch=r}return e.prototype.compareTo=function(e){return this.major-e.major||this.minor-e.minor||this.patch-e.patch},e}(),_e=function(){function o(e){this.identifiers=e}return o.parse=function(e){return e?new o(e.split(".")):o.EMPTY},o.prototype.isEmpty=function(){return 0===this.identifiers.length},o.prototype.isNotEmpty=function(){return!this.isEmpty()},o.prototype.compareTo=function(e){return this.isEmpty()&&e.isEmpty()?0:this.isEmpty()&&e.isNotEmpty()?1:this.isNotEmpty()&&e.isEmpty()?-1:this.compareIdentifiers(e)},o.prototype.compareIdentifiers=function(e){for(var t=Math.min(this.identifiers.length,e.identifiers.length),r=0;r<t;r++){var n=o.compareIdentifiers(this.identifiers[r],e.identifiers[r]);if(0!==n)return n}return this.identifiers.length-e.identifiers.length},o.compareIdentifiers=function(e,t){return o.numericIdentifierRegExp.test(e)&&o.numericIdentifierRegExp.test(t)?+e-+t:e===t?0:e<t?-1:1},o.EMPTY=new o([]),o.numericIdentifierRegExp=/^(0|[1-9]\d*)$/,o}(),Re=["MATCH","NOT_MATCH"],we=["STRING","NUMBER","BOOLEAN","VERSION"],Oe=["IN","CONTAINS","STARTS_WITH","ENDS_WITH","GT","GTE","LT","LTE"],Ae=["VARIATION","BUCKET"],ke=["HACKLE_PROPERTY","USER_PROPERTY"],Ce=function(){function e(){}return e.validate=function(e){if(e){if("object"!=typeof e)return!1;for(var t in e)if(!this.validProperty(t,e[t]))return!1}return!0},e.filteredProperties=function(r){var n=this;return Object.keys(r).filter(function(e){return n.validProperty(e,r[e])}).reduce(function(e,t){return ie(ie({},e),((e={})[t]=n.filteredPropertiesValue(r[t]),e))},{})},e.filteredPropertiesValue=function(e){return"string"==typeof e&&1024<e.length?e.slice(0,1024):e},e.validProperty=function(e,t){return!!e&&"string"==typeof e&&!(128<e.length)&&("string"==typeof t||"boolean"==typeof t||"number"==typeof t&&!isNaN(t)&&isFinite(t))},e}(),Pe=function(){function e(e,t,r){this.timestamp=e,this.user=t,this.hackleProperties=r}return e.exposure=function(e,t,r,n){return void 0===n&&(n={}),new Se((new Date).getTime(),t,e,r.variationId,r.variationKey,r.reason,n)},e.track=function(e,t,r,n){return void 0===n&&(n={}),new De((new Date).getTime(),r,e,t,n)},e.isExposure=function(e){return void 0!==e.experiment},e.isTrack=function(e){return void 0!==e.eventType},e}(),Se=function(a){function e(e,t,r,n,o,i,u){u=a.call(this,e,t,u)||this;return u.experiment=r,u.variationId=n,u.variationKey=o,u.decisionReason=i,u}return bt(e,a),e.prototype.toDto=function(){return{timestamp:this.timestamp,userId:this.user.id,userProperties:Ce.filteredProperties(this.user.properties||{}),experimentId:this.experiment.id,experimentKey:this.experiment.key,experimentType:this.experiment.type,variationId:this.variationId,variationKey:this.variationKey,decisionReason:this.decisionReason.toString(),hackleProperties:Ce.filteredProperties(this.hackleProperties||{})}},e}(Pe),De=function(i){function e(e,t,r,n,o){o=i.call(this,e,t,o)||this;return o.eventType=r,o.event=n,o}return bt(e,i),e.prototype.toDto=function(){return{timestamp:this.timestamp,userId:this.user.id,userProperties:Ce.filteredProperties(this.user.properties||{}),eventTypeId:this.eventType.id,eventTypeKey:this.eventType.key,value:this.event.value||0,properties:Ce.filteredProperties(this.event.properties||{}),hackleProperties:Ce.filteredProperties(this.hackleProperties||{})}},e}(Pe),Fe=function(){function n(e,t,r){this.variationId=e,this.variationKey=t,this.reason=r}return n.withVariation=function(e,t){return new n(e.id,e.key,t)},n.withKey=function(e,t){return new n(void 0,e,t)},n.of=function(e,t,r){e=e._getVariationByKeyOrNull(t);return e?n.withVariation(e,r):n.withKey(t,r)},n}(),Me=function(){function e(e){this.evaluationFlowFactory=e}return e.prototype.evaluate=function(e,t,r,n,o){return this.evaluationFlowFactory.getFlow(t.type).evaluate(e,t,r,n,o)},e}(),je=function(){function e(e){this.conditionMatcherFactory=e}return e.prototype.matches=function(e,t,r,n){var o=this;return e.conditions.every(function(e){return o._matches(e,t,r,n)})},e.prototype._matches=function(e,t,r,n){return this.conditionMatcherFactory.getMatcher(e.key.type).matches(e,t,r,n)},e}(),Le=function(){function e(e,t){this.valueMatcherFactory=e,this.operatorMatcherFactory=t}return e.prototype.matches=function(t,e){var r=this.valueMatcherFactory.getMatcher(e.valueType),n=this.operatorMatcherFactory.getMatcher(e.operator),o=e.values.some(function(e){return r.matches(n,t,e)});return this._matches(e.type,o)},e.prototype._matches=function(e,t){switch(e){case"MATCH":return t;case"NOT_MATCH":return!t}},e}(),Ue=function(){function e(){}return e.prototype.booleanMatches=function(e,t){return e===t},e.prototype.numberMatches=function(e,t){return e===t},e.prototype.stringMatches=function(e,t){return e===t},e.prototype.versionMatches=function(e,t){return e.isEqualTo(t)},e}(),Ve=function(){function e(){}return e.prototype.booleanMatches=function(e,t){return!1},e.prototype.numberMatches=function(e,t){return!1},e.prototype.stringMatches=function(e,t){return e.includes(t)},e.prototype.versionMatches=function(e,t){return!1},e}(),He=function(){function e(){}return e.prototype.booleanMatches=function(e,t){return!1},e.prototype.numberMatches=function(e,t){return!1},e.prototype.stringMatches=function(e,t){return e.startsWith(t)},e.prototype.versionMatches=function(e,t){return!1},e}(),$e=function(){function e(){}return e.prototype.booleanMatches=function(e,t){return!1},e.prototype.numberMatches=function(e,t){return!1},e.prototype.stringMatches=function(e,t){return e.endsWith(t)},e.prototype.versionMatches=function(e,t){return!1},e}(),Be=function(){function e(){}return e.prototype.booleanMatches=function(e,t){return!1},e.prototype.numberMatches=function(e,t){return t<e},e.prototype.stringMatches=function(e,t){return!1},e.prototype.versionMatches=function(e,t){return e.isGreaterThan(t)},e}(),Ge=function(){function e(){}return e.prototype.booleanMatches=function(e,t){return!1},e.prototype.numberMatches=function(e,t){return t<=e},e.prototype.stringMatches=function(e,t){return!1},e.prototype.versionMatches=function(e,t){return e.isGreaterThanOrEqualTo(t)},e}(),Ke=function(){function e(){}return e.prototype.booleanMatches=function(e,t){return!1},e.prototype.numberMatches=function(e,t){return e<t},e.prototype.stringMatches=function(e,t){return!1},e.prototype.versionMatches=function(e,t){return e.isLessThan(t)},e}(),qe=function(){function e(){}return e.prototype.booleanMatches=function(e,t){return!1},e.prototype.numberMatches=function(e,t){return e<=t},e.prototype.stringMatches=function(e,t){return!1},e.prototype.versionMatches=function(e,t){return e.isLessThanOrEqualTo(t)},e}(),Ye=function(){function t(){}return t.prototype.getMatcher=function(e){switch(e){case"IN":return t.IN_MATCHER;case"CONTAINS":return t.CONTAINS_MATCHER;case"STARTS_WITH":return t.STARTS_WITH_MATCHER;case"ENDS_WITH":return t.ENDS_WITH_MATCHER;case"GT":return t.GT_MATCHER;case"GTE":return t.GTE_MATCHER;case"LT":return t.LT_MATCHER;case"LTE":return t.LTE_MATCHER}},t.IN_MATCHER=new Ue,t.CONTAINS_MATCHER=new Ve,t.STARTS_WITH_MATCHER=new He,t.ENDS_WITH_MATCHER=new $e,t.GT_MATCHER=new Be,t.GTE_MATCHER=new Ge,t.LT_MATCHER=new Ke,t.LTE_MATCHER=new qe,t}(),We=function(){function e(){}return e.prototype.matches=function(e,t,r){return"string"==typeof t&&"string"==typeof r&&e.stringMatches(t,r)},e}(),ze=function(){function e(){}return e.prototype.matches=function(e,t,r){return"number"==typeof t&&"number"==typeof r&&e.numberMatches(t,r)},e}(),Xe=function(){function e(){}return e.prototype.matches=function(e,t,r){return"boolean"==typeof t&&"boolean"==typeof r&&e.booleanMatches(t,r)},e}(),Ze=function(){function e(){}return e.prototype.matches=function(e,t,r){t=Te.tryParse(t),r=Te.tryParse(r);return!(!t||!r)&&e.versionMatches(t,r)},e}(),Qe=function(){function t(){}return t.prototype.getMatcher=function(e){switch(e){case"STRING":return t.STRING_MATCHER;case"NUMBER":return t.NUMBER_MATCHER;case"BOOLEAN":return t.BOOLEAN_MATCHER;case"VERSION":return t.VERSION_MATCHER}},t.STRING_MATCHER=new We,t.NUMBER_MATCHER=new ze,t.BOOLEAN_MATCHER=new Xe,t.VERSION_MATCHER=new Ze,t}(),Je=function(){function e(e){this.valueOperatorMatcher=e}return e.prototype.matches=function(e,t,r,n){n=this._resolveProperty(r,n,e.key);return!!n&&this.valueOperatorMatcher.matches(n,e.match)},e.prototype._resolveProperty=function(e,t,r){switch(r.type){case"HACKLE_PROPERTY":return t[r.name];case"USER_PROPERTY":return e.properties&&e.properties[r.name]}},e}(),et=function(){function t(){}return t.prototype.getMatcher=function(e){switch(e){case"USER_PROPERTY":case"HACKLE_PROPERTY":return t.PROPERTY_CONDITION_MATCHER}},t.PROPERTY_CONDITION_MATCHER=new Je(new Le(new Qe,new Ye)),t}(),tt=function(){function e(e){this.bucketer=e}return e.prototype.resolveOrNull=function(e,t,r,n){switch(e.type){case"VARIATION":return this._resolveVariation(e,r);case"BUCKET":return this._resolveBucket(e,t,r,n)}},e.prototype._resolveVariation=function(e,t){return t._getVariationByIdOrNull(e.variationId)},e.prototype._resolveBucket=function(e,t,r,n){e=t.getBucketOrNull(e.bucketId),n=this.bucketer.bucketing(e,n);if(n)return r._getVariationByIdOrNull(n.variationId)},e}(),rt={murmurhash3_x86_32:function(e,t,r,n){for(var o,i=3432918353,u=461845907,a=-4&(n=void 0===n?e.length:n),s=t,c=0;c<a;c+=4)o=255&e.charCodeAt(c)|(255&e.charCodeAt(c+1))<<8|(255&e.charCodeAt(c+2))<<16|(255&e.charCodeAt(c+3))<<24,o=(131071&(o=this.mul32(o,i)))<<15|o>>>17,s=5*((524287&(s^=o=this.mul32(o,u)))<<13|s>>>19)+3864292196|0;switch(o=0,n%4){case 3:o=(255&e.charCodeAt(2+a))<<16;case 2:o|=(255&e.charCodeAt(1+a))<<8;case 1:o|=255&e.charCodeAt(a),o=(131071&(o=this.mul32(o,i)))<<15|o>>>17,s^=o=this.mul32(o,u)}return s^=n,s=this.mul32(s^=s>>>16,2246822507),(s=this.mul32(s^=s>>>13,3266489909))^s>>>16},mul32:function(e,t){var r=65535&t;return((t-r)*e|0)+(r*e|0)|0}},nt=function(){function e(){}return e.prototype.bucketing=function(e,t){var r=this.calculateSlotNumber(e.seed,e.slotSize,t.id);return e.slots.find(function(e){return e.contains(r)})},e.prototype.calculateSlotNumber=function(e,t,r){e=rt.murmurhash3_x86_32(r,e);return Math.abs(e)%Math.abs(t)},e}(),ot=function(){function a(e,t){void 0===t&&(t=void 0),this.flowEvaluator=e=void 0===e?void 0:e,this.nextFlow=t}return a.prototype.evaluate=function(e,t,r,n,o){return this.flowEvaluator&&this.nextFlow?this.flowEvaluator.evaluate(e,t,r,n,o,this.nextFlow):Fe.of(t,o,se.TRAFFIC_NOT_ALLOCATED)},a.of=function(){for(var t,e,r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var o=new a;try{for(var i=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&n>=e.length?void 0:e)&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}(r.reverse()),u=i.next();!u.done;u=i.next())o=new a(u.value,o)}catch(e){t={error:e}}finally{try{u&&!u.done&&(e=i.return)&&e.call(i)}finally{if(t)throw t.error}}return o},a}(),it=function(){function e(){}return e.prototype.evaluate=function(e,t,r,n,o,i){var u=t._getOverriddenVariation(r);if(!u)return i.evaluate(e,t,r,n,o);switch(t.type){case"AB_TEST":return Fe.withVariation(u,se.OVERRIDDEN);case"FEATURE_FLAG":return Fe.withVariation(u,se.INDIVIDUAL_TARGET_MATCH)}},e}(),ut=function(){function e(){}return e.prototype.evaluate=function(e,t,r,n,o,i){return t instanceof ce.Draft?Fe.of(t,o,se.EXPERIMENT_DRAFT):i.evaluate(e,t,r,n,o)},e}(),at=function(){function e(){}return e.prototype.evaluate=function(e,t,r,n,o,i){if(!(t instanceof ce.Paused))return i.evaluate(e,t,r,n,o);switch(t.type){case"AB_TEST":return Fe.of(t,o,se.EXPERIMENT_PAUSED);case"FEATURE_FLAG":return Fe.of(t,o,se.FEATURE_FLAG_INACTIVE)}},e}(),st=function(){function e(){}return e.prototype.evaluate=function(e,t,r,n,o,i){return t instanceof ce.Completed?Fe.withVariation(t.winnerVariation(),se.EXPERIMENT_COMPLETED):i.evaluate(e,t,r,n,o)},e}(),ct=function(){function e(e){this.experimentTargetDeterminer=e}return e.prototype.evaluate=function(e,t,r,n,o,i){if(!(t instanceof ce.Running))throw new Error("experiment must be running [".concat(t.id,"]"));if("AB_TEST"!==t.type)throw new Error("experiment type bust be AB_TEST [".concat(t.id,"]"));return this.experimentTargetDeterminer.isUserInExperimentTarget(e,t,r,n)?i.evaluate(e,t,r,n,o):Fe.of(t,o,se.NOT_IN_EXPERIMENT_TARGET)},e}(),ft=function(){function e(e){this.actionResolver=e}return e.prototype.evaluate=function(e,t,r,n,o,i){if(!(t instanceof ce.Running))throw new Error("experiment must be running [".concat(t.id,"]"));if("AB_TEST"!==t.type)throw new Error("experiment type bust be AB_TEST [".concat(t.id,"]"));r=this.actionResolver.resolveOrNull(t.defaultRule,e,t,r);return r?r.isDropped?Fe.of(t,o,se.VARIATION_DROPPED):Fe.withVariation(r,se.TRAFFIC_ALLOCATED):Fe.of(t,o,se.TRAFFIC_NOT_ALLOCATED)},e}(),lt=function(){function e(e,t){this.targetRuleDeterminer=e,this.actionResolver=t}return e.prototype.evaluate=function(e,t,r,n,o,i){if(!(t instanceof ce.Running))throw new Error("experiment must be running [".concat(t.id,"]"));if("FEATURE_FLAG"!==t.type)throw new Error("experiment type bust be FEATURE_FLAG [".concat(t.id,"]"));var u=this.targetRuleDeterminer.determineTargetRuleOrNull(e,t,r,n);if(!u)return i.evaluate(e,t,r,n,o);r=this.actionResolver.resolveOrNull(u.action,e,t,r);if(!r)throw new Error("FeatureFlag must decide the Variation [".concat(t.id,"]"));return Fe.withVariation(r,se.TARGET_RULE_MATCH)},e}(),pt=function(){function e(e){this.actionResolver=e}return e.prototype.evaluate=function(e,t,r,n,o,i){if(!(t instanceof ce.Running))throw new Error("experiment must be running [".concat(t.id,"]"));if("FEATURE_FLAG"!==t.type)throw new Error("experiment type bust be FEATURE_FLAG [".concat(t.id,"]"));r=this.actionResolver.resolveOrNull(t.defaultRule,e,t,r);if(!r)throw new Error("FeatureFlag must decide the Variation [".concat(t.id,"]"));return Fe.withVariation(r,se.DEFAULT_RULE)},e}(),yt=function(){function e(e){this.targetMatcher=e}return e.prototype.isUserInExperimentTarget=function(t,e,r,n){var o=this;if(!(e instanceof ce.Running))throw new Error("experiment must be running [".concat(e.id,"]"));return 0===e.targetAudiences.length||e.targetAudiences.some(function(e){return o.targetMatcher.matches(e,t,r,n)})},e}(),ht=function(){function e(e){this.targetMatcher=e}return e.prototype.determineTargetRuleOrNull=function(t,e,r,n){var o=this;if(!(e instanceof ce.Running))throw new Error("experiment must be running [".concat(e.id,"]"));return e.targetRules.find(function(e){return o.targetMatcher.matches(e.target,t,r,n)})},e}(),dt=function(){function e(){var e=new je(new et),t=new tt(new nt);this.abTestFlow=ot.of(new it,new ut,new at,new st,new ct(new yt(e)),new ft(t)),this.featureFlagFlow=ot.of(new ut,new at,new st,new it,new lt(new ht(e),t),new pt(t))}return e.prototype.getFlow=function(e){switch(e){case"AB_TEST":return this.abTestFlow;case"FEATURE_FLAG":return this.featureFlagFlow}},e}(),mt=R.log,a=function(){function e(e,t,r){this.evaluator=new Me(new dt),this.workspaceFetcher=e,this.eventProcessor=t,this.eventEmitter=r,this.workspaceFetcher.start(),this.eventProcessor.start(),this.readyPromise=this.workspaceFetcher.onReady().then(function(){return{success:!0}},function(){return{success:!1}})}return e.prototype._experiment=function(e,t,r,n){if(!e)return mt.error("experimentKey must not be empty"),ue.of(n,se.INVALID_INPUT);if(!t)return mt.error("user must not be null."),ue.of(n,se.INVALID_INPUT);if(!t.id||"string"!=typeof t.id)return mt.error("user.id must not be null and must be string type"),ue.of(n,se.INVALID_INPUT);var o=this.workspaceFetcher.get();if(!o)return mt.warn("SDK not ready."),ue.of(n,se.SDK_NOT_READY);e=o.getExperimentOrNull(e);if(!e)return mt.warn("Experiment does not exist."),ue.of(n,se.EXPERIMENT_NOT_FOUND);n=this.evaluator.evaluate(o,e,t,r,n);return this.eventProcessor.process(Pe.exposure(e,t,n,r)),ue.of(n.variationKey,n.reason)},e.prototype._featureFlag=function(e,t,r){if(!e)return mt.error("featureKey must not be empty"),ae.off(se.INVALID_INPUT);if(!t)return mt.error("user must not be null."),ae.off(se.INVALID_INPUT);if(!t.id||"string"!=typeof t.id)return mt.error("user.id must not be null and must be string type"),ae.off(se.INVALID_INPUT);var n=this.workspaceFetcher.get();if(!n)return mt.warn("SDK not ready."),ae.off(se.SDK_NOT_READY);e=n.getFeatureFlagOrNull(e);if(!e)return mt.warn("FeatureFlag does not exist."),ae.off(se.FEATURE_FLAG_NOT_FOUND);n=this.evaluator.evaluate(n,e,t,r,"A");return this.eventProcessor.process(Pe.exposure(e,t,n,r)),"A"===n.variationKey?ae.off(n.reason):ae.on(n.reason)},e.prototype._track=function(e,t,r){var n;e?"object"==typeof e?"object"!=typeof e||e.key&&"string"==typeof e.key?t?t.id&&"string"==typeof t.id?(n=this.workspaceFetcher.get())?(n=n.getEventTypeOrNull(e.key),this.eventProcessor.process(Pe.track(n,e,t,r))):mt.warn("SDK not ready"):mt.error("Id must not be null. or Id must be string type"):mt.error("User must not be null."):mt.warn("Event key must be not null. or event key must be string type."):mt.warn("Event must be event type."):mt.warn("event must not be null.")},e.prototype._onReady=function(t,e){var r;void 0===e&&(e=3e3),mt.debug("Start HackleClient onReady");var n=new Promise(function(e){r=e}),o=setTimeout(function(){r({success:!1})},e);this.readyPromise.then(function(){clearTimeout(o),r({success:!0})}),Promise.race([this.readyPromise,n]).then(function(e){mt.debug("HackleClient onReady"),t()})},e.prototype._close=function(){this.workspaceFetcher.close(),this.eventProcessor.close()},e}(),vt=function(){function e(e){var t=e.timeout,e=e.callback;this.timeout=Math.max(t,0),this.callback=e}return e.prototype.start=function(){this.timeoutId=setTimeout(this.callback,this.timeout)},e.prototype.refresh=function(){this.stop(),this.start()},e.prototype.stop=function(){this.timeoutId&&clearTimeout(this.timeoutId)},e}(),Et=function(){function e(e,t,r,n){void 0===r&&(r=1e3),void 0===n&&(n=1e4),this.buffer=[],this.sink=e,this.maxQueueSize=r,this.batchComparator=t,this.timer=new vt({callback:this.flush.bind(this),timeout:n}),this.started=!1}return e.prototype.start=function(){this.started=!0},e.prototype.stop=function(){this.started=!1;var e=this.sink(this.buffer,!0);return this.buffer=[],this.timer.stop(),e},e.prototype.enqueue=function(e){this.started&&(0===this.buffer.length&&this.timer.refresh(),this.buffer.push(e),this.buffer.length>=this.maxQueueSize&&this.flush())},e.prototype.flush=function(){this.sink(this.buffer),this.buffer=[],this.timer.stop()},e.prototype.close=function(){this.stop()},e}(),u=function(){function n(e,t,r){void 0===t&&(t=1e3),void 0===r&&(r=n.DEFAULT_FLUSH_INTERVAL),this.flushInterval=n.DEFAULT_FLUSH_INTERVAL,this.eventDispatcher=e,this.flushInterval=r,this.queue=new Et(this.drainQueue.bind(this),_t,t,r)}return n.prototype.drainQueue=function(t,r){var n=this;return new Promise(function(e){0!==t.length?r?n.eventDispatcher.dispatchXhrOrBeacon(t,function(){e()}):n.eventDispatcher.dispatch(t,function(){e()}):e()})},n.prototype.process=function(e){this.queue.enqueue(e)},n.prototype.start=function(){return e=this,s=function(){return r=this,n=function(e){return this.queue.start(),[2]},a={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]},t={next:e(0),throw:e(1),return:e(2)},"function"==typeof Symbol&&(t[Symbol.iterator]=function(){return this}),t;function e(t){return function(e){return function(t){if(o)throw new TypeError("Generator is already executing.");for(;a;)try{if(o=1,i&&(u=2&t[0]?i.return:t[0]?i.throw||((u=i.return)&&u.call(i),0):i.next)&&!(u=u.call(i,t[1])).done)return u;switch(i=0,(t=u?[2&t[0],u.value]:t)[0]){case 0:case 1:u=t;break;case 4:return a.label++,{value:t[1],done:!1};case 5:a.label++,i=t[1],t=[0];continue;case 7:t=a.ops.pop(),a.trys.pop();continue;default:if(!((u=0<(u=a.trys).length&&u[u.length-1])||6!==t[0]&&2!==t[0])){a=0;continue}if(3===t[0]&&(!u||t[1]>u[0]&&t[1]<u[3])){a.label=t[1];break}if(6===t[0]&&a.label<u[1]){a.label=u[1],u=t;break}if(u&&a.label<u[2]){a.label=u[2],a.ops.push(t);break}u[2]&&a.ops.pop(),a.trys.pop();continue}t=n.call(r,a)}catch(e){t=[6,e],i=0}finally{o=u=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}([t,e])}}var r,n,o,i,u,t,a},new(a=(a=u=void 0)||Promise)(function(r,t){function n(e){try{i(s.next(e))}catch(e){t(e)}}function o(e){try{i(s.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?r(e.value):((t=e.value)instanceof a?t:new a(function(e){e(t)})).then(n,o)}i((s=s.apply(e,u||[])).next())});var e,u,a,s},n.prototype.stop=function(){try{this.queue.close()}catch(e){}return Promise.resolve()},n.prototype.close=function(){this.stop()},n.DEFAULT_FLUSH_INTERVAL=1e4,n}(),gt=R.log,g=function(){function s(e,t,r,n){this.experiments=e,this.featureFlags=t,this.buckets=r,this.eventTypes=n}return s.prototype.getExperimentOrNull=function(e){return this.experiments.get(e)},s.prototype.getFeatureFlagOrNull=function(e){return this.featureFlags.get(e)},s.prototype.getBucketOrNull=function(e){return this.buckets.get(e)},s.prototype.getEventTypeOrNull=function(e){return this.eventTypes.get(e)||new ye(0,e)},s.from=function(e){var t=this,r=s.associate(e.buckets,function(e){return[e.id,t.toBucket(e)]}),n=s.associateBy(s.mapNotUndefined(e.experiments,function(e){return t.toExperimentOrNull("AB_TEST",e)}),function(e){return e.key}),o=s.associateBy(s.mapNotUndefined(e.featureFlags,function(e){return t.toExperimentOrNull("FEATURE_FLAG",e)}),function(e){return e.key}),e=s.associate(e.events,function(e){return[e.key,new ye(e.id,e.key)]});return new s(n,o,r,e)},s.toBucket=function(e){return new le(e.seed,e.slotSize,e.slots.map(function(e){var t=e.startInclusive,r=e.endExclusive,e=e.variationId;return new pe(t,r,e)}))},s.toExperimentOrNull=function(e,t){var r=this,n=t.variations.map(function(e){return new fe(e.id,e.key,"DROPPED"===e.status)}),o=s.associate(t.execution.userOverrides,function(e){return[e.userId,e.variationId]});switch(t.execution.status){case"READY":return new ce.Draft(t.id,t.key,e,n,o);case"RUNNING":var i=s.mapNotUndefined(t.execution.targetAudiences,function(e){return r.toTargetOrNull(e)}),u=s.mapNotUndefined(t.execution.targetRules,function(e){return r.toTargetRuleOrNull(e)}),a=this.toTargetActionOrNull(t.execution.defaultRule);return a&&new ce.Running(t.id,t.key,e,n,o,i,u,a);case"PAUSED":return new ce.Paused(t.id,t.key,e,n,o);case"STOPPED":return new ce.Completed(t.id,t.key,e,n,o,t.winnerVariationId);default:return}},s.toTargetRuleOrNull=function(e){var t=this.toTargetOrNull(e.target),e=this.toTargetActionOrNull(e.action);return t&&e&&new ge(t,e)},s.toTargetActionOrNull=function(e){var t=this.parseOrNull(Ae,e.type);return t&&new Ee(t,e.variationId,e.bucketId)},s.toTargetOrNull=function(e){var t=this,e=s.mapNotUndefined(e.conditions,function(e){return t.toConditionOrNull(e)});return new he(e)},s.toConditionOrNull=function(e){var t=this.toTargetKeyOrNull(e.key),e=this.toTargetMatchOrNull(e.match);return t&&e&&new de(t,e)},s.toTargetKeyOrNull=function(e){var t=this.parseOrNull(ke,e.type);return t&&new me(t,e.name)},s.toTargetMatchOrNull=function(e){var t=this.parseOrNull(Re,e.type),r=this.parseOrNull(Oe,e.operator),n=this.parseOrNull(we,e.valueType);return t&&r&&n&&new ve(t,r,n,e.values)},s.parseOrNull=function(e,t){e=e.find(function(e){return e===t});return e||gt.debug("Unsupported type [".concat(t,"]. Please use the latest version of sdk.")),e},s.mapNotUndefined=function(e,r){return e.reduce(function(e,t){t=r(t);return t&&e.push(t),e},Array())},s.associateTo=function(e,t,r){return e.reduce(function(e,t){t=r(t);return e.set(t[0],t[1]),e},t)},s.associate=function(e,t){return s.associateTo(e,new Map,t)},s.associateBy=function(e,t){return this.associateTo(e,new Map,function(e){return[t(e),e]})},s}(),E.Bucket=le,E.CoreVersion=be,E.DEFAULT_ON_READY_TIMEOUT=3e3,E.Decision=ue,E.DecisionReason=se,E.DefaultEventQueue=Et,E.Event=Pe,E.EventProcessor=u,E.EventType=ye,E.Experiment=ce,E.Exposure=Se,E.FeatureFlagDecision=ae,E.HackleInternalClient=a,E.Logger=R,E.MATCH_OPERATORS=Oe,E.MATCH_TYPES=Re,E.MATCH_VALUE_TYPES=we,E.MetaVersion=_e,E.Slot=pe,E.TARGET_ACTION_TYPES=Ae,E.TARGET_KEY_TYPES=ke,E.Target=he,E.TargetAction=Ee,E.TargetCondition=de,E.TargetKey=me,E.TargetMatch=ve,E.TargetRule=ge,E.Track=De,E.Variation=fe,E.Version=Te,E.Workspace=g,E.logLevels=ne,E.toPayload=function(e){var t=new Array,r=new Array;return e.forEach(function(e){Pe.isExposure(e)?t.push(e.toDto()):Pe.isTrack(e)&&r.push(e.toDto())}),{exposureEvents:t,trackEvents:r}},Object.defineProperty(E,"__esModule",{value:!0});var Rt=Tt.exports.Logger.log;function wt(e,t){void 0===t&&(t="A");var r=l.exports.useContext(te),n=r.hackle,o=r.user,i=l.exports.useCallback(function(){return(null==n?void 0:n.variation(e,o))||t},[t,e,o,n]),u=f(l.exports.useState(function(){return n?i():("undefined"!=typeof window&&Rt.error("HackleClient is not existed"),t)}),2),a=u[0],s=u[1],c={key:e,user:o},r=f(l.exports.useState(c),2),u=r[0],r=r[1];return Ot(u,c)||(r(c),s(i())),a}function Ot(e,t){var r,n,o;return e.key===t.key&&(null===(r=e.user)||void 0===r?void 0:r.id)===(null===(r=t.user)||void 0===r?void 0:r.id)&&(e=null===(e=e.user)||void 0===e?void 0:e.properties,t=null===(t=t.user)||void 0===t?void 0:t.properties,n=At(e),o=At(t),e=Object.keys(n),t=Object.keys(o),e.length===t.length&&e.every(function(e){return e in o&&n[e]===o[e]}))}function At(e){return"object"==typeof e&&null!==e?e:{}}function kt(e){var t,r=e.experimentKey,e=e.children,n=wt(r);return e&&"function"==typeof e?e(n):(l.exports.Children.forEach(e,function(e){l.exports.isValidElement(e)&&(e.props.variation?n===e.props.variation&&(t=e):e.props.default&&(t=e))}),t?l.exports.cloneElement(t,{variation:n}):null)}function Ct(e){return e.variation,e=e.children,l.exports.createElement(l.exports.Fragment,null,e)}t.HackleContext=te,t.HackleContextConsumer=v,t.HackleContextProvider=re,t.HackleExperiment=kt,t.HackleProvider=function(e){var t=e.hackleClient,r=e.user,n=e.timeout,o=void 0===n?3e3:n,i=e.children,u={hackle:t,user:r},e=(n=f(l.exports.useState(!1),2))[0],a=n[1],u=(n=f(l.exports.useState(u),2))[0],s=n[1];return l.exports.useEffect(function(){s(function(e){return c(c({},e),{user:r})})},[r]),t.onReady(function(){return a(!0)},o),e?ee.createElement(re,{value:u},i):null},t.HackleVariation=Ct,t.createInstance=function(e,t){return new o(e,t)},t.useFeature=function(e){var t=(s=l.exports.useContext(te)).hackle,r=s.user,n=l.exports.useCallback(function(){return(null==t?void 0:t.isFeatureOn(e,r))||!1},[e,r,t]),o=(a=f(l.exports.useState(function(){return t?n():("undefined"!=typeof window&&Rt.error("HackleClient is not existed"),!1)}),2))[0],i=a[1],u={key:e,user:r},a=(s=f(l.exports.useState(u),2))[0],s=s[1];return Ot(a,u)||(s(u),i(n())),o},t.useFeatureFlagDetail=function(e){var t=(s=l.exports.useContext(te)).hackle,r=s.user,n=l.exports.useCallback(function(){return(null==t?void 0:t.featureFlagDetail(e,r))||Tt.exports.FeatureFlagDecision.off(Tt.exports.DecisionReason.EXCEPTION)},[e,r,t]),o=(a=f(l.exports.useState(function(){return t?n():("undefined"!=typeof window&&Rt.error("HackleClient is not existed"),Tt.exports.FeatureFlagDecision.off(Tt.exports.DecisionReason.EXCEPTION))}),2))[0],i=a[1],u={key:e,user:r},a=(s=f(l.exports.useState(u),2))[0],s=s[1];return Ot(a,u)||(s(u),i(n())),o},t.useTrack=function(){var e=l.exports.useContext(te),t=e.hackle,r=e.user;return t?function(e){return null==t?void 0:t.track(e,r)}:("undefined"!=typeof window&&Rt.error("HackleClient is not existed"),function(){})},t.useVariation=wt,t.useVariationDetail=function(e,t){void 0===t&&(t="A");var r=(c=l.exports.useContext(te)).hackle,n=c.user,o=l.exports.useCallback(function(){return(null==r?void 0:r.variationDetail(e,n))||Tt.exports.Decision.of(t,Tt.exports.DecisionReason.EXCEPTION)},[t,e,n,r]),i=(s=f(l.exports.useState(function(){return r?o():("undefined"!=typeof window&&Rt.error("HackleClient is not existed"),Tt.exports.Decision.of(t,Tt.exports.DecisionReason.EXCEPTION))}),2))[0],u=s[1],a={key:e,user:n},s=(c=f(l.exports.useState(a),2))[0],c=c[1];return Ot(s,a)||(c(a),u(o())),i},Object.keys(r).forEach(function(e){"default"===e||t.hasOwnProperty(e)||Object.defineProperty(t,e,{enumerable:!0,get:function(){return r[e]}})}),Object.defineProperty(t,"__esModule",{value:!0})});
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@hackler/js-client-sdk")):"function"==typeof define&&define.amd?define(["exports","@hackler/js-client-sdk"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).hackleReactSDK={},e.Hackle)}(this,function(t,r){"use strict";function e(r){if(r&&r.__esModule)return r;var n=Object.create(null);return r&&Object.keys(r).forEach(function(e){var t;"default"!==e&&(t=Object.getOwnPropertyDescriptor(r,e),Object.defineProperty(n,e,t.get?t:{enumerable:!0,get:function(){return r[e]}}))}),n.default=r,Object.freeze(n)}var n=e(r),c=function(){return(c=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function f(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),u=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)u.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u}var o=(i.prototype.variation=function(e,t,r){return this.client.variation(e,t,r)},i.prototype.variationDetail=function(e,t,r){return this.client.variationDetail(e,t,r)},i.prototype.isFeatureOn=function(e,t){return this.client.isFeatureOn(e,t)},i.prototype.featureFlagDetail=function(e,t){return this.client.featureFlagDetail(e,t)},i.prototype.track=function(e,t){this.client.track(e,t)},i.prototype.trackPageView=function(e){this.client.trackPageView(e)},i.prototype.onReady=function(e,t){this.client.onReady(e,t)},i);function i(e,t){this.client=n.createInstance(e,c(c({},t),{SDK_NAME_HEADER:"react-sdk",SDK_VERSION_HEADER:"3.0.3"}))}var l={exports:{}},u={},s=Object.getOwnPropertySymbols,p=Object.prototype.hasOwnProperty,y=Object.prototype.propertyIsEnumerable;var Ne=function(){try{if(!Object.assign)return;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return;for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return;var n={};return"abcdefghijklmnopqrst".split("").forEach(function(e){n[e]=e}),"abcdefghijklmnopqrst"!==Object.keys(Object.assign({},n)).join("")?void 0:1}catch(e){return}}()?Object.assign:function(e,t){for(var r,n=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),o=1;o<arguments.length;o++){for(var i in r=Object(arguments[o]))p.call(r,i)&&(n[i]=r[i]);if(s)for(var u=s(r),a=0;a<u.length;a++)y.call(r,u[a])&&(n[u[a]]=r[u[a]])}return n},h=Ne,a="function"==typeof Symbol&&Symbol.for,d=a?Symbol.for("react.element"):60103,m=a?Symbol.for("react.portal"):60106,v=a?Symbol.for("react.fragment"):60107,E=a?Symbol.for("react.strict_mode"):60108,g=a?Symbol.for("react.profiler"):60114,T=a?Symbol.for("react.provider"):60109,b=a?Symbol.for("react.context"):60110,_=a?Symbol.for("react.forward_ref"):60112,R=a?Symbol.for("react.suspense"):60113,w=a?Symbol.for("react.memo"):60115,O=a?Symbol.for("react.lazy"):60116,A="function"==typeof Symbol&&Symbol.iterator;function k(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var C={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},N={};function I(e,t,r){this.props=e,this.context=t,this.refs=N,this.updater=r||C}function x(){}function P(e,t,r){this.props=e,this.context=t,this.refs=N,this.updater=r||C}I.prototype.isReactComponent={},I.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error(k(85));this.updater.enqueueSetState(this,e,t,"setState")},I.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},x.prototype=I.prototype;a=P.prototype=new x;a.constructor=P,h(a,I.prototype),a.isPureReactComponent=!0;var S={current:null},D=Object.prototype.hasOwnProperty,F={key:!0,ref:!0,__self:!0,__source:!0};function M(e,t,r){var n,o={},i=null,u=null;if(null!=t)for(n in void 0!==t.ref&&(u=t.ref),void 0!==t.key&&(i=""+t.key),t)D.call(t,n)&&!F.hasOwnProperty(n)&&(o[n]=t[n]);var a=arguments.length-2;if(1===a)o.children=r;else if(1<a){for(var s=Array(a),c=0;c<a;c++)s[c]=arguments[c+2];o.children=s}if(e&&e.defaultProps)for(n in a=e.defaultProps)void 0===o[n]&&(o[n]=a[n]);return{$$typeof:d,type:e,key:i,ref:u,props:o,_owner:S.current}}function j(e){return"object"==typeof e&&null!==e&&e.$$typeof===d}var L=/\/+/g,U=[];function V(e,t,r,n){if(U.length){var o=U.pop();return o.result=e,o.keyPrefix=t,o.func=r,o.context=n,o.count=0,o}return{result:e,keyPrefix:t,func:r,context:n,count:0}}function H(e){e.result=null,e.keyPrefix=null,e.func=null,e.context=null,e.count=0,U.length<10&&U.push(e)}function $(e,t,r){return null==e?0:function e(t,r,n,o){var i=!1;if(null===(t="undefined"==(a=typeof t)||"boolean"===a?null:t))i=!0;else switch(a){case"string":case"number":i=!0;break;case"object":switch(t.$$typeof){case d:case m:i=!0}}if(i)return n(o,t,""===r?"."+B(t,0):r),1;if(i=0,r=""===r?".":r+":",Array.isArray(t))for(var u=0;u<t.length;u++){var a,s=r+B(a=t[u],u);i+=e(a,s,n,o)}else if("function"==typeof(s=null!==t&&"object"==typeof t&&"function"==typeof(s=A&&t[A]||t["@@iterator"])?s:null))for(t=s.call(t),u=0;!(a=t.next()).done;)i+=e(a=a.value,s=r+B(a,u++),n,o);else if("object"===a)throw n=""+t,Error(k(31,"[object Object]"===n?"object with keys {"+Object.keys(t).join(", ")+"}":n,""));return i}(e,"",t,r)}function B(e,t){return"object"==typeof e&&null!==e&&null!=e.key?(e=e.key,r={"=":"=0",":":"=2"},"$"+(""+e).replace(/[=:]/g,function(e){return r[e]})):t.toString(36);var r}function G(e,t){e.func.call(e.context,t,e.count++)}function K(e,t,r){var n=e.result,o=e.keyPrefix;e=e.func.call(e.context,t,e.count++),Array.isArray(e)?q(e,n,r,function(e){return e}):null!=e&&(j(e)&&(r=o+(!(o=e).key||t&&t.key===e.key?"":(""+e.key).replace(L,"$&/")+"/")+r,e={$$typeof:d,type:o.type,key:r,ref:o.ref,props:o.props,_owner:o._owner}),n.push(e))}function q(e,t,r,n,o){var i="";$(e,K,t=V(t,i=null!=r?(""+r).replace(L,"$&/")+"/":i,n,o)),H(t)}var Y={current:null};function W(){var e=Y.current;if(null===e)throw Error(k(321));return e}a={ReactCurrentDispatcher:Y,ReactCurrentBatchConfig:{suspense:null},ReactCurrentOwner:S,IsSomeRendererActing:{current:!1},assign:h};u.Children={map:function(e,t,r){if(null==e)return e;var n=[];return q(e,n,null,t,r),n},forEach:function(e,t,r){if(null==e)return e;$(e,G,t=V(null,null,t,r)),H(t)},count:function(e){return $(e,function(){return null},null)},toArray:function(e){var t=[];return q(e,t,null,function(e){return e}),t},only:function(e){if(!j(e))throw Error(k(143));return e}},u.Component=I,u.Fragment=v,u.Profiler=g,u.PureComponent=P,u.StrictMode=E,u.Suspense=R,u.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=a,u.cloneElement=function(e,t,r){if(null==e)throw Error(k(267,e));var n=h({},e.props),o=e.key,i=e.ref,u=e._owner;if(null!=t)for(a in void 0!==t.ref&&(i=t.ref,u=S.current),void 0!==t.key&&(o=""+t.key),e.type&&e.type.defaultProps&&(s=e.type.defaultProps),t)D.call(t,a)&&!F.hasOwnProperty(a)&&(n[a]=(void 0===t[a]&&void 0!==s?s:t)[a]);var a=arguments.length-2;if(1===a)n.children=r;else if(1<a){for(var s=Array(a),c=0;c<a;c++)s[c]=arguments[c+2];n.children=s}return{$$typeof:d,type:e.type,key:o,ref:i,props:n,_owner:u}},u.createContext=function(e,t){return(e={$$typeof:b,_calculateChangedBits:t=void 0===t?null:t,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null}).Provider={$$typeof:T,_context:e},e.Consumer=e},u.createElement=M,u.createFactory=function(e){var t=M.bind(null,e);return t.type=e,t},u.createRef=function(){return{current:null}},u.forwardRef=function(e){return{$$typeof:_,render:e}},u.isValidElement=j,u.lazy=function(e){return{$$typeof:O,_ctor:e,_status:-1,_result:null}},u.memo=function(e,t){return{$$typeof:w,type:e,compare:void 0===t?null:t}},u.useCallback=function(e,t){return W().useCallback(e,t)},u.useContext=function(e,t){return W().useContext(e,t)},u.useDebugValue=function(){},u.useEffect=function(e,t){return W().useEffect(e,t)},u.useImperativeHandle=function(e,t,r){return W().useImperativeHandle(e,t,r)},u.useLayoutEffect=function(e,t){return W().useLayoutEffect(e,t)},u.useMemo=function(e,t){return W().useMemo(e,t)},u.useReducer=function(e,t,r){return W().useReducer(e,t,r)},u.useRef=function(e){return W().useRef(e)},u.useState=function(e){return W().useState(e)},u.version="16.14.0";var z,X,Z,Ie={},Q=function(){};function J(e,t,r,n,o){if("production"!==production)for(var i in e)if(Z(e,i)){var u;try{if("function"!=typeof e[i]){var a=Error((n||"React class")+": "+r+" type `"+i+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[i]+"`.");throw a.name="Invariant Violation",a}u=e[i](t,i,n,r,null,z)}catch(e){u=e}!u||u instanceof Error||Q((n||"React class")+": type specification of "+r+" `"+i+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof u+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),u instanceof Error&&!(u.message in X)&&(X[u.message]=!0,i=o?o():"",Q("Failed "+r+" type: "+u.message+(null!=i?i:"")))}}"production"!==production&&(z="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",X={},Z=Function.call.bind(Object.prototype.hasOwnProperty),Q=function(e){e="Warning: "+e;"undefined"!=typeof console&&console.error(e);try{throw new Error(e)}catch(e){}}),J.resetWarningCache=function(){"production"!==production&&(X={})};var xe=J;"production"!==production&&function(){var h=Ne,o=xe,e="function"==typeof Symbol&&Symbol.for,d=e?Symbol.for("react.element"):60103,m=e?Symbol.for("react.portal"):60106,a=e?Symbol.for("react.fragment"):60107,n=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,u=e?Symbol.for("react.provider"):60109,s=e?Symbol.for("react.context"):60110,t=e?Symbol.for("react.concurrent_mode"):60111,c=e?Symbol.for("react.forward_ref"):60112,f=e?Symbol.for("react.suspense"):60113,l=e?Symbol.for("react.suspense_list"):60120,p=e?Symbol.for("react.memo"):60115,y=e?Symbol.for("react.lazy"):60116,v=e?Symbol.for("react.block"):60121,r=e?Symbol.for("react.fundamental"):60117,E=e?Symbol.for("react.responder"):60118,g=e?Symbol.for("react.scope"):60119,T="function"==typeof Symbol&&Symbol.iterator,b="@@iterator";function _(e){if(null===e||"object"!=typeof e)return null;e=T&&e[T]||e[b];return"function"==typeof e?e:null}var R={current:null},w={current:null},O=/^(.*)[\\\/]/;var A=1;function k(e){if(null==e)return null;if("number"==typeof e.tag&&S("Received an unexpected object in getComponentName(). This is likely a bug in React. Please file an issue."),"function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case a:return"Fragment";case m:return"Portal";case i:return"Profiler";case n:return"StrictMode";case f:return"Suspense";case l:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case s:return"Context.Consumer";case u:return"Context.Provider";case c:return t=e.render,r="ForwardRef",t=t.displayName||t.name||"",e.displayName||(""!==t?r+"("+t+")":r);case p:return k(e.type);case v:return k(e.render);case y:r=(r=e)._status===A?r._result:null;if(r)return k(r)}var t,r;return null}var C={},N=null;function I(e){N=e}C.getCurrentStack=null,C.getStackAddendum=function(){var e,t,r,n,o,i="";N&&(n=k(N.type),o=N._owner,i+=(e=n,t=N._source,r=o&&k(o.type),u="",t?(o=(n=t.fileName).replace(O,""),/^index\./.test(o)&&(!(n=n.match(O))||(n=n[1])&&(o=n.replace(O,"")+"/"+o)),u=" (at "+o+":"+t.lineNumber+")"):r&&(u=" (created by "+r+")"),"\n in "+(e||"Unknown")+u));var u=C.getCurrentStack;return u&&(i+=u()||""),i};var x={ReactCurrentDispatcher:R,ReactCurrentBatchConfig:{suspense:null},ReactCurrentOwner:w,IsSomeRendererActing:{current:!1},assign:h};function P(e){for(var t=arguments.length,r=new Array(1<t?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];D("warn",e,r)}function S(e){for(var t=arguments.length,r=new Array(1<t?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];D("error",e,r)}function D(e,t,r){0<r.length&&"string"==typeof r[r.length-1]&&0===r[r.length-1].indexOf("\n in")||""!==(n=x.ReactDebugCurrentFrame.getStackAddendum())&&(t+="%s",r=r.concat([n]));var n=r.map(function(e){return""+e});n.unshift("Warning: "+t),Function.prototype.apply.call(console[e],console,n);try{var o=0,i="Warning: "+t.replace(/%s/g,function(){return r[o++]});throw new Error(i)}catch(e){}}h(x,{ReactDebugCurrentFrame:C,ReactComponentTreeHook:{}});var F={};function M(e,t){var r=e.constructor,e=r&&(r.displayName||r.name)||"ReactClass",r=e+"."+t;F[r]||(S("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",t,e),F[r]=!0)}var j={isMounted:function(e){return!1},enqueueForceUpdate:function(e,t,r){M(e,"forceUpdate")},enqueueReplaceState:function(e,t,r,n){M(e,"replaceState")},enqueueSetState:function(e,t,r,n){M(e,"setState")}},L={};function U(e,t,r){this.props=e,this.context=t,this.refs=L,this.updater=r||j}Object.freeze(L),U.prototype.isReactComponent={},U.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},U.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};var V,H={isMounted:["isMounted","Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],replaceState:["replaceState","Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."]};for(V in H)H.hasOwnProperty(V)&&function(e,t){Object.defineProperty(U.prototype,e,{get:function(){P("%s(...) is deprecated in plain JavaScript React classes. %s",t[0],t[1])}})}(V,H[V]);function $(){}function B(e,t,r){this.props=e,this.context=t,this.refs=L,this.updater=r||j}$.prototype=U.prototype;e=B.prototype=new $;e.constructor=B,h(e,U.prototype),e.isPureReactComponent=!0;var G,K,q=Object.prototype.hasOwnProperty,Y={key:!0,ref:!0,__self:!0,__source:!0};function W(e){if(q.call(e,"ref")){var t=Object.getOwnPropertyDescriptor(e,"ref").get;if(t&&t.isReactWarning)return}return void 0!==e.ref}function z(e){if(q.call(e,"key")){var t=Object.getOwnPropertyDescriptor(e,"key").get;if(t&&t.isReactWarning)return}return void 0!==e.key}var X={},Z=function(e,t,r,n,o,i,u){i={$$typeof:d,type:e,key:t,ref:r,props:u,_owner:i,_store:{}};return Object.defineProperty(i._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(i,"_self",{configurable:!1,enumerable:!1,writable:!1,value:n}),Object.defineProperty(i,"_source",{configurable:!1,enumerable:!1,writable:!1,value:o}),Object.freeze&&(Object.freeze(i.props),Object.freeze(i)),i};function Q(e,t,r){var n,o,i,u={},a=null,s=null,c=null,f=null;if(null!=t)for(n in W(t)&&(s=t.ref,"string"==typeof(o=t).ref&&w.current&&o.__self&&w.current.stateNode!==o.__self&&(i=k(w.current.type),X[i]||(S('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://fb.me/react-strict-mode-string-ref',k(w.current.type),o.ref),X[i]=!0))),z(t)&&(a=""+t.key),c=void 0===t.__self?null:t.__self,f=void 0===t.__source?null:t.__source,t)q.call(t,n)&&!Y.hasOwnProperty(n)&&(u[n]=t[n]);var l,p,y,h=arguments.length-2;if(1==h)u.children=r;else if(1<h){for(var d=Array(h),m=0;m<h;m++)d[m]=arguments[m+2];Object.freeze&&Object.freeze(d),u.children=d}if(e&&e.defaultProps){var v=e.defaultProps;for(n in v)void 0===u[n]&&(u[n]=v[n])}function E(){K||(K=!0,S("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://fb.me/react-special-props)",l))}function g(){G||(G=!0,S("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://fb.me/react-special-props)",y))}return(a||s)&&(r="function"==typeof e?e.displayName||e.name||"Unknown":e,a&&(p=u,y=r,g.isReactWarning=!0,Object.defineProperty(p,"key",{get:g,configurable:!0})),s&&(p=u,l=r,E.isReactWarning=!0,Object.defineProperty(p,"ref",{get:E,configurable:!0}))),Z(e,a,s,c,f,w.current,u)}function J(e){return"object"==typeof e&&null!==e&&e.$$typeof===d}var ee=".",te=":";var re=!1,ne=/\/+/g;function oe(e){return(""+e).replace(ne,"$&/")}var ie=10,ue=[];function ae(e,t,r,n){if(ue.length){var o=ue.pop();return o.result=e,o.keyPrefix=t,o.func=r,o.context=n,o.count=0,o}return{result:e,keyPrefix:t,func:r,context:n,count:0}}function se(e){e.result=null,e.keyPrefix=null,e.func=null,e.context=null,e.count=0,ue.length<ie&&ue.push(e)}function ce(e,t,r){return null==e?0:function e(t,r,n,o){var i,u=typeof t,a=!1;if(null===(t="undefined"==u||"boolean"==u?null:t))a=!0;else switch(u){case"string":case"number":a=!0;break;case"object":switch(t.$$typeof){case d:case m:a=!0}}if(a)return n(o,t,""===r?ee+fe(t,0):r),1;var s=0,c=""===r?ee:r+te;if(Array.isArray(t))for(var f=0;f<t.length;f++)s+=e(i=t[f],c+fe(i,f),n,o);else if("function"==typeof(r=_(t))){r===t.entries&&(re||P("Using Maps as children is deprecated and will be removed in a future major release. Consider converting children to an array of keyed ReactElements instead."),re=!0);for(var l,p=r.call(t),y=0;!(l=p.next()).done;)s+=e(i=l.value,c+fe(i,y++),n,o)}else if("object"==u)throw r=" If you meant to render a collection of children, use an array instead."+C.getStackAddendum(),u=""+t,Error("Objects are not valid as a React child (found: "+("[object Object]"==u?"object with keys {"+Object.keys(t).join(", ")+"}":u)+")."+r);return s}(e,"",t,r)}function fe(e,t){return"object"==typeof e&&null!==e&&null!=e.key?(e=e.key,r={"=":"=0",":":"=2"},"$"+(""+e).replace(/[=:]/g,function(e){return r[e]})):t.toString(36);var r}function le(e,t,r){var n=e.func,o=e.context;n.call(o,t,e.count++)}function pe(e,t,r){var n=e.result,o=e.keyPrefix,i=e.func,u=e.context,e=i.call(u,t,e.count++);Array.isArray(e)?ye(e,n,r,function(e){return e}):null!=e&&(J(e)&&(r=o+(!(o=e).key||t&&t.key===e.key?"":oe(e.key)+"/")+r,e=Z(o.type,r,o.ref,o._self,o._source,o._owner,o.props)),n.push(e))}function ye(e,t,r,n,o){var i="",o=ae(t,i=null!=r?oe(r)+"/":i,n,o);ce(e,pe,o),se(o)}function he(e){return"string"==typeof e||"function"==typeof e||e===a||e===t||e===i||e===n||e===f||e===l||"object"==typeof e&&null!==e&&(e.$$typeof===y||e.$$typeof===p||e.$$typeof===u||e.$$typeof===s||e.$$typeof===c||e.$$typeof===r||e.$$typeof===E||e.$$typeof===g||e.$$typeof===v)}function de(){var e=R.current;if(null===e)throw Error("Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://fb.me/react-invalid-hook-call for tips about how to debug and fix this problem.");return e}function me(){if(w.current){var e=k(w.current.type);if(e)return"\n\nCheck the render method of `"+e+"`."}return""}var ve=!1,Ee={};function ge(e,t){var r;e._store&&!e._store.validated&&null==e.key&&(e._store.validated=!0,r=t,(t=me())||(r="string"==typeof r?r:r.displayName||r.name)&&(t="\n\nCheck the top-level render call using <"+r+">."),Ee[r=t]||(Ee[r]=!0,t="",e&&e._owner&&e._owner!==w.current&&(t=" It was passed a child from "+k(e._owner.type)+"."),I(e),S('Each child in a list should have a unique "key" prop.%s%s See https://fb.me/react-warning-keys for more information.',r,t),I(null)))}function Te(e,t){if("object"==typeof e)if(Array.isArray(e))for(var r=0;r<e.length;r++){var n=e[r];J(n)&&ge(n,t)}else if(J(e))e._store&&(e._store.validated=!0);else if(e){var o=_(e);if("function"==typeof o&&o!==e.entries)for(var i,u=o.call(e);!(i=u.next()).done;)J(i.value)&&ge(i.value,t)}}function be(e){var t=e.type;if(null!=t&&"string"!=typeof t){var r,n=k(t);if("function"==typeof t)r=t.propTypes;else{if("object"!=typeof t||t.$$typeof!==c&&t.$$typeof!==p)return;r=t.propTypes}r?(I(e),o(r,e.props,"prop",n,C.getStackAddendum),I(null)):void 0===t.PropTypes||ve||(ve=!0,S("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",n||"Unknown")),"function"!=typeof t.getDefaultProps||t.getDefaultProps.isReactClassApproved||S("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function _e(e,t,r){var n,o=he(e);o||(i="",(void 0===e||"object"==typeof e&&null!==e&&0===Object.keys(e).length)&&(i+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."),i+=(null==(t=t)||void 0===(t=t.__source)?"":"\n\nCheck your code at "+t.fileName.replace(/^.*[\\\/]/,"")+":"+t.lineNumber+".")||me(),null===e?n="null":Array.isArray(e)?n="array":void 0!==e&&e.$$typeof===d?(n="<"+(k(e.type)||"Unknown")+" />",i=" Did you accidentally export a JSX literal instead of a component?"):n=typeof e,S("React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",n,i));var i=Q.apply(this,arguments);if(null==i)return i;if(o)for(var u=2;u<arguments.length;u++)Te(arguments[u],e);return(e===a?function(e){I(e);for(var t=Object.keys(e.props),r=0;r<t.length;r++){var n=t[r];if("children"!==n&&"key"!==n){S("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",n);break}}null!==e.ref&&S("Invalid attribute `ref` supplied to `React.Fragment`."),I(null)}:be)(i),i}var Re=!1;try{var we=Object.freeze({}),Oe=new Map([[we,null]]),Ae=new Set([we]);Oe.set(0,0),Ae.add(0)}catch(e){}function ke(e,t,r){for(var n=function(e,t,r){if(null==e)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var n,o,i=h({},e.props),u=e.key,a=e.ref,s=e._self,c=e._source,f=e._owner;if(null!=t)for(n in W(t)&&(a=t.ref,f=w.current),z(t)&&(u=""+t.key),e.type&&e.type.defaultProps&&(o=e.type.defaultProps),t)q.call(t,n)&&!Y.hasOwnProperty(n)&&(void 0===t[n]&&void 0!==o?i[n]=o[n]:i[n]=t[n]);var l=arguments.length-2;if(1==l)i.children=r;else if(1<l){for(var p=Array(l),y=0;y<l;y++)p[y]=arguments[y+2];i.children=p}return Z(e.type,u,a,s,c,f,i)}.apply(this,arguments),o=2;o<arguments.length;o++)Te(arguments[o],n.type);return be(n),n}function Ce(e){var t=_e.bind(null,e);return t.type=e,Re||(Re=!0,P("React.createFactory() is deprecated and will be removed in a future major release. Consider using JSX or use React.createElement() directly instead.")),Object.defineProperty(t,"type",{enumerable:!1,get:function(){return P("Factory.type is deprecated. Access the class directly before passing it to createFactory."),Object.defineProperty(this,"type",{value:e}),e}}),t}Ae=_e;Ie.Children={map:function(e,t,r){if(null==e)return e;var n=[];return ye(e,n,null,t,r),n},forEach:function(e,t,r){if(null==e)return e;r=ae(null,null,t,r),ce(e,le,r),se(r)},count:function(e){return ce(e,function(){return null},null)},toArray:function(e){var t=[];return ye(e,t,null,function(e){return e}),t},only:function(e){if(!J(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},Ie.Component=U,Ie.Fragment=a,Ie.Profiler=i,Ie.PureComponent=B,Ie.StrictMode=n,Ie.Suspense=f,Ie.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=x,Ie.cloneElement=ke,Ie.createContext=function(e,t){void 0===t?t=null:null!==t&&"function"!=typeof t&&S("createContext: Expected the optional second argument to be a function. Instead received: %s",t);var r={$$typeof:s,_calculateChangedBits:t,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},n=!(r.Provider={$$typeof:u,_context:r}),o=!1,e={$$typeof:s,_context:r,_calculateChangedBits:r._calculateChangedBits};return Object.defineProperties(e,{Provider:{get:function(){return o||(o=!0,S("Rendering <Context.Consumer.Provider> is not supported and will be removed in a future major release. Did you mean to render <Context.Provider> instead?")),r.Provider},set:function(e){r.Provider=e}},_currentValue:{get:function(){return r._currentValue},set:function(e){r._currentValue=e}},_currentValue2:{get:function(){return r._currentValue2},set:function(e){r._currentValue2=e}},_threadCount:{get:function(){return r._threadCount},set:function(e){r._threadCount=e}},Consumer:{get:function(){return n||(n=!0,S("Rendering <Context.Consumer.Consumer> is not supported and will be removed in a future major release. Did you mean to render <Context.Consumer> instead?")),r.Consumer}}}),r.Consumer=e,r._currentRenderer=null,r._currentRenderer2=null,r},Ie.createElement=Ae,Ie.createFactory=Ce,Ie.createRef=function(){var e={current:null};return Object.seal(e),e},Ie.forwardRef=function(e){return null!=e&&e.$$typeof===p?S("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."):"function"!=typeof e?S("forwardRef requires a render function but was given %s.",null===e?"null":typeof e):0!==e.length&&2!==e.length&&S("forwardRef render functions accept exactly two parameters: props and ref. %s",1===e.length?"Did you forget to use the ref parameter?":"Any additional parameter will be undefined."),null!=e&&(null==e.defaultProps&&null==e.propTypes||S("forwardRef render functions do not support propTypes or defaultProps. Did you accidentally pass a React component?")),{$$typeof:c,render:e}},Ie.isValidElement=J,Ie.lazy=function(e){var t,r,n={$$typeof:y,_ctor:e,_status:-1,_result:null};return Object.defineProperties(n,{defaultProps:{configurable:!0,get:function(){return t},set:function(e){S("React.lazy(...): It is not supported to assign `defaultProps` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."),t=e,Object.defineProperty(n,"defaultProps",{enumerable:!0})}},propTypes:{configurable:!0,get:function(){return r},set:function(e){S("React.lazy(...): It is not supported to assign `propTypes` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."),r=e,Object.defineProperty(n,"propTypes",{enumerable:!0})}}}),n},Ie.memo=function(e,t){return he(e)||S("memo: The first argument must be a component. Instead received: %s",null===e?"null":typeof e),{$$typeof:p,type:e,compare:void 0===t?null:t}},Ie.useCallback=function(e,t){return de().useCallback(e,t)},Ie.useContext=function(e,t){var r,n=de();return void 0!==t&&S("useContext() second argument is reserved for future use in React. Passing it is not supported. You passed: %s.%s",t,"number"==typeof t&&Array.isArray(arguments[2])?"\n\nDid you call array.map(useContext)? Calling Hooks inside a loop is not supported. Learn more at https://fb.me/rules-of-hooks":""),void 0!==e._context&&((r=e._context).Consumer===e?S("Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be removed in a future major release. Did you mean to call useContext(Context) instead?"):r.Provider===e&&S("Calling useContext(Context.Provider) is not supported. Did you mean to call useContext(Context) instead?")),n.useContext(e,t)},Ie.useDebugValue=function(e,t){return de().useDebugValue(e,t)},Ie.useEffect=function(e,t){return de().useEffect(e,t)},Ie.useImperativeHandle=function(e,t,r){return de().useImperativeHandle(e,t,r)},Ie.useLayoutEffect=function(e,t){return de().useLayoutEffect(e,t)},Ie.useMemo=function(e,t){return de().useMemo(e,t)},Ie.useReducer=function(e,t,r){return de().useReducer(e,t,r)},Ie.useRef=function(e){return de().useRef(e)},Ie.useState=function(e){return de().useState(e)},Ie.version="16.14.0"}(),"production"===production?l.exports=u:l.exports=Ie;var ee=l.exports,te=l.exports.createContext({hackle:void 0,user:void 0}),v=te.Consumer,re=te.Provider;var ne,oe,ie,ue,ae,se,ce,fe,le,pe,ye,he,de,me,ve,Ee,ge,Te,be,_e,Re,we,Oe,Ae,ke,Ce,Pe,Se,De,Fe,Me,je,Le,Ue,Ve,He,$e,Be,Ge,Ke,qe,Ye,We,ze,Xe,Ze,Qe,Je,et,tt,rt,nt,ot,it,ut,at,st,ct,ft,lt,pt,yt,ht,dt,mt,vt,Et,gt,Tt={exports:{}};function bt(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}oe(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}function _t(e,t){return e.timestamp==t.timestamp&&e.user.id==t.user.id&&e.user.properties==t.user.properties}g=Tt.exports,E=g,ne={DISABLE:0,ERROR:1,WARN:2,INFO:3,DEBUG:4},R=function(){function t(){}return t.setLogLevel=function(e){this.logLevel=e=void 0===e?ne.INFO:e},t._log=function(e,t){var r;switch(e){case"WARN":r="orange";break;case"ERROR":r="red";break;default:r="#AAAAAA"}try{console.log("%c[".concat(e,"] Hackle: ").concat(t),"color: ".concat(r))}catch(e){}},t.logLevel=ne.INFO,t.log={error:function(e){ne.ERROR<=t.logLevel&&t._log("ERROR",e)},warn:function(e){ne.WARN<=t.logLevel&&t._log("WARN",e)},info:function(e){ne.INFO<=t.logLevel&&t._log("INFO",e)},debug:function(e){ne.DEBUG<=t.logLevel&&t._log("DEBUG",e)}},t}(),oe=function(e,t){return(oe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},ie=function(){return(ie=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},ue=function(){function r(e,t){this.variation=e,this.reason=t}return r.of=function(e,t){return new r(e,t)},r}(),ae=function(){function t(e,t){this.isOn=e,this.reason=t}return t.on=function(e){return new t(!0,e)},t.off=function(e){return new t(!1,e)},t}(),se=function(){function e(){}return e.SDK_NOT_READY="SDK_NOT_READY",e.EXCEPTION="EXCEPTION",e.INVALID_INPUT="INVALID_INPUT",e.EXPERIMENT_NOT_FOUND="EXPERIMENT_NOT_FOUND",e.EXPERIMENT_DRAFT="EXPERIMENT_DRAFT",e.EXPERIMENT_PAUSED="EXPERIMENT_PAUSED",e.EXPERIMENT_COMPLETED="EXPERIMENT_COMPLETED",e.OVERRIDDEN="OVERRIDDEN",e.TRAFFIC_NOT_ALLOCATED="TRAFFIC_NOT_ALLOCATED",e.VARIATION_DROPPED="VARIATION_DROPPED",e.TRAFFIC_ALLOCATED="TRAFFIC_ALLOCATED",e.NOT_IN_EXPERIMENT_TARGET="NOT_IN_EXPERIMENT_TARGET",e.FEATURE_FLAG_NOT_FOUND="FEATURE_FLAG_NOT_FOUND",e.FEATURE_FLAG_INACTIVE="FEATURE_FLAG_INACTIVE",e.INDIVIDUAL_TARGET_MATCH="INDIVIDUAL_TARGET_MATCH",e.TARGET_RULE_MATCH="TARGET_RULE_MATCH",e.DEFAULT_RULE="DEFAULT_RULE",e}(),ce=function(){function e(e,t,r,n,o){this.id=e,this.key=t,this.type=r,this.variations=n,this.overrides=o}return e.prototype._getVariationByIdOrNull=function(t){return this.variations.find(function(e){return e.id===t})},e.prototype._getVariationByKeyOrNull=function(t){return this.variations.find(function(e){return e.key===t})},e.prototype._getOverriddenVariation=function(e){e=this.overrides.get(e.id);return e?this._getVariationByIdOrNull(e):void 0},e.Draft=(bt(o,a=e),o),e.Running=(bt(n,s=e),n),e.Paused=(bt(r,i=e),r),e.Completed=(bt(t,u=e),t.prototype.winnerVariation=function(){var t=this;return this.variations.find(function(e){return e.id===t._winnerVariationId})},t),e;function t(e,t,r,n,o,i){o=u.call(this,e,t,r,n,o)||this;return o._winnerVariationId=i,o}var u,i,s,a;function r(e,t,r,n,o){return i.call(this,e,t,r,n,o)||this}function n(e,t,r,n,o,i,u,a){o=s.call(this,e,t,r,n,o)||this;return o.targetAudiences=i,o.targetRules=u,o.defaultRule=a,o}function o(e,t,r,n,o){return a.call(this,e,t,r,n,o)||this}}(),fe=function(e,t,r){this.id=e,this.key=t,this.isDropped=r},le=function(e,t,r){this.seed=e,this.slotSize=t,this.slots=r},pe=function(){function e(e,t,r){this.startInclusive=e,this.endExclusive=t,this.variationId=r}return e.prototype.contains=function(e){return this.startInclusive<=e&&e<this.endExclusive},e}(),ye=function(e,t){this.id=e,this.key=t},he=function(e){this.conditions=e},de=function(e,t){this.key=e,this.match=t},me=function(e,t){this.type=e,this.name=t},ve=function(e,t,r,n){this.type=e,this.operator=t,this.valueType=r,this.values=n},Ee=function(e,t,r){this.type=e,this.variationId=t,this.bucketId=r},ge=function(e,t){this.target=e,this.action=t},Te=function(){function i(e,t,r){this.coreVersion=e,this.prerelease=t,this.build=r}return i.tryParse=function(e){var u=i.regExp.exec(e);if(u){var t=function(e){var t="function"==typeof Symbol&&u[Symbol.iterator];if(!t)return u;var r,n,o=t.call(u),i=[];try{for(;(void 0===e||0<e--)&&!(r=o.next()).done;)i.push(r.value)}catch(e){n={error:e}}finally{try{r&&!r.done&&(t=o.return)&&t.call(o)}finally{if(n)throw n.error}}return i}(6);t[0];var r=t[1],n=t[2],o=void 0===n?"0":n,e=t[3],n=void 0===e?"0":e,e=t[4],t=t[5];return new i(new be(parseInt(r,10),parseInt(o,10),parseInt(n,10)),_e.parse(e),_e.parse(t))}},i.prototype.compareTo=function(e){return this.coreVersion.compareTo(e.coreVersion)||this.prerelease.compareTo(e.prerelease)},i.prototype.isEqualTo=function(e){return 0===this.compareTo(e)},i.prototype.isGreaterThan=function(e){return 0<this.compareTo(e)},i.prototype.isGreaterThanOrEqualTo=function(e){return 0<=this.compareTo(e)},i.prototype.isLessThan=function(e){return this.compareTo(e)<0},i.prototype.isLessThanOrEqualTo=function(e){return this.compareTo(e)<=0},i.regExp=/^(0|[1-9]\d*)(?:\.(0|[1-9]\d*))?(?:\.(0|[1-9]\d*))?(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/,i}(),be=function(){function e(e,t,r){this.major=e,this.minor=t,this.patch=r}return e.prototype.compareTo=function(e){return this.major-e.major||this.minor-e.minor||this.patch-e.patch},e}(),_e=function(){function o(e){this.identifiers=e}return o.parse=function(e){return e?new o(e.split(".")):o.EMPTY},o.prototype.isEmpty=function(){return 0===this.identifiers.length},o.prototype.isNotEmpty=function(){return!this.isEmpty()},o.prototype.compareTo=function(e){return this.isEmpty()&&e.isEmpty()?0:this.isEmpty()&&e.isNotEmpty()?1:this.isNotEmpty()&&e.isEmpty()?-1:this.compareIdentifiers(e)},o.prototype.compareIdentifiers=function(e){for(var t=Math.min(this.identifiers.length,e.identifiers.length),r=0;r<t;r++){var n=o.compareIdentifiers(this.identifiers[r],e.identifiers[r]);if(0!==n)return n}return this.identifiers.length-e.identifiers.length},o.compareIdentifiers=function(e,t){return o.numericIdentifierRegExp.test(e)&&o.numericIdentifierRegExp.test(t)?+e-+t:e===t?0:e<t?-1:1},o.EMPTY=new o([]),o.numericIdentifierRegExp=/^(0|[1-9]\d*)$/,o}(),Re=["MATCH","NOT_MATCH"],we=["STRING","NUMBER","BOOLEAN","VERSION"],Oe=["IN","CONTAINS","STARTS_WITH","ENDS_WITH","GT","GTE","LT","LTE"],Ae=["VARIATION","BUCKET"],ke=["HACKLE_PROPERTY","USER_PROPERTY"],Ce=function(){function e(){}return e.validate=function(e){if(e){if("object"!=typeof e)return!1;for(var t in e)if(!this.validProperty(t,e[t]))return!1}return!0},e.filteredProperties=function(r){var n=this;return Object.keys(r).filter(function(e){return n.validProperty(e,r[e])}).reduce(function(e,t){return ie(ie({},e),((e={})[t]=n.filteredPropertiesValue(r[t]),e))},{})},e.filteredPropertiesValue=function(e){return"string"==typeof e&&1024<e.length?e.slice(0,1024):e},e.validProperty=function(e,t){return!!e&&"string"==typeof e&&!(128<e.length)&&("string"==typeof t||"boolean"==typeof t||"number"==typeof t&&!isNaN(t)&&isFinite(t))},e}(),Pe=function(){function e(e,t,r){this.timestamp=e,this.user=t,this.hackleProperties=r}return e.exposure=function(e,t,r,n){return void 0===n&&(n={}),new Se((new Date).getTime(),t,e,r.variationId,r.variationKey,r.reason,n)},e.track=function(e,t,r,n){return void 0===n&&(n={}),new De((new Date).getTime(),r,e,t,n)},e.isExposure=function(e){return void 0!==e.experiment},e.isTrack=function(e){return void 0!==e.eventType},e}(),Se=function(a){function e(e,t,r,n,o,i,u){u=a.call(this,e,t,u)||this;return u.experiment=r,u.variationId=n,u.variationKey=o,u.decisionReason=i,u}return bt(e,a),e.prototype.toDto=function(){return{timestamp:this.timestamp,userId:this.user.id,userProperties:Ce.filteredProperties(this.user.properties||{}),experimentId:this.experiment.id,experimentKey:this.experiment.key,experimentType:this.experiment.type,variationId:this.variationId,variationKey:this.variationKey,decisionReason:this.decisionReason.toString(),hackleProperties:Ce.filteredProperties(this.hackleProperties||{})}},e}(Pe),De=function(i){function e(e,t,r,n,o){o=i.call(this,e,t,o)||this;return o.eventType=r,o.event=n,o}return bt(e,i),e.prototype.toDto=function(){return{timestamp:this.timestamp,userId:this.user.id,userProperties:Ce.filteredProperties(this.user.properties||{}),eventTypeId:this.eventType.id,eventTypeKey:this.eventType.key,value:this.event.value||0,properties:Ce.filteredProperties(this.event.properties||{}),hackleProperties:Ce.filteredProperties(this.hackleProperties||{})}},e}(Pe),Fe=function(){function n(e,t,r){this.variationId=e,this.variationKey=t,this.reason=r}return n.withVariation=function(e,t){return new n(e.id,e.key,t)},n.withKey=function(e,t){return new n(void 0,e,t)},n.of=function(e,t,r){e=e._getVariationByKeyOrNull(t);return e?n.withVariation(e,r):n.withKey(t,r)},n}(),Me=function(){function e(e){this.evaluationFlowFactory=e}return e.prototype.evaluate=function(e,t,r,n,o){return this.evaluationFlowFactory.getFlow(t.type).evaluate(e,t,r,n,o)},e}(),je=function(){function e(e){this.conditionMatcherFactory=e}return e.prototype.matches=function(e,t,r,n){var o=this;return e.conditions.every(function(e){return o._matches(e,t,r,n)})},e.prototype._matches=function(e,t,r,n){return this.conditionMatcherFactory.getMatcher(e.key.type).matches(e,t,r,n)},e}(),Le=function(){function e(e,t){this.valueMatcherFactory=e,this.operatorMatcherFactory=t}return e.prototype.matches=function(t,e){var r=this.valueMatcherFactory.getMatcher(e.valueType),n=this.operatorMatcherFactory.getMatcher(e.operator),o=e.values.some(function(e){return r.matches(n,t,e)});return this._matches(e.type,o)},e.prototype._matches=function(e,t){switch(e){case"MATCH":return t;case"NOT_MATCH":return!t}},e}(),Ue=function(){function e(){}return e.prototype.booleanMatches=function(e,t){return e===t},e.prototype.numberMatches=function(e,t){return e===t},e.prototype.stringMatches=function(e,t){return e===t},e.prototype.versionMatches=function(e,t){return e.isEqualTo(t)},e}(),Ve=function(){function e(){}return e.prototype.booleanMatches=function(e,t){return!1},e.prototype.numberMatches=function(e,t){return!1},e.prototype.stringMatches=function(e,t){return e.includes(t)},e.prototype.versionMatches=function(e,t){return!1},e}(),He=function(){function e(){}return e.prototype.booleanMatches=function(e,t){return!1},e.prototype.numberMatches=function(e,t){return!1},e.prototype.stringMatches=function(e,t){return e.startsWith(t)},e.prototype.versionMatches=function(e,t){return!1},e}(),$e=function(){function e(){}return e.prototype.booleanMatches=function(e,t){return!1},e.prototype.numberMatches=function(e,t){return!1},e.prototype.stringMatches=function(e,t){return e.endsWith(t)},e.prototype.versionMatches=function(e,t){return!1},e}(),Be=function(){function e(){}return e.prototype.booleanMatches=function(e,t){return!1},e.prototype.numberMatches=function(e,t){return t<e},e.prototype.stringMatches=function(e,t){return!1},e.prototype.versionMatches=function(e,t){return e.isGreaterThan(t)},e}(),Ge=function(){function e(){}return e.prototype.booleanMatches=function(e,t){return!1},e.prototype.numberMatches=function(e,t){return t<=e},e.prototype.stringMatches=function(e,t){return!1},e.prototype.versionMatches=function(e,t){return e.isGreaterThanOrEqualTo(t)},e}(),Ke=function(){function e(){}return e.prototype.booleanMatches=function(e,t){return!1},e.prototype.numberMatches=function(e,t){return e<t},e.prototype.stringMatches=function(e,t){return!1},e.prototype.versionMatches=function(e,t){return e.isLessThan(t)},e}(),qe=function(){function e(){}return e.prototype.booleanMatches=function(e,t){return!1},e.prototype.numberMatches=function(e,t){return e<=t},e.prototype.stringMatches=function(e,t){return!1},e.prototype.versionMatches=function(e,t){return e.isLessThanOrEqualTo(t)},e}(),Ye=function(){function t(){}return t.prototype.getMatcher=function(e){switch(e){case"IN":return t.IN_MATCHER;case"CONTAINS":return t.CONTAINS_MATCHER;case"STARTS_WITH":return t.STARTS_WITH_MATCHER;case"ENDS_WITH":return t.ENDS_WITH_MATCHER;case"GT":return t.GT_MATCHER;case"GTE":return t.GTE_MATCHER;case"LT":return t.LT_MATCHER;case"LTE":return t.LTE_MATCHER}},t.IN_MATCHER=new Ue,t.CONTAINS_MATCHER=new Ve,t.STARTS_WITH_MATCHER=new He,t.ENDS_WITH_MATCHER=new $e,t.GT_MATCHER=new Be,t.GTE_MATCHER=new Ge,t.LT_MATCHER=new Ke,t.LTE_MATCHER=new qe,t}(),We=function(){function e(){}return e.prototype.matches=function(e,t,r){return"string"==typeof t&&"string"==typeof r&&e.stringMatches(t,r)},e}(),ze=function(){function e(){}return e.prototype.matches=function(e,t,r){return"number"==typeof t&&"number"==typeof r&&e.numberMatches(t,r)},e}(),Xe=function(){function e(){}return e.prototype.matches=function(e,t,r){return"boolean"==typeof t&&"boolean"==typeof r&&e.booleanMatches(t,r)},e}(),Ze=function(){function e(){}return e.prototype.matches=function(e,t,r){t=Te.tryParse(t),r=Te.tryParse(r);return!(!t||!r)&&e.versionMatches(t,r)},e}(),Qe=function(){function t(){}return t.prototype.getMatcher=function(e){switch(e){case"STRING":return t.STRING_MATCHER;case"NUMBER":return t.NUMBER_MATCHER;case"BOOLEAN":return t.BOOLEAN_MATCHER;case"VERSION":return t.VERSION_MATCHER}},t.STRING_MATCHER=new We,t.NUMBER_MATCHER=new ze,t.BOOLEAN_MATCHER=new Xe,t.VERSION_MATCHER=new Ze,t}(),Je=function(){function e(e){this.valueOperatorMatcher=e}return e.prototype.matches=function(e,t,r,n){n=this._resolveProperty(r,n,e.key);return!!n&&this.valueOperatorMatcher.matches(n,e.match)},e.prototype._resolveProperty=function(e,t,r){switch(r.type){case"HACKLE_PROPERTY":return t[r.name];case"USER_PROPERTY":return e.properties&&e.properties[r.name]}},e}(),et=function(){function t(){}return t.prototype.getMatcher=function(e){switch(e){case"USER_PROPERTY":case"HACKLE_PROPERTY":return t.PROPERTY_CONDITION_MATCHER}},t.PROPERTY_CONDITION_MATCHER=new Je(new Le(new Qe,new Ye)),t}(),tt=function(){function e(e){this.bucketer=e}return e.prototype.resolveOrNull=function(e,t,r,n){switch(e.type){case"VARIATION":return this._resolveVariation(e,r);case"BUCKET":return this._resolveBucket(e,t,r,n)}},e.prototype._resolveVariation=function(e,t){return t._getVariationByIdOrNull(e.variationId)},e.prototype._resolveBucket=function(e,t,r,n){e=t.getBucketOrNull(e.bucketId),n=this.bucketer.bucketing(e,n);if(n)return r._getVariationByIdOrNull(n.variationId)},e}(),rt={murmurhash3_x86_32:function(e,t,r,n){for(var o,i=3432918353,u=461845907,a=-4&(n=void 0===n?e.length:n),s=t,c=0;c<a;c+=4)o=255&e.charCodeAt(c)|(255&e.charCodeAt(c+1))<<8|(255&e.charCodeAt(c+2))<<16|(255&e.charCodeAt(c+3))<<24,o=(131071&(o=this.mul32(o,i)))<<15|o>>>17,s=5*((524287&(s^=o=this.mul32(o,u)))<<13|s>>>19)+3864292196|0;switch(o=0,n%4){case 3:o=(255&e.charCodeAt(2+a))<<16;case 2:o|=(255&e.charCodeAt(1+a))<<8;case 1:o|=255&e.charCodeAt(a),o=(131071&(o=this.mul32(o,i)))<<15|o>>>17,s^=o=this.mul32(o,u)}return s^=n,s=this.mul32(s^=s>>>16,2246822507),(s=this.mul32(s^=s>>>13,3266489909))^s>>>16},mul32:function(e,t){var r=65535&t;return((t-r)*e|0)+(r*e|0)|0}},nt=function(){function e(){}return e.prototype.bucketing=function(e,t){var r=this.calculateSlotNumber(e.seed,e.slotSize,t.id);return e.slots.find(function(e){return e.contains(r)})},e.prototype.calculateSlotNumber=function(e,t,r){e=rt.murmurhash3_x86_32(r,e);return Math.abs(e)%Math.abs(t)},e}(),ot=function(){function a(e,t){void 0===t&&(t=void 0),this.flowEvaluator=e=void 0===e?void 0:e,this.nextFlow=t}return a.prototype.evaluate=function(e,t,r,n,o){return this.flowEvaluator&&this.nextFlow?this.flowEvaluator.evaluate(e,t,r,n,o,this.nextFlow):Fe.of(t,o,se.TRAFFIC_NOT_ALLOCATED)},a.of=function(){for(var t,e,r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var o=new a;try{for(var i=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&n>=e.length?void 0:e)&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}(r.reverse()),u=i.next();!u.done;u=i.next())o=new a(u.value,o)}catch(e){t={error:e}}finally{try{u&&!u.done&&(e=i.return)&&e.call(i)}finally{if(t)throw t.error}}return o},a}(),it=function(){function e(){}return e.prototype.evaluate=function(e,t,r,n,o,i){var u=t._getOverriddenVariation(r);if(!u)return i.evaluate(e,t,r,n,o);switch(t.type){case"AB_TEST":return Fe.withVariation(u,se.OVERRIDDEN);case"FEATURE_FLAG":return Fe.withVariation(u,se.INDIVIDUAL_TARGET_MATCH)}},e}(),ut=function(){function e(){}return e.prototype.evaluate=function(e,t,r,n,o,i){return t instanceof ce.Draft?Fe.of(t,o,se.EXPERIMENT_DRAFT):i.evaluate(e,t,r,n,o)},e}(),at=function(){function e(){}return e.prototype.evaluate=function(e,t,r,n,o,i){if(!(t instanceof ce.Paused))return i.evaluate(e,t,r,n,o);switch(t.type){case"AB_TEST":return Fe.of(t,o,se.EXPERIMENT_PAUSED);case"FEATURE_FLAG":return Fe.of(t,o,se.FEATURE_FLAG_INACTIVE)}},e}(),st=function(){function e(){}return e.prototype.evaluate=function(e,t,r,n,o,i){return t instanceof ce.Completed?Fe.withVariation(t.winnerVariation(),se.EXPERIMENT_COMPLETED):i.evaluate(e,t,r,n,o)},e}(),ct=function(){function e(e){this.experimentTargetDeterminer=e}return e.prototype.evaluate=function(e,t,r,n,o,i){if(!(t instanceof ce.Running))throw new Error("experiment must be running [".concat(t.id,"]"));if("AB_TEST"!==t.type)throw new Error("experiment type bust be AB_TEST [".concat(t.id,"]"));return this.experimentTargetDeterminer.isUserInExperimentTarget(e,t,r,n)?i.evaluate(e,t,r,n,o):Fe.of(t,o,se.NOT_IN_EXPERIMENT_TARGET)},e}(),ft=function(){function e(e){this.actionResolver=e}return e.prototype.evaluate=function(e,t,r,n,o,i){if(!(t instanceof ce.Running))throw new Error("experiment must be running [".concat(t.id,"]"));if("AB_TEST"!==t.type)throw new Error("experiment type bust be AB_TEST [".concat(t.id,"]"));r=this.actionResolver.resolveOrNull(t.defaultRule,e,t,r);return r?r.isDropped?Fe.of(t,o,se.VARIATION_DROPPED):Fe.withVariation(r,se.TRAFFIC_ALLOCATED):Fe.of(t,o,se.TRAFFIC_NOT_ALLOCATED)},e}(),lt=function(){function e(e,t){this.targetRuleDeterminer=e,this.actionResolver=t}return e.prototype.evaluate=function(e,t,r,n,o,i){if(!(t instanceof ce.Running))throw new Error("experiment must be running [".concat(t.id,"]"));if("FEATURE_FLAG"!==t.type)throw new Error("experiment type bust be FEATURE_FLAG [".concat(t.id,"]"));var u=this.targetRuleDeterminer.determineTargetRuleOrNull(e,t,r,n);if(!u)return i.evaluate(e,t,r,n,o);r=this.actionResolver.resolveOrNull(u.action,e,t,r);if(!r)throw new Error("FeatureFlag must decide the Variation [".concat(t.id,"]"));return Fe.withVariation(r,se.TARGET_RULE_MATCH)},e}(),pt=function(){function e(e){this.actionResolver=e}return e.prototype.evaluate=function(e,t,r,n,o,i){if(!(t instanceof ce.Running))throw new Error("experiment must be running [".concat(t.id,"]"));if("FEATURE_FLAG"!==t.type)throw new Error("experiment type bust be FEATURE_FLAG [".concat(t.id,"]"));r=this.actionResolver.resolveOrNull(t.defaultRule,e,t,r);if(!r)throw new Error("FeatureFlag must decide the Variation [".concat(t.id,"]"));return Fe.withVariation(r,se.DEFAULT_RULE)},e}(),yt=function(){function e(e){this.targetMatcher=e}return e.prototype.isUserInExperimentTarget=function(t,e,r,n){var o=this;if(!(e instanceof ce.Running))throw new Error("experiment must be running [".concat(e.id,"]"));return 0===e.targetAudiences.length||e.targetAudiences.some(function(e){return o.targetMatcher.matches(e,t,r,n)})},e}(),ht=function(){function e(e){this.targetMatcher=e}return e.prototype.determineTargetRuleOrNull=function(t,e,r,n){var o=this;if(!(e instanceof ce.Running))throw new Error("experiment must be running [".concat(e.id,"]"));return e.targetRules.find(function(e){return o.targetMatcher.matches(e.target,t,r,n)})},e}(),dt=function(){function e(){var e=new je(new et),t=new tt(new nt);this.abTestFlow=ot.of(new it,new ut,new at,new st,new ct(new yt(e)),new ft(t)),this.featureFlagFlow=ot.of(new ut,new at,new st,new it,new lt(new ht(e),t),new pt(t))}return e.prototype.getFlow=function(e){switch(e){case"AB_TEST":return this.abTestFlow;case"FEATURE_FLAG":return this.featureFlagFlow}},e}(),mt=R.log,a=function(){function e(e,t,r){this.evaluator=new Me(new dt),this.workspaceFetcher=e,this.eventProcessor=t,this.eventEmitter=r,this.workspaceFetcher.start(),this.eventProcessor.start(),this.readyPromise=this.workspaceFetcher.onReady().then(function(){return{success:!0}},function(){return{success:!1}})}return e.prototype._experiment=function(e,t,r,n){if(!e)return mt.error("experimentKey must not be empty"),ue.of(n,se.INVALID_INPUT);if(!t)return mt.error("user must not be null."),ue.of(n,se.INVALID_INPUT);if(!t.id||"string"!=typeof t.id)return mt.error("user.id must not be null and must be string type"),ue.of(n,se.INVALID_INPUT);var o=this.workspaceFetcher.get();if(!o)return mt.warn("SDK not ready."),ue.of(n,se.SDK_NOT_READY);e=o.getExperimentOrNull(e);if(!e)return mt.warn("Experiment does not exist."),ue.of(n,se.EXPERIMENT_NOT_FOUND);n=this.evaluator.evaluate(o,e,t,r,n);return this.eventProcessor.process(Pe.exposure(e,t,n,r)),ue.of(n.variationKey,n.reason)},e.prototype._featureFlag=function(e,t,r){if(!e)return mt.error("featureKey must not be empty"),ae.off(se.INVALID_INPUT);if(!t)return mt.error("user must not be null."),ae.off(se.INVALID_INPUT);if(!t.id||"string"!=typeof t.id)return mt.error("user.id must not be null and must be string type"),ae.off(se.INVALID_INPUT);var n=this.workspaceFetcher.get();if(!n)return mt.warn("SDK not ready."),ae.off(se.SDK_NOT_READY);e=n.getFeatureFlagOrNull(e);if(!e)return mt.warn("FeatureFlag does not exist."),ae.off(se.FEATURE_FLAG_NOT_FOUND);n=this.evaluator.evaluate(n,e,t,r,"A");return this.eventProcessor.process(Pe.exposure(e,t,n,r)),"A"===n.variationKey?ae.off(n.reason):ae.on(n.reason)},e.prototype._track=function(e,t,r){var n;e?"object"==typeof e?"object"!=typeof e||e.key&&"string"==typeof e.key?t?t.id&&"string"==typeof t.id?(n=this.workspaceFetcher.get())?(n=n.getEventTypeOrNull(e.key),this.eventProcessor.process(Pe.track(n,e,t,r))):mt.warn("SDK not ready"):mt.error("Id must not be null. or Id must be string type"):mt.error("User must not be null."):mt.warn("Event key must be not null. or event key must be string type."):mt.warn("Event must be event type."):mt.warn("event must not be null.")},e.prototype._onReady=function(t,e){var r;void 0===e&&(e=3e3),mt.debug("Start HackleClient onReady");var n=new Promise(function(e){r=e}),o=setTimeout(function(){r({success:!1})},e);this.readyPromise.then(function(){clearTimeout(o),r({success:!0})}),Promise.race([this.readyPromise,n]).then(function(e){mt.debug("HackleClient onReady"),t()})},e.prototype._close=function(){this.workspaceFetcher.close(),this.eventProcessor.close()},e}(),vt=function(){function e(e){var t=e.timeout,e=e.callback;this.timeout=Math.max(t,0),this.callback=e}return e.prototype.start=function(){this.timeoutId=setTimeout(this.callback,this.timeout)},e.prototype.refresh=function(){this.stop(),this.start()},e.prototype.stop=function(){this.timeoutId&&clearTimeout(this.timeoutId)},e}(),Et=function(){function e(e,t,r,n){void 0===r&&(r=1e3),void 0===n&&(n=1e4),this.buffer=[],this.sink=e,this.maxQueueSize=r,this.batchComparator=t,this.timer=new vt({callback:this.flush.bind(this),timeout:n}),this.started=!1}return e.prototype.start=function(){this.started=!0},e.prototype.stop=function(){this.started=!1;var e=this.sink(this.buffer,!0);return this.buffer=[],this.timer.stop(),e},e.prototype.enqueue=function(e){this.started&&(0===this.buffer.length&&this.timer.refresh(),this.buffer.push(e),this.buffer.length>=this.maxQueueSize&&this.flush())},e.prototype.flush=function(){this.sink(this.buffer),this.buffer=[],this.timer.stop()},e.prototype.close=function(){this.stop()},e}(),u=function(){function n(e,t,r){void 0===t&&(t=1e3),void 0===r&&(r=n.DEFAULT_FLUSH_INTERVAL),this.flushInterval=n.DEFAULT_FLUSH_INTERVAL,this.eventDispatcher=e,this.flushInterval=r,this.queue=new Et(this.drainQueue.bind(this),_t,t,r)}return n.prototype.drainQueue=function(t,r){var n=this;return new Promise(function(e){0!==t.length?r?n.eventDispatcher.dispatchXhrOrBeacon(t,function(){e()}):n.eventDispatcher.dispatch(t,function(){e()}):e()})},n.prototype.process=function(e){this.queue.enqueue(e)},n.prototype.start=function(){return e=this,s=function(){return r=this,n=function(e){return this.queue.start(),[2]},a={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]},t={next:e(0),throw:e(1),return:e(2)},"function"==typeof Symbol&&(t[Symbol.iterator]=function(){return this}),t;function e(t){return function(e){return function(t){if(o)throw new TypeError("Generator is already executing.");for(;a;)try{if(o=1,i&&(u=2&t[0]?i.return:t[0]?i.throw||((u=i.return)&&u.call(i),0):i.next)&&!(u=u.call(i,t[1])).done)return u;switch(i=0,(t=u?[2&t[0],u.value]:t)[0]){case 0:case 1:u=t;break;case 4:return a.label++,{value:t[1],done:!1};case 5:a.label++,i=t[1],t=[0];continue;case 7:t=a.ops.pop(),a.trys.pop();continue;default:if(!((u=0<(u=a.trys).length&&u[u.length-1])||6!==t[0]&&2!==t[0])){a=0;continue}if(3===t[0]&&(!u||t[1]>u[0]&&t[1]<u[3])){a.label=t[1];break}if(6===t[0]&&a.label<u[1]){a.label=u[1],u=t;break}if(u&&a.label<u[2]){a.label=u[2],a.ops.push(t);break}u[2]&&a.ops.pop(),a.trys.pop();continue}t=n.call(r,a)}catch(e){t=[6,e],i=0}finally{o=u=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}([t,e])}}var r,n,o,i,u,t,a},new(a=(a=u=void 0)||Promise)(function(r,t){function n(e){try{i(s.next(e))}catch(e){t(e)}}function o(e){try{i(s.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?r(e.value):((t=e.value)instanceof a?t:new a(function(e){e(t)})).then(n,o)}i((s=s.apply(e,u||[])).next())});var e,u,a,s},n.prototype.stop=function(){try{this.queue.close()}catch(e){}return Promise.resolve()},n.prototype.close=function(){this.stop()},n.DEFAULT_FLUSH_INTERVAL=1e4,n}(),gt=R.log,g=function(){function s(e,t,r,n){this.experiments=e,this.featureFlags=t,this.buckets=r,this.eventTypes=n}return s.prototype.getExperimentOrNull=function(e){return this.experiments.get(e)},s.prototype.getFeatureFlagOrNull=function(e){return this.featureFlags.get(e)},s.prototype.getBucketOrNull=function(e){return this.buckets.get(e)},s.prototype.getEventTypeOrNull=function(e){return this.eventTypes.get(e)||new ye(0,e)},s.from=function(e){var t=this,r=s.associate(e.buckets,function(e){return[e.id,t.toBucket(e)]}),n=s.associateBy(s.mapNotUndefined(e.experiments,function(e){return t.toExperimentOrNull("AB_TEST",e)}),function(e){return e.key}),o=s.associateBy(s.mapNotUndefined(e.featureFlags,function(e){return t.toExperimentOrNull("FEATURE_FLAG",e)}),function(e){return e.key}),e=s.associate(e.events,function(e){return[e.key,new ye(e.id,e.key)]});return new s(n,o,r,e)},s.toBucket=function(e){return new le(e.seed,e.slotSize,e.slots.map(function(e){var t=e.startInclusive,r=e.endExclusive,e=e.variationId;return new pe(t,r,e)}))},s.toExperimentOrNull=function(e,t){var r=this,n=t.variations.map(function(e){return new fe(e.id,e.key,"DROPPED"===e.status)}),o=s.associate(t.execution.userOverrides,function(e){return[e.userId,e.variationId]});switch(t.execution.status){case"READY":return new ce.Draft(t.id,t.key,e,n,o);case"RUNNING":var i=s.mapNotUndefined(t.execution.targetAudiences,function(e){return r.toTargetOrNull(e)}),u=s.mapNotUndefined(t.execution.targetRules,function(e){return r.toTargetRuleOrNull(e)}),a=this.toTargetActionOrNull(t.execution.defaultRule);return a&&new ce.Running(t.id,t.key,e,n,o,i,u,a);case"PAUSED":return new ce.Paused(t.id,t.key,e,n,o);case"STOPPED":return new ce.Completed(t.id,t.key,e,n,o,t.winnerVariationId);default:return}},s.toTargetRuleOrNull=function(e){var t=this.toTargetOrNull(e.target),e=this.toTargetActionOrNull(e.action);return t&&e&&new ge(t,e)},s.toTargetActionOrNull=function(e){var t=this.parseOrNull(Ae,e.type);return t&&new Ee(t,e.variationId,e.bucketId)},s.toTargetOrNull=function(e){var t=this,e=s.mapNotUndefined(e.conditions,function(e){return t.toConditionOrNull(e)});return new he(e)},s.toConditionOrNull=function(e){var t=this.toTargetKeyOrNull(e.key),e=this.toTargetMatchOrNull(e.match);return t&&e&&new de(t,e)},s.toTargetKeyOrNull=function(e){var t=this.parseOrNull(ke,e.type);return t&&new me(t,e.name)},s.toTargetMatchOrNull=function(e){var t=this.parseOrNull(Re,e.type),r=this.parseOrNull(Oe,e.operator),n=this.parseOrNull(we,e.valueType);return t&&r&&n&&new ve(t,r,n,e.values)},s.parseOrNull=function(e,t){e=e.find(function(e){return e===t});return e||gt.debug("Unsupported type [".concat(t,"]. Please use the latest version of sdk.")),e},s.mapNotUndefined=function(e,r){return e.reduce(function(e,t){t=r(t);return t&&e.push(t),e},Array())},s.associateTo=function(e,t,r){return e.reduce(function(e,t){t=r(t);return e.set(t[0],t[1]),e},t)},s.associate=function(e,t){return s.associateTo(e,new Map,t)},s.associateBy=function(e,t){return this.associateTo(e,new Map,function(e){return[t(e),e]})},s}(),E.Bucket=le,E.CoreVersion=be,E.DEFAULT_ON_READY_TIMEOUT=3e3,E.Decision=ue,E.DecisionReason=se,E.DefaultEventQueue=Et,E.Event=Pe,E.EventProcessor=u,E.EventType=ye,E.Experiment=ce,E.Exposure=Se,E.FeatureFlagDecision=ae,E.HackleInternalClient=a,E.Logger=R,E.MATCH_OPERATORS=Oe,E.MATCH_TYPES=Re,E.MATCH_VALUE_TYPES=we,E.MetaVersion=_e,E.Slot=pe,E.TARGET_ACTION_TYPES=Ae,E.TARGET_KEY_TYPES=ke,E.Target=he,E.TargetAction=Ee,E.TargetCondition=de,E.TargetKey=me,E.TargetMatch=ve,E.TargetRule=ge,E.Track=De,E.Variation=fe,E.Version=Te,E.Workspace=g,E.logLevels=ne,E.toPayload=function(e){var t=new Array,r=new Array;return e.forEach(function(e){Pe.isExposure(e)?t.push(e.toDto()):Pe.isTrack(e)&&r.push(e.toDto())}),{exposureEvents:t,trackEvents:r}},Object.defineProperty(E,"__esModule",{value:!0});var Rt=Tt.exports.Logger.log;function wt(e,t){void 0===t&&(t="A");var r=l.exports.useContext(te),n=r.hackle,o=r.user,i=l.exports.useCallback(function(){return(null==n?void 0:n.variation(e,o))||t},[t,e,o,n]),u=f(l.exports.useState(function(){return n?i():("undefined"!=typeof window&&Rt.error("HackleClient is not existed"),t)}),2),a=u[0],s=u[1],c={key:e,user:o},r=f(l.exports.useState(c),2),u=r[0],r=r[1];return Ot(u,c)||(r(c),s(i())),a}function Ot(e,t){var r,n,o;return e.key===t.key&&(null===(r=e.user)||void 0===r?void 0:r.id)===(null===(r=t.user)||void 0===r?void 0:r.id)&&(e=null===(e=e.user)||void 0===e?void 0:e.properties,t=null===(t=t.user)||void 0===t?void 0:t.properties,n=At(e),o=At(t),e=Object.keys(n),t=Object.keys(o),e.length===t.length&&e.every(function(e){return e in o&&n[e]===o[e]}))}function At(e){return"object"==typeof e&&null!==e?e:{}}function kt(e){var t,r=e.experimentKey,e=e.children,n=wt(r);return e&&"function"==typeof e?e(n):(l.exports.Children.forEach(e,function(e){l.exports.isValidElement(e)&&(e.props.variation?n===e.props.variation&&(t=e):e.props.default&&(t=e))}),t?l.exports.cloneElement(t,{variation:n}):null)}function Ct(e){return e.variation,e=e.children,l.exports.createElement(l.exports.Fragment,null,e)}t.HackleContext=te,t.HackleContextConsumer=v,t.HackleContextProvider=re,t.HackleExperiment=kt,t.HackleProvider=function(e){var t=e.hackleClient,r=e.user,n=e.timeout,o=void 0===n?3e3:n,i=e.children,u={hackle:t,user:r},e=(n=f(l.exports.useState(!1),2))[0],a=n[1],u=(n=f(l.exports.useState(u),2))[0],s=n[1];return l.exports.useEffect(function(){s(function(e){return c(c({},e),{user:r})})},[r]),t.onReady(function(){return a(!0)},o),e?ee.createElement(re,{value:u},i):null},t.HackleVariation=Ct,t.createInstance=function(e,t){return new o(e,t)},t.useFeature=function(e){var t=(s=l.exports.useContext(te)).hackle,r=s.user,n=l.exports.useCallback(function(){return(null==t?void 0:t.isFeatureOn(e,r))||!1},[e,r,t]),o=(a=f(l.exports.useState(function(){return t?n():("undefined"!=typeof window&&Rt.error("HackleClient is not existed"),!1)}),2))[0],i=a[1],u={key:e,user:r},a=(s=f(l.exports.useState(u),2))[0],s=s[1];return Ot(a,u)||(s(u),i(n())),o},t.useFeatureFlagDetail=function(e){var t=(s=l.exports.useContext(te)).hackle,r=s.user,n=l.exports.useCallback(function(){return(null==t?void 0:t.featureFlagDetail(e,r))||Tt.exports.FeatureFlagDecision.off(Tt.exports.DecisionReason.EXCEPTION)},[e,r,t]),o=(a=f(l.exports.useState(function(){return t?n():("undefined"!=typeof window&&Rt.error("HackleClient is not existed"),Tt.exports.FeatureFlagDecision.off(Tt.exports.DecisionReason.EXCEPTION))}),2))[0],i=a[1],u={key:e,user:r},a=(s=f(l.exports.useState(u),2))[0],s=s[1];return Ot(a,u)||(s(u),i(n())),o},t.useTrack=function(){var e=l.exports.useContext(te),t=e.hackle,r=e.user;return t?function(e){return null==t?void 0:t.track(e,r)}:("undefined"!=typeof window&&Rt.error("HackleClient is not existed"),function(){})},t.useVariation=wt,t.useVariationDetail=function(e,t){void 0===t&&(t="A");var r=(c=l.exports.useContext(te)).hackle,n=c.user,o=l.exports.useCallback(function(){return(null==r?void 0:r.variationDetail(e,n))||Tt.exports.Decision.of(t,Tt.exports.DecisionReason.EXCEPTION)},[t,e,n,r]),i=(s=f(l.exports.useState(function(){return r?o():("undefined"!=typeof window&&Rt.error("HackleClient is not existed"),Tt.exports.Decision.of(t,Tt.exports.DecisionReason.EXCEPTION))}),2))[0],u=s[1],a={key:e,user:n},s=(c=f(l.exports.useState(a),2))[0],c=c[1];return Ot(s,a)||(c(a),u(o())),i},Object.keys(r).forEach(function(e){"default"===e||t.hasOwnProperty(e)||Object.defineProperty(t,e,{enumerable:!0,get:function(){return r[e]}})}),Object.defineProperty(t,"__esModule",{value:!0})});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hackler/react-sdk",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.3",
|
|
4
4
|
"description": "React SDK for Hackle",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Hackle",
|
|
@@ -39,8 +39,8 @@
|
|
|
39
39
|
"url": "https://github.com/hackle-io/hackle-javascript-sdk/issues"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@hackler/sdk-core": "3.0.
|
|
43
|
-
"@hackler/js-client-sdk": "3.0.
|
|
42
|
+
"@hackler/sdk-core": "3.0.3",
|
|
43
|
+
"@hackler/js-client-sdk": "3.0.3"
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|
|
46
46
|
"react": ">=16.8.0"
|