UNPKG

@customerglu/react-web-sdk

Version:

This React Component allows developers to integrate with CustomerGlu Gamification Platform easily

50 lines (47 loc) 31.5 kB
(function(oe,re){typeof exports=="object"&&typeof module<"u"?re(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],re):(oe=typeof globalThis<"u"?globalThis:oe||self,re(oe.CustomerGluComponents={},oe.React))})(this,function(oe,re){"use strict";function hr(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}var Ce={exports:{}},ye={};/** * @license React * react-jsx-runtime.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var Ve;function Er(){if(Ve)return ye;Ve=1;var a=re,j=Symbol.for("react.element"),S=Symbol.for("react.fragment"),u=Object.prototype.hasOwnProperty,E=a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function O(d,p,P){var c,g={},D=null,F=null;P!==void 0&&(D=""+P),p.key!==void 0&&(D=""+p.key),p.ref!==void 0&&(F=p.ref);for(c in p)u.call(p,c)&&!l.hasOwnProperty(c)&&(g[c]=p[c]);if(d&&d.defaultProps)for(c in p=d.defaultProps,p)g[c]===void 0&&(g[c]=p[c]);return{$$typeof:j,type:d,key:D,ref:F,props:g,_owner:E.current}}return ye.Fragment=S,ye.jsx=O,ye.jsxs=O,ye}var me={};/** * @license React * react-jsx-runtime.development.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var Ne;function gr(){return Ne||(Ne=1,process.env.NODE_ENV!=="production"&&function(){var a=re,j=Symbol.for("react.element"),S=Symbol.for("react.portal"),u=Symbol.for("react.fragment"),E=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),O=Symbol.for("react.provider"),d=Symbol.for("react.context"),p=Symbol.for("react.forward_ref"),P=Symbol.for("react.suspense"),c=Symbol.for("react.suspense_list"),g=Symbol.for("react.memo"),D=Symbol.for("react.lazy"),F=Symbol.for("react.offscreen"),N=Symbol.iterator,M="@@iterator";function V(e){if(e===null||typeof e!="object")return null;var r=N&&e[N]||e[M];return typeof r=="function"?r:null}var U=a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function Y(e){{for(var r=arguments.length,o=new Array(r>1?r-1:0),f=1;f<r;f++)o[f-1]=arguments[f];z("error",e,o)}}function z(e,r,o){{var f=U.ReactDebugCurrentFrame,I=f.getStackAddendum();I!==""&&(r+="%s",o=o.concat([I]));var $=o.map(function(w){return String(w)});$.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,$)}}var L=!1,i=!1,te=!1,he=!1,Ee=!1,ue;ue=Symbol.for("react.module.reference");function ge(e){return!!(typeof e=="string"||typeof e=="function"||e===u||e===l||Ee||e===E||e===P||e===c||he||e===F||L||i||te||typeof e=="object"&&e!==null&&(e.$$typeof===D||e.$$typeof===g||e.$$typeof===O||e.$$typeof===d||e.$$typeof===p||e.$$typeof===ue||e.getModuleId!==void 0))}function ce(e,r,o){var f=e.displayName;if(f)return f;var I=r.displayName||r.name||"";return I!==""?o+"("+I+")":o}function fe(e){return e.displayName||"Context"}function J(e){if(e==null)return null;if(typeof e.tag=="number"&&Y("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case u:return"Fragment";case S:return"Portal";case l:return"Profiler";case E:return"StrictMode";case P:return"Suspense";case c:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case d:var r=e;return fe(r)+".Consumer";case O:var o=e;return fe(o._context)+".Provider";case p:return ce(e,e.render,"ForwardRef");case g:var f=e.displayName||null;return f!==null?f:J(e.type)||"Memo";case D:{var I=e,$=I._payload,w=I._init;try{return J(w($))}catch{return null}}}return null}var K=Object.assign,ne=0,H,ee,ae,le,t,s,h;function b(){}b.__reactDisabledLog=!0;function v(){{if(ne===0){H=console.log,ee=console.info,ae=console.warn,le=console.error,t=console.group,s=console.groupCollapsed,h=console.groupEnd;var e={configurable:!0,enumerable:!0,value:b,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}ne++}}function C(){{if(ne--,ne===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:K({},e,{value:H}),info:K({},e,{value:ee}),warn:K({},e,{value:ae}),error:K({},e,{value:le}),group:K({},e,{value:t}),groupCollapsed:K({},e,{value:s}),groupEnd:K({},e,{value:h})})}ne<0&&Y("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var y=U.ReactCurrentDispatcher,m;function T(e,r,o){{if(m===void 0)try{throw Error()}catch(I){var f=I.stack.trim().match(/\n( *(at )?)/);m=f&&f[1]||""}return` `+m+e}}var x=!1,_;{var G=typeof WeakMap=="function"?WeakMap:Map;_=new G}function n(e,r){if(!e||x)return"";{var o=_.get(e);if(o!==void 0)return o}var f;x=!0;var I=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var $;$=y.current,y.current=null,v();try{if(r){var w=function(){throw Error()};if(Object.defineProperty(w.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(w,[])}catch(X){f=X}Reflect.construct(e,[],w)}else{try{w.call()}catch(X){f=X}e.call(w.prototype)}}else{try{throw Error()}catch(X){f=X}e()}}catch(X){if(X&&f&&typeof X.stack=="string"){for(var R=X.stack.split(` `),B=f.stack.split(` `),W=R.length-1,q=B.length-1;W>=1&&q>=0&&R[W]!==B[q];)q--;for(;W>=1&&q>=0;W--,q--)if(R[W]!==B[q]){if(W!==1||q!==1)do if(W--,q--,q<0||R[W]!==B[q]){var Q=` `+R[W].replace(" at new "," at ");return e.displayName&&Q.includes("<anonymous>")&&(Q=Q.replace("<anonymous>",e.displayName)),typeof e=="function"&&_.set(e,Q),Q}while(W>=1&&q>=0);break}}}finally{x=!1,y.current=$,C(),Error.prepareStackTrace=I}var pe=e?e.displayName||e.name:"",se=pe?T(pe):"";return typeof e=="function"&&_.set(e,se),se}function Z(e,r,o){return n(e,!1)}function de(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function ie(e,r,o){if(e==null)return"";if(typeof e=="function")return n(e,de(e));if(typeof e=="string")return T(e);switch(e){case P:return T("Suspense");case c:return T("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case p:return Z(e.render);case g:return ie(e.type,r,o);case D:{var f=e,I=f._payload,$=f._init;try{return ie($(I),r,o)}catch{}}}return""}var Te=Object.prototype.hasOwnProperty,ar={},ir=U.ReactDebugCurrentFrame;function Pe(e){if(e){var r=e._owner,o=ie(e.type,e._source,r?r.type:null);ir.setExtraStackFrame(o)}else ir.setExtraStackFrame(null)}function kr(e,r,o,f,I){{var $=Function.call.bind(Te);for(var w in e)if($(e,w)){var R=void 0;try{if(typeof e[w]!="function"){var B=Error((f||"React class")+": "+o+" type `"+w+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[w]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw B.name="Invariant Violation",B}R=e[w](r,w,f,o,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(W){R=W}R&&!(R instanceof Error)&&(Pe(I),Y("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",f||"React class",o,w,typeof R),Pe(null)),R instanceof Error&&!(R.message in ar)&&(ar[R.message]=!0,Pe(I),Y("Failed %s type: %s",o,R.message),Pe(null))}}}var Ir=Array.isArray;function Ye(e){return Ir(e)}function Dr(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,o=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return o}}function $r(e){try{return sr(e),!1}catch{return!0}}function sr(e){return""+e}function ur(e){if($r(e))return Y("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Dr(e)),sr(e)}var _e=U.ReactCurrentOwner,Mr={key:!0,ref:!0,__self:!0,__source:!0},cr,fr,We;We={};function Fr(e){if(Te.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function Yr(e){if(Te.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function Wr(e,r){if(typeof e.ref=="string"&&_e.current&&r&&_e.current.stateNode!==r){var o=J(_e.current.type);We[o]||(Y('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://reactjs.org/link/strict-mode-string-ref',J(_e.current.type),e.ref),We[o]=!0)}}function Lr(e,r){{var o=function(){cr||(cr=!0,Y("%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://reactjs.org/link/special-props)",r))};o.isReactWarning=!0,Object.defineProperty(e,"key",{get:o,configurable:!0})}}function qr(e,r){{var o=function(){fr||(fr=!0,Y("%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://reactjs.org/link/special-props)",r))};o.isReactWarning=!0,Object.defineProperty(e,"ref",{get:o,configurable:!0})}}var Ur=function(e,r,o,f,I,$,w){var R={$$typeof:j,type:e,key:r,ref:o,props:w,_owner:$};return R._store={},Object.defineProperty(R._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(R,"_self",{configurable:!1,enumerable:!1,writable:!1,value:f}),Object.defineProperty(R,"_source",{configurable:!1,enumerable:!1,writable:!1,value:I}),Object.freeze&&(Object.freeze(R.props),Object.freeze(R)),R};function zr(e,r,o,f,I){{var $,w={},R=null,B=null;o!==void 0&&(ur(o),R=""+o),Yr(r)&&(ur(r.key),R=""+r.key),Fr(r)&&(B=r.ref,Wr(r,I));for($ in r)Te.call(r,$)&&!Mr.hasOwnProperty($)&&(w[$]=r[$]);if(e&&e.defaultProps){var W=e.defaultProps;for($ in W)w[$]===void 0&&(w[$]=W[$])}if(R||B){var q=typeof e=="function"?e.displayName||e.name||"Unknown":e;R&&Lr(w,q),B&&qr(w,q)}return Ur(e,R,B,I,f,_e.current,w)}}var Le=U.ReactCurrentOwner,lr=U.ReactDebugCurrentFrame;function ve(e){if(e){var r=e._owner,o=ie(e.type,e._source,r?r.type:null);lr.setExtraStackFrame(o)}else lr.setExtraStackFrame(null)}var qe;qe=!1;function Ue(e){return typeof e=="object"&&e!==null&&e.$$typeof===j}function dr(){{if(Le.current){var e=J(Le.current.type);if(e)return` Check the render method of \``+e+"`."}return""}}function Vr(e){return""}var vr={};function Nr(e){{var r=dr();if(!r){var o=typeof e=="string"?e:e.displayName||e.name;o&&(r=` Check the top-level render call using <`+o+">.")}return r}}function pr(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var o=Nr(r);if(vr[o])return;vr[o]=!0;var f="";e&&e._owner&&e._owner!==Le.current&&(f=" It was passed a child from "+J(e._owner.type)+"."),ve(e),Y('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',o,f),ve(null)}}function yr(e,r){{if(typeof e!="object")return;if(Ye(e))for(var o=0;o<e.length;o++){var f=e[o];Ue(f)&&pr(f,r)}else if(Ue(e))e._store&&(e._store.validated=!0);else if(e){var I=V(e);if(typeof I=="function"&&I!==e.entries)for(var $=I.call(e),w;!(w=$.next()).done;)Ue(w.value)&&pr(w.value,r)}}}function Gr(e){{var r=e.type;if(r==null||typeof r=="string")return;var o;if(typeof r=="function")o=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===p||r.$$typeof===g))o=r.propTypes;else return;if(o){var f=J(r);kr(o,e.props,"prop",f,e)}else if(r.PropTypes!==void 0&&!qe){qe=!0;var I=J(r);Y("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",I||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&Y("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Br(e){{for(var r=Object.keys(e.props),o=0;o<r.length;o++){var f=r[o];if(f!=="children"&&f!=="key"){ve(e),Y("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",f),ve(null);break}}e.ref!==null&&(ve(e),Y("Invalid attribute `ref` supplied to `React.Fragment`."),ve(null))}}var mr={};function br(e,r,o,f,I,$){{var w=ge(e);if(!w){var R="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(R+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var B=Vr();B?R+=B:R+=dr();var W;e===null?W="null":Ye(e)?W="array":e!==void 0&&e.$$typeof===j?(W="<"+(J(e.type)||"Unknown")+" />",R=" Did you accidentally export a JSX literal instead of a component?"):W=typeof e,Y("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",W,R)}var q=zr(e,r,o,I,$);if(q==null)return q;if(w){var Q=r.children;if(Q!==void 0)if(f)if(Ye(Q)){for(var pe=0;pe<Q.length;pe++)yr(Q[pe],e);Object.freeze&&Object.freeze(Q)}else Y("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else yr(Q,e)}if(Te.call(r,"key")){var se=J(e),X=Object.keys(r).filter(function(Qr){return Qr!=="key"}),ze=X.length>0?"{key: someKey, "+X.join(": ..., ")+": ...}":"{key: someKey}";if(!mr[se+ze]){var Zr=X.length>0?"{"+X.join(": ..., ")+": ...}":"{}";Y(`A props object containing a "key" prop is being spread into JSX: let props = %s; <%s {...props} /> React keys must be passed directly to JSX without using spread: let props = %s; <%s key={someKey} {...props} />`,ze,se,Zr,se),mr[se+ze]=!0}}return e===u?Br(q):Gr(q),q}}function Jr(e,r,o){return br(e,r,o,!0)}function Kr(e,r,o){return br(e,r,o,!1)}var Xr=Kr,Hr=Jr;me.Fragment=u,me.jsx=Xr,me.jsxs=Hr}()),me}process.env.NODE_ENV==="production"?Ce.exports=Er():Ce.exports=gr();var Re=Ce.exports,we={exports:{}},Se={exports:{}},A={};/** @license React v16.13.1 * react-is.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var Ge;function Tr(){if(Ge)return A;Ge=1;var a=typeof Symbol=="function"&&Symbol.for,j=a?Symbol.for("react.element"):60103,S=a?Symbol.for("react.portal"):60106,u=a?Symbol.for("react.fragment"):60107,E=a?Symbol.for("react.strict_mode"):60108,l=a?Symbol.for("react.profiler"):60114,O=a?Symbol.for("react.provider"):60109,d=a?Symbol.for("react.context"):60110,p=a?Symbol.for("react.async_mode"):60111,P=a?Symbol.for("react.concurrent_mode"):60111,c=a?Symbol.for("react.forward_ref"):60112,g=a?Symbol.for("react.suspense"):60113,D=a?Symbol.for("react.suspense_list"):60120,F=a?Symbol.for("react.memo"):60115,N=a?Symbol.for("react.lazy"):60116,M=a?Symbol.for("react.block"):60121,V=a?Symbol.for("react.fundamental"):60117,U=a?Symbol.for("react.responder"):60118,Y=a?Symbol.for("react.scope"):60119;function z(i){if(typeof i=="object"&&i!==null){var te=i.$$typeof;switch(te){case j:switch(i=i.type,i){case p:case P:case u:case l:case E:case g:return i;default:switch(i=i&&i.$$typeof,i){case d:case c:case N:case F:case O:return i;default:return te}}case S:return te}}}function L(i){return z(i)===P}return A.AsyncMode=p,A.ConcurrentMode=P,A.ContextConsumer=d,A.ContextProvider=O,A.Element=j,A.ForwardRef=c,A.Fragment=u,A.Lazy=N,A.Memo=F,A.Portal=S,A.Profiler=l,A.StrictMode=E,A.Suspense=g,A.isAsyncMode=function(i){return L(i)||z(i)===p},A.isConcurrentMode=L,A.isContextConsumer=function(i){return z(i)===d},A.isContextProvider=function(i){return z(i)===O},A.isElement=function(i){return typeof i=="object"&&i!==null&&i.$$typeof===j},A.isForwardRef=function(i){return z(i)===c},A.isFragment=function(i){return z(i)===u},A.isLazy=function(i){return z(i)===N},A.isMemo=function(i){return z(i)===F},A.isPortal=function(i){return z(i)===S},A.isProfiler=function(i){return z(i)===l},A.isStrictMode=function(i){return z(i)===E},A.isSuspense=function(i){return z(i)===g},A.isValidElementType=function(i){return typeof i=="string"||typeof i=="function"||i===u||i===P||i===l||i===E||i===g||i===D||typeof i=="object"&&i!==null&&(i.$$typeof===N||i.$$typeof===F||i.$$typeof===O||i.$$typeof===d||i.$$typeof===c||i.$$typeof===V||i.$$typeof===U||i.$$typeof===Y||i.$$typeof===M)},A.typeOf=z,A}var k={};/** @license React v16.13.1 * react-is.development.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var Be;function _r(){return Be||(Be=1,process.env.NODE_ENV!=="production"&&function(){var a=typeof Symbol=="function"&&Symbol.for,j=a?Symbol.for("react.element"):60103,S=a?Symbol.for("react.portal"):60106,u=a?Symbol.for("react.fragment"):60107,E=a?Symbol.for("react.strict_mode"):60108,l=a?Symbol.for("react.profiler"):60114,O=a?Symbol.for("react.provider"):60109,d=a?Symbol.for("react.context"):60110,p=a?Symbol.for("react.async_mode"):60111,P=a?Symbol.for("react.concurrent_mode"):60111,c=a?Symbol.for("react.forward_ref"):60112,g=a?Symbol.for("react.suspense"):60113,D=a?Symbol.for("react.suspense_list"):60120,F=a?Symbol.for("react.memo"):60115,N=a?Symbol.for("react.lazy"):60116,M=a?Symbol.for("react.block"):60121,V=a?Symbol.for("react.fundamental"):60117,U=a?Symbol.for("react.responder"):60118,Y=a?Symbol.for("react.scope"):60119;function z(n){return typeof n=="string"||typeof n=="function"||n===u||n===P||n===l||n===E||n===g||n===D||typeof n=="object"&&n!==null&&(n.$$typeof===N||n.$$typeof===F||n.$$typeof===O||n.$$typeof===d||n.$$typeof===c||n.$$typeof===V||n.$$typeof===U||n.$$typeof===Y||n.$$typeof===M)}function L(n){if(typeof n=="object"&&n!==null){var Z=n.$$typeof;switch(Z){case j:var de=n.type;switch(de){case p:case P:case u:case l:case E:case g:return de;default:var ie=de&&de.$$typeof;switch(ie){case d:case c:case N:case F:case O:return ie;default:return Z}}case S:return Z}}}var i=p,te=P,he=d,Ee=O,ue=j,ge=c,ce=u,fe=N,J=F,K=S,ne=l,H=E,ee=g,ae=!1;function le(n){return ae||(ae=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),t(n)||L(n)===p}function t(n){return L(n)===P}function s(n){return L(n)===d}function h(n){return L(n)===O}function b(n){return typeof n=="object"&&n!==null&&n.$$typeof===j}function v(n){return L(n)===c}function C(n){return L(n)===u}function y(n){return L(n)===N}function m(n){return L(n)===F}function T(n){return L(n)===S}function x(n){return L(n)===l}function _(n){return L(n)===E}function G(n){return L(n)===g}k.AsyncMode=i,k.ConcurrentMode=te,k.ContextConsumer=he,k.ContextProvider=Ee,k.Element=ue,k.ForwardRef=ge,k.Fragment=ce,k.Lazy=fe,k.Memo=J,k.Portal=K,k.Profiler=ne,k.StrictMode=H,k.Suspense=ee,k.isAsyncMode=le,k.isConcurrentMode=t,k.isContextConsumer=s,k.isContextProvider=h,k.isElement=b,k.isForwardRef=v,k.isFragment=C,k.isLazy=y,k.isMemo=m,k.isPortal=T,k.isProfiler=x,k.isStrictMode=_,k.isSuspense=G,k.isValidElementType=z,k.typeOf=L}()),k}var Je;function Ke(){return Je||(Je=1,process.env.NODE_ENV==="production"?Se.exports=Tr():Se.exports=_r()),Se.exports}/* object-assign (c) Sindre Sorhus @license MIT */var xe,Xe;function Rr(){if(Xe)return xe;Xe=1;var a=Object.getOwnPropertySymbols,j=Object.prototype.hasOwnProperty,S=Object.prototype.propertyIsEnumerable;function u(l){if(l==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(l)}function E(){try{if(!Object.assign)return!1;var l=new String("abc");if(l[5]="de",Object.getOwnPropertyNames(l)[0]==="5")return!1;for(var O={},d=0;d<10;d++)O["_"+String.fromCharCode(d)]=d;var p=Object.getOwnPropertyNames(O).map(function(c){return O[c]});if(p.join("")!=="0123456789")return!1;var P={};return"abcdefghijklmnopqrst".split("").forEach(function(c){P[c]=c}),Object.keys(Object.assign({},P)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return xe=E()?Object.assign:function(l,O){for(var d,p=u(l),P,c=1;c<arguments.length;c++){d=Object(arguments[c]);for(var g in d)j.call(d,g)&&(p[g]=d[g]);if(a){P=a(d);for(var D=0;D<P.length;D++)S.call(d,P[D])&&(p[P[D]]=d[P[D]])}}return p},xe}var je,He;function Ae(){if(He)return je;He=1;var a="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return je=a,je}var ke,Ze;function Qe(){return Ze||(Ze=1,ke=Function.call.bind(Object.prototype.hasOwnProperty)),ke}var Ie,er;function Sr(){if(er)return Ie;er=1;var a=function(){};if(process.env.NODE_ENV!=="production"){var j=Ae(),S={},u=Qe();a=function(l){var O="Warning: "+l;typeof console<"u"&&console.error(O);try{throw new Error(O)}catch{}}}function E(l,O,d,p,P){if(process.env.NODE_ENV!=="production"){for(var c in l)if(u(l,c)){var g;try{if(typeof l[c]!="function"){var D=Error((p||"React class")+": "+d+" type `"+c+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof l[c]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw D.name="Invariant Violation",D}g=l[c](O,c,p,d,null,j)}catch(N){g=N}if(g&&!(g instanceof Error)&&a((p||"React class")+": type specification of "+d+" `"+c+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof g+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),g instanceof Error&&!(g.message in S)){S[g.message]=!0;var F=P?P():"";a("Failed "+d+" type: "+g.message+(F??""))}}}}return E.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(S={})},Ie=E,Ie}var De,rr;function Or(){if(rr)return De;rr=1;var a=Ke(),j=Rr(),S=Ae(),u=Qe(),E=Sr(),l=function(){};process.env.NODE_ENV!=="production"&&(l=function(d){var p="Warning: "+d;typeof console<"u"&&console.error(p);try{throw new Error(p)}catch{}});function O(){return null}return De=function(d,p){var P=typeof Symbol=="function"&&Symbol.iterator,c="@@iterator";function g(t){var s=t&&(P&&t[P]||t[c]);if(typeof s=="function")return s}var D="<<anonymous>>",F={array:U("array"),bigint:U("bigint"),bool:U("boolean"),func:U("function"),number:U("number"),object:U("object"),string:U("string"),symbol:U("symbol"),any:Y(),arrayOf:z,element:L(),elementType:i(),instanceOf:te,node:ge(),objectOf:Ee,oneOf:he,oneOfType:ue,shape:fe,exact:J};function N(t,s){return t===s?t!==0||1/t===1/s:t!==t&&s!==s}function M(t,s){this.message=t,this.data=s&&typeof s=="object"?s:{},this.stack=""}M.prototype=Error.prototype;function V(t){if(process.env.NODE_ENV!=="production")var s={},h=0;function b(C,y,m,T,x,_,G){if(T=T||D,_=_||m,G!==S){if(p){var n=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw n.name="Invariant Violation",n}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var Z=T+":"+m;!s[Z]&&h<3&&(l("You are manually calling a React.PropTypes validation function for the `"+_+"` prop on `"+T+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),s[Z]=!0,h++)}}return y[m]==null?C?y[m]===null?new M("The "+x+" `"+_+"` is marked as required "+("in `"+T+"`, but its value is `null`.")):new M("The "+x+" `"+_+"` is marked as required in "+("`"+T+"`, but its value is `undefined`.")):null:t(y,m,T,x,_)}var v=b.bind(null,!1);return v.isRequired=b.bind(null,!0),v}function U(t){function s(h,b,v,C,y,m){var T=h[b],x=H(T);if(x!==t){var _=ee(T);return new M("Invalid "+C+" `"+y+"` of type "+("`"+_+"` supplied to `"+v+"`, expected ")+("`"+t+"`."),{expectedType:t})}return null}return V(s)}function Y(){return V(O)}function z(t){function s(h,b,v,C,y){if(typeof t!="function")return new M("Property `"+y+"` of component `"+v+"` has invalid PropType notation inside arrayOf.");var m=h[b];if(!Array.isArray(m)){var T=H(m);return new M("Invalid "+C+" `"+y+"` of type "+("`"+T+"` supplied to `"+v+"`, expected an array."))}for(var x=0;x<m.length;x++){var _=t(m,x,v,C,y+"["+x+"]",S);if(_ instanceof Error)return _}return null}return V(s)}function L(){function t(s,h,b,v,C){var y=s[h];if(!d(y)){var m=H(y);return new M("Invalid "+v+" `"+C+"` of type "+("`"+m+"` supplied to `"+b+"`, expected a single ReactElement."))}return null}return V(t)}function i(){function t(s,h,b,v,C){var y=s[h];if(!a.isValidElementType(y)){var m=H(y);return new M("Invalid "+v+" `"+C+"` of type "+("`"+m+"` supplied to `"+b+"`, expected a single ReactElement type."))}return null}return V(t)}function te(t){function s(h,b,v,C,y){if(!(h[b]instanceof t)){var m=t.name||D,T=le(h[b]);return new M("Invalid "+C+" `"+y+"` of type "+("`"+T+"` supplied to `"+v+"`, expected ")+("instance of `"+m+"`."))}return null}return V(s)}function he(t){if(!Array.isArray(t))return process.env.NODE_ENV!=="production"&&(arguments.length>1?l("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):l("Invalid argument supplied to oneOf, expected an array.")),O;function s(h,b,v,C,y){for(var m=h[b],T=0;T<t.length;T++)if(N(m,t[T]))return null;var x=JSON.stringify(t,function(G,n){var Z=ee(n);return Z==="symbol"?String(n):n});return new M("Invalid "+C+" `"+y+"` of value `"+String(m)+"` "+("supplied to `"+v+"`, expected one of "+x+"."))}return V(s)}function Ee(t){function s(h,b,v,C,y){if(typeof t!="function")return new M("Property `"+y+"` of component `"+v+"` has invalid PropType notation inside objectOf.");var m=h[b],T=H(m);if(T!=="object")return new M("Invalid "+C+" `"+y+"` of type "+("`"+T+"` supplied to `"+v+"`, expected an object."));for(var x in m)if(u(m,x)){var _=t(m,x,v,C,y+"."+x,S);if(_ instanceof Error)return _}return null}return V(s)}function ue(t){if(!Array.isArray(t))return process.env.NODE_ENV!=="production"&&l("Invalid argument supplied to oneOfType, expected an instance of array."),O;for(var s=0;s<t.length;s++){var h=t[s];if(typeof h!="function")return l("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+ae(h)+" at index "+s+"."),O}function b(v,C,y,m,T){for(var x=[],_=0;_<t.length;_++){var G=t[_],n=G(v,C,y,m,T,S);if(n==null)return null;n.data&&u(n.data,"expectedType")&&x.push(n.data.expectedType)}var Z=x.length>0?", expected one of type ["+x.join(", ")+"]":"";return new M("Invalid "+m+" `"+T+"` supplied to "+("`"+y+"`"+Z+"."))}return V(b)}function ge(){function t(s,h,b,v,C){return K(s[h])?null:new M("Invalid "+v+" `"+C+"` supplied to "+("`"+b+"`, expected a ReactNode."))}return V(t)}function ce(t,s,h,b,v){return new M((t||"React class")+": "+s+" type `"+h+"."+b+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+v+"`.")}function fe(t){function s(h,b,v,C,y){var m=h[b],T=H(m);if(T!=="object")return new M("Invalid "+C+" `"+y+"` of type `"+T+"` "+("supplied to `"+v+"`, expected `object`."));for(var x in t){var _=t[x];if(typeof _!="function")return ce(v,C,y,x,ee(_));var G=_(m,x,v,C,y+"."+x,S);if(G)return G}return null}return V(s)}function J(t){function s(h,b,v,C,y){var m=h[b],T=H(m);if(T!=="object")return new M("Invalid "+C+" `"+y+"` of type `"+T+"` "+("supplied to `"+v+"`, expected `object`."));var x=j({},h[b],t);for(var _ in x){var G=t[_];if(u(t,_)&&typeof G!="function")return ce(v,C,y,_,ee(G));if(!G)return new M("Invalid "+C+" `"+y+"` key `"+_+"` supplied to `"+v+"`.\nBad object: "+JSON.stringify(h[b],null," ")+` Valid keys: `+JSON.stringify(Object.keys(t),null," "));var n=G(m,_,v,C,y+"."+_,S);if(n)return n}return null}return V(s)}function K(t){switch(typeof t){case"number":case"string":case"undefined":return!0;case"boolean":return!t;case"object":if(Array.isArray(t))return t.every(K);if(t===null||d(t))return!0;var s=g(t);if(s){var h=s.call(t),b;if(s!==t.entries){for(;!(b=h.next()).done;)if(!K(b.value))return!1}else for(;!(b=h.next()).done;){var v=b.value;if(v&&!K(v[1]))return!1}}else return!1;return!0;default:return!1}}function ne(t,s){return t==="symbol"?!0:s?s["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&s instanceof Symbol:!1}function H(t){var s=typeof t;return Array.isArray(t)?"array":t instanceof RegExp?"object":ne(s,t)?"symbol":s}function ee(t){if(typeof t>"u"||t===null)return""+t;var s=H(t);if(s==="object"){if(t instanceof Date)return"date";if(t instanceof RegExp)return"regexp"}return s}function ae(t){var s=ee(t);switch(s){case"array":case"object":return"an "+s;case"boolean":case"date":case"regexp":return"a "+s;default:return s}}function le(t){return!t.constructor||!t.constructor.name?D:t.constructor.name}return F.checkPropTypes=E,F.resetWarningCache=E.resetWarningCache,F.PropTypes=F,F},De}var $e,tr;function Pr(){if(tr)return $e;tr=1;var a=Ae();function j(){}function S(){}return S.resetWarningCache=j,$e=function(){function u(O,d,p,P,c,g){if(g!==a){var D=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw D.name="Invariant Violation",D}}u.isRequired=u;function E(){return u}var l={array:u,bigint:u,bool:u,func:u,number:u,object:u,string:u,symbol:u,any:u,arrayOf:E,element:u,elementType:u,instanceOf:E,node:u,objectOf:E,oneOf:E,oneOfType:E,shape:E,exact:E,checkPropTypes:S,resetWarningCache:j};return l.PropTypes=l,l},$e}if(process.env.NODE_ENV!=="production"){var Cr=Ke(),wr=!0;we.exports=Or()(Cr.isElement,wr)}else we.exports=Pr()();var xr=we.exports;const be=hr(xr);let Oe=null,nr=!1,Me=!1,Fe=null;const jr=a=>new Promise((j,S)=>{if(document.querySelector(`script[src="${a}"]`)){j();return}const u=document.createElement("script");u.src=a,u.async=!0,u.onload=j,u.onerror=S,document.body.appendChild(u)}),Ar=async(a,j,S,u="in")=>nr?(Oe.register(a,{userId:j,userToken:S},{}),Oe):(Me||(Me=!0,Fe=(async()=>{try{if(await jr(u==="us"?"https://assets-us.customerglu.com/scripts/sdk/v6.0/sdk.js":u==="me"?"https://assets-me.customerglu.com/scripts/sdk/v0.0.1/sdk.js":"https://assets.customerglu.com/scripts/sdk/v5.5/sdk.js"),!window.CustomerGlu)throw new Error("CustomerGlu failed to load");return Oe=new window.CustomerGlu(a,{userId:j,userToken:S},{}),nr=!0,Oe}catch(E){throw console.error("Error initializing CustomerGlu:",E),E}finally{Me=!1}})()),Fe),or=({userId:a="",gluToken:j,children:S,region:u="in",writeKey:E=""})=>{const[l,O]=re.useState(!0),[d,p]=re.useState(null);return re.useEffect(()=>{(async()=>{try{console.log("initializeCustomerGlu React Component"),await Ar(E,a,j,u),O(!1)}catch(c){p(c),O(!1)}})()},[a,j,u,E]),d?Re.jsx(Re.Fragment,{}):l?Re.jsx(Re.Fragment,{}):S};or.propTypes={userId:be.string,gluToken:be.string.isRequired,children:be.node,region:be.oneOf(["in","us","me"]),writeKey:be.string},oe.CustomerGluComponent=or,Object.defineProperty(oe,Symbol.toStringTag,{value:"Module"})});