@walkme/sdk
Advanced tools
Comparing version 2.0.8-alpha.1 to 2.0.8-alpha.2
@@ -1,2 +0,2 @@ | ||
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var r in n)("object"==typeof exports?exports:e)[r]=n[r]}}(this,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=4)}([function(e,t,n){"use strict";var r,o,a,s,i,u,c,l,d,f,p,m;n.d(t,"i",(function(){return r})),n.d(t,"h",(function(){return o})),n.d(t,"e",(function(){return a})),n.d(t,"b",(function(){return s})),n.d(t,"c",(function(){return i})),n.d(t,"f",(function(){return u})),n.d(t,"g",(function(){return c})),n.d(t,"d",(function(){return l})),n.d(t,"k",(function(){return d})),n.d(t,"j",(function(){return f})),n.d(t,"a",(function(){return p})),n.d(t,"l",(function(){return m})),n.d(t,"m",(function(){return g})),n.d(t,"n",(function(){return y})),function(e){e.Video="video",e.Article="article",e.Launcher="launcher",e.ShoutOut="shoutOut",e.Shuttle="shuttle",e.SmartWalkThru="smart-walkthru",e.Survey="survey",e.Task="task",e.Course="course",e.Lesson="lesson",e.Walkthru="walkthru",e.Category="category",e.Tab="tab",e.Experiments="experiments",e.SearchProviderUrl="search-provider-url",e.Tag="tag",e.TrackedElement="trackedElement",e.TrackedPage="trackedPage",e.SupportItem="support",e.SearchResult="search-result",e.HelpDesk="helpDesk",e.SmartTipSet="smartTipSet"}(r||(r={})),function(e){e.Help="help",e.Tasks="tasks"}(o||(o={})),function(e){e[e.Walkthru=0]="Walkthru",e[e.Task=1]="Task",e[e.Launcher=2]="Launcher",e[e.LabelGroup=3]="LabelGroup",e[e.Survey=4]="Survey",e[e.AbExperiment=5]="AbExperiment",e[e.Category=6]="Category",e[e.Content=7]="Content",e[e.Collection=8]="Collection",e[e.Shuttle=9]="Shuttle",e[e.Tag=10]="Tag",e[e.ShoutOut=14]="ShoutOut",e[e.ConditionBlock=17]="ConditionBlock",e[e.BusinessSolution=19]="BusinessSolution",e[e.Lesson=20]="Lesson",e[e.Course=21]="Course",e[e.TrackedPage=22]="TrackedPage",e[e.Spotlight=23]="Spotlight",e[e.Tooltip=24]="Tooltip",e[e.TrackedElement=25]="TrackedElement",e[e.SearchProviderUrl=26]="SearchProviderUrl",e[e.Space=27]="Space",e[e.Folder=28]="Folder",e[e.ActionBot=29]="ActionBot",e[e.ActionBotConversation=30]="ActionBotConversation",e[e.Menu=31]="Menu"}(a||(a={})),function(e){e.IDP="idp"}(s||(s={})),function(e){e[e.Play=2]="Play"}(i||(i={})),function(e){e.Verbose="Verbose",e.Debug="Debug",e.Info="Info",e.Warn="Warn",e.Error="Error"}(u||(u={})),function(e){e.Web="web",e.Mac="mac",e.Windows="windows",e.Mock="mock",e.Worker="worker"}(c||(c={})),function(e){e.BeforeOpen="beforeOpen",e.BeforeClose="beforeClose"}(l||(l={})),function(e){e.VisualDesign="visualDesign"}(d||(d={})),function(e){e.ActionClicked="visualDesign.actionClicked"}(f||(f={})),function(e){e.Remote="remote",e.Destroy="destroy",e.PlayShuttle="playShuttle",e.Play="play",e.PlayContent="playContent",e.PlaySWT="playBf",e.PlayWT="playWt",e.OpenMenu="openMenu"}(p||(p={})),function(e){e.APPS_DRAWS="wm-visualDesign-apps-items",e.DRAW_ACTIONS="wm-visualDesign-item-actions"}(m||(m={}));const g=600;var y;!function(e){e.Empty="%",e.Px="px"}(y||(y={}))},function(e,t,n){e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=1)}([,function(e,t,n){"use strict";var r;n.r(t),n.d(t,"addScript",(function(){return L})),n.d(t,"createSdk",(function(){return N})),n.d(t,"isSelfHosted",(function(){return m})),n.d(t,"getPublicPath",(function(){return v})),n.d(t,"getSdkApplicationsPublicPathWithEntry",(function(){return b})),n.d(t,"getSdkUtilsPublicPathWithEntry",(function(){return k})),n.d(t,"rpc",(function(){return A})),n.d(t,"overTheWire",(function(){return x})),n.d(t,"getLocalStorageItem",(function(){return f})),n.d(t,"LogLevel",(function(){return w})),n.d(t,"log",(function(){return T})),n.d(t,"warn",(function(){return I})),n.d(t,"error",(function(){return _})),n.d(t,"logger",(function(){return P})),n.d(t,"rpcLoader",(function(){return R}));var o=new Uint8Array(16);function a(){if(!r&&!(r="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return r(o)}for(var s=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,i=function(e){return"string"==typeof e&&s.test(e)},u=[],c=0;c<256;++c)u.push((c+256).toString(16).substr(1));var l,d=function(e,t,n){var r=(e=e||{}).random||(e.rng||a)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(var o=0;o<16;++o)t[n+o]=r[o];return t}return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(u[e[t+0]]+u[e[t+1]]+u[e[t+2]]+u[e[t+3]]+"-"+u[e[t+4]]+u[e[t+5]]+"-"+u[e[t+6]]+u[e[t+7]]+"-"+u[e[t+8]]+u[e[t+9]]+"-"+u[e[t+10]]+u[e[t+11]]+u[e[t+12]]+u[e[t+13]]+u[e[t+14]]+u[e[t+15]]).toLowerCase();if(!i(n))throw TypeError("Stringified UUID is invalid");return n}(r)};!function(e){e.request="request",e.response="response"}(l||(l={}));const f=e=>{var t,n;try{return(null===(n=null===(t=globalThis.walkme)||void 0===t?void 0:t.localStorageOverrides)||void 0===n?void 0:n[e])||globalThis.localStorage.getItem(e)}catch(e){}};function p(e){return new URL(window.location.href).searchParams.get(e)}function m(){return"true"===p(h)}function g(){const e=window.location.href.match(/^(.*?\/components)\//);return e&&e[1]}function y(e){if(e){const e=new URL(window.location.href),t=e.pathname.split("/");return t.splice(0,1),t.splice(-4),e.search="",e.pathname=t.join("/"),e.href+"/components"}return"https://cdn.walkme.com"}function v(e){const t=function(){const e=f("walkme-sdk-version");return"local"===e?"local":e||"b8ca01453f5c16bbb626af6f62d6edd021ce3a44"}();return"local"===t?"https://localhost:9128/dist/":`${y(e)}${e?"/sdk-runtime":"/sdk/player"}/${t}/`}const h="selfhosted";function b(){const e=function(){const e=f("walkme-sdk-version");return"local"===e?"local":e||"b8ca01453f5c16bbb626af6f62d6edd021ce3a44"}();if("local"===e)return"https://localhost:9902/dist/index.js";if("2"===p("sdk-version")){let t;return t=m()?g():y()+"/sdk",`${t+"/sdk-applications"}/${e}/index.js`}return y()+"/sdk/player/1.0/main.js"}function k(){const e=function(){const e=f("walkme-sdk-utils-version");return"local"===e?"local":e||"b8ca01453f5c16bbb626af6f62d6edd021ce3a44"}();if("local"===e)return"https://localhost:9904/dist/index.js";let t;return t=m()?g():y()+"/sdk",`${t+"/sdk-utils"}/${e}/index.js`}var w;let S,j;async function O({eventName:e,module:t,message:n,data:r,logLevel:o,extra:a}){if(!m()){(null==r?void 0:r.error)instanceof Error&&(r.error=JSON.parse(JSON.stringify(r.error,Object.getOwnPropertyNames(r.error))));try{await fetch("https://ec.walkme.com/event/log",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({app:"walkme-sdk",module:t,message:`${e}${n?": "+n:""}`,data:r,level:o,commit:"b8ca01453f5c16bbb626af6f62d6edd021ce3a44",sdkBranch:"davidsu-fix-types-publish",sessionId:S,userGuid:j,extra:a})})}catch(e){console.error(e)}}}!function(e){e.INFO="info",e.ERROR="error",e.WARN="warn"}(w||(w={}));const T=e=>O(Object.assign(Object.assign({},e),{logLevel:w.INFO})),I=e=>O(Object.assign(Object.assign({},e),{logLevel:w.WARN})),_=e=>O(Object.assign(Object.assign({},e),{logLevel:w.ERROR,extra:(new Error).stack})),P={warn:I,log:T,error:_,setSessionId:(e="noSessionId")=>{S=e},setUserGuid:(e="noUserGuid")=>{j=e}};function A(e){const t=function(){const e={},t=new Map,n=(e,t)=>t.has(e)&&e&&(Array.isArray(e)||"object"==typeof e),r=(n,r,o)=>Array.isArray(n)?[]:"object"==typeof n&&n?{}:"function"==typeof n?function(n,r,o){if(t.has(n))return t.get(n);const a=`##function##${o}##${d()}`,s=n.bind(r);return e[a]=s,t.set(n,a),a}(n,r,Array.isArray(r)?"ANONYMOUS":o):n;function*o(e,t){if(Array.isArray(e))for(let n=0;n<e.length;n++)yield{obj:e[n],key:n,parent:t,originalParent:e};else if("object"==typeof e&&e)for(const n of function*(e){const t=Object.getOwnPropertyDescriptors(e);for(const e in t)"function"!=typeof t[e].get&&(yield e)}(e))yield{obj:e[n],parent:t,key:n,originalParent:e}}const a="not serializable: https://cdn.walkme.com/sdk/sdk-applications/2.0/docs/index.html#serialization";return{serialize:e=>{let t=0;const s=new Set,i={},u=function(){let e,t,n=0;return{shift:()=>{const t=null==e?void 0:e.item;return e=null==e?void 0:e.next,n=Math.max(n-1,0),t},push:r=>{n++;const o={item:r};e?(t.next=o,t=t.next):(e=o,t=o)},get length(){return n}}}();for(u.push({obj:e,key:"ANONYMOUS",parent:i,originalParent:{}});u.length;){if(t++,t+u.length>1e5)throw P.error({eventName:"Serializer",message:a,module:"sdk-utils"}),new Error(a);const{obj:e,parent:i,key:c,originalParent:l}=u.shift();if(!(c in i))if(n(e,s))i[c]="##CIRCULAR_OBJECT##";else{s.add(e);const t=r(e,l,c);i[c]=t;for(const n of o(e,t))u.push(n)}}return i.ANONYMOUS},deserialize:function e(t,n){return Array.isArray(t)?((t,n)=>t.map(t=>e(t,n)))(t,n):"object"==typeof t&&t?((t,n)=>Object.entries(t).reduce((t,[r,o])=>(t[r]=e(o,n),t),{}))(t,n):/^##function##/.test(t)?(...e)=>n(t,e):t},getFunction:t=>e[t]}}(),n="__sdk__runtime__uniq__me"===e.name?e.name:`${e.name}##${d()}`,r={applicationId:n,messageType:l.request},o={applicationId:n,messageType:l.response},a={},s={},i=e=>t.getFunction(e)||a[e];function u({metadata:n,data:r}){let o;try{o=t.serialize(r)}catch(r){return n.messageType===l.response&&e.sendMessage({metadata:n,data:t.serialize(r)}),Promise.reject(r)}return e.sendMessage({metadata:n,data:o}),n.messageType===l.request?(a=n.messageId,new Promise((e,t)=>{s[a]={resolve:e,reject:t}})):Promise.resolve();var a}const c=(e="sdk_get_api")=>u({metadata:Object.assign(Object.assign({functionId:e,messageId:d()},r),{messageStackTrace:null}),data:[]}).then(e=>{const{userGuid:t,sessionId:n}=e;return t&&P.setUserGuid(t),n&&P.setSessionId(n),e}),f=e=>{const t=e.sdk_get_api;if(t){const e=t();P.setSessionId(null==e?void 0:e.sessionId),P.setUserGuid(null==e?void 0:e.userGuid)}Object.assign(a,e)};return e.receiveMessage((function(a){var c,f;if(!function(e){return e&&"object"==typeof e&&"metadata"in e&&"data"in e}(a))return;const{metadata:p,data:m}=a,{messageType:g,messageId:y,functionId:v,applicationId:h}=p;if(!function({requester:e,messageType:t,functionId:r,messageId:o}){return t===l.response?!!s[o]:e!==n&&!!i(r)}({requester:h,messageType:g,functionId:v,messageId:y}))return;const b=t.deserialize(m,(k=p,(e,t)=>u({metadata:Object.assign({messageStackTrace:k,functionId:e,messageId:d()},r),data:t})));var k;g===l.response?(p.error?(P.warn({data:{metadata:p,messengerName:e.name},eventName:"rpc",message:"other side rejected",module:"sdk-runtime"}),null===(c=s[y])||void 0===c||c.reject(p)):null===(f=s[y])||void 0===f||f.resolve(b),delete s[y]):async function(e,n,r,a){const s=i(n);if(s){let i,c;try{const e=await s(...r);i=t.serialize(e)}catch(e){c=t.serialize(e)}u({metadata:Object.assign(Object.assign({messageId:e,functionId:n},o),{error:c,messageStackTrace:a}),data:i})}}(y,v,b,p)})),"undefined"!=typeof TESTING?{getApi:c,provideResolver:f,serializer:t,onmessages:s}:{getApi:c,provideResolver:f}}const x=A;function L(e,t){const n=document.createElement("script");n.async=!0,n.src=e,document.getElementsByTagName("head")[0].appendChild(n),n.onerror=t}const E=()=>window,R=async e=>(await new Promise(e=>{var t;t=e,E()._walkmeInternals=E()._walkmeInternals||{},Object.assign(E()._walkmeInternals,{__rpc_loader_resolver:t}),L(k(),()=>{})})).rpc(e);let C=globalThis.sdkInstance;const N=e=>({async init(...t){C=await e(...t)},get content(){return null==C?void 0:C.content},get settings(){return null==C?void 0:C.settings},get storage(){return null==C?void 0:C.storage},get conditions(){return null==C?void 0:C.conditions},get events(){return null==C?void 0:C.events},get language(){return null==C?void 0:C.language},get platform(){return null==C?void 0:C.platform},get apps(){return null==C?void 0:C.apps},get ui(){return null==C?void 0:C.ui},get services(){return null==C?void 0:C.services},get notifications(){return null==C?void 0:C.notifications}});(()=>{const e=null===(t=window._walkmeInternals)||void 0===t?void 0:t.__rpc_loader_resolver;var t;e&&e({rpc:A})})()}])},,,function(e,t,n){"use strict";var r;n.r(t),n.d(t,"TypeName",(function(){return N.i})),n.d(t,"TabType",(function(){return N.h})),n.d(t,"LegacyTypes",(function(){return N.e})),n.d(t,"EndUserMethods",(function(){return N.b})),n.d(t,"Environment",(function(){return N.c})),n.d(t,"LogLevel",(function(){return N.f})),n.d(t,"PlatformType",(function(){return N.g})),n.d(t,"EventTypeName",(function(){return N.d})),n.d(t,"UIItemType",(function(){return N.k})),n.d(t,"UIEventType",(function(){return N.j})),n.d(t,"ActionType",(function(){return N.a})),n.d(t,"UI_STORAGE_KEYS",(function(){return N.l})),n.d(t,"UI_STORAGE_TIME",(function(){return N.m})),n.d(t,"Unit",(function(){return N.n}));var o=new Uint8Array(16);function a(){if(!r&&!(r="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return r(o)}var s=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;for(var i=function(e){return"string"==typeof e&&s.test(e)},u=[],c=0;c<256;++c)u.push((c+256).toString(16).substr(1));var l=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(u[e[t+0]]+u[e[t+1]]+u[e[t+2]]+u[e[t+3]]+"-"+u[e[t+4]]+u[e[t+5]]+"-"+u[e[t+6]]+u[e[t+7]]+"-"+u[e[t+8]]+u[e[t+9]]+"-"+u[e[t+10]]+u[e[t+11]]+u[e[t+12]]+u[e[t+13]]+u[e[t+14]]+u[e[t+15]]).toLowerCase();if(!i(n))throw TypeError("Stringified UUID is invalid");return n};var d,f=function(e,t,n){var r=(e=e||{}).random||(e.rng||a)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(var o=0;o<16;++o)t[n+o]=r[o];return t}return l(r)};!function(e){e.request="request",e.response="response"}(d||(d={}));const p=e=>{var t,n;try{return(null===(n=null===(t=globalThis.walkme)||void 0===t?void 0:t.localStorageOverrides)||void 0===n?void 0:n[e])||globalThis.localStorage.getItem(e)}catch(e){}};function m(e){return new URL(window.location.href).searchParams.get(e)}function g(){return"true"===m(h)}function y(){const e=window.location.href.match(/^(.*?\/components)\//);return e&&e[1]}function v(e){if(e){const e=new URL(window.location.href),t=e.pathname.split("/");return t.splice(0,1),t.splice(-4),e.search="",e.pathname=t.join("/"),e.href+"/components"}return"https://cdn.walkme.com"}const h="selfhosted";function b(){const e=function(){const e=p("walkme-sdk-version");return"local"===e?"local":e||"b8ca01453f5c16bbb626af6f62d6edd021ce3a44"}();if("local"===e)return"https://localhost:9902/dist/index.js";if("2"===m("sdk-version")){let t;t=g()?y():v()+"/sdk";return`${t+"/sdk-applications"}/${e}/index.js`}return v()+"/sdk/player"+"/1.0/main.js"}var k;let w,S;async function j({eventName:e,module:t,message:n,data:r,logLevel:o,extra:a}){if(g())return;(null==r?void 0:r.error)instanceof Error&&(r.error=JSON.parse(JSON.stringify(r.error,Object.getOwnPropertyNames(r.error))));try{await fetch("https://ec.walkme.com/event/log",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({app:"walkme-sdk",module:t,message:`${e}${n?": "+n:""}`,data:r,level:o,commit:"b8ca01453f5c16bbb626af6f62d6edd021ce3a44",sdkBranch:"davidsu-fix-types-publish",sessionId:w,userGuid:S,extra:a})})}catch(e){console.error(e)}}!function(e){e.INFO="info",e.ERROR="error",e.WARN="warn"}(k||(k={}));const O=e=>j(Object.assign(Object.assign({},e),{logLevel:k.WARN})),T=e=>j(Object.assign(Object.assign({},e),{logLevel:k.ERROR,extra:(new Error).stack})),I=(e="noSessionId")=>{w=e},_=(e="noUserGuid")=>{S=e};function P(){const e={},t=new Map;const n=(e,t)=>t.has(e)&&e&&(Array.isArray(e)||"object"==typeof e),r=(n,r,o)=>Array.isArray(n)?[]:"object"==typeof n&&n?{}:"function"==typeof n?function(n,r,o){if(t.has(n))return t.get(n);const a=`##function##${o}##${f()}`,s=n.bind(r);return e[a]=s,t.set(n,a),a}(n,r,Array.isArray(r)?"ANONYMOUS":o):n;function*o(e,t){if(Array.isArray(e))for(let n=0;n<e.length;n++)yield{obj:e[n],key:n,parent:t,originalParent:e};else if("object"==typeof e&&e)for(const n of function*(e){const t=Object.getOwnPropertyDescriptors(e);for(const e in t)"function"!=typeof t[e].get&&(yield e)}(e))yield{obj:e[n],parent:t,key:n,originalParent:e}}const a="not serializable: https://cdn.walkme.com/sdk/sdk-applications/2.0/docs/index.html#serialization";function s(e,t){return Array.isArray(e)?((e,t)=>e.map(e=>s(e,t)))(e,t):"object"==typeof e&&e?((e,t)=>Object.entries(e).reduce((e,[n,r])=>(e[n]=s(r,t),e),{}))(e,t):/^##function##/.test(e)?(...n)=>t(e,n):e}return{serialize:e=>{let t=0;const s=new Set,i={},u=function(){let e,t,n=0;return{shift:()=>{const t=null==e?void 0:e.item;return e=null==e?void 0:e.next,n=Math.max(n-1,0),t},push:r=>{n++;const o={item:r};e?(t.next=o,t=t.next):(e=o,t=o)},get length(){return n}}}();for(u.push({obj:e,key:"ANONYMOUS",parent:i,originalParent:{}});u.length;){if(t++,t+u.length>1e5)throw T({eventName:"Serializer",message:a,module:"sdk-utils"}),new Error(a);const{obj:e,parent:i,key:c,originalParent:l}=u.shift();if(!(c in i))if(n(e,s))i[c]="##CIRCULAR_OBJECT##";else{s.add(e);const t=r(e,l,c);i[c]=t;for(const n of o(e,t))u.push(n)}}return i.ANONYMOUS},deserialize:s,getFunction:t=>e[t]}}function A(e){const t=P(),n="__sdk__runtime__uniq__me"===e.name?e.name:`${e.name}##${f()}`,r={applicationId:n,messageType:d.request},o={applicationId:n,messageType:d.response},a={},s={},i=e=>t.getFunction(e)||a[e];function u({metadata:n,data:r}){let o;try{o=t.serialize(r)}catch(r){return n.messageType===d.response&&e.sendMessage({metadata:n,data:t.serialize(r)}),Promise.reject(r)}return e.sendMessage({metadata:n,data:o}),n.messageType===d.request?(a=n.messageId,new Promise((e,t)=>{s[a]={resolve:e,reject:t}})):Promise.resolve();var a}const c=(e="sdk_get_api")=>u({metadata:Object.assign(Object.assign({functionId:e,messageId:f()},r),{messageStackTrace:null}),data:[]}).then(e=>{const{userGuid:t,sessionId:n}=e;return t&&_(t),n&&I(n),e}),l=e=>{const t=e.sdk_get_api;if(t){const e=t();I(null==e?void 0:e.sessionId),_(null==e?void 0:e.userGuid)}Object.assign(a,e)};return e.receiveMessage((function(a){var c,l;if(!function(e){return e&&"object"==typeof e&&"metadata"in e&&"data"in e}(a))return;const{metadata:p,data:m}=a,{messageType:g,messageId:y,functionId:v,applicationId:h}=p;if(!function({requester:e,messageType:t,functionId:r,messageId:o}){return t===d.response?!!s[o]:e!==n&&!!i(r)}({requester:h,messageType:g,functionId:v,messageId:y}))return;const b=t.deserialize(m,(k=p,(e,t)=>u({metadata:Object.assign({messageStackTrace:k,functionId:e,messageId:f()},r),data:t})));var k;g===d.response?(p.error?(O({data:{metadata:p,messengerName:e.name},eventName:"rpc",message:"other side rejected",module:"sdk-runtime"}),null===(c=s[y])||void 0===c||c.reject(p)):null===(l=s[y])||void 0===l||l.resolve(b),delete s[y]):async function(e,n,r,a){const s=i(n);if(s){let i,c;try{const e=await s(...r);i=t.serialize(e)}catch(e){c=t.serialize(e)}u({metadata:Object.assign(Object.assign({messageId:e,functionId:n},o),{error:c,messageStackTrace:a}),data:i})}}(y,v,b,p)})),"undefined"!=typeof TESTING?{getApi:c,provideResolver:l,serializer:t,onmessages:s}:{getApi:c,provideResolver:l}}let x=globalThis.sdkInstance;(()=>{const e=null===(t=window._walkmeInternals)||void 0===t?void 0:t.__rpc_loader_resolver;var t;e&&e({rpc:A})})();var L=n(1);const E={name:"sdk-iframe-proxy-client",sendMessage:e=>{var t;return null===(t=R().contentWindow)||void 0===t?void 0:t.postMessage(e,"*")},receiveMessage:e=>{window.addEventListener("message",t=>{var n;(null===(n=t.data)||void 0===n?void 0:n.metadata)&&e(t.data)})}},R=()=>document.querySelector("#wm-channel");function C(){return new Promise(e=>{const t=document.createElement("iframe");t.id="wm-channel",t.src=Object(L.getPublicPath)()+"sdk-proxy.html?platform=web",t.style.display="none",t.addEventListener("load",()=>{const t=Object(L.rpc)(E).getApi();e(t)}),document.body.appendChild(t)})}var N=n(0);const M=(U=async function(e={mode:"common"}){try{return await("iframe"===e.mode?((null===(r=null===(n=null===(t=globalThis._walkmeInternals)||void 0===t?void 0:t.ctx)||void 0===n?void 0:n.get("FeaturesManager"))||void 0===r?void 0:r.isFeatureEnabled("playerSDKV2"))?z:C)():async function(){if(globalThis.sdkInstance)return globalThis.sdkInstance;const e=self;if(!e.__walkmeSDKLazyLoad){e.__walkmeSDKLazyLoad={},e.__walkmeSDKLazyLoad.promise=new Promise(t=>{e.__walkmeSDKLazyLoad.resolve=t,e.__walkmeSDKLazyLoad.reject=t});const t=document.createElement("script");t.src=""+b(),document.body.appendChild(t)}const t=await e.__walkmeSDKLazyLoad.promise;return await t.init(),globalThis.sdkInstance=t,t}())}catch(e){throw console.error(e),e}var t,n,r},{async init(...e){x=await U(...e)},get content(){return null==x?void 0:x.content},get settings(){return null==x?void 0:x.settings},get storage(){return null==x?void 0:x.storage},get conditions(){return null==x?void 0:x.conditions},get events(){return null==x?void 0:x.events},get language(){return null==x?void 0:x.language},get platform(){return null==x?void 0:x.platform},get apps(){return null==x?void 0:x.apps},get ui(){return null==x?void 0:x.ui},get services(){return null==x?void 0:x.services},get notifications(){return null==x?void 0:x.notifications}});var U;t.default=M;async function z(){return await new Promise(e=>{var t;const n=({data:t})=>{"WalkMeApplicationsLoader-PlayerSDKLoaded"===t&&(window.removeEventListener("message",n),e())};(null===(t=globalThis._walkmeInternals)||void 0===t?void 0:t.getPlayerSdk)?e():window.addEventListener("message",n)}),globalThis._walkmeInternals.getPlayerSdk()}}])})); | ||
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var r in n)("object"==typeof exports?exports:e)[r]=n[r]}}(this,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=4)}([function(e,t,n){"use strict";var r,o,a,s,i,u,c,l,d,f,p,m;n.d(t,"i",(function(){return r})),n.d(t,"h",(function(){return o})),n.d(t,"e",(function(){return a})),n.d(t,"b",(function(){return s})),n.d(t,"c",(function(){return i})),n.d(t,"f",(function(){return u})),n.d(t,"g",(function(){return c})),n.d(t,"d",(function(){return l})),n.d(t,"k",(function(){return d})),n.d(t,"j",(function(){return f})),n.d(t,"a",(function(){return p})),n.d(t,"l",(function(){return m})),n.d(t,"m",(function(){return g})),n.d(t,"n",(function(){return y})),function(e){e.Video="video",e.Article="article",e.Launcher="launcher",e.ShoutOut="shoutOut",e.Shuttle="shuttle",e.SmartWalkThru="smart-walkthru",e.Survey="survey",e.Task="task",e.Course="course",e.Lesson="lesson",e.Walkthru="walkthru",e.Category="category",e.Tab="tab",e.Experiments="experiments",e.SearchProviderUrl="search-provider-url",e.Tag="tag",e.TrackedElement="trackedElement",e.TrackedPage="trackedPage",e.SupportItem="support",e.SearchResult="search-result",e.HelpDesk="helpDesk",e.SmartTipSet="smartTipSet"}(r||(r={})),function(e){e.Help="help",e.Tasks="tasks"}(o||(o={})),function(e){e[e.Walkthru=0]="Walkthru",e[e.Task=1]="Task",e[e.Launcher=2]="Launcher",e[e.LabelGroup=3]="LabelGroup",e[e.Survey=4]="Survey",e[e.AbExperiment=5]="AbExperiment",e[e.Category=6]="Category",e[e.Content=7]="Content",e[e.Collection=8]="Collection",e[e.Shuttle=9]="Shuttle",e[e.Tag=10]="Tag",e[e.ShoutOut=14]="ShoutOut",e[e.ConditionBlock=17]="ConditionBlock",e[e.BusinessSolution=19]="BusinessSolution",e[e.Lesson=20]="Lesson",e[e.Course=21]="Course",e[e.TrackedPage=22]="TrackedPage",e[e.Spotlight=23]="Spotlight",e[e.Tooltip=24]="Tooltip",e[e.TrackedElement=25]="TrackedElement",e[e.SearchProviderUrl=26]="SearchProviderUrl",e[e.Space=27]="Space",e[e.Folder=28]="Folder",e[e.ActionBot=29]="ActionBot",e[e.ActionBotConversation=30]="ActionBotConversation",e[e.Menu=31]="Menu"}(a||(a={})),function(e){e.IDP="idp"}(s||(s={})),function(e){e[e.Play=2]="Play"}(i||(i={})),function(e){e.Verbose="Verbose",e.Debug="Debug",e.Info="Info",e.Warn="Warn",e.Error="Error"}(u||(u={})),function(e){e.Web="web",e.Mac="mac",e.Windows="windows",e.Mock="mock",e.Worker="worker"}(c||(c={})),function(e){e.BeforeOpen="beforeOpen",e.BeforeClose="beforeClose"}(l||(l={})),function(e){e.VisualDesign="visualDesign"}(d||(d={})),function(e){e.ActionClicked="visualDesign.actionClicked"}(f||(f={})),function(e){e.Remote="remote",e.Destroy="destroy",e.PlayShuttle="playShuttle",e.Play="play",e.PlayContent="playContent",e.PlaySWT="playBf",e.PlayWT="playWt",e.OpenMenu="openMenu"}(p||(p={})),function(e){e.APPS_DRAWS="wm-visualDesign-apps-items",e.DRAW_ACTIONS="wm-visualDesign-item-actions"}(m||(m={}));const g=600;var y;!function(e){e.Empty="%",e.Px="px"}(y||(y={}))},function(e,t,n){e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=1)}([,function(e,t,n){"use strict";var r;n.r(t),n.d(t,"addScript",(function(){return L})),n.d(t,"createSdk",(function(){return N})),n.d(t,"isSelfHosted",(function(){return m})),n.d(t,"getPublicPath",(function(){return v})),n.d(t,"getSdkApplicationsPublicPathWithEntry",(function(){return b})),n.d(t,"getSdkUtilsPublicPathWithEntry",(function(){return k})),n.d(t,"rpc",(function(){return A})),n.d(t,"overTheWire",(function(){return x})),n.d(t,"getLocalStorageItem",(function(){return f})),n.d(t,"LogLevel",(function(){return w})),n.d(t,"log",(function(){return T})),n.d(t,"warn",(function(){return I})),n.d(t,"error",(function(){return _})),n.d(t,"logger",(function(){return P})),n.d(t,"rpcLoader",(function(){return R}));var o=new Uint8Array(16);function a(){if(!r&&!(r="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return r(o)}for(var s=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,i=function(e){return"string"==typeof e&&s.test(e)},u=[],c=0;c<256;++c)u.push((c+256).toString(16).substr(1));var l,d=function(e,t,n){var r=(e=e||{}).random||(e.rng||a)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(var o=0;o<16;++o)t[n+o]=r[o];return t}return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(u[e[t+0]]+u[e[t+1]]+u[e[t+2]]+u[e[t+3]]+"-"+u[e[t+4]]+u[e[t+5]]+"-"+u[e[t+6]]+u[e[t+7]]+"-"+u[e[t+8]]+u[e[t+9]]+"-"+u[e[t+10]]+u[e[t+11]]+u[e[t+12]]+u[e[t+13]]+u[e[t+14]]+u[e[t+15]]).toLowerCase();if(!i(n))throw TypeError("Stringified UUID is invalid");return n}(r)};!function(e){e.request="request",e.response="response"}(l||(l={}));const f=e=>{var t,n;try{return(null===(n=null===(t=globalThis.walkme)||void 0===t?void 0:t.localStorageOverrides)||void 0===n?void 0:n[e])||globalThis.localStorage.getItem(e)}catch(e){}};function p(e){return new URL(window.location.href).searchParams.get(e)}function m(){return"true"===p(h)}function g(){const e=window.location.href.match(/^(.*?\/components)\//);return e&&e[1]}function y(e){if(e){const e=new URL(window.location.href),t=e.pathname.split("/");return t.splice(0,1),t.splice(-4),e.search="",e.pathname=t.join("/"),e.href+"/components"}return"https://cdn.walkme.com"}function v(e){const t=function(){const e=f("walkme-sdk-version");return"local"===e?"local":e||"b20976a12625dca645a5278024e4d56c107591c9"}();return"local"===t?"https://localhost:9128/dist/":`${y(e)}${e?"/sdk-runtime":"/sdk/player"}/${t}/`}const h="selfhosted";function b(){const e=function(){const e=f("walkme-sdk-version");return"local"===e?"local":e||"b20976a12625dca645a5278024e4d56c107591c9"}();if("local"===e)return"https://localhost:9902/dist/index.js";if("2"===p("sdk-version")){let t;return t=m()?g():y()+"/sdk",`${t+"/sdk-applications"}/${e}/index.js`}return y()+"/sdk/player/1.0/main.js"}function k(){const e=function(){const e=f("walkme-sdk-utils-version");return"local"===e?"local":e||"b20976a12625dca645a5278024e4d56c107591c9"}();if("local"===e)return"https://localhost:9904/dist/index.js";let t;return t=m()?g():y()+"/sdk",`${t+"/sdk-utils"}/${e}/index.js`}var w;let S,j;async function O({eventName:e,module:t,message:n,data:r,logLevel:o,extra:a}){if(!m()){(null==r?void 0:r.error)instanceof Error&&(r.error=JSON.parse(JSON.stringify(r.error,Object.getOwnPropertyNames(r.error))));try{await fetch("https://ec.walkme.com/event/log",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({app:"walkme-sdk",module:t,message:`${e}${n?": "+n:""}`,data:r,level:o,commit:"b20976a12625dca645a5278024e4d56c107591c9",sdkBranch:"davidsu-fix-types-publish",sessionId:S,userGuid:j,extra:a})})}catch(e){console.error(e)}}}!function(e){e.INFO="info",e.ERROR="error",e.WARN="warn"}(w||(w={}));const T=e=>O(Object.assign(Object.assign({},e),{logLevel:w.INFO})),I=e=>O(Object.assign(Object.assign({},e),{logLevel:w.WARN})),_=e=>O(Object.assign(Object.assign({},e),{logLevel:w.ERROR,extra:(new Error).stack})),P={warn:I,log:T,error:_,setSessionId:(e="noSessionId")=>{S=e},setUserGuid:(e="noUserGuid")=>{j=e}};function A(e){const t=function(){const e={},t=new Map,n=(e,t)=>t.has(e)&&e&&(Array.isArray(e)||"object"==typeof e),r=(n,r,o)=>Array.isArray(n)?[]:"object"==typeof n&&n?{}:"function"==typeof n?function(n,r,o){if(t.has(n))return t.get(n);const a=`##function##${o}##${d()}`,s=n.bind(r);return e[a]=s,t.set(n,a),a}(n,r,Array.isArray(r)?"ANONYMOUS":o):n;function*o(e,t){if(Array.isArray(e))for(let n=0;n<e.length;n++)yield{obj:e[n],key:n,parent:t,originalParent:e};else if("object"==typeof e&&e)for(const n of function*(e){const t=Object.getOwnPropertyDescriptors(e);for(const e in t)"function"!=typeof t[e].get&&(yield e)}(e))yield{obj:e[n],parent:t,key:n,originalParent:e}}const a="not serializable: https://cdn.walkme.com/sdk/sdk-applications/2.0/docs/index.html#serialization";return{serialize:e=>{let t=0;const s=new Set,i={},u=function(){let e,t,n=0;return{shift:()=>{const t=null==e?void 0:e.item;return e=null==e?void 0:e.next,n=Math.max(n-1,0),t},push:r=>{n++;const o={item:r};e?(t.next=o,t=t.next):(e=o,t=o)},get length(){return n}}}();for(u.push({obj:e,key:"ANONYMOUS",parent:i,originalParent:{}});u.length;){if(t++,t+u.length>1e5)throw P.error({eventName:"Serializer",message:a,module:"sdk-utils"}),new Error(a);const{obj:e,parent:i,key:c,originalParent:l}=u.shift();if(!(c in i))if(n(e,s))i[c]="##CIRCULAR_OBJECT##";else{s.add(e);const t=r(e,l,c);i[c]=t;for(const n of o(e,t))u.push(n)}}return i.ANONYMOUS},deserialize:function e(t,n){return Array.isArray(t)?((t,n)=>t.map(t=>e(t,n)))(t,n):"object"==typeof t&&t?((t,n)=>Object.entries(t).reduce((t,[r,o])=>(t[r]=e(o,n),t),{}))(t,n):/^##function##/.test(t)?(...e)=>n(t,e):t},getFunction:t=>e[t]}}(),n="__sdk__runtime__uniq__me"===e.name?e.name:`${e.name}##${d()}`,r={applicationId:n,messageType:l.request},o={applicationId:n,messageType:l.response},a={},s={},i=e=>t.getFunction(e)||a[e];function u({metadata:n,data:r}){let o;try{o=t.serialize(r)}catch(r){return n.messageType===l.response&&e.sendMessage({metadata:n,data:t.serialize(r)}),Promise.reject(r)}return e.sendMessage({metadata:n,data:o}),n.messageType===l.request?(a=n.messageId,new Promise((e,t)=>{s[a]={resolve:e,reject:t}})):Promise.resolve();var a}const c=(e="sdk_get_api")=>u({metadata:Object.assign(Object.assign({functionId:e,messageId:d()},r),{messageStackTrace:null}),data:[]}).then(e=>{const{userGuid:t,sessionId:n}=e;return t&&P.setUserGuid(t),n&&P.setSessionId(n),e}),f=e=>{const t=e.sdk_get_api;if(t){const e=t();P.setSessionId(null==e?void 0:e.sessionId),P.setUserGuid(null==e?void 0:e.userGuid)}Object.assign(a,e)};return e.receiveMessage((function(a){var c,f;if(!function(e){return e&&"object"==typeof e&&"metadata"in e&&"data"in e}(a))return;const{metadata:p,data:m}=a,{messageType:g,messageId:y,functionId:v,applicationId:h}=p;if(!function({requester:e,messageType:t,functionId:r,messageId:o}){return t===l.response?!!s[o]:e!==n&&!!i(r)}({requester:h,messageType:g,functionId:v,messageId:y}))return;const b=t.deserialize(m,(k=p,(e,t)=>u({metadata:Object.assign({messageStackTrace:k,functionId:e,messageId:d()},r),data:t})));var k;g===l.response?(p.error?(P.warn({data:{metadata:p,messengerName:e.name},eventName:"rpc",message:"other side rejected",module:"sdk-runtime"}),null===(c=s[y])||void 0===c||c.reject(p)):null===(f=s[y])||void 0===f||f.resolve(b),delete s[y]):async function(e,n,r,a){const s=i(n);if(s){let i,c;try{const e=await s(...r);i=t.serialize(e)}catch(e){c=t.serialize(e)}u({metadata:Object.assign(Object.assign({messageId:e,functionId:n},o),{error:c,messageStackTrace:a}),data:i})}}(y,v,b,p)})),"undefined"!=typeof TESTING?{getApi:c,provideResolver:f,serializer:t,onmessages:s}:{getApi:c,provideResolver:f}}const x=A;function L(e,t){const n=document.createElement("script");n.async=!0,n.src=e,document.getElementsByTagName("head")[0].appendChild(n),n.onerror=t}const E=()=>window,R=async e=>(await new Promise(e=>{var t;t=e,E()._walkmeInternals=E()._walkmeInternals||{},Object.assign(E()._walkmeInternals,{__rpc_loader_resolver:t}),L(k(),()=>{})})).rpc(e);let C=globalThis.sdkInstance;const N=e=>({async init(...t){C=await e(...t)},get content(){return null==C?void 0:C.content},get settings(){return null==C?void 0:C.settings},get storage(){return null==C?void 0:C.storage},get conditions(){return null==C?void 0:C.conditions},get events(){return null==C?void 0:C.events},get language(){return null==C?void 0:C.language},get platform(){return null==C?void 0:C.platform},get apps(){return null==C?void 0:C.apps},get ui(){return null==C?void 0:C.ui},get services(){return null==C?void 0:C.services},get notifications(){return null==C?void 0:C.notifications}});(()=>{const e=null===(t=window._walkmeInternals)||void 0===t?void 0:t.__rpc_loader_resolver;var t;e&&e({rpc:A})})()}])},,,function(e,t,n){"use strict";var r;n.r(t),n.d(t,"TypeName",(function(){return N.i})),n.d(t,"TabType",(function(){return N.h})),n.d(t,"LegacyTypes",(function(){return N.e})),n.d(t,"EndUserMethods",(function(){return N.b})),n.d(t,"Environment",(function(){return N.c})),n.d(t,"LogLevel",(function(){return N.f})),n.d(t,"PlatformType",(function(){return N.g})),n.d(t,"EventTypeName",(function(){return N.d})),n.d(t,"UIItemType",(function(){return N.k})),n.d(t,"UIEventType",(function(){return N.j})),n.d(t,"ActionType",(function(){return N.a})),n.d(t,"UI_STORAGE_KEYS",(function(){return N.l})),n.d(t,"UI_STORAGE_TIME",(function(){return N.m})),n.d(t,"Unit",(function(){return N.n}));var o=new Uint8Array(16);function a(){if(!r&&!(r="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return r(o)}var s=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;for(var i=function(e){return"string"==typeof e&&s.test(e)},u=[],c=0;c<256;++c)u.push((c+256).toString(16).substr(1));var l=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(u[e[t+0]]+u[e[t+1]]+u[e[t+2]]+u[e[t+3]]+"-"+u[e[t+4]]+u[e[t+5]]+"-"+u[e[t+6]]+u[e[t+7]]+"-"+u[e[t+8]]+u[e[t+9]]+"-"+u[e[t+10]]+u[e[t+11]]+u[e[t+12]]+u[e[t+13]]+u[e[t+14]]+u[e[t+15]]).toLowerCase();if(!i(n))throw TypeError("Stringified UUID is invalid");return n};var d,f=function(e,t,n){var r=(e=e||{}).random||(e.rng||a)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(var o=0;o<16;++o)t[n+o]=r[o];return t}return l(r)};!function(e){e.request="request",e.response="response"}(d||(d={}));const p=e=>{var t,n;try{return(null===(n=null===(t=globalThis.walkme)||void 0===t?void 0:t.localStorageOverrides)||void 0===n?void 0:n[e])||globalThis.localStorage.getItem(e)}catch(e){}};function m(e){return new URL(window.location.href).searchParams.get(e)}function g(){return"true"===m(h)}function y(){const e=window.location.href.match(/^(.*?\/components)\//);return e&&e[1]}function v(e){if(e){const e=new URL(window.location.href),t=e.pathname.split("/");return t.splice(0,1),t.splice(-4),e.search="",e.pathname=t.join("/"),e.href+"/components"}return"https://cdn.walkme.com"}const h="selfhosted";function b(){const e=function(){const e=p("walkme-sdk-version");return"local"===e?"local":e||"b20976a12625dca645a5278024e4d56c107591c9"}();if("local"===e)return"https://localhost:9902/dist/index.js";if("2"===m("sdk-version")){let t;t=g()?y():v()+"/sdk";return`${t+"/sdk-applications"}/${e}/index.js`}return v()+"/sdk/player"+"/1.0/main.js"}var k;let w,S;async function j({eventName:e,module:t,message:n,data:r,logLevel:o,extra:a}){if(g())return;(null==r?void 0:r.error)instanceof Error&&(r.error=JSON.parse(JSON.stringify(r.error,Object.getOwnPropertyNames(r.error))));try{await fetch("https://ec.walkme.com/event/log",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({app:"walkme-sdk",module:t,message:`${e}${n?": "+n:""}`,data:r,level:o,commit:"b20976a12625dca645a5278024e4d56c107591c9",sdkBranch:"davidsu-fix-types-publish",sessionId:w,userGuid:S,extra:a})})}catch(e){console.error(e)}}!function(e){e.INFO="info",e.ERROR="error",e.WARN="warn"}(k||(k={}));const O=e=>j(Object.assign(Object.assign({},e),{logLevel:k.WARN})),T=e=>j(Object.assign(Object.assign({},e),{logLevel:k.ERROR,extra:(new Error).stack})),I=(e="noSessionId")=>{w=e},_=(e="noUserGuid")=>{S=e};function P(){const e={},t=new Map;const n=(e,t)=>t.has(e)&&e&&(Array.isArray(e)||"object"==typeof e),r=(n,r,o)=>Array.isArray(n)?[]:"object"==typeof n&&n?{}:"function"==typeof n?function(n,r,o){if(t.has(n))return t.get(n);const a=`##function##${o}##${f()}`,s=n.bind(r);return e[a]=s,t.set(n,a),a}(n,r,Array.isArray(r)?"ANONYMOUS":o):n;function*o(e,t){if(Array.isArray(e))for(let n=0;n<e.length;n++)yield{obj:e[n],key:n,parent:t,originalParent:e};else if("object"==typeof e&&e)for(const n of function*(e){const t=Object.getOwnPropertyDescriptors(e);for(const e in t)"function"!=typeof t[e].get&&(yield e)}(e))yield{obj:e[n],parent:t,key:n,originalParent:e}}const a="not serializable: https://cdn.walkme.com/sdk/sdk-applications/2.0/docs/index.html#serialization";function s(e,t){return Array.isArray(e)?((e,t)=>e.map(e=>s(e,t)))(e,t):"object"==typeof e&&e?((e,t)=>Object.entries(e).reduce((e,[n,r])=>(e[n]=s(r,t),e),{}))(e,t):/^##function##/.test(e)?(...n)=>t(e,n):e}return{serialize:e=>{let t=0;const s=new Set,i={},u=function(){let e,t,n=0;return{shift:()=>{const t=null==e?void 0:e.item;return e=null==e?void 0:e.next,n=Math.max(n-1,0),t},push:r=>{n++;const o={item:r};e?(t.next=o,t=t.next):(e=o,t=o)},get length(){return n}}}();for(u.push({obj:e,key:"ANONYMOUS",parent:i,originalParent:{}});u.length;){if(t++,t+u.length>1e5)throw T({eventName:"Serializer",message:a,module:"sdk-utils"}),new Error(a);const{obj:e,parent:i,key:c,originalParent:l}=u.shift();if(!(c in i))if(n(e,s))i[c]="##CIRCULAR_OBJECT##";else{s.add(e);const t=r(e,l,c);i[c]=t;for(const n of o(e,t))u.push(n)}}return i.ANONYMOUS},deserialize:s,getFunction:t=>e[t]}}function A(e){const t=P(),n="__sdk__runtime__uniq__me"===e.name?e.name:`${e.name}##${f()}`,r={applicationId:n,messageType:d.request},o={applicationId:n,messageType:d.response},a={},s={},i=e=>t.getFunction(e)||a[e];function u({metadata:n,data:r}){let o;try{o=t.serialize(r)}catch(r){return n.messageType===d.response&&e.sendMessage({metadata:n,data:t.serialize(r)}),Promise.reject(r)}return e.sendMessage({metadata:n,data:o}),n.messageType===d.request?(a=n.messageId,new Promise((e,t)=>{s[a]={resolve:e,reject:t}})):Promise.resolve();var a}const c=(e="sdk_get_api")=>u({metadata:Object.assign(Object.assign({functionId:e,messageId:f()},r),{messageStackTrace:null}),data:[]}).then(e=>{const{userGuid:t,sessionId:n}=e;return t&&_(t),n&&I(n),e}),l=e=>{const t=e.sdk_get_api;if(t){const e=t();I(null==e?void 0:e.sessionId),_(null==e?void 0:e.userGuid)}Object.assign(a,e)};return e.receiveMessage((function(a){var c,l;if(!function(e){return e&&"object"==typeof e&&"metadata"in e&&"data"in e}(a))return;const{metadata:p,data:m}=a,{messageType:g,messageId:y,functionId:v,applicationId:h}=p;if(!function({requester:e,messageType:t,functionId:r,messageId:o}){return t===d.response?!!s[o]:e!==n&&!!i(r)}({requester:h,messageType:g,functionId:v,messageId:y}))return;const b=t.deserialize(m,(k=p,(e,t)=>u({metadata:Object.assign({messageStackTrace:k,functionId:e,messageId:f()},r),data:t})));var k;g===d.response?(p.error?(O({data:{metadata:p,messengerName:e.name},eventName:"rpc",message:"other side rejected",module:"sdk-runtime"}),null===(c=s[y])||void 0===c||c.reject(p)):null===(l=s[y])||void 0===l||l.resolve(b),delete s[y]):async function(e,n,r,a){const s=i(n);if(s){let i,c;try{const e=await s(...r);i=t.serialize(e)}catch(e){c=t.serialize(e)}u({metadata:Object.assign(Object.assign({messageId:e,functionId:n},o),{error:c,messageStackTrace:a}),data:i})}}(y,v,b,p)})),"undefined"!=typeof TESTING?{getApi:c,provideResolver:l,serializer:t,onmessages:s}:{getApi:c,provideResolver:l}}let x=globalThis.sdkInstance;(()=>{const e=null===(t=window._walkmeInternals)||void 0===t?void 0:t.__rpc_loader_resolver;var t;e&&e({rpc:A})})();var L=n(1);const E={name:"sdk-iframe-proxy-client",sendMessage:e=>{var t;return null===(t=R().contentWindow)||void 0===t?void 0:t.postMessage(e,"*")},receiveMessage:e=>{window.addEventListener("message",t=>{var n;(null===(n=t.data)||void 0===n?void 0:n.metadata)&&e(t.data)})}},R=()=>document.querySelector("#wm-channel");function C(){return new Promise(e=>{const t=document.createElement("iframe");t.id="wm-channel",t.src=Object(L.getPublicPath)()+"sdk-proxy.html?platform=web",t.style.display="none",t.addEventListener("load",()=>{const t=Object(L.rpc)(E).getApi();e(t)}),document.body.appendChild(t)})}var N=n(0);const M=(U=async function(e={mode:"common"}){try{return await("iframe"===e.mode?((null===(r=null===(n=null===(t=globalThis._walkmeInternals)||void 0===t?void 0:t.ctx)||void 0===n?void 0:n.get("FeaturesManager"))||void 0===r?void 0:r.isFeatureEnabled("playerSDKV2"))?z:C)():async function(){if(globalThis.sdkInstance)return globalThis.sdkInstance;const e=self;if(!e.__walkmeSDKLazyLoad){e.__walkmeSDKLazyLoad={},e.__walkmeSDKLazyLoad.promise=new Promise(t=>{e.__walkmeSDKLazyLoad.resolve=t,e.__walkmeSDKLazyLoad.reject=t});const t=document.createElement("script");t.src=""+b(),document.body.appendChild(t)}const t=await e.__walkmeSDKLazyLoad.promise;return await t.init(),globalThis.sdkInstance=t,t}())}catch(e){throw console.error(e),e}var t,n,r},{async init(...e){x=await U(...e)},get content(){return null==x?void 0:x.content},get settings(){return null==x?void 0:x.settings},get storage(){return null==x?void 0:x.storage},get conditions(){return null==x?void 0:x.conditions},get events(){return null==x?void 0:x.events},get language(){return null==x?void 0:x.language},get platform(){return null==x?void 0:x.platform},get apps(){return null==x?void 0:x.apps},get ui(){return null==x?void 0:x.ui},get services(){return null==x?void 0:x.services},get notifications(){return null==x?void 0:x.notifications}});var U;t.default=M;async function z(){return await new Promise(e=>{var t;const n=({data:t})=>{"WalkMeApplicationsLoader-PlayerSDKLoaded"===t&&(window.removeEventListener("message",n),e())};(null===(t=globalThis._walkmeInternals)||void 0===t?void 0:t.getPlayerSdk)?e():window.addEventListener("message",n)}),globalThis._walkmeInternals.getPlayerSdk()}}])})); | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@walkme/sdk", | ||
"version": "2.0.8-alpha.1", | ||
"version": "2.0.8-alpha.2", | ||
"description": "Player SDK", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1580696
105
8282