@candulabs/core
Advanced tools
Comparing version 0.5.0-alpha.3 to 0.5.0
@@ -6,2 +6,15 @@ # Change Log | ||
# [0.5.0](https://github.com/candulabs/candu-sdk/tree/master/packages/candu-core/compare/v0.4.0...v0.5.0) (2020-10-07) | ||
### Features | ||
* improve sdk ([#194](https://github.com/candulabs/candu-sdk/tree/master/packages/candu-core/issues/194)) ([f7c12ae](https://github.com/candulabs/candu-sdk/tree/master/packages/candu-core/commit/f7c12ae93d8bce52b72fd359cf34793875258ceb)) | ||
* **plainjs-sdk:** implement portals ([#190](https://github.com/candulabs/candu-sdk/tree/master/packages/candu-core/issues/190)) ([feb6c42](https://github.com/candulabs/candu-sdk/tree/master/packages/candu-core/commit/feb6c42fc5de0dba153cc7e4a4d42584d258e8f8)) | ||
* implement styleguide in plainjs-sdk ([#187](https://github.com/candulabs/candu-sdk/tree/master/packages/candu-core/issues/187)) ([3d7211a](https://github.com/candulabs/candu-sdk/tree/master/packages/candu-core/commit/3d7211ac24fddb40a0c30b34f09de18359ad091c)) | ||
# [0.5.0-alpha.3](https://github.com/candulabs/candu-sdk/tree/master/packages/candu-core/compare/v0.4.0...v0.5.0-alpha.3) (2020-10-07) | ||
@@ -8,0 +21,0 @@ |
@@ -1,2 +0,2 @@ | ||
"use strict";function _interopDefault(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var util=require("util"),e=_interopDefault(require("crypto")),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=_root.Symbol,_Symbol=Symbol,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 o=nativeObjectToString.call(e);return a&&(t?e[symToStringTag]=r:delete e[symToStringTag]),o}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 o=-1,n=Object(t),i=a(t),s=i.length;s--;){var c=i[e?s:++o];if(!1===r(n[c],c,n))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,o=a&&a.exports===r?_root.Buffer:void 0,n=(o?o.isBuffer:void 0)||stubFalse_1;e.exports=n})),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,o=a&&a.exports===r&&_freeGlobal.process,n=function(){try{var e=a&&a.require&&a.require("util").types;return e||o&&o.binding&&o.binding("util")}catch(e){}}();e.exports=n})),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),o=!r&&!a&&isBuffer_1(e),n=!r&&!a&&!o&&isTypedArray_1(e),i=r||a||o||n,s=i?_baseTimes(e.length,String):[],c=s.length;for(var _ in e)!t&&!hasOwnProperty$3.call(e,_)||i&&("length"==_||o&&("offset"==_||"parent"==_)||n&&("buffer"==_||"byteLength"==_||"byteOffset"==_)||_isIndex(_,c))||s.push(_);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,o,n){var i=r&COMPARE_PARTIAL_FLAG,s=e.length,c=t.length;if(s!=c&&!(i&&c>s))return!1;var _=n.get(e);if(_&&n.get(t))return _==t;var u=-1,l=!0,p=r&COMPARE_UNORDERED_FLAG?new _SetCache:void 0;for(n.set(e,t),n.set(t,e);++u<s;){var g=e[u],y=t[u];if(a)var d=i?a(y,g,u,t,e,n):a(g,y,u,e,t,n);if(void 0!==d){if(d)continue;l=!1;break}if(p){if(!_arraySome(t,(function(e,t){if(!_cacheHas(p,t)&&(g===e||o(g,e,r,a,n)))return p.push(t)}))){l=!1;break}}else if(g!==y&&!o(g,y,r,a,n)){l=!1;break}}return n.delete(e),n.delete(t),l}var _equalArrays=equalArrays,Uint8Array=_root.Uint8Array,_Uint8Array=Uint8Array;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,o,n,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||!n(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 _=i.get(e);if(_)return _==t;a|=COMPARE_UNORDERED_FLAG$1,i.set(e,t);var u=_equalArrays(s(e),s(t),a,o,n,i);return i.delete(e),u;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,o=e.length;++r<a;)e[o+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,o=0,n=[];++r<a;){var i=e[r];t(i,r,e)&&(n[o++]=i)}return n}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,o,n){var i=r&COMPARE_PARTIAL_FLAG$2,s=_getAllKeys(e),c=s.length;if(c!=_getAllKeys(t).length&&!i)return!1;for(var _=c;_--;){var u=s[_];if(!(i?u in t:hasOwnProperty$7.call(t,u)))return!1}var l=n.get(e);if(l&&n.get(t))return l==t;var p=!0;n.set(e,t),n.set(t,e);for(var g=i;++_<c;){var y=e[u=s[_]],d=t[u];if(a)var f=i?a(d,y,u,t,e,n):a(y,d,u,e,t,n);if(!(void 0===f?y===d||o(y,d,r,a,n):f)){p=!1;break}g||(g="constructor"==u)}if(p&&!g){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 n.delete(e),n.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,o,n){var i=isArray_1(e),s=isArray_1(t),c=i?arrayTag$1:_getTag(e),_=s?arrayTag$1:_getTag(t),u=(c=c==argsTag$2?objectTag$2:c)==objectTag$2,l=(_=_==argsTag$2?objectTag$2:_)==objectTag$2,p=c==_;if(p&&isBuffer_1(e)){if(!isBuffer_1(t))return!1;i=!0,u=!1}if(p&&!u)return n||(n=new _Stack),i||isTypedArray_1(e)?_equalArrays(e,t,r,a,o,n):_equalByTag(e,t,c,r,a,o,n);if(!(r&COMPARE_PARTIAL_FLAG$3)){var g=u&&hasOwnProperty$8.call(e,"__wrapped__"),y=l&&hasOwnProperty$8.call(t,"__wrapped__");if(g||y){var d=g?e.value():e,f=y?t.value():t;return n||(n=new _Stack),o(d,f,r,a,n)}}return!!p&&(n||(n=new _Stack),_equalObjects(e,t,r,a,o,n))}var _baseIsEqualDeep=baseIsEqualDeep;function baseIsEqual(e,t,r,a,o){return e===t||(null==e||null==t||!isObjectLike_1(e)&&!isObjectLike_1(t)?e!=e&&t!=t:_baseIsEqualDeep(e,t,r,a,baseIsEqual,o))}var _baseIsEqual=baseIsEqual,COMPARE_PARTIAL_FLAG$4=1,COMPARE_UNORDERED_FLAG$2=2;function baseIsMatch(e,t,r,a){var o=r.length,n=o,i=!a;if(null==e)return!n;for(e=Object(e);o--;){var s=r[o];if(i&&s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++o<n;){var c=(s=r[o])[0],_=e[c],u=s[1];if(i&&s[2]){if(void 0===_&&!(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],o=e[a];t[r]=[a,o,_isStrictComparable(o)]}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,o=t?t.apply(this,a):a[0],n=r.cache;if(n.has(o))return n.get(o);var i=e.apply(this,a);return r.cache=n.set(o,i)||n,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,o){t.push(a?o.replace(reEscapeChar,"$1"):r||e)})),t})),_stringToPath=stringToPath;function arrayMap(e,t){for(var r=-1,a=null==e?0:e.length,o=Array(a);++r<a;)o[r]=t(e[r],r,e);return o}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,o=(t=_castPath(t,e)).length,n=!1;++a<o;){var i=_toKey(t[a]);if(!(n=null!=e&&r(e,i)))break;e=e[i]}return n||++a!=o?n:!!(o=null==e?0:e.length)&&isLength_1(o)&&_isIndex(i,o)&&(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,o){_baseAssignValue(r,a,t(e,a,o))})),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;const unpackShorthandStyles=e=>{const{padding:t,margin:r,...a}=e.css;let o={};return t&&(o={paddingRight:t,paddingLeft:t,paddingBottom:t,paddingTop:t}),r&&(o={...o,marginRight:r,marginLeft:r,marginBottom:r,marginTop:r}),{...e,css:{...o,...a}}},convertStyleNumberValues=e=>{const t=e.css,r={};return Object.entries(t).forEach(([e,t])=>{if(util.isNumber(t))return CSSProperty_1.isUnitlessNumber[e]?void(r[e]=`${t}`):void(r[e]=`${t}px`);r[e]=t}),{...e,css:r}},typographyNode=e=>{const t=get_1(e,"data.custom.variant","P");return{...e,type:t}},normalizeFlexBasis=e=>{const{flexBasis:t}=e.css;return"0"===t||"0px"===t?{...e,css:{...e.css,flexBasis:"0%"}}:e},adaptCustomNodes=e=>mapValues_1(e,e=>{let t=e;return"Typography"===t.type&&(t=typographyNode(t)),t.css&&"flexBasis"in t.css&&(t=normalizeFlexBasis(t)),t.css&&(t=unpackShorthandStyles(t),t=convertStyleNumberValues(t)),t}),eventPrefix=e=>`candu.sdk.${e}`,errorPrefix=e=>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"},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),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=e=>`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={EVENTING_NOT_INITIALIZED:EVENTING_NOT_INITIALIZED,[EVENT_NAMES.PORTAL_ASSET_NOT_FOUND]:PORTAL_ASSET_NOT_FOUND,[EVENT_NAMES.PORTAL_NO_SEGMENT_IDS]:PORTAL_NO_SEGMENT_IDS,[EVENT_NAMES.NO_MATCHING_TUTORIALS]:NO_MATCHING_TUTORIALS,[EVENT_NAMES.NO_VALID_TUTORIAL_IDENTIFIER]:"(Candu/Tutorial) You must define one of tutorialId, slug, commitId or contentHashId.",[EVENT_NAMES.TUTORIAL_LOADING_ERROR]:"An error has occurred while trying to load the Tutorial",[EVENT_NAMES.UNKOWN_INLINE_NODE_TYPE]:unknownMessage(ERROR_SLUGS.UNKOWN_INLINE_NODE_TYPE),[EVENT_NAMES.UNKOWN_NODE_TYPE]:unknownMessage(ERROR_SLUGS.UNKOWN_NODE_TYPE),[EVENT_NAMES.CIRCULAR_DEPENDENCY_EMBED_PORTAL]:"Circular dependency found on Embeded Portal. Please take a look at the Portal Content.",[EVENT_NAMES.CIRCULAR_DEPENDENCY_EMBED_TUTORIAL]:"Circular dependency found on Embeded Tutorial. Please take a look at the Tutorial Content."},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=e=>{const t={};return Object.keys(e).forEach(r=>{defaultStyleguide[r]&&(t[`styleguide.${r}`]=e[r].displayName||!0)}),t},LOGGER={error:console.error,warning:console.warn},internalEventing=({identify:e,track:t})=>({provider:({userId:r,traits:a,styleguide:o})=>{e(r,a),t(EVENT_NAMES.HEARTBEAT,trackStyleguideProperties(o))},tutorialDocumentLoadingError:({tutorialId:e,slug:r,contentHashId:a})=>{LOGGER.error(ERROR_MESSAGES[EVENT_NAMES.TUTORIAL_LOADING_ERROR]),t(EVENT_NAMES.TUTORIAL_LOADING_ERROR,{tutorialId:e,slug:r,contentHashId:a})}});for(var n=function(){return e.randomBytes(16)},t=[],r=0;r<256;++r)t[r]=(r+256).toString(16).substr(1);var i,s,a=function(e,r){var a=r||0,o=t;return[o[e[a++]],o[e[a++]],o[e[a++]],o[e[a++]],"-",o[e[a++]],o[e[a++]],"-",o[e[a++]],o[e[a++]],"-",o[e[a++]],o[e[a++]],"-",o[e[a++]],o[e[a++]],o[e[a++]],o[e[a++]],o[e[a++]],o[e[a++]]].join("")},o=function(e,t,r){var o=t&&r||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null);var i=(e=e||{}).random||(e.rng||n)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,t)for(var s=0;s<16;++s)t[o+s]=i[s];return t||a(i)},c=Object.freeze({__proto__:null,API_BASE_URL:"https://api.candu.ai",VERSION:"0.5.0-alpha.3"});!function(e){e.UserGenerated="UserGenerated",e.SDK="SDK"}(i||(i={})),function(e){e.Identify="Identify",e.Group="Group",e.Track="Track",e.Page="Page",e.Screen="Screen"}(s||(s={}));const m=()=>"undefined"!=typeof window&&window.localStorage,g=e=>t=>{m()&&null!=t&&window.localStorage.setItem(e,JSON.stringify(t))};var f={anonymousId:{getOrCreate:((e,t)=>()=>(e=>()=>{if(m()){const e=window.localStorage.getItem("candu:anonymous_id");if(e)try{return JSON.parse(e)}catch(e){return null}}})()()||(()=>{const e=o();return g("candu:anonymous_id")(e),e})())(),set:g("candu:anonymous_id")}};const O=f.anonymousId.getOrCreate;var t$1="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n$1="object"==typeof t$1&&t$1&&t$1.Object===Object&&t$1,o$1="object"==typeof self&&self&&self.Object===Object&&self,r$1=(n$1||o$1||Function("return this")()).Symbol,a$1=Object.prototype,i$1=a$1.hasOwnProperty,l=a$1.toString,E=r$1?r$1.toStringTag:void 0,c$1=function(e){var t=i$1.call(e,E),r=e[E];try{e[E]=void 0;var a=!0}catch(e){}var o=l.call(e);return a&&(t?e[E]=r:delete e[E]),o},s$1=Object.prototype.toString,u=function(e){return s$1.call(e)},d="[object Null]",p="[object Undefined]",v=r$1?r$1.toStringTag:void 0,T=function(e){return null==e?void 0===e?p:d:v&&v in Object(e)?c$1(e):u(e)},O$1=Array.isArray,_=function(e){return null!=e&&"object"==typeof e},A="[object String]",f$1=function(e){return"string"==typeof e||!O$1(e)&&_(e)&&T(e)==A},m$1="[object Number]",N=function(e){return"number"==typeof e||_(e)&&T(e)==m$1};const P=/^([a-zA-Z0-9]|_|-)+$/,S=e=>f$1(e)&&e.length>=3&&e.length<100&&P.test(e),g$1=e=>N(e)&&e>=0,I=e=>f$1(e)&&!!e.match(/^[0-9a-zA-Z]*$/)&&e.length>=10,R=e=>g$1(e)||f$1(e)&&e.trim().length>0;var L,b,M,w,$,j;!function(e){e.SDK="SDK",e.PREVIEW="PREVIEW"}(L||(L={})),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"}(b||(b={})),(M||(M={})).ON_CLICK="OnClick",function(e){e.NATIVE="Native",e.PENDO="Pendo"}(w||(w={})),function(e){e.NAVIGATE="Navigate",e.CHANGE_TUTORIAL="ChangeTutorial",e.OPEN_GUIDE="OpenGuide"}($||($={})),function(e){e.PRIMARY="primary",e.SECONDARY="primary",e.WARNING="warning",e.DANGER="danger",e.NEUTRAL="neutral",e.ACTIVE="active",e.INFO="info"}(j||(j={}));const V=j.PRIMARY;var W;!function(e){e.U="U",e.B="B",e.Em="Em",e.InlineCode="InlineCode"}(W||(W={}));const U=e=>f$1(e)&&!!e.match(/^[0-9a-zA-Z]{40}$/),B=e=>g$1(e),k=e=>S(e);var X,q,Q,ee,K=Object.freeze({__proto__:null,PREVIEW_SCRIPT_URL:"https://app.candu.ai/preview.html"});!function(e){e.COLLAPSED="Collapsed",e.EXPANDED="Expanded",e.MINIMIZED="Minimized"}(X||(X={})),function(e){e.TUTORIAL="Tutorial",e.PORTAL="Portal"}(q||(q={})),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"}(ee||(ee={}));var invariant=function(e,t,r,a,o,n,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 _=[r,a,o,n,i,s],u=0;(c=new Error(t.replace(/%s/g,(function(){return _[u++]})))).name="Invariant Violation"}throw c.framesToPop=1,c}},invariant_1=invariant;const isValidStyleguideProps=e=>invariant_1(!e||isObject_1(e),"(Candu) styleguide must be undefined or an object"),providerValidation=({clientToken:e,userId:t,traits:r,options:a,styleguide:o,...n})=>(invariant_1(I(e),"(Candu) you must provide a valid clientToken"),invariant_1(!t||R(t),"(Candu) you must provide a valid userId"),isValidStyleguideProps(o),invariant_1(!r||isObject_1(r),"(Candu) traits must be undefined or an object"),invariant_1(!a||isObject_1(a),"(Candu) options must be undefined or an object"),{...n,clientToken:e,traits:r||{},options:a||{},styleguide:o||{},userId:t||O()}),tutorialValidation=({slug:e,styleguide:t,contentHashId:r,tutorialId:a,tutorialDocument:o,...n})=>(isValidStyleguideProps(t),{...n,slug:e,styleguide:t||{},contentHashId:r,tutorialId:a,tutorialDocument:o}),portalValidation=({slug:e,styleguide:t})=>(isValidStyleguideProps(t),{slug:e,styleguide:t||{}}),API_BASE_URL="https://api.candu.ai",CDN_BASE_URL="https://cdn.candu.ai",VERSION="0.5.0-alpha.3";var injections=Object.freeze({__proto__:null,API_BASE_URL:API_BASE_URL,CDN_BASE_URL:CDN_BASE_URL,VERSION:VERSION});const{API_BASE_URL:API_BASE_URL$1}=injections,{CDN_BASE_URL:CDN_BASE_URL$1}=injections,ENDPOINTS={segmentMembership:"/api/segmentMemberships",tutorialDocuments:"/api/tutorialDocumentsEditor"},fetchURL=async e=>(await fetch(e)).json(),fetchFromApi=e=>fetchURL(`${API_BASE_URL$1}${e}`),fetchFromCdn=e=>fetchURL(`${CDN_BASE_URL$1}${e}`),getTutorialDocument=e=>({byId:t=>fetchFromApi(`${ENDPOINTS.tutorialDocuments}/${t}?token=${e}`),bySlug:t=>fetchFromCdn(`/tutorials/${e}/${t}.json`),byContentHash:t=>fetchFromCdn(`/tutorials/${e}/${t}.json`)}),RESOURCES={tutorialDocumentLatestPublished:async(e,t)=>fetchFromApi(`${ENDPOINTS.tutorialDocuments}?token=${e}&finder=latestPublished&tutorialId=${t}`),portalAsset:async(e,t)=>fetchFromCdn(`/portals/${e}/${t}/head.json`),segmentMembership:async(e,t)=>fetchFromApi(`${ENDPOINTS.segmentMembership}/${t}?token=${e}`),tutorialDocument:(e,t,r)=>{const{contentHashId:a,tutorialId:o,tutorialDocument:n,slug:i}=e,s=getTutorialDocument(t);return B(o)?s.byId(o):k(i)?s.bySlug(i):U(a)?s.byContentHash(a):isObject_1(n)?Promise.resolve(n):(LOGGER.error(ERROR_MESSAGES[EVENT_NAMES.NO_VALID_TUTORIAL_IDENTIFIER]),r.track(EVENT_NAMES.NO_VALID_TUTORIAL_IDENTIFIER,{slug:e.slug}),null)}},logError=(...e)=>console.error(...e),logWarning=(...e)=>console.warn(...e),logger={error:logError,warning:logWarning},getEventHandler=e=>{switch(e.trigger){case M.ON_CLICK:default:return"onClick"}},getActionHandler=(e,t)=>{switch(e.handler.type){case $.NAVIGATE:return{[getEventHandler(e)]:()=>{const{href:r,target:a}=e.handler;t(e),"Blank"===a?window.open(r,"_blank"):r&&r.includes("mailto:")?window.location=r:document.location.href=r}};case $.CHANGE_TUTORIAL:return{[getEventHandler(e)]:()=>{const{tutorialId:t}=e.handler;logError("TODO -> change tutorial",t)}};case $.OPEN_GUIDE:return{[getEventHandler(e)]:()=>{const{guideId:t}=e.handler;logError("TODO -> open guide",t)}};default:return{}}},getActionHandlers=({data:e},t)=>{if(!e||!e.actions)return{};const r=e=>{t.provider.eventing.track(EVENT_NAMES.TUTORIAL_INTERACTION,{...e,...t.trackingIdentifiers||{}})};return e.actions.map(e=>getActionHandler(e,r)).reduce((e,t)=>({...e,...t}),{})},mapNodeToStyleguide=(e,t)=>{const{provider:r,document:a,trackingIdentifiers:o}=t,n=a.nodes[e];if(!n)return logger.error("Document is corrupted. Refusing to move further."),null;const i=e=>mapNodeToStyleguide(e,t),{type:s,props:c,css:_}=n,u={...c||{},style:_||{},children:(c||{}).children||n.nodes&&n.nodes.map(i),...getActionHandlers(n,{trackingIdentifiers:o,provider:r})},l={nodeId:e,node:n,document:a,render:{node:i,styleguide:(e,r={})=>t.renderNode(e,{api:l,attributes:r}),tutorial:e=>t.renderTutorial(e),portal:e=>t.renderPortal(e)},trackingIdentifiers:o},p=l.render.styleguide(s,u);return p||(logger.error(ERROR_MESSAGES[EVENT_NAMES.UNKOWN_NODE_TYPE],{type:s}),r.eventing.track(EVENT_NAMES.UNKOWN_NODE_TYPE,{type:s}),null)},mergeStyleguidesFromContext=memoize_1((e,t)=>{const{provider:r,portal:a,tutorial:o}=e,n=r.styleguide;let i,s;return o&&(s=o.styleguide),a&&(i=a.styleguide),{...n||{},...i||{},...s||{},...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=e=>{const 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="#EDEDED",exports.DEFAULT_ALT="",exports.DEFAULT_TAB_ACTIVE_COLOR="#FEFEFE",exports.DEFAULT_TAB_COLOR="#FEFEFE",exports.DEFAULT_TAB_HEADER_COLOR="#333745",exports.DEFAULT_TAB_ITEM_COLOR="#838792",exports.ERROR_MESSAGES=ERROR_MESSAGES,exports.ERROR_SLUGS=ERROR_SLUGS,exports.EVENT_NAMES=EVENT_NAMES,exports.LOGGER=LOGGER,exports.RESOURCES=RESOURCES,exports.STYLEGUIDE_COLORS=STYLEGUIDE_COLORS,exports.adaptCustomNodes=adaptCustomNodes,exports.attachStylesheet=attachStylesheet,exports.convertStyleNumberValues=convertStyleNumberValues,exports.defaultStyleguide=defaultStyleguide,exports.internalEventing=internalEventing,exports.logError=logError,exports.logWarning=logWarning,exports.logger=logger,exports.mapNodeToStyleguide=mapNodeToStyleguide,exports.mergeStyleguidesFromContext=mergeStyleguidesFromContext,exports.portalValidation=portalValidation,exports.providerValidation=providerValidation,exports.tutorialValidation=tutorialValidation,exports.unpackShorthandStyles=unpackShorthandStyles; | ||
"use strict";function _interopDefault(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var util=require("util"),e=_interopDefault(require("crypto")),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=_root.Symbol,_Symbol=Symbol,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 o=nativeObjectToString.call(e);return a&&(t?e[symToStringTag]=r:delete e[symToStringTag]),o}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 o=-1,n=Object(t),i=a(t),s=i.length;s--;){var c=i[e?s:++o];if(!1===r(n[c],c,n))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,o=a&&a.exports===r?_root.Buffer:void 0,n=(o?o.isBuffer:void 0)||stubFalse_1;e.exports=n})),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,o=a&&a.exports===r&&_freeGlobal.process,n=function(){try{var e=a&&a.require&&a.require("util").types;return e||o&&o.binding&&o.binding("util")}catch(e){}}();e.exports=n})),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),o=!r&&!a&&isBuffer_1(e),n=!r&&!a&&!o&&isTypedArray_1(e),i=r||a||o||n,s=i?_baseTimes(e.length,String):[],c=s.length;for(var _ in e)!t&&!hasOwnProperty$3.call(e,_)||i&&("length"==_||o&&("offset"==_||"parent"==_)||n&&("buffer"==_||"byteLength"==_||"byteOffset"==_)||_isIndex(_,c))||s.push(_);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,o,n){var i=r&COMPARE_PARTIAL_FLAG,s=e.length,c=t.length;if(s!=c&&!(i&&c>s))return!1;var _=n.get(e);if(_&&n.get(t))return _==t;var u=-1,l=!0,p=r&COMPARE_UNORDERED_FLAG?new _SetCache:void 0;for(n.set(e,t),n.set(t,e);++u<s;){var g=e[u],y=t[u];if(a)var d=i?a(y,g,u,t,e,n):a(g,y,u,e,t,n);if(void 0!==d){if(d)continue;l=!1;break}if(p){if(!_arraySome(t,(function(e,t){if(!_cacheHas(p,t)&&(g===e||o(g,e,r,a,n)))return p.push(t)}))){l=!1;break}}else if(g!==y&&!o(g,y,r,a,n)){l=!1;break}}return n.delete(e),n.delete(t),l}var _equalArrays=equalArrays,Uint8Array=_root.Uint8Array,_Uint8Array=Uint8Array;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,o,n,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||!n(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 _=i.get(e);if(_)return _==t;a|=COMPARE_UNORDERED_FLAG$1,i.set(e,t);var u=_equalArrays(s(e),s(t),a,o,n,i);return i.delete(e),u;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,o=e.length;++r<a;)e[o+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,o=0,n=[];++r<a;){var i=e[r];t(i,r,e)&&(n[o++]=i)}return n}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,o,n){var i=r&COMPARE_PARTIAL_FLAG$2,s=_getAllKeys(e),c=s.length;if(c!=_getAllKeys(t).length&&!i)return!1;for(var _=c;_--;){var u=s[_];if(!(i?u in t:hasOwnProperty$7.call(t,u)))return!1}var l=n.get(e);if(l&&n.get(t))return l==t;var p=!0;n.set(e,t),n.set(t,e);for(var g=i;++_<c;){var y=e[u=s[_]],d=t[u];if(a)var f=i?a(d,y,u,t,e,n):a(y,d,u,e,t,n);if(!(void 0===f?y===d||o(y,d,r,a,n):f)){p=!1;break}g||(g="constructor"==u)}if(p&&!g){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 n.delete(e),n.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,o,n){var i=isArray_1(e),s=isArray_1(t),c=i?arrayTag$1:_getTag(e),_=s?arrayTag$1:_getTag(t),u=(c=c==argsTag$2?objectTag$2:c)==objectTag$2,l=(_=_==argsTag$2?objectTag$2:_)==objectTag$2,p=c==_;if(p&&isBuffer_1(e)){if(!isBuffer_1(t))return!1;i=!0,u=!1}if(p&&!u)return n||(n=new _Stack),i||isTypedArray_1(e)?_equalArrays(e,t,r,a,o,n):_equalByTag(e,t,c,r,a,o,n);if(!(r&COMPARE_PARTIAL_FLAG$3)){var g=u&&hasOwnProperty$8.call(e,"__wrapped__"),y=l&&hasOwnProperty$8.call(t,"__wrapped__");if(g||y){var d=g?e.value():e,f=y?t.value():t;return n||(n=new _Stack),o(d,f,r,a,n)}}return!!p&&(n||(n=new _Stack),_equalObjects(e,t,r,a,o,n))}var _baseIsEqualDeep=baseIsEqualDeep;function baseIsEqual(e,t,r,a,o){return e===t||(null==e||null==t||!isObjectLike_1(e)&&!isObjectLike_1(t)?e!=e&&t!=t:_baseIsEqualDeep(e,t,r,a,baseIsEqual,o))}var _baseIsEqual=baseIsEqual,COMPARE_PARTIAL_FLAG$4=1,COMPARE_UNORDERED_FLAG$2=2;function baseIsMatch(e,t,r,a){var o=r.length,n=o,i=!a;if(null==e)return!n;for(e=Object(e);o--;){var s=r[o];if(i&&s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++o<n;){var c=(s=r[o])[0],_=e[c],u=s[1];if(i&&s[2]){if(void 0===_&&!(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],o=e[a];t[r]=[a,o,_isStrictComparable(o)]}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,o=t?t.apply(this,a):a[0],n=r.cache;if(n.has(o))return n.get(o);var i=e.apply(this,a);return r.cache=n.set(o,i)||n,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,o){t.push(a?o.replace(reEscapeChar,"$1"):r||e)})),t})),_stringToPath=stringToPath;function arrayMap(e,t){for(var r=-1,a=null==e?0:e.length,o=Array(a);++r<a;)o[r]=t(e[r],r,e);return o}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,o=(t=_castPath(t,e)).length,n=!1;++a<o;){var i=_toKey(t[a]);if(!(n=null!=e&&r(e,i)))break;e=e[i]}return n||++a!=o?n:!!(o=null==e?0:e.length)&&isLength_1(o)&&_isIndex(i,o)&&(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,o){_baseAssignValue(r,a,t(e,a,o))})),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;const unpackShorthandStyles=e=>{const{padding:t,margin:r,...a}=e.css;let o={};return t&&(o={paddingRight:t,paddingLeft:t,paddingBottom:t,paddingTop:t}),r&&(o={...o,marginRight:r,marginLeft:r,marginBottom:r,marginTop:r}),{...e,css:{...o,...a}}},convertStyleNumberValues=e=>{const t=e.css,r={};return Object.entries(t).forEach(([e,t])=>{if(util.isNumber(t))return CSSProperty_1.isUnitlessNumber[e]?void(r[e]=`${t}`):void(r[e]=`${t}px`);r[e]=t}),{...e,css:r}},typographyNode=e=>{const t=get_1(e,"data.custom.variant","P");return{...e,type:t}},normalizeFlexBasis=e=>{const{flexBasis:t}=e.css;return"0"===t||"0px"===t?{...e,css:{...e.css,flexBasis:"0%"}}:e},adaptCustomNodes=e=>mapValues_1(e,e=>{let t=e;return"Typography"===t.type&&(t=typographyNode(t)),t.css&&"flexBasis"in t.css&&(t=normalizeFlexBasis(t)),t.css&&(t=unpackShorthandStyles(t),t=convertStyleNumberValues(t)),t}),eventPrefix=e=>`candu.sdk.${e}`,errorPrefix=e=>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"},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),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=e=>`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={EVENTING_NOT_INITIALIZED:EVENTING_NOT_INITIALIZED,[EVENT_NAMES.PORTAL_ASSET_NOT_FOUND]:PORTAL_ASSET_NOT_FOUND,[EVENT_NAMES.PORTAL_NO_SEGMENT_IDS]:PORTAL_NO_SEGMENT_IDS,[EVENT_NAMES.NO_MATCHING_TUTORIALS]:NO_MATCHING_TUTORIALS,[EVENT_NAMES.NO_VALID_TUTORIAL_IDENTIFIER]:"(Candu/Tutorial) You must define one of tutorialId, slug, commitId or contentHashId.",[EVENT_NAMES.TUTORIAL_LOADING_ERROR]:"An error has occurred while trying to load the Tutorial",[EVENT_NAMES.UNKOWN_INLINE_NODE_TYPE]:unknownMessage(ERROR_SLUGS.UNKOWN_INLINE_NODE_TYPE),[EVENT_NAMES.UNKOWN_NODE_TYPE]:unknownMessage(ERROR_SLUGS.UNKOWN_NODE_TYPE),[EVENT_NAMES.CIRCULAR_DEPENDENCY_EMBED_PORTAL]:"Circular dependency found on Embeded Portal. Please take a look at the Portal Content.",[EVENT_NAMES.CIRCULAR_DEPENDENCY_EMBED_TUTORIAL]:"Circular dependency found on Embeded Tutorial. Please take a look at the Tutorial Content."},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=e=>{const t={};return Object.keys(e).forEach(r=>{defaultStyleguide[r]&&(t[`styleguide.${r}`]=e[r].displayName||!0)}),t},LOGGER={error:console.error,warning:console.warn},internalEventing=({identify:e,track:t})=>({provider:({userId:r,traits:a,styleguide:o})=>{e(r,a),t(EVENT_NAMES.HEARTBEAT,trackStyleguideProperties(o))},tutorialDocumentLoadingError:({tutorialId:e,slug:r,contentHashId:a})=>{LOGGER.error(ERROR_MESSAGES[EVENT_NAMES.TUTORIAL_LOADING_ERROR]),t(EVENT_NAMES.TUTORIAL_LOADING_ERROR,{tutorialId:e,slug:r,contentHashId:a})}});for(var n=function(){return e.randomBytes(16)},t=[],r=0;r<256;++r)t[r]=(r+256).toString(16).substr(1);var i,s,a=function(e,r){var a=r||0,o=t;return[o[e[a++]],o[e[a++]],o[e[a++]],o[e[a++]],"-",o[e[a++]],o[e[a++]],"-",o[e[a++]],o[e[a++]],"-",o[e[a++]],o[e[a++]],"-",o[e[a++]],o[e[a++]],o[e[a++]],o[e[a++]],o[e[a++]],o[e[a++]]].join("")},o=function(e,t,r){var o=t&&r||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null);var i=(e=e||{}).random||(e.rng||n)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,t)for(var s=0;s<16;++s)t[o+s]=i[s];return t||a(i)},c=Object.freeze({__proto__:null,API_BASE_URL:"https://api.candu.ai",VERSION:"0.5.0"});!function(e){e.UserGenerated="UserGenerated",e.SDK="SDK"}(i||(i={})),function(e){e.Identify="Identify",e.Group="Group",e.Track="Track",e.Page="Page",e.Screen="Screen"}(s||(s={}));const m=()=>"undefined"!=typeof window&&window.localStorage,g=e=>t=>{m()&&null!=t&&window.localStorage.setItem(e,JSON.stringify(t))};var f={anonymousId:{getOrCreate:((e,t)=>()=>(e=>()=>{if(m()){const e=window.localStorage.getItem("candu:anonymous_id");if(e)try{return JSON.parse(e)}catch(e){return null}}})()()||(()=>{const e=o();return g("candu:anonymous_id")(e),e})())(),set:g("candu:anonymous_id")}};const O=f.anonymousId.getOrCreate;var t$1="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n$1="object"==typeof t$1&&t$1&&t$1.Object===Object&&t$1,o$1="object"==typeof self&&self&&self.Object===Object&&self,r$1=(n$1||o$1||Function("return this")()).Symbol,a$1=Object.prototype,i$1=a$1.hasOwnProperty,l=a$1.toString,E=r$1?r$1.toStringTag:void 0,c$1=function(e){var t=i$1.call(e,E),r=e[E];try{e[E]=void 0;var a=!0}catch(e){}var o=l.call(e);return a&&(t?e[E]=r:delete e[E]),o},s$1=Object.prototype.toString,u=function(e){return s$1.call(e)},d="[object Null]",p="[object Undefined]",v=r$1?r$1.toStringTag:void 0,T=function(e){return null==e?void 0===e?p:d:v&&v in Object(e)?c$1(e):u(e)},O$1=Array.isArray,_=function(e){return null!=e&&"object"==typeof e},A="[object String]",f$1=function(e){return"string"==typeof e||!O$1(e)&&_(e)&&T(e)==A},m$1="[object Number]",N=function(e){return"number"==typeof e||_(e)&&T(e)==m$1};const P=/^([a-zA-Z0-9]|_|-)+$/,S=e=>f$1(e)&&e.length>=3&&e.length<100&&P.test(e),g$1=e=>N(e)&&e>=0,I=e=>f$1(e)&&!!e.match(/^[0-9a-zA-Z]*$/)&&e.length>=10,R=e=>g$1(e)||f$1(e)&&e.trim().length>0;var L,b,M,w,$,j;!function(e){e.SDK="SDK",e.PREVIEW="PREVIEW"}(L||(L={})),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"}(b||(b={})),(M||(M={})).ON_CLICK="OnClick",function(e){e.NATIVE="Native",e.PENDO="Pendo"}(w||(w={})),function(e){e.NAVIGATE="Navigate",e.CHANGE_TUTORIAL="ChangeTutorial",e.OPEN_GUIDE="OpenGuide"}($||($={})),function(e){e.PRIMARY="primary",e.SECONDARY="primary",e.WARNING="warning",e.DANGER="danger",e.NEUTRAL="neutral",e.ACTIVE="active",e.INFO="info"}(j||(j={}));const V=j.PRIMARY;var W;!function(e){e.U="U",e.B="B",e.Em="Em",e.InlineCode="InlineCode"}(W||(W={}));const U=e=>f$1(e)&&!!e.match(/^[0-9a-zA-Z]{40}$/),B=e=>g$1(e),k=e=>S(e);var X,q,Q,ee,K=Object.freeze({__proto__:null,PREVIEW_SCRIPT_URL:"https://app.candu.ai/preview.html"});!function(e){e.COLLAPSED="Collapsed",e.EXPANDED="Expanded",e.MINIMIZED="Minimized"}(X||(X={})),function(e){e.TUTORIAL="Tutorial",e.PORTAL="Portal"}(q||(q={})),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"}(ee||(ee={}));var invariant=function(e,t,r,a,o,n,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 _=[r,a,o,n,i,s],u=0;(c=new Error(t.replace(/%s/g,(function(){return _[u++]})))).name="Invariant Violation"}throw c.framesToPop=1,c}},invariant_1=invariant;const isValidStyleguideProps=e=>invariant_1(!e||isObject_1(e),"(Candu) styleguide must be undefined or an object"),providerValidation=({clientToken:e,userId:t,traits:r,options:a,styleguide:o,...n})=>(invariant_1(I(e),"(Candu) you must provide a valid clientToken"),invariant_1(!t||R(t),"(Candu) you must provide a valid userId"),isValidStyleguideProps(o),invariant_1(!r||isObject_1(r),"(Candu) traits must be undefined or an object"),invariant_1(!a||isObject_1(a),"(Candu) options must be undefined or an object"),{...n,clientToken:e,traits:r||{},options:a||{},styleguide:o||{},userId:t||O()}),tutorialValidation=({slug:e,styleguide:t,contentHashId:r,tutorialId:a,tutorialDocument:o,...n})=>(isValidStyleguideProps(t),{...n,slug:e,styleguide:t||{},contentHashId:r,tutorialId:a,tutorialDocument:o}),portalValidation=({slug:e,styleguide:t})=>(isValidStyleguideProps(t),{slug:e,styleguide:t||{}}),API_BASE_URL="https://api.candu.ai",CDN_BASE_URL="https://cdn.candu.ai",VERSION="0.5.0";var injections=Object.freeze({__proto__:null,API_BASE_URL:API_BASE_URL,CDN_BASE_URL:CDN_BASE_URL,VERSION:"0.5.0"});const{API_BASE_URL:API_BASE_URL$1}=injections,{CDN_BASE_URL:CDN_BASE_URL$1}=injections,ENDPOINTS={segmentMembership:"/api/segmentMemberships",tutorialDocuments:"/api/tutorialDocumentsEditor"},fetchURL=async e=>(await fetch(e)).json(),fetchFromApi=e=>fetchURL(`${API_BASE_URL$1}${e}`),fetchFromCdn=e=>fetchURL(`${CDN_BASE_URL$1}${e}`),getTutorialDocument=e=>({byId:t=>fetchFromApi(`${ENDPOINTS.tutorialDocuments}/${t}?token=${e}`),bySlug:t=>fetchFromCdn(`/tutorials/${e}/${t}.json`),byContentHash:t=>fetchFromCdn(`/tutorials/${e}/${t}.json`)}),RESOURCES={tutorialDocumentLatestPublished:async(e,t)=>fetchFromApi(`${ENDPOINTS.tutorialDocuments}?token=${e}&finder=latestPublished&tutorialId=${t}`),portalAsset:async(e,t)=>fetchFromCdn(`/portals/${e}/${t}/head.json`),segmentMembership:async(e,t)=>fetchFromApi(`${ENDPOINTS.segmentMembership}/${t}?token=${e}`),tutorialDocument:(e,t,r)=>{const{contentHashId:a,tutorialId:o,tutorialDocument:n,slug:i}=e,s=getTutorialDocument(t);return B(o)?s.byId(o):k(i)?s.bySlug(i):U(a)?s.byContentHash(a):isObject_1(n)?Promise.resolve(n):(LOGGER.error(ERROR_MESSAGES[EVENT_NAMES.NO_VALID_TUTORIAL_IDENTIFIER]),r.track(EVENT_NAMES.NO_VALID_TUTORIAL_IDENTIFIER,{slug:e.slug}),null)}},logError=(...e)=>console.error(...e),logWarning=(...e)=>console.warn(...e),logger={error:logError,warning:logWarning},getEventHandler=e=>{switch(e.trigger){case M.ON_CLICK:default:return"onClick"}},getActionHandler=(e,t)=>{switch(e.handler.type){case $.NAVIGATE:return{[getEventHandler(e)]:()=>{const{href:r,target:a}=e.handler;t(e),"Blank"===a?window.open(r,"_blank"):r&&r.includes("mailto:")?window.location=r:document.location.href=r}};case $.CHANGE_TUTORIAL:return{[getEventHandler(e)]:()=>{const{tutorialId:t}=e.handler;logError("TODO -> change tutorial",t)}};case $.OPEN_GUIDE:return{[getEventHandler(e)]:()=>{const{guideId:t}=e.handler;logError("TODO -> open guide",t)}};default:return{}}},getActionHandlers=({data:e},t)=>{if(!e||!e.actions)return{};const r=e=>{t.provider.eventing.track(EVENT_NAMES.TUTORIAL_INTERACTION,{...e,...t.trackingIdentifiers||{}})};return e.actions.map(e=>getActionHandler(e,r)).reduce((e,t)=>({...e,...t}),{})},mapNodeToStyleguide=(e,t)=>{const{provider:r,document:a,trackingIdentifiers:o}=t,n=a.nodes[e];if(!n)return logger.error("Document is corrupted. Refusing to move further."),null;const i=e=>mapNodeToStyleguide(e,t),{type:s,props:c,css:_}=n,u={...c||{},style:_||{},children:(c||{}).children||n.nodes&&n.nodes.map(i),...getActionHandlers(n,{trackingIdentifiers:o,provider:r})},l={nodeId:e,node:n,document:a,render:{node:i,styleguide:(e,r={})=>t.renderNode(e,{api:l,attributes:r}),tutorial:e=>t.renderTutorial(e),portal:e=>t.renderPortal(e)},trackingIdentifiers:o},p=l.render.styleguide(s,u);return p||(logger.error(ERROR_MESSAGES[EVENT_NAMES.UNKOWN_NODE_TYPE],{type:s}),r.eventing.track(EVENT_NAMES.UNKOWN_NODE_TYPE,{type:s}),null)},mergeStyleguidesFromContext=memoize_1((e,t)=>{const{provider:r,portal:a,tutorial:o}=e,n=r.styleguide;let i,s;return o&&(s=o.styleguide),a&&(i=a.styleguide),{...n||{},...i||{},...s||{},...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=e=>{const 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="#EDEDED",exports.DEFAULT_ALT="",exports.DEFAULT_TAB_ACTIVE_COLOR="#FEFEFE",exports.DEFAULT_TAB_COLOR="#FEFEFE",exports.DEFAULT_TAB_HEADER_COLOR="#333745",exports.DEFAULT_TAB_ITEM_COLOR="#838792",exports.ERROR_MESSAGES=ERROR_MESSAGES,exports.ERROR_SLUGS=ERROR_SLUGS,exports.EVENT_NAMES=EVENT_NAMES,exports.LOGGER=LOGGER,exports.RESOURCES=RESOURCES,exports.STYLEGUIDE_COLORS=STYLEGUIDE_COLORS,exports.adaptCustomNodes=adaptCustomNodes,exports.attachStylesheet=attachStylesheet,exports.convertStyleNumberValues=convertStyleNumberValues,exports.defaultStyleguide=defaultStyleguide,exports.internalEventing=internalEventing,exports.logError=logError,exports.logWarning=logWarning,exports.logger=logger,exports.mapNodeToStyleguide=mapNodeToStyleguide,exports.mergeStyleguidesFromContext=mergeStyleguidesFromContext,exports.portalValidation=portalValidation,exports.providerValidation=providerValidation,exports.tutorialValidation=tutorialValidation,exports.unpackShorthandStyles=unpackShorthandStyles; | ||
//# sourceMappingURL=index.cjs.js.map |
@@ -1,2 +0,2 @@ | ||
import{isNumber as t}from"util";import e from"crypto";var r="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function n(t,e){return t(e={exports:{}},e.exports),e.exports}var o="object"==typeof r&&r&&r.Object===Object&&r,a="object"==typeof self&&self&&self.Object===Object&&self,i=o||a||Function("return this")(),u=i.Symbol,c=Object.prototype,l=c.hasOwnProperty,s=c.toString,f=u?u.toStringTag:void 0;var d=function(t){var e=l.call(t,f),r=t[f];try{t[f]=void 0;var n=!0}catch(t){}var o=s.call(t);return n&&(e?t[f]=r:delete t[f]),o},p=Object.prototype.toString;var _=function(t){return p.call(t)},v="[object Null]",h="[object Undefined]",y=u?u.toStringTag:void 0;var b=function(t){return null==t?void 0===t?h:v:y&&y in Object(t)?d(t):_(t)};var g=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)},E="[object AsyncFunction]",O="[object Function]",T="[object GeneratorFunction]",I="[object Proxy]";var N,m=function(t){if(!g(t))return!1;var e=b(t);return e==O||e==T||e==E||e==I},A=i["__core-js_shared__"],j=(N=/[^.]+$/.exec(A&&A.keys&&A.keys.IE_PROTO||""))?"Symbol(src)_1."+N:"";var R=function(t){return!!j&&j in t},P=Function.prototype.toString;var w=function(t){if(null!=t){try{return P.call(t)}catch(t){}try{return t+""}catch(t){}}return""},D=/^\[object .+?Constructor\]$/,S=Function.prototype,C=Object.prototype,L=S.toString,U=C.hasOwnProperty,k=RegExp("^"+L.call(U).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var B=function(t){return!(!g(t)||R(t))&&(m(t)?k:D).test(w(t))};var z=function(t,e){return null==t?void 0:t[e]};var $=function(t,e){var r=z(t,e);return B(r)?r:void 0},x=function(){try{var t=$(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();var W=function(t,e,r){"__proto__"==e&&x?x(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r};var M=function(t){return function(e,r,n){for(var o=-1,a=Object(e),i=n(e),u=i.length;u--;){var c=i[t?u:++o];if(!1===r(a[c],c,a))break}return e}}();var F=function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n};var G=function(t){return null!=t&&"object"==typeof t},V="[object Arguments]";var Y=function(t){return G(t)&&b(t)==V},K=Object.prototype,H=K.hasOwnProperty,J=K.propertyIsEnumerable,Z=Y(function(){return arguments}())?Y:function(t){return G(t)&&H.call(t,"callee")&&!J.call(t,"callee")},q=Array.isArray;var X=function(){return!1},Q=n((function(t,e){var r=e&&!e.nodeType&&e,n=r&&t&&!t.nodeType&&t,o=n&&n.exports===r?i.Buffer:void 0,a=(o?o.isBuffer:void 0)||X;t.exports=a})),tt=9007199254740991,et=/^(?:0|[1-9]\d*)$/;var rt=function(t,e){var r=typeof t;return!!(e=null==e?tt:e)&&("number"==r||"symbol"!=r&&et.test(t))&&t>-1&&t%1==0&&t<e},nt=9007199254740991;var ot=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=nt},at={};at["[object Float32Array]"]=at["[object Float64Array]"]=at["[object Int8Array]"]=at["[object Int16Array]"]=at["[object Int32Array]"]=at["[object Uint8Array]"]=at["[object Uint8ClampedArray]"]=at["[object Uint16Array]"]=at["[object Uint32Array]"]=!0,at["[object Arguments]"]=at["[object Array]"]=at["[object ArrayBuffer]"]=at["[object Boolean]"]=at["[object DataView]"]=at["[object Date]"]=at["[object Error]"]=at["[object Function]"]=at["[object Map]"]=at["[object Number]"]=at["[object Object]"]=at["[object RegExp]"]=at["[object Set]"]=at["[object String]"]=at["[object WeakMap]"]=!1;var it=function(t){return G(t)&&ot(t.length)&&!!at[b(t)]};var ut=function(t){return function(e){return t(e)}},ct=n((function(t,e){var r=e&&!e.nodeType&&e,n=r&&t&&!t.nodeType&&t,a=n&&n.exports===r&&o.process,i=function(){try{var t=n&&n.require&&n.require("util").types;return t||a&&a.binding&&a.binding("util")}catch(t){}}();t.exports=i})),lt=ct&&ct.isTypedArray,st=lt?ut(lt):it,ft=Object.prototype.hasOwnProperty;var dt=function(t,e){var r=q(t),n=!r&&Z(t),o=!r&&!n&&Q(t),a=!r&&!n&&!o&&st(t),i=r||n||o||a,u=i?F(t.length,String):[],c=u.length;for(var l in t)!e&&!ft.call(t,l)||i&&("length"==l||o&&("offset"==l||"parent"==l)||a&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||rt(l,c))||u.push(l);return u},pt=Object.prototype;var _t=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||pt)};var vt=function(t,e){return function(r){return t(e(r))}}(Object.keys,Object),ht=Object.prototype.hasOwnProperty;var yt=function(t){if(!_t(t))return vt(t);var e=[];for(var r in Object(t))ht.call(t,r)&&"constructor"!=r&&e.push(r);return e};var bt=function(t){return null!=t&&ot(t.length)&&!m(t)};var gt=function(t){return bt(t)?dt(t):yt(t)};var Et=function(t,e){return t&&M(t,e,gt)};var Ot=function(){this.__data__=[],this.size=0};var Tt=function(t,e){return t===e||t!=t&&e!=e};var It=function(t,e){for(var r=t.length;r--;)if(Tt(t[r][0],e))return r;return-1},Nt=Array.prototype.splice;var mt=function(t){var e=this.__data__,r=It(e,t);return!(r<0)&&(r==e.length-1?e.pop():Nt.call(e,r,1),--this.size,!0)};var At=function(t){var e=this.__data__,r=It(e,t);return r<0?void 0:e[r][1]};var jt=function(t){return It(this.__data__,t)>-1};var Rt=function(t,e){var r=this.__data__,n=It(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this};function Pt(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])}}Pt.prototype.clear=Ot,Pt.prototype.delete=mt,Pt.prototype.get=At,Pt.prototype.has=jt,Pt.prototype.set=Rt;var wt=Pt;var Dt=function(){this.__data__=new wt,this.size=0};var St=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r};var Ct=function(t){return this.__data__.get(t)};var Lt=function(t){return this.__data__.has(t)},Ut=$(i,"Map"),kt=$(Object,"create");var Bt=function(){this.__data__=kt?kt(null):{},this.size=0};var zt=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},$t="__lodash_hash_undefined__",xt=Object.prototype.hasOwnProperty;var Wt=function(t){var e=this.__data__;if(kt){var r=e[t];return r===$t?void 0:r}return xt.call(e,t)?e[t]:void 0},Mt=Object.prototype.hasOwnProperty;var Ft=function(t){var e=this.__data__;return kt?void 0!==e[t]:Mt.call(e,t)},Gt="__lodash_hash_undefined__";var Vt=function(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=kt&&void 0===e?Gt:e,this};function Yt(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])}}Yt.prototype.clear=Bt,Yt.prototype.delete=zt,Yt.prototype.get=Wt,Yt.prototype.has=Ft,Yt.prototype.set=Vt;var Kt=Yt;var Ht=function(){this.size=0,this.__data__={hash:new Kt,map:new(Ut||wt),string:new Kt}};var Jt=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t};var Zt=function(t,e){var r=t.__data__;return Jt(e)?r["string"==typeof e?"string":"hash"]:r.map};var qt=function(t){var e=Zt(this,t).delete(t);return this.size-=e?1:0,e};var Xt=function(t){return Zt(this,t).get(t)};var Qt=function(t){return Zt(this,t).has(t)};var te=function(t,e){var r=Zt(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this};function ee(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])}}ee.prototype.clear=Ht,ee.prototype.delete=qt,ee.prototype.get=Xt,ee.prototype.has=Qt,ee.prototype.set=te;var re=ee,ne=200;var oe=function(t,e){var r=this.__data__;if(r instanceof wt){var n=r.__data__;if(!Ut||n.length<ne-1)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new re(n)}return r.set(t,e),this.size=r.size,this};function ae(t){var e=this.__data__=new wt(t);this.size=e.size}ae.prototype.clear=Dt,ae.prototype.delete=St,ae.prototype.get=Ct,ae.prototype.has=Lt,ae.prototype.set=oe;var ie=ae,ue="__lodash_hash_undefined__";var ce=function(t){return this.__data__.set(t,ue),this};var le=function(t){return this.__data__.has(t)};function se(t){var e=-1,r=null==t?0:t.length;for(this.__data__=new re;++e<r;)this.add(t[e])}se.prototype.add=se.prototype.push=ce,se.prototype.has=le;var fe=se;var de=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 pe=function(t,e){return t.has(e)},_e=1,ve=2;var he=function(t,e,r,n,o,a){var i=r&_e,u=t.length,c=e.length;if(u!=c&&!(i&&c>u))return!1;var l=a.get(t);if(l&&a.get(e))return l==e;var s=-1,f=!0,d=r&ve?new fe:void 0;for(a.set(t,e),a.set(e,t);++s<u;){var p=t[s],_=e[s];if(n)var v=i?n(_,p,s,e,t,a):n(p,_,s,t,e,a);if(void 0!==v){if(v)continue;f=!1;break}if(d){if(!de(e,(function(t,e){if(!pe(d,e)&&(p===t||o(p,t,r,n,a)))return d.push(e)}))){f=!1;break}}else if(p!==_&&!o(p,_,r,n,a)){f=!1;break}}return a.delete(t),a.delete(e),f},ye=i.Uint8Array;var be=function(t){var e=-1,r=Array(t.size);return t.forEach((function(t,n){r[++e]=[n,t]})),r};var ge=function(t){var e=-1,r=Array(t.size);return t.forEach((function(t){r[++e]=t})),r},Ee=1,Oe=2,Te="[object Boolean]",Ie="[object Date]",Ne="[object Error]",me="[object Map]",Ae="[object Number]",je="[object RegExp]",Re="[object Set]",Pe="[object String]",we="[object Symbol]",De="[object ArrayBuffer]",Se="[object DataView]",Ce=u?u.prototype:void 0,Le=Ce?Ce.valueOf:void 0;var Ue=function(t,e,r,n,o,a,i){switch(r){case Se:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case De:return!(t.byteLength!=e.byteLength||!a(new ye(t),new ye(e)));case Te:case Ie:case Ae:return Tt(+t,+e);case Ne:return t.name==e.name&&t.message==e.message;case je:case Pe:return t==e+"";case me:var u=be;case Re:var c=n&Ee;if(u||(u=ge),t.size!=e.size&&!c)return!1;var l=i.get(t);if(l)return l==e;n|=Oe,i.set(t,e);var s=he(u(t),u(e),n,o,a,i);return i.delete(t),s;case we:if(Le)return Le.call(t)==Le.call(e)}return!1};var ke=function(t,e){for(var r=-1,n=e.length,o=t.length;++r<n;)t[o+r]=e[r];return t};var Be=function(t,e,r){var n=e(t);return q(t)?n:ke(n,r(t))};var ze=function(t,e){for(var r=-1,n=null==t?0:t.length,o=0,a=[];++r<n;){var i=t[r];e(i,r,t)&&(a[o++]=i)}return a};var $e=function(){return[]},xe=Object.prototype.propertyIsEnumerable,We=Object.getOwnPropertySymbols,Me=We?function(t){return null==t?[]:(t=Object(t),ze(We(t),(function(e){return xe.call(t,e)})))}:$e;var Fe=function(t){return Be(t,gt,Me)},Ge=1,Ve=Object.prototype.hasOwnProperty;var Ye=function(t,e,r,n,o,a){var i=r&Ge,u=Fe(t),c=u.length;if(c!=Fe(e).length&&!i)return!1;for(var l=c;l--;){var s=u[l];if(!(i?s in e:Ve.call(e,s)))return!1}var f=a.get(t);if(f&&a.get(e))return f==e;var d=!0;a.set(t,e),a.set(e,t);for(var p=i;++l<c;){var _=t[s=u[l]],v=e[s];if(n)var h=i?n(v,_,s,e,t,a):n(_,v,s,t,e,a);if(!(void 0===h?_===v||o(_,v,r,n,a):h)){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 a.delete(t),a.delete(e),d},Ke=$(i,"DataView"),He=$(i,"Promise"),Je=$(i,"Set"),Ze=$(i,"WeakMap"),qe=w(Ke),Xe=w(Ut),Qe=w(He),tr=w(Je),er=w(Ze),rr=b;(Ke&&"[object DataView]"!=rr(new Ke(new ArrayBuffer(1)))||Ut&&"[object Map]"!=rr(new Ut)||He&&"[object Promise]"!=rr(He.resolve())||Je&&"[object Set]"!=rr(new Je)||Ze&&"[object WeakMap]"!=rr(new Ze))&&(rr=function(t){var e=b(t),r="[object Object]"==e?t.constructor:void 0,n=r?w(r):"";if(n)switch(n){case qe:return"[object DataView]";case Xe:return"[object Map]";case Qe:return"[object Promise]";case tr:return"[object Set]";case er:return"[object WeakMap]"}return e});var nr=rr,or=1,ar="[object Arguments]",ir="[object Array]",ur="[object Object]",cr=Object.prototype.hasOwnProperty;var lr=function(t,e,r,n,o,a){var i=q(t),u=q(e),c=i?ir:nr(t),l=u?ir:nr(e),s=(c=c==ar?ur:c)==ur,f=(l=l==ar?ur:l)==ur,d=c==l;if(d&&Q(t)){if(!Q(e))return!1;i=!0,s=!1}if(d&&!s)return a||(a=new ie),i||st(t)?he(t,e,r,n,o,a):Ue(t,e,c,r,n,o,a);if(!(r&or)){var p=s&&cr.call(t,"__wrapped__"),_=f&&cr.call(e,"__wrapped__");if(p||_){var v=p?t.value():t,h=_?e.value():e;return a||(a=new ie),o(v,h,r,n,a)}}return!!d&&(a||(a=new ie),Ye(t,e,r,n,o,a))};var sr=function t(e,r,n,o,a){return e===r||(null==e||null==r||!G(e)&&!G(r)?e!=e&&r!=r:lr(e,r,n,o,t,a))},fr=1,dr=2;var pr=function(t,e,r,n){var o=r.length,a=o,i=!n;if(null==t)return!a;for(t=Object(t);o--;){var u=r[o];if(i&&u[2]?u[1]!==t[u[0]]:!(u[0]in t))return!1}for(;++o<a;){var c=(u=r[o])[0],l=t[c],s=u[1];if(i&&u[2]){if(void 0===l&&!(c in t))return!1}else{var f=new ie;if(n)var d=n(l,s,c,t,e,f);if(!(void 0===d?sr(s,l,fr|dr,n,f):d))return!1}}return!0};var _r=function(t){return t==t&&!g(t)};var vr=function(t){for(var e=gt(t),r=e.length;r--;){var n=e[r],o=t[n];e[r]=[n,o,_r(o)]}return e};var hr=function(t,e){return function(r){return null!=r&&(r[t]===e&&(void 0!==e||t in Object(r)))}};var yr=function(t){var e=vr(t);return 1==e.length&&e[0][2]?hr(e[0][0],e[0][1]):function(r){return r===t||pr(r,t,e)}},br="[object Symbol]";var gr=function(t){return"symbol"==typeof t||G(t)&&b(t)==br},Er=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Or=/^\w*$/;var Tr=function(t,e){if(q(t))return!1;var r=typeof t;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=t&&!gr(t))||(Or.test(t)||!Er.test(t)||null!=e&&t in Object(e))},Ir="Expected a function";function Nr(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError(Ir);var r=function(){var n=arguments,o=e?e.apply(this,n):n[0],a=r.cache;if(a.has(o))return a.get(o);var i=t.apply(this,n);return r.cache=a.set(o,i)||a,i};return r.cache=new(Nr.Cache||re),r}Nr.Cache=re;var mr=Nr,Ar=500;var jr=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Rr=/\\(\\)?/g,Pr=function(t){var e=mr(t,(function(t){return r.size===Ar&&r.clear(),t})),r=e.cache;return e}((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(jr,(function(t,r,n,o){e.push(n?o.replace(Rr,"$1"):r||t)})),e}));var wr=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},Dr=1/0,Sr=u?u.prototype:void 0,Cr=Sr?Sr.toString:void 0;var Lr=function t(e){if("string"==typeof e)return e;if(q(e))return wr(e,t)+"";if(gr(e))return Cr?Cr.call(e):"";var r=e+"";return"0"==r&&1/e==-Dr?"-0":r};var Ur=function(t){return null==t?"":Lr(t)};var kr=function(t,e){return q(t)?t:Tr(t,e)?[t]:Pr(Ur(t))},Br=1/0;var zr=function(t){if("string"==typeof t||gr(t))return t;var e=t+"";return"0"==e&&1/t==-Br?"-0":e};var $r=function(t,e){for(var r=0,n=(e=kr(e,t)).length;null!=t&&r<n;)t=t[zr(e[r++])];return r&&r==n?t:void 0};var xr=function(t,e,r){var n=null==t?void 0:$r(t,e);return void 0===n?r:n};var Wr=function(t,e){return null!=t&&e in Object(t)};var Mr=function(t,e,r){for(var n=-1,o=(e=kr(e,t)).length,a=!1;++n<o;){var i=zr(e[n]);if(!(a=null!=t&&r(t,i)))break;t=t[i]}return a||++n!=o?a:!!(o=null==t?0:t.length)&&ot(o)&&rt(i,o)&&(q(t)||Z(t))};var Fr=function(t,e){return null!=t&&Mr(t,e,Wr)},Gr=1,Vr=2;var Yr=function(t,e){return Tr(t)&&_r(e)?hr(zr(t),e):function(r){var n=xr(r,t);return void 0===n&&n===e?Fr(r,t):sr(e,n,Gr|Vr)}};var Kr=function(t){return t};var Hr=function(t){return function(e){return null==e?void 0:e[t]}};var Jr=function(t){return function(e){return $r(e,t)}};var Zr=function(t){return Tr(t)?Hr(zr(t)):Jr(t)};var qr=function(t){return"function"==typeof t?t:null==t?Kr:"object"==typeof t?q(t)?Yr(t[0],t[1]):yr(t):Zr(t)};var Xr=function(t,e){var r={};return e=qr(e),Et(t,(function(t,n,o){W(r,n,e(t,n,o))})),r},Qr={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 tn=["Webkit","ms","Moz","O"];Object.keys(Qr).forEach((function(t){tn.forEach((function(e){Qr[function(t,e){return t+e.charAt(0).toUpperCase()+e.substring(1)}(e,t)]=Qr[t]}))}));var en={isUnitlessNumber:Qr,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}}};const rn=t=>{const{padding:e,margin:r,...n}=t.css;let o={};return e&&(o={paddingRight:e,paddingLeft:e,paddingBottom:e,paddingTop:e}),r&&(o={...o,marginRight:r,marginLeft:r,marginBottom:r,marginTop:r}),{...t,css:{...o,...n}}},nn=e=>{const r=e.css,n={};return Object.entries(r).forEach(([e,r])=>{if(t(r))return en.isUnitlessNumber[e]?void(n[e]=`${r}`):void(n[e]=`${r}px`);n[e]=r}),{...e,css:n}},on=t=>Xr(t,t=>{let e=t;return"Typography"===e.type&&(e=(t=>{const e=xr(t,"data.custom.variant","P");return{...t,type:e}})(e)),e.css&&"flexBasis"in e.css&&(e=(t=>{const{flexBasis:e}=t.css;return"0"===e||"0px"===e?{...t,css:{...t.css,flexBasis:"0%"}}:t})(e)),e.css&&(e=rn(e),e=nn(e)),e}),an=t=>`candu.sdk.${t}`,un=t=>an(`error.${t}`),cn={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"},ln={HEARTBEAT:an("heartbeat"),PREVIEW_OPEN:an("preview.open"),PORTAL:an("portal"),TUTORIAL:an("tutorial"),TUTORIAL_INTERACTION:an("tutorial.interaction"),PORTAL_ASSET_NOT_FOUND:un("portal_asset_not_found"),PORTAL_NO_SEGMENT_IDS:un("portal_no_segment_ids"),NO_MATCHING_TUTORIALS:un("no_matching_tutorials"),NO_VALID_TUTORIAL_IDENTIFIER:un("no_valid_tutorial_identifier"),COMMIT_API_LOADING_ERROR:un("commit_api"),TUTORIAL_LOADING_ERROR:un("tutorial"),UNKOWN_NODE_TYPE:un(cn.UNKOWN_NODE_TYPE),UNKOWN_INLINE_NODE_TYPE:un(cn.UNKOWN_INLINE_NODE_TYPE),UNKOWN_NODE_OBJECT_TYPE:un(cn.UNKOWN_NODE_OBJECT_TYPE),CIRCULAR_DEPENDENCY_EMBED_PORTAL:un("circular_dependecy_embed_portal"),CIRCULAR_DEPENDENCY_EMBED_TUTORIAL:un("circular_dependecy_embed_tutorial")},sn=t=>`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}.`,fn={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",[ln.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",[ln.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",[ln.NO_MATCHING_TUTORIALS]:"The Tutorial will not be rendered because there are no matching segments for the given user.",[ln.NO_VALID_TUTORIAL_IDENTIFIER]:"(Candu/Tutorial) You must define one of tutorialId, slug, commitId or contentHashId.",[ln.TUTORIAL_LOADING_ERROR]:"An error has occurred while trying to load the Tutorial",[ln.UNKOWN_INLINE_NODE_TYPE]:sn(cn.UNKOWN_INLINE_NODE_TYPE),[ln.UNKOWN_NODE_TYPE]:sn(cn.UNKOWN_NODE_TYPE),[ln.CIRCULAR_DEPENDENCY_EMBED_PORTAL]:"Circular dependency found on Embeded Portal. Please take a look at the Portal Content.",[ln.CIRCULAR_DEPENDENCY_EMBED_TUTORIAL]:"Circular dependency found on Embeded Tutorial. Please take a look at the Tutorial Content."},dn={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},pn={error:console.error,warning:console.warn},_n=({identify:t,track:e})=>({provider:({userId:r,traits:n,styleguide:o})=>{t(r,n),e(ln.HEARTBEAT,(t=>{const e={};return Object.keys(t).forEach(r=>{dn[r]&&(e[`styleguide.${r}`]=t[r].displayName||!0)}),e})(o))},tutorialDocumentLoadingError:({tutorialId:t,slug:r,contentHashId:n})=>{pn.error(fn[ln.TUTORIAL_LOADING_ERROR]),e(ln.TUTORIAL_LOADING_ERROR,{tutorialId:t,slug:r,contentHashId:n})}});for(var vn=function(){return e.randomBytes(16)},hn=[],yn=0;yn<256;++yn)hn[yn]=(yn+256).toString(16).substr(1);var bn,gn,En=function(t,e){var r=e||0,n=hn;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("")},On=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||vn)();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,e)for(var a=0;a<16;++a)e[n+a]=o[a];return e||En(o)};Object.freeze({__proto__:null,API_BASE_URL:"https://api.candu.ai",VERSION:"0.5.0-alpha.3"});!function(t){t.UserGenerated="UserGenerated",t.SDK="SDK"}(bn||(bn={})),function(t){t.Identify="Identify",t.Group="Group",t.Track="Track",t.Page="Page",t.Screen="Screen"}(gn||(gn={}));const Tn=()=>"undefined"!=typeof window&&window.localStorage,In=t=>e=>{Tn()&&null!=e&&window.localStorage.setItem(t,JSON.stringify(e))};const Nn={anonymousId:{getOrCreate:((t,e)=>()=>(t=>()=>{if(Tn()){const t=window.localStorage.getItem("candu:anonymous_id");if(t)try{return JSON.parse(t)}catch(t){return null}}})()()||(()=>{const t=On();return In("candu:anonymous_id")(t),t})())(),set:In("candu:anonymous_id")}}.anonymousId.getOrCreate;var mn="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},An="object"==typeof mn&&mn&&mn.Object===Object&&mn,jn="object"==typeof self&&self&&self.Object===Object&&self,Rn=(An||jn||Function("return this")()).Symbol,Pn=Object.prototype,wn=Pn.hasOwnProperty,Dn=Pn.toString,Sn=Rn?Rn.toStringTag:void 0,Cn=Object.prototype.toString,Ln=Rn?Rn.toStringTag:void 0,Un=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":Ln&&Ln in Object(t)?function(t){var e=wn.call(t,Sn),r=t[Sn];try{t[Sn]=void 0;var n=!0}catch(t){}var o=Dn.call(t);return n&&(e?t[Sn]=r:delete t[Sn]),o}(t):function(t){return Cn.call(t)}(t)},kn=Array.isArray,Bn=function(t){return null!=t&&"object"==typeof t},zn=function(t){return"string"==typeof t||!kn(t)&&Bn(t)&&"[object String]"==Un(t)};const $n=/^([a-zA-Z0-9]|_|-)+$/,xn=t=>(function(t){return"number"==typeof t||Bn(t)&&"[object Number]"==Un(t)})(t)&&t>=0;var Wn,Mn,Fn,Gn,Vn,Yn;!function(t){t.SDK="SDK",t.PREVIEW="PREVIEW"}(Wn||(Wn={})),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"}(Mn||(Mn={})),(Fn||(Fn={})).ON_CLICK="OnClick",function(t){t.NATIVE="Native",t.PENDO="Pendo"}(Gn||(Gn={})),function(t){t.NAVIGATE="Navigate",t.CHANGE_TUTORIAL="ChangeTutorial",t.OPEN_GUIDE="OpenGuide"}(Vn||(Vn={})),function(t){t.PRIMARY="primary",t.SECONDARY="primary",t.WARNING="warning",t.DANGER="danger",t.NEUTRAL="neutral",t.ACTIVE="active",t.INFO="info"}(Yn||(Yn={}));Yn.PRIMARY;var Kn;!function(t){t.U="U",t.B="B",t.Em="Em",t.InlineCode="InlineCode"}(Kn||(Kn={}));const Hn=t=>(t=>zn(t)&&t.length>=3&&t.length<100&&$n.test(t))(t);var Jn,Zn,qn,Xn;Object.freeze({__proto__:null,PREVIEW_SCRIPT_URL:"https://app.candu.ai/preview.html"});!function(t){t.COLLAPSED="Collapsed",t.EXPANDED="Expanded",t.MINIMIZED="Minimized"}(Jn||(Jn={})),function(t){t.TUTORIAL="Tutorial",t.PORTAL="Portal"}(Zn||(Zn={})),function(t){t.Global="Global",t.Organization="Organization"}(qn||(qn={})),function(t){t.Root="root",t.Rule="rule",t.Atrule="atrule",t.Decl="decl",t.Any="any"}(Xn||(Xn={}));var Qn=function(t,e,r,n,o,a,i,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,a,i,u],s=0;(c=new Error(e.replace(/%s/g,(function(){return l[s++]})))).name="Invariant Violation"}throw c.framesToPop=1,c}};const to=t=>Qn(!t||g(t),"(Candu) styleguide must be undefined or an object"),eo=({clientToken:t,userId:e,traits:r,options:n,styleguide:o,...a})=>(Qn((t=>zn(t)&&!!t.match(/^[0-9a-zA-Z]*$/)&&t.length>=10)(t),"(Candu) you must provide a valid clientToken"),Qn(!e||(t=>xn(t)||zn(t)&&t.trim().length>0)(e),"(Candu) you must provide a valid userId"),to(o),Qn(!r||g(r),"(Candu) traits must be undefined or an object"),Qn(!n||g(n),"(Candu) options must be undefined or an object"),{...a,clientToken:t,traits:r||{},options:n||{},styleguide:o||{},userId:e||Nn()}),ro=({slug:t,styleguide:e,contentHashId:r,tutorialId:n,tutorialDocument:o,...a})=>(to(e),{...a,slug:t,styleguide:e||{},contentHashId:r,tutorialId:n,tutorialDocument:o}),no=({slug:t,styleguide:e})=>(to(e),{slug:t,styleguide:e||{}});var oo=Object.freeze({__proto__:null,API_BASE_URL:"https://api.candu.ai",CDN_BASE_URL:"https://cdn.candu.ai",VERSION:"0.5.0-alpha.3"});const{API_BASE_URL:ao}=oo,{CDN_BASE_URL:io}=oo,uo="/api/segmentMemberships",co="/api/tutorialDocumentsEditor",lo=async t=>(await fetch(t)).json(),so=t=>lo(`${ao}${t}`),fo=t=>lo(`${io}${t}`),po={tutorialDocumentLatestPublished:async(t,e)=>so(`${co}?token=${t}&finder=latestPublished&tutorialId=${e}`),portalAsset:async(t,e)=>fo(`/portals/${t}/${e}/head.json`),segmentMembership:async(t,e)=>so(`${uo}/${e}?token=${t}`),tutorialDocument:(t,e,r)=>{const{contentHashId:n,tutorialId:o,tutorialDocument:a,slug:i}=t,u=(t=>({byId:e=>so(`${co}/${e}?token=${t}`),bySlug:e=>fo(`/tutorials/${t}/${e}.json`),byContentHash:e=>fo(`/tutorials/${t}/${e}.json`)}))(e);return(t=>xn(t))(o)?u.byId(o):Hn(i)?u.bySlug(i):(t=>zn(t)&&!!t.match(/^[0-9a-zA-Z]{40}$/))(n)?u.byContentHash(n):g(a)?Promise.resolve(a):(pn.error(fn[ln.NO_VALID_TUTORIAL_IDENTIFIER]),r.track(ln.NO_VALID_TUTORIAL_IDENTIFIER,{slug:t.slug}),null)}},_o=(...t)=>console.error(...t),vo=(...t)=>console.warn(...t),ho={error:_o,warning:vo},yo=t=>{switch(t.trigger){case Fn.ON_CLICK:default:return"onClick"}},bo=({data:t},e)=>{if(!t||!t.actions)return{};const r=t=>{e.provider.eventing.track(ln.TUTORIAL_INTERACTION,{...t,...e.trackingIdentifiers||{}})};return t.actions.map(t=>((t,e)=>{switch(t.handler.type){case Vn.NAVIGATE:return{[yo(t)]:()=>{const{href:r,target:n}=t.handler;e(t),"Blank"===n?window.open(r,"_blank"):r&&r.includes("mailto:")?window.location=r:document.location.href=r}};case Vn.CHANGE_TUTORIAL:return{[yo(t)]:()=>{const{tutorialId:e}=t.handler;_o("TODO -> change tutorial",e)}};case Vn.OPEN_GUIDE:return{[yo(t)]:()=>{const{guideId:e}=t.handler;_o("TODO -> open guide",e)}};default:return{}}})(t,r)).reduce((t,e)=>({...t,...e}),{})},go=(t,e)=>{const{provider:r,document:n,trackingIdentifiers:o}=e,a=n.nodes[t];if(!a)return ho.error("Document is corrupted. Refusing to move further."),null;const i=t=>go(t,e),{type:u,props:c,css:l}=a,s={...c||{},style:l||{},children:(c||{}).children||a.nodes&&a.nodes.map(i),...bo(a,{trackingIdentifiers:o,provider:r})},f={nodeId:t,node:a,document:n,render:{node:i,styleguide:(t,r={})=>e.renderNode(t,{api:f,attributes:r}),tutorial:t=>e.renderTutorial(t),portal:t=>e.renderPortal(t)},trackingIdentifiers:o},d=f.render.styleguide(u,s);return d||(ho.error(fn[ln.UNKOWN_NODE_TYPE],{type:u}),r.eventing.track(ln.UNKOWN_NODE_TYPE,{type:u}),null)},Eo=mr((t,e)=>{const{provider:r,portal:n,tutorial:o}=t,a=r.styleguide;let i,u;return o&&(u=o.styleguide),n&&(i=n.styleguide),{...a||{},...i||{},...u||{},...e||{}}}),Oo="",To="#EDEDED",Io="#333745",No="#838792",mo="#FEFEFE",Ao="#FEFEFE",jo={primary:"#6310E5",secondary:"#59C3C3",tertiary:"#4D515D",warning:"#FCAD0D",danger:"#EE4266"},Ro=t=>{const e=document.createElement("link");e.setAttribute("rel","stylesheet"),e.setAttribute("href",`${io}/styleguides/applications/${t}/default/main.css`),document.head.appendChild(e)};export{To as DEFAULT_ALERT_COLOR,Oo as DEFAULT_ALT,mo as DEFAULT_TAB_ACTIVE_COLOR,Ao as DEFAULT_TAB_COLOR,Io as DEFAULT_TAB_HEADER_COLOR,No as DEFAULT_TAB_ITEM_COLOR,fn as ERROR_MESSAGES,cn as ERROR_SLUGS,ln as EVENT_NAMES,pn as LOGGER,po as RESOURCES,jo as STYLEGUIDE_COLORS,on as adaptCustomNodes,Ro as attachStylesheet,nn as convertStyleNumberValues,dn as defaultStyleguide,_n as internalEventing,_o as logError,vo as logWarning,ho as logger,go as mapNodeToStyleguide,Eo as mergeStyleguidesFromContext,no as portalValidation,eo as providerValidation,ro as tutorialValidation,rn as unpackShorthandStyles}; | ||
import{isNumber as t}from"util";import e from"crypto";var r="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function n(t,e){return t(e={exports:{}},e.exports),e.exports}var o="object"==typeof r&&r&&r.Object===Object&&r,a="object"==typeof self&&self&&self.Object===Object&&self,i=o||a||Function("return this")(),u=i.Symbol,c=Object.prototype,s=c.hasOwnProperty,l=c.toString,f=u?u.toStringTag:void 0;var d=function(t){var e=s.call(t,f),r=t[f];try{t[f]=void 0;var n=!0}catch(t){}var o=l.call(t);return n&&(e?t[f]=r:delete t[f]),o},p=Object.prototype.toString;var _=function(t){return p.call(t)},v="[object Null]",h="[object Undefined]",y=u?u.toStringTag:void 0;var b=function(t){return null==t?void 0===t?h:v:y&&y in Object(t)?d(t):_(t)};var g=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)},E="[object AsyncFunction]",O="[object Function]",T="[object GeneratorFunction]",I="[object Proxy]";var N,m=function(t){if(!g(t))return!1;var e=b(t);return e==O||e==T||e==E||e==I},A=i["__core-js_shared__"],j=(N=/[^.]+$/.exec(A&&A.keys&&A.keys.IE_PROTO||""))?"Symbol(src)_1."+N:"";var R=function(t){return!!j&&j in t},P=Function.prototype.toString;var w=function(t){if(null!=t){try{return P.call(t)}catch(t){}try{return t+""}catch(t){}}return""},D=/^\[object .+?Constructor\]$/,S=Function.prototype,C=Object.prototype,L=S.toString,U=C.hasOwnProperty,k=RegExp("^"+L.call(U).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var B=function(t){return!(!g(t)||R(t))&&(m(t)?k:D).test(w(t))};var z=function(t,e){return null==t?void 0:t[e]};var $=function(t,e){var r=z(t,e);return B(r)?r:void 0},x=function(){try{var t=$(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();var W=function(t,e,r){"__proto__"==e&&x?x(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r};var M=function(t){return function(e,r,n){for(var o=-1,a=Object(e),i=n(e),u=i.length;u--;){var c=i[t?u:++o];if(!1===r(a[c],c,a))break}return e}}();var F=function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n};var G=function(t){return null!=t&&"object"==typeof t},V="[object Arguments]";var Y=function(t){return G(t)&&b(t)==V},K=Object.prototype,H=K.hasOwnProperty,J=K.propertyIsEnumerable,Z=Y(function(){return arguments}())?Y:function(t){return G(t)&&H.call(t,"callee")&&!J.call(t,"callee")},q=Array.isArray;var X=function(){return!1},Q=n((function(t,e){var r=e&&!e.nodeType&&e,n=r&&t&&!t.nodeType&&t,o=n&&n.exports===r?i.Buffer:void 0,a=(o?o.isBuffer:void 0)||X;t.exports=a})),tt=9007199254740991,et=/^(?:0|[1-9]\d*)$/;var rt=function(t,e){var r=typeof t;return!!(e=null==e?tt:e)&&("number"==r||"symbol"!=r&&et.test(t))&&t>-1&&t%1==0&&t<e},nt=9007199254740991;var ot=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=nt},at={};at["[object Float32Array]"]=at["[object Float64Array]"]=at["[object Int8Array]"]=at["[object Int16Array]"]=at["[object Int32Array]"]=at["[object Uint8Array]"]=at["[object Uint8ClampedArray]"]=at["[object Uint16Array]"]=at["[object Uint32Array]"]=!0,at["[object Arguments]"]=at["[object Array]"]=at["[object ArrayBuffer]"]=at["[object Boolean]"]=at["[object DataView]"]=at["[object Date]"]=at["[object Error]"]=at["[object Function]"]=at["[object Map]"]=at["[object Number]"]=at["[object Object]"]=at["[object RegExp]"]=at["[object Set]"]=at["[object String]"]=at["[object WeakMap]"]=!1;var it=function(t){return G(t)&&ot(t.length)&&!!at[b(t)]};var ut=function(t){return function(e){return t(e)}},ct=n((function(t,e){var r=e&&!e.nodeType&&e,n=r&&t&&!t.nodeType&&t,a=n&&n.exports===r&&o.process,i=function(){try{var t=n&&n.require&&n.require("util").types;return t||a&&a.binding&&a.binding("util")}catch(t){}}();t.exports=i})),st=ct&&ct.isTypedArray,lt=st?ut(st):it,ft=Object.prototype.hasOwnProperty;var dt=function(t,e){var r=q(t),n=!r&&Z(t),o=!r&&!n&&Q(t),a=!r&&!n&&!o&<(t),i=r||n||o||a,u=i?F(t.length,String):[],c=u.length;for(var s in t)!e&&!ft.call(t,s)||i&&("length"==s||o&&("offset"==s||"parent"==s)||a&&("buffer"==s||"byteLength"==s||"byteOffset"==s)||rt(s,c))||u.push(s);return u},pt=Object.prototype;var _t=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||pt)};var vt=function(t,e){return function(r){return t(e(r))}}(Object.keys,Object),ht=Object.prototype.hasOwnProperty;var yt=function(t){if(!_t(t))return vt(t);var e=[];for(var r in Object(t))ht.call(t,r)&&"constructor"!=r&&e.push(r);return e};var bt=function(t){return null!=t&&ot(t.length)&&!m(t)};var gt=function(t){return bt(t)?dt(t):yt(t)};var Et=function(t,e){return t&&M(t,e,gt)};var Ot=function(){this.__data__=[],this.size=0};var Tt=function(t,e){return t===e||t!=t&&e!=e};var It=function(t,e){for(var r=t.length;r--;)if(Tt(t[r][0],e))return r;return-1},Nt=Array.prototype.splice;var mt=function(t){var e=this.__data__,r=It(e,t);return!(r<0)&&(r==e.length-1?e.pop():Nt.call(e,r,1),--this.size,!0)};var At=function(t){var e=this.__data__,r=It(e,t);return r<0?void 0:e[r][1]};var jt=function(t){return It(this.__data__,t)>-1};var Rt=function(t,e){var r=this.__data__,n=It(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this};function Pt(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])}}Pt.prototype.clear=Ot,Pt.prototype.delete=mt,Pt.prototype.get=At,Pt.prototype.has=jt,Pt.prototype.set=Rt;var wt=Pt;var Dt=function(){this.__data__=new wt,this.size=0};var St=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r};var Ct=function(t){return this.__data__.get(t)};var Lt=function(t){return this.__data__.has(t)},Ut=$(i,"Map"),kt=$(Object,"create");var Bt=function(){this.__data__=kt?kt(null):{},this.size=0};var zt=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},$t="__lodash_hash_undefined__",xt=Object.prototype.hasOwnProperty;var Wt=function(t){var e=this.__data__;if(kt){var r=e[t];return r===$t?void 0:r}return xt.call(e,t)?e[t]:void 0},Mt=Object.prototype.hasOwnProperty;var Ft=function(t){var e=this.__data__;return kt?void 0!==e[t]:Mt.call(e,t)},Gt="__lodash_hash_undefined__";var Vt=function(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=kt&&void 0===e?Gt:e,this};function Yt(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])}}Yt.prototype.clear=Bt,Yt.prototype.delete=zt,Yt.prototype.get=Wt,Yt.prototype.has=Ft,Yt.prototype.set=Vt;var Kt=Yt;var Ht=function(){this.size=0,this.__data__={hash:new Kt,map:new(Ut||wt),string:new Kt}};var Jt=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t};var Zt=function(t,e){var r=t.__data__;return Jt(e)?r["string"==typeof e?"string":"hash"]:r.map};var qt=function(t){var e=Zt(this,t).delete(t);return this.size-=e?1:0,e};var Xt=function(t){return Zt(this,t).get(t)};var Qt=function(t){return Zt(this,t).has(t)};var te=function(t,e){var r=Zt(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this};function ee(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])}}ee.prototype.clear=Ht,ee.prototype.delete=qt,ee.prototype.get=Xt,ee.prototype.has=Qt,ee.prototype.set=te;var re=ee,ne=200;var oe=function(t,e){var r=this.__data__;if(r instanceof wt){var n=r.__data__;if(!Ut||n.length<ne-1)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new re(n)}return r.set(t,e),this.size=r.size,this};function ae(t){var e=this.__data__=new wt(t);this.size=e.size}ae.prototype.clear=Dt,ae.prototype.delete=St,ae.prototype.get=Ct,ae.prototype.has=Lt,ae.prototype.set=oe;var ie=ae,ue="__lodash_hash_undefined__";var ce=function(t){return this.__data__.set(t,ue),this};var se=function(t){return this.__data__.has(t)};function le(t){var e=-1,r=null==t?0:t.length;for(this.__data__=new re;++e<r;)this.add(t[e])}le.prototype.add=le.prototype.push=ce,le.prototype.has=se;var fe=le;var de=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 pe=function(t,e){return t.has(e)},_e=1,ve=2;var he=function(t,e,r,n,o,a){var i=r&_e,u=t.length,c=e.length;if(u!=c&&!(i&&c>u))return!1;var s=a.get(t);if(s&&a.get(e))return s==e;var l=-1,f=!0,d=r&ve?new fe:void 0;for(a.set(t,e),a.set(e,t);++l<u;){var p=t[l],_=e[l];if(n)var v=i?n(_,p,l,e,t,a):n(p,_,l,t,e,a);if(void 0!==v){if(v)continue;f=!1;break}if(d){if(!de(e,(function(t,e){if(!pe(d,e)&&(p===t||o(p,t,r,n,a)))return d.push(e)}))){f=!1;break}}else if(p!==_&&!o(p,_,r,n,a)){f=!1;break}}return a.delete(t),a.delete(e),f},ye=i.Uint8Array;var be=function(t){var e=-1,r=Array(t.size);return t.forEach((function(t,n){r[++e]=[n,t]})),r};var ge=function(t){var e=-1,r=Array(t.size);return t.forEach((function(t){r[++e]=t})),r},Ee=1,Oe=2,Te="[object Boolean]",Ie="[object Date]",Ne="[object Error]",me="[object Map]",Ae="[object Number]",je="[object RegExp]",Re="[object Set]",Pe="[object String]",we="[object Symbol]",De="[object ArrayBuffer]",Se="[object DataView]",Ce=u?u.prototype:void 0,Le=Ce?Ce.valueOf:void 0;var Ue=function(t,e,r,n,o,a,i){switch(r){case Se:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case De:return!(t.byteLength!=e.byteLength||!a(new ye(t),new ye(e)));case Te:case Ie:case Ae:return Tt(+t,+e);case Ne:return t.name==e.name&&t.message==e.message;case je:case Pe:return t==e+"";case me:var u=be;case Re:var c=n&Ee;if(u||(u=ge),t.size!=e.size&&!c)return!1;var s=i.get(t);if(s)return s==e;n|=Oe,i.set(t,e);var l=he(u(t),u(e),n,o,a,i);return i.delete(t),l;case we:if(Le)return Le.call(t)==Le.call(e)}return!1};var ke=function(t,e){for(var r=-1,n=e.length,o=t.length;++r<n;)t[o+r]=e[r];return t};var Be=function(t,e,r){var n=e(t);return q(t)?n:ke(n,r(t))};var ze=function(t,e){for(var r=-1,n=null==t?0:t.length,o=0,a=[];++r<n;){var i=t[r];e(i,r,t)&&(a[o++]=i)}return a};var $e=function(){return[]},xe=Object.prototype.propertyIsEnumerable,We=Object.getOwnPropertySymbols,Me=We?function(t){return null==t?[]:(t=Object(t),ze(We(t),(function(e){return xe.call(t,e)})))}:$e;var Fe=function(t){return Be(t,gt,Me)},Ge=1,Ve=Object.prototype.hasOwnProperty;var Ye=function(t,e,r,n,o,a){var i=r&Ge,u=Fe(t),c=u.length;if(c!=Fe(e).length&&!i)return!1;for(var s=c;s--;){var l=u[s];if(!(i?l in e:Ve.call(e,l)))return!1}var f=a.get(t);if(f&&a.get(e))return f==e;var d=!0;a.set(t,e),a.set(e,t);for(var p=i;++s<c;){var _=t[l=u[s]],v=e[l];if(n)var h=i?n(v,_,l,e,t,a):n(_,v,l,t,e,a);if(!(void 0===h?_===v||o(_,v,r,n,a):h)){d=!1;break}p||(p="constructor"==l)}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 a.delete(t),a.delete(e),d},Ke=$(i,"DataView"),He=$(i,"Promise"),Je=$(i,"Set"),Ze=$(i,"WeakMap"),qe=w(Ke),Xe=w(Ut),Qe=w(He),tr=w(Je),er=w(Ze),rr=b;(Ke&&"[object DataView]"!=rr(new Ke(new ArrayBuffer(1)))||Ut&&"[object Map]"!=rr(new Ut)||He&&"[object Promise]"!=rr(He.resolve())||Je&&"[object Set]"!=rr(new Je)||Ze&&"[object WeakMap]"!=rr(new Ze))&&(rr=function(t){var e=b(t),r="[object Object]"==e?t.constructor:void 0,n=r?w(r):"";if(n)switch(n){case qe:return"[object DataView]";case Xe:return"[object Map]";case Qe:return"[object Promise]";case tr:return"[object Set]";case er:return"[object WeakMap]"}return e});var nr=rr,or=1,ar="[object Arguments]",ir="[object Array]",ur="[object Object]",cr=Object.prototype.hasOwnProperty;var sr=function(t,e,r,n,o,a){var i=q(t),u=q(e),c=i?ir:nr(t),s=u?ir:nr(e),l=(c=c==ar?ur:c)==ur,f=(s=s==ar?ur:s)==ur,d=c==s;if(d&&Q(t)){if(!Q(e))return!1;i=!0,l=!1}if(d&&!l)return a||(a=new ie),i||lt(t)?he(t,e,r,n,o,a):Ue(t,e,c,r,n,o,a);if(!(r&or)){var p=l&&cr.call(t,"__wrapped__"),_=f&&cr.call(e,"__wrapped__");if(p||_){var v=p?t.value():t,h=_?e.value():e;return a||(a=new ie),o(v,h,r,n,a)}}return!!d&&(a||(a=new ie),Ye(t,e,r,n,o,a))};var lr=function t(e,r,n,o,a){return e===r||(null==e||null==r||!G(e)&&!G(r)?e!=e&&r!=r:sr(e,r,n,o,t,a))},fr=1,dr=2;var pr=function(t,e,r,n){var o=r.length,a=o,i=!n;if(null==t)return!a;for(t=Object(t);o--;){var u=r[o];if(i&&u[2]?u[1]!==t[u[0]]:!(u[0]in t))return!1}for(;++o<a;){var c=(u=r[o])[0],s=t[c],l=u[1];if(i&&u[2]){if(void 0===s&&!(c in t))return!1}else{var f=new ie;if(n)var d=n(s,l,c,t,e,f);if(!(void 0===d?lr(l,s,fr|dr,n,f):d))return!1}}return!0};var _r=function(t){return t==t&&!g(t)};var vr=function(t){for(var e=gt(t),r=e.length;r--;){var n=e[r],o=t[n];e[r]=[n,o,_r(o)]}return e};var hr=function(t,e){return function(r){return null!=r&&(r[t]===e&&(void 0!==e||t in Object(r)))}};var yr=function(t){var e=vr(t);return 1==e.length&&e[0][2]?hr(e[0][0],e[0][1]):function(r){return r===t||pr(r,t,e)}},br="[object Symbol]";var gr=function(t){return"symbol"==typeof t||G(t)&&b(t)==br},Er=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Or=/^\w*$/;var Tr=function(t,e){if(q(t))return!1;var r=typeof t;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=t&&!gr(t))||(Or.test(t)||!Er.test(t)||null!=e&&t in Object(e))},Ir="Expected a function";function Nr(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError(Ir);var r=function(){var n=arguments,o=e?e.apply(this,n):n[0],a=r.cache;if(a.has(o))return a.get(o);var i=t.apply(this,n);return r.cache=a.set(o,i)||a,i};return r.cache=new(Nr.Cache||re),r}Nr.Cache=re;var mr=Nr,Ar=500;var jr=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Rr=/\\(\\)?/g,Pr=function(t){var e=mr(t,(function(t){return r.size===Ar&&r.clear(),t})),r=e.cache;return e}((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(jr,(function(t,r,n,o){e.push(n?o.replace(Rr,"$1"):r||t)})),e}));var wr=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},Dr=1/0,Sr=u?u.prototype:void 0,Cr=Sr?Sr.toString:void 0;var Lr=function t(e){if("string"==typeof e)return e;if(q(e))return wr(e,t)+"";if(gr(e))return Cr?Cr.call(e):"";var r=e+"";return"0"==r&&1/e==-Dr?"-0":r};var Ur=function(t){return null==t?"":Lr(t)};var kr=function(t,e){return q(t)?t:Tr(t,e)?[t]:Pr(Ur(t))},Br=1/0;var zr=function(t){if("string"==typeof t||gr(t))return t;var e=t+"";return"0"==e&&1/t==-Br?"-0":e};var $r=function(t,e){for(var r=0,n=(e=kr(e,t)).length;null!=t&&r<n;)t=t[zr(e[r++])];return r&&r==n?t:void 0};var xr=function(t,e,r){var n=null==t?void 0:$r(t,e);return void 0===n?r:n};var Wr=function(t,e){return null!=t&&e in Object(t)};var Mr=function(t,e,r){for(var n=-1,o=(e=kr(e,t)).length,a=!1;++n<o;){var i=zr(e[n]);if(!(a=null!=t&&r(t,i)))break;t=t[i]}return a||++n!=o?a:!!(o=null==t?0:t.length)&&ot(o)&&rt(i,o)&&(q(t)||Z(t))};var Fr=function(t,e){return null!=t&&Mr(t,e,Wr)},Gr=1,Vr=2;var Yr=function(t,e){return Tr(t)&&_r(e)?hr(zr(t),e):function(r){var n=xr(r,t);return void 0===n&&n===e?Fr(r,t):lr(e,n,Gr|Vr)}};var Kr=function(t){return t};var Hr=function(t){return function(e){return null==e?void 0:e[t]}};var Jr=function(t){return function(e){return $r(e,t)}};var Zr=function(t){return Tr(t)?Hr(zr(t)):Jr(t)};var qr=function(t){return"function"==typeof t?t:null==t?Kr:"object"==typeof t?q(t)?Yr(t[0],t[1]):yr(t):Zr(t)};var Xr=function(t,e){var r={};return e=qr(e),Et(t,(function(t,n,o){W(r,n,e(t,n,o))})),r},Qr={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 tn=["Webkit","ms","Moz","O"];Object.keys(Qr).forEach((function(t){tn.forEach((function(e){Qr[function(t,e){return t+e.charAt(0).toUpperCase()+e.substring(1)}(e,t)]=Qr[t]}))}));var en={isUnitlessNumber:Qr,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}}};const rn=t=>{const{padding:e,margin:r,...n}=t.css;let o={};return e&&(o={paddingRight:e,paddingLeft:e,paddingBottom:e,paddingTop:e}),r&&(o={...o,marginRight:r,marginLeft:r,marginBottom:r,marginTop:r}),{...t,css:{...o,...n}}},nn=e=>{const r=e.css,n={};return Object.entries(r).forEach(([e,r])=>{if(t(r))return en.isUnitlessNumber[e]?void(n[e]=`${r}`):void(n[e]=`${r}px`);n[e]=r}),{...e,css:n}},on=t=>Xr(t,t=>{let e=t;return"Typography"===e.type&&(e=(t=>{const e=xr(t,"data.custom.variant","P");return{...t,type:e}})(e)),e.css&&"flexBasis"in e.css&&(e=(t=>{const{flexBasis:e}=t.css;return"0"===e||"0px"===e?{...t,css:{...t.css,flexBasis:"0%"}}:t})(e)),e.css&&(e=rn(e),e=nn(e)),e}),an=t=>`candu.sdk.${t}`,un=t=>an(`error.${t}`),cn={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"},sn={HEARTBEAT:an("heartbeat"),PREVIEW_OPEN:an("preview.open"),PORTAL:an("portal"),TUTORIAL:an("tutorial"),TUTORIAL_INTERACTION:an("tutorial.interaction"),PORTAL_ASSET_NOT_FOUND:un("portal_asset_not_found"),PORTAL_NO_SEGMENT_IDS:un("portal_no_segment_ids"),NO_MATCHING_TUTORIALS:un("no_matching_tutorials"),NO_VALID_TUTORIAL_IDENTIFIER:un("no_valid_tutorial_identifier"),COMMIT_API_LOADING_ERROR:un("commit_api"),TUTORIAL_LOADING_ERROR:un("tutorial"),UNKOWN_NODE_TYPE:un(cn.UNKOWN_NODE_TYPE),UNKOWN_INLINE_NODE_TYPE:un(cn.UNKOWN_INLINE_NODE_TYPE),UNKOWN_NODE_OBJECT_TYPE:un(cn.UNKOWN_NODE_OBJECT_TYPE),CIRCULAR_DEPENDENCY_EMBED_PORTAL:un("circular_dependecy_embed_portal"),CIRCULAR_DEPENDENCY_EMBED_TUTORIAL:un("circular_dependecy_embed_tutorial")},ln=t=>`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}.`,fn={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",[sn.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",[sn.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",[sn.NO_MATCHING_TUTORIALS]:"The Tutorial will not be rendered because there are no matching segments for the given user.",[sn.NO_VALID_TUTORIAL_IDENTIFIER]:"(Candu/Tutorial) You must define one of tutorialId, slug, commitId or contentHashId.",[sn.TUTORIAL_LOADING_ERROR]:"An error has occurred while trying to load the Tutorial",[sn.UNKOWN_INLINE_NODE_TYPE]:ln(cn.UNKOWN_INLINE_NODE_TYPE),[sn.UNKOWN_NODE_TYPE]:ln(cn.UNKOWN_NODE_TYPE),[sn.CIRCULAR_DEPENDENCY_EMBED_PORTAL]:"Circular dependency found on Embeded Portal. Please take a look at the Portal Content.",[sn.CIRCULAR_DEPENDENCY_EMBED_TUTORIAL]:"Circular dependency found on Embeded Tutorial. Please take a look at the Tutorial Content."},dn={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},pn={error:console.error,warning:console.warn},_n=({identify:t,track:e})=>({provider:({userId:r,traits:n,styleguide:o})=>{t(r,n),e(sn.HEARTBEAT,(t=>{const e={};return Object.keys(t).forEach(r=>{dn[r]&&(e[`styleguide.${r}`]=t[r].displayName||!0)}),e})(o))},tutorialDocumentLoadingError:({tutorialId:t,slug:r,contentHashId:n})=>{pn.error(fn[sn.TUTORIAL_LOADING_ERROR]),e(sn.TUTORIAL_LOADING_ERROR,{tutorialId:t,slug:r,contentHashId:n})}});for(var vn=function(){return e.randomBytes(16)},hn=[],yn=0;yn<256;++yn)hn[yn]=(yn+256).toString(16).substr(1);var bn,gn,En=function(t,e){var r=e||0,n=hn;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("")},On=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||vn)();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,e)for(var a=0;a<16;++a)e[n+a]=o[a];return e||En(o)};Object.freeze({__proto__:null,API_BASE_URL:"https://api.candu.ai",VERSION:"0.5.0"});!function(t){t.UserGenerated="UserGenerated",t.SDK="SDK"}(bn||(bn={})),function(t){t.Identify="Identify",t.Group="Group",t.Track="Track",t.Page="Page",t.Screen="Screen"}(gn||(gn={}));const Tn=()=>"undefined"!=typeof window&&window.localStorage,In=t=>e=>{Tn()&&null!=e&&window.localStorage.setItem(t,JSON.stringify(e))};const Nn={anonymousId:{getOrCreate:((t,e)=>()=>(t=>()=>{if(Tn()){const t=window.localStorage.getItem("candu:anonymous_id");if(t)try{return JSON.parse(t)}catch(t){return null}}})()()||(()=>{const t=On();return In("candu:anonymous_id")(t),t})())(),set:In("candu:anonymous_id")}}.anonymousId.getOrCreate;var mn="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},An="object"==typeof mn&&mn&&mn.Object===Object&&mn,jn="object"==typeof self&&self&&self.Object===Object&&self,Rn=(An||jn||Function("return this")()).Symbol,Pn=Object.prototype,wn=Pn.hasOwnProperty,Dn=Pn.toString,Sn=Rn?Rn.toStringTag:void 0,Cn=Object.prototype.toString,Ln=Rn?Rn.toStringTag:void 0,Un=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":Ln&&Ln in Object(t)?function(t){var e=wn.call(t,Sn),r=t[Sn];try{t[Sn]=void 0;var n=!0}catch(t){}var o=Dn.call(t);return n&&(e?t[Sn]=r:delete t[Sn]),o}(t):function(t){return Cn.call(t)}(t)},kn=Array.isArray,Bn=function(t){return null!=t&&"object"==typeof t},zn=function(t){return"string"==typeof t||!kn(t)&&Bn(t)&&"[object String]"==Un(t)};const $n=/^([a-zA-Z0-9]|_|-)+$/,xn=t=>(function(t){return"number"==typeof t||Bn(t)&&"[object Number]"==Un(t)})(t)&&t>=0;var Wn,Mn,Fn,Gn,Vn,Yn;!function(t){t.SDK="SDK",t.PREVIEW="PREVIEW"}(Wn||(Wn={})),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"}(Mn||(Mn={})),(Fn||(Fn={})).ON_CLICK="OnClick",function(t){t.NATIVE="Native",t.PENDO="Pendo"}(Gn||(Gn={})),function(t){t.NAVIGATE="Navigate",t.CHANGE_TUTORIAL="ChangeTutorial",t.OPEN_GUIDE="OpenGuide"}(Vn||(Vn={})),function(t){t.PRIMARY="primary",t.SECONDARY="primary",t.WARNING="warning",t.DANGER="danger",t.NEUTRAL="neutral",t.ACTIVE="active",t.INFO="info"}(Yn||(Yn={}));Yn.PRIMARY;var Kn;!function(t){t.U="U",t.B="B",t.Em="Em",t.InlineCode="InlineCode"}(Kn||(Kn={}));const Hn=t=>(t=>zn(t)&&t.length>=3&&t.length<100&&$n.test(t))(t);var Jn,Zn,qn,Xn;Object.freeze({__proto__:null,PREVIEW_SCRIPT_URL:"https://app.candu.ai/preview.html"});!function(t){t.COLLAPSED="Collapsed",t.EXPANDED="Expanded",t.MINIMIZED="Minimized"}(Jn||(Jn={})),function(t){t.TUTORIAL="Tutorial",t.PORTAL="Portal"}(Zn||(Zn={})),function(t){t.Global="Global",t.Organization="Organization"}(qn||(qn={})),function(t){t.Root="root",t.Rule="rule",t.Atrule="atrule",t.Decl="decl",t.Any="any"}(Xn||(Xn={}));var Qn=function(t,e,r,n,o,a,i,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,a,i,u],l=0;(c=new Error(e.replace(/%s/g,(function(){return s[l++]})))).name="Invariant Violation"}throw c.framesToPop=1,c}};const to=t=>Qn(!t||g(t),"(Candu) styleguide must be undefined or an object"),eo=({clientToken:t,userId:e,traits:r,options:n,styleguide:o,...a})=>(Qn((t=>zn(t)&&!!t.match(/^[0-9a-zA-Z]*$/)&&t.length>=10)(t),"(Candu) you must provide a valid clientToken"),Qn(!e||(t=>xn(t)||zn(t)&&t.trim().length>0)(e),"(Candu) you must provide a valid userId"),to(o),Qn(!r||g(r),"(Candu) traits must be undefined or an object"),Qn(!n||g(n),"(Candu) options must be undefined or an object"),{...a,clientToken:t,traits:r||{},options:n||{},styleguide:o||{},userId:e||Nn()}),ro=({slug:t,styleguide:e,contentHashId:r,tutorialId:n,tutorialDocument:o,...a})=>(to(e),{...a,slug:t,styleguide:e||{},contentHashId:r,tutorialId:n,tutorialDocument:o}),no=({slug:t,styleguide:e})=>(to(e),{slug:t,styleguide:e||{}});var oo=Object.freeze({__proto__:null,API_BASE_URL:"https://api.candu.ai",CDN_BASE_URL:"https://cdn.candu.ai",VERSION:"0.5.0"});const{API_BASE_URL:ao}=oo,{CDN_BASE_URL:io}=oo,uo="/api/segmentMemberships",co="/api/tutorialDocumentsEditor",so=async t=>(await fetch(t)).json(),lo=t=>so(`${ao}${t}`),fo=t=>so(`${io}${t}`),po={tutorialDocumentLatestPublished:async(t,e)=>lo(`${co}?token=${t}&finder=latestPublished&tutorialId=${e}`),portalAsset:async(t,e)=>fo(`/portals/${t}/${e}/head.json`),segmentMembership:async(t,e)=>lo(`${uo}/${e}?token=${t}`),tutorialDocument:(t,e,r)=>{const{contentHashId:n,tutorialId:o,tutorialDocument:a,slug:i}=t,u=(t=>({byId:e=>lo(`${co}/${e}?token=${t}`),bySlug:e=>fo(`/tutorials/${t}/${e}.json`),byContentHash:e=>fo(`/tutorials/${t}/${e}.json`)}))(e);return(t=>xn(t))(o)?u.byId(o):Hn(i)?u.bySlug(i):(t=>zn(t)&&!!t.match(/^[0-9a-zA-Z]{40}$/))(n)?u.byContentHash(n):g(a)?Promise.resolve(a):(pn.error(fn[sn.NO_VALID_TUTORIAL_IDENTIFIER]),r.track(sn.NO_VALID_TUTORIAL_IDENTIFIER,{slug:t.slug}),null)}},_o=(...t)=>console.error(...t),vo=(...t)=>console.warn(...t),ho={error:_o,warning:vo},yo=t=>{switch(t.trigger){case Fn.ON_CLICK:default:return"onClick"}},bo=({data:t},e)=>{if(!t||!t.actions)return{};const r=t=>{e.provider.eventing.track(sn.TUTORIAL_INTERACTION,{...t,...e.trackingIdentifiers||{}})};return t.actions.map(t=>((t,e)=>{switch(t.handler.type){case Vn.NAVIGATE:return{[yo(t)]:()=>{const{href:r,target:n}=t.handler;e(t),"Blank"===n?window.open(r,"_blank"):r&&r.includes("mailto:")?window.location=r:document.location.href=r}};case Vn.CHANGE_TUTORIAL:return{[yo(t)]:()=>{const{tutorialId:e}=t.handler;_o("TODO -> change tutorial",e)}};case Vn.OPEN_GUIDE:return{[yo(t)]:()=>{const{guideId:e}=t.handler;_o("TODO -> open guide",e)}};default:return{}}})(t,r)).reduce((t,e)=>({...t,...e}),{})},go=(t,e)=>{const{provider:r,document:n,trackingIdentifiers:o}=e,a=n.nodes[t];if(!a)return ho.error("Document is corrupted. Refusing to move further."),null;const i=t=>go(t,e),{type:u,props:c,css:s}=a,l={...c||{},style:s||{},children:(c||{}).children||a.nodes&&a.nodes.map(i),...bo(a,{trackingIdentifiers:o,provider:r})},f={nodeId:t,node:a,document:n,render:{node:i,styleguide:(t,r={})=>e.renderNode(t,{api:f,attributes:r}),tutorial:t=>e.renderTutorial(t),portal:t=>e.renderPortal(t)},trackingIdentifiers:o},d=f.render.styleguide(u,l);return d||(ho.error(fn[sn.UNKOWN_NODE_TYPE],{type:u}),r.eventing.track(sn.UNKOWN_NODE_TYPE,{type:u}),null)},Eo=mr((t,e)=>{const{provider:r,portal:n,tutorial:o}=t,a=r.styleguide;let i,u;return o&&(u=o.styleguide),n&&(i=n.styleguide),{...a||{},...i||{},...u||{},...e||{}}}),Oo="",To="#EDEDED",Io="#333745",No="#838792",mo="#FEFEFE",Ao="#FEFEFE",jo={primary:"#6310E5",secondary:"#59C3C3",tertiary:"#4D515D",warning:"#FCAD0D",danger:"#EE4266"},Ro=t=>{const e=document.createElement("link");e.setAttribute("rel","stylesheet"),e.setAttribute("href",`${io}/styleguides/applications/${t}/default/main.css`),document.head.appendChild(e)};export{To as DEFAULT_ALERT_COLOR,Oo as DEFAULT_ALT,mo as DEFAULT_TAB_ACTIVE_COLOR,Ao as DEFAULT_TAB_COLOR,Io as DEFAULT_TAB_HEADER_COLOR,No as DEFAULT_TAB_ITEM_COLOR,fn as ERROR_MESSAGES,cn as ERROR_SLUGS,sn as EVENT_NAMES,pn as LOGGER,po as RESOURCES,jo as STYLEGUIDE_COLORS,on as adaptCustomNodes,Ro as attachStylesheet,nn as convertStyleNumberValues,dn as defaultStyleguide,_n as internalEventing,_o as logError,vo as logWarning,ho as logger,go as mapNodeToStyleguide,Eo as mergeStyleguidesFromContext,no as portalValidation,eo as providerValidation,ro as tutorialValidation,rn as unpackShorthandStyles}; | ||
//# sourceMappingURL=index.es.js.map |
@@ -1,2 +0,2 @@ | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("util"),require("crypto")):"function"==typeof define&&define.amd?define(["exports","util","crypto"],e):e((t=t||self)["@candulabs/core"]={},t.util,t.e)}(this,(function(t,e,r){"use strict";r=r&&r.hasOwnProperty("default")?r.default:r;var n="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function o(t,e){return t(e={exports:{}},e.exports),e.exports}var a="object"==typeof n&&n&&n.Object===Object&&n,i="object"==typeof self&&self&&self.Object===Object&&self,u=a||i||Function("return this")(),c=u.Symbol,l=Object.prototype,s=l.hasOwnProperty,d=l.toString,f=c?c.toStringTag:void 0;var p=function(t){var e=s.call(t,f),r=t[f];try{t[f]=void 0;var n=!0}catch(t){}var o=d.call(t);return n&&(e?t[f]=r:delete t[f]),o},_=Object.prototype.toString;var v=function(t){return _.call(t)},h="[object Null]",y="[object Undefined]",b=c?c.toStringTag:void 0;var E=function(t){return null==t?void 0===t?y:h:b&&b in Object(t)?p(t):v(t)};var g=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)},O="[object AsyncFunction]",T="[object Function]",I="[object GeneratorFunction]",N="[object Proxy]";var A,m=function(t){if(!g(t))return!1;var e=E(t);return e==T||e==I||e==O||e==N},j=u["__core-js_shared__"],R=(A=/[^.]+$/.exec(j&&j.keys&&j.keys.IE_PROTO||""))?"Symbol(src)_1."+A:"";var S=function(t){return!!R&&R in t},D=Function.prototype.toString;var L=function(t){if(null!=t){try{return D.call(t)}catch(t){}try{return t+""}catch(t){}}return""},P=/^\[object .+?Constructor\]$/,w=Function.prototype,C=Object.prototype,U=w.toString,k=C.hasOwnProperty,B=RegExp("^"+U.call(k).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var x=function(t){return!(!g(t)||S(t))&&(m(t)?B:P).test(L(t))};var z=function(t,e){return null==t?void 0:t[e]};var M=function(t,e){var r=z(t,e);return x(r)?r:void 0},$=function(){try{var t=M(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();var W=function(t,e,r){"__proto__"==e&&$?$(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r};var F=function(t){return function(e,r,n){for(var o=-1,a=Object(e),i=n(e),u=i.length;u--;){var c=i[t?u:++o];if(!1===r(a[c],c,a))break}return e}}();var V=function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n};var G=function(t){return null!=t&&"object"==typeof t},Y="[object Arguments]";var H=function(t){return G(t)&&E(t)==Y},K=Object.prototype,q=K.hasOwnProperty,J=K.propertyIsEnumerable,Z=H(function(){return arguments}())?H:function(t){return G(t)&&q.call(t,"callee")&&!J.call(t,"callee")},X=Array.isArray;var Q=function(){return!1},tt=o((function(t,e){var r=e&&!e.nodeType&&e,n=r&&t&&!t.nodeType&&t,o=n&&n.exports===r?u.Buffer:void 0,a=(o?o.isBuffer:void 0)||Q;t.exports=a})),et=9007199254740991,rt=/^(?:0|[1-9]\d*)$/;var nt=function(t,e){var r=typeof t;return!!(e=null==e?et:e)&&("number"==r||"symbol"!=r&&rt.test(t))&&t>-1&&t%1==0&&t<e},ot=9007199254740991;var at=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=ot},it={};it["[object Float32Array]"]=it["[object Float64Array]"]=it["[object Int8Array]"]=it["[object Int16Array]"]=it["[object Int32Array]"]=it["[object Uint8Array]"]=it["[object Uint8ClampedArray]"]=it["[object Uint16Array]"]=it["[object Uint32Array]"]=!0,it["[object Arguments]"]=it["[object Array]"]=it["[object ArrayBuffer]"]=it["[object Boolean]"]=it["[object DataView]"]=it["[object Date]"]=it["[object Error]"]=it["[object Function]"]=it["[object Map]"]=it["[object Number]"]=it["[object Object]"]=it["[object RegExp]"]=it["[object Set]"]=it["[object String]"]=it["[object WeakMap]"]=!1;var ut=function(t){return G(t)&&at(t.length)&&!!it[E(t)]};var ct=function(t){return function(e){return t(e)}},lt=o((function(t,e){var r=e&&!e.nodeType&&e,n=r&&t&&!t.nodeType&&t,o=n&&n.exports===r&&a.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})),st=lt&<.isTypedArray,dt=st?ct(st):ut,ft=Object.prototype.hasOwnProperty;var pt=function(t,e){var r=X(t),n=!r&&Z(t),o=!r&&!n&&tt(t),a=!r&&!n&&!o&&dt(t),i=r||n||o||a,u=i?V(t.length,String):[],c=u.length;for(var l in t)!e&&!ft.call(t,l)||i&&("length"==l||o&&("offset"==l||"parent"==l)||a&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||nt(l,c))||u.push(l);return u},_t=Object.prototype;var vt=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||_t)};var ht=function(t,e){return function(r){return t(e(r))}}(Object.keys,Object),yt=Object.prototype.hasOwnProperty;var bt=function(t){if(!vt(t))return ht(t);var e=[];for(var r in Object(t))yt.call(t,r)&&"constructor"!=r&&e.push(r);return e};var Et=function(t){return null!=t&&at(t.length)&&!m(t)};var gt=function(t){return Et(t)?pt(t):bt(t)};var Ot=function(t,e){return t&&F(t,e,gt)};var Tt=function(){this.__data__=[],this.size=0};var It=function(t,e){return t===e||t!=t&&e!=e};var Nt=function(t,e){for(var r=t.length;r--;)if(It(t[r][0],e))return r;return-1},At=Array.prototype.splice;var mt=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 jt=function(t){var e=this.__data__,r=Nt(e,t);return r<0?void 0:e[r][1]};var Rt=function(t){return Nt(this.__data__,t)>-1};var St=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 Dt(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])}}Dt.prototype.clear=Tt,Dt.prototype.delete=mt,Dt.prototype.get=jt,Dt.prototype.has=Rt,Dt.prototype.set=St;var Lt=Dt;var Pt=function(){this.__data__=new Lt,this.size=0};var wt=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r};var Ct=function(t){return this.__data__.get(t)};var Ut=function(t){return this.__data__.has(t)},kt=M(u,"Map"),Bt=M(Object,"create");var xt=function(){this.__data__=Bt?Bt(null):{},this.size=0};var zt=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},Mt="__lodash_hash_undefined__",$t=Object.prototype.hasOwnProperty;var Wt=function(t){var e=this.__data__;if(Bt){var r=e[t];return r===Mt?void 0:r}return $t.call(e,t)?e[t]:void 0},Ft=Object.prototype.hasOwnProperty;var Vt=function(t){var e=this.__data__;return Bt?void 0!==e[t]:Ft.call(e,t)},Gt="__lodash_hash_undefined__";var Yt=function(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=Bt&&void 0===e?Gt:e,this};function Ht(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])}}Ht.prototype.clear=xt,Ht.prototype.delete=zt,Ht.prototype.get=Wt,Ht.prototype.has=Vt,Ht.prototype.set=Yt;var Kt=Ht;var qt=function(){this.size=0,this.__data__={hash:new Kt,map:new(kt||Lt),string:new Kt}};var Jt=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t};var Zt=function(t,e){var r=t.__data__;return Jt(e)?r["string"==typeof e?"string":"hash"]:r.map};var Xt=function(t){var e=Zt(this,t).delete(t);return this.size-=e?1:0,e};var Qt=function(t){return Zt(this,t).get(t)};var te=function(t){return Zt(this,t).has(t)};var ee=function(t,e){var r=Zt(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this};function re(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])}}re.prototype.clear=qt,re.prototype.delete=Xt,re.prototype.get=Qt,re.prototype.has=te,re.prototype.set=ee;var ne=re,oe=200;var ae=function(t,e){var r=this.__data__;if(r instanceof Lt){var n=r.__data__;if(!kt||n.length<oe-1)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new ne(n)}return r.set(t,e),this.size=r.size,this};function ie(t){var e=this.__data__=new Lt(t);this.size=e.size}ie.prototype.clear=Pt,ie.prototype.delete=wt,ie.prototype.get=Ct,ie.prototype.has=Ut,ie.prototype.set=ae;var ue=ie,ce="__lodash_hash_undefined__";var le=function(t){return this.__data__.set(t,ce),this};var se=function(t){return this.__data__.has(t)};function de(t){var e=-1,r=null==t?0:t.length;for(this.__data__=new ne;++e<r;)this.add(t[e])}de.prototype.add=de.prototype.push=le,de.prototype.has=se;var fe=de;var pe=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 _e=function(t,e){return t.has(e)},ve=1,he=2;var ye=function(t,e,r,n,o,a){var i=r&ve,u=t.length,c=e.length;if(u!=c&&!(i&&c>u))return!1;var l=a.get(t);if(l&&a.get(e))return l==e;var s=-1,d=!0,f=r&he?new fe:void 0;for(a.set(t,e),a.set(e,t);++s<u;){var p=t[s],_=e[s];if(n)var v=i?n(_,p,s,e,t,a):n(p,_,s,t,e,a);if(void 0!==v){if(v)continue;d=!1;break}if(f){if(!pe(e,(function(t,e){if(!_e(f,e)&&(p===t||o(p,t,r,n,a)))return f.push(e)}))){d=!1;break}}else if(p!==_&&!o(p,_,r,n,a)){d=!1;break}}return a.delete(t),a.delete(e),d},be=u.Uint8Array;var Ee=function(t){var e=-1,r=Array(t.size);return t.forEach((function(t,n){r[++e]=[n,t]})),r};var ge=function(t){var e=-1,r=Array(t.size);return t.forEach((function(t){r[++e]=t})),r},Oe=1,Te=2,Ie="[object Boolean]",Ne="[object Date]",Ae="[object Error]",me="[object Map]",je="[object Number]",Re="[object RegExp]",Se="[object Set]",De="[object String]",Le="[object Symbol]",Pe="[object ArrayBuffer]",we="[object DataView]",Ce=c?c.prototype:void 0,Ue=Ce?Ce.valueOf:void 0;var ke=function(t,e,r,n,o,a,i){switch(r){case we:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case Pe:return!(t.byteLength!=e.byteLength||!a(new be(t),new be(e)));case Ie:case Ne:case je:return It(+t,+e);case Ae:return t.name==e.name&&t.message==e.message;case Re:case De:return t==e+"";case me:var u=Ee;case Se:var c=n&Oe;if(u||(u=ge),t.size!=e.size&&!c)return!1;var l=i.get(t);if(l)return l==e;n|=Te,i.set(t,e);var s=ye(u(t),u(e),n,o,a,i);return i.delete(t),s;case Le:if(Ue)return Ue.call(t)==Ue.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 xe=function(t,e,r){var n=e(t);return X(t)?n:Be(n,r(t))};var ze=function(t,e){for(var r=-1,n=null==t?0:t.length,o=0,a=[];++r<n;){var i=t[r];e(i,r,t)&&(a[o++]=i)}return a};var Me=function(){return[]},$e=Object.prototype.propertyIsEnumerable,We=Object.getOwnPropertySymbols,Fe=We?function(t){return null==t?[]:(t=Object(t),ze(We(t),(function(e){return $e.call(t,e)})))}:Me;var Ve=function(t){return xe(t,gt,Fe)},Ge=1,Ye=Object.prototype.hasOwnProperty;var He=function(t,e,r,n,o,a){var i=r&Ge,u=Ve(t),c=u.length;if(c!=Ve(e).length&&!i)return!1;for(var l=c;l--;){var s=u[l];if(!(i?s in e:Ye.call(e,s)))return!1}var d=a.get(t);if(d&&a.get(e))return d==e;var f=!0;a.set(t,e),a.set(e,t);for(var p=i;++l<c;){var _=t[s=u[l]],v=e[s];if(n)var h=i?n(v,_,s,e,t,a):n(_,v,s,t,e,a);if(!(void 0===h?_===v||o(_,v,r,n,a):h)){f=!1;break}p||(p="constructor"==s)}if(f&&!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)&&(f=!1)}return a.delete(t),a.delete(e),f},Ke=M(u,"DataView"),qe=M(u,"Promise"),Je=M(u,"Set"),Ze=M(u,"WeakMap"),Xe=L(Ke),Qe=L(kt),tr=L(qe),er=L(Je),rr=L(Ze),nr=E;(Ke&&"[object DataView]"!=nr(new Ke(new ArrayBuffer(1)))||kt&&"[object Map]"!=nr(new kt)||qe&&"[object Promise]"!=nr(qe.resolve())||Je&&"[object Set]"!=nr(new Je)||Ze&&"[object WeakMap]"!=nr(new Ze))&&(nr=function(t){var e=E(t),r="[object Object]"==e?t.constructor:void 0,n=r?L(r):"";if(n)switch(n){case Xe:return"[object DataView]";case Qe:return"[object Map]";case tr:return"[object Promise]";case er:return"[object Set]";case rr:return"[object WeakMap]"}return e});var or=nr,ar=1,ir="[object Arguments]",ur="[object Array]",cr="[object Object]",lr=Object.prototype.hasOwnProperty;var sr=function(t,e,r,n,o,a){var i=X(t),u=X(e),c=i?ur:or(t),l=u?ur:or(e),s=(c=c==ir?cr:c)==cr,d=(l=l==ir?cr:l)==cr,f=c==l;if(f&&tt(t)){if(!tt(e))return!1;i=!0,s=!1}if(f&&!s)return a||(a=new ue),i||dt(t)?ye(t,e,r,n,o,a):ke(t,e,c,r,n,o,a);if(!(r&ar)){var p=s&&lr.call(t,"__wrapped__"),_=d&&lr.call(e,"__wrapped__");if(p||_){var v=p?t.value():t,h=_?e.value():e;return a||(a=new ue),o(v,h,r,n,a)}}return!!f&&(a||(a=new ue),He(t,e,r,n,o,a))};var dr=function t(e,r,n,o,a){return e===r||(null==e||null==r||!G(e)&&!G(r)?e!=e&&r!=r:sr(e,r,n,o,t,a))},fr=1,pr=2;var _r=function(t,e,r,n){var o=r.length,a=o,i=!n;if(null==t)return!a;for(t=Object(t);o--;){var u=r[o];if(i&&u[2]?u[1]!==t[u[0]]:!(u[0]in t))return!1}for(;++o<a;){var c=(u=r[o])[0],l=t[c],s=u[1];if(i&&u[2]){if(void 0===l&&!(c in t))return!1}else{var d=new ue;if(n)var f=n(l,s,c,t,e,d);if(!(void 0===f?dr(s,l,fr|pr,n,d):f))return!1}}return!0};var vr=function(t){return t==t&&!g(t)};var hr=function(t){for(var e=gt(t),r=e.length;r--;){var n=e[r],o=t[n];e[r]=[n,o,vr(o)]}return e};var yr=function(t,e){return function(r){return null!=r&&(r[t]===e&&(void 0!==e||t in Object(r)))}};var br=function(t){var e=hr(t);return 1==e.length&&e[0][2]?yr(e[0][0],e[0][1]):function(r){return r===t||_r(r,t,e)}},Er="[object Symbol]";var gr=function(t){return"symbol"==typeof t||G(t)&&E(t)==Er},Or=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Tr=/^\w*$/;var Ir=function(t,e){if(X(t))return!1;var r=typeof t;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=t&&!gr(t))||(Tr.test(t)||!Or.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],a=r.cache;if(a.has(o))return a.get(o);var i=t.apply(this,n);return r.cache=a.set(o,i)||a,i};return r.cache=new(Ar.Cache||ne),r}Ar.Cache=ne;var mr=Ar,jr=500;var Rr=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Sr=/\\(\\)?/g,Dr=function(t){var e=mr(t,(function(t){return r.size===jr&&r.clear(),t})),r=e.cache;return e}((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(Rr,(function(t,r,n,o){e.push(n?o.replace(Sr,"$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},Pr=1/0,wr=c?c.prototype:void 0,Cr=wr?wr.toString:void 0;var Ur=function t(e){if("string"==typeof e)return e;if(X(e))return Lr(e,t)+"";if(gr(e))return Cr?Cr.call(e):"";var r=e+"";return"0"==r&&1/e==-Pr?"-0":r};var kr=function(t){return null==t?"":Ur(t)};var Br=function(t,e){return X(t)?t:Ir(t,e)?[t]:Dr(kr(t))},xr=1/0;var zr=function(t){if("string"==typeof t||gr(t))return t;var e=t+"";return"0"==e&&1/t==-xr?"-0":e};var Mr=function(t,e){for(var r=0,n=(e=Br(e,t)).length;null!=t&&r<n;)t=t[zr(e[r++])];return r&&r==n?t:void 0};var $r=function(t,e,r){var n=null==t?void 0:Mr(t,e);return void 0===n?r:n};var Wr=function(t,e){return null!=t&&e in Object(t)};var Fr=function(t,e,r){for(var n=-1,o=(e=Br(e,t)).length,a=!1;++n<o;){var i=zr(e[n]);if(!(a=null!=t&&r(t,i)))break;t=t[i]}return a||++n!=o?a:!!(o=null==t?0:t.length)&&at(o)&&nt(i,o)&&(X(t)||Z(t))};var Vr=function(t,e){return null!=t&&Fr(t,e,Wr)},Gr=1,Yr=2;var Hr=function(t,e){return Ir(t)&&vr(e)?yr(zr(t),e):function(r){var n=$r(r,t);return void 0===n&&n===e?Vr(r,t):dr(e,n,Gr|Yr)}};var Kr=function(t){return t};var qr=function(t){return function(e){return null==e?void 0:e[t]}};var Jr=function(t){return function(e){return Mr(e,t)}};var Zr=function(t){return Ir(t)?qr(zr(t)):Jr(t)};var Xr=function(t){return"function"==typeof t?t:null==t?Kr:"object"==typeof t?X(t)?Hr(t[0],t[1]):br(t):Zr(t)};var Qr=function(t,e){var r={};return e=Xr(e),Ot(t,(function(t,n,o){W(r,n,e(t,n,o))})),r},tn={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 en=["Webkit","ms","Moz","O"];Object.keys(tn).forEach((function(t){en.forEach((function(e){tn[function(t,e){return t+e.charAt(0).toUpperCase()+e.substring(1)}(e,t)]=tn[t]}))}));var rn={isUnitlessNumber:tn,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}}};const nn=t=>{const{padding:e,margin:r,...n}=t.css;let o={};return e&&(o={paddingRight:e,paddingLeft:e,paddingBottom:e,paddingTop:e}),r&&(o={...o,marginRight:r,marginLeft:r,marginBottom:r,marginTop:r}),{...t,css:{...o,...n}}},on=t=>{const r=t.css,n={};return Object.entries(r).forEach(([t,r])=>{if(e.isNumber(r))return rn.isUnitlessNumber[t]?void(n[t]=`${r}`):void(n[t]=`${r}px`);n[t]=r}),{...t,css:n}},an=t=>`candu.sdk.${t}`,un=t=>an(`error.${t}`),cn={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"},ln={HEARTBEAT:an("heartbeat"),PREVIEW_OPEN:an("preview.open"),PORTAL:an("portal"),TUTORIAL:an("tutorial"),TUTORIAL_INTERACTION:an("tutorial.interaction"),PORTAL_ASSET_NOT_FOUND:un("portal_asset_not_found"),PORTAL_NO_SEGMENT_IDS:un("portal_no_segment_ids"),NO_MATCHING_TUTORIALS:un("no_matching_tutorials"),NO_VALID_TUTORIAL_IDENTIFIER:un("no_valid_tutorial_identifier"),COMMIT_API_LOADING_ERROR:un("commit_api"),TUTORIAL_LOADING_ERROR:un("tutorial"),UNKOWN_NODE_TYPE:un(cn.UNKOWN_NODE_TYPE),UNKOWN_INLINE_NODE_TYPE:un(cn.UNKOWN_INLINE_NODE_TYPE),UNKOWN_NODE_OBJECT_TYPE:un(cn.UNKOWN_NODE_OBJECT_TYPE),CIRCULAR_DEPENDENCY_EMBED_PORTAL:un("circular_dependecy_embed_portal"),CIRCULAR_DEPENDENCY_EMBED_TUTORIAL:un("circular_dependecy_embed_tutorial")},sn=t=>`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}.`,dn={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",[ln.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",[ln.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",[ln.NO_MATCHING_TUTORIALS]:"The Tutorial will not be rendered because there are no matching segments for the given user.",[ln.NO_VALID_TUTORIAL_IDENTIFIER]:"(Candu/Tutorial) You must define one of tutorialId, slug, commitId or contentHashId.",[ln.TUTORIAL_LOADING_ERROR]:"An error has occurred while trying to load the Tutorial",[ln.UNKOWN_INLINE_NODE_TYPE]:sn(cn.UNKOWN_INLINE_NODE_TYPE),[ln.UNKOWN_NODE_TYPE]:sn(cn.UNKOWN_NODE_TYPE),[ln.CIRCULAR_DEPENDENCY_EMBED_PORTAL]:"Circular dependency found on Embeded Portal. Please take a look at the Portal Content.",[ln.CIRCULAR_DEPENDENCY_EMBED_TUTORIAL]:"Circular dependency found on Embeded Tutorial. Please take a look at the Tutorial Content."},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},pn={error:console.error,warning:console.warn};for(var _n=function(){return r.randomBytes(16)},vn=[],hn=0;hn<256;++hn)vn[hn]=(hn+256).toString(16).substr(1);var yn,bn,En=function(t,e){var r=e||0,n=vn;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("")},gn=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||_n)();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,e)for(var a=0;a<16;++a)e[n+a]=o[a];return e||En(o)};Object.freeze({__proto__:null,API_BASE_URL:"https://api.candu.ai",VERSION:"0.5.0-alpha.3"});!function(t){t.UserGenerated="UserGenerated",t.SDK="SDK"}(yn||(yn={})),function(t){t.Identify="Identify",t.Group="Group",t.Track="Track",t.Page="Page",t.Screen="Screen"}(bn||(bn={}));const On=()=>"undefined"!=typeof window&&window.localStorage,Tn=t=>e=>{On()&&null!=e&&window.localStorage.setItem(t,JSON.stringify(e))};const In={anonymousId:{getOrCreate:((t,e)=>()=>(t=>()=>{if(On()){const t=window.localStorage.getItem("candu:anonymous_id");if(t)try{return JSON.parse(t)}catch(t){return null}}})()()||(()=>{const t=gn();return Tn("candu:anonymous_id")(t),t})())(),set:Tn("candu:anonymous_id")}}.anonymousId.getOrCreate;var Nn="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},An="object"==typeof Nn&&Nn&&Nn.Object===Object&&Nn,mn="object"==typeof self&&self&&self.Object===Object&&self,jn=(An||mn||Function("return this")()).Symbol,Rn=Object.prototype,Sn=Rn.hasOwnProperty,Dn=Rn.toString,Ln=jn?jn.toStringTag:void 0,Pn=Object.prototype.toString,wn=jn?jn.toStringTag:void 0,Cn=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":wn&&wn in Object(t)?function(t){var e=Sn.call(t,Ln),r=t[Ln];try{t[Ln]=void 0;var n=!0}catch(t){}var o=Dn.call(t);return n&&(e?t[Ln]=r:delete t[Ln]),o}(t):function(t){return Pn.call(t)}(t)},Un=Array.isArray,kn=function(t){return null!=t&&"object"==typeof t},Bn=function(t){return"string"==typeof t||!Un(t)&&kn(t)&&"[object String]"==Cn(t)};const xn=/^([a-zA-Z0-9]|_|-)+$/,zn=t=>(function(t){return"number"==typeof t||kn(t)&&"[object Number]"==Cn(t)})(t)&&t>=0;var Mn,$n,Wn,Fn,Vn,Gn;!function(t){t.SDK="SDK",t.PREVIEW="PREVIEW"}(Mn||(Mn={})),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"}($n||($n={})),function(t){t.ON_CLICK="OnClick"}(Wn||(Wn={})),function(t){t.NATIVE="Native",t.PENDO="Pendo"}(Fn||(Fn={})),function(t){t.NAVIGATE="Navigate",t.CHANGE_TUTORIAL="ChangeTutorial",t.OPEN_GUIDE="OpenGuide"}(Vn||(Vn={})),function(t){t.PRIMARY="primary",t.SECONDARY="primary",t.WARNING="warning",t.DANGER="danger",t.NEUTRAL="neutral",t.ACTIVE="active",t.INFO="info"}(Gn||(Gn={}));Gn.PRIMARY;var Yn;!function(t){t.U="U",t.B="B",t.Em="Em",t.InlineCode="InlineCode"}(Yn||(Yn={}));const Hn=t=>(t=>Bn(t)&&t.length>=3&&t.length<100&&xn.test(t))(t);var Kn,qn,Jn,Zn;Object.freeze({__proto__:null,PREVIEW_SCRIPT_URL:"https://app.candu.ai/preview.html"});!function(t){t.COLLAPSED="Collapsed",t.EXPANDED="Expanded",t.MINIMIZED="Minimized"}(Kn||(Kn={})),function(t){t.TUTORIAL="Tutorial",t.PORTAL="Portal"}(qn||(qn={})),function(t){t.Global="Global",t.Organization="Organization"}(Jn||(Jn={})),function(t){t.Root="root",t.Rule="rule",t.Atrule="atrule",t.Decl="decl",t.Any="any"}(Zn||(Zn={}));var Xn=function(t,e,r,n,o,a,i,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,a,i,u],s=0;(c=new Error(e.replace(/%s/g,(function(){return l[s++]})))).name="Invariant Violation"}throw c.framesToPop=1,c}};const Qn=t=>Xn(!t||g(t),"(Candu) styleguide must be undefined or an object");var to=Object.freeze({__proto__:null,API_BASE_URL:"https://api.candu.ai",CDN_BASE_URL:"https://cdn.candu.ai",VERSION:"0.5.0-alpha.3"});const{API_BASE_URL:eo}=to,{CDN_BASE_URL:ro}=to,no="/api/segmentMemberships",oo="/api/tutorialDocumentsEditor",ao=async t=>(await fetch(t)).json(),io=t=>ao(`${eo}${t}`),uo=t=>ao(`${ro}${t}`),co={tutorialDocumentLatestPublished:async(t,e)=>io(`${oo}?token=${t}&finder=latestPublished&tutorialId=${e}`),portalAsset:async(t,e)=>uo(`/portals/${t}/${e}/head.json`),segmentMembership:async(t,e)=>io(`${no}/${e}?token=${t}`),tutorialDocument:(t,e,r)=>{const{contentHashId:n,tutorialId:o,tutorialDocument:a,slug:i}=t,u=(t=>({byId:e=>io(`${oo}/${e}?token=${t}`),bySlug:e=>uo(`/tutorials/${t}/${e}.json`),byContentHash:e=>uo(`/tutorials/${t}/${e}.json`)}))(e);return(t=>zn(t))(o)?u.byId(o):Hn(i)?u.bySlug(i):(t=>Bn(t)&&!!t.match(/^[0-9a-zA-Z]{40}$/))(n)?u.byContentHash(n):g(a)?Promise.resolve(a):(pn.error(dn[ln.NO_VALID_TUTORIAL_IDENTIFIER]),r.track(ln.NO_VALID_TUTORIAL_IDENTIFIER,{slug:t.slug}),null)}},lo=(...t)=>console.error(...t),so=(...t)=>console.warn(...t),fo={error:lo,warning:so},po=t=>{switch(t.trigger){case Wn.ON_CLICK:default:return"onClick"}},_o=({data:t},e)=>{if(!t||!t.actions)return{};const r=t=>{e.provider.eventing.track(ln.TUTORIAL_INTERACTION,{...t,...e.trackingIdentifiers||{}})};return t.actions.map(t=>((t,e)=>{switch(t.handler.type){case Vn.NAVIGATE:return{[po(t)]:()=>{const{href:r,target:n}=t.handler;e(t),"Blank"===n?window.open(r,"_blank"):r&&r.includes("mailto:")?window.location=r:document.location.href=r}};case Vn.CHANGE_TUTORIAL:return{[po(t)]:()=>{const{tutorialId:e}=t.handler;lo("TODO -> change tutorial",e)}};case Vn.OPEN_GUIDE:return{[po(t)]:()=>{const{guideId:e}=t.handler;lo("TODO -> open guide",e)}};default:return{}}})(t,r)).reduce((t,e)=>({...t,...e}),{})},vo=(t,e)=>{const{provider:r,document:n,trackingIdentifiers:o}=e,a=n.nodes[t];if(!a)return fo.error("Document is corrupted. Refusing to move further."),null;const i=t=>vo(t,e),{type:u,props:c,css:l}=a,s={...c||{},style:l||{},children:(c||{}).children||a.nodes&&a.nodes.map(i),..._o(a,{trackingIdentifiers:o,provider:r})},d={nodeId:t,node:a,document:n,render:{node:i,styleguide:(t,r={})=>e.renderNode(t,{api:d,attributes:r}),tutorial:t=>e.renderTutorial(t),portal:t=>e.renderPortal(t)},trackingIdentifiers:o},f=d.render.styleguide(u,s);return f||(fo.error(dn[ln.UNKOWN_NODE_TYPE],{type:u}),r.eventing.track(ln.UNKOWN_NODE_TYPE,{type:u}),null)},ho=mr((t,e)=>{const{provider:r,portal:n,tutorial:o}=t,a=r.styleguide;let i,u;return o&&(u=o.styleguide),n&&(i=n.styleguide),{...a||{},...i||{},...u||{},...e||{}}});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=dn,t.ERROR_SLUGS=cn,t.EVENT_NAMES=ln,t.LOGGER=pn,t.RESOURCES=co,t.STYLEGUIDE_COLORS={primary:"#6310E5",secondary:"#59C3C3",tertiary:"#4D515D",warning:"#FCAD0D",danger:"#EE4266"},t.adaptCustomNodes=t=>Qr(t,t=>{let e=t;return"Typography"===e.type&&(e=(t=>{const e=$r(t,"data.custom.variant","P");return{...t,type:e}})(e)),e.css&&"flexBasis"in e.css&&(e=(t=>{const{flexBasis:e}=t.css;return"0"===e||"0px"===e?{...t,css:{...t.css,flexBasis:"0%"}}:t})(e)),e.css&&(e=nn(e),e=on(e)),e}),t.attachStylesheet=t=>{const e=document.createElement("link");e.setAttribute("rel","stylesheet"),e.setAttribute("href",`${ro}/styleguides/applications/${t}/default/main.css`),document.head.appendChild(e)},t.convertStyleNumberValues=on,t.defaultStyleguide=fn,t.internalEventing=({identify:t,track:e})=>({provider:({userId:r,traits:n,styleguide:o})=>{t(r,n),e(ln.HEARTBEAT,(t=>{const e={};return Object.keys(t).forEach(r=>{fn[r]&&(e[`styleguide.${r}`]=t[r].displayName||!0)}),e})(o))},tutorialDocumentLoadingError:({tutorialId:t,slug:r,contentHashId:n})=>{pn.error(dn[ln.TUTORIAL_LOADING_ERROR]),e(ln.TUTORIAL_LOADING_ERROR,{tutorialId:t,slug:r,contentHashId:n})}}),t.logError=lo,t.logWarning=so,t.logger=fo,t.mapNodeToStyleguide=vo,t.mergeStyleguidesFromContext=ho,t.portalValidation=({slug:t,styleguide:e})=>(Qn(e),{slug:t,styleguide:e||{}}),t.providerValidation=({clientToken:t,userId:e,traits:r,options:n,styleguide:o,...a})=>(Xn((t=>Bn(t)&&!!t.match(/^[0-9a-zA-Z]*$/)&&t.length>=10)(t),"(Candu) you must provide a valid clientToken"),Xn(!e||(t=>zn(t)||Bn(t)&&t.trim().length>0)(e),"(Candu) you must provide a valid userId"),Qn(o),Xn(!r||g(r),"(Candu) traits must be undefined or an object"),Xn(!n||g(n),"(Candu) options must be undefined or an object"),{...a,clientToken:t,traits:r||{},options:n||{},styleguide:o||{},userId:e||In()}),t.tutorialValidation=({slug:t,styleguide:e,contentHashId:r,tutorialId:n,tutorialDocument:o,...a})=>(Qn(e),{...a,slug:t,styleguide:e||{},contentHashId:r,tutorialId:n,tutorialDocument:o}),t.unpackShorthandStyles=nn,Object.defineProperty(t,"__esModule",{value:!0})})); | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("util"),require("crypto")):"function"==typeof define&&define.amd?define(["exports","util","crypto"],e):e((t=t||self)["@candulabs/core"]={},t.util,t.e)}(this,(function(t,e,r){"use strict";r=r&&r.hasOwnProperty("default")?r.default:r;var n="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function o(t,e){return t(e={exports:{}},e.exports),e.exports}var a="object"==typeof n&&n&&n.Object===Object&&n,i="object"==typeof self&&self&&self.Object===Object&&self,u=a||i||Function("return this")(),c=u.Symbol,l=Object.prototype,s=l.hasOwnProperty,d=l.toString,f=c?c.toStringTag:void 0;var p=function(t){var e=s.call(t,f),r=t[f];try{t[f]=void 0;var n=!0}catch(t){}var o=d.call(t);return n&&(e?t[f]=r:delete t[f]),o},_=Object.prototype.toString;var v=function(t){return _.call(t)},h="[object Null]",y="[object Undefined]",b=c?c.toStringTag:void 0;var E=function(t){return null==t?void 0===t?y:h:b&&b in Object(t)?p(t):v(t)};var g=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)},O="[object AsyncFunction]",T="[object Function]",I="[object GeneratorFunction]",N="[object Proxy]";var A,m=function(t){if(!g(t))return!1;var e=E(t);return e==T||e==I||e==O||e==N},j=u["__core-js_shared__"],R=(A=/[^.]+$/.exec(j&&j.keys&&j.keys.IE_PROTO||""))?"Symbol(src)_1."+A:"";var S=function(t){return!!R&&R in t},D=Function.prototype.toString;var L=function(t){if(null!=t){try{return D.call(t)}catch(t){}try{return t+""}catch(t){}}return""},P=/^\[object .+?Constructor\]$/,w=Function.prototype,C=Object.prototype,U=w.toString,k=C.hasOwnProperty,B=RegExp("^"+U.call(k).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var x=function(t){return!(!g(t)||S(t))&&(m(t)?B:P).test(L(t))};var z=function(t,e){return null==t?void 0:t[e]};var M=function(t,e){var r=z(t,e);return x(r)?r:void 0},$=function(){try{var t=M(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();var W=function(t,e,r){"__proto__"==e&&$?$(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r};var F=function(t){return function(e,r,n){for(var o=-1,a=Object(e),i=n(e),u=i.length;u--;){var c=i[t?u:++o];if(!1===r(a[c],c,a))break}return e}}();var V=function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n};var G=function(t){return null!=t&&"object"==typeof t},Y="[object Arguments]";var H=function(t){return G(t)&&E(t)==Y},K=Object.prototype,q=K.hasOwnProperty,J=K.propertyIsEnumerable,Z=H(function(){return arguments}())?H:function(t){return G(t)&&q.call(t,"callee")&&!J.call(t,"callee")},X=Array.isArray;var Q=function(){return!1},tt=o((function(t,e){var r=e&&!e.nodeType&&e,n=r&&t&&!t.nodeType&&t,o=n&&n.exports===r?u.Buffer:void 0,a=(o?o.isBuffer:void 0)||Q;t.exports=a})),et=9007199254740991,rt=/^(?:0|[1-9]\d*)$/;var nt=function(t,e){var r=typeof t;return!!(e=null==e?et:e)&&("number"==r||"symbol"!=r&&rt.test(t))&&t>-1&&t%1==0&&t<e},ot=9007199254740991;var at=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=ot},it={};it["[object Float32Array]"]=it["[object Float64Array]"]=it["[object Int8Array]"]=it["[object Int16Array]"]=it["[object Int32Array]"]=it["[object Uint8Array]"]=it["[object Uint8ClampedArray]"]=it["[object Uint16Array]"]=it["[object Uint32Array]"]=!0,it["[object Arguments]"]=it["[object Array]"]=it["[object ArrayBuffer]"]=it["[object Boolean]"]=it["[object DataView]"]=it["[object Date]"]=it["[object Error]"]=it["[object Function]"]=it["[object Map]"]=it["[object Number]"]=it["[object Object]"]=it["[object RegExp]"]=it["[object Set]"]=it["[object String]"]=it["[object WeakMap]"]=!1;var ut=function(t){return G(t)&&at(t.length)&&!!it[E(t)]};var ct=function(t){return function(e){return t(e)}},lt=o((function(t,e){var r=e&&!e.nodeType&&e,n=r&&t&&!t.nodeType&&t,o=n&&n.exports===r&&a.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})),st=lt&<.isTypedArray,dt=st?ct(st):ut,ft=Object.prototype.hasOwnProperty;var pt=function(t,e){var r=X(t),n=!r&&Z(t),o=!r&&!n&&tt(t),a=!r&&!n&&!o&&dt(t),i=r||n||o||a,u=i?V(t.length,String):[],c=u.length;for(var l in t)!e&&!ft.call(t,l)||i&&("length"==l||o&&("offset"==l||"parent"==l)||a&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||nt(l,c))||u.push(l);return u},_t=Object.prototype;var vt=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||_t)};var ht=function(t,e){return function(r){return t(e(r))}}(Object.keys,Object),yt=Object.prototype.hasOwnProperty;var bt=function(t){if(!vt(t))return ht(t);var e=[];for(var r in Object(t))yt.call(t,r)&&"constructor"!=r&&e.push(r);return e};var Et=function(t){return null!=t&&at(t.length)&&!m(t)};var gt=function(t){return Et(t)?pt(t):bt(t)};var Ot=function(t,e){return t&&F(t,e,gt)};var Tt=function(){this.__data__=[],this.size=0};var It=function(t,e){return t===e||t!=t&&e!=e};var Nt=function(t,e){for(var r=t.length;r--;)if(It(t[r][0],e))return r;return-1},At=Array.prototype.splice;var mt=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 jt=function(t){var e=this.__data__,r=Nt(e,t);return r<0?void 0:e[r][1]};var Rt=function(t){return Nt(this.__data__,t)>-1};var St=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 Dt(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])}}Dt.prototype.clear=Tt,Dt.prototype.delete=mt,Dt.prototype.get=jt,Dt.prototype.has=Rt,Dt.prototype.set=St;var Lt=Dt;var Pt=function(){this.__data__=new Lt,this.size=0};var wt=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r};var Ct=function(t){return this.__data__.get(t)};var Ut=function(t){return this.__data__.has(t)},kt=M(u,"Map"),Bt=M(Object,"create");var xt=function(){this.__data__=Bt?Bt(null):{},this.size=0};var zt=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},Mt="__lodash_hash_undefined__",$t=Object.prototype.hasOwnProperty;var Wt=function(t){var e=this.__data__;if(Bt){var r=e[t];return r===Mt?void 0:r}return $t.call(e,t)?e[t]:void 0},Ft=Object.prototype.hasOwnProperty;var Vt=function(t){var e=this.__data__;return Bt?void 0!==e[t]:Ft.call(e,t)},Gt="__lodash_hash_undefined__";var Yt=function(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=Bt&&void 0===e?Gt:e,this};function Ht(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])}}Ht.prototype.clear=xt,Ht.prototype.delete=zt,Ht.prototype.get=Wt,Ht.prototype.has=Vt,Ht.prototype.set=Yt;var Kt=Ht;var qt=function(){this.size=0,this.__data__={hash:new Kt,map:new(kt||Lt),string:new Kt}};var Jt=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t};var Zt=function(t,e){var r=t.__data__;return Jt(e)?r["string"==typeof e?"string":"hash"]:r.map};var Xt=function(t){var e=Zt(this,t).delete(t);return this.size-=e?1:0,e};var Qt=function(t){return Zt(this,t).get(t)};var te=function(t){return Zt(this,t).has(t)};var ee=function(t,e){var r=Zt(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this};function re(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])}}re.prototype.clear=qt,re.prototype.delete=Xt,re.prototype.get=Qt,re.prototype.has=te,re.prototype.set=ee;var ne=re,oe=200;var ae=function(t,e){var r=this.__data__;if(r instanceof Lt){var n=r.__data__;if(!kt||n.length<oe-1)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new ne(n)}return r.set(t,e),this.size=r.size,this};function ie(t){var e=this.__data__=new Lt(t);this.size=e.size}ie.prototype.clear=Pt,ie.prototype.delete=wt,ie.prototype.get=Ct,ie.prototype.has=Ut,ie.prototype.set=ae;var ue=ie,ce="__lodash_hash_undefined__";var le=function(t){return this.__data__.set(t,ce),this};var se=function(t){return this.__data__.has(t)};function de(t){var e=-1,r=null==t?0:t.length;for(this.__data__=new ne;++e<r;)this.add(t[e])}de.prototype.add=de.prototype.push=le,de.prototype.has=se;var fe=de;var pe=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 _e=function(t,e){return t.has(e)},ve=1,he=2;var ye=function(t,e,r,n,o,a){var i=r&ve,u=t.length,c=e.length;if(u!=c&&!(i&&c>u))return!1;var l=a.get(t);if(l&&a.get(e))return l==e;var s=-1,d=!0,f=r&he?new fe:void 0;for(a.set(t,e),a.set(e,t);++s<u;){var p=t[s],_=e[s];if(n)var v=i?n(_,p,s,e,t,a):n(p,_,s,t,e,a);if(void 0!==v){if(v)continue;d=!1;break}if(f){if(!pe(e,(function(t,e){if(!_e(f,e)&&(p===t||o(p,t,r,n,a)))return f.push(e)}))){d=!1;break}}else if(p!==_&&!o(p,_,r,n,a)){d=!1;break}}return a.delete(t),a.delete(e),d},be=u.Uint8Array;var Ee=function(t){var e=-1,r=Array(t.size);return t.forEach((function(t,n){r[++e]=[n,t]})),r};var ge=function(t){var e=-1,r=Array(t.size);return t.forEach((function(t){r[++e]=t})),r},Oe=1,Te=2,Ie="[object Boolean]",Ne="[object Date]",Ae="[object Error]",me="[object Map]",je="[object Number]",Re="[object RegExp]",Se="[object Set]",De="[object String]",Le="[object Symbol]",Pe="[object ArrayBuffer]",we="[object DataView]",Ce=c?c.prototype:void 0,Ue=Ce?Ce.valueOf:void 0;var ke=function(t,e,r,n,o,a,i){switch(r){case we:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case Pe:return!(t.byteLength!=e.byteLength||!a(new be(t),new be(e)));case Ie:case Ne:case je:return It(+t,+e);case Ae:return t.name==e.name&&t.message==e.message;case Re:case De:return t==e+"";case me:var u=Ee;case Se:var c=n&Oe;if(u||(u=ge),t.size!=e.size&&!c)return!1;var l=i.get(t);if(l)return l==e;n|=Te,i.set(t,e);var s=ye(u(t),u(e),n,o,a,i);return i.delete(t),s;case Le:if(Ue)return Ue.call(t)==Ue.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 xe=function(t,e,r){var n=e(t);return X(t)?n:Be(n,r(t))};var ze=function(t,e){for(var r=-1,n=null==t?0:t.length,o=0,a=[];++r<n;){var i=t[r];e(i,r,t)&&(a[o++]=i)}return a};var Me=function(){return[]},$e=Object.prototype.propertyIsEnumerable,We=Object.getOwnPropertySymbols,Fe=We?function(t){return null==t?[]:(t=Object(t),ze(We(t),(function(e){return $e.call(t,e)})))}:Me;var Ve=function(t){return xe(t,gt,Fe)},Ge=1,Ye=Object.prototype.hasOwnProperty;var He=function(t,e,r,n,o,a){var i=r&Ge,u=Ve(t),c=u.length;if(c!=Ve(e).length&&!i)return!1;for(var l=c;l--;){var s=u[l];if(!(i?s in e:Ye.call(e,s)))return!1}var d=a.get(t);if(d&&a.get(e))return d==e;var f=!0;a.set(t,e),a.set(e,t);for(var p=i;++l<c;){var _=t[s=u[l]],v=e[s];if(n)var h=i?n(v,_,s,e,t,a):n(_,v,s,t,e,a);if(!(void 0===h?_===v||o(_,v,r,n,a):h)){f=!1;break}p||(p="constructor"==s)}if(f&&!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)&&(f=!1)}return a.delete(t),a.delete(e),f},Ke=M(u,"DataView"),qe=M(u,"Promise"),Je=M(u,"Set"),Ze=M(u,"WeakMap"),Xe=L(Ke),Qe=L(kt),tr=L(qe),er=L(Je),rr=L(Ze),nr=E;(Ke&&"[object DataView]"!=nr(new Ke(new ArrayBuffer(1)))||kt&&"[object Map]"!=nr(new kt)||qe&&"[object Promise]"!=nr(qe.resolve())||Je&&"[object Set]"!=nr(new Je)||Ze&&"[object WeakMap]"!=nr(new Ze))&&(nr=function(t){var e=E(t),r="[object Object]"==e?t.constructor:void 0,n=r?L(r):"";if(n)switch(n){case Xe:return"[object DataView]";case Qe:return"[object Map]";case tr:return"[object Promise]";case er:return"[object Set]";case rr:return"[object WeakMap]"}return e});var or=nr,ar=1,ir="[object Arguments]",ur="[object Array]",cr="[object Object]",lr=Object.prototype.hasOwnProperty;var sr=function(t,e,r,n,o,a){var i=X(t),u=X(e),c=i?ur:or(t),l=u?ur:or(e),s=(c=c==ir?cr:c)==cr,d=(l=l==ir?cr:l)==cr,f=c==l;if(f&&tt(t)){if(!tt(e))return!1;i=!0,s=!1}if(f&&!s)return a||(a=new ue),i||dt(t)?ye(t,e,r,n,o,a):ke(t,e,c,r,n,o,a);if(!(r&ar)){var p=s&&lr.call(t,"__wrapped__"),_=d&&lr.call(e,"__wrapped__");if(p||_){var v=p?t.value():t,h=_?e.value():e;return a||(a=new ue),o(v,h,r,n,a)}}return!!f&&(a||(a=new ue),He(t,e,r,n,o,a))};var dr=function t(e,r,n,o,a){return e===r||(null==e||null==r||!G(e)&&!G(r)?e!=e&&r!=r:sr(e,r,n,o,t,a))},fr=1,pr=2;var _r=function(t,e,r,n){var o=r.length,a=o,i=!n;if(null==t)return!a;for(t=Object(t);o--;){var u=r[o];if(i&&u[2]?u[1]!==t[u[0]]:!(u[0]in t))return!1}for(;++o<a;){var c=(u=r[o])[0],l=t[c],s=u[1];if(i&&u[2]){if(void 0===l&&!(c in t))return!1}else{var d=new ue;if(n)var f=n(l,s,c,t,e,d);if(!(void 0===f?dr(s,l,fr|pr,n,d):f))return!1}}return!0};var vr=function(t){return t==t&&!g(t)};var hr=function(t){for(var e=gt(t),r=e.length;r--;){var n=e[r],o=t[n];e[r]=[n,o,vr(o)]}return e};var yr=function(t,e){return function(r){return null!=r&&(r[t]===e&&(void 0!==e||t in Object(r)))}};var br=function(t){var e=hr(t);return 1==e.length&&e[0][2]?yr(e[0][0],e[0][1]):function(r){return r===t||_r(r,t,e)}},Er="[object Symbol]";var gr=function(t){return"symbol"==typeof t||G(t)&&E(t)==Er},Or=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Tr=/^\w*$/;var Ir=function(t,e){if(X(t))return!1;var r=typeof t;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=t&&!gr(t))||(Tr.test(t)||!Or.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],a=r.cache;if(a.has(o))return a.get(o);var i=t.apply(this,n);return r.cache=a.set(o,i)||a,i};return r.cache=new(Ar.Cache||ne),r}Ar.Cache=ne;var mr=Ar,jr=500;var Rr=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Sr=/\\(\\)?/g,Dr=function(t){var e=mr(t,(function(t){return r.size===jr&&r.clear(),t})),r=e.cache;return e}((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(Rr,(function(t,r,n,o){e.push(n?o.replace(Sr,"$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},Pr=1/0,wr=c?c.prototype:void 0,Cr=wr?wr.toString:void 0;var Ur=function t(e){if("string"==typeof e)return e;if(X(e))return Lr(e,t)+"";if(gr(e))return Cr?Cr.call(e):"";var r=e+"";return"0"==r&&1/e==-Pr?"-0":r};var kr=function(t){return null==t?"":Ur(t)};var Br=function(t,e){return X(t)?t:Ir(t,e)?[t]:Dr(kr(t))},xr=1/0;var zr=function(t){if("string"==typeof t||gr(t))return t;var e=t+"";return"0"==e&&1/t==-xr?"-0":e};var Mr=function(t,e){for(var r=0,n=(e=Br(e,t)).length;null!=t&&r<n;)t=t[zr(e[r++])];return r&&r==n?t:void 0};var $r=function(t,e,r){var n=null==t?void 0:Mr(t,e);return void 0===n?r:n};var Wr=function(t,e){return null!=t&&e in Object(t)};var Fr=function(t,e,r){for(var n=-1,o=(e=Br(e,t)).length,a=!1;++n<o;){var i=zr(e[n]);if(!(a=null!=t&&r(t,i)))break;t=t[i]}return a||++n!=o?a:!!(o=null==t?0:t.length)&&at(o)&&nt(i,o)&&(X(t)||Z(t))};var Vr=function(t,e){return null!=t&&Fr(t,e,Wr)},Gr=1,Yr=2;var Hr=function(t,e){return Ir(t)&&vr(e)?yr(zr(t),e):function(r){var n=$r(r,t);return void 0===n&&n===e?Vr(r,t):dr(e,n,Gr|Yr)}};var Kr=function(t){return t};var qr=function(t){return function(e){return null==e?void 0:e[t]}};var Jr=function(t){return function(e){return Mr(e,t)}};var Zr=function(t){return Ir(t)?qr(zr(t)):Jr(t)};var Xr=function(t){return"function"==typeof t?t:null==t?Kr:"object"==typeof t?X(t)?Hr(t[0],t[1]):br(t):Zr(t)};var Qr=function(t,e){var r={};return e=Xr(e),Ot(t,(function(t,n,o){W(r,n,e(t,n,o))})),r},tn={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 en=["Webkit","ms","Moz","O"];Object.keys(tn).forEach((function(t){en.forEach((function(e){tn[function(t,e){return t+e.charAt(0).toUpperCase()+e.substring(1)}(e,t)]=tn[t]}))}));var rn={isUnitlessNumber:tn,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}}};const nn=t=>{const{padding:e,margin:r,...n}=t.css;let o={};return e&&(o={paddingRight:e,paddingLeft:e,paddingBottom:e,paddingTop:e}),r&&(o={...o,marginRight:r,marginLeft:r,marginBottom:r,marginTop:r}),{...t,css:{...o,...n}}},on=t=>{const r=t.css,n={};return Object.entries(r).forEach(([t,r])=>{if(e.isNumber(r))return rn.isUnitlessNumber[t]?void(n[t]=`${r}`):void(n[t]=`${r}px`);n[t]=r}),{...t,css:n}},an=t=>`candu.sdk.${t}`,un=t=>an(`error.${t}`),cn={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"},ln={HEARTBEAT:an("heartbeat"),PREVIEW_OPEN:an("preview.open"),PORTAL:an("portal"),TUTORIAL:an("tutorial"),TUTORIAL_INTERACTION:an("tutorial.interaction"),PORTAL_ASSET_NOT_FOUND:un("portal_asset_not_found"),PORTAL_NO_SEGMENT_IDS:un("portal_no_segment_ids"),NO_MATCHING_TUTORIALS:un("no_matching_tutorials"),NO_VALID_TUTORIAL_IDENTIFIER:un("no_valid_tutorial_identifier"),COMMIT_API_LOADING_ERROR:un("commit_api"),TUTORIAL_LOADING_ERROR:un("tutorial"),UNKOWN_NODE_TYPE:un(cn.UNKOWN_NODE_TYPE),UNKOWN_INLINE_NODE_TYPE:un(cn.UNKOWN_INLINE_NODE_TYPE),UNKOWN_NODE_OBJECT_TYPE:un(cn.UNKOWN_NODE_OBJECT_TYPE),CIRCULAR_DEPENDENCY_EMBED_PORTAL:un("circular_dependecy_embed_portal"),CIRCULAR_DEPENDENCY_EMBED_TUTORIAL:un("circular_dependecy_embed_tutorial")},sn=t=>`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}.`,dn={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",[ln.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",[ln.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",[ln.NO_MATCHING_TUTORIALS]:"The Tutorial will not be rendered because there are no matching segments for the given user.",[ln.NO_VALID_TUTORIAL_IDENTIFIER]:"(Candu/Tutorial) You must define one of tutorialId, slug, commitId or contentHashId.",[ln.TUTORIAL_LOADING_ERROR]:"An error has occurred while trying to load the Tutorial",[ln.UNKOWN_INLINE_NODE_TYPE]:sn(cn.UNKOWN_INLINE_NODE_TYPE),[ln.UNKOWN_NODE_TYPE]:sn(cn.UNKOWN_NODE_TYPE),[ln.CIRCULAR_DEPENDENCY_EMBED_PORTAL]:"Circular dependency found on Embeded Portal. Please take a look at the Portal Content.",[ln.CIRCULAR_DEPENDENCY_EMBED_TUTORIAL]:"Circular dependency found on Embeded Tutorial. Please take a look at the Tutorial Content."},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},pn={error:console.error,warning:console.warn};for(var _n=function(){return r.randomBytes(16)},vn=[],hn=0;hn<256;++hn)vn[hn]=(hn+256).toString(16).substr(1);var yn,bn,En=function(t,e){var r=e||0,n=vn;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("")},gn=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||_n)();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,e)for(var a=0;a<16;++a)e[n+a]=o[a];return e||En(o)};Object.freeze({__proto__:null,API_BASE_URL:"https://api.candu.ai",VERSION:"0.5.0"});!function(t){t.UserGenerated="UserGenerated",t.SDK="SDK"}(yn||(yn={})),function(t){t.Identify="Identify",t.Group="Group",t.Track="Track",t.Page="Page",t.Screen="Screen"}(bn||(bn={}));const On=()=>"undefined"!=typeof window&&window.localStorage,Tn=t=>e=>{On()&&null!=e&&window.localStorage.setItem(t,JSON.stringify(e))};const In={anonymousId:{getOrCreate:((t,e)=>()=>(t=>()=>{if(On()){const t=window.localStorage.getItem("candu:anonymous_id");if(t)try{return JSON.parse(t)}catch(t){return null}}})()()||(()=>{const t=gn();return Tn("candu:anonymous_id")(t),t})())(),set:Tn("candu:anonymous_id")}}.anonymousId.getOrCreate;var Nn="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},An="object"==typeof Nn&&Nn&&Nn.Object===Object&&Nn,mn="object"==typeof self&&self&&self.Object===Object&&self,jn=(An||mn||Function("return this")()).Symbol,Rn=Object.prototype,Sn=Rn.hasOwnProperty,Dn=Rn.toString,Ln=jn?jn.toStringTag:void 0,Pn=Object.prototype.toString,wn=jn?jn.toStringTag:void 0,Cn=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":wn&&wn in Object(t)?function(t){var e=Sn.call(t,Ln),r=t[Ln];try{t[Ln]=void 0;var n=!0}catch(t){}var o=Dn.call(t);return n&&(e?t[Ln]=r:delete t[Ln]),o}(t):function(t){return Pn.call(t)}(t)},Un=Array.isArray,kn=function(t){return null!=t&&"object"==typeof t},Bn=function(t){return"string"==typeof t||!Un(t)&&kn(t)&&"[object String]"==Cn(t)};const xn=/^([a-zA-Z0-9]|_|-)+$/,zn=t=>(function(t){return"number"==typeof t||kn(t)&&"[object Number]"==Cn(t)})(t)&&t>=0;var Mn,$n,Wn,Fn,Vn,Gn;!function(t){t.SDK="SDK",t.PREVIEW="PREVIEW"}(Mn||(Mn={})),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"}($n||($n={})),function(t){t.ON_CLICK="OnClick"}(Wn||(Wn={})),function(t){t.NATIVE="Native",t.PENDO="Pendo"}(Fn||(Fn={})),function(t){t.NAVIGATE="Navigate",t.CHANGE_TUTORIAL="ChangeTutorial",t.OPEN_GUIDE="OpenGuide"}(Vn||(Vn={})),function(t){t.PRIMARY="primary",t.SECONDARY="primary",t.WARNING="warning",t.DANGER="danger",t.NEUTRAL="neutral",t.ACTIVE="active",t.INFO="info"}(Gn||(Gn={}));Gn.PRIMARY;var Yn;!function(t){t.U="U",t.B="B",t.Em="Em",t.InlineCode="InlineCode"}(Yn||(Yn={}));const Hn=t=>(t=>Bn(t)&&t.length>=3&&t.length<100&&xn.test(t))(t);var Kn,qn,Jn,Zn;Object.freeze({__proto__:null,PREVIEW_SCRIPT_URL:"https://app.candu.ai/preview.html"});!function(t){t.COLLAPSED="Collapsed",t.EXPANDED="Expanded",t.MINIMIZED="Minimized"}(Kn||(Kn={})),function(t){t.TUTORIAL="Tutorial",t.PORTAL="Portal"}(qn||(qn={})),function(t){t.Global="Global",t.Organization="Organization"}(Jn||(Jn={})),function(t){t.Root="root",t.Rule="rule",t.Atrule="atrule",t.Decl="decl",t.Any="any"}(Zn||(Zn={}));var Xn=function(t,e,r,n,o,a,i,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,a,i,u],s=0;(c=new Error(e.replace(/%s/g,(function(){return l[s++]})))).name="Invariant Violation"}throw c.framesToPop=1,c}};const Qn=t=>Xn(!t||g(t),"(Candu) styleguide must be undefined or an object");var to=Object.freeze({__proto__:null,API_BASE_URL:"https://api.candu.ai",CDN_BASE_URL:"https://cdn.candu.ai",VERSION:"0.5.0"});const{API_BASE_URL:eo}=to,{CDN_BASE_URL:ro}=to,no="/api/segmentMemberships",oo="/api/tutorialDocumentsEditor",ao=async t=>(await fetch(t)).json(),io=t=>ao(`${eo}${t}`),uo=t=>ao(`${ro}${t}`),co={tutorialDocumentLatestPublished:async(t,e)=>io(`${oo}?token=${t}&finder=latestPublished&tutorialId=${e}`),portalAsset:async(t,e)=>uo(`/portals/${t}/${e}/head.json`),segmentMembership:async(t,e)=>io(`${no}/${e}?token=${t}`),tutorialDocument:(t,e,r)=>{const{contentHashId:n,tutorialId:o,tutorialDocument:a,slug:i}=t,u=(t=>({byId:e=>io(`${oo}/${e}?token=${t}`),bySlug:e=>uo(`/tutorials/${t}/${e}.json`),byContentHash:e=>uo(`/tutorials/${t}/${e}.json`)}))(e);return(t=>zn(t))(o)?u.byId(o):Hn(i)?u.bySlug(i):(t=>Bn(t)&&!!t.match(/^[0-9a-zA-Z]{40}$/))(n)?u.byContentHash(n):g(a)?Promise.resolve(a):(pn.error(dn[ln.NO_VALID_TUTORIAL_IDENTIFIER]),r.track(ln.NO_VALID_TUTORIAL_IDENTIFIER,{slug:t.slug}),null)}},lo=(...t)=>console.error(...t),so=(...t)=>console.warn(...t),fo={error:lo,warning:so},po=t=>{switch(t.trigger){case Wn.ON_CLICK:default:return"onClick"}},_o=({data:t},e)=>{if(!t||!t.actions)return{};const r=t=>{e.provider.eventing.track(ln.TUTORIAL_INTERACTION,{...t,...e.trackingIdentifiers||{}})};return t.actions.map(t=>((t,e)=>{switch(t.handler.type){case Vn.NAVIGATE:return{[po(t)]:()=>{const{href:r,target:n}=t.handler;e(t),"Blank"===n?window.open(r,"_blank"):r&&r.includes("mailto:")?window.location=r:document.location.href=r}};case Vn.CHANGE_TUTORIAL:return{[po(t)]:()=>{const{tutorialId:e}=t.handler;lo("TODO -> change tutorial",e)}};case Vn.OPEN_GUIDE:return{[po(t)]:()=>{const{guideId:e}=t.handler;lo("TODO -> open guide",e)}};default:return{}}})(t,r)).reduce((t,e)=>({...t,...e}),{})},vo=(t,e)=>{const{provider:r,document:n,trackingIdentifiers:o}=e,a=n.nodes[t];if(!a)return fo.error("Document is corrupted. Refusing to move further."),null;const i=t=>vo(t,e),{type:u,props:c,css:l}=a,s={...c||{},style:l||{},children:(c||{}).children||a.nodes&&a.nodes.map(i),..._o(a,{trackingIdentifiers:o,provider:r})},d={nodeId:t,node:a,document:n,render:{node:i,styleguide:(t,r={})=>e.renderNode(t,{api:d,attributes:r}),tutorial:t=>e.renderTutorial(t),portal:t=>e.renderPortal(t)},trackingIdentifiers:o},f=d.render.styleguide(u,s);return f||(fo.error(dn[ln.UNKOWN_NODE_TYPE],{type:u}),r.eventing.track(ln.UNKOWN_NODE_TYPE,{type:u}),null)},ho=mr((t,e)=>{const{provider:r,portal:n,tutorial:o}=t,a=r.styleguide;let i,u;return o&&(u=o.styleguide),n&&(i=n.styleguide),{...a||{},...i||{},...u||{},...e||{}}});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=dn,t.ERROR_SLUGS=cn,t.EVENT_NAMES=ln,t.LOGGER=pn,t.RESOURCES=co,t.STYLEGUIDE_COLORS={primary:"#6310E5",secondary:"#59C3C3",tertiary:"#4D515D",warning:"#FCAD0D",danger:"#EE4266"},t.adaptCustomNodes=t=>Qr(t,t=>{let e=t;return"Typography"===e.type&&(e=(t=>{const e=$r(t,"data.custom.variant","P");return{...t,type:e}})(e)),e.css&&"flexBasis"in e.css&&(e=(t=>{const{flexBasis:e}=t.css;return"0"===e||"0px"===e?{...t,css:{...t.css,flexBasis:"0%"}}:t})(e)),e.css&&(e=nn(e),e=on(e)),e}),t.attachStylesheet=t=>{const e=document.createElement("link");e.setAttribute("rel","stylesheet"),e.setAttribute("href",`${ro}/styleguides/applications/${t}/default/main.css`),document.head.appendChild(e)},t.convertStyleNumberValues=on,t.defaultStyleguide=fn,t.internalEventing=({identify:t,track:e})=>({provider:({userId:r,traits:n,styleguide:o})=>{t(r,n),e(ln.HEARTBEAT,(t=>{const e={};return Object.keys(t).forEach(r=>{fn[r]&&(e[`styleguide.${r}`]=t[r].displayName||!0)}),e})(o))},tutorialDocumentLoadingError:({tutorialId:t,slug:r,contentHashId:n})=>{pn.error(dn[ln.TUTORIAL_LOADING_ERROR]),e(ln.TUTORIAL_LOADING_ERROR,{tutorialId:t,slug:r,contentHashId:n})}}),t.logError=lo,t.logWarning=so,t.logger=fo,t.mapNodeToStyleguide=vo,t.mergeStyleguidesFromContext=ho,t.portalValidation=({slug:t,styleguide:e})=>(Qn(e),{slug:t,styleguide:e||{}}),t.providerValidation=({clientToken:t,userId:e,traits:r,options:n,styleguide:o,...a})=>(Xn((t=>Bn(t)&&!!t.match(/^[0-9a-zA-Z]*$/)&&t.length>=10)(t),"(Candu) you must provide a valid clientToken"),Xn(!e||(t=>zn(t)||Bn(t)&&t.trim().length>0)(e),"(Candu) you must provide a valid userId"),Qn(o),Xn(!r||g(r),"(Candu) traits must be undefined or an object"),Xn(!n||g(n),"(Candu) options must be undefined or an object"),{...a,clientToken:t,traits:r||{},options:n||{},styleguide:o||{},userId:e||In()}),t.tutorialValidation=({slug:t,styleguide:e,contentHashId:r,tutorialId:n,tutorialDocument:o,...a})=>(Qn(e),{...a,slug:t,styleguide:e||{},contentHashId:r,tutorialId:n,tutorialDocument:o}),t.unpackShorthandStyles=nn,Object.defineProperty(t,"__esModule",{value:!0})})); | ||
//# sourceMappingURL=index.js.map |
@@ -12,3 +12,3 @@ { | ||
}, | ||
"version": "0.5.0-alpha.3", | ||
"version": "0.5.0", | ||
"main": "dist/index.js", | ||
@@ -27,7 +27,7 @@ "module": "dist/index.es.js", | ||
"dependencies": { | ||
"@candulabs/eventing": "^0.5.0-alpha.3", | ||
"@candulabs/models": "^0.5.0-alpha.3", | ||
"@candulabs/eventing": "^0.5.0", | ||
"@candulabs/models": "^0.5.0", | ||
"react-style-object-to-css": "^1.1.2" | ||
}, | ||
"gitHead": "b00b12ef61c7864fcfe98fdc3739dadb8358e5a0" | ||
"gitHead": "c38d58d847e12fcddab1d3e4e8d745c72339341d" | ||
} |
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
642711
Updated@candulabs/eventing@^0.5.0
Updated@candulabs/models@^0.5.0