Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@candulabs/core

Package Overview
Dependencies
Maintainers
4
Versions
156
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@candulabs/core - npm Package Compare versions

Comparing version 0.7.1-alpha.6 to 0.7.1-alpha.7

8

CHANGELOG.md

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

## 0.7.1-alpha.7 (2021-04-01)
**Note:** Version bump only for package @candulabs/core
## 0.7.1-alpha.6 (2021-03-31)

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

2

dist/index.es.js

@@ -15,3 +15,3 @@ import t from"react-style-object-to-css/lib/CSSProperty";import{DEFAULT_SEGMENT_ID as e,isClientToken as r,isUserId as n,isTutorialSlug as o,isTutorialId as i,isContentHashId as a,TRIGGERS as u,HANDLER_TYPES as c,StateResolverType as s,CheckListScope as l,CheckListItemStatus as f}from"@candulabs/models";import{getAnonymousId as d}from"@candulabs/eventing";import p from"invariant";import"setimmediate";import v from"dataloader";

PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var h=function(t,e){return(h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)};function _(t,e){function r(){this.constructor=t}h(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var y=function(){return(y=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function b(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r}function g(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}c((n=n.apply(t,e||[])).next())}))}function E(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}function O(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;var n=Array(t),o=0;for(e=0;e<r;e++)for(var i=arguments[e],a=0,u=i.length;a<u;a++,o++)n[o]=i[a];return n}var T="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function m(t){var e={exports:{}};return t(e,e.exports),e.exports}var I="object"==typeof T&&T&&T.Object===Object&&T,R="object"==typeof self&&self&&self.Object===Object&&self,A=I||R||Function("return this")(),j=A.Symbol,N=Object.prototype,w=N.hasOwnProperty,D=N.toString,P=j?j.toStringTag:void 0;var C=function(t){var e=w.call(t,P),r=t[P];try{t[P]=void 0;var n=!0}catch(t){}var o=D.call(t);return n&&(e?t[P]=r:delete t[P]),o},L=Object.prototype.toString;var S=function(t){return L.call(t)},k=j?j.toStringTag:void 0;var U=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":k&&k in Object(t)?C(t):S(t)};var M=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)};var x,F=function(t){if(!M(t))return!1;var e=U(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e},B=A["__core-js_shared__"],z=(x=/[^.]+$/.exec(B&&B.keys&&B.keys.IE_PROTO||""))?"Symbol(src)_1."+x:"";var H=function(t){return!!z&&z in t},Y=Function.prototype.toString;var G=function(t){if(null!=t){try{return Y.call(t)}catch(t){}try{return t+""}catch(t){}}return""},K=/^\[object .+?Constructor\]$/,W=Function.prototype,V=Object.prototype,J=W.toString,$=V.hasOwnProperty,q=RegExp("^"+J.call($).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var Z=function(t){return!(!M(t)||H(t))&&(F(t)?q:K).test(G(t))};var Q=function(t,e){return null==t?void 0:t[e]};var X=function(t,e){var r=Q(t,e);return Z(r)?r:void 0},tt=function(){try{var t=X(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();var et=function(t,e,r){"__proto__"==e&&tt?tt(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r};var rt=function(t){return function(e,r,n){for(var o=-1,i=Object(e),a=n(e),u=a.length;u--;){var c=a[t?u:++o];if(!1===r(i[c],c,i))break}return e}}();var nt=function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n};var ot=function(t){return null!=t&&"object"==typeof t};var it=function(t){return ot(t)&&"[object Arguments]"==U(t)},at=Object.prototype,ut=at.hasOwnProperty,ct=at.propertyIsEnumerable,st=it(function(){return arguments}())?it:function(t){return ot(t)&&ut.call(t,"callee")&&!ct.call(t,"callee")},lt=Array.isArray;var ft=function(){return!1},dt=m((function(t,e){var r=e&&!e.nodeType&&e,n=r&&t&&!t.nodeType&&t,o=n&&n.exports===r?A.Buffer:void 0,i=(o?o.isBuffer:void 0)||ft;t.exports=i})),pt=/^(?:0|[1-9]\d*)$/;var vt=function(t,e){var r=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==r||"symbol"!=r&&pt.test(t))&&t>-1&&t%1==0&&t<e};var ht=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991},_t={};_t["[object Float32Array]"]=_t["[object Float64Array]"]=_t["[object Int8Array]"]=_t["[object Int16Array]"]=_t["[object Int32Array]"]=_t["[object Uint8Array]"]=_t["[object Uint8ClampedArray]"]=_t["[object Uint16Array]"]=_t["[object Uint32Array]"]=!0,_t["[object Arguments]"]=_t["[object Array]"]=_t["[object ArrayBuffer]"]=_t["[object Boolean]"]=_t["[object DataView]"]=_t["[object Date]"]=_t["[object Error]"]=_t["[object Function]"]=_t["[object Map]"]=_t["[object Number]"]=_t["[object Object]"]=_t["[object RegExp]"]=_t["[object Set]"]=_t["[object String]"]=_t["[object WeakMap]"]=!1;var yt=function(t){return ot(t)&&ht(t.length)&&!!_t[U(t)]};var bt=function(t){return function(e){return t(e)}},gt=m((function(t,e){var r=e&&!e.nodeType&&e,n=r&&t&&!t.nodeType&&t,o=n&&n.exports===r&&I.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})),Et=gt&&gt.isTypedArray,Ot=Et?bt(Et):yt,Tt=Object.prototype.hasOwnProperty;var mt=function(t,e){var r=lt(t),n=!r&&st(t),o=!r&&!n&&dt(t),i=!r&&!n&&!o&&Ot(t),a=r||n||o||i,u=a?nt(t.length,String):[],c=u.length;for(var s in t)!e&&!Tt.call(t,s)||a&&("length"==s||o&&("offset"==s||"parent"==s)||i&&("buffer"==s||"byteLength"==s||"byteOffset"==s)||vt(s,c))||u.push(s);return u},It=Object.prototype;var Rt=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||It)};var At=function(t,e){return function(r){return t(e(r))}}(Object.keys,Object),jt=Object.prototype.hasOwnProperty;var Nt=function(t){if(!Rt(t))return At(t);var e=[];for(var r in Object(t))jt.call(t,r)&&"constructor"!=r&&e.push(r);return e};var wt=function(t){return null!=t&&ht(t.length)&&!F(t)};var Dt=function(t){return wt(t)?mt(t):Nt(t)};var Pt=function(t,e){return t&&rt(t,e,Dt)};var Ct=function(){this.__data__=[],this.size=0};var Lt=function(t,e){return t===e||t!=t&&e!=e};var St=function(t,e){for(var r=t.length;r--;)if(Lt(t[r][0],e))return r;return-1},kt=Array.prototype.splice;var Ut=function(t){var e=this.__data__,r=St(e,t);return!(r<0)&&(r==e.length-1?e.pop():kt.call(e,r,1),--this.size,!0)};var Mt=function(t){var e=this.__data__,r=St(e,t);return r<0?void 0:e[r][1]};var xt=function(t){return St(this.__data__,t)>-1};var Ft=function(t,e){var r=this.__data__,n=St(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this};function Bt(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])}}Bt.prototype.clear=Ct,Bt.prototype.delete=Ut,Bt.prototype.get=Mt,Bt.prototype.has=xt,Bt.prototype.set=Ft;var zt=Bt;var Ht=function(){this.__data__=new zt,this.size=0};var Yt=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r};var Gt=function(t){return this.__data__.get(t)};var Kt=function(t){return this.__data__.has(t)},Wt=X(A,"Map"),Vt=X(Object,"create");var Jt=function(){this.__data__=Vt?Vt(null):{},this.size=0};var $t=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},qt=Object.prototype.hasOwnProperty;var Zt=function(t){var e=this.__data__;if(Vt){var r=e[t];return"__lodash_hash_undefined__"===r?void 0:r}return qt.call(e,t)?e[t]:void 0},Qt=Object.prototype.hasOwnProperty;var Xt=function(t){var e=this.__data__;return Vt?void 0!==e[t]:Qt.call(e,t)};var te=function(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=Vt&&void 0===e?"__lodash_hash_undefined__":e,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=Jt,ee.prototype.delete=$t,ee.prototype.get=Zt,ee.prototype.has=Xt,ee.prototype.set=te;var re=ee;var ne=function(){this.size=0,this.__data__={hash:new re,map:new(Wt||zt),string:new re}};var oe=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t};var ie=function(t,e){var r=t.__data__;return oe(e)?r["string"==typeof e?"string":"hash"]:r.map};var ae=function(t){var e=ie(this,t).delete(t);return this.size-=e?1:0,e};var ue=function(t){return ie(this,t).get(t)};var ce=function(t){return ie(this,t).has(t)};var se=function(t,e){var r=ie(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this};function le(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])}}le.prototype.clear=ne,le.prototype.delete=ae,le.prototype.get=ue,le.prototype.has=ce,le.prototype.set=se;var fe=le;var de=function(t,e){var r=this.__data__;if(r instanceof zt){var n=r.__data__;if(!Wt||n.length<199)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new fe(n)}return r.set(t,e),this.size=r.size,this};function pe(t){var e=this.__data__=new zt(t);this.size=e.size}pe.prototype.clear=Ht,pe.prototype.delete=Yt,pe.prototype.get=Gt,pe.prototype.has=Kt,pe.prototype.set=de;var ve=pe;var he=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this};var _e=function(t){return this.__data__.has(t)};function ye(t){var e=-1,r=null==t?0:t.length;for(this.__data__=new fe;++e<r;)this.add(t[e])}ye.prototype.add=ye.prototype.push=he,ye.prototype.has=_e;var be=ye;var ge=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 Ee=function(t,e){return t.has(e)};var Oe=function(t,e,r,n,o,i){var a=1&r,u=t.length,c=e.length;if(u!=c&&!(a&&c>u))return!1;var s=i.get(t);if(s&&i.get(e))return s==e;var l=-1,f=!0,d=2&r?new be:void 0;for(i.set(t,e),i.set(e,t);++l<u;){var p=t[l],v=e[l];if(n)var h=a?n(v,p,l,e,t,i):n(p,v,l,t,e,i);if(void 0!==h){if(h)continue;f=!1;break}if(d){if(!ge(e,(function(t,e){if(!Ee(d,e)&&(p===t||o(p,t,r,n,i)))return d.push(e)}))){f=!1;break}}else if(p!==v&&!o(p,v,r,n,i)){f=!1;break}}return i.delete(t),i.delete(e),f},Te=A.Uint8Array;var me=function(t){var e=-1,r=Array(t.size);return t.forEach((function(t,n){r[++e]=[n,t]})),r};var Ie=function(t){var e=-1,r=Array(t.size);return t.forEach((function(t){r[++e]=t})),r},Re=j?j.prototype:void 0,Ae=Re?Re.valueOf:void 0;var je=function(t,e,r,n,o,i,a){switch(r){case"[object DataView]":if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case"[object ArrayBuffer]":return!(t.byteLength!=e.byteLength||!i(new Te(t),new Te(e)));case"[object Boolean]":case"[object Date]":case"[object Number]":return Lt(+t,+e);case"[object Error]":return t.name==e.name&&t.message==e.message;case"[object RegExp]":case"[object String]":return t==e+"";case"[object Map]":var u=me;case"[object Set]":var c=1&n;if(u||(u=Ie),t.size!=e.size&&!c)return!1;var s=a.get(t);if(s)return s==e;n|=2,a.set(t,e);var l=Oe(u(t),u(e),n,o,i,a);return a.delete(t),l;case"[object Symbol]":if(Ae)return Ae.call(t)==Ae.call(e)}return!1};var Ne=function(t,e){for(var r=-1,n=e.length,o=t.length;++r<n;)t[o+r]=e[r];return t};var we=function(t,e,r){var n=e(t);return lt(t)?n:Ne(n,r(t))};var De=function(t,e){for(var r=-1,n=null==t?0:t.length,o=0,i=[];++r<n;){var a=t[r];e(a,r,t)&&(i[o++]=a)}return i};var Pe=function(){return[]},Ce=Object.prototype.propertyIsEnumerable,Le=Object.getOwnPropertySymbols,Se=Le?function(t){return null==t?[]:(t=Object(t),De(Le(t),(function(e){return Ce.call(t,e)})))}:Pe;var ke=function(t){return we(t,Dt,Se)},Ue=Object.prototype.hasOwnProperty;var Me=function(t,e,r,n,o,i){var a=1&r,u=ke(t),c=u.length;if(c!=ke(e).length&&!a)return!1;for(var s=c;s--;){var l=u[s];if(!(a?l in e:Ue.call(e,l)))return!1}var f=i.get(t);if(f&&i.get(e))return f==e;var d=!0;i.set(t,e),i.set(e,t);for(var p=a;++s<c;){var v=t[l=u[s]],h=e[l];if(n)var _=a?n(h,v,l,e,t,i):n(v,h,l,t,e,i);if(!(void 0===_?v===h||o(v,h,r,n,i):_)){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 i.delete(t),i.delete(e),d},xe=X(A,"DataView"),Fe=X(A,"Promise"),Be=X(A,"Set"),ze=X(A,"WeakMap"),He=G(xe),Ye=G(Wt),Ge=G(Fe),Ke=G(Be),We=G(ze),Ve=U;(xe&&"[object DataView]"!=Ve(new xe(new ArrayBuffer(1)))||Wt&&"[object Map]"!=Ve(new Wt)||Fe&&"[object Promise]"!=Ve(Fe.resolve())||Be&&"[object Set]"!=Ve(new Be)||ze&&"[object WeakMap]"!=Ve(new ze))&&(Ve=function(t){var e=U(t),r="[object Object]"==e?t.constructor:void 0,n=r?G(r):"";if(n)switch(n){case He:return"[object DataView]";case Ye:return"[object Map]";case Ge:return"[object Promise]";case Ke:return"[object Set]";case We:return"[object WeakMap]"}return e});var Je=Ve,$e="[object Object]",qe=Object.prototype.hasOwnProperty;var Ze=function(t,e,r,n,o,i){var a=lt(t),u=lt(e),c=a?"[object Array]":Je(t),s=u?"[object Array]":Je(e),l=(c="[object Arguments]"==c?$e:c)==$e,f=(s="[object Arguments]"==s?$e:s)==$e,d=c==s;if(d&&dt(t)){if(!dt(e))return!1;a=!0,l=!1}if(d&&!l)return i||(i=new ve),a||Ot(t)?Oe(t,e,r,n,o,i):je(t,e,c,r,n,o,i);if(!(1&r)){var p=l&&qe.call(t,"__wrapped__"),v=f&&qe.call(e,"__wrapped__");if(p||v){var h=p?t.value():t,_=v?e.value():e;return i||(i=new ve),o(h,_,r,n,i)}}return!!d&&(i||(i=new ve),Me(t,e,r,n,o,i))};var Qe=function t(e,r,n,o,i){return e===r||(null==e||null==r||!ot(e)&&!ot(r)?e!=e&&r!=r:Ze(e,r,n,o,t,i))};var Xe=function(t,e,r,n){var o=r.length,i=o,a=!n;if(null==t)return!i;for(t=Object(t);o--;){var u=r[o];if(a&&u[2]?u[1]!==t[u[0]]:!(u[0]in t))return!1}for(;++o<i;){var c=(u=r[o])[0],s=t[c],l=u[1];if(a&&u[2]){if(void 0===s&&!(c in t))return!1}else{var f=new ve;if(n)var d=n(s,l,c,t,e,f);if(!(void 0===d?Qe(l,s,3,n,f):d))return!1}}return!0};var tr=function(t){return t==t&&!M(t)};var er=function(t){for(var e=Dt(t),r=e.length;r--;){var n=e[r],o=t[n];e[r]=[n,o,tr(o)]}return e};var rr=function(t,e){return function(r){return null!=r&&(r[t]===e&&(void 0!==e||t in Object(r)))}};var nr=function(t){var e=er(t);return 1==e.length&&e[0][2]?rr(e[0][0],e[0][1]):function(r){return r===t||Xe(r,t,e)}};var or=function(t){return"symbol"==typeof t||ot(t)&&"[object Symbol]"==U(t)},ir=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ar=/^\w*$/;var ur=function(t,e){if(lt(t))return!1;var r=typeof t;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=t&&!or(t))||(ar.test(t)||!ir.test(t)||null!=e&&t in Object(e))};function cr(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var r=function(){var n=arguments,o=e?e.apply(this,n):n[0],i=r.cache;if(i.has(o))return i.get(o);var a=t.apply(this,n);return r.cache=i.set(o,a)||i,a};return r.cache=new(cr.Cache||fe),r}cr.Cache=fe;var sr=cr;var lr=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,fr=/\\(\\)?/g,dr=function(t){var e=sr(t,(function(t){return 500===r.size&&r.clear(),t})),r=e.cache;return e}((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(lr,(function(t,r,n,o){e.push(n?o.replace(fr,"$1"):r||t)})),e}));var pr=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},vr=j?j.prototype:void 0,hr=vr?vr.toString:void 0;var _r=function t(e){if("string"==typeof e)return e;if(lt(e))return pr(e,t)+"";if(or(e))return hr?hr.call(e):"";var r=e+"";return"0"==r&&1/e==-1/0?"-0":r};var yr=function(t){return null==t?"":_r(t)};var br=function(t,e){return lt(t)?t:ur(t,e)?[t]:dr(yr(t))};var gr=function(t){if("string"==typeof t||or(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e};var Er=function(t,e){for(var r=0,n=(e=br(e,t)).length;null!=t&&r<n;)t=t[gr(e[r++])];return r&&r==n?t:void 0};var Or=function(t,e,r){var n=null==t?void 0:Er(t,e);return void 0===n?r:n};var Tr=function(t,e){return null!=t&&e in Object(t)};var mr=function(t,e,r){for(var n=-1,o=(e=br(e,t)).length,i=!1;++n<o;){var a=gr(e[n]);if(!(i=null!=t&&r(t,a)))break;t=t[a]}return i||++n!=o?i:!!(o=null==t?0:t.length)&&ht(o)&&vt(a,o)&&(lt(t)||st(t))};var Ir=function(t,e){return null!=t&&mr(t,e,Tr)};var Rr=function(t,e){return ur(t)&&tr(e)?rr(gr(t),e):function(r){var n=Or(r,t);return void 0===n&&n===e?Ir(r,t):Qe(e,n,3)}};var Ar=function(t){return t};var jr=function(t){return function(e){return null==e?void 0:e[t]}};var Nr=function(t){return function(e){return Er(e,t)}};var wr=function(t){return ur(t)?jr(gr(t)):Nr(t)};var Dr=function(t){return"function"==typeof t?t:null==t?Ar:"object"==typeof t?lt(t)?Rr(t[0],t[1]):nr(t):wr(t)};var Pr=function(t,e){var r={};return e=Dr(e),Pt(t,(function(t,n,o){et(r,n,e(t,n,o))})),r};var Cr=function(t){return"number"==typeof t||ot(t)&&"[object Number]"==U(t)},Lr=function(e){var r=e.css,n={};return Object.entries(r).forEach((function(e){var r=e[0],o=e[1];if(Cr(o))return t.isUnitlessNumber[r]?void(n[r]=""+o):void(n[r]=o+"px");n[r]=o})),y(y({},e),{css:y(y({},n),{boxSizing:"border-box"})})},Sr=function(t){return Pr(t,(function(t){var e=t;return"Typography"===e.type&&(e=function(t){var e=Or(t,"data.custom.variant","P");return y(y({},t),{type:e})}(e)),e.css&&M(e.css)&&e.css.flexBasis&&(e=function(t){var e=t.css.flexBasis;return"0"===e||"0px"===e?y(y({},t),{css:y(y({},t.css),{flexBasis:"0%"})}):t}(e)),e.css&&(e=Lr(e)),e}))};var kr,Ur="https://cdn.candu.ai",Mr="/api/checklistItems",xr="/api/cards",Fr="/api/segmentMemberships",Br="/api/segmentsDefinition",zr="/api/tutorialMetadata",Hr="/api/tutorialDocumentsSdk",Yr="wss://2jcfb7pjlf.execute-api.eu-west-1.amazonaws.com/prod",Gr=function(t){if(!document.querySelectorAll('[href="'+t+'"]').length){var e=document.createElement("link");e.setAttribute("rel","prefetch"),e.setAttribute("href",t),document.head.appendChild(e)}},Kr=function(t,e){t&&lt(t)&&t.map((function(t){var r=t.nodeType,n=t.url;return Gr("EmbedTutorial"===r?Ur+"/tutorials/"+e+"/"+n+".json":"EmbedPortal"===r?Ur+"/portals/"+e+"/"+n+"/head.json":n)}))},Wr=function(){function t(t){this.adjacencyList={},this.rootDocument=t,this.adjacencyList[t]=[]}return t.prototype.get=function(t){return this.adjacencyList[t]},t.prototype.add=function(t,e){var r=this;if(this.adjacencyList[t]||(this.adjacencyList[t]=[]),!this.adjacencyList[e])return this.adjacencyList[t].push(e),this.adjacencyList[e]=[],!0;if(this.adjacencyList[t].includes(e))return!0;var n=function(e){if(e===t)return!0;for(var o=0,i=r.adjacencyList[e];o<i.length;o++){var a=i[o];if(n(a))return!0}return!1};return!n(e)&&(this.adjacencyList[t].push(e),!0)},t}(),Vr=function(t,e){return{id:t,dependencies:e?e.dependencies:new Wr(t)}},Jr=function(t,e){return t.dependencies.add(t.id,e)},$r=function(t,r){var n=r.reduce((function(t,e){var r;return y(y({},t),((r={})[e]=e,r))}),{});return t.content.find((function(t){var r=t.segmentId;return!!n[r]||r===e}))},qr=function(t){return"candu.sdk."+t},Zr=function(t){return qr("error."+t)},Qr={UNKOWN_NODE_TYPE:"unknown_node_type",UNKOWN_BLOCK_NODE_TYPE:"unkown_block_node_type",UNKOWN_INLINE_NODE_TYPE:"unkown_inline_node_type",UNKOWN_NODE_OBJECT_TYPE:"unkown_node_object_type",TUTORIAL_ERROR:"tutorial_error_boundary",PORTAL_ERROR:"portal_error_boundary",PROVIDER_ERROR:"provider_error_boundary",STYLEGUIDE_MAP_ERROR:"styleguide_map",RENDER_NODE_ERROR:"render_node"},Xr={HEARTBEAT:qr("heartbeat"),PREVIEW_OPEN:qr("preview.open"),PORTAL:qr("portal"),TUTORIAL:qr("tutorial"),TUTORIAL_INTERACTION:qr("tutorial.interaction"),PORTAL_ASSET_NOT_FOUND:Zr("portal_asset_not_found"),PORTAL_NO_SEGMENT_IDS:Zr("portal_no_segment_ids"),NO_MATCHING_TUTORIALS:Zr("no_matching_tutorials"),NO_VALID_TUTORIAL_IDENTIFIER:Zr("no_valid_tutorial_identifier"),COMMIT_API_LOADING_ERROR:Zr("commit_api"),TUTORIAL_LOADING_ERROR:Zr("tutorial"),UNKOWN_NODE_TYPE:Zr(Qr.UNKOWN_NODE_TYPE),UNKOWN_INLINE_NODE_TYPE:Zr(Qr.UNKOWN_INLINE_NODE_TYPE),UNKOWN_NODE_OBJECT_TYPE:Zr(Qr.UNKOWN_NODE_OBJECT_TYPE),TUTORIAL_ERROR:Zr(Qr.TUTORIAL_ERROR),PORTAL_ERROR:Zr(Qr.PORTAL_ERROR),PROVIDER_ERROR:Zr(Qr.PROVIDER_ERROR),STYLEGUIDE_MAP_ERROR:Zr(Qr.TUTORIAL_ERROR),RENDER_NODE_ERROR:Zr(Qr.TUTORIAL_ERROR),CIRCULAR_DEPENDENCY_EMBED_PORTAL:Zr("circular_dependecy_embed_portal"),CIRCULAR_DEPENDENCY_EMBED_TUTORIAL:Zr("circular_dependecy_embed_tutorial"),STATE_FETCH_FAILED:Zr("state_fetch_failed"),STATE_UPDATE_FAILED:Zr("state_update_failed"),SEGMENT_MEMBERSHIP_TIMEOUT:Zr("segment_membership_timeout"),CHECKLIST_ITEM_STATE_UPDATED:qr("tutorial.checklist_item_state_updated"),CHECKLIST_GROUP_COMPLETE:qr("tutorial.checklist_group_complete"),CARD_DISMISSED:qr("tutorial.card_dismissed")},tn=function(t){return qr("metric."+t)},en={SEGMENT_MEMBERSHIP_LOAD_TIME:tn("segment_membership_load_time"),PORTAL_LOAD_TIME:tn("portal_load_time"),TUTORIAL_LOAD_TIME:tn("tutorial_load_time"),TUTORIAL_DOCUMENT_MOUNT_TIME:tn("tutorial_document_mount_time")},rn=function(t){return"An error has occured while trying to parse your Tutorial.\nUpgrade the SDK to the latest version to get rid of this error.\nErrorCode: "+t+"."},nn=((kr={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"})[Xr.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",kr[Xr.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",kr[Xr.NO_MATCHING_TUTORIALS]="The Tutorial will not be rendered because there are no matching segments for the given user.",kr[Xr.NO_VALID_TUTORIAL_IDENTIFIER]="(Candu/Tutorial) You must define one of tutorialId, slug, commitId or contentHashId.",kr[Xr.TUTORIAL_LOADING_ERROR]="An error has occurred while trying to load the Tutorial",kr[Xr.UNKOWN_INLINE_NODE_TYPE]=rn(Qr.UNKOWN_INLINE_NODE_TYPE),kr[Xr.UNKOWN_NODE_TYPE]=rn(Qr.UNKOWN_NODE_TYPE),kr[Xr.CIRCULAR_DEPENDENCY_EMBED_PORTAL]="Circular dependency found on Embeded Portal. Please take a look at the Portal Content.",kr[Xr.CIRCULAR_DEPENDENCY_EMBED_TUTORIAL]="Circular dependency found on Embeded Tutorial. Please take a look at the Tutorial Content.",kr[Xr.PORTAL_ERROR]="An error has occured within Portal",kr[Xr.PROVIDER_ERROR]="An error has occured within Provider",kr[Xr.TUTORIAL_ERROR]="An error has occured within Tutorial",kr[Xr.RENDER_NODE_ERROR]="An error has occured while rendering tutorial node",kr[Xr.STYLEGUIDE_MAP_ERROR]="An error has occured while mapping node to styleguide",kr[Xr.STATE_FETCH_FAILED]="An error has occured while fetching state:",kr[Xr.STATE_UPDATE_FAILED]="An error has occured while updating state:",kr[Xr.SEGMENT_MEMBERSHIP_TIMEOUT]="Segment membership fetch has timed out",kr),on={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},an={error:console.error,warning:console.warn},un=function(t){var e=t.identify,r=t.track;return{provider:function(t){var n=t.userId,o=t.traits,i=t.styleguide;e(n,o),r(Xr.HEARTBEAT,function(t){var e={};return Object.keys(t).forEach((function(r){on[r]&&(e["styleguide."+r]=t[r].displayName||!0)})),e}(i))},tutorialDocumentLoadingError:function(t){var e=t.tutorialId,n=t.slug,o=t.contentHashId;an.error(nn[Xr.TUTORIAL_LOADING_ERROR]),r(Xr.TUTORIAL_LOADING_ERROR,{tutorialId:e,slug:n,contentHashId:o})}}},cn=function(t){return p(!t||M(t),"(Candu) styleguide must be undefined or an object")},sn=function(t){var e=t.clientToken,o=t.userId,i=t.traits,a=t.options,u=t.styleguide,c=b(t,["clientToken","userId","traits","options","styleguide"]);return p(r(e),"(Candu) you must provide a valid clientToken"),p(!o||n(o),"(Candu) you must provide a valid userId"),cn(u),p(!i||M(i),"(Candu) traits must be undefined or an object"),p(!a||M(a),"(Candu) options must be undefined or an object"),y(y({},c),{clientToken:e,traits:i||{},options:a||{},styleguide:u||{},userId:o||d()})},ln=function(t){var e=t.slug,r=t.styleguide,n=t.contentHashId,o=t.tutorialId,i=t.tutorialDocument,a=t.renderedByClient,u=b(t,["slug","styleguide","contentHashId","tutorialId","tutorialDocument","renderedByClient"]);return cn(r),y(y({},u),{slug:e,styleguide:r||{},contentHashId:n,tutorialId:o,tutorialDocument:i,renderedByClient:a})},fn=function(t){var e=t.slug,r=t.styleguide;return cn(r),{slug:e,styleguide:r||{}}},dn=function(t,e){return g(void 0,void 0,void 0,(function(){return E(this,(function(r){switch(r.label){case 0:return[4,fetch(t,e&&{headers:e})];case 1:return[2,r.sent().json()]}}))}))},pn=function(t){return dn("https://api.candu.ai"+t,{SDKVersion:"0.7.1-alpha.6"})},vn=function(t){return dn(""+Ur+t,{SDKVersion:"0.7.1-alpha.6"})},hn={tutorialDocumentLatestSaved:function(t,e){return g(void 0,void 0,void 0,(function(){return E(this,(function(r){return[2,pn(Hr+"/"+e+"?token="+t)]}))}))},portalAsset:function(t,e,r){return g(void 0,void 0,void 0,(function(){var n,o;return E(this,(function(i){return(null===(o=r)||void 0===o?void 0:o.length)?(n="?segmentIds="+r.join(","),[2,vn("/portalMemberships/"+t+"/"+e+"/head.json"+n)]):[2,vn("/portals/"+t+"/"+e+"/head.json")]}))}))},segmentMembership:function(t,e){return g(void 0,void 0,void 0,(function(){return E(this,(function(r){return[2,pn(Fr+"/"+e+"?token="+t)]}))}))},segmentDefinition:function(t){return g(void 0,void 0,void 0,(function(){return E(this,(function(e){return[2,pn(Br+"?token="+t)]}))}))},tutorialMetadata:function(t){return g(void 0,void 0,void 0,(function(){return E(this,(function(e){return[2,pn(zr+"?token="+t)]}))}))},tutorialSocket:function(t,e,r){var n=new WebSocket(Yr+"?clientToken="+t+"&tutorialId="+e);return n.onmessage=function(t){var e=JSON.parse(t.data);r(e)},function(){return n.close()}},tutorialDocument:function(t,e,r){var n=t.contentHashId,u=t.tutorialId,c=t.tutorialDocument,s=t.slug,l=function(t){return{byId:function(e){return pn(Hr+"?token="+t+"&finder=latestPublished&tutorialId="+e)},bySlug:function(e){return vn("/tutorials/"+t+"/"+e+".json")},byContentHash:function(e){return vn("/tutorials/"+t+"/"+e+".json")}}}(e);return o(s)?l.bySlug(s):i(u)?l.byId(u):a(n)?l.byContentHash(n):M(c)?Promise.resolve(c):(an.error(nn[Xr.NO_VALID_TUTORIAL_IDENTIFIER]),r.track(Xr.NO_VALID_TUTORIAL_IDENTIFIER,{slug:t.slug}),null)}},_n=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return console.error.apply(console,t)},yn=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return console.warn.apply(console,t)},bn={error:_n,warning:yn},gn=function(t){return t.replace(/\s/g,"&nbsp;")},En=function(t){return DOMParser?(new DOMParser).parseFromString(t,"text/html").body.textContent||"":t},On=function(){function t(){this.subscribers=[]}return t.prototype.subscribe=function(t){var e=this;return this.subscribers.push(t),function(){e.subscribers[e.subscribers.indexOf(t)]=function(){}}},t.prototype.notify=function(t){this.subscribers.forEach((function(e){return e(t)}))},t.prototype.clear=function(){this.subscribers=[]},t}(),Tn=function(){function t(){this.onClientUpdateObserver=new On}return t.prototype.attachClient=function(t){this.client=t,this.onClientUpdateObserver.notify({client:t})},t.prototype.detachClient=function(){this.client&&(this.client=null,this.onClientUpdateObserver.notify({client:null}))},t.prototype.onClientUpdate=function(t){var e=this.onClientUpdateObserver.subscribe(t);return this.client&&t({client:this.client}),e},t}(),mn=function(t){return t.lastModifiedAt===t.lastPublishedAt?"Published":t.lastPublishedAt?"Unsynced":"Draft"};function In(t){var e,r,n=function(t){return function(){for(var e,n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];if(r.api)return(e=r.api)[t].apply(e,n);console.warn("Please initialize the SDK by calling Candu.init() before attempting to call "+t)}};return(e=function(){function e(){}return e.init=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return this.api||(e.api=new(t.bind.apply(t,O([void 0],r)))),e.subscriberCallbacks.forEach((function(t){return t()})),e.subscriberCallbacks=[],window.postMessage({source:"CANDU_SINGLETON",payload:{type:"INIT"}},window&&window.origin?window.origin:"*"),e},e.onProviderReady=function(t){if(e.api)return t();e.subscriberCallbacks.push(t)},e}()).subscriberCallbacks=[],e.renderTutorial=n("renderTutorial"),e.renderPortal=n("renderPortal"),e.attachClient=n("attachClient"),e.detachClient=n("detachClient"),e.getProvider=n("getProvider"),e.getInfo=n("getInfo"),r=e,window.Candu=r,r}var Rn="/home/runner/work/candu-sdk/candu-sdk/packages/candu-core/dist/core.es.js",An="0.7.1-alpha.6",jn=function(){function t(t){this.init(t)}return t.prototype.getInfo=function(){return{core:{version:An,name:Rn},sdk:{version:this.version,name:this.name}}},t.prototype.attachClient=function(t){return this.provider.preview.attachClient(t)},t.prototype.detachClient=function(){return this.provider.preview.detachClient()},Object.defineProperty(t.prototype,"provider",{get:function(){return this.getProvider()},enumerable:!0,configurable:!0}),t}(),Nn=function(t){switch(t.trigger){case u.ON_CLICK:default:return"onClick"}},wn=function(t,e){var r,n,o,i,a,s;if("Link"===t.type&&(null===(r=t.props)||void 0===r?void 0:r.href)){var l=t.props.href+" Link Clicked",f=null===(o=null===(n=t)||void 0===n?void 0:n.nodes)||void 0===o?void 0:o[0];if(f){var d=e.document.nodes[f];"Text"===(null===(i=d)||void 0===i?void 0:i.type)&&(null===(s=null===(a=d)||void 0===a?void 0:a.props)||void 0===s?void 0:s.children)&&(l=d.props.children+" Link Clicked")}return{onClick:function(){var r;return e.provider.eventing.track(Xr.TUTORIAL_INTERACTION,{trigger:u.ON_CLICK,category:t.type,eventName:l,handler:{href:null===(r=t.props)||void 0===r?void 0:r.href,type:c.NAVIGATE}})}}}if(!t.data||!t.data.actions)return{};var p=function(t,r){e.provider.eventing.track(Xr.TUTORIAL_INTERACTION,y(y({},t),r||{}))};return t.data.actions.map((function(t){return function(t,e,r){var n,o,i;switch(t.handler.type){case c.NAVIGATE:return(n={})[Nn(t)]=function(n){n.stopPropagation();var o=t.handler,i=o.href,a=o.target,u=r||{},c=u.parentTrackers,s=b(u,["parentTrackers"]);c&&c.forEach((function(r){return e(t,r)})),e(t,s),"Blank"===a?window.open(i,"_blank"):i&&i.includes("mailto:")?window.location=i:document.location.href=i},n;case c.CHANGE_TUTORIAL:return(o={})[Nn(t)]=function(){var e=t.handler.tutorialId;_n("TODO -> change tutorial",e)},o;case c.OPEN_GUIDE:return(i={})[Nn(t)]=function(){var e=t.handler.guideId;_n("TODO -> open guide",e)},i;default:return{}}}(t,p,e.trackingIdentifiers)})).reduce((function(t,e){return y(y({},t),e)}),{})},Dn=function(t,e){var r=t.props||{},n=t.nodes,o=r.children;return o||(n?n.map(e):null)},Pn=function(t,e){var r=t.states;return r&&e.stateProviderInstances.filter((function(t){return!!r[t.providerId]}))},Cn=function(t,e){var r=t.nodes;return r&&r.map((function(t){return e.document.nodes[t]})).filter((function(t){return!!t})).map((function(t){return Pn(t,e)||[]})).reduce((function(t,e){return t.concat(e)}),[])},Ln=function(t,e){try{var r=e.provider,n=e.document,o=e.trackingIdentifiers,i=n.nodes[t];if(!i)return bn.error("Document is corrupted. Refusing to move further."),null;var a=function(t){return Ln(t,e)},u=i.type,c=i.props,s=i.css,l=y(y(y({},c||{}),{style:s||{},children:Dn(i,a)}),wn(i,{trackingIdentifiers:o,provider:r,document:n})),f={nodeId:t,node:i,document:n,render:{node:a,styleguide:function(t,r){return void 0===r&&(r={}),e.renderNode(t,{api:f,attributes:r})},tutorial:function(t){return e.renderTutorial(t)},portal:function(t){return e.renderPortal(t)}},trackingIdentifiers:o,stateInstances:Pn(i,e),childrenStateInstances:Cn(i,e)},d=f.render.styleguide(u,l);return d||(bn.error(nn[Xr.UNKOWN_NODE_TYPE],{type:u}),r.eventing.error(new Error(nn[Xr.UNKOWN_NODE_TYPE]),{type:u}),null)}catch(t){return bn.error(nn[Xr.STYLEGUIDE_MAP_ERROR],t),e.provider.eventing.error(t),null}},Sn=sr((function(t,e){var r,n,o=t.provider,i=t.portal,a=t.tutorial,u=o.styleguide;return a&&(n=a.styleguide),i&&(r=i.styleguide),y(y(y(y({},u||{}),r||{}),n||{}),e||{})})),kn="",Un="#EDEDED",Mn="#333745",xn="#838792",Fn="#FEFEFE",Bn="#FEFEFE",zn={primary:"#6310E5",secondary:"#59C3C3",tertiary:"#4D515D",warning:"#FCAD0D",danger:"#EE4266"},Hn=function(t){return"candu-styleguide-"+t},Yn=function(t,e){void 0===e&&(e="main");var r=Hn(t);if(!document.getElementById(r)){var n=document.createElement("link");n.setAttribute("id",r),n.setAttribute("rel","stylesheet"),n.setAttribute("href",Ur+"/styleguides/applications/"+t+"/default/"+e+".css"),document.head.appendChild(n)}},Gn=function(t){var e=document.getElementById(Hn(t));e&&e.remove()},Kn=function(t,e){var r,n,o,i,a="string"==typeof e&&e.split(" ");return a?1===a.length?((r={})[t+"Right"]=e,r[t+"Left"]=e,r[t+"Bottom"]=e,r[t+"Top"]=e,r):2===a.length?((n={})[t+"Top"]=a[0],n[t+"Right"]=a[1],n[t+"Bottom"]=a[0],n[t+"Left"]=a[1],n):3===a.length?((o={})[t+"Top"]=a[0],o[t+"Right"]=a[1],o[t+"Bottom"]=a[2],o[t+"Left"]=a[1],o):((i={})[t+"Top"]=a[0],i[t+"Right"]=a[1],i[t+"Bottom"]=a[2],i[t+"Left"]=a[3],i):{}},Wn=function(t){var e=t.padding,r=t.margin,n=b(t,["padding","margin"]),o={};return e&&(o=y(y({},o),Kn("padding",e))),r&&(o=y(y({},o),Kn("margin",r))),y(y({},o),n)};var Vn=function(t,e){return function(r,n){if(null==r)return r;if(!wt(r))return t(r,n);for(var o=r.length,i=e?o:-1,a=Object(r);(e?i--:++i<o)&&!1!==n(a[i],i,a););return r}}(Pt);var Jn=function(t,e){var r=-1,n=wt(t)?Array(t.length):[];return Vn(t,(function(t,o,i){n[++r]=e(t,o,i)})),n};var $n=function(t,e){return(lt(t)?pr:Jn)(t,Dr(e))},qn=function(){function t(t,e,r){var n=this;this.observer=new On,this.context=t,this.providerId=e,this.resolver=r,this.state=this.resolver.cache.load(this.providerId),this.resolver.retrieve(t,e).then((function(t){return n.updateState(t)})).catch((function(t){bn.error(nn[Xr.STATE_FETCH_FAILED],t.message),n.context.eventing.track(nn[Xr.STATE_FETCH_FAILED],{errorMessage:t.message})}))}return t.prototype.mutate=function(t){var e=this,r=this.state;this.updateState(y(y({},r),t)),this.resolver.update(this.context,this.providerId,t).then((function(t){return e.updateState(t)})).catch((function(t){bn.error(nn[Xr.STATE_UPDATE_FAILED],t.message),e.context.eventing.track(nn[Xr.STATE_UPDATE_FAILED],{errorMessage:t.message}),r&&e.updateState(r)}))},t.prototype.subscribe=function(t){var e=this.observer.subscribe(t);return this.state&&t(this.state),e},t.prototype.getResolvedState=function(){return this.state},t.prototype.updateState=function(t){this.state=t,this.resolver.cache.save(this.providerId,t),this.observer.notify(t)},t}(),Zn=function(){function t(t){void 0===t&&(t="candu-state:"),this.prefix=t}return t.prototype.save=function(t,e){try{window.localStorage.setItem(this.prefix+t,JSON.stringify(e))}catch(t){}},t.prototype.load=function(t){try{var e=window.localStorage.getItem(this.prefix+t);return e&&JSON.parse(e)}catch(t){return null}},t}(),Qn=Object.create(null),Xn=function(){function t(t){this.cache=new Zn,this.options=y({},t||{})}return t.register=function(t,e){Qn[t]=e,e.prototype.type=t},t.fromJSON=function(t){var e=t.type,r=b(t,["type"]),n=Qn[e];return n?new n(r):null},t.prototype.toJSON=function(){return y({type:this.type},this.options)},t}();var to=function(t,e,r,n){for(var o=t.length,i=r+(n?1:-1);n?i--:++i<o;)if(e(t[i],i,t))return i;return-1};var eo=function(t){return t!=t};var ro=function(t,e,r){for(var n=r-1,o=t.length;++n<o;)if(t[n]===e)return n;return-1};var no=function(t,e,r){return e==e?ro(t,e,r):to(t,eo,r)};var oo=function(t,e){return!!(null==t?0:t.length)&&no(t,e,0)>-1};var io=function(t,e,r){for(var n=-1,o=null==t?0:t.length;++n<o;)if(r(e,t[n]))return!0;return!1};var ao=function(){},uo=Be&&1/Ie(new Be([,-0]))[1]==1/0?function(t){return new Be(t)}:ao;var co=function(t,e,r){var n=-1,o=oo,i=t.length,a=!0,u=[],c=u;if(r)a=!1,o=io;else if(i>=200){var s=e?null:uo(t);if(s)return Ie(s);a=!1,o=Ee,c=new be}else c=e?[]:u;t:for(;++n<i;){var l=t[n],f=e?e(l):l;if(l=r||0!==l?l:0,a&&f==f){for(var d=c.length;d--;)if(c[d]===f)continue t;e&&c.push(f),u.push(l)}else o(c,f,r)||(c!==u&&c.push(f),u.push(l))}return u};var so=function(t){return t&&t.length?co(t):[]},lo=function(){function t(){}return t.get=function(e,r){var n=t.loaders.get(e);if(n)return n;var o=new v(r,{cache:!1});return t.loaders.set(e,o),o},t.loaders=new Map,t}(),fo="https://api.candu.ai"+xr,po=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return _(e,t),e.prototype.retrieve=function(t,e){return g(this,void 0,void 0,(function(){var r,n,o=this;return E(this,(function(i){switch(i.label){case 0:return[4,lo.get("cardStateApi",(function(e){return g(o,void 0,void 0,(function(){var r;return E(this,(function(n){switch(n.label){case 0:return[4,fetch(fo+"?token="+t.clientToken+"&finder=byIds&ids="+so(e).join(",")+"&userId="+t.userId).then((function(t){return t.json()}))];case 1:return r=n.sent(),[2,e.map((function(t){return r.find((function(e){return e.id===t}))}))]}}))}))})).load(e)];case 1:return r=i.sent(),n={id:e,state:{dismissed:!1}},[2,r||n]}}))}))},e.prototype.update=function(t,e,r){return fetch(fo+"/"+e+"?token="+t.clientToken,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({state:r.state,userId:t.userId.toString()})}).then((function(t){return t.json()}))},e}(Xn);Xn.register(s.CardApi,po);var vo="https://api.candu.ai"+Mr;function ho(t){return{state:t.state,id:t.id}}function _o(t){switch(t){case l.Account:return"AccountId";case l.User:default:return"UserId"}}var yo=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return _(e,t),e.prototype.getScopeAndFieldFromContext=function(t){var e=this.options.scopeTrait,r=this.options.scope||l.User,n=t.userId.toString();return r===l.Account&&(e&&t.traits[e]?n=t.traits[e]:(yn("trait '"+e+"' is not defined, falling back to user scope"),r=l.User)),{scope:r,scopeField:n}},e.prototype.retrieve=function(t,e){return g(this,void 0,void 0,(function(){var r,n,o,i=this;return E(this,(function(a){switch(a.label){case 0:return r=this.getScopeAndFieldFromContext(t),n=r.scope,o=r.scopeField,[4,lo.get("checklistState",(function(e){return g(i,void 0,void 0,(function(){var r;return E(this,(function(i){switch(i.label){case 0:return[4,fetch(vo+"?token="+t.clientToken+"&byTrait="+_o(n)+"&field="+o+"&finder=byIds&ids="+so(e).join(",")).then((function(t){return t.json()})).then((function(t){return t.map(ho)}))];case 1:return r=i.sent(),[2,e.map((function(t){return r.find((function(e){return e.id===t}))}))]}}))}))})).load(e)];case 1:return[2,a.sent()||{id:e,state:f.NotStared}]}}))}))},e.prototype.update=function(t,e,r){var n=this.getScopeAndFieldFromContext(t),o=n.scope,i=n.scopeField;return fetch(vo+"/"+e+"?token="+t.clientToken,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(y(y({},r),{byTrait:_o(o),field:i}))}).then((function(t){return t.json()})).then(ho)},e}(Xn);function bo(t,e){return $n(t,(function(t,r){var n=Xn.fromJSON(t.resolver);return n?new qn(e,r,n):null})).filter((function(t){return!!t}))}Xn.register(s.CheckListApi,yo);var go=function(t,e){for(var r=Object.values(t),n=function(t){var e=r.find((function(e){return e.position===t}));if(!e||e.status===f.NotStared)return{value:t}},o=0;o<e;o+=1){var i=n(o);if("object"==typeof i)return i.value}},Eo=function(t,e){var r=Object.values(t).filter((function(t){return t.status===f.Done})).length;return{completedItems:r,percComplete:e?Math.round(100*r/e):0}},Oo=function(t){return t.filter((function(t){return t.resolver instanceof yo}))},To=function(t){var e={};return t.forEach((function(t,r){var n=t.getResolvedState();n&&(e[n.id]={status:n.state,position:r})})),e};export{po as CardResolverInstance,yo as CheckListResolverInstance,Un as DEFAULT_ALERT_COLOR,kn as DEFAULT_ALT,Fn as DEFAULT_TAB_ACTIVE_COLOR,Bn as DEFAULT_TAB_COLOR,Mn as DEFAULT_TAB_HEADER_COLOR,xn as DEFAULT_TAB_ITEM_COLOR,nn as ERROR_MESSAGES,Qr as ERROR_SLUGS,Xr as EVENT_NAMES,an as LOGGER,en as METRICS,On as Observer,Tn as PreviewContainer,hn as RESOURCES,zn as STYLEGUIDE_COLORS,jn as SingletonAPI,qn as StateProviderInstance,Xn as StateResolverInstance,Wr as TutorialDependencies,Sr as adaptCustomNodes,Yn as attachStylesheet,Eo as calculateGroupCompletion,Jr as checkCyclicAndAdd,In as createSingleton,Vr as createTutorialDocumentContext,on as defaultStyleguide,Gn as detachStylesheet,Kr as fetchHead,$r as findMatchingSegment,Oo as getCheckListStateProviders,mn as getContentState,go as getFirstNotStartedItem,To as getInitialItems,gn as includeHTMLWhitespaces,bo as initStateProviders,un as internalEventing,_n as logError,yn as logWarning,bn as logger,Ln as mapNodeToStyleguide,Sn as mergeStyleguidesFromContext,Lr as normalizeCss,fn as portalValidation,sn as providerValidation,En as stripHTML,ln as tutorialValidation,Wn as unpackShorthandStyles};
***************************************************************************** */var h=function(t,e){return(h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)};function _(t,e){function r(){this.constructor=t}h(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var y=function(){return(y=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function b(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r}function g(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}c((n=n.apply(t,e||[])).next())}))}function E(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}function O(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;var n=Array(t),o=0;for(e=0;e<r;e++)for(var i=arguments[e],a=0,u=i.length;a<u;a++,o++)n[o]=i[a];return n}var T="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function m(t){var e={exports:{}};return t(e,e.exports),e.exports}var I="object"==typeof T&&T&&T.Object===Object&&T,R="object"==typeof self&&self&&self.Object===Object&&self,A=I||R||Function("return this")(),j=A.Symbol,N=Object.prototype,w=N.hasOwnProperty,D=N.toString,P=j?j.toStringTag:void 0;var C=function(t){var e=w.call(t,P),r=t[P];try{t[P]=void 0;var n=!0}catch(t){}var o=D.call(t);return n&&(e?t[P]=r:delete t[P]),o},L=Object.prototype.toString;var S=function(t){return L.call(t)},k=j?j.toStringTag:void 0;var U=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":k&&k in Object(t)?C(t):S(t)};var M=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)};var x,F=function(t){if(!M(t))return!1;var e=U(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e},B=A["__core-js_shared__"],z=(x=/[^.]+$/.exec(B&&B.keys&&B.keys.IE_PROTO||""))?"Symbol(src)_1."+x:"";var H=function(t){return!!z&&z in t},Y=Function.prototype.toString;var G=function(t){if(null!=t){try{return Y.call(t)}catch(t){}try{return t+""}catch(t){}}return""},K=/^\[object .+?Constructor\]$/,W=Function.prototype,V=Object.prototype,J=W.toString,$=V.hasOwnProperty,q=RegExp("^"+J.call($).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var Z=function(t){return!(!M(t)||H(t))&&(F(t)?q:K).test(G(t))};var Q=function(t,e){return null==t?void 0:t[e]};var X=function(t,e){var r=Q(t,e);return Z(r)?r:void 0},tt=function(){try{var t=X(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();var et=function(t,e,r){"__proto__"==e&&tt?tt(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r};var rt=function(t){return function(e,r,n){for(var o=-1,i=Object(e),a=n(e),u=a.length;u--;){var c=a[t?u:++o];if(!1===r(i[c],c,i))break}return e}}();var nt=function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n};var ot=function(t){return null!=t&&"object"==typeof t};var it=function(t){return ot(t)&&"[object Arguments]"==U(t)},at=Object.prototype,ut=at.hasOwnProperty,ct=at.propertyIsEnumerable,st=it(function(){return arguments}())?it:function(t){return ot(t)&&ut.call(t,"callee")&&!ct.call(t,"callee")},lt=Array.isArray;var ft=function(){return!1},dt=m((function(t,e){var r=e&&!e.nodeType&&e,n=r&&t&&!t.nodeType&&t,o=n&&n.exports===r?A.Buffer:void 0,i=(o?o.isBuffer:void 0)||ft;t.exports=i})),pt=/^(?:0|[1-9]\d*)$/;var vt=function(t,e){var r=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==r||"symbol"!=r&&pt.test(t))&&t>-1&&t%1==0&&t<e};var ht=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991},_t={};_t["[object Float32Array]"]=_t["[object Float64Array]"]=_t["[object Int8Array]"]=_t["[object Int16Array]"]=_t["[object Int32Array]"]=_t["[object Uint8Array]"]=_t["[object Uint8ClampedArray]"]=_t["[object Uint16Array]"]=_t["[object Uint32Array]"]=!0,_t["[object Arguments]"]=_t["[object Array]"]=_t["[object ArrayBuffer]"]=_t["[object Boolean]"]=_t["[object DataView]"]=_t["[object Date]"]=_t["[object Error]"]=_t["[object Function]"]=_t["[object Map]"]=_t["[object Number]"]=_t["[object Object]"]=_t["[object RegExp]"]=_t["[object Set]"]=_t["[object String]"]=_t["[object WeakMap]"]=!1;var yt=function(t){return ot(t)&&ht(t.length)&&!!_t[U(t)]};var bt=function(t){return function(e){return t(e)}},gt=m((function(t,e){var r=e&&!e.nodeType&&e,n=r&&t&&!t.nodeType&&t,o=n&&n.exports===r&&I.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})),Et=gt&&gt.isTypedArray,Ot=Et?bt(Et):yt,Tt=Object.prototype.hasOwnProperty;var mt=function(t,e){var r=lt(t),n=!r&&st(t),o=!r&&!n&&dt(t),i=!r&&!n&&!o&&Ot(t),a=r||n||o||i,u=a?nt(t.length,String):[],c=u.length;for(var s in t)!e&&!Tt.call(t,s)||a&&("length"==s||o&&("offset"==s||"parent"==s)||i&&("buffer"==s||"byteLength"==s||"byteOffset"==s)||vt(s,c))||u.push(s);return u},It=Object.prototype;var Rt=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||It)};var At=function(t,e){return function(r){return t(e(r))}}(Object.keys,Object),jt=Object.prototype.hasOwnProperty;var Nt=function(t){if(!Rt(t))return At(t);var e=[];for(var r in Object(t))jt.call(t,r)&&"constructor"!=r&&e.push(r);return e};var wt=function(t){return null!=t&&ht(t.length)&&!F(t)};var Dt=function(t){return wt(t)?mt(t):Nt(t)};var Pt=function(t,e){return t&&rt(t,e,Dt)};var Ct=function(){this.__data__=[],this.size=0};var Lt=function(t,e){return t===e||t!=t&&e!=e};var St=function(t,e){for(var r=t.length;r--;)if(Lt(t[r][0],e))return r;return-1},kt=Array.prototype.splice;var Ut=function(t){var e=this.__data__,r=St(e,t);return!(r<0)&&(r==e.length-1?e.pop():kt.call(e,r,1),--this.size,!0)};var Mt=function(t){var e=this.__data__,r=St(e,t);return r<0?void 0:e[r][1]};var xt=function(t){return St(this.__data__,t)>-1};var Ft=function(t,e){var r=this.__data__,n=St(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this};function Bt(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])}}Bt.prototype.clear=Ct,Bt.prototype.delete=Ut,Bt.prototype.get=Mt,Bt.prototype.has=xt,Bt.prototype.set=Ft;var zt=Bt;var Ht=function(){this.__data__=new zt,this.size=0};var Yt=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r};var Gt=function(t){return this.__data__.get(t)};var Kt=function(t){return this.__data__.has(t)},Wt=X(A,"Map"),Vt=X(Object,"create");var Jt=function(){this.__data__=Vt?Vt(null):{},this.size=0};var $t=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},qt=Object.prototype.hasOwnProperty;var Zt=function(t){var e=this.__data__;if(Vt){var r=e[t];return"__lodash_hash_undefined__"===r?void 0:r}return qt.call(e,t)?e[t]:void 0},Qt=Object.prototype.hasOwnProperty;var Xt=function(t){var e=this.__data__;return Vt?void 0!==e[t]:Qt.call(e,t)};var te=function(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=Vt&&void 0===e?"__lodash_hash_undefined__":e,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=Jt,ee.prototype.delete=$t,ee.prototype.get=Zt,ee.prototype.has=Xt,ee.prototype.set=te;var re=ee;var ne=function(){this.size=0,this.__data__={hash:new re,map:new(Wt||zt),string:new re}};var oe=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t};var ie=function(t,e){var r=t.__data__;return oe(e)?r["string"==typeof e?"string":"hash"]:r.map};var ae=function(t){var e=ie(this,t).delete(t);return this.size-=e?1:0,e};var ue=function(t){return ie(this,t).get(t)};var ce=function(t){return ie(this,t).has(t)};var se=function(t,e){var r=ie(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this};function le(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])}}le.prototype.clear=ne,le.prototype.delete=ae,le.prototype.get=ue,le.prototype.has=ce,le.prototype.set=se;var fe=le;var de=function(t,e){var r=this.__data__;if(r instanceof zt){var n=r.__data__;if(!Wt||n.length<199)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new fe(n)}return r.set(t,e),this.size=r.size,this};function pe(t){var e=this.__data__=new zt(t);this.size=e.size}pe.prototype.clear=Ht,pe.prototype.delete=Yt,pe.prototype.get=Gt,pe.prototype.has=Kt,pe.prototype.set=de;var ve=pe;var he=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this};var _e=function(t){return this.__data__.has(t)};function ye(t){var e=-1,r=null==t?0:t.length;for(this.__data__=new fe;++e<r;)this.add(t[e])}ye.prototype.add=ye.prototype.push=he,ye.prototype.has=_e;var be=ye;var ge=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 Ee=function(t,e){return t.has(e)};var Oe=function(t,e,r,n,o,i){var a=1&r,u=t.length,c=e.length;if(u!=c&&!(a&&c>u))return!1;var s=i.get(t);if(s&&i.get(e))return s==e;var l=-1,f=!0,d=2&r?new be:void 0;for(i.set(t,e),i.set(e,t);++l<u;){var p=t[l],v=e[l];if(n)var h=a?n(v,p,l,e,t,i):n(p,v,l,t,e,i);if(void 0!==h){if(h)continue;f=!1;break}if(d){if(!ge(e,(function(t,e){if(!Ee(d,e)&&(p===t||o(p,t,r,n,i)))return d.push(e)}))){f=!1;break}}else if(p!==v&&!o(p,v,r,n,i)){f=!1;break}}return i.delete(t),i.delete(e),f},Te=A.Uint8Array;var me=function(t){var e=-1,r=Array(t.size);return t.forEach((function(t,n){r[++e]=[n,t]})),r};var Ie=function(t){var e=-1,r=Array(t.size);return t.forEach((function(t){r[++e]=t})),r},Re=j?j.prototype:void 0,Ae=Re?Re.valueOf:void 0;var je=function(t,e,r,n,o,i,a){switch(r){case"[object DataView]":if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case"[object ArrayBuffer]":return!(t.byteLength!=e.byteLength||!i(new Te(t),new Te(e)));case"[object Boolean]":case"[object Date]":case"[object Number]":return Lt(+t,+e);case"[object Error]":return t.name==e.name&&t.message==e.message;case"[object RegExp]":case"[object String]":return t==e+"";case"[object Map]":var u=me;case"[object Set]":var c=1&n;if(u||(u=Ie),t.size!=e.size&&!c)return!1;var s=a.get(t);if(s)return s==e;n|=2,a.set(t,e);var l=Oe(u(t),u(e),n,o,i,a);return a.delete(t),l;case"[object Symbol]":if(Ae)return Ae.call(t)==Ae.call(e)}return!1};var Ne=function(t,e){for(var r=-1,n=e.length,o=t.length;++r<n;)t[o+r]=e[r];return t};var we=function(t,e,r){var n=e(t);return lt(t)?n:Ne(n,r(t))};var De=function(t,e){for(var r=-1,n=null==t?0:t.length,o=0,i=[];++r<n;){var a=t[r];e(a,r,t)&&(i[o++]=a)}return i};var Pe=function(){return[]},Ce=Object.prototype.propertyIsEnumerable,Le=Object.getOwnPropertySymbols,Se=Le?function(t){return null==t?[]:(t=Object(t),De(Le(t),(function(e){return Ce.call(t,e)})))}:Pe;var ke=function(t){return we(t,Dt,Se)},Ue=Object.prototype.hasOwnProperty;var Me=function(t,e,r,n,o,i){var a=1&r,u=ke(t),c=u.length;if(c!=ke(e).length&&!a)return!1;for(var s=c;s--;){var l=u[s];if(!(a?l in e:Ue.call(e,l)))return!1}var f=i.get(t);if(f&&i.get(e))return f==e;var d=!0;i.set(t,e),i.set(e,t);for(var p=a;++s<c;){var v=t[l=u[s]],h=e[l];if(n)var _=a?n(h,v,l,e,t,i):n(v,h,l,t,e,i);if(!(void 0===_?v===h||o(v,h,r,n,i):_)){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 i.delete(t),i.delete(e),d},xe=X(A,"DataView"),Fe=X(A,"Promise"),Be=X(A,"Set"),ze=X(A,"WeakMap"),He=G(xe),Ye=G(Wt),Ge=G(Fe),Ke=G(Be),We=G(ze),Ve=U;(xe&&"[object DataView]"!=Ve(new xe(new ArrayBuffer(1)))||Wt&&"[object Map]"!=Ve(new Wt)||Fe&&"[object Promise]"!=Ve(Fe.resolve())||Be&&"[object Set]"!=Ve(new Be)||ze&&"[object WeakMap]"!=Ve(new ze))&&(Ve=function(t){var e=U(t),r="[object Object]"==e?t.constructor:void 0,n=r?G(r):"";if(n)switch(n){case He:return"[object DataView]";case Ye:return"[object Map]";case Ge:return"[object Promise]";case Ke:return"[object Set]";case We:return"[object WeakMap]"}return e});var Je=Ve,$e="[object Object]",qe=Object.prototype.hasOwnProperty;var Ze=function(t,e,r,n,o,i){var a=lt(t),u=lt(e),c=a?"[object Array]":Je(t),s=u?"[object Array]":Je(e),l=(c="[object Arguments]"==c?$e:c)==$e,f=(s="[object Arguments]"==s?$e:s)==$e,d=c==s;if(d&&dt(t)){if(!dt(e))return!1;a=!0,l=!1}if(d&&!l)return i||(i=new ve),a||Ot(t)?Oe(t,e,r,n,o,i):je(t,e,c,r,n,o,i);if(!(1&r)){var p=l&&qe.call(t,"__wrapped__"),v=f&&qe.call(e,"__wrapped__");if(p||v){var h=p?t.value():t,_=v?e.value():e;return i||(i=new ve),o(h,_,r,n,i)}}return!!d&&(i||(i=new ve),Me(t,e,r,n,o,i))};var Qe=function t(e,r,n,o,i){return e===r||(null==e||null==r||!ot(e)&&!ot(r)?e!=e&&r!=r:Ze(e,r,n,o,t,i))};var Xe=function(t,e,r,n){var o=r.length,i=o,a=!n;if(null==t)return!i;for(t=Object(t);o--;){var u=r[o];if(a&&u[2]?u[1]!==t[u[0]]:!(u[0]in t))return!1}for(;++o<i;){var c=(u=r[o])[0],s=t[c],l=u[1];if(a&&u[2]){if(void 0===s&&!(c in t))return!1}else{var f=new ve;if(n)var d=n(s,l,c,t,e,f);if(!(void 0===d?Qe(l,s,3,n,f):d))return!1}}return!0};var tr=function(t){return t==t&&!M(t)};var er=function(t){for(var e=Dt(t),r=e.length;r--;){var n=e[r],o=t[n];e[r]=[n,o,tr(o)]}return e};var rr=function(t,e){return function(r){return null!=r&&(r[t]===e&&(void 0!==e||t in Object(r)))}};var nr=function(t){var e=er(t);return 1==e.length&&e[0][2]?rr(e[0][0],e[0][1]):function(r){return r===t||Xe(r,t,e)}};var or=function(t){return"symbol"==typeof t||ot(t)&&"[object Symbol]"==U(t)},ir=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ar=/^\w*$/;var ur=function(t,e){if(lt(t))return!1;var r=typeof t;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=t&&!or(t))||(ar.test(t)||!ir.test(t)||null!=e&&t in Object(e))};function cr(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var r=function(){var n=arguments,o=e?e.apply(this,n):n[0],i=r.cache;if(i.has(o))return i.get(o);var a=t.apply(this,n);return r.cache=i.set(o,a)||i,a};return r.cache=new(cr.Cache||fe),r}cr.Cache=fe;var sr=cr;var lr=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,fr=/\\(\\)?/g,dr=function(t){var e=sr(t,(function(t){return 500===r.size&&r.clear(),t})),r=e.cache;return e}((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(lr,(function(t,r,n,o){e.push(n?o.replace(fr,"$1"):r||t)})),e}));var pr=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},vr=j?j.prototype:void 0,hr=vr?vr.toString:void 0;var _r=function t(e){if("string"==typeof e)return e;if(lt(e))return pr(e,t)+"";if(or(e))return hr?hr.call(e):"";var r=e+"";return"0"==r&&1/e==-1/0?"-0":r};var yr=function(t){return null==t?"":_r(t)};var br=function(t,e){return lt(t)?t:ur(t,e)?[t]:dr(yr(t))};var gr=function(t){if("string"==typeof t||or(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e};var Er=function(t,e){for(var r=0,n=(e=br(e,t)).length;null!=t&&r<n;)t=t[gr(e[r++])];return r&&r==n?t:void 0};var Or=function(t,e,r){var n=null==t?void 0:Er(t,e);return void 0===n?r:n};var Tr=function(t,e){return null!=t&&e in Object(t)};var mr=function(t,e,r){for(var n=-1,o=(e=br(e,t)).length,i=!1;++n<o;){var a=gr(e[n]);if(!(i=null!=t&&r(t,a)))break;t=t[a]}return i||++n!=o?i:!!(o=null==t?0:t.length)&&ht(o)&&vt(a,o)&&(lt(t)||st(t))};var Ir=function(t,e){return null!=t&&mr(t,e,Tr)};var Rr=function(t,e){return ur(t)&&tr(e)?rr(gr(t),e):function(r){var n=Or(r,t);return void 0===n&&n===e?Ir(r,t):Qe(e,n,3)}};var Ar=function(t){return t};var jr=function(t){return function(e){return null==e?void 0:e[t]}};var Nr=function(t){return function(e){return Er(e,t)}};var wr=function(t){return ur(t)?jr(gr(t)):Nr(t)};var Dr=function(t){return"function"==typeof t?t:null==t?Ar:"object"==typeof t?lt(t)?Rr(t[0],t[1]):nr(t):wr(t)};var Pr=function(t,e){var r={};return e=Dr(e),Pt(t,(function(t,n,o){et(r,n,e(t,n,o))})),r};var Cr=function(t){return"number"==typeof t||ot(t)&&"[object Number]"==U(t)},Lr=function(e){var r=e.css,n={};return Object.entries(r).forEach((function(e){var r=e[0],o=e[1];if(Cr(o))return t.isUnitlessNumber[r]?void(n[r]=""+o):void(n[r]=o+"px");n[r]=o})),y(y({},e),{css:y(y({},n),{boxSizing:"border-box"})})},Sr=function(t){return Pr(t,(function(t){var e=t;return"Typography"===e.type&&(e=function(t){var e=Or(t,"data.custom.variant","P");return y(y({},t),{type:e})}(e)),e.css&&M(e.css)&&e.css.flexBasis&&(e=function(t){var e=t.css.flexBasis;return"0"===e||"0px"===e?y(y({},t),{css:y(y({},t.css),{flexBasis:"0%"})}):t}(e)),e.css&&(e=Lr(e)),e}))};var kr,Ur="https://cdn.candu.ai",Mr="/api/checklistItems",xr="/api/cards",Fr="/api/segmentMemberships",Br="/api/segmentsDefinition",zr="/api/tutorialMetadata",Hr="/api/tutorialDocumentsSdk",Yr="wss://2jcfb7pjlf.execute-api.eu-west-1.amazonaws.com/prod",Gr=function(t){if(!document.querySelectorAll('[href="'+t+'"]').length){var e=document.createElement("link");e.setAttribute("rel","prefetch"),e.setAttribute("href",t),document.head.appendChild(e)}},Kr=function(t,e){t&&lt(t)&&t.map((function(t){var r=t.nodeType,n=t.url;return Gr("EmbedTutorial"===r?Ur+"/tutorials/"+e+"/"+n+".json":"EmbedPortal"===r?Ur+"/portals/"+e+"/"+n+"/head.json":n)}))},Wr=function(){function t(t){this.adjacencyList={},this.rootDocument=t,this.adjacencyList[t]=[]}return t.prototype.get=function(t){return this.adjacencyList[t]},t.prototype.add=function(t,e){var r=this;if(this.adjacencyList[t]||(this.adjacencyList[t]=[]),!this.adjacencyList[e])return this.adjacencyList[t].push(e),this.adjacencyList[e]=[],!0;if(this.adjacencyList[t].includes(e))return!0;var n=function(e){if(e===t)return!0;for(var o=0,i=r.adjacencyList[e];o<i.length;o++){var a=i[o];if(n(a))return!0}return!1};return!n(e)&&(this.adjacencyList[t].push(e),!0)},t}(),Vr=function(t,e){return{id:t,dependencies:e?e.dependencies:new Wr(t)}},Jr=function(t,e){return t.dependencies.add(t.id,e)},$r=function(t,r){var n=r.reduce((function(t,e){var r;return y(y({},t),((r={})[e]=e,r))}),{});return t.content.find((function(t){var r=t.segmentId;return!!n[r]||r===e}))},qr=function(t){return"candu.sdk."+t},Zr=function(t){return qr("error."+t)},Qr={UNKOWN_NODE_TYPE:"unknown_node_type",UNKOWN_BLOCK_NODE_TYPE:"unkown_block_node_type",UNKOWN_INLINE_NODE_TYPE:"unkown_inline_node_type",UNKOWN_NODE_OBJECT_TYPE:"unkown_node_object_type",TUTORIAL_ERROR:"tutorial_error_boundary",PORTAL_ERROR:"portal_error_boundary",PROVIDER_ERROR:"provider_error_boundary",STYLEGUIDE_MAP_ERROR:"styleguide_map",RENDER_NODE_ERROR:"render_node"},Xr={HEARTBEAT:qr("heartbeat"),PREVIEW_OPEN:qr("preview.open"),PORTAL:qr("portal"),TUTORIAL:qr("tutorial"),TUTORIAL_INTERACTION:qr("tutorial.interaction"),PORTAL_ASSET_NOT_FOUND:Zr("portal_asset_not_found"),PORTAL_NO_SEGMENT_IDS:Zr("portal_no_segment_ids"),NO_MATCHING_TUTORIALS:Zr("no_matching_tutorials"),NO_VALID_TUTORIAL_IDENTIFIER:Zr("no_valid_tutorial_identifier"),COMMIT_API_LOADING_ERROR:Zr("commit_api"),TUTORIAL_LOADING_ERROR:Zr("tutorial"),UNKOWN_NODE_TYPE:Zr(Qr.UNKOWN_NODE_TYPE),UNKOWN_INLINE_NODE_TYPE:Zr(Qr.UNKOWN_INLINE_NODE_TYPE),UNKOWN_NODE_OBJECT_TYPE:Zr(Qr.UNKOWN_NODE_OBJECT_TYPE),TUTORIAL_ERROR:Zr(Qr.TUTORIAL_ERROR),PORTAL_ERROR:Zr(Qr.PORTAL_ERROR),PROVIDER_ERROR:Zr(Qr.PROVIDER_ERROR),STYLEGUIDE_MAP_ERROR:Zr(Qr.TUTORIAL_ERROR),RENDER_NODE_ERROR:Zr(Qr.TUTORIAL_ERROR),CIRCULAR_DEPENDENCY_EMBED_PORTAL:Zr("circular_dependecy_embed_portal"),CIRCULAR_DEPENDENCY_EMBED_TUTORIAL:Zr("circular_dependecy_embed_tutorial"),STATE_FETCH_FAILED:Zr("state_fetch_failed"),STATE_UPDATE_FAILED:Zr("state_update_failed"),SEGMENT_MEMBERSHIP_TIMEOUT:Zr("segment_membership_timeout"),CHECKLIST_ITEM_STATE_UPDATED:qr("tutorial.checklist_item_state_updated"),CHECKLIST_GROUP_COMPLETE:qr("tutorial.checklist_group_complete"),CARD_DISMISSED:qr("tutorial.card_dismissed")},tn=function(t){return qr("metric."+t)},en={SEGMENT_MEMBERSHIP_LOAD_TIME:tn("segment_membership_load_time"),PORTAL_LOAD_TIME:tn("portal_load_time"),TUTORIAL_LOAD_TIME:tn("tutorial_load_time"),TUTORIAL_DOCUMENT_MOUNT_TIME:tn("tutorial_document_mount_time")},rn=function(t){return"An error has occured while trying to parse your Tutorial.\nUpgrade the SDK to the latest version to get rid of this error.\nErrorCode: "+t+"."},nn=((kr={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"})[Xr.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",kr[Xr.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",kr[Xr.NO_MATCHING_TUTORIALS]="The Tutorial will not be rendered because there are no matching segments for the given user.",kr[Xr.NO_VALID_TUTORIAL_IDENTIFIER]="(Candu/Tutorial) You must define one of tutorialId, slug, commitId or contentHashId.",kr[Xr.TUTORIAL_LOADING_ERROR]="An error has occurred while trying to load the Tutorial",kr[Xr.UNKOWN_INLINE_NODE_TYPE]=rn(Qr.UNKOWN_INLINE_NODE_TYPE),kr[Xr.UNKOWN_NODE_TYPE]=rn(Qr.UNKOWN_NODE_TYPE),kr[Xr.CIRCULAR_DEPENDENCY_EMBED_PORTAL]="Circular dependency found on Embeded Portal. Please take a look at the Portal Content.",kr[Xr.CIRCULAR_DEPENDENCY_EMBED_TUTORIAL]="Circular dependency found on Embeded Tutorial. Please take a look at the Tutorial Content.",kr[Xr.PORTAL_ERROR]="An error has occured within Portal",kr[Xr.PROVIDER_ERROR]="An error has occured within Provider",kr[Xr.TUTORIAL_ERROR]="An error has occured within Tutorial",kr[Xr.RENDER_NODE_ERROR]="An error has occured while rendering tutorial node",kr[Xr.STYLEGUIDE_MAP_ERROR]="An error has occured while mapping node to styleguide",kr[Xr.STATE_FETCH_FAILED]="An error has occured while fetching state:",kr[Xr.STATE_UPDATE_FAILED]="An error has occured while updating state:",kr[Xr.SEGMENT_MEMBERSHIP_TIMEOUT]="Segment membership fetch has timed out",kr),on={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},an={error:console.error,warning:console.warn},un=function(t){var e=t.identify,r=t.track;return{provider:function(t){var n=t.userId,o=t.traits,i=t.styleguide;e(n,o),r(Xr.HEARTBEAT,function(t){var e={};return Object.keys(t).forEach((function(r){on[r]&&(e["styleguide."+r]=t[r].displayName||!0)})),e}(i))},tutorialDocumentLoadingError:function(t){var e=t.tutorialId,n=t.slug,o=t.contentHashId;an.error(nn[Xr.TUTORIAL_LOADING_ERROR]),r(Xr.TUTORIAL_LOADING_ERROR,{tutorialId:e,slug:n,contentHashId:o})}}},cn=function(t){return p(!t||M(t),"(Candu) styleguide must be undefined or an object")},sn=function(t){var e=t.clientToken,o=t.userId,i=t.traits,a=t.options,u=t.styleguide,c=b(t,["clientToken","userId","traits","options","styleguide"]);return p(r(e),"(Candu) you must provide a valid clientToken"),p(!o||n(o),"(Candu) you must provide a valid userId"),cn(u),p(!i||M(i),"(Candu) traits must be undefined or an object"),p(!a||M(a),"(Candu) options must be undefined or an object"),y(y({},c),{clientToken:e,traits:i||{},options:a||{},styleguide:u||{},userId:o||d()})},ln=function(t){var e=t.slug,r=t.styleguide,n=t.contentHashId,o=t.tutorialId,i=t.tutorialDocument,a=t.renderedByClient,u=b(t,["slug","styleguide","contentHashId","tutorialId","tutorialDocument","renderedByClient"]);return cn(r),y(y({},u),{slug:e,styleguide:r||{},contentHashId:n,tutorialId:o,tutorialDocument:i,renderedByClient:a})},fn=function(t){var e=t.slug,r=t.styleguide;return cn(r),{slug:e,styleguide:r||{}}},dn=function(t,e){return g(void 0,void 0,void 0,(function(){return E(this,(function(r){switch(r.label){case 0:return[4,fetch(t,e&&{headers:e})];case 1:return[2,r.sent().json()]}}))}))},pn=function(t){return dn("https://api.candu.ai"+t,{SDKVersion:"0.7.1-alpha.7"})},vn=function(t){return dn(""+Ur+t,{SDKVersion:"0.7.1-alpha.7"})},hn={tutorialDocumentLatestSaved:function(t,e){return g(void 0,void 0,void 0,(function(){return E(this,(function(r){return[2,pn(Hr+"/"+e+"?token="+t)]}))}))},portalAsset:function(t,e,r){return g(void 0,void 0,void 0,(function(){var n,o;return E(this,(function(i){return(null===(o=r)||void 0===o?void 0:o.length)?(n="?segmentIds="+r.join(","),[2,vn("/portalMemberships/"+t+"/"+e+"/head.json"+n)]):[2,vn("/portals/"+t+"/"+e+"/head.json")]}))}))},segmentMembership:function(t,e){return g(void 0,void 0,void 0,(function(){return E(this,(function(r){return[2,pn(Fr+"/"+e+"?token="+t)]}))}))},segmentDefinition:function(t){return g(void 0,void 0,void 0,(function(){return E(this,(function(e){return[2,pn(Br+"?token="+t)]}))}))},tutorialMetadata:function(t){return g(void 0,void 0,void 0,(function(){return E(this,(function(e){return[2,pn(zr+"?token="+t)]}))}))},tutorialSocket:function(t,e,r){var n=new WebSocket(Yr+"?clientToken="+t+"&tutorialId="+e);return n.onmessage=function(t){var e=JSON.parse(t.data);r(e)},function(){return n.close()}},tutorialDocument:function(t,e,r){var n=t.contentHashId,u=t.tutorialId,c=t.tutorialDocument,s=t.slug,l=function(t){return{byId:function(e){return pn(Hr+"?token="+t+"&finder=latestPublished&tutorialId="+e)},bySlug:function(e){return vn("/tutorials/"+t+"/"+e+".json")},byContentHash:function(e){return vn("/tutorials/"+t+"/"+e+".json")}}}(e);return o(s)?l.bySlug(s):i(u)?l.byId(u):a(n)?l.byContentHash(n):M(c)?Promise.resolve(c):(an.error(nn[Xr.NO_VALID_TUTORIAL_IDENTIFIER]),r.track(Xr.NO_VALID_TUTORIAL_IDENTIFIER,{slug:t.slug}),null)}},_n=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return console.error.apply(console,t)},yn=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return console.warn.apply(console,t)},bn={error:_n,warning:yn},gn=function(t){return t.replace(/\s/g,"&nbsp;")},En=function(t){return DOMParser?(new DOMParser).parseFromString(t,"text/html").body.textContent||"":t},On=function(){function t(){this.subscribers=[]}return t.prototype.subscribe=function(t){var e=this;return this.subscribers.push(t),function(){e.subscribers[e.subscribers.indexOf(t)]=function(){}}},t.prototype.notify=function(t){this.subscribers.forEach((function(e){return e(t)}))},t.prototype.clear=function(){this.subscribers=[]},t}(),Tn=function(){function t(){this.onClientUpdateObserver=new On}return t.prototype.attachClient=function(t){this.client=t,this.onClientUpdateObserver.notify({client:t})},t.prototype.detachClient=function(){this.client&&(this.client=null,this.onClientUpdateObserver.notify({client:null}))},t.prototype.onClientUpdate=function(t){var e=this.onClientUpdateObserver.subscribe(t);return this.client&&t({client:this.client}),e},t}(),mn=function(t){return t.lastModifiedAt===t.lastPublishedAt?"Published":t.lastPublishedAt?"Unsynced":"Draft"};function In(t){var e,r,n=function(t){return function(){for(var e,n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];if(r.api)return(e=r.api)[t].apply(e,n);console.warn("Please initialize the SDK by calling Candu.init() before attempting to call "+t)}};return(e=function(){function e(){}return e.init=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return this.api||(e.api=new(t.bind.apply(t,O([void 0],r)))),e.subscriberCallbacks.forEach((function(t){return t()})),e.subscriberCallbacks=[],window.postMessage({source:"CANDU_SINGLETON",payload:{type:"INIT"}},window&&window.origin?window.origin:"*"),e},e.onProviderReady=function(t){if(e.api)return t();e.subscriberCallbacks.push(t)},e}()).subscriberCallbacks=[],e.renderTutorial=n("renderTutorial"),e.renderPortal=n("renderPortal"),e.attachClient=n("attachClient"),e.detachClient=n("detachClient"),e.getProvider=n("getProvider"),e.getInfo=n("getInfo"),r=e,window.Candu=r,r}var Rn="/home/runner/work/candu-sdk/candu-sdk/packages/candu-core/dist/core.es.js",An="0.7.1-alpha.7",jn=function(){function t(t){this.init(t)}return t.prototype.getInfo=function(){return{core:{version:An,name:Rn},sdk:{version:this.version,name:this.name}}},t.prototype.attachClient=function(t){return this.provider.preview.attachClient(t)},t.prototype.detachClient=function(){return this.provider.preview.detachClient()},Object.defineProperty(t.prototype,"provider",{get:function(){return this.getProvider()},enumerable:!0,configurable:!0}),t}(),Nn=function(t){switch(t.trigger){case u.ON_CLICK:default:return"onClick"}},wn=function(t,e){var r,n,o,i,a,s;if("Link"===t.type&&(null===(r=t.props)||void 0===r?void 0:r.href)){var l=t.props.href+" Link Clicked",f=null===(o=null===(n=t)||void 0===n?void 0:n.nodes)||void 0===o?void 0:o[0];if(f){var d=e.document.nodes[f];"Text"===(null===(i=d)||void 0===i?void 0:i.type)&&(null===(s=null===(a=d)||void 0===a?void 0:a.props)||void 0===s?void 0:s.children)&&(l=d.props.children+" Link Clicked")}return{onClick:function(){var r;return e.provider.eventing.track(Xr.TUTORIAL_INTERACTION,{trigger:u.ON_CLICK,category:t.type,eventName:l,handler:{href:null===(r=t.props)||void 0===r?void 0:r.href,type:c.NAVIGATE}})}}}if(!t.data||!t.data.actions)return{};var p=function(t,r){e.provider.eventing.track(Xr.TUTORIAL_INTERACTION,y(y({},t),r||{}))};return t.data.actions.map((function(t){return function(t,e,r){var n,o,i;switch(t.handler.type){case c.NAVIGATE:return(n={})[Nn(t)]=function(n){n.stopPropagation();var o=t.handler,i=o.href,a=o.target,u=r||{},c=u.parentTrackers,s=b(u,["parentTrackers"]);c&&c.forEach((function(r){return e(t,r)})),e(t,s),"Blank"===a?window.open(i,"_blank"):i&&i.includes("mailto:")?window.location=i:document.location.href=i},n;case c.CHANGE_TUTORIAL:return(o={})[Nn(t)]=function(){var e=t.handler.tutorialId;_n("TODO -> change tutorial",e)},o;case c.OPEN_GUIDE:return(i={})[Nn(t)]=function(){var e=t.handler.guideId;_n("TODO -> open guide",e)},i;default:return{}}}(t,p,e.trackingIdentifiers)})).reduce((function(t,e){return y(y({},t),e)}),{})},Dn=function(t,e){var r=t.props||{},n=t.nodes,o=r.children;return o||(n?n.map(e):null)},Pn=function(t,e){var r=t.states;return r&&e.stateProviderInstances.filter((function(t){return!!r[t.providerId]}))},Cn=function(t,e){var r=t.nodes;return r&&r.map((function(t){return e.document.nodes[t]})).filter((function(t){return!!t})).map((function(t){return Pn(t,e)||[]})).reduce((function(t,e){return t.concat(e)}),[])},Ln=function(t,e){try{var r=e.provider,n=e.document,o=e.trackingIdentifiers,i=n.nodes[t];if(!i)return bn.error("Document is corrupted. Refusing to move further."),null;var a=function(t){return Ln(t,e)},u=i.type,c=i.props,s=i.css,l=y(y(y({},c||{}),{style:s||{},children:Dn(i,a)}),wn(i,{trackingIdentifiers:o,provider:r,document:n})),f={nodeId:t,node:i,document:n,render:{node:a,styleguide:function(t,r){return void 0===r&&(r={}),e.renderNode(t,{api:f,attributes:r})},tutorial:function(t){return e.renderTutorial(t)},portal:function(t){return e.renderPortal(t)}},trackingIdentifiers:o,stateInstances:Pn(i,e),childrenStateInstances:Cn(i,e)},d=f.render.styleguide(u,l);return d||(bn.error(nn[Xr.UNKOWN_NODE_TYPE],{type:u}),r.eventing.error(new Error(nn[Xr.UNKOWN_NODE_TYPE]),{type:u}),null)}catch(t){return bn.error(nn[Xr.STYLEGUIDE_MAP_ERROR],t),e.provider.eventing.error(t),null}},Sn=sr((function(t,e){var r,n,o=t.provider,i=t.portal,a=t.tutorial,u=o.styleguide;return a&&(n=a.styleguide),i&&(r=i.styleguide),y(y(y(y({},u||{}),r||{}),n||{}),e||{})})),kn="",Un="#EDEDED",Mn="#333745",xn="#838792",Fn="#FEFEFE",Bn="#FEFEFE",zn={primary:"#6310E5",secondary:"#59C3C3",tertiary:"#4D515D",warning:"#FCAD0D",danger:"#EE4266"},Hn=function(t){return"candu-styleguide-"+t},Yn=function(t,e){void 0===e&&(e="main");var r=Hn(t);if(!document.getElementById(r)){var n=document.createElement("link");n.setAttribute("id",r),n.setAttribute("rel","stylesheet"),n.setAttribute("href",Ur+"/styleguides/applications/"+t+"/default/"+e+".css"),document.head.appendChild(n)}},Gn=function(t){var e=document.getElementById(Hn(t));e&&e.remove()},Kn=function(t,e){var r,n,o,i,a="string"==typeof e&&e.split(" ");return a?1===a.length?((r={})[t+"Right"]=e,r[t+"Left"]=e,r[t+"Bottom"]=e,r[t+"Top"]=e,r):2===a.length?((n={})[t+"Top"]=a[0],n[t+"Right"]=a[1],n[t+"Bottom"]=a[0],n[t+"Left"]=a[1],n):3===a.length?((o={})[t+"Top"]=a[0],o[t+"Right"]=a[1],o[t+"Bottom"]=a[2],o[t+"Left"]=a[1],o):((i={})[t+"Top"]=a[0],i[t+"Right"]=a[1],i[t+"Bottom"]=a[2],i[t+"Left"]=a[3],i):{}},Wn=function(t){var e=t.padding,r=t.margin,n=b(t,["padding","margin"]),o={};return e&&(o=y(y({},o),Kn("padding",e))),r&&(o=y(y({},o),Kn("margin",r))),y(y({},o),n)};var Vn=function(t,e){return function(r,n){if(null==r)return r;if(!wt(r))return t(r,n);for(var o=r.length,i=e?o:-1,a=Object(r);(e?i--:++i<o)&&!1!==n(a[i],i,a););return r}}(Pt);var Jn=function(t,e){var r=-1,n=wt(t)?Array(t.length):[];return Vn(t,(function(t,o,i){n[++r]=e(t,o,i)})),n};var $n=function(t,e){return(lt(t)?pr:Jn)(t,Dr(e))},qn=function(){function t(t,e,r){var n=this;this.observer=new On,this.context=t,this.providerId=e,this.resolver=r,this.state=this.resolver.cache.load(this.providerId),this.resolver.retrieve(t,e).then((function(t){return n.updateState(t)})).catch((function(t){bn.error(nn[Xr.STATE_FETCH_FAILED],t.message),n.context.eventing.track(nn[Xr.STATE_FETCH_FAILED],{errorMessage:t.message})}))}return t.prototype.mutate=function(t){var e=this,r=this.state;this.updateState(y(y({},r),t)),this.resolver.update(this.context,this.providerId,t).then((function(t){return e.updateState(t)})).catch((function(t){bn.error(nn[Xr.STATE_UPDATE_FAILED],t.message),e.context.eventing.track(nn[Xr.STATE_UPDATE_FAILED],{errorMessage:t.message}),r&&e.updateState(r)}))},t.prototype.subscribe=function(t){var e=this.observer.subscribe(t);return this.state&&t(this.state),e},t.prototype.getResolvedState=function(){return this.state},t.prototype.updateState=function(t){this.state=t,this.resolver.cache.save(this.providerId,t),this.observer.notify(t)},t}(),Zn=function(){function t(t){void 0===t&&(t="candu-state:"),this.prefix=t}return t.prototype.save=function(t,e){try{window.localStorage.setItem(this.prefix+t,JSON.stringify(e))}catch(t){}},t.prototype.load=function(t){try{var e=window.localStorage.getItem(this.prefix+t);return e&&JSON.parse(e)}catch(t){return null}},t}(),Qn=Object.create(null),Xn=function(){function t(t){this.cache=new Zn,this.options=y({},t||{})}return t.register=function(t,e){Qn[t]=e,e.prototype.type=t},t.fromJSON=function(t){var e=t.type,r=b(t,["type"]),n=Qn[e];return n?new n(r):null},t.prototype.toJSON=function(){return y({type:this.type},this.options)},t}();var to=function(t,e,r,n){for(var o=t.length,i=r+(n?1:-1);n?i--:++i<o;)if(e(t[i],i,t))return i;return-1};var eo=function(t){return t!=t};var ro=function(t,e,r){for(var n=r-1,o=t.length;++n<o;)if(t[n]===e)return n;return-1};var no=function(t,e,r){return e==e?ro(t,e,r):to(t,eo,r)};var oo=function(t,e){return!!(null==t?0:t.length)&&no(t,e,0)>-1};var io=function(t,e,r){for(var n=-1,o=null==t?0:t.length;++n<o;)if(r(e,t[n]))return!0;return!1};var ao=function(){},uo=Be&&1/Ie(new Be([,-0]))[1]==1/0?function(t){return new Be(t)}:ao;var co=function(t,e,r){var n=-1,o=oo,i=t.length,a=!0,u=[],c=u;if(r)a=!1,o=io;else if(i>=200){var s=e?null:uo(t);if(s)return Ie(s);a=!1,o=Ee,c=new be}else c=e?[]:u;t:for(;++n<i;){var l=t[n],f=e?e(l):l;if(l=r||0!==l?l:0,a&&f==f){for(var d=c.length;d--;)if(c[d]===f)continue t;e&&c.push(f),u.push(l)}else o(c,f,r)||(c!==u&&c.push(f),u.push(l))}return u};var so=function(t){return t&&t.length?co(t):[]},lo=function(){function t(){}return t.get=function(e,r){var n=t.loaders.get(e);if(n)return n;var o=new v(r,{cache:!1});return t.loaders.set(e,o),o},t.loaders=new Map,t}(),fo="https://api.candu.ai"+xr,po=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return _(e,t),e.prototype.retrieve=function(t,e){return g(this,void 0,void 0,(function(){var r,n,o=this;return E(this,(function(i){switch(i.label){case 0:return[4,lo.get("cardStateApi",(function(e){return g(o,void 0,void 0,(function(){var r;return E(this,(function(n){switch(n.label){case 0:return[4,fetch(fo+"?token="+t.clientToken+"&finder=byIds&ids="+so(e).join(",")+"&userId="+t.userId).then((function(t){return t.json()}))];case 1:return r=n.sent(),[2,e.map((function(t){return r.find((function(e){return e.id===t}))}))]}}))}))})).load(e)];case 1:return r=i.sent(),n={id:e,state:{dismissed:!1}},[2,r||n]}}))}))},e.prototype.update=function(t,e,r){return fetch(fo+"/"+e+"?token="+t.clientToken,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({state:r.state,userId:t.userId.toString()})}).then((function(t){return t.json()}))},e}(Xn);Xn.register(s.CardApi,po);var vo="https://api.candu.ai"+Mr;function ho(t){return{state:t.state,id:t.id}}function _o(t){switch(t){case l.Account:return"AccountId";case l.User:default:return"UserId"}}var yo=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return _(e,t),e.prototype.getScopeAndFieldFromContext=function(t){var e=this.options.scopeTrait,r=this.options.scope||l.User,n=t.userId.toString();return r===l.Account&&(e&&t.traits[e]?n=t.traits[e]:(yn("trait '"+e+"' is not defined, falling back to user scope"),r=l.User)),{scope:r,scopeField:n}},e.prototype.retrieve=function(t,e){return g(this,void 0,void 0,(function(){var r,n,o,i=this;return E(this,(function(a){switch(a.label){case 0:return r=this.getScopeAndFieldFromContext(t),n=r.scope,o=r.scopeField,[4,lo.get("checklistState",(function(e){return g(i,void 0,void 0,(function(){var r;return E(this,(function(i){switch(i.label){case 0:return[4,fetch(vo+"?token="+t.clientToken+"&byTrait="+_o(n)+"&field="+o+"&finder=byIds&ids="+so(e).join(",")).then((function(t){return t.json()})).then((function(t){return t.map(ho)}))];case 1:return r=i.sent(),[2,e.map((function(t){return r.find((function(e){return e.id===t}))}))]}}))}))})).load(e)];case 1:return[2,a.sent()||{id:e,state:f.NotStared}]}}))}))},e.prototype.update=function(t,e,r){var n=this.getScopeAndFieldFromContext(t),o=n.scope,i=n.scopeField;return fetch(vo+"/"+e+"?token="+t.clientToken,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(y(y({},r),{byTrait:_o(o),field:i}))}).then((function(t){return t.json()})).then(ho)},e}(Xn);function bo(t,e){return $n(t,(function(t,r){var n=Xn.fromJSON(t.resolver);return n?new qn(e,r,n):null})).filter((function(t){return!!t}))}Xn.register(s.CheckListApi,yo);var go=function(t,e){for(var r=Object.values(t),n=function(t){var e=r.find((function(e){return e.position===t}));if(!e||e.status===f.NotStared)return{value:t}},o=0;o<e;o+=1){var i=n(o);if("object"==typeof i)return i.value}},Eo=function(t,e){var r=Object.values(t).filter((function(t){return t.status===f.Done})).length;return{completedItems:r,percComplete:e?Math.round(100*r/e):0}},Oo=function(t){return t.filter((function(t){return t.resolver instanceof yo}))},To=function(t){var e={};return t.forEach((function(t,r){var n=t.getResolvedState();n&&(e[n.id]={status:n.state,position:r})})),e};export{po as CardResolverInstance,yo as CheckListResolverInstance,Un as DEFAULT_ALERT_COLOR,kn as DEFAULT_ALT,Fn as DEFAULT_TAB_ACTIVE_COLOR,Bn as DEFAULT_TAB_COLOR,Mn as DEFAULT_TAB_HEADER_COLOR,xn as DEFAULT_TAB_ITEM_COLOR,nn as ERROR_MESSAGES,Qr as ERROR_SLUGS,Xr as EVENT_NAMES,an as LOGGER,en as METRICS,On as Observer,Tn as PreviewContainer,hn as RESOURCES,zn as STYLEGUIDE_COLORS,jn as SingletonAPI,qn as StateProviderInstance,Xn as StateResolverInstance,Wr as TutorialDependencies,Sr as adaptCustomNodes,Yn as attachStylesheet,Eo as calculateGroupCompletion,Jr as checkCyclicAndAdd,In as createSingleton,Vr as createTutorialDocumentContext,on as defaultStyleguide,Gn as detachStylesheet,Kr as fetchHead,$r as findMatchingSegment,Oo as getCheckListStateProviders,mn as getContentState,go as getFirstNotStartedItem,To as getInitialItems,gn as includeHTMLWhitespaces,bo as initStateProviders,un as internalEventing,_n as logError,yn as logWarning,bn as logger,Ln as mapNodeToStyleguide,Sn as mergeStyleguidesFromContext,Lr as normalizeCss,fn as portalValidation,sn as providerValidation,En as stripHTML,ln as tutorialValidation,Wn as unpackShorthandStyles};
//# sourceMappingURL=index.es.js.map

@@ -1,2 +0,2 @@

"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("react-style-object-to-css/lib/CSSProperty"),e=require("@candulabs/models"),r=require("@candulabs/eventing"),n=require("invariant");require("setimmediate");var o=require("dataloader");function i(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var a=i(t),u=i(n),c=i(o),s=function(t,e){return(s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)};function l(t,e){function r(){this.constructor=t}s(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var f=function(){return(f=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function d(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r}function p(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}c((n=n.apply(t,e||[])).next())}))}function v(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}function h(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;var n=Array(t),o=0;for(e=0;e<r;e++)for(var i=arguments[e],a=0,u=i.length;a<u;a++,o++)n[o]=i[a];return n}var _="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function y(t){var e={exports:{}};return t(e,e.exports),e.exports}var b="object"==typeof _&&_&&_.Object===Object&&_,g="object"==typeof self&&self&&self.Object===Object&&self,E=b||g||Function("return this")(),O=E.Symbol,T=Object.prototype,I=T.hasOwnProperty,m=T.toString,R=O?O.toStringTag:void 0;var A=function(t){var e=I.call(t,R),r=t[R];try{t[R]=void 0;var n=!0}catch(t){}var o=m.call(t);return n&&(e?t[R]=r:delete t[R]),o},j=Object.prototype.toString;var N=function(t){return j.call(t)},S=O?O.toStringTag:void 0;var L=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":S&&S in Object(t)?A(t):N(t)};var C=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)};var w,D=function(t){if(!C(t))return!1;var e=L(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e},P=E["__core-js_shared__"],k=(w=/[^.]+$/.exec(P&&P.keys&&P.keys.IE_PROTO||""))?"Symbol(src)_1."+w:"";var x=function(t){return!!k&&k in t},U=Function.prototype.toString;var M=function(t){if(null!=t){try{return U.call(t)}catch(t){}try{return t+""}catch(t){}}return""},F=/^\[object .+?Constructor\]$/,B=Function.prototype,H=Object.prototype,G=B.toString,Y=H.hasOwnProperty,z=RegExp("^"+G.call(Y).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var K=function(t){return!(!C(t)||x(t))&&(D(t)?z:F).test(M(t))};var V=function(t,e){return null==t?void 0:t[e]};var W=function(t,e){var r=V(t,e);return K(r)?r:void 0},J=function(){try{var t=W(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();var q=function(t,e,r){"__proto__"==e&&J?J(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r};var $=function(t){return function(e,r,n){for(var o=-1,i=Object(e),a=n(e),u=a.length;u--;){var c=a[t?u:++o];if(!1===r(i[c],c,i))break}return e}}();var Z=function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n};var Q=function(t){return null!=t&&"object"==typeof t};var X=function(t){return Q(t)&&"[object Arguments]"==L(t)},tt=Object.prototype,et=tt.hasOwnProperty,rt=tt.propertyIsEnumerable,nt=X(function(){return arguments}())?X:function(t){return Q(t)&&et.call(t,"callee")&&!rt.call(t,"callee")},ot=Array.isArray;var it=function(){return!1},at=y((function(t,e){var r=e&&!e.nodeType&&e,n=r&&t&&!t.nodeType&&t,o=n&&n.exports===r?E.Buffer:void 0,i=(o?o.isBuffer:void 0)||it;t.exports=i})),ut=/^(?:0|[1-9]\d*)$/;var ct=function(t,e){var r=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==r||"symbol"!=r&&ut.test(t))&&t>-1&&t%1==0&&t<e};var st=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991},lt={};lt["[object Float32Array]"]=lt["[object Float64Array]"]=lt["[object Int8Array]"]=lt["[object Int16Array]"]=lt["[object Int32Array]"]=lt["[object Uint8Array]"]=lt["[object Uint8ClampedArray]"]=lt["[object Uint16Array]"]=lt["[object Uint32Array]"]=!0,lt["[object Arguments]"]=lt["[object Array]"]=lt["[object ArrayBuffer]"]=lt["[object Boolean]"]=lt["[object DataView]"]=lt["[object Date]"]=lt["[object Error]"]=lt["[object Function]"]=lt["[object Map]"]=lt["[object Number]"]=lt["[object Object]"]=lt["[object RegExp]"]=lt["[object Set]"]=lt["[object String]"]=lt["[object WeakMap]"]=!1;var ft=function(t){return Q(t)&&st(t.length)&&!!lt[L(t)]};var dt=function(t){return function(e){return t(e)}},pt=y((function(t,e){var r=e&&!e.nodeType&&e,n=r&&t&&!t.nodeType&&t,o=n&&n.exports===r&&b.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})),vt=pt&&pt.isTypedArray,ht=vt?dt(vt):ft,_t=Object.prototype.hasOwnProperty;var yt=function(t,e){var r=ot(t),n=!r&&nt(t),o=!r&&!n&&at(t),i=!r&&!n&&!o&&ht(t),a=r||n||o||i,u=a?Z(t.length,String):[],c=u.length;for(var s in t)!e&&!_t.call(t,s)||a&&("length"==s||o&&("offset"==s||"parent"==s)||i&&("buffer"==s||"byteLength"==s||"byteOffset"==s)||ct(s,c))||u.push(s);return u},bt=Object.prototype;var gt=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||bt)};var Et=function(t,e){return function(r){return t(e(r))}}(Object.keys,Object),Ot=Object.prototype.hasOwnProperty;var Tt=function(t){if(!gt(t))return Et(t);var e=[];for(var r in Object(t))Ot.call(t,r)&&"constructor"!=r&&e.push(r);return e};var It=function(t){return null!=t&&st(t.length)&&!D(t)};var mt=function(t){return It(t)?yt(t):Tt(t)};var Rt=function(t,e){return t&&$(t,e,mt)};var At=function(){this.__data__=[],this.size=0};var jt=function(t,e){return t===e||t!=t&&e!=e};var Nt=function(t,e){for(var r=t.length;r--;)if(jt(t[r][0],e))return r;return-1},St=Array.prototype.splice;var Lt=function(t){var e=this.__data__,r=Nt(e,t);return!(r<0)&&(r==e.length-1?e.pop():St.call(e,r,1),--this.size,!0)};var Ct=function(t){var e=this.__data__,r=Nt(e,t);return r<0?void 0:e[r][1]};var wt=function(t){return Nt(this.__data__,t)>-1};var Dt=function(t,e){var r=this.__data__,n=Nt(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this};function 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=At,Pt.prototype.delete=Lt,Pt.prototype.get=Ct,Pt.prototype.has=wt,Pt.prototype.set=Dt;var kt=Pt;var xt=function(){this.__data__=new kt,this.size=0};var Ut=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r};var Mt=function(t){return this.__data__.get(t)};var Ft=function(t){return this.__data__.has(t)},Bt=W(E,"Map"),Ht=W(Object,"create");var Gt=function(){this.__data__=Ht?Ht(null):{},this.size=0};var Yt=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},zt=Object.prototype.hasOwnProperty;var Kt=function(t){var e=this.__data__;if(Ht){var r=e[t];return"__lodash_hash_undefined__"===r?void 0:r}return zt.call(e,t)?e[t]:void 0},Vt=Object.prototype.hasOwnProperty;var Wt=function(t){var e=this.__data__;return Ht?void 0!==e[t]:Vt.call(e,t)};var Jt=function(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=Ht&&void 0===e?"__lodash_hash_undefined__":e,this};function qt(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])}}qt.prototype.clear=Gt,qt.prototype.delete=Yt,qt.prototype.get=Kt,qt.prototype.has=Wt,qt.prototype.set=Jt;var $t=qt;var Zt=function(){this.size=0,this.__data__={hash:new $t,map:new(Bt||kt),string:new $t}};var Qt=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t};var Xt=function(t,e){var r=t.__data__;return Qt(e)?r["string"==typeof e?"string":"hash"]:r.map};var te=function(t){var e=Xt(this,t).delete(t);return this.size-=e?1:0,e};var ee=function(t){return Xt(this,t).get(t)};var re=function(t){return Xt(this,t).has(t)};var ne=function(t,e){var r=Xt(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this};function oe(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}oe.prototype.clear=Zt,oe.prototype.delete=te,oe.prototype.get=ee,oe.prototype.has=re,oe.prototype.set=ne;var ie=oe;var ae=function(t,e){var r=this.__data__;if(r instanceof kt){var n=r.__data__;if(!Bt||n.length<199)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new ie(n)}return r.set(t,e),this.size=r.size,this};function ue(t){var e=this.__data__=new kt(t);this.size=e.size}ue.prototype.clear=xt,ue.prototype.delete=Ut,ue.prototype.get=Mt,ue.prototype.has=Ft,ue.prototype.set=ae;var ce=ue;var se=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this};var le=function(t){return this.__data__.has(t)};function fe(t){var e=-1,r=null==t?0:t.length;for(this.__data__=new ie;++e<r;)this.add(t[e])}fe.prototype.add=fe.prototype.push=se,fe.prototype.has=le;var de=fe;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 ve=function(t,e){return t.has(e)};var he=function(t,e,r,n,o,i){var a=1&r,u=t.length,c=e.length;if(u!=c&&!(a&&c>u))return!1;var s=i.get(t);if(s&&i.get(e))return s==e;var l=-1,f=!0,d=2&r?new de:void 0;for(i.set(t,e),i.set(e,t);++l<u;){var p=t[l],v=e[l];if(n)var h=a?n(v,p,l,e,t,i):n(p,v,l,t,e,i);if(void 0!==h){if(h)continue;f=!1;break}if(d){if(!pe(e,(function(t,e){if(!ve(d,e)&&(p===t||o(p,t,r,n,i)))return d.push(e)}))){f=!1;break}}else if(p!==v&&!o(p,v,r,n,i)){f=!1;break}}return i.delete(t),i.delete(e),f},_e=E.Uint8Array;var ye=function(t){var e=-1,r=Array(t.size);return t.forEach((function(t,n){r[++e]=[n,t]})),r};var be=function(t){var e=-1,r=Array(t.size);return t.forEach((function(t){r[++e]=t})),r},ge=O?O.prototype:void 0,Ee=ge?ge.valueOf:void 0;var Oe=function(t,e,r,n,o,i,a){switch(r){case"[object DataView]":if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case"[object ArrayBuffer]":return!(t.byteLength!=e.byteLength||!i(new _e(t),new _e(e)));case"[object Boolean]":case"[object Date]":case"[object Number]":return jt(+t,+e);case"[object Error]":return t.name==e.name&&t.message==e.message;case"[object RegExp]":case"[object String]":return t==e+"";case"[object Map]":var u=ye;case"[object Set]":var c=1&n;if(u||(u=be),t.size!=e.size&&!c)return!1;var s=a.get(t);if(s)return s==e;n|=2,a.set(t,e);var l=he(u(t),u(e),n,o,i,a);return a.delete(t),l;case"[object Symbol]":if(Ee)return Ee.call(t)==Ee.call(e)}return!1};var Te=function(t,e){for(var r=-1,n=e.length,o=t.length;++r<n;)t[o+r]=e[r];return t};var Ie=function(t,e,r){var n=e(t);return ot(t)?n:Te(n,r(t))};var me=function(t,e){for(var r=-1,n=null==t?0:t.length,o=0,i=[];++r<n;){var a=t[r];e(a,r,t)&&(i[o++]=a)}return i};var Re=function(){return[]},Ae=Object.prototype.propertyIsEnumerable,je=Object.getOwnPropertySymbols,Ne=je?function(t){return null==t?[]:(t=Object(t),me(je(t),(function(e){return Ae.call(t,e)})))}:Re;var Se=function(t){return Ie(t,mt,Ne)},Le=Object.prototype.hasOwnProperty;var Ce=function(t,e,r,n,o,i){var a=1&r,u=Se(t),c=u.length;if(c!=Se(e).length&&!a)return!1;for(var s=c;s--;){var l=u[s];if(!(a?l in e:Le.call(e,l)))return!1}var f=i.get(t);if(f&&i.get(e))return f==e;var d=!0;i.set(t,e),i.set(e,t);for(var p=a;++s<c;){var v=t[l=u[s]],h=e[l];if(n)var _=a?n(h,v,l,e,t,i):n(v,h,l,t,e,i);if(!(void 0===_?v===h||o(v,h,r,n,i):_)){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 i.delete(t),i.delete(e),d},we=W(E,"DataView"),De=W(E,"Promise"),Pe=W(E,"Set"),ke=W(E,"WeakMap"),xe=M(we),Ue=M(Bt),Me=M(De),Fe=M(Pe),Be=M(ke),He=L;(we&&"[object DataView]"!=He(new we(new ArrayBuffer(1)))||Bt&&"[object Map]"!=He(new Bt)||De&&"[object Promise]"!=He(De.resolve())||Pe&&"[object Set]"!=He(new Pe)||ke&&"[object WeakMap]"!=He(new ke))&&(He=function(t){var e=L(t),r="[object Object]"==e?t.constructor:void 0,n=r?M(r):"";if(n)switch(n){case xe:return"[object DataView]";case Ue:return"[object Map]";case Me:return"[object Promise]";case Fe:return"[object Set]";case Be:return"[object WeakMap]"}return e});var Ge=He,Ye="[object Object]",ze=Object.prototype.hasOwnProperty;var Ke=function(t,e,r,n,o,i){var a=ot(t),u=ot(e),c=a?"[object Array]":Ge(t),s=u?"[object Array]":Ge(e),l=(c="[object Arguments]"==c?Ye:c)==Ye,f=(s="[object Arguments]"==s?Ye:s)==Ye,d=c==s;if(d&&at(t)){if(!at(e))return!1;a=!0,l=!1}if(d&&!l)return i||(i=new ce),a||ht(t)?he(t,e,r,n,o,i):Oe(t,e,c,r,n,o,i);if(!(1&r)){var p=l&&ze.call(t,"__wrapped__"),v=f&&ze.call(e,"__wrapped__");if(p||v){var h=p?t.value():t,_=v?e.value():e;return i||(i=new ce),o(h,_,r,n,i)}}return!!d&&(i||(i=new ce),Ce(t,e,r,n,o,i))};var Ve=function t(e,r,n,o,i){return e===r||(null==e||null==r||!Q(e)&&!Q(r)?e!=e&&r!=r:Ke(e,r,n,o,t,i))};var We=function(t,e,r,n){var o=r.length,i=o,a=!n;if(null==t)return!i;for(t=Object(t);o--;){var u=r[o];if(a&&u[2]?u[1]!==t[u[0]]:!(u[0]in t))return!1}for(;++o<i;){var c=(u=r[o])[0],s=t[c],l=u[1];if(a&&u[2]){if(void 0===s&&!(c in t))return!1}else{var f=new ce;if(n)var d=n(s,l,c,t,e,f);if(!(void 0===d?Ve(l,s,3,n,f):d))return!1}}return!0};var Je=function(t){return t==t&&!C(t)};var qe=function(t){for(var e=mt(t),r=e.length;r--;){var n=e[r],o=t[n];e[r]=[n,o,Je(o)]}return e};var $e=function(t,e){return function(r){return null!=r&&(r[t]===e&&(void 0!==e||t in Object(r)))}};var Ze=function(t){var e=qe(t);return 1==e.length&&e[0][2]?$e(e[0][0],e[0][1]):function(r){return r===t||We(r,t,e)}};var Qe=function(t){return"symbol"==typeof t||Q(t)&&"[object Symbol]"==L(t)},Xe=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,tr=/^\w*$/;var er=function(t,e){if(ot(t))return!1;var r=typeof t;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=t&&!Qe(t))||(tr.test(t)||!Xe.test(t)||null!=e&&t in Object(e))};function rr(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var r=function(){var n=arguments,o=e?e.apply(this,n):n[0],i=r.cache;if(i.has(o))return i.get(o);var a=t.apply(this,n);return r.cache=i.set(o,a)||i,a};return r.cache=new(rr.Cache||ie),r}rr.Cache=ie;var nr=rr;var or=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ir=/\\(\\)?/g,ar=function(t){var e=nr(t,(function(t){return 500===r.size&&r.clear(),t})),r=e.cache;return e}((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(or,(function(t,r,n,o){e.push(n?o.replace(ir,"$1"):r||t)})),e}));var ur=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},cr=O?O.prototype:void 0,sr=cr?cr.toString:void 0;var lr=function t(e){if("string"==typeof e)return e;if(ot(e))return ur(e,t)+"";if(Qe(e))return sr?sr.call(e):"";var r=e+"";return"0"==r&&1/e==-1/0?"-0":r};var fr=function(t){return null==t?"":lr(t)};var dr=function(t,e){return ot(t)?t:er(t,e)?[t]:ar(fr(t))};var pr=function(t){if("string"==typeof t||Qe(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e};var vr=function(t,e){for(var r=0,n=(e=dr(e,t)).length;null!=t&&r<n;)t=t[pr(e[r++])];return r&&r==n?t:void 0};var hr=function(t,e,r){var n=null==t?void 0:vr(t,e);return void 0===n?r:n};var _r=function(t,e){return null!=t&&e in Object(t)};var yr=function(t,e,r){for(var n=-1,o=(e=dr(e,t)).length,i=!1;++n<o;){var a=pr(e[n]);if(!(i=null!=t&&r(t,a)))break;t=t[a]}return i||++n!=o?i:!!(o=null==t?0:t.length)&&st(o)&&ct(a,o)&&(ot(t)||nt(t))};var br=function(t,e){return null!=t&&yr(t,e,_r)};var gr=function(t,e){return er(t)&&Je(e)?$e(pr(t),e):function(r){var n=hr(r,t);return void 0===n&&n===e?br(r,t):Ve(e,n,3)}};var Er=function(t){return t};var Or=function(t){return function(e){return null==e?void 0:e[t]}};var Tr=function(t){return function(e){return vr(e,t)}};var Ir=function(t){return er(t)?Or(pr(t)):Tr(t)};var mr=function(t){return"function"==typeof t?t:null==t?Er:"object"==typeof t?ot(t)?gr(t[0],t[1]):Ze(t):Ir(t)};var Rr=function(t,e){var r={};return e=mr(e),Rt(t,(function(t,n,o){q(r,n,e(t,n,o))})),r};var Ar=function(t){return"number"==typeof t||Q(t)&&"[object Number]"==L(t)},jr=function(t){var e=t.css,r={};return Object.entries(e).forEach((function(t){var e=t[0],n=t[1];if(Ar(n))return a.default.isUnitlessNumber[e]?void(r[e]=""+n):void(r[e]=n+"px");r[e]=n})),f(f({},t),{css:f(f({},r),{boxSizing:"border-box"})})};var Nr,Sr="https://cdn.candu.ai",Lr="/api/checklistItems",Cr="/api/cards",wr="/api/segmentMemberships",Dr="/api/segmentsDefinition",Pr="/api/tutorialMetadata",kr="/api/tutorialDocumentsSdk",xr="wss://2jcfb7pjlf.execute-api.eu-west-1.amazonaws.com/prod",Ur=function(t){if(!document.querySelectorAll('[href="'+t+'"]').length){var e=document.createElement("link");e.setAttribute("rel","prefetch"),e.setAttribute("href",t),document.head.appendChild(e)}},Mr=function(){function t(t){this.adjacencyList={},this.rootDocument=t,this.adjacencyList[t]=[]}return t.prototype.get=function(t){return this.adjacencyList[t]},t.prototype.add=function(t,e){var r=this;if(this.adjacencyList[t]||(this.adjacencyList[t]=[]),!this.adjacencyList[e])return this.adjacencyList[t].push(e),this.adjacencyList[e]=[],!0;if(this.adjacencyList[t].includes(e))return!0;var n=function(e){if(e===t)return!0;for(var o=0,i=r.adjacencyList[e];o<i.length;o++){var a=i[o];if(n(a))return!0}return!1};return!n(e)&&(this.adjacencyList[t].push(e),!0)},t}(),Fr=function(t){return"candu.sdk."+t},Br=function(t){return Fr("error."+t)},Hr={UNKOWN_NODE_TYPE:"unknown_node_type",UNKOWN_BLOCK_NODE_TYPE:"unkown_block_node_type",UNKOWN_INLINE_NODE_TYPE:"unkown_inline_node_type",UNKOWN_NODE_OBJECT_TYPE:"unkown_node_object_type",TUTORIAL_ERROR:"tutorial_error_boundary",PORTAL_ERROR:"portal_error_boundary",PROVIDER_ERROR:"provider_error_boundary",STYLEGUIDE_MAP_ERROR:"styleguide_map",RENDER_NODE_ERROR:"render_node"},Gr={HEARTBEAT:Fr("heartbeat"),PREVIEW_OPEN:Fr("preview.open"),PORTAL:Fr("portal"),TUTORIAL:Fr("tutorial"),TUTORIAL_INTERACTION:Fr("tutorial.interaction"),PORTAL_ASSET_NOT_FOUND:Br("portal_asset_not_found"),PORTAL_NO_SEGMENT_IDS:Br("portal_no_segment_ids"),NO_MATCHING_TUTORIALS:Br("no_matching_tutorials"),NO_VALID_TUTORIAL_IDENTIFIER:Br("no_valid_tutorial_identifier"),COMMIT_API_LOADING_ERROR:Br("commit_api"),TUTORIAL_LOADING_ERROR:Br("tutorial"),UNKOWN_NODE_TYPE:Br(Hr.UNKOWN_NODE_TYPE),UNKOWN_INLINE_NODE_TYPE:Br(Hr.UNKOWN_INLINE_NODE_TYPE),UNKOWN_NODE_OBJECT_TYPE:Br(Hr.UNKOWN_NODE_OBJECT_TYPE),TUTORIAL_ERROR:Br(Hr.TUTORIAL_ERROR),PORTAL_ERROR:Br(Hr.PORTAL_ERROR),PROVIDER_ERROR:Br(Hr.PROVIDER_ERROR),STYLEGUIDE_MAP_ERROR:Br(Hr.TUTORIAL_ERROR),RENDER_NODE_ERROR:Br(Hr.TUTORIAL_ERROR),CIRCULAR_DEPENDENCY_EMBED_PORTAL:Br("circular_dependecy_embed_portal"),CIRCULAR_DEPENDENCY_EMBED_TUTORIAL:Br("circular_dependecy_embed_tutorial"),STATE_FETCH_FAILED:Br("state_fetch_failed"),STATE_UPDATE_FAILED:Br("state_update_failed"),SEGMENT_MEMBERSHIP_TIMEOUT:Br("segment_membership_timeout"),CHECKLIST_ITEM_STATE_UPDATED:Fr("tutorial.checklist_item_state_updated"),CHECKLIST_GROUP_COMPLETE:Fr("tutorial.checklist_group_complete"),CARD_DISMISSED:Fr("tutorial.card_dismissed")},Yr=function(t){return Fr("metric."+t)},zr={SEGMENT_MEMBERSHIP_LOAD_TIME:Yr("segment_membership_load_time"),PORTAL_LOAD_TIME:Yr("portal_load_time"),TUTORIAL_LOAD_TIME:Yr("tutorial_load_time"),TUTORIAL_DOCUMENT_MOUNT_TIME:Yr("tutorial_document_mount_time")},Kr=function(t){return"An error has occured while trying to parse your Tutorial.\nUpgrade the SDK to the latest version to get rid of this error.\nErrorCode: "+t+"."},Vr=((Nr={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"})[Gr.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",Nr[Gr.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",Nr[Gr.NO_MATCHING_TUTORIALS]="The Tutorial will not be rendered because there are no matching segments for the given user.",Nr[Gr.NO_VALID_TUTORIAL_IDENTIFIER]="(Candu/Tutorial) You must define one of tutorialId, slug, commitId or contentHashId.",Nr[Gr.TUTORIAL_LOADING_ERROR]="An error has occurred while trying to load the Tutorial",Nr[Gr.UNKOWN_INLINE_NODE_TYPE]=Kr(Hr.UNKOWN_INLINE_NODE_TYPE),Nr[Gr.UNKOWN_NODE_TYPE]=Kr(Hr.UNKOWN_NODE_TYPE),Nr[Gr.CIRCULAR_DEPENDENCY_EMBED_PORTAL]="Circular dependency found on Embeded Portal. Please take a look at the Portal Content.",Nr[Gr.CIRCULAR_DEPENDENCY_EMBED_TUTORIAL]="Circular dependency found on Embeded Tutorial. Please take a look at the Tutorial Content.",Nr[Gr.PORTAL_ERROR]="An error has occured within Portal",Nr[Gr.PROVIDER_ERROR]="An error has occured within Provider",Nr[Gr.TUTORIAL_ERROR]="An error has occured within Tutorial",Nr[Gr.RENDER_NODE_ERROR]="An error has occured while rendering tutorial node",Nr[Gr.STYLEGUIDE_MAP_ERROR]="An error has occured while mapping node to styleguide",Nr[Gr.STATE_FETCH_FAILED]="An error has occured while fetching state:",Nr[Gr.STATE_UPDATE_FAILED]="An error has occured while updating state:",Nr[Gr.SEGMENT_MEMBERSHIP_TIMEOUT]="Segment membership fetch has timed out",Nr),Wr={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},Jr={error:console.error,warning:console.warn},qr=function(t){return u.default(!t||C(t),"(Candu) styleguide must be undefined or an object")},$r=function(t,e){return p(void 0,void 0,void 0,(function(){return v(this,(function(r){switch(r.label){case 0:return[4,fetch(t,e&&{headers:e})];case 1:return[2,r.sent().json()]}}))}))},Zr=function(t){return $r("https://api.candu.ai"+t,{SDKVersion:"0.7.1-alpha.6"})},Qr=function(t){return $r(""+Sr+t,{SDKVersion:"0.7.1-alpha.6"})},Xr={tutorialDocumentLatestSaved:function(t,e){return p(void 0,void 0,void 0,(function(){return v(this,(function(r){return[2,Zr(kr+"/"+e+"?token="+t)]}))}))},portalAsset:function(t,e,r){return p(void 0,void 0,void 0,(function(){var n,o;return v(this,(function(i){return(null===(o=r)||void 0===o?void 0:o.length)?(n="?segmentIds="+r.join(","),[2,Qr("/portalMemberships/"+t+"/"+e+"/head.json"+n)]):[2,Qr("/portals/"+t+"/"+e+"/head.json")]}))}))},segmentMembership:function(t,e){return p(void 0,void 0,void 0,(function(){return v(this,(function(r){return[2,Zr(wr+"/"+e+"?token="+t)]}))}))},segmentDefinition:function(t){return p(void 0,void 0,void 0,(function(){return v(this,(function(e){return[2,Zr(Dr+"?token="+t)]}))}))},tutorialMetadata:function(t){return p(void 0,void 0,void 0,(function(){return v(this,(function(e){return[2,Zr(Pr+"?token="+t)]}))}))},tutorialSocket:function(t,e,r){var n=new WebSocket(xr+"?clientToken="+t+"&tutorialId="+e);return n.onmessage=function(t){var e=JSON.parse(t.data);r(e)},function(){return n.close()}},tutorialDocument:function(t,r,n){var o=t.contentHashId,i=t.tutorialId,a=t.tutorialDocument,u=t.slug,c=function(t){return{byId:function(e){return Zr(kr+"?token="+t+"&finder=latestPublished&tutorialId="+e)},bySlug:function(e){return Qr("/tutorials/"+t+"/"+e+".json")},byContentHash:function(e){return Qr("/tutorials/"+t+"/"+e+".json")}}}(r);return e.isTutorialSlug(u)?c.bySlug(u):e.isTutorialId(i)?c.byId(i):e.isContentHashId(o)?c.byContentHash(o):C(a)?Promise.resolve(a):(Jr.error(Vr[Gr.NO_VALID_TUTORIAL_IDENTIFIER]),n.track(Gr.NO_VALID_TUTORIAL_IDENTIFIER,{slug:t.slug}),null)}},tn=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return console.error.apply(console,t)},en=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return console.warn.apply(console,t)},rn={error:tn,warning:en},nn=function(){function t(){this.subscribers=[]}return t.prototype.subscribe=function(t){var e=this;return this.subscribers.push(t),function(){e.subscribers[e.subscribers.indexOf(t)]=function(){}}},t.prototype.notify=function(t){this.subscribers.forEach((function(e){return e(t)}))},t.prototype.clear=function(){this.subscribers=[]},t}(),on=function(){function t(){this.onClientUpdateObserver=new nn}return t.prototype.attachClient=function(t){this.client=t,this.onClientUpdateObserver.notify({client:t})},t.prototype.detachClient=function(){this.client&&(this.client=null,this.onClientUpdateObserver.notify({client:null}))},t.prototype.onClientUpdate=function(t){var e=this.onClientUpdateObserver.subscribe(t);return this.client&&t({client:this.client}),e},t}();var an="/home/runner/work/candu-sdk/candu-sdk/packages/candu-core/dist/core.cjs.js",un="0.7.1-alpha.6",cn=function(){function t(t){this.init(t)}return t.prototype.getInfo=function(){return{core:{version:un,name:an},sdk:{version:this.version,name:this.name}}},t.prototype.attachClient=function(t){return this.provider.preview.attachClient(t)},t.prototype.detachClient=function(){return this.provider.preview.detachClient()},Object.defineProperty(t.prototype,"provider",{get:function(){return this.getProvider()},enumerable:!0,configurable:!0}),t}(),sn=function(t){switch(t.trigger){case e.TRIGGERS.ON_CLICK:default:return"onClick"}},ln=function(t,r){var n,o,i,a,u,c;if("Link"===t.type&&(null===(n=t.props)||void 0===n?void 0:n.href)){var s=t.props.href+" Link Clicked",l=null===(i=null===(o=t)||void 0===o?void 0:o.nodes)||void 0===i?void 0:i[0];if(l){var p=r.document.nodes[l];"Text"===(null===(a=p)||void 0===a?void 0:a.type)&&(null===(c=null===(u=p)||void 0===u?void 0:u.props)||void 0===c?void 0:c.children)&&(s=p.props.children+" Link Clicked")}return{onClick:function(){var n;return r.provider.eventing.track(Gr.TUTORIAL_INTERACTION,{trigger:e.TRIGGERS.ON_CLICK,category:t.type,eventName:s,handler:{href:null===(n=t.props)||void 0===n?void 0:n.href,type:e.HANDLER_TYPES.NAVIGATE}})}}}if(!t.data||!t.data.actions)return{};var v=function(t,e){r.provider.eventing.track(Gr.TUTORIAL_INTERACTION,f(f({},t),e||{}))};return t.data.actions.map((function(t){return function(t,r,n){var o,i,a;switch(t.handler.type){case e.HANDLER_TYPES.NAVIGATE:return(o={})[sn(t)]=function(e){e.stopPropagation();var o=t.handler,i=o.href,a=o.target,u=n||{},c=u.parentTrackers,s=d(u,["parentTrackers"]);c&&c.forEach((function(e){return r(t,e)})),r(t,s),"Blank"===a?window.open(i,"_blank"):i&&i.includes("mailto:")?window.location=i:document.location.href=i},o;case e.HANDLER_TYPES.CHANGE_TUTORIAL:return(i={})[sn(t)]=function(){var e=t.handler.tutorialId;tn("TODO -> change tutorial",e)},i;case e.HANDLER_TYPES.OPEN_GUIDE:return(a={})[sn(t)]=function(){var e=t.handler.guideId;tn("TODO -> open guide",e)},a;default:return{}}}(t,v,r.trackingIdentifiers)})).reduce((function(t,e){return f(f({},t),e)}),{})},fn=function(t,e){var r=t.props||{},n=t.nodes,o=r.children;return o||(n?n.map(e):null)},dn=function(t,e){var r=t.states;return r&&e.stateProviderInstances.filter((function(t){return!!r[t.providerId]}))},pn=function(t,e){var r=t.nodes;return r&&r.map((function(t){return e.document.nodes[t]})).filter((function(t){return!!t})).map((function(t){return dn(t,e)||[]})).reduce((function(t,e){return t.concat(e)}),[])},vn=function(t,e){try{var r=e.provider,n=e.document,o=e.trackingIdentifiers,i=n.nodes[t];if(!i)return rn.error("Document is corrupted. Refusing to move further."),null;var a=function(t){return vn(t,e)},u=i.type,c=i.props,s=i.css,l=f(f(f({},c||{}),{style:s||{},children:fn(i,a)}),ln(i,{trackingIdentifiers:o,provider:r,document:n})),d={nodeId:t,node:i,document:n,render:{node:a,styleguide:function(t,r){return void 0===r&&(r={}),e.renderNode(t,{api:d,attributes:r})},tutorial:function(t){return e.renderTutorial(t)},portal:function(t){return e.renderPortal(t)}},trackingIdentifiers:o,stateInstances:dn(i,e),childrenStateInstances:pn(i,e)},p=d.render.styleguide(u,l);return p||(rn.error(Vr[Gr.UNKOWN_NODE_TYPE],{type:u}),r.eventing.error(new Error(Vr[Gr.UNKOWN_NODE_TYPE]),{type:u}),null)}catch(t){return rn.error(Vr[Gr.STYLEGUIDE_MAP_ERROR],t),e.provider.eventing.error(t),null}},hn=nr((function(t,e){var r,n,o=t.provider,i=t.portal,a=t.tutorial,u=o.styleguide;return a&&(n=a.styleguide),i&&(r=i.styleguide),f(f(f(f({},u||{}),r||{}),n||{}),e||{})})),_n=function(t){return"candu-styleguide-"+t},yn=function(t,e){var r,n,o,i,a="string"==typeof e&&e.split(" ");return a?1===a.length?((r={})[t+"Right"]=e,r[t+"Left"]=e,r[t+"Bottom"]=e,r[t+"Top"]=e,r):2===a.length?((n={})[t+"Top"]=a[0],n[t+"Right"]=a[1],n[t+"Bottom"]=a[0],n[t+"Left"]=a[1],n):3===a.length?((o={})[t+"Top"]=a[0],o[t+"Right"]=a[1],o[t+"Bottom"]=a[2],o[t+"Left"]=a[1],o):((i={})[t+"Top"]=a[0],i[t+"Right"]=a[1],i[t+"Bottom"]=a[2],i[t+"Left"]=a[3],i):{}};var bn=function(t,e){return function(r,n){if(null==r)return r;if(!It(r))return t(r,n);for(var o=r.length,i=e?o:-1,a=Object(r);(e?i--:++i<o)&&!1!==n(a[i],i,a););return r}}(Rt);var gn=function(t,e){var r=-1,n=It(t)?Array(t.length):[];return bn(t,(function(t,o,i){n[++r]=e(t,o,i)})),n};var En=function(t,e){return(ot(t)?ur:gn)(t,mr(e))},On=function(){function t(t,e,r){var n=this;this.observer=new nn,this.context=t,this.providerId=e,this.resolver=r,this.state=this.resolver.cache.load(this.providerId),this.resolver.retrieve(t,e).then((function(t){return n.updateState(t)})).catch((function(t){rn.error(Vr[Gr.STATE_FETCH_FAILED],t.message),n.context.eventing.track(Vr[Gr.STATE_FETCH_FAILED],{errorMessage:t.message})}))}return t.prototype.mutate=function(t){var e=this,r=this.state;this.updateState(f(f({},r),t)),this.resolver.update(this.context,this.providerId,t).then((function(t){return e.updateState(t)})).catch((function(t){rn.error(Vr[Gr.STATE_UPDATE_FAILED],t.message),e.context.eventing.track(Vr[Gr.STATE_UPDATE_FAILED],{errorMessage:t.message}),r&&e.updateState(r)}))},t.prototype.subscribe=function(t){var e=this.observer.subscribe(t);return this.state&&t(this.state),e},t.prototype.getResolvedState=function(){return this.state},t.prototype.updateState=function(t){this.state=t,this.resolver.cache.save(this.providerId,t),this.observer.notify(t)},t}(),Tn=function(){function t(t){void 0===t&&(t="candu-state:"),this.prefix=t}return t.prototype.save=function(t,e){try{window.localStorage.setItem(this.prefix+t,JSON.stringify(e))}catch(t){}},t.prototype.load=function(t){try{var e=window.localStorage.getItem(this.prefix+t);return e&&JSON.parse(e)}catch(t){return null}},t}(),In=Object.create(null),mn=function(){function t(t){this.cache=new Tn,this.options=f({},t||{})}return t.register=function(t,e){In[t]=e,e.prototype.type=t},t.fromJSON=function(t){var e=t.type,r=d(t,["type"]),n=In[e];return n?new n(r):null},t.prototype.toJSON=function(){return f({type:this.type},this.options)},t}();var Rn=function(t,e,r,n){for(var o=t.length,i=r+(n?1:-1);n?i--:++i<o;)if(e(t[i],i,t))return i;return-1};var An=function(t){return t!=t};var jn=function(t,e,r){for(var n=r-1,o=t.length;++n<o;)if(t[n]===e)return n;return-1};var Nn=function(t,e,r){return e==e?jn(t,e,r):Rn(t,An,r)};var Sn=function(t,e){return!!(null==t?0:t.length)&&Nn(t,e,0)>-1};var Ln=function(t,e,r){for(var n=-1,o=null==t?0:t.length;++n<o;)if(r(e,t[n]))return!0;return!1};var Cn=function(){},wn=Pe&&1/be(new Pe([,-0]))[1]==1/0?function(t){return new Pe(t)}:Cn;var Dn=function(t,e,r){var n=-1,o=Sn,i=t.length,a=!0,u=[],c=u;if(r)a=!1,o=Ln;else if(i>=200){var s=e?null:wn(t);if(s)return be(s);a=!1,o=ve,c=new de}else c=e?[]:u;t:for(;++n<i;){var l=t[n],f=e?e(l):l;if(l=r||0!==l?l:0,a&&f==f){for(var d=c.length;d--;)if(c[d]===f)continue t;e&&c.push(f),u.push(l)}else o(c,f,r)||(c!==u&&c.push(f),u.push(l))}return u};var Pn=function(t){return t&&t.length?Dn(t):[]},kn=function(){function t(){}return t.get=function(e,r){var n=t.loaders.get(e);if(n)return n;var o=new c.default(r,{cache:!1});return t.loaders.set(e,o),o},t.loaders=new Map,t}(),xn="https://api.candu.ai"+Cr,Un=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return l(e,t),e.prototype.retrieve=function(t,e){return p(this,void 0,void 0,(function(){var r,n,o=this;return v(this,(function(i){switch(i.label){case 0:return[4,kn.get("cardStateApi",(function(e){return p(o,void 0,void 0,(function(){var r;return v(this,(function(n){switch(n.label){case 0:return[4,fetch(xn+"?token="+t.clientToken+"&finder=byIds&ids="+Pn(e).join(",")+"&userId="+t.userId).then((function(t){return t.json()}))];case 1:return r=n.sent(),[2,e.map((function(t){return r.find((function(e){return e.id===t}))}))]}}))}))})).load(e)];case 1:return r=i.sent(),n={id:e,state:{dismissed:!1}},[2,r||n]}}))}))},e.prototype.update=function(t,e,r){return fetch(xn+"/"+e+"?token="+t.clientToken,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({state:r.state,userId:t.userId.toString()})}).then((function(t){return t.json()}))},e}(mn);mn.register(e.StateResolverType.CardApi,Un);var Mn="https://api.candu.ai"+Lr;function Fn(t){return{state:t.state,id:t.id}}function Bn(t){switch(t){case e.CheckListScope.Account:return"AccountId";case e.CheckListScope.User:default:return"UserId"}}var Hn=function(t){function r(){return null!==t&&t.apply(this,arguments)||this}return l(r,t),r.prototype.getScopeAndFieldFromContext=function(t){var r=this.options.scopeTrait,n=this.options.scope||e.CheckListScope.User,o=t.userId.toString();return n===e.CheckListScope.Account&&(r&&t.traits[r]?o=t.traits[r]:(en("trait '"+r+"' is not defined, falling back to user scope"),n=e.CheckListScope.User)),{scope:n,scopeField:o}},r.prototype.retrieve=function(t,r){return p(this,void 0,void 0,(function(){var n,o,i,a=this;return v(this,(function(u){switch(u.label){case 0:return n=this.getScopeAndFieldFromContext(t),o=n.scope,i=n.scopeField,[4,kn.get("checklistState",(function(e){return p(a,void 0,void 0,(function(){var r;return v(this,(function(n){switch(n.label){case 0:return[4,fetch(Mn+"?token="+t.clientToken+"&byTrait="+Bn(o)+"&field="+i+"&finder=byIds&ids="+Pn(e).join(",")).then((function(t){return t.json()})).then((function(t){return t.map(Fn)}))];case 1:return r=n.sent(),[2,e.map((function(t){return r.find((function(e){return e.id===t}))}))]}}))}))})).load(r)];case 1:return[2,u.sent()||{id:r,state:e.CheckListItemStatus.NotStared}]}}))}))},r.prototype.update=function(t,e,r){var n=this.getScopeAndFieldFromContext(t),o=n.scope,i=n.scopeField;return fetch(Mn+"/"+e+"?token="+t.clientToken,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(f(f({},r),{byTrait:Bn(o),field:i}))}).then((function(t){return t.json()})).then(Fn)},r}(mn);mn.register(e.StateResolverType.CheckListApi,Hn);exports.CardResolverInstance=Un,exports.CheckListResolverInstance=Hn,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=Vr,exports.ERROR_SLUGS=Hr,exports.EVENT_NAMES=Gr,exports.LOGGER=Jr,exports.METRICS=zr,exports.Observer=nn,exports.PreviewContainer=on,exports.RESOURCES=Xr,exports.STYLEGUIDE_COLORS={primary:"#6310E5",secondary:"#59C3C3",tertiary:"#4D515D",warning:"#FCAD0D",danger:"#EE4266"},exports.SingletonAPI=cn,exports.StateProviderInstance=On,exports.StateResolverInstance=mn,exports.TutorialDependencies=Mr,exports.adaptCustomNodes=function(t){return Rr(t,(function(t){var e=t;return"Typography"===e.type&&(e=function(t){var e=hr(t,"data.custom.variant","P");return f(f({},t),{type:e})}(e)),e.css&&C(e.css)&&e.css.flexBasis&&(e=function(t){var e=t.css.flexBasis;return"0"===e||"0px"===e?f(f({},t),{css:f(f({},t.css),{flexBasis:"0%"})}):t}(e)),e.css&&(e=jr(e)),e}))},exports.attachStylesheet=function(t,e){void 0===e&&(e="main");var r=_n(t);if(!document.getElementById(r)){var n=document.createElement("link");n.setAttribute("id",r),n.setAttribute("rel","stylesheet"),n.setAttribute("href",Sr+"/styleguides/applications/"+t+"/default/"+e+".css"),document.head.appendChild(n)}},exports.calculateGroupCompletion=function(t,r){var n=Object.values(t).filter((function(t){return t.status===e.CheckListItemStatus.Done})).length;return{completedItems:n,percComplete:r?Math.round(100*n/r):0}},exports.checkCyclicAndAdd=function(t,e){return t.dependencies.add(t.id,e)},exports.createSingleton=function(t){var e,r,n=function(t){return function(){for(var e,n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];if(r.api)return(e=r.api)[t].apply(e,n);console.warn("Please initialize the SDK by calling Candu.init() before attempting to call "+t)}};return(e=function(){function e(){}return e.init=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return this.api||(e.api=new(t.bind.apply(t,h([void 0],r)))),e.subscriberCallbacks.forEach((function(t){return t()})),e.subscriberCallbacks=[],window.postMessage({source:"CANDU_SINGLETON",payload:{type:"INIT"}},window&&window.origin?window.origin:"*"),e},e.onProviderReady=function(t){if(e.api)return t();e.subscriberCallbacks.push(t)},e}()).subscriberCallbacks=[],e.renderTutorial=n("renderTutorial"),e.renderPortal=n("renderPortal"),e.attachClient=n("attachClient"),e.detachClient=n("detachClient"),e.getProvider=n("getProvider"),e.getInfo=n("getInfo"),r=e,window.Candu=r,r},exports.createTutorialDocumentContext=function(t,e){return{id:t,dependencies:e?e.dependencies:new Mr(t)}},exports.defaultStyleguide=Wr,exports.detachStylesheet=function(t){var e=document.getElementById(_n(t));e&&e.remove()},exports.fetchHead=function(t,e){t&&ot(t)&&t.map((function(t){var r=t.nodeType,n=t.url;return Ur("EmbedTutorial"===r?Sr+"/tutorials/"+e+"/"+n+".json":"EmbedPortal"===r?Sr+"/portals/"+e+"/"+n+"/head.json":n)}))},exports.findMatchingSegment=function(t,r){var n=r.reduce((function(t,e){var r;return f(f({},t),((r={})[e]=e,r))}),{});return t.content.find((function(t){var r=t.segmentId;return!!n[r]||r===e.DEFAULT_SEGMENT_ID}))},exports.getCheckListStateProviders=function(t){return t.filter((function(t){return t.resolver instanceof Hn}))},exports.getContentState=function(t){return t.lastModifiedAt===t.lastPublishedAt?"Published":t.lastPublishedAt?"Unsynced":"Draft"},exports.getFirstNotStartedItem=function(t,r){for(var n=Object.values(t),o=function(t){var r=n.find((function(e){return e.position===t}));if(!r||r.status===e.CheckListItemStatus.NotStared)return{value:t}},i=0;i<r;i+=1){var a=o(i);if("object"==typeof a)return a.value}},exports.getInitialItems=function(t){var e={};return t.forEach((function(t,r){var n=t.getResolvedState();n&&(e[n.id]={status:n.state,position:r})})),e},exports.includeHTMLWhitespaces=function(t){return t.replace(/\s/g,"&nbsp;")},exports.initStateProviders=function(t,e){return En(t,(function(t,r){var n=mn.fromJSON(t.resolver);return n?new On(e,r,n):null})).filter((function(t){return!!t}))},exports.internalEventing=function(t){var e=t.identify,r=t.track;return{provider:function(t){var n=t.userId,o=t.traits,i=t.styleguide;e(n,o),r(Gr.HEARTBEAT,function(t){var e={};return Object.keys(t).forEach((function(r){Wr[r]&&(e["styleguide."+r]=t[r].displayName||!0)})),e}(i))},tutorialDocumentLoadingError:function(t){var e=t.tutorialId,n=t.slug,o=t.contentHashId;Jr.error(Vr[Gr.TUTORIAL_LOADING_ERROR]),r(Gr.TUTORIAL_LOADING_ERROR,{tutorialId:e,slug:n,contentHashId:o})}}},exports.logError=tn,exports.logWarning=en,exports.logger=rn,exports.mapNodeToStyleguide=vn,exports.mergeStyleguidesFromContext=hn,exports.normalizeCss=jr,exports.portalValidation=function(t){var e=t.slug,r=t.styleguide;return qr(r),{slug:e,styleguide:r||{}}},exports.providerValidation=function(t){var n=t.clientToken,o=t.userId,i=t.traits,a=t.options,c=t.styleguide,s=d(t,["clientToken","userId","traits","options","styleguide"]);return u.default(e.isClientToken(n),"(Candu) you must provide a valid clientToken"),u.default(!o||e.isUserId(o),"(Candu) you must provide a valid userId"),qr(c),u.default(!i||C(i),"(Candu) traits must be undefined or an object"),u.default(!a||C(a),"(Candu) options must be undefined or an object"),f(f({},s),{clientToken:n,traits:i||{},options:a||{},styleguide:c||{},userId:o||r.getAnonymousId()})},exports.stripHTML=function(t){return DOMParser?(new DOMParser).parseFromString(t,"text/html").body.textContent||"":t},exports.tutorialValidation=function(t){var e=t.slug,r=t.styleguide,n=t.contentHashId,o=t.tutorialId,i=t.tutorialDocument,a=t.renderedByClient,u=d(t,["slug","styleguide","contentHashId","tutorialId","tutorialDocument","renderedByClient"]);return qr(r),f(f({},u),{slug:e,styleguide:r||{},contentHashId:n,tutorialId:o,tutorialDocument:i,renderedByClient:a})},exports.unpackShorthandStyles=function(t){var e=t.padding,r=t.margin,n=d(t,["padding","margin"]),o={};return e&&(o=f(f({},o),yn("padding",e))),r&&(o=f(f({},o),yn("margin",r))),f(f({},o),n)};
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("react-style-object-to-css/lib/CSSProperty"),e=require("@candulabs/models"),r=require("@candulabs/eventing"),n=require("invariant");require("setimmediate");var o=require("dataloader");function i(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var a=i(t),u=i(n),c=i(o),s=function(t,e){return(s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)};function l(t,e){function r(){this.constructor=t}s(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var f=function(){return(f=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function d(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r}function p(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}c((n=n.apply(t,e||[])).next())}))}function v(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}function h(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;var n=Array(t),o=0;for(e=0;e<r;e++)for(var i=arguments[e],a=0,u=i.length;a<u;a++,o++)n[o]=i[a];return n}var _="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function y(t){var e={exports:{}};return t(e,e.exports),e.exports}var b="object"==typeof _&&_&&_.Object===Object&&_,g="object"==typeof self&&self&&self.Object===Object&&self,E=b||g||Function("return this")(),O=E.Symbol,T=Object.prototype,I=T.hasOwnProperty,m=T.toString,R=O?O.toStringTag:void 0;var A=function(t){var e=I.call(t,R),r=t[R];try{t[R]=void 0;var n=!0}catch(t){}var o=m.call(t);return n&&(e?t[R]=r:delete t[R]),o},j=Object.prototype.toString;var N=function(t){return j.call(t)},S=O?O.toStringTag:void 0;var L=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":S&&S in Object(t)?A(t):N(t)};var C=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)};var w,D=function(t){if(!C(t))return!1;var e=L(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e},P=E["__core-js_shared__"],k=(w=/[^.]+$/.exec(P&&P.keys&&P.keys.IE_PROTO||""))?"Symbol(src)_1."+w:"";var x=function(t){return!!k&&k in t},U=Function.prototype.toString;var M=function(t){if(null!=t){try{return U.call(t)}catch(t){}try{return t+""}catch(t){}}return""},F=/^\[object .+?Constructor\]$/,B=Function.prototype,H=Object.prototype,G=B.toString,Y=H.hasOwnProperty,z=RegExp("^"+G.call(Y).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var K=function(t){return!(!C(t)||x(t))&&(D(t)?z:F).test(M(t))};var V=function(t,e){return null==t?void 0:t[e]};var W=function(t,e){var r=V(t,e);return K(r)?r:void 0},J=function(){try{var t=W(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();var q=function(t,e,r){"__proto__"==e&&J?J(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r};var $=function(t){return function(e,r,n){for(var o=-1,i=Object(e),a=n(e),u=a.length;u--;){var c=a[t?u:++o];if(!1===r(i[c],c,i))break}return e}}();var Z=function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n};var Q=function(t){return null!=t&&"object"==typeof t};var X=function(t){return Q(t)&&"[object Arguments]"==L(t)},tt=Object.prototype,et=tt.hasOwnProperty,rt=tt.propertyIsEnumerable,nt=X(function(){return arguments}())?X:function(t){return Q(t)&&et.call(t,"callee")&&!rt.call(t,"callee")},ot=Array.isArray;var it=function(){return!1},at=y((function(t,e){var r=e&&!e.nodeType&&e,n=r&&t&&!t.nodeType&&t,o=n&&n.exports===r?E.Buffer:void 0,i=(o?o.isBuffer:void 0)||it;t.exports=i})),ut=/^(?:0|[1-9]\d*)$/;var ct=function(t,e){var r=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==r||"symbol"!=r&&ut.test(t))&&t>-1&&t%1==0&&t<e};var st=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991},lt={};lt["[object Float32Array]"]=lt["[object Float64Array]"]=lt["[object Int8Array]"]=lt["[object Int16Array]"]=lt["[object Int32Array]"]=lt["[object Uint8Array]"]=lt["[object Uint8ClampedArray]"]=lt["[object Uint16Array]"]=lt["[object Uint32Array]"]=!0,lt["[object Arguments]"]=lt["[object Array]"]=lt["[object ArrayBuffer]"]=lt["[object Boolean]"]=lt["[object DataView]"]=lt["[object Date]"]=lt["[object Error]"]=lt["[object Function]"]=lt["[object Map]"]=lt["[object Number]"]=lt["[object Object]"]=lt["[object RegExp]"]=lt["[object Set]"]=lt["[object String]"]=lt["[object WeakMap]"]=!1;var ft=function(t){return Q(t)&&st(t.length)&&!!lt[L(t)]};var dt=function(t){return function(e){return t(e)}},pt=y((function(t,e){var r=e&&!e.nodeType&&e,n=r&&t&&!t.nodeType&&t,o=n&&n.exports===r&&b.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})),vt=pt&&pt.isTypedArray,ht=vt?dt(vt):ft,_t=Object.prototype.hasOwnProperty;var yt=function(t,e){var r=ot(t),n=!r&&nt(t),o=!r&&!n&&at(t),i=!r&&!n&&!o&&ht(t),a=r||n||o||i,u=a?Z(t.length,String):[],c=u.length;for(var s in t)!e&&!_t.call(t,s)||a&&("length"==s||o&&("offset"==s||"parent"==s)||i&&("buffer"==s||"byteLength"==s||"byteOffset"==s)||ct(s,c))||u.push(s);return u},bt=Object.prototype;var gt=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||bt)};var Et=function(t,e){return function(r){return t(e(r))}}(Object.keys,Object),Ot=Object.prototype.hasOwnProperty;var Tt=function(t){if(!gt(t))return Et(t);var e=[];for(var r in Object(t))Ot.call(t,r)&&"constructor"!=r&&e.push(r);return e};var It=function(t){return null!=t&&st(t.length)&&!D(t)};var mt=function(t){return It(t)?yt(t):Tt(t)};var Rt=function(t,e){return t&&$(t,e,mt)};var At=function(){this.__data__=[],this.size=0};var jt=function(t,e){return t===e||t!=t&&e!=e};var Nt=function(t,e){for(var r=t.length;r--;)if(jt(t[r][0],e))return r;return-1},St=Array.prototype.splice;var Lt=function(t){var e=this.__data__,r=Nt(e,t);return!(r<0)&&(r==e.length-1?e.pop():St.call(e,r,1),--this.size,!0)};var Ct=function(t){var e=this.__data__,r=Nt(e,t);return r<0?void 0:e[r][1]};var wt=function(t){return Nt(this.__data__,t)>-1};var Dt=function(t,e){var r=this.__data__,n=Nt(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this};function 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=At,Pt.prototype.delete=Lt,Pt.prototype.get=Ct,Pt.prototype.has=wt,Pt.prototype.set=Dt;var kt=Pt;var xt=function(){this.__data__=new kt,this.size=0};var Ut=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r};var Mt=function(t){return this.__data__.get(t)};var Ft=function(t){return this.__data__.has(t)},Bt=W(E,"Map"),Ht=W(Object,"create");var Gt=function(){this.__data__=Ht?Ht(null):{},this.size=0};var Yt=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},zt=Object.prototype.hasOwnProperty;var Kt=function(t){var e=this.__data__;if(Ht){var r=e[t];return"__lodash_hash_undefined__"===r?void 0:r}return zt.call(e,t)?e[t]:void 0},Vt=Object.prototype.hasOwnProperty;var Wt=function(t){var e=this.__data__;return Ht?void 0!==e[t]:Vt.call(e,t)};var Jt=function(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=Ht&&void 0===e?"__lodash_hash_undefined__":e,this};function qt(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])}}qt.prototype.clear=Gt,qt.prototype.delete=Yt,qt.prototype.get=Kt,qt.prototype.has=Wt,qt.prototype.set=Jt;var $t=qt;var Zt=function(){this.size=0,this.__data__={hash:new $t,map:new(Bt||kt),string:new $t}};var Qt=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t};var Xt=function(t,e){var r=t.__data__;return Qt(e)?r["string"==typeof e?"string":"hash"]:r.map};var te=function(t){var e=Xt(this,t).delete(t);return this.size-=e?1:0,e};var ee=function(t){return Xt(this,t).get(t)};var re=function(t){return Xt(this,t).has(t)};var ne=function(t,e){var r=Xt(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this};function oe(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}oe.prototype.clear=Zt,oe.prototype.delete=te,oe.prototype.get=ee,oe.prototype.has=re,oe.prototype.set=ne;var ie=oe;var ae=function(t,e){var r=this.__data__;if(r instanceof kt){var n=r.__data__;if(!Bt||n.length<199)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new ie(n)}return r.set(t,e),this.size=r.size,this};function ue(t){var e=this.__data__=new kt(t);this.size=e.size}ue.prototype.clear=xt,ue.prototype.delete=Ut,ue.prototype.get=Mt,ue.prototype.has=Ft,ue.prototype.set=ae;var ce=ue;var se=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this};var le=function(t){return this.__data__.has(t)};function fe(t){var e=-1,r=null==t?0:t.length;for(this.__data__=new ie;++e<r;)this.add(t[e])}fe.prototype.add=fe.prototype.push=se,fe.prototype.has=le;var de=fe;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 ve=function(t,e){return t.has(e)};var he=function(t,e,r,n,o,i){var a=1&r,u=t.length,c=e.length;if(u!=c&&!(a&&c>u))return!1;var s=i.get(t);if(s&&i.get(e))return s==e;var l=-1,f=!0,d=2&r?new de:void 0;for(i.set(t,e),i.set(e,t);++l<u;){var p=t[l],v=e[l];if(n)var h=a?n(v,p,l,e,t,i):n(p,v,l,t,e,i);if(void 0!==h){if(h)continue;f=!1;break}if(d){if(!pe(e,(function(t,e){if(!ve(d,e)&&(p===t||o(p,t,r,n,i)))return d.push(e)}))){f=!1;break}}else if(p!==v&&!o(p,v,r,n,i)){f=!1;break}}return i.delete(t),i.delete(e),f},_e=E.Uint8Array;var ye=function(t){var e=-1,r=Array(t.size);return t.forEach((function(t,n){r[++e]=[n,t]})),r};var be=function(t){var e=-1,r=Array(t.size);return t.forEach((function(t){r[++e]=t})),r},ge=O?O.prototype:void 0,Ee=ge?ge.valueOf:void 0;var Oe=function(t,e,r,n,o,i,a){switch(r){case"[object DataView]":if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case"[object ArrayBuffer]":return!(t.byteLength!=e.byteLength||!i(new _e(t),new _e(e)));case"[object Boolean]":case"[object Date]":case"[object Number]":return jt(+t,+e);case"[object Error]":return t.name==e.name&&t.message==e.message;case"[object RegExp]":case"[object String]":return t==e+"";case"[object Map]":var u=ye;case"[object Set]":var c=1&n;if(u||(u=be),t.size!=e.size&&!c)return!1;var s=a.get(t);if(s)return s==e;n|=2,a.set(t,e);var l=he(u(t),u(e),n,o,i,a);return a.delete(t),l;case"[object Symbol]":if(Ee)return Ee.call(t)==Ee.call(e)}return!1};var Te=function(t,e){for(var r=-1,n=e.length,o=t.length;++r<n;)t[o+r]=e[r];return t};var Ie=function(t,e,r){var n=e(t);return ot(t)?n:Te(n,r(t))};var me=function(t,e){for(var r=-1,n=null==t?0:t.length,o=0,i=[];++r<n;){var a=t[r];e(a,r,t)&&(i[o++]=a)}return i};var Re=function(){return[]},Ae=Object.prototype.propertyIsEnumerable,je=Object.getOwnPropertySymbols,Ne=je?function(t){return null==t?[]:(t=Object(t),me(je(t),(function(e){return Ae.call(t,e)})))}:Re;var Se=function(t){return Ie(t,mt,Ne)},Le=Object.prototype.hasOwnProperty;var Ce=function(t,e,r,n,o,i){var a=1&r,u=Se(t),c=u.length;if(c!=Se(e).length&&!a)return!1;for(var s=c;s--;){var l=u[s];if(!(a?l in e:Le.call(e,l)))return!1}var f=i.get(t);if(f&&i.get(e))return f==e;var d=!0;i.set(t,e),i.set(e,t);for(var p=a;++s<c;){var v=t[l=u[s]],h=e[l];if(n)var _=a?n(h,v,l,e,t,i):n(v,h,l,t,e,i);if(!(void 0===_?v===h||o(v,h,r,n,i):_)){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 i.delete(t),i.delete(e),d},we=W(E,"DataView"),De=W(E,"Promise"),Pe=W(E,"Set"),ke=W(E,"WeakMap"),xe=M(we),Ue=M(Bt),Me=M(De),Fe=M(Pe),Be=M(ke),He=L;(we&&"[object DataView]"!=He(new we(new ArrayBuffer(1)))||Bt&&"[object Map]"!=He(new Bt)||De&&"[object Promise]"!=He(De.resolve())||Pe&&"[object Set]"!=He(new Pe)||ke&&"[object WeakMap]"!=He(new ke))&&(He=function(t){var e=L(t),r="[object Object]"==e?t.constructor:void 0,n=r?M(r):"";if(n)switch(n){case xe:return"[object DataView]";case Ue:return"[object Map]";case Me:return"[object Promise]";case Fe:return"[object Set]";case Be:return"[object WeakMap]"}return e});var Ge=He,Ye="[object Object]",ze=Object.prototype.hasOwnProperty;var Ke=function(t,e,r,n,o,i){var a=ot(t),u=ot(e),c=a?"[object Array]":Ge(t),s=u?"[object Array]":Ge(e),l=(c="[object Arguments]"==c?Ye:c)==Ye,f=(s="[object Arguments]"==s?Ye:s)==Ye,d=c==s;if(d&&at(t)){if(!at(e))return!1;a=!0,l=!1}if(d&&!l)return i||(i=new ce),a||ht(t)?he(t,e,r,n,o,i):Oe(t,e,c,r,n,o,i);if(!(1&r)){var p=l&&ze.call(t,"__wrapped__"),v=f&&ze.call(e,"__wrapped__");if(p||v){var h=p?t.value():t,_=v?e.value():e;return i||(i=new ce),o(h,_,r,n,i)}}return!!d&&(i||(i=new ce),Ce(t,e,r,n,o,i))};var Ve=function t(e,r,n,o,i){return e===r||(null==e||null==r||!Q(e)&&!Q(r)?e!=e&&r!=r:Ke(e,r,n,o,t,i))};var We=function(t,e,r,n){var o=r.length,i=o,a=!n;if(null==t)return!i;for(t=Object(t);o--;){var u=r[o];if(a&&u[2]?u[1]!==t[u[0]]:!(u[0]in t))return!1}for(;++o<i;){var c=(u=r[o])[0],s=t[c],l=u[1];if(a&&u[2]){if(void 0===s&&!(c in t))return!1}else{var f=new ce;if(n)var d=n(s,l,c,t,e,f);if(!(void 0===d?Ve(l,s,3,n,f):d))return!1}}return!0};var Je=function(t){return t==t&&!C(t)};var qe=function(t){for(var e=mt(t),r=e.length;r--;){var n=e[r],o=t[n];e[r]=[n,o,Je(o)]}return e};var $e=function(t,e){return function(r){return null!=r&&(r[t]===e&&(void 0!==e||t in Object(r)))}};var Ze=function(t){var e=qe(t);return 1==e.length&&e[0][2]?$e(e[0][0],e[0][1]):function(r){return r===t||We(r,t,e)}};var Qe=function(t){return"symbol"==typeof t||Q(t)&&"[object Symbol]"==L(t)},Xe=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,tr=/^\w*$/;var er=function(t,e){if(ot(t))return!1;var r=typeof t;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=t&&!Qe(t))||(tr.test(t)||!Xe.test(t)||null!=e&&t in Object(e))};function rr(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var r=function(){var n=arguments,o=e?e.apply(this,n):n[0],i=r.cache;if(i.has(o))return i.get(o);var a=t.apply(this,n);return r.cache=i.set(o,a)||i,a};return r.cache=new(rr.Cache||ie),r}rr.Cache=ie;var nr=rr;var or=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ir=/\\(\\)?/g,ar=function(t){var e=nr(t,(function(t){return 500===r.size&&r.clear(),t})),r=e.cache;return e}((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(or,(function(t,r,n,o){e.push(n?o.replace(ir,"$1"):r||t)})),e}));var ur=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},cr=O?O.prototype:void 0,sr=cr?cr.toString:void 0;var lr=function t(e){if("string"==typeof e)return e;if(ot(e))return ur(e,t)+"";if(Qe(e))return sr?sr.call(e):"";var r=e+"";return"0"==r&&1/e==-1/0?"-0":r};var fr=function(t){return null==t?"":lr(t)};var dr=function(t,e){return ot(t)?t:er(t,e)?[t]:ar(fr(t))};var pr=function(t){if("string"==typeof t||Qe(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e};var vr=function(t,e){for(var r=0,n=(e=dr(e,t)).length;null!=t&&r<n;)t=t[pr(e[r++])];return r&&r==n?t:void 0};var hr=function(t,e,r){var n=null==t?void 0:vr(t,e);return void 0===n?r:n};var _r=function(t,e){return null!=t&&e in Object(t)};var yr=function(t,e,r){for(var n=-1,o=(e=dr(e,t)).length,i=!1;++n<o;){var a=pr(e[n]);if(!(i=null!=t&&r(t,a)))break;t=t[a]}return i||++n!=o?i:!!(o=null==t?0:t.length)&&st(o)&&ct(a,o)&&(ot(t)||nt(t))};var br=function(t,e){return null!=t&&yr(t,e,_r)};var gr=function(t,e){return er(t)&&Je(e)?$e(pr(t),e):function(r){var n=hr(r,t);return void 0===n&&n===e?br(r,t):Ve(e,n,3)}};var Er=function(t){return t};var Or=function(t){return function(e){return null==e?void 0:e[t]}};var Tr=function(t){return function(e){return vr(e,t)}};var Ir=function(t){return er(t)?Or(pr(t)):Tr(t)};var mr=function(t){return"function"==typeof t?t:null==t?Er:"object"==typeof t?ot(t)?gr(t[0],t[1]):Ze(t):Ir(t)};var Rr=function(t,e){var r={};return e=mr(e),Rt(t,(function(t,n,o){q(r,n,e(t,n,o))})),r};var Ar=function(t){return"number"==typeof t||Q(t)&&"[object Number]"==L(t)},jr=function(t){var e=t.css,r={};return Object.entries(e).forEach((function(t){var e=t[0],n=t[1];if(Ar(n))return a.default.isUnitlessNumber[e]?void(r[e]=""+n):void(r[e]=n+"px");r[e]=n})),f(f({},t),{css:f(f({},r),{boxSizing:"border-box"})})};var Nr,Sr="https://cdn.candu.ai",Lr="/api/checklistItems",Cr="/api/cards",wr="/api/segmentMemberships",Dr="/api/segmentsDefinition",Pr="/api/tutorialMetadata",kr="/api/tutorialDocumentsSdk",xr="wss://2jcfb7pjlf.execute-api.eu-west-1.amazonaws.com/prod",Ur=function(t){if(!document.querySelectorAll('[href="'+t+'"]').length){var e=document.createElement("link");e.setAttribute("rel","prefetch"),e.setAttribute("href",t),document.head.appendChild(e)}},Mr=function(){function t(t){this.adjacencyList={},this.rootDocument=t,this.adjacencyList[t]=[]}return t.prototype.get=function(t){return this.adjacencyList[t]},t.prototype.add=function(t,e){var r=this;if(this.adjacencyList[t]||(this.adjacencyList[t]=[]),!this.adjacencyList[e])return this.adjacencyList[t].push(e),this.adjacencyList[e]=[],!0;if(this.adjacencyList[t].includes(e))return!0;var n=function(e){if(e===t)return!0;for(var o=0,i=r.adjacencyList[e];o<i.length;o++){var a=i[o];if(n(a))return!0}return!1};return!n(e)&&(this.adjacencyList[t].push(e),!0)},t}(),Fr=function(t){return"candu.sdk."+t},Br=function(t){return Fr("error."+t)},Hr={UNKOWN_NODE_TYPE:"unknown_node_type",UNKOWN_BLOCK_NODE_TYPE:"unkown_block_node_type",UNKOWN_INLINE_NODE_TYPE:"unkown_inline_node_type",UNKOWN_NODE_OBJECT_TYPE:"unkown_node_object_type",TUTORIAL_ERROR:"tutorial_error_boundary",PORTAL_ERROR:"portal_error_boundary",PROVIDER_ERROR:"provider_error_boundary",STYLEGUIDE_MAP_ERROR:"styleguide_map",RENDER_NODE_ERROR:"render_node"},Gr={HEARTBEAT:Fr("heartbeat"),PREVIEW_OPEN:Fr("preview.open"),PORTAL:Fr("portal"),TUTORIAL:Fr("tutorial"),TUTORIAL_INTERACTION:Fr("tutorial.interaction"),PORTAL_ASSET_NOT_FOUND:Br("portal_asset_not_found"),PORTAL_NO_SEGMENT_IDS:Br("portal_no_segment_ids"),NO_MATCHING_TUTORIALS:Br("no_matching_tutorials"),NO_VALID_TUTORIAL_IDENTIFIER:Br("no_valid_tutorial_identifier"),COMMIT_API_LOADING_ERROR:Br("commit_api"),TUTORIAL_LOADING_ERROR:Br("tutorial"),UNKOWN_NODE_TYPE:Br(Hr.UNKOWN_NODE_TYPE),UNKOWN_INLINE_NODE_TYPE:Br(Hr.UNKOWN_INLINE_NODE_TYPE),UNKOWN_NODE_OBJECT_TYPE:Br(Hr.UNKOWN_NODE_OBJECT_TYPE),TUTORIAL_ERROR:Br(Hr.TUTORIAL_ERROR),PORTAL_ERROR:Br(Hr.PORTAL_ERROR),PROVIDER_ERROR:Br(Hr.PROVIDER_ERROR),STYLEGUIDE_MAP_ERROR:Br(Hr.TUTORIAL_ERROR),RENDER_NODE_ERROR:Br(Hr.TUTORIAL_ERROR),CIRCULAR_DEPENDENCY_EMBED_PORTAL:Br("circular_dependecy_embed_portal"),CIRCULAR_DEPENDENCY_EMBED_TUTORIAL:Br("circular_dependecy_embed_tutorial"),STATE_FETCH_FAILED:Br("state_fetch_failed"),STATE_UPDATE_FAILED:Br("state_update_failed"),SEGMENT_MEMBERSHIP_TIMEOUT:Br("segment_membership_timeout"),CHECKLIST_ITEM_STATE_UPDATED:Fr("tutorial.checklist_item_state_updated"),CHECKLIST_GROUP_COMPLETE:Fr("tutorial.checklist_group_complete"),CARD_DISMISSED:Fr("tutorial.card_dismissed")},Yr=function(t){return Fr("metric."+t)},zr={SEGMENT_MEMBERSHIP_LOAD_TIME:Yr("segment_membership_load_time"),PORTAL_LOAD_TIME:Yr("portal_load_time"),TUTORIAL_LOAD_TIME:Yr("tutorial_load_time"),TUTORIAL_DOCUMENT_MOUNT_TIME:Yr("tutorial_document_mount_time")},Kr=function(t){return"An error has occured while trying to parse your Tutorial.\nUpgrade the SDK to the latest version to get rid of this error.\nErrorCode: "+t+"."},Vr=((Nr={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"})[Gr.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",Nr[Gr.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",Nr[Gr.NO_MATCHING_TUTORIALS]="The Tutorial will not be rendered because there are no matching segments for the given user.",Nr[Gr.NO_VALID_TUTORIAL_IDENTIFIER]="(Candu/Tutorial) You must define one of tutorialId, slug, commitId or contentHashId.",Nr[Gr.TUTORIAL_LOADING_ERROR]="An error has occurred while trying to load the Tutorial",Nr[Gr.UNKOWN_INLINE_NODE_TYPE]=Kr(Hr.UNKOWN_INLINE_NODE_TYPE),Nr[Gr.UNKOWN_NODE_TYPE]=Kr(Hr.UNKOWN_NODE_TYPE),Nr[Gr.CIRCULAR_DEPENDENCY_EMBED_PORTAL]="Circular dependency found on Embeded Portal. Please take a look at the Portal Content.",Nr[Gr.CIRCULAR_DEPENDENCY_EMBED_TUTORIAL]="Circular dependency found on Embeded Tutorial. Please take a look at the Tutorial Content.",Nr[Gr.PORTAL_ERROR]="An error has occured within Portal",Nr[Gr.PROVIDER_ERROR]="An error has occured within Provider",Nr[Gr.TUTORIAL_ERROR]="An error has occured within Tutorial",Nr[Gr.RENDER_NODE_ERROR]="An error has occured while rendering tutorial node",Nr[Gr.STYLEGUIDE_MAP_ERROR]="An error has occured while mapping node to styleguide",Nr[Gr.STATE_FETCH_FAILED]="An error has occured while fetching state:",Nr[Gr.STATE_UPDATE_FAILED]="An error has occured while updating state:",Nr[Gr.SEGMENT_MEMBERSHIP_TIMEOUT]="Segment membership fetch has timed out",Nr),Wr={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},Jr={error:console.error,warning:console.warn},qr=function(t){return u.default(!t||C(t),"(Candu) styleguide must be undefined or an object")},$r=function(t,e){return p(void 0,void 0,void 0,(function(){return v(this,(function(r){switch(r.label){case 0:return[4,fetch(t,e&&{headers:e})];case 1:return[2,r.sent().json()]}}))}))},Zr=function(t){return $r("https://api.candu.ai"+t,{SDKVersion:"0.7.1-alpha.7"})},Qr=function(t){return $r(""+Sr+t,{SDKVersion:"0.7.1-alpha.7"})},Xr={tutorialDocumentLatestSaved:function(t,e){return p(void 0,void 0,void 0,(function(){return v(this,(function(r){return[2,Zr(kr+"/"+e+"?token="+t)]}))}))},portalAsset:function(t,e,r){return p(void 0,void 0,void 0,(function(){var n,o;return v(this,(function(i){return(null===(o=r)||void 0===o?void 0:o.length)?(n="?segmentIds="+r.join(","),[2,Qr("/portalMemberships/"+t+"/"+e+"/head.json"+n)]):[2,Qr("/portals/"+t+"/"+e+"/head.json")]}))}))},segmentMembership:function(t,e){return p(void 0,void 0,void 0,(function(){return v(this,(function(r){return[2,Zr(wr+"/"+e+"?token="+t)]}))}))},segmentDefinition:function(t){return p(void 0,void 0,void 0,(function(){return v(this,(function(e){return[2,Zr(Dr+"?token="+t)]}))}))},tutorialMetadata:function(t){return p(void 0,void 0,void 0,(function(){return v(this,(function(e){return[2,Zr(Pr+"?token="+t)]}))}))},tutorialSocket:function(t,e,r){var n=new WebSocket(xr+"?clientToken="+t+"&tutorialId="+e);return n.onmessage=function(t){var e=JSON.parse(t.data);r(e)},function(){return n.close()}},tutorialDocument:function(t,r,n){var o=t.contentHashId,i=t.tutorialId,a=t.tutorialDocument,u=t.slug,c=function(t){return{byId:function(e){return Zr(kr+"?token="+t+"&finder=latestPublished&tutorialId="+e)},bySlug:function(e){return Qr("/tutorials/"+t+"/"+e+".json")},byContentHash:function(e){return Qr("/tutorials/"+t+"/"+e+".json")}}}(r);return e.isTutorialSlug(u)?c.bySlug(u):e.isTutorialId(i)?c.byId(i):e.isContentHashId(o)?c.byContentHash(o):C(a)?Promise.resolve(a):(Jr.error(Vr[Gr.NO_VALID_TUTORIAL_IDENTIFIER]),n.track(Gr.NO_VALID_TUTORIAL_IDENTIFIER,{slug:t.slug}),null)}},tn=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return console.error.apply(console,t)},en=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return console.warn.apply(console,t)},rn={error:tn,warning:en},nn=function(){function t(){this.subscribers=[]}return t.prototype.subscribe=function(t){var e=this;return this.subscribers.push(t),function(){e.subscribers[e.subscribers.indexOf(t)]=function(){}}},t.prototype.notify=function(t){this.subscribers.forEach((function(e){return e(t)}))},t.prototype.clear=function(){this.subscribers=[]},t}(),on=function(){function t(){this.onClientUpdateObserver=new nn}return t.prototype.attachClient=function(t){this.client=t,this.onClientUpdateObserver.notify({client:t})},t.prototype.detachClient=function(){this.client&&(this.client=null,this.onClientUpdateObserver.notify({client:null}))},t.prototype.onClientUpdate=function(t){var e=this.onClientUpdateObserver.subscribe(t);return this.client&&t({client:this.client}),e},t}();var an="/home/runner/work/candu-sdk/candu-sdk/packages/candu-core/dist/core.cjs.js",un="0.7.1-alpha.7",cn=function(){function t(t){this.init(t)}return t.prototype.getInfo=function(){return{core:{version:un,name:an},sdk:{version:this.version,name:this.name}}},t.prototype.attachClient=function(t){return this.provider.preview.attachClient(t)},t.prototype.detachClient=function(){return this.provider.preview.detachClient()},Object.defineProperty(t.prototype,"provider",{get:function(){return this.getProvider()},enumerable:!0,configurable:!0}),t}(),sn=function(t){switch(t.trigger){case e.TRIGGERS.ON_CLICK:default:return"onClick"}},ln=function(t,r){var n,o,i,a,u,c;if("Link"===t.type&&(null===(n=t.props)||void 0===n?void 0:n.href)){var s=t.props.href+" Link Clicked",l=null===(i=null===(o=t)||void 0===o?void 0:o.nodes)||void 0===i?void 0:i[0];if(l){var p=r.document.nodes[l];"Text"===(null===(a=p)||void 0===a?void 0:a.type)&&(null===(c=null===(u=p)||void 0===u?void 0:u.props)||void 0===c?void 0:c.children)&&(s=p.props.children+" Link Clicked")}return{onClick:function(){var n;return r.provider.eventing.track(Gr.TUTORIAL_INTERACTION,{trigger:e.TRIGGERS.ON_CLICK,category:t.type,eventName:s,handler:{href:null===(n=t.props)||void 0===n?void 0:n.href,type:e.HANDLER_TYPES.NAVIGATE}})}}}if(!t.data||!t.data.actions)return{};var v=function(t,e){r.provider.eventing.track(Gr.TUTORIAL_INTERACTION,f(f({},t),e||{}))};return t.data.actions.map((function(t){return function(t,r,n){var o,i,a;switch(t.handler.type){case e.HANDLER_TYPES.NAVIGATE:return(o={})[sn(t)]=function(e){e.stopPropagation();var o=t.handler,i=o.href,a=o.target,u=n||{},c=u.parentTrackers,s=d(u,["parentTrackers"]);c&&c.forEach((function(e){return r(t,e)})),r(t,s),"Blank"===a?window.open(i,"_blank"):i&&i.includes("mailto:")?window.location=i:document.location.href=i},o;case e.HANDLER_TYPES.CHANGE_TUTORIAL:return(i={})[sn(t)]=function(){var e=t.handler.tutorialId;tn("TODO -> change tutorial",e)},i;case e.HANDLER_TYPES.OPEN_GUIDE:return(a={})[sn(t)]=function(){var e=t.handler.guideId;tn("TODO -> open guide",e)},a;default:return{}}}(t,v,r.trackingIdentifiers)})).reduce((function(t,e){return f(f({},t),e)}),{})},fn=function(t,e){var r=t.props||{},n=t.nodes,o=r.children;return o||(n?n.map(e):null)},dn=function(t,e){var r=t.states;return r&&e.stateProviderInstances.filter((function(t){return!!r[t.providerId]}))},pn=function(t,e){var r=t.nodes;return r&&r.map((function(t){return e.document.nodes[t]})).filter((function(t){return!!t})).map((function(t){return dn(t,e)||[]})).reduce((function(t,e){return t.concat(e)}),[])},vn=function(t,e){try{var r=e.provider,n=e.document,o=e.trackingIdentifiers,i=n.nodes[t];if(!i)return rn.error("Document is corrupted. Refusing to move further."),null;var a=function(t){return vn(t,e)},u=i.type,c=i.props,s=i.css,l=f(f(f({},c||{}),{style:s||{},children:fn(i,a)}),ln(i,{trackingIdentifiers:o,provider:r,document:n})),d={nodeId:t,node:i,document:n,render:{node:a,styleguide:function(t,r){return void 0===r&&(r={}),e.renderNode(t,{api:d,attributes:r})},tutorial:function(t){return e.renderTutorial(t)},portal:function(t){return e.renderPortal(t)}},trackingIdentifiers:o,stateInstances:dn(i,e),childrenStateInstances:pn(i,e)},p=d.render.styleguide(u,l);return p||(rn.error(Vr[Gr.UNKOWN_NODE_TYPE],{type:u}),r.eventing.error(new Error(Vr[Gr.UNKOWN_NODE_TYPE]),{type:u}),null)}catch(t){return rn.error(Vr[Gr.STYLEGUIDE_MAP_ERROR],t),e.provider.eventing.error(t),null}},hn=nr((function(t,e){var r,n,o=t.provider,i=t.portal,a=t.tutorial,u=o.styleguide;return a&&(n=a.styleguide),i&&(r=i.styleguide),f(f(f(f({},u||{}),r||{}),n||{}),e||{})})),_n=function(t){return"candu-styleguide-"+t},yn=function(t,e){var r,n,o,i,a="string"==typeof e&&e.split(" ");return a?1===a.length?((r={})[t+"Right"]=e,r[t+"Left"]=e,r[t+"Bottom"]=e,r[t+"Top"]=e,r):2===a.length?((n={})[t+"Top"]=a[0],n[t+"Right"]=a[1],n[t+"Bottom"]=a[0],n[t+"Left"]=a[1],n):3===a.length?((o={})[t+"Top"]=a[0],o[t+"Right"]=a[1],o[t+"Bottom"]=a[2],o[t+"Left"]=a[1],o):((i={})[t+"Top"]=a[0],i[t+"Right"]=a[1],i[t+"Bottom"]=a[2],i[t+"Left"]=a[3],i):{}};var bn=function(t,e){return function(r,n){if(null==r)return r;if(!It(r))return t(r,n);for(var o=r.length,i=e?o:-1,a=Object(r);(e?i--:++i<o)&&!1!==n(a[i],i,a););return r}}(Rt);var gn=function(t,e){var r=-1,n=It(t)?Array(t.length):[];return bn(t,(function(t,o,i){n[++r]=e(t,o,i)})),n};var En=function(t,e){return(ot(t)?ur:gn)(t,mr(e))},On=function(){function t(t,e,r){var n=this;this.observer=new nn,this.context=t,this.providerId=e,this.resolver=r,this.state=this.resolver.cache.load(this.providerId),this.resolver.retrieve(t,e).then((function(t){return n.updateState(t)})).catch((function(t){rn.error(Vr[Gr.STATE_FETCH_FAILED],t.message),n.context.eventing.track(Vr[Gr.STATE_FETCH_FAILED],{errorMessage:t.message})}))}return t.prototype.mutate=function(t){var e=this,r=this.state;this.updateState(f(f({},r),t)),this.resolver.update(this.context,this.providerId,t).then((function(t){return e.updateState(t)})).catch((function(t){rn.error(Vr[Gr.STATE_UPDATE_FAILED],t.message),e.context.eventing.track(Vr[Gr.STATE_UPDATE_FAILED],{errorMessage:t.message}),r&&e.updateState(r)}))},t.prototype.subscribe=function(t){var e=this.observer.subscribe(t);return this.state&&t(this.state),e},t.prototype.getResolvedState=function(){return this.state},t.prototype.updateState=function(t){this.state=t,this.resolver.cache.save(this.providerId,t),this.observer.notify(t)},t}(),Tn=function(){function t(t){void 0===t&&(t="candu-state:"),this.prefix=t}return t.prototype.save=function(t,e){try{window.localStorage.setItem(this.prefix+t,JSON.stringify(e))}catch(t){}},t.prototype.load=function(t){try{var e=window.localStorage.getItem(this.prefix+t);return e&&JSON.parse(e)}catch(t){return null}},t}(),In=Object.create(null),mn=function(){function t(t){this.cache=new Tn,this.options=f({},t||{})}return t.register=function(t,e){In[t]=e,e.prototype.type=t},t.fromJSON=function(t){var e=t.type,r=d(t,["type"]),n=In[e];return n?new n(r):null},t.prototype.toJSON=function(){return f({type:this.type},this.options)},t}();var Rn=function(t,e,r,n){for(var o=t.length,i=r+(n?1:-1);n?i--:++i<o;)if(e(t[i],i,t))return i;return-1};var An=function(t){return t!=t};var jn=function(t,e,r){for(var n=r-1,o=t.length;++n<o;)if(t[n]===e)return n;return-1};var Nn=function(t,e,r){return e==e?jn(t,e,r):Rn(t,An,r)};var Sn=function(t,e){return!!(null==t?0:t.length)&&Nn(t,e,0)>-1};var Ln=function(t,e,r){for(var n=-1,o=null==t?0:t.length;++n<o;)if(r(e,t[n]))return!0;return!1};var Cn=function(){},wn=Pe&&1/be(new Pe([,-0]))[1]==1/0?function(t){return new Pe(t)}:Cn;var Dn=function(t,e,r){var n=-1,o=Sn,i=t.length,a=!0,u=[],c=u;if(r)a=!1,o=Ln;else if(i>=200){var s=e?null:wn(t);if(s)return be(s);a=!1,o=ve,c=new de}else c=e?[]:u;t:for(;++n<i;){var l=t[n],f=e?e(l):l;if(l=r||0!==l?l:0,a&&f==f){for(var d=c.length;d--;)if(c[d]===f)continue t;e&&c.push(f),u.push(l)}else o(c,f,r)||(c!==u&&c.push(f),u.push(l))}return u};var Pn=function(t){return t&&t.length?Dn(t):[]},kn=function(){function t(){}return t.get=function(e,r){var n=t.loaders.get(e);if(n)return n;var o=new c.default(r,{cache:!1});return t.loaders.set(e,o),o},t.loaders=new Map,t}(),xn="https://api.candu.ai"+Cr,Un=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return l(e,t),e.prototype.retrieve=function(t,e){return p(this,void 0,void 0,(function(){var r,n,o=this;return v(this,(function(i){switch(i.label){case 0:return[4,kn.get("cardStateApi",(function(e){return p(o,void 0,void 0,(function(){var r;return v(this,(function(n){switch(n.label){case 0:return[4,fetch(xn+"?token="+t.clientToken+"&finder=byIds&ids="+Pn(e).join(",")+"&userId="+t.userId).then((function(t){return t.json()}))];case 1:return r=n.sent(),[2,e.map((function(t){return r.find((function(e){return e.id===t}))}))]}}))}))})).load(e)];case 1:return r=i.sent(),n={id:e,state:{dismissed:!1}},[2,r||n]}}))}))},e.prototype.update=function(t,e,r){return fetch(xn+"/"+e+"?token="+t.clientToken,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({state:r.state,userId:t.userId.toString()})}).then((function(t){return t.json()}))},e}(mn);mn.register(e.StateResolverType.CardApi,Un);var Mn="https://api.candu.ai"+Lr;function Fn(t){return{state:t.state,id:t.id}}function Bn(t){switch(t){case e.CheckListScope.Account:return"AccountId";case e.CheckListScope.User:default:return"UserId"}}var Hn=function(t){function r(){return null!==t&&t.apply(this,arguments)||this}return l(r,t),r.prototype.getScopeAndFieldFromContext=function(t){var r=this.options.scopeTrait,n=this.options.scope||e.CheckListScope.User,o=t.userId.toString();return n===e.CheckListScope.Account&&(r&&t.traits[r]?o=t.traits[r]:(en("trait '"+r+"' is not defined, falling back to user scope"),n=e.CheckListScope.User)),{scope:n,scopeField:o}},r.prototype.retrieve=function(t,r){return p(this,void 0,void 0,(function(){var n,o,i,a=this;return v(this,(function(u){switch(u.label){case 0:return n=this.getScopeAndFieldFromContext(t),o=n.scope,i=n.scopeField,[4,kn.get("checklistState",(function(e){return p(a,void 0,void 0,(function(){var r;return v(this,(function(n){switch(n.label){case 0:return[4,fetch(Mn+"?token="+t.clientToken+"&byTrait="+Bn(o)+"&field="+i+"&finder=byIds&ids="+Pn(e).join(",")).then((function(t){return t.json()})).then((function(t){return t.map(Fn)}))];case 1:return r=n.sent(),[2,e.map((function(t){return r.find((function(e){return e.id===t}))}))]}}))}))})).load(r)];case 1:return[2,u.sent()||{id:r,state:e.CheckListItemStatus.NotStared}]}}))}))},r.prototype.update=function(t,e,r){var n=this.getScopeAndFieldFromContext(t),o=n.scope,i=n.scopeField;return fetch(Mn+"/"+e+"?token="+t.clientToken,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(f(f({},r),{byTrait:Bn(o),field:i}))}).then((function(t){return t.json()})).then(Fn)},r}(mn);mn.register(e.StateResolverType.CheckListApi,Hn);exports.CardResolverInstance=Un,exports.CheckListResolverInstance=Hn,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=Vr,exports.ERROR_SLUGS=Hr,exports.EVENT_NAMES=Gr,exports.LOGGER=Jr,exports.METRICS=zr,exports.Observer=nn,exports.PreviewContainer=on,exports.RESOURCES=Xr,exports.STYLEGUIDE_COLORS={primary:"#6310E5",secondary:"#59C3C3",tertiary:"#4D515D",warning:"#FCAD0D",danger:"#EE4266"},exports.SingletonAPI=cn,exports.StateProviderInstance=On,exports.StateResolverInstance=mn,exports.TutorialDependencies=Mr,exports.adaptCustomNodes=function(t){return Rr(t,(function(t){var e=t;return"Typography"===e.type&&(e=function(t){var e=hr(t,"data.custom.variant","P");return f(f({},t),{type:e})}(e)),e.css&&C(e.css)&&e.css.flexBasis&&(e=function(t){var e=t.css.flexBasis;return"0"===e||"0px"===e?f(f({},t),{css:f(f({},t.css),{flexBasis:"0%"})}):t}(e)),e.css&&(e=jr(e)),e}))},exports.attachStylesheet=function(t,e){void 0===e&&(e="main");var r=_n(t);if(!document.getElementById(r)){var n=document.createElement("link");n.setAttribute("id",r),n.setAttribute("rel","stylesheet"),n.setAttribute("href",Sr+"/styleguides/applications/"+t+"/default/"+e+".css"),document.head.appendChild(n)}},exports.calculateGroupCompletion=function(t,r){var n=Object.values(t).filter((function(t){return t.status===e.CheckListItemStatus.Done})).length;return{completedItems:n,percComplete:r?Math.round(100*n/r):0}},exports.checkCyclicAndAdd=function(t,e){return t.dependencies.add(t.id,e)},exports.createSingleton=function(t){var e,r,n=function(t){return function(){for(var e,n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];if(r.api)return(e=r.api)[t].apply(e,n);console.warn("Please initialize the SDK by calling Candu.init() before attempting to call "+t)}};return(e=function(){function e(){}return e.init=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return this.api||(e.api=new(t.bind.apply(t,h([void 0],r)))),e.subscriberCallbacks.forEach((function(t){return t()})),e.subscriberCallbacks=[],window.postMessage({source:"CANDU_SINGLETON",payload:{type:"INIT"}},window&&window.origin?window.origin:"*"),e},e.onProviderReady=function(t){if(e.api)return t();e.subscriberCallbacks.push(t)},e}()).subscriberCallbacks=[],e.renderTutorial=n("renderTutorial"),e.renderPortal=n("renderPortal"),e.attachClient=n("attachClient"),e.detachClient=n("detachClient"),e.getProvider=n("getProvider"),e.getInfo=n("getInfo"),r=e,window.Candu=r,r},exports.createTutorialDocumentContext=function(t,e){return{id:t,dependencies:e?e.dependencies:new Mr(t)}},exports.defaultStyleguide=Wr,exports.detachStylesheet=function(t){var e=document.getElementById(_n(t));e&&e.remove()},exports.fetchHead=function(t,e){t&&ot(t)&&t.map((function(t){var r=t.nodeType,n=t.url;return Ur("EmbedTutorial"===r?Sr+"/tutorials/"+e+"/"+n+".json":"EmbedPortal"===r?Sr+"/portals/"+e+"/"+n+"/head.json":n)}))},exports.findMatchingSegment=function(t,r){var n=r.reduce((function(t,e){var r;return f(f({},t),((r={})[e]=e,r))}),{});return t.content.find((function(t){var r=t.segmentId;return!!n[r]||r===e.DEFAULT_SEGMENT_ID}))},exports.getCheckListStateProviders=function(t){return t.filter((function(t){return t.resolver instanceof Hn}))},exports.getContentState=function(t){return t.lastModifiedAt===t.lastPublishedAt?"Published":t.lastPublishedAt?"Unsynced":"Draft"},exports.getFirstNotStartedItem=function(t,r){for(var n=Object.values(t),o=function(t){var r=n.find((function(e){return e.position===t}));if(!r||r.status===e.CheckListItemStatus.NotStared)return{value:t}},i=0;i<r;i+=1){var a=o(i);if("object"==typeof a)return a.value}},exports.getInitialItems=function(t){var e={};return t.forEach((function(t,r){var n=t.getResolvedState();n&&(e[n.id]={status:n.state,position:r})})),e},exports.includeHTMLWhitespaces=function(t){return t.replace(/\s/g,"&nbsp;")},exports.initStateProviders=function(t,e){return En(t,(function(t,r){var n=mn.fromJSON(t.resolver);return n?new On(e,r,n):null})).filter((function(t){return!!t}))},exports.internalEventing=function(t){var e=t.identify,r=t.track;return{provider:function(t){var n=t.userId,o=t.traits,i=t.styleguide;e(n,o),r(Gr.HEARTBEAT,function(t){var e={};return Object.keys(t).forEach((function(r){Wr[r]&&(e["styleguide."+r]=t[r].displayName||!0)})),e}(i))},tutorialDocumentLoadingError:function(t){var e=t.tutorialId,n=t.slug,o=t.contentHashId;Jr.error(Vr[Gr.TUTORIAL_LOADING_ERROR]),r(Gr.TUTORIAL_LOADING_ERROR,{tutorialId:e,slug:n,contentHashId:o})}}},exports.logError=tn,exports.logWarning=en,exports.logger=rn,exports.mapNodeToStyleguide=vn,exports.mergeStyleguidesFromContext=hn,exports.normalizeCss=jr,exports.portalValidation=function(t){var e=t.slug,r=t.styleguide;return qr(r),{slug:e,styleguide:r||{}}},exports.providerValidation=function(t){var n=t.clientToken,o=t.userId,i=t.traits,a=t.options,c=t.styleguide,s=d(t,["clientToken","userId","traits","options","styleguide"]);return u.default(e.isClientToken(n),"(Candu) you must provide a valid clientToken"),u.default(!o||e.isUserId(o),"(Candu) you must provide a valid userId"),qr(c),u.default(!i||C(i),"(Candu) traits must be undefined or an object"),u.default(!a||C(a),"(Candu) options must be undefined or an object"),f(f({},s),{clientToken:n,traits:i||{},options:a||{},styleguide:c||{},userId:o||r.getAnonymousId()})},exports.stripHTML=function(t){return DOMParser?(new DOMParser).parseFromString(t,"text/html").body.textContent||"":t},exports.tutorialValidation=function(t){var e=t.slug,r=t.styleguide,n=t.contentHashId,o=t.tutorialId,i=t.tutorialDocument,a=t.renderedByClient,u=d(t,["slug","styleguide","contentHashId","tutorialId","tutorialDocument","renderedByClient"]);return qr(r),f(f({},u),{slug:e,styleguide:r||{},contentHashId:n,tutorialId:o,tutorialDocument:i,renderedByClient:a})},exports.unpackShorthandStyles=function(t){var e=t.padding,r=t.margin,n=d(t,["padding","margin"]),o={};return e&&(o=f(f({},o),yn("padding",e))),r&&(o=f(f({},o),yn("margin",r))),f(f({},o),n)};
//# sourceMappingURL=index.js.map

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

},
"version": "0.7.1-alpha.6",
"version": "0.7.1-alpha.7",
"main": "dist/index.js",

@@ -28,4 +28,4 @@ "module": "dist/index.es.js",

"dependencies": {
"@candulabs/eventing": "^0.7.1-alpha.6",
"@candulabs/models": "^0.7.1-alpha.6",
"@candulabs/eventing": "^0.7.1-alpha.7",
"@candulabs/models": "^0.7.1-alpha.7",
"dataloader": "^2.0.0",

@@ -35,3 +35,3 @@ "react-style-object-to-css": "^1.1.2",

},
"gitHead": "41d5f446bc19a832c9a3c9cc130fa7a5248a59bf"
"gitHead": "55eacbb6d4dae5b2b5add015e3c4251af6f88eab"
}
SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc