Socket
Socket
Sign inDemoInstall

@candulabs/core

Package Overview
Dependencies
Maintainers
5
Versions
156
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@candulabs/core - npm Package Compare versions

Comparing version 0.6.0-alpha.4 to 0.6.0-alpha.5

8

CHANGELOG.md

@@ -6,2 +6,10 @@ # Change Log

# [0.6.0-alpha.5](https://github.com/candulabs/candu-sdk/tree/master/packages/candu-core/compare/v0.6.0-alpha.4...v0.6.0-alpha.5) (2020-10-26)
**Note:** Version bump only for package @candulabs/core
# [0.6.0-alpha.4](https://github.com/candulabs/candu-sdk/tree/master/packages/candu-core/compare/v0.5.6...v0.6.0-alpha.4) (2020-10-26)

@@ -8,0 +16,0 @@

2

dist/index.cjs.js

@@ -16,3 +16,3 @@ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});

***************************************************************************** */
var __assign=function(){return(__assign=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)};function __rest(e,t){var r={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(r[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(a=Object.getOwnPropertySymbols(e);n<a.length;n++)t.indexOf(a[n])<0&&Object.prototype.propertyIsEnumerable.call(e,a[n])&&(r[a[n]]=e[a[n]])}return r}function __awaiter(e,t,r,a){return new(r||(r=Promise))((function(n,o){function i(e){try{c(a.next(e))}catch(e){o(e)}}function s(e){try{c(a.throw(e))}catch(e){o(e)}}function c(e){e.done?n(e.value):new r((function(t){t(e.value)})).then(i,s)}c((a=a.apply(e,t||[])).next())}))}function __generator(e,t){var r,a,n,o,i={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;i;)try{if(r=1,a&&(n=2&o[0]?a.return:o[0]?a.throw||((n=a.return)&&n.call(a),0):a.next)&&!(n=n.call(a,o[1])).done)return n;switch(a=0,n&&(o=[2&o[0],n.value]),o[0]){case 0:case 1:n=o;break;case 4:return i.label++,{value:o[1],done:!1};case 5:i.label++,a=o[1],o=[0];continue;case 7:o=i.ops.pop(),i.trys.pop();continue;default:if(!(n=(n=i.trys).length>0&&n[n.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!n||o[1]>n[0]&&o[1]<n[3])){i.label=o[1];break}if(6===o[0]&&i.label<n[1]){i.label=n[1],n=o;break}if(n&&i.label<n[2]){i.label=n[2],i.ops.push(o);break}n[2]&&i.ops.pop(),i.trys.pop();continue}o=t.call(e,i)}catch(e){o=[6,e],a=0}finally{r=n=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}function __spreadArrays(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var a=Array(e),n=0;for(t=0;t<r;t++)for(var o=arguments[t],i=0,s=o.length;i<s;i++,n++)a[n]=o[i];return a}var commonjsGlobal="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function createCommonjsModule(e,t){return e(t={exports:{}},t.exports),t.exports}var freeGlobal="object"==typeof commonjsGlobal&&commonjsGlobal&&commonjsGlobal.Object===Object&&commonjsGlobal,_freeGlobal=freeGlobal,freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=_freeGlobal||freeSelf||Function("return this")(),_root=root,Symbol$1=_root.Symbol,_Symbol=Symbol$1,objectProto=Object.prototype,hasOwnProperty=objectProto.hasOwnProperty,nativeObjectToString=objectProto.toString,symToStringTag=_Symbol?_Symbol.toStringTag:void 0;function getRawTag(e){var t=hasOwnProperty.call(e,symToStringTag),r=e[symToStringTag];try{e[symToStringTag]=void 0;var a=!0}catch(e){}var n=nativeObjectToString.call(e);return a&&(t?e[symToStringTag]=r:delete e[symToStringTag]),n}var _getRawTag=getRawTag,objectProto$1=Object.prototype,nativeObjectToString$1=objectProto$1.toString;function objectToString(e){return nativeObjectToString$1.call(e)}var _objectToString=objectToString,nullTag="[object Null]",undefinedTag="[object Undefined]",symToStringTag$1=_Symbol?_Symbol.toStringTag:void 0;function baseGetTag(e){return null==e?void 0===e?undefinedTag:nullTag:symToStringTag$1&&symToStringTag$1 in Object(e)?_getRawTag(e):_objectToString(e)}var _baseGetTag=baseGetTag;function isObject(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}var isObject_1=isObject,asyncTag="[object AsyncFunction]",funcTag="[object Function]",genTag="[object GeneratorFunction]",proxyTag="[object Proxy]";function isFunction(e){if(!isObject_1(e))return!1;var t=_baseGetTag(e);return t==funcTag||t==genTag||t==asyncTag||t==proxyTag}var isFunction_1=isFunction,coreJsData=_root["__core-js_shared__"],_coreJsData=coreJsData,maskSrcKey=function(){var e=/[^.]+$/.exec(_coreJsData&&_coreJsData.keys&&_coreJsData.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function isMasked(e){return!!maskSrcKey&&maskSrcKey in e}var _isMasked=isMasked,funcProto=Function.prototype,funcToString=funcProto.toString;function toSource(e){if(null!=e){try{return funcToString.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var _toSource=toSource,reRegExpChar=/[\\^$.*+?()[\]{}|]/g,reIsHostCtor=/^\[object .+?Constructor\]$/,funcProto$1=Function.prototype,objectProto$2=Object.prototype,funcToString$1=funcProto$1.toString,hasOwnProperty$1=objectProto$2.hasOwnProperty,reIsNative=RegExp("^"+funcToString$1.call(hasOwnProperty$1).replace(reRegExpChar,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function baseIsNative(e){return!(!isObject_1(e)||_isMasked(e))&&(isFunction_1(e)?reIsNative:reIsHostCtor).test(_toSource(e))}var _baseIsNative=baseIsNative;function getValue(e,t){return null==e?void 0:e[t]}var _getValue=getValue;function getNative(e,t){var r=_getValue(e,t);return _baseIsNative(r)?r:void 0}var _getNative=getNative,defineProperty=function(){try{var e=_getNative(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),_defineProperty=defineProperty;function baseAssignValue(e,t,r){"__proto__"==t&&_defineProperty?_defineProperty(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}var _baseAssignValue=baseAssignValue;function createBaseFor(e){return function(t,r,a){for(var n=-1,o=Object(t),i=a(t),s=i.length;s--;){var c=i[e?s:++n];if(!1===r(o[c],c,o))break}return t}}var _createBaseFor=createBaseFor,baseFor=_createBaseFor(),_baseFor=baseFor;function baseTimes(e,t){for(var r=-1,a=Array(e);++r<e;)a[r]=t(r);return a}var _baseTimes=baseTimes;function isObjectLike(e){return null!=e&&"object"==typeof e}var isObjectLike_1=isObjectLike,argsTag="[object Arguments]";function baseIsArguments(e){return isObjectLike_1(e)&&_baseGetTag(e)==argsTag}var _baseIsArguments=baseIsArguments,objectProto$3=Object.prototype,hasOwnProperty$2=objectProto$3.hasOwnProperty,propertyIsEnumerable=objectProto$3.propertyIsEnumerable,isArguments=_baseIsArguments(function(){return arguments}())?_baseIsArguments:function(e){return isObjectLike_1(e)&&hasOwnProperty$2.call(e,"callee")&&!propertyIsEnumerable.call(e,"callee")},isArguments_1=isArguments,isArray=Array.isArray,isArray_1=isArray;function stubFalse(){return!1}var stubFalse_1=stubFalse,isBuffer_1=createCommonjsModule((function(e,t){var r=t&&!t.nodeType&&t,a=r&&e&&!e.nodeType&&e,n=a&&a.exports===r?_root.Buffer:void 0,o=(n?n.isBuffer:void 0)||stubFalse_1;e.exports=o})),MAX_SAFE_INTEGER=9007199254740991,reIsUint=/^(?:0|[1-9]\d*)$/;function isIndex(e,t){var r=typeof e;return!!(t=null==t?MAX_SAFE_INTEGER:t)&&("number"==r||"symbol"!=r&&reIsUint.test(e))&&e>-1&&e%1==0&&e<t}var _isIndex=isIndex,MAX_SAFE_INTEGER$1=9007199254740991;function isLength(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=MAX_SAFE_INTEGER$1}var isLength_1=isLength,argsTag$1="[object Arguments]",arrayTag="[object Array]",boolTag="[object Boolean]",dateTag="[object Date]",errorTag="[object Error]",funcTag$1="[object Function]",mapTag="[object Map]",numberTag="[object Number]",objectTag="[object Object]",regexpTag="[object RegExp]",setTag="[object Set]",stringTag="[object String]",weakMapTag="[object WeakMap]",arrayBufferTag="[object ArrayBuffer]",dataViewTag="[object DataView]",float32Tag="[object Float32Array]",float64Tag="[object Float64Array]",int8Tag="[object Int8Array]",int16Tag="[object Int16Array]",int32Tag="[object Int32Array]",uint8Tag="[object Uint8Array]",uint8ClampedTag="[object Uint8ClampedArray]",uint16Tag="[object Uint16Array]",uint32Tag="[object Uint32Array]",typedArrayTags={};function baseIsTypedArray(e){return isObjectLike_1(e)&&isLength_1(e.length)&&!!typedArrayTags[_baseGetTag(e)]}typedArrayTags[float32Tag]=typedArrayTags[float64Tag]=typedArrayTags[int8Tag]=typedArrayTags[int16Tag]=typedArrayTags[int32Tag]=typedArrayTags[uint8Tag]=typedArrayTags[uint8ClampedTag]=typedArrayTags[uint16Tag]=typedArrayTags[uint32Tag]=!0,typedArrayTags[argsTag$1]=typedArrayTags[arrayTag]=typedArrayTags[arrayBufferTag]=typedArrayTags[boolTag]=typedArrayTags[dataViewTag]=typedArrayTags[dateTag]=typedArrayTags[errorTag]=typedArrayTags[funcTag$1]=typedArrayTags[mapTag]=typedArrayTags[numberTag]=typedArrayTags[objectTag]=typedArrayTags[regexpTag]=typedArrayTags[setTag]=typedArrayTags[stringTag]=typedArrayTags[weakMapTag]=!1;var _baseIsTypedArray=baseIsTypedArray;function baseUnary(e){return function(t){return e(t)}}var _baseUnary=baseUnary,_nodeUtil=createCommonjsModule((function(e,t){var r=t&&!t.nodeType&&t,a=r&&e&&!e.nodeType&&e,n=a&&a.exports===r&&_freeGlobal.process,o=function(){try{var e=a&&a.require&&a.require("util").types;return e||n&&n.binding&&n.binding("util")}catch(e){}}();e.exports=o})),nodeIsTypedArray=_nodeUtil&&_nodeUtil.isTypedArray,isTypedArray=nodeIsTypedArray?_baseUnary(nodeIsTypedArray):_baseIsTypedArray,isTypedArray_1=isTypedArray,objectProto$4=Object.prototype,hasOwnProperty$3=objectProto$4.hasOwnProperty;function arrayLikeKeys(e,t){var r=isArray_1(e),a=!r&&isArguments_1(e),n=!r&&!a&&isBuffer_1(e),o=!r&&!a&&!n&&isTypedArray_1(e),i=r||a||n||o,s=i?_baseTimes(e.length,String):[],c=s.length;for(var u in e)!t&&!hasOwnProperty$3.call(e,u)||i&&("length"==u||n&&("offset"==u||"parent"==u)||o&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||_isIndex(u,c))||s.push(u);return s}var _arrayLikeKeys=arrayLikeKeys,objectProto$5=Object.prototype;function isPrototype(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||objectProto$5)}var _isPrototype=isPrototype;function overArg(e,t){return function(r){return e(t(r))}}var _overArg=overArg,nativeKeys=_overArg(Object.keys,Object),_nativeKeys=nativeKeys,objectProto$6=Object.prototype,hasOwnProperty$4=objectProto$6.hasOwnProperty;function baseKeys(e){if(!_isPrototype(e))return _nativeKeys(e);var t=[];for(var r in Object(e))hasOwnProperty$4.call(e,r)&&"constructor"!=r&&t.push(r);return t}var _baseKeys=baseKeys;function isArrayLike(e){return null!=e&&isLength_1(e.length)&&!isFunction_1(e)}var isArrayLike_1=isArrayLike;function keys(e){return isArrayLike_1(e)?_arrayLikeKeys(e):_baseKeys(e)}var keys_1=keys;function baseForOwn(e,t){return e&&_baseFor(e,t,keys_1)}var _baseForOwn=baseForOwn;function listCacheClear(){this.__data__=[],this.size=0}var _listCacheClear=listCacheClear;function eq(e,t){return e===t||e!=e&&t!=t}var eq_1=eq;function assocIndexOf(e,t){for(var r=e.length;r--;)if(eq_1(e[r][0],t))return r;return-1}var _assocIndexOf=assocIndexOf,arrayProto=Array.prototype,splice=arrayProto.splice;function listCacheDelete(e){var t=this.__data__,r=_assocIndexOf(t,e);return!(r<0)&&(r==t.length-1?t.pop():splice.call(t,r,1),--this.size,!0)}var _listCacheDelete=listCacheDelete;function listCacheGet(e){var t=this.__data__,r=_assocIndexOf(t,e);return r<0?void 0:t[r][1]}var _listCacheGet=listCacheGet;function listCacheHas(e){return _assocIndexOf(this.__data__,e)>-1}var _listCacheHas=listCacheHas;function listCacheSet(e,t){var r=this.__data__,a=_assocIndexOf(r,e);return a<0?(++this.size,r.push([e,t])):r[a][1]=t,this}var _listCacheSet=listCacheSet;function ListCache(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var a=e[t];this.set(a[0],a[1])}}ListCache.prototype.clear=_listCacheClear,ListCache.prototype.delete=_listCacheDelete,ListCache.prototype.get=_listCacheGet,ListCache.prototype.has=_listCacheHas,ListCache.prototype.set=_listCacheSet;var _ListCache=ListCache;function stackClear(){this.__data__=new _ListCache,this.size=0}var _stackClear=stackClear;function stackDelete(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}var _stackDelete=stackDelete;function stackGet(e){return this.__data__.get(e)}var _stackGet=stackGet;function stackHas(e){return this.__data__.has(e)}var _stackHas=stackHas,Map=_getNative(_root,"Map"),_Map=Map,nativeCreate=_getNative(Object,"create"),_nativeCreate=nativeCreate;function hashClear(){this.__data__=_nativeCreate?_nativeCreate(null):{},this.size=0}var _hashClear=hashClear;function hashDelete(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var _hashDelete=hashDelete,HASH_UNDEFINED="__lodash_hash_undefined__",objectProto$7=Object.prototype,hasOwnProperty$5=objectProto$7.hasOwnProperty;function hashGet(e){var t=this.__data__;if(_nativeCreate){var r=t[e];return r===HASH_UNDEFINED?void 0:r}return hasOwnProperty$5.call(t,e)?t[e]:void 0}var _hashGet=hashGet,objectProto$8=Object.prototype,hasOwnProperty$6=objectProto$8.hasOwnProperty;function hashHas(e){var t=this.__data__;return _nativeCreate?void 0!==t[e]:hasOwnProperty$6.call(t,e)}var _hashHas=hashHas,HASH_UNDEFINED$1="__lodash_hash_undefined__";function hashSet(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=_nativeCreate&&void 0===t?HASH_UNDEFINED$1:t,this}var _hashSet=hashSet;function Hash(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var a=e[t];this.set(a[0],a[1])}}Hash.prototype.clear=_hashClear,Hash.prototype.delete=_hashDelete,Hash.prototype.get=_hashGet,Hash.prototype.has=_hashHas,Hash.prototype.set=_hashSet;var _Hash=Hash;function mapCacheClear(){this.size=0,this.__data__={hash:new _Hash,map:new(_Map||_ListCache),string:new _Hash}}var _mapCacheClear=mapCacheClear;function isKeyable(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}var _isKeyable=isKeyable;function getMapData(e,t){var r=e.__data__;return _isKeyable(t)?r["string"==typeof t?"string":"hash"]:r.map}var _getMapData=getMapData;function mapCacheDelete(e){var t=_getMapData(this,e).delete(e);return this.size-=t?1:0,t}var _mapCacheDelete=mapCacheDelete;function mapCacheGet(e){return _getMapData(this,e).get(e)}var _mapCacheGet=mapCacheGet;function mapCacheHas(e){return _getMapData(this,e).has(e)}var _mapCacheHas=mapCacheHas;function mapCacheSet(e,t){var r=_getMapData(this,e),a=r.size;return r.set(e,t),this.size+=r.size==a?0:1,this}var _mapCacheSet=mapCacheSet;function MapCache(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var a=e[t];this.set(a[0],a[1])}}MapCache.prototype.clear=_mapCacheClear,MapCache.prototype.delete=_mapCacheDelete,MapCache.prototype.get=_mapCacheGet,MapCache.prototype.has=_mapCacheHas,MapCache.prototype.set=_mapCacheSet;var _MapCache=MapCache,LARGE_ARRAY_SIZE=200;function stackSet(e,t){var r=this.__data__;if(r instanceof _ListCache){var a=r.__data__;if(!_Map||a.length<LARGE_ARRAY_SIZE-1)return a.push([e,t]),this.size=++r.size,this;r=this.__data__=new _MapCache(a)}return r.set(e,t),this.size=r.size,this}var _stackSet=stackSet;function Stack(e){var t=this.__data__=new _ListCache(e);this.size=t.size}Stack.prototype.clear=_stackClear,Stack.prototype.delete=_stackDelete,Stack.prototype.get=_stackGet,Stack.prototype.has=_stackHas,Stack.prototype.set=_stackSet;var _Stack=Stack,HASH_UNDEFINED$2="__lodash_hash_undefined__";function setCacheAdd(e){return this.__data__.set(e,HASH_UNDEFINED$2),this}var _setCacheAdd=setCacheAdd;function setCacheHas(e){return this.__data__.has(e)}var _setCacheHas=setCacheHas;function SetCache(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new _MapCache;++t<r;)this.add(e[t])}SetCache.prototype.add=SetCache.prototype.push=_setCacheAdd,SetCache.prototype.has=_setCacheHas;var _SetCache=SetCache;function arraySome(e,t){for(var r=-1,a=null==e?0:e.length;++r<a;)if(t(e[r],r,e))return!0;return!1}var _arraySome=arraySome;function cacheHas(e,t){return e.has(t)}var _cacheHas=cacheHas,COMPARE_PARTIAL_FLAG=1,COMPARE_UNORDERED_FLAG=2;function equalArrays(e,t,r,a,n,o){var i=r&COMPARE_PARTIAL_FLAG,s=e.length,c=t.length;if(s!=c&&!(i&&c>s))return!1;var u=o.get(e);if(u&&o.get(t))return u==t;var _=-1,l=!0,p=r&COMPARE_UNORDERED_FLAG?new _SetCache:void 0;for(o.set(e,t),o.set(t,e);++_<s;){var d=e[_],f=t[_];if(a)var g=i?a(f,d,_,t,e,o):a(d,f,_,e,t,o);if(void 0!==g){if(g)continue;l=!1;break}if(p){if(!_arraySome(t,(function(e,t){if(!_cacheHas(p,t)&&(d===e||n(d,e,r,a,o)))return p.push(t)}))){l=!1;break}}else if(d!==f&&!n(d,f,r,a,o)){l=!1;break}}return o.delete(e),o.delete(t),l}var _equalArrays=equalArrays,Uint8Array$1=_root.Uint8Array,_Uint8Array=Uint8Array$1;function mapToArray(e){var t=-1,r=Array(e.size);return e.forEach((function(e,a){r[++t]=[a,e]})),r}var _mapToArray=mapToArray;function setToArray(e){var t=-1,r=Array(e.size);return e.forEach((function(e){r[++t]=e})),r}var _setToArray=setToArray,COMPARE_PARTIAL_FLAG$1=1,COMPARE_UNORDERED_FLAG$1=2,boolTag$1="[object Boolean]",dateTag$1="[object Date]",errorTag$1="[object Error]",mapTag$1="[object Map]",numberTag$1="[object Number]",regexpTag$1="[object RegExp]",setTag$1="[object Set]",stringTag$1="[object String]",symbolTag="[object Symbol]",arrayBufferTag$1="[object ArrayBuffer]",dataViewTag$1="[object DataView]",symbolProto=_Symbol?_Symbol.prototype:void 0,symbolValueOf=symbolProto?symbolProto.valueOf:void 0;function equalByTag(e,t,r,a,n,o,i){switch(r){case dataViewTag$1:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case arrayBufferTag$1:return!(e.byteLength!=t.byteLength||!o(new _Uint8Array(e),new _Uint8Array(t)));case boolTag$1:case dateTag$1:case numberTag$1:return eq_1(+e,+t);case errorTag$1:return e.name==t.name&&e.message==t.message;case regexpTag$1:case stringTag$1:return e==t+"";case mapTag$1:var s=_mapToArray;case setTag$1:var c=a&COMPARE_PARTIAL_FLAG$1;if(s||(s=_setToArray),e.size!=t.size&&!c)return!1;var u=i.get(e);if(u)return u==t;a|=COMPARE_UNORDERED_FLAG$1,i.set(e,t);var _=_equalArrays(s(e),s(t),a,n,o,i);return i.delete(e),_;case symbolTag:if(symbolValueOf)return symbolValueOf.call(e)==symbolValueOf.call(t)}return!1}var _equalByTag=equalByTag;function arrayPush(e,t){for(var r=-1,a=t.length,n=e.length;++r<a;)e[n+r]=t[r];return e}var _arrayPush=arrayPush;function baseGetAllKeys(e,t,r){var a=t(e);return isArray_1(e)?a:_arrayPush(a,r(e))}var _baseGetAllKeys=baseGetAllKeys;function arrayFilter(e,t){for(var r=-1,a=null==e?0:e.length,n=0,o=[];++r<a;){var i=e[r];t(i,r,e)&&(o[n++]=i)}return o}var _arrayFilter=arrayFilter;function stubArray(){return[]}var stubArray_1=stubArray,objectProto$9=Object.prototype,propertyIsEnumerable$1=objectProto$9.propertyIsEnumerable,nativeGetSymbols=Object.getOwnPropertySymbols,getSymbols=nativeGetSymbols?function(e){return null==e?[]:(e=Object(e),_arrayFilter(nativeGetSymbols(e),(function(t){return propertyIsEnumerable$1.call(e,t)})))}:stubArray_1,_getSymbols=getSymbols;function getAllKeys(e){return _baseGetAllKeys(e,keys_1,_getSymbols)}var _getAllKeys=getAllKeys,COMPARE_PARTIAL_FLAG$2=1,objectProto$a=Object.prototype,hasOwnProperty$7=objectProto$a.hasOwnProperty;function equalObjects(e,t,r,a,n,o){var i=r&COMPARE_PARTIAL_FLAG$2,s=_getAllKeys(e),c=s.length;if(c!=_getAllKeys(t).length&&!i)return!1;for(var u=c;u--;){var _=s[u];if(!(i?_ in t:hasOwnProperty$7.call(t,_)))return!1}var l=o.get(e);if(l&&o.get(t))return l==t;var p=!0;o.set(e,t),o.set(t,e);for(var d=i;++u<c;){var f=e[_=s[u]],g=t[_];if(a)var y=i?a(g,f,_,t,e,o):a(f,g,_,e,t,o);if(!(void 0===y?f===g||n(f,g,r,a,o):y)){p=!1;break}d||(d="constructor"==_)}if(p&&!d){var h=e.constructor,b=t.constructor;h!=b&&"constructor"in e&&"constructor"in t&&!("function"==typeof h&&h instanceof h&&"function"==typeof b&&b instanceof b)&&(p=!1)}return o.delete(e),o.delete(t),p}var _equalObjects=equalObjects,DataView=_getNative(_root,"DataView"),_DataView=DataView,Promise$1=_getNative(_root,"Promise"),_Promise=Promise$1,Set=_getNative(_root,"Set"),_Set=Set,WeakMap=_getNative(_root,"WeakMap"),_WeakMap=WeakMap,mapTag$2="[object Map]",objectTag$1="[object Object]",promiseTag="[object Promise]",setTag$2="[object Set]",weakMapTag$1="[object WeakMap]",dataViewTag$2="[object DataView]",dataViewCtorString=_toSource(_DataView),mapCtorString=_toSource(_Map),promiseCtorString=_toSource(_Promise),setCtorString=_toSource(_Set),weakMapCtorString=_toSource(_WeakMap),getTag=_baseGetTag;(_DataView&&getTag(new _DataView(new ArrayBuffer(1)))!=dataViewTag$2||_Map&&getTag(new _Map)!=mapTag$2||_Promise&&getTag(_Promise.resolve())!=promiseTag||_Set&&getTag(new _Set)!=setTag$2||_WeakMap&&getTag(new _WeakMap)!=weakMapTag$1)&&(getTag=function(e){var t=_baseGetTag(e),r=t==objectTag$1?e.constructor:void 0,a=r?_toSource(r):"";if(a)switch(a){case dataViewCtorString:return dataViewTag$2;case mapCtorString:return mapTag$2;case promiseCtorString:return promiseTag;case setCtorString:return setTag$2;case weakMapCtorString:return weakMapTag$1}return t});var _getTag=getTag,COMPARE_PARTIAL_FLAG$3=1,argsTag$2="[object Arguments]",arrayTag$1="[object Array]",objectTag$2="[object Object]",objectProto$b=Object.prototype,hasOwnProperty$8=objectProto$b.hasOwnProperty;function baseIsEqualDeep(e,t,r,a,n,o){var i=isArray_1(e),s=isArray_1(t),c=i?arrayTag$1:_getTag(e),u=s?arrayTag$1:_getTag(t),_=(c=c==argsTag$2?objectTag$2:c)==objectTag$2,l=(u=u==argsTag$2?objectTag$2:u)==objectTag$2,p=c==u;if(p&&isBuffer_1(e)){if(!isBuffer_1(t))return!1;i=!0,_=!1}if(p&&!_)return o||(o=new _Stack),i||isTypedArray_1(e)?_equalArrays(e,t,r,a,n,o):_equalByTag(e,t,c,r,a,n,o);if(!(r&COMPARE_PARTIAL_FLAG$3)){var d=_&&hasOwnProperty$8.call(e,"__wrapped__"),f=l&&hasOwnProperty$8.call(t,"__wrapped__");if(d||f){var g=d?e.value():e,y=f?t.value():t;return o||(o=new _Stack),n(g,y,r,a,o)}}return!!p&&(o||(o=new _Stack),_equalObjects(e,t,r,a,n,o))}var _baseIsEqualDeep=baseIsEqualDeep;function baseIsEqual(e,t,r,a,n){return e===t||(null==e||null==t||!isObjectLike_1(e)&&!isObjectLike_1(t)?e!=e&&t!=t:_baseIsEqualDeep(e,t,r,a,baseIsEqual,n))}var _baseIsEqual=baseIsEqual,COMPARE_PARTIAL_FLAG$4=1,COMPARE_UNORDERED_FLAG$2=2;function baseIsMatch(e,t,r,a){var n=r.length,o=n,i=!a;if(null==e)return!o;for(e=Object(e);n--;){var s=r[n];if(i&&s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++n<o;){var c=(s=r[n])[0],u=e[c],_=s[1];if(i&&s[2]){if(void 0===u&&!(c in e))return!1}else{var l=new _Stack;if(a)var p=a(u,_,c,e,t,l);if(!(void 0===p?_baseIsEqual(_,u,COMPARE_PARTIAL_FLAG$4|COMPARE_UNORDERED_FLAG$2,a,l):p))return!1}}return!0}var _baseIsMatch=baseIsMatch;function isStrictComparable(e){return e==e&&!isObject_1(e)}var _isStrictComparable=isStrictComparable;function getMatchData(e){for(var t=keys_1(e),r=t.length;r--;){var a=t[r],n=e[a];t[r]=[a,n,_isStrictComparable(n)]}return t}var _getMatchData=getMatchData;function matchesStrictComparable(e,t){return function(r){return null!=r&&(r[e]===t&&(void 0!==t||e in Object(r)))}}var _matchesStrictComparable=matchesStrictComparable;function baseMatches(e){var t=_getMatchData(e);return 1==t.length&&t[0][2]?_matchesStrictComparable(t[0][0],t[0][1]):function(r){return r===e||_baseIsMatch(r,e,t)}}var _baseMatches=baseMatches,symbolTag$1="[object Symbol]";function isSymbol(e){return"symbol"==typeof e||isObjectLike_1(e)&&_baseGetTag(e)==symbolTag$1}var isSymbol_1=isSymbol,reIsDeepProp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,reIsPlainProp=/^\w*$/;function isKey(e,t){if(isArray_1(e))return!1;var r=typeof e;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!isSymbol_1(e))||(reIsPlainProp.test(e)||!reIsDeepProp.test(e)||null!=t&&e in Object(t))}var _isKey=isKey,FUNC_ERROR_TEXT="Expected a function";function memoize(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError(FUNC_ERROR_TEXT);var r=function(){var a=arguments,n=t?t.apply(this,a):a[0],o=r.cache;if(o.has(n))return o.get(n);var i=e.apply(this,a);return r.cache=o.set(n,i)||o,i};return r.cache=new(memoize.Cache||_MapCache),r}memoize.Cache=_MapCache;var memoize_1=memoize,MAX_MEMOIZE_SIZE=500;function memoizeCapped(e){var t=memoize_1(e,(function(e){return r.size===MAX_MEMOIZE_SIZE&&r.clear(),e})),r=t.cache;return t}var _memoizeCapped=memoizeCapped,rePropName=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,reEscapeChar=/\\(\\)?/g,stringToPath=_memoizeCapped((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(rePropName,(function(e,r,a,n){t.push(a?n.replace(reEscapeChar,"$1"):r||e)})),t})),_stringToPath=stringToPath;function arrayMap(e,t){for(var r=-1,a=null==e?0:e.length,n=Array(a);++r<a;)n[r]=t(e[r],r,e);return n}var _arrayMap=arrayMap,INFINITY=1/0,symbolProto$1=_Symbol?_Symbol.prototype:void 0,symbolToString=symbolProto$1?symbolProto$1.toString:void 0;function baseToString(e){if("string"==typeof e)return e;if(isArray_1(e))return _arrayMap(e,baseToString)+"";if(isSymbol_1(e))return symbolToString?symbolToString.call(e):"";var t=e+"";return"0"==t&&1/e==-INFINITY?"-0":t}var _baseToString=baseToString;function toString(e){return null==e?"":_baseToString(e)}var toString_1=toString;function castPath(e,t){return isArray_1(e)?e:_isKey(e,t)?[e]:_stringToPath(toString_1(e))}var _castPath=castPath,INFINITY$1=1/0;function toKey(e){if("string"==typeof e||isSymbol_1(e))return e;var t=e+"";return"0"==t&&1/e==-INFINITY$1?"-0":t}var _toKey=toKey;function baseGet(e,t){for(var r=0,a=(t=_castPath(t,e)).length;null!=e&&r<a;)e=e[_toKey(t[r++])];return r&&r==a?e:void 0}var _baseGet=baseGet;function get(e,t,r){var a=null==e?void 0:_baseGet(e,t);return void 0===a?r:a}var get_1=get;function baseHasIn(e,t){return null!=e&&t in Object(e)}var _baseHasIn=baseHasIn;function hasPath(e,t,r){for(var a=-1,n=(t=_castPath(t,e)).length,o=!1;++a<n;){var i=_toKey(t[a]);if(!(o=null!=e&&r(e,i)))break;e=e[i]}return o||++a!=n?o:!!(n=null==e?0:e.length)&&isLength_1(n)&&_isIndex(i,n)&&(isArray_1(e)||isArguments_1(e))}var _hasPath=hasPath;function hasIn(e,t){return null!=e&&_hasPath(e,t,_baseHasIn)}var hasIn_1=hasIn,COMPARE_PARTIAL_FLAG$5=1,COMPARE_UNORDERED_FLAG$3=2;function baseMatchesProperty(e,t){return _isKey(e)&&_isStrictComparable(t)?_matchesStrictComparable(_toKey(e),t):function(r){var a=get_1(r,e);return void 0===a&&a===t?hasIn_1(r,e):_baseIsEqual(t,a,COMPARE_PARTIAL_FLAG$5|COMPARE_UNORDERED_FLAG$3)}}var _baseMatchesProperty=baseMatchesProperty;function identity(e){return e}var identity_1=identity;function baseProperty(e){return function(t){return null==t?void 0:t[e]}}var _baseProperty=baseProperty;function basePropertyDeep(e){return function(t){return _baseGet(t,e)}}var _basePropertyDeep=basePropertyDeep;function property(e){return _isKey(e)?_baseProperty(_toKey(e)):_basePropertyDeep(e)}var property_1=property;function baseIteratee(e){return"function"==typeof e?e:null==e?identity_1:"object"==typeof e?isArray_1(e)?_baseMatchesProperty(e[0],e[1]):_baseMatches(e):property_1(e)}var _baseIteratee=baseIteratee;function mapValues(e,t){var r={};return t=_baseIteratee(t),_baseForOwn(e,(function(e,a,n){_baseAssignValue(r,a,t(e,a,n))})),r}var mapValues_1=mapValues,isUnitlessNumber={boxFlex:!0,boxFlexGroup:!0,columnCount:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,strokeDashoffset:!0,strokeOpacity:!0,strokeWidth:!0};function prefixKey(e,t){return e+t.charAt(0).toUpperCase()+t.substring(1)}var prefixes=["Webkit","ms","Moz","O"];Object.keys(isUnitlessNumber).forEach((function(e){prefixes.forEach((function(t){isUnitlessNumber[prefixKey(t,e)]=isUnitlessNumber[e]}))}));var shorthandPropertyExpansions={background:{backgroundImage:!0,backgroundPosition:!0,backgroundRepeat:!0,backgroundColor:!0},border:{borderWidth:!0,borderStyle:!0,borderColor:!0},borderBottom:{borderBottomWidth:!0,borderBottomStyle:!0,borderBottomColor:!0},borderLeft:{borderLeftWidth:!0,borderLeftStyle:!0,borderLeftColor:!0},borderRight:{borderRightWidth:!0,borderRightStyle:!0,borderRightColor:!0},borderTop:{borderTopWidth:!0,borderTopStyle:!0,borderTopColor:!0},font:{fontStyle:!0,fontVariant:!0,fontWeight:!0,fontSize:!0,lineHeight:!0,fontFamily:!0}},CSSProperty={isUnitlessNumber:isUnitlessNumber,shorthandPropertyExpansions:shorthandPropertyExpansions},CSSProperty_1=CSSProperty;function isNumber(e){return"number"==typeof e}var N,L,C,D,w,M,normalizeCss=function(e){var t=e.css,r={};return Object.entries(t).forEach((function(e){var t=e[0],a=e[1];if(isNumber(a))return CSSProperty_1.isUnitlessNumber[t]?void(r[t]=""+a):void(r[t]=a+"px");r[t]=a})),__assign(__assign({},e),{css:__assign(__assign({},r),{boxSizing:"border-box"})})},typographyNode=function(e){var t=get_1(e,"data.custom.variant","P");return __assign(__assign({},e),{type:t})},normalizeFlexBasis=function(e){var t=e.css.flexBasis;return"0"===t||"0px"===t?__assign(__assign({},e),{css:__assign(__assign({},e.css),{flexBasis:"0%"})}):e},adaptCustomNodes=function(e){return mapValues_1(e,(function(e){var t=e;return"Typography"===t.type&&(t=typographyNode(t)),t.css&&isObject_1(t.css)&&t.css.flexBasis&&(t=normalizeFlexBasis(t)),t.css&&(t=normalizeCss(t)),t}))},TutorialDependencies=function(){function e(e){this.adjacencyList={},this.rootDocument=e,this.adjacencyList[e]=[]}return e.prototype.get=function(e){return this.adjacencyList[e]},e.prototype.add=function(e,t){var r=this;if(this.adjacencyList[e]||(this.adjacencyList[e]=[]),!this.adjacencyList[t])return this.adjacencyList[e].push(t),this.adjacencyList[t]=[],!0;if(this.adjacencyList[e].includes(t))return!0;var a=function(t){if(t===e)return!0;for(var n=0,o=r.adjacencyList[t];n<o.length;n++){var i=o[n];if(a(i))return!0}return!1};return!a(t)&&(this.adjacencyList[e].push(t),!0)},e}(),createTutorialDocumentContext=function(e,t){return{id:e,dependencies:t?t.dependencies:new TutorialDependencies(e)}},checkCyclicAndAdd=function(e,t){return e.dependencies.add(e.id,t)},n="Everyone",e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t="object"==typeof e&&e&&e.Object===Object&&e,r="object"==typeof self&&self&&self.Object===Object&&self,o=(t||r||Function("return this")()).Symbol,i=Object.prototype,u=i.hasOwnProperty,a=i.toString,c=o?o.toStringTag:void 0,l=function(e){var t=u.call(e,c),r=e[c];try{e[c]=void 0;var n=!0}catch(e){}var o=a.call(e);return n&&(t?e[c]=r:delete e[c]),o},E=Object.prototype.toString,f=function(e){return E.call(e)},s="[object Null]",d="[object Undefined]",v=o?o.toStringTag:void 0,p=function(e){return null==e?void 0===e?d:s:v&&v in Object(e)?l(e):f(e)},T=Array.isArray,O=function(e){return null!=e&&"object"==typeof e},A="[object String]",g=function(e){return"string"==typeof e||!T(e)&&O(e)&&p(e)==A},m="[object Number]",S=function(e){return"number"==typeof e||O(e)&&p(e)==m},_=/^([a-zA-Z0-9]|_|-)+$/,y=function(e){return g(e)&&e.length>=3&&e.length<100&&_.test(e)},P=function(e){return S(e)&&e>=0},b=function(e){return g(e)&&!!e.match(/^[0-9a-zA-Z]*$/)&&e.length>=10},I=function(e){return P(e)||g(e)&&e.trim().length>0};!function(e){e.SDK="SDK",e.PREVIEW="PREVIEW"}(N||(N={})),function(e){e.BOOTSTRAP="Bootstrap",e.CHANGE_POSITION="ChangePosition",e.CLOSE_PREVIEW="ClosePreview",e.PREVIEW_LOADED="PreviewLoaded",e.SET_AVALIABLE_PORTALS="SetAvaliablePortals",e.SET_CONTENT="SetContent",e.SET_SELECTED_ELEMENT="SetSelectedElement",e.SET_VIEW_MODE="SetViewMode",e.ADD_ELEMENT="AddElement",e.REMOVE_ELEMENT="RemoveElement",e.UPDATE_ELEMENT="UpdateElement",e.SET_ELEMENT="SetElement"}(L||(L={})),(C||(C={})).ON_CLICK="OnClick",function(e){e.NATIVE="Native",e.PENDO="Pendo"}(D||(D={})),function(e){e.NAVIGATE="Navigate",e.CHANGE_TUTORIAL="ChangeTutorial",e.OPEN_GUIDE="OpenGuide"}(w||(w={})),function(e){e.PRIMARY="primary",e.SECONDARY="primary",e.WARNING="warning",e.DANGER="danger",e.NEUTRAL="neutral",e.ACTIVE="active",e.INFO="info"}(M||(M={}));var G,B=M.PRIMARY;!function(e){e.U="U",e.B="B",e.Em="Em",e.InlineCode="InlineCode"}(G||(G={}));var x,F,Q,nn,z=function(e){return g(e)&&!!e.match(/^[0-9a-zA-Z]{40}$/)},H=function(e){return P(e)},K=function(e){return y(e)};!function(e){e.COLLAPSED="Collapsed",e.EXPANDED="Expanded",e.MINIMIZED="Minimized"}(x||(x={})),function(e){e.TUTORIAL="Tutorial",e.PORTAL="Portal"}(F||(F={})),function(e){e.Global="Global",e.Organization="Organization"}(Q||(Q={})),function(e){e.Root="root",e.Rule="rule",e.Atrule="atrule",e.Decl="decl",e.Any="any"}(nn||(nn={}));for(var _a,createLookup=function(e){return e.reduce((function(e,t){var r;return __assign(__assign({},e),((r={})[t]=t,r))}),{})},findMatchingSegment=function(e,t){var r=createLookup(t);return e.content.find((function(e){var t=e.segmentId;return!!r[t]||t===n}))},eventPrefix=function(e){return"candu.sdk."+e},errorPrefix=function(e){return eventPrefix("error."+e)},ERROR_SLUGS={UNKOWN_NODE_TYPE:"unknown_node_type",UNKOWN_BLOCK_NODE_TYPE:"unkown_block_node_type",UNKOWN_INLINE_NODE_TYPE:"unkown_inline_node_type",UNKOWN_NODE_OBJECT_TYPE:"unkown_node_object_type",TUTORIAL_ERROR:"tutorial_error_boundary",PORTAL_ERROR:"portal_error_boundary",PROVIDER_ERROR:"provider_error_boundary",STYLEGUIDE_MAP_ERROR:"styleguide_map",RENDER_NODE_ERROR:"render_node"},EVENT_NAMES={HEARTBEAT:eventPrefix("heartbeat"),PREVIEW_OPEN:eventPrefix("preview.open"),PORTAL:eventPrefix("portal"),TUTORIAL:eventPrefix("tutorial"),TUTORIAL_INTERACTION:eventPrefix("tutorial.interaction"),PORTAL_ASSET_NOT_FOUND:errorPrefix("portal_asset_not_found"),PORTAL_NO_SEGMENT_IDS:errorPrefix("portal_no_segment_ids"),NO_MATCHING_TUTORIALS:errorPrefix("no_matching_tutorials"),NO_VALID_TUTORIAL_IDENTIFIER:errorPrefix("no_valid_tutorial_identifier"),COMMIT_API_LOADING_ERROR:errorPrefix("commit_api"),TUTORIAL_LOADING_ERROR:errorPrefix("tutorial"),UNKOWN_NODE_TYPE:errorPrefix(ERROR_SLUGS.UNKOWN_NODE_TYPE),UNKOWN_INLINE_NODE_TYPE:errorPrefix(ERROR_SLUGS.UNKOWN_INLINE_NODE_TYPE),UNKOWN_NODE_OBJECT_TYPE:errorPrefix(ERROR_SLUGS.UNKOWN_NODE_OBJECT_TYPE),TUTORIAL_ERROR:errorPrefix(ERROR_SLUGS.TUTORIAL_ERROR),PORTAL_ERROR:errorPrefix(ERROR_SLUGS.PORTAL_ERROR),PROVIDER_ERROR:errorPrefix(ERROR_SLUGS.PROVIDER_ERROR),STYLEGUIDE_MAP_ERROR:errorPrefix(ERROR_SLUGS.TUTORIAL_ERROR),RENDER_NODE_ERROR:errorPrefix(ERROR_SLUGS.TUTORIAL_ERROR),CIRCULAR_DEPENDENCY_EMBED_PORTAL:errorPrefix("circular_dependecy_embed_portal"),CIRCULAR_DEPENDENCY_EMBED_TUTORIAL:errorPrefix("circular_dependecy_embed_tutorial")},PORTAL_ASSET_NOT_FOUND="Could not find the requested Portal. This could happen because:\n1. The Portal does not exist or it was deleted.\n2. The Portal has not been made avaliable to be rendered.\n3. CORS Authenticaton failed.\nSee http://udn.ac/portal-not-found for more information.\n",unknownMessage=function(e){return"An error has occured while trying to parse your Tutorial.\nUpgrade the SDK to the latest version to get rid of this error.\nErrorCode: "+e+"."},EVENTING_NOT_INITIALIZED="You tried to send an event, but you haven't initialized eventing.\nThis is happening because you called eventing outside the scope of the CanduProvider. It can be fixed by:\n1. Adding CanduProvider to the root of the application.\n2. Initializing a new Eventing object outside of Candu.\nRead here for more context: http://udn.ac/tracking-not-init.\n",PORTAL_NO_SEGMENT_IDS="You have tried to render a Portal that doesn't contain any content.\nAdd content to your Portal: https://udn.ac/update-portals.\n",NO_MATCHING_TUTORIALS="The Tutorial will not be rendered because there are no matching segments for the given user.",ERROR_MESSAGES=((_a={EVENTING_NOT_INITIALIZED:EVENTING_NOT_INITIALIZED})[EVENT_NAMES.PORTAL_ASSET_NOT_FOUND]=PORTAL_ASSET_NOT_FOUND,_a[EVENT_NAMES.PORTAL_NO_SEGMENT_IDS]=PORTAL_NO_SEGMENT_IDS,_a[EVENT_NAMES.NO_MATCHING_TUTORIALS]=NO_MATCHING_TUTORIALS,_a[EVENT_NAMES.NO_VALID_TUTORIAL_IDENTIFIER]="(Candu/Tutorial) You must define one of tutorialId, slug, commitId or contentHashId.",_a[EVENT_NAMES.TUTORIAL_LOADING_ERROR]="An error has occurred while trying to load the Tutorial",_a[EVENT_NAMES.UNKOWN_INLINE_NODE_TYPE]=unknownMessage(ERROR_SLUGS.UNKOWN_INLINE_NODE_TYPE),_a[EVENT_NAMES.UNKOWN_NODE_TYPE]=unknownMessage(ERROR_SLUGS.UNKOWN_NODE_TYPE),_a[EVENT_NAMES.CIRCULAR_DEPENDENCY_EMBED_PORTAL]="Circular dependency found on Embeded Portal. Please take a look at the Portal Content.",_a[EVENT_NAMES.CIRCULAR_DEPENDENCY_EMBED_TUTORIAL]="Circular dependency found on Embeded Tutorial. Please take a look at the Tutorial Content.",_a[EVENT_NAMES.PORTAL_ERROR]="An error has occured within Portal",_a[EVENT_NAMES.PROVIDER_ERROR]="An error has occured within Provider",_a[EVENT_NAMES.TUTORIAL_ERROR]="An error has occured within Tutorial",_a[EVENT_NAMES.RENDER_NODE_ERROR]="An error has occured while rendering tutorial node",_a[EVENT_NAMES.STYLEGUIDE_MAP_ERROR]="An error has occured while mapping node to styleguide",_a),defaultStyleguide={Alert:!0,B:!0,Badge:!0,Button:!0,Card:!0,Code:!0,Document:!0,Em:!0,EmbedPortal:!0,EmbedTutorial:!0,Flex:!0,FlexItem:!0,H1:!0,H2:!0,H3:!0,H4:!0,H5:!0,H6:!0,Image:!0,InlineCode:!0,Link:!0,List:!0,ListItem:!0,P:!0,RichText:!0,Spacing:!0,Text:!0,U:!0,View:!0,Player:!0},trackStyleguideProperties=function(e){var t={};return Object.keys(e).forEach((function(r){defaultStyleguide[r]&&(t["styleguide."+r]=e[r].displayName||!0)})),t},LOGGER={error:console.error,warning:console.warn},internalEventing=function(e){var t=e.identify,r=e.track;return{provider:function(e){var a=e.userId,n=e.traits,o=e.styleguide;t(a,n),r(EVENT_NAMES.HEARTBEAT,trackStyleguideProperties(o))},tutorialDocumentLoadingError:function(e){var t=e.tutorialId,a=e.slug,n=e.contentHashId;LOGGER.error(ERROR_MESSAGES[EVENT_NAMES.TUTORIAL_LOADING_ERROR]),r(EVENT_NAMES.TUTORIAL_LOADING_ERROR,{tutorialId:t,slug:a,contentHashId:n})}}},e$1=function(e,t){return function(e){var t="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(t){var r=new Uint8Array(16);e.exports=function(){return t(r),r}}else{var a=new Array(16);e.exports=function(){for(var e,t=0;t<16;t++)0==(3&t)&&(e=4294967296*Math.random()),a[t]=e>>>((3&t)<<3)&255;return a}}}(t={exports:{}}),t.exports}(),n$1=[],t$1=0;t$1<256;++t$1)n$1[t$1]=(t$1+256).toString(16).substr(1);var a$1,i$1,r$1=function(e,t){var r=t||0,a=n$1;return[a[e[r++]],a[e[r++]],a[e[r++]],a[e[r++]],"-",a[e[r++]],a[e[r++]],"-",a[e[r++]],a[e[r++]],"-",a[e[r++]],a[e[r++]],"-",a[e[r++]],a[e[r++]],a[e[r++]],a[e[r++]],a[e[r++]],a[e[r++]]].join("")},o$1=function(e,t,r){var a=t&&r||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null);var n=(e=e||{}).random||(e.rng||e$1)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t)for(var o=0;o<16;++o)t[a+o]=n[o];return t||r$1(n)};!function(e){e.UserGenerated="UserGenerated",e.SDK="SDK"}(a$1||(a$1={})),function(e){e.Identify="Identify",e.Group="Group",e.Track="Track",e.Page="Page",e.Screen="Screen"}(i$1||(i$1={}));var u$1,c$1,d$1=function(){return"undefined"!=typeof window&&window.localStorage},p$1=function(e){return function(t){d$1()&&null!=t&&window.localStorage.setItem(e,JSON.stringify(t))}},l$1={anonymousId:{getOrCreate:(u$1="candu:anonymous_id",c$1=function(){var e=o$1();return p$1("candu:anonymous_id")(e),e},function(){return function(e){return function(){if(d$1()){var t=window.localStorage.getItem(e);if(t)try{return JSON.parse(t)}catch(e){return null}}}}(u$1)()||c$1()}),set:p$1("candu:anonymous_id")}},h=l$1.anonymousId.getOrCreate,invariant=function(e,t,r,a,n,o,i,s){if(!e){var c;if(void 0===t)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=[r,a,n,o,i,s],_=0;(c=new Error(t.replace(/%s/g,(function(){return u[_++]})))).name="Invariant Violation"}throw c.framesToPop=1,c}},browser=invariant,isValidStyleguideProps=function(e){return browser(!e||isObject_1(e),"(Candu) styleguide must be undefined or an object")},providerValidation=function(e){var t=e.clientToken,r=e.userId,a=e.traits,n=e.options,o=e.styleguide,i=__rest(e,["clientToken","userId","traits","options","styleguide"]);return browser(b(t),"(Candu) you must provide a valid clientToken"),browser(!r||I(r),"(Candu) you must provide a valid userId"),isValidStyleguideProps(o),browser(!a||isObject_1(a),"(Candu) traits must be undefined or an object"),browser(!n||isObject_1(n),"(Candu) options must be undefined or an object"),__assign(__assign({},i),{clientToken:t,traits:a||{},options:n||{},styleguide:o||{},userId:r||h()})},tutorialValidation=function(e){var t=e.slug,r=e.styleguide,a=e.contentHashId,n=e.tutorialId,o=e.tutorialDocument,i=e.renderedByClient,s=__rest(e,["slug","styleguide","contentHashId","tutorialId","tutorialDocument","renderedByClient"]);return isValidStyleguideProps(r),__assign(__assign({},s),{slug:t,styleguide:r||{},contentHashId:a,tutorialId:n,tutorialDocument:o,renderedByClient:i})},portalValidation=function(e){var t=e.slug,r=e.styleguide;return isValidStyleguideProps(r),{slug:t,styleguide:r||{}}};const API_BASE_URL="https://api.candu.ai",CDN_BASE_URL="https://cdn.candu.ai";var API_BASE_URL$1=API_BASE_URL,CDN_BASE_URL$1=CDN_BASE_URL,ENDPOINTS={segmentMembership:"/api/segmentMemberships",segmentsDefinition:"/api/segmentsDefinition",tutorialMetadata:"/api/tutorialMetadata",tutorialDocuments:"/api/tutorialDocumentsSdk",tutorialProdSocket:"wss://2jcfb7pjlf.execute-api.eu-west-1.amazonaws.com/prod"},fetchURL=function(e){return __awaiter(void 0,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:return[4,fetch(e)];case 1:return[2,t.sent().json()]}}))}))},fetchFromApi=function(e){return fetchURL(""+API_BASE_URL$1+e)},fetchFromCdn=function(e){return fetchURL(""+CDN_BASE_URL$1+e)},getTutorialDocument=function(e){return{byId:function(t){return fetchFromApi(ENDPOINTS.tutorialDocuments+"?token="+e+"&finder=latestPublished&tutorialId="+t)},bySlug:function(t){return fetchFromCdn("/tutorials/"+e+"/"+t+".json")},byContentHash:function(t){return fetchFromCdn("/tutorials/"+e+"/"+t+".json")}}},RESOURCES={tutorialDocumentLatestSaved:function(e,t){return __awaiter(void 0,void 0,void 0,(function(){return __generator(this,(function(r){return[2,fetchFromApi(ENDPOINTS.tutorialDocuments+"/"+t+"?token="+e)]}))}))},portalAsset:function(e,t){return __awaiter(void 0,void 0,void 0,(function(){return __generator(this,(function(r){return[2,fetchFromCdn("/portals/"+e+"/"+t+"/head.json")]}))}))},segmentMembership:function(e,t){return __awaiter(void 0,void 0,void 0,(function(){return __generator(this,(function(r){return[2,fetchFromApi(ENDPOINTS.segmentMembership+"/"+t+"?token="+e)]}))}))},segmentDefinition:function(e){return __awaiter(void 0,void 0,void 0,(function(){return __generator(this,(function(t){return[2,fetchFromApi(ENDPOINTS.segmentsDefinition+"?token="+e)]}))}))},tutorialMetadata:function(e){return __awaiter(void 0,void 0,void 0,(function(){return __generator(this,(function(t){return[2,fetchFromApi(ENDPOINTS.tutorialMetadata+"?token="+e)]}))}))},tutorialSocket:function(e,t,r){var a=ENDPOINTS.tutorialProdSocket+"?clientToken="+e+"&tutorialId="+t,n=new WebSocket(a);return n.onmessage=function(e){var t=JSON.parse(e.data);r(t)},function(){return n.close()}},tutorialDocument:function(e,t,r){var a=e.contentHashId,n=e.tutorialId,o=e.tutorialDocument,i=e.slug,s=getTutorialDocument(t);return H(n)?s.byId(n):K(i)?s.bySlug(i):z(a)?s.byContentHash(a):isObject_1(o)?Promise.resolve(o):(LOGGER.error(ERROR_MESSAGES[EVENT_NAMES.NO_VALID_TUTORIAL_IDENTIFIER]),r.track(EVENT_NAMES.NO_VALID_TUTORIAL_IDENTIFIER,{slug:e.slug}),null)}},logError=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return console.error.apply(console,e)},logWarning=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return console.warn.apply(console,e)},logger={error:logError,warning:logWarning},stripHTML=function(e){return DOMParser?(new DOMParser).parseFromString(e,"text/html").body.textContent||"":e},Observer=function(){function e(){this.subscribers=[]}return e.prototype.subscribe=function(e){var t=this;return this.subscribers.push(e),function(){t.subscribers[t.subscribers.indexOf(e)]=function(){}}},e.prototype.notify=function(e){this.subscribers.forEach((function(t){return t(e)}))},e.prototype.clear=function(){this.subscribers=[]},e}(),PreviewContainer=function(){function e(){this.onClientUpdateObserver=new Observer}return e.prototype.attachClient=function(e){this.client=e,this.onClientUpdateObserver.notify({client:e})},e.prototype.detachClient=function(){this.client=null,this.onClientUpdateObserver.notify({client:null})},e.prototype.onClientUpdate=function(e){var t=this.onClientUpdateObserver.subscribe(e);return this.client&&e({client:this.client}),t},e}();function createSingleton(e){var t,r,a=function(e){return function(){for(var t,a=[],n=0;n<arguments.length;n++)a[n]=arguments[n];if(r.api)return(t=r.api)[e].apply(t,a);console.warn("Please initialize the SDK by calling Candu.init() before attempting to call "+e)}};return(t=function(){function t(){}return t.init=function(){for(var r=[],a=0;a<arguments.length;a++)r[a]=arguments[a];return this.api||(t.api=new(e.bind.apply(e,__spreadArrays([void 0],r)))),t.subscriberCallbacks.forEach((function(e){return e()})),t.subscriberCallbacks=[],window.postMessage({source:"CANDU_SINGLETON",payload:{type:"INIT"}},window&&window.origin?window.origin:"*"),t},t.onProviderReady=function(e){if(t.api)return e();t.subscriberCallbacks.push(e)},t}()).subscriberCallbacks=[],t.renderTutorial=a("renderTutorial"),t.renderPortal=a("renderPortal"),t.attachClient=a("attachClient"),t.detachClient=a("detachClient"),t.getProvider=a("getProvider"),r=t,window.Candu=r,r}var SingletonAPI=function(){function e(e){this.init(e)}return e.prototype.attachClient=function(e){return this.provider.preview.attachClient(e)},e.prototype.detachClient=function(){return this.provider.preview.detachClient()},Object.defineProperty(e.prototype,"provider",{get:function(){return this.getProvider()},enumerable:!0,configurable:!0}),e}(),getEventHandler=function(e){switch(e.trigger){case C.ON_CLICK:default:return"onClick"}},getActionHandler=function(e,t){var r,a,n;switch(e.handler.type){case w.NAVIGATE:return(r={})[getEventHandler(e)]=function(){var r=e.handler,a=r.href,n=r.target;t(e),"Blank"===n?window.open(a,"_blank"):a&&a.includes("mailto:")?window.location=a:document.location.href=a},r;case w.CHANGE_TUTORIAL:return(a={})[getEventHandler(e)]=function(){var t=e.handler.tutorialId;logError("TODO -> change tutorial",t)},a;case w.OPEN_GUIDE:return(n={})[getEventHandler(e)]=function(){var t=e.handler.guideId;logError("TODO -> open guide",t)},n;default:return{}}},getActionHandlers=function(e,t){var r=e.data;if(!r||!r.actions)return{};var a=function(e){t.provider.eventing.track(EVENT_NAMES.TUTORIAL_INTERACTION,__assign(__assign({},e),t.trackingIdentifiers||{}))};return r.actions.map((function(e){return getActionHandler(e,a)})).reduce((function(e,t){return __assign(__assign({},e),t)}),{})},getChildren=function(e,t){var r=e.props||{},a=e.nodes,n=r.children;return n?"string"==typeof n?stripHTML(n):n:a?a.map(t):null},mapNodeToStyleguide=function(e,t){try{var r=t.provider,a=t.document,n=t.trackingIdentifiers,o=a.nodes[e];if(!o)return logger.error("Document is corrupted. Refusing to move further."),null;var i=function(e){return mapNodeToStyleguide(e,t)},s=o.type,c=o.props,u=o.css,_=__assign(__assign(__assign({},c||{}),{style:u||{},children:getChildren(o,i)}),getActionHandlers(o,{trackingIdentifiers:n,provider:r})),l={nodeId:e,node:o,document:a,render:{node:i,styleguide:function(e,r){return void 0===r&&(r={}),t.renderNode(e,{api:l,attributes:r})},tutorial:function(e){return t.renderTutorial(e)},portal:function(e){return t.renderPortal(e)}},trackingIdentifiers:n},p=l.render.styleguide(s,_);return p||(logger.error(ERROR_MESSAGES[EVENT_NAMES.UNKOWN_NODE_TYPE],{type:s}),r.eventing.track(EVENT_NAMES.UNKOWN_NODE_TYPE,{type:s}),null)}catch(e){return logger.error(ERROR_MESSAGES[EVENT_NAMES.STYLEGUIDE_MAP_ERROR],e),null}},mergeStyleguidesFromContext=memoize_1((function(e,t){var r,a,n=e.provider,o=e.portal,i=e.tutorial,s=n.styleguide;return i&&(a=i.styleguide),o&&(r=o.styleguide),__assign(__assign(__assign(__assign({},s||{}),r||{}),a||{}),t||{})})),DEFAULT_ALT="",DEFAULT_ALERT_COLOR="#EDEDED",DEFAULT_TAB_HEADER_COLOR="#333745",DEFAULT_TAB_ITEM_COLOR="#838792",DEFAULT_TAB_ACTIVE_COLOR="#FEFEFE",DEFAULT_TAB_COLOR="#FEFEFE",STYLEGUIDE_COLORS={primary:"#6310E5",secondary:"#59C3C3",tertiary:"#4D515D",warning:"#FCAD0D",danger:"#EE4266"},attachStylesheet=function(e){var t=document.createElement("link");t.setAttribute("rel","stylesheet"),t.setAttribute("href",CDN_BASE_URL$1+"/styleguides/applications/"+e+"/default/main.css"),document.head.appendChild(t)};exports.DEFAULT_ALERT_COLOR=DEFAULT_ALERT_COLOR,exports.DEFAULT_ALT=DEFAULT_ALT,exports.DEFAULT_TAB_ACTIVE_COLOR=DEFAULT_TAB_ACTIVE_COLOR,exports.DEFAULT_TAB_COLOR=DEFAULT_TAB_COLOR,exports.DEFAULT_TAB_HEADER_COLOR=DEFAULT_TAB_HEADER_COLOR,exports.DEFAULT_TAB_ITEM_COLOR=DEFAULT_TAB_ITEM_COLOR,exports.ERROR_MESSAGES=ERROR_MESSAGES,exports.ERROR_SLUGS=ERROR_SLUGS,exports.EVENT_NAMES=EVENT_NAMES,exports.LOGGER=LOGGER,exports.Observer=Observer,exports.PreviewContainer=PreviewContainer,exports.RESOURCES=RESOURCES,exports.STYLEGUIDE_COLORS=STYLEGUIDE_COLORS,exports.SingletonAPI=SingletonAPI,exports.TutorialDependencies=TutorialDependencies,exports.adaptCustomNodes=adaptCustomNodes,exports.attachStylesheet=attachStylesheet,exports.checkCyclicAndAdd=checkCyclicAndAdd,exports.createSingleton=createSingleton,exports.createTutorialDocumentContext=createTutorialDocumentContext,exports.defaultStyleguide=defaultStyleguide,exports.findMatchingSegment=findMatchingSegment,exports.internalEventing=internalEventing,exports.logError=logError,exports.logWarning=logWarning,exports.logger=logger,exports.mapNodeToStyleguide=mapNodeToStyleguide,exports.mergeStyleguidesFromContext=mergeStyleguidesFromContext,exports.normalizeCss=normalizeCss,exports.portalValidation=portalValidation,exports.providerValidation=providerValidation,exports.stripHTML=stripHTML,exports.tutorialValidation=tutorialValidation;
var __assign=function(){return(__assign=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)};function __rest(e,t){var r={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(r[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(a=Object.getOwnPropertySymbols(e);n<a.length;n++)t.indexOf(a[n])<0&&Object.prototype.propertyIsEnumerable.call(e,a[n])&&(r[a[n]]=e[a[n]])}return r}function __awaiter(e,t,r,a){return new(r||(r=Promise))((function(n,o){function i(e){try{c(a.next(e))}catch(e){o(e)}}function s(e){try{c(a.throw(e))}catch(e){o(e)}}function c(e){e.done?n(e.value):new r((function(t){t(e.value)})).then(i,s)}c((a=a.apply(e,t||[])).next())}))}function __generator(e,t){var r,a,n,o,i={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;i;)try{if(r=1,a&&(n=2&o[0]?a.return:o[0]?a.throw||((n=a.return)&&n.call(a),0):a.next)&&!(n=n.call(a,o[1])).done)return n;switch(a=0,n&&(o=[2&o[0],n.value]),o[0]){case 0:case 1:n=o;break;case 4:return i.label++,{value:o[1],done:!1};case 5:i.label++,a=o[1],o=[0];continue;case 7:o=i.ops.pop(),i.trys.pop();continue;default:if(!(n=(n=i.trys).length>0&&n[n.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!n||o[1]>n[0]&&o[1]<n[3])){i.label=o[1];break}if(6===o[0]&&i.label<n[1]){i.label=n[1],n=o;break}if(n&&i.label<n[2]){i.label=n[2],i.ops.push(o);break}n[2]&&i.ops.pop(),i.trys.pop();continue}o=t.call(e,i)}catch(e){o=[6,e],a=0}finally{r=n=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}function __spreadArrays(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var a=Array(e),n=0;for(t=0;t<r;t++)for(var o=arguments[t],i=0,s=o.length;i<s;i++,n++)a[n]=o[i];return a}var commonjsGlobal="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function createCommonjsModule(e,t){return e(t={exports:{}},t.exports),t.exports}var freeGlobal="object"==typeof commonjsGlobal&&commonjsGlobal&&commonjsGlobal.Object===Object&&commonjsGlobal,_freeGlobal=freeGlobal,freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=_freeGlobal||freeSelf||Function("return this")(),_root=root,Symbol$1=_root.Symbol,_Symbol=Symbol$1,objectProto=Object.prototype,hasOwnProperty=objectProto.hasOwnProperty,nativeObjectToString=objectProto.toString,symToStringTag=_Symbol?_Symbol.toStringTag:void 0;function getRawTag(e){var t=hasOwnProperty.call(e,symToStringTag),r=e[symToStringTag];try{e[symToStringTag]=void 0;var a=!0}catch(e){}var n=nativeObjectToString.call(e);return a&&(t?e[symToStringTag]=r:delete e[symToStringTag]),n}var _getRawTag=getRawTag,objectProto$1=Object.prototype,nativeObjectToString$1=objectProto$1.toString;function objectToString(e){return nativeObjectToString$1.call(e)}var _objectToString=objectToString,nullTag="[object Null]",undefinedTag="[object Undefined]",symToStringTag$1=_Symbol?_Symbol.toStringTag:void 0;function baseGetTag(e){return null==e?void 0===e?undefinedTag:nullTag:symToStringTag$1&&symToStringTag$1 in Object(e)?_getRawTag(e):_objectToString(e)}var _baseGetTag=baseGetTag;function isObject(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}var isObject_1=isObject,asyncTag="[object AsyncFunction]",funcTag="[object Function]",genTag="[object GeneratorFunction]",proxyTag="[object Proxy]";function isFunction(e){if(!isObject_1(e))return!1;var t=_baseGetTag(e);return t==funcTag||t==genTag||t==asyncTag||t==proxyTag}var isFunction_1=isFunction,coreJsData=_root["__core-js_shared__"],_coreJsData=coreJsData,maskSrcKey=function(){var e=/[^.]+$/.exec(_coreJsData&&_coreJsData.keys&&_coreJsData.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function isMasked(e){return!!maskSrcKey&&maskSrcKey in e}var _isMasked=isMasked,funcProto=Function.prototype,funcToString=funcProto.toString;function toSource(e){if(null!=e){try{return funcToString.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var _toSource=toSource,reRegExpChar=/[\\^$.*+?()[\]{}|]/g,reIsHostCtor=/^\[object .+?Constructor\]$/,funcProto$1=Function.prototype,objectProto$2=Object.prototype,funcToString$1=funcProto$1.toString,hasOwnProperty$1=objectProto$2.hasOwnProperty,reIsNative=RegExp("^"+funcToString$1.call(hasOwnProperty$1).replace(reRegExpChar,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function baseIsNative(e){return!(!isObject_1(e)||_isMasked(e))&&(isFunction_1(e)?reIsNative:reIsHostCtor).test(_toSource(e))}var _baseIsNative=baseIsNative;function getValue(e,t){return null==e?void 0:e[t]}var _getValue=getValue;function getNative(e,t){var r=_getValue(e,t);return _baseIsNative(r)?r:void 0}var _getNative=getNative,defineProperty=function(){try{var e=_getNative(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),_defineProperty=defineProperty;function baseAssignValue(e,t,r){"__proto__"==t&&_defineProperty?_defineProperty(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}var _baseAssignValue=baseAssignValue;function createBaseFor(e){return function(t,r,a){for(var n=-1,o=Object(t),i=a(t),s=i.length;s--;){var c=i[e?s:++n];if(!1===r(o[c],c,o))break}return t}}var _createBaseFor=createBaseFor,baseFor=_createBaseFor(),_baseFor=baseFor;function baseTimes(e,t){for(var r=-1,a=Array(e);++r<e;)a[r]=t(r);return a}var _baseTimes=baseTimes;function isObjectLike(e){return null!=e&&"object"==typeof e}var isObjectLike_1=isObjectLike,argsTag="[object Arguments]";function baseIsArguments(e){return isObjectLike_1(e)&&_baseGetTag(e)==argsTag}var _baseIsArguments=baseIsArguments,objectProto$3=Object.prototype,hasOwnProperty$2=objectProto$3.hasOwnProperty,propertyIsEnumerable=objectProto$3.propertyIsEnumerable,isArguments=_baseIsArguments(function(){return arguments}())?_baseIsArguments:function(e){return isObjectLike_1(e)&&hasOwnProperty$2.call(e,"callee")&&!propertyIsEnumerable.call(e,"callee")},isArguments_1=isArguments,isArray=Array.isArray,isArray_1=isArray;function stubFalse(){return!1}var stubFalse_1=stubFalse,isBuffer_1=createCommonjsModule((function(e,t){var r=t&&!t.nodeType&&t,a=r&&e&&!e.nodeType&&e,n=a&&a.exports===r?_root.Buffer:void 0,o=(n?n.isBuffer:void 0)||stubFalse_1;e.exports=o})),MAX_SAFE_INTEGER=9007199254740991,reIsUint=/^(?:0|[1-9]\d*)$/;function isIndex(e,t){var r=typeof e;return!!(t=null==t?MAX_SAFE_INTEGER:t)&&("number"==r||"symbol"!=r&&reIsUint.test(e))&&e>-1&&e%1==0&&e<t}var _isIndex=isIndex,MAX_SAFE_INTEGER$1=9007199254740991;function isLength(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=MAX_SAFE_INTEGER$1}var isLength_1=isLength,argsTag$1="[object Arguments]",arrayTag="[object Array]",boolTag="[object Boolean]",dateTag="[object Date]",errorTag="[object Error]",funcTag$1="[object Function]",mapTag="[object Map]",numberTag="[object Number]",objectTag="[object Object]",regexpTag="[object RegExp]",setTag="[object Set]",stringTag="[object String]",weakMapTag="[object WeakMap]",arrayBufferTag="[object ArrayBuffer]",dataViewTag="[object DataView]",float32Tag="[object Float32Array]",float64Tag="[object Float64Array]",int8Tag="[object Int8Array]",int16Tag="[object Int16Array]",int32Tag="[object Int32Array]",uint8Tag="[object Uint8Array]",uint8ClampedTag="[object Uint8ClampedArray]",uint16Tag="[object Uint16Array]",uint32Tag="[object Uint32Array]",typedArrayTags={};function baseIsTypedArray(e){return isObjectLike_1(e)&&isLength_1(e.length)&&!!typedArrayTags[_baseGetTag(e)]}typedArrayTags[float32Tag]=typedArrayTags[float64Tag]=typedArrayTags[int8Tag]=typedArrayTags[int16Tag]=typedArrayTags[int32Tag]=typedArrayTags[uint8Tag]=typedArrayTags[uint8ClampedTag]=typedArrayTags[uint16Tag]=typedArrayTags[uint32Tag]=!0,typedArrayTags[argsTag$1]=typedArrayTags[arrayTag]=typedArrayTags[arrayBufferTag]=typedArrayTags[boolTag]=typedArrayTags[dataViewTag]=typedArrayTags[dateTag]=typedArrayTags[errorTag]=typedArrayTags[funcTag$1]=typedArrayTags[mapTag]=typedArrayTags[numberTag]=typedArrayTags[objectTag]=typedArrayTags[regexpTag]=typedArrayTags[setTag]=typedArrayTags[stringTag]=typedArrayTags[weakMapTag]=!1;var _baseIsTypedArray=baseIsTypedArray;function baseUnary(e){return function(t){return e(t)}}var _baseUnary=baseUnary,_nodeUtil=createCommonjsModule((function(e,t){var r=t&&!t.nodeType&&t,a=r&&e&&!e.nodeType&&e,n=a&&a.exports===r&&_freeGlobal.process,o=function(){try{var e=a&&a.require&&a.require("util").types;return e||n&&n.binding&&n.binding("util")}catch(e){}}();e.exports=o})),nodeIsTypedArray=_nodeUtil&&_nodeUtil.isTypedArray,isTypedArray=nodeIsTypedArray?_baseUnary(nodeIsTypedArray):_baseIsTypedArray,isTypedArray_1=isTypedArray,objectProto$4=Object.prototype,hasOwnProperty$3=objectProto$4.hasOwnProperty;function arrayLikeKeys(e,t){var r=isArray_1(e),a=!r&&isArguments_1(e),n=!r&&!a&&isBuffer_1(e),o=!r&&!a&&!n&&isTypedArray_1(e),i=r||a||n||o,s=i?_baseTimes(e.length,String):[],c=s.length;for(var u in e)!t&&!hasOwnProperty$3.call(e,u)||i&&("length"==u||n&&("offset"==u||"parent"==u)||o&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||_isIndex(u,c))||s.push(u);return s}var _arrayLikeKeys=arrayLikeKeys,objectProto$5=Object.prototype;function isPrototype(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||objectProto$5)}var _isPrototype=isPrototype;function overArg(e,t){return function(r){return e(t(r))}}var _overArg=overArg,nativeKeys=_overArg(Object.keys,Object),_nativeKeys=nativeKeys,objectProto$6=Object.prototype,hasOwnProperty$4=objectProto$6.hasOwnProperty;function baseKeys(e){if(!_isPrototype(e))return _nativeKeys(e);var t=[];for(var r in Object(e))hasOwnProperty$4.call(e,r)&&"constructor"!=r&&t.push(r);return t}var _baseKeys=baseKeys;function isArrayLike(e){return null!=e&&isLength_1(e.length)&&!isFunction_1(e)}var isArrayLike_1=isArrayLike;function keys(e){return isArrayLike_1(e)?_arrayLikeKeys(e):_baseKeys(e)}var keys_1=keys;function baseForOwn(e,t){return e&&_baseFor(e,t,keys_1)}var _baseForOwn=baseForOwn;function listCacheClear(){this.__data__=[],this.size=0}var _listCacheClear=listCacheClear;function eq(e,t){return e===t||e!=e&&t!=t}var eq_1=eq;function assocIndexOf(e,t){for(var r=e.length;r--;)if(eq_1(e[r][0],t))return r;return-1}var _assocIndexOf=assocIndexOf,arrayProto=Array.prototype,splice=arrayProto.splice;function listCacheDelete(e){var t=this.__data__,r=_assocIndexOf(t,e);return!(r<0)&&(r==t.length-1?t.pop():splice.call(t,r,1),--this.size,!0)}var _listCacheDelete=listCacheDelete;function listCacheGet(e){var t=this.__data__,r=_assocIndexOf(t,e);return r<0?void 0:t[r][1]}var _listCacheGet=listCacheGet;function listCacheHas(e){return _assocIndexOf(this.__data__,e)>-1}var _listCacheHas=listCacheHas;function listCacheSet(e,t){var r=this.__data__,a=_assocIndexOf(r,e);return a<0?(++this.size,r.push([e,t])):r[a][1]=t,this}var _listCacheSet=listCacheSet;function ListCache(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var a=e[t];this.set(a[0],a[1])}}ListCache.prototype.clear=_listCacheClear,ListCache.prototype.delete=_listCacheDelete,ListCache.prototype.get=_listCacheGet,ListCache.prototype.has=_listCacheHas,ListCache.prototype.set=_listCacheSet;var _ListCache=ListCache;function stackClear(){this.__data__=new _ListCache,this.size=0}var _stackClear=stackClear;function stackDelete(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}var _stackDelete=stackDelete;function stackGet(e){return this.__data__.get(e)}var _stackGet=stackGet;function stackHas(e){return this.__data__.has(e)}var _stackHas=stackHas,Map=_getNative(_root,"Map"),_Map=Map,nativeCreate=_getNative(Object,"create"),_nativeCreate=nativeCreate;function hashClear(){this.__data__=_nativeCreate?_nativeCreate(null):{},this.size=0}var _hashClear=hashClear;function hashDelete(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var _hashDelete=hashDelete,HASH_UNDEFINED="__lodash_hash_undefined__",objectProto$7=Object.prototype,hasOwnProperty$5=objectProto$7.hasOwnProperty;function hashGet(e){var t=this.__data__;if(_nativeCreate){var r=t[e];return r===HASH_UNDEFINED?void 0:r}return hasOwnProperty$5.call(t,e)?t[e]:void 0}var _hashGet=hashGet,objectProto$8=Object.prototype,hasOwnProperty$6=objectProto$8.hasOwnProperty;function hashHas(e){var t=this.__data__;return _nativeCreate?void 0!==t[e]:hasOwnProperty$6.call(t,e)}var _hashHas=hashHas,HASH_UNDEFINED$1="__lodash_hash_undefined__";function hashSet(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=_nativeCreate&&void 0===t?HASH_UNDEFINED$1:t,this}var _hashSet=hashSet;function Hash(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var a=e[t];this.set(a[0],a[1])}}Hash.prototype.clear=_hashClear,Hash.prototype.delete=_hashDelete,Hash.prototype.get=_hashGet,Hash.prototype.has=_hashHas,Hash.prototype.set=_hashSet;var _Hash=Hash;function mapCacheClear(){this.size=0,this.__data__={hash:new _Hash,map:new(_Map||_ListCache),string:new _Hash}}var _mapCacheClear=mapCacheClear;function isKeyable(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}var _isKeyable=isKeyable;function getMapData(e,t){var r=e.__data__;return _isKeyable(t)?r["string"==typeof t?"string":"hash"]:r.map}var _getMapData=getMapData;function mapCacheDelete(e){var t=_getMapData(this,e).delete(e);return this.size-=t?1:0,t}var _mapCacheDelete=mapCacheDelete;function mapCacheGet(e){return _getMapData(this,e).get(e)}var _mapCacheGet=mapCacheGet;function mapCacheHas(e){return _getMapData(this,e).has(e)}var _mapCacheHas=mapCacheHas;function mapCacheSet(e,t){var r=_getMapData(this,e),a=r.size;return r.set(e,t),this.size+=r.size==a?0:1,this}var _mapCacheSet=mapCacheSet;function MapCache(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var a=e[t];this.set(a[0],a[1])}}MapCache.prototype.clear=_mapCacheClear,MapCache.prototype.delete=_mapCacheDelete,MapCache.prototype.get=_mapCacheGet,MapCache.prototype.has=_mapCacheHas,MapCache.prototype.set=_mapCacheSet;var _MapCache=MapCache,LARGE_ARRAY_SIZE=200;function stackSet(e,t){var r=this.__data__;if(r instanceof _ListCache){var a=r.__data__;if(!_Map||a.length<LARGE_ARRAY_SIZE-1)return a.push([e,t]),this.size=++r.size,this;r=this.__data__=new _MapCache(a)}return r.set(e,t),this.size=r.size,this}var _stackSet=stackSet;function Stack(e){var t=this.__data__=new _ListCache(e);this.size=t.size}Stack.prototype.clear=_stackClear,Stack.prototype.delete=_stackDelete,Stack.prototype.get=_stackGet,Stack.prototype.has=_stackHas,Stack.prototype.set=_stackSet;var _Stack=Stack,HASH_UNDEFINED$2="__lodash_hash_undefined__";function setCacheAdd(e){return this.__data__.set(e,HASH_UNDEFINED$2),this}var _setCacheAdd=setCacheAdd;function setCacheHas(e){return this.__data__.has(e)}var _setCacheHas=setCacheHas;function SetCache(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new _MapCache;++t<r;)this.add(e[t])}SetCache.prototype.add=SetCache.prototype.push=_setCacheAdd,SetCache.prototype.has=_setCacheHas;var _SetCache=SetCache;function arraySome(e,t){for(var r=-1,a=null==e?0:e.length;++r<a;)if(t(e[r],r,e))return!0;return!1}var _arraySome=arraySome;function cacheHas(e,t){return e.has(t)}var _cacheHas=cacheHas,COMPARE_PARTIAL_FLAG=1,COMPARE_UNORDERED_FLAG=2;function equalArrays(e,t,r,a,n,o){var i=r&COMPARE_PARTIAL_FLAG,s=e.length,c=t.length;if(s!=c&&!(i&&c>s))return!1;var u=o.get(e);if(u&&o.get(t))return u==t;var _=-1,l=!0,p=r&COMPARE_UNORDERED_FLAG?new _SetCache:void 0;for(o.set(e,t),o.set(t,e);++_<s;){var d=e[_],f=t[_];if(a)var g=i?a(f,d,_,t,e,o):a(d,f,_,e,t,o);if(void 0!==g){if(g)continue;l=!1;break}if(p){if(!_arraySome(t,(function(e,t){if(!_cacheHas(p,t)&&(d===e||n(d,e,r,a,o)))return p.push(t)}))){l=!1;break}}else if(d!==f&&!n(d,f,r,a,o)){l=!1;break}}return o.delete(e),o.delete(t),l}var _equalArrays=equalArrays,Uint8Array$1=_root.Uint8Array,_Uint8Array=Uint8Array$1;function mapToArray(e){var t=-1,r=Array(e.size);return e.forEach((function(e,a){r[++t]=[a,e]})),r}var _mapToArray=mapToArray;function setToArray(e){var t=-1,r=Array(e.size);return e.forEach((function(e){r[++t]=e})),r}var _setToArray=setToArray,COMPARE_PARTIAL_FLAG$1=1,COMPARE_UNORDERED_FLAG$1=2,boolTag$1="[object Boolean]",dateTag$1="[object Date]",errorTag$1="[object Error]",mapTag$1="[object Map]",numberTag$1="[object Number]",regexpTag$1="[object RegExp]",setTag$1="[object Set]",stringTag$1="[object String]",symbolTag="[object Symbol]",arrayBufferTag$1="[object ArrayBuffer]",dataViewTag$1="[object DataView]",symbolProto=_Symbol?_Symbol.prototype:void 0,symbolValueOf=symbolProto?symbolProto.valueOf:void 0;function equalByTag(e,t,r,a,n,o,i){switch(r){case dataViewTag$1:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case arrayBufferTag$1:return!(e.byteLength!=t.byteLength||!o(new _Uint8Array(e),new _Uint8Array(t)));case boolTag$1:case dateTag$1:case numberTag$1:return eq_1(+e,+t);case errorTag$1:return e.name==t.name&&e.message==t.message;case regexpTag$1:case stringTag$1:return e==t+"";case mapTag$1:var s=_mapToArray;case setTag$1:var c=a&COMPARE_PARTIAL_FLAG$1;if(s||(s=_setToArray),e.size!=t.size&&!c)return!1;var u=i.get(e);if(u)return u==t;a|=COMPARE_UNORDERED_FLAG$1,i.set(e,t);var _=_equalArrays(s(e),s(t),a,n,o,i);return i.delete(e),_;case symbolTag:if(symbolValueOf)return symbolValueOf.call(e)==symbolValueOf.call(t)}return!1}var _equalByTag=equalByTag;function arrayPush(e,t){for(var r=-1,a=t.length,n=e.length;++r<a;)e[n+r]=t[r];return e}var _arrayPush=arrayPush;function baseGetAllKeys(e,t,r){var a=t(e);return isArray_1(e)?a:_arrayPush(a,r(e))}var _baseGetAllKeys=baseGetAllKeys;function arrayFilter(e,t){for(var r=-1,a=null==e?0:e.length,n=0,o=[];++r<a;){var i=e[r];t(i,r,e)&&(o[n++]=i)}return o}var _arrayFilter=arrayFilter;function stubArray(){return[]}var stubArray_1=stubArray,objectProto$9=Object.prototype,propertyIsEnumerable$1=objectProto$9.propertyIsEnumerable,nativeGetSymbols=Object.getOwnPropertySymbols,getSymbols=nativeGetSymbols?function(e){return null==e?[]:(e=Object(e),_arrayFilter(nativeGetSymbols(e),(function(t){return propertyIsEnumerable$1.call(e,t)})))}:stubArray_1,_getSymbols=getSymbols;function getAllKeys(e){return _baseGetAllKeys(e,keys_1,_getSymbols)}var _getAllKeys=getAllKeys,COMPARE_PARTIAL_FLAG$2=1,objectProto$a=Object.prototype,hasOwnProperty$7=objectProto$a.hasOwnProperty;function equalObjects(e,t,r,a,n,o){var i=r&COMPARE_PARTIAL_FLAG$2,s=_getAllKeys(e),c=s.length;if(c!=_getAllKeys(t).length&&!i)return!1;for(var u=c;u--;){var _=s[u];if(!(i?_ in t:hasOwnProperty$7.call(t,_)))return!1}var l=o.get(e);if(l&&o.get(t))return l==t;var p=!0;o.set(e,t),o.set(t,e);for(var d=i;++u<c;){var f=e[_=s[u]],g=t[_];if(a)var y=i?a(g,f,_,t,e,o):a(f,g,_,e,t,o);if(!(void 0===y?f===g||n(f,g,r,a,o):y)){p=!1;break}d||(d="constructor"==_)}if(p&&!d){var h=e.constructor,b=t.constructor;h!=b&&"constructor"in e&&"constructor"in t&&!("function"==typeof h&&h instanceof h&&"function"==typeof b&&b instanceof b)&&(p=!1)}return o.delete(e),o.delete(t),p}var _equalObjects=equalObjects,DataView=_getNative(_root,"DataView"),_DataView=DataView,Promise$1=_getNative(_root,"Promise"),_Promise=Promise$1,Set=_getNative(_root,"Set"),_Set=Set,WeakMap=_getNative(_root,"WeakMap"),_WeakMap=WeakMap,mapTag$2="[object Map]",objectTag$1="[object Object]",promiseTag="[object Promise]",setTag$2="[object Set]",weakMapTag$1="[object WeakMap]",dataViewTag$2="[object DataView]",dataViewCtorString=_toSource(_DataView),mapCtorString=_toSource(_Map),promiseCtorString=_toSource(_Promise),setCtorString=_toSource(_Set),weakMapCtorString=_toSource(_WeakMap),getTag=_baseGetTag;(_DataView&&getTag(new _DataView(new ArrayBuffer(1)))!=dataViewTag$2||_Map&&getTag(new _Map)!=mapTag$2||_Promise&&getTag(_Promise.resolve())!=promiseTag||_Set&&getTag(new _Set)!=setTag$2||_WeakMap&&getTag(new _WeakMap)!=weakMapTag$1)&&(getTag=function(e){var t=_baseGetTag(e),r=t==objectTag$1?e.constructor:void 0,a=r?_toSource(r):"";if(a)switch(a){case dataViewCtorString:return dataViewTag$2;case mapCtorString:return mapTag$2;case promiseCtorString:return promiseTag;case setCtorString:return setTag$2;case weakMapCtorString:return weakMapTag$1}return t});var _getTag=getTag,COMPARE_PARTIAL_FLAG$3=1,argsTag$2="[object Arguments]",arrayTag$1="[object Array]",objectTag$2="[object Object]",objectProto$b=Object.prototype,hasOwnProperty$8=objectProto$b.hasOwnProperty;function baseIsEqualDeep(e,t,r,a,n,o){var i=isArray_1(e),s=isArray_1(t),c=i?arrayTag$1:_getTag(e),u=s?arrayTag$1:_getTag(t),_=(c=c==argsTag$2?objectTag$2:c)==objectTag$2,l=(u=u==argsTag$2?objectTag$2:u)==objectTag$2,p=c==u;if(p&&isBuffer_1(e)){if(!isBuffer_1(t))return!1;i=!0,_=!1}if(p&&!_)return o||(o=new _Stack),i||isTypedArray_1(e)?_equalArrays(e,t,r,a,n,o):_equalByTag(e,t,c,r,a,n,o);if(!(r&COMPARE_PARTIAL_FLAG$3)){var d=_&&hasOwnProperty$8.call(e,"__wrapped__"),f=l&&hasOwnProperty$8.call(t,"__wrapped__");if(d||f){var g=d?e.value():e,y=f?t.value():t;return o||(o=new _Stack),n(g,y,r,a,o)}}return!!p&&(o||(o=new _Stack),_equalObjects(e,t,r,a,n,o))}var _baseIsEqualDeep=baseIsEqualDeep;function baseIsEqual(e,t,r,a,n){return e===t||(null==e||null==t||!isObjectLike_1(e)&&!isObjectLike_1(t)?e!=e&&t!=t:_baseIsEqualDeep(e,t,r,a,baseIsEqual,n))}var _baseIsEqual=baseIsEqual,COMPARE_PARTIAL_FLAG$4=1,COMPARE_UNORDERED_FLAG$2=2;function baseIsMatch(e,t,r,a){var n=r.length,o=n,i=!a;if(null==e)return!o;for(e=Object(e);n--;){var s=r[n];if(i&&s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++n<o;){var c=(s=r[n])[0],u=e[c],_=s[1];if(i&&s[2]){if(void 0===u&&!(c in e))return!1}else{var l=new _Stack;if(a)var p=a(u,_,c,e,t,l);if(!(void 0===p?_baseIsEqual(_,u,COMPARE_PARTIAL_FLAG$4|COMPARE_UNORDERED_FLAG$2,a,l):p))return!1}}return!0}var _baseIsMatch=baseIsMatch;function isStrictComparable(e){return e==e&&!isObject_1(e)}var _isStrictComparable=isStrictComparable;function getMatchData(e){for(var t=keys_1(e),r=t.length;r--;){var a=t[r],n=e[a];t[r]=[a,n,_isStrictComparable(n)]}return t}var _getMatchData=getMatchData;function matchesStrictComparable(e,t){return function(r){return null!=r&&(r[e]===t&&(void 0!==t||e in Object(r)))}}var _matchesStrictComparable=matchesStrictComparable;function baseMatches(e){var t=_getMatchData(e);return 1==t.length&&t[0][2]?_matchesStrictComparable(t[0][0],t[0][1]):function(r){return r===e||_baseIsMatch(r,e,t)}}var _baseMatches=baseMatches,symbolTag$1="[object Symbol]";function isSymbol(e){return"symbol"==typeof e||isObjectLike_1(e)&&_baseGetTag(e)==symbolTag$1}var isSymbol_1=isSymbol,reIsDeepProp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,reIsPlainProp=/^\w*$/;function isKey(e,t){if(isArray_1(e))return!1;var r=typeof e;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!isSymbol_1(e))||(reIsPlainProp.test(e)||!reIsDeepProp.test(e)||null!=t&&e in Object(t))}var _isKey=isKey,FUNC_ERROR_TEXT="Expected a function";function memoize(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError(FUNC_ERROR_TEXT);var r=function(){var a=arguments,n=t?t.apply(this,a):a[0],o=r.cache;if(o.has(n))return o.get(n);var i=e.apply(this,a);return r.cache=o.set(n,i)||o,i};return r.cache=new(memoize.Cache||_MapCache),r}memoize.Cache=_MapCache;var memoize_1=memoize,MAX_MEMOIZE_SIZE=500;function memoizeCapped(e){var t=memoize_1(e,(function(e){return r.size===MAX_MEMOIZE_SIZE&&r.clear(),e})),r=t.cache;return t}var _memoizeCapped=memoizeCapped,rePropName=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,reEscapeChar=/\\(\\)?/g,stringToPath=_memoizeCapped((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(rePropName,(function(e,r,a,n){t.push(a?n.replace(reEscapeChar,"$1"):r||e)})),t})),_stringToPath=stringToPath;function arrayMap(e,t){for(var r=-1,a=null==e?0:e.length,n=Array(a);++r<a;)n[r]=t(e[r],r,e);return n}var _arrayMap=arrayMap,INFINITY=1/0,symbolProto$1=_Symbol?_Symbol.prototype:void 0,symbolToString=symbolProto$1?symbolProto$1.toString:void 0;function baseToString(e){if("string"==typeof e)return e;if(isArray_1(e))return _arrayMap(e,baseToString)+"";if(isSymbol_1(e))return symbolToString?symbolToString.call(e):"";var t=e+"";return"0"==t&&1/e==-INFINITY?"-0":t}var _baseToString=baseToString;function toString(e){return null==e?"":_baseToString(e)}var toString_1=toString;function castPath(e,t){return isArray_1(e)?e:_isKey(e,t)?[e]:_stringToPath(toString_1(e))}var _castPath=castPath,INFINITY$1=1/0;function toKey(e){if("string"==typeof e||isSymbol_1(e))return e;var t=e+"";return"0"==t&&1/e==-INFINITY$1?"-0":t}var _toKey=toKey;function baseGet(e,t){for(var r=0,a=(t=_castPath(t,e)).length;null!=e&&r<a;)e=e[_toKey(t[r++])];return r&&r==a?e:void 0}var _baseGet=baseGet;function get(e,t,r){var a=null==e?void 0:_baseGet(e,t);return void 0===a?r:a}var get_1=get;function baseHasIn(e,t){return null!=e&&t in Object(e)}var _baseHasIn=baseHasIn;function hasPath(e,t,r){for(var a=-1,n=(t=_castPath(t,e)).length,o=!1;++a<n;){var i=_toKey(t[a]);if(!(o=null!=e&&r(e,i)))break;e=e[i]}return o||++a!=n?o:!!(n=null==e?0:e.length)&&isLength_1(n)&&_isIndex(i,n)&&(isArray_1(e)||isArguments_1(e))}var _hasPath=hasPath;function hasIn(e,t){return null!=e&&_hasPath(e,t,_baseHasIn)}var hasIn_1=hasIn,COMPARE_PARTIAL_FLAG$5=1,COMPARE_UNORDERED_FLAG$3=2;function baseMatchesProperty(e,t){return _isKey(e)&&_isStrictComparable(t)?_matchesStrictComparable(_toKey(e),t):function(r){var a=get_1(r,e);return void 0===a&&a===t?hasIn_1(r,e):_baseIsEqual(t,a,COMPARE_PARTIAL_FLAG$5|COMPARE_UNORDERED_FLAG$3)}}var _baseMatchesProperty=baseMatchesProperty;function identity(e){return e}var identity_1=identity;function baseProperty(e){return function(t){return null==t?void 0:t[e]}}var _baseProperty=baseProperty;function basePropertyDeep(e){return function(t){return _baseGet(t,e)}}var _basePropertyDeep=basePropertyDeep;function property(e){return _isKey(e)?_baseProperty(_toKey(e)):_basePropertyDeep(e)}var property_1=property;function baseIteratee(e){return"function"==typeof e?e:null==e?identity_1:"object"==typeof e?isArray_1(e)?_baseMatchesProperty(e[0],e[1]):_baseMatches(e):property_1(e)}var _baseIteratee=baseIteratee;function mapValues(e,t){var r={};return t=_baseIteratee(t),_baseForOwn(e,(function(e,a,n){_baseAssignValue(r,a,t(e,a,n))})),r}var mapValues_1=mapValues,isUnitlessNumber={boxFlex:!0,boxFlexGroup:!0,columnCount:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,strokeDashoffset:!0,strokeOpacity:!0,strokeWidth:!0};function prefixKey(e,t){return e+t.charAt(0).toUpperCase()+t.substring(1)}var prefixes=["Webkit","ms","Moz","O"];Object.keys(isUnitlessNumber).forEach((function(e){prefixes.forEach((function(t){isUnitlessNumber[prefixKey(t,e)]=isUnitlessNumber[e]}))}));var shorthandPropertyExpansions={background:{backgroundImage:!0,backgroundPosition:!0,backgroundRepeat:!0,backgroundColor:!0},border:{borderWidth:!0,borderStyle:!0,borderColor:!0},borderBottom:{borderBottomWidth:!0,borderBottomStyle:!0,borderBottomColor:!0},borderLeft:{borderLeftWidth:!0,borderLeftStyle:!0,borderLeftColor:!0},borderRight:{borderRightWidth:!0,borderRightStyle:!0,borderRightColor:!0},borderTop:{borderTopWidth:!0,borderTopStyle:!0,borderTopColor:!0},font:{fontStyle:!0,fontVariant:!0,fontWeight:!0,fontSize:!0,lineHeight:!0,fontFamily:!0}},CSSProperty={isUnitlessNumber:isUnitlessNumber,shorthandPropertyExpansions:shorthandPropertyExpansions},CSSProperty_1=CSSProperty;function isNumber(e){return"number"==typeof e}var N,L,C,D,w,M,normalizeCss=function(e){var t=e.css,r={};return Object.entries(t).forEach((function(e){var t=e[0],a=e[1];if(isNumber(a))return CSSProperty_1.isUnitlessNumber[t]?void(r[t]=""+a):void(r[t]=a+"px");r[t]=a})),__assign(__assign({},e),{css:__assign(__assign({},r),{boxSizing:"border-box"})})},typographyNode=function(e){var t=get_1(e,"data.custom.variant","P");return __assign(__assign({},e),{type:t})},normalizeFlexBasis=function(e){var t=e.css.flexBasis;return"0"===t||"0px"===t?__assign(__assign({},e),{css:__assign(__assign({},e.css),{flexBasis:"0%"})}):e},adaptCustomNodes=function(e){return mapValues_1(e,(function(e){var t=e;return"Typography"===t.type&&(t=typographyNode(t)),t.css&&isObject_1(t.css)&&t.css.flexBasis&&(t=normalizeFlexBasis(t)),t.css&&(t=normalizeCss(t)),t}))},TutorialDependencies=function(){function e(e){this.adjacencyList={},this.rootDocument=e,this.adjacencyList[e]=[]}return e.prototype.get=function(e){return this.adjacencyList[e]},e.prototype.add=function(e,t){var r=this;if(this.adjacencyList[e]||(this.adjacencyList[e]=[]),!this.adjacencyList[t])return this.adjacencyList[e].push(t),this.adjacencyList[t]=[],!0;if(this.adjacencyList[e].includes(t))return!0;var a=function(t){if(t===e)return!0;for(var n=0,o=r.adjacencyList[t];n<o.length;n++){var i=o[n];if(a(i))return!0}return!1};return!a(t)&&(this.adjacencyList[e].push(t),!0)},e}(),createTutorialDocumentContext=function(e,t){return{id:e,dependencies:t?t.dependencies:new TutorialDependencies(e)}},checkCyclicAndAdd=function(e,t){return e.dependencies.add(e.id,t)},n="Everyone",e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t="object"==typeof e&&e&&e.Object===Object&&e,r="object"==typeof self&&self&&self.Object===Object&&self,o=(t||r||Function("return this")()).Symbol,i=Object.prototype,u=i.hasOwnProperty,a=i.toString,c=o?o.toStringTag:void 0,l=function(e){var t=u.call(e,c),r=e[c];try{e[c]=void 0;var n=!0}catch(e){}var o=a.call(e);return n&&(t?e[c]=r:delete e[c]),o},E=Object.prototype.toString,f=function(e){return E.call(e)},s="[object Null]",d="[object Undefined]",v=o?o.toStringTag:void 0,p=function(e){return null==e?void 0===e?d:s:v&&v in Object(e)?l(e):f(e)},T=Array.isArray,O=function(e){return null!=e&&"object"==typeof e},A="[object String]",g=function(e){return"string"==typeof e||!T(e)&&O(e)&&p(e)==A},m="[object Number]",S=function(e){return"number"==typeof e||O(e)&&p(e)==m},_=/^([a-zA-Z0-9]|_|-)+$/,y=function(e){return g(e)&&e.length>=3&&e.length<100&&_.test(e)},P=function(e){return S(e)&&e>=0},b=function(e){return g(e)&&!!e.match(/^[0-9a-zA-Z]*$/)&&e.length>=10},I=function(e){return P(e)||g(e)&&e.trim().length>0};!function(e){e.SDK="SDK",e.PREVIEW="PREVIEW"}(N||(N={})),function(e){e.BOOTSTRAP="Bootstrap",e.CHANGE_POSITION="ChangePosition",e.CLOSE_PREVIEW="ClosePreview",e.PREVIEW_LOADED="PreviewLoaded",e.SET_AVALIABLE_PORTALS="SetAvaliablePortals",e.SET_CONTENT="SetContent",e.SET_SELECTED_ELEMENT="SetSelectedElement",e.SET_VIEW_MODE="SetViewMode",e.ADD_ELEMENT="AddElement",e.REMOVE_ELEMENT="RemoveElement",e.UPDATE_ELEMENT="UpdateElement",e.SET_ELEMENT="SetElement"}(L||(L={})),(C||(C={})).ON_CLICK="OnClick",function(e){e.NATIVE="Native",e.PENDO="Pendo"}(D||(D={})),function(e){e.NAVIGATE="Navigate",e.CHANGE_TUTORIAL="ChangeTutorial",e.OPEN_GUIDE="OpenGuide"}(w||(w={})),function(e){e.PRIMARY="primary",e.SECONDARY="primary",e.WARNING="warning",e.DANGER="danger",e.NEUTRAL="neutral",e.ACTIVE="active",e.INFO="info"}(M||(M={}));var G,B=M.PRIMARY;!function(e){e.U="U",e.B="B",e.Em="Em",e.InlineCode="InlineCode"}(G||(G={}));var x,F,Q,nn,z=function(e){return g(e)&&!!e.match(/^[0-9a-zA-Z]{40}$/)},H=function(e){return P(e)},K=function(e){return y(e)};!function(e){e.COLLAPSED="Collapsed",e.EXPANDED="Expanded",e.MINIMIZED="Minimized"}(x||(x={})),function(e){e.TUTORIAL="Tutorial",e.PORTAL="Portal"}(F||(F={})),function(e){e.Global="Global",e.Organization="Organization"}(Q||(Q={})),function(e){e.Root="root",e.Rule="rule",e.Atrule="atrule",e.Decl="decl",e.Any="any"}(nn||(nn={}));for(var _a,createLookup=function(e){return e.reduce((function(e,t){var r;return __assign(__assign({},e),((r={})[t]=t,r))}),{})},findMatchingSegment=function(e,t){var r=createLookup(t);return e.content.find((function(e){var t=e.segmentId;return!!r[t]||t===n}))},eventPrefix=function(e){return"candu.sdk."+e},errorPrefix=function(e){return eventPrefix("error."+e)},ERROR_SLUGS={UNKOWN_NODE_TYPE:"unknown_node_type",UNKOWN_BLOCK_NODE_TYPE:"unkown_block_node_type",UNKOWN_INLINE_NODE_TYPE:"unkown_inline_node_type",UNKOWN_NODE_OBJECT_TYPE:"unkown_node_object_type",TUTORIAL_ERROR:"tutorial_error_boundary",PORTAL_ERROR:"portal_error_boundary",PROVIDER_ERROR:"provider_error_boundary",STYLEGUIDE_MAP_ERROR:"styleguide_map",RENDER_NODE_ERROR:"render_node"},EVENT_NAMES={HEARTBEAT:eventPrefix("heartbeat"),PREVIEW_OPEN:eventPrefix("preview.open"),PORTAL:eventPrefix("portal"),TUTORIAL:eventPrefix("tutorial"),TUTORIAL_INTERACTION:eventPrefix("tutorial.interaction"),PORTAL_ASSET_NOT_FOUND:errorPrefix("portal_asset_not_found"),PORTAL_NO_SEGMENT_IDS:errorPrefix("portal_no_segment_ids"),NO_MATCHING_TUTORIALS:errorPrefix("no_matching_tutorials"),NO_VALID_TUTORIAL_IDENTIFIER:errorPrefix("no_valid_tutorial_identifier"),COMMIT_API_LOADING_ERROR:errorPrefix("commit_api"),TUTORIAL_LOADING_ERROR:errorPrefix("tutorial"),UNKOWN_NODE_TYPE:errorPrefix(ERROR_SLUGS.UNKOWN_NODE_TYPE),UNKOWN_INLINE_NODE_TYPE:errorPrefix(ERROR_SLUGS.UNKOWN_INLINE_NODE_TYPE),UNKOWN_NODE_OBJECT_TYPE:errorPrefix(ERROR_SLUGS.UNKOWN_NODE_OBJECT_TYPE),TUTORIAL_ERROR:errorPrefix(ERROR_SLUGS.TUTORIAL_ERROR),PORTAL_ERROR:errorPrefix(ERROR_SLUGS.PORTAL_ERROR),PROVIDER_ERROR:errorPrefix(ERROR_SLUGS.PROVIDER_ERROR),STYLEGUIDE_MAP_ERROR:errorPrefix(ERROR_SLUGS.TUTORIAL_ERROR),RENDER_NODE_ERROR:errorPrefix(ERROR_SLUGS.TUTORIAL_ERROR),CIRCULAR_DEPENDENCY_EMBED_PORTAL:errorPrefix("circular_dependecy_embed_portal"),CIRCULAR_DEPENDENCY_EMBED_TUTORIAL:errorPrefix("circular_dependecy_embed_tutorial")},PORTAL_ASSET_NOT_FOUND="Could not find the requested Portal. This could happen because:\n1. The Portal does not exist or it was deleted.\n2. The Portal has not been made avaliable to be rendered.\n3. CORS Authenticaton failed.\nSee http://udn.ac/portal-not-found for more information.\n",unknownMessage=function(e){return"An error has occured while trying to parse your Tutorial.\nUpgrade the SDK to the latest version to get rid of this error.\nErrorCode: "+e+"."},EVENTING_NOT_INITIALIZED="You tried to send an event, but you haven't initialized eventing.\nThis is happening because you called eventing outside the scope of the CanduProvider. It can be fixed by:\n1. Adding CanduProvider to the root of the application.\n2. Initializing a new Eventing object outside of Candu.\nRead here for more context: http://udn.ac/tracking-not-init.\n",PORTAL_NO_SEGMENT_IDS="You have tried to render a Portal that doesn't contain any content.\nAdd content to your Portal: https://udn.ac/update-portals.\n",NO_MATCHING_TUTORIALS="The Tutorial will not be rendered because there are no matching segments for the given user.",ERROR_MESSAGES=((_a={EVENTING_NOT_INITIALIZED:EVENTING_NOT_INITIALIZED})[EVENT_NAMES.PORTAL_ASSET_NOT_FOUND]=PORTAL_ASSET_NOT_FOUND,_a[EVENT_NAMES.PORTAL_NO_SEGMENT_IDS]=PORTAL_NO_SEGMENT_IDS,_a[EVENT_NAMES.NO_MATCHING_TUTORIALS]=NO_MATCHING_TUTORIALS,_a[EVENT_NAMES.NO_VALID_TUTORIAL_IDENTIFIER]="(Candu/Tutorial) You must define one of tutorialId, slug, commitId or contentHashId.",_a[EVENT_NAMES.TUTORIAL_LOADING_ERROR]="An error has occurred while trying to load the Tutorial",_a[EVENT_NAMES.UNKOWN_INLINE_NODE_TYPE]=unknownMessage(ERROR_SLUGS.UNKOWN_INLINE_NODE_TYPE),_a[EVENT_NAMES.UNKOWN_NODE_TYPE]=unknownMessage(ERROR_SLUGS.UNKOWN_NODE_TYPE),_a[EVENT_NAMES.CIRCULAR_DEPENDENCY_EMBED_PORTAL]="Circular dependency found on Embeded Portal. Please take a look at the Portal Content.",_a[EVENT_NAMES.CIRCULAR_DEPENDENCY_EMBED_TUTORIAL]="Circular dependency found on Embeded Tutorial. Please take a look at the Tutorial Content.",_a[EVENT_NAMES.PORTAL_ERROR]="An error has occured within Portal",_a[EVENT_NAMES.PROVIDER_ERROR]="An error has occured within Provider",_a[EVENT_NAMES.TUTORIAL_ERROR]="An error has occured within Tutorial",_a[EVENT_NAMES.RENDER_NODE_ERROR]="An error has occured while rendering tutorial node",_a[EVENT_NAMES.STYLEGUIDE_MAP_ERROR]="An error has occured while mapping node to styleguide",_a),defaultStyleguide={Alert:!0,B:!0,Badge:!0,Button:!0,Card:!0,Code:!0,Document:!0,Em:!0,EmbedPortal:!0,EmbedTutorial:!0,Flex:!0,FlexItem:!0,H1:!0,H2:!0,H3:!0,H4:!0,H5:!0,H6:!0,Image:!0,InlineCode:!0,Link:!0,List:!0,ListItem:!0,P:!0,RichText:!0,Spacing:!0,Text:!0,U:!0,View:!0,Player:!0},trackStyleguideProperties=function(e){var t={};return Object.keys(e).forEach((function(r){defaultStyleguide[r]&&(t["styleguide."+r]=e[r].displayName||!0)})),t},LOGGER={error:console.error,warning:console.warn},internalEventing=function(e){var t=e.identify,r=e.track;return{provider:function(e){var a=e.userId,n=e.traits,o=e.styleguide;t(a,n),r(EVENT_NAMES.HEARTBEAT,trackStyleguideProperties(o))},tutorialDocumentLoadingError:function(e){var t=e.tutorialId,a=e.slug,n=e.contentHashId;LOGGER.error(ERROR_MESSAGES[EVENT_NAMES.TUTORIAL_LOADING_ERROR]),r(EVENT_NAMES.TUTORIAL_LOADING_ERROR,{tutorialId:t,slug:a,contentHashId:n})}}},e$1=function(e,t){return function(e){var t="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(t){var r=new Uint8Array(16);e.exports=function(){return t(r),r}}else{var a=new Array(16);e.exports=function(){for(var e,t=0;t<16;t++)0==(3&t)&&(e=4294967296*Math.random()),a[t]=e>>>((3&t)<<3)&255;return a}}}(t={exports:{}}),t.exports}(),n$1=[],t$1=0;t$1<256;++t$1)n$1[t$1]=(t$1+256).toString(16).substr(1);var a$1,i$1,r$1=function(e,t){var r=t||0,a=n$1;return[a[e[r++]],a[e[r++]],a[e[r++]],a[e[r++]],"-",a[e[r++]],a[e[r++]],"-",a[e[r++]],a[e[r++]],"-",a[e[r++]],a[e[r++]],"-",a[e[r++]],a[e[r++]],a[e[r++]],a[e[r++]],a[e[r++]],a[e[r++]]].join("")},o$1=function(e,t,r){var a=t&&r||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null);var n=(e=e||{}).random||(e.rng||e$1)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t)for(var o=0;o<16;++o)t[a+o]=n[o];return t||r$1(n)};!function(e){e.UserGenerated="UserGenerated",e.SDK="SDK"}(a$1||(a$1={})),function(e){e.Identify="Identify",e.Group="Group",e.Track="Track",e.Page="Page",e.Screen="Screen"}(i$1||(i$1={}));var u$1,c$1,d$1=function(){return"undefined"!=typeof window&&window.localStorage},p$1=function(e){return function(t){d$1()&&null!=t&&window.localStorage.setItem(e,JSON.stringify(t))}},l$1={anonymousId:{getOrCreate:(u$1="candu:anonymous_id",c$1=function(){var e=o$1();return p$1("candu:anonymous_id")(e),e},function(){return function(e){return function(){if(d$1()){var t=window.localStorage.getItem(e);if(t)try{return JSON.parse(t)}catch(e){return null}}}}(u$1)()||c$1()}),set:p$1("candu:anonymous_id")}},h=l$1.anonymousId.getOrCreate,invariant=function(e,t,r,a,n,o,i,s){if(!e){var c;if(void 0===t)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=[r,a,n,o,i,s],_=0;(c=new Error(t.replace(/%s/g,(function(){return u[_++]})))).name="Invariant Violation"}throw c.framesToPop=1,c}},browser=invariant,isValidStyleguideProps=function(e){return browser(!e||isObject_1(e),"(Candu) styleguide must be undefined or an object")},providerValidation=function(e){var t=e.clientToken,r=e.userId,a=e.traits,n=e.options,o=e.styleguide,i=__rest(e,["clientToken","userId","traits","options","styleguide"]);return browser(b(t),"(Candu) you must provide a valid clientToken"),browser(!r||I(r),"(Candu) you must provide a valid userId"),isValidStyleguideProps(o),browser(!a||isObject_1(a),"(Candu) traits must be undefined or an object"),browser(!n||isObject_1(n),"(Candu) options must be undefined or an object"),__assign(__assign({},i),{clientToken:t,traits:a||{},options:n||{},styleguide:o||{},userId:r||h()})},tutorialValidation=function(e){var t=e.slug,r=e.styleguide,a=e.contentHashId,n=e.tutorialId,o=e.tutorialDocument,i=e.renderedByClient,s=__rest(e,["slug","styleguide","contentHashId","tutorialId","tutorialDocument","renderedByClient"]);return isValidStyleguideProps(r),__assign(__assign({},s),{slug:t,styleguide:r||{},contentHashId:a,tutorialId:n,tutorialDocument:o,renderedByClient:i})},portalValidation=function(e){var t=e.slug,r=e.styleguide;return isValidStyleguideProps(r),{slug:t,styleguide:r||{}}};const API_BASE_URL="https://api.candu.ai",CDN_BASE_URL="https://cdn.candu.ai";var API_BASE_URL$1=API_BASE_URL,CDN_BASE_URL$1=CDN_BASE_URL,ENDPOINTS={segmentMembership:"/api/segmentMemberships",segmentsDefinition:"/api/segmentsDefinition",tutorialMetadata:"/api/tutorialMetadata",tutorialDocuments:"/api/tutorialDocumentsSdk",tutorialProdSocket:"wss://2jcfb7pjlf.execute-api.eu-west-1.amazonaws.com/prod"},fetchURL=function(e){return __awaiter(void 0,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:return[4,fetch(e)];case 1:return[2,t.sent().json()]}}))}))},fetchFromApi=function(e){return fetchURL(""+API_BASE_URL$1+e)},fetchFromCdn=function(e){return fetchURL(""+CDN_BASE_URL$1+e)},getTutorialDocument=function(e){return{byId:function(t){return fetchFromApi(ENDPOINTS.tutorialDocuments+"?token="+e+"&finder=latestPublished&tutorialId="+t)},bySlug:function(t){return fetchFromCdn("/tutorials/"+e+"/"+t+".json")},byContentHash:function(t){return fetchFromCdn("/tutorials/"+e+"/"+t+".json")}}},RESOURCES={tutorialDocumentLatestSaved:function(e,t){return __awaiter(void 0,void 0,void 0,(function(){return __generator(this,(function(r){return[2,fetchFromApi(ENDPOINTS.tutorialDocuments+"/"+t+"?token="+e)]}))}))},portalAsset:function(e,t){return __awaiter(void 0,void 0,void 0,(function(){return __generator(this,(function(r){return[2,fetchFromCdn("/portals/"+e+"/"+t+"/head.json")]}))}))},segmentMembership:function(e,t){return __awaiter(void 0,void 0,void 0,(function(){return __generator(this,(function(r){return[2,fetchFromApi(ENDPOINTS.segmentMembership+"/"+t+"?token="+e)]}))}))},segmentDefinition:function(e){return __awaiter(void 0,void 0,void 0,(function(){return __generator(this,(function(t){return[2,fetchFromApi(ENDPOINTS.segmentsDefinition+"?token="+e)]}))}))},tutorialMetadata:function(e){return __awaiter(void 0,void 0,void 0,(function(){return __generator(this,(function(t){return[2,fetchFromApi(ENDPOINTS.tutorialMetadata+"?token="+e)]}))}))},tutorialSocket:function(e,t,r){var a=ENDPOINTS.tutorialProdSocket+"?clientToken="+e+"&tutorialId="+t,n=new WebSocket(a);return n.onmessage=function(e){var t=JSON.parse(e.data);r(t)},function(){return n.close()}},tutorialDocument:function(e,t,r){var a=e.contentHashId,n=e.tutorialId,o=e.tutorialDocument,i=e.slug,s=getTutorialDocument(t);return K(i)?s.bySlug(i):H(n)?s.byId(n):z(a)?s.byContentHash(a):isObject_1(o)?Promise.resolve(o):(LOGGER.error(ERROR_MESSAGES[EVENT_NAMES.NO_VALID_TUTORIAL_IDENTIFIER]),r.track(EVENT_NAMES.NO_VALID_TUTORIAL_IDENTIFIER,{slug:e.slug}),null)}},logError=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return console.error.apply(console,e)},logWarning=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return console.warn.apply(console,e)},logger={error:logError,warning:logWarning},stripHTML=function(e){return DOMParser?(new DOMParser).parseFromString(e,"text/html").body.textContent||"":e},Observer=function(){function e(){this.subscribers=[]}return e.prototype.subscribe=function(e){var t=this;return this.subscribers.push(e),function(){t.subscribers[t.subscribers.indexOf(e)]=function(){}}},e.prototype.notify=function(e){this.subscribers.forEach((function(t){return t(e)}))},e.prototype.clear=function(){this.subscribers=[]},e}(),PreviewContainer=function(){function e(){this.onClientUpdateObserver=new Observer}return e.prototype.attachClient=function(e){this.client=e,this.onClientUpdateObserver.notify({client:e})},e.prototype.detachClient=function(){this.client=null,this.onClientUpdateObserver.notify({client:null})},e.prototype.onClientUpdate=function(e){var t=this.onClientUpdateObserver.subscribe(e);return this.client&&e({client:this.client}),t},e}();function createSingleton(e){var t,r,a=function(e){return function(){for(var t,a=[],n=0;n<arguments.length;n++)a[n]=arguments[n];if(r.api)return(t=r.api)[e].apply(t,a);console.warn("Please initialize the SDK by calling Candu.init() before attempting to call "+e)}};return(t=function(){function t(){}return t.init=function(){for(var r=[],a=0;a<arguments.length;a++)r[a]=arguments[a];return this.api||(t.api=new(e.bind.apply(e,__spreadArrays([void 0],r)))),t.subscriberCallbacks.forEach((function(e){return e()})),t.subscriberCallbacks=[],window.postMessage({source:"CANDU_SINGLETON",payload:{type:"INIT"}},window&&window.origin?window.origin:"*"),t},t.onProviderReady=function(e){if(t.api)return e();t.subscriberCallbacks.push(e)},t}()).subscriberCallbacks=[],t.renderTutorial=a("renderTutorial"),t.renderPortal=a("renderPortal"),t.attachClient=a("attachClient"),t.detachClient=a("detachClient"),t.getProvider=a("getProvider"),r=t,window.Candu=r,r}var SingletonAPI=function(){function e(e){this.init(e)}return e.prototype.attachClient=function(e){return this.provider.preview.attachClient(e)},e.prototype.detachClient=function(){return this.provider.preview.detachClient()},Object.defineProperty(e.prototype,"provider",{get:function(){return this.getProvider()},enumerable:!0,configurable:!0}),e}(),getEventHandler=function(e){switch(e.trigger){case C.ON_CLICK:default:return"onClick"}},getActionHandler=function(e,t){var r,a,n;switch(e.handler.type){case w.NAVIGATE:return(r={})[getEventHandler(e)]=function(){var r=e.handler,a=r.href,n=r.target;t(e),"Blank"===n?window.open(a,"_blank"):a&&a.includes("mailto:")?window.location=a:document.location.href=a},r;case w.CHANGE_TUTORIAL:return(a={})[getEventHandler(e)]=function(){var t=e.handler.tutorialId;logError("TODO -> change tutorial",t)},a;case w.OPEN_GUIDE:return(n={})[getEventHandler(e)]=function(){var t=e.handler.guideId;logError("TODO -> open guide",t)},n;default:return{}}},getActionHandlers=function(e,t){var r=e.data;if(!r||!r.actions)return{};var a=function(e){t.provider.eventing.track(EVENT_NAMES.TUTORIAL_INTERACTION,__assign(__assign({},e),t.trackingIdentifiers||{}))};return r.actions.map((function(e){return getActionHandler(e,a)})).reduce((function(e,t){return __assign(__assign({},e),t)}),{})},getChildren=function(e,t){var r=e.props||{},a=e.nodes,n=r.children;return n?"string"==typeof n?stripHTML(n):n:a?a.map(t):null},mapNodeToStyleguide=function(e,t){try{var r=t.provider,a=t.document,n=t.trackingIdentifiers,o=a.nodes[e];if(!o)return logger.error("Document is corrupted. Refusing to move further."),null;var i=function(e){return mapNodeToStyleguide(e,t)},s=o.type,c=o.props,u=o.css,_=__assign(__assign(__assign({},c||{}),{style:u||{},children:getChildren(o,i)}),getActionHandlers(o,{trackingIdentifiers:n,provider:r})),l={nodeId:e,node:o,document:a,render:{node:i,styleguide:function(e,r){return void 0===r&&(r={}),t.renderNode(e,{api:l,attributes:r})},tutorial:function(e){return t.renderTutorial(e)},portal:function(e){return t.renderPortal(e)}},trackingIdentifiers:n},p=l.render.styleguide(s,_);return p||(logger.error(ERROR_MESSAGES[EVENT_NAMES.UNKOWN_NODE_TYPE],{type:s}),r.eventing.track(EVENT_NAMES.UNKOWN_NODE_TYPE,{type:s}),null)}catch(e){return logger.error(ERROR_MESSAGES[EVENT_NAMES.STYLEGUIDE_MAP_ERROR],e),null}},mergeStyleguidesFromContext=memoize_1((function(e,t){var r,a,n=e.provider,o=e.portal,i=e.tutorial,s=n.styleguide;return i&&(a=i.styleguide),o&&(r=o.styleguide),__assign(__assign(__assign(__assign({},s||{}),r||{}),a||{}),t||{})})),DEFAULT_ALT="",DEFAULT_ALERT_COLOR="#EDEDED",DEFAULT_TAB_HEADER_COLOR="#333745",DEFAULT_TAB_ITEM_COLOR="#838792",DEFAULT_TAB_ACTIVE_COLOR="#FEFEFE",DEFAULT_TAB_COLOR="#FEFEFE",STYLEGUIDE_COLORS={primary:"#6310E5",secondary:"#59C3C3",tertiary:"#4D515D",warning:"#FCAD0D",danger:"#EE4266"},attachStylesheet=function(e){var t=document.createElement("link");t.setAttribute("rel","stylesheet"),t.setAttribute("href",CDN_BASE_URL$1+"/styleguides/applications/"+e+"/default/main.css"),document.head.appendChild(t)};exports.DEFAULT_ALERT_COLOR=DEFAULT_ALERT_COLOR,exports.DEFAULT_ALT=DEFAULT_ALT,exports.DEFAULT_TAB_ACTIVE_COLOR=DEFAULT_TAB_ACTIVE_COLOR,exports.DEFAULT_TAB_COLOR=DEFAULT_TAB_COLOR,exports.DEFAULT_TAB_HEADER_COLOR=DEFAULT_TAB_HEADER_COLOR,exports.DEFAULT_TAB_ITEM_COLOR=DEFAULT_TAB_ITEM_COLOR,exports.ERROR_MESSAGES=ERROR_MESSAGES,exports.ERROR_SLUGS=ERROR_SLUGS,exports.EVENT_NAMES=EVENT_NAMES,exports.LOGGER=LOGGER,exports.Observer=Observer,exports.PreviewContainer=PreviewContainer,exports.RESOURCES=RESOURCES,exports.STYLEGUIDE_COLORS=STYLEGUIDE_COLORS,exports.SingletonAPI=SingletonAPI,exports.TutorialDependencies=TutorialDependencies,exports.adaptCustomNodes=adaptCustomNodes,exports.attachStylesheet=attachStylesheet,exports.checkCyclicAndAdd=checkCyclicAndAdd,exports.createSingleton=createSingleton,exports.createTutorialDocumentContext=createTutorialDocumentContext,exports.defaultStyleguide=defaultStyleguide,exports.findMatchingSegment=findMatchingSegment,exports.internalEventing=internalEventing,exports.logError=logError,exports.logWarning=logWarning,exports.logger=logger,exports.mapNodeToStyleguide=mapNodeToStyleguide,exports.mergeStyleguidesFromContext=mergeStyleguidesFromContext,exports.normalizeCss=normalizeCss,exports.portalValidation=portalValidation,exports.providerValidation=providerValidation,exports.stripHTML=stripHTML,exports.tutorialValidation=tutorialValidation;
//# sourceMappingURL=index.cjs.js.map

@@ -15,3 +15,3 @@ /*! *****************************************************************************

***************************************************************************** */
var t=function(){return(t=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function e(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r}function r(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){t.done?o(t.value):new r((function(e){e(t.value)})).then(a,u)}c((n=n.apply(t,e||[])).next())}))}function n(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}function o(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;var n=Array(t),o=0;for(e=0;e<r;e++)for(var i=arguments[e],a=0,u=i.length;a<u;a++,o++)n[o]=i[a];return n}var i="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function a(t,e){return t(e={exports:{}},e.exports),e.exports}var u="object"==typeof i&&i&&i.Object===Object&&i,c="object"==typeof self&&self&&self.Object===Object&&self,s=u||c||Function("return this")(),l=s.Symbol,f=Object.prototype,d=f.hasOwnProperty,p=f.toString,v=l?l.toStringTag:void 0;var h=function(t){var e=d.call(t,v),r=t[v];try{t[v]=void 0;var n=!0}catch(t){}var o=p.call(t);return n&&(e?t[v]=r:delete t[v]),o},y=Object.prototype.toString;var _=function(t){return y.call(t)},b="[object Null]",g="[object Undefined]",E=l?l.toStringTag:void 0;var O=function(t){return null==t?void 0===t?g:b:E&&E in Object(t)?h(t):_(t)};var T=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)},R="[object AsyncFunction]",I="[object Function]",m="[object GeneratorFunction]",N="[object Proxy]";var A,j=function(t){if(!T(t))return!1;var e=O(t);return e==I||e==m||e==R||e==N},w=s["__core-js_shared__"],P=(A=/[^.]+$/.exec(w&&w.keys&&w.keys.IE_PROTO||""))?"Symbol(src)_1."+A:"";var D=function(t){return!!P&&P in t},C=Function.prototype.toString;var L=function(t){if(null!=t){try{return C.call(t)}catch(t){}try{return t+""}catch(t){}}return""},S=/^\[object .+?Constructor\]$/,U=Function.prototype,k=Object.prototype,x=U.toString,M=k.hasOwnProperty,z=RegExp("^"+x.call(M).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var W=function(t){return!(!T(t)||D(t))&&(j(t)?z:S).test(L(t))};var B=function(t,e){return null==t?void 0:t[e]};var G=function(t,e){var r=B(t,e);return W(r)?r:void 0},V=function(){try{var t=G(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();var F=function(t,e,r){"__proto__"==e&&V?V(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r};var Y=function(t){return function(e,r,n){for(var o=-1,i=Object(e),a=n(e),u=a.length;u--;){var c=a[t?u:++o];if(!1===r(i[c],c,i))break}return e}}();var K=function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n};var H=function(t){return null!=t&&"object"==typeof t},$="[object Arguments]";var J=function(t){return H(t)&&O(t)==$},Z=Object.prototype,q=Z.hasOwnProperty,X=Z.propertyIsEnumerable,Q=J(function(){return arguments}())?J:function(t){return H(t)&&q.call(t,"callee")&&!X.call(t,"callee")},tt=Array.isArray;var et=function(){return!1},rt=a((function(t,e){var r=e&&!e.nodeType&&e,n=r&&t&&!t.nodeType&&t,o=n&&n.exports===r?s.Buffer:void 0,i=(o?o.isBuffer:void 0)||et;t.exports=i})),nt=9007199254740991,ot=/^(?:0|[1-9]\d*)$/;var it=function(t,e){var r=typeof t;return!!(e=null==e?nt:e)&&("number"==r||"symbol"!=r&&ot.test(t))&&t>-1&&t%1==0&&t<e},at=9007199254740991;var ut=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=at},ct={};ct["[object Float32Array]"]=ct["[object Float64Array]"]=ct["[object Int8Array]"]=ct["[object Int16Array]"]=ct["[object Int32Array]"]=ct["[object Uint8Array]"]=ct["[object Uint8ClampedArray]"]=ct["[object Uint16Array]"]=ct["[object Uint32Array]"]=!0,ct["[object Arguments]"]=ct["[object Array]"]=ct["[object ArrayBuffer]"]=ct["[object Boolean]"]=ct["[object DataView]"]=ct["[object Date]"]=ct["[object Error]"]=ct["[object Function]"]=ct["[object Map]"]=ct["[object Number]"]=ct["[object Object]"]=ct["[object RegExp]"]=ct["[object Set]"]=ct["[object String]"]=ct["[object WeakMap]"]=!1;var st=function(t){return H(t)&&ut(t.length)&&!!ct[O(t)]};var lt=function(t){return function(e){return t(e)}},ft=a((function(t,e){var r=e&&!e.nodeType&&e,n=r&&t&&!t.nodeType&&t,o=n&&n.exports===r&&u.process,i=function(){try{var t=n&&n.require&&n.require("util").types;return t||o&&o.binding&&o.binding("util")}catch(t){}}();t.exports=i})),dt=ft&&ft.isTypedArray,pt=dt?lt(dt):st,vt=Object.prototype.hasOwnProperty;var ht=function(t,e){var r=tt(t),n=!r&&Q(t),o=!r&&!n&&rt(t),i=!r&&!n&&!o&&pt(t),a=r||n||o||i,u=a?K(t.length,String):[],c=u.length;for(var s in t)!e&&!vt.call(t,s)||a&&("length"==s||o&&("offset"==s||"parent"==s)||i&&("buffer"==s||"byteLength"==s||"byteOffset"==s)||it(s,c))||u.push(s);return u},yt=Object.prototype;var _t=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||yt)};var bt=function(t,e){return function(r){return t(e(r))}}(Object.keys,Object),gt=Object.prototype.hasOwnProperty;var Et=function(t){if(!_t(t))return bt(t);var e=[];for(var r in Object(t))gt.call(t,r)&&"constructor"!=r&&e.push(r);return e};var Ot=function(t){return null!=t&&ut(t.length)&&!j(t)};var Tt=function(t){return Ot(t)?ht(t):Et(t)};var Rt=function(t,e){return t&&Y(t,e,Tt)};var It=function(){this.__data__=[],this.size=0};var mt=function(t,e){return t===e||t!=t&&e!=e};var Nt=function(t,e){for(var r=t.length;r--;)if(mt(t[r][0],e))return r;return-1},At=Array.prototype.splice;var jt=function(t){var e=this.__data__,r=Nt(e,t);return!(r<0)&&(r==e.length-1?e.pop():At.call(e,r,1),--this.size,!0)};var wt=function(t){var e=this.__data__,r=Nt(e,t);return r<0?void 0:e[r][1]};var Pt=function(t){return Nt(this.__data__,t)>-1};var Dt=function(t,e){var r=this.__data__,n=Nt(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this};function Ct(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Ct.prototype.clear=It,Ct.prototype.delete=jt,Ct.prototype.get=wt,Ct.prototype.has=Pt,Ct.prototype.set=Dt;var Lt=Ct;var St=function(){this.__data__=new Lt,this.size=0};var Ut=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r};var kt=function(t){return this.__data__.get(t)};var xt=function(t){return this.__data__.has(t)},Mt=G(s,"Map"),zt=G(Object,"create");var Wt=function(){this.__data__=zt?zt(null):{},this.size=0};var Bt=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},Gt="__lodash_hash_undefined__",Vt=Object.prototype.hasOwnProperty;var Ft=function(t){var e=this.__data__;if(zt){var r=e[t];return r===Gt?void 0:r}return Vt.call(e,t)?e[t]:void 0},Yt=Object.prototype.hasOwnProperty;var Kt=function(t){var e=this.__data__;return zt?void 0!==e[t]:Yt.call(e,t)},Ht="__lodash_hash_undefined__";var $t=function(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=zt&&void 0===e?Ht:e,this};function Jt(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Jt.prototype.clear=Wt,Jt.prototype.delete=Bt,Jt.prototype.get=Ft,Jt.prototype.has=Kt,Jt.prototype.set=$t;var Zt=Jt;var qt=function(){this.size=0,this.__data__={hash:new Zt,map:new(Mt||Lt),string:new Zt}};var Xt=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t};var Qt=function(t,e){var r=t.__data__;return Xt(e)?r["string"==typeof e?"string":"hash"]:r.map};var te=function(t){var e=Qt(this,t).delete(t);return this.size-=e?1:0,e};var ee=function(t){return Qt(this,t).get(t)};var re=function(t){return Qt(this,t).has(t)};var ne=function(t,e){var r=Qt(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this};function oe(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}oe.prototype.clear=qt,oe.prototype.delete=te,oe.prototype.get=ee,oe.prototype.has=re,oe.prototype.set=ne;var ie=oe,ae=200;var ue=function(t,e){var r=this.__data__;if(r instanceof Lt){var n=r.__data__;if(!Mt||n.length<ae-1)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new ie(n)}return r.set(t,e),this.size=r.size,this};function ce(t){var e=this.__data__=new Lt(t);this.size=e.size}ce.prototype.clear=St,ce.prototype.delete=Ut,ce.prototype.get=kt,ce.prototype.has=xt,ce.prototype.set=ue;var se=ce,le="__lodash_hash_undefined__";var fe=function(t){return this.__data__.set(t,le),this};var de=function(t){return this.__data__.has(t)};function pe(t){var e=-1,r=null==t?0:t.length;for(this.__data__=new ie;++e<r;)this.add(t[e])}pe.prototype.add=pe.prototype.push=fe,pe.prototype.has=de;var ve=pe;var he=function(t,e){for(var r=-1,n=null==t?0:t.length;++r<n;)if(e(t[r],r,t))return!0;return!1};var ye=function(t,e){return t.has(e)},_e=1,be=2;var ge=function(t,e,r,n,o,i){var a=r&_e,u=t.length,c=e.length;if(u!=c&&!(a&&c>u))return!1;var s=i.get(t);if(s&&i.get(e))return s==e;var l=-1,f=!0,d=r&be?new ve:void 0;for(i.set(t,e),i.set(e,t);++l<u;){var p=t[l],v=e[l];if(n)var h=a?n(v,p,l,e,t,i):n(p,v,l,t,e,i);if(void 0!==h){if(h)continue;f=!1;break}if(d){if(!he(e,(function(t,e){if(!ye(d,e)&&(p===t||o(p,t,r,n,i)))return d.push(e)}))){f=!1;break}}else if(p!==v&&!o(p,v,r,n,i)){f=!1;break}}return i.delete(t),i.delete(e),f},Ee=s.Uint8Array;var Oe=function(t){var e=-1,r=Array(t.size);return t.forEach((function(t,n){r[++e]=[n,t]})),r};var Te=function(t){var e=-1,r=Array(t.size);return t.forEach((function(t){r[++e]=t})),r},Re=1,Ie=2,me="[object Boolean]",Ne="[object Date]",Ae="[object Error]",je="[object Map]",we="[object Number]",Pe="[object RegExp]",De="[object Set]",Ce="[object String]",Le="[object Symbol]",Se="[object ArrayBuffer]",Ue="[object DataView]",ke=l?l.prototype:void 0,xe=ke?ke.valueOf:void 0;var Me=function(t,e,r,n,o,i,a){switch(r){case Ue:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case Se:return!(t.byteLength!=e.byteLength||!i(new Ee(t),new Ee(e)));case me:case Ne:case we:return mt(+t,+e);case Ae:return t.name==e.name&&t.message==e.message;case Pe:case Ce:return t==e+"";case je:var u=Oe;case De:var c=n&Re;if(u||(u=Te),t.size!=e.size&&!c)return!1;var s=a.get(t);if(s)return s==e;n|=Ie,a.set(t,e);var l=ge(u(t),u(e),n,o,i,a);return a.delete(t),l;case Le:if(xe)return xe.call(t)==xe.call(e)}return!1};var ze=function(t,e){for(var r=-1,n=e.length,o=t.length;++r<n;)t[o+r]=e[r];return t};var We=function(t,e,r){var n=e(t);return tt(t)?n:ze(n,r(t))};var Be=function(t,e){for(var r=-1,n=null==t?0:t.length,o=0,i=[];++r<n;){var a=t[r];e(a,r,t)&&(i[o++]=a)}return i};var Ge=function(){return[]},Ve=Object.prototype.propertyIsEnumerable,Fe=Object.getOwnPropertySymbols,Ye=Fe?function(t){return null==t?[]:(t=Object(t),Be(Fe(t),(function(e){return Ve.call(t,e)})))}:Ge;var Ke=function(t){return We(t,Tt,Ye)},He=1,$e=Object.prototype.hasOwnProperty;var Je=function(t,e,r,n,o,i){var a=r&He,u=Ke(t),c=u.length;if(c!=Ke(e).length&&!a)return!1;for(var s=c;s--;){var l=u[s];if(!(a?l in e:$e.call(e,l)))return!1}var f=i.get(t);if(f&&i.get(e))return f==e;var d=!0;i.set(t,e),i.set(e,t);for(var p=a;++s<c;){var v=t[l=u[s]],h=e[l];if(n)var y=a?n(h,v,l,e,t,i):n(v,h,l,t,e,i);if(!(void 0===y?v===h||o(v,h,r,n,i):y)){d=!1;break}p||(p="constructor"==l)}if(d&&!p){var _=t.constructor,b=e.constructor;_!=b&&"constructor"in t&&"constructor"in e&&!("function"==typeof _&&_ instanceof _&&"function"==typeof b&&b instanceof b)&&(d=!1)}return i.delete(t),i.delete(e),d},Ze=G(s,"DataView"),qe=G(s,"Promise"),Xe=G(s,"Set"),Qe=G(s,"WeakMap"),tr=L(Ze),er=L(Mt),rr=L(qe),nr=L(Xe),or=L(Qe),ir=O;(Ze&&"[object DataView]"!=ir(new Ze(new ArrayBuffer(1)))||Mt&&"[object Map]"!=ir(new Mt)||qe&&"[object Promise]"!=ir(qe.resolve())||Xe&&"[object Set]"!=ir(new Xe)||Qe&&"[object WeakMap]"!=ir(new Qe))&&(ir=function(t){var e=O(t),r="[object Object]"==e?t.constructor:void 0,n=r?L(r):"";if(n)switch(n){case tr:return"[object DataView]";case er:return"[object Map]";case rr:return"[object Promise]";case nr:return"[object Set]";case or:return"[object WeakMap]"}return e});var ar=ir,ur=1,cr="[object Arguments]",sr="[object Array]",lr="[object Object]",fr=Object.prototype.hasOwnProperty;var dr=function(t,e,r,n,o,i){var a=tt(t),u=tt(e),c=a?sr:ar(t),s=u?sr:ar(e),l=(c=c==cr?lr:c)==lr,f=(s=s==cr?lr:s)==lr,d=c==s;if(d&&rt(t)){if(!rt(e))return!1;a=!0,l=!1}if(d&&!l)return i||(i=new se),a||pt(t)?ge(t,e,r,n,o,i):Me(t,e,c,r,n,o,i);if(!(r&ur)){var p=l&&fr.call(t,"__wrapped__"),v=f&&fr.call(e,"__wrapped__");if(p||v){var h=p?t.value():t,y=v?e.value():e;return i||(i=new se),o(h,y,r,n,i)}}return!!d&&(i||(i=new se),Je(t,e,r,n,o,i))};var pr=function t(e,r,n,o,i){return e===r||(null==e||null==r||!H(e)&&!H(r)?e!=e&&r!=r:dr(e,r,n,o,t,i))},vr=1,hr=2;var yr=function(t,e,r,n){var o=r.length,i=o,a=!n;if(null==t)return!i;for(t=Object(t);o--;){var u=r[o];if(a&&u[2]?u[1]!==t[u[0]]:!(u[0]in t))return!1}for(;++o<i;){var c=(u=r[o])[0],s=t[c],l=u[1];if(a&&u[2]){if(void 0===s&&!(c in t))return!1}else{var f=new se;if(n)var d=n(s,l,c,t,e,f);if(!(void 0===d?pr(l,s,vr|hr,n,f):d))return!1}}return!0};var _r=function(t){return t==t&&!T(t)};var br=function(t){for(var e=Tt(t),r=e.length;r--;){var n=e[r],o=t[n];e[r]=[n,o,_r(o)]}return e};var gr=function(t,e){return function(r){return null!=r&&(r[t]===e&&(void 0!==e||t in Object(r)))}};var Er=function(t){var e=br(t);return 1==e.length&&e[0][2]?gr(e[0][0],e[0][1]):function(r){return r===t||yr(r,t,e)}},Or="[object Symbol]";var Tr=function(t){return"symbol"==typeof t||H(t)&&O(t)==Or},Rr=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ir=/^\w*$/;var mr=function(t,e){if(tt(t))return!1;var r=typeof t;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=t&&!Tr(t))||(Ir.test(t)||!Rr.test(t)||null!=e&&t in Object(e))},Nr="Expected a function";function Ar(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError(Nr);var r=function(){var n=arguments,o=e?e.apply(this,n):n[0],i=r.cache;if(i.has(o))return i.get(o);var a=t.apply(this,n);return r.cache=i.set(o,a)||i,a};return r.cache=new(Ar.Cache||ie),r}Ar.Cache=ie;var jr=Ar,wr=500;var Pr=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Dr=/\\(\\)?/g,Cr=function(t){var e=jr(t,(function(t){return r.size===wr&&r.clear(),t})),r=e.cache;return e}((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(Pr,(function(t,r,n,o){e.push(n?o.replace(Dr,"$1"):r||t)})),e}));var Lr=function(t,e){for(var r=-1,n=null==t?0:t.length,o=Array(n);++r<n;)o[r]=e(t[r],r,t);return o},Sr=1/0,Ur=l?l.prototype:void 0,kr=Ur?Ur.toString:void 0;var xr=function t(e){if("string"==typeof e)return e;if(tt(e))return Lr(e,t)+"";if(Tr(e))return kr?kr.call(e):"";var r=e+"";return"0"==r&&1/e==-Sr?"-0":r};var Mr=function(t){return null==t?"":xr(t)};var zr=function(t,e){return tt(t)?t:mr(t,e)?[t]:Cr(Mr(t))},Wr=1/0;var Br=function(t){if("string"==typeof t||Tr(t))return t;var e=t+"";return"0"==e&&1/t==-Wr?"-0":e};var Gr=function(t,e){for(var r=0,n=(e=zr(e,t)).length;null!=t&&r<n;)t=t[Br(e[r++])];return r&&r==n?t:void 0};var Vr=function(t,e,r){var n=null==t?void 0:Gr(t,e);return void 0===n?r:n};var Fr=function(t,e){return null!=t&&e in Object(t)};var Yr=function(t,e,r){for(var n=-1,o=(e=zr(e,t)).length,i=!1;++n<o;){var a=Br(e[n]);if(!(i=null!=t&&r(t,a)))break;t=t[a]}return i||++n!=o?i:!!(o=null==t?0:t.length)&&ut(o)&&it(a,o)&&(tt(t)||Q(t))};var Kr=function(t,e){return null!=t&&Yr(t,e,Fr)},Hr=1,$r=2;var Jr=function(t,e){return mr(t)&&_r(e)?gr(Br(t),e):function(r){var n=Vr(r,t);return void 0===n&&n===e?Kr(r,t):pr(e,n,Hr|$r)}};var Zr=function(t){return t};var qr=function(t){return function(e){return null==e?void 0:e[t]}};var Xr=function(t){return function(e){return Gr(e,t)}};var Qr=function(t){return mr(t)?qr(Br(t)):Xr(t)};var tn=function(t){return"function"==typeof t?t:null==t?Zr:"object"==typeof t?tt(t)?Jr(t[0],t[1]):Er(t):Qr(t)};var en=function(t,e){var r={};return e=tn(e),Rt(t,(function(t,n,o){F(r,n,e(t,n,o))})),r},rn={boxFlex:!0,boxFlexGroup:!0,columnCount:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,strokeDashoffset:!0,strokeOpacity:!0,strokeWidth:!0};var nn=["Webkit","ms","Moz","O"];Object.keys(rn).forEach((function(t){nn.forEach((function(e){rn[function(t,e){return t+e.charAt(0).toUpperCase()+e.substring(1)}(e,t)]=rn[t]}))}));var on={isUnitlessNumber:rn,shorthandPropertyExpansions:{background:{backgroundImage:!0,backgroundPosition:!0,backgroundRepeat:!0,backgroundColor:!0},border:{borderWidth:!0,borderStyle:!0,borderColor:!0},borderBottom:{borderBottomWidth:!0,borderBottomStyle:!0,borderBottomColor:!0},borderLeft:{borderLeftWidth:!0,borderLeftStyle:!0,borderLeftColor:!0},borderRight:{borderRightWidth:!0,borderRightStyle:!0,borderRightColor:!0},borderTop:{borderTopWidth:!0,borderTopStyle:!0,borderTopColor:!0},font:{fontStyle:!0,fontVariant:!0,fontWeight:!0,fontSize:!0,lineHeight:!0,fontFamily:!0}}};var an,un,cn,sn,ln,fn,dn=function(e){var r=e.css,n={};return Object.entries(r).forEach((function(t){var e=t[0],r=t[1];if("number"==typeof r)return on.isUnitlessNumber[e]?void(n[e]=""+r):void(n[e]=r+"px");n[e]=r})),t(t({},e),{css:t(t({},n),{boxSizing:"border-box"})})},pn=function(e){return en(e,(function(e){var r=e;return"Typography"===r.type&&(r=function(e){var r=Vr(e,"data.custom.variant","P");return t(t({},e),{type:r})}(r)),r.css&&T(r.css)&&r.css.flexBasis&&(r=function(e){var r=e.css.flexBasis;return"0"===r||"0px"===r?t(t({},e),{css:t(t({},e.css),{flexBasis:"0%"})}):e}(r)),r.css&&(r=dn(r)),r}))},vn=function(){function t(t){this.adjacencyList={},this.rootDocument=t,this.adjacencyList[t]=[]}return t.prototype.get=function(t){return this.adjacencyList[t]},t.prototype.add=function(t,e){var r=this;if(this.adjacencyList[t]||(this.adjacencyList[t]=[]),!this.adjacencyList[e])return this.adjacencyList[t].push(e),this.adjacencyList[e]=[],!0;if(this.adjacencyList[t].includes(e))return!0;var n=function(e){if(e===t)return!0;for(var o=0,i=r.adjacencyList[e];o<i.length;o++){var a=i[o];if(n(a))return!0}return!1};return!n(e)&&(this.adjacencyList[t].push(e),!0)},t}(),hn=function(t,e){return{id:t,dependencies:e?e.dependencies:new vn(t)}},yn=function(t,e){return t.dependencies.add(t.id,e)},_n="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},bn="object"==typeof _n&&_n&&_n.Object===Object&&_n,gn="object"==typeof self&&self&&self.Object===Object&&self,En=(bn||gn||Function("return this")()).Symbol,On=Object.prototype,Tn=On.hasOwnProperty,Rn=On.toString,In=En?En.toStringTag:void 0,mn=Object.prototype.toString,Nn=En?En.toStringTag:void 0,An=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":Nn&&Nn in Object(t)?function(t){var e=Tn.call(t,In),r=t[In];try{t[In]=void 0;var n=!0}catch(t){}var o=Rn.call(t);return n&&(e?t[In]=r:delete t[In]),o}(t):function(t){return mn.call(t)}(t)},jn=Array.isArray,wn=function(t){return null!=t&&"object"==typeof t},Pn=function(t){return"string"==typeof t||!jn(t)&&wn(t)&&"[object String]"==An(t)},Dn=/^([a-zA-Z0-9]|_|-)+$/,Cn=function(t){return function(t){return"number"==typeof t||wn(t)&&"[object Number]"==An(t)}(t)&&t>=0};!function(t){t.SDK="SDK",t.PREVIEW="PREVIEW"}(an||(an={})),function(t){t.BOOTSTRAP="Bootstrap",t.CHANGE_POSITION="ChangePosition",t.CLOSE_PREVIEW="ClosePreview",t.PREVIEW_LOADED="PreviewLoaded",t.SET_AVALIABLE_PORTALS="SetAvaliablePortals",t.SET_CONTENT="SetContent",t.SET_SELECTED_ELEMENT="SetSelectedElement",t.SET_VIEW_MODE="SetViewMode",t.ADD_ELEMENT="AddElement",t.REMOVE_ELEMENT="RemoveElement",t.UPDATE_ELEMENT="UpdateElement",t.SET_ELEMENT="SetElement"}(un||(un={})),(cn||(cn={})).ON_CLICK="OnClick",function(t){t.NATIVE="Native",t.PENDO="Pendo"}(sn||(sn={})),function(t){t.NAVIGATE="Navigate",t.CHANGE_TUTORIAL="ChangeTutorial",t.OPEN_GUIDE="OpenGuide"}(ln||(ln={})),function(t){t.PRIMARY="primary",t.SECONDARY="primary",t.WARNING="warning",t.DANGER="danger",t.NEUTRAL="neutral",t.ACTIVE="active",t.INFO="info"}(fn||(fn={}));var Ln;fn.PRIMARY;!function(t){t.U="U",t.B="B",t.Em="Em",t.InlineCode="InlineCode"}(Ln||(Ln={}));var Sn,Un,kn,xn,Mn=function(t){return function(t){return Pn(t)&&t.length>=3&&t.length<100&&Dn.test(t)}(t)};!function(t){t.COLLAPSED="Collapsed",t.EXPANDED="Expanded",t.MINIMIZED="Minimized"}(Sn||(Sn={})),function(t){t.TUTORIAL="Tutorial",t.PORTAL="Portal"}(Un||(Un={})),function(t){t.Global="Global",t.Organization="Organization"}(kn||(kn={})),function(t){t.Root="root",t.Rule="rule",t.Atrule="atrule",t.Decl="decl",t.Any="any"}(xn||(xn={}));for(var zn,Wn=function(e,r){var n=r.reduce((function(e,r){var n;return t(t({},e),((n={})[r]=r,n))}),{});return e.content.find((function(t){var e=t.segmentId;return!!n[e]||"Everyone"===e}))},Bn=function(t){return"candu.sdk."+t},Gn=function(t){return Bn("error."+t)},Vn={UNKOWN_NODE_TYPE:"unknown_node_type",UNKOWN_BLOCK_NODE_TYPE:"unkown_block_node_type",UNKOWN_INLINE_NODE_TYPE:"unkown_inline_node_type",UNKOWN_NODE_OBJECT_TYPE:"unkown_node_object_type",TUTORIAL_ERROR:"tutorial_error_boundary",PORTAL_ERROR:"portal_error_boundary",PROVIDER_ERROR:"provider_error_boundary",STYLEGUIDE_MAP_ERROR:"styleguide_map",RENDER_NODE_ERROR:"render_node"},Fn={HEARTBEAT:Bn("heartbeat"),PREVIEW_OPEN:Bn("preview.open"),PORTAL:Bn("portal"),TUTORIAL:Bn("tutorial"),TUTORIAL_INTERACTION:Bn("tutorial.interaction"),PORTAL_ASSET_NOT_FOUND:Gn("portal_asset_not_found"),PORTAL_NO_SEGMENT_IDS:Gn("portal_no_segment_ids"),NO_MATCHING_TUTORIALS:Gn("no_matching_tutorials"),NO_VALID_TUTORIAL_IDENTIFIER:Gn("no_valid_tutorial_identifier"),COMMIT_API_LOADING_ERROR:Gn("commit_api"),TUTORIAL_LOADING_ERROR:Gn("tutorial"),UNKOWN_NODE_TYPE:Gn(Vn.UNKOWN_NODE_TYPE),UNKOWN_INLINE_NODE_TYPE:Gn(Vn.UNKOWN_INLINE_NODE_TYPE),UNKOWN_NODE_OBJECT_TYPE:Gn(Vn.UNKOWN_NODE_OBJECT_TYPE),TUTORIAL_ERROR:Gn(Vn.TUTORIAL_ERROR),PORTAL_ERROR:Gn(Vn.PORTAL_ERROR),PROVIDER_ERROR:Gn(Vn.PROVIDER_ERROR),STYLEGUIDE_MAP_ERROR:Gn(Vn.TUTORIAL_ERROR),RENDER_NODE_ERROR:Gn(Vn.TUTORIAL_ERROR),CIRCULAR_DEPENDENCY_EMBED_PORTAL:Gn("circular_dependecy_embed_portal"),CIRCULAR_DEPENDENCY_EMBED_TUTORIAL:Gn("circular_dependecy_embed_tutorial")},Yn=function(t){return"An error has occured while trying to parse your Tutorial.\nUpgrade the SDK to the latest version to get rid of this error.\nErrorCode: "+t+"."},Kn=((zn={EVENTING_NOT_INITIALIZED:"You tried to send an event, but you haven't initialized eventing.\nThis is happening because you called eventing outside the scope of the CanduProvider. It can be fixed by:\n1. Adding CanduProvider to the root of the application.\n2. Initializing a new Eventing object outside of Candu.\nRead here for more context: http://udn.ac/tracking-not-init.\n"})[Fn.PORTAL_ASSET_NOT_FOUND]="Could not find the requested Portal. This could happen because:\n1. The Portal does not exist or it was deleted.\n2. The Portal has not been made avaliable to be rendered.\n3. CORS Authenticaton failed.\nSee http://udn.ac/portal-not-found for more information.\n",zn[Fn.PORTAL_NO_SEGMENT_IDS]="You have tried to render a Portal that doesn't contain any content.\nAdd content to your Portal: https://udn.ac/update-portals.\n",zn[Fn.NO_MATCHING_TUTORIALS]="The Tutorial will not be rendered because there are no matching segments for the given user.",zn[Fn.NO_VALID_TUTORIAL_IDENTIFIER]="(Candu/Tutorial) You must define one of tutorialId, slug, commitId or contentHashId.",zn[Fn.TUTORIAL_LOADING_ERROR]="An error has occurred while trying to load the Tutorial",zn[Fn.UNKOWN_INLINE_NODE_TYPE]=Yn(Vn.UNKOWN_INLINE_NODE_TYPE),zn[Fn.UNKOWN_NODE_TYPE]=Yn(Vn.UNKOWN_NODE_TYPE),zn[Fn.CIRCULAR_DEPENDENCY_EMBED_PORTAL]="Circular dependency found on Embeded Portal. Please take a look at the Portal Content.",zn[Fn.CIRCULAR_DEPENDENCY_EMBED_TUTORIAL]="Circular dependency found on Embeded Tutorial. Please take a look at the Tutorial Content.",zn[Fn.PORTAL_ERROR]="An error has occured within Portal",zn[Fn.PROVIDER_ERROR]="An error has occured within Provider",zn[Fn.TUTORIAL_ERROR]="An error has occured within Tutorial",zn[Fn.RENDER_NODE_ERROR]="An error has occured while rendering tutorial node",zn[Fn.STYLEGUIDE_MAP_ERROR]="An error has occured while mapping node to styleguide",zn),Hn={Alert:!0,B:!0,Badge:!0,Button:!0,Card:!0,Code:!0,Document:!0,Em:!0,EmbedPortal:!0,EmbedTutorial:!0,Flex:!0,FlexItem:!0,H1:!0,H2:!0,H3:!0,H4:!0,H5:!0,H6:!0,Image:!0,InlineCode:!0,Link:!0,List:!0,ListItem:!0,P:!0,RichText:!0,Spacing:!0,Text:!0,U:!0,View:!0,Player:!0},$n={error:console.error,warning:console.warn},Jn=function(t){var e=t.identify,r=t.track;return{provider:function(t){var n=t.userId,o=t.traits,i=t.styleguide;e(n,o),r(Fn.HEARTBEAT,function(t){var e={};return Object.keys(t).forEach((function(r){Hn[r]&&(e["styleguide."+r]=t[r].displayName||!0)})),e}(i))},tutorialDocumentLoadingError:function(t){var e=t.tutorialId,n=t.slug,o=t.contentHashId;$n.error(Kn[Fn.TUTORIAL_LOADING_ERROR]),r(Fn.TUTORIAL_LOADING_ERROR,{tutorialId:e,slug:n,contentHashId:o})}}},Zn=function(t,e){return function(t){var e="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(e){var r=new Uint8Array(16);t.exports=function(){return e(r),r}}else{var n=new Array(16);t.exports=function(){for(var t,e=0;e<16;e++)0==(3&e)&&(t=4294967296*Math.random()),n[e]=t>>>((3&e)<<3)&255;return n}}}(e={exports:{}}),e.exports}(),qn=[],Xn=0;Xn<256;++Xn)qn[Xn]=(Xn+256).toString(16).substr(1);var Qn,to,eo=function(t,e,r){var n=e&&r||0;"string"==typeof t&&(e="binary"===t?new Array(16):null,t=null);var o=(t=t||{}).random||(t.rng||Zn)();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,e)for(var i=0;i<16;++i)e[n+i]=o[i];return e||function(t,e){var r=e||0,n=qn;return[n[t[r++]],n[t[r++]],n[t[r++]],n[t[r++]],"-",n[t[r++]],n[t[r++]],"-",n[t[r++]],n[t[r++]],"-",n[t[r++]],n[t[r++]],"-",n[t[r++]],n[t[r++]],n[t[r++]],n[t[r++]],n[t[r++]],n[t[r++]]].join("")}(o)};!function(t){t.UserGenerated="UserGenerated",t.SDK="SDK"}(Qn||(Qn={})),function(t){t.Identify="Identify",t.Group="Group",t.Track="Track",t.Page="Page",t.Screen="Screen"}(to||(to={}));var ro,no=function(){return"undefined"!=typeof window&&window.localStorage},oo=function(t){return function(e){no()&&null!=e&&window.localStorage.setItem(t,JSON.stringify(e))}},io={anonymousId:{getOrCreate:("candu:anonymous_id",ro=function(){var t=eo();return oo("candu:anonymous_id")(t),t},function(){return function(){if(no()){var t=window.localStorage.getItem("candu:anonymous_id");if(t)try{return JSON.parse(t)}catch(t){return null}}}()||ro()}),set:oo("candu:anonymous_id")}}.anonymousId.getOrCreate,ao=function(t,e,r,n,o,i,a,u){if(!t){var c;if(void 0===e)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var s=[r,n,o,i,a,u],l=0;(c=new Error(e.replace(/%s/g,(function(){return s[l++]})))).name="Invariant Violation"}throw c.framesToPop=1,c}},uo=function(t){return ao(!t||T(t),"(Candu) styleguide must be undefined or an object")},co=function(r){var n=r.clientToken,o=r.userId,i=r.traits,a=r.options,u=r.styleguide,c=e(r,["clientToken","userId","traits","options","styleguide"]);return ao(function(t){return Pn(t)&&!!t.match(/^[0-9a-zA-Z]*$/)&&t.length>=10}(n),"(Candu) you must provide a valid clientToken"),ao(!o||function(t){return Cn(t)||Pn(t)&&t.trim().length>0}(o),"(Candu) you must provide a valid userId"),uo(u),ao(!i||T(i),"(Candu) traits must be undefined or an object"),ao(!a||T(a),"(Candu) options must be undefined or an object"),t(t({},c),{clientToken:n,traits:i||{},options:a||{},styleguide:u||{},userId:o||io()})},so=function(r){var n=r.slug,o=r.styleguide,i=r.contentHashId,a=r.tutorialId,u=r.tutorialDocument,c=r.renderedByClient,s=e(r,["slug","styleguide","contentHashId","tutorialId","tutorialDocument","renderedByClient"]);return uo(o),t(t({},s),{slug:n,styleguide:o||{},contentHashId:i,tutorialId:a,tutorialDocument:u,renderedByClient:c})},lo=function(t){var e=t.slug,r=t.styleguide;return uo(r),{slug:e,styleguide:r||{}}};var fo="/api/segmentMemberships",po="/api/segmentsDefinition",vo="/api/tutorialMetadata",ho="/api/tutorialDocumentsSdk",yo="wss://2jcfb7pjlf.execute-api.eu-west-1.amazonaws.com/prod",_o=function(t){return r(void 0,void 0,void 0,(function(){return n(this,(function(e){switch(e.label){case 0:return[4,fetch(t)];case 1:return[2,e.sent().json()]}}))}))},bo=function(t){return _o("https://api.candu.ai"+t)},go=function(t){return _o("https://cdn.candu.ai"+t)},Eo={tutorialDocumentLatestSaved:function(t,e){return r(void 0,void 0,void 0,(function(){return n(this,(function(r){return[2,bo(ho+"/"+e+"?token="+t)]}))}))},portalAsset:function(t,e){return r(void 0,void 0,void 0,(function(){return n(this,(function(r){return[2,go("/portals/"+t+"/"+e+"/head.json")]}))}))},segmentMembership:function(t,e){return r(void 0,void 0,void 0,(function(){return n(this,(function(r){return[2,bo(fo+"/"+e+"?token="+t)]}))}))},segmentDefinition:function(t){return r(void 0,void 0,void 0,(function(){return n(this,(function(e){return[2,bo(po+"?token="+t)]}))}))},tutorialMetadata:function(t){return r(void 0,void 0,void 0,(function(){return n(this,(function(e){return[2,bo(vo+"?token="+t)]}))}))},tutorialSocket:function(t,e,r){var n=new WebSocket(yo+"?clientToken="+t+"&tutorialId="+e);return n.onmessage=function(t){var e=JSON.parse(t.data);r(e)},function(){return n.close()}},tutorialDocument:function(t,e,r){var n=t.contentHashId,o=t.tutorialId,i=t.tutorialDocument,a=t.slug,u=function(t){return{byId:function(e){return bo(ho+"?token="+t+"&finder=latestPublished&tutorialId="+e)},bySlug:function(e){return go("/tutorials/"+t+"/"+e+".json")},byContentHash:function(e){return go("/tutorials/"+t+"/"+e+".json")}}}(e);return function(t){return Cn(t)}(o)?u.byId(o):Mn(a)?u.bySlug(a):function(t){return Pn(t)&&!!t.match(/^[0-9a-zA-Z]{40}$/)}(n)?u.byContentHash(n):T(i)?Promise.resolve(i):($n.error(Kn[Fn.NO_VALID_TUTORIAL_IDENTIFIER]),r.track(Fn.NO_VALID_TUTORIAL_IDENTIFIER,{slug:t.slug}),null)}},Oo=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return console.error.apply(console,t)},To=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return console.warn.apply(console,t)},Ro={error:Oo,warning:To},Io=function(t){return DOMParser?(new DOMParser).parseFromString(t,"text/html").body.textContent||"":t},mo=function(){function t(){this.subscribers=[]}return t.prototype.subscribe=function(t){var e=this;return this.subscribers.push(t),function(){e.subscribers[e.subscribers.indexOf(t)]=function(){}}},t.prototype.notify=function(t){this.subscribers.forEach((function(e){return e(t)}))},t.prototype.clear=function(){this.subscribers=[]},t}(),No=function(){function t(){this.onClientUpdateObserver=new mo}return t.prototype.attachClient=function(t){this.client=t,this.onClientUpdateObserver.notify({client:t})},t.prototype.detachClient=function(){this.client=null,this.onClientUpdateObserver.notify({client:null})},t.prototype.onClientUpdate=function(t){var e=this.onClientUpdateObserver.subscribe(t);return this.client&&t({client:this.client}),e},t}();function Ao(t){var e,r,n=function(t){return function(){for(var e,n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];if(r.api)return(e=r.api)[t].apply(e,n);console.warn("Please initialize the SDK by calling Candu.init() before attempting to call "+t)}};return(e=function(){function e(){}return e.init=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return this.api||(e.api=new(t.bind.apply(t,o([void 0],r)))),e.subscriberCallbacks.forEach((function(t){return t()})),e.subscriberCallbacks=[],window.postMessage({source:"CANDU_SINGLETON",payload:{type:"INIT"}},window&&window.origin?window.origin:"*"),e},e.onProviderReady=function(t){if(e.api)return t();e.subscriberCallbacks.push(t)},e}()).subscriberCallbacks=[],e.renderTutorial=n("renderTutorial"),e.renderPortal=n("renderPortal"),e.attachClient=n("attachClient"),e.detachClient=n("detachClient"),e.getProvider=n("getProvider"),r=e,window.Candu=r,r}var jo=function(){function t(t){this.init(t)}return t.prototype.attachClient=function(t){return this.provider.preview.attachClient(t)},t.prototype.detachClient=function(){return this.provider.preview.detachClient()},Object.defineProperty(t.prototype,"provider",{get:function(){return this.getProvider()},enumerable:!0,configurable:!0}),t}(),wo=function(t){switch(t.trigger){case cn.ON_CLICK:default:return"onClick"}},Po=function(e,r){var n=e.data;if(!n||!n.actions)return{};var o=function(e){r.provider.eventing.track(Fn.TUTORIAL_INTERACTION,t(t({},e),r.trackingIdentifiers||{}))};return n.actions.map((function(t){return function(t,e){var r,n,o;switch(t.handler.type){case ln.NAVIGATE:return(r={})[wo(t)]=function(){var r=t.handler,n=r.href,o=r.target;e(t),"Blank"===o?window.open(n,"_blank"):n&&n.includes("mailto:")?window.location=n:document.location.href=n},r;case ln.CHANGE_TUTORIAL:return(n={})[wo(t)]=function(){var e=t.handler.tutorialId;Oo("TODO -> change tutorial",e)},n;case ln.OPEN_GUIDE:return(o={})[wo(t)]=function(){var e=t.handler.guideId;Oo("TODO -> open guide",e)},o;default:return{}}}(t,o)})).reduce((function(e,r){return t(t({},e),r)}),{})},Do=function(t,e){var r=t.props||{},n=t.nodes,o=r.children;return o?"string"==typeof o?Io(o):o:n?n.map(e):null},Co=function(e,r){try{var n=r.provider,o=r.document,i=r.trackingIdentifiers,a=o.nodes[e];if(!a)return Ro.error("Document is corrupted. Refusing to move further."),null;var u=function(t){return Co(t,r)},c=a.type,s=a.props,l=a.css,f=t(t(t({},s||{}),{style:l||{},children:Do(a,u)}),Po(a,{trackingIdentifiers:i,provider:n})),d={nodeId:e,node:a,document:o,render:{node:u,styleguide:function(t,e){return void 0===e&&(e={}),r.renderNode(t,{api:d,attributes:e})},tutorial:function(t){return r.renderTutorial(t)},portal:function(t){return r.renderPortal(t)}},trackingIdentifiers:i},p=d.render.styleguide(c,f);return p||(Ro.error(Kn[Fn.UNKOWN_NODE_TYPE],{type:c}),n.eventing.track(Fn.UNKOWN_NODE_TYPE,{type:c}),null)}catch(t){return Ro.error(Kn[Fn.STYLEGUIDE_MAP_ERROR],t),null}},Lo=jr((function(e,r){var n,o,i=e.provider,a=e.portal,u=e.tutorial,c=i.styleguide;return u&&(o=u.styleguide),a&&(n=a.styleguide),t(t(t(t({},c||{}),n||{}),o||{}),r||{})})),So="",Uo="#EDEDED",ko="#333745",xo="#838792",Mo="#FEFEFE",zo="#FEFEFE",Wo={primary:"#6310E5",secondary:"#59C3C3",tertiary:"#4D515D",warning:"#FCAD0D",danger:"#EE4266"},Bo=function(t){var e=document.createElement("link");e.setAttribute("rel","stylesheet"),e.setAttribute("href","https://cdn.candu.ai/styleguides/applications/"+t+"/default/main.css"),document.head.appendChild(e)};export{Uo as DEFAULT_ALERT_COLOR,So as DEFAULT_ALT,Mo as DEFAULT_TAB_ACTIVE_COLOR,zo as DEFAULT_TAB_COLOR,ko as DEFAULT_TAB_HEADER_COLOR,xo as DEFAULT_TAB_ITEM_COLOR,Kn as ERROR_MESSAGES,Vn as ERROR_SLUGS,Fn as EVENT_NAMES,$n as LOGGER,mo as Observer,No as PreviewContainer,Eo as RESOURCES,Wo as STYLEGUIDE_COLORS,jo as SingletonAPI,vn as TutorialDependencies,pn as adaptCustomNodes,Bo as attachStylesheet,yn as checkCyclicAndAdd,Ao as createSingleton,hn as createTutorialDocumentContext,Hn as defaultStyleguide,Wn as findMatchingSegment,Jn as internalEventing,Oo as logError,To as logWarning,Ro as logger,Co as mapNodeToStyleguide,Lo as mergeStyleguidesFromContext,dn as normalizeCss,lo as portalValidation,co as providerValidation,Io as stripHTML,so as tutorialValidation};
var t=function(){return(t=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function e(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r}function r(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){t.done?o(t.value):new r((function(e){e(t.value)})).then(a,u)}c((n=n.apply(t,e||[])).next())}))}function n(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}function o(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;var n=Array(t),o=0;for(e=0;e<r;e++)for(var i=arguments[e],a=0,u=i.length;a<u;a++,o++)n[o]=i[a];return n}var i="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function a(t,e){return t(e={exports:{}},e.exports),e.exports}var u="object"==typeof i&&i&&i.Object===Object&&i,c="object"==typeof self&&self&&self.Object===Object&&self,s=u||c||Function("return this")(),l=s.Symbol,f=Object.prototype,d=f.hasOwnProperty,p=f.toString,v=l?l.toStringTag:void 0;var h=function(t){var e=d.call(t,v),r=t[v];try{t[v]=void 0;var n=!0}catch(t){}var o=p.call(t);return n&&(e?t[v]=r:delete t[v]),o},y=Object.prototype.toString;var _=function(t){return y.call(t)},b="[object Null]",g="[object Undefined]",E=l?l.toStringTag:void 0;var O=function(t){return null==t?void 0===t?g:b:E&&E in Object(t)?h(t):_(t)};var T=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)},R="[object AsyncFunction]",I="[object Function]",m="[object GeneratorFunction]",N="[object Proxy]";var A,j=function(t){if(!T(t))return!1;var e=O(t);return e==I||e==m||e==R||e==N},w=s["__core-js_shared__"],P=(A=/[^.]+$/.exec(w&&w.keys&&w.keys.IE_PROTO||""))?"Symbol(src)_1."+A:"";var D=function(t){return!!P&&P in t},C=Function.prototype.toString;var L=function(t){if(null!=t){try{return C.call(t)}catch(t){}try{return t+""}catch(t){}}return""},S=/^\[object .+?Constructor\]$/,U=Function.prototype,k=Object.prototype,x=U.toString,M=k.hasOwnProperty,z=RegExp("^"+x.call(M).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var W=function(t){return!(!T(t)||D(t))&&(j(t)?z:S).test(L(t))};var B=function(t,e){return null==t?void 0:t[e]};var G=function(t,e){var r=B(t,e);return W(r)?r:void 0},V=function(){try{var t=G(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();var F=function(t,e,r){"__proto__"==e&&V?V(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r};var Y=function(t){return function(e,r,n){for(var o=-1,i=Object(e),a=n(e),u=a.length;u--;){var c=a[t?u:++o];if(!1===r(i[c],c,i))break}return e}}();var K=function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n};var H=function(t){return null!=t&&"object"==typeof t},$="[object Arguments]";var J=function(t){return H(t)&&O(t)==$},Z=Object.prototype,q=Z.hasOwnProperty,X=Z.propertyIsEnumerable,Q=J(function(){return arguments}())?J:function(t){return H(t)&&q.call(t,"callee")&&!X.call(t,"callee")},tt=Array.isArray;var et=function(){return!1},rt=a((function(t,e){var r=e&&!e.nodeType&&e,n=r&&t&&!t.nodeType&&t,o=n&&n.exports===r?s.Buffer:void 0,i=(o?o.isBuffer:void 0)||et;t.exports=i})),nt=9007199254740991,ot=/^(?:0|[1-9]\d*)$/;var it=function(t,e){var r=typeof t;return!!(e=null==e?nt:e)&&("number"==r||"symbol"!=r&&ot.test(t))&&t>-1&&t%1==0&&t<e},at=9007199254740991;var ut=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=at},ct={};ct["[object Float32Array]"]=ct["[object Float64Array]"]=ct["[object Int8Array]"]=ct["[object Int16Array]"]=ct["[object Int32Array]"]=ct["[object Uint8Array]"]=ct["[object Uint8ClampedArray]"]=ct["[object Uint16Array]"]=ct["[object Uint32Array]"]=!0,ct["[object Arguments]"]=ct["[object Array]"]=ct["[object ArrayBuffer]"]=ct["[object Boolean]"]=ct["[object DataView]"]=ct["[object Date]"]=ct["[object Error]"]=ct["[object Function]"]=ct["[object Map]"]=ct["[object Number]"]=ct["[object Object]"]=ct["[object RegExp]"]=ct["[object Set]"]=ct["[object String]"]=ct["[object WeakMap]"]=!1;var st=function(t){return H(t)&&ut(t.length)&&!!ct[O(t)]};var lt=function(t){return function(e){return t(e)}},ft=a((function(t,e){var r=e&&!e.nodeType&&e,n=r&&t&&!t.nodeType&&t,o=n&&n.exports===r&&u.process,i=function(){try{var t=n&&n.require&&n.require("util").types;return t||o&&o.binding&&o.binding("util")}catch(t){}}();t.exports=i})),dt=ft&&ft.isTypedArray,pt=dt?lt(dt):st,vt=Object.prototype.hasOwnProperty;var ht=function(t,e){var r=tt(t),n=!r&&Q(t),o=!r&&!n&&rt(t),i=!r&&!n&&!o&&pt(t),a=r||n||o||i,u=a?K(t.length,String):[],c=u.length;for(var s in t)!e&&!vt.call(t,s)||a&&("length"==s||o&&("offset"==s||"parent"==s)||i&&("buffer"==s||"byteLength"==s||"byteOffset"==s)||it(s,c))||u.push(s);return u},yt=Object.prototype;var _t=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||yt)};var bt=function(t,e){return function(r){return t(e(r))}}(Object.keys,Object),gt=Object.prototype.hasOwnProperty;var Et=function(t){if(!_t(t))return bt(t);var e=[];for(var r in Object(t))gt.call(t,r)&&"constructor"!=r&&e.push(r);return e};var Ot=function(t){return null!=t&&ut(t.length)&&!j(t)};var Tt=function(t){return Ot(t)?ht(t):Et(t)};var Rt=function(t,e){return t&&Y(t,e,Tt)};var It=function(){this.__data__=[],this.size=0};var mt=function(t,e){return t===e||t!=t&&e!=e};var Nt=function(t,e){for(var r=t.length;r--;)if(mt(t[r][0],e))return r;return-1},At=Array.prototype.splice;var jt=function(t){var e=this.__data__,r=Nt(e,t);return!(r<0)&&(r==e.length-1?e.pop():At.call(e,r,1),--this.size,!0)};var wt=function(t){var e=this.__data__,r=Nt(e,t);return r<0?void 0:e[r][1]};var Pt=function(t){return Nt(this.__data__,t)>-1};var Dt=function(t,e){var r=this.__data__,n=Nt(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this};function Ct(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Ct.prototype.clear=It,Ct.prototype.delete=jt,Ct.prototype.get=wt,Ct.prototype.has=Pt,Ct.prototype.set=Dt;var Lt=Ct;var St=function(){this.__data__=new Lt,this.size=0};var Ut=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r};var kt=function(t){return this.__data__.get(t)};var xt=function(t){return this.__data__.has(t)},Mt=G(s,"Map"),zt=G(Object,"create");var Wt=function(){this.__data__=zt?zt(null):{},this.size=0};var Bt=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},Gt="__lodash_hash_undefined__",Vt=Object.prototype.hasOwnProperty;var Ft=function(t){var e=this.__data__;if(zt){var r=e[t];return r===Gt?void 0:r}return Vt.call(e,t)?e[t]:void 0},Yt=Object.prototype.hasOwnProperty;var Kt=function(t){var e=this.__data__;return zt?void 0!==e[t]:Yt.call(e,t)},Ht="__lodash_hash_undefined__";var $t=function(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=zt&&void 0===e?Ht:e,this};function Jt(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Jt.prototype.clear=Wt,Jt.prototype.delete=Bt,Jt.prototype.get=Ft,Jt.prototype.has=Kt,Jt.prototype.set=$t;var Zt=Jt;var qt=function(){this.size=0,this.__data__={hash:new Zt,map:new(Mt||Lt),string:new Zt}};var Xt=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t};var Qt=function(t,e){var r=t.__data__;return Xt(e)?r["string"==typeof e?"string":"hash"]:r.map};var te=function(t){var e=Qt(this,t).delete(t);return this.size-=e?1:0,e};var ee=function(t){return Qt(this,t).get(t)};var re=function(t){return Qt(this,t).has(t)};var ne=function(t,e){var r=Qt(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this};function oe(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}oe.prototype.clear=qt,oe.prototype.delete=te,oe.prototype.get=ee,oe.prototype.has=re,oe.prototype.set=ne;var ie=oe,ae=200;var ue=function(t,e){var r=this.__data__;if(r instanceof Lt){var n=r.__data__;if(!Mt||n.length<ae-1)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new ie(n)}return r.set(t,e),this.size=r.size,this};function ce(t){var e=this.__data__=new Lt(t);this.size=e.size}ce.prototype.clear=St,ce.prototype.delete=Ut,ce.prototype.get=kt,ce.prototype.has=xt,ce.prototype.set=ue;var se=ce,le="__lodash_hash_undefined__";var fe=function(t){return this.__data__.set(t,le),this};var de=function(t){return this.__data__.has(t)};function pe(t){var e=-1,r=null==t?0:t.length;for(this.__data__=new ie;++e<r;)this.add(t[e])}pe.prototype.add=pe.prototype.push=fe,pe.prototype.has=de;var ve=pe;var he=function(t,e){for(var r=-1,n=null==t?0:t.length;++r<n;)if(e(t[r],r,t))return!0;return!1};var ye=function(t,e){return t.has(e)},_e=1,be=2;var ge=function(t,e,r,n,o,i){var a=r&_e,u=t.length,c=e.length;if(u!=c&&!(a&&c>u))return!1;var s=i.get(t);if(s&&i.get(e))return s==e;var l=-1,f=!0,d=r&be?new ve:void 0;for(i.set(t,e),i.set(e,t);++l<u;){var p=t[l],v=e[l];if(n)var h=a?n(v,p,l,e,t,i):n(p,v,l,t,e,i);if(void 0!==h){if(h)continue;f=!1;break}if(d){if(!he(e,(function(t,e){if(!ye(d,e)&&(p===t||o(p,t,r,n,i)))return d.push(e)}))){f=!1;break}}else if(p!==v&&!o(p,v,r,n,i)){f=!1;break}}return i.delete(t),i.delete(e),f},Ee=s.Uint8Array;var Oe=function(t){var e=-1,r=Array(t.size);return t.forEach((function(t,n){r[++e]=[n,t]})),r};var Te=function(t){var e=-1,r=Array(t.size);return t.forEach((function(t){r[++e]=t})),r},Re=1,Ie=2,me="[object Boolean]",Ne="[object Date]",Ae="[object Error]",je="[object Map]",we="[object Number]",Pe="[object RegExp]",De="[object Set]",Ce="[object String]",Le="[object Symbol]",Se="[object ArrayBuffer]",Ue="[object DataView]",ke=l?l.prototype:void 0,xe=ke?ke.valueOf:void 0;var Me=function(t,e,r,n,o,i,a){switch(r){case Ue:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case Se:return!(t.byteLength!=e.byteLength||!i(new Ee(t),new Ee(e)));case me:case Ne:case we:return mt(+t,+e);case Ae:return t.name==e.name&&t.message==e.message;case Pe:case Ce:return t==e+"";case je:var u=Oe;case De:var c=n&Re;if(u||(u=Te),t.size!=e.size&&!c)return!1;var s=a.get(t);if(s)return s==e;n|=Ie,a.set(t,e);var l=ge(u(t),u(e),n,o,i,a);return a.delete(t),l;case Le:if(xe)return xe.call(t)==xe.call(e)}return!1};var ze=function(t,e){for(var r=-1,n=e.length,o=t.length;++r<n;)t[o+r]=e[r];return t};var We=function(t,e,r){var n=e(t);return tt(t)?n:ze(n,r(t))};var Be=function(t,e){for(var r=-1,n=null==t?0:t.length,o=0,i=[];++r<n;){var a=t[r];e(a,r,t)&&(i[o++]=a)}return i};var Ge=function(){return[]},Ve=Object.prototype.propertyIsEnumerable,Fe=Object.getOwnPropertySymbols,Ye=Fe?function(t){return null==t?[]:(t=Object(t),Be(Fe(t),(function(e){return Ve.call(t,e)})))}:Ge;var Ke=function(t){return We(t,Tt,Ye)},He=1,$e=Object.prototype.hasOwnProperty;var Je=function(t,e,r,n,o,i){var a=r&He,u=Ke(t),c=u.length;if(c!=Ke(e).length&&!a)return!1;for(var s=c;s--;){var l=u[s];if(!(a?l in e:$e.call(e,l)))return!1}var f=i.get(t);if(f&&i.get(e))return f==e;var d=!0;i.set(t,e),i.set(e,t);for(var p=a;++s<c;){var v=t[l=u[s]],h=e[l];if(n)var y=a?n(h,v,l,e,t,i):n(v,h,l,t,e,i);if(!(void 0===y?v===h||o(v,h,r,n,i):y)){d=!1;break}p||(p="constructor"==l)}if(d&&!p){var _=t.constructor,b=e.constructor;_!=b&&"constructor"in t&&"constructor"in e&&!("function"==typeof _&&_ instanceof _&&"function"==typeof b&&b instanceof b)&&(d=!1)}return i.delete(t),i.delete(e),d},Ze=G(s,"DataView"),qe=G(s,"Promise"),Xe=G(s,"Set"),Qe=G(s,"WeakMap"),tr=L(Ze),er=L(Mt),rr=L(qe),nr=L(Xe),or=L(Qe),ir=O;(Ze&&"[object DataView]"!=ir(new Ze(new ArrayBuffer(1)))||Mt&&"[object Map]"!=ir(new Mt)||qe&&"[object Promise]"!=ir(qe.resolve())||Xe&&"[object Set]"!=ir(new Xe)||Qe&&"[object WeakMap]"!=ir(new Qe))&&(ir=function(t){var e=O(t),r="[object Object]"==e?t.constructor:void 0,n=r?L(r):"";if(n)switch(n){case tr:return"[object DataView]";case er:return"[object Map]";case rr:return"[object Promise]";case nr:return"[object Set]";case or:return"[object WeakMap]"}return e});var ar=ir,ur=1,cr="[object Arguments]",sr="[object Array]",lr="[object Object]",fr=Object.prototype.hasOwnProperty;var dr=function(t,e,r,n,o,i){var a=tt(t),u=tt(e),c=a?sr:ar(t),s=u?sr:ar(e),l=(c=c==cr?lr:c)==lr,f=(s=s==cr?lr:s)==lr,d=c==s;if(d&&rt(t)){if(!rt(e))return!1;a=!0,l=!1}if(d&&!l)return i||(i=new se),a||pt(t)?ge(t,e,r,n,o,i):Me(t,e,c,r,n,o,i);if(!(r&ur)){var p=l&&fr.call(t,"__wrapped__"),v=f&&fr.call(e,"__wrapped__");if(p||v){var h=p?t.value():t,y=v?e.value():e;return i||(i=new se),o(h,y,r,n,i)}}return!!d&&(i||(i=new se),Je(t,e,r,n,o,i))};var pr=function t(e,r,n,o,i){return e===r||(null==e||null==r||!H(e)&&!H(r)?e!=e&&r!=r:dr(e,r,n,o,t,i))},vr=1,hr=2;var yr=function(t,e,r,n){var o=r.length,i=o,a=!n;if(null==t)return!i;for(t=Object(t);o--;){var u=r[o];if(a&&u[2]?u[1]!==t[u[0]]:!(u[0]in t))return!1}for(;++o<i;){var c=(u=r[o])[0],s=t[c],l=u[1];if(a&&u[2]){if(void 0===s&&!(c in t))return!1}else{var f=new se;if(n)var d=n(s,l,c,t,e,f);if(!(void 0===d?pr(l,s,vr|hr,n,f):d))return!1}}return!0};var _r=function(t){return t==t&&!T(t)};var br=function(t){for(var e=Tt(t),r=e.length;r--;){var n=e[r],o=t[n];e[r]=[n,o,_r(o)]}return e};var gr=function(t,e){return function(r){return null!=r&&(r[t]===e&&(void 0!==e||t in Object(r)))}};var Er=function(t){var e=br(t);return 1==e.length&&e[0][2]?gr(e[0][0],e[0][1]):function(r){return r===t||yr(r,t,e)}},Or="[object Symbol]";var Tr=function(t){return"symbol"==typeof t||H(t)&&O(t)==Or},Rr=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ir=/^\w*$/;var mr=function(t,e){if(tt(t))return!1;var r=typeof t;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=t&&!Tr(t))||(Ir.test(t)||!Rr.test(t)||null!=e&&t in Object(e))},Nr="Expected a function";function Ar(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError(Nr);var r=function(){var n=arguments,o=e?e.apply(this,n):n[0],i=r.cache;if(i.has(o))return i.get(o);var a=t.apply(this,n);return r.cache=i.set(o,a)||i,a};return r.cache=new(Ar.Cache||ie),r}Ar.Cache=ie;var jr=Ar,wr=500;var Pr=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Dr=/\\(\\)?/g,Cr=function(t){var e=jr(t,(function(t){return r.size===wr&&r.clear(),t})),r=e.cache;return e}((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(Pr,(function(t,r,n,o){e.push(n?o.replace(Dr,"$1"):r||t)})),e}));var Lr=function(t,e){for(var r=-1,n=null==t?0:t.length,o=Array(n);++r<n;)o[r]=e(t[r],r,t);return o},Sr=1/0,Ur=l?l.prototype:void 0,kr=Ur?Ur.toString:void 0;var xr=function t(e){if("string"==typeof e)return e;if(tt(e))return Lr(e,t)+"";if(Tr(e))return kr?kr.call(e):"";var r=e+"";return"0"==r&&1/e==-Sr?"-0":r};var Mr=function(t){return null==t?"":xr(t)};var zr=function(t,e){return tt(t)?t:mr(t,e)?[t]:Cr(Mr(t))},Wr=1/0;var Br=function(t){if("string"==typeof t||Tr(t))return t;var e=t+"";return"0"==e&&1/t==-Wr?"-0":e};var Gr=function(t,e){for(var r=0,n=(e=zr(e,t)).length;null!=t&&r<n;)t=t[Br(e[r++])];return r&&r==n?t:void 0};var Vr=function(t,e,r){var n=null==t?void 0:Gr(t,e);return void 0===n?r:n};var Fr=function(t,e){return null!=t&&e in Object(t)};var Yr=function(t,e,r){for(var n=-1,o=(e=zr(e,t)).length,i=!1;++n<o;){var a=Br(e[n]);if(!(i=null!=t&&r(t,a)))break;t=t[a]}return i||++n!=o?i:!!(o=null==t?0:t.length)&&ut(o)&&it(a,o)&&(tt(t)||Q(t))};var Kr=function(t,e){return null!=t&&Yr(t,e,Fr)},Hr=1,$r=2;var Jr=function(t,e){return mr(t)&&_r(e)?gr(Br(t),e):function(r){var n=Vr(r,t);return void 0===n&&n===e?Kr(r,t):pr(e,n,Hr|$r)}};var Zr=function(t){return t};var qr=function(t){return function(e){return null==e?void 0:e[t]}};var Xr=function(t){return function(e){return Gr(e,t)}};var Qr=function(t){return mr(t)?qr(Br(t)):Xr(t)};var tn=function(t){return"function"==typeof t?t:null==t?Zr:"object"==typeof t?tt(t)?Jr(t[0],t[1]):Er(t):Qr(t)};var en=function(t,e){var r={};return e=tn(e),Rt(t,(function(t,n,o){F(r,n,e(t,n,o))})),r},rn={boxFlex:!0,boxFlexGroup:!0,columnCount:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,strokeDashoffset:!0,strokeOpacity:!0,strokeWidth:!0};var nn=["Webkit","ms","Moz","O"];Object.keys(rn).forEach((function(t){nn.forEach((function(e){rn[function(t,e){return t+e.charAt(0).toUpperCase()+e.substring(1)}(e,t)]=rn[t]}))}));var on={isUnitlessNumber:rn,shorthandPropertyExpansions:{background:{backgroundImage:!0,backgroundPosition:!0,backgroundRepeat:!0,backgroundColor:!0},border:{borderWidth:!0,borderStyle:!0,borderColor:!0},borderBottom:{borderBottomWidth:!0,borderBottomStyle:!0,borderBottomColor:!0},borderLeft:{borderLeftWidth:!0,borderLeftStyle:!0,borderLeftColor:!0},borderRight:{borderRightWidth:!0,borderRightStyle:!0,borderRightColor:!0},borderTop:{borderTopWidth:!0,borderTopStyle:!0,borderTopColor:!0},font:{fontStyle:!0,fontVariant:!0,fontWeight:!0,fontSize:!0,lineHeight:!0,fontFamily:!0}}};var an,un,cn,sn,ln,fn,dn=function(e){var r=e.css,n={};return Object.entries(r).forEach((function(t){var e=t[0],r=t[1];if("number"==typeof r)return on.isUnitlessNumber[e]?void(n[e]=""+r):void(n[e]=r+"px");n[e]=r})),t(t({},e),{css:t(t({},n),{boxSizing:"border-box"})})},pn=function(e){return en(e,(function(e){var r=e;return"Typography"===r.type&&(r=function(e){var r=Vr(e,"data.custom.variant","P");return t(t({},e),{type:r})}(r)),r.css&&T(r.css)&&r.css.flexBasis&&(r=function(e){var r=e.css.flexBasis;return"0"===r||"0px"===r?t(t({},e),{css:t(t({},e.css),{flexBasis:"0%"})}):e}(r)),r.css&&(r=dn(r)),r}))},vn=function(){function t(t){this.adjacencyList={},this.rootDocument=t,this.adjacencyList[t]=[]}return t.prototype.get=function(t){return this.adjacencyList[t]},t.prototype.add=function(t,e){var r=this;if(this.adjacencyList[t]||(this.adjacencyList[t]=[]),!this.adjacencyList[e])return this.adjacencyList[t].push(e),this.adjacencyList[e]=[],!0;if(this.adjacencyList[t].includes(e))return!0;var n=function(e){if(e===t)return!0;for(var o=0,i=r.adjacencyList[e];o<i.length;o++){var a=i[o];if(n(a))return!0}return!1};return!n(e)&&(this.adjacencyList[t].push(e),!0)},t}(),hn=function(t,e){return{id:t,dependencies:e?e.dependencies:new vn(t)}},yn=function(t,e){return t.dependencies.add(t.id,e)},_n="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},bn="object"==typeof _n&&_n&&_n.Object===Object&&_n,gn="object"==typeof self&&self&&self.Object===Object&&self,En=(bn||gn||Function("return this")()).Symbol,On=Object.prototype,Tn=On.hasOwnProperty,Rn=On.toString,In=En?En.toStringTag:void 0,mn=Object.prototype.toString,Nn=En?En.toStringTag:void 0,An=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":Nn&&Nn in Object(t)?function(t){var e=Tn.call(t,In),r=t[In];try{t[In]=void 0;var n=!0}catch(t){}var o=Rn.call(t);return n&&(e?t[In]=r:delete t[In]),o}(t):function(t){return mn.call(t)}(t)},jn=Array.isArray,wn=function(t){return null!=t&&"object"==typeof t},Pn=function(t){return"string"==typeof t||!jn(t)&&wn(t)&&"[object String]"==An(t)},Dn=/^([a-zA-Z0-9]|_|-)+$/,Cn=function(t){return function(t){return"number"==typeof t||wn(t)&&"[object Number]"==An(t)}(t)&&t>=0};!function(t){t.SDK="SDK",t.PREVIEW="PREVIEW"}(an||(an={})),function(t){t.BOOTSTRAP="Bootstrap",t.CHANGE_POSITION="ChangePosition",t.CLOSE_PREVIEW="ClosePreview",t.PREVIEW_LOADED="PreviewLoaded",t.SET_AVALIABLE_PORTALS="SetAvaliablePortals",t.SET_CONTENT="SetContent",t.SET_SELECTED_ELEMENT="SetSelectedElement",t.SET_VIEW_MODE="SetViewMode",t.ADD_ELEMENT="AddElement",t.REMOVE_ELEMENT="RemoveElement",t.UPDATE_ELEMENT="UpdateElement",t.SET_ELEMENT="SetElement"}(un||(un={})),(cn||(cn={})).ON_CLICK="OnClick",function(t){t.NATIVE="Native",t.PENDO="Pendo"}(sn||(sn={})),function(t){t.NAVIGATE="Navigate",t.CHANGE_TUTORIAL="ChangeTutorial",t.OPEN_GUIDE="OpenGuide"}(ln||(ln={})),function(t){t.PRIMARY="primary",t.SECONDARY="primary",t.WARNING="warning",t.DANGER="danger",t.NEUTRAL="neutral",t.ACTIVE="active",t.INFO="info"}(fn||(fn={}));var Ln;fn.PRIMARY;!function(t){t.U="U",t.B="B",t.Em="Em",t.InlineCode="InlineCode"}(Ln||(Ln={}));var Sn,Un,kn,xn,Mn=function(t){return function(t){return Pn(t)&&t.length>=3&&t.length<100&&Dn.test(t)}(t)};!function(t){t.COLLAPSED="Collapsed",t.EXPANDED="Expanded",t.MINIMIZED="Minimized"}(Sn||(Sn={})),function(t){t.TUTORIAL="Tutorial",t.PORTAL="Portal"}(Un||(Un={})),function(t){t.Global="Global",t.Organization="Organization"}(kn||(kn={})),function(t){t.Root="root",t.Rule="rule",t.Atrule="atrule",t.Decl="decl",t.Any="any"}(xn||(xn={}));for(var zn,Wn=function(e,r){var n=r.reduce((function(e,r){var n;return t(t({},e),((n={})[r]=r,n))}),{});return e.content.find((function(t){var e=t.segmentId;return!!n[e]||"Everyone"===e}))},Bn=function(t){return"candu.sdk."+t},Gn=function(t){return Bn("error."+t)},Vn={UNKOWN_NODE_TYPE:"unknown_node_type",UNKOWN_BLOCK_NODE_TYPE:"unkown_block_node_type",UNKOWN_INLINE_NODE_TYPE:"unkown_inline_node_type",UNKOWN_NODE_OBJECT_TYPE:"unkown_node_object_type",TUTORIAL_ERROR:"tutorial_error_boundary",PORTAL_ERROR:"portal_error_boundary",PROVIDER_ERROR:"provider_error_boundary",STYLEGUIDE_MAP_ERROR:"styleguide_map",RENDER_NODE_ERROR:"render_node"},Fn={HEARTBEAT:Bn("heartbeat"),PREVIEW_OPEN:Bn("preview.open"),PORTAL:Bn("portal"),TUTORIAL:Bn("tutorial"),TUTORIAL_INTERACTION:Bn("tutorial.interaction"),PORTAL_ASSET_NOT_FOUND:Gn("portal_asset_not_found"),PORTAL_NO_SEGMENT_IDS:Gn("portal_no_segment_ids"),NO_MATCHING_TUTORIALS:Gn("no_matching_tutorials"),NO_VALID_TUTORIAL_IDENTIFIER:Gn("no_valid_tutorial_identifier"),COMMIT_API_LOADING_ERROR:Gn("commit_api"),TUTORIAL_LOADING_ERROR:Gn("tutorial"),UNKOWN_NODE_TYPE:Gn(Vn.UNKOWN_NODE_TYPE),UNKOWN_INLINE_NODE_TYPE:Gn(Vn.UNKOWN_INLINE_NODE_TYPE),UNKOWN_NODE_OBJECT_TYPE:Gn(Vn.UNKOWN_NODE_OBJECT_TYPE),TUTORIAL_ERROR:Gn(Vn.TUTORIAL_ERROR),PORTAL_ERROR:Gn(Vn.PORTAL_ERROR),PROVIDER_ERROR:Gn(Vn.PROVIDER_ERROR),STYLEGUIDE_MAP_ERROR:Gn(Vn.TUTORIAL_ERROR),RENDER_NODE_ERROR:Gn(Vn.TUTORIAL_ERROR),CIRCULAR_DEPENDENCY_EMBED_PORTAL:Gn("circular_dependecy_embed_portal"),CIRCULAR_DEPENDENCY_EMBED_TUTORIAL:Gn("circular_dependecy_embed_tutorial")},Yn=function(t){return"An error has occured while trying to parse your Tutorial.\nUpgrade the SDK to the latest version to get rid of this error.\nErrorCode: "+t+"."},Kn=((zn={EVENTING_NOT_INITIALIZED:"You tried to send an event, but you haven't initialized eventing.\nThis is happening because you called eventing outside the scope of the CanduProvider. It can be fixed by:\n1. Adding CanduProvider to the root of the application.\n2. Initializing a new Eventing object outside of Candu.\nRead here for more context: http://udn.ac/tracking-not-init.\n"})[Fn.PORTAL_ASSET_NOT_FOUND]="Could not find the requested Portal. This could happen because:\n1. The Portal does not exist or it was deleted.\n2. The Portal has not been made avaliable to be rendered.\n3. CORS Authenticaton failed.\nSee http://udn.ac/portal-not-found for more information.\n",zn[Fn.PORTAL_NO_SEGMENT_IDS]="You have tried to render a Portal that doesn't contain any content.\nAdd content to your Portal: https://udn.ac/update-portals.\n",zn[Fn.NO_MATCHING_TUTORIALS]="The Tutorial will not be rendered because there are no matching segments for the given user.",zn[Fn.NO_VALID_TUTORIAL_IDENTIFIER]="(Candu/Tutorial) You must define one of tutorialId, slug, commitId or contentHashId.",zn[Fn.TUTORIAL_LOADING_ERROR]="An error has occurred while trying to load the Tutorial",zn[Fn.UNKOWN_INLINE_NODE_TYPE]=Yn(Vn.UNKOWN_INLINE_NODE_TYPE),zn[Fn.UNKOWN_NODE_TYPE]=Yn(Vn.UNKOWN_NODE_TYPE),zn[Fn.CIRCULAR_DEPENDENCY_EMBED_PORTAL]="Circular dependency found on Embeded Portal. Please take a look at the Portal Content.",zn[Fn.CIRCULAR_DEPENDENCY_EMBED_TUTORIAL]="Circular dependency found on Embeded Tutorial. Please take a look at the Tutorial Content.",zn[Fn.PORTAL_ERROR]="An error has occured within Portal",zn[Fn.PROVIDER_ERROR]="An error has occured within Provider",zn[Fn.TUTORIAL_ERROR]="An error has occured within Tutorial",zn[Fn.RENDER_NODE_ERROR]="An error has occured while rendering tutorial node",zn[Fn.STYLEGUIDE_MAP_ERROR]="An error has occured while mapping node to styleguide",zn),Hn={Alert:!0,B:!0,Badge:!0,Button:!0,Card:!0,Code:!0,Document:!0,Em:!0,EmbedPortal:!0,EmbedTutorial:!0,Flex:!0,FlexItem:!0,H1:!0,H2:!0,H3:!0,H4:!0,H5:!0,H6:!0,Image:!0,InlineCode:!0,Link:!0,List:!0,ListItem:!0,P:!0,RichText:!0,Spacing:!0,Text:!0,U:!0,View:!0,Player:!0},$n={error:console.error,warning:console.warn},Jn=function(t){var e=t.identify,r=t.track;return{provider:function(t){var n=t.userId,o=t.traits,i=t.styleguide;e(n,o),r(Fn.HEARTBEAT,function(t){var e={};return Object.keys(t).forEach((function(r){Hn[r]&&(e["styleguide."+r]=t[r].displayName||!0)})),e}(i))},tutorialDocumentLoadingError:function(t){var e=t.tutorialId,n=t.slug,o=t.contentHashId;$n.error(Kn[Fn.TUTORIAL_LOADING_ERROR]),r(Fn.TUTORIAL_LOADING_ERROR,{tutorialId:e,slug:n,contentHashId:o})}}},Zn=function(t,e){return function(t){var e="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(e){var r=new Uint8Array(16);t.exports=function(){return e(r),r}}else{var n=new Array(16);t.exports=function(){for(var t,e=0;e<16;e++)0==(3&e)&&(t=4294967296*Math.random()),n[e]=t>>>((3&e)<<3)&255;return n}}}(e={exports:{}}),e.exports}(),qn=[],Xn=0;Xn<256;++Xn)qn[Xn]=(Xn+256).toString(16).substr(1);var Qn,to,eo=function(t,e,r){var n=e&&r||0;"string"==typeof t&&(e="binary"===t?new Array(16):null,t=null);var o=(t=t||{}).random||(t.rng||Zn)();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,e)for(var i=0;i<16;++i)e[n+i]=o[i];return e||function(t,e){var r=e||0,n=qn;return[n[t[r++]],n[t[r++]],n[t[r++]],n[t[r++]],"-",n[t[r++]],n[t[r++]],"-",n[t[r++]],n[t[r++]],"-",n[t[r++]],n[t[r++]],"-",n[t[r++]],n[t[r++]],n[t[r++]],n[t[r++]],n[t[r++]],n[t[r++]]].join("")}(o)};!function(t){t.UserGenerated="UserGenerated",t.SDK="SDK"}(Qn||(Qn={})),function(t){t.Identify="Identify",t.Group="Group",t.Track="Track",t.Page="Page",t.Screen="Screen"}(to||(to={}));var ro,no=function(){return"undefined"!=typeof window&&window.localStorage},oo=function(t){return function(e){no()&&null!=e&&window.localStorage.setItem(t,JSON.stringify(e))}},io={anonymousId:{getOrCreate:("candu:anonymous_id",ro=function(){var t=eo();return oo("candu:anonymous_id")(t),t},function(){return function(){if(no()){var t=window.localStorage.getItem("candu:anonymous_id");if(t)try{return JSON.parse(t)}catch(t){return null}}}()||ro()}),set:oo("candu:anonymous_id")}}.anonymousId.getOrCreate,ao=function(t,e,r,n,o,i,a,u){if(!t){var c;if(void 0===e)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var s=[r,n,o,i,a,u],l=0;(c=new Error(e.replace(/%s/g,(function(){return s[l++]})))).name="Invariant Violation"}throw c.framesToPop=1,c}},uo=function(t){return ao(!t||T(t),"(Candu) styleguide must be undefined or an object")},co=function(r){var n=r.clientToken,o=r.userId,i=r.traits,a=r.options,u=r.styleguide,c=e(r,["clientToken","userId","traits","options","styleguide"]);return ao(function(t){return Pn(t)&&!!t.match(/^[0-9a-zA-Z]*$/)&&t.length>=10}(n),"(Candu) you must provide a valid clientToken"),ao(!o||function(t){return Cn(t)||Pn(t)&&t.trim().length>0}(o),"(Candu) you must provide a valid userId"),uo(u),ao(!i||T(i),"(Candu) traits must be undefined or an object"),ao(!a||T(a),"(Candu) options must be undefined or an object"),t(t({},c),{clientToken:n,traits:i||{},options:a||{},styleguide:u||{},userId:o||io()})},so=function(r){var n=r.slug,o=r.styleguide,i=r.contentHashId,a=r.tutorialId,u=r.tutorialDocument,c=r.renderedByClient,s=e(r,["slug","styleguide","contentHashId","tutorialId","tutorialDocument","renderedByClient"]);return uo(o),t(t({},s),{slug:n,styleguide:o||{},contentHashId:i,tutorialId:a,tutorialDocument:u,renderedByClient:c})},lo=function(t){var e=t.slug,r=t.styleguide;return uo(r),{slug:e,styleguide:r||{}}};var fo="/api/segmentMemberships",po="/api/segmentsDefinition",vo="/api/tutorialMetadata",ho="/api/tutorialDocumentsSdk",yo="wss://2jcfb7pjlf.execute-api.eu-west-1.amazonaws.com/prod",_o=function(t){return r(void 0,void 0,void 0,(function(){return n(this,(function(e){switch(e.label){case 0:return[4,fetch(t)];case 1:return[2,e.sent().json()]}}))}))},bo=function(t){return _o("https://api.candu.ai"+t)},go=function(t){return _o("https://cdn.candu.ai"+t)},Eo={tutorialDocumentLatestSaved:function(t,e){return r(void 0,void 0,void 0,(function(){return n(this,(function(r){return[2,bo(ho+"/"+e+"?token="+t)]}))}))},portalAsset:function(t,e){return r(void 0,void 0,void 0,(function(){return n(this,(function(r){return[2,go("/portals/"+t+"/"+e+"/head.json")]}))}))},segmentMembership:function(t,e){return r(void 0,void 0,void 0,(function(){return n(this,(function(r){return[2,bo(fo+"/"+e+"?token="+t)]}))}))},segmentDefinition:function(t){return r(void 0,void 0,void 0,(function(){return n(this,(function(e){return[2,bo(po+"?token="+t)]}))}))},tutorialMetadata:function(t){return r(void 0,void 0,void 0,(function(){return n(this,(function(e){return[2,bo(vo+"?token="+t)]}))}))},tutorialSocket:function(t,e,r){var n=new WebSocket(yo+"?clientToken="+t+"&tutorialId="+e);return n.onmessage=function(t){var e=JSON.parse(t.data);r(e)},function(){return n.close()}},tutorialDocument:function(t,e,r){var n=t.contentHashId,o=t.tutorialId,i=t.tutorialDocument,a=t.slug,u=function(t){return{byId:function(e){return bo(ho+"?token="+t+"&finder=latestPublished&tutorialId="+e)},bySlug:function(e){return go("/tutorials/"+t+"/"+e+".json")},byContentHash:function(e){return go("/tutorials/"+t+"/"+e+".json")}}}(e);return Mn(a)?u.bySlug(a):function(t){return Cn(t)}(o)?u.byId(o):function(t){return Pn(t)&&!!t.match(/^[0-9a-zA-Z]{40}$/)}(n)?u.byContentHash(n):T(i)?Promise.resolve(i):($n.error(Kn[Fn.NO_VALID_TUTORIAL_IDENTIFIER]),r.track(Fn.NO_VALID_TUTORIAL_IDENTIFIER,{slug:t.slug}),null)}},Oo=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return console.error.apply(console,t)},To=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return console.warn.apply(console,t)},Ro={error:Oo,warning:To},Io=function(t){return DOMParser?(new DOMParser).parseFromString(t,"text/html").body.textContent||"":t},mo=function(){function t(){this.subscribers=[]}return t.prototype.subscribe=function(t){var e=this;return this.subscribers.push(t),function(){e.subscribers[e.subscribers.indexOf(t)]=function(){}}},t.prototype.notify=function(t){this.subscribers.forEach((function(e){return e(t)}))},t.prototype.clear=function(){this.subscribers=[]},t}(),No=function(){function t(){this.onClientUpdateObserver=new mo}return t.prototype.attachClient=function(t){this.client=t,this.onClientUpdateObserver.notify({client:t})},t.prototype.detachClient=function(){this.client=null,this.onClientUpdateObserver.notify({client:null})},t.prototype.onClientUpdate=function(t){var e=this.onClientUpdateObserver.subscribe(t);return this.client&&t({client:this.client}),e},t}();function Ao(t){var e,r,n=function(t){return function(){for(var e,n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];if(r.api)return(e=r.api)[t].apply(e,n);console.warn("Please initialize the SDK by calling Candu.init() before attempting to call "+t)}};return(e=function(){function e(){}return e.init=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return this.api||(e.api=new(t.bind.apply(t,o([void 0],r)))),e.subscriberCallbacks.forEach((function(t){return t()})),e.subscriberCallbacks=[],window.postMessage({source:"CANDU_SINGLETON",payload:{type:"INIT"}},window&&window.origin?window.origin:"*"),e},e.onProviderReady=function(t){if(e.api)return t();e.subscriberCallbacks.push(t)},e}()).subscriberCallbacks=[],e.renderTutorial=n("renderTutorial"),e.renderPortal=n("renderPortal"),e.attachClient=n("attachClient"),e.detachClient=n("detachClient"),e.getProvider=n("getProvider"),r=e,window.Candu=r,r}var jo=function(){function t(t){this.init(t)}return t.prototype.attachClient=function(t){return this.provider.preview.attachClient(t)},t.prototype.detachClient=function(){return this.provider.preview.detachClient()},Object.defineProperty(t.prototype,"provider",{get:function(){return this.getProvider()},enumerable:!0,configurable:!0}),t}(),wo=function(t){switch(t.trigger){case cn.ON_CLICK:default:return"onClick"}},Po=function(e,r){var n=e.data;if(!n||!n.actions)return{};var o=function(e){r.provider.eventing.track(Fn.TUTORIAL_INTERACTION,t(t({},e),r.trackingIdentifiers||{}))};return n.actions.map((function(t){return function(t,e){var r,n,o;switch(t.handler.type){case ln.NAVIGATE:return(r={})[wo(t)]=function(){var r=t.handler,n=r.href,o=r.target;e(t),"Blank"===o?window.open(n,"_blank"):n&&n.includes("mailto:")?window.location=n:document.location.href=n},r;case ln.CHANGE_TUTORIAL:return(n={})[wo(t)]=function(){var e=t.handler.tutorialId;Oo("TODO -> change tutorial",e)},n;case ln.OPEN_GUIDE:return(o={})[wo(t)]=function(){var e=t.handler.guideId;Oo("TODO -> open guide",e)},o;default:return{}}}(t,o)})).reduce((function(e,r){return t(t({},e),r)}),{})},Do=function(t,e){var r=t.props||{},n=t.nodes,o=r.children;return o?"string"==typeof o?Io(o):o:n?n.map(e):null},Co=function(e,r){try{var n=r.provider,o=r.document,i=r.trackingIdentifiers,a=o.nodes[e];if(!a)return Ro.error("Document is corrupted. Refusing to move further."),null;var u=function(t){return Co(t,r)},c=a.type,s=a.props,l=a.css,f=t(t(t({},s||{}),{style:l||{},children:Do(a,u)}),Po(a,{trackingIdentifiers:i,provider:n})),d={nodeId:e,node:a,document:o,render:{node:u,styleguide:function(t,e){return void 0===e&&(e={}),r.renderNode(t,{api:d,attributes:e})},tutorial:function(t){return r.renderTutorial(t)},portal:function(t){return r.renderPortal(t)}},trackingIdentifiers:i},p=d.render.styleguide(c,f);return p||(Ro.error(Kn[Fn.UNKOWN_NODE_TYPE],{type:c}),n.eventing.track(Fn.UNKOWN_NODE_TYPE,{type:c}),null)}catch(t){return Ro.error(Kn[Fn.STYLEGUIDE_MAP_ERROR],t),null}},Lo=jr((function(e,r){var n,o,i=e.provider,a=e.portal,u=e.tutorial,c=i.styleguide;return u&&(o=u.styleguide),a&&(n=a.styleguide),t(t(t(t({},c||{}),n||{}),o||{}),r||{})})),So="",Uo="#EDEDED",ko="#333745",xo="#838792",Mo="#FEFEFE",zo="#FEFEFE",Wo={primary:"#6310E5",secondary:"#59C3C3",tertiary:"#4D515D",warning:"#FCAD0D",danger:"#EE4266"},Bo=function(t){var e=document.createElement("link");e.setAttribute("rel","stylesheet"),e.setAttribute("href","https://cdn.candu.ai/styleguides/applications/"+t+"/default/main.css"),document.head.appendChild(e)};export{Uo as DEFAULT_ALERT_COLOR,So as DEFAULT_ALT,Mo as DEFAULT_TAB_ACTIVE_COLOR,zo as DEFAULT_TAB_COLOR,ko as DEFAULT_TAB_HEADER_COLOR,xo as DEFAULT_TAB_ITEM_COLOR,Kn as ERROR_MESSAGES,Vn as ERROR_SLUGS,Fn as EVENT_NAMES,$n as LOGGER,mo as Observer,No as PreviewContainer,Eo as RESOURCES,Wo as STYLEGUIDE_COLORS,jo as SingletonAPI,vn as TutorialDependencies,pn as adaptCustomNodes,Bo as attachStylesheet,yn as checkCyclicAndAdd,Ao as createSingleton,hn as createTutorialDocumentContext,Hn as defaultStyleguide,Wn as findMatchingSegment,Jn as internalEventing,Oo as logError,To as logWarning,Ro as logger,Co as mapNodeToStyleguide,Lo as mergeStyleguidesFromContext,dn as normalizeCss,lo as portalValidation,co as providerValidation,Io as stripHTML,so as tutorialValidation};
//# sourceMappingURL=index.es.js.map

@@ -15,3 +15,3 @@ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t=t||self)["@candulabs/core"]={})}(this,(function(t){"use strict";

and limitations under the License.
***************************************************************************** */var e=function(){return(e=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function r(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r}function n(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){t.done?o(t.value):new r((function(e){e(t.value)})).then(a,u)}c((n=n.apply(t,e||[])).next())}))}function o(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}function i(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;var n=Array(t),o=0;for(e=0;e<r;e++)for(var i=arguments[e],a=0,u=i.length;a<u;a++,o++)n[o]=i[a];return n}var a="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function u(t,e){return t(e={exports:{}},e.exports),e.exports}var c="object"==typeof a&&a&&a.Object===Object&&a,l="object"==typeof self&&self&&self.Object===Object&&self,s=c||l||Function("return this")(),f=s.Symbol,d=Object.prototype,p=d.hasOwnProperty,v=d.toString,h=f?f.toStringTag:void 0;var _=function(t){var e=p.call(t,h),r=t[h];try{t[h]=void 0;var n=!0}catch(t){}var o=v.call(t);return n&&(e?t[h]=r:delete t[h]),o},y=Object.prototype.toString;var b=function(t){return y.call(t)},E="[object Null]",g="[object Undefined]",O=f?f.toStringTag:void 0;var T=function(t){return null==t?void 0===t?g:E:O&&O in Object(t)?_(t):b(t)};var R=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)},m="[object AsyncFunction]",I="[object Function]",A="[object GeneratorFunction]",N="[object Proxy]";var j,w=function(t){if(!R(t))return!1;var e=T(t);return e==I||e==A||e==m||e==N},C=s["__core-js_shared__"],D=(j=/[^.]+$/.exec(C&&C.keys&&C.keys.IE_PROTO||""))?"Symbol(src)_1."+j:"";var P=function(t){return!!D&&D in t},L=Function.prototype.toString;var S=function(t){if(null!=t){try{return L.call(t)}catch(t){}try{return t+""}catch(t){}}return""},U=/^\[object .+?Constructor\]$/,k=Function.prototype,x=Object.prototype,M=k.toString,z=x.hasOwnProperty,B=RegExp("^"+M.call(z).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var G=function(t){return!(!R(t)||P(t))&&(w(t)?B:U).test(S(t))};var V=function(t,e){return null==t?void 0:t[e]};var W=function(t,e){var r=V(t,e);return G(r)?r:void 0},F=function(){try{var t=W(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();var Y=function(t,e,r){"__proto__"==e&&F?F(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r};var H=function(t){return function(e,r,n){for(var o=-1,i=Object(e),a=n(e),u=a.length;u--;){var c=a[t?u:++o];if(!1===r(i[c],c,i))break}return e}}();var K=function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n};var $=function(t){return null!=t&&"object"==typeof t},J="[object Arguments]";var Z=function(t){return $(t)&&T(t)==J},q=Object.prototype,X=q.hasOwnProperty,Q=q.propertyIsEnumerable,tt=Z(function(){return arguments}())?Z:function(t){return $(t)&&X.call(t,"callee")&&!Q.call(t,"callee")},et=Array.isArray;var rt=function(){return!1},nt=u((function(t,e){var r=e&&!e.nodeType&&e,n=r&&t&&!t.nodeType&&t,o=n&&n.exports===r?s.Buffer:void 0,i=(o?o.isBuffer:void 0)||rt;t.exports=i})),ot=9007199254740991,it=/^(?:0|[1-9]\d*)$/;var at=function(t,e){var r=typeof t;return!!(e=null==e?ot:e)&&("number"==r||"symbol"!=r&&it.test(t))&&t>-1&&t%1==0&&t<e},ut=9007199254740991;var ct=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=ut},lt={};lt["[object Float32Array]"]=lt["[object Float64Array]"]=lt["[object Int8Array]"]=lt["[object Int16Array]"]=lt["[object Int32Array]"]=lt["[object Uint8Array]"]=lt["[object Uint8ClampedArray]"]=lt["[object Uint16Array]"]=lt["[object Uint32Array]"]=!0,lt["[object Arguments]"]=lt["[object Array]"]=lt["[object ArrayBuffer]"]=lt["[object Boolean]"]=lt["[object DataView]"]=lt["[object Date]"]=lt["[object Error]"]=lt["[object Function]"]=lt["[object Map]"]=lt["[object Number]"]=lt["[object Object]"]=lt["[object RegExp]"]=lt["[object Set]"]=lt["[object String]"]=lt["[object WeakMap]"]=!1;var st=function(t){return $(t)&&ct(t.length)&&!!lt[T(t)]};var ft=function(t){return function(e){return t(e)}},dt=u((function(t,e){var r=e&&!e.nodeType&&e,n=r&&t&&!t.nodeType&&t,o=n&&n.exports===r&&c.process,i=function(){try{var t=n&&n.require&&n.require("util").types;return t||o&&o.binding&&o.binding("util")}catch(t){}}();t.exports=i})),pt=dt&&dt.isTypedArray,vt=pt?ft(pt):st,ht=Object.prototype.hasOwnProperty;var _t=function(t,e){var r=et(t),n=!r&&tt(t),o=!r&&!n&&nt(t),i=!r&&!n&&!o&&vt(t),a=r||n||o||i,u=a?K(t.length,String):[],c=u.length;for(var l in t)!e&&!ht.call(t,l)||a&&("length"==l||o&&("offset"==l||"parent"==l)||i&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||at(l,c))||u.push(l);return u},yt=Object.prototype;var bt=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||yt)};var Et=function(t,e){return function(r){return t(e(r))}}(Object.keys,Object),gt=Object.prototype.hasOwnProperty;var Ot=function(t){if(!bt(t))return Et(t);var e=[];for(var r in Object(t))gt.call(t,r)&&"constructor"!=r&&e.push(r);return e};var Tt=function(t){return null!=t&&ct(t.length)&&!w(t)};var Rt=function(t){return Tt(t)?_t(t):Ot(t)};var mt=function(t,e){return t&&H(t,e,Rt)};var It=function(){this.__data__=[],this.size=0};var At=function(t,e){return t===e||t!=t&&e!=e};var Nt=function(t,e){for(var r=t.length;r--;)if(At(t[r][0],e))return r;return-1},jt=Array.prototype.splice;var wt=function(t){var e=this.__data__,r=Nt(e,t);return!(r<0)&&(r==e.length-1?e.pop():jt.call(e,r,1),--this.size,!0)};var Ct=function(t){var e=this.__data__,r=Nt(e,t);return r<0?void 0:e[r][1]};var Dt=function(t){return Nt(this.__data__,t)>-1};var Pt=function(t,e){var r=this.__data__,n=Nt(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this};function Lt(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Lt.prototype.clear=It,Lt.prototype.delete=wt,Lt.prototype.get=Ct,Lt.prototype.has=Dt,Lt.prototype.set=Pt;var St=Lt;var Ut=function(){this.__data__=new St,this.size=0};var kt=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r};var xt=function(t){return this.__data__.get(t)};var Mt=function(t){return this.__data__.has(t)},zt=W(s,"Map"),Bt=W(Object,"create");var Gt=function(){this.__data__=Bt?Bt(null):{},this.size=0};var Vt=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},Wt="__lodash_hash_undefined__",Ft=Object.prototype.hasOwnProperty;var Yt=function(t){var e=this.__data__;if(Bt){var r=e[t];return r===Wt?void 0:r}return Ft.call(e,t)?e[t]:void 0},Ht=Object.prototype.hasOwnProperty;var Kt=function(t){var e=this.__data__;return Bt?void 0!==e[t]:Ht.call(e,t)},$t="__lodash_hash_undefined__";var Jt=function(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=Bt&&void 0===e?$t:e,this};function Zt(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Zt.prototype.clear=Gt,Zt.prototype.delete=Vt,Zt.prototype.get=Yt,Zt.prototype.has=Kt,Zt.prototype.set=Jt;var qt=Zt;var Xt=function(){this.size=0,this.__data__={hash:new qt,map:new(zt||St),string:new qt}};var Qt=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t};var te=function(t,e){var r=t.__data__;return Qt(e)?r["string"==typeof e?"string":"hash"]:r.map};var ee=function(t){var e=te(this,t).delete(t);return this.size-=e?1:0,e};var re=function(t){return te(this,t).get(t)};var ne=function(t){return te(this,t).has(t)};var oe=function(t,e){var r=te(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this};function ie(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}ie.prototype.clear=Xt,ie.prototype.delete=ee,ie.prototype.get=re,ie.prototype.has=ne,ie.prototype.set=oe;var ae=ie,ue=200;var ce=function(t,e){var r=this.__data__;if(r instanceof St){var n=r.__data__;if(!zt||n.length<ue-1)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new ae(n)}return r.set(t,e),this.size=r.size,this};function le(t){var e=this.__data__=new St(t);this.size=e.size}le.prototype.clear=Ut,le.prototype.delete=kt,le.prototype.get=xt,le.prototype.has=Mt,le.prototype.set=ce;var se=le,fe="__lodash_hash_undefined__";var de=function(t){return this.__data__.set(t,fe),this};var pe=function(t){return this.__data__.has(t)};function ve(t){var e=-1,r=null==t?0:t.length;for(this.__data__=new ae;++e<r;)this.add(t[e])}ve.prototype.add=ve.prototype.push=de,ve.prototype.has=pe;var he=ve;var _e=function(t,e){for(var r=-1,n=null==t?0:t.length;++r<n;)if(e(t[r],r,t))return!0;return!1};var ye=function(t,e){return t.has(e)},be=1,Ee=2;var ge=function(t,e,r,n,o,i){var a=r&be,u=t.length,c=e.length;if(u!=c&&!(a&&c>u))return!1;var l=i.get(t);if(l&&i.get(e))return l==e;var s=-1,f=!0,d=r&Ee?new he:void 0;for(i.set(t,e),i.set(e,t);++s<u;){var p=t[s],v=e[s];if(n)var h=a?n(v,p,s,e,t,i):n(p,v,s,t,e,i);if(void 0!==h){if(h)continue;f=!1;break}if(d){if(!_e(e,(function(t,e){if(!ye(d,e)&&(p===t||o(p,t,r,n,i)))return d.push(e)}))){f=!1;break}}else if(p!==v&&!o(p,v,r,n,i)){f=!1;break}}return i.delete(t),i.delete(e),f},Oe=s.Uint8Array;var Te=function(t){var e=-1,r=Array(t.size);return t.forEach((function(t,n){r[++e]=[n,t]})),r};var Re=function(t){var e=-1,r=Array(t.size);return t.forEach((function(t){r[++e]=t})),r},me=1,Ie=2,Ae="[object Boolean]",Ne="[object Date]",je="[object Error]",we="[object Map]",Ce="[object Number]",De="[object RegExp]",Pe="[object Set]",Le="[object String]",Se="[object Symbol]",Ue="[object ArrayBuffer]",ke="[object DataView]",xe=f?f.prototype:void 0,Me=xe?xe.valueOf:void 0;var ze=function(t,e,r,n,o,i,a){switch(r){case ke:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case Ue:return!(t.byteLength!=e.byteLength||!i(new Oe(t),new Oe(e)));case Ae:case Ne:case Ce:return At(+t,+e);case je:return t.name==e.name&&t.message==e.message;case De:case Le:return t==e+"";case we:var u=Te;case Pe:var c=n&me;if(u||(u=Re),t.size!=e.size&&!c)return!1;var l=a.get(t);if(l)return l==e;n|=Ie,a.set(t,e);var s=ge(u(t),u(e),n,o,i,a);return a.delete(t),s;case Se:if(Me)return Me.call(t)==Me.call(e)}return!1};var Be=function(t,e){for(var r=-1,n=e.length,o=t.length;++r<n;)t[o+r]=e[r];return t};var Ge=function(t,e,r){var n=e(t);return et(t)?n:Be(n,r(t))};var Ve=function(t,e){for(var r=-1,n=null==t?0:t.length,o=0,i=[];++r<n;){var a=t[r];e(a,r,t)&&(i[o++]=a)}return i};var We=function(){return[]},Fe=Object.prototype.propertyIsEnumerable,Ye=Object.getOwnPropertySymbols,He=Ye?function(t){return null==t?[]:(t=Object(t),Ve(Ye(t),(function(e){return Fe.call(t,e)})))}:We;var Ke=function(t){return Ge(t,Rt,He)},$e=1,Je=Object.prototype.hasOwnProperty;var Ze=function(t,e,r,n,o,i){var a=r&$e,u=Ke(t),c=u.length;if(c!=Ke(e).length&&!a)return!1;for(var l=c;l--;){var s=u[l];if(!(a?s in e:Je.call(e,s)))return!1}var f=i.get(t);if(f&&i.get(e))return f==e;var d=!0;i.set(t,e),i.set(e,t);for(var p=a;++l<c;){var v=t[s=u[l]],h=e[s];if(n)var _=a?n(h,v,s,e,t,i):n(v,h,s,t,e,i);if(!(void 0===_?v===h||o(v,h,r,n,i):_)){d=!1;break}p||(p="constructor"==s)}if(d&&!p){var y=t.constructor,b=e.constructor;y!=b&&"constructor"in t&&"constructor"in e&&!("function"==typeof y&&y instanceof y&&"function"==typeof b&&b instanceof b)&&(d=!1)}return i.delete(t),i.delete(e),d},qe=W(s,"DataView"),Xe=W(s,"Promise"),Qe=W(s,"Set"),tr=W(s,"WeakMap"),er=S(qe),rr=S(zt),nr=S(Xe),or=S(Qe),ir=S(tr),ar=T;(qe&&"[object DataView]"!=ar(new qe(new ArrayBuffer(1)))||zt&&"[object Map]"!=ar(new zt)||Xe&&"[object Promise]"!=ar(Xe.resolve())||Qe&&"[object Set]"!=ar(new Qe)||tr&&"[object WeakMap]"!=ar(new tr))&&(ar=function(t){var e=T(t),r="[object Object]"==e?t.constructor:void 0,n=r?S(r):"";if(n)switch(n){case er:return"[object DataView]";case rr:return"[object Map]";case nr:return"[object Promise]";case or:return"[object Set]";case ir:return"[object WeakMap]"}return e});var ur=ar,cr=1,lr="[object Arguments]",sr="[object Array]",fr="[object Object]",dr=Object.prototype.hasOwnProperty;var pr=function(t,e,r,n,o,i){var a=et(t),u=et(e),c=a?sr:ur(t),l=u?sr:ur(e),s=(c=c==lr?fr:c)==fr,f=(l=l==lr?fr:l)==fr,d=c==l;if(d&&nt(t)){if(!nt(e))return!1;a=!0,s=!1}if(d&&!s)return i||(i=new se),a||vt(t)?ge(t,e,r,n,o,i):ze(t,e,c,r,n,o,i);if(!(r&cr)){var p=s&&dr.call(t,"__wrapped__"),v=f&&dr.call(e,"__wrapped__");if(p||v){var h=p?t.value():t,_=v?e.value():e;return i||(i=new se),o(h,_,r,n,i)}}return!!d&&(i||(i=new se),Ze(t,e,r,n,o,i))};var vr=function t(e,r,n,o,i){return e===r||(null==e||null==r||!$(e)&&!$(r)?e!=e&&r!=r:pr(e,r,n,o,t,i))},hr=1,_r=2;var yr=function(t,e,r,n){var o=r.length,i=o,a=!n;if(null==t)return!i;for(t=Object(t);o--;){var u=r[o];if(a&&u[2]?u[1]!==t[u[0]]:!(u[0]in t))return!1}for(;++o<i;){var c=(u=r[o])[0],l=t[c],s=u[1];if(a&&u[2]){if(void 0===l&&!(c in t))return!1}else{var f=new se;if(n)var d=n(l,s,c,t,e,f);if(!(void 0===d?vr(s,l,hr|_r,n,f):d))return!1}}return!0};var br=function(t){return t==t&&!R(t)};var Er=function(t){for(var e=Rt(t),r=e.length;r--;){var n=e[r],o=t[n];e[r]=[n,o,br(o)]}return e};var gr=function(t,e){return function(r){return null!=r&&(r[t]===e&&(void 0!==e||t in Object(r)))}};var Or=function(t){var e=Er(t);return 1==e.length&&e[0][2]?gr(e[0][0],e[0][1]):function(r){return r===t||yr(r,t,e)}},Tr="[object Symbol]";var Rr=function(t){return"symbol"==typeof t||$(t)&&T(t)==Tr},mr=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ir=/^\w*$/;var Ar=function(t,e){if(et(t))return!1;var r=typeof t;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=t&&!Rr(t))||(Ir.test(t)||!mr.test(t)||null!=e&&t in Object(e))},Nr="Expected a function";function jr(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError(Nr);var r=function(){var n=arguments,o=e?e.apply(this,n):n[0],i=r.cache;if(i.has(o))return i.get(o);var a=t.apply(this,n);return r.cache=i.set(o,a)||i,a};return r.cache=new(jr.Cache||ae),r}jr.Cache=ae;var wr=jr,Cr=500;var Dr=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Pr=/\\(\\)?/g,Lr=function(t){var e=wr(t,(function(t){return r.size===Cr&&r.clear(),t})),r=e.cache;return e}((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(Dr,(function(t,r,n,o){e.push(n?o.replace(Pr,"$1"):r||t)})),e}));var Sr=function(t,e){for(var r=-1,n=null==t?0:t.length,o=Array(n);++r<n;)o[r]=e(t[r],r,t);return o},Ur=1/0,kr=f?f.prototype:void 0,xr=kr?kr.toString:void 0;var Mr=function t(e){if("string"==typeof e)return e;if(et(e))return Sr(e,t)+"";if(Rr(e))return xr?xr.call(e):"";var r=e+"";return"0"==r&&1/e==-Ur?"-0":r};var zr=function(t){return null==t?"":Mr(t)};var Br=function(t,e){return et(t)?t:Ar(t,e)?[t]:Lr(zr(t))},Gr=1/0;var Vr=function(t){if("string"==typeof t||Rr(t))return t;var e=t+"";return"0"==e&&1/t==-Gr?"-0":e};var Wr=function(t,e){for(var r=0,n=(e=Br(e,t)).length;null!=t&&r<n;)t=t[Vr(e[r++])];return r&&r==n?t:void 0};var Fr=function(t,e,r){var n=null==t?void 0:Wr(t,e);return void 0===n?r:n};var Yr=function(t,e){return null!=t&&e in Object(t)};var Hr=function(t,e,r){for(var n=-1,o=(e=Br(e,t)).length,i=!1;++n<o;){var a=Vr(e[n]);if(!(i=null!=t&&r(t,a)))break;t=t[a]}return i||++n!=o?i:!!(o=null==t?0:t.length)&&ct(o)&&at(a,o)&&(et(t)||tt(t))};var Kr=function(t,e){return null!=t&&Hr(t,e,Yr)},$r=1,Jr=2;var Zr=function(t,e){return Ar(t)&&br(e)?gr(Vr(t),e):function(r){var n=Fr(r,t);return void 0===n&&n===e?Kr(r,t):vr(e,n,$r|Jr)}};var qr=function(t){return t};var Xr=function(t){return function(e){return null==e?void 0:e[t]}};var Qr=function(t){return function(e){return Wr(e,t)}};var tn=function(t){return Ar(t)?Xr(Vr(t)):Qr(t)};var en=function(t){return"function"==typeof t?t:null==t?qr:"object"==typeof t?et(t)?Zr(t[0],t[1]):Or(t):tn(t)};var rn=function(t,e){var r={};return e=en(e),mt(t,(function(t,n,o){Y(r,n,e(t,n,o))})),r},nn={boxFlex:!0,boxFlexGroup:!0,columnCount:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,strokeDashoffset:!0,strokeOpacity:!0,strokeWidth:!0};var on=["Webkit","ms","Moz","O"];Object.keys(nn).forEach((function(t){on.forEach((function(e){nn[function(t,e){return t+e.charAt(0).toUpperCase()+e.substring(1)}(e,t)]=nn[t]}))}));var an={isUnitlessNumber:nn,shorthandPropertyExpansions:{background:{backgroundImage:!0,backgroundPosition:!0,backgroundRepeat:!0,backgroundColor:!0},border:{borderWidth:!0,borderStyle:!0,borderColor:!0},borderBottom:{borderBottomWidth:!0,borderBottomStyle:!0,borderBottomColor:!0},borderLeft:{borderLeftWidth:!0,borderLeftStyle:!0,borderLeftColor:!0},borderRight:{borderRightWidth:!0,borderRightStyle:!0,borderRightColor:!0},borderTop:{borderTopWidth:!0,borderTopStyle:!0,borderTopColor:!0},font:{fontStyle:!0,fontVariant:!0,fontWeight:!0,fontSize:!0,lineHeight:!0,fontFamily:!0}}};var un,cn,ln,sn,fn,dn,pn=function(t){var r=t.css,n={};return Object.entries(r).forEach((function(t){var e=t[0],r=t[1];if("number"==typeof r)return an.isUnitlessNumber[e]?void(n[e]=""+r):void(n[e]=r+"px");n[e]=r})),e(e({},t),{css:e(e({},n),{boxSizing:"border-box"})})},vn=function(){function t(t){this.adjacencyList={},this.rootDocument=t,this.adjacencyList[t]=[]}return t.prototype.get=function(t){return this.adjacencyList[t]},t.prototype.add=function(t,e){var r=this;if(this.adjacencyList[t]||(this.adjacencyList[t]=[]),!this.adjacencyList[e])return this.adjacencyList[t].push(e),this.adjacencyList[e]=[],!0;if(this.adjacencyList[t].includes(e))return!0;var n=function(e){if(e===t)return!0;for(var o=0,i=r.adjacencyList[e];o<i.length;o++){var a=i[o];if(n(a))return!0}return!1};return!n(e)&&(this.adjacencyList[t].push(e),!0)},t}(),hn="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},_n="object"==typeof hn&&hn&&hn.Object===Object&&hn,yn="object"==typeof self&&self&&self.Object===Object&&self,bn=(_n||yn||Function("return this")()).Symbol,En=Object.prototype,gn=En.hasOwnProperty,On=En.toString,Tn=bn?bn.toStringTag:void 0,Rn=Object.prototype.toString,mn=bn?bn.toStringTag:void 0,In=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":mn&&mn in Object(t)?function(t){var e=gn.call(t,Tn),r=t[Tn];try{t[Tn]=void 0;var n=!0}catch(t){}var o=On.call(t);return n&&(e?t[Tn]=r:delete t[Tn]),o}(t):function(t){return Rn.call(t)}(t)},An=Array.isArray,Nn=function(t){return null!=t&&"object"==typeof t},jn=function(t){return"string"==typeof t||!An(t)&&Nn(t)&&"[object String]"==In(t)},wn=/^([a-zA-Z0-9]|_|-)+$/,Cn=function(t){return function(t){return"number"==typeof t||Nn(t)&&"[object Number]"==In(t)}(t)&&t>=0};!function(t){t.SDK="SDK",t.PREVIEW="PREVIEW"}(un||(un={})),function(t){t.BOOTSTRAP="Bootstrap",t.CHANGE_POSITION="ChangePosition",t.CLOSE_PREVIEW="ClosePreview",t.PREVIEW_LOADED="PreviewLoaded",t.SET_AVALIABLE_PORTALS="SetAvaliablePortals",t.SET_CONTENT="SetContent",t.SET_SELECTED_ELEMENT="SetSelectedElement",t.SET_VIEW_MODE="SetViewMode",t.ADD_ELEMENT="AddElement",t.REMOVE_ELEMENT="RemoveElement",t.UPDATE_ELEMENT="UpdateElement",t.SET_ELEMENT="SetElement"}(cn||(cn={})),function(t){t.ON_CLICK="OnClick"}(ln||(ln={})),function(t){t.NATIVE="Native",t.PENDO="Pendo"}(sn||(sn={})),function(t){t.NAVIGATE="Navigate",t.CHANGE_TUTORIAL="ChangeTutorial",t.OPEN_GUIDE="OpenGuide"}(fn||(fn={})),function(t){t.PRIMARY="primary",t.SECONDARY="primary",t.WARNING="warning",t.DANGER="danger",t.NEUTRAL="neutral",t.ACTIVE="active",t.INFO="info"}(dn||(dn={}));var Dn;dn.PRIMARY;!function(t){t.U="U",t.B="B",t.Em="Em",t.InlineCode="InlineCode"}(Dn||(Dn={}));var Pn,Ln,Sn,Un,kn=function(t){return function(t){return jn(t)&&t.length>=3&&t.length<100&&wn.test(t)}(t)};!function(t){t.COLLAPSED="Collapsed",t.EXPANDED="Expanded",t.MINIMIZED="Minimized"}(Pn||(Pn={})),function(t){t.TUTORIAL="Tutorial",t.PORTAL="Portal"}(Ln||(Ln={})),function(t){t.Global="Global",t.Organization="Organization"}(Sn||(Sn={})),function(t){t.Root="root",t.Rule="rule",t.Atrule="atrule",t.Decl="decl",t.Any="any"}(Un||(Un={}));for(var xn,Mn=function(t){return"candu.sdk."+t},zn=function(t){return Mn("error."+t)},Bn={UNKOWN_NODE_TYPE:"unknown_node_type",UNKOWN_BLOCK_NODE_TYPE:"unkown_block_node_type",UNKOWN_INLINE_NODE_TYPE:"unkown_inline_node_type",UNKOWN_NODE_OBJECT_TYPE:"unkown_node_object_type",TUTORIAL_ERROR:"tutorial_error_boundary",PORTAL_ERROR:"portal_error_boundary",PROVIDER_ERROR:"provider_error_boundary",STYLEGUIDE_MAP_ERROR:"styleguide_map",RENDER_NODE_ERROR:"render_node"},Gn={HEARTBEAT:Mn("heartbeat"),PREVIEW_OPEN:Mn("preview.open"),PORTAL:Mn("portal"),TUTORIAL:Mn("tutorial"),TUTORIAL_INTERACTION:Mn("tutorial.interaction"),PORTAL_ASSET_NOT_FOUND:zn("portal_asset_not_found"),PORTAL_NO_SEGMENT_IDS:zn("portal_no_segment_ids"),NO_MATCHING_TUTORIALS:zn("no_matching_tutorials"),NO_VALID_TUTORIAL_IDENTIFIER:zn("no_valid_tutorial_identifier"),COMMIT_API_LOADING_ERROR:zn("commit_api"),TUTORIAL_LOADING_ERROR:zn("tutorial"),UNKOWN_NODE_TYPE:zn(Bn.UNKOWN_NODE_TYPE),UNKOWN_INLINE_NODE_TYPE:zn(Bn.UNKOWN_INLINE_NODE_TYPE),UNKOWN_NODE_OBJECT_TYPE:zn(Bn.UNKOWN_NODE_OBJECT_TYPE),TUTORIAL_ERROR:zn(Bn.TUTORIAL_ERROR),PORTAL_ERROR:zn(Bn.PORTAL_ERROR),PROVIDER_ERROR:zn(Bn.PROVIDER_ERROR),STYLEGUIDE_MAP_ERROR:zn(Bn.TUTORIAL_ERROR),RENDER_NODE_ERROR:zn(Bn.TUTORIAL_ERROR),CIRCULAR_DEPENDENCY_EMBED_PORTAL:zn("circular_dependecy_embed_portal"),CIRCULAR_DEPENDENCY_EMBED_TUTORIAL:zn("circular_dependecy_embed_tutorial")},Vn=function(t){return"An error has occured while trying to parse your Tutorial.\nUpgrade the SDK to the latest version to get rid of this error.\nErrorCode: "+t+"."},Wn=((xn={EVENTING_NOT_INITIALIZED:"You tried to send an event, but you haven't initialized eventing.\nThis is happening because you called eventing outside the scope of the CanduProvider. It can be fixed by:\n1. Adding CanduProvider to the root of the application.\n2. Initializing a new Eventing object outside of Candu.\nRead here for more context: http://udn.ac/tracking-not-init.\n"})[Gn.PORTAL_ASSET_NOT_FOUND]="Could not find the requested Portal. This could happen because:\n1. The Portal does not exist or it was deleted.\n2. The Portal has not been made avaliable to be rendered.\n3. CORS Authenticaton failed.\nSee http://udn.ac/portal-not-found for more information.\n",xn[Gn.PORTAL_NO_SEGMENT_IDS]="You have tried to render a Portal that doesn't contain any content.\nAdd content to your Portal: https://udn.ac/update-portals.\n",xn[Gn.NO_MATCHING_TUTORIALS]="The Tutorial will not be rendered because there are no matching segments for the given user.",xn[Gn.NO_VALID_TUTORIAL_IDENTIFIER]="(Candu/Tutorial) You must define one of tutorialId, slug, commitId or contentHashId.",xn[Gn.TUTORIAL_LOADING_ERROR]="An error has occurred while trying to load the Tutorial",xn[Gn.UNKOWN_INLINE_NODE_TYPE]=Vn(Bn.UNKOWN_INLINE_NODE_TYPE),xn[Gn.UNKOWN_NODE_TYPE]=Vn(Bn.UNKOWN_NODE_TYPE),xn[Gn.CIRCULAR_DEPENDENCY_EMBED_PORTAL]="Circular dependency found on Embeded Portal. Please take a look at the Portal Content.",xn[Gn.CIRCULAR_DEPENDENCY_EMBED_TUTORIAL]="Circular dependency found on Embeded Tutorial. Please take a look at the Tutorial Content.",xn[Gn.PORTAL_ERROR]="An error has occured within Portal",xn[Gn.PROVIDER_ERROR]="An error has occured within Provider",xn[Gn.TUTORIAL_ERROR]="An error has occured within Tutorial",xn[Gn.RENDER_NODE_ERROR]="An error has occured while rendering tutorial node",xn[Gn.STYLEGUIDE_MAP_ERROR]="An error has occured while mapping node to styleguide",xn),Fn={Alert:!0,B:!0,Badge:!0,Button:!0,Card:!0,Code:!0,Document:!0,Em:!0,EmbedPortal:!0,EmbedTutorial:!0,Flex:!0,FlexItem:!0,H1:!0,H2:!0,H3:!0,H4:!0,H5:!0,H6:!0,Image:!0,InlineCode:!0,Link:!0,List:!0,ListItem:!0,P:!0,RichText:!0,Spacing:!0,Text:!0,U:!0,View:!0,Player:!0},Yn={error:console.error,warning:console.warn},Hn=function(t,e){return function(t){var e="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(e){var r=new Uint8Array(16);t.exports=function(){return e(r),r}}else{var n=new Array(16);t.exports=function(){for(var t,e=0;e<16;e++)0==(3&e)&&(t=4294967296*Math.random()),n[e]=t>>>((3&e)<<3)&255;return n}}}(e={exports:{}}),e.exports}(),Kn=[],$n=0;$n<256;++$n)Kn[$n]=($n+256).toString(16).substr(1);var Jn,Zn,qn=function(t,e,r){var n=e&&r||0;"string"==typeof t&&(e="binary"===t?new Array(16):null,t=null);var o=(t=t||{}).random||(t.rng||Hn)();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,e)for(var i=0;i<16;++i)e[n+i]=o[i];return e||function(t,e){var r=e||0,n=Kn;return[n[t[r++]],n[t[r++]],n[t[r++]],n[t[r++]],"-",n[t[r++]],n[t[r++]],"-",n[t[r++]],n[t[r++]],"-",n[t[r++]],n[t[r++]],"-",n[t[r++]],n[t[r++]],n[t[r++]],n[t[r++]],n[t[r++]],n[t[r++]]].join("")}(o)};!function(t){t.UserGenerated="UserGenerated",t.SDK="SDK"}(Jn||(Jn={})),function(t){t.Identify="Identify",t.Group="Group",t.Track="Track",t.Page="Page",t.Screen="Screen"}(Zn||(Zn={}));var Xn,Qn=function(){return"undefined"!=typeof window&&window.localStorage},to=function(t){return function(e){Qn()&&null!=e&&window.localStorage.setItem(t,JSON.stringify(e))}},eo={anonymousId:{getOrCreate:("candu:anonymous_id",Xn=function(){var t=qn();return to("candu:anonymous_id")(t),t},function(){return function(){if(Qn()){var t=window.localStorage.getItem("candu:anonymous_id");if(t)try{return JSON.parse(t)}catch(t){return null}}}()||Xn()}),set:to("candu:anonymous_id")}}.anonymousId.getOrCreate,ro=function(t,e,r,n,o,i,a,u){if(!t){var c;if(void 0===e)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=[r,n,o,i,a,u],s=0;(c=new Error(e.replace(/%s/g,(function(){return l[s++]})))).name="Invariant Violation"}throw c.framesToPop=1,c}},no=function(t){return ro(!t||R(t),"(Candu) styleguide must be undefined or an object")};var oo="/api/segmentMemberships",io="/api/segmentsDefinition",ao="/api/tutorialMetadata",uo="/api/tutorialDocumentsSdk",co="wss://2jcfb7pjlf.execute-api.eu-west-1.amazonaws.com/prod",lo=function(t){return n(void 0,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return[4,fetch(t)];case 1:return[2,e.sent().json()]}}))}))},so=function(t){return lo("https://api.candu.ai"+t)},fo=function(t){return lo("https://cdn.candu.ai"+t)},po={tutorialDocumentLatestSaved:function(t,e){return n(void 0,void 0,void 0,(function(){return o(this,(function(r){return[2,so(uo+"/"+e+"?token="+t)]}))}))},portalAsset:function(t,e){return n(void 0,void 0,void 0,(function(){return o(this,(function(r){return[2,fo("/portals/"+t+"/"+e+"/head.json")]}))}))},segmentMembership:function(t,e){return n(void 0,void 0,void 0,(function(){return o(this,(function(r){return[2,so(oo+"/"+e+"?token="+t)]}))}))},segmentDefinition:function(t){return n(void 0,void 0,void 0,(function(){return o(this,(function(e){return[2,so(io+"?token="+t)]}))}))},tutorialMetadata:function(t){return n(void 0,void 0,void 0,(function(){return o(this,(function(e){return[2,so(ao+"?token="+t)]}))}))},tutorialSocket:function(t,e,r){var n=new WebSocket(co+"?clientToken="+t+"&tutorialId="+e);return n.onmessage=function(t){var e=JSON.parse(t.data);r(e)},function(){return n.close()}},tutorialDocument:function(t,e,r){var n=t.contentHashId,o=t.tutorialId,i=t.tutorialDocument,a=t.slug,u=function(t){return{byId:function(e){return so(uo+"?token="+t+"&finder=latestPublished&tutorialId="+e)},bySlug:function(e){return fo("/tutorials/"+t+"/"+e+".json")},byContentHash:function(e){return fo("/tutorials/"+t+"/"+e+".json")}}}(e);return function(t){return Cn(t)}(o)?u.byId(o):kn(a)?u.bySlug(a):function(t){return jn(t)&&!!t.match(/^[0-9a-zA-Z]{40}$/)}(n)?u.byContentHash(n):R(i)?Promise.resolve(i):(Yn.error(Wn[Gn.NO_VALID_TUTORIAL_IDENTIFIER]),r.track(Gn.NO_VALID_TUTORIAL_IDENTIFIER,{slug:t.slug}),null)}},vo=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return console.error.apply(console,t)},ho=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return console.warn.apply(console,t)},_o={error:vo,warning:ho},yo=function(t){return DOMParser?(new DOMParser).parseFromString(t,"text/html").body.textContent||"":t},bo=function(){function t(){this.subscribers=[]}return t.prototype.subscribe=function(t){var e=this;return this.subscribers.push(t),function(){e.subscribers[e.subscribers.indexOf(t)]=function(){}}},t.prototype.notify=function(t){this.subscribers.forEach((function(e){return e(t)}))},t.prototype.clear=function(){this.subscribers=[]},t}(),Eo=function(){function t(){this.onClientUpdateObserver=new bo}return t.prototype.attachClient=function(t){this.client=t,this.onClientUpdateObserver.notify({client:t})},t.prototype.detachClient=function(){this.client=null,this.onClientUpdateObserver.notify({client:null})},t.prototype.onClientUpdate=function(t){var e=this.onClientUpdateObserver.subscribe(t);return this.client&&t({client:this.client}),e},t}();var go=function(){function t(t){this.init(t)}return t.prototype.attachClient=function(t){return this.provider.preview.attachClient(t)},t.prototype.detachClient=function(){return this.provider.preview.detachClient()},Object.defineProperty(t.prototype,"provider",{get:function(){return this.getProvider()},enumerable:!0,configurable:!0}),t}(),Oo=function(t){switch(t.trigger){case ln.ON_CLICK:default:return"onClick"}},To=function(t,r){var n=t.data;if(!n||!n.actions)return{};var o=function(t){r.provider.eventing.track(Gn.TUTORIAL_INTERACTION,e(e({},t),r.trackingIdentifiers||{}))};return n.actions.map((function(t){return function(t,e){var r,n,o;switch(t.handler.type){case fn.NAVIGATE:return(r={})[Oo(t)]=function(){var r=t.handler,n=r.href,o=r.target;e(t),"Blank"===o?window.open(n,"_blank"):n&&n.includes("mailto:")?window.location=n:document.location.href=n},r;case fn.CHANGE_TUTORIAL:return(n={})[Oo(t)]=function(){var e=t.handler.tutorialId;vo("TODO -> change tutorial",e)},n;case fn.OPEN_GUIDE:return(o={})[Oo(t)]=function(){var e=t.handler.guideId;vo("TODO -> open guide",e)},o;default:return{}}}(t,o)})).reduce((function(t,r){return e(e({},t),r)}),{})},Ro=function(t,e){var r=t.props||{},n=t.nodes,o=r.children;return o?"string"==typeof o?yo(o):o:n?n.map(e):null},mo=function(t,r){try{var n=r.provider,o=r.document,i=r.trackingIdentifiers,a=o.nodes[t];if(!a)return _o.error("Document is corrupted. Refusing to move further."),null;var u=function(t){return mo(t,r)},c=a.type,l=a.props,s=a.css,f=e(e(e({},l||{}),{style:s||{},children:Ro(a,u)}),To(a,{trackingIdentifiers:i,provider:n})),d={nodeId:t,node:a,document:o,render:{node:u,styleguide:function(t,e){return void 0===e&&(e={}),r.renderNode(t,{api:d,attributes:e})},tutorial:function(t){return r.renderTutorial(t)},portal:function(t){return r.renderPortal(t)}},trackingIdentifiers:i},p=d.render.styleguide(c,f);return p||(_o.error(Wn[Gn.UNKOWN_NODE_TYPE],{type:c}),n.eventing.track(Gn.UNKOWN_NODE_TYPE,{type:c}),null)}catch(t){return _o.error(Wn[Gn.STYLEGUIDE_MAP_ERROR],t),null}},Io=wr((function(t,r){var n,o,i=t.provider,a=t.portal,u=t.tutorial,c=i.styleguide;return u&&(o=u.styleguide),a&&(n=a.styleguide),e(e(e(e({},c||{}),n||{}),o||{}),r||{})}));t.DEFAULT_ALERT_COLOR="#EDEDED",t.DEFAULT_ALT="",t.DEFAULT_TAB_ACTIVE_COLOR="#FEFEFE",t.DEFAULT_TAB_COLOR="#FEFEFE",t.DEFAULT_TAB_HEADER_COLOR="#333745",t.DEFAULT_TAB_ITEM_COLOR="#838792",t.ERROR_MESSAGES=Wn,t.ERROR_SLUGS=Bn,t.EVENT_NAMES=Gn,t.LOGGER=Yn,t.Observer=bo,t.PreviewContainer=Eo,t.RESOURCES=po,t.STYLEGUIDE_COLORS={primary:"#6310E5",secondary:"#59C3C3",tertiary:"#4D515D",warning:"#FCAD0D",danger:"#EE4266"},t.SingletonAPI=go,t.TutorialDependencies=vn,t.adaptCustomNodes=function(t){return rn(t,(function(t){var r=t;return"Typography"===r.type&&(r=function(t){var r=Fr(t,"data.custom.variant","P");return e(e({},t),{type:r})}(r)),r.css&&R(r.css)&&r.css.flexBasis&&(r=function(t){var r=t.css.flexBasis;return"0"===r||"0px"===r?e(e({},t),{css:e(e({},t.css),{flexBasis:"0%"})}):t}(r)),r.css&&(r=pn(r)),r}))},t.attachStylesheet=function(t){var e=document.createElement("link");e.setAttribute("rel","stylesheet"),e.setAttribute("href","https://cdn.candu.ai/styleguides/applications/"+t+"/default/main.css"),document.head.appendChild(e)},t.checkCyclicAndAdd=function(t,e){return t.dependencies.add(t.id,e)},t.createSingleton=function(t){var e,r,n=function(t){return function(){for(var e,n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];if(r.api)return(e=r.api)[t].apply(e,n);console.warn("Please initialize the SDK by calling Candu.init() before attempting to call "+t)}};return(e=function(){function e(){}return e.init=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return this.api||(e.api=new(t.bind.apply(t,i([void 0],r)))),e.subscriberCallbacks.forEach((function(t){return t()})),e.subscriberCallbacks=[],window.postMessage({source:"CANDU_SINGLETON",payload:{type:"INIT"}},window&&window.origin?window.origin:"*"),e},e.onProviderReady=function(t){if(e.api)return t();e.subscriberCallbacks.push(t)},e}()).subscriberCallbacks=[],e.renderTutorial=n("renderTutorial"),e.renderPortal=n("renderPortal"),e.attachClient=n("attachClient"),e.detachClient=n("detachClient"),e.getProvider=n("getProvider"),r=e,window.Candu=r,r},t.createTutorialDocumentContext=function(t,e){return{id:t,dependencies:e?e.dependencies:new vn(t)}},t.defaultStyleguide=Fn,t.findMatchingSegment=function(t,r){var n=r.reduce((function(t,r){var n;return e(e({},t),((n={})[r]=r,n))}),{});return t.content.find((function(t){var e=t.segmentId;return!!n[e]||"Everyone"===e}))},t.internalEventing=function(t){var e=t.identify,r=t.track;return{provider:function(t){var n=t.userId,o=t.traits,i=t.styleguide;e(n,o),r(Gn.HEARTBEAT,function(t){var e={};return Object.keys(t).forEach((function(r){Fn[r]&&(e["styleguide."+r]=t[r].displayName||!0)})),e}(i))},tutorialDocumentLoadingError:function(t){var e=t.tutorialId,n=t.slug,o=t.contentHashId;Yn.error(Wn[Gn.TUTORIAL_LOADING_ERROR]),r(Gn.TUTORIAL_LOADING_ERROR,{tutorialId:e,slug:n,contentHashId:o})}}},t.logError=vo,t.logWarning=ho,t.logger=_o,t.mapNodeToStyleguide=mo,t.mergeStyleguidesFromContext=Io,t.normalizeCss=pn,t.portalValidation=function(t){var e=t.slug,r=t.styleguide;return no(r),{slug:e,styleguide:r||{}}},t.providerValidation=function(t){var n=t.clientToken,o=t.userId,i=t.traits,a=t.options,u=t.styleguide,c=r(t,["clientToken","userId","traits","options","styleguide"]);return ro(function(t){return jn(t)&&!!t.match(/^[0-9a-zA-Z]*$/)&&t.length>=10}(n),"(Candu) you must provide a valid clientToken"),ro(!o||function(t){return Cn(t)||jn(t)&&t.trim().length>0}(o),"(Candu) you must provide a valid userId"),no(u),ro(!i||R(i),"(Candu) traits must be undefined or an object"),ro(!a||R(a),"(Candu) options must be undefined or an object"),e(e({},c),{clientToken:n,traits:i||{},options:a||{},styleguide:u||{},userId:o||eo()})},t.stripHTML=yo,t.tutorialValidation=function(t){var n=t.slug,o=t.styleguide,i=t.contentHashId,a=t.tutorialId,u=t.tutorialDocument,c=t.renderedByClient,l=r(t,["slug","styleguide","contentHashId","tutorialId","tutorialDocument","renderedByClient"]);return no(o),e(e({},l),{slug:n,styleguide:o||{},contentHashId:i,tutorialId:a,tutorialDocument:u,renderedByClient:c})},Object.defineProperty(t,"__esModule",{value:!0})}));
***************************************************************************** */var e=function(){return(e=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function r(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r}function n(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){t.done?o(t.value):new r((function(e){e(t.value)})).then(a,u)}c((n=n.apply(t,e||[])).next())}))}function o(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}function i(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;var n=Array(t),o=0;for(e=0;e<r;e++)for(var i=arguments[e],a=0,u=i.length;a<u;a++,o++)n[o]=i[a];return n}var a="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function u(t,e){return t(e={exports:{}},e.exports),e.exports}var c="object"==typeof a&&a&&a.Object===Object&&a,l="object"==typeof self&&self&&self.Object===Object&&self,s=c||l||Function("return this")(),f=s.Symbol,d=Object.prototype,p=d.hasOwnProperty,v=d.toString,h=f?f.toStringTag:void 0;var _=function(t){var e=p.call(t,h),r=t[h];try{t[h]=void 0;var n=!0}catch(t){}var o=v.call(t);return n&&(e?t[h]=r:delete t[h]),o},y=Object.prototype.toString;var b=function(t){return y.call(t)},E="[object Null]",g="[object Undefined]",O=f?f.toStringTag:void 0;var T=function(t){return null==t?void 0===t?g:E:O&&O in Object(t)?_(t):b(t)};var R=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)},m="[object AsyncFunction]",I="[object Function]",A="[object GeneratorFunction]",N="[object Proxy]";var j,w=function(t){if(!R(t))return!1;var e=T(t);return e==I||e==A||e==m||e==N},C=s["__core-js_shared__"],D=(j=/[^.]+$/.exec(C&&C.keys&&C.keys.IE_PROTO||""))?"Symbol(src)_1."+j:"";var P=function(t){return!!D&&D in t},L=Function.prototype.toString;var S=function(t){if(null!=t){try{return L.call(t)}catch(t){}try{return t+""}catch(t){}}return""},U=/^\[object .+?Constructor\]$/,k=Function.prototype,x=Object.prototype,M=k.toString,z=x.hasOwnProperty,B=RegExp("^"+M.call(z).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var G=function(t){return!(!R(t)||P(t))&&(w(t)?B:U).test(S(t))};var V=function(t,e){return null==t?void 0:t[e]};var W=function(t,e){var r=V(t,e);return G(r)?r:void 0},F=function(){try{var t=W(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();var Y=function(t,e,r){"__proto__"==e&&F?F(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r};var H=function(t){return function(e,r,n){for(var o=-1,i=Object(e),a=n(e),u=a.length;u--;){var c=a[t?u:++o];if(!1===r(i[c],c,i))break}return e}}();var K=function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n};var $=function(t){return null!=t&&"object"==typeof t},J="[object Arguments]";var Z=function(t){return $(t)&&T(t)==J},q=Object.prototype,X=q.hasOwnProperty,Q=q.propertyIsEnumerable,tt=Z(function(){return arguments}())?Z:function(t){return $(t)&&X.call(t,"callee")&&!Q.call(t,"callee")},et=Array.isArray;var rt=function(){return!1},nt=u((function(t,e){var r=e&&!e.nodeType&&e,n=r&&t&&!t.nodeType&&t,o=n&&n.exports===r?s.Buffer:void 0,i=(o?o.isBuffer:void 0)||rt;t.exports=i})),ot=9007199254740991,it=/^(?:0|[1-9]\d*)$/;var at=function(t,e){var r=typeof t;return!!(e=null==e?ot:e)&&("number"==r||"symbol"!=r&&it.test(t))&&t>-1&&t%1==0&&t<e},ut=9007199254740991;var ct=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=ut},lt={};lt["[object Float32Array]"]=lt["[object Float64Array]"]=lt["[object Int8Array]"]=lt["[object Int16Array]"]=lt["[object Int32Array]"]=lt["[object Uint8Array]"]=lt["[object Uint8ClampedArray]"]=lt["[object Uint16Array]"]=lt["[object Uint32Array]"]=!0,lt["[object Arguments]"]=lt["[object Array]"]=lt["[object ArrayBuffer]"]=lt["[object Boolean]"]=lt["[object DataView]"]=lt["[object Date]"]=lt["[object Error]"]=lt["[object Function]"]=lt["[object Map]"]=lt["[object Number]"]=lt["[object Object]"]=lt["[object RegExp]"]=lt["[object Set]"]=lt["[object String]"]=lt["[object WeakMap]"]=!1;var st=function(t){return $(t)&&ct(t.length)&&!!lt[T(t)]};var ft=function(t){return function(e){return t(e)}},dt=u((function(t,e){var r=e&&!e.nodeType&&e,n=r&&t&&!t.nodeType&&t,o=n&&n.exports===r&&c.process,i=function(){try{var t=n&&n.require&&n.require("util").types;return t||o&&o.binding&&o.binding("util")}catch(t){}}();t.exports=i})),pt=dt&&dt.isTypedArray,vt=pt?ft(pt):st,ht=Object.prototype.hasOwnProperty;var _t=function(t,e){var r=et(t),n=!r&&tt(t),o=!r&&!n&&nt(t),i=!r&&!n&&!o&&vt(t),a=r||n||o||i,u=a?K(t.length,String):[],c=u.length;for(var l in t)!e&&!ht.call(t,l)||a&&("length"==l||o&&("offset"==l||"parent"==l)||i&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||at(l,c))||u.push(l);return u},yt=Object.prototype;var bt=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||yt)};var Et=function(t,e){return function(r){return t(e(r))}}(Object.keys,Object),gt=Object.prototype.hasOwnProperty;var Ot=function(t){if(!bt(t))return Et(t);var e=[];for(var r in Object(t))gt.call(t,r)&&"constructor"!=r&&e.push(r);return e};var Tt=function(t){return null!=t&&ct(t.length)&&!w(t)};var Rt=function(t){return Tt(t)?_t(t):Ot(t)};var mt=function(t,e){return t&&H(t,e,Rt)};var It=function(){this.__data__=[],this.size=0};var At=function(t,e){return t===e||t!=t&&e!=e};var Nt=function(t,e){for(var r=t.length;r--;)if(At(t[r][0],e))return r;return-1},jt=Array.prototype.splice;var wt=function(t){var e=this.__data__,r=Nt(e,t);return!(r<0)&&(r==e.length-1?e.pop():jt.call(e,r,1),--this.size,!0)};var Ct=function(t){var e=this.__data__,r=Nt(e,t);return r<0?void 0:e[r][1]};var Dt=function(t){return Nt(this.__data__,t)>-1};var Pt=function(t,e){var r=this.__data__,n=Nt(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this};function Lt(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Lt.prototype.clear=It,Lt.prototype.delete=wt,Lt.prototype.get=Ct,Lt.prototype.has=Dt,Lt.prototype.set=Pt;var St=Lt;var Ut=function(){this.__data__=new St,this.size=0};var kt=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r};var xt=function(t){return this.__data__.get(t)};var Mt=function(t){return this.__data__.has(t)},zt=W(s,"Map"),Bt=W(Object,"create");var Gt=function(){this.__data__=Bt?Bt(null):{},this.size=0};var Vt=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},Wt="__lodash_hash_undefined__",Ft=Object.prototype.hasOwnProperty;var Yt=function(t){var e=this.__data__;if(Bt){var r=e[t];return r===Wt?void 0:r}return Ft.call(e,t)?e[t]:void 0},Ht=Object.prototype.hasOwnProperty;var Kt=function(t){var e=this.__data__;return Bt?void 0!==e[t]:Ht.call(e,t)},$t="__lodash_hash_undefined__";var Jt=function(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=Bt&&void 0===e?$t:e,this};function Zt(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Zt.prototype.clear=Gt,Zt.prototype.delete=Vt,Zt.prototype.get=Yt,Zt.prototype.has=Kt,Zt.prototype.set=Jt;var qt=Zt;var Xt=function(){this.size=0,this.__data__={hash:new qt,map:new(zt||St),string:new qt}};var Qt=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t};var te=function(t,e){var r=t.__data__;return Qt(e)?r["string"==typeof e?"string":"hash"]:r.map};var ee=function(t){var e=te(this,t).delete(t);return this.size-=e?1:0,e};var re=function(t){return te(this,t).get(t)};var ne=function(t){return te(this,t).has(t)};var oe=function(t,e){var r=te(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this};function ie(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}ie.prototype.clear=Xt,ie.prototype.delete=ee,ie.prototype.get=re,ie.prototype.has=ne,ie.prototype.set=oe;var ae=ie,ue=200;var ce=function(t,e){var r=this.__data__;if(r instanceof St){var n=r.__data__;if(!zt||n.length<ue-1)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new ae(n)}return r.set(t,e),this.size=r.size,this};function le(t){var e=this.__data__=new St(t);this.size=e.size}le.prototype.clear=Ut,le.prototype.delete=kt,le.prototype.get=xt,le.prototype.has=Mt,le.prototype.set=ce;var se=le,fe="__lodash_hash_undefined__";var de=function(t){return this.__data__.set(t,fe),this};var pe=function(t){return this.__data__.has(t)};function ve(t){var e=-1,r=null==t?0:t.length;for(this.__data__=new ae;++e<r;)this.add(t[e])}ve.prototype.add=ve.prototype.push=de,ve.prototype.has=pe;var he=ve;var _e=function(t,e){for(var r=-1,n=null==t?0:t.length;++r<n;)if(e(t[r],r,t))return!0;return!1};var ye=function(t,e){return t.has(e)},be=1,Ee=2;var ge=function(t,e,r,n,o,i){var a=r&be,u=t.length,c=e.length;if(u!=c&&!(a&&c>u))return!1;var l=i.get(t);if(l&&i.get(e))return l==e;var s=-1,f=!0,d=r&Ee?new he:void 0;for(i.set(t,e),i.set(e,t);++s<u;){var p=t[s],v=e[s];if(n)var h=a?n(v,p,s,e,t,i):n(p,v,s,t,e,i);if(void 0!==h){if(h)continue;f=!1;break}if(d){if(!_e(e,(function(t,e){if(!ye(d,e)&&(p===t||o(p,t,r,n,i)))return d.push(e)}))){f=!1;break}}else if(p!==v&&!o(p,v,r,n,i)){f=!1;break}}return i.delete(t),i.delete(e),f},Oe=s.Uint8Array;var Te=function(t){var e=-1,r=Array(t.size);return t.forEach((function(t,n){r[++e]=[n,t]})),r};var Re=function(t){var e=-1,r=Array(t.size);return t.forEach((function(t){r[++e]=t})),r},me=1,Ie=2,Ae="[object Boolean]",Ne="[object Date]",je="[object Error]",we="[object Map]",Ce="[object Number]",De="[object RegExp]",Pe="[object Set]",Le="[object String]",Se="[object Symbol]",Ue="[object ArrayBuffer]",ke="[object DataView]",xe=f?f.prototype:void 0,Me=xe?xe.valueOf:void 0;var ze=function(t,e,r,n,o,i,a){switch(r){case ke:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case Ue:return!(t.byteLength!=e.byteLength||!i(new Oe(t),new Oe(e)));case Ae:case Ne:case Ce:return At(+t,+e);case je:return t.name==e.name&&t.message==e.message;case De:case Le:return t==e+"";case we:var u=Te;case Pe:var c=n&me;if(u||(u=Re),t.size!=e.size&&!c)return!1;var l=a.get(t);if(l)return l==e;n|=Ie,a.set(t,e);var s=ge(u(t),u(e),n,o,i,a);return a.delete(t),s;case Se:if(Me)return Me.call(t)==Me.call(e)}return!1};var Be=function(t,e){for(var r=-1,n=e.length,o=t.length;++r<n;)t[o+r]=e[r];return t};var Ge=function(t,e,r){var n=e(t);return et(t)?n:Be(n,r(t))};var Ve=function(t,e){for(var r=-1,n=null==t?0:t.length,o=0,i=[];++r<n;){var a=t[r];e(a,r,t)&&(i[o++]=a)}return i};var We=function(){return[]},Fe=Object.prototype.propertyIsEnumerable,Ye=Object.getOwnPropertySymbols,He=Ye?function(t){return null==t?[]:(t=Object(t),Ve(Ye(t),(function(e){return Fe.call(t,e)})))}:We;var Ke=function(t){return Ge(t,Rt,He)},$e=1,Je=Object.prototype.hasOwnProperty;var Ze=function(t,e,r,n,o,i){var a=r&$e,u=Ke(t),c=u.length;if(c!=Ke(e).length&&!a)return!1;for(var l=c;l--;){var s=u[l];if(!(a?s in e:Je.call(e,s)))return!1}var f=i.get(t);if(f&&i.get(e))return f==e;var d=!0;i.set(t,e),i.set(e,t);for(var p=a;++l<c;){var v=t[s=u[l]],h=e[s];if(n)var _=a?n(h,v,s,e,t,i):n(v,h,s,t,e,i);if(!(void 0===_?v===h||o(v,h,r,n,i):_)){d=!1;break}p||(p="constructor"==s)}if(d&&!p){var y=t.constructor,b=e.constructor;y!=b&&"constructor"in t&&"constructor"in e&&!("function"==typeof y&&y instanceof y&&"function"==typeof b&&b instanceof b)&&(d=!1)}return i.delete(t),i.delete(e),d},qe=W(s,"DataView"),Xe=W(s,"Promise"),Qe=W(s,"Set"),tr=W(s,"WeakMap"),er=S(qe),rr=S(zt),nr=S(Xe),or=S(Qe),ir=S(tr),ar=T;(qe&&"[object DataView]"!=ar(new qe(new ArrayBuffer(1)))||zt&&"[object Map]"!=ar(new zt)||Xe&&"[object Promise]"!=ar(Xe.resolve())||Qe&&"[object Set]"!=ar(new Qe)||tr&&"[object WeakMap]"!=ar(new tr))&&(ar=function(t){var e=T(t),r="[object Object]"==e?t.constructor:void 0,n=r?S(r):"";if(n)switch(n){case er:return"[object DataView]";case rr:return"[object Map]";case nr:return"[object Promise]";case or:return"[object Set]";case ir:return"[object WeakMap]"}return e});var ur=ar,cr=1,lr="[object Arguments]",sr="[object Array]",fr="[object Object]",dr=Object.prototype.hasOwnProperty;var pr=function(t,e,r,n,o,i){var a=et(t),u=et(e),c=a?sr:ur(t),l=u?sr:ur(e),s=(c=c==lr?fr:c)==fr,f=(l=l==lr?fr:l)==fr,d=c==l;if(d&&nt(t)){if(!nt(e))return!1;a=!0,s=!1}if(d&&!s)return i||(i=new se),a||vt(t)?ge(t,e,r,n,o,i):ze(t,e,c,r,n,o,i);if(!(r&cr)){var p=s&&dr.call(t,"__wrapped__"),v=f&&dr.call(e,"__wrapped__");if(p||v){var h=p?t.value():t,_=v?e.value():e;return i||(i=new se),o(h,_,r,n,i)}}return!!d&&(i||(i=new se),Ze(t,e,r,n,o,i))};var vr=function t(e,r,n,o,i){return e===r||(null==e||null==r||!$(e)&&!$(r)?e!=e&&r!=r:pr(e,r,n,o,t,i))},hr=1,_r=2;var yr=function(t,e,r,n){var o=r.length,i=o,a=!n;if(null==t)return!i;for(t=Object(t);o--;){var u=r[o];if(a&&u[2]?u[1]!==t[u[0]]:!(u[0]in t))return!1}for(;++o<i;){var c=(u=r[o])[0],l=t[c],s=u[1];if(a&&u[2]){if(void 0===l&&!(c in t))return!1}else{var f=new se;if(n)var d=n(l,s,c,t,e,f);if(!(void 0===d?vr(s,l,hr|_r,n,f):d))return!1}}return!0};var br=function(t){return t==t&&!R(t)};var Er=function(t){for(var e=Rt(t),r=e.length;r--;){var n=e[r],o=t[n];e[r]=[n,o,br(o)]}return e};var gr=function(t,e){return function(r){return null!=r&&(r[t]===e&&(void 0!==e||t in Object(r)))}};var Or=function(t){var e=Er(t);return 1==e.length&&e[0][2]?gr(e[0][0],e[0][1]):function(r){return r===t||yr(r,t,e)}},Tr="[object Symbol]";var Rr=function(t){return"symbol"==typeof t||$(t)&&T(t)==Tr},mr=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ir=/^\w*$/;var Ar=function(t,e){if(et(t))return!1;var r=typeof t;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=t&&!Rr(t))||(Ir.test(t)||!mr.test(t)||null!=e&&t in Object(e))},Nr="Expected a function";function jr(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError(Nr);var r=function(){var n=arguments,o=e?e.apply(this,n):n[0],i=r.cache;if(i.has(o))return i.get(o);var a=t.apply(this,n);return r.cache=i.set(o,a)||i,a};return r.cache=new(jr.Cache||ae),r}jr.Cache=ae;var wr=jr,Cr=500;var Dr=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Pr=/\\(\\)?/g,Lr=function(t){var e=wr(t,(function(t){return r.size===Cr&&r.clear(),t})),r=e.cache;return e}((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(Dr,(function(t,r,n,o){e.push(n?o.replace(Pr,"$1"):r||t)})),e}));var Sr=function(t,e){for(var r=-1,n=null==t?0:t.length,o=Array(n);++r<n;)o[r]=e(t[r],r,t);return o},Ur=1/0,kr=f?f.prototype:void 0,xr=kr?kr.toString:void 0;var Mr=function t(e){if("string"==typeof e)return e;if(et(e))return Sr(e,t)+"";if(Rr(e))return xr?xr.call(e):"";var r=e+"";return"0"==r&&1/e==-Ur?"-0":r};var zr=function(t){return null==t?"":Mr(t)};var Br=function(t,e){return et(t)?t:Ar(t,e)?[t]:Lr(zr(t))},Gr=1/0;var Vr=function(t){if("string"==typeof t||Rr(t))return t;var e=t+"";return"0"==e&&1/t==-Gr?"-0":e};var Wr=function(t,e){for(var r=0,n=(e=Br(e,t)).length;null!=t&&r<n;)t=t[Vr(e[r++])];return r&&r==n?t:void 0};var Fr=function(t,e,r){var n=null==t?void 0:Wr(t,e);return void 0===n?r:n};var Yr=function(t,e){return null!=t&&e in Object(t)};var Hr=function(t,e,r){for(var n=-1,o=(e=Br(e,t)).length,i=!1;++n<o;){var a=Vr(e[n]);if(!(i=null!=t&&r(t,a)))break;t=t[a]}return i||++n!=o?i:!!(o=null==t?0:t.length)&&ct(o)&&at(a,o)&&(et(t)||tt(t))};var Kr=function(t,e){return null!=t&&Hr(t,e,Yr)},$r=1,Jr=2;var Zr=function(t,e){return Ar(t)&&br(e)?gr(Vr(t),e):function(r){var n=Fr(r,t);return void 0===n&&n===e?Kr(r,t):vr(e,n,$r|Jr)}};var qr=function(t){return t};var Xr=function(t){return function(e){return null==e?void 0:e[t]}};var Qr=function(t){return function(e){return Wr(e,t)}};var tn=function(t){return Ar(t)?Xr(Vr(t)):Qr(t)};var en=function(t){return"function"==typeof t?t:null==t?qr:"object"==typeof t?et(t)?Zr(t[0],t[1]):Or(t):tn(t)};var rn=function(t,e){var r={};return e=en(e),mt(t,(function(t,n,o){Y(r,n,e(t,n,o))})),r},nn={boxFlex:!0,boxFlexGroup:!0,columnCount:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,strokeDashoffset:!0,strokeOpacity:!0,strokeWidth:!0};var on=["Webkit","ms","Moz","O"];Object.keys(nn).forEach((function(t){on.forEach((function(e){nn[function(t,e){return t+e.charAt(0).toUpperCase()+e.substring(1)}(e,t)]=nn[t]}))}));var an={isUnitlessNumber:nn,shorthandPropertyExpansions:{background:{backgroundImage:!0,backgroundPosition:!0,backgroundRepeat:!0,backgroundColor:!0},border:{borderWidth:!0,borderStyle:!0,borderColor:!0},borderBottom:{borderBottomWidth:!0,borderBottomStyle:!0,borderBottomColor:!0},borderLeft:{borderLeftWidth:!0,borderLeftStyle:!0,borderLeftColor:!0},borderRight:{borderRightWidth:!0,borderRightStyle:!0,borderRightColor:!0},borderTop:{borderTopWidth:!0,borderTopStyle:!0,borderTopColor:!0},font:{fontStyle:!0,fontVariant:!0,fontWeight:!0,fontSize:!0,lineHeight:!0,fontFamily:!0}}};var un,cn,ln,sn,fn,dn,pn=function(t){var r=t.css,n={};return Object.entries(r).forEach((function(t){var e=t[0],r=t[1];if("number"==typeof r)return an.isUnitlessNumber[e]?void(n[e]=""+r):void(n[e]=r+"px");n[e]=r})),e(e({},t),{css:e(e({},n),{boxSizing:"border-box"})})},vn=function(){function t(t){this.adjacencyList={},this.rootDocument=t,this.adjacencyList[t]=[]}return t.prototype.get=function(t){return this.adjacencyList[t]},t.prototype.add=function(t,e){var r=this;if(this.adjacencyList[t]||(this.adjacencyList[t]=[]),!this.adjacencyList[e])return this.adjacencyList[t].push(e),this.adjacencyList[e]=[],!0;if(this.adjacencyList[t].includes(e))return!0;var n=function(e){if(e===t)return!0;for(var o=0,i=r.adjacencyList[e];o<i.length;o++){var a=i[o];if(n(a))return!0}return!1};return!n(e)&&(this.adjacencyList[t].push(e),!0)},t}(),hn="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},_n="object"==typeof hn&&hn&&hn.Object===Object&&hn,yn="object"==typeof self&&self&&self.Object===Object&&self,bn=(_n||yn||Function("return this")()).Symbol,En=Object.prototype,gn=En.hasOwnProperty,On=En.toString,Tn=bn?bn.toStringTag:void 0,Rn=Object.prototype.toString,mn=bn?bn.toStringTag:void 0,In=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":mn&&mn in Object(t)?function(t){var e=gn.call(t,Tn),r=t[Tn];try{t[Tn]=void 0;var n=!0}catch(t){}var o=On.call(t);return n&&(e?t[Tn]=r:delete t[Tn]),o}(t):function(t){return Rn.call(t)}(t)},An=Array.isArray,Nn=function(t){return null!=t&&"object"==typeof t},jn=function(t){return"string"==typeof t||!An(t)&&Nn(t)&&"[object String]"==In(t)},wn=/^([a-zA-Z0-9]|_|-)+$/,Cn=function(t){return function(t){return"number"==typeof t||Nn(t)&&"[object Number]"==In(t)}(t)&&t>=0};!function(t){t.SDK="SDK",t.PREVIEW="PREVIEW"}(un||(un={})),function(t){t.BOOTSTRAP="Bootstrap",t.CHANGE_POSITION="ChangePosition",t.CLOSE_PREVIEW="ClosePreview",t.PREVIEW_LOADED="PreviewLoaded",t.SET_AVALIABLE_PORTALS="SetAvaliablePortals",t.SET_CONTENT="SetContent",t.SET_SELECTED_ELEMENT="SetSelectedElement",t.SET_VIEW_MODE="SetViewMode",t.ADD_ELEMENT="AddElement",t.REMOVE_ELEMENT="RemoveElement",t.UPDATE_ELEMENT="UpdateElement",t.SET_ELEMENT="SetElement"}(cn||(cn={})),function(t){t.ON_CLICK="OnClick"}(ln||(ln={})),function(t){t.NATIVE="Native",t.PENDO="Pendo"}(sn||(sn={})),function(t){t.NAVIGATE="Navigate",t.CHANGE_TUTORIAL="ChangeTutorial",t.OPEN_GUIDE="OpenGuide"}(fn||(fn={})),function(t){t.PRIMARY="primary",t.SECONDARY="primary",t.WARNING="warning",t.DANGER="danger",t.NEUTRAL="neutral",t.ACTIVE="active",t.INFO="info"}(dn||(dn={}));var Dn;dn.PRIMARY;!function(t){t.U="U",t.B="B",t.Em="Em",t.InlineCode="InlineCode"}(Dn||(Dn={}));var Pn,Ln,Sn,Un,kn=function(t){return function(t){return jn(t)&&t.length>=3&&t.length<100&&wn.test(t)}(t)};!function(t){t.COLLAPSED="Collapsed",t.EXPANDED="Expanded",t.MINIMIZED="Minimized"}(Pn||(Pn={})),function(t){t.TUTORIAL="Tutorial",t.PORTAL="Portal"}(Ln||(Ln={})),function(t){t.Global="Global",t.Organization="Organization"}(Sn||(Sn={})),function(t){t.Root="root",t.Rule="rule",t.Atrule="atrule",t.Decl="decl",t.Any="any"}(Un||(Un={}));for(var xn,Mn=function(t){return"candu.sdk."+t},zn=function(t){return Mn("error."+t)},Bn={UNKOWN_NODE_TYPE:"unknown_node_type",UNKOWN_BLOCK_NODE_TYPE:"unkown_block_node_type",UNKOWN_INLINE_NODE_TYPE:"unkown_inline_node_type",UNKOWN_NODE_OBJECT_TYPE:"unkown_node_object_type",TUTORIAL_ERROR:"tutorial_error_boundary",PORTAL_ERROR:"portal_error_boundary",PROVIDER_ERROR:"provider_error_boundary",STYLEGUIDE_MAP_ERROR:"styleguide_map",RENDER_NODE_ERROR:"render_node"},Gn={HEARTBEAT:Mn("heartbeat"),PREVIEW_OPEN:Mn("preview.open"),PORTAL:Mn("portal"),TUTORIAL:Mn("tutorial"),TUTORIAL_INTERACTION:Mn("tutorial.interaction"),PORTAL_ASSET_NOT_FOUND:zn("portal_asset_not_found"),PORTAL_NO_SEGMENT_IDS:zn("portal_no_segment_ids"),NO_MATCHING_TUTORIALS:zn("no_matching_tutorials"),NO_VALID_TUTORIAL_IDENTIFIER:zn("no_valid_tutorial_identifier"),COMMIT_API_LOADING_ERROR:zn("commit_api"),TUTORIAL_LOADING_ERROR:zn("tutorial"),UNKOWN_NODE_TYPE:zn(Bn.UNKOWN_NODE_TYPE),UNKOWN_INLINE_NODE_TYPE:zn(Bn.UNKOWN_INLINE_NODE_TYPE),UNKOWN_NODE_OBJECT_TYPE:zn(Bn.UNKOWN_NODE_OBJECT_TYPE),TUTORIAL_ERROR:zn(Bn.TUTORIAL_ERROR),PORTAL_ERROR:zn(Bn.PORTAL_ERROR),PROVIDER_ERROR:zn(Bn.PROVIDER_ERROR),STYLEGUIDE_MAP_ERROR:zn(Bn.TUTORIAL_ERROR),RENDER_NODE_ERROR:zn(Bn.TUTORIAL_ERROR),CIRCULAR_DEPENDENCY_EMBED_PORTAL:zn("circular_dependecy_embed_portal"),CIRCULAR_DEPENDENCY_EMBED_TUTORIAL:zn("circular_dependecy_embed_tutorial")},Vn=function(t){return"An error has occured while trying to parse your Tutorial.\nUpgrade the SDK to the latest version to get rid of this error.\nErrorCode: "+t+"."},Wn=((xn={EVENTING_NOT_INITIALIZED:"You tried to send an event, but you haven't initialized eventing.\nThis is happening because you called eventing outside the scope of the CanduProvider. It can be fixed by:\n1. Adding CanduProvider to the root of the application.\n2. Initializing a new Eventing object outside of Candu.\nRead here for more context: http://udn.ac/tracking-not-init.\n"})[Gn.PORTAL_ASSET_NOT_FOUND]="Could not find the requested Portal. This could happen because:\n1. The Portal does not exist or it was deleted.\n2. The Portal has not been made avaliable to be rendered.\n3. CORS Authenticaton failed.\nSee http://udn.ac/portal-not-found for more information.\n",xn[Gn.PORTAL_NO_SEGMENT_IDS]="You have tried to render a Portal that doesn't contain any content.\nAdd content to your Portal: https://udn.ac/update-portals.\n",xn[Gn.NO_MATCHING_TUTORIALS]="The Tutorial will not be rendered because there are no matching segments for the given user.",xn[Gn.NO_VALID_TUTORIAL_IDENTIFIER]="(Candu/Tutorial) You must define one of tutorialId, slug, commitId or contentHashId.",xn[Gn.TUTORIAL_LOADING_ERROR]="An error has occurred while trying to load the Tutorial",xn[Gn.UNKOWN_INLINE_NODE_TYPE]=Vn(Bn.UNKOWN_INLINE_NODE_TYPE),xn[Gn.UNKOWN_NODE_TYPE]=Vn(Bn.UNKOWN_NODE_TYPE),xn[Gn.CIRCULAR_DEPENDENCY_EMBED_PORTAL]="Circular dependency found on Embeded Portal. Please take a look at the Portal Content.",xn[Gn.CIRCULAR_DEPENDENCY_EMBED_TUTORIAL]="Circular dependency found on Embeded Tutorial. Please take a look at the Tutorial Content.",xn[Gn.PORTAL_ERROR]="An error has occured within Portal",xn[Gn.PROVIDER_ERROR]="An error has occured within Provider",xn[Gn.TUTORIAL_ERROR]="An error has occured within Tutorial",xn[Gn.RENDER_NODE_ERROR]="An error has occured while rendering tutorial node",xn[Gn.STYLEGUIDE_MAP_ERROR]="An error has occured while mapping node to styleguide",xn),Fn={Alert:!0,B:!0,Badge:!0,Button:!0,Card:!0,Code:!0,Document:!0,Em:!0,EmbedPortal:!0,EmbedTutorial:!0,Flex:!0,FlexItem:!0,H1:!0,H2:!0,H3:!0,H4:!0,H5:!0,H6:!0,Image:!0,InlineCode:!0,Link:!0,List:!0,ListItem:!0,P:!0,RichText:!0,Spacing:!0,Text:!0,U:!0,View:!0,Player:!0},Yn={error:console.error,warning:console.warn},Hn=function(t,e){return function(t){var e="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(e){var r=new Uint8Array(16);t.exports=function(){return e(r),r}}else{var n=new Array(16);t.exports=function(){for(var t,e=0;e<16;e++)0==(3&e)&&(t=4294967296*Math.random()),n[e]=t>>>((3&e)<<3)&255;return n}}}(e={exports:{}}),e.exports}(),Kn=[],$n=0;$n<256;++$n)Kn[$n]=($n+256).toString(16).substr(1);var Jn,Zn,qn=function(t,e,r){var n=e&&r||0;"string"==typeof t&&(e="binary"===t?new Array(16):null,t=null);var o=(t=t||{}).random||(t.rng||Hn)();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,e)for(var i=0;i<16;++i)e[n+i]=o[i];return e||function(t,e){var r=e||0,n=Kn;return[n[t[r++]],n[t[r++]],n[t[r++]],n[t[r++]],"-",n[t[r++]],n[t[r++]],"-",n[t[r++]],n[t[r++]],"-",n[t[r++]],n[t[r++]],"-",n[t[r++]],n[t[r++]],n[t[r++]],n[t[r++]],n[t[r++]],n[t[r++]]].join("")}(o)};!function(t){t.UserGenerated="UserGenerated",t.SDK="SDK"}(Jn||(Jn={})),function(t){t.Identify="Identify",t.Group="Group",t.Track="Track",t.Page="Page",t.Screen="Screen"}(Zn||(Zn={}));var Xn,Qn=function(){return"undefined"!=typeof window&&window.localStorage},to=function(t){return function(e){Qn()&&null!=e&&window.localStorage.setItem(t,JSON.stringify(e))}},eo={anonymousId:{getOrCreate:("candu:anonymous_id",Xn=function(){var t=qn();return to("candu:anonymous_id")(t),t},function(){return function(){if(Qn()){var t=window.localStorage.getItem("candu:anonymous_id");if(t)try{return JSON.parse(t)}catch(t){return null}}}()||Xn()}),set:to("candu:anonymous_id")}}.anonymousId.getOrCreate,ro=function(t,e,r,n,o,i,a,u){if(!t){var c;if(void 0===e)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=[r,n,o,i,a,u],s=0;(c=new Error(e.replace(/%s/g,(function(){return l[s++]})))).name="Invariant Violation"}throw c.framesToPop=1,c}},no=function(t){return ro(!t||R(t),"(Candu) styleguide must be undefined or an object")};var oo="/api/segmentMemberships",io="/api/segmentsDefinition",ao="/api/tutorialMetadata",uo="/api/tutorialDocumentsSdk",co="wss://2jcfb7pjlf.execute-api.eu-west-1.amazonaws.com/prod",lo=function(t){return n(void 0,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return[4,fetch(t)];case 1:return[2,e.sent().json()]}}))}))},so=function(t){return lo("https://api.candu.ai"+t)},fo=function(t){return lo("https://cdn.candu.ai"+t)},po={tutorialDocumentLatestSaved:function(t,e){return n(void 0,void 0,void 0,(function(){return o(this,(function(r){return[2,so(uo+"/"+e+"?token="+t)]}))}))},portalAsset:function(t,e){return n(void 0,void 0,void 0,(function(){return o(this,(function(r){return[2,fo("/portals/"+t+"/"+e+"/head.json")]}))}))},segmentMembership:function(t,e){return n(void 0,void 0,void 0,(function(){return o(this,(function(r){return[2,so(oo+"/"+e+"?token="+t)]}))}))},segmentDefinition:function(t){return n(void 0,void 0,void 0,(function(){return o(this,(function(e){return[2,so(io+"?token="+t)]}))}))},tutorialMetadata:function(t){return n(void 0,void 0,void 0,(function(){return o(this,(function(e){return[2,so(ao+"?token="+t)]}))}))},tutorialSocket:function(t,e,r){var n=new WebSocket(co+"?clientToken="+t+"&tutorialId="+e);return n.onmessage=function(t){var e=JSON.parse(t.data);r(e)},function(){return n.close()}},tutorialDocument:function(t,e,r){var n=t.contentHashId,o=t.tutorialId,i=t.tutorialDocument,a=t.slug,u=function(t){return{byId:function(e){return so(uo+"?token="+t+"&finder=latestPublished&tutorialId="+e)},bySlug:function(e){return fo("/tutorials/"+t+"/"+e+".json")},byContentHash:function(e){return fo("/tutorials/"+t+"/"+e+".json")}}}(e);return kn(a)?u.bySlug(a):function(t){return Cn(t)}(o)?u.byId(o):function(t){return jn(t)&&!!t.match(/^[0-9a-zA-Z]{40}$/)}(n)?u.byContentHash(n):R(i)?Promise.resolve(i):(Yn.error(Wn[Gn.NO_VALID_TUTORIAL_IDENTIFIER]),r.track(Gn.NO_VALID_TUTORIAL_IDENTIFIER,{slug:t.slug}),null)}},vo=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return console.error.apply(console,t)},ho=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return console.warn.apply(console,t)},_o={error:vo,warning:ho},yo=function(t){return DOMParser?(new DOMParser).parseFromString(t,"text/html").body.textContent||"":t},bo=function(){function t(){this.subscribers=[]}return t.prototype.subscribe=function(t){var e=this;return this.subscribers.push(t),function(){e.subscribers[e.subscribers.indexOf(t)]=function(){}}},t.prototype.notify=function(t){this.subscribers.forEach((function(e){return e(t)}))},t.prototype.clear=function(){this.subscribers=[]},t}(),Eo=function(){function t(){this.onClientUpdateObserver=new bo}return t.prototype.attachClient=function(t){this.client=t,this.onClientUpdateObserver.notify({client:t})},t.prototype.detachClient=function(){this.client=null,this.onClientUpdateObserver.notify({client:null})},t.prototype.onClientUpdate=function(t){var e=this.onClientUpdateObserver.subscribe(t);return this.client&&t({client:this.client}),e},t}();var go=function(){function t(t){this.init(t)}return t.prototype.attachClient=function(t){return this.provider.preview.attachClient(t)},t.prototype.detachClient=function(){return this.provider.preview.detachClient()},Object.defineProperty(t.prototype,"provider",{get:function(){return this.getProvider()},enumerable:!0,configurable:!0}),t}(),Oo=function(t){switch(t.trigger){case ln.ON_CLICK:default:return"onClick"}},To=function(t,r){var n=t.data;if(!n||!n.actions)return{};var o=function(t){r.provider.eventing.track(Gn.TUTORIAL_INTERACTION,e(e({},t),r.trackingIdentifiers||{}))};return n.actions.map((function(t){return function(t,e){var r,n,o;switch(t.handler.type){case fn.NAVIGATE:return(r={})[Oo(t)]=function(){var r=t.handler,n=r.href,o=r.target;e(t),"Blank"===o?window.open(n,"_blank"):n&&n.includes("mailto:")?window.location=n:document.location.href=n},r;case fn.CHANGE_TUTORIAL:return(n={})[Oo(t)]=function(){var e=t.handler.tutorialId;vo("TODO -> change tutorial",e)},n;case fn.OPEN_GUIDE:return(o={})[Oo(t)]=function(){var e=t.handler.guideId;vo("TODO -> open guide",e)},o;default:return{}}}(t,o)})).reduce((function(t,r){return e(e({},t),r)}),{})},Ro=function(t,e){var r=t.props||{},n=t.nodes,o=r.children;return o?"string"==typeof o?yo(o):o:n?n.map(e):null},mo=function(t,r){try{var n=r.provider,o=r.document,i=r.trackingIdentifiers,a=o.nodes[t];if(!a)return _o.error("Document is corrupted. Refusing to move further."),null;var u=function(t){return mo(t,r)},c=a.type,l=a.props,s=a.css,f=e(e(e({},l||{}),{style:s||{},children:Ro(a,u)}),To(a,{trackingIdentifiers:i,provider:n})),d={nodeId:t,node:a,document:o,render:{node:u,styleguide:function(t,e){return void 0===e&&(e={}),r.renderNode(t,{api:d,attributes:e})},tutorial:function(t){return r.renderTutorial(t)},portal:function(t){return r.renderPortal(t)}},trackingIdentifiers:i},p=d.render.styleguide(c,f);return p||(_o.error(Wn[Gn.UNKOWN_NODE_TYPE],{type:c}),n.eventing.track(Gn.UNKOWN_NODE_TYPE,{type:c}),null)}catch(t){return _o.error(Wn[Gn.STYLEGUIDE_MAP_ERROR],t),null}},Io=wr((function(t,r){var n,o,i=t.provider,a=t.portal,u=t.tutorial,c=i.styleguide;return u&&(o=u.styleguide),a&&(n=a.styleguide),e(e(e(e({},c||{}),n||{}),o||{}),r||{})}));t.DEFAULT_ALERT_COLOR="#EDEDED",t.DEFAULT_ALT="",t.DEFAULT_TAB_ACTIVE_COLOR="#FEFEFE",t.DEFAULT_TAB_COLOR="#FEFEFE",t.DEFAULT_TAB_HEADER_COLOR="#333745",t.DEFAULT_TAB_ITEM_COLOR="#838792",t.ERROR_MESSAGES=Wn,t.ERROR_SLUGS=Bn,t.EVENT_NAMES=Gn,t.LOGGER=Yn,t.Observer=bo,t.PreviewContainer=Eo,t.RESOURCES=po,t.STYLEGUIDE_COLORS={primary:"#6310E5",secondary:"#59C3C3",tertiary:"#4D515D",warning:"#FCAD0D",danger:"#EE4266"},t.SingletonAPI=go,t.TutorialDependencies=vn,t.adaptCustomNodes=function(t){return rn(t,(function(t){var r=t;return"Typography"===r.type&&(r=function(t){var r=Fr(t,"data.custom.variant","P");return e(e({},t),{type:r})}(r)),r.css&&R(r.css)&&r.css.flexBasis&&(r=function(t){var r=t.css.flexBasis;return"0"===r||"0px"===r?e(e({},t),{css:e(e({},t.css),{flexBasis:"0%"})}):t}(r)),r.css&&(r=pn(r)),r}))},t.attachStylesheet=function(t){var e=document.createElement("link");e.setAttribute("rel","stylesheet"),e.setAttribute("href","https://cdn.candu.ai/styleguides/applications/"+t+"/default/main.css"),document.head.appendChild(e)},t.checkCyclicAndAdd=function(t,e){return t.dependencies.add(t.id,e)},t.createSingleton=function(t){var e,r,n=function(t){return function(){for(var e,n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];if(r.api)return(e=r.api)[t].apply(e,n);console.warn("Please initialize the SDK by calling Candu.init() before attempting to call "+t)}};return(e=function(){function e(){}return e.init=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return this.api||(e.api=new(t.bind.apply(t,i([void 0],r)))),e.subscriberCallbacks.forEach((function(t){return t()})),e.subscriberCallbacks=[],window.postMessage({source:"CANDU_SINGLETON",payload:{type:"INIT"}},window&&window.origin?window.origin:"*"),e},e.onProviderReady=function(t){if(e.api)return t();e.subscriberCallbacks.push(t)},e}()).subscriberCallbacks=[],e.renderTutorial=n("renderTutorial"),e.renderPortal=n("renderPortal"),e.attachClient=n("attachClient"),e.detachClient=n("detachClient"),e.getProvider=n("getProvider"),r=e,window.Candu=r,r},t.createTutorialDocumentContext=function(t,e){return{id:t,dependencies:e?e.dependencies:new vn(t)}},t.defaultStyleguide=Fn,t.findMatchingSegment=function(t,r){var n=r.reduce((function(t,r){var n;return e(e({},t),((n={})[r]=r,n))}),{});return t.content.find((function(t){var e=t.segmentId;return!!n[e]||"Everyone"===e}))},t.internalEventing=function(t){var e=t.identify,r=t.track;return{provider:function(t){var n=t.userId,o=t.traits,i=t.styleguide;e(n,o),r(Gn.HEARTBEAT,function(t){var e={};return Object.keys(t).forEach((function(r){Fn[r]&&(e["styleguide."+r]=t[r].displayName||!0)})),e}(i))},tutorialDocumentLoadingError:function(t){var e=t.tutorialId,n=t.slug,o=t.contentHashId;Yn.error(Wn[Gn.TUTORIAL_LOADING_ERROR]),r(Gn.TUTORIAL_LOADING_ERROR,{tutorialId:e,slug:n,contentHashId:o})}}},t.logError=vo,t.logWarning=ho,t.logger=_o,t.mapNodeToStyleguide=mo,t.mergeStyleguidesFromContext=Io,t.normalizeCss=pn,t.portalValidation=function(t){var e=t.slug,r=t.styleguide;return no(r),{slug:e,styleguide:r||{}}},t.providerValidation=function(t){var n=t.clientToken,o=t.userId,i=t.traits,a=t.options,u=t.styleguide,c=r(t,["clientToken","userId","traits","options","styleguide"]);return ro(function(t){return jn(t)&&!!t.match(/^[0-9a-zA-Z]*$/)&&t.length>=10}(n),"(Candu) you must provide a valid clientToken"),ro(!o||function(t){return Cn(t)||jn(t)&&t.trim().length>0}(o),"(Candu) you must provide a valid userId"),no(u),ro(!i||R(i),"(Candu) traits must be undefined or an object"),ro(!a||R(a),"(Candu) options must be undefined or an object"),e(e({},c),{clientToken:n,traits:i||{},options:a||{},styleguide:u||{},userId:o||eo()})},t.stripHTML=yo,t.tutorialValidation=function(t){var n=t.slug,o=t.styleguide,i=t.contentHashId,a=t.tutorialId,u=t.tutorialDocument,c=t.renderedByClient,l=r(t,["slug","styleguide","contentHashId","tutorialId","tutorialDocument","renderedByClient"]);return no(o),e(e({},l),{slug:n,styleguide:o||{},contentHashId:i,tutorialId:a,tutorialDocument:u,renderedByClient:c})},Object.defineProperty(t,"__esModule",{value:!0})}));
//# sourceMappingURL=index.js.map

@@ -12,3 +12,3 @@ {

},
"version": "0.6.0-alpha.4",
"version": "0.6.0-alpha.5",
"main": "dist/index.js",

@@ -31,3 +31,3 @@ "module": "dist/index.es.js",

},
"gitHead": "66528f1af238ec4b2a066e36a9bb15f9e519b116"
"gitHead": "c49336408e5c38e22683f8f791461a4b6370fd7b"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc